diff --git a/lean/OAI/Analysis/HardSphere/Kernels/TrialObserved.lean b/lean/OAI/Analysis/HardSphere/Kernels/TrialObserved.lean new file mode 100644 index 0000000000000000000000000000000000000000..4eaf6cea714692ae573977e8bb412f72d4a231ad --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Kernels/TrialObserved.lean @@ -0,0 +1,57 @@ +import Mathlib +import OAI.Analysis.HardSphere.Kernels.TrialKernel +import OAI.Analysis.HardSphere.Bridges.GaussianMixture +import OAI.Analysis.HardSphere.Conditioning.RouteObservation + +namespace OAI + +section + +section +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal +namespace HardSphere.Comparison +open Bridge Wiener GaussianPacking + +lemma trialKernel_midpoint (t : ℝ) (y z u : Point) : + ∀ᵐ ω ∂trialKernel t y z u,ω midpointTime=u := by + rw [trialKernel_apply] + apply (ae_map_iff ((trialPath_continuous t y z).measurable.comp + (measurable_const.prodMk measurable_id)).aemeasurable (measurableSet_eq_fun ((continuous_eval_const midpointTime).measurable : Measurable (fun ω : C(Time,Point) ↦ ω midpointTime)) measurable_const)).mpr + exact ae_of_all _ (fun β ↦ trial_midpoint t y z u β) + +lemma paired_trial_midpoint (μ : Measure Point) [SFinite μ] (t : ℝ) (y z y' z' : Point) + (S T : Set C(Time,Point)) (hS : MeasurableSet S) (hT : MeasurableSet T) : + ∀ᵐ p ∂pairedFactor μ (trialKernel t y z) (trialKernel t y' z') S T hS hT, + p.2.1 midpointTime=p.1 ∧ p.2.2 midpointTime=p.1 := by + apply pairedFactor_midpoint μ (trialKernel t y z) (trialKernel t y' z') + (fun ω ↦ ω midpointTime) (fun ω ↦ ω midpointTime) id + (continuous_eval_const midpointTime).measurable (continuous_eval_const midpointTime).measurable measurable_id + · exact ae_of_all _ (trialKernel_midpoint t y z) + · exact ae_of_all _ (trialKernel_midpoint t y' z') + +lemma route_observed_trial_eq {W : Type*} [MeasurableSpace W] (d : ℕ) + (τ : Fin (d+2) → Measure (Point×(C(Time,Point)×C(Time,Point)))) + [∀k,IsProbabilityMeasure (τ k)] (ξ : Measure W) [SFinite ξ] + (hτ : ∀k,∀ᵐ p ∂τ k,p.2.1 midpointTime=p.1 ∧ p.2.2 midpointTime=p.1) + (C : Set ((Fin (d+2) → Point×(C(Time,Point)×C(Time,Point)))×W)) : + ((((Measure.pi τ).prod ξ) C)⁻¹ • ((Measure.pi τ).prod ξ).restrict C).map + (observeFirst d (fun ω ↦ ω midpointTime)) = + ((((Measure.pi τ).prod ξ) C)⁻¹ • ((Measure.pi τ).prod ξ).restrict C).map + (observeSecond d (fun ω ↦ ω midpointTime)) := by + apply conditioned_observed_measures_eq + apply (Measure.ae_prod_iff_ae_ae (by measurability)).mpr + have h : ∀k,∀ᵐ v ∂Measure.pi τ,(v k).2.1 midpointTime=(v k).1 ∧ (v k).2.2 midpointTime=(v k).1 := + fun k ↦ (measurePreserving_eval τ k).quasiMeasurePreserving.ae (hτ k) + filter_upwards [ae_all_iff.mpr h] with v hv + exact ae_of_all _ (fun _ ↦ hv) + +end HardSphere.Comparison + +end +end + +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Main.lean b/lean/OAI/Analysis/HardSphere/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a2d1fc35dbfce61e520c824511b43a889f77319 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Main.lean @@ -0,0 +1,50 @@ +import Mathlib +import OAI.Analysis.HardSphere.FormDomain.AeSelfGradientSquare +import OAI.Analysis.HardSphere.FormDomain.AeGradientPhase +import OAI.Analysis.HardSphere.Conditioning.LintegralReferenceMeasure +import OAI.Analysis.HardSphere.Bridges.AccessibleAuxiliary +import OAI.Analysis.HardSphere.PathBounds.RegularVisitors +import OAI.Analysis.HardSphere.Collisions.InsertionProducer +import OAI.Analysis.HardSphere.Kernels.KernelPi +import OAI.Analysis.HardSphere.Kernels.ParametricTrial +import OAI.Analysis.HardSphere.PathBounds.UniformVisitMGF +import OAI.Analysis.HardSphere.Density.GroundProjection + +namespace OAI + +section + +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal BigOperators Topology +namespace HardSphere + +theorem condensation_all_ground_states : + ∃ε₀ c₀ : ℝ,0<ε₀ ∧ 0.sub contDiff_const) +lemma cutoff_nonneg (δ x : ℝ) : 0≤cutoff δ x := Real.smoothTransition.nonneg _ +lemma cutoff_le_one (δ x : ℝ) : cutoff δ x≤1 := Real.smoothTransition.le_one _ +lemma cutoff_zero {δ x : ℝ} (hδ : 0<δ) (hx : x≤δ/2) : cutoff δ x=0 := by + apply Real.smoothTransition.zero_of_nonpos + have hh : 2*x/δ≤1 := (div_le_one hδ).mpr (by linarith) + linarith +lemma cutoff_one {δ x : ℝ} (hδ : 0<δ) (hx : δ≤x) : cutoff δ x=1 := by + apply Real.smoothTransition.one_of_one_le + have hh : 2≤2*x/δ := (le_div_iff₀ hδ).mpr (by linarith) + linarith +lemma cutoff_error {δ x : ℝ} (hδ : 0<δ) (hx : 0≤x) : + ‖(1-cutoff δ x)^2*x‖≤δ := by + have hq := cutoff_nonneg δ x + have hq' := cutoff_le_one δ x + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (sq_nonneg _) hx)] + by_cases hh : δ≤x + · rw [cutoff_one hδ hh]; simpa using hδ.le + · have hx' : x≤δ := (lt_of_not_ge hh).le + have hs : (1-cutoff δ x)^2≤1 := by nlinarith + exact (mul_le_mul_of_nonneg_right hs hx).trans (by simpa using hx') + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +omit [CompleteSpace H] in +lemma finite_range_compact (F : H →L[ℂ] H) (W : Submodule ℂ H) + [FiniteDimensional ℂ W] (hW : ∀x,F x∈W) : IsCompactOperator F := by + have hh := isCompactOperator_of_locallyCompactSpace_dom (F.codRestrict W hW) + exact hh.clm_comp W.subtypeL + +lemma cutoff_compact {ι : Type*} (T : H →L[ℂ] H) (hT : IsSelfAdjoint T) + (v : ι→H) (r : ι→ℝ) + (hdense : (Submodule.span ℂ (range v)).topologicalClosure=⊤) + (heigen : ∀i,T (v i)=r i • v i) + (hfinite : ∀ε : ℝ,0<ε → {i | ε≤r i}.Finite) + {δ : ℝ} (hδ : 0<δ) : + IsCompactOperator (cfc (p:=IsSelfAdjoint) (cutoff δ) T : H →L[ℂ] H) := by + let S : Set ι := {i | δ/2≤r i} + have hS : S.Finite := hfinite _ (by positivity) + let W : Submodule ℂ H := Submodule.span ℂ (v '' S) + have : FiniteDimensional ℂ W := FiniteDimensional.span_of_finite ℂ (hS.image v) + apply finite_range_compact _ W + have hgen : Submodule.span ℂ (range v) ≤ + W.comap (cfc (p:=IsSelfAdjoint) (cutoff δ) T).toLinearMap := by + apply Submodule.span_le.mpr + rintro _ ⟨i,rfl⟩ + change cfc (p:=IsSelfAdjoint) (cutoff δ) T (v i)∈W + rw [cfc_eigen_apply T hT _ (cutoff_smooth δ).continuous _ + ((cutoff_smooth δ).differentiable (by norm_num)).differentiableAt _ (heigen i)] + by_cases hi : i∈S + · exact W.smul_mem _ (Submodule.subset_span ⟨i,hi,rfl⟩) + · have hr : r i≤δ/2 := (lt_of_not_ge hi).le + rw [cutoff_zero hδ hr,zero_smul] + exact W.zero_mem + have hclosed : IsClosed (W.comap (cfc (p:=IsSelfAdjoint) (cutoff δ) T).toLinearMap : Set H) := + W.closed_of_finiteDimensional.preimage (cfc (p:=IsSelfAdjoint) (cutoff δ) T).continuous + have hh := (Submodule.span ℂ (range v)).topologicalClosure_minimal hgen hclosed + rw [hdense] at hh + intro x + exact hh (Submodule.mem_top : x∈(⊤ : Submodule ℂ H)) + +end HardSphere.CompactForm + +namespace HardSphere.CompactForm +variable {G H : Type*} [NormedAddCommGroup G] [InnerProductSpace ℂ G] [CompleteSpace G] + [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +lemma cutoff_embedding_error (J : G →L[ℂ] H) (T : H →L[ℂ] H) + (hJT : J ∘L J.adjoint=T) (hT : T.IsPositive) (hTn : ‖T‖≤1) + {δ : ℝ} (hδ : 0<δ) : + ‖((1-cfc (p:=IsSelfAdjoint) (cutoff δ) T) : H →L[ℂ] H) ∘L J‖^2≤δ := by + let q : ℝ→ℝ := fun x ↦ 1-cutoff δ x + have hq : Continuous q := continuous_const.sub (cutoff_smooth δ).continuous + let Q : H →L[ℂ] H := cfc (p:=IsSelfAdjoint) q T + have hQ : Q=1-cfc (p:=IsSelfAdjoint) (cutoff δ) T := by + dsimp only [Q,q] + rw [cfc_sub _ _ T continuousOn_const (cutoff_smooth δ).continuous.continuousOn, + cfc_const 1 T hT.isSelfAdjoint,map_one] + have hQadj : Q.adjoint=Q := cfc_predicate q T + let E : G →L[ℂ] H := Q ∘L J + have hEE : E ∘L E.adjoint=Q*T*Q := by + change (Q ∘L J) ∘L (Q ∘L J).adjoint=Q*T*Q + rw [adjoint_comp,hQadj] + calc + _ = Q ∘L ((J ∘L J.adjoint) ∘L Q) := by simp only [comp_assoc] + _ = Q*T*Q := by rw [hJT]; rfl + have hcalc : Q*T*Q=cfc (p:=IsSelfAdjoint) (fun x : ℝ ↦ (1-cutoff δ x)^2*x) T := by + have hf : (fun x : ℝ ↦ (1-cutoff δ x)^2*x)=(fun x ↦ (q x*x)*q x) := by + funext x; dsimp only [q]; ring + rw [hf] + symm + calc + _ = cfc (p:=IsSelfAdjoint) (fun x : ℝ ↦ q x*x) T * cfc q T := + cfc_mul (fun x : ℝ ↦ q x*x) q T (hq.mul continuous_id).continuousOn hq.continuousOn + _ = (cfc q T * cfc (p:=IsSelfAdjoint) id T) * cfc q T := by + congr 1 + exact cfc_mul q id T hq.continuousOn continuous_id.continuousOn + _ = Q*T*Q := by + change cfc q T * cfc (p:=IsSelfAdjoint) (fun x : ℝ ↦ x) T * cfc q T = _ + rw [cfc_id' ℝ T hT.isSelfAdjoint] + have hb : ‖E ∘L E.adjoint‖≤δ := by + rw [hEE,hcalc] + apply norm_cfc_le hδ.le + intro spectralValue hmem + have hnonneg := spectrum_nonneg_of_nonneg + (ContinuousLinearMap.nonneg_iff_isPositive.mpr hT) hmem + by_cases hlarge : 1 ≤ δ + · have hbound : spectralValue ≤ 1 := (le_abs_self _).trans + ((spectrum.norm_le_norm_mul_of_mem hmem).trans + ((mul_le_of_le_one_right (norm_nonneg T) norm_id_le).trans hTn)) + have hcutoff : (1-cutoff δ spectralValue)^2 ≤ 1 := by + nlinarith [cutoff_nonneg δ spectralValue, cutoff_le_one δ spectralValue] + rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (sq_nonneg _) hnonneg)] + exact (mul_le_of_le_one_left hnonneg hcutoff).trans (hbound.trans hlarge) + · exact cutoff_error hδ hnonneg + have hn := norm_adjoint_comp_self E.adjoint + rw [adjoint_adjoint,LinearIsometryEquiv.norm_map] at hn + rw [hn] at hb + change ‖Q ∘L J‖*‖Q ∘L J‖≤δ at hb + rw [hQ] at hb + simpa only [sq] using hb + +lemma compact_embedding {ι : Type*} (J : G →L[ℂ] H) (T : H →L[ℂ] H) + (hJT : J ∘L J.adjoint=T) (hT : T.IsPositive) (hTn : ‖T‖≤1) + (v : ι→H) (r : ι→ℝ) + (hdense : (Submodule.span ℂ (range v)).topologicalClosure=⊤) + (heigen : ∀i,T (v i)=r i • v i) + (hfinite : ∀ε : ℝ,0<ε → {i | ε≤r i}.Finite) : IsCompactOperator J := by + have hclosed : IsClosed {F : G →L[ℂ] H | IsCompactOperator F} := isClosed_setOfPred_isCompactOperator + apply hclosed.closure_subset + rw [Metric.mem_closure_iff] + intro ε hε + let δ : ℝ := ε^2/4 + have hδ : 0<δ := by dsimp only [δ]; positivity + let F : H →L[ℂ] H := cfc (p:=IsSelfAdjoint) (cutoff δ) T + have hF : IsCompactOperator F := cutoff_compact T hT.isSelfAdjoint v r hdense heigen hfinite hδ + refine ⟨F ∘L J,hF.comp_clm J,?_⟩ + rw [dist_eq_norm] + have heq : J-F ∘L J=(1-F) ∘L J := by ext x; simp + rw [heq] + have hh := cutoff_embedding_error J T hJT hT hTn hδ + change ‖(1-F) ∘L J‖^2≤δ at hh + have hn := norm_nonneg ((1-F) ∘L J) + dsimp only [δ] at hh + nlinarith + +end HardSphere.CompactForm +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Operators/FormResolventNormEnergy.lean b/lean/OAI/Analysis/HardSphere/Operators/FormResolventNormEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..22d6df42da91ef6b45c48870b7fcc739418ca858 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Operators/FormResolventNormEnergy.lean @@ -0,0 +1,99 @@ +import Mathlib +import OAI.Analysis.HardSphere.Operators.KilledTransitionFormHeat +import OAI.Analysis.HardSphere.Collisions.IteratedInsertion + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology BigOperators +open scoped BigOperators ComplexConjugate +open MeasureTheory ProbabilityTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators +open MeasureTheory ProbabilityTheory Real Complex +open scoped ENNReal ComplexConjugate +open ProbabilityTheory +namespace HardSphere +open ContinuousLinearMap + +lemma formResolvent_norm_le_of_energy {N : ℕ} {L : Length} {a b : ℝ} + (hb : 0≤b) (henergy : ∀ u : Jet N L, u∈dirichletDomain N L a → b*‖u.1‖^2≤energy u) : + ‖formResolvent N L a‖≤(1+b)⁻¹ := by + have hp : 0<1+b := by linarith + apply opNorm_le_bound _ (inv_nonneg.mpr hp.le) + intro f + let g := (scalarEmbedding N L a).adjoint f + let u := hilbertJetEquiv N L (g : HilbertJet N L) + have hu : u∈dirichletDomain N L a := g.property + have he := henergy u hu + have hn : ‖g‖^2=‖u.1‖^2+energy u := hilbertJet_norm_sq (g : HilbertJet N L) + have hinner : ‖g‖^2=(inner ℂ f u.1).re := by + rw [norm_sq_eq_re_inner (𝕜 := ℂ)] + exact congrArg Complex.re (adjoint_inner_left (scalarEmbedding N L a) g f) + have hbound : (1+b)*‖u.1‖^2≤‖f‖*‖u.1‖ := by + have hi := re_inner_le_norm (𝕜 := ℂ) f u.1 + change (inner ℂ f u.1).re≤‖f‖*‖u.1‖ at hi + nlinarith + change ‖u.1‖≤(1+b)⁻¹*‖f‖ + by_cases hz : ‖u.1‖=0 + · rw [hz]; positivity + · have hupos : 0<‖u.1‖ := lt_of_le_of_ne (norm_nonneg _) (Ne.symm hz) + rw [← div_eq_inv_mul,le_div_iff₀ hp] + nlinarith + +local instance scalarOperatorRealAlgebraCoercive (N : ℕ) (L : Length) : + Algebra ℝ (ScalarL2 N L →L[ℂ] ScalarL2 N L) := Algebra.restrictScalars ℝ ℂ _ + +lemma formHeat_norm_le_of_energy {N : ℕ} {L : Length} {a b t : ℝ} (ht : 0 + let := h + rw [show formHeat N L a t=0 from Subsingleton.elim _ _,norm_zero] + exact (Real.exp_pos _).le + | inr h => + let := h + by_cases hb : 0≤b + · have hp : 0<1+b := by linarith + have hR := formResolvent_norm_le_of_energy hb henergy + unfold formHeat + apply norm_cfc_le (Real.exp_pos _).le + intro x hx + have hx0 : 0≤x := spectrum_nonneg_of_nonneg + (ContinuousLinearMap.nonneg_iff_isPositive.mpr (formResolvent_isPositive N L a)) hx + have hxb : x≤(1+b)⁻¹ := (Real.le_norm_self x).trans ((spectrum.norm_le_norm_of_mem hx).trans hR) + rw [Real.norm_eq_abs,abs_of_nonneg (heatScalar_nonneg t x)] + rcases eq_or_lt_of_le hx0 with rfl | hx0 + · rw [heatScalar_zero]; exact (Real.exp_pos _).le + · rw [heatScalar_of_pos ht hx0] + apply Real.exp_le_exp.mpr + have hxinv : 1+b≤x⁻¹ := by + simpa only [inv_inv] using (inv_le_inv₀ (inv_pos.mpr hp) hx0).mpr hxb + have hg := mul_le_mul_of_nonneg_left hxinv ht.le + rw [div_eq_mul_inv] + linarith + · have hnorm : ‖formHeat N L a t‖≤1 := by + rw [formHeat,← regularHeat_pos (formResolvent N L a) ht] + exact regularHeat_contract (formResolvent_isPositive N L a) (formResolvent_norm_le_one N L a) t + exact hnorm.trans (Real.one_le_exp (mul_nonneg_of_nonpos_of_nonpos (by linarith) (le_of_not_ge hb))) +lemma killedTransition_norm_le_of_energy {N : ℕ} {L : Length} {a b t : ℝ} (ht : 0.mono (Icc_subset_Ici_self : Icc (0:ℝ) t ⊆ Ici 0)) + (fun s hs ↦ (hdz s hs.1).norm_sq) + (by simp [z,hw0]) continuousOn_const (fun s _ ↦ hasDerivWithinAt_const s _ _) + (fun s hs ↦ mul_nonpos_of_nonneg_of_nonpos (by norm_num) (hnonpos s hs.1)) + (x := t) ⟨ht,le_refl _⟩ + have hz : z t=0 := norm_eq_zero.mp (by nlinarith [norm_nonneg (z t)]) + have hw : w t=0 := by + change Real.exp (-t) • w t=0 at hz + exact (smul_eq_zero.mp hz).resolve_left (ne_of_gt (Real.exp_pos _)) + exact sub_eq_zero.mp hw + +omit [Nontrivial F] in +lemma semigroupLaplace_kernel (K : ℝ → F→L[ℂ] F) + (hadd : ∀ s t, 0 ≤ s → 0 ≤ t → K (s+t)=(K s).comp (K t)) + (hc : ∀ f, Continuous (fun t : ℝ ↦ K (max 0 t) f)) + (hnorm : ∀ t, 0 ≤ t → ∀ f, ‖K t f‖≤‖f‖) (f : F) + (he : semigroupLaplace K f=0) {t : ℝ} (ht : 0 ≤ t) : K t f=0 := by + have hh := semigroupLaplace_difference_tendsto K hadd hc hnorm f + simp only [he,map_zero,sub_self,smul_zero,sub_zero] at hh + have hz : K 0 f=0 := (tendsto_nhds_unique tendsto_const_nhds hh).symm + have hp := congrArg (fun T : F→L[ℂ] F ↦ T f) (hadd t 0 ht (le_refl 0)) + simpa only [add_zero,comp_apply,hz,map_zero] using hp + +lemma semigroup_eq_heat (K : ℝ → F→L[ℂ] F) + (hadd : ∀ s t, 0 ≤ s → 0 ≤ t → K (s+t)=(K s).comp (K t)) + (hc : ∀ f, Continuous (fun t : ℝ ↦ K (max 0 t) f)) + (hnorm : ∀ t, 0 ≤ t → ∀ f, ‖K t f‖≤‖f‖) + (hKs : ∀ t, IsSelfAdjoint (K t)) + (R : F→L[ℂ] F) (hRp : R.IsPositive) (hRn : ‖R‖≤1) + (hR : ∀ f, semigroupLaplace K f=R f) {t : ℝ} (ht : 0 simp [h,hω] + have heq : inner ℂ (modulusScalar u.1) + (weightedKilledTransition N L a (s+t) (h ∘ configurationPrefix N L (splitTime s t hs ht)) hhp + (modulusScalar u.1)) = + (Real.exp (-t*energy u):ℂ)*inner ℂ (modulusScalar u.1) + (weightedKilledTransition N L a s h hhs (modulusScalar u.1)) := by + rw [weightedKilledTransition_prefix N L a s t hs ht hh hhs hhp zero_le_one hb, + ContinuousLinearMap.comp_apply] + have he := hu.modulus.killed_eigenvector ht.le + change killedTransition N L a t (modulusScalar u.1)= + (Real.exp (-t*energy (modulusJet u)):ℂ) • modulusScalar u.1 at he + rw [hu.energy_modulus] at he + rw [he,map_smul,inner_smul_right] + have hp : h ∘ configurationPrefix N L (splitTime s t hs ht)= + ((configurationPrefix N L (splitTime s t hs ht)) ⁻¹' S).indicator (fun _ ↦ (1:ℂ)) := by + ext ω + rfl + apply Complex.ofReal_injective + rw [Complex.ofReal_mul,← weightedKilledTransition_indicator_pairing (a := a) s u.1 u.1 hS, + ← weightedKilledTransition_indicator_pairing (a := a) (s+t) u.1 u.1 + (hS.preimage (configurationPrefix_continuous N L _).measurable)] + simpa only [hp] using heq + +lemma IsGroundVector.groundPathLaw_prefix {u : Jet N L} (hu : IsGroundVector N L a u) + (s t : ℝ) (hs : 0 rw [← centerLift_coe L x, pairQ_coe] + +lemma bump_smooth (L : Length) (δ : ℝ) (x : Torus L) : + ContDiff ℝ ((⊤:ℕ∞):WithTop ℕ∞) + (fun R : LiftedConfiguration 1 ↦ (bump L δ x (project 1 L R 0) : ℂ)) := by + simp_rw [bump_project] + exact Complex.ofRealCLM.contDiff.comp ((Real.contDiff_cos.comp + (TightCutoff.angleLift_smooth L.val δ)).comp ((contDiff_apply ℝ (Fin 3 → ℝ) 0).sub contDiff_const)) + +def raw (L : Length) (δ : ℝ) (x : Torus L) : SmoothMultiplier 1 L := + .ofSmooth (fun X ↦ (bump L δ x (X 0) : ℂ)) (bump_smooth L δ x) + +lemma bump_continuous (L : Length) (δ : ℝ) (x : Torus L) : Continuous (bump L δ x) := by + unfold bump TightCutoff.angle + exact Real.continuous_cos.comp (continuous_const.mul (Real.smoothTransition.continuous.comp + (((pairQ_continuous L.val).comp (continuous_id.prodMk continuous_const)).sub + continuous_const |>.div_const _))) + +lemma bump_bounds (L : Length) (δ : ℝ) (x y : Torus L) : 0 ≤ bump L δ x y ∧ bump L δ x y ≤ 1 := by + refine ⟨?_,Real.cos_le_one _⟩ + apply Real.cos_nonneg_of_mem_Icc + exact ⟨by linarith [(TightCutoff.angle_bounds L.val δ y x).1,Real.pi_pos], + (TightCutoff.angle_bounds L.val δ y x).2⟩ + +lemma bump_eq_one {L : Length} {δ : ℝ} (hδ : 0<δ) (x : Torus L) {y : Torus L} + (hy : y∈box L.val (δ/2) x) : bump L δ x y=1 := by + have hd j : dist (y j) (x j) ≤ δ/2 := (Set.mem_univ_pi.mp hy) j + have hq := pairQ_le L.val y x + have hs : (∑ j : Fin 3, dist (y j) (x j)^2) ≤ 3*(δ/2)^2 := by + calc + _ ≤ ∑ _j : Fin 3, (δ/2)^2 := Finset.sum_le_sum fun j _ ↦ + (sq_le_sq₀ dist_nonneg (by positivity)).mpr (hd j) + _ = _ := by simp + unfold bump + rw [TightCutoff.angle_zero L.val hδ (by nlinarith), Real.cos_zero] + +lemma bump_eq_zero {L : Length} {δ : ℝ} (hδ : 0<δ) (x : Torus L) {y : Torus L} + (hy : y∉TightCutoff.near L.val δ x) : bump L δ x y=0 := by + rw [bump,TightCutoff.angle_one_outside L.val hδ hy,Real.cos_pi_div_two] + +lemma bump_support {L : Length} {δ : ℝ} (hδ : 0<δ) (x : Torus L) : + tsupport (bump L δ x) ⊆ TightCutoff.near L.val δ x := by + apply closure_minimal + · intro y hy + by_contra hn + exact hy (bump_eq_zero hδ x hn) + · exact isClosed_le ((pairQ_continuous L.val).comp + (continuous_id.prodMk continuous_const)) continuous_const + +lemma box_volume_eq {L : Length} {b : ℝ} (hb : 0 ≤ b) (hbL : 2*b ≤ L.val) (x : Torus L) : + volume.real (box L.val b x)=(2*b)^3 := by + have he : volume (box L.val b x)=ENNReal.ofReal (min L.val (2*b))^3 := by + rw [volume_pi,box,Measure.pi_pi] + simp_rw [AddCircle.volume_closedBall] + simp + rw [measureReal_def,he,min_eq_right hbL,ENNReal.toReal_pow, + ENNReal.toReal_ofReal (by positivity)] + +def mass (L : Length) (δ : ℝ) (x : Torus L) : ℝ := ∫ y : Torus L, (bump L δ x y)^2 + +lemma mass_lower {L : Length} {δ : ℝ} (hδ : 0<δ) (hδL : δ ≤ L.val) (x : Torus L) : + δ^3 ≤ mass L δ x := by + have hi : Integrable (fun y : Torus L ↦ (bump L δ x y)^2) volume := + ((bump_continuous L δ x).pow 2).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + calc + _ = volume.real (box L.val (δ/2) x) := by rw [box_volume_eq (by positivity) (by linarith)]; ring + _ = ∫ y in box L.val (δ/2) x, (bump L δ x y)^2 := by + rw [setIntegral_congr_fun (box_measurable _ _ _) (fun y hy ↦ by rw [bump_eq_one hδ x hy])] + simp + _ ≤ mass L δ x := setIntegral_le_integral hi (Filter.Eventually.of_forall fun _ ↦ sq_nonneg _) + +lemma mass_pos {L : Length} {δ : ℝ} (hδ : 0<δ) (hδL : δ ≤ L.val) (x : Torus L) : + 0 < mass L δ x := lt_of_lt_of_le (by positivity) (mass_lower hδ hδL x) + +lemma raw_fderiv (L : Length) (δ : ℝ) (x : Torus L) (R v : LiftedConfiguration 1) : + fderiv ℝ (fun R ↦ (raw L δ x).toFun (project 1 L R)) R v = + ((-Real.sin (TightCutoff.angleLift L.val δ (R 0-centerLift L x)) * + ∑ j : Fin 3, TightCutoff.anglePartial L.val δ (R 0-centerLift L x) j*v 0 j : ℝ) : ℂ) := by + have hd : HasDerivAt (fun t : ℝ ↦ R+t • v) v 0 := by + simpa using ((hasDerivAt_id (0:ℝ)).smul_const v).const_add R + have hf := ((((raw L δ x).smooth).differentiable (by simp)) R).hasFDerivAt.comp_hasDerivAt_of_eq 0 hd (by simp) + have ha := TightCutoff.angleLift_derivative L.val δ + (fun j t ↦ R 0 j+t*v 0 j-centerLift L x j) (fun j ↦ v 0 j) 0 (fun j ↦ by + convert ((((hasDerivAt_id (0:ℝ)).mul_const (v 0 j)).const_add (R 0 j)).sub_const (centerLift L x j)) using 1 <;> first | rfl | simp only [one_mul]) + have hb := Complex.ofRealCLM.hasFDerivAt.comp_hasDerivAt 0 ha.cos + have he : ((fun R ↦ (raw L δ x).toFun (project 1 L R)) ∘ fun t : ℝ ↦ R+t • v) = + (fun t : ℝ ↦ (Real.cos (TightCutoff.angleLift L.val δ + (fun j ↦ R 0 j+t*v 0 j-centerLift L x j)) : ℂ)) := by + funext t + exact congrArg Complex.ofReal (bump_project L δ x (R+t • v)) + rw [he] at hf + convert hf.unique hb using 1 + simp only [zero_mul,add_zero,Complex.ofRealCLM_apply] + rfl + +lemma raw_partial (L : Length) (δ : ℝ) (x y : Torus L) (j : Fin 3) : + coordDerivative 1 L (raw L δ x).toFun (0,j) (fun _ ↦ y)= + ((-Real.sin (TightCutoff.angleLift L.val δ (centerLift L y-centerLift L x)) * + TightCutoff.anglePartial L.val δ (centerLift L y-centerLift L x) j : ℝ) : ℂ) := by + rw [coordDerivative,raw_fderiv] + change (Complex.ofReal (-Real.sin _ * ∑ k : Fin 3, _ * (Pi.single j (1:ℝ)) k)) = _ + simp only [Pi.single_apply,mul_ite,mul_one,mul_zero,Finset.sum_ite_eq',Finset.mem_univ,ite_true] + rfl + +lemma raw_partial_sq_le {L : Length} {δ M : ℝ} (hδ : 0<δ) (hM : 0 ≤ M) + (hb : ∀ t : ℝ, |deriv Real.smoothTransition t| ≤ M) (x y : Torus L) (j : Fin 3) : + ‖coordDerivative 1 L (raw L δ x).toFun (0,j) (fun _ ↦ y)‖^2 ≤ 24*Real.pi^2*M^2/δ^2 := by + rw [raw_partial,Complex.norm_real,Real.norm_eq_abs,sq_abs,mul_pow,neg_sq] + calc + _ ≤ 1*(TightCutoff.anglePartial L.val δ (centerLift L y-centerLift L x) j)^2 := by + gcongr + exact Real.sin_sq_le_one _ + _ ≤ _ := by simpa using TightCutoff.anglePartial_sq_le L.val hδ hM hb (centerLift L y-centerLift L x) j + +lemma raw_partial_zero {L : Length} {δ : ℝ} (hδ : 0<δ) (x y : Torus L) (j : Fin 3) + (hy : y∉TightCutoff.near L.val δ x) : + coordDerivative 1 L (raw L δ x).toFun (0,j) (fun _ ↦ y)=0 := by + have he : qLift L.val (centerLift L y-centerLift L x)=pairQ L.val y x := by + rw [← pairQ_coe,centerLift_coe,centerLift_coe] + have hn : qLift L.val (centerLift L y-centerLift L x)∉Icc ((5/4)*δ^2) ((3/2)*δ^2) := by + rw [he] + exact fun h ↦ hy h.2 + rw [raw_partial,TightCutoff.anglePartial_eq_zero L.val hδ hn,mul_zero,Complex.ofReal_zero] + +lemma raw_energy_le {L : Length} {δ M : ℝ} (hδ : 0<δ) (hM : 0 ≤ M) + (hb : ∀ t : ℝ, |deriv Real.smoothTransition t| ≤ M) (x : Torus L) : + (raw L δ x).orbitalEnergy ≤ 3*(24*Real.pi^2*M^2/δ^2)*(4*δ)^3 := by + have hpart (j : Fin 3) : + (∫ y : Torus L, ‖coordDerivative 1 L (raw L δ x).toFun (0,j) (fun _ ↦ y)‖^2) ≤ + (24*Real.pi^2*M^2/δ^2)*(4*δ)^3 := by + let f := fun y : Torus L ↦ ‖coordDerivative 1 L (raw L δ x).toFun (0,j) (fun _ ↦ y)‖^2 + have hf : Continuous f := ((continuous_coordDerivative (raw L δ x).smooth (0,j)).comp + (continuous_pi fun _ ↦ continuous_id)).norm.pow 2 + have hi : Integrable f volume := hf.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + have he : (∫ y, f y) = ∫ y in TightCutoff.near L.val δ x, f y := by + symm + apply setIntegral_eq_integral_of_forall_compl_eq_zero + intro y hy + simp [f,raw_partial_zero hδ x y j hy] + rw [he] + calc + _ ≤ ∫ _y in TightCutoff.near L.val δ x, (24*Real.pi^2*M^2/δ^2) := + setIntegral_mono_on hi.integrableOn (integrableOn_const) (TightCutoff.near_measurable _ _ _) + (fun y _ ↦ raw_partial_sq_le hδ hM hb x y j) + _ = volume.real (TightCutoff.near L.val δ x)*(24*Real.pi^2*M^2/δ^2) := by simp + _ ≤ _ := by + simpa only [mul_comm] using mul_le_mul_of_nonneg_right (TightCutoff.near_volume_le L.val hδ x) + (show 0 ≤ 24*Real.pi^2*M^2/δ^2 by positivity) + unfold SmoothMultiplier.orbitalEnergy + calc + _ ≤ ∑ _j : Fin 3, (24*Real.pi^2*M^2/δ^2)*(4*δ)^3 := Finset.sum_le_sum fun j _ ↦ hpart j + _ = _ := by simp; ring + +def normalized (L : Length) (δ : ℝ) (x : Torus L) : SmoothMultiplier 1 L := + .ofSmooth (fun X ↦ (((Real.sqrt (mass L δ x))⁻¹ : ℝ) : ℂ)*(raw L δ x).toFun X) + (contDiff_const.mul (raw L δ x).smooth) + +lemma normalized_real (L : Length) (δ : ℝ) (x : Torus L) (X : Configuration 1 L) : + conj ((normalized L δ x).toFun X)=(normalized L δ x).toFun X := by + simp [normalized,raw,SmoothMultiplier.ofSmooth] + +lemma normalized_norm_sq {L : Length} {δ : ℝ} (hδ : 0<δ) (hδL : δ ≤ L.val) (x y : Torus L) : + ‖(normalized L δ x).orbital y‖^2=(mass L δ x)⁻¹*(bump L δ x y)^2 := by + change ‖(((Real.sqrt (mass L δ x))⁻¹ : ℝ) : ℂ)*(bump L δ x y : ℂ)‖^2 = _ + rw [norm_mul,mul_pow,Complex.norm_real,Real.norm_eq_abs,sq_abs,Complex.norm_real,Real.norm_eq_abs,sq_abs, + inv_pow,Real.sq_sqrt (mass_pos hδ hδL x).le] + +lemma normalized_mass {L : Length} {δ : ℝ} (hδ : 0<δ) (hδL : δ ≤ L.val) (x : Torus L) : + (∫ y : Torus L, ‖(normalized L δ x).orbital y‖^2)=1 := by + simp_rw [normalized_norm_sq hδ hδL] + rw [integral_const_mul] + exact inv_mul_cancel₀ (mass_pos hδ hδL x).ne' + +lemma normalized_support {L : Length} {δ : ℝ} (hδ : 0<δ) (x : Torus L) : + tsupport (normalized L δ x).orbital ⊆ TightCutoff.near L.val δ x := by + apply closure_minimal + · intro y hy + by_contra hn + apply hy + change (((Real.sqrt (mass L δ x))⁻¹ : ℝ) : ℂ)*(bump L δ x y : ℂ)=0 + rw [bump_eq_zero hδ x hn,Complex.ofReal_zero,mul_zero] + · exact isClosed_le ((pairQ_continuous L.val).comp + (continuous_id.prodMk continuous_const)) continuous_const + +lemma normalized_bound {L : Length} {δ : ℝ} (hδ : 0<δ) (hδL : δ ≤ L.val) (x : Torus L) : + (normalized L δ x).orbitalBound ≤ (δ^3)⁻¹ := by + have hs : 0 linarith [ht.1,ht.2,hs.1,hs.2] + have hd : dist (gridCenter L v j) (gridCenter L w j)<1 := by + rw [dist_eq_norm,he] + exact lt_of_le_of_lt (QuotientAddGroup.norm_mk_le_norm (m:=t-s)) (by simpa only [Real.norm_eq_abs] using ha) + exact (not_lt_of_ge (fin_circle_dist hL hj)) hd + +lemma gridHome_eq_iff {K : ℕ} {L : Length} (hL : L.val=(K:ℝ)) (hK : 1≤K) + (x : Torus L) (v : Fin 3→Fin K) : gridHome hL x=v ↔ x∈centeredCell L (gridCenter L v) := by + constructor + · intro h; exact h ▸ gridHome_mem hL hK x + · intro hx + by_contra h + exact Set.disjoint_left.mp (centeredCell_disjoint hL hK h) (gridHome_mem hL hK x) hx + +end HardSphere.CellOrbital + +end +end + +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Orbitals/CenteredCell.lean b/lean/OAI/Analysis/HardSphere/Orbitals/CenteredCell.lean new file mode 100644 index 0000000000000000000000000000000000000000..654643d459055a2c03fb4a036a6374c0ee4bb462 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Orbitals/CenteredCell.lean @@ -0,0 +1,209 @@ +import Mathlib +import OAI.Analysis.HardSphere.Geometry.GroundPositionLaw + +namespace OAI + +section +section +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology BigOperators +noncomputable section +open scoped BigOperators ComplexConjugate +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators +noncomputable section +open MeasureTheory ProbabilityTheory Real Complex +open scoped ENNReal ComplexConjugate +open ProbabilityTheory +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology +noncomputable section +open MeasureTheory Set +open scoped ENNReal +namespace HardSphere.CellOrbital +open MeasureTheory Set Filter +noncomputable section + +def centeredCell (L : Length) (c : Torus L) : Set (Torus L) := + {x | ∀ j, ((AddCircle.equivIco L.val (-L.val/2)) (x j-c j)).val ∈ Ico (-1/2:ℝ) (1/2)} + +lemma centeredCell_measurable (L : Length) (c : Torus L) : MeasurableSet (centeredCell L c) := by + simp only [centeredCell,Set.ofPred_forall] + apply MeasurableSet.iInter + intro j + exact measurableSet_Ico.preimage (measurable_subtype_coe.comp + ((AddCircle.measurableEquivIco L.val (-L.val/2)).measurable.comp + ((measurable_pi_apply j).sub measurable_const))) + +lemma centered_rep_abs (L : Length) (x : AddCircle L.val) : + |((AddCircle.equivIco L.val (-L.val/2)) x).val|=‖x‖ := by + let t := (AddCircle.equivIco L.val (-L.val/2)) x + have ht : |t.val| ≤ |L.val|/2 := by + rw [abs_of_pos L.property,abs_le] + constructor <;> linarith [t.property.1,t.property.2] + have he := (AddCircle.norm_coe_eq_abs_iff L.val L.property.ne').mpr ht + rw [AddCircle.coe_equivIco] at he + exact he.symm + +lemma chi_support_centeredCell (L : Length) (c x : Torus L) (hx : chi L (1/100) c x≠0) : + x∈centeredCell L c := by + have hnb : bump L (8*(1/100)) c x≠0 := by + intro he + apply hx + simp only [chi,he,zero_pow (by norm_num : (2:ℕ)≠0)] + have hb := bump_support (by norm_num : (0:ℝ)<8*(1/100)) c (subset_closure hnb) + have hb' := TightCutoff.near_subset_box L.val (by norm_num : (0:ℝ)<8*(1/100)) c hb + intro j + have hj : dist (x j) (c j) ≤ 2*(8*(1/100)) := Set.mem_univ_pi.mp hb' j + have ht : |((AddCircle.equivIco L.val (-L.val/2)) (x j-c j)).val| ≤ 2*(8*(1/100)) := by + rw [centered_rep_abs,← dist_eq_norm] + exact hj + obtain ⟨hl,hu⟩ := abs_le.mp ht + constructor <;> linarith + +noncomputable def centeredCount {n : ℕ} (L : Length) (c : Torus L) (X : Configuration n L) : ℕ := + by classical exact (Finset.univ.filter (fun i ↦ X i∈centeredCell L c)).card + +lemma centeredCount_measurable {n : ℕ} (L : Length) (c : Torus L) : + Measurable (centeredCount (n:=n) L c) := by + classical + unfold centeredCount + simp_rw [Finset.card_eq_sum_ones,Finset.sum_filter] + apply Finset.measurable_sum + intro i _ + exact Measurable.ite ((centeredCell_measurable L c).preimage (measurable_pi_apply i)) + measurable_const measurable_const + +lemma count_le_centeredCount {n : ℕ} (L : Length) (c : Torus L) (X : Configuration n L) : + count L (1/100) c X ≤ (centeredCount L c X:ℝ) := by + classical + change (∑ i, chi L (1/100) c (X i)) ≤ ((Finset.univ.filter (fun i ↦ X i∈centeredCell L c)).card:ℝ) + rw [Finset.card_eq_sum_ones] + push_cast + rw [Finset.sum_filter] + apply Finset.sum_le_sum + intro i _ + by_cases hi : X i∈centeredCell L c + · simpa only [ite_eq_left hi] using (chi_bounds L (1/100) c (X i)).2 + · rw [ite_eq_right hi] + have hz : chi L (1/100) c (X i)=0 := by + by_contra hh + exact hi (chi_support_centeredCell L c (X i) hh) + exact hz.le + +theorem scaled_centered_low_counts : ∃ α₀ ell D₀ Q : ℝ, + 0<α₀ ∧ 0 linarith [ht.1,ht.2] + rw [← he,AddCircle.equivIco_coe_eq ht'] + exact ht + +def gridCenter {K : ℕ} (L : Length) (v : Fin 3 → Fin K) : Torus L := + fun j ↦ ((v j:ℝ) : AddCircle L.val) + +lemma fin_circle_dist {K : ℕ} {L : Length} (hL : L.val=(K:ℝ)) {v w : Fin K} (hvw : v≠w) : + 1 ≤ dist ((v:ℝ) : AddCircle L.val) ((w:ℝ) : AddCircle L.val) := by + have hi (v : Fin K) : (v:ℝ)∈Ico (0:ℝ) (0+L.val) := by + constructor + · positivity + · simpa only [zero_add,hL] using (show (v:ℝ)<(K:ℝ) by exact_mod_cast v.isLt) + have hne : ((v:ℝ):AddCircle L.val)≠((w:ℝ):AddCircle L.val) := by + intro he + have he' := (AddCircle.coe_eq_coe_iff_of_mem_Ico (hi v) (hi w)).mp he + exact hvw (Fin.ext (by exact_mod_cast he')) + let z : ℤ := (v.val:ℤ)-(w.val:ℤ)-round (L.val⁻¹*((v:ℝ)-(w:ℝ)))*(K:ℤ) + have hd : dist ((v:ℝ):AddCircle L.val) ((w:ℝ):AddCircle L.val)=|(z:ℝ)| := by + rw [dist_eq_norm,← QuotientAddGroup.mk_sub,AddCircle.norm_eq] + dsimp [z] + push_cast + rw [hL] + have hz : z≠0 := by + intro hz + apply hne + apply dist_eq_zero.mp + rw [hd,hz,Int.cast_zero,abs_zero] + have ha : (1:ℤ)≤|z| := by + have hh : 0 < |z| := abs_pos.mpr hz + omega + rw [hd,← Int.cast_abs] + exact_mod_cast ha + +lemma gridCenter_separated {K : ℕ} {L : Length} (hL : L.val=(K:ℝ)) : + ∀ z v : Fin 3 → Fin K, z≠v → 1 ≤ dist (gridCenter L z) (gridCenter L v) := by + intro z v hzv + obtain ⟨j,hj⟩ : ∃ j, z j≠v j := by + by_contra hh + push Not at hh + exact hzv (funext hh) + exact (fin_circle_dist hL hj).trans (dist_le_pi_dist (gridCenter L z) (gridCenter L v) j) + +theorem grid_low_count_probability : ∃ α₀ ell D₀ Q : ℝ, + 0<α₀ ∧ 0.trans (by nlinarith [norm_nonneg (v x)]) + +def fieldApply (v : Lp E 2 μ) : Lp F 2 μ := + (field_memLp A hA hbound v).toLp _ + +lemma coe_fieldApply (v : Lp E 2 μ) : + fieldApply A hA hbound v =ᵐ[μ] fun x ↦ A x (v x) := + MemLp.coeFn_toLp _ + +lemma norm_fieldApply_le (v : Lp E 2 μ) : ‖fieldApply A hA hbound v‖ ≤ ‖v‖ := by + apply Lp.norm_le_norm_of_ae_le + filter_upwards [coe_fieldApply A hA hbound v, hbound] with x hx hb + rw [hx] + exact (A x).le_opNorm (v x) |>.trans (by nlinarith [norm_nonneg (v x)]) + +lemma fieldApply_sub (v w : Lp E 2 μ) : + fieldApply A hA hbound (v - w) = fieldApply A hA hbound v - fieldApply A hA hbound w := by + apply Lp.ext + filter_upwards [coe_fieldApply A hA hbound (v - w), coe_fieldApply A hA hbound v, + coe_fieldApply A hA hbound w, Lp.coeFn_sub v w, + Lp.coeFn_sub (fieldApply A hA hbound v) (fieldApply A hA hbound w)] with x h1 h2 h3 h4 h5 + simp only [h1, h4, Pi.sub_apply, map_sub, h5, h2, h3] + +lemma norm_fieldApply_sub_le (v w : Lp E 2 μ) : + ‖fieldApply A hA hbound v - fieldApply A hA hbound w‖ ≤ ‖v - w‖ := by + rw [← fieldApply_sub] + exact norm_fieldApply_le A hA hbound _ +end Field + +variable [NormedSpace ℝ E] [NormedSpace ℝ F] + +lemma coeff_meas (A : G → E →L[ℝ] F) (hA : Continuous A) (u : Lp G 2 μ) : + AEStronglyMeasurable (fun x ↦ A (u x)) μ := + hA.comp_aestronglyMeasurable (Lp.aestronglyMeasurable u) + +lemma tendsto_fieldApply_fixed [IsFiniteMeasure μ] + (A : G → E →L[ℝ] F) (hA : Continuous A) (hb : ∀ z, ‖A z‖ ≤ 1) + (u : ℕ → Lp G 2 μ) (u₀ : Lp G 2 μ) + (hu : ∀ᵐ x ∂μ, Tendsto (fun n ↦ u n x) atTop (𝓝 (u₀ x))) (v : Lp E 2 μ) : + Tendsto (fun n ↦ fieldApply (fun x ↦ A (u n x)) (coeff_meas A hA (u n)) + (Eventually.of_forall (fun x ↦ hb (u n x))) v) atTop + (𝓝 (fieldApply (fun x ↦ A (u₀ x)) (coeff_meas A hA u₀) + (Eventually.of_forall (fun x ↦ hb (u₀ x))) v)) := by + apply tendsto_toLp_of_domination _ _ (Lp.memLp v) + · intro n + exact Eventually.of_forall fun x ↦ (A (u n x)).le_opNorm (v x) |>.trans + (by nlinarith [norm_nonneg (v x), hb (u n x)]) + · filter_upwards [hu] with x hx + exact ((ContinuousLinearMap.apply ℝ F (v x)).continuous.tendsto _).comp + (hA.continuousAt.tendsto.comp hx) + +lemma tendsto_fieldApply [IsFiniteMeasure μ] + (A : G → E →L[ℝ] F) (hA : Continuous A) (hb : ∀ z, ‖A z‖ ≤ 1) + (u : ℕ → Lp G 2 μ) (u₀ : Lp G 2 μ) + (hu : ∀ᵐ x ∂μ, Tendsto (fun n ↦ u n x) atTop (𝓝 (u₀ x))) + (v : ℕ → Lp E 2 μ) (v₀ : Lp E 2 μ) (hv : Tendsto v atTop (𝓝 v₀)) : + Tendsto (fun n ↦ fieldApply (fun x ↦ A (u n x)) (coeff_meas A hA (u n)) + (Eventually.of_forall (fun x ↦ hb (u n x))) (v n)) atTop + (𝓝 (fieldApply (fun x ↦ A (u₀ x)) (coeff_meas A hA u₀) + (Eventually.of_forall (fun x ↦ hb (u₀ x))) v₀)) := by + have hdiff : Tendsto (fun n ↦ + fieldApply (fun x ↦ A (u n x)) (coeff_meas A hA (u n)) + (Eventually.of_forall (fun x ↦ hb (u n x))) (v n) - + fieldApply (fun x ↦ A (u n x)) (coeff_meas A hA (u n)) + (Eventually.of_forall (fun x ↦ hb (u n x))) v₀) atTop (𝓝 0) := by + apply squeeze_zero_norm (fun n ↦ norm_fieldApply_sub_le _ _ _ (v n) v₀) + simpa using (hv.sub_const v₀).norm + simpa only [sub_add_cancel, zero_add] using + hdiff.add (tendsto_fieldApply_fixed A hA hb u u₀ hu v₀) + +end L2Contraction + +namespace HardSphere + +structure SmoothContraction where + toFun : ℂ → ℂ + smooth : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) toFun + zero : toFun 0 = 0 + derivative_le : ∀ z, ‖fderiv ℝ toFun z‖ ≤ 1 + +namespace SmoothContraction +variable (f : SmoothContraction) + +lemma lipschitz : LipschitzWith 1 f.toFun := + lipschitzWith_of_nnnorm_fderiv_le (f.smooth.differentiable (by simp)) + (fun z ↦ NNReal.coe_le_coe.mp (f.derivative_le z)) + +lemma derivative_continuous : Continuous (fderiv ℝ f.toFun) := + f.smooth.continuous_fderiv (by simp) + +lemma coordDerivative_comp {N : ℕ} {L : Length} {a : ℝ} + (g : SmoothTest N L a) (p : Direction N) : + coordDerivative N L (f.toFun ∘ g.toFun) p = fun X ↦ + fderiv ℝ f.toFun (g.toFun X) (coordDerivative N L g.toFun p X) := by + funext X + unfold coordDerivative + rw [show (fun Y : LiftedConfiguration N ↦ (f.toFun ∘ g.toFun) (project N L Y)) = + f.toFun ∘ (fun Y ↦ g.toFun (project N L Y)) from rfl] + rw [fderiv_comp (representative N L X) + (f.smooth.differentiable (by simp)).differentiableAt + (g.smooth.differentiable (by simp)).differentiableAt] + simp only [ContinuousLinearMap.comp_apply, project_representative] + +def composeTest {N : ℕ} {L : Length} {a : ℝ} + (g : SmoothTest N L a) : SmoothTest N L a where + toFun := f.toFun ∘ g.toFun + smooth := f.smooth.comp g.smooth + compact := g.compact.comp_left f.zero + support_allowed := (tsupport_comp_subset f.zero g.toFun).trans g.support_allowed + memLp := f.lipschitz.comp_memLp f.zero g.memLp + partial_memLp := by + intro p + rw [f.coordDerivative_comp g p] + have hm := f.derivative_continuous.comp_aestronglyMeasurable g.memLp.aestronglyMeasurable + apply (g.partial_memLp p).of_le + ((continuous_fst.clm_apply continuous_snd).comp_aestronglyMeasurable + (hm.prodMk (g.partial_memLp p).aestronglyMeasurable)) + exact Eventually.of_forall fun X ↦ + (fderiv ℝ f.toFun (g.toFun X)).le_opNorm _ |>.trans + (by nlinarith [f.derivative_le (g.toFun X), + norm_nonneg (coordDerivative N L g.toFun p X)]) + +def onScalar {N : ℕ} {L : Length} (u : ScalarL2 N L) : ScalarL2 N L := + f.lipschitz.compLp f.zero u + +def onPartial {N : ℕ} {L : Length} (u v : ScalarL2 N L) : ScalarL2 N L := + L2Contraction.fieldApply (fun X ↦ fderiv ℝ f.toFun (u X)) + (L2Contraction.coeff_meas _ f.derivative_continuous u) + (Eventually.of_forall (fun X ↦ f.derivative_le (u X))) v + +def onJet {N : ℕ} {L : Length} (u : Jet N L) : Jet N L := + (f.onScalar u.1, fun p ↦ f.onPartial u.1 (u.2 p)) + +lemma coe_onScalar {N : ℕ} {L : Length} (u : ScalarL2 N L) : + f.onScalar u =ᵐ[volume] fun X ↦ f.toFun (u X) := f.lipschitz.coeFn_compLp f.zero u + +lemma coe_onPartial {N : ℕ} {L : Length} (u v : ScalarL2 N L) : + f.onPartial u v =ᵐ[volume] fun X ↦ fderiv ℝ f.toFun (u X) (v X) := + L2Contraction.coe_fieldApply _ _ _ v + +lemma jet_composeTest {N : ℕ} {L : Length} {a : ℝ} + (g : SmoothTest N L a) : (f.composeTest g).jet = f.onJet g.jet := by + apply Prod.ext + · apply Lp.ext + filter_upwards [(f.composeTest g).memLp.coeFn_toLp, f.coe_onScalar g.jet.1, + g.memLp.coeFn_toLp] with X h1 h2 h3 + change g.jet.1 X = g.toFun X at h3 + change (f.composeTest g).jet.1 X = f.toFun (g.toFun X) at h1 + change (f.composeTest g).jet.1 X = f.onScalar g.jet.1 X + rw [h1, h2, h3] + · funext p + apply Lp.ext + filter_upwards [(f.composeTest g).partial_memLp p |>.coeFn_toLp, + f.coe_onPartial g.jet.1 (g.jet.2 p), g.memLp.coeFn_toLp, + (g.partial_memLp p).coeFn_toLp] with X h1 h2 h3 h4 + change (f.composeTest g).jet.2 p X = coordDerivative N L (f.toFun ∘ g.toFun) p X at h1 + change g.jet.1 X = g.toFun X at h3 + change g.jet.2 p X = coordDerivative N L g.toFun p X at h4 + change (f.composeTest g).jet.2 p X = f.onPartial g.jet.1 (g.jet.2 p) X + rw [h1, h2] + rw [f.coordDerivative_comp g p, h3, h4] + +lemma onJet_mem_domain {N : ℕ} {L : Length} {a : ℝ} {u : Jet N L} + (hu : u ∈ dirichletDomain N L a) : f.onJet u ∈ dirichletDomain N L a := by + obtain ⟨v, hv, hl⟩ := mem_closure_iff_seq_limit.mp hu + choose g hg using hv + have hl' : Tendsto (fun n ↦ (g n).jet) atTop (𝓝 u) := by simpa only [hg] using hl + have hs := (continuous_fst.tendsto u).comp hl' + obtain ⟨ns, hns, hae⟩ := (tendstoInMeasure_of_tendsto_Lp hs).exists_seq_tendsto_ae + have hlim : Tendsto (fun n ↦ (f.composeTest (g (ns n))).jet) atTop (𝓝 (f.onJet u)) := by + simp only [f.jet_composeTest] + apply Tendsto.prodMk_nhds + · exact (f.lipschitz.continuous_compLp f.zero).continuousAt.tendsto.comp + (hs.comp hns.tendsto_atTop) + · apply tendsto_pi_nhds.mpr + intro p + apply L2Contraction.tendsto_fieldApply _ f.derivative_continuous f.derivative_le + _ u.1 hae _ (u.2 p) + exact ((continuous_apply p).tendsto u.2).comp + ((continuous_snd.tendsto u).comp (hl'.comp hns.tendsto_atTop)) + exact isClosed_closure.mem_of_tendsto hlim + (Eventually.of_forall fun n ↦ subset_closure ⟨f.composeTest (g (ns n)), rfl⟩) + +lemma energy_onJet_le {N : ℕ} {L : Length} (u : Jet N L) : + energy (f.onJet u) ≤ energy u := by + apply Finset.sum_le_sum + intro p _ + apply pow_le_pow_left₀ (norm_nonneg _) _ 2 + exact L2Contraction.norm_fieldApply_le _ + (L2Contraction.coeff_meas _ f.derivative_continuous u.1) + (Eventually.of_forall fun X ↦ f.derivative_le (u.1 X)) (u.2 p) + +end SmoothContraction +end HardSphere + +open scoped RealInnerProductSpace + +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Orbitals/FreePathLawFiniteDeletion.lean b/lean/OAI/Analysis/HardSphere/Orbitals/FreePathLawFiniteDeletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..19f3bbb3b27573e0ed6c2585bd1b4b3860119db4 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Orbitals/FreePathLawFiniteDeletion.lean @@ -0,0 +1,133 @@ +import Mathlib +import OAI.Analysis.HardSphere.Geometry.SliceNormSq + +namespace OAI + +section +section +noncomputable section +open MeasureTheory Filter Set +open scoped Topology ENNReal BigOperators +open scoped RealInnerProductSpace +noncomputable section +open MeasureTheory Filter Set +open scoped Topology ENNReal BigOperators +namespace HardSphere +open MeasureTheory Wiener Set Filter +noncomputable section + +instance freePathLaw_finite_deletion (N : ℕ) (L : Length) (t : ℝ) : + IsFiniteMeasure (freePathLaw N L t) := by unfold freePathLaw; infer_instance +instance killedPathLaw_finite_deletion (N : ℕ) (L : Length) (a t : ℝ) : + IsFiniteMeasure (killedPathLaw N L a t) := by unfold killedPathLaw; infer_instance + +@[simp] lemma joinConfigurationPath_apply (m n : ℕ) (L : Length) + (p : ConfigurationPath m L × ConfigurationPath n L) (t : Time) : + joinConfigurationPath m n L p t=joinConfiguration m n L (p.1 t,p.2 t) := rfl + +lemma selected_reversal_integral {m n : ℕ} {L : Length} (u : ScalarL2 (m+n) L) (t : ℝ) + {h : ConfigurationPath m L → ℝ≥0∞} (hh : Measurable h) + (hrev : ∀ ω, h (reverseConfigurationPath m L ω)=h ω) : + (∫⁻ ω : ConfigurationPath m L, h ω*ENNReal.ofReal (sliceNormSq u (ω 1)) ∂freePathLaw m L t)= + ∫⁻ ω : ConfigurationPath m L, h ω*ENNReal.ofReal (sliceNormSq u (ω 0)) ∂freePathLaw m L t := by + have hmeas : Measurable (fun ω : ConfigurationPath m L ↦ h ω*ENNReal.ofReal (sliceNormSq u (ω 0))) := + hh.mul (((sliceNormSq_measurable u).comp (continuous_eval_const (0:Time)).measurable).ennreal_ofReal) + simpa only [reverseConfigurationPath_apply,reverseTime_zero,hrev] using + (reverse_freePath_preserving m L t).lintegral_comp hmeas + +lemma deleted_path_integral_le {m n : ℕ} {L : Length} (u : ScalarL2 (m+n) L) (a t : ℝ) + {h : ConfigurationPath m L → ℝ≥0∞} (hh : Measurable h) + (hrev : ∀ ω, h (reverseConfigurationPath m L ω)=h ω) : + (∫⁻ ω : ConfigurationPath (m+n) L, + h (splitConfigurationPath m n L ω).1*ENNReal.ofReal (‖u (ω 0)‖*‖u (ω 1)‖) + ∂killedPathLaw (m+n) L a t) ≤ + ENNReal.ofReal ‖killedTransition n L a t‖* + ∫⁻ ω : ConfigurationPath m L, h ω*ENNReal.ofReal (sliceNormSq u (ω 0)) ∂freePathLaw m L t := by + let F : ConfigurationPath (m+n) L → ℝ≥0∞ := fun ω ↦ + h (splitConfigurationPath m n L ω).1*ENNReal.ofReal (‖u (ω 0)‖*‖u (ω 1)‖) + let G : ConfigurationPath m L × ConfigurationPath n L → ℝ≥0∞ := fun p ↦ + h p.1*ENNReal.ofReal (‖u (joinConfiguration m n L (p.1 0,p.2 0))‖* + ‖u (joinConfiguration m n L (p.1 1,p.2 1))‖) + have hu := (Lp.stronglyMeasurable u).measurable + have hF : Measurable F := by + exact (hh.comp ((splitConfigurationPath_continuous m n L).measurable.fst)).mul + (((hu.comp (continuous_eval_const (0:Time)).measurable).norm.mul + (hu.comp (continuous_eval_const (1:Time)).measurable).norm).ennreal_ofReal) + have hG : Measurable G := by + simpa only [F,G,Function.comp_def,split_joinConfigurationPath,joinConfigurationPath_apply] + using hF.comp (joinConfigurationPath_continuous m n L).measurable + have hS0 : Measurable (fun ω : ConfigurationPath m L ↦ h ω*ENNReal.ofReal (sliceNormSq u (ω 0))) := + hh.mul (((sliceNormSq_measurable u).comp (continuous_eval_const (0:Time)).measurable).ennreal_ofReal) + have hS1 : Measurable (fun ω : ConfigurationPath m L ↦ h ω*ENNReal.ofReal (sliceNormSq u (ω 1))) := + hh.mul (((sliceNormSq_measurable u).comp (continuous_eval_const (1:Time)).measurable).ennreal_ofReal) + have hj := (joinConfigurationPath_preserving m n L t).restrict_preimage + (staysAllowed_open (m+n) L a).measurableSet + have hd : ((freePathLaw m L t).prod (freePathLaw n L t)).restrict + (joinConfigurationPath m n L ⁻¹' staysAllowed (m+n) L a) ≤ + (freePathLaw m L t).prod (killedPathLaw n L a t) := by + calc + _ ≤ ((freePathLaw m L t).prod (freePathLaw n L t)).restrict + (Set.univ ×ˢ staysAllowed n L a) := + Measure.restrict_mono_set _ fun p hp ↦ + ⟨mem_univ _,staysAllowed_join_subset_bath m n L a hp⟩ + _ = _ := by rw [← Measure.prod_restrict,Measure.restrict_univ]; rfl + have hq := bath_slice_quadratic_ae u a t + calc + _ = ∫⁻ p, G p ∂((freePathLaw m L t).prod (freePathLaw n L t)).restrict + (joinConfigurationPath m n L ⁻¹' staysAllowed (m+n) L a) := by + symm + simpa only [F,G,killedPathLaw,split_joinConfigurationPath,joinConfigurationPath_apply] using + hj.lintegral_comp hF + _ ≤ ∫⁻ p, G p ∂((freePathLaw m L t).prod (killedPathLaw n L a t)) := + lintegral_mono' hd le_rfl + _ = ∫⁻ ω : ConfigurationPath m L, h ω*(∫⁻ η : ConfigurationPath n L, + ENNReal.ofReal (‖u (joinConfiguration m n L (ω 0,η 0))‖* + ‖u (joinConfiguration m n L (ω 1,η 1))‖) ∂killedPathLaw n L a t) ∂freePathLaw m L t := by + rw [lintegral_prod _ hG.aemeasurable] + apply lintegral_congr + intro ω + dsimp only [G] + exact lintegral_const_mul _ (by + apply Measurable.ennreal_ofReal + apply Measurable.mul + all_goals + apply Measurable.norm + apply hu.comp + exact (joinConfiguration_continuous m n L).measurable.comp + (measurable_const.prodMk (continuous_eval_const _).measurable)) + _ ≤ ∫⁻ ω : ConfigurationPath m L, h ω*(ENNReal.ofReal (‖killedTransition n L a t‖/2)* + (ENNReal.ofReal (sliceNormSq u (ω 0))+ENNReal.ofReal (sliceNormSq u (ω 1)))) ∂freePathLaw m L t := by + apply lintegral_mono_ae + filter_upwards [hq] with ω hω + exact mul_le_mul_right hω _ + _ = ENNReal.ofReal (‖killedTransition n L a t‖/2)* + ((∫⁻ ω : ConfigurationPath m L, h ω*ENNReal.ofReal (sliceNormSq u (ω 0)) ∂freePathLaw m L t)+ + (∫⁻ ω : ConfigurationPath m L, h ω*ENNReal.ofReal (sliceNormSq u (ω 1)) ∂freePathLaw m L t)) := by + calc + _ = ∫⁻ ω : ConfigurationPath m L, ENNReal.ofReal (‖killedTransition n L a t‖/2)* + (h ω*ENNReal.ofReal (sliceNormSq u (ω 0))+h ω*ENNReal.ofReal (sliceNormSq u (ω 1))) + ∂freePathLaw m L t := by + apply lintegral_congr + intro ω + rw [← mul_add,mul_left_comm] + _ = _ := by + calc + _ = ENNReal.ofReal (‖killedTransition n L a t‖/2)* + (∫⁻ ω : ConfigurationPath m L, + h ω*ENNReal.ofReal (sliceNormSq u (ω 0))+ + h ω*ENNReal.ofReal (sliceNormSq u (ω 1)) ∂freePathLaw m L t) := + lintegral_const_mul _ (hS0.add hS1) + _ = _ := by rw [lintegral_add_left hS0] + _ = _ := by + rw [selected_reversal_integral u t hh hrev,mul_add,← add_mul, + ← ENNReal.ofReal_add (div_nonneg (norm_nonneg _) (by norm_num)) + (div_nonneg (norm_nonneg _) (by norm_num)),add_halves] +end +end HardSphere + +end +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Orbitals/GridLowStationary.lean b/lean/OAI/Analysis/HardSphere/Orbitals/GridLowStationary.lean new file mode 100644 index 0000000000000000000000000000000000000000..b29ea1a08280a85f8b605e5d7b14f8abf5d9c126 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Orbitals/GridLowStationary.lean @@ -0,0 +1,50 @@ +import Mathlib +import OAI.Analysis.HardSphere.Operators.Stationary +import OAI.Analysis.HardSphere.Thermodynamics.LowCountAbove + +namespace OAI + +section + +section +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators +namespace HardSphere.CellOrbital +open Wiener + +theorem grid_stationary_low_above (Amin : ℝ) : ∃ α₀ ell D₀ Q : ℝ, + Amin≤α₀ ∧ 0<α₀ ∧ 0 linarith [Real.smoothTransition.nonneg (t/h-1),Real.smoothTransition.le_one (t/h-1)] + +lemma profile_one {h : ℝ} (hh : 0 rfl + +lemma coe_insertionJet_zero {n : ℕ} {L : Length} (f : SmoothMultiplier (n+1) L) + (u : Jet n L) (j : Fin 3) : + (f.insertionJet u).2 (0,j) =ᵐ[volume] + fun X ↦ coordDerivative (n+1) L f.toFun (0,j) X*u.1 (Fin.tail X) := by + change (f.insertionScalar 0+L2Multiplier.clm _ (f.partial_memLp_top (0,j)) + (configurationTailCLM n L u.1)) =ᵐ[volume] _ + rw [map_zero,zero_add] + filter_upwards [coe_configurationTailCLM u.1, + L2Multiplier.coe_clm _ (f.partial_memLp_top (0,j)) (configurationTailCLM n L u.1)] with X h1 h2 + exact h2.trans (by rw [h1]) + +lemma coe_insertionJet_succ {n : ℕ} {L : Length} (f : SmoothMultiplier (n+1) L) + (u : Jet n L) (i : Fin n) (j : Fin 3) : + (f.insertionJet u).2 (i.succ,j) =ᵐ[volume] + fun X ↦ f.toFun X*u.2 (i,j) (Fin.tail X)+ + coordDerivative (n+1) L f.toFun (i.succ,j) X*u.1 (Fin.tail X) := by + change (f.insertionScalar (u.2 (i,j))+L2Multiplier.clm _ (f.partial_memLp_top (i.succ,j)) + (configurationTailCLM n L u.1)) =ᵐ[volume] _ + filter_upwards [coe_insertionScalar f (u.2 (i,j)),coe_configurationTailCLM u.1, + L2Multiplier.coe_clm _ (f.partial_memLp_top (i.succ,j)) (configurationTailCLM n L u.1), + Lp.coeFn_add (f.insertionScalar (u.2 (i,j))) + (L2Multiplier.clm _ (f.partial_memLp_top (i.succ,j)) (configurationTailCLM n L u.1))] + with X h1 h2 h3 h4 + rw [h4,Pi.add_apply,h1,h3,h2] + +lemma SmoothTest.jet_insert {n : ℕ} {L : Length} {a : ℝ} (g : SmoothTest n L a) + (f : SmoothMultiplier (n+1) L) (hc : InsertionClearance a f) : + (g.insert f hc).jet=f.insertionJet g.jet := by + apply Prod.ext + · apply Lp.ext + filter_upwards [MemLp.coeFn_toLp (g.insert f hc).memLp, + (configurationTail_quasiPreserving n L).ae_eq_comp (MemLp.coeFn_toLp g.memLp), + coe_insertionScalar f g.jet.1] with X h1 h2 h3 + dsimp only [Function.comp_def] at h2 + change ((g.insert f hc).jet.1) X=(f.insertionScalar g.jet.1) X + rw [h3] + dsimp only [SmoothTest.jet] + rw [h1,h2] + rfl + · funext p + rcases p with ⟨i,j⟩ + refine Fin.cases ?_ (fun k ↦ ?_) i + · apply Lp.ext + filter_upwards [MemLp.coeFn_toLp ((g.insert f hc).partial_memLp (0,j)), + (configurationTail_quasiPreserving n L).ae_eq_comp (MemLp.coeFn_toLp g.memLp), + coe_insertionJet_zero f g.jet j] with X h1 h2 h3 + dsimp only [Function.comp_def] at h2 + rw [h3] + dsimp only [SmoothTest.jet] + rw [h1] + change coordDerivative (n+1) L (f.toFun*(fun X ↦ g.toFun (Fin.tail X))) (0,j) X=_ + rw [coordDerivative_mul (f.smooth.differentiable (by simp)) + ((smooth_tail g.smooth).differentiable (by simp)), + coordDerivative_tail_zero (g.smooth.differentiable (by simp))] + simp only [Pi.add_apply,Pi.mul_apply,Pi.zero_apply,mul_zero,zero_add,h2] + ring + · apply Lp.ext + filter_upwards [MemLp.coeFn_toLp ((g.insert f hc).partial_memLp (k.succ,j)), + (configurationTail_quasiPreserving n L).ae_eq_comp (MemLp.coeFn_toLp g.memLp), + (configurationTail_quasiPreserving n L).ae_eq_comp (MemLp.coeFn_toLp (g.partial_memLp (k,j))), + coe_insertionJet_succ f g.jet k j] with X h1 h2 h3 h4 + dsimp only [Function.comp_def] at h2 h3 + rw [h4] + dsimp only [SmoothTest.jet] + rw [h1] + change coordDerivative (n+1) L (f.toFun*(fun X ↦ g.toFun (Fin.tail X))) (k.succ,j) X=_ + rw [coordDerivative_mul (f.smooth.differentiable (by simp)) + ((smooth_tail g.smooth).differentiable (by simp)), + coordDerivative_tail_succ (g.smooth.differentiable (by simp))] + simp only [Pi.add_apply,Pi.mul_apply,h2,h3] + ring + +lemma SmoothMultiplier.insertionJet_mem_domain {n : ℕ} {L : Length} {a : ℝ} + (f : SmoothMultiplier (n+1) L) (hc : InsertionClearance a f) + {u : Jet n L} (hu : u∈dirichletDomain n L a) : + f.insertionJet u∈dirichletDomain (n+1) L a := by + apply map_mem_closure f.insertionJet.continuous hu + rintro _ ⟨g,rfl⟩ + exact ⟨g.insert f hc,g.jet_insert f hc⟩ + +end +end HardSphere + +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/PathBounds/ExpNatTail.lean b/lean/OAI/Analysis/HardSphere/PathBounds/ExpNatTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c18e34851309c76cfcda54b7f356de5e77632dc --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/PathBounds/ExpNatTail.lean @@ -0,0 +1,247 @@ +import Mathlib +import OAI.Analysis.HardSphere.Bridges.WienerGaussian +import OAI.Analysis.HardSphere.PathBounds.FreeVisitProbability + +namespace OAI + +noncomputable section +open MeasureTheory Set +open scoped ENNReal NNReal BigOperators +namespace HardSphere.FreeVisits + +lemma exp_block_sum_bound (C J : ℕ) (hC : 0 simp [W,hindex] + have hterm (k : ℕ) : (∫⁻ w,W k w ∂μ) ≤ + (ENNReal.ofReal (Real.exp (η*(C:ℝ)))+ENNReal.ofReal (Real.exp (η*(C:ℝ)))*a)* + ENNReal.ofReal (Real.exp (-1))^k := by + rw [show (∫⁻ w,W k w ∂μ) = ENNReal.ofReal (Real.exp (η*(C:ℝ)*((k:ℝ)+1))) * μ {w | C*k simpa only [Nat.succ_eq_add_one,Nat.zero_add,Nat.cast_one,one_mul,pow_one] using hbound + | succ k hk ih => + intro X + have h := visit_moment_add L A i (mul_pos (by exact_mod_cast hk) ht) ht hη + (B^k) B ih hbound X + convert h using 1 <;> push_cast <;> ring_nf + +lemma small_visit_moment {c : ℝ} (_hc : 0 + simp only [coordDerivative_tail_zero hs j,mul_zero,zero_add] at hd + rw [show (fun X ↦ g.toFun X*r.toFun (Fin.tail X))=g.toFun*(fun X ↦ r.toFun (Fin.tail X)) from rfl,hd] + simp only [Pi.mul_apply,Fin.tail_cons,norm_mul,mul_pow] + rw [integral_const_mul] + | succ k => + have he := g.insertion_orthogonal_local hr k j Y hn + have ho : (∫ x : Torus L, + conj (g.toFun (Fin.cons x Y)*coordDerivative n L r.toFun (k,j) Y)* + (r.toFun Y*coordDerivative (n+1) L g.toFun (k.succ,j) (Fin.cons x Y)))=0 := by + calc + _ = (conj (coordDerivative n L r.toFun (k,j) Y)*r.toFun Y)* + ∫ x : Torus L, conj (g.toFun (Fin.cons x Y))* + coordDerivative (n+1) L g.toFun (k.succ,j) (Fin.cons x Y) := by + rw [← integral_const_mul] + apply integral_congr_ae + exact Eventually.of_forall fun x ↦ by simp only [map_mul]; ring + _ = 0 := by rw [he,mul_zero] + have heq := integral_norm_add_sq_orthogonal (hg.mul continuous_const) (continuous_const.mul hdg) ho + simp only [Pi.mul_apply,Function.comp_def] at heq + have hd' := coordDerivative_mul (g := fun X : Configuration (n+1) L ↦ r.toFun (Fin.tail X)) + (g.smooth.differentiable (by simp)) + ((smooth_tail r.smooth).differentiable (by simp)) (k.succ,j) + rw [coordDerivative_tail_succ hs k j] at hd' + rw [show (fun X ↦ g.toFun X*r.toFun (Fin.tail X))=g.toFun*(fun X ↦ r.toFun (Fin.tail X)) from rfl,hd'] + simp only [Pi.mul_apply,Pi.add_apply,Fin.tail_cons] + rw [heq] + simp only [norm_mul,mul_pow] + rw [integral_const_mul] + exact le_add_of_nonneg_left (integral_nonneg fun x ↦ mul_nonneg (sq_nonneg _) (sq_nonneg _)) + +lemma SmoothMultiplier.localNormalization_derivative_le {n : ℕ} {L : Length} + (f : SmoothMultiplier (n+1) L) (hr : ∀ X, conj (f.toFun X)=f.toFun X) + (p : Direction (n+1)) (Y : Configuration n L) (hY : 1/2 + intro X + simpa only [Nat.succ_eq_add_one,Nat.zero_add,Nat.cast_one,one_mul,mul_one] using one_segment_visit_tail htail L hL A i ht X + | succ k hk ih => + intro X + have hkt : 0<(k:ℝ)*t := mul_pos (by exact_mod_cast hk) ht + have h := visit_tail_add L A i hkt ht (29^3*k) (29^3) + ((k:ℝ≥0∞)*(3*M*ENNReal.ofReal (Real.exp (-c/(2*t))))) + (3*M*ENNReal.ofReal (Real.exp (-c/(2*t)))) ih + (fun X ↦ one_segment_visit_tail htail L hL A i ht X) X + convert h using 1 <;> push_cast <;> ring_nf + +lemma whole_time_visit_tail {c : ℝ} {M : ℝ≥0∞} + (htail : ∀ R : ℝ, 0≤R → wiener {w | R≤‖w‖}≤M*ENNReal.ofReal (Real.exp (-c*R^2))) + {n K : ℕ} [NeZero K] (L : Length) (hL : L.val=(K:ℝ)) + (A : Finset (DiscreteTorus K)) (i : Fin n) {t : ℝ} (ht : 0 simp only [F] <;> + first | exact hf.aemeasurable | exact hg.aemeasurable | exact hh.aemeasurable + have H := ENNReal.lintegral_prod_norm_pow_le (μ:=μ) Finset.univ hF + (p:=fun _ ↦ (1/3:ℝ)) (by norm_num) (by intros; norm_num) + simpa [Fin.prod_univ_three,F] using H + +lemma ofReal_exp_rpow {x p : ℝ} (hp : 0≤p) : + ENNReal.ofReal (Real.exp x)^p = ENNReal.ofReal (Real.exp (x*p)) := by + rw [ENNReal.ofReal_rpow_of_nonneg (Real.exp_nonneg _) hp,Real.exp_mul] + +lemma indicator_one_third {Ω : Type*} (D : Set Ω) (w : Ω) : + (D.indicator (fun _ ↦ (1:ℝ≥0∞)) w)^(1/3:ℝ) = D.indicator (fun _ ↦ 1) w := by + classical + by_cases hw : w∈D <;> simp [hw] + +lemma exp_sub_one_le_mul_exp (x : ℝ) : Real.exp x-1≤x*Real.exp x := by + have h := mul_le_mul_of_nonneg_right (Real.add_one_le_exp (-x)) (Real.exp_nonneg x) + rw [←Real.exp_add] at h + simp only [neg_add_cancel,Real.exp_zero] at h + nlinarith + +def visitDefect {n K : ℕ} (L : Length) (A : Finset (DiscreteTorus K)) (i : Fin n) + (t η : ℝ) (X : Configuration n L) (D : Set (CoordinatePaths n)) (w : CoordinatePaths n) : ℝ≥0∞ := by + classical + exact ENNReal.ofReal (Real.exp (η*(if w∈D then (visitCount L A i t X w:ℝ) else 0))-1) + +lemma visitDefect_le {n K : ℕ} (L : Length) (A : Finset (DiscreteTorus K)) (i : Fin n) + (t : ℝ) {η η₀ : ℝ} (hη : 0≤η) (hηη : η≤η₀) (X : Configuration n L) + (D : Set (CoordinatePaths n)) (w : CoordinatePaths n) : + visitDefect L A i t η X D w ≤ ENNReal.ofReal η * + (visitWeight L A i t (3*(η₀+1)) X w ^ (1/3:ℝ) * + (D.indicator (fun _ ↦ (1:ℝ≥0∞)) w)^(1/3:ℝ) * + ({w | 0 rw [←(show (t:AddCircle L.val)=x from AddCircle.coe_equivIco)] + rw [dist_eq_norm,←QuotientAddGroup.mk_sub,AddCircle.norm_eq] + congr 1 + dsimp [periodicLatticeIndex,δ,t] + push_cast + rw [←hL] + simp only [Int.fract] + ring + rw [hd] + calc + _ = |((periodicLatticeIndex L x v:ℝ)-δ)+δ| := by congr 1; ring + _ ≤ |(periodicLatticeIndex L x v:ℝ)-δ|+|δ| := abs_add_le _ _ + _ ≤ _ := add_le_add le_rfl hδ + +lemma circle_lattice_exponential_bound {K : ℕ} {L : Length} (hL : L.val=(K:ℝ)) + (x : AddCircle L.val) : + (∑ v : Fin K, Real.exp (-dist (((v.val:ℝ)+1/2:ℝ):AddCircle L.val) x/3))≤ + Real.exp (1/3)*latticeExponentialSum := by + classical + calc + _ ≤ ∑ v : Fin K, Real.exp (1/3)*Real.exp (-|(periodicLatticeIndex L x v:ℝ)|/3) := by + apply Finset.sum_le_sum + intro v _ + rw [←Real.exp_add] + apply Real.exp_le_exp.mpr + have h := periodicLatticeIndex_bound hL x v + linarith only [h] + _ = Real.exp (1/3)*∑ v : Fin K, Real.exp (-|(periodicLatticeIndex L x v:ℝ)|/3) := (Finset.mul_sum ..).symm + _ ≤ _ := by + apply mul_le_mul_of_nonneg_left _ (Real.exp_pos _).le + rw [←Finset.sum_image (f:=fun z : ℤ ↦ Real.exp (-|(z:ℝ)|/3)) (s:=Finset.univ) (periodicLatticeIndex_injective x).injOn] + exact latticeExponential_summable.sum_le_tsum _ (fun _ _ ↦ (Real.exp_pos _).le) + +lemma torus_exp_le_coordinate_exp (L : Length) (x y : Torus L) : + Real.exp (-torusDistance L x y)≤Real.exp (-dist (x 0) (y 0)/3)* + Real.exp (-dist (x 1) (y 1)/3)*Real.exp (-dist (x 2) (y 2)/3) := by + rw [←Real.exp_add,←Real.exp_add] + apply Real.exp_le_exp.mpr + have h0 := coordinate_distance_le L x y 0 + have h1 := coordinate_distance_le L x y 1 + have h2 := coordinate_distance_le L x y 2 + linarith only [h0,h1,h2] + +theorem unitGrid_exponential_bound : ∃ C : ℝ, 0.trans (hw (i,j))) + ((w (i,j)).norm_coe_le_norm u |>.trans (hw (i,j)))) + _ = _ := by ring + +lemma killedObservable_eq_of_small_path (N : ℕ) (L : Length) (a t : ℝ) + (g : Configuration N L → ℂ) {δ B : ℝ} (hB : 0≤B) + (hδ : Metric.cthickening δ (tsupport g) ⊆ allowed N L a) + (ht : 2*Real.sqrt (2*t)*B≤δ) + {w : CoordinatePaths N} (hw : ∀ p, ‖w p‖≤B) (X : Configuration N L) : + killedObservable N L a g (freeTrajectory N L t w X)=g (freeTrajectory N L t w X 1) := by + by_cases hg : g (freeTrajectory N L t w X 1)=0 + · simp only [killedObservable] + by_cases he : freeTrajectory N L t w X∈staysAllowed N L a + · simp only [Set.indicator_of_mem he] + · simp only [Set.indicator_of_notMem he,hg] + · have hs : freeTrajectory N L t w X 1∈tsupport g := subset_closure hg + have he : freeTrajectory N L t w X∈staysAllowed N L a := by + rintro _ ⟨s,rfl⟩ + apply hδ + exact Metric.mem_cthickening_of_dist_le _ _ _ _ hs + ((freeTrajectory_dist_le N L t hB hw X s 1).trans ht) + simp only [killedObservable,Set.indicator_of_mem he] + +lemma coordinateWiener_tail8 (N : ℕ) {B : ℝ} (hB : 0.norm) + have hi (b : ℝ) : Integrable (fun w : CoordinatePaths N ↦ + killedObservable N L b g (freeTrajectory N L t w X)) (coordinateWiener N) := by + apply (integrable_const ‖g‖).mono' + · exact ((killedObservable_measurable N L b g.continuous.measurable).comp + ((freeTrajectory_continuous N L t).comp (continuous_id.prodMk continuous_const)).measurable).aestronglyMeasurable + · exact Eventually.of_forall fun _ ↦ killedObservable_bound N L b (norm_nonneg g) g.norm_coe_le_norm _ + rw [killedAverage,killedAverage,← integral_sub (hi a) (hi (-1))] + calc + _ ≤ ∫ w, E.indicator (fun _ ↦ ‖g‖) w ∂coordinateWiener N := by + apply norm_integral_le_of_norm_le + · exact (integrable_const ‖g‖).indicator hE + · filter_upwards [] with w + rw [killedObservable_of_neg N L (by norm_num : (-1:ℝ)<0)] + by_cases he : w∈E + · rw [Set.indicator_of_mem he] + by_cases ha : freeTrajectory N L t w X∈staysAllowed N L a + · simp only [killedObservable,Set.indicator_of_mem ha,sub_self,norm_zero] + exact norm_nonneg g + · simp only [killedObservable,Set.indicator_of_notMem ha,zero_sub,norm_neg] + exact g.norm_coe_le_norm _ + · rw [Set.indicator_of_notMem he] + have hw : ∀ p, ‖w p‖≤B*normMultiplier := by + intro p + exact le_of_not_gt fun h ↦ he ⟨p,h⟩ + rw [killedObservable_eq_of_small_path N L a t g + (mul_nonneg hB.le normMultiplier_pos.le) hδ ht hw X,sub_self,norm_zero] + _ = _ := by rw [integral_indicator_const _ hE]; simp only [smul_eq_mul,mul_comm]; rfl + +def pathTailConstant (N : ℕ) : ℝ := + ((Fintype.card (Direction N) : ℝ≥0∞) * + ((1+(1-(2:ℝ≥0∞)*(4/3)⁻¹^8)⁻¹)*moment8)).toReal + +lemma pathTailConstant_nonneg (N : ℕ) : 0 ≤ pathTailConstant N := ENNReal.toReal_nonneg + +lemma coordinateWiener_tail8_real (N : ℕ) {B : ℝ} (hB : 0] 0) (𝓝 0) := by + obtain ⟨C,hC,hb⟩ := killedTransition_free_order4 N L a g hg + rw [tendsto_zero_iff_norm_tendsto_zero] + apply squeeze_zero' (g := fun t : ℝ ↦ C*t^3) (Eventually.of_forall fun t ↦ norm_nonneg _) ?_ ?_ + · filter_upwards [self_mem_nhdsWithin] with t ht + have ht' : 0 (apply (Int.cast_le (R := ℝ)).mp; push_cast; linarith) + exact ⟨fun j ↦ (hz j).1,fun j ↦ (hz j).2⟩ + · ext j + simp [torusProjection,z] + +lemma card_near_sites_le {K : ℕ} [NeZero K] (L : Length) (hL : L.val=(K:ℝ)) + (x : Torus L) (A : Finset (DiscreteTorus K)) + (hA : ∀ v∈A, ∀ j, dist (siteCenter L v j) (x j)≤13) : A.card≤29^3 := by + classical + let c : Fin 3 → ℝ := fun j ↦ (AddCircle.equivIco L.val 0 (x j)).val + have hc (j : Fin 3) : ((c j:ℝ):AddCircle L.val)=x j := AddCircle.coe_equivIco + have hsub : A ⊆ (packingBox c).image (torusProjection K) := by + intro v hv + obtain ⟨z,hz,he⟩ := site_packing_witness L hL c v (fun j ↦ by rw [hc]; exact hA v hv j) + exact Finset.mem_image.mpr ⟨z,hz,he⟩ + exact (Finset.card_le_card hsub).trans ((Finset.card_image_le).trans (le_of_eq (card_packingBox c))) +end HardSphere.FreeVisits + +namespace HardSphere +open MeasureTheory Wiener Set +attribute [local irreducible] torusDistance + +def pathVisitsBall {n : ℕ} (L : Length) (R : ℝ) (v : Torus L) + (i : Fin n) (ω : ConfigurationPath n L) : Prop := + ∃ q : Time, torusDistance L (ω q i) v ≤ R + +lemma pathVisitsBall_isClosed {n : ℕ} (L : Length) (R : ℝ) (v : Torus L) (i : Fin n) : + IsClosed {ω : ConfigurationPath n L | pathVisitsBall L R v i ω} := by + have hc : Continuous (fun p : ConfigurationPath n L × Time ↦ torusDistance L (p.1 p.2 i) v) := by + have he : Continuous (fun p : ConfigurationPath n L × Time ↦ p.1 p.2 i) := + (continuous_apply i).comp (continuous_eval : Continuous (fun p : ConfigurationPath n L × Time ↦ p.1 p.2)) + exact (continuous_torusDistance L).comp (he.prodMk continuous_const) + have hs := isClosedMap_fst_of_compactSpace + {p : ConfigurationPath n L × Time | torusDistance L (p.1 p.2 i) v ≤ R} + (isClosed_le hc continuous_const) + convert hs using 1 + ext ω + simp only [pathVisitsBall,Set.mem_ofPred_eq,Set.mem_image,Prod.exists] + constructor + · rintro ⟨q,hq⟩ + exact ⟨ω,q,hq,rfl⟩ + · rintro ⟨ω',q,hq,rfl⟩ + exact ⟨q,hq⟩ + +@[simp] lemma pathVisitsBall_reverse {n : ℕ} (L : Length) (R : ℝ) (v : Torus L) + (i : Fin n) (ω : ConfigurationPath n L) : + pathVisitsBall L R v i (reverseConfigurationPath n L ω) ↔ pathVisitsBall L R v i ω := by + constructor + · rintro ⟨q,hq⟩ + exact ⟨reverseTime q,hq⟩ + · rintro ⟨q,hq⟩ + refine ⟨reverseTime q,?_⟩ + simpa only [reverseConfigurationPath_apply,reverseTime_reverse] using hq + +def pathVisitedSites {S : Type*} {n : ℕ} (L : Length) (v : S → Torus L) + (A : Finset S) (i : Fin n) (ω : ConfigurationPath n L) : Finset S := by + classical + exact A.filter (fun a ↦ pathVisitsBall L 12 (v a) i ω) + +lemma pathVisitedSites_measurable {S : Type*} {n : ℕ} (L : Length) + (v : S → Torus L) (A : Finset S) (i : Fin n) : + Measurable (fun ω : ConfigurationPath n L ↦ ((pathVisitedSites L v A i ω).card:ℝ)) := by + classical + simp only [pathVisitedSites,Finset.card_filter,Nat.cast_sum,Nat.cast_ite,Nat.cast_one,Nat.cast_zero] + apply Finset.measurable_sum + intro a _ + exact Measurable.ite (pathVisitsBall_isClosed L 12 (v a) i).measurableSet + measurable_const measurable_const + +@[simp] lemma pathVisitedSites_reverse {S : Type*} {n : ℕ} (L : Length) + (v : S → Torus L) (A : Finset S) (i : Fin n) (ω : ConfigurationPath n L) : + pathVisitedSites L v A i (reverseConfigurationPath n L ω)=pathVisitedSites L v A i ω := by + classical + simp only [pathVisitedSites,pathVisitsBall_reverse] + +end HardSphere + +namespace HardSphere.FreeVisits +open HardSphere.BathSlice HardSphere.Lattice HardSphere.CellOrbital HardSphere.Wiener + +lemma visited_subset_near {n K : ℕ} [NeZero K] (L : Length) (A : Finset (DiscreteTorus K)) + (i : Fin n) (ω : ConfigurationPath n L) (x : Torus L) + (hω : ∀ (u : Time) (j : Fin 3), dist (ω u i j) (x j)≤1) : + ∀ v∈pathVisitedSites L (siteCenter L) A i ω, ∀ j, dist (siteCenter L v j) (x j)≤13 := by + classical + intro v hv j + obtain ⟨_,u,hu⟩ := Finset.mem_filter.mp hv + have hc := dist_coord_le_torusDistance L (ω u i) (siteCenter L v) j + calc + dist (siteCenter L v j) (x j) ≤ dist (siteCenter L v j) (ω u i j)+dist (ω u i j) (x j) := dist_triangle _ _ _ + _ ≤ 12+1 := add_le_add (by rw [dist_comm]; exact hc.trans hu) (hω u j) + _ = 13 := by norm_num + +lemma visited_card_le_of_short {n K : ℕ} [NeZero K] (L : Length) (hL : L.val=(K:ℝ)) + (A : Finset (DiscreteTorus K)) (i : Fin n) (ω : ConfigurationPath n L) (x : Torus L) + (hω : ∀ (u : Time) (j : Fin 3), dist (ω u i j) (x j)≤1) : + (pathVisitedSites L (siteCenter L) A i ω).card≤29^3 := + card_near_sites_le L hL x _ (visited_subset_near L A i ω x hω) + +lemma visited_split {S : Type*} [DecidableEq S] {n : ℕ} (L : Length) (v : S → Torus L) + (A : Finset S) (i : Fin n) (ω : ConfigurationPath n L) + (u : Time) (hu : 0<(u:ℝ)) (hu' : (u:ℝ)<1) : + pathVisitedSites L v A i ω = pathVisitedSites L v A i (configurationPrefix n L u ω) ∪ + pathVisitedSites L v A i (configurationSuffix n L u ω) := by + classical + ext a + rw [Finset.mem_union] + constructor + · intro hav + obtain ⟨ha,q,hq⟩ := Finset.mem_filter.mp hav + by_cases hq' : (q:ℝ)≤u + · let z : Time := ⟨(q:ℝ)/(u:ℝ),div_nonneg q.property.1 hu.le,(div_le_one hu).mpr hq'⟩ + have hz : prefixTime u z=q := by + apply Subtype.ext + change (u:ℝ)*((q:ℝ)/(u:ℝ))=(q:ℝ) + field_simp + exact Or.inl (Finset.mem_filter.mpr ⟨ha,z,by simpa only [configurationPrefix,ContinuousMap.comp_apply,hz] using hq⟩) + · let z : Time := ⟨((q:ℝ)-(u:ℝ))/(1-(u:ℝ)), + div_nonneg (sub_nonneg.mpr (le_of_not_ge hq')) (sub_pos.mpr hu').le, + (div_le_one (sub_pos.mpr hu')).mpr (by linarith [q.property.2])⟩ + have hz : suffixTime u z=q := by + apply Subtype.ext + change (u:ℝ)+(1-(u:ℝ))*(((q:ℝ)-(u:ℝ))/(1-(u:ℝ)))=(q:ℝ) + field_simp [ne_of_gt (sub_pos.mpr hu')] + ring + exact Or.inr (Finset.mem_filter.mpr ⟨ha,z,by simpa only [configurationSuffix,ContinuousMap.comp_apply,hz] using hq⟩) + · rintro (hav|hav) + · obtain ⟨ha,q,hq⟩ := Finset.mem_filter.mp hav + exact Finset.mem_filter.mpr ⟨ha,prefixTime u q,hq⟩ + · obtain ⟨ha,q,hq⟩ := Finset.mem_filter.mp hav + exact Finset.mem_filter.mpr ⟨ha,suffixTime u q,hq⟩ + +lemma visited_card_split_le {S : Type*} {n : ℕ} (L : Length) (v : S → Torus L) + (A : Finset S) (i : Fin n) (ω : ConfigurationPath n L) + (u : Time) (hu : 0<(u:ℝ)) (hu' : (u:ℝ)<1) : + (pathVisitedSites L v A i ω).card ≤ (pathVisitedSites L v A i (configurationPrefix n L u ω)).card + + (pathVisitedSites L v A i (configurationSuffix n L u ω)).card := by + classical + rw [visited_split L v A i ω u hu hu'] + exact Finset.card_union_le _ _ + +lemma freeTrajectory_coord_dist_le {n : ℕ} (L : Length) (t : ℝ) (w : CoordinatePaths n) + (X : Configuration n L) (i : Fin n) (u : Time) (j : Fin 3) : + dist (freeTrajectory n L t w X u i j) (X i j) ≤ Real.sqrt (2*t)*‖w (i,j)‖ := by + change dist (X i j+((Real.sqrt (2*t)*w (i,j) u:ℝ):AddCircle L.val)) (X i j) ≤ _ + simp only [dist_eq_norm,add_sub_cancel_left] + calc + ‖((Real.sqrt (2*t)*w (i,j) u:ℝ):AddCircle L.val)‖ ≤ ‖Real.sqrt (2*t)*w (i,j) u‖ := + QuotientAddGroup.norm_mk_le_norm + _ = Real.sqrt (2*t)*|w (i,j) u| := by rw [Real.norm_eq_abs,abs_mul,abs_of_nonneg (Real.sqrt_nonneg _)] + _ ≤ _ := mul_le_mul_of_nonneg_left (by simpa only [Real.norm_eq_abs] using ContinuousMap.norm_coe_le_norm (w (i,j)) u) (Real.sqrt_nonneg _) + +lemma free_visited_card_le_of_norm {n K : ℕ} [NeZero K] (L : Length) (hL : L.val=(K:ℝ)) + (A : Finset (DiscreteTorus K)) (i : Fin n) (t : ℝ) (w : CoordinatePaths n) + (X : Configuration n L) (hw : ∀ j, Real.sqrt (2*t)*‖w (i,j)‖≤1) : + (pathVisitedSites L (siteCenter L) A i (freeTrajectory n L t w X)).card≤29^3 := by + apply visited_card_le_of_short L hL A i _ (X i) + exact fun u j ↦ (freeTrajectory_coord_dist_le L t w X i u j).trans (hw j) + +end HardSphere.FreeVisits + +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Paths/AcceptedIntegrand.lean b/lean/OAI/Analysis/HardSphere/Paths/AcceptedIntegrand.lean new file mode 100644 index 0000000000000000000000000000000000000000..615fd507645c0248f283dc1fdca9119830a858cc --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Paths/AcceptedIntegrand.lean @@ -0,0 +1,279 @@ +import Mathlib +import OAI.Analysis.HardSphere.Paths.LiftedSkeleton + +namespace OAI + +section +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal BigOperators +namespace HardSphere.DyadicSkeleton +open HardSphere.Lattice +attribute [local instance] Classical.propDecidable + +lemma measurable_simpleEncounter {K : ℕ} [NeZero K] (R : ℕ) + (x y : DiscreteTorus K) : + Measurable (fun p : SimplePath x y × SimplePath x y ↦ simpleEncounter R p.1 p.2) := + measurable_of_countable _ + +lemma measurable_simpleEncounter_comp {Ω : Type*} [MeasurableSpace Ω] + {K : ℕ} [NeZero K] (R : ℕ) {x y : DiscreteTorus K} + (f : Ω → SimplePath x y) (hf : Measurable f) : + Measurable (fun z : Ω×Ω ↦ simpleEncounter (K:=K) R (x:=x) (y:=y) (f z.1) (f z.2)) := + by + have hf1 : Measurable (fun z : Ω×Ω ↦ f z.1) := hf.comp measurable_fst + have hf2 : Measurable (fun z : Ω×Ω ↦ f z.2) := hf.comp measurable_snd + have hpair : Measurable (fun z : Ω×Ω ↦ (f z.1,f z.2)) := hf1.prodMk hf2 + exact Measurable.comp + (g:=fun p : SimplePath x y × SimplePath x y ↦ simpleEncounter (K:=K) R p.1 p.2) + (f:=fun z : Ω×Ω ↦ (f z.1,f z.2)) + (measurable_simpleEncounter (K:=K) R x y) hpair + +@[fun_prop] lemma measurable_dyadicEncounter {K n : ℕ} [NeZero K] (hK : 2 fun_prop + +lemma dyadic_environment_moment {K n : ℕ} [NeZero K] (hK : 2 simp [torusProjection,v] + +lemma current_admissible_card {K : ℕ} [NeZero K] (hK : 400≤K) : + K^6≤2000*(currentAdmissiblePairs K).card := by + let m := K/10 + let I := Finset.Icc (K/10+1) (K/8) + let J := Finset.range (2*m+1) + let S : Finset (DiscreteTorus K × ℕ × ℕ × ℕ) := + Finset.univ ×ˢ (I ×ˢ (J ×ˢ J)) + let f : DiscreteTorus K × ℕ × ℕ × ℕ → DiscreteTorus K × DiscreteTorus K := + fun z ↦ (z.1,z.1+![(z.2.1:ZMod K),((z.2.2.1:ℤ)-m:ZMod K),((z.2.2.2:ℤ)-m:ZMod K)]) + have hI (n : ℕ) (hn : n∈I) : K≤10*n ∧ 8*n≤K ∧ n omega + have hsub : S.image f⊆currentAdmissiblePairs K := by + intro z hz + obtain ⟨⟨x,n,b,c⟩,hu,rfl⟩ := Finset.mem_image.mp hz + simp only [S,Finset.mem_product] at hu + obtain ⟨_,hn,hb,hc⟩ := hu + have hin := hI n hn + apply Finset.mem_filter.mpr + refine ⟨Finset.mem_univ _,n,hin.1,hin.2.1,![(b:ℤ)-m,(c:ℤ)-m],?_,?_⟩ + · intro j + fin_cases j + · exact (hJ b hb).2.trans (by exact_mod_cast hin.2.2.2.le) + · exact (hJ c hc).2.trans (by exact_mod_cast hin.2.2.2.le) + · simp [f] + have hinj : Set.InjOn f (↑S : Set _) := by + rintro ⟨x,n,b,c⟩ hx ⟨x',n',b',c'⟩ hx' he + have he₁ : x=x' := congrArg Prod.fst he + subst x' + have he₂ : ![(n:ZMod K),((b:ℤ)-m:ZMod K),((c:ℤ)-m:ZMod K)]= + ![(n':ZMod K),((b':ℤ)-m:ZMod K),((c':ℤ)-m:ZMod K)] := + add_left_cancel (congrArg Prod.snd he) + change (x,n,b,c)∈S at hx + change (x,n',b',c')∈S at hx' + simp only [S,Finset.mem_product] at hx hx' + obtain ⟨_,hn,hb,hc⟩ := hx + obtain ⟨_,hn',hb',hc'⟩ := hx' + have hnval := congrArg (fun z : Fin 3 → ZMod K ↦ (z 0).val) he₂ + simp only [Matrix.cons_val_zero,ZMod.val_natCast_of_lt (hI n hn).2.2.1, + ZMod.val_natCast_of_lt (hI n' hn').2.2.1] at hnval + have hbeq : (b:ZMod K)=(b':ZMod K) := by + have h := congrFun he₂ 1 + simpa using h + have hceq : (c:ZMod K)=(c':ZMod K) := by + have h := congrFun he₂ 2 + simpa using h + have hbval := congrArg ZMod.val hbeq + have hcval := congrArg ZMod.val hceq + simp only [ZMod.val_natCast_of_lt (hJ b hb).1,ZMod.val_natCast_of_lt (hJ b' hb').1] at hbval + simp only [ZMod.val_natCast_of_lt (hJ c hc).1,ZMod.val_natCast_of_lt (hJ c' hc').1] at hcval + simp only [Prod.mk.injEq] + exact ⟨trivial,hnval,hbval,hcval⟩ + have hcard : S.card≤(currentAdmissiblePairs K).card := + (Finset.card_image_iff.mpr hinj).symm.trans_le (Finset.card_le_card hsub) + have hcardS : S.card=K^3*I.card*J.card^2 := by + dsimp only [S] + rw [Finset.card_product,Finset.card_product,Finset.card_product] + simp [DiscreteTorus,mul_assoc,pow_two] + have hcardI : K≤50*I.card := by + dsimp [I] + rw [Nat.card_Icc] + omega + have hcardJ : K≤6*J.card := by + simp only [J,Finset.card_range,m] + omega + rw [hcardS] at hcard + calc + K^6=K^3*K*K^2 := by ring + _ ≤ K^3*(50*I.card)*(6*J.card)^2 := Nat.mul_le_mul + (Nat.mul_le_mul_left _ hcardI) (Nat.pow_le_pow_left hcardJ 2) + _ = 1800*(K^3*I.card*J.card^2) := by ring + _ ≤ 1800*(currentAdmissiblePairs K).card := Nat.mul_le_mul_left _ hcard + _ ≤ _ := Nat.mul_le_mul_right _ (by decide) + +end HardSphere.DyadicSkeleton +end +end + +section + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped ENNReal BigOperators +namespace HardSphere.DyadicSkeleton +open HardSphere.Lattice + +theorem current_good_paths (R : ℕ) : + ∃ p₀ κ : ℝ, 0 simp [torusProjection,v,n,Δ₂,Δ₃,ZMod.coe_valMinAbs] + +lemma horizon_self (n : ℕ) : n/2≤3^n := by + have : n≤3^n := by + induction n with + | zero => simp + | succ n ih => + rw [pow_succ] + have : 0<3^n := by positivity + omega + exact (Nat.div_le_self _ _).trans this + +theorem admissiblePairs_card {K : ℕ} [NeZero K] (hK : 8≤K) : + K^6≤8*(admissiblePairs K).card := by + let I := Finset.Icc (K/4+1) (K/2) + let S : Finset (DiscreteTorus K × ℕ × ZMod K × ZMod K) := + Finset.univ ×ˢ (I ×ˢ (Finset.univ ×ˢ Finset.univ)) + let f : DiscreteTorus K × ℕ × ZMod K × ZMod K → DiscreteTorus K × DiscreteTorus K := + fun z ↦ (z.1,z.1+![(z.2.1:ZMod K),z.2.2.1,z.2.2.2]) + have hI (n : ℕ) (hn : n∈I) : K≤4*n ∧ 2*n≤K ∧ n linarith [h.1,h.2] + +@[fun_prop] lemma measurable_uniform (j : Fin 2) (ℓ k : ℕ) : + Measurable (fun ω ↦ uniform ω j ℓ k) := by + unfold uniform + fun_prop + +def decay : ℝ := (2:ℝ)^(-(1:ℝ)/4) +def cvel : ℝ := (1-decay)/2 + +lemma decay_pos : 0 < decay := Real.rpow_pos_of_pos (by norm_num) _ +lemma decay_lt_one : decay < 1 := by + exact Real.rpow_lt_one_of_one_lt_of_neg (by norm_num) (by norm_num) +lemma cvel_pos : 0 < cvel := by unfold cvel; linarith [decay_lt_one] + +def velocity (ω : Noise) (j : Fin 2) (i : ℕ) : ℝ := + cvel * ∑' ℓ : ℕ, decay^ℓ * uniform ω j ℓ (i/2^ℓ) + +def position (ω : Noise) (j : Fin 2) (t : ℕ) : ℝ := + ∑ i ∈ Finset.range t, velocity ω j i + +lemma summable_velocity (ω : Noise) (j : Fin 2) (i : ℕ) : + Summable (fun ℓ : ℕ ↦ decay^ℓ * uniform ω j ℓ (i/2^ℓ)) := by + apply Summable.of_norm_bounded (summable_geometric_of_lt_one decay_pos.le decay_lt_one) + intro ℓ + rw [Real.norm_eq_abs, abs_mul, abs_of_nonneg (pow_nonneg decay_pos.le _)] + exact (mul_le_mul_of_nonneg_left (uniform_abs_le ω j ℓ _) (pow_nonneg decay_pos.le _)).trans_eq (mul_one _) + +lemma velocity_abs_le (ω : Noise) (j : Fin 2) (i : ℕ) : + |velocity ω j i| ≤ 1/2 := by + have hsum : |∑' ℓ : ℕ, decay^ℓ * uniform ω j ℓ (i/2^ℓ)| ≤ + ∑' ℓ : ℕ, decay^ℓ := by + apply (norm_tsum_le_tsum_norm (summable_velocity ω j i).norm).trans + apply Summable.tsum_le_tsum _ (summable_velocity ω j i).norm + (summable_geometric_of_lt_one decay_pos.le decay_lt_one) + intro ℓ + rw [Real.norm_eq_abs, abs_mul, abs_of_nonneg (pow_nonneg decay_pos.le _)] + simpa using mul_le_mul_of_nonneg_left (uniform_abs_le ω j ℓ _) (pow_nonneg decay_pos.le _) + rw [tsum_geometric_of_lt_one decay_pos.le decay_lt_one] at hsum + rw [velocity,abs_mul,abs_of_pos cvel_pos] + calc + _ ≤ cvel * (1-decay)⁻¹ := mul_le_mul_of_nonneg_left hsum cvel_pos.le + _ = 1/2 := by + unfold cvel + have hd : 1-decay ≠ 0 := ne_of_gt (sub_pos.mpr decay_lt_one) + field_simp + +@[fun_prop] lemma measurable_velocity (j : Fin 2) (i : ℕ) : + Measurable (fun ω ↦ velocity ω j i) := by + unfold velocity + apply Measurable.const_mul + exact Measurable.tsum (fun ℓ ↦ measurable_const.mul (measurable_uniform j ℓ _)) + +@[fun_prop] lemma measurable_position (j : Fin 2) (t : ℕ) : + Measurable (fun ω ↦ position ω j t) := by + unfold position + fun_prop + +lemma position_succ (ω : Noise) (j : Fin 2) (t : ℕ) : + position ω j (t+1) = position ω j t + velocity ω j t := by + exact Finset.sum_range_succ _ _ + +lemma exists_fresh_block (t k : ℕ) (hk : 0 < k) : + ∃ ℓ b : ℕ, t ≤ b*2^ℓ ∧ (b+1)*2^ℓ ≤ t+k ∧ k ≤ 4*2^ℓ := by + by_cases hk1 : k=1 + · subst k + exact ⟨0,t,by simp,by simp,by norm_num⟩ + have hk2 : 1 ≤ k/2 := by omega + let ℓ := Nat.log 2 (k/2) + let d := 2^ℓ + have hd : 0 < d := by dsimp [d]; positivity + have hdle : d ≤ k/2 := Nat.pow_log_le_self 2 (by omega) + have hdgt : k/2 < 2*d := by + have h := Nat.lt_pow_succ_log_self (by decide : 1 < 2) (k/2) + simpa only [Nat.pow_succ,Nat.mul_comm] using h + refine ⟨ℓ,t/d+1,?_,?_,?_⟩ + · change t ≤ (t/d+1)*d + have h₁ := Nat.mod_lt t hd + have h₂ := Nat.mod_add_div t d + nlinarith + · change (t/d+1+1)*d ≤ t+k + have h := Nat.div_mul_le_self t d + have h₂ : 2*d ≤ k := by omega + nlinarith + · change k ≤ 4*d + omega + +lemma resample_preserving (q : Index) : + MeasurePreserving (fun z : Noise × unitInterval ↦ Function.update z.1 q z.2) + (law.prod volume) law := by + classical + refine ⟨measurable_update', ?_⟩ + apply Measure.eq_infinitePi + intro s A hA + rw [Measure.map_apply measurable_update' (.pi s.countable_toSet fun i _ ↦ hA i)] + by_cases hq : q ∈ s + · have he : (fun z : Noise × unitInterval ↦ Function.update z.1 q z.2) ⁻¹' + ((s : Set Index).pi A) = ((s.erase q : Set Index).pi A) ×ˢ A q := by + ext z + simp only [mem_preimage,Set.mem_pi,Finset.mem_coe,mem_prod,Finset.mem_erase] + constructor + · intro h + refine ⟨fun i hi ↦ ?_, ?_⟩ + · simpa [Function.update_of_ne hi.1] using h i hi.2 + · simpa using h q hq + · rintro ⟨h,h'⟩ i hi + by_cases hiq : i=q + · subst i; simpa using h' + · simpa [Function.update_of_ne hiq] using h i ⟨hiq,hi⟩ + rw [he,Measure.prod_prod,law,Measure.infinitePi_pi _ (fun i _ ↦ hA i)] + exact Finset.prod_erase_mul s (fun i ↦ volume (A i)) hq + · have he : (fun z : Noise × unitInterval ↦ Function.update z.1 q z.2) ⁻¹' + ((s : Set Index).pi A) = ((s : Set Index).pi A) ×ˢ univ := by + ext z + simp only [mem_preimage,Set.mem_pi,Finset.mem_coe,mem_prod,mem_univ,and_true] + apply forall_congr' + intro i + apply forall_congr' + intro hi + have hiq : i≠q := by intro he; subst i; exact hq hi + rw [Function.update_of_ne hiq] + rw [he,Measure.prod_prod,measure_univ,mul_one,law, + Measure.infinitePi_pi _ (fun i _ ↦ hA i)] + +lemma lintegral_resample (q : Index) (f : Noise → ℝ≥0∞) (hf : Measurable f) : + (∫⁻ ω, f ω ∂law) = + ∫⁻ ω, ∫⁻ x : unitInterval, f (Function.update ω q x) ∂volume ∂law := by + rw [← (resample_preserving q).lintegral_comp hf] + exact lintegral_prod _ (hf.comp measurable_update').aemeasurable + +lemma velocity_update_sub (ω : Noise) (j : Fin 2) (ℓ b i : ℕ) + (x : unitInterval) : + velocity (Function.update ω (j,ℓ,b) x) j i - velocity ω j i = + if i/2^ℓ=b then cvel * decay^ℓ * (2*((x:ℝ)-(ω (j,ℓ,b):ℝ))) else 0 := by + classical + rw [velocity,velocity,←mul_sub,← (summable_velocity _ j i).tsum_sub + (summable_velocity ω j i)] + have he : (fun a ↦ decay^a * uniform (Function.update ω (j,ℓ,b) x) j a (i/2^a) - + decay^a * uniform ω j a (i/2^a)) = + (fun a ↦ if a=ℓ then decay^ℓ * + (if i/2^ℓ=b then 2*((x:ℝ)-(ω (j,ℓ,b):ℝ)) else 0) else 0) := by + funext a + by_cases ha : a=ℓ + · subst a + by_cases hi : i/2^ℓ=b + · simp [hi,uniform] + ring + · simp [hi,uniform] + · simp [ha,uniform] + rw [he,tsum_ite_eq] + split_ifs <;> ring + +lemma position_update_past (ω : Noise) (j : Fin 2) (ℓ b t : ℕ) + (ht : t ≤ b*2^ℓ) (x : unitInterval) : + position (Function.update ω (j,ℓ,b) x) j t = position ω j t := by + classical + apply Finset.sum_congr rfl + intro i hi + have hi' : i < b*2^ℓ := (Finset.mem_range.mp hi).trans_le ht + have hn : i/2^ℓ ≠ b := by + intro he + have hd := Nat.div_mul_le_self i (2^ℓ) + rw [he] at hd + omega + have h := velocity_update_sub ω j ℓ b i x + rw [ite_eq_right hn] at h + linarith + +lemma block_filter (ℓ b n : ℕ) (hn : (b+1)*2^ℓ ≤ n) : + (Finset.range n).filter (fun i ↦ i/2^ℓ=b) = + Finset.Ico (b*2^ℓ) ((b+1)*2^ℓ) := by + ext i + simp only [Finset.mem_filter,Finset.mem_range,Finset.mem_Ico] + constructor + · rintro ⟨hi,hd⟩ + have hlo := Nat.div_mul_le_self i (2^ℓ) + have hhi := Nat.mod_lt i (by positivity : 0 < 2^ℓ) + have he := Nat.mod_add_div i (2^ℓ) + rw [hd] at hlo he + constructor + · exact hlo + · nlinarith + · rintro ⟨hlo,hhi⟩ + exact ⟨hhi.trans_le hn,Nat.div_eq_of_lt_le hlo hhi⟩ + +lemma position_update_future (ω : Noise) (j : Fin 2) (ℓ b n : ℕ) + (hn : (b+1)*2^ℓ ≤ n) (x : unitInterval) : + position (Function.update ω (j,ℓ,b) x) j n - position ω j n = + (2^ℓ:ℕ) * cvel * decay^ℓ * (2*((x:ℝ)-(ω (j,ℓ,b):ℝ))) := by + classical + rw [position,position,← Finset.sum_sub_distrib] + simp_rw [velocity_update_sub] + rw [← Finset.sum_filter,block_filter ℓ b n hn] + simp only [Finset.sum_const,Nat.card_Ico,nsmul_eq_mul] + have he : (b+1)*2^ℓ-b*2^ℓ=2^ℓ := by rw [Nat.add_mul,one_mul,Nat.add_sub_cancel_left] + rw [he] + ring + +lemma position_update_other (ω : Noise) (j j' : Fin 2) (hjj : j' ≠ j) + (ℓ b n : ℕ) (x : unitInterval) : + position (Function.update ω (j,ℓ,b) x) j' n = position ω j' n := by + unfold position velocity + apply Finset.sum_congr rfl + intro i _ + congr 1 + apply tsum_congr + intro a + have hn : (j',a,i/2^a) ≠ (j,ℓ,b) := by + intro h; exact hjj (congrArg Prod.fst h) + simp only [uniform,Function.update_of_ne hn] + +lemma affine_interval_volume (A B y R : ℝ) (hA : 0 < A) : + volume {x : unitInterval | |A*(x:ℝ)+B-y| ≤ R} ≤ ENNReal.ofReal (2*R/A) := by + rw [unitInterval.volume_apply] + have hs : Subtype.val '' {x : unitInterval | |A*(x:ℝ)+B-y| ≤ R} ⊆ + Icc ((y-B-R)/A) ((y-B+R)/A) := by + rintro z ⟨x,hx,rfl⟩ + change |A*(x:ℝ)+B-y| ≤ R at hx + have hx' := abs_le.mp hx + constructor + · rw [div_le_iff₀ hA] + nlinarith + · rw [le_div_iff₀ hA] + nlinarith + refine (measure_mono hs).trans_eq ?_ + rw [Real.volume_Icc] + congr 1 + ring + +def coordinateTest (j : Fin 2) (n : ℕ) (y R : ℝ) (ω : Noise) : ℝ≥0∞ := + {ω | |position ω j n-y| ≤ R}.indicator (fun _ ↦ 1) ω + +@[fun_prop] lemma measurable_coordinateTest (j : Fin 2) (n : ℕ) (y R : ℝ) : + Measurable (coordinateTest j n y R) := by + apply measurable_const.indicator + exact measurableSet_le ((measurable_position j n).sub_const y).abs measurable_const + +lemma coordinateTest_update_other (ω : Noise) (j j' : Fin 2) (hjj : j' ≠ j) + (ℓ b n : ℕ) (y R : ℝ) (x : unitInterval) : + coordinateTest j' n y R (Function.update ω (j,ℓ,b) x) = + coordinateTest j' n y R ω := by + simp only [coordinateTest,Set.indicator_apply,Set.mem_ofPred_eq, + position_update_other ω j j' hjj ℓ b n x] + +lemma coordinateTest_update_past (ω : Noise) (j j' : Fin 2) + (ℓ b n : ℕ) (hn : n ≤ b*2^ℓ) (y R : ℝ) (x : unitInterval) : + coordinateTest j' n y R (Function.update ω (j,ℓ,b) x) = + coordinateTest j' n y R ω := by + by_cases hjj : j'=j + · subst j' + simp only [coordinateTest,Set.indicator_apply,Set.mem_ofPred_eq, + position_update_past ω j ℓ b n hn x] + · exact coordinateTest_update_other ω j j' hjj ℓ b n y R x + +def freshScale (ℓ : ℕ) : ℝ := (2^ℓ:ℕ) * cvel * decay^ℓ +lemma freshScale_pos (ℓ : ℕ) : 0 < freshScale ℓ := by + unfold freshScale + exact mul_pos (mul_pos (by positivity) cvel_pos) (pow_pos decay_pos _) + +lemma fresh_coordinate_integral (ω : Noise) (j : Fin 2) (ℓ b n : ℕ) + (hn : (b+1)*2^ℓ ≤ n) (y R : ℝ) : + (∫⁻ x : unitInterval, coordinateTest j n y R (Function.update ω (j,ℓ,b) x)) ≤ + ENNReal.ofReal (R/freshScale ℓ) := by + let A := 2*freshScale ℓ + let B := position ω j n - 2*freshScale ℓ*(ω (j,ℓ,b):ℝ) + have he (x : unitInterval) : position (Function.update ω (j,ℓ,b) x) j n = + A*(x:ℝ)+B := by + have h := position_update_future ω j ℓ b n hn x + change _ = freshScale ℓ * (2*((x:ℝ)-(ω (j,ℓ,b):ℝ))) at h + dsimp only [A,B] + linarith + have hm : MeasurableSet {x : unitInterval | |A*(x:ℝ)+B-y| ≤ R} := by + apply measurableSet_le _ measurable_const + fun_prop + simp only [coordinateTest,Set.indicator_apply,Set.mem_ofPred_eq,he] + change (∫⁻ x : unitInterval, + {x : unitInterval | |A*(x:ℝ)+B-y| ≤ R}.indicator (fun _ ↦ 1) x) ≤ _ + rw [lintegral_indicator hm] + simp only [lintegral_const,Measure.restrict_apply_univ,one_mul] + refine (affine_interval_volume A B y R (mul_pos (by norm_num) (freshScale_pos ℓ))).trans_eq ?_ + congr 1 + dsimp only [A] + field_simp + +lemma fresh_weighted_coordinate (j : Fin 2) (ℓ b n : ℕ) + (hn : (b+1)*2^ℓ ≤ n) (y R : ℝ) (H : Noise → ℝ≥0∞) (hH : Measurable H) + (hinv : ∀ ω x, H (Function.update ω (j,ℓ,b) x) = H ω) : + (∫⁻ ω, H ω * coordinateTest j n y R ω ∂law) ≤ + ENNReal.ofReal (R/freshScale ℓ) * ∫⁻ ω, H ω ∂law := by + rw [lintegral_resample (j,ℓ,b) (fun ω ↦ H ω * coordinateTest j n y R ω) + (hH.mul (measurable_coordinateTest j n y R))] + simp_rw [hinv] + calc + _ = ∫⁻ ω, H ω * ∫⁻ x : unitInterval, + coordinateTest j n y R (Function.update ω (j,ℓ,b) x) ∂volume ∂law := by + apply lintegral_congr + intro ω + exact lintegral_const_mul _ ((measurable_coordinateTest j n y R).comp + (measurable_update ω)) + _ ≤ ∫⁻ ω, H ω * ENNReal.ofReal (R/freshScale ℓ) ∂law := by + apply lintegral_mono + intro ω + exact mul_le_mul_right (fresh_coordinate_integral ω j ℓ b n hn y R) (H ω) + _ = _ := by rw [lintegral_mul_const _ hH,mul_comm] + +def nearTest (n : ℕ) (y : Fin 2 → ℝ) (R : ℝ) (ω : Noise) : ℝ≥0∞ := + coordinateTest 0 n (y 0) R ω * coordinateTest 1 n (y 1) R ω + +@[fun_prop] lemma measurable_nearTest (n : ℕ) (y : Fin 2 → ℝ) (R : ℝ) : + Measurable (nearTest n y R) := + (measurable_coordinateTest 0 n (y 0) R).mul (measurable_coordinateTest 1 n (y 1) R) + +lemma nearTest_le_one (n : ℕ) (y : Fin 2 → ℝ) (R : ℝ) (ω : Noise) : + nearTest n y R ω ≤ 1 := by + unfold nearTest coordinateTest + simp only [Set.indicator_apply] + split_ifs <;> simp_all + +def PastInvariant (t : ℕ) (H : Noise → ℝ≥0∞) : Prop := + ∀ (j : Fin 2) (ℓ b : ℕ), t ≤ b*2^ℓ → ∀ ω x, + H (Function.update ω (j,ℓ,b) x) = H ω + +lemma nearTest_pastInvariant (n t : ℕ) (hnt : n ≤ t) (y : Fin 2 → ℝ) (R : ℝ) : + PastInvariant t (nearTest n y R) := by + intro j ℓ b hb ω x + simp only [nearTest,coordinateTest_update_past ω j 0 ℓ b n (hnt.trans hb), + coordinateTest_update_past ω j 1 ℓ b n (hnt.trans hb)] + +lemma fresh_weighted_pair (ℓ b n : ℕ) (hn : (b+1)*2^ℓ ≤ n) + (y : Fin 2 → ℝ) (R : ℝ) (H : Noise → ℝ≥0∞) (hH : Measurable H) + (hinv : ∀ j : Fin 2, ∀ ω x, H (Function.update ω (j,ℓ,b) x) = H ω) : + (∫⁻ ω, H ω * nearTest n y R ω ∂law) ≤ + ENNReal.ofReal (R/freshScale ℓ)^2 * ∫⁻ ω, H ω ∂law := by + let a := ENNReal.ofReal (R/freshScale ℓ) + calc + _ = ∫⁻ ω, (H ω * coordinateTest 1 n (y 1) R ω) * + coordinateTest 0 n (y 0) R ω ∂law := by + apply lintegral_congr; intro ω; simp only [nearTest]; ring + _ ≤ a * ∫⁻ ω, H ω * coordinateTest 1 n (y 1) R ω ∂law := + fresh_weighted_coordinate 0 ℓ b n hn (y 0) R _ + (hH.mul (measurable_coordinateTest 1 n (y 1) R)) (by + intro ω x + rw [hinv 0,coordinateTest_update_other ω 0 1 (by decide)]) + _ ≤ a * (a * ∫⁻ ω, H ω ∂law) := + mul_le_mul_right (fresh_weighted_coordinate 1 ℓ b n hn (y 1) R H hH (hinv 1)) a + _ = _ := by ring + +lemma freshScale_eq_rpow (ℓ : ℕ) : + freshScale ℓ = cvel * ((2:ℝ)^ℓ)^((3:ℝ)/4) := by + have hd : decay^ℓ = ((2:ℝ)^ℓ)^(-(1:ℝ)/4) := by + rw [decay,← Real.rpow_mul_natCast (by norm_num : (0:ℝ) ≤ 2), + ← Real.rpow_natCast_mul (by norm_num : (0:ℝ) ≤ 2)] + congr 1 + ring + rw [freshScale,Nat.cast_pow,Nat.cast_ofNat,hd] + calc + _ = cvel * (((2:ℝ)^ℓ)^((1:ℝ)) * ((2:ℝ)^ℓ)^(-(1:ℝ)/4)) := by + rw [Real.rpow_one]; ring + _ = cvel * ((2:ℝ)^ℓ)^((1:ℝ)+(-(1:ℝ)/4)) := by + rw [Real.rpow_add (by positivity)] + _ = _ := by norm_num + +lemma freshScale_sq (ℓ : ℕ) : + freshScale ℓ ^ 2 = cvel^2 * ((2:ℝ)^ℓ)^((3:ℝ)/2) := by + rw [freshScale_eq_rpow,mul_pow,← Real.rpow_mul_natCast (by positivity)] + norm_num + +lemma freshScale_gap_bound (k ℓ : ℕ) (hk : 0 < k) (hkℓ : k ≤ 4*2^ℓ) (R : ℝ) : + (R/freshScale ℓ)^2 ≤ (16*R^2/cvel^2) * (k:ℝ)^(-(3:ℝ)/2) := by + have hd : 0 < (2:ℝ)^ℓ := by positivity + have hk' : 0 < (k:ℝ) := by exact_mod_cast hk + have hpow : (k:ℝ)^((3:ℝ)/2) ≤ 16*((2:ℝ)^ℓ)^((3:ℝ)/2) := by + have hg : (k:ℝ) ≤ 4*(2:ℝ)^ℓ := by exact_mod_cast hkℓ + calc + _ ≤ (4*(2:ℝ)^ℓ)^((3:ℝ)/2) := + Real.rpow_le_rpow hk'.le hg (by norm_num) + _ = (4:ℝ)^((3:ℝ)/2) * ((2:ℝ)^ℓ)^((3:ℝ)/2) := + Real.mul_rpow (by norm_num) hd.le + _ ≤ 16 * ((2:ℝ)^ℓ)^((3:ℝ)/2) := by + apply mul_le_mul_of_nonneg_right _ (Real.rpow_nonneg hd.le _) + have h := Real.rpow_le_rpow_of_exponent_le (by norm_num : (1:ℝ) ≤ 4) + (by norm_num : (3:ℝ)/2 ≤ 2) + norm_num at h ⊢ + have hc2 : 0 < cvel^2 := sq_pos_of_pos cvel_pos + have hd2 : 0 < ((2:ℝ)^ℓ)^((3:ℝ)/2) := Real.rpow_pos_of_pos hd _ + have hk2 : 0 < (k:ℝ)^((3:ℝ)/2) := Real.rpow_pos_of_pos hk' _ + rw [div_pow,freshScale_sq] + rw [show -(3:ℝ)/2 = -((3:ℝ)/2) by ring,Real.rpow_neg hk'.le,← div_eq_mul_inv] + apply (div_le_div_iff₀ (mul_pos hc2 hd2) hk2).mpr + calc + _ ≤ R^2 * (16*((2:ℝ)^ℓ)^((3:ℝ)/2)) := + mul_le_mul_of_nonneg_left hpow (sq_nonneg R) + _ = _ := by field_simp [ne_of_gt cvel_pos] + +end HardSphere.DyadicSkeleton +end +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Paths/LevelList.lean b/lean/OAI/Analysis/HardSphere/Paths/LevelList.lean new file mode 100644 index 0000000000000000000000000000000000000000..40ce37c9e03557b6c18888fd604994c4bc1ffb26 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Paths/LevelList.lean @@ -0,0 +1,427 @@ +import Mathlib +import OAI.Analysis.HardSphere.Paths.NearPotential + +namespace OAI + +section +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal BigOperators Topology +namespace HardSphere.DyadicSkeleton + +lemma refineStep_mem (a b x : Vertex) (hx : x ∈ refineStep a b) : + x 0 = b 0 ∧ ∀j, |x j-b j| ≤ |a j-b j| := by + simp only [refineStep,List.mem_append,List.mem_singleton,List.mem_map] at hx + rcases hx with (rfl|⟨c,hc,rfl⟩)|⟨c,hc,rfl⟩ + · refine ⟨rfl,?_⟩ + intro j + fin_cases j <;> simp + · refine ⟨rfl,?_⟩ + intro j + fin_cases j + · simp + · exact axisSteps_near_final _ _ _ hc + · simp + · refine ⟨rfl,?_⟩ + intro j + fin_cases j + · simp + · simp + · exact axisSteps_near_final _ _ _ hc + +def levelList (n : ℕ) (d : Fin 2 → ℤ) (ω : Noise) : ℕ → List Vertex + | 0 => [baseVertex n d ω 0] + | t+1 => refineStep (baseVertex n d ω t) (baseVertex n d ω (t+1)) + +def occurrenceList (n : ℕ) (d : Fin 2 → ℤ) (ω : Noise) : List Vertex := + (List.range (n+1)).flatMap (levelList n d ω) + +lemma levelList_length (n : ℕ) (hn : 0 < n) (d : Fin 2 → ℤ) + (hd : ∀j, |d j| ≤ n) (ω : Noise) (t : ℕ) (ht : t ≤ n) : + (levelList n d ω t).length ≤ 5 := by + cases t with + | zero => simp [levelList] + | succ t => exact refineStep_length _ _ (baseVertex_step n hn d hd ω t (by omega)) + +lemma levelList_mem (n : ℕ) (hn : 0 < n) (d : Fin 2 → ℤ) + (hd : ∀j, |d j| ≤ n) (ω : Noise) (t : ℕ) (ht : t ≤ n) + (x : Vertex) (hx : x ∈ levelList n d ω t) : + x 0 = (t:ℤ) ∧ ∀j, |x j-baseVertex n d ω t j| ≤ 2 := by + cases t with + | zero => + have he : x = baseVertex n d ω 0 := by simpa only [levelList,List.mem_singleton] using hx + subst x + simp [baseVertex] + | succ t => + obtain ⟨h0,hb⟩ := refineStep_mem _ _ x hx + refine ⟨h0,fun j ↦ (hb j).trans ?_⟩ + rw [abs_sub_comm] + exact baseVertex_step n hn d hd ω t (by omega) j + +lemma occurrenceList_initial (n : ℕ) (d : Fin 2 → ℤ) (ω : Noise) : + (0:Vertex) ∈ occurrenceList n d ω := by + apply List.mem_flatMap.mpr + refine ⟨0,by simp,?_⟩ + simp [levelList,baseVertex_initial] + +lemma integer_step_lipschitz (f : ℕ → ℤ) (H : ℕ) (L : ℤ) + (hstep : ∀ i simp + | @succ b hab ih => + have h := hstep b (by omega) + have hh := ih (by omega) + calc + |f (b+1)-f a| ≤ |f (b+1)-f b|+|f b-f a| := abs_sub_le _ _ _ + _ ≤ L+L*((b:ℤ)-a) := add_le_add h hh + _ = _ := by push_cast; ring + rcases le_total i j with h|h + · rw [abs_sub_comm (f i),abs_sub_comm (i:ℤ),abs_of_nonneg (by omega : 0≤(j:ℤ)-i)] + exact hforward i j h hj + · rw [abs_of_nonneg (by omega : 0≤(i:ℤ)-j)] + exact hforward j i h hi + +lemma baseVertex_lipschitz (n : ℕ) (hn : 0 < n) (d : Fin 2 → ℤ) + (hd : ∀j, |d j| ≤ n) (ω : Noise) (s t : ℕ) (hs : s ≤ n) (ht : t ≤ n) (j : Fin 3) : + |baseVertex n d ω s j-baseVertex n d ω t j| ≤ 2*|(s:ℤ)-t| := + integer_step_lipschitz (fun u ↦ baseVertex n d ω u j) n 2 + (fun k hk ↦ baseVertex_step n hn d hd ω k hk j) hs ht + +lemma real_sub_floor_le (x y : ℝ) : |x-y| ≤ |(⌊x⌋:ℝ)-(⌊y⌋:ℝ)|+1 := by + have h1 := Int.floor_le x + have h2 := Int.lt_floor_add_one x + have h3 := Int.floor_le y + have h4 := Int.lt_floor_add_one y + have hl := neg_abs_le ((⌊x⌋:ℝ)-(⌊y⌋:ℝ)) + have hu := le_abs_self ((⌊x⌋:ℝ)-(⌊y⌋:ℝ)) + apply abs_le.mpr + constructor <;> linarith + +lemma floor_sub_real_le (x y : ℝ) : |(⌊x⌋:ℝ)-(⌊y⌋:ℝ)| ≤ |x-y|+1 := by + have h1 := Int.floor_le x + have h2 := Int.lt_floor_add_one x + have h3 := Int.floor_le y + have h4 := Int.lt_floor_add_one y + have hl := neg_abs_le (x-y) + have hu := le_abs_self (x-y) + apply abs_le.mpr + constructor <;> linarith + +lemma same_time_position_bound (n t : ℕ) (ht : t ≤ n) (ω ω' : Noise) (j : Fin 2) : + |position ω j (min t (n-t))-position ω' j (min t (n-t))| ≤ (n:ℝ)/2 := by + have hu : 2*(min t (n-t)) ≤ n := by omega + have hu' : 2*((min t (n-t):ℕ):ℝ) ≤ (n:ℝ) := by exact_mod_cast hu + calc + _ ≤ |position ω j (min t (n-t))|+|position ω' j (min t (n-t))| := abs_sub _ _ + _ ≤ ((min t (n-t):ℕ):ℝ)/2+((min t (n-t):ℕ):ℝ)/2 := + add_le_add (position_abs_le ω j _) (position_abs_le ω' j _) + _ ≤ _ := by linarith + +lemma same_time_floor_bound (n t : ℕ) (ht : t ≤ n) (d : Fin 2 → ℤ) + (ω ω' : Noise) (j : Fin 3) : + |(baseVertex n d ω t j:ℝ)-(baseVertex n d ω' t j:ℝ)| ≤ (n:ℝ)/2+1 := by + have hh (i : Fin 2) : |(⌊baseTrans n d ω t i⌋:ℝ)-(⌊baseTrans n d ω' t i⌋:ℝ)| ≤ + (n:ℝ)/2+1 := by + have h := floor_sub_real_le (baseTrans n d ω t i) (baseTrans n d ω' t i) + have he : baseTrans n d ω t i-baseTrans n d ω' t i = + position ω i (min t (n-t))-position ω' i (min t (n-t)) := by unfold baseTrans; ring + rw [he] at h + exact h.trans (add_le_add (same_time_position_bound n t ht ω ω' i) le_rfl) + fin_cases j + · change |(t:ℝ)-(t:ℝ)| ≤ _ + rw [sub_self,abs_zero] + positivity + · exact hh 0 + · exact hh 1 + +def periodicProjection (K : ℕ) (x : Vertex) : Fin 3 → AddCircle (K:ℝ) := + fun j ↦ ((x j:ℝ) : AddCircle (K:ℝ)) + +def periodicDistance (K : ℕ) (x y : Vertex) : ℝ := + dist (periodicProjection K x) (periodicProjection K y) + +lemma periodicDistance_nonneg (K : ℕ) (x y : Vertex) : 0 ≤ periodicDistance K x y := dist_nonneg +lemma periodicDistance_symm (K : ℕ) (x y : Vertex) : + periodicDistance K x y = periodicDistance K y x := dist_comm _ _ +lemma periodicDistance_triangle (K : ℕ) (x y z : Vertex) : + periodicDistance K x z ≤ periodicDistance K x y+periodicDistance K y z := dist_triangle _ _ _ + +lemma periodicDistance_le (K : ℕ) (x y : Vertex) (r : ℝ) (hr : 0 ≤ r) + (h : ∀j, |(x j:ℝ)-(y j:ℝ)| ≤ r) : periodicDistance K x y ≤ r := by + apply (dist_pi_le_iff hr).mpr + intro j + change dist ((x j:ℝ):AddCircle (K:ℝ)) ((y j:ℝ):AddCircle (K:ℝ)) ≤ r + rw [dist_eq_norm,← QuotientAddGroup.mk_sub] + exact QuotientAddGroup.norm_mk_le_norm.trans (by simpa only [Real.norm_eq_abs] using h j) + +lemma periodicDistance_coord (K : ℕ) (hK : 0 < K) (x y : Vertex) (j : Fin 3) + (h : |(x j:ℝ)-(y j:ℝ)| ≤ (K:ℝ)/2) : + |(x j:ℝ)-(y j:ℝ)| ≤ periodicDistance K x y := by + have hK' : 0 < (K:ℝ) := by exact_mod_cast hK + have he : dist ((x j:ℝ):AddCircle (K:ℝ)) ((y j:ℝ):AddCircle (K:ℝ)) = + |(x j:ℝ)-(y j:ℝ)| := by + rw [dist_eq_norm,← QuotientAddGroup.mk_sub] + exact (AddCircle.norm_coe_eq_abs_iff (K:ℝ) (ne_of_gt hK')).mpr + (by simpa only [abs_of_pos hK'] using h) + rw [← he] + exact dist_le_pi_dist (periodicProjection K x) (periodicProjection K y) j + +lemma periodicDistance_le_half (K : ℕ) (hK : 0 < K) (x y : Vertex) : + periodicDistance K x y ≤ (K:ℝ)/2 := by + have hK' : 0 < (K:ℝ) := by exact_mod_cast hK + apply (dist_pi_le_iff (by positivity : 0 ≤ (K:ℝ)/2)).mpr + intro j + rw [dist_eq_norm] + simpa only [abs_of_pos hK'] using AddCircle.norm_le_half_period (K:ℝ) (x := + periodicProjection K x j-periodicProjection K y j) (ne_of_gt hK') + +lemma same_time_deviation_le (K n : ℕ) (hn : 0 < n) (hnK : 8*n ≤ K) + (d : Fin 2 → ℤ) (ω ω' : Noise) (t : ℕ) (ht : t ≤ n) : + twoCopyDistance (min t (n-t)) (ω,ω') ≤ + periodicDistance K (baseVertex n d ω t) (baseVertex n d ω' t)+1 := by + have hK : 0 < K := by omega + have htrans (i : Fin 2) (j : Fin 3) + (he : baseVertex n d ω t j = ⌊baseTrans n d ω t i⌋) + (he' : baseVertex n d ω' t j = ⌊baseTrans n d ω' t i⌋) : + |position ω i (min t (n-t))-position ω' i (min t (n-t))| ≤ + periodicDistance K (baseVertex n d ω t) (baseVertex n d ω' t)+1 := by + have hp := periodicDistance_coord K hK (baseVertex n d ω t) (baseVertex n d ω' t) j + ((same_time_floor_bound n t ht d ω ω' j).trans (by + have hnr : (1:ℝ) ≤ (n:ℝ) := by exact_mod_cast hn + have hkr : 8*(n:ℝ) ≤ (K:ℝ) := by exact_mod_cast hnK + linarith)) + rw [he,he'] at hp + have hh := real_sub_floor_le (baseTrans n d ω t i) (baseTrans n d ω' t i) + have heq : baseTrans n d ω t i-baseTrans n d ω' t i = + position ω i (min t (n-t))-position ω' i (min t (n-t)) := by unfold baseTrans; ring + rw [heq] at hh + exact hh.trans (add_le_add hp le_rfl) + exact max_le (htrans 0 1 rfl rfl) (htrans 1 2 rfl rfl) + +lemma occurrence_deviation_le (K n : ℕ) (hn : 0 < n) (hnK : 8*n ≤ K) + (d : Fin 2 → ℤ) (hd : ∀j, |d j| ≤ n) (ω ω' : Noise) + (s t : ℕ) (hs : s ≤ n) (ht : t ≤ n) (x y : Vertex) + (hx : x ∈ levelList n d ω s) (hy : y ∈ levelList n d ω' t) : + twoCopyDistance (min s (n-s)) (ω,ω') ≤ 3*periodicDistance K x y+5 := by + obtain ⟨hx0,hxb⟩ := levelList_mem n hn d hd ω s hs x hx + obtain ⟨hy0,hyb⟩ := levelList_mem n hn d hd ω' t ht y hy + have hK : 0 < K := by omega + have hst : |(s:ℝ)-(t:ℝ)| ≤ periodicDistance K x y := by + have h := periodicDistance_coord K hK x y 0 (by + rw [hx0,hy0]; push_cast + apply (abs_le.mpr ⟨by + have hn' : 8*(n:ℝ) ≤ (K:ℝ) := by exact_mod_cast hnK + have hs' : (s:ℝ) ≤ n := by exact_mod_cast hs + have ht' : (t:ℝ) ≤ n := by exact_mod_cast ht + have hsz : (0:ℝ) ≤ s := by positivity + linarith,by + have hn' : 8*(n:ℝ) ≤ (K:ℝ) := by exact_mod_cast hnK + have hs' : (s:ℝ) ≤ n := by exact_mod_cast hs + have ht' : (t:ℝ) ≤ n := by exact_mod_cast ht + have htz : (0:ℝ) ≤ t := by positivity + linarith⟩)) + simpa only [hx0,hy0,Int.cast_natCast] using h + have hxb' : periodicDistance K (baseVertex n d ω s) x ≤ 2 := by + apply periodicDistance_le _ _ _ 2 (by norm_num) + intro j + rw [abs_sub_comm] + exact_mod_cast hxb j + have hyb' : periodicDistance K y (baseVertex n d ω' t) ≤ 2 := by + apply periodicDistance_le _ _ _ 2 (by norm_num) + intro j + exact_mod_cast hyb j + have hbb : periodicDistance K (baseVertex n d ω' t) (baseVertex n d ω' s) ≤ + 2*periodicDistance K x y := by + apply periodicDistance_le _ _ _ _ (mul_nonneg (by norm_num) (periodicDistance_nonneg _ _ _)) + intro j + have h : |(baseVertex n d ω' t j:ℝ)-(baseVertex n d ω' s j:ℝ)| ≤ + 2*|(t:ℝ)-(s:ℝ)| := by + exact_mod_cast baseVertex_lipschitz n hn d hd ω' t s ht hs j + rw [abs_sub_comm (t:ℝ)] at h + linarith + have htri1 := periodicDistance_triangle K (baseVertex n d ω s) x y + have htri2 := periodicDistance_triangle K (baseVertex n d ω s) y (baseVertex n d ω' t) + have htri3 := periodicDistance_triangle K (baseVertex n d ω s) + (baseVertex n d ω' t) (baseVertex n d ω' s) + have hdev := same_time_deviation_le K n hn hnK d ω ω' s hs + linarith + +def distanceToList (K : ℕ) (x : Vertex) (l : List Vertex) : ℝ := + l.foldr (fun y r ↦ min (periodicDistance K x y) r) ((K:ℝ)/2) + +lemma distanceToList_nonneg (K : ℕ) (x : Vertex) (l : List Vertex) : + 0 ≤ distanceToList K x l := by + induction l with + | nil => simp only [distanceToList,List.foldr_nil]; positivity + | cons y l ih => exact le_min (periodicDistance_nonneg _ _ _) ih + +lemma distanceToList_le (K : ℕ) (x y : Vertex) (l : List Vertex) (hy : y ∈ l) : + distanceToList K x l ≤ periodicDistance K x y := by + induction l with + | nil => simp at hy + | cons z l ih => + rcases List.mem_cons.mp hy with rfl|hy + · exact min_le_left _ _ + · exact (min_le_right _ _).trans (ih hy) + +lemma distanceToList_attained (K : ℕ) (hK : 0 < K) (x : Vertex) (l : List Vertex) + (hne : l ≠ []) : ∃ y ∈ l, distanceToList K x l = periodicDistance K x y := by + induction l with + | nil => exact False.elim (hne rfl) + | cons z l ih => + by_cases hl : l = [] + · subst l + refine ⟨z,by simp,?_⟩ + exact min_eq_left (periodicDistance_le_half K hK x z) + · obtain ⟨y,hy,he⟩ := ih hl + change ∃ y ∈ z::l, min (periodicDistance K x z) (distanceToList K x l) = _ + rcases le_total (periodicDistance K x z) (distanceToList K x l) with h|h + · exact ⟨z,by simp,min_eq_left h⟩ + · exact ⟨y,by simp [hy],(min_eq_right h).trans he⟩ + +lemma occurrenceList_ne_nil (n : ℕ) (d : Fin 2 → ℤ) (ω : Noise) : + occurrenceList n d ω ≠ [] := List.ne_nil_of_mem (occurrenceList_initial n d ω) + +lemma distanceToList_deviation_le (K n : ℕ) (hn : 0 < n) (hnK : 8*n ≤ K) + (d : Fin 2 → ℤ) (hd : ∀j, |d j| ≤ n) (ω ω' : Noise) + (s : ℕ) (hs : s ≤ n) (x : Vertex) (hx : x ∈ levelList n d ω s) : + twoCopyDistance (min s (n-s)) (ω,ω') ≤ + 3*distanceToList K x (occurrenceList n d ω')+5 := by + obtain ⟨y,hy,he⟩ := distanceToList_attained K (by omega) x _ (occurrenceList_ne_nil n d ω') + obtain ⟨t,ht,hy⟩ := List.mem_flatMap.mp hy + rw [List.mem_range] at ht + rw [he] + exact occurrence_deviation_le K n hn hnK d hd ω ω' s t hs (by omega) x y hx hy + +def foldIndex (n : ℕ) (j : Fin (n+1)) : Fin (n/2+1) × Bool := + if hj : j.val ≤ n/2 then (⟨j.val, by omega⟩, false) + else (⟨n-j.val, by omega⟩, true) + +lemma foldIndex_value (n : ℕ) (j : Fin (n+1)) : + (foldIndex n j).1.val = min j.val (n-j.val) := by + unfold foldIndex + split_ifs with h <;> simp only + · omega + · omega + +lemma foldIndex_injective (n : ℕ) : Function.Injective (foldIndex n) := by + intro i j h + have h₁ := congrArg (fun x : Fin (n/2+1) × Bool ↦ x.1.val) h + have h₂ := congrArg Prod.snd h + unfold foldIndex at h₁ h₂ + split_ifs at h₁ h₂ <;> simp_all only + all_goals apply Fin.ext; omega + +lemma folded_sum_le (n : ℕ) (f : ℕ → ℝ) (hf : ∀ j, 0 ≤ f j) : + (∑ j ∈ Finset.range (n+1), f (min j (n-j))) ≤ + 2 * ∑ j ∈ Finset.range (n/2+1), f j := by + let g : Fin (n/2+1) × Bool → ℝ := fun x ↦ f x.1.val + have hs : (∑ x ∈ Finset.univ.image (foldIndex n), g x) ≤ ∑ x, g x := by + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ _) (fun x _ _ ↦ hf _) + rw [Finset.sum_image (fun i _ j _ hij ↦ foldIndex_injective n hij)] at hs + have hleft : (∑ i : Fin (n+1), g (foldIndex n i)) = + ∑ j ∈ Finset.range (n+1), f (min j (n-j)) := by + simp only [g, foldIndex_value] + exact Fin.sum_univ_eq_sum_range (fun j ↦ f (min j (n-j))) (n+1) + have hright : (∑ x : Fin (n/2+1) × Bool, g x) = + 2 * ∑ j ∈ Finset.range (n/2+1), f j := by + simp only [Fintype.sum_prod_type, Fintype.sum_bool, g, ← two_mul, ← Finset.mul_sum, + Fin.sum_univ_eq_sum_range] + simpa only [hleft, hright] using hs + +lemma nearPotential_eq_if (u : ℕ) (R : ℝ) (z : Noise × Noise) : + nearPotential u (fun j ↦ position z.2 j u) R z.1 = + if twoCopyDistance u z ≤ R then 1 else 0 := by + unfold nearPotential nearTest coordinateTest twoCopyDistance transverseDistance + by_cases h0 : |position z.1 0 u-position z.2 0 u| ≤ R <;> + by_cases h1 : |position z.1 1 u-position z.2 1 u| ≤ R <;> + simp [h0,h1] + +lemma twoCopyDistance_swap (u : ℕ) (z : Noise × Noise) : + twoCopyDistance u z.swap = twoCopyDistance u z := by + simp only [twoCopyDistance,transverseDistance,Prod.swap] + rw [abs_sub_comm (position z.2 0 u),abs_sub_comm (position z.2 1 u)] + +lemma nearPotential_swap (u : ℕ) (R : ℝ) (ω ω' : Noise) : + nearPotential u (fun j ↦ position ω j u) R ω' = + nearPotential u (fun j ↦ position ω' j u) R ω := by + rw [nearPotential_eq_if (z := (ω',ω)),nearPotential_eq_if (z := (ω,ω'))] + rw [show twoCopyDistance u (ω',ω) = twoCopyDistance u (ω,ω') from + twoCopyDistance_swap u (ω,ω')] + +def oneSideHit (K : ℕ) (R : ℝ) (l l' : List Vertex) : ℝ := + (l.map (fun x ↦ if distanceToList K x l' ≤ R then 1 else 0)).sum + +def occurrenceHit (K : ℕ) (R : ℝ) (l l' : List Vertex) : ℝ := + oneSideHit K R l l'+oneSideHit K R l' l + +def occurrenceSoft (K : ℕ) (B : ℝ) (l l' : List Vertex) : ℝ := + (l.map (fun x ↦ Real.exp (-distanceToList K x l'/B))).sum + +lemma oneSideHit_nonneg (K : ℕ) (R : ℝ) (l l' : List Vertex) : + 0 ≤ oneSideHit K R l l' := by + apply List.sum_nonneg + intro a ha + obtain ⟨x,hx,rfl⟩ := List.mem_map.mp ha + split_ifs <;> norm_num + +lemma occurrenceHit_nonneg (K : ℕ) (R : ℝ) (l l' : List Vertex) : + 0 ≤ occurrenceHit K R l l' := add_nonneg + (oneSideHit_nonneg _ _ _ _) (oneSideHit_nonneg _ _ _ _) + +lemma level_sum_le (n : ℕ) (hn : 0 < n) (d : Fin 2 → ℤ) + (hd : ∀j, |d j| ≤ n) (ω : Noise) (f : Vertex → ℝ) (g : ℕ → ℝ) + (hg : ∀t, 0 ≤ g t) + (hfg : ∀t ≤ n, ∀x ∈ levelList n d ω t, f x ≤ g t) : + ((occurrenceList n d ω).map f).sum ≤ + 5*∑ t ∈ Finset.range (n+1), g t := by + have hlevel (t : ℕ) (ht : t ≤ n) : + ((levelList n d ω t).map f).sum ≤ 5*g t := by + calc + _ ≤ ((levelList n d ω t).map (fun _ ↦ g t)).sum := by + apply List.sum_le_sum + intro x hx + exact hfg t ht x hx + _ = ((levelList n d ω t).length:ℝ)*g t := by simp [nsmul_eq_mul] + _ ≤ _ := mul_le_mul_of_nonneg_right (by + exact_mod_cast levelList_length n hn d hd ω t ht) (hg t) + unfold occurrenceList + rw [List.flatMap_def,List.map_flatten,List.sum_flatten] + simp only [List.map_map] + calc + _ ≤ ((List.range (n+1)).map (fun t ↦ 5*g t)).sum := by + apply List.sum_le_sum + intro t ht + exact hlevel t (Nat.le_of_lt_succ (List.mem_range.mp ht)) + _ = _ := by + rw [List.sum_map_mul_left,← List.sum_toFinset g List.nodup_range,List.toFinset_range] + +lemma oneSideHit_le (K n : ℕ) (hn : 0 < n) (hnK : 8*n ≤ K) + (d : Fin 2 → ℤ) (hd : ∀j, |d j| ≤ n) (ω ω' : Noise) (R : ℝ) : + oneSideHit K R (occurrenceList n d ω) (occurrenceList n d ω') ≤ + 10*∑ u ∈ Finset.range (n/2+1), + nearPotential u (fun j ↦ position ω' j u) (3*R+5) ω := by + have h := level_sum_le n hn d hd ω + (fun x ↦ if distanceToList K x (occurrenceList n d ω') ≤ R then 1 else 0) + (fun t ↦ nearPotential (min t (n-t)) + (fun j ↦ position ω' j (min t (n-t))) (3*R+5) ω) + (fun _ ↦ nearPotential_nonneg _ _ _ _) (by + intro t ht x hx + split_ifs with h + · rw [nearPotential_eq_if (z := (ω,ω'))] + rw [ite_eq_left (by linarith [distanceToList_deviation_le K n hn hnK d hd ω ω' t ht x hx])] + · exact nearPotential_nonneg _ _ _ _) + have hf := folded_sum_le n + (fun u ↦ nearPotential u (fun j ↦ position ω' j u) (3*R+5) ω) + (fun _ ↦ nearPotential_nonneg _ _ _ _) + change oneSideHit K R _ _ ≤ _ at h + linarith + +end HardSphere.DyadicSkeleton +end +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Paths/LiftedSkeleton.lean b/lean/OAI/Analysis/HardSphere/Paths/LiftedSkeleton.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c734522484c9c75b0c628875f9a73393cc3aa03 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Paths/LiftedSkeleton.lean @@ -0,0 +1,461 @@ +import Mathlib +import OAI.Analysis.HardSphere.Geometry.SimplePath +import OAI.Analysis.HardSphere.Paths.SkeletonHitConstant + +namespace OAI + +section + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal BigOperators +namespace HardSphere.DyadicSkeleton +open HardSphere.Lattice +attribute [local instance] Classical.propDecidable + +lemma mem_axisSteps_of_between (a b k : ℤ) (hl : min a b ≤ k) (hu : k ≤ max a b) : + k = a ∨ k ∈ axisSteps a b := by + by_cases ha : k = a + · exact Or.inl ha + right + unfold axisSteps + split_ifs with h + · simp only [min_eq_left h] at hl + simp only [max_eq_right h] at hu + apply List.mem_map.mpr + refine ⟨(k-a-1).toNat,List.mem_range.mpr ?_,?_⟩ <;> omega + · simp only [min_eq_right (by omega : b ≤ a)] at hl + simp only [max_eq_left (by omega : b ≤ a)] at hu + apply List.mem_map.mpr + refine ⟨(a-k-1).toNat,List.mem_range.mpr ?_,?_⟩ <;> omega + +lemma refineStep_final (a b : Vertex) : b ∈ refineStep a b := by + have h2 := mem_axisSteps_of_between (a 2) (b 2) (b 2) (min_le_right _ _) (le_max_right _ _) + have h1 := mem_axisSteps_of_between (a 1) (b 1) (b 1) (min_le_right _ _) (le_max_right _ _) + have hb : ![b 0,b 1,b 2] = b := by ext j; fin_cases j <;> rfl + rcases h2 with h2|h2 + · rcases h1 with h1|h1 + · have he : ![b 0,a 1,a 2] = b := by rw [← h1,← h2,hb] + simp [refineStep,he] + · apply List.mem_append_left + apply List.mem_append_right + apply List.mem_map.mpr + exact ⟨b 1,h1,by rw [← h2,hb]⟩ + · apply List.mem_append_right + apply List.mem_map.mpr + exact ⟨b 2,h2,hb⟩ + +lemma refineStep_reach (a b : Vertex) (hfirst : b 0 = a 0+1) : + withinReach nearestStep {x | x=a ∨ x∈refineStep a b} a b := by + let D : Set Vertex := {x | x=a ∨ x∈refineStep a b} + let u : Vertex := ![b 0,a 1,a 2] + let v : Vertex := ![b 0,b 1,a 2] + have hu : u∈D := Or.inr (by simp [refineStep,u]) + have h1 : withinReach nearestStep D a u := by + apply Relation.ReflTransGen.single + refine ⟨Or.inl rfl,hu,0,?_,?_⟩ + · simp only [u,Matrix.cons_val_zero,hfirst]; norm_num + · intro j hj + fin_cases j <;> simp_all [u] + have h2 : withinReach nearestStep D u v := by + have h := withinReach_axis u 1 (a 1) (b 1) (D:=D) ?_ + · convert h using 1 <;> ext j <;> fin_cases j <;> simp [u,v] + intro k hk hk' + rcases mem_axisSteps_of_between (a 1) (b 1) k hk hk' with rfl|hmem + · change Function.update u 1 (u 1)∈D + simpa only [Function.update_eq_self] using hu + · right + apply List.mem_append_left + apply List.mem_append_right + refine List.mem_map.mpr ⟨k,hmem,?_⟩ + ext j; fin_cases j <;> simp [u] + have hv : v∈D := by + rcases mem_axisSteps_of_between (a 1) (b 1) (b 1) (min_le_right _ _) (le_max_right _ _) with h|h + · simpa [v,h] using hu + · exact Or.inr (List.mem_append_left _ (List.mem_append_right _ (List.mem_map.mpr ⟨b 1,h,rfl⟩))) + have h3 : withinReach nearestStep D v b := by + have h := withinReach_axis v 2 (a 2) (b 2) (D:=D) ?_ + · convert h using 1 <;> ext j <;> fin_cases j <;> simp [v] + intro k hk hk' + rcases mem_axisSteps_of_between (a 2) (b 2) k hk hk' with rfl|hmem + · change Function.update v 2 (v 2)∈D + simpa only [Function.update_eq_self] using hv + · right + apply List.mem_append_right + refine List.mem_map.mpr ⟨k,hmem,?_⟩ + ext j; fin_cases j <;> simp [v] + exact h1.trans (h2.trans h3) + +lemma baseVertex_mem_level (n : ℕ) (d : Fin 2 → ℤ) (ω : Noise) (t : ℕ) : + baseVertex n d ω t ∈ levelList n d ω t := by + cases t with + | zero => simp [levelList] + | succ t => exact refineStep_final _ _ + +lemma level_mem_occurrence (n : ℕ) (d : Fin 2 → ℤ) (ω : Noise) (t : ℕ) (ht : t ≤ n) + {x : Vertex} (hx : x∈levelList n d ω t) : x∈occurrenceList n d ω := + List.mem_flatMap.mpr ⟨t,List.mem_range.mpr (by omega),hx⟩ + +lemma occurrence_reach (n : ℕ) (d : Fin 2 → ℤ) (ω : Noise) : + withinReach nearestStep {x | x∈occurrenceList n d ω} + (baseVertex n d ω 0) (baseVertex n d ω n) := by + have H : ∀t, t≤n → withinReach nearestStep {x | x∈occurrenceList n d ω} + (baseVertex n d ω 0) (baseVertex n d ω t) := by + intro t + induction t with + | zero => intro _; exact .refl + | succ t ih => + intro ht + apply (ih (by omega)).trans + apply withinReach_mono (D:={x | x=baseVertex n d ω t ∨ x∈refineStep + (baseVertex n d ω t) (baseVertex n d ω (t+1))}) + · intro x hx + rcases hx with rfl|hx + · exact level_mem_occurrence n d ω t (by omega) (baseVertex_mem_level n d ω t) + · exact level_mem_occurrence n d ω (t+1) ht hx + · apply refineStep_reach + simp [baseVertex] + exact H n le_rfl + +lemma nearestStep_add (v : Vertex) {x y : Vertex} (h : nearestStep x y) : + nearestStep (v+x) (v+y) := by + obtain ⟨j,hj,hr⟩ := h + refine ⟨j,?_,fun i hi ↦ by simpa using congrArg (v i+·) (hr i hi)⟩ + simpa only [Pi.add_apply,add_sub_add_left_eq_sub] using hj + +lemma withinReach_add (v : Vertex) {D : Set Vertex} {x y : Vertex} + (h : withinReach nearestStep D x y) : + withinReach nearestStep ((v+·) '' D) (v+x) (v+y) := by + induction h using Relation.ReflTransGen.trans_induction_on with + | refl => exact .refl + | single h => exact .single ⟨mem_image_of_mem _ h.1,mem_image_of_mem _ h.2.1,nearestStep_add v h.2.2⟩ + | trans _ _ ih ih' => exact ih.trans ih' + +def liftedSkeleton (n : ℕ) (d : Fin 2 → ℤ) (v : Vertex) (ω : Noise) : Finset Vertex := + ((occurrenceList n d ω).map (v+·)).toFinset + +lemma liftedSkeleton_mem (n : ℕ) (d : Fin 2 → ℤ) (v : Vertex) (ω : Noise) {x : Vertex} : + x∈liftedSkeleton n d v ω ↔ ∃y∈occurrenceList n d ω,v+y=x := by + simp [liftedSkeleton] + +lemma liftedSkeleton_reach (n : ℕ) (d : Fin 2 → ℤ) (v : Vertex) (ω : Noise) : + withinReach nearestStep (↑(liftedSkeleton n d v ω)) + (v+baseVertex n d ω 0) (v+baseVertex n d ω n) := by + apply withinReach_mono _ (withinReach_add v (occurrence_reach n d ω)) + rintro x ⟨y,hy,rfl⟩ + exact (liftedSkeleton_mem _ _ _ _).mpr ⟨y,hy,rfl⟩ + +lemma liftedSkeleton_initial (n : ℕ) (d : Fin 2 → ℤ) (v : Vertex) (ω : Noise) : + v ∈ liftedSkeleton n d v ω := by + exact (liftedSkeleton_mem _ _ _ _).mpr ⟨0,occurrenceList_initial n d ω,add_zero v⟩ + +lemma liftedSkeleton_final (n : ℕ) (hn : 0.trans (by norm_num) + +lemma nominalBase_near_deviation {K n r : ℕ} (hn : 0 positivity)] + apply Finset.sum_congr rfl + intro F _ + split_ifs <;> simp [ENNReal.ofReal_pow ht] + rw [hcast] + refine hF.trans (Finset.sum_le_sum fun i _ ↦ ?_) + refine le_trans (ENNReal.tsum_le_tsum (fun m ↦ ?_)) + (geometric_soft_sum hb (mul_nonneg (Nat.cast_nonneg A) ht) hq + (fun m ↦ (((12*(R+2)+24)*(m+1):ℕ):ℝ)+1) (fun m ↦ ?_)) + · by_cases h : torusNear K ((12*(R+2)+24)*(m+1)) + (torusProjection K (U i)) (torusProjection K (U' i)) + · rw [ite_eq_left h,ite_eq_left (hnear _ i h)] + apply pow_le_pow_left' + rw [ENNReal.ofReal_mul (Nat.cast_nonneg A),ENNReal.ofReal_natCast] + exact mul_le_mul' (by exact_mod_cast candidateConstant_growth (R+2)) le_rfl + · rw [ite_eq_right h]; exact zero_le + · have ha := candidateConstant_radius (R+2) + have ha' : (12*(R+2)+24)*(m+1)+1≤dyadicRadius R*(m+1) := by + dsimp [dyadicRadius] + nlinarith + dsimp [b]; exact_mod_cast ha' + rw [← ENNReal.ofReal_sum_of_nonneg (by intro i _; dsimp [f]; positivity)] at hFe + have hFr := (ENNReal.ofReal_le_ofReal_iff (by positivity)).mp hFe + rw [← Finset.mul_sum] at hFr + have hbound := add_le_add hNr hFr + have heq : (∑ i : Fin (n+1),f i)=∑ j∈Finset.range (n+1), Real.exp + (-twoCopyDistance (min j (n-j)) (ω,ω')/(dyadicRadius R:ℝ)) := by + exact Fin.sum_univ_eq_sum_range + (fun j ↦ Real.exp (-twoCopyDistance (min j (n-j)) (ω,ω')/(dyadicRadius R:ℝ))) (n+1) + rw [heq] at hbound + calc + _ ≤ _ := hbound + _ = _ := by dsimp [A]; ring + +end HardSphere.DyadicSkeleton +end +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Paths/NearPotential.lean b/lean/OAI/Analysis/HardSphere/Paths/NearPotential.lean new file mode 100644 index 0000000000000000000000000000000000000000..c87937e671a2a16fa3692bc0c50e9ae7c3cb7ba0 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Paths/NearPotential.lean @@ -0,0 +1,424 @@ +import Mathlib +import OAI.Analysis.HardSphere.Paths.TimeGaps + +namespace OAI + +section +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal BigOperators Topology +namespace HardSphere.DyadicSkeleton + +lemma orderedEncounterConstant_one_le : 1 ≤ orderedEncounterConstant := by + simpa only [orderedEncounterConstant,ENNReal.toReal_one] using + ENNReal.toReal_mono gapKernel_sum_ne_top gapKernel_sum_one_le + +def nearPotential (n : ℕ) (y : Fin 2 → ℝ) (R : ℝ) (ω : Noise) : ℝ := + (nearTest n y R ω).toReal +lemma nearPotential_nonneg (n : ℕ) (y : Fin 2 → ℝ) (R : ℝ) (ω : Noise) : + 0 ≤ nearPotential n y R ω := ENNReal.toReal_nonneg +lemma nearPotential_le_one (n : ℕ) (y : Fin 2 → ℝ) (R : ℝ) (ω : Noise) : + nearPotential n y R ω ≤ 1 := by + simpa only [nearPotential,ENNReal.toReal_one] using + ENNReal.toReal_mono (by norm_num : (1:ℝ≥0∞) ≠ ∞) (nearTest_le_one n y R ω) +lemma nearPotential_cast (n : ℕ) (y : Fin 2 → ℝ) (R : ℝ) (ω : Noise) : + ENNReal.ofReal (nearPotential n y R ω) = nearTest n y R ω := + ENNReal.ofReal_toReal (ne_top_of_le_ne_top (by norm_num) (nearTest_le_one n y R ω)) +@[fun_prop] lemma measurable_nearPotential (n : ℕ) (y : Fin 2 → ℝ) (R : ℝ) : + Measurable (nearPotential n y R) := (measurable_nearTest n y R).ennreal_toReal + +def singleRadiusWeights (R : ℕ) (a : ℝ≥0∞) (l : ℕ) : ℝ≥0∞ := if l=R then a else 0 +lemma singleRadiusWeights_envelope (R : ℕ) (a : ℝ≥0∞) (n : ℕ) + (y : Fin 2 → ℝ) (ω : Noise) : + radiusEnvelope (singleRadiusWeights R a) n y ω = a * nearTest n y (R:ℝ) ω := by + simp [radiusEnvelope,singleRadiusWeights,ite_mul] +lemma singleRadiusWeights_activity (R : ℕ) (a : ℝ≥0∞) : + radiusActivity (singleRadiusWeights R a) = + ENNReal.ofReal orderedEncounterConstant * (a * radiusFactor (R:ℝ)) := by + simp [radiusActivity,singleRadiusWeights,ite_mul] + +def hitConstant : ℝ := (4 * Real.exp 2 * orderedEncounterConstant)⁻¹ +lemma hitConstant_pos : 0 < hitConstant := by + unfold hitConstant + positivity [orderedEncounterConstant_pos] +lemma hitConstant_le_one : hitConstant ≤ 1 := by + have he : 1 ≤ Real.exp 2 := Real.one_le_exp (by norm_num) + have hc := orderedEncounterConstant_one_le + have hd : 1 ≤ 4 * Real.exp 2 * orderedEncounterConstant := by nlinarith + exact (inv_le_one₀ (by positivity)).mpr hd + +lemma same_time_hit_moment (T R : ℕ) (y : ℕ → Fin 2 → ℝ) : + (∫⁻ ω, ENNReal.ofReal (Real.exp ((hitConstant/(1+(R:ℝ))^2) * + ∑ u ∈ Finset.range (T+1), nearPotential u (y u) (R:ℝ) ω)) ∂law) ≤ 2 := by + let a := hitConstant/(2*(1+(R:ℝ))^2) + have hp : 0 < (1+(R:ℝ))^2 := by positivity + have ha : 0 ≤ a := by dsimp [a]; exact div_nonneg hitConstant_pos.le (by positivity) + have ha1 : a ≤ 1 := by + dsimp [a] + apply (div_le_one (by positivity)).mpr + have hr := Nat.cast_nonneg (α:=ℝ) R + nlinarith [hitConstant_le_one] + have hsmall : ENNReal.ofReal (2*Real.exp 2) * + radiusActivity (singleRadiusWeights R (ENNReal.ofReal a)) ≤ (1/2:ℝ≥0∞) := by + rw [singleRadiusWeights_activity,radiusFactor, + ← ENNReal.ofReal_mul ha,← ENNReal.ofReal_mul orderedEncounterConstant_pos.le, + ← ENNReal.ofReal_mul (by positivity : 0 ≤ 2*Real.exp 2)] + have heq : 2*Real.exp 2*(orderedEncounterConstant*(a*(1+(R:ℝ))^2)) = 1/4 := by + dsimp [a,hitConstant] + field_simp [ne_of_gt orderedEncounterConstant_pos,ne_of_gt (Real.exp_pos 2)] + rw [heq] + norm_num [ENNReal.ofReal_div_of_pos] + have h := radius_exponential_bound T (singleRadiusWeights R (ENNReal.ofReal a)) y + (fun n ω ↦ a*nearPotential n (y n) (R:ℝ) ω) + (fun n ω ↦ mul_nonneg ha (nearPotential_nonneg n (y n) (R:ℝ) ω)) + (fun n ω ↦ (mul_le_mul_of_nonneg_left (nearPotential_le_one n (y n) (R:ℝ) ω) ha).trans + (by simpa using ha1)) + (by intro n ω; rw [ENNReal.ofReal_mul ha,nearPotential_cast,singleRadiusWeights_envelope]) hsmall + convert h using 1 + apply lintegral_congr + intro ω + congr 2 + rw [← Finset.mul_sum] + dsimp [a] + field_simp + +def transverseDistance (n : ℕ) (y : Fin 2 → ℝ) (ω : Noise) : ℝ := + max |position ω 0 n-y 0| |position ω 1 n-y 1| +lemma transverseDistance_nonneg (n : ℕ) (y : Fin 2 → ℝ) (ω : Noise) : + 0 ≤ transverseDistance n y ω := (abs_nonneg _).trans (le_max_left _ _) +@[fun_prop] lemma measurable_transverseDistance (n : ℕ) (y : Fin 2 → ℝ) : + Measurable (transverseDistance n y) := by unfold transverseDistance; fun_prop +lemma nearTest_eq_one (n : ℕ) (y : Fin 2 → ℝ) (R : ℝ) (ω : Noise) + (h : transverseDistance n y ω ≤ R) : nearTest n y R ω = 1 := by + have h' := max_le_iff.mp h + simp [nearTest,coordinateTest,h'.1,h'.2] + +def softPotential (B : ℝ) (n : ℕ) (y : Fin 2 → ℝ) (ω : Noise) : ℝ := + Real.exp (-transverseDistance n y ω/B) +lemma softPotential_nonneg (B : ℝ) (n : ℕ) (y : Fin 2 → ℝ) (ω : Noise) : + 0 ≤ softPotential B n y ω := (Real.exp_pos _).le +lemma softPotential_le_one (B : ℝ) (hB : 0 < B) (n : ℕ) (y : Fin 2 → ℝ) (ω : Noise) : + softPotential B n y ω ≤ 1 := + Real.exp_le_one_iff.mpr (div_nonpos_of_nonpos_of_nonneg (by + linarith [transverseDistance_nonneg n y ω]) hB.le) +@[fun_prop] lemma measurable_softPotential (B : ℝ) (n : ℕ) (y : Fin 2 → ℝ) : + Measurable (softPotential B n y) := by unfold softPotential; fun_prop + +def softWeights (B : ℝ) (l : ℕ) : ℝ≥0∞ := ENNReal.ofReal (Real.exp ((1-(l:ℝ))/B)) +lemma softPotential_envelope (B : ℝ) (hB : 0 < B) (n : ℕ) (y : Fin 2 → ℝ) (ω : Noise) : + ENNReal.ofReal (softPotential B n y ω) ≤ radiusEnvelope (softWeights B) n y ω := by + let l := ⌈transverseDistance n y ω⌉₊ + have hl : transverseDistance n y ω ≤ (l:ℝ) := Nat.le_ceil _ + have hl' : (l:ℝ) < transverseDistance n y ω+1 := + Nat.ceil_lt_add_one (transverseDistance_nonneg n y ω) + refine le_trans ?_ (ENNReal.le_tsum (f := fun k : ℕ ↦ + softWeights B k * nearTest n y (k:ℝ) ω) l) + rw [nearTest_eq_one n y (l:ℝ) ω hl,mul_one] + change ENNReal.ofReal (Real.exp (-transverseDistance n y ω/B)) ≤ + ENNReal.ofReal (Real.exp ((1-(l:ℝ))/B)) + apply ENNReal.ofReal_le_ofReal + apply Real.exp_le_exp.mpr + exact div_le_div_of_nonneg_right (by linarith) hB.le + +lemma soft_activity_ne_top (B : ℝ) (hB : 0 < B) : radiusActivity (softWeights B) ≠ ∞ := by + let q := Real.exp (-1/B) + have hq : ‖q‖ < 1 := by + rw [Real.norm_eq_abs,abs_of_pos (Real.exp_pos _)] + apply Real.exp_lt_one_iff.mpr + exact div_neg_of_neg_of_pos (by norm_num) hB + have hs0 : Summable (fun l : ℕ ↦ q^l) := summable_geometric_of_norm_lt_one hq + have hs1 := summable_pow_mul_geometric_of_norm_lt_one 1 hq + have hs2 := summable_pow_mul_geometric_of_norm_lt_one 2 hq + have hs : Summable (fun l : ℕ ↦ Real.exp ((1-(l:ℝ))/B)*(1+(l:ℝ))^2) := by + have h := ((hs2.add (hs1.mul_left 2)).add hs0).mul_left (Real.exp (1/B)) + apply h.congr + intro l + have he : Real.exp ((1-(l:ℝ))/B) = Real.exp (1/B) * q^l := by + rw [show (1-(l:ℝ))/B = 1/B + (l:ℝ)*(-1/B) by ring,Real.exp_add,Real.exp_nat_mul] + rw [he] + simp only [pow_one] + ring + have he : (∑' l : ℕ, softWeights B l * radiusFactor (l:ℝ)) = + ENNReal.ofReal (∑' l : ℕ, Real.exp ((1-(l:ℝ))/B)*(1+(l:ℝ))^2) := by + simp only [softWeights,radiusFactor,← ENNReal.ofReal_mul (Real.exp_pos _).le] + exact (ENNReal.ofReal_tsum_of_nonneg (fun l ↦ by positivity) hs).symm + unfold radiusActivity + rw [he] + finiteness + +lemma same_time_soft_moment (B : ℝ) (hB : 0 < B) : + ∃ ξ : ℝ, 0 < ξ ∧ ∀ (T : ℕ) (y : ℕ → Fin 2 → ℝ), + (∫⁻ ω, ENNReal.ofReal (Real.exp (ξ * + ∑ u ∈ Finset.range (T+1), softPotential B u (y u) ω)) ∂law) ≤ 2 := by + let A := (radiusActivity (softWeights B)).toReal + let δ := (4*Real.exp 2*(1+A))⁻¹ + have hA : 0 ≤ A := ENNReal.toReal_nonneg + have hAc : ENNReal.ofReal A = radiusActivity (softWeights B) := + ENNReal.ofReal_toReal (soft_activity_ne_top B hB) + have hd : 0 < δ := by dsimp [δ]; positivity + have hd1 : δ ≤ 1 := by + apply (inv_le_one₀ (by positivity)).mpr + have he : 1 ≤ Real.exp 2 := Real.one_le_exp (by norm_num) + nlinarith + refine ⟨2*δ,by positivity,?_⟩ + intro T y + let a := fun l ↦ ENNReal.ofReal δ * softWeights B l + have hsmall : ENNReal.ofReal (2*Real.exp 2) * radiusActivity a ≤ (1/2:ℝ≥0∞) := by + rw [show radiusActivity a = ENNReal.ofReal δ * radiusActivity (softWeights B) from + radiusActivity_smul _ _,← hAc,← ENNReal.ofReal_mul hd.le, + ← ENNReal.ofReal_mul (by positivity : 0 ≤ 2*Real.exp 2)] + calc + _ ≤ ENNReal.ofReal (1/2:ℝ) := by + apply ENNReal.ofReal_le_ofReal + dsimp [δ] + have he := Real.exp_pos 2 + field_simp + nlinarith + _ = _ := by norm_num [ENNReal.ofReal_div_of_pos] + have h := radius_exponential_bound T a y + (fun n ω ↦ δ * softPotential B n (y n) ω) + (fun n ω ↦ mul_nonneg hd.le (softPotential_nonneg B n (y n) ω)) + (fun n ω ↦ (mul_le_mul_of_nonneg_left (softPotential_le_one B hB n (y n) ω) hd.le).trans + (by simpa using hd1)) + (by + intro n ω + rw [ENNReal.ofReal_mul hd.le] + exact (mul_le_mul_right (softPotential_envelope B hB n (y n) ω) (ENNReal.ofReal δ)).trans_eq + (radiusEnvelope_smul _ _ n (y n) ω).symm) hsmall + convert h using 1 + apply lintegral_congr + intro ω + congr 2 + rw [← Finset.mul_sum] + ring + +def twoCopyDistance (n : ℕ) (z : Noise × Noise) : ℝ := + transverseDistance n (fun j ↦ position z.2 j n) z.1 + +@[fun_prop] lemma measurable_twoCopyDistance (n : ℕ) : + Measurable (twoCopyDistance n) := by + unfold twoCopyDistance transverseDistance + exact (((measurable_position 0 n).comp measurable_fst).sub + ((measurable_position 0 n).comp measurable_snd)).abs.max + (((measurable_position 1 n).comp measurable_fst).sub + ((measurable_position 1 n).comp measurable_snd)).abs + +@[fun_prop] lemma measurable_twoCopyNear (n : ℕ) (R : ℝ) : + Measurable (fun z : Noise × Noise ↦ + nearPotential n (fun j ↦ position z.2 j n) R z.1) := by + unfold nearPotential nearTest + apply Measurable.ennreal_toReal + apply Measurable.mul + all_goals + apply measurable_const.indicator + apply measurableSet_le _ measurable_const + apply Measurable.abs + exact ((measurable_position _ n).comp measurable_fst).sub + ((measurable_position _ n).comp measurable_snd) + +lemma two_copy_hit_moment (T R : ℕ) : + (∫⁻ z, ENNReal.ofReal (Real.exp ((hitConstant/(1+(R:ℝ))^2) * + ∑ u ∈ Finset.range (T+1), nearPotential u + (fun j ↦ position z.2 j u) (R:ℝ) z.1)) ∂law.prod law) ≤ 2 := by + rw [lintegral_prod_symm _ (by + apply Measurable.aemeasurable + apply Measurable.ennreal_ofReal + apply Measurable.exp + apply Measurable.const_mul + exact Finset.measurable_sum _ (fun u _ ↦ measurable_twoCopyNear u (R:ℝ)))] + calc + _ ≤ ∫⁻ _ : Noise, (2:ℝ≥0∞) ∂law := lintegral_mono (fun ω ↦ + same_time_hit_moment T R (fun u j ↦ position ω j u)) + _ = 2 := by simp + +lemma two_copy_soft_moment (B : ℝ) (hB : 0 < B) : + ∃ ξ : ℝ, 0 < ξ ∧ ∀ T : ℕ, + (∫⁻ z, ENNReal.ofReal (Real.exp (ξ * + ∑ u ∈ Finset.range (T+1), Real.exp (-twoCopyDistance u z / B))) + ∂law.prod law) ≤ 2 := by + obtain ⟨ξ,hξ,h⟩ := same_time_soft_moment B hB + refine ⟨ξ,hξ,fun T ↦ ?_⟩ + rw [lintegral_prod_symm _ (by fun_prop)] + calc + _ ≤ ∫⁻ _ : Noise, (2:ℝ≥0∞) ∂law := lintegral_mono (fun ω ↦ + h T (fun u j ↦ position ω j u)) + _ = 2 := by simp + +lemma position_lipschitz (ω : Noise) (j : Fin 2) (s t : ℕ) : + |position ω j s-position ω j t| ≤ |(s:ℝ)-t|/2 := by + have hinc (a k : ℕ) : |position ω j (a+k)-position ω j a| ≤ (k:ℝ)/2 := by + induction k with + | zero => simp + | succ k ih => + rw [Nat.add_succ, position_succ] + calc + _ = |(position ω j (a+k)-position ω j a)+velocity ω j (a+k)| := by congr 1; ring + _ ≤ _ := abs_add_le _ _ + _ ≤ (k:ℝ)/2+1/2 := add_le_add ih (velocity_abs_le ω j (a+k)) + _ = _ := by push_cast; ring + rcases le_total t s with h | h + · have hs : 0 ≤ (s:ℝ)-t := sub_nonneg.mpr (by exact_mod_cast h) + rw [abs_of_nonneg hs] + simpa only [Nat.add_sub_of_le h,Nat.cast_sub h] using hinc t (s-t) + · have hs : 0 ≤ (t:ℝ)-s := sub_nonneg.mpr (by exact_mod_cast h) + rw [abs_sub_comm (s:ℝ),abs_of_nonneg hs,abs_sub_comm (position ω j s)] + simpa only [Nat.add_sub_of_le h,Nat.cast_sub h] using hinc s (t-s) + +lemma position_abs_le (ω : Noise) (j : Fin 2) (t : ℕ) : + |position ω j t| ≤ (t:ℝ)/2 := by + simpa [position,abs_of_nonneg (Nat.cast_nonneg (α:=ℝ) t)] using position_lipschitz ω j t 0 + +lemma fold_time_lipschitz (n s t : ℕ) (hs : s ≤ n) (ht : t ≤ n) : + |((min s (n-s):ℕ):ℝ)-((min t (n-t):ℕ):ℝ)| ≤ |(s:ℝ)-t| := by + have h := abs_min_sub_min_le_max (s:ℝ) ((n:ℝ)-s) (t:ℝ) ((n:ℝ)-t) + have he : |((n:ℝ)-s)-((n:ℝ)-t)| = |(s:ℝ)-t| := by + rw [sub_sub_sub_cancel_left,abs_sub_comm] + simpa only [Nat.cast_min,Nat.cast_sub hs,Nat.cast_sub ht,he,max_self] using h + +abbrev Vertex := Fin 3 → ℤ + +def baseTrans (n : ℕ) (d : Fin 2 → ℤ) (ω : Noise) (t : ℕ) (j : Fin 2) : ℝ := + (t:ℝ)*(d j:ℝ)/(n:ℝ)+position ω j (min t (n-t)) + +def baseVertex (n : ℕ) (d : Fin 2 → ℤ) (ω : Noise) (t : ℕ) : Vertex := + ![(t:ℤ),⌊baseTrans n d ω t 0⌋,⌊baseTrans n d ω t 1⌋] + +@[fun_prop] lemma measurable_baseTrans (n : ℕ) (d : Fin 2 → ℤ) (t : ℕ) (j : Fin 2) : + Measurable (fun ω ↦ baseTrans n d ω t j) := by unfold baseTrans; fun_prop + +@[fun_prop] lemma measurable_baseVertex (n : ℕ) (d : Fin 2 → ℤ) (t : ℕ) : + Measurable (fun ω ↦ baseVertex n d ω t) := by + apply Measurable.of_eval + intro j + fin_cases j + · exact measurable_const + · exact Int.measurable_floor.comp (measurable_baseTrans n d t 0) + · exact Int.measurable_floor.comp (measurable_baseTrans n d t 1) + +lemma drift_rate_le (n : ℕ) (hn : 0 < n) (d : ℤ) (hd : |d| ≤ n) : + |(d:ℝ)/(n:ℝ)| ≤ 1 := by + have hn' : 0 < (n:ℝ) := by exact_mod_cast hn + rw [abs_div,abs_of_pos hn',div_le_one hn'] + exact_mod_cast hd + +lemma baseTrans_lipschitz (n : ℕ) (hn : 0 < n) (d : Fin 2 → ℤ) + (hd : ∀j, |d j| ≤ n) (ω : Noise) (s t : ℕ) (hs : s ≤ n) (ht : t ≤ n) (j : Fin 2) : + |baseTrans n d ω s j-baseTrans n d ω t j| ≤ (3/2)*|(s:ℝ)-t| := by + have hp := (position_lipschitz ω j (min s (n-s)) (min t (n-t))).trans + (div_le_div_of_nonneg_right (fold_time_lipschitz n s t hs ht) (by norm_num : (0:ℝ) ≤ 2)) + calc + _ = |((s:ℝ)-t)*((d j:ℝ)/(n:ℝ))+ + (position ω j (min s (n-s))-position ω j (min t (n-t)))| := by + unfold baseTrans; congr 1; ring + _ ≤ _ := abs_add_le _ _ + _ ≤ |(s:ℝ)-t| + |(s:ℝ)-t|/2 := add_le_add (by + rw [abs_mul] + exact (mul_le_mul_of_nonneg_left (drift_rate_le n hn (d j) (hd j)) + (abs_nonneg _)).trans_eq (mul_one _)) hp + _ = _ := by ring + +lemma floor_abs_sub_le_two (x y : ℝ) (h : |x-y| ≤ 3/2) : + |⌊x⌋-⌊y⌋| ≤ (2:ℤ) := by + have hf := Int.floor_le x + have hg := Int.lt_floor_add_one y + have hf' := Int.floor_le y + have hg' := Int.lt_floor_add_one x + obtain ⟨hl,hu⟩ := abs_le.mp h + apply abs_le.mpr + constructor + · by_contra hn + have h' : ⌊y⌋-⌊x⌋ ≥ (3:ℤ) := by omega + have hh : (3:ℝ) ≤ (⌊y⌋:ℝ)-(⌊x⌋:ℝ) := by exact_mod_cast h' + linarith + · by_contra hn + have h' : ⌊x⌋-⌊y⌋ ≥ (3:ℤ) := by omega + have hh : (3:ℝ) ≤ (⌊x⌋:ℝ)-(⌊y⌋:ℝ) := by exact_mod_cast h' + linarith + +lemma baseVertex_step (n : ℕ) (hn : 0 < n) (d : Fin 2 → ℤ) + (hd : ∀j, |d j| ≤ n) (ω : Noise) (t : ℕ) (ht : t < n) (j : Fin 3) : + |baseVertex n d ω (t+1) j-baseVertex n d ω t j| ≤ 2 := by + have hh (i : Fin 2) : |⌊baseTrans n d ω (t+1) i⌋-⌊baseTrans n d ω t i⌋| ≤ (2:ℤ) := by + apply floor_abs_sub_le_two + have h := baseTrans_lipschitz n hn d hd ω (t+1) t (by omega) (by omega) i + simpa only [Nat.cast_add,Nat.cast_one,add_sub_cancel_left,abs_one,mul_one] using h + fin_cases j + · norm_num [baseVertex] + · exact hh 0 + · exact hh 1 + +lemma baseVertex_initial (n : ℕ) (d : Fin 2 → ℤ) (ω : Noise) : + baseVertex n d ω 0 = 0 := by + ext j + fin_cases j <;> simp [baseVertex,baseTrans,position] + +lemma baseVertex_final (n : ℕ) (hn : 0 < n) (d : Fin 2 → ℤ) (ω : Noise) : + baseVertex n d ω n = ![(n:ℤ),d 0,d 1] := by + have hn0 : (n:ℝ) ≠ 0 := by exact_mod_cast (ne_of_gt hn) + ext j + fin_cases j <;> simp [baseVertex,baseTrans,position,mul_div_cancel_left₀ _ hn0] + +def axisSteps (a b : ℤ) : List ℤ := + if a ≤ b then (List.range (b-a).toNat).map (fun k : ℕ ↦ a+(k:ℤ)+1) + else (List.range (a-b).toNat).map (fun k : ℕ ↦ a-(k:ℤ)-1) + +lemma axisSteps_length (a b : ℤ) : (axisSteps a b).length = (b-a).natAbs := by + unfold axisSteps + split_ifs with h <;> simp only [List.length_map,List.length_range] + · have hh := Int.natAbs_of_nonneg (by omega : 0 ≤ b-a) + have hh' := Int.toNat_of_nonneg (by omega : 0 ≤ b-a) + omega + · rw [← Int.natAbs_neg,Int.neg_sub] + have hh := Int.natAbs_of_nonneg (by omega : 0 ≤ a-b) + have hh' := Int.toNat_of_nonneg (by omega : 0 ≤ a-b) + omega + +lemma axisSteps_between (a b c : ℤ) (hc : c ∈ axisSteps a b) : + min a b ≤ c ∧ c ≤ max a b := by + unfold axisSteps at hc + split_ifs at hc with h + · obtain ⟨k,hk,rfl⟩ := List.mem_map.mp hc + have hk' := List.mem_range.mp hk + simp only [min_eq_left h,max_eq_right h] + omega + · obtain ⟨k,hk,rfl⟩ := List.mem_map.mp hc + have hk' := List.mem_range.mp hk + simp only [min_eq_right (by omega : b ≤ a),max_eq_left (by omega : b ≤ a)] + omega + +lemma axisSteps_near_final (a b c : ℤ) (hc : c ∈ axisSteps a b) : + |c-b| ≤ |a-b| := by + obtain ⟨hl,hu⟩ := axisSteps_between a b c hc + rcases le_total a b with h|h + · rw [min_eq_left h] at hl + rw [max_eq_right h] at hu + rw [abs_of_nonpos (by omega : a-b ≤ 0),abs_of_nonpos (by omega : c-b ≤ 0)] + omega + · rw [min_eq_right h] at hl + rw [max_eq_left h] at hu + rw [abs_of_nonneg (by omega : 0 ≤ a-b),abs_of_nonneg (by omega : 0 ≤ c-b)] + omega + +def refineStep (a b : Vertex) : List Vertex := + [![b 0,a 1,a 2]] ++ + (axisSteps (a 1) (b 1)).map (fun c ↦ ![b 0,c,a 2]) ++ + (axisSteps (a 2) (b 2)).map (fun c ↦ ![b 0,b 1,c]) + +lemma refineStep_length (a b : Vertex) (h : ∀j, |b j-a j| ≤ 2) : + (refineStep a b).length ≤ 5 := by + simp only [refineStep,List.length_append,List.length_singleton,List.length_map,axisSteps_length] + have h1 := h 1 + have h2 := h 2 + have ha1 : (b 1-a 1).natAbs ≤ 2 := by + have hh : ((b 1-a 1).natAbs:ℤ) ≤ 2 := by simpa only [Int.natCast_natAbs] using h1 + exact_mod_cast hh + have ha2 : (b 2-a 2).natAbs ≤ 2 := by + have hh : ((b 2-a 2).natAbs:ℤ) ≤ 2 := by simpa only [Int.natCast_natAbs] using h2 + exact_mod_cast hh + omega + +end HardSphere.DyadicSkeleton +end +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Paths/SimpleRouteGeometry.lean b/lean/OAI/Analysis/HardSphere/Paths/SimpleRouteGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..82d9cf77f4b12617ebaaa2c98c63ee5b24a49da5 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Paths/SimpleRouteGeometry.lean @@ -0,0 +1,106 @@ +import Mathlib +import OAI.Analysis.HardSphere.Conditioning.SlotMultiplicity +import OAI.Analysis.HardSphere.Allocation.PhysicalRouteGeometry +import OAI.Analysis.HardSphere.Allocation.RouteCenters + +namespace OAI + +section + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal NNReal +namespace HardSphere.Groups +open Wiener Bridge Sampling Comparison GaussianPacking PathCutoff CellOrbital HardSphere.Lattice +attribute [local instance] Classical.propDecidable +variable {K : ℕ} [NeZero K] {x y : DiscreteTorus K} {J : Type*} + +def simpleRouteVertices (p : SimplePath x y) (n : ℕ) : Fin (n+2)→Fin 3→Fin K := + fun i ↦ siteIndex (p.val.getVert i.val) + +lemma simpleRouteVertices_zero (p : SimplePath x y) (n : ℕ) : + simpleRouteVertices p n 0=siteIndex x := by simp [simpleRouteVertices] +lemma simpleRouteVertices_last (p : SimplePath x y) (n : ℕ) (hn : n+1=p.val.length) : + simpleRouteVertices p n (Fin.last (n+1))=siteIndex y := by + simp only [simpleRouteVertices,Fin.val_last,hn,SimpleGraph.Walk.getVert_length] + +omit [NeZero K] in +lemma simpleRouteVertices_adjacent (p : SimplePath x y) (n : ℕ) (hn : n+1=p.val.length) + (i : Fin (n+1)) : + (torusNearestGraph K).Adj (p.val.getVert i.castSucc.val) (p.val.getVert i.succ.val) := + p.val.adj_getVert_succ (by simpa only [Fin.val_castSucc, ←hn] using i.isLt) + +lemma simpleRouteVertices_distance {L : Length} (hL : L.val=(K:ℝ)) + (p : SimplePath x y) (n : ℕ) (hn : n+1=p.val.length) : + ∀i:Fin (n+1),torusDistance L (gridCenter L (simpleRouteVertices p n i.castSucc)) + (gridCenter L (simpleRouteVertices p n i.succ))≤1 := + fun i ↦ adjacent_center_distance hL (simpleRouteVertices_adjacent p n hn i) + +def simpleRouteSteps {L : Length} (hL : L.val=(K:ℝ)) + (p : SimplePath x y) (n : ℕ) (hn : n+1=p.val.length) : Fin (n+1)→Fin 7 := + fun i ↦ (adjacent_routeCellPeriod hL (simpleRouteVertices_adjacent p n hn i)).choose + +lemma simpleRouteSteps_period {L : Length} (hL : L.val=(K:ℝ)) + (p : SimplePath x y) (n : ℕ) (hn : n+1=p.val.length) : + ∀ i : Fin (n+1), projectPoint L (routeCellPeriod (simpleRouteVertices p n i.succ) + (simpleRouteVertices p n i.castSucc) (simpleRouteSteps hL p n hn i))=0 := + fun i ↦ (adjacent_routeCellPeriod hL (simpleRouteVertices_adjacent p n hn i)).choose_spec + +lemma gridSite_slotCenter {home : J→Fin 3→Fin K} (w : DiscreteTorus K) : + (fun i ↦ gridSite (slotCenter home (siteIndex w) i))= + extendedAnchor (fun j ↦ gridSite (home j)) w := by + funext i + cases i with + | none => exact indexSite_siteIndex w + | some j => rfl + +lemma routeSlots_reparam {d e : ℕ} (f : Fin d↪J) (h : e=d) : + routeSlots ((finCongr h).toEmbedding.trans f)=routeSlots f := by + subst e + rfl + +lemma simpleRouteSlots {n : ℕ} (p : SimplePath x y) (hn : n+1=p.val.length) + (home : J→Fin 3→Fin K) (f : Fin (n+1)↪J) + (hf : ∀i,home (f i)=simpleRouteVertices p n i.castSucc) : + ∃ pick : Fin p.val.length→J, ∃ H : ∀i,gridSite (home (pick i))=pathVertexEmbedding p i.castSucc, + routeSlots f=routeSlots (departureEmbedding p (fun j ↦ gridSite (home j)) pick H) := by + let pick : Fin p.val.length→J := fun i ↦ f (Fin.cast hn.symm i) + have hp : ∀i,gridSite (home (pick i))=pathVertexEmbedding p i.castSucc := by + intro i + dsimp only [pick] + rw [hf] + exact indexSite_siteIndex _ + refine ⟨pick,hp,?_⟩ + have he : departureEmbedding p (fun j ↦ gridSite (home j)) pick hp= + (finCongr hn.symm).toEmbedding.trans f := by ext i; rfl + rw [he,routeSlots_reparam] + +lemma simpleRoute_near_first {n l : ℕ} (p q : SimplePath x y) + (hn : n+1=p.val.length) (hl : l+1=q.val.length) + (home : J→Fin 3→Fin K) (f : Fin (n+1)↪J) (g : Fin (l+1)↪J) + (hf : ∀i,home (f i)=simpleRouteVertices p n i.castSucc) + (hg : ∀i,home (g i)=simpleRouteVertices q l i.castSucc) (R : ℕ) : + (nearSlots (torusNear K R) (fun i ↦ gridSite (slotCenter home (siteIndex y) i)) + (routeSlots f) (routeSlots g)).card≤ simpleEncounter R p q := by + obtain ⟨pick,hpick,hp⟩ := simpleRouteSlots p hn home f hf + obtain ⟨choose,hchoose,hq⟩ := simpleRouteSlots q hl home g hg + rw [gridSite_slotCenter,hp,hq] + exact simple_nearSlots_bound R p q _ pick choose hpick hchoose + +lemma simpleRoute_near_second {n l : ℕ} (p q : SimplePath x y) + (hn : n+1=p.val.length) (hl : l+1=q.val.length) + (home : J→Fin 3→Fin K) (f : Fin (n+1)↪J) (g : Fin (l+1)↪J) + (hf : ∀i,home (f i)=simpleRouteVertices p n i.castSucc) + (hg : ∀i,home (g i)=simpleRouteVertices q l i.castSucc) (R : ℕ) : + (nearSlots (torusNear K R) (fun i ↦ gridSite (slotCenter home (siteIndex x) i)) + (routeSlots f) (routeSlots g)).card≤2*simpleEncounter R p q := by + obtain ⟨pick,hpick,hp⟩ := simpleRouteSlots p hn home f hf + obtain ⟨choose,hchoose,hq⟩ := simpleRouteSlots q hl home g hg + rw [gridSite_slotCenter,hp,hq] + exact second_primary_nearSlots_bound R p q _ pick choose hpick hchoose + +end HardSphere.Groups +end +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Paths/SkeletonHitConstant.lean b/lean/OAI/Analysis/HardSphere/Paths/SkeletonHitConstant.lean new file mode 100644 index 0000000000000000000000000000000000000000..187444035297f7400a4f671877449e7e1f6c082d --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Paths/SkeletonHitConstant.lean @@ -0,0 +1,146 @@ +import Mathlib +import OAI.Analysis.HardSphere.Paths.LevelList + +namespace OAI + +section +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal BigOperators Topology +namespace HardSphere.DyadicSkeleton + +lemma occurrenceHit_le (K n : ℕ) (hn : 0 < n) (hnK : 8*n ≤ K) + (d : Fin 2 → ℤ) (hd : ∀j, |d j| ≤ n) (ω ω' : Noise) (R : ℝ) : + occurrenceHit K R (occurrenceList n d ω) (occurrenceList n d ω') ≤ + 20*∑ u ∈ Finset.range (n/2+1), + nearPotential u (fun j ↦ position ω' j u) (3*R+5) ω := by + have h := oneSideHit_le K n hn hnK d hd ω ω' R + have h' := oneSideHit_le K n hn hnK d hd ω' ω R + simp_rw [nearPotential_swap _ _ ω ω'] at h' + unfold occurrenceHit + linarith + +lemma occurrenceSoft_le (K n : ℕ) (hn : 0 < n) (hnK : 8*n ≤ K) + (d : Fin 2 → ℤ) (hd : ∀j, |d j| ≤ n) (ω ω' : Noise) (B : ℝ) (hB : 0 < B) : + occurrenceSoft K B (occurrenceList n d ω) (occurrenceList n d ω') ≤ + (10*Real.exp (5/(3*B)))*∑ u ∈ Finset.range (n/2+1), + Real.exp (-twoCopyDistance u (ω,ω')/(3*B)) := by + have h := level_sum_le n hn d hd ω + (fun x ↦ Real.exp (-distanceToList K x (occurrenceList n d ω')/B)) + (fun t ↦ Real.exp (5/(3*B))*Real.exp (-twoCopyDistance (min t (n-t)) (ω,ω')/(3*B))) + (fun _ ↦ by positivity) (by + intro t ht x hx + rw [← Real.exp_add] + apply Real.exp_le_exp.mpr + have hdev := distanceToList_deviation_le K n hn hnK d hd ω ω' t ht x hx + have hBp : 0 < 3*B := by positivity + rw [← add_div] + apply (le_div_iff₀ hBp).mpr + have he : (-distanceToList K x (occurrenceList n d ω')/B)*(3*B) = + -3*distanceToList K x (occurrenceList n d ω') := by field_simp + rw [he] + linarith) + have hf := folded_sum_le n + (fun u ↦ Real.exp (-twoCopyDistance u (ω,ω')/(3*B))) (fun _ ↦ (Real.exp_pos _).le) + change occurrenceSoft K B _ _ ≤ _ at h + simp_rw [← Finset.mul_sum] at h + have hpos : 0 < Real.exp (5/(3*B)) := Real.exp_pos _ + nlinarith + +def skeletonHitConstant : ℝ := hitConstant/720 +lemma skeletonHitConstant_pos : 0 < skeletonHitConstant := div_pos hitConstant_pos (by norm_num) + +theorem skeleton_hit_moment (K n : ℕ) (hn : 0 < n) (hnK : 8*n ≤ K) + (d : Fin 2 → ℤ) (hd : ∀j, |d j| ≤ n) (R : ℕ) : + (∫⁻ z : Noise × Noise, ENNReal.ofReal (Real.exp + ((skeletonHitConstant/(1+(R:ℝ))^2) * + occurrenceHit K (R:ℝ) (occurrenceList n d z.1) (occurrenceList n d z.2))) + ∂law.prod law) ≤ 2 := by + have hcoeff : skeletonHitConstant/(1+(R:ℝ))^2*20 ≤ + hitConstant/(1+((3*R+5:ℕ):ℝ))^2 := by + have hR : 0 ≤ (R:ℝ) := by positivity + have hden : (1+((3*R+5:ℕ):ℝ))^2 ≤ 36*(1+(R:ℝ))^2 := by + push_cast + nlinarith + calc + _ = hitConstant/(36*(1+(R:ℝ))^2) := by + unfold skeletonHitConstant + field_simp + ring + _ ≤ _ := div_le_div_of_nonneg_left hitConstant_pos.le (by positivity) hden + refine le_trans (lintegral_mono (fun z ↦ ?_)) (two_copy_hit_moment (n/2) (3*R+5)) + apply ENNReal.ofReal_le_ofReal + apply Real.exp_le_exp.mpr + have h := occurrenceHit_le K n hn hnK d hd z.1 z.2 (R:ℝ) + have ha : 0 ≤ skeletonHitConstant/(1+(R:ℝ))^2 := by + exact div_nonneg skeletonHitConstant_pos.le (sq_nonneg _) + calc + _ ≤ (skeletonHitConstant/(1+(R:ℝ))^2) * + (20*∑ u ∈ Finset.range (n/2+1), + nearPotential u (fun j ↦ position z.2 j u) (3*(R:ℝ)+5) z.1) := + mul_le_mul_of_nonneg_left h ha + _ = (skeletonHitConstant/(1+(R:ℝ))^2*20) * + ∑ u ∈ Finset.range (n/2+1), + nearPotential u (fun j ↦ position z.2 j u) ((3*R+5:ℕ):ℝ) z.1 := by + push_cast + ring + _ ≤ _ := mul_le_mul_of_nonneg_right hcoeff + (Finset.sum_nonneg (fun u _ ↦ nearPotential_nonneg _ _ _ _)) + +theorem skeleton_soft_moment (B : ℝ) (hB : 0 < B) : + ∃ ξ : ℝ, 0 < ξ ∧ ∀ K n : ℕ, 0 < n → 8*n ≤ K → + ∀ d : Fin 2 → ℤ, (∀j, |d j| ≤ n) → + (∫⁻ z : Noise × Noise, ENNReal.ofReal (Real.exp + (ξ*occurrenceSoft K B (occurrenceList n d z.1) (occurrenceList n d z.2))) + ∂law.prod law) ≤ 2 := by + obtain ⟨η,hη,hm⟩ := two_copy_soft_moment (3*B) (by positivity) + let C : ℝ := 10*Real.exp (5/(3*B)) + have hC : 0 < C := by dsimp [C]; positivity + refine ⟨η/C,div_pos hη hC,fun K n hn hnK d hd ↦ ?_⟩ + refine le_trans (lintegral_mono (fun z ↦ ?_)) (hm (n/2)) + apply ENNReal.ofReal_le_ofReal + apply Real.exp_le_exp.mpr + calc + _ ≤ (η/C)*(C*∑ u ∈ Finset.range (n/2+1), + Real.exp (-twoCopyDistance u z/(3*B))) := + mul_le_mul_of_nonneg_left (occurrenceSoft_le K n hn hnK d hd z.1 z.2 B hB) + (div_pos hη hC).le + _ = _ := by field_simp + +instance listVertexMeasurableSpace : MeasurableSpace (List Vertex) := ⊤ +instance listVertexDiscreteMeasurableSpace : DiscreteMeasurableSpace (List Vertex) := ⟨fun _ ↦ trivial⟩ + +@[fun_prop] lemma measurable_levelList (n : ℕ) (d : Fin 2 → ℤ) (t : ℕ) : + Measurable (fun ω ↦ levelList n d ω t) := by + cases t with + | zero => + exact (measurable_of_countable (fun a : Vertex ↦ [a])).comp + (measurable_baseVertex n d 0) + | succ t => + exact (measurable_of_countable (fun a : Vertex × Vertex ↦ refineStep a.1 a.2)).comp + ((measurable_baseVertex n d t).prodMk (measurable_baseVertex n d (t+1))) + +@[fun_prop] lemma measurable_occurrenceList (n : ℕ) (d : Fin 2 → ℤ) : + Measurable (occurrenceList n d) := by + have hl (ts : List ℕ) : Measurable (fun ω ↦ ts.flatMap (levelList n d ω)) := by + induction ts with + | nil => exact measurable_const + | cons t ts ih => + simpa only [List.flatMap_cons,Function.comp_def] using + (measurable_of_countable (fun p : List Vertex × List Vertex ↦ p.1 ++ p.2)).comp + ((measurable_levelList n d t).prodMk ih) + exact hl (List.range (n+1)) + +def skeletonLaw (n : ℕ) (d : Fin 2 → ℤ) : Measure (List Vertex) := + law.map (occurrenceList n d) + +instance skeletonLaw_isProbability (n : ℕ) (d : Fin 2 → ℤ) : + IsProbabilityMeasure (skeletonLaw n d) := + (Measure.isProbabilityMeasure_map_iff + (measurable_occurrenceList n d).aemeasurable).mpr inferInstance + +end HardSphere.DyadicSkeleton +end +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Paths/TimeGaps.lean b/lean/OAI/Analysis/HardSphere/Paths/TimeGaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..bbb030dcb913b63aa3a1939dc49c982114bd12b8 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Paths/TimeGaps.lean @@ -0,0 +1,434 @@ +import Mathlib +import OAI.Analysis.HardSphere.Paths.Index + +namespace OAI + +section +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal BigOperators Topology +namespace HardSphere.DyadicSkeleton + +lemma weighted_gap_concentration (t k : ℕ) (hk : 0 < k) + (y : Fin 2 → ℝ) (R : ℝ) (hR : 0 ≤ R) (H : Noise → ℝ≥0∞) + (hH : Measurable H) (hinv : PastInvariant t H) : + (∫⁻ ω, H ω * nearTest (t+k) y R ω ∂law) ≤ + ENNReal.ofReal ((16*R^2/cvel^2) * (k:ℝ)^(-(3:ℝ)/2)) * + ∫⁻ ω, H ω ∂law := by + obtain ⟨ℓ,b,ht,hf,hkℓ⟩ := exists_fresh_block t k hk + refine (fresh_weighted_pair ℓ b (t+k) hf y R H hH + (fun j ↦ hinv j ℓ b ht)).trans ?_ + apply mul_le_mul_left + rw [← ENNReal.ofReal_pow (div_nonneg hR (freshScale_pos ℓ).le)] + exact ENNReal.ofReal_le_ofReal (freshScale_gap_bound k ℓ hk hkℓ R) + +def timeGaps : {n : ℕ} → (Fin n → ℕ) → Fin n → ℕ + | 0, _ => Fin.elim0 + | _+1, t => Fin.cases (t 0) (fun i ↦ t i.succ - t i.castSucc) + +@[simp] lemma timeGaps_zero {n : ℕ} (t : Fin (n+1) → ℕ) : timeGaps t 0 = t 0 := rfl +@[simp] lemma timeGaps_succ {n : ℕ} (t : Fin (n+1) → ℕ) (i : Fin n) : + timeGaps t i.succ = t i.succ - t i.castSucc := rfl + +lemma timeGaps_castSucc {n : ℕ} (t : Fin (n+1) → ℕ) (i : Fin n) : + timeGaps t i.castSucc = timeGaps (Fin.init t) i := by + cases n with + | zero => exact Fin.elim0 i + | succ n => exact Fin.cases rfl (fun _ ↦ rfl) i + +lemma timeGaps_injective {n : ℕ} : + Function.Injective (fun t : {t : Fin n → ℕ // Monotone t} ↦ timeGaps t.val) := by + intro t s h + apply Subtype.ext + funext i + cases n with + | zero => exact Fin.elim0 i + | succ n => + refine Fin.induction ?_ (fun j ih ↦ ?_) i + · exact congrFun h 0 + · have he := congrFun h j.succ + simp only [timeGaps_succ] at he + have ht := t.property (Fin.castSucc_le_succ j) + have hs := s.property (Fin.castSucc_le_succ j) + omega + +def splitVectorEquiv (n : ℕ) (A : Type*) : (Fin (n+1) → A) ≃ A × (Fin n → A) where + toFun f := (f 0, fun i ↦ f i.succ) + invFun v := Fin.cases v.1 v.2 + left_inv f := by funext i; exact Fin.cases rfl (fun _ ↦ rfl) i + right_inv v := rfl + +lemma tsum_vector_prod {n : ℕ} (f : Fin n → ℕ → ℝ≥0∞) : + (∑' g : Fin n → ℕ, ∏ i, f i (g i)) = ∏ i, ∑' k, f i k := by + induction n with + | zero => simp + | succ n ih => + rw [← (splitVectorEquiv n ℕ).symm.tsum_eq] + change (∑' v : ℕ × (Fin n → ℕ), ∏ i, f i (Fin.cases v.1 v.2 i)) = _ + rw [ENNReal.tsum_prod'] + simp only [Fin.prod_univ_succ, Fin.cases_zero, Fin.cases_succ] + simp_rw [ENNReal.tsum_mul_left, ih] + rw [ENNReal.tsum_mul_right] + +lemma ordered_gap_sum_bound (T n : ℕ) (b : ℕ → ℝ≥0∞) : + (∑' t : {t : Fin n → ℕ // StrictMono t ∧ ∀ i, t i ≤ T}, ∏ i, b (timeGaps t.val i)) ≤ + (∑' k, b k)^n := by + let g : {t : Fin n → ℕ // StrictMono t ∧ ∀ i, t i ≤ T} → (Fin n → ℕ) := + fun t ↦ timeGaps t.val + have hg : Function.Injective g := by + intro t s he + have hv := timeGaps_injective (a₁ := ⟨t.val,t.property.1.monotone⟩) + (a₂ := ⟨s.val,s.property.1.monotone⟩) he + exact Subtype.ext (congrArg (fun q : {f : Fin n → ℕ // Monotone f} ↦ q.val) hv) + have h := ENNReal.tsum_comp_le_tsum_of_injective hg (fun v : Fin n → ℕ ↦ ∏ i, b (v i)) + simpa only [g, tsum_vector_prod, Finset.prod_const, Finset.card_univ, Fintype.card_fin] using h + +abbrev BoundedTimes (T n : ℕ) := {t : Fin n → ℕ // StrictMono t ∧ ∀ i, t i ≤ T} +abbrev TimeSubset (T : ℕ) := {s : Finset ℕ // s ∈ (Finset.range (T+1)).powerset} + +def encodeTimeSubset (T : ℕ) (s : TimeSubset T) : Σ n, BoundedTimes T n := + ⟨s.val.card, ⟨s.val.orderEmbOfFin rfl, (s.val.orderEmbOfFin rfl).strictMono, + fun i ↦ by + have h := (Finset.mem_powerset.mp s.property) (s.val.orderEmbOfFin_mem rfl i) + exact Nat.le_of_lt_succ (Finset.mem_range.mp h)⟩⟩ + +def decodeTimes {T : ℕ} (v : Σ n, BoundedTimes T n) : Finset ℕ := + Finset.univ.image v.2.val + +lemma decode_encode (T : ℕ) (s : TimeSubset T) : decodeTimes (encodeTimeSubset T s) = s.val := by + exact s.val.image_orderEmbOfFin_univ rfl + +lemma encodeTimeSubset_injective (T : ℕ) : Function.Injective (encodeTimeSubset T) := by + intro s t h + apply Subtype.ext + simpa only [decode_encode] using congrArg decodeTimes h + +lemma prod_encode (T : ℕ) (s : TimeSubset T) (f : ℕ → ℝ≥0∞) : + (∏ i, f ((encodeTimeSubset T s).2.val i)) = ∏ u ∈ s.val, f u := by + change (∏ i, f (s.val.orderEmbOfFin rfl i)) = _ + conv_rhs => rw [← s.val.map_orderEmbOfFin_univ rfl, Finset.prod_map] + rfl + +lemma prod_one_add_le_ordered_series (T : ℕ) (f : ℕ → ℝ≥0∞) : + (∏ u ∈ Finset.range (T+1), (1+f u)) ≤ + ∑' n, ∑' t : BoundedTimes T n, ∏ i, f (t.val i) := by + rw [Finset.prod_one_add] + calc + _ = ∑' s : TimeSubset T, ∏ u ∈ s.val, f u := by + rw [tsum_fintype] + exact (Finset.sum_attach _ _).symm + _ = ∑' s : TimeSubset T, ∏ i, f ((encodeTimeSubset T s).2.val i) := by + apply tsum_congr + intro s + exact (prod_encode T s f).symm + _ ≤ ∑' v : Σ n, BoundedTimes T n, ∏ i, f (v.2.val i) := + ENNReal.tsum_comp_le_tsum_of_injective (encodeTimeSubset_injective T) + (fun v : Σ n, BoundedTimes T n ↦ ∏ i, f (v.2.val i)) + _ = _ := ENNReal.tsum_sigma' _ + +def gapKernel (k : ℕ) : ℝ≥0∞ := + if k=0 then 1 else ENNReal.ofReal ((16/cvel^2) * (k:ℝ)^(-(3:ℝ)/2)) +def radiusFactor (R : ℝ) : ℝ≥0∞ := ENNReal.ofReal ((1+R)^2) + +lemma radiusFactor_one_le (R : ℝ) (hR : 0 ≤ R) : 1 ≤ radiusFactor R := by + rw [← ENNReal.ofReal_one] + apply ENNReal.ofReal_le_ofReal + nlinarith + +lemma weighted_gap_radius (t k : ℕ) (hk : 0 < k) + (y : Fin 2 → ℝ) (R : ℝ) (hR : 0 ≤ R) (H : Noise → ℝ≥0∞) + (hH : Measurable H) (hinv : PastInvariant t H) : + (∫⁻ ω, H ω * nearTest (t+k) y R ω ∂law) ≤ + radiusFactor R * gapKernel k * ∫⁻ ω, H ω ∂law := by + refine (weighted_gap_concentration t k hk y R hR H hH hinv).trans ?_ + apply mul_le_mul_left + rw [gapKernel,ite_eq_right (ne_of_gt hk),radiusFactor, + ← ENNReal.ofReal_mul (sq_nonneg (1+R))] + apply ENNReal.ofReal_le_ofReal + have hp : 0 ≤ (16/cvel^2) * (k:ℝ)^(-(3:ℝ)/2) := by positivity + calc + _ = R^2 * ((16/cvel^2) * (k:ℝ)^(-(3:ℝ)/2)) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_right (by nlinarith) hp + +def encounterMass {n : ℕ} (t : Fin n → ℕ) (r : Fin n → ℝ) + (y : ℕ → Fin 2 → ℝ) : ℝ≥0∞ := + ∫⁻ ω, ∏ i, nearTest (t i) (y (t i)) (r i) ω ∂law + +lemma encounter_append_bound (u s : ℕ) (hus : u < s) + {n : ℕ} (t : Fin n → ℕ) (r : Fin n → ℝ) (y : ℕ → Fin 2 → ℝ) + (ht : ∀ i, t i ≤ u) (R : ℝ) (hR : 0 ≤ R) : + encounterMass (Fin.snoc t s) (Fin.snoc r R) y ≤ + radiusFactor R * gapKernel (s-u) * encounterMass t r y := by + have h := weighted_gap_radius u (s-u) (by omega) (y s) R hR + (fun ω ↦ ∏ i, nearTest (t i) (y (t i)) (r i) ω) (by fun_prop) (by + intro j ℓ b hb ω x + apply Finset.prod_congr rfl + intro i _ + exact nearTest_pastInvariant (t i) u (ht i) (y (t i)) (r i) j ℓ b hb ω x) + rw [Nat.add_sub_of_le hus.le] at h + simpa only [encounterMass,Fin.prod_univ_castSucc,Fin.snoc_castSucc,Fin.snoc_last] using h + +lemma encounter_singleton_bound (s : ℕ) (R : ℝ) (hR : 0 ≤ R) (y : ℕ → Fin 2 → ℝ) : + encounterMass (fun _ : Fin 1 ↦ s) (fun _ ↦ R) y ≤ radiusFactor R * gapKernel s := by + by_cases h0 : s=0 + · subst s + refine le_trans ?_ (by simpa [gapKernel] using radiusFactor_one_le R hR) + calc + _ ≤ ∫⁻ _ : Noise, 1 ∂law := by + apply lintegral_mono + intro ω + simpa only [Fin.prod_univ_one] using nearTest_le_one 0 (y 0) R ω + _ = 1 := by simp + · have h := weighted_gap_radius 0 s (by omega) (y s) R hR + (fun _ ↦ 1) measurable_const (by intro j ℓ b hb ω x; rfl) + simpa [encounterMass,Fin.prod_univ_one] using h + +lemma encounterMass_le_gap_prod (n : ℕ) (t : Fin n → ℕ) (r : Fin n → ℝ) + (y : ℕ → Fin 2 → ℝ) (ht : StrictMono t) (hr : ∀ i, 0 ≤ r i) : + encounterMass t r y ≤ ∏ i, radiusFactor (r i) * gapKernel (timeGaps t i) := by + induction n with + | zero => simp [encounterMass] + | succ n ih => + cases n with + | zero => + have h := encounter_singleton_bound (t 0) (r 0) (hr 0) y + have he : (fun _ : Fin 1 ↦ t 0) = t := by + funext i; exact congrArg t (Fin.ext (by omega)) + have hl : (fun _ : Fin 1 ↦ r 0) = r := by + funext i; exact congrArg r (Fin.ext (by omega)) + rw [he, hl] at h + rw [Fin.prod_univ_one, timeGaps_zero] + exact h + | succ n => + have hin : StrictMono (Fin.init t) := ht.comp (Fin.strictMono_castSucc) + have hb := ih (Fin.init t) (Fin.init r) hin (fun i ↦ hr i.castSucc) + have hlt : t (Fin.last n).castSucc < t (Fin.last (n+1)) := ht (by simp) + have ha := encounter_append_bound (t (Fin.last n).castSucc) (t (Fin.last (n+1))) + hlt (Fin.init t) (Fin.init r) y + (fun i ↦ ht.monotone (by exact_mod_cast Fin.le_last i)) + (r (Fin.last (n+1))) (hr _) + rw [Fin.snoc_init_self, Fin.snoc_init_self] at ha + refine ha.trans ?_ + rw [Fin.prod_univ_castSucc] + calc + _ ≤ radiusFactor (r (Fin.last (n+1))) * + gapKernel (t (Fin.last (n+1))-t (Fin.last n).castSucc) * + ∏ i, radiusFactor (Fin.init r i) * gapKernel (timeGaps (Fin.init t) i) := + mul_le_mul' le_rfl hb + _ = _ := by + simp_rw [timeGaps_castSucc] + change _ = _ * (radiusFactor (r (Fin.last (n+1))) * + gapKernel (t (Fin.last (n+1))-t (Fin.last n).castSucc)) + exact mul_comm _ _ + +lemma gapKernel_sum_ne_top : (∑' k, gapKernel k) ≠ ∞ := by + have hs : Summable (fun k : ℕ ↦ (16/cvel^2) * (k:ℝ)^(-(3:ℝ)/2)) := + (Real.summable_nat_rpow.mpr (by norm_num)).mul_left _ + have he : (∑' k : ℕ, ENNReal.ofReal ((16/cvel^2) * (k:ℝ)^(-(3:ℝ)/2))) = + ENNReal.ofReal (∑' k : ℕ, (16/cvel^2) * (k:ℝ)^(-(3:ℝ)/2)) := + (ENNReal.ofReal_tsum_of_nonneg (fun _ ↦ by positivity) hs).symm + have hb : (∑' k, gapKernel k) ≤ + 1 + ∑' k : ℕ, ENNReal.ofReal ((16/cvel^2) * (k:ℝ)^(-(3:ℝ)/2)) := by + calc + _ ≤ (∑' k : ℕ, ((if k=0 then 1 else 0) + + ENNReal.ofReal ((16/cvel^2) * (k:ℝ)^(-(3:ℝ)/2)))) := by + apply ENNReal.tsum_le_tsum + intro k + by_cases h : k=0 <;> simp [gapKernel,h] + _ = _ := by rw [ENNReal.tsum_add]; simp + rw [he] at hb + exact ne_top_of_le_ne_top (by finiteness) hb + +lemma gapKernel_sum_one_le : (1 : ℝ≥0∞) ≤ ∑' k, gapKernel k := by + simpa only [gapKernel,↓reduceIte] using ENNReal.le_tsum (f := gapKernel) 0 + +def orderedEncounterConstant : ℝ := (∑' k, gapKernel k).toReal +lemma orderedEncounterConstant_pos : 0 < orderedEncounterConstant := by + exact ENNReal.toReal_pos (ne_of_gt (lt_of_lt_of_le (by norm_num) gapKernel_sum_one_le)) + gapKernel_sum_ne_top +lemma orderedEncounterConstant_cast : ENNReal.ofReal orderedEncounterConstant = ∑' k, gapKernel k := + ENNReal.ofReal_toReal gapKernel_sum_ne_top + +lemma ordered_encounter_sum (T n : ℕ) (r : Fin n → ℝ) (hr : ∀ i, 0 ≤ r i) + (y : ℕ → Fin 2 → ℝ) : + (∑' t : BoundedTimes T n, encounterMass t.val r y) ≤ + ∏ i, ENNReal.ofReal orderedEncounterConstant * radiusFactor (r i) := by + calc + _ ≤ ∑' t : BoundedTimes T n, ∏ i, radiusFactor (r i) * gapKernel (timeGaps t.val i) := + ENNReal.tsum_le_tsum fun t ↦ encounterMass_le_gap_prod n t.val r y t.property.1 hr + _ = (∏ i, radiusFactor (r i)) * + ∑' t : BoundedTimes T n, ∏ i, gapKernel (timeGaps t.val i) := by + simp_rw [Finset.prod_mul_distrib,ENNReal.tsum_mul_left] + _ ≤ (∏ i, radiusFactor (r i)) * (∑' k, gapKernel k)^n := + mul_le_mul' le_rfl (ordered_gap_sum_bound T n gapKernel) + _ = _ := by + rw [Finset.prod_mul_distrib,orderedEncounterConstant_cast] + simp [mul_comm] + +def radiusEnvelope (a : ℕ → ℝ≥0∞) (n : ℕ) (y : Fin 2 → ℝ) (ω : Noise) : ℝ≥0∞ := + ∑' l : ℕ, a l * nearTest n y (l:ℝ) ω + +@[fun_prop] lemma measurable_radiusEnvelope (a : ℕ → ℝ≥0∞) (n : ℕ) (y : Fin 2 → ℝ) : + Measurable (radiusEnvelope a n y) := by + unfold radiusEnvelope + exact Measurable.tsum (fun l ↦ (measurable_nearTest n y (l:ℝ)).const_mul _) + +lemma radiusEnvelope_prod {n : ℕ} (t : Fin n → ℕ) (a : ℕ → ℝ≥0∞) + (y : ℕ → Fin 2 → ℝ) (ω : Noise) : + (∏ i, radiusEnvelope a (t i) (y (t i)) ω) = + ∑' l : Fin n → ℕ, (∏ i, a (l i)) * ∏ i, nearTest (t i) (y (t i)) (l i : ℝ) ω := by + unfold radiusEnvelope + rw [← tsum_vector_prod] + apply tsum_congr + intro l + exact Finset.prod_mul_distrib + +def weightedEncounterMass {n : ℕ} (t : Fin n → ℕ) (a : ℕ → ℝ≥0∞) + (y : ℕ → Fin 2 → ℝ) : ℝ≥0∞ := + ∫⁻ ω, ∏ i, radiusEnvelope a (t i) (y (t i)) ω ∂law + +lemma weightedEncounterMass_eq {n : ℕ} (t : Fin n → ℕ) (a : ℕ → ℝ≥0∞) + (y : ℕ → Fin 2 → ℝ) : + weightedEncounterMass t a y = + ∑' l : Fin n → ℕ, (∏ i, a (l i)) * encounterMass t (fun i ↦ (l i : ℝ)) y := by + unfold weightedEncounterMass + simp_rw [radiusEnvelope_prod] + rw [lintegral_tsum (fun l ↦ by fun_prop)] + apply tsum_congr + intro l + exact lintegral_const_mul _ (by fun_prop) + +def radiusActivity (a : ℕ → ℝ≥0∞) : ℝ≥0∞ := + ENNReal.ofReal orderedEncounterConstant * ∑' l : ℕ, a l * radiusFactor (l:ℝ) + +lemma weighted_ordered_sum_bound (T n : ℕ) (a : ℕ → ℝ≥0∞) + (y : ℕ → Fin 2 → ℝ) : + (∑' t : BoundedTimes T n, weightedEncounterMass t.val a y) ≤ (radiusActivity a)^n := by + simp_rw [weightedEncounterMass_eq] + rw [ENNReal.tsum_comm] + calc + _ = ∑' l : Fin n → ℕ, (∏ i, a (l i)) * + ∑' t : BoundedTimes T n, encounterMass t.val (fun i ↦ (l i : ℝ)) y := by + apply tsum_congr + intro l + rw [ENNReal.tsum_mul_left] + _ ≤ ∑' l : Fin n → ℕ, (∏ i, a (l i)) * + ∏ i, ENNReal.ofReal orderedEncounterConstant * radiusFactor (l i : ℝ) := + ENNReal.tsum_le_tsum fun l ↦ mul_le_mul' le_rfl + (ordered_encounter_sum T n (fun i ↦ (l i : ℝ)) (fun i ↦ Nat.cast_nonneg _) y) + _ = ∑' l : Fin n → ℕ, ∏ i, + ENNReal.ofReal orderedEncounterConstant * (a (l i) * radiusFactor (l i : ℝ)) := by + apply tsum_congr + intro l + rw [← Finset.prod_mul_distrib] + apply Finset.prod_congr rfl + intro i _ + ring + _ = _ := by + rw [tsum_vector_prod (fun (_ : Fin n) k ↦ + ENNReal.ofReal orderedEncounterConstant * (a k * radiusFactor (k:ℝ)))] + simp only [ENNReal.tsum_mul_left,radiusActivity,Finset.prod_const, + Finset.card_univ,Fintype.card_fin] + +lemma ordered_product_bound_envelope (T : ℕ) (a : ℕ → ℝ≥0∞) + (y : ℕ → Fin 2 → ℝ) : + (∫⁻ ω, ∏ u ∈ Finset.range (T+1), (1+radiusEnvelope a u (y u) ω) ∂law) ≤ + (1-radiusActivity a)⁻¹ := by + calc + _ ≤ ∫⁻ ω, ∑' n, ∑' t : BoundedTimes T n, + ∏ i, radiusEnvelope a (t.val i) (y (t.val i)) ω ∂law := + lintegral_mono fun ω ↦ prod_one_add_le_ordered_series T + (fun u ↦ radiusEnvelope a u (y u) ω) + _ = ∑' n, ∑' t : BoundedTimes T n, weightedEncounterMass t.val a y := by + rw [lintegral_tsum (fun n ↦ (Measurable.tsum (fun t ↦ by fun_prop)).aemeasurable)] + apply tsum_congr + intro n + rw [lintegral_tsum (fun t ↦ by fun_prop)] + rfl + _ ≤ ∑' n, (radiusActivity a)^n := + ENNReal.tsum_le_tsum (fun n ↦ weighted_ordered_sum_bound T n a y) + _ = _ := ENNReal.tsum_geometric _ + +lemma ordered_product_bound (T : ℕ) (a : ℕ → ℝ≥0∞) (y : ℕ → Fin 2 → ℝ) + (f : ℕ → Noise → ℝ≥0∞) (hf : ∀ n ω, f n ω ≤ radiusEnvelope a n (y n) ω) : + (∫⁻ ω, ∏ u ∈ Finset.range (T+1), (1+f u ω) ∂law) ≤ (1-radiusActivity a)⁻¹ := by + refine le_trans (lintegral_mono (fun ω ↦ ?_)) (ordered_product_bound_envelope T a y) + exact Finset.prod_le_prod (fun u _ ↦ add_le_add_right (hf u ω) 1) + +lemma exp_sub_one_le_slope {x B : ℝ} (hx : 0 ≤ x) (hB : x ≤ B) : + Real.exp x - 1 ≤ Real.exp B * x := by + have h := mul_le_mul_of_nonneg_left (Real.add_one_le_exp (-x)) (Real.exp_pos x).le + rw [← Real.exp_add, add_neg_cancel, Real.exp_zero] at h + have he : Real.exp x ≤ Real.exp B := Real.exp_le_exp.mpr hB + nlinarith [mul_le_mul_of_nonneg_right he hx] + +lemma radiusEnvelope_smul (c : ℝ≥0∞) (a : ℕ → ℝ≥0∞) (n : ℕ) + (y : Fin 2 → ℝ) (ω : Noise) : + radiusEnvelope (fun l ↦ c*a l) n y ω = c*radiusEnvelope a n y ω := by + unfold radiusEnvelope + rw [← ENNReal.tsum_mul_left] + apply tsum_congr + intro l + ring + +lemma radiusActivity_smul (c : ℝ≥0∞) (a : ℕ → ℝ≥0∞) : + radiusActivity (fun l ↦ c*a l) = c*radiusActivity a := by + unfold radiusActivity + simp only [mul_assoc] + rw [ENNReal.tsum_mul_left] + ac_rfl + +lemma ofReal_exp_finset_sum {ι : Type*} (s : Finset ι) (f : ι → ℝ) : + ENNReal.ofReal (Real.exp (∑ i ∈ s, f i)) = ∏ i ∈ s, ENNReal.ofReal (Real.exp (f i)) := by + rw [Real.exp_sum, ENNReal.ofReal_prod_of_nonneg] + intro i _ + exact (Real.exp_pos _).le + +lemma radius_exponential_bound (T : ℕ) (a : ℕ → ℝ≥0∞) (y : ℕ → Fin 2 → ℝ) + (U : ℕ → Noise → ℝ) (hU0 : ∀ n ω, 0 ≤ U n ω) (hU1 : ∀ n ω, U n ω ≤ 1) + (hUa : ∀ n ω, ENNReal.ofReal (U n ω) ≤ radiusEnvelope a n (y n) ω) + (ha : ENNReal.ofReal (2*Real.exp 2) * radiusActivity a ≤ (1/2:ℝ≥0∞)) : + (∫⁻ ω, ENNReal.ofReal (Real.exp (2 * ∑ u ∈ Finset.range (T+1), U u ω)) ∂law) ≤ 2 := by + let c := ENNReal.ofReal (2*Real.exp 2) + let b := fun l ↦ c*a l + let f := fun n ω ↦ ENNReal.ofReal (Real.exp (2*U n ω)-1) + have hba : radiusActivity b ≤ (1/2:ℝ≥0∞) := by + simpa only [b,radiusActivity_smul,c] using ha + have hbf : ∀ n ω, f n ω ≤ radiusEnvelope b n (y n) ω := by + intro n ω + calc + f n ω ≤ ENNReal.ofReal (2*Real.exp 2 * U n ω) := by + apply ENNReal.ofReal_le_ofReal + simpa only [mul_assoc,mul_left_comm,mul_comm] using + exp_sub_one_le_slope (by linarith [hU0 n ω] : 0 ≤ 2*U n ω) + (by linarith [hU1 n ω] : 2*U n ω ≤ 2) + _ = c * ENNReal.ofReal (U n ω) := by rw [ENNReal.ofReal_mul (by positivity)] + _ ≤ c * radiusEnvelope a n (y n) ω := mul_le_mul' le_rfl (hUa n ω) + _ = radiusEnvelope b n (y n) ω := (radiusEnvelope_smul c a n (y n) ω).symm + have he (n : ℕ) (ω : Noise) : 1+f n ω = ENNReal.ofReal (Real.exp (2*U n ω)) := by + have hx : 0 ≤ Real.exp (2*U n ω)-1 := by + have := Real.one_le_exp_iff.mpr (by linarith [hU0 n ω] : 0 ≤ 2*U n ω) + linarith + change 1+ENNReal.ofReal (Real.exp (2*U n ω)-1) = _ + rw [← ENNReal.ofReal_one,← ENNReal.ofReal_add (by norm_num) hx] + congr 1 + ring + have h := ordered_product_bound T b y f hbf + have hh : (∫⁻ ω, ENNReal.ofReal + (Real.exp (2 * ∑ u ∈ Finset.range (T+1), U u ω)) ∂law) = + ∫⁻ ω, ∏ u ∈ Finset.range (T+1), (1+f u ω) ∂law := by + apply lintegral_congr + intro ω + rw [Finset.mul_sum,ofReal_exp_finset_sum] + exact Finset.prod_congr rfl (fun u _ ↦ (he _ _).symm) + rw [hh] + refine h.trans ?_ + have hd : (1/2:ℝ≥0∞) ≤ 1-radiusActivity b := by + simpa using tsub_le_tsub_left hba (1:ℝ≥0∞) + exact (ENNReal.inv_le_inv.mpr hd).trans_eq (by norm_num) + +end HardSphere.DyadicSkeleton +end +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Rescaling/PhysicalRescaling.lean b/lean/OAI/Analysis/HardSphere/Rescaling/PhysicalRescaling.lean new file mode 100644 index 0000000000000000000000000000000000000000..5899586058820f1835861daa478710cf93462240 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Rescaling/PhysicalRescaling.lean @@ -0,0 +1,120 @@ +import Mathlib +import OAI.Analysis.HardSphere.Geometry.BoxWeight + +namespace OAI + +section + +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal BigOperators Topology +namespace HardSphere +namespace Rescaling +attribute [local instance] Classical.propDecidable + +def circle (L J : Length) : AddCircle L.val ≃+ AddCircle J.val := + AddCircle.equivAddCircle L.val J.val L.property.ne' J.property.ne' +def torus (L J : Length) : Torus L ≃+ Torus J := AddEquiv.piCongrRight fun _ ↦ circle L J +def config (N : ℕ) (L J : Length) : Configuration N L ≃+ Configuration N J := + AddEquiv.piCongrRight fun _ ↦ torus L J +def configHomeo (N : ℕ) (L J : Length) : Configuration N L ≃ₜ Configuration N J := + Homeomorph.piCongrRight fun _ ↦ Homeomorph.piCongrRight fun _ ↦ + AddCircle.homeomorphAddCircle L.val J.val L.property.ne' J.property.ne' + +lemma configHomeo_toFun (N : ℕ) (L J : Length) : (configHomeo N L J : Configuration N L → Configuration N J)=config N L J := rfl +lemma config_continuous (N : ℕ) (L J : Length) : Continuous (config N L J) := (configHomeo N L J).continuous + +lemma circle_project (L J : Length) (x : ℝ) : circle L J (x : AddCircle L.val)=((J.val/L.val*x : ℝ) : AddCircle J.val) := by + simp only [circle,AddCircle.equivAddCircle_apply_mk] + congr 1 + ring +lemma config_project (N : ℕ) (L J : Length) (X : LiftedConfiguration N) : + config N L J (project N L X)=project N J ((J.val/L.val) • X) := by + ext i j + exact circle_project L J _ + +lemma circle_representative (L J : Length) (x : AddCircle L.val) : + (AddCircle.equivIco J.val 0 (circle L J x)).val= + J.val/L.val*(AddCircle.equivIco L.val 0 x).val := by + have hLp := L.property + have hJp := J.property + let y := (AddCircle.equivIco L.val 0 x).val + have hy : y∈Ico 0 L.val := by simpa only [zero_add] using (AddCircle.equivIco L.val 0 x).property + have he : x=(y : AddCircle L.val) := AddCircle.coe_equivIco.symm + conv_lhs => rw [he,circle_project] + have hm : J.val/L.val*y∈Ico 0 (0+J.val) := by + constructor + · exact mul_nonneg (by positivity) hy.1 + · have hh := mul_lt_mul_of_pos_left hy.2 (by positivity : 0.trans (Int.le_ceil _) + have ht' := (abs_le.mp ht).1 + exact_mod_cast (show (z i : ℝ)-(M : ℝ) ≤ w i by linarith) + · intro i + have ht : |(w i : ℝ)-z i| ≤ (M : ℝ) := + (le_div_iff₀ hh).mpr (by simpa only [mul_comm] using hw i) |>.trans (Int.le_ceil _) + have ht' := (abs_le.mp ht).2 + exact_mod_cast (show (w i : ℝ) ≤ z i+(M : ℝ) by linarith) + +lemma infinite_component_has_exit {B : Set Vertex} {z : Vertex} {h : ℝ} + (hh : 0 < h) (hinf : ¬ (liftedBadComponent B z).Finite) : + ∃ w, withinReach starStep B z w ∧ ∃ i, (1:ℝ)/4 ≤ h * |(w i : ℝ)-z i| := by + by_contra hn + push Not at hn + apply hinf + apply (finite_scaled_box (d := (1:ℝ)/4) hh z).subset + intro w hw i + exact (hn w hw.2.2 i).le +end HardSphere.Lattice + +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Thermodynamics/LowCountAbove.lean b/lean/OAI/Analysis/HardSphere/Thermodynamics/LowCountAbove.lean new file mode 100644 index 0000000000000000000000000000000000000000..f2819cc88466bd3524a86dc7de46e686978c7ca9 --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Thermodynamics/LowCountAbove.lean @@ -0,0 +1,187 @@ +import Mathlib +import OAI.Analysis.HardSphere.Orbitals.CenteredCell + +namespace OAI + +section + +section +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators +namespace HardSphere.CellOrbital +theorem scaled_joint_low_counts_above (Amin : ℝ) : ∃ α₀ ell D₀ Q : ℝ, + Amin≤α₀ ∧ 0<α₀ ∧ 0 omega + | succ n => + convert (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n+1) ↦ Torus L) 0).symm.measurableEmbedding.comp + (MeasurableEquiv.prodComm (α:=Configuration n L) (β:=Torus L)).measurableEmbedding using 1 <;> try rfl + funext p i + simp [insertFirst,MeasurableEquiv.piFinSuccAbove,MeasurableEquiv.prodComm]) + (fun X ↦ ‖ψ X‖^2) + rw [hm,Measure.real,BathSlice.volume_torus,ENNReal.toReal_ofReal (by positivity : 0≤L.val^3)] at hbound + unfold occupation + change (L.val^3)⁻¹*(∫Y,‖∫x,f (Y,x)‖^2)≤‖ψ‖^2 + calc + _ ≤ (L.val^3)⁻¹*(L.val^3*‖ψ‖^2) := mul_le_mul_of_nonneg_left hbound (by positivity) + _ = _ := by rw [←mul_assoc,inv_mul_cancel₀ (pow_ne_zero _ L.property.ne'),one_mul] + +end HardSphere +end +end + +section + +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal BigOperators Topology +namespace HardSphere +attribute [local instance] Classical.propDecidable + +theorem eventually_all_ground_occupation : + ∃ε₀ c₀ : ℝ,0<ε₀ ∧ 0 try simp only [mul_zero,zero_add] + funext D + ring + have hf : Tendsto f atTop (𝓝 0) := by + simpa only [f,Function.comp_def,ENNReal.ofReal_zero] using ENNReal.continuous_ofReal.continuousAt.tendsto.comp hreal + have hlim : Tendsto (fun D ↦ ENNReal.ofReal δ+(4*(49^3*(M+1)):ℕ)*(routeDensityBound t*(J*(2*f D)))) + atTop (𝓝 (ENNReal.ofReal δ)) := by + have hh := ENNReal.Tendsto.const_mul hf (a:=2) (Or.inr (by norm_num)) + have hh := ENNReal.Tendsto.const_mul hh (a:=J) (Or.inr hJ) + have hh := ENNReal.Tendsto.const_mul hh (a:=routeDensityBound t) (Or.inr (routeDensityBound_ne_top ht)) + have hh := ENNReal.Tendsto.const_mul hh (a:=(4*(49^3*(M+1)):ℕ)) (Or.inr (by finiteness)) + simpa only [mul_zero,add_zero] using tendsto_const_nhds.add hh + have hδE : ENNReal.ofReal δ<1 := ENNReal.ofReal_lt_one.mpr hδ + filter_upwards [eventually_ge_atTop (1:ℝ),hlim.eventually (gt_mem_nhds hδE)] with D hD hh + intro α hα hαA + refine le_trans ?_ hh.le + gcongr + change J*(2*ENNReal.ofReal _)≤J*(2*f D) + gcongr + dsimp only [f] + apply ENNReal.ofReal_le_ofReal + have hDp : 0 arg 2; arg 2; rw [←Real.rpow_one D] + rw [←Real.rpow_add hDp] + norm_num + rw [he] + nlinarith + · have hh : (1372*(α/D))>0 := by positivity + apply (le_div_iff₀ hh).mpr + have he : 1/(2744*A)*D*(1372*(α/D))=α/(2*A) := by field_simp; ring + rw [he] + exact (div_le_one (by positivity : 0<2*A)).mpr hαA + +theorem physical_uniform_phase_error {A c : ℝ} (hA : 2≤A) (hc : 0 omega + | succ n => + have hn : 0 rfl + +lemma pull_occupation_succ {n : ℕ} {L J : Length} (f : ScalarL2 (n+1) J) : + occupation (Nat.zero_lt_succ n) (pull (n+1) L J f)=occupation (Nat.zero_lt_succ n) f := by + have hLp := L.property + have hJp := J.property + let z := L.val^3/J.val^3 + have hz : 0 omega + | succ n => exact pull_occupation_succ f + +end HardSphere.Rescaling +end +end + +end OAI diff --git a/lean/OAI/Analysis/HardSphere/Thermodynamics/PhysicalRescaleLp.lean b/lean/OAI/Analysis/HardSphere/Thermodynamics/PhysicalRescaleLp.lean new file mode 100644 index 0000000000000000000000000000000000000000..4723c17778cb6065c5ba2c2c75e5e888f8ccbaff --- /dev/null +++ b/lean/OAI/Analysis/HardSphere/Thermodynamics/PhysicalRescaleLp.lean @@ -0,0 +1,86 @@ +import Mathlib +import OAI.Analysis.HardSphere.Geometry.ScalarNormSqIntegral +import OAI.Analysis.HardSphere.Rescaling.PhysicalRescaling + +namespace OAI + +section + +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal BigOperators Topology +namespace HardSphere.Rescaling +attribute [local instance] Classical.propDecidable + +def amplitude (N : ℕ) (L J : Length) : ℝ := Real.sqrt ((jacobian N L J)⁻¹) +lemma amplitude_pos (N : ℕ) (L J : Length) : 0 simp [w_inner _ hx] +omit [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] [μ.IsAddHaarMeasure] in +lemma weight_outer (κ : ℝ) (e : sphere (0:E) 1) {x : E} (hx : 2 ≤ ‖x‖) : + weight μ κ e x = 0 := by + unfold weight + split_ifs <;> simp [w_outer _ hx] + +lemma integral_weight {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (x : E) : + (∫ e, weight μ κ e x ∂μ.toSphere) = w (Module.finrank ℝ E) x := by + by_cases hx : x ≠ 0 ∧ 0 < d x + · simp only [weight,dite_eq_left hx,integral_const_mul] + rw [integral_normalized _ (ne_of_gt (sphere_normalizer_pos μ _ (mul_pos hκ hx.2) + ((mul_le_of_le_one_left (d_nonneg x) hκ1).trans (d_le_one x)))),mul_one] + · have hw : w (Module.finrank ℝ E) x = 0 := by + by_cases hx0 : x = 0 + · subst x; exact w_inner _ (by simp) + · exact w_outer _ (not_lt.mp (fun hh => hx ⟨hx0,(d_pos_iff x).mpr hh⟩)) + simp only [weight,dite_eq_right hx,integral_zero,hw] + +omit [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] in +lemma normalize_dist_le {x y : E} (hx : 1/2 ≤ ‖x‖) (hy : 1/2 ≤ ‖y‖) : + dist (NormedSpace.normalize x) (NormedSpace.normalize y) ≤ 4*dist x y := by + have hx0 : ‖x‖ ≠ 0 := ne_of_gt (by linarith) + have hy0 : y ≠ 0 := norm_ne_zero_iff.mp (ne_of_gt (by linarith : 0 < ‖y‖)) + have he : NormedSpace.normalize x-NormedSpace.normalize y = + ‖x‖⁻¹ • (x-y) + ((‖y‖-‖x‖)/‖x‖) • NormedSpace.normalize y := by + rw [NormedSpace.normalize,NormedSpace.normalize,smul_sub,smul_smul] + have hr : (‖y‖-‖x‖)/‖x‖*‖y‖⁻¹ = ‖x‖⁻¹-‖y‖⁻¹ := by + field_simp [hx0,norm_ne_zero_iff.mpr hy0] + rw [hr,sub_smul] + abel + rw [dist_eq_norm,he] + calc + _ ≤ ‖‖x‖⁻¹ • (x-y)‖+‖((‖y‖-‖x‖)/‖x‖) • NormedSpace.normalize y‖ := norm_add_le _ _ + _ = (dist x y+|‖y‖-‖x‖|)/‖x‖ := by + rw [norm_smul,norm_smul,NormedSpace.norm_normalize hy0,mul_one,Real.norm_eq_abs, + Real.norm_eq_abs,abs_inv,abs_of_nonneg (norm_nonneg x),abs_div, + abs_of_nonneg (norm_nonneg x),← dist_eq_norm] + ring + _ ≤ (dist x y+dist x y)/‖x‖ := by + apply div_le_div_of_nonneg_right _ (norm_nonneg x) + gcongr + simpa only [dist_comm x y,dist_eq_norm] using abs_norm_sub_norm_le y x + _ ≤ (dist x y+dist x y)/(1/2) := div_le_div_of_nonneg_left (by positivity) (by norm_num) hx + _ = _ := by ring + +def boundConstant (κ : ℝ) : ℝ := + (6*(N (Module.finrank ℝ E):ℝ)*3^(N (Module.finrank ℝ E)-1)) / + (lowerConstant μ * κ^(Module.finrank ℝ E-1)) + +omit [BorelSpace E] [Nontrivial E] in +lemma boundConstant_nonneg {κ : ℝ} (hκ : 0 ≤ κ) : 0 ≤ boundConstant μ κ := by + unfold boundConstant + exact div_nonneg (by positivity) (mul_nonneg (constants_positive μ).1.le (pow_nonneg hκ _)) + +lemma weight_bound {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (e : sphere (0:E) 1) (x : E) : + weight μ κ e x ≤ boundConstant μ κ * (d x)^(N (Module.finrank ℝ E)-Module.finrank ℝ E) := by + let n := Module.finrank ℝ E + have hn : 1 ≤ n := Module.finrank_pos + by_cases hx : x ≠ 0 ∧ 0 < d x + · rw [weight,dite_eq_left hx] + have hrad : κ*d x ≤ 1 := (mul_le_of_le_one_left (d_nonneg x) hκ1).trans (d_le_one x) + have hb := (sphere_normalizer_bounds μ (direction x hx.1) (mul_pos hκ hx.2) hrad).1 + have hc : 0 < lowerConstant μ*κ^(n-1) := mul_pos (constants_positive μ).1 (pow_pos hκ _) + have hpow : n-1+(N n-n) = N n-1 := by dsimp [N]; omega + calc + _ ≤ (6*(N n:ℝ)*3^(N n-1)*(d x)^(N n-1)) * + (1/(lowerConstant μ*(κ*d x)^(n-1))) := by + apply mul_le_mul + · rw [w_eq_profile]; exact wProfile_bound n (norm_nonneg x) + · exact (normalized_le_inv μ.toSphere _ (mul_pos hκ hx.2) e).trans + (by simpa only [one_div] using one_div_le_one_div_of_le (mul_pos (constants_positive μ).1 (pow_pos (mul_pos hκ hx.2) _)) hb) + · exact normalized_nonneg _ _ _ _ + · exact mul_nonneg (by positivity) (pow_nonneg (d_nonneg x) _) + _ = _ := by + have hdPow : (d x)^(N n-1) = (d x)^(n-1)*(d x)^(N n-n) := by rw [← hpow,pow_add] + rw [hdPow,mul_pow] + unfold boundConstant + change _ = (6*(N n:ℝ)*3^(N n-1))/(lowerConstant μ*κ^(n-1))*(d x)^(N n-n) + field_simp [ne_of_gt (constants_positive μ).1,ne_of_gt hκ,ne_of_gt hx.2] + · rw [weight,dite_eq_right hx] + exact mul_nonneg (boundConstant_nonneg μ hκ.le) (pow_nonneg (d_nonneg x) _) + +end HenonLaneEmden.AdaptiveCap +end +end AdaptiveCaps + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Angular.lean b/lean/OAI/Analysis/HenonEmden/Angular.lean new file mode 100644 index 0000000000000000000000000000000000000000..b48e949ae5f3be50f00e8a5e85ba64ec39838498 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Angular.lean @@ -0,0 +1,146 @@ +import OAI.Analysis.HenonEmden.ShortComponents + +namespace OAI + +universe uE + +section Angular + +open MeasureTheory MeasureTheory.Measure Set Metric +open scoped ENNReal Pointwise +noncomputable section +namespace HenonLaneEmden.Angular +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] + +/-- Polar lower bound contributed by a set of directions whose full radial +segment has source at least `t`. Surface measure here is not normalized. -/ +lemma ray_mass_le {f : E → ℝ≥0∞} {S : Set (sphere (0:E) 1)} + (hS : MeasurableSet S) {l : ℝ} (hl : 0 < l) (t : ℝ≥0∞) + (h : ∀ e ∈ S, ∀ r ∈ Ioo 0 l, t ≤ f (r • e.1)) : + t * μ.toSphere S * ENNReal.ofReal (l ^ Module.finrank ℝ E / Module.finrank ℝ E) + ≤ ∫⁻ z, f z ∂μ := by + let L : Ioi (0:ℝ) := ⟨l,hl⟩ + let T := S ×ˢ Iio L + have hm : MeasurableSet T := hS.prod measurableSet_Iio + rw [Polar.lintegral_polar_prod μ] + have hb : ∀ z : sphere (0:E) 1 × Ioi (0:ℝ), T.indicator (fun _ => t) z ≤ f (z.2.1 • z.1.1) := by + intro z + by_cases hz : z ∈ T + · rw [indicator_of_mem hz] + exact h z.1 hz.1 z.2.1 ⟨z.2.2,hz.2⟩ + · simp only [indicator_of_notMem hz,zero_le] + have he : ∫⁻ z, T.indicator (fun _ => t) z + ∂μ.toSphere.prod (volumeIoiPow (Module.finrank ℝ E-1)) = + t * μ.toSphere S * ENNReal.ofReal (l ^ Module.finrank ℝ E / Module.finrank ℝ E) := by + rw [lintegral_indicator hm,lintegral_const,Measure.restrict_apply_univ, + Measure.prod_prod,volumeIoiPow_apply_Iio] + have hn : Module.finrank ℝ E-1+1 = Module.finrank ℝ E := + Nat.sub_add_cancel (Module.finrank_pos : 0 < Module.finrank ℝ E) + have hnr : ((Module.finrank ℝ E-1 : ℕ) : ℝ)+1 = Module.finrank ℝ E := by + exact_mod_cast hn + simp only [hn,hnr,L,mul_assoc] + exact he ▸ lintegral_mono hb + +open LineComponents + +/-- The long-component alternative on a line uses either forward or backward +rays. In particular it requires no independence of any cap weight and layer. -/ +lemma long_component_mass_le {f : E → ℝ≥0∞} + {U : Set (sphere (0:E) 1 × ℝ)} (hU : IsOpen U) + {l : ℝ} (hl : 0 < l) (t : ℝ≥0∞) + (h : ∀ e r, |r| ≤ l/2 → (e,r) ∈ U → t ≤ f (r • e.1)) : + t * ENNReal.ofReal ((l/2)^Module.finrank ℝ E / Module.finrank ℝ E) * + μ.toSphere {e | ENNReal.ofReal l < componentLength U e} ≤ + 2 * ∫⁻ z, f z ∂μ := by + let F := {e | ENNReal.ofReal (l/2) < forwardExit U e} + let G := {e | ENNReal.ofReal (l/2) < backwardExit U e} + have hF : MeasurableSet F := measurableSet_lt measurable_const (measurable_forwardExit hU) + have hG : MeasurableSet G := measurableSet_lt measurable_const (measurable_backwardExit hU) + have hs : {e | ENNReal.ofReal l < componentLength U e} ⊆ F ∪ G := by + intro e he + by_contra hn + have hne : ¬ e ∈ F ∧ ¬ e ∈ G := not_or.mp hn + have hh : componentLength U e ≤ ENNReal.ofReal l := by + calc + componentLength U e ≤ ENNReal.ofReal (l/2) + ENNReal.ofReal (l/2) := + add_le_add (le_of_not_gt hne.1) (le_of_not_gt hne.2) + _ = ENNReal.ofReal l := by rw [← ENNReal.ofReal_add (by positivity) (by positivity)]; congr 1; ring + exact (not_lt_of_ge hh) he + have hforward := ray_mass_le μ hF (half_pos hl) t (f := f) (by + intro e he r hr + have hin : SegmentInside U e (l/2) := (lt_forwardExit_iff hU (by positivity)).mp he + exact h e r (by rw [abs_of_pos hr.1]; exact hr.2.le) (hin r (by rw [uIcc_of_le (by positivity)]; exact ⟨hr.1.le,hr.2.le⟩))) + have hbackward := ray_mass_le μ hG (half_pos hl) t (f := fun z => f (-z)) (by + intro e he r hr + have hin : SegmentInside U e (-(l/2)) := (lt_backwardExit_iff hU (by positivity)).mp he + have hm := hin (-r) (by rw [uIcc_of_ge (by linarith)]; constructor <;> linarith [hr.1,hr.2]) + simpa only [neg_smul] using h e (-r) (by rw [abs_neg,abs_of_pos hr.1]; exact hr.2.le) hm) + rw [lintegral_neg_eq_self] at hbackward + have hmeasure : μ.toSphere {e | ENNReal.ofReal l < componentLength U e} ≤ + μ.toSphere F + μ.toSphere G := (measure_mono hs).trans (measure_union_le F G) + calc + _ ≤ t * ENNReal.ofReal ((l/2)^Module.finrank ℝ E / Module.finrank ℝ E) * + (μ.toSphere F + μ.toSphere G) := by gcongr + _ = t * μ.toSphere F * ENNReal.ofReal ((l/2)^Module.finrank ℝ E / Module.finrank ℝ E) + + t * μ.toSphere G * ENNReal.ofReal ((l/2)^Module.finrank ℝ E / Module.finrank ℝ E) := by ring + _ ≤ (∫⁻ z, f z ∂μ) + ∫⁻ z, f z ∂μ := add_le_add hforward hbackward + _ = _ := (two_mul _).symm + +/-- Translation of the ray estimate to a local source; the only quantitative +input is its mass on the fixed ball `B₄`. -/ +lemma long_component_local_mass_le {f : E → ℝ} {x : E} (hx : ‖x‖ ≤ 2) + {t l : ℝ} (hl : 0 < l) (hl1 : l ≤ 1) + (hU : IsOpen {z : sphere (0:E) 1 × ℝ | t < f (x + z.2 • z.1.1)}) : + ENNReal.ofReal t * ENNReal.ofReal ((l/2)^Module.finrank ℝ E / Module.finrank ℝ E) * + μ.toSphere {e | ENNReal.ofReal l < componentLength + {z : sphere (0:E) 1 × ℝ | t < f (x + z.2 • z.1.1)} e} ≤ + 2 * ∫⁻ z in ball (0:E) 4, ENNReal.ofReal (f z) ∂μ := by + let F : E → ℝ≥0∞ := (ball (0:E) 4).indicator (fun z => ENNReal.ofReal (f z)) + have hh := long_component_mass_le μ hU hl (ENNReal.ofReal t) + (f := fun z => F (x+z)) (by + intro e r hr ht + have hn : ‖(e:E)‖ = 1 := by simpa only [mem_sphere,dist_zero_right] using e.2 + have hb : x+r • (e:E) ∈ ball (0:E) 4 := by + rw [mem_ball,dist_zero_right] + have hs := norm_add_le x (r • (e:E)) + rw [norm_smul,Real.norm_eq_abs,hn,mul_one] at hs + linarith + change ENNReal.ofReal t ≤ (ball (0:E) 4).indicator (fun z => ENNReal.ofReal (f z)) (x+r • (e:E)) + rw [indicator_of_mem hb] + exact ENNReal.ofReal_le_ofReal ht.le) + rwa [lintegral_add_left_eq_self,lintegral_indicator measurableSet_ball] at hh + +end HenonLaneEmden.Angular + +namespace HenonLaneEmden +/-- With value zero assigned at the origin, the positive source subgraph is +open jointly in spatial location and positive level. -/ +lemma isOpen_source_subgraph {n : ℕ} {u : Space n → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n))) (hup : ∀ x, 0 < u x) (q B : ℝ) : + IsOpen {z : Space n × ℝ | 0 < z.2 ∧ z.2 < source u q B z.1} := by + rw [isOpen_iff_mem_nhds] + intro z hz + have hx : z.1 ≠ 0 := by + intro he + simpa [he,source_zero] using hz.1.trans hz.2 + have hc : ContinuousAt (source u q B) z.1 := + (regular_source hu hup q B).continuousOn.continuousAt (isClosed_singleton.isOpen_compl.mem_nhds hx) + exact (continuousAt_const.eventually_lt continuousAt_snd hz.1).and + (continuousAt_snd.eventually_lt (hc.comp continuousAt_fst) hz.2) + +lemma isOpen_source_lineLayer {n : ℕ} {u : Space n → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n))) (hup : ∀ x, 0 < u x) (q B : ℝ) + (x : Space n) {t : ℝ} (ht : 0 < t) : + IsOpen {z : sphere (0:Space n) 1 × ℝ | t < source u q B (x + z.2 • z.1.1)} := by + have hh := (isOpen_source_subgraph hu hup q B).preimage + (show Continuous (fun z : sphere (0:Space n) 1 × ℝ => (x+z.2 • z.1.1,t)) from + (continuous_const.add (continuous_snd.smul continuous_fst.subtype_val)).prodMk continuous_const) + simpa only [Set.mem_ofPred_eq,true_and,ht,Set.preimage_ofPred_eq] using hh + +end HenonLaneEmden +end +end Angular + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/AngularBounds.lean b/lean/OAI/Analysis/HenonEmden/AngularBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..0aa7696cc6983759e957bf06cc21b010e9e09baa --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/AngularBounds.lean @@ -0,0 +1,106 @@ +import OAI.Analysis.HenonEmden.LocalizationIntegral + +namespace OAI + +section AngularBounds + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open Cutoff AdaptiveCap SpatialComponents + +lemma d_w_bound {n : ℕ} (x : Space n) : d x*w n x ≤ 6*(N n:ℝ)*eta n x := by + rw [w_eq_profile] + exact gap_wProfile_bound n (norm_nonneg x) + +lemma IsSolution.integrable_radialWeight {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) : + Integrable (fun z : Space n × Space n => w n z.1*radialFactor z) (interaction (source u q B) (source v p A)) := by + have hi := (h.weight_left hn hq (continuous_w n) (compactSupport_w n) (w_nonneg n)).1 + apply hi.mono' (((continuous_w n).measurable.comp measurable_fst).mul (measurable_radialFactor n)).aestronglyMeasurable + exact ae_of_all _ (fun z => by + dsimp only [Function.comp_def,Pi.mul_apply] + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (w_nonneg n _) (radialFactor_bounds z).1)] + exact mul_le_of_le_one_right (w_nonneg n _) (radialFactor_bounds z).2) + +def radialPressure {n : ℕ} (f g : Space n → ℝ) : ℝ := + ((n:ℝ)-2)*(∫ z : Space n × Space n, w n z.1*radialFactor z ∂interaction f g) +lemma radialPressure_nonneg {n : ℕ} (hn : 2 ≤ n) (f g : Space n → ℝ) : 0 ≤ radialPressure f g := by + have hn2 : 0 ≤ (n:ℝ)-2 := by exact_mod_cast (Nat.cast_le.mpr hn : (2:ℝ) ≤ n) |> sub_nonneg.mpr + exact mul_nonneg hn2 (integral_nonneg (fun z => mul_nonneg (w_nonneg n _) (radialFactor_bounds z).1)) + +lemma lintegral_angular_interaction_weight {n : ℕ} (hn : 1 ≤ n) {κ : ℝ} + (hκ : 0 < κ) (hκ1 : κ ≤ 1) {f g : Space n → ℝ} (_hf : Measurable f) (_hg : Measurable g) + {G : Space n × Space n → ℝ} (hG : Measurable G) (_hG0 : ∀ z, 0 ≤ G z) : + (∫⁻ e : sphere (0:Space n) 1, ∫⁻ z, ENNReal.ofReal (weight volume κ e z.1*G z) + ∂interaction f g ∂volume.toSphere) = + ∫⁻ z, ENNReal.ofReal (w n z.1*G z) ∂interaction f g := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hm : Measurable (fun z : sphere (0:Space n) 1 × (Space n × Space n) => + ENNReal.ofReal (weight volume κ z.1 z.2.1*G z.2)) := + (((measurable_weight volume hκ hκ1).comp (measurable_fst.prodMk measurable_snd.fst)).mul (hG.comp measurable_snd)).ennreal_ofReal + rw [lintegral_lintegral_swap hm.aemeasurable] + apply lintegral_congr + intro z + simp_rw [ENNReal.ofReal_mul (weight_nonneg volume κ _ _)] + rw [lintegral_mul_const _ (continuous_weight_direction volume κ z.1).measurable.ennreal_ofReal, + lintegral_cap_weight hn hκ hκ1,← ENNReal.ofReal_mul (w_nonneg n _)] + +lemma IsSolution.angular_pressure_bound {n : ℕ} (hn : 2 ≤ n) {p q A B κ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (_hp : 0 < p) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) : + (∫⁻ e : sphere (0:Space n) 1, capPressureIntegral (source u q B) (source v p A) κ e ∂volume.toSphere) ≤ + ENNReal.ofReal (radialPressure (source u q B) (source v p A)+ + (12*(N n:ℝ)*((n:ℝ)-2)*κ)*weightedEnergy (eta n) u q B) := by + have hn2 : 0 ≤ (n:ℝ)-2 := by + have hh : (2:ℝ) ≤ n := by exact_mod_cast hn + linarith + have hm : Measurable (fun z : Space n × Space n => ((n:ℝ)-2)*(radialFactor z+2*κ*d z.1)) := by + have hd := (continuous_d (E := Space n)).measurable + fun_prop + have hg0 (z : Space n × Space n) : 0 ≤ ((n:ℝ)-2)*(radialFactor z+2*κ*d z.1) := + mul_nonneg hn2 (add_nonneg (radialFactor_bounds z).1 (by positivity [d_nonneg z.1])) + have hb := lintegral_mono (μ := (volume : Measure (Space n)).toSphere) (fun e : sphere (0:Space n) 1 => + lintegral_mono (μ := interaction (source u q B) (source v p A)) (fun z => ENNReal.ofReal_le_ofReal + (show ((n:ℝ)-2)*weight volume κ e z.1*directionalFactor e z ≤ weight volume κ e z.1*(((n:ℝ)-2)*(radialFactor z+2*κ*d z.1)) by + nlinarith [mul_le_mul_of_nonneg_left (weight_directional_bound (by omega : 1 ≤ n) hκ e z.1 z.2) hn2]))) + change (∫⁻ e : sphere (0:Space n) 1, capPressureIntegral (source u q B) (source v p A) κ e ∂volume.toSphere) ≤ _ at hb + rw [lintegral_angular_interaction_weight (by omega) hκ hκ1 (measurable_source h.continuous_u q B) + (measurable_source h.continuous_v p A) hm hg0] at hb + apply hb.trans + have he (z : Space n × Space n) : w n z.1*(((n:ℝ)-2)*(radialFactor z+2*κ*d z.1)) ≤ + ((n:ℝ)-2)*(w n z.1*radialFactor z)+(12*(N n:ℝ)*((n:ℝ)-2)*κ)*eta n z.1 := by + have hh := mul_le_mul_of_nonneg_left (d_w_bound z.1) (show 0 ≤ 2*((n:ℝ)-2)*κ by positivity) + nlinarith [hh] + apply (lintegral_mono (fun z => ENNReal.ofReal_le_ofReal (he z))).trans_eq + have hj := (h.integrable_radialWeight hn hq).const_mul ((n:ℝ)-2) + have hη := h.weight_left hn hq (continuous_eta n) (compactSupport_eta n) (eta_nonneg n) + have hi : Integrable (fun z : Space n × Space n => ((n:ℝ)-2)*(w n z.1*radialFactor z)+(12*(N n:ℝ)*((n:ℝ)-2)*κ)*eta n z.1) _ := + hj.add (hη.1.const_mul _) + rw [← ofReal_integral_eq_lintegral_ofReal hi (ae_of_all _ (fun z => add_nonneg + (mul_nonneg hn2 (mul_nonneg (w_nonneg n _) (radialFactor_bounds z).1)) + (mul_nonneg (by positivity) (eta_nonneg n _)))),integral_add hj (hη.1.const_mul _), + integral_const_mul,integral_const_mul,hη.2] + rfl + +lemma weightedEnergyN_d_w_le {n : ℕ} {u : Space n → ℝ} (hu : Continuous u) + (hu0 : ∀ x, 0 ≤ u x) (q B : ℝ) : + weightedEnergyN (fun x => d x*w n x) u q B ≤ ENNReal.ofReal (6*(N n:ℝ))*weightedEnergyN (eta n) u q B := by + unfold weightedEnergyN + have hm : Measurable (fun x => ENNReal.ofReal (eta n x*source u q B x*u x)) := + (((continuous_eta n).measurable.mul (measurable_source hu q B)).mul hu.measurable).ennreal_ofReal + rw [← lintegral_const_mul _ hm] + apply lintegral_mono + intro x + dsimp only + rw [← ENNReal.ofReal_mul (by positivity : 0 ≤ 6*(N n:ℝ))] + apply ENNReal.ofReal_le_ofReal + have hh := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (d_w_bound x) (source_nonneg hu0 q B x)) (hu0 x) + nlinarith [hh] + +end HenonLaneEmden +end +end AngularBounds + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/AngularIntegration.lean b/lean/OAI/Analysis/HenonEmden/AngularIntegration.lean new file mode 100644 index 0000000000000000000000000000000000000000..b6e0c733b091893048db7c3f5cdc9949d23379b5 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/AngularIntegration.lean @@ -0,0 +1,67 @@ +import OAI.Analysis.HenonEmden.IntegratedRecovery + +namespace OAI + +universe uE uΩ + +section AngularIntegration + +open MeasureTheory Set Metric +noncomputable section +namespace HenonLaneEmden.Angular +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] +open LineComponents + +def rayConstant (n : ℕ) : ℝ := 2^(n+1)*(n:ℝ) + +lemma long_component_measure_le {f : E → ℝ} {x : E} (hx : ‖x‖ ≤ 2) + {t l M : ℝ} (ht : 0 < t) (hl : 0 < l) (hl1 : l ≤ 1) (hM : 0 ≤ M) + (hU : IsOpen {z : sphere (0:E) 1 × ℝ | t < f (x+z.2 • z.1.1)}) + (hm : (∫⁻ z in ball (0:E) 4, ENNReal.ofReal (f z) ∂μ) ≤ ENNReal.ofReal M) : + μ.toSphere.real {e | ENNReal.ofReal l < componentLength + {z : sphere (0:E) 1 × ℝ | t < f (x+z.2 • z.1.1)} e} ≤ + rayConstant (Module.finrank ℝ E)*M/(t*l^(Module.finrank ℝ E)) := by + let n := Module.finrank ℝ E + have hn : 0 < (n:ℝ) := Nat.cast_pos.mpr Module.finrank_pos + have hh := (long_component_local_mass_le μ hx hl hl1 hU).trans + (mul_le_mul_right hm 2) + have hh' := ENNReal.toReal_mono (by finiteness) hh + have hf : 0 ≤ (l/2)^(Module.finrank ℝ E)/(Module.finrank ℝ E:ℝ) := by positivity + simp only [ENNReal.toReal_mul,ENNReal.toReal_ofReal ht.le,ENNReal.toReal_ofReal hf, + ENNReal.toReal_ofNat,ENNReal.toReal_ofReal hM] at hh' + rw [le_div_iff₀ (mul_pos ht (pow_pos hl _))] + unfold rayConstant + have he : t*((l/2)^n/(n:ℝ)) = (t*l^n)/(2^n*(n:ℝ)) := by + rw [div_pow]; field_simp + rw [he] at hh' + have hd : 0 < (2^n:ℝ)*(n:ℝ) := mul_pos (by positivity) hn + have hh'' := (div_le_iff₀ hd).mp (show μ.toSphere.real _*(t*l^n)/(2^n*(n:ℝ)) ≤ 2*M by + convert hh' using 1; unfold Measure.real at *; ring) + convert hh'' using 1; dsimp [n]; rw [pow_succ]; ring + +end HenonLaneEmden.Angular + +namespace HenonLaneEmden +lemma integral_le_constant_add_event {Ω : Type uΩ} [MeasurableSpace Ω] (ν : Measure Ω) + [IsFiniteMeasure ν] {S : Set Ω} (hS : MeasurableSet S) {F : Ω → ℝ} + (hF : Measurable F) {a H : ℝ} (ha : 0 ≤ a) (_hH : 0 ≤ H) + (hFn : ∀ z, 0 ≤ F z) (hFH : ∀ z, F z ≤ H) (hout : ∀ z ∉ S, F z ≤ a) : + (∫ z, F z ∂ν) ≤ a*ν.real univ+H*ν.real S := by + have hFi : Integrable F ν := (integrable_const H).mono' hF.aestronglyMeasurable + (ae_of_all _ (fun z => by rw [Real.norm_eq_abs,abs_of_nonneg (hFn z)]; exact hFH z)) + have hIi : Integrable (S.indicator (fun _ => H)) ν := (integrable_const H).indicator hS + have hh := integral_mono hFi ((integrable_const a).add hIi) (fun z => ?_) + · simpa [integral_add (integrable_const a) hIi,integral_indicator hS,integral_const, + smul_eq_mul,mul_comm] using hh + · change F z ≤ a + S.indicator (fun _ => H) z + by_cases hz : z ∈ S + · rw [indicator_of_mem hz]; linarith [hFH z] + · rw [indicator_of_notMem hz]; simpa only [add_zero] using hout z hz + +end HenonLaneEmden +end +end AngularIntegration + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/AngularLoss.lean b/lean/OAI/Analysis/HenonEmden/AngularLoss.lean new file mode 100644 index 0000000000000000000000000000000000000000..0db24da18de8e5207f2783888ad5164cc4d3f1c4 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/AngularLoss.lean @@ -0,0 +1,80 @@ +import OAI.Analysis.HenonEmden.AngularMeasurability + +namespace OAI + +section AngularLoss + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open Cutoff AdaptiveCap SpatialComponents LayerTonelli + +def sourceBallConstant (n : ℕ) (p q A B : ℝ) : ℝ := + max (sourceConstant n p q A B*4^((n:ℝ)-2-alpha p q A B)) 0+ + max (sourceConstant n q p B A*4^((n:ℝ)-2-alpha q p B A)) 0 +lemma sourceBallConstant_nonneg (n : ℕ) (p q A B : ℝ) : 0 ≤ sourceBallConstant n p q A B := + add_nonneg (le_max_right _ _) (le_max_right _ _) +lemma sourceBallConstant_swap (n : ℕ) (p q A B : ℝ) : + sourceBallConstant n q p B A=sourceBallConstant n p q A B := by unfold sourceBallConstant; ring + +lemma IsSolution.source_g_ball_bound {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + (∫⁻ x in ball (0:Space n) 4, ENNReal.ofReal (source v p A x)) ≤ + ENNReal.ofReal (sourceBallConstant n p q A B) := by + have hs := h.sourceMeasure_ball hn 4 + rw [sourceMeasure,withDensity_apply _ measurableSet_ball] at hs + rw [hs] + apply ENNReal.ofReal_le_ofReal + apply (h.sourceMass_g_upper hn hp hq (by norm_num : (0:ℝ)<4)).trans + exact (le_max_left _ _).trans (le_add_of_nonneg_right (le_max_right _ _)) + +lemma IsSolution.u_mass_two_bound {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + (∫⁻ x in ball (0:Space n) 2, ENNReal.ofReal (u x)) ≤ + ENNReal.ofReal (max (uniformMassConstant n p q A B) 0) := by + have hi : IntegrableOn u (ball (0:Space n) 4) := + (h.continuous_u.continuousOn.integrableOn_compact (isCompact_closedBall _ 4)).mono_set ball_subset_closedBall + apply (lintegral_mono_set (ball_subset_ball (by norm_num : (2:ℝ) ≤ 4))).trans + rw [← ofReal_integral_eq_lintegral_ofReal hi (ae_of_all _ (fun x => (h.positive_u x).le))] + exact ENNReal.ofReal_le_ofReal ((h.uniform_u_mass hn hp hq).trans (le_max_left _ _)) + +lemma IsSolution.angular_loss_bound {n : ℕ} (hn : 2 ≤ n) {p q A B κ δ P : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 < δ) (hδ1 : δ ≤ 1/2) (hP : 0 < P) : + (∫⁻ e : sphere (0:Space n) 1, lossIntegral u (source u q B) κ δ e ∂volume.toSphere) ≤ + ENNReal.ofReal (lossCoefficient (volume : Measure (Space n)) κ δ (sourceBallConstant n p q A B) P* + weightedEnergy (eta n) u q B+ + lowLevelConstant n*P*max (uniformMassConstant n p q A B) 0) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hf := measurable_source h.continuous_u q B + have hu := h.continuous_u.measurable + have hu0 := fun x => (h.positive_u x).le + have hfo := isOpen_source_subgraph h.regular_u h.positive_u q B + rw [lintegral_angular_loss (by omega) hκ hκ1 hf hu hu0 hfo] + have hm := h.swap.source_g_ball_bound hn hq hp + rw [sourceBallConstant_swap] at hm + have hh := lintegral_averagedLoss_bound volume hf hu hfo (source_nonneg hu0 q B) hu0 + hκ hκ1 hδ hδ1 (sourceBallConstant_nonneg n p q A B) hP hm + simp only [finrank_euclideanSpace_fin] at hh + apply hh.trans + have hc := lossCoefficient_nonneg (volume : Measure (Space n)) hκ.le hδ.le + (sourceBallConstant_nonneg n p q A B) hP.le + have hE := weightedEnergyN_nonneg (eta_nonneg n) hu0 (q:=q) (B:=B) + have hl : 0 ≤ lowLevelConstant n*P := mul_nonneg (lowLevelConstant_nonneg n) hP.le + have heq := h.weightedEnergyN_eq hn (continuous_eta n) (compactSupport_eta n) (eta_nonneg n) + change weightedEnergyN (eta n) u q B=ENNReal.ofReal (weightedEnergy (eta n) u q B) at heq + change ENNReal.ofReal _ * weightedEnergyN (eta n) u q B + _ ≤ _ + rw [heq] + calc + _ ≤ ENNReal.ofReal _*ENNReal.ofReal (weightedEnergy (eta n) u q B)+ + ENNReal.ofReal (lowLevelConstant n*P)*ENNReal.ofReal (max (uniformMassConstant n p q A B) 0) := + add_le_add le_rfl (mul_le_mul le_rfl (h.u_mass_two_bound hn hp hq) bot_le bot_le) + _ = _ := by rw [← ENNReal.ofReal_mul hc,← ENNReal.ofReal_mul hl, + ← ENNReal.ofReal_add (mul_nonneg hc hE) (mul_nonneg hl (le_max_right _ _))] + +end HenonLaneEmden +end +end AngularLoss + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/AngularMeasurability.lean b/lean/OAI/Analysis/HenonEmden/AngularMeasurability.lean new file mode 100644 index 0000000000000000000000000000000000000000..021a9bfea7d71742a4f92ece24808a6a6d338301 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/AngularMeasurability.lean @@ -0,0 +1,105 @@ +import OAI.Analysis.HenonEmden.AngularBounds + +namespace OAI + +section AngularMeasurability + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open Cutoff AdaptiveCap SpatialComponents LayerTonelli + +lemma measurable_cap_energy {n : ℕ} (hn : 1 ≤ n) {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) + {u : Space n → ℝ} (hu : Continuous u) (q B : ℝ) : + Measurable (fun e : sphere (0:Space n) 1 => weightedEnergyN (weight volume κ e) u q B) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hm : Measurable (fun z : sphere (0:Space n) 1 × Space n => + ENNReal.ofReal (weight volume κ z.1 z.2*source u q B z.2*u z.2)) := + (((measurable_weight volume hκ hκ1).mul ((measurable_source hu q B).comp measurable_snd)).mul + (hu.measurable.comp measurable_snd)).ennreal_ofReal + exact hm.lintegral_prod_right + +lemma measurable_cap_d_energy {n : ℕ} (hn : 1 ≤ n) {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) + {u : Space n → ℝ} (hu : Continuous u) (q B : ℝ) : + Measurable (fun e : sphere (0:Space n) 1 => weightedEnergyN (fun x => d x*weight volume κ e x) u q B) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hm : Measurable (fun z : sphere (0:Space n) 1 × Space n => + ENNReal.ofReal ((d z.2*weight volume κ z.1 z.2)*source u q B z.2*u z.2)) := + (((((continuous_d (E := Space n)).measurable.comp measurable_snd).mul (measurable_weight volume hκ hκ1)).mul + ((measurable_source hu q B).comp measurable_snd)).mul (hu.measurable.comp measurable_snd)).ennreal_ofReal + exact hm.lintegral_prod_right + +lemma measurable_cap_pressure {n : ℕ} (hn : 1 ≤ n) {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (f g : Space n → ℝ) : + Measurable (capPressureIntegral f g κ) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hm : Measurable (fun z : sphere (0:Space n) 1 × (Space n × Space n) => + ENNReal.ofReal (((n:ℝ)-2)*weight volume κ z.1 z.2.1*directionalFactor z.1 z.2)) := by + have hw : Measurable (fun z : sphere (0:Space n) 1 × (Space n × Space n) => weight volume κ z.1 z.2.1) := + (measurable_weight (volume : Measure (Space n)) hκ hκ1).comp (measurable_fst.prodMk measurable_snd.fst) + unfold directionalFactor + fun_prop + exact hm.lintegral_prod_right + +lemma measurable_cap_mismatch {n : ℕ} (hn : 1 ≤ n) {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (f g : Space n → ℝ) : + Measurable (capMismatchIntegral f g κ) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hw := measurable_weight (volume : Measure (Space n)) hκ hκ1 + have hm : Measurable (fun z : sphere (0:Space n) 1 × (Space n × Space n) => + ENNReal.ofReal (|weight volume κ z.1 z.2.1-weight volume κ z.1 z.2.2|)) := + ((hw.comp (measurable_fst.prodMk measurable_snd.fst)).sub + (hw.comp (measurable_fst.prodMk measurable_snd.snd))).abs.ennreal_ofReal + exact hm.lintegral_prod_right + +lemma measurable_cap_loss {n : ℕ} (hn : 1 ≤ n) {κ δ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) {f u : Space n → ℝ} + (hu : Measurable u) (hfo : IsOpen {z : Space n × ℝ | 0 < z.2 ∧ z.2 < f z.1}) : + Measurable (lossIntegral u f κ δ) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hm : Measurable (fun z : sphere (0:Space n) 1 × (Space n × ℝ) => + ENNReal.ofReal ((weight volume κ z.1 z.2.1-lineWeight volume f κ δ z)*u z.2.1)) := + ((((measurable_weight volume hκ hκ1).comp (measurable_fst.prodMk measurable_snd.fst)).sub + (measurable_lineWeight volume hfo hκ hκ1 δ)).mul (hu.comp measurable_snd.fst)).ennreal_ofReal + exact hm.lintegral_prod_right + +lemma lintegral_angular_d_energy {n : ℕ} (hn : 1 ≤ n) {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) + {u : Space n → ℝ} (hu : Continuous u) (q B : ℝ) : + (∫⁻ e : sphere (0:Space n) 1, weightedEnergyN (fun x => d x*weight volume κ e x) u q B ∂volume.toSphere) = + weightedEnergyN (fun x => d x*w n x) u q B := by + unfold weightedEnergyN + have h1 (e : sphere (0:Space n) 1) (x : Space n) : + (d x*weight volume κ e x)*source u q B x*u x=weight volume κ e x*(d x*source u q B x*u x) := by ring + have h2 (x : Space n) : (d x*w n x)*source u q B x*u x=w n x*(d x*source u q B x*u x) := by ring + simp_rw [h1,h2,ENNReal.ofReal_mul (weight_nonneg volume κ _ _),ENNReal.ofReal_mul (w_nonneg n _)] + exact lintegral_angular_weight hn hκ hκ1 + (((continuous_d (E := Space n)).measurable.mul (measurable_source hu q B)).mul hu.measurable) + +def sphereMass (n : ℕ) : ℝ := (volume : Measure (Space n)).toSphere.real univ +lemma sphereMass_nonneg (n : ℕ) : 0 ≤ sphereMass n := ENNReal.toReal_nonneg + +lemma angular_constant_bound {n : ℕ} (hn : 1 ≤ n) {F : sphere (0:Space n) 1 → ℝ≥0∞} {C : ℝ} + (_hC : 0 ≤ C) (hF : ∀ e, F e ≤ ENNReal.ofReal C) : + (∫⁻ e, F e ∂volume.toSphere) ≤ ENNReal.ofReal (sphereMass n*C) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + apply (lintegral_mono hF).trans_eq + rw [lintegral_const,ENNReal.ofReal_mul (sphereMass_nonneg n)] + exact (mul_comm _ _).trans (congrArg (fun a => a*ENNReal.ofReal C) (ENNReal.ofReal_toReal (measure_ne_top _ _) |>.symm)) + +lemma IsSolution.angular_mismatch_bound {n : ℕ} (hn : 2 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 < δ) (hδ1 : δ ≤ 1/4) : + (∫⁻ e : sphere (0:Space n) 1, capMismatchIntegral (source u q B) (source v p A) κ e ∂volume.toSphere) ≤ ENNReal.ofReal + (sphereMass n*(oscillationConstant (volume : Measure (Space n)) κ*δ*(weightedEnergy (eta n) u q B+weightedEnergy (eta n) v p A)+ + boundConstant (volume : Measure (Space n)) κ*(farConstant n p q A B δ+farConstant n q p B A δ))) := by + have hC := oscillationConstant_nonneg (volume : Measure (Space n)) hκ.le + have hB := boundConstant_nonneg (volume : Measure (Space n)) hκ.le + have hfE := weightedEnergyN_nonneg (eta_nonneg n) (fun x => (h.positive_u x).le) (q:=q) (B:=B) + have hgE := weightedEnergyN_nonneg (eta_nonneg n) (fun x => (h.positive_v x).le) (q:=p) (B:=A) + apply angular_constant_bound (by omega) (add_nonneg (mul_nonneg (mul_nonneg hC hδ.le) (add_nonneg hfE hgE)) + (mul_nonneg hB (add_nonneg (farConstant_nonneg _ _ _ _ hδ.le) (farConstant_nonneg _ _ _ _ hδ.le)))) + exact h.capMismatch_bound hn hp hq hκ hκ1 hδ hδ1 + +end HenonLaneEmden +end +end AngularMeasurability + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/AngularPressure.lean b/lean/OAI/Analysis/HenonEmden/AngularPressure.lean new file mode 100644 index 0000000000000000000000000000000000000000..86407c1cf225739325dcd146dcf4f8b0dc23af5a --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/AngularPressure.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.HenonEmden.DirectionalPressure + +namespace OAI + +section AngularPressure + +open MeasureTheory Set Metric +open scoped ENNReal InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open Cutoff AdaptiveCap LayerTonelli + +lemma integrable_cap_weight {n : ℕ} (hn : 1 ≤ n) {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (x : Space n) : + Integrable (fun e : sphere (0:Space n) 1 => weight volume κ e x) volume.toSphere := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + exact (integrable_const (boundConstant volume κ)).mono' (continuous_weight_direction volume κ x).aestronglyMeasurable + (ae_of_all _ (fun e => by rw [Real.norm_eq_abs,abs_of_nonneg (weight_nonneg volume _ _ _)]; exact weight_le_constant volume hκ hκ1 e x)) + +lemma lintegral_cap_weight {n : ℕ} (hn : 1 ≤ n) {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (x : Space n) : + (∫⁻ e : sphere (0:Space n) 1, ENNReal.ofReal (weight volume κ e x) ∂volume.toSphere) = + ENNReal.ofReal (w n x) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + rw [← ofReal_integral_eq_lintegral_ofReal (integrable_cap_weight hn hκ hκ1 x) + (ae_of_all _ (fun e => weight_nonneg volume κ e x)),integral_weight volume hκ hκ1] + simp only [finrank_euclideanSpace_fin] + +lemma lintegral_angular_weight {n : ℕ} (hn : 1 ≤ n) {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) + {F : Space n → ℝ} (hF : Measurable F) : + (∫⁻ e : sphere (0:Space n) 1, ∫⁻ x, ENNReal.ofReal (weight volume κ e x)*ENNReal.ofReal (F x) ∂volume + ∂volume.toSphere) = ∫⁻ x, ENNReal.ofReal (w n x)*ENNReal.ofReal (F x) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hM := (measurable_weight volume hκ hκ1).ennreal_ofReal.mul (hF.comp measurable_snd).ennreal_ofReal + rw [lintegral_lintegral_swap hM.aemeasurable] + apply lintegral_congr + intro x + rw [lintegral_mul_const _ (continuous_weight_direction volume κ x).measurable.ennreal_ofReal, + lintegral_cap_weight hn hκ hκ1] + +lemma lintegral_angular_energy {n : ℕ} (hn : 1 ≤ n) {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) + {u : Space n → ℝ} (hu : Continuous u) (q B : ℝ) : + (∫⁻ e : sphere (0:Space n) 1, weightedEnergyN (weight volume κ e) u q B ∂volume.toSphere) = + weightedEnergyN (w n) u q B := by + unfold weightedEnergyN + simp_rw [mul_assoc,ENNReal.ofReal_mul (weight_nonneg volume κ _ _)] + simp_rw [ENNReal.ofReal_mul (w_nonneg n _)] + exact lintegral_angular_weight hn hκ hκ1 ((measurable_source hu q B).mul hu.measurable) + +namespace SpatialComponents +lemma lintegral_angular_loss {n : ℕ} (hn : 1 ≤ n) {κ δ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) + {f u : Space n → ℝ} (_hf : Measurable f) (hu : Measurable u) (hun : ∀ x, 0 ≤ u x) + (hfo : IsOpen {z : Space n × ℝ | 0 < z.2 ∧ z.2 < f z.1}) : + (∫⁻ e : sphere (0:Space n) 1, lossIntegral u f κ δ e ∂volume.toSphere) = + ∫⁻ z, ENNReal.ofReal (u z.1*averagedLoss volume f κ δ z) ∂layerMeasure volume f := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hM : Measurable (fun z : sphere (0:Space n) 1 × (Space n × ℝ) => + ENNReal.ofReal ((weight volume κ z.1 z.2.1-lineWeight volume f κ δ z)*u z.2.1)) := by + exact ((((measurable_weight volume hκ hκ1).comp (measurable_fst.prodMk measurable_snd.fst)).sub + (measurable_lineWeight volume hfo hκ hκ1 δ)).mul (hu.comp measurable_snd.fst)).ennreal_ofReal + unfold lossIntegral + rw [lintegral_lintegral_swap hM.aemeasurable] + apply lintegral_congr + intro z + have hi := (integrable_loss volume hfo hκ hκ1 δ z.1 z.2).mul_const (u z.1) + rw [← ofReal_integral_eq_lintegral_ofReal hi + (ae_of_all _ (fun e => mul_nonneg (sub_nonneg.mpr (lineWeight_le volume f κ δ (e,z))) (hun z.1))), + integral_mul_const] + congr 1 + exact mul_comm _ _ +end SpatialComponents +end HenonLaneEmden +end +end AngularPressure + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/CapContinuity.lean b/lean/OAI/Analysis/HenonEmden/CapContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..80b5f7d7f4ee23d8e11b1592d9010dc86b00e546 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/CapContinuity.lean @@ -0,0 +1,97 @@ +import OAI.Analysis.HenonEmden.CapOscillation + +namespace OAI + +universe uE + +section CapContinuity + +open MeasureTheory Set Metric Filter Topology +noncomputable section +namespace HenonLaneEmden.AdaptiveCap +open Cutoff CapWeights +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] + +lemma weight_short_oscillation {κ δ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) + (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1/2) {x y : E} (hd : 0 < d x) + (hxy : dist x y ≤ δ*(d x)^(m (Module.finrank ℝ E))) (e : sphere (0:E) 1) : + |weight μ κ e x-weight μ κ e y| ≤ + oscillationConstant μ κ*δ*(d x)^(N (Module.finrank ℝ E)) := by + let n := Module.finrank ℝ E + have hn : 1 ≤ n := Module.finrank_pos + have hdist : dist x y ≤ d x/2 := by + have hp := pow_d_le_self x (show 1 ≤ m n by unfold m; omega) + calc + _ ≤ δ*(d x)^(m n) := hxy + _ ≤ δ*d x := mul_le_mul_of_nonneg_left hp hδ + _ ≤ _ := by nlinarith + have hh := weight_close_oscillation μ hκ hκ1 hd hdist e + have hc := oscillationConstant_nonneg μ hκ.le + calc + _ ≤ oscillationConstant μ κ*(d x)^(N n-n-1)*dist x y := hh + _ ≤ oscillationConstant μ κ*(d x)^(N n-n-1)*(δ*(d x)^(m n)) := + mul_le_mul_of_nonneg_left hxy (mul_nonneg hc (pow_nonneg hd.le _)) + _ = oscillationConstant μ κ*δ*(d x)^((N n-n-1)+m n) := by rw [pow_add]; ring + _ ≤ _ := by + apply mul_le_mul_of_nonneg_left _ (mul_nonneg hc hδ) + exact pow_le_pow_of_le_one hd.le (d_le_one x) (by change (k n) + n + 2 ≤ (k n + n + 2 - n - 1) + (n+3); omega) + +lemma continuous_weight {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (e : sphere (0:E) 1) : + Continuous (weight μ κ e) := by + rw [continuous_iff_continuousAt] + intro x + by_cases hd : 0 < d x + · rw [Metric.continuousAt_iff] + intro ε hε + let C := oscillationConstant μ κ*(d x)^(N (Module.finrank ℝ E)-Module.finrank ℝ E-1) + have hC : 0 ≤ C := mul_nonneg (oscillationConstant_nonneg μ hκ.le) (pow_nonneg hd.le _) + have hC1 : 0 < C+1 := by linarith + refine ⟨min (d x/2) (ε/(C+1)),lt_min (half_pos hd) (div_pos hε hC1),?_⟩ + intro y hy + have hdist : dist x y < ε/(C+1) := by simpa only [dist_comm x y] using (lt_min_iff.mp hy).2 + have hh := weight_close_oscillation μ hκ hκ1 hd (y := y) + (by simpa only [dist_comm] using (lt_min_iff.mp hy).1.le) e + change |weight μ κ e x-weight μ κ e y| ≤ C*dist x y at hh + rw [Real.dist_eq,abs_sub_comm] + have hb : (C+1)*dist x y < ε := by simpa only [mul_comm] using (lt_div_iff₀ hC1).mp hdist + have hr := dist_nonneg (x := x) (y := y) + nlinarith + · have hd0 : d x = 0 := le_antisymm (not_lt.mp hd) (d_nonneg x) + have hx : 2 ≤ ‖x‖ := not_lt.mp (fun hh => hd ((d_pos_iff x).mpr hh)) + have hN : N (Module.finrank ℝ E)-Module.finrank ℝ E ≠ 0 := by unfold N; omega + have hcont : Continuous (fun y : E => boundConstant μ κ*(d y)^(N (Module.finrank ℝ E)-Module.finrank ℝ E)) := + continuous_const.mul (continuous_d.pow _) + have ht : Tendsto (fun y : E => boundConstant μ κ*(d y)^(N (Module.finrank ℝ E)-Module.finrank ℝ E)) + (𝓝 x) (𝓝 0) := by simpa only [hd0,zero_pow hN,mul_zero] using hcont.tendsto x + change Tendsto _ (𝓝 x) (𝓝 (weight μ κ e x)) + rw [weight_outer μ κ e hx] + exact squeeze_zero (weight_nonneg μ κ e) (weight_bound μ hκ hκ1 e) ht + +omit [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] [μ.IsAddHaarMeasure] in +lemma continuous_weight_direction (κ : ℝ) (x : E) : + Continuous (fun e : sphere (0:E) 1 => weight μ κ e x) := by + by_cases hx : x ≠ 0 ∧ 0 < d x + · simp only [weight,dite_eq_left hx,normalized] + exact continuous_const.mul ((continuous_profile _ _).div_const _) + · simp only [weight,dite_eq_right hx]; exact continuous_const + +lemma measurable_weight {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) : + Measurable (fun z : sphere (0:E) 1 × E => weight μ κ z.1 z.2) := by + have hh : Measurable (fun z : E × sphere (0:E) 1 => weight μ κ z.2 z.1) := + measurable_uncurry_of_continuous_of_measurable (continuous_weight μ hκ hκ1) + (fun x => (continuous_weight_direction μ κ x).measurable) + exact hh.comp measurable_swap + +lemma weight_le_constant {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (e : sphere (0:E) 1) (x : E) : + weight μ κ e x ≤ boundConstant μ κ := by + apply (weight_bound μ hκ hκ1 e x).trans + have hp := pow_le_one₀ (d_nonneg x) (d_le_one x) (n := N (Module.finrank ℝ E)-Module.finrank ℝ E) + simpa only [mul_one] using mul_le_mul_of_nonneg_left hp (boundConstant_nonneg μ hκ.le) + +end HenonLaneEmden.AdaptiveCap +end +end CapContinuity + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/CapGeometry.lean b/lean/OAI/Analysis/HenonEmden/CapGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..eba440330daa99b7179c5ce2d0e0588783c4de44 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/CapGeometry.lean @@ -0,0 +1,230 @@ +import OAI.Analysis.HenonEmden.PotentialContinuity + +namespace OAI + +universe uE + +section CapGeometry + +open MeasureTheory MeasureTheory.Measure Set Metric +open scoped ENNReal Pointwise +noncomputable section +namespace HenonLaneEmden.CapGeometry + +/-- Radial bands in the positive-radius factor of polar coordinates. -/ +def band (a b : ℝ) : Set (Ioi (0:ℝ)) := {r | a < r.1 ∧ r.1 < b} + +lemma volumeIoiPow_band_bounds (k : ℕ) {a b : ℝ} (ha : 0 ≤ a) (hab : a ≤ b) : + ENNReal.ofReal (a^k*(b-a)) ≤ volumeIoiPow k (band a b) ∧ + volumeIoiPow k (band a b) ≤ ENNReal.ofReal (b^k*(b-a)) := by + have hband : MeasurableSet (band a b) := (measurable_subtype_coe measurableSet_Ioo) + have he : Subtype.val '' band a b = Ioo a b := by + ext x + constructor + · rintro ⟨r,hr,rfl⟩; exact hr + · intro hx; exact ⟨⟨x,ha.trans_lt hx.1⟩,hx,rfl⟩ + rw [volumeIoiPow,withDensity_apply _ hband, + setLIntegral_subtype measurableSet_Ioi _ (fun r : ℝ => ENNReal.ofReal (r^k)),he] + have hconst (c : ℝ) (hc : 0 ≤ c) : + (∫⁻ _ in Ioo a b, ENNReal.ofReal c) = ENNReal.ofReal (c*(b-a)) := by + rw [lintegral_const,Measure.restrict_apply_univ,Real.volume_Ioo,← ENNReal.ofReal_mul hc] + constructor + · rw [← hconst (a^k) (pow_nonneg ha k)] + apply setLIntegral_mono' measurableSet_Ioo + intro x hx + exact ENNReal.ofReal_le_ofReal (pow_le_pow_left₀ ha hx.1.le k) + · rw [← hconst (b^k) (pow_nonneg (ha.trans hab) k)] + apply setLIntegral_mono' measurableSet_Ioo + intro x hx + exact ENNReal.ofReal_le_ofReal (pow_le_pow_left₀ (ha.trans hx.1.le) hx.2.le k) + +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] + +lemma polar_rectangle_le {S : Set (sphere (0:E) 1)} {I : Set (Ioi (0:ℝ))} {A : Set E} + (hS : MeasurableSet S) (hI : MeasurableSet I) (hA : MeasurableSet A) + (h : ∀ e ∈ S, ∀ r ∈ I, r.1 • e.1 ∈ A) : + μ.toSphere S * volumeIoiPow (Module.finrank ℝ E-1) I ≤ μ A := by + rw [← Measure.prod_prod] + have he : μ A = ∫⁻ z : sphere (0:E) 1 × Ioi (0:ℝ), A.indicator (fun _ => (1:ℝ≥0∞)) + (z.2.1 • z.1.1) ∂μ.toSphere.prod (volumeIoiPow (Module.finrank ℝ E-1)) := by + rw [← Polar.lintegral_polar_prod μ,lintegral_indicator hA,lintegral_one,Measure.restrict_apply_univ] + have hr : (μ.toSphere.prod (volumeIoiPow (Module.finrank ℝ E-1))) (S ×ˢ I) = + ∫⁻ z, (S ×ˢ I).indicator (fun _ => (1:ℝ≥0∞)) z + ∂μ.toSphere.prod (volumeIoiPow (Module.finrank ℝ E-1)) := by + rw [lintegral_indicator (hS.prod hI),lintegral_one,Measure.restrict_apply_univ] + rw [he,hr] + apply lintegral_mono + intro z + by_cases hz : z ∈ S ×ˢ I + · simp only [indicator_of_mem hz,indicator_of_mem (h z.1 hz.1 z.2 hz.2),le_refl] + · simp only [indicator_of_notMem hz,zero_le] + +lemma measure_le_polar_rectangle {S : Set (sphere (0:E) 1)} {I : Set (Ioi (0:ℝ))} {A : Set E} + (hS : MeasurableSet S) (hI : MeasurableSet I) (hA : MeasurableSet A) + (h : ∀ e r, r.1 • e.1 ∈ A → e ∈ S ∧ r ∈ I) : + μ A ≤ μ.toSphere S * volumeIoiPow (Module.finrank ℝ E-1) I := by + rw [← Measure.prod_prod] + have he : μ A = ∫⁻ z : sphere (0:E) 1 × Ioi (0:ℝ), A.indicator (fun _ => (1:ℝ≥0∞)) + (z.2.1 • z.1.1) ∂μ.toSphere.prod (volumeIoiPow (Module.finrank ℝ E-1)) := by + rw [← Polar.lintegral_polar_prod μ,lintegral_indicator hA,lintegral_one,Measure.restrict_apply_univ] + have hr : (μ.toSphere.prod (volumeIoiPow (Module.finrank ℝ E-1))) (S ×ˢ I) = + ∫⁻ z, (S ×ˢ I).indicator (fun _ => (1:ℝ≥0∞)) z + ∂μ.toSphere.prod (volumeIoiPow (Module.finrank ℝ E-1)) := by + rw [lintegral_indicator (hS.prod hI),lintegral_one,Measure.restrict_apply_univ] + rw [he,hr] + apply lintegral_mono + intro z + by_cases hz : z.2.1 • z.1.1 ∈ A + · have hz' : z ∈ S ×ˢ I := h z.1 z.2 hz + simp only [indicator_of_mem hz,indicator_of_mem hz',le_refl] + · simp only [indicator_of_notMem hz,zero_le] + +omit [NormedSpace ℝ E] [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] in +lemma norm_unit (e : sphere (0:E) 1) : ‖(e:E)‖ = 1 := by + simpa only [mem_sphere,dist_zero_right] using e.2 + +omit [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] in +lemma polar_unit_distance (e θ : sphere (0:E) 1) {r : ℝ} (hr : 0 ≤ r) : + |r-1| ≤ ‖r • (e:E) - (θ:E)‖ ∧ + dist e θ ≤ 2 * ‖r • (e:E) - (θ:E)‖ := by + have hn : ‖r • (e:E)‖ = r := by rw [norm_smul,Real.norm_eq_abs,abs_of_nonneg hr,norm_unit,mul_one] + have hab : |r-1| ≤ ‖r • (e:E) - (θ:E)‖ := by + simpa only [hn,norm_unit] using abs_norm_sub_norm_le (r • (e:E)) (θ:E) + refine ⟨hab,?_⟩ + have heq : ‖(e:E)-r • (e:E)‖ = |r-1| := by + have hev : (e:E)-r • (e:E) = (1-r) • (e:E) := by rw [sub_smul,one_smul] + rw [hev,norm_smul,Real.norm_eq_abs,norm_unit,mul_one,abs_sub_comm] + have hh := dist_triangle (e:E) (r • (e:E)) (θ:E) + simp only [dist_eq_norm] at hh + rw [heq] at hh + rw [Subtype.dist_eq,dist_eq_norm] + linarith + +lemma cap_lower_product (θ : sphere (0:E) 1) {l : ℝ} (hl : 0 < l) (hl1 : l ≤ 1) : + μ (ball (θ:E) (l/4)) ≤ μ.toSphere (ball θ l) * + ENNReal.ofReal (2^(Module.finrank ℝ E-1)*l) := by + have ha : 0 ≤ 1-l/4 := by linarith + have hb : 1-l/4 ≤ 1+l/4 := by linarith + have hgeom := measure_le_polar_rectangle μ (S := ball θ l) + (I := band (1-l/4) (1+l/4)) measurableSet_ball + (measurable_subtype_coe measurableSet_Ioo) measurableSet_ball (A := ball (θ:E) (l/4)) (by + intro e r hr + have hd : ‖r.1 • (e:E)-(θ:E)‖ < l/4 := by simpa only [mem_ball,dist_eq_norm] using hr + have hh := polar_unit_distance e θ r.2.le + constructor + · change dist e θ < l + linarith [hh.2] + · change 1-l/4 < r.1 ∧ r.1 < 1+l/4 + have har : |r.1-1| < l/4 := hh.1.trans_lt hd + obtain ⟨hlo,hhi⟩ := abs_lt.mp har + constructor <;> linarith) + apply hgeom.trans + gcongr + apply (volumeIoiPow_band_bounds _ ha hb).2.trans + apply ENNReal.ofReal_le_ofReal + have hp : (1+l/4)^(Module.finrank ℝ E-1) ≤ 2^(Module.finrank ℝ E-1) := + pow_le_pow_left₀ (by linarith) (by linarith) _ + calc + (1+l/4)^(Module.finrank ℝ E-1)*((1+l/4)-(1-l/4)) = + (1+l/4)^(Module.finrank ℝ E-1)*(l/2) := by ring + _ ≤ 2^(Module.finrank ℝ E-1)*(l/2) := by gcongr + _ ≤ _ := by gcongr; linarith + +lemma cap_upper_product (θ : sphere (0:E) 1) {l : ℝ} (hl : 0 < l) (hl1 : l ≤ 1) : + μ.toSphere (ball θ l) * ENNReal.ofReal ((1/2:ℝ)^(Module.finrank ℝ E-1)*(l/2)) ≤ + μ (ball (θ:E) (2*l)) := by + have ha : 0 ≤ 1-l/2 := by linarith + have hb : 1-l/2 ≤ 1 := by linarith + have hgeom := polar_rectangle_le μ (S := ball θ l) + (I := band (1-l/2) 1) measurableSet_ball + (measurable_subtype_coe measurableSet_Ioo) measurableSet_ball (A := ball (θ:E) (2*l)) (by + intro e he r hr + have hd : ‖(e:E)-(θ:E)‖ < l := by simpa only [mem_ball,Subtype.dist_eq,dist_eq_norm] using he + have hr1 : r.1 < 1 := hr.2 + have hrl : 1-l/2 < r.1 := hr.1 + have heq : ‖r.1 • (e:E)-(e:E)‖ = 1-r.1 := by + have hev : r.1 • (e:E)-(e:E) = (r.1-1) • (e:E) := by rw [sub_smul,one_smul] + rw [hev,norm_smul,Real.norm_eq_abs,norm_unit,mul_one,abs_of_neg (by linarith)] + ring + have hh := dist_triangle (r.1 • (e:E)) (e:E) (θ:E) + simp only [dist_eq_norm] at hh + rw [heq] at hh + rw [mem_ball,dist_eq_norm] + linarith) + apply le_trans _ hgeom + gcongr + apply le_trans _ (volumeIoiPow_band_bounds _ ha hb).1 + apply ENNReal.ofReal_le_ofReal + have hp : (1/2:ℝ)^(Module.finrank ℝ E-1) ≤ (1-l/2)^(Module.finrank ℝ E-1) := + pow_le_pow_left₀ (by norm_num) (by linarith) _ + have heq : 1-(1-l/2) = l/2 := by ring + rw [heq] + gcongr + +lemma cap_real_bounds (θ : sphere (0:E) 1) {l : ℝ} (hl : 0 < l) (hl1 : l ≤ 1) : + (μ (ball (0:E) 1)).toReal / (4^Module.finrank ℝ E * 2^(Module.finrank ℝ E-1)) * + l^(Module.finrank ℝ E-1) ≤ (μ.toSphere (ball θ l)).toReal ∧ + (μ.toSphere (ball θ l)).toReal ≤ + 4^Module.finrank ℝ E * (μ (ball (0:E) 1)).toReal * l^(Module.finrank ℝ E-1) := by + have hn : Module.finrank ℝ E-1+1 = Module.finrank ℝ E := + Nat.sub_add_cancel (Module.finrank_pos : 0 < Module.finrank ℝ E) + have hbf : μ (ball (0:E) 1) ≠ ⊤ := (isBounded_ball.measure_lt_top (μ := μ)).ne + have hcf : μ.toSphere (ball θ l) ≠ ⊤ := measure_ne_top _ _ + have hlo := cap_lower_product μ θ hl hl1 + rw [μ.addHaar_ball _ (by positivity)] at hlo + have hlor := ENNReal.toReal_mono (ENNReal.mul_ne_top hcf ENNReal.ofReal_ne_top) hlo + simp only [ENNReal.toReal_mul,ENNReal.toReal_ofReal (show 0 ≤ (l/4)^Module.finrank ℝ E by positivity), + ENNReal.toReal_ofReal (show 0 ≤ (2:ℝ)^(Module.finrank ℝ E-1)*l by positivity)] at hlor + have hhi := cap_upper_product μ θ hl hl1 + rw [μ.addHaar_ball _ (by positivity)] at hhi + have hhir := ENNReal.toReal_mono (ENNReal.mul_ne_top ENNReal.ofReal_ne_top hbf) hhi + simp only [ENNReal.toReal_mul, + ENNReal.toReal_ofReal (show 0 ≤ (2*l)^Module.finrank ℝ E by positivity), + ENNReal.toReal_ofReal (show 0 ≤ (1/2:ℝ)^(Module.finrank ℝ E-1)*(l/2) by positivity)] at hhir + have hlpow : l^Module.finrank ℝ E = l^(Module.finrank ℝ E-1)*l := by + nth_rw 1 [← hn]; rw [pow_succ] + have h2pow : (2:ℝ)^Module.finrank ℝ E = 2^(Module.finrank ℝ E-1)*2 := by + nth_rw 1 [← hn]; rw [pow_succ] + have h4pow : (4:ℝ)^Module.finrank ℝ E = (2^Module.finrank ℝ E)^2 := by + rw [← pow_mul, mul_comm _ 2,pow_mul]; norm_num + constructor + · rw [div_pow,hlpow] at hlor + have h4 : (0:ℝ) < 4^Module.finrank ℝ E := by positivity + have h2 : (0:ℝ) < 2^(Module.finrank ℝ E-1) := by positivity + have hs : (μ (ball (0:E) 1)).toReal * l^(Module.finrank ℝ E-1) * l ≤ + (μ.toSphere (ball θ l)).toReal * (2^(Module.finrank ℝ E-1)*l) * 4^Module.finrank ℝ E := by + apply (div_le_iff₀ h4).mp + simpa only [div_mul_eq_mul_div,mul_comm,mul_left_comm,mul_assoc] using hlor + have hh : (μ (ball (0:E) 1)).toReal * l^(Module.finrank ℝ E-1) ≤ + (μ.toSphere (ball θ l)).toReal * (4^Module.finrank ℝ E * 2^(Module.finrank ℝ E-1)) := by + apply (mul_le_mul_iff_left₀ hl).mp + simpa only [mul_comm,mul_left_comm,mul_assoc] using hs + calc + _ = ((μ (ball (0:E) 1)).toReal * l^(Module.finrank ℝ E-1)) / + (4^Module.finrank ℝ E * 2^(Module.finrank ℝ E-1)) := by ring + _ ≤ _ := (div_le_iff₀ (mul_pos h4 h2)).mpr hh + · apply (mul_le_mul_iff_left₀ (show 0 < (1/2:ℝ)^(Module.finrank ℝ E-1)*(l/2) by positivity)).mp + calc + _ ≤ (2*l)^Module.finrank ℝ E * (μ (ball (0:E) 1)).toReal := hhir + _ = (4^Module.finrank ℝ E * (μ (ball (0:E) 1)).toReal * l^(Module.finrank ℝ E-1)) * + ((1/2:ℝ)^(Module.finrank ℝ E-1)*(l/2)) := by + rw [mul_pow,hlpow,h4pow,h2pow,div_pow] + field_simp + ring + +omit [BorelSpace E] [Nontrivial E] in +lemma cap_constants_pos : + 0 < (μ (ball (0:E) 1)).toReal / (4^Module.finrank ℝ E * 2^(Module.finrank ℝ E-1)) ∧ + 0 < (4:ℝ)^Module.finrank ℝ E * (μ (ball (0:E) 1)).toReal := by + have hp : 0 < (μ (ball (0:E) 1)).toReal := + ENNReal.toReal_pos (ne_of_gt (Metric.measure_ball_pos μ 0 (by norm_num))) + (isBounded_ball.measure_lt_top (μ := μ)).ne + constructor <;> positivity + +end HenonLaneEmden.CapGeometry +end +end CapGeometry + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/CapLoss.lean b/lean/OAI/Analysis/HenonEmden/CapLoss.lean new file mode 100644 index 0000000000000000000000000000000000000000..32de24d6f503028dc376f46762c0d2936311ebaa --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/CapLoss.lean @@ -0,0 +1,112 @@ +import OAI.Analysis.HenonEmden.AngularIntegration + +namespace OAI + +universe uE + +section CapLoss + +open MeasureTheory Set Metric +noncomputable section +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap LineComponents Angular +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] + +omit [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] in +lemma length_at {f : E → ℝ} (x : E) {t : ℝ} (ht : 0 < t) (e : sphere (0:E) 1) : + componentLength (lineLayer f) (e,x,t) = + componentLength {z : sphere (0:E) 1 × ℝ | t < f (x+z.2 • z.1.1)} e := by + classical + have hs (r : ℝ) : SegmentInside (lineLayer f) (e,x,t) r ↔ + SegmentInside {z : sphere (0:E) 1 × ℝ | t < f (x+z.2 • z.1.1)} e r := by + change (∀ s ∈ uIcc 0 r, 0 < t ∧ t < f (x+s • e.1)) ↔ + (∀ s ∈ uIcc 0 r, t < f (x+s • e.1)) + simp only [ht,true_and] + unfold componentLength forwardExit backwardExit + congr 1 <;> apply iSup_congr <;> intro r + · exact if_congr (hs (r : ℝ)) rfl rfl + · exact if_congr (hs (-(r : ℝ))) rfl rfl + +lemma integrable_loss {f : E → ℝ} (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (δ : ℝ) (x : E) (t : ℝ) : + Integrable (fun e : sphere (0:E) 1 => weight μ κ e x-lineWeight μ f κ δ (e,x,t)) μ.toSphere := by + have hm := (continuous_weight_direction μ κ x).measurable.sub + ((measurable_lineWeight μ hf hκ hκ1 δ).comp (show Measurable (fun e : sphere (0:E) 1 => (e,x,t)) by fun_prop)) + apply (integrable_const (boundConstant μ κ)).mono' hm.aestronglyMeasurable + apply ae_of_all + intro e + change ‖weight μ κ e x-lineWeight μ f κ δ (e,x,t)‖ ≤ _ + rw [Real.norm_eq_abs,abs_of_nonneg (sub_nonneg.mpr (lineWeight_le μ f κ δ (e,x,t)))] + exact (sub_le_self _ (lineWeight_nonneg μ f κ δ _)).trans (weight_le_constant μ hκ hκ1 e x) + +lemma averaged_loss_le_weight {f : E → ℝ} (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (δ : ℝ) (x : E) (t : ℝ) : + (∫ e, weight μ κ e x-lineWeight μ f κ δ (e,x,t) ∂μ.toSphere) ≤ w (Module.finrank ℝ E) x := by + have hi : Integrable (fun e : sphere (0:E) 1 => weight μ κ e x) μ.toSphere := + (integrable_const (boundConstant μ κ)).mono' (continuous_weight_direction μ κ x).aestronglyMeasurable + (ae_of_all _ (fun e => by rw [Real.norm_eq_abs,abs_of_nonneg (weight_nonneg μ _ _ _)]; exact weight_le_constant μ hκ hκ1 e x)) + rw [← integral_weight μ hκ hκ1 x] + exact integral_mono (integrable_loss μ hf hκ hκ1 δ x t) hi + (fun e => sub_le_self _ (lineWeight_nonneg μ f κ δ _)) + +lemma averaged_loss_le {f : E → ℝ} (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + {κ δ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 < δ) (hδ1 : δ ≤ 1/2) + {x : E} (hd : 0 < d x) {t M : ℝ} (ht : 0 < t) (htf : t < f x) (hM : 0 ≤ M) + (hm : (∫⁻ z in ball (0:E) 4, ENNReal.ofReal (f z) ∂μ) ≤ ENNReal.ofReal M) : + (∫ e, weight μ κ e x-lineWeight μ f κ δ (e,x,t) ∂μ.toSphere) ≤ + oscillationConstant μ κ*δ*(d x)^(N (Module.finrank ℝ E))*μ.toSphere.real univ + + (boundConstant μ κ*(d x)^(N (Module.finrank ℝ E)-Module.finrank ℝ E))* + (rayConstant (Module.finrank ℝ E)*M/(t*(δ*(d x)^(m (Module.finrank ℝ E)))^(Module.finrank ℝ E))) := by + let l := δ*(d x)^(m (Module.finrank ℝ E)) + let U := {z : sphere (0:E) 1 × ℝ | t < f (x+z.2 • z.1.1)} + let S := {e | ENNReal.ofReal l < componentLength U e} + have hU : IsOpen U := by + have hh := hf.preimage (show Continuous (fun z : sphere (0:E) 1 × ℝ => (x+z.2 • z.1.1,t)) by fun_prop) + simpa only [preimage_ofPred_eq,ht,true_and] using hh + have hS : MeasurableSet S := measurableSet_lt measurable_const (measurable_componentLength hU) + have hF := (continuous_weight_direction μ κ x).measurable.sub + ((measurable_lineWeight μ hf hκ hκ1 δ).comp (show Measurable (fun e : sphere (0:E) 1 => (e,x,t)) by fun_prop)) + have hb : 0 ≤ boundConstant μ κ*(d x)^(N (Module.finrank ℝ E)-Module.finrank ℝ E) := + mul_nonneg (boundConstant_nonneg μ hκ.le) (pow_nonneg hd.le _) + have he := integral_le_constant_add_event μ.toSphere hS hF + (a := oscillationConstant μ κ*δ*(d x)^(N (Module.finrank ℝ E))) + (H := boundConstant μ κ*(d x)^(N (Module.finrank ℝ E)-Module.finrank ℝ E)) + (mul_nonneg (mul_nonneg (oscillationConstant_nonneg μ hκ.le) hδ.le) (pow_nonneg hd.le _)) hb + (fun e => sub_nonneg.mpr (lineWeight_le μ f κ δ (e,x,t))) + (fun e => (sub_le_self _ (lineWeight_nonneg μ f κ δ _)).trans (weight_bound μ hκ hκ1 e x)) + (by + intro e he + apply short_loss μ hf hκ hκ1 hδ.le hδ1 e hd ht htf + rw [length_at x ht] + exact le_of_not_gt he) + have hl : 0 < l := mul_pos hδ (pow_pos hd _) + have hl1 : l ≤ 1 := (mul_le_of_le_one_left (pow_nonneg hd.le _) + (by linarith : δ ≤ 1)).trans (pow_le_one₀ hd.le (d_le_one x)) + have hp := long_component_measure_le μ ((d_pos_iff x).mp hd).le ht hl hl1 hM hU hm + apply he.trans + exact add_le_add le_rfl (mul_le_mul_of_nonneg_left hp hb) + +lemma high_level_flatness (n : ℕ) {D δ t P C : ℝ} (hD : 0 < D) (hδ : 0 < δ) + (ht : 0 < t) (hP : 0 < P) (hC : 0 ≤ C) (hlevel : P ≤ t*D^(k n)) : + C*D^(N n-n)/(t*(δ*D^(m n))^n) ≤ C/δ^n/P*D^(N n) := by + have hn : (N n-n)+k n = N n+m n*n := by + simp only [N,k,m,Nat.mul_add,Nat.add_mul] + omega + have hp : D^(N n-n)*D^(k n) = D^(N n)*D^(m n*n) := by rw [← pow_add,← pow_add,hn] + have he : C*D^(N n-n)/(t*(δ*D^(m n))^n) = (C/δ^n)*(D^(N n)/(t*D^(k n))) := by + rw [mul_pow,← pow_mul] + field_simp + nlinarith [congrArg (fun r => C*δ^n*t*r) hp] + rw [he] + calc + _ ≤ (C/δ^n)*(D^(N n)/P) := mul_le_mul_of_nonneg_left + (div_le_div_of_nonneg_left (pow_nonneg hD.le _) hP hlevel) (div_nonneg hC (pow_nonneg hδ.le _)) + _ = _ := by ring + +end HenonLaneEmden.SpatialComponents +end +end CapLoss + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/CapMismatch.lean b/lean/OAI/Analysis/HenonEmden/CapMismatch.lean new file mode 100644 index 0000000000000000000000000000000000000000..33f14b7abfa969e2dcfd856e3d229ab12fb25919 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/CapMismatch.lean @@ -0,0 +1,111 @@ +import OAI.Analysis.HenonEmden.InteractionBounds + +namespace OAI + +section CapMismatch + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open Cutoff AdaptiveCap SpatialComponents + +lemma cap_close_bound {n : ℕ} (hn : 1 ≤ n) {κ δ : ℝ} + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1/4) + (e : sphere (0:Space n) 1) {x y : Space n} + (hs : 0 < pairGap (x,y)) (hxy : ‖x-y‖ ≤ δ*pairGap (x,y)^(m n)) : + |weight volume κ e x-weight volume κ e y| ≤ + oscillationConstant (volume : Measure (Space n)) κ*δ*(eta n x+eta n y) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hC := oscillationConstant_nonneg (volume : Measure (Space n)) hκ.le + have hlen := (close_pair_gaps hδ hδ1 hs hxy).2.2.2 + have hbound {a b : Space n} (hab : ‖a-b‖ ≤ δ*pairGap (a,b)^(m n)) + (hs' : 0 < pairGap (a,b)) (hlen' : ‖a-b‖ ≤ δ*pairGap (a,b)) (hma : pairGap (a,b)=d a) : + |weight volume κ e a-weight volume κ e b| ≤ + oscillationConstant (volume : Measure (Space n)) κ*δ*(eta n a+eta n b) := by + rw [hma] at hab hs' hlen' + have hd : dist a b ≤ d a/2 := by rw [dist_eq_norm]; nlinarith + have ho := weight_close_oscillation volume hκ hκ1 hs' hd e + simp only [finrank_euclideanSpace_fin] at ho + rw [dist_eq_norm] at ho + have hp : d a^(N n-n-1)*‖a-b‖ ≤ δ*d a^(N n) := by + calc + _ ≤ d a^(N n-n-1)*(δ*d a^(m n)) := mul_le_mul_of_nonneg_left hab (pow_nonneg hs'.le _) + _ = δ*d a^(N n-n-1+m n) := by rw [pow_add]; ring + _ ≤ _ := mul_le_mul_of_nonneg_left (pow_le_pow_of_le_one hs'.le (d_le_one a) (by unfold N m; omega)) hδ + exact ho.trans ((by nlinarith [mul_le_mul_of_nonneg_left hp hC] : + oscillationConstant (volume : Measure (Space n)) κ*d a^(N n-n-1)*‖a-b‖ ≤ + oscillationConstant (volume : Measure (Space n)) κ*δ*d a^(N n)).trans + (mul_le_mul_of_nonneg_left ((eta_gap_bounds n a).1.trans (le_add_of_nonneg_right (eta_nonneg n b))) (mul_nonneg hC hδ))) + rcases max_choice (d x) (d y) with hx | hy + · exact hbound hxy hs hlen hx + · have hh := hbound (a:=y) (b:=x) (by simpa only [pairGap,max_comm,norm_sub_rev y x] using hxy) + (by simpa only [pairGap,max_comm] using hs) (by simpa only [pairGap,max_comm,norm_sub_rev y x] using hlen) + (by simpa only [pairGap,max_comm] using hy) + simpa only [abs_sub_comm,add_comm] using hh + +lemma cap_endpoint_far_bound {n : ℕ} (hn : 1 ≤ n) {κ δ : ℝ} + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (e : sphere (0:Space n) 1) (x y : Space n) + (hfar : 0 < d x → δ*d x^(m n) ≤ ‖x-y‖) : + weight volume κ e x ≤ boundConstant (volume : Measure (Space n)) κ*farWeight δ (N n-n:ℕ) (x,y) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + by_cases hx : 0 < d x + · rw [farWeight,ite_eq_left ⟨hx,hfar hx⟩,Real.rpow_natCast] + simpa only [finrank_euclideanSpace_fin] using weight_bound volume hκ hκ1 e x + · have hx2 : 2 ≤ ‖x‖ := not_lt.mp (fun hh => hx ((d_pos_iff x).mpr hh)) + rw [weight_outer volume κ e hx2,farWeight,ite_eq_right (by simp [hx]),mul_zero] + +lemma cap_difference_global {n : ℕ} (hn : 1 ≤ n) {κ δ : ℝ} + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 < δ) (hδ1 : δ ≤ 1/4) + (e : sphere (0:Space n) 1) (z : Space n × Space n) : + |weight volume κ e z.1-weight volume κ e z.2| ≤ + oscillationConstant (volume : Measure (Space n)) κ*δ*(eta n z.1+eta n z.2)+ + boundConstant (volume : Measure (Space n)) κ*(farWeight δ (N n-n:ℕ) z+farWeight δ (N n-n:ℕ) z.swap) := by + have hC := oscillationConstant_nonneg (volume : Measure (Space n)) hκ.le + have hB := boundConstant_nonneg (volume : Measure (Space n)) hκ.le + by_cases hc : 0 < pairGap z ∧ ‖z.1-z.2‖ ≤ δ*pairGap z^(m n) + · exact (cap_close_bound hn hκ hκ1 hδ.le hδ1 e hc.1 hc.2).trans (le_add_of_nonneg_right + (mul_nonneg hB (add_nonneg (farWeight_nonneg _ _ _) (farWeight_nonneg _ _ _)))) + · obtain ⟨ha,hb⟩ := far_pair_endpoint hδ.le hc + have h1 := cap_endpoint_far_bound hn hκ hκ1 e z.1 z.2 ha + have h2 := cap_endpoint_far_bound hn hκ hκ1 e z.2 z.1 (by simpa only [norm_sub_rev z.2 z.1] using hb) + have hab : |weight volume κ e z.1-weight volume κ e z.2| ≤ weight volume κ e z.1+weight volume κ e z.2 := by + simpa only [sub_zero,zero_sub,abs_neg,abs_of_nonneg (weight_nonneg volume κ e _)] using + abs_sub_le (weight volume κ e z.1) 0 (weight volume κ e z.2) + exact hab.trans (((add_le_add h1 h2).trans_eq (by simp only [Prod.swap]; ring)).trans + (le_add_of_nonneg_left (mul_nonneg (mul_nonneg hC hδ.le) (add_nonneg (eta_nonneg n _) (eta_nonneg n _))))) + +lemma IsSolution.capMismatch_bound {n : ℕ} (hn : 2 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 < δ) (hδ1 : δ ≤ 1/4) (e : sphere (0:Space n) 1) : + capMismatchIntegral (source u q B) (source v p A) κ e ≤ ENNReal.ofReal + (oscillationConstant (volume : Measure (Space n)) κ*δ*(weightedEnergy (eta n) u q B+weightedEnergy (eta n) v p A)+ + boundConstant (volume : Measure (Space n)) κ*(farConstant n p q A B δ+farConstant n q p B A δ)) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hηf := h.weight_left hn hq (continuous_eta n) (compactSupport_eta n) (eta_nonneg n) + have hηg := h.weight_right hn hp (continuous_eta n) (compactSupport_eta n) (eta_nonneg n) + have h1 := h.farWeight_bound hn hp hq hδ (by linarith) (cutoff_far_exponents n).2.2 + have h2 := h.farWeight_swap_bound hn hp hq hδ (by linarith) (cutoff_far_exponents n).2.2 + have hηi : Integrable (fun z : Space n × Space n => eta n z.1+eta n z.2) _ := hηf.1.add hηg.1 + have hfi : Integrable (fun z => farWeight δ (N n-n:ℕ) z+farWeight δ (N n-n:ℕ) z.swap) _ := h1.1.add h2.1 + have hi : Integrable (fun z : Space n × Space n => + oscillationConstant (volume : Measure (Space n)) κ*δ*(eta n z.1+eta n z.2)+ + boundConstant (volume : Measure (Space n)) κ*(farWeight δ (N n-n:ℕ) z+farWeight δ (N n-n:ℕ) z.swap)) _ := + (hηi.const_mul _).add (hfi.const_mul _) + have hC := oscillationConstant_nonneg (volume : Measure (Space n)) hκ.le + have hB := boundConstant_nonneg (volume : Measure (Space n)) hκ.le + have hb := cap_difference_global (by omega : 1 ≤ n) hκ hκ1 hδ hδ1 e + unfold capMismatchIntegral + apply (lintegral_mono (fun z => ENNReal.ofReal_le_ofReal (hb z))).trans + rw [← ofReal_integral_eq_lintegral_ofReal hi (ae_of_all _ (fun z => + add_nonneg (mul_nonneg (mul_nonneg hC hδ.le) (add_nonneg (eta_nonneg n _) (eta_nonneg n _))) + (mul_nonneg hB (add_nonneg (farWeight_nonneg _ _ _) (farWeight_nonneg _ _ _))))), + integral_add (hηi.const_mul _) (hfi.const_mul _),integral_const_mul,integral_const_mul, + integral_add hηf.1 hηg.1,integral_add h1.1 h2.1,hηf.2,hηg.2] + exact ENNReal.ofReal_le_ofReal (add_le_add le_rfl (mul_le_mul_of_nonneg_left (add_le_add h1.2 h2.2) hB)) + +end HenonLaneEmden +end +end CapMismatch + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/CapOscillation.lean b/lean/OAI/Analysis/HenonEmden/CapOscillation.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3b43c622eb761a509b6f22e663df195cb02fbf9 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/CapOscillation.lean @@ -0,0 +1,133 @@ +import OAI.Analysis.HenonEmden.AdaptiveCaps + +namespace OAI + +universe uE + +section CapOscillation + +open MeasureTheory Set Metric +noncomputable section +namespace HenonLaneEmden.AdaptiveCap +open Cutoff CapWeights +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] + +def normalizedOscConstant : ℝ := + 2/(lowerConstant μ/2^(Module.finrank ℝ E-1))+ + 2*(2^(Module.finrank ℝ E)*upperConstant μ)/(lowerConstant μ/2^(Module.finrank ℝ E-1))^2 + +def oscillationConstant (κ : ℝ) : ℝ := + wDerivativeConstant (Module.finrank ℝ E)*2^(N (Module.finrank ℝ E)-2) / + (lowerConstant μ*κ^(Module.finrank ℝ E-1)) + + (6*(N (Module.finrank ℝ E):ℝ)*3^(N (Module.finrank ℝ E)-1))* + 2^(N (Module.finrank ℝ E)-1)*normalizedOscConstant μ*6/κ^(Module.finrank ℝ E) + +omit [BorelSpace E] [Nontrivial E] in +lemma oscillationConstant_nonneg {κ : ℝ} (hκ : 0 ≤ κ) : 0 ≤ oscillationConstant μ κ := by + obtain ⟨hc,hC⟩ := constants_positive μ + have hd := (constants_nonneg (Module.finrank ℝ E)).2.2 + dsimp [oscillationConstant,normalizedOscConstant] + positivity + +lemma normalized_close_oscillation {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) + {x y : E} (hx : x ≠ 0) (hy : y ≠ 0) (hd : 0 < d x) + (hxy : dist x y ≤ d x/2) (hnx : 1/2 ≤ ‖x‖) (hny : 1/2 ≤ ‖y‖) + (e : sphere (0:E) 1) : + |normalized μ.toSphere (direction x hx) (κ*d x) e- + normalized μ.toSphere (direction y hy) (κ*d y) e| ≤ + normalizedOscConstant μ*6*dist x y/(κ*d x)^(Module.finrank ℝ E) := by + have hg := abs_le.mp (d_oscillation x y) + have hcomp : d x/2 ≤ d y ∧ d y ≤ 2*d x := by constructor <;> linarith + have hr := sphere_normalized_oscillation μ (mul_pos hκ hd) + (l := κ*d x) (l' := κ*d y) (by nlinarith [mul_pos hκ hd]) + (by nlinarith [mul_le_mul_of_nonneg_left hcomp.1 hκ.le]) + (by nlinarith [mul_pos hκ hd]) + (by nlinarith [mul_le_mul_of_nonneg_left hcomp.2 hκ.le]) + ((mul_le_of_le_one_left (d_nonneg x) hκ1).trans (d_le_one x)) + ((mul_le_of_le_one_left (d_nonneg y) hκ1).trans (d_le_one y)) e + (θ := direction x hx) (θ' := direction y hy) + change _ ≤ normalizedOscConstant μ*(dist (direction x hx) (direction y hy)+2*|κ*d x-κ*d y|)/(κ*d x)^Module.finrank ℝ E at hr + apply hr.trans + apply div_le_div_of_nonneg_right _ (pow_nonneg (mul_pos hκ hd).le _) + have hc : 0 ≤ normalizedOscConstant μ := by + obtain ⟨hc,hC⟩ := constants_positive μ; unfold normalizedOscConstant; positivity + have hdir : dist (direction x hx) (direction y hy) ≤ 4*dist x y := normalize_dist_le hnx hny + have hrad : |κ*d x-κ*d y| ≤ dist x y := by + rw [← mul_sub,abs_mul,abs_of_pos hκ] + exact (mul_le_mul_of_nonneg_left (d_oscillation x y) hκ.le).trans + (by nlinarith [dist_nonneg (x := x) (y := y)]) + nlinarith + +lemma weight_close_oscillation {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) + {x y : E} (hd : 0 < d x) (hxy : dist x y ≤ d x/2) (e : sphere (0:E) 1) : + |weight μ κ e x-weight μ κ e y| ≤ + oscillationConstant μ κ*(d x)^(N (Module.finrank ℝ E)-Module.finrank ℝ E-1)*dist x y := by + let n := Module.finrank ℝ E + have hn : 1 ≤ n := Module.finrank_pos + have hc := constants_positive μ + have hg := abs_le.mp (d_oscillation x y) + have hdy : 0 < d y := by linarith + have hdyU : d y ≤ 2*d x := by linarith + have hdist : dist x y ≤ 1/2 := by linarith [d_le_one x] + by_cases hboth : ‖x‖ ≤ 1 ∧ ‖y‖ ≤ 1 + · rw [weight_inner μ κ e hboth.1,weight_inner μ κ e hboth.2,sub_self,abs_zero] + exact mul_nonneg (mul_nonneg (oscillationConstant_nonneg μ hκ.le) (pow_nonneg hd.le _)) dist_nonneg + have hnxy : 1/2 ≤ ‖x‖ ∧ 1/2 ≤ ‖y‖ := by + have hnorm : |‖x‖-‖y‖| ≤ dist x y := by simpa only [dist_eq_norm] using abs_norm_sub_norm_le x y + have hh := abs_le.mp hnorm + push Not at hboth + by_cases hx : ‖x‖ ≤ 1 + · have hy := hboth hx; constructor <;> linarith + · push Not at hx; constructor <;> linarith + have hx0 : x ≠ 0 := norm_ne_zero_iff.mp (ne_of_gt (by linarith [hnxy.1] : 0 < ‖x‖)) + have hy0 : y ≠ 0 := norm_ne_zero_iff.mp (ne_of_gt (by linarith [hnxy.2] : 0 < ‖y‖)) + let cₓ := normalized μ.toSphere (direction x hx0) (κ*d x) e + let cᵧ := normalized μ.toSphere (direction y hy0) (κ*d y) e + have hcx : 0 ≤ cₓ := normalized_nonneg _ _ _ _ + have hcy : 0 ≤ cᵧ := normalized_nonneg _ _ _ _ + have hcl : cₓ ≤ 1/(lowerConstant μ*(κ*d x)^(n-1)) := by + exact (normalized_le_inv μ.toSphere _ (mul_pos hκ hd) e).trans (by + simpa only [one_div] using one_div_le_one_div_of_le + (mul_pos hc.1 (pow_pos (mul_pos hκ hd) _)) + (sphere_normalizer_bounds μ (direction x hx0) (mul_pos hκ hd) + ((mul_le_of_le_one_left (d_nonneg x) hκ1).trans (d_le_one x))).1) + have hco := normalized_close_oscillation μ hκ hκ1 hx0 hy0 hd hxy hnxy.1 hnxy.2 e + have hwo : |w n x-w n y| ≤ wDerivativeConstant n*(2*d x)^(N n-2)*dist x y := by + rw [abs_sub_comm] + exact w_oscillation hn (by positivity) (by linarith) + have hwy : w n y ≤ (6*(N n:ℝ)*3^(N n-1))*(2*d x)^(N n-1) := by + rw [w_eq_profile] + exact (wProfile_bound n (norm_nonneg y)).trans + (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (d_nonneg y) hdyU _) (by positivity)) + rw [weight,dite_eq_left ⟨hx0,hd⟩,weight,dite_eq_left ⟨hy0,hdy⟩] + change |w n x*cₓ-w n y*cᵧ| ≤ _ + calc + _ ≤ |w n x-w n y| *cₓ+w n y*|cₓ-cᵧ| := by + rw [show w n x*cₓ-w n y*cᵧ = (w n x-w n y)*cₓ+w n y*(cₓ-cᵧ) by ring] + simpa only [abs_mul,abs_of_nonneg hcx,abs_of_nonneg (w_nonneg n y)] using abs_add_le ((w n x-w n y)*cₓ) (w n y*(cₓ-cᵧ)) + _ ≤ (wDerivativeConstant n*(2*d x)^(N n-2)*dist x y)* + (1/(lowerConstant μ*(κ*d x)^(n-1))) + + ((6*(N n:ℝ)*3^(N n-1))*(2*d x)^(N n-1))* + (normalizedOscConstant μ*6*dist x y/(κ*d x)^n) := by + apply add_le_add + · exact mul_le_mul hwo hcl hcx (by have hh := (constants_nonneg n).2.2; positivity) + · exact mul_le_mul hwy hco (abs_nonneg _) (by positivity) + _ = _ := by + have hN2 : N n-2 = (n-1)+(N n-n-1) := by dsimp [N]; omega + have hN1 : N n-1 = n+(N n-n-1) := by dsimp [N]; omega + have hd2 : (d x)^(N n-2) = (d x)^(n-1)*(d x)^(N n-n-1) := by rw [hN2,pow_add] + have hd1 : (d x)^(N n-1) = (d x)^n*(d x)^(N n-n-1) := by rw [hN1,pow_add] + simp only [mul_pow] + rw [hd2,hd1] + unfold oscillationConstant + change _ = (wDerivativeConstant n*2^(N n-2)/(lowerConstant μ*κ^(n-1))+ + (6*(N n:ℝ)*3^(N n-1))*2^(N n-1)*normalizedOscConstant μ*6/κ^n)*(d x)^(N n-n-1)*dist x y + field_simp [ne_of_gt hc.1,ne_of_gt hκ,ne_of_gt hd] + +end HenonLaneEmden.AdaptiveCap +end +end CapOscillation + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/CapWeights.lean b/lean/OAI/Analysis/HenonEmden/CapWeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..f09981eb13d6cd0a64068f78dfd593e59b38c77f --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/CapWeights.lean @@ -0,0 +1,219 @@ +import OAI.Analysis.HenonEmden.CapGeometry + +namespace OAI + +universe uT + +section CapWeights + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden.CapWeights + +variable {T : Type uT} [MetricSpace T] + +/-- A Lipschitz tent profile suffices for the pressure argument; no derivative +of the profile is used in the layer or interval integration. -/ +def profile (θ : T) (l : ℝ) (e : T) : ℝ := max (1-dist e θ/l) 0 + +lemma profile_nonneg (θ : T) (l : ℝ) (e : T) : 0 ≤ profile θ l e := le_max_right _ _ +lemma profile_le_one (θ : T) {l : ℝ} (hl : 0 < l) (e : T) : profile θ l e ≤ 1 := by + unfold profile + apply max_le _ (by norm_num) + linarith [div_nonneg (dist_nonneg (x := e) (y := θ)) hl.le] +lemma profile_eq_zero {θ e : T} {l : ℝ} (hl : 0 < l) (he : e ∉ ball θ l) : + profile θ l e = 0 := by + unfold profile + apply max_eq_right + have hh : l ≤ dist e θ := not_lt.mp he + have hr : 1 ≤ dist e θ/l := (le_div_iff₀ hl).mpr (by simpa using hh) + linarith +lemma profile_half {θ e : T} {l : ℝ} (hl : 0 < l) (he : e ∈ ball θ (l/2)) : + 1/2 ≤ profile θ l e := by + apply le_trans _ (le_max_left _ _) + have hh : dist e θ/l < 1/2 := (div_lt_iff₀ hl).mpr (by simpa [div_eq_mul_inv,mul_comm] using he) + linarith +lemma continuous_profile (θ : T) (l : ℝ) : Continuous (profile θ l) := by + unfold profile + fun_prop + +lemma profile_as_div (θ : T) {l : ℝ} (hl : 0 < l) (e : T) : + profile θ l e = max (l-dist e θ) 0/l := by + unfold profile + rw [← max_div_div_right hl.le,zero_div] + congr 1 + field_simp [ne_of_gt hl] + +lemma profile_center_oscillation {θ θ' e : T} {l : ℝ} (hl : 0 < l) : + |profile θ l e-profile θ' l e| ≤ dist θ θ'/l := by + unfold profile + calc + _ ≤ |(1-dist e θ/l)-(1-dist e θ'/l)| := abs_max_sub_max_le_abs _ _ _ + _ = |dist e θ-dist e θ'|/l := by + rw [show (1-dist e θ/l)-(1-dist e θ'/l) = -(dist e θ-dist e θ')/l by ring, + abs_div,abs_neg,abs_of_pos hl] + _ ≤ _ := div_le_div_of_nonneg_right (by simpa only [dist_comm e] using abs_dist_sub_le θ θ' e) hl.le + +lemma profile_radial_oscillation {θ e : T} {l l' : ℝ} (hl : 0 < l) (hl' : 0 < l') : + |profile θ l e-profile θ l' e| ≤ 2*|l-l'|/l := by + let a := max (l-dist e θ) 0 + let b := max (l'-dist e θ) 0 + have hab : |a-b| ≤ |l-l'| := by + simpa only [sub_sub_sub_cancel_right] using abs_max_sub_max_le_abs (l-dist e θ) (l'-dist e θ) 0 + have heq : profile θ l e-profile θ l' e = (a-b)/l+(l'-l)/l*profile θ l' e := by + rw [profile_as_div _ hl,profile_as_div _ hl'] + dsimp [a,b] + field_simp [ne_of_gt hl,ne_of_gt hl'] + ring + rw [heq] + calc + _ ≤ |(a-b)/l|+|(l'-l)/l*profile θ l' e| := abs_add_le _ _ + _ = |a-b|/l+|l-l'|/l*profile θ l' e := by + rw [abs_mul,abs_div,abs_div,abs_of_pos hl,abs_sub_comm l', + abs_of_nonneg (profile_nonneg _ _ _)] + _ ≤ |l-l'|/l+|l-l'|/l*1 := by + gcongr + exact profile_le_one _ hl' _ + _ = _ := by ring + +lemma profile_oscillation {θ θ' e : T} {l l' : ℝ} (hl : 0 < l) (hl' : 0 < l') : + |profile θ l e-profile θ' l' e| ≤ (dist θ θ'+2*|l-l'|)/l := by + calc + _ ≤ |profile θ l e-profile θ' l e|+|profile θ' l e-profile θ' l' e| := abs_sub_le _ _ _ + _ ≤ dist θ θ'/l+2*|l-l'|/l := add_le_add (profile_center_oscillation hl) (profile_radial_oscillation hl hl') + _ = _ := by ring + +variable [MeasurableSpace T] [BorelSpace T] (σ : Measure T) [IsFiniteMeasure σ] [CompactSpace T] + +def normalizer (θ : T) (l : ℝ) : ℝ := ∫ e, profile θ l e ∂σ + +lemma integrable_profile (θ : T) (l : ℝ) : Integrable (profile θ l) σ := by + have hh := (continuous_profile θ l).continuousOn.integrableOn_compact (μ := σ) isCompact_univ + simpa only [integrableOn_univ] using hh + +omit [BorelSpace T] [IsFiniteMeasure σ] [CompactSpace T] in +lemma normalizer_nonneg (θ : T) (l : ℝ) : 0 ≤ normalizer σ θ l := + integral_nonneg (profile_nonneg θ l) + +lemma normalizer_bounds (θ : T) {l : ℝ} (hl : 0 < l) : + (σ (ball θ (l/2))).toReal/2 ≤ normalizer σ θ l ∧ + normalizer σ θ l ≤ (σ (ball θ l)).toReal := by + have hlo (e : T) : (ball θ (l/2)).indicator (fun _ => (1/2:ℝ)) e ≤ profile θ l e := by + by_cases he : e ∈ ball θ (l/2) + · rw [indicator_of_mem he]; exact profile_half hl he + · rw [indicator_of_notMem he]; exact profile_nonneg _ _ _ + have hhi (e : T) : profile θ l e ≤ (ball θ l).indicator (fun _ => (1:ℝ)) e := by + by_cases he : e ∈ ball θ l + · rw [indicator_of_mem he]; exact profile_le_one _ hl _ + · rw [indicator_of_notMem he,profile_eq_zero hl he] + constructor + · have hh := integral_mono ((integrable_const (1/2:ℝ)).indicator measurableSet_ball) + (integrable_profile σ θ l) hlo + simpa only [integral_indicator measurableSet_ball,integral_const,Measure.real,Measure.restrict_apply_univ, + smul_eq_mul,one_mul,div_eq_mul_inv,normalizer] using hh + · have hh := integral_mono (integrable_profile σ θ l) + ((integrable_const (1:ℝ)).indicator measurableSet_ball) hhi + simpa only [integral_indicator measurableSet_ball,integral_const,Measure.real,Measure.restrict_apply_univ, + smul_eq_mul,one_mul,mul_one,normalizer] using hh + +lemma continuousOn_normalizer : ContinuousOn (fun z : T × ℝ => normalizer σ z.1 z.2) + {z | 0 < z.2} := by + apply continuousOn_integral_of_compact_support (μ := σ) isCompact_univ + · change ContinuousOn (fun z : (T × ℝ) × T => max (1-dist z.2 z.1.1/z.1.2) 0) + ({z : T × ℝ | 0 < z.2} ×ˢ univ) + apply ContinuousOn.sup _ continuousOn_const + apply continuousOn_const.sub + apply ContinuousOn.div + · exact (continuous_snd.dist continuous_fst.fst).continuousOn + · exact continuous_fst.snd.continuousOn + · intro z hz; exact ne_of_gt hz.1 + · intro p x hp hx + exact (hx (mem_univ x)).elim + +/-- Every cap is normalized exactly, with no rotational-invariance assumption. -/ +def normalized (θ : T) (l : ℝ) (e : T) : ℝ := profile θ l e / normalizer σ θ l + +omit [BorelSpace T] [IsFiniteMeasure σ] [CompactSpace T] in +lemma integral_normalized {θ : T} {l : ℝ} (hZ : normalizer σ θ l ≠ 0) : + (∫ e, normalized σ θ l e ∂σ) = 1 := by + unfold normalized + rw [integral_div,← normalizer,div_self hZ] + +omit [BorelSpace T] [IsFiniteMeasure σ] [CompactSpace T] in +lemma normalized_nonneg (θ : T) (l : ℝ) (e : T) : 0 ≤ normalized σ θ l e := + div_nonneg (profile_nonneg _ _ _) (normalizer_nonneg σ _ _) + +omit [BorelSpace T] [IsFiniteMeasure σ] [CompactSpace T] in +lemma normalized_le_inv (θ : T) {l : ℝ} (hl : 0 < l) (e : T) : + normalized σ θ l e ≤ (normalizer σ θ l)⁻¹ := by + simpa only [one_div,normalized] using div_le_div_of_nonneg_right (profile_le_one θ hl e) + (normalizer_nonneg σ θ l) + +lemma normalizer_oscillation {θ θ' : T} {l l' : ℝ} (hl : 0 < l) (hl' : 0 < l') + {Q : ℝ} (hQ : (dist θ θ'+2*|l-l'|)/l ≤ Q) : + |normalizer σ θ l-normalizer σ θ' l'| ≤ + Q*((σ (ball θ l)).toReal+(σ (ball θ' l')).toReal) := by + have hQ0 : 0 ≤ Q := (div_nonneg (by positivity) hl.le).trans hQ + let F := (ball θ l).indicator (fun _ => Q) + let G := (ball θ' l').indicator (fun _ => Q) + have hF : Integrable F σ := (integrable_const Q).indicator measurableSet_ball + have hG : Integrable G σ := (integrable_const Q).indicator measurableSet_ball + have hpt (e : T) : |profile θ l e-profile θ' l' e| ≤ F e+G e := by + have hh := (profile_oscillation (θ := θ) (θ' := θ') (e := e) hl hl').trans hQ + by_cases he : e ∈ ball θ l <;> by_cases he' : e ∈ ball θ' l' + · simp only [F,G,indicator_of_mem he,indicator_of_mem he']; linarith + · simpa only [F,G,indicator_of_mem he,indicator_of_notMem he',add_zero] using hh + · simpa only [F,G,indicator_of_notMem he,indicator_of_mem he',zero_add] using hh + · simp only [F,G,indicator_of_notMem he,indicator_of_notMem he', + profile_eq_zero hl he,profile_eq_zero hl' he',sub_self,abs_zero,add_zero,le_refl] + calc + _ = |∫ e, profile θ l e-profile θ' l' e ∂σ| := by + rw [integral_sub (integrable_profile σ _ _) (integrable_profile σ _ _)]; rfl + _ ≤ ∫ e, |profile θ l e-profile θ' l' e| ∂σ := abs_integral_le_integral_abs + _ ≤ ∫ e, F e+G e ∂σ := integral_mono + ((integrable_profile σ _ _).sub (integrable_profile σ _ _)).abs (hF.add hG) hpt + _ = _ := by + rw [integral_add hF hG] + simp only [F,G,integral_indicator measurableSet_ball,integral_const,Measure.real, + Measure.restrict_apply_univ,smul_eq_mul] + ring + +lemma normalized_oscillation {θ θ' : T} {l l' L U Q : ℝ} + (hl : 0 < l) (hl' : 0 < l') (hL : 0 < L) + (hZ : L ≤ normalizer σ θ l) (hZ' : L ≤ normalizer σ θ' l') + (hU : (σ (ball θ l)).toReal+(σ (ball θ' l')).toReal ≤ U) + (hQ : (dist θ θ'+2*|l-l'|)/l ≤ Q) (e : T) : + |normalized σ θ l e-normalized σ θ' l' e| ≤ (1/L+U/L^2)*Q := by + have hQ0 : 0 ≤ Q := (div_nonneg (by positivity) hl.le).trans hQ + have hU0 : 0 ≤ U := (add_nonneg ENNReal.toReal_nonneg ENNReal.toReal_nonneg).trans hU + have hp := (profile_oscillation (θ := θ) (θ' := θ') (e := e) hl hl').trans hQ + have hz := (normalizer_oscillation σ hl hl' hQ).trans (mul_le_mul_of_nonneg_left hU hQ0) + have hz0 : 0 < normalizer σ θ l := hL.trans_le hZ + have hz0' : 0 < normalizer σ θ' l' := hL.trans_le hZ' + have he : normalized σ θ l e-normalized σ θ' l' e = + (profile θ l e-profile θ' l' e)/normalizer σ θ l + + profile θ' l' e*(normalizer σ θ' l'-normalizer σ θ l)/ + (normalizer σ θ l*normalizer σ θ' l') := by + unfold normalized + field_simp [ne_of_gt hz0,ne_of_gt hz0'] + ring + rw [he] + calc + _ ≤ |(profile θ l e-profile θ' l' e)/normalizer σ θ l|+ + |profile θ' l' e*(normalizer σ θ' l'-normalizer σ θ l)/(normalizer σ θ l*normalizer σ θ' l')| := abs_add_le _ _ + _ = |profile θ l e-profile θ' l' e|/normalizer σ θ l+ + profile θ' l' e*|normalizer σ θ l-normalizer σ θ' l'|/ + (normalizer σ θ l*normalizer σ θ' l') := by + rw [abs_div,abs_div,abs_mul,abs_of_pos hz0,abs_of_pos (mul_pos hz0 hz0'), + abs_of_nonneg (profile_nonneg _ _ _),abs_sub_comm (normalizer σ θ' l')] + _ ≤ Q/L+1*(Q*U)/(L*L) := by + gcongr + exact profile_le_one _ hl' _ + _ = _ := by ring + +end HenonLaneEmden.CapWeights +end +end CapWeights + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/ComponentWeights.lean b/lean/OAI/Analysis/HenonEmden/ComponentWeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3c4613e91baae036f7691f5b92639d5db996229 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/ComponentWeights.lean @@ -0,0 +1,245 @@ +import OAI.Analysis.HenonEmden.Components + +namespace OAI + +universe uX uP + +section ComponentWeights +open MeasureTheory Set Filter Topology +open scoped ENNReal +open Classical +namespace HenonLaneEmden.LineComponents +variable {X : Type uX} [TopologicalSpace X] + +omit [TopologicalSpace X] in +lemma forwardExit_le_volume_component {U : Set (X × ℝ)} {p : X} + (_hp : (p,0) ∈ U) : + forwardExit U p ≤ volume (connectedComponentIn {s : ℝ | (p,s) ∈ U} 0) := by + unfold forwardExit + apply iSup_le + intro r + split_ifs with hr + · by_cases hpos : 0 ≤ (r : ℝ) + · have hs : uIcc 0 (r : ℝ) ⊆ connectedComponentIn {s : ℝ | (p,s) ∈ U} 0 := + isPreconnected_uIcc.subset_connectedComponentIn left_mem_uIcc hr + have hv := measure_mono (μ := (volume : Measure ℝ)) hs + simpa only [uIcc_of_le hpos,Real.volume_Icc,sub_zero] using hv + · simp only [ENNReal.ofReal_eq_zero.mpr (le_of_not_ge hpos),zero_le] + · exact bot_le + +omit [TopologicalSpace X] in +lemma backwardExit_le_volume_component {U : Set (X × ℝ)} {p : X} + (_hp : (p,0) ∈ U) : + backwardExit U p ≤ volume (connectedComponentIn {s : ℝ | (p,s) ∈ U} 0) := by + unfold backwardExit + apply iSup_le + intro r + split_ifs with hr + · by_cases hpos : 0 ≤ (r : ℝ) + · have hs : uIcc 0 (-(r : ℝ)) ⊆ connectedComponentIn {s : ℝ | (p,s) ∈ U} 0 := + isPreconnected_uIcc.subset_connectedComponentIn left_mem_uIcc hr + have hv := measure_mono (μ := (volume : Measure ℝ)) hs + simpa only [uIcc_of_ge (neg_nonpos.mpr hpos),Real.volume_Icc,zero_sub,neg_neg] using hv + · simp only [ENNReal.ofReal_eq_zero.mpr (le_of_not_ge hpos),zero_le] + · exact bot_le + +/-- The rational exit construction gives the genuine Lebesgue length, including +unbounded components, not merely the finite case. -/ +lemma volume_component_all {U : Set (X × ℝ)} (hU : IsOpen U) {p : X} + (hp : (p,0) ∈ U) : + volume (connectedComponentIn {s : ℝ | (p,s) ∈ U} 0) = componentLength U p := by + by_cases hfin : componentLength U p ≠ ⊤ + · exact volume_component hU hp hfin + · have ht : componentLength U p = ⊤ := not_ne_iff.mp hfin + rw [ht] + by_contra hv + apply hfin + exact ENNReal.add_ne_top.mpr + ⟨ne_top_of_le_ne_top hv (forwardExit_le_volume_component hp), + ne_top_of_le_ne_top hv (backwardExit_le_volume_component hp)⟩ + +/-- The family that observes a single real layer relative to a moving basepoint. -/ +def shiftedLayer (U : Set ℝ) : Set (ℝ × ℝ) := {z | z.1+z.2 ∈ U} + +lemma isOpen_shiftedLayer {U : Set ℝ} (hU : IsOpen U) : IsOpen (shiftedLayer U) := + hU.preimage (continuous_fst.add continuous_snd) + +lemma image_relative_component {U : Set ℝ} {x : ℝ} (hx : x ∈ U) : + (fun r : ℝ => x+r) '' connectedComponentIn {r : ℝ | (x,r) ∈ shiftedLayer U} 0 = + connectedComponentIn U x := by + let H := Homeomorph.addLeft x + have hs : H '' {r : ℝ | (x,r) ∈ shiftedLayer U} = U := by + change H '' H ⁻¹' U = U + exact image_preimage_eq U H.surjective + have hzero : 0 ∈ {r : ℝ | (x,r) ∈ shiftedLayer U} := by simpa [shiftedLayer] using hx + have hh := H.image_connectedComponentIn hzero + rw [hs] at hh + change (fun r : ℝ => x+r) '' connectedComponentIn {r : ℝ | (x,r) ∈ shiftedLayer U} 0 = + connectedComponentIn U (x+0) at hh + simpa only [add_zero] using hh + +lemma shifted_componentInf_eq {U : Set ℝ} (hU : IsOpen U) {x : ℝ} (hx : x ∈ U) + {f : ℝ → ℝ} (hf : Continuous f) : + componentInf (shiftedLayer U) (fun z => f (z.1+z.2)) x = + ⨅ y ∈ connectedComponentIn U x, ENNReal.ofReal (f y) := by + rw [componentInf_eq_component (isOpen_shiftedLayer hU) (by simpa [shiftedLayer] using hx) + (hf.comp (continuous_const.add continuous_id)), ← image_relative_component hx, iInf_image] + +lemma shifted_componentLength_eq {U : Set ℝ} (hU : IsOpen U) {x : ℝ} (hx : x ∈ U) : + componentLength (shiftedLayer U) x = volume (connectedComponentIn U x) := by + rw [← volume_component_all (isOpen_shiftedLayer hU) (by simpa [shiftedLayer] using hx), + ← image_relative_component hx] + have hm := measure_preimage_add volume x + ((fun r : ℝ => x+r) '' connectedComponentIn {r : ℝ | (x,r) ∈ shiftedLayer U} 0) + rw [preimage_image_eq _ (by intro a b hab; linarith : Function.Injective (fun r : ℝ => x+r))] at hm + exact hm + + +/-- A connected real set of finite length is bounded; this rules out every +unbounded line-component case without choosing fictitious infinite endpoints. -/ +lemma bounded_of_connected_volume_ne_top {I : Set ℝ} (hc : IsConnected I) + (hv : volume I ≠ ⊤) : BddBelow I ∧ BddAbove I := by + obtain ⟨x,hx⟩ := hc.nonempty + constructor + · by_contra h + have hs : Iio x ⊆ I := by + intro z hz + obtain ⟨y,hy,hyz⟩ := not_bddBelow_iff.mp h z + exact hc.Icc_subset hy hx ⟨hyz.le,hz.le⟩ + have hm := measure_mono (μ := (volume : Measure ℝ)) hs + rw [Real.volume_Iio] at hm + exact hv (top_le_iff.mp hm) + · by_contra h + have hs : Ioi x ⊆ I := by + intro z hz + obtain ⟨y,hy,hzy⟩ := not_bddAbove_iff.mp h z + exact hc.Icc_subset hx hy ⟨hz.le,hzy.le⟩ + have hm := measure_mono (μ := (volume : Measure ℝ)) hs + rw [Real.volume_Ioi] at hm + exact hv (top_le_iff.mp hm) + +noncomputable def setInf (f : ℝ → ℝ) (I : Set ℝ) : ℝ≥0∞ := + ⨅ y ∈ I, ENNReal.ofReal (f y) + +/-- The component weight, including the zero continuation when +the set is empty or the length condition fails. -/ +noncomputable def setWeight (h d : ℝ → ℝ) (δ : ℝ) (I : Set ℝ) : ℝ≥0∞ := + if I.Nonempty ∧ volume I ≠ ⊤ ∧ volume I ≤ ENNReal.ofReal (2*δ)*setInf d I + then setInf h I else 0 + +lemma setInf_le {f : ℝ → ℝ} {I : Set ℝ} {x : ℝ} (hx : x ∈ I) : + setInf f I ≤ ENNReal.ofReal (f x) := + iInf_le_of_le x (iInf_le_of_le hx le_rfl) + +lemma setWeight_le {h d : ℝ → ℝ} {δ : ℝ} {I : Set ℝ} {x : ℝ} (hx : x ∈ I) : + setWeight h d δ I ≤ ENNReal.ofReal (h x) := by + unfold setWeight + split_ifs + · exact setInf_le hx + · exact bot_le + +lemma setWeight_ne_top {h d : ℝ → ℝ} {δ : ℝ} {I : Set ℝ} : + setWeight h d δ I ≠ ⊤ := by + unfold setWeight + split_ifs with hI + · obtain ⟨x,hx⟩ := hI.1 + exact ne_top_of_le_ne_top ENNReal.ofReal_ne_top (setInf_le hx) + · exact ENNReal.zero_ne_top + +lemma setWeight_eq_zero_of_empty (h d : ℝ → ℝ) (δ : ℝ) : + setWeight h d δ ∅ = 0 := by simp [setWeight] + +lemma setWeight_pos_bounded {h d : ℝ → ℝ} {δ : ℝ} {I : Set ℝ} + (hc : IsConnected I) (hp : 0 < (setWeight h d δ I).toReal) : + BddBelow I ∧ BddAbove I := by + apply bounded_of_connected_volume_ne_top hc + unfold setWeight at hp + split_ifs at hp with hI + · exact hI.2.1 + · simp only [ENNReal.toReal_zero,lt_self_iff_false] at hp + +lemma componentWeight_eq_setWeight {U : Set (X × ℝ)} (hU : IsOpen U) + {h d : X × ℝ → ℝ} {p : X} (hh : Continuous (fun s => h (p,s))) + (hd : Continuous (fun s => d (p,s))) (δ : ℝ) : + componentWeight U h d δ p = setWeight (fun s => h (p,s)) (fun s => d (p,s)) δ + (connectedComponentIn {s | (p,s) ∈ U} 0) := by + by_cases hp : (p,0) ∈ U + · have hne : (connectedComponentIn {s | (p,s) ∈ U} 0).Nonempty := + ⟨0,mem_connectedComponentIn hp⟩ + simp only [componentWeight,setWeight,hp,hne,true_and,volume_component_all hU hp, + componentInf_eq_component hU hp hh,componentInf_eq_component hU hp hd,setInf] + · simp only [componentWeight,hp,false_and,ite_false, + connectedComponentIn_eq_empty (show 0 ∉ {s | (p,s) ∈ U} from hp), + setWeight_eq_zero_of_empty] + +lemma shifted_componentWeight_eq {U : Set ℝ} (hU : IsOpen U) + {h d : ℝ → ℝ} (hh : Continuous h) (hd : Continuous d) (δ x : ℝ) : + componentWeight (shiftedLayer U) (fun z => h (z.1+z.2)) + (fun z => d (z.1+z.2)) δ x = setWeight h d δ (connectedComponentIn U x) := by + by_cases hx : x ∈ U + · have hne : (connectedComponentIn U x).Nonempty := ⟨x,mem_connectedComponentIn hx⟩ + have hpx : (x,0) ∈ shiftedLayer U := by simpa [shiftedLayer] using hx + simp only [componentWeight,setWeight,hpx,hne,true_and, + shifted_componentLength_eq hU hx,shifted_componentInf_eq hU hx hh, + shifted_componentInf_eq hU hx hd,setInf] + · simp [componentWeight,shiftedLayer,hx,connectedComponentIn_eq_empty hx,setWeight] + +lemma measurable_setWeight_component {U : Set ℝ} (hU : IsOpen U) + {h d : ℝ → ℝ} (hh : Continuous h) (hd : Continuous d) (δ : ℝ) : + Measurable (fun x => setWeight h d δ (connectedComponentIn U x)) := by + have he : (fun x => setWeight h d δ (connectedComponentIn U x)) = + componentWeight (shiftedLayer U) (fun z => h (z.1+z.2)) (fun z => d (z.1+z.2)) δ := by + funext x + exact (shifted_componentWeight_eq hU hh hd δ x).symm + rw [he] + exact measurable_componentWeight (isOpen_shiftedLayer hU) + (hh.measurable.comp (measurable_fst.add measurable_snd)) + (hd.measurable.comp (measurable_fst.add measurable_snd)) δ + +section Parameter +variable {P : Type uP} [TopologicalSpace P] + +def relativeLayer (U : Set (P × ℝ)) : Set ((P × ℝ) × ℝ) := + {z | (z.1.1,z.1.2+z.2) ∈ U} + +lemma isOpen_relativeLayer {U : Set (P × ℝ)} (hU : IsOpen U) : IsOpen (relativeLayer U) := + hU.preimage ((continuous_fst.fst).prodMk (continuous_fst.snd.add continuous_snd)) + +lemma relative_componentWeight_eq {U : Set (P × ℝ)} (hU : IsOpen U) + {h d : P × ℝ → ℝ} (hh : Continuous h) (hd : Continuous d) (δ : ℝ) (p : P × ℝ) : + componentWeight (relativeLayer U) (fun z => h (z.1.1,z.1.2+z.2)) + (fun z => d (z.1.1,z.1.2+z.2)) δ p = + setWeight (fun s => h (p.1,s)) (fun s => d (p.1,s)) δ + (connectedComponentIn {s | (p.1,s) ∈ U} p.2) := by + have he := shifted_componentWeight_eq (isOpen_section hU p.1) + (h := fun s => h (p.1,s)) (d := fun s => d (p.1,s)) + (hh.comp (continuous_const.prodMk continuous_id)) + (hd.comp (continuous_const.prodMk continuous_id)) δ p.2 + simpa only [componentWeight,componentLength,forwardExit,backwardExit,componentInf, + SegmentInside,relativeLayer,shiftedLayer,Set.mem_ofPred] using he + + +variable [MeasurableSpace P] [BorelSpace P] +lemma measurable_parametric_setWeight {U : Set (P × ℝ)} (hU : IsOpen U) + {h d : P × ℝ → ℝ} (hh : Continuous h) (hd : Continuous d) (δ : ℝ) : + Measurable (fun p : P × ℝ => + setWeight (fun s => h (p.1,s)) (fun s => d (p.1,s)) δ + (connectedComponentIn {s | (p.1,s) ∈ U} p.2)) := by + have he : (fun p : P × ℝ => + setWeight (fun s => h (p.1,s)) (fun s => d (p.1,s)) δ + (connectedComponentIn {s | (p.1,s) ∈ U} p.2)) = + componentWeight (relativeLayer U) (fun z => h (z.1.1,z.1.2+z.2)) + (fun z => d (z.1.1,z.1.2+z.2)) δ := by + funext p + exact (relative_componentWeight_eq hU hh hd δ p).symm + rw [he] + exact measurable_componentWeight (isOpen_relativeLayer hU) + (hh.measurable.comp (measurable_fst.fst.prodMk (measurable_fst.snd.add measurable_snd))) + (hd.measurable.comp (measurable_fst.fst.prodMk (measurable_fst.snd.add measurable_snd))) δ + +end Parameter + +end HenonLaneEmden.LineComponents +end ComponentWeights + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Components.lean b/lean/OAI/Analysis/HenonEmden/Components.lean new file mode 100644 index 0000000000000000000000000000000000000000..58becac28fe4ca2e1a5bf2a77a28337b9ed28d63 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Components.lean @@ -0,0 +1,265 @@ +import OAI.Analysis.HenonEmden.CapContinuity + +namespace OAI + +universe uX + +section Components +open MeasureTheory Set Filter Topology +open scoped ENNReal +open Classical +namespace HenonLaneEmden.LineComponents + +variable {X : Type uX} [TopologicalSpace X] + +/-- All points of the closed segment between the base point `0` and `r` +remain in the open line layer. -/ +def SegmentInside (U : Set (X × ℝ)) (p : X) (r : ℝ) : Prop := + ∀ s ∈ uIcc 0 r, (p,s) ∈ U + +omit [TopologicalSpace X] in +lemma segmentInside_iff_mem_component {U : Set (X × ℝ)} {p : X} {r : ℝ} + (hp : (p,0) ∈ U) : + SegmentInside U p r ↔ r ∈ connectedComponentIn {s : ℝ | (p,s) ∈ U} 0 := by + constructor + · intro h + exact isPreconnected_uIcc.subset_connectedComponentIn left_mem_uIcc h right_mem_uIcc + · intro hr s hs + have hp' : 0 ∈ connectedComponentIn {s : ℝ | (p,s) ∈ U} 0 := mem_connectedComponentIn hp + exact connectedComponentIn_subset {s : ℝ | (p,s) ∈ U} 0 + (isPreconnected_connectedComponentIn.ordConnected.uIcc_subset hp' hr hs) + +omit [TopologicalSpace X] in +lemma segmentInside_zero {U : Set (X × ℝ)} {p : X} : + SegmentInside U p 0 ↔ (p,0) ∈ U := by simp [SegmentInside] + +omit [TopologicalSpace X] in +lemma segmentInside_base {U : Set (X × ℝ)} {p : X} {r : ℝ} + (h : SegmentInside U p r) : (p,0) ∈ U := h 0 left_mem_uIcc + +omit [TopologicalSpace X] in +lemma segmentInside_endpoint {U : Set (X × ℝ)} {p : X} {r : ℝ} + (h : SegmentInside U p r) : (p,r) ∈ U := h r right_mem_uIcc + +lemma isOpen_segmentInside {U : Set (X × ℝ)} (hU : IsOpen U) (r : ℝ) : + IsOpen {p : X | SegmentInside U p r} := by + rw [isOpen_iff_mem_nhds] + intro p hp + have hprod : ({p} : Set X) ×ˢ uIcc 0 r ⊆ U := by + rintro ⟨q,s⟩ ⟨hq,hs⟩ + obtain rfl := mem_singleton_iff.mp hq + exact hp s hs + obtain ⟨V,W,hV,-,hpV,hsegW,hVW⟩ := + generalized_tube_lemma isCompact_singleton isCompact_uIcc hU hprod + exact Filter.mem_of_superset (hV.mem_nhds (singleton_subset_iff.mp hpV)) + (fun q hq s hs => hVW ⟨hq,hsegW hs⟩) + +lemma isOpen_section {U : Set (X × ℝ)} (hU : IsOpen U) (p : X) : + IsOpen {s : ℝ | (p,s) ∈ U} := hU.preimage (continuous_const.prodMk continuous_id) + +/-- The rational definition makes joint measurability independent of coordinates +on the direction-dependent transverse hyperplanes. -/ +noncomputable def forwardExit (U : Set (X × ℝ)) (p : X) : ℝ≥0∞ := + ⨆ r : ℚ, if SegmentInside U p (r : ℝ) then ENNReal.ofReal (r : ℝ) else 0 + +noncomputable def backwardExit (U : Set (X × ℝ)) (p : X) : ℝ≥0∞ := + ⨆ r : ℚ, if SegmentInside U p (-(r : ℝ)) then ENNReal.ofReal (r : ℝ) else 0 + +noncomputable def componentLength (U : Set (X × ℝ)) (p : X) : ℝ≥0∞ := + forwardExit U p + backwardExit U p + +noncomputable def componentInf (U : Set (X × ℝ)) (value : X × ℝ → ℝ) (p : X) : ℝ≥0∞ := + ⨅ r : ℚ, if SegmentInside U p (r : ℝ) then ENNReal.ofReal (value (p,(r : ℝ))) else ⊤ + +omit [TopologicalSpace X] in +lemma componentInf_le_base {U : Set (X × ℝ)} (value : X × ℝ → ℝ) {p : X} + (hp : (p,0) ∈ U) : componentInf U value p ≤ ENNReal.ofReal (value (p,0)) := by + have h := iInf_le (fun r : ℚ => if SegmentInside U p (r : ℝ) + then ENNReal.ofReal (value (p,(r : ℝ))) else ⊤) 0 + simpa [componentInf, segmentInside_zero, hp] using h + +omit [TopologicalSpace X] in +lemma componentInf_ne_top {U : Set (X × ℝ)} (value : X × ℝ → ℝ) {p : X} + (hp : (p,0) ∈ U) : componentInf U value p ≠ ⊤ := + ne_top_of_le_ne_top ENNReal.ofReal_ne_top (componentInf_le_base value hp) + +noncomputable def componentWeight (U : Set (X × ℝ)) (h d : X × ℝ → ℝ) + (δ : ℝ) (p : X) : ℝ≥0∞ := + if (p,0) ∈ U ∧ componentLength U p ≠ ⊤ ∧ + componentLength U p ≤ ENNReal.ofReal (2*δ) * componentInf U d p + then componentInf U h p else 0 + +omit [TopologicalSpace X] in +lemma componentWeight_le_base {U : Set (X × ℝ)} (h d : X × ℝ → ℝ) (δ : ℝ) (p : X) : + componentWeight U h d δ p ≤ ENNReal.ofReal (h (p,0)) := by + unfold componentWeight + split_ifs with hp + · exact componentInf_le_base h hp.1 + · exact bot_le + +/-- The rational infimum equals the infimum over the genuine open component. -/ +lemma componentInf_eq_component {U : Set (X × ℝ)} (hU : IsOpen U) + {value : X × ℝ → ℝ} {p : X} (hp : (p,0) ∈ U) + (hv : Continuous (fun s : ℝ => value (p,s))) : + componentInf U value p = + ⨅ s ∈ connectedComponentIn {s : ℝ | (p,s) ∈ U} 0, ENNReal.ofReal (value (p,s)) := by + let C := connectedComponentIn {s : ℝ | (p,s) ∈ U} 0 + have hC : IsOpen C := (isOpen_section hU p).connectedComponentIn + have hclosed : IsClosed {s : ℝ | componentInf U value p ≤ ENNReal.ofReal (value (p,s))} := + isClosed_le continuous_const (ENNReal.continuous_ofReal.comp hv) + have hdense : C ⊆ closure (range ((↑) : ℚ → ℝ) ∩ C) := + by simpa [inter_comm] using Rat.denseRange_cast.open_subset_closure_inter hC + have hle : ∀ s ∈ C, componentInf U value p ≤ ENNReal.ofReal (value (p,s)) := by + intro s hs + apply closure_minimal (t := {s : ℝ | componentInf U value p ≤ ENNReal.ofReal (value (p,s))}) + ?_ hclosed (hdense hs) + rintro z ⟨⟨r,rfl⟩,hr⟩ + have hin := (segmentInside_iff_mem_component hp).mpr hr + have h := iInf_le (fun r : ℚ => if SegmentInside U p (r : ℝ) + then ENNReal.ofReal (value (p,(r : ℝ))) else ⊤) r + simpa only [Set.mem_ofPred_eq, componentInf, ite_eq_left hin] using h + apply le_antisymm + · exact le_iInf fun s => le_iInf fun hs => hle s hs + · unfold componentInf + apply le_iInf + intro r + split_ifs with hr + · exact iInf_le_of_le (r : ℝ) (iInf_le_of_le ((segmentInside_iff_mem_component hp).mp hr) le_rfl) + · exact le_top + +/-- Exceeding a nonnegative forward offset is precisely the compact-segment +condition. Openness is needed to replace membership of the endpoint by strict +inequality of the exit distance. -/ +lemma lt_forwardExit_iff {U : Set (X × ℝ)} (hU : IsOpen U) {p : X} {r : ℝ} + (hr : 0 ≤ r) : ENNReal.ofReal r < forwardExit U p ↔ SegmentInside U p r := by + unfold forwardExit + rw [lt_iSup_iff] + constructor + · rintro ⟨q,hq⟩ + split_ifs at hq with hin + · have hrq := (ENNReal.ofReal_lt_ofReal_iff_of_nonneg hr).mp hq + intro s hs + apply hin s + rw [uIcc_of_le (hr.trans hrq.le), mem_Icc] + rw [uIcc_of_le hr, mem_Icc] at hs + exact ⟨hs.1, hs.2.trans hrq.le⟩ + · exact (not_lt_zero hq).elim + · intro hin + have hp := segmentInside_base hin + have hrC := (segmentInside_iff_mem_component hp).mp hin + have hopen := (isOpen_section hU p).connectedComponentIn (x := 0) + obtain ⟨a,b,hab,hsub⟩ := mem_nhds_iff_exists_Ioo_subset.mp (hopen.mem_nhds hrC) + obtain ⟨q,hrq,hqb⟩ := exists_rat_btwn hab.2 + have hqC := hsub ⟨hab.1.trans hrq,hqb⟩ + refine ⟨q, ?_⟩ + rw [ite_eq_left ((segmentInside_iff_mem_component hp).mpr hqC)] + exact (ENNReal.ofReal_lt_ofReal_iff_of_nonneg hr).mpr hrq + +omit [TopologicalSpace X] in +lemma segmentInside_reflect {U : Set (X × ℝ)} {p : X} {r : ℝ} : + SegmentInside {z : X × ℝ | (z.1,-z.2) ∈ U} p r ↔ SegmentInside U p (-r) := by + constructor <;> intro h s hs + · have hm : -s ∈ uIcc 0 r := by + simp only [mem_uIcc] at hs ⊢ + rcases hs with hs | hs + · right; constructor <;> linarith + · left; constructor <;> linarith + simpa using h (-s) hm + · have hm : -s ∈ uIcc 0 (-r) := by + simp only [mem_uIcc] at hs ⊢ + rcases hs with hs | hs + · right; constructor <;> linarith + · left; constructor <;> linarith + simpa using h (-s) hm + +lemma lt_backwardExit_iff {U : Set (X × ℝ)} (hU : IsOpen U) {p : X} {r : ℝ} + (hr : 0 ≤ r) : ENNReal.ofReal r < backwardExit U p ↔ SegmentInside U p (-r) := by + have hV : IsOpen {z : X × ℝ | (z.1,-z.2) ∈ U} := + hU.preimage (continuous_fst.prodMk continuous_snd.neg) + have heq : backwardExit U p = forwardExit {z : X × ℝ | (z.1,-z.2) ∈ U} p := by + simp only [backwardExit, forwardExit, segmentInside_reflect] + rw [heq, lt_forwardExit_iff hV hr, segmentInside_reflect] + +lemma forwardExit_pos {U : Set (X × ℝ)} (hU : IsOpen U) {p : X} + (hp : (p,0) ∈ U) : 0 < forwardExit U p := by + simpa using (lt_forwardExit_iff hU (p := p) (r := 0) le_rfl).mpr + (segmentInside_zero.mpr hp) + +lemma backwardExit_pos {U : Set (X × ℝ)} (hU : IsOpen U) {p : X} + (hp : (p,0) ∈ U) : 0 < backwardExit U p := by + simpa using (lt_backwardExit_iff hU (p := p) (r := 0) le_rfl).mpr + (by simpa using (segmentInside_zero (p := p)).mpr hp) + +lemma component_eq_Ioo {U : Set (X × ℝ)} (hU : IsOpen U) {p : X} + (hp : (p,0) ∈ U) (hf : forwardExit U p ≠ ⊤) (hb : backwardExit U p ≠ ⊤) : + connectedComponentIn {s : ℝ | (p,s) ∈ U} 0 = + Ioo (-(backwardExit U p).toReal) (forwardExit U p).toReal := by + have hfp : 0 < (forwardExit U p).toReal := ENNReal.toReal_pos (forwardExit_pos hU hp).ne' hf + have hbp : 0 < (backwardExit U p).toReal := ENNReal.toReal_pos (backwardExit_pos hU hp).ne' hb + ext r + rw [← segmentInside_iff_mem_component hp, mem_Ioo] + by_cases hr : 0 ≤ r + · rw [← lt_forwardExit_iff hU hr, ENNReal.ofReal_lt_iff_lt_toReal hr hf] + exact ⟨fun h => ⟨by linarith,h⟩, fun h => h.2⟩ + · have hnr : 0 ≤ -r := by linarith + have he := lt_backwardExit_iff hU (p := p) hnr + rw [neg_neg] at he + rw [← he, ENNReal.ofReal_lt_iff_lt_toReal hnr hb] + constructor + · intro h; constructor <;> linarith + · intro h; linarith [h.1] + +lemma volume_component {U : Set (X × ℝ)} (hU : IsOpen U) {p : X} + (hp : (p,0) ∈ U) (hfin : componentLength U p ≠ ⊤) : + volume (connectedComponentIn {s : ℝ | (p,s) ∈ U} 0) = componentLength U p := by + have hf : forwardExit U p ≠ ⊤ := by + exact (ENNReal.add_ne_top.mp hfin).1 + have hb : backwardExit U p ≠ ⊤ := by + exact (ENNReal.add_ne_top.mp hfin).2 + rw [component_eq_Ioo hU hp hf hb, Real.volume_Ioo, sub_neg_eq_add] + rw [ENNReal.ofReal_add (ENNReal.toReal_nonneg) (ENNReal.toReal_nonneg), + ENNReal.ofReal_toReal hf, ENNReal.ofReal_toReal hb] + rfl + +section Measurability +variable [MeasurableSpace X] [BorelSpace X] + +lemma measurable_forwardExit {U : Set (X × ℝ)} (hU : IsOpen U) : Measurable (forwardExit U) := by + apply Measurable.iSup + intro r + exact Measurable.ite (isOpen_segmentInside hU (r : ℝ)).measurableSet + measurable_const measurable_const + +lemma measurable_backwardExit {U : Set (X × ℝ)} (hU : IsOpen U) : Measurable (backwardExit U) := by + apply Measurable.iSup + intro r + exact Measurable.ite (isOpen_segmentInside hU (-(r : ℝ))).measurableSet + measurable_const measurable_const + +lemma measurable_componentLength {U : Set (X × ℝ)} (hU : IsOpen U) : + Measurable (componentLength U) := + (measurable_forwardExit hU).add (measurable_backwardExit hU) + +lemma measurable_componentInf {U : Set (X × ℝ)} (hU : IsOpen U) + {value : X × ℝ → ℝ} (hvalue : Measurable value) : Measurable (componentInf U value) := by + apply Measurable.iInf + intro r + exact Measurable.ite (isOpen_segmentInside hU (r : ℝ)).measurableSet + ((hvalue.comp (measurable_id.prodMk measurable_const)).ennreal_ofReal) measurable_const + +lemma measurable_componentWeight {U : Set (X × ℝ)} (hU : IsOpen U) + {h d : X × ℝ → ℝ} (hh : Measurable h) (hd : Measurable d) (δ : ℝ) : + Measurable (componentWeight U h d δ) := by + apply Measurable.ite _ (measurable_componentInf hU hh) measurable_const + apply MeasurableSet.inter + · exact (hU.preimage (continuous_id.prodMk continuous_const)).measurableSet + · apply MeasurableSet.inter + · exact (measurable_componentLength hU (measurableSet_singleton ⊤)).compl + · exact measurableSet_le (measurable_componentLength hU) + (measurable_const.mul (measurable_componentInf hU hd)) + +end Measurability +end HenonLaneEmden.LineComponents +end Components + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Cutoff.lean b/lean/OAI/Analysis/HenonEmden/Cutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..ba22498a79aaa2fe1879774a56d1d2e66ae9c556 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Cutoff.lean @@ -0,0 +1,364 @@ +import OAI.Analysis.HenonEmden.SphereCaps + +namespace OAI + +universe uE + +section Cutoff + +open MeasureTheory Set Metric Filter Topology +noncomputable section +namespace HenonLaneEmden.Cutoff + +/-- The positive-part powers used by the compact cutoff. -/ +def posPow (k : ℕ) (r : ℝ) : ℝ := (max r 0)^k +lemma continuous_posPow (k : ℕ) : Continuous (posPow k) := by unfold posPow; fun_prop +lemma hasDerivAt_posPow {k : ℕ} (hk : 2 ≤ k) (r : ℝ) : + HasDerivAt (posPow k) ((k:ℝ)*(max r 0)^(k-1)) r := by + rcases lt_trichotomy r 0 with hr|rfl|hr + · have he : posPow k =ᶠ[𝓝 r] (fun _ => (0:ℝ)) := by + filter_upwards [eventually_lt_nhds hr] with t ht + simp [posPow,max_eq_right ht.le,show k ≠ 0 by omega] + simpa [max_eq_right hr.le,show k-1 ≠ 0 by omega] using + (hasDerivAt_const r (0:ℝ)).congr_of_eventuallyEq he + · have hleft : HasDerivWithinAt (posPow k) 0 (Iic (0:ℝ)) 0 := by + apply (hasDerivWithinAt_const 0 (Iic (0:ℝ)) (0:ℝ)).congr + · intro t ht; simp [posPow,max_eq_right (mem_Iic.mp ht),show k ≠ 0 by omega] + · simp [posPow,show k ≠ 0 by omega] + have hright : HasDerivWithinAt (posPow k) 0 (Ici (0:ℝ)) 0 := by + have hp : HasDerivWithinAt (fun t : ℝ => t^k) 0 (Ici (0:ℝ)) 0 := by + simpa [show k-1 ≠ 0 by omega] using (hasDerivAt_pow k (0:ℝ)).hasDerivWithinAt (s := Ici (0:ℝ)) + apply hp.congr + · intro t ht; simp [posPow,max_eq_left (mem_Ici.mp ht)] + · simp [posPow] + have hh := hleft.union hright + rw [Iic_union_Ici,hasDerivWithinAt_univ] at hh + simpa [show k-1 ≠ 0 by omega] using hh + · have he : posPow k =ᶠ[𝓝 r] (fun t => t^k) := by + filter_upwards [eventually_gt_nhds hr] with t ht + simp [posPow,max_eq_left ht.le] + simpa [max_eq_left hr.le] using (hasDerivAt_pow k r).congr_of_eventuallyEq he + +def m (n : ℕ) := n+3 +def k (n : ℕ) := n*(m n+1) +def N (n : ℕ) := k n+n+2 +lemma N_ge_two (n : ℕ) : 2 ≤ N n := by unfold N; omega +lemma N_ge_three {n : ℕ} (hn : 1 ≤ n) : 3 ≤ N n := by unfold N; omega + +def gapProfile (r : ℝ) : ℝ := min 1 (max (2-r) 0) +def baseProfile (r : ℝ) : ℝ := max (1-posPow 3 (r-1)) 0 +def etaProfile (n : ℕ) (r : ℝ) : ℝ := posPow (N n) (1-posPow 3 (r-1)) +def derivativeProfile (n : ℕ) (r : ℝ) : ℝ := + -(3*(N n:ℝ)*(max (r-1) 0)^2*(baseProfile r)^(N n-1)) +def wProfile (n : ℕ) (r : ℝ) : ℝ := -r*derivativeProfile n r + +lemma continuous_gapProfile : Continuous gapProfile := by unfold gapProfile; fun_prop +lemma continuous_baseProfile : Continuous baseProfile := by unfold baseProfile posPow; fun_prop +lemma continuous_etaProfile (n : ℕ) : Continuous (etaProfile n) := by + unfold etaProfile posPow; fun_prop +lemma continuous_derivativeProfile (n : ℕ) : Continuous (derivativeProfile n) := by + unfold derivativeProfile baseProfile posPow; fun_prop +lemma continuous_wProfile (n : ℕ) : Continuous (wProfile n) := by + unfold wProfile; exact continuous_id.neg.mul (continuous_derivativeProfile n) + +lemma hasDerivAt_etaProfile (n : ℕ) (r : ℝ) : + HasDerivAt (etaProfile n) (derivativeProfile n r) r := by + have h1 := (hasDerivAt_posPow (by omega : 2 ≤ 3) (r-1)).comp r + ((hasDerivAt_id r).sub_const 1) + have h2 := (hasDerivAt_posPow (N_ge_two n) (1-posPow 3 (r-1))).comp r (h1.const_sub 1) + apply h2.congr_deriv + simp only [derivativeProfile,baseProfile,Nat.cast_ofNat,mul_one,Nat.reduceSub] + ring + +lemma gapProfile_nonneg (r : ℝ) : 0 ≤ gapProfile r := + le_min (by norm_num) (le_max_right _ _) +lemma gapProfile_le_one (r : ℝ) : gapProfile r ≤ 1 := min_le_left _ _ +lemma baseProfile_nonneg (r : ℝ) : 0 ≤ baseProfile r := le_max_right _ _ +lemma baseProfile_le_one (r : ℝ) : baseProfile r ≤ 1 := by + apply max_le _ (by norm_num) + have hp : 0 ≤ posPow 3 (r-1) := pow_nonneg (le_max_right _ _) _ + linarith +lemma gapProfile_inner {r : ℝ} (hr : r ≤ 1) : gapProfile r = 1 := by + unfold gapProfile + rw [min_eq_left] + exact le_trans (by linarith) (le_max_left _ _) +lemma baseProfile_inner {r : ℝ} (hr : r ≤ 1) : baseProfile r = 1 := by + simp [baseProfile,posPow,max_eq_right (by linarith : r-1 ≤ 0)] +lemma gapProfile_outer {r : ℝ} (hr : 2 ≤ r) : gapProfile r = 0 := by + simp [gapProfile,max_eq_right (by linarith : 2-r ≤ 0)] +lemma baseProfile_outer {r : ℝ} (hr : 2 ≤ r) : baseProfile r = 0 := by + have hp : 1 ≤ (max (r-1) 0)^3 := one_le_pow₀ (by linarith [le_max_left (r-1) 0]) + exact max_eq_right (by dsimp [posPow]; linarith) +lemma gapProfile_middle {r : ℝ} (hr : 1 ≤ r) (hr' : r ≤ 2) : gapProfile r = 2-r := by + unfold gapProfile + rw [max_eq_left (by linarith),min_eq_right (by linarith)] +lemma baseProfile_middle {r : ℝ} (hr : 1 ≤ r) (hr' : r ≤ 2) : + baseProfile r = (2-r)*(1+(r-1)+(r-1)^2) := by + have hp : (r-1)^3 ≤ 1 := pow_le_one₀ (by linarith) (by linarith) + unfold baseProfile posPow + rw [max_eq_left (by linarith : 0 ≤ r-1),max_eq_left (by linarith)] + ring +lemma base_gap_bounds (r : ℝ) : gapProfile r ≤ baseProfile r ∧ baseProfile r ≤ 3*gapProfile r := by + by_cases h1 : r ≤ 1 + · rw [gapProfile_inner h1,baseProfile_inner h1]; norm_num + by_cases h2 : 2 ≤ r + · rw [gapProfile_outer h2,baseProfile_outer h2]; norm_num + have hr : 1 ≤ r := (not_le.mp h1).le + have hr' : r ≤ 2 := (not_le.mp h2).le + rw [gapProfile_middle hr hr',baseProfile_middle hr hr'] + have hs : (r-1)^2 ≤ 1 := pow_le_one₀ (by linarith) (by linarith) + constructor + · nlinarith [mul_nonneg (by linarith : 0 ≤ 2-r) (by positivity : 0 ≤ (r-1)^2)] + · nlinarith [mul_nonneg (by linarith : 0 ≤ 2-r) (by linarith : 0 ≤ 2-((r-1)+(r-1)^2))] +lemma etaProfile_eq_power (n : ℕ) (r : ℝ) : etaProfile n r = (baseProfile r)^(N n) := rfl +lemma etaProfile_bounds (n : ℕ) (r : ℝ) : + (gapProfile r)^(N n) ≤ etaProfile n r ∧ etaProfile n r ≤ 3^(N n)*(gapProfile r)^(N n) := by + rw [etaProfile_eq_power,← mul_pow] + exact ⟨pow_le_pow_left₀ (gapProfile_nonneg r) (base_gap_bounds r).1 _, + pow_le_pow_left₀ (baseProfile_nonneg r) (base_gap_bounds r).2 _⟩ +lemma derivativeProfile_inner (n : ℕ) {r : ℝ} (hr : r ≤ 1) : derivativeProfile n r = 0 := by + simp [derivativeProfile,max_eq_right (by linarith : r-1 ≤ 0)] +lemma derivativeProfile_outer (n : ℕ) {r : ℝ} (hr : 2 ≤ r) : derivativeProfile n r = 0 := by + simp [derivativeProfile,baseProfile_outer hr,show N n-1 ≠ 0 by have := N_ge_two n; omega] +lemma derivativeProfile_nonpos (n : ℕ) (r : ℝ) : derivativeProfile n r ≤ 0 := by + have hb := baseProfile_nonneg r + unfold derivativeProfile + exact neg_nonpos.mpr (by positivity) +lemma wProfile_nonneg (n : ℕ) {r : ℝ} (hr : 0 ≤ r) : 0 ≤ wProfile n r := + mul_nonneg_of_nonpos_of_nonpos (neg_nonpos.mpr hr) (derivativeProfile_nonpos n r) +lemma derivativeProfile_bound (n : ℕ) (r : ℝ) : + |derivativeProfile n r| ≤ 3*(N n:ℝ)*3^(N n-1)*(gapProfile r)^(N n-1) := by + have hb := baseProfile_nonneg r + have hg := gapProfile_nonneg r + by_cases h1 : r ≤ 1 + · rw [derivativeProfile_inner n h1,abs_zero]; positivity + by_cases h2 : 2 ≤ r + · rw [derivativeProfile_outer n h2,abs_zero]; positivity + have hs : (max (r-1) 0)^2 ≤ 1 := by + rw [max_eq_left (by linarith : 0 ≤ r-1)] + exact pow_le_one₀ (by linarith) (by linarith) + rw [abs_of_nonpos (derivativeProfile_nonpos n r),derivativeProfile,neg_neg] + calc + _ ≤ 3*(N n:ℝ)*1*(3*gapProfile r)^(N n-1) := by + gcongr + exact (base_gap_bounds r).2 + _ = _ := by rw [mul_pow]; ring +lemma wProfile_bound (n : ℕ) {r : ℝ} (_hr : 0 ≤ r) : + wProfile n r ≤ 6*(N n:ℝ)*3^(N n-1)*(gapProfile r)^(N n-1) := by + have hg := gapProfile_nonneg r + by_cases h2 : 2 ≤ r + · simp only [wProfile,derivativeProfile_outer n h2,mul_zero]; positivity + calc + _ = r*|derivativeProfile n r| := by rw [abs_of_nonpos (derivativeProfile_nonpos n r),wProfile]; ring + _ ≤ 2*(3*(N n:ℝ)*3^(N n-1)*(gapProfile r)^(N n-1)) := by + gcongr + · exact le_of_lt (not_le.mp h2) + · exact derivativeProfile_bound n r + _ = _ := by ring +lemma gap_wProfile_bound (n : ℕ) {r : ℝ} (_hr : 0 ≤ r) : + gapProfile r*wProfile n r ≤ 6*(N n:ℝ)*etaProfile n r := by + have hb := baseProfile_nonneg r + have hg := gapProfile_nonneg r + have hη : 0 ≤ etaProfile n r := pow_nonneg hb _ + by_cases h1 : r ≤ 1 + · simp only [wProfile,derivativeProfile_inner n h1,mul_zero]; positivity + by_cases h2 : 2 ≤ r + · simp only [wProfile,derivativeProfile_outer n h2,mul_zero]; positivity + have hs : (max (r-1) 0)^2 ≤ 1 := by + rw [max_eq_left (by linarith : 0 ≤ r-1)] + exact pow_le_one₀ (by linarith) (by linarith) + have hN : N n-1+1 = N n := Nat.sub_add_cancel (by have := N_ge_two n; omega) + calc + _ = 3*(N n:ℝ)*r*(max (r-1) 0)^2*(gapProfile r*(baseProfile r)^(N n-1)) := by + unfold wProfile derivativeProfile; ring + _ ≤ 3*(N n:ℝ)*2*1*(baseProfile r*(baseProfile r)^(N n-1)) := by + gcongr + · exact le_of_lt (not_le.mp h2) + · exact (base_gap_bounds r).1 + _ = _ := by + have hpow : (baseProfile r)^(N n) = (baseProfile r)^(N n-1)*baseProfile r := by + nth_rw 1 [← hN]; rw [pow_succ] + rw [etaProfile_eq_power,hpow]; ring + +def secondProfile (n : ℕ) (r : ℝ) : ℝ := + -6*(N n:ℝ)*max (r-1) 0*(baseProfile r)^(N n-1) + + 9*(N n:ℝ)*(N n-1)*((max (r-1) 0)^4)*(baseProfile r)^(N n-2) + +lemma continuous_secondProfile (n : ℕ) : Continuous (secondProfile n) := by + unfold secondProfile baseProfile posPow; fun_prop + +lemma hasDerivAt_derivativeProfile {n : ℕ} (hn : 1 ≤ n) (r : ℝ) : + HasDerivAt (derivativeProfile n) (secondProfile n r) r := by + have hN := N_ge_three hn + have h1 := (hasDerivAt_posPow (by omega : 2 ≤ 3) (r-1)).comp r + ((hasDerivAt_id r).sub_const 1) + have h2 := (hasDerivAt_posPow (by omega : 2 ≤ N n-1) (1-posPow 3 (r-1))).comp r + (h1.const_sub 1) + have h3 := (hasDerivAt_posPow (by omega : 2 ≤ 2) (r-1)).comp r + ((hasDerivAt_id r).sub_const 1) + have hh := ((h3.const_mul (3*(N n:ℝ))).mul h2).neg + apply hh.congr_deriv + simp only [Function.comp_def, id_eq, posPow,Nat.cast_ofNat,mul_one,Nat.reduceSub,pow_one, + show N n-1-1 = N n-2 by omega] + rw [Nat.cast_sub (by omega : 1 ≤ N n)] + simp only [Nat.cast_one,secondProfile,baseProfile,posPow] + ring + +lemma secondProfile_inner (n : ℕ) {r : ℝ} (hr : r ≤ 1) : secondProfile n r = 0 := by + simp [secondProfile,max_eq_right (by linarith : r-1 ≤ 0)] +lemma secondProfile_outer {n : ℕ} (hn : 1 ≤ n) {r : ℝ} (hr : 2 ≤ r) : + secondProfile n r = 0 := by + have := N_ge_three hn + simp [secondProfile,baseProfile_outer hr,show N n-1 ≠ 0 by omega, + show N n-2 ≠ 0 by omega] + +lemma secondProfile_bound {n : ℕ} (hn : 1 ≤ n) (r : ℝ) : + |secondProfile n r| ≤ (6*(N n:ℝ)+9*(N n:ℝ)*(N n-1))* + 3^(N n-2)*(gapProfile r)^(N n-2) := by + have hN := N_ge_three hn + have hn0 : (0:ℝ) ≤ N n-1 := by + have : (3:ℝ) ≤ N n := by exact_mod_cast hN + linarith + have hb := baseProfile_nonneg r + have hg := gapProfile_nonneg r + by_cases h1 : r ≤ 1 + · rw [secondProfile_inner n h1,abs_zero]; positivity + by_cases h2 : 2 ≤ r + · rw [secondProfile_outer hn h2,abs_zero]; positivity + have hs0 : 0 ≤ max (r-1) 0 := le_max_right _ _ + have hs1 : max (r-1) 0 ≤ 1 := by apply max_le <;> linarith + have hs4 : (max (r-1) 0)^4 ≤ 1 := pow_le_one₀ hs0 hs1 + have hp := pow_le_pow_of_le_one hb (baseProfile_le_one r) (by omega : N n-2 ≤ N n-1) + have hp' := pow_le_pow_left₀ hb (base_gap_bounds r).2 (N n-2) + calc + _ ≤ 6*(N n:ℝ)*max (r-1) 0*(baseProfile r)^(N n-1) + + 9*(N n:ℝ)*(N n-1)*(max (r-1) 0)^4*(baseProfile r)^(N n-2) := by + unfold secondProfile + calc + _ ≤ |-6*(N n:ℝ)*max (r-1) 0*(baseProfile r)^(N n-1)| + + |9*(N n:ℝ)*(N n-1)*(max (r-1) 0)^4*(baseProfile r)^(N n-2)| := abs_add_le _ _ + _ = _ := by + rw [abs_of_nonpos (by + have hp : 0 ≤ 6*(N n:ℝ)*max (r-1) 0*(baseProfile r)^(N n-1) := by positivity + nlinarith),abs_of_nonneg (by positivity)] + ring + _ ≤ 6*(N n:ℝ)*1*((3*gapProfile r)^(N n-2)) + + 9*(N n:ℝ)*(N n-1)*1*((3*gapProfile r)^(N n-2)) := by + gcongr + exact hp.trans hp' + _ = _ := by rw [mul_pow]; ring + +lemma lipschitz_gapProfile : LipschitzWith 1 gapProfile := by + have hh : LipschitzWith 1 (fun r : ℝ => 2-r) := by + apply LipschitzWith.of_dist_le_mul + intro r s + simp only [NNReal.coe_one,one_mul,Real.dist_eq] + rw [show (2-r)-(2-s) = -(r-s) by ring,abs_neg] + exact (hh.max_const 0).const_min 1 + +lemma gapProfile_oscillation (r s : ℝ) : |gapProfile r-gapProfile s| ≤ |r-s| := by + simpa only [Real.dist_eq,NNReal.coe_one,one_mul] using lipschitz_gapProfile.dist_le_mul r s + +def derivativeConstant (n : ℕ) : ℝ := 3*(N n:ℝ)*3^(N n-1) +def secondConstant (n : ℕ) : ℝ := (6*(N n:ℝ)+9*(N n:ℝ)*(N n-1))*3^(N n-2) +def wDerivativeConstant (n : ℕ) : ℝ := derivativeConstant n+2*secondConstant n + +def wDerivativeProfile (n : ℕ) (r : ℝ) : ℝ := -derivativeProfile n r-r*secondProfile n r + +lemma hasDerivAt_wProfile {n : ℕ} (hn : 1 ≤ n) (r : ℝ) : + HasDerivAt (wProfile n) (wDerivativeProfile n r) r := by + exact ((hasDerivAt_id r).neg.mul (hasDerivAt_derivativeProfile hn r)).congr_deriv (by + simp only [wDerivativeProfile,Pi.neg_apply,id_eq]; ring) + +lemma constants_nonneg (n : ℕ) : 0 ≤ derivativeConstant n ∧ 0 ≤ secondConstant n ∧ 0 ≤ wDerivativeConstant n := by + have hn : (0:ℝ) ≤ N n-1 := by + have : (2:ℝ) ≤ N n := by exact_mod_cast N_ge_two n + linarith + dsimp [derivativeConstant,secondConstant,wDerivativeConstant] + constructor + · positivity + constructor <;> positivity + +lemma wDerivativeProfile_bound {n : ℕ} (hn : 1 ≤ n) {r : ℝ} (hr : 0 ≤ r) : + |wDerivativeProfile n r| ≤ wDerivativeConstant n*(gapProfile r)^(N n-2) := by + have hN := N_ge_three hn + have hc := constants_nonneg n + have hg := gapProfile_nonneg r + by_cases h2 : 2 ≤ r + · simp only [wDerivativeProfile,derivativeProfile_outer n h2,secondProfile_outer hn h2, + neg_zero,mul_zero,sub_zero,abs_zero] + exact mul_nonneg hc.2.2 (pow_nonneg hg _) + have hp := pow_le_pow_of_le_one hg (gapProfile_le_one r) (by omega : N n-2 ≤ N n-1) + calc + _ ≤ |derivativeProfile n r|+r*|secondProfile n r| := by + unfold wDerivativeProfile + simpa only [sub_zero,zero_sub,abs_neg,abs_mul,abs_of_nonneg hr] using abs_sub_le (-derivativeProfile n r) 0 (r*secondProfile n r) + _ ≤ derivativeConstant n*(gapProfile r)^(N n-2)+ + 2*(secondConstant n*(gapProfile r)^(N n-2)) := by + apply add_le_add + · exact (derivativeProfile_bound n r).trans (mul_le_mul_of_nonneg_left hp hc.1) + · apply mul_le_mul (by linarith) (secondProfile_bound hn r) (abs_nonneg _) (by norm_num) + _ = _ := by unfold wDerivativeConstant; ring + +lemma wProfile_oscillation {n : ℕ} (hn : 1 ≤ n) {r s D : ℝ} (_hD : 0 ≤ D) + (hseg : ∀ t ∈ uIcc r s, 0 ≤ t ∧ gapProfile t ≤ D) : + |wProfile n s-wProfile n r| ≤ wDerivativeConstant n*D^(N n-2)*|s-r| := by + have hh := (convex_uIcc r s).norm_image_sub_le_of_norm_hasDerivWithin_le + (fun t _ => (hasDerivAt_wProfile hn t).hasDerivWithinAt) + (show ∀ t ∈ uIcc r s, ‖wDerivativeProfile n t‖ ≤ wDerivativeConstant n*D^(N n-2) from by + intro t ht + rw [Real.norm_eq_abs] + exact (wDerivativeProfile_bound hn (hseg t ht).1).trans + (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (gapProfile_nonneg t) (hseg t ht).2 _) (constants_nonneg n).2.2)) + left_mem_uIcc right_mem_uIcc + simpa only [Real.norm_eq_abs] using hh + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def d (x : E) : ℝ := gapProfile ‖x‖ +def eta (n : ℕ) (x : E) : ℝ := etaProfile n ‖x‖ +def w (n : ℕ) (x : E) : ℝ := -(fderiv ℝ (eta n : E → ℝ) x x) +def X (n : ℕ) (x : E) : E := eta n x • x + +omit [InnerProductSpace ℝ E] in +lemma continuous_d : Continuous (d : E → ℝ) := continuous_gapProfile.comp continuous_norm +omit [InnerProductSpace ℝ E] in +lemma continuous_eta (n : ℕ) : Continuous (eta n : E → ℝ) := + (continuous_etaProfile n).comp continuous_norm +omit [InnerProductSpace ℝ E] in +lemma eta_eq_one {n : ℕ} {x : E} (hx : ‖x‖ ≤ 1) : eta n x = 1 := by + simp [eta,etaProfile,posPow,max_eq_right (by linarith : ‖x‖-1 ≤ 0)] +omit [InnerProductSpace ℝ E] in +lemma eta_eq_zero {n : ℕ} {x : E} (hx : 2 ≤ ‖x‖) : eta n x = 0 := by + have hs : 1 ≤ (max (‖x‖-1) 0)^3 := by + exact one_le_pow₀ (by linarith [le_max_left (‖x‖-1) 0]) + simp [eta,etaProfile,posPow,max_eq_right (by linarith : 1-(max (‖x‖-1) 0)^3 ≤ 0), + show N n ≠ 0 by have := N_ge_two n; omega] + +lemma hasFDerivAt_eta (n : ℕ) (x : E) : + HasFDerivAt (eta n) ((derivativeProfile n ‖x‖/‖x‖) • innerSL ℝ x) x := by + by_cases hx : x = 0 + · subst x + have he : (eta n : E → ℝ) =ᶠ[𝓝 0] (fun _ => (1:ℝ)) := by + filter_upwards [Metric.ball_mem_nhds (0:E) (by norm_num : (0:ℝ)<1)] with y hy + exact eta_eq_one (mem_ball_zero_iff.mp hy).le + simpa using (hasFDerivAt_const (1:ℝ) (0:E)).congr_of_eventuallyEq he + · exact RadialCalculus.hasFDerivAt_profile_norm hx (hasDerivAt_etaProfile n ‖x‖) + +lemma w_eq_profile (n : ℕ) (x : E) : w n x = wProfile n ‖x‖ := by + rw [w,(hasFDerivAt_eta n x).fderiv] + simp only [smul_apply,innerSL_apply_apply,smul_eq_mul,real_inner_self_eq_norm_sq,wProfile] + by_cases hx : x = 0 + · subst x; simp + · have hn := norm_ne_zero_iff.mpr hx + field_simp + +lemma continuous_w (n : ℕ) : Continuous (w n : E → ℝ) := by + rw [show (w n : E → ℝ) = fun x => wProfile n ‖x‖ from funext (w_eq_profile n)] + exact (continuous_wProfile n).comp continuous_norm + +end HenonLaneEmden.Cutoff +end +end Cutoff + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/CutoffOscillation.lean b/lean/OAI/Analysis/HenonEmden/CutoffOscillation.lean new file mode 100644 index 0000000000000000000000000000000000000000..811e29d5f6b5cfa969a22cf8783fdea1ee1041ee --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/CutoffOscillation.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.HenonEmden.Cutoff + +namespace OAI + +universe uE + +section CutoffOscillation + +open Set Metric +noncomputable section +namespace HenonLaneEmden.Cutoff + +variable {E : Type uE} [NormedAddCommGroup E] + +lemma d_nonneg (x : E) : 0 ≤ d x := gapProfile_nonneg _ +lemma d_le_one (x : E) : d x ≤ 1 := gapProfile_le_one _ +lemma d_pos_iff (x : E) : 0 < d x ↔ ‖x‖ < 2 := by + simp only [d,gapProfile,lt_min_iff,lt_max_iff,lt_self_iff_false,or_false] + constructor + · intro h; linarith [h.2] + · intro h; constructor <;> linarith + +lemma d_oscillation (x y : E) : |d x-d y| ≤ dist x y := by + exact (gapProfile_oscillation ‖x‖ ‖y‖).trans (by simpa only [dist_eq_norm] using abs_norm_sub_norm_le x y) + +lemma pow_d_le_self (x : E) {j : ℕ} (hj : 1 ≤ j) : (d x)^j ≤ d x := by + simpa only [pow_one] using pow_le_pow_of_le_one (d_nonneg x) (d_le_one x) hj + +lemma close_gap_comparable {x y : E} {δ : ℝ} (hδ : 0 ≤ δ) (hδ' : δ ≤ 1/2) + {j : ℕ} (hj : 1 ≤ j) (hxy : dist x y ≤ δ*(d x)^j) : + d x/2 ≤ d y ∧ d y ≤ 2*d x := by + have hdist : dist x y ≤ δ*d x := hxy.trans (mul_le_mul_of_nonneg_left (pow_d_le_self x hj) hδ) + have hg := abs_le.mp (d_oscillation x y) + have hd := d_nonneg x + constructor <;> nlinarith + +lemma norm_segment_gap {x y : E} {D : ℝ} (hD : d x+dist x y ≤ D) + {t : ℝ} (ht : t ∈ uIcc ‖x‖ ‖y‖) : 0 ≤ t ∧ gapProfile t ≤ D := by + refine ⟨le_trans (le_min (norm_nonneg _) (norm_nonneg _)) ht.1,?_⟩ + have hdist : |t-‖x‖| ≤ |‖y‖-‖x‖| := by + exact (abs_sub_le_iff.mpr ⟨by + have hmax : max ‖x‖ ‖y‖ ≤ ‖x‖+|‖y‖-‖x‖| := by + apply max_le + · linarith [abs_nonneg (‖y‖-‖x‖)] + · linarith [le_abs_self (‖y‖-‖x‖)] + linarith [ht.2] + ,by + have hmin : ‖x‖-|‖y‖-‖x‖| ≤ min ‖x‖ ‖y‖ := by + apply le_min + · linarith [abs_nonneg (‖y‖-‖x‖)] + · linarith [neg_abs_le (‖y‖-‖x‖)] + linarith [ht.1]⟩) + have hn : |‖y‖-‖x‖| ≤ dist x y := by + simpa only [dist_comm x y,dist_eq_norm] using abs_norm_sub_norm_le y x + have hg := (abs_le.mp (gapProfile_oscillation t ‖x‖)).2 + change gapProfile t ≤ D + change gapProfile ‖x‖+dist x y ≤ D at hD + linarith + +variable [InnerProductSpace ℝ E] +lemma w_oscillation {n : ℕ} (hn : 1 ≤ n) {x y : E} {D : ℝ} (hD : 0 ≤ D) + (hxy : d x+dist x y ≤ D) : + |w n y-w n x| ≤ wDerivativeConstant n*D^(N n-2)*dist x y := by + rw [w_eq_profile,w_eq_profile] + have hh := wProfile_oscillation hn hD (fun _ ht => norm_segment_gap hxy ht) + have hn' : |‖y‖-‖x‖| ≤ dist x y := by + simpa only [dist_comm x y,dist_eq_norm] using abs_norm_sub_norm_le y x + exact hh.trans (mul_le_mul_of_nonneg_left hn' (mul_nonneg (constants_nonneg n).2.2 (pow_nonneg hD _))) + +end HenonLaneEmden.Cutoff +end +end CutoffOscillation + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/CutoffSmooth.lean b/lean/OAI/Analysis/HenonEmden/CutoffSmooth.lean new file mode 100644 index 0000000000000000000000000000000000000000..74cc2c553e7183e0774435d3dfb955ee0dff646c --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/CutoffSmooth.lean @@ -0,0 +1,37 @@ +import OAI.Analysis.HenonEmden.RadialIntegration + +namespace OAI + +universe uE + +section CutoffSmooth + +open MeasureTheory Set Filter Topology Metric +noncomputable section +namespace HenonLaneEmden.Cutoff + +lemma contDiff_etaProfile {n : ℕ} (hn : 1 ≤ n) : ContDiff ℝ 2 (etaProfile n) := by + have hd : deriv (etaProfile n) = derivativeProfile n := funext (fun r => (hasDerivAt_etaProfile n r).deriv) + rw [show (2 : WithTop ℕ∞) = 1+1 by norm_num,contDiff_succ_iff_deriv] + refine ⟨fun r => (hasDerivAt_etaProfile n r).differentiableAt, by simp, ?_⟩ + rw [hd,contDiff_one_iff_deriv] + refine ⟨fun r => (hasDerivAt_derivativeProfile hn r).differentiableAt, ?_⟩ + convert continuous_secondProfile n using 1 + exact funext (fun r => (hasDerivAt_derivativeProfile hn r).deriv) + +lemma contDiff_eta {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + {n : ℕ} (hn : 1 ≤ n) : ContDiff ℝ 2 (eta n : E → ℝ) := by + rw [contDiff_iff_contDiffAt] + intro x + by_cases hx : x = 0 + · subst x + apply contDiffAt_const.congr_of_eventuallyEq + filter_upwards [Metric.ball_mem_nhds (0:E) (by norm_num : (0:ℝ)<1)] with y hy + exact eta_eq_one (mem_ball_zero_iff.mp hy).le + · exact (contDiff_etaProfile hn).contDiffAt.comp _ (contDiffAt_norm ℝ hx) + +end HenonLaneEmden.Cutoff +end +end CutoffSmooth + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/CutoffTaylor.lean b/lean/OAI/Analysis/HenonEmden/CutoffTaylor.lean new file mode 100644 index 0000000000000000000000000000000000000000..29aab5ab1086bd306738ec5904cffb379b2516a8 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/CutoffTaylor.lean @@ -0,0 +1,81 @@ +import OAI.Analysis.HenonEmden.AngularPressure + +namespace OAI + +universe uE + +section CutoffTaylor + +open Set Metric +noncomputable section +namespace HenonLaneEmden.Cutoff + +lemma derivativeProfile_oscillation {n : ℕ} (hn : 1 ≤ n) {r s D : ℝ} + (hseg : ∀ t ∈ uIcc r s, gapProfile t ≤ D) : + |derivativeProfile n s-derivativeProfile n r| ≤ secondConstant n*D^(N n-2)*|s-r| := by + have hh := (convex_uIcc r s).norm_image_sub_le_of_norm_hasDerivWithin_le + (fun t _ => (hasDerivAt_derivativeProfile hn t).hasDerivWithinAt) + (show ∀ t ∈ uIcc r s, ‖secondProfile n t‖ ≤ secondConstant n*D^(N n-2) from by + intro t ht + rw [Real.norm_eq_abs] + exact (secondProfile_bound hn t).trans + (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (gapProfile_nonneg t) (hseg t ht) _) (constants_nonneg n).2.1)) + left_mem_uIcc right_mem_uIcc + simpa only [Real.norm_eq_abs] using hh + +lemma etaProfile_oscillation (n : ℕ) {r s D : ℝ} + (hseg : ∀ t ∈ uIcc r s, gapProfile t ≤ D) : + |etaProfile n s-etaProfile n r| ≤ derivativeConstant n*D^(N n-1)*|s-r| := by + have hh := (convex_uIcc r s).norm_image_sub_le_of_norm_hasDerivWithin_le + (fun t _ => (hasDerivAt_etaProfile n t).hasDerivWithinAt) + (show ∀ t ∈ uIcc r s, ‖derivativeProfile n t‖ ≤ derivativeConstant n*D^(N n-1) from by + intro t ht + rw [Real.norm_eq_abs] + exact (derivativeProfile_bound n t).trans + (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (gapProfile_nonneg t) (hseg t ht) _) (constants_nonneg n).1)) + left_mem_uIcc right_mem_uIcc + simpa only [Real.norm_eq_abs] using hh + +lemma abs_sub_left_le_of_mem_uIcc {r s t : ℝ} (ht : t ∈ uIcc r s) : |t-r| ≤ |s-r| := by + rcases le_total r s with h | h + · rw [uIcc_of_le h] at ht + rw [abs_of_nonneg (sub_nonneg.mpr ht.1),abs_of_nonneg (sub_nonneg.mpr h)] + linarith [ht.2] + · rw [uIcc_of_ge h] at ht + rw [abs_of_nonpos (sub_nonpos.mpr ht.2),abs_of_nonpos (sub_nonpos.mpr h)] + linarith [ht.1] + +lemma etaProfile_taylor {n : ℕ} (hn : 1 ≤ n) {r s D : ℝ} (hD : 0 ≤ D) + (hseg : ∀ t ∈ uIcc r s, gapProfile t ≤ D) : + |etaProfile n s-etaProfile n r-derivativeProfile n r*(s-r)| ≤ + secondConstant n*D^(N n-2)*(s-r)^2 := by + let F (t : ℝ) := etaProfile n t-derivativeProfile n r*t + have hF (t) : HasDerivAt F (derivativeProfile n t-derivativeProfile n r) t := by + convert (hasDerivAt_etaProfile n t).sub ((hasDerivAt_id t).const_mul (derivativeProfile n r)) using 1 <;> first | rfl | simp only [mul_one] + have hh := (convex_uIcc r s).norm_image_sub_le_of_norm_hasDerivWithin_le + (fun t _ => (hF t).hasDerivWithinAt) + (show ∀ t ∈ uIcc r s, ‖derivativeProfile n t-derivativeProfile n r‖ ≤ secondConstant n*D^(N n-2)*|s-r| from by + intro t ht + rw [Real.norm_eq_abs] + exact (derivativeProfile_oscillation hn (fun z hz => hseg z (uIcc_subset_uIcc_left ht hz))).trans + (mul_le_mul_of_nonneg_left (abs_sub_left_le_of_mem_uIcc ht) + (mul_nonneg (constants_nonneg n).2.1 (pow_nonneg hD _)))) + left_mem_uIcc right_mem_uIcc + simpa only [F,Real.norm_eq_abs,show etaProfile n s-derivativeProfile n r*s-(etaProfile n r-derivativeProfile n r*r) = + etaProfile n s-etaProfile n r-derivativeProfile n r*(s-r) by ring,mul_assoc,← sq, sq_abs] using hh + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +omit [InnerProductSpace ℝ E] in +lemma eta_oscillation (n : ℕ) {x y : E} {D : ℝ} (hD : 0 ≤ D) + (hxy : d x+dist x y ≤ D) : + |eta n y-eta n x| ≤ derivativeConstant n*D^(N n-1)*dist x y := by + have hh := etaProfile_oscillation n (fun t ht => (norm_segment_gap hxy ht).2) + exact hh.trans (mul_le_mul_of_nonneg_left + (by simpa only [dist_comm x y,dist_eq_norm] using abs_norm_sub_norm_le y x) + (mul_nonneg (constants_nonneg n).1 (pow_nonneg hD _))) + +end HenonLaneEmden.Cutoff +end +end CutoffTaylor + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/DirectionalPressure.lean b/lean/OAI/Analysis/HenonEmden/DirectionalPressure.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4ae9dee0844b1d00752c631446cca3424cdf649 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/DirectionalPressure.lean @@ -0,0 +1,36 @@ +import OAI.Analysis.HenonEmden.PressureMismatch + +namespace OAI + +section DirectionalPressure + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap LayerPressure + +lemma IsSolution_directional_pressure {n : ℕ} (hn : 3 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) (e : sphere (0:Space n) 1) : + ENNReal.ofReal (1/(q+1))*weightedEnergyN (weight volume κ e) u q B+ + ENNReal.ofReal (1/(p+1))*weightedEnergyN (weight volume κ e) v p A ≤ + capPressureIntegral (source u q B) (source v p A) κ e+ + capMismatchIntegral (source u q B) (source v p A) κ e+ + 2*(lossIntegral u (source u q B) κ δ e+lossIntegral v (source v p A) κ δ e)+ + (ENNReal.ofReal (endpointConstant q B*δ)*weightedEnergyN (fun x => d x*weight volume κ e x) u q B+ + ENNReal.ofReal (endpointConstant p A*δ)*weightedEnergyN (fun x => d x*weight volume κ e x) v p A) := by + apply pressure_cancellation + (ENNReal.add_ne_top.mpr ⟨IsSolution_endpointIntegral_finite (by omega) h hq hκ hκ1 hδ e, + IsSolution_endpointIntegral_finite (by omega) h.swap hp hκ hκ1 hδ e⟩) + (IsSolution_pressure_comparison hn h hp hq hκ hκ1 hδ e) _ + (IsSolution_pairMismatch_bound hn h hp hq hκ hκ1 e) + have hf := IsSolution_integrated_pressure_recovery (by omega : 2 ≤ n) h hq hκ hκ1 hδ e + have hg := IsSolution_integrated_pressure_recovery (by omega : 2 ≤ n) h.swap hp hκ hκ1 hδ e + convert add_le_add hf hg using 1 <;> first | rfl | ac_rfl + +end HenonLaneEmden.SpatialComponents +end +end DirectionalPressure + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Distribution.lean b/lean/OAI/Analysis/HenonEmden/Distribution.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb3e1515385960e39ecd7a07efede45cd4a0627a --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Distribution.lean @@ -0,0 +1,180 @@ +import OAI.Analysis.HenonEmden.OriginBounds + +namespace OAI + +universe uE uE2 + +section Distribution + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +open Set Filter Topology +open MeasureTheory Set Filter Topology +open scoped ContDiff +noncomputable section + + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + [MeasurableSpace E] [BorelSpace E] + +lemma cutoff_laplacian_integral_scale {u φ ξ : E → ℝ} + (hφ : ContDiff ℝ 2 φ) (hξ : ContDiff ℝ 2 ξ) {R : ℝ} (hR : 0 < R) : + (∫ x : E, u x*Laplacian.laplacian (fun y => φ y*ξ (R⁻¹ • y)) x) = + R^(Module.finrank ℝ E)*(R⁻¹)^2* + ∫ y : E, u (R • y)*Laplacian.laplacian (fun z => φ (R • z)*ξ z) y := by + have hF : ContDiff ℝ 2 (fun z : E => φ (R • z)*ξ z) := + (hφ.comp (contDiff_const.smul contDiff_id)).mul hξ + have hid : (fun y : E => φ y*ξ (R⁻¹ • y)) = + (fun y : E => (fun z => φ (R • z)*ξ z) (R⁻¹ • y)) := by + ext y + simp [smul_smul,ne_of_gt hR] + have hh (x : E) : Laplacian.laplacian (fun y => φ y*ξ (R⁻¹ • y)) (R • x) = + (R⁻¹)^2*Laplacian.laplacian (fun z => φ (R • z)*ξ z) x := by + rw [hid,laplacian_dilation hF] + simp [smul_smul,ne_of_gt hR] + have hc := Measure.integral_comp_smul_of_nonneg volume + (fun x => u x*Laplacian.laplacian (fun y => φ y*ξ (R⁻¹ • y)) x) R (hR := hR.le) + simp only [hh,smul_eq_mul] at hc + have hC : (∫ x, u (R • x)*((R⁻¹)^2*Laplacian.laplacian (fun z => φ (R • z)*ξ z) x)) = + (R⁻¹)^2*(∫ x, u (R • x)*Laplacian.laplacian (fun z => φ (R • z)*ξ z) x) := by + simp_rw [← mul_assoc,mul_comm (u (R • _)) ((R⁻¹)^2),mul_assoc] + exact integral_const_mul _ _ + rw [hC] at hc + have hn : R^(Module.finrank ℝ E) ≠ 0 := pow_ne_zero _ (ne_of_gt hR) + calc + _ = R^Module.finrank ℝ E * ((R^Module.finrank ℝ E)⁻¹ * + ∫ x, u x*Laplacian.laplacian (fun y => φ y*ξ (R⁻¹ • y)) x) := by field_simp + _ = _ := by rw [← hc]; ring + +lemma cutoff_laplacian_integral_tendsto_zero {u φ ξ : E → ℝ} + (hn : 3 ≤ Module.finrank ℝ E) (hu : Continuous u) + (hφ : ContDiff ℝ 2 φ) (hξ : ContDiff ℝ 2 ξ) (hξc : HasCompactSupport ξ) : + Tendsto (fun R : ℝ => ∫ x : E, u x*Laplacian.laplacian (fun y => φ y*ξ (R⁻¹ • y)) x) + (𝓝[>] 0) (𝓝 0) := by + have heq : ∀ᶠ R : ℝ in 𝓝[>] 0, (∫ x : E, u x*Laplacian.laplacian (fun y => φ y*ξ (R⁻¹ • y)) x) = + R^(Module.finrank ℝ E-2)*∫ y : E, u (R • y)*Laplacian.laplacian (fun z => φ (R • z)*ξ z) y := by + filter_upwards [self_mem_nhdsWithin] with R hR + rw [cutoff_laplacian_integral_scale hφ hξ hR] + congr 1 + rw [inv_pow] + have hp := pow_sub₀ R (ne_of_gt hR) (show 2 ≤ Module.finrank ℝ E by omega) + exact hp.symm + apply Tendsto.congr' (Filter.EventuallyEq.symm heq) + have hpow : Tendsto (fun R : ℝ => R^(Module.finrank ℝ E-2)) (𝓝[>] 0) (𝓝 0) := by + have := (continuous_pow (Module.finrank ℝ E-2) : Continuous (fun R : ℝ => R^(Module.finrank ℝ E-2))).tendsto 0 + simpa [show Module.finrank ℝ E-2 ≠ 0 by omega] using this.mono_left nhdsWithin_le_nhds + simpa using hpow.mul ((continuous_cutoff_error hu hφ hξ hξc).tendsto 0 |>.mono_left nhdsWithin_le_nhds) +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + [MeasurableSpace E] [BorelSpace E] + +omit [MeasurableSpace E] [BorelSpace E] in +lemma bump_dilation_eventually_zero (ξ : ContDiffBump (0 : E)) {x : E} (hx : x ≠ 0) : + (fun R : ℝ => ξ (R⁻¹ • x)) =ᶠ[𝓝[>] 0] 0 := by + have he : 0 < ‖x‖ / ξ.rOut := div_pos (norm_pos_iff.mpr hx) ξ.rOut_pos + filter_upwards [self_mem_nhdsWithin, (eventually_lt_nhds he).filter_mono nhdsWithin_le_nhds] with R hR hlt + apply ξ.zero_of_le_dist + rw [dist_zero_right,norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hR),← div_eq_inv_mul] + apply (le_div_iff₀ hR).mpr + simpa only [mul_comm] using (le_of_lt ((lt_div_iff₀ ξ.rOut_pos).mp hlt)) + +lemma cutoff_source_integral_tendsto_zero [Nontrivial E] {g φ : E → ℝ} + (hg : LocallyIntegrable g) (hφ : Continuous φ) (hφc : HasCompactSupport φ) + (ξ : ContDiffBump (0 : E)) : + Tendsto (fun R : ℝ => ∫ x : E, g x*(φ x*ξ (R⁻¹ • x))) (𝓝[>] 0) (𝓝 0) := by + have hi : Integrable (fun x => g x*φ x) := + hg.integrable_smul_right_of_hasCompactSupport hφ hφc + have hc (R : ℝ) : Continuous (fun x : E => ξ (R⁻¹ • x)) := + ξ.continuous.comp (continuous_const.smul continuous_id) + have lim := tendsto_integral_filter_of_dominated_convergence + (μ := volume) (l := 𝓝[>] (0 : ℝ)) (F := fun R x => g x*(φ x*ξ (R⁻¹ • x))) + (f := fun _ => (0 : ℝ)) (fun x => ‖g x*φ x‖) + (Eventually.of_forall fun R => by + rw [show (fun x => g x*(φ x*ξ (R⁻¹ • x))) = + ((fun x => g x*φ x)*(fun x => ξ (R⁻¹ • x))) by ext x; simp only [Pi.mul_apply]; ring] + exact hi.aestronglyMeasurable.mul (hc R).aestronglyMeasurable) + (Eventually.of_forall fun R => Eventually.of_forall fun x => by + rw [← mul_assoc,norm_mul] + exact mul_le_of_le_one_right (norm_nonneg _) (by + rw [Real.norm_eq_abs,abs_of_nonneg ξ.nonneg]; exact ξ.le_one)) + hi.norm ?_ + · simpa using lim + filter_upwards [ae_iff.mpr (show volume {x : E | ¬ x ≠ 0} = 0 by simp)] with x hx + apply tendsto_const_nhds.congr' + filter_upwards [bump_dilation_eventually_zero ξ hx] with R hR + simp [hR] + +omit [MeasurableSpace E] [BorelSpace E] in +lemma cutoff_test_off_origin {φ : E → ℝ} (hφ : ContDiff ℝ 2 φ) + (hφc : HasCompactSupport φ) (ξ : ContDiffBump (0 : E)) {R : ℝ} (_hR : 0 < R) : + ContDiff ℝ 2 (fun x => φ x-φ x*ξ (R⁻¹ • x)) ∧ + HasCompactSupport (fun x => φ x-φ x*ξ (R⁻¹ • x)) ∧ + 0 ∉ tsupport (fun x => φ x-φ x*ξ (R⁻¹ • x)) := by + refine ⟨hφ.sub (hφ.mul (ξ.contDiff.comp (contDiff_const.smul contDiff_id))), + hφc.sub (hφc.mul_right), ?_⟩ + apply notMem_tsupport_iff_eventuallyEq.mpr + have ht : Tendsto (fun x : E => R⁻¹ • x) (𝓝 0) (𝓝 0) := by + have h : Continuous (fun x : E => R⁻¹ • x) := continuous_const.smul continuous_id + have ht := h.tendsto 0 + change Tendsto (fun x : E => R⁻¹ • x) (𝓝 0) (𝓝 (R⁻¹ • (0:E))) at ht + simpa only [smul_zero] using ht + have he := ξ.eventuallyEq_one.comp_tendsto ht + filter_upwards [he] with x hx + change ξ (R⁻¹ • x) = 1 at hx + simp [hx] + +lemma distributional_extension (hn : 3 ≤ Module.finrank ℝ E) {u g : E → ℝ} + (hu : Continuous u) (hg : LocallyIntegrable g) + (heq : ∀ (φ : E → ℝ), ContDiff ℝ 2 φ → HasCompactSupport φ → 0 ∉ tsupport φ → + (∫ x, u x*Laplacian.laplacian φ x) = -(∫ x, g x*φ x)) + {φ : E → ℝ} (hφ : ContDiff ℝ 2 φ) (hφc : HasCompactSupport φ) : + (∫ x, u x*Laplacian.laplacian φ x) = -(∫ x, g x*φ x) := by + have : Nontrivial E := (Module.finrank_pos_iff (R := ℝ)).mp (by omega) + let ξ : ContDiffBump (0 : E) := ⟨1,2,by norm_num,by norm_num⟩ + have hi : Integrable (fun x => g x*φ x) := + hg.integrable_smul_right_of_hasCompactSupport hφ.continuous hφc + have hui : Integrable (fun x => u x*Laplacian.laplacian φ x) := + integrable_mul_compact (compactSupport_laplacian hφc) hu.continuousOn (continuous_laplacian hφ).continuousOn + have hevent : ∀ᶠ R : ℝ in 𝓝[>] 0, + (∫ x, u x*Laplacian.laplacian φ x) - + (∫ x, u x*Laplacian.laplacian (fun y => φ y*ξ (R⁻¹ • y)) x) = + -(∫ x, g x*φ x) + (∫ x, g x*(φ x*ξ (R⁻¹ • x))) := by + filter_upwards [self_mem_nhdsWithin] with R hR + have hχ : ContDiff ℝ 2 (fun x => φ x*ξ (R⁻¹ • x)) := + hφ.mul (ξ.contDiff.comp (contDiff_const.smul contDiff_id)) + have hχc : HasCompactSupport (fun x => φ x*ξ (R⁻¹ • x)) := hφc.mul_right + have hχi : Integrable (fun x => u x*Laplacian.laplacian (fun y => φ y*ξ (R⁻¹ • y)) x) := + integrable_mul_compact (compactSupport_laplacian hχc) hu.continuousOn (continuous_laplacian hχ).continuousOn + have hgi : Integrable (fun x => g x*(φ x*ξ (R⁻¹ • x))) := + hg.integrable_smul_right_of_hasCompactSupport hχ.continuous hχc + obtain ⟨hψ,hψc,hψ0⟩ := cutoff_test_off_origin hφ hφc ξ hR + have HH := heq _ hψ hψc hψ0 + have hid (x : E) : Laplacian.laplacian (fun y => φ y-φ y*ξ (R⁻¹ • y)) x = + Laplacian.laplacian φ x-Laplacian.laplacian (fun y => φ y*ξ (R⁻¹ • y)) x := + hφ.contDiffAt.laplacian_sub hχ.contDiffAt + simp_rw [hid,mul_sub] at HH + rw [integral_sub hui hχi,integral_sub hi hgi] at HH + linarith + have hlim1 := (tendsto_const_nhds (x := ∫ x, u x*Laplacian.laplacian φ x)).sub (cutoff_laplacian_integral_tendsto_zero hn hu hφ ξ.contDiff ξ.hasCompactSupport) + have hlim2 := (tendsto_const_nhds (x := -(∫ x, g x*φ x))).add (cutoff_source_integral_tendsto_zero hg hφ.continuous hφc ξ) + have HH := tendsto_nhds_unique hlim1 (hlim2.congr' (Filter.EventuallyEq.symm hevent)) + simpa only [sub_zero,add_zero] using HH +end HenonLaneEmden.WeakPDE + +end +end Distribution + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Endpoints.lean b/lean/OAI/Analysis/HenonEmden/Endpoints.lean new file mode 100644 index 0000000000000000000000000000000000000000..b733d508b2b7a048bdeb68edd59dc015520b9546 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Endpoints.lean @@ -0,0 +1,170 @@ +import OAI.Analysis.HenonEmden.LayerPressure + +namespace OAI + +universe uP uP2 uP3 uP4 uP5 uP6 uP7 uP8 + +section Endpoints + +open Set MeasureTheory Filter Topology +open scoped ENNReal +open Classical +namespace HenonLaneEmden.LineComponents + +/-- Relative endpoints are chosen by measurable rational exits. On the only +components whose weight is positive they are the genuine finite endpoints. -/ +noncomputable def lowerEndpoint {P : Type uP} (U : Set (P × ℝ)) (p : P × ℝ) : ℝ := + p.2 - (backwardExit (relativeLayer U) p).toReal +noncomputable def upperEndpoint {P : Type uP2} (U : Set (P × ℝ)) (p : P × ℝ) : ℝ := + p.2 + (forwardExit (relativeLayer U) p).toReal + +lemma measurable_lowerEndpoint {P : Type uP3} [TopologicalSpace P] [MeasurableSpace P] + [BorelSpace P] {U : Set (P × ℝ)} (hU : IsOpen U) : Measurable (lowerEndpoint U) := + measurable_snd.sub (measurable_backwardExit (isOpen_relativeLayer hU)).ennreal_toReal +lemma measurable_upperEndpoint {P : Type uP4} [TopologicalSpace P] [MeasurableSpace P] + [BorelSpace P] {U : Set (P × ℝ)} (hU : IsOpen U) : Measurable (upperEndpoint U) := + measurable_snd.add (measurable_forwardExit (isOpen_relativeLayer hU)).ennreal_toReal + +lemma relative_component_eq_Ioo {P : Type uP5} [TopologicalSpace P] + {U : Set (P × ℝ)} (hU : IsOpen U) {p : P × ℝ} (hp : p ∈ U) + (hfin : componentLength (relativeLayer U) p ≠ ⊤) : + connectedComponentIn {s | (p.1,s) ∈ U} p.2 = + Ioo (lowerEndpoint U p) (upperEndpoint U p) := by + have hp0 : (p,0) ∈ relativeLayer U := by simpa [relativeLayer] using hp + have he := component_eq_Ioo (isOpen_relativeLayer hU) hp0 + (ENNReal.add_ne_top.mp hfin).1 (ENNReal.add_ne_top.mp hfin).2 + have him := image_relative_component (U := {s | (p.1,s) ∈ U}) (x := p.2) hp + have hsets : {r : ℝ | (p,r) ∈ relativeLayer U} = + {r : ℝ | (p.2,r) ∈ shiftedLayer {s | (p.1,s) ∈ U}} := rfl + rw [hsets] at he + rw [← him,he] + ext s + constructor + · rintro ⟨r,hr,rfl⟩ + constructor <;> dsimp [lowerEndpoint,upperEndpoint] <;> linarith [hr.1,hr.2] + · intro hs + refine ⟨s-p.2,?_,by ring⟩ + constructor <;> dsimp [lowerEndpoint,upperEndpoint] at hs <;> linarith [hs.1,hs.2] + +lemma relative_endpoints_eq {P : Type uP6} [TopologicalSpace P] + {U : Set (P × ℝ)} (hU : IsOpen U) {p : P × ℝ} (hp : p ∈ U) + (hfin : componentLength (relativeLayer U) p ≠ ⊤) : + lowerEndpoint U p = sInf (connectedComponentIn {s | (p.1,s) ∈ U} p.2) ∧ + upperEndpoint U p = sSup (connectedComponentIn {s | (p.1,s) ∈ U} p.2) := by + have he := relative_component_eq_Ioo hU hp hfin + have hpI := mem_connectedComponentIn (F := {s | (p.1,s) ∈ U}) hp + rw [he] at hpI + rw [he,csInf_Ioo (lt_trans hpI.1 hpI.2),csSup_Ioo (lt_trans hpI.1 hpI.2)] + exact ⟨rfl,rfl⟩ + +/-- Components are closed relative to the original set. -/ +lemma closure_component_inter_subset {U : Set ℝ} {x : ℝ} (hx : x ∈ U) : + closure (connectedComponentIn U x) ∩ U ⊆ connectedComponentIn U x := by + intro y hy + have hpre : IsPreconnected (insert y (connectedComponentIn U x)) := + isPreconnected_connectedComponentIn.subset_closure (subset_insert _ _) + (insert_subset_iff.mpr ⟨hy.1,subset_closure⟩) + have hsub := hpre.subset_connectedComponentIn + (mem_insert_of_mem _ (mem_connectedComponentIn hx)) + (insert_subset_iff.mpr ⟨hy.2,connectedComponentIn_subset U x⟩) + exact hsub (mem_insert _ _) + +lemma component_endpoints_frontier {U : Set ℝ} {x a b : ℝ} (hx : x ∈ U) + (he : connectedComponentIn U x = Ioo a b) : a ∈ frontier U ∧ b ∈ frontier U := by + have hxI := mem_connectedComponentIn hx + rw [he] at hxI + have hab : a < b := lt_trans hxI.1 hxI.2 + have hac : a ∈ closure (connectedComponentIn U x) := by rw [he,closure_Ioo hab.ne]; exact ⟨le_rfl,hab.le⟩ + have hbc : b ∈ closure (connectedComponentIn U x) := by rw [he,closure_Ioo hab.ne]; exact ⟨hab.le,le_rfl⟩ + have haU : a ∉ U := by + intro ha + have hh := closure_component_inter_subset hx ⟨hac,ha⟩ + rw [he] at hh + exact (lt_irrefl a) hh.1 + have hbU : b ∉ U := by + intro hb + have hh := closure_component_inter_subset hx ⟨hbc,hb⟩ + rw [he] at hh + exact (lt_irrefl b) hh.2 + exact ⟨⟨closure_mono (connectedComponentIn_subset U x) hac, + fun ha => haU (interior_subset ha)⟩, + ⟨closure_mono (connectedComponentIn_subset U x) hbc, + fun hb => hbU (interior_subset hb)⟩⟩ + +lemma value_eq_level_at_endpoint {f : ℝ → ℝ} {O : Set ℝ} {t x a b : ℝ} + (hx : x ∈ {s | s ∈ O ∧ t < f s}) + (he : connectedComponentIn {s | s ∈ O ∧ t < f s} x = Ioo a b) + {y : ℝ} (hy : y=a ∨ y=b) (hyO : y ∈ O) (hf : ContinuousAt f y) : f y = t := by + have hfront := component_endpoints_frontier hx he + have hyfront : y ∈ frontier {s | s ∈ O ∧ t < f s} := hy.elim (fun h => h ▸ hfront.1) (fun h => h ▸ hfront.2) + have hxI := mem_connectedComponentIn hx + rw [he] at hxI + have hab : a < b := lt_trans hxI.1 hxI.2 + have hyc : y ∈ closure (connectedComponentIn {s | s ∈ O ∧ t < f s} x) := by + rw [he,closure_Ioo hab.ne] + rcases hy with rfl | rfl <;> exact ⟨by linarith,by linarith⟩ + have hynot : y ∉ {s | s ∈ O ∧ t < f s} := by + intro h + have hm := closure_component_inter_subset hx ⟨hyc,h⟩ + rw [he] at hm + rcases hy with rfl | rfl <;> linarith [hm.1,hm.2] + apply le_antisymm + · exact le_of_not_gt (fun h => hynot ⟨hyO,h⟩) + · have hmem := _root_.mem_closure_image hf hyc + have hsub : f '' connectedComponentIn {s | s ∈ O ∧ t < f s} x ⊆ Ici t := by + rintro _ ⟨s,hs,rfl⟩ + exact (connectedComponentIn_subset _ _ hs).2.le + exact (closure_minimal hsub isClosed_Ici) hmem + +lemma setWeight_le_on_closure {h d : ℝ → ℝ} {δ : ℝ} {I : Set ℝ} + (hh : Continuous h) (hn : ∀ x ∈ I, 0 ≤ h x) {y : ℝ} (hy : y ∈ closure I) : + (setWeight h d δ I).toReal ≤ h y := by + have hs : I ⊆ {x | (setWeight h d δ I).toReal ≤ h x} := by + intro x hx + exact (ENNReal.toReal_le_toReal setWeight_ne_top ENNReal.ofReal_ne_top).mpr (setWeight_le hx) + |>.trans_eq (ENNReal.toReal_ofReal (hn x hx)) + exact (closure_minimal hs (isClosed_le continuous_const hh)) hy + +lemma endpoints_distance_bound {h d : ℝ → ℝ} {δ x a b : ℝ} {I : Set ℝ} + (he : I = Ioo a b) (hx : x ∈ I) (hδ : 0 ≤ δ) (hd : 0 ≤ d x) + (hw : 0 < (setWeight h d δ I).toReal) : + |a-x| ≤ 2*δ*d x ∧ |b-x| ≤ 2*δ*d x := by + have hxI : a < x ∧ x < b := by simpa [he] using hx + have htest : I.Nonempty ∧ volume I ≠ ⊤ ∧ volume I ≤ ENNReal.ofReal (2*δ)*setInf d I := by + unfold setWeight at hw + split_ifs at hw with htest + · exact htest + · simp at hw + have hv : volume I ≤ ENNReal.ofReal (2*δ)*ENNReal.ofReal (d x) := htest.2.2.trans (by + gcongr + exact setInf_le hx) + rw [he,Real.volume_Ioo,← ENNReal.ofReal_mul (by positivity : 0 ≤ 2*δ)] at hv + have hlen : b-a ≤ 2*δ*d x := (ENNReal.ofReal_le_ofReal_iff (by positivity : 0 ≤ 2*δ*d x)).mp hv + rw [abs_of_neg (by linarith : a-x<0),abs_of_pos (by linarith : 0 linarith + +lemma relative_componentLength_eq {P : Type uP7} [TopologicalSpace P] + {U : Set (P × ℝ)} (hU : IsOpen U) {p : P × ℝ} (hp : p ∈ U) : + componentLength (relativeLayer U) p = + volume (connectedComponentIn {s | (p.1,s) ∈ U} p.2) := by + have he := shifted_componentLength_eq (isOpen_section hU p.1) hp + simpa only [componentLength,forwardExit,backwardExit,SegmentInside,relativeLayer, + shiftedLayer,Set.mem_ofPred] using he + +lemma relative_endpoints_eq_of_weight_pos {P : Type uP8} [TopologicalSpace P] + {U : Set (P × ℝ)} (hU : IsOpen U) {p : P × ℝ} (hp : p ∈ U) + {h d : ℝ → ℝ} {δ : ℝ} + (hw : 0 < (setWeight h d δ (connectedComponentIn {s | (p.1,s) ∈ U} p.2)).toReal) : + lowerEndpoint U p = sInf (connectedComponentIn {s | (p.1,s) ∈ U} p.2) ∧ + upperEndpoint U p = sSup (connectedComponentIn {s | (p.1,s) ∈ U} p.2) := by + apply relative_endpoints_eq hU hp + rw [relative_componentLength_eq hU hp] + unfold setWeight at hw + split_ifs at hw with hh + · exact hh.2.1 + · simp at hw + +end HenonLaneEmden.LineComponents +end Endpoints + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Energy.lean b/lean/OAI/Analysis/HenonEmden/Energy.lean new file mode 100644 index 0000000000000000000000000000000000000000..c2ebc4da3f54047a738e3c26f9537b117a376fcb --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Energy.lean @@ -0,0 +1,143 @@ +import OAI.Analysis.HenonEmden.UniformBounds + +namespace OAI + +section Energy +open MeasureTheory Set Filter Topology Metric +open scoped ENNReal +namespace HenonLaneEmden + +noncomputable def energyDensity {n : ℕ} (u : Space n → ℝ) (q B : ℝ) (x : Space n) : ℝ := + ‖x‖^B*(u x)^(q+1) + +lemma measurable_energyDensity {n : ℕ} {u : Space n → ℝ} (hu : Continuous u) (q B : ℝ) : + Measurable (energyDensity u q B) := by + unfold energyDensity + exact (measurable_norm.pow_const B).mul (hu.measurable.pow_const (q+1)) + +lemma energyDensity_nonneg {n : ℕ} {u : Space n → ℝ} (hu : ∀ x, 0 ≤ u x) + (q B : ℝ) (x : Space n) : 0 ≤ energyDensity u q B x := + mul_nonneg (Real.rpow_nonneg (norm_nonneg _) _) (Real.rpow_nonneg (hu _) _) + +lemma energyDensity_dilation {n : ℕ} {u : Space n → ℝ} {R : ℝ} (hR : 0 < R) + (hu : ∀ x, 0 ≤ u x) (a q B : ℝ) (x : Space n) : + energyDensity (dilation u a R) q B x = + R^(a*(q+1)-B)*energyDensity u q B (R • x) := by + unfold energyDensity dilation + rw [Real.mul_rpow (Real.rpow_nonneg hR.le _) (hu _), ← Real.rpow_mul hR.le, + norm_smul, Real.norm_eq_abs, abs_of_pos hR, Real.mul_rpow hR.le (norm_nonneg x), + Real.rpow_sub hR] + have hpower : R^B ≠ 0 := ne_of_gt (Real.rpow_pos_of_pos hR B) + field_simp + +lemma lintegral_ball_comp_dilation {n : ℕ} {F : Space n → ℝ≥0∞} (hF : Measurable F) + {R : ℝ} (hR : 0 < R) : + (∫⁻ x in ball (0 : Space n) 1, F (R • x)) = + ENNReal.ofReal (R^(-(n:ℝ))) * ∫⁻ y in ball (0 : Space n) R, F y := by + have hpre : (fun x : Space n => R • x) ⁻¹' ball 0 R = ball 0 1 := by + ext x + simp only [mem_preimage, mem_ball, dist_zero_right, norm_smul, Real.norm_eq_abs, abs_of_pos hR] + simpa only [mul_one] using (mul_lt_mul_iff_right₀ hR : R*‖x‖ < R*1 ↔ ‖x‖ < 1) + have hmap := setLIntegral_map (μ := (volume : Measure (Space n))) + (isOpen_ball (x := (0 : Space n)) (ε := R)).measurableSet hF + (continuous_id.const_smul R).measurable + change (∫⁻ y in ball (0 : Space n) R, F y ∂Measure.map (fun x : Space n => R • x) volume) = + (∫⁻ x in (fun x : Space n => R • x) ⁻¹' ball 0 R, F (R • x)) at hmap + rw [hpre, Measure.map_addHaar_smul volume (ne_of_gt hR), Measure.restrict_smul, + lintegral_smul_measure] at hmap + rw [← hmap] + congr 2 + rw [finrank_euclideanSpace_fin, abs_of_pos (inv_pos.mpr (pow_pos hR n)), + Real.rpow_neg hR.le, Real.rpow_natCast] + +lemma lintegral_energy_dilation {n : ℕ} {u : Space n → ℝ} (hu : Continuous u) + (hupos : ∀ x, 0 ≤ u x) {R : ℝ} (hR : 0 < R) (a q B : ℝ) : + (∫⁻ x in ball (0 : Space n) 1, ENNReal.ofReal (energyDensity (dilation u a R) q B x)) = + ENNReal.ofReal (R^(a*(q+1)-B-(n:ℝ))) * + ∫⁻ y in ball (0 : Space n) R, ENNReal.ofReal (energyDensity u q B y) := by + simp_rw [energyDensity_dilation hR hupos a q B, + ENNReal.ofReal_mul (Real.rpow_nonneg hR.le _)] + rw [lintegral_const_mul _ (show Measurable (fun x : Space n => + ENNReal.ofReal (energyDensity u q B (R • x))) from + ((measurable_energyDensity hu q B).comp (continuous_id.const_smul R).measurable).ennreal_ofReal), + lintegral_ball_comp_dilation (measurable_energyDensity hu q B).ennreal_ofReal hR, + ← mul_assoc, ← ENNReal.ofReal_mul (Real.rpow_nonneg hR.le _), + ← Real.rpow_add hR] + rfl + +lemma energy_exponents {p q A B : ℝ} (hpq : 1 < p*q) : + alpha p q A B*(q+1)-B = alpha p q A B+beta p q A B+2 ∧ + beta p q A B*(p+1)-A = alpha p q A B+beta p q A B+2 := by + have hr := scaling_relations (A := A) (B := B) hpq + constructor <;> nlinarith [hr.1,hr.2] + +lemma energyDensity_eq_source_mul {n : ℕ} {u : Space n → ℝ} + (hu : ∀ x, 0 < u x) (q B : ℝ) {x : Space n} (hx : x ≠ 0) : + energyDensity u q B x = source u q B x * u x := by + rw [energyDensity,source_off_zero _ _ _ hx,Real.rpow_add (hu x),Real.rpow_one,mul_assoc] + +lemma IsSolution.energy_locallyIntegrable {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) : + LocallyIntegrable (energyDensity u q B) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hi := (h.source_f_locallyIntegrable hn).mul_continuous h.continuous_u + apply hi.congr + filter_upwards [ae_iff.mpr (by simp : volume {x : Space n | ¬ x ≠ 0} = 0)] with x hx + exact (energyDensity_eq_source_mul h.positive_u q B hx).symm + +lemma IsSolution.energy_ball_pos {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) {R : ℝ} (hR : 0 < R) : + 0 < ∫⁻ x in ball (0:Space n) R, ENNReal.ofReal (energyDensity u q B x) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + apply (setLIntegral_pos_iff (measurable_energyDensity h.continuous_u q B).ennreal_ofReal).mpr + have hs : ball (0:Space n) R \ {0} ⊆ Function.support (fun x => ENNReal.ofReal (energyDensity u q B x)) ∩ ball 0 R := by + intro x hx + refine ⟨?_,hx.1⟩ + apply ne_of_gt + apply ENNReal.ofReal_pos.mpr + exact mul_pos (Real.rpow_pos_of_pos (norm_pos_iff.mpr hx.2) _) (Real.rpow_pos_of_pos (h.positive_u x) _) + apply lt_of_lt_of_le _ (measure_mono hs) + rw [measure_sdiff_null (by simp)] + exact Metric.measure_ball_pos volume _ hR + +lemma IsSolution.energy_ball_finite {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (R : ℝ) : + (∫⁻ x in ball (0:Space n) R, ENNReal.ofReal (energyDensity u q B x)) ≠ ⊤ := by + exact (((h.energy_locallyIntegrable hn).integrableOn_isCompact (isCompact_closedBall _ R)).mono_set + ball_subset_closedBall).lintegral_lt_top.ne + +/-- The scaling obstruction. With the strict hyperbola, +any putative solution has arbitrarily large unit-ball energy among its dilates. -/ +lemma IsSolution.scaled_energy_unbounded {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hsub : Subcritical n p q A B) (C : ℝ) : + ∃ R : ℝ, 1 ≤ R ∧ ENNReal.ofReal C < + ∫⁻ x in ball (0:Space n) 1, + ENNReal.ofReal (energyDensity (dilation u (alpha p q A B) R) q B x) := by + have hpq := h.product_gt_one hn hp hq + let s := alpha p q A B+beta p q A B+2-(n:ℝ) + have hs : 0 < s := subcritical_scaling_exponent hp hq hpq hsub + let M := ∫⁻ x in ball (0:Space n) 1, ENNReal.ofReal (energyDensity u q B x) + have hM : 0 < M.toReal := ENNReal.toReal_pos (ne_of_gt (h.energy_ball_pos hn (by norm_num))) + (h.energy_ball_finite hn 1) + have ht : Tendsto (fun R : ℝ => R^s*M.toReal) atTop atTop := + (tendsto_rpow_atTop hs).atTop_mul_const hM + obtain ⟨R,hR,hRC⟩ := ((eventually_ge_atTop (1:ℝ)).and + (ht.eventually (eventually_gt_atTop (max C 0)))).exists + have hR0 : 0 < R := by linarith + refine ⟨R,hR,?_⟩ + rw [lintegral_energy_dilation h.continuous_u (fun x => (h.positive_u x).le) hR0] + have he : alpha p q A B*(q+1)-B-(n:ℝ) = s := by rw [(energy_exponents hpq).1] + rw [he] + have hm : M ≤ ∫⁻ x in ball (0:Space n) R, ENNReal.ofReal (energyDensity u q B x) := + lintegral_mono_set (ball_subset_ball hR) + apply lt_of_lt_of_le _ (mul_le_mul_right hm (ENNReal.ofReal (R^s))) + apply (ENNReal.toReal_lt_toReal ENNReal.ofReal_ne_top + (ENNReal.mul_ne_top ENNReal.ofReal_ne_top (h.energy_ball_finite hn 1))).mp + simpa only [ENNReal.toReal_ofReal',ENNReal.toReal_mul, + ENNReal.toReal_ofReal (Real.rpow_nonneg hR0.le _)] using hRC + +end HenonLaneEmden +end Energy + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/FarInteraction.lean b/lean/OAI/Analysis/HenonEmden/FarInteraction.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c157ad0d22591003eb836d7d4c8a4f26e89a4e6 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/FarInteraction.lean @@ -0,0 +1,152 @@ +import OAI.Analysis.HenonEmden.NearLocalization + +namespace OAI + +section FarInteraction + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open Cutoff + +def farWeight {n : ℕ} (δ j : ℝ) (z : Space n × Space n) : ℝ := + if 0 < d z.1 ∧ δ*d z.1^(m n) ≤ ‖z.1-z.2‖ then d z.1^j else 0 + +@[fun_prop] lemma measurable_farWeight (n : ℕ) (δ j : ℝ) : Measurable (farWeight (n:=n) δ j) := by + unfold farWeight + have hd : Continuous (fun z : Space n × Space n => d z.1) := continuous_d.comp continuous_fst + have ht : Continuous (fun z : Space n × Space n => δ*d z.1^(m n)) := continuous_const.mul (hd.pow _) + have hs : Continuous (fun z : Space n × Space n => ‖z.1-z.2‖) := (continuous_fst.sub continuous_snd).norm + exact (hd.measurable.pow_const j).ite ((isOpen_lt continuous_const hd).measurableSet.inter + (isClosed_le ht hs).measurableSet) measurable_const + +lemma farWeight_nonneg {n : ℕ} (δ j : ℝ) (z : Space n × Space n) : 0 ≤ farWeight δ j z := by + unfold farWeight; split_ifs + · exact Real.rpow_nonneg (d_nonneg z.1) j + · exact le_rfl + +lemma far_power_bound {n : ℕ} {δ r j : ℝ} (hδ : 0 < δ) (hr : 0 < r) (hr1 : r ≤ 1) + (hj : 0 ≤ j+(m n:ℝ)*(2-(n:ℝ))) : + r^j*(δ*r^(m n))^(2-(n:ℝ)) ≤ δ^(2-(n:ℝ)) := by + rw [Real.mul_rpow hδ.le (pow_nonneg hr.le _),← Real.rpow_natCast r (m n),← Real.rpow_mul hr.le, + mul_left_comm,← Real.rpow_add hr] + exact mul_le_of_le_one_right (by positivity) (Real.rpow_le_one hr.le hr1 hj) + +lemma IsSolution.truncated_newton_bound {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + {x : Space n} (hx : ‖x‖ ≤ 4) {l : ℝ} (hl : 0 < l) (hl1 : l ≤ 1) : + (∫⁻ y in {y | l ≤ ‖x-y‖}, ENNReal.ofReal (source v p A y)*ENNReal.ofReal (newtonKernel n (x,y))) ≤ + ENNReal.ofReal ((newtonDenom n)⁻¹*(sourceConstant n p q A B*8^((n:ℝ)-2-alpha p q A B)+ + uniformTailConstant n p q A B)*l^(2-(n:ℝ))) := by + have hd := newtonDenom_pos (h.dimension_ge_three hn) + have hgm := measurable_source h.continuous_v p A + have hs : MeasurableSet {y : Space n | l ≤ ‖x-y‖} := (isClosed_le continuous_const (continuous_const.sub continuous_id).norm).measurableSet + have he : (∫⁻ y in {y | l ≤ ‖x-y‖}, ENNReal.ofReal (‖x-y‖^(2-(n:ℝ))) ∂sourceMeasure v p A) = + ∫⁻ y in {y | l ≤ ‖x-y‖}, ENNReal.ofReal (source v p A y)*ENNReal.ofReal (‖x-y‖^(2-(n:ℝ))) := by + rw [← lintegral_indicator hs,lintegral_sourceMeasure h.continuous_v p A (by fun_prop)] + rw [← lintegral_indicator hs] + apply lintegral_congr + intro y + by_cases hy : l ≤ ‖x-y‖ <;> simp [hy] + simp_rw [newtonKernel,ENNReal.ofReal_mul (inv_nonneg.mpr hd.le),mul_left_comm (ENNReal.ofReal (source v p A _))] + rw [lintegral_const_mul _ (by fun_prop),← he] + have hh := mul_le_mul (le_refl (ENNReal.ofReal ((newtonDenom n)⁻¹))) (h.uniform_g_truncated hn hp hq hx hl hl1) bot_le bot_le + convert hh using 1; first | rfl | rw [← ENNReal.ofReal_mul (inv_nonneg.mpr hd.le)]; congr 1; ring + +def truncatedConstant (n : ℕ) (p q A B : ℝ) : ℝ := + max ((newtonDenom n)⁻¹*(sourceConstant n p q A B*8^((n:ℝ)-2-alpha p q A B)+ + uniformTailConstant n p q A B)) 0 + +def farConstant (n : ℕ) (p q A B δ : ℝ) : ℝ := + truncatedConstant n p q A B*δ^(2-(n:ℝ))* + max (sourceConstant n q p B A*2^((n:ℝ)-2-alpha q p B A)) 0 + +lemma truncatedConstant_nonneg (n : ℕ) (p q A B : ℝ) : 0 ≤ truncatedConstant n p q A B := le_max_right _ _ +lemma farConstant_nonneg {n : ℕ} (p q A B : ℝ) {δ : ℝ} (hδ : 0 ≤ δ) : 0 ≤ farConstant n p q A B δ := by + unfold farConstant + exact mul_nonneg (mul_nonneg (truncatedConstant_nonneg _ _ _ _ _) (Real.rpow_nonneg hδ _)) (le_max_right _ _) + +lemma IsSolution.far_inner_bound {n : ℕ} (hn : 2 ≤ n) {p q A B δ j : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hj : 0 ≤ j+(m n:ℝ)*(2-(n:ℝ))) (x : Space n) : + (∫⁻ y, ENNReal.ofReal (source v p A y)*ENNReal.ofReal (newtonKernel n (x,y))* + ENNReal.ofReal (farWeight δ j (x,y))) ≤ + (ball (0:Space n) 2).indicator (fun _ => ENNReal.ofReal (truncatedConstant n p q A B*δ^(2-(n:ℝ)))) x := by + have hgm := measurable_source h.continuous_v p A + by_cases hx : 0 < d x + · have hx2 : x ∈ ball (0:Space n) 2 := mem_ball_zero_iff.mpr ((d_pos_iff x).mp hx) + rw [indicator_of_mem hx2] + let l := δ*d x^(m n) + have hl : 0 < l := mul_pos hδ (pow_pos hx _) + have hl1 : l ≤ 1 := (mul_le_of_le_one_left (pow_nonneg hx.le _) hδ1).trans + (pow_le_one₀ hx.le (d_le_one x)) + have hs : MeasurableSet {y : Space n | l ≤ ‖x-y‖} := + (isClosed_le continuous_const (continuous_const.sub continuous_id).norm).measurableSet + have he : (∫⁻ y, ENNReal.ofReal (source v p A y)*ENNReal.ofReal (newtonKernel n (x,y))* + ENNReal.ofReal (farWeight δ j (x,y))) = + ENNReal.ofReal (d x^j)*(∫⁻ y in {y | l ≤ ‖x-y‖}, + ENNReal.ofReal (source v p A y)*ENNReal.ofReal (newtonKernel n (x,y))) := by + rw [← lintegral_const_mul _ (by fun_prop),← lintegral_indicator hs] + apply lintegral_congr + intro y + by_cases hy : l ≤ ‖x-y‖ <;> simp [farWeight,hx,hy,l] + ring + rw [he] + have hb := (h.truncated_newton_bound hn hp hq (by have hh := mem_ball_zero_iff.mp hx2; linarith) hl hl1).trans + (ENNReal.ofReal_le_ofReal (mul_le_mul_of_nonneg_right (le_max_left _ 0) (Real.rpow_nonneg hl.le (2-(n:ℝ))))) + have hh := mul_le_mul (le_refl (ENNReal.ofReal (d x^j))) hb bot_le bot_le + apply hh.trans + rw [← ENNReal.ofReal_mul (Real.rpow_nonneg hx.le j)] + apply ENNReal.ofReal_le_ofReal + convert mul_le_mul_of_nonneg_left (far_power_bound hδ hx (d_le_one x) hj) + (truncatedConstant_nonneg n p q A B) using 1; first | rfl | dsimp [truncatedConstant,l]; ring + · have hx2 : x ∉ ball (0:Space n) 2 := by simpa only [mem_ball_zero_iff,← d_pos_iff x] using hx + simp only [farWeight,hx,false_and,ite_false,ENNReal.ofReal_zero,mul_zero,lintegral_zero, + indicator_of_notMem hx2] + exact le_rfl + +lemma IsSolution.far_interaction_bound {n : ℕ} (hn : 2 ≤ n) {p q A B δ j : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hj : 0 ≤ j+(m n:ℝ)*(2-(n:ℝ))) : + (∫⁻ z, ENNReal.ofReal (farWeight δ j z) ∂interaction (source u q B) (source v p A)) ≤ + ENNReal.ofReal (farConstant n p q A B δ) := by + have hfm := measurable_source h.continuous_u q B + have hgm := measurable_source h.continuous_v p A + rw [lintegral_interaction hfm hgm (by fun_prop),lintegral_prod _ (by fun_prop)] + have heq (x : Space n) : (∫⁻ y, ENNReal.ofReal (source u q B x)* + (ENNReal.ofReal (source v p A y)*(ENNReal.ofReal (newtonKernel n (x,y))*ENNReal.ofReal (farWeight δ j (x,y))))) = + ENNReal.ofReal (source u q B x)*(∫⁻ y, + ENNReal.ofReal (source v p A y)*(ENNReal.ofReal (newtonKernel n (x,y))*ENNReal.ofReal (farWeight δ j (x,y)))) := + lintegral_const_mul _ (by fun_prop) + simp_rw [mul_assoc,heq] + have hb := lintegral_mono (μ := volume) (fun x => mul_le_mul (le_refl (ENNReal.ofReal (source u q B x))) + (h.far_inner_bound hn hp hq hδ hδ1 hj x) bot_le bot_le) + simp only [mul_assoc] at hb + apply hb.trans + have he : (∫⁻ x, ENNReal.ofReal (source u q B x)*(ball (0:Space n) 2).indicator + (fun _ => ENNReal.ofReal (truncatedConstant n p q A B*δ^(2-(n:ℝ)))) x) = + ENNReal.ofReal (truncatedConstant n p q A B*δ^(2-(n:ℝ)))*sourceMeasure u q B (ball 0 2) := by + rw [← lintegral_sourceMeasure h.continuous_u q B (measurable_const.indicator measurableSet_ball), + lintegral_indicator measurableSet_ball,setLIntegral_const] + rw [he,h.swap.sourceMeasure_ball hn] + have hm := (h.swap.sourceMass_g_upper hn hq hp (by norm_num : (0:ℝ) < 2)).trans (le_max_left _ 0) + exact (mul_le_mul (le_refl _) (ENNReal.ofReal_le_ofReal hm) bot_le bot_le).trans_eq + (by rw [← ENNReal.ofReal_mul (mul_nonneg (truncatedConstant_nonneg _ _ _ _ _) (Real.rpow_nonneg hδ.le _))]; rfl) + +lemma lintegral_interaction_swap {n : ℕ} {f g : Space n → ℝ} + (hf : Measurable f) (hg : Measurable g) {F : Space n × Space n → ℝ≥0∞} (hF : Measurable F) : + (∫⁻ z, F z.swap ∂interaction f g) = ∫⁻ z, F z ∂interaction g f := by + change (∫⁻ z, (F ∘ Prod.swap) z ∂interaction f g) = _ + rw [lintegral_interaction hf hg (hF.comp measurable_swap),lintegral_interaction hg hf hF,← lintegral_prod_swap] + apply lintegral_congr + intro z + change ENNReal.ofReal (f z.2)*ENNReal.ofReal (g z.1)*ENNReal.ofReal (newtonKernel n (z.2,z.1))*F z = _ + rw [newtonKernel_symm n z.2 z.1] + ring + +end HenonLaneEmden +end +end FarInteraction + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/FarLocalization.lean b/lean/OAI/Analysis/HenonEmden/FarLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..a50904dd4084fb3c2ed4f60a2c64d14511f68b78 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/FarLocalization.lean @@ -0,0 +1,118 @@ +import OAI.Analysis.HenonEmden.FarInteraction + +namespace OAI + +section FarLocalization + +open MeasureTheory Set Metric +open scoped InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open Cutoff AdaptiveCap + +def farLocalConstant (n : ℕ) : ℝ := 2*3^(N n)+2*derivativeConstant n + +lemma norm_X_bound {n : ℕ} (x : Space n) : ‖X n x‖ ≤ 2*eta n x := by + by_cases hx : ‖x‖ ≤ 2 + · rw [X,norm_smul,Real.norm_eq_abs,abs_of_nonneg (eta_nonneg n x)] + nlinarith [eta_nonneg n x] + · simp only [X,eta_eq_zero (le_of_not_ge hx),zero_smul,norm_zero,mul_zero,le_refl] + +lemma fluxFactor_bound {n : ℕ} (x y : Space n) : + |fluxFactor n (x,y)| ≤ 2*(eta n x+eta n y)/‖x-y‖ := by + by_cases hxy : x=y + · subst y + simp only [fluxFactor,sub_self,inner_zero_left,zero_div,abs_zero,norm_zero,div_zero,le_refl] + have hL : 0 < ‖x-y‖ := norm_pos_iff.mpr (sub_ne_zero.mpr hxy) + rw [fluxFactor,abs_div,abs_of_nonneg (sq_nonneg ‖x-y‖),div_le_div_iff₀ (sq_pos_of_pos hL) hL] + have hh := (abs_real_inner_le_norm (x-y) (X n x-X n y)).trans + (mul_le_mul_of_nonneg_left (norm_sub_le _ _) (norm_nonneg _)) + have hm := add_le_add (norm_X_bound x) (norm_X_bound y) + have hh' := mul_le_mul_of_nonneg_left hm (norm_nonneg (x-y)) + nlinarith [mul_le_mul_of_nonneg_right (hh.trans hh') (norm_nonneg (x-y))] + +lemma localError_rough {n : ℕ} (x y : Space n) : + localError (x,y) ≤ (2*eta n x/‖x-y‖+2*eta n x+w n x)+ + (2*eta n y/‖x-y‖+2*eta n y+w n y) := by + have hηx := eta_nonneg n x + have hηy := eta_nonneg n y + have hwx := w_nonneg n x + have hwy := w_nonneg n y + have hD := radialFactor_bounds (x,y) + have hh : |fluxFactor n (x,y)-eta n x+w n x*radialFactor (x,y)| ≤ |fluxFactor n (x,y)|+eta n x+w n x := by + have hs : |fluxFactor n (x,y)-eta n x| ≤ |fluxFactor n (x,y)|+eta n x := by + simpa only [sub_zero,zero_sub,abs_neg,abs_of_nonneg hηx] using abs_sub_le (fluxFactor n (x,y)) 0 (eta n x) + have hw : |w n x*radialFactor (x,y)| ≤ w n x := by + rw [abs_of_nonneg (mul_nonneg hwx hD.1)] + exact mul_le_of_le_one_right hwx hD.2 + exact (abs_add_le _ _).trans (by linarith) + have he : |eta n x-eta n y| ≤ eta n x+eta n y := by + simpa only [sub_zero,zero_sub,abs_neg,abs_of_nonneg hηx,abs_of_nonneg hηy] using abs_sub_le (eta n x) 0 (eta n y) + have hf := fluxFactor_bound x y + unfold localError + rw [mul_add,add_div] at hf + linarith + +lemma endpoint_far_bound {n : ℕ} {δ : ℝ} (hδ : 0 < δ) {x y : Space n} (hne : x ≠ y) + (hfar : 0 < d x → δ*d x^(m n) ≤ ‖x-y‖) : + 2*eta n x/‖x-y‖+2*eta n x+w n x ≤ farLocalConstant n* + (farWeight δ (N n-1:ℕ) (x,y)+δ⁻¹*farWeight δ ((N n:ℝ)-(m n:ℝ)) (x,y)) := by + have hd := d_nonneg x + have hN := N_ge_two n + have hC : 0 ≤ derivativeConstant n := (constants_nonneg n).1 + by_cases hx : 0 < d x + · have hf := hfar hx + simp only [farWeight,ite_eq_left (show 0 < d x ∧ δ*d x^(m n) ≤ ‖x-y‖ from ⟨hx,hf⟩),Real.rpow_natCast] + have hη := (eta_gap_bounds n x).2 + have hw : w n x ≤ 2*derivativeConstant n*d x^(N n-1) := by + convert wProfile_bound n (norm_nonneg x) using 1 + · exact w_eq_profile n x + · dsimp [derivativeConstant,d]; ring + have hpow : d x^(N n) ≤ d x^(N n-1) := pow_le_pow_of_le_one hd (d_le_one x) (by omega) + have hη' : eta n x ≤ 3^(N n)*d x^(N n-1) := hη.trans (mul_le_mul_of_nonneg_left hpow (by positivity)) + have hL : 0 < ‖x-y‖ := norm_pos_iff.mpr (sub_ne_zero.mpr hne) + have hηL : 2*eta n x/‖x-y‖ ≤ 2*3^(N n)*δ⁻¹*d x^((N n:ℝ)-(m n:ℝ)) := by + have hh := div_le_div₀ (by positivity : 0 ≤ 2*(3^(N n)*d x^(N n))) (show 2*eta n x ≤ 2*(3^(N n)*d x^(N n)) by linarith) + (mul_pos hδ (pow_pos hx _)) hf + apply hh.trans_eq + rw [Real.rpow_sub hx,Real.rpow_natCast,Real.rpow_natCast] + field_simp + have hp0 : 0 ≤ δ⁻¹*d x^((N n:ℝ)-(m n:ℝ)) := mul_nonneg (inv_nonneg.mpr hδ.le) (Real.rpow_nonneg hd _) + unfold farLocalConstant + have hm := mul_nonneg hC hp0 + nlinarith [hηL,hw,hη'] + · have hx2 : 2 ≤ ‖x‖ := not_lt.mp (fun hh => hx ((d_pos_iff x).mpr hh)) + simp only [eta_eq_zero hx2,w_outer n hx2,mul_zero,zero_div,farWeight,hx,false_and, + ite_false,add_zero,le_refl] + +lemma far_pair_endpoint {n : ℕ} {δ : ℝ} (hδ : 0 ≤ δ) {x y : Space n} + (hf : ¬(0 < pairGap (x,y) ∧ ‖x-y‖ ≤ δ*pairGap (x,y)^(m n))) : + (0 < d x → δ*d x^(m n) ≤ ‖x-y‖) ∧ (0 < d y → δ*d y^(m n) ≤ ‖x-y‖) := by + have hsx : d x ≤ pairGap (x,y) := le_max_left _ _ + have hsy : d y ≤ pairGap (x,y) := le_max_right _ _ + constructor + · intro hx + have hs := hx.trans_le hsx + exact (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (d_nonneg x) hsx _) hδ).trans + (le_of_lt (not_le.mp (fun hL => hf ⟨hs,hL⟩))) + · intro hy + have hs := hy.trans_le hsy + exact (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (d_nonneg y) hsy _) hδ).trans + (le_of_lt (not_le.mp (fun hL => hf ⟨hs,hL⟩))) + +lemma localError_far {n : ℕ} {δ : ℝ} (hδ : 0 < δ) {x y : Space n} (hne : x ≠ y) + (hf : ¬(0 < pairGap (x,y) ∧ ‖x-y‖ ≤ δ*pairGap (x,y)^(m n))) : + localError (x,y) ≤ farLocalConstant n* + (farWeight δ (N n-1:ℕ) (x,y)+δ⁻¹*farWeight δ ((N n:ℝ)-(m n:ℝ)) (x,y)+ + farWeight δ (N n-1:ℕ) (y,x)+δ⁻¹*farWeight δ ((N n:ℝ)-(m n:ℝ)) (y,x)) := by + obtain ⟨hx,hy⟩ := far_pair_endpoint hδ.le hf + have hh := endpoint_far_bound hδ hne hx + have hh' := endpoint_far_bound hδ hne.symm (fun hy' => by simpa only [norm_sub_rev y x] using hy hy') + rw [norm_sub_rev y x] at hh' + exact (localError_rough x y).trans ((add_le_add hh hh').trans_eq (by ring)) + +end HenonLaneEmden +end +end FarLocalization + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/FundamentalSolution.lean b/lean/OAI/Analysis/HenonEmden/FundamentalSolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c166a5e6c7a63ac55b8e25414e1354a000cb870 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/FundamentalSolution.lean @@ -0,0 +1,122 @@ +import OAI.Analysis.HenonEmden.NewtonBounds + +namespace OAI + +universe uE + +section FundamentalSolution + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +open Set Filter Topology +open MeasureTheory Set Filter Topology +open scoped ContDiff +noncomputable section + + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] +open SphereCalculus + +omit [Nontrivial E] in +lemma locallyIntegrable_newtonKernel (hn : 1 ≤ Module.finrank ℝ E) : + LocallyIntegrable (fun x : E => ‖x‖^(2-(Module.finrank ℝ E:ℝ))) := by + apply locallyIntegrable_of_norm_le_rpow hn (α := (Module.finrank ℝ E:ℝ)-2) (C := 1) + (by linarith) _ (measurable_norm.pow_const _).aestronglyMeasurable + filter_upwards [] with x + rw [Real.norm_eq_abs,abs_of_nonneg (Real.rpow_nonneg (norm_nonneg x) _),one_mul] + rw [show -((Module.finrank ℝ E:ℝ)-2) = 2-(Module.finrank ℝ E:ℝ) by ring] + +lemma kernel_integral_polar (hn : 3 ≤ Module.finrank ℝ E) {w : E → ℝ} + (hw : Continuous w) (hwc : HasCompactSupport w) : + (∫ x : E, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*w x) = ∫ r in Ioi (0:ℝ), r*mean w r := by + have hi := (locallyIntegrable_newtonKernel (by omega : 1 ≤ Module.finrank ℝ E)).integrable_smul_right_of_hasCompactSupport hw hwc + change Integrable (fun x : E => ‖x‖^(2-(Module.finrank ℝ E:ℝ))*w x) volume at hi + rw [Polar.integral_polar volume _ hi] + apply setIntegral_congr_fun measurableSet_Ioi + intro r hr + simp_rw [norm_smul_sphere hr.le,integral_const_mul] + change r^(Module.finrank ℝ E-1)*(r^(2-(Module.finrank ℝ E:ℝ))*mean w r) = r*mean w r + rw [← mul_assoc] + congr 1 + rw [← Real.rpow_natCast,← Real.rpow_add hr] + have hc : ((Module.finrank ℝ E-1:ℕ):ℝ)+(2-(Module.finrank ℝ E:ℝ)) = 1 := by + rw [Nat.cast_sub (by omega : 1 ≤ Module.finrank ℝ E),Nat.cast_one] + ring + rw [hc,Real.rpow_one] + +lemma mean_ode_global (hn : 2 ≤ Module.finrank ℝ E) {φ : E → ℝ} (hφ : ContDiff ℝ 2 φ) + {r : ℝ} (hr : 0 < r) : + r*meanDD φ r+((Module.finrank ℝ E:ℝ)-1)*meanD φ r = r*mean (Laplacian.laplacian φ) r := by + have h := mean_laplacian_ode hφ.contDiffOn (continuous_laplacian hφ).continuousOn + (fun _ _ => rfl) hr + have hp : r^(Module.finrank ℝ E-1) = r^(Module.finrank ℝ E-2)*r := by + rw [show Module.finrank ℝ E-1 = Module.finrank ℝ E-2+1 by omega,pow_succ] + rw [hp,Nat.cast_sub (by omega : 1 ≤ Module.finrank ℝ E),Nat.cast_one] at h + apply mul_left_cancel₀ (pow_ne_zero (Module.finrank ℝ E-2) hr.ne') + nlinarith [h] + +omit [Nontrivial E] in +lemma mean_at_large_zero {φ : E → ℝ} {R : ℝ} + (hR : 0 < R) (hbound : ∀ x ∈ tsupport φ, ‖x‖ < R) {r : ℝ} (hr : R ≤ r) : + mean φ r = 0 ∧ meanD φ r = 0 ∧ mean (Laplacian.laplacian φ) r = 0 := by + have hs (θ : UnitSphere E) : r • (θ:E) ∉ tsupport φ := by + intro hx + have hh := hbound _ hx + rw [norm_smul_sphere (hR.le.trans hr)] at hh + linarith + refine ⟨?_,?_,?_⟩ + · unfold mean + have he : (fun θ : UnitSphere E => φ (r • (θ:E))) = 0 := by + ext θ + exact image_eq_zero_of_notMem_tsupport (hs θ) + rw [he] + exact integral_zero _ _ + · unfold meanD + simp_rw [fderiv_of_notMem_tsupport ℝ (hs _),_root_.zero_apply] + exact integral_zero _ _ + · unfold mean + simp_rw [laplacian_zero_of_notMem_tsupport (hs _)] + exact integral_zero _ _ + +lemma integral_kernel_laplacian (hn : 3 ≤ Module.finrank ℝ E) {φ : E → ℝ} + (hφ : ContDiff ℝ 2 φ) (hφc : HasCompactSupport φ) : + (∫ x : E, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*Laplacian.laplacian φ x) = + -((Module.finrank ℝ E:ℝ)-2)*((volume : Measure E).toSphere univ).toReal*φ 0 := by + obtain ⟨R,hR,hbound⟩ := hφc.isBounded.exists_pos_norm_lt + rw [kernel_integral_polar hn (continuous_laplacian hφ) (compactSupport_laplacian hφc)] + rw [setIntegral_eq_of_subset_of_forall_sdiff_eq_zero measurableSet_Ioi Ioc_subset_Ioi_self (s := Ioc 0 R) + (fun r hr => by + have hRr : R ≤ r := le_of_not_gt (fun h => hr.2 ⟨hr.1,h.le⟩) + rw [(mean_at_large_zero hR hbound hRr).2.2,mul_zero])] + rw [← intervalIntegral.integral_of_le hR.le] + let H (r : ℝ) := r*meanD φ r+((Module.finrank ℝ E:ℝ)-2)*mean φ r + have hH : Continuous H := (continuous_id.mul (continuous_meanD_global hφ)).add ((continuous_mean hφ.continuous).const_mul _) + have hHd (r : ℝ) (hr : r ∈ Ioo 0 R) : HasDerivAt H (r*mean (Laplacian.laplacian φ) r) r := by + convert! (((hasDerivAt_id r).mul (hasDerivAt_meanD hφ.contDiffOn hr.1)).add + ((hasDerivAt_mean hφ.contDiffOn hr.1).const_mul ((Module.finrank ℝ E:ℝ)-2))) using 1 + simp only [id_eq,one_mul] + nlinarith [mean_ode_global (by omega) hφ hr.1] + rw [intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hR.le hH.continuousOn hHd + ((continuous_id.mul (continuous_mean (continuous_laplacian hφ))).intervalIntegrable _ _)] + obtain ⟨h0,h1,_⟩ := mean_at_large_zero hR hbound le_rfl + dsimp [H] + rw [h0,h1,mean_zero] + ring +end HenonLaneEmden.WeakPDE + +end +end FundamentalSolution + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/GlobalLoss.lean b/lean/OAI/Analysis/HenonEmden/GlobalLoss.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad5227876cabd6dc3440e3339c435253126b5434 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/GlobalLoss.lean @@ -0,0 +1,100 @@ +import OAI.Analysis.HenonEmden.LayerIntegration + +namespace OAI + +universe uE + +section GlobalLoss + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap LineComponents Angular LayerTonelli +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] + +def lossCoefficient (κ δ M P : ℝ) : ℝ := + oscillationConstant μ κ*δ*μ.toSphere.real univ+ + (boundConstant μ κ*rayConstant (Module.finrank ℝ E)*M)/δ^(Module.finrank ℝ E)/P + +def lowLevelConstant (n : ℕ) : ℝ := 6*(N n:ℝ)*3^(N n-1) +lemma lowLevelConstant_nonneg (n : ℕ) : 0 ≤ lowLevelConstant n := by unfold lowLevelConstant; positivity +omit [BorelSpace E] [Nontrivial E] in +lemma lossCoefficient_nonneg {κ δ M P : ℝ} (hκ : 0 ≤ κ) (hδ : 0 ≤ δ) (hM : 0 ≤ M) (hP : 0 ≤ P) : + 0 ≤ lossCoefficient μ κ δ M P := by + have hO := oscillationConstant_nonneg μ hκ + have hC := boundConstant_nonneg μ hκ + have hR : 0 ≤ rayConstant (Module.finrank ℝ E) := by unfold rayConstant; positivity + unfold lossCoefficient + positivity + +omit [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] [μ.IsAddHaarMeasure] in +lemma averagedLoss_zero_outer (f : E → ℝ) (κ δ : ℝ) {x : E} (hx : 2 ≤ ‖x‖) (t : ℝ) : + averagedLoss μ f κ δ (x,t)=0 := by + unfold averagedLoss + apply integral_eq_zero_of_ae + filter_upwards [] with e + rw [weight_outer μ κ e hx] + have he := lineWeight_le μ f κ δ (e,x,t) + rw [weight_outer μ κ e hx] at he + rw [le_antisymm he (lineWeight_nonneg μ f κ δ _)] + simp + +lemma lintegral_averagedLoss_bound {f u : E → ℝ} (hf : Measurable f) (hu : Measurable u) + (hfo : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) (hfn : ∀ x, 0 ≤ f x) (hun : ∀ x, 0 ≤ u x) + {κ δ M P : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 < δ) (hδ1 : δ ≤ 1/2) + (hM : 0 ≤ M) (hP : 0 < P) + (hm : (∫⁻ x in ball (0:E) 4, ENNReal.ofReal (f x) ∂μ) ≤ ENNReal.ofReal M) : + (∫⁻ z, ENNReal.ofReal (u z.1*averagedLoss μ f κ δ z) ∂layerMeasure μ f) ≤ + ENNReal.ofReal (lossCoefficient μ κ δ M P)* + (∫⁻ x, ENNReal.ofReal (eta (Module.finrank ℝ E) x*f x*u x) ∂μ)+ + ENNReal.ofReal (lowLevelConstant (Module.finrank ℝ E)*P)* + ∫⁻ x in ball (0:E) 2, ENNReal.ofReal (u x) ∂μ := by + let n := Module.finrank ℝ E + let c := lossCoefficient μ κ δ M P + have hc : 0 ≤ c := lossCoefficient_nonneg μ hκ.le hδ.le hM hP.le + have hcP : 0 ≤ lowLevelConstant n*P := mul_nonneg (lowLevelConstant_nonneg n) hP.le + have hla := measurable_averagedLoss μ hfo hκ hκ1 δ + have hetaM : Measurable (eta (Module.finrank ℝ E) : E → ℝ) := (continuous_eta _).measurable + rw [lintegral_layerMeasure μ hf (by fun_prop)] + simp_rw [ENNReal.ofReal_mul (hun _)] + have hfactor (x : E) : + (∫⁻ t in Ioo 0 (f x), ENNReal.ofReal (u x)*ENNReal.ofReal (averagedLoss μ f κ δ (x,t))) = + ENNReal.ofReal (u x)*(∫⁻ t in Ioo 0 (f x), ENNReal.ofReal (averagedLoss μ f κ δ (x,t))) := + lintegral_const_mul _ (by fun_prop) + simp_rw [hfactor] + have hpoint (x : E) : + ENNReal.ofReal (u x)*(∫⁻ t in Ioo 0 (f x), ENNReal.ofReal (averagedLoss μ f κ δ (x,t))) ≤ + ENNReal.ofReal c*ENNReal.ofReal (eta n x*f x*u x)+ + (ball (0:E) 2).indicator (fun x => ENNReal.ofReal (lowLevelConstant n*P)*ENNReal.ofReal (u x)) x := by + by_cases hx : x ∈ ball (0:E) 2 + · have hd : 0 < d x := (d_pos_iff x).mpr (mem_ball_zero_iff.mp hx) + have hh := integrated_averagedLoss μ hfo hκ hκ1 hδ hδ1 hd (hfn x) hM hP hm + have hh' := mul_le_mul (le_refl (ENNReal.ofReal (u x))) hh bot_le bot_le + rw [indicator_of_mem hx] + apply hh'.trans + have heta0 : 0 ≤ eta n x := le_trans (pow_nonneg (d_nonneg x) _) (etaProfile_bounds n ‖x‖).1 + rw [← ENNReal.ofReal_mul (hun x),← ENNReal.ofReal_mul hc, + ← ENNReal.ofReal_mul hcP,← ENNReal.ofReal_add + (mul_nonneg hc (mul_nonneg (mul_nonneg heta0 (hfn x)) (hun x))) + (mul_nonneg hcP (hun x))] + apply ENNReal.ofReal_le_ofReal + have heta : (d x)^(N n) ≤ eta n x := (etaProfile_bounds n ‖x‖).1 + change u x*(c*(d x)^(N n)*f x+lowLevelConstant n*P) ≤ _ + nlinarith [mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left heta hc) (hfn x)) (hun x)] + · have hx' : 2 ≤ ‖x‖ := not_lt.mp (by simpa only [mem_ball,dist_zero_right] using hx) + simp_rw [averagedLoss_zero_outer μ f κ δ hx'] + simp only [ENNReal.ofReal_zero,lintegral_zero,mul_zero] + exact bot_le + apply (lintegral_mono hpoint).trans_eq + rw [lintegral_add_left (by fun_prop),lintegral_indicator measurableSet_ball, + lintegral_const_mul _ (by fun_prop),lintegral_const_mul _ hu.ennreal_ofReal] + +end HenonLaneEmden.SpatialComponents +end +end GlobalLoss + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Gradients.lean b/lean/OAI/Analysis/HenonEmden/Gradients.lean new file mode 100644 index 0000000000000000000000000000000000000000..b52d6694a7b3438f2271d3ab379acb109f327353 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Gradients.lean @@ -0,0 +1,454 @@ +import OAI.Analysis.HenonEmden.CapMismatch + +namespace OAI + +universe uE uE2 uE3 uE4 uE5 uE6 + +section Gradients +open Set Filter Topology MeasureTheory MeasureTheory.Measure +open scoped RealInnerProductSpace ContDiff ENNReal Convolution Pointwise +noncomputable section +open HenonLaneEmden.RadialCalculus HenonLaneEmden.WeakPDE HenonLaneEmden.SphereCalculus + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +noncomputable def kernelDir (e x : E) : ℝ := + (2-(Module.finrank ℝ E:ℝ))*‖x‖^(-(Module.finrank ℝ E:ℝ))*⟪x,e⟫ + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma hasFDerivAt_kernel {x : E} (hx : x ≠ 0) : + HasFDerivAt (fun y : E => ‖y‖^(2-(Module.finrank ℝ E:ℝ))) + (((2-(Module.finrank ℝ E:ℝ))*‖x‖^(-(Module.finrank ℝ E:ℝ))) • innerSL ℝ x) x := by + have hr := norm_pos_iff.mpr hx + have hd := RadialCalculus.hasFDerivAt_profile_norm hx + (Real.hasDerivAt_rpow_const (p := 2-(Module.finrank ℝ E:ℝ)) (Or.inl hr.ne')) + convert hd using 1 + congr 1 + rw [mul_div_assoc] + congr 1 + calc + _ = ‖x‖^(2-(Module.finrank ℝ E:ℝ)-1-1) := by congr 1; ring + _ = _ := by rw [Real.rpow_sub hr,Real.rpow_one] + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma dir_kernel {e x : E} (hx : x ≠ 0) : + dir (fun y : E => ‖y‖^(2-(Module.finrank ℝ E:ℝ))) e x = kernelDir e x := by + rw [dir,(hasFDerivAt_kernel hx).fderiv] + rfl + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma kernelDir_bound (e x : E) : + |kernelDir e x| ≤ |2-(Module.finrank ℝ E:ℝ)| *‖e‖*‖x‖^(1-(Module.finrank ℝ E:ℝ)) := by + by_cases hx : x = 0 + · simp only [hx,kernelDir,inner_zero_left,mul_zero,abs_zero,norm_zero] + positivity + have hr := norm_pos_iff.mpr hx + unfold kernelDir + rw [abs_mul,abs_mul,abs_of_nonneg (Real.rpow_nonneg (norm_nonneg _) _)] + have he : ‖x‖^(-(Module.finrank ℝ E:ℝ))*‖x‖ = ‖x‖^(1-(Module.finrank ℝ E:ℝ)) := by + calc + _ = ‖x‖^(-(Module.finrank ℝ E:ℝ)+1) := by rw [Real.rpow_add hr,Real.rpow_one] + _ = _ := by congr 1; ring + calc + _ ≤ (|2-(Module.finrank ℝ E:ℝ)| *‖x‖^(-(Module.finrank ℝ E:ℝ)))*(‖x‖*‖e‖) := + mul_le_mul_of_nonneg_left (abs_real_inner_le_norm x e) (by positivity) + _ = |2-(Module.finrank ℝ E:ℝ)| *‖e‖*(‖x‖^(-(Module.finrank ℝ E:ℝ))*‖x‖) := by ring + _ = _ := by rw [he] + +lemma measurable_kernelDir (e : E) : Measurable (kernelDir e) := + (measurable_const.mul (measurable_norm.pow_const _)).mul (by fun_prop) + +lemma locallyIntegrable_kernelDir (hn : 1 ≤ Module.finrank ℝ E) (e : E) : + LocallyIntegrable (kernelDir e) := by + apply locallyIntegrable_of_norm_le_rpow hn + (α := (Module.finrank ℝ E:ℝ)-1) (C := |2-(Module.finrank ℝ E:ℝ)| *‖e‖) (by linarith) + ?_ (measurable_kernelDir e).aestronglyMeasurable + apply Eventually.of_forall + intro x + simpa only [Real.norm_eq_abs,neg_sub] using kernelDir_bound e x + +lemma integral_kernel_dir_off_zero (hn : 1 ≤ Module.finrank ℝ E) {φ : E → ℝ} + (hφ : ContDiff ℝ 2 φ) (hc : HasCompactSupport φ) (h0 : 0 ∉ tsupport φ) (e : E) : + (∫ x, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*dir φ e x) = -(∫ x, kernelDir e x*φ x) := by + have hK := locallyIntegrable_newtonKernel hn + have hdφ : Continuous (dir φ e) := (contDiffOn_univ.mp + (contDiffOn_dir (k := 1) hφ.contDiffOn isOpen_univ e)).continuous + have hi := (locallyIntegrable_kernelDir hn e).integrable_smul_right_of_hasCompactSupport hφ.continuous hc + have heq : (fun x => dir (fun y : E => ‖y‖^(2-(Module.finrank ℝ E:ℝ))) e x*φ x) = + (fun x => kernelDir e x*φ x) := by + ext x + by_cases hx : x = 0 + · simp [hx,image_eq_zero_of_notMem_tsupport h0] + · rw [dir_kernel hx] + have hh := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + (μ := volume) (v := e) (f := fun x : E => ‖x‖^(2-(Module.finrank ℝ E:ℝ))) (g := φ) + (by change Integrable (fun x => dir (fun y : E => ‖y‖^(2-(Module.finrank ℝ E:ℝ))) e x*φ x); rw [heq]; exact hi) + (hK.integrable_smul_right_of_hasCompactSupport hdφ (compactSupport_dir hc e)) + (hK.integrable_smul_right_of_hasCompactSupport hφ.continuous hc) + (fun x hx => (hasFDerivAt_kernel (fun he => h0 (he ▸ hx))).differentiableAt) + (fun x _ => hφ.differentiable (by norm_num) x) + change (∫ x, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*dir φ e x) = -(∫ x, dir (fun y : E => ‖y‖^(2-(Module.finrank ℝ E:ℝ))) e x*φ x) at hh + rwa [heq] at hh +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +lemma kernel_cutoff_derivative_tendsto_zero (hn : 1 ≤ Module.finrank ℝ E) {φ : E → ℝ} + (hφ : Continuous φ) (hc : HasCompactSupport φ) (ξ : ContDiffBump (0:E)) (e : E) : + Tendsto (fun R : ℝ => ∫ x : E, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*φ x* + (R⁻¹*dir ξ e (R⁻¹ • x))) (𝓝[>] 0) (𝓝 0) := by + have hdξ : Continuous (dir ξ e) := (contDiffOn_univ.mp + (contDiffOn_dir (k := 1) (ξ.contDiff.of_le (by exact WithTop.coe_le_coe.mpr le_top)).contDiffOn isOpen_univ e)).continuous + obtain ⟨M,hM⟩ := (compactSupport_dir ξ.hasCompactSupport e).exists_bound_of_continuous hdξ + have hM0 : 0 ≤ M := (norm_nonneg (dir ξ e 0)).trans (hM 0) + have hi : Integrable (fun x : E => ‖x‖^(1-(Module.finrank ℝ E:ℝ))*φ x) := + (locallyIntegrable_norm_power hn _ (by linarith)).integrable_smul_right_of_hasCompactSupport hφ hc + have hlim := tendsto_integral_filter_of_dominated_convergence + (μ := volume) (l := 𝓝[>] (0:ℝ)) + (F := fun (R : ℝ) (x : E) => ‖x‖^(2-(Module.finrank ℝ E:ℝ))*φ x*(R⁻¹*dir ξ e (R⁻¹ • x))) + (f := fun _ => (0:ℝ)) (fun x => (M*ξ.rOut)*‖‖x‖^(1-(Module.finrank ℝ E:ℝ))*φ x‖) + (Eventually.of_forall fun R => by + exact (((measurable_norm.pow_const _).mul hφ.measurable).mul + (measurable_const.mul (hdξ.measurable.comp (measurable_const.smul measurable_id)))).aestronglyMeasurable) + ?_ (hi.norm.const_mul (M*ξ.rOut)) ?_ + · simpa only [integral_zero] using hlim + · filter_upwards [self_mem_nhdsWithin] with R hR + filter_upwards [ae_iff.mpr (show volume {x : E | ¬ x ≠ 0} = 0 by simp)] with x hx + by_cases hd : dir ξ e (R⁻¹ • x) = 0 + · simp only [hd,mul_zero,norm_zero] + exact mul_nonneg (mul_nonneg hM0 ξ.rOut_pos.le) (norm_nonneg _) + have hs := tsupport_dir_subset (ξ : E → ℝ) e (subset_tsupport _ hd) + rw [ξ.tsupport_eq] at hs + have hnorm : R⁻¹*‖x‖ ≤ ξ.rOut := by + simpa only [Metric.mem_closedBall,dist_zero_right,norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr (show 0 < R from hR))] using hs + have hrx := norm_pos_iff.mpr hx + have hb : R⁻¹ ≤ ξ.rOut/‖x‖ := (le_div_iff₀ hrx).mpr hnorm + have hh : |R⁻¹*dir ξ e (R⁻¹ • x)| ≤ M*ξ.rOut/‖x‖ := by + rw [abs_mul,abs_of_pos (inv_pos.mpr hR)] + have hm' : |dir ξ e (R⁻¹ • x)| ≤ M := by simpa only [Real.norm_eq_abs] using hM (R⁻¹ • x) + calc + _ ≤ R⁻¹*M := mul_le_mul_of_nonneg_left hm' (inv_pos.mpr hR).le + _ ≤ (ξ.rOut/‖x‖)*M := mul_le_mul_of_nonneg_right hb hM0 + _ = _ := by ring + rw [norm_mul,Real.norm_eq_abs (R⁻¹*_),norm_mul,Real.norm_eq_abs (‖x‖^_),abs_of_nonneg (Real.rpow_nonneg (norm_nonneg _) _)] + apply (mul_le_mul_of_nonneg_left hh (mul_nonneg (Real.rpow_nonneg (norm_nonneg _) _) (norm_nonneg _))).trans_eq + rw [norm_mul,Real.norm_eq_abs (‖x‖^_),abs_of_nonneg (Real.rpow_nonneg (norm_nonneg _) _)] + have he : ‖x‖^(2-(Module.finrank ℝ E:ℝ))/‖x‖ = ‖x‖^(1-(Module.finrank ℝ E:ℝ)) := by + calc + _ = ‖x‖^(2-(Module.finrank ℝ E:ℝ)-1) := by rw [Real.rpow_sub hrx (2-(Module.finrank ℝ E:ℝ)) 1,Real.rpow_one] + _ = _ := by congr 1; ring + calc + _ = (M*ξ.rOut)*(‖x‖^(2-(Module.finrank ℝ E:ℝ))/‖x‖)*‖φ x‖ := by ring + _ = _ := by rw [he]; ring + · filter_upwards [ae_iff.mpr (show volume {x : E | ¬ x ≠ 0} = 0 by simp)] with x hx + have he : 0 < ‖x‖/ξ.rOut := div_pos (norm_pos_iff.mpr hx) ξ.rOut_pos + apply tendsto_const_nhds.congr' + filter_upwards [self_mem_nhdsWithin,(eventually_lt_nhds he).filter_mono nhdsWithin_le_nhds] with R hR hlt + have hs : R⁻¹ • x ∉ tsupport (ξ : E → ℝ) := by + rw [ξ.tsupport_eq,Metric.mem_closedBall,dist_zero_right,norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hR)] + apply not_le_of_gt + rw [← div_eq_inv_mul] + apply (lt_div_iff₀ hR).mpr + simpa only [mul_comm] using (lt_div_iff₀ ξ.rOut_pos).mp hlt + simp only [dir,fderiv_of_notMem_tsupport ℝ hs,_root_.zero_apply,mul_zero] +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE3} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +lemma kernel_dir_cutoff_tendsto_zero (hn : 1 ≤ Module.finrank ℝ E) {φ : E → ℝ} + (hφ : ContDiff ℝ 2 φ) (hc : HasCompactSupport φ) (ξ : ContDiffBump (0:E)) (e : E) : + Tendsto (fun R : ℝ => ∫ x : E, ‖x‖^(2-(Module.finrank ℝ E:ℝ))* + dir (fun y => φ y*ξ (R⁻¹ • y)) e x) (𝓝[>] 0) (𝓝 0) := by + have hK := locallyIntegrable_newtonKernel hn + have hdφ : Continuous (dir φ e) := (contDiffOn_univ.mp + (contDiffOn_dir (k := 1) hφ.contDiffOn isOpen_univ e)).continuous + have hdξ : Continuous (dir ξ e) := (contDiffOn_univ.mp + (contDiffOn_dir (k := 1) (ξ.contDiff.of_le (by exact WithTop.coe_le_coe.mpr le_top)).contDiffOn isOpen_univ e)).continuous + have heq (R : ℝ) : (∫ x : E, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*dir (fun y => φ y*ξ (R⁻¹ • y)) e x) = + (∫ x : E, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*(dir φ e x*ξ (R⁻¹ • x))) + + (∫ x : E, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*φ x*(R⁻¹*dir ξ e (R⁻¹ • x))) := by + have hξR : Differentiable ℝ (fun y : E => ξ (R⁻¹ • y)) := + ((ξ.contDiff : ContDiff ℝ 2 ξ).comp (contDiff_const.smul contDiff_id)).differentiable (by norm_num) + simp_rw [dir_mul (hφ.differentiable (by norm_num) _) (hξR _) e,dir_dilation,mul_add,← mul_assoc] + apply integral_add + · simpa only [smul_eq_mul, Pi.mul_apply, Function.comp_apply, Pi.smul_apply, id_eq, mul_assoc] using + hK.integrable_smul_right_of_hasCompactSupport + (hdφ.mul (ξ.continuous.comp (continuous_id.const_smul R⁻¹))) (compactSupport_dir hc e).mul_right + · simpa only [smul_eq_mul, Pi.mul_apply, Function.comp_apply, Pi.smul_apply, id_eq, mul_assoc] using + hK.integrable_smul_right_of_hasCompactSupport + (hφ.continuous.mul ((continuous_const : Continuous (fun _ : E => R⁻¹)).mul + (hdξ.comp (continuous_id.const_smul R⁻¹)))) hc.mul_right + simp_rw [heq] + simpa only [add_zero] using (cutoff_source_integral_tendsto_zero hK hdφ (compactSupport_dir hc e) ξ).add + (kernel_cutoff_derivative_tendsto_zero hn hφ.continuous hc ξ e) + +lemma integral_kernel_dir (hn : 1 ≤ Module.finrank ℝ E) {φ : E → ℝ} + (hφ : ContDiff ℝ 2 φ) (hc : HasCompactSupport φ) (e : E) : + (∫ x, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*dir φ e x) = -(∫ x, kernelDir e x*φ x) := by + let ξ : ContDiffBump (0:E) := ⟨1,2,by norm_num,by norm_num⟩ + have hK := locallyIntegrable_newtonKernel hn + have hD := locallyIntegrable_kernelDir hn e + have hdφ : Continuous (dir φ e) := (contDiffOn_univ.mp + (contDiffOn_dir (k := 1) hφ.contDiffOn isOpen_univ e)).continuous + have hiK := hK.integrable_smul_right_of_hasCompactSupport hdφ (compactSupport_dir hc e) + have hiD := hD.integrable_smul_right_of_hasCompactSupport hφ.continuous hc + have hevent : ∀ᶠ R : ℝ in 𝓝[>] 0, + (∫ x, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*dir φ e x) - + (∫ x, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*dir (fun y => φ y*ξ (R⁻¹ • y)) e x) = + -(∫ x, kernelDir e x*φ x)+(∫ x, kernelDir e x*(φ x*ξ (R⁻¹ • x))) := by + filter_upwards [self_mem_nhdsWithin] with R hR + obtain ⟨hψ,hψc,hψ0⟩ := cutoff_test_off_origin hφ hc ξ hR + have hh := integral_kernel_dir_off_zero hn hψ hψc hψ0 e + have hχ : ContDiff ℝ 2 (fun y : E => φ y*ξ (R⁻¹ • y)) := + hφ.mul (ξ.contDiff.comp (contDiff_const.smul contDiff_id)) + have hχc : HasCompactSupport (fun y : E => φ y*ξ (R⁻¹ • y)) := hc.mul_right + have hdχ : Continuous (dir (fun y : E => φ y*ξ (R⁻¹ • y)) e) := (contDiffOn_univ.mp + (contDiffOn_dir (k := 1) hχ.contDiffOn isOpen_univ e)).continuous + have hiχK := hK.integrable_smul_right_of_hasCompactSupport hdχ (compactSupport_dir hχc e) + have hiχD := hD.integrable_smul_right_of_hasCompactSupport hχ.continuous hχc + simp only [smul_eq_mul] at hiK hiD hiχK hiχD + have hid (x : E) : dir (fun y => φ y-φ y*ξ (R⁻¹ • y)) e x = + dir φ e x-dir (fun y => φ y*ξ (R⁻¹ • y)) e x := by + unfold dir + exact congrArg (fun L : E →L[ℝ] ℝ => L e) + ((hφ.differentiable (by norm_num) x).hasFDerivAt.sub + (hχ.differentiable (by norm_num) x).hasFDerivAt).fderiv + simp_rw [hid,mul_sub] at hh + rw [integral_sub hiK hiχK,integral_sub hiD hiχD] at hh + linarith + have hlim₁ := (tendsto_const_nhds (x := ∫ x, ‖x‖^(2-(Module.finrank ℝ E:ℝ))*dir φ e x)).sub + (kernel_dir_cutoff_tendsto_zero hn hφ hc ξ e) + have hlim₂ := (tendsto_const_nhds (x := -(∫ x, kernelDir e x*φ x))).add + (cutoff_source_integral_tendsto_zero hD hφ.continuous hc ξ) + simpa only [sub_zero,add_zero] using tendsto_nhds_unique hlim₁ (hlim₂.congr' (hevent.mono fun _ hh => hh.symm)) +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE4} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma kernelDir_shift_bound (hn : 3 ≤ Module.finrank ℝ E) {r : ℝ} (hr : 0 < r) + {x x₀ y : E} (hx : ‖x-x₀‖ < r/2) (hy : r ≤ ‖x₀-y‖) (e : E) : + |kernelDir e (x-y)| ≤ (|2-(Module.finrank ℝ E:ℝ)| *‖e‖*(2/r)*(1/2:ℝ)^(2-(Module.finrank ℝ E:ℝ)))* + ‖x₀-y‖^(2-(Module.finrank ℝ E:ℝ)) := by + have ht := norm_sub_le (x₀-x) (y-x) + simp only [sub_sub_sub_cancel_right,norm_sub_rev y x,norm_sub_rev x₀ x] at ht + have hl : r/2 ≤ ‖x-y‖ := by linarith + have hp : 0 < ‖x-y‖ := lt_of_lt_of_le (half_pos hr) hl + have ha : 2-(Module.finrank ℝ E:ℝ) ≤ 0 := by + have hh : (3:ℝ) ≤ Module.finrank ℝ E := by exact_mod_cast hn + linarith + have he : ‖x-y‖^(1-(Module.finrank ℝ E:ℝ)) = ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))/‖x-y‖ := by + calc + _ = ‖x-y‖^(2-(Module.finrank ℝ E:ℝ)-1) := by congr 1; ring + _ = _ := by rw [Real.rpow_sub hp,Real.rpow_one] + have hh : ‖x-y‖^(1-(Module.finrank ℝ E:ℝ)) ≤ + (2/r)*((1/2:ℝ)^(2-(Module.finrank ℝ E:ℝ))*‖x₀-y‖^(2-(Module.finrank ℝ E:ℝ))) := by + rw [he,div_eq_inv_mul] + apply mul_le_mul + · have h := one_div_le_one_div_of_le (half_pos hr) hl + simpa only [one_div,inv_div] using h + · exact rpow_kernel_shift_bound ha hr hx hy + · positivity + · positivity + exact (kernelDir_bound e (x-y)).trans ((mul_le_mul_of_nonneg_left hh (by positivity)).trans_eq (by ring)) + +lemma hasLineDerivAt_far_rawPotential (hn : 3 ≤ Module.finrank ℝ E) {g : E → ℝ} + (hg : Measurable g) (hgp : ∀ y, 0 ≤ g y) {x₀ : E} {r : ℝ} (hr : 0 < r) + (hzero : ∀ y ∈ Metric.ball x₀ r, g y = 0) + (hi : Integrable (fun y => ‖x₀-y‖^(2-(Module.finrank ℝ E:ℝ))*g y)) (e : E) : + Integrable (fun y => kernelDir e (x₀-y)*g y) ∧ + HasLineDerivAt ℝ (rawPotential g) (∫ y, kernelDir e (x₀-y)*g y) x₀ e := by + let C := |2-(Module.finrank ℝ E:ℝ)| *‖e‖*(2/r)*(1/2:ℝ)^(2-(Module.finrank ℝ E:ℝ)) + let s : Set ℝ := {t | ‖t • e‖ < r/2} + have hs : s ∈ 𝓝 (0:ℝ) := by + apply IsOpen.mem_nhds (isOpen_lt (continuous_id.smul continuous_const).norm continuous_const) + simpa [s] using half_pos hr + have hDmeas : Measurable (fun y : E => kernelDir e (x₀-y)*g y) := + ((measurable_kernelDir e).comp (measurable_const.sub measurable_id)).mul hg + have hh := hasDerivAt_integral_of_dominated_loc_of_deriv_le + (μ := (volume : Measure E)) (F := fun (t : ℝ) (y : E) => ‖(x₀+t • e)-y‖^(2-(Module.finrank ℝ E:ℝ))*g y) + (F' := fun (t : ℝ) (y : E) => kernelDir e ((x₀+t • e)-y)*g y) + (bound := fun y => C*(‖x₀-y‖^(2-(Module.finrank ℝ E:ℝ))*g y)) hs + (Eventually.of_forall fun t => (((measurable_const.sub measurable_id).norm.pow_const _).mul hg).aestronglyMeasurable) + (by simpa using hi) + (by simpa only [zero_smul, add_zero] using hDmeas.aestronglyMeasurable) + ?_ (hi.const_mul C) ?_ + · simpa only [zero_smul,add_zero,HasLineDerivAt,rawPotential] using hh + · apply Eventually.of_forall + intro y t ht + by_cases hy : y ∈ Metric.ball x₀ r + · simp only [hzero y hy,mul_zero,norm_zero,le_refl] + have hyr : r ≤ ‖x₀-y‖ := by + have hy' : ¬ ‖y-x₀‖ < r := by simpa only [Metric.mem_ball,dist_eq_norm] using hy + simpa only [norm_sub_rev] using le_of_not_gt hy' + have htx : ‖(x₀+t • e)-x₀‖ < r/2 := by simpa only [s,Set.mem_ofPred_eq,add_sub_cancel_left] using ht + rw [norm_mul,Real.norm_eq_abs,Real.norm_eq_abs,abs_of_nonneg (hgp y)] + exact (mul_le_mul_of_nonneg_right (kernelDir_shift_bound hn hr htx hyr e) (hgp y)).trans_eq (mul_assoc _ _ _) + · apply Eventually.of_forall + intro y t ht + by_cases hy : y ∈ Metric.ball x₀ r + · simp only [hzero y hy,mul_zero] + exact hasDerivAt_const t 0 + have hyr : r ≤ ‖x₀-y‖ := by + have hy' : ¬ ‖y-x₀‖ < r := by simpa only [Metric.mem_ball,dist_eq_norm] using hy + simpa only [norm_sub_rev] using le_of_not_gt hy' + have hne : (x₀+t • e)-y ≠ 0 := by + intro he + have he' : y = x₀+t • e := (sub_eq_zero.mp he).symm + rw [he',norm_sub_rev,add_sub_cancel_left] at hyr + linarith [show ‖t • e‖ < r/2 from ht] + have haff : HasDerivAt (fun t : ℝ => (x₀+t • e)-y) e t := by + simpa using (((hasDerivAt_id t).smul_const e).const_add x₀).sub_const y + have hd := ((hasFDerivAt_kernel hne).comp_hasDerivAt t haff).mul_const (g y) + simpa only [_root_.smul_apply,innerSL_apply_apply,smul_eq_mul,kernelDir,Function.comp_apply] using hd +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE5} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +omit [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] in +lemma contDiff_mul_cutoff {g ξ : E → ℝ} {s : Set E} {k : ℕ∞ω} (hs : IsOpen s) + (hg : ContDiffOn ℝ k g s) (hξ : ContDiff ℝ k ξ) (hξs : tsupport ξ ⊆ s) : + ContDiff ℝ k (fun y => ξ y*g y) := by + apply contDiff_iff_contDiffAt.mpr + intro x + by_cases hx : x ∈ tsupport ξ + · exact hξ.contDiffAt.mul (hg.contDiffAt (hs.mem_nhds (hξs hx))) + · apply (contDiffAt_const (c := (0:ℝ))).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_mul] + +omit [Nontrivial E] in +lemma rawPotential_eq_convolve (g : E → ℝ) : rawPotential g = convolve (fun y : E => ‖y‖^(2-(Module.finrank ℝ E:ℝ))) g := by + ext x + rw [rawPotential,convolve_def,← integral_sub_left_eq_self (fun y : E => ‖y‖^(2-(Module.finrank ℝ E:ℝ))*g (x-y)) volume x] + simp only [sub_sub_cancel] + +omit [Nontrivial E] in +lemma integrable_kernelDir_local (hn : 1 ≤ Module.finrank ℝ E) {g : E → ℝ} + (hg : Continuous g) (hc : HasCompactSupport g) (e x : E) : + Integrable (fun y => kernelDir e (x-y)*g y) := by + have hh := (locallyIntegrable_kernelDir hn e).integrable_smul_right_of_hasCompactSupport + (hg.comp (continuous_const.sub continuous_id)) (hc.comp_homeomorph (Homeomorph.subLeft x)) + have hi := (Measure.measurePreserving_sub_left volume x).integrable_comp hh.aestronglyMeasurable + apply hi.mpr hh |>.congr + exact Eventually.of_forall fun y => by simp only [Function.comp_apply,Pi.sub_apply,id_eq,sub_sub_cancel,smul_eq_mul] + +lemma dir_rawPotential_local (hn : 1 ≤ Module.finrank ℝ E) {g : E → ℝ} + (hg : ContDiff ℝ 2 g) (hc : HasCompactSupport g) (e x : E) : + dir (rawPotential g) e x = ∫ y, kernelDir e (x-y)*g y := by + let φ : E → ℝ := fun z => g (x-z) + have hφ : ContDiff ℝ 2 φ := hg.comp (contDiff_const.sub contDiff_id) + have hφc : HasCompactSupport φ := hc.comp_homeomorph (Homeomorph.subLeft x) + have hdφ (z : E) : dir φ e z = -dir g e (x-z) := by + unfold dir φ + have hd := (hg.differentiable (by norm_num) (x-z)).hasFDerivAt.comp z + ((hasFDerivAt_id z).const_sub x) + have hfd : fderiv ℝ (fun z => g (x-z)) z = _ := hd.fderiv + rw [hfd] + simp + have hh := integral_kernel_dir hn hφ hφc e + simp_rw [hdφ,mul_neg,integral_neg] at hh + have hh' := neg_injective hh + rw [rawPotential_eq_convolve,dir_convolve (locallyIntegrable_newtonKernel hn) (hg.of_le (by norm_num)) hc,convolve_def,hh'] + rw [← integral_sub_left_eq_self (fun z => kernelDir e z*g (x-z)) volume x] + simp only [sub_sub_cancel] + +lemma hasLineDerivAt_rawPotential_local (hn : 1 ≤ Module.finrank ℝ E) {g : E → ℝ} + (hg : ContDiff ℝ 2 g) (hc : HasCompactSupport g) (e x : E) : + HasLineDerivAt ℝ (rawPotential g) (∫ y, kernelDir e (x-y)*g y) x e := by + have hd : Differentiable ℝ (rawPotential g) := by + rw [rawPotential_eq_convolve] + exact (contDiff_convolve (locallyIntegrable_newtonKernel hn) hg hc).differentiable (by norm_num) + rw [← dir_rawPotential_local hn hg hc] + exact (hd x).hasFDerivAt.hasLineDerivAt e +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE6} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +lemma hasLineDerivAt_rawPotential (hn : 3 ≤ Module.finrank ℝ E) {g : E → ℝ} {s : Set E} + (hg : Measurable g) (hgp : ∀ x, 0 ≤ g x) (hs : IsOpen s) (hgc : ContDiffOn ℝ 2 g s) + (hi : ∀ x, Integrable (fun y => ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y)) + {x₀ : E} (hx₀ : x₀ ∈ s) (e : E) : + Integrable (fun y => kernelDir e (x₀-y)*g y) ∧ + HasLineDerivAt ℝ (rawPotential g) (∫ y, kernelDir e (x₀-y)*g y) x₀ e := by + obtain ⟨r,hr,hrs⟩ := Metric.mem_nhds_iff.mp (hs.mem_nhds hx₀) + let ξ : ContDiffBump x₀ := ⟨r/4,r/2,by linarith,by linarith⟩ + have hξs : tsupport ξ ⊆ s := by + apply Subset.trans (by rw [ξ.tsupport_eq] : tsupport ξ ⊆ Metric.closedBall x₀ ξ.rOut) + intro y hy + apply hrs + have hy' : dist y x₀ ≤ r/2 := hy + change dist y x₀ < r + linarith + let g₀ : E → ℝ := fun y => ξ y*g y + let g₁ : E → ℝ := fun y => (1-ξ y)*g y + have hg₀c : ContDiff ℝ 2 g₀ := contDiff_mul_cutoff hs hgc ξ.contDiff hξs + have hg₀k : HasCompactSupport g₀ := ξ.hasCompactSupport.mul_right + have hg₁m : Measurable g₁ := (measurable_const.sub ξ.continuous.measurable).mul hg + have hg₁p : ∀ y, 0 ≤ g₁ y := fun y => mul_nonneg (sub_nonneg.mpr (ξ.le_one (x := y))) (hgp y) + have hi₀ (x : E) := rawPotential_integrable_cutoff hg hgp ξ.continuous.measurable + (fun _ => ξ.nonneg) (fun _ => ξ.le_one) (hi x) + have hi₁ (x : E) : Integrable (fun y => ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*((1-ξ y)*g y)) := by + simpa only [Pi.sub_apply] using rawPotential_integrable_cutoff hg hgp + (measurable_const.sub ξ.continuous.measurable) (fun y => sub_nonneg.mpr (ξ.le_one (x := y))) + (fun y => by change 1-ξ y ≤ 1; linarith [ξ.nonneg (x := y)]) (hi x) + obtain ⟨hd₁,hfar⟩ := hasLineDerivAt_far_rawPotential hn hg₁m hg₁p (r := r/4) (by linarith) + (by intro y hy + have heq : ξ y = 1 := ξ.one_of_mem_closedBall (Metric.ball_subset_closedBall hy) + simp [g₁,heq]) (hi₁ x₀) e + have hd₀ := integrable_kernelDir_local (by omega : 1 ≤ Module.finrank ℝ E) hg₀c.continuous hg₀k e x₀ + have heqD : (fun y => kernelDir e (x₀-y)*g y) = + (fun y => kernelDir e (x₀-y)*g₀ y+kernelDir e (x₀-y)*g₁ y) := by + funext y; dsimp [g₀,g₁]; ring + refine ⟨?_,?_⟩ + · rw [heqD] + exact hd₀.add hd₁ + have heq : rawPotential g = fun x => rawPotential g₀ x+rawPotential g₁ x := by + ext x + change (∫ y, ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y) = + (∫ y, ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*(ξ y*g y)) + + (∫ y, ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*((1-ξ y)*g y)) + rw [← integral_add (hi₀ x) (hi₁ x)] + apply integral_congr_ae + exact Eventually.of_forall fun y => by ring + rw [heq,heqD,integral_add hd₀ hd₁] + exact (hasLineDerivAt_rawPotential_local (by omega) hg₀c hg₀k e x₀).add hfar +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden +open WeakPDE +lemma IsSolution.gradient_u {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + {x : Space n} (hx : x ≠ 0) (e : Space n) : + Integrable (fun y => kernelDir e (x-y)*source v p A y) ∧ + newtonDenom n*dir u e x = ∫ y, kernelDir e (x-y)*source v p A y := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + obtain ⟨hi,hd⟩ := hasLineDerivAt_rawPotential (by simpa using h.dimension_ge_three hn) + (measurable_source h.continuous_v p A) (source_nonneg (fun y => (h.positive_v y).le) p A) + isOpen_compl_singleton (regular_source h.regular_v h.positive_v p A) + (by simpa only [finrank_euclideanSpace_fin] using h.kernel_g_integrable hn) hx e + refine ⟨hi,?_⟩ + have hu := (h.regular_u.contDiffAt (isOpen_compl_singleton.mem_nhds hx)).differentiableAt (by norm_num) + have hd' : HasLineDerivAt ℝ (fun y => newtonDenom n*u y) (newtonDenom n*dir u e x) x e := by + simpa only [dir,_root_.smul_apply,smul_eq_mul] using (hu.hasFDerivAt.const_mul (newtonDenom n)).hasLineDerivAt e + apply hd'.unique + apply hd.congr_of_eventuallyEq + filter_upwards [isOpen_compl_singleton.mem_nhds hx] with y hy + exact h.potential_u hn hq hy +end HenonLaneEmden +end +end Gradients + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Harmonic.lean b/lean/OAI/Analysis/HenonEmden/Harmonic.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9f359e4d09c8be3aada2f5261c9b113183c4ffc --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Harmonic.lean @@ -0,0 +1,147 @@ +import OAI.Analysis.HenonEmden.FundamentalSolution + +namespace OAI + +universe uE uE2 + +section Harmonic + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +open Set Filter Topology +open MeasureTheory Set Filter Topology +open scoped ContDiff +noncomputable section + + +namespace HenonLaneEmden.SphereCalculus +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +lemma harmonic_mean_zero (hn : 2 ≤ Module.finrank ℝ E) {u : E → ℝ} + (hu : ContDiff ℝ 2 u) (heq : ∀ x, Laplacian.laplacian u x = 0) {R : ℝ} (hR : 0 ≤ R) : + mean u R = mean u 0 := by + have hflux (r : ℝ) (hr : 0 < r) : HasDerivAt + (fun s => s^(Module.finrank ℝ E-1)*meanD u s) 0 r := by + convert hasDerivAt_mean_flux hu.contDiffOn (continuous_const.continuousOn : ContinuousOn (fun _ : E => (0:ℝ)) ({0}ᶜ)) + (fun x _ => by rw [heq x,neg_zero]) hr using 1 + simp [mean] + have hfluxzero (r : ℝ) (hr : 0 < r) : meanD u r = 0 := by + have hc : Continuous (fun s => s^(Module.finrank ℝ E-1)*meanD u s) := + (continuous_id.pow _).mul (continuous_meanD_global hu) + have hh := intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hr.le hc.continuousOn + (fun s hs => hflux s hs.1) (intervalIntegrable_const : IntervalIntegrable (fun _ : ℝ => (0:ℝ)) volume 0 r) + simp only [intervalIntegral.integral_zero,zero_pow (by omega : Module.finrank ℝ E-1 ≠ 0),zero_mul,sub_zero] at hh + exact (mul_eq_zero.mp hh.symm).resolve_left (pow_ne_zero _ hr.ne') + have hh := intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hR (continuous_mean hu.continuous).continuousOn + (fun s hs => by simpa only [hfluxzero s hs.1] using hasDerivAt_mean hu.contDiffOn hs.1) + (intervalIntegrable_const : IntervalIntegrable (fun _ : ℝ => (0:ℝ)) volume 0 R) + simpa only [intervalIntegral.integral_zero,sub_eq_zero] using hh.symm + +lemma harmonic_ball_zero (hn : 2 ≤ Module.finrank ℝ E) {u : E → ℝ} + (hu : ContDiff ℝ 2 u) (heq : ∀ x, Laplacian.laplacian u x = 0) (R : ℝ) : + (∫ x in Metric.ball (0:E) R, u x) = (volume (Metric.ball (0:E) R)).toReal*u 0 := by + have hi : IntegrableOn u (Metric.ball (0:E) R) := + (hu.continuous.locallyIntegrable.integrableOn_isCompact (isCompact_closedBall (0:E) R)).mono_set Metric.ball_subset_closedBall + have hic : IntegrableOn (fun _ : E => u 0) (Metric.ball (0:E) R) := integrableOn_const + have hc : (volume (Metric.ball (0:E) R)).toReal*u 0 = ∫ _ : E in Metric.ball (0:E) R, u 0 := by simp [Measure.real] + rw [hc] + rw [← integral_indicator measurableSet_ball,← integral_indicator measurableSet_ball, + Polar.integral_polar volume _ ((integrable_indicator_iff measurableSet_ball).mpr hi), + Polar.integral_polar volume _ ((integrable_indicator_iff measurableSet_ball).mpr hic)] + apply setIntegral_congr_fun measurableSet_Ioi + intro r hr + dsimp only + have hh : ∀ θ : UnitSphere E, (r • (θ:E)) ∈ Metric.ball (0:E) R ↔ r < R := by + intro θ; rw [Metric.mem_ball,dist_zero_right,norm_smul_sphere hr.le] + by_cases hrR : r < R + · have hiu : (fun θ : UnitSphere E => (Metric.ball (0:E) R).indicator u (r • (θ:E))) = + fun θ : UnitSphere E => u (r • (θ:E)) := by + ext θ + exact indicator_of_mem ((hh θ).mpr hrR) _ + have hic0 : (fun θ : UnitSphere E => (Metric.ball (0:E) R).indicator (fun _ => u 0) (r • (θ:E))) = + fun _ => u 0 := by + ext θ + exact indicator_of_mem ((hh θ).mpr hrR) _ + rw [hiu,hic0] + change r^(Module.finrank ℝ E-1)*mean u r = _ + rw [harmonic_mean_zero hn hu heq hr.le,mean_zero] + simp [integral_const,Measure.real,smul_eq_mul] + · have hzero (f : E → ℝ) : (fun θ : UnitSphere E => (Metric.ball (0:E) R).indicator f (r • (θ:E))) = 0 := by + ext θ + exact indicator_of_notMem (mt (hh θ).mp hrR) _ + rw [hzero,hzero] +end HenonLaneEmden.SphereCalculus + +namespace HenonLaneEmden.SphereCalculus +variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +lemma harmonic_ball (hn : 2 ≤ Module.finrank ℝ E) {u : E → ℝ} + (hu : ContDiff ℝ 2 u) (heq : ∀ x, Laplacian.laplacian u x = 0) (x : E) (R : ℝ) : + (∫ y in Metric.ball x R, u y) = (volume (Metric.ball x R)).toReal*u x := by + have hh := harmonic_ball_zero hn (hu.comp (contDiff_const.sub contDiff_id)) + (fun z => by change Laplacian.laplacian (fun y => u (x-y)) z = 0; rw [WeakPDE.laplacian_reflect hu,heq]) R + simp only [Function.comp_def,id_eq,sub_zero] at hh + have hind : (fun y => (Metric.ball x R).indicator u (x-y)) = + (Metric.ball (0:E) R).indicator (fun y => u (x-y)) := by + ext y + have hm : x-y ∈ Metric.ball x R ↔ y ∈ Metric.ball (0:E) R := by + simp [Metric.mem_ball,dist_eq_norm] + by_cases hy : y ∈ Metric.ball (0:E) R + · rw [indicator_of_mem ((hm).mpr hy),indicator_of_mem hy] + · rw [indicator_of_notMem (mt hm.mp hy),indicator_of_notMem hy] + have ht := integral_sub_left_eq_self (μ := volume) ((Metric.ball x R).indicator u) x + rw [hind,integral_indicator measurableSet_ball,integral_indicator measurableSet_ball] at ht + rw [← ht,hh,Measure.addHaar_ball_center volume x] + +lemma harmonic_nonnegative_constant (hn : 2 ≤ Module.finrank ℝ E) {u : E → ℝ} + (hu : ContDiff ℝ 2 u) (heq : ∀ x, Laplacian.laplacian u x = 0) (hp : ∀ x, 0 ≤ u x) + (x z : E) : u x = u z := by + suffices h : ∀ x z : E, u x ≤ u z from le_antisymm (h x z) (h z x) + intro x z + let b := dist x z + let c := (volume (Metric.ball (0:E) 1)).toReal + have hc : 0 < c := ENNReal.toReal_pos (Metric.measure_ball_pos volume (0:E) zero_lt_one).ne' + (measure_ball_lt_top (μ := volume)).ne + have hv (y : E) (R : ℝ) (hR : 0 < R) : (volume (Metric.ball y R)).toReal = R^(Module.finrank ℝ E)*c := by + rw [Measure.addHaar_ball_of_pos volume y hR,ENNReal.toReal_mul,ENNReal.toReal_ofReal (pow_nonneg hR.le _)] + have hcomp (R : ℝ) (hR : 0 < R) : u x ≤ (1+b/R)^(Module.finrank ℝ E)*u z := by + have hb : 0 ≤ b := dist_nonneg + have hs : Metric.ball x R ⊆ Metric.ball z (R+b) := by + intro y hy + have ht := dist_triangle y x z + change dist y z < R+dist x z + change dist y x < R at hy + linarith + have hI := setIntegral_mono_set (μ := volume) (s := Metric.ball x R) (t := Metric.ball z (R+b)) + ((hu.continuous.locallyIntegrable.integrableOn_isCompact (isCompact_closedBall z (R+b))).mono_set Metric.ball_subset_closedBall) + (Eventually.of_forall fun y => hp y) (Eventually.of_forall hs) + rw [harmonic_ball hn hu heq,harmonic_ball hn hu heq,hv x R hR,hv z (R+b) (by positivity)] at hI + have hfac : (R+b)^(Module.finrank ℝ E) = R^(Module.finrank ℝ E)*(1+b/R)^(Module.finrank ℝ E) := by + rw [← mul_pow] + congr 1 + field_simp + rw [hfac] at hI + apply (mul_le_mul_iff_of_pos_left (mul_pos (pow_pos hR _) hc)).mp + convert hI using 1; ring + have ht : Tendsto (fun R : ℝ => (1+b/R)^(Module.finrank ℝ E)*u z) atTop (𝓝 (u z)) := by + have hh := (((tendsto_const_nhds : Tendsto (fun _ : ℝ => b) atTop (𝓝 b)).div_atTop tendsto_id).const_add 1).pow (Module.finrank ℝ E) + simpa using hh.mul_const (u z) + exact ge_of_tendsto ht (eventually_atTop.2 ⟨1,fun R hR => hcomp R (by linarith)⟩) +end HenonLaneEmden.SphereCalculus + +end +end Harmonic + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/IntegratedPressure.lean b/lean/OAI/Analysis/HenonEmden/IntegratedPressure.lean new file mode 100644 index 0000000000000000000000000000000000000000..3bb4cc178756cbc573fbc5fbfac656d4a8617177 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/IntegratedPressure.lean @@ -0,0 +1,65 @@ +import OAI.Analysis.HenonEmden.AngularLoss + +namespace OAI + +universe uα + +section IntegratedPressure + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open Cutoff AdaptiveCap SpatialComponents LayerTonelli + +lemma integrate_pressure_sum {α : Type uα} [MeasurableSpace α] {μ : Measure α} + {F G P Q L J D H : α → ℝ≥0∞} (hF : Measurable F) (hG : Measurable G) + (hP : Measurable P) (hQ : Measurable Q) (hL : Measurable L) (hJ : Measurable J) + (hD : Measurable D) (hH : Measurable H) {a b c d : ℝ≥0∞} + (hh : ∀ x, a*F x+b*G x ≤ P x+Q x+2*(L x+J x)+(c*D x+d*H x)) : + a*(∫⁻ x, F x ∂μ)+b*(∫⁻ x, G x ∂μ) ≤ + (∫⁻ x, P x ∂μ)+(∫⁻ x, Q x ∂μ)+2*((∫⁻ x, L x ∂μ)+(∫⁻ x, J x ∂μ))+ + (c*(∫⁻ x, D x ∂μ)+d*(∫⁻ x, H x ∂μ)) := by + have hPQ : Measurable (fun x => P x+Q x) := hP.add hQ + have hLJ : Measurable (fun x => L x+J x) := hL.add hJ + have hAll : Measurable (fun x => P x+Q x+2*(L x+J x)) := hPQ.add (hLJ.const_mul 2) + have hb := lintegral_mono (μ := μ) hh + rw [lintegral_add_left (hF.const_mul a),lintegral_const_mul _ hF,lintegral_const_mul _ hG, + lintegral_add_left hAll, + lintegral_add_left hPQ,lintegral_add_left hP, + lintegral_const_mul _ hLJ,lintegral_add_left hL, + lintegral_add_left (hD.const_mul c),lintegral_const_mul _ hD,lintegral_const_mul _ hH] at hb + exact hb + +lemma IsSolution.integrated_directional_pressure {n : ℕ} (hn : 3 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) : + ENNReal.ofReal (1/(q+1))*weightedEnergyN (w n) u q B+ + ENNReal.ofReal (1/(p+1))*weightedEnergyN (w n) v p A ≤ + (∫⁻ e : sphere (0:Space n) 1, capPressureIntegral (source u q B) (source v p A) κ e ∂volume.toSphere)+ + (∫⁻ e : sphere (0:Space n) 1, capMismatchIntegral (source u q B) (source v p A) κ e ∂volume.toSphere)+ + 2*((∫⁻ e : sphere (0:Space n) 1, lossIntegral u (source u q B) κ δ e ∂volume.toSphere)+ + (∫⁻ e : sphere (0:Space n) 1, lossIntegral v (source v p A) κ δ e ∂volume.toSphere))+ + (ENNReal.ofReal (endpointConstant q B*δ)*weightedEnergyN (fun x => d x*w n x) u q B+ + ENNReal.ofReal (endpointConstant p A*δ)*weightedEnergyN (fun x => d x*w n x) v p A) := by + have hn1 : 1 ≤ n := by omega + have hb := integrate_pressure_sum (μ := (volume : Measure (Space n)).toSphere) + (measurable_cap_energy hn1 hκ hκ1 h.continuous_u q B) + (measurable_cap_energy hn1 hκ hκ1 h.continuous_v p A) + (measurable_cap_pressure hn1 hκ hκ1 _ _) (measurable_cap_mismatch hn1 hκ hκ1 _ _) + (measurable_cap_loss hn1 hκ hκ1 h.continuous_u.measurable (isOpen_source_subgraph h.regular_u h.positive_u q B)) + (measurable_cap_loss hn1 hκ hκ1 h.continuous_v.measurable (isOpen_source_subgraph h.regular_v h.positive_v p A)) + (measurable_cap_d_energy hn1 hκ hκ1 h.continuous_u q B) + (measurable_cap_d_energy hn1 hκ hκ1 h.continuous_v p A) + (IsSolution_directional_pressure hn h hp hq hκ hκ1 hδ) + rw [lintegral_angular_energy hn1 hκ hκ1 h.continuous_u, + lintegral_angular_energy hn1 hκ hκ1 h.continuous_v, + lintegral_angular_d_energy hn1 hκ hκ1 h.continuous_u, + lintegral_angular_d_energy hn1 hκ hκ1 h.continuous_v] at hb + exact hb + +end HenonLaneEmden +end +end IntegratedPressure + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/IntegratedRecovery.lean b/lean/OAI/Analysis/HenonEmden/IntegratedRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f20ba4f4b1b708684daaa3c060ce3a89dc1b041 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/IntegratedRecovery.lean @@ -0,0 +1,139 @@ +import OAI.Analysis.HenonEmden.WeightedEnergy + +namespace OAI + +section IntegratedRecovery + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap LayerTonelli + +lemma lintegral_weight_layer {n : ℕ} {u : Space n → ℝ} {q B : ℝ} + (hu : Measurable u) (hu0 : ∀ x, 0 ≤ u x) (hf : Measurable (source u q B)) + {χ : Space n → ℝ} (hχ : Measurable χ) (_hχ0 : ∀ x, 0 ≤ χ x) : + (∫⁻ z, ENNReal.ofReal (χ z.1*u z.1) ∂layerMeasure volume (source u q B)) = + weightedEnergyN χ u q B := by + rw [lintegral_layerMeasure_fst volume hf (F := fun x => ENNReal.ofReal (χ x*u x)) (by fun_prop)] + apply lintegral_congr + intro x + rw [← ENNReal.ofReal_mul (source_nonneg hu0 q B x)] + congr 1 + ring + +lemma lintegral_pressure_root {n : ℕ} {u : Space n → ℝ} {q B : ℝ} + (hu : Measurable u) (hup : ∀ x, 0 < u x) (hq : 0 < q) (hf : Measurable (source u q B)) + {χ : Space n → ℝ} (hχ : Measurable χ) (hχ0 : ∀ x, 0 ≤ χ x) : + (∫⁻ z, ENNReal.ofReal (χ z.1*(u z.1-sourceRoot q B z)) ∂layerMeasure volume (source u q B)) = + ENNReal.ofReal (1/(q+1))*weightedEnergyN χ u q B := by + rw [lintegral_layerMeasure volume hf (by fun_prop)] + simp_rw [ENNReal.ofReal_mul (hχ0 _)] + have he (x : Space n) : (∫⁻ t in Ioo 0 (source u q B x), ENNReal.ofReal (χ x)* + ENNReal.ofReal (u x-sourceRoot q B (x,t))) = + ENNReal.ofReal (1/(q+1))*ENNReal.ofReal (χ x*source u q B x*u x) := by + rw [lintegral_const_mul _ (by fun_prop),lintegral_source_residual hup hq, + ← ENNReal.ofReal_mul (hχ0 x),← ENNReal.ofReal_mul (one_div_nonneg.mpr (by linarith : 0 ≤ q+1))] + congr 1 + ring + simp_rw [he] + exact lintegral_const_mul _ (by fun_prop) + +lemma IsSolution_endpointIntegral_bound {n : ℕ} (hn : 2 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) (e : sphere (0:Space n) 1) : + endpointIntegral u (source u q B) κ δ e ≤ + ENNReal.ofReal (1+endpointConstant q B*δ)*weightedEnergyN (weight volume κ e) u q B := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have huM := h.continuous_u.measurable + have hfM := measurable_source h.continuous_u q B + have hm := (continuous_weight volume hκ hκ1 e).measurable + have hd : Measurable (d : Space n → ℝ) := continuous_d.measurable + have hc := endpointConstant_nonneg q B + have hpoint (z : Space n × ℝ) (hz : z ∈ sourceSubgraph (source u q B)) : + lineWeight volume (source u q B) κ δ (e,z)*endpointAverage u (source u q B) (e,z) ≤ + (1+endpointConstant q B*δ)*(weight volume κ e z.1*u z.1) := by + have hχ := lineWeight_nonneg volume (source u q B) κ δ (e,z) + have hh := weight_nonneg volume κ e z.1 + have hu0 := (h.positive_u z.1).le + by_cases hpos : 0 < lineWeight volume (source u q B) κ δ (e,z) + · have he := (abs_le.mp (source_endpoint_error (by omega) h.regular_u h.positive_u hq hκ hκ1 hδ hpos)).2 + have hr := (sourceRoot_bounds h.positive_u hq hz).2 + change sourceRoot q B z ≤ u z.1 at hr + have hε : endpointConstant q B*δ*d z.1*u z.1 ≤ endpointConstant q B*δ*u z.1 := by + exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (d_le_one z.1) (mul_nonneg hc hδ)) hu0 |>.trans_eq (by ring) + have hle : endpointAverage u (source u q B) (e,z) ≤ (1+endpointConstant q B*δ)*u z.1 := by + change endpointAverage u (source u q B) (e,z)-sourceRoot q B z ≤ _ at he + nlinarith + calc + _ ≤ lineWeight volume (source u q B) κ δ (e,z)*((1+endpointConstant q B*δ)*u z.1) := + mul_le_mul_of_nonneg_left hle hχ + _ ≤ weight volume κ e z.1*((1+endpointConstant q B*δ)*u z.1) := + mul_le_mul_of_nonneg_right (lineWeight_le volume _ _ _ _) (by positivity) + _ = _ := by ring + · rw [le_antisymm (not_lt.mp hpos) hχ,zero_mul] + positivity + calc + _ ≤ ∫⁻ z, ENNReal.ofReal ((1+endpointConstant q B*δ)*(weight volume κ e z.1*u z.1)) + ∂layerMeasure volume (source u q B) := by + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem (measurableSet_sourceSubgraph hfM)] with z hz + exact ENNReal.ofReal_le_ofReal (hpoint z hz) + _ = _ := by + simp_rw [ENNReal.ofReal_mul (show 0 ≤ 1+endpointConstant q B*δ by positivity)] + rw [lintegral_const_mul _ (by fun_prop),lintegral_weight_layer h.continuous_u.measurable + (fun x => (h.positive_u x).le) hfM hm (weight_nonneg volume κ e)] + +lemma IsSolution_endpointIntegral_finite {n : ℕ} (hn : 2 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) (e : sphere (0:Space n) 1) : + endpointIntegral u (source u q B) κ δ e ≠ ⊤ := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + exact ne_top_of_le_ne_top (ENNReal.mul_ne_top ENNReal.ofReal_ne_top + (h.weightedEnergyN_finite hn (continuous_weight volume hκ hκ1 e) (compactSupport_weight κ e))) + (IsSolution_endpointIntegral_bound hn h hq hκ hκ1 hδ e) + +lemma IsSolution_integrated_pressure_recovery {n : ℕ} (hn : 2 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) (e : sphere (0:Space n) 1) : + ENNReal.ofReal (1/(q+1))*weightedEnergyN (weight volume κ e) u q B+ + endpointIntegral u (source u q B) κ δ e ≤ + positionIntegral u (source u q B) κ δ e+lossIntegral u (source u q B) κ δ e+ + ENNReal.ofReal (endpointConstant q B*δ)*weightedEnergyN (fun x => d x*weight volume κ e x) u q B := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have huM := h.continuous_u.measurable + have hfM := measurable_source h.continuous_u q B + have hf := isOpen_source_subgraph h.regular_u h.positive_u q B + have hm := (continuous_weight volume hκ hκ1 e).measurable + have hmχ : Measurable (fun z : Space n × ℝ => lineWeight volume (source u q B) κ δ (e,z)) := + (measurable_lineWeight volume hf hκ hκ1 δ).comp (measurable_const.prodMk measurable_id) + have hlo := measurable_lowerPoint hf + have hhi := measurable_upperPoint hf + have hd : Measurable (d : Space n → ℝ) := continuous_d.measurable + have hc := endpointConstant_nonneg q B + have hrec := lintegral_mono_ae (μ := layerMeasure volume (source u q B)) (show ∀ᵐ z ∂layerMeasure volume (source u q B), + ENNReal.ofReal (weight volume κ e z.1*(u z.1-sourceRoot q B z))+ + ENNReal.ofReal (lineWeight volume (source u q B) κ δ (e,z)*endpointAverage u (source u q B) (e,z)) ≤ + ENNReal.ofReal (lineWeight volume (source u q B) κ δ (e,z)*u z.1)+ + ENNReal.ofReal ((weight volume κ e z.1-lineWeight volume (source u q B) κ δ (e,z))*u z.1)+ + ENNReal.ofReal (endpointConstant q B*δ*d z.1*weight volume κ e z.1*u z.1) from by + filter_upwards [ae_restrict_mem (measurableSet_sourceSubgraph hfM)] with z hz + exact source_pressure_recovery_pointwise (by omega) h.regular_u h.positive_u hq hκ hκ1 hδ e hz) + rw [lintegral_add_left (by fun_prop),lintegral_add_left (by fun_prop),lintegral_add_left (by fun_prop), + lintegral_pressure_root huM h.positive_u hq hfM hm (weight_nonneg volume κ e)] at hrec + change _ ≤ positionIntegral u (source u q B) κ δ e+lossIntegral u (source u q B) κ δ e+_ at hrec + convert hrec using 1 + congr 1 + have he (z : Space n × ℝ) : ENNReal.ofReal (endpointConstant q B*δ*d z.1*weight volume κ e z.1*u z.1) = + ENNReal.ofReal (endpointConstant q B*δ)*ENNReal.ofReal ((d z.1*weight volume κ e z.1)*u z.1) := by + rw [← ENNReal.ofReal_mul (mul_nonneg hc hδ)]; congr 1; ring + simp_rw [he] + rw [lintegral_const_mul _ (by fun_prop), + lintegral_weight_layer huM (fun x => (h.positive_u x).le) hfM (by fun_prop) + (fun x => mul_nonneg (d_nonneg x) (weight_nonneg volume κ e x))] + +end HenonLaneEmden.SpatialComponents +end +end IntegratedRecovery + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Interaction.lean b/lean/OAI/Analysis/HenonEmden/Interaction.lean new file mode 100644 index 0000000000000000000000000000000000000000..6c76ee64625d78265f8236342c7564eb1fd560bc --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Interaction.lean @@ -0,0 +1,131 @@ +import OAI.Analysis.HenonEmden.Energy + +namespace OAI + +section Interaction + +open MeasureTheory Set Filter Topology Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open LayerTonelli + +/-- The Newton kernel, including its harmless diagonal convention. -/ +def newtonKernel (n : ℕ) (z : Space n × Space n) : ℝ := + (newtonDenom n)⁻¹*‖z.1-z.2‖^(2-(n:ℝ)) + +@[fun_prop] lemma measurable_newtonKernel (n : ℕ) : Measurable (newtonKernel n) := by + unfold newtonKernel; fun_prop +lemma newtonKernel_symm (n : ℕ) (x y : Space n) : + newtonKernel n (x,y)=newtonKernel n (y,x) := by + simp only [newtonKernel,norm_sub_rev x y] +lemma newtonKernel_nonneg {n : ℕ} (hn : 3 ≤ n) (z : Space n × Space n) : + 0 ≤ newtonKernel n z := + mul_nonneg (inv_nonneg.mpr (newtonDenom_pos hn).le) (Real.rpow_nonneg (norm_nonneg _) _) + +lemma IsSolution.newton_potential_u {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + {x : Space n} (hx : x ≠ 0) : + potential volume (fun z => ENNReal.ofReal (newtonKernel n z)) (source v p A) x = + ENNReal.ofReal (u x) := by + have hd := newtonDenom_pos (h.dimension_ge_three hn) + have hgm := measurable_source h.continuous_v p A + unfold potential newtonKernel + simp_rw [ENNReal.ofReal_mul (inv_nonneg.mpr hd.le),mul_left_comm (ENNReal.ofReal (source v p A _))] + rw [lintegral_const_mul _ (by fun_prop)] + have hi := ofReal_integral_eq_lintegral_ofReal (h.kernel_g_integrable hn x) + (ae_of_all _ fun y => mul_nonneg (Real.rpow_nonneg (norm_nonneg _) _) + (source_nonneg (fun y => (h.positive_v y).le) p A y)) + have he : (∫⁻ y, ENNReal.ofReal (source v p A y)*ENNReal.ofReal (‖x-y‖^(2-(n:ℝ)))) = + ENNReal.ofReal (newtonDenom n*u x) := by + rw [h.potential_u hn hq hx] + simp only [WeakPDE.rawPotential,finrank_euclideanSpace_fin] + rw [hi] + apply lintegral_congr + intro y + rw [ENNReal.ofReal_mul (Real.rpow_nonneg (norm_nonneg _) _),mul_comm] + rw [he,← ENNReal.ofReal_mul (inv_nonneg.mpr hd.le)] + congr 1 + field_simp + +lemma IsSolution.newton_potential_u_ae {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) : + ∀ᵐ x, potential volume (fun z => ENNReal.ofReal (newtonKernel n z)) (source v p A) x = + ENNReal.ofReal (u x) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + filter_upwards [ae_iff.mpr (by simp : volume {x : Space n | ¬ x ≠ 0}=0)] with x hx + exact h.newton_potential_u hn hq hx + +def interaction {n : ℕ} (f g : Space n → ℝ) : Measure (Space n × Space n) := + (volume.prod volume).withDensity (fun z => ENNReal.ofReal (f z.1)*ENNReal.ofReal (g z.2)* + ENNReal.ofReal (newtonKernel n z)) + +instance interaction_sigmaFinite {n : ℕ} (f g : Space n → ℝ) : SigmaFinite (interaction f g) := by + unfold interaction + apply SigmaFinite.withDensity_of_ne_top + filter_upwards [] with z + exact ENNReal.mul_ne_top (ENNReal.mul_ne_top ENNReal.ofReal_ne_top ENNReal.ofReal_ne_top) ENNReal.ofReal_ne_top + +lemma lintegral_interaction {n : ℕ} {f g : Space n → ℝ} + (hf : Measurable f) (hg : Measurable g) {F : Space n × Space n → ℝ≥0∞} + (hF : Measurable F) : + (∫⁻ z, F z ∂interaction f g) = + ∫⁻ z, ENNReal.ofReal (f z.1)*ENNReal.ofReal (g z.2)*ENNReal.ofReal (newtonKernel n z)*F z ∂volume.prod volume := + lintegral_withDensity_eq_lintegral_mul _ (by fun_prop [measurable_newtonKernel]) hF + +lemma lintegral_interaction_left {n : ℕ} {f g : Space n → ℝ} + (hf : Measurable f) (hg : Measurable g) {F : Space n → ℝ≥0∞} (hF : Measurable F) : + (∫⁻ z, F z.1 ∂interaction f g) = ∫⁻ x, ENNReal.ofReal (f x)*F x* + potential volume (fun z => ENNReal.ofReal (newtonKernel n z)) g x := by + rw [lintegral_interaction hf hg (by fun_prop),lintegral_prod _ (by fun_prop [measurable_newtonKernel])] + apply lintegral_congr + intro x + have he (y : Space n) : + ENNReal.ofReal (f x)*ENNReal.ofReal (g y)*ENNReal.ofReal (newtonKernel n (x,y))*F x = + (ENNReal.ofReal (f x)*F x)*(ENNReal.ofReal (g y)*ENNReal.ofReal (newtonKernel n (x,y))) := by ring + simp_rw [he] + rw [lintegral_const_mul _ (by fun_prop [measurable_newtonKernel])] + rfl + +lemma lintegral_interaction_right {n : ℕ} {f g : Space n → ℝ} + (hf : Measurable f) (hg : Measurable g) {F : Space n → ℝ≥0∞} (hF : Measurable F) : + (∫⁻ z, F z.2 ∂interaction f g) = ∫⁻ y, ENNReal.ofReal (g y)*F y* + potential volume (fun z => ENNReal.ofReal (newtonKernel n z)) f y := by + rw [lintegral_interaction hf hg (by fun_prop),← lintegral_prod_swap] + change (∫⁻ z : Space n × Space n, ENNReal.ofReal (f z.2)*ENNReal.ofReal (g z.1)* + ENNReal.ofReal (newtonKernel n (z.2,z.1))*F z.1 ∂volume.prod volume) = _ + simp_rw [newtonKernel_symm n _ _] + have he (z : Space n × Space n) : + ENNReal.ofReal (f z.2)*ENNReal.ofReal (g z.1)*ENNReal.ofReal (newtonKernel n (z.1,z.2))*F z.1 = + ENNReal.ofReal (g z.1)*ENNReal.ofReal (f z.2)*ENNReal.ofReal (newtonKernel n z)*F z.1 := by ring + simp_rw [he] + rw [← lintegral_interaction hg hf (by fun_prop)] + exact lintegral_interaction_left hg hf hF + +lemma IsSolution.interaction_left {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + {F : Space n → ℝ≥0∞} (hF : Measurable F) : + (∫⁻ z, F z.1 ∂interaction (source u q B) (source v p A)) = + ∫⁻ x, ENNReal.ofReal (source u q B x*u x)*F x := by + rw [lintegral_interaction_left (measurable_source h.continuous_u q B) (measurable_source h.continuous_v p A) hF] + apply lintegral_congr_ae + filter_upwards [h.newton_potential_u_ae hn hq] with x hx + rw [hx,ENNReal.ofReal_mul (source_nonneg (fun x => (h.positive_u x).le) q B x)] + ring + +lemma IsSolution.interaction_right {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) + {F : Space n → ℝ≥0∞} (hF : Measurable F) : + (∫⁻ z, F z.2 ∂interaction (source u q B) (source v p A)) = + ∫⁻ y, ENNReal.ofReal (source v p A y*v y)*F y := by + rw [lintegral_interaction_right (measurable_source h.continuous_u q B) (measurable_source h.continuous_v p A) hF] + apply lintegral_congr_ae + filter_upwards [h.swap.newton_potential_u_ae hn hp] with y hy + rw [hy,ENNReal.ofReal_mul (source_nonneg (fun x => (h.positive_v x).le) p A y)] + ring + +end HenonLaneEmden +end +end Interaction + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/InteractionBounds.lean b/lean/OAI/Analysis/HenonEmden/InteractionBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc24db279a779615c708a9529d7a314079146d3f --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/InteractionBounds.lean @@ -0,0 +1,104 @@ +import OAI.Analysis.HenonEmden.RealInteraction + +namespace OAI + +universe uα + +section InteractionBounds + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open Cutoff + +lemma integrable_integral_le_of_lintegral_le {α : Type uα} [MeasurableSpace α] {μ : Measure α} + {F : α → ℝ} (hF : Measurable F) (hF0 : ∀ x, 0 ≤ F x) {C : ℝ} (hC : 0 ≤ C) + (hb : (∫⁻ x, ENNReal.ofReal (F x) ∂μ) ≤ ENNReal.ofReal C) : + Integrable F μ ∧ (∫ x, F x ∂μ) ≤ C := by + have hf : (∫⁻ x, ENNReal.ofReal (F x) ∂μ) ≠ ⊤ := ne_top_of_le_ne_top ENNReal.ofReal_ne_top hb + refine ⟨(lintegral_ofReal_ne_top_iff_integrable hF.aestronglyMeasurable (ae_of_all _ hF0)).mp hf,?_⟩ + rw [integral_eq_lintegral_of_nonneg_ae (ae_of_all _ hF0) hF.aestronglyMeasurable] + exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top hb).trans_eq (ENNReal.toReal_ofReal hC) + +lemma IsSolution.lintegral_weight_left {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v χ : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + (hχ : Continuous χ) (hχc : HasCompactSupport χ) (hχ0 : ∀ x, 0 ≤ χ x) : + (∫⁻ z, ENNReal.ofReal (χ z.1) ∂interaction (source u q B) (source v p A)) = + ENNReal.ofReal (weightedEnergy χ u q B) := by + rw [h.interaction_left hn hq hχ.measurable.ennreal_ofReal,← h.weightedEnergyN_eq hn hχ hχc hχ0] + unfold weightedEnergyN + apply lintegral_congr + intro x + rw [← ENNReal.ofReal_mul (mul_nonneg (source_nonneg (fun x => (h.positive_u x).le) q B x) (h.positive_u x).le)] + congr 1; ring + +lemma IsSolution.lintegral_weight_right {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v χ : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) + (hχ : Continuous χ) (hχc : HasCompactSupport χ) (hχ0 : ∀ x, 0 ≤ χ x) : + (∫⁻ z, ENNReal.ofReal (χ z.2) ∂interaction (source u q B) (source v p A)) = + ENNReal.ofReal (weightedEnergy χ v p A) := by + rw [h.interaction_right hn hp hχ.measurable.ennreal_ofReal,← h.swap.weightedEnergyN_eq hn hχ hχc hχ0] + unfold weightedEnergyN + apply lintegral_congr + intro x + rw [← ENNReal.ofReal_mul (mul_nonneg (source_nonneg (fun x => (h.positive_v x).le) p A x) (h.positive_v x).le)] + congr 1; ring + +lemma IsSolution.weight_left {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v χ : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + (hχ : Continuous χ) (hχc : HasCompactSupport χ) (hχ0 : ∀ x, 0 ≤ χ x) : + Integrable (fun z => χ z.1) (interaction (source u q B) (source v p A)) ∧ + (∫ z, χ z.1 ∂interaction (source u q B) (source v p A)) = weightedEnergy χ u q B := by + have he := h.lintegral_weight_left hn hq hχ hχc hχ0 + refine ⟨(integrable_integral_le_of_lintegral_le (hχ.measurable.comp measurable_fst) (fun z => hχ0 z.1) + (weightedEnergyN_nonneg hχ0 (fun x => (h.positive_u x).le)) he.le).1,?_⟩ + rw [integral_eq_lintegral_of_nonneg_ae (ae_of_all _ (fun z : Space n × Space n => hχ0 z.1)) (hχ.measurable.comp measurable_fst).aestronglyMeasurable,he, + ENNReal.toReal_ofReal (weightedEnergyN_nonneg hχ0 (fun x => (h.positive_u x).le))] + +lemma IsSolution.weight_right {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v χ : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) + (hχ : Continuous χ) (hχc : HasCompactSupport χ) (hχ0 : ∀ x, 0 ≤ χ x) : + Integrable (fun z => χ z.2) (interaction (source u q B) (source v p A)) ∧ + (∫ z, χ z.2 ∂interaction (source u q B) (source v p A)) = weightedEnergy χ v p A := by + have he := h.lintegral_weight_right hn hp hχ hχc hχ0 + refine ⟨(integrable_integral_le_of_lintegral_le (hχ.measurable.comp measurable_snd) (fun z => hχ0 z.2) + (weightedEnergyN_nonneg hχ0 (fun x => (h.positive_v x).le)) he.le).1,?_⟩ + rw [integral_eq_lintegral_of_nonneg_ae (ae_of_all _ (fun z : Space n × Space n => hχ0 z.2)) (hχ.measurable.comp measurable_snd).aestronglyMeasurable,he, + ENNReal.toReal_ofReal (weightedEnergyN_nonneg hχ0 (fun x => (h.positive_v x).le))] + +lemma IsSolution.farWeight_bound {n : ℕ} (hn : 2 ≤ n) {p q A B δ j : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hj : 0 ≤ j+(m n:ℝ)*(2-(n:ℝ))) : + Integrable (farWeight δ j) (interaction (source u q B) (source v p A)) ∧ + (∫ z, farWeight δ j z ∂interaction (source u q B) (source v p A)) ≤ farConstant n p q A B δ := + integrable_integral_le_of_lintegral_le (by fun_prop) (farWeight_nonneg δ j) (farConstant_nonneg p q A B hδ.le) + (h.far_interaction_bound hn hp hq hδ hδ1 hj) + +lemma IsSolution.farWeight_swap_bound {n : ℕ} (hn : 2 ≤ n) {p q A B δ j : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hj : 0 ≤ j+(m n:ℝ)*(2-(n:ℝ))) : + Integrable (fun z => farWeight δ j z.swap) (interaction (source u q B) (source v p A)) ∧ + (∫ z, farWeight δ j z.swap ∂interaction (source u q B) (source v p A)) ≤ farConstant n q p B A δ := by + apply integrable_integral_le_of_lintegral_le ((measurable_farWeight n δ j).comp measurable_swap) (fun z => farWeight_nonneg δ j z.swap) + (farConstant_nonneg q p B A hδ.le) + simp only [Function.comp_def] + rw [lintegral_interaction_swap (measurable_source h.continuous_u q B) + (measurable_source h.continuous_v p A) (measurable_farWeight n δ j).ennreal_ofReal] + exact h.swap.far_interaction_bound hn hq hp hδ hδ1 hj + +lemma cutoff_far_exponents (n : ℕ) : + 0 ≤ ((N n-1:ℕ):ℝ)+(m n:ℝ)*(2-(n:ℝ)) ∧ + 0 ≤ ((N n:ℝ)-(m n:ℝ))+(m n:ℝ)*(2-(n:ℝ)) ∧ + 0 ≤ ((N n-n:ℕ):ℝ)+(m n:ℝ)*(2-(n:ℝ)) := by + have hN : 1 ≤ N n := by have := N_ge_two n; omega + have hNn : n ≤ N n := by unfold N; omega + rw [Nat.cast_sub hN,Nat.cast_sub hNn] + simp only [N,m,k,Nat.cast_add,Nat.cast_mul,Nat.cast_ofNat,Nat.cast_one] + constructor <;> (try constructor) <;> nlinarith [Nat.cast_nonneg (α:=ℝ) n] + +end HenonLaneEmden +end +end InteractionBounds + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Intervals.lean b/lean/OAI/Analysis/HenonEmden/Intervals.lean new file mode 100644 index 0000000000000000000000000000000000000000..8246256608ceb7a909b9b82a39bde1a24ca48ddc --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Intervals.lean @@ -0,0 +1,569 @@ +import OAI.Analysis.HenonEmden.SpatialComponents + +namespace OAI + +section Intervals +open MeasureTheory Set Filter Topology +namespace HenonLaneEmden.IntervalGeometry + + +/-- Integral over the segment of half-length `r` centered at `x`. -/ +noncomputable def segmentIntegral (k : ℝ → ℝ) (r x : ℝ) : ℝ := + ∫ t in x - r..x + r, k t + +lemma primitive_hasDerivAt {k : ℝ → ℝ} (hk : Continuous k) (x : ℝ) : + HasDerivAt (fun s => ∫ t in (0 : ℝ)..s, k t) (k x) x := + intervalIntegral.integral_hasDerivAt_right (hk.intervalIntegrable _ _) + hk.aestronglyMeasurable.stronglyMeasurableAtFilter hk.continuousAt + +lemma segmentIntegral_eq_primitive {k : ℝ → ℝ} (hk : Continuous k) (r x : ℝ) : + segmentIntegral k r x = (∫ t in (0 : ℝ)..x + r, k t) - + (∫ t in (0 : ℝ)..x - r, k t) := by + unfold segmentIntegral + have h := intervalIntegral.integral_add_adjacent_intervals + (hk.intervalIntegrable (μ := volume) 0 (x - r)) (hk.intervalIntegrable (x - r) (x + r)) + linarith + +lemma segmentIntegral_hasDerivAt {k : ℝ → ℝ} (hk : Continuous k) (r x : ℝ) : + HasDerivAt (segmentIntegral k r) (k (x + r) - k (x - r)) x := by + have h₁ := (primitive_hasDerivAt hk (x + r)).comp x ((hasDerivAt_id x).add_const r) + have h₂ := (primitive_hasDerivAt hk (x - r)).comp x ((hasDerivAt_id x).sub_const r) + have heq : segmentIntegral k r = (fun y => + (∫ t in (0 : ℝ)..y + r, k t) - (∫ t in (0 : ℝ)..y - r, k t)) := + funext (segmentIntegral_eq_primitive hk r) + rw [heq] + convert h₁.sub h₂ using 1 <;> first | rfl | simp only [mul_one] + +lemma segmentIntegral_continuous {k : ℝ → ℝ} (hk : Continuous k) (r : ℝ) : + Continuous (segmentIntegral k r) := + continuous_iff_continuousAt.mpr (fun x => (segmentIntegral_hasDerivAt hk r x).continuousAt) + +lemma segmentIntegral_even {k : ℝ → ℝ} (heven : ∀ x, k (-x) = k x) (r x : ℝ) : + segmentIntegral k r (-x) = segmentIntegral k r x := by + unfold segmentIntegral + have h := intervalIntegral.integral_comp_neg (a := x-r) (b := x+r) k + simp only [heven] at h + rw [show -x - r = -(x + r) by ring, show -x + r = -(x - r) by ring] + exact h.symm + +lemma segmentIntegral_antitoneOn {k : ℝ → ℝ} (hk : Continuous k) + (hanti : ∀ {x y : ℝ}, |x| ≤ |y| → k y ≤ k x) {r : ℝ} (hr : 0 ≤ r) : + AntitoneOn (segmentIntegral k r) (Ici 0) := by + apply antitoneOn_of_deriv_nonpos (convex_Ici 0) (segmentIntegral_continuous hk r).continuousOn + · exact fun x _ => (segmentIntegral_hasDerivAt hk r x).differentiableAt.differentiableWithinAt + · intro x hx + rw [(segmentIntegral_hasDerivAt hk r x).deriv] + apply sub_nonpos.mpr + apply hanti + have hx' : 0 ≤ x := le_of_lt (by simpa only [interior_Ici, mem_Ioi] using hx) + rw [abs_of_nonneg (add_nonneg hx' hr)] + exact abs_le.mpr ⟨by linarith, by linarith⟩ + +lemma segmentIntegral_abs {k : ℝ → ℝ} (heven : ∀ x, k (-x) = k x) (r x : ℝ) : + segmentIntegral k r |x| = segmentIntegral k r x := by + rcases le_or_gt 0 x with hx | hx + · rw [abs_of_nonneg hx] + · rw [abs_of_neg hx] + exact segmentIntegral_even heven r x + +lemma segmentIntegral_antitone_abs {k : ℝ → ℝ} (hk : Continuous k) + (heven : ∀ x, k (-x) = k x) + (hanti : ∀ {x y : ℝ}, |x| ≤ |y| → k y ≤ k x) + {r : ℝ} (hr : 0 ≤ r) {x y : ℝ} (hxy : |x| ≤ |y|) : + segmentIntegral k r y ≤ segmentIntegral k r x := by + rw [← segmentIntegral_abs heven r y, ← segmentIntegral_abs heven r x] + exact segmentIntegral_antitoneOn hk hanti hr (abs_nonneg x) (abs_nonneg y) hxy + +lemma integral_translate_eq_segment (k : ℝ → ℝ) (c d x : ℝ) : + (∫ y in c..d, k (x - y)) = + segmentIntegral k ((d-c)/2) (x-(c+d)/2) := by + rw [intervalIntegral.integral_comp_sub_left] + unfold segmentIntegral + congr 1 <;> ring + +/-- The drift of the two interval midpoints has the opposite sign to the + integrated endpoint difference of a symmetric decreasing kernel. -/ +lemma midpoint_endpoint_sign {k : ℝ → ℝ} (hk : Continuous k) + (heven : ∀ x, k (-x) = k x) + (hanti : ∀ {x y : ℝ}, |x| ≤ |y| → k y ≤ k x) + {a b c d : ℝ} (hab : a ≤ b) (hcd : c ≤ d) : + ((a+b)/2-(c+d)/2) * (∫ y in c..d, (k (b-y)-k (a-y))) ≤ 0 := by + have hkb : Continuous (fun y : ℝ => k (b-y)) := hk.comp (continuous_const.sub continuous_id) + have hka : Continuous (fun y : ℝ => k (a-y)) := hk.comp (continuous_const.sub continuous_id) + rw [intervalIntegral.integral_sub (hkb.intervalIntegrable c d) (hka.intervalIntegrable c d)] + rw [integral_translate_eq_segment k c d b, integral_translate_eq_segment k c d a] + have hr : 0 ≤ (d-c)/2 := by linarith + rcases le_or_gt 0 ((a+b)/2-(c+d)/2) with hm | hm + · apply mul_nonpos_of_nonneg_of_nonpos hm + apply sub_nonpos.mpr + apply segmentIntegral_antitone_abs hk heven hanti hr + rw [← sq_le_sq] + nlinarith + · apply mul_nonpos_of_nonpos_of_nonneg hm.le + apply sub_nonneg.mpr + apply segmentIntegral_antitone_abs hk heven hanti hr + rw [← sq_le_sq] + nlinarith + + + + +/-- Restricted Newton kernel; `c` is its (positive) normalization. -/ +noncomputable def kernel (n : ℕ) (l c h : ℝ) : ℝ := + c * (l ^ 2 + h ^ 2) ^ ((2 - (n : ℝ)) / 2) + +lemma base_pos {l : ℝ} (hl : 0 < l) (x : ℝ) : 0 < l ^ 2 + x ^ 2 := by + positivity + +lemma kernel_nonneg (n : ℕ) {l c : ℝ} (hc : 0 ≤ c) (h : ℝ) : + 0 ≤ kernel n l c h := by + unfold kernel + positivity + +lemma kernel_even (n : ℕ) (l c h : ℝ) : kernel n l c (-h) = kernel n l c h := by + simp [kernel] + +lemma kernel_continuous (n : ℕ) {l : ℝ} (hl : 0 < l) (c : ℝ) : + Continuous (kernel n l c) := by + apply continuous_const.mul + exact (continuous_const.add (continuous_id.pow 2)).rpow_const + (fun x => Or.inl (ne_of_gt (base_pos hl x))) + +lemma kernel_hasDerivAt (n : ℕ) {l : ℝ} (hl : 0 < l) (c h : ℝ) : + HasDerivAt (kernel n l c) + (-((n : ℝ) - 2) * h / (l ^ 2 + h ^ 2) * kernel n l c h) h := by + have hd := ((((hasDerivAt_id h).pow 2).const_add (l ^ 2)).rpow_const (p := (2 - (n : ℝ)) / 2) + (Or.inl (ne_of_gt (base_pos hl h)))).const_mul c + convert hd using 1 <;> try rfl + simp only [kernel, id_eq, Pi.pow_apply, Nat.cast_ofNat, Nat.reduceSub, + pow_one, mul_one, Real.rpow_sub (base_pos hl h), Real.rpow_one] + field_simp + ring + +lemma kernel_antitone_abs (n : ℕ) (hn : 3 ≤ n) {l c : ℝ} (hl : 0 < l) + (hc : 0 ≤ c) {x y : ℝ} (hxy : |x| ≤ |y|) : kernel n l c y ≤ kernel n l c x := by + apply mul_le_mul_of_nonneg_left _ hc + apply Real.rpow_le_rpow_of_nonpos (base_pos hl x) + · have hsq : x ^ 2 ≤ y ^ 2 := by simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg x) hxy 2 + linarith + · have hn' : (3 : ℝ) ≤ n := by exact_mod_cast hn + linarith + + + + +noncomputable def boxIntegral (a b c d : ℝ) (F : ℝ → ℝ → ℝ) : ℝ := + ∫ x in a..b, ∫ y in c..d, F x y + +lemma boxIntegral_congr (a b c d : ℝ) {F G : ℝ → ℝ → ℝ} + (h : ∀ x y, F x y = G x y) : boxIntegral a b c d F = boxIntegral a b c d G := by + have heq : F = G := funext (fun x => funext (h x)) + rw [heq] + +lemma boxIntegral_add (a b c d : ℝ) {F G : ℝ → ℝ → ℝ} + (hF : Continuous F.uncurry) (hG : Continuous G.uncurry) : + boxIntegral a b c d (fun x y => F x y + G x y) = + boxIntegral a b c d F + boxIntegral a b c d G := by + unfold boxIntegral + simp_rw [intervalIntegral.integral_add + ((hF.uncurry_left _).intervalIntegrable c d) ((hG.uncurry_left _).intervalIntegrable c d)] + exact intervalIntegral.integral_add + ((intervalIntegral.continuous_parametric_intervalIntegral_of_continuous' hF c d).intervalIntegrable a b) + ((intervalIntegral.continuous_parametric_intervalIntegral_of_continuous' hG c d).intervalIntegrable a b) + +lemma boxIntegral_sub (a b c d : ℝ) {F G : ℝ → ℝ → ℝ} + (hF : Continuous F.uncurry) (hG : Continuous G.uncurry) : + boxIntegral a b c d (fun x y => F x y - G x y) = + boxIntegral a b c d F - boxIntegral a b c d G := by + unfold boxIntegral + simp_rw [intervalIntegral.integral_sub + ((hF.uncurry_left _).intervalIntegrable c d) ((hG.uncurry_left _).intervalIntegrable c d)] + exact intervalIntegral.integral_sub + ((intervalIntegral.continuous_parametric_intervalIntegral_of_continuous' hF c d).intervalIntegrable a b) + ((intervalIntegral.continuous_parametric_intervalIntegral_of_continuous' hG c d).intervalIntegrable a b) + +lemma boxIntegral_const_mul (a b c d t : ℝ) (F : ℝ → ℝ → ℝ) : + boxIntegral a b c d (fun x y => t * F x y) = t * boxIntegral a b c d F := by + simp only [boxIntegral, intervalIntegral.integral_const_mul] + +lemma boxIntegral_swap (a b c d : ℝ) {F : ℝ → ℝ → ℝ} + (hF : Continuous F.uncurry) : + boxIntegral a b c d F = boxIntegral c d a b (fun y x => F x y) := by + apply intervalIntegral_intervalIntegral_swap + exact (ContinuousOn.integrableOn_compact + (isCompact_uIcc.prod isCompact_uIcc) hF.continuousOn).mono_set + (Set.prod_mono uIoc_subset_uIcc uIoc_subset_uIcc) + +lemma boxIntegral_nonneg {a b c d : ℝ} (hab : a ≤ b) (hcd : c ≤ d) + {F : ℝ → ℝ → ℝ} (hF : ∀ x y, 0 ≤ F x y) : 0 ≤ boxIntegral a b c d F := by + apply intervalIntegral.integral_nonneg hab + intro x _ + exact intervalIntegral.integral_nonneg hcd (fun y _ => hF x y) + +lemma endpoint_defect {k k' : ℝ → ℝ} (hk : Continuous k) (hk' : Continuous k') + (hderiv : ∀ x, HasDerivAt k (k' x) x) (a b y : ℝ) : + (∫ x in a..b, k (x-y)) - (b-a) * ((k (a-y) + k (b-y))/2) = + -(∫ x in a..b, (x-(a+b)/2) * k' (x-y)) := by + have hkxy : Continuous (fun x : ℝ => k (x-y)) := hk.comp (continuous_id.sub continuous_const) + have hk'xy : Continuous (fun x : ℝ => k' (x-y)) := hk'.comp (continuous_id.sub continuous_const) + have hdkxy (x : ℝ) : HasDerivAt (fun x : ℝ => k (x-y)) (k' (x-y)) x := by + convert (hderiv (x-y)).comp x ((hasDerivAt_id x).sub_const y) using 1 <;> + first | rfl | simp only [mul_one] + have hparts := intervalIntegral.integral_mul_deriv_eq_deriv_mul_of_hasDerivAt + (u := fun x : ℝ => x-(a+b)/2) (v := fun x : ℝ => k (x-y)) + (u' := fun _ => 1) (v' := fun x => k' (x-y)) + (continuous_id.sub continuous_const).continuousOn hkxy.continuousOn + (fun x _ => (hasDerivAt_id x).sub_const ((a+b)/2)) (fun x _ => hdkxy x) + (continuous_const.intervalIntegrable a b) (hk'xy.intervalIntegrable a b) + simp only [one_mul] at hparts + linarith [hparts] + +lemma endpoint_defect_right {k k' : ℝ → ℝ} (hk : Continuous k) (hk' : Continuous k') + (hderiv : ∀ x, HasDerivAt k (k' x) x) (c d x : ℝ) : + (∫ y in c..d, k (x-y)) - (d-c) * ((k (x-c) + k (x-d))/2) = + ∫ y in c..d, (y-(c+d)/2) * k' (x-y) := by + have hkxy : Continuous (fun y : ℝ => k (x-y)) := hk.comp (continuous_const.sub continuous_id) + have hk'xy : Continuous (fun y : ℝ => -k' (x-y)) := (hk'.comp (continuous_const.sub continuous_id)).neg + have hdkxy (y : ℝ) : HasDerivAt (fun y : ℝ => k (x-y)) (-k' (x-y)) y := by + convert (hderiv (x-y)).comp y ((hasDerivAt_id y).const_sub x) using 1 <;> + first | rfl | simp only [mul_neg, mul_one] + have hparts := intervalIntegral.integral_mul_deriv_eq_deriv_mul_of_hasDerivAt + (u := fun y : ℝ => y-(c+d)/2) (v := fun y : ℝ => k (x-y)) + (u' := fun _ => 1) (v' := fun y => -k' (x-y)) + (continuous_id.sub continuous_const).continuousOn hkxy.continuousOn + (fun y _ => (hasDerivAt_id y).sub_const ((c+d)/2)) (fun y _ => hdkxy y) + (continuous_const.intervalIntegrable c d) (hk'xy.intervalIntegrable c d) + simp only [one_mul, mul_neg, intervalIntegral.integral_neg] at hparts + linarith [hparts] + +lemma box_endpoint_defect_left {k k' : ℝ → ℝ} (hk : Continuous k) (hk' : Continuous k') + (hderiv : ∀ x, HasDerivAt k (k' x) x) (a b c d : ℝ) : + boxIntegral a b c d (fun x y => k (x-y) - (k (a-y)+k (b-y))/2) = + boxIntegral a b c d (fun x y => -((x-(a+b)/2)*k' (x-y))) := by + rw [boxIntegral_swap a b c d (by fun_prop), + boxIntegral_swap a b c d (by fun_prop)] + unfold boxIntegral + apply intervalIntegral.integral_congr + intro y _ + dsimp only + have hkxy : Continuous (fun x : ℝ => k (x-y)) := hk.comp (continuous_id.sub continuous_const) + rw [intervalIntegral.integral_sub (g := fun _ : ℝ => (k (a-y)+k (b-y))/2) (hkxy.intervalIntegrable a b) + (continuous_const.intervalIntegrable a b), intervalIntegral.integral_const, + intervalIntegral.integral_neg, smul_eq_mul] + exact endpoint_defect hk hk' hderiv a b y + +lemma box_endpoint_defect_right {k k' : ℝ → ℝ} (hk : Continuous k) (hk' : Continuous k') + (hderiv : ∀ x, HasDerivAt k (k' x) x) (a b c d : ℝ) : + boxIntegral a b c d (fun x y => k (x-y) - (k (x-c)+k (x-d))/2) = + boxIntegral a b c d (fun x y => (y-(c+d)/2)*k' (x-y)) := by + unfold boxIntegral + apply intervalIntegral.integral_congr + intro x _ + dsimp only + have hkxy : Continuous (fun y : ℝ => k (x-y)) := hk.comp (continuous_const.sub continuous_id) + rw [intervalIntegral.integral_sub (g := fun _ : ℝ => (k (x-c)+k (x-d))/2) (hkxy.intervalIntegrable c d) + (continuous_const.intervalIntegrable c d), intervalIntegral.integral_const, smul_eq_mul] + exact endpoint_defect_right hk hk' hderiv c d x + +lemma box_midpoint_identity {k k' : ℝ → ℝ} (hk : Continuous k) (hk' : Continuous k') + (hderiv : ∀ x, HasDerivAt k (k' x) x) (a b c d : ℝ) : + boxIntegral a b c d (fun x y => 2*k (x-y) - (k (a-y)+k (b-y))/2 - + (k (x-c)+k (x-d))/2) = + boxIntegral a b c d (fun x y => -(x-y-((a+b)/2-(c+d)/2))*k' (x-y)) := by + calc + _ = boxIntegral a b c d (fun x y => + (k (x-y) - (k (a-y)+k (b-y))/2) + (k (x-y) - (k (x-c)+k (x-d))/2)) := by + apply boxIntegral_congr; intros; ring + _ = boxIntegral a b c d (fun x y => k (x-y) - (k (a-y)+k (b-y))/2) + + boxIntegral a b c d (fun x y => k (x-y) - (k (x-c)+k (x-d))/2) := + boxIntegral_add a b c d (by fun_prop) (by fun_prop) + _ = boxIntegral a b c d (fun x y => -((x-(a+b)/2)*k' (x-y))) + + boxIntegral a b c d (fun x y => (y-(c+d)/2)*k' (x-y)) := by + rw [box_endpoint_defect_left hk hk' hderiv, box_endpoint_defect_right hk hk' hderiv] + _ = boxIntegral a b c d (fun x y => + -((x-(a+b)/2)*k' (x-y)) + (y-(c+d)/2)*k' (x-y)) := + (boxIntegral_add a b c d (by fun_prop) (by fun_prop)).symm + _ = _ := by apply boxIntegral_congr; intros; ring + + +lemma box_integral_derivative {k k' : ℝ → ℝ} (hk' : Continuous k') + (hderiv : ∀ x, HasDerivAt k (k' x) x) (a b c d : ℝ) : + boxIntegral a b c d (fun x y => k' (x-y)) = + ∫ y in c..d, (k (b-y)-k (a-y)) := by + rw [boxIntegral_swap a b c d (by fun_prop)] + unfold boxIntegral + apply intervalIntegral.integral_congr + intro y _ + dsimp only + apply intervalIntegral.integral_eq_sub_of_hasDerivAt + · intro x _ + convert (hderiv (x-y)).comp x ((hasDerivAt_id x).sub_const y) using 1 <;> + first | rfl | simp only [mul_one] + · exact (hk'.comp (continuous_id.sub continuous_const)).intervalIntegrable a b + +lemma box_midpoint_sign {k k' : ℝ → ℝ} (hk : Continuous k) (hk' : Continuous k') + (hderiv : ∀ x, HasDerivAt k (k' x) x) + (heven : ∀ x, k (-x) = k x) + (hanti : ∀ {x y : ℝ}, |x| ≤ |y| → k y ≤ k x) + {a b c d : ℝ} (hab : a ≤ b) (hcd : c ≤ d) : + ((a+b)/2-(c+d)/2) * boxIntegral a b c d (fun x y => k' (x-y)) ≤ 0 := by + rw [box_integral_derivative hk' hderiv] + exact midpoint_endpoint_sign hk heven hanti hab hcd + +/-- General interval comparison before substituting the Newton kernel. -/ +lemma box_endpoint_comparison {k k' : ℝ → ℝ} (hk : Continuous k) (hk' : Continuous k') + (hderiv : ∀ x, HasDerivAt k (k' x) x) + (heven : ∀ x, k (-x) = k x) + (hanti : ∀ {x y : ℝ}, |x| ≤ |y| → k y ≤ k x) + {a b c d : ℝ} (hab : a ≤ b) (hcd : c ≤ d) : + boxIntegral a b c d (fun x y => 2*k (x-y) - (k (a-y)+k (b-y))/2 - + (k (x-c)+k (x-d))/2) ≤ + boxIntegral a b c d (fun x y => -(x-y)*k' (x-y)) := by + rw [box_midpoint_identity hk hk' hderiv] + have hsplit : boxIntegral a b c d + (fun x y => -(x-y-((a+b)/2-(c+d)/2))*k' (x-y)) = + boxIntegral a b c d (fun x y => -(x-y)*k' (x-y)) + + ((a+b)/2-(c+d)/2) * boxIntegral a b c d (fun x y => k' (x-y)) := by + calc + _ = boxIntegral a b c d (fun x y => -(x-y)*k' (x-y) + + ((a+b)/2-(c+d)/2)*k' (x-y)) := by + apply boxIntegral_congr; intros; ring + _ = _ := by + rw [boxIntegral_add a b c d (by fun_prop) (by fun_prop), boxIntegral_const_mul] + rw [hsplit] + linarith [box_midpoint_sign hk hk' hderiv heven hanti hab hcd] + +lemma kernel_derivative_continuous (n : ℕ) {l : ℝ} (hl : 0 < l) (c : ℝ) : + Continuous (fun h : ℝ => -((n : ℝ)-2)*h/(l^2+h^2)*kernel n l c h) := by + apply Continuous.mul _ (kernel_continuous n hl c) + exact (continuous_const.mul continuous_id).div + (continuous_const.add (continuous_id.pow 2)) (fun x => ne_of_gt (base_pos hl x)) + +/-- The two unweighted endpoint defects are controlled by the directional interaction. -/ +lemma newton_endpoint_comparison (n : ℕ) (hn : 3 ≤ n) {l C a b c d : ℝ} + (hl : 0 < l) (hC : 0 ≤ C) (hab : a ≤ b) (hcd : c ≤ d) : + boxIntegral a b c d (fun x y => 2*kernel n l C (x-y) - + (kernel n l C (a-y)+kernel n l C (b-y))/2 - + (kernel n l C (x-c)+kernel n l C (x-d))/2) ≤ + ((n : ℝ)-2)*boxIntegral a b c d + (fun x y => (x-y)^2/(l^2+(x-y)^2)*kernel n l C (x-y)) := by + have h := box_endpoint_comparison (kernel_continuous n hl C) + (kernel_derivative_continuous n hl C) (kernel_hasDerivAt n hl C) + (kernel_even n l C) (fun hxy => kernel_antitone_abs n hn hl hC hxy) hab hcd + calc + _ ≤ _ := h + _ = _ := by + rw [← boxIntegral_const_mul] + apply boxIntegral_congr + intro x y + ring + +lemma weighted_scalar_comparison {K EI EJ T cI cJ : ℝ} + (hEI : 0 ≤ EI) (hEJ : 0 ≤ EJ) (hI : 0 ≤ cI) (hJ : 0 ≤ cJ) + (hpair : 2*K-EI-EJ ≤ T) : + (cI+cJ)*K ≤ cI*EI+cJ*EJ+min cI cJ*T+|cI-cJ| * K := by + rcases le_total cI cJ with hij | hji + · rw [min_eq_left hij, abs_of_nonpos (sub_nonpos.mpr hij)] + have h := mul_le_mul_of_nonneg_left hpair hI + have h' := mul_nonneg (sub_nonneg.mpr hij) hEJ + nlinarith + · rw [min_eq_right hji, abs_of_nonneg (sub_nonneg.mpr hji)] + have h := mul_le_mul_of_nonneg_left hpair hJ + have h' := mul_nonneg (sub_nonneg.mpr hji) hEI + nlinarith + +/-- Weighted interval comparison, with finite endpoints. The normalizing +constant `C` may be instantiated by `1 / ((n-2) * area(S^(n-1)))`. -/ +lemma bounded_weighted_interval_comparison (n : ℕ) (hn : 3 ≤ n) + {l C a b c d cI cJ : ℝ} (hl : 0 < l) (hC : 0 ≤ C) + (hab : a ≤ b) (hcd : c ≤ d) (hcI : 0 ≤ cI) (hcJ : 0 ≤ cJ) : + (cI+cJ) * boxIntegral a b c d (fun x y => kernel n l C (x-y)) ≤ + cI * boxIntegral a b c d (fun _ y => (kernel n l C (a-y)+kernel n l C (b-y))/2) + + cJ * boxIntegral a b c d (fun x _ => (kernel n l C (x-c)+kernel n l C (x-d))/2) + + (((n : ℝ)-2)*min cI cJ) * boxIntegral a b c d + (fun x y => (x-y)^2/(l^2+(x-y)^2)*kernel n l C (x-y)) + + |cI-cJ| * boxIntegral a b c d (fun x y => kernel n l C (x-y)) := by + have hk := kernel_continuous n hl C + have hcomp := newton_endpoint_comparison n hn hl hC hab hcd + rw [boxIntegral_sub a b c d (by fun_prop) (by fun_prop), + boxIntegral_sub a b c d (by fun_prop) (by fun_prop), boxIntegral_const_mul] at hcomp + have hEI : 0 ≤ boxIntegral a b c d + (fun _ y => (kernel n l C (a-y)+kernel n l C (b-y))/2) := by + apply boxIntegral_nonneg hab hcd + intro x y + exact div_nonneg (add_nonneg (kernel_nonneg n hC (a-y)) (kernel_nonneg n hC (b-y))) (by norm_num) + have hEJ : 0 ≤ boxIntegral a b c d + (fun x _ => (kernel n l C (x-c)+kernel n l C (x-d))/2) := by + apply boxIntegral_nonneg hab hcd + intro x y + exact div_nonneg (add_nonneg (kernel_nonneg n hC (x-c)) (kernel_nonneg n hC (x-d))) (by norm_num) + have hw := weighted_scalar_comparison hEI hEJ hcI hcJ hcomp + nlinarith [hw] + + +lemma ofReal_boxIntegral {a b c d : ℝ} (hab : a ≤ b) (hcd : c ≤ d) + {F : ℝ → ℝ → ℝ} (hF : Continuous F.uncurry) (hpos : ∀ x y, 0 ≤ F x y) : + ENNReal.ofReal (boxIntegral a b c d F) = + ∫⁻ x in Ioo a b, ∫⁻ y in Ioo c d, ENNReal.ofReal (F x y) := by + simp only [Measure.restrict_congr_set (Ioo_ae_eq_Ioc (μ := volume))] + unfold boxIntegral + rw [intervalIntegral.integral_of_le hab] + rw [ofReal_integral_eq_lintegral_ofReal] + · apply lintegral_congr + intro x + rw [intervalIntegral.integral_of_le hcd] + exact ofReal_integral_eq_lintegral_ofReal + (by + change IntegrableOn (F x) (Ioc c d) volume + exact ((hF.uncurry_left x).intervalIntegrable c d).1) + (Filter.Eventually.of_forall (hpos x)) + · change IntegrableOn _ (Ioc a b) volume + exact ((intervalIntegral.continuous_parametric_intervalIntegral_of_continuous' hF c d).intervalIntegrable a b).1 + · exact Filter.Eventually.of_forall fun x => + intervalIntegral.integral_nonneg hcd (fun y _ => hpos x y) + +lemma bounded_weighted_interval_lintegral (n : ℕ) (hn : 3 ≤ n) + {l C a b c d cI cJ : ℝ} (hl : 0 < l) (hC : 0 ≤ C) + (hab : a ≤ b) (hcd : c ≤ d) (hcI : 0 ≤ cI) (hcJ : 0 ≤ cJ) : + (∫⁻ x in Ioo a b, ∫⁻ y in Ioo c d, + ENNReal.ofReal ((cI+cJ)*kernel n l C (x-y))) ≤ + ∫⁻ x in Ioo a b, ∫⁻ y in Ioo c d, + ENNReal.ofReal (cI*((kernel n l C (a-y)+kernel n l C (b-y))/2) + + cJ*((kernel n l C (x-c)+kernel n l C (x-d))/2) + + (((n:ℝ)-2)*min cI cJ*((x-y)^2/(l^2+(x-y)^2))+|cI-cJ|)*kernel n l C (x-y)) := by + have hk := kernel_continuous n hl C + have hD : Continuous (fun z : ℝ × ℝ => (z.1-z.2)^2/(l^2+(z.1-z.2)^2)) := + ((continuous_fst.sub continuous_snd).pow 2).div + (continuous_const.add ((continuous_fst.sub continuous_snd).pow 2)) + (fun z => ne_of_gt (base_pos hl (z.1-z.2))) + have hpc (x y : ℝ) : 0 ≤ (x-y)^2/(l^2+(x-y)^2) := + div_nonneg (sq_nonneg _) (base_pos hl _).le + have hn' : 0 ≤ (n : ℝ)-2 := by exact_mod_cast (show 0 ≤ (n : ℤ)-2 by omega) + have hleft : ∀ x y, 0 ≤ (cI+cJ)*kernel n l C (x-y) := + fun x y => mul_nonneg (add_nonneg hcI hcJ) (kernel_nonneg n hC _) + have hright (x y : ℝ) : 0 ≤ cI*((kernel n l C (a-y)+kernel n l C (b-y))/2) + + cJ*((kernel n l C (x-c)+kernel n l C (x-d))/2) + + (((n:ℝ)-2)*min cI cJ*((x-y)^2/(l^2+(x-y)^2))+|cI-cJ|)*kernel n l C (x-y) := by + apply add_nonneg + · apply add_nonneg + · exact mul_nonneg hcI (div_nonneg + (add_nonneg (kernel_nonneg n hC _) (kernel_nonneg n hC _)) (by norm_num)) + · exact mul_nonneg hcJ (div_nonneg + (add_nonneg (kernel_nonneg n hC _) (kernel_nonneg n hC _)) (by norm_num)) + · exact mul_nonneg (add_nonneg + (mul_nonneg (mul_nonneg hn' (le_min hcI hcJ)) (hpc x y)) (abs_nonneg _)) + (kernel_nonneg n hC _) + rw [← ofReal_boxIntegral hab hcd (by fun_prop (disch := positivity)) hleft, + ← ofReal_boxIntegral hab hcd (by fun_prop (disch := positivity)) hright] + apply ENNReal.ofReal_le_ofReal + have heq : boxIntegral a b c d (fun x y => + cI*((kernel n l C (a-y)+kernel n l C (b-y))/2) + + cJ*((kernel n l C (x-c)+kernel n l C (x-d))/2) + + (((n:ℝ)-2)*min cI cJ*((x-y)^2/(l^2+(x-y)^2))+|cI-cJ|)*kernel n l C (x-y)) = + cI * boxIntegral a b c d (fun _ y => (kernel n l C (a-y)+kernel n l C (b-y))/2) + + cJ * boxIntegral a b c d (fun x _ => (kernel n l C (x-c)+kernel n l C (x-d))/2) + + (((n:ℝ)-2)*min cI cJ) * boxIntegral a b c d + (fun x y => (x-y)^2/(l^2+(x-y)^2)*kernel n l C (x-y)) + + |cI-cJ| * boxIntegral a b c d (fun x y => kernel n l C (x-y)) := by + calc + _ = boxIntegral a b c d (fun x y => + (cI*((kernel n l C (a-y)+kernel n l C (b-y))/2) + + cJ*((kernel n l C (x-c)+kernel n l C (x-d))/2) + + (((n:ℝ)-2)*min cI cJ)*((x-y)^2/(l^2+(x-y)^2)*kernel n l C (x-y))) + + |cI-cJ| *kernel n l C (x-y)) := by + apply boxIntegral_congr; intros; ring + _ = _ := by + rw [boxIntegral_add a b c d (by fun_prop (disch := positivity)) (by fun_prop (disch := positivity)), + boxIntegral_add a b c d (by fun_prop (disch := positivity)) (by fun_prop (disch := positivity)), + boxIntegral_add a b c d (by fun_prop (disch := positivity)) (by fun_prop (disch := positivity))] + simp only [boxIntegral_const_mul] + rw [heq, boxIntegral_const_mul] + exact bounded_weighted_interval_comparison n hn hl hC hab hcd hcI hcJ + +/-- The four kinds of nonempty open real intervals. `Valid` excludes reversed +finite endpoints; no endpoints at infinity are ever evaluated. -/ +inductive OpenInterval where + | bounded (a b : ℝ) + | below (b : ℝ) + | above (a : ℝ) + | all + +namespace OpenInterval + +def carrier : OpenInterval → Set ℝ + | .bounded a b => Ioo a b + | .below b => Iio b + | .above a => Ioi a + | .all => univ + +def Valid : OpenInterval → Prop + | .bounded a b => a < b + | _ => True + +def IsBounded : OpenInterval → Prop + | .bounded _ _ => True + | _ => False + +noncomputable def leftAverage (I : OpenInterval) (k : ℝ → ℝ) (y : ℝ) : ℝ := + match I with + | .bounded a b => (k (a-y)+k (b-y))/2 + | _ => 0 + +noncomputable def rightAverage (J : OpenInterval) (k : ℝ → ℝ) (x : ℝ) : ℝ := + match J with + | .bounded c d => (k (x-c)+k (x-d))/2 + | _ => 0 + +lemma leftAverage_nonneg (I : OpenInterval) {k : ℝ → ℝ} (hk : ∀ x, 0 ≤ k x) (y : ℝ) : + 0 ≤ I.leftAverage k y := by + cases I <;> simp only [leftAverage] + · exact div_nonneg (add_nonneg (hk _) (hk _)) (by norm_num) + all_goals exact le_rfl + +lemma rightAverage_nonneg (I : OpenInterval) {k : ℝ → ℝ} (hk : ∀ x, 0 ≤ k x) (y : ℝ) : + 0 ≤ I.rightAverage k y := by + cases I <;> simp only [rightAverage] + · exact div_nonneg (add_nonneg (hk _) (hk _)) (by norm_num) + all_goals exact le_rfl + +lemma exists_bounded (I : OpenInterval) (h : I.IsBounded) : ∃ a b, I = .bounded a b := by + cases I <;> simp_all [IsBounded] + +end OpenInterval + +/-- The full interval comparison, including unbounded zero-weight intervals. +All expressions are nonnegative extended integrals, so no divergent quantities +are subtracted. The harmless zero continuation of the endpoint average is +used only when the corresponding coefficient vanishes. -/ +lemma weighted_interval_comparison (n : ℕ) (hn : 3 ≤ n) + (I J : OpenInterval) (hI : I.Valid) (hJ : J.Valid) + {l C cI cJ : ℝ} (hl : 0 < l) (hC : 0 ≤ C) (hcI : 0 ≤ cI) (hcJ : 0 ≤ cJ) + (hboundedI : 0 < cI → I.IsBounded) (hboundedJ : 0 < cJ → J.IsBounded) : + (∫⁻ x in I.carrier, ∫⁻ y in J.carrier, + ENNReal.ofReal ((cI+cJ)*kernel n l C (x-y))) ≤ + ∫⁻ x in I.carrier, ∫⁻ y in J.carrier, + ENNReal.ofReal (cI*I.leftAverage (kernel n l C) y + + cJ*J.rightAverage (kernel n l C) x + + (((n:ℝ)-2)*min cI cJ*((x-y)^2/(l^2+(x-y)^2))+|cI-cJ|)*kernel n l C (x-y)) := by + by_cases hzI : cI = 0 + · subst cI + apply lintegral_mono; intro x + apply lintegral_mono; intro y + apply ENNReal.ofReal_le_ofReal + simp only [zero_add, zero_mul, min_eq_left hcJ, mul_zero, zero_sub, abs_neg, abs_of_nonneg hcJ] + exact le_add_of_nonneg_left (mul_nonneg hcJ (J.rightAverage_nonneg (kernel_nonneg n hC) x)) + by_cases hzJ : cJ = 0 + · subst cJ + apply lintegral_mono; intro x + apply lintegral_mono; intro y + apply ENNReal.ofReal_le_ofReal + simp only [add_zero, zero_mul, min_eq_right hcI, mul_zero, zero_add, sub_zero, abs_of_nonneg hcI] + exact le_add_of_nonneg_left (mul_nonneg hcI (I.leftAverage_nonneg (kernel_nonneg n hC) y)) + obtain ⟨a,b,rfl⟩ := I.exists_bounded (hboundedI (lt_of_le_of_ne hcI (Ne.symm hzI))) + obtain ⟨c,d,rfl⟩ := J.exists_bounded (hboundedJ (lt_of_le_of_ne hcJ (Ne.symm hzJ))) + exact bounded_weighted_interval_lintegral n hn hl hC hI.le hJ.le hcI hcJ + +end HenonLaneEmden.IntervalGeometry +end Intervals + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/KernelBalls.lean b/lean/OAI/Analysis/HenonEmden/KernelBalls.lean new file mode 100644 index 0000000000000000000000000000000000000000..15c22d687ed31670e99a193a649752bfedfb2d6d --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/KernelBalls.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.HenonEmden.OriginCutoff + +namespace OAI + +universe uE + +section KernelBalls + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma shifted_ball_indicator (a r : ℝ) (x y : E) : + (ball x r).indicator (fun y => ‖x-y‖^a) y = + (ball (0:E) r).indicator (fun z => ‖z‖^a) (x-y) := by + by_cases hy : y ∈ ball x r + · rw [indicator_of_mem hy,indicator_of_mem] + simpa only [mem_ball,dist_zero_right,dist_eq_norm,sub_zero,norm_sub_rev x y] using hy + · rw [indicator_of_notMem hy,indicator_of_notMem] + simpa only [mem_ball,dist_zero_right,dist_eq_norm,sub_zero,norm_sub_rev x y] using hy + +lemma integrable_shifted_power_ball (hn : 1 ≤ Module.finrank ℝ E) {a : ℝ} + (ha : -(Module.finrank ℝ E:ℝ) < a) (r : ℝ) (x : E) : + Integrable ((ball x r).indicator (fun y => ‖x-y‖^a)) := by + have hi : IntegrableOn (fun z : E => ‖z‖^a) (ball 0 r) := + ((locallyIntegrable_norm_power hn a ha).integrableOn_isCompact (isCompact_closedBall 0 r)).mono_set ball_subset_closedBall + have hI := hi.integrable_indicator measurableSet_ball + simpa only [Function.comp_def,← shifted_ball_indicator] using + (Measure.measurePreserving_sub_left volume x).integrable_comp hI.aestronglyMeasurable |>.mpr hI + +lemma integral_shifted_power_ball (a : ℝ) {r : ℝ} (hr : 0 < r) (x : E) : + (∫ y, (ball x r).indicator (fun y => ‖x-y‖^a) y) = + r^((Module.finrank ℝ E:ℝ)+a)*(∫ z in ball (0:E) 1, ‖z‖^a) := by + simp_rw [shifted_ball_indicator] + rw [integral_sub_left_eq_self (fun z => (ball (0:E) r).indicator (fun z => ‖z‖^a) z) volume x, + integral_indicator measurableSet_ball,integral_weight_ball_scaling a hr] + +lemma rpow_half_double_bound {r s : ℝ} (hr : 0 < r) (hs : r/2 ≤ s) (hs' : s ≤ 2*r) (A : ℝ) : + s^A ≤ (2:ℝ)^|A| * r^A := by + have hs0 : 0 < s := by linarith + by_cases hA : 0 ≤ A + · calc + _ ≤ (2*r)^A := Real.rpow_le_rpow hs0.le hs' hA + _ = _ := by rw [Real.mul_rpow (by norm_num) hr.le,abs_of_nonneg hA] + · have hA' : A ≤ 0 := (not_le.mp hA).le + calc + _ ≤ (r/2)^A := Real.rpow_le_rpow_of_nonpos (by positivity) hs hA' + _ = _ := by + rw [Real.div_rpow hr.le (by norm_num),abs_of_nonpos hA',Real.rpow_neg (by norm_num : (0:ℝ) ≤ 2),div_eq_mul_inv,mul_comm] + +end HenonLaneEmden.WeakPDE +end +end KernelBalls + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/LayerAssembly.lean b/lean/OAI/Analysis/HenonEmden/LayerAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..350637c18c9dfcea71176ed628438ecc4ed5f86a --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/LayerAssembly.lean @@ -0,0 +1,191 @@ +import OAI.Analysis.HenonEmden.LayerSplit + +namespace OAI + +universe uZ + +section LayerAssembly + +open MeasureTheory Set +open scoped ENNReal +namespace HenonLaneEmden.LayerPressure +open LineComponents IntervalGeometry LayerTonelli + +variable {Z : Type uZ} [NormedAddCommGroup Z] [MeasurableSpace Z] [BorelSpace Z] [SecondCountableTopology Z] + + +noncomputable def sourceWeight (f h d : Z × ℝ → ℝ) (δ : ℝ) (a : (Z × ℝ) × ℝ) : ℝ := + lineWeight {s | ((a.1.1,a.2),s) ∈ parameterLayer f} (fun s => h (a.1.1,s)) + (fun s => d (a.1.1,s)) δ a.1.2 + +noncomputable def sourceLower (f : Z × ℝ → ℝ) (a : (Z × ℝ) × ℝ) : Z × ℝ := + (a.1.1,lowerEndpoint (parameterLayer f) ((a.1.1,a.2),a.1.2)) +noncomputable def sourceUpper (f : Z × ℝ → ℝ) (a : (Z × ℝ) × ℝ) : Z × ℝ := + (a.1.1,upperEndpoint (parameterLayer f) ((a.1.1,a.2),a.1.2)) + +omit [SecondCountableTopology Z] in +lemma measurable_sourceWeight {f h d : Z × ℝ → ℝ} (hf : IsOpen (parameterLayer f)) + (hh : Continuous h) (hd : Continuous d) (δ : ℝ) : Measurable (sourceWeight f h d δ) := by + let h' : (Z × ℝ) × ℝ → ℝ := fun z => h (z.1.1,z.2) + let d' : (Z × ℝ) × ℝ → ℝ := fun z => d (z.1.1,z.2) + have hh' : Continuous h' := hh.comp (continuous_fst.fst.prodMk continuous_snd) + have hd' : Continuous d' := hd.comp (continuous_fst.fst.prodMk continuous_snd) + have he : Measurable (fun p : (Z × ℝ) × ℝ => + (setWeight (fun s => h' (p.1,s)) (fun s => d' (p.1,s)) δ + (connectedComponentIn {s | (p.1,s) ∈ parameterLayer f} p.2)).toReal) := + (measurable_parametric_setWeight hf hh' hd' δ).ennreal_toReal + have hem := he.comp (tripleSwap : (Z × ℝ) × ℝ ≃ᵐ (Z × ℝ) × ℝ).measurable + unfold sourceWeight lineWeight + simpa only [Function.comp_def,tripleSwap_apply,h',d'] using hem + +omit [SecondCountableTopology Z] in +lemma measurable_sourceLower {f : Z × ℝ → ℝ} (hf : IsOpen (parameterLayer f)) : + Measurable (sourceLower f) := by + exact measurable_fst.fst.prodMk ((measurable_lowerEndpoint hf).comp + (measurable_fst.fst.prodMk measurable_snd |>.prodMk measurable_fst.snd)) +omit [SecondCountableTopology Z] in +lemma measurable_sourceUpper {f : Z × ℝ → ℝ} (hf : IsOpen (parameterLayer f)) : + Measurable (sourceUpper f) := by + exact measurable_fst.fst.prodMk ((measurable_upperEndpoint hf).comp + (measurable_fst.fst.prodMk measurable_snd |>.prodMk measurable_fst.snd)) + +omit [NormedAddCommGroup Z] [MeasurableSpace Z] [BorelSpace Z] [SecondCountableTopology Z] in +lemma sourceWeight_nonneg (f h d : Z × ℝ → ℝ) (δ : ℝ) (a : (Z × ℝ) × ℝ) : + 0 ≤ sourceWeight f h d δ a := ENNReal.toReal_nonneg + +omit [NormedAddCommGroup Z] [MeasurableSpace Z] [BorelSpace Z] [SecondCountableTopology Z] in +lemma sourceWeight_le {f h d : Z × ℝ → ℝ} {δ : ℝ} {a : (Z × ℝ) × ℝ} + (ha : a ∈ sourceSubgraph f) (hh : 0 ≤ h a.1) : sourceWeight f h d δ a ≤ h a.1 := + lineWeight_le ha hh + +noncomputable def splitKernel (n : ℕ) (C : ℝ) (z : (Z × ℝ) × (Z × ℝ)) : ℝ := + kernel n ‖z.1.1-z.2.1‖ C (z.1.2-z.2.2) +noncomputable def splitDirection (z : (Z × ℝ) × (Z × ℝ)) : ℝ := + (z.1.2-z.2.2)^2/(‖z.1.1-z.2.1‖^2+(z.1.2-z.2.2)^2) + +lemma measurable_splitKernel (n : ℕ) (C : ℝ) : Measurable (splitKernel (Z := Z) n C) := by + unfold splitKernel kernel + fun_prop +lemma measurable_splitDirection : Measurable (splitDirection (Z := Z)) := by + unfold splitDirection + fun_prop + +noncomputable def pairLeft (n : ℕ) (C : ℝ) (f g h d : Z × ℝ → ℝ) (δ : ℝ) + (z : ((Z × ℝ) × ℝ) × ((Z × ℝ) × ℝ)) : ℝ := + (sourceWeight f h d δ z.1+sourceWeight g h d δ z.2)*splitKernel n C (z.1.1,z.2.1) + +noncomputable def pairRight (n : ℕ) (C : ℝ) (f g h d : Z × ℝ → ℝ) (δ : ℝ) + (z : ((Z × ℝ) × ℝ) × ((Z × ℝ) × ℝ)) : ℝ := + sourceWeight f h d δ z.1 * + ((splitKernel n C (sourceLower f z.1,z.2.1)+splitKernel n C (sourceUpper f z.1,z.2.1))/2) + + sourceWeight g h d δ z.2 * + ((splitKernel n C (z.1.1,sourceLower g z.2)+splitKernel n C (z.1.1,sourceUpper g z.2))/2) + + (((n:ℝ)-2)*h z.1.1*splitDirection (z.1.1,z.2.1)+ + |sourceWeight f h d δ z.1-sourceWeight g h d δ z.2|)*splitKernel n C (z.1.1,z.2.1) + +lemma measurable_pairLeft (n : ℕ) (C : ℝ) {f g h d : Z × ℝ → ℝ} + (hf : IsOpen (parameterLayer f)) (hg : IsOpen (parameterLayer g)) + (hh : Continuous h) (hd : Continuous d) (δ : ℝ) : Measurable (pairLeft n C f g h d δ) := by + unfold pairLeft + have hχf := measurable_sourceWeight hf hh hd δ + have hχg := measurable_sourceWeight hg hh hd δ + have hk := measurable_splitKernel (Z := Z) n C + fun_prop + +lemma measurable_pairRight (n : ℕ) (C : ℝ) {f g h d : Z × ℝ → ℝ} + (hf : IsOpen (parameterLayer f)) (hg : IsOpen (parameterLayer g)) + (hh : Continuous h) (hd : Continuous d) (δ : ℝ) : Measurable (pairRight n C f g h d δ) := by + unfold pairRight + have hχf := measurable_sourceWeight hf hh hd δ + have hχg := measurable_sourceWeight hg hh hd δ + have hlof := measurable_sourceLower hf + have hlog := measurable_sourceLower hg + have hhif := measurable_sourceUpper hf + have hhig := measurable_sourceUpper hg + have hk := measurable_splitKernel (Z := Z) n C + have hD := measurable_splitDirection (Z := Z) + fun_prop + +omit [MeasurableSpace Z] [BorelSpace Z] [SecondCountableTopology Z] in +lemma weighted_leftAverage_eq {f h d : Z × ℝ → ℝ} (hf : IsOpen (parameterLayer f)) + (δ : ℝ) {p : Z × ℝ} {s : ℝ} (hs : (p,s) ∈ parameterLayer f) + (k : ℝ → ℝ) (y : ℝ) : + lineWeight {s | (p,s) ∈ parameterLayer f} (fun s => h (p.1,s)) (fun s => d (p.1,s)) δ s * + leftAverage {s | (p,s) ∈ parameterLayer f} k s y = + lineWeight {s | (p,s) ∈ parameterLayer f} (fun s => h (p.1,s)) (fun s => d (p.1,s)) δ s * + ((k (lowerEndpoint (parameterLayer f) (p,s)-y)+k (upperEndpoint (parameterLayer f) (p,s)-y))/2) := by + by_cases hz : lineWeight {s | (p,s) ∈ parameterLayer f} (fun s => h (p.1,s)) + (fun s => d (p.1,s)) δ s = 0 + · rw [hz,zero_mul,zero_mul] + · have he := relative_endpoints_eq_of_weight_pos hf hs + (lt_of_le_of_ne (lineWeight_nonneg _ _ _ _ _) (Ne.symm hz)) + simp only [leftAverage,he.1,he.2] + +omit [MeasurableSpace Z] [BorelSpace Z] [SecondCountableTopology Z] in +lemma weighted_rightAverage_eq {g h d : Z × ℝ → ℝ} (hg : IsOpen (parameterLayer g)) + (δ : ℝ) {p : Z × ℝ} {s : ℝ} (hs : (p,s) ∈ parameterLayer g) + (k : ℝ → ℝ) (x : ℝ) : + lineWeight {s | (p,s) ∈ parameterLayer g} (fun s => h (p.1,s)) (fun s => d (p.1,s)) δ s * + rightAverage {s | (p,s) ∈ parameterLayer g} k x s = + lineWeight {s | (p,s) ∈ parameterLayer g} (fun s => h (p.1,s)) (fun s => d (p.1,s)) δ s * + ((k (x-lowerEndpoint (parameterLayer g) (p,s))+k (x-upperEndpoint (parameterLayer g) (p,s)))/2) := by + by_cases hz : lineWeight {s | (p,s) ∈ parameterLayer g} (fun s => h (p.1,s)) + (fun s => d (p.1,s)) δ s = 0 + · rw [hz,zero_mul,zero_mul] + · have he := relative_endpoints_eq_of_weight_pos hg hs + (lt_of_le_of_ne (lineWeight_nonneg _ _ _ _ _) (Ne.symm hz)) + simp only [rightAverage,he.1,he.2] + +omit [MeasurableSpace Z] [BorelSpace Z] [SecondCountableTopology Z] in +lemma pair_line_comparison (n : ℕ) (hn : 3 ≤ n) {C : ℝ} (hC : 0 ≤ C) + {f g h d : Z × ℝ → ℝ} (hf : IsOpen (parameterLayer f)) (hg : IsOpen (parameterLayer g)) + (hhn : ∀ x, 0 ≤ h x) (δ : ℝ) (p : (Z × ℝ) × (Z × ℝ)) (hp : p.1.1 ≠ p.2.1) : + (∫⁻ s : ℝ × ℝ in {s | (p.1,s) ∈ parameterLayer f} ×ˢ {s | (p.2,s) ∈ parameterLayer g}, + ENNReal.ofReal (pairLeft n C f g h d δ (((p.1.1,s.1),p.1.2),((p.2.1,s.2),p.2.2)))) ≤ + ∫⁻ s : ℝ × ℝ in {s | (p.1,s) ∈ parameterLayer f} ×ˢ {s | (p.2,s) ∈ parameterLayer g}, + ENNReal.ofReal (pairRight n C f g h d δ (((p.1.1,s.1),p.1.2),((p.2.1,s.2),p.2.2))) := by + have hfo := isOpen_section hf p.1 + have hgo := isOpen_section hg p.2 + have hl : 0 < ‖p.1.1-p.2.1‖ := norm_pos_iff.mpr (sub_ne_zero.mpr hp) + have hh := weighted_source_layer_comparison n hn hfo hgo + (fun s => h (p.1.1,s)) (fun s => h (p.2.1,s)) + (fun s => d (p.1.1,s)) (fun s => d (p.2.1,s)) δ hl hC (fun x _ => hhn _) + change (∫⁻ s in _, ENNReal.ofReal _) ≤ _ at hh + convert hh using 1 + · rfl + · apply setLIntegral_congr_fun (hfo.measurableSet.prod hgo.measurableSet) + intro s hs + unfold pairRight splitKernel splitDirection sourceLower sourceUpper sourceWeight + dsimp only + rw [weighted_leftAverage_eq hf δ hs.1,weighted_rightAverage_eq hg δ hs.2] + +lemma ae_distinct_transverse (μ : Measure Z) [SFinite μ] [NullSingletonClass μ] : + ∀ᵐ p : (Z × ℝ) × (Z × ℝ) ∂(μ.prod volume).prod (μ.prod volume), p.1.1 ≠ p.2.1 := by + apply (Measure.ae_prod_iff_ae_ae (by measurability)).mpr + apply ae_of_all + intro x + apply (Measure.ae_prod_iff_ae_ae (by measurability)).mpr + filter_upwards [μ.ae_ne x.1] with z hz + exact ae_of_all _ (fun _ => Ne.symm hz) + +/-- The globally integrated nonnegative interval comparison. No source, +endpoint, or energy integrability is assumed; all terms are still extended values. -/ +lemma global_nonnegative_pressure (μ : Measure Z) [SFinite μ] [NullSingletonClass μ] + (n : ℕ) (hn : 3 ≤ n) {C : ℝ} (hC : 0 ≤ C) + {f g h d : Z × ℝ → ℝ} (hf : Measurable f) (hg : Measurable g) + (hfo : IsOpen (parameterLayer f)) (hgo : IsOpen (parameterLayer g)) + (hh : Continuous h) (hd : Continuous d) (hhn : ∀ x, 0 ≤ h x) (δ : ℝ) : + (∫⁻ z, ENNReal.ofReal (pairLeft n C f g h d δ z) + ∂(layerMeasure (μ.prod volume) f).prod (layerMeasure (μ.prod volume) g)) ≤ + ∫⁻ z, ENNReal.ofReal (pairRight n C f g h d δ z) + ∂(layerMeasure (μ.prod volume) f).prod (layerMeasure (μ.prod volume) g) := by + rw [lintegral_pair_layer_split μ hf hg (measurable_pairLeft n C hfo hgo hh hd δ).ennreal_ofReal, + lintegral_pair_layer_split μ hf hg (measurable_pairRight n C hfo hgo hh hd δ).ennreal_ofReal] + apply lintegral_mono_ae + filter_upwards [ae_distinct_transverse μ] with p hp + exact pair_line_comparison n hn hC hfo hgo hhn δ p hp + +end HenonLaneEmden.LayerPressure +end LayerAssembly + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/LayerIntegration.lean b/lean/OAI/Analysis/HenonEmden/LayerIntegration.lean new file mode 100644 index 0000000000000000000000000000000000000000..b9db1c4b20c9b3d655850747f39370680374e484 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/LayerIntegration.lean @@ -0,0 +1,127 @@ +import OAI.Analysis.HenonEmden.CapLoss + +namespace OAI + +universe uE + +section LayerIntegration + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap LineComponents Angular + +lemma low_high_layer_bound {F : ℝ → ℝ} {f w T a : ℝ} + (hf : 0 ≤ f) (hw : 0 ≤ w) (hT : 0 ≤ T) (ha : 0 ≤ a) + (hglobal : ∀ t ∈ Ioo 0 f, F t ≤ w) + (hhigh : ∀ t ∈ Ioo 0 f, T ≤ t → F t ≤ a) : + (∫⁻ t in Ioo 0 f, ENNReal.ofReal (F t)) ≤ ENNReal.ofReal (a*f+w*T) := by + classical + have hpt (t : ℝ) (ht : t ∈ Ioo 0 f) : + ENNReal.ofReal (F t) ≤ ENNReal.ofReal a+(Ioo 0 T).indicator (fun _ => ENNReal.ofReal w) t := by + by_cases hlt : t < T + · rw [indicator_of_mem (show t ∈ Ioo 0 T from ⟨ht.1,hlt⟩)] + exact (ENNReal.ofReal_le_ofReal (hglobal t ht)).trans (le_add_left le_rfl) + · rw [indicator_of_notMem (fun hh => hlt hh.2),add_zero] + exact ENNReal.ofReal_le_ofReal (hhigh t ht (not_lt.mp hlt)) + calc + _ ≤ ∫⁻ t in Ioo 0 f, ENNReal.ofReal a+(Ioo 0 T).indicator (fun _ => ENNReal.ofReal w) t := + lintegral_mono_ae (ae_restrict_mem measurableSet_Ioo |>.mono hpt) + _ = ENNReal.ofReal a*ENNReal.ofReal f+ + ∫⁻ t in Ioo 0 f, (Ioo 0 T).indicator (fun _ => ENNReal.ofReal w) t := by + rw [lintegral_add_left measurable_const,lintegral_const,Measure.restrict_apply_univ,Real.volume_Ioo,sub_zero] + _ ≤ ENNReal.ofReal a*ENNReal.ofReal f+ + ∫⁻ t, (Ioo 0 T).indicator (fun _ => ENNReal.ofReal w) t := by + exact add_le_add le_rfl (lintegral_mono' Measure.restrict_le_self (le_refl _)) + _ = _ := by + rw [lintegral_indicator measurableSet_Ioo,lintegral_const,Measure.restrict_apply_univ, + Real.volume_Ioo,sub_zero,← ENNReal.ofReal_mul ha,← ENNReal.ofReal_mul hw, + ← ENNReal.ofReal_add (mul_nonneg ha hf) (mul_nonneg hw hT)] + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] + +def averagedLoss (f : E → ℝ) (κ δ : ℝ) (z : E × ℝ) : ℝ := + ∫ e : sphere (0:E) 1, weight μ κ e z.1-lineWeight μ f κ δ (e,z) ∂μ.toSphere + +lemma measurable_averagedLoss {f : E → ℝ} + (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (δ : ℝ) : + Measurable (averagedLoss μ f κ δ) := by + have hm : Measurable (fun z : sphere (0:E) 1 × (E × ℝ) => + weight μ κ z.1 z.2.1-lineWeight μ f κ δ z) := + ((measurable_weight μ hκ hκ1).comp (measurable_fst.prodMk measurable_snd.fst)).sub + (measurable_lineWeight μ hf hκ hκ1 δ) + exact hm.stronglyMeasurable.integral_prod_left'.measurable + +omit [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] [μ.IsAddHaarMeasure] in +lemma averagedLoss_nonneg (f : E → ℝ) (κ δ : ℝ) (z : E × ℝ) : + 0 ≤ averagedLoss μ f κ δ z := + integral_nonneg (fun e => sub_nonneg.mpr (lineWeight_le μ f κ δ (e,z))) + +lemma averagedLoss_high {f : E → ℝ} + (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + {κ δ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 < δ) (hδ1 : δ ≤ 1/2) + {x : E} (hd : 0 < d x) {t M P : ℝ} (ht : 0 < t) (htf : t < f x) + (hM : 0 ≤ M) (hP : 0 < P) (hlevel : P/(d x)^(k (Module.finrank ℝ E)) ≤ t) + (hm : (∫⁻ z in ball (0:E) 4, ENNReal.ofReal (f z) ∂μ) ≤ ENNReal.ofReal M) : + averagedLoss μ f κ δ (x,t) ≤ + (oscillationConstant μ κ*δ*μ.toSphere.real univ+ + (boundConstant μ κ*rayConstant (Module.finrank ℝ E)*M)/δ^(Module.finrank ℝ E)/P)* + (d x)^(N (Module.finrank ℝ E)) := by + let n := Module.finrank ℝ E + have hC : 0 ≤ boundConstant μ κ*rayConstant n*M := + mul_nonneg (mul_nonneg (boundConstant_nonneg μ hκ.le) (show 0 ≤ rayConstant n by unfold rayConstant; positivity)) hM + have hh := high_level_flatness n hd hδ ht hP hC ((div_le_iff₀ (pow_pos hd _)).mp hlevel) + have he := averaged_loss_le μ hf hκ hκ1 hδ hδ1 hd ht htf hM hm + change averagedLoss μ f κ δ (x,t) ≤ _ at he + calc + _ ≤ oscillationConstant μ κ*δ*(d x)^(N n)*μ.toSphere.real univ+ + (boundConstant μ κ*rayConstant n*M)*(d x)^(N n-n)/(t*(δ*(d x)^(m n))^n) := by + convert he using 1; ring + _ ≤ oscillationConstant μ κ*δ*(d x)^(N n)*μ.toSphere.real univ+ + (boundConstant μ κ*rayConstant n*M)/δ^n/P*(d x)^(N n) := add_le_add le_rfl hh + _ = _ := by ring + +omit [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] in +lemma weight_low_levels_bound (n : ℕ) {x : E} (hd : 0 < d x) {P : ℝ} (hP : 0 ≤ P) : + w n x*(P/(d x)^(k n)) ≤ (6*(N n:ℝ)*3^(N n-1))*P := by + have hw : w n x ≤ 6*(N n:ℝ)*3^(N n-1)*(d x)^(N n-1) := by + rw [w_eq_profile]; exact wProfile_bound n (norm_nonneg x) + have hp : (d x)^(N n-1) ≤ (d x)^(k n) := + pow_le_pow_of_le_one hd.le (d_le_one x) (by unfold N; omega) + calc + _ ≤ (6*(N n:ℝ)*3^(N n-1)*(d x)^(N n-1))*(P/(d x)^(k n)) := + mul_le_mul_of_nonneg_right hw (div_nonneg hP (pow_nonneg hd.le _)) + _ ≤ (6*(N n:ℝ)*3^(N n-1)*(d x)^(k n))*(P/(d x)^(k n)) := by gcongr + _ = _ := by field_simp + +lemma integrated_averagedLoss {f : E → ℝ} + (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + {κ δ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 < δ) (hδ1 : δ ≤ 1/2) + {x : E} (hd : 0 < d x) (hfx : 0 ≤ f x) {M P : ℝ} (hM : 0 ≤ M) (hP : 0 < P) + (hm : (∫⁻ z in ball (0:E) 4, ENNReal.ofReal (f z) ∂μ) ≤ ENNReal.ofReal M) : + (∫⁻ t in Ioo 0 (f x), ENNReal.ofReal (averagedLoss μ f κ δ (x,t))) ≤ + ENNReal.ofReal ((oscillationConstant μ κ*δ*μ.toSphere.real univ+ + (boundConstant μ κ*rayConstant (Module.finrank ℝ E)*M)/δ^(Module.finrank ℝ E)/P)* + (d x)^(N (Module.finrank ℝ E))*f x + (6*(N (Module.finrank ℝ E):ℝ)*3^(N (Module.finrank ℝ E)-1))*P) := by + let n := Module.finrank ℝ E + apply (low_high_layer_bound hfx (w_nonneg n x) (div_nonneg hP.le (pow_nonneg hd.le _)) + (a := (oscillationConstant μ κ*δ*μ.toSphere.real univ+ + (boundConstant μ κ*rayConstant n*M)/δ^n/P)*(d x)^(N n)) + (by exact mul_nonneg (add_nonneg + (mul_nonneg (mul_nonneg (oscillationConstant_nonneg μ hκ.le) hδ.le) (measureReal_nonneg)) + (div_nonneg (div_nonneg (mul_nonneg (mul_nonneg (boundConstant_nonneg μ hκ.le) + (show 0 ≤ rayConstant n by unfold rayConstant; positivity)) hM) (pow_nonneg hδ.le _)) hP.le)) (pow_nonneg hd.le _)) + (fun t _ => averaged_loss_le_weight μ hf hκ hκ1 δ x t) + (fun t ht hlevel => averagedLoss_high μ hf hκ hκ1 hδ hδ1 hd ht.1 ht.2 hM hP hlevel hm)).trans + apply ENNReal.ofReal_le_ofReal + exact add_le_add le_rfl (weight_low_levels_bound n hd hP.le) + +end HenonLaneEmden.SpatialComponents +end +end LayerIntegration + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/LayerPressure.lean b/lean/OAI/Analysis/HenonEmden/LayerPressure.lean new file mode 100644 index 0000000000000000000000000000000000000000..1cd3db2f6a1087d239e44b064859d74f43811036 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/LayerPressure.lean @@ -0,0 +1,251 @@ +import OAI.Analysis.HenonEmden.Intervals + +namespace OAI + +section LayerPressure + + +open Set MeasureTheory +open scoped ENNReal NNReal Topology + +namespace HenonLaneEmden.LayerPressure + +/-- The actual (nonempty) connected components of an open real line layer. -/ +def components (U : Set ℝ) : Set (Set ℝ) := connectedComponentIn U '' U + +lemma component_nonempty {U I : Set ℝ} (hI : I ∈ components U) : I.Nonempty := by + obtain ⟨x,hx,rfl⟩ := hI + exact ⟨x, mem_connectedComponentIn hx⟩ + +lemma component_open {U I : Set ℝ} (hU : IsOpen U) (hI : I ∈ components U) : IsOpen I := by + obtain ⟨x,hx,rfl⟩ := hI + exact hU.connectedComponentIn + +lemma component_connected {U I : Set ℝ} (hI : I ∈ components U) : IsConnected I := by + obtain ⟨x,hx,rfl⟩ := hI + exact ⟨⟨x,mem_connectedComponentIn hx⟩,isPreconnected_connectedComponentIn⟩ + +lemma component_identify {U I : Set ℝ} (hI : I ∈ components U) {x : ℝ} (hx : x ∈ I) : + connectedComponentIn U x = I := by + obtain ⟨y,hy,rfl⟩ := hI + exact (connectedComponentIn_eq hx).symm + +lemma components_disjoint (U : Set ℝ) : (components U).PairwiseDisjoint id := by + intro I hI J hJ hne + change Disjoint I J + rw [Set.disjoint_left] + intro x hxI hxJ + exact hne ((component_identify hI hxI).symm.trans (component_identify hJ hxJ)) + +lemma components_countable {U : Set ℝ} (hU : IsOpen U) : (components U).Countable := + (components_disjoint U).countable_of_isOpen (fun _ h => component_open hU h) + (fun _ h => component_nonempty h) + +lemma biUnion_components (U : Set ℝ) : (⋃ I ∈ components U, I) = U := by + apply subset_antisymm + · apply iUnion₂_subset + intro I hI + obtain ⟨x,hx,rfl⟩ := hI + exact connectedComponentIn_subset U x + · intro x hx + exact mem_iUnion₂.mpr ⟨connectedComponentIn U x,⟨x,hx,rfl⟩,mem_connectedComponentIn hx⟩ + +/-- Nonnegative integration can be summed over two line-layer component families +without any integrability or finiteness assumption on either side. -/ +lemma lintegral_layer_comparison {U V : Set ℝ} (hU : IsOpen U) (hV : IsOpen V) + (F G : ℝ × ℝ → ℝ≥0∞) + (h : ∀ I ∈ components U, ∀ J ∈ components V, + (∫⁻ z in I ×ˢ J, F z) ≤ ∫⁻ z in I ×ˢ J, G z) : + (∫⁻ z in U ×ˢ V, F z) ≤ ∫⁻ z in U ×ˢ V, G z := by + let C : Set (Set ℝ × Set ℝ) := components U ×ˢ components V + let S : Set ℝ × Set ℝ → Set (ℝ × ℝ) := fun p => p.1 ×ˢ p.2 + have hC : C.Countable := (components_countable hU).prod (components_countable hV) + have hop : ∀ p ∈ C, MeasurableSet (S p) := by + intro p hp + exact (component_open hU hp.1).measurableSet.prod (component_open hV hp.2).measurableSet + have hdis : C.PairwiseDisjoint S := by + intro p hp q hq hpq + change Disjoint (S p) (S q) + rw [Set.disjoint_left] + rintro ⟨x,y⟩ hxp hxq + apply hpq + apply Prod.ext + · exact (component_identify hp.1 hxp.1).symm.trans (component_identify hq.1 hxq.1) + · exact (component_identify hp.2 hxp.2).symm.trans (component_identify hq.2 hxq.2) + have heq : (⋃ p ∈ C, S p) = U ×ˢ V := by + ext z + simp only [mem_iUnion, mem_prod, C, S] + constructor + · rintro ⟨⟨I,J⟩,⟨hI,hJ⟩,hzI,hzJ⟩ + exact ⟨by rw [← biUnion_components U]; exact mem_iUnion₂.mpr ⟨I,hI,hzI⟩, + by rw [← biUnion_components V]; exact mem_iUnion₂.mpr ⟨J,hJ,hzJ⟩⟩ + · rintro ⟨hzU,hzV⟩ + rw [← biUnion_components U] at hzU + rw [← biUnion_components V] at hzV + obtain ⟨I,hI,hzI⟩ := mem_iUnion₂.mp hzU + obtain ⟨J,hJ,hzJ⟩ := mem_iUnion₂.mp hzV + exact ⟨(I,J),⟨hI,hJ⟩,hzI,hzJ⟩ + rw [← heq,lintegral_biUnion hC hop hdis F,lintegral_biUnion hC hop hdis G] + exact ENNReal.tsum_le_tsum fun p => h p.val.1 p.property.1 p.val.2 p.property.2 + +lemma open_connected_eq_Ioo {I : Set ℝ} (hop : IsOpen I) (hcon : IsConnected I) + (hlo : BddBelow I) (hhi : BddAbove I) : I = Ioo (sInf I) (sSup I) := by + apply subset_antisymm + · intro x hx + obtain ⟨a,b,hab,hsub⟩ := mem_nhds_iff_exists_Ioo_subset.mp (hop.mem_nhds hx) + have hm : (a+x)/2 ∈ I := hsub ⟨by linarith [hab.1], by linarith [hab.1,hab.2]⟩ + have hp : (x+b)/2 ∈ I := hsub ⟨by linarith [hab.1,hab.2], by linarith [hab.2]⟩ + exact ⟨lt_of_le_of_lt (csInf_le hlo hm) (by linarith [hab.1]), + lt_of_lt_of_le (by linarith [hab.2]) (le_csSup hhi hp)⟩ + · exact hcon.Ioo_csInf_csSup_subset hlo hhi + +open IntervalGeometry + +/-- The interval comparison stated directly on a product of two open components. +The endpoint values on an unbounded component are immaterial because its weight +is zero. All integrands are nonnegative extended values. -/ +lemma component_pair_comparison (n : ℕ) (hn : 3 ≤ n) + {I J : Set ℝ} (hopI : IsOpen I) (hopJ : IsOpen J) + (hconI : IsConnected I) (hconJ : IsConnected J) + {l C cI cJ : ℝ} (hl : 0 < l) (hC : 0 ≤ C) (hcI : 0 ≤ cI) (hcJ : 0 ≤ cJ) + (hbI : 0 < cI → BddBelow I ∧ BddAbove I) + (hbJ : 0 < cJ → BddBelow J ∧ BddAbove J) : + (∫⁻ z in I ×ˢ J, ENNReal.ofReal ((cI+cJ)*kernel n l C (z.1-z.2))) ≤ + ∫⁻ z in I ×ˢ J, ENNReal.ofReal + (cI*((kernel n l C (sInf I-z.2)+kernel n l C (sSup I-z.2))/2) + + cJ*((kernel n l C (z.1-sInf J)+kernel n l C (z.1-sSup J))/2) + + (((n:ℝ)-2)*min cI cJ*((z.1-z.2)^2/(l^2+(z.1-z.2)^2))+|cI-cJ|)* + kernel n l C (z.1-z.2)) := by + by_cases hzI : cI = 0 + · subst cI + apply lintegral_mono; intro z + apply ENNReal.ofReal_le_ofReal + simp only [zero_add, zero_mul, mul_zero, min_eq_left hcJ, zero_sub, abs_neg, abs_of_nonneg hcJ] + exact le_add_of_nonneg_left (mul_nonneg hcJ (div_nonneg + (add_nonneg (kernel_nonneg n hC _) (kernel_nonneg n hC _)) (by norm_num))) + by_cases hzJ : cJ = 0 + · subst cJ + apply lintegral_mono; intro z + apply ENNReal.ofReal_le_ofReal + simp only [add_zero, zero_mul, min_eq_right hcI, mul_zero, zero_add, sub_zero, abs_of_nonneg hcI] + exact le_add_of_nonneg_left (mul_nonneg hcI (div_nonneg + (add_nonneg (kernel_nonneg n hC _) (kernel_nonneg n hC _)) (by norm_num))) + obtain ⟨hloI,hhiI⟩ := hbI (lt_of_le_of_ne hcI (Ne.symm hzI)) + obtain ⟨hloJ,hhiJ⟩ := hbJ (lt_of_le_of_ne hcJ (Ne.symm hzJ)) + have heqI := open_connected_eq_Ioo hopI hconI hloI hhiI + have heqJ := open_connected_eq_Ioo hopJ hconJ hloJ hhiJ + have ha : sInf I ≤ sSup I := csInf_le_csSup hconI.nonempty hloI hhiI + have hb : sInf J ≤ sSup J := csInf_le_csSup hconJ.nonempty hloJ hhiJ + have hk := kernel_continuous n hl C + have hD : Continuous (fun z : ℝ × ℝ => (z.1-z.2)^2/(l^2+(z.1-z.2)^2)) := + ((continuous_fst.sub continuous_snd).pow 2).div + (continuous_const.add ((continuous_fst.sub continuous_snd).pow 2)) + (fun z => ne_of_gt (base_pos hl (z.1-z.2))) + have hcL : Continuous (fun z : ℝ × ℝ => (cI+cJ)*kernel n l C (z.1-z.2)) := by fun_prop + have hcR : Continuous (fun z : ℝ × ℝ => + cI*((kernel n l C (sInf I-z.2)+kernel n l C (sSup I-z.2))/2) + + cJ*((kernel n l C (z.1-sInf J)+kernel n l C (z.1-sSup J))/2) + + (((n:ℝ)-2)*min cI cJ*((z.1-z.2)^2/(l^2+(z.1-z.2)^2))+|cI-cJ|)* + kernel n l C (z.1-z.2)) := by fun_prop + rw [show (volume : Measure (ℝ × ℝ)) = volume.prod volume from rfl, + ← Measure.prod_restrict, lintegral_prod _ hcL.measurable.ennreal_ofReal.aemeasurable, + lintegral_prod _ hcR.measurable.ennreal_ofReal.aemeasurable] + simpa only [← heqI, ← heqJ] using + (bounded_weighted_interval_lintegral n hn hl hC ha hb hcI hcJ) + +/-- Weighted interval comparison summed over two general open line layers. The +coefficients are arbitrary nonnegative component-constant weights, with positive +weight permitted only on bounded components. -/ +lemma open_layer_comparison (n : ℕ) (hn : 3 ≤ n) + {U V : Set ℝ} (hU : IsOpen U) (hV : IsOpen V) + (c d : Set ℝ → ℝ) {l C : ℝ} (hl : 0 < l) (hC : 0 ≤ C) + (hc : ∀ I ∈ components U, 0 ≤ c I) (hd : ∀ J ∈ components V, 0 ≤ d J) + (hbc : ∀ I ∈ components U, 0 < c I → BddBelow I ∧ BddAbove I) + (hbd : ∀ J ∈ components V, 0 < d J → BddBelow J ∧ BddAbove J) : + (∫⁻ z in U ×ˢ V, ENNReal.ofReal + ((c (connectedComponentIn U z.1)+d (connectedComponentIn V z.2))*kernel n l C (z.1-z.2))) ≤ + ∫⁻ z in U ×ˢ V, ENNReal.ofReal + (c (connectedComponentIn U z.1)* + ((kernel n l C (sInf (connectedComponentIn U z.1)-z.2)+ + kernel n l C (sSup (connectedComponentIn U z.1)-z.2))/2) + + d (connectedComponentIn V z.2)* + ((kernel n l C (z.1-sInf (connectedComponentIn V z.2))+ + kernel n l C (z.1-sSup (connectedComponentIn V z.2)))/2) + + (((n:ℝ)-2)*min (c (connectedComponentIn U z.1)) (d (connectedComponentIn V z.2))* + ((z.1-z.2)^2/(l^2+(z.1-z.2)^2))+ + |c (connectedComponentIn U z.1)-d (connectedComponentIn V z.2)|)* + kernel n l C (z.1-z.2)) := by + apply lintegral_layer_comparison hU hV + intro I hI J hJ + have hm : MeasurableSet (I ×ˢ J) := + (component_open hU hI).measurableSet.prod (component_open hV hJ).measurableSet + have hp := component_pair_comparison n hn (component_open hU hI) (component_open hV hJ) + (component_connected hI) (component_connected hJ) hl hC (hc I hI) (hd J hJ) + (hbc I hI) (hbd J hJ) + convert hp using 1 + · apply setLIntegral_congr_fun hm + intro z hz + dsimp only + rw [component_identify hI hz.1, component_identify hJ hz.2] + · apply setLIntegral_congr_fun hm + intro z hz + dsimp only + rw [component_identify hI hz.1, component_identify hJ hz.2] + +open LineComponents + +noncomputable def lineWeight (U : Set ℝ) (h d : ℝ → ℝ) (δ x : ℝ) : ℝ := + (setWeight h d δ (connectedComponentIn U x)).toReal + +noncomputable def leftAverage (U : Set ℝ) (k : ℝ → ℝ) (x y : ℝ) : ℝ := + (k (sInf (connectedComponentIn U x)-y)+k (sSup (connectedComponentIn U x)-y))/2 + +noncomputable def rightAverage (V : Set ℝ) (k : ℝ → ℝ) (x y : ℝ) : ℝ := + (k (x-sInf (connectedComponentIn V y))+k (x-sSup (connectedComponentIn V y)))/2 + +lemma lineWeight_nonneg (U : Set ℝ) (h d : ℝ → ℝ) (δ x : ℝ) : + 0 ≤ lineWeight U h d δ x := ENNReal.toReal_nonneg + +lemma lineWeight_le {U : Set ℝ} {h d : ℝ → ℝ} {δ x : ℝ} + (hx : x ∈ U) (hh : 0 ≤ h x) : lineWeight U h d δ x ≤ h x := by + have he := ENNReal.toReal_mono ENNReal.ofReal_ne_top (setWeight_le (h := h) (d := d) + (δ := δ) (mem_connectedComponentIn hx)) + simpa only [lineWeight,ENNReal.toReal_ofReal hh] using he + +/-- The actual capped component weights satisfy the summed nonnegative layer +comparison of equation (layer-pair), still before integrations over levels and +transverse variables. No boundedness of either whole layer is assumed. -/ +lemma weighted_source_layer_comparison (n : ℕ) (hn : 3 ≤ n) + {U V : Set ℝ} (hU : IsOpen U) (hV : IsOpen V) + (h₁ h₂ d₁ d₂ : ℝ → ℝ) (δ : ℝ) {l C : ℝ} (hl : 0 < l) (hC : 0 ≤ C) + (hh₁ : ∀ x ∈ U, 0 ≤ h₁ x) : + (∫⁻ z in U ×ˢ V, ENNReal.ofReal + ((lineWeight U h₁ d₁ δ z.1+lineWeight V h₂ d₂ δ z.2)*kernel n l C (z.1-z.2))) ≤ + ∫⁻ z in U ×ˢ V, ENNReal.ofReal + (lineWeight U h₁ d₁ δ z.1*leftAverage U (kernel n l C) z.1 z.2 + + lineWeight V h₂ d₂ δ z.2*rightAverage V (kernel n l C) z.1 z.2 + + (((n:ℝ)-2)*h₁ z.1*((z.1-z.2)^2/(l^2+(z.1-z.2)^2))+ + |lineWeight U h₁ d₁ δ z.1-lineWeight V h₂ d₂ δ z.2|)*kernel n l C (z.1-z.2)) := by + have hh := open_layer_comparison n hn hU hV + (fun I => (setWeight h₁ d₁ δ I).toReal) (fun J => (setWeight h₂ d₂ δ J).toReal) hl hC + (fun _ _ => ENNReal.toReal_nonneg) (fun _ _ => ENNReal.toReal_nonneg) + (fun _ hI hpos => setWeight_pos_bounded (component_connected hI) hpos) + (fun _ hJ hpos => setWeight_pos_bounded (component_connected hJ) hpos) + apply hh.trans + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem (hU.measurableSet.prod hV.measurableSet)] with z hz + apply ENNReal.ofReal_le_ofReal + dsimp only [lineWeight,leftAverage,rightAverage] + apply add_le_add_right + apply mul_le_mul_of_nonneg_right _ (kernel_nonneg n hC _) + apply add_le_add_left + apply mul_le_mul_of_nonneg_right _ (div_nonneg (sq_nonneg _) (base_pos hl _).le) + apply mul_le_mul_of_nonneg_left _ (by + have hn' : (3:ℝ) ≤ n := by exact_mod_cast hn + linarith) + exact (min_le_left _ _).trans (lineWeight_le hz.1 (hh₁ z.1 hz.1)) + +end HenonLaneEmden.LayerPressure +end LayerPressure + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/LayerRecovery.lean b/lean/OAI/Analysis/HenonEmden/LayerRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ffcb124e6a4918ef4268f6a69f8db25ab830965 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/LayerRecovery.lean @@ -0,0 +1,67 @@ +import OAI.Analysis.HenonEmden.Endpoints + +namespace OAI + +section LayerRecovery +open MeasureTheory Set Filter Topology +namespace HenonLaneEmden.WeightedLayers + +lemma source_root {w u q : ℝ} (hw : 0 < w) (hu : 0 < u) (hq : 0 < q) : + (w*u^q)^(1/q) = w^(1/q)*u := by + rw [Real.mul_rpow hw.le (Real.rpow_nonneg hu.le _), ← Real.rpow_mul hu.le] + have h : q*(1/q) = 1 := by field_simp + rw [h, Real.rpow_one] + +lemma weighted_layer_identity {w u q : ℝ} (hw : 0 < w) (hu : 0 < u) (hq : 0 < q) : + (∫ t in 0..w*u^q, (u-(t/w)^(1/q))) = w*u^(q+1)/(q+1) := by + have hq' : 0 < 1/q := one_div_pos.mpr hq + have hf : 0 < w*u^q := mul_pos hw (Real.rpow_pos_of_pos hu _) + have hr : IntervalIntegrable (fun t : ℝ => t^(1/q)) volume 0 (w*u^q) := + intervalIntegral.intervalIntegrable_rpow' (by linarith) + have heq : (∫ t in 0..w*u^q, (u-(t/w)^(1/q))) = + (∫ t in 0..w*u^q, (u-t^(1/q)/w^(1/q))) := by + apply intervalIntegral.integral_congr + intro t ht + rw [uIcc_of_le hf.le] at ht + dsimp only + rw [Real.div_rpow ht.1 hw.le] + rw [heq, intervalIntegral.integral_sub (continuous_const.intervalIntegrable ..) (hr.div_const _), + intervalIntegral.integral_const, intervalIntegral.integral_div, + integral_rpow (Or.inl (by linarith : -1 < 1/q)), + Real.zero_rpow (ne_of_gt (by linarith : 0 < 1/q+1)), sub_zero, + sub_zero, smul_eq_mul] + rw [Real.rpow_add hf, Real.rpow_one, source_root hw hu hq, + Real.rpow_add hu, Real.rpow_one] + have hw' : w^(1/q) ≠ 0 := ne_of_gt (Real.rpow_pos_of_pos hw _) + have hq0 : q ≠ 0 := ne_of_gt hq + have hq1 : q+1 ≠ 0 := by linarith + field_simp [hw', hq0, hq1] + ring + +lemma layer_root_bounds {w u q t : ℝ} (hw : 0 < w) (hu : 0 < u) (hq : 0 < q) + (ht : 0 ≤ t) (htf : t ≤ w*u^q) : + 0 ≤ (t/w)^(1/q) ∧ (t/w)^(1/q) ≤ u := by + constructor + · exact Real.rpow_nonneg (div_nonneg ht hw.le) _ + · have htw : t/w ≤ u^q := (div_le_iff₀ hw).mpr (by simpa [mul_comm] using htf) + have hroot := Real.rpow_le_rpow (div_nonneg ht hw.le) htw (one_div_nonneg.mpr hq.le) + rw [← Real.rpow_mul hu.le] at hroot + have h : q*(1/q) = 1 := by field_simp + rwa [h, Real.rpow_one] at hroot + +/-- The exact scalar recovery inequality before integration. -/ +lemma pressure_recovery_pointwise {h χ u τ endpoint error : ℝ} + (hχ : 0 ≤ χ) (hχh : χ ≤ h) (hτ : 0 ≤ τ) + (hend : |endpoint-τ| ≤ error*u) : + h*(u-τ)-χ*(u-endpoint) ≤ (h-χ)*u+error*h*u := by + have hhu : 0 ≤ error*u := le_trans (abs_nonneg _) hend + have he := (abs_le.mp hend).2 + have hmul := mul_le_mul_of_nonneg_left he hχ + have hmul' := mul_le_mul_of_nonneg_right hχh hhu + have htail := mul_nonneg (sub_nonneg.mpr hχh) hτ + nlinarith + +end HenonLaneEmden.WeightedLayers +end LayerRecovery + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/LayerSplit.lean b/lean/OAI/Analysis/HenonEmden/LayerSplit.lean new file mode 100644 index 0000000000000000000000000000000000000000..b591ec3c503bb2a5284612f66a95e0ce8b827c2c --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/LayerSplit.lean @@ -0,0 +1,98 @@ +import OAI.Analysis.HenonEmden.MeasureShuffle + +namespace OAI + +universe uZ uA uB uC uA2 uB2 uC2 uA3 uB3 uC3 + +section LayerSplit + +open MeasureTheory Set +open scoped ENNReal +namespace HenonLaneEmden.LayerTonelli + +variable {Z : Type uZ} [MeasurableSpace Z] + +def tripleSwap {A : Type uA} {B : Type uB} {C : Type uC} [MeasurableSpace A] [MeasurableSpace B] [MeasurableSpace C] : + (A × B) × C ≃ᵐ (A × C) × B := + MeasurableEquiv.prodAssoc.trans + ((MeasurableEquiv.prodCongr (MeasurableEquiv.refl A) MeasurableEquiv.prodComm).trans + MeasurableEquiv.prodAssoc.symm) + +@[simp] lemma tripleSwap_apply {A : Type uA2} {B : Type uB2} {C : Type uC2} [MeasurableSpace A] + [MeasurableSpace B] [MeasurableSpace C] (x : (A × B) × C) : + tripleSwap x = ((x.1.1,x.2),x.1.2) := rfl + +lemma measurePreserving_tripleSwap {A : Type uA3} {B : Type uB3} {C : Type uC3} [MeasurableSpace A] + [MeasurableSpace B] [MeasurableSpace C] (μ : Measure A) (ν : Measure B) (ρ : Measure C) + [SFinite ν] [SFinite ρ] [SFinite μ] : + MeasurePreserving (tripleSwap : (A × B) × C ≃ᵐ (A × C) × B) + ((μ.prod ν).prod ρ) ((μ.prod ρ).prod ν) := by + exact ((MeasurePreserving.symm MeasurableEquiv.prodAssoc + (measurePreserving_prodAssoc μ ρ ν)).comp + ((MeasurePreserving.id μ).prod (Measure.measurePreserving_swap (μ := ν) (ν := ρ)))).comp + (measurePreserving_prodAssoc μ ν ρ) + +def parameterLayer (f : Z × ℝ → ℝ) : Set ((Z × ℝ) × ℝ) := + {z | 0 < z.1.2 ∧ z.1.2 < f (z.1.1,z.2)} + +lemma measurableSet_parameterLayer {f : Z × ℝ → ℝ} (hf : Measurable f) : + MeasurableSet (parameterLayer f) := + (measurableSet_lt measurable_const measurable_fst.snd).inter + (measurableSet_lt measurable_fst.snd (hf.comp (measurable_fst.fst.prodMk measurable_snd))) + +noncomputable def parameterLayerMeasure (μ : Measure Z) (f : Z × ℝ → ℝ) : + Measure ((Z × ℝ) × ℝ) := + ((μ.prod volume).prod volume).restrict (parameterLayer f) + +instance parameterLayerMeasure_sfinite (μ : Measure Z) [SFinite μ] (f : Z × ℝ → ℝ) : + SFinite (parameterLayerMeasure μ f) := inferInstanceAs (SFinite (Measure.restrict _ _)) + +lemma measurePreserving_layer_tripleSwap (μ : Measure Z) [SFinite μ] + {f : Z × ℝ → ℝ} (hf : Measurable f) : + MeasurePreserving (tripleSwap : (Z × ℝ) × ℝ ≃ᵐ (Z × ℝ) × ℝ) + (layerMeasure (μ.prod volume) f) (parameterLayerMeasure μ f) := by + exact (measurePreserving_tripleSwap μ volume volume).restrict_preimage + (measurableSet_parameterLayer hf) + +/-- After permuting the real position and level coordinates, every pair layer +integral is the iterated nonnegative integral over two transverse/level parameters +and then the two real line layers. This is valid before proving finiteness. -/ +lemma lintegral_pair_layer_split (μ : Measure Z) [SFinite μ] + {f g : Z × ℝ → ℝ} (hf : Measurable f) (hg : Measurable g) + {F : ((Z × ℝ) × ℝ) × ((Z × ℝ) × ℝ) → ℝ≥0∞} (hF : Measurable F) : + (∫⁻ z, F z ∂(layerMeasure (μ.prod volume) f).prod (layerMeasure (μ.prod volume) g)) = + ∫⁻ p : (Z × ℝ) × (Z × ℝ), + ∫⁻ s : ℝ × ℝ in {s | (p.1,s) ∈ parameterLayer f} ×ˢ {s | (p.2,s) ∈ parameterLayer g}, + F (((p.1.1,s.1),p.1.2),((p.2.1,s.2),p.2.2)) + ∂volume.prod volume ∂(μ.prod volume).prod (μ.prod volume) := by + let V := parameterLayer f ×ˢ parameterLayer g + let G : ((Z × ℝ) × ℝ) × ((Z × ℝ) × ℝ) → ℝ≥0∞ := + fun z => F (((z.1.1.1,z.1.2),z.1.1.2),((z.2.1.1,z.2.2),z.2.1.2)) + have hG : Measurable G := by fun_prop + have hV : MeasurableSet V := (measurableSet_parameterLayer hf).prod (measurableSet_parameterLayer hg) + calc + _ = ∫⁻ z, G z ∂(parameterLayerMeasure μ f).prod (parameterLayerMeasure μ g) := by + exact ((measurePreserving_layer_tripleSwap μ hf).prod + (measurePreserving_layer_tripleSwap μ hg)).lintegral_comp hG + _ = ∫⁻ z, V.indicator G z ∂((μ.prod volume).prod volume).prod ((μ.prod volume).prod volume) := by + rw [parameterLayerMeasure,parameterLayerMeasure,Measure.prod_restrict] + exact (lintegral_indicator hV G).symm + _ = ∫⁻ z : ((Z × ℝ) × (Z × ℝ)) × (ℝ × ℝ), + V.indicator G ((z.1.1,z.2.1),(z.1.2,z.2.2)) + ∂((μ.prod volume).prod (μ.prod volume)).prod (volume.prod volume) := + lintegral_prod_prod_shuffle _ _ _ _ (hG.indicator hV) + _ = _ := by + rw [lintegral_prod _ (by fun_prop)] + apply lintegral_congr + intro p + have hset : MeasurableSet ({s | (p.1,s) ∈ parameterLayer f} ×ˢ {s | (p.2,s) ∈ parameterLayer g}) := + ((measurableSet_parameterLayer hf).preimage measurable_prodMk_left).prod + ((measurableSet_parameterLayer hg).preimage measurable_prodMk_left) + rw [← lintegral_indicator hset] + apply lintegral_congr; intro s + rfl + +end HenonLaneEmden.LayerTonelli +end LayerSplit + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/LineCoordinates.lean b/lean/OAI/Analysis/HenonEmden/LineCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..ab70a61125f196f99f249a2c09ece60e91640f69 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/LineCoordinates.lean @@ -0,0 +1,100 @@ +import OAI.Analysis.HenonEmden.Model + +namespace OAI + +universe uE + +section LineCoordinates + +open MeasureTheory Set Metric +open scoped InnerProductSpace +noncomputable section +namespace HenonLaneEmden.LineCoordinates + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def transverse (e : sphere (0:E) 1) : Submodule ℝ E := (ℝ ∙ (e : E))ᗮ +omit [InnerProductSpace ℝ E] in +lemma norm_unit (e : sphere (0:E) 1) : ‖(e:E)‖ = 1 := by + simpa only [mem_sphere,dist_zero_right] using e.2 +lemma inner_transverse (e : sphere (0:E) 1) (z : transverse e) : inner ℝ (e:E) (z:E) = 0 := + Submodule.mem_orthogonal_singleton_iff_inner_right.mp z.2 + +def join (e : sphere (0:E) 1) : WithLp 2 (transverse e × ℝ) →ₗᵢ[ℝ] E where + toFun z := z.fst.1 + z.snd • (e:E) + map_add' z z' := by simp only [WithLp.add_fst,WithLp.add_snd,Submodule.coe_add,add_smul]; abel + map_smul' r z := by + simp only [WithLp.smul_fst,WithLp.smul_snd,Submodule.coe_smul_of_tower,smul_eq_mul, + smul_add,smul_smul,RingHom.id_apply] + norm_map' z := by + change ‖(z.fst:E)+z.snd • (e:E)‖ = ‖z‖ + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + rw [norm_add_sq_real,real_inner_comm,inner_smul_left,inner_transverse,mul_zero,mul_zero,add_zero, + norm_smul,norm_unit,mul_one,Real.norm_eq_abs,sq_abs,WithLp.prod_norm_sq_eq_of_L2, + Real.norm_eq_abs,sq_abs] + rfl + +lemma join_surjective (e : sphere (0:E) 1) : Function.Surjective (join e) := by + intro x + let t := inner ℝ (e:E) x + have hz : x-t • (e:E) ∈ transverse e := by + apply Submodule.mem_orthogonal_singleton_iff_inner_right.mpr + simp only [inner_sub_right,inner_smul_right,real_inner_self_eq_norm_sq,norm_unit,one_pow,mul_one,t,sub_self] + refine ⟨WithLp.toLp 2 (⟨x-t • (e:E),hz⟩,t),?_⟩ + change (x-t • (e:E))+t • (e:E) = x + abel + +def isometry (e : sphere (0:E) 1) : WithLp 2 (transverse e × ℝ) ≃ₗᵢ[ℝ] E := + LinearIsometryEquiv.ofSurjective (join e) (join_surjective e) + +@[simp] lemma isometry_apply (e : sphere (0:E) 1) (z : WithLp 2 (transverse e × ℝ)) : + isometry e z = (z.fst:E)+z.snd • (e:E) := rfl + +lemma norm_join_sq (e : sphere (0:E) 1) (z : transverse e) (s : ℝ) : + ‖(z:E)+s • (e:E)‖^2 = ‖z‖^2+s^2 := by + simpa only [isometry_apply,WithLp.toLp_fst,WithLp.toLp_snd,Real.norm_eq_abs,sq_abs] using + congrArg (fun t : ℝ => t^2) ((isometry e).norm_map (WithLp.toLp 2 (z,s))) |>.trans + (WithLp.prod_norm_sq_eq_of_L2 (WithLp.toLp 2 (z,s))) + +variable [MeasurableSpace E] [BorelSpace E] + +def measurableEquiv (e : sphere (0:E) 1) : (transverse e × ℝ) ≃ᵐ E := + (MeasurableEquiv.toLp 2 _).trans (isometry e).toMeasurableEquiv + +@[simp] lemma measurableEquiv_apply (e : sphere (0:E) 1) (z : transverse e × ℝ) : + measurableEquiv e z = (z.1:E)+z.2 • (e:E) := rfl + +lemma measurePreserving [FiniteDimensional ℝ E] (e : sphere (0:E) 1) : + MeasurePreserving (measurableEquiv e) (volume.prod volume) volume := by + exact (isometry e).measurePreserving.comp (WithLp.volume_preserving_toLp (transverse e) ℝ) + +lemma continuous_measurableEquiv (e : sphere (0:E) 1) : Continuous (measurableEquiv e) := by + change Continuous (fun z : transverse e × ℝ => (z.1:E)+z.2 • (e:E)) + fun_prop + +lemma distance_sq (e : sphere (0:E) 1) (z z' : transverse e × ℝ) : + dist (measurableEquiv e z) (measurableEquiv e z')^2 = ‖z.1-z'.1‖^2+(z.2-z'.2)^2 := by + rw [dist_eq_norm] + have he : measurableEquiv e z-measurableEquiv e z' = ((z.1-z'.1 : transverse e):E)+(z.2-z'.2) • (e:E) := by + simp only [measurableEquiv_apply,Submodule.coe_sub,sub_smul]; abel + rw [he,norm_join_sq] + +lemma parallel (e : sphere (0:E) 1) (z : transverse e × ℝ) (s : ℝ) : + measurableEquiv e (z.1,z.2+s) = measurableEquiv e z+s • (e:E) := by + simp only [measurableEquiv_apply,add_smul]; abel + +omit [MeasurableSpace E] [BorelSpace E] in +lemma transverse_nontrivial [FiniteDimensional ℝ E] (h : 2 ≤ Module.finrank ℝ E) + (e : sphere (0:E) 1) : Nontrivial (transverse e) := by + apply (Module.finrank_pos_iff (R := ℝ)).mp + have he : (e:E) ≠ 0 := norm_ne_zero_iff.mp (by rw [norm_unit]; norm_num) + have hh := (ℝ ∙ (e:E)).finrank_add_finrank_orthogonal + rw [finrank_span_singleton he] at hh + change 0 < Module.finrank ℝ ((ℝ ∙ (e:E))ᗮ) + omega + +end HenonLaneEmden.LineCoordinates +end +end LineCoordinates + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/LocalizationIntegral.lean b/lean/OAI/Analysis/HenonEmden/LocalizationIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..5420223537bef7d4de01949143937b807367ee38 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/LocalizationIntegral.lean @@ -0,0 +1,103 @@ +import OAI.Analysis.HenonEmden.SymmetricVirial + +namespace OAI + +section LocalizationIntegral + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open Cutoff + +@[fun_prop] lemma measurable_localError (n : ℕ) : Measurable (localError : Space n × Space n → ℝ) := by + unfold localError + have hη := (continuous_eta n (E := Space n)).measurable + have hw := (continuous_w n (E := Space n)).measurable + fun_prop +lemma localError_nonneg {n : ℕ} (z : Space n × Space n) : 0 ≤ localError z := add_nonneg (abs_nonneg _) (abs_nonneg _) +lemma closeConstant_nonneg (n : ℕ) : 0 ≤ closeConstant n := by + obtain ⟨hD,hS,hW⟩ := constants_nonneg n + unfold closeConstant; positivity +lemma farLocalConstant_nonneg (n : ℕ) : 0 ≤ farLocalConstant n := by + have := (constants_nonneg n).1 + unfold farLocalConstant; positivity + +def localFarSum {n : ℕ} (δ : ℝ) (z : Space n × Space n) : ℝ := + farWeight δ (N n-1:ℕ) z+δ⁻¹*farWeight δ ((N n:ℝ)-(m n:ℝ)) z+ + farWeight δ (N n-1:ℕ) z.swap+δ⁻¹*farWeight δ ((N n:ℝ)-(m n:ℝ)) z.swap +lemma localFarSum_nonneg {n : ℕ} {δ : ℝ} (hδ : 0 ≤ δ) (z : Space n × Space n) : 0 ≤ localFarSum δ z := by + unfold localFarSum + exact add_nonneg (add_nonneg (add_nonneg (farWeight_nonneg _ _ _) (mul_nonneg (inv_nonneg.mpr hδ) + (farWeight_nonneg _ _ _))) (farWeight_nonneg _ _ _)) (mul_nonneg (inv_nonneg.mpr hδ) (farWeight_nonneg _ _ _)) +lemma localError_global {n : ℕ} (hn : 1 ≤ n) {δ : ℝ} (hδ : 0 < δ) (hδ1 : δ ≤ 1/4) + {z : Space n × Space n} (hne : z.1 ≠ z.2) : + localError z ≤ closeConstant n*δ*(eta n z.1+eta n z.2)+farLocalConstant n*localFarSum δ z := by + by_cases hc : 0 < pairGap z ∧ ‖z.1-z.2‖ ≤ δ*pairGap z^(m n) + · exact (localError_close hn hδ.le hδ1 hc.1 hc.2 hne).trans + (le_add_of_nonneg_right (mul_nonneg (farLocalConstant_nonneg n) (localFarSum_nonneg hδ.le z))) + · exact (localError_far hδ hne hc).trans + (le_add_of_nonneg_left (mul_nonneg (mul_nonneg (closeConstant_nonneg n) hδ.le) + (add_nonneg (eta_nonneg n _) (eta_nonneg n _)))) + +def localizationConstant (n : ℕ) (p q A B δ : ℝ) : ℝ := + farLocalConstant n*(1+δ⁻¹)*(farConstant n p q A B δ+farConstant n q p B A δ) +lemma localizationConstant_nonneg {n : ℕ} (p q A B : ℝ) {δ : ℝ} (hδ : 0 ≤ δ) : + 0 ≤ localizationConstant n p q A B δ := by + unfold localizationConstant + exact mul_nonneg (mul_nonneg (farLocalConstant_nonneg n) (by positivity)) + (add_nonneg (farConstant_nonneg _ _ _ _ hδ) (farConstant_nonneg _ _ _ _ hδ)) + +lemma IsSolution.localFarSum_bound {n : ℕ} (hn : 2 ≤ n) {p q A B δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) : + Integrable (localFarSum δ) (interaction (source u q B) (source v p A)) ∧ + (∫ z, localFarSum δ z ∂interaction (source u q B) (source v p A)) ≤ + (1+δ⁻¹)*(farConstant n p q A B δ+farConstant n q p B A δ) := by + have h1 := h.farWeight_bound hn hp hq hδ hδ1 (cutoff_far_exponents n).1 + have h2 := h.farWeight_bound hn hp hq hδ hδ1 (cutoff_far_exponents n).2.1 + have h3 := h.farWeight_swap_bound hn hp hq hδ hδ1 (cutoff_far_exponents n).1 + have h4 := h.farWeight_swap_bound hn hp hq hδ hδ1 (cutoff_far_exponents n).2.1 + have h12 : Integrable (fun z => farWeight δ (N n-1:ℕ) z+δ⁻¹*farWeight δ ((N n:ℝ)-(m n:ℝ)) z) _ := h1.1.add (h2.1.const_mul _) + have h123 : Integrable (fun z => farWeight δ (N n-1:ℕ) z+δ⁻¹*farWeight δ ((N n:ℝ)-(m n:ℝ)) z+farWeight δ (N n-1:ℕ) z.swap) _ := h12.add h3.1 + refine ⟨h123.add (h4.1.const_mul _),?_⟩ + unfold localFarSum + rw [integral_add h123 (h4.1.const_mul _), + integral_add h12 h3.1,integral_add h1.1 (h2.1.const_mul _), + integral_const_mul,integral_const_mul] + have hh := add_le_add (add_le_add (add_le_add h1.2 (mul_le_mul_of_nonneg_left h2.2 (inv_nonneg.mpr hδ.le))) h3.2) + (mul_le_mul_of_nonneg_left h4.2 (inv_nonneg.mpr hδ.le)) + exact hh.trans_eq (by ring) + +lemma IsSolution.localError_bound {n : ℕ} (hn : 2 ≤ n) {p q A B δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hδ : 0 < δ) (hδ1 : δ ≤ 1/4) : + Integrable localError (interaction (source u q B) (source v p A)) ∧ + (∫ z, localError z ∂interaction (source u q B) (source v p A)) ≤ + closeConstant n*δ*(weightedEnergy (eta n) u q B+weightedEnergy (eta n) v p A)+localizationConstant n p q A B δ := by + have hηf := h.weight_left hn hq (continuous_eta n) (compactSupport_eta n) (eta_nonneg n) + have hηg := h.weight_right hn hp (continuous_eta n) (compactSupport_eta n) (eta_nonneg n) + have hfar := h.localFarSum_bound hn hp hq hδ (by linarith) + have hηi : Integrable (fun z : Space n × Space n => eta n z.1+eta n z.2) _ := hηf.1.add hηg.1 + have hi : Integrable (fun z : Space n × Space n => closeConstant n*δ*(eta n z.1+eta n z.2)+farLocalConstant n*localFarSum δ z) _ := + (hηi.const_mul _).add (hfar.1.const_mul _) + have hb : ∀ᵐ z ∂interaction (source u q B) (source v p A), localError z ≤ + closeConstant n*δ*(eta n z.1+eta n z.2)+farLocalConstant n*localFarSum δ z := + (interaction_ae_ne (by omega : 1 ≤ n) _ _).mono (fun _ hz => localError_global (by omega) hδ hδ1 hz) + have he : Integrable localError (interaction (source u q B) (source v p A)) := hi.mono' + (measurable_localError n).aestronglyMeasurable (hb.mono (fun z hz => by + simpa only [Real.norm_eq_abs,abs_of_nonneg (localError_nonneg z)] using hz)) + refine ⟨he,(integral_mono_ae he hi hb).trans ?_⟩ + rw [integral_add (hηi.const_mul _) (hfar.1.const_mul _),integral_const_mul, + integral_const_mul,integral_add hηf.1 hηg.1,hηf.2,hηg.2] + calc + _ ≤ closeConstant n*δ*(weightedEnergy (eta n) u q B+weightedEnergy (eta n) v p A)+ + farLocalConstant n*((1+δ⁻¹)*(farConstant n p q A B δ+farConstant n q p B A δ)) := + add_le_add le_rfl (mul_le_mul_of_nonneg_left hfar.2 (farLocalConstant_nonneg n)) + _ = _ := by unfold localizationConstant; ring + +end HenonLaneEmden +end +end LocalizationIntegral + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Main.lean b/lean/OAI/Analysis/HenonEmden/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..e68ed629019e74239ef0f475268978112fe16dfe --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Main.lean @@ -0,0 +1,45 @@ +import OAI.Analysis.HenonEmden.UniformEnergy + +namespace OAI + +section Main + +namespace HenonLaneEmden + +theorem main_nonexistence (n : ℕ) (hn : 2 ≤ n) (p q A B : ℝ) + (hp : 0 < p) (hq : 0 < q) (hsub : Subcritical n p q A B) : + ¬ ∃ u v : Space n → ℝ, IsSolution n p q A B u v := by + rintro ⟨u,v,h⟩ + have hn3 := h.dimension_ge_three hn + obtain ⟨C,_hC,hbound⟩ := uniform_unit_energy hn3 hp hq hsub + obtain ⟨R,hR,hRC⟩ := h.scaled_energy_unbounded hn hp hq hsub C + have hscale := h.dilate (h.product_gt_one hn hp hq) (show 0 < R by linarith) + exact not_lt_of_ge (hbound _ _ hscale) hRC + +theorem lane_emden_nonexistence (n : ℕ) (hn : 3 ≤ n) (p q : ℝ) + (hp : 0 < p) (hq : 0 < q) + (hsub : 1 / (p + 1) + 1 / (q + 1) > ((n : ℝ) - 2) / (n : ℝ)) : + ¬ ∃ u v : Space n → ℝ, + ContDiff ℝ 2 u ∧ ContDiff ℝ 2 v ∧ + (∀ x, 0 < u x) ∧ (∀ x, 0 < v x) ∧ + (∀ x, -(Laplacian.laplacian u) x = Real.rpow (v x) p) ∧ + (∀ x, -(Laplacian.laplacian v) x = Real.rpow (u x) q) := by + have hn0 : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) + have hs : Subcritical n p q 0 0 := by + have hh := (div_lt_iff₀ hn0).mp hsub + unfold Subcritical + simp only [add_zero,div_eq_mul_inv,one_mul] at hh ⊢ + nlinarith [hh] + rintro ⟨u,v,hu,hv,hup,hvp,heu,hev⟩ + apply main_nonexistence n (by omega) p q 0 0 hp hq hs + refine ⟨u,v,hu.continuous,hv.continuous,hu.contDiffOn,hv.contDiffOn,hup,hvp,?_,?_⟩ + · intro x _hx + simpa only [Real.rpow_eq_pow,Real.rpow_zero,one_mul] using heu x + · intro x _hx + simpa only [Real.rpow_eq_pow,Real.rpow_zero,one_mul] using hev x + +end HenonLaneEmden + +end Main + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/MassGrowth.lean b/lean/OAI/Analysis/HenonEmden/MassGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c6ed0fbd16f7fef7f81921da5c1c564e289fabb --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/MassGrowth.lean @@ -0,0 +1,80 @@ +import OAI.Analysis.HenonEmden.ProductBounds + +namespace OAI + +section MassGrowth + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +open Set Filter Topology +open MeasureTheory Set Filter Topology +open scoped ContDiff +noncomputable section + + +namespace HenonLaneEmden +noncomputable def sourceConstant (n : ℕ) (p q A B : ℝ) : ℝ := + ((ballConstant n*weightMass n A)*(ballConstant n*weightMass n B)^p)^(1/(1-p*q)) / ballConstant n + +lemma sourceConstant_pos {n : ℕ} (hn : 3 ≤ n) {p q A B : ℝ} (hA : -2 < A) (hB : -2 < B) : + 0 < sourceConstant n p q A B := by + exact div_pos (Real.rpow_pos_of_pos + (mul_pos (mul_pos (ballConstant_pos hn) (weightMass_pos hn hA)) + (Real.rpow_pos_of_pos (mul_pos (ballConstant_pos hn) (weightMass_pos hn hB)) p)) _) + (ballConstant_pos hn) + +lemma IsSolution.sourceMass_g_upper {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + {R : ℝ} (hR : 0 < R) : + sourceMass v p A R ≤ sourceConstant n p q A B * R^((n:ℝ)-2-alpha p q A B) := by + have hn3 := h.dimension_ge_three hn + have hA := h.first_weight_gt_neg_two hn + have hB := h.swap.first_weight_gt_neg_two hn + have hpq := h.product_gt_one hn hp hq + let c := ballConstant n*weightMass n A + let d := ballConstant n*weightMass n B + have hc : 0 < c := mul_pos (ballConstant_pos hn3) (weightMass_pos hn3 hA) + have hd : 0 < d := mul_pos (ballConstant_pos hn3) (weightMass_pos hn3 hB) + have hu := coupled_upper_one (h.lowerMass_g_pos hn hR) (h.swap.lowerMass_g_pos hn hR) + (mul_pos hc (Real.rpow_pos_of_pos hR (2+A))) + (mul_pos hd (Real.rpow_pos_of_pos hR (2+B))) hp hpq + (h.lowerMass_g_coupling hn hp hR) (h.swap.lowerMass_g_coupling hn hq hR) + have hexp : (2+A+p*(2+B))*(1/(1-p*q)) = -alpha p q A B := by + unfold alpha + field_simp [ne_of_gt (show 0 < p*q-1 by linarith), ne_of_lt (show 1-p*q < 0 by linarith)] + ring + have he : ((c*R^(2+A))*(d*R^(2+B))^p)^(1/(1-p*q)) = + (c*d^p)^(1/(1-p*q))*R^(-alpha p q A B) := by + rw [Real.mul_rpow hd.le (Real.rpow_nonneg hR.le (2+B)),← Real.rpow_mul hR.le] + have hinner : c*R^(2+A)*(d^p*R^((2+B)*p)) = c*d^p*R^(2+A+p*(2+B)) := by + conv_rhs => rw [Real.rpow_add hR (2+A) (p*(2+B))] + rw [mul_comm (2+B) p]; ring + rw [hinner,Real.mul_rpow (mul_nonneg hc.le (Real.rpow_nonneg hd.le p)) + (Real.rpow_nonneg hR.le _),← Real.rpow_mul hR.le,hexp] + rw [he,lowerMass_eq _ _ _ hR] at hu + have hfactor : ballConstant n*R^(2-(n:ℝ)) * + (sourceConstant n p q A B * R^((n:ℝ)-2-alpha p q A B)) = + (c*d^p)^(1/(1-p*q))*R^(-alpha p q A B) := by + unfold sourceConstant + change ballConstant n*R^(2-(n:ℝ))*((c*d^p)^(1/(1-p*q))/ballConstant n * R^((n:ℝ)-2-alpha p q A B)) = _ + rw [show R^(-alpha p q A B) = R^(2-(n:ℝ))*R^((n:ℝ)-2-alpha p q A B) by + rw [← Real.rpow_add hR]; congr 1; ring] + field_simp [ne_of_gt (ballConstant_pos hn3)] + rw [← hfactor] at hu + exact (mul_le_mul_iff_right₀ (mul_pos (ballConstant_pos hn3) (Real.rpow_pos_of_pos hR _))).mp hu +end HenonLaneEmden + +end +end MassGrowth + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/MeasureShuffle.lean b/lean/OAI/Analysis/HenonEmden/MeasureShuffle.lean new file mode 100644 index 0000000000000000000000000000000000000000..65162e2f6e20f14f03af3ab4c6315c1d3a24043d --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/MeasureShuffle.lean @@ -0,0 +1,57 @@ +import OAI.Analysis.HenonEmden.Tonelli + +namespace OAI + +universe uA uB uC uD + +section MeasureShuffle + +open MeasureTheory +open scoped ENNReal +namespace HenonLaneEmden.LayerTonelli + +variable {A : Type uA} {B : Type uB} {C : Type uC} {D : Type uD} [MeasurableSpace A] [MeasurableSpace B] + [MeasurableSpace C] [MeasurableSpace D] + +lemma lintegral_prod_triple_swap (μ : Measure A) (ν : Measure B) (ρ : Measure C) + [SFinite μ] [SFinite ν] [SFinite ρ] {F : (A × B) × C → ℝ≥0∞} (hF : Measurable F) : + (∫⁻ z, F z ∂(μ.prod ν).prod ρ) = + ∫⁻ z : (A × C) × B, F ((z.1.1,z.2),z.1.2) ∂(μ.prod ρ).prod ν := by + calc + _ = ∫⁻ a, ∫⁻ b, ∫⁻ c, F ((a,b),c) ∂ρ ∂ν ∂μ := by + rw [lintegral_prod F hF.aemeasurable] + exact lintegral_prod _ (by fun_prop) + _ = ∫⁻ a, ∫⁻ c, ∫⁻ b, F ((a,b),c) ∂ν ∂ρ ∂μ := by + apply lintegral_congr; intro a + exact lintegral_lintegral_swap (by fun_prop) + _ = _ := by + rw [lintegral_prod (fun z : (A × C) × B => F ((z.1.1,z.2),z.1.2)) (by fun_prop)] + exact (lintegral_prod (fun z : A × C => ∫⁻ b, F ((z.1,b),z.2) ∂ν) (by fun_prop)).symm + +lemma lintegral_prod_prod_shuffle (μ : Measure A) (ν : Measure B) (ρ : Measure C) (σ : Measure D) + [SFinite μ] [SFinite ν] [SFinite ρ] [SFinite σ] + {F : (A × B) × (C × D) → ℝ≥0∞} (hF : Measurable F) : + (∫⁻ z, F z ∂(μ.prod ν).prod (ρ.prod σ)) = + ∫⁻ z : (A × C) × (B × D), F ((z.1.1,z.2.1),(z.1.2,z.2.2)) + ∂(μ.prod ρ).prod (ν.prod σ) := by + calc + _ = ∫⁻ a, ∫⁻ b, ∫⁻ c, ∫⁻ d, F ((a,b),(c,d)) ∂σ ∂ρ ∂ν ∂μ := by + rw [lintegral_prod _ hF.aemeasurable, + lintegral_prod (fun z : A × B => ∫⁻ y : C × D, F (z,y) ∂ρ.prod σ) (by fun_prop)] + apply lintegral_congr; intro a + apply lintegral_congr; intro b + exact lintegral_prod _ (by fun_prop) + _ = ∫⁻ a, ∫⁻ c, ∫⁻ b, ∫⁻ d, F ((a,b),(c,d)) ∂σ ∂ν ∂ρ ∂μ := by + apply lintegral_congr; intro a + exact lintegral_lintegral_swap (by fun_prop) + _ = _ := by + rw [lintegral_prod (fun z : (A × C) × (B × D) => F ((z.1.1,z.2.1),(z.1.2,z.2.2))) (by fun_prop), + lintegral_prod (fun z : A × C => ∫⁻ y : B × D, F ((z.1,y.1),(z.2,y.2)) ∂ν.prod σ) (by fun_prop)] + apply lintegral_congr; intro a + apply lintegral_congr; intro c + exact (lintegral_prod (fun z : B × D => F ((a,z.1),(c,z.2))) (by fun_prop)).symm + +end HenonLaneEmden.LayerTonelli +end MeasureShuffle + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Model.lean b/lean/OAI/Analysis/HenonEmden/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..9415379af646cec4d71da2c1d6528c0e51a78218 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Model.lean @@ -0,0 +1,26 @@ +import Mathlib + +namespace OAI + +namespace HenonLaneEmden + +abbrev Space (n : ℕ) := EuclideanSpace ℝ (Fin n) + +structure IsSolution (n : ℕ) (p q A B : ℝ) (u v : Space n → ℝ) : Prop where + continuous_u : Continuous u + continuous_v : Continuous v + regular_u : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n)) + regular_v : ContDiffOn ℝ 2 v ({0}ᶜ : Set (Space n)) + positive_u : ∀ x, 0 < u x + positive_v : ∀ x, 0 < v x + equation_u : ∀ x, x ≠ 0 → + -(Laplacian.laplacian u) x = Real.rpow ‖x‖ A * Real.rpow (v x) p + equation_v : ∀ x, x ≠ 0 → + -(Laplacian.laplacian v) x = Real.rpow ‖x‖ B * Real.rpow (u x) q + +def Subcritical (n : ℕ) (p q A B : ℝ) : Prop := + ((n : ℝ) + A) / (p + 1) + ((n : ℝ) + B) / (q + 1) > (n : ℝ) - (1 + 1) + +end HenonLaneEmden + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Mollification.lean b/lean/OAI/Analysis/HenonEmden/Mollification.lean new file mode 100644 index 0000000000000000000000000000000000000000..8396eee90d41b495539be566aed8c8d858e6bd85 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Mollification.lean @@ -0,0 +1,200 @@ +import OAI.Analysis.HenonEmden.WeakOrigin + +namespace OAI + +universe uE uE2 uι uE3 + +section Mollification + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +noncomputable section + + +open scoped Convolution +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + [MeasurableSpace E] [BorelSpace E] + +noncomputable def convolve (f g : E → ℝ) : E → ℝ := f ⋆[ContinuousLinearMap.mul ℝ ℝ] g + +lemma convolve_def (f g : E → ℝ) (x : E) : convolve f g x = ∫ y, f y*g (x-y) := rfl + +lemma contDiff_convolve {f g : E → ℝ} (hf : LocallyIntegrable f) + (hg : ContDiff ℝ 2 g) (hgc : HasCompactSupport g) : ContDiff ℝ 2 (convolve f g) := + hgc.contDiff_convolution_right (ContinuousLinearMap.mul ℝ ℝ) hf hg + +lemma dir_convolve {f g : E → ℝ} (hf : LocallyIntegrable f) + (hg : ContDiff ℝ 1 g) (hgc : HasCompactSupport g) (e x : E) : + dir (convolve f g) e x = convolve f (dir g e) x := by + unfold dir convolve + rw [(hgc.hasFDerivAt_convolution_right (ContinuousLinearMap.mul ℝ ℝ) hf hg x).fderiv] + exact convolution_precompR_apply (ContinuousLinearMap.mul ℝ ℝ) hf (hgc.fderiv ℝ) + (hg.continuous_fderiv one_ne_zero) x e + +lemma laplacian_convolve {f g : E → ℝ} (hf : LocallyIntegrable f) + (hg : ContDiff ℝ 2 g) (hgc : HasCompactSupport g) (x : E) : + Laplacian.laplacian (convolve f g) x = convolve f (Laplacian.laplacian g) x := by + have hfg := contDiff_convolve hf hg hgc + have hdir (e : E) : dir (convolve f g) e = convolve f (dir g e) := by + ext y; exact dir_convolve hf (hg.of_le (by norm_num)) hgc e y + have hgdir (e : E) : ContDiff ℝ 1 (dir g e) := + contDiffOn_univ.mp (contDiffOn_dir hg.contDiffOn isOpen_univ e) + have hi (e : E) : Integrable (fun y => f y*dir (dir g e) e (x-y)) := by + exact (compactSupport_dir (compactSupport_dir hgc e) e).convolutionExists_right + (ContinuousLinearMap.mul ℝ ℝ) hf + (contDiffOn_univ.mp (contDiffOn_dir (k := 0) (hgdir e).contDiffOn isOpen_univ e)).continuous x + simp only [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis,convolve_def] + have hleft (i : Fin (Module.finrank ℝ E)) : + iteratedFDeriv ℝ 2 (convolve f g) x ![stdOrthonormalBasis ℝ E i,stdOrthonormalBasis ℝ E i] = + ∫ y, f y*dir (dir g (stdOrthonormalBasis ℝ E i)) (stdOrthonormalBasis ℝ E i) (x-y) := by + rw [← dir_dir hfg.contDiffOn isOpen_univ (mem_univ x),hdir, + dir_convolve hf (hgdir _) (compactSupport_dir hgc _)] + rfl + simp_rw [hleft,← dir_dir hg.contDiffOn isOpen_univ (mem_univ _),Finset.mul_sum] + exact (integral_finsetSum _ (fun i _ => hi (stdOrthonormalBasis ℝ E i))).symm + +omit [MeasurableSpace E] [BorelSpace E] in +lemma laplacian_translate (f : E → ℝ) (a x : E) : + Laplacian.laplacian (fun y => f (a+y)) x = Laplacian.laplacian f (a+x) := by + simp only [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis, + iteratedFDeriv_comp_add_left] + +omit [MeasurableSpace E] [BorelSpace E] in +lemma laplacian_reflect {f : E → ℝ} (hf : ContDiff ℝ 2 f) (a x : E) : + Laplacian.laplacian (fun y => f (a-y)) x = Laplacian.laplacian f (a-x) := by + have hh : (fun y => f (a-y)) = (fun y => (fun z => f (a+z)) ((-1:ℝ) • y)) := by + ext y; simp [sub_eq_add_neg] + have hfa : ContDiff ℝ 2 (fun z => f (a+z)) := hf.comp (contDiff_const.add contDiff_id) + rw [hh,laplacian_dilation hfa,laplacian_translate] + simp [sub_eq_add_neg] +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + [MeasurableSpace E] [BorelSpace E] + +lemma convolve_nonneg {f g : E → ℝ} (hf : ∀ x, 0 ≤ f x) (hg : ∀ x, 0 ≤ g x) (x : E) : + 0 ≤ convolve f g x := integral_nonneg fun y => mul_nonneg (hf y) (hg (x-y)) + +lemma convolve_comm (f g : E → ℝ) : convolve f g = convolve g f := by + have hL : (ContinuousLinearMap.mul ℝ ℝ).flip = ContinuousLinearMap.mul ℝ ℝ := by + exact ContinuousLinearMap.ext fun x => ContinuousLinearMap.ext fun y => mul_comm y x + have hh := convolution_flip (L := ContinuousLinearMap.mul ℝ ℝ) (μ := volume) (f := f) (g := g) + rw [hL] at hh + exact hh.symm + +lemma convolve_weak_equation {u g ξ : E → ℝ} (hu : LocallyIntegrable u) + (hξ : ContDiff ℝ 2 ξ) (hξc : HasCompactSupport ξ) + (heq : ∀ (φ : E → ℝ), ContDiff ℝ 2 φ → HasCompactSupport φ → + (∫ y, u y*Laplacian.laplacian φ y) = -(∫ y, g y*φ y)) (x : E) : + Laplacian.laplacian (convolve u ξ) x = -convolve g ξ x := by + rw [laplacian_convolve hu hξ hξc,convolve_def,convolve_def] + have ht : ContDiff ℝ 2 (fun y => ξ (x-y)) := hξ.comp (contDiff_const.sub contDiff_id) + have hs : HasCompactSupport (fun y => ξ (x-y)) := hξc.comp_homeomorph (Homeomorph.subLeft x) + have hh := heq _ ht hs + simp_rw [laplacian_reflect hξ] at hh + exact hh + +lemma convolve_normed_tendsto {ι : Type uι} {l : Filter ι} {ξ : ι → ContDiffBump (0 : E)} + (hξ : Tendsto (fun i => (ξ i).rOut) l (𝓝 0)) {f : E → ℝ} + (hf : AEStronglyMeasurable f) {x : E} (hfx : ContinuousAt f x) : + Tendsto (fun i => convolve f ((ξ i).normed volume) x) l (𝓝 (f x)) := by + have he (i : ι) : convolve f ((ξ i).normed volume) x = + (((ξ i).normed volume) ⋆[ContinuousLinearMap.lsmul ℝ ℝ] f) x := by + rw [convolve_comm,convolve_def,convolution_def] + rfl + simp_rw [he] + exact ContDiffBump.convolution_tendsto_right hξ (Eventually.of_forall fun _ => hf) + (hfx.tendsto.comp tendsto_snd) tendsto_const_nhds +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE3} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +lemma smooth_newton_lower (hn : 3 ≤ Module.finrank ℝ E) {u w : E → ℝ} + (hu : ContDiff ℝ 2 u) (hw : Continuous w) (hp : ∀ x, 0 ≤ u x) (hwp : ∀ x, 0 ≤ w x) + (hEq : ∀ x, -Laplacian.laplacian u x = w x) (x : E) : + (∫⁻ y : E, ENNReal.ofReal (‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*w y)) ≤ + ENNReal.ofReal (((Module.finrank ℝ E:ℝ)-2)* + ((volume : Measure E).toSphere univ).toReal*u x) := by + have hh := SphereCalculus.smooth_newton_lower_at_zero hn + (hu.comp (contDiff_const.sub contDiff_id)) (hw.comp (continuous_const.sub continuous_id)) + (fun y => hp (x-y)) (fun y => hwp (x-y)) + (fun y => by change -Laplacian.laplacian (fun z => u (x-z)) y = w (x-y); rw [laplacian_reflect hu]; exact hEq (x-y)) + simp only [Function.comp_def,Pi.sub_apply,id_eq,sub_zero] at hh + have he := lintegral_sub_left_eq_self (μ := volume) + (fun y : E => ENNReal.ofReal (‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*w y)) x + simp only [sub_sub_cancel] at he + exact he ▸ hh + +noncomputable def standardBump (j : ℕ) : ContDiffBump (0:E) := + ⟨1/((j:ℝ)+1),2/((j:ℝ)+1),by positivity,by + apply (div_lt_div_iff_of_pos_right (by positivity : (0:ℝ) (standardBump (E := E) j).rOut) atTop (𝓝 0) := by + have hh := (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul 2 + simpa only [standardBump, ← mul_div_assoc,mul_one,mul_zero] using hh + +lemma weak_newton_lower (hn : 3 ≤ Module.finrank ℝ E) {u g : E → ℝ} + (hu : Continuous u) (hg : LocallyIntegrable g) + (hgc : ContinuousOn g ({0}ᶜ : Set E)) (hp : ∀ x, 0 ≤ u x) (hgp : ∀ x, 0 ≤ g x) + (heq : ∀ (φ : E → ℝ), ContDiff ℝ 2 φ → HasCompactSupport φ → + (∫ y, u y*Laplacian.laplacian φ y) = -(∫ y, g y*φ y)) (x : E) : + (∫⁻ y : E, ENNReal.ofReal (‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y)) ≤ + ENNReal.ofReal (((Module.finrank ℝ E:ℝ)-2)* + ((volume : Measure E).toSphere univ).toReal*u x) := by + let ξ (j : ℕ) := (standardBump (E := E) j).normed volume + let U (j : ℕ) := convolve u (ξ j) + let G (j : ℕ) := convolve g (ξ j) + have hξ (j : ℕ) : ContDiff ℝ 2 (ξ j) := (standardBump j).contDiff_normed + have hξc (j : ℕ) : HasCompactSupport (ξ j) := (standardBump j).hasCompactSupport_normed + have hξp (j : ℕ) (y : E) : 0 ≤ ξ j y := (standardBump j).nonneg_normed y + have hU (j : ℕ) : ContDiff ℝ 2 (U j) := contDiff_convolve hu.locallyIntegrable (hξ j) (hξc j) + have hG (j : ℕ) : ContDiff ℝ 2 (G j) := contDiff_convolve hg (hξ j) (hξc j) + have hUlim : Tendsto (fun j => U j x) atTop (𝓝 (u x)) := + convolve_normed_tendsto standardBump_tendsto hu.aestronglyMeasurable hu.continuousAt + have hGlim : ∀ᵐ y : E, Tendsto (fun j => G j y) atTop (𝓝 (g y)) := by + filter_upwards [ae_iff.mpr (show volume {y : E | ¬ y ≠ 0} = 0 by simp)] with y hy + exact convolve_normed_tendsto standardBump_tendsto hg.aestronglyMeasurable + (hgc.continuousAt (isOpen_compl_singleton.mem_nhds hy)) + let F (j : ℕ) (y : E) := ENNReal.ofReal (‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*G j y) + have hFm (j : ℕ) : Measurable (F j) := by + dsimp [F] + exact (((continuous_const.sub continuous_id).norm.measurable.pow_const _).mul + (hG j).continuous.measurable).ennreal_ofReal + have hFint (j : ℕ) : (∫⁻ y, F j y) ≤ + ENNReal.ofReal (((Module.finrank ℝ E:ℝ)-2)*((volume : Measure E).toSphere univ).toReal*U j x) := + smooth_newton_lower hn (hU j) (hG j).continuous + (convolve_nonneg hp (hξp j)) (convolve_nonneg hgp (hξp j)) + (fun y => by dsimp [U,G]; rw [convolve_weak_equation hu.locallyIntegrable (hξ j) (hξc j) heq]; ring) x + have hFeq : (∫⁻ y, ENNReal.ofReal (‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y)) = + ∫⁻ y, liminf (fun j => F j y) atTop := by + apply lintegral_congr_ae + filter_upwards [hGlim] with y hy + exact (ENNReal.tendsto_ofReal (hy.const_mul _)).liminf_eq.symm + rw [hFeq] + apply (lintegral_liminf_le hFm).trans + calc + _ ≤ liminf (fun j => ENNReal.ofReal (((Module.finrank ℝ E:ℝ)-2)* + ((volume : Measure E).toSphere univ).toReal*U j x)) atTop := + liminf_le_liminf (Eventually.of_forall hFint) + _ = _ := (ENNReal.tendsto_ofReal (hUlim.const_mul _)).liminf_eq +end HenonLaneEmden.WeakPDE + +end +end Mollification + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/NearLocalization.lean b/lean/OAI/Analysis/HenonEmden/NearLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..1549b4f043c304a6fff96438d654bf3b4960a39b --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/NearLocalization.lean @@ -0,0 +1,149 @@ +import OAI.Analysis.HenonEmden.RadialTaylor + +namespace OAI + +universe uE uE2 + +section NearLocalization + +open Set Metric +open scoped InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open Cutoff AdaptiveCap + +@[fun_prop] lemma measurable_radialFactor (n : ℕ) : Measurable (radialFactor : Space n × Space n → ℝ) := by + unfold radialFactor; fun_prop +@[fun_prop] lemma measurable_fluxFactor (n : ℕ) : Measurable (fluxFactor n : Space n × Space n → ℝ) := by + unfold fluxFactor X + have hη := (continuous_eta n (E := Space n)).measurable + fun_prop + +lemma eta_nonneg {E : Type uE} [NormedAddCommGroup E] (n : ℕ) (x : E) : 0 ≤ eta n x := + pow_nonneg (baseProfile_nonneg ‖x‖) _ + +lemma eta_gap_bounds {E : Type uE2} [NormedAddCommGroup E] (n : ℕ) (x : E) : + d x^(N n) ≤ eta n x ∧ eta n x ≤ 3^(N n)*d x^(N n) := etaProfile_bounds n ‖x‖ + +def pairGap {n : ℕ} (z : Space n × Space n) : ℝ := max (d z.1) (d z.2) +def localError {n : ℕ} (z : Space n × Space n) : ℝ := + |fluxFactor n z-eta n z.1+w n z.1*radialFactor z|+|eta n z.1-eta n z.2| +def closeConstant (n : ℕ) : ℝ := (2*secondConstant n+4*derivativeConstant n)*2^(N n) + +lemma pairGap_bounds {n : ℕ} (z : Space n × Space n) : 0 ≤ pairGap z ∧ pairGap z ≤ 1 := + ⟨(d_nonneg z.1).trans (le_max_left _ _),max_le (d_le_one z.1) (d_le_one z.2)⟩ +lemma pairGap_power_le {n : ℕ} (z : Space n × Space n) : + pairGap z^(N n) ≤ eta n z.1+eta n z.2 := by + rcases le_total (d z.1) (d z.2) with h | h + · rw [pairGap,max_eq_right h] + exact (eta_gap_bounds n z.2).1.trans (le_add_of_nonneg_left (eta_nonneg n z.1)) + · rw [pairGap,max_eq_left h] + exact (eta_gap_bounds n z.1).1.trans (le_add_of_nonneg_right (eta_nonneg n z.2)) + +lemma close_pair_gaps {n : ℕ} {δ : ℝ} (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1/4) + {x y : Space n} (hs : 0 < pairGap (x,y)) (hxy : ‖x-y‖ ≤ δ*pairGap (x,y)^(m n)) : + 0 < d x ∧ 0 < d y ∧ d x+dist x y ≤ 2*pairGap (x,y) ∧ ‖x-y‖ ≤ δ*pairGap (x,y) := by + have hb := pairGap_bounds (x,y) + have hp : pairGap (x,y)^(m n) ≤ pairGap (x,y) := by + simpa only [pow_one] using pow_le_pow_of_le_one hb.1 hb.2 (by simp [m] : 1 ≤ m n) + have hL := hxy.trans (mul_le_mul_of_nonneg_left hp hδ) + have hd := abs_le.mp (d_oscillation x y) + rw [dist_eq_norm] at hd + have hmax : pairGap (x,y) = d x ∨ pairGap (x,y) = d y := max_choice _ _ + have hx := le_max_left (d x) (d y) + have hy := le_max_right (d x) (d y) + change d x ≤ pairGap (x,y) at hx + change d y ≤ pairGap (x,y) at hy + have hm : δ*pairGap (x,y) ≤ pairGap (x,y)/4 := by nlinarith + refine ⟨?_,?_,?_,hL⟩ + · rcases hmax with h | h <;> nlinarith + · rcases hmax with h | h <;> nlinarith + · rw [dist_eq_norm]; linarith + +lemma close_power_bound {n j : ℕ} {s δ L : ℝ} (hs : 0 ≤ s) (hs1 : s ≤ 1) + (hδ : 0 ≤ δ) (hL : L ≤ δ*s^(m n)) (hj : j ≤ N n) (hjm : N n ≤ j+m n) : + (2*s)^j*L ≤ 2^(N n)*δ*s^(N n) := by + rw [mul_pow] + calc + _ ≤ (2^j*s^j)*(δ*s^(m n)) := mul_le_mul_of_nonneg_left hL (by positivity) + _ = 2^j*δ*s^(j+m n) := by rw [pow_add]; ring + _ ≤ 2^(N n)*δ*s^(N n) := by + apply mul_le_mul + · exact mul_le_mul_of_nonneg_right (pow_le_pow_right₀ (by norm_num : (1:ℝ) ≤ 2) hj) hδ + · exact pow_le_pow_of_le_one hs hs1 hjm + · positivity + · positivity + +lemma flux_close_estimate {n : ℕ} (hn : 1 ≤ n) {x y : Space n} (hx : (1:ℝ)/2 ≤ ‖x‖) + (hy : ‖y‖ ≤ 2) (hxy : x ≠ y) {D : ℝ} (hD : 0 ≤ D) + (hseg : ∀ t ∈ uIcc ‖x‖ ‖y‖, gapProfile t ≤ D) : + |fluxFactor n (x,y)-eta n x+w n x*radialFactor (x,y)| ≤ + (2*secondConstant n*D^(N n-2)+3*derivativeConstant n*D^(N n-1))*‖x-y‖ := by + obtain ⟨hDc,hSc,hWc⟩ := constants_nonneg n + have hr : 0 < ‖x‖ := by linarith + have hL : 0 < ‖x-y‖ := norm_pos_iff.mpr (sub_ne_zero.mpr hxy) + have hD1 : |derivativeProfile n ‖x‖| ≤ derivativeConstant n*D^(N n-1) := + (derivativeProfile_bound n ‖x‖).trans (mul_le_mul_of_nonneg_left + (pow_le_pow_left₀ (gapProfile_nonneg _) (hseg _ left_mem_uIcc) _) (constants_nonneg n).1) + have hJ : |inner ℝ (x-y) y| ≤ 2*‖x-y‖ := + (abs_real_inner_le_norm _ _).trans (by nlinarith [norm_nonneg (x-y)]) + have hI : |inner ℝ x (x-y)| ≤ ‖x‖*‖x-y‖ := abs_real_inner_le_norm _ _ + have he := eta_radial_taylor hn hx y hD hseg + rw [flux_linearization_identity (norm_pos_iff.mp hr) hxy] + apply (abs_sub_le _ 0 _).trans + simp only [sub_zero,zero_sub,abs_neg,abs_div,abs_mul,abs_of_nonneg (norm_nonneg x),abs_of_nonneg (sq_nonneg ‖x-y‖)] + have hfirst : |eta n x-eta n y-derivativeProfile n ‖x‖*inner ℝ x (x-y)/‖x‖| * + |inner ℝ (x-y) y|/‖x-y‖^2 ≤ + 2*(secondConstant n*D^(N n-2)+derivativeConstant n*D^(N n-1))*‖x-y‖ := by + apply (div_le_iff₀ (sq_pos_of_pos hL)).mpr + have hh := mul_le_mul he hJ (abs_nonneg _) (by positivity) + nlinarith [hh] + have hsecond : |derivativeProfile n ‖x‖| *|inner ℝ x (x-y)|/‖x‖ ≤ derivativeConstant n*D^(N n-1)*‖x-y‖ := by + apply (div_le_iff₀ hr).mpr + have hh := mul_le_mul hD1 hI (abs_nonneg _) (by positivity) + nlinarith [hh] + linarith + +lemma localError_close {n : ℕ} (hn : 1 ≤ n) {δ : ℝ} (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1/4) + {x y : Space n} (hs : 0 < pairGap (x,y)) (hxy : ‖x-y‖ ≤ δ*pairGap (x,y)^(m n)) (hne : x ≠ y) : + localError (x,y) ≤ closeConstant n*δ*(eta n x+eta n y) := by + obtain ⟨hxpos,hypos,hseg,hL⟩ := close_pair_gaps hδ hδ1 hs hxy + have hs0 := pairGap_bounds (x,y) + obtain ⟨hDc,hSc,hWc⟩ := constants_nonneg n + have hC : 0 ≤ closeConstant n := by unfold closeConstant; positivity + by_cases hx : ‖x‖ ≤ 1/2 + · have hy : ‖y‖ ≤ 1 := by + have hh := norm_le_norm_add_norm_sub x y + have hm : δ*pairGap (x,y) ≤ 1/4 := mul_le_of_le_one_right hδ (hs0.2) |>.trans hδ1 + linarith + have hx1 : ‖x‖ ≤ 1 := by linarith + have hflux : fluxFactor n (x,y)=1 := by + simp only [fluxFactor,X,eta_eq_one hx1,eta_eq_one hy,one_smul,real_inner_self_eq_norm_sq] + exact div_self (ne_of_gt (sq_pos_of_pos (norm_pos_iff.mpr (sub_ne_zero.mpr hne)))) + simp only [localError,hflux,eta_eq_one hx1,eta_eq_one hy,w_inner n hx1,zero_mul, + sub_self,add_zero,abs_zero] + positivity + · have hD : 0 ≤ 2*pairGap (x,y) := by positivity + have hf := flux_close_estimate hn (le_of_not_ge hx) ((d_pos_iff y).mp hypos).le hne hD + (fun _ ht => (norm_segment_gap hseg ht).2) + have he := eta_oscillation n hD hseg + rw [abs_sub_comm,dist_eq_norm] at he + have hN := N_ge_two n + have hP := close_power_bound hs0.1 hs0.2 hδ hxy (by omega : N n-2 ≤ N n) (by simp [m]; omega : N n ≤ N n-2+m n) + have hP' := close_power_bound hs0.1 hs0.2 hδ hxy (by omega : N n-1 ≤ N n) (by simp [m]; omega : N n ≤ N n-1+m n) + unfold localError + calc + _ ≤ (2*secondConstant n)*((2*pairGap (x,y))^(N n-2)*‖x-y‖)+ + (4*derivativeConstant n)*((2*pairGap (x,y))^(N n-1)*‖x-y‖) := by linarith + _ ≤ (2*secondConstant n+4*derivativeConstant n)*(2^(N n)*δ*pairGap (x,y)^(N n)) := by + have hh := mul_le_mul_of_nonneg_left hP (by positivity : 0 ≤ 2*secondConstant n) + have hh' := mul_le_mul_of_nonneg_left hP' (by positivity : 0 ≤ 4*derivativeConstant n) + nlinarith + _ = closeConstant n*δ*pairGap (x,y)^(N n) := by unfold closeConstant; ring + _ ≤ _ := mul_le_mul_of_nonneg_left (pairGap_power_le (x,y)) (mul_nonneg hC hδ) + +end HenonLaneEmden +end +end NearLocalization + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/NewtonBounds.lean b/lean/OAI/Analysis/HenonEmden/NewtonBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..d1b4621eb153f5e12bebd9361ce79d15fe82472d --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/NewtonBounds.lean @@ -0,0 +1,95 @@ +import OAI.Analysis.HenonEmden.Distribution + +namespace OAI + +section NewtonBounds + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +open Set Filter Topology +open MeasureTheory Set Filter Topology +open scoped ContDiff +noncomputable section + + +namespace HenonLaneEmden +open WeakPDE + +lemma IsSolution.dimension_ge_three {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) : 3 ≤ n := by + by_contra hn3 + have hn2 : n = 2 := by omega + subst n + exact h.not_two_dimensional + +lemma IsSolution.source_g_locallyIntegrable {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) : LocallyIntegrable (source v p A) := + locallyIntegrable_source (by omega) h.continuous_v h.positive_v p A (by + have hA := h.first_weight_gt_neg_two hn + have hnreal : (2:ℝ) ≤ n := by exact_mod_cast hn + linarith) + +lemma IsSolution.source_f_locallyIntegrable {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) : LocallyIntegrable (source u q B) := + h.swap.source_g_locallyIntegrable hn + +lemma IsSolution.weak_u {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) {φ : Space n → ℝ} + (hφ : ContDiff ℝ 2 φ) (hφc : HasCompactSupport φ) : + (∫ x, u x*Laplacian.laplacian φ x) = -(∫ x, source v p A x*φ x) := + distributional_extension (by simpa using h.dimension_ge_three hn) h.continuous_u + (h.source_g_locallyIntegrable hn) (fun _ hψ hψc hψ0 => h.weak_u_off_origin hψ hψc hψ0) hφ hφc + +lemma IsSolution.weak_v {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) {φ : Space n → ℝ} + (hφ : ContDiff ℝ 2 φ) (hφc : HasCompactSupport φ) : + (∫ x, v x*Laplacian.laplacian φ x) = -(∫ x, source u q B x*φ x) := h.swap.weak_u hn hφ hφc + +noncomputable def sphereArea (n : ℕ) : ℝ := ((volume : Measure (Space n)).toSphere univ).toReal +noncomputable def newtonDenom (n : ℕ) : ℝ := ((n:ℝ)-2)*sphereArea n + +lemma sphereArea_pos {n : ℕ} (hn : 1 ≤ n) : 0 < sphereArea n := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp only [finrank_euclideanSpace_fin]; omega) + apply ENNReal.toReal_pos + · exact (Measure.measure_univ_pos.mpr (Measure.toSphere_ne_zero volume)).ne' + · exact measure_ne_top _ _ + +lemma newtonDenom_pos {n : ℕ} (hn : 3 ≤ n) : 0 < newtonDenom n := by + apply mul_pos _ (sphereArea_pos (by omega)) + have hnreal : (3:ℝ) ≤ n := by exact_mod_cast hn + linarith + +lemma IsSolution.newton_lower_u {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (x : Space n) : + (∫⁻ y, ENNReal.ofReal (‖x-y‖^(2-(n:ℝ))*source v p A y)) ≤ ENNReal.ofReal (newtonDenom n*u x) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + simpa only [finrank_euclideanSpace_fin,newtonDenom,sphereArea] using + weak_newton_lower (by simpa using h.dimension_ge_three hn) h.continuous_u + (h.source_g_locallyIntegrable hn) (regular_source h.regular_v h.positive_v p A).continuousOn + (fun y => (h.positive_u y).le) (source_nonneg (fun y => (h.positive_v y).le) p A) + (fun _ hφ hφc => h.weak_u hn hφ hφc) x + +lemma IsSolution.kernel_g_integrable {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (x : Space n) : + Integrable (fun y => ‖x-y‖^(2-(n:ℝ))*source v p A y) := by + refine ⟨(((continuous_const.sub continuous_id).norm.measurable.pow_const _).mul + (measurable_source h.continuous_v p A)).aestronglyMeasurable,?_⟩ + apply (hasFiniteIntegral_iff_ofReal (Eventually.of_forall fun y => + mul_nonneg (Real.rpow_nonneg (norm_nonneg (x-y)) _) (source_nonneg (fun z => (h.positive_v z).le) p A y))).mpr + exact lt_of_le_of_lt (h.newton_lower_u hn x) ENNReal.ofReal_lt_top +end HenonLaneEmden + +end +end NewtonBounds + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/NewtonPotential.lean b/lean/OAI/Analysis/HenonEmden/NewtonPotential.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8e2925b9f39fdbce3ad14bcf869ae102e07b3e8 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/NewtonPotential.lean @@ -0,0 +1,222 @@ +import OAI.Analysis.HenonEmden.Harmonic + +namespace OAI + +universe uE uE2 uE3 uE4 + +section NewtonPotential + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +open Set Filter Topology +open MeasureTheory Set Filter Topology +open scoped ContDiff +noncomputable section + + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +noncomputable def rawPotential (g : E → ℝ) (x : E) : ℝ := + ∫ y, ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y + +omit [Nontrivial E] in +lemma measurable_kernel_source {g : E → ℝ} (hg : Measurable g) : + Measurable (fun z : E × E => ‖z.1-z.2‖^(2-(Module.finrank ℝ E:ℝ))*g z.2) := + ((measurable_fst.sub measurable_snd).norm.pow_const _).mul (hg.comp measurable_snd) + +omit [Nontrivial E] in +lemma measurable_rawPotential {g : E → ℝ} (hg : Measurable g) : Measurable (rawPotential g) := + (measurable_kernel_source hg).stronglyMeasurable.integral_prod_right'.measurable + +omit [Nontrivial E] in +lemma rawPotential_nonneg {g : E → ℝ} (hg : ∀ x, 0 ≤ g x) (x : E) : 0 ≤ rawPotential g x := + integral_nonneg fun y => mul_nonneg (Real.rpow_nonneg (norm_nonneg _) _) (hg y) + +omit [Nontrivial E] in +lemma locallyIntegrable_rawPotential {g U : E → ℝ} (hg : Measurable g) (hgp : ∀ x, 0 ≤ g x) + (hU : LocallyIntegrable U) (hbound : ∀ x, rawPotential g x ≤ U x) : + LocallyIntegrable (rawPotential g) := by + apply hU.mono (measurable_rawPotential hg).aestronglyMeasurable + filter_upwards [] with x + rw [Real.norm_eq_abs,abs_of_nonneg (rawPotential_nonneg hgp x)] + exact (hbound x).trans (le_abs_self _) + +lemma integral_kernel_laplacian_translate (hn : 3 ≤ Module.finrank ℝ E) {φ : E → ℝ} + (hφ : ContDiff ℝ 2 φ) (hφc : HasCompactSupport φ) (y : E) : + (∫ x : E, ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*Laplacian.laplacian φ x) = + -((Module.finrank ℝ E:ℝ)-2)*((volume : Measure E).toSphere univ).toReal*φ y := by + have hh := integral_kernel_laplacian hn (hφ.comp (contDiff_const.sub contDiff_id)) + (hφc.comp_homeomorph (Homeomorph.subLeft y)) + simp only [Function.comp_def,id_eq,sub_zero] at hh + simp_rw [laplacian_reflect hφ] at hh + have he := integral_sub_left_eq_self (μ := volume) + (fun x : E => ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*Laplacian.laplacian φ x) y + simp only [sub_sub_cancel_left,norm_neg] at he + exact he ▸ hh + +lemma rawPotential_weak_equation (hn : 3 ≤ Module.finrank ℝ E) {g : E → ℝ} + (hg : Measurable g) (hgp : ∀ x, 0 ≤ g x) + (hki : ∀ x, Integrable (fun y => ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y)) + (hP : LocallyIntegrable (rawPotential g)) {φ : E → ℝ} + (hφ : ContDiff ℝ 2 φ) (hφc : HasCompactSupport φ) : + (∫ x, rawPotential g x*Laplacian.laplacian φ x) = + -((Module.finrank ℝ E:ℝ)-2)*((volume : Measure E).toSphere univ).toReal*(∫ x, g x*φ x) := by + let F (z : E × E) := ‖z.1-z.2‖^(2-(Module.finrank ℝ E:ℝ))*g z.2*Laplacian.laplacian φ z.1 + have hFm : Measurable F := (measurable_kernel_source hg).mul ((continuous_laplacian hφ).measurable.comp measurable_fst) + have hi : Integrable F (volume.prod volume) := by + apply (integrable_prod_iff hFm.aestronglyMeasurable).mpr + refine ⟨Eventually.of_forall fun x => (hki x).mul_const (Laplacian.laplacian φ x),?_⟩ + have hpint := hP.integrable_smul_right_of_hasCompactSupport (continuous_laplacian hφ).norm + (compactSupport_laplacian hφc).norm + convert hpint using 1 + ext x + simp only [F,norm_mul,Real.norm_eq_abs,abs_of_nonneg (Real.rpow_nonneg (norm_nonneg (x- _)) _),abs_of_nonneg (hgp _)] + rw [integral_mul_const] + rfl + calc + _ = ∫ x, ∫ y, F (x,y) := by simp only [F,integral_mul_const,rawPotential] + _ = ∫ y, ∫ x, F (x,y) := integral_integral_swap hi + _ = ∫ y, g y*(-((Module.finrank ℝ E:ℝ)-2)*((volume : Measure E).toSphere univ).toReal*φ y) := by + apply integral_congr_ae + filter_upwards [] with y + have hf : (fun x => F (x,y)) = fun x => g y*(‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*Laplacian.laplacian φ x) := by ext x; dsimp [F]; ring + rw [hf,integral_const_mul,integral_kernel_laplacian_translate hn hφ hφc] + _ = _ := by + rw [← integral_const_mul] + apply integral_congr_ae + filter_upwards [] with y + ring +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma convolve_assoc {f g k : E → ℝ} (hf : LocallyIntegrable f) + (hg : Continuous g) (hgc : HasCompactSupport g) + (hk : Continuous k) (hkc : HasCompactSupport k) : + convolve (convolve f g) k = convolve f (convolve g k) := by + let L := ContinuousLinearMap.mul ℝ ℝ + ext x + apply convolution_assoc L L L L (fun a b c => mul_assoc a b c) + hf.aestronglyMeasurable hg.aestronglyMeasurable hk.aestronglyMeasurable + · exact Eventually.of_forall (hgc.convolutionExists_right L hf hg) + · exact Eventually.of_forall (hkc.norm.convolutionExists_right L hg.norm.locallyIntegrable hk.norm) + · exact (hgc.norm.convolution L hkc.norm).convolutionExists_right L (fun x => (hf x).norm) + (hkc.norm.continuous_convolution_right L hg.norm.locallyIntegrable hk.norm) x + +lemma convolve_const (c : ℝ) (g : E → ℝ) (x : E) : + convolve (fun _ => c) g x = c*(∫ y, g y) := by + rw [convolve_def,integral_const_mul,integral_sub_left_eq_self] + +lemma convolve_const_right (f : E → ℝ) (c : ℝ) (x : E) : + convolve f (fun _ => c) x = (∫ y, f y)*c := by + rw [convolve_def,integral_mul_const] +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE3} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +lemma harmonic_distribution_nonneg_constant (hn : 2 ≤ Module.finrank ℝ E) {h : E → ℝ} + (hi : LocallyIntegrable h) (hp : ∀ x, 0 ≤ h x) + (heq : ∀ (φ : E → ℝ), ContDiff ℝ 2 φ → HasCompactSupport φ → + (∫ y, h y*Laplacian.laplacian φ y) = 0) : + ∃ c : ℝ, 0 ≤ c ∧ ∀ᵐ x, h x = c := by + let ξ (j : ℕ) := (standardBump (E := E) j).normed volume + let c := convolve h (ξ 0) 0 + have hξ (j : ℕ) : ContDiff ℝ 2 (ξ j) := (standardBump j).contDiff_normed + have hξc (j : ℕ) : HasCompactSupport (ξ j) := (standardBump j).hasCompactSupport_normed + have hξp (j : ℕ) (y : E) : 0 ≤ ξ j y := (standardBump j).nonneg_normed y + have hξint (j : ℕ) : (∫ y, ξ j y) = 1 := (standardBump j).integral_normed + have hH (j : ℕ) : ContDiff ℝ 2 (convolve h (ξ j)) := contDiff_convolve hi (hξ j) (hξc j) + have hHeq (j : ℕ) (x : E) : Laplacian.laplacian (convolve h (ξ j)) x = 0 := by + have hh := convolve_weak_equation hi (hξ j) (hξc j) (g := fun _ => 0) + (fun φ hφ hφc => by simpa using heq φ hφ hφc) x + simpa [convolve_def] using hh + have hHc (j : ℕ) : convolve h (ξ j) = fun _ => convolve h (ξ j) 0 := by + ext x + exact SphereCalculus.harmonic_nonnegative_constant hn (hH j) (hHeq j) + (convolve_nonneg hp (hξp j)) x 0 + have hsame (j : ℕ) : convolve h (ξ j) 0 = c := by + have hh : convolve (convolve h (ξ j)) (ξ 0) = convolve (convolve h (ξ 0)) (ξ j) := by + rw [convolve_assoc hi (hξ j).continuous (hξc j) (hξ 0).continuous (hξc 0), + convolve_assoc hi (hξ 0).continuous (hξc 0) (hξ j).continuous (hξc j),convolve_comm (ξ j) (ξ 0)] + rw [hHc j,hHc 0] at hh + have hv := congrFun hh (0:E) + simpa only [convolve_const,hξint,mul_one] using hv + have htest (φ : E → ℝ) (hφ : ContDiff ℝ 2 φ) (hφc : HasCompactSupport φ) (x : E) : + convolve h φ x = c*(∫ y, φ y) := by + have hcφ : Continuous (convolve h φ) := (contDiff_convolve hi hφ hφc).continuous + have ht := convolve_normed_tendsto standardBump_tendsto hcφ.aestronglyMeasurable (hcφ.continuousAt (x := x)) + have hx (j : ℕ) : convolve (convolve h φ) (ξ j) x = c*(∫ y, φ y) := by + have hh : convolve (convolve h φ) (ξ j) = convolve (convolve h (ξ j)) φ := by + rw [convolve_assoc hi hφ.continuous hφc (hξ j).continuous (hξc j), + convolve_assoc hi (hξ j).continuous (hξc j) hφ.continuous hφc,convolve_comm φ (ξ j)] + rw [hh,hHc j,hsame j,convolve_const] + exact tendsto_nhds_unique ht (by simpa only [ξ,← funext hx] using + (tendsto_const_nhds : Tendsto (fun _ : ℕ => c*(∫ y, φ y)) atTop (𝓝 (c*(∫ y, φ y))))) + refine ⟨c,convolve_nonneg hp (hξp 0) 0,?_⟩ + apply ae_eq_of_integral_contDiff_smul_eq hi (continuous_const.locallyIntegrable) + intro φ hφ hφc + have hφ2 : ContDiff ℝ 2 φ := hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top) + have hh := htest (fun y => φ (-y)) (hφ2.comp contDiff_neg) (hφc.comp_homeomorph (Homeomorph.neg E)) (0:E) + simp only [convolve_def,zero_sub,neg_neg,integral_neg_eq_self] at hh + simpa only [smul_eq_mul,integral_mul_const,mul_comm] using hh +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE4} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +lemma potential_constant (hn : 3 ≤ Module.finrank ℝ E) {u g : E → ℝ} + (hu : Continuous u) (hg : Measurable g) (hgp : ∀ x, 0 ≤ g x) + (hki : ∀ x, Integrable (fun y => ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y)) + (hlower : ∀ x, rawPotential g x ≤ ((Module.finrank ℝ E:ℝ)-2)* + ((volume : Measure E).toSphere univ).toReal*u x) + (heq : ∀ (φ : E → ℝ), ContDiff ℝ 2 φ → HasCompactSupport φ → + (∫ y, u y*Laplacian.laplacian φ y) = -(∫ y, g y*φ y)) : + ∃ c : ℝ, 0 ≤ c ∧ ∀ᵐ x, ((Module.finrank ℝ E:ℝ)-2)* + ((volume : Measure E).toSphere univ).toReal*u x = rawPotential g x+c := by + let D := ((Module.finrank ℝ E:ℝ)-2)*((volume : Measure E).toSphere univ).toReal + have hP : LocallyIntegrable (rawPotential g) := + locallyIntegrable_rawPotential hg hgp (hu.const_mul D).locallyIntegrable hlower + let h (x : E) := D*u x-rawPotential g x + have hh : LocallyIntegrable h := (hu.const_mul D).locallyIntegrable.sub hP + have hharm (φ : E → ℝ) (hφ : ContDiff ℝ 2 φ) (hφc : HasCompactSupport φ) : + (∫ x, h x*Laplacian.laplacian φ x) = 0 := by + have h1 := (hu.locallyIntegrable (μ := volume)).integrable_smul_right_of_hasCompactSupport (continuous_laplacian hφ) + (compactSupport_laplacian hφc) + have h2 := hP.integrable_smul_right_of_hasCompactSupport (continuous_laplacian hφ) + (compactSupport_laplacian hφc) + simp only [smul_eq_mul] at h1 h2 + have hf : (fun x => h x*Laplacian.laplacian φ x) = + fun x => D*(u x*Laplacian.laplacian φ x)-rawPotential g x*Laplacian.laplacian φ x := by ext x; dsimp [h]; ring + rw [hf,integral_sub (h1.const_mul D) h2,integral_const_mul,heq φ hφ hφc, + rawPotential_weak_equation hn hg hgp hki hP hφ hφc] + dsimp [D]; ring + obtain ⟨c,hc,hceq⟩ := harmonic_distribution_nonneg_constant (by omega) hh + (fun x => sub_nonneg.mpr (hlower x)) hharm + refine ⟨c,hc,?_⟩ + filter_upwards [hceq] with x hx + change D*u x-rawPotential g x = c at hx + change D*u x = rawPotential g x+c + exact sub_eq_iff_eq_add'.mp hx +end HenonLaneEmden.WeakPDE + +end +end NewtonPotential + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/OriginBounds.lean b/lean/OAI/Analysis/HenonEmden/OriginBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..a61b374905599bec82bd167238baec3f2c54bc61 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/OriginBounds.lean @@ -0,0 +1,221 @@ +import OAI.Analysis.HenonEmden.Sources + +namespace OAI + +section OriginBounds + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +open Set Filter Topology +open MeasureTheory Set Filter Topology +open scoped ContDiff +noncomputable section + + +namespace HenonLaneEmden.RadialODE +lemma impossible_two_dimensional {U V W : ℝ → ℝ} + (hU : ContinuousOn U (Ici 0)) (hV : ∀ r > 0, HasDerivAt U (V r) r) + (hF : ∀ r > 0, HasDerivAt (fun s => s*V s) (-r*W r) r) + (hp : ∀ r > 0, 0 < U r) (hW : ∀ r > 0, 0 < W r) : False := by + have ha : StrictAntiOn (fun s => s*V s) (Ioi 0) := by + apply strictAntiOn_of_hasDerivWithinAt_neg (convex_Ioi 0) + (fun r hr => (hF r hr).continuousAt.continuousWithinAt) + (fun r hr => (hF r (by simpa using hr)).hasDerivWithinAt) + intro r hr + have hr0 : 0 < r := by simpa using hr + exact mul_neg_of_neg_of_pos (neg_neg_of_pos hr0) (hW r hr0) + have hf1 : 1*V 1 ≤ 0 := by + simpa using flux_nonpos (k := 1) (by rfl) hU hV (by simpa using ha.antitoneOn) + (r := 1) zero_lt_one + have hf2 : 2*V 2 < 0 := lt_of_lt_of_le (ha (by norm_num) (by norm_num) (by norm_num)) hf1 + let c : ℝ := -(2*V 2) + have hc : 0 < c := neg_pos.mpr hf2 + have hcomp : AntitoneOn (fun r => U r+c*Real.log r) (Ici 2) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Ici 2) + · intro r hr + change 2 ≤ r at hr + exact ((hV r (by linarith [hr])).continuousAt.add + ((Real.continuousAt_log (by linarith [hr])).const_mul c)).continuousWithinAt + · intro r hr + have hr0 : 0 < r := by simp only [interior_Ici,mem_Ioi] at hr; linarith + exact ((hV r hr0).add ((Real.hasDerivAt_log hr0.ne').const_mul c)).hasDerivWithinAt + · intro r hr + have hr2 : 2 < r := by simpa using hr + have hr0 : 0 < r := by linarith + have hle : r*V r ≤ 2*V 2 := ha.antitoneOn (by norm_num) hr0 hr2.le + change V r+c*r⁻¹ ≤ 0 + have hdiv : V r ≤ (2*V 2)/r := (le_div_iff₀ hr0).mpr (by nlinarith [hle]) + rw [div_eq_mul_inv] at hdiv + dsimp [c] + nlinarith + have hbound : ∀ᶠ r : ℝ in atTop, c*Real.log r ≤ U 2+c*Real.log 2 := by + filter_upwards [eventually_ge_atTop (2:ℝ)] with r hr + have hh := hcomp (by simp) hr hr + have hp' := hp r (by linarith) + linarith + have hlim := Real.tendsto_log_atTop.const_mul_atTop hc + have hconst := tendsto_atTop_mono' atTop hbound hlim + exact not_tendsto_atTop_of_tendsto_nhds tendsto_const_nhds hconst +end HenonLaneEmden.RadialODE + +namespace HenonLaneEmden +open SphereCalculus +lemma IsSolution.not_two_dimensional {p q A B : ℝ} {u v : Space 2 → ℝ} + (h : IsSolution 2 p q A B u v) : False := by + have hw : ContinuousOn (source v p A) ({0}ᶜ : Set (Space 2)) := + (regular_source h.regular_v h.positive_v p A).continuousOn + have heq : ∀ x ≠ 0, -Laplacian.laplacian u x = source v p A x := by + intro x hx; rw [source_off_zero v p A hx]; exact h.equation_u x hx + exact RadialODE.impossible_two_dimensional (continuous_mean h.continuous_u).continuousOn + (fun r hr => hasDerivAt_mean h.regular_u hr) + (fun r hr => by simpa using hasDerivAt_mean_flux h.regular_u hw heq hr) + (fun r _ => mean_pos h.continuous_u h.positive_u r) + (fun r hr => mean_pos_off_origin hw (fun x hx => source_pos h.positive_v p A hx) hr) +end HenonLaneEmden + +namespace HenonLaneEmden.RadialODE +lemma impossible_log_derivative_near_zero {U V : ℝ → ℝ} {c R : ℝ} + (hc : 0 < c) (hR : 0 < R) (hU : ContinuousOn U (Ici 0)) + (hV : ∀ r > 0, HasDerivAt U (V r) r) + (hbound : ∀ r ∈ Ioo 0 R, V r ≤ -c/r) : False := by + let H : ℝ → ℝ := fun r => U r+c*Real.log r + have hanti : AntitoneOn H (Ioo 0 R) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Ioo 0 R) + · intro r hr + exact ((hV r hr.1).continuousAt.add + ((Real.continuousAt_log hr.1.ne').const_mul c)).continuousWithinAt + · intro r hr + have hr' : r ∈ Ioo 0 R := interior_subset hr + exact ((hV r hr'.1).add ((Real.hasDerivAt_log hr'.1.ne').const_mul c)).hasDerivWithinAt + · intro r hr + have hh := hbound r (interior_subset hr) + change V r+c*r⁻¹ ≤ 0 + rw [div_eq_mul_inv,neg_mul] at hh + linarith + have hlimU : Tendsto U (𝓝[>] 0) (𝓝 (U 0)) := (hU 0 (by simp)).mono Ioi_subset_Ici_self + have hlim : Tendsto H (𝓝[>] 0) atBot := hlimU.add_atBot + (Real.tendsto_log_nhdsGT_zero.const_mul_atBot hc) + have hconst : Tendsto (fun _ : ℝ => H (R/2)) (𝓝[>] 0) atBot := by + apply tendsto_atBot_mono' _ _ hlim + filter_upwards [self_mem_nhdsWithin,mem_nhdsWithin_of_mem_nhds + (Iio_mem_nhds (half_pos hR))] with r hr hrR + exact hanti ⟨hr,hrR.trans (half_lt_self hR)⟩ ⟨half_pos hR,half_lt_self hR⟩ hrR.le + exact not_tendsto_nhds_of_tendsto_atBot hconst _ tendsto_const_nhds + +lemma impossible_source_inverse_square {U V W : ℝ → ℝ} {k : ℕ} (hk : 1 ≤ k) + (hU : ContinuousOn U (Ici 0)) (hV : ∀ r > 0, HasDerivAt U (V r) r) + (hF : ∀ r > 0, HasDerivAt (fun s => s^k*V s) (-(r^k*W r)) r) + (hW : ∀ r > 0, 0 ≤ W r) {c R : ℝ} (hc : 0 < c) (hR : 0 < R) + (hbound : ∀ r ∈ Ioo 0 R, c/r^2 ≤ W r) : False := by + have ha : AntitoneOn (fun s => s^k*V s) (Ioi 0) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Ioi 0) + (fun r hr => (hF r hr).continuousAt.continuousWithinAt) + (fun r hr => (hF r (by simpa using hr)).hasDerivWithinAt) + intro r hr + have hr0 : 0 < r := by simpa using hr + exact neg_nonpos.mpr (mul_nonneg (pow_nonneg hr0.le k) (hW r hr0)) + have hneg : ∀ r > 0, r^k*V r ≤ 0 := fun r hr => flux_nonpos hk hU hV ha hr + apply impossible_log_derivative_near_zero (c := c/2^(k+1)) (div_pos hc (by positivity)) hR hU hV + intro r hr + have hhalf : 0 < r/2 := half_pos hr.1 + obtain ⟨s,hs,he⟩ := exists_hasDerivAt_eq_slope (fun t => t^k*V t) + (fun t => -(t^k*W t)) (half_lt_self hr.1) + (fun t ht => (hF t (hhalf.trans_le ht.1)).continuousAt.continuousWithinAt) + (fun t ht => hF t (hhalf.trans ht.1)) + have hs0 : 0 < s := hhalf.trans hs.1 + have hwr : c/r^2 ≤ W s := by + have hsr2 : s^2 ≤ r^2 := pow_le_pow_left₀ hs0.le hs.2.le 2 + exact (div_le_div_of_nonneg_left hc.le (sq_pos_of_pos hs0) hsr2).trans + (hbound s ⟨hs0,hs.2.trans hr.2⟩) + have hpow : (r/2)^k ≤ s^k := pow_le_pow_left₀ hhalf.le hs.1.le k + have hprod : (r/2)^k*(c/r^2) ≤ s^k*W s := mul_le_mul hpow hwr + (div_nonneg hc.le (sq_nonneg r)) (pow_nonneg hs0.le k) + have hfeq : -(s^k*W s)*(r-r/2) = r^k*V r-(r/2)^k*V (r/2) := + (eq_div_iff (sub_pos.mpr (half_lt_self hr.1)).ne').mp he + have hid : (r/2)^k*(c/r^2)*(r-r/2) = r^k*((c/2^(k+1))/r) := by + rw [div_pow,pow_succ] + field_simp + ring + have hest : r^k*V r ≤ -(r^k*((c/2^(k+1))/r)) := by + have hmul := mul_le_mul_of_nonneg_right hprod (sub_pos.mpr (half_lt_self hr.1)).le + rw [hid] at hmul + have hn := hneg (r/2) hhalf + nlinarith + have hdiv : V r ≤ -((c/2^(k+1))/r) := + (mul_le_mul_iff_right₀ (pow_pos hr.1 k)).mp (by nlinarith [hest]) + simpa only [neg_div] using hdiv +end HenonLaneEmden.RadialODE + +namespace HenonLaneEmden +open SphereCalculus +lemma source_mean_factor {n : ℕ} {u : Space n → ℝ} (q B : ℝ) {r : ℝ} (hr : 0 < r) : + mean (source u q B) r = r^B * mean (fun x => (u x)^q) r := by + unfold mean + simp_rw [source_off_zero u q B (smul_sphere_ne_zero hr _),norm_smul_sphere hr.le] + exact integral_const_mul (r^B) _ + +lemma source_mean_lower_near_zero {n : ℕ} (hn : 1 ≤ n) {u : Space n → ℝ} + (hu : Continuous u) (hp : ∀ x, 0 < u x) (q B : ℝ) : + ∃ c > 0, ∃ R > 0, R ≤ 1 ∧ ∀ r ∈ Ioo 0 R, c*r^B ≤ mean (source u q B) r := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp only [finrank_euclideanSpace_fin]; omega) + let a : Space n → ℝ := fun x => (u x)^q + have ha : Continuous a := hu.rpow_const (fun x => Or.inl (hp x).ne') + have ha0 : 0 < mean a 0 := mean_pos ha (fun x => Real.rpow_pos_of_pos (hp x) q) 0 + have he : ∀ᶠ r in 𝓝 (0:ℝ), mean a 0/2 < mean a r := + (continuous_mean ha).continuousAt (Ioi_mem_nhds (half_lt_self ha0)) + obtain ⟨δ,hδ,hnear⟩ := Metric.eventually_nhds_iff.mp he + refine ⟨mean a 0/2,half_pos ha0,min δ 1,lt_min hδ zero_lt_one,min_le_right _ _,?_⟩ + intro r hr + rw [source_mean_factor q B hr.1] + have hh : mean a 0/2 ≤ mean a r := (hnear (by + simpa [Real.dist_eq,abs_of_pos hr.1] using hr.2.trans_le (min_le_left δ 1))).le + simpa only [mul_comm] using mul_le_mul_of_nonneg_left hh (Real.rpow_nonneg hr.1.le B) + +lemma IsSolution.swap {n : ℕ} {p q A B : ℝ} {u v : Space n → ℝ} + (h : IsSolution n p q A B u v) : IsSolution n q p B A v u := + ⟨h.continuous_v,h.continuous_u,h.regular_v,h.regular_u, + h.positive_v,h.positive_u,h.equation_v,h.equation_u⟩ + +lemma IsSolution.first_weight_gt_neg_two {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) : -2 < A := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by + simp only [finrank_euclideanSpace_fin]; omega) + by_contra hA + have hA' : A ≤ -2 := le_of_not_gt hA + obtain ⟨c,hc,R,hR,hR1,hbound⟩ := source_mean_lower_near_zero (by omega) h.continuous_v h.positive_v p A + have hw : ContinuousOn (source v p A) ({0}ᶜ : Set (Space n)) := + (regular_source h.regular_v h.positive_v p A).continuousOn + have heq : ∀ x ≠ 0, -Laplacian.laplacian u x = source v p A x := by + intro x hx; rw [source_off_zero v p A hx]; exact h.equation_u x hx + apply RadialODE.impossible_source_inverse_square (k := n-1) (by omega) + (continuous_mean h.continuous_u).continuousOn (fun r hr => hasDerivAt_mean h.regular_u hr) + (fun r hr => by simpa using hasDerivAt_mean_flux h.regular_u hw heq hr) + (fun r hr => (mean_pos_off_origin hw (fun x hx => source_pos h.positive_v p A hx) hr).le) + hc hR + intro r hr + have hpow := Real.rpow_le_rpow_of_exponent_ge hr.1 (hr.2.le.trans hR1) hA' + have hpow' : (r^2)⁻¹ ≤ r^A := by + simpa only [Real.rpow_neg hr.1.le,Real.rpow_two] using hpow + have hh : c/r^2 ≤ c*r^A := by + simpa only [div_eq_mul_inv] using mul_le_mul_of_nonneg_left hpow' hc.le + exact hh.trans (hbound r hr) + +lemma IsSolution.weights_gt_neg_two {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) : -2 < A ∧ -2 < B := + ⟨h.first_weight_gt_neg_two hn,h.swap.first_weight_gt_neg_two hn⟩ +end HenonLaneEmden + +end +end OriginBounds + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/OriginCutoff.lean b/lean/OAI/Analysis/HenonEmden/OriginCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..e37d127c3581f587567330737ebd9ae72f6b4fc1 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/OriginCutoff.lean @@ -0,0 +1,71 @@ +import OAI.Analysis.HenonEmden.WeightedVirial + +namespace OAI + +universe uE + +section OriginCutoff + +open MeasureTheory Set Filter Topology Metric +open scoped InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open WeakPDE Cutoff + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + [MeasurableSpace E] [BorelSpace E] + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma compact_radialDir {ψ : E → ℝ} (hψ : HasCompactSupport ψ) : + HasCompactSupport (fun x => dir ψ x x) := by + apply HasCompactSupport.intro hψ + intro x hx + simp only [dir,fderiv_of_notMem_tsupport ℝ hx,zero_apply] + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma compact_dilation_eventually_zero {ψ : E → ℝ} (hψ : HasCompactSupport ψ) + {x : E} (hx : x ≠ 0) : + (fun R : ℝ => ψ (R⁻¹ • x)) =ᶠ[𝓝[>] 0] 0 := by + obtain ⟨M,hM⟩ := hψ.isBounded.exists_norm_le + have he : 0 < ‖x‖/(max M 0+1) := div_pos (norm_pos_iff.mpr hx) (by positivity) + filter_upwards [self_mem_nhdsWithin,(eventually_lt_nhds he).filter_mono nhdsWithin_le_nhds] with R hR hlt + apply image_eq_zero_of_notMem_tsupport + intro hs + have hh := hM _ hs + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hR),← div_eq_inv_mul] at hh + have hb : R*M < ‖x‖ := by + have hr : R*(max M 0+1) < ‖x‖ := (lt_div_iff₀ (by positivity : 0 < max M 0+1)).mp hlt + exact (mul_le_mul_of_nonneg_left (by linarith [le_max_left M 0] : M ≤ max M 0+1) hR.le).trans_lt hr + exact (not_le_of_gt hb) (by nlinarith [(div_le_iff₀ hR).mp hh]) + +lemma integral_mul_dilation_tendsto_zero [Nontrivial E] {G ψ : E → ℝ} + (hG : Integrable G) (hψ : Continuous ψ) (hψc : HasCompactSupport ψ) : + Tendsto (fun R : ℝ => ∫ x, G x*ψ (R⁻¹ • x)) (𝓝[>] 0) (𝓝 0) := by + obtain ⟨M,hM⟩ := hψc.exists_bound_of_continuous hψ + have hh := tendsto_integral_filter_of_dominated_convergence (μ := volume) (l := 𝓝[>] (0:ℝ)) + (F := fun R x => G x*ψ (R⁻¹ • x)) (f := fun _ => (0:ℝ)) (fun x => M*‖G x‖) + (Eventually.of_forall fun R => hG.aestronglyMeasurable.mul + (hψ.comp (continuous_const.smul continuous_id)).aestronglyMeasurable) + (Eventually.of_forall fun R => ae_of_all _ fun x => by + rw [norm_mul]; exact (mul_le_mul_of_nonneg_left (hM _) (norm_nonneg _)).trans_eq (mul_comm _ _)) + (hG.norm.const_mul M) ?_ + · simpa only [integral_zero] using hh + filter_upwards [ae_iff.mpr (show volume {x : E | ¬x ≠ 0}=0 by simp)] with x hx + apply tendsto_const_nhds.congr' + filter_upwards [compact_dilation_eventually_zero hψc hx] with R hR + simp [hR] + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma radialDir_dilation {ψ : E → ℝ} (hψ : Differentiable ℝ ψ) (R : ℝ) (x : E) : + dir (fun y => ψ (R⁻¹ • y)) x x = dir ψ (R⁻¹ • x) (R⁻¹ • x) := by + have hh := (hψ (R⁻¹ • x)).hasFDerivAt.comp x + ((hasFDerivAt_id x).const_smul R⁻¹) + change HasFDerivAt (fun y => ψ (R⁻¹ • y)) _ x at hh + rw [dir,hh.fderiv] + rfl + +end HenonLaneEmden +end +end OriginCutoff + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/OriginVirial.lean b/lean/OAI/Analysis/HenonEmden/OriginVirial.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6f886de00dc9b43695515a7c71c84eddbf2d6c6 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/OriginVirial.lean @@ -0,0 +1,97 @@ +import OAI.Analysis.HenonEmden.RadialJoint + +namespace OAI + +section OriginVirial + +open MeasureTheory Set Filter Topology Metric +open scoped InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open WeakPDE Cutoff + +lemma integrable_mul_dilation {n : ℕ} {G ψ : Space n → ℝ} + (hG : Integrable G) (hψ : Continuous ψ) (hψc : HasCompactSupport ψ) (R : ℝ) : + Integrable (fun x => G x*ψ (R⁻¹ • x)) := by + obtain ⟨M,hM⟩ := hψc.exists_bound_of_continuous hψ + exact hG.mul_bdd (hψ.comp (continuous_id.const_smul (R⁻¹))).aestronglyMeasurable + (ae_of_all _ fun x => hM _) + +lemma radialDir_inner_cutoff {n : ℕ} (ξ : ContDiffBump (0:Space n)) (R : ℝ) (x : Space n) : + dir (fun y => eta n y-eta n y*ξ (R⁻¹ • y)) x x = + -w n x*(1-ξ (R⁻¹ • x))-eta n x*dir ξ (R⁻¹ • x) (R⁻¹ • x) := by + have hξ : ContDiff ℝ 2 (ξ : Space n → ℝ) := ξ.contDiff + have hξdiff := hξ.differentiable (by norm_num) + have hηd := (hasFDerivAt_eta n x).differentiableAt + have hξd : Differentiable ℝ (fun y : Space n => ξ (R⁻¹ • y)) := + hξdiff.comp (differentiable_id.const_smul (R⁻¹)) + have he : dir (fun y => eta n y-eta n y*ξ (R⁻¹ • y)) x x = + dir (eta n) x x-dir (fun y => eta n y*ξ (R⁻¹ • y)) x x := by + have hm : DifferentiableAt ℝ (fun y => eta n y*ξ (R⁻¹ • y)) x := hηd.mul (hξd x) + unfold dir + rw [show (fun y => eta n y-eta n y*ξ (R⁻¹ • y)) = eta n-(fun y => eta n y*ξ (R⁻¹ • y)) by rfl, + fderiv_sub hηd hm] + rfl + rw [he,dir_mul hηd (hξd x),radialDir_dilation hξdiff] + simp only [w,dir] + ring + +lemma IsSolution.weighted_virial {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + ((n:ℝ)+B)*weightedEnergy (eta n) u q B-weightedEnergy (w n) u q B = + -(q+1)*(∫ x, eta n x*source u q B x*dir u x x) := by + have : Nontrivial (Space n) := (Module.finrank_pos_iff (R := ℝ)).mp (by simp; omega) + let ξ : ContDiffBump (0:Space n) := ⟨1,2,by norm_num,by norm_num⟩ + let ψ (x : Space n) := dir ξ x x + have hψ : Continuous ψ := ((ξ.contDiff : ContDiff ℝ 2 (ξ : Space n → ℝ)).continuous_fderiv (by norm_num)).clm_apply continuous_id + have hψc : HasCompactSupport ψ := compact_radialDir ξ.hasCompactSupport + let G (x : Space n) := energyDensity u q B x*(((n:ℝ)+B)*eta n x-w n x) + let H (x : Space n) := energyDensity u q B x*eta n x + let J (x : Space n) := eta n x*source u q B x*dir u x x + have hG : Integrable G := (h.energy_locallyIntegrable hn).integrable_smul_right_of_hasCompactSupport + ((continuous_const.mul (continuous_eta n)).sub (continuous_w n)) + (((compactSupport_eta n).mul_left).sub (compactSupport_w n)) + have hH : Integrable H := (h.energy_locallyIntegrable hn).integrable_smul_right_of_hasCompactSupport + (continuous_eta n) (compactSupport_eta n) + have hJ : Integrable J := h.integrable_eta_source_radialDir hn hp hq + have he : ∀ᶠ R : ℝ in 𝓝[>] 0, + ((∫ x, G x)-(∫ x, G x*ξ (R⁻¹ • x)))-(∫ x, H x*ψ (R⁻¹ • x)) = + -(q+1)*((∫ x, J x)-(∫ x, J x*ξ (R⁻¹ • x))) := by + filter_upwards [self_mem_nhdsWithin] with R hR + obtain ⟨hθ,hθc,hθ0⟩ := cutoff_test_off_origin (contDiff_eta (by omega : 1 ≤ n)) (compactSupport_eta n) ξ hR + have hh := weighted_virial_off_origin h.regular_u h.positive_u q B (hθ.of_le (by norm_num)) hθc hθ0 + have hL : (∫ x, energyDensity u q B x*(((n:ℝ)+B)*(eta n x-eta n x*ξ (R⁻¹ • x))+ + dir (fun y => eta n y-eta n y*ξ (R⁻¹ • y)) x x)) = + ((∫ x, G x)-(∫ x, G x*ξ (R⁻¹ • x)))-(∫ x,H x*ψ (R⁻¹ • x)) := by + have hsub : Integrable (fun x => G x-G x*ξ (R⁻¹ • x)) := + hG.sub (integrable_mul_dilation hG ξ.continuous ξ.hasCompactSupport R) + rw [← integral_sub hG (integrable_mul_dilation hG ξ.continuous ξ.hasCompactSupport R), + ← integral_sub hsub (integrable_mul_dilation hH hψ hψc R)] + apply integral_congr_ae + exact ae_of_all _ fun x => by dsimp only; rw [radialDir_inner_cutoff]; dsimp only [G,H,ψ]; ring + have hR' : (∫ x, (eta n x-eta n x*ξ (R⁻¹ • x))*source u q B x*dir u x x) = + (∫ x, J x)-(∫ x,J x*ξ (R⁻¹ • x)) := by + rw [← integral_sub hJ (integrable_mul_dilation hJ ξ.continuous ξ.hasCompactSupport R)] + apply integral_congr_ae + exact ae_of_all _ fun x => by dsimp only [J]; ring + rwa [hL,hR'] at hh + have hlimL := ((tendsto_const_nhds (x := ∫ x,G x)).sub (integral_mul_dilation_tendsto_zero hG ξ.continuous ξ.hasCompactSupport)).sub + (integral_mul_dilation_tendsto_zero hH hψ hψc) + have hlimR := ((tendsto_const_nhds (x := ∫ x,J x)).sub (integral_mul_dilation_tendsto_zero hJ ξ.continuous ξ.hasCompactSupport)).const_mul (-(q+1)) + have hh : (∫ x, G x) = -(q+1)*(∫ x,J x) := by + simpa only [sub_zero] using tendsto_nhds_unique hlimL (hlimR.congr' (he.mono fun _ hR => hR.symm)) + rw [← hh] + have hiη := h.integrable_source_energy_weight hn (continuous_eta n) (compactSupport_eta n) + have hiw := h.integrable_source_energy_weight hn (continuous_w n) (compactSupport_w n) + rw [weightedEnergy,weightedEnergy,← integral_const_mul,← integral_sub (hiη.const_mul _) hiw] + apply integral_congr_ae + filter_upwards [ae_iff.mpr (show volume {x : Space n | ¬x ≠ 0}=0 by simp)] with x hx + dsimp only [G] + rw [energyDensity_eq_source_mul h.positive_u q B hx] + ring + +end HenonLaneEmden +end +end OriginVirial + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/PDEPressure.lean b/lean/OAI/Analysis/HenonEmden/PDEPressure.lean new file mode 100644 index 0000000000000000000000000000000000000000..d888e91c4046262b51c2e3a703538e2b847cea05 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/PDEPressure.lean @@ -0,0 +1,124 @@ +import OAI.Analysis.HenonEmden.GlobalLoss + +namespace OAI + +section PDEPressure + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open LayerTonelli + +lemma lintegral_pair_interaction {n : ℕ} {f g : Space n → ℝ} + (hf : Measurable f) (hg : Measurable g) {F : Space n × Space n → ℝ≥0∞} + (hF : Measurable F) : + (∫⁻ z, F (z.1.1,z.2.1)*ENNReal.ofReal (newtonKernel n (z.1.1,z.2.1)) + ∂(layerMeasure volume f).prod (layerMeasure volume g)) = ∫⁻ z, F z ∂interaction f g := by + rw [lintegral_pair_spatial volume hf hg (F := fun z => F z*ENNReal.ofReal (newtonKernel n z)) (by fun_prop [measurable_newtonKernel,measurable_directionalFactor]), + lintegral_interaction hf hg hF] + apply lintegral_congr + intro z + ring + +namespace SpatialComponents +open Cutoff AdaptiveCap LayerPressure + +lemma IsSolution_pairRight_recovery {n : ℕ} (hn : 3 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) (e : sphere (0:Space n) 1) : + (∫⁻ z, ENNReal.ofReal (spatialPairRight (source u q B) (source v p A) κ δ e z) + ∂(layerMeasure volume (source u q B)).prod (layerMeasure volume (source v p A))) = + (endpointIntegral u (source u q B) κ δ e+endpointIntegral v (source v p A) κ δ e)+ + capPressureIntegral (source u q B) (source v p A) κ e+ + pairMismatchIntegral (source u q B) (source v p A) κ δ e := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hf := isOpen_source_subgraph h.regular_u h.positive_u q B + have hg := isOpen_source_subgraph h.regular_v h.positive_v p A + have hfM := measurable_source h.continuous_u q B + have hgM := measurable_source h.continuous_v p A + have hm1 : Measurable (fun z : Space n × ℝ => lineWeight volume (source u q B) κ δ (e,z)) := + (measurable_lineWeight volume hf hκ hκ1 δ).comp (measurable_const.prodMk measurable_id) + have hm2 : Measurable (fun z : Space n × ℝ => lineWeight volume (source v p A) κ δ (e,z)) := + (measurable_lineWeight volume hg hκ hκ1 δ).comp (measurable_const.prodMk measurable_id) + have hlo1 : Measurable (fun z : Space n × ℝ => lowerPoint (source u q B) (e,z)) := + (measurable_lowerPoint hf).comp (measurable_const.prodMk measurable_id) + have hhi1 : Measurable (fun z : Space n × ℝ => upperPoint (source u q B) (e,z)) := + (measurable_upperPoint hf).comp (measurable_const.prodMk measurable_id) + have hlo2 : Measurable (fun z : Space n × ℝ => lowerPoint (source v p A) (e,z)) := + (measurable_lowerPoint hg).comp (measurable_const.prodMk measurable_id) + have hhi2 : Measurable (fun z : Space n × ℝ => upperPoint (source v p A) (e,z)) := + (measurable_upperPoint hg).comp (measurable_const.prodMk measurable_id) + have hh : Measurable (weight volume κ e : Space n → ℝ) := (continuous_weight volume hκ hκ1 e).measurable + have hn2 : 0 ≤ (n:ℝ)-2 := by exact_mod_cast (show (2:ℝ) ≤ n by exact_mod_cast (show 2 ≤ n by omega)) |> sub_nonneg.mpr + have he (z : (Space n × ℝ) × (Space n × ℝ)) : + ENNReal.ofReal (spatialPairRight (source u q B) (source v p A) κ δ e z) = + ENNReal.ofReal (lineWeight volume (source u q B) κ δ (e,z.1))* + ((ENNReal.ofReal (newtonKernel n (lowerPoint (source u q B) (e,z.1),z.2.1))+ + ENNReal.ofReal (newtonKernel n (upperPoint (source u q B) (e,z.1),z.2.1)))/2)+ + ENNReal.ofReal (lineWeight volume (source v p A) κ δ (e,z.2))* + ((ENNReal.ofReal (newtonKernel n (z.1.1,lowerPoint (source v p A) (e,z.2)))+ + ENNReal.ofReal (newtonKernel n (z.1.1,upperPoint (source v p A) (e,z.2))))/2)+ + ENNReal.ofReal (((n:ℝ)-2)*weight volume κ e z.1.1*directionalFactor e (z.1.1,z.2.1))* + ENNReal.ofReal (newtonKernel n (z.1.1,z.2.1))+ + ENNReal.ofReal (|lineWeight volume (source u q B) κ δ (e,z.1)-lineWeight volume (source v p A) κ δ (e,z.2)| * + newtonKernel n (z.1.1,z.2.1)) := by + have hk := newtonKernel_nonneg hn + have hχ := lineWeight_nonneg (μ := (volume : Measure (Space n))) + have hh0 := weight_nonneg (μ := (volume : Measure (Space n))) + have hd := (directionalFactor_bounds e (z.1.1,z.2.1)).1 + have hχ1 := hχ (source u q B) κ δ (e,z.1) + have hχ2 := hχ (source v p A) κ δ (e,z.2) + have hh1 := hh0 κ e z.1.1 + have hk0 := hk (z.1.1,z.2.1) + have hk1 := hk (lowerPoint (source u q B) (e,z.1),z.2.1) + have hk2 := hk (upperPoint (source u q B) (e,z.1),z.2.1) + have hk3 := hk (z.1.1,lowerPoint (source v p A) (e,z.2)) + have hk4 := hk (z.1.1,upperPoint (source v p A) (e,z.2)) + unfold spatialPairRight + rw [add_mul] + rw [ENNReal.ofReal_add (by positivity) (by positivity), + ENNReal.ofReal_add (by positivity) (by positivity), + ENNReal.ofReal_add (by positivity) (by positivity)] + rw [ENNReal.ofReal_mul (hχ _ _ _ _),ENNReal.ofReal_mul (hχ _ _ _ _), + ENNReal.ofReal_div_of_pos (show (0:ℝ)<2 by norm_num), + ENNReal.ofReal_div_of_pos (show (0:ℝ)<2 by norm_num), + ENNReal.ofReal_add (hk _) (hk _),ENNReal.ofReal_add (hk _) (hk _), + ENNReal.ofReal_mul (mul_nonneg (mul_nonneg hn2 (hh0 _ _ _)) hd),ENNReal.ofReal_ofNat] + ring + have hm1' := measurable_lineWeight volume hf hκ hκ1 δ + have hm2' := measurable_lineWeight volume hg hκ hκ1 δ + have hlo1' := measurable_lowerPoint hf + have hhi1' := measurable_upperPoint hf + have hlo2' := measurable_lowerPoint hg + have hhi2' := measurable_upperPoint hg + have hh' := measurable_weight (volume : Measure (Space n)) hκ hκ1 + simp_rw [he] + rw [lintegral_add_left (by fun_prop [measurable_newtonKernel,measurable_directionalFactor]),lintegral_add_left (by fun_prop [measurable_newtonKernel,measurable_directionalFactor]),lintegral_add_left (by fun_prop [measurable_newtonKernel,measurable_directionalFactor]), + lintegral_pair_endpoint_average volume hgM (measurable_newtonKernel n).ennreal_ofReal hm1.ennreal_ofReal hlo1 hhi1, + lintegral_pair_endpoint_average_right volume hfM (measurable_newtonKernel n).ennreal_ofReal + (fun x y => congrArg ENNReal.ofReal (newtonKernel_symm n x y)) hm2.ennreal_ofReal hlo2 hhi2, + lintegral_pair_interaction hfM hgM (F := fun z => ENNReal.ofReal (((n:ℝ)-2)*weight volume κ e z.1*directionalFactor e z)) (by fun_prop [measurable_newtonKernel,measurable_directionalFactor])] + simp_rw [weighted_potential_endpoint (by omega) h hq hκ hκ1 hδ e, + weighted_potential_endpoint (by omega) h.swap hp hκ hκ1 hδ e] + rfl + +lemma IsSolution_pressure_comparison {n : ℕ} (hn : 3 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) (e : sphere (0:Space n) 1) : + positionIntegral u (source u q B) κ δ e+positionIntegral v (source v p A) κ δ e ≤ + (endpointIntegral u (source u q B) κ δ e+endpointIntegral v (source v p A) κ δ e)+ + capPressureIntegral (source u q B) (source v p A) κ e+ + pairMismatchIntegral (source u q B) (source v p A) κ δ e := by + rw [← IsSolution_pairLeft_recovery (by omega) h hp hq hκ hκ1, + ← IsSolution_pairRight_recovery hn h hp hq hκ hκ1 hδ] + exact spatial_global_nonnegative_pressure hn (measurable_source h.continuous_u q B) + (measurable_source h.continuous_v p A) (isOpen_source_subgraph h.regular_u h.positive_u q B) + (isOpen_source_subgraph h.regular_v h.positive_v p A) hκ hκ1 δ e + +end SpatialComponents +end HenonLaneEmden +end +end PDEPressure + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/PairPressure.lean b/lean/OAI/Analysis/HenonEmden/PairPressure.lean new file mode 100644 index 0000000000000000000000000000000000000000..09fe98322dc60391f489b58a7a8022fb7846a7d3 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/PairPressure.lean @@ -0,0 +1,133 @@ +import OAI.Analysis.HenonEmden.SpatialPressure + +namespace OAI + +universe uE uE2 uE3 uE4 + +section PairPressure + +open MeasureTheory Set Metric +open scoped ENNReal InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open LineCoordinates + +def directionalFactor {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (e : sphere (0:E) 1) (z : E × E) : ℝ := + (inner ℝ (e:E) (z.1-z.2))^2/‖z.1-z.2‖^2 + +@[fun_prop] lemma measurable_directionalFactor {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] (e : sphere (0:E) 1) : Measurable (directionalFactor e) := by + unfold directionalFactor; fun_prop +lemma directionalFactor_bounds {E : Type uE3} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (e : sphere (0:E) 1) (z : E × E) : 0 ≤ directionalFactor e z ∧ directionalFactor e z ≤ 1 := by + have hh : |inner ℝ (e:E) (z.1-z.2)| ≤ ‖z.1-z.2‖ := by + simpa only [norm_unit,one_mul] using abs_real_inner_le_norm (e:E) (z.1-z.2) + refine ⟨by unfold directionalFactor; positivity,?_⟩ + unfold directionalFactor + by_cases hz : z.1-z.2=0 + · simp [hz] + · apply (div_le_one (sq_pos_of_pos (norm_pos_iff.mpr hz))).mpr + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) (norm_nonneg _)).mpr hh + +lemma coordinate_kernel {n : ℕ} (e : sphere (0:Space n) 1) (z z' : transverse e × ℝ) : + LayerPressure.splitKernel n (newtonDenom n)⁻¹ (z,z') = + newtonKernel n (measurableEquiv e z,measurableEquiv e z') := by + unfold LayerPressure.splitKernel IntervalGeometry.kernel newtonKernel + rw [← distance_sq,dist_eq_norm,← Real.rpow_natCast,← Real.rpow_mul (norm_nonneg _)] + congr 2 + ring + +lemma coordinate_direction {E : Type uE4} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] (e : sphere (0:E) 1) (z z' : transverse e × ℝ) : + LayerPressure.splitDirection (z,z') = directionalFactor e (measurableEquiv e z,measurableEquiv e z') := by + have hi : inner ℝ (e:E) (measurableEquiv e z-measurableEquiv e z') = z.2-z'.2 := by + simp only [measurableEquiv_apply,inner_sub_right,inner_add_right,inner_smul_right, + inner_transverse,real_inner_self_eq_norm_sq,norm_unit,one_pow,mul_one,zero_add] + unfold LayerPressure.splitDirection directionalFactor + rw [hi,← distance_sq,dist_eq_norm] + +namespace SpatialComponents +open Cutoff AdaptiveCap LineComponents LayerTonelli + +def spatialPairLeft {n : ℕ} (f g : Space n → ℝ) (κ δ : ℝ) (e : sphere (0:Space n) 1) + (z : (Space n × ℝ) × (Space n × ℝ)) : ℝ := + (lineWeight volume f κ δ (e,z.1)+lineWeight volume g κ δ (e,z.2))*newtonKernel n (z.1.1,z.2.1) + +def spatialPairRight {n : ℕ} (f g : Space n → ℝ) (κ δ : ℝ) (e : sphere (0:Space n) 1) + (z : (Space n × ℝ) × (Space n × ℝ)) : ℝ := + lineWeight volume f κ δ (e,z.1)* + ((newtonKernel n (lowerPoint f (e,z.1),z.2.1)+newtonKernel n (upperPoint f (e,z.1),z.2.1))/2)+ + lineWeight volume g κ δ (e,z.2)* + ((newtonKernel n (z.1.1,lowerPoint g (e,z.2))+newtonKernel n (z.1.1,upperPoint g (e,z.2)))/2)+ + (((n:ℝ)-2)*weight volume κ e z.1.1*directionalFactor e (z.1.1,z.2.1)+ + |lineWeight volume f κ δ (e,z.1)-lineWeight volume g κ δ (e,z.2)|)*newtonKernel n (z.1.1,z.2.1) + +lemma measurable_spatialPairLeft {n : ℕ} (hn : 1 ≤ n) {f g : Space n → ℝ} + (hf : IsOpen {z : Space n × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + (hg : IsOpen {z : Space n × ℝ | 0 < z.2 ∧ z.2 < g z.1}) + {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (δ : ℝ) (e : sphere (0:Space n) 1) : + Measurable (spatialPairLeft f g κ δ e) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hm1 := measurable_lineWeight volume hf hκ hκ1 δ + have hm2 := measurable_lineWeight volume hg hκ hκ1 δ + unfold spatialPairLeft + fun_prop + +lemma measurable_spatialPairRight {n : ℕ} (hn : 1 ≤ n) {f g : Space n → ℝ} + (hf : IsOpen {z : Space n × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + (hg : IsOpen {z : Space n × ℝ | 0 < z.2 ∧ z.2 < g z.1}) + {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (δ : ℝ) (e : sphere (0:Space n) 1) : + Measurable (spatialPairRight f g κ δ e) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hm1 := measurable_lineWeight volume hf hκ hκ1 δ + have hm2 := measurable_lineWeight volume hg hκ hκ1 δ + have hlo1 := measurable_lowerPoint hf + have hlo2 := measurable_lowerPoint hg + have hhi1 := measurable_upperPoint hf + have hhi2 := measurable_upperPoint hg + have hh := (continuous_weight volume hκ hκ1 e).measurable + unfold spatialPairRight + fun_prop + +lemma spatial_global_nonnegative_pressure {n : ℕ} (hn : 3 ≤ n) {f g : Space n → ℝ} + (hf : Measurable f) (hg : Measurable g) + (hfo : IsOpen {z : Space n × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + (hgo : IsOpen {z : Space n × ℝ | 0 < z.2 ∧ z.2 < g z.1}) + {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (δ : ℝ) (e : sphere (0:Space n) 1) : + (∫⁻ z, ENNReal.ofReal (spatialPairLeft f g κ δ e z) + ∂(layerMeasure volume f).prod (layerMeasure volume g)) ≤ + ∫⁻ z, ENNReal.ofReal (spatialPairRight f g κ δ e z) + ∂(layerMeasure volume f).prod (layerMeasure volume g) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have : Nontrivial (transverse e) := transverse_nontrivial (by simp; omega) e + have hp := LayerPressure.global_nonnegative_pressure (volume : Measure (transverse e)) n hn + (inv_nonneg.mpr (newtonDenom_pos hn).le) (hf.comp (measurableEquiv e).measurable) + (hg.comp (measurableEquiv e).measurable) (coordinate_layer_open e hfo) (coordinate_layer_open e hgo) + ((continuous_weight volume hκ hκ1 e).comp (continuous_measurableEquiv e)) + (continuous_d.comp (continuous_measurableEquiv e)) + (fun x => weight_nonneg volume κ e (measurableEquiv e x)) δ + have hmp := (measurePreserving_coordinateLayer e hf).prod (measurePreserving_coordinateLayer e hg) + rw [← hmp.lintegral_comp (measurable_spatialPairLeft (by omega) hfo hgo hκ hκ1 δ e).ennreal_ofReal, + ← hmp.lintegral_comp (measurable_spatialPairRight (by omega) hfo hgo hκ hκ1 δ e).ennreal_ofReal] + convert hp using 1 + · apply lintegral_congr + intro z + congr 1 + simp only [LayerPressure.pairLeft,spatialPairLeft,coordinate_sourceWeight e hfo hκ hκ1, + coordinate_sourceWeight e hgo hκ hκ1,coordinate_kernel] + rfl + · apply lintegral_congr + intro z + congr 1 + simp only [LayerPressure.pairRight,spatialPairRight,coordinate_sourceWeight e hfo hκ hκ1, + coordinate_sourceWeight e hgo hκ hκ1,coordinate_kernel,coordinate_direction, + coordinate_sourceLower,coordinate_sourceUpper,Function.comp_apply] + rfl + +end SpatialComponents +end HenonLaneEmden +end +end PairPressure + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/PairRecovery.lean b/lean/OAI/Analysis/HenonEmden/PairRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..b25947fed354f0baebdb14d8f110fd353def1989 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/PairRecovery.lean @@ -0,0 +1,99 @@ +import OAI.Analysis.HenonEmden.PairPressure + +namespace OAI + +section PairRecovery + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap LayerTonelli + +def positionIntegral {n : ℕ} (u f : Space n → ℝ) (κ δ : ℝ) (e : sphere (0:Space n) 1) : ℝ≥0∞ := + ∫⁻ z, ENNReal.ofReal (lineWeight volume f κ δ (e,z)*u z.1) ∂layerMeasure volume f + +def endpointIntegral {n : ℕ} (u f : Space n → ℝ) (κ δ : ℝ) (e : sphere (0:Space n) 1) : ℝ≥0∞ := + ∫⁻ z, ENNReal.ofReal (lineWeight volume f κ δ (e,z)*endpointAverage u f (e,z)) ∂layerMeasure volume f + +def lossIntegral {n : ℕ} (u f : Space n → ℝ) (κ δ : ℝ) (e : sphere (0:Space n) 1) : ℝ≥0∞ := + ∫⁻ z, ENNReal.ofReal ((weight volume κ e z.1-lineWeight volume f κ δ (e,z))*u z.1) ∂layerMeasure volume f + +def capPressureIntegral {n : ℕ} (f g : Space n → ℝ) (κ : ℝ) (e : sphere (0:Space n) 1) : ℝ≥0∞ := + ∫⁻ z, ENNReal.ofReal (((n:ℝ)-2)*weight volume κ e z.1*directionalFactor e z) ∂interaction f g + +def pairMismatchIntegral {n : ℕ} (f g : Space n → ℝ) (κ δ : ℝ) (e : sphere (0:Space n) 1) : ℝ≥0∞ := + ∫⁻ z, ENNReal.ofReal (|lineWeight volume f κ δ (e,z.1)-lineWeight volume g κ δ (e,z.2)| * + newtonKernel n (z.1.1,z.2.1)) ∂(layerMeasure volume f).prod (layerMeasure volume g) + +def capMismatchIntegral {n : ℕ} (f g : Space n → ℝ) (κ : ℝ) (e : sphere (0:Space n) 1) : ℝ≥0∞ := + ∫⁻ z, ENNReal.ofReal (|weight volume κ e z.1-weight volume κ e z.2|) ∂interaction f g + +lemma weighted_potential_position {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + (κ δ : ℝ) (e : sphere (0:Space n) 1) (z : Space n × ℝ) : + ENNReal.ofReal (lineWeight volume (source u q B) κ δ (e,z))* + potential volume (fun z => ENNReal.ofReal (newtonKernel n z)) (source v p A) z.1 = + ENNReal.ofReal (lineWeight volume (source u q B) κ δ (e,z)*u z.1) := by + have hnχ := lineWeight_nonneg volume (source u q B) κ δ (e,z) + by_cases hχ : 0 < lineWeight volume (source u q B) κ δ (e,z) + · have hb := positive_lineWeight_base volume hχ + have hx : z.1 ≠ 0 := by + intro hx; rw [hx,source_zero] at hb; linarith [hb.1,hb.2.1] + rw [h.newton_potential_u hn hq hx,ENNReal.ofReal_mul hnχ] + · rw [le_antisymm (not_lt.mp hχ) hnχ] + simp + +lemma weighted_potential_endpoint {n : ℕ} (hn : 2 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) + (e : sphere (0:Space n) 1) (z : Space n × ℝ) : + ENNReal.ofReal (lineWeight volume (source u q B) κ δ (e,z))* + ((potential volume (fun z => ENNReal.ofReal (newtonKernel n z)) (source v p A) (lowerPoint (source u q B) (e,z))+ + potential volume (fun z => ENNReal.ofReal (newtonKernel n z)) (source v p A) (upperPoint (source u q B) (e,z)))/2) = + ENNReal.ofReal (lineWeight volume (source u q B) κ δ (e,z)*endpointAverage u (source u q B) (e,z)) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hnχ := lineWeight_nonneg volume (source u q B) κ δ (e,z) + by_cases hχ : 0 < lineWeight volume (source u q B) κ δ (e,z) + · have hf := isOpen_source_subgraph h.regular_u h.positive_u q B + have hfc (y : Space n) (hy : y ≠ 0) : ContinuousAt (source u q B) y := + (regular_source h.regular_u h.positive_u q B).continuousOn.continuousAt (isOpen_compl_singleton.mem_nhds hy) + have hlo := (endpoint_spec volume hf hfc hκ hκ1 hδ hχ (Or.inl rfl)).1 + have hhi := (endpoint_spec volume hf hfc hκ hκ1 hδ hχ (Or.inr rfl)).1 + have hlo0 : lowerPoint (source u q B) (e,z) ≠ 0 := norm_ne_zero_iff.mp (by change ‖z.1+_ • (e:Space n)‖ ≠ 0; linarith) + have hhi0 : upperPoint (source u q B) (e,z) ≠ 0 := norm_ne_zero_iff.mp (by change ‖z.1+_ • (e:Space n)‖ ≠ 0; linarith) + rw [h.newton_potential_u hn hq hlo0,h.newton_potential_u hn hq hhi0] + unfold endpointAverage + rw [ENNReal.ofReal_mul hnχ,ENNReal.ofReal_div_of_pos (by norm_num), + ENNReal.ofReal_add (h.positive_u _).le (h.positive_u _).le,ENNReal.ofReal_ofNat] + · rw [le_antisymm (not_lt.mp hχ) hnχ] + simp + +lemma IsSolution_pairLeft_recovery {n : ℕ} (hn : 2 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (e : sphere (0:Space n) 1) : + (∫⁻ z, ENNReal.ofReal (spatialPairLeft (source u q B) (source v p A) κ δ e z) + ∂(layerMeasure volume (source u q B)).prod (layerMeasure volume (source v p A))) = + positionIntegral u (source u q B) κ δ e+positionIntegral v (source v p A) κ δ e := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hf := isOpen_source_subgraph h.regular_u h.positive_u q B + have hg := isOpen_source_subgraph h.regular_v h.positive_v p A + have hfM := measurable_source h.continuous_u q B + have hgM := measurable_source h.continuous_v p A + have hm1 : Measurable (fun z : Space n × ℝ => lineWeight volume (source u q B) κ δ (e,z)) := + (measurable_lineWeight volume hf hκ hκ1 δ).comp (measurable_const.prodMk measurable_id) + have hm2 : Measurable (fun z : Space n × ℝ => lineWeight volume (source v p A) κ δ (e,z)) := + (measurable_lineWeight volume hg hκ hκ1 δ).comp (measurable_const.prodMk measurable_id) + unfold spatialPairLeft + simp_rw [ENNReal.ofReal_mul (add_nonneg (lineWeight_nonneg volume _ _ _ _) (lineWeight_nonneg volume _ _ _ _)), + ENNReal.ofReal_add (lineWeight_nonneg volume _ _ _ _) (lineWeight_nonneg volume _ _ _ _)] + rw [lintegral_pair_weight_sum volume hfM hgM (measurable_newtonKernel n).ennreal_ofReal + (fun x y => congrArg ENNReal.ofReal (newtonKernel_symm n x y)) hm1.ennreal_ofReal hm2.ennreal_ofReal] + simp_rw [weighted_potential_position hn h hq κ δ e,weighted_potential_position hn h.swap hp κ δ e] + rfl + +end HenonLaneEmden.SpatialComponents +end +end PairRecovery + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Polar.lean b/lean/OAI/Analysis/HenonEmden/Polar.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ea9490475559573f37efa198d2c69018454175a --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Polar.lean @@ -0,0 +1,108 @@ +import OAI.Analysis.HenonEmden.RadialCalculus + +namespace OAI + +universe uE + +section Polar + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff + +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden.Polar +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] + +omit [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] in +lemma polar_inverse (x : ({0}ᶜ : Set E)) : + (((homeomorphUnitSphereProd E) x).2 : ℝ) • + (((homeomorphUnitSphereProd E) x).1 : E) = x.1 := + congrArg Subtype.val ((homeomorphUnitSphereProd E).symm_apply_apply x) + +lemma integral_polar_prod (f : E → ℝ) : + ∫ x, f x ∂μ = ∫ z : Metric.sphere (0:E) 1 × Ioi (0:ℝ), + f (z.2.1 • z.1.1) ∂μ.toSphere.prod (volumeIoiPow (Module.finrank ℝ E-1)) := by + calc + _ = ∫ x : ({0}ᶜ : Set E), f x.1 ∂μ.comap Subtype.val := by + rw [integral_subtype_comap (measurableSet_singleton _).compl, + restrict_compl_singleton] + _ = _ := by + simpa only [Function.comp_def, homeomorphUnitSphereProd_symm_apply_coe, polar_inverse] using μ.measurePreserving_homeomorphUnitSphereProd.integral_comp + (Homeomorph.measurableEmbedding _) (f ∘ Subtype.val ∘ (homeomorphUnitSphereProd E).symm) + +lemma integrable_polar_prod (f : E → ℝ) : + Integrable f μ ↔ Integrable (fun z : Metric.sphere (0:E) 1 × Ioi (0:ℝ) => + f (z.2.1 • z.1.1)) (μ.toSphere.prod (volumeIoiPow (Module.finrank ℝ E-1))) := by + conv_lhs => rw [← restrict_compl_singleton (μ := μ) 0, ← IntegrableOn, + integrableOn_iff_comap_subtypeVal (by measurability)] + simpa only [Function.comp_def, homeomorphUnitSphereProd_symm_apply_coe, polar_inverse] using μ.measurePreserving_homeomorphUnitSphereProd.integrable_comp_emb + (Homeomorph.measurableEmbedding _) (g := f ∘ Subtype.val ∘ (homeomorphUnitSphereProd E).symm) + +lemma lintegral_polar_prod (f : E → ℝ≥0∞) : + ∫⁻ x, f x ∂μ = ∫⁻ z : Metric.sphere (0:E) 1 × Ioi (0:ℝ), + f (z.2.1 • z.1.1) ∂μ.toSphere.prod (volumeIoiPow (Module.finrank ℝ E-1)) := by + calc + _ = ∫⁻ x : ({0}ᶜ : Set E), f x.1 ∂μ.comap Subtype.val := by + rw [lintegral_subtype_comap (measurableSet_singleton _).compl, + restrict_compl_singleton] + _ = _ := by + simpa only [Function.comp_def, homeomorphUnitSphereProd_symm_apply_coe, polar_inverse] using μ.measurePreserving_homeomorphUnitSphereProd.lintegral_comp_emb + (Homeomorph.measurableEmbedding _) (f ∘ Subtype.val ∘ (homeomorphUnitSphereProd E).symm) + +lemma integral_polar_radius (f : E → ℝ) (hf : Integrable f μ) : + ∫ x, f x ∂μ = ∫ r : Ioi (0:ℝ), + (∫ θ : Metric.sphere (0:E) 1, f (r.1 • θ.1) ∂μ.toSphere) + ∂volumeIoiPow (Module.finrank ℝ E-1) := by + rw [integral_polar_prod] + exact integral_prod_symm _ ((integrable_polar_prod μ f).mp hf) + +lemma lintegral_polar_radius (f : E → ℝ≥0∞) (hf : Measurable f) : + ∫⁻ x, f x ∂μ = ∫⁻ r : Ioi (0:ℝ), + (∫⁻ θ : Metric.sphere (0:E) 1, f (r.1 • θ.1) ∂μ.toSphere) + ∂volumeIoiPow (Module.finrank ℝ E-1) := by + rw [lintegral_polar_prod] + apply lintegral_prod_symm + exact (hf.comp (show Measurable (fun z : Metric.sphere (0:E) 1 × Ioi (0:ℝ) => + z.2.1 • z.1.1) from measurable_snd.subtype_coe.smul measurable_fst.subtype_coe)).aemeasurable + +lemma integral_polar (f : E → ℝ) (hf : Integrable f μ) : + ∫ x, f x ∂μ = ∫ r in Ioi (0:ℝ), r^(Module.finrank ℝ E-1) * + (∫ θ : Metric.sphere (0:E) 1, f (r • θ.1) ∂μ.toSphere) := by + rw [integral_polar_radius μ f hf, volumeIoiPow] + simp only [ENNReal.ofReal] + rw [integral_withDensity_eq_integral_smul] + · rw [integral_subtype_comap measurableSet_Ioi + (fun r : ℝ => Real.toNNReal (r^(Module.finrank ℝ E-1)) • + ∫ θ : Metric.sphere (0:E) 1, f (r • θ.1) ∂μ.toSphere)] + apply setIntegral_congr_fun measurableSet_Ioi + intro r hr + simp [NNReal.smul_def, Real.coe_toNNReal _ (pow_nonneg hr.le _)] + · exact (measurable_subtype_coe.pow_const _).real_toNNReal + +lemma lintegral_polar (f : E → ℝ≥0∞) (hf : Measurable f) : + ∫⁻ x, f x ∂μ = ∫⁻ r in Ioi (0:ℝ), ENNReal.ofReal (r^(Module.finrank ℝ E-1)) * + (∫⁻ θ : Metric.sphere (0:E) 1, f (r • θ.1) ∂μ.toSphere) := by + have hm : Measurable (fun z : Ioi (0:ℝ) × Metric.sphere (0:E) 1 => + f (z.1.1 • z.2.1)) := hf.comp (measurable_fst.subtype_coe.smul + measurable_snd.subtype_coe) + rw [lintegral_polar_radius μ f hf, volumeIoiPow, + lintegral_withDensity_eq_lintegral_mul _ + ((measurable_subtype_coe.pow_const _).ennreal_ofReal) hm.lintegral_prod_right] + exact lintegral_subtype_comap measurableSet_Ioi + (fun r : ℝ => ENNReal.ofReal (r^(Module.finrank ℝ E-1)) * + ∫⁻ θ : Metric.sphere (0:E) 1, f (r • θ.1) ∂μ.toSphere) + +end HenonLaneEmden.Polar + +end +end Polar + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/PotentialContinuity.lean b/lean/OAI/Analysis/HenonEmden/PotentialContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ab08b37f2c8a283c1b128aa1802880fdb0205c6 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/PotentialContinuity.lean @@ -0,0 +1,176 @@ +import OAI.Analysis.HenonEmden.MassGrowth + +namespace OAI + +universe uE + +section PotentialContinuity + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +open Set Filter Topology +open MeasureTheory Set Filter Topology +open scoped ContDiff +noncomputable section + + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] in +lemma rpow_kernel_shift_bound {a r : ℝ} (ha : a ≤ 0) (hr : 0 < r) {x x₀ y : E} + (hx : ‖x-x₀‖ < r/2) (hy : r ≤ ‖x₀-y‖) : + ‖x-y‖^a ≤ (1/2:ℝ)^a*‖x₀-y‖^a := by + have ht := norm_sub_le (x₀-x) (y-x) + simp only [sub_sub_sub_cancel_right, norm_sub_rev y x] at ht + rw [norm_sub_rev x₀ x] at ht + have hp : 0 < ‖x₀-y‖/2 := by linarith + have hl : ‖x₀-y‖/2 ≤ ‖x-y‖ := by linarith + have hh := Real.rpow_le_rpow_of_nonpos hp hl ha + have he : ‖x₀-y‖/2 = (1/2:ℝ)*‖x₀-y‖ := by ring + rwa [he,Real.mul_rpow (by norm_num) (norm_nonneg _)] at hh + +omit [Nontrivial E] in +lemma continuousAt_far_rawPotential (hn : 3 ≤ Module.finrank ℝ E) {g : E → ℝ} + (hg : Measurable g) (hgp : ∀ y, 0 ≤ g y) {x₀ : E} {r : ℝ} (hr : 0 < r) + (hzero : ∀ y ∈ Metric.ball x₀ r, g y = 0) + (hi : Integrable (fun y => ‖x₀-y‖^(2-(Module.finrank ℝ E:ℝ))*g y)) : + ContinuousAt (rawPotential g) x₀ := by + let a := 2-(Module.finrank ℝ E:ℝ) + have ha : a ≤ 0 := by + have hd : (3:ℝ) ≤ Module.finrank ℝ E := by exact_mod_cast hn + dsimp [a]; linarith + apply continuousAt_of_dominated (bound := fun y => (1/2:ℝ)^a*(‖x₀-y‖^a*g y)) + · exact Eventually.of_forall fun x => + (((measurable_const.sub measurable_id).norm.pow_const a).mul hg).aestronglyMeasurable + · filter_upwards [Metric.ball_mem_nhds x₀ (half_pos hr)] with x hx + apply Eventually.of_forall + intro y + by_cases hy : y ∈ Metric.ball x₀ r + · simp [hzero y hy] + · have hyr : r ≤ ‖x₀-y‖ := by + have hy' : ¬ ‖y-x₀‖ < r := by simpa only [Metric.mem_ball,dist_eq_norm] using hy + simpa only [norm_sub_rev] using le_of_not_gt hy' + have hxr : ‖x-x₀‖ < r/2 := by simpa only [Metric.mem_ball,dist_eq_norm] using hx + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (Real.rpow_nonneg (norm_nonneg _) _) (hgp y))] + exact (mul_le_mul_of_nonneg_right (rpow_kernel_shift_bound ha hr hxr hyr) (hgp y)).trans_eq (mul_assoc _ _ _) + · exact hi.const_mul _ + · apply Eventually.of_forall + intro y + by_cases hy : y = x₀ + · subst y + have hg0 := hzero x₀ (Metric.mem_ball_self hr) + simp only [hg0,mul_zero] + exact continuousAt_const + · exact (((continuousAt_id.sub continuousAt_const).norm).rpow_const + (Or.inl (norm_ne_zero_iff.mpr (sub_ne_zero.mpr (Ne.symm hy))))).mul continuousAt_const + +omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] in +lemma continuous_mul_cutoff {g ξ : E → ℝ} {s : Set E} (hs : IsOpen s) + (hg : ContinuousOn g s) (hξ : Continuous ξ) (hξs : tsupport ξ ⊆ s) : + Continuous (fun y => ξ y*g y) := by + apply continuous_iff_continuousAt.mpr + intro x + by_cases hx : x ∈ tsupport ξ + · exact hξ.continuousAt.mul (hg.continuousAt (hs.mem_nhds (hξs hx))) + · apply (continuousAt_const (y := (0:ℝ))).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_mul] + +omit [Nontrivial E] in +lemma rawPotential_integrable_cutoff {g ξ : E → ℝ} (hg : Measurable g) (hgp : ∀ x, 0 ≤ g x) + (hξ : Measurable ξ) (hξp : ∀ x, 0 ≤ ξ x) (hξ1 : ∀ x, ξ x ≤ 1) {x : E} + (hi : Integrable (fun y => ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y)) : + Integrable (fun y => ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*(ξ y*g y)) := by + apply hi.mono' ((((measurable_const.sub measurable_id).norm.pow_const _).mul (hξ.mul hg)).aestronglyMeasurable) + apply Eventually.of_forall + intro y + change ‖‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*(ξ y*g y)‖ ≤ _ + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (Real.rpow_nonneg (norm_nonneg _) _) (mul_nonneg (hξp y) (hgp y)))] + exact mul_le_mul_of_nonneg_left ((mul_le_mul_of_nonneg_right (hξ1 y) (hgp y)).trans_eq (one_mul _)) + (Real.rpow_nonneg (norm_nonneg _) _) + +omit [Nontrivial E] in +lemma continuousOn_rawPotential (hn : 3 ≤ Module.finrank ℝ E) {g : E → ℝ} {s : Set E} + (hg : Measurable g) (hgp : ∀ x, 0 ≤ g x) (hs : IsOpen s) (hgc : ContinuousOn g s) + (hi : ∀ x, Integrable (fun y => ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y)) : + ContinuousOn (rawPotential g) s := by + intro x₀ hx₀ + obtain ⟨r,hr,hrs⟩ := Metric.mem_nhds_iff.mp (hs.mem_nhds hx₀) + let ξ : ContDiffBump x₀ := ⟨r/4,r/2,by linarith,by linarith⟩ + have hξs : tsupport ξ ⊆ s := by + apply Subset.trans (by rw [ξ.tsupport_eq] : tsupport ξ ⊆ Metric.closedBall x₀ ξ.rOut) + intro y hy + apply hrs + have hy' : dist y x₀ ≤ r/2 := hy + change dist y x₀ < r + linarith + let g₀ : E → ℝ := fun y => ξ y*g y + let g₁ : E → ℝ := fun y => (1-ξ y)*g y + have hg₀c : Continuous g₀ := continuous_mul_cutoff hs hgc ξ.continuous hξs + have hg₀k : HasCompactSupport g₀ := ξ.hasCompactSupport.mul_right + have hK : LocallyIntegrable (fun y : E => ‖y‖^(2-(Module.finrank ℝ E:ℝ))) := + locallyIntegrable_norm_power (by omega) _ (by linarith) + have hlocal : Continuous (rawPotential g₀) := by + have hh := hg₀k.continuous_convolution_left (ContinuousLinearMap.lsmul ℝ ℝ) hg₀c hK + convert hh using 1 + ext x + simp only [rawPotential,convolution_def,ContinuousLinearMap.lsmul_apply,smul_eq_mul,mul_comm (g₀ _)] + have hg₁m : Measurable g₁ := (measurable_const.sub ξ.continuous.measurable).mul hg + have hg₁p : ∀ y, 0 ≤ g₁ y := fun y => mul_nonneg (sub_nonneg.mpr (ξ.le_one (x := y))) (hgp y) + have hi₀ (x : E) := rawPotential_integrable_cutoff hg hgp ξ.continuous.measurable + (fun _ => ξ.nonneg) (fun _ => ξ.le_one) (hi x) + have hi₁ (x : E) : Integrable (fun y => ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*((1-ξ y)*g y)) := by + simpa only [Pi.sub_apply] using rawPotential_integrable_cutoff hg hgp + (measurable_const.sub ξ.continuous.measurable) (fun y => sub_nonneg.mpr (ξ.le_one (x := y))) + (fun y => by change 1-ξ y ≤ 1; linarith [ξ.nonneg (x := y)]) (hi x) + have hfar : ContinuousAt (rawPotential g₁) x₀ := by + apply continuousAt_far_rawPotential hn hg₁m hg₁p (r := r/4) (by linarith) ?_ (hi₁ x₀) + intro y hy + have heq : ξ y = 1 := ξ.one_of_mem_closedBall (Metric.ball_subset_closedBall hy) + simp [g₁,heq] + have heq : rawPotential g = fun x => rawPotential g₀ x+rawPotential g₁ x := by + ext x + change (∫ y, ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y) = + (∫ y, ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*(ξ y*g y)) + + (∫ y, ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*((1-ξ y)*g y)) + rw [← integral_add (hi₀ x) (hi₁ x)] + apply integral_congr_ae + apply Eventually.of_forall + intro y + dsimp [g₀,g₁] + ring + rw [heq] + exact (hlocal.continuousAt.add hfar).continuousWithinAt +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden +open WeakPDE +lemma IsSolution.potential_u {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + {x : Space n} (hx : x ≠ 0) : + newtonDenom n*u x = rawPotential (source v p A) x := by + apply Measure.eqOn_open_of_ae_eq (ae_restrict_of_ae (h.potential_u_ae hn hq)) + isOpen_compl_singleton (continuous_const.mul h.continuous_u).continuousOn ?_ hx + apply continuousOn_rawPotential (by simpa using h.dimension_ge_three hn) + (measurable_source h.continuous_v p A) (source_nonneg (fun y => (h.positive_v y).le) p A) + isOpen_compl_singleton + · exact (regular_source h.regular_v h.positive_v p A).continuousOn + · simpa only [finrank_euclideanSpace_fin] using h.kernel_g_integrable hn +end HenonLaneEmden + +end +end PotentialContinuity + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/PressureEstimate.lean b/lean/OAI/Analysis/HenonEmden/PressureEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3f611dc7ee77c0482d67ff88ef8aceef886ca59 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/PressureEstimate.lean @@ -0,0 +1,160 @@ +import OAI.Analysis.HenonEmden.IntegratedPressure + +namespace OAI + +section PressureEstimate + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open Cutoff AdaptiveCap SpatialComponents LayerTonelli Angular + +def pressureGeomCoefficient (n : ℕ) : ℝ := 12*(N n:ℝ)*((n:ℝ)-2) +def pressureSmallCoefficient (n : ℕ) (p q A B κ : ℝ) : ℝ := + 3*sphereMass n*oscillationConstant (volume : Measure (Space n)) κ+ + 6*(N n:ℝ)*(endpointConstant q B+endpointConstant p A) +def pressureHighCoefficient (n : ℕ) (p q A B κ δ : ℝ) : ℝ := + 2*(boundConstant (volume : Measure (Space n)) κ*rayConstant n*sourceBallConstant n p q A B)/δ^n +def pressureConstant (n : ℕ) (p q A B κ δ P : ℝ) : ℝ := + sphereMass n*boundConstant (volume : Measure (Space n)) κ* + (farConstant n p q A B δ+farConstant n q p B A δ)+ + 2*lowLevelConstant n*P*(max (uniformMassConstant n p q A B) 0+max (uniformMassConstant n q p B A) 0) + +lemma pressureGeomCoefficient_nonneg {n : ℕ} (hn : 2 ≤ n) : 0 ≤ pressureGeomCoefficient n := by + have hn' : (2:ℝ) ≤ n := by exact_mod_cast hn + unfold pressureGeomCoefficient + positivity +lemma pressureSmallCoefficient_nonneg (n : ℕ) (p q A B : ℝ) {κ : ℝ} (hκ : 0 ≤ κ) : + 0 ≤ pressureSmallCoefficient n p q A B κ := by + have ho := oscillationConstant_nonneg (volume : Measure (Space n)) hκ + have hs := sphereMass_nonneg n + have heq := endpointConstant_nonneg q B + have hep := endpointConstant_nonneg p A + unfold pressureSmallCoefficient + positivity +lemma pressureHighCoefficient_nonneg (n : ℕ) (p q A B : ℝ) {κ δ : ℝ} (hκ : 0 ≤ κ) (hδ : 0 ≤ δ) : + 0 ≤ pressureHighCoefficient n p q A B κ δ := by + have hb := boundConstant_nonneg (volume : Measure (Space n)) hκ + have hm := sourceBallConstant_nonneg n p q A B + have hr : 0 ≤ rayConstant n := by unfold rayConstant; positivity + unfold pressureHighCoefficient + positivity +lemma pressureConstant_nonneg (n : ℕ) (p q A B : ℝ) {κ δ P : ℝ} (hκ : 0 ≤ κ) (hδ : 0 ≤ δ) (hP : 0 ≤ P) : + 0 ≤ pressureConstant n p q A B κ δ P := by + have hb := boundConstant_nonneg (volume : Measure (Space n)) hκ + have hs := sphereMass_nonneg n + have hf := farConstant_nonneg (n:=n) p q A B hδ + have hg := farConstant_nonneg (n:=n) q p B A hδ + have hl := lowLevelConstant_nonneg n + unfold pressureConstant + positivity + +lemma IsSolution.pressure_estimate {n : ℕ} (hn : 3 ≤ n) {p q A B κ δ P : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 < δ) (hδ1 : δ ≤ 1/4) (hP : 0 < P) : + (q+1)⁻¹*weightedEnergy (w n) u q B+(p+1)⁻¹*weightedEnergy (w n) v p A- + radialPressure (source u q B) (source v p A) ≤ + (pressureGeomCoefficient n*κ+pressureSmallCoefficient n p q A B κ*δ+ + pressureHighCoefficient n p q A B κ δ/P)* + (weightedEnergy (eta n) u q B+weightedEnergy (eta n) v p A)+ + pressureConstant n p q A B κ δ P := by + have hn2 : 2 ≤ n := by omega + let Ef := weightedEnergy (eta n) u q B + let Eg := weightedEnergy (eta n) v p A + let R := radialPressure (source u q B) (source v p A) + let L := lossCoefficient (volume : Measure (Space n)) κ δ (sourceBallConstant n p q A B) P + let Uf := lowLevelConstant n*P*max (uniformMassConstant n p q A B) 0 + let Ug := lowLevelConstant n*P*max (uniformMassConstant n q p B A) 0 + let T := sphereMass n*(oscillationConstant (volume : Measure (Space n)) κ*δ*(Ef+Eg)+ + boundConstant (volume : Measure (Space n)) κ*(farConstant n p q A B δ+farConstant n q p B A δ)) + have hEf : 0 ≤ Ef := weightedEnergyN_nonneg (eta_nonneg n) (fun x => (h.positive_u x).le) + have hEg : 0 ≤ Eg := weightedEnergyN_nonneg (eta_nonneg n) (fun x => (h.positive_v x).le) + have hR : 0 ≤ R := radialPressure_nonneg hn2 _ _ + have hL : 0 ≤ L := lossCoefficient_nonneg volume hκ.le hδ.le (sourceBallConstant_nonneg n p q A B) hP.le + have hUf : 0 ≤ Uf := by dsimp [Uf]; positivity [lowLevelConstant_nonneg n] + have hUg : 0 ≤ Ug := by dsimp [Ug]; positivity [lowLevelConstant_nonneg n] + have hG := pressureGeomCoefficient_nonneg hn2 + have ho := oscillationConstant_nonneg (volume : Measure (Space n)) hκ.le + have hb := boundConstant_nonneg (volume : Measure (Space n)) hκ.le + have hs := sphereMass_nonneg n + have hfC : 0 ≤ farConstant n p q A B δ := farConstant_nonneg p q A B hδ.le + have hgC : 0 ≤ farConstant n q p B A δ := farConstant_nonneg q p B A hδ.le + have hT : 0 ≤ T := by dsimp [T]; positivity + have heq := endpointConstant_nonneg q B + have hep := endpointConstant_nonneg p A + have hNEf := h.weightedEnergyN_eq hn2 (continuous_eta n) (compactSupport_eta n) (eta_nonneg n) + have hNEg := h.swap.weightedEnergyN_eq hn2 (continuous_eta n) (compactSupport_eta n) (eta_nonneg n) + have hDq := weightedEnergyN_d_w_le h.continuous_u (fun x => (h.positive_u x).le) q B + have hDp := weightedEnergyN_d_w_le h.continuous_v (fun x => (h.positive_v x).le) p A + rw [hNEf,← ENNReal.ofReal_mul (by positivity : 0 ≤ 6*(N n:ℝ))] at hDq + rw [hNEg,← ENNReal.ofReal_mul (by positivity : 0 ≤ 6*(N n:ℝ))] at hDp + have hLf := h.angular_loss_bound hn2 hp hq hκ hκ1 hδ (by linarith) hP + have hLg := h.swap.angular_loss_bound hn2 hq hp hκ hκ1 hδ (by linarith) hP + rw [sourceBallConstant_swap] at hLg + have hh := h.integrated_directional_pressure hn hp hq hκ hκ1 hδ.le + have hnq : 0 ≤ 1/(q+1) := by positivity + have hnp : 0 ≤ 1/(p+1) := by positivity + have hWf := weightedEnergyN_nonneg (w_nonneg n) (fun x => (h.positive_u x).le) (q:=q) (B:=B) + have hWg := weightedEnergyN_nonneg (w_nonneg n) (fun x => (h.positive_v x).le) (q:=p) (B:=A) + rw [h.weightedEnergyN_eq hn2 (continuous_w n) (compactSupport_w n) (w_nonneg n), + h.swap.weightedEnergyN_eq hn2 (continuous_w n) (compactSupport_w n) (w_nonneg n), + ← ENNReal.ofReal_mul hnq,← ENNReal.ofReal_mul hnp, + ← ENNReal.ofReal_add (mul_nonneg hnq hWf) (mul_nonneg hnp hWg)] at hh + have htot : ENNReal.ofReal (1/(q+1)*weightedEnergy (w n) u q B+1/(p+1)*weightedEnergy (w n) v p A) ≤ ENNReal.ofReal (R+pressureGeomCoefficient n*κ*Ef)+ENNReal.ofReal T+ + 2*(ENNReal.ofReal (L*Ef+Uf)+ENNReal.ofReal (L*Eg+Ug))+ + (ENNReal.ofReal (endpointConstant q B*δ)*ENNReal.ofReal (6*(N n:ℝ)*Ef)+ + ENNReal.ofReal (endpointConstant p A*δ)*ENNReal.ofReal (6*(N n:ℝ)*Eg)) := by + apply hh.trans + exact add_le_add (add_le_add (add_le_add (h.angular_pressure_bound hn2 hp hq hκ hκ1) + (h.angular_mismatch_bound hn2 hp hq hκ hκ1 hδ hδ1)) + (mul_le_mul le_rfl (add_le_add hLf hLg) bot_le bot_le)) + (add_le_add (mul_le_mul le_rfl hDq bot_le bot_le) (mul_le_mul le_rfl hDp bot_le bot_le)) + have hLF0 : 0 ≤ L*Ef+Uf := by positivity + have hLG0 : 0 ≤ L*Eg+Ug := by positivity + have htwo (x : ℝ) : (2:ℝ≥0∞)*ENNReal.ofReal x=ENNReal.ofReal (2*x) := by + rw [ENNReal.ofReal_mul (by norm_num : (0:ℝ) ≤ 2)] + norm_num + rw [← ENNReal.ofReal_add (add_nonneg hR (by positivity)) hT, + ← ENNReal.ofReal_add hLF0 hLG0, + ← ENNReal.ofReal_mul (mul_nonneg heq hδ.le),← ENNReal.ofReal_mul (mul_nonneg hep hδ.le), + ← ENNReal.ofReal_add (by positivity : 0 ≤ (endpointConstant q B*δ)*(6*(N n:ℝ)*Ef)) + (by positivity : 0 ≤ (endpointConstant p A*δ)*(6*(N n:ℝ)*Eg)), + htwo, + ← ENNReal.ofReal_add (by positivity : 0 ≤ R+pressureGeomCoefficient n*κ*Ef+T) (by positivity), + ← ENNReal.ofReal_add (by positivity) (by positivity)] at htot + have hreal := (ENNReal.ofReal_le_ofReal_iff (by positivity)).mp htot + dsimp only [R,Ef,Eg] at hreal + simp only [one_div] at hreal + have hraw : (q+1)⁻¹*weightedEnergy (w n) u q B+(p+1)⁻¹*weightedEnergy (w n) v p A-R ≤ + pressureGeomCoefficient n*κ*Ef+T+2*(L*Ef+Uf+(L*Eg+Ug))+ + (endpointConstant q B*δ*(6*(N n:ℝ)*Ef)+endpointConstant p A*δ*(6*(N n:ℝ)*Eg)) := by + dsimp only [R,Ef,Eg] + linarith [hreal] + apply hraw.trans + have hGE : pressureGeomCoefficient n*κ*Ef ≤ pressureGeomCoefficient n*κ*(Ef+Eg) := by + nlinarith [mul_nonneg (mul_nonneg hG hκ.le) hEg] + have hEE : endpointConstant q B*δ*(6*(N n:ℝ)*Ef)+endpointConstant p A*δ*(6*(N n:ℝ)*Eg) ≤ + 6*(N n:ℝ)*(endpointConstant q B+endpointConstant p A)*δ*(Ef+Eg) := by + nlinarith [mul_nonneg (mul_nonneg (mul_nonneg heq hδ.le) (by positivity : 0 ≤ 6*(N n:ℝ))) hEg, + mul_nonneg (mul_nonneg (mul_nonneg hep hδ.le) (by positivity : 0 ≤ 6*(N n:ℝ))) hEf] + have halg : + (pressureGeomCoefficient n*κ+pressureSmallCoefficient n p q A B κ*δ+ + pressureHighCoefficient n p q A B κ δ/P)*(Ef+Eg)+pressureConstant n p q A B κ δ P = + pressureGeomCoefficient n*κ*(Ef+Eg)+T+2*(L*Ef+Uf+(L*Eg+Ug))+ + 6*(N n:ℝ)*(endpointConstant q B+endpointConstant p A)*δ*(Ef+Eg) := by + dsimp only [L,T,Uf,Ug,lossCoefficient,pressureSmallCoefficient,pressureHighCoefficient,pressureConstant,sphereMass] + simp only [finrank_euclideanSpace_fin] + ring + change pressureGeomCoefficient n*κ*Ef+T+2*(L*Ef+Uf+(L*Eg+Ug))+ + (endpointConstant q B*δ*(6*(N n:ℝ)*Ef)+endpointConstant p A*δ*(6*(N n:ℝ)*Eg)) ≤ + (pressureGeomCoefficient n*κ+pressureSmallCoefficient n p q A B κ*δ+ + pressureHighCoefficient n p q A B κ δ/P)*(Ef+Eg)+pressureConstant n p q A B κ δ P + rw [halg] + linarith [hGE,hEE] + +end HenonLaneEmden +end +end PressureEstimate + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/PressureMismatch.lean b/lean/OAI/Analysis/HenonEmden/PressureMismatch.lean new file mode 100644 index 0000000000000000000000000000000000000000..1166b3465c64ea0815f2f4ed36cc7860eae0d55a --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/PressureMismatch.lean @@ -0,0 +1,82 @@ +import OAI.Analysis.HenonEmden.PDEPressure + +namespace OAI + +section PressureMismatch + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap LayerTonelli + +lemma weighted_potential_loss {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + (κ δ : ℝ) (e : sphere (0:Space n) 1) (z : Space n × ℝ) : + ENNReal.ofReal (weight volume κ e z.1-lineWeight volume (source u q B) κ δ (e,z))* + potential volume (fun z => ENNReal.ofReal (newtonKernel n z)) (source v p A) z.1 = + ENNReal.ofReal ((weight volume κ e z.1-lineWeight volume (source u q B) κ δ (e,z))*u z.1) := by + have hnχ := sub_nonneg.mpr (lineWeight_le volume (source u q B) κ δ (e,z)) + by_cases hx : z.1 = 0 + · have hh : weight volume κ e z.1 = 0 := weight_inner volume κ e (by simp [hx]) + have hχ : lineWeight volume (source u q B) κ δ (e,z) = 0 := + le_antisymm ((lineWeight_le volume _ _ _ _).trans_eq hh) (lineWeight_nonneg volume _ _ _ _) + simp [hh,hχ] + · rw [h.newton_potential_u hn hq hx,ENNReal.ofReal_mul hnχ] + +lemma IsSolution_pairMismatch_bound {n : ℕ} (hn : 3 ≤ n) {p q A B κ δ : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (e : sphere (0:Space n) 1) : + pairMismatchIntegral (source u q B) (source v p A) κ δ e ≤ + capMismatchIntegral (source u q B) (source v p A) κ e+ + (lossIntegral u (source u q B) κ δ e+lossIntegral v (source v p A) κ δ e) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hf := isOpen_source_subgraph h.regular_u h.positive_u q B + have hg := isOpen_source_subgraph h.regular_v h.positive_v p A + have hfM := measurable_source h.continuous_u q B + have hgM := measurable_source h.continuous_v p A + have hm1 : Measurable (fun z : Space n × ℝ => lineWeight volume (source u q B) κ δ (e,z)) := + (measurable_lineWeight volume hf hκ hκ1 δ).comp (measurable_const.prodMk measurable_id) + have hm2 : Measurable (fun z : Space n × ℝ => lineWeight volume (source v p A) κ δ (e,z)) := + (measurable_lineWeight volume hg hκ hκ1 δ).comp (measurable_const.prodMk measurable_id) + have hh : Measurable (weight volume κ e : Space n → ℝ) := (continuous_weight volume hκ hκ1 e).measurable + let lf (z : Space n × ℝ) := weight volume κ e z.1-lineWeight volume (source u q B) κ δ (e,z) + let lg (z : Space n × ℝ) := weight volume κ e z.1-lineWeight volume (source v p A) κ δ (e,z) + have hlf (z) : 0 ≤ lf z := sub_nonneg.mpr (lineWeight_le volume _ _ _ _) + have hlg (z) : 0 ≤ lg z := sub_nonneg.mpr (lineWeight_le volume _ _ _ _) + have hlfM : Measurable lf := by unfold lf; fun_prop + have hlgM : Measurable lg := by unfold lg; fun_prop + have hpoint (z : (Space n × ℝ) × (Space n × ℝ)) : + ENNReal.ofReal (|lineWeight volume (source u q B) κ δ (e,z.1)-lineWeight volume (source v p A) κ δ (e,z.2)| * + newtonKernel n (z.1.1,z.2.1)) ≤ + ENNReal.ofReal (|weight volume κ e z.1.1-weight volume κ e z.2.1|)*ENNReal.ofReal (newtonKernel n (z.1.1,z.2.1))+ + (ENNReal.ofReal (lf z.1)+ENNReal.ofReal (lg z.2))*ENNReal.ofReal (newtonKernel n (z.1.1,z.2.1)) := by + rw [← add_mul,← ENNReal.ofReal_add (hlf _) (hlg _),← ENNReal.ofReal_add (abs_nonneg _) (add_nonneg (hlf _) (hlg _)), + ← ENNReal.ofReal_mul (add_nonneg (abs_nonneg _) (add_nonneg (hlf _) (hlg _)))] + apply ENNReal.ofReal_le_ofReal + apply mul_le_mul_of_nonneg_right _ (newtonKernel_nonneg hn _) + apply abs_le.mpr + have h1 := le_abs_self (weight volume κ e z.1.1-weight volume κ e z.2.1) + have h2 := neg_le_abs (weight volume κ e z.1.1-weight volume κ e z.2.1) + dsimp [lf,lg] at * + have h3 := lineWeight_le volume (source u q B) κ δ (e,z.1) + have h4 := lineWeight_le volume (source v p A) κ δ (e,z.2) + constructor <;> linarith + calc + _ ≤ ∫⁻ z, ENNReal.ofReal (|weight volume κ e z.1.1-weight volume κ e z.2.1|)*ENNReal.ofReal (newtonKernel n (z.1.1,z.2.1))+ + (ENNReal.ofReal (lf z.1)+ENNReal.ofReal (lg z.2))*ENNReal.ofReal (newtonKernel n (z.1.1,z.2.1)) + ∂(layerMeasure volume (source u q B)).prod (layerMeasure volume (source v p A)) := lintegral_mono hpoint + _ = _ := by + rw [lintegral_add_left (by fun_prop [measurable_newtonKernel]), + lintegral_pair_interaction hfM hgM (F := fun z => ENNReal.ofReal (|weight volume κ e z.1-weight volume κ e z.2|)) (by fun_prop), + lintegral_pair_weight_sum volume hfM hgM (measurable_newtonKernel n).ennreal_ofReal + (fun x y => congrArg ENNReal.ofReal (newtonKernel_symm n x y)) hlfM.ennreal_ofReal hlgM.ennreal_ofReal] + dsimp only [lf,lg] + simp_rw [weighted_potential_loss (by omega) h hq κ δ e,weighted_potential_loss (by omega) h.swap hp κ δ e] + rfl + +end HenonLaneEmden.SpatialComponents +end +end PressureMismatch + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/PressureRecovery.lean b/lean/OAI/Analysis/HenonEmden/PressureRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..5a988f227384c86ba7cd1da1e32362021b8f7323 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/PressureRecovery.lean @@ -0,0 +1,115 @@ +import OAI.Analysis.HenonEmden.LayerAssembly + +namespace OAI + +universe uE uZ + +section PressureRecovery + +open MeasureTheory Set +open scoped ENNReal +namespace HenonLaneEmden.LayerTonelli +variable {E : Type uE} [MeasurableSpace E] + +lemma lintegral_pair_endpoint_right (μ : Measure E) [SFinite μ] {f g : E → ℝ} + {k : E × E → ℝ≥0∞} {b : E × ℝ → ℝ≥0∞} {endpoint : E × ℝ → E} + (hf : Measurable f) (hk : Measurable k) (hs : ∀ x y, k (x,y) = k (y,x)) + (hb : Measurable b) (he : Measurable endpoint) : + ∫⁻ z, b z.2*k (z.1.1,endpoint z.2) ∂(layerMeasure μ f).prod (layerMeasure μ g) = + ∫⁻ z, b z*potential μ k f (endpoint z) ∂layerMeasure μ g := by + rw [← lintegral_prod_swap] + simp only [Prod.swap] + simp_rw [hs _ (endpoint _)] + exact lintegral_pair_endpoint μ hf hk hb he + +lemma lintegral_pair_position_right (μ : Measure E) [SFinite μ] {f g : E → ℝ} + {k : E × E → ℝ≥0∞} {b : E × ℝ → ℝ≥0∞} + (hf : Measurable f) (hk : Measurable k) (hs : ∀ x y, k (x,y) = k (y,x)) + (hb : Measurable b) : + ∫⁻ z, b z.2*k (z.1.1,z.2.1) ∂(layerMeasure μ f).prod (layerMeasure μ g) = + ∫⁻ z, b z*potential μ k f z.1 ∂layerMeasure μ g := + lintegral_pair_endpoint_right μ hf hk hs hb measurable_fst + +lemma lintegral_pair_endpoint_average_right (μ : Measure E) [SFinite μ] {f g : E → ℝ} + {k : E × E → ℝ≥0∞} {b : E × ℝ → ℝ≥0∞} {lo hi : E × ℝ → E} + (hf : Measurable f) (hk : Measurable k) (hs : ∀ x y, k (x,y) = k (y,x)) + (hb : Measurable b) (hlo : Measurable lo) (hhi : Measurable hi) : + ∫⁻ z, b z.2*((k (z.1.1,lo z.2)+k (z.1.1,hi z.2))/2) + ∂(layerMeasure μ f).prod (layerMeasure μ g) = + ∫⁻ z, b z*((potential μ k f (lo z)+potential μ k f (hi z))/2) + ∂layerMeasure μ g := by + rw [← lintegral_prod_swap] + change (∫⁻ z, b z.1*((k (z.2.1,lo z.1)+k (z.2.1,hi z.1))/2) + ∂(layerMeasure μ g).prod (layerMeasure μ f)) = _ + simp_rw [hs _ (lo _),hs _ (hi _)] + exact lintegral_pair_endpoint_average μ hf hk hb hlo hhi + +lemma lintegral_pair_weight_sum (μ : Measure E) [SFinite μ] {f g : E → ℝ} + {k : E × E → ℝ≥0∞} {a b : E × ℝ → ℝ≥0∞} + (hf : Measurable f) (hg : Measurable g) (hk : Measurable k) + (hs : ∀ x y, k (x,y) = k (y,x)) (ha : Measurable a) (hb : Measurable b) : + ∫⁻ z, (a z.1+b z.2)*k (z.1.1,z.2.1) ∂(layerMeasure μ f).prod (layerMeasure μ g) = + (∫⁻ z, a z*potential μ k g z.1 ∂layerMeasure μ f) + + ∫⁻ z, b z*potential μ k f z.1 ∂layerMeasure μ g := by + simp_rw [add_mul] + rw [lintegral_add_left (by fun_prop),lintegral_pair_position μ hg hk ha, + lintegral_pair_position_right μ hf hk hs hb] + +end HenonLaneEmden.LayerTonelli + +namespace HenonLaneEmden.LayerPressure +open LineComponents LayerTonelli IntervalGeometry +variable {Z : Type uZ} [NormedAddCommGroup Z] [MeasurableSpace Z] [BorelSpace Z] + [SecondCountableTopology Z] + +omit [MeasurableSpace Z] [BorelSpace Z] [SecondCountableTopology Z] in +lemma splitKernel_symm (n : ℕ) (C : ℝ) (x y : Z × ℝ) : + splitKernel n C (x,y) = splitKernel n C (y,x) := by + unfold splitKernel kernel + dsimp only + rw [norm_sub_rev x.1 y.1,show (x.2-y.2)^2=(y.2-x.2)^2 by ring] + +omit [MeasurableSpace Z] [BorelSpace Z] [SecondCountableTopology Z] in +lemma splitKernel_nonneg (n : ℕ) {C : ℝ} (hC : 0 ≤ C) (z : (Z × ℝ) × (Z × ℝ)) : + 0 ≤ splitKernel n C z := kernel_nonneg n hC _ + +lemma pairLeft_recovery (μ : Measure Z) [SFinite μ] (n : ℕ) (C : ℝ) + {f g h d : Z × ℝ → ℝ} (hf : Measurable f) (hg : Measurable g) + (hfo : IsOpen (parameterLayer f)) (hgo : IsOpen (parameterLayer g)) + (hh : Continuous h) (hd : Continuous d) (δ : ℝ) : + (∫⁻ z, ENNReal.ofReal (pairLeft n C f g h d δ z) + ∂(layerMeasure (μ.prod volume) f).prod (layerMeasure (μ.prod volume) g)) = + (∫⁻ z, ENNReal.ofReal (sourceWeight f h d δ z)* + potential (μ.prod volume) (fun p => ENNReal.ofReal (splitKernel n C p)) g z.1 + ∂layerMeasure (μ.prod volume) f) + + ∫⁻ z, ENNReal.ofReal (sourceWeight g h d δ z)* + potential (μ.prod volume) (fun p => ENNReal.ofReal (splitKernel n C p)) f z.1 + ∂layerMeasure (μ.prod volume) g := by + have he (z : ((Z × ℝ) × ℝ) × ((Z × ℝ) × ℝ)) : + ENNReal.ofReal (pairLeft n C f g h d δ z) = + (ENNReal.ofReal (sourceWeight f h d δ z.1)+ENNReal.ofReal (sourceWeight g h d δ z.2))* + ENNReal.ofReal (splitKernel n C (z.1.1,z.2.1)) := by + rw [pairLeft,ENNReal.ofReal_mul (add_nonneg (sourceWeight_nonneg _ _ _ _ _) (sourceWeight_nonneg _ _ _ _ _)), + ENNReal.ofReal_add (sourceWeight_nonneg _ _ _ _ _) (sourceWeight_nonneg _ _ _ _ _)] + simp_rw [he] + exact lintegral_pair_weight_sum (μ.prod volume) hf hg (measurable_splitKernel n C).ennreal_ofReal + (fun x y => congrArg ENNReal.ofReal (splitKernel_symm n C x y)) + (measurable_sourceWeight hfo hh hd δ).ennreal_ofReal + (measurable_sourceWeight hgo hh hd δ).ennreal_ofReal + +/-- Finite cancellation is used only after the endpoint contributions have +been proved finite. -/ +lemma pressure_cancellation {U V R P M Q L T : ℝ≥0∞} (hV : V ≠ ⊤) + (hcomp : U ≤ V+P+M) (hrec : R+V ≤ U+L+T) (hmis : M ≤ Q+L) : + R ≤ P+Q+2*L+T := by + apply (ENNReal.add_le_add_iff_right hV).mp + calc + R+V ≤ U+L+T := hrec + _ ≤ (V+P+M)+L+T := by gcongr + _ ≤ (V+P+(Q+L))+L+T := by gcongr + _ = (P+Q+2*L+T)+V := by ring + +end HenonLaneEmden.LayerPressure +end PressureRecovery + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/ProductBounds.lean b/lean/OAI/Analysis/HenonEmden/ProductBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..d8cca1e41555d37a151c5251372464213e51a07f --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/ProductBounds.lean @@ -0,0 +1,142 @@ +import OAI.Analysis.HenonEmden.SourceMass + +namespace OAI + +section ProductBounds + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +open Set Filter Topology +open MeasureTheory Set Filter Topology +open scoped ContDiff +noncomputable section + + +namespace HenonLaneEmden +lemma coupled_power_lower {U V c d R a b p q : ℝ} + (hU : 0 < U) (_hV : 0 < V) (hc : 0 < c) (hd : 0 < d) (hR : 0 < R) + (hp : 0 < p) (h1 : c*R^a*V^p ≤ U) (h2 : d*R^b*U^q ≤ V) : + c*d^p*R^(a+p*b) ≤ U^(1-p*q) := by + have hh := Real.rpow_le_rpow (by positivity : 0 ≤ d*R^b*U^q) h2 hp.le + have hh' := (mul_le_mul_of_nonneg_left hh (mul_nonneg hc.le (Real.rpow_nonneg hR.le a))).trans h1 + have he : c*R^a*(d*R^b*U^q)^p = c*d^p*R^(a+p*b)*U^(p*q) := by + rw [Real.mul_rpow (by positivity) (Real.rpow_nonneg hU.le q), + Real.mul_rpow hd.le (Real.rpow_nonneg hR.le b), + ← Real.rpow_mul hR.le,← Real.rpow_mul hU.le,Real.rpow_add hR] + simp only [mul_comm b p,mul_comm q p] + ring + rw [he] at hh' + rw [Real.rpow_sub hU,Real.rpow_one] + exact (le_div_iff₀ (Real.rpow_pos_of_pos hU (p*q))).mpr hh' + +lemma no_small_product_coupled {U V : ℝ → ℝ} {c d a b p q M : ℝ} + (hc : 0 < c) (hd : 0 < d) (ha : 0 < a) (hb : 0 < b) (hp : 0 < p) + (hU : ∀ R > 0, 0 < U R) (hV : ∀ R > 0, 0 < V R) + (h1 : ∀ R > 0, c*R^a*(V R)^p ≤ U R) + (h2 : ∀ R > 0, d*R^b*(U R)^q ≤ V R) + (hbound : ∀ R > 0, U R ≤ M) : 1 < p*q := by + by_contra hh + have hpq : p*q ≤ 1 := le_of_not_gt hh + have hK : 0 < c*d^p := mul_pos hc (Real.rpow_pos_of_pos hd p) + have hB : ∀ R > 0, c*d^p*R^(a+p*b) ≤ M^(1-p*q) := by + intro R hR + exact (coupled_power_lower (hU R hR) (hV R hR) hc hd hR hp (h1 R hR) (h2 R hR)).trans + (Real.rpow_le_rpow (hU R hR).le (hbound R hR) (by linarith)) + have ht : Tendsto (fun R : ℝ => c*d^p*R^(a+p*b)) atTop atTop := + (tendsto_rpow_atTop (add_pos ha (mul_pos hp hb))).const_mul_atTop hK + obtain ⟨R,hR,hgt⟩ := ((eventually_gt_atTop (0:ℝ)).and + (ht.eventually (eventually_gt_atTop (M^(1-p*q))))).exists + exact (not_lt_of_ge (hB R hR)) hgt + +lemma coupled_upper_one {U V c d p q : ℝ} + (hU : 0 < U) (hV : 0 < V) (hc : 0 < c) (hd : 0 < d) + (hp : 0 < p) (hpq : 1 < p*q) (h1 : c*V^p ≤ U) (h2 : d*U^q ≤ V) : + U ≤ (c*d^p)^(1/(1-p*q)) := by + have hh := coupled_power_lower (a := 0) (b := 0) (R := 1) hU hV hc hd zero_lt_one hp + (by simpa using h1) (by simpa using h2) + simp only [Real.one_rpow,mul_one] at hh + have hK : 0 < c*d^p := mul_pos hc (Real.rpow_pos_of_pos hd p) + simpa only [one_div] using (Real.le_rpow_inv_iff_of_neg hU hK (show 1-p*q < 0 by linarith)).mpr hh +end HenonLaneEmden + +namespace HenonLaneEmden +open WeakPDE +lemma IsSolution.product_gt_one {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : 1 < p*q := by + have hn3 := h.dimension_ge_three hn + have hA := h.first_weight_gt_neg_two hn + have hB := h.swap.first_weight_gt_neg_two hn + apply no_small_product_coupled (U := lowerMass v p A) (V := lowerMass u q B) + (M := u 0) (mul_pos (ballConstant_pos hn3) (weightMass_pos hn3 hA)) + (mul_pos (ballConstant_pos hn3) (weightMass_pos hn3 hB)) + (show 0 < 2+A by linarith) (show 0 < 2+B by linarith) hp + (fun _ hR => h.lowerMass_g_pos hn hR) (fun _ hR => h.swap.lowerMass_g_pos hn hR) + (fun _ hR => h.lowerMass_g_coupling hn hp hR) + · exact fun R hR => h.swap.lowerMass_g_coupling hn hq hR + · intro R hR + exact h.lowerMass_g_le hn hR (by simpa using hR.le) +end HenonLaneEmden + +namespace HenonLaneEmden +open WeakPDE +lemma IsSolution.no_positive_lower_bound_u {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) + {M : ℝ} (hM : 0 < M) (hbound : ∀ x, M ≤ u x) : False := by + have hn3 := h.dimension_ge_three hn + have hB := h.swap.first_weight_gt_neg_two hn + have hc := ballConstant_pos hn3 + have hw := weightMass_pos hn3 hB + have hb (R : ℝ) (hR : 0 < R) : + ballConstant n*weightMass n B*M^q*R^(2+B) ≤ v 0 := by + have hh := integral_source_ge_lower hn3 h.continuous_u h.positive_u hq.le hB hR hM.le + (fun x _ => hbound x) + have hh' := mul_le_mul_of_nonneg_left hh + (mul_nonneg hc.le (Real.rpow_nonneg hR.le (2-(n:ℝ)))) + have he : R^(2+B) = R^(2-(n:ℝ))*R^((n:ℝ)+B) := by + rw [← Real.rpow_add hR]; congr 1; ring + have hl : ballConstant n*weightMass n B*M^q*R^(2+B) ≤ lowerMass u q B R := by + rw [lowerMass_eq _ _ _ hR,he] + nlinarith only [hh'] + exact hl.trans (h.swap.lowerMass_g_le hn hR (by simpa using hR.le)) + have ht : Tendsto (fun R : ℝ => ballConstant n*weightMass n B*M^q*R^(2+B)) atTop atTop := + (tendsto_rpow_atTop (show 0 < 2+B by linarith)).const_mul_atTop + (mul_pos (mul_pos hc hw) (Real.rpow_pos_of_pos hM q)) + obtain ⟨R,hR,hgt⟩ := ((eventually_gt_atTop (0:ℝ)).and + (ht.eventually (eventually_gt_atTop (v 0)))).exists + exact (not_lt_of_ge (hb R hR)) hgt + +lemma IsSolution.potential_u_ae {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) : + ∀ᵐ x, newtonDenom n*u x = rawPotential (source v p A) x := by + obtain ⟨c,hc,hceq⟩ := h.potential_constant_u hn + have hc0 : c = 0 := by + by_contra hh + have hcp : 0 < c := lt_of_le_of_ne hc (Ne.symm hh) + have hD := newtonDenom_pos (h.dimension_ge_three hn) + have hb : ∀ᵐ x, c/newtonDenom n ≤ u x := by + filter_upwards [hceq] with x hx + apply (div_le_iff₀ hD).mpr + have hp := rawPotential_nonneg (source_nonneg (fun y => (h.positive_v y).le) p A) x + nlinarith only [hx,hp] + have heq : (fun x => max (c/newtonDenom n) (u x)) = u := + Measure.eq_of_ae_eq (hb.mono fun _ hx => max_eq_right hx) + (continuous_const.max h.continuous_u) h.continuous_u + exact h.no_positive_lower_bound_u hn hq (div_pos hcp hD) + (fun x => max_eq_right_iff.mp (congrFun heq x)) + simpa only [hc0,add_zero] using hceq +end HenonLaneEmden + +end +end ProductBounds + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RadialCalculus.lean b/lean/OAI/Analysis/HenonEmden/RadialCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c0c43c9e36f4e92b0e653b927464565197bc666 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RadialCalculus.lean @@ -0,0 +1,171 @@ +import OAI.Analysis.HenonEmden.WeakForm + +namespace OAI + +universe uE uE2 uE3 + +section RadialCalculus + +open Set Filter Topology MeasureTheory +open scoped ContDiff + +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +namespace HenonLaneEmden.RadialCalculus +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +lemma hasFDerivAt_profile_norm_sq {h : ℝ → ℝ} {h' : ℝ} {x : E} + (hh : HasDerivAt h h' (‖x‖^2)) : + HasFDerivAt (fun y : E => h (‖y‖^2)) ((2*h') • innerSL ℝ x) x := by + have hc : HasFDerivAt (fun y : E => h (‖y‖^2)) + (h' • (2 • innerSL ℝ x)) x := + hh.comp_hasFDerivAt x (hasStrictFDerivAt_norm_sq x).hasFDerivAt + have heq : h' • (2 • innerSL ℝ x) = (2*h') • innerSL ℝ x := by + ext v + simp only [smul_apply, smul_eq_mul] + ring + rw [heq] at hc + exact hc + +lemma fderiv_profile_norm_sq {h : ℝ → ℝ} {h' : ℝ → ℝ} + (hh : ∀ r, HasDerivAt h (h' r) r) : + fderiv ℝ (fun x : E => h (‖x‖^2)) = fun x => (2*h' (‖x‖^2)) • innerSL ℝ x := by + funext x + exact (hasFDerivAt_profile_norm_sq (x := x) (hh _)).fderiv + +lemma second_profile_norm_sq {h h' : ℝ → ℝ} {h'' : ℝ} {x : E} + (hh : ∀ r, HasDerivAt h (h' r) r) (hh' : HasDerivAt h' h'' (‖x‖^2)) (e : E) : + iteratedFDeriv ℝ 2 (fun y : E => h (‖y‖^2)) x ![e,e] = + 4*h''*⟪x,e⟫^2+2*h' (‖x‖^2)*‖e‖^2 := by + rw [← bilinearIteratedFDerivTwo_eq_iteratedFDeriv] + unfold bilinearIteratedFDerivTwo + rw [fderiv_profile_norm_sq hh] + have hd := ((hasFDerivAt_profile_norm_sq hh').const_mul 2).smul + (innerSL ℝ (E := E)).hasFDerivAt + change HasFDerivAt (fun y : E => (2*h' (‖y‖^2)) • innerSL ℝ y) _ x at hd + rw [hd.fderiv] + simp [ContinuousLinearMap.smulRight_apply] + change 2*h' (‖x‖^2)*⟪e,e⟫ + (2*(2*h''*⟪x,e⟫))*⟪x,e⟫ = _ + rw [real_inner_self_eq_norm_sq] + ring + +variable [FiniteDimensional ℝ E] +lemma laplacian_profile_norm_sq {h h' : ℝ → ℝ} {h'' : ℝ} (x : E) + (hh : ∀ r, HasDerivAt h (h' r) r) (hh' : HasDerivAt h' h'' (‖x‖^2)) : + Laplacian.laplacian (fun y : E => h (‖y‖^2)) x = + 4*‖x‖^2*h''+2*(Module.finrank ℝ E : ℝ)*h' (‖x‖^2) := by + rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis] + simp_rw [second_profile_norm_sq hh hh', (stdOrthonormalBasis ℝ E).norm_eq_one, one_pow, + mul_one, Finset.sum_add_distrib, ← Finset.mul_sum] + have hsum : (∑ i, ⟪x,stdOrthonormalBasis ℝ E i⟫^2) = ‖x‖^2 := by + simpa only [Real.norm_eq_abs, sq_abs] using (stdOrthonormalBasis ℝ E).sum_sq_norm_inner_left x + rw [hsum] + simp + ring + +end HenonLaneEmden.RadialCalculus + +namespace HenonLaneEmden.RadialCalculus +variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +lemma hasFDerivAt_norm_real {x : E} (hx : x ≠ 0) : + HasFDerivAt (fun y : E => ‖y‖) (‖x‖⁻¹ • innerSL ℝ x) x := by + have hd := (hasStrictFDerivAt_norm_sq x).hasFDerivAt.sqrt (pow_ne_zero 2 (norm_ne_zero_iff.mpr hx)) + simp only [Real.sqrt_sq (norm_nonneg _)] at hd + refine hd.congr_fderiv ?_ + ext v + simp only [smul_apply, smul_eq_mul] + field_simp + ring + +lemma hasFDerivAt_profile_norm {h : ℝ → ℝ} {h' : ℝ} {x : E} + (hx : x ≠ 0) (hh : HasDerivAt h h' ‖x‖) : + HasFDerivAt (fun y : E => h ‖y‖) ((h'/‖x‖) • innerSL ℝ x) x := by + have hd := hh.comp_hasFDerivAt x (hasFDerivAt_norm_real hx) + convert! hd using 1 + ext v + simp only [smul_apply, smul_eq_mul] + ring + +lemma second_profile_norm {h h' : ℝ → ℝ} {h'' : ℝ} {x : E} + (hx : x ≠ 0) (hh : ∀ r > 0, HasDerivAt h (h' r) r) + (hh' : HasDerivAt h' h'' ‖x‖) (e : E) : + iteratedFDeriv ℝ 2 (fun y : E => h ‖y‖) x ![e,e] = + ((h''*‖x‖-h' ‖x‖)/‖x‖^3)*⟪x,e⟫^2+(h' ‖x‖/‖x‖)*‖e‖^2 := by + have hr : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx + have heq : fderiv ℝ (fun y : E => h ‖y‖) =ᶠ[𝓝 x] + (fun y => (h' ‖y‖ / ‖y‖) • innerSL ℝ y) := by + filter_upwards [isOpen_compl_singleton.mem_nhds hx] with y hy + exact (hasFDerivAt_profile_norm hy (hh _ (norm_pos_iff.mpr hy))).fderiv + have hc := hasFDerivAt_profile_norm hx (hh'.div (hasDerivAt_id _) hr) + have hd := hc.smul (innerSL ℝ (E := E)).hasFDerivAt + change HasFDerivAt (fun y : E => (h' ‖y‖ / ‖y‖) • innerSL ℝ y) _ x at hd + rw [← bilinearIteratedFDerivTwo_eq_iteratedFDeriv] + unfold bilinearIteratedFDerivTwo + rw [heq.fderiv_eq, hd.fderiv] + simp [ContinuousLinearMap.smulRight_apply] + change h' ‖x‖ / ‖x‖ * ⟪e,e⟫ + + ((h''*‖x‖-h' ‖x‖)/‖x‖^2/‖x‖*⟪x,e⟫)*⟪x,e⟫ = _ + rw [real_inner_self_eq_norm_sq] + field_simp + ring + +variable [FiniteDimensional ℝ E] +lemma laplacian_profile_norm {h h' : ℝ → ℝ} {h'' : ℝ} {x : E} + (hx : x ≠ 0) (hh : ∀ r > 0, HasDerivAt h (h' r) r) + (hh' : HasDerivAt h' h'' ‖x‖) : + Laplacian.laplacian (fun y : E => h ‖y‖) x = + h''+((Module.finrank ℝ E:ℝ)-1)/‖x‖*h' ‖x‖ := by + rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis] + simp_rw [second_profile_norm hx hh hh', (stdOrthonormalBasis ℝ E).norm_eq_one, + one_pow, mul_one, Finset.sum_add_distrib, ← Finset.mul_sum] + have hsum : (∑ i, ⟪x,stdOrthonormalBasis ℝ E i⟫^2) = ‖x‖^2 := by + simpa only [Real.norm_eq_abs, sq_abs] using (stdOrthonormalBasis ℝ E).sum_sq_norm_inner_left x + rw [hsum] + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + field_simp [norm_ne_zero_iff.mpr hx] + ring + +end HenonLaneEmden.RadialCalculus +open Set Filter Topology +open scoped ContDiff +namespace HenonLaneEmden.RadialCalculus +variable {E : Type uE3} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +omit [InnerProductSpace ℝ E] in +lemma radial_tsupport {h : ℝ → ℝ} : + tsupport (fun x : E => h ‖x‖) ⊆ (fun x : E => ‖x‖) ⁻¹' tsupport h := + tsupport_comp_subset_preimage h continuous_norm + +omit [InnerProductSpace ℝ E] in +lemma radial_tsupport_off_origin {h : ℝ → ℝ} (hs : tsupport h ⊆ Ioi 0) : + tsupport (fun x : E => h ‖x‖) ⊆ ({0}ᶜ : Set E) := by + intro x hx + have hpos := hs (radial_tsupport hx) + exact norm_pos_iff.mp hpos + +lemma radial_contDiff {h : ℝ → ℝ} {k : ℕ∞ω} + (hh : ContDiff ℝ k h) (hs : tsupport h ⊆ Ioi 0) : + ContDiff ℝ k (fun x : E => h ‖x‖) := by + rw [contDiff_iff_contDiffAt] + intro x + by_cases hx : x = 0 + · have hn : x ∉ tsupport (fun y : E => h ‖y‖) := by + intro hy + exact radial_tsupport_off_origin hs hy hx + exact contDiffAt_const.congr_of_eventuallyEq (notMem_tsupport_iff_eventuallyEq.mp hn) + · exact hh.contDiffAt.comp x (contDiffAt_norm ℝ hx) + +variable [FiniteDimensional ℝ E] +lemma radial_compactSupport {h : ℝ → ℝ} (hh : HasCompactSupport h) : + HasCompactSupport (fun x : E => h ‖x‖) := by + obtain ⟨R,hR⟩ := hh.isBounded.exists_norm_le + apply (isCompact_closedBall (0:E) R).of_isClosed_subset (isClosed_tsupport _) + intro x hx + simpa [Metric.mem_closedBall, dist_zero_right] using hR ‖x‖ (radial_tsupport hx) + +end HenonLaneEmden.RadialCalculus + +end RadialCalculus + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RadialGeometry.lean b/lean/OAI/Analysis/HenonEmden/RadialGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec82a460d3e452067e954582947e750f678404b8 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RadialGeometry.lean @@ -0,0 +1,81 @@ +import OAI.Analysis.HenonEmden.CutoffTaylor + +namespace OAI + +universe uE uE2 uE3 uE4 uE5 + +section RadialGeometry + +open MeasureTheory Set Metric NormedSpace +open scoped ENNReal InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open Cutoff AdaptiveCap CapWeights + +def radialFactor {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (z : E × E) : ℝ := + (inner ℝ z.1 (z.1-z.2))^2/(‖z.1‖^2*‖z.1-z.2‖^2) + +def fluxFactor {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (n : ℕ) (z : E × E) : ℝ := + inner ℝ (z.1-z.2) (X n z.1-X n z.2)/‖z.1-z.2‖^2 + +lemma radialFactor_eq {E : Type uE3} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + {x : E} (hx : x ≠ 0) (y : E) : + radialFactor (x,y)=directionalFactor (direction x hx) (x,y) := by + simp only [radialFactor,directionalFactor,direction,NormedSpace.normalize,real_inner_smul_left,mul_pow, + div_eq_mul_inv,mul_inv_rev,inv_pow] + ring + +lemma radialFactor_bounds {E : Type uE4} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (z : E × E) : + 0 ≤ radialFactor z ∧ radialFactor z ≤ 1 := by + by_cases hx : z.1 = 0 + · simp [radialFactor,hx] + · rw [radialFactor_eq hx] + exact directionalFactor_bounds _ _ + +lemma directionalFactor_oscillation {E : Type uE5} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (e ω : sphere (0:E) 1) (z : E × E) : + |directionalFactor e z-directionalFactor ω z| ≤ 2*dist e ω := by + have he := abs_real_inner_le_norm (e:E) (z.1-z.2) + have hω := abs_real_inner_le_norm (ω:E) (z.1-z.2) + simp only [LineCoordinates.norm_unit,one_mul] at he hω + have hdiff : |inner ℝ (e:E) (z.1-z.2)-inner ℝ (ω:E) (z.1-z.2)| ≤ dist e ω*‖z.1-z.2‖ := by + rw [← inner_sub_left] + exact (abs_real_inner_le_norm ((e:E)-(ω:E)) (z.1-z.2)).trans_eq (by rw [Subtype.dist_eq,dist_eq_norm]) + have hsum : |inner ℝ (e:E) (z.1-z.2)+inner ℝ (ω:E) (z.1-z.2)| ≤ 2*‖z.1-z.2‖ := + (abs_add_le _ _).trans (by linarith) + by_cases hz : z.1-z.2=0 + · simp only [directionalFactor,hz,inner_zero_right,norm_zero,zero_pow (by omega : 2 ≠ 0),zero_div,sub_zero,abs_zero] + positivity + have hs : 0 < ‖z.1-z.2‖^2 := sq_pos_of_pos (norm_pos_iff.mpr hz) + unfold directionalFactor + rw [← sub_div,abs_div,abs_of_pos hs,div_le_iff₀ hs] + calc + _ = |inner ℝ (e:E) (z.1-z.2)-inner ℝ (ω:E) (z.1-z.2)| * + |inner ℝ (e:E) (z.1-z.2)+inner ℝ (ω:E) (z.1-z.2)| := by rw [← abs_mul]; congr 1; ring + _ ≤ (dist e ω*‖z.1-z.2‖)*(2*‖z.1-z.2‖) := mul_le_mul hdiff hsum (abs_nonneg _) (by positivity) + _ = _ := by ring + +lemma weight_directional_bound {n : ℕ} (_hn : 1 ≤ n) {κ : ℝ} (hκ : 0 < κ) + (e : sphere (0:Space n) 1) (x y : Space n) : + weight volume κ e x*directionalFactor e (x,y) ≤ + weight volume κ e x*(radialFactor (x,y)+2*κ*d x) := by + by_cases hw : weight volume κ e x=0 + · rw [hw,zero_mul,zero_mul] + have hx : x ≠ 0 ∧ 0 < d x := by + by_contra hh + exact hw (by simp [weight,dite_eq_right hh]) + have he : e ∈ ball (direction x hx.1) (κ*d x) := by + by_contra hh + have hzero := profile_eq_zero (mul_pos hκ hx.2) hh + exact hw (by simp only [weight,dite_eq_left hx,normalized,hzero,zero_div,mul_zero]) + rw [radialFactor_eq hx.1] + apply mul_le_mul_of_nonneg_left _ (weight_nonneg volume κ e x) + have hb := (directionalFactor_oscillation e (direction x hx.1) (x,y)).trans + (mul_le_mul_of_nonneg_left (mem_ball.mp he).le (by norm_num : (0:ℝ) ≤ 2)) + linarith [(abs_le.mp hb).2] + +end HenonLaneEmden +end +end RadialGeometry + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RadialGradient.lean b/lean/OAI/Analysis/HenonEmden/RadialGradient.lean new file mode 100644 index 0000000000000000000000000000000000000000..63581640917010f3c0bcfb32a888fe8508483020 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RadialGradient.lean @@ -0,0 +1,76 @@ +import OAI.Analysis.HenonEmden.RadialKernel + +namespace OAI + +section RadialGradient + +open MeasureTheory Set Filter Topology Metric +open scoped ENNReal InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open WeakPDE + +lemma IsSolution.radial_kernel_absolute_bounded {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ x : Space n, x ≠ 0 → ‖x‖ ≤ 2 → + (∫ y, |kernelDir x (x-y)*source v p A y|) ≤ C := by + have hn3 := h.dimension_ge_three hn + have hd := (newtonDenom_pos hn3).le + have hn1 : 1 ≤ Module.finrank ℝ (Space n) := by simp; omega + have hA := h.first_weight_gt_neg_two hn + obtain ⟨M,hM,hnear⟩ := source_near_radial_bound h.continuous_v h.positive_v hp A + obtain ⟨U,hU⟩ := (isCompact_closedBall (0:Space n) 2).exists_bound_of_continuousOn h.continuous_u.continuousOn + let J : ℝ := ∫ z : Space n in ball 0 1, ‖z‖^(1-(n:ℝ)) + have hJ : 0 ≤ J := integral_nonneg (fun _ => Real.rpow_nonneg (norm_nonneg _) _) + let C : ℝ := |2-(n:ℝ)| *M*2^(A+2)*J+2*|2-(n:ℝ)| *newtonDenom n*max U 0 + refine ⟨C,by dsimp [C]; positivity,?_⟩ + intro x hx hx2 + have hr := norm_pos_iff.mpr hx + let H : Space n → ℝ := (ball x (‖x‖/2)).indicator (fun y => ‖x-y‖^(1-(n:ℝ))) + have hiH : Integrable H := integrable_shifted_power_ball hn1 (by simp only [finrank_euclideanSpace_fin]; linarith) _ _ + have hH (y : Space n) : 0 ≤ H y := indicator_nonneg (fun y _ => Real.rpow_nonneg (norm_nonneg _) _) y + have hS (y : Space n) := source_nonneg (fun y => (h.positive_v y).le) p A y + have hdom (y : Space n) : |kernelDir x (x-y)*source v p A y| ≤ + (|2-(n:ℝ)| *‖x‖*(M*‖x‖^A))*H y+ + (2*|2-(n:ℝ)|)*(‖x-y‖^(2-(n:ℝ))*source v p A y) := by + rw [abs_mul,abs_of_nonneg (hS y)] + by_cases hy : ‖x-y‖ < ‖x‖/2 + · have hy' : y ∈ ball x (‖x‖/2) := by simpa only [mem_ball,dist_eq_norm,norm_sub_rev] using hy + have hk := kernelDir_bound x (x-y) + simp only [finrank_euclideanSpace_fin] at hk + have hh := mul_le_mul hk (hnear x hr hx2 y hy) (hS y) (by positivity) + rw [show H y=‖x-y‖^(1-(n:ℝ)) from indicator_of_mem hy' _] + nlinarith [mul_nonneg (by positivity : 0 ≤ 2*|2-(n:ℝ)|) (mul_nonneg (Real.rpow_nonneg (norm_nonneg (x-y)) (2-(n:ℝ))) (hS y))] + · have hk := mul_le_mul_of_nonneg_right (radial_kernel_far_bound hr (le_of_not_gt hy)) (hS y) + have hzero : H y=0 := indicator_of_notMem (by simpa only [mem_ball,dist_eq_norm,norm_sub_rev] using hy) _ + rw [hzero,mul_zero,zero_add] + simpa only [mul_assoc] using hk + have hi := (h.gradient_u hn hq hx x).1.norm + simp only [Real.norm_eq_abs] at hi + have hh := integral_mono hi ((hiH.const_mul _).add ((h.kernel_g_integrable hn x).const_mul _)) hdom + simp only [Pi.add_apply] at hh + rw [integral_add (hiH.const_mul _) ((h.kernel_g_integrable hn x).const_mul _),integral_const_mul,integral_const_mul] at hh + have heH : (∫ y, H y) = ‖x‖/2*J := by + simpa only [finrank_euclideanSpace_fin,show (n:ℝ)+(1-(n:ℝ))=1 by ring,Real.rpow_one] using + integral_shifted_power_ball (1-(n:ℝ)) (half_pos hr) x + have heP : (∫ y, ‖x-y‖^(2-(n:ℝ))*source v p A y) = newtonDenom n*u x := by + simpa only [rawPotential,finrank_euclideanSpace_fin] using (h.potential_u hn hq hx).symm + rw [heH,heP] at hh + have hpower : ‖x‖*‖x‖^A*‖x‖ = ‖x‖^(A+2) := by + rw [show A+2=A+1+1 by ring,Real.rpow_add hr,Real.rpow_add hr,Real.rpow_one] + ring + have hpowle : ‖x‖^(A+2) ≤ (2:ℝ)^(A+2) := Real.rpow_le_rpow hr.le hx2 (by linarith) + have huU : u x ≤ max U 0 := (le_abs_self _).trans ((hU x (mem_closedBall_zero_iff.mpr hx2)).trans (le_max_left _ _)) + have hbound1 := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hpowle (mul_nonneg (abs_nonneg (2-(n:ℝ))) hM)) hJ + have hbound2 := mul_le_mul_of_nonneg_left huU (by positivity : 0 ≤ 2*|2-(n:ℝ)| *newtonDenom n) + have hrw : (|2-(n:ℝ)| *‖x‖*(M*‖x‖^A))*(‖x‖/2*J) = (|2-(n:ℝ)| *M*‖x‖^(A+2)*J)/2 := by + rw [← hpower]; ring + rw [hrw] at hh + dsimp [C] + nlinarith [mul_nonneg (mul_nonneg (mul_nonneg (abs_nonneg (2-(n:ℝ))) hM) (Real.rpow_nonneg (norm_nonneg x) (A+2))) hJ] + +end HenonLaneEmden +end +end RadialGradient + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RadialIntegration.lean b/lean/OAI/Analysis/HenonEmden/RadialIntegration.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e42d760eb7aea96255e8717d16c8fa370b7ceeb --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RadialIntegration.lean @@ -0,0 +1,76 @@ +import OAI.Analysis.HenonEmden.VirialCalculus + +namespace OAI + +section RadialIntegration + +open MeasureTheory Set Filter Topology Metric +open scoped InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open WeakPDE + +lemma sum_inner_mul_dir {n : ℕ} (F : Space n → ℝ) (x : Space n) : + ∑ i : Fin n, inner ℝ (EuclideanSpace.basisFun (Fin n) ℝ i) x * + dir F (EuclideanSpace.basisFun (Fin n) ℝ i) x = dir F x x := by + let b := EuclideanSpace.basisFun (Fin n) ℝ + have he := congrArg (fderiv ℝ F x) (b.sum_repr' x) + simpa only [map_sum,map_smul,smul_eq_mul,dir] using he + +lemma integral_radial_test {n : ℕ} {F θ : Space n → ℝ} + (hF : ContDiffOn ℝ 1 F ({0}ᶜ : Set (Space n))) + (hθ : ContDiff ℝ 1 θ) (hθc : HasCompactSupport θ) (hθ0 : 0 ∉ tsupport θ) : + (∫ x, F x*((n:ℝ)*θ x+dir θ x x)) = -(∫ x, θ x*dir F x x) := by + let b := EuclideanSpace.basisFun (Fin n) ℝ + let φ (i : Fin n) (x : Space n) := θ x*inner ℝ (b i) x + have hφ (i : Fin n) : ContDiff ℝ 1 (φ i) := hθ.mul ((innerSL ℝ (b i)).contDiff) + have hφs (i : Fin n) : tsupport (φ i) ⊆ tsupport θ := tsupport_mul_subset_left + have hφc (i : Fin n) : HasCompactSupport (φ i) := hθc.mul_right + have hs : tsupport θ ⊆ ({0}ᶜ : Set (Space n)) := by + intro x hx + simp only [mem_compl_iff,mem_singleton_iff] + intro he; subst x; exact hθ0 hx + have hφD (i : Fin n) : Continuous (dir (φ i) (b i)) := + (contDiffOn_univ.mp (contDiffOn_dir (k := 0) (hφ i).contDiffOn isOpen_univ (b i))).continuous + have hFD (i : Fin n) : ContinuousOn (dir F (b i)) ({0}ᶜ : Set (Space n)) := + (contDiffOn_dir (k := 0) hF isOpen_compl_singleton (b i)).continuousOn + have hiL (i : Fin n) : Integrable (fun x => F x*dir (φ i) (b i) x) := + integrable_mul_compact (compactSupport_dir (hφc i) (b i)) + (hF.continuousOn.mono ((tsupport_dir_subset _ _).trans ((hφs i).trans hs))) (hφD i).continuousOn + have hiR (i : Fin n) : Integrable (fun x => dir F (b i) x*φ i x) := + integrable_mul_compact (hφc i) ((hFD i).mono ((hφs i).trans hs)) (hφ i).continuous.continuousOn + have hiP (i : Fin n) : Integrable (fun x => F x*φ i x) := + integrable_mul_compact (hφc i) (hF.continuousOn.mono ((hφs i).trans hs)) (hφ i).continuous.continuousOn + have hI (i : Fin n) : (∫ x, F x*dir (φ i) (b i) x) = -(∫ x, dir F (b i) x*φ i x) := by + exact integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable (μ := volume) (f := F) (g := φ i) (v := b i) + (hiR i) (hiL i) (hiP i) + (fun x hx => (hF.contDiffAt (isOpen_compl_singleton.mem_nhds (hs (hφs i hx)))).differentiableAt (by norm_num)) + (fun x _ => (hφ i).differentiable (by norm_num) x) + have hφeq (i : Fin n) (x : Space n) : dir (φ i) (b i) x = + inner ℝ (b i) x*dir θ (b i) x+θ x := by + have hh := ((hθ.differentiable (by norm_num) x).hasFDerivAt).mul ((innerSL ℝ (b i)).hasFDerivAt) + change HasFDerivAt (φ i) _ x at hh + rw [dir,hh.fderiv] + simp only [add_apply,smul_apply,smul_eq_mul,innerSL_apply_apply,b.inner_eq_ite,ite_true,mul_one,dir] + ring + have hL (x : Space n) : (∑ i : Fin n, F x*dir (φ i) (b i) x) = F x*((n:ℝ)*θ x+dir θ x x) := by + simp_rw [hφeq,mul_add] + rw [Finset.sum_add_distrib,← Finset.mul_sum,show (∑ i : Fin n, inner ℝ (b i) x*dir θ (b i) x) = dir θ x x from sum_inner_mul_dir θ x] + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + ring + have hR (x : Space n) : (∑ i : Fin n, dir F (b i) x*φ i x) = θ x*dir F x x := by + simp only [φ] + simp_rw [show ∀ i : Fin n, dir F (b i) x*(θ x*inner ℝ (b i) x) = θ x*(inner ℝ (b i) x*dir F (b i) x) from fun _ => by ring] + rw [← Finset.mul_sum,sum_inner_mul_dir] + calc + _ = ∫ x, ∑ i : Fin n, F x*dir (φ i) (b i) x := by simp_rw [hL] + _ = ∑ i : Fin n, ∫ x, F x*dir (φ i) (b i) x := integral_finsetSum _ (fun i _ => hiL i) + _ = ∑ i : Fin n, -(∫ x, dir F (b i) x*φ i x) := by simp_rw [hI] + _ = -(∫ x, ∑ i : Fin n, dir F (b i) x*φ i x) := by rw [integral_finsetSum _ (fun i _ => hiR i),Finset.sum_neg_distrib] + _ = _ := by simp_rw [hR] + +end HenonLaneEmden +end +end RadialIntegration + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RadialJoint.lean b/lean/OAI/Analysis/HenonEmden/RadialJoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..31554e9c8749c1e953a8465d17bc294e8adcdd43 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RadialJoint.lean @@ -0,0 +1,80 @@ +import OAI.Analysis.HenonEmden.RadialGradient + +namespace OAI + +section RadialJoint + +open MeasureTheory Set Filter Topology Metric +open scoped ENNReal InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open WeakPDE Cutoff + +@[fun_prop] lemma measurable_joint_kernelDir (n : ℕ) : + Measurable (fun z : Space n × Space n => kernelDir z.1 (z.1-z.2)) := by + unfold kernelDir + exact (measurable_const.mul ((measurable_fst.sub measurable_snd).norm.pow_const _)).mul (by fun_prop) + +lemma IsSolution.integrable_joint_radial_gradient {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + Integrable (fun z : Space n × Space n => + eta n z.1*source u q B z.1*(kernelDir z.1 (z.1-z.2)*source v p A z.2)) (volume.prod volume) := by + have : Nontrivial (Space n) := (Module.finrank_pos_iff (R := ℝ)).mp (by simp; omega) + have hfm := measurable_source h.continuous_u q B + have hgm := measurable_source h.continuous_v p A + have hηm := (continuous_eta n (E := Space n)).measurable + have hm : Measurable (fun z : Space n × Space n => + eta n z.1*source u q B z.1*(kernelDir z.1 (z.1-z.2)*source v p A z.2)) := by fun_prop + have hz : ∀ᵐ x : Space n, x ≠ 0 := ae_iff.mpr (by simp) + apply (integrable_prod_iff hm.aestronglyMeasurable).mpr + constructor + · filter_upwards [hz] with x hx + exact ((h.gradient_u hn hq hx x).1.const_mul _) + · obtain ⟨C,hC,hbound⟩ := h.radial_kernel_absolute_bounded hn hp hq + have hi : Integrable (fun x => C*(eta n x*source u q B x)) := + ((h.source_f_locallyIntegrable hn).integrable_smul_left_of_hasCompactSupport + (continuous_eta n) (compactSupport_eta n)).const_mul C + apply hi.mono' hm.stronglyMeasurable.norm.integral_prod_right.aestronglyMeasurable + filter_upwards [hz] with x hx + have hs := source_nonneg (fun y => (h.positive_u y).le) q B x + have ht : 0 ≤ eta n x*source u q B x := mul_nonneg + (pow_nonneg (baseProfile_nonneg ‖x‖) (N n) : 0 ≤ eta n x) hs + have he (y : Space n) : ‖eta n x*source u q B x*(kernelDir x (x-y)*source v p A y)‖ = + (eta n x*source u q B x)*|kernelDir x (x-y)*source v p A y| := by + rw [norm_mul,Real.norm_eq_abs,abs_of_nonneg ht,Real.norm_eq_abs] + simp_rw [he] + rw [integral_const_mul,Real.norm_eq_abs, + abs_of_nonneg (mul_nonneg ht (integral_nonneg (fun y => abs_nonneg _)))] + by_cases hx2 : ‖x‖ ≤ 2 + · exact (mul_le_mul_of_nonneg_left (hbound x hx hx2) ht).trans_eq (mul_comm _ _) + · rw [eta_eq_zero (le_of_not_ge hx2)]; simp + +lemma IsSolution.integrable_eta_source_radialDir {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + Integrable (fun x => eta n x*source u q B x*dir u x x) := by + have : Nontrivial (Space n) := (Module.finrank_pos_iff (R := ℝ)).mp (by simp; omega) + have hi := (h.integrable_joint_radial_gradient hn hp hq).integral_prod_left.const_mul ((newtonDenom n)⁻¹) + apply hi.congr + filter_upwards [ae_iff.mpr (show volume {x : Space n | ¬x ≠ 0}=0 by simp)] with x hx + rw [integral_const_mul] + have hg := (h.gradient_u hn hq hx x).2 + rw [← hg] + field_simp [ne_of_gt (newtonDenom_pos (h.dimension_ge_three hn))] + +lemma IsSolution.integral_eta_source_radialDir {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + (∫ x, eta n x*source u q B x*dir u x x) = (newtonDenom n)⁻¹* + ∫ z : Space n × Space n, eta n z.1*source u q B z.1* + (kernelDir z.1 (z.1-z.2)*source v p A z.2) ∂volume.prod volume := by + have : Nontrivial (Space n) := (Module.finrank_pos_iff (R := ℝ)).mp (by simp; omega) + rw [integral_prod _ (h.integrable_joint_radial_gradient hn hp hq),← integral_const_mul] + apply integral_congr_ae + filter_upwards [ae_iff.mpr (show volume {x : Space n | ¬x ≠ 0}=0 by simp)] with x hx + rw [integral_const_mul,← (h.gradient_u hn hq hx x).2] + field_simp [ne_of_gt (newtonDenom_pos (h.dimension_ge_three hn))] + +end HenonLaneEmden +end +end RadialJoint + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RadialKernel.lean b/lean/OAI/Analysis/HenonEmden/RadialKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c223119066734ceda04a3e90de1af9fc27fc24a --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RadialKernel.lean @@ -0,0 +1,55 @@ +import OAI.Analysis.HenonEmden.KernelBalls + +namespace OAI + +section RadialKernel + +open MeasureTheory Set Metric +open scoped ENNReal InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open WeakPDE + +lemma source_near_radial_bound {n : ℕ} {v : Space n → ℝ} (hv : Continuous v) + (hvp : ∀ x, 0 < v x) {p : ℝ} (hp : 0 < p) (A : ℝ) : + ∃ M : ℝ, 0 ≤ M ∧ ∀ x : Space n, 0 < ‖x‖ → ‖x‖ ≤ 2 → + ∀ y : Space n, ‖x-y‖ < ‖x‖/2 → source v p A y ≤ M*‖x‖^A := by + obtain ⟨C,hC⟩ := (isCompact_closedBall (0:Space n) 3).exists_bound_of_continuousOn hv.continuousOn + let C' := max C 1 + refine ⟨C'^p*(2:ℝ)^|A|,by positivity,?_⟩ + intro x hx hx2 y hy + have hnorm : ‖y‖ ≤ ‖x‖+‖x-y‖ := by + simpa only [show x+(y-x)=y by abel,norm_sub_rev x y] using norm_add_le x (y-x) + have hnorm' : ‖x‖ ≤ ‖y‖+‖x-y‖ := by + simpa only [show y+(x-y)=x by abel] using norm_add_le y (x-y) + have hy0 : 0 < ‖y‖ := by linarith + have hy3 : y ∈ closedBall (0:Space n) 3 := mem_closedBall_zero_iff.mpr (by linarith) + have hvC : v y ≤ C' := (le_abs_self _).trans ((hC y hy3).trans (le_max_left _ _)) + have hvpow : (v y)^p ≤ C'^p := Real.rpow_le_rpow (hvp y).le hvC hp.le + rw [source_off_zero v p A (norm_ne_zero_iff.mp hy0.ne')] + have hweight := WeakPDE.rpow_half_double_bound hx (by linarith : ‖x‖/2 ≤ ‖y‖) (by linarith : ‖y‖ ≤ 2*‖x‖) A + exact (mul_le_mul hweight hvpow (Real.rpow_nonneg (hvp y).le p) (by positivity)).trans_eq (by ring) + +lemma radial_kernel_far_bound {n : ℕ} {x y : Space n} (hx : 0 < ‖x‖) + (hy : ‖x‖/2 ≤ ‖x-y‖) : + |kernelDir x (x-y)| ≤ 2*|2-(n:ℝ)| *‖x-y‖^(2-(n:ℝ)) := by + have hs : 0 < ‖x-y‖ := lt_of_lt_of_le (half_pos hx) hy + have he : ‖x-y‖^(1-(n:ℝ)) = ‖x-y‖^(2-(n:ℝ))/‖x-y‖ := by + calc + _ = ‖x-y‖^(2-(n:ℝ)-1) := by congr 1; ring + _ = _ := by rw [Real.rpow_sub hs,Real.rpow_one] + have hb := kernelDir_bound x (x-y) + simp only [finrank_euclideanSpace_fin] at hb + rw [he] at hb + refine hb.trans ?_ + have hr : ‖x‖/‖x-y‖ ≤ 2 := (div_le_iff₀ hs).mpr (by linarith) + calc + _ = (‖x‖/‖x-y‖)*(|2-(n:ℝ)| *‖x-y‖^(2-(n:ℝ))) := by ring + _ ≤ 2*(|2-(n:ℝ)| *‖x-y‖^(2-(n:ℝ))) := mul_le_mul_of_nonneg_right hr (by positivity) + _ = _ := by ring + +end HenonLaneEmden +end +end RadialKernel + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RadialODE.lean b/lean/OAI/Analysis/HenonEmden/RadialODE.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8889e07abccdf2bc0252e69d7be789852e315bf --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RadialODE.lean @@ -0,0 +1,274 @@ +import OAI.Analysis.HenonEmden.SphereFlux + +namespace OAI + +universe uE uE2 + +section RadialODE + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +noncomputable section + + +open Set Filter Topology +namespace HenonLaneEmden.RadialODE +lemma pow_le_self {k : ℕ} (hk : 1 ≤ k) {r : ℝ} (hr : 0 ≤ r) (hr1 : r ≤ 1) : r^k ≤ r := by + calc r^k ≤ r^1 := pow_le_pow_of_le_one hr hr1 hk + _ = r := pow_one r + +lemma sample_flux {U V : ℝ → ℝ} {k : ℕ} (hk : 1 ≤ k) + (hU : ContinuousOn U (Ici 0)) (hV : ∀ r > 0, HasDerivAt U (V r) r) + {r : ℝ} (hr : 0 < r) (hr1 : r ≤ 1) : + ∃ c ∈ Ioo 0 r, |c^k * V c| ≤ |U r-U 0| := by + obtain ⟨c,hc,hd⟩ := exists_hasDerivAt_eq_slope U V hr (hU.mono (Icc_subset_Ici_self)) + (fun x hx => hV x hx.1) + refine ⟨c,hc,?_⟩ + rw [hd,sub_zero,← mul_div_assoc,abs_div,abs_mul,abs_of_pos (pow_pos hc.1 k),abs_of_pos hr] + apply (div_le_iff₀ hr).mpr + have hp : c^k ≤ r := (pow_le_self hk hc.1.le (hc.2.le.trans hr1)).trans hc.2.le + nlinarith [abs_nonneg (U r-U 0)] + +lemma flux_nonpos {U V : ℝ → ℝ} {k : ℕ} (hk : 1 ≤ k) + (hU : ContinuousOn U (Ici 0)) (hV : ∀ r > 0, HasDerivAt U (V r) r) + (hF : AntitoneOn (fun r => r^k*V r) (Ioi 0)) {r : ℝ} (hr : 0 < r) : + r^k*V r ≤ 0 := by + have hl : Tendsto (fun s => |U s-U 0|) (𝓝[>] 0) (𝓝 0) := by + have hc : Tendsto U (𝓝[>] 0) (𝓝 (U 0)) := (hU 0 (by simp)).mono Ioi_subset_Ici_self + simpa using (hc.sub_const (U 0)).abs + apply ge_of_tendsto hl + filter_upwards [self_mem_nhdsWithin, mem_nhdsWithin_of_mem_nhds (Iio_mem_nhds hr), + mem_nhdsWithin_of_mem_nhds (Iio_mem_nhds (zero_lt_one : (0:ℝ)<1))] with s hs hsr hs1 + obtain ⟨c,hc,hsamp⟩ := sample_flux hk hU hV hs hs1.le + exact (hF hc.1 hr (hc.2.le.trans hsr.le)).trans ((le_abs_self _).trans hsamp) + +lemma flux_tendsto_zero {U V : ℝ → ℝ} {k : ℕ} (hk : 1 ≤ k) + (hU : ContinuousOn U (Ici 0)) (hV : ∀ r > 0, HasDerivAt U (V r) r) + (hF : AntitoneOn (fun r => r^k*V r) (Ioi 0)) : + Tendsto (fun r => r^k*V r) (𝓝[>] 0) (𝓝 0) := by + rw [Metric.tendsto_nhds] + intro ε hε + have hl : Tendsto (fun s => |U s-U 0|) (𝓝[>] 0) (𝓝 0) := by + have hc : Tendsto U (𝓝[>] 0) (𝓝 (U 0)) := (hU 0 (by simp)).mono Ioi_subset_Ici_self + simpa using (hc.sub_const (U 0)).abs + have he : ∀ᶠ s in 𝓝[>] (0:ℝ), |U s-U 0| < ε := hl (Iio_mem_nhds hε) + obtain ⟨s,⟨hs,hs1⟩,he⟩ := (((show ∀ᶠ s : ℝ in 𝓝[>] 0, 0 < s from self_mem_nhdsWithin).and + (show ∀ᶠ s : ℝ in 𝓝[>] 0, s < 1 from mem_nhdsWithin_of_mem_nhds (Iio_mem_nhds zero_lt_one))).and he).exists + obtain ⟨c,hc,hsamp⟩ := sample_flux hk hU hV hs hs1.le + filter_upwards [self_mem_nhdsWithin,mem_nhdsWithin_of_mem_nhds (Iio_mem_nhds hc.1)] with r hr hrc + have hneg := flux_nonpos hk hU hV hF hr + have hlo := hF hr hc.1 hrc.le + rw [Real.dist_eq,sub_zero,abs_of_nonpos hneg] + have hcneg : -(c^k*V c) ≤ |c^k*V c| := neg_le_abs _ + linarith +end HenonLaneEmden.RadialODE + +namespace HenonLaneEmden.RadialODE +lemma positive_radial_flux_lower {k : ℕ} (hk : 2 ≤ k) {U V : ℝ → ℝ} + (hV : ∀ r > 0, HasDerivAt U (V r) r) + (hF : AntitoneOn (fun r => r^k*V r) (Ioi 0)) (hU : ∀ r > 0, 0 ≤ U r) + {r : ℝ} (hr : 0 < r) : 0 ≤ r*V r+((k:ℝ)-1)*U r := by + let c : ℝ := r^k*V r/((k:ℝ)-1) + have hk1 : 0 < (k:ℝ)-1 := by exact_mod_cast (show 0 < (k:ℤ)-1 by omega) + have hkpos : 1 ≤ k := by omega + have hcomp : AntitoneOn (fun s : ℝ => U s+c*s^(-((k:ℝ)-1))) (Ici r) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Ici r) + · intro s hs + have hs0 : 0 < s := hr.trans_le hs + exact ((hV s hs0).continuousAt.add + ((Real.continuousAt_rpow_const _ _ (Or.inl hs0.ne')).const_mul c)).continuousWithinAt + · intro s hs + have hs0 : 0 < s := hr.trans (by simpa using hs) + exact ((hV s hs0).add ((Real.hasDerivAt_rpow_const (Or.inl hs0.ne')).const_mul c)).hasDerivWithinAt + · intro s hs + have hsr : r < s := by simpa using hs + have hs0 : 0 < s := hr.trans hsr + have hh := hF hr hs0 hsr.le + have he : -((k:ℝ)-1)-1 = -(k:ℝ) := by ring + change V s+c*(-((k:ℝ)-1)*s^(-((k:ℝ)-1)-1)) ≤ 0 + rw [he,Real.rpow_neg hs0.le,Real.rpow_natCast] + dsimp [c] + have hden : (k:ℝ)-1 ≠ 0 := ne_of_gt hk1 + have hsPow : 0 < s^k := pow_pos hs0 _ + have hh' : V s ≤ r^k*V r/(s^k) := (le_div_iff₀ hsPow).mpr (by simpa [mul_comm] using hh) + field_simp + field_simp at hh' + nlinarith + have hbound : ∀ᶠ s : ℝ in atTop, c*s^(-((k:ℝ)-1)) ≤ U r+c*r^(-((k:ℝ)-1)) := by + filter_upwards [eventually_ge_atTop r] with s hs + have hh := hcomp (by simp) hs hs + linarith [hU s (hr.trans_le hs)] + have hh : 0 ≤ U r+c*r^(-((k:ℝ)-1)) := + le_of_tendsto (by simpa using (tendsto_rpow_neg_atTop hk1).const_mul c) hbound + have he : (k:ℝ)-1 = ((k-1:ℕ):ℝ) := by rw [Nat.cast_sub hkpos]; norm_num + rw [Real.rpow_neg hr.le,he,Real.rpow_natCast] at hh + have hpow : r^k = r*r^(k-1) := by + conv_lhs => rw [show k = (k-1)+1 by omega,pow_succ] + ring + dsimp [c] at hh + rw [hpow] at hh + have hrp : r^(k-1) ≠ 0 := pow_ne_zero _ hr.ne' + have hsimp : r*r^(k-1)*V r/((k:ℝ)-1)*(r^(k-1))⁻¹ = r*V r/((k:ℝ)-1) := by field_simp + rw [hsimp] at hh + nlinarith [(le_div_iff₀ hk1).mp (show -(U r) ≤ r*V r/((k:ℝ)-1) by linarith)] +end HenonLaneEmden.RadialODE + +open MeasureTheory +namespace HenonLaneEmden.RadialODE +lemma radial_source_integral_bound {k : ℕ} (hk : 2 ≤ k) {U V V' W : ℝ → ℝ} + (hUc : ContinuousOn U (Ici 0)) (hVc : ContinuousOn V (Ici 0)) + (hWc : ContinuousOn W (Ici 0)) + (hU : ∀ r > 0, HasDerivAt U (V r) r) (hV : ∀ r > 0, HasDerivAt V (V' r) r) + (hF : AntitoneOn (fun r => r^k*V r) (Ioi 0)) + (hODE : ∀ r > 0, r*V' r+(k:ℝ)*V r = -r*W r) + (hp : ∀ r > 0, 0 ≤ U r) {R : ℝ} (hR : 0 < R) : + (∫ r in 0..R, r*W r) ≤ ((k:ℝ)-1)*U 0 := by + have hH : ContinuousOn (fun r => r*V r+((k:ℝ)-1)*U r) (Icc 0 R) := + ((continuousOn_id.mul hVc).add (hUc.const_mul _)).mono Icc_subset_Ici_self + have hHd (r : ℝ) (hr : r ∈ Ioo 0 R) : + HasDerivAt (fun s => s*V s+((k:ℝ)-1)*U s) (-r*W r) r := by + convert! (((hasDerivAt_id r).mul (hV r hr.1)).add ((hU r hr.1).const_mul ((k:ℝ)-1))) using 1 + simp only [id_eq,one_mul] + nlinarith [hODE r hr.1] + have hi : IntervalIntegrable (fun r => r*W r) volume 0 R := + (continuousOn_id.mul hWc).mono Icc_subset_Ici_self |>.intervalIntegrable_of_Icc hR.le + have hh := intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hR.le hH hHd (by simpa only [Pi.neg_def,neg_mul] using hi.neg) + simp only [zero_mul,zero_add] at hh + have hi' : (∫ r in 0..R, -r*W r) = -(∫ r in 0..R, r*W r) := by + simp_rw [neg_mul]; exact intervalIntegral.integral_neg + rw [hi'] at hh + linarith [positive_radial_flux_lower hk hU hF hp hR] +end HenonLaneEmden.RadialODE + +namespace HenonLaneEmden.SphereCalculus +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +omit [Nontrivial E] in +lemma continuous_meanD_global {u : E → ℝ} (hu : ContDiff ℝ 2 u) : Continuous (meanD u) := by + rw [← continuousOn_univ] + apply continuousOn_integral_of_compact_support isCompact_univ + (s := (univ : Set ℝ)) + · exact (((hu.continuous_fderiv (by norm_num)).comp + (continuous_fst.smul continuous_snd.subtype_val)).clm_apply + continuous_snd.subtype_val).continuousOn + · exact fun _ _ _ h => (h (mem_univ _)).elim + +lemma spherical_source_integral_bound (hn : 3 ≤ Module.finrank ℝ E) {u w : E → ℝ} + (hu : ContDiff ℝ 2 u) (hw : Continuous w) (hp : ∀ x, 0 ≤ u x) (hwp : ∀ x, 0 ≤ w x) + (hEq : ∀ x, -Laplacian.laplacian u x = w x) {R : ℝ} (hR : 0 < R) : + (∫ r in 0..R, r*mean w r) ≤ ((Module.finrank ℝ E:ℝ)-2)*mean u 0 := by + have hd (r : ℝ) (hr : 0 < r) := hasDerivAt_mean_flux hu.contDiffOn hw.continuousOn + (fun x _ => hEq x) hr + have hF : AntitoneOn (fun r => r^(Module.finrank ℝ E-1)*meanD u r) (Ioi 0) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Ioi 0) + (fun r hr => (hd r hr).continuousAt.continuousWithinAt) + (fun r hr => (hd r (by simpa using hr)).hasDerivWithinAt) + intro r hr + have hr0 : 0 < r := by simpa using hr + exact neg_nonpos.mpr (mul_nonneg (pow_nonneg hr0.le _) + (integral_nonneg fun θ => hwp (r • θ.1))) + have hODE (r : ℝ) (hr : 0 < r) : r*meanDD u r+ + ((Module.finrank ℝ E-1:ℕ):ℝ)*meanD u r = -r*mean w r := by + have h := mean_laplacian_ode hu.contDiffOn hw.neg.continuousOn + (fun x _ => neg_eq_iff_eq_neg.mp (hEq x)) hr + simp only [Pi.neg_def,mean_neg] at h + have hpower : r^(Module.finrank ℝ E-1) = r^(Module.finrank ℝ E-2)*r := by + rw [show Module.finrank ℝ E-1 = Module.finrank ℝ E-2+1 by omega,pow_succ] + rw [hpower] at h + have hnz : r^(Module.finrank ℝ E-2) ≠ 0 := pow_ne_zero _ hr.ne' + apply (mul_left_cancel₀ hnz) + nlinarith [h] + have hh := RadialODE.radial_source_integral_bound (k := Module.finrank ℝ E-1) (by omega) + (continuous_mean hu.continuous).continuousOn (continuous_meanD_global hu).continuousOn + (continuous_mean hw).continuousOn + (fun r hr => hasDerivAt_mean hu.contDiffOn hr) + (fun r hr => hasDerivAt_meanD hu.contDiffOn hr) hF hODE + (fun r _ => integral_nonneg fun θ => hp (r • θ.1)) hR + have hcast : ((Module.finrank ℝ E-1:ℕ):ℝ)-1 = (Module.finrank ℝ E:ℝ)-2 := by + rw [Nat.cast_sub (by omega : 1 ≤ Module.finrank ℝ E),Nat.cast_one] + ring + simpa only [hcast] using hh +end HenonLaneEmden.SphereCalculus + +namespace HenonLaneEmden.SphereCalculus +variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +lemma spherical_source_lintegral_bound (hn : 3 ≤ Module.finrank ℝ E) {u w : E → ℝ} + (hu : ContDiff ℝ 2 u) (hw : Continuous w) (hp : ∀ x, 0 ≤ u x) (hwp : ∀ x, 0 ≤ w x) + (hEq : ∀ x, -Laplacian.laplacian u x = w x) : + (∫⁻ r in Ioi (0:ℝ), ENNReal.ofReal (r*mean w r)) ≤ + ENNReal.ofReal (((Module.finrank ℝ E:ℝ)-2)*mean u 0) := by + have hUnion : (⋃ j : ℕ, Ioc (0:ℝ) (j+1:ℝ)) = Ioi 0 := by + apply iUnion_Ioc_eq_Ioi_self_iff.mpr + intro r _ + obtain ⟨j,hj⟩ := exists_nat_gt r + exact ⟨j,by linarith⟩ + have hm : Monotone (fun j : ℕ => Ioc (0:ℝ) (j+1:ℝ)) := by + intro i j hij + exact Ioc_subset_Ioc_right (by exact_mod_cast (Nat.add_le_add_right hij 1)) + rw [← hUnion,setLIntegral_iUnion_of_directed _ hm.directed_le] + apply iSup_le + intro j + have hR : (0:ℝ) < j+1 := by positivity + have hi : IntervalIntegrable (fun r => r*mean w r) volume 0 (j+1:ℝ) := + (continuous_id.mul (continuous_mean hw)).intervalIntegrable _ _ + have hrw : (∫⁻ r in Ioc (0:ℝ) (j+1:ℝ), ENNReal.ofReal (r*mean w r)) = + ENNReal.ofReal (∫ r in 0..(j+1:ℝ), r*mean w r) := by + rw [intervalIntegral.integral_of_le hR.le] + apply (ofReal_integral_eq_lintegral_ofReal hi.1 _).symm + filter_upwards [ae_restrict_mem measurableSet_Ioc] with r hr + exact mul_nonneg hr.1.le (integral_nonneg fun θ => hwp (r • θ.1)) + rw [hrw] + exact ENNReal.ofReal_le_ofReal (spherical_source_integral_bound hn hu hw hp hwp hEq hR) + +lemma kernel_source_polar (hn : 3 ≤ Module.finrank ℝ E) {w : E → ℝ} + (hw : Continuous w) (hp : ∀ x, 0 ≤ w x) : + (∫⁻ x : E, ENNReal.ofReal (‖x‖^(2-(Module.finrank ℝ E:ℝ))*w x)) = + ∫⁻ r in Ioi (0:ℝ), ENNReal.ofReal (r*mean w r) := by + rw [Polar.lintegral_polar volume _ (by fun_prop)] + apply setLIntegral_congr_fun measurableSet_Ioi + intro r hr + have hr0 : 0 < r := hr + simp_rw [norm_smul_sphere hr0.le] + have hsint : Integrable (fun θ : UnitSphere E => w (r • θ.1)) (volume : Measure E).toSphere := + (hw.comp (continuous_const.smul continuous_subtype_val)).integrable_of_hasCompactSupport + (.of_compactSpace _) + have hs : (∫⁻ θ : UnitSphere E, ENNReal.ofReal (r^(2-(Module.finrank ℝ E:ℝ))*w (r • θ.1)) + ∂(volume : Measure E).toSphere) = + ENNReal.ofReal (r^(2-(Module.finrank ℝ E:ℝ))*mean w r) := by + rw [← ofReal_integral_eq_lintegral_ofReal (hsint.const_mul _) (Eventually.of_forall fun θ => + mul_nonneg (Real.rpow_nonneg hr0.le _) (hp _)),integral_const_mul] + rfl + rw [hs,← ENNReal.ofReal_mul (pow_nonneg hr0.le _)] + congr 1 + rw [← mul_assoc] + congr 1 + rw [← Real.rpow_natCast,← Real.rpow_add hr0] + have hc : ((Module.finrank ℝ E-1:ℕ):ℝ)+(2-(Module.finrank ℝ E:ℝ)) = 1 := by + rw [Nat.cast_sub (by omega : 1 ≤ Module.finrank ℝ E),Nat.cast_one] + ring + rw [hc,Real.rpow_one] + +lemma smooth_newton_lower_at_zero (hn : 3 ≤ Module.finrank ℝ E) {u w : E → ℝ} + (hu : ContDiff ℝ 2 u) (hw : Continuous w) (hp : ∀ x, 0 ≤ u x) (hwp : ∀ x, 0 ≤ w x) + (hEq : ∀ x, -Laplacian.laplacian u x = w x) : + (∫⁻ x : E, ENNReal.ofReal (‖x‖^(2-(Module.finrank ℝ E:ℝ))*w x)) ≤ + ENNReal.ofReal (((Module.finrank ℝ E:ℝ)-2)* + ((volume : Measure E).toSphere univ).toReal*u 0) := by + rw [kernel_source_polar hn hw hwp] + simpa only [mean_zero, mul_assoc] using spherical_source_lintegral_bound hn hu hw hp hwp hEq +end HenonLaneEmden.SphereCalculus + +end +end RadialODE + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RadialTaylor.lean b/lean/OAI/Analysis/HenonEmden/RadialTaylor.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed3bb15b6dd7c05b266ebb35fa02bd0c7266b30f --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RadialTaylor.lean @@ -0,0 +1,75 @@ +import OAI.Analysis.HenonEmden.RadialGeometry + +namespace OAI + +universe uE + +section RadialTaylor + +open MeasureTheory Set Metric NormedSpace +open scoped ENNReal InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open Cutoff + +lemma norm_radial_error {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + {x : E} (hx : (1:ℝ)/2 ≤ ‖x‖) (y : E) : + |(‖x‖-‖y‖)-inner ℝ x (x-y)/‖x‖| ≤ ‖x-y‖^2 := by + have hr : 0 < ‖x‖ := by linarith + have hid := norm_sub_sq_real x y + have hI : inner ℝ x (x-y) = ‖x‖^2-inner ℝ x y := by + rw [inner_sub_right,real_inner_self_eq_norm_sq] + have hs : (‖x‖-‖y‖)^2 ≤ ‖x-y‖^2 := by + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg (‖x‖-‖y‖)) (norm_nonneg (x-y))).mpr (abs_norm_sub_norm_le x y) + have he : (‖x‖-‖y‖)-inner ℝ x (x-y)/‖x‖ = (‖x‖*(‖x‖-‖y‖)-inner ℝ x (x-y))/‖x‖ := by + field_simp + rw [he,abs_div,abs_of_pos hr,div_le_iff₀ hr,hI] + apply abs_le.mpr + constructor <;> nlinarith [sq_nonneg (‖x‖-‖y‖),mul_le_mul_of_nonneg_right hx (sq_nonneg ‖x-y‖)] + +lemma eta_radial_taylor {n : ℕ} (hn : 1 ≤ n) {x : Space n} (hx : (1:ℝ)/2 ≤ ‖x‖) + (y : Space n) {D : ℝ} (hD : 0 ≤ D) (hseg : ∀ t ∈ uIcc ‖x‖ ‖y‖, gapProfile t ≤ D) : + |eta n x-eta n y-derivativeProfile n ‖x‖*inner ℝ x (x-y)/‖x‖| ≤ + (secondConstant n*D^(N n-2)+derivativeConstant n*D^(N n-1))*‖x-y‖^2 := by + have hs := etaProfile_taylor hn hD hseg + have hnrm := norm_radial_error hx y + have hp := (derivativeProfile_bound n ‖x‖).trans + (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (gapProfile_nonneg _) (hseg _ left_mem_uIcc) _) (constants_nonneg n).1) + have hsq : (‖y‖-‖x‖)^2 ≤ ‖x-y‖^2 := by + simpa only [sq_abs,norm_sub_rev y x] using + (sq_le_sq₀ (abs_nonneg (‖y‖-‖x‖)) (norm_nonneg (y-x))).mpr (abs_norm_sub_norm_le y x) + have hs' : |eta n x-eta n y-derivativeProfile n ‖x‖*(‖x‖-‖y‖)| ≤ secondConstant n*D^(N n-2)*‖x-y‖^2 := by + have hh := hs.trans (mul_le_mul_of_nonneg_left hsq (mul_nonneg (constants_nonneg n).2.1 (pow_nonneg hD _))) + rw [show eta n x-eta n y-derivativeProfile n ‖x‖*(‖x‖-‖y‖) = + -(etaProfile n ‖y‖-etaProfile n ‖x‖-derivativeProfile n ‖x‖*(‖y‖-‖x‖)) by unfold eta; ring,abs_neg] + exact hh + have he : eta n x-eta n y-derivativeProfile n ‖x‖*inner ℝ x (x-y)/‖x‖ = + (eta n x-eta n y-derivativeProfile n ‖x‖*(‖x‖-‖y‖))+ + derivativeProfile n ‖x‖*((‖x‖-‖y‖)-inner ℝ x (x-y)/‖x‖) := by ring + rw [he] + exact (abs_add_le _ _).trans ((add_le_add hs' + ((by rw [abs_mul]; exact mul_le_mul hp hnrm (abs_nonneg _) (mul_nonneg (constants_nonneg n).1 (pow_nonneg hD _)) : + |derivativeProfile n ‖x‖*((‖x‖-‖y‖)-inner ℝ x (x-y)/‖x‖)| ≤ + derivativeConstant n*D^(N n-1)*‖x-y‖^2))).trans_eq (by ring)) + +lemma flux_linearization_identity {n : ℕ} {x y : Space n} (hx : x ≠ 0) (hxy : x ≠ y) : + fluxFactor n (x,y)-eta n x+w n x*radialFactor (x,y) = + (eta n x-eta n y-derivativeProfile n ‖x‖*inner ℝ x (x-y)/‖x‖)* + inner ℝ (x-y) y/‖x-y‖^2-derivativeProfile n ‖x‖*inner ℝ x (x-y)/‖x‖ := by + have hr : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx + have hd : ‖x-y‖ ≠ 0 := norm_ne_zero_iff.mpr (sub_ne_zero.mpr hxy) + have hI : inner ℝ (x-y) x = inner ℝ x (x-y) := real_inner_comm _ _ + have hJ : inner ℝ (x-y) y = inner ℝ x (x-y)-‖x-y‖^2 := by + have he : inner ℝ (x-y) (x-y) = inner ℝ (x-y) x-inner ℝ (x-y) y := inner_sub_right _ _ _ + rw [real_inner_self_eq_norm_sq,hI] at he; linarith + simp only [fluxFactor,X,inner_sub_right,real_inner_smul_right,radialFactor,w_eq_profile,wProfile] + rw [hI,hJ] + simp only [inner_sub_right] + field_simp + ring + +end HenonLaneEmden +end +end RadialTaylor + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RealInteraction.lean b/lean/OAI/Analysis/HenonEmden/RealInteraction.lean new file mode 100644 index 0000000000000000000000000000000000000000..5213d5e02baa9bdfa41b000d455b6b1b20663295 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RealInteraction.lean @@ -0,0 +1,46 @@ +import OAI.Analysis.HenonEmden.FarLocalization + +namespace OAI + +section RealInteraction + +open MeasureTheory Set Filter Topology Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden + +lemma interaction_density_finite {n : ℕ} (f g : Space n → ℝ) : + ∀ᵐ z : Space n × Space n ∂volume.prod volume, + ENNReal.ofReal (f z.1)*ENNReal.ofReal (g z.2)*ENNReal.ofReal (newtonKernel n z) < ⊤ := by + exact ae_of_all _ fun z => ENNReal.mul_lt_top (ENNReal.mul_lt_top ENNReal.ofReal_lt_top ENNReal.ofReal_lt_top) ENNReal.ofReal_lt_top + +lemma integrable_interaction_iff {n : ℕ} (hn : 3 ≤ n) {f g : Space n → ℝ} + (hf : Measurable f) (hg : Measurable g) (hf0 : ∀ x, 0 ≤ f x) (hg0 : ∀ x, 0 ≤ g x) + (F : Space n × Space n → ℝ) : + Integrable F (interaction f g) ↔ Integrable (fun z => f z.1*g z.2*newtonKernel n z*F z) (volume.prod volume) := by + rw [interaction,integrable_withDensity_iff_integrable_smul' (by fun_prop) (interaction_density_finite f g)] + simp only [ENNReal.toReal_mul,ENNReal.toReal_ofReal (hf0 _),ENNReal.toReal_ofReal (hg0 _), + ENNReal.toReal_ofReal (newtonKernel_nonneg hn _),smul_eq_mul] + +lemma integral_interaction {n : ℕ} (hn : 3 ≤ n) {f g : Space n → ℝ} + (hf : Measurable f) (hg : Measurable g) (hf0 : ∀ x, 0 ≤ f x) (hg0 : ∀ x, 0 ≤ g x) + (F : Space n × Space n → ℝ) : + (∫ z, F z ∂interaction f g) = ∫ z, f z.1*g z.2*newtonKernel n z*F z ∂volume.prod volume := by + rw [interaction,integral_withDensity_eq_integral_toReal_smul (by fun_prop) (interaction_density_finite f g)] + simp only [ENNReal.toReal_mul,ENNReal.toReal_ofReal (hf0 _),ENNReal.toReal_ofReal (hg0 _), + ENNReal.toReal_ofReal (newtonKernel_nonneg hn _),smul_eq_mul] + +lemma interaction_ae_ne {n : ℕ} (hn : 1 ≤ n) (f g : Space n → ℝ) : + ∀ᵐ z : Space n × Space n ∂interaction f g, z.1 ≠ z.2 := by + have : Nontrivial (Space n) := (Module.finrank_pos_iff (R := ℝ)).mp (by simp; omega) + apply ae_iff.mpr + apply withDensity_absolutelyContinuous (volume.prod volume) _ + apply ae_iff.mp + apply (Measure.ae_prod_iff_ae_ae (by measurability)).mpr + exact ae_of_all _ fun x => ae_iff.mpr (by simp) + +end HenonLaneEmden +end +end RealInteraction + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RelativeLocalization.lean b/lean/OAI/Analysis/HenonEmden/RelativeLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..590f0663a0bb3b65322dc6394077ac977a5300d5 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RelativeLocalization.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.HenonEmden.RelativePressure + +namespace OAI + +section RelativeLocalization + +open MeasureTheory Set Metric +noncomputable section +namespace HenonLaneEmden +open Cutoff + +def localQ {n : ℕ} (f g : Space n → ℝ) : ℝ := + ∫ z : Space n × Space n, fluxFactor n z-eta n z.1+w n z.1*radialFactor z ∂interaction f g + +lemma IsSolution.localQ_identity {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + localQ (source u q B) (source v p A) = + (∫ z, fluxFactor n z ∂interaction (source u q B) (source v p A))-weightedEnergy (eta n) u q B+ + (∫ z : Space n × Space n, w n z.1*radialFactor z ∂interaction (source u q B) (source v p A)) := by + have hη := h.weight_left hn hq (continuous_eta n) (compactSupport_eta n) (eta_nonneg n) + have hi : Integrable (fun z : Space n × Space n => fluxFactor n z-eta n z.1) _ := + (h.integrable_fluxFactor hn hp hq).sub hη.1 + rw [localQ,integral_add hi (h.integrable_radialWeight hn hq), + integral_sub (h.integrable_fluxFactor hn hp hq) hη.1,hη.2] + +lemma IsSolution.local_errors_le {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + |localQ (source u q B) (source v p A)|+|weightedEnergy (eta n) u q B-weightedEnergy (eta n) v p A| ≤ + ∫ z, localError z ∂interaction (source u q B) (source v p A) := by + have hηf := h.weight_left hn hq (continuous_eta n) (compactSupport_eta n) (eta_nonneg n) + have hηg := h.weight_right hn hp (continuous_eta n) (compactSupport_eta n) (eta_nonneg n) + have hi : Integrable (fun z : Space n × Space n => fluxFactor n z-eta n z.1+w n z.1*radialFactor z) _ := + ((h.integrable_fluxFactor hn hp hq).sub hηf.1).add (h.integrable_radialWeight hn hq) + have hj : Integrable (fun z : Space n × Space n => eta n z.1-eta n z.2) _ := hηf.1.sub hηg.1 + unfold localQ localError + rw [integral_add hi.abs hj.abs,← hηf.2,← hηg.2,← integral_sub hηf.1 hηg.1] + exact add_le_add abs_integral_le_integral_abs abs_integral_le_integral_abs + +lemma localization_relative {n : ℕ} (hn : 2 ≤ n) {p q A B ε : ℝ} (hp : 0 < p) (hq : 0 < q) + (hε : 0 < ε) : ∃ C : ℝ, 0 ≤ C ∧ ∀ u v : Space n → ℝ, IsSolution n p q A B u v → + |localQ (source u q B) (source v p A)|+|weightedEnergy (eta n) u q B-weightedEnergy (eta n) v p A| ≤ + ε*(weightedEnergy (eta n) u q B+weightedEnergy (eta n) v p A)+C := by + let δ := min (1/4) (ε/(closeConstant n+1)) + have hC := closeConstant_nonneg n + have hden : 0 < closeConstant n+1 := by linarith + have hδ : 0 < δ := lt_min (by norm_num) (div_pos hε hden) + have hδ1 : δ ≤ 1/4 := min_le_left _ _ + have hδε : closeConstant n*δ ≤ ε := by + have hh := (le_div_iff₀ hden).mp (min_le_right (1/4) (ε/(closeConstant n+1))) + change δ*(closeConstant n+1) ≤ ε at hh + nlinarith + refine ⟨localizationConstant n p q A B δ,localizationConstant_nonneg p q A B hδ.le,?_⟩ + intro u v h + have he := (h.local_errors_le hn hp hq).trans (h.localError_bound hn hp hq hδ hδ1).2 + have hE : 0 ≤ weightedEnergy (eta n) u q B+weightedEnergy (eta n) v p A := + add_nonneg (weightedEnergyN_nonneg (eta_nonneg n) (fun x => (h.positive_u x).le)) + (weightedEnergyN_nonneg (eta_nonneg n) (fun x => (h.positive_v x).le)) + exact he.trans (add_le_add (mul_le_mul_of_nonneg_right hδε hE) le_rfl) + +lemma IsSolution.closing_identity {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + (((n:ℝ)+B)/(q+1)-((n:ℝ)-2))*weightedEnergy (eta n) u q B+ + (((n:ℝ)+A)/(p+1))*weightedEnergy (eta n) v p A = + (q+1)⁻¹*weightedEnergy (w n) u q B+(p+1)⁻¹*weightedEnergy (w n) v p A- + radialPressure (source u q B) (source v p A)+((n:ℝ)-2)*localQ (source u q B) (source v p A) := by + have hh := h.symmetric_virial hn hp hq + rw [h.localQ_identity hn hp hq,radialPressure] + nlinarith [hh] + +end HenonLaneEmden +end +end RelativeLocalization + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RelativePressure.lean b/lean/OAI/Analysis/HenonEmden/RelativePressure.lean new file mode 100644 index 0000000000000000000000000000000000000000..6a6466b1afa20de9b6130909e06e6d7329a86a65 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RelativePressure.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.HenonEmden.PressureEstimate + +namespace OAI + +section RelativePressure + +open MeasureTheory Set Metric +noncomputable section +namespace HenonLaneEmden +open Cutoff + +lemma pressure_relative {n : ℕ} (hn : 3 ≤ n) {p q A B ε : ℝ} (hp : 0 < p) (hq : 0 < q) + (hε : 0 < ε) : ∃ C : ℝ, 0 ≤ C ∧ ∀ u v : Space n → ℝ, IsSolution n p q A B u v → + (q+1)⁻¹*weightedEnergy (w n) u q B+(p+1)⁻¹*weightedEnergy (w n) v p A- + radialPressure (source u q B) (source v p A) ≤ + ε*(weightedEnergy (eta n) u q B+weightedEnergy (eta n) v p A)+C := by + let G := pressureGeomCoefficient n + have hG : 0 ≤ G := pressureGeomCoefficient_nonneg (by omega) + let κ := min 1 (ε/(3*(G+1))) + have hκ : 0 < κ := lt_min (by norm_num) (div_pos hε (by positivity)) + have hκ1 : κ ≤ 1 := min_le_left _ _ + have hGκ : G*κ ≤ ε/3 := by + have hh := (le_div_iff₀ (by positivity : 0 < 3*(G+1))).mp (min_le_right 1 (ε/(3*(G+1)))) + change κ*(3*(G+1)) ≤ ε at hh + nlinarith + let S := pressureSmallCoefficient n p q A B κ + have hS : 0 ≤ S := pressureSmallCoefficient_nonneg n p q A B hκ.le + let δ := min (1/4) (ε/(3*(S+1))) + have hδ : 0 < δ := lt_min (by norm_num) (div_pos hε (by positivity)) + have hδ1 : δ ≤ 1/4 := min_le_left _ _ + have hSδ : S*δ ≤ ε/3 := by + have hh := (le_div_iff₀ (by positivity : 0 < 3*(S+1))).mp (min_le_right (1/4) (ε/(3*(S+1)))) + change δ*(3*(S+1)) ≤ ε at hh + nlinarith + let H := pressureHighCoefficient n p q A B κ δ + let P := max 1 (3*H/ε) + have hP : 0 < P := lt_of_lt_of_le (by norm_num) (le_max_left _ _) + have hHP : H/P ≤ ε/3 := by + apply (div_le_iff₀ hP).mpr + have hh := (div_le_iff₀ hε).mp (le_max_right 1 (3*H/ε)) + change 3*H ≤ P*ε at hh + nlinarith + have hc : G*κ+S*δ+H/P ≤ ε := by linarith + refine ⟨pressureConstant n p q A B κ δ P,pressureConstant_nonneg n p q A B hκ.le hδ.le hP.le,?_⟩ + intro u v h + have he := h.pressure_estimate hn hp hq hκ hκ1 hδ hδ1 hP + have hE : 0 ≤ weightedEnergy (eta n) u q B+weightedEnergy (eta n) v p A := + add_nonneg (weightedEnergyN_nonneg (eta_nonneg n) (fun x => (h.positive_u x).le)) + (weightedEnergyN_nonneg (eta_nonneg n) (fun x => (h.positive_v x).le)) + exact he.trans (add_le_add (mul_le_mul_of_nonneg_right hc hE) le_rfl) + +end HenonLaneEmden +end +end RelativePressure + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/RootRecovery.lean b/lean/OAI/Analysis/HenonEmden/RootRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ec5f5f486d9c59b34dd084657e19f49a930a59f --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/RootRecovery.lean @@ -0,0 +1,92 @@ +import OAI.Analysis.HenonEmden.PairRecovery + +namespace OAI + +section RootRecovery + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden.WeightedLayers + +lemma weighted_layer_identity_ennreal {w u q : ℝ} (hw : 0 < w) (hu : 0 < u) (hq : 0 < q) : + (∫⁻ t in Ioo 0 (w*u^q), ENNReal.ofReal (u-(t/w)^(1/q))) = + ENNReal.ofReal ((w*u^q*u)/(q+1)) := by + have hf : 0 < w*u^q := mul_pos hw (Real.rpow_pos_of_pos hu _) + have hc : Continuous (fun t : ℝ => u-(t/w)^(1/q)) := by + apply continuous_const.sub + exact (continuous_id.div_const w).rpow_const (fun _ => Or.inr (one_div_nonneg.mpr hq.le)) + have hi : IntegrableOn (fun t : ℝ => u-(t/w)^(1/q)) (Ioo 0 (w*u^q)) := + (hc.integrableOn_Icc).mono_set Ioo_subset_Icc_self + rw [← ofReal_integral_eq_lintegral_ofReal hi] + · rw [← integral_Ioc_eq_integral_Ioo,← intervalIntegral.integral_of_le hf.le, + weighted_layer_identity hw hu hq,Real.rpow_add hu,Real.rpow_one,mul_assoc] + · filter_upwards [ae_restrict_mem measurableSet_Ioo] with t ht + exact sub_nonneg.mpr (layer_root_bounds hw hu hq ht.1.le ht.2.le).2 + +end HenonLaneEmden.WeightedLayers +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap WeightedLayers LayerTonelli + +def sourceRoot {n : ℕ} (q B : ℝ) (z : Space n × ℝ) : ℝ := (z.2/‖z.1‖^B)^(1/q) +@[fun_prop] lemma measurable_sourceRoot (n : ℕ) (q B : ℝ) : Measurable (sourceRoot (n:=n) q B) := by + unfold sourceRoot; fun_prop + +lemma sourceRoot_bounds {n : ℕ} {u : Space n → ℝ} {q B : ℝ} + (hu : ∀ x, 0 < u x) (hq : 0 < q) {z : Space n × ℝ} + (hz : 0 < z.2 ∧ z.2 < source u q B z.1) : + 0 ≤ sourceRoot q B z ∧ sourceRoot q B z ≤ u z.1 := by + have hx : z.1 ≠ 0 := by + intro hx; rw [hx,source_zero] at hz; linarith [hz.1,hz.2] + exact layer_root_bounds (Real.rpow_pos_of_pos (norm_pos_iff.mpr hx) B) (hu _) hq hz.1.le + (by rw [← source_off_zero _ _ _ hx]; exact hz.2.le) + +lemma lintegral_source_residual {n : ℕ} {u : Space n → ℝ} {q B : ℝ} + (hu : ∀ x, 0 < u x) (hq : 0 < q) (x : Space n) : + (∫⁻ t in Ioo 0 (source u q B x), ENNReal.ofReal (u x-sourceRoot q B (x,t))) = + ENNReal.ofReal (source u q B x*u x/(q+1)) := by + by_cases hx : x=0 + · simp [hx,source_zero] + · rw [source_off_zero _ _ _ hx] + exact weighted_layer_identity_ennreal (Real.rpow_pos_of_pos (norm_pos_iff.mpr hx) B) (hu _) hq + +lemma source_pressure_recovery_pointwise {n : ℕ} (hn : 1 ≤ n) {u : Space n → ℝ} {q B κ δ : ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n))) (hup : ∀ x, 0 < u x) + (hq : 0 < q) (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) + (e : sphere (0:Space n) 1) {z : Space n × ℝ} + (hz : 0 < z.2 ∧ z.2 < source u q B z.1) : + ENNReal.ofReal (weight volume κ e z.1*(u z.1-sourceRoot q B z))+ + ENNReal.ofReal (lineWeight volume (source u q B) κ δ (e,z)*endpointAverage u (source u q B) (e,z)) ≤ + ENNReal.ofReal (lineWeight volume (source u q B) κ δ (e,z)*u z.1)+ + ENNReal.ofReal ((weight volume κ e z.1-lineWeight volume (source u q B) κ δ (e,z))*u z.1)+ + ENNReal.ofReal (endpointConstant q B*δ*d z.1*weight volume κ e z.1*u z.1) := by + have hnχ := lineWeight_nonneg volume (source u q B) κ δ (e,z) + have hleh := lineWeight_le volume (source u q B) κ δ (e,z) + have hh := weight_nonneg volume κ e z.1 + have hu0 : 0 ≤ u z.1 := (hup _).le + have he : 0 ≤ endpointAverage u (source u q B) (e,z) := by + exact div_nonneg (add_nonneg (hup _).le (hup _).le) (by norm_num) + have hr := sourceRoot_bounds hup hq hz + rw [← ENNReal.ofReal_add (mul_nonneg hh (sub_nonneg.mpr hr.2)) (mul_nonneg hnχ he), + ← ENNReal.ofReal_add (mul_nonneg hnχ (hup _).le) (mul_nonneg (sub_nonneg.mpr hleh) (hup _).le), + ← ENNReal.ofReal_add (add_nonneg (mul_nonneg hnχ (hup _).le) (mul_nonneg (sub_nonneg.mpr hleh) (hup _).le)) + (by have hc := endpointConstant_nonneg q B; have hd := d_nonneg z.1; positivity)] + apply ENNReal.ofReal_le_ofReal + by_cases hχ : 0 < lineWeight volume (source u q B) κ δ (e,z) + · have hs := source_endpoint_error hn hu hup hq hκ hκ1 hδ hχ + have hp := pressure_recovery_pointwise hnχ hleh hr.1 hs + change _ ≤ _ at hp + dsimp only [sourceRoot] at * + nlinarith + · have hzero := le_antisymm (not_lt.mp hχ) hnχ + rw [hzero] + have hc := endpointConstant_nonneg q B + have hd := d_nonneg z.1 + have htail : 0 ≤ endpointConstant q B*δ*d z.1*weight volume κ e z.1*u z.1 := by positivity + nlinarith [mul_nonneg hh hr.1] + +end HenonLaneEmden.SpatialComponents +end +end RootRecovery + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Scaling.lean b/lean/OAI/Analysis/HenonEmden/Scaling.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1963fb1f69a661901dfb2d1b181e46b09308d2f --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Scaling.lean @@ -0,0 +1,153 @@ +import OAI.Analysis.HenonEmden.Mollification + +namespace OAI + +universe uE + +section Scaling + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +noncomputable section + +open Set Filter Topology +namespace HenonLaneEmden + + +noncomputable def alpha (p q A B : ℝ) := (2+A+p*(2+B))/(p*q-1) +noncomputable def beta (p q A B : ℝ) := (2+B+q*(2+A))/(p*q-1) + +lemma scaling_relations {p q A B : ℝ} (hpq : 1 < p*q) : + p*beta p q A B = alpha p q A B+2+A ∧ + q*alpha p q A B = beta p q A B+2+B := by + unfold alpha beta + have h : p*q-1 ≠ 0 := ne_of_gt (sub_pos.mpr hpq) + constructor + · field_simp [h] + ring + · have h' : q*p-1 ≠ 0 := by simpa [mul_comm] using h + field_simp [h, h'] + ring + +lemma alpha_pos {p q A B : ℝ} (hp : 0 < p) (hA : -2 < A) (hB : -2 < B) + (hpq : 1 < p*q) : 0 < alpha p q A B := by + apply div_pos _ (sub_pos.mpr hpq) + exact add_pos (by linarith) (mul_pos hp (by linarith)) + +lemma beta_pos {p q A B : ℝ} (hq : 0 < q) (hA : -2 < A) (hB : -2 < B) + (hpq : 1 < p*q) : 0 < beta p q A B := by + apply div_pos _ (sub_pos.mpr hpq) + exact add_pos (by linarith) (mul_pos hq (by linarith)) + +lemma subcritical_scaling_exponent {n : ℕ} {p q A B : ℝ} + (hp : 0 < p) (hq : 0 < q) (hpq : 1 < p*q) (hsub : Subcritical n p q A B) : + 0 < alpha p q A B + beta p q A B + 2 - (n : ℝ) := by + have hp1 : 0 < p+1 := by linarith + have hq1 : 0 < q+1 := by linarith + have hden : 0 < p*q-1 := sub_pos.mpr hpq + have hid : ((n : ℝ)+A)/(p+1) + ((n : ℝ)+B)/(q+1) - ((n : ℝ)-2) = + (p*q-1)/((p+1)*(q+1)) * (alpha p q A B+beta p q A B+2-(n : ℝ)) := by + unfold alpha beta + field_simp + ring + unfold Subcritical at hsub + have hleft : 0 < ((n : ℝ)+A)/(p+1) + ((n : ℝ)+B)/(q+1) - ((n : ℝ)-2) := + by simpa only [one_add_one_eq_two] using (sub_pos.mpr hsub) + rw [hid] at hleft + exact pos_of_mul_pos_right hleft (div_nonneg hden.le (mul_pos hp1 hq1).le) + +section LaplacianScaling +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + +lemma laplacian_comp_dilation (f : E → ℝ) {R : ℝ} (hR : R ≠ 0) (x : E) : + Laplacian.laplacian (fun y => f (R • y)) x = R^2 * Laplacian.laplacian f (R • x) := by + let g : E ≃L[ℝ] E := (Units.mk0 R hR) • ContinuousLinearEquiv.refl ℝ E + have hg (y : E) : g y = R • y := by simp [g] + have hi := g.iteratedFDerivWithin_comp_right f uniqueDiffOn_univ (x := x) (mem_univ _) 2 + simp only [preimage_univ, iteratedFDerivWithin_univ] at hi + rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis, + InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis] + dsimp only + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + have heq : (fun y => f (R • y)) = f ∘ g := by ext y; simp [hg] + rw [heq, hi] + simp only [ContinuousMultilinearMap.compContinuousLinearMap_apply, ContinuousLinearEquiv.coe_coe, hg] + -- The pointwise vector family is factored by multilinearity. + convert (iteratedFDeriv ℝ 2 f (R • x)).map_smul_univ (fun _ : Fin 2 => R) + ![stdOrthonormalBasis ℝ E i, stdOrthonormalBasis ℝ E i] using 1 + simp [pow_two, smul_eq_mul] + +end LaplacianScaling + +noncomputable def dilation {n : ℕ} (u : Space n → ℝ) (a R : ℝ) : Space n → ℝ := + fun x => R^a*u (R • x) + +lemma dilation_regular {n : ℕ} {u : Space n → ℝ} (a : ℝ) {R : ℝ} (hR : 0 < R) + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n))) : + ContDiffOn ℝ 2 (dilation u a R) ({0}ᶜ : Set (Space n)) := by + apply contDiffOn_const.mul + apply hu.comp (ContDiff.const_smul R contDiff_id).contDiffOn + intro x hx + exact smul_ne_zero (ne_of_gt hR) hx + +lemma dilation_equation {n : ℕ} {u v : Space n → ℝ} {p A a b R : ℝ} + (hR : 0 < R) (hrel : p*b = a+2+A) + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n))) (hv : ∀ x, 0 < v x) + (heq : ∀ x, x ≠ 0 → -(Laplacian.laplacian u) x = ‖x‖^A*(v x)^p) + (x : Space n) (hx : x ≠ 0) : + -(Laplacian.laplacian (dilation u a R)) x = ‖x‖^A*(dilation v b R x)^p := by + have hxR : R • x ≠ 0 := smul_ne_zero (ne_of_gt hR) hx + have hu' : ContDiffAt ℝ 2 (fun y => u (R • y)) x := by + apply (hu.contDiffAt ((isClosed_singleton.isOpen_compl).mem_nhds hxR)).comp x + exact (ContDiff.const_smul R contDiff_id).contDiffAt + have hLap : Laplacian.laplacian (dilation u a R) x = + R^a*(R^2*Laplacian.laplacian u (R • x)) := by + change Laplacian.laplacian (R^a • (fun y => u (R • y))) x = _ + rw [InnerProductSpace.laplacian_smul (R^a) hu', laplacian_comp_dilation u (ne_of_gt hR)] + rfl + have hscale : R^a*R^2*R^A = (R^b)^p := by + rw [← Real.rpow_mul hR.le, mul_comm b p, hrel, Real.rpow_add hR, Real.rpow_add hR, Real.rpow_two] + rw [hLap] + calc + -(R^a*(R^2*Laplacian.laplacian u (R • x))) = + R^a*R^2*(-Laplacian.laplacian u (R • x)) := by ring + _ = R^a*R^2*(‖R • x‖^A*(v (R • x))^p) := by rw [heq _ hxR] + _ = (R^a*R^2*R^A)*‖x‖^A*(v (R • x))^p := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos hR, Real.mul_rpow hR.le (norm_nonneg x)] + ring + _ = ‖x‖^A*(dilation v b R x)^p := by + rw [hscale, dilation, Real.mul_rpow (Real.rpow_nonneg hR.le _) (hv _).le] + ring + +lemma IsSolution.dilate {n : ℕ} {p q A B : ℝ} {u v : Space n → ℝ} + (h : IsSolution n p q A B u v) (hpq : 1 < p*q) {R : ℝ} (hR : 0 < R) : + IsSolution n p q A B (dilation u (alpha p q A B) R) + (dilation v (beta p q A B) R) := by + have hrels := scaling_relations (A := A) (B := B) hpq + refine ⟨?_, ?_, dilation_regular _ hR h.regular_u, dilation_regular _ hR h.regular_v, + ?_, ?_, ?_, ?_⟩ + · exact continuous_const.mul (h.continuous_u.comp (continuous_id.const_smul R)) + · exact continuous_const.mul (h.continuous_v.comp (continuous_id.const_smul R)) + · intro x; exact mul_pos (Real.rpow_pos_of_pos hR _) (h.positive_u _) + · intro x; exact mul_pos (Real.rpow_pos_of_pos hR _) (h.positive_v _) + · exact dilation_equation hR hrels.1 h.regular_u h.positive_v h.equation_u + · exact dilation_equation hR hrels.2 h.regular_v h.positive_u h.equation_v + +end HenonLaneEmden + +end +end Scaling + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/ShortComponents.lean b/lean/OAI/Analysis/HenonEmden/ShortComponents.lean new file mode 100644 index 0000000000000000000000000000000000000000..c75622facd84deaad6fca859e727393a076641a2 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/ShortComponents.lean @@ -0,0 +1,86 @@ +import OAI.Analysis.HenonEmden.ComponentWeights + +namespace OAI + +section ShortComponents + +open MeasureTheory Set Metric +noncomputable section +namespace HenonLaneEmden.LineComponents + +lemma dist_le_component_volume {I : Set ℝ} (hI : IsPreconnected I) + {x y : ℝ} (hx : x ∈ I) (hy : y ∈ I) : + ENNReal.ofReal (dist x y) ≤ volume I := by + have hs : uIcc x y ⊆ I := hI.ordConnected.uIcc_subset hx hy + have hm := measure_mono (μ := (volume : Measure ℝ)) hs + rcases le_total x y with hxy|hyx + · simpa only [uIcc_of_le hxy,Real.volume_Icc,Real.dist_eq,abs_of_nonpos (sub_nonpos.mpr hxy),neg_sub] using hm + · simpa only [uIcc_of_ge hyx,Real.volume_Icc,Real.dist_eq,abs_of_nonneg (sub_nonneg.mpr hyx)] using hm + +lemma dist_le_of_volume_le {I : Set ℝ} (hI : IsPreconnected I) + {x y l : ℝ} (hx : x ∈ I) (hy : y ∈ I) (hl : 0 ≤ l) + (hv : volume I ≤ ENNReal.ofReal l) : dist x y ≤ l := + (ENNReal.ofReal_le_ofReal_iff hl).mp ((dist_le_component_volume hI hx hy).trans hv) + +lemma setInf_lower {f : ℝ → ℝ} {I : Set ℝ} {b : ℝ} + (hb : ∀ y ∈ I, b ≤ f y) : ENNReal.ofReal b ≤ setInf f I := by + apply le_iInf + intro y + apply le_iInf + intro hy + exact ENNReal.ofReal_le_ofReal (hb y hy) + +/-- Every short component passes the component length test. The bound +on `d` is kept intrinsic, so no choice of coordinates enters the statement. -/ +lemma short_setWeight_eq {I : Set ℝ} (hI : I.Nonempty) + {h d : ℝ → ℝ} {δ d₀ l : ℝ} (hδ : 0 ≤ δ) (hδ' : δ ≤ 1/2) + (hd₀ : 0 ≤ d₀) (_hl : 0 ≤ l) (hl' : l ≤ δ*d₀) + (hv : volume I ≤ ENNReal.ofReal l) (hd : ∀ y ∈ I, d₀-l ≤ d y) : + setWeight h d δ I = setInf h I := by + have hlow : 0 ≤ d₀-l := by nlinarith + have hlen : l ≤ 2*δ*(d₀-l) := by + have h1 : l ≤ d₀/2 := by nlinarith + nlinarith [mul_nonneg hδ (sub_nonneg.mpr h1)] + have htest : volume I ≤ ENNReal.ofReal (2*δ)*setInf d I := by + calc + _ ≤ ENNReal.ofReal l := hv + _ ≤ ENNReal.ofReal (2*δ*(d₀-l)) := ENNReal.ofReal_le_ofReal hlen + _ = ENNReal.ofReal (2*δ)*ENNReal.ofReal (d₀-l) := ENNReal.ofReal_mul (by positivity) + _ ≤ _ := mul_le_mul_right (setInf_lower hd) _ + exact ite_eq_left ⟨hI,ne_top_of_le_ne_top ENNReal.ofReal_ne_top hv,htest⟩ + +lemma setInf_oscillation {I : Set ℝ} {h : ℝ → ℝ} {x ε : ℝ} + (hx : x ∈ I) (_hh : 0 ≤ h x) (hb : ∀ y ∈ I, |h x-h y| ≤ ε) : + h x-(setInf h I).toReal ≤ ε := by + have hfin := ne_top_of_le_ne_top ENNReal.ofReal_ne_top (setInf_le (f := h) hx) + have hlo : ENNReal.ofReal (h x-ε) ≤ setInf h I := by + apply setInf_lower + intro y hy + have := (abs_le.mp (hb y hy)).2 + linarith + have ht := ENNReal.toReal_mono hfin hlo + rw [ENNReal.toReal_ofReal'] at ht + have hm := le_max_left (h x-ε) 0 + linarith + +lemma short_component_loss {U : Set ℝ} (_hU : IsOpen U) {x : ℝ} (hx : x ∈ U) + {h d : ℝ → ℝ} {δ l ε : ℝ} (hδ : 0 ≤ δ) (hδ' : δ ≤ 1/2) + (hd₀ : 0 ≤ d x) (hh : 0 ≤ h x) (hl : 0 ≤ l) (hl' : l ≤ δ*d x) + (hv : volume (connectedComponentIn U x) ≤ ENNReal.ofReal l) + (hd : ∀ y, dist y x ≤ l → d x-dist y x ≤ d y) + (hosc : ∀ y, dist y x ≤ l → |h x-h y| ≤ ε) : + h x-(setWeight h d δ (connectedComponentIn U x)).toReal ≤ ε := by + have hxi := mem_connectedComponentIn hx + have hdist (y : ℝ) (hy : y ∈ connectedComponentIn U x) : dist y x ≤ l := + dist_le_of_volume_le isPreconnected_connectedComponentIn hy hxi hl hv + rw [short_setWeight_eq ⟨x,hxi⟩ hδ hδ' hd₀ hl hl' hv (by + intro y hy + have hh := hd y (hdist y hy) + linarith [hdist y hy])] + exact setInf_oscillation hxi hh (fun y hy => hosc y (hdist y hy)) + +end HenonLaneEmden.LineComponents +end +end ShortComponents + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/SourceEndpoints.lean b/lean/OAI/Analysis/HenonEmden/SourceEndpoints.lean new file mode 100644 index 0000000000000000000000000000000000000000..367ed88fbdcb251595f9d4a9eb39e8783bac6adc --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/SourceEndpoints.lean @@ -0,0 +1,69 @@ +import OAI.Analysis.HenonEmden.SpatialEndpoints + +namespace OAI + +section SourceEndpoints + +open MeasureTheory Set Metric +noncomputable section +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap WeightedLayers + + def endpointConstant (q B : ℝ) : ℝ := 2*(|-B/q| *2^|-B/q-1| *2^|-B/q|) +lemma endpointConstant_nonneg (q B : ℝ) : 0 ≤ endpointConstant q B := by + unfold endpointConstant; positivity + +def endpointAverage {n : ℕ} (u : Space n → ℝ) (f : Space n → ℝ) + (z : sphere (0:Space n) 1 × (Space n × ℝ)) : ℝ := + (u (lowerPoint f z)+u (upperPoint f z))/2 + +lemma measurable_endpointAverage {n : ℕ} {u f : Space n → ℝ} (hu : Measurable u) + (hf : IsOpen {z : Space n × ℝ | 0 < z.2 ∧ z.2 < f z.1}) : + Measurable (endpointAverage u f) := + ((hu.comp (measurable_lowerPoint hf)).add (hu.comp (measurable_upperPoint hf))).div_const 2 + +lemma source_endpoint_error {n : ℕ} (hn : 1 ≤ n) {u : Space n → ℝ} {q B κ δ : ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n))) (hup : ∀ x, 0 < u x) + (hq : 0 < q) (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) + {z : sphere (0:Space n) 1 × (Space n × ℝ)} + (hχ : 0 < lineWeight volume (source u q B) κ δ z) : + |endpointAverage u (source u q B) z-(z.2.2/‖z.2.1‖^B)^(1/q)| ≤ + endpointConstant q B*δ*d z.2.1*u z.2.1 := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hf := isOpen_source_subgraph hu hup q B + have hfc (y : Space n) (hy : y ≠ 0) : ContinuousAt (source u q B) y := + (regular_source hu hup q B).continuousOn.continuousAt (isClosed_singleton.isOpen_compl.mem_nhds hy) + have hb := positive_lineWeight_base volume hχ + have hw : 0 < weight volume κ z.1 z.2.1 := hχ.trans_le (lineWeight_le volume _ κ δ z) + have hx1 : 1 < ‖z.2.1‖ := by + by_contra hh + rw [weight_inner volume κ z.1 (not_lt.mp hh)] at hw + exact lt_irrefl _ hw + have hx2 : ‖z.2.1‖ < 2 := by + by_contra hh + rw [weight_outer volume κ z.1 (not_lt.mp hh)] at hw + exact lt_irrefl _ hw + have hx0 : z.2.1 ≠ 0 := norm_ne_zero_iff.mp (by linarith) + have hroot := layer_root_bounds (Real.rpow_pos_of_pos (norm_pos_iff.mpr hx0) B) + (hup z.2.1) hq hb.1.le (by rw [← source_off_zero _ _ _ hx0]; exact hb.2.1.le) + have he (s : ℝ) (hs : s=lowerOffset (source u q B) z ∨ s=upperOffset (source u q B) z) : + |u (z.2.1+s • z.1.1)-(z.2.2/‖z.2.1‖^B)^(1/q)| ≤ + endpointConstant q B*δ*d z.2.1*u z.2.1 := by + obtain ⟨hy1,hy2,hlev,hdist⟩ := endpoint_spec volume hf hfc hκ hκ1 hδ hχ hs + have hy0 : z.2.1+s • z.1.1 ≠ 0 := norm_ne_zero_iff.mp (by linarith) + rw [source_level_root hq hup hy0 hlev] + have hh := radial_layer_endpoint_error (q := q) (B := B) ⟨hx1.le,hx2.le⟩ ⟨hy1.le,hy2.le⟩ hb.1.le + calc + _ ≤ (|-B/q| *2^|-B/q-1| *2^|-B/q|)*dist (z.2.1+s • z.1.1) z.2.1* + (z.2.2/‖z.2.1‖^B)^(1/q) := hh + _ ≤ (|-B/q| *2^|-B/q-1| *2^|-B/q|)*(2*δ*d z.2.1)*u z.2.1 := by + have hd0 := d_nonneg z.2.1 + exact mul_le_mul (mul_le_mul_of_nonneg_left hdist (by positivity)) hroot.2 hroot.1 (by positivity) + _ = _ := by unfold endpointConstant; ring + exact average_endpoint_error (he _ (Or.inl rfl)) (he _ (Or.inr rfl)) + +end HenonLaneEmden.SpatialComponents +end +end SourceEndpoints + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/SourceMass.lean b/lean/OAI/Analysis/HenonEmden/SourceMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..2dfd58711bc5c83b32696f7daf5f589f7edaa685 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/SourceMass.lean @@ -0,0 +1,230 @@ +import OAI.Analysis.HenonEmden.NewtonPotential + +namespace OAI + +universe uE + +section SourceMass + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +open Set Filter Topology +open MeasureTheory Set Filter Topology +open scoped ContDiff +noncomputable section + + +namespace HenonLaneEmden +open WeakPDE +lemma IsSolution.rawPotential_lower_u {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (x : Space n) : + rawPotential (source v p A) x ≤ newtonDenom n*u x := by + have hp : ∀ y, 0 ≤ ‖x-y‖^(2-(n:ℝ))*source v p A y := fun y => + mul_nonneg (Real.rpow_nonneg (norm_nonneg _) _) (source_nonneg (fun z => (h.positive_v z).le) p A y) + have hh := ENNReal.toReal_mono ENNReal.ofReal_ne_top (h.newton_lower_u hn x) + rw [ENNReal.toReal_ofReal (mul_nonneg (newtonDenom_pos (h.dimension_ge_three hn)).le (h.positive_u x).le), + ← integral_eq_lintegral_of_nonneg_ae (Eventually.of_forall hp) (h.kernel_g_integrable hn x).aestronglyMeasurable] at hh + simpa only [rawPotential,finrank_euclideanSpace_fin] using hh + +lemma IsSolution.potential_constant_u {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) : + ∃ c : ℝ, 0 ≤ c ∧ ∀ᵐ x, newtonDenom n*u x = rawPotential (source v p A) x+c := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + simpa only [finrank_euclideanSpace_fin,newtonDenom,sphereArea] using + potential_constant (by simpa using h.dimension_ge_three hn) h.continuous_u + (measurable_source h.continuous_v p A) (source_nonneg (fun y => (h.positive_v y).le) p A) + (by simpa only [finrank_euclideanSpace_fin] using h.kernel_g_integrable hn) + (by simpa only [finrank_euclideanSpace_fin,newtonDenom,sphereArea] using h.rawPotential_lower_u hn) + (fun _ hφ hφc => h.weak_u hn hφ hφc) +end HenonLaneEmden + +namespace HenonLaneEmden.WeakPDE +open scoped Pointwise +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +lemma rawPotential_ball_lower (hn : 3 ≤ Module.finrank ℝ E) {g : E → ℝ} + (hg : LocallyIntegrable g) (hp : ∀ x, 0 ≤ g x) + (hki : ∀ x, Integrable (fun y => ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y)) + {R : ℝ} (_hR : 0 < R) {x : E} (hx : x ∈ Metric.closedBall (0:E) R) : + (2*R)^(2-(Module.finrank ℝ E:ℝ))*(∫ y in Metric.ball (0:E) R, g y) ≤ rawPotential g x := by + have hgi : IntegrableOn g (Metric.ball (0:E) R) := + (hg.integrableOn_isCompact (isCompact_closedBall (0:E) R)).mono_set Metric.ball_subset_closedBall + have h1 : (2*R)^(2-(Module.finrank ℝ E:ℝ))*(∫ y in Metric.ball (0:E) R, g y) ≤ + ∫ y in Metric.ball (0:E) R, ‖x-y‖^(2-(Module.finrank ℝ E:ℝ))*g y := by + rw [← integral_const_mul] + apply integral_mono_ae (hgi.const_mul _) (hki x).integrableOn + filter_upwards [ae_restrict_mem measurableSet_ball, + ae_restrict_of_ae (ae_iff.mpr (show volume {y : E | ¬ y ≠ x} = 0 by simp))] with y hy hyx + apply mul_le_mul_of_nonneg_right _ (hp y) + apply Real.rpow_le_rpow_of_nonpos (norm_pos_iff.mpr (sub_ne_zero.mpr (Ne.symm hyx))) + · have hh := norm_sub_le x y + have hx' : ‖x‖ ≤ R := by simpa using hx + have hy' : ‖y‖ < R := by simpa using hy + linarith + · have hnreal : (3:ℝ) ≤ Module.finrank ℝ E := by exact_mod_cast hn + linarith + exact h1.trans (setIntegral_le_integral (hki x) + (Eventually.of_forall fun y => mul_nonneg (Real.rpow_nonneg (norm_nonneg _) _) (hp y))) + +omit [Nontrivial E] in +lemma ball_integral_dilation (f : E → ℝ) {R : ℝ} (hR : 0 < R) : + (∫ x in Metric.ball (0:E) R, f x) = R^(Module.finrank ℝ E)* + (∫ x in Metric.ball (0:E) 1, f (R • x)) := by + have hs : R • Metric.ball (0:E) 1 = Metric.ball (0:E) R := by + ext x + rw [mem_smul_set_iff_inv_smul_mem₀ hR.ne'] + simp only [Metric.mem_ball,dist_zero_right,norm_smul,Real.norm_eq_abs, + abs_of_pos (inv_pos.mpr hR)] + rw [inv_mul_lt_iff₀ hR,mul_one] + have hh := Measure.setIntegral_comp_smul_of_pos volume f (Metric.ball (0:E) 1) hR + rw [hs,smul_eq_mul] at hh + rw [hh,mul_inv_cancel_left₀ (pow_ne_zero _ hR.ne')] + +omit [Nontrivial E] in +lemma locallyIntegrable_norm_power (hn : 1 ≤ Module.finrank ℝ E) (a : ℝ) + (ha : -(Module.finrank ℝ E:ℝ) < a) : LocallyIntegrable (fun x : E => ‖x‖^a) := by + apply locallyIntegrable_of_norm_le_rpow hn (α := -a) (C := 1) ?_ ?_ + (measurable_norm.pow_const a).aestronglyMeasurable + · linarith + · filter_upwards [] with x + simp [Real.norm_eq_abs,abs_of_nonneg (Real.rpow_nonneg (norm_nonneg x) a)] + +omit [Nontrivial E] in +lemma integral_weight_ball_scaling (a : ℝ) {R : ℝ} (hR : 0 < R) : + (∫ x in Metric.ball (0:E) R, ‖x‖^a) = + R^((Module.finrank ℝ E:ℝ)+a)*(∫ x in Metric.ball (0:E) 1, ‖x‖^a) := by + rw [ball_integral_dilation _ hR] + simp only [norm_smul,Real.norm_eq_abs,abs_of_pos hR,Real.mul_rpow hR.le (norm_nonneg _),integral_const_mul] + rw [← mul_assoc,← Real.rpow_natCast,← Real.rpow_add hR] + +lemma integral_weight_ball_pos (hn : 1 ≤ Module.finrank ℝ E) (a : ℝ) + (ha : -(Module.finrank ℝ E:ℝ) < a) {R : ℝ} (hR : 0 < R) : + 0 < ∫ x in Metric.ball (0:E) R, ‖x‖^a := by + have hi : IntegrableOn (fun x : E => ‖x‖^a) (Metric.ball (0:E) R) := + ((locallyIntegrable_norm_power hn a ha).integrableOn_isCompact (isCompact_closedBall (0:E) R)).mono_set Metric.ball_subset_closedBall + apply integral_pos_iff_support_of_nonneg_ae (Eventually.of_forall fun x => Real.rpow_nonneg (norm_nonneg x) a) hi |>.mpr + have hz : ({0}ᶜ : Set E) ⊆ Function.support (fun x : E => ‖x‖^a) := by + intro x hx + exact ne_of_gt (Real.rpow_pos_of_pos (norm_pos_iff.mpr hx) a) + apply lt_of_lt_of_le _ (measure_mono hz) + rw [Measure.restrict_apply (measurableSet_singleton _).compl, + inter_comm] + change 0 < volume (Metric.ball (0:E) R \ {0}) + rw [measure_sdiff_null (by simp)] + exact Metric.measure_ball_pos volume (0:E) hR +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden +open WeakPDE +noncomputable def sourceMass {n : ℕ} (u : Space n → ℝ) (q B R : ℝ) : ℝ := + ∫ x in Metric.ball (0:Space n) R, source u q B x +noncomputable def lowerMass {n : ℕ} (u : Space n → ℝ) (q B R : ℝ) : ℝ := + (2*R)^(2-(n:ℝ))/newtonDenom n*sourceMass u q B R +noncomputable def weightMass (n : ℕ) (B : ℝ) : ℝ := + ∫ x in Metric.ball (0:Space n) 1, ‖x‖^B +noncomputable def ballConstant (n : ℕ) : ℝ := 2^(2-(n:ℝ))/newtonDenom n + +lemma ballConstant_pos {n : ℕ} (hn : 3 ≤ n) : 0 < ballConstant n := + div_pos (Real.rpow_pos_of_pos (by norm_num) _) (newtonDenom_pos hn) + +lemma weightMass_pos {n : ℕ} (hn : 3 ≤ n) {B : ℝ} (hB : -2 < B) : 0 < weightMass n B := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + apply integral_weight_ball_pos (by simpa using (show 1 ≤ n by omega)) B _ zero_lt_one + simp only [finrank_euclideanSpace_fin] + have hnreal : (3:ℝ) ≤ n := by exact_mod_cast hn + linarith + +lemma lowerMass_eq {n : ℕ} (u : Space n → ℝ) (q B : ℝ) {R : ℝ} (hR : 0 < R) : + lowerMass u q B R = ballConstant n*R^(2-(n:ℝ))*sourceMass u q B R := by + dsimp [lowerMass,ballConstant] + rw [Real.mul_rpow (by norm_num) hR.le] + ring + +lemma IsSolution.sourceMass_g_pos {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) {R : ℝ} (hR : 0 < R) : + 0 < sourceMass v p A R := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hi : IntegrableOn (source v p A) (Metric.ball (0:Space n) R) := + ((h.source_g_locallyIntegrable hn).integrableOn_isCompact (isCompact_closedBall _ R)).mono_set Metric.ball_subset_closedBall + apply (integral_pos_iff_support_of_nonneg_ae (Eventually.of_forall (source_nonneg (fun x => (h.positive_v x).le) p A)) hi).mpr + have hz : ({0}ᶜ : Set (Space n)) ⊆ Function.support (source v p A) := fun x hx => + ne_of_gt (source_pos h.positive_v p A hx) + apply lt_of_lt_of_le _ (measure_mono hz) + rw [Measure.restrict_apply (measurableSet_singleton _).compl,inter_comm] + change 0 < volume (Metric.ball (0:Space n) R \ {0}) + rw [measure_sdiff_null (by simp)] + exact Metric.measure_ball_pos volume _ hR + +lemma IsSolution.lowerMass_g_pos {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) {R : ℝ} (hR : 0 < R) : + 0 < lowerMass v p A R := by + rw [lowerMass_eq _ _ _ hR] + exact mul_pos (mul_pos (ballConstant_pos (h.dimension_ge_three hn)) (Real.rpow_pos_of_pos hR _)) + (h.sourceMass_g_pos hn hR) + +lemma IsSolution.lowerMass_g_le {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) {R : ℝ} (hR : 0 < R) + {x : Space n} (hx : x ∈ Metric.closedBall (0:Space n) R) : lowerMass v p A R ≤ u x := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hh := rawPotential_ball_lower (by simpa using h.dimension_ge_three hn) + (h.source_g_locallyIntegrable hn) (source_nonneg (fun y => (h.positive_v y).le) p A) + (by simpa only [finrank_euclideanSpace_fin] using h.kernel_g_integrable hn) hR hx + have hl := hh.trans (h.rawPotential_lower_u hn x) + rw [lowerMass,div_mul_eq_mul_div] + apply (div_le_iff₀ (newtonDenom_pos (h.dimension_ge_three hn))).mpr + simpa only [finrank_euclideanSpace_fin,sourceMass,mul_comm (u x)] using hl + +lemma integral_source_ge_lower {n : ℕ} (hn : 3 ≤ n) {u : Space n → ℝ} {q B R M : ℝ} + (hu : Continuous u) (hup : ∀ x, 0 < u x) (hq : 0 ≤ q) (hB : -2 < B) + (hR : 0 < R) (hM : 0 ≤ M) (hbound : ∀ x ∈ Metric.ball (0:Space n) R, M ≤ u x) : + M^q*R^((n:ℝ)+B)*weightMass n B ≤ sourceMass u q B R := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + have hBn : -(n:ℝ) < B := by + have hnreal : (3:ℝ) ≤ n := by exact_mod_cast hn + linarith + have hdim : 1 ≤ Module.finrank ℝ (Space n) := by simp; omega + have hi : IntegrableOn (source u q B) (Metric.ball (0:Space n) R) := + ((locallyIntegrable_source (by omega) hu hup q B hBn).integrableOn_isCompact (isCompact_closedBall _ R)).mono_set Metric.ball_subset_closedBall + have hw : IntegrableOn (fun x : Space n => ‖x‖^B) (Metric.ball (0:Space n) R) := + ((locallyIntegrable_norm_power hdim B (by simpa using hBn)).integrableOn_isCompact (isCompact_closedBall _ R)).mono_set Metric.ball_subset_closedBall + have hscale : R^((n:ℝ)+B)*weightMass n B = ∫ x in Metric.ball (0:Space n) R, ‖x‖^B := by + simpa only [weightMass,finrank_euclideanSpace_fin] using (integral_weight_ball_scaling (E := Space n) B hR).symm + rw [mul_assoc,hscale] + rw [← integral_const_mul] + apply integral_mono_ae (hw.const_mul _) hi + filter_upwards [ae_restrict_mem measurableSet_ball, + ae_restrict_of_ae (ae_iff.mpr (show volume {x : Space n | ¬ x ≠ 0} = 0 by simp))] with x hx hx0 + rw [source_off_zero u q B hx0,mul_comm] + exact mul_le_mul_of_nonneg_left (Real.rpow_le_rpow hM (hbound x hx) hq) (Real.rpow_nonneg (norm_nonneg _) _) + +lemma IsSolution.lowerMass_g_coupling {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) + {R : ℝ} (hR : 0 < R) : + ballConstant n*weightMass n A*R^(2+A)*(lowerMass u q B R)^p ≤ lowerMass v p A R := by + have hh := integral_source_ge_lower (h.dimension_ge_three hn) h.continuous_v h.positive_v hp.le + (h.first_weight_gt_neg_two hn) hR (h.swap.lowerMass_g_pos hn hR).le + (fun x hx => h.swap.lowerMass_g_le hn hR (Metric.ball_subset_closedBall hx)) + have hmul := mul_le_mul_of_nonneg_left hh + (mul_nonneg (ballConstant_pos (h.dimension_ge_three hn)).le (Real.rpow_nonneg hR.le (2-(n:ℝ)))) + conv_rhs => rw [lowerMass_eq _ _ _ hR] + have he : R^(2+A) = R^(2-(n:ℝ))*R^((n:ℝ)+A) := by rw [← Real.rpow_add hR]; congr 1; ring + calc + _ = ballConstant n*R^(2-(n:ℝ)) * (lowerMass u q B R ^ p * R ^ ((n:ℝ) + A) * weightMass n A) := by rw [he]; ring + _ ≤ _ := hmul +end HenonLaneEmden + +end +end SourceMass + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Sources.lean b/lean/OAI/Analysis/HenonEmden/Sources.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5270848cf73575da8c62ea63f64d661a7eaa4bd --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Sources.lean @@ -0,0 +1,117 @@ +import OAI.Analysis.HenonEmden.Scaling + +namespace OAI + +section Sources + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +open scoped Convolution +open Set Filter Topology +noncomputable section + + +open MeasureTheory Set Filter Topology +open scoped ContDiff +namespace HenonLaneEmden + +noncomputable def source {n : ℕ} (u : Space n → ℝ) (q B : ℝ) (x : Space n) : ℝ := + if x = 0 then 0 else ‖x‖^B*(u x)^q + +lemma source_zero {n : ℕ} (u : Space n → ℝ) (q B : ℝ) : source u q B 0 = 0 := by simp [source] + +lemma source_off_zero {n : ℕ} (u : Space n → ℝ) (q B : ℝ) {x : Space n} (hx : x ≠ 0) : + source u q B x = ‖x‖^B*(u x)^q := ite_eq_right hx + +lemma measurable_source {n : ℕ} {u : Space n → ℝ} (hu : Continuous u) (q B : ℝ) : + Measurable (source u q B) := + Measurable.ite (measurableSet_singleton 0) measurable_const + ((measurable_norm.pow_const B).mul (hu.measurable.pow_const q)) + +lemma source_nonneg {n : ℕ} {u : Space n → ℝ} (hu : ∀ x, 0 ≤ u x) (q B : ℝ) (x : Space n) : + 0 ≤ source u q B x := by + unfold source + split_ifs + · exact le_rfl + · exact mul_nonneg (Real.rpow_nonneg (norm_nonneg _) _) (Real.rpow_nonneg (hu x) _) + +lemma source_pos {n : ℕ} {u : Space n → ℝ} (hu : ∀ x, 0 < u x) (q B : ℝ) {x : Space n} + (hx : x ≠ 0) : 0 < source u q B x := by + rw [source_off_zero u q B hx] + exact mul_pos (Real.rpow_pos_of_pos (norm_pos_iff.mpr hx) _) (Real.rpow_pos_of_pos (hu x) _) + +lemma regular_source {n : ℕ} {u : Space n → ℝ} (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n))) + (hupos : ∀ x, 0 < u x) (q B : ℝ) : ContDiffOn ℝ 2 (source u q B) ({0}ᶜ : Set (Space n)) := by + apply ((contDiffOn_id.norm ℝ (fun x hx => by simpa using hx)).rpow_const_of_ne + (fun x hx => norm_ne_zero_iff.mpr (by simpa using hx))).mul + (hu.rpow_const_of_ne (fun x _ => ne_of_gt (hupos x))) |>.congr + intro x hx + exact source_off_zero u q B (by simpa using hx) + +lemma locallyIntegrable_source {n : ℕ} (hn : 1 ≤ n) {u : Space n → ℝ} + (hu : Continuous u) (hupos : ∀ x, 0 < u x) (q B : ℝ) (hB : -(n : ℝ) < B) : + LocallyIntegrable (source u q B) volume := by + have hdim : 1 ≤ Module.finrank ℝ (Space n) := by simpa using hn + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by omega) + have hpow : LocallyIntegrable (fun x : Space n => ‖x‖^B) volume := by + apply locallyIntegrable_of_norm_le_rpow hdim (α := -B) (C := 1) ?_ ?_ + (measurable_norm.pow_const B).aestronglyMeasurable + · simp only [finrank_euclideanSpace_fin] + linarith + · filter_upwards [] with x + simp [Real.norm_eq_abs, abs_of_nonneg (Real.rpow_nonneg (norm_nonneg x) B)] + have hc : Continuous (fun x => (u x)^q) := hu.rpow_const (fun x => Or.inl (ne_of_gt (hupos x))) + apply (hpow.mul_continuous hc).congr + filter_upwards [ae_iff.mpr (show volume {x : Space n | ¬ x ≠ 0} = 0 by simp)] with x hx + exact (source_off_zero u q B hx).symm + +lemma IsSolution.weak_u_off_origin {n : ℕ} {p q A B : ℝ} {u v : Space n → ℝ} + (h : IsSolution n p q A B u v) {φ : Space n → ℝ} (hφ : ContDiff ℝ 2 φ) + (hφc : HasCompactSupport φ) (hφ0 : 0 ∉ tsupport φ) : + (∫ x, u x * Laplacian.laplacian φ x) = -(∫ x, source v p A x * φ x) := by + have hφs : tsupport φ ⊆ ({0}ᶜ : Set (Space n)) := by + intro x hx + simpa using fun hzero : x = 0 => hφ0 (hzero ▸ hx) + rw [WeakPDE.integral_laplacian_test isClosed_singleton.isOpen_compl h.regular_u hφ hφc hφs, + ← integral_neg] + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x ∈ tsupport φ + · have hx0 : x ≠ 0 := by simpa using hφs hx + have he : -(Laplacian.laplacian u) x = ‖x‖^A*(v x)^p := h.equation_u x hx0 + rw [source_off_zero v p A hx0, ← he] + ring + · simp [image_eq_zero_of_notMem_tsupport hx] + +lemma IsSolution.weak_v_off_origin {n : ℕ} {p q A B : ℝ} {u v : Space n → ℝ} + (h : IsSolution n p q A B u v) {φ : Space n → ℝ} (hφ : ContDiff ℝ 2 φ) + (hφc : HasCompactSupport φ) (hφ0 : 0 ∉ tsupport φ) : + (∫ x, v x * Laplacian.laplacian φ x) = -(∫ x, source u q B x * φ x) := by + have hφs : tsupport φ ⊆ ({0}ᶜ : Set (Space n)) := by + intro x hx + simpa using fun hzero : x = 0 => hφ0 (hzero ▸ hx) + rw [WeakPDE.integral_laplacian_test isClosed_singleton.isOpen_compl h.regular_v hφ hφc hφs, + ← integral_neg] + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x ∈ tsupport φ + · have hx0 : x ≠ 0 := by simpa using hφs hx + have he : -(Laplacian.laplacian v) x = ‖x‖^B*(u x)^q := h.equation_v x hx0 + rw [source_off_zero u q B hx0, ← he] + ring + · simp [image_eq_zero_of_notMem_tsupport hx] +end HenonLaneEmden + +end +end Sources + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/SpatialComponents.lean b/lean/OAI/Analysis/HenonEmden/SpatialComponents.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc866d429bac98e014ea4b4b7c7dca536324001e --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/SpatialComponents.lean @@ -0,0 +1,120 @@ +import OAI.Analysis.HenonEmden.Angular + +namespace OAI + +universe uE + +section SpatialComponents + +open MeasureTheory Set Metric +noncomputable section +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap LineComponents +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] + +def lineLayer (f : E → ℝ) : Set ((sphere (0:E) 1 × (E × ℝ)) × ℝ) := + {z | 0 < z.1.2.2 ∧ z.1.2.2 < f (z.1.2.1+z.2 • z.1.1.1)} +def lineWeight (f : E → ℝ) (κ δ : ℝ) (p : sphere (0:E) 1 × (E × ℝ)) : ℝ := + (componentWeight (lineLayer f) (fun z => weight μ κ z.1.1 (z.1.2.1+z.2 • z.1.1.1)) + (fun z => d (z.1.2.1+z.2 • z.1.1.1)) δ p).toReal + +omit [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] in +lemma isOpen_lineLayer {f : E → ℝ} (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) : + IsOpen (lineLayer f) := by + exact hf.preimage (show Continuous (fun z : (sphere (0:E) 1 × (E × ℝ)) × ℝ => + (z.1.2.1+z.2 • z.1.1.1,z.1.2.2)) by fun_prop) + +lemma measurable_lineWeight {f : E → ℝ} (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (δ : ℝ) : + Measurable (lineWeight μ f κ δ) := by + unfold lineWeight + apply Measurable.ennreal_toReal + apply measurable_componentWeight (isOpen_lineLayer hf) + · exact (measurable_weight μ hκ hκ1).comp + (show Measurable (fun z : (sphere (0:E) 1 × (E × ℝ)) × ℝ => + (z.1.1,z.1.2.1+z.2 • z.1.1.1)) by fun_prop) + · exact continuous_d.measurable.comp + (show Measurable (fun z : (sphere (0:E) 1 × (E × ℝ)) × ℝ => + z.1.2.1+z.2 • z.1.1.1) by fun_prop) + +omit [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] [μ.IsAddHaarMeasure] in +lemma lineWeight_nonneg (f : E → ℝ) (κ δ : ℝ) (p : sphere (0:E) 1 × (E × ℝ)) : + 0 ≤ lineWeight μ f κ δ p := ENNReal.toReal_nonneg + +omit [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] [μ.IsAddHaarMeasure] in +lemma lineWeight_le (f : E → ℝ) (κ δ : ℝ) (p : sphere (0:E) 1 × (E × ℝ)) : + lineWeight μ f κ δ p ≤ weight μ κ p.1 p.2.1 := by + have he := componentWeight_le_base + (U := lineLayer f) (fun z => weight μ κ z.1.1 (z.1.2.1+z.2 • z.1.1.1)) + (fun z => d (z.1.2.1+z.2 • z.1.1.1)) δ p + have hr := ENNReal.toReal_mono ENNReal.ofReal_ne_top he + simpa only [lineWeight,zero_smul,add_zero,ENNReal.toReal_ofReal (weight_nonneg μ _ _ _)] using hr + +lemma lineWeight_eq_setWeight {f : E → ℝ} + (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (δ : ℝ) (e : sphere (0:E) 1) + (x : E) (t : ℝ) : + lineWeight μ f κ δ (e,x,t) = + (setWeight (fun s => weight μ κ e (x+s • (e:E))) (fun s => d (x+s • (e:E))) δ + (connectedComponentIn {s | 0 < t ∧ t < f (x+s • (e:E))} 0)).toReal := by + have hh : Continuous (fun s : ℝ => weight μ κ e (x+s • (e:E))) := + (continuous_weight μ hκ hκ1 e).comp (by fun_prop) + have hd : Continuous (fun s : ℝ => d (x+s • (e:E))) := continuous_d.comp (by fun_prop) + exact congrArg ENNReal.toReal (componentWeight_eq_setWeight (isOpen_lineLayer hf) + (p := (e,x,t)) + (h := fun z => weight μ κ z.1.1 (z.1.2.1+z.2 • z.1.1.1)) + (d := fun z => d (z.1.2.1+z.2 • z.1.1.1)) hh hd δ) + +omit [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] in +lemma dist_line (e : sphere (0:E) 1) (x : E) (s t : ℝ) : + dist (x+s • (e:E)) (x+t • (e:E)) = dist s t := by + have hn : ‖(e:E)‖ = 1 := by simpa only [mem_sphere,dist_zero_right] using e.2 + rw [dist_eq_norm,show x+s • (e:E)-(x+t • (e:E)) = (s-t) • (e:E) by module, + norm_smul,hn,mul_one,Real.norm_eq_abs,Real.dist_eq] + +lemma short_loss {f : E → ℝ} + (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + {κ δ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1/2) + (e : sphere (0:E) 1) {x : E} (hd : 0 < d x) {t : ℝ} (ht : 0 < t) (htf : t < f x) + (hlen : componentLength (lineLayer f) (e,x,t) ≤ + ENNReal.ofReal (δ*(d x)^(m (Module.finrank ℝ E)))) : + weight μ κ e x-lineWeight μ f κ δ (e,x,t) ≤ + oscillationConstant μ κ*δ*(d x)^(N (Module.finrank ℝ E)) := by + let U := {s : ℝ | 0 < t ∧ t < f (x+s • (e:E))} + have hU : IsOpen U := isOpen_section (isOpen_lineLayer hf) (e,x,t) + have h0 : 0 ∈ U := by simpa only [U,Set.mem_ofPred_eq,zero_smul,add_zero] using And.intro ht htf + have hvol : volume (connectedComponentIn U 0) ≤ ENNReal.ofReal (δ*(d x)^(m (Module.finrank ℝ E))) := by + have hh := volume_component_all (isOpen_lineLayer hf) (show ((e,x,t),0) ∈ lineLayer f from h0) + exact hh.trans_le hlen + rw [lineWeight_eq_setWeight μ hf hκ hκ1] + have hd0 : d (x+(0:ℝ) • (e:E)) = d x := by rw [zero_smul,add_zero] + have hh0 : weight μ κ e (x+(0:ℝ) • (e:E)) = weight μ κ e x := by rw [zero_smul,add_zero] + have hp := pow_d_le_self x (show 1 ≤ m (Module.finrank ℝ E) by unfold m; omega) + have he := short_component_loss hU h0 hδ hδ1 (by rw [hd0]; exact hd.le) + (weight_nonneg μ κ e _) (mul_nonneg hδ (pow_nonneg hd.le _)) + (by rw [hd0]; exact mul_le_mul_of_nonneg_left hp hδ) hvol + (h := fun s => weight μ κ e (x+s • (e:E))) + (d := fun s => d (x+s • (e:E))) + (ε := oscillationConstant μ κ*δ*(d x)^(N (Module.finrank ℝ E))) + (by + intro s hs + have hh := (abs_le.mp (d_oscillation x (x+s • (e:E)))).2 + have hdist : dist x (x+s • (e:E)) = dist s 0 := by + simpa only [zero_smul,add_zero,dist_comm] using dist_line e x 0 s + rw [hd0] + rw [hdist] at hh + linarith) + (by + intro s hs + rw [hh0] + apply weight_short_oscillation μ hκ hκ1 hδ hδ1 hd _ e + simpa only [← dist_line e x s 0,zero_smul,add_zero,dist_comm] using hs) + simpa only [hh0] using he + +end HenonLaneEmden.SpatialComponents +end +end SpatialComponents + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/SpatialEndpoints.lean b/lean/OAI/Analysis/HenonEmden/SpatialEndpoints.lean new file mode 100644 index 0000000000000000000000000000000000000000..98dabbaf938dc3049f86d5e822aa893a8ac77ba3 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/SpatialEndpoints.lean @@ -0,0 +1,101 @@ +import OAI.Analysis.HenonEmden.WeightedEndpoints + +namespace OAI + +universe uE + +section SpatialEndpoints + +open MeasureTheory Set Metric +noncomputable section +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap LineComponents WeightedLayers +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] + +def lowerOffset (f : E → ℝ) (p : sphere (0:E) 1 × (E × ℝ)) : ℝ := + -(backwardExit (lineLayer f) p).toReal +def upperOffset (f : E → ℝ) (p : sphere (0:E) 1 × (E × ℝ)) : ℝ := + (forwardExit (lineLayer f) p).toReal +def lowerPoint (f : E → ℝ) (p : sphere (0:E) 1 × (E × ℝ)) : E := + p.2.1+lowerOffset f p • p.1.1 +def upperPoint (f : E → ℝ) (p : sphere (0:E) 1 × (E × ℝ)) : E := + p.2.1+upperOffset f p • p.1.1 + +omit [Nontrivial E] in +lemma measurable_lowerPoint {f : E → ℝ} (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) : + Measurable (lowerPoint f) := + measurable_snd.fst.add (((measurable_backwardExit (isOpen_lineLayer hf)).ennreal_toReal.neg).smul measurable_fst.subtype_val) +omit [Nontrivial E] in +lemma measurable_upperPoint {f : E → ℝ} (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) : + Measurable (upperPoint f) := + measurable_snd.fst.add (((measurable_forwardExit (isOpen_lineLayer hf)).ennreal_toReal).smul measurable_fst.subtype_val) + +omit [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] [μ.IsAddHaarMeasure] in +lemma positive_lineWeight_base {f : E → ℝ} {κ δ : ℝ} {p : sphere (0:E) 1 × (E × ℝ)} + (hχ : 0 < lineWeight μ f κ δ p) : + 0 < p.2.2 ∧ p.2.2 < f p.2.1 ∧ componentLength (lineLayer f) p ≠ ⊤ := by + unfold lineWeight componentWeight at hχ + split_ifs at hχ with hh + · have hb := hh.1 + simp only [lineLayer,Set.mem_ofPred_eq,zero_smul,add_zero] at hb + exact ⟨hb.1,hb.2,hh.2.1⟩ + · simp at hχ + +lemma endpoint_spec {f : E → ℝ} + (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + (hfc : ∀ y ≠ 0, ContinuousAt f y) {κ δ : ℝ} + (hκ : 0 < κ) (hκ1 : κ ≤ 1) (hδ : 0 ≤ δ) + {p : sphere (0:E) 1 × (E × ℝ)} (hχ : 0 < lineWeight μ f κ δ p) + {s : ℝ} (hs : s=lowerOffset f p ∨ s=upperOffset f p) : + 1 < ‖p.2.1+s • p.1.1‖ ∧ ‖p.2.1+s • p.1.1‖ < 2 ∧ + f (p.2.1+s • p.1.1)=p.2.2 ∧ dist (p.2.1+s • p.1.1) p.2.1 ≤ 2*δ*d p.2.1 := by + obtain ⟨ht,htf,hfin⟩ := positive_lineWeight_base μ hχ + let U := {s : ℝ | 0 < p.2.2 ∧ p.2.2 < f (p.2.1+s • p.1.1)} + have hp : (p,0) ∈ lineLayer f := by simpa only [lineLayer,Set.mem_ofPred_eq,zero_smul,add_zero] using And.intro ht htf + have he : connectedComponentIn U 0 = Ioo (lowerOffset f p) (upperOffset f p) := + component_eq_Ioo (isOpen_lineLayer hf) hp (ENNReal.add_ne_top.mp hfin).1 (ENNReal.add_ne_top.mp hfin).2 + have h0 : 0 ∈ U := hp + have h0I := mem_connectedComponentIn h0 + have hab : lowerOffset f p < upperOffset f p := by + rw [he] at h0I + exact h0I.1.trans h0I.2 + have hsc : s ∈ closure (connectedComponentIn U 0) := by + rw [he,closure_Ioo hab.ne] + rcases hs with rfl | rfl <;> exact ⟨by linarith,by linarith⟩ + have hwe : lineWeight μ f κ δ p = (setWeight (fun r => weight μ κ p.1 (p.2.1+r • p.1.1)) + (fun r => d (p.2.1+r • p.1.1)) δ (connectedComponentIn U 0)).toReal := + lineWeight_eq_setWeight μ hf hκ hκ1 δ p.1 p.2.1 p.2.2 + have hle := setWeight_le_on_closure (d := fun r => d (p.2.1+r • p.1.1)) (δ := δ) + ((continuous_weight μ hκ hκ1 p.1).comp (show Continuous (fun r : ℝ => p.2.1+r • p.1.1) by fun_prop)) + (fun r _ => weight_nonneg μ κ p.1 _) hsc + simp only [Function.comp_def] at hle + rw [← hwe] at hle + have hw : 0 < weight μ κ p.1 (p.2.1+s • p.1.1) := hχ.trans_le hle + have h1 : 1 < ‖p.2.1+s • p.1.1‖ := by + by_contra hh + rw [weight_inner μ κ p.1 (not_lt.mp hh)] at hw + exact lt_irrefl _ hw + have h2 : ‖p.2.1+s • p.1.1‖ < 2 := by + by_contra hh + rw [weight_outer μ κ p.1 (not_lt.mp hh)] at hw + exact lt_irrefl _ hw + have hy0 : p.2.1+s • p.1.1 ≠ 0 := norm_ne_zero_iff.mp (by linarith) + have hval : f (p.2.1+s • p.1.1)=p.2.2 := + value_eq_level_at_endpoint (O := {r : ℝ | 0 < p.2.2}) h0 he hs ht + ((hfc _ hy0).comp (f := fun r : ℝ => p.2.1+r • p.1.1) (show ContinuousAt (fun r : ℝ => p.2.1+r • p.1.1) s by fun_prop)) + have hdist := endpoints_distance_bound he (mem_connectedComponentIn h0) hδ + (d_nonneg (p.2.1+(0:ℝ) • p.1.1)) (by rw [← hwe]; exact hχ) + simp only [zero_smul,add_zero,sub_zero] at hdist + have hd : |s| ≤ 2*δ*d p.2.1 := hs.elim (fun hh => hh ▸ hdist.1) (fun hh => hh ▸ hdist.2) + refine ⟨h1,h2,hval,?_⟩ + have hd' := dist_line p.1 p.2.1 s 0 + simp only [zero_smul,add_zero,Real.dist_eq,sub_zero] at hd' + exact hd'.trans_le hd + +end HenonLaneEmden.SpatialComponents +end +end SpatialEndpoints + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/SpatialPressure.lean b/lean/OAI/Analysis/HenonEmden/SpatialPressure.lean new file mode 100644 index 0000000000000000000000000000000000000000..42de11d97337ee01526e48fca2fa7c1308498a59 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/SpatialPressure.lean @@ -0,0 +1,121 @@ +import OAI.Analysis.HenonEmden.Interaction + +namespace OAI + +universe uX uY uX2 uY2 uX3 uY3 uX4 uY4 uE + +section SpatialPressure + +open MeasureTheory Set Metric +open scoped ENNReal InnerProductSpace +noncomputable section +namespace HenonLaneEmden.LineComponents + +lemma forwardExit_congr_section {X : Type uX} {Y : Type uY} {U : Set (X × ℝ)} {V : Set (Y × ℝ)} + {x : X} {y : Y} (he : ∀ s, (x,s) ∈ U ↔ (y,s) ∈ V) : + forwardExit U x = forwardExit V y := by + classical + unfold forwardExit SegmentInside + simp_rw [he] +lemma backwardExit_congr_section {X : Type uX2} {Y : Type uY2} {U : Set (X × ℝ)} {V : Set (Y × ℝ)} + {x : X} {y : Y} (he : ∀ s, (x,s) ∈ U ↔ (y,s) ∈ V) : + backwardExit U x = backwardExit V y := by + classical + unfold backwardExit SegmentInside + simp_rw [he] +lemma componentInf_congr_section {X : Type uX3} {Y : Type uY3} {U : Set (X × ℝ)} {V : Set (Y × ℝ)} + {x : X} {y : Y} {f : X × ℝ → ℝ} {g : Y × ℝ → ℝ} + (he : ∀ s, (x,s) ∈ U ↔ (y,s) ∈ V) (hv : ∀ s, f (x,s)=g (y,s)) : + componentInf U f x = componentInf V g y := by + classical + unfold componentInf SegmentInside + simp_rw [he,hv] +lemma componentWeight_congr_section {X : Type uX4} {Y : Type uY4} {U : Set (X × ℝ)} {V : Set (Y × ℝ)} + {x : X} {y : Y} {h d : X × ℝ → ℝ} {h' d' : Y × ℝ → ℝ} + (he : ∀ s, (x,s) ∈ U ↔ (y,s) ∈ V) (hh : ∀ s, h (x,s)=h' (y,s)) + (hd : ∀ s, d (x,s)=d' (y,s)) (δ : ℝ) : + componentWeight U h d δ x = componentWeight V h' d' δ y := by + classical + rw [componentWeight,componentWeight,componentLength,componentLength, + forwardExit_congr_section he,backwardExit_congr_section he, + componentInf_congr_section he hh,componentInf_congr_section he hd,he 0] + +end HenonLaneEmden.LineComponents +namespace HenonLaneEmden.SpatialComponents +open Cutoff AdaptiveCap LineComponents LineCoordinates LayerTonelli +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + +def coordinateLayerEquiv (e : sphere (0:E) 1) : ((transverse e × ℝ) × ℝ) ≃ᵐ (E × ℝ) := + MeasurableEquiv.prodCongr (measurableEquiv e) (MeasurableEquiv.refl ℝ) + +omit [Nontrivial E] in +lemma measurePreserving_coordinateLayer (e : sphere (0:E) 1) {f : E → ℝ} (hf : Measurable f) : + MeasurePreserving (coordinateLayerEquiv e) + (layerMeasure (volume.prod volume) (f ∘ measurableEquiv e)) (layerMeasure volume f) := by + exact ((measurePreserving e).prod (MeasurePreserving.id volume)).restrict_preimage + (measurableSet_sourceSubgraph hf) + +omit [FiniteDimensional ℝ E] [Nontrivial E] in +lemma coordinate_layer_open (e : sphere (0:E) 1) {f : E → ℝ} + (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) : + IsOpen (parameterLayer (f ∘ measurableEquiv e)) := by + exact hf.preimage (show Continuous (fun z : (transverse e × ℝ) × ℝ => + (measurableEquiv e (z.1.1,z.2),z.1.2)) by + exact ((continuous_measurableEquiv e).comp (continuous_fst.fst.prodMk continuous_snd)).prodMk continuous_fst.snd) + +lemma coordinate_sourceWeight (e : sphere (0:E) 1) {f : E → ℝ} + (hf : IsOpen {z : E × ℝ | 0 < z.2 ∧ z.2 < f z.1}) + {κ : ℝ} (hκ : 0 < κ) (hκ1 : κ ≤ 1) (δ : ℝ) (a : (transverse e × ℝ) × ℝ) : + LayerPressure.sourceWeight (f ∘ measurableEquiv e) (weight volume κ e ∘ measurableEquiv e) + (d ∘ measurableEquiv e) δ a = + lineWeight volume f κ δ (e,measurableEquiv e a.1,a.2) := by + have hhh : Continuous (fun p : (transverse e × ℝ) × ℝ => weight volume κ e (measurableEquiv e (p.1.1,p.2))) := + ((continuous_weight volume hκ hκ1 e).comp (continuous_measurableEquiv e)).comp (continuous_fst.fst.prodMk continuous_snd) + have hdd : Continuous (fun p : (transverse e × ℝ) × ℝ => d (measurableEquiv e (p.1.1,p.2))) := + (continuous_d.comp (continuous_measurableEquiv e)).comp (continuous_fst.fst.prodMk continuous_snd) + unfold LayerPressure.sourceWeight LayerPressure.lineWeight + have hre := relative_componentWeight_eq (coordinate_layer_open e hf) hhh hdd δ ((a.1.1,a.2),a.1.2) + dsimp only at hre + refine (congrArg ENNReal.toReal hre).symm.trans ?_ + unfold lineWeight + congr 1 + apply componentWeight_congr_section + · intro s + simp only [relativeLayer,parameterLayer,lineLayer,mem_ofPred_eq,Function.comp_apply,parallel] + · intro s + simp only [parallel] + · intro s + simp only [parallel] + +omit [FiniteDimensional ℝ E] [Nontrivial E] in +lemma coordinate_sourceLower (e : sphere (0:E) 1) (f : E → ℝ) (a : (transverse e × ℝ) × ℝ) : + measurableEquiv e (LayerPressure.sourceLower (f ∘ measurableEquiv e) a) = + lowerPoint f (e,measurableEquiv e a.1,a.2) := by + have he : backwardExit (relativeLayer (parameterLayer (f ∘ measurableEquiv e))) ((a.1.1,a.2),a.1.2) = + backwardExit (lineLayer f) (e,measurableEquiv e a.1,a.2) := by + apply backwardExit_congr_section + intro s + simp only [relativeLayer,parameterLayer,lineLayer,mem_ofPred_eq,Function.comp_apply,parallel] + unfold LayerPressure.sourceLower lowerEndpoint lowerPoint lowerOffset + rw [he] + simpa only [sub_eq_add_neg] using parallel e a.1 (-(backwardExit (lineLayer f) (e,measurableEquiv e a.1,a.2)).toReal) + +omit [FiniteDimensional ℝ E] [Nontrivial E] in +lemma coordinate_sourceUpper (e : sphere (0:E) 1) (f : E → ℝ) (a : (transverse e × ℝ) × ℝ) : + measurableEquiv e (LayerPressure.sourceUpper (f ∘ measurableEquiv e) a) = + upperPoint f (e,measurableEquiv e a.1,a.2) := by + have he : forwardExit (relativeLayer (parameterLayer (f ∘ measurableEquiv e))) ((a.1.1,a.2),a.1.2) = + forwardExit (lineLayer f) (e,measurableEquiv e a.1,a.2) := by + apply forwardExit_congr_section + intro s + simp only [relativeLayer,parameterLayer,lineLayer,mem_ofPred_eq,Function.comp_apply,parallel] + unfold LayerPressure.sourceUpper upperEndpoint upperPoint upperOffset + rw [he] + exact parallel e a.1 ((forwardExit (lineLayer f) (e,measurableEquiv e a.1,a.2)).toReal) + +end HenonLaneEmden.SpatialComponents +end +end SpatialPressure + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/SphereCaps.lean b/lean/OAI/Analysis/HenonEmden/SphereCaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..15c8ad5b84414eaccc0317f410d892410778b955 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/SphereCaps.lean @@ -0,0 +1,100 @@ +import OAI.Analysis.HenonEmden.CapWeights + +namespace OAI + +universe uE + +section SphereCaps + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden.CapWeights + +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] + (μ : Measure E) [μ.IsAddHaarMeasure] + +def lowerConstant : ℝ := (μ (ball (0:E) 1)).toReal / + (4^Module.finrank ℝ E * 2^(Module.finrank ℝ E-1)) / 2^(Module.finrank ℝ E) +def upperConstant : ℝ := 4^Module.finrank ℝ E*(μ (ball (0:E) 1)).toReal + +omit [BorelSpace E] [Nontrivial E] in +lemma constants_positive : 0 < lowerConstant μ ∧ 0 < upperConstant μ := by + obtain ⟨hc,hC⟩ := CapGeometry.cap_constants_pos μ + exact ⟨div_pos hc (by positivity),hC⟩ + +lemma sphere_normalizer_bounds (θ : sphere (0:E) 1) {l : ℝ} (hl : 0 < l) (hl1 : l ≤ 1) : + lowerConstant μ*l^(Module.finrank ℝ E-1) ≤ normalizer μ.toSphere θ l ∧ + normalizer μ.toSphere θ l ≤ upperConstant μ*l^(Module.finrank ℝ E-1) := by + have hb := normalizer_bounds μ.toSphere θ hl + have hlo := (CapGeometry.cap_real_bounds μ θ (by linarith : 0 < l/2) (by linarith : l/2 ≤ 1)).1 + have hhi := (CapGeometry.cap_real_bounds μ θ hl hl1).2 + refine ⟨?_,hb.2.trans hhi⟩ + have hn : Module.finrank ℝ E-1+1 = Module.finrank ℝ E := + Nat.sub_add_cancel (Module.finrank_pos : 0 < Module.finrank ℝ E) + apply le_trans _ hb.1 + convert div_le_div_of_nonneg_right hlo (by norm_num : (0:ℝ) ≤ 2) using 1 + unfold lowerConstant + have h2 : (2:ℝ)^Module.finrank ℝ E = 2^(Module.finrank ℝ E-1)*2 := by + nth_rw 1 [← hn]; rw [pow_succ] + rw [div_pow,h2] + ring + +lemma sphere_normalizer_pos (θ : sphere (0:E) 1) {l : ℝ} (hl : 0 < l) (hl1 : l ≤ 1) : + 0 < normalizer μ.toSphere θ l := + (mul_pos (constants_positive μ).1 (pow_pos hl _)).trans_le (sphere_normalizer_bounds μ θ hl hl1).1 + +/-- Oscillation of a normalized cap with comparable radii, uniformly in directions. -/ +lemma sphere_normalized_oscillation + {θ θ' : sphere (0:E) 1} {l l' ρ : ℝ} (hρ : 0 < ρ) + (hl : ρ/2 ≤ l) (hl' : ρ/2 ≤ l') (hlU : l ≤ 2*ρ) (hlU' : l' ≤ 2*ρ) + (hl1 : l ≤ 1) (hl1' : l' ≤ 1) (e : sphere (0:E) 1) : + |normalized μ.toSphere θ l e-normalized μ.toSphere θ' l' e| ≤ + (2/(lowerConstant μ/2^(Module.finrank ℝ E-1))+ + 2*(2^(Module.finrank ℝ E)*upperConstant μ)/(lowerConstant μ/2^(Module.finrank ℝ E-1))^2)* + (dist θ θ'+2*|l-l'|)/ρ^(Module.finrank ℝ E) := by + let d := Module.finrank ℝ E-1 + let c := lowerConstant μ/2^d + let C := 2^(Module.finrank ℝ E)*upperConstant μ + have hc : 0 < c := div_pos (constants_positive μ).1 (by positivity) + have hC : 0 < C := mul_pos (by positivity) (constants_positive μ).2 + have hl0 : 0 < l := (half_pos hρ).trans_le hl + have hl0' : 0 < l' := (half_pos hρ).trans_le hl' + have hZ (θ : sphere (0:E) 1) {l : ℝ} (hl : ρ/2 ≤ l) (hl1 : l ≤ 1) : + c*ρ^d ≤ normalizer μ.toSphere θ l := by + apply le_trans _ (sphere_normalizer_bounds μ θ ((half_pos hρ).trans_le hl) hl1).1 + calc + _ = lowerConstant μ*(ρ/2)^d := by rw [div_pow]; dsimp [c]; ring + _ ≤ _ := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (half_pos hρ).le hl d) (constants_positive μ).1.le + have hmu (θ : sphere (0:E) 1) {l : ℝ} (hl0 : 0 < l) (hlU : l ≤ 2*ρ) (hl1 : l ≤ 1) : + (μ.toSphere (ball θ l)).toReal ≤ upperConstant μ*(2*ρ)^d := by + exact (CapGeometry.cap_real_bounds μ θ hl0 hl1).2.trans + (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hl0.le hlU d) (constants_positive μ).2.le) + have hμ : (μ.toSphere (ball θ l)).toReal+(μ.toSphere (ball θ' l')).toReal ≤ C*ρ^d := by + apply le_trans (add_le_add (hmu θ hl0 hlU hl1) (hmu θ' hl0' hlU' hl1')) + have hn : d+1 = Module.finrank ℝ E := Nat.sub_add_cancel (Module.finrank_pos : 0 < Module.finrank ℝ E) + apply le_of_eq + dsimp [C] + rw [← hn,pow_succ,mul_pow] + ring + have hparam : (dist θ θ'+2*|l-l'|)/l ≤ 2*(dist θ θ'+2*|l-l'|)/ρ := by + calc + _ ≤ (dist θ θ'+2*|l-l'|)/(ρ/2) := div_le_div_of_nonneg_left (by positivity) (half_pos hρ) hl + _ = _ := by ring + have hh := normalized_oscillation μ.toSphere hl0 hl0' (mul_pos hc (pow_pos hρ d)) + (hZ θ hl hl1) (hZ θ' hl' hl1') hμ hparam e + apply hh.trans + have hn : d+1 = Module.finrank ℝ E := Nat.sub_add_cancel (Module.finrank_pos : 0 < Module.finrank ℝ E) + apply le_of_eq + change (1/(c*ρ^d)+C*ρ^d/(c*ρ^d)^2)*(2*(dist θ θ'+2*|l-l'|)/ρ) = + (2/c+2*C/c^2)*(dist θ θ'+2*|l-l'|)/ρ^(Module.finrank ℝ E) + rw [← hn,pow_succ] + field_simp [ne_of_gt hc,ne_of_gt hρ] + ring + +end HenonLaneEmden.CapWeights +end +end SphereCaps + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/SphereFlux.lean b/lean/OAI/Analysis/HenonEmden/SphereFlux.lean new file mode 100644 index 0000000000000000000000000000000000000000..483d0039f99ed887d95c046a232c0fcb8ba5559b --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/SphereFlux.lean @@ -0,0 +1,179 @@ +import OAI.Analysis.HenonEmden.SphereMean + +namespace OAI + +universe uE uE2 + +section SphereFlux + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +noncomputable section + + +namespace HenonLaneEmden.SphereCalculus +open HenonLaneEmden.RadialCalculus HenonLaneEmden.WeakPDE +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +omit [Nontrivial E] in +lemma continuousOn_mean_source {w : E → ℝ} (hw : ContinuousOn w ({0}ᶜ : Set E)) : + ContinuousOn (mean w) (Ioi 0) := by + apply continuousOn_integral_of_compact_support isCompact_univ + · exact hw.comp (continuous_fst.smul continuous_snd.subtype_val).continuousOn + (fun z hz => smul_sphere_ne_zero hz.1 z.2) + · exact fun _ _ _ h => (h (mem_univ _)).elim + +omit [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] in +lemma norm_smul_sphere {r : ℝ} (hr : 0 ≤ r) (θ : UnitSphere E) : ‖r • (θ:E)‖ = r := by + have ht : ‖(θ:E)‖ = 1 := by simpa only [Metric.mem_sphere,dist_zero_right] using θ.property + simp [norm_smul,Real.norm_eq_abs,abs_of_nonneg hr,ht] + +omit [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + [Nontrivial E] [MeasurableSpace E] [BorelSpace E] in +lemma radial_jacobian (k : ℕ) {r : ℝ} (hr : r ≠ 0) (a b : ℝ) : + r^k*(a+(k:ℝ)/r*b)=r^k*a+(k:ℝ)*r^(k-1)*b := by + cases k with + | zero => simp + | succ k => simp only [Nat.add_sub_cancel,pow_succ]; field_simp + +lemma radial_weak_identity {u w : E → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set E)) + (hw : ContinuousOn w ({0}ᶜ : Set E)) + (heq : ∀ x ≠ 0, Laplacian.laplacian u x = w x) + (φ : ℝ → ℝ) (hφ : ContDiff ℝ 2 φ) (hc : HasCompactSupport φ) + (hs : tsupport φ ⊆ Ioi 0) : + (∫ r, mean u r * (r^(Module.finrank ℝ E-1)*deriv (deriv φ) r+ + ((Module.finrank ℝ E-1 : ℕ):ℝ)*r^(Module.finrank ℝ E-2)*deriv φ r)) = + ∫ r, r^(Module.finrank ℝ E-1)*mean w r*φ r := by + let ψ : E → ℝ := fun x => φ ‖x‖ + have hψ : ContDiff ℝ 2 ψ := radial_contDiff hφ hs + have hψc : HasCompactSupport ψ := radial_compactSupport hc + have hψs : tsupport ψ ⊆ ({0}ᶜ : Set E) := radial_tsupport_off_origin hs + have hi1 : Integrable (fun x => u x * Laplacian.laplacian ψ x) := + integrable_mul_compact (compactSupport_laplacian hψc) + (hu.continuousOn.mono ((tsupport_laplacian_subset ψ).trans hψs)) + (continuous_laplacian hψ).continuousOn + have hi2 : Integrable (fun x => w x * ψ x) := + integrable_mul_compact hψc (hw.mono hψs) hψ.continuous.continuousOn + have htest : (∫ x, u x * Laplacian.laplacian ψ x) = ∫ x, w x*ψ x := by + rw [integral_laplacian_test isOpen_compl_singleton hu hψ hψc hψs] + congr 1; funext x + by_cases hx : x ∈ tsupport ψ + · rw [heq x (hψs hx)] + · simp [image_eq_zero_of_notMem_tsupport hx] + have hn : 1 ≤ Module.finrank ℝ E := Module.finrank_pos + have hcast : ((Module.finrank ℝ E-1:ℕ):ℝ) = (Module.finrank ℝ E:ℝ)-1 := by + rw [Nat.cast_sub hn]; norm_num + have hφ' := hφ.differentiable_deriv_two + have hlap {r : ℝ} (hr : 0 < r) (θ : UnitSphere E) : Laplacian.laplacian ψ (r • (θ:E)) = + deriv (deriv φ) r+((Module.finrank ℝ E-1:ℕ):ℝ)/r*deriv φ r := by + rw [laplacian_profile_norm (smul_sphere_ne_zero hr θ) + (fun s _ => (hφ.differentiable (by norm_num) s).hasDerivAt) + (hφ' _).hasDerivAt, norm_smul_sphere hr.le, ← hcast] + have hp1 := Polar.integral_polar (volume : Measure E) + (fun x => u x * Laplacian.laplacian ψ x) hi1 + have hp2 := Polar.integral_polar (volume : Measure E) (fun x => w x*ψ x) hi2 + rw [hp1,hp2] at htest + have hleft : (∫ r in Ioi (0:ℝ), r^(Module.finrank ℝ E-1) * + ∫ θ : UnitSphere E, u (r • θ.1)*Laplacian.laplacian ψ (r • θ.1) + ∂(volume : Measure E).toSphere) = + ∫ r, mean u r*(r^(Module.finrank ℝ E-1)*deriv (deriv φ) r+ + ((Module.finrank ℝ E-1:ℕ):ℝ)*r^(Module.finrank ℝ E-2)*deriv φ r) := by + calc + _ = ∫ r in Ioi (0:ℝ), mean u r*(r^(Module.finrank ℝ E-1)*deriv (deriv φ) r+ + ((Module.finrank ℝ E-1:ℕ):ℝ)*r^(Module.finrank ℝ E-2)*deriv φ r) := by + apply setIntegral_congr_fun measurableSet_Ioi + intro r hr + simp_rw [hlap hr] + rw [integral_mul_const] + change r^(Module.finrank ℝ E-1)*(mean u r*_)=_ + rw [← mul_assoc, mul_comm _ (mean u r), mul_assoc, radial_jacobian _ hr.ne'] + congr 3 + _ = _ := setIntegral_eq_integral_of_forall_compl_eq_zero (fun r hr => by + have h1 : deriv φ r = 0 := image_eq_zero_of_notMem_tsupport (fun h => + hr (hs (tsupport_deriv_subset h))) + have h2 : deriv (deriv φ) r = 0 := image_eq_zero_of_notMem_tsupport (fun h => + hr (hs (tsupport_deriv_subset (tsupport_deriv_subset h)))) + simp [h1,h2]) + have hright : (∫ r in Ioi (0:ℝ), r^(Module.finrank ℝ E-1) * + ∫ θ : UnitSphere E, w (r • θ.1)*ψ (r • θ.1) ∂(volume : Measure E).toSphere) = + ∫ r, r^(Module.finrank ℝ E-1)*mean w r*φ r := by + calc + _ = ∫ r in Ioi (0:ℝ), r^(Module.finrank ℝ E-1)*mean w r*φ r := by + apply setIntegral_congr_fun measurableSet_Ioi + intro r hr + simp_rw [ψ,norm_smul_sphere hr.le] + rw [integral_mul_const] + exact (mul_assoc _ _ _).symm + _ = _ := setIntegral_eq_integral_of_forall_compl_eq_zero (fun r hr => by + simp [image_eq_zero_of_notMem_tsupport (fun h => hr (hs h))]) + rw [hleft,hright] at htest + exact htest + +lemma mean_laplacian_ode {u w : E → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set E)) + (hw : ContinuousOn w ({0}ᶜ : Set E)) + (heq : ∀ x ≠ 0, Laplacian.laplacian u x = w x) {r : ℝ} (hr : 0 < r) : + r^(Module.finrank ℝ E-1)*meanDD u r+ + ((Module.finrank ℝ E-1:ℕ):ℝ)*r^(Module.finrank ℝ E-2)*meanD u r = + r^(Module.finrank ℝ E-1)*mean w r := by + have hwk := radial_ode_of_weak (Module.finrank ℝ E-1) + (continuousOn_mean hu) (continuousOn_meanD hu) (continuousOn_meanDD hu) + (continuousOn_mean_source hw) (fun r hr => hasDerivAt_mean hu hr) + (fun r hr => hasDerivAt_meanD hu hr) + (fun φ hφ hc hs => by + simpa only [Nat.sub_sub] using radial_weak_identity hu hw heq φ + (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top)) hc hs) r hr + simpa only [Nat.sub_sub] using hwk + +end HenonLaneEmden.SphereCalculus + +namespace HenonLaneEmden.SphereCalculus +variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +lemma mean_pos_off_origin {w : E → ℝ} (hw : ContinuousOn w ({0}ᶜ : Set E)) + (hp : ∀ x ≠ 0, 0 < w x) {r : ℝ} (hr : 0 < r) : 0 < mean w r := by + have hp' (θ : UnitSphere E) : 0 < w (r • θ.1) := hp _ (smul_sphere_ne_zero hr θ) + have hc : Continuous (fun θ : UnitSphere E => w (r • θ.1)) := by + rw [← continuousOn_univ] + apply hw.comp (continuous_const.smul continuous_subtype_val).continuousOn + exact fun θ _ => smul_sphere_ne_zero hr θ + unfold mean + apply (integral_pos_iff_support_of_nonneg (fun θ => (hp' θ).le) + (hc.integrable_of_hasCompactSupport (.of_compactSpace _))).mpr + have heq : Function.support (fun θ : UnitSphere E => w (r • θ.1)) = univ := by + ext θ; simp [Function.mem_support,(hp' θ).ne'] + rw [heq] + exact Measure.measure_univ_pos.mpr (Measure.toSphere_ne_zero (volume : Measure E)) + +omit [Nontrivial E] in +lemma mean_neg (w : E → ℝ) (r : ℝ) : mean (fun x => -w x) r = -mean w r := by + exact integral_neg _ + +lemma hasDerivAt_mean_flux {u w : E → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set E)) + (hw : ContinuousOn w ({0}ᶜ : Set E)) + (heq : ∀ x ≠ 0, -Laplacian.laplacian u x = w x) {r : ℝ} (hr : 0 < r) : + HasDerivAt (fun s => s^(Module.finrank ℝ E-1)*meanD u s) + (-(r^(Module.finrank ℝ E-1)*mean w r)) r := by + have ho := mean_laplacian_ode hu hw.neg (fun x hx => (neg_eq_iff_eq_neg.mp (heq x hx))) hr + simp only [Pi.neg_def,mean_neg] at ho + have hd := ((hasDerivAt_id r).pow (Module.finrank ℝ E-1)).mul (hasDerivAt_meanD hu hr) + convert! hd using 1 + simp only [mul_one,Nat.sub_sub, id_eq, Pi.pow_apply, Nat.reduceAdd] + linarith +end HenonLaneEmden.SphereCalculus + +end +end SphereFlux + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/SphereMean.lean b/lean/OAI/Analysis/HenonEmden/SphereMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b333045de78f06ccd772934e769600971818e8a --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/SphereMean.lean @@ -0,0 +1,188 @@ +import OAI.Analysis.HenonEmden.Polar + +namespace OAI + +universe uS uE uE2 + +section SphereMean + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +noncomputable section + +open Set Filter Topology MeasureTheory + +namespace HenonLaneEmden.SphereCalculus +variable {S : Type uS} [TopologicalSpace S] [CompactSpace S] [MeasurableSpace S] + [BorelSpace S] (μ : Measure S) [IsFiniteMeasure μ] + +omit [CompactSpace S] [MeasurableSpace S] [BorelSpace S] in +lemma slice_continuous {F : ℝ × S → ℝ} {s : Set ℝ} + (hF : ContinuousOn F (s ×ˢ univ)) {x : ℝ} (hx : x ∈ s) : + Continuous (fun θ => F (x,θ)) := by + rw [← continuousOn_univ] + exact hF.comp (continuous_const.prodMk continuous_id).continuousOn (fun _ _ => ⟨hx,mem_univ _⟩) + +lemma hasDerivAt_integral_compact {F F' : ℝ × S → ℝ} {s : Set ℝ} + (hs : IsOpen s) (hF : ContinuousOn F (s ×ˢ univ)) + (hF' : ContinuousOn F' (s ×ˢ univ)) + (hderiv : ∀ x ∈ s, ∀ θ, HasDerivAt (fun y => F (y,θ)) (F' (x,θ)) x) + {x : ℝ} (hx : x ∈ s) : + HasDerivAt (fun y => ∫ θ, F (y,θ) ∂μ) (∫ θ, F' (x,θ) ∂μ) x := by + obtain ⟨ε,hε,hεs⟩ := Metric.mem_nhds_iff.mp (hs.mem_nhds hx) + let K : Set (ℝ × S) := Metric.closedBall x (ε/2) ×ˢ univ + have hK : IsCompact K := (isCompact_closedBall x (ε/2)).prod isCompact_univ + have hKs : K ⊆ s ×ˢ univ := by + intro z hz + refine ⟨hεs ?_,mem_univ _⟩ + exact lt_of_le_of_lt (Metric.mem_closedBall.mp hz.1) (by linarith) + obtain ⟨C,hC⟩ := hK.exists_bound_of_continuousOn (hF'.mono hKs) + have hmeas : ∀ᶠ y in 𝓝 x, AEStronglyMeasurable (fun θ => F (y,θ)) μ := by + filter_upwards [hs.mem_nhds hx] with y hy + exact (slice_continuous hF hy).aestronglyMeasurable + have hint : Integrable (fun θ => F (x,θ)) μ := + (slice_continuous hF hx).integrable_of_hasCompactSupport (.of_compactSpace _) + have hmeas' : AEStronglyMeasurable (fun θ => F' (x,θ)) μ := + (slice_continuous hF' hx).aestronglyMeasurable + apply (hasDerivAt_integral_of_dominated_loc_of_deriv_le + (μ := μ) (F := fun r θ => F (r,θ)) (F' := fun r θ => F' (r,θ)) + (s := Metric.closedBall x (ε/2)) (bound := fun _ => C) + (Metric.closedBall_mem_nhds x (by linarith)) + hmeas hint hmeas' _ (integrable_const C) _).2 + · exact Filter.Eventually.of_forall fun θ y hy => hC (y,θ) ⟨hy,mem_univ _⟩ + · exact Filter.Eventually.of_forall fun θ y hy => hderiv y (hKs (show (y,θ) ∈ K from ⟨hy,mem_univ _⟩)).1 θ + +end HenonLaneEmden.SphereCalculus + +namespace HenonLaneEmden.SphereCalculus +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] + +abbrev UnitSphere (E : Type uE2) [NormedAddCommGroup E] := Metric.sphere (0:E) 1 + +noncomputable def mean (u : E → ℝ) (r : ℝ) : ℝ := + ∫ θ : UnitSphere E, u (r • θ.1) ∂(volume : Measure E).toSphere +noncomputable def meanD (u : E → ℝ) (r : ℝ) : ℝ := + ∫ θ : UnitSphere E, fderiv ℝ u (r • θ.1) θ.1 ∂(volume : Measure E).toSphere +noncomputable def meanDD (u : E → ℝ) (r : ℝ) : ℝ := + ∫ θ : UnitSphere E, fderiv ℝ (fderiv ℝ u) (r • θ.1) θ.1 θ.1 + ∂(volume : Measure E).toSphere + +omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [Nontrivial E] + [MeasurableSpace E] [BorelSpace E] in +lemma sphere_ne_zero (θ : UnitSphere E) : (θ : E) ≠ 0 := by + have hn : ‖(θ:E)‖ = 1 := by simpa only [Metric.mem_sphere, dist_zero_right] using θ.property + intro h; simp [h] at hn + +omit [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] in +lemma smul_sphere_ne_zero {r : ℝ} (hr : 0 < r) (θ : UnitSphere E) : r • (θ:E) ≠ 0 := + smul_ne_zero hr.ne' (sphere_ne_zero θ) + +omit [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] in +lemma continuous_mean_integrand {u : E → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set E)) : + ContinuousOn (fun z : ℝ × UnitSphere E => u (z.1 • z.2.1)) (Ioi 0 ×ˢ univ) := by + exact hu.continuousOn.comp + (continuous_fst.smul continuous_snd.subtype_val).continuousOn + (fun z hz => smul_sphere_ne_zero hz.1 z.2) + +omit [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] in +lemma continuous_meanD_integrand {u : E → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set E)) : + ContinuousOn (fun z : ℝ × UnitSphere E => fderiv ℝ u (z.1 • z.2.1) z.2.1) + (Ioi 0 ×ˢ univ) := by + have hc := (hu.fderiv_of_isOpen isOpen_compl_singleton (m := 1) (by norm_num)).continuousOn + exact (hc.comp (continuous_fst.smul continuous_snd.subtype_val).continuousOn + (fun z hz => smul_sphere_ne_zero hz.1 z.2)).clm_apply + continuous_snd.subtype_val.continuousOn + +omit [FiniteDimensional ℝ E] [Nontrivial E] [MeasurableSpace E] [BorelSpace E] in +lemma continuous_meanDD_integrand {u : E → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set E)) : + ContinuousOn (fun z : ℝ × UnitSphere E => fderiv ℝ (fderiv ℝ u) + (z.1 • z.2.1) z.2.1 z.2.1) (Ioi 0 ×ˢ univ) := by + have hc := ((hu.fderiv_of_isOpen isOpen_compl_singleton (m := 1) (by norm_num)).fderiv_of_isOpen + isOpen_compl_singleton (m := 0) (by norm_num)).continuousOn + exact ((hc.comp (continuous_fst.smul continuous_snd.subtype_val).continuousOn + (fun z hz => smul_sphere_ne_zero hz.1 z.2)).clm_apply + continuous_snd.subtype_val.continuousOn).clm_apply continuous_snd.subtype_val.continuousOn + +omit [Nontrivial E] in +lemma continuousOn_mean {u : E → ℝ} (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set E)) : + ContinuousOn (mean u) (Ioi 0) := by + exact continuousOn_integral_of_compact_support isCompact_univ + (continuous_mean_integrand hu) (fun _ _ _ h => (h (mem_univ _)).elim) + +omit [Nontrivial E] in +lemma continuousOn_meanD {u : E → ℝ} (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set E)) : + ContinuousOn (meanD u) (Ioi 0) := by + exact continuousOn_integral_of_compact_support isCompact_univ + (continuous_meanD_integrand hu) (fun _ _ _ h => (h (mem_univ _)).elim) + +omit [Nontrivial E] in +lemma continuousOn_meanDD {u : E → ℝ} (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set E)) : + ContinuousOn (meanDD u) (Ioi 0) := by + exact continuousOn_integral_of_compact_support isCompact_univ + (continuous_meanDD_integrand hu) (fun _ _ _ h => (h (mem_univ _)).elim) + +omit [Nontrivial E] in +lemma continuous_mean {u : E → ℝ} (hu : Continuous u) : Continuous (mean u) := by + rw [← continuousOn_univ] + exact continuousOn_integral_of_compact_support isCompact_univ + (hu.comp (continuous_fst.smul continuous_snd.subtype_val)).continuousOn + (fun _ _ _ h => (h (mem_univ _)).elim) + +omit [Nontrivial E] in +lemma mean_zero (u : E → ℝ) : mean u 0 = ((volume : Measure E).toSphere univ).toReal * u 0 := by + simp only [mean, zero_smul, integral_const, smul_eq_mul, Measure.real] + +omit [Nontrivial E] in +lemma hasDerivAt_mean {u : E → ℝ} (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set E)) + {r : ℝ} (hr : 0 < r) : HasDerivAt (mean u) (meanD u r) r := by + apply hasDerivAt_integral_compact (volume : Measure E).toSphere isOpen_Ioi + (continuous_mean_integrand hu) (continuous_meanD_integrand hu) _ hr + intro s hs θ + have hd := (hu.contDiffAt (isOpen_compl_singleton.mem_nhds + (smul_sphere_ne_zero hs θ))).differentiableAt (by norm_num) + convert! hd.hasFDerivAt.comp_hasDerivAt s ((hasDerivAt_id s).smul_const (θ:E)) using 1 + simp only [one_smul] + +omit [Nontrivial E] in +lemma hasDerivAt_meanD {u : E → ℝ} (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set E)) + {r : ℝ} (hr : 0 < r) : HasDerivAt (meanD u) (meanDD u r) r := by + apply hasDerivAt_integral_compact (volume : Measure E).toSphere isOpen_Ioi + (continuous_meanD_integrand hu) (continuous_meanDD_integrand hu) _ hr + intro s hs θ + have hd := ((hu.fderiv_of_isOpen isOpen_compl_singleton (m := 1) (by norm_num)).contDiffAt + (isOpen_compl_singleton.mem_nhds (smul_sphere_ne_zero hs θ))).differentiableAt (by norm_num) + have h1 : HasDerivAt (fun y : ℝ => fderiv ℝ u (y • (θ:E))) + (fderiv ℝ (fderiv ℝ u) (s • (θ:E)) (θ:E)) s := by + convert! hd.hasFDerivAt.comp_hasDerivAt s + ((hasDerivAt_id s).smul_const (θ:E)) using 1 + simp only [one_smul] + convert! h1.clm_apply (hasDerivAt_const s (θ:E)) using 1 + simp only [map_zero, add_zero] + +lemma mean_pos {u : E → ℝ} (hu : Continuous u) (hp : ∀ x, 0 < u x) (r : ℝ) : + 0 < mean u r := by + unfold mean + apply (integral_pos_iff_support_of_nonneg (fun θ : UnitSphere E => (hp (r • θ.1)).le) ?_).mpr + · have heq : Function.support (fun θ : UnitSphere E => u (r • θ.1)) = univ := by + ext θ; simp [Function.mem_support, (hp _).ne'] + rw [heq] + exact (Measure.measure_univ_pos.mpr (Measure.toSphere_ne_zero (volume : Measure E))) + · exact (hu.comp (continuous_const.smul continuous_subtype_val)).integrable_of_hasCompactSupport + (.of_compactSpace _) + +end HenonLaneEmden.SphereCalculus + +end +end SphereMean + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/SymmetricVirial.lean b/lean/OAI/Analysis/HenonEmden/SymmetricVirial.lean new file mode 100644 index 0000000000000000000000000000000000000000..33e7bce9631b1891732b42115151b30665ce7860 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/SymmetricVirial.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.HenonEmden.OriginVirial + +namespace OAI + +section SymmetricVirial + +open MeasureTheory Set Filter Topology Metric +open scoped ENNReal InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open WeakPDE Cutoff + +lemma radial_gradient_pair {n : ℕ} (x y : Space n) : + (newtonDenom n)⁻¹*(eta n x*kernelDir x (x-y)+eta n y*kernelDir y (y-x)) = + (2-(n:ℝ))*newtonKernel n (x,y)*fluxFactor n (x,y) := by + by_cases hxy : x=y + · subst y + simp only [sub_self,kernelDir,inner_zero_left,mul_zero,zero_add,fluxFactor,zero_div] + have hr : 0 < ‖x-y‖ := norm_pos_iff.mpr (sub_ne_zero.mpr hxy) + have he : ‖x-y‖^(-(n:ℝ)) = ‖x-y‖^(2-(n:ℝ))/‖x-y‖^2 := by + rw [← Real.rpow_two,← Real.rpow_sub hr] + congr 1; ring + simp only [kernelDir,finrank_euclideanSpace_fin,norm_sub_rev y x,he,newtonKernel,fluxFactor,X, + inner_sub_right,real_inner_smul_right] + rw [show y-x=-(x-y) by abel,inner_neg_left] + ring + +lemma IsSolution.integrable_fluxFactor {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + Integrable (fluxFactor n) (interaction (source u q B) (source v p A)) := by + have hn3 := h.dimension_ge_three hn + have hfm := measurable_source h.continuous_u q B + have hgm := measurable_source h.continuous_v p A + have hf0 := source_nonneg (fun x => (h.positive_u x).le) q B + have hg0 := source_nonneg (fun x => (h.positive_v x).le) p A + apply (integrable_interaction_iff hn3 hfm hgm hf0 hg0 _).mpr + have hi := ((h.integrable_joint_radial_gradient hn hp hq).add + (h.swap.integrable_joint_radial_gradient hn hq hp).swap).const_mul ((newtonDenom n)⁻¹/(2-(n:ℝ))) + apply hi.congr + exact ae_of_all _ (fun z => by + dsimp only [Function.comp_def,Prod.swap,Pi.add_apply] + have he := radial_gradient_pair z.1 z.2 + have hn0 : 2-(n:ℝ) ≠ 0 := by + have hh : (3:ℝ) ≤ n := by exact_mod_cast hn3 + linarith + have hh := congrArg (fun a : ℝ => source u q B z.1*source v p A z.2*a/(2-(n:ℝ))) he + field_simp [hn0] at hh ⊢ + nlinarith [hh]) + +lemma IsSolution.integral_radial_pair {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + (∫ x, eta n x*source u q B x*dir u x x)+(∫ x, eta n x*source v p A x*dir v x x) = + (2-(n:ℝ))*(∫ z, fluxFactor n z ∂interaction (source u q B) (source v p A)) := by + rw [h.integral_eta_source_radialDir hn hp hq,h.swap.integral_eta_source_radialDir hn hq hp, + ← integral_prod_swap (fun z : Space n × Space n => eta n z.1*source v p A z.1* + (kernelDir z.1 (z.1-z.2)*source u q B z.2))] + have hi := (h.swap.integrable_joint_radial_gradient hn hq hp).swap + simp only [Function.comp_def] at hi + rw [← mul_add,← integral_add (h.integrable_joint_radial_gradient hn hp hq) hi] + rw [integral_interaction (h.dimension_ge_three hn) (measurable_source h.continuous_u q B) + (measurable_source h.continuous_v p A) (source_nonneg (fun x => (h.positive_u x).le) q B) + (source_nonneg (fun x => (h.positive_v x).le) p A),← integral_const_mul,← integral_const_mul] + apply integral_congr_ae + exact ae_of_all _ (fun z => by + dsimp only [Prod.swap] + have he := congrArg (fun a : ℝ => source u q B z.1*source v p A z.2*a) (radial_gradient_pair z.1 z.2) + nlinarith [he]) + +lemma IsSolution.symmetric_virial {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + ((n:ℝ)+B)/(q+1)*weightedEnergy (eta n) u q B+ + ((n:ℝ)+A)/(p+1)*weightedEnergy (eta n) v p A- + ((q+1)⁻¹*weightedEnergy (w n) u q B+(p+1)⁻¹*weightedEnergy (w n) v p A) = + ((n:ℝ)-2)*(∫ z, fluxFactor n z ∂interaction (source u q B) (source v p A)) := by + have hf := h.weighted_virial hn hp hq + have hg := h.swap.weighted_virial hn hq hp + have hpair := h.integral_radial_pair hn hp hq + have hp1 : p+1 ≠ 0 := by positivity + have hq1 : q+1 ≠ 0 := by positivity + field_simp + linear_combination (p+1)*hf+(q+1)*hg-(p+1)*(q+1)*hpair + +end HenonLaneEmden +end +end SymmetricVirial + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Tails.lean b/lean/OAI/Analysis/HenonEmden/Tails.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6e82c0fa34989ba12572cd5d8bba21e405cbf85 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Tails.lean @@ -0,0 +1,83 @@ +import OAI.Analysis.HenonEmden.PressureRecovery + +namespace OAI + +universe uE + +section Tails + +open MeasureTheory Set Filter +open scoped ENNReal +namespace HenonLaneEmden.UniformTail + +lemma dyadic_power_identity {R : ℝ} (hR : 0 < R) (a s C : ℝ) (k : ℕ) : + (R*2^k)^(-a) * (C*(R*2^(k+1))^s) = + (C*2^s*R^(s-a)) * (2^(s-a))^k := by + rw [show (2:ℝ)^(k+1) = 2*2^k by rw [pow_succ]; ring, + show R*(2*2^k) = (2*R)*2^k by ring, + Real.mul_rpow hR.le (by positivity),Real.mul_rpow (by positivity) (by positivity), + Real.mul_rpow (by norm_num) hR.le, + ← Real.rpow_pow_comm (by norm_num : (0:ℝ) ≤ 2) (-a) k, + ← Real.rpow_pow_comm (by norm_num : (0:ℝ) ≤ 2) s k] + rw [show R^(s-a) = R^(-a)*R^s by rw [← Real.rpow_add hR]; congr 1; ring, + show (2:ℝ)^(s-a) = 2^(-a)*2^s by rw [← Real.rpow_add (by norm_num : (0:ℝ)<2)]; congr 1; ring, + mul_pow] + ring + +variable {E : Type uE} [NormedAddCommGroup E] [MeasurableSpace E] [BorelSpace E] + +/-- A nonnegative measure having polynomial centered ball growth has a uniform +inverse-power tail whenever the decay exponent exceeds the growth exponent. +The proof uses a geometric majorant, not subtraction of divergent potentials. -/ +lemma lintegral_norm_rpow_compl_ball_le (μ : Measure E) {C R a s : ℝ} + (hC : 0 ≤ C) (hR : 0 < R) (ha : 0 ≤ a) (hs : s < a) + (hball : ∀ r > 0, μ (Metric.ball (0:E) r) ≤ ENNReal.ofReal (C*r^s)) : + (∫⁻ y in (Metric.ball (0:E) R)ᶜ, ENNReal.ofReal (‖y‖^(-a)) ∂μ) ≤ + ENNReal.ofReal (C*2^s*R^(s-a)/(1-2^(s-a))) := by + let F : ℕ → E → ℝ≥0∞ := fun k => (Metric.ball (0:E) (R*2^(k+1))).indicator + (fun _ => ENNReal.ofReal ((R*2^k)^(-a))) + have hF : ∀ k, Measurable (F k) := fun k => measurable_const.indicator measurableSet_ball + have hpoint : ∀ y : E, (Metric.ball (0:E) R)ᶜ.indicator + (fun y => ENNReal.ofReal (‖y‖^(-a))) y ≤ ∑' k, F k y := by + intro y + by_cases hy : y ∈ (Metric.ball (0:E) R)ᶜ + · have hny : R ≤ ‖y‖ := by simpa only [mem_compl_iff,Metric.mem_ball,dist_zero_right,not_lt] using hy + obtain ⟨k,hk₁,hk₂⟩ := exists_nat_pow_near ((le_div_iff₀ hR).mpr (by simpa using hny)) + (by norm_num : (1:ℝ)<2) + have hklo : R*2^k ≤ ‖y‖ := by nlinarith [(le_div_iff₀ hR).mp hk₁] + have hkhi : ‖y‖ < R*2^(k+1) := by nlinarith [(div_lt_iff₀ hR).mp hk₂] + have hym : y ∈ Metric.ball (0:E) (R*2^(k+1)) := by simpa [Metric.mem_ball,dist_zero_right] using hkhi + rw [indicator_of_mem hy] + apply le_trans _ (ENNReal.le_tsum k) + dsimp only [F] + rw [indicator_of_mem hym] + exact ENNReal.ofReal_le_ofReal (Real.rpow_le_rpow_of_nonpos (by positivity) hklo (neg_nonpos.mpr ha)) + · simp only [indicator_of_notMem hy,zero_le] + have hgeom : 0 ≤ (2:ℝ)^(s-a) := Real.rpow_nonneg (by norm_num) _ + have hgeomlt : (2:ℝ)^(s-a) < 1 := by + exact Real.rpow_lt_one_of_one_lt_of_neg (by norm_num) (sub_neg.mpr hs) + have hsumm : Summable (fun k : ℕ => (C*2^s*R^(s-a))*((2:ℝ)^(s-a))^k) := + (summable_geometric_of_abs_lt_one (by rwa [abs_of_nonneg hgeom])).mul_left _ + calc + _ = ∫⁻ y, (Metric.ball (0:E) R)ᶜ.indicator (fun y => ENNReal.ofReal (‖y‖^(-a))) y ∂μ := + (lintegral_indicator measurableSet_ball.compl _).symm + _ ≤ ∫⁻ y, ∑' k, F k y ∂μ := lintegral_mono hpoint + _ = ∑' k, ∫⁻ y, F k y ∂μ := lintegral_tsum (fun k => (hF k).aemeasurable) + _ ≤ ∑' k : ℕ, ENNReal.ofReal ((R*2^k)^(-a)) * ENNReal.ofReal (C*(R*2^(k+1))^s) := by + apply ENNReal.tsum_le_tsum; intro k + dsimp only [F] + rw [lintegral_indicator measurableSet_ball,setLIntegral_const] + gcongr + exact hball _ (by positivity) + _ = ∑' k : ℕ, ENNReal.ofReal ((C*2^s*R^(s-a))*((2:ℝ)^(s-a))^k) := by + apply tsum_congr; intro k + rw [← ENNReal.ofReal_mul (by positivity),dyadic_power_identity hR] + _ = ENNReal.ofReal (∑' k : ℕ, (C*2^s*R^(s-a))*((2:ℝ)^(s-a))^k) := + (ENNReal.ofReal_tsum_of_nonneg (fun k => by positivity) hsumm).symm + _ = _ := by + rw [tsum_mul_left,tsum_geometric_of_abs_lt_one (by rwa [abs_of_nonneg hgeom]),div_eq_mul_inv] + +end HenonLaneEmden.UniformTail +end Tails + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/Tonelli.lean b/lean/OAI/Analysis/HenonEmden/Tonelli.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ed6c07adf3af1df47ed720b28364c71c59fab3d --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/Tonelli.lean @@ -0,0 +1,133 @@ +import OAI.Analysis.HenonEmden.SourceEndpoints + +namespace OAI + +universe uE + +section Tonelli + +open MeasureTheory Set Function +open scoped ENNReal +namespace HenonLaneEmden.LayerTonelli + +variable {E : Type uE} [MeasurableSpace E] + +/-- The literal positive source subgraph; no integrability is implicit. -/ +def sourceSubgraph (f : E → ℝ) : Set (E × ℝ) := {z | 0 < z.2 ∧ z.2 < f z.1} + +lemma measurableSet_sourceSubgraph {f : E → ℝ} (hf : Measurable f) : + MeasurableSet (sourceSubgraph f) := + (measurableSet_lt measurable_const measurable_snd).inter + (measurableSet_lt measurable_snd (hf.comp measurable_fst)) + +noncomputable def layerMeasure (μ : Measure E) (f : E → ℝ) : Measure (E × ℝ) := + (μ.prod volume).restrict (sourceSubgraph f) + +instance layerMeasure_sfinite (μ : Measure E) [SFinite μ] (f : E → ℝ) : + SFinite (layerMeasure μ f) := inferInstanceAs (SFinite ((μ.prod volume).restrict _)) + +lemma lintegral_layerMeasure (μ : Measure E) [SFinite μ] {f : E → ℝ} + (hf : Measurable f) {F : E × ℝ → ℝ≥0∞} (hF : Measurable F) : + ∫⁻ z, F z ∂layerMeasure μ f = ∫⁻ x, ∫⁻ t in Ioo 0 (f x), F (x,t) ∂volume ∂μ := by + rw [layerMeasure,← lintegral_indicator (measurableSet_sourceSubgraph hf), + lintegral_prod _ (hF.indicator (measurableSet_sourceSubgraph hf)).aemeasurable] + apply lintegral_congr + intro x + rw [← lintegral_indicator measurableSet_Ioo] + apply lintegral_congr + intro t + simp only [indicator,sourceSubgraph,mem_Ioo,mem_ofPred] + +lemma lintegral_layerMeasure_fst (μ : Measure E) [SFinite μ] {f : E → ℝ} + (hf : Measurable f) {F : E → ℝ≥0∞} (hF : Measurable F) : + ∫⁻ z, F z.1 ∂layerMeasure μ f = ∫⁻ x, ENNReal.ofReal (f x)*F x ∂μ := by + rw [lintegral_layerMeasure μ hf (F := fun z => F z.1) (by fun_prop)] + apply lintegral_congr + intro x + simp only [lintegral_const,Measure.restrict_apply_univ,Real.volume_Ioo,sub_zero,mul_comm] + +/-- Newton potentials are kept as nonnegative extended integrals until their +finiteness has separately been supplied by the PDE. -/ +noncomputable def potential (μ : Measure E) (k : E × E → ℝ≥0∞) (g : E → ℝ) (x : E) : ℝ≥0∞ := + ∫⁻ y, ENNReal.ofReal (g y)*k (x,y) ∂μ + +lemma measurable_potential (μ : Measure E) [SFinite μ] {k : E × E → ℝ≥0∞} + {g : E → ℝ} (hk : Measurable k) (hg : Measurable g) : + Measurable (potential μ k g) := + ((hg.comp measurable_snd).ennreal_ofReal.mul hk).lintegral_prod_right + +lemma lintegral_layer_kernel (μ : Measure E) [SFinite μ] {g : E → ℝ} + {k : E × E → ℝ≥0∞} (hg : Measurable g) (hk : Measurable k) (x : E) : + ∫⁻ y, k (x,y.1) ∂layerMeasure μ g = potential μ k g x := + lintegral_layerMeasure_fst μ hg (hk.comp (measurable_const.prodMk measurable_id)) + +/-- This is the Tonelli recovery at an arbitrary measurable selected endpoint. +The selected point depends only on the first layer, never on the second layer. -/ +lemma lintegral_pair_endpoint (μ : Measure E) [SFinite μ] {f g : E → ℝ} + {k : E × E → ℝ≥0∞} {a : E × ℝ → ℝ≥0∞} {endpoint : E × ℝ → E} + (hg : Measurable g) (hk : Measurable k) (ha : Measurable a) (he : Measurable endpoint) : + ∫⁻ z, a z.1*k (endpoint z.1,z.2.1) ∂(layerMeasure μ f).prod (layerMeasure μ g) = + ∫⁻ z, a z*potential μ k g (endpoint z) ∂layerMeasure μ f := by + rw [lintegral_prod (fun z : (E × ℝ) × (E × ℝ) => a z.1*k (endpoint z.1,z.2.1)) (by fun_prop)] + apply lintegral_congr + intro z + change (∫⁻ y : E × ℝ, a z*k (endpoint z,y.1) ∂layerMeasure μ g) = _ + rw [lintegral_const_mul _ (show Measurable (fun y : E × ℝ => k (endpoint z,y.1)) by fun_prop), + lintegral_layer_kernel μ hg hk] + +lemma lintegral_pair_position (μ : Measure E) [SFinite μ] {f g : E → ℝ} + {k : E × E → ℝ≥0∞} {a : E × ℝ → ℝ≥0∞} + (hg : Measurable g) (hk : Measurable k) (ha : Measurable a) : + ∫⁻ z, a z.1*k (z.1.1,z.2.1) ∂(layerMeasure μ f).prod (layerMeasure μ g) = + ∫⁻ z, a z*potential μ k g z.1 ∂layerMeasure μ f := + lintegral_pair_endpoint μ hg hk ha measurable_fst + +lemma lintegral_pair_endpoint_average (μ : Measure E) [SFinite μ] {f g : E → ℝ} + {k : E × E → ℝ≥0∞} {a : E × ℝ → ℝ≥0∞} {lo hi : E × ℝ → E} + (hg : Measurable g) (hk : Measurable k) (ha : Measurable a) + (hlo : Measurable lo) (hhi : Measurable hi) : + ∫⁻ z, a z.1*((k (lo z.1,z.2.1)+k (hi z.1,z.2.1))/2) + ∂(layerMeasure μ f).prod (layerMeasure μ g) = + ∫⁻ z, a z*((potential μ k g (lo z)+potential μ k g (hi z))/2) + ∂layerMeasure μ f := by + simp only [ENNReal.div_eq_inv_mul,mul_add] + simp_rw [← mul_assoc] + rw [lintegral_add_left] + · rw [lintegral_add_left] + · congr 1 + · exact lintegral_pair_endpoint μ hg hk (ha.mul_const _) hlo + · exact lintegral_pair_endpoint μ hg hk (ha.mul_const _) hhi + · exact (ha.mul_const _).mul ((measurable_potential μ hk hg).comp hlo) + · exact ((ha.comp measurable_fst).mul_const _).mul + (hk.comp ((hlo.comp measurable_fst).prodMk measurable_snd.fst)) + +/-- Integrating any spatial nonnegative pair function over the two sets of +levels gives exactly the interaction with both source densities. -/ +lemma lintegral_pair_spatial (μ : Measure E) [SFinite μ] {f g : E → ℝ} + {F : E × E → ℝ≥0∞} (hf : Measurable f) (hg : Measurable g) (hF : Measurable F) : + ∫⁻ z, F (z.1.1,z.2.1) ∂(layerMeasure μ f).prod (layerMeasure μ g) = + ∫⁻ z, ENNReal.ofReal (f z.1)*ENNReal.ofReal (g z.2)*F z ∂μ.prod μ := by + calc + _ = ∫⁻ x : E × ℝ, ∫⁻ y : E × ℝ, F (x.1,y.1) ∂layerMeasure μ g ∂layerMeasure μ f := by + exact lintegral_prod _ (by fun_prop) + _ = ∫⁻ x : E × ℝ, ∫⁻ y : E, ENNReal.ofReal (g y)*F (x.1,y) ∂μ ∂layerMeasure μ f := by + apply lintegral_congr + intro x + exact lintegral_layerMeasure_fst μ hg (F := fun y => F (x.1,y)) (by fun_prop) + _ = ∫⁻ x : E, ENNReal.ofReal (f x)*(∫⁻ y : E, ENNReal.ofReal (g y)*F (x,y) ∂μ) ∂μ := by + exact lintegral_layerMeasure_fst μ hf + (F := fun x => ∫⁻ y : E, ENNReal.ofReal (g y)*F (x,y) ∂μ) + ((show Measurable (fun z : E × E => ENNReal.ofReal (g z.2)*F z) by fun_prop).lintegral_prod_right) + _ = ∫⁻ z : E × E, ENNReal.ofReal (f z.1)*ENNReal.ofReal (g z.2)*F z ∂μ.prod μ := by + rw [lintegral_prod _ (by fun_prop)] + apply lintegral_congr + intro x + rw [← lintegral_const_mul _ (show Measurable (fun y => ENNReal.ofReal (g y)*F (x,y)) by fun_prop)] + apply lintegral_congr + intro y + exact (mul_assoc _ _ _).symm + +end HenonLaneEmden.LayerTonelli +end Tonelli + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/UniformBounds.lean b/lean/OAI/Analysis/HenonEmden/UniformBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..1db00ad5d1a53a7c9e208d18ea00878f7a8b313b --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/UniformBounds.lean @@ -0,0 +1,288 @@ +import OAI.Analysis.HenonEmden.Tails + +namespace OAI + +universe uE + +section UniformBounds + +open MeasureTheory Set Filter +open scoped ENNReal +namespace HenonLaneEmden.UniformTail + +variable {E : Type uE} [NormedAddCommGroup E] [MeasurableSpace E] [BorelSpace E] + +omit [MeasurableSpace E] [BorelSpace E] in +lemma shifted_rpow_le {a : ℝ} (ha : 0 ≤ a) {x y : E} {R : ℝ} + (hx : ‖x‖ ≤ R) (hy : 2*R ≤ ‖y‖) (hy0 : 0 < ‖y‖) : + ‖x-y‖^(-a) ≤ 2^a*‖y‖^(-a) := by + have hlo : ‖y‖/2 ≤ ‖x-y‖ := by + have ht := norm_sub_norm_le y x + rw [norm_sub_rev y x] at ht + linarith + have hh := Real.rpow_le_rpow_of_nonpos (by positivity : 0 < ‖y‖/2) hlo (neg_nonpos.mpr ha) + calc + _ ≤ (‖y‖/2)^(-a) := hh + _ = 2^a*‖y‖^(-a) := by + rw [Real.div_rpow (norm_nonneg _) (by norm_num),Real.rpow_neg (by norm_num : (0:ℝ) ≤ 2)] + rw [div_inv_eq_mul,mul_comm] + +lemma uniform_shifted_tail (μ : Measure E) {C a s : ℝ} (hC : 0 ≤ C) + (ha : 0 ≤ a) (hs : s < a) + (hball : ∀ r > 0, μ (Metric.ball (0:E) r) ≤ ENNReal.ofReal (C*r^s)) : + ∀ x : E, ‖x‖ ≤ 4 → + (∫⁻ y in (Metric.ball (0:E) 8)ᶜ, ENNReal.ofReal (‖x-y‖^(-a)) ∂μ) ≤ + ENNReal.ofReal (2^a*(C*2^s*8^(s-a)/(1-2^(s-a)))) := by + let T := C*2^s*8^(s-a)/(1-2^(s-a)) + intro x hx + calc + _ ≤ ∫⁻ y in (Metric.ball (0:E) 8)ᶜ, ENNReal.ofReal (2^a) * ENNReal.ofReal (‖y‖^(-a)) ∂μ := by + apply setLIntegral_mono' measurableSet_ball.compl + intro y hy + have hy' : 8 ≤ ‖y‖ := by simpa only [mem_compl_iff,Metric.mem_ball,dist_zero_right,not_lt] using hy + rw [← ENNReal.ofReal_mul (by positivity)] + exact ENNReal.ofReal_le_ofReal (shifted_rpow_le ha hx (by linarith) (by linarith)) + _ = ENNReal.ofReal (2^a) * ∫⁻ y in (Metric.ball (0:E) 8)ᶜ, ENNReal.ofReal (‖y‖^(-a)) ∂μ := by + rw [lintegral_const_mul'' _ (by fun_prop)] + _ ≤ ENNReal.ofReal (2^a) * ENNReal.ofReal T := by + gcongr + exact lintegral_norm_rpow_compl_ball_le μ hC (by norm_num) ha hs hball + _ = ENNReal.ofReal (2^a*T) := (ENNReal.ofReal_mul (by positivity)).symm + + +noncomputable def tailNumber (C a s : ℝ) : ℝ := + 2^a*(C*2^s*8^(s-a)/(1-2^(s-a))) + +lemma tailNumber_nonneg {C a s : ℝ} (hC : 0 ≤ C) (hs : s < a) : + 0 ≤ tailNumber C a s := by + unfold tailNumber + apply mul_nonneg (by positivity) + apply div_nonneg (by positivity) + exact sub_nonneg.mpr (Real.rpow_le_one_of_one_le_of_nonpos (by norm_num) (sub_nonpos.mpr hs.le)) + +lemma truncated_potential_bound (μ : Measure E) {C a s : ℝ} (hC : 0 ≤ C) + (ha : 0 ≤ a) (hs : s < a) + (hball : ∀ r > 0, μ (Metric.ball (0:E) r) ≤ ENNReal.ofReal (C*r^s)) + {x : E} (hx : ‖x‖ ≤ 4) {l : ℝ} (hl : 0 < l) (hl1 : l ≤ 1) : + (∫⁻ y in {y | l ≤ ‖x-y‖}, ENNReal.ofReal (‖x-y‖^(-a)) ∂μ) ≤ + ENNReal.ofReal ((C*8^s+tailNumber C a s)*l^(-a)) := by + let S : Set E := {y | l ≤ ‖x-y‖} + have hS : MeasurableSet S := measurableSet_le measurable_const (by fun_prop) + have hpoint (y : E) : + S.indicator (fun y => ENNReal.ofReal (‖x-y‖^(-a))) y ≤ + (Metric.ball (0:E) 8).indicator (fun _ => ENNReal.ofReal (l^(-a))) y + + (Metric.ball (0:E) 8)ᶜ.indicator (fun y => ENNReal.ofReal (‖x-y‖^(-a))) y := by + by_cases hy : y ∈ S + · rw [indicator_of_mem hy] + by_cases hy8 : y ∈ Metric.ball (0:E) 8 + · rw [indicator_of_mem hy8,indicator_of_notMem (not_not.mpr hy8),add_zero] + exact ENNReal.ofReal_le_ofReal (Real.rpow_le_rpow_of_nonpos hl hy (neg_nonpos.mpr ha)) + · rw [indicator_of_notMem hy8,indicator_of_mem hy8,zero_add] + · rw [indicator_of_notMem hy]; exact zero_le + have ht := uniform_shifted_tail μ hC ha hs hball x hx + have hpow : 1 ≤ l^(-a) := Real.one_le_rpow_of_pos_of_le_one_of_nonpos hl hl1 (neg_nonpos.mpr ha) + calc + _ = ∫⁻ y, S.indicator (fun y => ENNReal.ofReal (‖x-y‖^(-a))) y ∂μ := + (lintegral_indicator hS _).symm + _ ≤ ∫⁻ y, (Metric.ball (0:E) 8).indicator (fun _ => ENNReal.ofReal (l^(-a))) y + + (Metric.ball (0:E) 8)ᶜ.indicator (fun y => ENNReal.ofReal (‖x-y‖^(-a))) y ∂μ := lintegral_mono hpoint + _ = ENNReal.ofReal (l^(-a))*μ (Metric.ball (0:E) 8) + + ∫⁻ y in (Metric.ball (0:E) 8)ᶜ, ENNReal.ofReal (‖x-y‖^(-a)) ∂μ := by + rw [lintegral_add_left (measurable_const.indicator measurableSet_ball), + lintegral_indicator measurableSet_ball,lintegral_indicator measurableSet_ball.compl,setLIntegral_const] + _ ≤ ENNReal.ofReal (l^(-a))*ENNReal.ofReal (C*8^s)+ENNReal.ofReal (tailNumber C a s) := by + apply add_le_add _ ht + gcongr + exact hball 8 (by norm_num) + _ = ENNReal.ofReal (l^(-a)*(C*8^s)+tailNumber C a s) := by + rw [← ENNReal.ofReal_mul (by positivity),← ENNReal.ofReal_add (by positivity) (tailNumber_nonneg hC hs)] + _ ≤ _ := ENNReal.ofReal_le_ofReal (by nlinarith [mul_le_mul_of_nonneg_left hpow (tailNumber_nonneg hC hs)]) + +variable [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + +lemma local_kernel_mass_le (a : ℝ) {y : E} (hy : ‖y‖ < 8) : + (∫⁻ x in Metric.ball (0:E) 4, ENNReal.ofReal (‖x-y‖^(-a))) ≤ + ∫⁻ z in Metric.ball (0:E) 12, ENNReal.ofReal (‖z‖^(-a)) := by + rw [← lintegral_indicator measurableSet_ball,← lintegral_indicator measurableSet_ball] + rw [← lintegral_sub_right_eq_self (fun z => (Metric.ball (0:E) 12).indicator + (fun z => ENNReal.ofReal (‖z‖^(-a))) z) y] + apply lintegral_mono + intro x + dsimp only + by_cases hx : x ∈ Metric.ball (0:E) 4 + · have hx' : ‖x‖ < 4 := by simpa [Metric.mem_ball,dist_zero_right] using hx + have hm : x-y ∈ Metric.ball (0:E) 12 := by + simp only [Metric.mem_ball,dist_zero_right] + exact lt_of_le_of_lt (norm_sub_le x y) (by linarith) + rw [indicator_of_mem hx,indicator_of_mem hm] + · rw [indicator_of_notMem hx]; exact zero_le + +lemma local_potential_bound (μ : Measure E) [SFinite μ] {C a s : ℝ} (hC : 0 ≤ C) + (ha : 0 ≤ a) (hs : s < a) + (hball : ∀ r > 0, μ (Metric.ball (0:E) r) ≤ ENNReal.ofReal (C*r^s)) : + (∫⁻ x in Metric.ball (0:E) 4, ∫⁻ y, ENNReal.ofReal (‖x-y‖^(-a)) ∂μ) ≤ + (∫⁻ z in Metric.ball (0:E) 12, ENNReal.ofReal (‖z‖^(-a))) * ENNReal.ofReal (C*8^s) + + ENNReal.ofReal (tailNumber C a s) * volume (Metric.ball (0:E) 4) := by + have hpoint (x : E) (hx : x ∈ Metric.ball (0:E) 4) : + (∫⁻ y, ENNReal.ofReal (‖x-y‖^(-a)) ∂μ) ≤ + (∫⁻ y in Metric.ball (0:E) 8, ENNReal.ofReal (‖x-y‖^(-a)) ∂μ) + + ENNReal.ofReal (tailNumber C a s) := by + rw [← lintegral_add_compl (fun y => ENNReal.ofReal (‖x-y‖^(-a))) measurableSet_ball] + gcongr + exact uniform_shifted_tail μ hC ha hs hball x (le_of_lt (by simpa [Metric.mem_ball,dist_zero_right] using hx)) + calc + _ ≤ ∫⁻ x in Metric.ball (0:E) 4, + (∫⁻ y in Metric.ball (0:E) 8, ENNReal.ofReal (‖x-y‖^(-a)) ∂μ) + + ENNReal.ofReal (tailNumber C a s) := setLIntegral_mono' measurableSet_ball hpoint + _ = (∫⁻ x in Metric.ball (0:E) 4, ∫⁻ y in Metric.ball (0:E) 8, ENNReal.ofReal (‖x-y‖^(-a)) ∂μ) + + ENNReal.ofReal (tailNumber C a s) * volume (Metric.ball (0:E) 4) := by + rw [lintegral_add_right _ measurable_const,setLIntegral_const] + _ ≤ _ := by + apply add_le_add _ le_rfl + rw [lintegral_lintegral_swap (by fun_prop)] + calc + _ ≤ ∫⁻ y in Metric.ball (0:E) 8, (∫⁻ z in Metric.ball (0:E) 12, ENNReal.ofReal (‖z‖^(-a))) ∂μ := by + apply setLIntegral_mono' measurableSet_ball + intro y hy + exact local_kernel_mass_le a (by simpa [Metric.mem_ball,dist_zero_right] using hy) + _ = (∫⁻ z in Metric.ball (0:E) 12, ENNReal.ofReal (‖z‖^(-a))) * μ (Metric.ball (0:E) 8) := + setLIntegral_const _ _ + _ ≤ _ := by gcongr; exact hball 8 (by norm_num) + +end HenonLaneEmden.UniformTail + +namespace HenonLaneEmden +open UniformTail + +noncomputable def sourceMeasure {n : ℕ} (u : Space n → ℝ) (q B : ℝ) : Measure (Space n) := + volume.withDensity (fun x => ENNReal.ofReal (source u q B x)) + +lemma IsSolution.sourceMeasure_ball {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (R : ℝ) : + sourceMeasure v p A (Metric.ball (0:Space n) R) = ENNReal.ofReal (sourceMass v p A R) := by + rw [sourceMeasure,withDensity_apply _ measurableSet_ball] + exact (ofReal_integral_eq_lintegral_ofReal + (((h.source_g_locallyIntegrable hn).integrableOn_isCompact (isCompact_closedBall _ R)).mono_set + Metric.ball_subset_closedBall) + (Eventually.of_forall (source_nonneg (fun y => (h.positive_v y).le) p A))).symm + +lemma IsSolution.uniform_source_tail_g {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + ∀ x : Space n, ‖x‖ ≤ 4 → + (∫⁻ y in (Metric.ball (0:Space n) 8)ᶜ, ENNReal.ofReal (‖x-y‖^(2-(n:ℝ))) + ∂sourceMeasure v p A) ≤ ENNReal.ofReal + (2^((n:ℝ)-2) * (sourceConstant n p q A B * 2^((n:ℝ)-2-alpha p q A B) * + 8^(-alpha p q A B) / (1-2^(-alpha p q A B)))) := by + have hn3 := h.dimension_ge_three hn + have hn3' : (3:ℝ) ≤ n := by exact_mod_cast hn3 + have hA := h.first_weight_gt_neg_two hn + have hB := h.swap.first_weight_gt_neg_two hn + have ha := alpha_pos hp hA hB (h.product_gt_one hn hp hq) + simpa only [neg_sub,show (n:ℝ)-2-alpha p q A B-((n:ℝ)-2) = -alpha p q A B by ring] using uniform_shifted_tail (sourceMeasure v p A) + (sourceConstant_pos hn3 hA hB).le (show 0 ≤ (n:ℝ)-2 by linarith) + (show (n:ℝ)-2-alpha p q A B < (n:ℝ)-2 by linarith) + (fun R hR => by rw [h.sourceMeasure_ball hn]; exact ENNReal.ofReal_le_ofReal (h.sourceMass_g_upper hn hp hq hR)) + + +instance sourceMeasure_sigmaFinite {n : ℕ} (u : Space n → ℝ) (q B : ℝ) : + SigmaFinite (sourceMeasure u q B) := by unfold sourceMeasure; infer_instance + +lemma lintegral_sourceMeasure {n : ℕ} {u : Space n → ℝ} (hu : Continuous u) (q B : ℝ) + {F : Space n → ℝ≥0∞} (hF : Measurable F) : + (∫⁻ y, F y ∂sourceMeasure u q B) = ∫⁻ y, ENNReal.ofReal (source u q B y)*F y := + lintegral_withDensity_eq_lintegral_mul volume (measurable_source hu q B).ennreal_ofReal hF + +lemma IsSolution.sourceMeasure_potential_u_ae {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hq : 0 < q) : + ∀ᵐ x, (∫⁻ y, ENNReal.ofReal (‖x-y‖^(2-(n:ℝ))) ∂sourceMeasure v p A) = + ENNReal.ofReal (newtonDenom n*u x) := by + filter_upwards [h.potential_u_ae hn hq] with x hx + rw [lintegral_sourceMeasure h.continuous_v p A (by fun_prop),hx] + have hi := ofReal_integral_eq_lintegral_ofReal (h.kernel_g_integrable hn x) + (Eventually.of_forall fun y => mul_nonneg (Real.rpow_nonneg (norm_nonneg _) _) + (source_nonneg (fun y => (h.positive_v y).le) p A y)) + calc + _ = ∫⁻ y, ENNReal.ofReal (‖x-y‖^(2-(n:ℝ))*source v p A y) := by + apply lintegral_congr + intro y + rw [ENNReal.ofReal_mul (Real.rpow_nonneg (norm_nonneg _) _),mul_comm] + _ = _ := by simpa only [WeakPDE.rawPotential,finrank_euclideanSpace_fin] using hi.symm + +noncomputable def kernelMass (n : ℕ) : ℝ := + ∫ x in Metric.ball (0:Space n) 12, ‖x‖^(2-(n:ℝ)) + +lemma kernelMass_nonneg (n : ℕ) : 0 ≤ kernelMass n := + integral_nonneg (fun x => Real.rpow_nonneg (norm_nonneg x) _) + +lemma lintegral_kernelMass (n : ℕ) (hn : 1 ≤ n) : + (∫⁻ x in Metric.ball (0:Space n) 12, ENNReal.ofReal (‖x‖^(2-(n:ℝ)))) = ENNReal.ofReal (kernelMass n) := by + have hi := (WeakPDE.locallyIntegrable_newtonKernel (E := Space n) (by simpa using hn)).integrableOn_isCompact + (isCompact_closedBall (0:Space n) 12) + have hib : IntegrableOn (fun x : Space n => ‖x‖^(2-(n:ℝ))) (Metric.ball 0 12) := by + simpa only [finrank_euclideanSpace_fin] using hi.mono_set Metric.ball_subset_closedBall + exact (ofReal_integral_eq_lintegral_ofReal hib + (Eventually.of_forall fun x => Real.rpow_nonneg (norm_nonneg x) _)).symm + +noncomputable def uniformTailConstant (n : ℕ) (p q A B : ℝ) : ℝ := + tailNumber (sourceConstant n p q A B) ((n:ℝ)-2) ((n:ℝ)-2-alpha p q A B) + +noncomputable def uniformMassConstant (n : ℕ) (p q A B : ℝ) : ℝ := + (kernelMass n*(sourceConstant n p q A B*8^((n:ℝ)-2-alpha p q A B)) + + uniformTailConstant n p q A B * (volume (Metric.ball (0:Space n) 4)).toReal) / newtonDenom n + +lemma IsSolution.uniform_u_mass {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) : + (∫ x in Metric.ball (0:Space n) 4, u x) ≤ uniformMassConstant n p q A B := by + have hn3 := h.dimension_ge_three hn + have hn3' : (3:ℝ) ≤ n := by exact_mod_cast hn3 + have hA := h.first_weight_gt_neg_two hn + have hB := h.swap.first_weight_gt_neg_two hn + have ha := alpha_pos hp hA hB (h.product_gt_one hn hp hq) + have hC : 0 ≤ sourceConstant n p q A B := (sourceConstant_pos hn3 hA hB).le + have hT : 0 ≤ uniformTailConstant n p q A B := tailNumber_nonneg hC (by linarith) + have hh := local_potential_bound (sourceMeasure v p A) hC + (show 0 ≤ (n:ℝ)-2 by linarith) + (show (n:ℝ)-2-alpha p q A B < (n:ℝ)-2 by linarith) + (fun R hR => by rw [h.sourceMeasure_ball hn]; exact ENNReal.ofReal_le_ofReal (h.sourceMass_g_upper hn hp hq hR)) + simp only [neg_sub] at hh + rw [lintegral_congr_ae (ae_restrict_of_ae (h.sourceMeasure_potential_u_ae hn hq)), + lintegral_kernelMass n (by omega)] at hh + have huf : IntegrableOn (fun x => newtonDenom n*u x) (Metric.ball (0:Space n) 4) := + ((continuous_const.mul h.continuous_u).continuousOn.integrableOn_compact (isCompact_closedBall _ 4)).mono_set + Metric.ball_subset_closedBall + rw [← ofReal_integral_eq_lintegral_ofReal huf (Eventually.of_forall fun x => + mul_nonneg (newtonDenom_pos hn3).le (h.positive_u x).le),integral_const_mul] at hh + have hv : volume (Metric.ball (0:Space n) 4) = + ENNReal.ofReal ((volume (Metric.ball (0:Space n) 4)).toReal) := + (ENNReal.ofReal_toReal measure_ball_lt_top.ne).symm + change ENNReal.ofReal (newtonDenom n * _) ≤ _ + ENNReal.ofReal (uniformTailConstant n p q A B) * _ at hh + rw [hv,← ENNReal.ofReal_mul (kernelMass_nonneg n), + ← ENNReal.ofReal_mul hT, + ← ENNReal.ofReal_add (mul_nonneg (kernelMass_nonneg n) (mul_nonneg hC (by positivity))) + (mul_nonneg hT ENNReal.toReal_nonneg)] at hh + apply (le_div_iff₀ (newtonDenom_pos hn3)).mpr + rw [mul_comm] + exact (ENNReal.ofReal_le_ofReal_iff (add_nonneg + (mul_nonneg (kernelMass_nonneg n) (mul_nonneg hC (by positivity))) + (mul_nonneg hT ENNReal.toReal_nonneg))).mp hh + +lemma IsSolution.uniform_g_truncated {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) (hp : 0 < p) (hq : 0 < q) + {x : Space n} (hx : ‖x‖ ≤ 4) {l : ℝ} (hl : 0 < l) (hl1 : l ≤ 1) : + (∫⁻ y in {y | l ≤ ‖x-y‖}, ENNReal.ofReal (‖x-y‖^(2-(n:ℝ))) ∂sourceMeasure v p A) ≤ + ENNReal.ofReal ((sourceConstant n p q A B*8^((n:ℝ)-2-alpha p q A B)+uniformTailConstant n p q A B)*l^(2-(n:ℝ))) := by + have hn3 := h.dimension_ge_three hn + have hn3' : (3:ℝ) ≤ n := by exact_mod_cast hn3 + have hA := h.first_weight_gt_neg_two hn + have hB := h.swap.first_weight_gt_neg_two hn + have ha := alpha_pos hp hA hB (h.product_gt_one hn hp hq) + simpa only [neg_sub,uniformTailConstant] using + truncated_potential_bound (sourceMeasure v p A) (sourceConstant_pos hn3 hA hB).le + (show 0 ≤ (n:ℝ)-2 by linarith) + (show (n:ℝ)-2-alpha p q A B < (n:ℝ)-2 by linarith) + (fun R hR => by rw [h.sourceMeasure_ball hn]; exact ENNReal.ofReal_le_ofReal (h.sourceMass_g_upper hn hp hq hR)) hx hl hl1 + +end HenonLaneEmden +end UniformBounds + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/UniformEnergy.lean b/lean/OAI/Analysis/HenonEmden/UniformEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..3573e60eb2696021b9e171dc52b23899c13aacbe --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/UniformEnergy.lean @@ -0,0 +1,92 @@ +import OAI.Analysis.HenonEmden.RelativeLocalization + +namespace OAI + +section UniformEnergy + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open Cutoff + +lemma weighted_uniform_energy {n : ℕ} (hn : 3 ≤ n) {p q A B : ℝ} (hp : 0 < p) (hq : 0 < q) + (hsub : Subcritical n p q A B) : ∃ C : ℝ, 0 ≤ C ∧ + ∀ u v : Space n → ℝ, IsSolution n p q A B u v → + weightedEnergy (eta n) u q B+weightedEnergy (eta n) v p A ≤ C := by + let c₁ := ((n:ℝ)+B)/(q+1)-((n:ℝ)-2) + let c₂ := ((n:ℝ)+A)/(p+1) + let γ := c₁+c₂ + have hγ : 0 < γ := by dsimp [γ,c₁,c₂]; unfold Subcritical at hsub; linarith + have hn2 : 0 ≤ (n:ℝ)-2 := by + have hn' : (3:ℝ) ≤ n := by exact_mod_cast hn + linarith + let K := (n:ℝ)-2+|(c₁-c₂)/2| + have hK : 0 ≤ K := add_nonneg hn2 (abs_nonneg _) + let ε := γ/(4*(1+K)) + have hε : 0 < ε := div_pos hγ (by positivity) + have hεeq : (1+K)*ε=γ/4 := by + dsimp [ε] + field_simp + obtain ⟨CP,hCP,hP⟩ := pressure_relative hn hp hq hε + obtain ⟨CL,hCL,hL⟩ := localization_relative (by omega : 2 ≤ n) hp hq hε + refine ⟨4*(CP+K*CL)/γ,by positivity,?_⟩ + intro u v h + let Ef := weightedEnergy (eta n) u q B + let Eg := weightedEnergy (eta n) v p A + let Q := localQ (source u q B) (source v p A) + let T := (q+1)⁻¹*weightedEnergy (w n) u q B+(p+1)⁻¹*weightedEnergy (w n) v p A- + radialPressure (source u q B) (source v p A) + have hEid : c₁*Ef+c₂*Eg=T+((n:ℝ)-2)*Q := h.closing_identity (by omega) hp hq + have hT : T ≤ ε*(Ef+Eg)+CP := hP u v h + have hQ : |Q|+|Ef-Eg| ≤ ε*(Ef+Eg)+CL := hL u v h + have hcomb : γ/2*(Ef+Eg)=T+((n:ℝ)-2)*Q-((c₁-c₂)/2)*(Ef-Eg) := by + dsimp only [γ] + nlinarith [hEid] + have hneg : -((c₁-c₂)/2)*(Ef-Eg) ≤ |(c₁-c₂)/2| *|Ef-Eg| := by + simpa only [abs_mul,neg_mul] using neg_le_abs (((c₁-c₂)/2)*(Ef-Eg)) + have herror : ((n:ℝ)-2)*Q-((c₁-c₂)/2)*(Ef-Eg) ≤ K*(|Q|+|Ef-Eg|) := by + have h1 := mul_le_mul_of_nonneg_left (le_abs_self Q) hn2 + have h2 := mul_nonneg hn2 (abs_nonneg (Ef-Eg)) + have h3 := mul_nonneg (abs_nonneg ((c₁-c₂)/2)) (abs_nonneg Q) + dsimp only [K] + nlinarith [h1,hneg,h2,h3] + have hclose : γ/2*(Ef+Eg) ≤ (1+K)*ε*(Ef+Eg)+CP+K*CL := by + have hmul := mul_le_mul_of_nonneg_left hQ hK + nlinarith [hcomb,herror,hT,hmul] + rw [hεeq] at hclose + apply (le_div_iff₀ hγ).mpr + change (Ef+Eg)*γ ≤ 4*(CP+K*CL) + nlinarith [hclose] + +lemma IsSolution.unit_energy_le_weighted {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v : Space n → ℝ} (h : IsSolution n p q A B u v) : + (∫⁻ x in ball (0:Space n) 1, ENNReal.ofReal (energyDensity u q B x)) ≤ + ENNReal.ofReal (weightedEnergy (eta n) u q B) := by + have : Nontrivial (Space n) := Module.nontrivial_of_finrank_pos (R := ℝ) (by simp; omega) + rw [← h.weightedEnergyN_eq hn (continuous_eta n) (compactSupport_eta n) (eta_nonneg n)] + unfold weightedEnergyN + rw [← lintegral_indicator measurableSet_ball] + apply lintegral_mono_ae + filter_upwards [ae_iff.mpr (by simp : volume {x : Space n | ¬ x ≠ 0}=0)] with x hx + by_cases hb : x ∈ ball (0:Space n) 1 + · rw [indicator_of_mem hb,energyDensity_eq_source_mul h.positive_u q B hx, + eta_eq_one (mem_ball_zero_iff.mp hb).le,one_mul] + · rw [indicator_of_notMem hb] + exact bot_le + +lemma uniform_unit_energy {n : ℕ} (hn : 3 ≤ n) {p q A B : ℝ} (hp : 0 < p) (hq : 0 < q) + (hsub : Subcritical n p q A B) : ∃ C : ℝ, 0 ≤ C ∧ + ∀ u v : Space n → ℝ, IsSolution n p q A B u v → + (∫⁻ x in ball (0:Space n) 1, ENNReal.ofReal (energyDensity u q B x)) ≤ ENNReal.ofReal C := by + obtain ⟨C,hC,hbound⟩ := weighted_uniform_energy hn hp hq hsub + refine ⟨C,hC,fun u v h => (h.unit_energy_le_weighted (by omega)).trans (ENNReal.ofReal_le_ofReal ?_)⟩ + have hEg : 0 ≤ weightedEnergy (eta n) v p A := + weightedEnergyN_nonneg (eta_nonneg n) (fun x => (h.positive_v x).le) + linarith [hbound u v h] + +end HenonLaneEmden +end +end UniformEnergy + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/VirialCalculus.lean b/lean/OAI/Analysis/HenonEmden/VirialCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d0aec5b4948afe378b21d5af50828c292fbd6b6 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/VirialCalculus.lean @@ -0,0 +1,76 @@ +import OAI.Analysis.HenonEmden.Gradients + +namespace OAI + +section VirialCalculus + +open MeasureTheory Set Filter Topology Metric +open scoped InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open WeakPDE RadialCalculus + +lemma regular_energyDensity {n : ℕ} {u : Space n → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n))) (hup : ∀ x, 0 < u x) (q B : ℝ) : + ContDiffOn ℝ 2 (energyDensity u q B) ({0}ᶜ : Set (Space n)) := by + exact ((contDiffOn_id.norm ℝ (fun x hx => by simpa using hx)).rpow_const_of_ne + (fun x hx => norm_ne_zero_iff.mpr (by simpa using hx))).mul + (hu.rpow_const_of_ne (fun x _ => ne_of_gt (hup x))) + +lemma dir_energyDensity {n : ℕ} {u : Space n → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n))) (hup : ∀ x, 0 < u x) + (q B : ℝ) {x : Space n} (hx : x ≠ 0) (e : Space n) : + dir (energyDensity u q B) e x = + B*inner ℝ x e/‖x‖^2*energyDensity u q B x+(q+1)*source u q B x*dir u e x := by + have hr : 0 < ‖x‖ := norm_pos_iff.mpr hx + have huD := (hu.contDiffAt (isOpen_compl_singleton.mem_nhds hx)).differentiableAt (by norm_num) + have hrD := hasFDerivAt_profile_norm hx (Real.hasDerivAt_rpow_const (p := B) (Or.inl hr.ne')) + have hpD := huD.hasFDerivAt.rpow_const (p := q+1) (Or.inl (hup x).ne') + have hD := hrD.mul hpD + change HasFDerivAt (energyDensity u q B) _ x at hD + rw [dir,hD.fderiv] + simp only [add_apply,smul_apply,innerSL_apply_apply,smul_eq_mul] + rw [show q+1-1=q by ring,source_off_zero _ _ _ hx] + unfold energyDensity dir + rw [Real.rpow_sub hr,Real.rpow_one] + field_simp + ring + +lemma weighted_virial_scalar_test {n : ℕ} {u φ : Space n → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n))) (hup : ∀ x, 0 < u x) + (q B : ℝ) (hφ : ContDiff ℝ 1 φ) (hφc : HasCompactSupport φ) + (hφ0 : 0 ∉ tsupport φ) (e : Space n) : + (∫ x, energyDensity u q B x*dir φ e x) = + -(∫ x, (B*inner ℝ x e/‖x‖^2*energyDensity u q B x+ + (q+1)*source u q B x*dir u e x)*φ x) := by + have hF := regular_energyDensity hu hup q B + have hs : tsupport φ ⊆ ({0}ᶜ : Set (Space n)) := by + intro x hx; simp only [mem_compl_iff,mem_singleton_iff]; intro hx0; subst x; exact hφ0 hx + have hφD : ContDiff ℝ 0 (dir φ e) := contDiffOn_univ.mp (contDiffOn_dir hφ.contDiffOn isOpen_univ e) + have hFc : ContinuousOn (dir (energyDensity u q B) e) ({0}ᶜ : Set (Space n)) := + (contDiffOn_dir (k := 1) hF isOpen_compl_singleton e).continuousOn + have hi1 : Integrable (fun x => dir (energyDensity u q B) e x*φ x) := + integrable_mul_compact hφc (hFc.mono hs) hφ.continuous.continuousOn + have hi2 : Integrable (fun x => energyDensity u q B x*dir φ e x) := + integrable_mul_compact (compactSupport_dir hφc e) + (hF.continuousOn.mono ((tsupport_dir_subset φ e).trans hs)) hφD.continuous.continuousOn + have hi3 : Integrable (fun x => energyDensity u q B x*φ x) := + integrable_mul_compact hφc (hF.continuousOn.mono hs) hφ.continuous.continuousOn + have hI := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable (μ := volume) + (f := energyDensity u q B) (g := φ) (v := e) hi1 hi2 hi3 + (fun x hx => (hF.contDiffAt (isOpen_compl_singleton.mem_nhds (hs hx))).differentiableAt (by norm_num)) + (fun x _ => hφ.differentiable (by norm_num) x) + change (∫ x, energyDensity u q B x*dir φ e x) = -(∫ x, dir (energyDensity u q B) e x*φ x) at hI + rw [hI] + congr 1 + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x ∈ tsupport φ + · rw [dir_energyDensity hu hup q B (hs hx) e] + · rw [image_eq_zero_of_notMem_tsupport hx,mul_zero,mul_zero] + +end HenonLaneEmden +end +end VirialCalculus + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/WeakForm.lean b/lean/OAI/Analysis/HenonEmden/WeakForm.lean new file mode 100644 index 0000000000000000000000000000000000000000..c1bf7877a6136d810eac8e3269794802d8581ae3 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/WeakForm.lean @@ -0,0 +1,270 @@ +import OAI.Analysis.HenonEmden.LineCoordinates + +namespace OAI + +universe uE uE2 + +section WeakForm + + + +open Set Filter Topology MeasureTheory +open scoped ContDiff +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + [MeasurableSpace E] [BorelSpace E] + +lemma integrable_mul_compact {f g : E → ℝ} (hg : HasCompactSupport g) + (hf : ContinuousOn f (tsupport g)) (hgc : ContinuousOn g (tsupport g)) : + Integrable (fun x => f x*g x) := by + apply (integrableOn_iff_integrable_of_support_subset ?_).mp + ((hf.mul hgc).integrableOn_compact hg) + intro x hx + apply subset_tsupport g + exact (mul_ne_zero_iff.mp hx).2 + +noncomputable def dir (f : E → ℝ) (e : E) : E → ℝ := fun x => fderiv ℝ f x e + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma tsupport_dir_subset (f : E → ℝ) (e : E) : tsupport (dir f e) ⊆ tsupport f := + tsupport_fderiv_apply_subset ℝ e + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma compactSupport_dir {f : E → ℝ} (hf : HasCompactSupport f) (e : E) : + HasCompactSupport (dir f e) := hf.fderiv_apply ℝ e + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma contDiffOn_dir {f : E → ℝ} {s : Set E} {k : ℕ∞ω} + (hf : ContDiffOn ℝ (k+1) f s) (hs : IsOpen s) (e : E) : + ContDiffOn ℝ k (dir f e) s := + (hf.fderiv_of_isOpen hs le_rfl).clm_apply contDiffOn_const + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma differentiableAt_dir {f : E → ℝ} {s : Set E} + (hf : ContDiffOn ℝ 2 f s) (hs : IsOpen s) {x : E} (hx : x ∈ s) (e : E) : + DifferentiableAt ℝ (dir f e) x := by + have hc : ContDiffOn ℝ 1 (dir f e) s := contDiffOn_dir hf hs e + exact (hc.contDiffAt (hs.mem_nhds hx)).differentiableAt (by norm_num) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma dir_dir {f : E → ℝ} {s : Set E} (hf : ContDiffOn ℝ 2 f s) + (hs : IsOpen s) {x : E} (hx : x ∈ s) (e : E) : + dir (dir f e) e x = iteratedFDeriv ℝ 2 f x ![e,e] := by + have hd : DifferentiableAt ℝ (fderiv ℝ f) x := + ((hf.fderiv_of_isOpen hs (m := 1) (by norm_num)).contDiffAt + (hs.mem_nhds hx)).differentiableAt (by norm_num) + rw [← bilinearIteratedFDerivTwo_eq_iteratedFDeriv] + change (fderiv ℝ (fun y => (fderiv ℝ f y) e) x) e = ((fderiv ℝ (fderiv ℝ f) x) e) e + rw [fderiv_clm_apply hd (differentiableAt_const e)] + simp + +lemma integral_laplacian_test {u φ : E → ℝ} {s : Set E} (hs : IsOpen s) + (hu : ContDiffOn ℝ 2 u s) (hφ : ContDiff ℝ 2 φ) (hφc : HasCompactSupport φ) + (hφs : tsupport φ ⊆ s) : + (∫ x, u x * Laplacian.laplacian φ x) = ∫ x, Laplacian.laplacian u x * φ x := by + have hφon : ContDiffOn ℝ 2 φ univ := hφ.contDiffOn + have hφ1 (e : E) : ContDiff ℝ 1 (dir φ e) := by + exact contDiffOn_univ.mp (contDiffOn_dir hφon isOpen_univ e) + have hu1 (e : E) : ContDiffOn ℝ 1 (dir u e) s := contDiffOn_dir hu hs e + have hi1 (e : E) : Integrable (fun x => dir u e x * φ x) := + integrable_mul_compact hφc ((hu1 e).continuousOn.mono hφs) hφ.continuous.continuousOn + have hi2 (e : E) : Integrable (fun x => dir u e x * dir φ e x) := + integrable_mul_compact (compactSupport_dir hφc e) + ((hu1 e).continuousOn.mono ((tsupport_dir_subset φ e).trans hφs)) + (hφ1 e).continuous.continuousOn + have hi3 (e : E) : Integrable (fun x => dir (dir u e) e x * φ x) := by + have hc : ContinuousOn (dir (dir u e) e) s := + (contDiffOn_dir (k := 0) (by simpa using hu1 e) hs e).continuousOn + exact integrable_mul_compact hφc (hc.mono hφs) hφ.continuous.continuousOn + have hi4 (e : E) : Integrable (fun x => u x * dir φ e x) := + integrable_mul_compact (compactSupport_dir hφc e) + (hu.continuousOn.mono ((tsupport_dir_subset φ e).trans hφs)) + (hφ1 e).continuous.continuousOn + have hi5 (e : E) : Integrable (fun x => u x * dir (dir φ e) e x) := by + have hc : Continuous (dir (dir φ e) e) := by + exact (show ContDiff ℝ 0 (dir (dir φ e) e) from + contDiffOn_univ.mp (contDiffOn_dir (hφ1 e).contDiffOn isOpen_univ e)).continuous + exact integrable_mul_compact (compactSupport_dir (compactSupport_dir hφc e) e) + (hu.continuousOn.mono (((tsupport_dir_subset (dir φ e) e).trans + (tsupport_dir_subset φ e)).trans hφs)) hc.continuousOn + have hidentity (e : E) : (∫ x, u x * dir (dir φ e) e x) = + ∫ x, dir (dir u e) e x * φ x := by + have hA := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable (μ := volume) + (f := u) (g := dir φ e) (v := e) (hi2 e) (hi5 e) (hi4 e) + (fun x hx => (hu.contDiffAt (hs.mem_nhds (hφs (tsupport_dir_subset φ e hx)))).differentiableAt + (by norm_num)) + (fun x _ => (hφ1 e).differentiable (by norm_num) x) + have hB := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable (μ := volume) + (f := dir u e) (g := φ) (v := e) (hi3 e) (hi2 e) (hi1 e) + (fun x hx => differentiableAt_dir hu hs (hφs hx) e) + (fun x _ => hφ.differentiable (by norm_num) x) + change (∫ x, u x * dir (dir φ e) e x) = -(∫ x, dir u e x * dir φ e x) at hA + change (∫ x, dir u e x * dir φ e x) = -(∫ x, dir (dir u e) e x * φ x) at hB + rw [hA,hB,neg_neg] + have hleft (x : E) : u x * Laplacian.laplacian φ x = + ∑ i, u x * dir (dir φ (stdOrthonormalBasis ℝ E i)) (stdOrthonormalBasis ℝ E i) x := by + rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis] + simp only [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + rw [dir_dir hφon isOpen_univ (mem_univ x)] + have hright (x : E) : Laplacian.laplacian u x * φ x = + ∑ i, dir (dir u (stdOrthonormalBasis ℝ E i)) (stdOrthonormalBasis ℝ E i) x * φ x := by + by_cases hx : x ∈ tsupport φ + · rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis] + simp only [Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + rw [dir_dir hu hs (hφs hx)] + · simp [image_eq_zero_of_notMem_tsupport hx] + simp_rw [hleft,hright] + rw [integral_finsetSum _ (fun i _ => hi5 _), integral_finsetSum _ (fun i _ => hi3 _)] + exact Finset.sum_congr rfl fun i _ => hidentity _ + +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE + +lemma ibp_compact_on {f f' φ : ℝ → ℝ} {s : Set ℝ} + (hf : ContinuousOn f s) (hf' : ContinuousOn f' s) + (hd : ∀ x ∈ s, HasDerivAt f (f' x) x) + (hφ : ContDiff ℝ 1 φ) (hc : HasCompactSupport φ) (hs : tsupport φ ⊆ s) : + (∫ x, f x * deriv φ x) = -(∫ x, f' x * φ x) := by + have hdc : Continuous (deriv φ) := hφ.continuous_deriv le_rfl + exact integral_mul_deriv_eq_deriv_mul_of_integrable + (fun x hx => hd x (hs hx)) (fun x _ => (hφ.differentiable one_ne_zero x).hasDerivAt) + (integrable_mul_compact hc.deriv (hf.mono ((tsupport_deriv_subset (f := φ)).trans hs)) + hdc.continuousOn) + (integrable_mul_compact hc (hf'.mono hs) hφ.continuous.continuousOn) + (integrable_mul_compact hc (hf.mono hs) hφ.continuous.continuousOn) + +lemma weighted_second_ibp {u u' u'' φ : ℝ → ℝ} {s : Set ℝ} (k : ℕ) + (hu : ContinuousOn u s) (hu' : ContinuousOn u' s) (hu'' : ContinuousOn u'' s) + (hdu : ∀ x ∈ s, HasDerivAt u (u' x) x) + (hdu' : ∀ x ∈ s, HasDerivAt u' (u'' x) x) + (hφ : ContDiff ℝ 2 φ) (hc : HasCompactSupport φ) (hs : tsupport φ ⊆ s) : + (∫ r, u r * (r^k * deriv (deriv φ) r + (k:ℝ)*r^(k-1)*deriv φ r)) = + ∫ r, (r^k * u'' r + (k:ℝ)*r^(k-1)*u' r)*φ r := by + have hφ' : ContDiff ℝ 1 (deriv φ) := hφ.deriv' + have hA : ContinuousOn (fun r : ℝ => r^k * u r) s := continuousOn_id.pow k |>.mul hu + have hA' : ContinuousOn (fun r : ℝ => r^k*u' r+(k:ℝ)*r^(k-1)*u r) s := by + fun_prop + have hAd : ∀ r ∈ s, HasDerivAt (fun x : ℝ => x^k*u x) + (r^k*u' r+(k:ℝ)*r^(k-1)*u r) r := by + intro r hr + convert! ((hasDerivAt_id r).pow k).mul (hdu r hr) using 1 + simp only [Pi.pow_apply, id_eq, mul_one] + ring + have hB : ContinuousOn (fun r : ℝ => r^k*u' r) s := continuousOn_id.pow k |>.mul hu' + have hB' : ContinuousOn (fun r : ℝ => r^k*u'' r+(k:ℝ)*r^(k-1)*u' r) s := by + fun_prop + have hBd : ∀ r ∈ s, HasDerivAt (fun x : ℝ => x^k*u' x) + (r^k*u'' r+(k:ℝ)*r^(k-1)*u' r) r := by + intro r hr + convert! ((hasDerivAt_id r).pow k).mul (hdu' r hr) using 1 + simp only [Pi.pow_apply, id_eq, mul_one] + ring + have h1 := ibp_compact_on hA hA' hAd hφ' hc.deriv ((tsupport_deriv_subset (f := φ)).trans hs) + have h2 := ibp_compact_on hB hB' hBd (hφ.of_le (by norm_num)) hc hs + have hiA := integrable_mul_compact hc.deriv.deriv + (hA.mono (((tsupport_deriv_subset (f := deriv φ)).trans (tsupport_deriv_subset (f := φ))).trans hs)) + (hφ'.continuous_deriv le_rfl).continuousOn + have hiC : Integrable (fun r : ℝ => ((k:ℝ)*r^(k-1)*u r)*deriv φ r) := by + apply integrable_mul_compact hc.deriv _ hφ'.continuous.continuousOn + exact ((continuousOn_const.mul (continuousOn_id.pow (k-1))).mul hu).mono + ((tsupport_deriv_subset (f := φ)).trans hs) + have hiB := integrable_mul_compact hc.deriv + (hB.mono ((tsupport_deriv_subset (f := φ)).trans hs)) hφ'.continuous.continuousOn + calc + _ = (∫ r, (r^k*u r)*deriv (deriv φ) r) + + ∫ r, ((k:ℝ)*r^(k-1)*u r)*deriv φ r := by + rw [← integral_add hiA hiC] + congr 1; funext r; ring + _ = -(∫ r, (r^k*u' r+(k:ℝ)*r^(k-1)*u r)*deriv φ r) + + ∫ r, ((k:ℝ)*r^(k-1)*u r)*deriv φ r := by rw [h1] + _ = -(∫ r, (r^k*u' r)*deriv φ r) := by + simp_rw [add_mul] + rw [integral_add hiB hiC] + ring + _ = _ := by rw [h2,neg_neg] + +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +lemma radial_ode_of_weak {u u' u'' w : ℝ → ℝ} (k : ℕ) + (hu : ContinuousOn u (Ioi 0)) (hu' : ContinuousOn u' (Ioi 0)) + (hu'' : ContinuousOn u'' (Ioi 0)) (hw : ContinuousOn w (Ioi 0)) + (hdu : ∀ r > 0, HasDerivAt u (u' r) r) + (hdu' : ∀ r > 0, HasDerivAt u' (u'' r) r) + (hweak : ∀ φ : ℝ → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ Ioi 0 → + (∫ r, u r * (r^k*deriv (deriv φ) r+(k:ℝ)*r^(k-1)*deriv φ r)) = + ∫ r, r^k*w r*φ r) : + ∀ r > 0, r^k*u'' r+(k:ℝ)*r^(k-1)*u' r = r^k*w r := by + let F : ℝ → ℝ := fun r => r^k*u'' r+(k:ℝ)*r^(k-1)*u' r-r^k*w r + have hFc : ContinuousOn F (Ioi 0) := by unfold F; fun_prop + have hae : ∀ᵐ r, r ∈ Ioi (0:ℝ) → F r = 0 := by + apply isOpen_Ioi.ae_eq_zero_of_integral_contDiff_smul_eq_zero + (hFc.locallyIntegrableOn measurableSet_Ioi) + intro φ hφ hc hs + have htest := weighted_second_ibp k hu hu' hu'' hdu hdu' (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top)) hc hs + have hi1 : Integrable (fun r => (r^k*u'' r+(k:ℝ)*r^(k-1)*u' r)*φ r) := by + apply integrable_mul_compact hc _ hφ.continuous.continuousOn + have hp : ContinuousOn (fun r : ℝ => r^k*u'' r+(k:ℝ)*r^(k-1)*u' r) (Ioi 0) := by fun_prop + exact hp.mono hs + have hi2 : Integrable (fun r => r^k*w r*φ r) := + integrable_mul_compact hc (((continuousOn_id.pow k).mul hw).mono hs) hφ.continuous.continuousOn + calc + (∫ r, φ r • F r) = (∫ r, (r^k*u'' r+(k:ℝ)*r^(k-1)*u' r)*φ r) - + ∫ r, r^k*w r*φ r := by + rw [← integral_sub hi1 hi2] + congr 1; funext r; simp only [smul_eq_mul,F]; ring + _ = 0 := by rw [← htest, hweak φ hφ hc hs,sub_self] + have hae' : F =ᵐ[volume.restrict (Ioi (0:ℝ))] (fun _ => 0) := by + exact (ae_restrict_iff' measurableSet_Ioi).mpr hae + have heq := Measure.eqOn_open_of_ae_eq hae' isOpen_Ioi hFc continuousOn_const + intro r hr + exact sub_eq_zero.mp (heq hr) +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + +lemma continuousOn_laplacian {u : E → ℝ} {s : Set E} (hs : IsOpen s) + (hu : ContDiffOn ℝ 2 u s) : ContinuousOn (Laplacian.laplacian u) s := by + have hsum : ContinuousOn (fun x => ∑ i, dir (dir u (stdOrthonormalBasis ℝ E i)) + (stdOrthonormalBasis ℝ E i) x) s := by + apply continuousOn_finsetSum + intro i _ + exact (contDiffOn_dir (k := 0) (contDiffOn_dir hu hs _) hs _).continuousOn + apply hsum.congr + intro x hx + rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis] + apply Finset.sum_congr rfl + intro i _ + exact (dir_dir hu hs hx _).symm + +lemma laplacian_zero_of_notMem_tsupport {u : E → ℝ} {x : E} (hx : x ∉ tsupport u) : + Laplacian.laplacian u x = 0 := by + rw [(InnerProductSpace.laplacian_congr_nhds (notMem_tsupport_iff_eventuallyEq.mp hx)).self_of_nhds, + InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis] + simp + +lemma tsupport_laplacian_subset (u : E → ℝ) : tsupport (Laplacian.laplacian u) ⊆ tsupport u := by + apply closure_minimal _ (isClosed_tsupport u) + intro x hx + by_contra hn + exact hx (laplacian_zero_of_notMem_tsupport hn) + +lemma compactSupport_laplacian {u : E → ℝ} (hu : HasCompactSupport u) : + HasCompactSupport (Laplacian.laplacian u) := + hu.of_isClosed_subset (isClosed_tsupport _) (tsupport_laplacian_subset _) + +lemma continuous_laplacian {u : E → ℝ} (hu : ContDiff ℝ 2 u) : + Continuous (Laplacian.laplacian u) := by + rw [← continuousOn_univ] + exact continuousOn_laplacian isOpen_univ hu.contDiffOn +end HenonLaneEmden.WeakPDE + +end WeakForm + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/WeakOrigin.lean b/lean/OAI/Analysis/HenonEmden/WeakOrigin.lean new file mode 100644 index 0000000000000000000000000000000000000000..abfc6b6fb0de00c727dee75469835105084303d3 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/WeakOrigin.lean @@ -0,0 +1,117 @@ +import OAI.Analysis.HenonEmden.RadialODE + +namespace OAI + +universe uE uE2 + +section WeakOrigin + +open Set Filter Topology MeasureTheory +open scoped ContDiff +open Set Filter Topology +open scoped RealInnerProductSpace ContDiff +open Set Filter Topology +open scoped ContDiff +open Set MeasureTheory MeasureTheory.Measure +open scoped ENNReal +open Set Filter Topology MeasureTheory +open Set Filter Topology +open MeasureTheory +noncomputable section + + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] +omit [FiniteDimensional ℝ E] in +lemma dir_mul {f g : E → ℝ} {x : E} + (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (e : E) : + dir (fun y => f y*g y) e x = dir f e x*g x+f x*dir g e x := by + unfold dir + change (fderiv ℝ (f*g) x) e = _ + rw [fderiv_mul hf hg] + simp [smul_eq_mul] + ring + +omit [FiniteDimensional ℝ E] in +lemma dir_dir_mul {f g : E → ℝ} (hf : ContDiff ℝ 2 f) (hg : ContDiff ℝ 2 g) (e x : E) : + dir (dir (fun y => f y*g y) e) e x = + dir (dir f e) e x*g x+2*(dir f e x*dir g e x)+f x*dir (dir g e) e x := by + have heq : dir (fun y => f y*g y) e = fun y => dir f e y*g y+f y*dir g e y := by + ext y; exact dir_mul (hf.differentiable (by norm_num) y) (hg.differentiable (by norm_num) y) e + rw [heq] + have hdf := differentiableAt_dir hf.contDiffOn isOpen_univ (mem_univ x) e + have hdg := differentiableAt_dir hg.contDiffOn isOpen_univ (mem_univ x) e + have hfx := hf.differentiable (by norm_num) x + have hgx := hg.differentiable (by norm_num) x + change (fderiv ℝ (dir f e*g+f*dir g e) x) e = _ + rw [fderiv_add (hdf.mul hgx) (hfx.mul hdg),_root_.add_apply] + change dir (fun y => dir f e y*g y) e x+dir (fun y => f y*dir g e y) e x = _ + rw [dir_mul hdf hgx,dir_mul hfx hdg] + ring + +lemma laplacian_mul {f g : E → ℝ} (hf : ContDiff ℝ 2 f) (hg : ContDiff ℝ 2 g) (x : E) : + Laplacian.laplacian (fun y => f y*g y) x = + Laplacian.laplacian f x*g x+f x*Laplacian.laplacian g x+ + 2*∑ i, dir f (stdOrthonormalBasis ℝ E i) x*dir g (stdOrthonormalBasis ℝ E i) x := by + simp only [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis] + simp_rw [← dir_dir (hf.mul hg).contDiffOn isOpen_univ (mem_univ x), + dir_dir_mul hf hg,← dir_dir hf.contDiffOn isOpen_univ (mem_univ x), + ← dir_dir hg.contDiffOn isOpen_univ (mem_univ x)] + simp only [Finset.sum_add_distrib,Finset.sum_mul,Finset.mul_sum] + ring +end HenonLaneEmden.WeakPDE + +namespace HenonLaneEmden.WeakPDE +variable {E : Type uE2} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + +lemma laplacian_dilation {f : E → ℝ} (hf : ContDiff ℝ 2 f) (R : ℝ) (x : E) : + Laplacian.laplacian (fun y => f (R • y)) x = R^2*Laplacian.laplacian f (R • x) := by + simp only [InnerProductSpace.laplacian_eq_iteratedFDeriv_stdOrthonormalBasis] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + rw [iteratedFDeriv_comp_const_smul R hf] + simp [smul_eq_mul] + +omit [FiniteDimensional ℝ E] in +lemma dir_dilation (f : E → ℝ) (R : ℝ) (x e : E) : + dir (fun y => f (R • y)) e x = R*dir f e (R • x) := by + unfold dir + rw [fderiv_comp_smul] + simp + +lemma continuous_laplacian_dilation_mul {φ ξ : E → ℝ} (hφ : ContDiff ℝ 2 φ) (hξ : ContDiff ℝ 2 ξ) : + Continuous (fun z : ℝ × E => Laplacian.laplacian (fun y => φ (z.1 • y)*ξ y) z.2) := by + have hid (R : ℝ) (x : E) : Laplacian.laplacian (fun y => φ (R • y)*ξ y) x = + R^2*Laplacian.laplacian φ (R • x)*ξ x+φ (R • x)*Laplacian.laplacian ξ x+ + 2*∑ i, (R*dir φ (stdOrthonormalBasis ℝ E i) (R • x))*dir ξ (stdOrthonormalBasis ℝ E i) x := by + have hh : ContDiff ℝ 2 (fun y => φ (R • y)) := hφ.comp (contDiff_const.smul contDiff_id) + rw [laplacian_mul hh hξ, + laplacian_dilation hφ] + simp_rw [dir_dilation] + simp_rw [hid] + have hφlap := continuous_laplacian hφ + have hξlap := continuous_laplacian hξ + have hφd (e : E) : Continuous (dir φ e) := + (contDiffOn_univ.mp (contDiffOn_dir (k := 1) hφ.contDiffOn isOpen_univ e)).continuous + have hξd (e : E) : Continuous (dir ξ e) := + (contDiffOn_univ.mp (contDiffOn_dir (k := 1) hξ.contDiffOn isOpen_univ e)).continuous + fun_prop + +variable [MeasurableSpace E] [BorelSpace E] +lemma continuous_cutoff_error {u φ ξ : E → ℝ} (hu : Continuous u) + (hφ : ContDiff ℝ 2 φ) (hξ : ContDiff ℝ 2 ξ) (hξc : HasCompactSupport ξ) : + Continuous (fun R : ℝ => ∫ y : E, u (R • y)*Laplacian.laplacian (fun z => φ (R • z)*ξ z) y) := by + rw [← continuousOn_univ] + apply continuousOn_integral_of_compact_support hξc + · exact ((hu.comp (continuous_fst.smul continuous_snd)).mul + (continuous_laplacian_dilation_mul hφ hξ)).continuousOn + · intro R y _ hy + have hh : y ∉ tsupport (fun z => φ (R • z)*ξ z) := fun h => hy (tsupport_mul_subset_right h) + rw [laplacian_zero_of_notMem_tsupport hh,mul_zero] +end HenonLaneEmden.WeakPDE + +end +end WeakOrigin + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/WeightedEndpoints.lean b/lean/OAI/Analysis/HenonEmden/WeightedEndpoints.lean new file mode 100644 index 0000000000000000000000000000000000000000..0cb1f77c6f756f4ab062ff721d1c56281159f294 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/WeightedEndpoints.lean @@ -0,0 +1,88 @@ +import OAI.Analysis.HenonEmden.LayerRecovery + +namespace OAI + +universe uE + +section WeightedEndpoints + +open MeasureTheory Set Metric +noncomputable section +namespace HenonLaneEmden.WeightedLayers + +lemma rpow_annulus_bound {r : ℝ} (hr : r ∈ Icc (1:ℝ) 2) (s : ℝ) : r^s ≤ 2^|s| := by + have hr0 : 0 ≤ r := by linarith [hr.1] + calc + _ ≤ r^|s| := Real.rpow_le_rpow_of_exponent_le hr.1 (le_abs_self s) + _ ≤ _ := Real.rpow_le_rpow hr0 hr.2 (abs_nonneg s) + +lemma rpow_annulus_lipschitz {r r' : ℝ} (hr : r ∈ Icc (1:ℝ) 2) + (hr' : r' ∈ Icc (1:ℝ) 2) (s : ℝ) : + |r'^s-r^s| ≤ (|s| *2^|s-1|)*|r'-r| := by + have hd (x : ℝ) (hx : x ∈ Icc (1:ℝ) 2) := Real.hasStrictDerivAt_rpow_const_of_ne + (ne_of_gt (show 0 < x by linarith [hx.1])) s |>.hasDerivAt + have hh := (convex_Icc (1:ℝ) 2).norm_image_sub_le_of_norm_hasDerivWithin_le + (fun x hx => (hd x hx).hasDerivWithinAt) + (show ∀ x ∈ Icc (1:ℝ) 2, ‖s*x^(s-1)‖ ≤ |s| *2^|s-1| from by + intro x hx + rw [Real.norm_eq_abs,abs_mul,abs_of_nonneg (Real.rpow_nonneg (by linarith [hx.1]) _)] + exact mul_le_mul_of_nonneg_left (rpow_annulus_bound hx (s-1)) (abs_nonneg s)) hr hr' + simpa only [Real.norm_eq_abs] using hh + +lemma rpow_annulus_relative {r r' : ℝ} (hr : r ∈ Icc (1:ℝ) 2) + (hr' : r' ∈ Icc (1:ℝ) 2) (s : ℝ) : + |r'^s-r^s| ≤ (|s| *2^|s-1| *2^|s|)*|r'-r| *r^s := by + have hr0 : 0 < r := by linarith [hr.1] + have hp : 1 ≤ 2^|s| *r^s := by + have hh := mul_le_mul_of_nonneg_right (rpow_annulus_bound hr (-s)) (Real.rpow_nonneg hr0.le s) + rw [abs_neg,← Real.rpow_add hr0,neg_add_cancel,Real.rpow_zero] at hh + exact hh + calc + _ ≤ (|s| *2^|s-1|)*|r'-r| := rpow_annulus_lipschitz hr hr' s + _ ≤ (|s| *2^|s-1|)*|r'-r| *(2^|s| *r^s) := by + exact le_mul_of_one_le_right (by positivity) hp + _ = _ := by ring + +lemma layer_root_radial {r t : ℝ} (hr : 0 < r) (ht : 0 ≤ t) (q B : ℝ) : + (t/r^B)^(1/q) = t^(1/q)*r^(-B/q) := by + rw [Real.div_rpow ht (Real.rpow_nonneg hr.le _),← Real.rpow_mul hr.le, + show -B/q = -(B*(1/q)) by ring,Real.rpow_neg hr.le,div_eq_mul_inv] + +lemma source_level_root {n : ℕ} {u : Space n → ℝ} {q B t : ℝ} + (hq : 0 < q) (hu : ∀ x, 0 < u x) {x : Space n} (hx : x ≠ 0) + (ht : source u q B x = t) : u x = (t/‖x‖^B)^(1/q) := by + rw [← ht,source_off_zero _ _ _ hx,mul_div_cancel_left₀ _ + (ne_of_gt (Real.rpow_pos_of_pos (norm_pos_iff.mpr hx) _)),← Real.rpow_mul (hu x).le] + have he : q*(1/q) = 1 := by field_simp + rw [he,Real.rpow_one] + +lemma radial_layer_endpoint_error {E : Type uE} [NormedAddCommGroup E] + {x y : E} (hx : ‖x‖ ∈ Icc (1:ℝ) 2) (hy : ‖y‖ ∈ Icc (1:ℝ) 2) + {q B t : ℝ} (ht : 0 ≤ t) : + |(t/‖y‖^B)^(1/q)-(t/‖x‖^B)^(1/q)| ≤ + (|-B/q| *2^|-B/q-1| *2^|-B/q|)*dist y x*(t/‖x‖^B)^(1/q) := by + have hx0 : 0 < ‖x‖ := by linarith [hx.1] + have hy0 : 0 < ‖y‖ := by linarith [hy.1] + rw [layer_root_radial hx0 ht,layer_root_radial hy0 ht,← mul_sub,abs_mul, + abs_of_nonneg (Real.rpow_nonneg ht _)] + have hh := rpow_annulus_relative hx hy (-B/q) + have hh' := hh.trans (mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left (abs_norm_sub_norm_le y x) (by positivity)) + (Real.rpow_nonneg hx0.le (-B/q))) + calc + _ ≤ t^(1/q)*((|-B/q| *2^|-B/q-1| *2^|-B/q|)*‖y-x‖*‖x‖^(-B/q)) := + mul_le_mul_of_nonneg_left hh' (Real.rpow_nonneg ht _) + _ = _ := by rw [dist_eq_norm]; ring + +lemma average_endpoint_error {a b τ ε : ℝ} + (ha : |a-τ| ≤ ε) (hb : |b-τ| ≤ ε) : |(a+b)/2-τ| ≤ ε := by + have hh := abs_add_le (a-τ) (b-τ) + rw [show (a+b)/2-τ = ((a-τ)+(b-τ))/2 by ring,abs_div] + norm_num + linarith + +end HenonLaneEmden.WeightedLayers +end +end WeightedEndpoints + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/WeightedEnergy.lean b/lean/OAI/Analysis/HenonEmden/WeightedEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c6d63630bec93a49a3359cdf1f59eb1ee829000 --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/WeightedEnergy.lean @@ -0,0 +1,67 @@ +import OAI.Analysis.HenonEmden.RootRecovery + +namespace OAI + +section WeightedEnergy + +open MeasureTheory Set Metric +open scoped ENNReal +noncomputable section +namespace HenonLaneEmden +open Cutoff AdaptiveCap + +lemma compactSupport_of_outer_zero {n : ℕ} {F : Space n → ℝ} + (hF : ∀ x, 2 ≤ ‖x‖ → F x=0) : HasCompactSupport F := by + apply HasCompactSupport.intro (K := closedBall 0 2) (isCompact_closedBall _ _) + intro x hx + exact hF x (not_lt.mp (fun hh => hx (mem_closedBall_zero_iff.mpr hh.le))) + +lemma compactSupport_eta (n : ℕ) : HasCompactSupport (eta n : Space n → ℝ) := + compactSupport_of_outer_zero (fun _ hx => eta_eq_zero hx) +lemma compactSupport_w (n : ℕ) : HasCompactSupport (w n : Space n → ℝ) := + compactSupport_of_outer_zero (fun _ hx => w_outer n hx) +lemma compactSupport_weight {n : ℕ} (κ : ℝ) (e : sphere (0:Space n) 1) : + HasCompactSupport (weight volume κ e) := + compactSupport_of_outer_zero (fun _ hx => weight_outer volume κ e hx) + +lemma IsSolution.integrable_source_energy_weight {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v χ : Space n → ℝ} (h : IsSolution n p q A B u v) + (hχ : Continuous χ) (hχc : HasCompactSupport χ) : + Integrable (fun x => χ x*source u q B x*u x) := by + have hl := ((h.source_f_locallyIntegrable hn).mul_continuous h.continuous_u).mul_continuous hχ + have hi := hl.integrableOn_isCompact hχc + apply (integrableOn_iff_integrable_of_support_subset ?_).mp + (hi.congr_fun (fun x _ => by ring) (isClosed_tsupport χ).measurableSet) + intro x hx + apply subset_tsupport χ + intro hz + exact hx (by simp [hz]) + +def weightedEnergy {n : ℕ} (χ u : Space n → ℝ) (q B : ℝ) : ℝ := + ∫ x, χ x*source u q B x*u x + +def weightedEnergyN {n : ℕ} (χ u : Space n → ℝ) (q B : ℝ) : ℝ≥0∞ := + ∫⁻ x, ENNReal.ofReal (χ x*source u q B x*u x) + +lemma weightedEnergyN_nonneg {n : ℕ} {χ u : Space n → ℝ} {q B : ℝ} + (hχ : ∀ x, 0 ≤ χ x) (hu : ∀ x, 0 ≤ u x) : 0 ≤ weightedEnergy χ u q B := by + exact integral_nonneg (fun x => mul_nonneg (mul_nonneg (hχ x) (source_nonneg hu q B x)) (hu x)) + +lemma IsSolution.weightedEnergyN_eq {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v χ : Space n → ℝ} (h : IsSolution n p q A B u v) + (hχ : Continuous χ) (hχc : HasCompactSupport χ) (hχ0 : ∀ x, 0 ≤ χ x) : + weightedEnergyN χ u q B = ENNReal.ofReal (weightedEnergy χ u q B) := by + exact (ofReal_integral_eq_lintegral_ofReal (h.integrable_source_energy_weight hn hχ hχc) + (ae_of_all _ fun x => mul_nonneg (mul_nonneg (hχ0 x) + (source_nonneg (fun y => (h.positive_u y).le) q B x)) (h.positive_u x).le)).symm + +lemma IsSolution.weightedEnergyN_finite {n : ℕ} (hn : 2 ≤ n) {p q A B : ℝ} + {u v χ : Space n → ℝ} (h : IsSolution n p q A B u v) + (hχ : Continuous χ) (hχc : HasCompactSupport χ) : weightedEnergyN χ u q B ≠ ⊤ := + (h.integrable_source_energy_weight hn hχ hχc).lintegral_lt_top.ne + +end HenonLaneEmden +end +end WeightedEnergy + +end OAI diff --git a/lean/OAI/Analysis/HenonEmden/WeightedVirial.lean b/lean/OAI/Analysis/HenonEmden/WeightedVirial.lean new file mode 100644 index 0000000000000000000000000000000000000000..c2ec6c5ef93623c8d88cf2b04bc2be11212c842e --- /dev/null +++ b/lean/OAI/Analysis/HenonEmden/WeightedVirial.lean @@ -0,0 +1,81 @@ +import OAI.Analysis.HenonEmden.CutoffSmooth + +namespace OAI + +section WeightedVirial + +open MeasureTheory Set Filter Topology Metric +open scoped InnerProductSpace +noncomputable section +namespace HenonLaneEmden +open WeakPDE Cutoff + +lemma continuousOn_radialDir {n : ℕ} {u : Space n → ℝ} + (hu : ContDiffOn ℝ 1 u ({0}ᶜ : Set (Space n))) : + ContinuousOn (fun x => dir u x x) ({0}ᶜ : Set (Space n)) := + (hu.continuousOn_fderiv_of_isOpen isOpen_compl_singleton le_rfl).clm_apply continuousOn_id + +lemma weighted_virial_off_origin {n : ℕ} {u θ : Space n → ℝ} + (hu : ContDiffOn ℝ 2 u ({0}ᶜ : Set (Space n))) (hup : ∀ x, 0 < u x) + (q B : ℝ) (hθ : ContDiff ℝ 1 θ) (hθc : HasCompactSupport θ) (hθ0 : 0 ∉ tsupport θ) : + (∫ x, energyDensity u q B x*((n+B)*θ x+dir θ x x)) = + -(q+1)*(∫ x, θ x*source u q B x*dir u x x) := by + have hF := regular_energyDensity hu hup q B + have hs : tsupport θ ⊆ ({0}ᶜ : Set (Space n)) := by + intro x hx + simp only [mem_compl_iff,mem_singleton_iff] + intro he; subst x; exact hθ0 hx + have hθc' : HasCompactSupport (fun x => B*θ x) := hθc.mul_left + have hiFθ : Integrable (fun x => energyDensity u q B x*θ x) := + integrable_mul_compact hθc (hF.continuousOn.mono hs) hθ.continuous.continuousOn + have hiG : Integrable (fun x => θ x*source u q B x*dir u x x) := by + have hc := (regular_source hu hup q B).continuousOn.mul (continuousOn_radialDir (hu.of_le (by norm_num))) + exact (integrable_mul_compact hθc (hc.mono hs) hθ.continuous.continuousOn).congr + (ae_of_all _ (fun _ => by dsimp only [Pi.mul_apply]; ring)) + have hiFD : Integrable (fun x => θ x*dir (energyDensity u q B) x x) := by + exact (integrable_mul_compact hθc ((continuousOn_radialDir (hF.of_le (by norm_num))).mono hs) + hθ.continuous.continuousOn).congr (ae_of_all _ (fun _ => mul_comm _ _)) + have hpoint (x : Space n) : θ x*dir (energyDensity u q B) x x = + B*(energyDensity u q B x*θ x)+(q+1)*(θ x*source u q B x*dir u x x) := by + by_cases hx : x ∈ tsupport θ + · have hx0 := hs hx + have hr := norm_ne_zero_iff.mpr hx0 + rw [dir_energyDensity hu hup q B hx0,real_inner_self_eq_norm_sq] + field_simp + · rw [image_eq_zero_of_notMem_tsupport hx] + ring + have hrad := integral_radial_test (hF.of_le (by norm_num)) hθ hθc hθ0 + have hiL : Integrable (fun x => energyDensity u q B x*((n:ℝ)*θ x+dir θ x x)) := by + have hc : Continuous (fun x : Space n => (n:ℝ)*θ x+dir θ x x) := (continuous_const.mul hθ.continuous).add ((hθ.continuous_fderiv (by norm_num)).clm_apply continuous_id) + have hk : HasCompactSupport (fun x => (n:ℝ)*θ x+dir θ x x) := by + apply HasCompactSupport.intro hθc + intro x hx + rw [image_eq_zero_of_notMem_tsupport hx] + have hd : fderiv ℝ θ x = 0 := fderiv_of_notMem_tsupport ℝ hx + simp [dir,hd] + have hsub : tsupport (fun x => (n:ℝ)*θ x+dir θ x x) ⊆ tsupport θ := by + apply closure_minimal _ (isClosed_tsupport θ) + intro x hx + contrapose! hx + simp only [Function.mem_support,not_not] + rw [image_eq_zero_of_notMem_tsupport hx] + have hd : fderiv ℝ θ x = 0 := fderiv_of_notMem_tsupport ℝ hx + simp [dir,hd] + exact integrable_mul_compact hk (hF.continuousOn.mono (hsub.trans hs)) hc.continuousOn + have hsumF := integral_add hiL (hiFθ.const_mul B) + have hsumG := integral_add (hiFθ.const_mul B) (hiG.const_mul (q+1)) + simp_rw [hpoint] at hrad + rw [hsumG,integral_const_mul,integral_const_mul] at hrad + calc + _ = (∫ x, energyDensity u q B x*((n:ℝ)*θ x+dir θ x x))+ + B*(∫ x, energyDensity u q B x*θ x) := by + rw [← integral_const_mul,← hsumF] + apply integral_congr_ae + exact ae_of_all _ (fun x => by ring) + _ = _ := by linarith + +end HenonLaneEmden +end +end WeightedVirial + +end OAI diff --git a/lean/OAI/Analysis/Herglotz.lean b/lean/OAI/Analysis/Herglotz.lean new file mode 100644 index 0000000000000000000000000000000000000000..7f7d904ed27369640d6b20f575db7d198205777f --- /dev/null +++ b/lean/OAI/Analysis/Herglotz.lean @@ -0,0 +1,1325 @@ +import Mathlib + +namespace OAI + +noncomputable section + +section +open scoped BigOperators ComplexConjugate ENNReal Topology +open MeasureTheory +open scoped ComplexConjugate +open scoped BigOperators ComplexConjugate +open scoped BigOperators +open MvPolynomial +open scoped BigOperators ComplexConjugate Classical +open Submodule +open ContinuousLinearMap +open scoped ENNReal +open Set Filter Topology Complex MeasureTheory +open Set Filter Topology Complex Metric +open MeasureTheory Set Filter Topology Complex Metric InnerProductSpace +open scoped ENNReal NNReal + +namespace EntropyPhotonNumber.Herglotz + +section Density +variable {X : Type*} [MeasurableSpace X] [TopologicalSpace X] [BorelSpace X] + [CompactSpace X] (μ : Measure X) [IsFiniteMeasure μ] + + +def densityMeasure (f : C(X, ℝ)) : FiniteMeasure X := + ⟨μ.withDensity (fun x => ENNReal.ofReal (f x)), + isFiniteMeasure_withDensity + (f.continuous.integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace f)).lintegral_lt_top.ne⟩ + +theorem integral_densityMeasure (f : C(X, ℝ)) (hf : ∀ x, 0 ≤ f x) (g : X → ℝ) : + (∫ x, g x ∂(densityMeasure μ f : Measure X)) = ∫ x, f x * g x ∂μ := by + change (∫ x, g x ∂μ.withDensity (fun x => ENNReal.ofReal (f x))) = _ + rw [integral_withDensity_eq_integral_toReal_smul + (show Measurable (fun x => ENNReal.ofReal (f x)) from + ENNReal.measurable_ofReal.comp f.continuous.measurable) + (by simp : ∀ᵐ x ∂μ, ENNReal.ofReal (f x) < ∞)] + simp only [ENNReal.toReal_ofReal (hf _), smul_eq_mul] + +theorem mass_densityMeasure (f : C(X, ℝ)) (hf : ∀ x, 0 ≤ f x) : + ((densityMeasure μ f).mass : ℝ) = ∫ x, f x ∂μ := by + have h := integral_densityMeasure μ f hf (fun _ => 1) + simpa only [integral_const, smul_eq_mul, mul_one, FiniteMeasure.measureReal_eq_coe_coeFn, + FiniteMeasure.mass] using h +end Density + +section WeakIntegral +variable {X : Type*} [MeasurableSpace X] [TopologicalSpace X] [BorelSpace X] + [CompactSpace X] + +theorem tendsto_integral_varying {ι : Type*} {l : Filter ι} + {μs : ι → FiniteMeasure X} {μ : FiniteMeasure X} + {fs : ι → C(X, ℝ)} {f : C(X, ℝ)} + (hμ : Tendsto μs l (𝓝 μ)) (hf : Tendsto fs l (𝓝 f)) : + Tendsto (fun i => ∫ x, fs i x ∂(μs i : Measure X)) l + (𝓝 (∫ x, f x ∂(μ : Measure X))) := by + have hfixed := (FiniteMeasure.continuous_integral_continuousMap f).continuousAt.tendsto.comp hμ + have hmass : Tendsto (fun i => ((μs i).mass : ℝ)) l (𝓝 (μ.mass : ℝ)) := + NNReal.continuous_coe.continuousAt.tendsto.comp + (FiniteMeasure.continuous_mass.continuousAt.tendsto.comp hμ) + have hnorm : Tendsto (fun i => ‖fs i - f‖) l (𝓝 0) := by + simpa using (hf.sub (tendsto_const_nhds (x := f))).norm + have hdiff : Tendsto (fun i => ∫ x, (fs i - f) x ∂(μs i : Measure X)) l (𝓝 0) := by + refine squeeze_zero_norm (fun i => ?_) (by simpa using hnorm.mul hmass) + simpa only [FiniteMeasure.measureReal_eq_coe_coeFn, FiniteMeasure.mass] using + (norm_integral_le_of_norm_le_const (μ := (μs i : Measure X)) + (Eventually.of_forall (fun x => (fs i - f).norm_coe_le_norm x))) + have hi (i : ι) : (∫ x, (fs i - f) x ∂(μs i : Measure X)) = + (∫ x, fs i x ∂(μs i : Measure X)) - ∫ x, f x ∂(μs i : Measure X) := + integral_sub + ((fs i).continuous.integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _)) + (f.continuous.integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _)) + simpa only [hi, Function.comp_apply, sub_add_cancel, zero_add] using hdiff.add hfixed + +theorem continuous_integral_varying : + Continuous (fun p : FiniteMeasure X × C(X, ℝ) => ∫ x, p.2 x ∂(p.1 : Measure X)) := by + apply continuous_iff_continuousAt.mpr + intro p + exact tendsto_integral_varying continuous_fst.continuousAt continuous_snd.continuousAt +end WeakIntegral + + + +abbrev Angle := Icc (0 : ℝ) (2 * Real.pi) + +local instance : MeasureSpace Angle := Measure.Subtype.measureSpace + +instance : IsFiniteMeasure (volume : Measure Angle) := by + constructor + rw [show (volume : Measure Angle) = Measure.comap Subtype.val volume from rfl, + Measure.comap_apply _ Subtype.val_injective + (MeasurableEmbedding.subtype_coe measurableSet_Icc).measurableSet_image' _ + MeasurableSet.univ] + simpa only [image_univ, Subtype.range_coe_subtype, ofPred_mem_eq] using + (isCompact_Icc : IsCompact (Icc (0 : ℝ) (2 * Real.pi))).measure_lt_top + +theorem integral_angle (F : ℝ → ℝ) : + (∫ θ : Angle, F θ) = ∫ θ in (0 : ℝ)..2 * Real.pi, F θ := by + rw [integral_subtype measurableSet_Icc F, integral_Icc_eq_integral_Ioc, + intervalIntegral.integral_of_le (by positivity)] + + +def RadialDensity (v : ℂ → ℝ) (R : ℝ) + (hv : ContinuousOn v (ball 0 1)) (hR : R ∈ Ioo 0 1) : C(Angle, ℝ) where + toFun θ := (2 * Real.pi)⁻¹ * v (circleMap 0 R θ) + continuous_toFun := by + apply continuous_const.mul + apply hv.comp_continuous ((continuous_circleMap 0 R).comp continuous_subtype_val) + intro θ + simp only [Function.comp_apply, mem_ball, dist_zero_right, norm_circleMap_zero, + abs_of_pos hR.1] + exact hR.2 + +theorem radialDensity_nonneg {v : ℂ → ℝ} {R : ℝ} + (hv : ContinuousOn v (ball 0 1)) (hR : R ∈ Ioo 0 1) + (hn : ∀ z ∈ ball (0 : ℂ) 1, 0 ≤ v z) (θ : Angle) : + 0 ≤ RadialDensity v R hv hR θ := by + apply mul_nonneg (by positivity) + apply hn + simp only [mem_ball, dist_zero_right, norm_circleMap_zero, abs_of_pos hR.1] + exact hR.2 + +def radialMeasure (v : ℂ → ℝ) (R : ℝ) + (hv : ContinuousOn v (ball 0 1)) (hR : R ∈ Ioo 0 1) : FiniteMeasure Angle := + densityMeasure volume (RadialDensity v R hv hR) + +theorem integral_radialMeasure {v : ℂ → ℝ} {R : ℝ} + (hv : ContinuousOn v (ball 0 1)) (hR : R ∈ Ioo 0 1) + (hn : ∀ z ∈ ball (0 : ℂ) 1, 0 ≤ v z) (F : ℝ → ℝ) : + (∫ θ : Angle, F θ ∂(radialMeasure v R hv hR : Measure Angle)) = + (2 * Real.pi)⁻¹ * ∫ θ in (0 : ℝ)..2 * Real.pi, + v (circleMap 0 R θ) * F θ := by + rw [radialMeasure, integral_densityMeasure _ _ (radialDensity_nonneg hv hR hn)] + simp only [RadialDensity, ContinuousMap.coe_mk, mul_assoc] + rw [integral_const_mul] + exact congrArg ((2 * Real.pi)⁻¹ * ·) + (integral_angle (fun θ => v (circleMap 0 R θ) * F θ)) + +theorem mass_radialMeasure {v : ℂ → ℝ} {R : ℝ} + (hv : HarmonicOnNhd v (ball 0 1)) (hR : R ∈ Ioo 0 1) + (hn : ∀ z ∈ ball (0 : ℂ) 1, 0 ≤ v z) : + ((radialMeasure v R hv.continuousOn hR).mass : ℝ) = v 0 := by + have h := integral_radialMeasure hv.continuousOn hR hn (fun _ => 1) + have hr : HarmonicOnNhd v (closedBall 0 |R|) := by + rw [abs_of_pos hR.1] + exact hv.mono (closedBall_subset_ball hR.2) + have hr' := hr.circleAverage_eq + rw [Real.circleAverage_def] at hr' + simp only [smul_eq_mul] at hr' + simpa only [integral_const, smul_eq_mul, mul_one, FiniteMeasure.measureReal_eq_coe_coeFn, + FiniteMeasure.mass, hr'] using h + + +def radialKernel (w : ℂ) (R : ℝ) (hR : ‖w‖ < R) : C(Angle, ℝ) where + toFun θ := (herglotzRieszKernel 0 w (circleMap 0 R θ)).re + continuous_toFun := by + have hn (θ : Angle) : circleMap 0 R θ - w ≠ 0 := by + intro h + have he := congrArg norm (sub_eq_zero.mp h) + simp only [norm_circleMap_zero, abs_of_pos (lt_of_le_of_lt (norm_nonneg w) hR)] at he + linarith + simp only [herglotzRieszKernel, sub_zero] + apply Complex.continuous_re.comp + exact (continuous_circleMap 0 R |>.comp continuous_subtype_val |>.add continuous_const).div + (continuous_circleMap 0 R |>.comp continuous_subtype_val |>.sub continuous_const) hn + +theorem continuous_radialKernel (w : ℂ) : + Continuous (fun R : Ioi ‖w‖ => radialKernel w R R.property) := by + apply ContinuousMap.continuous_of_continuous_uncurry + have hn (p : Ioi ‖w‖ × Angle) : circleMap 0 p.1 p.2 - w ≠ 0 := by + intro h + have he := congrArg norm (sub_eq_zero.mp h) + simp only [norm_circleMap_zero, + abs_of_pos (lt_of_le_of_lt (norm_nonneg w) p.1.property)] at he + exact (ne_of_gt p.1.property) he + simp only [Function.uncurry_def, radialKernel, ContinuousMap.coe_mk, + herglotzRieszKernel, sub_zero] + apply Complex.continuous_re.comp + apply Continuous.div _ _ hn <;> unfold circleMap <;> fun_prop + +theorem integral_radialKernel {v : ℂ → ℝ} {R : ℝ} + (hv : HarmonicOnNhd v (ball 0 1)) (hR : R ∈ Ioo 0 1) + (hn : ∀ z ∈ ball (0 : ℂ) 1, 0 ≤ v z) {w : ℂ} (hw : ‖w‖ < R) : + (∫ θ : Angle, radialKernel w R hw θ + ∂(radialMeasure v R hv.continuousOn hR : Measure Angle)) = v w := by + have hr : HarmonicOnNhd v (closedBall 0 R) := + hv.mono (closedBall_subset_ball hR.2) + have hp := hr.circleAverage_re_herglotzRieszKernel_smul + (by simpa only [mem_ball, dist_zero_right] using hw) + rw [Real.circleAverage_def] at hp + change (∫ θ : Angle, (herglotzRieszKernel 0 w (circleMap 0 R θ)).re + ∂(radialMeasure v R hv.continuousOn hR : Measure Angle)) = _ + rw [integral_radialMeasure hv.continuousOn hR hn + (fun θ => (herglotzRieszKernel 0 w (circleMap 0 R θ)).re)] + simpa only [Pi.smul_apply, Function.comp_apply, smul_eq_mul, Pi.mul_apply, mul_comm] using hp + +def approachRadius (n : ℕ) : ℝ := 1 - ((n : ℝ) + 2)⁻¹ + +theorem approachRadius_mem (n : ℕ) : approachRadius n ∈ Ioo 0 1 := by + have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg n + have hp : 0 < (n : ℝ) + 2 := by linarith + have hi := (inv_lt_one₀ hp).mpr (by linarith) + have hi' := inv_pos.mpr hp + exact ⟨by dsimp [approachRadius]; linarith, by dsimp [approachRadius]; linarith⟩ + +theorem approachRadius_tendsto : Tendsto approachRadius atTop (𝓝 1) := by + have hn : Tendsto (fun n : ℕ => (n : ℝ) + 2) atTop atTop := + tendsto_atTop_mono (fun _ => by linarith) tendsto_natCast_atTop_atTop + change Tendsto (fun n : ℕ => 1 - ((n : ℝ) + 2)⁻¹) atTop (𝓝 1) + simpa only [Function.comp_apply, sub_zero] using + (tendsto_const_nhds (x := (1 : ℝ))).sub (tendsto_inv_atTop_zero.comp hn) + + +def clippedRadius (w : ℂ) (hw : ‖w‖ < 1) (R : ℝ) : Ioi ‖w‖ := + ⟨max ((‖w‖ + 1) / 2) R, + show ‖w‖ < max ((‖w‖ + 1) / 2) R from + lt_of_lt_of_le (show ‖w‖ < (‖w‖ + 1) / 2 by linarith) (le_max_left _ _)⟩ + +def clippedKernel (w : ℂ) (hw : ‖w‖ < 1) (R : ℝ) : C(Angle, ℝ) := + radialKernel w (clippedRadius w hw R) (clippedRadius w hw R).property + +theorem continuous_clippedKernel (w : ℂ) (hw : ‖w‖ < 1) : + Continuous (clippedKernel w hw) := by + exact (continuous_radialKernel w).comp + (show Continuous (clippedRadius w hw) from + (continuous_const.max continuous_id).subtype_mk _) + +theorem clippedKernel_one (w : ℂ) (hw : ‖w‖ < 1) : + clippedKernel w hw 1 = radialKernel w 1 hw := by + have ha : (‖w‖ + 1) / 2 ≤ 1 := by linarith + simp only [clippedKernel, clippedRadius, max_eq_right ha] + +theorem clippedKernel_eq {w : ℂ} (hw : ‖w‖ < 1) {R : ℝ} + (hR : (‖w‖ + 1) / 2 < R) : + clippedKernel w hw R = radialKernel w R (by linarith) := by + simp only [clippedKernel, clippedRadius, max_eq_right hR.le] + +def radialSequence (v : ℂ → ℝ) (hv : HarmonicOnNhd v (ball 0 1)) + (n : ℕ) : FiniteMeasure Angle := + radialMeasure v (approachRadius n) hv.continuousOn (approachRadius_mem n) + +theorem exists_radialSequence_cluster {v : ℂ → ℝ} + (hv : HarmonicOnNhd v (ball 0 1)) + (hn : ∀ z ∈ ball (0 : ℂ) 1, 0 ≤ v z) : + ∃ μ : FiniteMeasure Angle, (μ.mass : ℝ) = v 0 ∧ + MapClusterPt μ atTop (radialSequence v hv) := by + let C : ℝ≥0 := ⟨v 0, hn 0 (by simp)⟩ + have hmass (n : ℕ) : (radialSequence v hv n).mass = C := by + apply NNReal.coe_injective + exact mass_radialMeasure hv (approachRadius_mem n) hn + obtain ⟨μ, hμmass, hcluster⟩ := + (isCompact_setOfPred_finiteMeasure_eq_of_compactSpace Angle C).exists_mapClusterPt + (u := radialSequence v hv) (f := atTop) (by + rw [Filter.le_principal_iff] + change ∀ᶠ n : ℕ in atTop, (radialSequence v hv n).mass = C + exact Eventually.of_forall hmass) + exact ⟨μ, congrArg ((↑) : ℝ≥0 → ℝ) hμmass, hcluster⟩ + +theorem eventually_integral_clippedKernel {v : ℂ → ℝ} + (hv : HarmonicOnNhd v (ball 0 1)) + (hn : ∀ z ∈ ball (0 : ℂ) 1, 0 ≤ v z) {w : ℂ} (hw : ‖w‖ < 1) : + ∀ᶠ n : ℕ in atTop, + (∫ θ : Angle, clippedKernel w hw (approachRadius n) θ + ∂(radialSequence v hv n : Measure Angle)) = v w := by + have ha : (‖w‖ + 1) / 2 < 1 := by linarith + filter_upwards [approachRadius_tendsto.eventually (Ioi_mem_nhds ha)] with n hn' + have hwr : ‖w‖ < approachRadius n := by linarith + rw [clippedKernel_eq hw hn'] + exact integral_radialKernel hv (approachRadius_mem n) hn hwr + +theorem radialCluster_represents {v : ℂ → ℝ} + (hv : HarmonicOnNhd v (ball 0 1)) + (hn : ∀ z ∈ ball (0 : ℂ) 1, 0 ≤ v z) {μ : FiniteMeasure Angle} + (hcluster : MapClusterPt μ atTop (radialSequence v hv)) + {w : ℂ} (hw : ‖w‖ < 1) : + (∫ θ : Angle, radialKernel w 1 hw θ ∂(μ : Measure Angle)) = v w := by + let l := comap (radialSequence v hv) (𝓝 μ) ⊓ (atTop : Filter ℕ) + have : l.NeBot := neBot_inf_comap_iff_map'.mpr hcluster + have hμ : Tendsto (radialSequence v hv) l (𝓝 μ) := tendsto_comap.mono_left inf_le_left + have hR : Tendsto approachRadius l (𝓝 1) := approachRadius_tendsto.mono_left inf_le_right + have hk : Tendsto (fun n => clippedKernel w hw (approachRadius n)) l + (𝓝 (radialKernel w 1 hw)) := by + simpa only [clippedKernel_one, Function.comp_def] using + (continuous_clippedKernel w hw).continuousAt.tendsto.comp hR + have hi := tendsto_integral_varying hμ hk + have heq : ∀ᶠ n : ℕ in l, + (∫ θ : Angle, clippedKernel w hw (approachRadius n) θ + ∂(radialSequence v hv n : Measure Angle)) = v w := + (show l ≤ atTop from inf_le_right) (eventually_integral_clippedKernel hv hn hw) + exact tendsto_nhds_unique hi (tendsto_const_nhds.congr' (Filter.EventuallyEq.symm heq)) + + + + +theorem positive_harmonic_disk_representation {v : ℂ → ℝ} + (hv : HarmonicOnNhd v (ball 0 1)) + (hn : ∀ z ∈ ball (0 : ℂ) 1, 0 ≤ v z) : + ∃ μ : FiniteMeasure Angle, (μ.mass : ℝ) = v 0 ∧ + ∀ w : ℂ, ‖w‖ < 1 → + (∫ θ : Angle, (herglotzRieszKernel 0 w (circleMap 0 1 θ)).re + ∂(μ : Measure Angle)) = v w := by + obtain ⟨μ, hm, hc⟩ := exists_radialSequence_cluster hv hn + exact ⟨μ, hm, fun _ hw => radialCluster_represents hv hn hc hw⟩ + + +def diskKernel (w : ℂ) (hw : ‖w‖ < 1) : C(Angle, ℂ) where + toFun θ := herglotzRieszKernel 0 w (circleMap 0 1 θ) + continuous_toFun := by + have hn (θ : Angle) : circleMap 0 1 θ - w ≠ 0 := by + intro h + have he := congrArg norm (sub_eq_zero.mp h) + simp only [norm_circleMap_zero, abs_one] at he + linarith + simp only [herglotzRieszKernel, sub_zero] + exact (continuous_circleMap 0 1 |>.comp continuous_subtype_val |>.add continuous_const).div + (continuous_circleMap 0 1 |>.comp continuous_subtype_val |>.sub continuous_const) hn + +def diskIntegral (μ : FiniteMeasure Angle) (w : ℂ) : ℂ := + ∫ θ : Angle, herglotzRieszKernel 0 w (circleMap 0 1 θ) ∂(μ : Measure Angle) + +theorem diskKernel_integrable (μ : FiniteMeasure Angle) {w : ℂ} (hw : ‖w‖ < 1) : + Integrable (fun θ : Angle => herglotzRieszKernel 0 w (circleMap 0 1 θ)) + (μ : Measure Angle) := + (diskKernel w hw).continuous.integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + +theorem hasDerivAt_diskIntegral (μ : FiniteMeasure Angle) {w : ℂ} (hw : ‖w‖ < 1) : + HasDerivAt (diskIntegral μ) + (∫ θ : Angle, 2 * circleMap 0 1 θ / (circleMap 0 1 θ - w) ^ 2 + ∂(μ : Measure Angle)) w := by + let d := (1 - ‖w‖) / 2 + have hd : 0 < d := by dsimp [d]; linarith + have hdist (x : ℂ) (hx : x ∈ ball w d) (θ : Angle) : d ≤ ‖circleMap 0 1 θ - x‖ := by + have hnorm := norm_le_norm_sub_add x w + have hx' : ‖x - w‖ < d := by simpa only [mem_ball, dist_eq_norm] using hx + have he := norm_sub_norm_le (circleMap 0 1 θ) x + simp only [norm_circleMap_zero, abs_one] at he + dsimp [d] at * + linarith + refine (hasDerivAt_integral_of_dominated_loc_of_deriv_le + (F := fun x (θ : Angle) => herglotzRieszKernel 0 x (circleMap 0 1 θ)) + (F' := fun x (θ : Angle) => 2 * circleMap 0 1 θ / (circleMap 0 1 θ - x) ^ 2) + (bound := fun _ => 2 * (d ^ 2)⁻¹) (μ := (μ : Measure Angle)) + (ball_mem_nhds w hd) ?_ (diskKernel_integrable μ hw) ?_ ?_ (integrable_const _) ?_).2 + · filter_upwards with x + simp only [herglotzRieszKernel, sub_zero, circleMap] + exact (by fun_prop : Measurable _).aestronglyMeasurable + · exact (by fun_prop : Measurable _).aestronglyMeasurable + · filter_upwards with θ x hx + rw [norm_div, norm_mul, norm_pow, norm_circleMap_zero, abs_one, mul_one, + show ‖(2 : ℂ)‖ = 2 by norm_num, div_eq_mul_inv] + gcongr + exact hdist x hx θ + · filter_upwards with θ x hx + have hne : circleMap 0 1 θ - x ≠ 0 := + norm_pos_iff.mp (lt_of_lt_of_le hd (hdist x hx θ)) + have hh := ((hasDerivAt_id' x).const_add (circleMap 0 1 θ)).div + ((hasDerivAt_id' x).const_sub (circleMap 0 1 θ)) hne + simpa [herglotzRieszKernel_def, sub_zero, sub_sub, ← two_mul, Pi.div_def] using hh + +theorem analyticOnNhd_diskIntegral (μ : FiniteMeasure Angle) : + AnalyticOnNhd ℂ (diskIntegral μ) (ball 0 1) := by + apply DifferentiableOn.analyticOnNhd _ isOpen_ball + intro w hw + exact (hasDerivAt_diskIntegral μ (by simpa only [mem_ball, dist_zero_right] using hw)).differentiableAt.differentiableWithinAt + +theorem positive_real_disk_representation {P : ℂ → ℂ} + (hP : AnalyticOnNhd ℂ P (ball 0 1)) + (hn : ∀ w ∈ ball (0 : ℂ) 1, 0 ≤ (P w).re) : + ∃ (μ : FiniteMeasure Angle) (c : ℝ), + ∀ w ∈ ball (0 : ℂ) 1, + P w = (c : ℂ) * I + diskIntegral μ w := by + have hh : HarmonicOnNhd (fun w => (P w).re) (ball 0 1) := + fun w hw => (hP w hw).harmonicAt_re + obtain ⟨μ, _, hμ⟩ := positive_harmonic_disk_representation hh hn + have hre (w : ℂ) (hw : w ∈ ball (0 : ℂ) 1) : (P w - diskIntegral μ w).re = 0 := by + have hwn : ‖w‖ < 1 := by simpa only [mem_ball, dist_zero_right] using hw + have hi := Complex.reCLM.integral_comp_comm (diskKernel_integrable μ hwn) + change (∫ θ : Angle, (herglotzRieszKernel 0 w (circleMap 0 1 θ)).re + ∂(μ : Measure Angle)) = (diskIntegral μ w).re at hi + rw [Complex.sub_re, ← hi, hμ w hwn, sub_self] + obtain ⟨c, hc⟩ := (hP.sub (analyticOnNhd_diskIntegral μ)).eq_re_add_const_mul_I_of_re_eq_const + hre isOpen_ball (isConnected_ball (by norm_num)) + refine ⟨μ, c, fun w hw => ?_⟩ + have hh' := hc w hw + simp only [Complex.ofReal_zero, zero_add] at hh' + exact sub_eq_iff_eq_add.mp hh' + + +def toDisk (s : ℂ) : ℂ := (s - I) / (s + I) +def toHalfPlane (w : ℂ) : ℂ := I * (1 + w) / (1 - w) + +theorem add_I_ne_zero {s : ℂ} (hs : 0 < s.im) : s + I ≠ 0 := by + intro h + have hi := congrArg Complex.im h + simp only [Complex.add_im, Complex.I_im, Complex.zero_im] at hi + linarith + +theorem one_sub_ne_zero {w : ℂ} (hw : ‖w‖ < 1) : 1 - w ≠ 0 := by + intro h + have he : w = 1 := (sub_eq_zero.mp h).symm + simp [he] at hw + +theorem norm_toDisk_lt_one {s : ℂ} (hs : 0 < s.im) : ‖toDisk s‖ < 1 := by + have hd := add_I_ne_zero hs + rw [toDisk, norm_div, div_lt_one (norm_pos_iff.mpr hd)] + apply (sq_lt_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + rw [← Complex.normSq_eq_norm_sq, ← Complex.normSq_eq_norm_sq] + simp only [Complex.normSq_apply, Complex.sub_re, Complex.I_re, sub_zero, + Complex.add_re, add_zero, Complex.sub_im, Complex.add_im, Complex.I_im] + nlinarith + +theorem im_toHalfPlane (w : ℂ) : + (toHalfPlane w).im = (1 - ‖w‖ ^ 2) / Complex.normSq (1 - w) := by + simp only [toHalfPlane, Complex.div_im, Complex.mul_im, Complex.mul_re, + Complex.I_re, Complex.I_im, Complex.add_re, Complex.add_im, + Complex.one_re, Complex.one_im, Complex.sub_re, Complex.sub_im, + zero_mul, one_mul, zero_add, zero_sub, ← Complex.normSq_eq_norm_sq, + Complex.normSq_apply] + ring + +theorem im_toHalfPlane_pos {w : ℂ} (hw : ‖w‖ < 1) : 0 < (toHalfPlane w).im := by + rw [im_toHalfPlane] + apply div_pos _ (Complex.normSq_pos.mpr (one_sub_ne_zero hw)) + nlinarith [norm_nonneg w] + +theorem toHalfPlane_toDisk {s : ℂ} (hs : 0 < s.im) : toHalfPlane (toDisk s) = s := by + have hd := add_I_ne_zero hs + have he := one_sub_ne_zero (norm_toDisk_lt_one hs) + dsimp [toHalfPlane, toDisk] at * + field_simp + ring + +theorem toDisk_toHalfPlane {w : ℂ} (hw : ‖w‖ < 1) : toDisk (toHalfPlane w) = w := by + have hd := one_sub_ne_zero hw + have he := add_I_ne_zero (im_toHalfPlane_pos hw) + dsimp [toHalfPlane, toDisk] at * + field_simp + ring + +theorem analyticAt_toHalfPlane {w : ℂ} (hw : ‖w‖ < 1) : + AnalyticAt ℂ toHalfPlane w := by + exact (analyticAt_const.mul (analyticAt_const.add analyticAt_id)).div + (analyticAt_const.sub analyticAt_id) (one_sub_ne_zero hw) + +theorem analyticAt_toDisk {s : ℂ} (hs : 0 < s.im) : AnalyticAt ℂ toDisk s := by + exact (analyticAt_id.sub analyticAt_const).div (analyticAt_id.add analyticAt_const) + (add_I_ne_zero hs) + + + +theorem upper_half_plane_representation {P : ℂ → ℂ} + (hP : AnalyticOnNhd ℂ P {s | 0 < s.im}) + (hn : ∀ s : ℂ, 0 < s.im → 0 ≤ (P s).im) : + ∃ (μ : FiniteMeasure Angle) (a : ℝ), + ∀ s : ℂ, 0 < s.im → P s = (a : ℂ) + I * diskIntegral μ (toDisk s) := by + let Q : ℂ → ℂ := fun w => -I * P (toHalfPlane w) + have hQ : AnalyticOnNhd ℂ Q (ball 0 1) := by + intro w hw + have hwn : ‖w‖ < 1 := by simpa only [mem_ball, dist_zero_right] using hw + exact analyticAt_const.mul ((hP _ (im_toHalfPlane_pos hwn)).comp + (analyticAt_toHalfPlane hwn)) + have hQn : ∀ w ∈ ball (0 : ℂ) 1, 0 ≤ (Q w).re := by + intro w hw + have hwn : ‖w‖ < 1 := by simpa only [mem_ball, dist_zero_right] using hw + simpa [Q, Complex.mul_re] using hn _ (im_toHalfPlane_pos hwn) + obtain ⟨μ, c, hc⟩ := positive_real_disk_representation hQ hQn + refine ⟨μ, -c, fun s hs => ?_⟩ + have he := hc (toDisk s) (by simpa only [mem_ball, dist_zero_right] using norm_toDisk_lt_one hs) + dsimp [Q] at he + rw [toHalfPlane_toDisk hs] at he + have ht := congrArg (I * ·) he + simpa [mul_add, mul_neg, ← mul_assoc, mul_comm I (c : ℂ), + mul_assoc (c : ℂ) I I, Complex.I_sq] using ht + +theorem continuous_weighted_radial {v : ℂ → ℝ} + (hv : ContinuousOn v (ball 0 1)) (f : C(Angle, ℝ)) + (hc : ∀ θ ∈ tsupport f, ContinuousAt v (circleMap 0 1 θ)) : + Continuous (fun p : Icc (0 : ℝ) 1 × Angle => + f p.2 * v (circleMap 0 p.1 p.2)) := by + have hm : Continuous (fun p : Icc (0 : ℝ) 1 × Angle => circleMap 0 p.1 p.2) := by + simp only [circleMap] + fun_prop + apply continuous_iff_continuousAt.mpr + intro p + by_cases hf : p.2 ∈ tsupport f + · apply (f.continuous.comp continuous_snd).continuousAt.mul + apply ContinuousAt.comp _ hm.continuousAt + rcases lt_or_eq_of_le p.1.property.2 with hr | hr + · apply hv.continuousAt (isOpen_ball.mem_nhds _) + simp only [mem_ball, dist_zero_right, norm_circleMap_zero, + abs_of_nonneg p.1.property.1] + exact hr + · simpa only [hr] using hc p.2 hf + · apply (continuousAt_const (y := (0 : ℝ))).congr + have he := (notMem_tsupport_iff_eventuallyEq.mp hf).comp_tendsto + (continuous_snd.continuousAt : ContinuousAt Prod.snd p) + filter_upwards [he] with q hq + simp only [Function.comp_apply, Pi.zero_apply] at hq + simp [hq] + +theorem tendsto_radial_test_zero {v : ℂ → ℝ} + (hv : HarmonicOnNhd v (ball 0 1)) + (hn : ∀ z ∈ ball (0 : ℂ) 1, 0 ≤ v z) (f : C(Angle, ℝ)) + (hc : ∀ θ ∈ tsupport f, ContinuousAt v (circleMap 0 1 θ)) + (hz : ∀ θ ∈ tsupport f, v (circleMap 0 1 θ) = 0) : + Tendsto (fun n => ∫ θ : Angle, f θ ∂(radialSequence v hv n : Measure Angle)) + atTop (𝓝 0) := by + let R : ℕ → Icc (0 : ℝ) 1 := fun n => + ⟨approachRadius n, (approachRadius_mem n).1.le, (approachRadius_mem n).2.le⟩ + let R₁ : Icc (0 : ℝ) 1 := ⟨1, by norm_num⟩ + have hR : Tendsto R atTop (𝓝 R₁) := tendsto_subtype_rng.mpr approachRadius_tendsto + have hj := continuous_weighted_radial hv.continuousOn f hc + let F : Icc (0 : ℝ) 1 → C(Angle, ℝ) := fun r => + ⟨fun θ => f θ * v (circleMap 0 r θ), hj.comp (continuous_const.prodMk continuous_id)⟩ + have hF : Continuous F := ContinuousMap.continuous_of_continuous_uncurry F hj + have hF₁ : F R₁ = 0 := by + ext θ + change f θ * v (circleMap 0 1 θ) = 0 + by_cases he : f θ = 0 + · simp [he] + · simp [hz θ (subset_closure he)] + have ht : Tendsto (fun n => F (R n)) atTop (𝓝 0) := by + simpa only [hF₁, Function.comp_def] using hF.continuousAt.tendsto.comp hR + let μV : FiniteMeasure Angle := ⟨volume, inferInstance⟩ + have hi := tendsto_integral_varying (tendsto_const_nhds (x := μV)) ht + change Tendsto (fun n => ∫ θ : Angle, F (R n) θ) atTop (𝓝 (∫ θ : Angle, (0 : C(Angle, ℝ)) θ)) at hi + have he (n : ℕ) : + (∫ θ : Angle, f θ ∂(radialSequence v hv n : Measure Angle)) = + (2 * Real.pi)⁻¹ * ∫ θ : Angle, F (R n) θ := by + change (∫ θ : Angle, f θ ∂(densityMeasure (volume : Measure Angle) + (RadialDensity v (approachRadius n) hv.continuousOn (approachRadius_mem n)) : Measure Angle)) = _ + rw [integral_densityMeasure _ _ + (radialDensity_nonneg hv.continuousOn (approachRadius_mem n) hn)] + simp only [RadialDensity, ContinuousMap.coe_mk, mul_assoc] + rw [integral_const_mul] + congr 1 + apply integral_congr_ae + filter_upwards with θ + change v (circleMap 0 (approachRadius n) θ) * f θ = + f θ * v (circleMap 0 (approachRadius n) θ) + ring + simpa only [he, ContinuousMap.zero_apply, integral_zero, mul_zero] using + hi.const_mul ((2 * Real.pi)⁻¹) + +theorem radialCluster_integral_zero {v : ℂ → ℝ} + (hv : HarmonicOnNhd v (ball 0 1)) + (hn : ∀ z ∈ ball (0 : ℂ) 1, 0 ≤ v z) {μ : FiniteMeasure Angle} + (hcluster : MapClusterPt μ atTop (radialSequence v hv)) (f : C(Angle, ℝ)) + (hc : ∀ θ ∈ tsupport f, ContinuousAt v (circleMap 0 1 θ)) + (hz : ∀ θ ∈ tsupport f, v (circleMap 0 1 θ) = 0) : + (∫ θ : Angle, f θ ∂(μ : Measure Angle)) = 0 := by + let l := comap (radialSequence v hv) (𝓝 μ) ⊓ (atTop : Filter ℕ) + have : l.NeBot := neBot_inf_comap_iff_map'.mpr hcluster + have hμ : Tendsto (radialSequence v hv) l (𝓝 μ) := tendsto_comap.mono_left inf_le_left + exact tendsto_nhds_unique + ((FiniteMeasure.continuous_integral_continuousMap f).continuousAt.tendsto.comp hμ) + ((tendsto_radial_test_zero hv hn f hc hz).mono_left inf_le_right) + + + +theorem radialCluster_no_mass {v : ℂ → ℝ} + (hv : HarmonicOnNhd v (ball 0 1)) + (hn : ∀ z ∈ ball (0 : ℂ) 1, 0 ≤ v z) {μ : FiniteMeasure Angle} + (hcluster : MapClusterPt μ atTop (radialSequence v hv)) + {U : Set Angle} (hU : IsOpen U) + (hc : ∀ θ ∈ U, ContinuousAt v (circleMap 0 1 θ)) + (hz : ∀ θ ∈ U, v (circleMap 0 1 θ) = 0) : (μ : Measure Angle) U = 0 := by + have hs : U ⊆ (μ : Measure Angle).supportᶜ := by + intro θ hθ + obtain ⟨f, hfU, hfθ, hfr⟩ := exists_tsupport_one_of_isOpen_isClosed hU + isClosed_closure.isCompact isClosed_singleton (singleton_subset_iff.mpr hθ) + have hzero : (∫ z : Angle, f z ∂(μ : Measure Angle)) = 0 := + radialCluster_integral_zero hv hn hcluster f + (fun z hz' => hc z (hfU hz')) (fun z hz' => hz z (hfU hz')) + have hae : f =ᵐ[(μ : Measure Angle)] 0 := + (integral_eq_zero_iff_of_nonneg (fun z => (hfr z).1) + (f.continuous.integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _))).mp hzero + apply Measure.notMem_support_iff_exists.mpr + refine ⟨{z | f z ≠ 0}, ?_, ?_⟩ + · exact f.continuous.continuousAt.eventually_ne (by simp [hfθ (mem_singleton θ)]) + · exact ae_iff.mp hae + exact measure_mono_null hs (Measure.measure_compl_support (μ := (μ : Measure Angle))) + +theorem positive_real_disk_representation_with_support {P : ℂ → ℂ} + (hP : AnalyticOnNhd ℂ P (ball 0 1)) + (hn : ∀ w ∈ ball (0 : ℂ) 1, 0 ≤ (P w).re) + {U : Set Angle} (hU : IsOpen U) + (hc : ∀ θ ∈ U, ContinuousAt (fun w => (P w).re) (circleMap 0 1 θ)) + (hz : ∀ θ ∈ U, (P (circleMap 0 1 θ)).re = 0) : + ∃ (μ : FiniteMeasure Angle) (c : ℝ), (μ : Measure Angle) U = 0 ∧ + ∀ w ∈ ball (0 : ℂ) 1, + P w = (c : ℂ) * I + diskIntegral μ w := by + have hh : HarmonicOnNhd (fun w => (P w).re) (ball 0 1) := + fun w hw => (hP w hw).harmonicAt_re + obtain ⟨μ, _, hcluster⟩ := exists_radialSequence_cluster hh hn + have hre (w : ℂ) (hw : w ∈ ball (0 : ℂ) 1) : (P w - diskIntegral μ w).re = 0 := by + have hwn : ‖w‖ < 1 := by simpa only [mem_ball, dist_zero_right] using hw + have hi := Complex.reCLM.integral_comp_comm (diskKernel_integrable μ hwn) + change (∫ θ : Angle, (herglotzRieszKernel 0 w (circleMap 0 1 θ)).re + ∂(μ : Measure Angle)) = (diskIntegral μ w).re at hi + have hr := radialCluster_represents hh hn hcluster hwn + change (∫ θ : Angle, (herglotzRieszKernel 0 w (circleMap 0 1 θ)).re + ∂(μ : Measure Angle)) = (P w).re at hr + rw [Complex.sub_re, ← hi, hr, sub_self] + obtain ⟨c, hcc⟩ := (hP.sub (analyticOnNhd_diskIntegral μ)).eq_re_add_const_mul_I_of_re_eq_const + hre isOpen_ball (isConnected_ball (by norm_num)) + refine ⟨μ, c, radialCluster_no_mass hh hn hcluster hU hc hz, fun w hw => ?_⟩ + have he := hcc w hw + simp only [Complex.ofReal_zero, zero_add] at he + exact sub_eq_iff_eq_add.mp he + +theorem re_toHalfPlane (w : ℂ) : + (toHalfPlane w).re = -2 * w.im / Complex.normSq (1 - w) := by + simp only [toHalfPlane, Complex.div_re, Complex.mul_im, Complex.mul_re, + Complex.I_re, Complex.I_im, Complex.add_re, Complex.add_im, + Complex.one_re, Complex.one_im, Complex.sub_re, Complex.sub_im, + zero_mul, one_mul, zero_add, zero_sub] + ring + +theorem one_sub_ne_zero_of_im_neg {w : ℂ} (hw : w.im < 0) : 1 - w ≠ 0 := by + intro h + have hh := congrArg Complex.im h + simp only [Complex.sub_im, Complex.one_im, Complex.zero_im, zero_sub] at hh + linarith + +theorem boundary_toHalfPlane {w : ℂ} (hw : ‖w‖ = 1) (hi : w.im < 0) : + (toHalfPlane w).im = 0 ∧ 0 < (toHalfPlane w).re := by + constructor + · simp [im_toHalfPlane, hw] + · rw [re_toHalfPlane] + exact div_pos (mul_pos_of_neg_of_neg (by norm_num) hi) + (Complex.normSq_pos.mpr (one_sub_ne_zero_of_im_neg hi)) + +theorem analyticAt_toHalfPlane_of_ne {w : ℂ} (hw : 1 - w ≠ 0) : + AnalyticAt ℂ toHalfPlane w := by + exact (analyticAt_const.mul (analyticAt_const.add analyticAt_id)).div + (analyticAt_const.sub analyticAt_id) hw + + + +theorem upper_half_plane_representation_with_support_of_continuous {P : ℂ → ℂ} + (hP : AnalyticOnNhd ℂ P {s | 0 < s.im}) + (hn : ∀ s : ℂ, 0 < s.im → 0 ≤ (P s).im) + (hR : ∀ x : ℝ, 0 < x → ContinuousAt P (x : ℂ) ∧ (P (x : ℂ)).im = 0) : + ∃ (μ : FiniteMeasure Angle) (a : ℝ), + (∀ᵐ θ : Angle ∂(μ : Measure Angle), 0 ≤ (circleMap 0 1 θ).im) ∧ + ∀ s : ℂ, 0 < s.im → P s = (a : ℂ) + I * diskIntegral μ (toDisk s) := by + let Q : ℂ → ℂ := fun w => -I * P (toHalfPlane w) + have hQ : AnalyticOnNhd ℂ Q (ball 0 1) := by + intro w hw + have hwn : ‖w‖ < 1 := by simpa only [mem_ball, dist_zero_right] using hw + exact analyticAt_const.mul ((hP _ (im_toHalfPlane_pos hwn)).comp + (analyticAt_toHalfPlane hwn)) + have hQn : ∀ w ∈ ball (0 : ℂ) 1, 0 ≤ (Q w).re := by + intro w hw + have hwn : ‖w‖ < 1 := by simpa only [mem_ball, dist_zero_right] using hw + simpa [Q, Complex.mul_re] using hn _ (im_toHalfPlane_pos hwn) + let U : Set Angle := {θ | (circleMap 0 1 θ).im < 0} + have hU : IsOpen U := isOpen_lt (by fun_prop) continuous_const + have hboundary (θ : Angle) (hθ : θ ∈ U) : + ContinuousAt (fun w => (Q w).re) (circleMap 0 1 θ) ∧ + (Q (circleMap 0 1 θ)).re = 0 := by + have hb := boundary_toHalfPlane (w := circleMap 0 1 θ) + (by simp only [norm_circleMap_zero, abs_one]) hθ + have he : ((toHalfPlane (circleMap 0 1 θ)).re : ℂ) = toHalfPlane (circleMap 0 1 θ) := by + simpa only [hb.1, Complex.ofReal_zero, zero_mul, add_zero] using + Complex.re_add_im (toHalfPlane (circleMap 0 1 θ)) + have hp := hR _ hb.2 + rw [he] at hp + constructor + · refine Complex.continuous_re.continuousAt.comp ?_ + change ContinuousAt Q (circleMap 0 1 θ) + exact continuousAt_const.mul (hp.1.comp + (analyticAt_toHalfPlane_of_ne (one_sub_ne_zero_of_im_neg hθ)).continuousAt) + · simpa [Q, Complex.mul_re] using hp.2 + obtain ⟨μ, c, hm, hc⟩ := positive_real_disk_representation_with_support hQ hQn hU + (fun θ hθ => (hboundary θ hθ).1) (fun θ hθ => (hboundary θ hθ).2) + refine ⟨μ, -c, ?_, fun s hs => ?_⟩ + · have ha := measure_eq_zero_iff_ae_notMem.mp hm + filter_upwards [ha] with θ hθ + exact le_of_not_gt hθ + · have he := hc (toDisk s) (by simpa only [mem_ball, dist_zero_right] using norm_toDisk_lt_one hs) + dsimp [Q] at he + rw [toHalfPlane_toDisk hs] at he + have ht := congrArg (I * ·) he + simpa [mul_add, mul_neg, ← mul_assoc, mul_comm I (c : ℂ), + mul_assoc (c : ℂ) I I, Complex.I_sq] using ht + + + + + +def boundaryParameter (θ : Angle) : ℝ := + (1 - (circleMap 0 1 θ).re + max 0 (circleMap 0 1 θ).im) / + (2 * (1 + max 0 (circleMap 0 1 θ).im)) + +def boundaryWeight (θ : Angle) : ℝ := + (1 + max 0 (circleMap 0 1 θ).im)⁻¹ + +theorem boundaryParameter_mem (θ : Angle) : boundaryParameter θ ∈ Icc 0 1 := by + have hr : |(circleMap 0 1 θ).re| ≤ 1 := by + simpa only [norm_circleMap_zero, abs_one] using Complex.abs_re_le_norm (circleMap 0 1 θ) + have hm : 0 ≤ max 0 (circleMap 0 1 θ).im := le_max_left _ _ + have hd : 0 < 2 * (1 + max 0 (circleMap 0 1 θ).im) := by positivity + rw [abs_le] at hr + constructor + · exact div_nonneg (by linarith) hd.le + · rw [boundaryParameter, div_le_one hd] + linarith + +theorem boundaryWeight_pos (θ : Angle) : 0 < boundaryWeight θ := by + dsimp [boundaryWeight] + positivity + +theorem boundaryWeight_le_one (θ : Angle) : boundaryWeight θ ≤ 1 := by + dsimp [boundaryWeight] + exact inv_le_one_of_one_le₀ (by linarith [le_max_left 0 (circleMap 0 1 θ).im]) + +theorem continuous_boundaryParameter : Continuous boundaryParameter := by + unfold boundaryParameter + apply Continuous.div (by fun_prop) (by fun_prop) + intro θ + positivity + +theorem continuous_boundaryWeight : Continuous boundaryWeight := by + unfold boundaryWeight + apply Continuous.inv₀ (by fun_prop) + intro θ + positivity + + +def compactKernel (t w : ℝ) (s : ℂ) : ℂ := (w : ℂ) / (1 + (s - 1) * t) + +theorem compactDen_ne_zero {t : ℝ} (ht : t ∈ Icc 0 1) {s : ℂ} + (hs : 0 < s.im ∨ 0 < s.re) : 1 + (s - 1) * (t : ℂ) ≠ 0 := by + intro he + rcases hs with hs | hs + · have hi := congrArg Complex.im he + simp only [Complex.add_im, Complex.one_im, Complex.mul_im, Complex.sub_im, + Complex.ofReal_im, mul_zero, sub_zero, Complex.ofReal_re, zero_add, + Complex.zero_im] at hi + have ht0 : t = 0 := (mul_eq_zero.mp hi).resolve_left hs.ne' + simp [ht0] at he + · have hr := congrArg Complex.re he + simp only [Complex.add_re, Complex.one_re, Complex.mul_re, Complex.sub_re, + Complex.ofReal_im, mul_zero, sub_zero, Complex.ofReal_re, Complex.zero_re] at hr + have ht0 : 0 < t := lt_of_le_of_ne ht.1 (by + intro h + simp [← h] at he) + nlinarith [mul_pos hs ht0, ht.2] + +theorem compactKernel_boundary {s ζ : ℂ} (hs : 0 < s.im) + (hζ : ‖ζ‖ = 1) (hi : 0 ≤ ζ.im) : + I * herglotzRieszKernel 0 (toDisk s) ζ = + (1 - 2 * ((1 - ζ.re + ζ.im) / (2 * (1 + ζ.im)) : ℝ) : ℂ) + + (s - 1) * compactKernel ((1 - ζ.re + ζ.im) / (2 * (1 + ζ.im))) + (1 + ζ.im)⁻¹ s := by + have hsi := add_I_ne_zero hs + have hd : ζ - toDisk s ≠ 0 := by + intro h + have he : ζ = toDisk s := sub_eq_zero.mp h + have := norm_toDisk_lt_one hs + rw [← he, hζ] at this + exact (lt_irrefl _ this).elim + have hnorm : ζ.re ^ 2 + ζ.im ^ 2 = 1 := by + simpa [Complex.normSq_apply, Complex.sq_norm, hζ, pow_two] using Complex.normSq_eq_norm_sq ζ + have hp : 0 < 2 * (1 + ζ.im) := by positivity + have hr : |ζ.re| ≤ 1 := hζ ▸ Complex.abs_re_le_norm ζ + have ht : (1 - ζ.re + ζ.im) / (2 * (1 + ζ.im)) ∈ Icc (0 : ℝ) 1 := by + rw [abs_le] at hr + exact ⟨div_nonneg (by linarith) hp.le, (div_le_one hp).mpr (by linarith)⟩ + have hden := compactDen_ne_zero ht (Or.inl hs) + have hc : (2 * (1 + (ζ.im : ℂ))) ≠ 0 := by + exact_mod_cast hp.ne' + have hc' : 1 + (ζ.im : ℂ) ≠ 0 := by exact_mod_cast (by linarith : (1 : ℝ) + ζ.im ≠ 0) + simp only [herglotzRieszKernel_def, sub_zero, compactKernel, toDisk, + Complex.ofReal_div, Complex.ofReal_sub, Complex.ofReal_add, Complex.ofReal_mul, + Complex.ofReal_one, Complex.ofReal_ofNat, Complex.ofReal_inv] at * + have hd₂ : ζ * (s + I) - (s - I) ≠ 0 := by + intro he + apply hd + apply sub_eq_zero.mpr + apply (eq_div_iff hsi).mpr + exact sub_eq_zero.mp he + have hd₃ : 2 * (1 + (ζ.im : ℂ)) + (1 - ζ.re + ζ.im) * (s - 1) ≠ 0 := by + intro he + apply hden + field_simp [hc', hc] + linear_combination he + field_simp [hsi, hd₂, hd₃, hc, hc'] + apply Complex.ext <;> norm_num [Complex.add_re, Complex.sub_re, Complex.mul_re, + Complex.add_im, Complex.sub_im, Complex.mul_im] + all_goals grind only + + +def compactIntegral (μ : FiniteMeasure Angle) (s : ℂ) : ℂ := + ∫ θ : Angle, compactKernel (boundaryParameter θ) (boundaryWeight θ) s ∂(μ : Measure Angle) + +theorem compactKernel_integrable (μ : FiniteMeasure Angle) {s : ℂ} + (hs : 0 < s.im ∨ 0 < s.re) : + Integrable (fun θ => compactKernel (boundaryParameter θ) (boundaryWeight θ) s) + (μ : Measure Angle) := by + have hc : Continuous (fun θ => compactKernel (boundaryParameter θ) (boundaryWeight θ) s) := by + exact (Complex.continuous_ofReal.comp continuous_boundaryWeight).div + (continuous_const.add (continuous_const.mul + (Complex.continuous_ofReal.comp continuous_boundaryParameter))) + (fun θ => compactDen_ne_zero (boundaryParameter_mem θ) hs) + exact hc.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + +theorem compactKernel_norm_le_two {s : ℂ} (hs : ‖s - 1‖ < 1 / 2) (θ : Angle) : + ‖compactKernel (boundaryParameter θ) (boundaryWeight θ) s‖ ≤ 2 := by + have ht := boundaryParameter_mem θ + have htw := boundaryWeight_le_one θ + have htp := boundaryWeight_pos θ + have ht' : ‖(boundaryParameter θ : ℂ)‖ ≤ 1 := by + simpa [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg ht.1] using ht.2 + have hsmall : ‖(s - 1) * (boundaryParameter θ : ℂ)‖ < 1 / 2 := by + rw [norm_mul] + calc + ‖s - 1‖ * ‖(boundaryParameter θ : ℂ)‖ ≤ ‖s - 1‖ * 1 := mul_le_mul_of_nonneg_left ht' (norm_nonneg _) + _ < 1 / 2 := by simpa using hs + have hden : 1 / 2 < ‖1 + (s - 1) * (boundaryParameter θ : ℂ)‖ := by + have he := norm_sub_norm_le (1 : ℂ) (-((s - 1) * (boundaryParameter θ : ℂ))) + simp only [norm_one, norm_neg, sub_neg_eq_add] at he + linarith + rw [compactKernel, norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos htp] + apply (div_le_iff₀ (by linarith : 0 < ‖1 + (s - 1) * (boundaryParameter θ : ℂ)‖)).mpr + linarith + +theorem continuousAt_compactIntegral_one (μ : FiniteMeasure Angle) : + ContinuousAt (compactIntegral μ) 1 := by + apply continuousAt_of_dominated (bound := fun _ => 2) + · filter_upwards with s + have hm : Measurable (fun θ => compactKernel (boundaryParameter θ) (boundaryWeight θ) s) := by + unfold compactKernel + exact (Complex.continuous_ofReal.comp continuous_boundaryWeight).measurable.div + (continuous_const.add (continuous_const.mul + (Complex.continuous_ofReal.comp continuous_boundaryParameter))).measurable + exact hm.aestronglyMeasurable + · filter_upwards [Metric.ball_mem_nhds (1 : ℂ) (by norm_num : (0 : ℝ) < 1 / 2)] with s hs + filter_upwards with θ + exact compactKernel_norm_le_two (by simpa only [mem_ball, dist_eq_norm] using hs) θ + · exact integrable_const _ + · filter_upwards with θ + apply ContinuousAt.div continuousAt_const + (continuousAt_const.add ((continuousAt_id.sub continuousAt_const).mul continuousAt_const)) + simp + + + +theorem pick_divided_difference_of_continuous {P : ℂ → ℂ} + (hP : AnalyticOnNhd ℂ P {s | 0 < s.im}) + (hn : ∀ s : ℂ, 0 < s.im → 0 ≤ (P s).im) + (hR : ∀ x : ℝ, 0 < x → ContinuousAt P (x : ℂ) ∧ (P (x : ℂ)).im = 0) : + ∃ μ : FiniteMeasure Angle, ∀ s : ℂ, 0 < s.im → + P s - P 1 = (s - 1) * compactIntegral μ s := by + obtain ⟨μ, a, hμ, hrep⟩ := upper_half_plane_representation_with_support_of_continuous hP hn hR + let A : ℂ := (a : ℂ) + ∫ θ : Angle, (1 - 2 * (boundaryParameter θ : ℂ)) ∂(μ : Measure Angle) + have hiA : Integrable (fun θ : Angle => (1 - 2 * (boundaryParameter θ : ℂ))) (μ : Measure Angle) := + (continuous_const.sub (continuous_const.mul + (Complex.continuous_ofReal.comp continuous_boundaryParameter))).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + have he (s : ℂ) (hs : 0 < s.im) : P s = A + (s - 1) * compactIntegral μ s := by + rw [hrep _ hs, diskIntegral, ← integral_const_mul] + have heq : (fun θ : Angle => I * herglotzRieszKernel 0 (toDisk s) (circleMap 0 1 θ)) =ᵐ[(μ : Measure Angle)] + (fun θ : Angle => (1 - 2 * (boundaryParameter θ : ℂ)) + + (s - 1) * compactKernel (boundaryParameter θ) (boundaryWeight θ) s) := by + filter_upwards [hμ] with θ hθ + simpa only [boundaryParameter, boundaryWeight, max_eq_right hθ] using + compactKernel_boundary hs (by simp only [norm_circleMap_zero, abs_one]) hθ + rw [integral_congr_ae heq, integral_add hiA ((compactKernel_integrable μ (Or.inl hs)).const_mul _), + integral_const_mul] + exact (add_assoc _ _ _).symm + have hlim : Tendsto (fun n : ℕ => (1 : ℂ) + ((1 - approachRadius n : ℝ) : ℂ) * I) atTop (𝓝 1) := by + simpa using (tendsto_const_nhds (x := (1 : ℂ))).add + ((Complex.continuous_ofReal.continuousAt.tendsto.comp + ((tendsto_const_nhds (x := (1 : ℝ))).sub approachRadius_tendsto)).mul_const I) + have hseq (n : ℕ) : 0 < ((1 : ℂ) + ((1 - approachRadius n : ℝ) : ℂ) * I).im := by + simpa using sub_pos.mpr (approachRadius_mem n).2 + have hA : P 1 = A := by + have hleft := (hR 1 (by norm_num)).1.tendsto.comp hlim + have hright := (tendsto_const_nhds (x := A)).add + ((hlim.sub (tendsto_const_nhds (x := (1 : ℂ)))).mul ((continuousAt_compactIntegral_one μ).tendsto.comp hlim)) + simp only [sub_self, zero_mul, add_zero] at hright + exact tendsto_nhds_unique hleft (hright.congr (fun n => (he _ (hseq n)).symm)) + exact ⟨μ, fun s hs => by rw [he s hs, hA]; ring⟩ + + +theorem pick_divided_difference {P : ℂ → ℂ} + (hP : AnalyticOnNhd ℂ P {s | 0 < s.im}) + (hn : ∀ s : ℂ, 0 < s.im → 0 ≤ (P s).im) + (hR : ∀ x : ℝ, 0 < x → AnalyticAt ℂ P (x : ℂ) ∧ (P (x : ℂ)).im = 0) : + ∃ μ : FiniteMeasure Angle, ∀ s : ℂ, 0 < s.im → + P s - P 1 = (s - 1) * compactIntegral μ s := + pick_divided_difference_of_continuous hP hn + (fun x hx => ⟨(hR x hx).1.continuousAt, (hR x hx).2⟩) + +theorem compactKernel_im (t w : ℝ) (s : ℂ) : + (compactKernel t w s).im = -(w * t * s.im) / Complex.normSq (1 + (s - 1) * t) := by + simp only [compactKernel, Complex.div_im, Complex.ofReal_im, zero_mul, + Complex.ofReal_re, Complex.add_im, Complex.one_im, Complex.mul_im, + Complex.sub_im, sub_zero, mul_zero, zero_add] + ring + +theorem mul_compactKernel_im (t w : ℝ) (s : ℂ) : + (s * compactKernel t w s).im = w * (1 - t) * s.im / Complex.normSq (1 + (s - 1) * t) := by + rw [compactKernel, ← mul_div_assoc, Complex.div_im] + simp only [Complex.mul_im, Complex.mul_re, Complex.ofReal_im, Complex.ofReal_re, + Complex.add_re, Complex.add_im, Complex.sub_re, Complex.sub_im, + Complex.one_im, Complex.one_re, sub_zero, mul_zero, zero_add] + ring + +theorem complex_im_integral {X : Type*} [MeasurableSpace X] {ν : Measure X} + {f : X → ℂ} (hf : Integrable f ν) : (∫ x, f x ∂ν).im = ∫ x, (f x).im ∂ν := + (Complex.imCLM.integral_comp_comm hf).symm + +theorem compactIntegral_im_nonpos (μ : FiniteMeasure Angle) {s : ℂ} (hs : 0 < s.im) : + (compactIntegral μ s).im ≤ 0 := by + rw [compactIntegral, complex_im_integral (compactKernel_integrable μ (Or.inl hs))] + apply integral_nonpos + intro θ + change (compactKernel _ _ _).im ≤ 0 + rw [compactKernel_im] + exact div_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr (mul_nonneg + (mul_nonneg (boundaryWeight_pos θ).le (boundaryParameter_mem θ).1) hs.le)) + (Complex.normSq_nonneg _) + +theorem mul_compactIntegral_im_nonneg (μ : FiniteMeasure Angle) {s : ℂ} (hs : 0 < s.im) : + 0 ≤ (s * compactIntegral μ s).im := by + rw [compactIntegral, ← integral_const_mul, + complex_im_integral ((compactKernel_integrable μ (Or.inl hs)).const_mul s)] + apply integral_nonneg + intro θ + change 0 ≤ (s * compactKernel _ _ _).im + rw [mul_compactKernel_im] + exact div_nonneg (mul_nonneg (mul_nonneg (boundaryWeight_pos θ).le + (sub_nonneg.mpr (boundaryParameter_mem θ).2)) hs.le) (Complex.normSq_nonneg _) + +theorem compactIntegral_ne_zero (μ : FiniteMeasure Angle) + (hμ : (μ : Measure Angle) ≠ 0) {s : ℂ} (hs : 0 < s.im) : compactIntegral μ s ≠ 0 := by + let F : Angle → ℝ := fun θ => (s * compactKernel (boundaryParameter θ) (boundaryWeight θ) s).im - + (compactKernel (boundaryParameter θ) (boundaryWeight θ) s).im + have hF (θ : Angle) : 0 < F θ := by + dsimp [F] + rw [mul_compactKernel_im, compactKernel_im] + have he : boundaryWeight θ * (1 - boundaryParameter θ) * s.im - -(boundaryWeight θ * boundaryParameter θ * s.im) = + boundaryWeight θ * s.im := by ring + rw [← sub_div, he] + exact div_pos (mul_pos (boundaryWeight_pos θ) hs) + (Complex.normSq_pos.mpr (compactDen_ne_zero (boundaryParameter_mem θ) (Or.inl hs))) + have hi := compactKernel_integrable μ (Or.inl hs) + have hFi : Integrable F (μ : Measure Angle) := + (Complex.imCLM.integrable_comp (hi.const_mul s)).sub (Complex.imCLM.integrable_comp hi) + have hp : 0 < ∫ θ, F θ ∂(μ : Measure Angle) := by + rw [integral_pos_iff_support_of_nonneg (fun θ => (hF θ).le) hFi] + have he : Function.support F = univ := by ext θ; simp [Function.mem_support, (hF θ).ne'] + rw [he] + exact Measure.measure_univ_pos.mpr hμ + have he : (∫ θ, F θ ∂(μ : Measure Angle)) = + (s * compactIntegral μ s).im - (compactIntegral μ s).im := by + have hi₁ : Integrable (fun θ => (s * compactKernel (boundaryParameter θ) (boundaryWeight θ) s).im) + (μ : Measure Angle) := Complex.imCLM.integrable_comp (hi.const_mul s) + have hi₂ : Integrable (fun θ => (compactKernel (boundaryParameter θ) (boundaryWeight θ) s).im) + (μ : Measure Angle) := Complex.imCLM.integrable_comp hi + dsimp [F] + rw [integral_sub hi₁ hi₂, ← complex_im_integral (hi.const_mul s), ← complex_im_integral hi, + integral_const_mul] + rfl + intro hz + rw [he, hz, mul_zero, Complex.zero_im, sub_self] at hp + exact lt_irrefl _ hp + +theorem continuousAt_compactIntegral (μ : FiniteMeasure Angle) {s : ℂ} (hs : 0 < s.re) : + ContinuousAt (compactIntegral μ) s := by + let d : ℝ := min 1 (s.re / 2) + have hd : 0 < d := lt_min zero_lt_one (half_pos hs) + apply continuousAt_of_dominated (bound := fun _ => 1 / d) + · filter_upwards with z + have hm : Measurable (fun θ => compactKernel (boundaryParameter θ) (boundaryWeight θ) z) := + (Complex.continuous_ofReal.comp continuous_boundaryWeight).measurable.div + (continuous_const.add (continuous_const.mul + (Complex.continuous_ofReal.comp continuous_boundaryParameter))).measurable + exact hm.aestronglyMeasurable + · have he : ∀ᶠ z : ℂ in 𝓝 s, s.re / 2 < z.re := + (Complex.continuous_re.continuousAt.tendsto).eventually (Ioi_mem_nhds (by linarith)) + filter_upwards [he] with z hz + filter_upwards with θ + have ht := boundaryParameter_mem θ + have hd1 : d ≤ 1 := min_le_left _ _ + have hdz : d ≤ z.re := (min_le_right _ _).trans hz.le + have hdr : d ≤ (1 + (z - 1) * (boundaryParameter θ : ℂ)).re := by + simp only [Complex.add_re, Complex.one_re, Complex.mul_re, Complex.sub_re, + Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] + nlinarith [mul_nonneg (sub_nonneg.mpr hd1) (sub_nonneg.mpr ht.2), + mul_nonneg (sub_nonneg.mpr hdz) ht.1] + have hdn : d ≤ ‖1 + (z - 1) * (boundaryParameter θ : ℂ)‖ := hdr.trans (Complex.re_le_norm _) + rw [compactKernel, norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (boundaryWeight_pos θ)] + exact div_le_div₀ zero_le_one (boundaryWeight_le_one θ) hd hdn + · exact integrable_const _ + · filter_upwards with θ + exact continuousAt_const.div + (continuousAt_const.add ((continuousAt_id.sub continuousAt_const).mul continuousAt_const)) + (compactDen_ne_zero (boundaryParameter_mem θ) (Or.inr hs)) + + + +theorem upper_boundary_eq {F G : ℂ → ℂ} {x : ℝ} + (hF : ContinuousAt F (x : ℂ)) (hG : ContinuousAt G (x : ℂ)) + (he : ∀ s : ℂ, 0 < s.im → F s = G s) : F (x : ℂ) = G (x : ℂ) := by + let z : ℕ → ℂ := fun n => (x : ℂ) + ((1 - approachRadius n : ℝ) : ℂ) * I + have hz : Tendsto z atTop (𝓝 (x : ℂ)) := by + simpa [z] using (tendsto_const_nhds (x := (x : ℂ))).add + ((Complex.continuous_ofReal.continuousAt.tendsto.comp + ((tendsto_const_nhds (x := (1 : ℝ))).sub approachRadius_tendsto)).mul_const I) + have hi (n : ℕ) : 0 < (z n).im := by + simpa [z] using sub_pos.mpr (approachRadius_mem n).2 + exact tendsto_nhds_unique (hF.tendsto.comp hz) + ((hG.tendsto.comp hz).congr (fun n => (he _ (hi n)).symm)) + +theorem analyticAt_dslope {P : ℂ → ℂ} {a : ℂ} (hP : AnalyticAt ℂ P a) : + AnalyticAt ℂ (dslope P a) a := by + apply Complex.analyticAt_of_differentiable_on_punctured_nhds_of_continuousAt + · filter_upwards [hP.eventually_analyticAt.filter_mono nhdsWithin_le_nhds, + self_mem_nhdsWithin] with z hz hza + exact (differentiableAt_dslope_of_ne hza).mpr hz.differentiableAt + · exact continuousAt_dslope_same.mpr hP.differentiableAt + + + +theorem pick_dslope_representation {P : ℂ → ℂ} + (hP : AnalyticOnNhd ℂ P {s | 0 < s.im}) + (hn : ∀ s : ℂ, 0 < s.im → 0 ≤ (P s).im) + (hR : ∀ x : ℝ, 0 < x → AnalyticAt ℂ P (x : ℂ) ∧ (P (x : ℂ)).im = 0) : + ∃ μ : FiniteMeasure Angle, + (∀ s : ℂ, 0 < s.im → dslope P 1 s = compactIntegral μ s) ∧ + (∀ x : ℝ, 0 < x → dslope P 1 (x : ℂ) = compactIntegral μ (x : ℂ)) := by + obtain ⟨μ, hμ⟩ := pick_divided_difference hP hn hR + have he (s : ℂ) (hs : 0 < s.im) : dslope P 1 s = compactIntegral μ s := by + have hs' : s ≠ 1 := by intro h; simp [h] at hs + rw [dslope_of_ne _ hs', slope, smul_eq_mul, vsub_eq_sub, hμ s hs] + field_simp [sub_ne_zero.mpr hs'] + refine ⟨μ, he, ?_⟩ + intro x hx + apply upper_boundary_eq _ (continuousAt_compactIntegral μ (by simpa using hx)) he + rcases eq_or_ne (x : ℂ) 1 with h | h + · rw [h] + exact continuousAt_dslope_same.mpr (hR 1 (by norm_num)).1.differentiableAt + · exact (continuousAt_dslope_of_ne h).mpr (hR x hx).1.continuousAt + + +theorem real_compactDen_pos {t : ℝ} (ht : t ∈ Icc 0 1) {x : ℝ} (hx : 0 < x) : + 0 < 1 + (x - 1) * t := by + by_cases h : t = 0 + · simp [h] + · have hp : 0 < t := lt_of_le_of_ne ht.1 (Ne.symm h) + nlinarith [mul_pos hx hp, ht.2] + +def realResolvent (x : ℝ) (hx : 0 < x) : C(Angle, ℝ) where + toFun θ := (1 + (x - 1) * boundaryParameter θ)⁻¹ + continuous_toFun := + (continuous_const.add (continuous_const.mul continuous_boundaryParameter)).inv₀ + (fun θ => (real_compactDen_pos (boundaryParameter_mem θ) hx).ne') + +def resolventDensity (A : ℝ) (hA : 0 < A) : C(Angle, ℝ) where + toFun θ := A * boundaryWeight θ / (1 + A * boundaryParameter θ) + continuous_toFun := + (continuous_const.mul continuous_boundaryWeight).div + (continuous_const.add (continuous_const.mul continuous_boundaryParameter)) + (fun θ => by nlinarith [(boundaryParameter_mem θ).1]) + +theorem resolventDensity_nonneg {A : ℝ} (hA : 0 < A) (θ : Angle) : + 0 ≤ resolventDensity A hA θ := by + dsimp [resolventDensity] + exact div_nonneg (mul_nonneg hA.le (boundaryWeight_pos θ).le) + (by nlinarith [(boundaryParameter_mem θ).1]) + +def resolventMeasure (μ : FiniteMeasure Angle) (A : ℝ) (hA : 0 < A) : FiniteMeasure Angle := + densityMeasure (μ : Measure Angle) (resolventDensity A hA) + +theorem mass_resolventMeasure (μ : FiniteMeasure Angle) {A : ℝ} (hA : 0 < A) : + ((resolventMeasure μ A hA).mass : ℝ) = + A * ∫ θ : Angle, boundaryWeight θ / (1 + A * boundaryParameter θ) ∂(μ : Measure Angle) := by + rw [resolventMeasure, mass_densityMeasure _ _ (resolventDensity_nonneg hA), ← integral_const_mul] + congr 1 + ext θ + simp only [resolventDensity, ContinuousMap.coe_mk, mul_div_assoc] + +theorem integrable_realKernel (μ : FiniteMeasure Angle) {x : ℝ} (hx : 0 < x) : + Integrable (fun θ => boundaryWeight θ / (1 + (x - 1) * boundaryParameter θ)) (μ : Measure Angle) := by + exact (continuous_boundaryWeight.div + (continuous_const.add (continuous_const.mul continuous_boundaryParameter)) + (fun θ => (real_compactDen_pos (boundaryParameter_mem θ) hx).ne')).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + +theorem resolvent_algebra (μ : FiniteMeasure Angle) {A x : ℝ} (hA : 0 < A) (hx : 0 < x) : + (x - 1) * (∫ θ : Angle, boundaryWeight θ / (1 + (x - 1) * boundaryParameter θ) ∂(μ : Measure Angle)) = + ((resolventMeasure μ A hA).mass : ℝ) - + (1 - (x - 1) / A) * ∫ θ : Angle, realResolvent x hx θ ∂(resolventMeasure μ A hA : Measure Angle) := by + rw [resolventMeasure, mass_densityMeasure _ _ (resolventDensity_nonneg hA), + integral_densityMeasure _ _ (resolventDensity_nonneg hA), ← integral_const_mul, + ← integral_const_mul, ← integral_sub] + · apply integral_congr_ae + filter_upwards with θ + have hd := (real_compactDen_pos (boundaryParameter_mem θ) hx).ne' + have hdA : 1 + A * boundaryParameter θ ≠ 0 := by + nlinarith [(boundaryParameter_mem θ).1] + dsimp [realResolvent, resolventDensity] + field_simp [hd, hdA, hA.ne'] + have hdA' : 1 + boundaryParameter θ * A ≠ 0 := by simpa [mul_comm] using hdA + field_simp [hdA'] + ring + · exact (resolventDensity A hA).continuous.integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + · exact (((resolventDensity A hA).continuous.mul (realResolvent x hx).continuous).const_mul _).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + + + + + +theorem compact_stieltjes_of_difference {R : ℝ → ℝ} (μ : FiniteMeasure Angle) + (hR : ∀ x : ℝ, 0 < x → 0 ≤ R x) + (he : ∀ x : ℝ, 0 < x → R x = R 1 - (x - 1) * + ∫ θ : Angle, boundaryWeight θ / (1 + (x - 1) * boundaryParameter θ) ∂(μ : Measure Angle)) : + ∃ c : ℝ, 0 ≤ c ∧ ∃ ν : FiniteMeasure Angle, + ∀ x : ℝ, 0 < x → R x = c + ∫ θ : Angle, (1 + (x - 1) * boundaryParameter θ)⁻¹ ∂(ν : Measure Angle) := by + let νs : ℕ → FiniteMeasure Angle := fun n => resolventMeasure μ ((n : ℝ) + 1) (by positivity) + let C : ℝ≥0 := ⟨R 1, hR 1 (by norm_num)⟩ + have hm (n : ℕ) : (νs n).mass ≤ C := by + change ((νs n).mass : ℝ) ≤ (C : ℝ) + rw [show νs n = resolventMeasure μ ((n : ℝ) + 1) (by positivity) from rfl, + mass_resolventMeasure] + have hr := hR ((n : ℝ) + 2) (by positivity) + rw [he _ (by positivity)] at hr + dsimp [C] + rw [show (n : ℝ) + 2 - 1 = (n : ℝ) + 1 by ring] at hr + exact sub_nonneg.mp hr + obtain ⟨ν, hν, hc⟩ := + (isCompact_setOfPred_finiteMeasure_le_of_compactSpace Angle C).exists_mapClusterPt + (u := νs) (f := atTop) (by + rw [Filter.le_principal_iff] + change ∀ᶠ n : ℕ in atTop, (νs n).mass ≤ C + exact Eventually.of_forall hm) + let l : Filter ℕ := Filter.comap νs (𝓝 ν) ⊓ atTop + have : NeBot l := neBot_inf_comap_iff_map'.mpr hc + have hνs : Tendsto νs l (𝓝 ν) := tendsto_comap.mono_left inf_le_left + have hmass : Tendsto (fun n => ((νs n).mass : ℝ)) l (𝓝 (ν.mass : ℝ)) := + NNReal.continuous_coe.continuousAt.tendsto.comp + (FiniteMeasure.continuous_mass.continuousAt.tendsto.comp hνs) + refine ⟨R 1 - (ν.mass : ℝ), sub_nonneg.mpr (show (ν.mass : ℝ) ≤ R 1 from hν), ν, ?_⟩ + intro x hx + have hi := (FiniteMeasure.continuous_integral_continuousMap (realResolvent x hx)).continuousAt.tendsto.comp hνs + have hf : Tendsto (fun n : ℕ => 1 - (x - 1) / ((n : ℝ) + 1)) l (𝓝 1) := by + have hd : Tendsto (fun n : ℕ => (x - 1) / ((n : ℝ) + 1)) atTop (𝓝 0) := by + simpa only [Function.comp_def, Nat.cast_add, Nat.cast_one] using + (tendsto_const_div_atTop_nhds_zero_nat (x - 1)).comp (tendsto_add_atTop_nat 1) + simpa using (tendsto_const_nhds (x := (1 : ℝ))).sub (hd.mono_left inf_le_right) + have hlim := ((tendsto_const_nhds (x := R 1)).sub hmass).add (hf.mul hi) + simp only [one_mul] at hlim + apply tendsto_nhds_unique tendsto_const_nhds (hlim.congr (fun n => ?_)) + rw [he x hx, resolvent_algebra μ (by positivity : 0 < (n : ℝ) + 1) hx] + change R 1 - ((νs n).mass : ℝ) + (1 - (x - 1) / ((n : ℝ) + 1)) * _ = + R 1 - (((νs n).mass : ℝ) - (1 - (x - 1) / ((n : ℝ) + 1)) * _) + dsimp only [Function.comp_apply, νs] + ring + + +theorem compactIntegral_real (μ : FiniteMeasure Angle) (x : ℝ) : + compactIntegral μ (x : ℂ) = + ((∫ θ : Angle, boundaryWeight θ / (1 + (x - 1) * boundaryParameter θ) ∂(μ : Measure Angle) : ℝ) : ℂ) := by + rw [compactIntegral, ← integral_complex_ofReal] + apply integral_congr_ae + filter_upwards with θ + simp only [compactKernel, Complex.ofReal_div, Complex.ofReal_add, Complex.ofReal_mul, + Complex.ofReal_sub, Complex.ofReal_one] + + + +theorem compact_stieltjes_representation {R : ℂ → ℂ} + (hR : AnalyticOnNhd ℂ R {s | 0 < s.im}) + (hn : ∀ s : ℂ, 0 < s.im → (R s).im ≤ 0) + (hp : ∀ x : ℝ, 0 < x → AnalyticAt ℂ R (x : ℂ) ∧ (R (x : ℂ)).im = 0 ∧ 0 ≤ (R (x : ℂ)).re) : + ∃ c : ℝ, 0 ≤ c ∧ ∃ ν : FiniteMeasure Angle, + ∀ x : ℝ, 0 < x → (R (x : ℂ)).re = c + + ∫ θ : Angle, (1 + (x - 1) * boundaryParameter θ)⁻¹ ∂(ν : Measure Angle) := by + obtain ⟨μ, hμ⟩ := pick_divided_difference (P := fun s => -R s) + (fun s hs => (hR s hs).neg) (fun s hs => by simpa using hn s hs) + (fun x hx => ⟨(hp x hx).1.neg, by simp [(hp x hx).2.1]⟩) + have he (s : ℂ) (hs : 0 < s.im) : R s = R 1 - (s - 1) * compactIntegral μ s := by + have := hμ s hs + linear_combination -this + have hb (x : ℝ) (hx : 0 < x) : R (x : ℂ) = R 1 - ((x : ℂ) - 1) * compactIntegral μ (x : ℂ) := + upper_boundary_eq (hp x hx).1.continuousAt + (continuousAt_const.sub ((continuousAt_id.sub continuousAt_const).mul + (continuousAt_compactIntegral μ (by simpa using hx)))) he + apply compact_stieltjes_of_difference (R := fun x : ℝ => (R (x : ℂ)).re) μ + (fun x hx => (hp x hx).2.2) + intro x hx + rw [hb x hx, compactIntegral_real] + simp + + + +theorem compactDen_loc_lower {s : ℂ} (hs : 0 < s.im ∨ 0 < s.re) : + ∃ d : ℝ, 0 < d ∧ ∀ z ∈ ball s d, ∀ θ : Angle, + d ≤ ‖1 + (z - 1) * (boundaryParameter θ : ℂ)‖ := by + let D : ℂ → Angle → ℂ := fun z θ => 1 + (z - 1) * (boundaryParameter θ : ℂ) + have hc : Continuous (fun θ : Angle => ‖D s θ‖) := + (continuous_const.add (continuous_const.mul + (Complex.continuous_ofReal.comp continuous_boundaryParameter))).norm + have hne : (univ : Set Angle).Nonempty := ⟨⟨0, le_rfl, by positivity⟩, mem_univ _⟩ + obtain ⟨θ₀, _, hmin⟩ := isCompact_univ.exists_isMinOn hne hc.continuousOn + have hp : 0 < ‖D s θ₀‖ := norm_pos_iff.mpr (compactDen_ne_zero (boundaryParameter_mem θ₀) hs) + refine ⟨‖D s θ₀‖ / 2, half_pos hp, ?_⟩ + intro z hz θ + have hlow : ‖D s θ₀‖ ≤ ‖D s θ‖ := hmin (mem_univ θ) + have ht : ‖(boundaryParameter θ : ℂ)‖ ≤ 1 := by + simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (boundaryParameter_mem θ).1] + using (boundaryParameter_mem θ).2 + have hdiff : ‖D s θ - D z θ‖ ≤ ‖s - z‖ := by + have he : D s θ - D z θ = (s - z) * (boundaryParameter θ : ℂ) := by dsimp [D]; ring + rw [he, norm_mul] + exact (mul_le_mul_of_nonneg_left ht (norm_nonneg _)).trans_eq (mul_one _) + have hnorm := norm_sub_norm_le (D s θ) (D z θ) + have hnear : ‖s - z‖ < ‖D s θ₀‖ / 2 := by + simpa only [mem_ball, dist_eq_norm, norm_sub_rev] using hz + change ‖D s θ₀‖ / 2 ≤ ‖D z θ‖ + linarith + +theorem hasDerivAt_compactKernel {t w : ℝ} {z : ℂ} + (hn : 1 + (z - 1) * (t : ℂ) ≠ 0) : + HasDerivAt (compactKernel t w) + (-((w : ℂ) * t) / (1 + (z - 1) * (t : ℂ)) ^ 2) z := by + have hd : HasDerivAt (fun s : ℂ => 1 + (s - 1) * (t : ℂ)) (t : ℂ) z := by + simpa only [id_eq, one_mul] using (((hasDerivAt_id z).sub_const 1).mul_const (t : ℂ)).const_add 1 + convert! (hasDerivAt_const z (w : ℂ)).div hd hn using 1 + simp only [zero_mul, zero_sub] + +theorem differentiableAt_compactIntegral (μ : FiniteMeasure Angle) {s : ℂ} + (hs : 0 < s.im ∨ 0 < s.re) : DifferentiableAt ℂ (compactIntegral μ) s := by + obtain ⟨d, hd, hden⟩ := compactDen_loc_lower hs + let F' : ℂ → Angle → ℂ := fun z θ => + -((boundaryWeight θ : ℂ) * boundaryParameter θ) / + (1 + (z - 1) * (boundaryParameter θ : ℂ)) ^ 2 + have hmeas : ∀ z : ℂ, AEStronglyMeasurable + (fun θ => compactKernel (boundaryParameter θ) (boundaryWeight θ) z) (μ : Measure Angle) := by + intro z + have hm : Measurable (fun θ : Angle => compactKernel (boundaryParameter θ) (boundaryWeight θ) z) := by + unfold compactKernel + exact (Complex.continuous_ofReal.comp continuous_boundaryWeight).measurable.div + (continuous_const.add (continuous_const.mul + (Complex.continuous_ofReal.comp continuous_boundaryParameter))).measurable + exact hm.aestronglyMeasurable + have hmeas' : AEStronglyMeasurable (F' s) (μ : Measure Angle) := by + have hm : Measurable (F' s) := by + dsimp [F'] + apply Measurable.div + · exact ((Complex.continuous_ofReal.comp continuous_boundaryWeight).mul + (Complex.continuous_ofReal.comp continuous_boundaryParameter)).neg.measurable + · exact ((continuous_const.add (continuous_const.mul + (Complex.continuous_ofReal.comp continuous_boundaryParameter))).pow 2).measurable + exact hm.aestronglyMeasurable + have hbound : ∀ᵐ θ : Angle ∂(μ : Measure Angle), ∀ z ∈ ball s d, ‖F' z θ‖ ≤ 1 / d ^ 2 := by + filter_upwards with θ z hz + have ht := boundaryParameter_mem θ + have hw := boundaryWeight_le_one θ + have hp := boundaryWeight_pos θ + have hnum : ‖(boundaryWeight θ : ℂ) * boundaryParameter θ‖ ≤ 1 := by + rw [norm_mul, Complex.norm_real, Complex.norm_real, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg ht.1, abs_of_pos hp] + exact (mul_le_mul hw ht.2 ht.1 zero_le_one).trans_eq (one_mul 1) + dsimp [F'] + rw [norm_div, norm_neg, norm_pow] + exact div_le_div₀ zero_le_one hnum (sq_pos_of_pos hd) + (sq_le_sq₀ hd.le (norm_nonneg _) |>.mpr (hden z hz θ)) + have hdiff : ∀ᵐ θ : Angle ∂(μ : Measure Angle), ∀ z ∈ ball s d, + HasDerivAt (fun u => compactKernel (boundaryParameter θ) (boundaryWeight θ) u) (F' z θ) z := by + filter_upwards with θ z hz + apply hasDerivAt_compactKernel + exact norm_pos_iff.mp (hd.trans_le (hden z hz θ)) + exact (hasDerivAt_integral_of_dominated_loc_of_deriv_le (ball_mem_nhds s hd) + (Eventually.of_forall hmeas) (compactKernel_integrable μ hs) hmeas' hbound + (integrable_const (1 / d ^ 2)) hdiff).2.differentiableAt + +theorem analyticAt_compactIntegral (μ : FiniteMeasure Angle) {s : ℂ} + (hs : 0 < s.im ∨ 0 < s.re) : AnalyticAt ℂ (compactIntegral μ) s := by + have hopen : IsOpen {s : ℂ | 0 < s.im ∨ 0 < s.re} := + (isOpen_lt continuous_const Complex.continuous_im).union + (isOpen_lt continuous_const Complex.continuous_re) + exact (DifferentiableOn.analyticOnNhd + (fun z hz => (differentiableAt_compactIntegral μ hz).differentiableWithinAt) hopen) s hs + + + + +theorem compactIntegral_real_pos (μ : FiniteMeasure Angle) (hμ : (μ : Measure Angle) ≠ 0) + {x : ℝ} (hx : 0 < x) : 0 < (compactIntegral μ (x : ℂ)).re := by + rw [compactIntegral_real, Complex.ofReal_re] + have hp (θ : Angle) : 0 < boundaryWeight θ / (1 + (x - 1) * boundaryParameter θ) := + div_pos (boundaryWeight_pos θ) (real_compactDen_pos (boundaryParameter_mem θ) hx) + rw [integral_pos_iff_support_of_nonneg (fun θ => (hp θ).le) (integrable_realKernel μ hx)] + have he : Function.support (fun θ : Angle => boundaryWeight θ / (1 + (x - 1) * boundaryParameter θ)) = + univ := by + ext θ + simp only [Function.mem_support, mem_univ, iff_true] + exact (hp θ).ne' + rw [he] + exact Measure.measure_univ_pos.mpr hμ + +end EntropyPhotonNumber.Herglotz + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/HilbertCrouzeix/Calculus.lean b/lean/OAI/Analysis/HilbertCrouzeix/Calculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..c26a67f1337ad5eebd0a1caf4f4c4496e6f6bd07 --- /dev/null +++ b/lean/OAI/Analysis/HilbertCrouzeix/Calculus.lean @@ -0,0 +1,106 @@ +import OAI.Analysis.HilbertCrouzeix.Spectrum + +namespace OAI + +noncomputable section + +open Complex Set +open scoped TensorProduct Matrix.Norms.L2Operator Classical ComplexConjugate + +namespace HilbertCrouzeix + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem HolomorphicOn.continuousOn {m : ℕ} {F : ℂ → Coeff m} {U : Set ℂ} + (hF : HolomorphicOn F U) : ContinuousOn F U := + continuousOn_pi.mpr fun i => continuousOn_pi.mpr fun j => (hF i j).continuousOn + +omit [CompleteSpace H] in +theorem holomorphic_max_attained [Nontrivial H] (A : H →L[ℂ] H) + {m : ℕ} {F : ℂ → Coeff m} {U : Set ℂ} + (hKU : numericalClosure A ⊆ U) (hF : HolomorphicOn F U) : + IsGreatest ((fun z => ‖F z‖) '' numericalClosure A) + (normSup (numericalClosure A) F) := + isGreatest_normSup (isCompact_numericalClosure A) (numericalClosure_nonempty A) + (hF.continuousOn.mono hKU) + +theorem isOpen_poleFreeSet {m : ℕ} (R : RationalMatrix m) : IsOpen (poleFreeSet R) := by + have heq : poleFreeSet R = ⋂ i, ⋂ j, {z | (R i j).denom.eval z ≠ 0} := by + ext z + simp [poleFreeSet] + rw [heq] + exact isOpen_iInter_of_finite fun i => isOpen_iInter_of_finite fun j => + isOpen_ne.preimage (R i j).denom.continuous + +theorem rationalFunction_holomorphic {m : ℕ} (R : RationalMatrix m) : + HolomorphicOn (rationalFunction R) (poleFreeSet R) := by + intro i j + simp only [rationalFunction, RatFunc.eval, Polynomial.eval₂_id] + exact (R i j).num.differentiable.differentiableOn.div + (R i j).denom.differentiable.differentiableOn (fun z hz => hz i j) + +omit [CompleteSpace H] in +theorem rational_max_attained [Nontrivial H] (A : H →L[ℂ] H) + {m : ℕ} (R : RationalMatrix m) (hR : numericalClosure A ⊆ poleFreeSet R) : + IsGreatest ((fun z => ‖rationalFunction R z‖) '' numericalClosure A) + (normSup (numericalClosure A) (rationalFunction R)) := + holomorphic_max_attained A hR (rationalFunction_holomorphic R) + +theorem rational_denominator_isUnit [Nontrivial H] (A : H →L[ℂ] H) + {m : ℕ} (R : RationalMatrix m) (hR : numericalClosure A ⊆ poleFreeSet R) + (i j : Fin m) : IsUnit (Polynomial.aeval A (R i j).denom) := by + apply (spectrum.zero_notMem_iff ℂ).mp + rw [spectrum.map_polynomial_aeval] + rintro ⟨z, hz, hz0⟩ + exact hR (spectrum_subset_numericalClosure A hz) i j hz0 + +section TrivialSpace +omit [CompleteSpace H] + +theorem numericalRange_eq_empty [Subsingleton H] (A : H →L[ℂ] H) : + numericalRange A = ∅ := by + apply eq_empty_iff_forall_notMem.mpr + rintro z ⟨x, hx, h⟩ + have hx0 : x = 0 := Subsingleton.elim _ _ + simp [hx0] at hx + +theorem amplification_eq_zero [Subsingleton H] (m : ℕ) (x : Amplification H m) : + x = 0 := by + refine UniformSpace.Completion.induction_on x (isClosed_eq continuous_id continuous_const) ?_ + intro a + have ha : a = 0 := Subsingleton.elim _ _ + simp only [ha, UniformSpace.Completion.coe_zero] + +theorem amplifiedOperator_eq_zero [Subsingleton H] (m : ℕ) + (T : Amplification H m →L[ℂ] Amplification H m) : T = 0 := by + apply ContinuousLinearMap.ext + intro x + exact amplification_eq_zero m (T x) + +end TrivialSpace + +theorem zeroConclusion [Subsingleton H] (A : H →L[ℂ] H) : ZeroConclusion A := by + have hW := numericalRange_eq_empty A + refine ⟨hW, ?_, ?_⟩ + · intro m F + simp [hW] + · intro m hm + refine ⟨amplifiedOperator_eq_zero m, ?_, ?_, ?_⟩ + · intro d B + have hP := amplifiedOperator_eq_zero m (polynomialEval A B) + exact ⟨hP, by simp only [hP, hW, normSup_empty, mul_zero]; exact le_of_eq ContinuousLinearMap.opNorm_zero⟩ + · intro U F + have hF := amplifiedOperator_eq_zero m (holomorphicEval A U F) + exact ⟨hF, by simp only [hF, hW, normSup_empty, mul_zero]; exact le_of_eq ContinuousLinearMap.opNorm_zero⟩ + · intro R + have hR := amplifiedOperator_eq_zero m (rationalEval A R) + exact ⟨hR, by simp only [hR, hW, normSup_empty, mul_zero]; exact le_of_eq ContinuousLinearMap.opNorm_zero⟩ + + +end HilbertCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/HilbertCrouzeix/Compression.lean b/lean/OAI/Analysis/HilbertCrouzeix/Compression.lean new file mode 100644 index 0000000000000000000000000000000000000000..c450ec7d0ebddf83709ec1306772761c5f598bc4 --- /dev/null +++ b/lean/OAI/Analysis/HilbertCrouzeix/Compression.lean @@ -0,0 +1,144 @@ +import OAI.Analysis.HilbertCrouzeix.NumericalRange + +namespace OAI + +noncomputable section + +open Complex Set +open scoped TensorProduct Matrix.Norms.L2Operator Classical ComplexConjugate + +namespace HilbertCrouzeix + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +section Elementary +omit [CompleteSpace H] + +def compression (A : H →L[ℂ] H) (E : Submodule ℂ H) [E.HasOrthogonalProjection] : + E →L[ℂ] E := E.orthogonalProjectionOnto.comp (A.comp E.subtypeL) + +theorem numericalRange_compression_subset (A : H →L[ℂ] H) (E : Submodule ℂ H) + [E.HasOrthogonalProjection] : numericalRange (compression A E) ⊆ numericalRange A := by + rintro z ⟨x, hx, rfl⟩ + refine ⟨(x : H), hx, ?_⟩ + exact (Submodule.inner_orthogonalProjectionOnto_eq_of_mem_left x (A x)).symm + +theorem compression_pow (A : H →L[ℂ] H) (E : Submodule ℂ H) + [E.HasOrthogonalProjection] (x : E) {d : ℕ} + (hmem : ∀ k ≤ d, (A ^ k) (x : H) ∈ E) {k : ℕ} (hk : k ≤ d) : + (((compression A E) ^ k) x : H) = (A ^ k) (x : H) := by + induction k with + | zero => simp + | succ k ih => + have hk' : k ≤ d := by omega + have hn : A ((A ^ k) (x : H)) ∈ E := by + simpa only [pow_succ', mul_apply_eq_comp] using hmem (k + 1) hk + rw [pow_succ', pow_succ', mul_apply_eq_comp, mul_apply_eq_comp] + change E.starProjection (A (((compression A E) ^ k) x : H)) = _ + rw [ih hk'] + exact Submodule.starProjection_eq_self_iff.mpr hn + +def iterateSpace {q : ℕ} (A : H →L[ℂ] H) (d : ℕ) (x : Fin q → H) : Submodule ℂ H := + Submodule.span ℂ (Set.range fun t : Fin (d + 1) × Fin q => (A ^ t.1.val) (x t.2)) + +instance iterateSpace_finiteDimensional {q : ℕ} (A : H →L[ℂ] H) (d : ℕ) + (x : Fin q → H) : FiniteDimensional ℂ (iterateSpace A d x) := + FiniteDimensional.span_of_finite ℂ (Set.finite_range _) + +theorem pow_mem_iterateSpace {q : ℕ} (A : H →L[ℂ] H) (d : ℕ) (x : Fin q → H) + {k : ℕ} (hk : k ≤ d) (j : Fin q) : (A ^ k) (x j) ∈ iterateSpace A d x := by + apply Submodule.subset_span + exact ⟨(⟨k, by omega⟩, j), rfl⟩ + +theorem mem_iterateSpace {q : ℕ} (A : H →L[ℂ] H) (d : ℕ) (x : Fin q → H) + (j : Fin q) : x j ∈ iterateSpace A d x := by + simpa using pow_mem_iterateSpace A d x (Nat.zero_le d) j + +def completedIsometry {V : Type*} {W : Type*} + [NormedAddCommGroup V] [NormedAddCommGroup W] [NormedSpace ℂ V] [NormedSpace ℂ W] + (f : V →ₗᵢ[ℂ] W) : UniformSpace.Completion V →ₗᵢ[ℂ] UniformSpace.Completion W := + { f.toContinuousLinearMap.completion.toLinearMap with + norm_map' := f.isometry.completion_map.norm_map_of_map_zero + (f.toContinuousLinearMap.completion.map_zero) } + +def tensorInclusion (E : Submodule ℂ H) (m : ℕ) : + Amplification E m →ₗᵢ[ℂ] Amplification H m := + completedIsometry (TensorProduct.mapIsometry E.subtypeₗᵢ (.id : CoeffSpace m →ₗᵢ[ℂ] CoeffSpace m)) + +@[simp] theorem tensorInclusion_tmul (E : Submodule ℂ H) {m : ℕ} + (x : E) (v : CoeffSpace m) : + tensorInclusion E m (↑(x ⊗ₜ[ℂ] v)) = (↑((x : H) ⊗ₜ[ℂ] v) : Amplification H m) := by + change (TensorProduct.mapIsometry E.subtypeₗᵢ (.id : CoeffSpace m →ₗᵢ[ℂ] CoeffSpace m) + ).toContinuousLinearMap.completion (↑(x ⊗ₜ[ℂ] v)) = _ + rw [ContinuousLinearMap.completion_apply_coe] + rfl + +@[simp] theorem tensorOp_tmul {m : ℕ} (A : H →L[ℂ] H) (B : Coeff m) + (x : H) (v : CoeffSpace m) : + tensorOp A B (↑(x ⊗ₜ[ℂ] v)) = + (↑(A x ⊗ₜ[ℂ] (Matrix.toEuclideanCLM (n := Fin m) (𝕜 := ℂ) B) v) : Amplification H m) := by + simp only [tensorOp, ContinuousLinearMap.completion_apply_coe, TensorProduct.mapL_tmul] + +theorem polynomialEval_compression_tmul (A : H →L[ℂ] H) (E : Submodule ℂ H) + [E.HasOrthogonalProjection] {m d : ℕ} (B : Fin (d + 1) → Coeff m) + (x : E) (v : CoeffSpace m) (hmem : ∀ k ≤ d, (A ^ k) (x : H) ∈ E) : + tensorInclusion E m (polynomialEval (compression A E) B (↑(x ⊗ₜ[ℂ] v))) = + polynomialEval A B (↑((x : H) ⊗ₜ[ℂ] v)) := by + simp only [polynomialEval, sum_apply, map_sum, tensorOp_tmul, + tensorInclusion_tmul] + apply Finset.sum_congr rfl + intro k hk + rw [compression_pow A E x hmem (Nat.le_of_lt_succ k.isLt)] + +@[simp] theorem completion_coe_sum {V : Type*} [NormedAddCommGroup V] + {ι : Type*} (s : Finset ι) (f : ι → V) : + (↑(∑ i ∈ s, f i) : UniformSpace.Completion V) = ∑ i ∈ s, (↑(f i) : UniformSpace.Completion V) := + map_sum (UniformSpace.Completion.toCompl : V →+ UniformSpace.Completion V) f s + +theorem exists_finite_compression {m d : ℕ} (A : H →L[ℂ] H) + (B : Fin (d + 1) → Coeff m) (ξ : H ⊗[ℂ] CoeffSpace m) : + ∃ (E : Submodule ℂ H) (hE : FiniteDimensional ℂ E), + letI : FiniteDimensional ℂ E := hE + ∃ η : Amplification E m, + tensorInclusion E m η = (↑ξ : Amplification H m) ∧ + tensorInclusion E m (polynomialEval (compression A E) B η) = + polynomialEval A B (↑ξ) := by + obtain ⟨q, x, v, rfl⟩ := TensorProduct.exists_sum_tmul_eq ξ + let E := iterateSpace A d x + let xE (j : Fin q) : E := ⟨x j, mem_iterateSpace A d x j⟩ + let η : Amplification E m := ∑ j : Fin q, (↑(xE j ⊗ₜ[ℂ] v j) : Amplification E m) + refine ⟨E, inferInstance, η, ?_, ?_⟩ + · simp only [η, map_sum, tensorInclusion_tmul, completion_coe_sum] + rfl + · simp only [η, map_sum, completion_coe_sum] + apply Finset.sum_congr rfl + intro j hj + exact polynomialEval_compression_tmul A E B (xE j) (v j) + (fun k hk => pow_mem_iterateSpace A d x hk j) + +theorem exists_finite_compression_norm_bound {m d : ℕ} (A : H →L[ℂ] H) + (B : Fin (d + 1) → Coeff m) (ξ : H ⊗[ℂ] CoeffSpace m) : + ∃ (E : Submodule ℂ H) (hE : FiniteDimensional ℂ E), + letI : FiniteDimensional ℂ E := hE + ‖polynomialEval A B (↑ξ)‖ ≤ ‖polynomialEval (compression A E) B‖ * ‖ξ‖ := by + obtain ⟨E, hE, η, hη, hp⟩ := exists_finite_compression A B ξ + let : FiniteDimensional ℂ E := hE + refine ⟨E, hE, ?_⟩ + calc + ‖polynomialEval A B (↑ξ)‖ = + ‖tensorInclusion E m (polynomialEval (compression A E) B η)‖ := congrArg norm hp.symm + _ = ‖polynomialEval (compression A E) B η‖ := (tensorInclusion E m).norm_map _ + _ ≤ ‖polynomialEval (compression A E) B‖ * ‖η‖ := + (polynomialEval (compression A E) B).le_opNorm η + _ = ‖polynomialEval (compression A E) B‖ * ‖ξ‖ := by + rw [← (tensorInclusion E m).norm_map η, hη, UniformSpace.Completion.norm_coe] + +end Elementary + +end HilbertCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/HilbertCrouzeix/Definitions.lean b/lean/OAI/Analysis/HilbertCrouzeix/Definitions.lean new file mode 100644 index 0000000000000000000000000000000000000000..17c06b6373ad54f73646a0f70482049d96221764 --- /dev/null +++ b/lean/OAI/Analysis/HilbertCrouzeix/Definitions.lean @@ -0,0 +1,152 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Complex Set +open scoped TensorProduct Matrix.Norms.L2Operator Classical ComplexConjugate + +namespace HilbertCrouzeix + +universe u + +abbrev Coeff (m : ℕ) := Matrix (Fin m) (Fin m) ℂ +abbrev CoeffSpace (m : ℕ) := EuclideanSpace ℂ (Fin m) + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +def numericalRange (A : H →L[ℂ] H) : Set ℂ := + {z | ∃ x : H, ‖x‖ = 1 ∧ inner ℂ x (A x) = z} + +def numericalClosure (A : H →L[ℂ] H) : Set ℂ := closure (numericalRange A) + +abbrev Amplification (H : Type u) [NormedAddCommGroup H] [InnerProductSpace ℂ H] + (m : ℕ) := UniformSpace.Completion (H ⊗[ℂ] CoeffSpace m) + +def tensorOp {m : ℕ} (A : H →L[ℂ] H) (B : Coeff m) : + Amplification H m →L[ℂ] Amplification H m := + (TensorProduct.mapL A (Matrix.toEuclideanCLM (n := Fin m) (𝕜 := ℂ) B)).completion + +def matrixPolynomial {m d : ℕ} (B : Fin (d + 1) → Coeff m) (z : ℂ) : Coeff m := + ∑ k : Fin (d + 1), z ^ k.val • B k + +def polynomialEval {m d : ℕ} (A : H →L[ℂ] H) (B : Fin (d + 1) → Coeff m) : + Amplification H m →L[ℂ] Amplification H m := + ∑ k : Fin (d + 1), tensorOp (A ^ k.val) (B k) + +def normSup {E : Type*} [Norm E] (S : Set ℂ) (f : ℂ → E) : ℝ := + if S.Nonempty then sSup ((fun z => ‖f z‖) '' S) else 0 + +def contourIntegral {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] + (γ : ℝ → ℂ) (f : ℂ → E) : E := + ∫ t : ℝ in (0 : ℝ)..1, deriv γ t • f (γ t) + +def contourIndex (γ : ℝ → ℂ) (z : ℂ) : ℂ := + (2 * (Real.pi : ℂ) * Complex.I)⁻¹ * contourIntegral γ (fun w => (w - z)⁻¹) + +def IsCauchyContour (K U : Set ℂ) (γ : ℝ → ℂ) : Prop := + ContDiff ℝ 1 γ ∧ γ 0 = γ 1 ∧ + (∀ t ∈ Set.Icc (0 : ℝ) 1, γ t ∈ U \ K) ∧ + (∀ z ∈ K, contourIndex γ z = 1) ∧ + (∀ z ∉ U, contourIndex γ z = 0) + +def chosenContour (K U : Set ℂ) : ℝ → ℂ := + Classical.epsilon (IsCauchyContour K U) + +variable [CompleteSpace H] + +def dunfordIntegral (A : H →L[ℂ] H) (γ : ℝ → ℂ) (f : ℂ → ℂ) : H →L[ℂ] H := + (2 * (Real.pi : ℂ) * Complex.I)⁻¹ • + contourIntegral γ (fun z => f z • resolvent A z) + +def holomorphicCalculus (A : H →L[ℂ] H) (U : Set ℂ) (f : ℂ → ℂ) : H →L[ℂ] H := + dunfordIntegral A (chosenContour (numericalClosure A) U) f + +def matrixUnit {m : ℕ} (i j : Fin m) : Coeff m := Matrix.single i j 1 + +def holomorphicEval {m : ℕ} (A : H →L[ℂ] H) (U : Set ℂ) (F : ℂ → Coeff m) : + Amplification H m →L[ℂ] Amplification H m := + ∑ i : Fin m, ∑ j : Fin m, + tensorOp (holomorphicCalculus A U (fun z => F z i j)) (matrixUnit i j) + +def contourEval {m : ℕ} (A : H →L[ℂ] H) (γ : ℝ → ℂ) (F : ℂ → Coeff m) : + Amplification H m →L[ℂ] Amplification H m := + ∑ i : Fin m, ∑ j : Fin m, + tensorOp (dunfordIntegral A γ (fun z => F z i j)) (matrixUnit i j) + +def HolomorphicOn {m : ℕ} (F : ℂ → Coeff m) (U : Set ℂ) : Prop := + ∀ i j, DifferentiableOn ℂ (fun z => F z i j) U + +abbrev RationalMatrix (m : ℕ) := Matrix (Fin m) (Fin m) (RatFunc ℂ) + +def poleFreeSet {m : ℕ} (R : RationalMatrix m) : Set ℂ := + {z | ∀ i j, (R i j).denom.eval z ≠ 0} + +def rationalFunction {m : ℕ} (R : RationalMatrix m) (z : ℂ) : Coeff m := + fun i j => RatFunc.eval (RingHom.id ℂ) z (R i j) + +def rationalCalculus (A : H →L[ℂ] H) (r : RatFunc ℂ) : H →L[ℂ] H := + Polynomial.aeval A r.num * Ring.inverse (Polynomial.aeval A r.denom) + +def rationalEval {m : ℕ} (A : H →L[ℂ] H) (R : RationalMatrix m) : + Amplification H m →L[ℂ] Amplification H m := + ∑ i : Fin m, ∑ j : Fin m, tensorOp (rationalCalculus A (R i j)) (matrixUnit i j) + +def PolynomialConclusion (A : H →L[ℂ] H) : Prop := + ∀ (m : ℕ), 0 < m → ∀ (d : ℕ) (B : Fin (d + 1) → Coeff m), + ‖polynomialEval A B‖ ≤ 2 * normSup (numericalRange A) (matrixPolynomial B) ∧ + 2 * normSup (numericalRange A) (matrixPolynomial B) = + 2 * normSup (numericalClosure A) (matrixPolynomial B) ∧ + IsGreatest ((fun z => ‖matrixPolynomial B z‖) '' numericalClosure A) + (normSup (numericalClosure A) (matrixPolynomial B)) + +def HolomorphicConclusion (A : H →L[ℂ] H) : Prop := + ∀ (m : ℕ), 0 < m → ∀ (U : Set ℂ), IsOpen U → numericalClosure A ⊆ U → + ∀ (F : ℂ → Coeff m), HolomorphicOn F U → + (∃ γ, IsCauchyContour (numericalClosure A) U γ) ∧ + (∀ γ, IsCauchyContour (numericalClosure A) U γ → + ∀ i j, dunfordIntegral A γ (fun z => F z i j) = + holomorphicCalculus A U (fun z => F z i j)) ∧ + IsGreatest ((fun z => ‖F z‖) '' numericalClosure A) + (normSup (numericalClosure A) F) ∧ + ‖holomorphicEval A U F‖ ≤ 2 * normSup (numericalClosure A) F + +def RationalConclusion (A : H →L[ℂ] H) : Prop := + ∀ (m : ℕ), 0 < m → ∀ (R : RationalMatrix m), + numericalClosure A ⊆ poleFreeSet R → + (∀ i j, IsUnit (Polynomial.aeval A (R i j).denom)) ∧ + rationalEval A R = holomorphicEval A (poleFreeSet R) (rationalFunction R) ∧ + IsGreatest ((fun z => ‖rationalFunction R z‖) '' numericalClosure A) + (normSup (numericalClosure A) (rationalFunction R)) ∧ + ‖rationalEval A R‖ ≤ 2 * normSup (numericalClosure A) (rationalFunction R) + +def NonzeroConclusion (A : H →L[ℂ] H) : Prop := + IsCompact (numericalClosure A) ∧ Convex ℝ (numericalClosure A) ∧ + spectrum ℂ A ⊆ numericalClosure A ∧ PolynomialConclusion A ∧ + HolomorphicConclusion A ∧ RationalConclusion A + +def ZeroConclusion (A : H →L[ℂ] H) : Prop := + numericalRange A = ∅ ∧ + (∀ (m : ℕ) (F : ℂ → Coeff m), normSup (numericalRange A) F = 0) ∧ + ∀ (m : ℕ), 0 < m → + (∀ T : Amplification H m →L[ℂ] Amplification H m, T = 0) ∧ + (∀ (d : ℕ) (B : Fin (d + 1) → Coeff m), polynomialEval A B = 0 ∧ + ‖polynomialEval A B‖ ≤ 2 * normSup (numericalRange A) (matrixPolynomial B)) ∧ + (∀ (U : Set ℂ) (F : ℂ → Coeff m), holomorphicEval A U F = 0 ∧ + ‖holomorphicEval A U F‖ ≤ 2 * normSup (numericalRange A) F) ∧ + (∀ (R : RationalMatrix m), rationalEval A R = 0 ∧ + ‖rationalEval A R‖ ≤ 2 * normSup (numericalRange A) (rationalFunction R)) + +def UniformlySharp : Prop := + ∀ c : ℝ, c < 2 → ∃ (n m d : ℕ), 0 < n ∧ 0 < m ∧ + ∃ (A : CoeffSpace n →L[ℂ] CoeffSpace n) (B : Fin (d + 1) → Coeff m), + c * normSup (numericalRange A) (matrixPolynomial B) < ‖polynomialEval A B‖ + + + +end HilbertCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/HilbertCrouzeix/Main.lean b/lean/OAI/Analysis/HilbertCrouzeix/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..6db2ed834212c3892105e2e639b8b0bb32d47ef8 --- /dev/null +++ b/lean/OAI/Analysis/HilbertCrouzeix/Main.lean @@ -0,0 +1,2 @@ +import OAI.Analysis.HilbertCrouzeix.Calculus +import OAI.Analysis.HilbertCrouzeix.Sharpness diff --git a/lean/OAI/Analysis/HilbertCrouzeix/NumericalRange.lean b/lean/OAI/Analysis/HilbertCrouzeix/NumericalRange.lean new file mode 100644 index 0000000000000000000000000000000000000000..669488076cc1dbd8daa14b1810c3912fb8baed2e --- /dev/null +++ b/lean/OAI/Analysis/HilbertCrouzeix/NumericalRange.lean @@ -0,0 +1,237 @@ +import OAI.Analysis.HilbertCrouzeix.Definitions + +namespace OAI + +noncomputable section + +open Complex Set +open scoped TensorProduct Matrix.Norms.L2Operator Classical ComplexConjugate + +namespace HilbertCrouzeix + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +section Elementary +omit [CompleteSpace H] + +theorem norm_le_of_mem_numericalRange (A : H →L[ℂ] H) {z : ℂ} + (hz : z ∈ numericalRange A) : ‖z‖ ≤ ‖A‖ := by + obtain ⟨x, hx, rfl⟩ := hz + calc + ‖inner ℂ x (A x)‖ ≤ ‖x‖ * ‖A x‖ := norm_inner_le_norm _ _ + _ ≤ ‖x‖ * (‖A‖ * ‖x‖) := mul_le_mul_of_nonneg_left (A.le_opNorm x) (norm_nonneg x) + _ = ‖A‖ := by rw [hx]; ring + +theorem numericalRange_subset_closedBall (A : H →L[ℂ] H) : + numericalRange A ⊆ Metric.closedBall 0 ‖A‖ := by + intro z hz + simpa only [Metric.mem_closedBall, dist_zero_right] using + norm_le_of_mem_numericalRange A hz + +theorem numericalClosure_subset_closedBall (A : H →L[ℂ] H) : + numericalClosure A ⊆ Metric.closedBall 0 ‖A‖ := + closure_minimal (numericalRange_subset_closedBall A) Metric.isClosed_closedBall + +theorem isCompact_numericalClosure (A : H →L[ℂ] H) : + IsCompact (numericalClosure A) := + (isCompact_closedBall (0 : ℂ) ‖A‖).of_isClosed_subset isClosed_closure + (numericalClosure_subset_closedBall A) + +theorem numericalRange_nonempty [Nontrivial H] (A : H →L[ℂ] H) : + (numericalRange A).Nonempty := by + obtain ⟨x, hx⟩ := exists_ne (0 : H) + let y : H := (‖x‖ : ℂ)⁻¹ • x + exact ⟨inner ℂ y (A y), y, norm_smul_inv_norm hx, rfl⟩ + +theorem numericalClosure_nonempty [Nontrivial H] (A : H →L[ℂ] H) : + (numericalClosure A).Nonempty := (numericalRange_nonempty A).closure + +@[simp] theorem normSup_empty {E : Type*} [Norm E] (f : ℂ → E) : + normSup ∅ f = 0 := by simp [normSup] + +theorem isGreatest_normSup {E : Type*} [NormedAddCommGroup E] + {S : Set ℂ} (hS : IsCompact S) (hne : S.Nonempty) + {f : ℂ → E} (hf : ContinuousOn f S) : + IsGreatest ((fun z => ‖f z‖) '' S) (normSup S f) := by + rw [normSup, ite_eq_left hne] + exact (hS.image_of_continuousOn hf.norm).isGreatest_sSup (hne.image _) + +theorem normSup_closure {E : Type*} [NormedAddCommGroup E] + {S : Set ℂ} (hS : IsCompact (closure S)) (hne : S.Nonempty) + {f : ℂ → E} (hf : ContinuousOn f (closure S)) : + normSup S f = normSup (closure S) f := by + have himg : BddAbove ((fun z => ‖f z‖) '' closure S) := + (hS.image_of_continuousOn hf.norm).bddAbove + have hsmall : BddAbove ((fun z => ‖f z‖) '' S) := + himg.mono (image_mono subset_closure) + simp only [normSup, ite_eq_left hne, ite_eq_left hne.closure] + apply le_antisymm + · exact csSup_le_csSup himg (hne.image _) (image_mono subset_closure) + · apply csSup_le (hne.closure.image _) + rintro _ ⟨z, hz, rfl⟩ + exact le_on_closure (fun w hw => le_csSup hsmall (mem_image_of_mem _ hw)) + hf.norm continuousOn_const hz + +theorem continuous_matrixPolynomial {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + Continuous (matrixPolynomial B) := by + unfold matrixPolynomial + exact continuous_finsetSum _ fun k _ => (continuous_id.pow k.val).smul continuous_const + +theorem polynomial_sup_eq_max [Nontrivial H] (A : H →L[ℂ] H) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + normSup (numericalRange A) (matrixPolynomial B) = + normSup (numericalClosure A) (matrixPolynomial B) ∧ + IsGreatest ((fun z => ‖matrixPolynomial B z‖) '' numericalClosure A) + (normSup (numericalClosure A) (matrixPolynomial B)) := by + exact ⟨normSup_closure (isCompact_numericalClosure A) (numericalRange_nonempty A) + (continuous_matrixPolynomial B).continuousOn, + isGreatest_normSup (isCompact_numericalClosure A) (numericalClosure_nonempty A) + (continuous_matrixPolynomial B).continuousOn⟩ + +lemma exists_unit_phase (w z : ℂ) : + ∃ c : ℂ, ‖c‖ = 1 ∧ (c * w).im = 0 ∧ 0 ≤ (c * z).re := by + have he : ∃ c : ℂ, ‖c‖ = 1 ∧ (c * w).im = 0 := by + by_cases hw : w = 0 + · exact ⟨1, norm_one, by simp [hw]⟩ + let c : ℂ := (‖w‖ : ℂ)⁻¹ * conj w + refine ⟨c, ?_, ?_⟩ + · simp [c, norm_inv, norm_ne_zero_iff.mpr hw] + · simp only [c, mul_assoc, ← Complex.normSq_eq_conj_mul_self] + simp + obtain ⟨c, hc, him⟩ := he + by_cases hre : 0 ≤ (c * z).re + · exact ⟨c, hc, him, hre⟩ + · exact ⟨-c, by simpa using hc, by simpa only [neg_mul, Complex.neg_im, neg_eq_zero] using him, + by simpa using (le_of_not_ge hre)⟩ + +lemma quadratic_cross_im (T : H →L[ℂ] H) (x y : H) (c : ℂ) + (hc : (c * (inner ℂ x (T y) - conj (inner ℂ y (T x)))).im = 0) : + (inner ℂ x (T (c • y)) + inner ℂ (c • y) (T x)).im = 0 := by + simp only [map_smul, inner_smul_right, inner_smul_left] + simp only [Complex.mul_im, Complex.sub_re, Complex.sub_im, + Complex.conj_re, Complex.conj_im, Complex.add_im] at * + linear_combination hc + +lemma quadratic_segment_im (T : H →L[ℂ] H) (x y : H) + (hx : (inner ℂ x (T x)).im = 0) (hy : (inner ℂ y (T y)).im = 0) + (hxy : (inner ℂ x (T y) + inner ℂ y (T x)).im = 0) (s t : ℝ) : + (inner ℂ ((s : ℂ) • x + (t : ℂ) • y) + (T ((s : ℂ) • x + (t : ℂ) • y))).im = 0 := by + have heq : inner ℂ ((s : ℂ) • x + (t : ℂ) • y) + (T ((s : ℂ) • x + (t : ℂ) • y)) = + (s : ℂ)^2 * inner ℂ x (T x) + (s : ℂ) * (t : ℂ) * + (inner ℂ x (T y) + inner ℂ y (T x)) + (t : ℂ)^2 * inner ℂ y (T y) := by + simp only [map_add, map_smul, inner_add_left, inner_add_right, + inner_smul_left, inner_smul_right, Complex.conj_ofReal] + ring + rw [heq] + simp only [Complex.add_im, Complex.mul_im, Complex.mul_re, ← Complex.ofReal_pow, Complex.ofReal_re, Complex.ofReal_im] at * + linear_combination s * t * hxy + s ^ 2 * hx + t ^ 2 * hy + +lemma unit_segment_ne_zero (x y : H) (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) + (hxy : 0 ≤ (inner ℂ x y).re) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : + (((1 - t : ℝ) : ℂ) • x + (t : ℂ) • y) ≠ 0 := by + intro hz + have hn := norm_add_sq (𝕜 := ℂ) (((1 - t : ℝ) : ℂ) • x) ((t : ℂ) • y) + simp only [hz, norm_zero, zero_pow (by decide : 2 ≠ 0), norm_smul, hx, hy, + mul_one, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg ht.1, + abs_of_nonneg (sub_nonneg.mpr ht.2), inner_smul_left, inner_smul_right, + Complex.conj_ofReal] at hn + have hp : 0 ≤ (1 - t) * t * (inner ℂ x y).re := + mul_nonneg (mul_nonneg (sub_nonneg.mpr ht.2) ht.1) hxy + change 0 = (1 - t) ^ 2 + 2 * ((t : ℂ) * (((1 - t : ℝ) : ℂ) * inner ℂ x y)).re + t ^ 2 at hn + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, + Complex.mul_im, zero_mul, add_zero, sub_zero] at hn + nlinarith [sq_nonneg (1 - 2 * t)] + +lemma zero_mem_numericalRange_of_opposite (T : H →L[ℂ] H) (x y : H) + (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) + (hxim : (inner ℂ x (T x)).im = 0) (hyim : (inner ℂ y (T y)).im = 0) + (hxre : (inner ℂ x (T x)).re ≤ 0) (hyre : 0 ≤ (inner ℂ y (T y)).re) : + 0 ∈ numericalRange T := by + obtain ⟨c, hc, hcim, hcre⟩ := exists_unit_phase + (inner ℂ x (T y) - conj (inner ℂ y (T x))) (inner ℂ x y) + let y' : H := c • y + have hy' : ‖y'‖ = 1 := by simp [y', norm_smul, hc, hy] + have hqy : inner ℂ y' (T y') = inner ℂ y (T y) := by + simp only [y', map_smul, inner_smul_left, inner_smul_right, ← mul_assoc, + RCLike.mul_conj, hc, RCLike.ofReal_one, one_pow, one_mul] + have hcross := quadratic_cross_im T x y c hcim + have hpos : 0 ≤ (inner ℂ x y').re := by simpa only [y', inner_smul_right] using hcre + let v (t : ℝ) : H := (((1 - t : ℝ) : ℂ) • x + (t : ℂ) • y') + have hv : Continuous v := + ((Complex.continuous_ofReal.comp (continuous_const.sub continuous_id)).smul + continuous_const).add ((Complex.continuous_ofReal).smul continuous_const) + let f (t : ℝ) : ℝ := (inner ℂ (v t) (T (v t))).re + have hf : Continuous f := Complex.continuous_re.comp (hv.inner (T.continuous.comp hv)) + have hf0 : f 0 ≤ 0 := by simpa [f, v] using hxre + have hf1 : 0 ≤ f 1 := by simpa only [f, v, sub_self, Complex.ofReal_zero, + zero_smul, Complex.ofReal_one, one_smul, zero_add, hqy] using hyre + obtain ⟨t, ht, hfval⟩ := intermediate_value_Icc (by norm_num : (0 : ℝ) ≤ 1) + hf.continuousOn ⟨hf0, hf1⟩ + have hn : v t ≠ 0 := unit_segment_ne_zero x y' hx hy' hpos ht + have hzero : inner ℂ (v t) (T (v t)) = 0 := by + apply Complex.ext + · exact hfval + · exact quadratic_segment_im T x y' hxim (hqy ▸ hyim) hcross (1 - t) t + refine ⟨(‖v t‖ : ℂ)⁻¹ • v t, norm_smul_inv_norm hn, ?_⟩ + simp only [map_smul, inner_smul_left, inner_smul_right, hzero, mul_zero] + +theorem convex_numericalRange (A : H →L[ℂ] H) : Convex ℝ (numericalRange A) := by + intro z hz w hw a b ha hb hab + by_cases hzw : z = w + · subst w + simpa only [← add_smul, hab, one_smul] using hz + obtain ⟨x, hx, hxz⟩ := hz + obtain ⟨y, hy, hyw⟩ := hw + let δ : ℂ := w - z + let z₀ : ℂ := a • z + b • w + let T : H →L[ℂ] H := conj δ • (A - z₀ • (1 : H →L[ℂ] H)) + have hq (v : H) (hv : ‖v‖ = 1) : + inner ℂ v (T v) = conj δ * (inner ℂ v (A v) - z₀) := by + simp only [T, smul_apply, sub_apply, inner_smul_right, + inner_sub_right, one_apply_eq_self, inner_self_eq_norm_sq_to_K, hv, + RCLike.ofReal_one, one_pow, mul_one] + have hxq : inner ℂ x (T x) = ((-b * normSq δ : ℝ) : ℂ) := by + rw [hq x hx, hxz] + calc + conj δ * (z - z₀) = (-b : ℂ) * (conj δ * δ) := by + have ha' : a = 1 - b := by linarith + simp only [z₀, δ, ha', Complex.real_smul, Complex.ofReal_sub, Complex.ofReal_one] + ring + _ = ((-b * normSq δ : ℝ) : ℂ) := by + rw [← Complex.normSq_eq_conj_mul_self] + push_cast + rfl + have hyq : inner ℂ y (T y) = ((a * normSq δ : ℝ) : ℂ) := by + rw [hq y hy, hyw] + calc + conj δ * (w - z₀) = (a : ℂ) * (conj δ * δ) := by + have hb' : b = 1 - a := by linarith + simp only [z₀, δ, hb', Complex.real_smul, Complex.ofReal_sub, Complex.ofReal_one] + ring + _ = ((a * normSq δ : ℝ) : ℂ) := by + rw [← Complex.normSq_eq_conj_mul_self] + push_cast + rfl + obtain ⟨v, hv, hTv⟩ := zero_mem_numericalRange_of_opposite T x y hx hy + (by simp [hxq]) (by simp [hyq]) + (by simpa only [hxq, Complex.ofReal_re] using + mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr hb) (normSq_nonneg δ)) + (by simpa only [hyq, Complex.ofReal_re] using mul_nonneg ha (normSq_nonneg δ)) + have hδ : conj δ ≠ 0 := (map_ne_zero (starRingEnd ℂ)).mpr (sub_ne_zero.mpr (Ne.symm hzw)) + rw [hq v hv] at hTv + exact ⟨v, hv, sub_eq_zero.mp ((mul_eq_zero.mp hTv).resolve_left hδ)⟩ + +theorem convex_numericalClosure (A : H →L[ℂ] H) : Convex ℝ (numericalClosure A) := + (convex_numericalRange A).closure + +end Elementary + +end HilbertCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/HilbertCrouzeix/Sharpness.lean b/lean/OAI/Analysis/HilbertCrouzeix/Sharpness.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b579c435ac3bcfc67e79fe78e63b1728e45ca51 --- /dev/null +++ b/lean/OAI/Analysis/HilbertCrouzeix/Sharpness.lean @@ -0,0 +1,103 @@ +import OAI.Analysis.HilbertCrouzeix.Compression + +namespace OAI + +noncomputable section + +open Complex Set +open scoped TensorProduct Matrix.Norms.L2Operator Classical ComplexConjugate + +namespace HilbertCrouzeix + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +def sharpOperator : CoeffSpace 2 →L[ℂ] CoeffSpace 2 := + (EuclideanSpace.proj (1 : Fin 2)).smulRight + ((2 : ℂ) • EuclideanSpace.single (0 : Fin 2) 1) + +def sharpPolynomial : Fin (1 + 1) → Coeff 1 := ![0, 1] + +theorem sharpPolynomial_apply (z : ℂ) : matrixPolynomial sharpPolynomial z = z • (1 : Coeff 1) := by + simp [matrixPolynomial, sharpPolynomial, Fin.sum_univ_two] + +theorem sharpPolynomial_norm (z : ℂ) : ‖matrixPolynomial sharpPolynomial z‖ = ‖z‖ := by + rw [sharpPolynomial_apply, norm_smul, norm_one, mul_one] + +theorem sharpOperator_apply (x : CoeffSpace 2) : + sharpOperator x = x.ofLp 1 • ((2 : ℂ) • EuclideanSpace.single (0 : Fin 2) 1) := by + simp only [sharpOperator, ContinuousLinearMap.smulRight_apply, EuclideanSpace.proj, + PiLp.proj_apply] + +theorem sharpOperator_numerical_le_one {z : ℂ} (hz : z ∈ numericalRange sharpOperator) : + ‖z‖ ≤ 1 := by + obtain ⟨x, hx, rfl⟩ := hz + have hsq : ‖x.ofLp 0‖ ^ 2 + ‖x.ofLp 1‖ ^ 2 = 1 := by + have h := EuclideanSpace.norm_sq_eq x + simpa only [hx, one_pow, Fin.sum_univ_two] using h.symm + rw [sharpOperator_apply] + rw [inner_smul_right, inner_smul_right, EuclideanSpace.inner_single_right] + simp only [norm_mul, norm_conj, one_mul] + norm_num + nlinarith [sq_nonneg (‖x.ofLp 0‖ - ‖x.ofLp 1‖)] + +theorem sharpPolynomial_sup_le_one : + normSup (numericalRange sharpOperator) (matrixPolynomial sharpPolynomial) ≤ 1 := by + rw [normSup, ite_eq_left (numericalRange_nonempty sharpOperator)] + apply csSup_le ((numericalRange_nonempty sharpOperator).image _) + rintro _ ⟨z, hz, rfl⟩ + change ‖matrixPolynomial sharpPolynomial z‖ ≤ 1 + rw [sharpPolynomial_norm] + exact sharpOperator_numerical_le_one hz + +theorem sharpPolynomial_sup_nonneg : + 0 ≤ normSup (numericalRange sharpOperator) (matrixPolynomial sharpPolynomial) := by + obtain ⟨z, hz⟩ := numericalRange_nonempty sharpOperator + have hb : BddAbove ((fun z => ‖matrixPolynomial sharpPolynomial z‖) '' + numericalRange sharpOperator) := by + refine ⟨1, ?_⟩ + rintro _ ⟨w, hw, rfl⟩ + change ‖matrixPolynomial sharpPolynomial w‖ ≤ 1 + rw [sharpPolynomial_norm] + exact sharpOperator_numerical_le_one hw + rw [normSup, ite_eq_left (numericalRange_nonempty sharpOperator)] + exact (norm_nonneg _).trans (le_csSup hb (mem_image_of_mem _ hz)) + +theorem sharpPolynomialEval_norm_ge_two : + 2 ≤ ‖polynomialEval sharpOperator sharpPolynomial‖ := by + let e : CoeffSpace 2 := EuclideanSpace.single (1 : Fin 2) 1 + let v : CoeffSpace 1 := EuclideanSpace.single (0 : Fin 1) 1 + let ξ : Amplification (CoeffSpace 2) 1 := ↑(e ⊗ₜ[ℂ] v) + have hξ : ‖ξ‖ = 1 := by + simp only [ξ, UniformSpace.Completion.norm_coe, TensorProduct.norm_tmul, + e, v, EuclideanSpace.single, PiLp.norm_single, norm_one, mul_one] + have heval : polynomialEval sharpOperator sharpPolynomial ξ = + (↑(((2 : ℂ) • EuclideanSpace.single (0 : Fin 2) (1 : ℂ)) ⊗ₜ[ℂ] v) : + Amplification (CoeffSpace 2) 1) := by + simp [polynomialEval, Fin.sum_univ_two, sharpPolynomial, ξ, tensorOp_tmul, + sharpOperator_apply, e] + have hvalue : ‖polynomialEval sharpOperator sharpPolynomial ξ‖ = 2 := by + rw [heval] + simp [UniformSpace.Completion.norm_coe, TensorProduct.norm_tmul, + norm_smul, v] + simpa only [hvalue, hξ, mul_one] using + (polynomialEval sharpOperator sharpPolynomial).le_opNorm ξ + +theorem uniformlySharp : UniformlySharp := by + intro c hc + refine ⟨2, 1, 1, by norm_num, by norm_num, sharpOperator, sharpPolynomial, ?_⟩ + apply lt_of_lt_of_le _ sharpPolynomialEval_norm_ge_two + by_cases h : 0 ≤ c + · exact lt_of_le_of_lt + (by simpa using mul_le_mul_of_nonneg_left sharpPolynomial_sup_le_one h) hc + · exact lt_of_le_of_lt + (mul_nonpos_of_nonpos_of_nonneg (le_of_not_ge h) sharpPolynomial_sup_nonneg) + (by norm_num) + + +end HilbertCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/HilbertCrouzeix/Spectrum.lean b/lean/OAI/Analysis/HilbertCrouzeix/Spectrum.lean new file mode 100644 index 0000000000000000000000000000000000000000..0dd7efba365d8944dcf949f2c46706ece8e7a828 --- /dev/null +++ b/lean/OAI/Analysis/HilbertCrouzeix/Spectrum.lean @@ -0,0 +1,100 @@ +import OAI.Analysis.HilbertCrouzeix.NumericalRange + +namespace OAI + +noncomputable section + +open Complex Set +open scoped TensorProduct Matrix.Norms.L2Operator Classical ComplexConjugate + +namespace HilbertCrouzeix + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +section Elementary +omit [CompleteSpace H] + +theorem lowerBound_of_unit_inner (T : H →L[ℂ] H) {δ : ℝ} + (h : ∀ x : H, ‖x‖ = 1 → δ ≤ ‖inner ℂ x (T x)‖) (x : H) : + δ * ‖x‖ ≤ ‖T x‖ := by + by_cases hx : x = 0 + · simp [hx] + have hn : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx + let y : H := (‖x‖ : ℂ)⁻¹ • x + have hy : ‖y‖ = 1 := norm_smul_inv_norm hx + have hl : δ ≤ ‖T y‖ := calc + δ ≤ ‖inner ℂ y (T y)‖ := h y hy + _ ≤ ‖y‖ * ‖T y‖ := norm_inner_le_norm _ _ + _ = ‖T y‖ := by rw [hy, one_mul] + calc + δ * ‖x‖ ≤ ‖T y‖ * ‖x‖ := mul_le_mul_of_nonneg_right hl (norm_nonneg x) + _ = ‖T x‖ := by + simp only [y, map_smul, norm_smul, norm_inv, Complex.norm_real, Real.norm_eq_abs, + abs_norm] + field_simp + +theorem antilipschitz_of_lowerBound (T : H →L[ℂ] H) {δ : ℝ} (hδ : 0 < δ) + (h : ∀ x : H, δ * ‖x‖ ≤ ‖T x‖) : + AntilipschitzWith ⟨δ⁻¹, inv_nonneg.mpr hδ.le⟩ T := by + apply AntilipschitzWith.of_le_mul_dist + intro x y + simp only [dist_eq_norm] + change ‖x - y‖ ≤ δ⁻¹ * ‖T x - T y‖ + rw [← map_sub, inv_mul_eq_div] + exact (le_div_iff₀ hδ).mpr (by simpa only [mul_comm] using h (x - y)) + +end Elementary + +theorem isUnit_of_unit_inner (T : H →L[ℂ] H) {δ : ℝ} (hδ : 0 < δ) + (h : ∀ x : H, ‖x‖ = 1 → δ ≤ ‖inner ℂ x (T x)‖) : IsUnit T := by + have hl := antilipschitz_of_lowerBound T hδ (lowerBound_of_unit_inner T h) + have hadj : ∀ x : H, ‖x‖ = 1 → δ ≤ ‖inner ℂ x (T.adjoint x)‖ := by + intro x hx + rw [ContinuousLinearMap.adjoint_inner_right, norm_inner_symm] + exact h x hx + have hla := antilipschitz_of_lowerBound T.adjoint hδ + (lowerBound_of_unit_inner T.adjoint hadj) + have hc : IsClosed (T.toLinearMap.range : Set H) := hl.isClosed_range T.uniformContinuous + have hbot : T.toLinearMap.rangeᗮ = ⊥ := by + rw [T.orthogonal_range] + exact LinearMap.ker_eq_bot.mpr hla.injective + have htop : T.toLinearMap.range = ⊤ := by + rw [← hc.submodule_topologicalClosure_eq] + exact Submodule.topologicalClosure_eq_top_iff.mpr hbot + exact ContinuousLinearMap.isUnit_iff_bijective.mpr + ⟨hl.injective, LinearMap.range_eq_top.mp htop⟩ + +theorem spectrum_subset_numericalClosure (A : H →L[ℂ] H) : + spectrum ℂ A ⊆ numericalClosure A := by + intro z hz + by_contra hnot + obtain ⟨δ, hδ, hb⟩ := Metric.isOpen_iff.mp + (isClosed_closure.isOpen_compl) z hnot + have hdist : ∀ w ∈ numericalRange A, δ ≤ ‖z - w‖ := by + intro w hw + by_contra! hlt + have hw' : w ∈ Metric.ball z δ := by + simpa only [Metric.mem_ball, dist_eq_norm, norm_sub_rev] using hlt + exact hb hw' (subset_closure hw) + have hu : IsUnit ((algebraMap ℂ (H →L[ℂ] H)) z - A) := by + apply isUnit_of_unit_inner _ hδ + intro x hx + simpa only [sub_apply, ContinuousLinearMap.algebraMap_apply, + inner_sub_right, inner_smul_right, inner_self_eq_norm_sq_to_K, hx, + RCLike.ofReal_one, one_pow, mul_one] using + hdist (inner ℂ x (A x)) ⟨x, hx, rfl⟩ + exact spectrum.mem_iff.mp hz hu + +theorem numericalClosure_geometry (A : H →L[ℂ] H) : + IsCompact (numericalClosure A) ∧ Convex ℝ (numericalClosure A) ∧ + spectrum ℂ A ⊆ numericalClosure A := + ⟨isCompact_numericalClosure A, convex_numericalClosure A, spectrum_subset_numericalClosure A⟩ + + +end HilbertCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Basic.lean b/lean/OAI/Analysis/HotSpots/Basic.lean new file mode 100644 index 0000000000000000000000000000000000000000..aba8d410e83c056e59feb0f2c91dc3a33732a983 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Basic.lean @@ -0,0 +1,72 @@ +import Mathlib + +namespace OAI + + + + + + + +noncomputable section +open Set MeasureTheory +open scoped ContDiff + +namespace StrictHotSpots + +abbrev Plane := EuclideanSpace ℝ (Fin 2) + + +def SmoothBoundary (Ω : Set Plane) : Prop := + ∀ p ∈ frontier Ω, ∃ (U : Set Plane) (ρ : Plane → ℝ), + IsOpen U ∧ p ∈ U ∧ ContDiffOn ℝ ∞ ρ U ∧ + fderiv ℝ ρ p ≠ 0 ∧ ρ p = 0 ∧ + Ω ∩ U = {x | ρ x < 0} ∩ U + + +def AdmissibleDomain (Ω : Set Plane) : Prop := + Ω.Nonempty ∧ IsOpen Ω ∧ Bornology.IsBounded Ω ∧ + IsSimplyConnected Ω ∧ SmoothBoundary Ω + + + +def HasH1Gradient (Ω : Set Plane) (v : Plane → ℝ) (g : Plane → Plane) : Prop := + MemLp v 2 (volume.restrict Ω) ∧ MemLp g 2 (volume.restrict Ω) ∧ + ∀ φ : Plane → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ Ω → + ∀ e : Plane, + (∫ x in Ω, v x * (fderiv ℝ φ x) e) = + -(∫ x in Ω, (inner ℝ (g x) e) * φ x) + + + +def rayleighValues (Ω : Set Plane) : Set ℝ := + {r | ∃ (v : Plane → ℝ) (g : Plane → Plane), + HasH1Gradient Ω v g ∧ (∫ x in Ω, v x) = 0 ∧ + 0 < (∫ x in Ω, (v x) ^ 2) ∧ + r = (∫ x in Ω, ‖g x‖ ^ 2) / (∫ x in Ω, (v x) ^ 2)} + +def firstPositiveNeumannValue (Ω : Set Plane) : ℝ := sInf (rayleighValues Ω) + + + + +def InFirstNeumannEigenspace (Ω : Set Plane) (u : Plane → ℝ) : Prop := + ContDiffOn ℝ ∞ u (closure Ω) ∧ HasH1Gradient Ω u (gradient u) ∧ + (∫ x in Ω, u x) = 0 ∧ + ∀ (v : Plane → ℝ) (g : Plane → Plane), HasH1Gradient Ω v g → + (∫ x in Ω, inner ℝ (gradient u x) (g x)) = + firstPositiveNeumannValue Ω * (∫ x in Ω, u x * v x) + + + +def MainConclusion (Ω : Set Plane) (u : Plane → ℝ) : Prop := + (∀ x ∈ Ω, gradient u x ≠ 0) ∧ + ∀ x ∈ Ω, sInf (u '' frontier Ω) < u x ∧ u x < sSup (u '' frontier Ω) + +end StrictHotSpots +end + + + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/BoundaryEnergy.lean b/lean/OAI/Analysis/HotSpots/BoundaryEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..907acbee004250815b9371fb179a78a9cd6316b7 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/BoundaryEnergy.lean @@ -0,0 +1,1366 @@ +import OAI.Analysis.HotSpots.DouglasEnergy +import OAI.Analysis.HotSpots.KernelLimit + +namespace OAI + +section LipschitzBoundaryScalarSupport + +noncomputable section + +section SubcriticalEnergyScalarSupportLayer +open Set MeasureTheory +open scoped InnerProductSpace ENNReal +namespace StrictHotSpots.SubcriticalExtension + +lemma energy_cancel {G H : Type*} [NormedAddCommGroup G] [InnerProductSpace ℝ G] + [NormedAddCommGroup H] [InnerProductSpace ℝ H] + (a b c q : G) (x z r : H) + (ha : inner ℝ a q = inner ℝ a b) (hc : inner ℝ c q = inner ℝ z r) : + inner ℝ (a+c) q - inner ℝ (x+z) r = inner ℝ a b - inner ℝ x r := by + rw [inner_add_left,inner_add_left,ha,hc] + ring + +variable {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict Ω) +local instance : NormedSpace ℝ (H10 ho) := (H10.innerProductSpace ho).toNormedSpace +local instance : NormedSpace ℝ (H1 Ω) := (h1Graph Ω).normedSpace + + + +lemma extension_energy (hT : ‖H10.greenOperator ho hb hC hν‖ < 1) + (A B : H1 Ω) (hA : Harmonic ho A) (hB : Harmonic ho B) : + inner ℝ (H1.grad (extension ho hb hC hν A)) (H1.grad (extension ho hb hC hν B)) - + inner ℝ (observe hC hν (extension ho hb hC hν A)) + (observe hC hν (extension ho hb hC hν B)) = + inner ℝ (H1.grad A) (H1.grad B) - + inner ℝ (observe hC hν A) + (BanachResolvent.resolvent (H10.greenOperator ho hb hC hν) (observe hC hν B)) := by + let a := solve ho hb hC hν + (BanachResolvent.resolvent (H10.greenOperator ho hb hC hν) (observe hC hν A)) + let b := solve ho hb hC hν + (BanachResolvent.resolvent (H10.greenOperator ho hb hC hν) (observe hC hν B)) + have hgA : H1.grad (extension ho hb hC hν A) = H1.grad A + H10.grad ho a := + extension_grad ho hb hC hν A + have hoA : observe hC hν (extension ho hb hC hν A) = observe hC hν A + H10.weightedValue ho hC hν a := + observe_add_coe ho hC hν A a + have hga : inner ℝ (H1.grad A) (H1.grad (extension ho hb hC hν B)) = + inner ℝ (H1.grad A) (H1.grad B) := by + have hgB : H1.grad (extension ho hb hC hν B) = H1.grad B + H10.grad ho b := + extension_grad ho hb hC hν B + calc + _ = inner ℝ (H1.grad A) (H1.grad B + H10.grad ho b) := + congrArg (fun z : Lp Plane 2 (volume.restrict Ω) => inner ℝ (H1.grad A) z) hgB + _ = inner ℝ (H1.grad A) (H1.grad B) + inner ℝ (H1.grad A) (H10.grad ho b) := + inner_add_right _ _ _ + _ = inner ℝ (H1.grad A) (H1.grad B) + 0 := + congrArg (fun r : ℝ => inner ℝ (H1.grad A) (H1.grad B) + r) (hA b) + _ = _ := add_zero _ + have hgc : inner ℝ (H10.grad ho a) (H1.grad (extension ho hb hC hν B)) = + inner ℝ (H10.weightedValue ho hC hν a) (observe hC hν (extension ho hb hC hν B)) := + (real_inner_comm _ _).trans ((extension_weak ho hb hC hν hT B hB a).trans (real_inner_comm _ _)) + have hq := extension_observe ho hb hC hν hT B + calc + _ = inner ℝ (H1.grad A + H10.grad ho a) (H1.grad (extension ho hb hC hν B)) - + inner ℝ (observe hC hν A + H10.weightedValue ho hC hν a) + (observe hC hν (extension ho hb hC hν B)) := + congrArg₂ (fun (g : Lp Plane 2 (volume.restrict Ω)) (v : Lp ℝ 2 ν) => + inner ℝ g (H1.grad (extension ho hb hC hν B)) - + inner ℝ v (observe hC hν (extension ho hb hC hν B))) hgA hoA + _ = inner ℝ (H1.grad A) (H1.grad B) - + inner ℝ (observe hC hν A) (observe hC hν (extension ho hb hC hν B)) := + energy_cancel _ _ _ _ _ _ _ hga hgc + _ = _ := congrArg (fun v : Lp ℝ 2 ν => inner ℝ (H1.grad A) (H1.grad B) - + inner ℝ (observe hC hν A) v) hq +end StrictHotSpots.SubcriticalExtension +end SubcriticalEnergyScalarSupportLayer + +section SubcriticalUniquenessScalarSupportLayer + +open Set MeasureTheory +open scoped InnerProductSpace ENNReal +namespace StrictHotSpots.SubcriticalExtension +variable {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict Ω) +local instance : NormedSpace ℝ (H10 ho) := (H10.innerProductSpace ho).toNormedSpace +local instance : NormedSpace ℝ (H1 Ω) := (h1Graph Ω).normedSpace + + +def WeakPotential (F : H1 Ω) : Prop := ∀ v : H10 ho, + inner ℝ (H1.grad F) (H10.grad ho v) = + inner ℝ (observe hC hν F) (H10.weightedValue ho hC hν v) + +lemma weakPotential_sub {F G : H1 Ω} + (hF : WeakPotential ho hC hν F) (hG : WeakPotential ho hC hν G) : + WeakPotential ho hC hν (F-G) := by + intro v + have hg := H1.grad.map_sub F G + have hh := (observe hC hν).map_sub F G + calc + _ = inner ℝ (H1.grad F-H1.grad G) (H10.grad ho v) := + congrArg (fun z : Lp Plane 2 (volume.restrict Ω) => inner ℝ z (H10.grad ho v)) hg + _ = inner ℝ (H1.grad F) (H10.grad ho v)-inner ℝ (H1.grad G) (H10.grad ho v) := + inner_sub_left _ _ _ + _ = inner ℝ (observe hC hν F) (H10.weightedValue ho hC hν v) - + inner ℝ (observe hC hν G) (H10.weightedValue ho hC hν v) := + congrArg₂ (fun a b : ℝ => a-b) (hF v) (hG v) + _ = inner ℝ (observe hC hν F-observe hC hν G) (H10.weightedValue ho hC hν v) := + (inner_sub_left _ _ _).symm + _ = _ := congrArg (fun z : Lp ℝ 2 ν => inner ℝ z (H10.weightedValue ho hC hν v)) hh.symm + +include hb in +lemma weakPotential_zero_class {d : ℝ} (hd : d < 1) + (hsub : ∀ v : H10 ho, ‖H10.weightedValue ho hC hν v‖^2 ≤ d*‖H10.grad ho v‖^2) + {F : H1 Ω} (hF : WeakPotential ho hC hν F) (h0 : ∃ v : H10 ho, F = v.val) : F = 0 := by + obtain ⟨v,rfl⟩ := h0 + have he := hF v + change inner ℝ (H10.grad ho v) (H10.grad ho v) = + inner ℝ (H10.weightedValue ho hC hν v) (H10.weightedValue ho hC hν v) at he + simp only [real_inner_self_eq_norm_sq] at he + have hz : ‖H10.grad ho v‖^2 = 0 := by nlinarith [hsub v,sq_nonneg ‖H10.grad ho v‖] + exact congrArg (fun v : H10 ho => v.val) (h10_eq_zero_of_grad_norm_sq ho hb v hz) + +lemma extension_difference (A : H1 Ω) : + ∃ v : H10 ho, extension ho hb hC hν A-A = v.val := by + refine ⟨solve ho hb hC hν + (BanachResolvent.resolvent (H10.greenOperator ho hb hC hν) (observe hC hν A)), ?_⟩ + change A+_-A = _ + abel + +include hb in +lemma weakPotential_unique {d : ℝ} (hd : d < 1) + (hsub : ∀ v : H10 ho, ‖H10.weightedValue ho hC hν v‖^2 ≤ d*‖H10.grad ho v‖^2) + {A F G : H1 Ω} (hF : WeakPotential ho hC hν F) (hG : WeakPotential ho hC hν G) + (hFA : ∃ v : H10 ho, F-A = v.val) (hGA : ∃ v : H10 ho, G-A = v.val) : F = G := by + apply sub_eq_zero.mp + apply weakPotential_zero_class ho hb hC hν hd hsub + (weakPotential_sub ho hC hν hF hG) + obtain ⟨v,hv⟩ := hFA + obtain ⟨w,hw⟩ := hGA + refine ⟨v-w,?_⟩ + change F-G=v.val-w.val + calc + _ = (F-A)-(G-A) := by abel + _ = _ := congrArg₂ (fun x y : H1 Ω => x-y) hv hw + +include hb in + + +theorem existsUnique_weakPotential {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ v : H10 ho, ‖H10.weightedValue ho hC hν v‖^2 ≤ d*‖H10.grad ho v‖^2) + (F : H1 Ω) : ∃! W : H1 Ω, WeakPotential ho hC hν W ∧ + ∃ v : H10 ho, W-F = v.val := by + let A := harmonicLift ho hb F + let W := extension ho hb hC hν A + have hT : ‖H10.greenOperator ho hb hC hν‖ < 1 := + (H10.greenOperator_norm_le ho hb hC hν hd0 hsub).trans_lt hd1 + have hW : WeakPotential ho hC hν W := + extension_weak ho hb hC hν hT A (harmonicLift_harmonic ho hb F) + have hWF : ∃ v : H10 ho, W-F=v.val := by + obtain ⟨v,hv⟩ := extension_difference ho hb hC hν A + obtain ⟨w,hw⟩ := harmonicLift_difference ho hb F + refine ⟨v+w,?_⟩ + change W-F=v.val+w.val + calc + _ = (W-A)+(A-F) := by abel + _ = _ := congrArg₂ (fun x y : H1 Ω => x+y) hv hw + refine ⟨W,⟨hW,hWF⟩,?_⟩ + intro G hG + exact weakPotential_unique ho hb hC hν hd1 hsub hG.1 hW hG.2 hWF + +end StrictHotSpots.SubcriticalExtension +end SubcriticalUniquenessScalarSupportLayer + +section BoundaryMeasureScalarSupportLayer + +section BoundaryMeasureLayer +noncomputable section +open MeasureTheory Set Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 + +local instance twoPiPos : Fact (0 < 2 * Real.pi) := ⟨Real.two_pi_pos⟩ + +def circleBoundary : Circle ≃ₜ Boundary where + toFun s := ⟨complexIso (s : ℂ), by simp⟩ + invFun s := ⟨complexIso.symm (s : Plane), by change dist (complexIso.symm (s : Plane)) 0 = 1; simpa using s.property⟩ + left_inv s := by ext; simp + right_inv s := by ext; simp + continuous_toFun := by fun_prop + continuous_invFun := by fun_prop + +def angleBoundary : AddCircle (2 * Real.pi) ≃ₜ Boundary := + AddCircle.homeomorphCircle'.trans circleBoundary + + +def boundaryMeasure : Measure Boundary := Measure.map angleBoundary volume + +instance boundaryMeasure_finite : IsFiniteMeasure boundaryMeasure := by + unfold boundaryMeasure + infer_instance + +instance boundaryMeasure_nullSingleton : NullSingletonClass boundaryMeasure := by + constructor + intro s + rw [boundaryMeasure, Measure.map_apply angleBoundary.continuous.measurable (measurableSet_singleton s)] + rw [show angleBoundary ⁻¹' {s} = {angleBoundary.symm s} by ext x; exact angleBoundary.toEquiv.eq_symm_apply.symm] + simpa only [closedBall_zero, mul_zero, min_eq_right Real.two_pi_pos.le, ENNReal.ofReal_zero] using + (AddCircle.volume_closedBall (2 * Real.pi) (x := angleBoundary.symm s) 0) + +instance boundaryMeasure_openPos : boundaryMeasure.IsOpenPosMeasure := + angleBoundary.continuous.isOpenPosMeasure_map angleBoundary.surjective + +lemma boundaryMeasure_univ : boundaryMeasure univ = ENNReal.ofReal (2 * Real.pi) := by + rw [boundaryMeasure, Measure.map_apply angleBoundary.continuous.measurable MeasurableSet.univ] + simp + +lemma boundaryMeasure_real : boundaryMeasure.real univ = 2 * Real.pi := by + rw [Measure.real, boundaryMeasure_univ, ENNReal.toReal_ofReal Real.two_pi_pos.le] + +lemma integral_boundary_angles {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (f : Boundary → E) : + ∫ s, f s ∂boundaryMeasure = ∫ θ in 0..2*Real.pi, + f (circleBoundary (Circle.exp θ)) := by + change ∫ s, f s ∂Measure.map angleBoundary.toMeasurableEquiv volume = _ + rw [integral_map_equiv] + change (∫ x : AddCircle (2 * Real.pi), f (angleBoundary x)) = _ + rw [← AddCircle.intervalIntegral_preimage (2 * Real.pi) 0 (fun s => f (angleBoundary s))] + simp only [zero_add] + rfl + +lemma poisson_eq_standard (s : Boundary) (x : Plane) : + poisson s x = (2*Real.pi)⁻¹ * + _root_.poissonKernel 0 (complexIso.symm x) (complexIso.symm (s : Plane)) := by + simp only [poisson, DiskFormula.poisson, _root_.poissonKernel_def, sub_zero, + LinearIsometryEquiv.norm_map, s.property, one_pow] + ring + +lemma integral_poisson (x : disk) : ∫ s, poisson s x ∂boundaryMeasure = 1 := by + have hx : complexIso.symm (x : Plane) ∈ ball (0:ℂ) 1 := by + simpa [disk, mem_ball_zero_iff] using x.property + have hc : InnerProductSpace.HarmonicOnNhd (fun _ : ℂ => (1:ℝ)) (closedBall 0 1) := by + intro z _ + exact InnerProductSpace.harmonicAt_const (1:ℝ) + have he := hc.circleAverage_poissonKernel_smul hx + rw [integral_boundary_angles] + simp_rw [poisson_eq_standard] + rw [intervalIntegral.integral_const_mul] + convert he using 1 + unfold Real.circleAverage + congr 2 + funext θ + change poissonKernel 0 (complexIso.symm (x : Plane)) + (complexIso.symm (complexIso (Circle.exp θ : ℂ))) = + (poissonKernel 0 (complexIso.symm (x : Plane)) • (fun _ : ℂ => (1 : ℝ))) + (circleMap 0 1 θ) + simp [circleMap, Circle.coe_exp] + +end StrictHotSpots.PlaneGreen +end +end BoundaryMeasureLayer +end BoundaryMeasureScalarSupportLayer + +section BoundaryMeasurabilityScalarSupportLayer + +section BoundaryMeasurabilityLayer +noncomputable section +open MeasureTheory Filter Set Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 + +lemma poisson_continuous_boundary (x : disk) : Continuous (fun s : Boundary => poisson s x) := by + have hn (s : Boundary) : complexIso.symm (s : Plane) - complexIso.symm (x : Plane) ≠ 0 := by + intro he + have hx : ‖(x : Plane)‖ < 1 := by simpa [disk] using x.property + have he' := complexIso.symm.injective (sub_eq_zero.mp he) + rw [← he', s.property] at hx + exact (lt_irrefl _ hx) + unfold poisson DiskFormula.poisson + apply Continuous.div continuous_const + · fun_prop + · intro s + exact mul_ne_zero (mul_ne_zero (by norm_num) Real.pi_ne_zero) + (pow_ne_zero 2 (norm_ne_zero_iff.mpr (hn s))) + +lemma poisson_joint_measurable : Measurable (fun z : Boundary × Plane => poisson z.1 z.2) := by + unfold poisson DiskFormula.poisson + fun_prop + +variable {ν : Measure Plane} [IsFiniteMeasure ν] {R : ℝ} + (hR : ∀ᵐ x ∂ν, ‖x‖ ≤ R) (hR1 : R < 1) + +lemma poissonRow_continuous : Continuous (poissonRow hR hR1) := by + rw [continuous_iff_continuousAt] + intro s + apply L2Limits.tendsto_toLp_of_dominated + (hb := memLp_const (1 / (2 * Real.pi * (1-R)^2))) + · apply Eventually.of_forall + intro t + filter_upwards [hR] with x hx + change ‖DiskFormula.poisson (complexIso.symm (t : Plane)) (complexIso.symm x)‖ ≤ _ + rw [Real.norm_eq_abs, abs_of_nonneg + (DiskFormula.poisson_nonneg _ _ (by simpa using hx.trans_lt hR1))] + exact DiskFormula.poisson_bounded _ _ (by simpa using t.property) (by simpa using hx) hR1 + · filter_upwards [hR] with x hx + exact (poisson_continuous_boundary ⟨x, by simpa [disk] using hx.trans_lt hR1⟩).continuousAt + +variable {C : ℝ≥0∞} (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +lemma smoothedRow_stronglyMeasurable : StronglyMeasurable (smoothedRow hC hν) := by + apply stronglyMeasurable_of_tendsto atTop + (f := fun n s => L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) + (cutoffSmoothedRow hC hν n s)) + · intro n + have he : (fun s => L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) + (cutoffSmoothedRow hC hν n s)) = + fun s => L2Cutoff.extension (cutoffSet n) (cutoffSet_measurable n) + (weightedIntegralOperator hC (restrictDensity hν (cutoffSet n)) + (poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s)) := by + funext s + rw [compactSmoothedRow_eq] + rfl + rw [he] + apply Continuous.stronglyMeasurable + exact (L2Cutoff.extension (cutoffSet n) (cutoffSet_measurable n)).continuous.comp + ((weightedIntegralOperator hC (restrictDensity hν (cutoffSet n))).continuous.comp + (poissonRow_continuous (cutoff_ae_norm n) (cutoffRadius_lt_one n))) + · exact tendsto_pi_nhds.mpr (extendedSmoothedRow_tendsto hC hν) + +lemma smoothedPoisson_joint_measurable : + Measurable (fun z : Boundary × Plane => smoothedPoisson (ν := ν) z.1 z.2) := by + have h1 : Measurable (fun z : (Boundary × Plane) × Plane => (z.1.2,z.2)) := + measurable_fst.snd.prodMk measurable_snd + have h2 : Measurable (fun z : (Boundary × Plane) × Plane => (z.1.1,z.2)) := + measurable_fst.fst.prodMk measurable_snd + have hk := measurable_kernel.comp h1 + have hp := poisson_joint_measurable.comp h2 + dsimp only [Function.comp_def] at hk hp + have hm := hk.mul hp + change Measurable (fun z : Boundary × Plane => + ∫ y, kernel z.2 y * poisson z.1 y ∂ν) + have hh : StronglyMeasurable (fun z : Boundary × Plane => + ∫ y, kernel z.2 y * poisson z.1 y ∂ν) := + hm.stronglyMeasurable.integral_prod_right' (ν := ν) + exact hh.measurable + +lemma fullBoundaryK_measurable (p : disk) : Measurable (fullBoundaryK hC hν p) := by + unfold fullBoundaryK + apply Measurable.add + · have hm : Measurable (fun s : Boundary => (s,(p : Plane))) := + measurable_id.prodMk measurable_const + have hf := (smoothedPoisson_joint_measurable (ν := ν)).comp hm + dsimp only [Function.comp_def] at hf + exact (poisson_continuous_boundary p).measurable.add hf + · have hsm : StronglyMeasurable (fun s => BanachResolvent.resolvent + (weightedIntegralOperator hC hν) (smoothedRow hC hν s)) := + (BanachResolvent.resolvent (weightedIntegralOperator hC hν)).continuous.comp_stronglyMeasurable + (smoothedRow_stronglyMeasurable hC hν) + exact (stronglyMeasurable_const.inner hsm).measurable + +lemma boundaryInteraction_measurable : + Measurable (fun z : Boundary × Boundary => boundaryInteraction z.1 z.2) := by + unfold boundaryInteraction DiskFormula.boundaryInteraction + fun_prop + +lemma fullBoundaryN_measurable : + Measurable (fun z : Boundary × Boundary => fullBoundaryN hC hν z.1 z.2) := by + have hm1 : Measurable (fun z : (Boundary × Boundary) × Plane => (z.1.1,z.2)) := + measurable_fst.fst.prodMk measurable_snd + have hm2 : Measurable (fun z : (Boundary × Boundary) × Plane => (z.1.2,z.2)) := + measurable_fst.snd.prodMk measurable_snd + have hp1 := poisson_joint_measurable.comp hm1 + have hp2 := poisson_joint_measurable.comp hm2 + have hs2 := (smoothedPoisson_joint_measurable (ν := ν)).comp hm2 + dsimp only [Function.comp_def] at hp1 hp2 hs2 + have hp := hp1.mul hp2 + have hs := hp1.mul hs2 + have h1 := (smoothedRow_stronglyMeasurable hC hν).comp_measurable + (measurable_fst : Measurable (Prod.fst : Boundary × Boundary → Boundary)) + have h2 := (smoothedRow_stronglyMeasurable hC hν).comp_measurable + (measurable_snd : Measurable (Prod.snd : Boundary × Boundary → Boundary)) + have hi : StronglyMeasurable (fun z : Boundary × Boundary => + inner ℝ (smoothedRow hC hν z.1) (BanachResolvent.resolvent + (weightedIntegralOperator hC hν) (smoothedRow hC hν z.2))) := + h1.inner ((BanachResolvent.resolvent (weightedIntegralOperator hC hν)).continuous.comp_stronglyMeasurable h2) + exact ((boundaryInteraction_measurable.add (hp.stronglyMeasurable.integral_prod_right' (ν := ν)).measurable).add + (hs.stronglyMeasurable.integral_prod_right' (ν := ν)).measurable).add hi.measurable + +end StrictHotSpots.PlaneGreen +end +end BoundaryMeasurabilityLayer +end BoundaryMeasurabilityScalarSupportLayer + +section BoundaryPoissonIntegralsScalarSupportLayer + +section BoundaryPoissonIntegralsLayer +noncomputable section +open MeasureTheory Filter Set Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 + +instance boundary_compactSpace : CompactSpace Boundary := circleBoundary.compactSpace + +lemma poisson_boundary_integrable (x : disk) : + Integrable (fun s : Boundary => poisson s x) boundaryMeasure := + (poisson_continuous_boundary x).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +include hC hν in +lemma poisson_integrable_weighted (s : Boundary) : Integrable (poisson s) ν := + (poisson_memLp_three_halves_weighted hC hν s).integrable (by + apply (ENNReal.le_div_iff_mul_le (by norm_num) (by norm_num)).2 + norm_num) + +include hC hν in +lemma poisson_product_boundary_integrable (s : Boundary) : + Integrable (fun z : Boundary × Plane => poisson s z.2 * poisson z.1 z.2) + (boundaryMeasure.prod ν) := by + have hs : Measurable (fun z : Boundary × Plane => poisson s z.2) := + (poisson_measurable s).comp measurable_snd + have hm := hs.mul poisson_joint_measurable + apply (integrable_prod_iff' hm.aestronglyMeasurable).2 + constructor + · filter_upwards [ae_mem_disk hν] with x hx + exact (poisson_boundary_integrable ⟨x,hx⟩).const_mul (poisson s x) + · apply (poisson_integrable_weighted hC hν s).congr + filter_upwards [ae_mem_disk hν] with x hx + change poisson s x = ∫ t, ‖poisson s x * poisson t x‖ ∂boundaryMeasure + rw [integral_congr_ae (Eventually.of_forall (fun t : Boundary => + Real.norm_of_nonneg (mul_nonneg (poisson_nonneg s ⟨x,hx⟩) (poisson_nonneg t ⟨x,hx⟩))))] + rw [integral_const_mul, integral_poisson ⟨x,hx⟩, mul_one] + +include hC hν in +lemma firstInteraction_integrable (s : Boundary) : + Integrable (fun t : Boundary => ∫ x, poisson s x * poisson t x ∂ν) boundaryMeasure := + (poisson_product_boundary_integrable hC hν s).integral_prod_left + +include hC hν in +lemma integral_firstInteraction (s : Boundary) : + (∫ t, ∫ x, poisson s x * poisson t x ∂ν ∂boundaryMeasure) = ∫ x, poisson s x ∂ν := by + rw [integral_integral_swap (poisson_product_boundary_integrable hC hν s)] + apply integral_congr_ae + filter_upwards [ae_mem_disk hν] with x hx + rw [integral_const_mul, integral_poisson ⟨x,hx⟩, mul_one] + + +def poissonExtension {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (f : Boundary → E) (x : Plane) : E := ∫ s, poisson s x • f s ∂boundaryMeasure + +lemma poissonExtension_norm_le {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + {f : Boundary → E} {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) (x : disk) : + ‖poissonExtension f x‖ ≤ B := by + unfold poissonExtension + apply (norm_integral_le_integral_norm _).trans + calc + _ ≤ ∫ s, poisson s x * B ∂boundaryMeasure := by + apply integral_mono_of_nonneg + · exact Eventually.of_forall fun _ => norm_nonneg _ + · exact (poisson_boundary_integrable x).mul_const B + · filter_upwards [] with s + rw [norm_smul, Real.norm_of_nonneg (poisson_nonneg s x)] + exact mul_le_mul_of_nonneg_left (hB s) (poisson_nonneg s x) + _ = B := by rw [integral_mul_const, integral_poisson, one_mul] + +end StrictHotSpots.PlaneGreen +end +end BoundaryPoissonIntegralsLayer +end BoundaryPoissonIntegralsScalarSupportLayer + +section BochnerL2RowsScalarSupportLayer + +open MeasureTheory Filter Set +open scoped ENNReal InnerProductSpace +namespace StrictHotSpots.L2Rows + +variable {A B : Type*} [MeasurableSpace A] [MeasurableSpace B] + {μ : Measure A} {ν : Measure B} [IsFiniteMeasure μ] [IsFiniteMeasure ν] + + +lemma integral_eq_toLp {r : A → B → ℝ} {R : A → Lp ℝ 2 ν} + (hR : Integrable R μ) (hr : ∀ a, R a =ᵐ[ν] r a) + (havg : MemLp (fun x => ∫ a, r a x ∂μ) 2 ν) + (hpair : ∀ g : Lp ℝ 2 ν, Integrable (fun z : A × B => g z.2 * r z.1 z.2) (μ.prod ν)) : + (∫ a, R a ∂μ) = havg.toLp (fun x => ∫ a, r a x ∂μ) := by + apply ext_inner_left ℝ + intro g + rw [← integral_inner hR g, L2.inner_def] + calc + (∫ a, inner ℝ g (R a) ∂μ) = ∫ a, ∫ x, g x * r a x ∂ν ∂μ := by + apply integral_congr_ae + filter_upwards [] with a + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hr a] with x hx + simp only [hx, Real.inner_apply] + _ = ∫ x, ∫ a, g x * r a x ∂μ ∂ν := integral_integral_swap (hpair g) + _ = ∫ x, inner ℝ (g x) ((havg.toLp (fun x => ∫ a, r a x ∂μ)) x) ∂ν := by + apply integral_congr_ae + filter_upwards [havg.coeFn_toLp] with x hx + rw [hx, integral_const_mul] + exact (Real.inner_apply _ _).symm + +lemma average_memLp {r : A → B → ℝ} + (hm : Measurable (fun z : A × B => r z.1 z.2)) {M : ℝ} + (hM : ∀ᵐ z ∂μ.prod ν, ‖r z.1 z.2‖ ≤ M) : + MemLp (fun x => ∫ a, r a x ∂μ) 2 ν := by + have hh : StronglyMeasurable (fun x => ∫ a, r a x ∂μ) := + hm.stronglyMeasurable.integral_prod_left' + apply MemLp.of_bound hh.aestronglyMeasurable (M * μ.real univ) + have hb := (Measure.ae_ae_comm (p := fun a x => ‖r a x‖ ≤ M) + (measurableSet_le hm.norm measurable_const)).mp + (Measure.ae_ae_of_ae_prod hM) + filter_upwards [hb] with x hx + exact norm_integral_le_of_norm_le_const hx + +lemma integrable_pair_of_bound {r : A → B → ℝ} + (hm : Measurable (fun z : A × B => r z.1 z.2)) {M : ℝ} + (hM : ∀ᵐ z ∂μ.prod ν, ‖r z.1 z.2‖ ≤ M) (g : Lp ℝ 2 ν) : + Integrable (fun z : A × B => g z.2 * r z.1 z.2) (μ.prod ν) := by + have hg : Integrable (fun z : A × B => ‖g z.2‖ * M) (μ.prod ν) := + ((Lp.memLp g).integrable (by norm_num)).norm.comp_snd μ |>.mul_const M + apply hg.mono' ((Lp.memLp g).aestronglyMeasurable.comp_snd.mul hm.aestronglyMeasurable) + filter_upwards [hM] with z hz + change ‖g z.2 * r z.1 z.2‖ ≤ _ + rw [norm_mul] + exact mul_le_mul_of_nonneg_left hz (norm_nonneg _) + +lemma integral_eq_toLp_of_bound {r : A → B → ℝ} {R : A → Lp ℝ 2 ν} + (hR : Integrable R μ) (hr : ∀ a, R a =ᵐ[ν] r a) + (hm : Measurable (fun z : A × B => r z.1 z.2)) {M : ℝ} + (hM : ∀ᵐ z ∂μ.prod ν, ‖r z.1 z.2‖ ≤ M) : + (∫ a, R a ∂μ) = (average_memLp hm hM).toLp (fun x => ∫ a, r a x ∂μ) := + integral_eq_toLp hR hr (average_memLp hm hM) (integrable_pair_of_bound hm hM) + +end StrictHotSpots.L2Rows +end BochnerL2RowsScalarSupportLayer + +section BoundaryExtensionScalarSupportLayer + +open MeasureTheory Filter Set Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +lemma poissonExtension_measurable {f : Boundary → ℝ} (hf : Measurable f) : + Measurable (poissonExtension f) := by + have hm : Measurable (fun z : Boundary × Plane => poisson z.1 z.2 * f z.1) := + poisson_joint_measurable.mul (hf.comp measurable_fst) + exact hm.stronglyMeasurable.integral_prod_left'.measurable + +include hν in +lemma poissonExtension_memLp {f : Boundary → ℝ} (hf : Measurable f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : MemLp (poissonExtension f) 2 ν := by + apply MemLp.of_bound (poissonExtension_measurable hf).aestronglyMeasurable B + filter_upwards [ae_mem_disk hν] with x hx + exact poissonExtension_norm_le hB ⟨x,hx⟩ + + + +def poissonL2 {f : Boundary → ℝ} (hf : Measurable f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : Lp ℝ 2 ν := + (poissonExtension_memLp hν hf hB).toLp (poissonExtension f) + +lemma smoothedRow_uniform_bound : ∃ M : ℝ, 0 ≤ M ∧ ∀ s, ‖smoothedRow hC hν s‖ ≤ M := by + obtain ⟨B,hB,h⟩ := green_poisson_uniform_bound hC hν + refine ⟨(measureUnivNNReal ν : ℝ) ^ (2 : ℝ)⁻¹ * B, by positivity, fun s => ?_⟩ + apply Lp.norm_le_of_ae_bound hB + filter_upwards [(smoothedPoisson_memLp hC hν s).coeFn_toLp, ae_mem_disk hν] with x hx hxd + rw [show smoothedRow hC hν s x = smoothedPoisson (ν := ν) s x from hx] + exact h x hxd s + +lemma smoothedRow_integrable {f : Boundary → ℝ} (hf : Measurable f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + Integrable (fun s => f s • smoothedRow hC hν s) boundaryMeasure := by + obtain ⟨M,hM,h⟩ := smoothedRow_uniform_bound hC hν + apply Integrable.of_bound (hf.aestronglyMeasurable.smul + (smoothedRow_stronglyMeasurable hC hν).aestronglyMeasurable) (B*M) + filter_upwards [] with s + change ‖f s • smoothedRow hC hν s‖ ≤ B*M + rw [norm_smul] + exact mul_le_mul (hB s) (h s) (norm_nonneg _) (le_trans (norm_nonneg (f s)) (hB s)) + +include hC hν in +lemma green_poisson_boundary_integrable (p : disk) : + Integrable (fun z : Boundary × Plane => kernel p z.2 * poisson z.1 z.2) + (boundaryMeasure.prod ν) := by + have hm : Measurable (fun z : Boundary × Plane => kernel p z.2 * poisson z.1 z.2) := + (measurable_kernel.comp (measurable_const.prodMk measurable_snd)).mul poisson_joint_measurable + apply (integrable_prod_iff' hm.aestronglyMeasurable).2 + constructor + · filter_upwards [ae_mem_disk hν] with x hx + exact (poisson_boundary_integrable ⟨x,hx⟩).const_mul (kernel p x) + · apply ((kernel_memLp_weighted hC hν p p.property).integrable (by norm_num)).norm.congr + filter_upwards [ae_mem_disk hν] with x hx + rw [show (∫ s, ‖kernel p x * poisson s x‖ ∂boundaryMeasure) = ‖kernel p x‖ by + simp_rw [norm_mul, Real.norm_of_nonneg (poisson_nonneg _ ⟨x,hx⟩)] + rw [integral_const_mul, integral_poisson ⟨x,hx⟩, mul_one]] + +include hC hν in +lemma green_poisson_data_integrable (p : disk) {f : Boundary → ℝ} (hf : Measurable f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + Integrable (fun z : Boundary × Plane => kernel p z.2 * poisson z.1 z.2 * f z.1) + (boundaryMeasure.prod ν) := by + apply ((green_poisson_boundary_integrable hC hν p).norm.mul_const B).mono' + (((measurable_kernel.comp (measurable_const.prodMk measurable_snd)).mul + poisson_joint_measurable).mul (hf.comp measurable_fst)).aestronglyMeasurable + filter_upwards [] with z + change ‖kernel p z.2 * poisson z.1 z.2 * f z.1‖ ≤ ‖kernel p z.2 * poisson z.1 z.2‖ * B + rw [norm_mul] + exact mul_le_mul_of_nonneg_left (hB z.1) (norm_nonneg (kernel p z.2 * poisson z.1 z.2)) + +include hC hν in +lemma smoothedPoisson_average (p : disk) {f : Boundary → ℝ} (hf : Measurable f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + (∫ s, f s * smoothedPoisson (ν := ν) s p ∂boundaryMeasure) = + ∫ x, kernel p x * poissonExtension f x ∂ν := by + calc + _ = ∫ s, ∫ x, kernel p x * poisson s x * f s ∂ν ∂boundaryMeasure := by + apply integral_congr_ae + filter_upwards [] with s + rw [integral_mul_const] + exact mul_comm _ _ + _ = ∫ x, ∫ s, kernel p x * poisson s x * f s ∂boundaryMeasure ∂ν := + integral_integral_swap (green_poisson_data_integrable hC hν p hf hB) + _ = _ := by + apply integral_congr_ae + filter_upwards [] with x + simp only [poissonExtension,smul_eq_mul, mul_assoc, integral_const_mul] + +lemma smoothedRow_average {f : Boundary → ℝ} (hf : Measurable f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + (∫ s, f s • smoothedRow hC hν s ∂boundaryMeasure) = + weightedIntegralOperator hC hν (poissonL2 hν hf hB) := by + obtain ⟨M,_,hM⟩ := green_poisson_uniform_bound hC hν + have hm : Measurable (fun z : Boundary × Plane => f z.1 * smoothedPoisson (ν := ν) z.1 z.2) := + (hf.comp measurable_fst).mul smoothedPoisson_joint_measurable + have hb : ∀ᵐ z ∂boundaryMeasure.prod ν, + ‖f z.1 * smoothedPoisson (ν := ν) z.1 z.2‖ ≤ B*M := by + apply (Measure.ae_prod_iff_ae_ae (measurableSet_le hm.norm measurable_const)).2 + filter_upwards [] with s + filter_upwards [ae_mem_disk hν] with x hx + change ‖f s * smoothedPoisson (ν := ν) s x‖ ≤ B*M + rw [norm_mul] + exact mul_le_mul (hB s) (hM x hx s) (norm_nonneg _) + (le_trans (norm_nonneg (f s)) (hB s)) + have hr (s : Boundary) : (f s • smoothedRow hC hν s) =ᵐ[ν] + (fun x => f s * smoothedPoisson (ν := ν) s x) := by + filter_upwards [Lp.coeFn_smul (f s) (smoothedRow hC hν s), + (smoothedPoisson_memLp hC hν s).coeFn_toLp] with x hx hpx + rw [hx] + change f s * smoothedRow hC hν s x = _ + rw [show smoothedRow hC hν s x = smoothedPoisson (ν := ν) s x from hpx] + rw [L2Rows.integral_eq_toLp_of_bound (r := fun s x => f s * smoothedPoisson (ν := ν) s x) + (smoothedRow_integrable hC hν hf hB) hr hm hb] + · apply Lp.ext + filter_upwards [(L2Rows.average_memLp (r := fun s x => f s * smoothedPoisson (ν := ν) s x) hm hb).coeFn_toLp, + weightedIntegralOperator_ae hC hν (poissonL2 hν hf hB),ae_mem_disk hν] with x hx ht hxd + rw [hx,ht,smoothedPoisson_average hC hν ⟨x,hxd⟩ hf hB] + apply integral_congr_ae + filter_upwards [(poissonExtension_memLp hν hf hB).coeFn_toLp] with y hy + rw [show poissonL2 hν hf hB y = poissonExtension f y from hy] +end StrictHotSpots.PlaneGreen +end BoundaryExtensionScalarSupportLayer + +section BoundaryKRepresentationScalarSupportLayer +open MeasureTheory Filter Set Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +omit [IsFiniteMeasure ν] in +lemma inner_row (p : disk) (g : Lp ℝ 2 ν) : + inner ℝ (row hC hν p) g = ∫ x, kernel p x * g x ∂ν := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [(column_memLp hC hν p).coeFn_toLp] with x hx + change inner ℝ (row hC hν p x) (g x) = _ + rw [show row hC hν p x = kernel x p from hx,kernel_symm x p,Real.inner_apply] + +lemma inner_row_poissonL2 (p : disk) {f : Boundary → ℝ} (hf : Measurable f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + inner ℝ (row hC hν p) (poissonL2 hν hf hB) = + ∫ x, kernel p x * poissonExtension f x ∂ν := by + rw [inner_row] + apply integral_congr_ae + filter_upwards [(poissonExtension_memLp hν hf hB).coeFn_toLp] with x hx + rw [show poissonL2 hν hf hB x = poissonExtension f x from hx] + + +def fullExtension {f : Boundary → ℝ} (hf : Measurable f) {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) + (p : disk) : ℝ := poissonExtension f p + inner ℝ (row hC hν p) + (BanachResolvent.resolvent (weightedIntegralOperator hC hν) (poissonL2 hν hf hB)) + +lemma fullBoundaryK_data_integrable (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (p : disk) {f : Boundary → ℝ} (hf : Measurable f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + Integrable (fun s => fullBoundaryK hC hν p s * f s) boundaryMeasure := by + obtain ⟨M,_,hM⟩ := fullBoundaryK_bounded hC hν p + apply Integrable.of_bound ((fullBoundaryK_measurable hC hν p).mul hf).aestronglyMeasurable (M*B) + filter_upwards [] with s + change ‖fullBoundaryK hC hν p s * f s‖ ≤ M*B + rw [norm_mul,Real.norm_of_nonneg (fullBoundaryK_pos hC hν hT p s).le] + exact mul_le_mul (hM s) (hB s) (norm_nonneg _) (by linarith [fullBoundaryK_pos hC hν hT p s]) + +lemma fullBoundaryK_representation (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (p : disk) {f : Boundary → ℝ} (hf : Measurable f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + (∫ s, fullBoundaryK hC hν p s * f s ∂boundaryMeasure) = + fullExtension hC hν hf hB p := by + let T := weightedIntegralOperator hC hν + let R := BanachResolvent.resolvent T + have hI := smoothedRow_integrable hC hν hf hB + have hRI := R.integrable_comp hI + have htail : (∫ s, f s * inner ℝ (row hC hν p) (R (smoothedRow hC hν s)) ∂boundaryMeasure) = + inner ℝ (row hC hν p) (R (T (poissonL2 hν hf hB))) := by + calc + _ = ∫ s, inner ℝ (row hC hν p) (R (f s • smoothedRow hC hν s)) ∂boundaryMeasure := by + apply integral_congr_ae + filter_upwards [] with s + rw [map_smul,inner_smul_right] + _ = _ := by rw [integral_inner hRI, R.integral_comp_comm hI,smoothedRow_average hC hν hf hB] + have htailI : Integrable (fun s => f s * inner ℝ (row hC hν p) (R (smoothedRow hC hν s))) boundaryMeasure := by + convert hRI.const_inner (row hC hν p) using 1 + funext s + rw [map_smul,inner_smul_right] + have hP : Integrable (fun s => poisson s p * f s) boundaryMeasure := by + apply ((poisson_boundary_integrable p).norm.mul_const B).mono' + ((poisson_continuous_boundary p).measurable.mul hf).aestronglyMeasurable + filter_upwards [] with s + change ‖poisson s p * f s‖ ≤ ‖poisson s p‖ * B + rw [norm_mul] + exact mul_le_mul_of_nonneg_left (hB s) (norm_nonneg _) + have hF : Integrable (fun s => f s * smoothedPoisson (ν := ν) s p) boundaryMeasure := by + have h := (green_poisson_data_integrable hC hν p hf hB).integral_prod_left + convert h using 1 + funext s + change f s * smoothedPoisson (ν := ν) s p = ∫ x, kernel p x * poisson s x * f s ∂ν + rw [integral_mul_const] + exact mul_comm _ _ + calc + _ = (∫ s, poisson s p * f s ∂boundaryMeasure) + + (∫ s, f s * smoothedPoisson (ν := ν) s p ∂boundaryMeasure) + + (∫ s, f s * inner ℝ (row hC hν p) (R (smoothedRow hC hν s)) ∂boundaryMeasure) := by + have hPF : Integrable (fun s => poisson s p * f s + f s * smoothedPoisson (ν := ν) s p) boundaryMeasure := hP.add hF + rw [← integral_add hP hF,← integral_add hPF htailI] + apply integral_congr_ae + filter_upwards [] with s + unfold fullBoundaryK + dsimp only [R,T] + ring + _ = fullExtension hC hν hf hB p := by + rw [smoothedPoisson_average hC hν p hf hB, htail, ← inner_row_poissonL2 hC hν p hf hB] + change poissonExtension f p + inner ℝ (row hC hν p) _ + inner ℝ (row hC hν p) _ = _ + have hr := BanachResolvent.apply_eq_add (weightedIntegralOperator hC hν) hT (poissonL2 hν hf hB) + rw [fullExtension,hr,inner_add_right] + ring +end StrictHotSpots.PlaneGreen +end BoundaryKRepresentationScalarSupportLayer + +section PoissonFubiniScalarSupportLayer +open MeasureTheory Filter Set Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hν : ν ≤ C • volume.restrict disk) + +include hν in +lemma poisson_pair_integrable {g : Plane → ℝ} (hg : Integrable g ν) : + Integrable (fun z : Boundary × Plane => poisson z.1 z.2 * g z.2) (boundaryMeasure.prod ν) := by + have hm : AEStronglyMeasurable (fun z : Boundary × Plane => poisson z.1 z.2 * g z.2) (boundaryMeasure.prod ν) := + poisson_joint_measurable.aestronglyMeasurable.mul hg.aestronglyMeasurable.comp_snd + apply (integrable_prod_iff' hm).2 + constructor + · filter_upwards [ae_mem_disk hν] with x hx + exact (poisson_boundary_integrable ⟨x,hx⟩).mul_const (g x) + · apply hg.norm.congr + filter_upwards [ae_mem_disk hν] with x hx + change ‖g x‖ = ∫ s, ‖poisson s x * g x‖ ∂boundaryMeasure + simp_rw [norm_mul,Real.norm_of_nonneg (poisson_nonneg _ ⟨x,hx⟩)] + rw [integral_mul_const,integral_poisson ⟨x,hx⟩,one_mul] + +include hν in +lemma poisson_data_pair_integrable {g : Plane → ℝ} (hg : Integrable g ν) + {f : Boundary → ℝ} (hf : Measurable f) {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + Integrable (fun z : Boundary × Plane => poisson z.1 z.2 * g z.2 * f z.1) (boundaryMeasure.prod ν) := by + apply ((poisson_pair_integrable hν hg).norm.mul_const B).mono' + ((poisson_joint_measurable.aestronglyMeasurable.mul hg.aestronglyMeasurable.comp_snd).mul + (hf.aestronglyMeasurable.comp_fst)) + filter_upwards [] with z + change ‖poisson z.1 z.2 * g z.2 * f z.1‖ ≤ ‖poisson z.1 z.2 * g z.2‖ * B + rw [norm_mul] + exact mul_le_mul_of_nonneg_left (hB z.1) (norm_nonneg _) + +include hν in +lemma poisson_average_pairing {g : Plane → ℝ} (hg : Integrable g ν) + {f : Boundary → ℝ} (hf : Measurable f) {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + (∫ s, f s * (∫ x, poisson s x * g x ∂ν) ∂boundaryMeasure) = + ∫ x, poissonExtension f x * g x ∂ν := by + calc + _ = ∫ s, ∫ x, poisson s x * g x * f s ∂ν ∂boundaryMeasure := by + apply integral_congr_ae + filter_upwards [] with s + rw [integral_mul_const,mul_comm] + _ = ∫ x, ∫ s, poisson s x * g x * f s ∂boundaryMeasure ∂ν := + integral_integral_swap (poisson_data_pair_integrable hν hg hf hB) + _ = _ := by + apply integral_congr_ae + filter_upwards [] with x + unfold poissonExtension + simp only [smul_eq_mul] + rw [← integral_mul_const] + apply integral_congr_ae + filter_upwards [] with s + ring + +lemma poissonL2_pairing (g : Lp ℝ 2 ν) + {f : Boundary → ℝ} (hf : Measurable f) {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + (∫ s, f s * (∫ x, poisson s x * g x ∂ν) ∂boundaryMeasure) = + inner ℝ (poissonL2 hν hf hB) g := by + rw [poisson_average_pairing hν ((Lp.memLp g).integrable (by norm_num)) hf hB, L2.inner_def] + apply integral_congr_ae + filter_upwards [(poissonExtension_memLp hν hf hB).coeFn_toLp] with x hx + rw [Real.inner_apply,show poissonL2 hν hf hB x = poissonExtension f x from hx] + +end StrictHotSpots.PlaneGreen +end PoissonFubiniScalarSupportLayer + +section BoundaryInteractionPartsScalarSupportLayer +open MeasureTheory Filter Set Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +def firstInteraction (s t : Boundary) : ℝ := ∫ x, poisson s x * poisson t x ∂ν + +def secondInteraction (s t : Boundary) : ℝ := ∫ x, poisson s x * smoothedPoisson (ν := ν) t x ∂ν + +def tailInteraction (s t : Boundary) : ℝ := inner ℝ (smoothedRow hC hν s) + (BanachResolvent.resolvent (weightedIntegralOperator hC hν) (smoothedRow hC hν t)) + +def fullBoundaryR (s t : Boundary) : ℝ := firstInteraction (ν := ν) s t + + secondInteraction (ν := ν) s t + tailInteraction hC hν s t + +lemma firstInteraction_measurable : Measurable (fun z : Boundary × Boundary => firstInteraction (ν := ν) z.1 z.2) := by + have hm1 : Measurable (fun z : (Boundary × Boundary) × Plane => (z.1.1,z.2)) := + measurable_fst.fst.prodMk measurable_snd + have hm2 : Measurable (fun z : (Boundary × Boundary) × Plane => (z.1.2,z.2)) := + measurable_fst.snd.prodMk measurable_snd + exact ((poisson_joint_measurable.comp hm1).mul + (poisson_joint_measurable.comp hm2)).stronglyMeasurable.integral_prod_right'.measurable + +lemma secondInteraction_measurable : Measurable (fun z : Boundary × Boundary => secondInteraction (ν := ν) z.1 z.2) := by + have hm1 : Measurable (fun z : (Boundary × Boundary) × Plane => (z.1.1,z.2)) := + measurable_fst.fst.prodMk measurable_snd + have hm2 : Measurable (fun z : (Boundary × Boundary) × Plane => (z.1.2,z.2)) := + measurable_fst.snd.prodMk measurable_snd + exact ((poisson_joint_measurable.comp hm1).mul + (smoothedPoisson_joint_measurable.comp hm2)).stronglyMeasurable.integral_prod_right'.measurable + +lemma tailInteraction_measurable : Measurable (fun z : Boundary × Boundary => tailInteraction hC hν z.1 z.2) := by + have h1 := (smoothedRow_stronglyMeasurable hC hν).comp_measurable + (measurable_fst : Measurable (Prod.fst : Boundary × Boundary → Boundary)) + have h2 := (smoothedRow_stronglyMeasurable hC hν).comp_measurable + (measurable_snd : Measurable (Prod.snd : Boundary × Boundary → Boundary)) + exact (h1.inner ((BanachResolvent.resolvent (weightedIntegralOperator hC hν)).continuous.comp_stronglyMeasurable h2)).measurable + +include hν in +omit [IsFiniteMeasure ν] in +lemma firstInteraction_nonneg (s t : Boundary) : 0 ≤ firstInteraction (ν := ν) s t := by + apply integral_nonneg_of_ae + filter_upwards [ae_mem_disk hν] with x hx + exact mul_nonneg (poisson_nonneg s ⟨x,hx⟩) (poisson_nonneg t ⟨x,hx⟩) + +include hν in +omit [IsFiniteMeasure ν] in +lemma secondInteraction_nonneg (s t : Boundary) : 0 ≤ secondInteraction (ν := ν) s t := by + apply integral_nonneg_of_ae + filter_upwards [ae_mem_disk hν] with x hx + exact mul_nonneg (poisson_nonneg s ⟨x,hx⟩) (smoothedPoisson_nonneg hν t hx) + +lemma tailInteraction_nonneg (hT : ‖weightedIntegralOperator hC hν‖ < 1) (s t : Boundary) : + 0 ≤ tailInteraction hC hν s t := by + exact L2Limits.inner_nonneg (smoothedRow_nonneg hC hν s) + (BanachResolvent.resolvent_nonneg _ hT (weightedIntegralOperator_order_nonneg hC hν) (smoothedRow_nonneg hC hν t)) + +lemma fullBoundaryR_nonneg (hT : ‖weightedIntegralOperator hC hν‖ < 1) (s t : Boundary) : + 0 ≤ fullBoundaryR hC hν s t := + add_nonneg (add_nonneg (firstInteraction_nonneg hν s t) (secondInteraction_nonneg hν s t)) + (tailInteraction_nonneg hC hν hT s t) + +include hν in +lemma massPoisson_integrable : Integrable (fun s : Boundary => ∫ x, poisson s x ∂ν) boundaryMeasure := by + have h := (poisson_pair_integrable hν (integrable_const (1 : ℝ))).integral_prod_left + simpa only [mul_one] using h + +include hC hν in +lemma firstInteraction_prod_integrable : + Integrable (fun z : Boundary × Boundary => firstInteraction (ν := ν) z.1 z.2) (boundaryMeasure.prod boundaryMeasure) := by + apply (integrable_prod_iff firstInteraction_measurable.aestronglyMeasurable).2 + constructor + · exact Eventually.of_forall (firstInteraction_integrable hC hν) + · apply (massPoisson_integrable hν).congr + filter_upwards [] with s + change (∫ x, poisson s x ∂ν) = ∫ t, ‖firstInteraction (ν := ν) s t‖ ∂boundaryMeasure + simp_rw [Real.norm_of_nonneg (firstInteraction_nonneg hν s _)] + exact (integral_firstInteraction hC hν s).symm + +include hC hν in +lemma secondInteraction_bound : ∃ M : ℝ, 0 ≤ M ∧ ∀ s t : Boundary, + ‖secondInteraction (ν := ν) s t‖ ≤ M * (∫ x, poisson s x ∂ν) := by + obtain ⟨M,hM,h⟩ := green_poisson_uniform_bound hC hν + refine ⟨M,hM,fun s t => ?_⟩ + apply (norm_integral_le_integral_norm _).trans + calc + _ ≤ ∫ x, M * poisson s x ∂ν := by + apply integral_mono_of_nonneg + · exact Eventually.of_forall fun _ => norm_nonneg _ + · exact (poisson_integrable_weighted hC hν s).const_mul M + · filter_upwards [ae_mem_disk hν] with x hx + rw [norm_mul,Real.norm_of_nonneg (poisson_nonneg s ⟨x,hx⟩),mul_comm M] + exact mul_le_mul_of_nonneg_left (h x hx t) (poisson_nonneg s ⟨x,hx⟩) + _ = _ := integral_const_mul _ _ + +include hC hν in +lemma secondInteraction_prod_integrable : + Integrable (fun z : Boundary × Boundary => secondInteraction (ν := ν) z.1 z.2) (boundaryMeasure.prod boundaryMeasure) := by + obtain ⟨M,_,hM⟩ := secondInteraction_bound hC hν + apply ((massPoisson_integrable hν).comp_fst boundaryMeasure |>.const_mul M).mono' + secondInteraction_measurable.aestronglyMeasurable + exact Eventually.of_forall fun z => hM z.1 z.2 + +lemma tailInteraction_prod_integrable : + Integrable (fun z : Boundary × Boundary => tailInteraction hC hν z.1 z.2) (boundaryMeasure.prod boundaryMeasure) := by + obtain ⟨M,hM,h⟩ := smoothedRow_uniform_bound hC hν + apply Integrable.of_bound (tailInteraction_measurable hC hν).aestronglyMeasurable + (M * (‖BanachResolvent.resolvent (weightedIntegralOperator hC hν)‖ * M)) + filter_upwards [] with z + change ‖inner ℝ (smoothedRow hC hν z.1) (BanachResolvent.resolvent _ (smoothedRow hC hν z.2))‖ ≤ _ + apply (norm_inner_le_norm _ _).trans + exact mul_le_mul (h z.1) ((ContinuousLinearMap.le_opNorm _ _).trans + (mul_le_mul_of_nonneg_left (h z.2) (norm_nonneg _))) (norm_nonneg _) hM + +lemma fullBoundaryR_integrable : Integrable (fun z : Boundary × Boundary => fullBoundaryR hC hν z.1 z.2) + (boundaryMeasure.prod boundaryMeasure) := + ((firstInteraction_prod_integrable hC hν).add (secondInteraction_prod_integrable hC hν)).add + (tailInteraction_prod_integrable hC hν) + +end StrictHotSpots.PlaneGreen +end BoundaryInteractionPartsScalarSupportLayer + +section BoundaryRAveragingScalarSupportLayer +open MeasureTheory Filter Set Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) +include hC hν + +lemma firstInteraction_average (s : Boundary) {g : Boundary → ℝ} (hg : Measurable g) + {B : ℝ} (hB : ∀ t, ‖g t‖ ≤ B) : + (∫ t, firstInteraction (ν := ν) s t * g t ∂boundaryMeasure) = + ∫ x, poisson s x * poissonExtension g x ∂ν := by + have h := poisson_average_pairing hν (poisson_integrable_weighted hC hν s) hg hB + convert h using 1 + · apply integral_congr_ae + filter_upwards [] with t + unfold firstInteraction + rw [mul_comm] + congr 1 + apply integral_congr_ae + filter_upwards [] with x + exact mul_comm _ _ + · apply integral_congr_ae + filter_upwards [] with x + exact mul_comm _ _ + +lemma firstInteraction_pairing {f g : Boundary → ℝ} (hf : Measurable f) (hg : Measurable g) + {A B : ℝ} (hA : ∀ s, ‖f s‖ ≤ A) (hB : ∀ t, ‖g t‖ ≤ B) : + (∫ s, f s * (∫ t, firstInteraction (ν := ν) s t * g t ∂boundaryMeasure) ∂boundaryMeasure) = + inner ℝ (poissonL2 hν hf hA) (poissonL2 hν hg hB) := by + simp_rw [firstInteraction_average hC hν _ hg hB] + rw [poisson_average_pairing hν ((poissonExtension_memLp hν hg hB).integrable (by norm_num)) hf hA, + L2.inner_def] + apply integral_congr_ae + filter_upwards [(poissonExtension_memLp hν hf hA).coeFn_toLp, + (poissonExtension_memLp hν hg hB).coeFn_toLp] with x hx hy + rw [Real.inner_apply,show poissonL2 hν hf hA x = poissonExtension f x from hx, + show poissonL2 hν hg hB x = poissonExtension g x from hy] + +lemma smoothed_average_ae {g : Boundary → ℝ} (hg : Measurable g) + {B : ℝ} (hB : ∀ t, ‖g t‖ ≤ B) : + (fun x => ∫ t, g t * smoothedPoisson (ν := ν) t x ∂boundaryMeasure) =ᵐ[ν] + weightedIntegralOperator hC hν (poissonL2 hν hg hB) := by + filter_upwards [ae_mem_disk hν, weightedIntegralOperator_ae hC hν (poissonL2 hν hg hB)] with x hx ht + rw [smoothedPoisson_average hC hν ⟨x,hx⟩ hg hB,ht] + apply integral_congr_ae + filter_upwards [(poissonExtension_memLp hν hg hB).coeFn_toLp] with y hy + rw [show poissonL2 hν hg hB y = poissonExtension g y from hy] + +lemma smoothed_data_pair_integrable {a : Plane → ℝ} (ha : Integrable a ν) + {g : Boundary → ℝ} (hg : Measurable g) {B : ℝ} (hB : ∀ t, ‖g t‖ ≤ B) : + Integrable (fun z : Boundary × Plane => a z.2 * smoothedPoisson (ν := ν) z.1 z.2 * g z.1) + (boundaryMeasure.prod ν) := by + obtain ⟨M,hM,h⟩ := green_poisson_uniform_bound hC hν + have hm : AEStronglyMeasurable + (fun z : Boundary × Plane => a z.2 * smoothedPoisson (ν := ν) z.1 z.2 * g z.1) + (boundaryMeasure.prod ν) := + (ha.aestronglyMeasurable.comp_snd.mul smoothedPoisson_joint_measurable.aestronglyMeasurable).mul + hg.aestronglyMeasurable.comp_fst + apply (((ha.norm.comp_snd boundaryMeasure).mul_const M).mul_const B).mono' hm + filter_upwards [(Measure.quasiMeasurePreserving_snd (μ := boundaryMeasure)).ae (ae_mem_disk hν)] with z hz + change ‖a z.2 * smoothedPoisson (ν := ν) z.1 z.2 * g z.1‖ ≤ ‖a z.2‖ * M * B + rw [norm_mul,norm_mul] + exact mul_le_mul (mul_le_mul_of_nonneg_left (h z.2 hz z.1) (norm_nonneg _)) + (hB z.1) (norm_nonneg _) (mul_nonneg (norm_nonneg _) hM) + +lemma smoothed_average_pairing {a : Plane → ℝ} (ha : Integrable a ν) + {g : Boundary → ℝ} (hg : Measurable g) {B : ℝ} (hB : ∀ t, ‖g t‖ ≤ B) : + (∫ t, g t * (∫ x, a x * smoothedPoisson (ν := ν) t x ∂ν) ∂boundaryMeasure) = + ∫ x, a x * weightedIntegralOperator hC hν (poissonL2 hν hg hB) x ∂ν := by + calc + _ = ∫ t, ∫ x, a x * smoothedPoisson (ν := ν) t x * g t ∂ν ∂boundaryMeasure := by + apply integral_congr_ae + filter_upwards [] with t + rw [integral_mul_const,mul_comm] + _ = ∫ x, ∫ t, a x * smoothedPoisson (ν := ν) t x * g t ∂boundaryMeasure ∂ν := + integral_integral_swap (smoothed_data_pair_integrable hC hν ha hg hB) + _ = _ := by + apply integral_congr_ae + filter_upwards [smoothed_average_ae hC hν hg hB] with x hx + rw [← hx,← integral_const_mul] + apply integral_congr_ae + filter_upwards [] with t + ring + +lemma secondInteraction_average (s : Boundary) {g : Boundary → ℝ} (hg : Measurable g) + {B : ℝ} (hB : ∀ t, ‖g t‖ ≤ B) : + (∫ t, secondInteraction (ν := ν) s t * g t ∂boundaryMeasure) = + ∫ x, poisson s x * weightedIntegralOperator hC hν (poissonL2 hν hg hB) x ∂ν := by + convert smoothed_average_pairing hC hν (poisson_integrable_weighted hC hν s) hg hB using 1 + apply integral_congr_ae + filter_upwards [] with t + exact mul_comm _ _ + +lemma secondInteraction_pairing {f g : Boundary → ℝ} (hf : Measurable f) (hg : Measurable g) + {A B : ℝ} (hA : ∀ s, ‖f s‖ ≤ A) (hB : ∀ t, ‖g t‖ ≤ B) : + (∫ s, f s * (∫ t, secondInteraction (ν := ν) s t * g t ∂boundaryMeasure) ∂boundaryMeasure) = + inner ℝ (poissonL2 hν hf hA) (weightedIntegralOperator hC hν (poissonL2 hν hg hB)) := by + simp_rw [secondInteraction_average hC hν _ hg hB] + exact poissonL2_pairing hν _ hf hA + +lemma tailInteraction_pairing {f g : Boundary → ℝ} (hf : Measurable f) (hg : Measurable g) + {A B : ℝ} (hA : ∀ s, ‖f s‖ ≤ A) (hB : ∀ t, ‖g t‖ ≤ B) : + (∫ s, f s * (∫ t, tailInteraction hC hν s t * g t ∂boundaryMeasure) ∂boundaryMeasure) = + inner ℝ (weightedIntegralOperator hC hν (poissonL2 hν hf hA)) + (BanachResolvent.resolvent (weightedIntegralOperator hC hν) + (weightedIntegralOperator hC hν (poissonL2 hν hg hB))) := by + let R := BanachResolvent.resolvent (weightedIntegralOperator hC hν) + have hI := smoothedRow_integrable hC hν hg hB + have hRI := R.integrable_comp hI + have ht (s : Boundary) : (∫ t, tailInteraction hC hν s t * g t ∂boundaryMeasure) = + inner ℝ (smoothedRow hC hν s) (R (weightedIntegralOperator hC hν (poissonL2 hν hg hB))) := by + calc + _ = ∫ t, inner ℝ (smoothedRow hC hν s) (R (g t • smoothedRow hC hν t)) ∂boundaryMeasure := by + apply integral_congr_ae + filter_upwards [] with t + rw [map_smul,inner_smul_right] + exact mul_comm _ _ + _ = _ := by rw [integral_inner hRI,R.integral_comp_comm hI,smoothedRow_average hC hν hg hB] + simp_rw [ht] + calc + _ = ∫ s, inner ℝ (f s • smoothedRow hC hν s) + (R (weightedIntegralOperator hC hν (poissonL2 hν hg hB))) ∂boundaryMeasure := by + simp_rw [inner_smul_left,conj_trivial] + _ = _ := by + have hc : (fun s => inner ℝ (f s • smoothedRow hC hν s) + (R (weightedIntegralOperator hC hν (poissonL2 hν hg hB)))) = + (fun s => inner ℝ (R (weightedIntegralOperator hC hν (poissonL2 hν hg hB))) + (f s • smoothedRow hC hν s)) := by + funext s + exact real_inner_comm _ _ + rw [hc] + rw [integral_inner (smoothedRow_integrable hC hν hf hA),smoothedRow_average hC hν hf hA] + exact real_inner_comm _ _ +end StrictHotSpots.PlaneGreen +end BoundaryRAveragingScalarSupportLayer + +section BoundaryRRepresentationScalarSupportLayer +open MeasureTheory Filter Set Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 + +lemma boundary_data_integrable {r : Boundary × Boundary → ℝ} + (hr : Integrable r (boundaryMeasure.prod boundaryMeasure)) + {f g : Boundary → ℝ} (hf : Measurable f) (hg : Measurable g) + {A B : ℝ} (hA : ∀ s, ‖f s‖ ≤ A) (hB : ∀ t, ‖g t‖ ≤ B) : + Integrable (fun z => r z * f z.1 * g z.2) (boundaryMeasure.prod boundaryMeasure) := by + apply ((hr.norm.mul_const A).mul_const B).mono' + ((hr.aestronglyMeasurable.mul hf.aestronglyMeasurable.comp_fst).mul hg.aestronglyMeasurable.comp_snd) + filter_upwards [] with z + change ‖r z * f z.1 * g z.2‖ ≤ ‖r z‖ * A * B + rw [norm_mul,norm_mul] + exact mul_le_mul (mul_le_mul_of_nonneg_left (hA z.1) (norm_nonneg _)) + (hB z.2) (norm_nonneg _) (mul_nonneg (norm_nonneg _) ((norm_nonneg _).trans (hA z.1))) + +lemma interaction_eq_iterated {r : Boundary × Boundary → ℝ} + (hr : Integrable r (boundaryMeasure.prod boundaryMeasure)) + {f g : Boundary → ℝ} (hf : Measurable f) (hg : Measurable g) + {A B : ℝ} (hA : ∀ s, ‖f s‖ ≤ A) (hB : ∀ t, ‖g t‖ ≤ B) : + (∫ z, r z * f z.1 * g z.2 ∂boundaryMeasure.prod boundaryMeasure) = + ∫ s, f s * (∫ t, r (s,t) * g t ∂boundaryMeasure) ∂boundaryMeasure := by + rw [integral_prod _ (boundary_data_integrable hr hf hg hA hB)] + apply integral_congr_ae + filter_upwards [] with s + rw [← integral_const_mul] + apply integral_congr_ae + filter_upwards [] with t + ring + +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +lemma fullBoundaryR_representation (hT : ‖weightedIntegralOperator hC hν‖ < 1) + {f g : Boundary → ℝ} (hf : Measurable f) (hg : Measurable g) + {A B : ℝ} (hA : ∀ s, ‖f s‖ ≤ A) (hB : ∀ t, ‖g t‖ ≤ B) : + (∫ z, fullBoundaryR hC hν z.1 z.2 * f z.1 * g z.2 ∂boundaryMeasure.prod boundaryMeasure) = + inner ℝ (poissonL2 hν hf hA) + (BanachResolvent.resolvent (weightedIntegralOperator hC hν) (poissonL2 hν hg hB)) := by + have h1 := boundary_data_integrable (firstInteraction_prod_integrable hC hν) hf hg hA hB + have h2 := boundary_data_integrable (secondInteraction_prod_integrable hC hν) hf hg hA hB + have h3 := boundary_data_integrable (tailInteraction_prod_integrable hC hν) hf hg hA hB + calc + _ = (∫ z, firstInteraction (ν := ν) z.1 z.2 * f z.1 * g z.2 ∂boundaryMeasure.prod boundaryMeasure) + + (∫ z, secondInteraction (ν := ν) z.1 z.2 * f z.1 * g z.2 ∂boundaryMeasure.prod boundaryMeasure) + + (∫ z, tailInteraction hC hν z.1 z.2 * f z.1 * g z.2 ∂boundaryMeasure.prod boundaryMeasure) := by + have h12 : Integrable (fun z : Boundary × Boundary => + firstInteraction (ν := ν) z.1 z.2 * f z.1 * g z.2 + + secondInteraction (ν := ν) z.1 z.2 * f z.1 * g z.2) + (boundaryMeasure.prod boundaryMeasure) := h1.add h2 + rw [← integral_add h1 h2,← integral_add h12 h3] + apply integral_congr_ae + filter_upwards [] with z + unfold fullBoundaryR + ring + _ = _ := by + rw [interaction_eq_iterated (firstInteraction_prod_integrable hC hν) hf hg hA hB, + interaction_eq_iterated (secondInteraction_prod_integrable hC hν) hf hg hA hB, + interaction_eq_iterated (tailInteraction_prod_integrable hC hν) hf hg hA hB, + firstInteraction_pairing hC hν hf hg hA hB, + secondInteraction_pairing hC hν hf hg hA hB, + tailInteraction_pairing hC hν hf hg hA hB] + exact (BanachResolvent.inner_two_terms _ hT (weightedIntegralOperator_symmetric hC hν) _ _).symm + +lemma fullBoundaryN_eq (s t : Boundary) : fullBoundaryN hC hν s t = + boundaryInteraction s t + fullBoundaryR hC hν s t := by + unfold fullBoundaryN fullBoundaryR firstInteraction secondInteraction tailInteraction + ring + +end StrictHotSpots.PlaneGreen +end BoundaryRRepresentationScalarSupportLayer + +section BoundaryRPropertiesScalarSupportLayer +open MeasureTheory Filter Set Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +lemma boundaryInteraction_symm (s t : Boundary) : boundaryInteraction s t = boundaryInteraction t s := by + simp only [boundaryInteraction,DiskFormula.boundaryInteraction,norm_sub_rev (complexIso.symm (t : Plane))] + +lemma fullBoundaryN_symm (hT : ‖weightedIntegralOperator hC hν‖ < 1) (s t : Boundary) : + fullBoundaryN hC hν s t = fullBoundaryN hC hν t s := by + by_cases hst : s = t + · subst t; rfl + have he (n : ℕ) : cutoffN hC hν n s t = cutoffN hC hν n t s := by + have hn : ‖weightedIntegralOperator hC (restrictDensity hν (cutoffSet n))‖ < 1 := by + rw [weightedIntegralOperator_restrict hC hν _ (cutoffSet_measurable n)] + exact (L2Cutoff.restrictedOperator_norm_le _ _ _).trans_lt hT + unfold cutoffN boundaryN + rw [boundaryInteraction_symm s t] + congr 1 + rw [← BanachResolvent.symmetric _ hn (weightedIntegralOperator_symmetric hC _)] + exact real_inner_comm _ _ + exact tendsto_nhds_unique (cutoffN_tendsto hC hν hT s t hst) + (by simpa only [he] using cutoffN_tendsto hC hν hT t s (Ne.symm hst)) + +lemma fullBoundaryR_symm (hT : ‖weightedIntegralOperator hC hν‖ < 1) (s t : Boundary) : + fullBoundaryR hC hν s t = fullBoundaryR hC hν t s := by + have hn := fullBoundaryN_symm hC hν hT s t + rw [fullBoundaryN_eq,fullBoundaryN_eq,boundaryInteraction_symm s t] at hn + exact add_left_cancel hn + +lemma poissonL2_one_ae : poissonL2 hν (measurable_const : Measurable (fun _ : Boundary => (1:ℝ))) + (B := 1) (by simp) =ᵐ[ν] (fun _ => (1:ℝ)) := by + filter_upwards [(poissonExtension_memLp hν (measurable_const : Measurable (fun _ : Boundary => (1:ℝ))) + (B := 1) (by simp)).coeFn_toLp,ae_mem_disk hν] with x hx hxd + rw [show poissonL2 hν measurable_const (B := 1) (by simp) x = poissonExtension (fun _ => (1:ℝ)) x from hx] + simp only [poissonExtension,smul_eq_mul,mul_one] + exact integral_poisson ⟨x,hxd⟩ + +lemma poissonL2_one_norm_sq : + ‖poissonL2 hν (measurable_const : Measurable (fun _ : Boundary => (1:ℝ))) + (B := 1) (by simp)‖ ^ 2 = ν.real univ := by + rw [← real_inner_self_eq_norm_sq,L2.inner_def] + calc + _ = ∫ _ : Plane, (1 : ℝ) ∂ν := by + apply integral_congr_ae + filter_upwards [poissonL2_one_ae hν] with x hx + rw [hx] + simp + _ = _ := by simp + +lemma fullBoundaryR_integral_le {d : ℝ} (hT : ‖weightedIntegralOperator hC hν‖ ≤ d) (hd : d < 1) : + (∫ z, fullBoundaryR hC hν z.1 z.2 ∂boundaryMeasure.prod boundaryMeasure) ≤ ν.real univ / (1-d) := by + let c := poissonL2 hν (measurable_const : Measurable (fun _ : Boundary => (1:ℝ))) (B := 1) (by simp) + have hr := fullBoundaryR_representation hC hν (hT.trans_lt hd) + (measurable_const : Measurable (fun _ : Boundary => (1:ℝ))) + (measurable_const : Measurable (fun _ : Boundary => (1:ℝ))) (A := 1) (B := 1) (by simp) (by simp) + simp only [mul_one] at hr + rw [hr] + change inner ℝ c (BanachResolvent.resolvent _ c) ≤ _ + calc + _ ≤ ‖c‖ * ‖BanachResolvent.resolvent (weightedIntegralOperator hC hν) c‖ := real_inner_le_norm _ _ + _ ≤ ‖c‖ * ((1-d)⁻¹ * ‖c‖) := by + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + exact (ContinuousLinearMap.le_opNorm _ _).trans + (mul_le_mul_of_nonneg_right (BanachResolvent.resolvent_norm_le _ hT hd) (norm_nonneg _)) + _ = ‖c‖ ^ 2 / (1-d) := by ring + _ = _ := by rw [poissonL2_one_norm_sq hν] +end StrictHotSpots.PlaneGreen +end BoundaryRPropertiesScalarSupportLayer + +section BoundaryFormScalarSupportLayer + + + +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +omit [InnerProductSpace ℝ E] in +lemma boundary_continuous_bound {f : Boundary → E} (hf : Continuous f) : + ∃ M : ℝ, 0 ≤ M ∧ ∀ s, ‖f s‖ ≤ M := by + obtain ⟨M,hM⟩ := isCompact_univ.exists_bound_of_continuousOn hf.continuousOn + exact ⟨max M 0,le_max_right _ _,fun s => (hM s (mem_univ s)).trans (le_max_left _ _)⟩ + +lemma harmonic_boundary_bound {h k : Boundary → E} {A B : ℝ≥0} + (hh : LipschitzWith A h) (hk : LipschitzWith B k) (s t : Boundary) : + ‖boundaryInteraction s t * inner ℝ (h s-h t) (k s-k t)‖ ≤ (A:ℝ)*B/Real.pi := by + rw [norm_mul,Real.norm_eq_abs,boundaryInteraction_eq_dist,abs_of_nonneg (by positivity)] + have h1 : ‖h s-h t‖ ≤ (A:ℝ)*dist s t := by simpa only [dist_eq_norm] using hh.dist_le_mul s t + have h2 : ‖k s-k t‖ ≤ (B:ℝ)*dist s t := by simpa only [dist_eq_norm] using hk.dist_le_mul s t + by_cases hd : dist s t = 0 + · simp [hd]; positivity + · calc + _ ≤ (1/(Real.pi*dist s t^2)) * (((A:ℝ)*dist s t)*((B:ℝ)*dist s t)) := by + gcongr + exact (norm_inner_le_norm _ _).trans (mul_le_mul h1 h2 (norm_nonneg _) (by positivity)) + _ = _ := by field_simp + +lemma harmonic_boundary_integrable {h k : Boundary → E} {A B : ℝ≥0} + (hh : LipschitzWith A h) (hk : LipschitzWith B k) : + Integrable (fun z : Boundary × Boundary => boundaryInteraction z.1 z.2 * + inner ℝ (h z.1-h z.2) (k z.1-k z.2)) (boundaryMeasure.prod boundaryMeasure) := by + apply (integrable_const ((A:ℝ)*B/Real.pi)).mono' + · exact (boundaryInteraction_measurable.aestronglyMeasurable).mul + (((hh.continuous.comp continuous_fst).sub (hh.continuous.comp continuous_snd)).inner + ((hk.continuous.comp continuous_fst).sub (hk.continuous.comp continuous_snd))).aestronglyMeasurable + · exact Filter.Eventually.of_forall fun z => harmonic_boundary_bound hh hk z.1 z.2 + +lemma interaction_boundary_integrable {R : Boundary → Boundary → ℝ} + (hR : Integrable (fun z : Boundary × Boundary => R z.1 z.2) (boundaryMeasure.prod boundaryMeasure)) + {h k : Boundary → E} (hh : Continuous h) (hk : Continuous k) : + Integrable (fun z : Boundary × Boundary => R z.1 z.2 * inner ℝ (h z.1) (k z.2)) + (boundaryMeasure.prod boundaryMeasure) := by + obtain ⟨A,hA,hAb⟩ := boundary_continuous_bound hh + obtain ⟨B,hB,hBb⟩ := boundary_continuous_bound hk + apply (hR.norm.const_mul (A*B)).mono' + · exact hR.aestronglyMeasurable.mul + ((hh.comp continuous_fst).inner (hk.comp continuous_snd)).aestronglyMeasurable + · apply Filter.Eventually.of_forall + intro z + simp only [norm_mul] + calc + _ ≤ ‖R z.1 z.2‖ * (A*B) := by + gcongr + exact (norm_inner_le_norm _ _).trans (mul_le_mul (hAb z.1) (hBb z.2) (norm_nonneg _) hA) + _ = _ := mul_comm _ _ + +lemma curvature_boundary_integrable {c : Boundary → ℝ} (hc : Integrable c boundaryMeasure) + {h k : Boundary → E} (hh : Continuous h) (hk : Continuous k) : + Integrable (fun s => c s * inner ℝ (h s) (k s)) boundaryMeasure := by + obtain ⟨A,hA,hAb⟩ := boundary_continuous_bound hh + obtain ⟨B,hB,hBb⟩ := boundary_continuous_bound hk + apply (hc.norm.const_mul (A*B)).mono' + · exact hc.aestronglyMeasurable.mul (hh.inner hk).aestronglyMeasurable + · apply Filter.Eventually.of_forall + intro s + simp only [norm_mul] + calc + _ ≤ ‖c s‖ * (A*B) := by + gcongr + exact (norm_inner_le_norm _ _).trans (mul_le_mul (hAb s) (hBb s) (norm_nonneg _) hA) + _ = _ := mul_comm _ _ + + +def boundaryForm (R : Boundary → Boundary → ℝ) (c : Boundary → ℝ) (h k : Boundary → E) : ℝ := + (1/2:ℝ) * (∫ z : Boundary × Boundary, boundaryInteraction z.1 z.2 * + inner ℝ (h z.1-h z.2) (k z.1-k z.2) ∂boundaryMeasure.prod boundaryMeasure) - + (∫ z : Boundary × Boundary, R z.1 z.2 * inner ℝ (h z.1) (k z.2) ∂boundaryMeasure.prod boundaryMeasure) + + ∫ s, c s * inner ℝ (h s) (k s) ∂boundaryMeasure + +lemma harmonic_multiplier_algebra (a b : ℝ) (x y : E) : + inner ℝ (a•x-b•y) (a•x-b•y) - inner ℝ (x-y) (a^2•x-b^2•y) = + (a-b)^2 * inner ℝ x y := by + simp only [inner_sub_left,inner_sub_right,real_inner_smul_left,real_inner_smul_right] + rw [real_inner_comm y x] + ring + +lemma boundary_smul_lipschitz {b : Boundary → ℝ} {g : Boundary → E} {A B : ℝ≥0} + (hb : LipschitzWith A b) (hg : LipschitzWith B g) : + ∃ L : ℝ≥0, LipschitzWith L (fun s => b s • g s) := by + obtain ⟨M,hM,hMb⟩ := boundary_continuous_bound hb.continuous + obtain ⟨N,hN,hNg⟩ := boundary_continuous_bound hg.continuous + refine ⟨A * ⟨N,hN⟩ + ⟨M,hM⟩ * B,LipschitzWith.of_dist_le_mul fun s t => ?_⟩ + rw [dist_eq_norm] + have he : b s • g s-b t • g t = (b s-b t) • g s + b t • (g s-g t) := by + simp only [sub_smul,smul_sub]; abel + rw [he] + calc + _ ≤ ‖(b s-b t) • g s‖ + ‖b t • (g s-g t)‖ := norm_add_le _ _ + _ = ‖b s-b t‖*‖g s‖ + ‖b t‖*‖g s-g t‖ := by simp only [norm_smul,Real.norm_eq_abs] + _ ≤ ((A:ℝ)*dist s t)*N + M*((B:ℝ)*dist s t) := by + gcongr + · simpa only [dist_eq_norm] using hb.dist_le_mul s t + · exact hNg s + · exact hMb t + · simpa only [dist_eq_norm] using hg.dist_le_mul s t + _ = _ := by + change ((A:ℝ)*dist s t)*N + M*((B:ℝ)*dist s t) = + ((A:ℝ)*N+M*(B:ℝ))*dist s t + ring + +end StrictHotSpots.PlaneGreen +end BoundaryFormScalarSupportLayer +end +end LipschitzBoundaryScalarSupport + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/BoundaryKernel.lean b/lean/OAI/Analysis/HotSpots/BoundaryKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f5f72f3f579c419f6fd11522b13d12df27bb4e7 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/BoundaryKernel.lean @@ -0,0 +1,1125 @@ +import OAI.Analysis.HotSpots.GreenOperator + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section FullBoundaryCombinedLayer +section TransferLayer + + + +open MeasureTheory Filter +open scoped ENNReal InnerProductSpace +namespace StrictHotSpots.MeasureKernelTransfer + +lemma integral_mul_eq_inner {X : Type*} [MeasurableSpace X] {ν : Measure X} + {f g : X → ℝ} (hf : MemLp f 2 ν) (hg : MemLp g 2 ν) : + (∫ x, f x * g x ∂ν) = inner ℝ (hf.toLp f) (hg.toLp g) := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hf.coeFn_toLp, hg.coeFn_toLp] with x hx hy + simp only [hx,hy, RCLike.inner_apply, conj_trivial] + ring + +variable {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {ν : Measure X} {μ : Measure Y} (e : X → Y) (he : MeasurePreserving e ν μ) + +def observe : Lp ℝ 2 μ →L[ℝ] Lp ℝ 2 ν := + (Lp.compMeasurePreservingₗᵢ ℝ e he).toContinuousLinearMap + +lemma observe_ae (f : Lp ℝ 2 μ) : observe e he f =ᵐ[ν] f ∘ e := + Lp.coeFn_compMeasurePreserving f he + +lemma observe_row {g : Y → ℝ} (hg : MemLp g 2 μ) : + observe e he (hg.toLp g) = (hg.comp_measurePreserving he).toLp (g ∘ e) := rfl + +def operator (T : Lp ℝ 2 μ →L[ℝ] Lp ℝ 2 μ) : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν := + ((observe e he).comp T).comp (observe e he).adjoint + +lemma integral_adjoint_row {g : Y → ℝ} (hg : MemLp g 2 μ) (f : Lp ℝ 2 ν) : + (∫ y, g y * (observe e he).adjoint f y ∂μ) = ∫ x, g (e x) * f x ∂ν := by + rw [integral_mul_eq_inner hg (Lp.memLp _), Lp.toLp_coeFn, + ContinuousLinearMap.adjoint_inner_right, observe_row e he hg] + symm + simpa only [Function.comp_apply, Lp.toLp_coeFn] using + integral_mul_eq_inner (hg.comp_measurePreserving he) (Lp.memLp f) + +lemma operator_ae (G : Y → Y → ℝ) (hrow : ∀ x, MemLp (G (e x)) 2 μ) + (T : Lp ℝ 2 μ →L[ℝ] Lp ℝ 2 μ) + (hT : ∀ f : Lp ℝ 2 μ, T f =ᵐ[μ] fun y => ∫ z, G y z * f z ∂μ) + (f : Lp ℝ 2 ν) : + operator e he T f =ᵐ[ν] fun x => ∫ z, G (e x) (e z) * f z ∂ν := by + filter_upwards [observe_ae e he (T ((observe e he).adjoint f)), + he.quasiMeasurePreserving.ae_eq_comp (hT ((observe e he).adjoint f))] with x hx ht + change observe e he (T ((observe e he).adjoint f)) x = _ + rw [hx] + change T ((observe e he).adjoint f) (e x) = _ + rw [show T ((observe e he).adjoint f) (e x) = + ∫ y, G (e x) y * (observe e he).adjoint f y ∂μ from ht] + exact integral_adjoint_row e he (hrow x) f + +lemma observe_norm_le : ‖observe e he‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro f + change ‖Lp.compMeasurePreserving e he f‖ ≤ 1 * ‖f‖ + simp + +lemma operator_norm_le (T : Lp ℝ 2 μ →L[ℝ] Lp ℝ 2 μ) : ‖operator e he T‖ ≤ ‖T‖ := by + calc + ‖operator e he T‖ ≤ ‖(observe e he).comp T‖ * ‖(observe e he).adjoint‖ := + ContinuousLinearMap.opNorm_comp_le _ _ + _ ≤ (‖observe e he‖ * ‖T‖) * ‖observe e he‖ := by + rw [LinearIsometryEquiv.norm_map] + exact mul_le_mul_of_nonneg_right (ContinuousLinearMap.opNorm_comp_le _ _) (norm_nonneg _) + _ ≤ (1 * ‖T‖) * 1 := by + gcongr <;> exact observe_norm_le e he + _ = ‖T‖ := by ring + +end StrictHotSpots.MeasureKernelTransfer + +end TransferLayer + + +namespace StrictHotSpots.MeasureKernelTransfer +open MeasureTheory +open scoped ENNReal InnerProductSpace +variable {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {ν : Measure X} {μ : Measure Y} (e : X → Y) (he : MeasurePreserving e ν μ) + +lemma observe_inner (f g : Lp ℝ 2 μ) : + inner ℝ (observe e he f) (observe e he g) = inner ℝ f g := + (Lp.compMeasurePreservingₗᵢ ℝ e he).inner_map_map f g + +lemma adjoint_observe (f : Lp ℝ 2 μ) : + (observe e he).adjoint (observe e he f) = f := by + have h := congrArg (fun T : Lp ℝ 2 μ →L[ℝ] Lp ℝ 2 μ => T f) + (Lp.compMeasurePreservingₗᵢ ℝ e he).adjoint_comp_self + exact h + +lemma operator_observe (T : Lp ℝ 2 μ →L[ℝ] Lp ℝ 2 μ) (f : Lp ℝ 2 μ) : + operator e he T (observe e he f) = observe e he (T f) := by + change observe e he (T ((observe e he).adjoint (observe e he f))) = _ + rw [adjoint_observe] + +lemma resolvent_observe (T : Lp ℝ 2 μ →L[ℝ] Lp ℝ 2 μ) (hT : ‖T‖ < 1) + (f : Lp ℝ 2 μ) : + BanachResolvent.resolvent (operator e he T) (observe e he f) = + observe e he (BanachResolvent.resolvent T f) := by + symm + apply BanachResolvent.resolvent_solution _ ((operator_norm_le e he T).trans_lt hT) + rw [operator_observe, ← map_sub] + congr 1 + exact congrArg (fun A : Lp ℝ 2 μ →L[ℝ] Lp ℝ 2 μ => A f) + (BanachResolvent.resolvent_left T hT) + +lemma resolvent_inner (T : Lp ℝ 2 μ →L[ℝ] Lp ℝ 2 μ) (hT : ‖T‖ < 1) + (f g : Lp ℝ 2 μ) : + inner ℝ (observe e he f) (BanachResolvent.resolvent (operator e he T) (observe e he g)) = + inner ℝ f (BanachResolvent.resolvent T g) := by + rw [resolvent_observe e he T hT, observe_inner] + +end StrictHotSpots.MeasureKernelTransfer + +section DiskCompactLayer +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.DiskKernel +lemma green_eq_formula (x y : Disk) : + green x y = DiskFormula.green x y := by + unfold green h DiskFormula.green + rw [one_div_div] + ring + +lemma regularized_symm (ε : ℝ) (x y : Disk) : regularized ε x y = regularized ε y x := by + have hh : h x y = h y x := by simp only [h, norm_sub_rev, mul_comm] + simp only [regularized, hh] +end StrictHotSpots.DiskKernel +namespace StrictHotSpots.PlaneGreen +lemma kernel_symm (x y : Plane) : kernel x y = kernel y x := by + simp only [kernel, DiskFormula.green, norm_sub_rev, mul_comm] +end StrictHotSpots.PlaneGreen + +namespace StrictHotSpots.DiskCompact +open PlaneGreen DiskH10 +variable {X : Type} [MetricSpace X] [CompactSpace X] [MeasurableSpace X] [BorelSpace X] + (ν : Measure X) [IsFiniteMeasure ν] + (e : X → Plane) (he : Continuous e) (hd : ∀ x, e x ∈ disk) + +def coordinates (x : X) : DiskKernel.Disk := + ⟨complexIso.symm (e x), by simpa [disk] using hd x⟩ + +omit [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +include he in +lemma coordinates_continuous : Continuous (coordinates e hd) := + ((complexIso.symm.continuous.comp he)).subtype_mk _ + +omit [MetricSpace X] [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma coordinates_injective (hinj : Function.Injective e) : Function.Injective (coordinates e hd) := by + intro x y h + apply hinj + exact complexIso.symm.injective (congrArg Subtype.val h) + +def regularizationParameter (n : ℕ) : ℝ := ((n : ℝ) + 1)⁻¹ + +lemma parameter_pos (n : ℕ) : 0 < regularizationParameter n := by + unfold regularizationParameter + positivity +lemma parameter_le_one (n : ℕ) : regularizationParameter n ≤ 1 := by + unfold regularizationParameter + exact inv_le_one_of_one_le₀ (by linarith [Nat.cast_nonneg (α := ℝ) n]) +lemma parameter_tendsto : Tendsto regularizationParameter atTop (𝓝 (0 : ℝ)) := by + exact tendsto_inv_atTop_zero.comp (tendsto_atTop_add_const_right atTop 1 tendsto_natCast_atTop_atTop) +lemma parameter_tendsto_gt : Tendsto regularizationParameter atTop (𝓝[>] (0 : ℝ)) := + tendsto_nhdsWithin_iff.mpr ⟨parameter_tendsto, Eventually.of_forall parameter_pos⟩ + +def regularized (n : ℕ) : C(X × X, ℝ) where + toFun p := DiskKernel.regularized (regularizationParameter n) (coordinates e hd p.1) + (coordinates e hd p.2) + continuous_toFun := by + have hfirst : Continuous (fun p : X × X => coordinates e hd p.1) := + (coordinates_continuous e he hd).comp continuous_fst + have hsecond : Continuous (fun p : X × X => coordinates e hd p.2) := + (coordinates_continuous e he hd).comp continuous_snd + have hr : Continuous (fun p : DiskKernel.Disk × DiskKernel.Disk => + DiskKernel.regularized (regularizationParameter n) p.1 p.2) := + DiskKernel.regularized_continuous (parameter_pos n) (parameter_le_one n) + have hm : Continuous (fun p : X × X => (coordinates e hd p.1, coordinates e hd p.2)) := + hfirst.prodMk hsecond + have hc := hr.comp hm + simpa only [Function.comp_def] using hc + +omit [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma regularized_pos (n : ℕ) (x y : X) : 0 < regularized e he hd n (x,y) := + DiskKernel.regularized_pos (parameter_pos n) (parameter_le_one n) _ _ +omit [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma regularized_symm (n : ℕ) (x y : X) : regularized e he hd n (x,y) = regularized e he hd n (y,x) := + DiskKernel.regularized_symm _ _ _ +omit [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma regularized_onePositiveSquare {ι : Type} [Fintype ι] (n : ℕ) (s : ι → X) : + ReciprocalKernel.OnePositiveSquare (Matrix.of fun i j => (regularized e he hd n (s i,s j))⁻¹) := + DiskKernel.regularized_reciprocal_onePositiveSquare (fun i => coordinates e hd (s i)) + (parameter_le_one n) + +omit [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma regularized_tendsto_off (hinj : Function.Injective e) (x y : X) (hxy : x ≠ y) : + Tendsto (fun n => regularized e he hd n (x,y)) atTop (𝓝 (kernel (e x) (e y))) := by + have h := (DiskKernel.regularized_tendsto_offDiagonal + (fun h => hxy (coordinates_injective e hd hinj h))).comp parameter_tendsto + simpa only [DiskKernel.green_eq_formula, regularized, ContinuousMap.coe_mk, + coordinates, kernel, Function.comp_def] using h +omit [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma regularized_tendsto_diagonal (x : X) : + Tendsto (fun n => regularized e he hd n (x,x)) atTop atTop := + (DiskKernel.regularized_tendsto_diagonal (coordinates e hd x)).comp parameter_tendsto_gt + +omit [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma regularized_le (hinj : Function.Injective e) (n : ℕ) (x y : X) (hxy : x ≠ y) : + regularized e he hd n (x,y) ≤ kernel (e x) (e y) := by + simpa only [DiskKernel.green_eq_formula, regularized, ContinuousMap.coe_mk, + coordinates, kernel] using DiskKernel.regularized_le_green (parameter_pos n).le + (fun h => hxy (coordinates_injective e hd hinj h)) + +omit [CompactSpace X] [IsFiniteMeasure ν] in +include he in +lemma preserving : MeasurePreserving e ν (Measure.map e ν) := ⟨he.measurable,rfl⟩ + +variable {C : ℝ≥0∞} (hC : C ≠ ∞) (hν : Measure.map e ν ≤ C • volume.restrict disk) + +omit [CompactSpace X] [IsFiniteMeasure ν] in +include he hd hC hν in +lemma kernel_memLp (x : X) : MemLp (fun z => kernel (e z) (e x)) 2 ν := by + have h := (kernel_memLp_weighted hC hν (e x) (hd x)).comp_measurePreserving (preserving ν e he) + simpa only [Function.comp_def, kernel_symm] using h + +omit [CompactSpace X] [IsFiniteMeasure ν] in +include he hν in +lemma ae_ne (x : X) : ∀ᵐ z ∂ν, z ≠ x := by + have h := (Measure.absolutelyContinuous_of_le_smul hν).ae_le + have hp : ∀ᵐ y ∂Measure.map e ν, y ≠ e x := + (Measure.ae_ne (volume.restrict disk) (e x)).filter_mono h + filter_upwards [(preserving ν e he).quasiMeasurePreserving.ae hp] with z hz hx + exact hz (congrArg e hx) + +def operator : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν := + MeasureKernelTransfer.operator e (preserving ν e he) (weightedIntegralOperator hC hν) + +omit [CompactSpace X] [IsFiniteMeasure ν] in +include hd in +lemma operator_ae (f : Lp ℝ 2 ν) : + operator ν e he hC hν f =ᵐ[ν] fun x => ∫ z, kernel (e z) (e x) * f z ∂ν := by + simpa only [operator, kernel_symm] using MeasureKernelTransfer.operator_ae e (preserving ν e he) + kernel (fun x => kernel_memLp_weighted hC hν (e x) (hd x)) + (weightedIntegralOperator hC hν) (weightedIntegralOperator_ae hC hν) f + +omit [CompactSpace X] [IsFiniteMeasure ν] in +lemma operator_norm_le {d : ℝ} (hd0 : 0 ≤ d) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) : ‖operator ν e he hC hν‖ ≤ d := + (MeasureKernelTransfer.operator_norm_le e (preserving ν e he) _).trans + (weightedIntegralOperator_norm_le hC hν hd0 hsub) + + + + +theorem reciprocal [Nonempty X] [DecidableEq X] (hinj : Function.Injective e) + {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) {ι : Type} [Fintype ι] (s : ι → X) : + ReciprocalKernel.OnePositiveSquare (Matrix.of fun i j => if s i = s j then 0 else + (CompactKernel.singularResolvedKernel ν (fun x y => kernel (e x) (e y)) + (kernel_memLp ν e he hd hC hν) (operator ν e he hC hν) (s i) (s j))⁻¹) := by + apply CompactKernel.singular_reciprocal_of_regularization ν (regularized e he hd) + (regularized_pos e he hd) (regularized_symm e he hd) + · intro n ι _ s + exact regularized_onePositiveSquare e he hd n s + · intro x y hxy + exact DiskFormula.green_pos (coordinates e hd x).property (coordinates e hd y).property + (fun h => hxy (hinj (complexIso.symm.injective h))) + · intro n x + filter_upwards [ae_ne ν e he hν x] with z hz + exact regularized_le e he hd hinj n z x hz + · intro x + filter_upwards [ae_ne ν e he hν x] with z hz + exact regularized_tendsto_off e he hd hinj z x hz + · exact regularized_tendsto_off e he hd hinj + · exact regularized_tendsto_diagonal e he hd + · exact operator_ae ν e he hd hC hν + · exact (operator_norm_le ν e he hC hν hd0 hsub).trans_lt hd1 + +end StrictHotSpots.DiskCompact +end +end DiskCompactLayer + +section PlaneResolvedLayer +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ ∞) + (hν : ν ≤ C • volume.restrict disk) + +include hC hν in +lemma column_memLp (x : disk) : MemLp (fun z => kernel z x) 2 ν := by + convert kernel_memLp_weighted hC hν x x.property using 1 + ext z + exact kernel_symm z x + +def row (x : disk) : Lp ℝ 2 ν := (column_memLp hC hν x).toLp (fun z => kernel z x) + +def resolved (x y : disk) : ℝ := kernel x y + inner ℝ (row hC hν x) + (BanachResolvent.resolvent (weightedIntegralOperator hC hν) (row hC hν y)) + +end StrictHotSpots.PlaneGreen +namespace StrictHotSpots.DiskCompact +open PlaneGreen DiskH10 +variable {X : Type} [MetricSpace X] [CompactSpace X] [MeasurableSpace X] [BorelSpace X] + (ν : Measure X) [IsFiniteMeasure ν] + (e : X → Plane) (he : Continuous e) (hd : ∀ x, e x ∈ disk) + {C : ℝ≥0∞} (hC : C ≠ ∞) (hν : Measure.map e ν ≤ C • volume.restrict disk) + +omit [CompactSpace X] [IsFiniteMeasure ν] in +lemma observe_row (x : X) : + MeasureKernelTransfer.observe e (preserving ν e he) (row hC hν ⟨e x,hd x⟩) = + (kernel_memLp ν e he hd hC hν x).toLp (fun z => kernel (e z) (e x)) := rfl + +omit [CompactSpace X] [IsFiniteMeasure ν] in +lemma resolved_eq {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) (x y : X) : + CompactKernel.singularResolvedKernel ν (fun x y => kernel (e x) (e y)) + (kernel_memLp ν e he hd hC hν) (operator ν e he hC hν) x y = + resolved hC hν ⟨e x,hd x⟩ ⟨e y,hd y⟩ := by + unfold CompactKernel.singularResolvedKernel resolved + rw [← observe_row ν e he hd hC hν x, ← observe_row ν e he hd hC hν y] + exact congrArg (fun r : ℝ => kernel (e x) (e y) + r) + (MeasureKernelTransfer.resolvent_inner e (preserving ν e he) _ + ((weightedIntegralOperator_norm_le hC hν hd0 hsub).trans_lt hd1) _ _) + +include he in + + +theorem reciprocal_ambient [Nonempty X] [DecidableEq X] (hinj : Function.Injective e) + {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) {ι : Type} [Fintype ι] (s : ι → X) : + ReciprocalKernel.OnePositiveSquare (Matrix.of fun i j => if s i = s j then 0 else + (resolved hC hν ⟨e (s i),hd (s i)⟩ ⟨e (s j),hd (s j)⟩)⁻¹) := by + have h := reciprocal ν e he hd hC hν hinj hd0 hd1 hsub s + simpa only [resolved_eq ν e he hd hC hν hd0 hd1 hsub] using h + +include he in +lemma reciprocal_ambient_of_map [Nonempty X] [DecidableEq X] (hinj : Function.Injective e) + (μ : Measure Plane) (hmap : Measure.map e ν = μ) (hμ : μ ≤ C • volume.restrict disk) + {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hμ u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) {ι : Type} [Fintype ι] (s : ι → X) : + ReciprocalKernel.OnePositiveSquare (Matrix.of fun i j => if s i = s j then 0 else + (resolved hC hμ ⟨e (s i),hd (s i)⟩ ⟨e (s j),hd (s j)⟩)⁻¹) := by + subst μ + exact reciprocal_ambient ν e he hd hC hμ hinj hd0 hd1 hsub s + +end StrictHotSpots.DiskCompact +end +end PlaneResolvedLayer + +section PlaneCompactSupportLayer +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable (ν : Measure Plane) [IsFiniteMeasure ν] {C : ℝ≥0∞} (hC : C ≠ ∞) + (hν : ν ≤ C • volume.restrict disk) + + + +theorem reciprocal_compact_support (K : Set Plane) (hK : IsCompact K) (hKd : K ⊆ disk) + (hsupp : ν Kᶜ = 0) {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) {ι : Type} [Fintype ι] (s : ι → disk) : + ReciprocalKernel.OnePositiveSquare (Matrix.of fun i j => if s i = s j then 0 else + (resolved hC hν (s i) (s j))⁻¹) := by + classical + let L : Set Plane := insert 0 (K ∪ Set.range (fun i => (s i : Plane))) + have hc : IsCompact L := (hK.union (Set.finite_range _).isCompact).insert 0 + have hLd : L ⊆ disk := by + intro x hx + rcases hx with hx | hx | hx + · rw [hx]; simp [disk] + · exact hKd hx + · rcases hx with ⟨i,rfl⟩; exact (s i).property + have hKL : K ⊆ L := fun x hx => Or.inr (Or.inl hx) + have hm : ∀ᵐ x ∂ν, x ∈ L := by + rw [ae_iff] + exact measure_mono_null (compl_subset_compl.mpr hKL) hsupp + let : CompactSpace L := isCompact_iff_compactSpace.mp hc + let : Nonempty L := ⟨⟨0,Or.inl rfl⟩⟩ + let νL : Measure L := ν.comap Subtype.val + have hmap : Measure.map (Subtype.val : L → Plane) νL = ν := by + rw [map_comap_subtype_coe hc.measurableSet] + exact Measure.restrict_eq_self_of_ae_mem hm + let t : ι → L := fun i => ⟨s i,Or.inr (Or.inr ⟨i,rfl⟩)⟩ + have hp := DiskCompact.reciprocal_ambient_of_map νL Subtype.val continuous_subtype_val + (fun x => hLd x.property) hC Subtype.val_injective ν hmap hν hd0 hd1 hsub t + simpa only [t, Subtype.mk.injEq, Subtype.coe_eta, Subtype.ext_iff] using hp + +end StrictHotSpots.PlaneGreen +end +end PlaneCompactSupportLayer + +section BoundaryRowLayer +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.DiskFormula +variable {X : Type*} [MeasurableSpace X] (ν : Measure X) [IsFiniteMeasure ν] + +lemma poisson_memLp_ae (s : ℂ) (hs : ‖s‖ = 1) (x : X → ℂ) (hm : Measurable x) + {R : ℝ} (hR : ∀ᵐ z ∂ν, ‖x z‖ ≤ R) (hR1 : R < 1) : + MemLp (fun z => poisson s (x z)) 2 ν := by + refine MemLp.of_bound ?_ (1 / (2*Real.pi*(1-R)^2)) ?_ + · apply Measurable.aestronglyMeasurable + unfold poisson + fun_prop + · filter_upwards [hR] with z hz + rw [Real.norm_eq_abs, abs_of_nonneg (poisson_nonneg s (x z) (hz.trans_lt hR1))] + exact poisson_bounded s (x z) hs hz hR1 + +lemma radial_one_memLp_ae (s : ℂ) (hs : ‖s‖ = 1) (x : X → ℂ) (hm : Measurable x) + {R rmin r : ℝ} (hR : ∀ᵐ z ∂ν, ‖x z‖ ≤ R) (hRmin : R < rmin) + (hrmin : rmin ≤ r) (hr : r < 1) : + MemLp (fun z => green (r • s) (x z)/(1-r)) 2 ν := by + refine MemLp.of_bound ?_ ((2/(rmin-R)^2)/(4*Real.pi)) ?_ + · apply Measurable.aestronglyMeasurable + unfold green + fun_prop + · filter_upwards [hR] with z hz + obtain ⟨h0,hb⟩ := radial_one_bounded s (x z) hs hz hRmin hrmin hr + simpa only [Real.norm_eq_abs, abs_of_nonneg h0] using hb + + + +theorem radial_one_L2_ae (s : ℂ) (hs : ‖s‖ = 1) (x : X → ℂ) (hm : Measurable x) + {R rmin : ℝ} (hR : ∀ᵐ z ∂ν, ‖x z‖ ≤ R) (hRmin : R < rmin) (hrmin1 : rmin < 1) + (r : ℕ → ℝ) (hrmin : ∀ n, rmin ≤ r n) (hr : ∀ n, r n < 1) + (hlim : Tendsto r atTop (𝓝 1)) : + Tendsto (fun n => (radial_one_memLp_ae ν s hs x hm hR hRmin (hrmin n) (hr n)).toLp + (fun z => green (r n • s) (x z) / (1-r n))) atTop + (𝓝 ((poisson_memLp_ae ν s hs x hm hR (hRmin.trans hrmin1)).toLp + (fun z => poisson s (x z)))) := by + apply L2Limits.tendsto_toLp_of_dominated + (hb := memLp_const ((2/(rmin-R)^2)/(4*Real.pi))) + · apply Filter.Eventually.of_forall + intro n + filter_upwards [hR] with z hz + obtain ⟨h0,hb⟩ := radial_one_bounded s (x z) hs hz hRmin (hrmin n) (hr n) + simpa only [Real.norm_eq_abs, abs_of_nonneg h0] using hb + · filter_upwards [hR] with z hz + exact (radial_one s (x z) hs (hz.trans_lt (hRmin.trans hrmin1))).comp + (tendsto_nhdsWithin_iff.mpr ⟨hlim, Filter.Eventually.of_forall fun n => hr n⟩) + +end StrictHotSpots.DiskFormula +end +end BoundaryRowLayer + +section KernelPositivityLayer +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.BanachResolvent +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] +lemma symmetric (T : H →L[ℝ] H) (hT : ‖T‖ < 1) + (hsym : ∀ f g, inner ℝ (T f) g = inner ℝ f (T g)) (f g : H) : + inner ℝ (resolvent T f) g = inner ℝ f (resolvent T g) := by + have hf : resolvent T f - T (resolvent T f) = f := + congrArg (fun A : H →L[ℝ] H => A f) (resolvent_left T hT) + have hg : resolvent T g - T (resolvent T g) = g := + congrArg (fun A : H →L[ℝ] H => A g) (resolvent_left T hT) + calc + inner ℝ (resolvent T f) g = + inner ℝ (resolvent T f) (resolvent T g - T (resolvent T g)) := by rw [hg] + _ = inner ℝ (resolvent T f - T (resolvent T f)) (resolvent T g) := by + rw [inner_sub_left, inner_sub_right, hsym] + _ = inner ℝ f (resolvent T g) := by rw [hf] +end StrictHotSpots.BanachResolvent + +namespace StrictHotSpots.L2Limits +lemma inner_nonneg {X : Type*} [MeasurableSpace X] {ν : Measure X} + {f g : Lp ℝ 2 ν} (hf : 0 ≤ f) (hg : 0 ≤ g) : 0 ≤ inner ℝ f g := by + rw [L2.inner_def] + apply integral_nonneg_of_ae + filter_upwards [(Lp.coeFn_nonneg f).mpr hf, (Lp.coeFn_nonneg g).mpr hg] with x hx hy + exact mul_nonneg hy hx +end StrictHotSpots.L2Limits + +namespace StrictHotSpots.PlaneGreen +open DiskH10 +lemma kernel_nonneg {x y : Plane} (hx : x ∈ disk) (hy : y ∈ disk) : 0 ≤ kernel x y := by + by_cases he : x = y + · subst y + simp [kernel, DiskFormula.green] + · exact (DiskFormula.green_pos (by simpa [disk] using hx) + (by simpa [disk] using hy) (fun h => he (complexIso.symm.injective h))).le + +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ ∞) + (hν : ν ≤ C • volume.restrict disk) + +include hν in +lemma ae_mem_disk : ∀ᵐ x ∂ν, x ∈ disk := + (ae_restrict_mem diskOpen.measurableSet).filter_mono + (Measure.absolutelyContinuous_of_le_smul hν).ae_le + +lemma row_nonneg (x : disk) : 0 ≤ row hC hν x := by + apply (Lp.coeFn_nonneg _).mp + filter_upwards [(column_memLp hC hν x).coeFn_toLp, ae_mem_disk hν] with z hz hzd + rw [show row hC hν x z = kernel z x from hz] + exact kernel_nonneg hzd x.property + +lemma weightedIntegralOperator_order_nonneg (f : Lp ℝ 2 ν) (hf : 0 ≤ f) : + 0 ≤ weightedIntegralOperator hC hν f := by + apply (Lp.coeFn_nonneg _).mp + filter_upwards [weightedIntegralOperator_ae hC hν f, ae_mem_disk hν] with x hx hxd + rw [hx] + apply integral_nonneg_of_ae + filter_upwards [(Lp.coeFn_nonneg f).mpr hf, ae_mem_disk hν] with y hy hyd + exact mul_nonneg (kernel_nonneg hxd hyd) hy + +lemma resolved_ge (hn : ‖weightedIntegralOperator hC hν‖ < 1) (x y : disk) : + kernel x y ≤ resolved hC hν x y := by + apply le_add_of_nonneg_right + apply L2Limits.inner_nonneg (row_nonneg hC hν x) + exact BanachResolvent.resolvent_nonneg _ hn (weightedIntegralOperator_order_nonneg hC hν) + (row_nonneg hC hν y) + +lemma resolved_symm (hn : ‖weightedIntegralOperator hC hν‖ < 1) (x y : disk) : + resolved hC hν x y = resolved hC hν y x := by + unfold resolved + rw [kernel_symm] + congr 1 + calc + inner ℝ (row hC hν x) (BanachResolvent.resolvent _ (row hC hν y)) = + inner ℝ (BanachResolvent.resolvent _ (row hC hν y)) (row hC hν x) := + real_inner_comm _ _ + _ = _ := BanachResolvent.symmetric _ hn (weightedIntegralOperator_symmetric hC hν) _ _ + +end StrictHotSpots.PlaneGreen +end +end KernelPositivityLayer + +section PlaneBoundaryLayer +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +abbrev Boundary := {s : Plane // ‖s‖ = 1} + +def poisson (s : Boundary) (x : Plane) : ℝ := + DiskFormula.poisson (complexIso.symm s) (complexIso.symm x) + +def boundaryInteraction (s t : Boundary) : ℝ := + DiskFormula.boundaryInteraction (complexIso.symm s) (complexIso.symm t) + +def radial (s : Boundary) (r : ℝ) (hr0 : 0 ≤ r) (hr1 : r < 1) : disk := + ⟨r • (s : Plane), by simpa [disk, norm_smul, Real.norm_eq_abs, abs_of_nonneg hr0, + s.property] using hr1⟩ + +lemma poisson_nonneg (s : Boundary) (x : disk) : 0 ≤ poisson s x := + DiskFormula.poisson_nonneg _ _ (by simpa [disk] using x.property) + +lemma poisson_pos (s : Boundary) (x : disk) : 0 < poisson s x := by + have hx : ‖(x : Plane)‖ < 1 := by simpa [disk] using x.property + have hne : complexIso.symm (s : Plane) - complexIso.symm (x : Plane) ≠ 0 := by + intro h + have he := complexIso.symm.injective (sub_eq_zero.mp h) + have hh := s.property + rw [he] at hh + linarith + unfold poisson DiskFormula.poisson + apply div_pos + · simp only [LinearIsometryEquiv.norm_map] + nlinarith [norm_nonneg (x : Plane)] + · exact mul_pos (mul_pos (by norm_num) Real.pi_pos) (sq_pos_of_ne_zero (norm_ne_zero_iff.mpr hne)) + +lemma boundaryInteraction_pos (s t : Boundary) (hst : s ≠ t) : 0 < boundaryInteraction s t := by + unfold boundaryInteraction DiskFormula.boundaryInteraction + apply one_div_pos.mpr + apply mul_pos Real.pi_pos + exact sq_pos_of_ne_zero (norm_ne_zero_iff.mpr (sub_ne_zero.mpr + (fun h => hst (Subtype.ext (complexIso.symm.injective h))))) + +variable {ν : Measure Plane} [IsFiniteMeasure ν] {R : ℝ} + (hR : ∀ᵐ x ∂ν, ‖x‖ ≤ R) (hR1 : R < 1) + +include hR hR1 in +lemma poisson_memLp (s : Boundary) : MemLp (poisson s) 2 ν := by + exact DiskFormula.poisson_memLp_ae ν (complexIso.symm s) (by simpa using s.property) complexIso.symm + complexIso.symm.continuous.measurable (by simpa using hR) hR1 + +def poissonRow (s : Boundary) : Lp ℝ 2 ν := (poisson_memLp hR hR1 s).toLp (poisson s) + +lemma poissonRow_nonneg (s : Boundary) : 0 ≤ poissonRow hR hR1 s := by + apply (Lp.coeFn_nonneg _).mp + filter_upwards [(poisson_memLp hR hR1 s).coeFn_toLp, hR] with x hx hr + rw [show poissonRow hR hR1 s x = poisson s x from hx] + exact DiskFormula.poisson_nonneg _ _ (by simpa using hr.trans_lt hR1) + +variable {C : ℝ≥0∞} (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +def boundaryK (p : disk) (s : Boundary) : ℝ := poisson s p + + inner ℝ (row hC hν p) (BanachResolvent.resolvent (weightedIntegralOperator hC hν) + (poissonRow hR hR1 s)) + +def boundaryN (s t : Boundary) : ℝ := boundaryInteraction s t + + inner ℝ (poissonRow hR hR1 s) (BanachResolvent.resolvent (weightedIntegralOperator hC hν) + (poissonRow hR hR1 t)) + +lemma boundaryK_pos (hn : ‖weightedIntegralOperator hC hν‖ < 1) (p : disk) (s : Boundary) : + 0 < boundaryK hR hR1 hC hν p s := by + apply add_pos_of_pos_of_nonneg (poisson_pos s p) + apply L2Limits.inner_nonneg (row_nonneg hC hν p) + exact BanachResolvent.resolvent_nonneg _ hn (weightedIntegralOperator_order_nonneg hC hν) + (poissonRow_nonneg hR hR1 s) + +lemma boundaryN_pos (hn : ‖weightedIntegralOperator hC hν‖ < 1) (s t : Boundary) (hst : s ≠ t) : + 0 < boundaryN hR hR1 hC hν s t := by + apply add_pos_of_pos_of_nonneg (boundaryInteraction_pos s t hst) + apply L2Limits.inner_nonneg (poissonRow_nonneg hR hR1 s) + exact BanachResolvent.resolvent_nonneg _ hn (weightedIntegralOperator_order_nonneg hC hν) + (poissonRow_nonneg hR hR1 t) + +lemma scaled_row_eq (s : Boundary) {rmin r : ℝ} (hRmin : R < rmin) + (hrmin : rmin ≤ r) (hr0 : 0 ≤ r) (hr1 : r < 1) : + (1-r)⁻¹ • row hC hν (radial s r hr0 hr1) = + (DiskFormula.radial_one_memLp_ae ν (complexIso.symm s) (by simpa using s.property) complexIso.symm + complexIso.symm.continuous.measurable (by simpa using hR) hRmin hrmin hr1).toLp + (fun z => DiskFormula.green (r • complexIso.symm s) (complexIso.symm z)/(1-r)) := by + apply Lp.ext + filter_upwards [Lp.coeFn_smul (1-r)⁻¹ (row hC hν (radial s r hr0 hr1)), + (column_memLp hC hν (radial s r hr0 hr1)).coeFn_toLp, + (DiskFormula.radial_one_memLp_ae ν (complexIso.symm s) (by simpa using s.property) complexIso.symm + complexIso.symm.continuous.measurable (by simpa using hR) hRmin hrmin hr1).coeFn_toLp] + with z hz hg ht + rw [hz] + simp only [Pi.smul_apply] + rw [show row hC hν (radial s r hr0 hr1) z = kernel z (radial s r hr0 hr1) from hg, ht, + kernel_symm] + simp only [kernel, radial, LinearIsometryEquiv.map_smul, smul_eq_mul, div_eq_mul_inv] + ring + +omit hR1 in +lemma scaled_row_tendsto (s : Boundary) {rmin : ℝ} (hRmin : R < rmin) (hrmin1 : rmin < 1) + (r : ℕ → ℝ) (hrmin : ∀ n, rmin ≤ r n) (hr0 : ∀ n, 0 ≤ r n) (hr1 : ∀ n, r n < 1) + (hlim : Tendsto r atTop (𝓝 1)) : + Tendsto (fun n => (1-r n)⁻¹ • row hC hν (radial s (r n) (hr0 n) (hr1 n))) atTop + (𝓝 (poissonRow hR (hRmin.trans hrmin1) s)) := by + have hh := DiskFormula.radial_one_L2_ae ν (complexIso.symm s) (by simpa using s.property) complexIso.symm + complexIso.symm.continuous.measurable (by simpa using hR) hRmin hrmin1 r hrmin hr1 hlim + convert hh using 1 + · funext n + exact scaled_row_eq hR hC hν s hRmin (hrmin n) (hr0 n) (hr1 n) + · rfl + +omit [IsFiniteMeasure ν] in +lemma resolved_radial_one_eq (p : disk) (s : Boundary) (r : ℝ) (hr0 : 0 ≤ r) (hr1 : r < 1) : + resolved hC hν p (radial s r hr0 hr1) / (1-r) = kernel p (radial s r hr0 hr1)/(1-r) + + inner ℝ (row hC hν p) (BanachResolvent.resolvent (weightedIntegralOperator hC hν) + ((1-r)⁻¹ • row hC hν (radial s r hr0 hr1))) := by + simp only [resolved, map_smul, real_inner_smul_right, div_eq_mul_inv] + ring + +omit [IsFiniteMeasure ν] in +lemma resolved_radial_two_eq (s t : Boundary) (r : ℝ) (hr0 : 0 ≤ r) (hr1 : r < 1) : + resolved hC hν (radial s r hr0 hr1) (radial t r hr0 hr1) / (1-r)^2 = + kernel (radial s r hr0 hr1) (radial t r hr0 hr1)/(1-r)^2 + + inner ℝ ((1-r)⁻¹ • row hC hν (radial s r hr0 hr1)) + (BanachResolvent.resolvent (weightedIntegralOperator hC hν) + ((1-r)⁻¹ • row hC hν (radial t r hr0 hr1))) := by + simp only [resolved, map_smul, real_inner_smul_left, real_inner_smul_right, + div_eq_mul_inv, ← inv_pow] + ring + +lemma resolved_radial_one_tendsto (p : disk) (s : Boundary) {rmin : ℝ} + (hRmin : R < rmin) (hrmin1 : rmin < 1) + (r : ℕ → ℝ) (hrmin : ∀ n, rmin ≤ r n) (hr0 : ∀ n, 0 ≤ r n) (hr1 : ∀ n, r n < 1) + (hlim : Tendsto r atTop (𝓝 1)) : + Tendsto (fun n => resolved hC hν p (radial s (r n) (hr0 n) (hr1 n)) / (1-r n)) + atTop (𝓝 (boundaryK hR hR1 hC hν p s)) := by + have hl : Tendsto r atTop (𝓝[<] 1) := tendsto_nhdsWithin_iff.mpr + ⟨hlim, Filter.Eventually.of_forall hr1⟩ + have hp := (DiskFormula.radial_one (complexIso.symm s) (complexIso.symm p) + (by simpa using s.property) (by simpa [disk] using p.property)).comp hl + have hs := scaled_row_tendsto hR hC hν s hRmin hrmin1 r hrmin hr0 hr1 hlim + have hi : Continuous (fun f : Lp ℝ 2 ν => inner ℝ (row hC hν p) + (BanachResolvent.resolvent (weightedIntegralOperator hC hν) f)) := + continuous_const.inner ((BanachResolvent.resolvent (weightedIntegralOperator hC hν)).continuous) + have ht := (hi.tendsto (poissonRow hR hR1 s)).comp hs + convert hp.add ht using 1 + · funext n + rw [resolved_radial_one_eq] + congr 1 + rw [kernel_symm] + simp only [kernel,radial,LinearIsometryEquiv.map_smul,Function.comp_apply] + · rfl + +lemma resolved_radial_two_tendsto (s t : Boundary) (hst : s ≠ t) {rmin : ℝ} + (hRmin : R < rmin) (hrmin1 : rmin < 1) + (r : ℕ → ℝ) (hrmin : ∀ n, rmin ≤ r n) (hr0 : ∀ n, 0 ≤ r n) (hr1 : ∀ n, r n < 1) + (hlim : Tendsto r atTop (𝓝 1)) : + Tendsto (fun n => resolved hC hν (radial s (r n) (hr0 n) (hr1 n)) + (radial t (r n) (hr0 n) (hr1 n)) / (1-r n)^2) + atTop (𝓝 (boundaryN hR hR1 hC hν s t)) := by + have hl : Tendsto r atTop (𝓝[<] 1) := tendsto_nhdsWithin_iff.mpr + ⟨hlim, Filter.Eventually.of_forall hr1⟩ + have hp := (DiskFormula.radial_two (complexIso.symm s) (complexIso.symm t) + (by simpa using s.property) (by simpa using t.property) + (fun h => hst (Subtype.ext (complexIso.symm.injective h)))).comp hl + have hs := scaled_row_tendsto hR hC hν s hRmin hrmin1 r hrmin hr0 hr1 hlim + have ht := scaled_row_tendsto hR hC hν t hRmin hrmin1 r hrmin hr0 hr1 hlim + have hi := hs.inner (𝕜 := ℝ) ((BanachResolvent.resolvent (weightedIntegralOperator hC hν)).continuous.tendsto + (poissonRow hR hR1 t) |>.comp ht) + convert hp.add hi using 1 + · funext n + rw [resolved_radial_two_eq] + simp only [kernel,radial,LinearIsometryEquiv.map_smul,Function.comp_apply] + · rfl + +end StrictHotSpots.PlaneGreen +end +end PlaneBoundaryLayer + +section BoundaryReciprocalLayer +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {R : ℝ} + (hR : ∀ᵐ x ∂ν, ‖x‖ ≤ R) (hR1 : R < 1) + {C : ℝ≥0∞} (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +lemma radial_injective {r : ℝ} (hr : 0 < r) (hr1 : r < 1) : + Function.Injective (fun s : Boundary => radial s r hr.le hr1) := by + intro s t h + apply Subtype.ext + have he : r • (s : Plane) = r • (t : Plane) := congrArg Subtype.val h + exact (smul_right_injective _ hr.ne') he + +lemma radial_ne_anchor (p : disk) (s : Boundary) {r : ℝ} (hr : ‖(p : Plane)‖ < r) + (hr1 : r < 1) : radial s r (norm_nonneg _ |>.trans hr.le) hr1 ≠ p := by + intro h + have he := congrArg (fun x : disk => ‖(x : Plane)‖) h + simp only [radial, norm_smul, Real.norm_eq_abs, abs_of_nonneg + (norm_nonneg _ |>.trans hr.le), s.property, mul_one] at he + exact hr.ne' he + + + +theorem boundary_reciprocal_compact_support (K : Set Plane) (hK : IsCompact K) + (hKd : K ⊆ disk) (hsupp : ν Kᶜ = 0) {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) (p : disk) + {ι : Type} [Fintype ι] (s : ι → Boundary) : + ReciprocalKernel.OnePositiveSquare (ReciprocalKernel.bordered + (Matrix.of fun i j => if s i = s j then 0 else (boundaryN hR hR1 hC hν (s i) (s j))⁻¹) + (fun i => (boundaryK hR hR1 hC hν p (s i))⁻¹)) := by + classical + have hp : ‖(p : Plane)‖ < 1 := by simpa [disk] using p.property + obtain ⟨rmin,hm,hm1⟩ := exists_between (max_lt hR1 hp) + have hRm : R < rmin := lt_of_le_of_lt (le_max_left _ _) hm + have hpm : ‖(p : Plane)‖ < rmin := lt_of_le_of_lt (le_max_right _ _) hm + have hm0 : 0 < rmin := (norm_nonneg _).trans_lt hpm + obtain ⟨r,_,hr,hlim⟩ := exists_seq_strictMono_tendsto' hm1 + have hr0 n : 0 < r n := hm0.trans (hr n).1 + have hr1 n : r n < 1 := (hr n).2 + have hrp n : ‖(p : Plane)‖ < r n := hpm.trans (hr n).1 + let a (n : ℕ) : ι ⊕ Unit → disk := Sum.elim (fun i => radial (s i) (r n) (hr0 n).le (hr1 n)) + (fun _ => p) + let l (n : ℕ) : ι ⊕ Unit → ℝ := Sum.elim (fun _ => 1-r n) (fun _ => 1) + let A (n : ℕ) : Matrix (ι ⊕ Unit) (ι ⊕ Unit) ℝ := Matrix.of fun i j => + l n i * (if a n i = a n j then 0 else (resolved hC hν (a n i) (a n j))⁻¹) * l n j + have hA n : ReciprocalKernel.OnePositiveSquare (A n) := + ReciprocalKernel.onePositiveSquare_scale + (reciprocal_compact_support ν hC hν K hK hKd hsupp hd0 hd1 hsub (a n)) (l n) + have hn : ‖weightedIntegralOperator hC hν‖ < 1 := + (weightedIntegralOperator_norm_le hC hν hd0 hsub).trans_lt hd1 + apply ReciprocalKernel.onePositiveSquare_of_entrywise_tendsto hA + intro i j + rcases i with i | i <;> rcases j with j | j + · by_cases he : s i = s j + · simp [A,l,a,ReciprocalKernel.bordered,he] + · have hne n : a n (Sum.inl i) ≠ a n (Sum.inl j) := + fun h => he (radial_injective (hr0 n) (hr1 n) h) + have hl := (resolved_radial_two_tendsto hR hR1 hC hν (s i) (s j) he hRm hm1 + r (fun n => (hr n).1.le) (fun n => (hr0 n).le) hr1 hlim).inv₀ + (boundaryN_pos hR hR1 hC hν hn (s i) (s j) he).ne' + convert hl using 1 + · funext n + change l n _ * (if a n _ = a n _ then 0 else _) * l n _ = _ + rw [ite_eq_right (hne n)] + simp only [l, Sum.elim_inl, a, div_eq_mul_inv, mul_inv_rev, inv_inv] + ring + · simp [ReciprocalKernel.bordered,he] + · have hne n : a n (Sum.inl i) ≠ a n (Sum.inr j) := + radial_ne_anchor p (s i) (hrp n) (hr1 n) + have hl := (resolved_radial_one_tendsto hR hR1 hC hν p (s i) hRm hm1 + r (fun n => (hr n).1.le) (fun n => (hr0 n).le) hr1 hlim).inv₀ + (boundaryK_pos hR hR1 hC hν hn p (s i)).ne' + convert hl using 1 + · funext n + change l n _ * (if a n _ = a n _ then 0 else _) * l n _ = _ + rw [ite_eq_right (hne n)] + simp only [l, Sum.elim_inl, Sum.elim_inr, a, div_eq_mul_inv, mul_inv_rev, inv_inv, mul_one] + rw [resolved_symm hC hν hn] + · simp [ReciprocalKernel.bordered] + · have hne n : a n (Sum.inr i) ≠ a n (Sum.inl j) := + (radial_ne_anchor p (s j) (hrp n) (hr1 n)).symm + have hl := (resolved_radial_one_tendsto hR hR1 hC hν p (s j) hRm hm1 + r (fun n => (hr n).1.le) (fun n => (hr0 n).le) hr1 hlim).inv₀ + (boundaryK_pos hR hR1 hC hν hn p (s j)).ne' + convert hl using 1 + · funext n + change l n _ * (if a n _ = a n _ then 0 else _) * l n _ = _ + rw [ite_eq_right (hne n)] + simp only [l, Sum.elim_inl, Sum.elim_inr, a, div_eq_mul_inv, mul_inv_rev, inv_inv, one_mul] + ring + · simp [ReciprocalKernel.bordered] + · simp [A,l,a,ReciprocalKernel.bordered] + + +def distanceKernel (p : disk) (s t : Boundary) : ℝ := + if s = t then 0 else boundaryK hR hR1 hC hν p s * boundaryK hR hR1 hC hν p t / + boundaryN hR hR1 hC hν s t + +theorem negative_kernel_compact_support (K : Set Plane) (hK : IsCompact K) + (hKd : K ⊆ disk) (hsupp : ν Kᶜ = 0) {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) (p : disk) + {ι : Type} [Fintype ι] (s : ι → Boundary) : + ReciprocalKernel.ConditionallyNegative (Matrix.of fun i j => + distanceKernel hR hR1 hC hν p (s i) (s j)) := by + classical + have hn : ‖weightedIntegralOperator hC hν‖ < 1 := + (weightedIntegralOperator_norm_le hC hν hd0 hsub).trans_lt hd1 + have h := ReciprocalKernel.conditionalNegative_scaled_of_bordered + (fun i => boundaryK hR hR1 hC hν p (s i)) + (fun i => (boundaryK_pos hR hR1 hC hν hn p (s i)).ne') + (boundary_reciprocal_compact_support hR hR1 hC hν K hK hKd hsupp hd0 hd1 hsub p s) + convert h using 1 + ext i j + by_cases he : s i = s j + · simp [distanceKernel,he] + · simp only [distanceKernel,he,ite_false,Matrix.of_apply,div_eq_mul_inv] + ring + +end StrictHotSpots.PlaneGreen +end +end BoundaryReciprocalLayer + +section BoundarySmoothingLayer +noncomputable section +open MeasureTheory Filter Metric Set +open scoped ENNReal Topology +namespace StrictHotSpots.GreenLp + +lemma shifted_logPole_norm_bound_three (x : ℂ) (hx : ‖x‖ < 1) : + eLpNorm (fun y => logPole (x-y)) 3 (volume.restrict (ball 0 1)) ≤ + eLpNorm logPole 3 (volume.restrict (ball (0 : ℂ) 2)) := by + have hm := (measurePreserving_sub_right (volume : Measure ℂ) x).restrict_preimage + (show MeasurableSet (ball (0 : ℂ) 2) from measurableSet_ball) + have hs : ball (0 : ℂ) 1 ⊆ (fun y => y-x) ⁻¹' ball 0 2 := by + intro y hy + have hy' : ‖y‖ < 1 := by simpa using hy + have hd := norm_sub_le y x + change y-x ∈ ball (0 : ℂ) 2 + rw [mem_ball_zero_iff] + linarith + calc + _ = eLpNorm (logPole ∘ fun y => y-x) 3 (volume.restrict (ball 0 1)) := by + congr 1 + funext y + simp only [Function.comp_apply, logPole, norm_sub_rev x y] + _ ≤ eLpNorm (logPole ∘ fun y => y-x) 3 + (volume.restrict ((fun y => y-x) ⁻¹' ball 0 2)) := + eLpNorm_mono_measure _ (Measure.restrict_mono hs le_rfl) + _ = _ := eLpNorm_comp_measurePreserving logPole_memLp_three.aestronglyMeasurable hm + +lemma invnorm_memLp_three_halves : MemLp (fun z : ℂ => ‖z‖⁻¹) (3/2) + (volume.restrict (ball (0 : ℂ) 2)) := by + have hm : Measurable (fun z : ℂ => ‖z‖⁻¹) := by fun_prop + apply (integrable_norm_rpow_iff hm.aestronglyMeasurable + (by norm_num : (3/2 : ℝ≥0∞) ≠ 0) (ENNReal.div_ne_top (by norm_num) (by norm_num) : (3/2 : ℝ≥0∞) ≠ ∞)).1 + apply integrableOn_ball_of_norm_le_rpow (C := 1) (α := 3/2) + (by norm_num : 1 ≤ Module.finrank ℝ ℂ) (by norm_num : (3/2:ℝ) < Module.finrank ℝ ℂ) + · filter_upwards [] with z + simp only [ENNReal.toReal_div, ENNReal.toReal_ofNat, Real.norm_of_nonneg (inv_nonneg.mpr (norm_nonneg z)), + Real.inv_rpow (norm_nonneg z), Real.rpow_neg (norm_nonneg z), one_mul] + rw [Real.norm_of_nonneg (by positivity)] + · exact (hm.norm.pow_const _).aestronglyMeasurable + +lemma shifted_invnorm_memLp_bound (s : ℂ) (hs : ‖s‖ = 1) : + MemLp (fun y => ‖s-y‖⁻¹) (3/2) (volume.restrict (ball 0 1)) ∧ + eLpNorm (fun y => ‖s-y‖⁻¹) (3/2) (volume.restrict (ball 0 1)) ≤ + eLpNorm (fun z : ℂ => ‖z‖⁻¹) (3/2) (volume.restrict (ball (0 : ℂ) 2)) := by + have hm := (measurePreserving_sub_right (volume : Measure ℂ) s).restrict_preimage + (show MeasurableSet (ball (0 : ℂ) 2) from measurableSet_ball) + have he : (fun y : ℂ => ‖s-y‖⁻¹) = (fun z : ℂ => ‖z‖⁻¹) ∘ (fun y => y-s) := by + funext y + simp only [Function.comp_apply,norm_sub_rev s y] + have hsub : ball (0 : ℂ) 1 ⊆ (fun y => y-s) ⁻¹' ball 0 2 := by + intro y hy + have hy' : ‖y‖ < 1 := by simpa using hy + have hd := norm_sub_le y s + change y-s ∈ ball (0 : ℂ) 2 + rw [mem_ball_zero_iff] + rw [hs] at hd + linarith + rw [he] + refine ⟨(invnorm_memLp_three_halves.comp_measurePreserving hm).mono_measure + (Measure.restrict_mono hsub le_rfl), ?_⟩ + exact (eLpNorm_mono_measure _ (Measure.restrict_mono hsub le_rfl)).trans_eq + (eLpNorm_comp_measurePreserving invnorm_memLp_three_halves.aestronglyMeasurable hm) + +end StrictHotSpots.GreenLp +namespace StrictHotSpots.DiskFormula +open GreenLp + +lemma green_uniform_L3_bound : ∃ B : ℝ≥0∞, B ≠ ∞ ∧ ∀ x : ℂ, ‖x‖ < 1 → + eLpNorm (green x) 3 (volume.restrict (ball 0 1)) ≤ B := by + let C := ENNReal.ofReal (4*Real.pi)⁻¹ * + eLpNorm logPole 3 (volume.restrict (ball (0 : ℂ) 2)) + refine ⟨C, ENNReal.mul_ne_top ENNReal.ofReal_ne_top logPole_memLp_three.eLpNorm_ne_top, + fun x hx => ?_⟩ + calc + _ ≤ ENNReal.ofReal (4*Real.pi)⁻¹ * + eLpNorm (fun y => logPole (x-y)) 3 (volume.restrict (ball 0 1)) := by + apply eLpNorm_le_mul_eLpNorm_of_ae_le_mul + (measurable_green_left x).aestronglyMeasurable + filter_upwards [ae_restrict_mem measurableSet_ball] with y hy + have hy' : ‖y‖ ≤ 1 := (by simpa using hy : ‖y‖ < 1).le + have hh := green_bounds hx.le hy' + rw [Real.norm_of_nonneg hh.1, Real.norm_of_nonneg (logPole_nonneg _)] + simpa only [div_eq_mul_inv, mul_comm] using hh.2 + _ ≤ C := by + dsimp [C] + gcongr + exact shifted_logPole_norm_bound_three x hx + +lemma poisson_invnorm_bound (s x : ℂ) (hs : ‖s‖ = 1) (hx : ‖x‖ < 1) : + poisson s x ≤ Real.pi⁻¹ * ‖s-x‖⁻¹ := by + have hn : 0 < ‖s-x‖ := norm_pos_iff.mpr (sub_ne_zero.mpr (fun h => by + rw [← h,hs] at hx; exact lt_irrefl _ hx)) + have hd : 1-‖x‖ ≤ ‖s-x‖ := by + have ht := norm_le_norm_sub_add s x + rw [hs] at ht + linarith + have hnum : 1-‖x‖^2 ≤ 2*‖s-x‖ := by + nlinarith [norm_nonneg x] + unfold poisson + apply (div_le_iff₀ (mul_pos (mul_pos (by norm_num) Real.pi_pos) (sq_pos_of_pos hn))).2 + calc + _ ≤ 2*‖s-x‖ := hnum + _ = Real.pi⁻¹ * ‖s-x‖⁻¹ * (2*Real.pi*‖s-x‖^2) := by + field_simp + +lemma poisson_memLp_three_halves (s : ℂ) (hs : ‖s‖ = 1) : + MemLp (poisson s) (3/2) (volume.restrict (ball 0 1)) := by + apply ((shifted_invnorm_memLp_bound s hs).1.const_mul Real.pi⁻¹).mono + (by + have hm : Measurable (poisson s) := by unfold poisson; fun_prop + exact hm.aestronglyMeasurable) + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + have hx' : ‖x‖ < 1 := by simpa using hx + simpa only [Real.norm_of_nonneg (poisson_nonneg s x hx'), + Real.norm_of_nonneg (mul_nonneg (inv_nonneg.mpr Real.pi_pos.le) + (inv_nonneg.mpr (norm_nonneg _)))] using poisson_invnorm_bound s x hs hx' + +lemma poisson_uniform_L32_bound : ∃ B : ℝ≥0∞, B ≠ ∞ ∧ ∀ s : ℂ, ‖s‖ = 1 → + eLpNorm (poisson s) (3/2) (volume.restrict (ball 0 1)) ≤ B := by + let C := ENNReal.ofReal Real.pi⁻¹ * + eLpNorm (fun z : ℂ => ‖z‖⁻¹) (3/2) (volume.restrict (ball (0 : ℂ) 2)) + refine ⟨C, ENNReal.mul_ne_top ENNReal.ofReal_ne_top + invnorm_memLp_three_halves.eLpNorm_ne_top, fun s hs => ?_⟩ + calc + _ ≤ ENNReal.ofReal Real.pi⁻¹ * + eLpNorm (fun x => ‖s-x‖⁻¹) (3/2) (volume.restrict (ball 0 1)) := by + apply eLpNorm_le_mul_eLpNorm_of_ae_le_mul + (show Measurable (poisson s) by unfold poisson; fun_prop).aestronglyMeasurable + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + have hx' : ‖x‖ < 1 := by simpa using hx + simpa only [Real.norm_of_nonneg (poisson_nonneg s x hx'), + Real.norm_of_nonneg (inv_nonneg.mpr (norm_nonneg _))] using + poisson_invnorm_bound s x hs hx' + _ ≤ C := mul_le_mul' le_rfl (shifted_invnorm_memLp_bound s hs).2 + +end StrictHotSpots.DiskFormula +end +end BoundarySmoothingLayer +section FullBoundarySmoothingLayer +noncomputable section +open MeasureTheory Filter Set Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 + +local instance holder_three_three_halves : ENNReal.HolderTriple 3 (3/2) 1 := by + rw [ENNReal.holderTriple_iff] + apply (ENNReal.toReal_eq_toReal_iff' (by simp) (by norm_num)).mp + norm_num [ENNReal.toReal_add, ENNReal.toReal_inv, ENNReal.toReal_div] + +lemma kernel_memLp_three (x : Plane) (hx : x ∈ disk) : + MemLp (kernel x) 3 (volume.restrict disk) := by + exact (DiskFormula.green_memLp_three _ (by simpa [disk] using hx)).comp_measurePreserving + complexIso_disk_preserving + +lemma poisson_memLp_three_halves (s : Boundary) : + MemLp (poisson s) (3/2) (volume.restrict disk) := + (DiskFormula.poisson_memLp_three_halves _ (by simpa using s.property)).comp_measurePreserving + complexIso_disk_preserving + +lemma kernel_uniform_three_bound : ∃ B : ℝ≥0∞, B ≠ ∞ ∧ ∀ x ∈ disk, + eLpNorm (kernel x) 3 (volume.restrict disk) ≤ B := by + obtain ⟨B,hB,h⟩ := DiskFormula.green_uniform_L3_bound + refine ⟨B,hB,fun x hx => ?_⟩ + change eLpNorm (DiskFormula.green (complexIso.symm x) ∘ complexIso.symm) 3 _ ≤ B + rw [eLpNorm_comp_measurePreserving + (DiskFormula.green_memLp_three _ (by simpa [disk] using hx)).aestronglyMeasurable + complexIso_disk_preserving] + exact h _ (by simpa [disk] using hx) + +lemma poisson_uniform_three_halves_bound : ∃ B : ℝ≥0∞, B ≠ ∞ ∧ ∀ s : Boundary, + eLpNorm (poisson s) (3/2) (volume.restrict disk) ≤ B := by + obtain ⟨B,hB,h⟩ := DiskFormula.poisson_uniform_L32_bound + refine ⟨B,hB,fun s => ?_⟩ + change eLpNorm (DiskFormula.poisson (complexIso.symm s) ∘ complexIso.symm) (3/2) _ ≤ B + rw [eLpNorm_comp_measurePreserving + (DiskFormula.poisson_memLp_three_halves _ (by simpa using s.property)).aestronglyMeasurable + complexIso_disk_preserving] + exact h _ (by simpa using s.property) + +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ ∞) + (hν : ν ≤ C • volume.restrict disk) + +include hC hν in +lemma kernel_memLp_three_weighted (x : Plane) (hx : x ∈ disk) : MemLp (kernel x) 3 ν := + (kernel_memLp_three x hx).of_measure_le_smul hC hν + +include hC hν in +lemma poisson_memLp_three_halves_weighted (s : Boundary) : MemLp (poisson s) (3/2) ν := + (poisson_memLp_three_halves s).of_measure_le_smul hC hν + +include hC hν in +lemma product_green_poisson_integrable (x : Plane) (hx : x ∈ disk) (s : Boundary) : + Integrable (fun y => kernel x y * poisson s y) ν := + (kernel_memLp_three_weighted hC hν x hx).integrable_mul + (poisson_memLp_three_halves_weighted hC hν s) + +include hC hν in +lemma kernel_uniform_three_bound_weighted : ∃ B : ℝ≥0∞, B ≠ ∞ ∧ ∀ x ∈ disk, + eLpNorm (kernel x) 3 ν ≤ B := by + obtain ⟨B,hB,h⟩ := kernel_uniform_three_bound + refine ⟨C ^ (1/(3:ℝ≥0∞)).toReal * B, ENNReal.mul_ne_top + (ENNReal.rpow_ne_top_of_nonneg ENNReal.toReal_nonneg hC) hB, + fun x hx => ?_⟩ + exact (eLpNorm_le_of_measure_le_smul hν).trans (mul_le_mul' le_rfl (h x hx)) + +include hC hν in +lemma poisson_uniform_three_halves_bound_weighted : ∃ B : ℝ≥0∞, B ≠ ∞ ∧ ∀ s : Boundary, + eLpNorm (poisson s) (3/2) ν ≤ B := by + obtain ⟨B,hB,h⟩ := poisson_uniform_three_halves_bound + refine ⟨C ^ (1/(3/2:ℝ≥0∞)).toReal * B, ENNReal.mul_ne_top + (ENNReal.rpow_ne_top_of_nonneg ENNReal.toReal_nonneg hC) hB, + fun s => ?_⟩ + exact (eLpNorm_le_of_measure_le_smul hν).trans (mul_le_mul' le_rfl (h s)) + +include hC hν in +lemma green_poisson_uniform_bound : ∃ B : ℝ, 0 ≤ B ∧ ∀ x ∈ disk, ∀ s : Boundary, + ‖∫ y, kernel x y * poisson s y ∂ν‖ ≤ B := by + obtain ⟨B,hB,h⟩ := kernel_uniform_three_bound_weighted hC hν + obtain ⟨D,hD,hp⟩ := poisson_uniform_three_halves_bound_weighted hC hν + refine ⟨(B*D).toReal, ENNReal.toReal_nonneg, fun x hx s => ?_⟩ + have hg := kernel_memLp_three_weighted hC hν x hx + have hs := poisson_memLp_three_halves_weighted hC hν s + have he : eLpNorm (fun y => kernel x y * poisson s y) 1 ν ≤ B*D := by + exact (eLpNorm_smul_le_mul_eLpNorm hg.aestronglyMeasurable hs.aestronglyMeasurable).trans + (mul_le_mul' (h x hx) (hp s)) + have hh := (enorm_integral_le_lintegral_enorm (fun y => kernel x y * poisson s y)).trans + (((eLpNorm_one_eq_lintegral_enorm + (hg.aestronglyMeasurable.mul hs.aestronglyMeasurable)).symm.le).trans he) + have ht := ENNReal.toReal_mono (ENNReal.mul_ne_top hB hD) hh + simpa only [enorm, ENNReal.coe_toReal, coe_nnnorm] using ht + + + +def smoothedPoisson (s : Boundary) (x : Plane) : ℝ := + ∫ y, kernel x y * poisson s y ∂ν + +omit hC hν in +lemma smoothedPoisson_measurable [SFinite ν] (s : Boundary) : Measurable (smoothedPoisson (ν := ν) s) := by + have hm : Measurable (fun z : Plane × Plane => kernel z.1 z.2 * poisson s z.2) := + measurable_kernel.mul (by unfold poisson DiskFormula.poisson; fun_prop) + exact hm.stronglyMeasurable.integral_prod_right'.measurable + +include hC hν in +lemma smoothedPoisson_memLp [IsFiniteMeasure ν] (s : Boundary) : + MemLp (smoothedPoisson (ν := ν) s) 2 ν := by + obtain ⟨B,_,hB⟩ := green_poisson_uniform_bound hC hν + apply MemLp.of_bound (smoothedPoisson_measurable s).aestronglyMeasurable B + filter_upwards [ae_mem_disk hν] with x hx + exact hB x hx s + +end StrictHotSpots.PlaneGreen +end +end FullBoundarySmoothingLayer + + +end FullBoundaryCombinedLayer + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Cauchy.lean b/lean/OAI/Analysis/HotSpots/Cauchy.lean new file mode 100644 index 0000000000000000000000000000000000000000..acf91e212e3d692f7c33df165bacae19ff3bd73d --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Cauchy.lean @@ -0,0 +1,463 @@ +import OAI.Analysis.HotSpots.Multiplicity + +namespace OAI + +section ActualBoundaryCauchySupport + +section ActualZeroExtensionLayer +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ContDiff InnerProductSpace Laplacian +namespace StrictHotSpots + + + +lemma zeroExtension_hasFDerivAt {Ω B : Set Plane} {u : Plane → ℝ} + {D : Plane → Plane →L[ℝ] ℝ} (hΩ : IsOpen Ω) (hB : IsOpen B) + (hD : ∀ x ∈ B ∩ closure Ω, HasFDerivWithinAt u (D x) (closure Ω) x) + (hz : ∀ x ∈ B ∩ frontier Ω, u x = 0 ∧ D x = 0) + {x : Plane} (hx : x ∈ B) : + HasFDerivAt (Ω.indicator u) (Ω.indicator D x) x := by + classical + by_cases hxi : x ∈ Ω + · rw [indicator_of_mem hxi] + apply ((hD x ⟨hx,subset_closure hxi⟩).hasFDerivAt + (mem_of_superset (hΩ.mem_nhds hxi) subset_closure)).congr_of_eventuallyEq + filter_upwards [hΩ.mem_nhds hxi] with y hy + exact indicator_of_mem hy _ + · rw [indicator_of_notMem hxi] + by_cases hxc : x ∈ closure Ω + · have hxf : x ∈ frontier Ω := ⟨hxc,by simpa only [hΩ.interior_eq] using hxi⟩ + have hzx := hz x ⟨hx,hxf⟩ + have heq : EqOn (Ω.indicator u) u (closure Ω ∩ B) := by + intro y hy + by_cases hyΩ : y ∈ Ω + · exact indicator_of_mem hyΩ _ + · rw [indicator_of_notMem hyΩ] + exact (hz y ⟨hy.2,hy.1,by simpa only [hΩ.interior_eq] using hyΩ⟩).1.symm + have hh : HasFDerivWithinAt (Ω.indicator u) (0 : Plane →L[ℝ] ℝ) (closure Ω ∩ B) x := by + rw [← hzx.2] + exact ((hD x ⟨hx,hxc⟩).mono inter_subset_left).congr heq + (by rw [indicator_of_notMem hxi,hzx.1]) + have hc : HasFDerivWithinAt (Ω.indicator u) (0 : Plane →L[ℝ] ℝ) (Ωᶜ ∩ B) x := by + exact (hasFDerivWithinAt_const (𝕜 := ℝ) (s := Ωᶜ ∩ B) (0 : ℝ) x).congr + (fun y hy => indicator_of_notMem hy.1 _) (indicator_of_notMem hxi _) + apply (hh.union hc).hasFDerivAt + apply mem_of_superset (hB.mem_nhds hx) + intro y hy + by_cases hyΩ : y ∈ Ω + · exact Or.inl ⟨subset_closure hyΩ,hy⟩ + · exact Or.inr ⟨hyΩ,hy⟩ + · apply (hasFDerivAt_const (𝕜 := ℝ) (0 : ℝ) x).congr_of_eventuallyEq + filter_upwards [isClosed_closure.isOpen_compl.mem_nhds hxc] with y hy + exact indicator_of_notMem (fun hyΩ => hy (subset_closure hyΩ)) _ + +lemma zeroExtension_continuousOn {E : Type*} [NormedAddCommGroup E] + {Ω B : Set Plane} {f : Plane → E} + (hf : ContinuousOn f (B ∩ closure Ω)) + (hz : ∀ x ∈ B ∩ frontier Ω, f x = 0) : ContinuousOn (Ω.indicator f) B := by + classical + exact ContinuousOn.piecewise hz hf continuousOn_const + +lemma weakGradient_of_continuous_derivative {B : Set Plane} {v : Plane → ℝ} + {D : Plane → Plane →L[ℝ] ℝ} (hB : IsOpen B) + (hv : ∀ x ∈ B, HasFDerivAt v (D x) x) (hD : ContinuousOn D B) + (hmv : MemLp v 2 (volume.restrict B)) + (hmg : MemLp (fun x => (InnerProductSpace.toDual ℝ Plane).symm (D x)) 2 (volume.restrict B)) : + HasH1Gradient B v (fun x => (InnerProductSpace.toDual ℝ Plane).symm (D x)) := by + refine ⟨hmv,hmg,?_⟩ + have hvc : ContinuousOn v B := fun x hx => (hv x hx).continuousAt.continuousWithinAt + intro φ hφ hc hs e + have he (x) : inner ℝ ((InnerProductSpace.toDual ℝ Plane).symm (D x)) e = D x e := + InnerProductSpace.toDual_symm_apply + simp_rw [he] + have hdφ : Continuous (fun x => fderiv ℝ φ x e) := + (hφ.continuous_fderiv (by simp)).clm_apply continuous_const + have hds : tsupport (fun x => fderiv ℝ φ x e) ⊆ B := + (tsupport_fderiv_apply_subset ℝ e).trans hs + rw [setIntegral_mul_test hds,setIntegral_mul_test hs] + have hd : Integrable (fun x => fderiv ℝ v x e * φ x) volume := by + apply (integrable_mul_test hB (hD.clm_apply (continuousOn_const (c := e))) hφ.continuous hc hs).congr + exact Eventually.of_forall fun x => by + dsimp only + by_cases hx : x ∈ B + · rw [(hv x hx).fderiv] + · rw [image_eq_zero_of_notMem_tsupport (fun h => hx (hs h))]; simp + have hEq := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable hd + (integrable_mul_test hB hvc hdφ (hc.fderiv_apply ℝ e) hds) + (integrable_mul_test hB hvc hφ.continuous hc hs) + (fun x hx => (hv x (hs hx)).differentiableAt) + (fun x _ => hφ.differentiable (by simp) x) + rw [hEq] + congr 1 + apply integral_congr_ae + exact Eventually.of_forall fun x => by + dsimp only + by_cases hx : x ∈ B + · rw [(hv x hx).fderiv] + · rw [image_eq_zero_of_notMem_tsupport (fun h => hx (hs h))]; simp + +end StrictHotSpots + +namespace StrictHotSpots + +lemma zeroExtension_H1 {Ω B : Set Plane} {u : Plane → ℝ} + {D : Plane → Plane →L[ℝ] ℝ} (hΩ : IsOpen Ω) (hB : IsOpen B) + (hD : ∀ x ∈ B ∩ closure Ω, HasFDerivWithinAt u (D x) (closure Ω) x) + (hDc : ContinuousOn D (B ∩ closure Ω)) + (hz : ∀ x ∈ B ∩ frontier Ω, u x = 0 ∧ D x = 0) + (hu : HasH1Gradient Ω u (gradient u)) : + HasH1Gradient B (Ω.indicator u) (Ω.indicator (gradient u)) := by + classical + let d (x : Plane) := (InnerProductSpace.toDual ℝ Plane).symm (Ω.indicator D x) + have hd : d =ᵐ[volume.restrict B] Ω.indicator (gradient u) := by + filter_upwards [ae_restrict_mem hB.measurableSet] with x hx + by_cases hxΩ : x ∈ Ω + · have hdu := (hD x ⟨hx,subset_closure hxΩ⟩).hasFDerivAt + (mem_of_superset (hΩ.mem_nhds hxΩ) subset_closure) + simp only [d,indicator_of_mem hxΩ,gradient,hdu.fderiv] + · simp only [d,indicator_of_notMem hxΩ,map_zero] + have hmv : MemLp (Ω.indicator u) 2 (volume.restrict B) := + ((memLp_indicator_iff_restrict hΩ.measurableSet).mpr hu.1).mono_measure Measure.restrict_le_self + have hmg : MemLp (Ω.indicator (gradient u)) 2 (volume.restrict B) := + ((memLp_indicator_iff_restrict hΩ.measurableSet).mpr hu.2.1).mono_measure Measure.restrict_le_self + have hh := weakGradient_of_continuous_derivative hB + (fun x hx => zeroExtension_hasFDerivAt hΩ hB hD hz hx) + (zeroExtension_continuousOn hDc (fun x hx => (hz x hx).2)) hmv ((memLp_congr_ae hd).mpr hmg) + refine ⟨hmv,hmg,?_⟩ + intro φ hφ hc hs e + rw [hh.2.2 _ hφ hc hs e] + congr 1 + apply integral_congr_ae + filter_upwards [hd] with x hx + rw [show (InnerProductSpace.toDual ℝ Plane).symm (Ω.indicator D x) = + Ω.indicator (gradient u) x from hx] + +lemma integral_indicator_local {Ω B : Set Plane} (hΩ : MeasurableSet Ω) + {f : Plane → ℝ} (hf : ∀ x ∉ B, f x = 0) : + (∫ x in B, Ω.indicator f x) = ∫ x in Ω, f x := by + rw [setIntegral_eq_integral_of_forall_compl_eq_zero,integral_indicator hΩ] + intro x hx + by_cases hxΩ : x ∈ Ω + · rw [indicator_of_mem hxΩ,hf x hx] + · rw [indicator_of_notMem hxΩ] + +lemma zeroExtension_weakEquation {Ω B : Set Plane} {u : Plane → ℝ} + (hΩ : IsOpen Ω) (hu : InInteriorNeumannEigenspace Ω u) + (hh : HasH1Gradient B (Ω.indicator u) (Ω.indicator (gradient u))) : + PlaneWeakEquation B (firstPositiveNeumannValue Ω) (Ω.indicator u) := by + classical + intro φ hφ hc hs + rw [weak_laplacian_test hh hφ hc hs] + have hgφ (x : Plane) (hx : x ∉ B) : gradient φ x = 0 := by + unfold gradient + rw [image_eq_zero_of_notMem_tsupport (f := fderiv ℝ φ) + (fun h => hx (hs (tsupport_fderiv_subset ℝ h))),map_zero] + have h1 : (fun x => inner ℝ (Ω.indicator (gradient u) x) (gradient φ x)) = + Ω.indicator (fun x => inner ℝ (gradient u x) (gradient φ x)) := by + funext x + by_cases hx : x ∈ Ω + · simp only [indicator_of_mem hx] + · simp only [indicator_of_notMem hx,inner_zero_left] + have h2 : (fun x => Ω.indicator u x * φ x) = Ω.indicator (fun x => u x * φ x) := by + funext x + by_cases hx : x ∈ Ω + · simp only [indicator_of_mem hx] + · simp only [indicator_of_notMem hx,zero_mul] + rw [h1,h2,integral_indicator_local hΩ.measurableSet + (fun x hx => by rw [hgφ x hx,inner_zero_right]), + integral_indicator_local hΩ.measurableSet + (fun x hx => by rw [image_eq_zero_of_notMem_tsupport (fun h => hx (hs h)),mul_zero]), + hu.2.2.2 φ (gradient φ) (HasH1Gradient.test hΩ hφ hc),neg_mul] + + + + +theorem interior_eigenfunction_zero_of_boundary_jet {Ω B : Set Plane} {u : Plane → ℝ} + {D : Plane → Plane →L[ℝ] ℝ} (hΩ : IsOpen Ω) (hcΩ : IsPreconnected Ω) + (hbΩ : Bornology.IsBounded Ω) (hB : IsOpen B) (hcB : IsPreconnected B) + (hbB : Bornology.IsBounded B) (hu : InInteriorNeumannEigenspace Ω u) + (hD : ∀ x ∈ B ∩ closure Ω, HasFDerivWithinAt u (D x) (closure Ω) x) + (hDc : ContinuousOn D (B ∩ closure Ω)) + (hz : ∀ x ∈ B ∩ frontier Ω, u x = 0 ∧ D x = 0) + (hin : (B ∩ Ω).Nonempty) + (hout : ∃ a ∈ B, ∃ ε > 0, ball a ε ⊆ Ωᶜ) : + EqOn u 0 Ω := by + classical + let : IsFiniteMeasure (volume.restrict B) := isFiniteMeasure_restrict.mpr hbB.measure_lt_top.ne + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hbΩ.measure_lt_top.ne + have hh := zeroExtension_H1 hΩ hB hD hDc hz hu.2.1 + have hW := zeroExtension_weakEquation hΩ hu hh + have hext : ∀ᵐ x ∂volume, x ∈ B → Ω.indicator u x = 0 := by + apply planeWeak_uniqueContinuation hB hcB (hh.1.integrable (by norm_num)) hW + obtain ⟨a,ha,ε,hε,hs⟩ := hout + refine ⟨a,ha,ε,hε,Eventually.of_forall fun x hx => ?_⟩ + exact indicator_of_notMem (hs hx) _ + have hu0 : ∀ᵐ x ∂volume, x ∈ Ω → u x = 0 := by + apply planeWeak_uniqueContinuation hΩ hcΩ (hu.2.1.1.integrable (by norm_num)) + (planeWeakEquation_of_euler hΩ hu.2.1 hu.2.2.2) + obtain ⟨a,ha⟩ := hin + obtain ⟨ε,hε,hs⟩ := Metric.isOpen_iff.mp (hB.inter hΩ) a ha + refine ⟨a,ha.2,ε,hε,?_⟩ + filter_upwards [hext] with x hx hxball + have hm := hs hxball + simpa only [indicator_of_mem hm.2] using hx hm.1 + exact Measure.eqOn_open_of_ae_eq ((ae_restrict_iff' hΩ.measurableSet).mpr hu0) hΩ + hu.1.continuousOn continuousOn_const + +end StrictHotSpots + +end +end ActualZeroExtensionLayer +section ActualBoundaryLocalConstLayer +noncomputable section +open Set Filter Metric Function +open scoped Topology ContDiff +namespace StrictHotSpots + +lemma nonzero_real_functional_surjective (D : Plane →L[ℝ] ℝ) (hD : D ≠ 0) : + D.range = ⊤ := by + apply LinearMap.range_eq_top.mpr + have hn : ∃ v, D v ≠ 0 := by + by_contra hh + apply hD + ext v + simpa using not_exists.mp hh v + obtain ⟨v,hv⟩ := hn + intro t + refine ⟨(t / D v) • v,?_⟩ + simp [map_smul,div_mul_cancel₀ _ hv] + +lemma frontier_level_zero {Ω U : Set Plane} {ρ : Plane → ℝ} {p : Plane} + (ho : IsOpen Ω) (hU : IsOpen U) (hpU : p ∈ U) (hp : p ∈ frontier Ω) + (hc : ContinuousAt ρ p) + (he : Ω ∩ U = {x | ρ x < 0} ∩ U) : ρ p = 0 := by + apply le_antisymm + · by_contra hh + have ht : ∀ᶠ x in 𝓝 p, x ∈ U ∧ 0 < ρ x := + (show ∀ᶠ x in 𝓝 p, x ∈ U from hU.mem_nhds hpU).and + (hc (lt_mem_nhds (lt_of_not_ge hh))) + obtain ⟨x,hx,hxU,hpx⟩ := (mem_closure_iff_frequently.mp hp.1).and_eventually ht |>.exists + have hz : ρ x < 0 := (he ▸ (show x ∈ Ω ∩ U from ⟨hx,hxU⟩)).1 + exact (not_lt_of_ge hpx.le) hz + · by_contra hh + have hm : p ∈ Ω := ((he.symm ▸ (show p ∈ {x | ρ x < 0} ∩ U from + ⟨lt_of_not_ge hh,hpU⟩)) : p ∈ Ω ∩ U).1 + exact hp.2 (ho.interior_eq.symm ▸ hm) + +lemma regular_level_mem_frontier {Ω U : Set Plane} {ρ : Plane → ℝ} {p : Plane} + (ho : IsOpen Ω) (hU : IsOpen U) (hpU : p ∈ U) + (hc : DifferentiableAt ℝ ρ p) (hD : fderiv ℝ ρ p ≠ 0) (hpρ : ρ p = 0) + (he : Ω ∩ U = {x | ρ x < 0} ∩ U) : p ∈ frontier Ω := by + obtain ⟨v,hv⟩ : ∃ v, fderiv ℝ ρ p v = -1 := + LinearMap.range_eq_top.mp (nonzero_real_functional_surjective _ hD) (-1) + have ht : Tendsto (fun t : ℝ => p+t•v) (𝓝[>] 0) (𝓝 p) := by + simpa using tendsto_const_nhds.add + ((tendsto_id'.mpr (nhdsWithin_le_nhds : 𝓝[>] (0 : ℝ) ≤ 𝓝 0)).smul_const v) + have hm : ∀ᶠ t in 𝓝[>] (0 : ℝ), p+t•v ∈ Ω := by + filter_upwards [HasFDerivAt.eventually_lt_along_ray hc.hasFDerivAt + (show fderiv ℝ ρ p v < 0 by rw [hv]; norm_num),ht (hU.mem_nhds hpU)] with t hneg htU + exact ((he.symm ▸ (show p+t•v ∈ {x | ρ x < 0} ∩ U from + ⟨by change ρ (p+t•v) < 0; simpa only [hpρ] using hneg,htU⟩)) : p+t•v ∈ Ω ∩ U).1 + refine ⟨mem_closure_of_tendsto ht hm,?_⟩ + rw [ho.interior_eq] + intro hh + have hz : ρ p < 0 := (he ▸ (show p ∈ Ω ∩ U from ⟨hh,hpU⟩)).1 + simp only [hpρ,lt_self_iff_false] at hz + + + + + +theorem SmoothBoundary.locally_const_of_boundary_zero_jet + {Ω O : Set Plane} {u : Plane → ℝ} (hs : SmoothBoundary Ω) (ho : IsOpen Ω) + {p : Plane} (hp : p ∈ frontier Ω) + (hO : IsOpen O) (hpO : p ∈ O) + (hz : ∀ x ∈ O ∩ frontier Ω, HasFDerivWithinAt u (0 : Plane →L[ℝ] ℝ) (closure Ω) x) : + ∃ V : Set Plane, IsOpen V ∧ p ∈ V ∧ ∀ x ∈ V ∩ frontier Ω, u x = u p := by + obtain ⟨U,ρ,hU,hpU,hρ,hD,hpρ,he⟩ := hs p hp + have hρat : ContDiffAt ℝ ∞ ρ p := (hρ p hpU).contDiffAt (hU.mem_nhds hpU) + let D := fderiv ℝ ρ p + let hker := D.ker_closedComplemented_of_finiteDimensional_range + let φ := HasStrictFDerivAt.implicitFunctionDataOfComplemented ρ D + (hρat.hasStrictFDerivAt (by simp)) (nonzero_real_functional_surjective D hD) hker + have hφp : φ.prodFun p = (0,0) := by + simp [φ,ImplicitFunctionData.prodFun,hpρ] + have hr : ContDiff ℝ ∞ φ.rightFun := by + change ContDiff ℝ ∞ (fun x => Classical.choose hker (x-p)) + fun_prop + have hcunc : ContDiffAt ℝ 1 φ.implicitFunction.uncurry (0,0) := by + rw [← hφp] + exact φ.contDiffAt_implicitFunction (hρat.of_le (by simp)) + (hr.contDiffAt.of_le (by simp)) (by simp) + let c : D.ker → Plane := φ.implicitFunction 0 + have hc : ContDiffAt ℝ 1 c 0 := by + exact hcunc.comp 0 (contDiffAt_const.prodMk contDiffAt_id) + have hcp : c 0 = p := by + have hh := φ.toOpenPartialHomeomorph.left_inv φ.pt_mem_toOpenPartialHomeomorph_source + change φ.implicitFunction (φ.prodFun p).1 (φ.prodFun p).2 = p at hh + simpa only [hφp] using hh + have ht : Tendsto (fun y : D.ker => (0,y)) (𝓝 0) (𝓝 (φ.prodFun p)) := by + rw [hφp] + exact tendsto_const_nhds.prodMk_nhds tendsto_id + have hcρ : ∀ᶠ y in 𝓝 (0 : D.ker), ρ (c y) = 0 := ht φ.leftFun_implicitFunction + have hct : Tendsto c (𝓝 (0 : D.ker)) (𝓝 p) := hcp ▸ hc.continuousAt.tendsto + have hdn := hct ((hρat.continuousAt_fderiv (by simp)).eventually_ne hD) + have hgood : ∀ᶠ y in 𝓝 (0 : D.ker), DifferentiableAt ℝ c y ∧ c y ∈ O ∩ frontier Ω := by + filter_upwards [hc.eventually (by simp),hcρ,hdn,hct (hU.mem_nhds hpU), + hct (hO.mem_nhds hpO)] with y hcy hρy hdy hyU hyO + refine ⟨hcy.differentiableAt (by simp),hyO,?_⟩ + exact regular_level_mem_frontier ho hU hyU + (((hρ (c y) hyU).contDiffAt (hU.mem_nhds hyU)).differentiableAt (by simp)) + hdy hρy he + obtain ⟨ε,hε,hεgood⟩ := Metric.eventually_nhds_iff.mp hgood + have hfzero (y : D.ker) (hy : y ∈ ball 0 ε) : HasFDerivAt (u ∘ c) (0 : D.ker →L[ℝ] ℝ) y := by + have hygood := hεgood hy + have hdu := hz (c y) hygood.2 + have hmaps : ∀ᶠ z in 𝓝 y, c z ∈ closure Ω := by + filter_upwards [isOpen_ball.mem_nhds hy] with z hz + exact (hεgood hz).2.2.1 + simpa only [ContinuousLinearMap.zero_comp] using + hdu.comp_hasFDerivAt y hygood.1.hasFDerivAt hmaps + have hconst (y : D.ker) (hy : y ∈ ball 0 ε) : u (c y) = u p := by + have hh := (convex_ball (0 : D.ker) ε).is_const_of_fderivWithin_eq_zero + (fun z hz => (hfzero z hz).differentiableAt.differentiableWithinAt) + (fun z hz => (hfzero z hz).hasFDerivWithinAt.fderivWithin + (isOpen_ball.uniqueDiffOn z hz)) hy (mem_ball_self hε) + exact hh.trans (congrArg u hcp) + have hright0 : φ.rightFun p = 0 := congrArg Prod.snd hφp + have hry : ∀ᶠ x in 𝓝 p, φ.rightFun x ∈ ball 0 ε := by + exact hr.continuous.continuousAt.tendsto + (hright0.symm ▸ (isOpen_ball.mem_nhds (mem_ball_self hε))) + have hloc : ∀ᶠ x in 𝓝 p, x ∈ frontier Ω → u x = u p := by + filter_upwards [hU.mem_nhds hpU,hry,φ.implicitFunction_apply_image] with x hxU hxy hix + intro hxf + have hzρ := frontier_level_zero ho hU hxU hxf + ((hρ x hxU).continuousWithinAt.continuousAt (hU.mem_nhds hxU)) he + have hic : c (φ.rightFun x) = x := by + change φ.implicitFunction 0 (φ.rightFun x) = x + change φ.implicitFunction (ρ x) (φ.rightFun x) = x at hix + simpa only [hzρ] using hix + exact hic ▸ hconst _ hxy + obtain ⟨V,hV,hVo,hpV⟩ := _root_.mem_nhds_iff.mp hloc + exact ⟨V,hVo,hpV,fun x hx => hV hx.1 hx.2⟩ + +end StrictHotSpots + +end +end ActualBoundaryLocalConstLayer +end ActualBoundaryCauchySupport + +section ClosedEigenLocalRank + +noncomputable section +open Set Filter Metric Function +open scoped Topology ContDiff InnerProductSpace +namespace StrictHotSpots +namespace Conformal.ClosedDiskChart +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) +include c + + + +theorem eq_zero_of_boundary_closedGradient (hΩ : AdmissibleDomain Ω) + {v : Plane → ℝ} (hv : InInteriorNeumannEigenspace Ω v) + (hvc : ContinuousOn v (closure Ω)) {Y : Plane → Plane} + (hY : ContinuousOn Y (closure Ω)) (he : EqOn (gradient v) Y Ω) + {p : Plane} (hp : p ∈ frontier Ω) {U : Set Plane} (hU : IsOpen U) (hpU : p ∈ U) + (hz : ∀ x ∈ U ∩ frontier Ω, v x = 0 ∧ Y x = 0) : EqOn v 0 Ω := by + obtain ⟨ε,hε,hεU⟩ := Metric.isOpen_iff.mp hU p hpU + let D : Plane → Plane →L[ℝ] ℝ := fun x => InnerProductSpace.toDual ℝ Plane (Y x) + apply interior_eigenfunction_zero_of_boundary_jet hΩ.2.1 + hΩ.2.2.2.1.isPathConnected.isConnected.isPreconnected hΩ.2.2.1 + isOpen_ball (convex_ball p ε).isPreconnected isBounded_ball hv (D := D) + · intro x hx + by_cases hxi : x ∈ Ω + · have hd := (hv.differentiableAt hΩ.2.1 hxi).hasFDerivAt.hasFDerivWithinAt (s := closure Ω) + have hh : fderiv ℝ v x = D x := by + change fderiv ℝ v x = InnerProductSpace.toDual ℝ Plane (Y x) + rw [← he hxi] + exact (InnerProductSpace.toDual ℝ Plane).apply_symm_apply _ |>.symm + rwa [hh] at hd + · have hxf : x ∈ frontier Ω := ⟨hx.2,by simpa only [hΩ.2.1.interior_eq] using hxi⟩ + have hh := (hz x ⟨hεU hx.1,hxf⟩).2 + have hd := c.hasFDerivWithinAt_zero_of_closedGradient_zero hv.1 hvc hY he hx.2 hh + simpa only [D,hh,map_zero] using hd + · exact ((InnerProductSpace.toDual ℝ Plane).continuous.comp_continuousOn hY).mono inter_subset_right + · intro x hx + have hh := hz x ⟨hεU hx.1,hx.2⟩ + exact ⟨hh.1,by simp only [D,hh.2,map_zero]⟩ + · obtain ⟨x,hx,hxp⟩ := Metric.mem_closure_iff.mp hp.1 ε hε + exact ⟨x,by simpa only [mem_ball,dist_comm] using hxp,hx⟩ + · exact hΩ.2.2.2.2.exterior_ball_in_neighborhood hp isOpen_ball (mem_ball_self hε) +end Conformal.ClosedDiskChart + + +def closedPatchEigenSpace (Ω O : Set Plane) (hΩ : AdmissibleDomain Ω) : + Submodule ℝ (ClosedEigenJet Ω) where + carrier := {J | J ∈ closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1 ∧ + ∀ x : closure Ω, (x : Plane) ∈ O ∩ frontier Ω → J.2 x = 0} + zero_mem' := ⟨(closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1).zero_mem,by simp⟩ + add_mem' := by + intro J K hJ hK + refine ⟨(closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1).add_mem hJ.1 hK.1,?_⟩ + intro x hx + change J.2 x + K.2 x = 0 + rw [hJ.2 x hx,hK.2 x hx,add_zero] + smul_mem' := by + intro a J hJ + refine ⟨(closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1).smul_mem a hJ.1,?_⟩ + intro x hx + change a • J.2 x = 0 + rw [hJ.2 x hx,smul_zero] + +def closedPatchEval {Ω O : Set Plane} (hΩ : AdmissibleDomain Ω) {p : Plane} + (hp : p ∈ frontier Ω) : closedPatchEigenSpace Ω O hΩ →ₗ[ℝ] ℝ where + toFun J := J.val.1 ⟨p,hp.1⟩ + map_add' _ _ := rfl + map_smul' _ _ := rfl + +lemma closedPatchEval_injective {Ω O : Set Plane} (c : Conformal.ClosedDiskChart Ω) + (hΩ : AdmissibleDomain Ω) {p : Plane} (hp : p ∈ frontier Ω) (hO : IsOpen O) (hpO : p ∈ O) : + Injective (closedPatchEval (O := O) hΩ hp) := by + have hzero (J : closedPatchEigenSpace Ω O hΩ) (hJ : closedPatchEval hΩ hp J = 0) : J = 0 := by + obtain ⟨v,Y,hv,hvc,hY,he,hjet⟩ := J.property.1 + have hz (x : Plane) (hx : x ∈ O ∩ frontier Ω) : Y x = 0 := by + have h := J.property.2 ⟨x,hx.2.1⟩ hx + rw [← hjet] at h + exact h + have hd (x : Plane) (hx : x ∈ O ∩ frontier Ω) : + HasFDerivWithinAt v (0 : Plane →L[ℝ] ℝ) (closure Ω) x := + c.hasFDerivWithinAt_zero_of_closedGradient_zero hv.1 hvc hY he hx.2.1 (hz x hx) + obtain ⟨V,hV,hpV,hconst⟩ := hΩ.2.2.2.2.locally_const_of_boundary_zero_jet hΩ.2.1 hp hO hpO hd + have hvp : v p = 0 := by + change J.val.1 ⟨p,hp.1⟩ = 0 at hJ + rw [← hjet] at hJ + exact hJ + have hv0 : EqOn v 0 Ω := c.eq_zero_of_boundary_closedGradient hΩ hv hvc hY he hp + (hV.inter hO) ⟨hpV,hpO⟩ + (fun x hx => ⟨(hconst x ⟨hx.1.1,hx.2⟩).trans hvp,hz x ⟨hx.1.2,hx.2⟩⟩) + apply Subtype.ext + exact hjet.symm.trans (closedEigenJet_eq_zero_of_eqOn hΩ.2.1 hvc hY he hv0) + intro J K hJK + apply sub_eq_zero.mp + apply hzero (J-K) + change J.val.1 ⟨p,hp.1⟩ - K.val.1 ⟨p,hp.1⟩ = 0 + exact sub_eq_zero.mpr hJK + + +theorem closedPatchEigenSpace_finrank_le_one {Ω O : Set Plane} (c : Conformal.ClosedDiskChart Ω) + (hΩ : AdmissibleDomain Ω) {p : Plane} (hp : p ∈ frontier Ω) (hO : IsOpen O) (hpO : p ∈ O) : + Module.Finite ℝ (closedPatchEigenSpace Ω O hΩ) ∧ + Module.finrank ℝ (closedPatchEigenSpace Ω O hΩ) ≤ 1 := by + have hi := closedPatchEval_injective c hΩ hp hO hpO + have hf := Module.Finite.of_injective (closedPatchEval (O := O) hΩ hp) hi + let : Module.Finite ℝ (closedPatchEigenSpace Ω O hΩ) := hf + exact ⟨hf,by simpa using LinearMap.finrank_le_finrank_of_injective hi⟩ +end StrictHotSpots +end +end ClosedEigenLocalRank + + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/ClosedChart.lean b/lean/OAI/Analysis/HotSpots/ClosedChart.lean new file mode 100644 index 0000000000000000000000000000000000000000..72d0901f564e581f3001602a410eca28f83ce78d --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/ClosedChart.lean @@ -0,0 +1,1518 @@ +import OAI.Analysis.HotSpots.Riemann +import OAI.Analysis.HotSpots.Trace + +namespace OAI + +section RollingBallTaylor + + + + +noncomputable section +open Set Metric Filter +open scoped Topology NNReal +namespace StrictHotSpots.Rolling +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +lemma taylor_quadratic {f : E → ℝ} {U : Set E} {K : ℝ≥0} + (hU : Convex ℝ U) (hd : ∀ x ∈ U, DifferentiableAt ℝ f x) + (hL : LipschitzOnWith K (fderiv ℝ f) U) {p x : E} (hp : p ∈ U) (hx : x ∈ U) : + ‖f x-f p-fderiv ℝ f p (x-p)‖ ≤ (K:ℝ)*‖x-p‖^2 := by + have hs : segment ℝ p x ⊆ U := hU.segment_subset hp hx + have H := (convex_segment p x).norm_image_sub_le_of_norm_fderiv_le' + (fun y hy => hd y (hs hy)) + (φ := fderiv ℝ f p) (C := (K:ℝ)*‖x-p‖) + (fun y hy => (hL.norm_sub_le (hs hy) hp).trans + (mul_le_mul_of_nonneg_left (norm_sub_le_of_mem_segment hy) K.coe_nonneg)) + (left_mem_segment ℝ p x) (right_mem_segment ℝ p x) + simpa only [pow_two,mul_assoc] using H + +lemma norm_sub_smul_sq (y n : E) (r : ℝ) : + ‖y-r•n‖^2 = ‖y‖^2 - 2*r*inner ℝ y n + r^2*‖n‖^2 := by + rw [norm_sub_sq_real,real_inner_smul_right,norm_smul,Real.norm_eq_abs, + mul_pow,sq_abs] + ring + +lemma tangent_ball_linear {p n x : E} {r : ℝ} (hn : ‖n‖ = 1) (hr : 0 < r) + (hx : x ∈ ball (p+r•n) r) : + ‖x-p‖^2 < 2*r*inner ℝ (x-p) n := by + have hh : ‖(x-p)-r•n‖ < r := by + simpa only [mem_ball,dist_eq_norm,sub_add_eq_sub_sub] using hx + have hh2 := (sq_lt_sq₀ (norm_nonneg _) hr.le).mpr hh + rw [norm_sub_smul_sq,hn,one_pow,mul_one] at hh2 + linarith + + + +lemma balls_of_taylor {f : E → ℝ} {p n : E} {U : Set E} {a K r : ℝ} + (hn : ‖n‖ = 1) (ha : 0 < a) (hr : 0 < r) + (hsmall : 2*r*K ≤ a) (hzero : f p = 0) + (hD : ∀ v, fderiv ℝ f p v = a*inner ℝ n v) + (hB : ball p (2*r) ⊆ U) + (hT : ∀ x ∈ U, ‖f x-f p-fderiv ℝ f p (x-p)‖ ≤ K*‖x-p‖^2) : + ball (p-r•n) r ⊆ {x | f x < 0} ∧ + ball (p+r•n) r ⊆ {x | 0 < f x} := by + have hside (N : E) (hN : ‖N‖ = 1) (x : E) (hx : x ∈ ball (p+r•N) r) : + x ∈ U ∧ ‖x-p‖^2 < 2*r*inner ℝ (x-p) N := by + refine ⟨hB ?_,tangent_ball_linear hN hr hx⟩ + have hd : dist (p+r•N) p = r := by + simp [dist_eq_norm,norm_smul,hN,abs_of_pos hr] + calc + dist x p ≤ dist x (p+r•N)+dist (p+r•N) p := dist_triangle _ _ _ + _ < r+r := add_lt_add_of_lt_of_le hx (le_of_eq hd) + _ = 2*r := by ring + constructor + · intro x hx + have hx' : x ∈ ball (p+r•(-n)) r := by simpa [smul_neg,sub_eq_add_neg] using hx + obtain ⟨hxU,hx2⟩ := hside (-n) (by simpa using hn) x hx' + rw [inner_neg_right,real_inner_comm n (x-p)] at hx2 + have ht := hT x hxU + rw [hzero,sub_zero,hD,Real.norm_eq_abs] at ht + have he := (le_abs_self (f x-a*inner ℝ n (x-p))).trans ht + have hk := mul_le_mul_of_nonneg_right hsmall (sq_nonneg ‖x-p‖) + have hstrict := mul_lt_mul_of_pos_left hx2 ha + have hmul := mul_le_mul_of_nonneg_left he (mul_pos (by norm_num : (0:ℝ)<2) hr).le + change f x < 0 + nlinarith only [hmul,hstrict,hk,hr] + · intro x hx + obtain ⟨hxU,hx2⟩ := hside n hn x hx + rw [real_inner_comm n (x-p)] at hx2 + have ht := hT x hxU + rw [hzero,sub_zero,hD,Real.norm_eq_abs] at ht + have he' : -(K*‖x-p‖^2) ≤ f x-a*inner ℝ n (x-p) := by + have hh := neg_abs_le (f x-a*inner ℝ n (x-p)) + linarith [ht] + have hk := mul_le_mul_of_nonneg_right hsmall (sq_nonneg ‖x-p‖) + have hstrict := mul_lt_mul_of_pos_left hx2 ha + have hmul := mul_le_mul_of_nonneg_left he' (mul_pos (by norm_num : (0:ℝ)<2) hr).le + change 0 < f x + nlinarith only [hmul,hstrict,hk,hr] + +end StrictHotSpots.Rolling +end +end RollingBallTaylor + +section RollingBallMetric + +noncomputable section +open Set Metric Filter +open scoped Topology +namespace StrictHotSpots.Rolling +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +lemma tangent_ball_mono {p n : E} {s r : ℝ} (hn : ‖n‖ = 1) + (hsr : s ≤ r) : ball (p+s•n) s ⊆ ball (p+r•n) r := by + intro x hx + have hd : dist (p+s•n) (p+r•n) = r-s := by + rw [dist_eq_norm,show (p+s•n)-(p+r•n) = (s-r)•n by module,norm_smul,hn,mul_one, + Real.norm_eq_abs,abs_of_nonpos (sub_nonpos.mpr hsr)] + ring + calc + dist x (p+r•n) ≤ dist x (p+s•n)+dist (p+s•n) (p+r•n) := dist_triangle _ _ _ + _ < s+(r-s) := add_lt_add_of_lt_of_le hx (le_of_eq hd) + _ = r := by ring + + + + +lemma nearest_normal_of_balls {Ω : Set E} {x p n : E} {r : ℝ} + (hn : ‖n‖ = 1) (hr : 0 < r) (hxp : x ≠ p) + (hin : ball x (dist x p) ⊆ Ω) + (hout : ball (p+r•n) r ⊆ Ωᶜ) : x = p-dist x p • n := by + let δ := dist x p + have hδ : 0 < δ := dist_pos.mpr hxp + have hdisj : Disjoint (ball x δ) (ball (p+r•n) r) := by + refine disjoint_left.mpr (fun y hy₁ hy₂ => ?_) + exact hout hy₂ (hin hy₁) + have hd : δ+r ≤ ‖(x-p)-r•n‖ := by + simpa only [dist_eq_norm,sub_add_eq_sub_sub] using + (disjoint_ball_ball_iff hδ hr).mp hdisj + have hnorm : ‖x-p‖ = δ := (dist_eq_norm _ _).symm + have hd2 := (sq_le_sq₀ (by positivity : 0 ≤ δ+r) (norm_nonneg _)).mpr hd + rw [norm_sub_smul_sq,hn,one_pow,mul_one,hnorm] at hd2 + have hi : inner ℝ (x-p) n ≤ -δ := by nlinarith only [hd2,hr] + have hi' := mul_le_mul_of_nonneg_left hi hδ.le + have he : ‖(x-p)+δ•n‖^2 = 0 := by + have hnn := sq_nonneg ‖(x-p)+δ•n‖ + rw [norm_add_sq_real,hnorm,real_inner_smul_right,norm_smul, + Real.norm_eq_abs,abs_of_pos hδ,hn,mul_one] at hnn ⊢ + nlinarith only [hi',hnn] + have hz : (x-p)+δ•n = 0 := norm_eq_zero.mp (sq_eq_zero_iff.mp he) + dsimp [δ] at hz + calc + x = (x-p)+p := by abel + _ = -(dist x p•n)+p := congrArg (fun a => a+p) (eq_neg_of_add_eq_zero_left hz) + _ = p-dist x p•n := by abel + +lemma near_interior_ball {Ω : Set E} {x p n : E} {r : ℝ} + (hn : ‖n‖ = 1) (hr : 0 < r) (hxp : x ≠ p) + (hin : ball x (dist x p) ⊆ Ω) (hout : ball (p+r•n) r ⊆ Ωᶜ) + (hnear : dist x p < r) : + dist x (p-r•n) = r-dist x p ∧ x ∈ ball (p-r•n) r := by + have he := nearest_normal_of_balls hn hr hxp hin hout + have heq : x-(p-r•n) = (r-dist x p) • n := by + calc + _ = (p-dist x p•n)-(p-r•n) := congrArg (fun a => a-(p-r•n)) he + _ = _ := by module + have hd : dist x (p-r•n) = r-dist x p := by + rw [dist_eq_norm,heq,norm_smul,hn,mul_one,Real.norm_eq_abs, + abs_of_pos (sub_pos.mpr hnear)] + refine ⟨hd,?_⟩ + change dist x (p-r•n) < r + rw [hd] + linarith [dist_pos.mpr hxp] + +end StrictHotSpots.Rolling +end +end RollingBallMetric + +section RollingBallNormals + +noncomputable section +open Set Metric +open scoped Topology +namespace StrictHotSpots.Rolling +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + + + +lemma normals_bound {U : Set E} {p q n m : E} {r : ℝ} (hr : 0 < r) + (hn : ‖n‖ = 1) (hm : ‖m‖ = 1) + (hip : ball (p-r•n) r ⊆ U) (hop : ball (p+r•n) r ⊆ Uᶜ) + (hiq : ball (q-r•m) r ⊆ U) (hoq : ball (q+r•m) r ⊆ Uᶜ) : + r*‖n-m‖ ≤ dist p q := by + have hd₁ : Disjoint (ball (p-r•n) r) (ball (q+r•m) r) := + disjoint_left.mpr (fun x h₁ h₂ => hoq h₂ (hip h₁)) + have hd₂ : Disjoint (ball (p+r•n) r) (ball (q-r•m) r) := + disjoint_left.mpr (fun x h₁ h₂ => hop h₁ (hiq h₂)) + have h₁ : 2*r ≤ ‖(p-q)-r•(n+m)‖ := by + have h := (disjoint_ball_ball_iff hr hr).mp hd₁ + simpa only [dist_eq_norm,show (p-r•n)-(q+r•m)=(p-q)-r•(n+m) by module,two_mul] using h + have h₂ : 2*r ≤ ‖(p-q)+r•(n+m)‖ := by + have h := (disjoint_ball_ball_iff hr hr).mp hd₂ + simpa only [dist_eq_norm,show (p+r•n)-(q-r•m)=(p-q)+r•(n+m) by module,two_mul] using h + have h₁sq := (sq_le_sq₀ (by positivity : 0 ≤ 2*r) (norm_nonneg _)).mpr h₁ + have h₂sq := (sq_le_sq₀ (by positivity : 0 ≤ 2*r) (norm_nonneg _)).mpr h₂ + have hp := parallelogram_law_with_norm ℝ (p-q) (r•(n+m)) + have hn' := parallelogram_law_with_norm ℝ n m + rw [norm_smul,Real.norm_eq_abs,abs_of_pos hr] at hp + rw [hn,hm] at hn' + have hsq : (r*‖n-m‖)^2 ≤ ‖p-q‖^2 := by + nlinarith only [h₁sq,h₂sq,hp,hn',sq_nonneg r] + rw [dist_eq_norm] + exact (sq_le_sq₀ (by positivity) (norm_nonneg _)).mp hsq + +lemma interior_centers_bound {U : Set E} {p q n m : E} {r : ℝ} (hr : 0 < r) + (hn : ‖n‖ = 1) (hm : ‖m‖ = 1) + (hip : ball (p-r•n) r ⊆ U) (hop : ball (p+r•n) r ⊆ Uᶜ) + (hiq : ball (q-r•m) r ⊆ U) (hoq : ball (q+r•m) r ⊆ Uᶜ) : + dist (p-r•n) (q-r•m) ≤ 2*dist p q := by + have H := normals_bound hr hn hm hip hop hiq hoq + rw [dist_eq_norm,show (p-r•n)-(q-r•m)=(p-q)-r•(n-m) by module] + calc + _ ≤ ‖p-q‖+‖r•(n-m)‖ := norm_sub_le _ _ + _ = dist p q+r*‖n-m‖ := by rw [norm_smul,Real.norm_eq_abs,abs_of_pos hr,dist_eq_norm] + _ ≤ 2*dist p q := by linarith +end StrictHotSpots.Rolling +end +end RollingBallNormals + +section RiemannBoundaryCompatible + +noncomputable section + + +section SmoothBoundaryGeometryCompatibleLayer + +open Set Filter Metric +open scoped Topology ContDiff +namespace StrictHotSpots + +lemma HasFDerivAt.eventually_lt_along_ray {f : Plane → ℝ} {D : Plane →L[ℝ] ℝ} + {p v : Plane} (hf : HasFDerivAt f D p) (hv : D v < 0) : + ∀ᶠ t in 𝓝[>] (0 : ℝ), f (p + t • v) < f p := by + have hl : HasDerivAt (fun t : ℝ => p + t • v) v 0 := by + simpa using ((hasDerivAt_id (0 : ℝ)).smul_const v).const_add p + have hh : HasDerivAt (fun t : ℝ => f (p + t • v)) (D v) 0 := by + exact (show HasFDerivAt f D (p + (0 : ℝ) • v) by simpa using hf).comp_hasDerivAt 0 hl + have ht := (HasDerivAt.tendsto_slope_zero_right hh).eventually (gt_mem_nhds hv) + filter_upwards [ht,self_mem_nhdsWithin] with t ht htp + simp only [zero_add,zero_smul,add_zero,smul_eq_mul,inv_mul_eq_div] at ht + have hh : f (p + t • v) - f p < 0 := by + have := (div_lt_iff₀ htp).mp ht + simpa only [zero_mul] using this + exact sub_neg.mp hh + +lemma regular_level_uniqueDiffWithinAt {Ω U : Set Plane} {ρ : Plane → ℝ} {p : Plane} + (hU : IsOpen U) (hpU : p ∈ U) (hρ : DifferentiableAt ℝ ρ p) + (hD : fderiv ℝ ρ p ≠ 0) (hp : ρ p = 0) + (hlevel : Ω ∩ U = {x | ρ x < 0} ∩ U) (hpcl : p ∈ closure Ω) : + UniqueDiffWithinAt ℝ (closure Ω) p := by + have hopen : IsOpen {v : Plane | fderiv ℝ ρ p v < 0} := + isOpen_lt (fderiv ℝ ρ p).continuous continuous_const + have hne : {v : Plane | fderiv ℝ ρ p v < 0}.Nonempty := by + have hn : ∃ v, fderiv ℝ ρ p v ≠ 0 := by + by_contra hh + apply hD + ext v + simpa using not_exists.mp hh v + obtain ⟨v,hv⟩ := hn + rcases lt_or_gt_of_ne hv with hv | hv + · exact ⟨v,hv⟩ + · refine ⟨-v,?_⟩ + change fderiv ℝ ρ p (-v) < 0 + rw [map_neg] + linarith + have hsub : {v : Plane | fderiv ℝ ρ p v < 0} ⊆ tangentConeAt ℝ Ω p := by + intro v hv + apply mem_tangentConeAt_of_add_smul_mem (c := fun t : ℝ => t) + (tendsto_id'.mpr (nhdsGT_le_nhdsNE (0 : ℝ))) + have ht : Tendsto (fun t : ℝ => p + t • v) (𝓝[>] 0) (𝓝 p) := by + simpa using tendsto_const_nhds.add ((tendsto_id'.mpr (nhdsWithin_le_nhds : 𝓝[>] (0 : ℝ) ≤ 𝓝 0)).smul_const v) + filter_upwards [HasFDerivAt.eventually_lt_along_ray hρ.hasFDerivAt hv,ht (hU.mem_nhds hpU)] with t hneg htU + have hh : p + t • v ∈ {x | ρ x < 0} ∩ U := ⟨by change ρ (p + t • v) < 0; simpa only [hp] using hneg,htU⟩ + rw [← hlevel] at hh + exact hh.1 + have hspan : Submodule.span ℝ (tangentConeAt ℝ Ω p) = ⊤ := by + apply Submodule.eq_top_of_nonempty_interior' + obtain ⟨v,hv⟩ := hne + refine ⟨v,?_⟩ + exact interior_mono (hsub.trans Submodule.subset_span) (hopen.interior_eq.symm ▸ hv) + rw [uniqueDiffWithinAt_iff,tangentConeAt_closure,hspan] + exact ⟨by simp,subset_closure hpcl⟩ + +lemma SmoothBoundary.uniqueDiffOn_closure {Ω : Set Plane} (hs : SmoothBoundary Ω) + (hΩ : IsOpen Ω) : UniqueDiffOn ℝ (closure Ω) := by + intro p hp + by_cases hpi : p ∈ Ω + · exact (hΩ.uniqueDiffOn p hpi).mono subset_closure + · have hpf : p ∈ frontier Ω := ⟨hp,by simpa only [hΩ.interior_eq] using hpi⟩ + obtain ⟨U,ρ,hU,hpU,hρ,hD,hpρ,hlevel⟩ := hs p hpf + exact regular_level_uniqueDiffWithinAt hU hpU + ((hρ p hpU).contDiffAt (hU.mem_nhds hpU) |>.differentiableAt (by simp)) + hD hpρ hlevel hp + +lemma SmoothBoundary.exterior_ball_in_neighborhood {Ω B : Set Plane} + (hs : SmoothBoundary Ω) {p : Plane} (hp : p ∈ frontier Ω) + (hB : IsOpen B) (hpB : p ∈ B) : + ∃ a ∈ B, ∃ ε > 0, ball a ε ⊆ Ωᶜ := by + obtain ⟨U,ρ,hU,hpU,hρ,hD,hpρ,hlevel⟩ := hs p hp + have hdρ : DifferentiableAt ℝ ρ p := + ((hρ p hpU).contDiffAt (hU.mem_nhds hpU)).differentiableAt (by simp) + obtain ⟨v,hv⟩ : ∃ v, 0 < fderiv ℝ ρ p v := by + have hn : ∃ v, fderiv ℝ ρ p v ≠ 0 := by + by_contra hh + apply hD + ext v + simpa using not_exists.mp hh v + obtain ⟨v,hv⟩ := hn + rcases lt_or_gt_of_ne hv with hv | hv + · exact ⟨-v,by rw [map_neg]; linarith⟩ + · exact ⟨v,hv⟩ + have hray := HasFDerivAt.eventually_lt_along_ray hdρ.hasFDerivAt.neg + (show (-fderiv ℝ ρ p) v < 0 by simpa using hv) + have ht : Tendsto (fun t : ℝ => p + t • v) (𝓝[>] 0) (𝓝 p) := by + simpa using tendsto_const_nhds.add ((tendsto_id'.mpr + (nhdsWithin_le_nhds : 𝓝[>] (0 : ℝ) ≤ 𝓝 0)).smul_const v) + have hbt : ∀ᶠ t in 𝓝[>] (0 : ℝ), p+t•v ∈ B := ht (hB.mem_nhds hpB) + have hut : ∀ᶠ t in 𝓝[>] (0 : ℝ), p+t•v ∈ U := ht (hU.mem_nhds hpU) + obtain ⟨t,htρ,htB,htU⟩ := (hray.and (hbt.and hut)).exists + have htpos : 0 < ρ (p+t•v) := by simpa only [Pi.neg_apply,hpρ,neg_zero,neg_lt_zero] using htρ + have hopen : IsOpen (U ∩ {x | 0 < ρ x}) := + hρ.continuousOn.isOpen_inter_preimage hU isOpen_Ioi + obtain ⟨ε,hε,hεS⟩ := Metric.isOpen_iff.mp hopen (p+t•v) ⟨htU,htpos⟩ + refine ⟨p+t•v,htB,ε,hε,?_⟩ + intro y hy hyΩ + have hyS := hεS hy + have hy' : y ∈ Ω ∩ U := ⟨hyΩ,hyS.1⟩ + rw [hlevel] at hy' + exact lt_asymm (show ρ y < 0 from hy'.1) (show 0 < ρ y from hyS.2) + +end StrictHotSpots +end SmoothBoundaryGeometryCompatibleLayer + + +section SmoothRollingBallsCompatibleLayer + +open Set Metric Filter +open scoped Topology ContDiff NNReal +namespace StrictHotSpots + +lemma boundary_level_zero {Ω U : Set Plane} {ρ : Plane → ℝ} {q : Plane} + (ho : IsOpen Ω) (hU : IsOpen U) (hq : q ∈ frontier Ω) (hqU : q ∈ U) + (hc : ContinuousAt ρ q) (hlevel : Ω ∩ U = {x | ρ x < 0} ∩ U) : ρ q = 0 := by + have hnonneg : 0 ≤ ρ q := by + by_contra hh + have hmem : q ∈ Ω ∩ U := hlevel ▸ ⟨lt_of_not_ge hh,hqU⟩ + exact hq.2 (ho.interior_eq.symm ▸ hmem.1) + apply le_antisymm _ hnonneg + by_contra hh + have hp : 0 < ρ q := lt_of_not_ge hh + have hnh : U ∩ ρ ⁻¹' Ioi 0 ∈ 𝓝 q := + inter_mem (hU.mem_nhds hqU) (hc.preimage_mem_nhds (Ioi_mem_nhds hp)) + obtain ⟨x,⟨hxU,hxρ⟩,hxΩ⟩ := mem_closure_iff_nhds.mp hq.1 _ hnh + have hx : x ∈ {x | ρ x < 0} ∩ U := hlevel ▸ ⟨hxΩ,hxU⟩ + exact lt_asymm (show ρ x < 0 from hx.1) (show 0 < ρ x from hxρ) + + + + +lemma SmoothBoundary.local_rolling_balls {Ω : Set Plane} (hs : SmoothBoundary Ω) + (ho : IsOpen Ω) {p : Plane} (hp : p ∈ frontier Ω) : + ∃ (V : Set Plane), IsOpen V ∧ p ∈ V ∧ ∃ r > 0, + ∀ q ∈ frontier Ω ∩ V, ∃ n : Plane, ‖n‖ = 1 ∧ + ball (q-r•n) r ⊆ Ω ∧ ball (q+r•n) r ⊆ Ωᶜ := by + obtain ⟨U,ρ,hU,hpU,hρ,hD,hpρ,hlevel⟩ := hs p hp + have hc : ContDiffAt ℝ ∞ ρ p := (hρ p hpU).contDiffAt (hU.mem_nhds hpU) + have hdc : ContDiffAt ℝ 1 (fderiv ℝ ρ) p := hc.fderiv_right (by exact WithTop.coe_le_coe.mpr le_top) + obtain ⟨K,A,hA,hL⟩ := hdc.exists_lipschitzOnWith + let a : ℝ := ‖fderiv ℝ ρ p‖/2 + have ha : 0 < a := half_pos (norm_pos_iff.mpr hD) + have han : a < ‖fderiv ℝ ρ p‖ := by dsimp [a]; linarith [norm_pos_iff.mpr hD] + have hAn : {x | a < ‖fderiv ℝ ρ x‖} ∈ 𝓝 p := + hdc.continuousAt.norm.preimage_mem_nhds (Ioi_mem_nhds han) + obtain ⟨R,hR,hsub⟩ := Metric.mem_nhds_iff.mp + (inter_mem (hU.mem_nhds hpU) (inter_mem hA hAn)) + let r : ℝ := min (R/8) (a/(4*((K:ℝ)+1))) + have hr : 0 < r := lt_min (by positivity) (by positivity) + have hrR : 2*r ≤ R/4 := by have := min_le_left (R/8) (a/(4*((K:ℝ)+1))); dsimp [r]; linarith + have hrK : 2*r*(K:ℝ) ≤ a := by + have hh : r ≤ a/(4*((K:ℝ)+1)) := min_le_right _ _ + have hc' : 0 < 4*((K:ℝ)+1) := by positivity + have hh' := (le_div_iff₀ hc').mp hh + nlinarith [K.coe_nonneg] + refine ⟨ball p (R/4),isOpen_ball,mem_ball_self (by positivity),r,hr,?_⟩ + intro q hq + have hqR : q ∈ ball p R := ball_subset_ball (by linarith : R/4 ≤ R) hq.2 + have hqU := (hsub hqR).1 + have hqρ : ρ q = 0 := boundary_level_zero ho hU hq.1 hqU + ((hρ q hqU).contDiffAt (hU.mem_nhds hqU)).continuousAt hlevel + let g := gradient ρ q + have hg : ‖g‖ = ‖fderiv ℝ ρ q‖ := by simp [g,gradient] + have hga : a < ‖g‖ := by rw [hg]; exact (hsub hqR).2.2 + have hgpos : 0 < ‖g‖ := ha.trans hga + let n : Plane := ‖g‖⁻¹ • g + have hn : ‖n‖ = 1 := by simp [n,norm_smul,ne_of_gt hgpos] + have hDq (v : Plane) : fderiv ℝ ρ q v = ‖g‖*inner ℝ n v := by + rw [show n = ‖g‖⁻¹ • g from rfl,real_inner_smul_left, + ← mul_assoc,mul_inv_cancel₀ hgpos.ne',one_mul] + exact inner_gradient_left.symm + have hball : ball q (2*r) ⊆ ball p R := by + intro x hx + calc + dist x p ≤ dist x q + dist q p := dist_triangle _ _ _ + _ < 2*r+R/4 := add_lt_add hx hq.2 + _ < R := by linarith + have hT (x : Plane) (hx : x ∈ ball p R) : + ‖ρ x-ρ q-fderiv ℝ ρ q (x-q)‖ ≤ (K:ℝ)*‖x-q‖^2 := + Rolling.taylor_quadratic (convex_ball p R) + (fun y hy => ((hρ y (hsub hy).1).contDiffAt + (hU.mem_nhds (hsub hy).1)).differentiableAt (by simp)) + (hL.mono (fun _ hy => (hsub hy).2.1)) hqR hx + obtain ⟨hin,hout⟩ := Rolling.balls_of_taylor hn hgpos hr + (hrK.trans hga.le) hqρ hDq hball hT + refine ⟨n,hn,?_,?_⟩ + · intro x hx + have hxR : x ∈ ball p R := hball (by + have hh : dist x q < 2*r := by + have hd : dist (q-r•n) q = r := by + simp [norm_smul,hn,abs_of_pos hr] + calc + dist x q ≤ dist x (q-r•n)+dist (q-r•n) q := dist_triangle _ _ _ + _ < r+r := add_lt_add_of_lt_of_le hx (le_of_eq hd) + _ = 2*r := by ring + exact hh) + have hh : x ∈ Ω ∩ U := hlevel ▸ ⟨hin hx,(hsub hxR).1⟩ + exact hh.1 + · intro x hx hxΩ + have hxU : x ∈ U := (hsub (hball (by + have hd : dist (q+r•n) q = r := by + simp [dist_eq_norm,norm_smul,hn,abs_of_pos hr] + calc + dist x q ≤ dist x (q+r•n)+dist (q+r•n) q := dist_triangle _ _ _ + _ < r+r := add_lt_add_of_lt_of_le hx (le_of_eq hd) + _ = 2*r := by ring))).1 + have hh : x ∈ {x | ρ x < 0} ∩ U := hlevel ▸ ⟨hxΩ,hxU⟩ + exact lt_asymm (show 0 < ρ x from hout hx) (show ρ x < 0 from hh.1) + +end StrictHotSpots +end SmoothRollingBallsCompatibleLayer + + +section UniformRollingBallsCompatibleLayer +open Set Metric Filter +open scoped Topology +namespace StrictHotSpots + +lemma finite_positive_lower {α : Type*} (s : Finset α) (f : α → ℝ) + (hf : ∀ a ∈ s, 0 < f a) : ∃ r > 0, ∀ a ∈ s, r ≤ f a := by + classical + induction s using Finset.induction_on with + | empty => exact ⟨1,by norm_num,by simp⟩ + | @insert a s hmem ih => + obtain ⟨r,hr,hR⟩ := ih (fun b hb => hf b (Finset.mem_insert_of_mem hb)) + refine ⟨min r (f a),lt_min hr (hf a (Finset.mem_insert_self _ _)),?_⟩ + intro b hb + rcases Finset.mem_insert.mp hb with rfl | hb + · exact min_le_right _ _ + · exact (min_le_left _ _).trans (hR b hb) + + + + +theorem SmoothBoundary.uniform_rolling_balls {Ω : Set Plane} (hs : SmoothBoundary Ω) + (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) : + ∃ r > 0, ∀ p ∈ frontier Ω, ∃ n : Plane, ‖n‖ = 1 ∧ + ball (p-r•n) r ⊆ Ω ∧ ball (p+r•n) r ⊆ Ωᶜ := by + classical + have hlocal (p : frontier Ω) := hs.local_rolling_balls ho p.property + choose V hVo hpV r hr hballs using hlocal + have hc : IsCompact (frontier Ω) := + hb.isCompact_closure.of_isClosed_subset isClosed_frontier frontier_subset_closure + have hcover : frontier Ω ⊆ ⋃ p : frontier Ω, V p := by + intro p hp + exact mem_iUnion.mpr ⟨⟨p,hp⟩,hpV ⟨p,hp⟩⟩ + obtain ⟨s,hcov⟩ := hc.elim_finite_subcover V hVo hcover + obtain ⟨R,hR,hRs⟩ := finite_positive_lower s r (fun p _ => hr p) + refine ⟨R,hR,?_⟩ + intro p hp + obtain ⟨q,hq⟩ := mem_iUnion.mp (hcov hp) + obtain ⟨hqs,hpV⟩ := mem_iUnion.mp hq + obtain ⟨n,hn,hin,hout⟩ := hballs q p ⟨hp,hpV⟩ + refine ⟨n,hn,?_,?_⟩ + · have hmono := Rolling.tangent_ball_mono (p := p) (n := -n) + (by simpa only [norm_neg] using hn) (hRs q hqs) + have hmono' : ball (p-R•n) R ⊆ ball (p-r q•n) (r q) := by + simpa only [smul_neg,← sub_eq_add_neg] using hmono + exact hmono'.trans hin + · exact (Rolling.tangent_ball_mono hn (hRs q hqs)).trans hout + +end StrictHotSpots +end UniformRollingBallsCompatibleLayer + + +section RiemannBoundaryGeometryCompatibleLayer +open Set Metric Filter +open scoped Topology +namespace StrictHotSpots + + +theorem SmoothBoundary.complex_rolling_balls {Ω : Set Plane} (hs : SmoothBoundary Ω) + (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) : + ∃ r > 0, ∀ p ∈ frontier (Conformal.coordinate ⁻¹' Ω), ∃ n : ℂ, ‖n‖ = 1 ∧ + ball (p-r•n) r ⊆ Conformal.coordinate ⁻¹' Ω ∧ + ball (p+r•n) r ⊆ (Conformal.coordinate ⁻¹' Ω)ᶜ := by + obtain ⟨r,hr,hR⟩ := hs.uniform_rolling_balls ho hb + refine ⟨r,hr,?_⟩ + intro p hp + have hp' : Conformal.coordinate p ∈ frontier Ω := by + change p ∈ Conformal.coordinate.toHomeomorph ⁻¹' frontier Ω + rw [Conformal.coordinate.toHomeomorph.preimage_frontier] + exact hp + obtain ⟨n,hn,hin,hout⟩ := hR _ hp' + refine ⟨Conformal.coordinate.symm n,by simpa using hn,?_,?_⟩ + · intro x hx + apply hin + simpa only [mem_ball,← Conformal.coordinate.dist_map x (p-r•Conformal.coordinate.symm n), + map_sub,map_smul,LinearIsometryEquiv.apply_symm_apply] using hx + · intro x hx + apply hout + simpa only [mem_ball,← Conformal.coordinate.dist_map x (p+r•Conformal.coordinate.symm n), + map_add,map_smul,LinearIsometryEquiv.apply_symm_apply] using hx + +namespace Riemann +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [ProperSpace E] + +omit [NormedSpace ℝ E] [ProperSpace E] in +lemma boundary_distance_pos {U : Set E} (ho : IsOpen U) (hc : Uᶜ.Nonempty) + {x : E} (hx : x ∈ U) : 0 < infDist x Uᶜ := by + apply (infDist_pos_iff_notMem_closure hc).mp + rwa [ho.isClosed_compl.closure_eq,mem_compl_iff,not_not] + + + +lemma nearest_frontier {U : Set E} (ho : IsOpen U) (hc : Uᶜ.Nonempty) + {x : E} (hx : x ∈ U) : + ∃ p ∈ frontier U, dist x p = infDist x Uᶜ ∧ x ≠ p ∧ + ball x (dist x p) ⊆ U := by + obtain ⟨p,hp,he⟩ := ho.isClosed_compl.exists_infDist_eq_dist hc x + have hδ := boundary_distance_pos ho hc hx + have hball : ball x (dist x p) ⊆ U := by + rw [← he] + exact ball_infDist_compl_subset + have hpcl : p ∈ closure U := by + have hpc : p ∈ closedBall x (dist x p) := by simp [dist_comm] + rw [← closure_ball x (by linarith : dist x p ≠ 0)] at hpc + exact closure_mono hball hpc + refine ⟨p,?_,he.symm,?_,hball⟩ + · rw [frontier_eq_closure_inter_closure,ho.isClosed_compl.closure_eq] + exact ⟨hpcl,hp⟩ + · exact dist_ne_zero.mp (by linarith) + +omit [NormedSpace ℝ E] in + + +lemma compact_core {U : Set E} (hb : Bornology.IsBounded U) {r : ℝ} (hr : 0 < r) : + IsCompact {x | x ∈ closure U ∧ r ≤ infDist x Uᶜ} ∧ + {x | x ∈ closure U ∧ r ≤ infDist x Uᶜ} ⊆ U := by + have hclosed : IsClosed {x : E | r ≤ infDist x Uᶜ} := + isClosed_le continuous_const (continuous_infDist_pt Uᶜ) + refine ⟨hb.isCompact_closure.inter_right hclosed,?_⟩ + intro x hx + by_contra hnot + have hz : infDist x Uᶜ = 0 := infDist_zero_of_mem hnot + linarith [hx.2] + +end Riemann +end StrictHotSpots +end RiemannBoundaryGeometryCompatibleLayer + + +section RiemannBoundaryDistanceCompatibleLayer +open Set Metric Filter +open scoped Topology +namespace StrictHotSpots.Riemann + +lemma compact_disk_separation {U K : Set ℂ} (hK : IsCompact K) (hKU : K ⊆ U) + {f : ℂ → ℂ} (hf : ContinuousOn f U) (hm : MapsTo f U (ball 0 1)) : + ∃ m : ℝ, 0 ≤ m ∧ m < 1 ∧ ∀ x ∈ K, ‖f x‖ ≤ m := by + rcases K.eq_empty_or_nonempty with rfl | hne + · exact ⟨0,le_rfl,by norm_num,by simp⟩ + obtain ⟨a,ha,hmax⟩ := hK.exists_isMaxOn hne (hf.norm.mono hKU) + exact ⟨‖f a‖,norm_nonneg _,mem_ball_zero_iff.mp (hm (hKU ha)),hmax⟩ + +lemma core_of_ball_subset {U : Set ℂ} (hc : Uᶜ.Nonempty) {c : ℂ} {r : ℝ} + (hr : 0 < r) (hin : ball c r ⊆ U) : + c ∈ {x | x ∈ closure U ∧ r ≤ infDist x Uᶜ} := by + refine ⟨subset_closure (hin (mem_ball_self hr)),(le_infDist hc).mpr ?_⟩ + intro y hy + by_contra h + exact hy (hin (by simpa only [mem_ball,dist_comm] using lt_of_not_ge h)) + + + + +theorem domain_distance_le_disk_distance {U : Set ℂ} (ho : IsOpen U) + (hb : Bornology.IsBounded U) (hc : Uᶜ.Nonempty) + {r : ℝ} (hr : 0 < r) + (hroll : ∀ p ∈ frontier U, ∃ n : ℂ, ‖n‖ = 1 ∧ + ball (p-r•n) r ⊆ U ∧ ball (p+r•n) r ⊆ Uᶜ) + {f : ℂ → ℂ} (hd : DifferentiableOn ℂ f U) (hm : MapsTo f U (ball 0 1)) : + ∃ C > 0, ∀ x ∈ U, infDist x Uᶜ ≤ C*(1-‖f x‖) := by + let K : Set ℂ := {x | x ∈ closure U ∧ r ≤ infDist x Uᶜ} + have hK := compact_core hb hr + obtain ⟨m,hm0,hm1,hfm⟩ := compact_disk_separation hK.1 hK.2 hd.continuousOn hm + obtain ⟨M,hM⟩ := (hb.isCompact_closure.image (continuous_infDist_pt Uᶜ)).bddAbove + let C := max (2*r/(1-m)^2) ((|M|+1)/(1-m)) + have hp : 0 < 1-m := sub_pos.mpr hm1 + have hpp : 0 < (1-m)^2 := sq_pos_of_pos hp + have hC : 0 < C := lt_of_lt_of_le (by positivity : 0 < 2*r/(1-m)^2) (le_max_left _ _) + refine ⟨C,hC,?_⟩ + intro x hx + have hfx : 0 < 1-‖f x‖ := sub_pos.mpr (mem_ball_zero_iff.mp (hm hx)) + by_cases hnear : infDist x Uᶜ < r + · obtain ⟨p,hpfr,hpd,hxp,hball⟩ := nearest_frontier ho hc hx + obtain ⟨n,hn,hin,hout⟩ := hroll p hpfr + obtain ⟨hdist,hxin⟩ := Rolling.near_interior_ball hn hr hxp hball hout (by rwa [hpd]) + have hcenter : p-r•n ∈ K := core_of_ball_subset hc hr hin + have hh := disk_distance_from_interior_ball (hd.mono hin) (hm.mono_left hin) + hxin hm1 (hfm _ hcenter) + rw [hdist] at hh + have hh' : infDist x Uᶜ ≤ (2*r/(1-m)^2)*(1-‖f x‖) := by + rw [div_mul_eq_mul_div] + apply (le_div_iff₀ hpp).mpr + nlinarith only [hh,hpd] + exact hh'.trans (mul_le_mul_of_nonneg_right (le_max_left _ _) hfx.le) + · have hxK : x ∈ K := ⟨subset_closure hx,le_of_not_gt hnear⟩ + have hnorm := hfm x hxK + have hxm : infDist x Uᶜ ≤ M := hM ⟨x,subset_closure hx,rfl⟩ + have hxm' : infDist x Uᶜ ≤ |M|+1 := hxm.trans (by linarith [le_abs_self M]) + have hh : infDist x Uᶜ ≤ ((|M|+1)/(1-m))*(1-‖f x‖) := by + calc + _ ≤ |M|+1 := hxm' + _ = ((|M|+1)/(1-m))*(1-m) := by field_simp + _ ≤ _ := mul_le_mul_of_nonneg_left (by linarith) (by positivity) + exact hh.trans (mul_le_mul_of_nonneg_right (le_max_right _ _) hfx.le) + +end StrictHotSpots.Riemann +end RiemannBoundaryDistanceCompatibleLayer + + +section RiemannDerivativeBoundCompatibleLayer +open Set Metric Filter _root_.Complex _root_.OAI.Complex +open scoped Topology +namespace StrictHotSpots.Riemann + +lemma exterior_ball_distance {U : Set ℂ} (ho : IsOpen U) (hc : Uᶜ.Nonempty) + {r : ℝ} (hr : 0 < r) {b y : ℂ} (hout : ball b r ⊆ Uᶜ) (hy : y ∈ U) : + r+infDist y Uᶜ ≤ dist y b := by + have hδ := boundary_distance_pos ho hc hy + have hdisj : Disjoint (ball y (infDist y Uᶜ)) (ball b r) := by + refine disjoint_left.mpr (fun a ha ha' => ?_) + exact hout ha' (ball_infDist_compl_subset ha) + simpa only [add_comm] using (disjoint_ball_ball_iff hδ hr).mp hdisj + + +theorem schwarz_exterior_ball {F : ℂ → ℂ} (hd : DifferentiableOn ℂ F (ball 0 1)) + {b : ℂ} {r : ℝ} (hr : 0 < r) + (hout : ∀ z ∈ ball (0:ℂ) 1, r < dist (F z) b) + {z : ℂ} (hz : z ∈ ball (0:ℂ) 1) : + r*‖deriv F z‖*(1-‖z‖^2) ≤ dist (F z) b ^2-r^2 := by + let f : ℂ → ℂ := fun w => (r:ℂ)/(F w-b) + have hne (w : ℂ) (hw : w ∈ ball (0:ℂ) 1) : F w-b ≠ 0 := by + apply norm_ne_zero_iff.mp + have hh := hout w hw + rw [dist_eq_norm] at hh + linarith + have hf (w : ℂ) (hw : w ∈ ball (0:ℂ) 1) : + HasDerivAt f (-(r:ℂ)*deriv F w/(F w-b)^2) w := by + simpa only [f,zero_mul,zero_sub,neg_mul] using + (hasDerivAt_const w (r:ℂ)).fun_div + (((hd w hw).differentiableAt (isOpen_ball.mem_nhds hw)).hasDerivAt.sub_const b) (hne w hw) + have hm : MapsTo f (ball 0 1) (ball 0 1) := by + intro w hw + rw [mem_ball_zero_iff] + dsimp [f] + rw [norm_div,norm_real,Real.norm_of_nonneg hr.le] + exact (div_lt_one (by simpa only [dist_eq_norm] using hr.trans (hout w hw))).mpr + (by simpa only [dist_eq_norm] using hout w hw) + have hh := schwarz_pick_deriv (fun w hw => (hf w hw).differentiableAt.differentiableWithinAt) hm hz + rw [(hf z hz).deriv,norm_div,norm_mul,norm_neg,norm_real,Real.norm_of_nonneg hr.le, + norm_pow] at hh + have he : ‖f z‖ = r/dist (F z) b := by + dsimp [f] + rw [norm_div,norm_real,Real.norm_of_nonneg hr.le,dist_eq_norm] + rw [he,← dist_eq_norm,div_pow] at hh + have hp : 0 < dist (F z) b ^2 := sq_pos_of_pos (hr.trans (hout z hz)) + have hh' := mul_le_mul_of_nonneg_right hh hp.le + have hc₁ : (r*‖deriv F z‖/dist (F z) b ^2*(1-‖z‖^2))*dist (F z) b ^2 = + r*‖deriv F z‖*(1-‖z‖^2) := by field_simp [(hr.trans (hout z hz)).ne'] + have hc₂ : (1-r^2/dist (F z) b ^2)*dist (F z) b ^2 = dist (F z) b ^2-r^2 := by field_simp [(hr.trans (hout z hz)).ne'] + rwa [hc₁,hc₂] at hh' + + + +theorem bounded_deriv_of_rolling_balls (e : OpenPartialHomeomorph ℂ ℂ) + (hes : e.source = ball 0 1) + (hd : DifferentiableOn ℂ e (ball 0 1)) + (hdi : DifferentiableOn ℂ e.symm e.target) + (hb : Bornology.IsBounded e.target) + (hc : e.targetᶜ.Nonempty) + {r : ℝ} (hr : 0 < r) + (hroll : ∀ p ∈ frontier e.target, ∃ n : ℂ, ‖n‖ = 1 ∧ + ball (p-r•n) r ⊆ e.target ∧ ball (p+r•n) r ⊆ e.targetᶜ) : + ∃ B > 0, ∀ z ∈ ball (0:ℂ) 1, ‖deriv e z‖ ≤ B := by + have hmi : MapsTo e.symm e.target (ball 0 1) := by simpa only [← hes] using e.mapsTo_symm + obtain ⟨C,hC,hδ⟩ := domain_distance_le_disk_distance e.open_target hb hc hr hroll hdi hmi + obtain ⟨M,hM⟩ := (hb.isCompact_closure.image (continuous_infDist_pt e.targetᶜ)).bddAbove + let L := 2*r+|M|+1 + have hL : 0 < L := by dsimp [L]; positivity + refine ⟨C*L/r,by positivity,?_⟩ + intro z hz + have hzs : z ∈ e.source := hes.symm ▸ hz + have hx : e z ∈ e.target := e.map_source hzs + have hδz : infDist (e z) e.targetᶜ ≤ C*(1-‖z‖) := by + simpa only [e.left_inv hzs] using hδ (e z) hx + have hδM : infDist (e z) e.targetᶜ ≤ M := hM ⟨e z,subset_closure hx,rfl⟩ + obtain ⟨p,hp,hpd,hxp,hball⟩ := nearest_frontier e.open_target hc hx + obtain ⟨n,hn,hin,hout⟩ := hroll p hp + have hnormal := Rolling.nearest_normal_of_balls hn hr hxp hball hout + have hdist : dist (e z) (p+r•n) = r+infDist (e z) e.targetᶜ := by + rw [dist_eq_norm,show e z-(p+r•n) = -(r+dist (e z) p)•n by + calc + _ = (p-dist (e z) p•n)-(p+r•n) := congrArg (fun a => a-(p+r•n)) hnormal + _ = _ := by module, + norm_smul,hn,mul_one,Real.norm_eq_abs,abs_neg,abs_of_pos (by positivity),hpd] + have hbound := schwarz_exterior_ball hd hr (fun w hw => + lt_of_lt_of_le (by linarith [boundary_distance_pos e.open_target hc (e.map_source (hes.symm ▸ hw))] : + r < r+infDist (e w) e.targetᶜ) + (exterior_ball_distance e.open_target hc hr hout (e.map_source (hes.symm ▸ hw)))) hz + rw [hdist] at hbound + have hleft : r*‖deriv e z‖*(1-‖z‖) ≤ r*‖deriv e z‖*(1-‖z‖^2) := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + have hz' := mem_ball_zero_iff.mp hz + nlinarith [norm_nonneg z] + have hright : (r+infDist (e z) e.targetᶜ)^2-r^2 ≤ L*(C*(1-‖z‖)) := by + calc + _ = (2*r+infDist (e z) e.targetᶜ)*infDist (e z) e.targetᶜ := by ring + _ ≤ L*(C*(1-‖z‖)) := mul_le_mul (by dsimp [L]; linarith [le_abs_self M]) hδz + infDist_nonneg hL.le + have hzz : 0 < 1-‖z‖ := sub_pos.mpr (mem_ball_zero_iff.mp hz) + have hh : r*‖deriv e z‖ ≤ L*C := (mul_le_mul_iff_left₀ hzz).mp (by + simpa only [mul_assoc,mul_comm,mul_left_comm] using hleft.trans (hbound.trans hright)) + apply (le_div_iff₀ hr).mpr + nlinarith only [hh] + +end StrictHotSpots.Riemann +end RiemannDerivativeBoundCompatibleLayer + + +section RiemannInverseBoundCompatibleLayer +open Set Metric Filter _root_.Complex _root_.OAI.Complex +open scoped Topology ComplexConjugate +namespace StrictHotSpots.Riemann + +lemma schwarz_pick_center {f : ℂ → ℂ} {c : ℂ} {r : ℝ} (hr : 0 < r) + (hd : DifferentiableOn ℂ f (ball c r)) (hm : MapsTo f (ball c r) (ball 0 1)) : + r*‖deriv f c‖ ≤ 1-‖f c‖^2 := by + have hc : c ∈ ball c r := mem_ball_self hr + have hfc : ‖f c‖ < 1 := mem_ball_zero_iff.mp (hm hc) + let g := fun y => mobius (f c) (f y) + have hg0 : g c = 0 := mobius_self _ + have hgd : DifferentiableOn ℂ g (ball c r) := by + intro y hy + exact ((hasDerivAt_mobius hfc (mem_ball_zero_iff.mp (hm hy))).differentiableAt.comp y + ((hd y hy).differentiableAt (isOpen_ball.mem_nhds hy))).differentiableWithinAt + have hgm : MapsTo g (ball c r) (closedBall (g c) 1) := by + intro y hy + rw [hg0,mem_closedBall_zero_iff] + exact (norm_mobius_lt hfc (mem_ball_zero_iff.mp (hm hy))).le + have hle := Complex.norm_deriv_le_div_of_mapsTo_ball hgd hgm hr + have hder := (hasDerivAt_mobius hfc hfc).comp c + ((hd c hc).differentiableAt (isOpen_ball.mem_nhds hc)).hasDerivAt + change HasDerivAt g (((1-conj (f c)*f c)/(1-conj (f c)*f c)^2)*deriv f c) c at hder + rw [hder.deriv,norm_mul,norm_mobius_self_deriv hfc] at hle + have hpos : 0 < 1-‖f c‖^2 := by nlinarith [norm_nonneg (f c)] + have hh : ‖deriv f c‖/(1-‖f c‖^2) ≤ 1/r := by simpa only [one_div,div_eq_mul_inv,mul_comm,one_mul] using hle + have hh' := (div_le_div_iff₀ hpos hr).mp hh + nlinarith only [hh'] + + + +theorem disk_distance_le_domain_distance (e : OpenPartialHomeomorph ℂ ℂ) + (hes : e.source = ball 0 1) (hd : DifferentiableOn ℂ e (ball 0 1)) + (hc : e.targetᶜ.Nonempty) {r : ℝ} (hr : 0 < r) + (hroll : ∀ p ∈ frontier e.target, ∃ n : ℂ, ‖n‖ = 1 ∧ + ball (p-r•n) r ⊆ e.target ∧ ball (p+r•n) r ⊆ e.targetᶜ) : + ∃ A > 0, ∀ z ∈ ball (0:ℂ) 1, 1-‖z‖ ≤ A*infDist (e z) e.targetᶜ := by + have h0 : (0:ℂ) ∈ e.source := by rw [hes]; exact mem_ball_self (by norm_num) + have hδ0 := boundary_distance_pos e.open_target hc (e.map_source h0) + let m := r/(r+infDist (e 0) e.targetᶜ) + have hm : m < 1 := (div_lt_one (by positivity)).mpr (by linarith only [hδ0]) + have hpos : 0 < (1-m)^2 := sq_pos_of_pos (sub_pos.mpr hm) + refine ⟨2/(r*(1-m)^2),by positivity,?_⟩ + intro z hz + have hzs : z ∈ e.source := hes.symm ▸ hz + have hx := e.map_source hzs + have hδ := boundary_distance_pos e.open_target hc hx + obtain ⟨p,hp,hpd,hxp,hball⟩ := nearest_frontier e.open_target hc hx + obtain ⟨n,hn,hin,hout⟩ := hroll p hp + let b := p+r•n + have hnormal := Rolling.nearest_normal_of_balls hn hr hxp hball hout + have hdist : dist (e z) b = r+infDist (e z) e.targetᶜ := by + rw [dist_eq_norm,show e z-b = -(r+dist (e z) p)•n by + calc + _ = (p-dist (e z) p•n)-(p+r•n) := congrArg (fun a => a-(p+r•n)) hnormal + _ = _ := by module, + norm_smul,hn,mul_one,Real.norm_eq_abs,abs_neg,abs_of_pos (by positivity),hpd] + have hsep (w : ℂ) (hw : w ∈ ball (0:ℂ) 1) : r < dist (e w) b := by + have hδw := boundary_distance_pos e.open_target hc (e.map_source (hes.symm ▸ hw)) + exact lt_of_lt_of_le (by linarith) (exterior_ball_distance e.open_target hc hr hout + (e.map_source (hes.symm ▸ hw))) + let f := fun w : ℂ => (r:ℂ)/(e w-b) + have hf : DifferentiableOn ℂ f (ball 0 1) := by + intro w hw + apply DifferentiableWithinAt.fun_div (differentiableWithinAt_const (r:ℂ)) ((hd w hw).sub_const b) + apply norm_ne_zero_iff.mp + have h := hr.trans (hsep w hw) + simpa only [dist_eq_norm] using h.ne' + have hnorm (w : ℂ) : ‖f w‖ = r/dist (e w) b := by + dsimp [f] + rw [norm_div,norm_real,Real.norm_of_nonneg hr.le,dist_eq_norm] + have hfm : MapsTo f (ball 0 1) (ball 0 1) := by + intro w hw + rw [mem_ball_zero_iff,hnorm] + exact (div_lt_one (hr.trans (hsep w hw))).mpr (hsep w hw) + have hfc : ‖f 0‖ ≤ m := by + rw [hnorm] + exact div_le_div_of_nonneg_left hr.le (by positivity) + (exterior_ball_distance e.open_target hc hr hout (e.map_source h0)) + have hh := disk_distance_from_interior_ball hf hfm hz hm hfc + rw [dist_zero_right,hnorm,hdist] at hh + have hright : r*(1-r/(r+infDist (e z) e.targetᶜ)) ≤ infDist (e z) e.targetᶜ := by + have hsum : 0 < r+infDist (e z) e.targetᶜ := by positivity + apply (mul_le_mul_iff_left₀ hsum).mp + field_simp + nlinarith [sq_nonneg (infDist (e z) e.targetᶜ)] + have hh' := mul_le_mul_of_nonneg_left hh hr.le + rw [div_mul_eq_mul_div] + apply (le_div_iff₀ (mul_pos hr hpos)).mpr + nlinarith only [hh',hright] + + + +theorem bounded_inverse_deriv_of_rolling_balls (e : OpenPartialHomeomorph ℂ ℂ) + (hes : e.source = ball 0 1) (hd : DifferentiableOn ℂ e (ball 0 1)) + (hdi : DifferentiableOn ℂ e.symm e.target) + (hc : e.targetᶜ.Nonempty) {r : ℝ} (hr : 0 < r) + (hroll : ∀ p ∈ frontier e.target, ∃ n : ℂ, ‖n‖ = 1 ∧ + ball (p-r•n) r ⊆ e.target ∧ ball (p+r•n) r ⊆ e.targetᶜ) : + ∃ B > 0, ∀ x ∈ e.target, ‖deriv e.symm x‖ ≤ B := by + obtain ⟨A,hA,hδ⟩ := disk_distance_le_domain_distance e hes hd hc hr hroll + refine ⟨2*A,by positivity,?_⟩ + intro x hx + have hδx := boundary_distance_pos e.open_target hc hx + have hin : ball x (infDist x e.targetᶜ) ⊆ e.target := ball_infDist_compl_subset + have hmi : MapsTo e.symm e.target (ball 0 1) := by + simpa only [← hes] using e.mapsTo_symm + have hh := schwarz_pick_center hδx (hdi.mono hin) (hmi.mono_left hin) + have hz : e.symm x ∈ ball (0:ℂ) 1 := hmi hx + have H : 1-‖e.symm x‖ ≤ A*infDist x e.targetᶜ := by + simpa only [e.right_inv hx] using hδ (e.symm x) hz + have H' : 1-‖e.symm x‖^2 ≤ 2*(A*infDist x e.targetᶜ) := by + have hsq := sq_nonneg (1-‖e.symm x‖) + nlinarith only [hsq,H] + exact (mul_le_mul_iff_right₀ hδx).mp (by + simpa only [mul_comm,mul_left_comm,mul_assoc] using hh.trans H') + +end StrictHotSpots.Riemann +end RiemannInverseBoundCompatibleLayer + + +section RiemannClosedExtensionCompatibleLayer +open Set Metric Filter _root_.Complex _root_.OAI.Complex +open scoped Topology NNReal +namespace StrictHotSpots.Riemann + +lemma complex_lipschitz_extension {f : ℂ → ℂ} {U : Set ℂ} {K : ℝ≥0} + (hf : LipschitzOnWith K f U) : + ∃ (F : ℂ → ℂ) (B : ℝ≥0), LipschitzWith B F ∧ EqOn f F U := by + obtain ⟨a,ha,hea⟩ := (Complex.reCLM.lipschitzWith.comp_lipschitzOnWith hf).extend_real + obtain ⟨b,hb,heb⟩ := (Complex.imCLM.lipschitzWith.comp_lipschitzOnWith hf).extend_real + let F : ℂ → ℂ := fun z => (a z:ℂ)+(b z:ℂ)*I + refine ⟨F,‖Complex.reCLM‖₊*K+‖Complex.imCLM‖₊*K,?_,?_⟩ + · apply LipschitzWith.of_dist_le_mul + intro x y + have h₁ := ha.dist_le_mul x y + have h₂ := hb.dist_le_mul x y + have hh := norm_le_abs_re_add_abs_im (F x-F y) + have hre : |(F x-F y).re| = dist (a x) (a y) := by simp [F,Real.dist_eq] + have him : |(F x-F y).im| = dist (b x) (b y) := by simp [F,Real.dist_eq] + rw [hre,him] at hh + simpa only [dist_eq_norm,NNReal.coe_add,NNReal.coe_mul,add_mul,mul_assoc] using + hh.trans (add_le_add h₁ h₂) + · intro x hx + apply Complex.ext + · simpa [F] using hea hx + · simpa [F] using heb hx + + + +theorem closed_disk_extension (e : OpenPartialHomeomorph ℂ ℂ) + (hes : e.source = ball 0 1) (hd : DifferentiableOn ℂ e (ball 0 1)) + {B : ℝ} (hB : 0 ≤ B) (hbound : ∀ z ∈ ball (0:ℂ) 1, ‖deriv e z‖ ≤ B) : + ∃ (F : ℂ → ℂ) (L : ℝ≥0), LipschitzWith L F ∧ EqOn e F (ball 0 1) ∧ + F '' closedBall 0 1 = closure e.target := by + have hLip : LipschitzOnWith ⟨B,hB⟩ e (ball 0 1) := + (convex_ball (0:ℂ) 1).lipschitzOnWith_of_nnnorm_deriv_le + (fun z hz => (hd z hz).differentiableAt (isOpen_ball.mem_nhds hz)) hbound + obtain ⟨F,L,hF,he⟩ := complex_lipschitz_extension hLip + have him : F '' ball (0:ℂ) 1 = e.target := by + calc + F '' ball (0:ℂ) 1 = e '' ball (0:ℂ) 1 := image_congr he.symm + _ = e.target := by rw [← hes,e.image_source_eq_target] + refine ⟨F,L,hF,he,?_⟩ + apply Subset.antisymm + · rw [← closure_ball (0:ℂ) (by norm_num : (1:ℝ) ≠ 0)] + simpa only [him] using image_closure_subset_closure_image (s := ball (0:ℂ) 1) hF.continuous + · have hclosed : IsClosed (F '' closedBall (0:ℂ) 1) := + ((isCompact_closedBall (0:ℂ) 1).image hF.continuous).isClosed + apply closure_minimal _ hclosed + rw [← him] + exact image_mono ball_subset_closedBall + +end StrictHotSpots.Riemann +end RiemannClosedExtensionCompatibleLayer + + +section RiemannGlobalInverseCompatibleLayer +open Set Metric Filter _root_.Complex _root_.OAI.Complex +open scoped Topology NNReal +namespace StrictHotSpots.Riemann + +lemma dist_image_le_on_ball {U : Set ℂ} (ho : IsOpen U) {f : ℂ → ℂ} + (hd : DifferentiableOn ℂ f U) {B : ℝ} (hB : ∀ z ∈ U, ‖deriv f z‖ ≤ B) + {c : ℂ} {r : ℝ} (hin : ball c r ⊆ U) {x y : ℂ} + (hx : x ∈ ball c r) (hy : y ∈ ball c r) : + dist (f x) (f y) ≤ B*dist x y := by + simpa only [dist_eq_norm] using (convex_ball c r).norm_image_sub_le_of_norm_deriv_le + (fun z hz => (hd z (hin hz)).differentiableAt (ho.mem_nhds (hin hz))) + (fun z hz => hB z (hin hz)) hy hx + + + + +theorem lipschitz_of_rolling_balls {U : Set ℂ} (ho : IsOpen U) (hc : Uᶜ.Nonempty) + {r : ℝ} (hr : 0 < r) + (hroll : ∀ p ∈ frontier U, ∃ n : ℂ, ‖n‖ = 1 ∧ + ball (p-r•n) r ⊆ U ∧ ball (p+r•n) r ⊆ Uᶜ) + {f : ℂ → ℂ} (hd : DifferentiableOn ℂ f U) + (hm : MapsTo f U (ball 0 1)) {B : ℝ} (hB : 0 < B) + (hbound : ∀ x ∈ U, ‖deriv f x‖ ≤ B) : + ∃ L : ℝ≥0, LipschitzOnWith L f U := by + let L : ℝ := 40*B+40/r + have hL : 0 < L := by dsimp [L]; positivity + refine ⟨⟨L,hL.le⟩,LipschitzOnWith.of_dist_le_mul ?_⟩ + intro x hx y hy + change dist (f x) (f y) ≤ L*dist x y + have hδx := boundary_distance_pos ho hc hx + have hδy := boundary_distance_pos ho hc hy + have hLB : B ≤ L := by + dsimp [L] + have := div_pos (by norm_num : (0:ℝ)<40) hr + linarith + by_cases hdirect : dist x y < infDist x Uᶜ + · have hh := dist_image_le_on_ball ho hd hbound (ball_infDist_compl_subset (s := U) (x := x)) + (mem_ball_self hδx) (by simpa only [mem_ball,dist_comm] using hdirect) + exact hh.trans (mul_le_mul_of_nonneg_right hLB dist_nonneg) + by_cases hnear : dist x y < r/10 + · let d := dist x y + have hd0 : 0 < d := hδx.trans_le (le_of_not_gt hdirect) + have hdx : infDist x Uᶜ ≤ d := le_of_not_gt hdirect + have hdy : infDist y Uᶜ ≤ 2*d := by + have hh : infDist y Uᶜ ≤ infDist x Uᶜ+dist y x := infDist_le_infDist_add_dist + rw [dist_comm y x] at hh + linarith + obtain ⟨p,hp,hpx,hxp,hballx⟩ := nearest_frontier ho hc hx + obtain ⟨q,hq,hqy,hyq,hbally⟩ := nearest_frontier ho hc hy + obtain ⟨n,hn,hip,hop⟩ := hroll p hp + obtain ⟨m,hnm,hiq,hoq⟩ := hroll q hq + have hxpball : x ∈ ball (p-r•n) r := + (Rolling.near_interior_ball hn hr hxp hballx hop (by rw [hpx]; dsimp [d] at hdx; linarith)).2 + have hyqball : y ∈ ball (q-r•m) r := + (Rolling.near_interior_ball hnm hr hyq hbally hoq (by rw [hqy]; dsimp [d] at hdy; linarith)).2 + have hpq : dist p q ≤ 4*d := by + have hh := dist_triangle4 p x y q + rw [dist_comm p x,hpx,hqy] at hh + dsimp [d] at * + linarith + have hcc : dist (p-r•n) (q-r•m) ≤ 8*d := + (Rolling.interior_centers_bound hr hn hnm hip hop hiq hoq).trans (by linarith) + let a := p-(9*d)•n + have ht : 9*d < r := by dsimp [d]; linarith + have hap : dist a p = 9*d := by + simp [a,hn,abs_of_pos hd0] + have hac : dist a (p-r•n) = r-9*d := by + rw [dist_eq_norm,show a-(p-r•n)=(r-9*d)•n by + dsimp only [a] + rw [sub_smul] + abel, + norm_smul,hn,mul_one,Real.norm_eq_abs,abs_of_pos (sub_pos.mpr ht)] + have ha₁ : a ∈ ball (p-r•n) r := by rw [mem_ball,hac]; linarith + have ha₂ : a ∈ ball (q-r•m) r := by + have hh := dist_triangle a (p-r•n) (q-r•m) + rw [hac] at hh + change dist a (q-r•m) < r + linarith + have hxa : dist x a ≤ 10*d := by + have hh := dist_triangle x p a + rw [hpx,dist_comm p a,hap] at hh + linarith + have hay : dist a y ≤ 11*d := by + have hh := dist_triangle a x y + rw [dist_comm a x] at hh + dsimp [d] at * + linarith + have h₁ := dist_image_le_on_ball ho hd hbound hip hxpball ha₁ + have h₂ := dist_image_le_on_ball ho hd hbound hiq ha₂ hyqball + calc + _ ≤ dist (f x) (f a)+dist (f a) (f y) := dist_triangle _ _ _ + _ ≤ B*(dist x a+dist a y) := by nlinarith only [h₁,h₂] + _ ≤ B*(21*d) := mul_le_mul_of_nonneg_left (by linarith) hB.le + _ ≤ L*d := by dsimp [L]; nlinarith [div_pos (by norm_num : (0:ℝ)<40) hr] + · have hfar : r/10 ≤ dist x y := le_of_not_gt hnear + have hdist : dist (f x) (f y) ≤ 2 := by + have hh := dist_triangle (f x) 0 (f y) + rw [dist_zero_right,dist_zero_left] at hh + linarith [mem_ball_zero_iff.mp (hm hx),mem_ball_zero_iff.mp (hm hy)] + apply hdist.trans + have hpos := div_mul_cancel₀ (40:ℝ) hr.ne' + have hh := mul_le_mul_of_nonneg_left hfar (show 0 ≤ 40/r by positivity) + dsimp [L] + nlinarith [mul_nonneg hB.le (dist_nonneg (x:=x) (y:=y))] + +end StrictHotSpots.Riemann +end RiemannGlobalInverseCompatibleLayer + + +section RiemannClosedBiholomorphicCompatibleLayer +open Set Metric Filter _root_.Complex _root_.OAI.Complex +open scoped Topology NNReal +namespace StrictHotSpots.Riemann + + + +theorem closed_bilipschitz_extension (e : OpenPartialHomeomorph ℂ ℂ) + (hes : e.source = ball 0 1) (hd : DifferentiableOn ℂ e (ball 0 1)) + (hdi : DifferentiableOn ℂ e.symm e.target) + (hb : Bornology.IsBounded e.target) (hc : e.targetᶜ.Nonempty) + {r : ℝ} (hr : 0 < r) + (hroll : ∀ p ∈ frontier e.target, ∃ n : ℂ, ‖n‖ = 1 ∧ + ball (p-r•n) r ⊆ e.target ∧ ball (p+r•n) r ⊆ e.targetᶜ) : + ∃ (F G : ℂ → ℂ) (L M : ℝ≥0), + LipschitzWith L F ∧ LipschitzWith M G ∧ + EqOn e F (ball 0 1) ∧ EqOn e.symm G e.target ∧ + F '' closedBall 0 1 = closure e.target ∧ + G '' closure e.target = closedBall 0 1 ∧ + (∀ z ∈ closedBall 0 1, G (F z) = z) ∧ + (∀ x ∈ closure e.target, F (G x) = x) := by + obtain ⟨B,hB,hbound⟩ := bounded_deriv_of_rolling_balls e hes hd hdi hb hc hr hroll + obtain ⟨F,L,hF,he,himage⟩ := closed_disk_extension e hes hd hB.le hbound + obtain ⟨C,hC,hcbound⟩ := bounded_inverse_deriv_of_rolling_balls e hes hd hdi hc hr hroll + have hmi : MapsTo e.symm e.target (ball 0 1) := by simpa only [← hes] using e.mapsTo_symm + obtain ⟨K,hK⟩ := lipschitz_of_rolling_balls e.open_target hc hr hroll hdi hmi hC hcbound + obtain ⟨G,M,hG,hi⟩ := complex_lipschitz_extension hK + have hleft₀ : EqOn (G ∘ F) id (ball (0:ℂ) 1) := by + intro z hz + change G (F z) = z + rw [← he hz,← hi (e.map_source (hes.symm ▸ hz)),e.left_inv (hes.symm ▸ hz)] + have hleft : ∀ z ∈ closedBall (0:ℂ) 1, G (F z) = z := by + have hh := hleft₀.closure (hG.continuous.comp hF.continuous) continuous_id + rwa [closure_ball (0:ℂ) (by norm_num : (1:ℝ) ≠ 0)] at hh + have hright₀ : EqOn (F ∘ G) id e.target := by + intro x hx + change F (G x) = x + rw [← hi hx,← he (hmi hx),e.right_inv hx] + have hright : ∀ x ∈ closure e.target, F (G x) = x := + hright₀.closure (hF.continuous.comp hG.continuous) continuous_id + refine ⟨F,G,L,M,hF,hG,he,hi,himage,?_,hleft,hright⟩ + rw [← himage,image_image] + exact image_congr hleft |>.trans (image_id _) + + + +def closedHomeomorph {F G : ℂ → ℂ} (hF : Continuous F) (hG : Continuous G) + {U : Set ℂ} (hf : MapsTo F (closedBall 0 1) (closure U)) + (hg : MapsTo G (closure U) (closedBall 0 1)) + (hl : ∀ z ∈ closedBall 0 1, G (F z) = z) + (hr : ∀ x ∈ closure U, F (G x) = x) : + (closedBall (0:ℂ) 1) ≃ₜ closure U where + toFun z := ⟨F z,hf z.property⟩ + invFun x := ⟨G x,hg x.property⟩ + left_inv z := Subtype.ext (hl z z.property) + right_inv x := Subtype.ext (hr x x.property) + continuous_toFun := hF.continuousOn.domRestrict.codRestrict _ + continuous_invFun := hG.continuousOn.domRestrict.codRestrict _ + +lemma closed_extension_frontier (e : OpenPartialHomeomorph ℂ ℂ) + (hes : e.source = ball 0 1) {F G : ℂ → ℂ} + (_he : EqOn e F (ball 0 1)) (hi : EqOn e.symm G e.target) + (hf : MapsTo F (closedBall 0 1) (closure e.target)) + (hl : ∀ z ∈ closedBall 0 1, G (F z) = z) : + MapsTo F (sphere 0 1) (frontier e.target) := by + intro z hz + rw [mem_sphere,dist_zero_right] at hz + have hzcl : z ∈ closedBall (0:ℂ) 1 := by simp only [mem_closedBall_zero_iff,hz,le_refl] + rw [e.open_target.frontier_eq] + refine ⟨hf hzcl,?_⟩ + intro hmem + have him : G (F z) ∈ ball (0:ℂ) 1 := by + rw [← hi hmem,← hes] + exact e.map_target hmem + rw [hl z hzcl,mem_ball_zero_iff,hz] at him + exact lt_irrefl _ him + +end StrictHotSpots.Riemann +end RiemannClosedBiholomorphicCompatibleLayer +end +end RiemannBoundaryCompatible + +section ActualClosedConformal + +noncomputable section +open Set Filter Metric MeasureTheory +open scoped Topology ContDiff NNReal +namespace StrictHotSpots.Conformal + + + +structure ClosedDiskChart (Ω : Set Plane) where + e : OpenPartialHomeomorph Plane Plane + d : Plane → ℂ + d' : Plane → ℂ + source_eq : e.source = DiskH10.disk + target_eq : e.target = Ω + smooth : ContDiffOn ℝ ∞ e e.source + inverse_smooth : ContDiffOn ℝ ∞ e.symm e.target + deriv : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x + inverse_deriv : ∀ y ∈ e.target, HasFDerivAt e.symm (planeMul (d' y)) y + nonzero : ∀ x ∈ e.source, d x ≠ 0 + inverse_nonzero : ∀ y ∈ e.target, d' y ≠ 0 + bound : ℝ + inverse_bound : ℝ + bound_pos : 0 < bound + inverse_bound_pos : 0 < inverse_bound + bounded_deriv : ∀ x ∈ e.source, ‖d x‖ ≤ bound + bounded_inverse_deriv : ∀ y ∈ e.target, ‖d' y‖ ≤ inverse_bound + F : Plane → Plane + G : Plane → Plane + Lip : ℝ≥0 + InvLip : ℝ≥0 + lipschitz : LipschitzWith Lip F + inverse_lipschitz : LipschitzWith InvLip G + agrees : EqOn e F e.source + inverse_agrees : EqOn e.symm G e.target + maps_closure : MapsTo F (closure e.source) (closure Ω) + inverse_maps_closure : MapsTo G (closure Ω) (closure e.source) + left_inverse : ∀ z ∈ closure e.source, G (F z) = z + right_inverse : ∀ x ∈ closure Ω, F (G x) = x + + + +theorem exists_closed_disk_chart {Ω : Set Plane} (hΩ : AdmissibleDomain Ω) : + Nonempty (ClosedDiskChart Ω) := by + let U : Set ℂ := coordinate ⁻¹' Ω + have ho : IsOpen U := hΩ.2.1.preimage coordinate.continuous + have hs : IsSimplyConnected U := coordinate.toHomeomorph.isSimplyConnected_preimage.mpr hΩ.2.2.2.1 + have hne : U.Nonempty := by + obtain ⟨x,hx⟩ := hΩ.1 + exact ⟨coordinate.symm x,by simpa [U] using hx⟩ + have hb : Bornology.IsBounded U := by + have he : U = coordinate.symm '' Ω := by + ext z + constructor + · intro hz + exact ⟨coordinate z,hz,coordinate.symm_apply_apply z⟩ + · rintro ⟨x,hx,rfl⟩ + simpa [U] using hx + rw [he] + exact coordinate.symm.lipschitz.isBounded_image hΩ.2.2.1 + have hproper : U ≠ univ := fun hh => NormedSpace.unbounded_univ ℝ ℂ (hh ▸ hb) + have hc : Uᶜ.Nonempty := nonempty_compl.mpr hproper + obtain ⟨Φ,hΦs,hΦt,hΦ,hΦi,hn,hn'⟩ := Riemann.exists_disk_biholomorphism ho hs hne hproper + obtain ⟨r,hr,hroll⟩ := hΩ.2.2.2.2.complex_rolling_balls hΩ.2.1 hΩ.2.2.1 + have hroll' : ∀ p ∈ frontier Φ.target, ∃ n : ℂ, ‖n‖=1 ∧ + ball (p-r•n) r ⊆ Φ.target ∧ ball (p+r•n) r ⊆ Φ.targetᶜ := by + simpa only [hΦt] using hroll + have hb' : Bornology.IsBounded Φ.target := hΦt.symm ▸ hb + have hc' : Φ.targetᶜ.Nonempty := hΦt.symm ▸ hc + obtain ⟨B,hB,hbd⟩ := Riemann.bounded_deriv_of_rolling_balls Φ hΦs hΦ + (hΦt.symm ▸ hΦi) hb' hc' hr hroll' + obtain ⟨C,hC,hcd⟩ := Riemann.bounded_inverse_deriv_of_rolling_balls Φ hΦs hΦ + (hΦt.symm ▸ hΦi) hc' hr hroll' + obtain ⟨F,G,L,M,hF,hG,he,hi,himage,himage',hl,hright⟩ := + Riemann.closed_bilipschitz_extension Φ hΦs hΦ (hΦt.symm ▸ hΦi) hb' hc' hr hroll' + let e := planeChart Φ + have hes : e.source = DiskH10.disk := by + rw [planeChart_source,hΦs] + ext x + simp only [mem_preimage,mem_ball,dist_zero_right,coordinate.symm.norm_map,DiskH10.disk] + have het : e.target = Ω := by + rw [planeChart_target,hΦt] + ext x + simp [U] + have hsrc (x : Plane) (hx : x ∈ e.source) : coordinate.symm x ∈ ball (0:ℂ) 1 := by + rwa [planeChart_source,hΦs] at hx + have htgt (x : Plane) (hx : x ∈ e.target) : coordinate.symm x ∈ U := by + rwa [planeChart_target,hΦt] at hx + have hsrccl (x : Plane) (hx : x ∈ closure e.source) : coordinate.symm x ∈ closedBall (0:ℂ) 1 := by + have hsball : e.source = ball (0:Plane) 1 := by + rw [hes] + rfl + rw [hsball,closure_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0)] at hx + simpa only [mem_closedBall_zero_iff,coordinate.symm.norm_map] using hx + have htgtcl (x : Plane) (hx : x ∈ closure Ω) : coordinate.symm x ∈ closure Φ.target := by + rw [hΦt] + change coordinate.symm x ∈ closure (coordinate.toHomeomorph ⁻¹' Ω) + rw [← coordinate.toHomeomorph.preimage_closure] + simpa using hx + let f : Plane → Plane := fun x => coordinate (F (coordinate.symm x)) + let g : Plane → Plane := fun x => coordinate (G (coordinate.symm x)) + have hf : LipschitzWith L f := by + apply LipschitzWith.of_dist_le_mul + intro x y + simpa only [f,coordinate.dist_map,coordinate.symm.dist_map] using hF.dist_le_mul (coordinate.symm x) (coordinate.symm y) + have hg : LipschitzWith M g := by + apply LipschitzWith.of_dist_le_mul + intro x y + simpa only [g,coordinate.dist_map,coordinate.symm.dist_map] using hG.dist_le_mul (coordinate.symm x) (coordinate.symm y) + refine ⟨{ + e := e + d := fun x => deriv Φ (coordinate.symm x) + d' := fun x => deriv Φ.symm (coordinate.symm x) + source_eq := hes + target_eq := het + smooth := ?_ + inverse_smooth := ?_ + deriv := ?_ + inverse_deriv := ?_ + nonzero := ?_ + inverse_nonzero := ?_ + bound := B + inverse_bound := C + bound_pos := hB + inverse_bound_pos := hC + bounded_deriv := ?_ + bounded_inverse_deriv := ?_ + F := f + G := g + Lip := L + InvLip := M + lipschitz := hf + inverse_lipschitz := hg + agrees := ?_ + inverse_agrees := ?_ + maps_closure := ?_ + inverse_maps_closure := ?_ + left_inverse := ?_ + right_inverse := ?_ }⟩ + · change ContDiffOn ℝ ∞ (fun x => coordinate (Φ (coordinate.symm x))) _ + rw [planeChart_source,hΦs] + exact conjugate_contDiffOn isOpen_ball hΦ + · change ContDiffOn ℝ ∞ (fun x => coordinate (Φ.symm (coordinate.symm x))) _ + rw [planeChart_target,hΦt] + exact conjugate_contDiffOn ho hΦi + · intro x hx + exact conjugate_hasFDerivAt ((hΦ _ (hsrc x hx)).differentiableAt (isOpen_ball.mem_nhds (hsrc x hx))) + · intro x hx + exact conjugate_hasFDerivAt ((hΦi _ (htgt x hx)).differentiableAt (ho.mem_nhds (htgt x hx))) + · intro x hx + exact hn _ (hsrc x hx) + · intro x hx + exact hn' _ (htgt x hx) + · intro x hx + exact hbd _ (hsrc x hx) + · intro x hx + exact hcd _ (hΦt.symm ▸ htgt x hx) + · intro x hx + exact congrArg coordinate (he (hsrc x hx)) + · intro x hx + change coordinate (Φ.symm (coordinate.symm x)) = coordinate (G (coordinate.symm x)) + have hm : coordinate.symm x ∈ Φ.target := by rw [hΦt]; exact htgt x hx + exact congrArg coordinate (hi hm) + · intro x hx + have hh : F (coordinate.symm x) ∈ closure Φ.target := himage ▸ mem_image_of_mem F (hsrccl x hx) + rw [hΦt] at hh + change coordinate (F (coordinate.symm x)) ∈ closure Ω + change F (coordinate.symm x) ∈ closure (coordinate.toHomeomorph ⁻¹' Ω) at hh + rwa [← coordinate.toHomeomorph.preimage_closure] at hh + · intro x hx + have hh : G (coordinate.symm x) ∈ closedBall (0:ℂ) 1 := himage' ▸ mem_image_of_mem G (htgtcl x hx) + have hsball : e.source = ball (0:Plane) 1 := by rw [hes]; rfl + rw [hsball,closure_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0)] + simpa only [g,mem_closedBall_zero_iff,coordinate.norm_map] using hh + · intro x hx + simpa only [f,g,coordinate.symm_apply_apply,coordinate.apply_symm_apply] using congrArg coordinate (hl _ (hsrccl x hx)) + · intro x hx + simpa only [f,g,coordinate.symm_apply_apply,coordinate.apply_symm_apply] using congrArg coordinate (hright _ (htgtcl x hx)) + +end StrictHotSpots.Conformal +end +end ActualClosedConformal + +section ClosedConformalData + +noncomputable section +open Set Filter Metric +open scoped ContDiff NNReal +namespace StrictHotSpots.Conformal.ClosedDiskChart +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + + + +def diskMap : OpenPartialHomeomorph Plane Plane where + toFun := c.e + invFun := c.e.symm + source := DiskH10.disk + target := Ω + map_source' := fun _ hx => c.target_eq.subset (c.e.map_source (c.source_eq.symm.subset hx)) + map_target' := fun _ hy => c.source_eq.subset (c.e.map_target (c.target_eq.symm.subset hy)) + left_inv' := fun _ hx => c.e.left_inv (c.source_eq.symm ▸ hx) + right_inv' := fun _ hy => c.e.right_inv (c.target_eq.symm ▸ hy) + open_source := PlaneGreen.diskOpen + open_target := c.target_eq ▸ c.e.open_target + continuousOn_toFun := c.source_eq ▸ c.e.continuousOn + continuousOn_invFun := c.e.continuousOn_symm.mono c.target_eq.symm.subset + +lemma diskMap_eq : c.diskMap = c.e := by + apply OpenPartialHomeomorph.ext c.diskMap c.e (fun _ => rfl) (fun _ => rfl) + exact c.source_eq.symm + +lemma diskMap_smooth : ContDiffOn ℝ ∞ c.diskMap DiskH10.disk := by + change ContDiffOn ℝ ∞ c.e DiskH10.disk + exact c.source_eq ▸ c.smooth +lemma diskMap_inverse_smooth : ContDiffOn ℝ ∞ c.diskMap.symm Ω := by + change ContDiffOn ℝ ∞ c.e.symm Ω + exact c.inverse_smooth.mono c.target_eq.symm.subset +lemma diskMap_deriv : ∀ x ∈ DiskH10.disk, HasFDerivAt c.diskMap (planeMul (c.d x)) x := + fun x hx => c.deriv x (c.source_eq.symm ▸ hx) +lemma diskMap_inverse_deriv : ∀ y ∈ Ω, HasFDerivAt c.diskMap.symm (planeMul (c.d' y)) y := + fun y hy => c.inverse_deriv y (c.target_eq.symm ▸ hy) +lemma continuous_closed : ContinuousOn c.F (closure DiskH10.disk) := c.lipschitz.continuous.continuousOn +lemma maps_closed : MapsTo c.F (closure DiskH10.disk) (closure Ω) := c.source_eq ▸ c.maps_closure +lemma inverse_maps_closed : MapsTo c.G (closure Ω) (closure DiskH10.disk) := + c.source_eq ▸ c.inverse_maps_closure +lemma diskMap_agrees : EqOn c.diskMap c.F DiskH10.disk := fun _ hx => c.agrees (c.source_eq.symm ▸ hx) +lemma diskMap_inverse_agrees : EqOn c.diskMap.symm c.G Ω := fun _ hy => c.inverse_agrees (c.target_eq.symm ▸ hy) + +lemma maps_boundary : MapsTo c.F (frontier DiskH10.disk) (frontier Ω) := by + intro x hx + refine ⟨c.maps_closed hx.1,?_⟩ + rw [(show IsOpen Ω from c.target_eq ▸ c.e.open_target).interior_eq] + intro hy + have hg : c.G (c.F x) ∈ DiskH10.disk := by + rw [← c.diskMap_inverse_agrees hy] + exact c.diskMap.map_target hy + have hi := c.left_inverse x (c.source_eq.symm ▸ hx.1) + rw [hi] at hg + exact hx.2 ((show IsOpen DiskH10.disk from PlaneGreen.diskOpen).interior_eq.symm ▸ hg) + +lemma inverse_maps_boundary : MapsTo c.G (frontier Ω) (frontier DiskH10.disk) := by + intro x hx + refine ⟨c.inverse_maps_closed hx.1,?_⟩ + rw [(show IsOpen DiskH10.disk from PlaneGreen.diskOpen).interior_eq] + intro hy + have hg : c.F (c.G x) ∈ Ω := by + rw [← c.diskMap_agrees hy] + exact c.diskMap.map_source hy + rw [c.right_inverse x hx.1] at hg + exact hx.2 ((show IsOpen Ω from c.target_eq ▸ c.e.open_target).interior_eq.symm ▸ hg) + + +def boundaryHomeomorph : frontier DiskH10.disk ≃ₜ frontier Ω where + toFun x := ⟨c.F x,c.maps_boundary x.property⟩ + invFun y := ⟨c.G y,c.inverse_maps_boundary y.property⟩ + left_inv x := Subtype.ext (c.left_inverse x (c.source_eq.symm ▸ x.property.1)) + right_inv y := Subtype.ext (c.right_inverse y y.property.1) + continuous_toFun := (c.lipschitz.continuous.comp continuous_subtype_val).subtype_mk _ + continuous_invFun := (c.inverse_lipschitz.continuous.comp continuous_subtype_val).subtype_mk _ + +end StrictHotSpots.Conformal.ClosedDiskChart +end +end ClosedConformalData + +section ClosedSmoothData + + + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace Topology +namespace StrictHotSpots + + +def closedGradient (Ω : Set Plane) (u : Plane → ℝ) (x : Plane) : Plane := + (InnerProductSpace.toDual ℝ Plane).symm (fderivWithin ℝ u (closure Ω) x) + +lemma closedGradient_eq {Ω : Set Plane} {u : Plane → ℝ} (ho : IsOpen Ω) {x : Plane} + (hx : x ∈ Ω) : closedGradient Ω u x = gradient u x := by + unfold closedGradient gradient + rw [fderivWithin_of_mem_nhds (mem_of_superset (ho.mem_nhds hx) subset_closure)] + +lemma closedGradient_continuous {Ω : Set Plane} {u : Plane → ℝ} (ho : IsOpen Ω) + (hs : SmoothBoundary Ω) (hu : ContDiffOn ℝ ∞ u (closure Ω)) : + ContinuousOn (closedGradient Ω u) (closure Ω) := + (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp_continuousOn + (hu.continuousOn_fderivWithin (hs.uniqueDiffOn_closure ho) (by simp)) + + +lemma continuous_closure_memLp {Ω : Set Plane} {F : Type*} [NormedAddCommGroup F] + {f : Plane → F} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (hf : ContinuousOn f (closure Ω)) : MemLp f 2 (volume.restrict Ω) := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + obtain ⟨C,hC⟩ := hb.isCompact_closure.exists_bound_of_continuousOn hf + apply MemLp.of_bound ((hf.mono subset_closure).aestronglyMeasurable ho.measurableSet) C + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + exact hC x (subset_closure hx) + +lemma smooth_closure_H1 {Ω : Set Plane} {u : Plane → ℝ} + (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + (hu : ContDiffOn ℝ ∞ u (closure Ω)) : HasH1Gradient Ω u (gradient u) := by + apply HasH1Gradient.of_contDiffOn ho (hu.mono subset_closure) + (continuous_closure_memLp ho hb hu.continuousOn) + apply MemLp.ae_eq _ (continuous_closure_memLp ho hb (closedGradient_continuous ho hs hu)) + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + exact closedGradient_eq ho hx + +lemma smooth_closure_zero_H10 {Ω : Set Plane} {u : Plane → ℝ} + (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + (hu : ContDiffOn ℝ ∞ u (closure Ω)) (hz : ∀ x ∈ frontier Ω, u x = 0) : + (smooth_closure_H1 ho hb hs hu).toH1 ∈ h10Submodule ho := + smooth_zero_trace_memH10 ho hu (smooth_closure_H1 ho hb hs hu) hb hz + +lemma closure_directional_smooth {Ω : Set Plane} {u : Plane → ℝ} + (ho : IsOpen Ω) (hs : SmoothBoundary Ω) + (hu : ContDiffOn ℝ ∞ u (closure Ω)) (e : Plane) : + ContDiffOn ℝ ∞ (fun x => fderivWithin ℝ u (closure Ω) x e) (closure Ω) := + (hu.fderivWithin (hs.uniqueDiffOn_closure ho) (by simp)).clm_apply contDiffOn_const + +end StrictHotSpots + +namespace StrictHotSpots.Conformal.ClosedDiskChart +open Set Filter Metric MeasureTheory +open scoped ContDiff InnerProductSpace NNReal +open DiskH10 PlaneGreen +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + +def pullDatum (w : Plane → ℝ) : Plane → ℝ := w ∘ c.F + +lemma pullDatum_continuous {w : Plane → ℝ} (hw : ContinuousOn w (closure Ω)) : + ContinuousOn (c.pullDatum w) (closure disk) := hw.comp c.continuous_closed c.maps_closed + +lemma pullDatum_eq_inner {w : Plane → ℝ} : EqOn (c.pullDatum w) (w ∘ c.diskMap) disk := + fun _ hx => congrArg w (c.diskMap_agrees hx).symm + +lemma pullDatum_smooth {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w Ω) : + ContDiffOn ℝ ∞ (c.pullDatum w) disk := + (hw.comp c.diskMap_smooth c.diskMap.mapsTo).congr c.pullDatum_eq_inner + +lemma pullDatum_grad_norm {w : Plane → ℝ} (hw : DifferentiableOn ℝ w Ω) + {x : Plane} (hx : x ∈ disk) : + ‖gradient (c.pullDatum w) x‖ = ‖c.d x‖ * ‖gradient w (c.diskMap x)‖ := by + have he : c.pullDatum w =ᶠ[nhds x] w ∘ c.diskMap := + eventually_of_mem (diskOpen.mem_nhds hx) (fun _ hy => c.pullDatum_eq_inner hy) + have hg : gradient (c.pullDatum w) x = gradient (w ∘ c.diskMap) x := by + unfold gradient + rw [he.fderiv_eq] + rw [hg] + exact plane_norm_gradient_comp (c.diskMap_deriv x hx) + ((hw _ (c.diskMap.map_source hx)).differentiableAt + (c.diskMap.open_target.mem_nhds (c.diskMap.map_source hx))) + +lemma pullDatum_bounded_gradient (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) : + ∃ B : ℝ≥0, ∀ x ∈ disk, ‖gradient (c.pullDatum w) x‖ ≤ B := by + obtain ⟨C,hC⟩ := hb.isCompact_closure.exists_bound_of_continuousOn + (closedGradient_continuous c.diskMap.open_target hs hw) + let B : ℝ≥0 := ⟨c.bound * max C 0,mul_nonneg c.bound_pos.le (le_max_right _ _)⟩ + refine ⟨B,fun x hx => ?_⟩ + rw [c.pullDatum_grad_norm ((hw.mono subset_closure).differentiableOn (by simp)) hx] + have ht := c.diskMap.map_source hx + have hcg := hC (c.diskMap x) (subset_closure ht) + rw [closedGradient_eq (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) ht] at hcg + exact mul_le_mul (c.bounded_deriv x (c.source_eq.symm.subset hx)) + (hcg.trans (le_max_left _ _)) (norm_nonneg _) c.bound_pos.le + +lemma pullDatum_lipschitz (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) : + ∃ B : ℝ≥0, LipschitzOnWith B (c.pullDatum w) (closure disk) := by + obtain ⟨B,hB⟩ := c.pullDatum_bounded_gradient hb hs hw + have hsm := c.pullDatum_smooth (hw.mono subset_closure) + have hd (x : Plane) (hx : x ∈ disk) : DifferentiableAt ℝ (c.pullDatum w) x := + ((hsm.differentiableOn (by simp)) x hx).differentiableAt (diskOpen.mem_nhds hx) + have hf (x : Plane) (hx : x ∈ disk) : ‖fderiv ℝ (c.pullDatum w) x‖₊ ≤ B := by + change ‖fderiv ℝ (c.pullDatum w) x‖ ≤ (B : ℝ) + simpa only [gradient,LinearIsometryEquiv.norm_map] using hB x hx + exact ⟨B,LipschitzOnWith.closure (c.pullDatum_continuous hw.continuousOn) + ((convex_ball (0 : Plane) 1).lipschitzOnWith_of_nnnorm_fderiv_le hd hf)⟩ + +lemma pullDatum_H1 (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) : + HasH1Gradient disk (c.pullDatum w) (gradient (c.pullDatum w)) := by + have hsm := c.pullDatum_smooth (hw.mono subset_closure) + apply HasH1Gradient.of_contDiffOn diskOpen hsm + (continuous_closure_memLp diskOpen diskBounded (c.pullDatum_continuous hw.continuousOn)) + let : IsFiniteMeasure (volume.restrict disk) := isFiniteMeasure_restrict.mpr diskBounded.measure_lt_top.ne + obtain ⟨B,hB⟩ := c.pullDatum_bounded_gradient hb hs hw + have hc : ContinuousOn (gradient (c.pullDatum w)) disk := + (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp_continuousOn + (hsm.continuousOn_fderiv_of_isOpen diskOpen (by simp)) + apply MemLp.of_bound (hc.aestronglyMeasurable diskOpen.measurableSet) B + filter_upwards [ae_restrict_mem diskOpen.measurableSet] with x hx + exact hB x hx + +end StrictHotSpots.Conformal.ClosedDiskChart +end +end ClosedSmoothData + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/ClosedSolution.lean b/lean/OAI/Analysis/HotSpots/ClosedSolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..269afe602d76b95ed582731ff6654b9f142cc239 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/ClosedSolution.lean @@ -0,0 +1,538 @@ +import OAI.Analysis.HotSpots.Multiplier + +namespace OAI + +section ClosedChartTopology + +noncomputable section +open Set Metric +open scoped Topology +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + +lemma complex_maps_disk {z : ℂ} (hz : z ∈ ball 0 1) : c.F (complexIso z) ∈ Ω := by + have hx : complexIso z ∈ disk := by simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hz + rw [← c.diskMap_agrees hx] + exact c.diskMap.map_source hx + +lemma complex_maps_closed {z : ℂ} (hz : z ∈ closedBall 0 1) : c.F (complexIso z) ∈ closure Ω := by + apply c.maps_closed + simpa only [disk,closure_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0),mem_closedBall_zero_iff, + LinearIsometryEquiv.norm_map] using hz + +lemma complex_maps_boundary (s : Circle) : c.F (complexIso (s:ℂ)) ∈ frontier Ω := by + apply c.maps_boundary + simp only [disk,frontier_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0),mem_sphere_zero_iff_norm, + LinearIsometryEquiv.norm_map,Circle.norm_coe] + +lemma complex_inverse_disk {x : Plane} (hx : x ∈ Ω) : complexIso.symm (c.G x) ∈ ball 0 1 := by + have hh := c.diskMap.map_target hx + change c.diskMap.symm x ∈ disk at hh + rw [c.diskMap_inverse_agrees hx] at hh + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hh + +lemma complex_inverse_boundary {x : Plane} (hx : x ∈ frontier Ω) : ‖complexIso.symm (c.G x)‖ = 1 := by + have hh := c.inverse_maps_boundary hx + simpa only [disk,frontier_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0),mem_sphere_zero_iff_norm, + LinearIsometryEquiv.norm_map] using hh + +lemma complex_inverse_image (S : Set Plane) (hs : S ⊆ Ω) : + (fun x => complexIso.symm (c.G x)) '' S = ball 0 1 ∩ (fun z => c.F (complexIso z)) ⁻¹' S := by + ext z + constructor + · rintro ⟨x,hx,rfl⟩ + refine ⟨c.complex_inverse_disk (hs hx),?_⟩ + simpa only [mem_preimage,LinearIsometryEquiv.apply_symm_apply,c.right_inverse x (subset_closure (hs hx))] using hx + · rintro ⟨hz,hx⟩ + refine ⟨c.F (complexIso z),hx,?_⟩ + have hd : complexIso z ∈ closure disk := by + exact subset_closure (by simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hz) + change complexIso.symm (c.G (c.F (complexIso z))) = z + rw [c.left_inverse _ (c.source_eq.symm ▸ hd),LinearIsometryEquiv.symm_apply_apply] + +lemma connected_complex_pull {v : Plane → ℝ} {P : Set ℝ} + (hcon : IsConnected (Ω ∩ v ⁻¹' P)) : + IsConnected (ball (0:ℂ) 1 ∩ (fun z => v (c.F (complexIso z))) ⁻¹' P) := by + have hh := hcon.image (fun x => complexIso.symm (c.G x)) + (complexIso.symm.continuous.comp c.inverse_lipschitz.continuous).continuousOn + rw [c.complex_inverse_image _ inter_subset_left] at hh + convert hh using 1 + ext z + constructor + · rintro ⟨hz,hv⟩ + exact ⟨hz,c.complex_maps_disk hz,hv⟩ + · rintro ⟨hz,_,hv⟩ + exact ⟨hz,hv⟩ + + +def circleBoundaryHomeomorph : Circle ≃ₜ frontier Ω := by + classical + let f : Circle → frontier Ω := fun s => ⟨c.F (complexIso (s:ℂ)),c.complex_maps_boundary s⟩ + let g : frontier Ω → Circle := fun x => ⟨complexIso.symm (c.G x), + mem_sphere_zero_iff_norm.mpr (c.complex_inverse_boundary x.property)⟩ + have hleft : Function.LeftInverse g f := by + intro s + apply Subtype.ext + have hd : complexIso (s:ℂ) ∈ closure disk := by + simp only [disk,closure_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0),mem_closedBall_zero_iff, + LinearIsometryEquiv.norm_map,Circle.norm_coe,le_refl] + change complexIso.symm (c.G (c.F (complexIso (s:ℂ)))) = (s:ℂ) + rw [c.left_inverse _ (c.source_eq.symm ▸ hd),LinearIsometryEquiv.symm_apply_apply] + have hright : Function.RightInverse g f := by + intro x + apply Subtype.ext + change c.F (complexIso (complexIso.symm (c.G x))) = x + rw [LinearIsometryEquiv.apply_symm_apply,c.right_inverse x x.property.1] + exact { + toFun := f + invFun := g + left_inv := hleft + right_inv := hright + continuous_toFun := (c.lipschitz.continuous.comp (complexIso.continuous.comp continuous_subtype_val)).subtype_mk _ + continuous_invFun := (complexIso.symm.continuous.comp (c.inverse_lipschitz.continuous.comp continuous_subtype_val)).subtype_mk _ } + +end StrictHotSpots.Conformal.ClosedDiskChart +end +end ClosedChartTopology + +section BoundaryCoordinateExtension + +noncomputable section +open Set MeasureTheory Filter Metric Function +open scoped NNReal Topology InnerProductSpace +namespace StrictHotSpots.Conformal.ClosedDiskChart +open PlaneGreen DiskH10 +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + + + +theorem boundary_scalar_extension {f : Boundary → ℝ} {B : ℝ≥0} (hf : LipschitzWith B f) : + ∃ (g : Plane → ℝ) (A : ℝ≥0), LipschitzWith A g ∧ ∀ s : Boundary, g (c.F s) = f s := by + classical + let f' (x : Plane) := if h : ‖x‖ = 1 then f ⟨x,h⟩ else 0 + have hl : LipschitzOnWith B f' {x : Plane | ‖x‖ = 1} := by + intro x hx y hy + change ‖x‖ = 1 at hx + change ‖y‖ = 1 at hy + simpa only [f',dite_eq_left hx,dite_eq_left hy,Subtype.edist_eq] using hf ⟨x,hx⟩ ⟨y,hy⟩ + obtain ⟨g,hg,he⟩ := hl.extend_real + refine ⟨g ∘ c.G,B*c.InvLip,hg.comp c.inverse_lipschitz,?_⟩ + intro s + change g (c.G (c.F s)) = f s + rw [c.left_inverse s (c.source_eq.symm ▸ (by simp only [disk,closure_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0),mem_closedBall_zero_iff,s.property,le_refl]))] + exact (he s.property).symm.trans (by simp only [f',dite_eq_left s.property]) +end StrictHotSpots.Conformal.ClosedDiskChart +namespace StrictHotSpots.HilbertMultipliers +lemma coordinate_lipschitz {H S ι : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] + [PseudoMetricSpace S] (e : HilbertBasis ι ℝ H) {b : S → H} {B : ℝ≥0} + (hb : LipschitzWith B b) (i : ι) : LipschitzWith B (fun s => inner ℝ (e i) (b s)) := by + apply LipschitzWith.of_dist_le_mul + intro s t + rw [Real.dist_eq,← inner_sub_right] + calc + |inner ℝ (e i) (b s-b t)| ≤ ‖e i‖*‖b s-b t‖ := abs_real_inner_le_norm _ _ + _ = ‖b s-b t‖ := by rw [e.orthonormal.1 i,one_mul] + _ ≤ B*dist s t := by simpa only [dist_eq_norm] using hb.dist_le_mul s t +end StrictHotSpots.HilbertMultipliers +end +end BoundaryCoordinateExtension + +section GreenClosedContinuous + +noncomputable section +open Set MeasureTheory Filter Metric +open scoped Topology InnerProductSpace ENNReal +namespace StrictHotSpots.PlaneGreen +open DiskH10 + +lemma norm_le_of_mem_closure_disk {x : Plane} (hx : x ∈ closure disk) : ‖x‖ ≤ 1 := by + simpa only [disk,closure_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0), + mem_closedBall_zero_iff] using hx + +lemma mem_disk_of_norm_lt {x : Plane} (hx : ‖x‖ < 1) : x ∈ disk := by + simpa only [disk,mem_ball_zero_iff] using hx + +lemma kernel_zero_left {x : Plane} (hx : ‖x‖ = 1) (y : Plane) : kernel x y = 0 := by + simp [kernel_plane_formula,hx] + +lemma kernel_continuousAt_left_closed {x y : Plane} (hx : x ∈ closure disk) + (hy : y ∈ disk) (hxy : x ≠ y) : ContinuousAt (fun z => kernel z y) x := by + have hx1 := norm_le_of_mem_closure_disk hx + have hy1 : ‖y‖ < 1 := by simpa only [disk,mem_ball_zero_iff] using hy + have hx2 : 0 ≤ 1-‖x‖^2 := by nlinarith [norm_nonneg x] + have hy2 : 0 ≤ 1-‖y‖^2 := by nlinarith [norm_nonneg y] + have hn : ‖x-y‖^2 ≠ 0 := pow_ne_zero _ (norm_ne_zero_iff.mpr (sub_ne_zero.mpr hxy)) + have ha : 1+(1-‖x‖^2)*(1-‖y‖^2)/‖x-y‖^2 ≠ 0 := by positivity + simp_rw [kernel_plane_formula] + fun_prop (disch := assumption) + +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ (∞ : ℝ≥0∞)) + (hν : ν ≤ C • volume.restrict disk) + +include hC hν in +lemma kernel_memLp_closed (x : Plane) (hx : x ∈ closure disk) : MemLp (kernel x) 2 ν := by + by_cases hi : ‖x‖ < 1 + · exact kernel_memLp_weighted hC hν x (mem_disk_of_norm_lt hi) + · have hn : ‖x‖ = 1 := le_antisymm (norm_le_of_mem_closure_disk hx) (not_lt.mp hi) + have he : kernel x = 0 := funext (kernel_zero_left hn) + rw [he] + exact MemLp.zero + +include hC hν in +lemma kernel_uniform_three_bound_closed : ∃ B : ℝ≥0∞, B ≠ ∞ ∧ + ∀ x ∈ closure disk, eLpNorm (kernel x) 3 ν ≤ B := by + obtain ⟨B,hB,h⟩ := kernel_uniform_three_bound_weighted hC hν + refine ⟨B,hB,fun x hx => ?_⟩ + by_cases hi : ‖x‖ < 1 + · exact h x (mem_disk_of_norm_lt hi) + · have hn : ‖x‖ = 1 := le_antisymm (norm_le_of_mem_closure_disk hx) (not_lt.mp hi) + have he : kernel x = 0 := funext (kernel_zero_left hn) + rw [he,eLpNorm_zero] + exact bot_le + + +def closedRow (x : closure disk) : Lp ℝ 2 ν := + (kernel_memLp_closed hC hν x x.property).toLp (kernel x) + +lemma closedRow_coe_ae (x : closure disk) : closedRow hC hν x =ᵐ[ν] kernel x := + (kernel_memLp_closed hC hν x x.property).coeFn_toLp + + + +lemma closedRow_continuous [IsFiniteMeasure ν] : Continuous (closedRow hC hν) := by + apply continuous_iff_seqContinuous.mpr + intro u x hu + simp only [Function.comp_def,closedRow] + apply (Lp.tendsto_Lp_iff_tendsto_eLpNorm'' (fun n => kernel (u n)) + (fun n => kernel_memLp_closed hC hν _ (u n).property) (kernel x) + (kernel_memLp_closed hC hν _ x.property)).mpr + apply tendsto_Lp_finite_of_tendsto_ae (by norm_num) (by norm_num) + (fun n => (kernel_memLp_closed hC hν _ (u n).property).aestronglyMeasurable) + (kernel_memLp_closed hC hν _ x.property) + · obtain ⟨B,hB,h⟩ := kernel_uniform_three_bound_closed hC hν + exact L2Limits.unifIntegrable_two_of_three + (fun n => (kernel_memLp_closed hC hν _ (u n).property).aestronglyMeasurable) + hB (fun n => h _ (u n).property) + · have hne : ∀ᵐ y ∂ν, y ≠ (x:Plane) := + ((volume.restrict disk).ae_ne (x:Plane)).filter_mono + (Measure.absolutelyContinuous_of_le_smul hν).ae_le + filter_upwards [ae_mem_disk hν,hne] with y hyd hyx + exact (kernel_continuousAt_left_closed x.property hyd hyx.symm).tendsto.comp + ((continuous_subtype_val.tendsto x).comp hu) + +lemma green_integral_eq_closedInner (f : Lp ℝ 2 ν) (x : closure disk) : + (∫ y, kernel x y*f y ∂ν) = inner ℝ (closedRow hC hν x) f := by + rw [MeasurableL2Kernel.integral_mul_eq_inner + (kernel_memLp_closed hC hν x x.property) (Lp.memLp f),Lp.toLp_coeFn] + rfl + +include hC hν in +lemma green_integral_continuousOn_closure [IsFiniteMeasure ν] (f : Lp ℝ 2 ν) : + ContinuousOn (fun x : Plane => ∫ y, kernel x y*f y ∂ν) (closure disk) := by + apply continuousOn_iff_continuous_domRestrict.mpr + change Continuous (fun x : closure disk => ∫ y, kernel x y*f y ∂ν) + simp_rw [green_integral_eq_closedInner hC hν] + exact (closedRow_continuous hC hν).inner continuous_const + +lemma green_integral_boundary (f : Lp ℝ 2 ν) {x : Plane} (hx : x ∈ frontier disk) : + (∫ y, kernel x y*f y ∂ν) = 0 := by + have hn : ‖x‖ = 1 := by + simpa only [disk,frontier_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0), + mem_sphere_zero_iff_norm] using hx + simp only [kernel_zero_left hn,zero_mul,integral_zero] + +end StrictHotSpots.PlaneGreen +end +end GreenClosedContinuous + +section BoundaryClosedSolution + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ContDiff InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.PlaneGreen +open DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +def boundaryClosedPoisson (f : C(Boundary,ℝ)) : Plane → ℝ := + Douglas.closedPlanePoisson (boundaryAngleData f) + +lemma boundaryClosedPoisson_interior (f : C(Boundary,ℝ)) {x : Plane} (hx : x ∈ disk) : + boundaryClosedPoisson f x = poissonExtension f x := + (Douglas.closedPlanePoisson_eqOn (boundaryAngleData f) hx).trans + (poissonExtension_eq_planePoisson f hx).symm + +lemma boundaryClosedPoisson_trace (f : C(Boundary,ℝ)) (s : Boundary) : + boundaryClosedPoisson f s = f s := by + obtain ⟨t,rfl⟩ := angleBoundary.surjective s + rw [angleBoundary_coe] + exact Douglas.closedPlanePoisson_boundary (boundaryAngleData f) t + +lemma boundaryClosedPoisson_continuousOn (f : C(Boundary,ℝ)) {A : ℝ≥0} + (hf : LipschitzWith A f) : ContinuousOn (boundaryClosedPoisson f) (closure disk) := + Douglas.closedPlanePoisson_continuousOn (boundaryAngleData f) A.coe_nonneg + (boundaryAngleData_lipschitz f hf) + +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ (∞ : ℝ≥0∞)) (hν : ν ≤ C • volume.restrict disk) + + + +def boundaryClosedSolution (f : C(Boundary,ℝ)) {B : ℝ} + (hB : ∀ s, ‖f s‖ ≤ B) (x : Plane) : ℝ := + boundaryClosedPoisson f x + ∫ y, kernel x y * + (BanachResolvent.resolvent (weightedIntegralOperator hC hν) + (poissonL2 hν f.continuous.measurable hB)) y ∂ν + +lemma boundaryClosedSolution_interior (f : C(Boundary,ℝ)) {B : ℝ} + (hB : ∀ s, ‖f s‖ ≤ B) {x : Plane} (hx : x ∈ disk) : + boundaryClosedSolution hC hν f hB x = boundarySolutionValue hC hν f hB x := by + exact congrArg (fun a => a + ∫ y, kernel x y * + (BanachResolvent.resolvent (weightedIntegralOperator hC hν) + (poissonL2 hν f.continuous.measurable hB)) y ∂ν) (boundaryClosedPoisson_interior f hx) + +lemma boundaryClosedSolution_continuousOn (f : C(Boundary,ℝ)) {A : ℝ≥0} + (hf : LipschitzWith A f) {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + ContinuousOn (boundaryClosedSolution hC hν f hB) (closure disk) := + (boundaryClosedPoisson_continuousOn f hf).add + (green_integral_continuousOn_closure hC hν _) + +lemma boundaryClosedSolution_trace (f : C(Boundary,ℝ)) {B : ℝ} + (hB : ∀ s, ‖f s‖ ≤ B) (s : Boundary) : + boundaryClosedSolution hC hν f hB s = f s := by + have hs : (s:Plane) ∈ frontier disk := by + simpa only [disk,frontier_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0), mem_sphere, dist_zero_right] using s.property + rw [boundaryClosedSolution,green_integral_boundary _ hs,add_zero,boundaryClosedPoisson_trace] + +lemma boundaryClosedSolution_value_ae (f : C(Boundary,ℝ)) {A : ℝ≥0} + (hf : LipschitzWith A f) {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + (H1.value (boundarySolution hC hν f hf) : Plane → ℝ) =ᵐ[volume.restrict disk] + boundaryClosedSolution hC hν f hB := by + filter_upwards [boundarySolution_value_ae hC hν f hf hB, + ae_restrict_mem diskOpen.measurableSet] with x hx hxd + exact hx.trans (boundaryClosedSolution_interior hC hν f hB hxd).symm + +lemma boundaryClosedSolution_hasH1Gradient (f : C(Boundary,ℝ)) {A : ℝ≥0} + (hf : LipschitzWith A f) {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + HasH1Gradient disk (boundaryClosedSolution hC hν f hB) + (H1.grad (boundarySolution hC hν f hf)) := + (H1.hasH1Gradient _).congr (boundaryClosedSolution_value_ae hC hν f hf hB) + Filter.EventuallyEq.rfl + + +lemma boundaryClosedSolution_K (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (f : C(Boundary,ℝ)) {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) (x : disk) : + boundaryClosedSolution hC hν f hB x = + ∫ s, fullBoundaryK hC hν x s*f s ∂boundaryMeasure := by + rw [boundaryClosedSolution_interior hC hν f hB x.property] + exact boundarySolution_K hC hν hT f hB x + +end StrictHotSpots.PlaneGreen +end +end BoundaryClosedSolution + +section PhysicalClosedSolution + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal Topology +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + +lemma inverse_map_chartMeasure : (volume.restrict Ω).map c.G = chartMeasure c.diskMap c.d := by + have hm : (chartMeasure c.diskMap c.d).map c.diskMap = volume.restrict Ω := + map_chartMeasure c.diskMap c.d c.diskMap_deriv + rw [← hm, + AEMeasurable.map_map_of_aemeasurable c.inverse_lipschitz.continuous.aemeasurable + (chart_aemeasurable c.diskMap c.d)] + have he : c.G ∘ c.diskMap =ᵐ[chartMeasure c.diskMap c.d] id := by + filter_upwards [ae_chart_source c.diskMap c.d] with x hx + change c.G (c.diskMap x)=x + rw [c.diskMap_agrees hx] + exact c.left_inverse x (c.source_eq.symm ▸ subset_closure hx) + rw [Measure.map_congr he,Measure.map_id] + +lemma pull_ae_to_physical {f g : Plane → ℝ} + (h : f ∘ c.diskMap =ᵐ[chartMeasure c.diskMap c.d] g) : + f =ᵐ[volume.restrict Ω] (g ∘ c.G) := by + have hg : f ∘ c.diskMap =ᵐ[(volume.restrict Ω).map c.G] g := + c.inverse_map_chartMeasure.symm ▸ h + have ha := ae_of_ae_map c.inverse_lipschitz.continuous.aemeasurable hg + filter_upwards [ha,ae_restrict_mem c.diskMap.open_target.measurableSet] with y hy hyΩ + have hi : c.diskMap (c.G y)=y := by + rw [← c.diskMap_inverse_agrees hyΩ] + exact c.diskMap.right_inv hyΩ + simpa only [Function.comp_apply,hi] using hy + +lemma physicalSolution_pull_ae (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + (hμ : 0 ≤ firstPositiveNeumannValue Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) : + (H1.value (c.physicalSolution hb hs hμ hw hl) : Plane → ℝ) ∘ c.diskMap + =ᵐ[chartMeasure c.diskMap c.d] + H1.value (boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl) := by + have h := affine_value_ae c.diskMap c.diskMap_inverse_smooth c.d c.diskMap_deriv hb + (smooth_closure_H1 (Ω:=Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hw) + (c.pullDatum_comp_H1 hb hs hw) (c.datumCorrection hb hs hμ hw hl) + have he : (c.pullDatum_comp_H1 hb hs hw).toH1+(c.datumCorrection hb hs hμ hw hl).val = + boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl := + (congrArg (fun V : H1 disk => V+(c.datumCorrection hb hs hμ hw hl).val) + (c.pullDatum_comp_toH1 hb hs hw)).trans (c.datumCorrection_spec hb hs hμ hw hl).symm + exact (chartPull_ae c.diskMap c.d c.diskMap_deriv _).symm.trans + (h.trans (EventuallyEq.of_eq (congrArg (fun V : H1 disk => (H1.value V : Plane → ℝ)) he))) + +lemma physicalSolution_closed_ae (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + (hμ : 0 ≤ firstPositiveNeumannValue Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) {M : ℝ} + (hM : ∀ s : Boundary, ‖w (c.F s)‖ ≤ M) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hb + (H1.value (c.physicalSolution hb hs hμ hw hl) : Plane → ℝ) + =ᵐ[volume.restrict Ω] + (boundaryClosedSolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hM) ∘ c.G := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hb + apply c.pull_ae_to_physical + exact (c.physicalSolution_pull_ae hb hs hμ hw hl).trans + ((chartMeasure_ac c.diskMap c.d).ae_le + (boundaryClosedSolution_value_ae c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl hM)) + +end StrictHotSpots.Conformal.ClosedDiskChart +end +end PhysicalClosedSolution + +section BoundaryClosedConvergence + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal Topology +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ (∞ : ℝ≥0∞)) (hν : ν ≤ C • volume.restrict disk) + +lemma boundaryClosedSolution_tendsto (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (fn : ℕ → C(Boundary,ℝ)) (f : C(Boundary,ℝ)) {M B : ℝ} + (hm : ∀ n s, ‖fn n s‖ ≤ M) (hb : ∀ s, ‖f s‖ ≤ B) + (ht : ∀ s, Tendsto (fun n => fn n s) atTop (𝓝 (f s))) (p : disk) : + Tendsto (fun n => boundaryClosedSolution hC hν (fn n) (hm n) p) + atTop (𝓝 (boundaryClosedSolution hC hν f hb p)) := by + obtain ⟨A,hA,hAb⟩ := fullBoundaryK_bounded hC hν p + have hn (s : Boundary) : ‖fullBoundaryK hC hν p s‖ ≤ A := by + rw [Real.norm_of_nonneg (fullBoundaryK_pos hC hν hT p s).le] + exact hAb s + simp only [boundaryClosedSolution_K hC hν hT] + apply tendsto_integral_of_dominated_convergence (fun _ : Boundary => A*M) + · intro n + exact ((fullBoundaryK_measurable hC hν p).mul (fn n).continuous.measurable).aestronglyMeasurable + · exact integrable_const _ + · intro n + exact Eventually.of_forall fun s => (norm_mul _ _).trans_le + (mul_le_mul (hn s) (hm n s) (norm_nonneg _) hA) + · exact Eventually.of_forall fun s => (ht s).const_mul _ + +end StrictHotSpots.PlaneGreen +end +end BoundaryClosedConvergence + +section PhysicalMultiplierClosed + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal Topology +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen Hodge +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) (hΩ : AdmissibleDomain Ω) +variable (hμ : 0 < firstPositiveNeumannValue Ω) +variable {L : ℝ} (hl : firstPositiveNeumannValue Ω < L) + (hD : ∀ j : H10 hΩ.2.1, L*‖H10.value hΩ.2.1 j‖^2 ≤ ‖H10.grad hΩ.2.1 j‖^2) + +lemma scalarSolution_closed_ae {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) + {M : ℝ} (hM : ∀ s : Boundary, ‖w (c.F s)‖ ≤ M) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + (H1.value (c.scalarSolution hΩ.2.2.1 hΩ.2.2.2.2 hμ hw) : Plane → ℝ) + =ᵐ[volume.restrict Ω] + (boundaryClosedSolution c.densityBound_ne_top (c.density_bound hμ.le) + (c.datumTrace w hw.continuousOn) hM) ∘ c.G := + c.physicalSolution_closed_ae hΩ.2.2.1 hΩ.2.2.2.2 hμ.le hw _ hM + +lemma scalarSolution_mul_tendsto {w b : Plane → ℝ} + (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} (hb : LipschitzWith B b) : + Tendsto (fun n => c.scalarSolution hΩ.2.2.1 hΩ.2.2.2.2 hμ + ((ambientSmooth_smooth (planeApproxBump n) hb).contDiffOn.mul hw)) atTop + (𝓝 (PhysicalHelmholtz.extension hΩ.2.1 hΩ.2.2.1 hμ.le hl hD + (H1.lipschitzMul hΩ.2.1 hΩ.2.2.1 hb (smooth_closure_H1 hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 hw).toH1))) := by + let U := (smooth_closure_H1 hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 hw).toH1 + have ht := (PhysicalHelmholtz.extension hΩ.2.1 hΩ.2.2.1 hμ.le hl hD).continuous.continuousAt.tendsto.comp + (smoothMul_tendsto_lipschitzMul hΩ.2.1 hΩ.2.2.1 hb U) + apply ht.congr' + apply Eventually.of_forall + intro n + have hen := smoothMul_smooth_closure hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 + (ambientSmooth_smooth (planeApproxBump n) hb) + (continuous_closure_memLp_top hΩ.2.1 hΩ.2.2.1 + (ambientSmooth_lipschitz (planeApproxBump n) hb).continuous.continuousOn) + (lipschitz_gradient_memLp_top (ambientSmooth_lipschitz (planeApproxBump n) hb)) hw + exact ((c.scalarSolution_eq_extension hΩ hμ hl hD + ((ambientSmooth_smooth (planeApproxBump n) hb).contDiffOn.mul hw)).trans + (congrArg (PhysicalHelmholtz.extension hΩ.2.1 hΩ.2.2.1 hμ.le hl hD) hen.symm)).symm + +def multiplierTrace {b : Plane → ℝ} {B : ℝ≥0} (hb : LipschitzWith B b) + (w : Plane → ℝ) (hw : ContinuousOn w (closure Ω)) : C(Boundary,ℝ) where + toFun s := b (c.F s)*w (c.F s) + continuous_toFun := (c.physical_boundary_lipschitz hb).continuous.mul (c.datumTrace w hw).continuous + +include hΩ in +lemma multiplierTrace_lipschitz {b w : Plane → ℝ} {B : ℝ≥0} (hb : LipschitzWith B b) + (hw : ContDiffOn ℝ ∞ w (closure Ω)) : + ∃ A : ℝ≥0, LipschitzWith A (c.multiplierTrace hb w hw.continuousOn) := by + obtain ⟨D,hD⟩ := c.datumTrace_lipschitz hΩ.2.2.1 hΩ.2.2.2.2 hw + exact boundary_smul_lipschitz (c.physical_boundary_lipschitz hb) hD + +lemma physical_lipschitzMul_closed_ae {w b : Plane → ℝ} + (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} (hb : LipschitzWith B b) + {A : ℝ} (hA : ∀ s, ‖c.multiplierTrace hb w hw.continuousOn s‖ ≤ A) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + (H1.value (PhysicalHelmholtz.extension hΩ.2.1 hΩ.2.2.1 hμ.le hl hD + (H1.lipschitzMul hΩ.2.1 hΩ.2.2.1 hb (smooth_closure_H1 hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 hw).toH1)) : Plane → ℝ) + =ᵐ[volume.restrict Ω] + (boundaryClosedSolution c.densityBound_ne_top (c.density_bound hμ.le) + (c.multiplierTrace hb w hw.continuousOn) hA) ∘ c.G := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + let hn (n : ℕ) := (ambientSmooth_smooth (planeApproxBump n) hb).contDiffOn.mul hw + let fn (n : ℕ) := c.datumTrace _ (hn n).continuousOn + obtain ⟨M,hM,hMb⟩ := c.smooth_physical_boundary_bound hΩ hb + obtain ⟨W,hW,hWb⟩ := boundary_continuous_bound (c.datumTrace w hw.continuousOn).continuous + have hMW (n : ℕ) (s : Boundary) : ‖fn n s‖ ≤ M*W := by + change ‖ambientSmooth (planeApproxBump n) b (c.F s)*w (c.F s)‖ ≤ M*W + rw [norm_mul] + exact mul_le_mul (hMb n s) (hWb s) (norm_nonneg _) hM + have ht (s : Boundary) : Tendsto (fun n => fn n s) atTop + (𝓝 (c.multiplierTrace hb w hw.continuousOn s)) := + (ambientSmooth_tendsto planeApproxBump_rOut_tendsto hb (c.F s)).mul_const _ + have he (n : ℕ) := c.scalarSolution_closed_ae hΩ hμ (hn n) (hMW n) + have hv := H1.value.continuous.continuousAt.tendsto.comp + (c.scalarSolution_mul_tendsto hΩ hμ hl hD hw hb) + obtain ⟨φ,hφ,hφae⟩ := (tendstoInMeasure_of_tendsto_Lp hv).exists_seq_tendsto_ae + filter_upwards [hφae,ae_all_iff.mpr he,ae_restrict_mem hΩ.2.1.measurableSet] with x hx hxe hxΩ + have hxD : c.G x ∈ disk := by + rw [← c.diskMap_inverse_agrees hxΩ] + exact c.diskMap.map_target hxΩ + have hk := boundaryClosedSolution_tendsto c.densityBound_ne_top (c.density_bound hμ.le) + (c.operator_norm_lt_one hΩ.2.2.1 hΩ.1 hμ) fn (c.multiplierTrace hb w hw.continuousOn) + hMW hA ht ⟨c.G x,hxD⟩ + apply tendsto_nhds_unique hx + exact (hk.comp hφ.tendsto_atTop).congr' (Eventually.of_forall fun n => (hxe (φ n)).symm) + +end StrictHotSpots.Conformal.ClosedDiskChart +end +end PhysicalMultiplierClosed + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Conformal.lean b/lean/OAI/Analysis/HotSpots/Conformal.lean new file mode 100644 index 0000000000000000000000000000000000000000..09147cec00d736cdbf55f820a567ab9d0a2113bf --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Conformal.lean @@ -0,0 +1,619 @@ +import OAI.Analysis.HotSpots.Dirichlet + +namespace OAI + +section ConformalCoordinates + + +noncomputable section +open Set MeasureTheory Complex ComplexConjugate InnerProductSpace +open scoped InnerProductSpace Topology ContDiff +namespace StrictHotSpots.Conformal + +abbrev CoordinatePlane := EuclideanSpace ℝ (Fin 2) +def coordinate : ℂ ≃ₗᵢ[ℝ] CoordinatePlane := Complex.orthonormalBasisOneI.repr + +def planeMul (a : ℂ) : CoordinatePlane →L[ℝ] CoordinatePlane := + coordinate.toContinuousLinearEquiv.toContinuousLinearMap.comp + (((ContinuousLinearMap.toSpanSingleton ℂ a).restrictScalars ℝ).comp + coordinate.symm.toContinuousLinearEquiv.toContinuousLinearMap) + +lemma planeMul_apply (a : ℂ) (z : CoordinatePlane) : + planeMul a z = coordinate (a*coordinate.symm z) := by + simp [planeMul,mul_comm] + +lemma planeMul_det (a : ℂ) : (planeMul a).det = ‖a‖^2 := by + have hh := LinearMap.det_conj + (((ContinuousLinearMap.toSpanSingleton ℂ a).restrictScalars ℝ).toLinearMap) coordinate.toLinearEquiv + change LinearMap.det _ = _ + have he : (planeMul a).toLinearMap = + (coordinate.toLinearEquiv : ℂ →ₗ[ℝ] CoordinatePlane) ∘ₗ + ((ContinuousLinearMap.toSpanSingleton ℂ a).restrictScalars ℝ).toLinearMap ∘ₗ + (coordinate.toLinearEquiv.symm : CoordinatePlane →ₗ[ℝ] ℂ) := by + ext z + rfl + rw [he,hh] + simp [LinearMap.det_restrictScalars, Algebra.norm_complex_eq, + Complex.normSq_eq_norm_sq] + +lemma plane_gradient_comp {f : CoordinatePlane → CoordinatePlane} + {w : CoordinatePlane → ℝ} {a : ℂ} {x : CoordinatePlane} + (hf : HasFDerivAt f (planeMul a) x) (hw : DifferentiableAt ℝ w (f x)) : + gradient (w ∘ f) x = coordinate (conj a * coordinate.symm (gradient w (f x))) := by + apply ext_inner_right ℝ + intro z + rw [inner_gradient_left,(hw.hasFDerivAt.comp x hf).fderiv] + change fderiv ℝ w (f x) (planeMul a z) = _ + rw [planeMul_apply,← inner_gradient_left] + have he (g : CoordinatePlane) (v : ℂ) : + inner ℝ g (coordinate v) = inner ℝ (coordinate.symm g) v := by + rw [← coordinate.inner_map_map (coordinate.symm g) v, coordinate.apply_symm_apply] + rw [he,← coordinate.symm.inner_map_map (coordinate _) z,coordinate.symm_apply_apply] + simp only [Complex.inner, map_mul, conj_conj] + congr 1 + ring + +lemma plane_norm_gradient_comp {f : CoordinatePlane → CoordinatePlane} + {w : CoordinatePlane → ℝ} {a : ℂ} {x : CoordinatePlane} + (hf : HasFDerivAt f (planeMul a) x) (hw : DifferentiableAt ℝ w (f x)) : + ‖gradient (w ∘ f) x‖ = ‖a‖ * ‖gradient w (f x)‖ := by + rw [plane_gradient_comp hf hw, coordinate.norm_map,norm_mul,norm_conj, + coordinate.symm.norm_map] + +lemma plane_integral_target (e : OpenPartialHomeomorph CoordinatePlane CoordinatePlane) + (d : CoordinatePlane → ℂ) (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (g : CoordinatePlane → ℝ) : + (∫ y in e.target, g y) = ∫ x in e.source, ‖d x‖^2 * g (e x) := by + have hh := integral_target_eq_integral_abs_det_fderiv_smul volume hd g + simpa only [planeMul_det,abs_sq, smul_eq_mul] using hh + +lemma plane_dirichlet_energy (e : OpenPartialHomeomorph CoordinatePlane CoordinatePlane) + (d : CoordinatePlane → ℂ) (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + {w : CoordinatePlane → ℝ} (hw : DifferentiableOn ℝ w e.target) : + (∫ y in e.target, ‖gradient w y‖^2) = + ∫ x in e.source, ‖gradient (w ∘ e) x‖^2 := by + rw [plane_integral_target e d hd] + apply setIntegral_congr_fun e.open_source.measurableSet + intro x hx + dsimp only + rw [plane_norm_gradient_comp (hd x hx) + ((hw (e x) (e.map_source hx)).differentiableAt + (e.open_target.mem_nhds (e.map_source hx))),mul_pow] + + +def planeChart (e : OpenPartialHomeomorph ℂ ℂ) : + OpenPartialHomeomorph CoordinatePlane CoordinatePlane := + coordinate.symm.toHomeomorph.toOpenPartialHomeomorph.trans + (e.trans coordinate.toHomeomorph.toOpenPartialHomeomorph) + +lemma planeChart_source (e : OpenPartialHomeomorph ℂ ℂ) : + (planeChart e).source = coordinate.symm ⁻¹' e.source := by + ext x + simp [planeChart] + +lemma planeChart_target (e : OpenPartialHomeomorph ℂ ℂ) : + (planeChart e).target = coordinate.symm ⁻¹' e.target := by + ext x + simp [planeChart] + +lemma planeChart_apply (e : OpenPartialHomeomorph ℂ ℂ) (x : CoordinatePlane) : + planeChart e x = coordinate (e (coordinate.symm x)) := rfl + +lemma planeChart_hasFDerivAt {e : OpenPartialHomeomorph ℂ ℂ} + {x : CoordinatePlane} (hd : DifferentiableAt ℂ e (coordinate.symm x)) : + HasFDerivAt (planeChart e) (planeMul (deriv e (coordinate.symm x))) x := by + exact coordinate.toContinuousLinearEquiv.toContinuousLinearMap.hasFDerivAt.comp x + ((hd.hasDerivAt.hasFDerivAt.restrictScalars ℝ).comp x + coordinate.symm.toContinuousLinearEquiv.toContinuousLinearMap.hasFDerivAt) + +end StrictHotSpots.Conformal +end +end ConformalCoordinates + +section CompactChartTransport + + + + +noncomputable section +open Set Filter +open scoped Topology ContDiff Classical +namespace CompactChart +variable {E : Type*} [NormedAddCommGroup E] + +variable (e : OpenPartialHomeomorph E E) + +def transport (f : E → ℝ) : E → ℝ := fun y => if y ∈ e.target then f (e.symm y) else 0 + +lemma transport_apply {f : E → ℝ} {y : E} (hy : y ∈ e.target) : + transport e f y = f (e.symm y) := ite_eq_left hy + +lemma transport_source (f : E → ℝ) {x : E} (hx : x ∈ e.source) : + transport e f (e x) = f x := by + rw [transport_apply e (e.map_source hx),e.left_inv hx] + +lemma support_transport_subset {f : E → ℝ} : + Function.support (transport e f) ⊆ e '' tsupport f := by + intro y hy + by_cases hyt : y ∈ e.target + · refine ⟨e.symm y,subset_tsupport _ ?_,e.right_inv hyt⟩ + simpa only [Function.mem_support,transport_apply e hyt] using hy + · exact False.elim (hy (ite_eq_right hyt)) + +lemma compact_image_tsupport {f : E → ℝ} (hc : HasCompactSupport f) + (hs : tsupport f ⊆ e.source) : IsCompact (e '' tsupport f) := + hc.image_of_continuousOn (e.continuousOn.mono hs) + +lemma tsupport_transport_subset {f : E → ℝ} (hc : HasCompactSupport f) + (hs : tsupport f ⊆ e.source) : tsupport (transport e f) ⊆ e '' tsupport f := by + exact closure_minimal (support_transport_subset e) (compact_image_tsupport e hc hs).isClosed + +lemma hasCompactSupport_transport {f : E → ℝ} (hc : HasCompactSupport f) + (hs : tsupport f ⊆ e.source) : HasCompactSupport (transport e f) := + (compact_image_tsupport e hc hs).of_isClosed_subset (isClosed_tsupport _) + (tsupport_transport_subset e hc hs) + +lemma transport_support_target {f : E → ℝ} (hc : HasCompactSupport f) + (hs : tsupport f ⊆ e.source) : tsupport (transport e f) ⊆ e.target := by + intro y hy + obtain ⟨x,hx,rfl⟩ := tsupport_transport_subset e hc hs hy + exact e.map_source (hs hx) + +lemma transport_eventuallyEq {f : E → ℝ} {y : E} (hy : y ∈ e.target) : + transport e f =ᶠ[𝓝 y] f ∘ e.symm := by + filter_upwards [e.open_target.mem_nhds hy] with z hz + exact transport_apply e hz + +lemma contDiff_transport [NormedSpace ℝ E] {f : E → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) (hs : tsupport f ⊆ e.source) + (he : ContDiffOn ℝ ∞ e.symm e.target) : ContDiff ℝ ∞ (transport e f) := by + rw [contDiff_iff_contDiffAt] + intro y + by_cases hy : y ∈ e.target + · exact (hf.contDiffAt.comp y ((he y hy).contDiffAt (e.open_target.mem_nhds hy))).congr_of_eventuallyEq + (transport_eventuallyEq e hy) + · exact contDiffAt_const.congr_of_eventuallyEq + (notMem_tsupport_iff_eventuallyEq.mp (fun h => hy (transport_support_target e hc hs h))) + +lemma transport_add (f g : E → ℝ) : + transport e (f+g) = transport e f+transport e g := by + funext y + by_cases hy : y ∈ e.target <;> simp [transport,hy] + +lemma transport_smul (c : ℝ) (f : E → ℝ) : + transport e (c • f) = c • transport e f := by + funext y + by_cases hy : y ∈ e.target <;> simp [transport,hy] + +lemma transport_comp_eventuallyEq {f : E → ℝ} {x : E} (hx : x ∈ e.source) : + (transport e f) ∘ e =ᶠ[𝓝 x] f := by + filter_upwards [e.open_source.mem_nhds hx] with z hz + exact transport_source e f hz + +lemma transport_symm_transport {f : E → ℝ} (hs : Function.support f ⊆ e.source) : + transport e.symm (transport e f)=f := by + funext x + by_cases hx : x ∈ e.source + · simpa only [transport_apply e.symm hx,e.symm_symm] using transport_source e f hx + · rw [transport,OpenPartialHomeomorph.symm_target,ite_eq_right hx] + exact (Function.notMem_support.mp (fun hh => hx (hs hh))).symm + +end CompactChart +end +end CompactChartTransport + +section ConformalH10Tests + + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace Topology ENNReal +namespace StrictHotSpots.Conformal + +variable (e : OpenPartialHomeomorph Plane Plane) +variable (he : ContDiffOn ℝ ∞ e.symm e.target) + +def transportTest : smoothTestSpace e.source →ₗ[ℝ] smoothTestSpace e.target where + toFun f := ⟨CompactChart.transport e f, + CompactChart.contDiff_transport e f.property.1 f.property.2.1 f.property.2.2 he, + CompactChart.hasCompactSupport_transport e f.property.2.1 f.property.2.2, + CompactChart.transport_support_target e f.property.2.1 f.property.2.2⟩ + map_add' f g := Subtype.ext (CompactChart.transport_add e f g) + map_smul' c f := Subtype.ext (CompactChart.transport_smul e c f) + +lemma test_grad_sq {Ω : Set Plane} (ho : IsOpen Ω) (f : smoothTestSpace Ω) : + ‖H10.grad ho (smoothTestToH10 ho f)‖^2 = ∫ x in Ω, ‖gradient (f : Plane → ℝ) x‖^2 := by + rw [L2VectorLimits.norm_sq_eq_integral_norm_sq] + apply integral_congr_ae + filter_upwards [(test_gradient_memLp (Ω:=Ω) f.property.1 f.property.2.1).coeFn_toLp] with x hx + exact congrArg (fun t : Plane => ‖t‖^2) hx + +lemma test_value_sq {Ω : Set Plane} (ho : IsOpen Ω) (f : smoothTestSpace Ω) : + ‖H10.value ho (smoothTestToH10 ho f)‖^2 = ∫ x in Ω, ((f : Plane → ℝ) x)^2 := by + rw [L2Limits.norm_sq_eq_integral_sq] + apply integral_congr_ae + filter_upwards [(test_memLp (Ω:=Ω) f.property.1 f.property.2.1).coeFn_toLp] with x hx + exact congrArg (fun t : ℝ => t^2) hx + +lemma transportTest_grad_sq (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) (f : smoothTestSpace e.source) : + ‖H10.grad e.open_target (smoothTestToH10 e.open_target (transportTest e he f))‖^2 = + ‖H10.grad e.open_source (smoothTestToH10 e.open_source f)‖^2 := by + rw [test_grad_sq,test_grad_sq,plane_dirichlet_energy e d hd + ((transportTest e he f).property.1.differentiable (by simp)).differentiableOn] + apply setIntegral_congr_fun e.open_source.measurableSet + intro x hx + dsimp only + congr 2 + change gradient ((CompactChart.transport e f) ∘ e) x = gradient (f : Plane → ℝ) x + unfold gradient + rw [(CompactChart.transport_comp_eventuallyEq e (f:=f) hx).fderiv_eq] + +lemma transportTest_value_sq (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) (f : smoothTestSpace e.source) : + ‖H10.value e.open_target (smoothTestToH10 e.open_target (transportTest e he f))‖^2 = + ∫ x in e.source, ‖d x‖^2 * ((f : Plane → ℝ) x)^2 := by + rw [test_value_sq,plane_integral_target e d hd] + apply setIntegral_congr_fun e.open_source.measurableSet + intro x hx + change ‖d x‖^2 * (CompactChart.transport e f (e x))^2 = _ + rw [CompactChart.transport_source e f hx] + +private lemma scalar_norm_bound {s t a b C : ℝ} + (hs : 0 ≤ s) (ht : 0 ≤ t) (ha : 0 ≤ a) (hb : 0 ≤ b) (hC : 0 ≤ C) + (hsplit : t^2 = a^2+b^2) (hbsq : b^2 ≤ s^2) (hP : a ≤ C*b) : + t ≤ (C+1)*s := by + have hbs : b ≤ s := (sq_le_sq₀ hb hs).mp hbsq + have ht' : t ≤ a+b := (sq_le_sq₀ ht (add_nonneg ha hb)).mp (by nlinarith) + calc + t ≤ a+b := ht' + _ ≤ C*b+b := by linarith + _ = (C+1)*b := by ring + _ ≤ (C+1)*s := mul_le_mul_of_nonneg_left hbs (by linarith) + +lemma transportTest_bound (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (hb : Bornology.IsBounded e.target) : + ∃ C : ℝ, ∀ f : smoothTestSpace e.source, + ‖smoothTestToH10 e.open_target (transportTest e he f)‖ ≤ + C * ‖smoothTestToH10 e.open_source f‖ := by + obtain ⟨C,hC,hP⟩ := H10.poincare e.open_target hb + refine ⟨C+1,fun f => ?_⟩ + let v : H10 e.open_source := smoothTestToH10 e.open_source f + let w : H10 e.open_target := smoothTestToH10 e.open_target (transportTest e he f) + have hs := H10.norm_sq e.open_source v + have ht := H10.norm_sq e.open_target w + have heq : ‖H10.grad e.open_target w‖^2 = ‖H10.grad e.open_source v‖^2 := + transportTest_grad_sq e he d hd f + have hp : ‖H10.value e.open_target w‖ ≤ C*‖H10.grad e.open_target w‖ := hP w + have hle : ‖H10.grad e.open_source v‖^2 ≤ ‖v‖^2 := by + calc + ‖H10.grad e.open_source v‖^2 ≤ + ‖H10.value e.open_source v‖^2+‖H10.grad e.open_source v‖^2 := + le_add_of_nonneg_left (sq_nonneg _) + _ = ‖v‖^2 := hs.symm + exact scalar_norm_bound (norm_nonneg v) (norm_nonneg w) + (norm_nonneg (H10.value e.open_target w)) (norm_nonneg (H10.grad e.open_target w)) + hC.le ht (heq.le.trans hle) hp + +end StrictHotSpots.Conformal +end +end ConformalH10Tests + +section ConformalH10 + + + + + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace Topology ENNReal +namespace StrictHotSpots.Conformal + +variable (e : OpenPartialHomeomorph Plane Plane) +variable (he : ContDiffOn ℝ ∞ e.symm e.target) + +def transportH10 : H10 e.open_source →L[ℝ] H10 e.open_target := + ((smoothTestToH10 e.open_target).comp (transportTest e he)).extendOfNorm + (smoothTestToH10 e.open_source) + +lemma transportH10_test (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (hb : Bornology.IsBounded e.target) (f : smoothTestSpace e.source) : + transportH10 e he (smoothTestToH10 e.open_source f) = + smoothTestToH10 e.open_target (transportTest e he f) := + LinearMap.extendOfNorm_eq (dense_smoothTestToH10 e.open_source) + (transportTest_bound e he d hd hb) f + +lemma transportH10_grad_sq (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (hb : Bornology.IsBounded e.target) (v : H10 e.open_source) : + ‖H10.grad e.open_target (transportH10 e he v)‖^2 = + ‖H10.grad e.open_source v‖^2 := by + have H : (fun v : H10 e.open_source => ‖H10.grad e.open_target (transportH10 e he v)‖^2) = + (fun v => ‖H10.grad e.open_source v‖^2) := by + apply (dense_smoothTestToH10 e.open_source).equalizer + (((H10.grad e.open_target).continuous.comp (transportH10 e he).continuous).norm.pow 2) + ((H10.grad e.open_source).continuous.norm.pow 2) + funext f + dsimp only [Function.comp_apply] + exact (congrArg (fun w : H10 e.open_target => ‖H10.grad e.open_target w‖^2) + (transportH10_test e he d hd hb f)).trans (transportTest_grad_sq e he d hd f) + exact congrFun H v + +lemma transportH10_inner_grad (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (hb : Bornology.IsBounded e.target) (v w : H10 e.open_source) : + inner ℝ (H10.grad e.open_target (transportH10 e he v)) + (H10.grad e.open_target (transportH10 e he w)) = + inner ℝ (H10.grad e.open_source v) (H10.grad e.open_source w) := by + have hv := transportH10_grad_sq e he d hd hb v + have hw := transportH10_grad_sq e he d hd hb w + have hsum := transportH10_grad_sq e he d hd hb (v+w) + simp only [map_add,norm_add_sq_real] at hsum + linarith + +lemma transportTest_symm (he' : ContDiffOn ℝ ∞ e e.source) + (f : smoothTestSpace e.source) : + transportTest e.symm he' (transportTest e he f)=f := by + apply Subtype.ext + exact CompactChart.transport_symm_transport e ((subset_tsupport _).trans f.property.2.2) + +lemma transportH10_symm (he' : ContDiffOn ℝ ∞ e e.source) + (d d' : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (hd' : ∀ y ∈ e.target, HasFDerivAt e.symm (planeMul (d' y)) y) + (hb : Bornology.IsBounded e.target) (hb' : Bornology.IsBounded e.source) + (v : H10 e.open_source) : + transportH10 e.symm he' (transportH10 e he v)=v := by + have H : (transportH10 e.symm he') ∘ (transportH10 e he) = id := by + apply (dense_smoothTestToH10 e.open_source).equalizer + ((transportH10 e.symm he').continuous.comp (transportH10 e he).continuous) continuous_id + funext f + dsimp only [Function.comp_apply] + exact (congrArg (transportH10 e.symm he') (transportH10_test e he d hd hb f)).trans + ((transportH10_test e.symm he' d' hd' hb' (transportTest e he f)).trans + (congrArg (smoothTestToH10 e.open_source) (transportTest_symm e he he' f))) + exact congrFun H v + + + +lemma transported_dirichlet (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (hb : Bornology.IsBounded e.target) {L : ℝ} + (hD : ∀ v : H10 e.open_target, L*‖H10.value e.open_target v‖^2 ≤ + ‖H10.grad e.open_target v‖^2) (v : H10 e.open_source) : + L*‖H10.value e.open_target (transportH10 e he v)‖^2 ≤ + ‖H10.grad e.open_source v‖^2 := by + exact (hD (transportH10 e he v)).trans_eq (transportH10_grad_sq e he d hd hb v) + + + +lemma transported_subcritical (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (hb : Bornology.IsBounded e.target) (hne : e.target.Nonempty) : + ∃ L : ℝ, 0 < L ∧ firstPositiveNeumannValue e.target < L ∧ + ∀ v : H10 e.open_source, + L*‖H10.value e.open_target (transportH10 e he v)‖^2 ≤ + ‖H10.grad e.open_source v‖^2 := by + apply Exists.elim (@H10.subcritical e.target e.open_target hne hb) + intro L h + exact Exists.intro L ⟨h.1,h.2.1,transported_dirichlet e he d hd hb h.2.2⟩ + +end StrictHotSpots.Conformal +end +end ConformalH10 + +section ConformalMeasure + + + + +noncomputable section +open Set MeasureTheory Filter +open scoped ENNReal Topology +namespace StrictHotSpots.Conformal + +variable (e : OpenPartialHomeomorph CoordinatePlane CoordinatePlane) (d : CoordinatePlane → ℂ) + +def chartMeasure : Measure CoordinatePlane := + (volume.restrict e.source).withDensity (fun x => ENNReal.ofReal (‖d x‖^2)) + +lemma chartMeasure_ac : chartMeasure e d ≪ volume.restrict e.source := + withDensity_absolutelyContinuous _ _ + +lemma chart_aemeasurable : AEMeasurable e (chartMeasure e d) := + (e.continuousOn.aemeasurable e.open_source.measurableSet).mono_ac (chartMeasure_ac e d) + +lemma map_chartMeasure + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) : + (chartMeasure e d).map e = volume.restrict e.target := by + have hh := map_withDensity_abs_det_fderiv_eq_addHaar (volume : Measure CoordinatePlane) + e.open_source.measurableSet.nullMeasurableSet + (fun x hx => (hd x hx).hasFDerivWithinAt) e.injOn + simpa only [chartMeasure, planeMul_det,abs_sq,OpenPartialHomeomorph.image_source_eq_target] using hh + + + +def measurableChart : CoordinatePlane → CoordinatePlane := + (chart_aemeasurable e d).mk e + +lemma measurableChart_ae : measurableChart e d =ᵐ[chartMeasure e d] e := + (chart_aemeasurable e d).ae_eq_mk.symm + +lemma measurableChart_preserving + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) : + MeasurePreserving (measurableChart e d) (chartMeasure e d) (volume.restrict e.target) := by + refine ⟨(chart_aemeasurable e d).measurable_mk,?_⟩ + exact (Measure.map_congr (measurableChart_ae e d)).trans (map_chartMeasure e d hd) + +def chartPull (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) : + Lp ℝ 2 (volume.restrict e.target) →ₗᵢ[ℝ] Lp ℝ 2 (chartMeasure e d) := + Lp.compMeasurePreservingₗᵢ ℝ (measurableChart e d) (measurableChart_preserving e d hd) + +lemma chartPull_ae (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (f : Lp ℝ 2 (volume.restrict e.target)) : + chartPull e d hd f =ᵐ[chartMeasure e d] f ∘ e := by + exact (Lp.coeFn_compMeasurePreserving f (measurableChart_preserving e d hd)).trans + ((measurableChart_ae e d).fun_comp f) + +lemma chartPull_test_ae + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + {f : CoordinatePlane → ℝ} (hf : MemLp f 2 (volume.restrict e.target)) : + chartPull e d hd (hf.toLp f) =ᵐ[chartMeasure e d] f ∘ e := by + apply (chartPull_ae e d hd _).trans + have hh : (hf.toLp f : CoordinatePlane → ℝ) =ᵐ[(chartMeasure e d).map e] f := by + rw [map_chartMeasure e d hd] + exact hf.coeFn_toLp + exact ae_of_ae_map (chart_aemeasurable e d) hh + +lemma ae_chart_source : ∀ᵐ x ∂chartMeasure e d, x ∈ e.source := + (chartMeasure_ac e d).ae_le (ae_restrict_mem e.open_source.measurableSet) + +end StrictHotSpots.Conformal +end +end ConformalMeasure + +section LpDensityClosure + + + + + +noncomputable section +open Set MeasureTheory Filter +open scoped Topology ENNReal +namespace LpDensityClosure + +variable {α : Type*} [MeasurableSpace α] {μ ν : Measure α} +variable {E : Type*} [NormedAddCommGroup E] + +lemma ae_eq_of_tendsto (hν : ν ≪ μ) + {f : ℕ → Lp E 2 μ} {g : ℕ → Lp E 2 ν} {u : Lp E 2 μ} {v : Lp E 2 ν} + (he : ∀ n, (f n : α → E) =ᵐ[ν] (g n : α → E)) + (hf : Tendsto f atTop (𝓝 u)) (hg : Tendsto g atTop (𝓝 v)) : + (u : α → E) =ᵐ[ν] (v : α → E) := by + obtain ⟨φ,hφ,hφae⟩ := (tendstoInMeasure_of_tendsto_Lp hf).exists_seq_tendsto_ae + obtain ⟨ψ,hψ,hψae⟩ := + (tendstoInMeasure_of_tendsto_Lp (hg.comp hφ.tendsto_atTop)).exists_seq_tendsto_ae + filter_upwards [hν.ae_le hφae,hψae,ae_all_iff.mpr he] with x hx hx' heq + apply tendsto_nhds_unique (hx.comp hψ.tendsto_atTop) + exact hx'.congr' (Filter.Eventually.of_forall (fun n => (heq (φ (ψ n))).symm)) + +lemma isClosed_graph (hν : ν ≪ μ) : + IsClosed {fg : Lp E 2 μ × Lp E 2 ν | (fg.1 : α → E) =ᵐ[ν] (fg.2 : α → E)} := by + apply IsSeqClosed.isClosed + intro fg uv hfg ht + exact ae_eq_of_tendsto hν hfg (continuous_fst.tendsto uv |>.comp ht) + (continuous_snd.tendsto uv |>.comp ht) + +lemma ae_eq_of_dense {X Y : Type*} [TopologicalSpace X] + {j : Y → X} (hj : DenseRange j) (hν : ν ≪ μ) + {f : X → Lp E 2 μ} {g : X → Lp E 2 ν} + (hf : Continuous f) (hg : Continuous g) + (hfg : ∀ y, (f (j y) : α → E) =ᵐ[ν] (g (j y) : α → E)) (x : X) : + (f x : α → E) =ᵐ[ν] (g x : α → E) := by + have hc : IsClosed {x | (f x : α → E) =ᵐ[ν] (g x : α → E)} := + (isClosed_graph hν).preimage (hf.prodMk hg) + exact closure_minimal (by rintro _ ⟨y,rfl⟩; exact hfg y) hc (hj x) + +end LpDensityClosure +end +end LpDensityClosure + +section ConformalWeightedValue + + + + + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace Topology ENNReal +namespace StrictHotSpots.Conformal +variable (e : OpenPartialHomeomorph Plane Plane) +variable (he : ContDiffOn ℝ ∞ e.symm e.target) +variable (d : Plane → ℂ) +variable (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + + +def weightedValue : H10 e.open_source →L[ℝ] Lp ℝ 2 (chartMeasure e d) := + (chartPull e d hd).toContinuousLinearMap.comp + ((H10.value e.open_target).comp (transportH10 e he)) + +lemma weightedValue_test (hb : Bornology.IsBounded e.target) + (f : smoothTestSpace e.source) : + (weightedValue e he d hd (smoothTestToH10 e.open_source f) : Plane → ℝ) + =ᵐ[chartMeasure e d] f := by + have ht := transportH10_test e he d hd hb f + have hp : weightedValue e he d hd (smoothTestToH10 e.open_source f) = + chartPull e d hd (H10.value e.open_target + (smoothTestToH10 e.open_target (transportTest e he f))) := + congrArg (fun w : H10 e.open_target => chartPull e d hd (H10.value e.open_target w)) ht + rw [hp] + have ha := chartPull_test_ae e d hd + (test_memLp (Ω:=e.target) (transportTest e he f).property.1 + (transportTest e he f).property.2.1) + apply ha.trans + filter_upwards [ae_chart_source e d] with x hx + exact CompactChart.transport_source e f hx + + + +lemma weightedValue_ae (hb : Bornology.IsBounded e.target) (v : H10 e.open_source) : + (H10.value e.open_source v : Plane → ℝ) =ᵐ[chartMeasure e d] + (weightedValue e he d hd v : Plane → ℝ) := by + apply LpDensityClosure.ae_eq_of_dense (dense_smoothTestToH10 e.open_source) + (chartMeasure_ac e d) (H10.value e.open_source).continuous + (weightedValue e he d hd).continuous _ v + intro f + have hs : (H10.value e.open_source (smoothTestToH10 e.open_source f) : Plane → ℝ) + =ᵐ[chartMeasure e d] f := + (chartMeasure_ac e d).ae_le + (test_memLp (Ω:=e.source) f.property.1 f.property.2.1).coeFn_toLp + exact hs.trans (weightedValue_test e he d hd hb f).symm + +lemma weightedValue_norm (v : H10 e.open_source) : + ‖weightedValue e he d hd v‖ = + ‖H10.value e.open_target (transportH10 e he v)‖ := + (chartPull e d hd).norm_map _ + +include he hd in +lemma value_memLp_chartMeasure (hb : Bornology.IsBounded e.target) + (v : H10 e.open_source) : + MemLp (H10.value e.open_source v : Plane → ℝ) 2 (chartMeasure e d) := + MemLp.ae_eq (weightedValue_ae e he d hd hb v).symm (Lp.memLp (weightedValue e he d hd v)) + +include hd in +lemma physical_value_sq (hb : Bornology.IsBounded e.target) (v : H10 e.open_source) : + ‖H10.value e.open_target (transportH10 e he v)‖^2 = + ∫ x, (H10.value e.open_source v x)^2 ∂chartMeasure e d := by + calc + _ = ‖weightedValue e he d hd v‖^2 := + congrArg (fun t : ℝ => t^2) (weightedValue_norm e he d hd v).symm + _ = ∫ x, (weightedValue e he d hd v x)^2 ∂chartMeasure e d := + L2Limits.norm_sq_eq_integral_sq _ + _ = _ := integral_congr_ae ((weightedValue_ae e he d hd hb v).symm.fun_comp + (fun t : ℝ => t^2)) + +include he hd in + + +theorem weighted_subcritical (hb : Bornology.IsBounded e.target) + (hne : e.target.Nonempty) : + ∃ L : ℝ, 0 < L ∧ firstPositiveNeumannValue e.target < L ∧ + ∀ v : H10 e.open_source, + L*(∫ x, (H10.value e.open_source v x)^2 ∂chartMeasure e d) ≤ + ‖H10.grad e.open_source v‖^2 := by + apply Exists.elim (transported_subcritical e he d hd hb hne) + intro L h + refine Exists.intro L ⟨h.1,h.2.1,fun v => ?_⟩ + exact (congrArg (fun t : ℝ => L*t) (physical_value_sq e he d hd hb v)).symm.le.trans (h.2.2 v) + +end StrictHotSpots.Conformal +end +end ConformalWeightedValue + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Dirichlet.lean b/lean/OAI/Analysis/HotSpots/Dirichlet.lean new file mode 100644 index 0000000000000000000000000000000000000000..e39d24cdfb13a1daefa1687cc8d9805845c187ef --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Dirichlet.lean @@ -0,0 +1,638 @@ +import OAI.Analysis.HotSpots.Helmholtz + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section ZeroLpPairingCombinedLayer +open Set MeasureTheory Filter +open scoped ENNReal InnerProductSpace +namespace StrictHotSpots.LpZeroExtension +variable {α E : Type*} [MeasurableSpace α] {μ : Measure α} + [NormedAddCommGroup E] [InnerProductSpace ℝ E] {s : Set α} (hs : MeasurableSet s) + +lemma integral_inner (f : Lp E 2 (μ.restrict s)) (g : α → E) : + (∫ x, inner ℝ (linearIsometry hs f x) (g x) ∂μ) = + ∫ x in s, inner ℝ (f x) (g x) ∂μ := by + rw [← integral_indicator hs] + apply integral_congr_ae + filter_upwards [linearIsometry_ae hs f] with x hx + rw [hx] + by_cases hx : x ∈ s <;> simp [hx] + +lemma integral_mul (f : Lp ℝ 2 (μ.restrict s)) (g : α → ℝ) : + (∫ x, linearIsometry hs f x * g x ∂μ) = ∫ x in s, f x * g x ∂μ := by + simpa only [RCLike.inner_apply,RCLike.conj_to_real,mul_comm] using integral_inner hs f g + +lemma integrable [IsFiniteMeasure (μ.restrict s)] (f : Lp E 2 (μ.restrict s)) : + Integrable (linearIsometry hs f : α → E) μ := + ((integrable_indicator_iff hs).mpr ((Lp.memLp f).integrable (by norm_num))).congr + (linearIsometry_ae hs f).symm + +end StrictHotSpots.LpZeroExtension +end ZeroLpPairingCombinedLayer + +section ZeroLpWeakCombinedLayer +open Set MeasureTheory Filter Metric +open scoped ENNReal InnerProductSpace Topology Laplacian +namespace StrictHotSpots.LpZeroExtension +variable {Ω : Set Plane} (hΩ : IsOpen Ω) +lemma weak_of_neumann (lam : ℝ) (f : Lp ℝ 2 (volume.restrict Ω)) + (g : Lp Plane 2 (volume.restrict Ω)) + (hg : HasH1Gradient univ (linearIsometry hΩ.measurableSet f) (linearIsometry hΩ.measurableSet g)) + (he : ∀ v k, HasH1Gradient Ω v k → + (∫ x in Ω, inner ℝ (g x) (k x)) = lam * (∫ x in Ω, f x * v x)) : + PlaneWeakEquation univ lam (linearIsometry hΩ.measurableSet f) := by + intro φ hφ hc hs + rw [weak_laplacian_test hg hφ hc hs] + simp only [Measure.restrict_univ] + rw [integral_inner hΩ.measurableSet g (gradient φ),integral_mul hΩ.measurableSet f φ, + he _ _ (HasH1Gradient.test hΩ hφ hc),neg_mul] + +lemma zero_of_weak (hb : Bornology.IsBounded Ω) (lam : ℝ) + (f : Lp ℝ 2 (volume.restrict Ω)) + (hz : PlaneWeakEquation univ lam (linearIsometry hΩ.measurableSet f)) : f = 0 := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + have hint : IntegrableOn (linearIsometry hΩ.measurableSet f) univ := by + rw [IntegrableOn,Measure.restrict_univ] + exact integrable hΩ.measurableSet f + have hcne : closure Ω ≠ univ := by + intro hh + exact (NormedSpace.unbounded_univ ℝ Plane) (hh ▸ hb.closure) + obtain ⟨a,ha⟩ := (ne_univ_iff_exists_notMem _).mp hcne + obtain ⟨ε,hε,hsub⟩ := Metric.isOpen_iff.mp isClosed_closure.isOpen_compl a ha + have hzero : ∀ᵐ x ∂volume, x ∈ univ → linearIsometry hΩ.measurableSet f x = 0 := + planeWeak_uniqueContinuation isOpen_univ isPreconnected_univ hint hz + ⟨a,mem_univ a,ε,hε,by + filter_upwards [linearIsometry_ae hΩ.measurableSet f] with x hx + intro hxb + rw [hx,indicator_of_notMem (fun hh => hsub hxb (subset_closure hh))]⟩ + have hzLp : linearIsometry hΩ.measurableSet f = 0 := by + apply Lp.ext + have ha : (linearIsometry hΩ.measurableSet f : Plane → ℝ) =ᵐ[volume] (fun _ => 0) := + hzero.mono fun _ hx => hx (mem_univ _) + exact ha.trans (Lp.coeFn_zero _ _ _).symm + apply (linearIsometry hΩ.measurableSet).injective + exact hzLp.trans (map_zero _).symm + +end StrictHotSpots.LpZeroExtension +end ZeroLpWeakCombinedLayer + +section H10NeumannZeroCombinedLayer +open Set MeasureTheory Filter Metric +open scoped ENNReal InnerProductSpace Topology Laplacian +namespace StrictHotSpots.H10 +variable {Ω : Set Plane} (hΩ : IsOpen Ω) +local instance : NormedSpace ℝ (H10 hΩ) := (H10.innerProductSpace hΩ).toNormedSpace + + + +lemma zero_of_neumann (hb : Bornology.IsBounded Ω) (lam : ℝ) (u : H10 hΩ) + (he : ∀ v k, HasH1Gradient Ω v k → + (∫ x in Ω, inner ℝ (grad hΩ u x) (k x)) = + lam * (∫ x in Ω, value hΩ u x * v x)) : value hΩ u = 0 := by + exact LpZeroExtension.zero_of_weak hΩ hb lam (value hΩ u) + (LpZeroExtension.weak_of_neumann hΩ lam (value hΩ u) (grad hΩ u) + (zero_hasH1Gradient hΩ u) he) + +end StrictHotSpots.H10 +end H10NeumannZeroCombinedLayer + +section H10DilationCombinedLayer +open Set MeasureTheory Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots +open DiskH10 + +lemma smoothTest_value_sq_global {Ω : Set Plane} (hΩ : IsOpen Ω) (f : smoothTestSpace Ω) : + ‖H10.value hΩ (smoothTestToH10 hΩ f)‖^2 = ∫ x, ((f : Plane → ℝ) x)^2 := by + rw [L2Limits.norm_sq_eq_integral_sq] + have he : (∫ x in Ω, (H10.value hΩ (smoothTestToH10 hΩ f) x)^2) = + ∫ x in Ω, ((f : Plane → ℝ) x)^2 := by + apply integral_congr_ae + filter_upwards [(test_memLp (Ω := Ω) f.property.1 f.property.2.1).coeFn_toLp] with x hx + exact congrArg (fun t : ℝ => t^2) hx + rw [he] + apply setIntegral_eq_integral_of_forall_compl_eq_zero + intro x hx + rw [image_eq_zero_of_notMem_tsupport (fun hh => hx (f.property.2.2 hh)),zero_pow (by norm_num : 2 ≠ 0)] + +lemma smoothTest_grad_sq_global {Ω : Set Plane} (hΩ : IsOpen Ω) (f : smoothTestSpace Ω) : + ‖H10.grad hΩ (smoothTestToH10 hΩ f)‖^2 = ∫ x, ‖gradient (f : Plane → ℝ) x‖^2 := by + rw [L2VectorLimits.norm_sq_eq_integral_norm_sq] + have he : (∫ x in Ω, ‖H10.grad hΩ (smoothTestToH10 hΩ f) x‖^2) = + ∫ x in Ω, ‖gradient (f : Plane → ℝ) x‖^2 := by + apply integral_congr_ae + filter_upwards [(test_gradient_memLp (Ω := Ω) f.property.1 f.property.2.1).coeFn_toLp] with x hx + exact congrArg (fun t : Plane => ‖t‖^2) hx + rw [he] + apply setIntegral_eq_integral_of_forall_compl_eq_zero + intro x hx + rw [gradient,fderiv_of_notMem_tsupport ℝ (fun hh => hx (f.property.2.2 hh)),map_zero,norm_zero,zero_pow (by norm_num : 2 ≠ 0)] + +lemma gradient_comp_smul {f : Plane → ℝ} (hf : Differentiable ℝ f) (R : ℝ) (x : Plane) : + gradient (fun y => f (R • y)) x = R • gradient (f : Plane → ℝ) (R • x) := by + apply ext_inner_right ℝ + intro v + rw [inner_gradient_left, real_inner_smul_left, inner_gradient_left] + have hd : fderiv ℝ (fun y : Plane => f (R • y)) x = + (fderiv ℝ (f : Plane → ℝ) (R • x)).comp (R • ContinuousLinearMap.id ℝ Plane) := + (hf (R • x)).hasFDerivAt.comp x ((hasFDerivAt_id x).const_smul R) |>.fderiv + rw [hd] + simp + +namespace H10 +variable {Ω : Set Plane} (hΩ : IsOpen Ω) {R : ℝ} (hR : 1 ≤ R) + (hb : Ω ⊆ Metric.ball 0 R) + +include hR in +private lemma radius_pos : 0 < R := lt_of_lt_of_le zero_lt_one hR + +def dilateTest : smoothTestSpace Ω →ₗ[ℝ] smoothTestSpace disk where + toFun f := ⟨fun x => (f : Plane → ℝ) (R • x), f.property.1.comp (contDiff_id.const_smul R), + f.property.2.1.comp_homeomorph (Homeomorph.smul (Units.mk0 R (radius_pos hR).ne')), + by + intro x hx + have hh : R • x ∈ Ω := f.property.2.2 (tsupport_comp_subset_preimage _ (continuous_id.const_smul R) hx) + have ht := hb hh + simp only [Metric.mem_ball,dist_zero_right,norm_smul,Real.norm_eq_abs, + abs_of_pos (radius_pos hR)] at ht + change ‖x - 0‖ < 1 + rw [sub_zero] + nlinarith [radius_pos hR]⟩ + map_add' _ _ := rfl + map_smul' _ _ := rfl + +lemma dilateTest_value_sq (f : smoothTestSpace Ω) : + ‖value PlaneGreen.diskOpen (smoothTestToH10 PlaneGreen.diskOpen (dilateTest hR hb f))‖^2 = + (R^2)⁻¹ * ‖value hΩ (smoothTestToH10 hΩ f)‖^2 := by + rw [smoothTest_value_sq_global,smoothTest_value_sq_global] + change (∫ x : Plane, ((f : Plane → ℝ) (R • x))^2) = _ + have := Measure.integral_comp_smul_of_nonneg (volume : Measure Plane) (fun x => ((f : Plane → ℝ) x)^2) R + (hR := (radius_pos hR).le) + simpa [Plane, finrank_euclideanSpace, smul_eq_mul] using this + +lemma dilateTest_grad_sq (f : smoothTestSpace Ω) : + ‖grad PlaneGreen.diskOpen (smoothTestToH10 PlaneGreen.diskOpen (dilateTest hR hb f))‖^2 = + ‖grad hΩ (smoothTestToH10 hΩ f)‖^2 := by + rw [smoothTest_grad_sq_global,smoothTest_grad_sq_global] + have hd : ∀ x, gradient (dilateTest hR hb f : Plane → ℝ) x = R • gradient (f : Plane → ℝ) (R • x) := + gradient_comp_smul (f.property.1.differentiable (by simp)) R + simp_rw [hd,norm_smul,Real.norm_eq_abs,abs_of_pos (radius_pos hR),mul_pow] + rw [integral_const_mul] + have ht := Measure.integral_comp_smul_of_nonneg (volume : Measure Plane) + (fun x => ‖gradient (f : Plane → ℝ) x‖^2) R (hR := (radius_pos hR).le) + simp only [Plane, finrank_euclideanSpace, Fintype.card_fin,smul_eq_mul] at ht + rw [ht] + field_simp [(radius_pos hR).ne'] + +lemma dilateTest_norm (f : smoothTestSpace Ω) : + ‖smoothTestToH10 PlaneGreen.diskOpen (dilateTest hR hb f)‖ ≤ ‖smoothTestToH10 hΩ f‖ := by + have ha := dilateTest_value_sq hΩ hR hb f + have hg := dilateTest_grad_sq hΩ hR hb f + have hnorm1 := norm_sq PlaneGreen.diskOpen (smoothTestToH10 PlaneGreen.diskOpen (dilateTest hR hb f)) + have hnorm2 := norm_sq hΩ (smoothTestToH10 hΩ f) + have hi : (R^2)⁻¹ ≤ 1 := inv_le_one_of_one_le₀ (by nlinarith) + have hs := mul_le_mul_of_nonneg_right hi (sq_nonneg ‖value hΩ (smoothTestToH10 hΩ f)‖) + nlinarith [norm_nonneg (smoothTestToH10 hΩ f),norm_nonneg (smoothTestToH10 PlaneGreen.diskOpen (dilateTest hR hb f))] + +end H10 +end StrictHotSpots +end H10DilationCombinedLayer + +section CompactDominationCombinedLayer +open Set Metric +namespace StrictHotSpots +lemma compact_of_norm_dominated {E F G : Type*} + [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + (J : E →L[ℝ] F) (K : E →L[ℝ] G) (hK : IsCompactOperator K) + {C : ℝ} (hC : 0 < C) (h : ∀ x, ‖J x‖ ≤ C * ‖K x‖) : IsCompactOperator J := by + apply (isCompactOperator_iff_isCompact_closure_image_closedBall J.toLinearMap zero_lt_one).mpr + apply TotallyBounded.isCompact_of_isClosed _ isClosed_closure + apply TotallyBounded.closure + apply Metric.totallyBounded_iff.mpr + intro ε hε + have ht : TotallyBounded (K '' closedBall 0 1) := + (hK.isCompact_closure_image_closedBall 1).totallyBounded.subset subset_closure + obtain ⟨t,htsub,htfin,hcover⟩ := Metric.finite_approx_of_totallyBounded ht + (ε / C) (div_pos hε hC) + choose x hxball hx using fun y : t => htsub y.property + let : Finite t := htfin.to_subtype + refine ⟨Set.range (fun y : t => J (x y)), Set.finite_range _, ?_⟩ + rintro _ ⟨v,hv,rfl⟩ + obtain ⟨y,hy,hyv⟩ := mem_iUnion₂.mp (hcover (mem_image_of_mem K hv)) + refine mem_iUnion₂.mpr ⟨J (x ⟨y,hy⟩),mem_range_self _,?_⟩ + rw [mem_ball,dist_eq_norm] + change ‖J v - J (x ⟨y,hy⟩)‖ < ε + rw [← J.map_sub] + apply (h (v-x ⟨y,hy⟩)).trans_lt + rw [map_sub,hx] + have hh : ‖K v - y‖ < ε / C := by simpa only [Metric.mem_ball, dist_eq_norm] using hyv + have := (lt_div_iff₀ hC).mp hh + simpa only [mul_comm] using this +end StrictHotSpots +end CompactDominationCombinedLayer + +section BoundedCompactEmbeddingCombinedLayer +open Set MeasureTheory Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.H10 +open DiskH10 +variable {Ω : Set Plane} (hΩ : IsOpen Ω) {R : ℝ} (hR : 1 ≤ R) + (hb : Ω ⊆ Metric.ball 0 R) + +def dilation : H10 hΩ →L[ℝ] H10 PlaneGreen.diskOpen := + ((smoothTestToH10 PlaneGreen.diskOpen).comp (dilateTest hR hb)).extendOfNorm (smoothTestToH10 hΩ) + +lemma dilation_test (f : smoothTestSpace Ω) : + dilation hΩ hR hb (smoothTestToH10 hΩ f) = + smoothTestToH10 PlaneGreen.diskOpen (dilateTest hR hb f) := + LinearMap.extendOfNorm_eq (dense_smoothTestToH10 hΩ) + ⟨1,fun f => by + rw [one_mul] + exact dilateTest_norm hΩ hR hb f⟩ f + +lemma dilation_value_sq (u : H10 hΩ) : + ‖value PlaneGreen.diskOpen (dilation hΩ hR hb u)‖^2 = + (R^2)⁻¹ * ‖value hΩ u‖^2 := by + apply isClosed_property (dense_smoothTestToH10 hΩ) _ _ u + · exact isClosed_eq (((value PlaneGreen.diskOpen).continuous.comp + (dilation hΩ hR hb).continuous).norm.pow 2) + (continuous_const.mul ((value hΩ).continuous.norm.pow 2)) + · intro f + rw [dilation_test] + exact dilateTest_value_sq hΩ hR hb f + +private lemma le_mul_of_inv_sq {a b R : ℝ} (_ha : 0 ≤ a) (hb : 0 ≤ b) + (hR : 0 < R) (h : b^2 = (R^2)⁻¹ * a^2) : a ≤ R * b := by + have he : R^2 * b^2 = a^2 := by rw [h]; field_simp + nlinarith [mul_nonneg hR.le hb] + +lemma value_dilation_bound (u : H10 hΩ) : + ‖value hΩ u‖ ≤ R * ‖value PlaneGreen.diskOpen (dilation hΩ hR hb u)‖ := + le_mul_of_inv_sq (norm_nonneg _) (norm_nonneg _) (zero_lt_one.trans_le hR) + (dilation_value_sq hΩ hR hb u) + +include hR hb in +lemma value_compact_of_ball : IsCompactOperator (value hΩ) := by + let K : H10 hΩ →L[ℝ] Lp ℝ 2 (volume.restrict disk) := + (value PlaneGreen.diskOpen).comp (dilation hΩ hR hb) + have hK : IsCompactOperator K := PlaneGreen.value_compact.comp_clm (dilation hΩ hR hb) + exact compact_of_norm_dominated (value hΩ) K hK (zero_lt_one.trans_le hR) + (value_dilation_bound hΩ hR hb) + +include hΩ in +lemma value_compact (hbounded : Bornology.IsBounded Ω) : IsCompactOperator (value hΩ) := by + obtain ⟨r,hr⟩ := hbounded.subset_ball (0 : Plane) + exact value_compact_of_ball hΩ (le_max_left 1 r) + (hr.trans (Metric.ball_subset_ball (le_max_right 1 r))) + +end StrictHotSpots.H10 +end BoundedCompactEmbeddingCombinedLayer + +section PositiveCompactCombinedLayer +open Set +open scoped InnerProductSpace +namespace StrictHotSpots + +lemma positive_norm_mem_spectrum {H : Type*} [NormedAddCommGroup H] + [InnerProductSpace ℝ H] [CompleteSpace H] [Nontrivial H] + (T : H →L[ℝ] H) (hs : T.IsSymmetric) (hp : ∀ x, 0 ≤ inner ℝ (T x) x) : + ‖T‖ ∈ spectrum ℝ T := by + by_contra h + have hr : algebraMap ℝ ℝ ‖T‖ ∈ resolventSet ℝ T := by + simpa only [Algebra.algebraMap_self, RingHom.id_apply] using (not_not.mp h) + obtain ⟨ε,hε,hgap⟩ := T.rayleighQuotient_le_of_norm_mem_resolventSet hr + have hn := T.norm_eq_iSup_rayleighQuotient hs + have hbound : ‖T‖ ≤ ‖T‖ - ε := by + calc + ‖T‖ = ⨆ x, |T.rayleighQuotient x| := hn + _ ≤ ‖T‖ - ε := by + apply ciSup_le + intro x + have hx : 0 ≤ T.rayleighQuotient x := by + exact div_nonneg (hp x) (sq_nonneg _) + rw [abs_of_nonneg hx] + exact hgap x + linarith + +lemma positive_compact_top_eigenvector {H : Type*} [NormedAddCommGroup H] + [InnerProductSpace ℝ H] [CompleteSpace H] + (T : H →L[ℝ] H) (hs : T.IsSymmetric) (hp : ∀ x, 0 ≤ inner ℝ (T x) x) + (hc : IsCompactOperator T) (hne : T ≠ 0) : + ∃ f : H, f ≠ 0 ∧ T f = ‖T‖ • f := by + have : Nontrivial H := not_subsingleton_iff_nontrivial.mp (by + intro hh + apply hne + ext x + exact Subsingleton.elim _ _) + have he := (hc.hasEigenvalue_iff_mem_spectrum (norm_ne_zero_iff.mpr hne)).mpr + (positive_norm_mem_spectrum T hs hp) + obtain ⟨f,hf⟩ := he.exists_hasEigenvector + exact ⟨f,hf.2,Module.End.mem_eigenspace_iff.mp hf.1⟩ + +end StrictHotSpots +end PositiveCompactCombinedLayer + +section DirichletAttainmentCombinedLayer +open Set +open scoped InnerProductSpace +namespace StrictHotSpots.DirichletOperator +variable {V H : Type*} + [NormedAddCommGroup V] [InnerProductSpace ℝ V] [CompleteSpace V] + [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] + +omit [CompleteSpace V] in +lemma energy_nonneg (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) (v : V) : + 0 ≤ B v v := by + obtain ⟨C,hC,h⟩ := hB + exact (mul_nonneg (mul_nonneg hC.le (norm_nonneg _)) (norm_nonneg _)).trans (h v) + +omit [CompleteSpace V] in +lemma energy_eq_zero (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) {v : V} + (h : B v v = 0) : v = 0 := by + obtain ⟨C,hC,hc⟩ := hB + have hh := hc v + rw [h] at hh + have : ‖v‖ = 0 := le_antisymm (le_of_not_gt (fun hv => + (not_lt_of_ge hh) (mul_pos (mul_pos hC hv) hv))) (norm_nonneg v) + exact norm_eq_zero.mp this + +lemma green_ne_zero (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) + (J : V →L[ℝ] H) (hJ : J ≠ 0) : green B hB J ≠ 0 := by + intro h + apply hJ + ext v + have hS : solution B hB J (J v) = 0 := by + apply energy_eq_zero B hB + rw [solution_spec, ← green_apply, h, zero_apply, inner_zero_right] + have ht := solution_spec B hB J (J v) v + rw [hS, map_zero, zero_apply, real_inner_self_eq_norm_sq] at ht + exact norm_eq_zero.mp (by nlinarith [norm_nonneg (J v)]) + + + +lemma minimum_attained (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) + (hsym : ∀ u v, B u v = B v u) (J : V →L[ℝ] H) + (hJ : J ≠ 0) (hc : IsCompactOperator J) : + ∃ (lam : ℝ) (φ : V), 0 < lam ∧ J φ ≠ 0 ∧ + (∀ v, lam * ‖J v‖^2 ≤ B v v) ∧ + (∀ v, B φ v = lam * inner ℝ (J φ) (J v)) := by + let T := green B hB J + have hT : T ≠ 0 := green_ne_zero B hB J hJ + have hθ : 0 < ‖T‖ := norm_pos_iff.mpr hT + obtain ⟨f,hf,he⟩ := positive_compact_top_eigenvector T + (green_symmetric B hB hsym J) (fun f => by + rw [real_inner_comm]; exact green_nonneg B hB J f) + (hc.comp_clm (solution B hB J)) hT + let φ := solution B hB J f + have hφ : J φ = ‖T‖ • f := he + refine ⟨‖T‖⁻¹,φ,inv_pos.mpr hθ,?_,?_,?_⟩ + · rw [hφ] + exact smul_ne_zero hθ.ne' hf + · intro v + let w := solution B hB J (J v) + have hw : B w v = ‖J v‖^2 := by + rw [solution_spec, real_inner_self_eq_norm_sq] + have hw' : B v w = ‖J v‖^2 := (hsym v w).trans hw + have hww : B w w ≤ ‖T‖ * ‖J v‖^2 := by + calc + _ = inner ℝ (J v) (T (J v)) := solution_spec B hB J (J v) w + _ ≤ ‖J v‖ * ‖T (J v)‖ := real_inner_le_norm _ _ + _ ≤ ‖J v‖ * (‖T‖ * ‖J v‖) := by + gcongr; exact T.le_opNorm _ + _ = _ := by ring + have hpos := energy_nonneg B hB (‖T‖ • v - w) + simp only [map_sub, map_smul, sub_apply, + smul_apply, smul_eq_mul] at hpos + rw [hw,hw'] at hpos + have hineq : ‖J v‖^2 ≤ ‖T‖ * B v v := by nlinarith + rw [inv_mul_eq_div, div_le_iff₀ hθ] + nlinarith + · intro v + rw [solution_spec, hφ, real_inner_smul_left] + field_simp + +end StrictHotSpots.DirichletOperator +end DirichletAttainmentCombinedLayer + +section DirichletMinimumCombinedLayer +open Set MeasureTheory Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.H10 +variable {Ω : Set Plane} (hΩ : IsOpen Ω) +local instance : NormedSpace ℝ (H10 hΩ) := (H10.innerProductSpace hΩ).toNormedSpace + +lemma value_ne_zero (hne : Ω.Nonempty) : value hΩ ≠ 0 := by + obtain ⟨a,ha⟩ := hne + obtain ⟨f,hs,hc,hf,_,hfa⟩ := exists_contDiff_tsupport_subset (n := ⊤) (hΩ.mem_nhds ha) + let t : smoothTestSpace Ω := ⟨f,hf,hc,hs⟩ + intro hz + have he : (test_memLp (Ω := Ω) hf hc).toLp f = 0 := by + change value hΩ (smoothTestToH10 hΩ t) = 0 + exact DFunLike.congr_fun hz (smoothTestToH10 hΩ t) + have hae : f =ᵐ[volume.restrict Ω] (fun _ => (0 : ℝ)) := + (test_memLp hf hc).coeFn_toLp.symm.trans (he ▸ Lp.coeFn_zero _ _ _) + have hp := Measure.eqOn_open_of_ae_eq hae hΩ hf.continuous.continuousOn continuousOn_const ha + exact zero_ne_one (hp.symm.trans hfa) + + + +lemma minimum (hne : Ω.Nonempty) (hb : Bornology.IsBounded Ω) : + ∃ (lam : ℝ) (φ : H10 hΩ), 0 < lam ∧ value hΩ φ ≠ 0 ∧ + (∀ v, lam * ‖value hΩ v‖^2 ≤ ‖grad hΩ v‖^2) ∧ + (∀ v, inner ℝ (grad hΩ φ) (grad hΩ v) = + lam * inner ℝ (value hΩ φ) (value hΩ v)) := by + have hsym : ∀ u v : H10 hΩ, energy hΩ u v = energy hΩ v u := by + intro u v + exact (real_inner_comm (grad hΩ u) (grad hΩ v)).symm + have hm := @DirichletOperator.minimum_attained (H10 hΩ) (Lp ℝ 2 (volume.restrict Ω)) + (H10.normedAddCommGroup hΩ) (H10.innerProductSpace hΩ) (H10.completeSpace hΩ) + inferInstance inferInstance inferInstance (energy hΩ) (energy_coercive hΩ hb) + hsym (value hΩ) (value_ne_zero hΩ hne) (value_compact hΩ hb) + obtain ⟨lam,φ,hl,hφ,hineq,heq⟩ := hm + refine ⟨lam,φ,hl,hφ,?_,heq⟩ + intro v + simpa only [energy_apply,real_inner_self_eq_norm_sq] using hineq v + +end StrictHotSpots.H10 +end DirichletMinimumCombinedLayer + +section StrictGapAlgebraCombinedLayer +open Set MeasureTheory Filter +open scoped ENNReal InnerProductSpace Topology +namespace StrictHotSpots +namespace H1 +variable {Ω : Set Plane} (hb : Bornology.IsBounded Ω) +local instance : NormedSpace ℝ (H1 Ω) := (h1Graph Ω).normedSpace + +def corrected (φ v : H1 Ω) : H1 Ω := v - ((mean hb v) / (mean hb φ)) • φ +lemma mean_corrected (φ v : H1 Ω) (hφ : mean hb φ ≠ 0) : + mean hb (corrected hb φ v) = 0 := by + simp only [corrected,map_sub,map_smul,smul_eq_mul] + field_simp + ring +lemma corrected_form (lam : ℝ) (φ v : H1 Ω) (hφ : form lam φ φ = 0) + (hv : form lam v φ = 0) : form lam (corrected hb φ v) (corrected hb φ v) = form lam v v := + form_diag_sub _ _ _ _ hφ hv +end H1 +namespace PlaneWaves +variable {Ω : Set Plane} (hΩ : IsOpen Ω) (hb : Bornology.IsBounded Ω) +local instance : NormedSpace ℝ (H1 Ω) := (h1Graph Ω).normedSpace + +lemma all_pair_zero {lam : ℝ} (hle : lam ≤ firstPositiveNeumannValue Ω) + (hvol : 0 < (volume Ω).toReal) (φ : H10 hΩ) + (he : H1.form lam φ.val φ.val = 0) (hm : H1.mean hb φ.val ≠ 0) + {k : Plane} (hk : ‖k‖^2 = lam) {l : Plane} (hl : ‖l‖^2 = lam) : + H1.form lam (cosH1 hΩ hb k) (cosH1 hΩ hb l) = 0 ∧ + H1.form lam (sinH1 hΩ hb k) (sinH1 hΩ hb l) = 0 := by + let c := H1.corrected hb φ.val (cosH1 hΩ hb k) + let s := H1.corrected hb φ.val (sinH1 hΩ hb k) + have hmc : H1.mean hb c = 0 := H1.mean_corrected hb _ _ hm + have hms : H1.mean hb s = 0 := H1.mean_corrected hb _ _ hm + have hc : H1.form lam c c = H1.form lam (cosH1 hΩ hb k) (cosH1 hΩ hb k) := + H1.corrected_form hb _ _ _ he (cosH1_dirichlet_pair hΩ hb hk φ) + have hs : H1.form lam s s = H1.form lam (sinH1 hΩ hb k) (sinH1 hΩ hb k) := + H1.corrected_form hb _ _ _ he (sinH1_dirichlet_pair hΩ hb hk φ) + have hsum := self_sum hΩ hb hk + have hcn := H1.form_nonneg hb hle c hmc + have hsn := H1.form_nonneg hb hle s hms + have hcz : H1.form lam c c = 0 := by linarith + have hsz : H1.form lam s s = 0 := by linarith + have hce := H1.form_zero_euler hb hle hvol c hmc hcz (cosH1 hΩ hb l) + have hse := H1.form_zero_euler hb hle hvol s hms hsz (sinH1 hΩ hb l) + have hcl : H1.form lam φ.val (cosH1 hΩ hb l) = 0 := by + rw [H1.form_symm]; exact cosH1_dirichlet_pair hΩ hb hl φ + have hsl : H1.form lam φ.val (sinH1 hΩ hb l) = 0 := by + rw [H1.form_symm]; exact sinH1_dirichlet_pair hΩ hb hl φ + simp only [c,s,H1.corrected,H1.form_sub_left,H1.form_smul_left,hcl,hsl,mul_zero,sub_zero] + at hce hse + exact ⟨hce,hse⟩ +end PlaneWaves +end StrictHotSpots +end StrictGapAlgebraCombinedLayer + +section NearbyFrequenciesCombinedLayer +open Set MeasureTheory Filter Metric +open scoped ENNReal InnerProductSpace Topology +namespace StrictHotSpots.PlaneWaves + +def frequency (r θ : ℝ) : Plane := WithLp.toLp 2 ![r * Real.cos θ, r * Real.sin θ] +lemma frequency_norm_sq (r θ : ℝ) : ‖frequency r θ‖^2 = r^2 := by + rw [PiLp.norm_sq_eq_of_L2] + simp only [frequency,Fin.sum_univ_two,Real.norm_eq_abs,sq_abs,WithLp.ofLp_toLp,Matrix.cons_val_zero,Matrix.cons_val_one] + nlinarith [Real.sin_sq_add_cos_sq θ] +lemma frequency_inner (r θ : ℝ) : inner ℝ (frequency r 0) (frequency r θ) = r^2 * Real.cos θ := by + simp [frequency,PiLp.inner_apply,Fin.sum_univ_two,RCLike.inner_apply,pow_two] + ring +lemma frequency_continuous (r : ℝ) : Continuous (frequency r) := by + apply (PiLp.continuous_toLp 2 _).comp + apply continuous_pi_iff.mpr + intro i + fin_cases i <;> fun_prop + +lemma cosine_integral_continuous {Ω : Set Plane} (hb : Bornology.IsBounded Ω) : + Continuous (fun k : Plane => ∫ x in Ω, cosine k x) := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + apply continuous_of_dominated (bound := fun _ => (1 : ℝ)) + · intro k + exact (cosine_smooth k).continuous.aestronglyMeasurable + · intro k + exact Eventually.of_forall fun x => Real.norm_eq_abs _ ▸ Real.abs_cos_le_one _ + · exact integrable_const _ + · exact Eventually.of_forall fun x => Real.continuous_cos.comp (continuous_id.inner continuous_const) + + + +lemma exists_nearby {Ω : Set Plane} (hb : Bornology.IsBounded Ω) + (hvol : 0 < (volume Ω).toReal) {lam : ℝ} (hlam : 0 < lam) : + ∃ k l : Plane, ‖k‖^2 = lam ∧ ‖l‖^2 = lam ∧ inner ℝ k l ≠ lam ∧ + 0 < ∫ x in Ω, cosine (k-l) x := by + let r := Real.sqrt lam + have hr : r^2 = lam := Real.sq_sqrt hlam.le + have hc : Continuous (fun θ : ℝ => ∫ x in Ω, cosine (frequency r 0 - frequency r θ) x) := + (cosine_integral_continuous hb).comp (continuous_const.sub (frequency_continuous r)) + have h0 : 0 < ∫ x in Ω, cosine (frequency r 0 - frequency r 0) x := by + simpa [cosine,Measure.real] using hvol + have he : ∀ᶠ θ in 𝓝 (0 : ℝ), 0 < ∫ x in Ω, cosine (frequency r 0 - frequency r θ) x := + hc.continuousAt.eventually (Ioi_mem_nhds h0) + obtain ⟨δ,hδ,hδ'⟩ := Metric.eventually_nhds_iff.mp he + let θ := min δ (Real.pi) / 2 + have ht : 0 < θ := by dsimp [θ]; positivity + have htd : θ < δ := by dsimp [θ]; linarith [min_le_left δ Real.pi] + have htp : θ < Real.pi := by dsimp [θ]; linarith [min_le_right δ Real.pi,Real.pi_pos] + refine ⟨frequency r 0,frequency r θ,(frequency_norm_sq _ _).trans hr, + (frequency_norm_sq _ _).trans hr,?_,hδ' (by simpa [Real.dist_eq,abs_of_pos ht] using htd)⟩ + rw [frequency_inner,hr] + intro hx + have hc1 : Real.cos θ = 1 := by nlinarith + have hs : 0 < Real.sin θ := Real.sin_pos_of_pos_of_lt_pi ht htp + nlinarith [Real.sin_sq_add_cos_sq θ] +end StrictHotSpots.PlaneWaves +end NearbyFrequenciesCombinedLayer + +section StrictGapCombinedLayer +open Set MeasureTheory Filter +open scoped ENNReal InnerProductSpace Topology +namespace StrictHotSpots +namespace H10 +variable {Ω : Set Plane} (hΩ : IsOpen Ω) + +lemma zero_of_form_neumann (hb : Bornology.IsBounded Ω) (lam : ℝ) (φ : H10 hΩ) + (he : ∀ v : H1 Ω, H1.form lam φ.val v = 0) : value hΩ φ = 0 := by + apply zero_of_neumann hΩ hb lam φ + intro v k hv + have hh := he hv.toH1 + unfold H1.form at hh + rw [H1.grad_toH1,H1.value_toH1,L2Inner.toLp_right,L2Inner.toLp_right] at hh + have hf : (∫ x in Ω, inner ℝ (H1.value φ.val x) (v x)) = + (∫ x in Ω, value hΩ φ x * v x) := by + apply integral_congr_ae + exact Eventually.of_forall fun x => by + simp only [RCLike.inner_apply,RCLike.conj_to_real] + exact mul_comm _ _ + rw [hf,sub_eq_zero] at hh + exact hh + + + + +lemma strict_gap (hne : Ω.Nonempty) (hb : Bornology.IsBounded Ω) + {lam : ℝ} (hlam : 0 < lam) (φ : H10 hΩ) (hφ : value hΩ φ ≠ 0) + (he : ∀ v, inner ℝ (grad hΩ φ) (grad hΩ v) = + lam * inner ℝ (value hΩ φ) (value hΩ v)) : + firstPositiveNeumannValue Ω < lam := by + by_contra hn + have hle : lam ≤ firstPositiveNeumannValue Ω := le_of_not_gt hn + have hvol : 0 < (volume Ω).toReal := + ENNReal.toReal_pos (hΩ.measure_pos volume hne).ne' hb.measure_lt_top.ne + have hform : H1.form lam φ.val φ.val = 0 := sub_eq_zero.mpr (he φ) + have hm : H1.mean hb φ.val ≠ 0 := by + intro hz + apply hφ + apply zero_of_form_neumann hΩ hb lam φ + exact H1.form_zero_euler hb hle hvol φ.val hz hform + obtain ⟨k,l,hk,hl,hkl,hint⟩ := PlaneWaves.exists_nearby hb hvol hlam + obtain ⟨hc,hs⟩ := PlaneWaves.all_pair_zero hΩ hb hle hvol φ hform hm hk hl + have hsum := PlaneWaves.pair_sum hΩ hb lam k l + rw [hc,hs,zero_add] at hsum + have hp : (inner ℝ k l - lam) * (∫ x in Ω, PlaneWaves.cosine (k-l) x) = 0 := hsum.symm + exact hkl (sub_eq_zero.mp ((mul_eq_zero.mp hp).resolve_right hint.ne')) + +lemma subcritical (hne : Ω.Nonempty) (hb : Bornology.IsBounded Ω) : + ∃ lam : ℝ, 0 < lam ∧ firstPositiveNeumannValue Ω < lam ∧ + ∀ v : H10 hΩ, lam * ‖value hΩ v‖^2 ≤ ‖grad hΩ v‖^2 := by + obtain ⟨lam,φ,hl,hφ,hi,he⟩ := minimum hΩ hne hb + exact ⟨lam,hl,strict_gap hΩ hne hb hl φ hφ he,hi⟩ +end H10 +end StrictHotSpots +end StrictGapCombinedLayer + + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/DiskKernel.lean b/lean/OAI/Analysis/HotSpots/DiskKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..0311c69436c33a9b33d0995cea3b43ba4cc1ec11 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/DiskKernel.lean @@ -0,0 +1,720 @@ +import OAI.Analysis.HotSpots.Reciprocal + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section FullBoundaryCombinedLayer +section DiskFiniteLayer + +open Filter Matrix +open scoped Topology +namespace StrictHotSpots.ScalarKernel + +lemma choose_recurrence (a : ℝ) (n : ℕ) : + ((n : ℝ) + 1) * Ring.choose a (n + 1) = (a - n) * Ring.choose a n := by + have hh := Ring.descPochhammer_eq_factorial_smul_choose a (n + 1) + rw [descPochhammer_succ_right, Polynomial.smeval_mul, + Polynomial.smeval_sub, Polynomial.smeval_X, Polynomial.smeval_natCast, + Ring.descPochhammer_eq_factorial_smul_choose] at hh + simp only [nsmul_eq_mul, Nat.factorial_succ, Nat.cast_mul, Nat.cast_add, + Nat.cast_one] at hh + have hn : (n.factorial : ℝ) ≠ 0 := by positivity + apply mul_left_cancel₀ hn + nlinarith [hh] + +def coeff (a : ℝ) (n : ℕ) : ℝ := -(Ring.choose a (n + 2) * (-1) ^ (n + 2)) + +lemma coeff_nonneg {a : ℝ} (ha : 0 ≤ a) (ha1 : a ≤ 1) (n : ℕ) : 0 ≤ coeff a n := by + induction n with + | zero => + have hh := choose_recurrence a 1 + simp only [Nat.cast_one, Ring.choose_one_right] at hh + simp only [coeff, zero_add, even_two, Even.neg_pow, one_pow, mul_one] + nlinarith [mul_nonneg ha (sub_nonneg.mpr ha1)] + | succ n ih => + have hh := choose_recurrence a (n + 2) + have hrec : ((n : ℝ) + 3) * coeff a (n + 1) = ((n : ℝ) + 2 - a) * coeff a n := by + simp only [coeff, Nat.cast_add, Nat.cast_ofNat] at * + rw [show n + 1 + 2 = (n + 2) + 1 by omega, pow_succ] + nlinarith [congrArg (fun t : ℝ => t * (-1) ^ (n + 2)) hh] + have hn : 0 < (n : ℝ) + 3 := by positivity + have hmul : 0 ≤ ((n : ℝ) + 2 - a) * coeff a n := + mul_nonneg (by have : (0 : ℝ) ≤ n := Nat.cast_nonneg n; linarith) ih + nlinarith + +lemma binomial_hasSum {a k : ℝ} (hk : |k| < 1) : + HasSum (fun n : ℕ => Ring.choose a n * (-k) ^ n) ((1 - k) ^ a) := by + have hh := (Real.one_add_rpow_hasFPowerSeriesOnBall_zero (a := a)).hasSum + (y := -k) (by simpa [Metric.mem_eball, edist_dist, Real.norm_eq_abs] using hk) + simpa [binomialSeries, FormalMultilinearSeries.coeff_ofScalars, + sub_eq_add_neg, mul_comm] using hh + + +lemma defect_hasSum {a k : ℝ} (hk0 : 0 < k) (hk1 : k < 1) : + HasSum (fun n : ℕ => coeff a n * k ^ (n + 1)) + ((1 - (1 - k) ^ a) / k - a) := by + have hh := binomial_hasSum (a := a) (abs_lt.mpr ⟨by linarith, hk1⟩) + have ht := (hasSum_nat_add_iff' 2).mpr hh + have hs := ht.mul_left (-k⁻¹) + have he : (fun n : ℕ => -k⁻¹ * (Ring.choose a (n + 2) * (-k) ^ (n + 2))) = + (fun n : ℕ => coeff a n * k ^ (n + 1)) := by + funext n + rw [neg_pow k (n + 2)] + simp only [coeff, pow_add] + field_simp + rw [he] at hs + have hv : -k⁻¹ * ((1 - k) ^ a - ∑ i ∈ Finset.range 2, Ring.choose a i * (-k) ^ i) = + (1 - (1 - k) ^ a) / k - a := by + simp only [Finset.sum_range_succ, Finset.sum_range_zero, + Ring.choose_zero_right, Ring.choose_one_right, pow_zero, pow_one] + field_simp + ring + rwa [hv] at hs + +section Matrix +variable {ι : Type*} [Fintype ι] + + +lemma posSemidef_entry_pow {A : Matrix ι ι ℝ} (hA : A.PosSemidef) (n : ℕ) : + (Matrix.of (fun i j => A i j ^ n)).PosSemidef := by + induction n with + | zero => + simpa [Matrix.vecMulVec] using + (Matrix.posSemidef_vecMulVec_self_star (fun _ : ι => (1 : ℝ))) + | succ n ih => + have he : Matrix.of (fun i j => A i j ^ (n + 1)) = + Matrix.of (fun i j => A i j ^ n) ⊙ A := by + ext i j + simp [pow_succ] + rw [he] + exact ih.hadamard hA + + +lemma posSemidef_of_entrywise_tendsto {A : ℕ → Matrix ι ι ℝ} {B : Matrix ι ι ℝ} + (hA : ∀ n, (A n).PosSemidef) + (hlim : ∀ i j, Tendsto (fun n => A n i j) atTop (𝓝 (B i j))) : B.PosSemidef := by + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg + · apply Matrix.isHermitian_iff_isSymm.mpr + ext i j + exact tendsto_nhds_unique (hlim j i) + ((hlim i j).congr fun n => by simpa using (hA n).isHermitian.apply j i) + · intro x + have hlimq : Tendsto (fun n => star x ⬝ᵥ A n *ᵥ x) atTop + (𝓝 (star x ⬝ᵥ B *ᵥ x)) := by + unfold dotProduct Matrix.mulVec + exact tendsto_finsetSum _ (fun i _ => tendsto_const_nhds.mul + (tendsto_finsetSum _ fun j _ => (hlim i j).mul tendsto_const_nhds)) + exact ge_of_tendsto hlimq (Filter.Eventually.of_forall fun n => + (hA n).dotProduct_mulVec_nonneg x) + + +lemma defect_posSemidef {A : Matrix ι ι ℝ} (hA : A.PosSemidef) + (hpos : ∀ i j, 0 < A i j) (hlt : ∀ i j, A i j < 1) + {a : ℝ} (ha : 0 ≤ a) (ha1 : a ≤ 1) : + (Matrix.of (fun i j => (1 - (1 - A i j) ^ a) / A i j - a)).PosSemidef := by + apply posSemidef_of_entrywise_tendsto + (A := fun n => ∑ m ∈ Finset.range n, + coeff a m • Matrix.of (fun i j => A i j ^ (m + 1))) + · intro n + exact Matrix.posSemidef_sum _ (fun m _ => + (posSemidef_entry_pow hA _).smul (coeff_nonneg ha ha1 m)) + · intro i j + simpa only [Matrix.sum_apply, Matrix.smul_apply, Matrix.of_apply, smul_eq_mul] + using (defect_hasSum (a := a) (hpos i j) (hlt i j)).tendsto_sum_nat + +lemma integral_posSemidef {F : ℝ → Matrix ι ι ℝ} + (hF : ∀ a ∈ Set.Icc (0 : ℝ) 1, (F a).PosSemidef) + (hi : ∀ i j, IntervalIntegrable (fun a => F a i j) MeasureTheory.volume 0 1) : + (Matrix.of (fun i j => ∫ a in (0 : ℝ)..1, F a i j)).PosSemidef := by + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg + · apply Matrix.isHermitian_iff_isSymm.mpr + ext i j + apply intervalIntegral.integral_congr + intro a ha + have ha' : a ∈ Set.Icc (0 : ℝ) 1 := by simpa using ha + simpa using (hF a ha').isHermitian.apply i j + · intro v + have he : (star v ⬝ᵥ (Matrix.of (fun i j => ∫ a in (0 : ℝ)..1, F a i j)) *ᵥ v) = + ∫ a in (0 : ℝ)..1, star v ⬝ᵥ F a *ᵥ v := by + simp only [dotProduct, Matrix.mulVec, star_trivial, Matrix.of_apply] + rw [intervalIntegral.integral_finsetSum] + · apply Finset.sum_congr rfl + intro i _ + rw [intervalIntegral.integral_const_mul, intervalIntegral.integral_finsetSum] + · simp only [intervalIntegral.integral_mul_const] + · intro j _ + exact (hi i j).mul_const _ + · intro i _ + simpa only [Finset.sum_apply] using + (IntervalIntegrable.sum Finset.univ fun j _ => (hi i j).mul_const (v j)).const_mul (v i) + rw [he] + apply intervalIntegral.integral_nonneg (by norm_num) + intro a ha + exact (hF a ha).dotProduct_mulVec_nonneg v + +end Matrix + + +lemma integral_rpow_parameter {x : ℝ} (hx : 0 < x) (hx1 : x < 1) : + (∫ a in (0 : ℝ)..1, x ^ a) = (x - 1) / Real.log x := by + have hl : Real.log x ≠ 0 := ne_of_lt (Real.log_neg hx hx1) + have hh := intervalIntegral.mul_integral_comp_mul_left + (f := Real.exp) (a := 0) (b := 1) (Real.log x) + simp only [mul_zero, mul_one, integral_exp, Real.exp_zero, Real.exp_log hx] at hh + rw [eq_div_iff hl] + convert hh using 1 + · simp only [Real.rpow_def_of_pos hx, mul_comm] + +lemma integral_defect {k : ℝ} (hk0 : 0 < k) (hk1 : k < 1) : + (∫ a in (0 : ℝ)..1, ((1 - (1 - k) ^ a) / k - a)) = + k⁻¹ - 1 / 2 + (Real.log (1 - k))⁻¹ := by + have hb : 0 < 1 - k := sub_pos.mpr hk1 + have hcont : Continuous (fun a : ℝ => (1 - k) ^ a) := + Real.continuous_const_rpow hb.ne' + have hi := hcont.intervalIntegrable (μ := MeasureTheory.volume) 0 1 + have hi1 : IntervalIntegrable (fun a : ℝ => (1 - (1 - k) ^ a) / k) + MeasureTheory.volume 0 1 := + ((continuous_const.sub hcont).div_const k).intervalIntegrable 0 1 + have hiid : IntervalIntegrable (fun a : ℝ => a) MeasureTheory.volume 0 1 := + continuous_id.intervalIntegrable 0 1 + rw [intervalIntegral.integral_sub hi1 hiid] + rw [intervalIntegral.integral_div, intervalIntegral.integral_sub + (continuous_const.intervalIntegrable 0 1) hi] + rw [integral_rpow_parameter hb (by linarith)] + norm_num [intervalIntegral.integral_const, integral_id] + field_simp + ring + +section Matrix +variable {ι : Type*} [Fintype ι] + +lemma logDefect_posSemidef {A : Matrix ι ι ℝ} (hA : A.PosSemidef) + (hpos : ∀ i j, 0 < A i j) (hlt : ∀ i j, A i j < 1) : + (Matrix.of (fun i j => (A i j)⁻¹ - 1 / 2 + (Real.log (1 - A i j))⁻¹)).PosSemidef := by + have hh := integral_posSemidef + (F := fun a => Matrix.of (fun i j => (1 - (1 - A i j) ^ a) / A i j - a)) + (fun a ha => defect_posSemidef hA hpos hlt ha.1 ha.2) + (fun i j => (((continuous_const.sub + (Real.continuous_const_rpow (sub_pos.mpr (hlt i j)).ne')).div_const + (A i j)).sub continuous_id).intervalIntegrable 0 1) + simpa only [Matrix.of_apply, integral_defect (hpos _ _) (hlt _ _)] using hh + +end Matrix + + +def dilation (n : ℕ) : ℝ := 1 - ((n : ℝ) + 2)⁻¹ + +lemma dilation_pos (n : ℕ) : 0 < dilation n := by + have hn : 1 < (n : ℝ) + 2 := by have := Nat.cast_nonneg (α := ℝ) n; linarith + exact sub_pos.mpr (inv_lt_one_of_one_lt₀ hn) + +lemma dilation_lt_one (n : ℕ) : dilation n < 1 := by + have hn : 0 < ((n : ℝ) + 2)⁻¹ := by positivity + dsimp [dilation] + linarith + +lemma dilation_tendsto : Tendsto dilation atTop (𝓝 1) := by + have ht : Tendsto (fun n : ℕ => (n : ℝ) + 2) atTop atTop := + tendsto_natCast_atTop_atTop.atTop_add tendsto_const_nhds + unfold dilation + simpa only [sub_zero] using (tendsto_const_nhds.sub ht.inv_tendsto_atTop : + Tendsto (fun n : ℕ => 1 - ((n : ℝ) + 2)⁻¹) atTop (𝓝 (1 - 0))) + +lemma invLog_continuousAt_zero : ContinuousAt (fun x : ℝ => (Real.log x)⁻¹) 0 := by + rw [continuousAt_iff_punctured_nhds] + simpa only [one_div, Real.log_zero, _root_.inv_zero] using + Real.tendsto_log_nhdsNE_zero.const_div_atBot 1 + +lemma logDefect_tendsto {a : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) : + Tendsto (fun n => (dilation n * a)⁻¹ - 1 / 2 + + (Real.log (1 - dilation n * a))⁻¹) atTop + (𝓝 (a⁻¹ - 1 / 2 + (Real.log (1 - a))⁻¹)) := by + have ht : Tendsto (fun n => dilation n * a) atTop (𝓝 a) := + by simpa using dilation_tendsto.mul_const a + apply (ht.inv₀ ha.ne').sub_const (1 / 2) |>.add + have ht' : Tendsto (fun n => 1 - dilation n * a) atTop (𝓝 (1 - a)) := + tendsto_const_nhds.sub ht + by_cases he : a = 1 + · subst a + simpa only [Function.comp_def, mul_one, sub_self, Real.log_zero, _root_.inv_zero] using + invLog_continuousAt_zero.tendsto.comp (by simpa using ht') + · have hb : 0 < 1 - a := sub_pos.mpr (lt_of_le_of_ne ha1 he) + have hl : Real.log (1 - a) ≠ 0 := ne_of_lt (Real.log_neg hb (by linarith)) + exact (Real.continuousAt_log hb.ne').tendsto.comp ht' |>.inv₀ hl + +lemma logDefect_posSemidef_le {ι : Type*} [Fintype ι] {A : Matrix ι ι ℝ} + (hA : A.PosSemidef) (hpos : ∀ i j, 0 < A i j) (hle : ∀ i j, A i j ≤ 1) : + (Matrix.of (fun i j => (A i j)⁻¹ - 1 / 2 + (Real.log (1 - A i j))⁻¹)).PosSemidef := by + apply posSemidef_of_entrywise_tendsto + (A := fun n => Matrix.of (fun i j => (dilation n * A i j)⁻¹ - 1 / 2 + + (Real.log (1 - dilation n * A i j))⁻¹)) + · intro n + exact logDefect_posSemidef (hA.smul (dilation_pos n).le) + (fun i j => mul_pos (dilation_pos n) (hpos i j)) + (fun i j => lt_of_le_of_lt + (mul_le_mul_of_nonneg_left (hle i j) (dilation_pos n).le) + (by simpa using dilation_lt_one n)) + · intro i j + exact logDefect_tendsto (hpos i j) (hle i j) + +end StrictHotSpots.ScalarKernel + + + + + +open Matrix Filter Complex +open scoped Topology ComplexOrder ENNReal +namespace StrictHotSpots.DiskKernel + +abbrev Disk := {z : ℂ // ‖z‖ < 1} + +def h (x y : Disk) : ℝ := + ‖(x : ℂ) - y‖ ^ 2 / ((1 - ‖(x : ℂ)‖ ^ 2) * (1 - ‖(y : ℂ)‖ ^ 2)) + +def logMean (t : ℝ) : ℝ := (Real.log (1 + 1 / t))⁻¹ + +def f (t : ℝ) : ℝ := t + 1 / 2 - logMean t + + +def green (x y : Disk) : ℝ := + (4 * Real.pi)⁻¹ * Real.log (1 + 1 / h x y) + + +def greenExtended (x y : Disk) : ℝ≥0∞ := + if x = y then ∞ else ENNReal.ofReal (green x y) + + +def regularized (ε : ℝ) (x y : Disk) : ℝ := + (4 * Real.pi * (h x y + 1 / 2 - (1 - ε) * f (h x y)))⁻¹ + +lemma disk_weight_pos (x : Disk) : 0 < 1 - ‖(x : ℂ)‖ ^ 2 := by + have hn := norm_nonneg (x : ℂ) + have hx := x.property + nlinarith + +lemma h_nonneg (x y : Disk) : 0 ≤ h x y := + div_nonneg (sq_nonneg _) (mul_pos (disk_weight_pos x) (disk_weight_pos y)).le + +lemma h_pos {x y : Disk} (hxy : x ≠ y) : 0 < h x y := by + apply div_pos _ (mul_pos (disk_weight_pos x) (disk_weight_pos y)) + exact sq_pos_of_pos (norm_pos_iff.mpr (sub_ne_zero.mpr (Subtype.coe_ne_coe.mpr hxy))) + +@[simp] lemma h_self (x : Disk) : h x x = 0 := by simp [h] +@[simp] lemma logMean_zero : logMean 0 = 0 := by simp [logMean] +@[simp] lemma f_zero : f 0 = 1 / 2 := by simp [f] + +lemma complex_posSemidef_of_entrywise_tendsto {ι : Type*} [Fintype ι] + {A : ℕ → Matrix ι ι ℂ} {B : Matrix ι ι ℂ} + (hA : ∀ n, (A n).PosSemidef) + (hlim : ∀ i j, Tendsto (fun n => A n i j) atTop (𝓝 (B i j))) : B.PosSemidef := by + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg + · ext i j + have hl := (hlim j i).star + exact tendsto_nhds_unique (hl.congr fun n => (hA n).isHermitian.apply i j) (hlim i j) + · intro v + have hq : Tendsto (fun n => star v ⬝ᵥ A n *ᵥ v) atTop (𝓝 (star v ⬝ᵥ B *ᵥ v)) := by + unfold dotProduct Matrix.mulVec + exact tendsto_finsetSum _ (fun i _ => tendsto_const_nhds.mul + (tendsto_finsetSum _ fun j _ => (hlim i j).mul tendsto_const_nhds)) + exact ge_of_tendsto hq (Filter.Eventually.of_forall fun n => + (hA n).dotProduct_mulVec_nonneg v) + + +lemma szego_posSemidef {ι : Type*} [Fintype ι] (x : ι → Disk) : + (Matrix.of (fun i j => (1 - (x i : ℂ) * star (x j : ℂ))⁻¹)).PosSemidef := by + let A (n : ℕ) : Matrix ι ι ℂ := + Matrix.vecMulVec (fun i => (x i : ℂ) ^ n) (star (fun j => (x j : ℂ) ^ n)) + apply complex_posSemidef_of_entrywise_tendsto + (A := fun n => ∑ m ∈ Finset.range n, A m) + · intro n + exact Matrix.posSemidef_sum _ (fun m _ => Matrix.posSemidef_vecMulVec_self_star _) + · intro i j + have hn : ‖(x i : ℂ) * star (x j : ℂ)‖ < 1 := by + rw [norm_mul, norm_star] + exact lt_of_le_of_lt + (mul_le_mul_of_nonneg_left (x j).property.le (norm_nonneg _)) + (by simpa using (x i).property) + have hs := (hasSum_geometric_of_norm_lt_one hn).tendsto_sum_nat + simpa [A, Matrix.sum_apply, Matrix.vecMulVec, mul_pow] using hs + +lemma realPart_posSemidef {ι : Type*} [Fintype ι] {A : Matrix ι ι ℂ} + (hA : A.PosSemidef) : (Matrix.of (fun i j => (A i j).re)).PosSemidef := by + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg + · ext i j + have hh := congrArg Complex.re (hA.isHermitian.apply i j) + simpa using hh + · intro v + have hh := (Complex.nonneg_iff.mp + (hA.dotProduct_mulVec_nonneg (fun i => (v i : ℂ)))).1 + simpa [dotProduct, Matrix.mulVec, map_sum, Complex.mul_re] using hh + +lemma disk_cross_identity (x y : ℂ) : + ‖1 - x * star y‖ ^ 2 = (1 - ‖x‖ ^ 2) * (1 - ‖y‖ ^ 2) + ‖x - y‖ ^ 2 := by + simp only [Complex.sq_norm, Complex.normSq_apply, Complex.sub_re, Complex.sub_im, + Complex.mul_re, Complex.mul_im, Complex.one_re, Complex.one_im, + Complex.star_def, Complex.conj_re, Complex.conj_im] + ring + +lemma normSzego_posSemidef {ι : Type*} [Fintype ι] (x : ι → Disk) : + (Matrix.of (fun i j => (‖1 - (x i : ℂ) * star (x j : ℂ)‖ ^ 2)⁻¹)).PosSemidef := by + have hh := realPart_posSemidef ((szego_posSemidef x).hadamard + (szego_posSemidef x).transpose) + convert hh using 1 + ext i j + change _ = (((1 - (x i : ℂ) * star (x j : ℂ))⁻¹) * + (1 - (x j : ℂ) * star (x i : ℂ))⁻¹).re + rw [show 1 - (x j : ℂ) * star (x i : ℂ) = + star (1 - (x i : ℂ) * star (x j : ℂ)) by simp [mul_comm]] + rw [← star_inv₀, Complex.star_def, Complex.mul_conj] + simp only [Matrix.of_apply, Complex.ofReal_re, Complex.normSq_eq_norm_sq, norm_inv, inv_pow] + +lemma k_identity (x y : Disk) : + (1 + h x y)⁻¹ = (1 - ‖(x : ℂ)‖ ^ 2) * + (‖1 - (x : ℂ) * star (y : ℂ)‖ ^ 2)⁻¹ * (1 - ‖(y : ℂ)‖ ^ 2) := by + rw [disk_cross_identity] + unfold h + have hx := disk_weight_pos x + have hy := disk_weight_pos y + have hn := sq_nonneg ‖(x : ℂ) - y‖ + field_simp + +lemma k_posSemidef {ι : Type*} [Fintype ι] (x : ι → Disk) : + (Matrix.of (fun i j => (1 + h (x i) (x j))⁻¹)).PosSemidef := by + classical + have hh := (normSzego_posSemidef x).mul_mul_conjTranspose_same + (Matrix.diagonal (fun i => (1 - ‖(x i : ℂ)‖ ^ 2))) + convert hh using 1 + ext i j + simp [k_identity] + +end StrictHotSpots.DiskKernel + +namespace StrictHotSpots.DiskKernel + +lemma f_eq_logDefect {t : ℝ} (ht : 0 ≤ t) : + f t = ((1 + t)⁻¹)⁻¹ - 1 / 2 + (Real.log (1 - (1 + t)⁻¹))⁻¹ := by + rcases eq_or_lt_of_le ht with he | hp + · subst t + norm_num [f, logMean] + · have hh : 1 - (1 + t)⁻¹ = (1 + 1 / t)⁻¹ := by + have : 1 + t ≠ 0 := by positivity + field_simp + ring + rw [hh, Real.log_inv, inv_neg, inv_inv] + simp only [f, logMean] + ring + +lemma f_posSemidef {ι : Type*} [Fintype ι] (x : ι → Disk) : + (Matrix.of (fun i j => f (h (x i) (x j)))).PosSemidef := by + have hh := ScalarKernel.logDefect_posSemidef_le (k_posSemidef x) + (fun i j => inv_pos.mpr (by have := h_nonneg (x i) (x j); linarith)) + (fun i j => inv_le_one_of_one_le₀ (by have := h_nonneg (x i) (x j); linarith)) + simpa only [Matrix.of_apply, ← f_eq_logDefect (h_nonneg _ _)] using hh + +lemma logMean_nonneg {t : ℝ} (ht : 0 ≤ t) : 0 ≤ logMean t := by + apply inv_nonneg.mpr + exact Real.log_nonneg (by have := one_div_nonneg.mpr ht; linarith) + +lemma logMean_pos {t : ℝ} (ht : 0 < t) : 0 < logMean t := by + apply inv_pos.mpr + exact Real.log_pos (by have := one_div_pos.mpr ht; linarith) + +lemma f_nonneg {t : ℝ} (ht : 0 ≤ t) : 0 ≤ f t := by + rcases eq_or_lt_of_le ht with he | hp + · subst t; rw [f_zero]; norm_num + · have hlo := Real.le_log_one_add_of_nonneg (one_div_nonneg.mpr ht) + have hi : 2 * (1 / t) / (1 / t + 2) = (t + 1 / 2)⁻¹ := by + have : 1 / t + 2 ≠ 0 := by positivity + have : t + 1 / 2 ≠ 0 := by positivity + field_simp + ring + rw [hi] at hlo + have hbound := (inv_le_inv₀ (lt_of_lt_of_le (by positivity : 0 < (t + 1 / 2)⁻¹) hlo) + (by positivity : 0 < (t + 1 / 2)⁻¹)).mpr hlo + simpa only [inv_inv, f, logMean, sub_nonneg] using hbound + +lemma f_le_half {t : ℝ} (ht : 0 ≤ t) : f t ≤ 1 / 2 := by + rcases eq_or_lt_of_le ht with he | hp + · subst t; exact le_of_eq f_zero + · have hlo := Real.log_le_sub_one_of_pos (by positivity : 0 < 1 + 1 / t) + have hlog : 0 < Real.log (1 + 1 / t) := by + exact Real.log_pos (by have := one_div_pos.mpr hp; linarith) + have hbound := (inv_le_inv₀ (inv_pos.mpr hp) hlog).mpr + (show Real.log (1 + 1 / t) ≤ t⁻¹ by + simpa only [add_sub_cancel_left, one_div] using hlo) + simp only [inv_inv] at hbound + dsimp [f, logMean] + linarith + +end StrictHotSpots.DiskKernel + +namespace StrictHotSpots.DiskKernel + +lemma f_alt (t : ℝ) : f t = t + 1 / 2 + (Real.log (t / (1 + t)))⁻¹ := by + by_cases ht : t = 0 + · subst t + norm_num [f, logMean] + · have he : 1 + 1 / t = (t / (1 + t))⁻¹ := by + rw [inv_div] + field_simp + ring + rw [f, logMean, he, Real.log_inv, inv_neg] + ring + +lemma f_continuousAt {t : ℝ} (ht : 0 ≤ t) : ContinuousAt f t := by + rw [show f = fun t => t + 1 / 2 + (Real.log (t / (1 + t)))⁻¹ from funext f_alt] + apply (continuousAt_id.add continuousAt_const).add + have hden : 1 + t ≠ 0 := by positivity + have hquot : ContinuousAt (fun t : ℝ => t / (1 + t)) t := + continuousAt_id.div (continuousAt_const.add continuousAt_id) hden + rcases eq_or_lt_of_le ht with he | hp + · subst t + exact ScalarKernel.invLog_continuousAt_zero.comp_of_eq hquot (by simp) + · have hq : 0 < t / (1 + t) := div_pos hp (by positivity) + have hql : t / (1 + t) < 1 := (div_lt_one (by positivity)).mpr (by linarith) + exact ((Real.continuousAt_log hq.ne').comp (f := fun t : ℝ => t / (1 + t)) hquot).inv₀ + (ne_of_lt (Real.log_neg hq hql)) + +lemma h_continuous : Continuous (fun p : Disk × Disk => h p.1 p.2) := by + apply ((continuous_subtype_val.comp continuous_fst).sub + (continuous_subtype_val.comp continuous_snd)).norm.pow 2 |>.div + · exact (continuous_const.sub ((continuous_subtype_val.comp continuous_fst).norm.pow 2)).mul + (continuous_const.sub ((continuous_subtype_val.comp continuous_snd).norm.pow 2)) + · intro p + exact (mul_pos (disk_weight_pos p.1) (disk_weight_pos p.2)).ne' + +lemma regularized_denominator {ε : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) (x y : Disk) : + ε / 2 ≤ h x y + 1 / 2 - (1 - ε) * f (h x y) := by + have ht := h_nonneg x y + have hl := logMean_nonneg ht + have he : h x y + 1 / 2 - (1 - ε) * f (h x y) = + ε * (h x y + 1 / 2) + (1 - ε) * logMean (h x y) := by + dsimp [f]; ring + rw [he] + nlinarith [mul_nonneg hε.le ht, mul_nonneg (sub_nonneg.mpr hε1) hl] + +lemma regularized_pos {ε : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) (x y : Disk) : + 0 < regularized ε x y := by + apply inv_pos.mpr + exact mul_pos (mul_pos (by norm_num) Real.pi_pos) + (lt_of_lt_of_le (by positivity : 0 < ε / 2) (regularized_denominator hε hε1 x y)) + +lemma regularized_le {ε : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) (x y : Disk) : + regularized ε x y ≤ (2 * Real.pi * ε)⁻¹ := by + apply inv_anti₀ (by positivity) + have hh := mul_le_mul_of_nonneg_left (regularized_denominator hε hε1 x y) + (le_of_lt (mul_pos (by norm_num : 0 < (4 : ℝ)) Real.pi_pos)) + nlinarith + +lemma regularized_continuous {ε : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) : + Continuous (fun p : Disk × Disk => regularized ε p.1 p.2) := by + have hf : Continuous (fun p : Disk × Disk => f (h p.1 p.2)) := + continuous_iff_continuousAt.mpr fun p => + (f_continuousAt (h_nonneg p.1 p.2)).comp + (f := fun p : Disk × Disk => h p.1 p.2) h_continuous.continuousAt + apply (continuous_const.mul ((h_continuous.add continuous_const).sub + (continuous_const.mul hf))).inv₀ + intro p + exact (mul_pos (mul_pos (by norm_num) Real.pi_pos) + (lt_of_lt_of_le (by positivity : 0 < ε / 2) + (regularized_denominator hε hε1 p.1 p.2))).ne' + +lemma regularized_self (ε : ℝ) (x : Disk) : + regularized ε x x = (2 * Real.pi * ε)⁻¹ := by + rw [regularized, h_self, f_zero] + congr 1 + ring + +lemma regularized_antitone {ε δ : ℝ} (hε : 0 < ε) (hδ : ε ≤ δ) (hδ1 : δ ≤ 1) + (x y : Disk) : regularized δ x y ≤ regularized ε x y := by + apply inv_anti₀ + · exact mul_pos (mul_pos (by norm_num) Real.pi_pos) + (lt_of_lt_of_le (by positivity : 0 < ε / 2) + (regularized_denominator hε (hδ.trans hδ1) x y)) + · apply mul_le_mul_of_nonneg_left _ (by positivity : 0 ≤ 4 * Real.pi) + nlinarith [mul_nonneg (sub_nonneg.mpr hδ) (f_nonneg (h_nonneg x y))] + +lemma regularized_tendsto_offDiagonal {x y : Disk} (hxy : x ≠ y) : + Tendsto (fun ε : ℝ => regularized ε x y) (𝓝 0) (𝓝 (green x y)) := by + have hl := logMean_pos (h_pos hxy) + have hh : ContinuousAt (fun ε : ℝ => regularized ε x y) 0 := by + apply (continuousAt_const.mul (continuousAt_const.sub + ((continuousAt_const.sub continuousAt_id).mul continuousAt_const))).inv₀ + have he : h x y + 1 / 2 - (1 - (0 : ℝ)) * f (h x y) = logMean (h x y) := by + dsimp [f]; ring + change 4 * Real.pi * (h x y + 1 / 2 - (1 - (0 : ℝ)) * f (h x y)) ≠ 0 + rw [he] + positivity + convert hh.tendsto using 1 + congr 1 + dsimp [regularized, f, logMean, green] + rw [show h x y + 1 / 2 - (1 - (0 : ℝ)) * + (h x y + 1 / 2 - (Real.log (1 + 1 / h x y))⁻¹) = + (Real.log (1 + 1 / h x y))⁻¹ by ring] + simp only [_root_.mul_inv_rev, inv_inv] + ring + +end StrictHotSpots.DiskKernel + + + + +namespace ReciprocalKernel +open Matrix +variable {ι : Type*} [Fintype ι] + +lemma onePositiveSquare_smul {A : Matrix ι ι ℝ} (hA : OnePositiveSquare A) + {a : ℝ} (ha : 0 < a) : OnePositiveSquare (a • A) := by + have he (x y : ι → ℝ) : pairing (a • A) x y = a * pairing A x y := by + simp [pairing, Matrix.smul_mulVec, dotProduct_smul] + refine ⟨?_, ?_⟩ + · ext i j + simpa only [Matrix.transpose_apply, Matrix.smul_apply, smul_eq_mul] using + congrArg (a * ·) (hA.1.apply i j) + · intro x y hx hxy + rw [he] at hx hxy ⊢ + exact mul_nonpos_of_nonneg_of_nonpos ha.le + (hA.2 x y ((mul_pos_iff_of_pos_left ha).mp hx) + ((mul_eq_zero.mp hxy).resolve_left ha.ne')) + +end ReciprocalKernel + +namespace StrictHotSpots.DiskKernel +open ReciprocalKernel + +lemma lorentz_identity (x y : Disk) : + (1 - ‖(x : ℂ)‖ ^ 2) * (h x y + 1 / 2) * (1 - ‖(y : ℂ)‖ ^ 2) = + (1 / 2) * (1 + ‖(x : ℂ)‖ ^ 2) * (1 + ‖(y : ℂ)‖ ^ 2) - + 2 * ((x : ℂ) * star (y : ℂ)).re := by + have hx := (disk_weight_pos x).ne' + have hy := (disk_weight_pos y).ne' + dsimp [h] + field_simp + simp only [Complex.sq_norm, Complex.normSq_apply, Complex.sub_re, Complex.sub_im, + Complex.mul_re, Complex.conj_re, Complex.conj_im] + ring + +lemma regularized_reciprocal_onePositiveSquare {ι : Type*} [Fintype ι] + (x : ι → Disk) {ε : ℝ} (hε1 : ε ≤ 1) : + OnePositiveSquare (Matrix.of (fun i j => (regularized ε (x i) (x j))⁻¹)) := by + classical + let w : ι → ℝ := fun i => 1 - ‖(x i : ℂ)‖ ^ 2 + let v : ι → ℝ := fun i => Real.sqrt (1 / 2) * (1 + ‖(x i : ℂ)‖ ^ 2) + let G : Matrix ι ι ℝ := Matrix.of fun i j => ((x i : ℂ) * star (x j : ℂ)).re + let F : Matrix ι ι ℝ := Matrix.of fun i j => f (h (x i) (x j)) + have hG : G.PosSemidef := realPart_posSemidef + (Matrix.posSemidef_vecMulVec_self_star (fun i => (x i : ℂ))) + have hF : (Matrix.diagonal w * F * (Matrix.diagonal w).conjTranspose).PosSemidef := + (f_posSemidef x).mul_mul_conjTranspose_same _ + have hU := (hG.smul (by norm_num : 0 ≤ (2 : ℝ))).add (hF.smul (sub_nonneg.mpr hε1)) + have hP := onePositiveSquare_rankOne_sub_psd v hU + have hsqrt : Real.sqrt (1 / 2) * Real.sqrt (1 / 2) = (1 / 2 : ℝ) := + Real.mul_self_sqrt (by norm_num) + have hn : Matrix.vecMulVec v v - ((2 : ℝ) • G + (1 - ε) • + (Matrix.diagonal w * F * (Matrix.diagonal w).conjTranspose)) = + Matrix.of (fun i j => w i * + (h (x i) (x j) + 1 / 2 - (1 - ε) * f (h (x i) (x j))) * w j) := by + ext i j + simp only [Matrix.sub_apply, Matrix.vecMulVec_apply, Matrix.add_apply, + Matrix.smul_apply, smul_eq_mul, Matrix.diagonal_conjTranspose, + star_trivial, Matrix.diagonal_mul, Matrix.mul_diagonal, Matrix.of_apply] + dsimp [v, G, F] + have hv : Real.sqrt (1 / 2) * (1 + ‖(x i : ℂ)‖ ^ 2) * + (Real.sqrt (1 / 2) * (1 + ‖(x j : ℂ)‖ ^ 2)) = + (1 / 2) * (1 + ‖(x i : ℂ)‖ ^ 2) * (1 + ‖(x j : ℂ)‖ ^ 2) := by + calc + _ = (Real.sqrt (1 / 2) * Real.sqrt (1 / 2)) * + (1 + ‖(x i : ℂ)‖ ^ 2) * (1 + ‖(x j : ℂ)‖ ^ 2) := by ring + _ = _ := by rw [hsqrt] + rw [hv] + have hh := lorentz_identity (x i) (x j) + dsimp [w] + simp only [starRingEnd_apply] + rw [sub_add_eq_sub_sub, ← hh] + ring + rw [hn] at hP + have hres := onePositiveSquare_smul (onePositiveSquare_scale hP (fun i => (w i)⁻¹)) + (mul_pos (by norm_num : 0 < (4 : ℝ)) Real.pi_pos) + convert hres using 1 + ext i j + simp only [Matrix.of_apply, Matrix.smul_apply, smul_eq_mul, regularized, inv_inv] + have hi := (disk_weight_pos (x i)).ne' + have hj := (disk_weight_pos (x j)).ne' + dsimp [w] + field_simp + +end StrictHotSpots.DiskKernel + +namespace StrictHotSpots.DiskKernel + +lemma regularized_zero (x y : Disk) : regularized 0 x y = green x y := by + dsimp [regularized, green, f, logMean] + rw [show h x y + 1 / 2 - (1 - (0 : ℝ)) * + (h x y + 1 / 2 - (Real.log (1 + 1 / h x y))⁻¹) = + (Real.log (1 + 1 / h x y))⁻¹ by ring] + simp only [_root_.mul_inv_rev, inv_inv] + ring + +lemma regularized_le_green {ε : ℝ} (hε : 0 ≤ ε) {x y : Disk} (hxy : x ≠ y) : + regularized ε x y ≤ green x y := by + rw [← regularized_zero] + apply inv_anti₀ + · have hh := logMean_pos (h_pos hxy) + have he : h x y + 1 / 2 - (1 - (0 : ℝ)) * f (h x y) = logMean (h x y) := by + dsimp [f]; ring + rw [he] + positivity + · apply mul_le_mul_of_nonneg_left _ (by positivity : 0 ≤ 4 * Real.pi) + nlinarith [mul_nonneg hε (f_nonneg (h_nonneg x y))] + +lemma regularized_tendsto_diagonal (x : Disk) : + Tendsto (fun ε : ℝ => regularized ε x x) (𝓝[>] 0) atTop := by + simp only [regularized_self] + have hh := tendsto_inv_nhdsGT_zero.const_mul_atTop + (by positivity : 0 < (2 * Real.pi)⁻¹) + simpa only [_root_.mul_inv_rev, mul_comm] using hh + + +lemma regularized_tendsto (x y : Disk) : + Tendsto (fun ε : ℝ => ENNReal.ofReal (regularized ε x y)) + (𝓝[>] 0) (𝓝 (greenExtended x y)) := by + by_cases hxy : x = y + · subst y + simpa [greenExtended, Function.comp_def] using + ENNReal.tendsto_ofReal_atTop.comp (regularized_tendsto_diagonal x) + · simpa only [greenExtended, ite_eq_right hxy, Function.comp_def] using + (ENNReal.continuous_ofReal.tendsto (green x y)).comp + ((regularized_tendsto_offDiagonal hxy).mono_left nhdsWithin_le_nhds) + + +theorem bounded_green_regularization : + ∃ C : ℝ → Disk → Disk → ℝ, + (∀ ε ∈ Set.Ioc (0 : ℝ) 1, + Continuous (fun p : Disk × Disk => C ε p.1 p.2) ∧ + (∀ x y, 0 < C ε x y ∧ C ε x y ≤ (2 * Real.pi * ε)⁻¹) ∧ + (∀ {ι : Type} [Fintype ι] (x : ι → Disk), + ReciprocalKernel.OnePositiveSquare (Matrix.of (fun i j => (C ε (x i) (x j))⁻¹)))) ∧ + (∀ ε δ, 0 < ε → ε ≤ δ → δ ≤ 1 → ∀ x y, C δ x y ≤ C ε x y) ∧ + (∀ x y, Tendsto (fun ε => ENNReal.ofReal (C ε x y)) + (𝓝[>] 0) (𝓝 (greenExtended x y))) := by + refine ⟨regularized, ?_, ?_, regularized_tendsto⟩ + · intro ε hε + exact ⟨regularized_continuous hε.1 hε.2, + fun x y => ⟨regularized_pos hε.1 hε.2 x y, regularized_le hε.1 hε.2 x y⟩, + fun {_} [_] x => regularized_reciprocal_onePositiveSquare x hε.2⟩ + · intro ε δ hε hεδ hδ + exact regularized_antitone hε hεδ hδ + +end StrictHotSpots.DiskKernel +end DiskFiniteLayer + + +end FullBoundaryCombinedLayer + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Douglas.lean b/lean/OAI/Analysis/HotSpots/Douglas.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c1cc1ca2f805a63765a9317a75144439939c511 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Douglas.lean @@ -0,0 +1,1512 @@ +import OAI.Analysis.HotSpots.Basic + +namespace OAI + +section DouglasLipschitzBase + +noncomputable section + +section DouglasMonomialCombinedLayer +open Set MeasureTheory AddCircle +open scoped InnerProductSpace +namespace StrictHotSpots.Douglas +variable {T : ℝ} [hT : Fact (0 < T)] + +instance haar_nullSingleton : NullSingletonClass (@haarAddCircle T hT) := by + constructor + intro t + have hv : (volume : Measure (AddCircle T)) {t} = 0 := by + simpa only [Metric.closedBall_zero,mul_zero,min_eq_right hT.out.le,ENNReal.ofReal_zero] + using (AddCircle.volume_closedBall T (x := t) 0) + rw [volume_eq_smul_haarAddCircle,Measure.smul_apply,smul_eq_mul] at hv + exact (mul_eq_zero.mp hv).resolve_left (ENNReal.ofReal_pos.mpr hT.out).ne' + + +def polynomial (n : ℕ) (a : ℕ → ℂ) : C(AddCircle T, ℂ) := + ∑ k ∈ Finset.range n, a k • fourier (k : ℤ) + +omit hT in +lemma polynomial_apply (n : ℕ) (a : ℕ → ℂ) (s : AddCircle T) : + polynomial n a s = ∑ k ∈ Finset.range n, a k * fourier (k : ℤ) s := by + simp [polynomial,ContinuousMap.sum_apply] + +lemma integral_norm_sq_polynomial (n : ℕ) (a : ℕ → ℂ) : + (∫ s : AddCircle T, ‖polynomial n a s‖^2 ∂haarAddCircle) = + ∑ k ∈ Finset.range n, ‖a k‖^2 := by + have ho := (orthonormal_fourier (T := T)).comp (fun n : ℕ => (n : ℤ)) + Int.ofNat_injective + have he := ho.inner_sum a a (Finset.range n) + have he' : inner ℂ ((ContinuousMap.toLp 2 (@haarAddCircle T hT) ℂ) (polynomial n a)) + ((ContinuousMap.toLp 2 (@haarAddCircle T hT) ℂ) (polynomial n a)) = + ∑ k ∈ Finset.range n, star (a k) * a k := by + simpa only [polynomial,map_sum,map_smul,Function.comp_apply,RCLike.star_def] + using he + rw [ContinuousMap.inner_toLp] at he' + have hi : Integrable (fun s : AddCircle T => + polynomial n a s * star (polynomial n a s)) haarAddCircle := by + exact ((polynomial (T:=T) n a).memLp haarAddCircle ℂ (p:=2)).integrable_mul + ((polynomial (T:=T) n a).memLp haarAddCircle ℂ (p:=2)).star + have hr := congrArg Complex.re he' + have hir : (∫ s : AddCircle T, polynomial n a s * + (starRingEnd ℂ) (polynomial n a s) ∂haarAddCircle).re = + ∫ s : AddCircle T, (polynomial n a s * + (starRingEnd ℂ) (polynomial n a s)).re ∂haarAddCircle := (integral_re hi).symm + rw [hir] at hr + simpa only [RCLike.star_def,Complex.re_sum,Complex.mul_re,Complex.conj_re,Complex.conj_im, + mul_neg,neg_mul,sub_neg_eq_add,← Complex.normSq_eq_norm_sq,Complex.normSq_apply] using hr + +omit hT in +lemma fourier_nat (n : ℕ) (s : AddCircle T) : + fourier (n : ℤ) s = (s.toCircle : ℂ)^n := by + induction n with + | zero => simp + | succ n ih => rw [Nat.cast_add,Nat.cast_one,fourier_add,ih,fourier_one,pow_succ] + +omit hT in +lemma polynomial_geom (n : ℕ) (s t : AddCircle T) : + polynomial n (fun k => (t.toCircle : ℂ)^(n-1-k)) s = + ∑ k ∈ Finset.range n, (s.toCircle : ℂ)^k * (t.toCircle : ℂ)^(n-1-k) := by + rw [polynomial_apply] + apply Finset.sum_congr rfl + intro k _ + rw [fourier_nat,mul_comm] + +lemma normalized_monomial_quotient (n : ℕ) (t : AddCircle T) : + (∫ s : AddCircle T, + ‖((s.toCircle : ℂ)^n-(t.toCircle : ℂ)^n) / + ((s.toCircle : ℂ)-(t.toCircle : ℂ))‖^2 ∂haarAddCircle) = (n : ℝ) := by + have hnull : ∀ᵐ s : AddCircle T ∂haarAddCircle, s ≠ t := by + simp only [ae_iff, not_not, measure_singleton, Set.ofPred_eq_eq_singleton] + have he : (fun s : AddCircle T => + ‖((s.toCircle : ℂ)^n-(t.toCircle : ℂ)^n) / + ((s.toCircle : ℂ)-(t.toCircle : ℂ))‖^2) =ᵐ[haarAddCircle] + (fun s => ‖polynomial n (fun k => (t.toCircle : ℂ)^(n-1-k)) s‖^2) := by + filter_upwards [hnull] with s hs + have hne : (s.toCircle : ℂ)-(t.toCircle : ℂ) ≠ 0 := by + intro hz + apply hs + exact injective_toCircle hT.out.ne' (Subtype.ext (sub_eq_zero.mp hz)) + rw [polynomial_geom,← geom_sum₂_mul _ _ n,mul_div_cancel_right₀ _ hne] + rw [integral_congr_ae he,integral_norm_sq_polynomial] + simp [norm_pow,Circle.norm_coe] + + + +theorem monomial_double_integral (n : ℕ) : + (∫ t : AddCircle T, ∫ s : AddCircle T, + ‖((s.toCircle : ℂ)^n-(t.toCircle : ℂ)^n) / + ((s.toCircle : ℂ)-(t.toCircle : ℂ))‖^2) = T^2 * (n : ℝ) := by + rw [volume_eq_smul_haarAddCircle] + simp_rw [integral_smul_measure,ENNReal.toReal_ofReal hT.out.le,smul_eq_mul, + normalized_monomial_quotient] + simp [pow_two,mul_assoc] + +end StrictHotSpots.Douglas +end DouglasMonomialCombinedLayer + +section LipschitzBoundaryEnergyCombinedLayer +open Set Filter MeasureTheory AddCircle +open scoped Topology +namespace StrictHotSpots.Douglas +variable {T : ℝ} [hT : Fact (0 < T)] + + +def boundaryDifference (h : AddCircle T → ℂ) (p : AddCircle T × AddCircle T) : ℂ := + (h p.1-h p.2) / ((p.1.toCircle : ℂ)-(p.2.toCircle : ℂ)) + + +def ChordLipschitz (K : ℝ) (h : AddCircle T → ℂ) : Prop := + ∀ s t, ‖h s-h t‖ ≤ K*‖(s.toCircle : ℂ)-(t.toCircle : ℂ)‖ + +omit hT in +lemma boundaryDifference_bound {K : ℝ} (hK : 0 ≤ K) {h : AddCircle T → ℂ} + (hh : ChordLipschitz K h) (p : AddCircle T × AddCircle T) : + ‖boundaryDifference h p‖ ≤ K := by + rw [boundaryDifference,norm_div] + by_cases hz : (p.1.toCircle : ℂ)-(p.2.toCircle : ℂ) = 0 + · simpa only [hz,norm_zero,div_zero] using hK + · exact (div_le_iff₀ (norm_pos_iff.mpr hz)).mpr (hh p.1 p.2) + +omit hT in +lemma measurable_boundaryDifference {h : AddCircle T → ℂ} (hh : Continuous h) : + Measurable (boundaryDifference h) := by + apply Measurable.div + · exact (hh.measurable.comp measurable_fst).sub (hh.measurable.comp measurable_snd) + · exact ((continuous_subtype_val.comp continuous_toCircle).measurable.comp measurable_fst).sub + ((continuous_subtype_val.comp continuous_toCircle).measurable.comp measurable_snd) + +lemma integrable_boundaryDifference_sq {K : ℝ} (hK : 0 ≤ K) + {h : AddCircle T → ℂ} (hc : Continuous h) (hh : ChordLipschitz K h) : + Integrable (fun p => ‖boundaryDifference h p‖^2) := by + refine (integrable_const (K^2)).mono' + ((measurable_boundaryDifference hc).norm.pow_const 2).aestronglyMeasurable ?_ + exact ae_of_all _ fun p => by + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (norm_nonneg _) (boundaryDifference_bound hK hh p) 2 + + +def boundaryEnergy (h : AddCircle T → ℂ) : ℝ := + ∫ p : AddCircle T × AddCircle T, ‖boundaryDifference h p‖^2 + + + +theorem boundaryEnergy_tendsto {K : ℝ} (hK : 0 ≤ K) + {h : AddCircle T → ℂ} {f : ℕ → AddCircle T → ℂ} + (hc : ∀ n, Continuous (f n)) (hf : ∀ n, ChordLipschitz K (f n)) + (hl : ∀ s, Tendsto (fun n => f n s) atTop (𝓝 (h s))) : + Tendsto (fun n => boundaryEnergy (f n)) atTop (𝓝 (boundaryEnergy h)) := by + apply tendsto_integral_of_dominated_convergence (fun _ : AddCircle T × AddCircle T => K^2) + · exact fun n => ((measurable_boundaryDifference (hc n)).norm.pow_const 2).aestronglyMeasurable + · exact integrable_const _ + · intro n + exact ae_of_all _ fun p => by + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (norm_nonneg _) (boundaryDifference_bound hK (hf n) p) 2 + · exact ae_of_all _ fun p => (((hl p.1).sub (hl p.2)).div_const _).norm.pow 2 + +end StrictHotSpots.Douglas +end LipschitzBoundaryEnergyCombinedLayer + +section BoundaryFourierCrossCombinedLayer +open Set MeasureTheory AddCircle +open scoped ComplexConjugate +namespace StrictHotSpots.Douglas +variable {T : ℝ} [hT : Fact (0 < T)] + +omit hT in +lemma fourier_shift (m : ℤ) (s r : AddCircle T) : + fourier m (s+r) = fourier m s * fourier m r := by + simp only [fourier_apply,smul_add,toCircle_add,Circle.coe_mul] + + +def boundaryModeCross (m n : ℤ) (p : AddCircle T × AddCircle T) : ℂ := + ((fourier m p.1-fourier m p.2)*conj (fourier n p.1-fourier n p.2)) / + ((‖(p.1.toCircle : ℂ)-(p.2.toCircle : ℂ)‖^2 : ℝ) : ℂ) + +omit hT in +lemma boundaryModeCross_shift (m n : ℤ) (p : AddCircle T × AddCircle T) + (r : AddCircle T) : + boundaryModeCross m n (p+(r,r)) = boundaryModeCross m n p * fourier (m-n) r := by + rw [show m-n = m+(-n) by rfl,fourier_add,fourier_neg] + simp only [boundaryModeCross,Prod.fst_add,Prod.snd_add,fourier_shift,toCircle_add, + Circle.coe_mul] + rw [← sub_mul,← sub_mul,← sub_mul] + simp only [norm_mul,Circle.norm_coe,mul_one,map_mul] + ring + + +theorem boundaryModeCross_integral_zero {m n : ℤ} (hmn : m ≠ n) : + (∫ p : AddCircle T × AddCircle T, boundaryModeCross m n p) = 0 := by + let r : AddCircle T := (T/2/(m-n) : ℝ) + have hf : fourier (m-n) r = -1 := by + simpa only [zero_add,fourier_eval_zero,Int.cast_sub,r] using + fourier_add_half_inv_index (sub_ne_zero.mpr hmn) hT.out (0 : AddCircle T) + let : (volume : Measure (AddCircle T × AddCircle T)).IsAddRightInvariant := ⟨fun g => + ((measurePreserving_add_right (volume : Measure (AddCircle T)) g.1).prod + (measurePreserving_add_right (volume : Measure (AddCircle T)) g.2)).map_eq⟩ + apply integral_eq_zero_of_add_right_eq_neg (g := (r,r)) + intro p + rw [boundaryModeCross_shift,hf,mul_neg_one] + +end StrictHotSpots.Douglas +end BoundaryFourierCrossCombinedLayer + +section DouglasBulkModeCombinedLayer +open Set MeasureTheory Metric +open scoped Topology +namespace StrictHotSpots.Douglas + +lemma integral_disk_norm_pow (n : ℕ) : + (∫ z : ℂ in ball 0 1, ‖z‖^n) = (2*Real.pi)/(n+2) := by + classical + let f : ℂ → ℝ := (ball 0 1).indicator (fun z => ‖z‖^n) + have h1 : (∫ z : ℂ in ball 0 1, ‖z‖^n) = + ∫ p in polarCoord.target, p.1 * f (Complex.polarCoord.symm p) := by + rw [← integral_indicator measurableSet_ball] + exact (Complex.integral_comp_polarCoord_symm f).symm + rw [h1] + have he : polarCoord.target.indicator + (fun p : ℝ × ℝ => p.1 * f (Complex.polarCoord.symm p)) = + ((Ioo (0:ℝ) 1) ×ˢ (Ioo (-Real.pi) Real.pi)).indicator + (fun p => p.1^(n+1)) := by + funext p + have hf : f (Complex.polarCoord.symm p) = + if |p.1| < 1 then |p.1|^n else 0 := by + change (if Complex.polarCoord.symm p ∈ ball (0:ℂ) 1 then + ‖Complex.polarCoord.symm p‖^n else 0) = _ + rw [mem_ball_zero_iff,Complex.norm_polarCoord_symm] + by_cases hr : 0 < p.1 + · by_cases ht : -Real.pi < p.2 ∧ p.2 < Real.pi + · by_cases hR : p.1 < 1 <;> + simp only [Set.indicator_apply,polarCoord_target,mem_prod,mem_Ioi,mem_Ioo, + hr,ht,hR,and_self,ite_true,ite_false,hf,abs_of_pos hr,mul_zero, + pow_succ,mul_comm,false_and,and_false] + · simp only [Set.indicator_apply,polarCoord_target,mem_prod,mem_Ioi,mem_Ioo, + hr,ht,and_false,ite_false] + · simp [polarCoord_target,hr] + rw [← integral_indicator polarCoord.open_target.measurableSet,he, + integral_indicator (measurableSet_Ioo.prod measurableSet_Ioo)] + have hi : (∫ r : ℝ in Ioo 0 1, r^(n+1)) = 1/(n+2) := by + rw [← integral_Ioc_eq_integral_Ioo,← intervalIntegral.integral_of_le (by norm_num : (0:ℝ) ≤ 1), + integral_pow] + simp [add_assoc] + norm_num + have hp := setIntegral_prod_mul (fun r : ℝ => r^(n+1)) (fun _ : ℝ => (1:ℝ)) + (Ioo 0 1) (Ioo (-Real.pi) Real.pi) (μ:=volume) (ν:=volume) + simp only [mul_one] at hp + rw [Measure.volume_eq_prod ℝ ℝ,hp,hi] + have hpos : 0 ≤ Real.pi - -Real.pi := by linarith [Real.pi_pos] + simp only [integral_const,Measure.real,Measure.restrict_apply_univ,Real.volume_Ioo,ENNReal.toReal_ofReal hpos, + smul_eq_mul,mul_one] + ring + + + +lemma holomorphic_mode_energy (n : ℕ) : + (∫ z : ℂ in ball 0 1, 2 * ‖((n+1 : ℕ) : ℂ) * z^n‖^2) = + 2*Real.pi*(n+1) := by + simp_rw [norm_mul,Complex.norm_natCast,norm_pow,mul_pow,← pow_mul] + rw [integral_const_mul,integral_const_mul,integral_disk_norm_pow] + push_cast + field_simp + +end StrictHotSpots.Douglas +end DouglasBulkModeCombinedLayer + +section DouglasModesCombinedLayer +open Set MeasureTheory Metric AddCircle InnerProductSpace +open scoped ComplexConjugate +namespace StrictHotSpots.Douglas + +local instance twoPiPos : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ + + +def harmonicMode : ℤ → ℂ → ℂ + | .ofNat n, z => z^n + | .negSucc n, z => conj (z^(n+1)) + +lemma harmonicMode_boundary {T : ℝ} (m : ℤ) (s : AddCircle T) : + harmonicMode m s.toCircle = fourier m s := by + cases m with + | ofNat n => exact (fourier_nat n s).symm + | negSucc n => + change conj ((s.toCircle : ℂ)^(n+1)) = fourier (-(↑(n+1) : ℤ)) s + rw [fourier_neg,fourier_nat] + +lemma harmonicMode_harmonic (m : ℤ) (z : ℂ) : HarmonicAt (harmonicMode m) z := by + cases m with + | ofNat n => exact (analyticAt_id.pow n).harmonicAt + | negSucc n => exact (analyticAt_id.pow (n+1)).harmonicAt_conj + +lemma harmonicMode_continuous (m : ℤ) : Continuous (harmonicMode m) := by + cases m with + | ofNat n => + change Continuous (fun z : ℂ => z^n) + fun_prop + | negSucc n => + change Continuous (fun z : ℂ => conj (z^(n+1))) + fun_prop + +lemma harmonicMode_poisson (m : ℤ) {z : ℂ} (hz : z ∈ ball 0 1) : + Real.circleAverage (poissonKernel 0 z • harmonicMode m) 0 1 = + harmonicMode m z := by + have hk : ContinuousOn (poissonKernel 0 z) (sphere 0 1) := by + unfold poissonKernel + refine ContinuousOn.div (by fun_prop) (by fun_prop) ?_ + intro w hw + simp only [sub_zero] + apply pow_ne_zero + apply norm_ne_zero_iff.mpr + apply sub_ne_zero.mpr + intro he + have hw' : ‖w‖ = 1 := mem_sphere_zero_iff_norm.mp hw + have hz' : ‖z‖ < 1 := mem_ball_zero_iff.mp hz + rw [he] at hw' + linarith + have hci : CircleIntegrable (poissonKernel 0 z • harmonicMode m) 0 1 := + (hk.smul (harmonicMode_continuous m).continuousOn).circleIntegrable (by norm_num) + have hr : HarmonicOnNhd (Complex.reCLM ∘ harmonicMode m) (closedBall 0 1) := + fun w _ => (harmonicMode_harmonic m w).comp_CLM Complex.reCLM + have hi : HarmonicOnNhd (Complex.imCLM ∘ harmonicMode m) (closedBall 0 1) := + fun w _ => (harmonicMode_harmonic m w).comp_CLM Complex.imCLM + apply Complex.ext + · have h := hr.circleAverage_poissonKernel_smul hz + change Complex.reCLM (Real.circleAverage _ _ _) = _ + rw [← Complex.reCLM.circleAverage_comp_comm hci] + have he : Complex.reCLM ∘ (poissonKernel 0 z • harmonicMode m) = + poissonKernel 0 z • (Complex.reCLM ∘ harmonicMode m) := by + funext w + exact map_smul Complex.reCLM (poissonKernel 0 z w) (harmonicMode m w) + rw [he] + exact h + · have h := hi.circleAverage_poissonKernel_smul hz + change Complex.imCLM (Real.circleAverage _ _ _) = _ + rw [← Complex.imCLM.circleAverage_comp_comm hci] + have he : Complex.imCLM ∘ (poissonKernel 0 z • harmonicMode m) = + poissonKernel 0 z • (Complex.imCLM ∘ harmonicMode m) := by + funext w + exact map_smul Complex.imCLM (poissonKernel 0 z w) (harmonicMode m w) + rw [he] + exact h + +lemma fderiv_pow_mode (n : ℕ) (z e : ℂ) : + fderiv ℝ (fun w : ℂ => w^(n+1)) z e = e * ((n+1 : ℕ) * z^n) := by + have h := (hasDerivAt_pow (n+1) z).hasFDerivAt.restrictScalars ℝ + simpa using congrArg (fun L : ℂ →L[ℝ] ℂ => L e) h.fderiv + +lemma fderiv_conj_mode (n : ℕ) (z e : ℂ) : + fderiv ℝ (fun w : ℂ => conj (w^(n+1))) z e = + conj (e * ((n+1 : ℕ) * z^n)) := by + have h := (hasDerivAt_pow (n+1) z).hasFDerivAt.restrictScalars ℝ + have hc := Complex.conjCLE.toContinuousLinearMap.hasFDerivAt.comp z h + have he := congrArg (fun L : ℂ →L[ℝ] ℂ => L e) hc.fderiv + change fderiv ℝ (fun w : ℂ => conj (w^(n+1))) z e = + conj (e * ((n+1 : ℕ) * z^(n+1-1))) at he + simpa only [Nat.add_sub_cancel] using he + + + +theorem harmonicMode_energy (m : ℤ) : + (∫ z : ℂ in ball 0 1, + ‖fderiv ℝ (harmonicMode m) z 1‖^2 + ‖fderiv ℝ (harmonicMode m) z Complex.I‖^2) = + 2*Real.pi*(m.natAbs : ℝ) := by + cases m with + | ofNat n => + cases n with + | zero => + change (∫ z : ℂ in ball 0 1, + ‖fderiv ℝ (fun _ : ℂ => (1:ℂ)) z 1‖^2 + + ‖fderiv ℝ (fun _ : ℂ => (1:ℂ)) z Complex.I‖^2) = _ + simp + | succ n => + change (∫ z : ℂ in ball 0 1, + ‖fderiv ℝ (fun w : ℂ => w^(n+1)) z 1‖^2 + + ‖fderiv ℝ (fun w : ℂ => w^(n+1)) z Complex.I‖^2) = _ + simp_rw [fderiv_pow_mode,one_mul,norm_mul,Complex.norm_I,one_mul,← two_mul] + change _ = 2*Real.pi*((n+1 : ℕ) : ℝ) + simpa only [norm_mul,Nat.cast_add,Nat.cast_one] using holomorphic_mode_energy n + | negSucc n => + change (∫ z : ℂ in ball 0 1, + ‖fderiv ℝ (fun w : ℂ => conj (w^(n+1))) z 1‖^2 + + ‖fderiv ℝ (fun w : ℂ => conj (w^(n+1))) z Complex.I‖^2) = _ + simp_rw [fderiv_conj_mode,Complex.norm_conj,one_mul,norm_mul,Complex.norm_I, + one_mul,← two_mul] + simpa only [norm_mul,Int.natAbs_negSucc,Nat.cast_add,Nat.cast_one,Nat.succ_eq_add_one] + using holomorphic_mode_energy n + + +theorem fourier_double_integral {T : ℝ} [Fact (0 < T)] (m : ℤ) : + (∫ t : AddCircle T, ∫ s : AddCircle T, + ‖(fourier m s-fourier m t) / ((s.toCircle : ℂ)-(t.toCircle : ℂ))‖^2) = + T^2 * (m.natAbs : ℝ) := by + cases m with + | ofNat n => + have h := monomial_double_integral (T:=T) n + simp_rw [← fourier_nat] at h + exact h + | negSucc n => + change (∫ t : AddCircle T, ∫ s : AddCircle T, + ‖(fourier (-(↑(n+1) : ℤ)) s-fourier (-(↑(n+1) : ℤ)) t) / + ((s.toCircle : ℂ)-(t.toCircle : ℂ))‖^2) = _ + simp_rw [fourier_neg,← map_sub,norm_div,Complex.norm_conj,← norm_div,fourier_nat] + exact monomial_double_integral (n+1) + + +theorem douglas_for_mode (m : ℤ) : + (∫ z : ℂ in ball 0 1, + ‖fderiv ℝ (harmonicMode m) z 1‖^2 + ‖fderiv ℝ (harmonicMode m) z Complex.I‖^2) = + (1/(2*Real.pi)) * + (∫ t : AddCircle (2*Real.pi), ∫ s : AddCircle (2*Real.pi), + ‖(fourier m s-fourier m t) / ((s.toCircle : ℂ)-(t.toCircle : ℂ))‖^2) := by + rw [harmonicMode_energy,fourier_double_integral] + field_simp + +end StrictHotSpots.Douglas +end DouglasModesCombinedLayer + +section BoundaryFourierIntegrableCombinedLayer +open Set Filter MeasureTheory AddCircle +open scoped ComplexConjugate +namespace StrictHotSpots.Douglas +variable {T : ℝ} [hT : Fact (0 < T)] + +lemma norm_pow_sub_pow_of_unit {a b : ℂ} (ha : ‖a‖=1) (hb : ‖b‖=1) (n : ℕ) : + ‖a^n-b^n‖ ≤ (n:ℝ)*‖a-b‖ := by + induction n with + | zero => simp + | succ n ih => + have he : a^(n+1)-b^(n+1)=a^n*(a-b)+(a^n-b^n)*b := by ring + rw [he] + calc + _ ≤ ‖a^n*(a-b)‖+‖(a^n-b^n)*b‖ := norm_add_le _ _ + _ = ‖a-b‖+‖a^n-b^n‖ := by rw [norm_mul,norm_mul,norm_pow,ha,hb]; simp + _ ≤ ‖a-b‖+(n:ℝ)*‖a-b‖ := add_le_add_right ih _ + _ = ((n+1:ℕ):ℝ)*‖a-b‖ := by push_cast; ring + +omit hT in +lemma chordLipschitz_fourier (m : ℤ) : ChordLipschitz (m.natAbs:ℝ) (@fourier T m) := by + intro s t + cases m with + | ofNat n => + change ‖fourier (n:ℤ) s-fourier (n:ℤ) t‖ ≤ (n:ℝ)*_ + rw [fourier_nat,fourier_nat] + exact norm_pow_sub_pow_of_unit (Circle.norm_coe _) (Circle.norm_coe _) n + | negSucc n => + change ‖fourier (-(↑(n+1) : ℤ)) s-fourier (-(↑(n+1) : ℤ)) t‖ ≤ _ + rw [fourier_neg,fourier_neg,← map_sub,Complex.norm_conj,fourier_nat,fourier_nat] + exact norm_pow_sub_pow_of_unit (Circle.norm_coe _) (Circle.norm_coe _) (n+1) + +omit hT in +lemma boundaryModeCross_eq (m n : ℤ) (p : AddCircle T × AddCircle T) : + boundaryModeCross m n p = + boundaryDifference (fourier m) p * conj (boundaryDifference (fourier n) p) := by + simp only [boundaryModeCross,boundaryDifference,map_div₀,div_mul_div_comm, + Complex.mul_conj,Complex.normSq_eq_norm_sq] + +lemma integrable_boundaryModeCross (m n : ℤ) : + Integrable (boundaryModeCross (T:=T) m n) := by + have he : boundaryModeCross (T:=T) m n = fun p => + boundaryDifference (fourier m) p * conj (boundaryDifference (fourier n) p) := by + funext p; exact boundaryModeCross_eq m n p + rw [he] + refine (integrable_const ((m.natAbs:ℝ)*(n.natAbs:ℝ))).mono' ?_ ?_ + · exact ((measurable_boundaryDifference (fourier m).continuous).mul + ((Complex.continuous_conj.measurable).comp + (measurable_boundaryDifference (fourier n).continuous))).aestronglyMeasurable + · exact ae_of_all _ fun p => by + rw [norm_mul,Complex.norm_conj] + exact mul_le_mul (boundaryDifference_bound (by positivity) (chordLipschitz_fourier m) p) + (boundaryDifference_bound (by positivity) (chordLipschitz_fourier n) p) + (norm_nonneg _) (by positivity) + +lemma boundaryDifference_sq_integral (m : ℤ) : + (∫ p : AddCircle T × AddCircle T, ‖boundaryDifference (fourier m) p‖^2) = + T^2*(m.natAbs:ℝ) := by + have hi := integrable_boundaryDifference_sq (by positivity : 0 ≤ (m.natAbs:ℝ)) + (fourier (T:=T) m).continuous (chordLipschitz_fourier m) + rw [Measure.volume_eq_prod (AddCircle T) (AddCircle T),integral_prod _ hi] + have he : (∫ x : AddCircle T, ∫ y : AddCircle T, + ‖boundaryDifference (fourier m) (x,y)‖^2) = + (∫ x : AddCircle T, ∫ y : AddCircle T, + ‖(fourier m y-fourier m x)/((y.toCircle:ℂ)-(x.toCircle:ℂ))‖^2) := by + apply integral_congr_ae + exact ae_of_all _ fun x => integral_congr_ae (ae_of_all _ fun y => by + simp only [boundaryDifference,norm_div] + rw [norm_sub_rev (fourier m x),norm_sub_rev (x.toCircle:ℂ)]) + exact he.trans (fourier_double_integral m) + + +theorem boundaryModeCross_integral (m n : ℤ) : + (∫ p : AddCircle T × AddCircle T, boundaryModeCross m n p) = + if m=n then ((T^2*(m.natAbs:ℝ):ℝ):ℂ) else 0 := by + classical + split_ifs with h + · subst n + have he : boundaryModeCross (T:=T) m m = fun p => + ((‖boundaryDifference (fourier m) p‖^2:ℝ):ℂ) := by + funext p + rw [boundaryModeCross_eq,Complex.mul_conj,Complex.normSq_eq_norm_sq] + rw [he,integral_complex_ofReal,boundaryDifference_sq_integral] + · exact boundaryModeCross_integral_zero h + +end StrictHotSpots.Douglas +end BoundaryFourierIntegrableCombinedLayer + +section BoundaryFourierPolynomialCombinedLayer +open Set MeasureTheory AddCircle +open scoped ComplexConjugate +namespace StrictHotSpots.Douglas +variable {T : ℝ} [hT : Fact (0 < T)] + +def boundaryPolynomial (S : Finset ℤ) (a : ℤ → ℂ) (x : AddCircle T) : ℂ := + ∑ m ∈ S, a m * fourier m x + +omit hT in +lemma boundaryDifference_polynomial (S : Finset ℤ) (a : ℤ → ℂ) + (p : AddCircle T × AddCircle T) : + boundaryDifference (boundaryPolynomial S a) p = + ∑ m ∈ S, a m * boundaryDifference (fourier m) p := by + simp only [boundaryDifference,boundaryPolynomial,← Finset.sum_sub_distrib, + Finset.sum_div] + apply Finset.sum_congr rfl + intro m _ + ring + +omit hT in +lemma boundaryPolynomial_sq (S : Finset ℤ) (a : ℤ → ℂ) + (p : AddCircle T × AddCircle T) : + ((‖boundaryDifference (boundaryPolynomial S a) p‖^2 : ℝ) : ℂ) = + ∑ m ∈ S, ∑ n ∈ S, (a m*conj (a n))*boundaryModeCross m n p := by + rw [← Complex.normSq_eq_norm_sq,← Complex.mul_conj,boundaryDifference_polynomial] + simp only [map_sum,Finset.sum_mul,Finset.mul_sum,map_mul,boundaryModeCross_eq] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro m _ + apply Finset.sum_congr rfl + intro n _ + ring + +lemma boundaryPolynomial_energy (S : Finset ℤ) (a : ℤ → ℂ) : + boundaryEnergy (boundaryPolynomial (T:=T) S a) = + T^2 * ∑ m ∈ S, (m.natAbs:ℝ)*‖a m‖^2 := by + classical + have hi (m n : ℤ) : Integrable (fun p : AddCircle T × AddCircle T => + (a m*conj (a n))*boundaryModeCross m n p) := + (integrable_boundaryModeCross m n).const_mul _ + have he : (fun p : AddCircle T × AddCircle T => + ((‖boundaryDifference (boundaryPolynomial S a) p‖^2 : ℝ) : ℂ)) = + fun p => ∑ m ∈ S, ∑ n ∈ S, (a m*conj (a n))*boundaryModeCross m n p := by + funext p; exact boundaryPolynomial_sq S a p + apply Complex.ofReal_injective + change ((∫ p : AddCircle T × AddCircle T, + ‖boundaryDifference (boundaryPolynomial S a) p‖^2 : ℝ) : ℂ) = _ + rw [← integral_complex_ofReal,he] + rw [integral_finsetSum S (fun m _ => integrable_finsetSum S (fun n _ => hi m n))] + simp_rw [integral_finsetSum S (fun n _ => hi _ n),integral_const_mul, + boundaryModeCross_integral] + have hs : (∑ m ∈ S, ∑ n ∈ S, + (a m*conj (a n))*(if m=n then ((T^2*(m.natAbs:ℝ):ℝ):ℂ) else 0)) = + ∑ m ∈ S, (a m*conj (a m))*((T^2*(m.natAbs:ℝ):ℝ):ℂ) := by + apply Finset.sum_congr rfl + intro m hm + rw [Finset.sum_eq_single m] + · simp + · intro n _ hnm + simp [Ne.symm hnm] + · exact fun h => (h hm).elim + rw [hs] + simp only [Complex.mul_conj,Complex.normSq_eq_norm_sq,Complex.ofReal_mul, + Complex.ofReal_sum] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro m _ + ring + +end StrictHotSpots.Douglas +end BoundaryFourierPolynomialCombinedLayer + +section DiskRotationCombinedLayer +open Set MeasureTheory Metric +namespace StrictHotSpots.Douglas + +def circleRotation (u : Circle) : ℂ ≃ₗᵢ[ℝ] ℂ where + toFun z := u • z + invFun z := u⁻¹ • z + left_inv z := inv_smul_smul u z + right_inv z := smul_inv_smul u z + map_add' z w := smul_add u z w + map_smul' r z := smul_comm u r z + norm_map' z := Circle.norm_smul u z + +lemma circleRotation_apply (u : Circle) (z : ℂ) : circleRotation u z = (u:ℂ)*z := rfl + +lemma integral_disk_rotation (u : Circle) (f : ℂ → ℂ) : + (∫ z : ℂ in ball 0 1, f ((u:ℂ)*z)) = ∫ z : ℂ in ball 0 1, f z := by + have h := (circleRotation u).measurePreserving.integral_comp + (circleRotation u).toHomeomorph.measurableEmbedding ((ball (0:ℂ) 1).indicator f) + have he : (fun z => (ball (0:ℂ) 1).indicator f (circleRotation u z)) = + (ball (0:ℂ) 1).indicator (fun z => f ((u:ℂ)*z)) := by + funext z + have hm : circleRotation u z ∈ ball (0:ℂ) 1 ↔ z ∈ ball 0 1 := by + simp only [mem_ball_zero_iff,(circleRotation u).norm_map] + by_cases hz : z ∈ ball (0:ℂ) 1 + · rw [Set.indicator_of_mem (hm.mpr hz),Set.indicator_of_mem hz,circleRotation_apply] + · rw [Set.indicator_of_notMem (mt hm.mp hz),Set.indicator_of_notMem hz] + rw [he,integral_indicator measurableSet_ball,integral_indicator measurableSet_ball] at h + exact h +end StrictHotSpots.Douglas +end DiskRotationCombinedLayer + +section DiskMonomialCrossCombinedLayer +open Set MeasureTheory Metric AddCircle +open scoped ComplexConjugate +namespace StrictHotSpots.Douglas +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ + +lemma monomialCross_rotation (k l : ℕ) (s : AddCircle (2*Real.pi)) (z : ℂ) : + ((s.toCircle:ℂ)*z)^k * conj (((s.toCircle:ℂ)*z)^l) = + (z^k * conj (z^l)) * fourier ((k:ℤ)-(l:ℤ)) s := by + rw [sub_eq_add_neg,fourier_add,fourier_neg,fourier_nat,fourier_nat] + simp only [mul_pow,map_mul] + ring + +lemma integral_disk_monomial_cross_zero {k l : ℕ} (hkl : k ≠ l) : + (∫ z : ℂ in ball 0 1, z^k * conj (z^l)) = 0 := by + let r : AddCircle (2*Real.pi) := ((2*Real.pi)/2/((k:ℤ)-(l:ℤ)) : ℝ) + have hne : (k:ℤ)-(l:ℤ) ≠ 0 := sub_ne_zero.mpr (Int.ofNat_inj.not.mpr hkl) + have hf : fourier ((k:ℤ)-(l:ℤ)) r = -1 := by + simpa only [zero_add,fourier_eval_zero,r,Int.cast_sub] using + fourier_add_half_inv_index hne (by positivity : 0 < 2*Real.pi) + (0 : AddCircle (2*Real.pi)) + have h := integral_disk_rotation r.toCircle (fun z => z^k*conj (z^l)) + simp_rw [monomialCross_rotation,hf,mul_neg_one] at h + rw [integral_neg] at h + have hre := congrArg Complex.re h + have him := congrArg Complex.im h + apply Complex.ext <;> simp only [Complex.neg_re,Complex.neg_im,Complex.zero_re, + Complex.zero_im] at * <;> linarith + +lemma integrableOn_monomial_cross (k l : ℕ) : + IntegrableOn (fun z : ℂ => z^k*conj (z^l)) (ball 0 1) := by + have hc : Continuous (fun z : ℂ => z^k*conj (z^l)) := by fun_prop + exact (hc.continuousOn.integrableOn_compact (isCompact_closedBall 0 1)).mono_set ball_subset_closedBall + +lemma integral_disk_monomial_cross (k l : ℕ) : + (∫ z : ℂ in ball 0 1, z^k * conj (z^l)) = + if k=l then (((2*Real.pi)/((2*k:ℕ)+2):ℝ):ℂ) else 0 := by + classical + split_ifs with h + · subst l + have he : (fun z : ℂ => z^k*conj (z^k)) = fun z => ((‖z‖^(2*k):ℝ):ℂ) := by + funext z + rw [Complex.mul_conj,Complex.normSq_eq_norm_sq,norm_pow,← pow_mul,mul_comm k 2] + rw [he,integral_complex_ofReal,integral_disk_norm_pow] + · exact integral_disk_monomial_cross_zero h +end StrictHotSpots.Douglas +end DiskMonomialCrossCombinedLayer + +section DiskModeCrossCombinedLayer +open Set MeasureTheory Metric +open scoped ComplexConjugate +namespace StrictHotSpots.Douglas + +def bulkModeCross (m n : ℤ) (z : ℂ) : ℂ := + fderiv ℝ (harmonicMode m) z 1 * conj (fderiv ℝ (harmonicMode n) z 1) + + fderiv ℝ (harmonicMode m) z Complex.I * conj (fderiv ℝ (harmonicMode n) z Complex.I) + +lemma bulkModeCross_zero_left (n : ℤ) (z : ℂ) : bulkModeCross 0 n z = 0 := by + have he : harmonicMode 0 = fun _ : ℂ => (1:ℂ) := by funext w; change w^0=1; exact pow_zero w + simp [bulkModeCross,he] + +lemma bulkModeCross_symm (m n : ℤ) (z : ℂ) : + bulkModeCross m n z = conj (bulkModeCross n m z) := by + simp only [bulkModeCross,map_add,map_mul,Complex.conj_conj] + ring + +lemma bulkModeCross_pos (k l : ℕ) (z : ℂ) : + bulkModeCross (k+1:ℕ) (l+1:ℕ) z = + (2*((k+1:ℕ):ℂ)*((l+1:ℕ):ℂ))*(z^k * conj (z^l)) := by + change (fderiv ℝ (fun w : ℂ => w^(k+1)) z 1 * + conj (fderiv ℝ (fun w : ℂ => w^(l+1)) z 1) + + fderiv ℝ (fun w : ℂ => w^(k+1)) z Complex.I * + conj (fderiv ℝ (fun w : ℂ => w^(l+1)) z Complex.I)) = _ + simp only [fderiv_pow_mode,one_mul,map_mul,map_natCast,Complex.conj_I] + ring_nf + simp only [Complex.I_sq] + ring + +lemma bulkModeCross_neg (k l : ℕ) (z : ℂ) : + bulkModeCross (Int.negSucc k) (Int.negSucc l) z = + conj (bulkModeCross (k+1:ℕ) (l+1:ℕ) z) := by + change (fderiv ℝ (fun w : ℂ => conj (w^(k+1))) z 1 * + conj (fderiv ℝ (fun w : ℂ => conj (w^(l+1))) z 1) + + fderiv ℝ (fun w : ℂ => conj (w^(k+1))) z Complex.I * + conj (fderiv ℝ (fun w : ℂ => conj (w^(l+1))) z Complex.I)) = _ + rw [bulkModeCross_pos] + simp only [fderiv_conj_mode,one_mul,map_mul,map_natCast,Complex.conj_I, + Complex.conj_conj,map_ofNat] + ring_nf + simp only [map_neg,Complex.conj_I] + ring_nf + rw [Complex.I_sq] + ring + +lemma bulkModeCross_mixed (k l : ℕ) (z : ℂ) : + bulkModeCross (k+1:ℕ) (Int.negSucc l) z = 0 := by + change (fderiv ℝ (fun w : ℂ => w^(k+1)) z 1 * + conj (fderiv ℝ (fun w : ℂ => conj (w^(l+1))) z 1) + + fderiv ℝ (fun w : ℂ => w^(k+1)) z Complex.I * + conj (fderiv ℝ (fun w : ℂ => conj (w^(l+1))) z Complex.I)) = _ + simp only [fderiv_pow_mode,fderiv_conj_mode,one_mul,Complex.conj_conj] + ring_nf + simp only [Complex.I_sq] + ring + +lemma bulkModeCross_continuous (m n : ℤ) : Continuous (bulkModeCross m n) := by + have hp (k l : ℕ) : Continuous (bulkModeCross (k+1:ℕ) (l+1:ℕ)) := by + simp_rw [funext (bulkModeCross_pos k l)] + fun_prop + have hn (k l : ℕ) : Continuous (bulkModeCross (Int.negSucc k) (Int.negSucc l)) := by + simp_rw [funext (bulkModeCross_neg k l)] + exact Complex.continuous_conj.comp (hp k l) + cases m with + | ofNat k => + cases k with + | zero => + change Continuous (bulkModeCross 0 n) + rw [funext (bulkModeCross_zero_left n)]; exact continuous_const + | succ k => + cases n with + | ofNat l => + cases l with + | zero => + have he : bulkModeCross (k+1:ℕ) 0 = fun _ => (0:ℂ) := by + funext z; rw [bulkModeCross_symm,bulkModeCross_zero_left,map_zero] + change Continuous (bulkModeCross (k+1:ℕ) 0) + rw [he]; exact continuous_const + | succ l => exact hp k l + | negSucc l => + change Continuous (bulkModeCross (k+1:ℕ) (Int.negSucc l)) + rw [funext (bulkModeCross_mixed k l)]; exact continuous_const + | negSucc k => + cases n with + | ofNat l => + cases l with + | zero => + have he : bulkModeCross (Int.negSucc k) 0 = fun _ => (0:ℂ) := by + funext z; rw [bulkModeCross_symm,bulkModeCross_zero_left,map_zero] + change Continuous (bulkModeCross (Int.negSucc k) 0) + rw [he]; exact continuous_const + | succ l => + have he : bulkModeCross (Int.negSucc k) (l+1:ℕ) = fun _ => (0:ℂ) := by + funext z; rw [bulkModeCross_symm,bulkModeCross_mixed,map_zero] + change Continuous (bulkModeCross (Int.negSucc k) (l+1:ℕ)) + rw [he]; exact continuous_const + | negSucc l => exact hn k l + +lemma bulkModeCross_integrable (m n : ℤ) : + IntegrableOn (bulkModeCross m n) (ball 0 1) := + ((bulkModeCross_continuous m n).continuousOn.integrableOn_compact (isCompact_closedBall 0 1)).mono_set + ball_subset_closedBall + +end StrictHotSpots.Douglas +end DiskModeCrossCombinedLayer + +section DiskModeGramCombinedLayer +open Set MeasureTheory Metric +open scoped ComplexConjugate +namespace StrictHotSpots.Douglas + +lemma bulkModeCross_self_integral (m : ℤ) : + (∫ z : ℂ in ball 0 1, bulkModeCross m m z) = + ((2*Real.pi*(m.natAbs:ℝ):ℝ):ℂ) := by + have he : bulkModeCross m m = fun z => + ((‖fderiv ℝ (harmonicMode m) z 1‖^2 + + ‖fderiv ℝ (harmonicMode m) z Complex.I‖^2 : ℝ):ℂ) := by + funext z + simp only [bulkModeCross,Complex.mul_conj,Complex.normSq_eq_norm_sq,Complex.ofReal_add] + rw [he,integral_complex_ofReal,harmonicMode_energy] + +lemma bulkModeCross_pos_integral_zero {k l : ℕ} (hkl : k ≠ l) : + (∫ z : ℂ in ball 0 1, bulkModeCross (k+1:ℕ) (l+1:ℕ) z) = 0 := by + simp_rw [bulkModeCross_pos] + rw [integral_const_mul,integral_disk_monomial_cross_zero hkl,mul_zero] + +lemma bulkModeCross_zero_right (m : ℤ) (z : ℂ) : bulkModeCross m 0 z = 0 := by + rw [bulkModeCross_symm,bulkModeCross_zero_left,map_zero] + +lemma bulkModeCross_opposite (k l : ℕ) (z : ℂ) : + bulkModeCross (Int.negSucc k) (l+1:ℕ) z = 0 := by + rw [bulkModeCross_symm,bulkModeCross_mixed,map_zero] + +lemma bulkModeCross_integral_zero {m n : ℤ} (hmn : m ≠ n) : + (∫ z : ℂ in ball 0 1, bulkModeCross m n z) = 0 := by + cases m with + | ofNat k => + cases k with + | zero => + change (∫ z : ℂ in ball 0 1, bulkModeCross 0 n z) = 0 + simp_rw [bulkModeCross_zero_left]; exact integral_zero _ _ + | succ k => + cases n with + | ofNat l => + cases l with + | zero => + change (∫ z : ℂ in ball 0 1, bulkModeCross (k+1:ℕ) 0 z) = 0 + simp_rw [bulkModeCross_zero_right]; exact integral_zero _ _ + | succ l => + exact bulkModeCross_pos_integral_zero (fun h => hmn (by subst l; rfl)) + | negSucc l => + change (∫ z : ℂ in ball 0 1, bulkModeCross (k+1:ℕ) (Int.negSucc l) z) = 0 + simp_rw [bulkModeCross_mixed]; exact integral_zero _ _ + | negSucc k => + cases n with + | ofNat l => + cases l with + | zero => + change (∫ z : ℂ in ball 0 1, bulkModeCross (Int.negSucc k) 0 z) = 0 + simp_rw [bulkModeCross_zero_right]; exact integral_zero _ _ + | succ l => + change (∫ z : ℂ in ball 0 1, bulkModeCross (Int.negSucc k) (l+1:ℕ) z) = 0 + simp_rw [bulkModeCross_opposite]; exact integral_zero _ _ + | negSucc l => + simp_rw [bulkModeCross_neg] + rw [integral_conj,bulkModeCross_pos_integral_zero (fun h => hmn (by subst l; rfl)),map_zero] + + +theorem bulkModeCross_integral (m n : ℤ) : + (∫ z : ℂ in ball 0 1, bulkModeCross m n z) = + if m=n then ((2*Real.pi*(m.natAbs:ℝ):ℝ):ℂ) else 0 := by + classical + split_ifs with h + · subst n; exact bulkModeCross_self_integral m + · exact bulkModeCross_integral_zero h +end StrictHotSpots.Douglas +end DiskModeGramCombinedLayer + +section DouglasPolynomialCombinedLayer +open Set MeasureTheory Metric AddCircle +open scoped ComplexConjugate +namespace StrictHotSpots.Douglas + +def harmonicPolynomial (S : Finset ℤ) (a : ℤ → ℂ) (z : ℂ) : ℂ := + ∑ m ∈ S, a m * harmonicMode m z + +lemma harmonicMode_differentiable (m : ℤ) : Differentiable ℝ (harmonicMode m) := by + cases m with + | ofNat n => exact differentiable_pow n + | negSucc n => + exact Complex.conjCLE.toContinuousLinearMap.differentiable.comp (differentiable_pow (n+1)) + +lemma harmonicPolynomial_deriv (S : Finset ℤ) (a : ℤ → ℂ) (z e : ℂ) : + fderiv ℝ (harmonicPolynomial S a) z e = + ∑ m ∈ S, a m * fderiv ℝ (harmonicMode m) z e := by + have h := HasFDerivAt.fun_sum (u:=S) (fun m _ => + ((harmonicMode_differentiable m z).hasFDerivAt.const_mul (a m))) + have he := congrArg (fun L : ℂ →L[ℝ] ℂ => L e) h.fderiv + change fderiv ℝ (fun y => ∑ i ∈ S, a i * harmonicMode i y) z e = _ + simpa using he + +lemma harmonicPolynomial_boundary {T : ℝ} (S : Finset ℤ) (a : ℤ → ℂ) (x : AddCircle T) : + harmonicPolynomial S a x.toCircle = boundaryPolynomial S a x := by + simp only [harmonicPolynomial,boundaryPolynomial,harmonicMode_boundary] + +lemma harmonicPolynomial_sq (S : Finset ℤ) (a : ℤ → ℂ) (z : ℂ) : + ((‖fderiv ℝ (harmonicPolynomial S a) z 1‖^2 + + ‖fderiv ℝ (harmonicPolynomial S a) z Complex.I‖^2 : ℝ):ℂ) = + ∑ m ∈ S, ∑ n ∈ S, (a m*conj (a n))*bulkModeCross m n z := by + simp only [Complex.ofReal_add,← Complex.normSq_eq_norm_sq,← Complex.mul_conj, + harmonicPolynomial_deriv,map_sum,Finset.sum_mul,Finset.mul_sum,map_mul] + rw [← Finset.sum_add_distrib,Finset.sum_comm] + apply Finset.sum_congr rfl + intro m _ + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro n _ + simp only [bulkModeCross] + ring + +lemma harmonicPolynomial_energy (S : Finset ℤ) (a : ℤ → ℂ) : + (∫ z : ℂ in ball 0 1, ‖fderiv ℝ (harmonicPolynomial S a) z 1‖^2 + + ‖fderiv ℝ (harmonicPolynomial S a) z Complex.I‖^2) = + 2*Real.pi * ∑ m ∈ S, (m.natAbs:ℝ)*‖a m‖^2 := by + classical + have hi (m n : ℤ) : IntegrableOn (fun z : ℂ => + (a m*conj (a n))*bulkModeCross m n z) (ball 0 1) := + (bulkModeCross_integrable m n).const_mul _ + have he := funext (harmonicPolynomial_sq S a) + apply Complex.ofReal_injective + rw [← integral_complex_ofReal,he] + rw [integral_finsetSum S (fun m _ => integrable_finsetSum S (fun n _ => hi m n))] + simp_rw [integral_finsetSum S (fun n _ => hi _ n),integral_const_mul, + bulkModeCross_integral] + have hs : (∑ m ∈ S, ∑ n ∈ S, + (a m*conj (a n))*(if m=n then ((2*Real.pi*(m.natAbs:ℝ):ℝ):ℂ) else 0)) = + ∑ m ∈ S, (a m*conj (a m))*((2*Real.pi*(m.natAbs:ℝ):ℝ):ℂ) := by + apply Finset.sum_congr rfl + intro m hm + rw [Finset.sum_eq_single m] + · simp + · intro n _ hnm + simp [Ne.symm hnm] + · exact fun h => (h hm).elim + rw [hs] + simp only [Complex.mul_conj,Complex.normSq_eq_norm_sq,Complex.ofReal_mul, + Complex.ofReal_sum] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro m _ + ring + +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ + + +theorem douglas_polynomial (S : Finset ℤ) (a : ℤ → ℂ) : + (∫ z : ℂ in ball 0 1, ‖fderiv ℝ (harmonicPolynomial S a) z 1‖^2 + + ‖fderiv ℝ (harmonicPolynomial S a) z Complex.I‖^2) = + (1/(2*Real.pi))*boundaryEnergy (boundaryPolynomial (T:=2*Real.pi) S a) := by + rw [harmonicPolynomial_energy,boundaryPolynomial_energy] + field_simp + +end StrictHotSpots.Douglas +end DouglasPolynomialCombinedLayer + +section DouglasSeriesBoundsCombinedLayer +open Set MeasureTheory Metric Filter +open scoped ComplexConjugate +namespace StrictHotSpots.Douglas + +lemma harmonicMode_norm_le_one (m : ℤ) {z : ℂ} (hz : ‖z‖ ≤ 1) : ‖harmonicMode m z‖ ≤ 1 := by + cases m with + | ofNat n => + change ‖z^n‖ ≤ 1 + rw [norm_pow] + exact pow_le_one₀ (norm_nonneg z) hz + | negSucc n => + change ‖conj (z^(n+1))‖ ≤ 1 + rw [Complex.norm_conj,norm_pow] + exact pow_le_one₀ (norm_nonneg z) hz + +lemma harmonicMode_deriv_apply_bound (m : ℤ) {z : ℂ} (hz : ‖z‖ ≤ 1) (e : ℂ) : + ‖fderiv ℝ (harmonicMode m) z e‖ ≤ (m.natAbs:ℝ)*‖e‖ := by + have hp (n : ℕ) : ‖e*((n+1:ℕ)*z^n)‖ ≤ ((n+1:ℕ):ℝ)*‖e‖ := by + rw [norm_mul,norm_mul,Complex.norm_natCast,norm_pow] + have h := mul_le_mul_of_nonneg_left (pow_le_one₀ (norm_nonneg z) hz (n:=n)) + (mul_nonneg (norm_nonneg e) (Nat.cast_nonneg (n+1) : (0:ℝ) ≤ (n+1:ℕ))) + calc + ‖e‖ * (((n+1:ℕ):ℝ) * ‖z‖^n) = (‖e‖ * ((n+1:ℕ):ℝ)) * ‖z‖^n := by ring + _ ≤ (‖e‖ * ((n+1:ℕ):ℝ)) * 1 := h + _ = ((n+1:ℕ):ℝ)*‖e‖ := by ring + cases m with + | ofNat n => + cases n with + | zero => + change ‖fderiv ℝ (fun _ : ℂ => (1:ℂ)) z e‖ ≤ _ + simp + | succ n => + change ‖fderiv ℝ (fun w : ℂ => w^(n+1)) z e‖ ≤ ((n+1:ℕ):ℝ)*‖e‖ + rw [fderiv_pow_mode] + exact hp n + | negSucc n => + change ‖fderiv ℝ (fun w : ℂ => conj (w^(n+1))) z e‖ ≤ ((n+1:ℕ):ℝ)*‖e‖ + rw [fderiv_conj_mode,Complex.norm_conj] + exact hp n + +lemma harmonicMode_deriv_bound (m : ℤ) {z : ℂ} (hz : ‖z‖ ≤ 1) : + ‖fderiv ℝ (harmonicMode m) z‖ ≤ (m.natAbs:ℝ) := by + apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) + exact harmonicMode_deriv_apply_bound m hz + + + +def harmonicSeries (a : ℤ → ℂ) (z : ℂ) : ℂ := ∑' m : ℤ, a m*harmonicMode m z + +lemma harmonicSeries_summable {a : ℤ → ℂ} (ha : Summable (fun m => ‖a m‖)) + {z : ℂ} (hz : ‖z‖ ≤ 1) : Summable (fun m => a m*harmonicMode m z) := by + apply Summable.of_norm_bounded ha + intro m + rw [norm_mul] + simpa using mul_le_mul_of_nonneg_left (harmonicMode_norm_le_one m hz) (norm_nonneg (a m)) + +lemma harmonicSeries_deriv_summable {a : ℤ → ℂ} + (ha : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) {z : ℂ} (hz : ‖z‖ ≤ 1) : + Summable (fun m => a m • fderiv ℝ (harmonicMode m) z) := by + apply Summable.of_norm_bounded ha + intro m + rw [norm_smul] + simpa only [mul_comm] using + mul_le_mul_of_nonneg_left (harmonicMode_deriv_bound m hz) (norm_nonneg (a m)) + +end StrictHotSpots.Douglas +end DouglasSeriesBoundsCombinedLayer + +section DouglasSeriesDerivCombinedLayer +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ComplexConjugate +namespace StrictHotSpots.Douglas + +def firstMoment (a : ℤ → ℂ) : ℝ := ∑' m : ℤ, (m.natAbs:ℝ)*‖a m‖ +lemma firstMoment_nonneg (a : ℤ → ℂ) : 0 ≤ firstMoment a := + tsum_nonneg (fun _m => mul_nonneg (Nat.cast_nonneg _) (norm_nonneg _)) + +lemma harmonicSeries_hasFDerivAt {a : ℤ → ℂ} + (h0 : Summable (fun m => ‖a m‖)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) + {z : ℂ} (hz : z ∈ ball 0 1) : + HasFDerivAt (harmonicSeries a) (∑' m : ℤ, a m • fderiv ℝ (harmonicMode m) z) z := by + apply hasFDerivAt_tsum_of_isPreconnected (s:=ball (0:ℂ) 1) h1 isOpen_ball + (convex_ball (0:ℂ) 1).isPreconnected + (fun m w _ => (harmonicMode_differentiable m w).hasFDerivAt.const_mul (a m)) + · intro m w hw + rw [norm_smul] + simpa only [mul_comm] using mul_le_mul_of_nonneg_left + (harmonicMode_deriv_bound m (mem_ball_zero_iff.mp hw).le) (norm_nonneg (a m)) + · exact mem_ball_self (by norm_num) + · exact harmonicSeries_summable h0 (z:=0) (by simp) + · exact hz + +lemma harmonicPolynomial_deriv_bound {a : ℤ → ℂ} + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) + (S : Finset ℤ) {z : ℂ} (hz : ‖z‖ ≤ 1) (e : ℂ) : + ‖fderiv ℝ (harmonicPolynomial S a) z e‖ ≤ firstMoment a * ‖e‖ := by + rw [harmonicPolynomial_deriv] + calc + _ ≤ ∑ m ∈ S, ‖a m * fderiv ℝ (harmonicMode m) z e‖ := norm_sum_le _ _ + _ ≤ ∑ m ∈ S, ((m.natAbs:ℝ)*‖a m‖)*‖e‖ := by + apply Finset.sum_le_sum + intro m _ + rw [norm_mul] + convert mul_le_mul_of_nonneg_left (harmonicMode_deriv_apply_bound m hz e) + (norm_nonneg (a m)) using 1; ring + _ = (∑ m ∈ S, (m.natAbs:ℝ)*‖a m‖)*‖e‖ := (Finset.sum_mul _ _ _).symm + _ ≤ firstMoment a * ‖e‖ := mul_le_mul_of_nonneg_right + (h1.sum_le_tsum S (fun m _ => by positivity)) (norm_nonneg _) + +lemma harmonicMode_deriv_continuous (m : ℤ) (e : ℂ) : + Continuous (fun z => fderiv ℝ (harmonicMode m) z e) := by + cases m with + | ofNat n => + cases n with + | zero => + change Continuous (fun z : ℂ => fderiv ℝ (fun _ : ℂ => (1:ℂ)) z e) + simpa using (continuous_const : Continuous (fun _ : ℂ => (0:ℂ))) + | succ n => + change Continuous (fun z : ℂ => fderiv ℝ (fun w : ℂ => w^(n+1)) z e) + simp_rw [fderiv_pow_mode] + fun_prop + | negSucc n => + change Continuous (fun z : ℂ => fderiv ℝ (fun w : ℂ => conj (w^(n+1))) z e) + simp_rw [fderiv_conj_mode] + fun_prop + +lemma harmonicPolynomial_deriv_continuous (S : Finset ℤ) (a : ℤ → ℂ) (e : ℂ) : + Continuous (fun z => fderiv ℝ (harmonicPolynomial S a) z e) := by + simp_rw [harmonicPolynomial_deriv] + exact continuous_finsetSum _ (fun m _ => continuous_const.mul (harmonicMode_deriv_continuous m e)) + +lemma harmonicPolynomial_deriv_tendsto {a : ℤ → ℂ} + (h0 : Summable (fun m => ‖a m‖)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) + {z : ℂ} (hz : z ∈ ball 0 1) (e : ℂ) : + Tendsto (fun S : Finset ℤ => fderiv ℝ (harmonicPolynomial S a) z e) + atTop (𝓝 (fderiv ℝ (harmonicSeries a) z e)) := by + rw [(harmonicSeries_hasFDerivAt h0 h1 hz).fderiv] + have ht := (harmonicSeries_deriv_summable h1 (mem_ball_zero_iff.mp hz).le).hasSum + have he := ((ContinuousLinearMap.apply ℝ ℂ e).continuous.tendsto _).comp ht + change Tendsto (fun S : Finset ℤ => (∑ m ∈ S, a m • fderiv ℝ (harmonicMode m) z) e) + atTop (𝓝 ((∑' m : ℤ, a m • fderiv ℝ (harmonicMode m) z) e)) at he + simpa only [sum_apply,smul_apply,smul_eq_mul,harmonicPolynomial_deriv] using he + +end StrictHotSpots.Douglas +end DouglasSeriesDerivCombinedLayer + +section DouglasSeriesBoundaryCombinedLayer +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ComplexConjugate +namespace StrictHotSpots.Douglas +variable {T : ℝ} + +lemma harmonicSeries_boundary_tendsto {a : ℤ → ℂ} + (h0 : Summable (fun m => ‖a m‖)) (x : AddCircle T) : + Tendsto (fun S : Finset ℤ => boundaryPolynomial S a x) + atTop (𝓝 (harmonicSeries a x.toCircle)) := by + have h := harmonicSeries_summable h0 (z:=(x.toCircle : ℂ)) (Circle.norm_coe x.toCircle).le + have ht := h.hasSum + change Tendsto (fun S : Finset ℤ => ∑ m ∈ S, a m * harmonicMode m x.toCircle) + atTop (𝓝 (harmonicSeries a x.toCircle)) at ht + simpa only [harmonicMode_boundary,boundaryPolynomial] using ht + +lemma boundaryPolynomial_chordLipschitz {a : ℤ → ℂ} + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) (S : Finset ℤ) : + ChordLipschitz (firstMoment a) (boundaryPolynomial (T:=T) S a) := by + intro s t + simp only [boundaryPolynomial,← Finset.sum_sub_distrib,← mul_sub] + calc + _ ≤ ∑ m ∈ S, ‖a m*(fourier m s-fourier m t)‖ := norm_sum_le _ _ + _ ≤ ∑ m ∈ S, ((m.natAbs:ℝ)*‖a m‖)*‖(s.toCircle:ℂ)-(t.toCircle:ℂ)‖ := by + apply Finset.sum_le_sum + intro m _ + rw [norm_mul] + convert mul_le_mul_of_nonneg_left (chordLipschitz_fourier m s t) + (norm_nonneg (a m)) using 1; ring + _ = (∑ m ∈ S, (m.natAbs:ℝ)*‖a m‖)*‖(s.toCircle:ℂ)-(t.toCircle:ℂ)‖ := + (Finset.sum_mul _ _ _).symm + _ ≤ firstMoment a * ‖(s.toCircle:ℂ)-(t.toCircle:ℂ)‖ := + mul_le_mul_of_nonneg_right (h1.sum_le_tsum S (fun m _ => by positivity)) (norm_nonneg _) + +lemma boundaryPolynomial_continuous (S : Finset ℤ) (a : ℤ → ℂ) : + Continuous (boundaryPolynomial (T:=T) S a) := + continuous_finsetSum _ (fun m _ => continuous_const.mul (fourier m).continuous) + +variable [hT : Fact (0 < T)] +theorem boundaryEnergy_tendsto_filter {ι : Type*} {l : Filter ι} [l.IsCountablyGenerated] + {K : ℝ} (hK : 0 ≤ K) {h : AddCircle T → ℂ} {f : ι → AddCircle T → ℂ} + (hc : ∀ i, Continuous (f i)) (hf : ∀ i, ChordLipschitz K (f i)) + (hl : ∀ s, Tendsto (fun i => f i s) l (𝓝 (h s))) : + Tendsto (fun i => boundaryEnergy (f i)) l (𝓝 (boundaryEnergy h)) := by + apply tendsto_integral_filter_of_dominated_convergence (fun _ : AddCircle T × AddCircle T => K^2) + · exact Eventually.of_forall fun i => + ((measurable_boundaryDifference (hc i)).norm.pow_const 2).aestronglyMeasurable + · exact Eventually.of_forall fun i => ae_of_all _ fun p => by + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (norm_nonneg _) (boundaryDifference_bound hK (hf i) p) 2 + · exact integrable_const _ + · exact ae_of_all _ fun p => (((hl p.1).sub (hl p.2)).div_const _).norm.pow 2 + +lemma harmonicSeries_boundaryEnergy_tendsto {a : ℤ → ℂ} + (h0 : Summable (fun m => ‖a m‖)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) : + Tendsto (fun S : Finset ℤ => boundaryEnergy (boundaryPolynomial (T:=T) S a)) atTop + (𝓝 (boundaryEnergy (fun x : AddCircle T => harmonicSeries a x.toCircle))) := + boundaryEnergy_tendsto_filter (firstMoment_nonneg a) + (fun S => boundaryPolynomial_continuous S a) (boundaryPolynomial_chordLipschitz h1) + (harmonicSeries_boundary_tendsto h0) + +end StrictHotSpots.Douglas +end DouglasSeriesBoundaryCombinedLayer + +section DouglasSeriesEnergyCombinedLayer +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ComplexConjugate +namespace StrictHotSpots.Douglas + +def diskEnergy (f : ℂ → ℂ) : ℝ := + ∫ z : ℂ in ball 0 1, ‖fderiv ℝ f z 1‖^2 + ‖fderiv ℝ f z Complex.I‖^2 + +lemma harmonicSeries_diskEnergy_tendsto {a : ℤ → ℂ} + (h0 : Summable (fun m => ‖a m‖)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) : + Tendsto (fun S : Finset ℤ => diskEnergy (harmonicPolynomial S a)) atTop + (𝓝 (diskEnergy (harmonicSeries a))) := by + apply tendsto_integral_filter_of_dominated_convergence (fun _ : ℂ => 2*(firstMoment a)^2) + · exact Eventually.of_forall fun S => + (((harmonicPolynomial_deriv_continuous S a 1).norm.pow 2).add + ((harmonicPolynomial_deriv_continuous S a Complex.I).norm.pow 2)).aestronglyMeasurable + · exact Eventually.of_forall fun S => + (ae_restrict_mem measurableSet_ball).mono fun z hz => by + have ha := harmonicPolynomial_deriv_bound h1 S (mem_ball_zero_iff.mp hz).le 1 + have hb := harmonicPolynomial_deriv_bound h1 S (mem_ball_zero_iff.mp hz).le Complex.I + rw [norm_one,mul_one] at ha + rw [Complex.norm_I,mul_one] at hb + rw [Real.norm_eq_abs,abs_of_nonneg (add_nonneg (sq_nonneg _) (sq_nonneg _))] + have hA := pow_le_pow_left₀ (norm_nonneg _) ha 2 + have hB := pow_le_pow_left₀ (norm_nonneg _) hb 2 + linarith + · exact integrableOn_const + · exact (ae_restrict_mem measurableSet_ball).mono fun z hz => + ((harmonicPolynomial_deriv_tendsto h0 h1 hz 1).norm.pow 2).add + ((harmonicPolynomial_deriv_tendsto h0 h1 hz Complex.I).norm.pow 2) + +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ + + + +theorem douglas_series {a : ℤ → ℂ} + (h0 : Summable (fun m => ‖a m‖)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) : + diskEnergy (harmonicSeries a) = (1/(2*Real.pi))* + boundaryEnergy (fun x : AddCircle (2*Real.pi) => harmonicSeries a x.toCircle) := by + have hb := (harmonicSeries_boundaryEnergy_tendsto (T:=2*Real.pi) h0 h1).const_mul + (1/(2*Real.pi)) + have he : (fun S : Finset ℤ => (1/(2*Real.pi))* + boundaryEnergy (boundaryPolynomial (T:=2*Real.pi) S a)) = + fun S => diskEnergy (harmonicPolynomial S a) := by + funext S + exact (douglas_polynomial S a).symm + rw [he] at hb + exact tendsto_nhds_unique (harmonicSeries_diskEnergy_tendsto h0 h1) hb + +end StrictHotSpots.Douglas +end DouglasSeriesEnergyCombinedLayer + +section DouglasSeriesPoissonCombinedLayer +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ComplexConjugate +namespace StrictHotSpots.Douglas + +lemma poissonKernel_continuousOn_sphere {z : ℂ} (hz : z ∈ ball 0 1) : + ContinuousOn (poissonKernel 0 z) (sphere 0 1) := by + unfold poissonKernel + refine ContinuousOn.div (by fun_prop) (by fun_prop) ?_ + intro w hw + simp only [sub_zero] + apply pow_ne_zero + apply norm_ne_zero_iff.mpr + apply sub_ne_zero.mpr + intro he + have hw' : ‖w‖ = 1 := mem_sphere_zero_iff_norm.mp hw + have hz' : ‖z‖ < 1 := mem_ball_zero_iff.mp hz + rw [he] at hw' + linarith + +lemma harmonicPolynomial_continuous (S : Finset ℤ) (a : ℤ → ℂ) : + Continuous (harmonicPolynomial S a) := + continuous_finsetSum _ (fun m _ => continuous_const.mul (harmonicMode_continuous m)) + +lemma harmonicPolynomial_poisson (S : Finset ℤ) (a : ℤ → ℂ) + {z : ℂ} (hz : z ∈ ball 0 1) : + Real.circleAverage (poissonKernel 0 z • harmonicPolynomial S a) 0 1 = + harmonicPolynomial S a z := by + have hk := poissonKernel_continuousOn_sphere hz + have he : poissonKernel 0 z • harmonicPolynomial S a = + fun w => ∑ m ∈ S, a m • (poissonKernel 0 z w • harmonicMode m w) := by + funext w + change poissonKernel 0 z w • (∑ m ∈ S, a m * harmonicMode m w) = _ + rw [Finset.smul_sum] + apply Finset.sum_congr rfl + intro m _ + change poissonKernel 0 z w • (a m • harmonicMode m w) = _ + exact smul_comm (poissonKernel 0 z w) (a m) (harmonicMode m w) + rw [he,Real.circleAverage_fun_sum] + · change (∑ m ∈ S, Real.circleAverage (fun w => a m • (poissonKernel 0 z w • harmonicMode m w)) 0 1) = _ + simp only [Real.circleAverage_fun_smul] + change (∑ m ∈ S, a m • Real.circleAverage (poissonKernel 0 z • harmonicMode m) 0 1) = _ + simp only [harmonicMode_poisson _ hz,smul_eq_mul,harmonicPolynomial] + · intro m _ + exact ((hk.smul (harmonicMode_continuous m).continuousOn).circleIntegrable + (by norm_num)).smul (a m) + +lemma harmonicPolynomial_bound {a : ℤ → ℂ} (h0 : Summable (fun m => ‖a m‖)) + (S : Finset ℤ) {z : ℂ} (hz : ‖z‖ ≤ 1) : + ‖harmonicPolynomial S a z‖ ≤ ∑' m : ℤ, ‖a m‖ := by + calc + _ ≤ ∑ m ∈ S, ‖a m*harmonicMode m z‖ := norm_sum_le _ _ + _ ≤ ∑ m ∈ S, ‖a m‖ := by + apply Finset.sum_le_sum + intro m _ + rw [norm_mul] + simpa only [mul_one] using mul_le_mul_of_nonneg_left + (harmonicMode_norm_le_one m hz) (norm_nonneg (a m)) + _ ≤ _ := h0.sum_le_tsum S (fun m _ => norm_nonneg (a m)) + +lemma harmonicSeries_poisson_tendsto {a : ℤ → ℂ} (h0 : Summable (fun m => ‖a m‖)) + {z : ℂ} (hz : z ∈ ball 0 1) : + Tendsto (fun S : Finset ℤ => Real.circleAverage + (poissonKernel 0 z • harmonicPolynomial S a) 0 1) atTop + (𝓝 (Real.circleAverage (poissonKernel 0 z • harmonicSeries a) 0 1)) := by + have hk := poissonKernel_continuousOn_sphere hz + obtain ⟨C,hC⟩ := (isCompact_sphere (0:ℂ) 1).exists_bound_of_continuousOn hk + have hmap (t : ℝ) : circleMap (0:ℂ) 1 t ∈ sphere 0 1 := by + exact circleMap_mem_sphere (0:ℂ) (by norm_num) t + have hkc : Continuous (fun t : ℝ => poissonKernel 0 z (circleMap 0 1 t)) := + hk.comp_continuous (continuous_circleMap 0 1) hmap + apply Filter.Tendsto.smul tendsto_const_nhds + apply intervalIntegral.tendsto_integral_filter_of_dominated_convergence + (fun _ : ℝ => C*(∑' m : ℤ, ‖a m‖)) + · exact Eventually.of_forall fun S => + (hkc.smul ((harmonicPolynomial_continuous S a).comp (continuous_circleMap 0 1))).aestronglyMeasurable + · exact Eventually.of_forall fun S => ae_of_all _ fun t _ => by + rw [Pi.smul_apply',norm_smul] + exact mul_le_mul (hC _ (hmap t)) + (harmonicPolynomial_bound h0 S (mem_sphere_zero_iff_norm.mp (hmap t)).le) + (norm_nonneg _) (le_trans (norm_nonneg _) (hC _ (hmap t))) + · exact intervalIntegrable_const + · refine ae_of_all _ fun t _ => ?_ + change Tendsto (fun S : Finset ℤ => poissonKernel 0 z (circleMap 0 1 t) • + (∑ m ∈ S, a m*harmonicMode m (circleMap 0 1 t))) atTop + (𝓝 (poissonKernel 0 z (circleMap 0 1 t) • ∑' m : ℤ, a m*harmonicMode m (circleMap 0 1 t))) + exact tendsto_const_nhds.smul + (harmonicSeries_summable h0 (mem_sphere_zero_iff_norm.mp (hmap t)).le).hasSum + + + +theorem harmonicSeries_poisson {a : ℤ → ℂ} (h0 : Summable (fun m => ‖a m‖)) + {z : ℂ} (hz : z ∈ ball 0 1) : + Real.circleAverage (poissonKernel 0 z • harmonicSeries a) 0 1 = harmonicSeries a z := by + have ht := harmonicSeries_poisson_tendsto h0 hz + simp only [harmonicPolynomial_poisson _ _ hz] at ht + exact tendsto_nhds_unique ht (harmonicSeries_summable h0 (mem_ball_zero_iff.mp hz).le).hasSum + +end StrictHotSpots.Douglas +end DouglasSeriesPoissonCombinedLayer + +section FourierSmoothMomentCombinedLayer +open Set MeasureTheory AddCircle +open scoped ComplexConjugate +namespace StrictHotSpots.Douglas +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma norm_fourierCoeff_le (f : C(AddCircle τ, ℂ)) (m : ℤ) : + ‖fourierCoeff f m‖ ≤ ‖f‖ := by + have h := norm_integral_le_of_norm_le_const (μ:=haarAddCircle) (C:=‖f‖) + (f:=fun x : AddCircle τ => fourier (-m) x • f x) (ae_of_all _ fun x => by + rw [norm_smul] + have hf : ‖fourier (T:=τ) (-m) x‖ = 1 := by + rw [fourier_apply,Circle.norm_coe] + rw [hf,one_mul] + exact ContinuousMap.norm_coe_le_norm f x) + simpa only [fourierCoeff,probReal_univ,mul_one] using h + +lemma fourierCoeffOn_coe (f : C(AddCircle τ, ℂ)) (m : ℤ) : + fourierCoeffOn (a:=0) (b:=τ) (by positivity) (fun t : ℝ => f t) m = + fourierCoeff f m := by + rw [fourierCoeffOn_eq_integral,fourierCoeff_eq_intervalIntegral _ _ 0] + simp_rw [fourier_coe_apply] + simp only [sub_zero,zero_add] + +lemma fourierCoeff_derivative (f g : C(AddCircle τ, ℂ)) + (hfg : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f t) (g t) t) + {m : ℤ} (hm : m ≠ 0) : + ((m:ℂ)*Complex.I)*fourierCoeff f m = fourierCoeff g m := by + have h := fourierCoeffOn_of_hasDerivAt (a:=0) (b:=τ) (by positivity) hm + (fun t _ => hfg t) ((g.continuous.comp (AddCircle.continuous_mk' τ)).intervalIntegrable _ _) + rw [fourierCoeffOn_coe f m,fourierCoeffOn_coe g m] at h + have he : f ((τ:ℝ):AddCircle τ) = f (0:AddCircle τ) := by rw [AddCircle.coe_period] + simp only [he] at h + rw [h] + have hm' : (m:ℂ) ≠ 0 := Int.cast_ne_zero.mpr hm + push_cast + field_simp [hm',Real.pi_ne_zero] + ring + +lemma norm_fourierCoeff_derivative (f g : C(AddCircle τ, ℂ)) + (hfg : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f t) (g t) t) + {m : ℤ} (hm : m ≠ 0) : + (m.natAbs:ℝ)*‖fourierCoeff f m‖ = ‖fourierCoeff g m‖ := by + have h := congrArg norm (fourierCoeff_derivative f g hfg hm) + have ha : (m.natAbs:ℝ) = |(m:ℝ)| := by rw [Nat.cast_natAbs,Int.cast_abs] + simpa only [norm_mul,Complex.norm_intCast,Complex.norm_I,mul_one,ha] using h + + +lemma firstMoment_fourierCoeff_bound (f0 f1 f2 f3 : C(AddCircle τ, ℂ)) + (h01 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f0 t) (f1 t) t) + (h12 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f1 t) (f2 t) t) + (h23 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f2 t) (f3 t) t) (m : ℤ) : + (m.natAbs:ℝ)*‖fourierCoeff f0 m‖ ≤ ‖f3‖*(1/(m:ℝ)^2) := by + by_cases hm : m=0 + · subst m; simp + have h0 := norm_fourierCoeff_derivative f0 f1 h01 hm + have h1 := norm_fourierCoeff_derivative f1 f2 h12 hm + have h2 := norm_fourierCoeff_derivative f2 f3 h23 hm + have hm' : (m:ℝ) ≠ 0 := Int.cast_ne_zero.mpr hm + rw [mul_one_div] + apply (le_div_iff₀ (sq_pos_of_ne_zero hm')).2 + calc + _ = (m.natAbs:ℝ)*((m.natAbs:ℝ)*((m.natAbs:ℝ)*‖fourierCoeff f0 m‖)) := by + have ha : (m.natAbs:ℝ) = |(m:ℝ)| := by rw [Nat.cast_natAbs,Int.cast_abs] + rw [ha] + calc + _ = |(m:ℝ)| * ‖fourierCoeff f0 m‖ * |(m:ℝ)|^2 := by rw [sq_abs] + _ = _ := by ring + _ = ‖fourierCoeff f3 m‖ := by rw [h0,h1,h2] + _ ≤ ‖f3‖ := norm_fourierCoeff_le f3 m + +lemma summable_firstMoment_fourierCoeff (f0 f1 f2 f3 : C(AddCircle τ, ℂ)) + (h01 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f0 t) (f1 t) t) + (h12 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f1 t) (f2 t) t) + (h23 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f2 t) (f3 t) t) : + Summable (fun m : ℤ => (m.natAbs:ℝ)*‖fourierCoeff f0 m‖) := by + have hp : Summable (fun m : ℤ => (1:ℝ)/(m:ℝ)^2) := Real.summable_one_div_int_pow.mpr (by norm_num) + exact Summable.of_nonneg_of_le (fun m => by positivity) + (firstMoment_fourierCoeff_bound f0 f1 f2 f3 h01 h12 h23) (hp.mul_left ‖f3‖) + +end StrictHotSpots.Douglas +end FourierSmoothMomentCombinedLayer + +section DouglasSmoothDataCombinedLayer +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ComplexConjugate +namespace StrictHotSpots.Douglas +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma summable_norm_of_firstMoment {a : ℤ → ℂ} + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) : Summable (fun m => ‖a m‖) := by + apply h1.of_norm_bounded_eventually + filter_upwards [eventually_cofinite_ne (0:ℤ)] with m hm + rw [Real.norm_eq_abs,abs_of_nonneg (norm_nonneg _)] + have hm' : 1 ≤ (m.natAbs:ℝ) := by + exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Int.natAbs_ne_zero.mpr hm) + exact le_mul_of_one_le_left (norm_nonneg _) hm' + +lemma harmonicSeries_fourier_boundary (f : C(AddCircle τ, ℂ)) + (h : Summable (fun m => ‖fourierCoeff f m‖)) (s : AddCircle τ) : + harmonicSeries (fourierCoeff f) s.toCircle = f s := by + have hf := has_pointwise_sum_fourier_series_of_summable h.of_norm s + simpa only [harmonicSeries,harmonicMode_boundary,smul_eq_mul] using hf.tsum_eq + +lemma circleMap_eq_toCircle (t : ℝ) : + circleMap (0:ℂ) 1 t = (AddCircle.toCircle (t:AddCircle τ) : ℂ) := by + rw [toCircle_apply_mk,Circle.coe_exp] + simp only [circleMap,Complex.ofReal_one,one_mul,zero_add] + congr 1 + push_cast + field_simp + + +def poissonExtension (f : AddCircle τ → ℂ) (z : ℂ) : ℂ := + τ⁻¹ • ∫ t in 0..τ, poissonKernel 0 z (circleMap 0 1 t) • f t + +lemma poissonExtension_eq_harmonicSeries (f : C(AddCircle τ, ℂ)) + (h : Summable (fun m => ‖fourierCoeff f m‖)) {z : ℂ} (hz : z ∈ ball 0 1) : + poissonExtension f z = harmonicSeries (fourierCoeff f) z := by + rw [← harmonicSeries_poisson h hz] + unfold poissonExtension Real.circleAverage + congr 1 + apply intervalIntegral.integral_congr + intro t _ + dsimp only + rw [Pi.smul_apply',circleMap_eq_toCircle,harmonicSeries_fourier_boundary f h] + + + +theorem douglas_C3 (f0 f1 f2 f3 : C(AddCircle τ, ℂ)) + (h01 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f0 t) (f1 t) t) + (h12 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f1 t) (f2 t) t) + (h23 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f2 t) (f3 t) t) : + diskEnergy (poissonExtension f0) = (1/τ)*boundaryEnergy f0 := by + have h1 := summable_firstMoment_fourierCoeff f0 f1 f2 f3 h01 h12 h23 + have h0 := summable_norm_of_firstMoment h1 + have he : EqOn (poissonExtension f0) (harmonicSeries (fourierCoeff f0)) (ball 0 1) := + fun z hz => poissonExtension_eq_harmonicSeries f0 h0 hz + have hd (z : ℂ) (hz : z ∈ ball 0 1) : + fderiv ℝ (poissonExtension f0) z = fderiv ℝ (harmonicSeries (fourierCoeff f0)) z := + (he.eventuallyEq_of_mem (isOpen_ball.mem_nhds hz)).fderiv_eq + have hE : diskEnergy (poissonExtension f0) = diskEnergy (harmonicSeries (fourierCoeff f0)) := by + apply setIntegral_congr_fun measurableSet_ball + intro z hz + dsimp only + rw [hd z hz] + rw [hE,douglas_series h0 h1] + have hb : (fun s : AddCircle τ => harmonicSeries (fourierCoeff f0) s.toCircle) = f0 := + funext (harmonicSeries_fourier_boundary f0 h0) + rw [hb] + +end StrictHotSpots.Douglas +end DouglasSmoothDataCombinedLayer + +section DouglasClosureCombinedLayer +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ComplexConjugate ContDiff +namespace StrictHotSpots.Douglas + +lemma harmonicMode_contDiff (m : ℤ) : ContDiff ℝ ∞ (harmonicMode m) := by + cases m with + | ofNat n => exact contDiff_id.pow n + | negSucc n => exact Complex.conjCLE.contDiff.comp (contDiff_id.pow (n+1)) + +lemma harmonicSeries_continuousOn {a : ℤ → ℂ} (ha : Summable (fun m => ‖a m‖)) : + ContinuousOn (harmonicSeries a) (closedBall 0 1) := by + apply continuousOn_tsum (fun m => + (continuous_const.mul (harmonicMode_continuous m)).continuousOn) ha + intro m z hz + dsimp only [Pi.mul_apply] + rw [norm_mul] + simpa only [mul_one] using mul_le_mul_of_nonneg_left + (harmonicMode_norm_le_one m (mem_closedBall_zero_iff.mp hz)) (norm_nonneg (a m)) + +def harmonicD (a : ℤ → ℂ) (z : ℂ) : ℂ →L[ℝ] ℂ := + ∑' m : ℤ, a m • fderiv ℝ (harmonicMode m) z + +lemma harmonicD_continuousOn {a : ℤ → ℂ} + (ha : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) : + ContinuousOn (harmonicD a) (closedBall 0 1) := by + unfold harmonicD + apply continuousOn_tsum (f := fun m z => a m • fderiv ℝ (harmonicMode m) z) + (fun m => (Continuous.const_smul ((harmonicMode_contDiff m).continuous_fderiv (by simp)) + (a m)).continuousOn) ha + intro m z hz + rw [norm_smul] + simpa only [mul_comm] using mul_le_mul_of_nonneg_left + (harmonicMode_deriv_bound m (mem_closedBall_zero_iff.mp hz)) (norm_nonneg (a m)) + +lemma harmonicD_bound {a : ℤ → ℂ} + (ha : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) {z : ℂ} (hz : ‖z‖ ≤ 1) : + ‖harmonicD a z‖ ≤ firstMoment a := by + apply (norm_tsum_le_tsum_norm (harmonicSeries_deriv_summable ha hz).norm).trans + exact Summable.tsum_le_tsum (fun m => by + rw [norm_smul] + simpa only [mul_comm] using mul_le_mul_of_nonneg_left + (harmonicMode_deriv_bound m hz) (norm_nonneg (a m))) + (harmonicSeries_deriv_summable ha hz).norm ha + +end StrictHotSpots.Douglas +end DouglasClosureCombinedLayer + + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/DouglasEnergy.lean b/lean/OAI/Analysis/HotSpots/DouglasEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..636b7fb4f56008d1a176f3d5880f193321fc2e00 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/DouglasEnergy.lean @@ -0,0 +1,1105 @@ +import OAI.Analysis.HotSpots.Poisson + +namespace OAI + +section PoissonContinuous + + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff InnerProductSpace +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + + + +def circleDatum (f : C(AddCircle τ,ℂ)) (z : ℂ) : ℂ := by + classical + exact if hz : z ∈ sphere 0 1 then + f ((AddCircle.homeomorphCircle (by positivity : τ ≠ 0)).symm ⟨z,hz⟩) + else 0 + +@[simp] lemma circleDatum_toCircle (f : C(AddCircle τ,ℂ)) (s : AddCircle τ) : + circleDatum f s.toCircle = f s := by + have hs : (s.toCircle:ℂ) ∈ sphere 0 1 := by + simp only [mem_sphere_zero_iff_norm,Circle.norm_coe] + classical + rw [circleDatum,dite_eq_left hs] + apply congrArg f + have he : (⟨(s.toCircle:ℂ),hs⟩ : Circle) = + (AddCircle.homeomorphCircle (by positivity : τ ≠ 0)) s := by + rw [AddCircle.homeomorphCircle_apply] + exact Subtype.ext rfl + rw [he,Homeomorph.symm_apply_apply] + +@[simp] lemma circleDatum_circleMap (f : C(AddCircle τ,ℂ)) (t : ℝ) : + circleDatum f (circleMap 0 1 t) = f t := by + rw [circleMap_eq_toCircle,circleDatum_toCircle] + +lemma circleDatum_circleIntegrable (f : C(AddCircle τ,ℂ)) : + CircleIntegrable (circleDatum f) 0 1 := by + change IntervalIntegrable (fun t : ℝ => circleDatum f (circleMap 0 1 t)) volume 0 τ + simp only [circleDatum_circleMap] + exact (f.continuous.comp (AddCircle.continuous_mk' τ)).intervalIntegrable _ _ + +lemma poisson_angle_continuous (f : C(AddCircle τ,ℂ)) {z : ℂ} (hz : z ∈ ball 0 1) : + Continuous (fun t : ℝ => poissonKernel 0 z (circleMap 0 1 t) • f t) := by + have hk := poissonKernel_continuousOn_sphere hz + have hkc : Continuous (fun t : ℝ => poissonKernel 0 z (circleMap 0 1 t)) := + hk.comp_continuous (continuous_circleMap 0 1) + (fun t => circleMap_mem_sphere (0:ℂ) (by norm_num) t) + exact hkc.smul (f.continuous.comp (AddCircle.continuous_mk' τ)) + +lemma poissonExtension_eq_circleAverage (f : C(AddCircle τ,ℂ)) (z : ℂ) : + poissonExtension f z = Real.circleAverage (poissonKernel 0 z • circleDatum f) 0 1 := by + unfold poissonExtension Real.circleAverage + congr 1 + apply intervalIntegral.integral_congr + intro t _ + simp only [Pi.smul_apply',circleDatum_circleMap] + +lemma poissonExtension_re_eq_circleAverage (f : C(AddCircle τ,ℂ)) + {z : ℂ} (hz : z ∈ ball 0 1) : + (poissonExtension f z).re = + Real.circleAverage (poissonKernel 0 z • (fun ζ => (circleDatum f ζ).re)) 0 1 := by + rw [poissonExtension_eq_circleAverage] + have hi : CircleIntegrable (poissonKernel 0 z • circleDatum f) 0 1 := by + change IntervalIntegrable (fun t : ℝ => + (poissonKernel 0 z • circleDatum f) (circleMap 0 1 t)) volume 0 τ + simp only [Pi.smul_apply',circleDatum_circleMap] + exact (poisson_angle_continuous f hz).intervalIntegrable _ _ + have he := Complex.reCLM.circleAverage_comp_comm hi + refine he.symm.trans (congrArg (fun F : ℂ → ℝ => Real.circleAverage F 0 1) ?_) + funext ζ + simp only [Function.comp_apply,Pi.smul_apply',Complex.reCLM_apply,Complex.smul_re,smul_eq_mul] + +lemma circleDatum_re_circleIntegrable (f : C(AddCircle τ,ℂ)) : + CircleIntegrable (fun ζ => (circleDatum f ζ).re) 0 1 := by + change IntervalIntegrable (fun t : ℝ => (circleDatum f (circleMap 0 1 t)).re) volume 0 τ + simp only [circleDatum_circleMap] + exact (Complex.continuous_re.comp (f.continuous.comp (AddCircle.continuous_mk' τ))).intervalIntegrable _ _ + + + +theorem poissonExtension_re_harmonic (f : C(AddCircle τ,ℂ)) : + InnerProductSpace.HarmonicOnNhd (fun z => (poissonExtension f z).re) (ball 0 1) := by + have hh := PlaneGreen.poissonAverage_harmonic (circleDatum_re_circleIntegrable f) + intro z hz + apply (InnerProductSpace.harmonicAt_congr_nhds (f₂ := fun w => + Real.circleAverage (poissonKernel 0 w • (fun ζ => (circleDatum f ζ).re)) 0 1) ?_).2 (hh z hz) + filter_upwards [isOpen_ball.mem_nhds hz] with w hw + exact poissonExtension_re_eq_circleAverage f hw + +lemma poissonExtension_re_contDiffOn (f : C(AddCircle τ,ℂ)) : + ContDiffOn ℝ ∞ (fun z => (poissonExtension f z).re) (ball 0 1) := by + apply (poissonAverage_contDiffOn (circleDatum_re_circleIntegrable f)).congr + intro z hz + exact poissonExtension_re_eq_circleAverage f hz + + + +def planePoisson (f : C(AddCircle τ,ℂ)) (x : Plane) : ℝ := + (poissonExtension f (complexIso.symm x)).re + +lemma planePoisson_contDiffOn (f : C(AddCircle τ,ℂ)) : + ContDiffOn ℝ ∞ (planePoisson f) disk := by + apply (poissonExtension_re_contDiffOn f).comp complexIso.symm.contDiff.contDiffOn + intro x hx + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + +lemma planePoisson_harmonic (f : C(AddCircle τ,ℂ)) : + InnerProductSpace.HarmonicOnNhd (planePoisson f) disk := by + intro x hx + have hz : complexIso.symm x ∈ ball (0:ℂ) 1 := by + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + exact harmonicAt_comp_linearIsometryEquiv complexIso.symm (poissonExtension_re_harmonic f _ hz) + +end StrictHotSpots.Douglas +end +end PoissonContinuous + +section PoissonBounds + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff InnerProductSpace +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma poisson_angle_kernel_nonneg {z : ℂ} (hz : z ∈ ball 0 1) (t : ℝ) : + 0 ≤ poissonKernel 0 z (circleMap 0 1 t) := by + have hn : ‖z‖ < 1 := mem_ball_zero_iff.mp hz + have ht : ‖circleMap (0:ℂ) 1 t‖ = 1 := + mem_sphere_zero_iff_norm.mp (circleMap_mem_sphere (0:ℂ) (by norm_num) t) + rw [poissonKernel_def,sub_zero,sub_zero,ht,one_pow] + exact div_nonneg (by nlinarith [norm_nonneg z]) (sq_nonneg _) + +lemma poisson_angle_kernel_continuous {z : ℂ} (hz : z ∈ ball 0 1) : + Continuous (fun t : ℝ => poissonKernel 0 z (circleMap 0 1 t)) := + (poissonKernel_continuousOn_sphere hz).comp_continuous (continuous_circleMap 0 1) + (fun t => circleMap_mem_sphere (0:ℂ) (by norm_num) t) + +lemma poisson_angle_mass {z : ℂ} (hz : z ∈ ball 0 1) : + τ⁻¹ * (∫ t : ℝ in 0..τ, poissonKernel 0 z (circleMap 0 1 t)) = 1 := by + have hc : InnerProductSpace.HarmonicOnNhd (fun _ : ℂ => (1:ℝ)) (closedBall 0 1) := + fun _ _ => InnerProductSpace.harmonicAt_const _ + have he := hc.circleAverage_poissonKernel_smul hz + simpa only [Real.circleAverage,Pi.smul_apply',smul_eq_mul,mul_one] using he + + + +theorem poissonExtension_norm_le (f : C(AddCircle τ,ℂ)) {z : ℂ} (hz : z ∈ ball 0 1) : + ‖poissonExtension f z‖ ≤ ‖f‖ := by + have ht : (0:ℝ) ≤ τ := le_of_lt (by positivity) + have hi := (poisson_angle_continuous f hz).intervalIntegrable (μ := volume) 0 τ + have hk := (poisson_angle_kernel_continuous hz).intervalIntegrable (μ := volume) 0 τ + rw [poissonExtension,norm_smul,Real.norm_eq_abs,abs_of_nonneg (inv_nonneg.mpr ht)] + calc + _ ≤ τ⁻¹ * (∫ t : ℝ in 0..τ, ‖poissonKernel 0 z (circleMap 0 1 t) • f t‖) := + mul_le_mul_of_nonneg_left (intervalIntegral.norm_integral_le_integral_norm ht) (inv_nonneg.mpr ht) + _ ≤ τ⁻¹ * (∫ t : ℝ in 0..τ, poissonKernel 0 z (circleMap 0 1 t)*‖f‖) := by + apply mul_le_mul_of_nonneg_left _ (inv_nonneg.mpr ht) + apply intervalIntegral.integral_mono ht hi.norm (hk.mul_const ‖f‖) + intro t + simp only [norm_smul,Real.norm_eq_abs,abs_of_nonneg (poisson_angle_kernel_nonneg hz t)] + exact mul_le_mul_of_nonneg_left (f.norm_coe_le_norm _) (poisson_angle_kernel_nonneg hz t) + _ = ‖f‖ := by + rw [intervalIntegral.integral_mul_const,← mul_assoc,poisson_angle_mass hz,one_mul] + +lemma planePoisson_norm_le (f : C(AddCircle τ,ℂ)) {x : Plane} (hx : x ∈ disk) : + ‖planePoisson f x‖ ≤ ‖f‖ := by + have hz : complexIso.symm x ∈ ball (0:ℂ) 1 := by + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + exact (Complex.abs_re_le_norm _).trans (poissonExtension_norm_le f hz) + +lemma planePoisson_memLp (f : C(AddCircle τ,ℂ)) : + MemLp (planePoisson f) 2 (volume.restrict disk) := by + let : IsFiniteMeasure (volume.restrict (ball (0:Plane) 1)) := + isFiniteMeasure_restrict.mpr (isBounded_ball (x := (0:Plane)) (r := 1)).measure_lt_top.ne + apply MemLp.of_bound ((planePoisson_contDiffOn f).continuousOn.aestronglyMeasurable measurableSet_ball) ‖f‖ + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + exact planePoisson_norm_le f hx + +lemma circleSmooth_sup_norm_le (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) : + ‖circleSmooth φ f‖ ≤ ‖f‖ := + (ContinuousMap.norm_le (circleSmooth φ f) (norm_nonneg _)).mpr (circleSmooth_norm_le φ f) + + + +theorem circleSmooth_planePoisson_tendsto_L2 {ι : Type*} {l : Filter ι} [l.IsCountablyGenerated] + {φ : ι → ContDiffBump (0:ℝ)} (hφ : Tendsto (fun i => (φ i).rOut) l (𝓝 0)) + (f : C(AddCircle τ,ℂ)) : + Tendsto (fun i => (planePoisson_memLp (circleSmooth (φ i) f)).toLp + (planePoisson (circleSmooth (φ i) f))) l + (𝓝 ((planePoisson_memLp f).toLp (planePoisson f))) := by + let : IsFiniteMeasure (volume.restrict (ball (0:Plane) 1)) := + isFiniteMeasure_restrict.mpr (isBounded_ball (x := (0:Plane)) (r := 1)).measure_lt_top.ne + apply L2Limits.tendsto_toLp_of_dominated (fun i => planePoisson_memLp (circleSmooth (φ i) f)) + (planePoisson_memLp f) (memLp_const (‖f‖ : ℝ)) + · exact Eventually.of_forall fun i => (ae_restrict_mem measurableSet_ball).mono fun x hx => + (planePoisson_norm_le (circleSmooth (φ i) f) hx).trans (circleSmooth_sup_norm_le (φ i) f) + · filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + have hz : complexIso.symm x ∈ ball (0:ℂ) 1 := by + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + exact Complex.continuous_re.continuousAt.tendsto.comp (circleSmooth_poisson_tendsto hφ f hz) + +end StrictHotSpots.Douglas +end +end PoissonBounds + +section SmoothPoissonH1 + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff InnerProductSpace +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma poissonExtension_sub (f g : C(AddCircle τ,ℂ)) {z : ℂ} (hz : z ∈ ball 0 1) : + poissonExtension (f-g) z = poissonExtension f z-poissonExtension g z := by + change τ⁻¹ • (∫ t in 0..τ, poissonKernel 0 z (circleMap 0 1 t) • (f t-g t)) = + τ⁻¹ • (∫ t in 0..τ, poissonKernel 0 z (circleMap 0 1 t) • f t) - + τ⁻¹ • (∫ t in 0..τ, poissonKernel 0 z (circleMap 0 1 t) • g t) + simp_rw [smul_sub] + rw [intervalIntegral.integral_sub ((poisson_angle_continuous f hz).intervalIntegrable _ _) + ((poisson_angle_continuous g hz).intervalIntegrable _ _),smul_sub] + +lemma planePoisson_sub (f g : C(AddCircle τ,ℂ)) {x : Plane} (hx : x ∈ disk) : + planePoisson (f-g) x = planePoisson f x-planePoisson g x := by + have hz : complexIso.symm x ∈ ball (0:ℂ) 1 := by + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + exact congrArg Complex.re (poissonExtension_sub f g hz) + +lemma planePoisson_eq_series (f : C(AddCircle τ,ℂ)) + (h0 : Summable (fun m => ‖fourierCoeff f m‖)) : + EqOn (planePoisson f) (planeSeries (fourierCoeff f)) disk := by + intro x hx + have hz : complexIso.symm x ∈ ball (0:ℂ) 1 := by + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + exact congrArg Complex.re (poissonExtension_eq_harmonicSeries f h0 hz) + + +lemma smooth_planePoisson_hasH1Gradient (f : C(AddCircle τ,ℂ)) + (hf : ContDiff ℝ ∞ (fun t : ℝ => f t)) : + HasH1Gradient disk (planePoisson f) (gradient (planePoisson f)) := by + have h1 := summable_firstMoment_of_smooth_lift f hf + have h0 := summable_norm_of_firstMoment h1 + have he := planePoisson_eq_series f h0 + apply (planeSeries_gradient h0 h1).congr + · filter_upwards [ae_restrict_mem (show MeasurableSet disk from measurableSet_ball)] with x hx + exact (he hx).symm + · filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + unfold gradient + rw [(he.eventuallyEq_of_mem (isOpen_ball.mem_nhds hx)).fderiv_eq] + + +def smoothPoissonH1 (f : C(AddCircle τ,ℂ)) + (hf : ContDiff ℝ ∞ (fun t : ℝ => f t)) : H1 disk := + (smooth_planePoisson_hasH1Gradient f hf).toH1 + +lemma smoothPoissonH1_value (f : C(AddCircle τ,ℂ)) + (hf : ContDiff ℝ ∞ (fun t : ℝ => f t)) : + H1.value (smoothPoissonH1 f hf) = (planePoisson_memLp f).toLp (planePoisson f) := rfl + +lemma smoothPoissonH1_sub (f g : C(AddCircle τ,ℂ)) + (hf : ContDiff ℝ ∞ (fun t : ℝ => f t)) + (hg : ContDiff ℝ ∞ (fun t : ℝ => g t)) : + smoothPoissonH1 (f-g) (hf.sub hg) = smoothPoissonH1 f hf-smoothPoissonH1 g hg := by + apply H1.value_injective (Ω := disk) isOpen_ball + rw [map_sub,smoothPoissonH1_value,smoothPoissonH1_value,smoothPoissonH1_value] + rw [← MemLp.toLp_sub] + apply Lp.ext + filter_upwards [(planePoisson_memLp (f-g)).coeFn_toLp, + ((planePoisson_memLp f).sub (planePoisson_memLp g)).coeFn_toLp, + ae_restrict_mem measurableSet_ball] with x h1 h2 hx + rw [h1,h2] + exact planePoisson_sub f g hx + +lemma lp_norm_sq_eq_integral_norm_sq {X E : Type*} [MeasurableSpace X] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] {μ : Measure X} + (u : Lp E 2 μ) : ‖u‖^2 = ∫ x, ‖u x‖^2 ∂μ := by + rw [← real_inner_self_eq_norm_sq,L2.inner_def] + simp only [real_inner_self_eq_norm_sq] + +lemma norm_toLp_sq_eq_integral_norm_sq {X E : Type*} [MeasurableSpace X] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] {μ : Measure X} + {u : X → E} (hu : MemLp u 2 μ) : + ‖hu.toLp u‖^2 = ∫ x, ‖u x‖^2 ∂μ := by + rw [lp_norm_sq_eq_integral_norm_sq] + exact integral_congr_ae (hu.coeFn_toLp.mono fun x hx => by dsimp only; rw [hx]) + + + +lemma smoothPoissonH1_grad_energy_le (f : C(AddCircle τ,ℂ)) + (hf : ContDiff ℝ ∞ (fun t : ℝ => f t)) : + ‖H1.grad (smoothPoissonH1 f hf)‖^2 ≤ diskEnergy (poissonExtension f) := by + have h1 := summable_firstMoment_of_smooth_lift f hf + have h0 := summable_norm_of_firstMoment h1 + have he := planePoisson_eq_series f h0 + change ‖(smooth_planePoisson_hasH1Gradient f hf).2.1.toLp _‖^2 ≤ _ + rw [norm_toLp_sq_eq_integral_norm_sq] + have hE : (∫ x : Plane in disk, ‖gradient (planePoisson f) x‖^2) = + ∫ x : Plane in disk, ‖gradient (planeSeries (fourierCoeff f)) x‖^2 := by + apply setIntegral_congr_fun measurableSet_ball + intro x hx + dsimp only + unfold gradient + rw [(he.eventuallyEq_of_mem (isOpen_ball.mem_nhds hx)).fderiv_eq] + rw [hE] + have hC : diskEnergy (poissonExtension f) = diskEnergy (harmonicSeries (fourierCoeff f)) := by + apply setIntegral_congr_fun measurableSet_ball + intro z hz + have he' : EqOn (poissonExtension f) (harmonicSeries (fourierCoeff f)) (ball 0 1) := + fun z hz => poissonExtension_eq_harmonicSeries f h0 hz + have hd := (he'.eventuallyEq_of_mem (isOpen_ball.mem_nhds hz)).fderiv_eq (𝕜:=ℝ) + dsimp only + rw [hd] + rw [hC] + exact planeSeries_energy_le h0 h1 + +end StrictHotSpots.Douglas +end +end SmoothPoissonH1 + +section SmoothWeakGradient + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal +namespace StrictHotSpots + + + + + +theorem HasH1Gradient.eq_gradient_of_contDiffOn {Ω : Set Plane} (ho : IsOpen Ω) + {v : Plane → ℝ} {g : Plane → Plane} (hg : HasH1Gradient Ω v g) + (hv : ContDiffOn ℝ ∞ v Ω) : + g =ᵐ[volume.restrict Ω] gradient v := by + have hgc : ContinuousOn (gradient v) Ω := + (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp_continuousOn + (hv.continuousOn_fderiv_of_isOpen ho (by simp)) + have hi (e : Plane) : ∀ᵐ x ∂volume.restrict Ω, inner ℝ (g x - gradient v x) e = 0 := by + have hgL := ((hg.2.1.inner_const (𝕜 := ℝ) e).locallyIntegrable + (by norm_num : (1 : ℝ≥0∞) ≤ 2)).locallyIntegrableOn Ω + have hkc : ContinuousOn (fun x => inner ℝ (gradient v x) e) Ω := + hgc.inner continuousOn_const + have hkL : LocallyIntegrableOn (fun x => inner ℝ (gradient v x) e) Ω + (volume.restrict Ω) := hkc.locallyIntegrableOn ho.measurableSet + have hl : LocallyIntegrableOn (fun x => inner ℝ (g x-gradient v x) e) Ω + (volume.restrict Ω) := by + have he : (fun x => inner ℝ (g x-gradient v x) e) = + (fun x => inner ℝ (g x) e) - (fun x => inner ℝ (gradient v x) e) := by + funext x + exact inner_sub_left _ _ _ + rw [he] + exact hgL.sub hkL + have ht := ho.ae_eq_zero_of_integral_contDiff_smul_eq_zero + (μ := volume.restrict Ω) hl + (fun φ hφ hc hs => show (∫ x in Ω, φ x • inner ℝ (g x-gradient v x) e) = 0 from by + have hgφ := hg.2.2 φ hφ hc hs e + have hkφ := integral_mul_test_fderiv ho hv hφ hc hs e + have hgi : Integrable (fun x => inner ℝ (g x) e * φ x) (volume.restrict Ω) := + (hg.2.1.inner_const e).integrable_mul (test_memLp hφ hc) + have hki : Integrable (fun x => inner ℝ (gradient v x) e * φ x) (volume.restrict Ω) := + (integrable_mul_test ho hkc hφ.continuous hc hs).restrict + simp only [smul_eq_mul, inner_sub_left, mul_sub] + rw [integral_sub (by simpa [Pi.mul_apply, mul_comm] using hgi) + (by simpa [Pi.mul_apply, mul_comm] using hki)] + simp_rw [mul_comm (φ _)] + simp only [inner_gradient_left] at * + linarith) + filter_upwards [ht, ae_restrict_mem ho.measurableSet] with x hx hxΩ + exact hx hxΩ + have hb : ∀ᵐ x ∂volume.restrict Ω, ∀ i : Fin 2, + inner ℝ (g x-gradient v x) (EuclideanSpace.basisFun (Fin 2) ℝ i) = 0 := + ae_all_iff.mpr fun i => hi _ + filter_upwards [hb] with x hx + have hz : g x-gradient v x = 0 := by + ext i + simpa [EuclideanSpace.basisFun_apply, EuclideanSpace.inner_single_right] using hx i + exact sub_eq_zero.mp hz + +lemma HasH1Gradient.actual_of_contDiffOn {Ω : Set Plane} (ho : IsOpen Ω) + {v : Plane → ℝ} {g : Plane → Plane} (hg : HasH1Gradient Ω v g) + (hv : ContDiffOn ℝ ∞ v Ω) : HasH1Gradient Ω v (gradient v) := + hg.congr (Filter.EventuallyEq.refl _ _) (hg.eq_gradient_of_contDiffOn ho hv) + +end StrictHotSpots +end +end SmoothWeakGradient + +section LipschitzPoissonH1 + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff InnerProductSpace +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma cauchySeq_of_pair_norm_sq_zero {E : Type*} [NormedAddCommGroup E] {u : ℕ → E} + (hu : Tendsto (fun p : ℕ × ℕ => ‖u p.1-u p.2‖^2) (atTop ×ˢ atTop) (𝓝 0)) : + CauchySeq u := by + have ht : Tendsto (fun p : ℕ × ℕ => ‖u p.1-u p.2‖) (atTop ×ˢ atTop) (𝓝 0) := by + simpa only [Function.comp_def,Real.sqrt_sq (norm_nonneg _),Real.sqrt_zero] using + Real.continuous_sqrt.continuousAt.tendsto.comp hu + apply Metric.cauchySeq_iff.mpr + intro ε hε + have h := ht.eventually (gt_mem_nhds hε) + rw [prod_atTop_atTop_eq] at h + obtain ⟨⟨N,M⟩,hNM⟩ := eventually_atTop.mp h + refine ⟨max N M,fun n hn m hm => ?_⟩ + rw [dist_eq_norm] + exact hNM (n,m) ⟨le_trans (le_max_left _ _) hn,le_trans (le_max_right _ _) hm⟩ + + + +theorem circleSmooth_cauchy_H1 {φ : ℕ → ContDiffBump (0:ℝ)} + (hφ : Tendsto (fun i => (φ i).rOut) atTop (𝓝 0)) + (f : C(AddCircle τ,ℂ)) {K : ℝ} (hK : 0 ≤ K) (h : ChordLipschitz K f) : + CauchySeq (fun i => smoothPoissonH1 (circleSmooth (φ i) f) (angleSmooth_smooth (φ i) f)) := by + let u := fun i => smoothPoissonH1 (circleSmooth (φ i) f) (angleSmooth_smooth (φ i) f) + have hv : Tendsto (fun i => H1.value (u i)) atTop + (𝓝 ((planePoisson_memLp f).toLp (planePoisson f))) := by + change Tendsto (fun i => (planePoisson_memLp (circleSmooth (φ i) f)).toLp + (planePoisson (circleSmooth (φ i) f))) atTop _ + exact circleSmooth_planePoisson_tendsto_L2 hφ f + have hv0 : Tendsto (fun p : ℕ × ℕ => ‖H1.value (u p.1)-H1.value (u p.2)‖^2) + (atTop ×ˢ atTop) (𝓝 0) := by + simpa only [Function.comp_def,sub_self,norm_zero,zero_pow (by norm_num : (2:ℕ) ≠ 0)] using + ((hv.comp tendsto_fst).sub (hv.comp tendsto_snd)).norm.pow 2 + have hg0 : Tendsto (fun p : ℕ × ℕ => ‖H1.grad (u p.1-u p.2)‖^2) + (atTop ×ˢ atTop) (𝓝 0) := by + apply squeeze_zero (fun _ => sq_nonneg _) _ (circleSmooth_poisson_cauchy hφ f hK h) + intro p + rw [show u p.1-u p.2 = smoothPoissonH1 + (circleSmooth (φ p.1) f-circleSmooth (φ p.2) f) + ((angleSmooth_smooth (φ p.1) f).sub (angleSmooth_smooth (φ p.2) f)) from + (smoothPoissonH1_sub _ _ _ _).symm] + exact smoothPoissonH1_grad_energy_le _ _ + apply cauchySeq_of_pair_norm_sq_zero + have hs := hv0.add hg0 + simpa only [H1.norm_sq,map_sub,add_zero] using hs + + + + +theorem hasH1Gradient_of_circleSmooth {φ : ℕ → ContDiffBump (0:ℝ)} + (hφ : Tendsto (fun i => (φ i).rOut) atTop (𝓝 0)) + (f : C(AddCircle τ,ℂ)) {K : ℝ} (hK : 0 ≤ K) (h : ChordLipschitz K f) : + HasH1Gradient disk (planePoisson f) (gradient (planePoisson f)) := by + obtain ⟨u,hu⟩ := cauchySeq_tendsto_of_complete (circleSmooth_cauchy_H1 hφ f hK h) + have hv : H1.value u = (planePoisson_memLp f).toLp (planePoisson f) := by + apply tendsto_nhds_unique (H1.value.continuous.continuousAt.tendsto.comp hu) + change Tendsto (fun i => (planePoisson_memLp (circleSmooth (φ i) f)).toLp + (planePoisson (circleSmooth (φ i) f))) atTop _ + exact circleSmooth_planePoisson_tendsto_L2 hφ f + have hw : HasH1Gradient disk (planePoisson f) (H1.grad u) := by + apply (H1.hasH1Gradient u).congr _ (Filter.EventuallyEq.refl _ _) + rw [hv] + exact (planePoisson_memLp f).coeFn_toLp + exact hw.actual_of_contDiffOn isOpen_ball (planePoisson_contDiffOn f) + + + +def circleApproxBump (n : ℕ) : ContDiffBump (0:ℝ) where + rIn := (2*((n:ℝ)+1))⁻¹ + rOut := ((n:ℝ)+1)⁻¹ + rIn_pos := by positivity + rIn_lt_rOut := by + apply inv_strictAnti₀ (by positivity) + nlinarith [Nat.cast_nonneg (α:=ℝ) n] + +lemma circleApproxBump_rOut_tendsto : + Tendsto (fun n => (circleApproxBump n).rOut) atTop (𝓝 0) := by + exact tendsto_inv_atTop_zero.comp (tendsto_atTop_add_const_right atTop 1 tendsto_natCast_atTop_atTop) + + +theorem lipschitz_planePoisson_hasH1Gradient (f : C(AddCircle τ,ℂ)) + {K : ℝ} (hK : 0 ≤ K) (h : ChordLipschitz K f) : + HasH1Gradient disk (planePoisson f) (gradient (planePoisson f)) := + hasH1Gradient_of_circleSmooth circleApproxBump_rOut_tendsto f hK h + +end StrictHotSpots.Douglas +end +end LipschitzPoissonH1 + +section PoissonComponents + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff InnerProductSpace Convolution +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + + +theorem circleSmooth_tendsto_H1 {φ : ℕ → ContDiffBump (0:ℝ)} + (hφ : Tendsto (fun i => (φ i).rOut) atTop (𝓝 0)) + (f : C(AddCircle τ,ℂ)) {K : ℝ} (hK : 0 ≤ K) (h : ChordLipschitz K f) : + Tendsto (fun i => smoothPoissonH1 (circleSmooth (φ i) f) (angleSmooth_smooth (φ i) f)) + atTop (𝓝 (lipschitz_planePoisson_hasH1Gradient f hK h).toH1) := by + obtain ⟨u,hu⟩ := cauchySeq_tendsto_of_complete (circleSmooth_cauchy_H1 hφ f hK h) + have he : u = (lipschitz_planePoisson_hasH1Gradient f hK h).toH1 := by + apply H1.value_injective (Ω:=disk) isOpen_ball + change H1.value u = (planePoisson_memLp f).toLp (planePoisson f) + apply tendsto_nhds_unique (H1.value.continuous.continuousAt.tendsto.comp hu) + change Tendsto (fun i => (planePoisson_memLp (circleSmooth (φ i) f)).toLp + (planePoisson (circleSmooth (φ i) f))) atTop _ + exact circleSmooth_planePoisson_tendsto_L2 hφ f + simpa only [he] using hu + +def poissonRealEnergy (f : C(AddCircle τ,ℂ)) : ℝ := + ∫ x : Plane in disk, ‖gradient (planePoisson f) x‖^2 + +lemma smoothPoissonH1_grad_norm_sq (f : C(AddCircle τ,ℂ)) + (hf : ContDiff ℝ ∞ (fun t : ℝ => f t)) : + ‖H1.grad (smoothPoissonH1 f hf)‖^2 = poissonRealEnergy f := + norm_toLp_sq_eq_integral_norm_sq (smooth_planePoisson_hasH1Gradient f hf).2.1 + +lemma lipschitzPoissonH1_grad_norm_sq (f : C(AddCircle τ,ℂ)) + {K : ℝ} (hK : 0 ≤ K) (h : ChordLipschitz K f) : + ‖H1.grad (lipschitz_planePoisson_hasH1Gradient f hK h).toH1‖^2 = poissonRealEnergy f := + norm_toLp_sq_eq_integral_norm_sq (lipschitz_planePoisson_hasH1Gradient f hK h).2.1 + +lemma circleSmooth_realEnergy_tendsto {φ : ℕ → ContDiffBump (0:ℝ)} + (hφ : Tendsto (fun i => (φ i).rOut) atTop (𝓝 0)) + (f : C(AddCircle τ,ℂ)) {K : ℝ} (hK : 0 ≤ K) (h : ChordLipschitz K f) : + Tendsto (fun i => poissonRealEnergy (circleSmooth (φ i) f)) atTop + (𝓝 (poissonRealEnergy f)) := by + have ht := (H1.grad.continuous.continuousAt.tendsto.comp (circleSmooth_tendsto_H1 hφ f hK h)).norm.pow 2 + convert ht using 1 + · funext i + exact (smoothPoissonH1_grad_norm_sq _ _).symm + · exact congrArg nhds (lipschitzPoissonH1_grad_norm_sq f hK h).symm + +lemma poissonExtension_smul (c : ℂ) (f : C(AddCircle τ,ℂ)) (z : ℂ) : + poissonExtension (c • f : C(AddCircle τ,ℂ)) z = c • poissonExtension f z := by + change τ⁻¹ • (∫ t in 0..τ, poissonKernel 0 z (circleMap 0 1 t) • (c • f t)) = + c • (τ⁻¹ • (∫ t in 0..τ, poissonKernel 0 z (circleMap 0 1 t) • f t)) + simp_rw [smul_comm _ c] + rw [intervalIntegral.integral_smul,smul_comm] + +lemma circleSmooth_smul (φ : ContDiffBump (0:ℝ)) (c : ℂ) (f : C(AddCircle τ,ℂ)) : + circleSmooth φ (c • f) = c • circleSmooth φ f := by + ext s + induction s using QuotientAddGroup.induction_on with | H t => + change (∫ u : ℝ, φ.normed volume u • (c • f ((t-u:ℝ):AddCircle τ))) = + c • (∫ u : ℝ, φ.normed volume u • f ((t-u:ℝ):AddCircle τ)) + simp_rw [smul_comm _ c] + rw [integral_smul] + + + +def imagDatum (f : C(AddCircle τ,ℂ)) : C(AddCircle τ,ℂ) := (-Complex.I) • f + +lemma imagDatum_chordLipschitz (f : C(AddCircle τ,ℂ)) {K : ℝ} (h : ChordLipschitz K f) : + ChordLipschitz K (imagDatum f) := by + intro s t + change ‖(-Complex.I) • f s-(-Complex.I) • f t‖ ≤ _ + simpa only [← smul_sub,norm_smul,norm_neg,Complex.norm_I,one_mul] using h s t + +lemma planePoisson_imagDatum (f : C(AddCircle τ,ℂ)) (x : Plane) : + planePoisson (imagDatum f) x = (poissonExtension f (complexIso.symm x)).im := by + unfold planePoisson imagDatum + rw [poissonExtension_smul] + simp only [smul_eq_mul,Complex.mul_re,Complex.neg_re,Complex.I_re, + Complex.I_im,zero_mul,neg_mul,one_mul,zero_sub,neg_neg] + +lemma circleSmooth_imagDatum (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) : + circleSmooth φ (imagDatum f) = imagDatum (circleSmooth φ f) := + circleSmooth_smul φ (-Complex.I) f + +lemma poissonExtension_im_eq (f : C(AddCircle τ,ℂ)) : + (fun z => (poissonExtension f z).im) = (fun z => (poissonExtension (imagDatum f) z).re) := by + funext z + have h := planePoisson_imagDatum f (complexIso z) + simpa only [planePoisson,LinearIsometryEquiv.symm_apply_apply] using h.symm + +lemma poissonExtension_contDiffOn (f : C(AddCircle τ,ℂ)) : + ContDiffOn ℝ ∞ (poissonExtension f) (ball 0 1) := by + have hr := poissonExtension_re_contDiffOn f + have hi : ContDiffOn ℝ ∞ (fun z => (poissonExtension f z).im) (ball 0 1) := by + rw [poissonExtension_im_eq] + exact poissonExtension_re_contDiffOn (imagDatum f) + have hc := (Complex.ofRealCLM.contDiff.comp_contDiffOn hr).add + ((Complex.ofRealCLM.contDiff.comp_contDiffOn hi).mul (contDiffOn_const (c:=Complex.I))) + exact hc.congr fun z _ => (Complex.re_add_im (poissonExtension f z)).symm + +end StrictHotSpots.Douglas +end +end PoissonComponents + +section DouglasLipschitzEnergy + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff InnerProductSpace +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma planeGradient_norm_sq (v : Plane → ℝ) (x : Plane) : + ‖gradient v x‖^2 = (fderiv ℝ v x (complexIso 1))^2+ + (fderiv ℝ v x (complexIso Complex.I))^2 := by + have he := (Complex.orthonormalBasisOneI.map complexIso).sum_inner_mul_inner + (gradient v x) (gradient v x) + simp only [Fin.sum_univ_two,OrthonormalBasis.map_apply,Complex.coe_orthonormalBasisOneI, + Matrix.cons_val_zero,Matrix.cons_val_one] at he + have hi (z : ℂ) : inner ℝ (gradient v x) (complexIso z) = fderiv ℝ v x (complexIso z) := + inner_gradient_left (f := v) (x := x) (y := complexIso z) + have hi' (z : ℂ) : inner ℝ (complexIso z) (gradient v x) = fderiv ℝ v x (complexIso z) := by + rw [real_inner_comm] + exact hi z + simp only [hi,hi',real_inner_self_eq_norm_sq,← sq] at he + exact he.symm + +lemma planePoisson_fderiv (f : C(AddCircle τ,ℂ)) {x : Plane} (hx : x ∈ disk) (v : ℂ) : + fderiv ℝ (planePoisson f) x (complexIso v) = + (fderiv ℝ (poissonExtension f) (complexIso.symm x) v).re := by + have hz : complexIso.symm x ∈ ball (0:ℂ) 1 := by + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + have hd := ((poissonExtension_contDiffOn f).differentiableOn (by simp)).differentiableAt + (isOpen_ball.mem_nhds hz) + have hh := (Complex.reCLM.hasFDerivAt.comp _ hd.hasFDerivAt).comp x + complexIso.symm.toContinuousLinearEquiv.hasFDerivAt + rw [show fderiv ℝ (planePoisson f) x = _ from hh.fderiv] + simp only [ContinuousLinearMap.comp_apply,ContinuousLinearEquiv.coe_coe, + LinearIsometryEquiv.coe_coe,LinearIsometryEquiv.symm_apply_apply,Complex.reCLM_apply] + +lemma planePoisson_im_fderiv (f : C(AddCircle τ,ℂ)) {x : Plane} (hx : x ∈ disk) (v : ℂ) : + fderiv ℝ (planePoisson (imagDatum f)) x (complexIso v) = + (fderiv ℝ (poissonExtension f) (complexIso.symm x) v).im := by + have hz : complexIso.symm x ∈ ball (0:ℂ) 1 := by + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + have hd := ((poissonExtension_contDiffOn f).differentiableOn (by simp)).differentiableAt + (isOpen_ball.mem_nhds hz) + have hh := (Complex.imCLM.hasFDerivAt.comp _ hd.hasFDerivAt).comp x + complexIso.symm.toContinuousLinearEquiv.hasFDerivAt + have he : planePoisson (imagDatum f) = fun y => (poissonExtension f (complexIso.symm y)).im := + funext (planePoisson_imagDatum f) + rw [he] + change fderiv ℝ ((Complex.imCLM ∘ poissonExtension f) ∘ complexIso.symm) x (complexIso v) = _ + rw [hh.fderiv] + simp only [ContinuousLinearMap.comp_apply,ContinuousLinearEquiv.coe_coe, + LinearIsometryEquiv.coe_coe,LinearIsometryEquiv.symm_apply_apply,Complex.imCLM_apply] + +lemma poisson_energy_pointwise (f : C(AddCircle τ,ℂ)) {x : Plane} (hx : x ∈ disk) : + ‖gradient (planePoisson f) x‖^2+‖gradient (planePoisson (imagDatum f)) x‖^2 = + ‖fderiv ℝ (poissonExtension f) (complexIso.symm x) 1‖^2+ + ‖fderiv ℝ (poissonExtension f) (complexIso.symm x) Complex.I‖^2 := by + rw [planeGradient_norm_sq,planeGradient_norm_sq, + planePoisson_fderiv f hx 1,planePoisson_fderiv f hx Complex.I, + planePoisson_im_fderiv f hx 1,planePoisson_im_fderiv f hx Complex.I] + simp only [← Complex.normSq_eq_norm_sq,Complex.normSq_apply] + ring + + + +theorem poisson_energy_components (f : C(AddCircle τ,ℂ)) + {K : ℝ} (hK : 0 ≤ K) (h : ChordLipschitz K f) : + diskEnergy (poissonExtension f) = poissonRealEnergy f+poissonRealEnergy (imagDatum f) := by + have hR := (lipschitz_planePoisson_hasH1Gradient f hK h).2.1 + have hI := (lipschitz_planePoisson_hasH1Gradient (imagDatum f) hK (imagDatum_chordLipschitz f h)).2.1 + have hiR := (memLp_two_iff_integrable_sq_norm hR.aestronglyMeasurable).mp hR + have hiI := (memLp_two_iff_integrable_sq_norm hI.aestronglyMeasurable).mp hI + unfold poissonRealEnergy + rw [← integral_add hiR hiI] + calc + _ = ∫ x : Plane in disk, + ‖fderiv ℝ (poissonExtension f) (complexIso.symm x) 1‖^2+ + ‖fderiv ℝ (poissonExtension f) (complexIso.symm x) Complex.I‖^2 := + (complexIso_disk_preserving.integral_comp complexIso.symm.toHomeomorph.measurableEmbedding + (fun z : ℂ => ‖fderiv ℝ (poissonExtension f) z 1‖^2+ + ‖fderiv ℝ (poissonExtension f) z Complex.I‖^2)).symm + _ = _ := by + apply setIntegral_congr_fun measurableSet_ball + intro x hx + exact (poisson_energy_pointwise f hx).symm + + + + +theorem douglas_lipschitz (f : C(AddCircle τ,ℂ)) {K : ℝ} + (hK : 0 ≤ K) (h : ChordLipschitz K f) : + diskEnergy (poissonExtension f) = (1/τ)*boundaryEnergy f := by + have hR := circleSmooth_realEnergy_tendsto circleApproxBump_rOut_tendsto f hK h + have hI := circleSmooth_realEnergy_tendsto circleApproxBump_rOut_tendsto + (imagDatum f) hK (imagDatum_chordLipschitz f h) + have hsum : Tendsto (fun i => diskEnergy (poissonExtension (circleSmooth (circleApproxBump i) f))) + atTop (𝓝 (diskEnergy (poissonExtension f))) := by + rw [poisson_energy_components f hK h] + have ht := hR.add hI + convert ht using 1 + funext i + rw [poisson_energy_components _ hK (circleSmooth_chordLipschitz (circleApproxBump i) f h), + circleSmooth_imagDatum] + exact tendsto_nhds_unique hsum (smooth_poisson_energy_tendsto circleApproxBump_rOut_tendsto f hK h) + +end StrictHotSpots.Douglas +end +end DouglasLipschitzEnergy + +section PoissonBoundaryContinuous + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff InnerProductSpace +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma chordLipschitz_equicontinuous {ι : Type*} (F : ι → C(AddCircle τ,ℂ)) + {K : ℝ} (hK : 0 ≤ K) (h : ∀ i, ChordLipschitz K (F i)) : + Equicontinuous (fun i => (F i : AddCircle τ → ℂ)) := by + intro s + rw [Metric.equicontinuousAt_iff_right] + intro ε hε + have hc : Continuous (fun t : AddCircle τ => ‖(t.toCircle:ℂ)-(s.toCircle:ℂ)‖) := by + fun_prop + have he : ∀ᶠ t in 𝓝 s, ‖(t.toCircle:ℂ)-(s.toCircle:ℂ)‖ < ε/(K+1) := + hc.continuousAt.preimage_mem_nhds (Iio_mem_nhds (by simp; positivity)) + filter_upwards [he] with t ht i + rw [dist_comm,dist_eq_norm] + calc + _ ≤ K*‖(t.toCircle:ℂ)-(s.toCircle:ℂ)‖ := h i t s + _ ≤ (K+1)*‖(t.toCircle:ℂ)-(s.toCircle:ℂ)‖ := + mul_le_mul_of_nonneg_right (by linarith) (norm_nonneg _) + _ < ε := by nlinarith [(lt_div_iff₀ (by linarith : 0 < K+1)).mp ht] + +lemma circleSmooth_tendsto_uniform {ι : Type*} {l : Filter ι} + {φ : ι → ContDiffBump (0:ℝ)} (hφ : Tendsto (fun i => (φ i).rOut) l (𝓝 0)) + (f : C(AddCircle τ,ℂ)) {K : ℝ} (hK : 0 ≤ K) (h : ChordLipschitz K f) : + Tendsto (fun i => circleSmooth (φ i) f) l (𝓝 f) := by + have he := chordLipschitz_equicontinuous (fun i => circleSmooth (φ i) f) hK + (fun i => circleSmooth_chordLipschitz (φ i) f h) + have ht := (he.tendsto_uniformFun_iff_pi l f).mpr + (tendsto_pi_nhds.mpr (fun s => circleSmooth_tendsto hφ f s)) + exact ContinuousMap.tendsto_iff_tendstoUniformly.mpr + (UniformFun.tendsto_iff_tendstoUniformly.mp ht) + + + + +def closedPoisson (f : C(AddCircle τ,ℂ)) (z : ℂ) : ℂ := by + classical + exact if z ∈ ball 0 1 then poissonExtension f z else circleDatum f z + +lemma closedPoisson_interior (f : C(AddCircle τ,ℂ)) {z : ℂ} (hz : z ∈ ball 0 1) : + closedPoisson f z = poissonExtension f z := by + classical + exact ite_eq_left hz + +lemma closedPoisson_boundary (f : C(AddCircle τ,ℂ)) (s : AddCircle τ) : + closedPoisson f s.toCircle = f s := by + classical + rw [closedPoisson,ite_eq_right (by simp only [mem_ball_zero_iff,Circle.norm_coe,lt_self_iff_false,not_false_eq_true]),circleDatum_toCircle] + +lemma exists_toCircle {z : ℂ} (hz : z ∈ sphere 0 1) : + ∃ s : AddCircle τ, (s.toCircle:ℂ) = z := by + obtain ⟨s,hs⟩ := (AddCircle.homeomorphCircle (by positivity : τ ≠ 0)).surjective ⟨z,hz⟩ + refine ⟨s,?_⟩ + have he := congrArg (fun c : Circle => (c:ℂ)) hs + simpa only [AddCircle.homeomorphCircle_apply] using he + +lemma smooth_closedPoisson_continuousOn (f : C(AddCircle τ,ℂ)) + (hf : ContDiff ℝ ∞ (fun t : ℝ => f t)) : + ContinuousOn (closedPoisson f) (closedBall 0 1) := by + have h0 := summable_norm_of_firstMoment (summable_firstMoment_of_smooth_lift f hf) + apply (harmonicSeries_continuousOn h0).congr + intro z hz + by_cases hi : z ∈ ball 0 1 + · exact (closedPoisson_interior f hi).trans (poissonExtension_eq_harmonicSeries f h0 hi) + · have hs : z ∈ sphere 0 1 := by + simp only [mem_ball_zero_iff,not_lt] at hi + simp only [mem_closedBall_zero_iff] at hz + exact mem_sphere_zero_iff_norm.mpr (le_antisymm hz hi) + obtain ⟨s,rfl⟩ := exists_toCircle hs + rw [closedPoisson_boundary,harmonicSeries_fourier_boundary f h0] + +lemma closedPoisson_sub (f g : C(AddCircle τ,ℂ)) (z : ℂ) : + closedPoisson (f-g) z = closedPoisson f z-closedPoisson g z := by + classical + by_cases hi : z ∈ ball 0 1 + · simp only [closedPoisson,ite_eq_left hi] + exact poissonExtension_sub f g hi + · simp only [closedPoisson,ite_eq_right hi,circleDatum] + split_ifs <;> simp + +lemma closedPoisson_norm_le (f : C(AddCircle τ,ℂ)) (z : ℂ) : + ‖closedPoisson f z‖ ≤ ‖f‖ := by + classical + by_cases hi : z ∈ ball 0 1 + · rw [closedPoisson_interior f hi] + exact poissonExtension_norm_le f hi + · simp only [closedPoisson,ite_eq_right hi,circleDatum] + split_ifs + · exact f.norm_coe_le_norm _ + · simp + + + +theorem closedPoisson_continuousOn (f : C(AddCircle τ,ℂ)) {K : ℝ} + (hK : 0 ≤ K) (h : ChordLipschitz K f) : + ContinuousOn (closedPoisson f) (closedBall 0 1) := by + have ht := ((circleSmooth_tendsto_uniform circleApproxBump_rOut_tendsto f hK h).sub + (tendsto_const_nhds (x:=f))).norm + have hzero : Tendsto (fun n : ℕ => ‖circleSmooth (circleApproxBump n) f-f‖) atTop (𝓝 0) := by + simpa only [sub_self,norm_zero] using ht + have hu : TendstoUniformlyOn (fun n : ℕ => closedPoisson (circleSmooth (circleApproxBump n) f)) + (closedPoisson f) atTop (closedBall 0 1) := by + rw [Metric.tendstoUniformlyOn_iff] + intro ε hε + filter_upwards [hzero.eventually (Iio_mem_nhds hε)] with n hn z _ + rw [dist_comm,dist_eq_norm,← closedPoisson_sub] + exact (closedPoisson_norm_le _ z).trans_lt hn + apply hu.continuousOn + exact Eventually.frequently (Eventually.of_forall fun n => + smooth_closedPoisson_continuousOn _ (angleSmooth_smooth (circleApproxBump n) f)) + +end StrictHotSpots.Douglas +end +end PoissonBoundaryContinuous + +section DouglasLipschitzBilinear + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff InnerProductSpace +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma poissonExtension_im_zero (f : C(AddCircle τ,ℂ)) (hr : ∀ s, (f s).im = 0) + {z : ℂ} (hz : z ∈ ball 0 1) : (poissonExtension f z).im = 0 := by + have hi := (poisson_angle_continuous f hz).intervalIntegrable (μ:=volume) 0 τ + unfold poissonExtension + rw [Complex.smul_im] + change τ⁻¹ • Complex.imCLM (∫ t in 0..τ, poissonKernel 0 z (circleMap 0 1 t) • f t) = 0 + rw [← Complex.imCLM.intervalIntegral_comp_comm hi] + simp only [Complex.imCLM_apply,Complex.smul_im,hr,smul_zero,intervalIntegral.integral_zero] + +lemma poissonRealEnergy_imag_zero (f : C(AddCircle τ,ℂ)) (hr : ∀ s, (f s).im = 0) : + poissonRealEnergy (imagDatum f) = 0 := by + have he : EqOn (planePoisson (imagDatum f)) (fun _ => 0) disk := by + intro x hx + rw [planePoisson_imagDatum] + apply poissonExtension_im_zero f hr + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + calc + _ = ∫ _ : Plane in disk, (0:ℝ) := by + apply setIntegral_congr_fun measurableSet_ball + intro x hx + dsimp only + unfold gradient + rw [(he.eventuallyEq_of_mem (isOpen_ball.mem_nhds hx)).fderiv_eq] + simp + _ = 0 := by simp + + +theorem douglas_lipschitz_real (f : C(AddCircle τ,ℂ)) {K : ℝ} + (hK : 0 ≤ K) (h : ChordLipschitz K f) (hr : ∀ s, (f s).im = 0) : + poissonRealEnergy f = (1/τ)*boundaryEnergy f := by + have he := douglas_lipschitz f hK h + rw [poisson_energy_components f hK h,poissonRealEnergy_imag_zero f hr,add_zero] at he + exact he + +lemma lipschitzPoissonH1_sub (f g : C(AddCircle τ,ℂ)) {K L : ℝ} + (hK : 0 ≤ K) (hf : ChordLipschitz K f) (hL : 0 ≤ L) (hg : ChordLipschitz L g) : + (lipschitz_planePoisson_hasH1Gradient (f-g) (add_nonneg hK hL) (chordLipschitz_sub hf hg)).toH1 = + (lipschitz_planePoisson_hasH1Gradient f hK hf).toH1- + (lipschitz_planePoisson_hasH1Gradient g hL hg).toH1 := by + apply H1.value_injective (Ω:=disk) isOpen_ball + rw [map_sub,H1.value_toH1,H1.value_toH1,H1.value_toH1] + rw [← MemLp.toLp_sub] + apply Lp.ext + filter_upwards [(planePoisson_memLp (f-g)).coeFn_toLp, + ((planePoisson_memLp f).sub (planePoisson_memLp g)).coeFn_toLp, + ae_restrict_mem measurableSet_ball] with x h1 h2 hx + rw [h1,h2] + exact planePoisson_sub f g hx + +lemma boundaryDifference_sub (f g : AddCircle τ → ℂ) (p : AddCircle τ × AddCircle τ) : + boundaryDifference (f-g) p = boundaryDifference f p-boundaryDifference g p := by + simp only [boundaryDifference,Pi.sub_apply] + ring + +def boundaryRealCross (f g : AddCircle τ → ℂ) : ℝ := + ∫ p : AddCircle τ × AddCircle τ, inner ℝ (boundaryDifference f p) (boundaryDifference g p) + +lemma boundaryRealCross_integrable (f g : C(AddCircle τ,ℂ)) {K L : ℝ} + (hK : 0 ≤ K) (hf : ChordLipschitz K f) (hL : 0 ≤ L) (hg : ChordLipschitz L g) : + Integrable (fun p : AddCircle τ × AddCircle τ => + inner ℝ (boundaryDifference f p) (boundaryDifference g p)) := by + apply Integrable.of_bound ((measurable_boundaryDifference f.continuous).inner + (measurable_boundaryDifference g.continuous)).aestronglyMeasurable (K*L) + exact ae_of_all _ fun p => (norm_inner_le_norm _ _).trans + (mul_le_mul (boundaryDifference_bound hK hf p) (boundaryDifference_bound hL hg p) + (norm_nonneg _) hK) + +lemma boundaryEnergy_sub (f g : C(AddCircle τ,ℂ)) {K L : ℝ} + (hK : 0 ≤ K) (hf : ChordLipschitz K f) (hL : 0 ≤ L) (hg : ChordLipschitz L g) : + boundaryEnergy (f-g : C(AddCircle τ,ℂ)) = boundaryEnergy f- + 2*boundaryRealCross f g+boundaryEnergy g := by + have hiF := integrable_boundaryDifference_sq hK f.continuous hf + have hiG := integrable_boundaryDifference_sq hL g.continuous hg + have hi := boundaryRealCross_integrable f g hK hf hL hg + unfold boundaryEnergy boundaryRealCross + change (∫ p : AddCircle τ × AddCircle τ, + ‖boundaryDifference ((f : AddCircle τ → ℂ)-(g : AddCircle τ → ℂ)) p‖^2) = _ + simp_rw [boundaryDifference_sub,norm_sub_sq_real] + have he := integral_add (hiF.sub (hi.const_mul 2)) hiG + have hs := integral_sub hiF (hi.const_mul 2) + simp only [Pi.sub_apply] at he hs + rw [he,hs,integral_const_mul] + +lemma lipschitzPoisson_grad_sub_norm_sq (f g : C(AddCircle τ,ℂ)) {K L : ℝ} + (hK : 0 ≤ K) (hf : ChordLipschitz K f) (hL : 0 ≤ L) (hg : ChordLipschitz L g) : + ‖H1.grad (lipschitz_planePoisson_hasH1Gradient f hK hf).toH1- + H1.grad (lipschitz_planePoisson_hasH1Gradient g hL hg).toH1‖^2 = poissonRealEnergy (f-g) := by + rw [← H1.grad.map_sub,← lipschitzPoissonH1_sub f g hK hf hL hg] + exact lipschitzPoissonH1_grad_norm_sq (f-g) (add_nonneg hK hL) (chordLipschitz_sub hf hg) + +lemma inner_eq_of_polarization {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (A B : E) (c x y z w : ℝ) (hA : ‖A‖^2 = c*x) (hB : ‖B‖^2 = c*y) + (hD : ‖A-B‖^2 = c*z) (hb : z = x-2*w+y) : inner ℝ A B = c*w := by + have he := norm_sub_sq_real A B + rw [hA,hB,hD,hb] at he + nlinarith only [he] + +lemma lipschitzPoisson_grad_norm_sq_real (f : C(AddCircle τ,ℂ)) {K : ℝ} + (hK : 0 ≤ K) (hf : ChordLipschitz K f) (hrf : ∀ s, (f s).im = 0) : + ‖H1.grad (lipschitz_planePoisson_hasH1Gradient f hK hf).toH1‖^2 = (1/τ)*boundaryEnergy f := + (lipschitzPoissonH1_grad_norm_sq f hK hf).trans (douglas_lipschitz_real f hK hf hrf) + +lemma lipschitzPoisson_grad_sub_norm_sq_real (f g : C(AddCircle τ,ℂ)) {K L : ℝ} + (hK : 0 ≤ K) (hf : ChordLipschitz K f) (hL : 0 ≤ L) (hg : ChordLipschitz L g) + (hrf : ∀ s, (f s).im = 0) (hrg : ∀ s, (g s).im = 0) : + ‖H1.grad (lipschitz_planePoisson_hasH1Gradient f hK hf).toH1- + H1.grad (lipschitz_planePoisson_hasH1Gradient g hL hg).toH1‖^2 = + (1/τ)*boundaryEnergy (f-g : C(AddCircle τ,ℂ)) := by + have hrd : ∀ s, ((f-g) s).im = 0 := by + intro s + simp only [ContinuousMap.sub_apply,Complex.sub_im,hrf,hrg,sub_zero] + exact (lipschitzPoisson_grad_sub_norm_sq f g hK hf hL hg).trans + (douglas_lipschitz_real (f-g) (add_nonneg hK hL) (chordLipschitz_sub hf hg) hrd) + + + +theorem douglas_lipschitz_bilinear (f g : C(AddCircle τ,ℂ)) {K L : ℝ} + (hK : 0 ≤ K) (hf : ChordLipschitz K f) (hL : 0 ≤ L) (hg : ChordLipschitz L g) + (hrf : ∀ s, (f s).im = 0) (hrg : ∀ s, (g s).im = 0) : + inner ℝ (H1.grad (lipschitz_planePoisson_hasH1Gradient f hK hf).toH1) + (H1.grad (lipschitz_planePoisson_hasH1Gradient g hL hg).toH1) = + (1/τ)*boundaryRealCross f g := by + exact inner_eq_of_polarization _ _ (1/τ) (boundaryEnergy f) (boundaryEnergy g) + (boundaryEnergy (f-g : C(AddCircle τ,ℂ))) (boundaryRealCross f g) + (lipschitzPoisson_grad_norm_sq_real f hK hf hrf) + (lipschitzPoisson_grad_norm_sq_real g hL hg hrg) + (lipschitzPoisson_grad_sub_norm_sq_real f g hK hf hL hg hrf hrg) + (boundaryEnergy_sub f g hK hf hL hg) + +end StrictHotSpots.Douglas +end +end DouglasLipschitzBilinear + +section LipschitzPoissonVariational + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ContDiff InnerProductSpace Laplacian +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 SubcriticalExtension +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma lipschitzPoisson_weak_harmonic (f : C(AddCircle τ,ℂ)) {K : ℝ} + (hK : 0 ≤ K) (h : ChordLipschitz K f) : + Harmonic (show IsOpen disk from isOpen_ball) (lipschitz_planePoisson_hasH1Gradient f hK h).toH1 := by + intro v + rw [H1.grad_toH1] + have hp : ∀ x ∈ disk, Laplacian.laplacian (planePoisson f) x = -(0:ℝ)*planePoisson f x := by + intro x hx + simpa using (planePoisson_harmonic f x hx).2.self_of_nhds + simpa using H10.helmholtz_pair (Ω:=disk) isOpen_ball (planePoisson_contDiffOn f) + (lipschitz_planePoisson_hasH1Gradient f hK h).1 + (lipschitz_planePoisson_hasH1Gradient f hK h).2.1 hp v + +def closedPlanePoisson (f : C(AddCircle τ,ℂ)) (x : Plane) : ℝ := + (closedPoisson f (complexIso.symm x)).re + +lemma closedPlanePoisson_eqOn (f : C(AddCircle τ,ℂ)) : + EqOn (closedPlanePoisson f) (planePoisson f) disk := by + intro x hx + exact congrArg Complex.re (closedPoisson_interior f + (by simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx)) + +lemma closedPlanePoisson_boundary (f : C(AddCircle τ,ℂ)) (s : AddCircle τ) : + closedPlanePoisson f (complexIso s.toCircle) = (f s).re := by + simp only [closedPlanePoisson,LinearIsometryEquiv.symm_apply_apply,closedPoisson_boundary] + +lemma closedPlanePoisson_contDiffOn (f : C(AddCircle τ,ℂ)) : + ContDiffOn ℝ ∞ (closedPlanePoisson f) disk := + (planePoisson_contDiffOn f).congr (closedPlanePoisson_eqOn f) + +lemma closedPlanePoisson_continuousOn (f : C(AddCircle τ,ℂ)) {K : ℝ} + (hK : 0 ≤ K) (h : ChordLipschitz K f) : + ContinuousOn (closedPlanePoisson f) (closure disk) := by + apply Complex.continuous_re.comp_continuousOn + apply (closedPoisson_continuousOn f hK h).comp complexIso.symm.continuous.continuousOn + intro x hx + simpa only [disk,closure_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0), + mem_closedBall_zero_iff,LinearIsometryEquiv.norm_map] using hx + +lemma closedPlanePoisson_hasH1Gradient (f : C(AddCircle τ,ℂ)) {K : ℝ} + (hK : 0 ≤ K) (h : ChordLipschitz K f) : + HasH1Gradient disk (closedPlanePoisson f) (gradient (closedPlanePoisson f)) := by + apply (lipschitz_planePoisson_hasH1Gradient f hK h).congr + · exact (ae_restrict_mem measurableSet_ball).mono (fun x hx => (closedPlanePoisson_eqOn f hx).symm) + · filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + unfold gradient + rw [((closedPlanePoisson_eqOn f).eventuallyEq_of_mem (isOpen_ball.mem_nhds hx)).fderiv_eq] + +lemma closedPlanePoisson_toH1 (f : C(AddCircle τ,ℂ)) {K : ℝ} + (hK : 0 ≤ K) (h : ChordLipschitz K f) : + (closedPlanePoisson_hasH1Gradient f hK h).toH1 = + (lipschitz_planePoisson_hasH1Gradient f hK h).toH1 := by + apply H1.value_injective (Ω:=disk) isOpen_ball + rw [H1.value_toH1,H1.value_toH1] + apply Lp.ext + filter_upwards [(closedPlanePoisson_hasH1Gradient f hK h).1.coeFn_toLp, + (lipschitz_planePoisson_hasH1Gradient f hK h).1.coeFn_toLp, + ae_restrict_mem measurableSet_ball] with x h1 h2 hx + rw [h1,h2] + exact closedPlanePoisson_eqOn f hx + + + + +theorem lipschitzPoisson_boundary_class (f : C(AddCircle τ,ℂ)) {K : ℝ} + (hK : 0 ≤ K) (h : ChordLipschitz K f) + {φ : Plane → ℝ} (hφ : ContDiffOn ℝ ∞ φ disk) + (hc : ContinuousOn φ (closure disk)) (hv : HasH1Gradient disk φ (gradient φ)) + (hb : ∀ s : AddCircle τ, φ (complexIso s.toCircle) = (f s).re) : + (lipschitz_planePoisson_hasH1Gradient f hK h).toH1-hv.toH1 ∈ + h10Submodule (show IsOpen disk from isOpen_ball) := by + let hu := closedPlanePoisson_hasH1Gradient f hK h + have hs := closedPlanePoisson_contDiffOn f + have hsub : HasH1Gradient disk (closedPlanePoisson f-φ) (gradient (closedPlanePoisson f-φ)) := by + apply (hu.sub hv).congr (ae_of_all _ (fun _ => rfl)) + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + simp only [gradient,Pi.sub_apply] + rw [fderiv_sub ((hs.contDiffAt (isOpen_ball.mem_nhds hx)).differentiableAt (by simp)) + ((hφ.contDiffAt (isOpen_ball.mem_nhds hx)).differentiableAt (by simp)),map_sub] + have hz : ∀ x ∈ frontier disk, (closedPlanePoisson f-φ) x = 0 := by + intro x hx + have hn : complexIso.symm x ∈ sphere (0:ℂ) 1 := by + simpa only [disk,frontier_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0), + mem_sphere_zero_iff_norm,LinearIsometryEquiv.norm_map] using hx + obtain ⟨s,hs⟩ := exists_toCircle hn + have hxc : complexIso s.toCircle = x := by rw [hs]; exact complexIso.apply_symm_apply x + rw [← hxc] + exact sub_eq_zero.mpr ((closedPlanePoisson_boundary f s).trans (hb s).symm) + have hm := interior_smooth_zero_trace_memH10 (Ω:=disk) isOpen_ball (hs.sub hφ) + ((closedPlanePoisson_continuousOn f hK h).sub hc) hsub isBounded_ball hz + have he : hu.toH1-hv.toH1 = hsub.toH1 := by + apply H1.value_injective (Ω:=disk) isOpen_ball + rw [map_sub,H1.value_toH1,H1.value_toH1,H1.value_toH1] + apply Lp.ext + filter_upwards [hu.1.coeFn_toLp,hv.1.coeFn_toLp,hsub.1.coeFn_toLp, + Lp.coeFn_sub (hu.1.toLp _) (hv.1.toLp _)] with x hux hvx hsx hdiff + rw [hdiff,Pi.sub_apply,hux,hvx,hsx] + rfl + rw [← he] at hm + change (closedPlanePoisson_hasH1Gradient f hK h).toH1-hv.toH1 ∈ _ at hm + rw [closedPlanePoisson_toH1 f hK h] at hm + exact hm + +theorem lipschitzPoisson_eq_harmonicLift (f : C(AddCircle τ,ℂ)) {K : ℝ} + (hK : 0 ≤ K) (h : ChordLipschitz K f) + {φ : Plane → ℝ} (hφ : ContDiffOn ℝ ∞ φ disk) + (hc : ContinuousOn φ (closure disk)) (hv : HasH1Gradient disk φ (gradient φ)) + (hb : ∀ s : AddCircle τ, φ (complexIso s.toCircle) = (f s).re) : + (lipschitz_planePoisson_hasH1Gradient f hK h).toH1 = + harmonicLift (show IsOpen disk from isOpen_ball) isBounded_ball hv.toH1 := by + apply harmonicLift_unique (Ω:=disk) isOpen_ball isBounded_ball _ _ + (lipschitzPoisson_weak_harmonic f hK h) + exact ⟨⟨_,lipschitzPoisson_boundary_class f hK h hφ hc hv hb⟩,rfl⟩ + +end StrictHotSpots.Douglas +end +end LipschitzPoissonVariational + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Eigenfunction.lean b/lean/OAI/Analysis/HotSpots/Eigenfunction.lean new file mode 100644 index 0000000000000000000000000000000000000000..abea352a50709b8323451ac757637043e811c743 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Eigenfunction.lean @@ -0,0 +1,1060 @@ +import OAI.Analysis.HotSpots.ClosedSolution + +namespace OAI + +section RadialHelmholtzUniqueness + + + + + +noncomputable section +open Set +namespace StrictHotSpots.Helmholtz + +lemma radial_ode_zero {f g : ℝ → ℂ} {a : ℂ} {R : ℝ} + (hR : 0 < R) (hsmall : ‖a‖*R^2 < 1) + (hf : ContinuousOn f (Icc 0 R)) (hg : ContinuousOn g (Icc 0 R)) + (hdf : ∀ r ∈ Icc 0 R, HasDerivAt f (g r) r) + (hprod : ∀ r ∈ Icc 0 R, + HasDerivAt (fun r : ℝ => (r:ℂ)*g r) (-(r:ℂ)*a*f r) r) + (hf0 : f 0=0) (hg0 : g 0=0) : ∀ r ∈ Icc 0 R, f r=0 := by + obtain ⟨x,hx,hmax⟩ := isCompact_Icc.exists_isMaxOn + (show (Icc (0:ℝ) R).Nonempty from ⟨0,le_rfl,hR.le⟩) hf.norm + let M := ‖f x‖ + have hM : 0 ≤ M := norm_nonneg _ + have hbound (t : ℝ) (ht : t ∈ Icc 0 R) : ‖f t‖ ≤ M := hmax ht + have hgbound (r : ℝ) (hr : r ∈ Icc 0 R) : ‖g r‖ ≤ ‖a‖*R*M := by + by_cases hr0 : r=0 + · rw [hr0,hg0,norm_zero] + positivity + have hrp : 0 < r := lt_of_le_of_ne hr.1 (Ne.symm hr0) + have hh := norm_image_sub_le_of_norm_deriv_right_le_segment + (f:=fun t : ℝ => (t:ℂ)*g t) (f':=fun t => -(t:ℂ)*a*f t) + (C:=‖a‖*r*M) (a:=0) (b:=r) + ((Complex.continuous_ofReal.continuousOn.mul hg).mono + (Icc_subset_Icc le_rfl hr.2)) + (fun t ht => (hprod t ⟨ht.1,ht.2.le.trans hr.2⟩).hasDerivWithinAt) + (fun t ht => by + rw [norm_mul,norm_mul,norm_neg,Complex.norm_real,Real.norm_of_nonneg ht.1] + calc + t*‖a‖*‖f t‖ ≤ r*‖a‖*M := by + exact mul_le_mul (mul_le_mul_of_nonneg_right ht.2.le (norm_nonneg _)) + (hbound t ⟨ht.1,ht.2.le.trans hr.2⟩) (norm_nonneg _) (by positivity) + _ = ‖a‖*r*M := by ring) + r ⟨hrp.le,le_rfl⟩ + simp only [Complex.ofReal_zero,zero_mul,sub_zero,norm_mul,Complex.norm_real, + Real.norm_of_nonneg hrp.le] at hh + have hgg : ‖g r‖ ≤ ‖a‖*r*M := by nlinarith + exact hgg.trans (mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hr.2 (norm_nonneg _)) hM) + have hh := norm_image_sub_le_of_norm_deriv_right_le_segment hf + (fun t ht => (hdf t (Ico_subset_Icc_self ht)).hasDerivWithinAt) + (fun t ht => hgbound t (Ico_subset_Icc_self ht)) x hx + rw [hf0,sub_zero,sub_zero] at hh + have hzero : M=0 := by + have hm : M ≤ (‖a‖*R^2)*M := by + calc + M ≤ (‖a‖*R*M)*x := hh + _ ≤ (‖a‖*R*M)*R := mul_le_mul_of_nonneg_left hx.2 (by positivity) + _ = (‖a‖*R^2)*M := by ring + nlinarith + intro r hr + exact norm_eq_zero.mp (le_antisymm ((hbound r hr).trans_eq hzero) (norm_nonneg _)) + +end StrictHotSpots.Helmholtz +end +end RadialHelmholtzUniqueness + +section ActualInteriorEigenSupport + + + +section HelmholtzCircleMeanActualInteriorLayer +noncomputable section +open Set MeasureTheory Metric _root_.Complex _root_.OAI.Complex Filter +open scoped Topology ContDiff Laplacian +namespace StrictHotSpots.Helmholtz + +lemma radial_regular_global {u : ℂ → ℂ} (hu : ContDiff ℝ ∞ u) (a : ℂ) : + Continuous (Function.uncurry (radial u a)) ∧ + Continuous (Function.uncurry (radialDeriv u a)) ∧ + Continuous (Function.uncurry (radialSecond u a)) := by + have h1 : ContDiff ℝ 1 (fderiv ℝ u) := hu.fderiv_right (by decide) + have h2 : Continuous (fderiv ℝ (fderiv ℝ u)) := h1.continuous_fderiv (by norm_num) + have hp := continuous_jointCircleMap a + have hd : Continuous (fun p : ℝ × ℝ => direction p.2) := continuous_direction.comp continuous_snd + exact ⟨hu.continuous.comp hp, + ((hu.continuous_fderiv (by simp)).comp hp).clm_apply hd, + ((h2.comp hp).clm_apply hd).clm_apply hd⟩ + +lemma hasDerivAt_coeff_global {u : ℂ → ℂ} (hu : ContDiff ℝ ∞ u) + (a : ℂ) (n : ℤ) (r : ℝ) : + HasDerivAt (coeff u a n) (coeffDeriv u a n r) r := by + have h := radial_regular_global hu a + exact hasDerivAt_intervalIntegral_of_continuousOn + (F := fun t θ => weight n θ * radial u a t θ) + (F' := fun t θ => weight n θ * radialDeriv u a t θ) isOpen_univ (mem_univ _) 0 (2*Real.pi) + (((continuous_weight n).comp continuous_snd).mul h.1).continuousOn + (((continuous_weight n).comp continuous_snd).mul h.2.1).continuousOn + (fun t _ θ => (hasDerivAt_radial (hu.differentiable (by simp) _)).const_mul _) + +lemma hasDerivAt_coeffDeriv_global {u : ℂ → ℂ} (hu : ContDiff ℝ ∞ u) + (a : ℂ) (n : ℤ) (r : ℝ) : + HasDerivAt (coeffDeriv u a n) (coeffSecond u a n r) r := by + have h := radial_regular_global hu a + exact hasDerivAt_intervalIntegral_of_continuousOn + (F := fun t θ => weight n θ * radialDeriv u a t θ) + (F' := fun t θ => weight n θ * radialSecond u a t θ) isOpen_univ (mem_univ _) 0 (2*Real.pi) + (((continuous_weight n).comp continuous_snd).mul h.2.1).continuousOn + (((continuous_weight n).comp continuous_snd).mul h.2.2).continuousOn + (fun t _ θ => (hasDerivAt_radialDeriv + ((hu.fderiv_right (m:=1) (by decide)).differentiable (by norm_num) _)).const_mul _) + +lemma weight_zero (θ : ℝ) : weight 0 θ = 1 := by simp [weight] + +lemma coeff_center (u : ℂ → ℂ) (a : ℂ) : + coeff u a 0 0 = (2*Real.pi) • u a := by + simp [coeff,weight_zero,radial,circleMap] + +lemma integral_direction : (∫ θ in (0:ℝ)..2*Real.pi, direction θ) = 0 := by + have he : direction = fun θ => (Real.cos θ : ℂ) + (Real.sin θ : ℂ)*I := by + funext θ + simp [direction,circleMap,Complex.exp_mul_I] + rw [he,intervalIntegral.integral_add] + · rw [intervalIntegral.integral_mul_const,intervalIntegral.integral_ofReal, + intervalIntegral.integral_ofReal,integral_cos,integral_sin] + simp + · exact (Complex.continuous_ofReal.comp Real.continuous_cos).intervalIntegrable _ _ + · exact ((Complex.continuous_ofReal.comp Real.continuous_sin).mul continuous_const).intervalIntegrable _ _ + +lemma coeffDeriv_center (u : ℂ → ℂ) (a : ℂ) : coeffDeriv u a 0 0 = 0 := by + simp only [coeffDeriv,weight_zero,one_mul,radialDeriv,circleMap,Complex.ofReal_zero, + zero_mul,add_zero] + rw [(fderiv ℝ u a).intervalIntegral_comp_comm (continuous_direction.intervalIntegrable _ _), + integral_direction,map_zero] + +lemma coeff_radial_ode {u : ℂ → ℂ} {a : ℂ} {R μ : ℝ} + (hu : ContDiff ℝ ∞ u) (hPDE : ∀ z ∈ ball a R, (Δ u) z = -μ • u z) + {r : ℝ} (hr : r ∈ Ico 0 R) : + HasDerivAt (fun r : ℝ => (r:ℂ)*coeffDeriv u a 0 r) + (-(r:ℂ)*(μ:ℂ)*coeff u a 0 r) r := by + have h := ((hasDerivAt_id r).ofReal_comp).mul (hasDerivAt_coeffDeriv_global hu a 0 r) + have he : (1:ℂ)*coeffDeriv u a 0 r + (r:ℂ)*coeffSecond u a 0 r = + -(r:ℂ)*(μ:ℂ)*coeff u a 0 r := by + by_cases hr0 : r=0 + · simp [hr0,coeffDeriv_center] + have hrp : 0 < r := lt_of_le_of_ne hr.1 (Ne.symm hr0) + rw [coeff_ode 0 (fun _ _ => (hu.of_le (by decide : (2:ℕ∞ω) ≤ ∞)).contDiffAt) + hPDE ⟨hrp,hr.2⟩] + simp only [Int.cast_zero,zero_pow (by norm_num : (2:ℕ) ≠ 0),zero_div,zero_sub] + have hrc : (r:ℂ) ≠ 0 := by exact_mod_cast hr0 + field_simp + ring + simpa only [id_eq,Complex.ofReal_one,he] using! h + + + +lemma circle_mean_comparison {u v : ℂ → ℂ} {a b : ℂ} {R ρ μ : ℝ} + (hu : ContDiff ℝ ∞ u) (hv : ContDiff ℝ ∞ v) + (hup : ∀ z ∈ ball a R, (Δ u) z = -μ • u z) + (hvp : ∀ z ∈ ball b R, (Δ v) z = -μ • v z) + (hρ : 0 < ρ) (hρR : ρ < R) (hsmall : |μ| * ρ^2 < 1) + (hc : u a = v b) : ∀ r ∈ Icc 0 ρ, coeff u a 0 r = coeff v b 0 r := by + let f := fun r => coeff u a 0 r - coeff v b 0 r + let g := fun r => coeffDeriv u a 0 r - coeffDeriv v b 0 r + have hdf (r : ℝ) : HasDerivAt f (g r) r := + (hasDerivAt_coeff_global hu a 0 r).sub (hasDerivAt_coeff_global hv b 0 r) + have hdg (r : ℝ) : DifferentiableAt ℝ g r := + ((hasDerivAt_coeffDeriv_global hu a 0 r).sub + (hasDerivAt_coeffDeriv_global hv b 0 r)).differentiableAt + have hz := radial_ode_zero (a:=(μ:ℂ)) hρ (by simpa only [Complex.norm_real,Real.norm_eq_abs] using hsmall) + (continuous_iff_continuousAt.mpr (fun r => (hdf r).continuousAt)).continuousOn + (continuous_iff_continuousAt.mpr (fun r => (hdg r).continuousAt)).continuousOn + (fun r _ => hdf r) (fun r hr => ?_) (by simp [f,coeff_center,hc]) + (by simp [g,coeffDeriv_center]) + · intro r hr + exact sub_eq_zero.mp (hz r hr) + · have hrR : r ∈ Ico 0 R := ⟨hr.1,hr.2.trans_lt hρR⟩ + have h := (coeff_radial_ode hu hup hrR).sub (coeff_radial_ode hv hvp hrR) + simpa only [f,g,mul_sub,Pi.sub_apply] using! h + +end StrictHotSpots.Helmholtz +end +end HelmholtzCircleMeanActualInteriorLayer + + +section HelmholtzRadialActualInteriorLayer +noncomputable section +open Set MeasureTheory Metric _root_.Complex _root_.OAI.Complex Filter Function Real +open scoped Topology ContDiff Laplacian +namespace StrictHotSpots.Helmholtz + + +def referenceReal (k : ℝ) (z : ℂ) : ℝ := Real.cos (k*z.re) +def referenceSin (k : ℝ) (z : ℂ) : ℝ := Real.sin (k*z.re) +def reference (μ : ℝ) (z : ℂ) : ℂ := referenceReal (Real.sqrt μ) z + +lemma referenceReal_smooth (k : ℝ) : ContDiff ℝ ∞ (referenceReal k) := + ((k • Complex.reCLM).contDiff).cos +lemma referenceSin_smooth (k : ℝ) : ContDiff ℝ ∞ (referenceSin k) := + ((k • Complex.reCLM).contDiff).sin +lemma reference_smooth (μ : ℝ) : ContDiff ℝ ∞ (reference μ) := + Complex.ofRealCLM.contDiff.comp (referenceReal_smooth _) + +lemma fderiv_referenceReal (k : ℝ) (z : ℂ) : + fderiv ℝ (referenceReal k) z = (-referenceSin k z) • (k • Complex.reCLM) := by + exact ((k • Complex.reCLM).hasFDerivAt.cos).fderiv +lemma fderiv_referenceSin (k : ℝ) (z : ℂ) : + fderiv ℝ (referenceSin k) z = (referenceReal k z) • (k • Complex.reCLM) := by + exact ((k • Complex.reCLM).hasFDerivAt.sin).fderiv + +lemma laplacian_referenceReal (k : ℝ) (z : ℂ) : + Δ (referenceReal k) z = -(k^2)*referenceReal k z := by + have hc : fderiv ℝ (referenceReal k) = fun y => (-referenceSin k y) • (k • Complex.reCLM) := + funext (fderiv_referenceReal k) + rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_complexPlane] + simp only [iteratedFDeriv_two_apply,Matrix.cons_val_zero,Matrix.cons_val_one,Matrix.cons_val_fin_one] + rw [hc, fderiv_smul_const (c := fun y : ℂ => -(referenceSin k y)) + ((referenceSin_smooth k).differentiable (by simp) z).neg (k • Complex.reCLM), + fderiv_fun_neg,fderiv_referenceSin] + simp + ring + +lemma laplacian_reference {μ : ℝ} (hμ : 0 ≤ μ) (z : ℂ) : + Δ (reference μ) z = -μ • reference μ z := by + have hh : ContDiffAt ℝ 2 (referenceReal (Real.sqrt μ)) z := ((referenceReal_smooth (Real.sqrt μ)).of_le (show (2:ℕ∞ω) ≤ ∞ by decide)).contDiffAt + change Δ (Complex.ofRealCLM ∘ referenceReal (Real.sqrt μ)) z = _ + rw [hh.laplacian_CLM_comp_left,Function.comp_apply,laplacian_referenceReal,Real.sq_sqrt hμ] + simp [reference,real_smul] + +lemma reference_zero (μ : ℝ) : reference μ 0 = 1 := by + simp [reference,referenceReal] + +lemma coeff_zero_eq_average (f : ℂ → ℂ) (a : ℂ) (r : ℝ) : + coeff f a 0 r = (2*Real.pi) • circleAverage f a r := by + simp only [coeff,weight_zero,one_mul,radial,circleAverage_def,smul_smul, + mul_inv_cancel₀ (mul_ne_zero two_ne_zero Real.pi_ne_zero),one_smul] + +lemma mean_eq_reference {u : ℂ → ℂ} {a : ℂ} {R ρ μ : ℝ} + (hu : ContDiff ℝ ∞ u) (hμ : 0 ≤ μ) + (hup : ∀ z ∈ ball a R, (Δ u) z = -μ • u z) + (hρ : 0 < ρ) (hρR : ρ < R) (hsmall : |μ| * ρ^2 < 1) + {r : ℝ} (hr : r ∈ Icc 0 ρ) : + circleAverage u a r = u a * circleAverage (reference μ) 0 r := by + have hv : ContDiff ℝ ∞ (fun z => u a * reference μ z) := contDiff_const.mul (reference_smooth μ) + have hvp (z : ℂ) (_hz : z ∈ ball (0:ℂ) R) : + Δ (fun z => u a * reference μ z) z = -μ • (u a * reference μ z) := by + change Δ (u a • reference μ) z = _ + rw [InnerProductSpace.laplacian_smul _ ((reference_smooth μ).of_le + (show (2:ℕ∞ω) ≤ ∞ by decide)).contDiffAt,laplacian_reference hμ] + simp only [smul_eq_mul,real_smul,Complex.ofReal_neg] + ring + have he := circle_mean_comparison hu hv hup hvp hρ hρR hsmall + (by simp only [reference_zero,mul_one]) r hr + have hcoeff : coeff (fun z => u a * reference μ z) 0 0 r = u a * coeff (reference μ) 0 0 r := by + simp only [coeff,weight_zero,one_mul,radial,intervalIntegral.integral_const_mul] + rw [hcoeff,coeff_zero_eq_average,coeff_zero_eq_average,real_smul,real_smul] at he + have hpi : ((2*Real.pi : ℝ):ℂ) ≠ 0 := by exact_mod_cast (mul_ne_zero two_ne_zero Real.pi_ne_zero) + apply mul_left_cancel₀ hpi + linear_combination he + +open StrictHotSpots.Weyl + + + +lemma radial_average_helmholtz {u : ℂ → ℂ} {a : ℂ} {R ρ μ : ℝ} + (hu : ContDiff ℝ ∞ u) (hμ : 0 ≤ μ) + (hup : ∀ z ∈ ball a R, (Δ u) z = -μ • u z) + (hρ : 0 < ρ) (hρR : ρ < R) (hsmall : |μ| * ρ^2 < 1) : + (∫ z, radialBump ρ z • u (a-z)) = + u a * (∫ z, radialBump ρ z • reference μ (-z)) := by + rw [← integral_const_mul] + rw [← Complex.integral_comp_polarCoord_symm,← Complex.integral_comp_polarCoord_symm] + change (∫ p in Ioi 0 ×ˢ Ioo (-Real.pi) Real.pi, + p.1 • (radialBump ρ (Complex.polarCoord.symm p) • u (a-Complex.polarCoord.symm p))) = + ∫ p in Ioi 0 ×ˢ Ioo (-Real.pi) Real.pi, + p.1 • (u a * (radialBump ρ (Complex.polarCoord.symm p) • reference μ (-Complex.polarCoord.symm p))) + have hi₂ := (polar_bump_integrable hρ (reference_smooth μ).continuous (0:ℂ)).const_mul (u a) + have hi₂' : IntegrableOn (fun p : ℝ × ℝ => p.1 • + (u a * (radialBump ρ (Complex.polarCoord.symm p) • reference μ (-Complex.polarCoord.symm p)))) + (Ioi 0 ×ˢ Ioo (-Real.pi) Real.pi) := by + simpa only [zero_sub,mul_smul_comm] using! hi₂ + rw [Measure.volume_eq_prod] + rw [setIntegral_prod _ (by simpa only [Measure.volume_eq_prod] using polar_bump_integrable hρ hu.continuous a), + setIntegral_prod _ (by simpa only [Measure.volume_eq_prod] using hi₂')] + apply setIntegral_congr_fun measurableSet_Ioi + intro r hr + have hpol : ∀ θ, -Complex.polarCoord.symm (r,θ) = circleMap 0 (-r) θ := by + intro θ + simpa only [zero_sub] using polar_circle 0 r θ + simp_rw [radialBump_polar,polar_circle,hpol,integral_smul,integral_const_mul] + simp_rw [integral_smul] + by_cases hrρ : r < ρ + · rw [angle_integral,angle_integral,circleAverage_neg_radius,circleAverage_neg_radius, + mean_eq_reference hu hμ hup hρ hρR hsmall ⟨hr.le,hrρ.le⟩] + simp only [mul_smul_comm] + · have hzero : expNegInvGlue (ρ^2-r^2) = 0 := by + apply expNegInvGlue.zero_of_nonpos + have hr' : ρ ≤ r := le_of_not_gt hrρ + nlinarith + simp only [hzero,zero_smul,smul_zero,mul_zero] + +end StrictHotSpots.Helmholtz +end +end HelmholtzRadialActualInteriorLayer + + +section HelmholtzRegularityActualInteriorLayer +noncomputable section +open Set MeasureTheory Metric _root_.Complex _root_.OAI.Complex Function Filter ContinuousLinearMap +open scoped Topology ContDiff Laplacian Convolution +namespace StrictHotSpots.Helmholtz +open StrictHotSpots.Weyl + +lemma regularizing_coefficient_pos {μ ρ : ℝ} (hρ : 0 < ρ) + (hpos : ∀ z ∈ ball (0:ℂ) ρ, 0 < referenceReal (Real.sqrt μ) (-z)) : + 0 < ∫ z, radialBump ρ z * referenceReal (Real.sqrt μ) (-z) := by + have hc : Continuous (fun z => radialBump ρ z * referenceReal (Real.sqrt μ) (-z)) := + (radialBump_contDiff ρ).continuous.mul ((referenceReal_smooth _).continuous.comp continuous_neg) + have hcomp : HasCompactSupport (fun z => radialBump ρ z * referenceReal (Real.sqrt μ) (-z)) := + (radialBump_compact hρ.le).mul_right + have hn (z : ℂ) : 0 ≤ radialBump ρ z * referenceReal (Real.sqrt μ) (-z) := by + by_cases hz : z ∈ ball (0:ℂ) ρ + · exact mul_nonneg (expNegInvGlue.nonneg _) (hpos z hz).le + · have hz' : ρ ≤ ‖z‖ := by simpa only [mem_ball,dist_zero_right,not_lt] using hz + rw [radialBump_zero hρ.le hz',zero_mul] + apply (integral_pos_iff_support_of_nonneg hn (hc.integrable_of_hasCompactSupport hcomp)).mpr + apply (measure_ball_pos volume (0:ℂ) hρ).trans_le + apply measure_mono + intro z hz + apply ne_of_gt + apply mul_pos _ (hpos z hz) + apply expNegInvGlue.pos_of_pos + have hz' : ‖z‖ < ρ := by simpa only [mem_ball,dist_zero_right] using hz + nlinarith [norm_nonneg z] + +lemma exists_regularizing_radius (μ : ℝ) {R : ℝ} (hR : 0 < R) : + ∃ ρ : ℝ, 0 < ρ ∧ ρ < R ∧ |μ| * ρ^2 < 1 ∧ + 0 < ∫ z, radialBump ρ z * referenceReal (Real.sqrt μ) (-z) := by + have hw : ∀ᶠ z : ℂ in 𝓝 0, 0 < referenceReal (Real.sqrt μ) (-z) := by + apply ((referenceReal_smooth _).continuous.comp continuous_neg).continuousAt.eventually + (eventually_gt_nhds (show (0:ℝ) < referenceReal (Real.sqrt μ) (-(0:ℂ)) by + simp [referenceReal])) + obtain ⟨r,hr,hrw⟩ := Metric.eventually_nhds_iff.mp hw + have he : ∀ᶠ s : ℝ in 𝓝 0, |μ| * s^2 < 1 := by + have hc : Continuous (fun s : ℝ => |μ| * s^2) := by fun_prop + exact hc.continuousAt.eventually (eventually_lt_nhds (by simp)) + obtain ⟨ε,hε,hεw⟩ := Metric.eventually_nhds_iff.mp he + obtain ⟨ρ,hρ,hρmin⟩ := exists_between (lt_min hR (lt_min hr hε)) + have hρR := hρmin.trans_le (min_le_left _ _) + have hρr := hρmin.trans_le ((min_le_right _ _).trans (min_le_left _ _)) + have hρε := hρmin.trans_le ((min_le_right _ _).trans (min_le_right _ _)) + refine ⟨ρ,hρ,hρR,hεw (by simpa only [dist_zero_right,Real.norm_eq_abs,abs_of_pos hρ] using hρε),?_⟩ + apply regularizing_coefficient_pos hρ + intro z hz + apply hrw + exact (mem_ball.mp hz).trans hρr + +lemma regularizing_coefficient_eq (μ ρ : ℝ) : + (∫ z, radialBump ρ z • reference μ (-z)) = + ((∫ z, radialBump ρ z * referenceReal (Real.sqrt μ) (-z) : ℝ) : ℂ) := by + simp only [reference,real_smul,← Complex.ofReal_mul,integral_complex_ofReal] + + + +theorem local_representative {u : ℂ → ℂ} {a : ℂ} {R μ : ℝ} + (hu : LocallyIntegrable u volume) (hR : 0 < R) (hμ : 0 ≤ μ) + (hpde : WeakEquation (ball a R) μ u) : + ∃ f : ℂ → ℂ, ContDiff ℝ ∞ f ∧ + ∀ᵐ x ∂volume, x ∈ ball a (R/4) → f x = u x := by + obtain ⟨ρ,hρ,hρR,hsmall,hc⟩ := exists_regularizing_radius μ (show 0 < R/4 by positivity) + let φ := radialBump ρ + let c : ℝ := ∫ z, φ z * referenceReal (Real.sqrt μ) (-z) + have hc' : 0 < c := hc + have hφ : ContDiff ℝ ∞ φ := radialBump_contDiff _ + have hcφ : HasCompactSupport φ := radialBump_compact hρ.le + let v := u ⋆[smulFlip] φ + have hv : ContDiff ℝ ∞ v := hcφ.contDiff_convolution_right _ hu hφ + refine ⟨fun x => c⁻¹ • v x,?_,?_⟩ + · simpa only [Pi.smul_apply] using! (contDiff_const (c := c⁻¹)).smul hv + filter_upwards [smoothen_tendsto hu,smoothen_tendsto hv.continuous.locallyIntegrable] with x hx hxv + intro hxa + have he : ∀ᶠ n in atTop, smoothen v n x = c • smoothen u n x := by + filter_upwards [(tendsto_order.1 mollifier_radius_tendsto).2 (R/2) (by positivity)] with n hn + have hh : ∀ z ∈ ball x (R/4), Δ (smoothen u n) z = -μ • smoothen u n z := by + intro z hz + apply smoothen_PDE hu hpde n + rw [mem_ball] at hz hxa ⊢ + have ht := dist_triangle z x a + linarith + calc + smoothen v n x = (smoothen u n ⋆[smulFlip] φ) x := + (congrFun (convolution_shuffle hu (mollifier n).continuous_normed + (mollifier n).hasCompactSupport_normed hφ.continuous hcφ) x).symm + _ = c • smoothen u n x := by + rw [← convolution_flip] + change (∫ z, radialBump ρ z • smoothen u n (x-z)) = _ + rw [radial_average_helmholtz (smoothen_contDiff hu n) hμ hh hρ hρR hsmall, + regularizing_coefficient_eq] + exact mul_comm _ _ + have ht : Tendsto (fun n => smoothen v n x) atTop (𝓝 (c • u x)) := + (hx.const_smul c).congr' (he.mono (fun _ h => h.symm)) + have hvx : v x = c • u x := tendsto_nhds_unique hxv ht + rw [hvx,smul_smul,inv_mul_cancel₀ hc'.ne',one_smul] + + + +theorem representative {u : ℂ → ℂ} {Ω : Set ℂ} (ho : IsOpen Ω) + (hu : LocallyIntegrable u volume) {μ : ℝ} (hμ : 0 ≤ μ) (hpde : WeakEquation Ω μ u) : + ∃ f : ℂ → ℂ, ContDiffOn ℝ ∞ f Ω ∧ ∀ᵐ x ∂volume, x ∈ Ω → f x = u x := by + classical + have hball (x : Ω) : ∃ R : ℝ, 0 < R ∧ ball (x:ℂ) R ⊆ Ω := + Metric.isOpen_iff.mp ho x x.property + choose R hR hRΩ using hball + choose f hf hfu using fun x : Ω => local_representative hu (hR x) hμ (hpde.mono (hRΩ x)) + have hsmall (x : Ω) : ball (x:ℂ) (R x/4) ⊆ Ω := + (ball_subset_ball (by linarith [hR x])).trans (hRΩ x) + have heq (x y : Ω) : EqOn (f x) (f y) (ball (x:ℂ) (R x/4) ∩ ball (y:ℂ) (R y/4)) := by + apply MeasureTheory.Measure.eqOn_open_of_ae_eq (μ := volume) _ (isOpen_ball.inter isOpen_ball) + (hf x).continuous.continuousOn (hf y).continuous.continuousOn + apply (ae_restrict_iff' (measurableSet_ball.inter measurableSet_ball)).mpr + filter_upwards [hfu x,hfu y] with z hx hy + intro hz + exact (hx hz.1).trans (hy hz.2).symm + let g : ℂ → ℂ := fun x => if hx : x ∈ Ω then f ⟨x,hx⟩ x else 0 + have hgf (x : Ω) {z : ℂ} (hz : z ∈ ball (x:ℂ) (R x/4)) : g z = f x z := by + have hzΩ := hsmall x hz + dsimp only [g] + rw [dite_eq_left hzΩ] + exact heq ⟨z,hzΩ⟩ x ⟨mem_ball_self (by linarith [hR ⟨z,hzΩ⟩]),hz⟩ + refine ⟨g,?_,?_⟩ + · intro x hx + let x' : Ω := ⟨x,hx⟩ + have he : g =ᶠ[𝓝 x] f x' := by + filter_upwards [ball_mem_nhds x (by linarith [hR x'] : 0 < R x'/4)] with z hz + exact hgf x' hz + exact ((hf x').contDiffAt.congr_of_eventuallyEq he).contDiffWithinAt + · obtain ⟨T,hT,hcover⟩ := (IsLindelof.of_coe (s := Ω)).elim_nhds_subcover' + (fun x hx => ball x (R ⟨x,hx⟩/4)) (fun x hx => ball_mem_nhds x (by linarith [hR ⟨x,hx⟩])) + have ha : ∀ᵐ z ∂volume, ∀ x ∈ T, z ∈ ball (x:ℂ) (R x/4) → f x z = u z := + (eventually_countable_ball hT).mpr (fun x _ => hfu x) + filter_upwards [ha] with z hz + intro hzΩ + obtain ⟨x,hx,hzB⟩ := mem_iUnion₂.mp (hcover hzΩ) + exact (hgf x hzB).trans (hz x hx hzB) + +end StrictHotSpots.Helmholtz +end +end HelmholtzRegularityActualInteriorLayer + +noncomputable section +open Set MeasureTheory Filter Metric +open scoped ContDiff Laplacian Topology +namespace StrictHotSpots.Helmholtz + +private def coord : ℂ ≃ₗᵢ[ℝ] Plane := Complex.orthonormalBasisOneI.repr + +private def complexExtension (Ω : Set Plane) (u : Plane → ℝ) (z : ℂ) : ℂ := + Complex.ofReal (Ω.indicator u (coord z)) + +private lemma complexExtension_integral (Ω : Set Plane) (hΩ : MeasurableSet Ω) + (u : Plane → ℝ) (ψ : ℂ → ℝ) : + (∫ z, ψ z • complexExtension Ω u z) = + Complex.ofReal (∫ x in Ω, u x * ψ (coord.symm x)) := by + have he : (fun z => ψ z • complexExtension Ω u z) = + (fun z => ((Ω.indicator (fun x => u x * ψ (coord.symm x))) (coord z) : ℂ)) := by + funext z + by_cases hz : coord z ∈ Ω + · simp [complexExtension,indicator_of_mem hz,Complex.real_smul,mul_comm] + · simp [complexExtension,indicator_of_notMem hz] + rw [he,integral_complex_ofReal, + coord.measurePreserving.integral_comp coord.toHomeomorph.measurableEmbedding, + integral_indicator hΩ] + +private lemma complexExtension_integrable {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : MeasurableSet Ω) (hu : IntegrableOn u Ω) : + Integrable (complexExtension Ω u) volume := by + have hi := (integrable_indicator_iff hΩ).mpr hu + have hj := coord.measurePreserving.integrable_comp_of_integrable hi + exact Complex.ofRealCLM.integrable_comp hj + +private lemma complexExtension_weak {Ω : Set Plane} {μ : ℝ} {u : Plane → ℝ} + (hΩ : MeasurableSet Ω) (hp : PlaneWeakEquation Ω μ u) : + Helmholtz.WeakEquation (coord ⁻¹' Ω) μ (complexExtension Ω u) := by + intro φ hφ hc hs + have ht : ContDiff ℝ ∞ (φ ∘ coord.symm) := + hφ.comp coord.symm.toContinuousLinearEquiv.contDiff + have htc : HasCompactSupport (φ ∘ coord.symm) := hc.comp_homeomorph coord.symm.toHomeomorph + have hts : tsupport (φ ∘ coord.symm) ⊆ Ω := by + change tsupport (φ ∘ coord.symm.toHomeomorph) ⊆ Ω + rw [tsupport_comp_eq_preimage φ coord.symm.toHomeomorph] + intro x hx + have h : coord (coord.symm x) ∈ Ω := hs hx + simpa only [coord.apply_symm_apply] using h + have h := hp _ ht htc hts + simp only [laplacian_comp_linearIsometryEquiv,Function.comp_apply] at h + rw [complexExtension_integral Ω hΩ u (Δ φ),complexExtension_integral Ω hΩ u φ,h] + simp + + + +theorem plane_representative {Ω : Set Plane} {u : Plane → ℝ} {μ : ℝ} + (ho : IsOpen Ω) (hu : IntegrableOn u Ω) (hμ : 0 ≤ μ) (hp : PlaneWeakEquation Ω μ u) : + ∃ f : Plane → ℝ, ContDiffOn ℝ ∞ f Ω ∧ ∀ᵐ x ∂volume.restrict Ω, f x = u x := by + obtain ⟨f,hf,hfu⟩ := representative (ho.preimage coord.continuous) + (complexExtension_integrable ho.measurableSet hu).locallyIntegrable hμ + (complexExtension_weak ho.measurableSet hp) + refine ⟨fun x => (f (coord.symm x)).re,?_,?_⟩ + · exact Complex.reCLM.contDiff.comp_contDiffOn (hf.comp + coord.symm.toContinuousLinearEquiv.contDiff.contDiffOn + (fun x hx => by simpa only [mem_preimage,coord.apply_symm_apply] using hx)) + · apply (ae_restrict_iff' ho.measurableSet).mpr + filter_upwards [coord.symm.measurePreserving.quasiMeasurePreserving.ae hfu] with x hx + intro hxm + have he := hx (show coord.symm x ∈ coord ⁻¹' Ω by simpa using hxm) + simpa only [complexExtension,coord.apply_symm_apply,indicator_of_mem hxm,Complex.ofReal_re] using congrArg Complex.re he + +end StrictHotSpots.Helmholtz + + +section WeakEigenRegularityActualInteriorLayer +noncomputable section +open Set MeasureTheory Filter InnerProductSpace +open scoped ContDiff Topology +namespace StrictHotSpots + + + +lemma HasH1Gradient.smooth_representative {Ω : Set Plane} {u f : Plane → ℝ} {g : Plane → Plane} + (ho : IsOpen Ω) (hu : HasH1Gradient Ω u g) (hf : ContDiffOn ℝ ∞ f Ω) + (he : f =ᵐ[volume.restrict Ω] u) : + g =ᵐ[volume.restrict Ω] gradient f ∧ HasH1Gradient Ω f (gradient f) := by + have hfu : HasH1Gradient Ω f g := hu.congr he.symm (EventuallyEq.refl _ _) + have hd : ContinuousOn (fderiv ℝ f) Ω := hf.continuousOn_fderiv_of_isOpen ho (by simp) + have hi (e : Plane) : ∀ᵐ x ∂volume.restrict Ω, + inner ℝ (g x) e - fderiv ℝ f x e = 0 := by + have hg := (hu.2.1.inner_const (𝕜 := ℝ) e).locallyIntegrable (by norm_num : (1:ENNReal) ≤ 2) + have hfD : LocallyIntegrableOn (fun x => (fderiv ℝ f x) e) Ω (volume.restrict Ω) := + (hd.clm_apply continuousOn_const).locallyIntegrableOn ho.measurableSet + have ht := ho.ae_eq_zero_of_integral_contDiff_smul_eq_zero + ((hg.locallyIntegrableOn Ω).sub hfD) (fun φ hφ hc hs => by + have h1 := hfu.2.2 φ hφ hc hs e + have h2 := integral_mul_test_fderiv ho hf hφ hc hs e + have hgi : Integrable (fun x => inner ℝ (g x) e * φ x) (volume.restrict Ω) := + (hu.2.1.inner_const e).integrable_mul (test_memLp hφ hc) + have hdi : Integrable (fun x => fderiv ℝ f x e * φ x) (volume.restrict Ω) := + (integrable_mul_test ho (hd.clm_apply continuousOn_const) hφ.continuous hc hs).integrableOn + simp only [smul_eq_mul,Pi.sub_apply,mul_sub] + rw [integral_sub (by simpa only [mul_comm] using hgi) (by simpa only [mul_comm] using hdi)] + simp_rw [mul_comm (φ _)] + linarith) + filter_upwards [ht,ae_restrict_mem ho.measurableSet] with x hx hxΩ + exact hx hxΩ + have hb : ∀ᵐ x ∂volume.restrict Ω, ∀ i : Fin 2, + inner ℝ (g x) (EuclideanSpace.basisFun (Fin 2) ℝ i) - + fderiv ℝ f x (EuclideanSpace.basisFun (Fin 2) ℝ i) = 0 := + ae_all_iff.mpr fun i => hi _ + have hg : g =ᵐ[volume.restrict Ω] gradient f := by + filter_upwards [hb] with x hx + have hz : g x - gradient f x = 0 := by + ext i + have hi : inner ℝ (g x - gradient f x) (EuclideanSpace.basisFun (Fin 2) ℝ i) = 0 := by + rw [inner_sub_left,inner_gradient_left] + exact hx i + simpa [EuclideanSpace.basisFun_apply,EuclideanSpace.inner_single_right] using hi + exact sub_eq_zero.mp hz + exact ⟨hg,hfu.congr (EventuallyEq.refl _ _) hg⟩ + + + + +def InInteriorNeumannEigenspace (Ω : Set Plane) (u : Plane → ℝ) : Prop := + ContDiffOn ℝ ∞ u Ω ∧ HasH1Gradient Ω u (gradient u) ∧ + (∫ x in Ω, u x) = 0 ∧ + ∀ (v : Plane → ℝ) (g : Plane → Plane), HasH1Gradient Ω v g → + (∫ x in Ω, inner ℝ (gradient u x) (g x)) = + firstPositiveNeumannValue Ω * (∫ x in Ω, u x * v x) + +lemma InFirstNeumannEigenspace.interior {Ω : Set Plane} {u : Plane → ℝ} + (hu : InFirstNeumannEigenspace Ω u) : InInteriorNeumannEigenspace Ω u := + ⟨hu.1.mono subset_closure,hu.2⟩ + + + +theorem weak_eigenfunction_representative {Ω : Set Plane} {u : Plane → ℝ} {g : Plane → Plane} + (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) (hu : HasH1Gradient Ω u g) + (hm : (∫ x in Ω, u x) = 0) + (hp : ∀ v k, HasH1Gradient Ω v k → (∫ x in Ω, inner ℝ (g x) (k x)) = + firstPositiveNeumannValue Ω * (∫ x in Ω, u x * v x)) : + ∃ f : Plane → ℝ, InInteriorNeumannEigenspace Ω f ∧ + f =ᵐ[volume.restrict Ω] u ∧ gradient f =ᵐ[volume.restrict Ω] g := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + obtain ⟨f,hf,he⟩ := Helmholtz.plane_representative ho (hu.1.integrable (by norm_num)) + (firstPositiveNeumannValue_nonneg Ω) (planeWeakEquation_of_euler ho hu hp) + obtain ⟨hg,hH⟩ := hu.smooth_representative ho hf he + refine ⟨f,⟨hf,hH,(integral_congr_ae he).trans hm,?_⟩,he,hg.symm⟩ + intro v k hv + calc + (∫ x in Ω, inner ℝ (gradient f x) (k x)) = ∫ x in Ω, inner ℝ (g x) (k x) := by + apply integral_congr_ae + filter_upwards [hg] with x hx + rw [hx] + _ = firstPositiveNeumannValue Ω * (∫ x in Ω, u x * v x) := hp v k hv + _ = firstPositiveNeumannValue Ω * (∫ x in Ω, f x * v x) := by + congr 1 + apply integral_congr_ae + filter_upwards [he] with x hx + rw [hx] + +end StrictHotSpots +end +end WeakEigenRegularityActualInteriorLayer + + +section HodgeInteriorNullspaceActualInteriorLayer +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace Topology +namespace StrictHotSpots.Hodge + + + + + +theorem vector_equality_interior {Ω : Set Plane} (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hs : IsSimplyConnected Ω) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) {L : ℝ} + (hl : firstPositiveNeumannValue Ω < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + (X : V2 Ω) (F G : Lp ℝ 2 (volume.restrict Ω)) + (hF : WeakNormalDiv X F) (hG : WeakCurl ho X G) + (hE : firstPositiveNeumannValue Ω * ‖X‖^2 = ‖F‖^2+‖G‖^2) : + ∃ v : Plane → ℝ, InInteriorNeumannEigenspace Ω v ∧ + gradient v =ᵐ[volume.restrict Ω] X ∧ G = 0 := by + obtain ⟨w,hw,hG0,he⟩ := vector_equality ho hne hs hb hμ hl hD X F G hF hG hE + have heuler : ∀ f g, HasH1Gradient Ω f g → + (∫ x in Ω, inner ℝ (N1.grad hb w x) (g x)) = + firstPositiveNeumannValue Ω * (∫ x in Ω, N1.value hb w x * f x) := by + intro f g hf + exact minimizer_euler hb + (ENNReal.toReal_pos (ho.measure_pos volume hne).ne' hb.measure_lt_top.ne) + (H1.hasH1Gradient w.val) hf (N1.mean_zero hb w) + (norm_minimizer_integral w.val he) + obtain ⟨v,hv,_hvw,hvg⟩ := weak_eigenfunction_representative ho hb + (H1.hasH1Gradient w.val) (N1.mean_zero hb w) heuler + exact ⟨v,hv,hw ▸ hvg,hG0⟩ + + + +theorem vector_equality_interior_pointwise {Ω : Set Plane} (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hs : IsSimplyConnected Ω) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) {L : ℝ} + (hl : firstPositiveNeumannValue Ω < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + (X : V2 Ω) (F G : Lp ℝ 2 (volume.restrict Ω)) + (hF : WeakNormalDiv X F) (hG : WeakCurl ho X G) + (hE : firstPositiveNeumannValue Ω * ‖X‖^2 = ‖F‖^2+‖G‖^2) + (Y : Plane → Plane) (hY : ContinuousOn Y Ω) (ha : X =ᵐ[volume.restrict Ω] Y) : + ∃ v : Plane → ℝ, InInteriorNeumannEigenspace Ω v ∧ EqOn (gradient v) Y Ω := by + obtain ⟨v,hv,hvg,_⟩ := vector_equality_interior ho hne hs hb hμ hl hD X F G hF hG hE + refine ⟨v,hv,Measure.eqOn_open_of_ae_eq (hvg.trans ha) ho ?_ hY⟩ + exact (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp_continuousOn + (hv.1.continuousOn_fderiv_of_isOpen ho (by simp)) + +end StrictHotSpots.Hodge +end +end HodgeInteriorNullspaceActualInteriorLayer +end +end ActualInteriorEigenSupport + +section ClosedNullGradient + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal Topology +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen Hodge +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) (hΩ : AdmissibleDomain Ω) +variable (hμ : 0 < firstPositiveNeumannValue Ω) +variable {L : ℝ} (hl : firstPositiveNeumannValue Ω < L) + (hD : ∀ j : H10 hΩ.2.1, L*‖H10.value hΩ.2.1 j‖^2 ≤ ‖H10.grad hΩ.2.1 j‖^2) + +include c + + + +theorem lipschitzMultipliedGradient_closed {u : Plane → ℝ} + (hu : InFirstNeumannEigenspace Ω u) {b : Plane → ℝ} {B : ℝ≥0} + (hb : LipschitzWith B b) : + ∃ Y : Plane → Plane, ContinuousOn Y (closure Ω) ∧ + EqOn Y (fun x => b x • closedGradient Ω u x) (frontier Ω) ∧ + (vectorValue (lipschitzMultipliedGradient hΩ hμ hl hD hu hb) : Plane → Plane) + =ᵐ[volume.restrict Ω] Y := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + let w (i : Fin 2) (x : Plane) := fderivWithin ℝ u (closure Ω) x (Hodge.e i) + have hw (i : Fin 2) : ContDiffOn ℝ ∞ (w i) (closure Ω) := + closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 (Hodge.e i) + let f (i : Fin 2) := c.multiplierTrace hb (w i) (hw i).continuousOn + obtain ⟨A,hA⟩ : ∃ A : Fin 2 → ℝ, ∀ i s, ‖f i s‖ ≤ A i := by + have hh (i : Fin 2) : ∃ a : ℝ, ∀ s, ‖f i s‖ ≤ a := by + obtain ⟨a,_,ha⟩ := boundary_continuous_bound (f i).continuous + exact ⟨a,ha⟩ + exact Classical.skolem.mp hh + let S (i : Fin 2) := boundaryClosedSolution c.densityBound_ne_top (c.density_bound hμ.le) (f i) (hA i) + have hSc (i : Fin 2) : ContinuousOn (S i) (closure disk) := by + obtain ⟨D,hD⟩ := c.multiplierTrace_lipschitz hΩ hb (hw i) + exact boundaryClosedSolution_continuousOn _ _ (f i) hD (hA i) + let Y (x : Plane) := S 0 (c.G x) • Hodge.e 0 + S 1 (c.G x) • Hodge.e 1 + have hY : ContinuousOn Y (closure Ω) := by + exact ((hSc 0).comp c.inverse_lipschitz.continuous.continuousOn c.inverse_maps_closed).smul continuousOn_const |>.add + (((hSc 1).comp c.inverse_lipschitz.continuous.continuousOn c.inverse_maps_closed).smul continuousOn_const) + have hae (i : Fin 2) : + (H1.value (lipschitzMultipliedGradient hΩ hμ hl hD hu hb i) : Plane → ℝ) + =ᵐ[volume.restrict Ω] (S i) ∘ c.G := + c.physical_lipschitzMul_closed_ae hΩ hμ hl hD (hw i) hb (hA i) + refine ⟨Y,hY,?_,?_⟩ + · intro x hx + have hxD := c.inverse_maps_boundary hx + have hnorm : ‖c.G x‖ = 1 := by + simpa only [disk,frontier_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0), + Metric.mem_sphere,dist_zero_right] using hxD + let s : Boundary := ⟨c.G x,hnorm⟩ + have he (i : Fin 2) : S i (c.G x) = b x*w i x := by + change S i s = _ + rw [show S i s = f i s from boundaryClosedSolution_trace _ _ (f i) (hA i) s] + change b (c.F (c.G x))*w i (c.F (c.G x)) = _ + rw [c.right_inverse x hx.1] + have hwc (i : Fin 2) : w i x = Hodge.c i (closedGradient Ω u x) := by + exact InnerProductSpace.toDual_symm_apply.symm + change S 0 (c.G x) • Hodge.e 0 + S 1 (c.G x) • Hodge.e 1 = _ + rw [he 0,he 1,hwc 0,hwc 1,mul_smul,mul_smul,← smul_add,expand] + · filter_upwards [vectorValue_ae (lipschitzMultipliedGradient hΩ hμ hl hD hu hb),hae 0,hae 1] + with x hx h0 h1 + exact hx.trans (congrArg₂ (fun a b : ℝ => a • Hodge.e 0+b • Hodge.e 1) h0 h1) + + + + +theorem lipschitzMultipliedGradient_null {u : Plane → ℝ} + (hu : InFirstNeumannEigenspace Ω u) {b : Plane → ℝ} {B : ℝ≥0} + (hb : LipschitzWith B b) + (hz : vectorForm (firstPositiveNeumannValue Ω) + (lipschitzMultipliedGradient hΩ hμ hl hD hu hb) + (lipschitzMultipliedGradient hΩ hμ hl hD hu hb) = 0) : + ∃ (v : Plane → ℝ) (Y : Plane → Plane), InInteriorNeumannEigenspace Ω v ∧ + ContinuousOn Y (closure Ω) ∧ EqOn (gradient v) Y Ω ∧ + EqOn Y (fun x => b x • closedGradient Ω u x) (frontier Ω) := by + obtain ⟨Y,hY,ht,hae⟩ := c.lipschitzMultipliedGradient_closed hΩ hμ hl hD hu hb + let X := lipschitzMultipliedGradient hΩ hμ hl hD hu hb + have hE : firstPositiveNeumannValue Ω * ‖vectorValue X‖^2 = + ‖divergenceL X‖^2 + ‖curlL X‖^2 := by + change vectorForm (firstPositiveNeumannValue Ω) X X = 0 at hz + simp only [vectorForm,real_inner_self_eq_norm_sq] at hz + linarith + obtain ⟨v,hv,he⟩ := vector_equality_interior_pointwise hΩ.2.1 hΩ.1 hΩ.2.2.2.1 + hΩ.2.2.1 hμ hl hD (vectorValue X) (divergenceL X) (curlL X) + (lipschitzMultipliedGradient_tangent hΩ hμ hl hD hu hb) + (partialL_test_curl hΩ.2.1 X) hE Y (hY.mono subset_closure) hae + exact ⟨v,Y,hv,hY,he,ht⟩ +end StrictHotSpots.Conformal.ClosedDiskChart +end +end ClosedNullGradient + +section ClosedEigenRepresentative + +noncomputable section +open Set MeasureTheory Filter Metric +open scoped ContDiff InnerProductSpace Topology NNReal +namespace StrictHotSpots + +lemma InInteriorNeumannEigenspace.congr_on {Ω : Set Plane} (ho : IsOpen Ω) + {u v : Plane → ℝ} (hu : InInteriorNeumannEigenspace Ω u) (he : EqOn u v Ω) : + InInteriorNeumannEigenspace Ω v := by + have hg : EqOn (gradient u) (gradient v) Ω := by + intro x hx + unfold gradient + rw [(show u =ᶠ[𝓝 x] v from eventually_of_mem (ho.mem_nhds hx) (fun y hy => he hy)).fderiv_eq] + have hae : u =ᵐ[volume.restrict Ω] v := (ae_restrict_iff' ho.measurableSet).mpr (Eventually.of_forall he) + have hgae : gradient u =ᵐ[volume.restrict Ω] gradient v := + (ae_restrict_iff' ho.measurableSet).mpr (Eventually.of_forall hg) + refine ⟨hu.1.congr he.symm,hu.2.1.congr hae hgae,(integral_congr_ae hae).symm.trans hu.2.2.1,?_⟩ + intro f g hf + calc + _ = ∫ x in Ω, ⟪gradient u x, g x⟫_ℝ := by + apply integral_congr_ae + filter_upwards [hgae] with x hx + rw [hx] + _ = _ := hu.2.2.2 f g hf + _ = _ := by + congr 1 + apply integral_congr_ae + filter_upwards [hae] with x hx + rw [hx] + +namespace Conformal.ClosedDiskChart +open DiskH10 +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + +include c + + + + +theorem exists_lipschitz_potential (hb : Bornology.IsBounded Ω) + {v : Plane → ℝ} (hv : ContDiffOn ℝ ∞ v Ω) {Y : Plane → Plane} + (hY : ContinuousOn Y (closure Ω)) (he : EqOn (gradient v) Y Ω) : + ∃ (V : Plane → ℝ) (A : ℝ≥0), LipschitzWith A V ∧ EqOn v V Ω := by + obtain ⟨M,hM⟩ := hb.isCompact_closure.exists_bound_of_continuousOn hY + let A : ℝ≥0 := ⟨c.bound * max M 0,mul_nonneg c.bound_pos.le (le_max_right _ _)⟩ + have hd : ∀ x ∈ disk, DifferentiableAt ℝ (c.pullDatum v) x := fun x hx => + ((c.pullDatum_smooth hv).differentiableOn (by simp) x hx).differentiableAt (isOpen_ball.mem_nhds hx) + have hbound (x : Plane) (hx : x ∈ disk) : ‖fderiv ℝ (c.pullDatum v) x‖₊ ≤ A := by + change ‖fderiv ℝ (c.pullDatum v) x‖ ≤ c.bound * max M 0 + have hn : ‖gradient (c.pullDatum v) x‖ = ‖fderiv ℝ (c.pullDatum v) x‖ := by + simp only [gradient,LinearIsometryEquiv.norm_map] + rw [← hn,c.pullDatum_grad_norm (hv.differentiableOn (by simp)) hx, + he (c.diskMap.map_source hx)] + exact mul_le_mul (c.bounded_deriv x (c.source_eq.symm ▸ hx)) + ((hM _ (subset_closure (c.diskMap.map_source hx))).trans (le_max_left _ _)) + (norm_nonneg _) c.bound_pos.le + have hLip : LipschitzOnWith A (c.pullDatum v) disk := + (convex_ball (0:Plane) 1).lipschitzOnWith_of_nnnorm_fderiv_le hd hbound + obtain ⟨f,hf,hef⟩ := hLip.extend_real + refine ⟨f ∘ c.G,A*c.InvLip,hf.comp c.inverse_lipschitz,?_⟩ + intro x hx + have hG : c.G x ∈ disk := by + rw [← c.diskMap_inverse_agrees hx] + exact c.diskMap.map_target hx + have hh := hef hG + change v (c.F (c.G x)) = f (c.G x) at hh + exact (congrArg v (c.right_inverse x (subset_closure hx))).symm.trans hh + + + +theorem null_eigenfunction_lipschitz (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + {v : Plane → ℝ} (hv : InInteriorNeumannEigenspace Ω v) {Y : Plane → Plane} + (hY : ContinuousOn Y (closure Ω)) (he : EqOn (gradient v) Y Ω) : + ∃ (V : Plane → ℝ) (A : ℝ≥0), LipschitzWith A V ∧ + InInteriorNeumannEigenspace Ω V ∧ EqOn (gradient V) Y Ω := by + obtain ⟨V,A,hV,hvV⟩ := c.exists_lipschitz_potential hb hv.1 hY he + refine ⟨V,A,hV,hv.congr_on ho hvV,?_⟩ + intro x hx + have hg : gradient V x = gradient v x := by + unfold gradient + rw [(show V =ᶠ[𝓝 x] v from eventually_of_mem (ho.mem_nhds hx) (fun y hy => (hvV hy).symm)).fderiv_eq] + exact hg.trans (he hx) +end Conformal.ClosedDiskChart +end StrictHotSpots +end +end ClosedEigenRepresentative + +section PhysicalCoordinateNull + +noncomputable section +open Set MeasureTheory Filter Metric Function +open scoped ENNReal NNReal Topology InnerProductSpace +namespace StrictHotSpots.Conformal.ClosedDiskChart +open PlaneGreen DiskH10 Hodge HilbertMultipliers +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + + + + +theorem coordinate_null_trace (hΩ : AdmissibleDomain Ω) + {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) (hne : ∃ x ∈ Ω, u x ≠ 0) + (p : disk) (hz : gradient u (c.F p) = 0) [IsFiniteMeasure c.potential] + {H ι : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [Countable ι] + (e : HilbertBasis ι ℝ H) {b : Boundary → H} {B : ℝ≥0} (hb : LipschitzWith B b) + (hid : ∀ s t, ‖b s-b t‖^2 = fullDistanceKernel c.densityBound_ne_top + (c.density_bound (firstPositiveNeumannValue_pos_of_eigenfunction hΩ hu hne).le) p s t) : + ∀ i, ∃ (v : Plane → ℝ) (Y : Plane → Plane), InInteriorNeumannEigenspace Ω v ∧ + ContinuousOn v (closure Ω) ∧ ContinuousOn Y (closure Ω) ∧ EqOn (gradient v) Y Ω ∧ + ∀ s : Boundary, Y (c.F s) = inner ℝ (e i) (b s) • closedGradient Ω u (c.F s) := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + have hμ := firstPositiveNeumannValue_pos_of_eigenfunction hΩ hu hne + obtain ⟨L,_hL,hl,hD⟩ := H10.subcritical hΩ.2.1 hΩ.1 hΩ.2.2.1 + have hext (i : ι) := c.boundary_scalar_extension (coordinate_lipschitz e hb i) + choose f A hf ht using hext + let X (i : ι) := lipschitzMultipliedGradient hΩ hμ hl hD hu (hf i) + let E (i : ι) := vectorForm (firstPositiveNeumannValue Ω) (X i) (X i) + have hE (i : ι) : E i = (1/2:ℝ)*∫ z : Boundary × Boundary, + fullBoundaryN c.densityBound_ne_top (c.density_bound hμ.le) z.1 z.2 * + (inner ℝ (e i) (b z.1-b z.2))^2 * + inner ℝ (closedGradient Ω u (c.F z.1)) (closedGradient Ω u (c.F z.2)) + ∂boundaryMeasure.prod boundaryMeasure := by + rw [show E i = _ from c.lipschitz_multiplier_kernel hΩ hu hμ hl hD (hf i)] + congr 1 + apply integral_congr_ae + exact Eventually.of_forall fun z => by + simp only [fullBoundaryN_eq,inner_sub_right,ht] + have hsum := full_embedding_coordinate_sum c.densityBound_ne_top (c.density_bound hμ.le) e p + (c.operator_norm_lt_one hΩ.2.2.1 hΩ.1 hμ) hb.continuous hid (c.closedGradient_trace_continuous hΩ hu) + have hzero := c.boundary_gradient_integral_zero hΩ hu hne p hz + rw [hzero,norm_zero,zero_pow (by norm_num : 2 ≠ 0),mul_zero] at hsum + have hs : HasSum E 0 := by + convert hsum using 1 + exact funext hE + have hzE (i : ι) : E i = 0 := nonnegative_coordinate_energy_zero hs + (fun i => lipschitzMultipliedGradient_nonneg hΩ hu hμ hl hD (hf i)) i + intro i + obtain ⟨v,Y,hv,hY,hvY,hYt⟩ := c.lipschitzMultipliedGradient_null hΩ hμ hl hD hu (hf i) (hzE i) + obtain ⟨V,D,hV,hVE,hVY⟩ := c.null_eigenfunction_lipschitz hΩ.2.1 hΩ.2.2.1 hv hY hvY + refine ⟨V,Y,hVE,hV.continuous.continuousOn,hY,hVY,?_⟩ + intro s + rw [hYt (c.maps_boundary (by simpa only [disk,frontier_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0),mem_sphere_zero_iff_norm] using s.property))] + simp only [ht] +end StrictHotSpots.Conformal.ClosedDiskChart +end +end PhysicalCoordinateNull + +section ClosedEigenAlgebra + +noncomputable section +open Set Filter MeasureTheory +open scoped ContDiff Topology InnerProductSpace +namespace StrictHotSpots + +lemma InInteriorNeumannEigenspace.differentiableAt {Ω : Set Plane} {u : Plane → ℝ} + (hu : InInteriorNeumannEigenspace Ω u) (ho : IsOpen Ω) {x : Plane} (hx : x ∈ Ω) : + DifferentiableAt ℝ u x := + ((hu.1 x hx).contDiffAt (ho.mem_nhds hx)).differentiableAt (by simp) + +lemma gradient_add_at {u v : Plane → ℝ} {x : Plane} + (hu : DifferentiableAt ℝ u x) (hv : DifferentiableAt ℝ v x) : + gradient (u+v) x = gradient u x + gradient v x := by + simp only [gradient,(hu.hasFDerivAt.add hv.hasFDerivAt).fderiv,map_add] + +lemma gradient_smul_at {u : Plane → ℝ} {x : Plane} + (hu : DifferentiableAt ℝ u x) (a : ℝ) : gradient (a • u) x = a • gradient u x := by + simp only [gradient,(hu.hasFDerivAt.const_smul a).fderiv,map_smul] + +lemma InInteriorNeumannEigenspace.add {Ω : Set Plane} {u v : Plane → ℝ} + (hu : InInteriorNeumannEigenspace Ω u) (hv : InInteriorNeumannEigenspace Ω v) + (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) : InInteriorNeumannEigenspace Ω (u+v) := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + have hgrad : (gradient u+gradient v) =ᵐ[volume.restrict Ω] gradient (u+v) := + (ae_restrict_iff' ho.measurableSet).mpr (Eventually.of_forall fun x hx => + (gradient_add_at (hu.differentiableAt ho hx) (hv.differentiableAt ho hx)).symm) + refine ⟨hu.1.add hv.1,(hu.2.1.add hv.2.1).congr (EventuallyEq.refl _ _) hgrad,?_,?_⟩ + · simp only [Pi.add_apply] + rw [integral_add] + · rw [hu.2.2.1,hv.2.2.1,add_zero] + · exact hu.2.1.1.integrable (by norm_num) + · exact hv.2.1.1.integrable (by norm_num) + · intro w g hw + calc + (∫ x in Ω, inner ℝ (gradient (u+v) x) (g x)) = + ∫ x in Ω, inner ℝ (gradient u x + gradient v x) (g x) := by + apply integral_congr_ae + filter_upwards [hgrad] with x hx + rw [← hx] + rfl + _ = (∫ x in Ω, inner ℝ (gradient u x) (g x)) + + (∫ x in Ω, inner ℝ (gradient v x) (g x)) := by + simp only [inner_add_left] + exact integral_add (integrable_inner_of_memLp hu.2.1.2.1 hw.2.1) + (integrable_inner_of_memLp hv.2.1.2.1 hw.2.1) + _ = firstPositiveNeumannValue Ω * (∫ x in Ω, u x*w x) + + firstPositiveNeumannValue Ω * (∫ x in Ω, v x*w x) := by + rw [hu.2.2.2 w g hw,hv.2.2.2 w g hw] + _ = firstPositiveNeumannValue Ω * (∫ x in Ω, (u+v) x*w x) := by + simp only [Pi.add_apply,add_mul] + have hiu : Integrable (fun x => u x*w x) (volume.restrict Ω) := hu.2.1.1.integrable_mul hw.1 + have hiv : Integrable (fun x => v x*w x) (volume.restrict Ω) := hv.2.1.1.integrable_mul hw.1 + rw [integral_add hiu hiv,mul_add] + +lemma InInteriorNeumannEigenspace.smul {Ω : Set Plane} {u : Plane → ℝ} + (hu : InInteriorNeumannEigenspace Ω u) (ho : IsOpen Ω) (a : ℝ) : + InInteriorNeumannEigenspace Ω (a • u) := by + have hgrad : (a • gradient u) =ᵐ[volume.restrict Ω] gradient (a • u) := + (ae_restrict_iff' ho.measurableSet).mpr (Eventually.of_forall fun x hx => + (gradient_smul_at (hu.differentiableAt ho hx) a).symm) + refine ⟨hu.1.const_smul a,(hu.2.1.smul a).congr (EventuallyEq.refl _ _) hgrad,?_,?_⟩ + · simp only [Pi.smul_apply,smul_eq_mul,integral_const_mul,hu.2.2.1,mul_zero] + · intro w g hw + calc + (∫ x in Ω, inner ℝ (gradient (a • u) x) (g x)) = + ∫ x in Ω, inner ℝ (a • gradient u x) (g x) := by + apply integral_congr_ae + filter_upwards [hgrad] with x hx + rw [← hx] + rfl + _ = a * (∫ x in Ω, inner ℝ (gradient u x) (g x)) := by + simp only [real_inner_smul_left,integral_const_mul] + _ = firstPositiveNeumannValue Ω * (∫ x in Ω, (a • u) x*w x) := by + rw [hu.2.2.2 w g hw] + simp only [Pi.smul_apply,smul_eq_mul,mul_assoc,integral_const_mul] + ring + +lemma InInteriorNeumannEigenspace.zero (Ω : Set Plane) : InInteriorNeumannEigenspace Ω 0 := by + have hg : gradient (0 : Plane → ℝ) = 0 := by + ext x + simp [gradient] + refine ⟨contDiffOn_const,?_,by simp,?_⟩ + · rw [hg] + refine ⟨MemLp.zero,MemLp.zero,?_⟩ + intro φ _ _ _ e + simp + · intro w g hw + simp only [hg,Pi.zero_apply,inner_zero_left,zero_mul,integral_zero,mul_zero] + + + + +abbrev ClosedEigenJet (Ω : Set Plane) := ((closure Ω) → ℝ) × ((closure Ω) → Plane) + +def closedEigenJet (Ω : Set Plane) (v : Plane → ℝ) (Y : Plane → Plane) : ClosedEigenJet Ω := + (fun x => v x, fun x => Y x) + + + + +def closedEigenSpace (Ω : Set Plane) (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) : + Submodule ℝ (ClosedEigenJet Ω) where + carrier := {J | ∃ v Y, InInteriorNeumannEigenspace Ω v ∧ ContinuousOn v (closure Ω) ∧ + ContinuousOn Y (closure Ω) ∧ EqOn (gradient v) Y Ω ∧ closedEigenJet Ω v Y = J} + zero_mem' := by + refine ⟨0,0,InInteriorNeumannEigenspace.zero Ω,continuousOn_const,continuousOn_const,?_,rfl⟩ + intro x hx + simp [gradient] + add_mem' := by + rintro J K ⟨u,Y,hu,huc,hY,huY,rfl⟩ ⟨v,Z,hv,hvc,hZ,hvZ,rfl⟩ + refine ⟨u+v,Y+Z,hu.add hv ho hb,huc.add hvc,hY.add hZ,?_,rfl⟩ + intro x hx + rw [gradient_add_at (hu.differentiableAt ho hx) (hv.differentiableAt ho hx),huY hx,hvZ hx] + rfl + smul_mem' := by + rintro a J ⟨u,Y,hu,huc,hY,huY,rfl⟩ + refine ⟨a • u,a • Y,hu.smul ho a,huc.const_smul a,hY.const_smul a,?_,rfl⟩ + intro x hx + rw [gradient_smul_at (hu.differentiableAt ho hx) a,huY hx] + rfl + +lemma closedEigenJet_eq_zero_of_eqOn {Ω : Set Plane} (ho : IsOpen Ω) + {v : Plane → ℝ} {Y : Plane → Plane} (hv : ContinuousOn v (closure Ω)) + (hY : ContinuousOn Y (closure Ω)) (he : EqOn (gradient v) Y Ω) + (hz : EqOn v 0 Ω) : closedEigenJet Ω v Y = 0 := by + have hzc := hz.of_subset_closure hv continuousOn_const subset_closure (Subset.refl _) + have hgz : EqOn Y 0 Ω := by + intro x hx + rw [← he hx] + unfold gradient + rw [(show v =ᶠ[𝓝 x] 0 from eventually_of_mem (ho.mem_nhds hx) (fun y hy => hz hy)).fderiv_eq] + simp + have hgc := hgz.of_subset_closure hY continuousOn_const subset_closure (Subset.refl _) + exact Prod.ext (funext fun x => hzc x.property) (funext fun x => hgc x.property) + + +lemma closedEigenJet_nonzero_interior {Ω : Set Plane} (ho : IsOpen Ω) + {v : Plane → ℝ} {Y : Plane → Plane} (hv : ContinuousOn v (closure Ω)) + (hY : ContinuousOn Y (closure Ω)) (he : EqOn (gradient v) Y Ω) + (hn : closedEigenJet Ω v Y ≠ 0) : ∃ x ∈ Ω, v x ≠ 0 := by + by_contra! h + exact hn (closedEigenJet_eq_zero_of_eqOn ho hv hY he h) + +end StrictHotSpots +end +end ClosedEigenAlgebra + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Green.lean b/lean/OAI/Analysis/HotSpots/Green.lean new file mode 100644 index 0000000000000000000000000000000000000000..e0a910cf9c5d64ac0755577a7cd4e6f435dfeab2 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Green.lean @@ -0,0 +1,1019 @@ +import OAI.Analysis.HotSpots.Sobolev +import OAI.Analysis.HotSpots.DiskKernel + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section FullBoundaryCombinedLayer +section WeightedLayer +open Set MeasureTheory +open scoped ContDiff InnerProductSpace ENNReal NNReal +open Set Filter MeasureTheory InnerProductSpace NormedSpace +open scoped Topology ContDiff +open scoped Laplacian + +open Set MeasureTheory Filter InnerProductSpace Bornology +open scoped Topology Laplacian ContDiff RealInnerProductSpace + +namespace StrictHotSpots.GreenFundamental + +def logRegularized (ε : ℝ) (z : ℂ) : ℝ := Real.log (‖z‖ ^ 2 + ε ^ 2) + +def peak (z : ℂ) : ℝ := 1 / (Real.pi * (1 + ‖z‖ ^ 2) ^ 2) + +lemma denominator_pos {ε : ℝ} (hε : ε ≠ 0) (z : ℂ) : + 0 < ‖z‖ ^ 2 + ε ^ 2 := add_pos_of_nonneg_of_pos (sq_nonneg _) (sq_pos_of_ne_zero hε) + +lemma logRegularized_contDiff {ε : ℝ} (hε : ε ≠ 0) : + ContDiff ℝ ∞ (logRegularized ε) := by + exact ((contDiff_id.norm_sq (𝕜 := ℂ)).add contDiff_const).log + (fun z => (denominator_pos hε z).ne') + +lemma logRegularized_fderiv {ε : ℝ} (hε : ε ≠ 0) (z : ℂ) : + fderiv ℝ (logRegularized ε) z = + (‖z‖ ^ 2 + ε ^ 2)⁻¹ • (2 • innerSL ℝ z) := by + exact (((hasStrictFDerivAt_norm_sq z).hasFDerivAt.add_const (ε ^ 2)).log + (denominator_pos hε z).ne').fderiv + +lemma logRegularized_second {ε : ℝ} (hε : ε ≠ 0) (z a b : ℂ) : + fderiv ℝ (fderiv ℝ (logRegularized ε)) z a b = + 2 * (‖z‖ ^ 2 + ε ^ 2)⁻¹ * ⟪a, b⟫_ℝ - + 4 * (‖z‖ ^ 2 + ε ^ 2)⁻¹ ^ 2 * ⟪z, a⟫_ℝ * ⟪z, b⟫_ℝ := by + have hf : fderiv ℝ (logRegularized ε) = fun z : ℂ => + (‖z‖ ^ 2 + ε ^ 2)⁻¹ • (2 • innerSL ℝ z) := + funext (logRegularized_fderiv hε) + rw [hf] + have hd := (hasDerivAt_inv (denominator_pos hε z).ne').comp_hasFDerivAt z + ((hasStrictFDerivAt_norm_sq z).hasFDerivAt.add_const (ε ^ 2)) + have hi : HasFDerivAt (fun z : ℂ => 2 • innerSL ℝ z) (2 • innerSL ℝ (E := ℂ)) z := by + exact (2 • innerSL ℝ (E := ℂ)).hasFDerivAt + calc + _ = _ := congrArg (fun L : ℂ →L[ℝ] (ℂ →L[ℝ] ℝ) => L a b) (hd.smul hi).fderiv + _ = _ := by + simp only [add_apply, smul_apply, two_smul, ContinuousLinearMap.smulRight_apply, + Function.comp_def, neg_mul, smul_eq_mul, innerSL_apply_apply] + erw [innerSL_apply_apply] + simp only [← inv_pow] + ring + +lemma logRegularized_laplacian {ε : ℝ} (hε : ε ≠ 0) (z : ℂ) : + Δ (logRegularized ε) z = 4 * ε ^ 2 / (‖z‖ ^ 2 + ε ^ 2) ^ 2 := by + rw [laplacian_eq_iteratedFDeriv_complexPlane] + simp only [iteratedFDeriv_two_apply, Fin.isValue, Matrix.cons_val_zero, + Matrix.cons_val_one, logRegularized_second hε] + have hz : z.re ^ 2 + z.im ^ 2 = ‖z‖ ^ 2 := by + simpa [Complex.normSq_apply, pow_two] using Complex.normSq_eq_norm_sq z + simp only [Complex.inner] + simp at * + field_simp + nlinarith + +lemma radial_primitive_hasDerivAt (r : ℝ) : + HasDerivAt (fun r : ℝ => -(2 * Real.pi)⁻¹ * (1 + r ^ 2)⁻¹) + (r / (Real.pi * (1 + r ^ 2)^2)) r := by + have hd := ((hasDerivAt_id r).pow 2).const_add 1 + have h := (hasDerivAt_inv (show 1 + r ^ 2 ≠ 0 by positivity)).comp r hd + have hh := h.const_mul (-(2 * Real.pi)⁻¹) + simp only [Function.comp_def, id_eq, Pi.pow_apply, Nat.cast_ofNat, + Nat.reduceSub, pow_one, mul_one] at hh + convert! hh using 1 + field_simp + +lemma radial_primitive_tendsto : + Tendsto (fun r : ℝ => -(2 * Real.pi)⁻¹ * (1 + r ^ 2)⁻¹) atTop (𝓝 0) := by + simpa using (tendsto_inv_atTop_zero.comp + (tendsto_atTop_add_const_left atTop (1 : ℝ) (tendsto_pow_atTop two_ne_zero))).const_mul + (-(2 * Real.pi)⁻¹) + +lemma integral_radial : + ∫ r in Ioi (0 : ℝ), r / (Real.pi * (1 + r ^ 2)^2) = (2 * Real.pi)⁻¹ := by + simpa using integral_Ioi_of_hasDerivAt_of_nonneg' + (a := (0 : ℝ)) (fun r _ => radial_primitive_hasDerivAt r) + (fun r hr => div_nonneg hr.le (by positivity)) radial_primitive_tendsto + +lemma integral_peak : ∫ z : ℂ, peak z = 1 := by + rw [← Complex.integral_comp_polarCoord_symm] + have heq : (fun p : ℝ × ℝ => p.1 • peak (Complex.polarCoord.symm p)) = + (fun p : ℝ × ℝ => (p.1 / (Real.pi * (1 + p.1 ^ 2)^2)) * (1 : ℝ)) := by + funext p + simp [peak, sq_abs, div_eq_mul_inv] + rw [heq] + change (∫ p in (Ioi (0 : ℝ)) ×ˢ Ioo (-Real.pi) Real.pi, + (p.1 / (Real.pi * (1 + p.1 ^ 2)^2)) * (1 : ℝ)) = 1 + rw [show (volume : Measure (ℝ × ℝ)) = volume.prod volume from rfl, + setIntegral_prod_mul (fun r : ℝ => r / (Real.pi * (1 + r ^ 2)^2)) + (fun _ : ℝ => (1 : ℝ)), integral_radial] + simp [Real.pi_pos.le] + field_simp + ring + +lemma peak_nonneg (z : ℂ) : 0 ≤ peak z := by + unfold peak + positivity + +lemma peak_decay : Tendsto (fun z : ℂ => ‖z‖ ^ Module.finrank ℝ ℂ * peak z) + (cobounded ℂ) (𝓝 0) := by + have h : Tendsto (fun z : ℂ => (1 + ‖z‖ ^ 2)⁻¹) (cobounded ℂ) (𝓝 0) := + tendsto_inv_atTop_zero.comp (tendsto_atTop_add_const_left _ (1 : ℝ) + ((tendsto_pow_atTop two_ne_zero).comp tendsto_norm_cobounded_atTop)) + have hh := (h.sub (h.pow 2)).const_mul Real.pi⁻¹ + simp only [zero_pow two_ne_zero, sub_zero, mul_zero] at hh + convert! hh using 1 + funext z + simp only [Complex.finrank_real_complex, peak] + field_simp + ring + +lemma tendsto_peak_mul {φ : ℂ → ℝ} (hφ : Integrable φ) (hc : ContinuousAt φ 0) : + Tendsto (fun c : ℝ => ∫ z : ℂ, (c ^ 2 * peak (c • z)) * φ z) + atTop (𝓝 (φ 0)) := by + simpa only [Complex.finrank_real_complex, smul_eq_mul] using + tendsto_integral_comp_smul_smul_of_integrable peak_nonneg integral_peak peak_decay hφ hc + +lemma logRegularized_laplacian_scale {c : ℝ} (hc : c ≠ 0) (z : ℂ) : + Δ (logRegularized c⁻¹) z = (4 * Real.pi) * (c ^ 2 * peak (c • z)) := by + rw [logRegularized_laplacian (inv_ne_zero hc)] + simp only [peak, norm_smul, Real.norm_eq_abs, mul_pow, sq_abs] + have hd : ‖z‖ ^ 2 + c⁻¹ ^ 2 ≠ 0 := (denominator_pos (inv_ne_zero hc) z).ne' + have hd' : 1 + c ^ 2 * ‖z‖ ^ 2 ≠ 0 := by positivity + field_simp + ring + +lemma tendsto_logRegularized_laplacian_mul {φ : ℂ → ℝ} + (hφ : Integrable φ) (hc : ContinuousAt φ 0) : + Tendsto (fun c : ℝ => ∫ z : ℂ, Δ (logRegularized c⁻¹) z * φ z) + atTop (𝓝 ((4 * Real.pi) * φ 0)) := by + apply ((tendsto_peak_mul hφ hc).const_mul (4 * Real.pi)).congr' + filter_upwards [Ioi_mem_atTop (0 : ℝ)] with c hc + simp_rw [logRegularized_laplacian_scale hc.ne', mul_assoc] + simpa only [mul_assoc] using (integral_const_mul (μ := (volume : Measure ℂ)) (4 * Real.pi) + (fun z : ℂ => c ^ 2 * (peak (c • z) * φ z))).symm + +def direction (f : ℂ → ℝ) (e : ℂ) (z : ℂ) : ℝ := fderiv ℝ f z e + +lemma direction_smooth {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (e : ℂ) : + ContDiff ℝ ∞ (direction f e) := + (hf.fderiv_right (by simp)).clm_apply contDiff_const + +lemma direction_compact {φ : ℂ → ℝ} (hc : HasCompactSupport φ) (e : ℂ) : + HasCompactSupport (direction φ e) := hc.fderiv_apply ℝ e + +lemma second_direction {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (e x : ℂ) : + direction (direction f e) e x = fderiv ℝ (fderiv ℝ f) x e e := by + unfold direction + rw [fderiv_clm_apply ((hf.fderiv_right (m := ∞) (by simp)).differentiable (by simp) x) + (differentiableAt_const _)] + simp + +lemma laplacian_direction {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) : + Δ f = fun x => direction (direction f 1) 1 x + + direction (direction f Complex.I) Complex.I x := by + funext x + rw [laplacian_eq_iteratedFDeriv_complexPlane] + simp only [iteratedFDeriv_two_apply, Fin.isValue, Matrix.cons_val_zero, + Matrix.cons_val_one, second_direction hf] + +lemma integral_direction_by_parts {f φ : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) (e : ℂ) : + ∫ x, f x * direction φ e x = -(∫ x, direction f e x * φ x) := by + apply integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + · exact ((direction_smooth hf e).continuous.mul hφ.continuous).integrable_of_hasCompactSupport + hc.mul_left + · exact (hf.continuous.mul (direction_smooth hφ e).continuous).integrable_of_hasCompactSupport + (direction_compact hc e).mul_left + · exact (hf.continuous.mul hφ.continuous).integrable_of_hasCompactSupport hc.mul_left + · intro x _ + exact hf.differentiable (by simp) x + · intro x _ + exact hφ.differentiable (by simp) x + +lemma integral_second_direction {f φ : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) (e : ℂ) : + ∫ x, f x * direction (direction φ e) e x = + ∫ x, direction (direction f e) e x * φ x := by + rw [integral_direction_by_parts hf (direction_smooth hφ e) (direction_compact hc e), + integral_direction_by_parts (direction_smooth hf e) hφ hc, neg_neg] + +lemma integral_laplacian_by_parts {f φ : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) : + ∫ x, f x * Δ φ x = ∫ x, Δ f x * φ x := by + have hi (e : ℂ) : Integrable (fun x => f x * direction (direction φ e) e x) := + (hf.continuous.mul (direction_smooth (direction_smooth hφ e) e).continuous).integrable_of_hasCompactSupport (direction_compact (direction_compact hc e) e).mul_left + have hi' (e : ℂ) : Integrable (fun x => direction (direction f e) e x * φ x) := + ((direction_smooth (direction_smooth hf e) e).continuous.mul hφ.continuous).integrable_of_hasCompactSupport hc.mul_left + simp_rw [laplacian_direction hf, laplacian_direction hφ, mul_add, add_mul] + rw [integral_add (hi 1) (hi Complex.I), integral_add (hi' 1) (hi' Complex.I), + integral_second_direction hf hφ hc, integral_second_direction hf hφ hc] + +lemma tendsto_logRegularized_test {φ : ℂ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) : + Tendsto (fun c : ℝ => ∫ z : ℂ, logRegularized c⁻¹ z * Δ φ z) + atTop (𝓝 ((4 * Real.pi) * φ 0)) := by + apply (tendsto_logRegularized_laplacian_mul + (hφ.continuous.integrable_of_hasCompactSupport hc) hφ.continuous.continuousAt).congr' + filter_upwards [Ioi_mem_atTop (0 : ℝ)] with c hc' + exact (integral_laplacian_by_parts (logRegularized_contDiff (inv_ne_zero hc'.ne')) hφ hc).symm + +lemma abs_log_bound {t : ℝ} (ht : 0 < t) : |Real.log t| ≤ t + t⁻¹ := by + have hu := Real.log_le_sub_one_of_pos ht + have hl := Real.one_sub_inv_le_log_of_pos ht + exact abs_le.mpr ⟨by linarith, by have := inv_pos.mpr ht; linarith⟩ + +lemma log_norm_integrableOn_ball (R : ℝ) : + IntegrableOn (fun z : ℂ => Real.log ‖z‖) (Metric.ball 0 R) := by + apply integrableOn_ball_of_norm_le_rpow (C := R ^ 2 + 1) (α := 1) + (by norm_num : 1 ≤ Module.finrank ℝ ℂ) (by norm_num : (1 : ℝ) < Module.finrank ℝ ℂ) + · filter_upwards [self_mem_ae_restrict measurableSet_ball] with z hz + rw [Real.norm_eq_abs, Real.rpow_neg_one] + by_cases he : z = 0 + · simp [he] + · have hp : 0 < ‖z‖ := norm_pos_iff.mpr he + have hr : ‖z‖ < R := by simpa using hz + calc + _ ≤ ‖z‖ + ‖z‖⁻¹ := abs_log_bound hp + _ ≤ (R ^ 2 + 1) * ‖z‖⁻¹ := by + rw [← div_eq_mul_inv] + apply (le_div_iff₀ hp).mpr + have he : (‖z‖ + ‖z‖⁻¹) * ‖z‖ = ‖z‖ ^ 2 + 1 := by field_simp + rw [he] + nlinarith + · exact (Real.measurable_log.comp continuous_norm.measurable).aestronglyMeasurable + +lemma logRegularized_abs_le {ε : ℝ} (hε : 0 ≤ ε) (hε' : ε ≤ 1) + {z : ℂ} (hz : z ≠ 0) : + |logRegularized ε z| ≤ 2 * |Real.log ‖z‖| + ‖z‖ ^ 2 + 1 := by + have hp : 0 < ‖z‖ := norm_pos_iff.mpr hz + have hl := Real.log_le_log (sq_pos_of_pos hp) (le_add_of_nonneg_right (sq_nonneg ε)) + have hu := Real.log_le_self (show 0 ≤ ‖z‖ ^ 2 + ε ^ 2 by positivity) + rw [Real.log_pow] at hl + norm_num at hl + have ha := neg_abs_le (Real.log ‖z‖) + have hb := abs_nonneg (Real.log ‖z‖) + unfold logRegularized + exact abs_le.mpr ⟨by nlinarith [sq_nonneg ‖z‖], by nlinarith⟩ + +lemma tendsto_logRegularized {z : ℂ} (hz : z ≠ 0) : + Tendsto (fun c : ℝ => logRegularized c⁻¹ z) atTop (𝓝 (2 * Real.log ‖z‖)) := by + have hp : ‖z‖ ^ 2 ≠ 0 := pow_ne_zero _ (norm_ne_zero_iff.mpr hz) + have ht : Tendsto (fun c : ℝ => ‖z‖ ^ 2 + (c⁻¹) ^ 2) atTop (𝓝 (‖z‖ ^ 2)) := by + simpa using (tendsto_const_nhds (x := ‖z‖ ^ 2)).add (tendsto_inv_atTop_zero.pow 2) + simpa [logRegularized, Real.log_pow, Function.comp_def] using (Real.continuousAt_log hp).tendsto.comp ht + +lemma tendsto_integral_logRegularized {ψ : ℂ → ℝ} + (hψ : Continuous ψ) (hc : HasCompactSupport ψ) : + Tendsto (fun c : ℝ => ∫ z : ℂ, logRegularized c⁻¹ z * ψ z) + atTop (𝓝 (∫ z : ℂ, (2 * Real.log ‖z‖) * ψ z)) := by + obtain ⟨R, hR, hsub⟩ := hc.isBounded.subset_ball_lt 0 (0 : ℂ) + obtain ⟨B, hB⟩ := hc.exists_bound_of_continuous hψ + have hB0 : 0 ≤ B := (norm_nonneg (ψ 0)).trans (hB 0) + let bound : ℂ → ℝ := (Metric.ball (0 : ℂ) R).indicator + (fun z => (2 * |Real.log ‖z‖| + R ^ 2 + 1) * B) + have hi : Integrable bound := by + apply (integrable_indicator_iff measurableSet_ball).mpr + exact ((((log_norm_integrableOn_ball R).abs.const_mul 2).add + (integrableOn_const (measure_ball_lt_top.ne))).add + (integrableOn_const (measure_ball_lt_top.ne))).mul_const B + refine tendsto_integral_filter_of_dominated_convergence bound ?_ ?_ hi ?_ + · filter_upwards [Ioi_mem_atTop (0 : ℝ)] with c hc' + exact ((logRegularized_contDiff (inv_ne_zero hc'.ne')).continuous.mul hψ).aestronglyMeasurable + · filter_upwards [Ici_mem_atTop (1 : ℝ)] with c hc' + change 1 ≤ c at hc' + filter_upwards [volume.ae_ne (0 : ℂ)] with z hz + by_cases hzr : z ∈ Metric.ball (0 : ℂ) R + · rw [norm_mul, Real.norm_eq_abs, show bound z = + (2 * |Real.log ‖z‖| + R ^ 2 + 1) * B from Set.indicator_of_mem hzr _] + have hr : ‖z‖ < R := by simpa using hzr + have hli : |logRegularized c⁻¹ z| ≤ 2 * |Real.log ‖z‖| + R ^ 2 + 1 := by + apply (logRegularized_abs_le (inv_nonneg.mpr (by linarith)) + (inv_le_one₀ (by linarith) |>.mpr hc') hz).trans + nlinarith [norm_nonneg z] + exact mul_le_mul hli (hB z) (norm_nonneg _) (by positivity) + · have hzψ : ψ z = 0 := image_eq_zero_of_notMem_tsupport + (fun hz' => hzr (hsub hz')) + simp [hzψ, bound, hzr] + · filter_upwards [volume.ae_ne (0 : ℂ)] with z hz + exact (tendsto_logRegularized hz).mul_const (ψ z) + +lemma laplacian_smooth {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ) : + ContDiff ℝ ∞ (Δ φ) := by + rw [laplacian_direction hφ] + exact (direction_smooth (direction_smooth hφ 1) 1).add + (direction_smooth (direction_smooth hφ Complex.I) Complex.I) + +lemma laplacian_compact {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ) + (hc : HasCompactSupport φ) : HasCompactSupport (Δ φ) := by + rw [laplacian_direction hφ] + exact (direction_compact (direction_compact hc 1) 1).add + (direction_compact (direction_compact hc Complex.I) Complex.I) + + + +lemma integral_log_laplacian {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ) + (hc : HasCompactSupport φ) : + ∫ z : ℂ, Real.log ‖z‖ * Δ φ z = (2 * Real.pi) * φ 0 := by + have he := tendsto_nhds_unique (tendsto_logRegularized_test hφ hc) + (tendsto_integral_logRegularized (laplacian_smooth hφ).continuous + (laplacian_compact hφ hc)) + simp_rw [mul_assoc] at he + rw [integral_const_mul] at he + linarith + +lemma log_norm_locallyIntegrable : LocallyIntegrable (fun z : ℂ => Real.log ‖z‖) := by + intro z + refine ⟨Metric.ball (0 : ℂ) (‖z‖ + 1), Metric.isOpen_ball.mem_nhds ?_, + log_norm_integrableOn_ball _⟩ + simp + +lemma laplacian_comp_add_right (φ : ℂ → ℝ) (a : ℂ) : + Δ (fun z => φ (z+a)) = fun z => Δ φ (z+a) := by + funext z + simp only [laplacian_eq_iteratedFDeriv_complexPlane, iteratedFDeriv_comp_add_right] + +lemma integral_log_sub_laplacian {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ) + (hc : HasCompactSupport φ) (a : ℂ) : + ∫ z : ℂ, Real.log ‖z-a‖ * Δ φ z = (2 * Real.pi) * φ a := by + have h := integral_log_laplacian (φ := fun z => φ (z+a)) + (hφ.comp (contDiff_id.add contDiff_const)) + (hc.comp_homeomorph (Homeomorph.addRight a)) + rw [laplacian_comp_add_right] at h + rw [← integral_add_right_eq_self (fun z : ℂ => Real.log ‖z-a‖ * Δ φ z) a] + simpa using h + +lemma integral_laplacian_zero {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ) + (hc : HasCompactSupport φ) : ∫ z : ℂ, Δ φ z = 0 := by + simpa using integral_laplacian_by_parts (f := fun _ => (1 : ℝ)) contDiff_const hφ hc + +lemma log_sub_mul_integrable {ψ : ℂ → ℝ} (hψ : Continuous ψ) + (hc : HasCompactSupport ψ) (a : ℂ) : + Integrable (fun z : ℂ => Real.log ‖z-a‖ * ψ z) := by + have hi := log_norm_locallyIntegrable.integrable_smul_right_of_hasCompactSupport + (hψ.comp (continuous_id.add continuous_const)) + (hc.comp_homeomorph (Homeomorph.addRight a)) + simpa [Function.comp_def, sub_eq_add_neg, smul_eq_mul] using + (measurePreserving_add_right volume (-a)).integrable_comp_of_integrable hi + +end StrictHotSpots.GreenFundamental + +namespace StrictHotSpots.DiskFormula +open StrictHotSpots.GreenFundamental + + + +def green (x y : ℂ) : ℝ := + Real.log (1 + (1 - ‖x‖ ^ 2) * (1 - ‖y‖ ^ 2) / ‖x-y‖ ^ 2) / (4 * Real.pi) + +lemma disk_cross_identity (x y : ℂ) : + ‖1 - x * star y‖ ^ 2 = (1 - ‖x‖ ^ 2) * (1 - ‖y‖ ^ 2) + ‖x-y‖ ^ 2 := by + simp only [Complex.sq_norm, Complex.normSq_apply, Complex.sub_re, Complex.sub_im, + Complex.mul_re, Complex.mul_im, Complex.one_re, Complex.one_im, + Complex.star_def, Complex.conj_re, Complex.conj_im] + ring + +lemma green_eq_log {x y : ℂ} (hxy : x ≠ y) (hnum : 1 - x * star y ≠ 0) : + green x y = (Real.log ‖1-x*star y‖ - Real.log ‖x-y‖) / (2 * Real.pi) := by + have hd := pow_ne_zero 2 (norm_ne_zero_iff.mpr (sub_ne_zero.mpr hxy)) + have hn := pow_ne_zero 2 (norm_ne_zero_iff.mpr hnum) + have he : 1 + (1 - ‖x‖ ^ 2) * (1 - ‖y‖ ^ 2) / ‖x-y‖ ^ 2 = + ‖1-x*star y‖ ^ 2 / ‖x-y‖ ^ 2 := by + rw [disk_cross_identity, add_div, div_self hd] + ring + rw [green, he, Real.log_div hn hd, Real.log_pow, Real.log_pow] + ring + +lemma correction_factor {y : ℂ} (hy : y ≠ 0) (z : ℂ) : + 1-z*star y = -(star y) * (z-(star y)⁻¹) := by + have hn : star y ≠ 0 := star_ne_zero.mpr hy + field_simp + ring + +lemma ae_correction_ne_zero (y : ℂ) : ∀ᵐ z : ℂ, 1-z*star y ≠ 0 := by + by_cases hy : y = 0 + · simp [hy] + · filter_upwards [volume.ae_ne ((star y)⁻¹)] with z hz + rw [correction_factor hy] + exact mul_ne_zero (neg_ne_zero.mpr (star_ne_zero.mpr hy)) (sub_ne_zero.mpr hz) + +lemma log_correction_eq {y : ℂ} (hy : y ≠ 0) {z : ℂ} (hz : z ≠ (star y)⁻¹) : + Real.log ‖1-z*star y‖ = Real.log ‖y‖ + Real.log ‖z-(star y)⁻¹‖ := by + rw [correction_factor hy, norm_mul, norm_neg, norm_star, + Real.log_mul (norm_ne_zero_iff.mpr hy) (norm_ne_zero_iff.mpr (sub_ne_zero.mpr hz))] + +lemma log_correction_mul_integrable (y : ℂ) {ψ : ℂ → ℝ} + (hψ : Continuous ψ) (hc : HasCompactSupport ψ) : + Integrable (fun z => Real.log ‖1-z*star y‖ * ψ z) := by + by_cases hy : y = 0 + · simp [hy] + · have hi := ((hψ.integrable_of_hasCompactSupport hc).const_mul (Real.log ‖y‖)).add + (log_sub_mul_integrable hψ hc ((star y)⁻¹)) + apply hi.congr + filter_upwards [volume.ae_ne ((star y)⁻¹)] with z hz + rw [log_correction_eq hy hz, add_mul] + rfl + +lemma integral_log_correction_laplacian {φ : ℂ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) + (hs : tsupport φ ⊆ Metric.ball 0 1) {y : ℂ} (hy : ‖y‖ < 1) : + ∫ z : ℂ, Real.log ‖1-z*star y‖ * Δ φ z = 0 := by + by_cases hy0 : y = 0 + · simp [hy0] + · have he : (fun z : ℂ => Real.log ‖1-z*star y‖ * Δ φ z) =ᵐ[volume] + (fun z => Real.log ‖y‖ * Δ φ z + Real.log ‖z-(star y)⁻¹‖ * Δ φ z) := by + filter_upwards [volume.ae_ne ((star y)⁻¹)] with z hz + rw [log_correction_eq hy0 hz, add_mul] + rw [integral_congr_ae he, integral_add + (((laplacian_smooth hφ).continuous.integrable_of_hasCompactSupport + (laplacian_compact hφ hc)).const_mul _) + (log_sub_mul_integrable (laplacian_smooth hφ).continuous + (laplacian_compact hφ hc) _), integral_const_mul, + integral_laplacian_zero hφ hc, integral_log_sub_laplacian hφ hc, mul_zero, zero_add] + have hnot : (star y)⁻¹ ∉ tsupport φ := by + intro h + have hh : ‖y‖⁻¹ < 1 := by simpa using hs h + have hp := norm_pos_iff.mpr hy0 + have hh' := (inv_lt_one₀ hp).mp hh + linarith + rw [image_eq_zero_of_notMem_tsupport hnot, mul_zero] + + + +lemma integral_green_laplacian {φ : ℂ → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) + (hs : tsupport φ ⊆ Metric.ball 0 1) {y : ℂ} (hy : ‖y‖ < 1) : + ∫ z : ℂ, green z y * Δ φ z = -φ y := by + have he : (fun z : ℂ => green z y * Δ φ z) =ᵐ[volume] + (fun z => (2 * Real.pi)⁻¹ * + (Real.log ‖1-z*star y‖ * Δ φ z - Real.log ‖z-y‖ * Δ φ z)) := by + filter_upwards [volume.ae_ne y, ae_correction_ne_zero y] with z hz hn + rw [green_eq_log hz hn] + ring + rw [integral_congr_ae he, integral_const_mul, integral_sub + (log_correction_mul_integrable y (laplacian_smooth hφ).continuous (laplacian_compact hφ hc)) + (log_sub_mul_integrable (laplacian_smooth hφ).continuous (laplacian_compact hφ hc) y), + integral_log_correction_laplacian hφ hc hs hy, integral_log_sub_laplacian hφ hc] + field_simp + ring + +end StrictHotSpots.DiskFormula + +open scoped Convolution +namespace StrictHotSpots.GreenPotential +open StrictHotSpots.GreenFundamental + +lemma direction_convolution {f g : ℂ → ℝ} + (hf : LocallyIntegrable f) (hg : ContDiff ℝ ∞ g) (hc : HasCompactSupport g) + (e : ℂ) : direction (f ⋆ g) e = f ⋆ (direction g e) := by + funext x + rw [direction, (hc.hasFDerivAt_convolution_right (ContinuousLinearMap.lsmul ℝ ℝ) + hf (hg.of_le (by simp)) x).fderiv] + exact convolution_precompR_apply (ContinuousLinearMap.lsmul ℝ ℝ) + hf (hc.fderiv ℝ) (hg.continuous_fderiv (by simp)) x e + +lemma laplacian_convolution {f g : ℂ → ℝ} + (hf : LocallyIntegrable f) (hg : ContDiff ℝ ∞ g) (hc : HasCompactSupport g) : + Δ (f ⋆ g) = f ⋆ (Δ g) := by + rw [laplacian_direction (hc.contDiff_convolution_right _ hf hg), laplacian_direction hg] + rw [direction_convolution hf hg hc, direction_convolution hf hg hc, + direction_convolution hf (direction_smooth hg _) (direction_compact hc _), + direction_convolution hf (direction_smooth hg _) (direction_compact hc _)] + funext x + symm + apply ConvolutionExistsAt.distrib_add + · exact (direction_compact (direction_compact hc _) _).convolutionExists_right _ hf + (direction_smooth (direction_smooth hg _) _).continuous x + · exact (direction_compact (direction_compact hc _) _).convolutionExists_right _ hf + (direction_smooth (direction_smooth hg _) _).continuous x + + + +lemma log_potential_smooth {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) : + ContDiff ℝ ∞ ((fun z : ℂ => Real.log ‖z‖) ⋆ f) := + hc.contDiff_convolution_right _ log_norm_locallyIntegrable hf + +lemma laplacian_comp_neg {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (z : ℂ) : + Δ (fun x : ℂ => f (-x)) z = Δ f (-z) := by + have hh := iteratedFDeriv_comp_const_smul (𝕜 := ℝ) (i := 2) (-1 : ℝ) + (hf.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)) + have hh' : iteratedFDeriv ℝ 2 (fun x : ℂ => f (-x)) z = + iteratedFDeriv ℝ 2 f (-z) := by + simpa using congrFun hh z + simp only [laplacian_eq_iteratedFDeriv_complexPlane, hh'] + +lemma laplacian_comp_const_sub {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (a z : ℂ) : + Δ (fun x : ℂ => f (a-x)) z = Δ f (a-z) := by + have he : (fun x : ℂ => f (a-x)) = fun x => (fun y => f (y+a)) (-x) := by + funext x; congr 1; abel + have hshift : ContDiff ℝ ∞ (fun y : ℂ => f (y+a)) := + hf.comp (contDiff_id.add contDiff_const) + calc + _ = Δ (fun y : ℂ => f (y+a)) (-z) := by + rw [he] + exact laplacian_comp_neg hshift z + _ = Δ f (-z+a) := congrFun (laplacian_comp_add_right f a) (-z) + _ = Δ f (a-z) := by rw [sub_eq_add_neg, add_comm a] + + + +lemma log_potential_laplacian {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) (z : ℂ) : + Δ ((fun x : ℂ => Real.log ‖x‖) ⋆ f) z = (2 * Real.pi) * f z := by + rw [laplacian_convolution log_norm_locallyIntegrable hf hc] + let φ : ℂ → ℝ := fun x => f (z-x) + have hφ : ContDiff ℝ ∞ φ := hf.comp (contDiff_const.sub contDiff_id) + have hφc : HasCompactSupport φ := by + simpa [φ, Function.comp_def, sub_eq_add_neg, add_comm] using + hc.comp_homeomorph ((Homeomorph.neg ℂ).trans (Homeomorph.addRight z)) + have h := integral_log_laplacian hφ hφc + simp only [φ, laplacian_comp_const_sub hf, sub_zero] at h + simpa only [convolution_def, ContinuousLinearMap.lsmul_apply, smul_eq_mul] using h + +def correctionIntegrand (f : ℂ → ℝ) (p : ℂ × ℂ) : ℝ := + f p.2 * Real.log ‖1-p.1*star p.2‖ + +lemma correctionIntegrand_contDiffOn {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + {s : Set ℂ} (hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) : + ContDiffOn ℝ ∞ (correctionIntegrand f) (s ×ˢ univ) := by + intro p hp + by_cases hy : p.2 ∈ tsupport f + · have hg : ContDiff ℝ ∞ (fun p : ℂ × ℂ => 1-p.1*star p.2) := by + exact contDiff_const.sub (contDiff_fst.mul + (Complex.conjCLE.contDiff.comp contDiff_snd)) + exact ((hf.comp contDiff_snd).contDiffAt.mul + ((hg.contDiffAt.norm (𝕜 := ℂ) (hn p.1 hp.1 p.2 hy)).log + (norm_ne_zero_iff.mpr (hn p.1 hp.1 p.2 hy)))).contDiffWithinAt + · have he : (fun q : ℂ × ℂ => f q.2) =ᶠ[𝓝 p] (fun _ => (0 : ℝ)) := + (notMem_tsupport_iff_eventuallyEq.mp hy).comp_tendsto continuousAt_snd + have hz : ContDiffAt ℝ ∞ (correctionIntegrand f) p := by + apply (contDiffAt_const (c := (0 : ℝ))).congr_of_eventuallyEq + filter_upwards [he] with q hq + simp [correctionIntegrand, hq] + exact hz.contDiffWithinAt + +lemma correction_potential_smooth {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) {s : Set ℂ} (hs : IsOpen s) + (hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) : + ContDiffOn ℝ ∞ (fun z : ℂ => ∫ y : ℂ, f y * Real.log ‖1-z*star y‖) s := by + have hh := contDiffOn_convolution_left_with_param_comp + (ContinuousLinearMap.lsmul ℝ ℝ) (v := fun _ : ℂ => (0 : ℂ)) + contDiffOn_const (f := fun _ : ℂ => (1 : ℝ)) + (g := fun z y => correctionIntegrand f (z,y)) hs hc.isCompact + (fun z y _ hy => by simp [correctionIntegrand, image_eq_zero_of_notMem_tsupport hy]) + (locallyIntegrable_const (μ := (volume : Measure ℂ)) (1 : ℝ)) + (correctionIntegrand_contDiffOn hf hn) + simpa only [convolution_def, correctionIntegrand, ContinuousLinearMap.lsmul_apply, + smul_eq_mul, mul_one] using hh + +end StrictHotSpots.GreenPotential + + + +open Set MeasureTheory Filter InnerProductSpace +open scoped Topology ContDiff Convolution Laplacian +namespace StrictHotSpots.CompactParameter + +variable {s k : Set ℂ} {F : ℂ × ℂ → ℝ} + +lemma fderiv_eq_zero_outside (hs : IsOpen s) (hk : IsClosed k) + (hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) {p : ℂ × ℂ} + (hp : p.1 ∈ s) (hy : p.2 ∉ k) : fderiv ℝ F p = 0 := by + have hd : HasFDerivAt F (0 : (ℂ × ℂ) →L[ℝ] ℝ) p := by + apply (hasFDerivAt_const (0 : ℝ) p).congr_of_eventuallyEq + filter_upwards [(hs.prod hk.isOpen_compl).mem_nhds (show p ∈ s ×ˢ kᶜ from ⟨hp,hy⟩)] with q hq + exact hz q.1 hq.1 q.2 hq.2 + exact hd.fderiv + +lemma fderiv_section_compact (hs : IsOpen s) (hk : IsCompact k) + (hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) {z : ℂ} (hzz : z ∈ s) : + HasCompactSupport (fun y : ℂ => fderiv ℝ F (z,y)) := by + apply HasCompactSupport.intro hk + intro y hy + exact fderiv_eq_zero_outside hs hk.isClosed hz hzz hy + +lemma fderiv_section_continuous (hs : IsOpen s) + (hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hz : z ∈ s) : + Continuous (fun y : ℂ => fderiv ℝ F (z,y)) := by + exact (hf.continuousOn_fderiv_of_isOpen (hs.prod isOpen_univ) (by simp)).comp_continuous + (continuous_const.prodMk continuous_id) (fun y => ⟨hz, mem_univ y⟩) + +lemma hasFDerivAt_integral (hs : IsOpen s) (hk : IsCompact k) + (hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) + (hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hzz : z ∈ s) : + HasFDerivAt (fun z : ℂ => ∫ y : ℂ, F (z,y)) + ((∫ y : ℂ, fderiv ℝ F (z,y)).comp (ContinuousLinearMap.inl ℝ ℂ ℂ)) z := by + have h := hasFDerivAt_convolution_right_with_param + (ContinuousLinearMap.lsmul ℝ ℝ) (μ := (volume : Measure ℂ)) + (f := fun _ : ℂ => (1 : ℝ)) (g := fun z y => F (z,y)) + hs hk (fun z y hzz hy => hz z hzz y hy) + (locallyIntegrable_const (1 : ℝ)) (hf.of_le (by simp)) (z,0) hzz + have h' := h.comp z (ContinuousLinearMap.inl ℝ ℂ ℂ).hasFDerivAt + have hfun : (fun z : ℂ => (fun q : ℂ × ℂ => + ((fun _ : ℂ => (1 : ℝ)) ⋆ (fun y => F (q.1,y))) q.2) + ((ContinuousLinearMap.inl ℝ ℂ ℂ) z)) = + (fun z : ℂ => ∫ y : ℂ, F (z,y)) := by + funext z + simp only [ContinuousLinearMap.inl_apply, convolution_def, + ContinuousLinearMap.lsmul_apply, smul_eq_mul, one_mul, zero_sub] + exact integral_neg_eq_self (fun y : ℂ => F (z,y)) volume + simp only [Function.comp_def] at h' + rw [hfun] at h' + convert! h' using 1 + congr 1 + change (∫ y : ℂ, fderiv ℝ F (z,y)) = + ∫ y : ℂ, (ContinuousLinearMap.lsmul ℝ ℝ).precompR (ℂ × ℂ) 1 + (fderiv ℝ F (z,0-y)) + have hid : (ContinuousLinearMap.lsmul ℝ ℝ).precompR (ℂ × ℂ) 1 = + ContinuousLinearMap.id ℝ ((ℂ × ℂ) →L[ℝ] ℝ) := by + apply ContinuousLinearMap.ext + intro D + apply ContinuousLinearMap.ext + intro p + simp [ContinuousLinearMap.precompR_apply] + rw [hid] + simpa only [zero_sub, ContinuousLinearMap.id_apply] using + (integral_neg_eq_self (fun y : ℂ => fderiv ℝ F (z,y)) volume).symm + +def paramDeriv (F : ℂ × ℂ → ℝ) (e : ℂ) (p : ℂ × ℂ) : ℝ := + fderiv ℝ F p (e,0) + +lemma partial_contDiffOn (hs : IsOpen s) (hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) (e : ℂ) : + ContDiffOn ℝ ∞ (paramDeriv F e) (s ×ˢ univ) := + (hf.fderiv_of_isOpen (hs.prod isOpen_univ) (by simp)).clm_apply contDiffOn_const + +lemma partial_zero_outside (hs : IsOpen s) (hk : IsClosed k) + (hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) (e : ℂ) : + ∀ z ∈ s, ∀ y ∉ k, paramDeriv F e (z,y) = 0 := by + intro z hzz y hy + simp [paramDeriv, fderiv_eq_zero_outside hs hk hz (p := (z,y)) hzz hy] + +lemma integral_contDiffOn (hs : IsOpen s) (hk : IsCompact k) + (hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) + (hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) : + ContDiffOn ℝ ∞ (fun z : ℂ => ∫ y : ℂ, F (z,y)) s := by + have hh := contDiffOn_convolution_left_with_param_comp + (ContinuousLinearMap.lsmul ℝ ℝ) (v := fun _ : ℂ => (0 : ℂ)) + contDiffOn_const (f := fun _ : ℂ => (1 : ℝ)) + (g := fun z y => F (z,y)) hs hk + (fun z y hzz hy => hz z hzz y hy) + (locallyIntegrable_const (μ := (volume : Measure ℂ)) (1 : ℝ)) hf + simpa only [convolution_def, ContinuousLinearMap.lsmul_apply, + smul_eq_mul, mul_one] using hh + +lemma fderiv_integral_apply (hs : IsOpen s) (hk : IsCompact k) + (hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) + (hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hzz : z ∈ s) (e : ℂ) : + fderiv ℝ (fun z : ℂ => ∫ y : ℂ, F (z,y)) z e = + ∫ y : ℂ, paramDeriv F e (z,y) := by + rw [(hasFDerivAt_integral hs hk hz hf hzz).fderiv] + change (∫ y : ℂ, fderiv ℝ F (z,y)) (e,0) = _ + exact ContinuousLinearMap.integral_apply + ((fderiv_section_continuous hs hf hzz).integrable_of_hasCompactSupport + (fderiv_section_compact hs hk hz hzz)) _ + +lemma fderiv_section_apply (hs : IsOpen s) + (hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hz : z ∈ s) (y e : ℂ) : + fderiv ℝ (fun z : ℂ => F (z,y)) z e = paramDeriv F e (z,y) := by + have hd := ((hf (z,y) ⟨hz, mem_univ y⟩).contDiffAt + ((hs.prod isOpen_univ).mem_nhds ⟨hz, mem_univ y⟩)).differentiableAt (by simp) + have hpair : HasFDerivAt (fun x : ℂ => (x,y)) (ContinuousLinearMap.inl ℝ ℂ ℂ) z := by + exact (hasFDerivAt_id z).prodMk (hasFDerivAt_const y z) + have hc := hd.hasFDerivAt.comp z hpair + exact congrArg (fun L : ℂ →L[ℝ] ℝ => L e) hc.fderiv + +lemma second_integral_apply (hs : IsOpen s) (hk : IsCompact k) + (hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) + (hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hzz : z ∈ s) (e : ℂ) : + fderiv ℝ (fun z : ℂ => fderiv ℝ (fun z : ℂ => ∫ y : ℂ, F (z,y)) z e) z e = + ∫ y : ℂ, paramDeriv (paramDeriv F e) e (z,y) := by + have he : (fun z : ℂ => fderiv ℝ (fun z : ℂ => ∫ y : ℂ, F (z,y)) z e) =ᶠ[𝓝 z] + (fun z : ℂ => ∫ y : ℂ, paramDeriv F e (z,y)) := by + filter_upwards [hs.mem_nhds hzz] with x hx + exact fderiv_integral_apply hs hk hz hf hx e + rw [he.fderiv_eq] + exact fderiv_integral_apply hs hk (partial_zero_outside hs hk.isClosed hz e) + (partial_contDiffOn hs hf e) hzz e + +lemma second_section_apply (hs : IsOpen s) + (hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hz : z ∈ s) (y e : ℂ) : + fderiv ℝ (fun z : ℂ => fderiv ℝ (fun z : ℂ => F (z,y)) z e) z e = + paramDeriv (paramDeriv F e) e (z,y) := by + have he : (fun z : ℂ => fderiv ℝ (fun z : ℂ => F (z,y)) z e) =ᶠ[𝓝 z] + (fun z : ℂ => paramDeriv F e (z,y)) := by + filter_upwards [hs.mem_nhds hz] with x hx + exact fderiv_section_apply hs hf hx y e + rw [he.fderiv_eq] + exact fderiv_section_apply hs (partial_contDiffOn hs hf e) hz y e + +lemma integrable_section (hk : IsCompact k) + (hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) + (hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hzz : z ∈ s) : + Integrable (fun y : ℂ => F (z,y)) := by + have hc : HasCompactSupport (fun y : ℂ => F (z,y)) := + HasCompactSupport.intro hk (hz z hzz) + exact (hf.continuousOn.comp_continuous (continuous_const.prodMk continuous_id) + (fun y => ⟨hzz, mem_univ y⟩)).integrable_of_hasCompactSupport hc + +lemma laplacian_directions_at {f : ℂ → ℝ} {z : ℂ} (hf : ContDiffAt ℝ ∞ f z) : + Δ f z = + fderiv ℝ (fun x : ℂ => fderiv ℝ f x 1) z 1 + + fderiv ℝ (fun x : ℂ => fderiv ℝ f x Complex.I) z Complex.I := by + rw [laplacian_eq_iteratedFDeriv_complexPlane] + simp only [iteratedFDeriv_two_apply, Fin.isValue, Matrix.cons_val_zero, Matrix.cons_val_one] + rw [fderiv_clm_apply ((hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp)) + (differentiableAt_const _), + fderiv_clm_apply ((hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp)) + (differentiableAt_const _)] + simp + +lemma laplacian_integral (hs : IsOpen s) (hk : IsCompact k) + (hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) + (hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hzz : z ∈ s) : + Δ (fun z : ℂ => ∫ y : ℂ, F (z,y)) z = + ∫ y : ℂ, Δ (fun z : ℂ => F (z,y)) z := by + have hfi : ContDiffAt ℝ ∞ (fun z : ℂ => ∫ y : ℂ, F (z,y)) z := + ((integral_contDiffOn hs hk hz hf) z hzz).contDiffAt (hs.mem_nhds hzz) + have hfs (y : ℂ) : ContDiffAt ℝ ∞ (fun z : ℂ => F (z,y)) z := + ((hf (z,y) ⟨hzz, mem_univ y⟩).contDiffAt + ((hs.prod isOpen_univ).mem_nhds ⟨hzz, mem_univ y⟩)).comp z + (contDiffAt_id.prodMk contDiffAt_const) + have hi (e : ℂ) : Integrable (fun y : ℂ => paramDeriv (paramDeriv F e) e (z,y)) := + integrable_section hk + (partial_zero_outside hs hk.isClosed (partial_zero_outside hs hk.isClosed hz e) e) + (partial_contDiffOn hs (partial_contDiffOn hs hf e) e) hzz + rw [laplacian_directions_at hfi, second_integral_apply hs hk hz hf hzz, + second_integral_apply hs hk hz hf hzz, ← integral_add (hi 1) (hi Complex.I)] + apply integral_congr_ae + filter_upwards [] with y + rw [laplacian_directions_at (hfs y), second_section_apply hs hf hzz, + second_section_apply hs hf hzz] + +end StrictHotSpots.CompactParameter + + +namespace StrictHotSpots.GreenPotential +open StrictHotSpots.GreenFundamental StrictHotSpots.DiskFormula + +lemma correction_potential_laplacian {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) {s : Set ℂ} (hs : IsOpen s) + (hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) {z : ℂ} (hz : z ∈ s) : + Δ (fun z : ℂ => ∫ y : ℂ, f y * Real.log ‖1-z*star y‖) z = 0 := by + change Δ (fun z : ℂ => ∫ y : ℂ, correctionIntegrand f (z,y)) z = 0 + rw [CompactParameter.laplacian_integral hs hc.isCompact + (F := correctionIntegrand f) + (fun z _ y hy => by simp [correctionIntegrand, image_eq_zero_of_notMem_tsupport hy]) + (correctionIntegrand_contDiffOn hf hn) hz] + apply integral_eq_zero_of_ae + filter_upwards [] with y + by_cases hy : f y = 0 + · simp [correctionIntegrand, hy] + · have hyt : y ∈ tsupport f := subset_tsupport _ hy + have ha : AnalyticAt ℂ (fun z : ℂ => 1-z*star y) z := + analyticAt_const.sub (analyticAt_id.mul analyticAt_const) + have hh := (ha.harmonicAt_log_norm (hn z hz y hyt)).const_smul (c := f y) + exact hh.2.self_of_nhds + +lemma log_potential_eq (f : ℂ → ℝ) (z : ℂ) : + ((fun x : ℂ => Real.log ‖x‖) ⋆ f) z = ∫ y : ℂ, f y * Real.log ‖z-y‖ := by + rw [← convolution_flip] + simp only [convolution_def, ContinuousLinearMap.flip_apply, + ContinuousLinearMap.lsmul_apply, smul_eq_mul] + apply integral_congr_ae + filter_upwards [] with y + ring + + +def potential (f : ℂ → ℝ) (z : ℂ) : ℝ := + (∫ y : ℂ, f y * Real.log ‖1-z*star y‖) / (2 * Real.pi) - + (((fun x : ℂ => Real.log ‖x‖) ⋆ f) z) / (2 * Real.pi) + +lemma potential_contDiffOn {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) {s : Set ℂ} (hs : IsOpen s) + (hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) : + ContDiffOn ℝ ∞ (potential f) s := + ((correction_potential_smooth hf hc hs hn).div_const _).sub + ((log_potential_smooth hf hc).contDiffOn.div_const _) + +lemma potential_laplacian {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) {s : Set ℂ} (hs : IsOpen s) + (hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) {z : ℂ} (hz : z ∈ s) : + Δ (potential f) z = -f z := by + have ha := ((correction_potential_smooth hf hc hs hn) z hz).contDiffAt (hs.mem_nhds hz) + have hb := (log_potential_smooth hf hc).contDiffAt (x := z) + have he : potential f = (2 * Real.pi)⁻¹ • + (fun z : ℂ => ∫ y : ℂ, f y * Real.log ‖1-z*star y‖) - + (2 * Real.pi)⁻¹ • ((fun x : ℂ => Real.log ‖x‖) ⋆ f) := by + funext x + simp only [potential, Pi.sub_apply, Pi.smul_apply, smul_eq_mul, div_eq_mul_inv] + ring + have ha2 : ContDiffAt ℝ 2 ((2 * Real.pi)⁻¹ • + (fun z : ℂ => ∫ y : ℂ, f y * Real.log ‖1-z*star y‖)) z := + (ha.const_smul ((2 * Real.pi)⁻¹)).of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2) + have hb2 : ContDiffAt ℝ 2 ((2 * Real.pi)⁻¹ • + ((fun x : ℂ => Real.log ‖x‖) ⋆ f)) z := + (hb.const_smul ((2 * Real.pi)⁻¹)).of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2) + rw [he, ha2.laplacian_sub hb2, + laplacian_smul _ (ha.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)), + laplacian_smul _ (hb.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)), + correction_potential_laplacian hf hc hs hn hz, log_potential_laplacian hf hc] + simp only [smul_eq_mul, mul_zero, zero_sub, neg_inj] + field_simp + +lemma potential_eq_zero_on_circle (f : ℂ → ℝ) {z : ℂ} (hz : ‖z‖ = 1) : + potential f z = 0 := by + have he (y : ℂ) : ‖1-z*star y‖ = ‖z-y‖ := by + have hh := disk_cross_identity z y + rw [hz] at hh + nlinarith [norm_nonneg (1-z*star y), norm_nonneg (z-y)] + simp only [potential, he, log_potential_eq, sub_self] + +lemma potential_eq_integral {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) {s : Set ℂ} (_hs : IsOpen s) + (hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) {z : ℂ} (hz : z ∈ s) : + potential f z = ∫ y : ℂ, green z y * f y := by + have hi : Integrable (fun y : ℂ => f y * Real.log ‖1-z*star y‖) := + CompactParameter.integrable_section hc.isCompact + (F := correctionIntegrand f) + (fun z _ y hy => by simp [correctionIntegrand, image_eq_zero_of_notMem_tsupport hy]) + (correctionIntegrand_contDiffOn hf hn) hz + have hj : Integrable (fun y : ℂ => f y * Real.log ‖z-y‖) := by + simpa only [norm_sub_rev z, mul_comm] using log_sub_mul_integrable hf.continuous hc z + rw [potential, log_potential_eq, ← integral_div, ← integral_div, + ← integral_sub (hi.div_const _) (hj.div_const _)] + apply integral_congr_ae + filter_upwards [volume.ae_ne z] with y hy + by_cases hfy : f y = 0 + · simp [hfy] + · rw [green_eq_log (Ne.symm hy) (hn z hz y (subset_tsupport _ hfy))] + ring + +lemma exists_regular_neighborhood {f : ℂ → ℝ} (hc : HasCompactSupport f) + (hd : tsupport f ⊆ Metric.ball (0 : ℂ) 1) : + ∃ R : ℝ, 1 < R ∧ ∀ z ∈ Metric.ball (0 : ℂ) R, + ∀ y ∈ tsupport f, 1-z*star y ≠ 0 := by + obtain ⟨a, ha, hsub⟩ := exists_pos_lt_subset_ball (by norm_num : (0 : ℝ) < 1) + hc.isCompact.isClosed hd + refine ⟨a⁻¹, (one_lt_inv₀ ha.1).mpr ha.2, ?_⟩ + intro z hz y hy + have hz' : ‖z‖ < a⁻¹ := by simpa using hz + have hy' : ‖y‖ < a := by simpa using hsub hy + have hp : ‖z*star y‖ < 1 := by + rw [norm_mul, norm_star] + calc + _ ≤ ‖z‖ * a := mul_le_mul_of_nonneg_left hy'.le (norm_nonneg _) + _ < a⁻¹ * a := mul_lt_mul_of_pos_right hz' ha.1 + _ = 1 := inv_mul_cancel₀ ha.1.ne' + intro he + have hm : z*star y = 1 := (sub_eq_zero.mp he).symm + rw [hm, norm_one] at hp + exact lt_irrefl _ hp + +lemma potential_smooth_near_closed_disk {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) (hd : tsupport f ⊆ Metric.ball (0 : ℂ) 1) : + ∃ R : ℝ, 1 < R ∧ ContDiffOn ℝ ∞ (potential f) (Metric.ball 0 R) ∧ + (∀ z ∈ Metric.ball (0 : ℂ) R, Δ (potential f) z = -f z) := by + obtain ⟨R,hR,hn⟩ := exists_regular_neighborhood hc hd + exact ⟨R,hR,potential_contDiffOn hf hc Metric.isOpen_ball hn, + fun z hz => potential_laplacian hf hc Metric.isOpen_ball hn hz⟩ + +end StrictHotSpots.GreenPotential + + + + +open InnerProductSpace +open scoped Laplacian ContDiff +namespace StrictHotSpots + +lemma laplacian_comp_linearIsometryEquiv + {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] + (g : E ≃ₗᵢ[ℝ] F) (f : F → ℝ) (x : E) : + Δ (f ∘ g) x = Δ f (g x) := by + let b := stdOrthonormalBasis ℝ E + rw [laplacian_eq_iteratedFDeriv_orthonormalBasis _ b, + laplacian_eq_iteratedFDeriv_orthonormalBasis _ (b.map g)] + have he : iteratedFDeriv ℝ 2 (f ∘ g) x = + (iteratedFDeriv ℝ 2 f (g x)).compContinuousLinearMap (fun _ => g.toContinuousLinearEquiv.toContinuousLinearMap) := by + simpa [iteratedFDerivWithin_univ] using g.toContinuousLinearEquiv.iteratedFDerivWithin_comp_right f + uniqueDiffOn_univ (Set.mem_univ (g x)) 2 + simp only [he, ContinuousMultilinearMap.compContinuousLinearMap_apply] + apply Finset.sum_congr rfl + intro i _ + congr 1 + funext j + fin_cases j <;> simp + +end StrictHotSpots + + +namespace StrictHotSpots.PlaneGreen +open GreenPotential DiskH10 + +lemma diskOpen : IsOpen disk := Metric.isOpen_ball + +noncomputable def complexIso : ℂ ≃ₗᵢ[ℝ] Plane := Complex.orthonormalBasisOneI.repr + +def source (f : Plane → ℝ) (z : ℂ) : ℝ := f (complexIso z) + +def potential (f : Plane → ℝ) (x : Plane) : ℝ := + GreenPotential.potential (source f) (complexIso.symm x) + +lemma source_contDiff {f : Plane → ℝ} (hf : ContDiff ℝ ∞ f) : + ContDiff ℝ ∞ (source f) := + hf.comp complexIso.toContinuousLinearEquiv.contDiff + +lemma source_compact {f : Plane → ℝ} (hc : HasCompactSupport f) : + HasCompactSupport (source f) := + hc.comp_homeomorph complexIso.toHomeomorph + +lemma source_support {f : Plane → ℝ} (hs : tsupport f ⊆ disk) : + tsupport (source f) ⊆ Metric.ball (0 : ℂ) 1 := by + intro z hz + have he := Set.ext_iff.mp (tsupport_comp_eq_preimage f complexIso.toHomeomorph) z + have hm : complexIso z ∈ disk := hs (he.mp hz) + simpa [disk] using hm + +lemma smooth_near_closed_disk {f : Plane → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) (hs : tsupport f ⊆ disk) : + ∃ R : ℝ, 1 < R ∧ ContDiffOn ℝ ∞ (potential f) (Metric.ball 0 R) ∧ + (∀ x ∈ Metric.ball (0 : Plane) R, Δ (potential f) x = -f x) := by + obtain ⟨R,hR,hu,hp⟩ := GreenPotential.potential_smooth_near_closed_disk + (source_contDiff hf) (source_compact hc) (source_support hs) + refine ⟨R,hR,?_,?_⟩ + · exact hu.comp complexIso.symm.toContinuousLinearEquiv.contDiff.contDiffOn + (fun x hx => by simpa using hx) + · intro x hx + change Δ (GreenPotential.potential (source f) ∘ complexIso.symm) x = -f x + rw [laplacian_comp_linearIsometryEquiv] + have hh := hp (complexIso.symm x) (by simpa using hx) + simpa [source] using hh + +lemma zero_on_circle (f : Plane → ℝ) {x : Plane} (hx : ‖x‖ = 1) : + potential f x = 0 := + GreenPotential.potential_eq_zero_on_circle (source f) (by simpa using hx) + +lemma value_mk (w : H1 disk) (hw : w ∈ h10Submodule diskOpen) : + H10.value diskOpen ⟨w,hw⟩ = H1.value w := rfl + +lemma grad_mk (w : H1 disk) (hw : w ∈ h10Submodule diskOpen) : + H10.grad diskOpen ⟨w,hw⟩ = H1.grad w := rfl + +lemma energy_mk (w : H1 disk) (hw : w ∈ h10Submodule diskOpen) (v : H10 diskOpen) : + H10.energy diskOpen ⟨w,hw⟩ v = inner ℝ (H1.grad w) (H10.grad diskOpen v) := rfl + +lemma exists_smooth_weak_solution {u f : Plane → ℝ} {R : ℝ} + (hR : 1 < R) (hu : ContDiffOn ℝ ∞ u (Metric.ball 0 R)) + (hz : ∀ x : Plane, ‖x‖ = 1 → u x = 0) + (hf : MemLp f 2 (volume.restrict disk)) + (hp : ∀ x ∈ disk, Δ u x = -f x) : + ∃ w : H10 (Ω := disk) diskOpen, + (H10.value diskOpen w =ᵐ[volume.restrict disk] u) ∧ + ∀ v : H10 (Ω := disk) diskOpen, + H10.energy diskOpen w v = inner ℝ (hf.toLp f) (H10.value diskOpen v) := by + let h : HasH1Gradient disk u (gradient u) := smooth_memH1 hR hu + have hm : h.toH1 ∈ h10Submodule diskOpen := smooth_zero_boundary_memH10 hR hu hz + refine ⟨⟨h.toH1,hm⟩,?_,?_⟩ + · rw [value_mk, H1.value_toH1] + exact h.1.coeFn_toLp + · intro v + rw [energy_mk] + exact smooth_weak_poisson diskOpen (hu.mono (Metric.ball_subset_ball hR.le)) h hf hp v + + + +lemma exists_dirichlet_representative {f : Plane → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) (hs : tsupport f ⊆ disk) : + ∃ u : H10 (Ω := disk) diskOpen, + (H10.value diskOpen u =ᵐ[volume.restrict disk] potential f) ∧ + ∀ v : H10 (Ω := disk) diskOpen, + H10.energy diskOpen u v = + inner ℝ ((test_memLp (Ω := disk) hf hc).toLp f) (H10.value diskOpen v) := by + have hex : ∃ R : ℝ, 1 < R ∧ ContDiffOn ℝ ∞ (potential f) (Metric.ball 0 R) ∧ + (∀ x ∈ Metric.ball (0 : Plane) R, Δ (potential f) x = -f x) := + smooth_near_closed_disk (f := f) hf hc hs + rcases hex with ⟨R,hR,hu,hp⟩ + refine exists_smooth_weak_solution (u := potential f) (f := f) (R := R) hR hu + ?_ (test_memLp (Ω := disk) hf hc) ?_ + · intro x hx + exact zero_on_circle f hx + · intro x hx + exact hp x (Metric.ball_subset_ball hR.le hx) + +end StrictHotSpots.PlaneGreen + + + + + + + +end WeightedLayer + +end FullBoundaryCombinedLayer + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/GreenOperator.lean b/lean/OAI/Analysis/HotSpots/GreenOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..04caa3e4d4fbbb78805c92ecc7ea0d3609028f6f --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/GreenOperator.lean @@ -0,0 +1,968 @@ +import OAI.Analysis.HotSpots.Green + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section FullBoundaryCombinedLayer +section WeightedLayer +open Set MeasureTheory +open scoped ContDiff InnerProductSpace ENNReal NNReal +open Set Filter MeasureTheory InnerProductSpace NormedSpace +open scoped Topology ContDiff +open scoped Laplacian +open Set MeasureTheory Filter InnerProductSpace Bornology +open scoped Topology Laplacian ContDiff RealInnerProductSpace +open scoped Convolution +open Set MeasureTheory Filter InnerProductSpace +open scoped Topology ContDiff Convolution Laplacian +open InnerProductSpace +open scoped Laplacian ContDiff + +open Filter Set +open scoped Topology +namespace StrictHotSpots.DiskFormula + +def poisson (s x : ℂ) : ℝ := (1 - ‖x‖ ^ 2) / (2 * Real.pi * ‖s-x‖ ^ 2) + +def boundaryInteraction (s t : ℂ) : ℝ := 1 / (Real.pi * ‖s-t‖ ^ 2) + +private def logRatio (u : ℝ) : ℝ := dslope Real.log 1 (1+u) + +private lemma logRatio_zero : logRatio 0 = 1 := by + simp [logRatio, Real.deriv_log] + +private lemma logRatio_continuousAt_zero : ContinuousAt logRatio 0 := by + have hd : ContinuousAt (dslope Real.log 1) 1 := + continuousAt_dslope_same.mpr (Real.differentiableAt_log one_ne_zero) + exact hd.comp_of_eq (show ContinuousAt (fun t : ℝ => 1+t) 0 from + continuousAt_const.add continuousAt_id) (by simp) + +private lemma log_eq_mul_ratio (u : ℝ) : Real.log (1+u) = u * logRatio u := by + have h := sub_smul_dslope Real.log 1 (1+u) + simpa [logRatio, smul_eq_mul] using h.symm + +lemma tendsto_log_mul_div {α : Type*} {l : Filter α} {a b : α → ℝ} {B : ℝ} + (ha : Tendsto a l (𝓝 0)) (hb : Tendsto b l (𝓝 B)) + (hne : ∀ᶠ z in l, a z ≠ 0) : + Tendsto (fun z => Real.log (1 + a z * b z) / a z) l (𝓝 B) := by + have hu : Tendsto (fun z => a z * b z) l (𝓝 0) := by simpa using ha.mul hb + have ht := (logRatio_continuousAt_zero.tendsto.comp hu).mul hb + rw [logRatio_zero, one_mul] at ht + apply ht.congr' + filter_upwards [hne] with z hz + rw [log_eq_mul_ratio] + dsimp only [Function.comp_def] + field_simp [hz] + +lemma radial_one_formula (s x : ℂ) (hs : ‖s‖ = 1) (r : ℝ) : + green (r • s) x = Real.log (1 + (1-r^2) * (1-‖x‖^2) / ‖r • s-x‖^2) / + (4 * Real.pi) := by + simp only [green, norm_smul, Real.norm_eq_abs, hs, mul_one, sq_abs] + +lemma radial_one (s x : ℂ) (hs : ‖s‖ = 1) (hx : ‖x‖ < 1) : + Tendsto (fun r : ℝ => green (r • s) x / (1-r)) (𝓝[<] 1) (𝓝 (poisson s x)) := by + have hne : s-x ≠ 0 := by + intro h + have he : s = x := sub_eq_zero.mp h + rw [← he, hs] at hx + exact lt_irrefl _ hx + have hden : ‖s-x‖^2 ≠ 0 := pow_ne_zero _ (norm_ne_zero_iff.mpr hne) + have hd : ContinuousAt (fun r : ℝ => ‖r • s-x‖^2) 1 := by fun_prop + have hb : Tendsto (fun r : ℝ => (1+r)*(1-‖x‖^2)/‖r • s-x‖^2) + (𝓝[<] 1) (𝓝 (2*(1-‖x‖^2)/‖s-x‖^2)) := by + have hh : ContinuousAt (fun r : ℝ => (1+r)*(1-‖x‖^2)/‖r • s-x‖^2) 1 := + ((continuousAt_const.add continuousAt_id).mul continuousAt_const).div hd + (by simpa using hden) + convert hh.tendsto.mono_left nhdsWithin_le_nhds using 1; norm_num + have ha : Tendsto (fun r : ℝ => 1-r) (𝓝[<] 1) (𝓝 0) := by + simpa using (tendsto_const_nhds.sub (tendsto_id.mono_left nhdsWithin_le_nhds) : + Tendsto (fun r : ℝ => 1-r) (𝓝[<] 1) (𝓝 (1-1))) + have hevent : ∀ᶠ r : ℝ in 𝓝[<] 1, (1-r) ≠ 0 := by + filter_upwards [self_mem_nhdsWithin] with r hr + exact (sub_pos.mpr hr).ne' + have ht := (tendsto_log_mul_div ha hb hevent).div_const (4*Real.pi) + have hv : 2*(1-‖x‖^2)/‖s-x‖^2/(4*Real.pi) = poisson s x := by + simp only [poisson] + field_simp + ring + rw [hv] at ht + apply ht.congr' + exact Filter.Eventually.of_forall fun r => by + dsimp only + rw [radial_one_formula s x hs] + have he : (1-r^2)*(1-‖x‖^2)/‖r • s-x‖^2 = + (1-r)*((1+r)*(1-‖x‖^2)/‖r • s-x‖^2) := by ring + rw [he] + ring + +lemma radial_two_formula (s t : ℂ) (hs : ‖s‖ = 1) (ht : ‖t‖ = 1) (r : ℝ) : + green (r • s) (r • t) = + Real.log (1 + (1-r^2)^2 / (r^2 * ‖s-t‖^2)) / (4*Real.pi) := by + simp only [green, ← smul_sub, norm_smul, Real.norm_eq_abs, hs, ht, mul_one, + mul_pow, sq_abs, ← pow_two] + +lemma radial_two (s t : ℂ) (hs : ‖s‖ = 1) (ht : ‖t‖ = 1) (hne : s ≠ t) : + Tendsto (fun r : ℝ => green (r • s) (r • t) / (1-r)^2) + (𝓝[<] 1) (𝓝 (boundaryInteraction s t)) := by + have hden : ‖s-t‖^2 ≠ 0 := pow_ne_zero _ (norm_ne_zero_iff.mpr (sub_ne_zero.mpr hne)) + have hb : Tendsto (fun r : ℝ => (1+r)^2 / (r^2 * ‖s-t‖^2)) + (𝓝[<] 1) (𝓝 (4 / ‖s-t‖^2)) := by + have hh : ContinuousAt (fun r : ℝ => (1+r)^2 / (r^2 * ‖s-t‖^2)) 1 := by + apply ContinuousAt.div (by fun_prop) (by fun_prop) + simpa using hden + convert hh.tendsto.mono_left nhdsWithin_le_nhds using 1; norm_num + have ha : Tendsto (fun r : ℝ => (1-r)^2) (𝓝[<] 1) (𝓝 0) := by + have hh : ContinuousAt (fun r : ℝ => (1-r)^2) 1 := by fun_prop + convert hh.tendsto.mono_left nhdsWithin_le_nhds using 1; norm_num + have hevent : ∀ᶠ r : ℝ in 𝓝[<] 1, (1-r)^2 ≠ 0 := by + filter_upwards [self_mem_nhdsWithin] with r hr + exact pow_ne_zero _ (sub_pos.mpr hr).ne' + have hz := (tendsto_log_mul_div ha hb hevent).div_const (4*Real.pi) + have hv : 4/‖s-t‖^2/(4*Real.pi) = boundaryInteraction s t := by + simp only [boundaryInteraction] + field_simp + rw [hv] at hz + apply hz.congr' + exact Filter.Eventually.of_forall fun r => by + dsimp only + rw [radial_two_formula s t hs ht] + have he : (1-r^2)^2/(r^2*‖s-t‖^2) = + (1-r)^2*((1+r)^2/(r^2*‖s-t‖^2)) := by ring + rw [he] + ring + +end StrictHotSpots.DiskFormula + + + + +open MeasureTheory Filter +open scoped Topology ENNReal + + +namespace StrictHotSpots.DiskFormula +open MeasureTheory + +lemma log_mul_div_bounds {a b : ℝ} (ha : 0 < a) (hb : 0 ≤ b) : + 0 ≤ Real.log (1+a*b)/a ∧ Real.log (1+a*b)/a ≤ b := by + have h1 : 1 ≤ 1+a*b := by linarith [mul_nonneg ha.le hb] + constructor + · exact div_nonneg (Real.log_nonneg h1) ha.le + · apply (div_le_iff₀ ha).mpr + have hh := Real.log_le_sub_one_of_pos (lt_of_lt_of_le zero_lt_one h1) + nlinarith + +lemma radial_one_bounded (s x : ℂ) (hs : ‖s‖ = 1) + {R rmin r : ℝ} (hR : ‖x‖ ≤ R) (hRmin : R < rmin) + (hrmin : rmin ≤ r) (hr : r < 1) : + 0 ≤ green (r • s) x / (1-r) ∧ + green (r • s) x / (1-r) ≤ (2/(rmin-R)^2)/(4*Real.pi) := by + have hR0 : 0 ≤ R := (norm_nonneg x).trans hR + have hr0 : 0 ≤ r := hR0.trans (hRmin.le.trans hrmin) + have hx1 : ‖x‖ < 1 := hR.trans_lt (hRmin.trans_le hrmin |>.trans hr) + have hx2 : 0 ≤ 1-‖x‖^2 := by nlinarith [norm_nonneg x] + have hδ : 0 < rmin-R := sub_pos.mpr hRmin + have hdist : rmin-R ≤ ‖r • s-x‖ := by + have hh := norm_sub_norm_le (r • s) x + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg hr0, hs, mul_one] at hh + linarith + have hdist0 : 0 < ‖r • s-x‖ := hδ.trans_le hdist + have hd2 : (rmin-R)^2 ≤ ‖r • s-x‖^2 := sq_le_sq₀ hδ.le (norm_nonneg _) |>.mpr hdist + have hnum : (1+r)*(1-‖x‖^2) ≤ 2 := by nlinarith [sq_nonneg ‖x‖] + have hb0 : 0 ≤ (1+r)*(1-‖x‖^2)/‖r • s-x‖^2 := by positivity + have hb : (1+r)*(1-‖x‖^2)/‖r • s-x‖^2 ≤ 2/(rmin-R)^2 := by + calc + _ ≤ 2/‖r • s-x‖^2 := div_le_div_of_nonneg_right hnum (sq_nonneg _) + _ ≤ _ := div_le_div_of_nonneg_left (by norm_num) (sq_pos_of_pos hδ) hd2 + have hlog := log_mul_div_bounds (sub_pos.mpr hr) hb0 + have he : green (r • s) x/(1-r) = + (Real.log (1 + (1-r)*((1+r)*(1-‖x‖^2)/‖r • s-x‖^2))/(1-r))/(4*Real.pi) := by + rw [radial_one_formula s x hs] + have hh : (1-r^2)*(1-‖x‖^2)/‖r • s-x‖^2 = + (1-r)*((1+r)*(1-‖x‖^2)/‖r • s-x‖^2) := by ring + rw [hh] + ring + rw [he] + exact ⟨div_nonneg hlog.1 (by positivity), + div_le_div_of_nonneg_right (hlog.2.trans hb) (by positivity)⟩ + +end StrictHotSpots.DiskFormula + +namespace StrictHotSpots.DiskFormula +open MeasureTheory +variable {X : Type*} [MeasurableSpace X] (ν : Measure X) [IsFiniteMeasure ν] + +lemma poisson_nonneg (s x : ℂ) (hx : ‖x‖ < 1) : 0 ≤ poisson s x := by + have hh : 0 ≤ 1-‖x‖^2 := by nlinarith [norm_nonneg x] + exact div_nonneg hh (by positivity) + +lemma poisson_bounded (s x : ℂ) (hs : ‖s‖ = 1) + {R : ℝ} (hR : ‖x‖ ≤ R) (hR1 : R < 1) : + poisson s x ≤ 1 / (2*Real.pi*(1-R)^2) := by + have hh := norm_sub_norm_le s x + rw [hs] at hh + have hd : 1-R ≤ ‖s-x‖ := by linarith + have hd0 : 0 < 1-R := sub_pos.mpr hR1 + have hd2 : (1-R)^2 ≤ ‖s-x‖^2 := (sq_le_sq₀ hd0.le (norm_nonneg _)).mpr hd + have hn : 1-‖x‖^2 ≤ 1 := by nlinarith [sq_nonneg ‖x‖] + unfold poisson + calc + _ ≤ 1/(2*Real.pi*‖s-x‖^2) := div_le_div_of_nonneg_right hn (by positivity) + _ ≤ _ := div_le_div_of_nonneg_left (by norm_num) (by positivity) + (mul_le_mul_of_nonneg_left hd2 (by positivity)) + +lemma poisson_memLp (s : ℂ) (hs : ‖s‖ = 1) (x : X → ℂ) (hm : Measurable x) + {R : ℝ} (hR : ∀ z, ‖x z‖ ≤ R) (hR1 : R < 1) : + MemLp (fun z => poisson s (x z)) 2 ν := by + refine MemLp.of_bound ?_ (1 / (2*Real.pi*(1-R)^2)) ?_ + · apply Measurable.aestronglyMeasurable + unfold poisson + fun_prop + · exact Filter.Eventually.of_forall fun z => by + rw [Real.norm_eq_abs, abs_of_nonneg (poisson_nonneg s (x z) ((hR z).trans_lt hR1))] + exact poisson_bounded s (x z) hs (hR z) hR1 + +lemma radial_one_memLp (s : ℂ) (hs : ‖s‖ = 1) (x : X → ℂ) (hm : Measurable x) + {R rmin r : ℝ} (hR : ∀ z, ‖x z‖ ≤ R) (hRmin : R < rmin) + (hrmin : rmin ≤ r) (hr : r < 1) : + MemLp (fun z => green (r • s) (x z)/(1-r)) 2 ν := by + refine MemLp.of_bound ?_ ((2/(rmin-R)^2)/(4*Real.pi)) ?_ + · apply Measurable.aestronglyMeasurable + unfold green + fun_prop + · exact Filter.Eventually.of_forall fun z => by + obtain ⟨h0,hb⟩ := radial_one_bounded s (x z) hs (hR z) hRmin hrmin hr + simpa only [Real.norm_eq_abs, abs_of_nonneg h0] using hb + + + +theorem radial_one_L2 (s : ℂ) (hs : ‖s‖ = 1) (x : X → ℂ) (hm : Measurable x) + {R rmin : ℝ} (hR : ∀ z, ‖x z‖ ≤ R) (hRmin : R < rmin) (hrmin1 : rmin < 1) + (r : ℕ → ℝ) (hrmin : ∀ n, rmin ≤ r n) (hr : ∀ n, r n < 1) + (hlim : Tendsto r atTop (𝓝 1)) : + Tendsto (fun n => (radial_one_memLp ν s hs x hm hR hRmin (hrmin n) (hr n)).toLp + (fun z => green (r n • s) (x z) / (1-r n))) atTop + (𝓝 ((poisson_memLp ν s hs x hm hR (hRmin.trans hrmin1)).toLp + (fun z => poisson s (x z)))) := by + apply L2Limits.tendsto_toLp_of_dominated + (hb := memLp_const ((2/(rmin-R)^2)/(4*Real.pi))) + · apply Filter.Eventually.of_forall + intro n + exact Filter.Eventually.of_forall fun z => by + obtain ⟨h0,hb⟩ := radial_one_bounded s (x z) hs (hR z) hRmin (hrmin n) (hr n) + simpa only [Real.norm_eq_abs, abs_of_nonneg h0] using hb + · exact Filter.Eventually.of_forall fun z => + (radial_one s (x z) hs ((hR z).trans_lt (hRmin.trans hrmin1))).comp + (tendsto_nhdsWithin_iff.mpr ⟨hlim, Filter.Eventually.of_forall fun n => hr n⟩) + +end StrictHotSpots.DiskFormula + + + + + +open MeasureTheory Filter Metric Set +open scoped Topology ENNReal +namespace StrictHotSpots.GreenLp + +def logPole (z : ℂ) : ℝ := Real.log (1 + 1 / ‖z‖^2) + +lemma logPole_nonneg (z : ℂ) : 0 ≤ logPole z := by + apply Real.log_nonneg + have : 0 ≤ 1 / ‖z‖^2 := one_div_nonneg.mpr (sq_nonneg _) + linarith + +lemma measurable_logPole : Measurable logPole := by + unfold logPole + fun_prop + +lemma logPole_cube_bound {t : ℝ} (ht : 0 < t) (ht2 : t ≤ 2) : + (Real.log (1 + 1/t^2))^3 ≤ 648 / t := by + have harg : 1 + 1/t^2 ≤ (3/t)^2 := by + rw [div_pow] + apply (le_div_iff₀ (sq_pos_of_pos ht)).2 + field_simp + nlinarith + have hl : Real.log (1 + 1/t^2) ≤ 2 * Real.log (3/t) := by + have hh := Real.log_le_log (by positivity : 0 < 1 + 1/t^2) harg + simpa only [Real.log_pow, Nat.cast_ofNat] using hh + have hp : 0 < 3/t := by positivity + have hr := Real.log_le_rpow_div hp.le (show 0 < (3:ℝ)⁻¹ by norm_num) + have he : Real.log (1 + 1/t^2) ≤ 6 * (3/t)^((3:ℝ)⁻¹) := by + norm_num at hr + linarith + have hnon : 0 ≤ Real.log (1 + 1/t^2) := by + apply Real.log_nonneg + have := one_div_nonneg.mpr (sq_nonneg t) + linarith + have hh := pow_le_pow_left₀ hnon he 3 + have hh3 : ((3/t)^((3:ℝ)⁻¹))^3 = 3/t := by + simpa only [Nat.cast_ofNat] using + Real.rpow_inv_natCast_pow hp.le (show (3:ℕ) ≠ 0 by decide) + rw [mul_pow, hh3] at hh + calc + _ ≤ 6^3 * (3/t) := hh + _ = 648/t := by ring + +lemma logPole_cube_integrable : IntegrableOn (fun z : ℂ => (logPole z)^3) (ball 0 2) := by + apply integrableOn_ball_of_norm_le_rpow (C := 648) (α := 1) + (by norm_num : 1 ≤ Module.finrank ℝ ℂ) (by norm_num : (1:ℝ) < Module.finrank ℝ ℂ) + · filter_upwards [self_mem_ae_restrict measurableSet_ball] with z hz + rw [Real.norm_of_nonneg (pow_nonneg (logPole_nonneg z) _), Real.rpow_neg_one] + by_cases hzero : z = 0 + · simp [hzero, logPole] + · have hp := norm_pos_iff.mpr hzero + have hlt : ‖z‖ < 2 := by simpa using hz + simpa only [logPole, div_eq_mul_inv] using logPole_cube_bound hp hlt.le + · exact (measurable_logPole.pow_const 3).aestronglyMeasurable + +lemma logPole_memLp_three : MemLp logPole 3 (volume.restrict (ball 0 2)) := by + apply (integrable_norm_rpow_iff measurable_logPole.aestronglyMeasurable + (by norm_num : (3:ℝ≥0∞) ≠ 0) (by simp : (3:ℝ≥0∞) ≠ (∞ : ℝ≥0∞))).1 + simpa only [IntegrableOn, ENNReal.toReal_ofNat, ← Real.rpow_natCast, Nat.cast_ofNat, + Real.norm_of_nonneg (logPole_nonneg _)] using logPole_cube_integrable + +lemma shifted_logPole_memLp_three (x : ℂ) (hx : ‖x‖ < 1) : + MemLp (fun y => logPole (x-y)) 3 (volume.restrict (ball 0 1)) := by + have hpres := (measurePreserving_sub_right (volume : Measure ℂ) x).restrict_preimage + (show MeasurableSet (ball (0:ℂ) 2) from measurableSet_ball) + have hh := logPole_memLp_three.comp_measurePreserving hpres + have hsub : ball (0:ℂ) 1 ⊆ (fun y => y-x) ⁻¹' ball 0 2 := by + intro y hy + have hy' : ‖y‖ < 1 := by simpa using hy + have hd := norm_sub_le y x + change y-x ∈ ball (0:ℂ) 2 + rw [mem_ball_zero_iff] + linarith + have hm := MemLp.mono_measure (Measure.restrict_mono hsub le_rfl) hh + convert hm using 1 + funext y + dsimp only [Function.comp_def, logPole] + rw [norm_sub_rev] + +end StrictHotSpots.GreenLp + + +open MeasureTheory Filter Metric Set +open scoped Topology ENNReal +namespace StrictHotSpots.DiskFormula +open GreenLp + +lemma measurable_green_left (x : ℂ) : Measurable (green x) := by + unfold green + fun_prop + +lemma green_bounds {x y : ℂ} (hx : ‖x‖ ≤ 1) (hy : ‖y‖ ≤ 1) : + 0 ≤ green x y ∧ green x y ≤ logPole (x-y) / (4*Real.pi) := by + have hwx : 0 ≤ 1-‖x‖^2 := by nlinarith [norm_nonneg x] + have hwy : 0 ≤ 1-‖y‖^2 := by nlinarith [norm_nonneg y] + have hn : (1-‖x‖^2)*(1-‖y‖^2) ≤ 1 := by + nlinarith [sq_nonneg ‖x‖, sq_nonneg ‖y‖, mul_nonneg hwx (sq_nonneg ‖y‖)] + have hdiv : 0 ≤ (1-‖x‖^2)*(1-‖y‖^2)/‖x-y‖^2 := by positivity + have hdiv' := div_le_div_of_nonneg_right hn (sq_nonneg ‖x-y‖) + have hlog : 0 ≤ Real.log (1+(1-‖x‖^2)*(1-‖y‖^2)/‖x-y‖^2) := + Real.log_nonneg (by linarith) + refine ⟨div_nonneg hlog (by positivity), ?_⟩ + apply div_le_div_of_nonneg_right _ (by positivity : 0 ≤ 4*Real.pi) + exact Real.log_le_log (by linarith) (by simpa only [logPole] using add_le_add_right hdiv' 1) + +lemma green_pos {x y : ℂ} (hx : ‖x‖ < 1) (hy : ‖y‖ < 1) (hne : x ≠ y) : + 0 < green x y := by + apply div_pos _ (by positivity) + apply Real.log_pos + have hwx : 0 < 1-‖x‖^2 := by nlinarith [norm_nonneg x] + have hwy : 0 < 1-‖y‖^2 := by nlinarith [norm_nonneg y] + have hd : 0 < ‖x-y‖^2 := sq_pos_of_pos (norm_pos_iff.mpr (sub_ne_zero.mpr hne)) + have := div_pos (mul_pos hwx hwy) hd + linarith + +lemma green_memLp_three (x : ℂ) (hx : ‖x‖ < 1) : + MemLp (green x) 3 (volume.restrict (ball 0 1)) := by + have hm : MemLp (fun y => logPole (x-y)/(4*Real.pi)) 3 + (volume.restrict (ball 0 1)) := by + simpa only [div_eq_mul_inv] using + (shifted_logPole_memLp_three x hx).mul_const (4*Real.pi)⁻¹ + apply hm.mono (measurable_green_left x).aestronglyMeasurable + filter_upwards [self_mem_ae_restrict measurableSet_ball] with y hy + have hy' : ‖y‖ ≤ 1 := (by simpa using hy : ‖y‖ < 1).le + have hb := green_bounds hx.le hy' + rw [Real.norm_of_nonneg hb.1, Real.norm_of_nonneg (div_nonneg (logPole_nonneg (x-y)) (by positivity : + 0 ≤ 4*Real.pi))] + exact hb.2 + +lemma green_memLp_two (x : ℂ) (hx : ‖x‖ < 1) : + MemLp (green x) 2 (volume.restrict (ball 0 1)) := by + have : IsFiniteMeasure (volume.restrict (ball (0:ℂ) 1)) := + ⟨by simpa only [Measure.restrict_apply_univ] using measure_ball_lt_top (x := (0:ℂ)) (r := 1)⟩ + exact (green_memLp_three x hx).mono_exponent (by norm_num) + +lemma green_memLp_three_of_le (ν : Measure ℂ) {A : ℝ≥0∞} (hA : A ≠ (∞ : ℝ≥0∞)) + (hν : ν ≤ A • volume.restrict (ball 0 1)) (x : ℂ) (hx : ‖x‖ < 1) : + MemLp (green x) 3 ν := + MemLp.mono_measure hν ((green_memLp_three x hx).smul_measure hA) + +lemma green_memLp_two_of_le (ν : Measure ℂ) {A : ℝ≥0∞} (hA : A ≠ (∞ : ℝ≥0∞)) + (hν : ν ≤ A • volume.restrict (ball 0 1)) (x : ℂ) (hx : ‖x‖ < 1) : + MemLp (green x) 2 ν := + MemLp.mono_measure hν ((green_memLp_two x hx).smul_measure hA) + +end StrictHotSpots.DiskFormula + + +open MeasureTheory Filter Metric Set +open scoped Topology ENNReal +namespace StrictHotSpots.GreenLp + +lemma logPole_memLp_two : MemLp logPole 2 (volume.restrict (ball (0 : ℂ) 2)) := by + let : IsFiniteMeasure (volume.restrict (ball (0 : ℂ) 2)) := + isFiniteMeasure_restrict.mpr Metric.isBounded_ball.measure_lt_top.ne + exact logPole_memLp_three.mono_exponent (by norm_num) + +lemma shifted_logPole_norm_bound (x : ℂ) (hx : ‖x‖ < 1) : + eLpNorm (fun y => logPole (x-y)) 2 (volume.restrict (ball 0 1)) ≤ + eLpNorm logPole 2 (volume.restrict (ball (0 : ℂ) 2)) := by + have hm := (measurePreserving_sub_right (volume : Measure ℂ) x).restrict_preimage + (show MeasurableSet (ball (0 : ℂ) 2) from measurableSet_ball) + have hs : ball (0 : ℂ) 1 ⊆ (fun y => y-x) ⁻¹' ball 0 2 := by + intro y hy + have hy' : ‖y‖ < 1 := by simpa using hy + have hd := norm_sub_le y x + change y-x ∈ ball (0 : ℂ) 2 + rw [mem_ball_zero_iff] + linarith + calc + _ = eLpNorm (logPole ∘ fun y => y-x) 2 (volume.restrict (ball 0 1)) := by + congr 1 + funext y + simp only [Function.comp_apply, logPole, norm_sub_rev x y] + _ ≤ eLpNorm (logPole ∘ fun y => y-x) 2 + (volume.restrict ((fun y => y-x) ⁻¹' ball 0 2)) := + eLpNorm_mono_measure _ (Measure.restrict_mono hs le_rfl) + _ = _ := eLpNorm_comp_measurePreserving logPole_memLp_two.aestronglyMeasurable hm + +end StrictHotSpots.GreenLp +namespace StrictHotSpots.DiskFormula +open GreenLp + +lemma green_uniform_L2_bound : ∃ B : ℝ, 0 ≤ B ∧ ∀ x : ℂ, ‖x‖ < 1 → + (eLpNorm (green x) 2 (volume.restrict (ball 0 1))).toReal ≤ B := by + let C := ENNReal.ofReal (4*Real.pi)⁻¹ * + eLpNorm logPole 2 (volume.restrict (ball (0 : ℂ) 2)) + have hC : C ≠ (∞ : ℝ≥0∞) := ENNReal.mul_ne_top ENNReal.ofReal_ne_top logPole_memLp_two.eLpNorm_ne_top + refine ⟨C.toReal, ENNReal.toReal_nonneg, fun x hx => ?_⟩ + apply ENNReal.toReal_mono hC + calc + _ ≤ ENNReal.ofReal (4*Real.pi)⁻¹ * + eLpNorm (fun y => logPole (x-y)) 2 (volume.restrict (ball 0 1)) := by + apply eLpNorm_le_mul_eLpNorm_of_ae_le_mul + (measurable_green_left x).aestronglyMeasurable + filter_upwards [ae_restrict_mem measurableSet_ball] with y hy + have hy' : ‖y‖ ≤ 1 := (by simpa using hy : ‖y‖ < 1).le + have hh := green_bounds hx.le hy' + rw [Real.norm_of_nonneg hh.1, Real.norm_of_nonneg (logPole_nonneg _)] + simpa only [div_eq_mul_inv, mul_comm] using hh.2 + _ ≤ C := by + dsimp [C] + gcongr + exact shifted_logPole_norm_bound x hx + +end StrictHotSpots.DiskFormula + + + +open MeasureTheory Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.MeasurableL2Kernel + +lemma integral_mul_eq_inner {X : Type*} [MeasurableSpace X] {ν : Measure X} + {f g : X → ℝ} (hf : MemLp f 2 ν) (hg : MemLp g 2 ν) : + (∫ x, f x * g x ∂ν) = inner ℝ (hf.toLp f) (hg.toLp g) := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hf.coeFn_toLp, hg.coeFn_toLp] with x hx hy + simp only [hx,hy, RCLike.inner_apply, conj_trivial] + ring + +lemma norm_integral_mul_le {X : Type*} [MeasurableSpace X] {ν : Measure X} + {f g : X → ℝ} (hf : MemLp f 2 ν) (hg : MemLp g 2 ν) : + ‖∫ x, f x * g x ∂ν‖ ≤ (eLpNorm f 2 ν).toReal * (eLpNorm g 2 ν).toReal := by + rw [integral_mul_eq_inner hf hg] + simpa only [Lp.norm_toLp] using norm_inner_le_norm (hf.toLp f) (hg.toLp g) + +variable {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {μ : Measure X} {ν : Measure Y} [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (K : X × Y → ℝ) (hK : AEStronglyMeasurable K (μ.prod ν)) + (hrow : ∀ᵐ x ∂μ, MemLp (fun y => K (x,y)) 2 ν) + {B : ℝ} (hB : 0 ≤ B) + (hbound : ∀ᵐ x ∂μ, (eLpNorm (fun y => K (x,y)) 2 ν).toReal ≤ B) + +omit [IsFiniteMeasure μ] [IsFiniteMeasure ν] in +include hrow hbound in +lemma apply_bound (f : Lp ℝ 2 ν) : + ∀ᵐ x ∂μ, ‖∫ y, K (x,y) * f y ∂ν‖ ≤ B * ‖f‖ := by + filter_upwards [hrow, hbound] with x hx hb + have hh := norm_integral_mul_le hx (Lp.memLp f) + have he : (eLpNorm (fun y => f y) 2 ν).toReal = ‖f‖ := rfl + rw [he] at hh + exact hh.trans (mul_le_mul_of_nonneg_right hb (norm_nonneg f)) + +include hK hrow hbound in +lemma apply_memLp (f : Lp ℝ 2 ν) : + MemLp (fun x => ∫ y, K (x,y) * f y ∂ν) 2 μ := by + have hm : AEStronglyMeasurable (fun z : X × Y => K z * f z.2) (μ.prod ν) := + hK.mul (Lp.aestronglyMeasurable f).comp_snd + exact MemLp.of_bound hm.integral_prod_right' (B * ‖f‖) + (apply_bound K hrow hbound f) + + + +def operator : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 μ := by + let T : Lp ℝ 2 ν →ₗ[ℝ] Lp ℝ 2 μ := + { toFun := fun f => (apply_memLp K hK hrow hbound f).toLp _ + map_add' := by + intro f g + apply Lp.ext + filter_upwards [(apply_memLp K hK hrow hbound (f+g)).coeFn_toLp, + (apply_memLp K hK hrow hbound f).coeFn_toLp, + (apply_memLp K hK hrow hbound g).coeFn_toLp, + Lp.coeFn_add ((apply_memLp K hK hrow hbound f).toLp _) + ((apply_memLp K hK hrow hbound g).toLp _), hrow] with x hx hf hg ha hr + rw [hx,ha, Pi.add_apply,hf,hg] + have he : (fun y => K (x,y) * (f+g) y) =ᵐ[ν] + (fun y => K (x,y) * f y + K (x,y) * g y) := by + filter_upwards [Lp.coeFn_add f g] with y hy + rw [hy, Pi.add_apply, mul_add] + rw [integral_congr_ae he, integral_add] + · exact hr.integrable_mul (Lp.memLp f) + · exact hr.integrable_mul (Lp.memLp g) + map_smul' := by + intro c f + apply Lp.ext + filter_upwards [(apply_memLp K hK hrow hbound (c • f)).coeFn_toLp, + (apply_memLp K hK hrow hbound f).coeFn_toLp, + Lp.coeFn_smul c ((apply_memLp K hK hrow hbound f).toLp _)] with x hx hf hs + simp only [RingHom.id_apply] + rw [hx,hs, Pi.smul_apply,hf] + have he : (fun y => K (x,y) * (c • f) y) =ᵐ[ν] + (fun y => c * (K (x,y) * f y)) := by + filter_upwards [Lp.coeFn_smul c f] with y hy + rw [hy, Pi.smul_apply, smul_eq_mul] + ring + rw [integral_congr_ae he, integral_const_mul, smul_eq_mul] } + refine T.mkContinuous ((measureUnivNNReal μ : ℝ) ^ (2 : ℝ≥0∞).toReal⁻¹ * B) ?_ + intro f + have hh := Lp.norm_le_of_ae_bound (mul_nonneg hB (norm_nonneg f)) + (show ∀ᵐ x ∂μ, ‖T f x‖ ≤ B * ‖f‖ from by + filter_upwards [(apply_memLp K hK hrow hbound f).coeFn_toLp, + apply_bound K hrow hbound f] with x hx hb + change ‖((apply_memLp K hK hrow hbound f).toLp _) x‖ ≤ _ + rw [hx] + exact hb) + exact hh.trans_eq (mul_assoc _ _ _).symm + +lemma operator_apply_ae (f : Lp ℝ 2 ν) : + operator K hK hrow hB hbound f =ᵐ[μ] fun x => ∫ y, K (x,y) * f y ∂ν := + (apply_memLp K hK hrow hbound f).coeFn_toLp + +end StrictHotSpots.MeasurableL2Kernel + + + +open MeasureTheory Filter InnerProductSpace +open scoped ENNReal Topology +namespace StrictHotSpots + +lemma eq_zero_of_inner_smoothTest_eq_zero {Ω : Set Plane} (hΩ : IsOpen Ω) + (u : Lp ℝ 2 (volume.restrict Ω)) + (h : ∀ φ : smoothTestSpace Ω, inner ℝ (H1.value (smoothTestToH1 hΩ φ)) u = 0) : + u = 0 := by + have hl := (Lp.memLp u).locallyIntegrable (by norm_num : (1 : ℝ≥0∞) ≤ 2) + have hh := hΩ.ae_eq_zero_of_integral_contDiff_smul_eq_zero + (μ := volume.restrict Ω) (hl.locallyIntegrableOn Ω) + (fun φ hp hc hs => show (∫ x in Ω, φ x • u x) = 0 from by + have ht := h ⟨φ,hp,hc,hs⟩ + have hv : H1.value (smoothTestToH1 hΩ ⟨φ,hp,hc,hs⟩) = + (test_memLp (Ω := Ω) hp hc).toLp φ := rfl + rw [hv, L2.inner_def] at ht + convert ht using 1 + apply integral_congr_ae + filter_upwards [(test_memLp (Ω := Ω) hp hc).coeFn_toLp] with x hx + simp only [hx, smul_eq_mul, RCLike.inner_apply, conj_trivial] + ring) + apply Lp.ext + filter_upwards [hh, ae_restrict_mem hΩ.measurableSet, Lp.coeFn_zero ℝ 2 (volume.restrict Ω)] + with x hx hΩx hz + rw [hz] + exact hx hΩx + +lemma smoothTest_dense_L2 {Ω : Set Plane} (hΩ : IsOpen Ω) : + DenseRange (fun φ : smoothTestSpace Ω => H1.value (smoothTestToH1 hΩ φ)) := by + let T : smoothTestSpace Ω →ₗ[ℝ] Lp ℝ 2 (volume.restrict Ω) := + H1.value.toLinearMap.comp (smoothTestToH1 hΩ) + have hz : T.rangeᗮ = ⊥ := by + apply eq_bot_iff.mpr + intro u hu + change u = 0 + apply eq_zero_of_inner_smoothTest_eq_zero hΩ u + intro φ + exact (Submodule.mem_orthogonal _ _).mp hu (T φ) ⟨φ,rfl⟩ + have ht : T.range.topologicalClosure = ⊤ := by + rw [← Submodule.orthogonal_orthogonal_eq_closure, hz, Submodule.bot_orthogonal_eq_top] + have hd : closure (Set.range T) = Set.univ := by + change closure (T.range : Set (Lp ℝ 2 (volume.restrict Ω))) = Set.univ + rw [← Submodule.topologicalClosure_coe, ht, Submodule.top_coe] + exact dense_iff_closure_eq.mpr hd + +end StrictHotSpots + + + + + + + +open scoped InnerProductSpace +namespace StrictHotSpots.DirichletOperator + +variable {V H : Type*} + [NormedAddCommGroup V] [InnerProductSpace ℝ V] [CompleteSpace V] + [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] + + +def solution (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) (J : V →L[ℝ] H) : + H →L[ℝ] V := + hB.continuousLinearEquivOfBilin.symm.toContinuousLinearMap.comp J.adjoint + +lemma solution_spec (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) (J : V →L[ℝ] H) + (f : H) (v : V) : B (solution B hB J f) v = ⟪f, J v⟫_ℝ := by + rw [← hB.continuousLinearEquivOfBilin_apply] + simp only [solution, ContinuousLinearMap.comp_apply, ContinuousLinearEquiv.coe_coe, + ContinuousLinearEquiv.apply_symm_apply, ContinuousLinearMap.adjoint_inner_left] + + +def green (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) (J : V →L[ℝ] H) : + H →L[ℝ] H := J.comp (solution B hB J) + +lemma green_apply (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) (J : V →L[ℝ] H) + (f : H) : green B hB J f = J (solution B hB J f) := rfl + +lemma green_symmetric (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) + (hsym : ∀ u v, B u v = B v u) (J : V →L[ℝ] H) (f g : H) : + ⟪green B hB J f, g⟫_ℝ = ⟪f, green B hB J g⟫_ℝ := by + calc + _ = ⟪g, J (solution B hB J f)⟫_ℝ := real_inner_comm _ _ + _ = B (solution B hB J g) (solution B hB J f) := (solution_spec B hB J g _).symm + _ = B (solution B hB J f) (solution B hB J g) := hsym _ _ + _ = _ := solution_spec B hB J f _ + +lemma green_nonneg (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) + (J : V →L[ℝ] H) (f : H) : 0 ≤ ⟪f, green B hB J f⟫_ℝ := by + rw [green_apply, ← solution_spec B hB J f (solution B hB J f)] + obtain ⟨C, hC, h⟩ := hB + exact (mul_nonneg (mul_nonneg hC.le (norm_nonneg _)) (norm_nonneg _)).trans (h _) + + + +lemma green_norm_le (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) + (J : V →L[ℝ] H) {d : ℝ} (hd : 0 ≤ d) + (hsub : ∀ v : V, ‖J v‖ ^ 2 ≤ d * B v v) : ‖green B hB J‖ ≤ d := by + apply ContinuousLinearMap.opNorm_le_bound _ hd + intro f + let u := solution B hB J f + have h0 := hsub u + have hs : B u u = ⟪f, J u⟫_ℝ := solution_spec B hB J f u + rw [hs] at h0 + have hi : ⟪f, J u⟫_ℝ ≤ ‖f‖ * ‖J u‖ := real_inner_le_norm _ _ + have ht : ‖J u‖ ^ 2 ≤ d * (‖f‖ * ‖J u‖) := + h0.trans (mul_le_mul_of_nonneg_left hi hd) + change ‖J u‖ ≤ d * ‖f‖ + by_cases hz : ‖J u‖ = 0 + · rw [hz] + positivity + · have hp : 0 < ‖J u‖ := lt_of_le_of_ne (norm_nonneg _) (Ne.symm hz) + nlinarith + +lemma green_norm_lt_one (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) + (J : V →L[ℝ] H) {d : ℝ} (hd : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ v : V, ‖J v‖ ^ 2 ≤ d * B v v) : ‖green B hB J‖ < 1 := + (green_norm_le B hB J hd hsub).trans_lt hd1 + +end StrictHotSpots.DirichletOperator + + +open MeasureTheory Set Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 + +lemma diskBounded : Bornology.IsBounded disk := Metric.isBounded_ball + +instance diskFinite : IsFiniteMeasure (volume.restrict disk) := + isFiniteMeasure_restrict.mpr diskBounded.measure_lt_top.ne + +def kernel (x y : Plane) : ℝ := DiskFormula.green (complexIso.symm x) (complexIso.symm y) + +lemma complexIso_disk_preserving : MeasurePreserving complexIso.symm + (volume.restrict disk) (volume.restrict (Metric.ball (0 : ℂ) 1)) := by + have h := complexIso.symm.measurePreserving.restrict_preimage + (show MeasurableSet (Metric.ball (0 : ℂ) 1) from measurableSet_ball) + have he : complexIso.symm ⁻¹' Metric.ball (0 : ℂ) 1 = disk := by + ext x + simp [disk] + rwa [he] at h + +lemma kernel_memLp (x : Plane) (hx : x ∈ disk) : + MemLp (kernel x) 2 (volume.restrict disk) := by + have hx' : ‖complexIso.symm x‖ < 1 := by simpa [disk] using hx + exact (DiskFormula.green_memLp_two _ hx').comp_measurePreserving complexIso_disk_preserving + +lemma measurable_kernel : Measurable (fun p : Plane × Plane => kernel p.1 p.2) := by + unfold kernel DiskFormula.green + fun_prop + +lemma kernel_bound : ∃ B : ℝ, 0 ≤ B ∧ ∀ x ∈ disk, + (eLpNorm (kernel x) 2 (volume.restrict disk)).toReal ≤ B := by + obtain ⟨B,hB,h⟩ := DiskFormula.green_uniform_L2_bound + refine ⟨B,hB,fun x hx => ?_⟩ + have hx' : ‖complexIso.symm x‖ < 1 := by simpa [disk] using hx + have he := eLpNorm_comp_measurePreserving (p := 2) + (DiskFormula.green_memLp_two _ hx').aestronglyMeasurable complexIso_disk_preserving + change (eLpNorm (DiskFormula.green (complexIso.symm x) ∘ complexIso.symm) 2 + (volume.restrict disk)).toReal ≤ B + rw [he] + exact h _ hx' + +lemma kernel_rows : ∀ᵐ x ∂volume.restrict disk, MemLp (kernel x) 2 (volume.restrict disk) := by + filter_upwards [ae_restrict_mem diskOpen.measurableSet] with x hx + exact kernel_memLp x hx + +def integralOperator : Lp ℝ 2 (volume.restrict disk) →L[ℝ] Lp ℝ 2 (volume.restrict disk) := + MeasurableL2Kernel.operator (fun p => kernel p.1 p.2) measurable_kernel.aestronglyMeasurable + kernel_rows kernel_bound.choose_spec.1 + (by filter_upwards [ae_restrict_mem diskOpen.measurableSet] with x hx + exact kernel_bound.choose_spec.2 x hx) + +lemma integralOperator_ae (f : Lp ℝ 2 (volume.restrict disk)) : + integralOperator f =ᵐ[volume.restrict disk] fun x => ∫ y in disk, kernel x y * f y := + MeasurableL2Kernel.operator_apply_ae _ _ _ _ _ f + +lemma potential_eq_integral {f : Plane → ℝ} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) (hs : tsupport f ⊆ disk) {x : Plane} (hx : x ∈ disk) : + potential f x = ∫ y in disk, kernel x y * f y := by + obtain ⟨R,hR,hn⟩ := GreenPotential.exists_regular_neighborhood (source_compact hc) + (source_support hs) + have hx' : complexIso.symm x ∈ Metric.ball (0 : ℂ) R := by + have : ‖x‖ < 1 := by simpa [disk] using hx + simpa using this.trans hR + have hh := GreenPotential.potential_eq_integral (source_contDiff hf) (source_compact hc) + Metric.isOpen_ball hn hx' + change GreenPotential.potential (source f) (complexIso.symm x) = _ + rw [hh] + have he := complexIso.symm.measurePreserving.integral_comp + complexIso.symm.toMeasurableEquiv.measurableEmbedding + (fun z => DiskFormula.green (complexIso.symm x) z * source f z) + simp only [source, complexIso.apply_symm_apply] at he + simp only [source] + rw [← he] + symm + apply setIntegral_eq_integral_of_forall_compl_eq_zero + intro y hy + have hfy : f y = 0 := image_eq_zero_of_notMem_tsupport (fun h => hy (hs h)) + simp [hfy, kernel] + +def variationalOperator : Lp ℝ 2 (volume.restrict disk) →L[ℝ] Lp ℝ 2 (volume.restrict disk) := + @DirichletOperator.green (H10 diskOpen) (Lp ℝ 2 (volume.restrict disk)) + (H10.normedAddCommGroup diskOpen) (H10.innerProductSpace diskOpen) + (H10.completeSpace diskOpen) inferInstance inferInstance inferInstance + (H10.energy diskOpen) (H10.energy_coercive diskOpen diskBounded) (H10.value diskOpen) + +lemma variationalOperator_test (f : smoothTestSpace disk) : + variationalOperator (H1.value (smoothTestToH1 diskOpen f)) =ᵐ[volume.restrict disk] + potential f := by + obtain ⟨u,hu,he⟩ := exists_dirichlet_representative f.property.1 f.property.2.1 f.property.2.2 + let w := DirichletOperator.solution (H10.energy diskOpen) + (H10.energy_coercive diskOpen diskBounded) (H10.value diskOpen) + (H1.value (smoothTestToH1 diskOpen f)) + have hw : ∀ v, H10.energy diskOpen w v = inner ℝ + (H1.value (smoothTestToH1 diskOpen f)) (H10.value diskOpen v) := + DirichletOperator.solution_spec _ _ _ _ + have he' : ∀ v, H10.energy diskOpen u v = inner ℝ + (H1.value (smoothTestToH1 diskOpen f)) (H10.value diskOpen v) := he + obtain ⟨_,_,hun⟩ := H10.existsUnique_energy_solution diskOpen diskBounded + ((innerSL ℝ (H1.value (smoothTestToH1 diskOpen f))).comp (H10.value diskOpen)) + have heq : w = u := (hun w hw).trans (hun u he').symm + change H10.value diskOpen w =ᵐ[volume.restrict disk] potential f + rw [heq] + exact hu + + + +lemma integralOperator_eq_variationalOperator : integralOperator = variationalOperator := by + apply DFunLike.coe_injective + apply (smoothTest_dense_L2 diskOpen).equalizer integralOperator.continuous + variationalOperator.continuous + funext f + simp only [Function.comp_apply] + apply Lp.ext + filter_upwards [integralOperator_ae (H1.value (smoothTestToH1 diskOpen f)), + variationalOperator_test f, ae_restrict_mem diskOpen.measurableSet] with x hx hu hxd + rw [hx,hu,potential_eq_integral f.property.1 f.property.2.1 f.property.2.2 hxd] + apply integral_congr_ae + have hf : H1.value (smoothTestToH1 diskOpen f) =ᵐ[volume.restrict disk] f := + (test_memLp (Ω := disk) f.property.1 f.property.2.1).coeFn_toLp + filter_upwards [hf] with y hy + rw [hy] + +end StrictHotSpots.PlaneGreen + + +open MeasureTheory +open scoped InnerProductSpace ENNReal +namespace StrictHotSpots.H10 +variable {Ω : Set Plane} (hΩ : IsOpen Ω) (hb : Bornology.IsBounded Ω) +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ (∞ : ℝ≥0∞)) + (hν : ν ≤ C • volume.restrict Ω) + + +def weightedValue : H10 hΩ →L[ℝ] Lp ℝ 2 ν := + (Lp.LpToLpOfMeasureLeSMul hC hν).comp (value hΩ) + +lemma weightedValue_ae (u : H10 hΩ) : + weightedValue hΩ hC hν u =ᵐ[ν] value hΩ u := + Lp.coeFn_LpToLpOfMeasureLeSMul hC hν (value hΩ u) + + + +def greenOperator : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν := + @DirichletOperator.green (H10 hΩ) (Lp ℝ 2 ν) + (H10.normedAddCommGroup hΩ) (H10.innerProductSpace hΩ) (H10.completeSpace hΩ) + inferInstance inferInstance inferInstance + (energy hΩ) (energy_coercive hΩ hb) (weightedValue hΩ hC hν) + +lemma energy_symmetric (u v : H10 hΩ) : energy hΩ u v = energy hΩ v u := by + calc + energy hΩ u v = inner ℝ (grad hΩ u) (grad hΩ v) := energy_apply hΩ u v + _ = inner ℝ (grad hΩ v) (grad hΩ u) := real_inner_comm _ _ + _ = energy hΩ v u := (energy_apply hΩ v u).symm + +lemma greenOperator_symmetric (f g : Lp ℝ 2 ν) : + inner ℝ (greenOperator hΩ hb hC hν f) g = + inner ℝ f (greenOperator hΩ hb hC hν g) := + DirichletOperator.green_symmetric (energy hΩ) (energy_coercive hΩ hb) + (energy_symmetric hΩ) (weightedValue hΩ hC hν) f g + +lemma greenOperator_nonneg (f : Lp ℝ 2 ν) : + 0 ≤ inner ℝ f (greenOperator hΩ hb hC hν f) := + DirichletOperator.green_nonneg (energy hΩ) (energy_coercive hΩ hb) + (weightedValue hΩ hC hν) f + + +lemma greenOperator_norm_le {d : ℝ} (hd : 0 ≤ d) + (hsub : ∀ u : H10 hΩ, ‖weightedValue hΩ hC hν u‖ ^ 2 ≤ + d * ‖grad hΩ u‖ ^ 2) : ‖greenOperator hΩ hb hC hν‖ ≤ d := by + apply DirichletOperator.green_norm_le (energy hΩ) (energy_coercive hΩ hb) + (weightedValue hΩ hC hν) hd + intro u + simpa only [energy_apply, real_inner_self_eq_norm_sq] using hsub u + +end StrictHotSpots.H10 + + +open MeasureTheory Filter +open scoped ENNReal InnerProductSpace +namespace StrictHotSpots.DirichletOperator + +lemma green_comp {V H K : Type*} + [NormedAddCommGroup V] [InnerProductSpace ℝ V] [CompleteSpace V] + [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] + [NormedAddCommGroup K] [InnerProductSpace ℝ K] [CompleteSpace K] + (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) (J : V →L[ℝ] H) (S : H →L[ℝ] K) : + green B hB (S.comp J) = (S.comp (green B hB J)).comp S.adjoint := by + simp only [green, solution, ContinuousLinearMap.adjoint_comp, ContinuousLinearMap.comp_assoc] + +end StrictHotSpots.DirichletOperator +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ (∞ : ℝ≥0∞)) + (hν : ν ≤ C • volume.restrict disk) + +def inclusion : Lp ℝ 2 (volume.restrict disk) →L[ℝ] Lp ℝ 2 ν := + Lp.LpToLpOfMeasureLeSMul hC hν + +lemma inclusion_ae (f : Lp ℝ 2 (volume.restrict disk)) : inclusion hC hν f =ᵐ[ν] f := + Lp.coeFn_LpToLpOfMeasureLeSMul hC hν f + +include hC hν in +lemma kernel_memLp_weighted (x : Plane) (hx : x ∈ disk) : MemLp (kernel x) 2 ν := + ((kernel_memLp x hx).smul_measure hC).mono_measure hν + +lemma inclusion_row (x : Plane) (hx : x ∈ disk) : + inclusion hC hν ((kernel_memLp x hx).toLp (kernel x)) = + (kernel_memLp_weighted hC hν x hx).toLp (kernel x) := by + apply Lp.ext + exact (inclusion_ae hC hν _).trans + (((Measure.absolutelyContinuous_of_le_smul hν).ae_eq (kernel_memLp x hx).coeFn_toLp).trans + (kernel_memLp_weighted hC hν x hx).coeFn_toLp.symm) + +lemma integral_adjoint_row (f : Lp ℝ 2 ν) (x : Plane) (hx : x ∈ disk) : + (∫ y in disk, kernel x y * (inclusion hC hν).adjoint f y) = + ∫ y, kernel x y * f y ∂ν := by + rw [MeasurableL2Kernel.integral_mul_eq_inner (kernel_memLp x hx) + (Lp.memLp ((inclusion hC hν).adjoint f)), Lp.toLp_coeFn, + ContinuousLinearMap.adjoint_inner_right, inclusion_row hC hν x hx] + rw [MeasurableL2Kernel.integral_mul_eq_inner (kernel_memLp_weighted hC hν x hx) + (Lp.memLp f), Lp.toLp_coeFn] + + + +def weightedIntegralOperator : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν := + ((inclusion hC hν).comp integralOperator).comp (inclusion hC hν).adjoint + +lemma weightedIntegralOperator_ae (f : Lp ℝ 2 ν) : + weightedIntegralOperator hC hν f =ᵐ[ν] fun x => ∫ y, kernel x y * f y ∂ν := by + have ha := (Measure.absolutelyContinuous_of_le_smul hν) + filter_upwards [inclusion_ae hC hν (integralOperator ((inclusion hC hν).adjoint f)), + ha.ae_eq (integralOperator_ae ((inclusion hC hν).adjoint f)), + (ae_restrict_mem diskOpen.measurableSet).filter_mono ha.ae_le] with x hx hi hxd + change inclusion hC hν (integralOperator ((inclusion hC hν).adjoint f)) x = _ + rw [hx,hi,integral_adjoint_row hC hν f x hxd] + +lemma weightedIntegralOperator_eq_greenOperator : weightedIntegralOperator hC hν = + H10.greenOperator diskOpen diskBounded hC hν := by + unfold weightedIntegralOperator H10.greenOperator H10.weightedValue + + rw [DirichletOperator.green_comp, integralOperator_eq_variationalOperator] + rfl + + + +lemma weightedIntegralOperator_norm_le {d : ℝ} (hd : 0 ≤ d) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) : ‖weightedIntegralOperator hC hν‖ ≤ d := by + rw [weightedIntegralOperator_eq_greenOperator] + exact H10.greenOperator_norm_le diskOpen diskBounded hC hν hd hsub + +lemma weightedIntegralOperator_symmetric (f g : Lp ℝ 2 ν) : + inner ℝ (weightedIntegralOperator hC hν f) g = + inner ℝ f (weightedIntegralOperator hC hν g) := by + rw [weightedIntegralOperator_eq_greenOperator] + exact H10.greenOperator_symmetric diskOpen diskBounded hC hν f g + +lemma weightedIntegralOperator_nonneg (f : Lp ℝ 2 ν) : + 0 ≤ inner ℝ f (weightedIntegralOperator hC hν f) := by + rw [weightedIntegralOperator_eq_greenOperator] + exact H10.greenOperator_nonneg diskOpen diskBounded hC hν f + +end StrictHotSpots.PlaneGreen + +end WeightedLayer + + +end FullBoundaryCombinedLayer + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/GreenSolution.lean b/lean/OAI/Analysis/HotSpots/GreenSolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..752f2f03d9dc5917aee428da4afd42f5b3f4238a --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/GreenSolution.lean @@ -0,0 +1,595 @@ +import OAI.Analysis.HotSpots.BoundaryEnergy +import OAI.Analysis.HotSpots.ClosedChart + +namespace OAI + +section UniformL3 + +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal Topology +namespace StrictHotSpots.L2Limits + + + +lemma unifIntegrable_two_of_three {α ι : Type*} [MeasurableSpace α] + {μ : Measure α} {f : ι → α → ℝ} (hf : ∀ i, AEStronglyMeasurable (f i) μ) + {B : ℝ≥0∞} (hB : B ≠ ∞) (hb : ∀ i, eLpNorm (f i) 3 μ ≤ B) : + UnifIntegrable f 2 μ := by + apply unifIntegrable_iff'.2 + intro ε hε + have ht : Tendsto (fun t : ℝ => B * (ENNReal.ofReal t) ^ (1/6 : ℝ)) (𝓝 0) (𝓝 0) := by + exact (ENNReal.tendsto_const_mul_rpow_nhds_zero_of_pos hB (by norm_num : (0:ℝ)<1/6)).comp + (by simpa using ENNReal.continuous_ofReal.tendsto (0:ℝ)) + have he : ∀ᶠ t : ℝ in 𝓝 0, B * (ENNReal.ofReal t) ^ (1/6:ℝ) < ε := + ht.eventually (eventually_lt_nhds hε) + obtain ⟨r,hr,hrb⟩ := Metric.mem_nhds_iff.mp he + refine ⟨ENNReal.ofReal (r/2), ENNReal.ofReal_pos.mpr (half_pos hr), + fun i s hs hμs => ?_⟩ + have htt : B * (ENNReal.ofReal (r/2)) ^ (1/6:ℝ) < ε := + hrb (by simpa only [Metric.mem_ball, Real.dist_eq, sub_zero, abs_of_pos (half_pos hr)] + using (half_lt_self hr)) + calc + eLpNorm (f i) 2 (μ.restrict s) ≤ eLpNorm (f i) 3 (μ.restrict s) * (μ s)^(1/6:ℝ) := by + simpa only [Measure.restrict_apply MeasurableSet.univ, univ_inter, + ENNReal.toReal_ofNat, show (1/(2:ℝ)-1/3) = 1/6 by norm_num] using + (eLpNorm_le_eLpNorm_mul_rpow_measure_univ (μ := μ.restrict s) + (by norm_num : (2:ℝ≥0∞)≤3) (hf i).restrict) + _ ≤ B * (ENNReal.ofReal (r/2)) ^ (1/6:ℝ) := by + gcongr + exact (eLpNorm_mono_measure (f i) Measure.restrict_le_self).trans (hb i) + _ ≤ ε := htt.le + +end StrictHotSpots.L2Limits +end +end UniformL3 + +section GreenRowContinuous + +noncomputable section +open Set MeasureTheory Filter Metric +open scoped Topology InnerProductSpace ENNReal +namespace StrictHotSpots.PlaneGreen +open DiskH10 + +lemma kernel_plane_formula (x y : Plane) : kernel x y = + Real.log (1+(1-‖x‖^2)*(1-‖y‖^2)/‖x-y‖^2)/(4*Real.pi) := by + simp only [kernel,DiskFormula.green,← map_sub,LinearIsometryEquiv.norm_map] + +lemma kernel_continuousAt_left {x y : Plane} (hx : x ∈ disk) (hy : y ∈ disk) + (hxy : x ≠ y) : ContinuousAt (fun z => kernel z y) x := by + have hx1 : ‖x‖ < 1 := by simpa [disk] using hx + have hy1 : ‖y‖ < 1 := by simpa [disk] using hy + have hx2 : 0 ≤ 1-‖x‖^2 := by nlinarith [norm_nonneg x] + have hy2 : 0 ≤ 1-‖y‖^2 := by nlinarith [norm_nonneg y] + have hn : ‖x-y‖^2 ≠ 0 := pow_ne_zero _ (norm_ne_zero_iff.mpr (sub_ne_zero.mpr hxy)) + have ha : 1+(1-‖x‖^2)*(1-‖y‖^2)/‖x-y‖^2 ≠ 0 := by positivity + simp_rw [kernel_plane_formula] + fun_prop (disch := assumption) + +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ (∞ : ℝ≥0∞)) + (hν : ν ≤ C • volume.restrict disk) + +lemma row_eq_toLp (x : disk) : row hC hν x = + (kernel_memLp_weighted hC hν x x.property).toLp (kernel x) := by + apply Lp.ext + filter_upwards [(column_memLp hC hν x).coeFn_toLp, + (kernel_memLp_weighted hC hν x x.property).coeFn_toLp] with y hy hx + exact hy.trans ((kernel_symm y x).trans hx.symm) + + + +theorem row_continuous [IsFiniteMeasure ν] : Continuous (row hC hν) := by + apply continuous_iff_seqContinuous.mpr + intro u x hu + simp only [Function.comp_def] + simp_rw [row_eq_toLp hC hν] + apply (Lp.tendsto_Lp_iff_tendsto_eLpNorm'' (fun n => kernel (u n)) + (fun n => kernel_memLp_weighted hC hν _ (u n).property) (kernel x) + (kernel_memLp_weighted hC hν _ x.property)).mpr + apply tendsto_Lp_finite_of_tendsto_ae (by norm_num) (by norm_num) + (fun n => (kernel_memLp_weighted hC hν _ (u n).property).aestronglyMeasurable) + (kernel_memLp_weighted hC hν _ x.property) + · obtain ⟨B,hB,h⟩ := kernel_uniform_three_bound_weighted hC hν + exact L2Limits.unifIntegrable_two_of_three + (fun n => (kernel_memLp_three_weighted hC hν _ (u n).property).aestronglyMeasurable) + hB (fun n => h _ (u n).property) + · have hne : ∀ᵐ y ∂ν, y ≠ (x:Plane) := + ((volume.restrict disk).ae_ne (x:Plane)).filter_mono + (Measure.absolutelyContinuous_of_le_smul hν).ae_le + filter_upwards [ae_mem_disk hν,hne] with y hyd hyx + exact (kernel_continuousAt_left x.property hyd hyx.symm).tendsto.comp + ((continuous_subtype_val.tendsto x).comp hu) + + +lemma green_integral_eq_inner (f : Lp ℝ 2 ν) (x : disk) : + (∫ y, kernel x y * f y ∂ν) = inner ℝ (row hC hν x) f := by + rw [row_eq_toLp hC hν,MeasurableL2Kernel.integral_mul_eq_inner + (kernel_memLp_weighted hC hν x x.property) (Lp.memLp f),Lp.toLp_coeFn] + +include hC hν in +lemma green_integral_continuous [IsFiniteMeasure ν] (f : Lp ℝ 2 ν) : + Continuous (fun x : disk => ∫ y, kernel x y * f y ∂ν) := by + simp_rw [green_integral_eq_inner hC hν] + exact (row_continuous hC hν).inner continuous_const + +end StrictHotSpots.PlaneGreen +end +end GreenRowContinuous + +section BoundaryPoissonTransport + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.PlaneGreen +open DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma angleBoundary_coe (s : AddCircle τ) : + (angleBoundary s : Plane) = complexIso s.toCircle := by + induction s using QuotientAddGroup.induction_on with + | H θ => + change complexIso (Circle.exp θ : ℂ) = complexIso (AddCircle.toCircle (θ : AddCircle τ) : ℂ) + congr 2 + rw [AddCircle.toCircle_apply_mk] + congr 1 + field_simp + +lemma angleBoundary_dist (s t : AddCircle τ) : + dist (angleBoundary s) (angleBoundary t) = ‖(s.toCircle:ℂ)-(t.toCircle:ℂ)‖ := by + rw [Subtype.dist_eq,dist_eq_norm,angleBoundary_coe,angleBoundary_coe, + ← map_sub,LinearIsometryEquiv.norm_map] + + + +def boundaryAngleData (f : C(Boundary,ℝ)) : C(AddCircle τ,ℂ) := + ⟨fun s => (f (angleBoundary s):ℂ), + Complex.continuous_ofReal.comp (f.continuous.comp angleBoundary.continuous)⟩ + +@[simp] lemma boundaryAngleData_apply (f : C(Boundary,ℝ)) (s : AddCircle τ) : + boundaryAngleData f s = (f (angleBoundary s):ℂ) := rfl + +lemma boundaryAngleData_lipschitz (f : C(Boundary,ℝ)) {A : ℝ≥0} + (hf : LipschitzWith A f) : Douglas.ChordLipschitz (A:ℝ) (boundaryAngleData f) := by + intro s t + simpa only [boundaryAngleData_apply,← Complex.ofReal_sub,Complex.norm_real, + ← Real.norm_eq_abs,← dist_eq_norm,angleBoundary_dist] using hf.dist_le_mul (angleBoundary s) (angleBoundary t) + +lemma integral_boundary_angle {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (f : Boundary → E) : (∫ s, f s ∂boundaryMeasure) = + ∫ s : AddCircle τ, f (angleBoundary s) := by + change ∫ s, f s ∂Measure.map angleBoundary.toMeasurableEquiv volume = _ + rw [integral_map_equiv] + rfl + +lemma poissonExtension_eq_planePoisson (f : C(Boundary,ℝ)) {x : Plane} (hx : x ∈ disk) : + poissonExtension f x = Douglas.planePoisson (boundaryAngleData f) x := by + rw [poissonExtension,integral_boundary_angles] + unfold Douglas.planePoisson + rw [Douglas.poissonExtension_re_eq_circleAverage _ + (by simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx)] + unfold Real.circleAverage + simp_rw [poisson_eq_standard] + simp only [smul_eq_mul,Pi.mul_apply,mul_assoc] + rw [intervalIntegral.integral_const_mul] + congr 1 + apply intervalIntegral.integral_congr + intro θ _ + simp only [Douglas.circleDatum_circleMap,boundaryAngleData_apply,Complex.ofReal_re] + have ha : angleBoundary (θ : AddCircle τ) = circleBoundary (Circle.exp θ) := rfl + rw [ha] + change poissonKernel 0 (complexIso.symm x) + (complexIso.symm (complexIso (Circle.exp θ : ℂ))) * _ = + poissonKernel 0 (complexIso.symm x) (circleMap 0 1 θ) * _ + simp [circleMap,Circle.coe_exp] + + +def boundaryPoissonH1 (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) : H1 disk := + (Douglas.lipschitz_planePoisson_hasH1Gradient (boundaryAngleData f) A.coe_nonneg + (boundaryAngleData_lipschitz f hf)).toH1 + +lemma boundaryPoissonH1_harmonic (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) : + SubcriticalExtension.Harmonic (show IsOpen disk from isOpen_ball) (boundaryPoissonH1 f hf) := + Douglas.lipschitzPoisson_weak_harmonic (boundaryAngleData f) A.coe_nonneg + (boundaryAngleData_lipschitz f hf) + +lemma boundaryPoissonH1_value_ae (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) : + (H1.value (boundaryPoissonH1 f hf) : Plane → ℝ) =ᵐ[volume.restrict disk] + poissonExtension f := by + rw [boundaryPoissonH1,H1.value_toH1] + filter_upwards [(Douglas.lipschitz_planePoisson_hasH1Gradient (boundaryAngleData f) + A.coe_nonneg (boundaryAngleData_lipschitz f hf)).1.coeFn_toLp, + ae_restrict_mem measurableSet_ball] with x hx hxd + exact hx.trans (poissonExtension_eq_planePoisson f hxd).symm + +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +lemma boundaryPoissonH1_observe (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + SubcriticalExtension.observe hC hν (boundaryPoissonH1 f hf) = + poissonL2 hν f.continuous.measurable hB := by + apply Lp.ext + filter_upwards [Lp.coeFn_LpToLpOfMeasureLeSMul hC hν (H1.value (boundaryPoissonH1 f hf)), + (Measure.absolutelyContinuous_of_le_smul hν).ae_le (boundaryPoissonH1_value_ae f hf), + (poissonExtension_memLp hν f.continuous.measurable hB).coeFn_toLp] with x hx hy hz + exact hx.trans (hy.trans hz.symm) + +end StrictHotSpots.PlaneGreen +end +end BoundaryPoissonTransport + +section BoundaryHarmonicEnergy + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.PlaneGreen +open DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma integral_boundary_prod_angle {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (f : Boundary × Boundary → E) : + (∫ st, f st ∂boundaryMeasure.prod boundaryMeasure) = + ∫ st : AddCircle τ × AddCircle τ, f (angleBoundary st.1,angleBoundary st.2) := by + rw [boundaryMeasure,Measure.map_prod_map _ _ angleBoundary.continuous.measurable + angleBoundary.continuous.measurable] + change (∫ st, f st ∂Measure.map + (angleBoundary.toMeasurableEquiv.prodCongr angleBoundary.toMeasurableEquiv) volume) = _ + rw [integral_map_equiv] + rfl + +lemma real_complex_inner_quotient (a b : ℝ) (z : ℂ) : + inner ℝ ((a:ℂ)/z) ((b:ℂ)/z) = a*b/‖z‖^2 := by + have he (r : ℝ) : (r:ℂ)/z = r • z⁻¹ := by simp [div_eq_mul_inv,Complex.real_smul] + rw [he,he,real_inner_smul_left,real_inner_smul_right,real_inner_self_eq_norm_sq,norm_inv] + simp only [inv_pow,div_eq_mul_inv] + ring + +lemma boundaryRealCross_geometric (f g : C(Boundary,ℝ)) : + (1/τ)*Douglas.boundaryRealCross (boundaryAngleData f) (boundaryAngleData g) = + (1/2:ℝ)*(∫ z : Boundary × Boundary, boundaryInteraction z.1 z.2 * + inner ℝ (f z.1-f z.2) (g z.1-g z.2) ∂boundaryMeasure.prod boundaryMeasure) := by + rw [integral_boundary_prod_angle,Douglas.boundaryRealCross,← integral_const_mul, + ← integral_const_mul] + apply integral_congr_ae + filter_upwards [] with z + simp only [Douglas.boundaryDifference,boundaryAngleData_apply,← Complex.ofReal_sub, + real_complex_inner_quotient,boundaryInteraction_eq_dist,angleBoundary_dist] + simp only [Real.inner_apply] + simp only [div_eq_mul_inv,mul_inv_rev] + ring + + + +theorem boundaryPoissonH1_energy (f g : C(Boundary,ℝ)) {A B : ℝ≥0} + (hf : LipschitzWith A f) (hg : LipschitzWith B g) : + inner ℝ (H1.grad (boundaryPoissonH1 f hf)) (H1.grad (boundaryPoissonH1 g hg)) = + (1/2:ℝ)*(∫ z : Boundary × Boundary, boundaryInteraction z.1 z.2 * + inner ℝ (f z.1-f z.2) (g z.1-g z.2) ∂boundaryMeasure.prod boundaryMeasure) := by + exact (Douglas.douglas_lipschitz_bilinear (boundaryAngleData f) (boundaryAngleData g) + A.coe_nonneg (boundaryAngleData_lipschitz f hf) B.coe_nonneg + (boundaryAngleData_lipschitz g hg) (fun _ => rfl) (fun _ => rfl)).trans + (boundaryRealCross_geometric f g) + +end StrictHotSpots.PlaneGreen +end +end BoundaryHarmonicEnergy + +section BoundaryScalarEnergy + +noncomputable section +open Set MeasureTheory Filter Metric +open scoped Topology ContDiff InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ (∞ : ℝ≥0∞)) (hν : ν ≤ C • volume.restrict disk) + + + +def boundarySolution (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) : H1 disk := + SubcriticalExtension.extension diskOpen diskBounded hC hν (boundaryPoissonH1 f hf) + +omit [IsFiniteMeasure ν] in +lemma boundarySolution_weak (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) : + SubcriticalExtension.WeakPotential diskOpen hC hν (boundarySolution hC hν f hf) := by + apply SubcriticalExtension.extension_weak diskOpen diskBounded hC hν + ((weightedIntegralOperator_eq_greenOperator hC hν) ▸ hT) + exact boundaryPoissonH1_harmonic f hf + +omit [IsFiniteMeasure ν] in +lemma boundarySolution_class (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) : + ∃ v : H10 diskOpen, boundarySolution hC hν f hf-boundaryPoissonH1 f hf=v.val := + SubcriticalExtension.extension_difference diskOpen diskBounded hC hν _ + + + + +theorem boundarySolution_energy (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (f g : C(Boundary,ℝ)) {A B : ℝ≥0} (hf : LipschitzWith A f) (hg : LipschitzWith B g) : + inner ℝ (H1.grad (boundarySolution hC hν f hf)) (H1.grad (boundarySolution hC hν g hg)) - + inner ℝ (SubcriticalExtension.observe hC hν (boundarySolution hC hν f hf)) + (SubcriticalExtension.observe hC hν (boundarySolution hC hν g hg)) = + (1/2:ℝ)*(∫ z : Boundary × Boundary, boundaryInteraction z.1 z.2 * + inner ℝ (f z.1-f z.2) (g z.1-g z.2) ∂boundaryMeasure.prod boundaryMeasure) - + (∫ z : Boundary × Boundary, fullBoundaryR hC hν z.1 z.2 * f z.1 * g z.2 + ∂boundaryMeasure.prod boundaryMeasure) := by + obtain ⟨M,_,hM⟩ := boundary_continuous_bound f.continuous + obtain ⟨N,_,hN⟩ := boundary_continuous_bound g.continuous + have hE := SubcriticalExtension.extension_energy diskOpen diskBounded hC hν + ((weightedIntegralOperator_eq_greenOperator hC hν) ▸ hT) + (boundaryPoissonH1 f hf) (boundaryPoissonH1 g hg) + (boundaryPoissonH1_harmonic f hf) (boundaryPoissonH1_harmonic g hg) + have hR : inner ℝ (SubcriticalExtension.observe hC hν (boundaryPoissonH1 f hf)) + (BanachResolvent.resolvent (H10.greenOperator diskOpen diskBounded hC hν) + (SubcriticalExtension.observe hC hν (boundaryPoissonH1 g hg))) = + ∫ z : Boundary × Boundary, fullBoundaryR hC hν z.1 z.2 * f z.1 * g z.2 + ∂boundaryMeasure.prod boundaryMeasure := by + rw [boundaryPoissonH1_observe hC hν f hf hM,boundaryPoissonH1_observe hC hν g hg hN, + ← weightedIntegralOperator_eq_greenOperator hC hν] + exact (fullBoundaryR_representation hC hν hT f.continuous.measurable + g.continuous.measurable hM hN).symm + exact hE.trans (congrArg₂ (fun a b : ℝ => a-b) (boundaryPoissonH1_energy f g hf hg) hR) + +end StrictHotSpots.PlaneGreen +end +end BoundaryScalarEnergy + +section GreenSolveContinuous + +noncomputable section +open Set MeasureTheory Filter Metric +open scoped Topology InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.DirichletOperator +variable {V H K : Type*} + [NormedAddCommGroup V] [InnerProductSpace ℝ V] [CompleteSpace V] + [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] + [NormedAddCommGroup K] [InnerProductSpace ℝ K] [CompleteSpace K] +lemma solution_comp (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) + (J : V →L[ℝ] H) (L : H →L[ℝ] K) : + solution B hB (L.comp J) = (solution B hB J).comp L.adjoint := by + unfold solution + rw [ContinuousLinearMap.adjoint_comp] + rfl +end StrictHotSpots.DirichletOperator +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ (∞ : ℝ≥0∞)) + (hν : ν ≤ C • volume.restrict disk) + +lemma solve_value_eq_integralOperator (f : Lp ℝ 2 ν) : + H10.value diskOpen (SubcriticalExtension.solve diskOpen diskBounded hC hν f) = + integralOperator ((inclusion hC hν).adjoint f) := by + have he := DirichletOperator.solution_comp (H10.energy diskOpen) + (H10.energy_coercive diskOpen diskBounded) (H10.value diskOpen) (inclusion hC hν) + have hev := congrArg (fun L => H10.value diskOpen (L f)) he + exact hev.trans (congrArg (fun L => L ((inclusion hC hν).adjoint f)) + integralOperator_eq_variationalOperator.symm) + + + +lemma solve_value_ae (f : Lp ℝ 2 ν) : + (H10.value diskOpen (SubcriticalExtension.solve diskOpen diskBounded hC hν f) : Plane → ℝ) + =ᵐ[volume.restrict disk] fun x => ∫ y, kernel x y*f y ∂ν := by + rw [solve_value_eq_integralOperator hC hν] + filter_upwards [integralOperator_ae ((inclusion hC hν).adjoint f), + ae_restrict_mem diskOpen.measurableSet] with x hx hxd + exact hx.trans (integral_adjoint_row hC hν f x hxd) + + + +def boundarySolutionValue [IsFiniteMeasure ν] (f : C(Boundary,ℝ)) {B : ℝ} + (hB : ∀ s, ‖f s‖ ≤ B) (x : Plane) : ℝ := + poissonExtension f x + ∫ y, kernel x y * + (BanachResolvent.resolvent (weightedIntegralOperator hC hν) + (poissonL2 hν f.continuous.measurable hB)) y ∂ν + +lemma boundarySolutionValue_eq_fullExtension [IsFiniteMeasure ν] + (f : C(Boundary,ℝ)) {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) (x : disk) : + boundarySolutionValue hC hν f hB x = fullExtension hC hν f.continuous.measurable hB x := by + rw [boundarySolutionValue,fullExtension,green_integral_eq_inner hC hν] + +lemma poissonExtension_continuousOn (f : C(Boundary,ℝ)) : + ContinuousOn (poissonExtension f) disk := by + apply (Douglas.planePoisson_contDiffOn (boundaryAngleData f)).continuousOn.congr + intro x hx + exact poissonExtension_eq_planePoisson f hx + +lemma boundarySolutionValue_continuousOn [IsFiniteMeasure ν] + (f : C(Boundary,ℝ)) {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + ContinuousOn (boundarySolutionValue hC hν f hB) disk := by + apply (poissonExtension_continuousOn f).add + exact continuousOn_iff_continuous_domRestrict.mpr (green_integral_continuous hC hν _) + +lemma boundarySolution_value_eq [IsFiniteMeasure ν] + (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + H1.value (boundarySolution hC hν f hf) = H1.value (boundaryPoissonH1 f hf) + + H10.value diskOpen (SubcriticalExtension.solve diskOpen diskBounded hC hν + (BanachResolvent.resolvent (weightedIntegralOperator hC hν) + (poissonL2 hν f.continuous.measurable hB))) := by + have hr : BanachResolvent.resolvent (H10.greenOperator diskOpen diskBounded hC hν) + (SubcriticalExtension.observe hC hν (boundaryPoissonH1 f hf)) = + BanachResolvent.resolvent (weightedIntegralOperator hC hν) + (poissonL2 hν f.continuous.measurable hB) := by + rw [boundaryPoissonH1_observe hC hν f hf hB, + ← weightedIntegralOperator_eq_greenOperator hC hν] + have hv := H1.value.map_add (boundaryPoissonH1 f hf) + (SubcriticalExtension.solve diskOpen diskBounded hC hν + (BanachResolvent.resolvent (H10.greenOperator diskOpen diskBounded hC hν) + (SubcriticalExtension.observe hC hν (boundaryPoissonH1 f hf)))).val + exact hv.trans (congrArg (fun z => H1.value (boundaryPoissonH1 f hf) + + H10.value diskOpen (SubcriticalExtension.solve diskOpen diskBounded hC hν z)) hr) + +lemma value_add_ae (a b : Lp ℝ 2 (volume.restrict disk)) + (f g : Plane → ℝ) (ha : a =ᵐ[volume.restrict disk] f) + (hb : b =ᵐ[volume.restrict disk] g) : + (a+b : Lp ℝ 2 (volume.restrict disk)) =ᵐ[volume.restrict disk] fun x => f x+g x := by + filter_upwards [Lp.coeFn_add a b,ha,hb] with x h h1 h2 + exact h.trans (congrArg₂ (fun a b : ℝ => a+b) h1 h2) + +lemma boundarySolution_value_ae [IsFiniteMeasure ν] + (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) : + (H1.value (boundarySolution hC hν f hf) : Plane → ℝ) =ᵐ[volume.restrict disk] + boundarySolutionValue hC hν f hB := by + rw [boundarySolution_value_eq hC hν f hf hB] + exact value_add_ae _ _ _ _ (boundaryPoissonH1_value_ae f hf) + (solve_value_ae hC hν _) + + + +theorem boundarySolution_K [IsFiniteMeasure ν] + (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (f : C(Boundary,ℝ)) {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) (x : disk) : + boundarySolutionValue hC hν f hB x = + ∫ s, fullBoundaryK hC hν x s * f s ∂boundaryMeasure := by + rw [boundarySolutionValue_eq_fullExtension hC hν] + exact (fullBoundaryK_representation hC hν hT x f.continuous.measurable hB).symm + +end StrictHotSpots.PlaneGreen +end +end GreenSolveContinuous + +section BoundarySolutionIdentification + +noncomputable section +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ContDiff InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.PlaneGreen +open DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma boundaryPoissonH1_real_class (f : C(Boundary,ℝ)) {A : ℝ≥0} + (hf : LipschitzWith A f) {φ : Plane → ℝ} + (hφ : ContDiffOn ℝ ∞ φ disk) (hc : ContinuousOn φ (closure disk)) + (hv : HasH1Gradient disk φ (gradient φ)) (hb : ∀ s : Boundary, φ s=f s) : + ∃ v : H10 diskOpen, hv.toH1-boundaryPoissonH1 f hf=v.val := by + have ht : ∀ s : AddCircle τ, φ (complexIso s.toCircle) = (boundaryAngleData f s).re := by + intro s + simpa only [boundaryAngleData_apply,Complex.ofReal_re,angleBoundary_coe] using hb (angleBoundary s) + have hm := Douglas.lipschitzPoisson_boundary_class (boundaryAngleData f) A.coe_nonneg + (boundaryAngleData_lipschitz f hf) hφ hc hv ht + refine ⟨⟨_,(h10Submodule diskOpen).neg_mem hm⟩,?_⟩ + change hv.toH1-boundaryPoissonH1 f hf = -(boundaryPoissonH1 f hf-hv.toH1) + abel + +variable {ν : Measure Plane} {C : ℝ≥0∞} + (hC : C ≠ (∞ : ℝ≥0∞)) (hν : ν ≤ C • volume.restrict disk) + + + + +lemma boundarySolution_eq_of_trace {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ v : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν v‖^2 ≤ d*‖H10.grad diskOpen v‖^2) + (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) {φ : Plane → ℝ} + (hφ : ContDiffOn ℝ ∞ φ disk) (hc : ContinuousOn φ (closure disk)) + (hv : HasH1Gradient disk φ (gradient φ)) (hb : ∀ s : Boundary, φ s=f s) + (hp : SubcriticalExtension.WeakPotential diskOpen hC hν hv.toH1) : + boundarySolution hC hν f hf = hv.toH1 := by + have hn : ‖weightedIntegralOperator hC hν‖ < 1 := + (weightedIntegralOperator_norm_le hC hν hd0 hsub).trans_lt hd1 + exact SubcriticalExtension.weakPotential_unique diskOpen diskBounded hC hν hd1 hsub + (boundarySolution_weak hC hν hn f hf) hp (boundarySolution_class hC hν f hf) + (boundaryPoissonH1_real_class f hf hφ hc hv hb) + +lemma boundarySolutionValue_eq_of_trace [IsFiniteMeasure ν] + {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ v : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν v‖^2 ≤ d*‖H10.grad diskOpen v‖^2) + (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) + {B : ℝ} (hB : ∀ s, ‖f s‖ ≤ B) {φ : Plane → ℝ} + (hφ : ContDiffOn ℝ ∞ φ disk) (hc : ContinuousOn φ (closure disk)) + (hv : HasH1Gradient disk φ (gradient φ)) (hb : ∀ s : Boundary, φ s=f s) + (hp : SubcriticalExtension.WeakPotential diskOpen hC hν hv.toH1) : + EqOn (boundarySolutionValue hC hν f hB) φ disk := by + have he := boundarySolution_value_ae hC hν f hf hB + rw [boundarySolution_eq_of_trace hC hν hd0 hd1 hsub f hf hφ hc hv hb hp,H1.value_toH1] at he + exact Measure.eqOn_open_of_ae_eq (he.symm.trans hv.1.coeFn_toLp) diskOpen + (boundarySolutionValue_continuousOn hC hν f hB) hφ.continuousOn + + + +theorem value_K_of_trace [IsFiniteMeasure ν] + {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ v : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν v‖^2 ≤ d*‖H10.grad diskOpen v‖^2) + (f : C(Boundary,ℝ)) {A : ℝ≥0} (hf : LipschitzWith A f) {φ : Plane → ℝ} + (hφ : ContDiffOn ℝ ∞ φ disk) (hc : ContinuousOn φ (closure disk)) + (hv : HasH1Gradient disk φ (gradient φ)) (hb : ∀ s : Boundary, φ s=f s) + (hp : SubcriticalExtension.WeakPotential diskOpen hC hν hv.toH1) (x : disk) : + φ x = ∫ s, fullBoundaryK hC hν x s*f s ∂boundaryMeasure := by + obtain ⟨B,_,hB⟩ := boundary_continuous_bound f.continuous + have he := boundarySolutionValue_eq_of_trace hC hν hd0 hd1 hsub f hf hB hφ hc hv hb hp x.property + exact he.symm.trans (boundarySolution_K hC hν + ((weightedIntegralOperator_norm_le hC hν hd0 hsub).trans_lt hd1) f hB x) + +end StrictHotSpots.PlaneGreen +end +end BoundarySolutionIdentification + +section ActualBoundaryDatum + +noncomputable section +open Set MeasureTheory Filter Metric +open scoped ContDiff InnerProductSpace NNReal +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + +lemma boundary_mem_closed (s : Boundary) : (s : Plane) ∈ closure disk := by + rw [disk, closure_ball (0 : Plane) (by norm_num : (1:ℝ) ≠ 0)] + exact sphere_subset_closedBall (by simpa only [mem_sphere, dist_zero_right] using s.property) + +def datumTrace (w : Plane → ℝ) (hw : ContinuousOn w (closure Ω)) : C(Boundary,ℝ) where + toFun s := c.pullDatum w s + continuous_toFun := (c.pullDatum_continuous hw).comp_continuous continuous_subtype_val + boundary_mem_closed + +lemma datumTrace_lipschitz (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) : + ∃ B : ℝ≥0, LipschitzWith B (c.datumTrace w hw.continuousOn) := by + obtain ⟨B,hB⟩ := c.pullDatum_lipschitz hb hs hw + refine ⟨B,fun x y => ?_⟩ + exact hB (boundary_mem_closed x) (boundary_mem_closed y) + +lemma pullDatum_Poisson_class (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) : + ∃ v : H10 diskOpen, (c.pullDatum_H1 hb hs hw).toH1 - + boundaryPoissonH1 (c.datumTrace w hw.continuousOn) hl = v.val := + boundaryPoissonH1_real_class (c.datumTrace w hw.continuousOn) hl + (c.pullDatum_smooth (hw.mono subset_closure)) (c.pullDatum_continuous hw.continuousOn) + (c.pullDatum_H1 hb hs hw) (fun _ => rfl) + +lemma pullDatum_comp_H1 (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) : + HasH1Gradient disk (w ∘ c.diskMap) (gradient (w ∘ c.diskMap)) := by + apply (c.pullDatum_H1 hb hs hw).congr + · filter_upwards [ae_restrict_mem diskOpen.measurableSet] with x hx + exact c.pullDatum_eq_inner hx + · filter_upwards [ae_restrict_mem diskOpen.measurableSet] with x hx + have he : c.pullDatum w =ᶠ[nhds x] w ∘ c.diskMap := + eventually_of_mem (diskOpen.mem_nhds hx) (fun _ hy => c.pullDatum_eq_inner hy) + exact congrArg (InnerProductSpace.toDual ℝ Plane).symm he.fderiv_eq + +lemma pullDatum_comp_toH1 (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) : + (c.pullDatum_comp_H1 hb hs hw).toH1 = (c.pullDatum_H1 hb hs hw).toH1 := by + apply H1.value_injective diskOpen + apply Lp.ext + filter_upwards [(c.pullDatum_comp_H1 hb hs hw).1.coeFn_toLp, + (c.pullDatum_H1 hb hs hw).1.coeFn_toLp,ae_restrict_mem diskOpen.measurableSet] + with x hx hy hxd + exact hx.trans ((c.pullDatum_eq_inner hxd).symm.trans hy.symm) + +end StrictHotSpots.Conformal.ClosedDiskChart +end +end ActualBoundaryDatum + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Helmholtz.lean b/lean/OAI/Analysis/HotSpots/Helmholtz.lean new file mode 100644 index 0000000000000000000000000000000000000000..c38f951ff3bf74a8ca7d52346ae74e8d67a7eb11 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Helmholtz.lean @@ -0,0 +1,1229 @@ +import OAI.Analysis.HotSpots.Variational + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section PlaneWaveFormsCombinedLayer +open Set MeasureTheory Filter +open scoped ENNReal InnerProductSpace Topology Laplacian +namespace StrictHotSpots.PlaneWaves +variable {Ω : Set Plane} (hΩ : IsOpen Ω) (hb : Bornology.IsBounded Ω) +include hΩ hb + +lemma cosine_h1_gradient (k : Plane) : HasH1Gradient Ω (cosine k) (gradient (cosine k)) := + (cosine_h1 hΩ hb k).congr (EventuallyEq.refl _ _) (Eventually.of_forall fun x => (gradient_cosine k x).symm) +lemma sine_h1_gradient (k : Plane) : HasH1Gradient Ω (sine k) (gradient (sine k)) := + (sine_h1 hΩ hb k).congr (EventuallyEq.refl _ _) (Eventually.of_forall fun x => (gradient_sine k x).symm) + +def cosH1 (k : Plane) : H1 Ω := (cosine_h1_gradient hΩ hb k).toH1 +def sinH1 (k : Plane) : H1 Ω := (sine_h1_gradient hΩ hb k).toH1 + +lemma cosH1_pair (lam : ℝ) (k l : Plane) : + H1.form lam (cosH1 hΩ hb k) (cosH1 hΩ hb l) = + inner ℝ k l * (∫ x in Ω, sine k x * sine l x) - + lam * (∫ x in Ω, cosine k x * cosine l x) := by + unfold cosH1 H1.form + rw [H1.grad_toH1,H1.grad_toH1,H1.value_toH1,H1.value_toH1, + L2Inner.toLp_pair,L2Inner.toLp_pair] + congr 1 + · rw [← integral_const_mul] + apply integral_congr_ae + exact Eventually.of_forall fun x => by + dsimp only + rw [gradient_cosine,gradient_cosine,real_inner_smul_left,real_inner_smul_right] + ring + · congr 1 + apply integral_congr_ae + exact Eventually.of_forall fun x => by + simp only [RCLike.inner_apply,RCLike.conj_to_real]; ring + +lemma sinH1_pair (lam : ℝ) (k l : Plane) : + H1.form lam (sinH1 hΩ hb k) (sinH1 hΩ hb l) = + inner ℝ k l * (∫ x in Ω, cosine k x * cosine l x) - + lam * (∫ x in Ω, sine k x * sine l x) := by + unfold sinH1 H1.form + rw [H1.grad_toH1,H1.grad_toH1,H1.value_toH1,H1.value_toH1, + L2Inner.toLp_pair,L2Inner.toLp_pair] + congr 1 + · rw [← integral_const_mul] + apply integral_congr_ae + exact Eventually.of_forall fun x => by + dsimp only + rw [gradient_sine,gradient_sine,real_inner_smul_left,real_inner_smul_right] + ring + · congr 1 + apply integral_congr_ae + exact Eventually.of_forall fun x => by + simp only [RCLike.inner_apply,RCLike.conj_to_real]; ring + +lemma pair_sum (lam : ℝ) (k l : Plane) : + H1.form lam (cosH1 hΩ hb k) (cosH1 hΩ hb l) + + H1.form lam (sinH1 hΩ hb k) (sinH1 hΩ hb l) = + (inner ℝ k l - lam) * (∫ x in Ω, cosine (k-l) x) := by + rw [cosH1_pair,sinH1_pair] + have he : (∫ x in Ω, cosine (k-l) x) = + (∫ x in Ω, cosine k x * cosine l x) + (∫ x in Ω, sine k x * sine l x) := by + have hc : Integrable (fun x => cosine k x * cosine l x) (volume.restrict Ω) := + (cosine_memLp hb k).integrable_mul (cosine_memLp hb l) + have hs : Integrable (fun x => sine k x * sine l x) (volume.restrict Ω) := + (sine_memLp hb k).integrable_mul (sine_memLp hb l) + rw [← integral_add hc hs] + apply integral_congr_ae + exact Eventually.of_forall fun x => by + simp only [cosine,sine,inner_sub_left,Real.cos_sub] + rw [he] + ring + +lemma self_sum {lam : ℝ} {k : Plane} (hk : ‖k‖^2 = lam) : + H1.form lam (cosH1 hΩ hb k) (cosH1 hΩ hb k) + + H1.form lam (sinH1 hΩ hb k) (sinH1 hΩ hb k) = 0 := by + rw [pair_sum,real_inner_self_eq_norm_sq,hk,sub_self,zero_mul] + +lemma cosH1_dirichlet_pair {lam : ℝ} {k : Plane} (hk : ‖k‖^2 = lam) (φ : H10 hΩ) : + H1.form lam (cosH1 hΩ hb k) φ.val = 0 := by + unfold H1.form cosH1 + rw [H1.grad_toH1,H1.value_toH1] + change inner ℝ ((cosine_h1_gradient hΩ hb k).2.1.toLp _) (H10.grad hΩ φ) - + lam * inner ℝ ((cosine_h1_gradient hΩ hb k).1.toLp _) (H10.value hΩ φ) = 0 + rw [H10.helmholtz_pair hΩ (cosine_smooth k).contDiffOn + (cosine_h1_gradient hΩ hb k).1 (cosine_h1_gradient hΩ hb k).2.1 + (fun x _ => by rw [laplacian_cosine,hk]),sub_self] + +lemma sinH1_dirichlet_pair {lam : ℝ} {k : Plane} (hk : ‖k‖^2 = lam) (φ : H10 hΩ) : + H1.form lam (sinH1 hΩ hb k) φ.val = 0 := by + unfold H1.form sinH1 + rw [H1.grad_toH1,H1.value_toH1] + change inner ℝ ((sine_h1_gradient hΩ hb k).2.1.toLp _) (H10.grad hΩ φ) - + lam * inner ℝ ((sine_h1_gradient hΩ hb k).1.toLp _) (H10.value hΩ φ) = 0 + rw [H10.helmholtz_pair hΩ (sine_smooth k).contDiffOn + (sine_h1_gradient hΩ hb k).1 (sine_h1_gradient hΩ hb k).2.1 + (fun x _ => by rw [laplacian_sine,hk]),sub_self] + +end StrictHotSpots.PlaneWaves +end PlaneWaveFormsCombinedLayer + +section LpZeroExtensionCombinedLayer +open MeasureTheory Set Filter +open scoped ENNReal +namespace StrictHotSpots.LpZeroExtension +variable {α E : Type*} [MeasurableSpace α] {μ : Measure α} + [NormedAddCommGroup E] [NormedSpace ℝ E] {s : Set α} (hs : MeasurableSet s) + +def lift (f : Lp E 2 (μ.restrict s)) : Lp E 2 μ := + ((memLp_indicator_iff_restrict hs).mpr (Lp.memLp f)).toLp (s.indicator f) + +omit [NormedSpace ℝ E] in +lemma lift_ae (f : Lp E 2 (μ.restrict s)) : lift hs f =ᵐ[μ] s.indicator f := + MemLp.coeFn_toLp _ + +omit [NormedSpace ℝ E] in +lemma lift_norm (f : Lp E 2 (μ.restrict s)) : ‖lift hs f‖ = ‖f‖ := by + rw [lift,Lp.norm_toLp,eLpNorm_indicator_eq_eLpNorm_restrict hs,Lp.norm_def] + +def linearIsometry : Lp E 2 (μ.restrict s) →ₗᵢ[ℝ] Lp E 2 μ where + toFun := lift hs + map_add' f g := by + apply Lp.ext + filter_upwards [lift_ae hs (f+g),Lp.coeFn_add (lift hs f) (lift hs g), + lift_ae hs f,lift_ae hs g, + (ae_eq_restrict_iff_indicator_ae_eq hs).mp (Lp.coeFn_add f g)] with x hx hy hf hg hh + rw [hx,hy] + simp only [Pi.add_apply] + rw [hf,hg,hh] + by_cases hx : x ∈ s <;> simp [hx] + map_smul' c f := by + apply Lp.ext + filter_upwards [lift_ae hs (c • f),Lp.coeFn_smul c (lift hs f), + lift_ae hs f,(ae_eq_restrict_iff_indicator_ae_eq hs).mp (Lp.coeFn_smul c f)] with x hx hy hf hh + change (lift hs (c • f) : α → E) x = (c • lift hs f : Lp E 2 μ) x + rw [hx,hy] + simp only [Pi.smul_apply] + rw [hf,hh] + by_cases hx : x ∈ s <;> simp [hx] + norm_map' := lift_norm hs + +lemma linearIsometry_ae (f : Lp E 2 (μ.restrict s)) : + linearIsometry hs f =ᵐ[μ] s.indicator f := lift_ae hs f + +lemma linearIsometry_toLp {f : α → E} (hf : MemLp f 2 μ) + (hsupp : Function.support f ⊆ s) : + linearIsometry hs ((hf.mono_measure Measure.restrict_le_self).toLp f) = hf.toLp f := by + apply Lp.ext + exact (linearIsometry_ae hs _).trans + (((ae_eq_restrict_iff_indicator_ae_eq hs).mp + (hf.mono_measure Measure.restrict_le_self).coeFn_toLp).trans + (by rw [Set.indicator_eq_self.mpr hsupp]; exact hf.coeFn_toLp.symm)) + +end StrictHotSpots.LpZeroExtension +end LpZeroExtensionCombinedLayer + +section H10ZeroExtensionCombinedLayer +open Set MeasureTheory Filter +open scoped ENNReal InnerProductSpace +namespace StrictHotSpots.H10 +private lemma inner_smul_reverse (v w : Plane) (c : ℝ) : + inner ℝ (c • v) w = inner ℝ w v * c := by + rw [real_inner_smul_left, real_inner_comm, mul_comm] + +variable {Ω : Set Plane} (hΩ : IsOpen Ω) + +def zeroValue : H10 hΩ →L[ℝ] Lp ℝ 2 (volume : Measure Plane) := + (LpZeroExtension.linearIsometry hΩ.measurableSet).toContinuousLinearMap.comp (value hΩ) + +def zeroGrad : H10 hΩ →L[ℝ] Lp Plane 2 (volume : Measure Plane) := + (LpZeroExtension.linearIsometry hΩ.measurableSet).toContinuousLinearMap.comp (grad hΩ) + +lemma zeroValue_test (f : smoothTestSpace Ω) + (hf : MemLp (f : Plane → ℝ) 2 (volume : Measure Plane)) : + zeroValue hΩ (smoothTestToH10 hΩ f) = hf.toLp f := by + exact LpZeroExtension.linearIsometry_toLp hΩ.measurableSet hf + ((subset_tsupport _).trans f.property.2.2) + +lemma zeroGrad_test (f : smoothTestSpace Ω) + (hf : MemLp (gradient (f : Plane → ℝ)) 2 (volume : Measure Plane)) : + zeroGrad hΩ (smoothTestToH10 hΩ f) = hf.toLp (gradient (f : Plane → ℝ)) := by + apply LpZeroExtension.linearIsometry_toLp hΩ.measurableSet hf + intro x hx + by_contra hn + apply hx + rw [gradient,fderiv_of_notMem_tsupport ℝ (fun hh => hn (f.property.2.2 hh)),map_zero] + +lemma inner_zeroValue_toLp {a : Plane → ℝ} (ha : MemLp a 2 (volume : Measure Plane)) + (u : H10 hΩ) : inner ℝ (ha.toLp a) (zeroValue hΩ u) = ∫ x, zeroValue hΩ u x * a x := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [ha.coeFn_toLp] with x hx + simp only [RCLike.inner_apply, RCLike.conj_to_real, hx] + +lemma inner_zeroGrad_toLp {φ : Plane → ℝ} (e : Plane) + (ha : MemLp (fun x => φ x • e) 2 (volume : Measure Plane)) + (u : H10 hΩ) : inner ℝ (ha.toLp _) (zeroGrad hΩ u) = + ∫ x, inner ℝ (zeroGrad hΩ u x) e * φ x := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [ha.coeFn_toLp] with x hx + change inner ℝ ((ha.toLp _) x) ((zeroGrad hΩ u) x) = _ + calc + _ = inner ℝ (φ x • e) ((zeroGrad hΩ u) x) := congrArg (fun z : Plane => inner ℝ z ((zeroGrad hΩ u) x)) hx + _ = _ := inner_smul_reverse e ((zeroGrad hΩ u) x) (φ x) + + + +lemma zero_hasH1Gradient (u : H10 hΩ) : + HasH1Gradient univ (zeroValue hΩ u) (zeroGrad hΩ u) := by + refine ⟨by simpa using Lp.memLp (zeroValue hΩ u),by simpa using Lp.memLp (zeroGrad hΩ u),?_⟩ + intro φ hφ hc _ e + have hdf : MemLp (fun x => fderiv ℝ φ x e) 2 (volume : Measure Plane) := by + simpa using test_derivative_memLp (Ω := univ) hφ hc e + have hvec : MemLp (fun x => φ x • e) 2 (volume : Measure Plane) := by + simpa using test_vector_memLp (Ω := univ) hφ hc e + let a : Lp ℝ 2 (volume : Measure Plane) := hdf.toLp _ + let b : Lp Plane 2 (volume : Measure Plane) := hvec.toLp _ + let L : H10 hΩ →L[ℝ] ℝ := ((innerSL ℝ a).comp (zeroValue hΩ)) + + ((innerSL ℝ b).comp (zeroGrad hΩ)) + have hL (v : H10 hΩ) : L v = + (∫ x, zeroValue hΩ v x * fderiv ℝ φ x e) + + (∫ x, inner ℝ (zeroGrad hΩ v x) e * φ x) := by + change inner ℝ a (zeroValue hΩ v) + inner ℝ b (zeroGrad hΩ v) = _ + exact congrArg₂ (· + ·) (inner_zeroValue_toLp hΩ hdf v) (inner_zeroGrad_toLp hΩ e hvec v) + have hdense : ∀ f : smoothTestSpace Ω, L (smoothTestToH10 hΩ f) = 0 := by + intro f + have hmf : MemLp (f : Plane → ℝ) 2 (volume : Measure Plane) := by + simpa using test_memLp (Ω := univ) f.property.1 f.property.2.1 + have hmg : MemLp (gradient (f : Plane → ℝ)) 2 (volume : Measure Plane) := by + simpa using test_gradient_memLp (Ω := univ) f.property.1 f.property.2.1 + rw [hL,zeroValue_test hΩ f hmf,zeroGrad_test hΩ f hmg] + have hi := (HasH1Gradient.test isOpen_univ f.property.1 f.property.2.1).2.2 + φ hφ hc (subset_univ _) e + simp only [Measure.restrict_univ] at hi + have hv : (∫ x, hmf.toLp (f : Plane → ℝ) x * fderiv ℝ φ x e) = ∫ x, (f : Plane → ℝ) x * fderiv ℝ φ x e := by + apply integral_congr_ae + filter_upwards [hmf.coeFn_toLp] with x hx using congrArg (fun t => t * fderiv ℝ φ x e) hx + have hg : (∫ x, inner ℝ (hmg.toLp _ x) e * φ x) = + ∫ x, inner ℝ (gradient (f : Plane → ℝ) x) e * φ x := by + apply integral_congr_ae + filter_upwards [hmg.coeFn_toLp] with x hx using congrArg (fun t => inner ℝ t e * φ x) hx + rw [hv,hg,hi,neg_add_cancel] + have hz : L u = 0 := isClosed_property (dense_smoothTestToH10 hΩ) + (isClosed_eq L.continuous continuous_const) hdense u + rw [hL] at hz + simp only [Measure.restrict_univ] + linarith + +end StrictHotSpots.H10 +end H10ZeroExtensionCombinedLayer + +section HelmholtzUCPCombinedLayer + + + + + + +open Set MeasureTheory Filter Metric Complex +open scoped Topology ContDiff Laplacian +namespace StrictHotSpots.Helmholtz + +lemma secondOrder_zero {f g A B : ℝ → ℂ} {a b K : ℝ} + (hf : ContinuousOn f (Icc a b)) (hg : ContinuousOn g (Icc a b)) + (hdf : ∀ x ∈ Ico a b, HasDerivAt f (g x) x) + (hdg : ∀ x ∈ Ico a b, HasDerivAt g (A x * f x + B x * g x) x) + (ha : f a = 0) (hga : g a = 0) + (hK : ∀ x ∈ Ico a b, 1 + ‖A x‖ + ‖B x‖ ≤ K) : + ∀ x ∈ Icc a b, f x = 0 ∧ g x = 0 := by + have hz := eq_zero_of_abs_deriv_le_mul_abs_self_of_eq_zero_right + (f := fun x => (f x,g x)) (f' := fun x => (g x,A x*f x+B x*g x)) + (hf.prodMk hg) (fun x hx => ((hdf x hx).prodMk (hdg x hx)).hasDerivWithinAt) + (by simp [ha,hga]) (K := K) ?_ + · intro x hx + have h := hz x hx + exact ⟨congrArg Prod.fst h, congrArg Prod.snd h⟩ + · intro x hx + rw [Prod.norm_def, Prod.norm_def] + apply max_le + · have hk : 1 ≤ K := by + have := hK x hx + linarith [norm_nonneg (A x), norm_nonneg (B x)] + exact (le_max_right _ _).trans (le_mul_of_one_le_left (by positivity) hk) + · apply (norm_add_le _ _).trans + rw [norm_mul,norm_mul] + calc + _ ≤ ‖A x‖ * max ‖f x‖ ‖g x‖ + ‖B x‖ * max ‖f x‖ ‖g x‖ := by + exact add_le_add + (mul_le_mul_of_nonneg_left (le_max_left _ _) (norm_nonneg _)) + (mul_le_mul_of_nonneg_left (le_max_right _ _) (norm_nonneg _)) + _ = (‖A x‖ + ‖B x‖) * max ‖f x‖ ‖g x‖ := (add_mul _ _ _).symm + _ ≤ K * max ‖f x‖ ‖g x‖ := by + gcongr + have := hK x hx + linarith + +lemma continuous_eq_zero_of_fourierCoeff {T : ℝ} [Fact (0 < T)] + {f : AddCircle T → ℂ} (hf : Continuous f) (h : ∀ n : ℤ, fourierCoeff f n = 0) : + f = 0 := by + let F : C(AddCircle T,ℂ) := ⟨f,hf⟩ + have he : fourierCoeff F = fun _ : ℤ => (0 : ℂ) := funext h + have hs : Summable (fourierCoeff F) := by rw [he]; exact summable_zero + funext x + have hz := has_pointwise_sum_fourier_series_of_summable hs x + have hz' : HasSum (fun _ : ℤ => (0 : ℂ)) (f x) := by + simpa only [he, zero_smul] using! hz + exact hz'.unique hasSum_zero + +lemma bilinear_rotation (B : ℂ →L[ℝ] ℂ →L[ℝ] ℂ) (e : ℂ) : + B e e + B (e * I) (e * I) = ‖e‖ ^ 2 • (B 1 1 + B I I) := by + have he : e = e.re • (1 : ℂ) + e.im • I := by + simpa only [real_smul, mul_one] using (re_add_im e).symm + have hei : e * I = (-e.im) • (1 : ℂ) + e.re • I := by + apply Complex.ext <;> simp + have hn : (‖e‖ ^ 2 : ℝ) = e.re^2 + e.im^2 := by + rw [Complex.sq_norm, Complex.normSq_apply] + ring + calc + _ = B (e.re • 1 + e.im • I) (e.re • 1 + e.im • I) + + B ((-e.im) • 1 + e.re • I) ((-e.im) • 1 + e.re • I) := by + exact congrArg₂ (· + ·) (congrArg (fun z => B z z) he) + (congrArg (fun z => B z z) hei) + _ = _ := by + simp only [map_add, map_smul, add_apply, smul_apply] + simp only [real_smul, hn] + push_cast + ring + + +def direction (θ : ℝ) : ℂ := circleMap 0 1 θ + +def radial (u : ℂ → ℂ) (a : ℂ) (r θ : ℝ) : ℂ := u (circleMap a r θ) +def radialDeriv (u : ℂ → ℂ) (a : ℂ) (r θ : ℝ) : ℂ := + fderiv ℝ u (circleMap a r θ) (direction θ) +def radialSecond (u : ℂ → ℂ) (a : ℂ) (r θ : ℝ) : ℂ := + fderiv ℝ (fderiv ℝ u) (circleMap a r θ) (direction θ) (direction θ) +def angularDeriv (u : ℂ → ℂ) (a : ℂ) (r θ : ℝ) : ℂ := + fderiv ℝ u (circleMap a r θ) (circleMap 0 r θ * I) +def angularSecond (u : ℂ → ℂ) (a : ℂ) (r θ : ℝ) : ℂ := + fderiv ℝ (fderiv ℝ u) (circleMap a r θ) + (circleMap 0 r θ * I) (circleMap 0 r θ * I) - r • radialDeriv u a r θ + +lemma point_eq (a : ℂ) (r θ : ℝ) : + circleMap a r θ = a + r • direction θ := by simp [direction,circleMap,real_smul] + +lemma hasDerivAt_point_radius (a : ℂ) (r θ : ℝ) : + HasDerivAt (fun t => circleMap a t θ) (direction θ) r := by + simpa only [point_eq,one_smul,id_eq] using! + ((hasDerivAt_id r).smul_const (direction θ)).const_add a + +lemma hasDerivAt_radial {u : ℂ → ℂ} {a : ℂ} {r θ : ℝ} + (hu : DifferentiableAt ℝ u (circleMap a r θ)) : + HasDerivAt (fun t => radial u a t θ) (radialDeriv u a r θ) r := + hu.hasFDerivAt.comp_hasDerivAt r (hasDerivAt_point_radius a r θ) + +lemma hasDerivAt_radialDeriv {u : ℂ → ℂ} {a : ℂ} {r θ : ℝ} + (hu : DifferentiableAt ℝ (fderiv ℝ u) (circleMap a r θ)) : + HasDerivAt (fun t => radialDeriv u a t θ) (radialSecond u a r θ) r := by + have hD : HasDerivAt (fun t : ℝ => fderiv ℝ u (circleMap a t θ)) + (fderiv ℝ (fderiv ℝ u) (circleMap a r θ) (direction θ)) r := + hu.hasFDerivAt.comp_hasDerivAt r (hasDerivAt_point_radius a r θ) + have h := hD.clm_apply (hasDerivAt_const r (direction θ)) + simpa only [radialDeriv,radialSecond,map_zero,add_zero] using! h + +lemma hasDerivAt_angular {u : ℂ → ℂ} {a : ℂ} {r θ : ℝ} + (hu : DifferentiableAt ℝ u (circleMap a r θ)) : + HasDerivAt (radial u a r) (angularDeriv u a r θ) θ := + hu.hasFDerivAt.comp_hasDerivAt θ (hasDerivAt_circleMap a r θ) + +lemma hasDerivAt_angularDeriv {u : ℂ → ℂ} {a : ℂ} {r θ : ℝ} + (hu : DifferentiableAt ℝ (fderiv ℝ u) (circleMap a r θ)) : + HasDerivAt (angularDeriv u a r) (angularSecond u a r θ) θ := by + have h := (hu.hasFDerivAt.comp_hasDerivAt θ (hasDerivAt_circleMap a r θ)).clm_apply + ((hasDerivAt_circleMap 0 r θ).mul_const I) + have he : (circleMap 0 r θ * I) * I = -(r • direction θ) := by + rw [mul_assoc,I_mul_I,mul_neg_one,point_eq,zero_add] + simpa only [Function.comp_def,he,map_neg,map_smul,sub_eq_add_neg, + angularDeriv,angularSecond,radialDeriv] using! h + +lemma polar_laplacian (u : ℂ → ℂ) (a : ℂ) {r : ℝ} (hr : r ≠ 0) (θ : ℝ) : + radialSecond u a r θ + r⁻¹ • radialDeriv u a r θ + + (r^2)⁻¹ • angularSecond u a r θ = (Δ u) (circleMap a r θ) := by + have hrot := bilinear_rotation (fderiv ℝ (fderiv ℝ u) (circleMap a r θ)) (direction θ) + have hn : ‖direction θ‖ = 1 := by simp [direction] + rw [hn,one_pow,one_smul] at hrot + rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_complexPlane] + simp only [iteratedFDeriv_two_apply,Fin.isValue,Matrix.cons_val_zero,Matrix.cons_val_one, + Matrix.cons_val_fin_one] + rw [← hrot] + unfold radialSecond angularSecond radialDeriv + rw [point_eq (0 : ℂ),zero_add,smul_mul_assoc] + simp only [map_smul,smul_apply,smul_smul] + simp only [real_smul,Complex.ofReal_inv,Complex.ofReal_pow,Complex.ofReal_mul] + have hrc : (r : ℂ) ≠ 0 := by exact_mod_cast hr + field_simp [hrc] + ring + +end StrictHotSpots.Helmholtz +end HelmholtzUCPCombinedLayer + +section HelmholtzFourierCombinedLayer + +open Set MeasureTheory Filter Metric Complex +open scoped Topology ContDiff Laplacian Interval +namespace StrictHotSpots.Helmholtz + + +lemma hasDerivAt_intervalIntegral_of_continuousOn {F F' : ℝ → ℝ → ℂ} + {S : Set ℝ} (hS : IsOpen S) {r : ℝ} (hr : r ∈ S) (a b : ℝ) + (hF : ContinuousOn (Function.uncurry F) (S ×ˢ univ)) + (hF' : ContinuousOn (Function.uncurry F') (S ×ˢ univ)) + (hD : ∀ t ∈ S, ∀ θ, HasDerivAt (fun t => F t θ) (F' t θ) t) : + HasDerivAt (fun t => ∫ θ in a..b, F t θ) (∫ θ in a..b, F' r θ) r := by + obtain ⟨ε,hε,hεS⟩ := Metric.mem_nhds_iff.mp (hS.mem_nhds hr) + let δ := ε / 2 + have hδ : 0 < δ := half_pos hε + have hsub : Icc (r-δ) (r+δ) ⊆ S := by + intro x hx + apply hεS + rw [Metric.mem_ball,Real.dist_eq] + rw [abs_lt] + rcases hx with ⟨hx₁,hx₂⟩ + constructor <;> dsimp [δ] at * <;> linarith + obtain ⟨C,hC⟩ := (isCompact_Icc.prod isCompact_uIcc).exists_bound_of_continuousOn + (hF'.mono (show Icc (r-δ) (r+δ) ×ˢ uIcc a b ⊆ S ×ˢ univ from by + intro x hx; exact ⟨hsub hx.1,mem_univ _⟩)) + have hc (t : ℝ) (ht : t ∈ S) : Continuous (F t) := by + rw [← continuousOn_univ] + exact hF.comp (continuous_const.prodMk continuous_id).continuousOn + (fun θ _ => ⟨ht,mem_univ θ⟩) + have hc' (t : ℝ) (ht : t ∈ S) : Continuous (F' t) := by + rw [← continuousOn_univ] + exact hF'.comp (continuous_const.prodMk continuous_id).continuousOn + (fun θ _ => ⟨ht,mem_univ θ⟩) + refine (intervalIntegral.hasDerivAt_integral_of_dominated_loc_of_deriv_le + (s := Icc (r-δ) (r+δ)) (bound := fun _ => C) + (Icc_mem_nhds (by linarith) (by linarith)) ?_ + ((hc r hr).intervalIntegrable a b) ((hc' r hr).aestronglyMeasurable) + ?_ intervalIntegrable_const ?_).2 + · filter_upwards [hS.mem_nhds hr] with t ht + exact (hc t ht).aestronglyMeasurable + · exact Filter.Eventually.of_forall (fun θ hθ t ht => hC (t,θ) ⟨ht,uIoc_subset_uIcc hθ⟩) + · exact Filter.Eventually.of_forall (fun θ _ t ht => hD t (hsub ht) θ) + +local instance twoPiPos : Fact (0 < 2 * Real.pi) := ⟨Real.two_pi_pos⟩ + +def weight (n : ℤ) (θ : ℝ) : ℂ := fourier (-n) (θ : AddCircle (2*Real.pi)) + +lemma hasDerivAt_weight (n : ℤ) (θ : ℝ) : + HasDerivAt (weight n) (-I*n*weight n θ) θ := by + have he : (-2 * (Real.pi:ℂ) * I * n / (2*Real.pi) : ℂ) = -I*n := by + have hp : (Real.pi:ℂ) ≠ 0 := by exact_mod_cast Real.pi_ne_zero + field_simp + simpa only [weight,Complex.ofReal_mul,Complex.ofReal_ofNat,he] using! + hasDerivAt_fourier_neg (2*Real.pi) n θ + +lemma continuous_weight (n : ℤ) : Continuous (weight n) := + continuous_iff_continuousAt.mpr fun θ => (hasDerivAt_weight n θ).continuousAt + +lemma weight_periodic (n : ℤ) : Function.Periodic (weight n) (2*Real.pi) := by + intro θ + simp [weight] + +lemma integral_weight_deriv {f f' : ℝ → ℂ} (n : ℤ) + (hdf : ∀ θ, HasDerivAt f (f' θ) θ) (hf' : Continuous f') + (hp : Function.Periodic f (2*Real.pi)) : + (∫ θ in 0..2*Real.pi, weight n θ * f' θ) = + (I*n) * ∫ θ in 0..2*Real.pi, weight n θ * f θ := by + have h := intervalIntegral.integral_mul_deriv_eq_deriv_mul + (fun θ _ => hasDerivAt_weight n θ) (fun θ _ => hdf θ) + (((continuous_const.mul (continuous_weight n))).intervalIntegrable 0 (2*Real.pi)) + (hf'.intervalIntegrable 0 (2*Real.pi)) + have hp0 : f (2*Real.pi) = f 0 := by simpa using hp 0 + have hw0 : weight n (2*Real.pi) = weight n 0 := by simpa using weight_periodic n 0 + rw [hp0,hw0,sub_self,zero_sub] at h + simp only [mul_assoc, intervalIntegral.integral_const_mul] at h + simpa only [neg_mul,neg_neg,mul_assoc] using h + +lemma circleMap_mem_ball {a : ℂ} {r R θ : ℝ} (hr : r ∈ Ioo 0 R) : + circleMap a r θ ∈ ball a R := by + rw [mem_ball,dist_eq_norm] + have h : circleMap a r θ - a = circleMap 0 r θ := by simp [circleMap] + rw [h,norm_circleMap_zero,abs_of_pos hr.1] + exact hr.2 + +lemma continuous_jointCircleMap (a : ℂ) : + Continuous (fun p : ℝ × ℝ => circleMap a p.1 p.2) := by + unfold circleMap + fun_prop + +lemma continuous_direction : Continuous direction := by + exact continuous_circleMap 0 1 + +lemma radial_regular {u : ℂ → ℂ} {a : ℂ} {R : ℝ} + (hu : ∀ z ∈ ball a R, ContDiffAt ℝ 2 u z) : + ContinuousOn (Function.uncurry (radial u a)) (Ioo 0 R ×ˢ univ) ∧ + ContinuousOn (Function.uncurry (radialDeriv u a)) (Ioo 0 R ×ˢ univ) ∧ + ContinuousOn (Function.uncurry (radialSecond u a)) (Ioo 0 R ×ˢ univ) := by + have hp := continuous_jointCircleMap a + have hdir : Continuous (fun p : ℝ × ℝ => direction p.2) := continuous_direction.comp continuous_snd + have h1 (p : ℝ × ℝ) (h : p ∈ Ioo 0 R ×ˢ univ) : + ContDiffAt ℝ 1 (fderiv ℝ u) (circleMap a p.1 p.2) := + (hu _ (circleMap_mem_ball h.1)).fderiv_right (by norm_num) + have h2 (p : ℝ × ℝ) (h : p ∈ Ioo 0 R ×ˢ univ) : + ContDiffAt ℝ 0 (fderiv ℝ (fderiv ℝ u)) (circleMap a p.1 p.2) := + (h1 p h).fderiv_right (by norm_num) + refine ⟨?_,?_,?_⟩ + · intro p hp' + exact ((hu _ (circleMap_mem_ball (θ := p.2) hp'.1)).continuousAt.comp (f := fun q : ℝ × ℝ => circleMap a q.1 q.2) hp.continuousAt).continuousWithinAt + · intro p hp' + exact (((h1 p hp').continuousAt.comp (f := fun q : ℝ × ℝ => circleMap a q.1 q.2) hp.continuousAt).clm_apply hdir.continuousAt).continuousWithinAt + · intro p hp' + exact ((((h2 p hp').continuousAt.comp (f := fun q : ℝ × ℝ => circleMap a q.1 q.2) hp.continuousAt).clm_apply + hdir.continuousAt).clm_apply hdir.continuousAt).continuousWithinAt + +lemma angular_regular {u : ℂ → ℂ} {a : ℂ} {r R : ℝ} + (hu : ∀ z ∈ ball a R, ContDiffAt ℝ 2 u z) (hr : r ∈ Ioo 0 R) : + Continuous (radial u a r) ∧ Continuous (angularDeriv u a r) ∧ + Continuous (angularSecond u a r) := by + have hp := continuous_circleMap a r + have hv : Continuous (fun θ => circleMap 0 r θ * I) := by fun_prop + have hd : Continuous (radialDeriv u a r) := by + rw [← continuousOn_univ] + exact (radial_regular hu).2.1.comp (continuous_const.prodMk continuous_id).continuousOn + (fun _ _ => ⟨hr,mem_univ _⟩) + have h1 (θ : ℝ) : ContDiffAt ℝ 1 (fderiv ℝ u) (circleMap a r θ) := + (hu _ (circleMap_mem_ball hr)).fderiv_right (by norm_num) + have h2 (θ : ℝ) : ContDiffAt ℝ 0 (fderiv ℝ (fderiv ℝ u)) (circleMap a r θ) := + (h1 θ).fderiv_right (by norm_num) + refine ⟨continuous_iff_continuousAt.mpr ?_,continuous_iff_continuousAt.mpr ?_, + continuous_iff_continuousAt.mpr ?_⟩ + · intro θ + exact (hu _ (circleMap_mem_ball hr)).continuousAt.comp hp.continuousAt + · intro θ + exact ((h1 θ).continuousAt.comp hp.continuousAt).clm_apply hv.continuousAt + · intro θ + exact ((((h2 θ).continuousAt.comp hp.continuousAt).clm_apply hv.continuousAt).clm_apply + hv.continuousAt).sub ((show ContinuousAt (fun _ : ℝ => r) θ from continuousAt_const).smul hd.continuousAt) + +def coeff (u : ℂ → ℂ) (a : ℂ) (n : ℤ) (r : ℝ) : ℂ := + ∫ θ in 0..2*Real.pi, weight n θ * radial u a r θ + +def coeffDeriv (u : ℂ → ℂ) (a : ℂ) (n : ℤ) (r : ℝ) : ℂ := + ∫ θ in 0..2*Real.pi, weight n θ * radialDeriv u a r θ + +def coeffSecond (u : ℂ → ℂ) (a : ℂ) (n : ℤ) (r : ℝ) : ℂ := + ∫ θ in 0..2*Real.pi, weight n θ * radialSecond u a r θ + +lemma hasDerivAt_coeff {u : ℂ → ℂ} {a : ℂ} {r R : ℝ} (n : ℤ) + (hu : ∀ z ∈ ball a R, ContDiffAt ℝ 2 u z) (hr : r ∈ Ioo 0 R) : + HasDerivAt (coeff u a n) (coeffDeriv u a n r) r := by + have h := radial_regular hu + exact hasDerivAt_intervalIntegral_of_continuousOn + (F := fun t θ => weight n θ * radial u a t θ) + (F' := fun t θ => weight n θ * radialDeriv u a t θ) isOpen_Ioo hr 0 (2*Real.pi) + (((continuous_weight n).comp continuous_snd).continuousOn.mul h.1) + (((continuous_weight n).comp continuous_snd).continuousOn.mul h.2.1) + (fun t ht θ => (hasDerivAt_radial + ((hu _ (circleMap_mem_ball ht)).differentiableAt (by norm_num))).const_mul _) + +lemma hasDerivAt_coeffDeriv {u : ℂ → ℂ} {a : ℂ} {r R : ℝ} (n : ℤ) + (hu : ∀ z ∈ ball a R, ContDiffAt ℝ 2 u z) (hr : r ∈ Ioo 0 R) : + HasDerivAt (coeffDeriv u a n) (coeffSecond u a n r) r := by + have h := radial_regular hu + exact hasDerivAt_intervalIntegral_of_continuousOn + (F := fun t θ => weight n θ * radialDeriv u a t θ) + (F' := fun t θ => weight n θ * radialSecond u a t θ) isOpen_Ioo hr 0 (2*Real.pi) + (((continuous_weight n).comp continuous_snd).continuousOn.mul h.2.1) + (((continuous_weight n).comp continuous_snd).continuousOn.mul h.2.2) + (fun t ht θ => (hasDerivAt_radialDeriv + (((hu _ (circleMap_mem_ball ht)).fderiv_right (m := 1) (by norm_num)).differentiableAt + (by norm_num))).const_mul _) + +lemma radial_periodic (u : ℂ → ℂ) (a : ℂ) (r : ℝ) : + Function.Periodic (radial u a r) (2*Real.pi) := + (periodic_circleMap a r).comp u + +lemma angularDeriv_periodic (u : ℂ → ℂ) (a : ℂ) (r : ℝ) : + Function.Periodic (angularDeriv u a r) (2*Real.pi) := by + intro θ + simp only [angularDeriv,periodic_circleMap a r θ,periodic_circleMap 0 r θ] + +lemma integral_weight_angularSecond {u : ℂ → ℂ} {a : ℂ} {r R : ℝ} (n : ℤ) + (hu : ∀ z ∈ ball a R, ContDiffAt ℝ 2 u z) (hr : r ∈ Ioo 0 R) : + (∫ θ in 0..2*Real.pi, weight n θ * angularSecond u a r θ) = + -(n : ℂ)^2 * coeff u a n r := by + have hd : ∀ θ, HasDerivAt (radial u a r) (angularDeriv u a r θ) θ := + fun θ => hasDerivAt_angular ((hu _ (circleMap_mem_ball hr)).differentiableAt (by norm_num)) + have hdd : ∀ θ, HasDerivAt (angularDeriv u a r) (angularSecond u a r θ) θ := + fun θ => hasDerivAt_angularDeriv + (((hu _ (circleMap_mem_ball hr)).fderiv_right (m := 1) (by norm_num)).differentiableAt + (by norm_num)) + rw [integral_weight_deriv n hdd (angular_regular hu hr).2.2 (angularDeriv_periodic u a r), + integral_weight_deriv n hd (angular_regular hu hr).2.1 (radial_periodic u a r)] + change I * n * (I * n * coeff u a n r) = _ + calc + _ = Complex.I^2 * (n : ℂ)^2 * coeff u a n r := by ring + _ = _ := by rw [I_sq]; ring + +lemma coeff_ode {u : ℂ → ℂ} {a : ℂ} {r R μ : ℝ} (n : ℤ) + (hu : ∀ z ∈ ball a R, ContDiffAt ℝ 2 u z) + (hPDE : ∀ z ∈ ball a R, (Δ u) z = -μ • u z) (hr : r ∈ Ioo 0 R) : + coeffSecond u a n r = ((n : ℂ)^2 / (r : ℂ)^2 - μ) * coeff u a n r + + (-(r : ℂ)⁻¹) * coeffDeriv u a n r := by + have hc := radial_regular hu + have hcr (F : ℝ → ℝ → ℂ) + (h : ContinuousOn (Function.uncurry F) (Ioo 0 R ×ˢ univ)) : Continuous (F r) := by + rw [← continuousOn_univ] + exact h.comp (continuous_const.prodMk continuous_id).continuousOn (fun _ _ => ⟨hr,mem_univ _⟩) + have h1 := (continuous_weight n).mul (hcr _ hc.2.1) + have h2 := (continuous_weight n).mul (hcr _ hc.2.2) + have hA := (continuous_weight n).mul (angular_regular hu hr).2.2 + have he (θ : ℝ) : + weight n θ * radialSecond u a r θ + (r : ℂ)⁻¹ * (weight n θ * radialDeriv u a r θ) + + ((r : ℂ)^2)⁻¹ * (weight n θ * angularSecond u a r θ) = + -(μ : ℂ) * (weight n θ * radial u a r θ) := by + have hp := polar_laplacian u a hr.1.ne' θ + rw [hPDE _ (circleMap_mem_ball hr)] at hp + simp only [real_smul,Complex.ofReal_inv,Complex.ofReal_pow,Complex.ofReal_neg] at hp + change _ = -(μ : ℂ) * radial u a r θ at hp + linear_combination weight n θ * hp + have hI := intervalIntegral.integral_congr (μ := volume) (a := 0) (b := 2*Real.pi) (fun θ _ => he θ) + have hi1 : IntervalIntegrable + (fun θ => (r : ℂ)⁻¹ * (weight n θ * radialDeriv u a r θ)) volume 0 (2*Real.pi) := + (continuous_const.mul h1).intervalIntegrable _ _ + have hiA : IntervalIntegrable + (fun θ => ((r : ℂ)^2)⁻¹ * (weight n θ * angularSecond u a r θ)) volume 0 (2*Real.pi) := + (continuous_const.mul hA).intervalIntegrable _ _ + have hi2 : IntervalIntegrable + (fun θ => weight n θ * radialSecond u a r θ) volume 0 (2*Real.pi) := + h2.intervalIntegrable _ _ + rw [intervalIntegral.integral_add (hi2.add hi1) hiA, + intervalIntegral.integral_add hi2 hi1] at hI + simp only [intervalIntegral.integral_const_mul] at hI + rw [integral_weight_angularSecond n hu hr] at hI + change coeffSecond u a n r + (r : ℂ)⁻¹ * coeffDeriv u a n r + + ((r : ℂ)^2)⁻¹ * (-(n:ℂ)^2 * coeff u a n r) = -(μ:ℂ)*coeff u a n r at hI + rw [div_eq_mul_inv] + linear_combination hI + +end StrictHotSpots.Helmholtz +end HelmholtzFourierCombinedLayer + +section HelmholtzContinuationCombinedLayer + +open Set MeasureTheory Filter Metric Complex +open scoped Topology ContDiff Laplacian +namespace StrictHotSpots.Helmholtz + +local instance twoPiPosCont : Fact (0 < 2 * Real.pi) := ⟨Real.two_pi_pos⟩ + +def circleFunction (u : ℂ → ℂ) (a : ℂ) (r : ℝ) (s : AddCircle (2 * Real.pi)) : ℂ := + u (a + r • (AddCircle.homeomorphCircle' s : ℂ)) + +lemma circleFunction_coe (u : ℂ → ℂ) (a : ℂ) (r θ : ℝ) : + circleFunction u a r (θ : AddCircle (2*Real.pi)) = radial u a r θ := by + simp only [circleFunction,AddCircle.homeomorphCircle'_apply_mk,Circle.coe_exp,radial,circleMap,real_smul] + +lemma continuous_circleFunction {u : ℂ → ℂ} {a : ℂ} {r R : ℝ} + (hu : ∀ z ∈ ball a R, ContinuousAt u z) (hr : r ∈ Ioo 0 R) : + Continuous (circleFunction u a r) := by + let f : AddCircle (2*Real.pi) → ℂ := fun s => a + r • (AddCircle.homeomorphCircle' s : ℂ) + have hf : Continuous f := by dsimp [f]; fun_prop + have hm (s : AddCircle (2*Real.pi)) : f s ∈ ball a R := by + rw [mem_ball,dist_eq_norm] + dsimp only [f] + rw [add_sub_cancel_left,norm_smul,Real.norm_eq_abs,abs_of_pos hr.1,Circle.norm_coe,mul_one] + exact hr.2 + exact continuous_iff_continuousAt.mpr fun s => (hu _ (hm s)).comp hf.continuousAt + +lemma coeff_zero_implies_radial_zero {u : ℂ → ℂ} {a : ℂ} {r R : ℝ} + (hu : ∀ z ∈ ball a R, ContinuousAt u z) (hr : r ∈ Ioo 0 R) + (h : ∀ n, coeff u a n r = 0) : ∀ θ, radial u a r θ = 0 := by + have hz : circleFunction u a r = 0 := continuous_eq_zero_of_fourierCoeff + (continuous_circleFunction hu hr) (fun n => by + rw [fourierCoeff_eq_intervalIntegral _ _ 0] + simp only [zero_add,circleFunction_coe,smul_eq_mul] + change (1/(2*Real.pi)) • coeff u a n r = 0 + rw [h n,smul_zero]) + intro θ + rw [← circleFunction_coe] + exact congrFun hz (θ : AddCircle (2*Real.pi)) + +lemma coeff_zero_of_ball_zero {u : ℂ → ℂ} {a : ℂ} {r ε : ℝ} + (hzero : ∀ z ∈ ball a ε, u z = 0) (hr : r ∈ Ioo 0 ε) (n : ℤ) : + coeff u a n r = 0 := by + unfold coeff radial + simp only [hzero _ (circleMap_mem_ball hr),mul_zero,intervalIntegral.integral_zero] + +lemma coeffDeriv_zero_of_ball_zero {u : ℂ → ℂ} {a : ℂ} {r ε : ℝ} + (hzero : ∀ z ∈ ball a ε, u z = 0) (hr : r ∈ Ioo 0 ε) (n : ℤ) : + coeffDeriv u a n r = 0 := by + have hd (z : ℂ) (hz : z ∈ ball a ε) : fderiv ℝ u z = 0 := by + have he : u =ᶠ[𝓝 z] (fun _ => 0) := by + filter_upwards [isOpen_ball.mem_nhds hz] with x hx + exact hzero x hx + simpa only [fderiv_const_apply] using he.fderiv_eq (𝕜 := ℝ) + unfold coeffDeriv radialDeriv + simp only [hd _ (circleMap_mem_ball hr),zero_apply,mul_zero, + intervalIntegral.integral_zero] + +lemma coeff_zero_on_ball {u : ℂ → ℂ} {a : ℂ} {R ε μ : ℝ} + (hu : ∀ z ∈ ball a R, ContDiffAt ℝ 2 u z) + (hPDE : ∀ z ∈ ball a R, (Δ u) z = -μ • u z) + (hε : 0 < ε) (hzero : ∀ z ∈ ball a ε, u z = 0) + (n : ℤ) : ∀ r ∈ Ioo 0 R, coeff u a n r = 0 := by + intro r hr + by_cases hrε : r < ε + · exact coeff_zero_of_ball_zero hzero ⟨hr.1,hrε⟩ n + have hεr : ε ≤ r := le_of_not_gt hrε + let r₀ := ε/2 + have hr₀ : r₀ ∈ Ioo 0 ε := ⟨half_pos hε,half_lt_self hε⟩ + have hi : Icc r₀ r ⊆ Ioo 0 R := by + intro x hx + exact ⟨hr₀.1.trans_le hx.1,hx.2.trans_lt hr.2⟩ + let A : ℝ → ℂ := fun x => (n : ℂ)^2 / (x : ℂ)^2 - μ + let B : ℝ → ℂ := fun x => -(x : ℂ)⁻¹ + have hA : ContinuousOn A (Icc r₀ r) := by + apply ContinuousOn.sub _ continuousOn_const + apply ContinuousOn.div continuousOn_const ((Complex.continuous_ofReal.comp continuous_id).continuousOn.pow 2) + intro x hx + exact pow_ne_zero 2 (Complex.ofReal_ne_zero.mpr (hi hx).1.ne') + have hB : ContinuousOn B (Icc r₀ r) := by + apply ContinuousOn.neg + exact (Complex.continuous_ofReal.comp continuous_id).continuousOn.inv₀ + (fun x hx => Complex.ofReal_ne_zero.mpr (hi hx).1.ne') + obtain ⟨CA,hCA⟩ := isCompact_Icc.exists_bound_of_continuousOn hA + obtain ⟨CB,hCB⟩ := isCompact_Icc.exists_bound_of_continuousOn hB + exact (secondOrder_zero + (fun x hx => (hasDerivAt_coeff n hu (hi hx)).continuousAt.continuousWithinAt) + (fun x hx => (hasDerivAt_coeffDeriv n hu (hi hx)).continuousAt.continuousWithinAt) + (fun x hx => hasDerivAt_coeff n hu (hi (Ico_subset_Icc_self hx))) + (fun x hx => by + rw [← coeff_ode n hu hPDE (hi (Ico_subset_Icc_self hx))] + exact hasDerivAt_coeffDeriv n hu (hi (Ico_subset_Icc_self hx))) + (coeff_zero_of_ball_zero hzero hr₀ n) (coeffDeriv_zero_of_ball_zero hzero hr₀ n) + (K := 1+CA+CB) (fun x hx => by + have h1 := hCA x (Ico_subset_Icc_self hx) + have h2 := hCB x (Ico_subset_Icc_self hx) + dsimp [A,B] at * + linarith) r ⟨hr₀.2.le.trans hεr,le_rfl⟩).1 + + +lemma zero_on_ball_of_zero_on_small_ball {u : ℂ → ℂ} {a : ℂ} {R ε μ : ℝ} + (hu : ∀ z ∈ ball a R, ContDiffAt ℝ 2 u z) + (hPDE : ∀ z ∈ ball a R, (Δ u) z = -μ • u z) + (hε : 0 < ε) (hzero : ∀ z ∈ ball a ε, u z = 0) : + ∀ z ∈ ball a R, u z = 0 := by + intro z hz + by_cases hza : z = a + · subst z + exact hzero a (mem_ball_self hε) + let r := ‖z-a‖ + have hr : r ∈ Ioo 0 R := ⟨norm_pos_iff.mpr (sub_ne_zero.mpr hza),by simpa [r,mem_ball,dist_eq_norm] using hz⟩ + have he : circleMap a r (arg (z-a)) = z := by + simp only [circleMap,r,norm_mul_exp_arg_mul_I] + abel + have hv := coeff_zero_implies_radial_zero (fun z hz => (hu z hz).continuousAt) hr + (fun n => coeff_zero_on_ball hu hPDE hε hzero n r hr) (arg (z-a)) + simpa only [radial,he] using hv + + + +theorem uniqueContinuation {u : ℂ → ℂ} {U : Set ℂ} {μ : ℝ} + (hU : IsOpen U) (hconn : IsPreconnected U) + (hu : ContDiffOn ℝ 2 u U) (hPDE : ∀ z ∈ U, (Δ u) z = -μ • u z) + (hzero : ∃ a ∈ U, ∀ᶠ z in 𝓝 a, u z = 0) : ∀ z ∈ U, u z = 0 := by + let S : Set ℂ := {a | ∀ᶠ z in 𝓝 a, u z = 0} + have hopen : IsOpen S := isOpen_setOfPred_eventually_nhds + have hne : (U ∩ S).Nonempty := hzero + have hcl : closure S ∩ U ⊆ S := by + intro x hx + obtain ⟨R,hR,hball⟩ := Metric.mem_nhds_iff.mp (hU.mem_nhds hx.2) + obtain ⟨a,ha,hxa⟩ := Metric.mem_closure_iff.mp hx.1 (R/4) (by positivity) + have hax : dist a x < R/4 := by simpa [dist_comm] using hxa + obtain ⟨ε,hε,hza⟩ := Metric.mem_nhds_iff.mp ha + have hbig : ball a (R/2) ⊆ U := by + intro z hz + apply hball + rw [mem_ball] at hz ⊢ + have htri := dist_triangle z a x + linarith + have hzbig : ∀ z ∈ ball a (R/2), u z = 0 := + zero_on_ball_of_zero_on_small_ball + (fun z hz => (hu z (hbig hz)).contDiffAt (hU.mem_nhds (hbig hz))) + (fun z hz => hPDE z (hbig hz)) hε hza + change ∀ᶠ z in 𝓝 x, u z = 0 + filter_upwards [Metric.ball_mem_nhds x (show 0 < R/4 by positivity)] with z hz + apply hzbig + rw [mem_ball] at hz ⊢ + have htri := dist_triangle z x a + linarith + have hsub := hconn.subset_of_closure_inter_subset hopen hne hcl + intro z hz + exact (hsub hz).self_of_nhds + +end StrictHotSpots.Helmholtz +end HelmholtzContinuationCombinedLayer + +section HelmholtzMollificationCombinedLayer + +open Set MeasureTheory Filter Metric Complex ContinuousLinearMap +open scoped Topology ContDiff Laplacian Convolution +namespace StrictHotSpots.Helmholtz + +abbrev smulFlip : ℂ →L[ℝ] ℝ →L[ℝ] ℂ := + (ContinuousLinearMap.lsmul ℝ ℝ : ℝ →L[ℝ] ℂ →L[ℝ] ℂ).flip + +lemma directional_convolution {u : ℂ → ℂ} {φ : ℂ → ℝ} + (hu : LocallyIntegrable u volume) (hφ : ContDiff ℝ ∞ φ) + (hc : HasCompactSupport φ) (x v : ℂ) : + fderiv ℝ (u ⋆[smulFlip] φ) x v = (u ⋆[smulFlip] (fun z => fderiv ℝ φ z v)) x := by + rw [(hc.hasFDerivAt_convolution_right smulFlip hu (hφ.of_le (by norm_num)) x).fderiv] + exact convolution_precompR_apply _ hu (hc.fderiv ℝ) + (hφ.continuous_fderiv (by norm_num)) x v + +lemma laplacian_convolution {u : ℂ → ℂ} {φ : ℂ → ℝ} + (hu : LocallyIntegrable u volume) (hφ : ContDiff ℝ ∞ φ) + (hc : HasCompactSupport φ) (x : ℂ) : + (Δ (u ⋆[smulFlip] φ)) x = (u ⋆[smulFlip] (Δ φ)) x := by + have hφ' : ContDiff ℝ ∞ (fderiv ℝ φ) := hφ.fderiv_right (by simp) + have hconv : ContDiff ℝ ∞ (u ⋆[smulFlip] φ) := hc.contDiff_convolution_right smulFlip hu hφ + have hcv' : Differentiable ℝ (fderiv ℝ (u ⋆[smulFlip] φ)) := + (hconv.fderiv_right (show ∞+1 ≤ ∞ by simp)).differentiable (by simp) + have he (v w : ℂ) : + fderiv ℝ (fderiv ℝ (u ⋆[smulFlip] φ)) x v w = + (u ⋆[smulFlip] (fun y => fderiv ℝ (fderiv ℝ φ) y v w)) x := by + have hfun : (fun y => fderiv ℝ (u ⋆[smulFlip] φ) y w) = + (u ⋆[smulFlip] fun y => fderiv ℝ φ y w) := funext fun y => directional_convolution hu hφ hc y w + have haux := directional_convolution hu (hφ'.clm_apply contDiff_const) + (hc.fderiv_apply ℝ w) x v + rw [← hfun] at haux + simpa only [fderiv_clm_apply hcv'.differentiableAt (differentiableAt_const w), + fderiv_clm_apply (hφ'.differentiable (by simp)).differentiableAt (differentiableAt_const w), + fderiv_const_apply,add_apply,ContinuousLinearMap.comp_apply, + zero_apply,map_zero,add_zero,zero_add,ContinuousLinearMap.flip_apply] using haux + simp only [InnerProductSpace.laplacian_eq_iteratedFDeriv_complexPlane, + iteratedFDeriv_two_apply,Fin.isValue,Matrix.cons_val_zero,Matrix.cons_val_one, + Matrix.cons_val_fin_one,he] + have hcc (v w : ℂ) : HasCompactSupport (fun y => fderiv ℝ (fderiv ℝ φ) y v w) := + ((hc.fderiv ℝ).fderiv ℝ).comp_left (g := fun F : ℂ →L[ℝ] ℂ →L[ℝ] ℝ => F v w) (by simp) + have hints (v w : ℂ) : ConvolutionExistsAt u (fun y => fderiv ℝ (fderiv ℝ φ) y v w) x smulFlip volume := + (hcc v w).convolutionExists_right smulFlip hu + (((hφ'.continuous_fderiv (by simp)).clm_apply continuous_const).clm_apply continuous_const) x + exact ((hints 1 1).distrib_add (hints Complex.I Complex.I)).symm + +lemma laplacian_reflect_translate {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ) (x y : ℂ) : + (Δ (fun z => φ (x-z))) y = (Δ φ) (x-y) := by + have hφ' : ContDiff ℝ ∞ (fderiv ℝ φ) := hφ.fderiv_right (by simp) + have hd (z : ℂ) : HasFDerivAt (fun z : ℂ => x-z) (-ContinuousLinearMap.id ℝ ℂ) z := by + simpa only [zero_sub,Pi.sub_apply,id_eq] using! (hasFDerivAt_const x z).sub (hasFDerivAt_id z) + have hD : fderiv ℝ (fun z => φ (x-z)) = fun z => -(fderiv ℝ φ (x-z)) := by + funext z + have h := ((hφ.differentiable (by simp)).differentiableAt.hasFDerivAt.comp z (hd z)).fderiv + simpa only [ContinuousLinearMap.comp_neg,ContinuousLinearMap.comp_id,Function.comp_def] using! h + have hDD : fderiv ℝ (fderiv ℝ (fun z => φ (x-z))) y = fderiv ℝ (fderiv ℝ φ) (x-y) := by + rw [hD] + have h := (((hφ'.differentiable (by simp)).differentiableAt.hasFDerivAt.comp y (hd y)).neg).fderiv + simpa only [ContinuousLinearMap.comp_neg,ContinuousLinearMap.comp_id,neg_neg,Function.comp_def,Pi.neg_apply] using! h + simp only [InnerProductSpace.laplacian_eq_iteratedFDeriv_complexPlane, + iteratedFDeriv_two_apply,Fin.isValue,Matrix.cons_val_zero,Matrix.cons_val_one, + Matrix.cons_val_fin_one,hDD] + + +def WeakEquation (U : Set ℂ) (μ : ℝ) (u : ℂ → ℂ) : Prop := + ∀ φ : ℂ → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ U → + (∫ z, (Δ φ) z • u z) = -μ • (∫ z, φ z • u z) + +lemma convolution_solves {U : Set ℂ} {μ : ℝ} {u : ℂ → ℂ} + (hu : LocallyIntegrable u volume) (hPDE : WeakEquation U μ u) + {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) {x : ℂ} + (hsupp : tsupport (fun z => φ (x-z)) ⊆ U) : + (Δ (u ⋆[smulFlip] φ)) x = -μ • (u ⋆[smulFlip] φ) x := by + rw [laplacian_convolution hu hφ hc] + have ht : ContDiff ℝ ∞ (fun z => φ (x-z)) := hφ.comp (contDiff_const.sub contDiff_id) + have hct : HasCompactSupport (fun z => φ (x-z)) := hc.comp_homeomorph (Homeomorph.subLeft x) + have hp := hPDE _ ht hct hsupp + simpa only [convolution_def,smulFlip,ContinuousLinearMap.flip_apply, + ContinuousLinearMap.lsmul_apply,laplacian_reflect_translate hφ] using hp + +end StrictHotSpots.Helmholtz +end HelmholtzMollificationCombinedLayer + +section HelmholtzWeakCombinedLayer + +open Set MeasureTheory Filter Metric Complex ContinuousLinearMap +open scoped Topology ContDiff Laplacian Convolution +namespace StrictHotSpots.Helmholtz + +def mollifier (n : ℕ) : ContDiffBump (0 : ℂ) where + rIn := 1/((n:ℝ)+1) + rOut := 2/((n:ℝ)+1) + rIn_pos := by positivity + rIn_lt_rOut := by apply div_lt_div_of_pos_right (by norm_num); positivity + +lemma mollifier_radius_tendsto : Tendsto (fun n => (mollifier n).rOut) atTop (𝓝 0) := by + have h := (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul 2 + simpa only [mul_zero,mul_one_div,mollifier] using h + +def smoothen (u : ℂ → ℂ) (n : ℕ) : ℂ → ℂ := u ⋆[smulFlip] (mollifier n).normed volume + +lemma smoothen_contDiff {u : ℂ → ℂ} (hu : LocallyIntegrable u volume) (n : ℕ) : + ContDiff ℝ ∞ (smoothen u n) := + (mollifier n).hasCompactSupport_normed.contDiff_convolution_right _ hu + (mollifier n).contDiff_normed + +lemma smoothen_tendsto {u : ℂ → ℂ} (hu : LocallyIntegrable u volume) : + ∀ᵐ x ∂volume, Tendsto (fun n => smoothen u n x) atTop (𝓝 (u x)) := by + have h := ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable + mollifier_radius_tendsto (K := 2) (Eventually.of_forall (fun n => by + dsimp [mollifier] + rw [mul_one_div])) hu + simpa only [smoothen,smulFlip,convolution_flip] using h + +lemma reflected_mollifier_support (n : ℕ) (x : ℂ) : + tsupport (fun z => (mollifier n).normed volume (x-z)) ⊆ closedBall x (mollifier n).rOut := by + apply closure_minimal _ isClosed_closedBall + intro z hz + have hz' : x-z ∈ ball (0:ℂ) (mollifier n).rOut := by + rwa [← (mollifier n).support_normed_eq (μ := volume)] + rw [mem_closedBall] + have hzdist : dist z x < (mollifier n).rOut := by + simpa [mem_ball,dist_eq_norm,norm_sub_rev] using hz' + exact hzdist.le + +lemma smoothen_PDE {u : ℂ → ℂ} {a : ℂ} {R μ : ℝ} + (hu : LocallyIntegrable u volume) (hPDE : WeakEquation (ball a R) μ u) + (n : ℕ) {x : ℂ} (hx : x ∈ ball a (R-(mollifier n).rOut)) : + (Δ (smoothen u n)) x = -μ • smoothen u n x := by + apply convolution_solves hu hPDE (mollifier n).contDiff_normed + (mollifier n).hasCompactSupport_normed + intro z hz + have hp := reflected_mollifier_support n x hz + rw [mem_ball] at hx ⊢ + rw [mem_closedBall] at hp + have ht := dist_triangle z x a + linarith + +lemma smoothen_zero {u : ℂ → ℂ} {a : ℂ} {ε : ℝ} + (hzero : ∀ᵐ z ∂volume, z ∈ ball a ε → u z = 0) + {n : ℕ} (hn : (mollifier n).rOut < ε/2) + {x : ℂ} (hx : x ∈ ball a (ε/2)) : smoothen u n x = 0 := by + apply integral_eq_zero_of_ae + filter_upwards [hzero] with z hz + change (mollifier n).normed volume (x-z) • u z = 0 + by_cases hza : z ∈ ball a ε + · rw [hz hza,smul_zero] + · suffices hh : (mollifier n).normed volume (x-z) = 0 by rw [hh,zero_smul] + by_contra hh + have hh' : x-z ∈ ball (0:ℂ) (mollifier n).rOut := by + rwa [← (mollifier n).support_normed_eq (μ := volume)] + have hzdist : dist z x < (mollifier n).rOut := by + simpa [mem_ball,dist_eq_norm,norm_sub_rev] using hh' + rw [mem_ball] at hx hza + have ht := dist_triangle z x a + linarith + +lemma weak_zero_on_ball {u : ℂ → ℂ} {a : ℂ} {R ε μ : ℝ} + (hu : LocallyIntegrable u volume) (hPDE : WeakEquation (ball a R) μ u) + (hε : 0 < ε) (hzero : ∀ᵐ z ∂volume, z ∈ ball a ε → u z = 0) : + ∀ᵐ z ∂volume, z ∈ ball a R → u z = 0 := by + filter_upwards [smoothen_tendsto hu] with z hz + intro hzR + have hzdist : 0 < R-dist z a := sub_pos.mpr hzR + have hs : ∀ᶠ n in atTop, smoothen u n z = 0 := by + filter_upwards [(tendsto_order.1 mollifier_radius_tendsto).2 (min (ε/2) (R-dist z a)) + (lt_min (half_pos hε) hzdist)] with n hn + have hn₁ : (mollifier n).rOut < ε/2 := hn.trans_le (min_le_left _ _) + have hn₂ : z ∈ ball a (R-(mollifier n).rOut) := by + rw [mem_ball] + have := hn.trans_le (min_le_right _ _) + linarith + exact zero_on_ball_of_zero_on_small_ball + (fun y _ => ((smoothen_contDiff hu n).of_le (show (2 : ℕ∞ω) ≤ ∞ by decide)).contDiffAt) + (fun y hy => smoothen_PDE hu hPDE n hy) + (half_pos hε) (fun y hy => smoothen_zero hzero hn₁ hy) z hn₂ + exact tendsto_nhds_unique hz (tendsto_const_nhds.congr' (hs.mono (fun _ he => he.symm))) + + +lemma WeakEquation.mono {U V : Set ℂ} {μ : ℝ} {u : ℂ → ℂ} + (h : WeakEquation U μ u) (hVU : V ⊆ U) : WeakEquation V μ u := + fun φ hφ hc hs => h φ hφ hc (hs.trans hVU) + + + + +theorem weak_uniqueContinuation {u : ℂ → ℂ} {U : Set ℂ} {μ : ℝ} + (hU : IsOpen U) (hconn : IsPreconnected U) + (hu : LocallyIntegrable u volume) (hPDE : WeakEquation U μ u) + (hzero : ∃ a ∈ U, ∃ ε > 0, ∀ᵐ z ∂volume, z ∈ ball a ε → u z = 0) : + ∀ᵐ z ∂volume, z ∈ U → u z = 0 := by + let S : Set ℂ := {a | ∃ ε > 0, ∀ᵐ z ∂volume, z ∈ ball a ε → u z = 0} + have hopen : IsOpen S := by + apply Metric.isOpen_iff.mpr + intro a ha + obtain ⟨ε,hε,hza⟩ := ha + refine ⟨ε/2,half_pos hε,?_⟩ + intro b hb + refine ⟨ε/2,half_pos hε,?_⟩ + filter_upwards [hza] with z hz + intro hzb + apply hz + rw [mem_ball] at hb hzb ⊢ + have ht := dist_triangle z b a + linarith + have hne : (U ∩ S).Nonempty := hzero + have hcl : closure S ∩ U ⊆ S := by + intro x hx + obtain ⟨R,hR,hball⟩ := Metric.mem_nhds_iff.mp (hU.mem_nhds hx.2) + obtain ⟨a,ha,hxa⟩ := Metric.mem_closure_iff.mp hx.1 (R/4) (by positivity) + have hax : dist a x < R/4 := by simpa [dist_comm] using hxa + obtain ⟨ε,hε,hza⟩ := ha + have hbig : ball a (R/2) ⊆ U := by + intro z hz + apply hball + rw [mem_ball] at hz ⊢ + have ht := dist_triangle z a x + linarith + have hzbig := weak_zero_on_ball hu (hPDE.mono hbig) hε hza + refine ⟨R/4,by positivity,?_⟩ + filter_upwards [hzbig] with z hz + intro hzx + apply hz + rw [mem_ball] at hzx ⊢ + have ht := dist_triangle z x a + linarith + have hsub := hconn.subset_of_closure_inter_subset hopen hne hcl + choose ε hε he using fun x : U => hsub x.2 + obtain ⟨T,hT,hcover⟩ := (IsLindelof.of_coe (s := U)).elim_nhds_subcover' + (fun x hx => ball x (ε ⟨x,hx⟩)) (fun x hx => ball_mem_nhds x (hε ⟨x,hx⟩)) + have ha : ∀ᵐ z ∂volume, ∀ x ∈ T, z ∈ ball (x:ℂ) (ε x) → u z = 0 := + (eventually_countable_ball hT).mpr (fun x _ => he x) + filter_upwards [ha] with z hz + intro hzU + obtain ⟨x,hx,hy⟩ := mem_iUnion₂.mp (hcover hzU) + exact hz x hx hy + +end StrictHotSpots.Helmholtz +end HelmholtzWeakCombinedLayer + +section GapWeakPDECombinedLayer +open scoped Laplacian ContDiff InnerProductSpace +open Set MeasureTheory Filter +namespace StrictHotSpots +open Laplacian + +abbrev planeBasis := EuclideanSpace.basisFun (Fin 2) ℝ + +def directionalDerivative (f : Plane → ℝ) (e : Plane) : Plane → ℝ := + fun x => (fderiv ℝ f x) e + +lemma directionalDerivative_contDiffOn {Ω : Set Plane} {f : Plane → ℝ} + (hΩ : IsOpen Ω) (hf : ContDiffOn ℝ ∞ f Ω) (e : Plane) : + ContDiffOn ℝ ∞ (directionalDerivative f e) Ω := + (hf.fderiv_of_isOpen hΩ (by simp)).clm_apply contDiffOn_const + +lemma laplacian_eq_sum_directional {Ω : Set Plane} {f : Plane → ℝ} + (hΩ : IsOpen Ω) (hf : ContDiffOn ℝ ∞ f Ω) {x : Plane} (hx : x ∈ Ω) : + (Δ f) x = ∑ i : Fin 2, directionalDerivative (directionalDerivative f (planeBasis i)) + (planeBasis i) x := by + rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_orthonormalBasis f planeBasis] + apply Finset.sum_congr rfl + intro i _ + have hd : DifferentiableAt ℝ (fderiv ℝ f) x := + ((hf.fderiv_of_isOpen hΩ (by simp : (∞ : ℕ∞ω) + 1 ≤ ∞) x hx).contDiffAt + (hΩ.mem_nhds hx)).differentiableAt (by simp) + simp only [iteratedFDeriv_two_apply] + change ((fderiv ℝ (fderiv ℝ f) x) (planeBasis i)) (planeBasis i) = + (fderiv ℝ (fun y => (fderiv ℝ f y) (planeBasis i)) x) (planeBasis i) + rw [fderiv_clm_apply hd (differentiableAt_const _)] + simp + + +end StrictHotSpots + +section + + +open Set MeasureTheory InnerProductSpace +open scoped ContDiff Laplacian +namespace StrictHotSpots + + +def PlaneWeakEquation (Ω : Set Plane) (μ : ℝ) (u : Plane → ℝ) : Prop := + ∀ φ : Plane → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ Ω → + (∫ x in Ω, u x * Δ φ x) = -μ * (∫ x in Ω, u x * φ x) + +lemma weak_laplacian_test {Ω : Set Plane} {u : Plane → ℝ} {g : Plane → Plane} + (hu : HasH1Gradient Ω u g) {φ : Plane → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) (hs : tsupport φ ⊆ Ω) : + (∫ x in Ω, u x * Δ φ x) = -(∫ x in Ω, inner ℝ (g x) (gradient φ x)) := by + have hd (i : Fin 2) : ContDiff ℝ ∞ (directionalDerivative φ (planeBasis i)) := + hφ.fderiv_right (by simp) |>.clm_apply contDiff_const + have hdc (i : Fin 2) : HasCompactSupport (directionalDerivative φ (planeBasis i)) := + hc.fderiv_apply ℝ (planeBasis i) + have hds (i : Fin 2) : tsupport (directionalDerivative φ (planeBasis i)) ⊆ Ω := + (tsupport_fderiv_apply_subset ℝ (planeBasis i)).trans hs + have hi (i : Fin 2) : Integrable (fun x => u x * directionalDerivative + (directionalDerivative φ (planeBasis i)) (planeBasis i) x) (volume.restrict Ω) := + hu.1.integrable_mul (test_derivative_memLp (hd i) (hdc i) (planeBasis i)) + have hj (i : Fin 2) : Integrable (fun x => inner ℝ (g x) (planeBasis i) * + directionalDerivative φ (planeBasis i) x) (volume.restrict Ω) := + (hu.2.1.inner_const (planeBasis i)).integrable_mul (test_derivative_memLp hφ hc (planeBasis i)) + have hp (x : Plane) : inner ℝ (g x) (gradient φ x) = + ∑ i : Fin 2, inner ℝ (g x) (planeBasis i) * directionalDerivative φ (planeBasis i) x := by + rw [← planeBasis.sum_inner_mul_inner] + simp only [directionalDerivative, inner_gradient_right,conj_trivial] + simp_rw [laplacian_eq_sum_directional isOpen_univ hφ.contDiffOn (mem_univ _), + Finset.mul_sum] + rw [integral_finsetSum _ (fun i _ => hi i)] + simp_rw [show ∀ i : Fin 2, (∫ x in Ω, u x * directionalDerivative + (directionalDerivative φ (planeBasis i)) (planeBasis i) x) = + -(∫ x in Ω, inner ℝ (g x) (planeBasis i) * directionalDerivative φ (planeBasis i) x) + from fun i => hu.2.2 _ (hd i) (hdc i) (hds i) (planeBasis i)] + rw [Finset.sum_neg_distrib, ← integral_finsetSum _ (fun i _ => hj i)] + simp_rw [← hp] + +lemma planeWeakEquation_of_euler {Ω : Set Plane} {μ : ℝ} {u : Plane → ℝ} {g : Plane → Plane} + (hΩ : IsOpen Ω) (hu : HasH1Gradient Ω u g) + (he : ∀ v k, HasH1Gradient Ω v k → + (∫ x in Ω, inner ℝ (g x) (k x)) = μ * (∫ x in Ω, u x * v x)) : + PlaneWeakEquation Ω μ u := by + intro φ hφ hc hs + rw [weak_laplacian_test hu hφ hc hs, he _ _ (HasH1Gradient.test hΩ hφ hc), neg_mul] + +lemma InFirstNeumannEigenspace.planeWeakEquation {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : IsOpen Ω) (hu : InFirstNeumannEigenspace Ω u) : + PlaneWeakEquation Ω (firstPositiveNeumannValue Ω) u := + planeWeakEquation_of_euler hΩ hu.2.1 hu.2.2.2 + +end StrictHotSpots +end + +section + + +open Set MeasureTheory Filter Metric +open scoped ContDiff Laplacian Topology +namespace StrictHotSpots + +private def coord : ℂ ≃ₗᵢ[ℝ] Plane := Complex.orthonormalBasisOneI.repr + +private def complexExtension (Ω : Set Plane) (u : Plane → ℝ) (z : ℂ) : ℂ := + Complex.ofReal (Ω.indicator u (coord z)) + +private lemma complexExtension_integral (Ω : Set Plane) (hΩ : MeasurableSet Ω) + (u : Plane → ℝ) (ψ : ℂ → ℝ) : + (∫ z, ψ z • complexExtension Ω u z) = + Complex.ofReal (∫ x in Ω, u x * ψ (coord.symm x)) := by + have he : (fun z => ψ z • complexExtension Ω u z) = + (fun z => ((Ω.indicator (fun x => u x * ψ (coord.symm x))) (coord z) : ℂ)) := by + funext z + by_cases hz : coord z ∈ Ω + · simp [complexExtension,indicator_of_mem hz,Complex.real_smul,mul_comm] + · simp [complexExtension,indicator_of_notMem hz] + rw [he,integral_complex_ofReal, + coord.measurePreserving.integral_comp coord.toHomeomorph.measurableEmbedding, + integral_indicator hΩ] + +private lemma complexExtension_integrable {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : MeasurableSet Ω) (hu : IntegrableOn u Ω) : + Integrable (complexExtension Ω u) volume := by + have hi := (integrable_indicator_iff hΩ).mpr hu + have hj := coord.measurePreserving.integrable_comp_of_integrable hi + exact Complex.ofRealCLM.integrable_comp hj + +private lemma complexExtension_weak {Ω : Set Plane} {μ : ℝ} {u : Plane → ℝ} + (hΩ : MeasurableSet Ω) (hp : PlaneWeakEquation Ω μ u) : + Helmholtz.WeakEquation (coord ⁻¹' Ω) μ (complexExtension Ω u) := by + intro φ hφ hc hs + have ht : ContDiff ℝ ∞ (φ ∘ coord.symm) := + hφ.comp coord.symm.toContinuousLinearEquiv.contDiff + have htc : HasCompactSupport (φ ∘ coord.symm) := hc.comp_homeomorph coord.symm.toHomeomorph + have hts : tsupport (φ ∘ coord.symm) ⊆ Ω := by + change tsupport (φ ∘ coord.symm.toHomeomorph) ⊆ Ω + rw [tsupport_comp_eq_preimage φ coord.symm.toHomeomorph] + intro x hx + have h : coord (coord.symm x) ∈ Ω := hs hx + simpa only [coord.apply_symm_apply] using h + have h := hp _ ht htc hts + simp only [laplacian_comp_linearIsometryEquiv,Function.comp_apply] at h + rw [complexExtension_integral Ω hΩ u (Δ φ),complexExtension_integral Ω hΩ u φ,h] + simp + + + +theorem planeWeak_uniqueContinuation {Ω : Set Plane} {μ : ℝ} {u : Plane → ℝ} + (hΩ : IsOpen Ω) (hc : IsPreconnected Ω) (hu : IntegrableOn u Ω) + (hp : PlaneWeakEquation Ω μ u) + (hz : ∃ a ∈ Ω, ∃ ε > 0, ∀ᵐ x ∂volume, x ∈ ball a ε → u x = 0) : + ∀ᵐ x ∂volume, x ∈ Ω → u x = 0 := by + have hconn : IsPreconnected (coord ⁻¹' Ω) := + coord.toHomeomorph.isPreconnected_preimage.mpr hc + have hz' : ∃ a ∈ coord ⁻¹' Ω, ∃ ε > 0, + ∀ᵐ z ∂volume, z ∈ ball a ε → complexExtension Ω u z = 0 := by + obtain ⟨a,ha,ε,hε,hz⟩ := hz + refine ⟨coord.symm a,by simpa,ε,hε,?_⟩ + filter_upwards [coord.measurePreserving.quasiMeasurePreserving.ae hz] with z hz + intro hzb + have hd : coord z ∈ ball a ε := by + simpa only [mem_ball,← coord.dist_map z (coord.symm a),coord.apply_symm_apply] using hzb + by_cases hzm : coord z ∈ Ω + · simp only [complexExtension,indicator_of_mem hzm,hz hd,Complex.ofReal_zero] + · simp only [complexExtension,indicator_of_notMem hzm,Complex.ofReal_zero] + have hh := Helmholtz.weak_uniqueContinuation + (hΩ.preimage coord.continuous) hconn + (complexExtension_integrable hΩ.measurableSet hu).locallyIntegrable + (complexExtension_weak hΩ.measurableSet hp) hz' + filter_upwards [coord.symm.measurePreserving.quasiMeasurePreserving.ae hh] with x hx + intro hxm + have hm : coord.symm x ∈ coord ⁻¹' Ω := by simpa using hxm + have he := hx hm + simpa only [complexExtension,coord.apply_symm_apply,indicator_of_mem hxm,Complex.ofReal_eq_zero] using he + +end StrictHotSpots +end +end GapWeakPDECombinedLayer + + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Hodge.lean b/lean/OAI/Analysis/HotSpots/Hodge.lean new file mode 100644 index 0000000000000000000000000000000000000000..f1998276b3c07594df91b982a8173be697ea4583 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Hodge.lean @@ -0,0 +1,637 @@ +import OAI.Analysis.HotSpots.Potentials + +namespace OAI + +section ActualVectorSupport +noncomputable section +section ActualNeumannHilbertLayer +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal +namespace StrictHotSpots +namespace H1 +variable {Ω : Set Plane} + +lemma norm_value_sq (u : H1 Ω) : + ‖value u‖ ^ 2 = ∫ x in Ω, (value u x) ^ 2 := by + rw [← real_inner_self_eq_norm_sq, L2.inner_def] + simp only [RCLike.inner_apply, conj_trivial, pow_two] + +lemma norm_grad_sq (u : H1 Ω) : + ‖grad u‖ ^ 2 = ∫ x in Ω, ‖grad u x‖ ^ 2 := by + rw [← real_inner_self_eq_norm_sq, L2.inner_def] + simp only [real_inner_self_eq_norm_sq] + + +lemma rayleigh (u : H1 Ω) (hm : (∫ x in Ω, value u x) = 0) : + firstPositiveNeumannValue Ω * ‖value u‖ ^ 2 ≤ ‖grad u‖ ^ 2 := by + by_cases hz : ‖value u‖ = 0 + · simp only [hz, zero_pow (by decide : 2 ≠ 0), mul_zero] + exact sq_nonneg _ + · have hp : 0 < ‖value u‖ ^ 2 := sq_pos_of_ne_zero hz + rw [norm_value_sq] at hp + simpa only [norm_value_sq, norm_grad_sq] using + rayleigh_inequality (hasH1Gradient u) hm hp + + +def one (hb : Bornology.IsBounded Ω) : Lp ℝ 2 (volume.restrict Ω) := by + letI : IsFiniteMeasure (volume.restrict Ω) := ⟨by + simpa using hb.measure_lt_top (μ := (volume : Measure Plane))⟩ + exact (memLp_const (1 : ℝ)).toLp (fun _ : Plane => (1 : ℝ)) + +lemma one_ae (hb : Bornology.IsBounded Ω) : + one hb =ᵐ[volume.restrict Ω] fun _ : Plane => (1 : ℝ) := + MemLp.coeFn_toLp _ + +lemma mean_apply (hb : Bornology.IsBounded Ω) (u : H1 Ω) : + mean hb u = ∫ x in Ω, value u x := mean_eq hb u + +end H1 + + +def meanZeroSubmodule {Ω : Set Plane} (hb : Bornology.IsBounded Ω) : Submodule ℝ (H1 Ω) := + (H1.mean hb).ker + +abbrev N1 {Ω : Set Plane} (hb : Bornology.IsBounded Ω) := meanZeroSubmodule hb + +instance N1.normedAddCommGroup {Ω : Set Plane} (hb : Bornology.IsBounded Ω) : + NormedAddCommGroup (N1 hb) := (meanZeroSubmodule hb).normedAddCommGroup + +instance N1.innerProductSpace {Ω : Set Plane} (hb : Bornology.IsBounded Ω) : + InnerProductSpace ℝ (N1 hb) := (meanZeroSubmodule hb).innerProductSpace + +instance N1.completeSpace {Ω : Set Plane} (hb : Bornology.IsBounded Ω) : + CompleteSpace (N1 hb) := (H1.mean hb).isClosed_ker.completeSpace_coe + +namespace N1 +variable {Ω : Set Plane} (hb : Bornology.IsBounded Ω) + +local instance : NormedSpace ℝ (N1 hb) := (N1.innerProductSpace hb).toNormedSpace + +def value : N1 hb →L[ℝ] Lp ℝ 2 (volume.restrict Ω) := + H1.value.comp (meanZeroSubmodule hb).subtypeL + +def grad : N1 hb →L[ℝ] Lp Plane 2 (volume.restrict Ω) := + H1.grad.comp (meanZeroSubmodule hb).subtypeL + +lemma norm_sq (u : N1 hb) : ‖u‖ ^ 2 = ‖value hb u‖ ^ 2 + ‖grad hb u‖ ^ 2 := + H1.norm_sq u.val + +lemma mean_zero (u : N1 hb) : (∫ x in Ω, value hb u x) = 0 := by + have hu : H1.mean hb u.val = 0 := u.property + change (∫ x in Ω, H1.value u.val x) = 0 + simpa only [H1.mean_apply] using hu + +lemma rayleigh (u : N1 hb) : + firstPositiveNeumannValue Ω * ‖value hb u‖ ^ 2 ≤ ‖grad hb u‖ ^ 2 := + H1.rayleigh u.val (mean_zero hb u) + +def energy : N1 hb →L[ℝ] N1 hb →L[ℝ] ℝ := by + let a : Lp Plane 2 (volume.restrict Ω) →L[ℝ] + Lp Plane 2 (volume.restrict Ω) →L[ℝ] ℝ := innerSL ℝ + let b : N1 hb →L[ℝ] Lp Plane 2 (volume.restrict Ω) →L[ℝ] ℝ := a.comp (grad hb) + let c : Lp Plane 2 (volume.restrict Ω) →L[ℝ] N1 hb →L[ℝ] ℝ := + ContinuousLinearMap.flip (E := N1 hb) (F := Lp Plane 2 (volume.restrict Ω)) b + let d : N1 hb →L[ℝ] N1 hb →L[ℝ] ℝ := c.comp (grad hb) + exact ContinuousLinearMap.flip (E := N1 hb) (F := N1 hb) d + +@[simp] lemma energy_apply (u v : N1 hb) : + energy hb u v = inner ℝ (grad hb u) (grad hb v) := rfl + +lemma energy_coercive (hμ : 0 < firstPositiveNeumannValue Ω) : + @IsCoercive (N1 hb) (N1.normedAddCommGroup hb).toSeminormedAddCommGroup + (N1.innerProductSpace hb).toNormedSpace (energy hb) := by + let μ := firstPositiveNeumannValue Ω + have hden : 0 < μ + 1 := by dsimp [μ]; positivity + refine ⟨μ / (μ + 1), div_pos hμ hden, fun u => ?_⟩ + have hR := rayleigh hb u + have hbound : μ * ‖u‖ ^ 2 ≤ (μ + 1) * ‖grad hb u‖ ^ 2 := by + rw [norm_sq hb] + nlinarith + calc + (μ / (μ + 1)) * ‖u‖ * ‖u‖ = (μ * ‖u‖ ^ 2) / (μ + 1) := by ring + _ ≤ ‖grad hb u‖ ^ 2 := (div_le_iff₀ hden).mpr (by simpa [mul_comm] using hbound) + _ = energy hb u u := (real_inner_self_eq_norm_sq _).symm + + + + +lemma existsUnique_energy_solution (hμ : 0 < firstPositiveNeumannValue Ω) + (ℓ : N1 hb →L[ℝ] ℝ) : + ∃! u : N1 hb, ∀ v : N1 hb, energy hb u v = ℓ v := by + exact @existsUnique_of_coercive (N1 hb) (N1.normedAddCommGroup hb) + (N1.innerProductSpace hb) (N1.completeSpace hb) + (energy hb) (energy_coercive hb hμ) ℓ + +end N1 +end StrictHotSpots + +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace +namespace StrictHotSpots +end StrictHotSpots +end ActualNeumannHilbertLayer + +section HodgeOrthogonalityInteriorSupportLayer + +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace +namespace StrictHotSpots +namespace Hodge + +lemma weakCurl_gradient {Ω : Set Plane} {v : Plane → ℝ} {g : Plane → Plane} + (hv : HasH1Gradient Ω v g) : WeakCurlZero Ω g := by + intro φ hφ hk hs + have h0 := hv.2.2 (D 0 φ) (D_smooth hφ 0) (D_compact hk 0) ((D_support φ 0).trans hs) (e 1) + have h1 := hv.2.2 (D 1 φ) (D_smooth hφ 1) (D_compact hk 1) ((D_support φ 1).trans hs) (e 0) + change (∫ x in Ω, v x * D 1 (D 0 φ) x) = -(∫ x in Ω, c 1 (g x)*D 0 φ x) at h0 + change (∫ x in Ω, v x * D 0 (D 1 φ) x) = -(∫ x in Ω, c 0 (g x)*D 1 φ x) at h1 + simp_rw [D_D hφ 1 0] at h0 + have hi := (hv.2.1.inner_const (e 1)).integrable_mul (test_derivative_memLp hφ hk (e 0)) + have hj := (hv.2.1.inner_const (e 0)).integrable_mul (test_derivative_memLp hφ hk (e 1)) + change IntegrableOn (fun x => c 1 (g x)*D 0 φ x) Ω at hi + change IntegrableOn (fun x => c 0 (g x)*D 1 φ x) Ω at hj + simp_rw [inner_rot_gradient] + rw [integral_sub hi hj] + linarith + +abbrev V2 (Ω : Set Plane) : Type := Lp Plane 2 (volume.restrict Ω) +def rotL (Ω : Set Plane) : V2 Ω →L[ℝ] V2 Ω := rot.compLpL 2 (volume.restrict Ω) +lemma rotL_ae {Ω : Set Plane} (u : V2 Ω) : rotL Ω u =ᵐ[volume.restrict Ω] fun x => rot (u x) := + rot.coeFn_compLpL u +lemma rotL_inner {Ω : Set Plane} (u v : V2 Ω) : inner ℝ (rotL Ω u) (rotL Ω v) = inner ℝ u v := by + rw [L2.inner_def,L2.inner_def] + apply integral_congr_ae + filter_upwards [rotL_ae u,rotL_ae v] with x hx hy + rw [hx,hy,rot_inner] +lemma rotL_norm {Ω : Set Plane} (u : V2 Ω) : ‖rotL Ω u‖ = ‖u‖ := by + have hh := rotL_inner u u + simp only [real_inner_self_eq_norm_sq] at hh + nlinarith [norm_nonneg (rotL Ω u),norm_nonneg u] + +lemma weakCurl_iff {Ω : Set Plane} (ho : IsOpen Ω) (Z : V2 Ω) : + WeakCurlZero Ω Z ↔ ∀ j : H10 ho, inner ℝ Z (rotL Ω (H10.grad ho j)) = 0 := by + constructor + · intro hz j + apply isClosed_property (dense_smoothTestToH10 ho) + (isClosed_eq (continuous_const.inner ((rotL Ω).continuous.comp (H10.grad ho).continuous)) continuous_const) _ j + intro f + rw [L2.inner_def] + have he : H10.grad ho (smoothTestToH10 ho f) =ᵐ[volume.restrict Ω] gradient f.val := + (test_gradient_memLp f.property.1 f.property.2.1).coeFn_toLp + calc + _ = ∫ x in Ω, inner ℝ (Z x) (rot (gradient f.val x)) := by + apply integral_congr_ae + filter_upwards [rotL_ae (H10.grad ho (smoothTestToH10 ho f)),he] with x hx hy + change inner ℝ (Z x) ((rotL Ω (H10.grad ho (smoothTestToH10 ho f))) x) = _ + rw [hx,hy] + _ = 0 := hz f.val f.property.1 f.property.2.1 f.property.2.2 + · intro hz φ hφ hk hs + let f : smoothTestSpace Ω := ⟨φ,hφ,hk,hs⟩ + have h := hz (smoothTestToH10 ho f) + rw [L2.inner_def] at h + have he : H10.grad ho (smoothTestToH10 ho f) =ᵐ[volume.restrict Ω] gradient φ := + (test_gradient_memLp hφ hk).coeFn_toLp + convert h using 1 + apply integral_congr_ae + filter_upwards [rotL_ae (H10.grad ho (smoothTestToH10 ho f)),he] with x hx hy + rw [hx,hy] + +lemma grad_rotGrad_orthogonal {Ω : Set Plane} (ho : IsOpen Ω) (v : H1 Ω) (j : H10 ho) : + inner ℝ (H1.grad v) (rotL Ω (H10.grad ho j)) = 0 := + (weakCurl_iff ho (H1.grad v)).mp (weakCurl_gradient (H1.hasH1Gradient v)) j + +lemma exists_meanZero_same_grad {Ω : Set Plane} (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hb : Bornology.IsBounded Ω) (v : H1 Ω) : + ∃ u : N1 hb, N1.grad hb u = H1.grad v := by + let C : H1 Ω := (HasH1Gradient.const hb 1).toH1 + have hcG : H1.grad C = 0 := by + apply Lp.ext + exact ((HasH1Gradient.const hb 1).2.1.coeFn_toLp).trans (Lp.coeFn_zero _ _ _).symm + have hcM : H1.mean hb C = (volume Ω).toReal := by + rw [H1.mean_apply] + calc + _ = ∫ x in Ω, (1 : ℝ) := integral_congr_ae (HasH1Gradient.const hb 1).1.coeFn_toLp + _ = _ := by simp [Measure.real] + have hv : (volume Ω).toReal ≠ 0 := + (ENNReal.toReal_pos (ho.measure_pos volume hne).ne' hb.measure_lt_top.ne).ne' + let u : H1 Ω := v - (H1.mean hb v/(volume Ω).toReal) • C + have hm : H1.mean hb u = 0 := by + simp only [u,map_sub,map_smul,smul_eq_mul,hcM] + field_simp + ring + refine ⟨⟨u,hm⟩,?_⟩ + change H1.grad u = _ + simp only [u,map_sub,map_smul,hcG,smul_zero,sub_zero] + +end Hodge +end StrictHotSpots + +end HodgeOrthogonalityInteriorSupportLayer + + +section HodgeProjectionInteriorSupportLayer + +open Set MeasureTheory +open scoped ContDiff InnerProductSpace +namespace StrictHotSpots.Hodge +local instance {Ω : Set Plane} (hb : Bornology.IsBounded Ω) : NormedSpace ℝ (N1 hb) := + (N1.innerProductSpace hb).toNormedSpace +local instance {Ω : Set Plane} (ho : IsOpen Ω) : NormedSpace ℝ (H10 ho) := + (H10.innerProductSpace ho).toNormedSpace + +def nFunctional {Ω : Set Plane} (hb : Bornology.IsBounded Ω) (X : Lp Plane 2 (volume.restrict Ω)) : + N1 hb →L[ℝ] ℝ := (innerSL ℝ X).comp (N1.grad hb) +lemma nFunctional_apply {Ω : Set Plane} (hb : Bornology.IsBounded Ω) + (X : Lp Plane 2 (volume.restrict Ω)) (v : N1 hb) : + nFunctional hb X v = inner ℝ X (N1.grad hb v) := rfl +lemma nProjection {Ω : Set Plane} (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) (X : Lp Plane 2 (volume.restrict Ω)) : + ∃ v : N1 hb, ∀ w : N1 hb, inner ℝ (N1.grad hb v) (N1.grad hb w) = + inner ℝ X (N1.grad hb w) := + ExistsUnique.exists (N1.existsUnique_energy_solution hb hμ (nFunctional hb X)) + +lemma nProjection_extend {Ω : Set Plane} (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hb : Bornology.IsBounded Ω) (X : Lp Plane 2 (volume.restrict Ω)) (v : N1 hb) + (hv : ∀ w : N1 hb, inner ℝ (N1.grad hb v) (N1.grad hb w) = inner ℝ X (N1.grad hb w)) + (u : H1 Ω) : inner ℝ (N1.grad hb v) (H1.grad u) = inner ℝ X (H1.grad u) := by + obtain ⟨w,hw⟩ := exists_meanZero_same_grad (Ω := Ω) ho hne hb u + exact hw ▸ hv w + +lemma neumann_projection {Ω : Set Plane} (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hb : Bornology.IsBounded Ω) (hμ : 0 < firstPositiveNeumannValue Ω) (X : Lp Plane 2 (volume.restrict Ω)) : + ∃ v : N1 hb, ∀ u : H1 Ω, inner ℝ (N1.grad hb v) (H1.grad u) = inner ℝ X (H1.grad u) := + (nProjection (Ω := Ω) hb hμ X).imp fun v hv => nProjection_extend ho hne hb X v hv + +def jFunctional {Ω : Set Plane} (ho : IsOpen Ω) (X : Lp Plane 2 (volume.restrict Ω)) : + H10 ho →L[ℝ] ℝ := (innerSL ℝ X).comp ((rotL Ω).comp (H10.grad ho)) +lemma jProjection {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (X : Lp Plane 2 (volume.restrict Ω)) : + ∃ j : H10 ho, ∀ k : H10 ho, inner ℝ (H10.grad ho j) (H10.grad ho k) = + inner ℝ X (rotL Ω (H10.grad ho k)) := + ExistsUnique.exists (H10.existsUnique_energy_solution ho hb (jFunctional ho X)) + +lemma dirichlet_projection {Ω : Set Plane} (ho : IsOpen Ω) + (hb : Bornology.IsBounded Ω) (X : Lp Plane 2 (volume.restrict Ω)) : + ∃ j : H10 ho, ∀ k : H10 ho, + inner ℝ (rotL Ω (H10.grad ho j)) (rotL Ω (H10.grad ho k)) = + inner ℝ X (rotL Ω (H10.grad ho k)) := by + exact (jProjection (Ω := Ω) ho hb X).imp fun j hj k => + (rotL_inner (Ω := Ω) (H10.grad ho j) (H10.grad ho k)).trans (hj k) +end StrictHotSpots.Hodge + +end HodgeProjectionInteriorSupportLayer + + +section HodgeResidualInteriorSupportLayer + +open Set MeasureTheory +open scoped ContDiff InnerProductSpace +namespace StrictHotSpots.Hodge + +def residual {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (X : V2 Ω) (v : N1 hb) (j : H10 ho) : V2 Ω := + X - N1.grad hb v - rotL Ω (H10.grad ho j) + +private lemma inner_sub_sub_normal_zero {E : Type*} [NormedAddCommGroup E] + [InnerProductSpace ℝ E] (first second third test : E) + (hsecond : inner ℝ second test = inner ℝ first test) + (hthird : inner ℝ third test = 0) : + inner ℝ (first - second - third) test = 0 := by + rw [inner_sub_left, inner_sub_left, hsecond, hthird, sub_self, sub_zero] + +lemma residual_normal {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (X : V2 Ω) (v : N1 hb) (j : H10 ho) + (hn : ∀ u : H1 Ω, inner ℝ (N1.grad hb v) (H1.grad u) = inner ℝ X (H1.grad u)) + (u : H1 Ω) : inner ℝ (residual ho hb X v j) (H1.grad u) = 0 := by + have he : inner ℝ (rotL Ω (H10.grad ho j)) (H1.grad u) = 0 := + (real_inner_comm _ _).trans (grad_rotGrad_orthogonal ho u j) + exact inner_sub_sub_normal_zero X (N1.grad hb v) (rotL Ω (H10.grad ho j)) + (H1.grad u) (hn u) he + +lemma inner_sub_sub_zero {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (X A B Y : E) (he : inner ℝ A Y = 0) (hj : inner ℝ B Y = inner ℝ X Y) : + inner ℝ (X-A-B) Y = 0 := by + rw [inner_sub_left,inner_sub_left,he,hj,sub_zero,sub_self] + +lemma residual_curl {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (X : V2 Ω) (v : N1 hb) (j : H10 ho) + (hj : ∀ k : H10 ho, inner ℝ (rotL Ω (H10.grad ho j)) (rotL Ω (H10.grad ho k)) = + inner ℝ X (rotL Ω (H10.grad ho k))) (k : H10 ho) : + inner ℝ (residual ho hb X v j) (rotL Ω (H10.grad ho k)) = 0 := + inner_sub_sub_zero X (N1.grad hb v) (rotL Ω (H10.grad ho j)) (rotL Ω (H10.grad ho k)) + (grad_rotGrad_orthogonal ho v.val k) (hj k) + +lemma orthogonal_all_zero {Ω : Set Plane} (ho : IsOpen Ω) (hs : IsSimplyConnected Ω) + (hb : Bornology.IsBounded Ω) (hμ : 0 < firstPositiveNeumannValue Ω) (Z : V2 Ω) + (hzN : ∀ u : H1 Ω, inner ℝ Z (H1.grad u) = 0) + (hzJ : ∀ k : H10 ho, inner ℝ Z (rotL Ω (H10.grad ho k)) = 0) : Z = 0 := by + apply Lp.ext + refine (weak_divCurl_zero ho hs hb hμ (Lp.memLp Z) ((weakCurl_iff ho Z).mpr hzJ) ?_).trans + (Lp.coeFn_zero _ _ _).symm + intro u g hh + have h := hzN hh.toH1 + rw [L2.inner_def] at h + convert h using 1 + apply integral_congr_ae + filter_upwards [hh.2.1.coeFn_toLp] with x hx + change inner ℝ (Z x) (g x) = inner ℝ (Z x) (hh.2.1.toLp g x) + rw [hx] + +lemma sub_sub_zero_iff {E : Type*} [AddCommGroup E] (X A B : E) : + X-A-B=0 ↔ X=A+B := by rw [sub_sub,sub_eq_zero] + +lemma residual_zero_iff {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (X : V2 Ω) (v : N1 hb) (j : H10 ho) : + residual ho hb X v j = 0 ↔ X = N1.grad hb v + rotL Ω (H10.grad ho j) := + sub_sub_zero_iff X (N1.grad hb v) (rotL Ω (H10.grad ho j)) + +lemma norm_add_orthogonal {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (a b : E) (h : inner ℝ a b = 0) : ‖a+b‖^2 = ‖a‖^2 + ‖b‖^2 := by + rw [norm_add_sq_real,h] + ring + +lemma decomposition_norm {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (v : N1 hb) (j : H10 ho) : + ‖N1.grad hb v + rotL Ω (H10.grad ho j)‖^2 = + ‖N1.grad hb v‖^2 + ‖H10.grad ho j‖^2 := by + exact (norm_add_orthogonal _ _ (grad_rotGrad_orthogonal ho v.val j)).trans + (congrArg (fun r : ℝ => ‖N1.grad hb v‖^2 + r^2) (rotL_norm (H10.grad ho j))) +end StrictHotSpots.Hodge + +end HodgeResidualInteriorSupportLayer + + +section HodgeDecompositionInteriorSupportLayer + +open Set MeasureTheory +open scoped ContDiff InnerProductSpace +namespace StrictHotSpots.Hodge + +lemma projection_eq {Ω : Set Plane} (ho : IsOpen Ω) (hs : IsSimplyConnected Ω) + (hb : Bornology.IsBounded Ω) (hμ : 0 < firstPositiveNeumannValue Ω) + (X : V2 Ω) (v : N1 hb) (j : H10 ho) + (hn : ∀ u : H1 Ω, inner ℝ (N1.grad hb v) (H1.grad u) = inner ℝ X (H1.grad u)) + (hj : ∀ k : H10 ho, inner ℝ (rotL Ω (H10.grad ho j)) (rotL Ω (H10.grad ho k)) = + inner ℝ X (rotL Ω (H10.grad ho k))) : + X = N1.grad hb v + rotL Ω (H10.grad ho j) := + (residual_zero_iff ho hb X v j).mp (orthogonal_all_zero ho hs hb hμ (residual ho hb X v j) + (residual_normal ho hb X v j hn) (residual_curl ho hb X v j hj)) + +lemma projection_eq_exists {Ω : Set Plane} (ho : IsOpen Ω) (hs : IsSimplyConnected Ω) + (hb : Bornology.IsBounded Ω) (hμ : 0 < firstPositiveNeumannValue Ω) + (X : V2 Ω) (v : N1 hb) + (hn : ∀ u : H1 Ω, inner ℝ (N1.grad hb v) (H1.grad u) = inner ℝ X (H1.grad u)) : + ∃ j : H10 ho, X = N1.grad hb v + rotL Ω (H10.grad ho j) := + (dirichlet_projection ho hb X).imp fun j hj => projection_eq ho hs hb hμ X v j hn hj + + + +theorem decomposition {Ω : Set Plane} (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hs : IsSimplyConnected Ω) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) (X : V2 Ω) : + ∃ (v : N1 hb) (j : H10 ho), X = N1.grad hb v + rotL Ω (H10.grad ho j) := + (neumann_projection ho hne hb hμ X).imp fun v hn => projection_eq_exists ho hs hb hμ X v hn +end StrictHotSpots.Hodge + +end HodgeDecompositionInteriorSupportLayer + + +section HodgeVectorEnergyInteriorSupportLayer + +open Set MeasureTheory +open scoped ContDiff InnerProductSpace +namespace StrictHotSpots.Hodge + +lemma scalar_energy_bound {a b c θ : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) + (ht : 0 ≤ θ) (hr : θ*b^2 ≤ a^2) (he : a^2 ≤ b*c) : θ*a^2 ≤ c^2 := by + by_cases h : b = 0 + · subst b + have hz : a = 0 := by nlinarith + simp [hz,sq_nonneg] + · have hp : 0 < b := lt_of_le_of_ne hb (Ne.symm h) + have htc : θ*b ≤ c := (mul_le_mul_iff_of_pos_right hp).mp (by nlinarith) + calc + θ*a^2 ≤ θ*(b*c) := mul_le_mul_of_nonneg_left he ht + _ = (θ*b)*c := by ring + _ ≤ c*c := mul_le_mul_of_nonneg_right htc hc + _ = c^2 := by ring + +lemma scalar_rayleigh_eq {a b c θ : ℝ} (ha : 0 ≤ a) (_hb : 0 ≤ b) (_hc : 0 ≤ c) + (ht : 0 < θ) (hr : θ*b^2 ≤ a^2) (he : a^2 ≤ b*c) (heq : θ*a^2 = c^2) : + θ*b^2 = a^2 := by + by_cases hz : a = 0 + · subst a + nlinarith + · have hp : 0 < a^2 := sq_pos_of_ne_zero hz + have hh : (a^2)^2 ≤ (b*c)^2 := by nlinarith [mul_nonneg _hb _hc] + have hh' : (a^2)*a^2 ≤ (θ*b^2)*a^2 := by nlinarith [sq_nonneg (b*c-a^2)] + exact le_antisymm hr ((mul_le_mul_iff_of_pos_right hp).mp hh') + + + +def WeakNormalDiv {Ω : Set Plane} (X : Lp Plane 2 (volume.restrict Ω)) (F : Lp ℝ 2 (volume.restrict Ω)) : Prop := + ∀ u : H1 Ω, inner ℝ X (H1.grad u) = -inner ℝ F (H1.value u) + +def WeakCurl {Ω : Set Plane} (ho : IsOpen Ω) (X : Lp Plane 2 (volume.restrict Ω)) + (G : Lp ℝ 2 (volume.restrict Ω)) : Prop := + ∀ j : H10 ho, inner ℝ X (rotL Ω (H10.grad ho j)) = -inner ℝ G (H10.value ho j) + +lemma pair_add_orthogonal_left {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (a b : E) (h : inner ℝ a b = 0) : inner ℝ (a+b) a = ‖a‖^2 := by + rw [inner_add_left,real_inner_comm a b,h,add_zero,real_inner_self_eq_norm_sq] + +lemma pair_add_orthogonal_right {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (a b : E) (h : inner ℝ a b = 0) : inner ℝ (a+b) b = ‖b‖^2 := by + rw [inner_add_left,h,zero_add,real_inner_self_eq_norm_sq] + +lemma neg_inner_bound {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (a b : E) : -inner ℝ a b ≤ ‖b‖*‖a‖ := by + simpa only [inner_neg_left,norm_neg,mul_comm] using real_inner_le_norm (-a) b + +lemma energy_pair_normal {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (v : N1 hb) (j : H10 ho) (F : Lp ℝ 2 (volume.restrict Ω)) + (hF : WeakNormalDiv (N1.grad hb v + rotL Ω (H10.grad ho j)) F) : + ‖N1.grad hb v‖^2 = -inner ℝ F (N1.value hb v) := + (pair_add_orthogonal_left _ _ (grad_rotGrad_orthogonal ho v.val j)).symm.trans (hF v.val) + +lemma energy_pair_curl {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (v : N1 hb) (j : H10 ho) (G : Lp ℝ 2 (volume.restrict Ω)) + (hG : WeakCurl ho (N1.grad hb v + rotL Ω (H10.grad ho j)) G) : + ‖H10.grad ho j‖^2 = -inner ℝ G (H10.value ho j) := + (congrArg (fun r : ℝ => r^2) (rotL_norm (H10.grad ho j))).symm.trans + ((pair_add_orthogonal_right _ _ (grad_rotGrad_orthogonal ho v.val j)).symm.trans (hG j)) + +lemma energy_bound_normal {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (v : N1 hb) (j : H10 ho) (F : Lp ℝ 2 (volume.restrict Ω)) + (hF : WeakNormalDiv (N1.grad hb v + rotL Ω (H10.grad ho j)) F) : + firstPositiveNeumannValue Ω * ‖N1.grad hb v‖^2 ≤ ‖F‖^2 := by + apply scalar_energy_bound (norm_nonneg _) (norm_nonneg _) (norm_nonneg _) + (firstPositiveNeumannValue_nonneg Ω) (N1.rayleigh hb v) + exact (energy_pair_normal ho hb v j F hF).trans_le (neg_inner_bound F (N1.value hb v)) + +lemma energy_bound_curl {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (v : N1 hb) (j : H10 ho) (G : Lp ℝ 2 (volume.restrict Ω)) {L : ℝ} (hl : 0 ≤ L) + (hD : L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + (hG : WeakCurl ho (N1.grad hb v + rotL Ω (H10.grad ho j)) G) : + L * ‖H10.grad ho j‖^2 ≤ ‖G‖^2 := by + apply scalar_energy_bound (norm_nonneg _) (norm_nonneg _) (norm_nonneg _) hl hD + exact (energy_pair_curl ho hb v j G hG).trans_le (neg_inner_bound G (H10.value ho j)) + +lemma energy_decomposition_of_eq {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + {L : ℝ} (hl : 0 ≤ L) (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + (X : V2 Ω) (F G : Lp ℝ 2 (volume.restrict Ω)) (v : N1 hb) (j : H10 ho) + (hX : X = N1.grad hb v + rotL Ω (H10.grad ho j)) + (hF : WeakNormalDiv X F) (hG : WeakCurl ho X G) : + X = N1.grad hb v + rotL Ω (H10.grad ho j) ∧ + firstPositiveNeumannValue Ω * ‖N1.grad hb v‖^2 ≤ ‖F‖^2 ∧ + L * ‖H10.grad ho j‖^2 ≤ ‖G‖^2 := + ⟨hX,energy_bound_normal ho hb v j F (by rwa [← hX]), + energy_bound_curl ho hb v j G hl (hD j) (by rwa [← hX])⟩ + + +theorem energy_decomposition {Ω : Set Plane} (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hs : IsSimplyConnected Ω) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) {L : ℝ} + (hl : firstPositiveNeumannValue Ω < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + (X : V2 Ω) (F G : Lp ℝ 2 (volume.restrict Ω)) + (hF : WeakNormalDiv X F) (hG : WeakCurl ho X G) : + ∃ (v : N1 hb) (j : H10 ho), + X = N1.grad hb v + rotL Ω (H10.grad ho j) ∧ + firstPositiveNeumannValue Ω * ‖N1.grad hb v‖^2 ≤ ‖F‖^2 ∧ + L * ‖H10.grad ho j‖^2 ≤ ‖G‖^2 := + (decomposition ho hne hs hb hμ X).imp fun v hv => hv.imp fun j hj => + energy_decomposition_of_eq ho hb (hμ.trans hl).le hD X F G v j hj hF hG + +theorem vector_inequality {Ω : Set Plane} (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hs : IsSimplyConnected Ω) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) {L : ℝ} + (hl : firstPositiveNeumannValue Ω < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + (X : Lp Plane 2 (volume.restrict Ω)) (F G : Lp ℝ 2 (volume.restrict Ω)) + (hF : WeakNormalDiv X F) (hG : WeakCurl ho X G) : + firstPositiveNeumannValue Ω * ‖X‖^2 ≤ ‖F‖^2 + ‖G‖^2 := by + obtain ⟨v,j,hX,hv,hj⟩ := energy_decomposition ho hne hs hb hμ hl hD X F G hF hG + rw [hX,decomposition_norm ho hb] + nlinarith [sq_nonneg ‖H10.grad ho j‖] + +end StrictHotSpots.Hodge + +end HodgeVectorEnergyInteriorSupportLayer + + +section HodgeEqualityInteriorSupportLayer + +open Set MeasureTheory +open scoped ContDiff InnerProductSpace +namespace StrictHotSpots.Hodge + +lemma scalar_surplus_eq {a b f g μ L : ℝ} (hl : μ < L) + (hv : μ*a^2 ≤ f^2) (hj : L*b^2 ≤ g^2) + (he : μ*(a^2+b^2) = f^2+g^2) : b=0 ∧ g=0 ∧ μ*a^2=f^2 := by + have hh : (L-μ)*b^2 ≤ 0 := by nlinarith + have hb : b^2 = 0 := le_antisymm + ((mul_le_mul_iff_of_pos_left (sub_pos.mpr hl)).mp (by simpa using hh)) (sq_nonneg _) + have hb' : b = 0 := sq_eq_zero_iff.mp hb + simp only [hb',zero_pow (by decide : 2 ≠ 0),add_zero] at he + have hg : g^2 = 0 := by linarith [sq_nonneg g] + exact ⟨hb',sq_eq_zero_iff.mp hg,by linarith⟩ + +lemma equality_norms {E F G : Type*} [NormedAddCommGroup E] + [NormedAddCommGroup F] [NormedAddCommGroup G] + (X A B : E) (f : F) (g : G) {μ L : ℝ} (hl : μ < L) + (hn : ‖X‖^2 = ‖A‖^2+‖B‖^2) (hv : μ*‖A‖^2 ≤ ‖f‖^2) + (hj : L*‖B‖^2 ≤ ‖g‖^2) (he : μ*‖X‖^2 = ‖f‖^2+‖g‖^2) : + B=0 ∧ g=0 ∧ μ*‖A‖^2 = ‖f‖^2 := by + obtain ⟨hB,hg,ha⟩ := scalar_surplus_eq hl hv hj (by rwa [hn] at he) + exact ⟨norm_eq_zero.mp hB,norm_eq_zero.mp hg,ha⟩ + +lemma add_map_zero {E F : Type*} [AddCommMonoid E] [AddCommMonoid F] + (T : E →+ F) {X A : F} {B : E} (hX : X=A+T B) (hB : B=0) : X=A := by + simpa only [hB,map_zero,add_zero] using hX + +lemma equality_minimizer {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) (v : N1 hb) (j : H10 ho) + (F : Lp ℝ 2 (volume.restrict Ω)) + (hF : WeakNormalDiv (N1.grad hb v + rotL Ω (H10.grad ho j)) F) + (he : firstPositiveNeumannValue Ω * ‖N1.grad hb v‖^2 = ‖F‖^2) : + firstPositiveNeumannValue Ω * ‖N1.value hb v‖^2 = ‖N1.grad hb v‖^2 := + scalar_rayleigh_eq (norm_nonneg _) (norm_nonneg _) (norm_nonneg _) hμ (N1.rayleigh hb v) + ((energy_pair_normal ho hb v j F hF).trans_le (neg_inner_bound F (N1.value hb v))) he + +lemma equality_of_decomposition {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) {L : ℝ} (hl : firstPositiveNeumannValue Ω < L) + (X : V2 Ω) (F G : Lp ℝ 2 (volume.restrict Ω)) (v : N1 hb) (j : H10 ho) + (hX : X = N1.grad hb v + rotL Ω (H10.grad ho j)) + (hv : firstPositiveNeumannValue Ω * ‖N1.grad hb v‖^2 ≤ ‖F‖^2) + (hj : L * ‖H10.grad ho j‖^2 ≤ ‖G‖^2) + (hF : WeakNormalDiv X F) + (he : firstPositiveNeumannValue Ω * ‖X‖^2 = ‖F‖^2+‖G‖^2) : + X = N1.grad hb v ∧ G = 0 ∧ + firstPositiveNeumannValue Ω * ‖N1.value hb v‖^2 = ‖N1.grad hb v‖^2 := by + have hn : ‖X‖^2 = ‖N1.grad hb v‖^2 + ‖H10.grad ho j‖^2 := + (congrArg (fun x : V2 Ω => ‖x‖^2) hX).trans (decomposition_norm ho hb v j) + exact (equality_norms X (N1.grad hb v) (H10.grad ho j) F G hl hn hv hj he).elim + fun hj0 hh => ⟨add_map_zero (rotL Ω).toAddMonoidHom hX hj0,hh.1, + equality_minimizer ho hb hμ v j F (hX ▸ hF) hh.2⟩ + + + + +theorem vector_equality {Ω : Set Plane} (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hs : IsSimplyConnected Ω) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) {L : ℝ} + (hl : firstPositiveNeumannValue Ω < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + (X : V2 Ω) (F G : Lp ℝ 2 (volume.restrict Ω)) + (hF : WeakNormalDiv X F) (hG : WeakCurl ho X G) + (he : firstPositiveNeumannValue Ω * ‖X‖^2 = ‖F‖^2+‖G‖^2) : + ∃ v : N1 hb, X = N1.grad hb v ∧ G = 0 ∧ + firstPositiveNeumannValue Ω * ‖N1.value hb v‖^2 = ‖N1.grad hb v‖^2 := by + exact (energy_decomposition ho hne hs hb hμ hl hD X F G hF hG).imp fun v hv => + hv.elim fun j hj => equality_of_decomposition ho hb hμ hl X F G v j hj.1 hj.2.1 hj.2.2 hF he + +lemma norm_minimizer_integral {Ω : Set Plane} (u : H1 Ω) + (he : firstPositiveNeumannValue Ω * ‖H1.value u‖^2 = ‖H1.grad u‖^2) : + (∫ x in Ω, ‖H1.grad u x‖^2) = + firstPositiveNeumannValue Ω * (∫ x in Ω, (H1.value u x)^2) := + (H1.norm_grad_sq u).symm.trans (he.symm.trans + (congrArg (fun t : ℝ => firstPositiveNeumannValue Ω*t) (H1.norm_value_sq u))) + +lemma real_L2_pair {α : Type*} [MeasurableSpace α] (ν : Measure α) (f g : Lp ℝ 2 ν) : + inner ℝ f g = ∫ x, f x*g x ∂ν := by + rw [L2.inner_def] + apply integral_congr_ae + exact Filter.Eventually.of_forall fun x => by + simp only [RCLike.inner_apply,RCLike.conj_to_real] + exact mul_comm _ _ + +lemma minimizer_euler_H1 {Ω : Set Plane} (hb : Bornology.IsBounded Ω) + (hvol : 0 < (volume Ω).toReal) (u : H1 Ω) (hm : (∫ x in Ω, H1.value u x)=0) + (he : firstPositiveNeumannValue Ω * ‖H1.value u‖^2 = ‖H1.grad u‖^2) + (w : H1 Ω) : inner ℝ (H1.grad u) (H1.grad w) = + firstPositiveNeumannValue Ω * inner ℝ (H1.value u) (H1.value w) := + (L2.inner_def _ _).trans ((minimizer_euler hb hvol (H1.hasH1Gradient u) + (H1.hasH1Gradient w) hm (norm_minimizer_integral u he)).trans + (congrArg (fun t : ℝ => firstPositiveNeumannValue Ω*t) + (real_L2_pair (volume.restrict Ω) (H1.value u) (H1.value w)).symm)) + +lemma minimizer_euler_L2 {Ω : Set Plane} (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hb : Bornology.IsBounded Ω) (v : N1 hb) + (he : firstPositiveNeumannValue Ω * ‖N1.value hb v‖^2 = ‖N1.grad hb v‖^2) + (w : H1 Ω) : inner ℝ (N1.grad hb v) (H1.grad w) = + firstPositiveNeumannValue Ω * inner ℝ (N1.value hb v) (H1.value w) := + minimizer_euler_H1 hb + (ENNReal.toReal_pos (ho.measure_pos volume hne).ne' hb.measure_lt_top.ne) + v.val (N1.mean_zero hb v) he w + +end StrictHotSpots.Hodge + +end HodgeEqualityInteriorSupportLayer + + +end + +end ActualVectorSupport + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/KernelLimit.lean b/lean/OAI/Analysis/HotSpots/KernelLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..b4cda5eeea21d2dab9b4a999434aa2b00486c71d --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/KernelLimit.lean @@ -0,0 +1,1048 @@ +import OAI.Analysis.HotSpots.BoundaryKernel + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section FullBoundaryCombinedLayer +section L2CutoffLayer + +open MeasureTheory Set Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.L2Cutoff +variable {X : Type*} [MeasurableSpace X] {ν : Measure X} (s : Set X) (hs : MeasurableSet s) + +include hs in +lemma extension_memLp (f : Lp ℝ 2 (ν.restrict s)) : MemLp (s.indicator f) 2 ν := + (memLp_indicator_iff_restrict hs).2 (Lp.memLp f) + +def extension : Lp ℝ 2 (ν.restrict s) →L[ℝ] Lp ℝ 2 ν := by + let J : Lp ℝ 2 (ν.restrict s) →ₗ[ℝ] Lp ℝ 2 ν := + { toFun := fun f => (extension_memLp s hs f).toLp _ + map_add' := by + intro f g + apply Lp.ext + filter_upwards [(extension_memLp s hs (f+g)).coeFn_toLp, + (extension_memLp s hs f).coeFn_toLp, (extension_memLp s hs g).coeFn_toLp, + Lp.coeFn_add ((extension_memLp s hs f).toLp _) ((extension_memLp s hs g).toLp _), + ae_imp_of_ae_restrict (Lp.coeFn_add f g)] with x hfg hf hg ha he + rw [hfg,ha,Pi.add_apply,hf,hg] + by_cases hx : x ∈ s + · simp only [indicator_of_mem hx, he hx, Pi.add_apply] + · simp [indicator_of_notMem hx] + map_smul' := by + intro c f + apply Lp.ext + filter_upwards [(extension_memLp s hs (c • f)).coeFn_toLp, + (extension_memLp s hs f).coeFn_toLp, + Lp.coeFn_smul c ((extension_memLp s hs f).toLp _), + ae_imp_of_ae_restrict (Lp.coeFn_smul c f)] with x hcf hf hc he + simp only [RingHom.id_apply] + rw [hcf,hc,Pi.smul_apply,hf] + by_cases hx : x ∈ s + · simp only [indicator_of_mem hx, he hx, Pi.smul_apply] + · simp [indicator_of_notMem hx] } + refine J.mkContinuous 1 (fun f => ?_) + change ‖(extension_memLp s hs f).toLp _‖ ≤ 1 * ‖f‖ + rw [Lp.norm_toLp, eLpNorm_indicator_eq_eLpNorm_restrict hs, one_mul] + rfl + +lemma extension_ae (f : Lp ℝ 2 (ν.restrict s)) : + extension s hs f =ᵐ[ν] s.indicator f := (extension_memLp s hs f).coeFn_toLp + +lemma extension_norm (f : Lp ℝ 2 (ν.restrict s)) : ‖extension s hs f‖ = ‖f‖ := by + change ‖(extension_memLp s hs f).toLp _‖ = _ + rw [Lp.norm_toLp, eLpNorm_indicator_eq_eLpNorm_restrict hs] + rfl + +lemma extension_norm_le : ‖extension (ν := ν) s hs‖ ≤ 1 := by + apply (extension (ν := ν) s hs).opNorm_le_bound (by norm_num) + intro f + simp [extension_norm] + +def restriction : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 (ν.restrict s) := + Lp.LpToLpOfMeasureLeSMul (by norm_num : (1 : ℝ≥0∞) ≠ ⊤) + (show ν.restrict s ≤ 1 • ν by simpa using Measure.restrict_le_self) + +lemma restriction_ae (f : Lp ℝ 2 ν) : restriction s f =ᵐ[ν.restrict s] f := + Lp.coeFn_LpToLpOfMeasureLeSMul _ _ f + +lemma restriction_norm (f : Lp ℝ 2 ν) : ‖restriction s f‖ ≤ ‖f‖ := by + change (eLpNorm (restriction s f) 2 (ν.restrict s)).toReal ≤ (eLpNorm f 2 ν).toReal + rw [eLpNorm_congr_ae (restriction_ae s f)] + exact ENNReal.toReal_mono (Lp.memLp f).eLpNorm_ne_top (eLpNorm_restrict_le _ _ _ _) + +lemma restriction_norm_le : ‖restriction (ν := ν) s‖ ≤ 1 := by + apply (restriction (ν := ν) s).opNorm_le_bound (by norm_num) + intro f + simpa only [one_mul] using restriction_norm s f + +lemma restriction_extension (f : Lp ℝ 2 (ν.restrict s)) : + restriction s (extension s hs f) = f := by + apply Lp.ext + filter_upwards [restriction_ae s (extension s hs f), (extension_ae s hs f).restrict, + ae_restrict_mem hs] with x hx he hxs + rw [hx,he,indicator_of_mem hxs] + +lemma extension_inner (f : Lp ℝ 2 (ν.restrict s)) (g : Lp ℝ 2 ν) : + inner ℝ (extension s hs f) g = inner ℝ f (restriction s g) := by + simp only [L2.inner_def, RCLike.inner_apply, conj_trivial] + have he : (fun x => g x * extension s hs f x) =ᵐ[ν] + s.indicator (fun x => g x * f x) := by + filter_upwards [extension_ae s hs f] with x hx + rw [hx] + by_cases hxs : x ∈ s <;> simp [hxs] + rw [integral_congr_ae he, integral_indicator hs] + apply integral_congr_ae + filter_upwards [restriction_ae s g] with x hx + rw [hx] + +lemma extension_eq_adjoint : extension (ν := ν) s hs = (restriction s).adjoint := by + exact (ContinuousLinearMap.eq_adjoint_iff _ _).2 (extension_inner s hs) + +lemma extension_inner_extension (f g : Lp ℝ 2 (ν.restrict s)) : + inner ℝ (extension s hs f) (extension s hs g) = inner ℝ f g := by + rw [extension_inner, restriction_extension] + +def projection : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν := (extension s hs).comp (restriction s) + +lemma projection_ae (f : Lp ℝ 2 ν) : projection s hs f =ᵐ[ν] s.indicator f := by + filter_upwards [extension_ae s hs (restriction s f), + ae_imp_of_ae_restrict (restriction_ae s f)] with x hx hr + change extension s hs (restriction s f) x = _ + rw [hx] + by_cases hxs : x ∈ s + · simp [hxs, hr hxs] + · simp [hxs] + +lemma projection_norm (f : Lp ℝ 2 ν) : ‖projection s hs f‖ ≤ ‖f‖ := by + exact (extension_norm s hs _).le.trans (restriction_norm s f) + +lemma projection_norm_le : ‖projection (ν := ν) s hs‖ ≤ 1 := by + apply (projection (ν := ν) s hs).opNorm_le_bound (by norm_num) + intro f + simpa only [one_mul] using projection_norm s hs f + +lemma projection_idempotent (f : Lp ℝ 2 ν) : + projection s hs (projection s hs f) = projection s hs f := by + exact congrArg (extension s hs) (restriction_extension s hs (restriction s f)) + +lemma projection_symmetric (f g : Lp ℝ 2 ν) : + inner ℝ (projection s hs f) g = inner ℝ f (projection s hs g) := by + change inner ℝ (extension s hs (restriction s f)) g = + inner ℝ f (extension s hs (restriction s g)) + calc + _ = inner ℝ (restriction s f) (restriction s g) := extension_inner s hs _ _ + _ = inner ℝ (restriction s g) (restriction s f) := real_inner_comm _ _ + _ = inner ℝ (extension s hs (restriction s g)) f := (extension_inner s hs _ _).symm + _ = _ := real_inner_comm _ _ + +end StrictHotSpots.L2Cutoff + +end L2CutoffLayer + +section CutoffConvergenceLayer +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.L2Cutoff +variable {X : Type*} [MeasurableSpace X] {ν : Measure X} + +lemma projection_tendsto (s : ℕ → Set X) (hs : ∀ n, MeasurableSet (s n)) + (hex : ∀ᵐ x ∂ν, ∀ᶠ n in atTop, x ∈ s n) (f : Lp ℝ 2 ν) : + Tendsto (fun n => projection (s n) (hs n) f) atTop (𝓝 f) := by + let hf : ∀ n, MemLp ((s n).indicator f) 2 ν := + fun n => (Lp.memLp f).indicator (hs n) + have ht := L2Limits.tendsto_toLp_of_dominated hf (Lp.memLp f) (Lp.memLp f).norm + (Eventually.of_forall fun n => Eventually.of_forall fun x => by + by_cases hx : x ∈ s n <;> simp [hx]) + (by + filter_upwards [hex] with x hx + apply tendsto_const_nhds.congr' + filter_upwards [hx] with n hn + simp [hn]) + have he (n : ℕ) : projection (s n) (hs n) f = (hf n).toLp _ := + Lp.ext ((projection_ae (s n) (hs n) f).trans (hf n).coeFn_toLp.symm) + simpa only [← he, Lp.toLp_coeFn] using ht + +end StrictHotSpots.L2Cutoff +namespace StrictHotSpots.BanachResolvent +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +lemma bounded_strong_tendsto_moving (Q : ℕ → E →L[ℝ] E) (A : E →L[ℝ] E) + {d : ℝ} (hQ : ∀ᶠ n in atTop, ‖Q n‖ ≤ d) + (hs : ∀ v, Tendsto (fun n => Q n v) atTop (𝓝 (A v))) + {v : ℕ → E} {w : E} (hv : Tendsto v atTop (𝓝 w)) : + Tendsto (fun n => Q n (v n)) atTop (𝓝 (A w)) := by + have hz : Tendsto (fun n => Q n (v n-w)) atTop (𝓝 0) := by + have hb : Tendsto (fun n => d * ‖v n-w‖) atTop (𝓝 0) := by + simpa using (hv.sub_const w).norm.const_mul d + apply squeeze_zero_norm' _ hb + filter_upwards [hQ] with n hn + exact (ContinuousLinearMap.le_opNorm _ _).trans + (mul_le_mul_of_nonneg_right hn (norm_nonneg _)) + simpa only [map_sub, sub_add_cancel, zero_add] using hz.add (hs w) + +lemma compression_norm_le (T P : E →L[ℝ] E) (hP : ‖P‖ ≤ 1) : + ‖P.comp (T.comp P)‖ ≤ ‖T‖ := by + calc + _ ≤ ‖P‖ * (‖T‖ * ‖P‖) := (ContinuousLinearMap.opNorm_comp_le _ _).trans + (mul_le_mul_of_nonneg_left (ContinuousLinearMap.opNorm_comp_le _ _) (norm_nonneg _)) + _ ≤ 1 * (‖T‖ * 1) := mul_le_mul hP + (mul_le_mul_of_nonneg_left hP (norm_nonneg _)) + (mul_nonneg (norm_nonneg _) (norm_nonneg _)) (by norm_num) + _ = ‖T‖ := by ring + +lemma compression_strong_tendsto (T : E →L[ℝ] E) (P : ℕ → E →L[ℝ] E) + (hP : ∀ᶠ n in atTop, ‖P n‖ ≤ 1) + (hs : ∀ v, Tendsto (fun n => P n v) atTop (𝓝 v)) (f : E) : + Tendsto (fun n => (P n).comp (T.comp (P n)) f) atTop (𝓝 (T f)) := by + exact bounded_strong_tendsto_moving P (ContinuousLinearMap.id ℝ E) hP hs + (T.continuous.continuousAt.tendsto.comp (hs f)) + +end StrictHotSpots.BanachResolvent +end +end CutoffConvergenceLayer + +section CutoffOperatorsLayer +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.L2Cutoff +variable {X : Type*} [MeasurableSpace X] {ν : Measure X} + (s : Set X) (hs : MeasurableSet s) + +def restrictedOperator (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) : + Lp ℝ 2 (ν.restrict s) →L[ℝ] Lp ℝ 2 (ν.restrict s) := + (restriction s).comp (T.comp (extension s hs)) + +def compressedOperator (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν := + (projection s hs).comp (T.comp (projection s hs)) + +lemma restrictedOperator_norm_le (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) : + ‖restrictedOperator s hs T‖ ≤ ‖T‖ := by + calc + _ ≤ ‖restriction (ν := ν) s‖ * (‖T‖ * ‖extension (ν := ν) s hs‖) := + (ContinuousLinearMap.opNorm_comp_le _ _).trans + (mul_le_mul_of_nonneg_left (ContinuousLinearMap.opNorm_comp_le _ _) (norm_nonneg _)) + _ ≤ 1 * (‖T‖ * 1) := mul_le_mul (restriction_norm_le s) + (mul_le_mul_of_nonneg_left (extension_norm_le s hs) (norm_nonneg _)) + (mul_nonneg (norm_nonneg _) (norm_nonneg _)) (by norm_num) + _ = ‖T‖ := by ring + +lemma compressedOperator_norm_le (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) : + ‖compressedOperator s hs T‖ ≤ ‖T‖ := + BanachResolvent.compression_norm_le T (projection s hs) (projection_norm_le s hs) + +lemma extension_intertwine (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) (f : Lp ℝ 2 (ν.restrict s)) : + extension s hs (restrictedOperator s hs T f) = + compressedOperator s hs T (extension s hs f) := by + change extension s hs (restriction s (T (extension s hs f))) = + extension s hs (restriction s (T (extension s hs (restriction s (extension s hs f))))) + rw [restriction_extension] + +lemma resolvent_extension (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) (hT : ‖T‖ < 1) + (f : Lp ℝ 2 (ν.restrict s)) : + BanachResolvent.resolvent (compressedOperator s hs T) (extension s hs f) = + extension s hs (BanachResolvent.resolvent (restrictedOperator s hs T) f) := by + symm + apply BanachResolvent.resolvent_solution _ ((compressedOperator_norm_le s hs T).trans_lt hT) + rw [← extension_intertwine, ← map_sub] + congr 1 + exact congrArg (fun A : Lp ℝ 2 (ν.restrict s) →L[ℝ] Lp ℝ 2 (ν.restrict s) => A f) + (BanachResolvent.resolvent_left _ ((restrictedOperator_norm_le s hs T).trans_lt hT)) + +lemma resolvent_inner_extension (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) (hT : ‖T‖ < 1) + (f g : Lp ℝ 2 (ν.restrict s)) : + inner ℝ (extension s hs f) + (BanachResolvent.resolvent (compressedOperator s hs T) (extension s hs g)) = + inner ℝ f (BanachResolvent.resolvent (restrictedOperator s hs T) g) := by + rw [resolvent_extension s hs T hT, extension_inner_extension] + +end StrictHotSpots.L2Cutoff +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ ∞) + (hν : ν ≤ C • volume.restrict disk) (s : Set Plane) + +include hν in +lemma restrictDensity : ν.restrict s ≤ C • volume.restrict disk := + Measure.restrict_le_self.trans hν + +lemma inclusion_restrict : inclusion hC (restrictDensity hν s) = + (L2Cutoff.restriction s).comp (inclusion hC hν) := by + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + filter_upwards [inclusion_ae hC (restrictDensity hν s) f, + L2Cutoff.restriction_ae s (inclusion hC hν f), (inclusion_ae hC hν f).restrict] + with x hx hr hi + rw [hx, show ((L2Cutoff.restriction s).comp (inclusion hC hν)) f x = f x from hr.trans hi] + +lemma weightedIntegralOperator_restrict (hs : MeasurableSet s) : + weightedIntegralOperator hC (restrictDensity hν s) = + L2Cutoff.restrictedOperator s hs (weightedIntegralOperator hC hν) := by + unfold weightedIntegralOperator L2Cutoff.restrictedOperator + rw [inclusion_restrict hC hν s, ContinuousLinearMap.adjoint_comp, L2Cutoff.extension_eq_adjoint] + simp only [ContinuousLinearMap.comp_assoc] + +lemma weightedValue_restrict (u : H10 diskOpen) : + H10.weightedValue diskOpen hC (restrictDensity hν s) u = + L2Cutoff.restriction s (H10.weightedValue diskOpen hC hν u) := by + exact congrArg (fun T => T (H10.value diskOpen u)) (inclusion_restrict hC hν s) + +lemma subcritical_restrict {d : ℝ} + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) : + ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC (restrictDensity hν s) u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2 := by + intro u + rw [weightedValue_restrict hC hν s] + exact (pow_le_pow_left₀ (norm_nonneg _) (L2Cutoff.restriction_norm s _) 2).trans (hsub u) + +lemma row_restrict (p : disk) : row hC (restrictDensity hν s) p = + L2Cutoff.restriction s (row hC hν p) := by + apply Lp.ext + exact (column_memLp hC (restrictDensity hν s) p).coeFn_toLp.trans + (((L2Cutoff.restriction_ae s (row hC hν p)).trans + (column_memLp hC hν p).coeFn_toLp.restrict).symm) + +end StrictHotSpots.PlaneGreen +end +end CutoffOperatorsLayer + +section DiskCutoffLayer +noncomputable section +open MeasureTheory Set Filter Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 + +def cutoffRadius (n : ℕ) : ℝ := 1 - 1 / ((n : ℝ) + 1) +def cutoffSet (n : ℕ) : Set Plane := closedBall 0 (cutoffRadius n) + +lemma cutoffRadius_nonneg (n : ℕ) : 0 ≤ cutoffRadius n := by + unfold cutoffRadius + have hn : 1 ≤ (n : ℝ) + 1 := by linarith [Nat.cast_nonneg (α := ℝ) n] + have hh : 1 / ((n : ℝ) + 1) ≤ 1 := (div_le_one (by positivity)).2 hn + linarith + +lemma cutoffRadius_lt_one (n : ℕ) : cutoffRadius n < 1 := by + unfold cutoffRadius + exact sub_lt_self _ (one_div_pos.mpr (by positivity)) + +lemma cutoffRadius_tendsto : Tendsto cutoffRadius atTop (𝓝 1) := by + change Tendsto (fun n : ℕ => 1 - 1 / ((n : ℝ) + 1)) atTop (𝓝 1) + simpa only [sub_zero] using + ((tendsto_const_nhds (x := (1:ℝ))).sub (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ))) + +lemma cutoffSet_compact (n : ℕ) : IsCompact (cutoffSet n) := isCompact_closedBall _ _ +lemma cutoffSet_measurable (n : ℕ) : MeasurableSet (cutoffSet n) := measurableSet_closedBall +lemma cutoffSet_subset (n : ℕ) : cutoffSet n ⊆ disk := by + intro x hx + simpa [disk] using (show ‖x‖ ≤ cutoffRadius n by simpa [cutoffSet] using hx).trans_lt + (cutoffRadius_lt_one n) + +lemma eventually_mem_cutoffSet (x : Plane) (hx : x ∈ disk) : + ∀ᶠ n in atTop, x ∈ cutoffSet n := by + have ht := cutoffRadius_tendsto.eventually (eventually_gt_nhds (show ‖x‖ < 1 by simpa [disk] using hx)) + filter_upwards [ht] with n hn + simpa [cutoffSet] using hn.le + +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ ∞) + (hν : ν ≤ C • volume.restrict disk) + +include hν in +lemma ae_eventually_mem_cutoffSet : ∀ᵐ x ∂ν, ∀ᶠ n in atTop, x ∈ cutoffSet n := by + filter_upwards [ae_mem_disk hν] with x hx + exact eventually_mem_cutoffSet x hx + +include hν in +lemma cutoffProjection_tendsto (f : Lp ℝ 2 ν) : + Tendsto (fun n => L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) f) + atTop (𝓝 f) := + L2Cutoff.projection_tendsto cutoffSet cutoffSet_measurable (ae_eventually_mem_cutoffSet hν) f + +include hν in +lemma cutoff_integral_tendsto {f : Plane → ℝ} (hf : Integrable f ν) : + Tendsto (fun n => ∫ x in cutoffSet n, f x ∂ν) atTop (𝓝 (∫ x, f x ∂ν)) := by + have hm : ∀ n, AEStronglyMeasurable ((cutoffSet n).indicator f) ν := + fun n => hf.aestronglyMeasurable.indicator (cutoffSet_measurable n) + have ht := tendsto_integral_filter_of_dominated_convergence (f := f) (fun x => ‖f x‖) + (Eventually.of_forall hm) + (Eventually.of_forall fun n => Eventually.of_forall fun x => by + by_cases hx : x ∈ cutoffSet n <;> simp [hx]) hf.norm + (by + filter_upwards [ae_eventually_mem_cutoffSet hν] with x hx + apply tendsto_const_nhds.congr' + filter_upwards [hx] with n hn + simp [hn]) + simpa only [integral_indicator (cutoffSet_measurable _)] using ht + +include hν in +lemma smoothedPoisson_nonneg (s : Boundary) {x : Plane} (hx : x ∈ disk) : + 0 ≤ smoothedPoisson (ν := ν) s x := by + apply integral_nonneg_of_ae + filter_upwards [ae_mem_disk hν] with y hy + exact mul_nonneg (kernel_nonneg hx hy) (poisson_nonneg s ⟨y,hy⟩) + +include hC hν in +lemma smoothedPoisson_restrict_le (s : Boundary) (E : Set Plane) {x : Plane} (hx : x ∈ disk) : + smoothedPoisson (ν := ν.restrict E) s x ≤ smoothedPoisson (ν := ν) s x := by + apply setIntegral_le_integral (product_green_poisson_integrable hC hν x hx s) + filter_upwards [ae_mem_disk hν] with y hy + exact mul_nonneg (kernel_nonneg hx hy) (poisson_nonneg s ⟨y,hy⟩) + +include hC hν in +lemma smoothedPoisson_full_memLp [IsFiniteMeasure ν] (s : Boundary) (E : Set Plane) : + MemLp (smoothedPoisson (ν := ν.restrict E) s) 2 ν := by + obtain ⟨B,_,hB⟩ := green_poisson_uniform_bound hC hν + apply MemLp.of_bound (smoothedPoisson_measurable s).aestronglyMeasurable B + filter_upwards [ae_mem_disk hν] with x hx + rw [Real.norm_of_nonneg (smoothedPoisson_nonneg (restrictDensity hν E) s hx)] + exact (smoothedPoisson_restrict_le hC hν s E hx).trans + (le_abs_self _ |>.trans (hB x hx s)) + +include hC hν in +lemma smoothedPoisson_cutoff_tendsto (s : Boundary) {x : Plane} (hx : x ∈ disk) : + Tendsto (fun n => smoothedPoisson (ν := ν.restrict (cutoffSet n)) s x) + atTop (𝓝 (smoothedPoisson (ν := ν) s x)) := + cutoff_integral_tendsto hν (product_green_poisson_integrable hC hν x hx s) + +lemma smoothedPoisson_cutoff_L2_tendsto [IsFiniteMeasure ν] (s : Boundary) : + Tendsto (fun n => (smoothedPoisson_full_memLp hC hν s (cutoffSet n)).toLp + (smoothedPoisson (ν := ν.restrict (cutoffSet n)) s)) atTop + (𝓝 ((smoothedPoisson_memLp hC hν s).toLp (smoothedPoisson (ν := ν) s))) := by + apply L2Limits.tendsto_toLp_of_dominated + (fun n => smoothedPoisson_full_memLp hC hν s (cutoffSet n)) + (smoothedPoisson_memLp hC hν s) (smoothedPoisson_memLp hC hν s) + · apply Eventually.of_forall + intro n + filter_upwards [ae_mem_disk hν] with x hx + rw [Real.norm_of_nonneg (smoothedPoisson_nonneg (restrictDensity hν (cutoffSet n)) s hx)] + exact smoothedPoisson_restrict_le hC hν s (cutoffSet n) hx + · filter_upwards [ae_mem_disk hν] with x hx + exact smoothedPoisson_cutoff_tendsto hC hν s hx + +end StrictHotSpots.PlaneGreen +end +end DiskCutoffLayer + +section FullBoundaryKernelLayer +noncomputable section +open MeasureTheory Set Filter Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.BanachResolvent +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] + +lemma apply_eq_add (T : H →L[ℝ] H) (hT : ‖T‖ < 1) (f : H) : + resolvent T f = f + resolvent T (T f) := by + have he := congrArg (fun A : H →L[ℝ] H => A f) (resolvent_right T hT) + have hh : resolvent T f - resolvent T (T f) = f := by + simpa only [mul_apply_eq_comp, sub_apply, + one_apply_eq_self, map_sub] using he + exact sub_eq_iff_eq_add.mp hh + +lemma apply_eq_add_left (T : H →L[ℝ] H) (hT : ‖T‖ < 1) (f : H) : + resolvent T f = f + T (resolvent T f) := by + have he := congrArg (fun A : H →L[ℝ] H => A f) (resolvent_left T hT) + have hh : resolvent T f - T (resolvent T f) = f := by + simpa only [mul_apply_eq_comp, sub_apply, + one_apply_eq_self] using he + exact sub_eq_iff_eq_add.mp hh + +lemma inner_two_terms (T : H →L[ℝ] H) (hT : ‖T‖ < 1) + (hsym : ∀ f g, inner ℝ (T f) g = inner ℝ f (T g)) (f g : H) : + inner ℝ f (resolvent T g) = inner ℝ f g + inner ℝ f (T g) + + inner ℝ (T f) (resolvent T (T g)) := by + have h1 := congrArg (fun v => inner ℝ f v) (apply_eq_add T hT g) + have h2 := congrArg (fun v => inner ℝ f v) (apply_eq_add_left T hT (T g)) + rw [inner_add_right] at h1 h2 + rw [← hsym f (resolvent T (T g))] at h2 + rw [h1, h2] + ring + +end StrictHotSpots.BanachResolvent +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +def smoothedRow (s : Boundary) : Lp ℝ 2 ν := + (smoothedPoisson_memLp hC hν s).toLp (smoothedPoisson (ν := ν) s) + +def cutoffSmoothedRow (n : ℕ) (s : Boundary) : Lp ℝ 2 ν := + (smoothedPoisson_full_memLp hC hν s (cutoffSet n)).toLp + (smoothedPoisson (ν := ν.restrict (cutoffSet n)) s) + +omit [IsFiniteMeasure ν] in +lemma cutoff_ae_norm (n : ℕ) : ∀ᵐ x ∂ν.restrict (cutoffSet n), ‖x‖ ≤ cutoffRadius n := by + filter_upwards [ae_restrict_mem (cutoffSet_measurable n)] with x hx + simpa [cutoffSet] using hx + +lemma compactSmoothedRow_eq (n : ℕ) (s : Boundary) : + weightedIntegralOperator hC (restrictDensity hν (cutoffSet n)) + (poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s) = + L2Cutoff.restriction (cutoffSet n) (cutoffSmoothedRow hC hν n s) := by + apply Lp.ext + filter_upwards [weightedIntegralOperator_ae hC (restrictDensity hν (cutoffSet n)) + (poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s), + L2Cutoff.restriction_ae (cutoffSet n) (cutoffSmoothedRow hC hν n s), + ((smoothedPoisson_full_memLp hC hν s (cutoffSet n)).coeFn_toLp).restrict] with x hx hr hs + rw [hx,hr,show cutoffSmoothedRow hC hν n s x = + smoothedPoisson (ν := ν.restrict (cutoffSet n)) s x from hs] + apply integral_congr_ae + filter_upwards [(poisson_memLp (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s).coeFn_toLp] + with y hy + rw [show poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s y = poisson s y from hy] + +lemma extendedSmoothedRow_tendsto (s : Boundary) : + Tendsto (fun n => L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) + (cutoffSmoothedRow hC hν n s)) atTop (𝓝 (smoothedRow hC hν s)) := by + apply BanachResolvent.bounded_strong_tendsto_moving + (fun n => L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n)) + (ContinuousLinearMap.id ℝ (Lp ℝ 2 ν)) + (Eventually.of_forall fun n => L2Cutoff.projection_norm_le _ _) + (cutoffProjection_tendsto hν) + exact smoothedPoisson_cutoff_L2_tendsto hC hν s + + + +def fullBoundaryK (p : disk) (s : Boundary) : ℝ := poisson s p + smoothedPoisson (ν := ν) s p + + inner ℝ (row hC hν p) (BanachResolvent.resolvent (weightedIntegralOperator hC hν) + (smoothedRow hC hν s)) + + + +def fullBoundaryN (s t : Boundary) : ℝ := boundaryInteraction s t + + (∫ x, poisson s x * poisson t x ∂ν) + + (∫ x, poisson s x * smoothedPoisson (ν := ν) t x ∂ν) + + inner ℝ (smoothedRow hC hν s) (BanachResolvent.resolvent (weightedIntegralOperator hC hν) + (smoothedRow hC hν t)) + +lemma smoothedRow_nonneg (s : Boundary) : 0 ≤ smoothedRow hC hν s := by + apply (Lp.coeFn_nonneg _).mp + filter_upwards [(smoothedPoisson_memLp hC hν s).coeFn_toLp, ae_mem_disk hν] with x hx hxd + rw [show smoothedRow hC hν s x = smoothedPoisson (ν := ν) s x from hx] + exact smoothedPoisson_nonneg hν s hxd + +lemma fullBoundaryK_pos (hT : ‖weightedIntegralOperator hC hν‖ < 1) (p : disk) (s : Boundary) : + 0 < fullBoundaryK hC hν p s := by + apply add_pos_of_pos_of_nonneg + · exact add_pos_of_pos_of_nonneg (poisson_pos s p) (smoothedPoisson_nonneg hν s p.property) + · apply L2Limits.inner_nonneg (row_nonneg hC hν p) + exact BanachResolvent.resolvent_nonneg _ hT (weightedIntegralOperator_order_nonneg hC hν) + (smoothedRow_nonneg hC hν s) + +lemma fullBoundaryN_pos (hT : ‖weightedIntegralOperator hC hν‖ < 1) (s t : Boundary) (hst : s ≠ t) : + 0 < fullBoundaryN hC hν s t := by + apply add_pos_of_pos_of_nonneg + · apply add_pos_of_pos_of_nonneg + · apply add_pos_of_pos_of_nonneg (boundaryInteraction_pos s t hst) + apply integral_nonneg_of_ae + filter_upwards [ae_mem_disk hν] with x hx + exact mul_nonneg (poisson_nonneg s ⟨x,hx⟩) (poisson_nonneg t ⟨x,hx⟩) + · apply integral_nonneg_of_ae + filter_upwards [ae_mem_disk hν] with x hx + exact mul_nonneg (poisson_nonneg s ⟨x,hx⟩) (smoothedPoisson_nonneg hν t hx) + · apply L2Limits.inner_nonneg (smoothedRow_nonneg hC hν s) + exact BanachResolvent.resolvent_nonneg _ hT (weightedIntegralOperator_order_nonneg hC hν) + (smoothedRow_nonneg hC hν t) + +end StrictHotSpots.PlaneGreen +end +end FullBoundaryKernelLayer + +section PoissonProductsLayer +noncomputable section +open MeasureTheory Set Filter Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 + +lemma poisson_measurable (s : Boundary) : Measurable (poisson s) := by + unfold poisson DiskFormula.poisson + fun_prop + +lemma poisson_invnorm_bound (s : Boundary) {x : Plane} (hx : x ∈ disk) : + poisson s x ≤ Real.pi⁻¹ * ‖(s : Plane)-x‖⁻¹ := by + have hh := DiskFormula.poisson_invnorm_bound (complexIso.symm s) (complexIso.symm x) + (by simpa using s.property) (by simpa [disk] using hx) + simpa only [poisson, ← map_sub, LinearIsometryEquiv.norm_map] using hh + +lemma poisson_product_bound (s t : Boundary) (hst : s ≠ t) : ∃ A : ℝ, 0 ≤ A ∧ + ∀ x ∈ disk, poisson s x * poisson t x ≤ A * (poisson s x + poisson t x) := by + let D : ℝ := ‖(s : Plane)-(t : Plane)‖ / 2 + have hD : 0 < D := div_pos (norm_pos_iff.mpr (sub_ne_zero.mpr + (fun h => hst (Subtype.ext h)))) (by norm_num) + let A : ℝ := Real.pi⁻¹ * D⁻¹ + refine ⟨A, mul_nonneg (inv_nonneg.mpr Real.pi_pos.le) (inv_nonneg.mpr hD.le), fun x hx => ?_⟩ + have hdist : 2*D ≤ ‖(s : Plane)-x‖ + ‖(t : Plane)-x‖ := by + have hh := norm_add_le ((s : Plane)-x) (x-(t : Plane)) + have he : (s : Plane)-x+(x-(t : Plane)) = (s : Plane)-(t : Plane) := by abel + rw [he, norm_sub_rev x (t : Plane)] at hh + dsimp [D] + linarith + have hb (v : Boundary) (hv : D ≤ ‖(v : Plane)-x‖) : poisson v x ≤ A := by + apply (poisson_invnorm_bound v hx).trans + exact mul_le_mul_of_nonneg_left + (by simpa only [one_div] using one_div_le_one_div_of_le hD hv) (inv_nonneg.mpr Real.pi_pos.le) + have hs := poisson_nonneg s ⟨x,hx⟩ + have ht := poisson_nonneg t ⟨x,hx⟩ + by_cases hd : D ≤ ‖(s : Plane)-x‖ + · have h1 := mul_le_mul_of_nonneg_right (hb s hd) ht + have h2 : A * poisson t x ≤ A * (poisson s x + poisson t x) := + mul_le_mul_of_nonneg_left (by linarith) (by dsimp [A]; positivity) + exact h1.trans h2 + · have h1 := mul_le_mul_of_nonneg_left (hb t (by linarith)) hs + have h2 : poisson s x * A ≤ A * (poisson s x + poisson t x) := by + have hA : 0 ≤ A := by dsimp [A]; positivity + nlinarith + exact h1.trans h2 + +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +include hC hν in +lemma poisson_integrable (s : Boundary) : Integrable (poisson s) ν := + (poisson_memLp_three_halves_weighted hC hν s).integrable (by rw [ENNReal.le_div_iff_mul_le (by norm_num) (by norm_num)]; norm_num) + +include hC hν in +lemma poisson_product_integrable (s t : Boundary) (hst : s ≠ t) : + Integrable (fun x => poisson s x * poisson t x) ν := by + obtain ⟨A,_,hA⟩ := poisson_product_bound s t hst + apply (((poisson_integrable hC hν s).add (poisson_integrable hC hν t)).const_mul A).mono' + ((poisson_measurable s).mul (poisson_measurable t)).aestronglyMeasurable + filter_upwards [ae_mem_disk hν] with x hx + change ‖poisson s x * poisson t x‖ ≤ A * (poisson s x + poisson t x) + rw [Real.norm_of_nonneg (mul_nonneg (poisson_nonneg s ⟨x,hx⟩) (poisson_nonneg t ⟨x,hx⟩))] + exact hA x hx + +include hC hν in +lemma poisson_smoothed_integrable (s t : Boundary) : + Integrable (fun x => poisson s x * smoothedPoisson (ν := ν) t x) ν := by + obtain ⟨B,_,hB⟩ := green_poisson_uniform_bound hC hν + apply ((poisson_integrable hC hν s).norm.mul_const B).mono' + ((poisson_measurable s).mul (smoothedPoisson_measurable t)).aestronglyMeasurable + filter_upwards [ae_mem_disk hν] with x hx + change ‖poisson s x * smoothedPoisson (ν := ν) t x‖ ≤ ‖poisson s x‖ * B + rw [norm_mul] + exact mul_le_mul_of_nonneg_left (hB x hx t) (norm_nonneg _) + +include hC hν in +lemma poisson_smoothed_cutoff_tendsto (s t : Boundary) : + Tendsto (fun n => ∫ x in cutoffSet n, poisson s x * + smoothedPoisson (ν := ν.restrict (cutoffSet n)) t x ∂ν) atTop + (𝓝 (∫ x, poisson s x * smoothedPoisson (ν := ν) t x ∂ν)) := by + obtain ⟨B,_,hB⟩ := green_poisson_uniform_bound hC hν + let f (n : ℕ) (x : Plane) := (cutoffSet n).indicator (fun x => poisson s x * + smoothedPoisson (ν := ν.restrict (cutoffSet n)) t x) x + have hm n : AEStronglyMeasurable (f n) ν := + (((poisson_measurable s).mul (smoothedPoisson_measurable t)).indicator + (cutoffSet_measurable n)).aestronglyMeasurable + have hd n : ∀ᵐ x ∂ν, ‖f n x‖ ≤ ‖poisson s x‖ * B := by + filter_upwards [ae_mem_disk hν] with x hx + by_cases he : x ∈ cutoffSet n + · dsimp only [f] + rw [indicator_of_mem he, norm_mul] + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + rw [Real.norm_of_nonneg (smoothedPoisson_nonneg (restrictDensity hν (cutoffSet n)) t hx)] + exact (smoothedPoisson_restrict_le hC hν t (cutoffSet n) hx).trans + (le_abs_self _ |>.trans (hB x hx t)) + · simp only [f, indicator_of_notMem he, norm_zero] + exact mul_nonneg (norm_nonneg _) (norm_nonneg _ |>.trans (hB x hx t)) + have hl : ∀ᵐ x ∂ν, Tendsto (fun n => f n x) atTop + (𝓝 (poisson s x * smoothedPoisson (ν := ν) t x)) := by + filter_upwards [ae_mem_disk hν, ae_eventually_mem_cutoffSet hν] with x hx he + apply ((smoothedPoisson_cutoff_tendsto hC hν t hx).const_mul (poisson s x)).congr' + filter_upwards [he] with n hn + simp [f,hn] + have hh := tendsto_integral_filter_of_dominated_convergence (fun x => ‖poisson s x‖ * B) + (Eventually.of_forall hm) (Eventually.of_forall hd) + ((poisson_integrable hC hν s).norm.mul_const B) hl + simpa only [f, integral_indicator (cutoffSet_measurable _)] using hh + +end StrictHotSpots.PlaneGreen +end +end PoissonProductsLayer + +section CutoffBoundaryLimitsLayer +noncomputable section +open MeasureTheory Set Filter Metric +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +abbrev cutoffOperator (n : ℕ) : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν := + L2Cutoff.compressedOperator (cutoffSet n) (cutoffSet_measurable n) (weightedIntegralOperator hC hν) + +abbrev cutoffK (n : ℕ) (p : disk) (s : Boundary) : ℝ := + boundaryK (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) hC + (restrictDensity hν (cutoffSet n)) p s + +abbrev cutoffN (n : ℕ) (s t : Boundary) : ℝ := + boundaryN (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) hC + (restrictDensity hν (cutoffSet n)) s t + +lemma cutoff_row_inner (n : ℕ) (p : disk) (s : Boundary) : + inner ℝ (row hC (restrictDensity hν (cutoffSet n)) p) + (poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s) = + smoothedPoisson (ν := ν.restrict (cutoffSet n)) s p := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [(column_memLp hC (restrictDensity hν (cutoffSet n)) p).coeFn_toLp, + (poisson_memLp (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s).coeFn_toLp] with x hx hs + change poissonRow _ _ s x * row hC _ p x = _ + rw [show row hC (restrictDensity hν (cutoffSet n)) p x = kernel x p from hx, + show poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s x = poisson s x from hs, + kernel_symm, mul_comm] + +lemma cutoff_poisson_inner (n : ℕ) (s t : Boundary) : + inner ℝ (poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s) + (poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) t) = + ∫ x in cutoffSet n, poisson s x * poisson t x ∂ν := + (MeasurableL2Kernel.integral_mul_eq_inner + (poisson_memLp (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s) + (poisson_memLp (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) t)).symm + +lemma cutoff_poisson_smoothed_inner (n : ℕ) (s t : Boundary) : + inner ℝ (poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s) + (weightedIntegralOperator hC (restrictDensity hν (cutoffSet n)) + (poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) t)) = + ∫ x in cutoffSet n, poisson s x * + smoothedPoisson (ν := ν.restrict (cutoffSet n)) t x ∂ν := by + rw [compactSmoothedRow_eq hC hν, L2.inner_def] + apply integral_congr_ae + filter_upwards [(poisson_memLp (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s).coeFn_toLp, + L2Cutoff.restriction_ae (cutoffSet n) (cutoffSmoothedRow hC hν n t), + ((smoothedPoisson_full_memLp hC hν t (cutoffSet n)).coeFn_toLp).restrict] with x hs hr ht + change L2Cutoff.restriction (cutoffSet n) (cutoffSmoothedRow hC hν n t) x * + poissonRow _ _ s x = _ + rw [hr,show cutoffSmoothedRow hC hν n t x = + smoothedPoisson (ν := ν.restrict (cutoffSet n)) t x from ht, + show poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s x = poisson s x from hs, + mul_comm] + +lemma cutoffK_expansion (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (n : ℕ) (p : disk) (s : Boundary) : + cutoffK hC hν n p s = poisson s p + smoothedPoisson (ν := ν.restrict (cutoffSet n)) s p + + inner ℝ (L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) (row hC hν p)) + (BanachResolvent.resolvent (cutoffOperator hC hν n) + (L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) (cutoffSmoothedRow hC hν n s))) := by + have hn : ‖weightedIntegralOperator hC (restrictDensity hν (cutoffSet n))‖ < 1 := by + rw [weightedIntegralOperator_restrict hC hν _ (cutoffSet_measurable n)] + exact (L2Cutoff.restrictedOperator_norm_le _ _ _).trans_lt hT + have he := L2Cutoff.resolvent_inner_extension (cutoffSet n) (cutoffSet_measurable n) + (weightedIntegralOperator hC hν) hT (row hC (restrictDensity hν (cutoffSet n)) p) + (weightedIntegralOperator hC (restrictDensity hν (cutoffSet n)) + (poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s)) + rw [← weightedIntegralOperator_restrict hC hν _ (cutoffSet_measurable n)] at he + rw [row_restrict hC hν, compactSmoothedRow_eq hC hν] at he + change inner ℝ (L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) (row hC hν p)) + (BanachResolvent.resolvent (cutoffOperator hC hν n) + (L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) (cutoffSmoothedRow hC hν n s))) = _ at he + unfold cutoffK boundaryK + rw [BanachResolvent.apply_eq_add _ hn, inner_add_right, cutoff_row_inner hC hν] + rw [compactSmoothedRow_eq hC hν, row_restrict hC hν] + rw [← he] + ring + +lemma cutoffN_expansion (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (n : ℕ) (s t : Boundary) : + cutoffN hC hν n s t = boundaryInteraction s t + + (∫ x in cutoffSet n, poisson s x * poisson t x ∂ν) + + (∫ x in cutoffSet n, poisson s x * smoothedPoisson (ν := ν.restrict (cutoffSet n)) t x ∂ν) + + inner ℝ (L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) (cutoffSmoothedRow hC hν n s)) + (BanachResolvent.resolvent (cutoffOperator hC hν n) + (L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) (cutoffSmoothedRow hC hν n t))) := by + have hn : ‖weightedIntegralOperator hC (restrictDensity hν (cutoffSet n))‖ < 1 := by + rw [weightedIntegralOperator_restrict hC hν _ (cutoffSet_measurable n)] + exact (L2Cutoff.restrictedOperator_norm_le _ _ _).trans_lt hT + have he := L2Cutoff.resolvent_inner_extension (cutoffSet n) (cutoffSet_measurable n) + (weightedIntegralOperator hC hν) hT + (weightedIntegralOperator hC (restrictDensity hν (cutoffSet n)) + (poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) s)) + (weightedIntegralOperator hC (restrictDensity hν (cutoffSet n)) + (poissonRow (cutoff_ae_norm (ν := ν) n) (cutoffRadius_lt_one n) t)) + rw [← weightedIntegralOperator_restrict hC hν _ (cutoffSet_measurable n)] at he + simp only [compactSmoothedRow_eq hC hν] at he + change inner ℝ (L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) (cutoffSmoothedRow hC hν n s)) + (BanachResolvent.resolvent (cutoffOperator hC hν n) + (L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) (cutoffSmoothedRow hC hν n t))) = _ at he + unfold cutoffN boundaryN + rw [BanachResolvent.inner_two_terms _ hn (weightedIntegralOperator_symmetric hC _), + cutoff_poisson_inner, cutoff_poisson_smoothed_inner hC hν] + simp only [compactSmoothedRow_eq hC hν] + rw [← he] + ring + +omit [IsFiniteMeasure ν] in +lemma cutoffOperator_strong_tendsto (f : Lp ℝ 2 ν) : + Tendsto (fun n => cutoffOperator hC hν n f) atTop (𝓝 (weightedIntegralOperator hC hν f)) := + BanachResolvent.compression_strong_tendsto _ _ + (Eventually.of_forall fun n => L2Cutoff.projection_norm_le (cutoffSet n) (cutoffSet_measurable n)) (cutoffProjection_tendsto hν) f + +lemma cutoff_resolvent_smoothed_tendsto (hT : ‖weightedIntegralOperator hC hν‖ < 1) (s : Boundary) : + Tendsto (fun n => BanachResolvent.resolvent (cutoffOperator hC hν n) + (L2Cutoff.projection (cutoffSet n) (cutoffSet_measurable n) (cutoffSmoothedRow hC hν n s))) + atTop (𝓝 (BanachResolvent.resolvent (weightedIntegralOperator hC hν) (smoothedRow hC hν s))) := by + apply BanachResolvent.resolvent_strong_tendsto_moving _ _ hT hT + (Eventually.of_forall fun n => L2Cutoff.compressedOperator_norm_le _ _ _) + (cutoffOperator_strong_tendsto hC hν) + exact extendedSmoothedRow_tendsto hC hν s + +lemma cutoffK_tendsto (hT : ‖weightedIntegralOperator hC hν‖ < 1) (p : disk) (s : Boundary) : + Tendsto (fun n => cutoffK hC hν n p s) atTop (𝓝 (fullBoundaryK hC hν p s)) := by + have ht := ((tendsto_const_nhds (x := poisson s p)).add + (smoothedPoisson_cutoff_tendsto hC hν s p.property)).add + ((cutoffProjection_tendsto hν (row hC hν p)).inner + (cutoff_resolvent_smoothed_tendsto hC hν hT s)) + simpa only [cutoffK_expansion hC hν hT, fullBoundaryK] using ht + +lemma cutoffN_tendsto (hT : ‖weightedIntegralOperator hC hν‖ < 1) (s t : Boundary) (hst : s ≠ t) : + Tendsto (fun n => cutoffN hC hν n s t) atTop (𝓝 (fullBoundaryN hC hν s t)) := by + have ht := (((tendsto_const_nhds (x := boundaryInteraction s t)).add + (cutoff_integral_tendsto hν (poisson_product_integrable hC hν s t hst))).add + (poisson_smoothed_cutoff_tendsto hC hν s t)).add + ((extendedSmoothedRow_tendsto hC hν s).inner (cutoff_resolvent_smoothed_tendsto hC hν hT t)) + simpa only [cutoffN_expansion hC hν hT, fullBoundaryN] using ht + +end StrictHotSpots.PlaneGreen +end +end CutoffBoundaryLimitsLayer + +section FullBoundaryReciprocalLayer +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + + + +theorem boundary_reciprocal {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) (p : disk) + {ι : Type} [Fintype ι] (s : ι → Boundary) : + ReciprocalKernel.OnePositiveSquare (ReciprocalKernel.bordered + (Matrix.of fun i j => if s i = s j then 0 else (fullBoundaryN hC hν (s i) (s j))⁻¹) + (fun i => (fullBoundaryK hC hν p (s i))⁻¹)) := by + classical + have hn : ‖weightedIntegralOperator hC hν‖ < 1 := + (weightedIntegralOperator_norm_le hC hν hd0 hsub).trans_lt hd1 + let A (n : ℕ) := ReciprocalKernel.bordered + (Matrix.of fun i j => if s i = s j then 0 else (cutoffN hC hν n (s i) (s j))⁻¹) + (fun i => (cutoffK hC hν n p (s i))⁻¹) + have hA n : ReciprocalKernel.OnePositiveSquare (A n) := by + exact boundary_reciprocal_compact_support (cutoff_ae_norm (ν := ν) n) + (cutoffRadius_lt_one n) hC (restrictDensity hν (cutoffSet n)) + (cutoffSet n) (cutoffSet_compact n) (cutoffSet_subset n) + (by rw [Measure.restrict_apply (cutoffSet_measurable n).compl]; simp) + hd0 hd1 (subcritical_restrict hC hν (cutoffSet n) hsub) p s + apply ReciprocalKernel.onePositiveSquare_of_entrywise_tendsto hA + intro i j + rcases i with i | i <;> rcases j with j | j + · by_cases he : s i = s j + · simp [A, ReciprocalKernel.bordered, he] + · simpa only [A, ReciprocalKernel.bordered, Matrix.of_apply, Matrix.fromBlocks_apply₁₁, he, ite_false] using + (cutoffN_tendsto hC hν hn (s i) (s j) he).inv₀ + (fullBoundaryN_pos hC hν hn (s i) (s j) he).ne' + · simpa only [A, ReciprocalKernel.bordered, Matrix.of_apply, Matrix.fromBlocks_apply₁₂] using + (cutoffK_tendsto hC hν hn p (s i)).inv₀ (fullBoundaryK_pos hC hν hn p (s i)).ne' + · simpa only [A, ReciprocalKernel.bordered, Matrix.of_apply, Matrix.fromBlocks_apply₂₁] using + (cutoffK_tendsto hC hν hn p (s j)).inv₀ (fullBoundaryK_pos hC hν hn p (s j)).ne' + · simp [A, ReciprocalKernel.bordered] + + +def fullDistanceKernel (p : disk) (s t : Boundary) : ℝ := + if s = t then 0 else fullBoundaryK hC hν p s * fullBoundaryK hC hν p t / + fullBoundaryN hC hν s t + + + +theorem negative_kernel {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) (p : disk) + {ι : Type} [Fintype ι] (s : ι → Boundary) : + ReciprocalKernel.ConditionallyNegative (Matrix.of fun i j => + fullDistanceKernel hC hν p (s i) (s j)) := by + classical + have hn : ‖weightedIntegralOperator hC hν‖ < 1 := + (weightedIntegralOperator_norm_le hC hν hd0 hsub).trans_lt hd1 + have h := ReciprocalKernel.conditionalNegative_scaled_of_bordered + (fun i => fullBoundaryK hC hν p (s i)) + (fun i => (fullBoundaryK_pos hC hν hn p (s i)).ne') + (boundary_reciprocal hC hν hd0 hd1 hsub p s) + convert h using 1 + ext i j + by_cases he : s i = s j + · simp [fullDistanceKernel, he] + · simp only [fullDistanceKernel, he, ite_false, Matrix.of_apply, div_eq_mul_inv] + ring + +end StrictHotSpots.PlaneGreen +end +end FullBoundaryReciprocalLayer + + + +end FullBoundaryCombinedLayer + +end + +end DouglasLipschitzBase + +section DouglasLipschitzBase +noncomputable section +section FullBoundaryCombinedLayer +section FullBoundaryEmbeddingLayer +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal NNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +lemma fullBoundaryK_bounded (p : disk) : ∃ B : ℝ, 0 ≤ B ∧ ∀ s : Boundary, + fullBoundaryK hC hν p s ≤ B := by + obtain ⟨B,hB,h⟩ := green_poisson_uniform_bound hC hν + let M : ℝ := (measureUnivNNReal ν : ℝ) ^ (2 : ℝ≥0∞).toReal⁻¹ * B + have hM : 0 ≤ M := mul_nonneg (Real.rpow_nonneg (by positivity) _) hB + have hs (s : Boundary) : ‖smoothedRow hC hν s‖ ≤ M := by + apply Lp.norm_le_of_ae_bound hB + filter_upwards [(smoothedPoisson_memLp hC hν s).coeFn_toLp, ae_mem_disk hν] with x hx hxd + rw [show smoothedRow hC hν s x = smoothedPoisson (ν := ν) s x from hx] + exact h x hxd s + let A : ℝ := 1 / (2 * Real.pi * (1 - ‖(p : Plane)‖) ^ 2) + refine ⟨A + B + ‖row hC hν p‖ * ‖BanachResolvent.resolvent (weightedIntegralOperator hC hν)‖ * M, + by dsimp [A]; positivity, fun s => ?_⟩ + unfold fullBoundaryK + apply add_le_add + · apply add_le_add + · exact DiskFormula.poisson_bounded _ _ (by simpa using s.property) + (by simp) (by simpa [disk] using p.property) + · exact (le_abs_self _).trans (h p p.property s) + · calc + _ ≤ ‖row hC hν p‖ * ‖BanachResolvent.resolvent (weightedIntegralOperator hC hν) + (smoothedRow hC hν s)‖ := real_inner_le_norm _ _ + _ ≤ ‖row hC hν p‖ * (‖BanachResolvent.resolvent (weightedIntegralOperator hC hν)‖ * M) := by + gcongr + exact (ContinuousLinearMap.le_opNorm _ _).trans (mul_le_mul_of_nonneg_left (hs s) (norm_nonneg _)) + _ = _ := (mul_assoc _ _ _).symm + +lemma boundaryInteraction_eq_dist (s t : Boundary) : + boundaryInteraction s t = 1 / (Real.pi * dist s t ^ 2) := by + simp only [boundaryInteraction, DiskFormula.boundaryInteraction, ← map_sub, + LinearIsometryEquiv.norm_map, Subtype.dist_eq, dist_eq_norm] + +lemma boundaryInteraction_le_fullBoundaryN (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (s t : Boundary) : boundaryInteraction s t ≤ fullBoundaryN hC hν s t := by + have h1 : 0 ≤ ∫ x, poisson s x * poisson t x ∂ν := by + apply integral_nonneg_of_ae + filter_upwards [ae_mem_disk hν] with x hx + exact mul_nonneg (poisson_nonneg s ⟨x,hx⟩) (poisson_nonneg t ⟨x,hx⟩) + have h2 : 0 ≤ ∫ x, poisson s x * smoothedPoisson (ν := ν) t x ∂ν := by + apply integral_nonneg_of_ae + filter_upwards [ae_mem_disk hν] with x hx + exact mul_nonneg (poisson_nonneg s ⟨x,hx⟩) (smoothedPoisson_nonneg hν t hx) + have h3 := L2Limits.inner_nonneg (smoothedRow_nonneg hC hν s) + (BanachResolvent.resolvent_nonneg _ hT (weightedIntegralOperator_order_nonneg hC hν) + (smoothedRow_nonneg hC hν t)) + unfold fullBoundaryN + linarith + +lemma fullDistanceKernel_pos (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (p : disk) (s t : Boundary) (hst : s ≠ t) : 0 < fullDistanceKernel hC hν p s t := by + rw [fullDistanceKernel, ite_eq_right hst] + exact div_pos (mul_pos (fullBoundaryK_pos hC hν hT p s) (fullBoundaryK_pos hC hν hT p t)) + (fullBoundaryN_pos hC hν hT s t hst) + +lemma fullDistanceKernel_bound (hT : ‖weightedIntegralOperator hC hν‖ < 1) + (p : disk) : ∃ L : ℝ≥0, ∀ s t, fullDistanceKernel hC hν p s t ≤ (L : ℝ)^2 * dist s t ^ 2 := by + obtain ⟨B,hB,hK⟩ := fullBoundaryK_bounded hC hν p + let L : ℝ≥0 := ⟨Real.sqrt Real.pi * B, mul_nonneg (Real.sqrt_nonneg _) hB⟩ + refine ⟨L, fun s t => ?_⟩ + by_cases hst : s = t + · subst t; simp [fullDistanceKernel] + have hd : 0 < dist s t := dist_pos.mpr hst + have hn := boundaryInteraction_le_fullBoundaryN hC hν hT s t + rw [boundaryInteraction_eq_dist] at hn + have hp := fullBoundaryN_pos hC hν hT s t hst + have hkk : fullBoundaryK hC hν p s * fullBoundaryK hC hν p t ≤ B^2 := by + exact (mul_le_mul (hK s) (hK t) (fullBoundaryK_pos hC hν hT p t).le hB).trans_eq (pow_two B).symm + rw [fullDistanceKernel, ite_eq_right hst] + calc + _ ≤ B^2 / fullBoundaryN hC hν s t := div_le_div_of_nonneg_right hkk hp.le + _ ≤ B^2 / (1 / (Real.pi * dist s t ^ 2)) := + div_le_div_of_nonneg_left (sq_nonneg _) (by positivity) hn + _ = (L : ℝ)^2 * dist s t ^ 2 := by + change B^2 / (1 / (Real.pi * dist s t ^ 2)) = + (Real.sqrt Real.pi * B)^2 * dist s t ^ 2 + rw [mul_pow, Real.sq_sqrt Real.pi_pos.le] + field_simp + +lemma fullDistanceKernel_conditionallyNegative {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) (p : disk) : + SquaredDistanceKernel.ConditionallyNegative (Matrix.of (fullDistanceKernel hC hν p)) := by + classical + refine ⟨?_, fun s => by simp [fullDistanceKernel], ?_⟩ + · ext s t + have hh := (negative_kernel hC hν hd0 hd1 hsub p (fun b : Bool => if b then s else t)).1.apply false true + simpa [Matrix.conjTranspose_apply] using hh.symm + · intro c hc + let a : c.support → ℝ := fun i => c i + have ha : (∑ i, a i) = 0 := by + change (∑ i : c.support, c i) = 0 + rw [Finset.sum_coe_sort c.support (fun x : Boundary => c x)] + exact hc + have hh := (negative_kernel hC hν hd0 hd1 hsub p (fun i : c.support => (i : Boundary))).2 a ha + simp only [ReciprocalKernel.pairing, dotProduct, Matrix.mulVec, Matrix.of_apply, + Finset.mul_sum, ← mul_assoc, a] at hh + have he : (∑ i : c.support, ∑ j : c.support, + c i * fullDistanceKernel hC hν p i j * c j) = + c.sum (fun x a => c.sum (fun y b => a * fullDistanceKernel hC hν p x y * b)) := by + calc + _ = ∑ i : c.support, ∑ j ∈ c.support, c i * fullDistanceKernel hC hν p i j * c j := by + apply Finset.sum_congr rfl + intro i _ + exact Finset.sum_coe_sort c.support (fun j => c i * fullDistanceKernel hC hν p i j * c j) + _ = _ := Finset.sum_coe_sort c.support (fun i => + ∑ j ∈ c.support, c i * fullDistanceKernel hC hν p i j * c j) + rw [he] at hh + exact hh + + + +theorem full_boundary_hilbert_embedding {d : ℝ} (hd0 : 0 ≤ d) (hd1 : d < 1) + (hsub : ∀ u : H10 diskOpen, ‖H10.weightedValue diskOpen hC hν u‖ ^ 2 ≤ + d * ‖H10.grad diskOpen u‖ ^ 2) (p : disk) : + ∃ (H : Type) (_ : NormedAddCommGroup H) (_ : InnerProductSpace ℝ H) + (_ : CompleteSpace H) (_ : TopologicalSpace.SeparableSpace H) (b : Boundary → H) (L : ℝ≥0), + Function.Injective b ∧ LipschitzWith L b ∧ + ∀ s t, ‖b s - b t‖ ^ 2 = fullDistanceKernel hC hν p s t := by + have hT : ‖weightedIntegralOperator hC hν‖ < 1 := + (weightedIntegralOperator_norm_le hC hν hd0 hsub).trans_lt hd1 + obtain ⟨L,hL⟩ := fullDistanceKernel_bound hC hν hT p + let o : Boundary := ⟨complexIso 1, by simp⟩ + obtain ⟨H,hn,hi,hc,hs,b,hb,hl,hd⟩ := SquaredDistanceKernel.separable_lipschitz_embedding + (fullDistanceKernel_conditionallyNegative hC hν hd0 hd1 hsub p) o + (fullDistanceKernel_pos hC hν hT p) hL + exact ⟨H,hn,hi,hc,hs,b,L,hb,hl,hd⟩ + +end StrictHotSpots.PlaneGreen +end +end FullBoundaryEmbeddingLayer +end FullBoundaryCombinedLayer + + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Main.lean b/lean/OAI/Analysis/HotSpots/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a4d4d6f29c7a9de7065b17f01d741df3904a1d6 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Main.lean @@ -0,0 +1,89 @@ +import OAI.Analysis.HotSpots.TraceRank + +namespace OAI + +section ActualNoncritical + +noncomputable section +open Set MeasureTheory Filter Metric Function Module +open scoped ENNReal NNReal Topology InnerProductSpace +namespace StrictHotSpots.Conformal.ClosedDiskChart +open PlaneGreen DiskH10 HilbertMultipliers +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + + + + +theorem noncritical_at_disk (hΩ : AdmissibleDomain Ω) + {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) (hne : ∃ x ∈ Ω, u x ≠ 0) + (p : disk) : gradient u (c.F p) ≠ 0 := by + intro hz + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + have hμ := firstPositiveNeumannValue_pos_of_eigenfunction hΩ hu hne + obtain ⟨d,hd,hd1,hsub⟩ := c.subcritical hΩ.2.2.1 hΩ.1 hμ + obtain ⟨H,hN,hI,hC,hS,b,B,hinj,hb,hid⟩ := full_boundary_hilbert_embedding + c.densityBound_ne_top (c.density_bound hμ.le) hd.le hd1 hsub p + let := hN + let := hI + let := hC + let := hS + obtain ⟨I,e,_he⟩ := exists_hilbertBasis ℝ H + let : Countable I := orthonormal_countable e.orthonormal + have hnull := c.coordinate_null_trace hΩ hu hne p hz e hb hid + have hY : ContinuousOn (closedGradient Ω u) (closure Ω) := + closedGradient_continuous hΩ.2.1 hΩ.2.2.2.2 hu.1 + have he : EqOn (gradient u) (closedGradient Ω u) Ω := fun _ hx => (closedGradient_eq hΩ.2.1 hx).symm + let J : closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1 := + ⟨closedEigenJet Ω u (closedGradient Ω u),u,closedGradient Ω u,hu.interior,hu.1.continuousOn,hY,he,rfl⟩ + let T := closedTraceSpace c hΩ + let g : T := ⟨closedGradientTrace c hΩ J,J,rfl⟩ + have hgv (s : Circle) : g.val s = closedGradient Ω u (c.F (circleBoundary s)) := rfl + obtain ⟨hf,hr⟩ := closedTraceSpace_rank c hΩ + let : Module.Finite ℝ T := hf + have hmem (i : I) : (fun s => inner ℝ (e i) (b (circleBoundary s)) • g.val s) ∈ T := by + obtain ⟨v,Y,hv,hvc,hY,hvY,ht⟩ := hnull i + let K : closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1 := + ⟨closedEigenJet Ω v Y,v,Y,hv,hvc,hY,hvY,rfl⟩ + refine ⟨K,?_⟩ + funext s + exact ht (circleBoundary s) + have h0 := multiplier_contradiction e (hb.continuous.comp circleBoundary.continuous) + (hinj.comp circleBoundary.injective) T hr (fun U hU hne => closedTraceSpace_local_rank c hΩ hU hne) + g ((c.closedGradient_trace_continuous hΩ hu).comp circleBoundary.continuous) hmem + apply c.boundary_gradient_not_zero hΩ hu.interior hu.1.continuousOn hY he hne + intro x hx + have hh := congrArg (fun f : T => f.val (c.circleBoundaryHomeomorph.symm ⟨x,hx⟩)) h0 + change closedGradient Ω u + (c.circleBoundaryHomeomorph (c.circleBoundaryHomeomorph.symm ⟨x,hx⟩)) = 0 at hh + simpa only [Homeomorph.apply_symm_apply] using hh + +include c + + +theorem noncritical (hΩ : AdmissibleDomain Ω) + {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) (hne : ∃ x ∈ Ω, u x ≠ 0) : + ∀ x ∈ Ω, gradient u x ≠ 0 := by + intro x hx + have hp : c.G x ∈ disk := by + have hh := c.diskMap.map_target hx + change c.diskMap.symm x ∈ disk at hh + rwa [c.diskMap_inverse_agrees hx] at hh + have hh := c.noncritical_at_disk hΩ hu hne ⟨c.G x,hp⟩ + simpa only [c.right_inverse x (subset_closure hx)] using hh +end StrictHotSpots.Conformal.ClosedDiskChart + +namespace StrictHotSpots + + +theorem main_theorem (Ω : Set Plane) (hΩ : AdmissibleDomain Ω) + (u : Plane → ℝ) (hu : InFirstNeumannEigenspace Ω u) + (hne : ∃ x ∈ Ω, u x ≠ 0) : MainConclusion Ω u := by + obtain ⟨c⟩ := Conformal.exists_closed_disk_chart hΩ + exact strict_boundary_extrema_of_noncritical hΩ.1 hΩ.2.1 hΩ.2.2.1 hu.1.continuousOn + (c.noncritical hΩ hu hne) +end StrictHotSpots +end +end ActualNoncritical + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Multiplicity.lean b/lean/OAI/Analysis/HotSpots/Multiplicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..df204c90d49eecebf8538eb077121a3555e742fa --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Multiplicity.lean @@ -0,0 +1,1440 @@ +import OAI.Analysis.HotSpots.Eigenfunction + +namespace OAI + +section ActualInteriorNodal + +noncomputable section NodalVariationalInteriorLayer +open Set MeasureTheory Filter Metric +open scoped ContDiff InnerProductSpace Topology +namespace StrictHotSpots.InteriorNodal +open StrictHotSpots.Nodal + +lemma minimizer_zero_of_open_zero {Ω : Set Plane} {u : Plane → ℝ} {g : Plane → Plane} + (hΩ : IsOpen Ω) (hc : IsPreconnected Ω) (hb : Bornology.IsBounded Ω) + (hv : 0 < (volume Ω).toReal) (hu : HasH1Gradient Ω u g) + (hm : (∫ x in Ω, u x) = 0) + (he : (∫ x in Ω, ‖g x‖^2) = firstPositiveNeumannValue Ω * (∫ x in Ω, (u x)^2)) + (hz : ∃ a ∈ Ω, ∃ ε > 0, ∀ᵐ x ∂volume, x ∈ ball a ε → u x = 0) : + u =ᵐ[volume.restrict Ω] 0 := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + have hi : IntegrableOn u Ω := hu.1.integrable (by norm_num) + have hp := planeWeakEquation_of_euler hΩ hu (fun v k hvk => + minimizer_euler hb hv hu hvk hm he) + exact (ae_restrict_iff' hΩ.measurableSet).mpr (planeWeak_uniqueContinuation hΩ hc hi hp hz) + +lemma integral_indicator_pos {Ω U : Set Plane} {u : Plane → ℝ} + (_hΩ : IsOpen Ω) (hb : Bornology.IsBounded Ω) (hU : IsOpen U) + (hs : U ⊆ Ω) (hne : U.Nonempty) (hc : ContinuousOn u Ω) + (hu : MemLp u 2 (volume.restrict Ω)) (hp : ∀ x ∈ U, 0 < u x) : + 0 < ∫ x in Ω, U.indicator u x := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + have hi := (hu.indicator hU.measurableSet).integrable (by norm_num : 1 ≤ (2:ENNReal)) + have hn (x : Plane) : 0 ≤ U.indicator u x := by + by_cases hx : x ∈ U + · simpa only [indicator_of_mem hx] using (hp x hx).le + · simp only [indicator_of_notMem hx,le_refl] + have hnn : 0 ≤ ∫ x in Ω, U.indicator u x := integral_nonneg hn + by_contra hf + have hz : (∫ x in Ω, U.indicator u x) = 0 := le_antisymm (le_of_not_gt hf) hnn + have hae := (integral_eq_zero_iff_of_nonneg hn hi).mp hz + have he : u =ᵐ[volume.restrict U] 0 := by + have hh := ae_restrict_of_ae_restrict_of_subset hs hae + filter_upwards [hh,ae_restrict_mem hU.measurableSet] with x hx hxm + simpa only [indicator_of_mem hxm,Pi.zero_apply] using hx + have hh := Measure.eqOn_open_of_ae_eq he hU (hc.mono hs) continuousOn_const + obtain ⟨x,hx⟩ := hne + have hp' := hp x hx + simp only [hh hx,Pi.zero_apply,lt_self_iff_false] at hp' + +lemma restriction_energy {Ω U : Set Plane} {u : Plane → ℝ} + (hu : InInteriorNeumannEigenspace Ω u) + (hH : HasH1Gradient Ω (U.indicator u) (U.indicator (gradient u))) : + (∫ x in Ω, ‖U.indicator (gradient u) x‖^2) = + firstPositiveNeumannValue Ω * (∫ x in Ω, (U.indicator u x)^2) := by + have he := hu.2.2.2 _ _ hH + convert he using 1 + · apply integral_congr_ae + exact Eventually.of_forall fun x => by + by_cases hx : x ∈ U + · simp only [indicator_of_mem hx,real_inner_self_eq_norm_sq] + · simp only [indicator_of_notMem hx,norm_zero,zero_pow (by norm_num : (2:ℕ)≠0),inner_zero_right] + · congr 1 + apply integral_congr_ae + exact Eventually.of_forall fun x => by + by_cases hx : x ∈ U + · simp only [indicator_of_mem hx,pow_two] + · simp only [indicator_of_notMem hx,zero_pow (by norm_num : (2:ℕ)≠0),mul_zero] + +lemma disjoint_indicator_norm_sq {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + {U V : Set Plane} (hd : Disjoint U V) (g : Plane → E) (a b : ℝ) (x : Plane) : + ‖a • U.indicator g x + b • V.indicator g x‖^2 = + a^2 * ‖U.indicator g x‖^2 + b^2 * ‖V.indicator g x‖^2 := by + by_cases hxU : x ∈ U + · have hxV : x ∉ V := fun hxV => Set.disjoint_left.mp hd hxU hxV + simp only [indicator_of_mem hxU,indicator_of_notMem hxV,smul_zero,add_zero,norm_zero, + zero_pow (by norm_num : (2:ℕ)≠0),mul_zero,norm_smul,mul_pow,Real.norm_eq_abs,sq_abs] + · simp only [indicator_of_notMem hxU,smul_zero,zero_add,norm_zero, + zero_pow (by norm_num : (2:ℕ)≠0),mul_zero,norm_smul,mul_pow,Real.norm_eq_abs,sq_abs] + +lemma disjoint_restriction_combination_energy {Ω U V : Set Plane} {u : Plane → ℝ} + (hu : InInteriorNeumannEigenspace Ω u) (hd : Disjoint U V) + (hU : HasH1Gradient Ω (U.indicator u) (U.indicator (gradient u))) + (hV : HasH1Gradient Ω (V.indicator u) (V.indicator (gradient u))) (a b : ℝ) : + (∫ x in Ω, ‖a • U.indicator (gradient u) x + b • V.indicator (gradient u) x‖^2) = + firstPositiveNeumannValue Ω * (∫ x in Ω, (a * U.indicator u x + b * V.indicator u x)^2) := by + have ha : (∫ x in Ω, ‖a • U.indicator (gradient u) x + b • V.indicator (gradient u) x‖^2) = + a^2 * (∫ x in Ω, ‖U.indicator (gradient u) x‖^2) + + b^2 * (∫ x in Ω, ‖V.indicator (gradient u) x‖^2) := by + simp_rw [disjoint_indicator_norm_sq hd] + rw [integral_add (hU.2.1.norm.integrable_sq.const_mul _) (hV.2.1.norm.integrable_sq.const_mul _), + integral_const_mul,integral_const_mul] + have hb : (∫ x in Ω, (a * U.indicator u x + b * V.indicator u x)^2) = + a^2 * (∫ x in Ω, (U.indicator u x)^2) + b^2 * (∫ x in Ω, (V.indicator u x)^2) := by + have he (x : Plane) := disjoint_indicator_norm_sq hd u a b x + simp only [smul_eq_mul,Real.norm_eq_abs,sq_abs] at he + simp_rw [he] + rw [integral_add (hU.1.integrable_sq.const_mul _) (hV.1.integrable_sq.const_mul _), + integral_const_mul,integral_const_mul] + rw [ha,hb,restriction_energy hu hU,restriction_energy hu hV] + ring + +end StrictHotSpots.InteriorNodal + +end NodalVariationalInteriorLayer + + +noncomputable section NodalConnectedInteriorLayer +open Set MeasureTheory Filter Metric +open scoped ContDiff InnerProductSpace Topology +namespace StrictHotSpots.InteriorNodal +open StrictHotSpots.Nodal + +lemma gradient_neg_fun (u : Plane → ℝ) : gradient (-u) = -gradient u := by + funext x + simp only [gradient,Pi.neg_apply,fderiv_neg,map_neg] + +lemma eigenfunction_neg {Ω : Set Plane} {u : Plane → ℝ} + (hu : InInteriorNeumannEigenspace Ω u) : InInteriorNeumannEigenspace Ω (-u) := by + refine ⟨hu.1.neg,?_,?_,?_⟩ + · simpa only [gradient_neg_fun,neg_one_smul] using hu.2.1.smul (-1) + · simp only [Pi.neg_apply,integral_neg,hu.2.2.1,neg_zero] + · intro v g hv + simp only [gradient_neg_fun,Pi.neg_apply,inner_neg_left,neg_mul,integral_neg] + rw [hu.2.2.2 v g hv] + ring + +lemma eigenfunction_has_negative {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : AdmissibleDomain Ω) (hu : InInteriorNeumannEigenspace Ω u) + (hne : ∃ x ∈ Ω, u x ≠ 0) : ∃ x ∈ Ω, u x < 0 := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hΩ.2.2.1.measure_lt_top.ne + by_contra hn + push Not at hn + have hae : 0 ≤ᵐ[volume.restrict Ω] u := + (ae_restrict_iff' hΩ.2.1.measurableSet).mpr (Eventually.of_forall hn) + have hz := (integral_eq_zero_iff_of_nonneg_ae hae (hu.2.1.1.integrable (by norm_num))).mp hu.2.2.1 + have hall := Measure.eqOn_open_of_ae_eq hz hΩ.2.1 hu.1.continuousOn continuousOn_const + obtain ⟨x,hx,hux⟩ := hne + exact hux (hall hx) + +lemma eigenfunction_has_positive {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : AdmissibleDomain Ω) (hu : InInteriorNeumannEigenspace Ω u) + (hne : ∃ x ∈ Ω, u x ≠ 0) : ∃ x ∈ Ω, 0 < u x := by + have hn : ∃ x ∈ Ω, (-u) x ≠ 0 := by + obtain ⟨x,hx,hux⟩ := hne + exact ⟨x,hx,by simpa only [Pi.neg_apply,neg_ne_zero] using hux⟩ + obtain ⟨x,hx,hux⟩ := eigenfunction_has_negative hΩ (eigenfunction_neg hu) hn + exact ⟨x,hx,by simpa only [Pi.neg_apply,neg_lt_zero] using hux⟩ + +lemma no_two_positive_regions {Ω U V : Set Plane} {u : Plane → ℝ} + (hΩ : AdmissibleDomain Ω) (hu : InInteriorNeumannEigenspace Ω u) + (hU : IsOpen U) (hV : IsOpen V) (hsU : U ⊆ Ω) (hsV : V ⊆ Ω) + (hnU : U.Nonempty) (hnV : V.Nonempty) (hd : Disjoint U V) + (hpU : ∀ x ∈ U, 0 < u x) (hpV : ∀ x ∈ V, 0 < u x) + (hhU : HasH1Gradient Ω (U.indicator u) (U.indicator (gradient u))) + (hhV : HasH1Gradient Ω (V.indicator u) (V.indicator (gradient u))) + (hneg : ∃ x ∈ Ω, u x < 0) : False := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hΩ.2.2.1.measure_lt_top.ne + let A := ∫ x in Ω, U.indicator u x + let B := ∫ x in Ω, V.indicator u x + have hB : 0 < B := integral_indicator_pos hΩ.2.1 hΩ.2.2.1 hV hsV hnV + hu.1.continuousOn hu.2.1.1 hpV + let w := B • U.indicator u + (-A) • V.indicator u + let g := B • U.indicator (gradient u) + (-A) • V.indicator (gradient u) + have hw : HasH1Gradient Ω w g := (hhU.smul B).add (hhV.smul (-A)) + have hm : (∫ x in Ω, w x) = 0 := by + change (∫ x in Ω, B * U.indicator u x + (-A) * V.indicator u x) = 0 + rw [integral_add ((hhU.1.integrable (by norm_num)).const_mul B) + ((hhV.1.integrable (by norm_num)).const_mul (-A)),integral_const_mul,integral_const_mul] + change B*A+(-A)*B=0 + ring + have he : (∫ x in Ω, ‖g x‖^2) = firstPositiveNeumannValue Ω * (∫ x in Ω, (w x)^2) := + disjoint_restriction_combination_energy hu hd hhU hhV B (-A) + have hz : ∃ a ∈ Ω, ∃ ε > 0, ∀ᵐ x ∂volume, x ∈ ball a ε → w x = 0 := by + obtain ⟨a,ha,han⟩ := hneg + have haU : {x | u x < 0} ∈ 𝓝 a := + (hu.1.continuousOn a ha).continuousAt (hΩ.2.1.mem_nhds ha) |>.eventually (gt_mem_nhds han) + obtain ⟨ε,hε,he⟩ := Metric.mem_nhds_iff.mp haU + refine ⟨a,ha,ε,hε,Eventually.of_forall fun x hx => ?_⟩ + have hn : u x < 0 := he hx + have hxu : x ∉ U := fun hxu => (not_lt_of_ge (hpU x hxu).le) hn + have hxv : x ∉ V := fun hxv => (not_lt_of_ge (hpV x hxv).le) hn + simp only [w,Pi.add_apply,Pi.smul_apply,indicator_of_notMem hxu,indicator_of_notMem hxv,smul_zero,add_zero] + have hv : 0 < (volume Ω).toReal := ENNReal.toReal_pos + (ne_of_gt (hΩ.2.1.measure_pos volume hΩ.1)) hΩ.2.2.1.measure_lt_top.ne + have hall := minimizer_zero_of_open_zero hΩ.2.1 + hΩ.2.2.2.1.isPathConnected.isConnected.isPreconnected hΩ.2.2.1 hv hw hm he hz + have hvu : (fun x => B * u x) =ᵐ[volume.restrict U] 0 := by + filter_upwards [ae_restrict_of_ae_restrict_of_subset hsU hall,ae_restrict_mem hU.measurableSet] with x hx hxm + have hxv : x ∉ V := fun hxv => Set.disjoint_left.mp hd hxm hxv + simpa only [w,Pi.add_apply,Pi.smul_apply,indicator_of_mem hxm,indicator_of_notMem hxv, + smul_zero,add_zero,smul_eq_mul,mul_zero] using hx + have hcont : ContinuousOn (fun x => B*u x) U := + continuousOn_const.mul (hu.1.continuousOn.mono hsU) + have hh := Measure.eqOn_open_of_ae_eq hvu hU hcont continuousOn_const + obtain ⟨x,hx⟩ := hnU + have hp := mul_pos hB (hpU x hx) + have hzero : B*u x = 0 := hh hx + linarith + + + +lemma positive_set_connected {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : AdmissibleDomain Ω) (hu : InInteriorNeumannEigenspace Ω u) + (hne : ∃ x ∈ Ω, u x ≠ 0) : IsConnected (Ω ∩ {x | 0 < u x}) := by + let P := Ω ∩ {x | 0 < u x} + have hopen : IsOpen P := positive_set_open hΩ.2.1 hu.1.continuousOn + obtain ⟨a,ha,hua⟩ := eigenfunction_has_positive hΩ hu hne + have hap : a ∈ P := ⟨ha,hua⟩ + have heq : P = connectedComponentIn P a := by + apply subset_antisymm _ (connectedComponentIn_subset P a) + intro b hb + by_contra hba + let U := connectedComponentIn P a + let V := connectedComponentIn P b + have hd : Disjoint U V := by + apply Set.disjoint_left.mpr + intro x hxU hxV + have heq : U = V := (connectedComponentIn_eq hxU).trans (connectedComponentIn_eq hxV).symm + have hbV : b ∈ V := mem_connectedComponentIn hb + have hbU : b ∈ U := heq.symm ▸ hbV + exact hba hbU + exact no_two_positive_regions hΩ hu hopen.connectedComponentIn hopen.connectedComponentIn + ((connectedComponentIn_subset P a).trans inter_subset_left) + ((connectedComponentIn_subset P b).trans inter_subset_left) + ⟨a,mem_connectedComponentIn hap⟩ ⟨b,mem_connectedComponentIn hb⟩ hd + (fun x hx => (connectedComponentIn_subset P a hx).2) + (fun x hx => (connectedComponentIn_subset P b hx).2) + (positive_component_hasH1Gradient hΩ.2.1 hu.1 hu.2.1 a) + (positive_component_hasH1Gradient hΩ.2.1 hu.1 hu.2.1 b) + (eigenfunction_has_negative hΩ hu hne) + rw [show Ω ∩ {x | 0 < u x} = P from rfl,heq] + exact isConnected_connectedComponentIn_iff.mpr hap + +lemma negative_set_connected {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : AdmissibleDomain Ω) (hu : InInteriorNeumannEigenspace Ω u) + (hne : ∃ x ∈ Ω, u x ≠ 0) : IsConnected (Ω ∩ {x | u x < 0}) := by + have hn : ∃ x ∈ Ω, (-u) x ≠ 0 := by + obtain ⟨x,hx,hux⟩ := hne + exact ⟨x,hx,by simpa only [Pi.neg_apply,neg_ne_zero] using hux⟩ + simpa only [Pi.neg_apply,neg_pos] using positive_set_connected hΩ (eigenfunction_neg hu) hn + +end StrictHotSpots.InteriorNodal + +end NodalConnectedInteriorLayer + +end ActualInteriorNodal + +section ActualInteriorBoundarySign + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ContDiff InnerProductSpace ENNReal +namespace StrictHotSpots.InteriorBoundarySign +open StrictHotSpots.BoundarySign +variable {Ω : Set Plane} {u : Plane → ℝ} +lemma gap_test (ho : IsOpen Ω) (hu : InInteriorNeumannEigenspace Ω u) (hc : ContinuousOn u (closure Ω)) + (hbound : Bornology.IsBounded Ω) (hb : ∀ x ∈ frontier Ω, u x ≤ 0) + {lam : ℝ} (hg : ∀ v : H10 ho, lam * ‖H10.value ho v‖^2 ≤ ‖H10.grad ho v‖^2) + (n : ℕ) : + lam * (∫ x in Ω, (Nodal.cutoff n (u x))^2) ≤ + ∫ x in Ω, (deriv (Nodal.cutoff n) (u x))^2 * ‖gradient u x‖^2 := by + let f := test_interior ho hu.1 hc hbound hb n + have hh := hg (smoothTestToH10 ho f) + change lam * ‖(HasH1Gradient.test ho f.property.1 f.property.2.1).1.toLp f.val‖^2 ≤ + ‖(HasH1Gradient.test ho f.property.1 f.property.2.1).2.1.toLp (gradient f.val)‖^2 at hh + rw [← real_inner_self_eq_norm_sq, ← real_inner_self_eq_norm_sq, + L2Inner.toLp_pair,L2Inner.toLp_pair] at hh + have hval : (∫ x in Ω, inner ℝ (f.val x) (f.val x)) = ∫ x in Ω, (Nodal.cutoff n (u x))^2 := by + apply setIntegral_congr_fun ho.measurableSet + intro x hx + simp only [f,test_interior,cut,indicator_of_mem hx,RCLike.inner_apply,conj_trivial,pow_two] + have hgrad : (∫ x in Ω, inner ℝ (gradient f.val x) (gradient f.val x)) = + ∫ x in Ω, (deriv (Nodal.cutoff n) (u x))^2 * ‖gradient u x‖^2 := by + apply setIntegral_congr_fun ho.measurableSet + intro x hx + dsimp only + rw [real_inner_self_eq_norm_sq] + change ‖gradient (cut Ω u n) x‖^2 = _ + rw [cut_gradient_interior ho hu.1 n hx,norm_smul,mul_pow,Real.norm_eq_abs,sq_abs] + rwa [hval,hgrad] at hh + +lemma equation_test (ho : IsOpen Ω) (hu : InInteriorNeumannEigenspace Ω u) (hc : ContinuousOn u (closure Ω)) + (hbound : Bornology.IsBounded Ω) (hb : ∀ x ∈ frontier Ω, u x ≤ 0) (n : ℕ) : + (∫ x in Ω, deriv (Nodal.cutoff n) (u x) * ‖gradient u x‖^2) = + firstPositiveNeumannValue Ω * (∫ x in Ω, u x * Nodal.cutoff n (u x)) := by + let f := test_interior ho hu.1 hc hbound hb n + have hh := hu.2.2.2 f.val (gradient f.val) (HasH1Gradient.test ho f.property.1 f.property.2.1) + convert hh using 1 + · apply setIntegral_congr_fun ho.measurableSet + intro x hx + change _ = inner ℝ (gradient u x) (gradient (cut Ω u n) x) + rw [cut_gradient_interior ho hu.1 n hx,inner_smul_right,real_inner_self_eq_norm_sq] + · congr 1 + apply setIntegral_congr_fun ho.measurableSet + intro x hx + simp only [f,test_interior,cut,indicator_of_mem hx] +lemma positivePart_square (t : ℝ) : (if 0 < t then t^2 else 0) = (max t 0)^2 := by + by_cases h : 0 < t + · rw [ite_eq_left h,max_eq_left h.le] + · rw [ite_eq_right h,max_eq_right (le_of_not_gt h),zero_pow (by decide : 2 ≠ 0)] +lemma positivePart_memLp (hu : MemLp u 2 (volume.restrict Ω)) : + MemLp (fun x => max (u x) 0) 2 (volume.restrict Ω) := by + apply hu.mono (((continuous_id.max continuous_const : Continuous (fun t : ℝ => max t 0))).comp_aestronglyMeasurable hu.aestronglyMeasurable) + exact Eventually.of_forall fun x => by + change ‖max (u x) 0‖ ≤ ‖u x‖ + by_cases h : 0 ≤ u x + · rw [max_eq_left h] + · rw [max_eq_right (le_of_not_ge h),norm_zero] + exact norm_nonneg _ + + + + +lemma nonpos_of_boundary_nonpos (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hbound : Bornology.IsBounded Ω) (hu : InInteriorNeumannEigenspace Ω u) (hc : ContinuousOn u (closure Ω)) + (hb : ∀ x ∈ frontier Ω, u x ≤ 0) : ∀ x ∈ Ω, u x ≤ 0 := by + obtain ⟨lam,_hl,hgap,hDir⟩ := H10.subcritical ho hne hbound + let M := ∫ x in Ω, if 0 < u x then (u x)^2 else 0 + let E := ∫ x in Ω, if 0 < u x then ‖gradient u x‖^2 else 0 + have hIg : Integrable (fun x => ‖gradient u x‖^2) (volume.restrict Ω) := + hu.2.1.2.1.integrable_norm_pow (by norm_num) + have hM := Nodal.cutoff_square_integral hu.2.1.1 + have hE := Nodal.cutoff_deriv_square_integral hu.2.1.1.aestronglyMeasurable hIg (fun x => sq_nonneg _) + have hi : lam * M ≤ E := le_of_tendsto_of_tendsto + (hM.const_mul lam) hE (Eventually.of_forall (gap_test ho hu hc hbound hb hDir)) + have hD := Nodal.cutoff_deriv_integral hu.2.1.1.aestronglyMeasurable hIg (fun x => sq_nonneg _) + have hP := Nodal.cutoff_product_integral hu.2.1.1 + have he : E = firstPositiveNeumannValue Ω * M := by + apply tendsto_nhds_unique hD + apply (hP.const_mul (firstPositiveNeumannValue Ω)).congr + intro n + exact (equation_test ho hu hc hbound hb n).symm + have hMn : 0 ≤ M := integral_nonneg fun x => by split_ifs <;> positivity + have hMz : M = 0 := by nlinarith + have hMz' : (∫ x in Ω, (max (u x) 0)^2) = 0 := by + simpa only [M,positivePart_square] using hMz + have hz := (integral_eq_zero_iff_of_nonneg (fun x => sq_nonneg _) (positivePart_memLp hu.2.1.1).integrable_sq).mp hMz' + have hae : (fun x => max (u x) 0) =ᵐ[volume.restrict Ω] 0 := by + filter_upwards [hz] with x hx + exact eq_zero_of_pow_eq_zero hx + have hall := Measure.eqOn_open_of_ae_eq hae ho + ((continuous_id.max continuous_const : Continuous (fun t : ℝ => max t 0)).comp_continuousOn + hu.1.continuousOn) continuousOn_const + intro x hx + exact (le_max_left (u x) 0).trans (le_of_eq (hall hx)) + +lemma zero_of_boundary_nonpos (ho : IsOpen Ω) (hne : Ω.Nonempty) + (hbound : Bornology.IsBounded Ω) (hu : InInteriorNeumannEigenspace Ω u) (hc : ContinuousOn u (closure Ω)) + (hb : ∀ x ∈ frontier Ω, u x ≤ 0) : ∀ x ∈ Ω, u x = 0 := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hbound.measure_lt_top.ne + have hnp := nonpos_of_boundary_nonpos ho hne hbound hu hc hb + have hn : 0 ≤ᵐ[volume.restrict Ω] -u := by + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + simpa only [Pi.neg_apply,Pi.zero_apply,neg_nonneg] using hnp x hx + have hm : (∫ x in Ω, (-u) x) = 0 := by + simp only [Pi.neg_apply,integral_neg,hu.2.2.1,neg_zero] + have hz := (integral_eq_zero_iff_of_nonneg_ae hn (hu.2.1.1.neg.integrable (by norm_num))).mp hm + have hae : u =ᵐ[volume.restrict Ω] 0 := by + filter_upwards [hz] with x hx + simpa only [Pi.neg_apply,Pi.zero_apply,neg_eq_zero] using hx + exact fun x hx => Measure.eqOn_open_of_ae_eq hae ho + hu.1.continuousOn continuousOn_const hx + +lemma exists_boundary_pos (ho : IsOpen Ω) (hbound : Bornology.IsBounded Ω) + (hu : InInteriorNeumannEigenspace Ω u) (hc : ContinuousOn u (closure Ω)) (hne : ∃ x ∈ Ω, u x ≠ 0) : + ∃ x ∈ frontier Ω, 0 < u x := by + by_contra hn + push Not at hn + obtain ⟨x,hx,hux⟩ := hne + exact hux (zero_of_boundary_nonpos ho ⟨x,hx⟩ hbound hu hc hn x hx) +lemma eigen_neg (hu : InInteriorNeumannEigenspace Ω u) : InInteriorNeumannEigenspace Ω (-u) := by + have hg : gradient (-u) = -gradient u := by + funext x + simp only [gradient,Pi.neg_apply,fderiv_neg,map_neg] + refine ⟨hu.1.neg,?_,?_,?_⟩ + · simpa only [hg,neg_one_smul] using hu.2.1.smul (-1) + · simp only [Pi.neg_apply,integral_neg,hu.2.2.1,neg_zero] + · intro v g hv + simp only [hg,Pi.neg_apply,inner_neg_left,neg_mul,integral_neg] + rw [hu.2.2.2 v g hv] + ring +lemma exists_boundary_neg (ho : IsOpen Ω) (hbound : Bornology.IsBounded Ω) + (hu : InInteriorNeumannEigenspace Ω u) (hc : ContinuousOn u (closure Ω)) (hne : ∃ x ∈ Ω, u x ≠ 0) : + ∃ x ∈ frontier Ω, u x < 0 := by + have hn : ∃ x ∈ Ω, (-u) x ≠ 0 := by + obtain ⟨x,hx,hux⟩ := hne + exact ⟨x,hx,by simpa only [Pi.neg_apply,neg_ne_zero] using hux⟩ + obtain ⟨x,hx,hux⟩ := exists_boundary_pos ho hbound (eigen_neg hu) hc.neg hn + exact ⟨x,hx,by simpa only [Pi.neg_apply,neg_pos] using hux⟩ + +end StrictHotSpots.InteriorBoundarySign +end +end ActualInteriorBoundarySign + +section MultiplicityComplete + +noncomputable section + +section PositiveWeightLayer +open Set Filter MeasureTheory Function +open scoped Topology InnerProductSpace +namespace StrictHotSpots.PositiveWeight +variable {X E : Type*} [TopologicalSpace X] [CompactSpace X] [Nonempty X] + [MeasurableSpace X] [OpensMeasurableSpace X] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + (μ : Measure X) [IsFiniteMeasure μ] + +omit [Nonempty X] in +lemma continuous_integrable {G : Type*} [NormedAddCommGroup G] (f : C(X,G)) : Integrable f μ := + f.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + +omit [Nonempty X] [FiniteDimensional ℝ E] in +lemma product_integrable (F : C(X,E)) (f : C(X,ℝ)) : Integrable (fun s => f s • F s) μ := + (f.continuous.smul F.continuous).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + +def momentLinear (F : C(X,E)) : C(X,ℝ) →ₗ[ℝ] E where + toFun f := ∫ s, f s • F s ∂μ + map_add' f g := by + simp only [ContinuousMap.add_apply,add_smul] + exact integral_add (product_integrable μ F f) (product_integrable μ F g) + map_smul' a f := by + simp only [ContinuousMap.smul_apply,smul_eq_mul,mul_smul,integral_smul,RingHom.id_apply] + +def moment (F : C(X,E)) : C(X,ℝ) →L[ℝ] E := + (momentLinear μ F).mkContinuous (‖F‖ * μ.real univ) (fun f => by + have hh := norm_integral_le_of_norm_le_const (μ := μ) + (Eventually.of_forall fun s => show ‖f s • F s‖ ≤ ‖f‖*‖F‖ by + rw [norm_smul] + exact mul_le_mul (f.norm_coe_le_norm s) (F.norm_coe_le_norm s) (norm_nonneg _) (norm_nonneg _)) + change ‖∫ s, f s • F s ∂μ‖ ≤ _ + nlinarith only [hh]) +omit [Nonempty X] [FiniteDimensional ℝ E] in +lemma moment_apply (F : C(X,E)) (f : C(X,ℝ)) : moment μ F f = ∫ s, f s • F s ∂μ := rfl + +def probe (F : C(X,E)) : E →ₗ[ℝ] C(X,ℝ) where + toFun a := ⟨fun s => inner ℝ a (F s),continuous_const.inner F.continuous⟩ + map_add' a b := by + ext s + change inner ℝ (a+b) (F s) = inner ℝ a (F s) + inner ℝ b (F s) + exact inner_add_left _ _ _ + map_smul' c a := by + ext s + change inner ℝ (c • a) (F s) = c * inner ℝ a (F s) + simp only [inner_smul_left,conj_trivial] + +omit [Nonempty X] in +lemma dual_moment (F : C(X,E)) (f : C(X,ℝ)) (l : E →L[ℝ] ℝ) : + l (moment μ F f) = ∫ s, f s * l (F s) ∂μ := by + rw [moment_apply,← l.integral_comp_comm (product_integrable μ F f)] + congr 1 + funext s + exact l.map_smul (f s) (F s) + +omit [Nonempty X] in +lemma integral_sq_pos [μ.IsOpenPosMeasure] (f : C(X,ℝ)) (hf : ∃ x, f x ≠ 0) : + 0 < ∫ s, (f s)^2 ∂μ := by + have hn : 0 ≤ ∫ s, (f s)^2 ∂μ := integral_nonneg fun _ => sq_nonneg _ + by_contra hp + have hz : (∫ s, (f s)^2 ∂μ) = 0 := le_antisymm (le_of_not_gt hp) hn + have hi : Integrable (fun s => (f s)^2) μ := + (f.continuous.pow 2).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + have ha := (integral_eq_zero_iff_of_nonneg (fun _ => sq_nonneg _) hi).mp hz + have hae : f =ᵐ[μ.restrict univ] (0 : X → ℝ) := by + rw [Measure.restrict_univ] + filter_upwards [ha] with x hx + exact eq_zero_of_pow_eq_zero hx + have he := Measure.eqOn_open_of_ae_eq hae isOpen_univ f.continuous.continuousOn continuousOn_const + obtain ⟨x,hx⟩ := hf + exact hx (he (mem_univ x)) + +omit [Nonempty X] in +lemma moment_surjective [μ.IsOpenPosMeasure] (F : C(X,E)) + (hF : ∀ a : E, a ≠ 0 → ∃ s, 0 < inner ℝ a (F s)) : Surjective (moment μ F) := by + let G : E →ₗ[ℝ] E := (moment μ F).toLinearMap.comp (probe F) + have hz (a : E) (ha : G a = 0) : a = 0 := by + by_contra hn + obtain ⟨s,hs⟩ := hF a hn + have hp := integral_sq_pos μ (probe F a) ⟨s,ne_of_gt hs⟩ + have he := dual_moment μ F (probe F a) (innerSL ℝ a) + have hv : (∫ s, (probe F a s)^2 ∂μ) = 0 := by + change inner ℝ a (G a) = ∫ s, inner ℝ a (F s) * inner ℝ a (F s) ∂μ at he + rw [ha,inner_zero_right] at he + simpa only [probe,LinearMap.coe_mk,AddHom.coe_mk,ContinuousMap.coe_mk,pow_two] using he.symm + linarith + have hi : Injective G := by + intro a b hab + apply sub_eq_zero.mp + apply hz + rw [map_sub,hab,sub_self] + intro a + obtain ⟨b,hb⟩ := G.surjective_of_injective hi a + exact ⟨probe F b,hb⟩ + +def positive : Set C(X,ℝ) := {f | ∀ s, 0 < f s} +omit [CompactSpace X] [Nonempty X] [MeasurableSpace X] [OpensMeasurableSpace X] in +lemma positive_convex : Convex ℝ (positive (X := X)) := by + intro f hf g hg a b ha hb hab s + change 0 < a * f s + b * g s + by_cases hza : a = 0 + · have hbo : b = 1 := by linarith + simpa [hza,hbo] using hg s + · exact add_pos_of_pos_of_nonneg (mul_pos (lt_of_le_of_ne ha (Ne.symm hza)) (hf s)) + (mul_nonneg hb (hg s).le) +omit [MeasurableSpace X] [OpensMeasurableSpace X] in +lemma positive_open : IsOpen (positive (X := X)) := by + rw [Metric.isOpen_iff] + intro f hf + obtain ⟨x,_,hx⟩ := isCompact_univ.exists_isMinOn (univ_nonempty : (univ : Set X).Nonempty) f.continuous.continuousOn + refine ⟨f x,hf x,?_⟩ + intro g hg s + have hd : |g s-f s| < f x := by + rw [← Real.dist_eq] + exact (ContinuousMap.dist_apply_le_dist s).trans_lt hg + have hm : f x ≤ f s := hx (mem_univ s) + have hl := (abs_lt.mp hd).1 + linarith + + + + +theorem exists_positive_annihilator [μ.IsOpenPosMeasure] (F : C(X,E)) + (hF : ∀ a : E, a ≠ 0 → ∃ s, 0 < inner ℝ a (F s)) : + ∃ w : C(X,ℝ), (∀ s, 0 < w s) ∧ (∫ s, w s • F s ∂μ) = 0 := by + let T := moment μ F + have hT : Surjective T := moment_surjective μ F hF + have ho : IsOpen (T '' positive) := T.isOpenMap hT _ positive_open + have hc : Convex ℝ (T '' positive) := positive_convex.linear_image T.toLinearMap + have hz : (0:E) ∈ T '' positive := by + by_contra hn + obtain ⟨l,hl⟩ := geometric_hahn_banach_open_point hc ho hn + let one : C(X,ℝ) := ContinuousMap.const X 1 + have hone : one ∈ positive := fun _ => zero_lt_one + have hnegative (f : C(X,ℝ)) (hf : f ∈ positive) : l (T f) < 0 := by + simpa only [map_zero] using hl (T f) ⟨f,hf,rfl⟩ + have hl0 : l ≠ 0 := by + intro he + have h := hnegative one hone + rw [he] at h + exact (lt_irrefl (0:ℝ)) h + let a : E := (InnerProductSpace.toDual ℝ E).symm l + have ha : a ≠ 0 := by + intro hz + have he := congrArg (InnerProductSpace.toDual ℝ E) hz + simp only [a,LinearIsometryEquiv.apply_symm_apply,map_zero] at he + exact hl0 he + obtain ⟨s,hs⟩ := hF a ha + have hla : ∀ x, l (F x) = inner ℝ a (F x) := by + intro x + exact congrArg (fun k : E →L[ℝ] ℝ => k (F x)) + ((InnerProductSpace.toDual ℝ E).apply_symm_apply l).symm + let q : C(X,ℝ) := ⟨fun x => max (l (F x)) 0,(l.continuous.comp F.continuous).max continuous_const⟩ + have hqnonneg (x : X) : 0 ≤ q x := le_max_right _ _ + have hqpos : 0 < q s := lt_of_lt_of_le (by rwa [hla s]) (le_max_left _ _) + let A := ∫ x, (q x)^2 ∂μ + have hA : 0 < A := integral_sq_pos μ q ⟨s,ne_of_gt hqpos⟩ + have he : l (T q) = A := by + rw [show T q = moment μ F q from rfl,dual_moment] + apply integral_congr_ae + exact Eventually.of_forall fun x => by + change max (l (F x)) 0 * l (F x) = (max (l (F x)) 0)^2 + by_cases h : 0 ≤ l (F x) + · rw [max_eq_left h,pow_two] + · rw [max_eq_right (le_of_not_ge h),zero_mul,zero_pow (by decide : 2 ≠ 0)] + let B := l (T one) + let c := (|B|+1)/A + have hcpos : 0 < c := div_pos (by positivity) hA + let f := one + c • q + have hf : f ∈ positive := by + intro x + change 0 < 1 + c * q x + linarith [mul_nonneg hcpos.le (hqnonneg x)] + have hbad := hnegative f hf + have hval : l (T f) = B + (|B|+1) := by + simp only [f,map_add,map_smul,smul_eq_mul,he] + change B + c*A = B+(|B|+1) + dsimp only [c] + rw [div_mul_cancel₀ _ hA.ne'] + rw [hval] at hbad + linarith [neg_abs_le B] + obtain ⟨w,hw,he⟩ := hz + exact ⟨w,hw,he⟩ +end StrictHotSpots.PositiveWeight +end PositiveWeightLayer + +section CirclePositiveWeightLayer +open Set MeasureTheory +open scoped Topology InnerProductSpace +namespace StrictHotSpots.PositiveWeight +local instance : Fact (0 < 2*Real.pi) := ⟨Real.two_pi_pos⟩ +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + + +theorem exists_circle_weight (F : C(Circle,E)) + (hF : ∀ a : E, a ≠ 0 → ∃ s, 0 < inner ℝ a (F s)) : + ∃ w : ℝ → ℝ, Continuous w ∧ Function.Periodic w (2*Real.pi) ∧ + (∀ θ, 0 < w θ) ∧ ∀ a : E, + (∫ θ in (0:ℝ)..2*Real.pi, w θ*inner ℝ a (F (Circle.exp θ))) = 0 := by + let G : C(AddCircle (2*Real.pi),E) := F.comp ⟨AddCircle.homeomorphCircle',AddCircle.homeomorphCircle'.continuous⟩ + have hG (a : E) (ha : a ≠ 0) : ∃ s, 0 < inner ℝ a (G s) := by + obtain ⟨s,hs⟩ := hF a ha + refine ⟨AddCircle.homeomorphCircle'.symm s,?_⟩ + change 0 < inner ℝ a (F (AddCircle.homeomorphCircle' (AddCircle.homeomorphCircle'.symm s))) + rwa [Homeomorph.apply_symm_apply] + obtain ⟨w,hw,he⟩ := exists_positive_annihilator (volume : Measure (AddCircle (2*Real.pi))) G hG + let W : ℝ → ℝ := fun θ => w (θ : AddCircle (2*Real.pi)) + refine ⟨W,w.continuous.comp (AddCircle.continuous_mk' (2*Real.pi)),?_,fun θ => hw _,?_⟩ + · intro θ + exact congrArg w (AddCircle.coe_add_period (2*Real.pi) θ) + · intro a + have hh := dual_moment (volume : Measure (AddCircle (2*Real.pi))) G w (innerSL ℝ a) + rw [moment_apply,he,map_zero] at hh + have hI := AddCircle.intervalIntegral_preimage (2*Real.pi) 0 + (fun s : AddCircle (2*Real.pi) => w s*inner ℝ a (G s)) + simp only [zero_add] at hI + simpa only [W,G,ContinuousMap.comp_apply,ContinuousMap.coe_mk, + AddCircle.homeomorphCircle'_apply_mk] using hI.trans hh.symm +end StrictHotSpots.PositiveWeight +end CirclePositiveWeightLayer + +section PlanarCrossingLayer + + +open Set Filter _root_.Complex _root_.OAI.Complex Metric +open scoped unitInterval Topology ComplexConjugate +namespace StrictHotSpots.PlanarTopology + +private lemma boundary_halfPlane {x b : ℂ} (hx : ‖x‖ ≤ 1) (hb : ‖b‖ = 1) + (hne : x ≠ b) : 0 < ((x-b)*(-conj b)).re := by + have hx' : normSq x ≤ 1 := by rw [normSq_eq_norm_sq]; nlinarith [norm_nonneg x] + have hb' : normSq b = 1 := by rw [normSq_eq_norm_sq,hb]; norm_num + have hd : 0 < normSq (x-b) := normSq_pos.mpr (sub_ne_zero.mpr hne) + simp only [normSq_apply,sub_re,sub_im] at hx' hb' hd + simp only [mul_re,sub_re,sub_im,neg_re,neg_im,conj_re,conj_im] + nlinarith + +private lemma log_difference {P : C(unitInterval,ℂ)} {b : ℂ} + (hP : ∀ s, ‖P s‖ ≤ 1) (hb : ‖b‖ = 1) (hne : ∀ s, P s ≠ b) + {l : C(unitInterval,ℂ)} (hl : ∀ s, exp (l s) = P s-b) : + l 1-l 0 = log ((P 1-b)*(-conj b))-log ((P 0-b)*(-conj b)) := by + let w : unitInterval → ℂ := fun s => (P s-b)*(-conj b) + have hw : Continuous w := by dsimp [w]; fun_prop + have hwpos (s) : 0 < (w s).re := boundary_halfPlane (hP s) hb (hne s) + have hws (s) : w s ∈ slitPlane := mem_slitPlane_iff.mpr (Or.inl (hwpos s)) + have hwn (s) : w s ≠ 0 := fun h => by simpa [h] using hwpos s + have hc : Continuous (fun s => log (w s)-log (w 0)+l 0) := + ((hw.clog hws).sub continuous_const).add continuous_const + have he (s) : exp (log (w s)-log (w 0)+l 0) = exp (l s) := by + rw [exp_add,exp_sub,exp_log (hwn s),exp_log (hwn 0),hl s,hl 0] + dsimp [w] + have hb0 : -conj b ≠ 0 := neg_ne_zero.mpr ((map_ne_zero (starRingEnd ℂ)).mpr (by intro h; simp [h] at hb)) + field_simp [sub_ne_zero.mpr (hne 0),neg_ne_zero.mp hb0] + have eqfun : (fun s => log (w s)-log (w 0)+l 0) = l := by + exact isCoveringMap_exp.eq_of_comp_eq hc l.continuous + (funext fun s => Subtype.ext (he s)) 0 (by simp) + have heq := congrFun eqfun 1 + dsimp [w] at heq + linear_combination -heq + +private lemma square_log {P N : C(unitInterval,ℂ)} (hne : ∀ s t, P s ≠ N t) : + ∃ L : C(unitInterval × unitInterval,ℂ), ∀ s t, exp (L (s,t)) = P s-N t := by + let : ContractibleSpace unitInterval := (convex_Icc (0:ℝ) 1).contractibleSpace ⟨0,by simp⟩ + let : LocallyPathConnectedSpace unitInterval := (convex_Icc (0:ℝ) 1).locallyPathConnectedSpace + let f : C(unitInterval × unitInterval,{z : ℂ // z ≠ 0}) := + ⟨fun st => ⟨P st.1-N st.2,sub_ne_zero.mpr (hne st.1 st.2)⟩, + ((P.continuous.comp continuous_fst).sub (N.continuous.comp continuous_snd)).subtype_mk _⟩ + obtain ⟨L,hL,-⟩ := isCoveringMap_exp.existsUnique_continuousMap_lifts f (0,0) + (log (f (0,0))) (Subtype.ext (exp_log (f (0,0)).property)) + exact ⟨L,fun s t => congrArg Subtype.val (congrFun hL.2 (s,t))⟩ + + + +theorem disk_paths_cross {P N : C(unitInterval,ℂ)} + (hP : ∀ s, ‖P s‖ ≤ 1) (hN : ∀ t, ‖N t‖ ≤ 1) + (hP0 : P 0 = -1) (hP1 : P 1 = 1) + (hN0 : ‖N 0‖ = 1) (hN1 : ‖N 1‖ = 1) + (hup : 0 < (N 0).im) (hdn : (N 1).im < 0) : + ∃ s t, P s = N t := by + by_contra h + push Not at h + obtain ⟨L,hL⟩ := square_log h + let D : unitInterval → ℂ := fun t => L (1,t)-L (0,t) + have hD : Continuous D := by dsimp [D]; fun_prop + have hed (t : unitInterval) (ht : ‖N t‖ = 1) : + D t = log ((1-N t)*(-conj (N t)))-log ((-1-N t)*(-conj (N t))) := by + have hh := log_difference hP ht (fun s => h s t) + (l := ⟨fun s => L (s,t),by fun_prop⟩) (fun s => hL s t) + simpa only [ContinuousMap.coe_mk,hP0,hP1] using hh + have him1 (z : ℂ) : ((1-z)*(-conj z)).im = z.im := by + simp only [mul_im,sub_re,sub_im,one_re,one_im,neg_re,neg_im,conj_re,conj_im] + ring + have him0 (z : ℂ) : ((-1-z)*(-conj z)).im = -z.im := by + simp only [mul_im,sub_re,sub_im,one_re,one_im,neg_re,neg_im,conj_re,conj_im] + ring + have hp : 0 < (D 0).im := by + rw [hed 0 hN0,sub_im,log_im,log_im] + have ha := arg_nonneg_iff.mpr (by rw [him1]; exact hup.le) + have hb := arg_neg_iff.mpr (by rw [him0]; exact neg_neg_of_pos hup) + linarith + have hn : (D 1).im < 0 := by + rw [hed 1 hN1,sub_im,log_im,log_im] + have ha := arg_neg_iff.mpr (by rw [him1]; exact hdn) + have hb := arg_nonneg_iff.mpr (by rw [him0]; exact neg_nonneg.mpr hdn.le) + linarith + obtain ⟨t,ht⟩ := intermediate_value_univ (1 : unitInterval) 0 (continuous_im.comp hD) + ⟨hn.le,hp.le⟩ + have he : (1-N t) = exp (D t) * (-1-N t) := by + have hd : exp (D t) = (1-N t)/(-1-N t) := by + dsimp only [D] + rw [exp_sub,hL,hL,hP1,hP0] + exact ((div_eq_iff (sub_ne_zero.mpr (hP0 ▸ h 0 t))).mp hd.symm) + have hex : exp (D t) = (Real.exp (D t).re : ℂ) := by + apply Complex.ext <;> simp [exp_re,exp_im,show (D t).im = 0 from ht] + rw [hex] at he + have hv : 0 < normSq (-1-N t) := normSq_pos.mpr (sub_ne_zero.mpr (hP0 ▸ h 0 t)) + have hx : normSq (N t) ≤ 1 := by + rw [normSq_eq_norm_sq] + nlinarith [hN t,norm_nonneg (N t)] + have hpv := mul_pos (Real.exp_pos (D t).re) hv + have hr := congrArg re (congrArg (fun z : ℂ => z*conj (-1-N t)) he) + simp only [mul_re,mul_im,sub_re,sub_im,one_re,one_im,neg_re,neg_im,conj_re,conj_im, + ofReal_re,ofReal_im,zero_mul,add_zero,sub_zero] at hr + simp only [normSq_apply,sub_re,sub_im,one_re,one_im,neg_re,neg_im] at hx hpv + nlinarith + +private lemma arg_product_rightHalfPlane {u v : ℂ} (hu : 0 < u.re) (hv : 0 < v.re) : + arg (u*conj v) = arg u-arg v := by + have h₁ := neg_pi_div_two_lt_arg_iff.mpr (Or.inl hu) + have h₂ := arg_lt_pi_div_two_iff.mpr (Or.inl hu) + have h₃ := neg_pi_div_two_lt_arg_iff.mpr (Or.inl hv) + have h₄ := arg_lt_pi_div_two_iff.mpr (Or.inl hv) + have hvπ : arg v ≠ Real.pi := by linarith [Real.pi_pos] + have hc : arg (conj v) = -arg v := by rw [arg_conj,ite_eq_right hvπ] + rw [arg_mul (by intro h; simp [h] at hu) + (by intro h; have := congrArg re h; simp only [conj_re,zero_re] at this; linarith) + (by rw [hc]; constructor <;> linarith),hc,sub_eq_add_neg] + +private lemma log_difference_im {P : C(unitInterval,ℂ)} {b : ℂ} + (hP : ∀ s, ‖P s‖ ≤ 1) (hb : ‖b‖ = 1) (hne : ∀ s, P s ≠ b) + {l : C(unitInterval,ℂ)} (hl : ∀ s, exp (l s) = P s-b) : + (l 1-l 0).im = arg ((P 1-b)*conj (P 0-b)) := by + rw [log_difference hP hb hne hl,sub_im,log_im,log_im, + ← arg_product_rightHalfPlane (boundary_halfPlane (hP 1) hb (hne 1)) + (boundary_halfPlane (hP 0) hb (hne 0))] + congr 1 + have hbc : (-conj b)*conj (-conj b) = 1 := by + rw [mul_conj,normSq_eq_norm_sq,norm_neg,norm_conj,hb] + norm_num + rw [map_mul] + calc + (P 1-b)*(-conj b)*(conj (P 0-b)*conj (-conj b)) = + ((P 1-b)*conj (P 0-b))*((-conj b)*conj (-conj b)) := by ring + _ = _ := by rw [hbc,mul_one] + +private lemma no_positive_chord_ratio {a c z : ℂ} {k : ℝ} + (ha : ‖a‖ = 1) (hc : ‖c‖ = 1) (hz : ‖z‖ ≤ 1) (hac : a ≠ c) (haz : a ≠ z) + (hk : 0 < k) (he : c-z = (k : ℂ)*(a-z)) : False := by + have hna : normSq a = 1 := by rw [normSq_eq_norm_sq,ha]; norm_num + have hnc : normSq c = 1 := by rw [normSq_eq_norm_sq,hc]; norm_num + have hnz : normSq z ≤ 1 := by rw [normSq_eq_norm_sq]; nlinarith [norm_nonneg z] + have hnaz : 0 < normSq (a-z) := normSq_pos.mpr (sub_ne_zero.mpr haz) + have hce : c = z+(k : ℂ)*(a-z) := by linear_combination he + have hid : normSq c-normSq a = + (k-1)*(normSq a-normSq z+k*normSq (a-z)) := by + rw [hce] + simp only [normSq_apply,add_re,add_im,mul_re,mul_im,sub_re,sub_im,ofReal_re,ofReal_im] + ring + rw [hna,hnc,sub_self] at hid + have hp : 0 < 1-normSq z+k*normSq (a-z) := + add_pos_of_nonneg_of_pos (sub_nonneg.mpr hnz) (mul_pos hk hnaz) + have he1 : k = 1 := by + have hh := (mul_eq_zero.mp hid.symm).resolve_right hp.ne' + linarith + rw [he1,ofReal_one,one_mul] at he + exact hac (sub_left_injective he).symm + + + + +theorem disk_paths_cross_chord {P N : C(unitInterval,ℂ)} + (hP : ∀ s, ‖P s‖ ≤ 1) (hN : ∀ t, ‖N t‖ ≤ 1) + (hP0 : ‖P 0‖ = 1) (hP1 : ‖P 1‖ = 1) (hneP : P 0 ≠ P 1) + (hN0 : ‖N 0‖ = 1) (hN1 : ‖N 1‖ = 1) + (hup : 0 < ((P 1-N 0)*conj (P 0-N 0)).im) + (hdn : ((P 1-N 1)*conj (P 0-N 1)).im < 0) : + ∃ s t, P s = N t := by + by_contra h + push Not at h + obtain ⟨L,hL⟩ := square_log h + let D : unitInterval → ℂ := fun t => L (1,t)-L (0,t) + have hD : Continuous D := by dsimp [D]; fun_prop + have hed (t : unitInterval) (ht : ‖N t‖ = 1) : + (D t).im = arg ((P 1-N t)*conj (P 0-N t)) := + log_difference_im hP ht (fun s => h s t) + (l := ⟨fun s => L (s,t),by fun_prop⟩) (fun s => hL s t) + have hp : 0 < (D 0).im := by + rw [hed 0 hN0] + have hge := arg_nonneg_iff.mpr hup.le + have hn : arg ((P 1-N 0)*conj (P 0-N 0)) ≠ 0 := by + intro ht + exact hup.ne' (arg_eq_zero_iff.mp ht).2 + exact hge.lt_of_ne' hn + have hn : (D 1).im < 0 := by rw [hed 1 hN1]; exact arg_neg_iff.mpr hdn + obtain ⟨t,ht⟩ := intermediate_value_univ (1 : unitInterval) 0 (continuous_im.comp hD) ⟨hn.le,hp.le⟩ + have he : (P 1-N t) = exp (D t)*(P 0-N t) := by + have hd : exp (D t) = (P 1-N t)/(P 0-N t) := by dsimp only [D]; rw [exp_sub,hL,hL] + exact (div_eq_iff (sub_ne_zero.mpr (h 0 t))).mp hd.symm + have hex : exp (D t) = (Real.exp (D t).re : ℂ) := by + apply Complex.ext <;> simp [exp_re,exp_im,show (D t).im = 0 from ht] + rw [hex] at he + exact no_positive_chord_ratio hP0 hP1 (hN t) hneP (h 0 t) (Real.exp_pos _) he + +end StrictHotSpots.PlanarTopology +end PlanarCrossingLayer + +section DiskSignTopologyLayer + +open Set Filter Metric _root_.Complex _root_.OAI.Complex +open scoped unitInterval Topology ComplexConjugate +namespace StrictHotSpots.PlanarTopology + +private lemma disk_positive_open {u : ℂ → ℝ} + (hu : ContinuousOn u (closedBall 0 1)) : IsOpen (ball (0 : ℂ) 1 ∩ {z | 0 < u z}) := by + exact (hu.mono ball_subset_closedBall).isOpen_inter_preimage isOpen_ball isOpen_Ioi + + + +lemma join_positive_interior {u : ℂ → ℝ} + (hu : ContinuousOn u (closedBall 0 1)) {a : ℂ} + (ha : a ∈ closedBall (0 : ℂ) 1) (hua : 0 < u a) : + ∃ a' ∈ ball (0 : ℂ) 1 ∩ {z | 0 < u z}, + JoinedIn (closedBall (0 : ℂ) 1 ∩ {z | 0 < u z}) a a' := by + obtain ⟨ε,hε,hεu⟩ := (Metric.continuousWithinAt_iff.mp (hu a ha)) (u a) hua + have hpos : closedBall (0 : ℂ) 1 ∩ ball a ε ⊆ {z | 0 < u z} := by + intro z hz + have hd := hεu hz.1 hz.2 + rw [Real.dist_eq] at hd + have := (abs_lt.mp hd).1 + change 0 < u z + linarith + have hacl : a ∈ closure (ball (0 : ℂ) 1) := by rwa [closure_ball (0 : ℂ) one_ne_zero] + obtain ⟨a',ha',hda'⟩ := Metric.mem_closure_iff.mp hacl ε hε + have hsa : a ∈ closedBall (0 : ℂ) 1 ∩ ball a ε := ⟨ha,mem_ball_self hε⟩ + have hsa' : a' ∈ closedBall (0 : ℂ) 1 ∩ ball a ε := + ⟨ball_subset_closedBall ha',by simpa only [mem_ball,dist_comm] using hda'⟩ + refine ⟨a',⟨ha',hpos hsa'⟩,?_⟩ + exact (((convex_closedBall (0 : ℂ) 1).inter (convex_ball a ε)).isPathConnected + ⟨a,hsa⟩ |>.joinedIn a hsa a' hsa').mono (fun z hz => ⟨hz.1,hpos hz⟩) + +lemma join_positive_closedDisk {u : ℂ → ℝ} + (hu : ContinuousOn u (closedBall 0 1)) + (hc : IsConnected (ball (0 : ℂ) 1 ∩ {z | 0 < u z})) + {a c : ℂ} (ha : a ∈ closedBall (0 : ℂ) 1) (hc' : c ∈ closedBall (0 : ℂ) 1) + (hua : 0 < u a) (huc : 0 < u c) : + JoinedIn (closedBall (0 : ℂ) 1 ∩ {z | 0 < u z}) a c := by + obtain ⟨a',ha',hja⟩ := join_positive_interior hu ha hua + obtain ⟨c',hc'',hjc⟩ := join_positive_interior hu hc' huc + have hpath := (disk_positive_open hu).isConnected_iff_isPathConnected.mp hc + have hj := (hpath.joinedIn a' ha' c' hc'').mono + (show ball (0 : ℂ) 1 ∩ {z | 0 < u z} ⊆ closedBall (0 : ℂ) 1 ∩ {z | 0 < u z} from + fun z hz => ⟨ball_subset_closedBall hz.1,hz.2⟩) + exact (hja.trans hj).trans hjc.symm + + + +theorem no_alternating_boundary_signs {u : ℂ → ℝ} + (hu : ContinuousOn u (closedBall 0 1)) + (hp : IsConnected (ball (0 : ℂ) 1 ∩ {z | 0 < u z})) + (hn : IsConnected (ball (0 : ℂ) 1 ∩ {z | u z < 0})) + {a b c d : ℂ} (ha : ‖a‖ = 1) (hb : ‖b‖ = 1) (hc : ‖c‖ = 1) (hd : ‖d‖ = 1) + (hac : a ≠ c) (hup : 0 < ((c-b)*conj (a-b)).im) + (hdn : ((c-d)*conj (a-d)).im < 0) + (hua : 0 < u a) (hub : u b < 0) (huc : 0 < u c) (hud : u d < 0) : False := by + have hacl : a ∈ closedBall (0 : ℂ) 1 := by simp only [mem_closedBall,dist_zero_right,ha,le_refl] + have hccl : c ∈ closedBall (0 : ℂ) 1 := by simp only [mem_closedBall,dist_zero_right,hc,le_refl] + have hbcl : b ∈ closedBall (0 : ℂ) 1 := by simp only [mem_closedBall,dist_zero_right,hb,le_refl] + have hdcl : d ∈ closedBall (0 : ℂ) 1 := by simp only [mem_closedBall,dist_zero_right,hd,le_refl] + have hP := join_positive_closedDisk hu hp hacl hccl hua huc + have hneg : IsConnected (ball (0 : ℂ) 1 ∩ {z | 0 < -u z}) := by + simpa only [neg_pos] using hn + have hN := join_positive_closedDisk hu.neg hneg hbcl hdcl (neg_pos.mpr hub) (neg_pos.mpr hud) + let P : C(unitInterval,ℂ) := hP.somePath.toContinuousMap + let N : C(unitInterval,ℂ) := hN.somePath.toContinuousMap + have hPs (s) : ‖P s‖ ≤ 1 := by + have hh := (hP.somePath_mem s).1 + simpa only [P,N,Path.coe_toContinuousMap,mem_closedBall,dist_zero_right] using hh + have hNs (s) : ‖N s‖ ≤ 1 := by + have hh := (hN.somePath_mem s).1 + simpa only [P,N,Path.coe_toContinuousMap,mem_closedBall,dist_zero_right] using hh + have hP0 : P 0 = a := hP.somePath.source + have hP1 : P 1 = c := hP.somePath.target + have hN0 : N 0 = b := hN.somePath.source + have hN1 : N 1 = d := hN.somePath.target + obtain ⟨s,t,hst⟩ := disk_paths_cross_chord hPs hNs (hP0.symm ▸ ha) (hP1.symm ▸ hc) + (by simpa only [hP0,hP1] using hac) (hN0.symm ▸ hb) (hN1.symm ▸ hd) + (by simpa only [hP0,hP1,hN0] using hup) (by simpa only [hP0,hP1,hN1] using hdn) + have hpos : 0 < u (P s) := (hP.somePath_mem s).2 + have hneg : 0 < -u (N t) := (hN.somePath_mem t).2 + rw [hst] at hpos + linarith + +end StrictHotSpots.PlanarTopology +end DiskSignTopologyLayer + +section CircleSignMomentsLayer + + + +open Set MeasureTheory +namespace StrictHotSpots.CircleSigns + +lemma separating_cosine (a b x : ℝ) : + Real.cos (x-(a+b)/2)-Real.cos ((b-a)/2) = + 2*Real.sin ((x-a)/2)*Real.sin ((b-x)/2) := by + rw [Real.cos_sub_cos] + have h₁ : ((x-(a+b)/2)+(b-a)/2)/2 = (x-a)/2 := by ring + have h₂ : ((x-(a+b)/2)-(b-a)/2)/2 = -((b-x)/2) := by ring + rw [h₁,h₂,Real.sin_neg] + ring + +lemma separating_cosine_pos {α a b x : ℝ} (ha : α < a) (hb : b < α+2*Real.pi) + (hx : x ∈ Ioo a b) : + 0 < Real.cos (x-(a+b)/2)-Real.cos ((b-a)/2) := by + rw [separating_cosine] + have h₁ : 0 < Real.sin ((x-a)/2) := + Real.sin_pos_of_pos_of_lt_pi (by linarith [hx.1]) (by linarith [hx.2]) + have h₂ : 0 < Real.sin ((b-x)/2) := + Real.sin_pos_of_pos_of_lt_pi (by linarith [hx.2]) (by linarith [hx.1]) + positivity + +lemma separating_cosine_nonpos {α a b x : ℝ} (ha : α < a) (hab : a < b) + (hb : b < α+2*Real.pi) (hx : x ∈ Icc α (α+2*Real.pi)) + (hout : x ≤ a ∨ b ≤ x) : + Real.cos (x-(a+b)/2)-Real.cos ((b-a)/2) ≤ 0 := by + rw [separating_cosine] + rcases hout with h | h + · have h₁ : Real.sin ((x-a)/2) ≤ 0 := + Real.sin_nonpos_of_nonpos_of_neg_pi_le (by linarith) (by linarith [hx.1]) + have h₂ : 0 ≤ Real.sin ((b-x)/2) := + Real.sin_nonneg_of_nonneg_of_le_pi (by linarith) (by linarith [hx.1]) + exact mul_nonpos_of_nonpos_of_nonneg (mul_nonpos_of_nonneg_of_nonpos (by norm_num) h₁) h₂ + · have h₁ : 0 ≤ Real.sin ((x-a)/2) := + Real.sin_nonneg_of_nonneg_of_le_pi (by linarith) (by linarith [hx.2]) + have h₂ : Real.sin ((b-x)/2) ≤ 0 := + Real.sin_nonpos_of_nonpos_of_neg_pi_le (by linarith) (by linarith [hx.2]) + exact mul_nonpos_of_nonneg_of_nonpos (mul_nonneg (by norm_num) h₁) h₂ + +lemma positive_points_sandwich {h : ℝ → ℝ} (hc : Continuous h) {α x : ℝ} + (hα : h α < 0) (hβ : h (α+2*Real.pi) < 0) + (hx : x ∈ Icc α (α+2*Real.pi)) (hh : 0 < h x) : + ∃ y z, y ∈ Icc α (α+2*Real.pi) ∧ z ∈ Icc α (α+2*Real.pi) ∧ + 0 < h y ∧ 0 < h z ∧ y < x ∧ x < z := by + have hαx : α < x := lt_of_le_of_ne hx.1 (by rintro rfl; linarith) + have hxβ : x < α+2*Real.pi := lt_of_le_of_ne hx.2 (by intro he; rw [he] at hh; linarith) + have ho : IsOpen (Ioo α (α+2*Real.pi) ∩ h ⁻¹' Ioi 0) := + isOpen_Ioo.inter (isOpen_Ioi.preimage hc) + obtain ⟨ε,hε,hball⟩ := Metric.isOpen_iff.mp ho x ⟨⟨hαx,hxβ⟩,hh⟩ + have hy : x-ε/2 ∈ Ioo α (α+2*Real.pi) ∩ h ⁻¹' Ioi 0 := by + apply hball + rw [Metric.mem_ball,Real.dist_eq] + have : x-ε/2-x = -(ε/2) := by ring + rw [this,abs_neg,abs_of_pos (by positivity)] + linarith + have hz : x+ε/2 ∈ Ioo α (α+2*Real.pi) ∩ h ⁻¹' Ioi 0 := by + apply hball + rw [Metric.mem_ball,Real.dist_eq] + have : x+ε/2-x = ε/2 := by ring + rw [this,abs_of_pos (by positivity)] + linarith + exact ⟨_,_,⟨hy.1.1.le,hy.1.2.le⟩,⟨hz.1.1.le,hz.1.2.le⟩,hy.2,hz.2,by linarith,by linarith⟩ + + + +theorem moment_sign_changes {h w : ℝ → ℝ} (hc : Continuous h) (wc : Continuous w) (α : ℝ) + (wp : ∀ x ∈ Icc α (α+2*Real.pi), 0 < w x) + (hα : h α < 0) (hβ : h (α+2*Real.pi) < 0) + (hp : ∃ x ∈ Icc α (α+2*Real.pi), 0 < h x) + (h0 : (∫ x in α..α+2*Real.pi, w x*h x) = 0) + (hcos : (∫ x in α..α+2*Real.pi, w x*h x*Real.cos x) = 0) + (hsin : (∫ x in α..α+2*Real.pi, w x*h x*Real.sin x) = 0) : + ∃ x y z, x ∈ Ioo α (α+2*Real.pi) ∧ z ∈ Ioo α (α+2*Real.pi) ∧ + x < y ∧ y < z ∧ 0 < h x ∧ h y < 0 ∧ 0 < h z := by + by_contra! hn + let P : Set ℝ := Icc α (α+2*Real.pi) ∩ h ⁻¹' Ioi 0 + have hP : P.Nonempty := hp + have hb : BddBelow P := ⟨α,fun x hx => hx.1.1⟩ + have ht : BddAbove P := ⟨α+2*Real.pi,fun x hx => hx.1.2⟩ + let a := sInf P + let b := sSup P + have hcl : closure P ⊆ Icc α (α+2*Real.pi) ∩ h ⁻¹' Ici 0 := by + apply closure_minimal + · intro x hx + refine ⟨hx.1,?_⟩ + change 0 ≤ h x + exact le_of_lt hx.2 + · exact isClosed_Icc.inter (isClosed_Ici.preimage hc) + have ham : a ∈ Icc α (α+2*Real.pi) ∩ h ⁻¹' Ici 0 := hcl (csInf_mem_closure hP hb) + have hbm : b ∈ Icc α (α+2*Real.pi) ∩ h ⁻¹' Ici 0 := hcl (csSup_mem_closure hP ht) + have ha : α < a := lt_of_le_of_ne ham.1.1 (by intro he; rw [← he] at ham; exact (not_lt_of_ge ham.2) hα) + have hβb : b < α+2*Real.pi := lt_of_le_of_ne hbm.1.2 (by intro he; rw [he] at hbm; exact (not_lt_of_ge hbm.2) hβ) + have hstrict (x : ℝ) (hx : x ∈ P) : a < x ∧ x < b := by + obtain ⟨y,z,hy,hz,hpy,hpz,hyx,hxz⟩ := positive_points_sandwich hc hα hβ hx.1 hx.2 + exact ⟨lt_of_le_of_lt (csInf_le hb ⟨hy,hpy⟩) hyx, + lt_of_lt_of_le hxz (le_csSup ht ⟨hz,hpz⟩)⟩ + let p := hP.some + have hp : p ∈ P := hP.some_mem + have hsp := hstrict p hp + have hab : a < b := hsp.1.trans hsp.2 + have hmid (x : ℝ) (hx : x ∈ Ioo a b) : 0 ≤ h x := by + by_contra! hh + obtain ⟨y,hy,hyx⟩ := exists_lt_of_csInf_lt hP hx.1 + obtain ⟨z,hz,hxz⟩ := exists_lt_of_lt_csSup hP hx.2 + have hsy := hstrict y hy + have hsz := hstrict z hz + exact (not_lt_of_ge (hn y x z ⟨ha.trans hsy.1,hsy.2.trans hβb⟩ + ⟨ha.trans hsz.1,hsz.2.trans hβb⟩ hyx hxz hy.2 hh)) hz.2 + have hout (x : ℝ) (hx : x ∈ Icc α (α+2*Real.pi)) (hh : x ≤ a ∨ b ≤ x) : h x ≤ 0 := by + by_contra! hp + have hs := hstrict x ⟨hx,hp⟩ + rcases hh with h | h <;> linarith [hs.1,hs.2] + let F : ℝ → ℝ := fun x => Real.cos (x-(a+b)/2)-Real.cos ((b-a)/2) + have hF : Continuous F := by dsimp [F]; fun_prop + have hnon (x : ℝ) (hx : x ∈ Icc α (α+2*Real.pi)) : 0 ≤ w x*h x*F x := by + by_cases hi : x ∈ Ioo a b + · exact mul_nonneg (mul_nonneg (wp x hx).le (hmid x hi)) (separating_cosine_pos ha hβb hi).le + · have he : x ≤ a ∨ b ≤ x := by simpa only [mem_Ioo,not_and_or,not_lt] using hi + exact mul_nonneg_of_nonpos_of_nonpos (mul_nonpos_of_nonneg_of_nonpos (wp x hx).le (hout x hx he)) + (separating_cosine_nonpos ha hab hβb hx he) + have hpos : 0 < ∫ x in α..α+2*Real.pi, w x*h x*F x := by + apply intervalIntegral.integral_pos (by linarith [Real.pi_pos]) ((wc.mul hc).mul hF).continuousOn + · intro x hx + exact hnon x ⟨hx.1.le,hx.2⟩ + · exact ⟨p,hp.1,mul_pos (mul_pos (wp p hp.1) hp.2) (separating_cosine_pos ha hβb hsp)⟩ + have heq (x : ℝ) : w x*h x*F x = + Real.cos ((a+b)/2)*(w x*h x*Real.cos x) + + Real.sin ((a+b)/2)*(w x*h x*Real.sin x) - Real.cos ((b-a)/2)*(w x*h x) := by + dsimp [F] + rw [Real.cos_sub] + ring + have he : (∫ x in α..α+2*Real.pi, w x*h x*F x) = 0 := by + simp_rw [heq] + rw [intervalIntegral.integral_sub,intervalIntegral.integral_add, + intervalIntegral.integral_const_mul,intervalIntegral.integral_const_mul, + intervalIntegral.integral_const_mul,hcos,hsin,h0] + · ring + all_goals apply Continuous.intervalIntegrable; fun_prop + linarith + +end StrictHotSpots.CircleSigns +end CircleSignMomentsLayer + +section ChordAnglesLayer +open _root_.Complex _root_.OAI.Complex Set Metric +open scoped ComplexConjugate +namespace StrictHotSpots.PlanarTopology + +lemma sine_triple_identity (a b c : ℝ) : + Real.sin (c-a) - Real.sin (c-b) + Real.sin (a-b) = + 4*Real.sin ((c-b)/2)*Real.sin ((a-b)/2)*Real.sin ((c-a)/2) := by + have h₂ : Real.sin (c-a) = 2*Real.sin ((c-a)/2)*Real.cos ((c-a)/2) := by + simpa only [show 2*((c-a)/2) = c-a by ring] using Real.sin_two_mul ((c-a)/2) + have h₃ := Real.sin_sub_sin (c-b) (a-b) + have he : ((c-b)-(a-b))/2 = (c-a)/2 := by ring + rw [he] at h₃ + have h₄ := Real.cos_sub_cos ((c-a)/2) (((c-b)+(a-b))/2) + have he₁ : ((c-a)/2 + ((c-b)+(a-b))/2)/2 = (c-b)/2 := by ring + have he₂ : ((c-a)/2 - ((c-b)+(a-b))/2)/2 = -((a-b)/2) := by ring + rw [he₁,he₂,Real.sin_neg] at h₄ + calc + _ = 2*Real.sin ((c-a)/2)*(Real.cos ((c-a)/2)-Real.cos (((c-b)+(a-b))/2)) := by + linarith [h₃] + _ = _ := by rw [h₄]; ring + +lemma chord_exp_det (a b c : ℝ) : + (((Circle.exp c : ℂ)-(Circle.exp b : ℂ))* + conj ((Circle.exp a : ℂ)-(Circle.exp b : ℂ))).im = + 4*Real.sin ((c-b)/2)*Real.sin ((a-b)/2)*Real.sin ((c-a)/2) := by + rw [← sine_triple_identity] + simp only [Circle.coe_exp,exp_ofReal_mul_I_re,exp_ofReal_mul_I_im, + mul_im,sub_re,sub_im,conj_re,conj_im,Real.sin_sub] + ring + +lemma angles_no_alternation {u : ℂ → ℝ} + (hu : ContinuousOn u (closedBall 0 1)) + (hp : IsConnected (ball (0 : ℂ) 1 ∩ {z | 0 < u z})) + (hn : IsConnected (ball (0 : ℂ) 1 ∩ {z | u z < 0})) + {α x y z : ℝ} (hαx : α < x) (hxy : x < y) (hyz : y < z) (hzβ : z < α+2*Real.pi) + (hα : u (Circle.exp α) < 0) (hx : 0 < u (Circle.exp x)) + (hy : u (Circle.exp y) < 0) (hz : 0 < u (Circle.exp z)) : False := by + have hzx : (Circle.exp z : ℂ) ≠ (Circle.exp x : ℂ) := by + intro he + have hc : Circle.exp z = Circle.exp x := Subtype.ext he + have := Circle.exp_injOn_Ico (a := α) (b := α+2*Real.pi) (by linarith) + ⟨by linarith,hzβ⟩ ⟨hαx.le,by linarith⟩ hc + linarith + have hup : 0 < (((Circle.exp x : ℂ)-(Circle.exp y : ℂ))* + conj ((Circle.exp z : ℂ)-(Circle.exp y : ℂ))).im := by + rw [chord_exp_det] + have hs₁ : Real.sin ((x-y)/2) < 0 := Real.sin_neg_of_neg_of_neg_pi_lt (by linarith) (by linarith) + have hs₂ : 0 < Real.sin ((z-y)/2) := Real.sin_pos_of_pos_of_lt_pi (by linarith) (by linarith) + have hs₃ : Real.sin ((x-z)/2) < 0 := Real.sin_neg_of_neg_of_neg_pi_lt (by linarith) (by linarith) + exact mul_pos_of_neg_of_neg (mul_neg_of_neg_of_pos (mul_neg_of_pos_of_neg (by norm_num) hs₁) hs₂) hs₃ + have hdn : (((Circle.exp x : ℂ)-(Circle.exp α : ℂ))* + conj ((Circle.exp z : ℂ)-(Circle.exp α : ℂ))).im < 0 := by + rw [chord_exp_det] + have hs₁ : 0 < Real.sin ((x-α)/2) := Real.sin_pos_of_pos_of_lt_pi (by linarith) (by linarith) + have hs₂ : 0 < Real.sin ((z-α)/2) := Real.sin_pos_of_pos_of_lt_pi (by linarith) (by linarith) + have hs₃ : Real.sin ((x-z)/2) < 0 := Real.sin_neg_of_neg_of_neg_pi_lt (by linarith) (by linarith) + exact mul_neg_of_pos_of_neg (mul_pos (mul_pos (by norm_num) hs₁) hs₂) hs₃ + exact no_alternating_boundary_signs hu hp hn (Circle.exp z).norm_coe (Circle.exp y).norm_coe + (Circle.exp x).norm_coe (Circle.exp α).norm_coe hzx hup hdn hz hy hx hα + +end StrictHotSpots.PlanarTopology +end ChordAnglesLayer + +section DiskBoundaryMomentsLayer +open Set MeasureTheory Metric +namespace StrictHotSpots.CircleSigns + +lemma periodic_weighted_signs {h w : ℝ → ℝ} (hc : Continuous h) (wc : Continuous w) + (hp : Function.Periodic h (2*Real.pi)) (wp : Function.Periodic w (2*Real.pi)) + (hw : ∀ x, 0 < w x) (hne : ∃ x, h x ≠ 0) + (hi : (∫ x in (0:ℝ)..2*Real.pi, w x*h x) = 0) : + (∃ x, h x < 0) ∧ (∃ x, 0 < h x) := by + have hneg {f : ℝ → ℝ} (fc : Continuous f) (fp : Function.Periodic f (2*Real.pi)) + (fn : ∃ x, f x ≠ 0) (fi : (∫ x in (0:ℝ)..2*Real.pi, w x*f x) = 0) : ∃ x, f x < 0 := by + by_contra! hh + obtain ⟨x,hx⟩ := fn + have hxx : 0 < f x := lt_of_le_of_ne (hh x) hx.symm + have hi' : 0 < ∫ y in x..x+2*Real.pi, w y*f y := by + apply intervalIntegral.integral_pos (by linarith [Real.pi_pos]) (wc.mul fc).continuousOn + · intro y _ + exact mul_nonneg (hw y).le (hh y) + · exact ⟨x,⟨le_rfl,by linarith [Real.pi_pos]⟩,mul_pos (hw x) hxx⟩ + have he := (wp.mul fp).intervalIntegral_add_eq x 0 + simp only [zero_add,Pi.mul_apply] at he + rw [fi] at he + linarith + constructor + · exact hneg hc hp hne hi + · obtain ⟨x,hx⟩ := hneg hc.neg (fun x => by simp only [Pi.neg_apply,hp x]) (by simpa using hne) (by + simpa only [Pi.neg_apply,mul_neg,intervalIntegral.integral_neg,neg_zero] using congrArg Neg.neg hi) + exact ⟨x,neg_lt_zero.mp hx⟩ + +lemma circle_trace_continuous {u : ℂ → ℝ} (hu : ContinuousOn u (closedBall 0 1)) : + Continuous (fun θ : ℝ => u (Circle.exp θ : ℂ)) := by + apply hu.comp_continuous + · fun_prop + · intro θ + simp only [mem_closedBall,dist_zero_right,(Circle.exp θ).norm_coe,le_refl] + + + +theorem disk_moments_nonzero {u : ℂ → ℝ} (hu : ContinuousOn u (closedBall 0 1)) + (hpos : IsConnected (ball (0 : ℂ) 1 ∩ {z | 0 < u z})) + (hneg : IsConnected (ball (0 : ℂ) 1 ∩ {z | u z < 0})) + {w : ℝ → ℝ} (wc : Continuous w) (wp : Function.Periodic w (2*Real.pi)) + (hw : ∀ θ, 0 < w θ) (hne : ∃ θ, u (Circle.exp θ : ℂ) ≠ 0) + (hi : (∫ θ in (0:ℝ)..2*Real.pi, w θ*u (Circle.exp θ : ℂ)) = 0) : + (∫ θ in (0:ℝ)..2*Real.pi, w θ*u (Circle.exp θ : ℂ)*Real.cos θ) ≠ 0 ∨ + (∫ θ in (0:ℝ)..2*Real.pi, w θ*u (Circle.exp θ : ℂ)*Real.sin θ) ≠ 0 := by + by_contra! hm + let h : ℝ → ℝ := fun θ => u (Circle.exp θ : ℂ) + have hc : Continuous h := circle_trace_continuous hu + have hp : Function.Periodic h (2*Real.pi) := by + intro θ + exact congrArg (fun z : Circle => u (z : ℂ)) (Circle.exp_add_two_pi θ) + obtain ⟨⟨α,hα⟩,⟨p,hp'⟩⟩ := periodic_weighted_signs hc wc hp wp hw hne hi + have hα' : h (α+2*Real.pi) < 0 := by rw [hp]; exact hα + have hposI : ∃ x ∈ Icc α (α+2*Real.pi), 0 < h x := by + have hr := hp.image_Icc Real.two_pi_pos α + have hx : h p ∈ Set.range h := ⟨p,rfl⟩ + rw [← hr] at hx + obtain ⟨x,hx,hex⟩ := hx + exact ⟨x,hx,hex ▸ hp'⟩ + have hi' : (∫ x in α..α+2*Real.pi, w x*h x) = 0 := by + have he := (wp.mul hp).intervalIntegral_add_eq α 0 + simp only [zero_add,Pi.mul_apply] at he + exact he.trans hi + have hcos : (∫ x in α..α+2*Real.pi, w x*h x*Real.cos x) = 0 := by + have he := ((wp.mul hp).mul Real.cos_periodic).intervalIntegral_add_eq α 0 + simp only [zero_add,Pi.mul_apply] at he + exact he.trans hm.1 + have hsin : (∫ x in α..α+2*Real.pi, w x*h x*Real.sin x) = 0 := by + have he := ((wp.mul hp).mul Real.sin_periodic).intervalIntegral_add_eq α 0 + simp only [zero_add,Pi.mul_apply] at he + exact he.trans hm.2 + obtain ⟨x,y,z,hx,hz,hxy,hyz,hpx,hny,hpz⟩ := + moment_sign_changes hc wc α (fun x _ => hw x) hα hα' hposI hi' hcos hsin + exact PlanarTopology.angles_no_alternation hu hpos hneg hx.1 hxy hyz hz.2 hα hpx hny hpz + +end StrictHotSpots.CircleSigns +end DiskBoundaryMomentsLayer + +section DiskMultiplicityLayer +open Set MeasureTheory Metric Function Module +open scoped Topology InnerProductSpace +namespace StrictHotSpots.CircleSigns +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] + +def weightedMoment (F : ℂ → E) (w q : ℝ → ℝ) + (hc : Continuous (fun θ => w θ*q θ)) + (hF : ContinuousOn F (closedBall 0 1)) : E →ₗ[ℝ] ℝ where + toFun a := ∫ θ in (0:ℝ)..2*Real.pi, w θ*q θ*inner ℝ a (F (Circle.exp θ : ℂ)) + map_add' a b := by + simp only [inner_add_left,mul_add] + have hcont : Continuous (fun θ : ℝ => F (Circle.exp θ : ℂ)) := + hF.comp_continuous (by fun_prop) (fun θ => by simp [mem_closedBall,dist_zero_right]) + exact intervalIntegral.integral_add + ((hc.mul (continuous_const.inner hcont)).intervalIntegrable _ _) + ((hc.mul (continuous_const.inner hcont)).intervalIntegrable _ _) + map_smul' c a := by + simp only [inner_smul_left,conj_trivial,RingHom.id_apply,smul_eq_mul] + simp_rw [show ∀ θ, w θ * q θ * (c * inner ℝ a (F (Circle.exp θ : ℂ))) = + c * (w θ*q θ*inner ℝ a (F (Circle.exp θ : ℂ))) from fun _ => by ring] + exact intervalIntegral.integral_const_mul _ _ + + + + +theorem disk_family_finrank_le_two (F : ℂ → E) + (hc : ContinuousOn F (closedBall 0 1)) + (hb : ∀ a : E, a ≠ 0 → ∃ s : Circle, 0 < inner ℝ a (F s)) + (hp : ∀ a : E, a ≠ 0 → IsConnected + (ball (0:ℂ) 1 ∩ {z | 0 < inner ℝ a (F z)})) + (hn : ∀ a : E, a ≠ 0 → IsConnected + (ball (0:ℂ) 1 ∩ {z | inner ℝ a (F z) < 0})) : finrank ℝ E ≤ 2 := by + let G : C(Circle,E) := ⟨fun s => F s, + hc.comp_continuous (by fun_prop) (fun s => by simpa only [mem_closedBall,dist_zero_right,Circle.norm_coe] using (le_refl (1:ℝ)))⟩ + obtain ⟨w,wc,wp,hw,hzero⟩ := PositiveWeight.exists_circle_weight G hb + let T : E →ₗ[ℝ] ℝ×ℝ := (weightedMoment F w Real.cos (wc.mul Real.continuous_cos) hc).prod + (weightedMoment F w Real.sin (wc.mul Real.continuous_sin) hc) + have hker (a : E) (ha : T a = 0) : a = 0 := by + by_contra haz + obtain ⟨s,hs⟩ := hb a haz + have hne : ∃ θ, inner ℝ a (F (Circle.exp θ : ℂ)) ≠ 0 := by + exact ⟨(s:ℂ).arg,by simpa only [Circle.exp_arg] using ne_of_gt hs⟩ + have hcont : ContinuousOn (fun z => inner ℝ a (F z)) (closedBall 0 1) := + continuousOn_const.inner hc + have hh := disk_moments_nonzero hcont (hp a haz) (hn a haz) wc wp hw hne (hzero a) + have hreal := congrArg Prod.fst ha + have himag := congrArg Prod.snd ha + change (∫ θ in (0:ℝ)..2*Real.pi, w θ*Real.cos θ*inner ℝ a (F (Circle.exp θ : ℂ))) = 0 at hreal + change (∫ θ in (0:ℝ)..2*Real.pi, w θ*Real.sin θ*inner ℝ a (F (Circle.exp θ : ℂ))) = 0 at himag + have hre : (∫ θ in (0:ℝ)..2*Real.pi, w θ*inner ℝ a (F (Circle.exp θ : ℂ))*Real.cos θ) = 0 := by + simpa only [mul_right_comm (w _) (Real.cos _) _] using hreal + have him : (∫ θ in (0:ℝ)..2*Real.pi, w θ*inner ℝ a (F (Circle.exp θ : ℂ))*Real.sin θ) = 0 := by + simpa only [mul_right_comm (w _) (Real.sin _) _] using himag + exact hh.elim (fun h => h hre) (fun h => h him) + have hi : Injective T := by + intro a b he + apply sub_eq_zero.mp + apply hker + rw [map_sub,he,sub_self] + simpa only [finrank_prod,finrank_self] using T.finrank_le_finrank_of_injective hi +end StrictHotSpots.CircleSigns +end DiskMultiplicityLayer +end +end MultiplicityComplete + +section ClosedEigenMultiplicity + +noncomputable section +open Set Metric Function Module +open scoped Topology InnerProductSpace +namespace StrictHotSpots +open PlaneGreen DiskH10 + + +def closedScalarEval {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) + (x : closure Ω) : closedEigenSpace Ω ho hb →ₗ[ℝ] ℝ where + toFun J := J.val.1 x + map_add' _ _ := rfl + map_smul' _ _ := rfl + + + + +theorem closedEigenSpace_family_card {Ω : Set Plane} (c : Conformal.ClosedDiskChart Ω) + (hΩ : AdmissibleDomain Ω) {n : ℕ} + (f : Fin n → closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1) (hf : LinearIndependent ℝ f) : n ≤ 2 := by + classical + choose u Y hu huc hY he hjet using fun i => (f i).property + let J (a : EuclideanSpace ℝ (Fin n)) : closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1 := ∑ i, a i • f i + have hjnz (a : EuclideanSpace ℝ (Fin n)) (ha : a ≠ 0) : J a ≠ 0 := by + intro hz + have hh := Fintype.linearIndependent_iff.mp hf (fun i => a i) hz + exact ha (by ext i; exact hh i) + have hcombo (a : EuclideanSpace ℝ (Fin n)) (x : closure Ω) : + (J a).val.1 x = ∑ i, a i * u i x := by + change closedScalarEval hΩ.2.1 hΩ.2.2.1 x (∑ i, a i • f i) = _ + rw [map_sum] + apply Finset.sum_congr rfl + intro i _ + rw [map_smul] + change a i * (f i).val.1 x = a i * u i x + rw [← hjet i] + rfl + let F (z : ℂ) : EuclideanSpace ℝ (Fin n) := WithLp.toLp 2 (fun i => u i (c.F (complexIso z))) + have hc : ContinuousOn F (closedBall 0 1) := by + apply (PiLp.continuous_toLp 2 (fun _ : Fin n => ℝ)).comp_continuousOn + apply continuousOn_pi.mpr + intro i + exact (huc i).comp (c.lipschitz.continuous.comp complexIso.continuous).continuousOn (fun _ hz => c.complex_maps_closed hz) + have hval (a : EuclideanSpace ℝ (Fin n)) {v : Plane → ℝ} {Z : Plane → Plane} + (hv : closedEigenJet Ω v Z = (J a).val) (z : ℂ) (hz : z ∈ closedBall 0 1) : + inner ℝ a (F z) = v (c.F (complexIso z)) := by + let x : closure Ω := ⟨c.F (complexIso z),c.complex_maps_closed hz⟩ + calc + inner ℝ a (F z) = ∑ i, a i * u i x := by + simp only [F,PiLp.inner_apply,RCLike.inner_apply,conj_trivial] + apply Finset.sum_congr rfl + intro i _ + exact mul_comm _ _ + _ = (J a).val.1 x := (hcombo a x).symm + _ = v (c.F (complexIso z)) := by rw [← hv]; rfl + have hdim := CircleSigns.disk_family_finrank_le_two F hc ?_ ?_ ?_ + · simpa only [finrank_euclideanSpace, Fintype.card_fin] using hdim + · intro a ha + obtain ⟨v,Z,hv,hvc,hZ,hvZ,hvjet⟩ := (J a).property + have hn : ∃ x ∈ Ω, v x ≠ 0 := closedEigenJet_nonzero_interior hΩ.2.1 hvc hZ hvZ + (fun hz => hjnz a ha (Subtype.ext (hvjet.symm.trans hz))) + obtain ⟨x,hx,hvx⟩ := InteriorBoundarySign.exists_boundary_pos hΩ.2.1 hΩ.2.2.1 hv hvc hn + let s : Circle := c.circleBoundaryHomeomorph.symm ⟨x,hx⟩ + have hs : c.F (complexIso (s:ℂ)) = x := congrArg Subtype.val (c.circleBoundaryHomeomorph.apply_symm_apply ⟨x,hx⟩) + refine ⟨s,?_⟩ + rw [hval a hvjet s (by simp only [mem_closedBall_zero_iff,Circle.norm_coe,le_refl]),hs] + exact hvx + · intro a ha + obtain ⟨v,Z,hv,hvc,hZ,hvZ,hvjet⟩ := (J a).property + have hn : ∃ x ∈ Ω, v x ≠ 0 := closedEigenJet_nonzero_interior hΩ.2.1 hvc hZ hvZ + (fun hz => hjnz a ha (Subtype.ext (hvjet.symm.trans hz))) + have hcon := c.connected_complex_pull (P := Ioi 0) (InteriorNodal.positive_set_connected hΩ hv hn) + convert hcon using 1 + ext z + constructor + · rintro ⟨hz,hp⟩ + refine ⟨hz,?_⟩ + simpa only [mem_ofPred_eq,mem_preimage,mem_Ioi,mem_Iio,← hval a hvjet z (ball_subset_closedBall hz)] using hp + · rintro ⟨hz,hp⟩ + refine ⟨hz,?_⟩ + change (0:ℝ) < inner ℝ a (F z) + rw [hval a hvjet z (ball_subset_closedBall hz)] + exact hp + · intro a ha + obtain ⟨v,Z,hv,hvc,hZ,hvZ,hvjet⟩ := (J a).property + have hn : ∃ x ∈ Ω, v x ≠ 0 := closedEigenJet_nonzero_interior hΩ.2.1 hvc hZ hvZ + (fun hz => hjnz a ha (Subtype.ext (hvjet.symm.trans hz))) + have hcon := c.connected_complex_pull (P := Iio 0) (InteriorNodal.negative_set_connected hΩ hv hn) + convert hcon using 1 + ext z + constructor + · rintro ⟨hz,hp⟩ + refine ⟨hz,?_⟩ + simpa only [mem_ofPred_eq,mem_preimage,mem_Ioi,mem_Iio,← hval a hvjet z (ball_subset_closedBall hz)] using hp + · rintro ⟨hz,hp⟩ + refine ⟨hz,?_⟩ + change inner ℝ a (F z) < (0:ℝ) + rw [hval a hvjet z (ball_subset_closedBall hz)] + exact hp + + +theorem closedEigenSpace_finrank_le_two {Ω : Set Plane} (c : Conformal.ClosedDiskChart Ω) + (hΩ : AdmissibleDomain Ω) : Module.Finite ℝ (closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1) ∧ + Module.finrank ℝ (closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1) ≤ 2 := by + have hr : Module.rank ℝ (closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1) < 3 := by + by_contra hn + obtain ⟨f,hf⟩ := exists_linearIndependent_of_le_rank (n := 3) (le_of_not_gt hn) + have hh := closedEigenSpace_family_card c hΩ f hf + norm_num at hh + have hfinite : Module.Finite ℝ (closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1) := + Module.rank_lt_aleph0_iff.mp (hr.trans (Cardinal.natCast_lt_aleph0 (n := 3))) + let : Module.Finite ℝ (closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1) := hfinite + refine ⟨hfinite,?_⟩ + have he := Module.finrank_eq_rank ℝ (closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1) + rw [← he] at hr + exact Nat.le_of_lt_succ (by exact_mod_cast hr) +end StrictHotSpots +end +end ClosedEigenMultiplicity + +section ClosedBoundaryZeroJet + +noncomputable section +open Set Filter Metric +open scoped Topology ContDiff InnerProductSpace +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) +include c + + + + +theorem hasFDerivWithinAt_zero_of_closedGradient_zero {v : Plane → ℝ} + (hv : ContDiffOn ℝ ∞ v Ω) (hvc : ContinuousOn v (closure Ω)) + {Y : Plane → Plane} (hY : ContinuousOn Y (closure Ω)) (he : EqOn (gradient v) Y Ω) + {p : Plane} (hp : p ∈ closure Ω) (hz : Y p = 0) : + HasFDerivWithinAt v (0 : Plane →L[ℝ] ℝ) (closure Ω) p := by + have hGp := c.inverse_maps_closed hp + have hYG : Tendsto (fun z => Y (c.F z)) (𝓝[disk] (c.G p)) (𝓝 (0 : Plane)) := by + have hc := (hY.comp c.continuous_closed c.maps_closed (c.G p) hGp).mono subset_closure + change Tendsto (Y ∘ c.F) (𝓝[disk] c.G p) (𝓝 (Y (c.F (c.G p)))) at hc + rw [c.right_inverse p hp,hz] at hc + exact hc + have hlim : Tendsto (fun z => fderiv ℝ (c.pullDatum v) z) + (𝓝[disk] (c.G p)) (𝓝 (0 : Plane →L[ℝ] ℝ)) := by + apply tendsto_zero_iff_norm_tendsto_zero.mpr + apply squeeze_zero' (g := fun z => c.bound * ‖Y (c.F z)‖) (Eventually.of_forall fun _ => norm_nonneg _) + · filter_upwards [self_mem_nhdsWithin] with z hzD + have hn : ‖fderiv ℝ (c.pullDatum v) z‖ = ‖gradient (c.pullDatum v) z‖ := by + simp only [gradient,LinearIsometryEquiv.norm_map] + rw [hn,c.pullDatum_grad_norm (hv.differentiableOn (by simp)) hzD, + he (c.diskMap.map_source hzD),c.diskMap_agrees hzD] + exact mul_le_mul_of_nonneg_right (c.bounded_deriv z (c.source_eq.symm ▸ hzD)) (norm_nonneg _) + · simpa only [norm_zero,mul_zero] using tendsto_const_nhds.mul hYG.norm + have hD : HasFDerivWithinAt (c.pullDatum v) (0 : Plane →L[ℝ] ℝ) + (closure disk) (c.G p) := + hasFDerivWithinAt_closure_of_tendsto_fderiv + ((c.pullDatum_smooth hv).differentiableOn (by simp)) + (convex_ball (0:Plane) 1) diskOpen + (fun z hzD => (c.pullDatum_continuous hvc z hzD).mono subset_closure) hlim + have ht : Tendsto c.G (𝓝[closure Ω] p) (𝓝[closure disk] (c.G p)) := + c.inverse_lipschitz.continuous.continuousWithinAt.tendsto_nhdsWithin c.inverse_maps_closed + have hsmall := (hasFDerivWithinAt_iff_isLittleO.mp hD).comp_tendsto ht + have hbig : (fun x => c.G x-c.G p) =O[𝓝[closure Ω] p] (fun x => x-p) := + Asymptotics.IsBigO.of_bound c.InvLip (Eventually.of_forall (fun x => c.inverse_lipschitz.norm_sub_le x p)) + have hh := hsmall.trans_isBigO hbig + apply hasFDerivWithinAt_iff_isLittleO.mpr + apply hh.congr' _ (Filter.EventuallyEq.refl _ _) + filter_upwards [self_mem_nhdsWithin] with x hx + simp only [Function.comp_apply,zero_apply,sub_zero,pullDatum, + c.right_inverse x hx,c.right_inverse p hp] + +end StrictHotSpots.Conformal.ClosedDiskChart +end +end ClosedBoundaryZeroJet + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Multiplier.lean b/lean/OAI/Analysis/HotSpots/Multiplier.lean new file mode 100644 index 0000000000000000000000000000000000000000..56ae929072659fe79b0e1abcf2c9b9acc5233352 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Multiplier.lean @@ -0,0 +1,1357 @@ +import OAI.Analysis.HotSpots.VectorEnergy + +namespace OAI + +section LipschitzMollifier + +noncomputable section +open Set MeasureTheory Filter Metric ContinuousLinearMap +open scoped ContDiff InnerProductSpace ENNReal NNReal Convolution +namespace StrictHotSpots + + +def ambientSmooth (φ : ContDiffBump (0 : Plane)) (b : Plane → ℝ) : Plane → ℝ := + φ.normed volume ⋆[lsmul ℝ ℝ,volume] b + +lemma ambientSmooth_smooth (φ : ContDiffBump (0 : Plane)) {b : Plane → ℝ} + {L : ℝ≥0} (hb : LipschitzWith L b) : ContDiff ℝ ∞ (ambientSmooth φ b) := + φ.hasCompactSupport_normed.contDiff_convolution_left _ φ.contDiff_normed hb.continuous.locallyIntegrable + +lemma ambientSmooth_integrable (φ : ContDiffBump (0 : Plane)) {b : Plane → ℝ} + {L : ℝ≥0} (hb : LipschitzWith L b) (x : Plane) : + Integrable (fun t : Plane => φ.normed volume t * b (x-t)) := + φ.hasCompactSupport_normed.convolutionExists_left_of_continuous_right + (lsmul ℝ ℝ) φ.integrable_normed.locallyIntegrable hb.continuous x + +lemma ambientSmooth_lipschitz (φ : ContDiffBump (0 : Plane)) {b : Plane → ℝ} + {L : ℝ≥0} (hb : LipschitzWith L b) : LipschitzWith L (ambientSmooth φ b) := by + rw [lipschitzWith_iff_norm_sub_le] + intro x y + have hi := (ambientSmooth_integrable φ hb x).sub (ambientSmooth_integrable φ hb y) + have hp (t : Plane) : ‖φ.normed volume t*b (x-t)-φ.normed volume t*b (y-t)‖ ≤ + φ.normed volume t*((L:ℝ)*‖x-y‖) := by + rw [← mul_sub,norm_mul,Real.norm_eq_abs,abs_of_nonneg (φ.nonneg_normed t)] + apply mul_le_mul_of_nonneg_left _ (φ.nonneg_normed t) + simpa only [sub_sub_sub_cancel_right] using hb.norm_sub_le (x-t) (y-t) + change ‖(∫ t : Plane, φ.normed volume t*b (x-t))-(∫ t : Plane, φ.normed volume t*b (y-t))‖ ≤ _ + rw [← integral_sub (ambientSmooth_integrable φ hb x) (ambientSmooth_integrable φ hb y)] + calc + _ ≤ ∫ t : Plane, ‖φ.normed volume t*b (x-t)-φ.normed volume t*b (y-t)‖ := norm_integral_le_integral_norm _ + _ ≤ ∫ t : Plane, φ.normed volume t*((L:ℝ)*‖x-y‖) := + integral_mono hi.norm (φ.integrable_normed.mul_const _) hp + _ = _ := by rw [integral_mul_const,φ.integral_normed,one_mul] + +lemma ambientSmooth_tendsto {φ : ℕ → ContDiffBump (0 : Plane)} + (hφ : Tendsto (fun n => (φ n).rOut) atTop (nhds 0)) {b : Plane → ℝ} + {L : ℝ≥0} (hb : LipschitzWith L b) (x : Plane) : + Tendsto (fun n => ambientSmooth (φ n) b x) atTop (nhds (b x)) := + ContDiffBump.convolution_tendsto_right_of_continuous hφ hb.continuous x + +lemma ambientSmooth_fderiv (φ : ContDiffBump (0 : Plane)) {b : Plane → ℝ} + {L : ℝ≥0} (hb : LipschitzWith L b) (x : Plane) : + fderiv ℝ (ambientSmooth φ b) x = ∫ t : Plane, φ.normed volume t • fderiv ℝ b (x-t) := by + have hm : AEStronglyMeasurable (fun t : Plane => φ.normed volume t • fderiv ℝ b (x-t)) volume := + (φ.continuous_normed.measurable.smul ((measurable_fderiv ℝ b).comp + (measurable_const.sub measurable_id))).aestronglyMeasurable + have hl : ∀ᵐ t : Plane ∂volume, LipschitzOnWith + (Real.nnabs (φ.normed volume t*(L:ℝ))) (fun y => φ.normed volume t*b (y-t)) univ := by + filter_upwards [] with t + apply LipschitzWith.lipschitzOnWith + apply LipschitzWith.of_dist_le_mul + intro y z + simp only [dist_eq_norm,← mul_sub,norm_mul,Real.norm_eq_abs,Real.coe_nnabs, + abs_of_nonneg (mul_nonneg (φ.nonneg_normed t) L.coe_nonneg), + abs_of_nonneg (φ.nonneg_normed t)] + calc + _ ≤ φ.normed volume t*((L:ℝ)*‖(y-t)-(z-t)‖) := + mul_le_mul_of_nonneg_left (hb.norm_sub_le _ _) (φ.nonneg_normed t) + _ = _ := by rw [sub_sub_sub_cancel_right]; ring + have hd : ∀ᵐ t : Plane ∂volume, HasFDerivAt (fun y => φ.normed volume t*b (y-t)) + (φ.normed volume t • fderiv ℝ b (x-t)) x := by + filter_upwards [(volume.measurePreserving_sub_left x).quasiMeasurePreserving.ae + (hb.ae_differentiableAt (μ := volume))] with t ht + have h := ht.hasFDerivAt.comp x ((hasFDerivAt_id x).sub (hasFDerivAt_const t x)) + simpa [Function.comp_def,Pi.smul_def,smul_eq_mul] using h.const_smul (φ.normed volume t) + have hh := hasFDerivAt_integral_of_dominated_loc_of_lip (s := univ) + (bound := fun t => φ.normed volume t*(L:ℝ)) (by simp : univ ∈ nhds x) + (Filter.Eventually.of_forall (fun y => (ambientSmooth_integrable φ hb y).aestronglyMeasurable)) + (ambientSmooth_integrable φ hb x) hm hl (φ.integrable_normed.mul_const _) hd + exact hh.2.fderiv + +lemma ambientSmooth_gradient (φ : ContDiffBump (0 : Plane)) {b : Plane → ℝ} + {L : ℝ≥0} (hb : LipschitzWith L b) (x : Plane) : + gradient (ambientSmooth φ b) x = + (φ.normed volume ⋆[lsmul ℝ ℝ,volume] gradient b) x := by + unfold gradient + rw [ambientSmooth_fderiv φ hb x] + apply ((InnerProductSpace.toDual ℝ Plane).symm.toContinuousLinearEquiv.integral_comp_comm + (fun t : Plane => φ.normed volume t • fderiv ℝ b (x-t))).symm.trans + apply integral_congr_ae + filter_upwards [] with t + exact map_smul _ _ _ + +lemma lipschitz_gradient_locallyIntegrable {b : Plane → ℝ} {L : ℝ≥0} (hb : LipschitzWith L b) : + LocallyIntegrable (gradient b) volume := by + have hm : Measurable (gradient b) := + (InnerProductSpace.toDual ℝ Plane).symm.continuous.measurable.comp (measurable_fderiv ℝ b) + apply (memLp_top_of_bound hm.aestronglyMeasurable (L:ℝ) ?_).locallyIntegrable (by simp) + filter_upwards [] with x + change ‖(InnerProductSpace.toDual ℝ Plane).symm (fderiv ℝ b x)‖ ≤ L + rw [LinearIsometryEquiv.norm_map] + exact norm_fderiv_le_of_lipschitz ℝ hb + +lemma ambientSmooth_gradient_tendsto {φ : ℕ → ContDiffBump (0 : Plane)} + (hφ : Tendsto (fun n => (φ n).rOut) atTop (nhds 0)) {K : ℝ} + (hK : ∀ᶠ n in atTop, (φ n).rOut ≤ K*(φ n).rIn) {b : Plane → ℝ} + {L : ℝ≥0} (hb : LipschitzWith L b) : + ∀ᵐ x : Plane ∂volume, Tendsto (fun n => gradient (ambientSmooth (φ n) b) x) atTop (nhds (gradient b x)) := by + simp_rw [ambientSmooth_gradient _ hb] + exact ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable hφ hK + (lipschitz_gradient_locallyIntegrable hb) + +end StrictHotSpots +end +end LipschitzMollifier + +section LipschitzH1 + +noncomputable section +open Set MeasureTheory Filter Metric +open scoped ContDiff InnerProductSpace ENNReal NNReal Topology +namespace StrictHotSpots + + +lemma HasH1Gradient.of_tendsto_L2 {Ω : Set Plane} {f : ℕ → Plane → ℝ} {g : ℕ → Plane → Plane} + (hf : ∀ n, HasH1Gradient Ω (f n) (g n)) {u : Plane → ℝ} {v : Plane → Plane} + (hu : MemLp u 2 (volume.restrict Ω)) (hv : MemLp v 2 (volume.restrict Ω)) + (hfu : Tendsto (fun n => (hf n).1.toLp (f n)) atTop (𝓝 (hu.toLp u))) + (hgv : Tendsto (fun n => (hf n).2.1.toLp (g n)) atTop (𝓝 (hv.toLp v))) : + HasH1Gradient Ω u v := by + have ht : Tendsto (fun n => (hf n).toH1.val) atTop + (𝓝 (WithLp.toLp 2 (hu.toLp u,hv.toLp v))) := + (WithLp.prod_continuous_toLp 2 _ _).continuousAt.tendsto.comp (hfu.prodMk_nhds hgv) + have hg := (h1Graph_mem_iff Ω (WithLp.toLp 2 (hu.toLp u,hv.toLp v))).mp + ((h1Graph_closed Ω).mem_of_tendsto ht (Eventually.of_forall fun n => (hf n).toH1.property)) + exact hg.congr hu.coeFn_toLp hv.coeFn_toLp + +def planeApproxBump (n : ℕ) : ContDiffBump (0 : Plane) where + rIn := (2*((n:ℝ)+1))⁻¹ + rOut := ((n:ℝ)+1)⁻¹ + rIn_pos := by positivity + rIn_lt_rOut := by + apply inv_strictAnti₀ (by positivity) + nlinarith [Nat.cast_nonneg (α:=ℝ) n] + +lemma planeApproxBump_rOut_tendsto : + Tendsto (fun n => (planeApproxBump n).rOut) atTop (𝓝 0) := + tendsto_inv_atTop_zero.comp (tendsto_atTop_add_const_right atTop 1 tendsto_natCast_atTop_atTop) + +lemma planeApproxBump_ratio (n : ℕ) : + (planeApproxBump n).rOut ≤ 2*(planeApproxBump n).rIn := by + dsimp only [planeApproxBump] + have h : (n:ℝ)+1 ≠ 0 := by positivity + field_simp + norm_num + +lemma planeApproxBump_rOut_le_one (n : ℕ) : (planeApproxBump n).rOut ≤ 1 := by + change ((n:ℝ)+1)⁻¹ ≤ 1 + apply inv_le_one_of_one_le₀ + linarith [Nat.cast_nonneg (α:=ℝ) n] + +lemma ambientSmooth_error (φ : ContDiffBump (0 : Plane)) {b : Plane → ℝ} + {L : ℝ≥0} (hb : LipschitzWith L b) (x : Plane) : + ‖ambientSmooth φ b x-b x‖ ≤ (L:ℝ)*φ.rOut := by + rw [← dist_eq_norm] + apply φ.dist_normed_convolution_le hb.continuous.aestronglyMeasurable + intro y hy + exact (hb.dist_le_mul y x).trans (mul_le_mul_of_nonneg_left hy.le L.coe_nonneg) + +lemma lipschitz_gradient_bound {b : Plane → ℝ} {L : ℝ≥0} (hb : LipschitzWith L b) (x : Plane) : + ‖gradient b x‖ ≤ L := by + change ‖(InnerProductSpace.toDual ℝ Plane).symm (fderiv ℝ b x)‖ ≤ L + rw [LinearIsometryEquiv.norm_map] + exact norm_fderiv_le_of_lipschitz ℝ hb + +lemma lipschitz_gradient_memLp_top {Ω : Set Plane} {b : Plane → ℝ} {L : ℝ≥0} + (hb : LipschitzWith L b) : MemLp (gradient b) ∞ (volume.restrict Ω) := by + apply memLp_top_of_bound + ((InnerProductSpace.toDual ℝ Plane).symm.continuous.measurable.comp + (measurable_fderiv ℝ b)).aestronglyMeasurable _ + exact Eventually.of_forall (lipschitz_gradient_bound hb) + +lemma continuous_closure_memLp_top {Ω : Set Plane} {F : Type*} [NormedAddCommGroup F] + {f : Plane → F} (ho : IsOpen Ω) (hΩ : Bornology.IsBounded Ω) + (hf : ContinuousOn f (closure Ω)) : MemLp f ∞ (volume.restrict Ω) := by + obtain ⟨C,hC⟩ := hΩ.isCompact_closure.exists_bound_of_continuousOn hf + apply memLp_top_of_bound ((hf.mono subset_closure).aestronglyMeasurable ho.measurableSet) C + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + exact hC x (subset_closure hx) + +lemma ambientSmooth_uniform_bound {Ω : Set Plane} (hΩ : Bornology.IsBounded Ω) + {b : Plane → ℝ} {L : ℝ≥0} (hb : LipschitzWith L b) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ n, ∀ x ∈ Ω, ‖ambientSmooth (planeApproxBump n) b x‖ ≤ C := by + obtain ⟨M,hM⟩ := hΩ.isCompact_closure.exists_bound_of_continuousOn hb.continuous.continuousOn + refine ⟨max M 0+L,by positivity,fun n x hx => ?_⟩ + have he := ambientSmooth_error (planeApproxBump n) hb x + have hφ := mul_le_mul_of_nonneg_left (planeApproxBump_rOut_le_one n) L.coe_nonneg + have hx' := hM x (subset_closure hx) + calc + _ ≤ ‖ambientSmooth (planeApproxBump n) b x-b x‖+‖b x‖ := norm_le_norm_sub_add _ _ + _ ≤ (L:ℝ)+max M 0 := by linarith [le_max_left M 0] + _ = _ := by ring + + + +lemma HasH1Gradient.mul_lipschitz {Ω : Set Plane} (ho : IsOpen Ω) + (hΩ : Bornology.IsBounded Ω) {u : Plane → ℝ} {g : Plane → Plane} + (hu : HasH1Gradient Ω u g) {b : Plane → ℝ} {L : ℝ≥0} (hb : LipschitzWith L b) : + HasH1Gradient Ω (fun x => b x*u x) (fun x => b x • g x+u x • gradient b x) := by + let bn := fun n => ambientSmooth (planeApproxBump n) b + have hbn (n : ℕ) : ContDiff ℝ ∞ (bn n) := ambientSmooth_smooth _ hb + have hbl (n : ℕ) : LipschitzWith L (bn n) := ambientSmooth_lipschitz _ hb + have hb0 := continuous_closure_memLp_top ho hΩ hb.continuous.continuousOn + have hb1 := lipschitz_gradient_memLp_top (Ω:=Ω) hb + have hn0 (n : ℕ) := continuous_closure_memLp_top ho hΩ (hbl n).continuous.continuousOn + have hn1 (n : ℕ) := lipschitz_gradient_memLp_top (Ω:=Ω) (hbl n) + have hf (n : ℕ) := hu.mul_smooth (hbn n) (hn0 n) (hn1 n) + have hv : MemLp (fun x => b x*u x) 2 (volume.restrict Ω) := hb0.fun_mul hu.1 + have hg : MemLp (fun x => b x • g x+u x • gradient b x) 2 (volume.restrict Ω) := + (hb0.smul hu.2.1).add (hu.1.smul hb1) + obtain ⟨C,hC,hbd⟩ := ambientSmooth_uniform_bound hΩ hb + have ht (x : Plane) : Tendsto (fun n => bn n x) atTop (𝓝 (b x)) := + ambientSmooth_tendsto planeApproxBump_rOut_tendsto hb x + have hgt : ∀ᵐ x ∂volume.restrict Ω, Tendsto (fun n => gradient (bn n) x) + atTop (𝓝 (gradient b x)) := + ae_restrict_of_ae (ambientSmooth_gradient_tendsto planeApproxBump_rOut_tendsto + (Eventually.of_forall planeApproxBump_ratio) hb) + apply HasH1Gradient.of_tendsto_L2 hf hv hg + · apply L2VectorLimits.tendsto_toLp_of_dominated (fun n => (hf n).1) hv + (hu.1.norm.const_mul C) + · filter_upwards [] with n + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + rw [norm_mul] + exact mul_le_mul_of_nonneg_right (hbd n x hx) (norm_nonneg _) + · exact Eventually.of_forall fun x => (ht x).mul_const (u x) + · apply L2VectorLimits.tendsto_toLp_of_dominated (fun n => (hf n).2.1) hg + ((hu.2.1.norm.const_mul C).add (hu.1.norm.const_mul (L:ℝ))) + · filter_upwards [] with n + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + calc + _ ≤ ‖bn n x • g x‖+‖u x • gradient (bn n) x‖ := norm_add_le _ _ + _ = ‖bn n x‖*‖g x‖+‖u x‖*‖gradient (bn n) x‖ := by rw [norm_smul,norm_smul] + _ ≤ C*‖g x‖+‖u x‖*(L:ℝ) := add_le_add + (mul_le_mul_of_nonneg_right (hbd n x hx) (norm_nonneg _)) + (mul_le_mul_of_nonneg_left (lipschitz_gradient_bound (hbl n) x) (norm_nonneg _)) + _ = _ := by simp only [Pi.add_apply]; ring + · filter_upwards [hgt] with x hx + exact ((ht x).smul_const (g x)).add (tendsto_const_nhds.smul hx) + +namespace H1 +variable {Ω : Set Plane} (ho : IsOpen Ω) (hΩ : Bornology.IsBounded Ω) + {b : Plane → ℝ} {L : ℝ≥0} (hb : LipschitzWith L b) + +def lipschitzMul (u : H1 Ω) : H1 Ω := + ((H1.hasH1Gradient u).mul_lipschitz ho hΩ hb).toH1 + +lemma lipschitzMul_value_ae (u : H1 Ω) : H1.value (lipschitzMul ho hΩ hb u) =ᵐ[volume.restrict Ω] + fun x => b x*H1.value u x := + ((H1.hasH1Gradient u).mul_lipschitz ho hΩ hb).1.coeFn_toLp + +lemma lipschitzMul_grad_ae (u : H1 Ω) : H1.grad (lipschitzMul ho hΩ hb u) =ᵐ[volume.restrict Ω] + fun x => b x • H1.grad u x+H1.value u x • gradient b x := + ((H1.hasH1Gradient u).mul_lipschitz ho hΩ hb).2.1.coeFn_toLp +end H1 + +end StrictHotSpots +end +end LipschitzH1 + +section PhysicalHelmholtz + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.PhysicalHelmholtz +variable {Ω : Set Plane} (ho : IsOpen Ω) +local instance : NormedAddCommGroup (H10 ho) := H10.normedAddCommGroup ho +local instance : InnerProductSpace ℝ (H10 ho) := H10.innerProductSpace ho +local instance : CompleteSpace (H10 ho) := H10.completeSpace ho +local instance : NormedSpace ℝ (H10 ho) := (H10.innerProductSpace ho).toNormedSpace +local instance : NormedSpace ℝ (H1 Ω) := (h1Graph Ω).normedSpace + +def pair (μ : ℝ) : H1 Ω →L[ℝ] H1 Ω →L[ℝ] ℝ := + ((innerSL ℝ).comp H1.grad).flip.comp H1.grad - + μ • ((innerSL ℝ).comp H1.value).flip.comp H1.value + +lemma pair_apply (μ : ℝ) (u v : H1 Ω) : pair μ u v = + inner ℝ (H1.grad v) (H1.grad u)-μ*inner ℝ (H1.value v) (H1.value u) := rfl + +lemma pair_comm (μ : ℝ) (u v : H1 Ω) : pair μ u v=pair μ v u := by + rw [pair_apply,pair_apply] + exact congrArg₂ (fun a b : ℝ => a-μ*b) + (real_inner_comm (H1.grad u) (H1.grad v)) + (real_inner_comm (H1.value u) (H1.value v)) + +def incl : H10 ho →L[ℝ] H1 Ω := (h10Submodule ho).subtypeL + +def zeroPair (μ : ℝ) : H10 ho →L[ℝ] H10 ho →L[ℝ] ℝ := by + let a : H10 ho →L[ℝ] H1 Ω →L[ℝ] ℝ := (pair μ).comp (incl ho) + let b : H1 Ω →L[ℝ] H10 ho →L[ℝ] ℝ := ContinuousLinearMap.flip (E := H10 ho) (F := H1 Ω) a + exact b.comp (incl ho) + +lemma zeroPair_apply (μ : ℝ) (u v : H10 ho) : zeroPair ho μ u v = + inner ℝ (H10.grad ho u) (H10.grad ho v)-μ*inner ℝ (H10.value ho u) (H10.value ho v) := rfl + +lemma zeroPair_pair (μ : ℝ) (u v : H10 ho) : zeroPair ho μ u v=pair μ v.val u.val := rfl + +lemma zeroPair_self (μ : ℝ) (v : H10 ho) : zeroPair ho μ v v= + ‖H10.grad ho v‖^2-μ*‖H10.value ho v‖^2 := + (zeroPair_apply ho μ v v).trans (congrArg₂ (fun a b : ℝ => a-μ*b) + (real_inner_self_eq_norm_sq (H10.grad ho v)) + (real_inner_self_eq_norm_sq (H10.value ho v))) + +lemma subcritical_numeric {μ L C x y z : ℝ} (hμ : 0 ≤ μ) (hl : μ < L) + (hv : C*x*x ≤ z^2) (hd : L*y^2 ≤ z^2) : + ((1-μ/L)*C)*x*x ≤ z^2-μ*y^2 := by + have hL : 0 < L := lt_of_le_of_lt hμ hl + have hρ : 0 < 1-μ/L := sub_pos.mpr ((div_lt_one hL).mpr hl) + have hmul := mul_le_mul_of_nonneg_left hd (div_nonneg hμ hL.le) + have he : μ/L*(L*y^2)=μ*y^2 := by field_simp [ne_of_gt hL] + rw [he] at hmul + have hh := mul_le_mul_of_nonneg_left hv hρ.le + nlinarith + +lemma zeroPair_coercive (hb : Bornology.IsBounded Ω) {μ L : ℝ} + (hμ : 0 ≤ μ) (hl : μ < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) : + @IsCoercive (H10 ho) (H10.normedAddCommGroup ho).toSeminormedAddCommGroup + (H10.innerProductSpace ho).toNormedSpace (zeroPair ho μ) := by + obtain ⟨C,hC,hE⟩ := H10.energy_coercive ho hb + have hL : 0 < L := lt_of_le_of_lt hμ hl + have hρ : 0 < 1-μ/L := sub_pos.mpr ((div_lt_one hL).mpr hl) + refine ⟨(1-μ/L)*C,mul_pos hρ hC,fun v => ?_⟩ + have hv : C*‖v‖*‖v‖ ≤ ‖H10.grad ho v‖^2 := + (hE v).trans_eq (by rw [H10.energy_apply,real_inner_self_eq_norm_sq]) + exact (subcritical_numeric hμ hl hv (hD v)).trans_eq + (zeroPair_self ho μ v).symm + +def forcing (μ : ℝ) : H1 Ω →L[ℝ] H10 ho →L[ℝ] ℝ := by + let a : H10 ho →L[ℝ] H1 Ω →L[ℝ] ℝ := (pair μ).flip.comp (incl ho) + let b : H1 Ω →L[ℝ] H10 ho →L[ℝ] ℝ := ContinuousLinearMap.flip (E := H10 ho) (F := H1 Ω) a + exact -b + +def correction (hb : Bornology.IsBounded Ω) {μ L : ℝ} + (hμ : 0 ≤ μ) (hl : μ < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) : + H1 Ω →L[ℝ] H10 ho := + (zeroPair_coercive ho hb hμ hl hD).continuousLinearEquivOfBilin.symm.toContinuousLinearMap.comp + ((InnerProductSpace.toDual ℝ (H10 ho)).symm.toContinuousLinearEquiv.toContinuousLinearMap.comp (forcing ho μ)) + +def extension (hb : Bornology.IsBounded Ω) {μ L : ℝ} + (hμ : 0 ≤ μ) (hl : μ < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) : + H1 Ω →L[ℝ] H1 Ω := + ContinuousLinearMap.id ℝ (H1 Ω)+(incl ho).comp (correction ho hb hμ hl hD) + +lemma correction_spec (hb : Bornology.IsBounded Ω) {μ L : ℝ} + (hμ : 0 ≤ μ) (hl : μ < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + (a : H1 Ω) (v : H10 ho) : + zeroPair ho μ (correction ho hb hμ hl hD a) v = -pair μ a v.val := by + rw [← (zeroPair_coercive ho hb hμ hl hD).continuousLinearEquivOfBilin_apply] + simp only [correction,ContinuousLinearMap.comp_apply,ContinuousLinearEquiv.coe_coe, + ContinuousLinearEquiv.apply_symm_apply] + exact InnerProductSpace.toDual_symm_apply + +lemma extension_class (hb : Bornology.IsBounded Ω) {μ L : ℝ} + (hμ : 0 ≤ μ) (hl : μ < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) (a : H1 Ω) : + ∃ w : H10 ho, extension ho hb hμ hl hD a-a=w.val := by + exact ⟨correction ho hb hμ hl hD a,add_sub_cancel_left _ _⟩ + +lemma extension_weak (hb : Bornology.IsBounded Ω) {μ L : ℝ} + (hμ : 0 ≤ μ) (hl : μ < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) (a : H1 Ω) + (v : H10 ho) : pair μ (extension ho hb hμ hl hD a) v.val=0 := by + change pair μ (a+(correction ho hb hμ hl hD a).val) v.val=0 + rw [map_add,add_apply] + have he := correction_spec ho hb hμ hl hD a v + have hh : pair μ (correction ho hb hμ hl hD a).val v.val= + zeroPair ho μ (correction ho hb hμ hl hD a) v := by + exact (pair_comm μ _ _).trans (zeroPair_pair ho μ _ _).symm + rw [hh,he,add_neg_cancel] + +lemma norm_zero_numeric {C x : ℝ} (hC : 0 < C) (hx : 0 ≤ x) (h : C*x*x ≤ 0) : x=0 := by + by_contra hn + have hp : 0 < x := lt_of_le_of_ne hx (Ne.symm hn) + exact (not_le_of_gt (mul_pos (mul_pos hC hp) hp)) h + +lemma self_zero (hb : Bornology.IsBounded Ω) {μ L : ℝ} + (hμ : 0 ≤ μ) (hl : μ < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + (w : H10 ho) (hz : zeroPair ho μ w w=0) : w=0 := by + obtain ⟨C,hC,hB⟩ := zeroPair_coercive ho hb hμ hl hD + have hn := hB w + rw [hz] at hn + exact norm_eq_zero.mp (norm_zero_numeric hC (norm_nonneg w) hn) + +lemma pair_sub (μ : ℝ) (a b v : H1 Ω) : + pair μ (a-b) v = pair μ a v-pair μ b v := by + exact congrArg (fun t : H1 Ω →L[ℝ] ℝ => t v) ((pair μ).map_sub a b) + +lemma unique (hb : Bornology.IsBounded Ω) {μ L : ℝ} + (hμ : 0 ≤ μ) (hl : μ < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + {a b : H1 Ω} (ha : ∀ v : H10 ho, pair μ a v.val=0) + (hb' : ∀ v : H10 ho, pair μ b v.val=0) + (hab : ∃ w : H10 ho, a-b=w.val) : a=b := by + obtain ⟨w,hw⟩ := hab + have h0 : pair μ w.val w.val=0 := by + calc + _ = pair μ (a-b) w.val := congrArg (fun z : H1 Ω => pair μ z w.val) hw.symm + _ = pair μ a w.val-pair μ b w.val := pair_sub μ a b w.val + _ = 0 := by rw [ha,hb',sub_self] + have hz : zeroPair ho μ w w=0 := h0 + have hw0 : w=0 := self_zero ho hb hμ hl hD w hz + apply sub_eq_zero.mp + exact hw.trans (congrArg (fun z : H10 ho => z.val) hw0) + +end StrictHotSpots.PhysicalHelmholtz +end +end PhysicalHelmholtz + +section PhysicalSolutionWeak + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.Conformal + +variable (e : OpenPartialHomeomorph Plane Plane) + (he : ContDiffOn ℝ ∞ e.symm e.target) (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (hb : Bornology.IsBounded e.target) + +lemma inner_H1grad_add_single {S : Set Plane} (a b z : H1 S) : + inner ℝ (H1.grad (a+b)) (H1.grad z) = + inner ℝ (H1.grad a) (H1.grad z)+inner ℝ (H1.grad b) (H1.grad z) := by + rw [map_add,inner_add_left] + +include d hd hb in +lemma affine_H10_grad_pair {w : Plane → ℝ} (hw : DifferentiableOn ℝ w e.target) + (hW : HasH1Gradient e.target w (gradient w)) + (hV : HasH1Gradient e.source (w ∘ e) (gradient (w ∘ e))) + (u v : H10 e.open_source) : + inner ℝ (H1.grad (hW.toH1+(transportH10 e he u).val)) + (H10.grad e.open_target (transportH10 e he v)) = + inner ℝ (H1.grad (hV.toH1+u.val)) (H10.grad e.open_source v) := by + exact (inner_H1grad_add_single hW.toH1 (transportH10 e he u).val + (transportH10 e he v).val).trans + ((congrArg₂ (fun a b : ℝ => a+b) (transportH10_mixed_grad e he d hd hb hw hW hV v) + (transportH10_inner_grad e he d hd hb u v)).trans + (inner_H1grad_add_single hV.toH1 u.val v.val).symm) + +include hd hb in +lemma affine_H10_mass_pair {w : Plane → ℝ} + (hW : HasH1Gradient e.target w (gradient w)) + (hV : HasH1Gradient e.source (w ∘ e) (gradient (w ∘ e))) + (u v : H10 e.open_source) : + inner ℝ (H1.value (hW.toH1+(transportH10 e he u).val)) + (H10.value e.open_target (transportH10 e he v)) = + ∫ x, H1.value (hV.toH1+u.val) x*H10.value e.open_source v x ∂chartMeasure e d := + isometry_value_pair (chartPull e d hd) _ _ + (affine_value_ae e he d hd hb hW hV u) (weightedValue_ae e he d hd hb v).symm + +namespace ClosedDiskChart +open DiskH10 PlaneGreen +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) +variable (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) +variable (hμ : 0 ≤ firstPositiveNeumannValue Ω) + +lemma physicalSolution_mixed_grad {w : Plane → ℝ} + (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) (v : H10 diskOpen) : + inner ℝ (H1.grad (c.physicalSolution hb hs hμ hw hl)) + (H10.grad c.diskMap.open_target (transportH10 c.diskMap c.diskMap_inverse_smooth v)) = + inner ℝ (H1.grad (boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl)) (H10.grad diskOpen v) := by + have hh := affine_H10_grad_pair c.diskMap c.diskMap_inverse_smooth c.d c.diskMap_deriv hb + ((hw.mono subset_closure).differentiableOn (by simp)) + (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hw) (c.pullDatum_comp_H1 hb hs hw) + (c.datumCorrection hb hs hμ hw hl) v + apply hh.trans + apply congrArg (fun U : H1 disk => inner ℝ (H1.grad U) (H10.grad diskOpen v)) + exact (congrArg (fun U : H1 disk => U+(c.datumCorrection hb hs hμ hw hl).val) + (c.pullDatum_comp_toH1 hb hs hw)).trans (c.datumCorrection_spec hb hs hμ hw hl).symm + +lemma physicalSolution_mixed_mass {w : Plane → ℝ} + (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) (v : H10 diskOpen) : + firstPositiveNeumannValue Ω * inner ℝ (H1.value (c.physicalSolution hb hs hμ hw hl)) + (H10.value c.diskMap.open_target (transportH10 c.diskMap c.diskMap_inverse_smooth v)) = + inner ℝ (SubcriticalExtension.observe c.densityBound_ne_top (c.density_bound hμ) + (boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl)) + (H10.weightedValue diskOpen c.densityBound_ne_top (c.density_bound hμ) v) := by + have hh := affine_H10_mass_pair c.diskMap c.diskMap_inverse_smooth c.d c.diskMap_deriv hb + (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hw) (c.pullDatum_comp_H1 hb hs hw) + (c.datumCorrection hb hs hμ hw hl) v + have he : (c.pullDatum_comp_H1 hb hs hw).toH1+(c.datumCorrection hb hs hμ hw hl).val= + boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl := + (congrArg (fun U : H1 disk => U+(c.datumCorrection hb hs hμ hw hl).val) + (c.pullDatum_comp_toH1 hb hs hw)).trans (c.datumCorrection_spec hb hs hμ hw hl).symm + let S := boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl + have hr := congrArg (fun U : H1 disk => + ∫ x, H1.value U x*H10.value diskOpen v x ∂chartMeasure c.diskMap c.d) he + have hp := potentialMeasure_integral c.diskMap c.d hμ + (fun x => H1.value S x*H10.value diskOpen v x) + have hq := congrArg (fun ν : Measure Plane => ∫ x, + H1.value S x*H10.value diskOpen v x ∂ν) c.potential_diskMap + exact (congrArg (fun t : ℝ => firstPositiveNeumannValue Ω*t) (hh.trans hr)).trans + (hp.symm.trans (hq.trans (observe_inner c.densityBound_ne_top (c.density_bound hμ) S v.val).symm)) + +lemma pair_forward {S : Set Plane} (μ : ℝ) (u v : H1 S) : + PhysicalHelmholtz.pair μ u v = inner ℝ (H1.grad u) (H1.grad v)- + μ*inner ℝ (H1.value u) (H1.value v) := + (PhysicalHelmholtz.pair_comm μ u v).trans (PhysicalHelmholtz.pair_apply μ v u) + +lemma physicalSolution_transported_weak (hne : Ω.Nonempty) (hpos : 0 < firstPositiveNeumannValue Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) (t : H10 diskOpen) : + PhysicalHelmholtz.pair (firstPositiveNeumannValue Ω) (c.physicalSolution hb hs hμ hw hl) + (show H1 Ω from (transportH10 c.diskMap c.diskMap_inverse_smooth t).val)=0 := by + have hn := c.operator_norm_lt_one hb hne hpos + have hwk := boundarySolution_weak c.densityBound_ne_top (c.density_bound hμ) hn + (c.datumTrace w hw.continuousOn) hl t + have hg := c.physicalSolution_mixed_grad hb hs hμ hw hl t + have hm := c.physicalSolution_mixed_mass hb hs hμ hw hl t + exact (pair_forward _ _ _).trans (sub_eq_zero.mpr (hg.trans (hwk.trans hm.symm))) + +lemma physicalSolution_weak (hne : Ω.Nonempty) (hpos : 0 < firstPositiveNeumannValue Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) + (v : H10 (show IsOpen Ω from c.diskMap.open_target)) : + PhysicalHelmholtz.pair (firstPositiveNeumannValue Ω) (c.physicalSolution hb hs hμ hw hl) v.val=0 := by + let t : H10 diskOpen := transportH10 c.diskMap.symm c.diskMap_smooth v + have ht : transportH10 c.diskMap c.diskMap_inverse_smooth t=v := + transportH10_symm c.diskMap.symm c.diskMap_smooth c.diskMap_inverse_smooth c.d' c.d + c.diskMap_inverse_deriv c.diskMap_deriv diskBounded hb v + have he := c.physicalSolution_transported_weak hb hs hμ hne hpos hw hl t + exact (congrArg (fun V : H10 (show IsOpen Ω from c.diskMap.open_target) => + PhysicalHelmholtz.pair (firstPositiveNeumannValue Ω) (c.physicalSolution hb hs hμ hw hl) V.val) ht).symm.trans he + +end ClosedDiskChart +end StrictHotSpots.Conformal +end +end PhysicalSolutionWeak + +section LipschitzH1Convergence + +noncomputable section +open Set MeasureTheory Filter Metric +open scoped ContDiff InnerProductSpace ENNReal NNReal Topology +namespace StrictHotSpots + +lemma H1.tendsto_of_components {Ω : Set Plane} {v : ℕ → H1 Ω} {u : H1 Ω} + (hv : Tendsto (fun n => H1.value (v n)) atTop (𝓝 (H1.value u))) + (hg : Tendsto (fun n => H1.grad (v n)) atTop (𝓝 (H1.grad u))) : + Tendsto v atTop (𝓝 u) := by + apply tendsto_subtype_rng.mpr + exact (WithLp.prod_continuous_toLp 2 _ _).continuousAt.tendsto.comp (hv.prodMk_nhds hg) + +lemma smoothMul_tendsto_lipschitzMul {Ω : Set Plane} (ho : IsOpen Ω) + (hΩ : Bornology.IsBounded Ω) {b : Plane → ℝ} {L : ℝ≥0} (hb : LipschitzWith L b) + (u : H1 Ω) : + Tendsto (fun n => H1.smoothMul (ambientSmooth_smooth (planeApproxBump n) hb) + (continuous_closure_memLp_top ho hΩ (ambientSmooth_lipschitz (planeApproxBump n) hb).continuous.continuousOn) + (lipschitz_gradient_memLp_top (ambientSmooth_lipschitz (planeApproxBump n) hb)) u) + atTop (𝓝 (H1.lipschitzMul ho hΩ hb u)) := by + let bn := fun n => ambientSmooth (planeApproxBump n) b + have hbn (n : ℕ) : ContDiff ℝ ∞ (bn n) := ambientSmooth_smooth _ hb + have hbl (n : ℕ) : LipschitzWith L (bn n) := ambientSmooth_lipschitz _ hb + have hn0 (n : ℕ) := continuous_closure_memLp_top ho hΩ (hbl n).continuous.continuousOn + have hn1 (n : ℕ) := lipschitz_gradient_memLp_top (Ω:=Ω) (hbl n) + have hu := H1.hasH1Gradient u + have hf (n : ℕ) := hu.mul_smooth (hbn n) (hn0 n) (hn1 n) + have hl := hu.mul_lipschitz ho hΩ hb + obtain ⟨C,hC,hbd⟩ := ambientSmooth_uniform_bound hΩ hb + have ht (x : Plane) : Tendsto (fun n => bn n x) atTop (𝓝 (b x)) := + ambientSmooth_tendsto planeApproxBump_rOut_tendsto hb x + have hgt : ∀ᵐ x ∂volume.restrict Ω, Tendsto (fun n => gradient (bn n) x) + atTop (𝓝 (gradient b x)) := + ae_restrict_of_ae (ambientSmooth_gradient_tendsto planeApproxBump_rOut_tendsto + (Eventually.of_forall planeApproxBump_ratio) hb) + apply H1.tendsto_of_components + · apply L2VectorLimits.tendsto_toLp_of_dominated (fun n => (hf n).1) hl.1 + (hu.1.norm.const_mul C) + · filter_upwards [] with n + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + rw [norm_mul] + exact mul_le_mul_of_nonneg_right (hbd n x hx) (norm_nonneg _) + · exact Eventually.of_forall fun x => (ht x).mul_const (H1.value u x) + · apply L2VectorLimits.tendsto_toLp_of_dominated (fun n => (hf n).2.1) hl.2.1 + ((hu.2.1.norm.const_mul C).add (hu.1.norm.const_mul (L:ℝ))) + · filter_upwards [] with n + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + calc + _ ≤ ‖bn n x • H1.grad u x‖+‖H1.value u x • gradient (bn n) x‖ := norm_add_le _ _ + _ = ‖bn n x‖*‖H1.grad u x‖+‖H1.value u x‖*‖gradient (bn n) x‖ := by rw [norm_smul,norm_smul] + _ ≤ C*‖H1.grad u x‖+‖H1.value u x‖*(L:ℝ) := add_le_add + (mul_le_mul_of_nonneg_right (hbd n x hx) (norm_nonneg _)) + (mul_le_mul_of_nonneg_left (lipschitz_gradient_bound (hbl n) x) (norm_nonneg _)) + _ = _ := by simp only [Pi.add_apply]; ring + · filter_upwards [hgt] with x hx + exact ((ht x).smul_const (H1.grad u x)).add (tendsto_const_nhds.smul hx) + +end StrictHotSpots +end +end LipschitzH1Convergence + +section LipschitzVectorMultiplier + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.Hodge +variable {Ω : Set Plane} (ho : IsOpen Ω) (hbound : Bornology.IsBounded Ω) +variable {b : Plane → ℝ} {L : ℝ≥0} (hb : LipschitzWith L b) + +theorem boundaryDefect_lipschitz_multiplier (X : Fin 2 → H1 Ω) : + boundaryDefect (fun i => H1.lipschitzMul ho hbound hb (X i)) + (fun i => H1.lipschitzMul ho hbound hb (X i)) = + boundaryDefect X (fun i => H1.lipschitzMul ho hbound hb (H1.lipschitzMul ho hbound hb (X i))) := by + rw [boundaryDefect_integral,boundaryDefect_integral] + apply integral_congr_ae + let M := H1.lipschitzMul ho hbound hb + filter_upwards [H1.lipschitzMul_grad_ae ho hbound hb (X 0), + H1.lipschitzMul_grad_ae ho hbound hb (X 1), + H1.lipschitzMul_value_ae ho hbound hb (X 0), + H1.lipschitzMul_value_ae ho hbound hb (X 1), + H1.lipschitzMul_grad_ae ho hbound hb (M (X 0)), + H1.lipschitzMul_grad_ae ho hbound hb (M (X 1))] with x h0 h1 hv0 hv1 hh0 hh1 + change H1.grad (M (X 0)) x = _ at h0 + change H1.grad (M (X 1)) x = _ at h1 + change H1.value (M (X 0)) x = _ at hv0 + change H1.value (M (X 1)) x = _ at hv1 + change -inner ℝ (H1.grad (M (X 0)) x) (rot (H1.grad (M (X 1)) x))+ + inner ℝ (H1.grad (M (X 1)) x) (rot (H1.grad (M (X 0)) x)) = _ + exact defect_multiplier_substitute (b x) (H1.value (X 0) x) (H1.value (X 1) x) + (H1.value (M (X 0)) x) (H1.value (M (X 1)) x) + (H1.grad (X 0) x) (H1.grad (X 1) x) (gradient b x) + (H1.grad (M (X 0)) x) (H1.grad (M (X 1)) x) + (H1.grad (M (M (X 0))) x) (H1.grad (M (M (X 1))) x) + h0 h1 hv0 hv1 hh0 hh1 + +lemma vectorValue_lipschitzMul_ae (X : Fin 2 → H1 Ω) : + vectorValue (fun i => H1.lipschitzMul ho hbound hb (X i)) =ᵐ[volume.restrict Ω] + fun x => b x • vectorValue X x := by + let M := H1.lipschitzMul ho hbound hb + filter_upwards [vectorValue_ae (fun i => M (X i)),vectorValue_ae X, + H1.lipschitzMul_value_ae ho hbound hb (X 0),H1.lipschitzMul_value_ae ho hbound hb (X 1)] + with x hV hX h0 h1 + apply hV.trans + exact (congrArg₂ (fun a d : ℝ => a • e 0+d • e 1) h0 h1).trans + (by rw [hX]; module) + +lemma divergenceL_lipschitzMul_ae (X : Fin 2 → H1 Ω) : + divergenceL (fun i => H1.lipschitzMul ho hbound hb (X i)) =ᵐ[volume.restrict Ω] + fun x => b x*divergenceL X x+inner ℝ (vectorValue X x) (gradient b x) := by + let M := H1.lipschitzMul ho hbound hb + filter_upwards [divergenceL_ae (fun i => M (X i)),divergenceL_ae X,vectorValue_ae X, + H1.lipschitzMul_grad_ae ho hbound hb (X 0),H1.lipschitzMul_grad_ae ho hbound hb (X 1)] + with x hD hX hV h0 h1 + apply hD.trans + exact (congrArg₂ (fun A B : Plane => c 0 A+c 1 B) h0 h1).trans + ((divergence_multiplier_algebra _ _ _ _ _ _).trans + (congrArg₂ (fun d : ℝ => fun V : Plane => b x*d+inner ℝ V (gradient b x)) hX hV).symm) + + +lemma normal_pair_lipschitzMul (X : Fin 2 → H1 Ω) (u : H1 Ω) : + inner ℝ (vectorValue (fun i => H1.lipschitzMul ho hbound hb (X i))) (H1.grad u)+ + inner ℝ (divergenceL (fun i => H1.lipschitzMul ho hbound hb (X i))) (H1.value u) = + inner ℝ (vectorValue X) (H1.grad (H1.lipschitzMul ho hbound hb u))+ + inner ℝ (divergenceL X) (H1.value (H1.lipschitzMul ho hbound hb u)) := by + refine Eq.trans (normal_pair_integral _ _) (Eq.trans ?_ (normal_pair_integral _ _).symm) + apply integral_congr_ae + filter_upwards [vectorValue_lipschitzMul_ae ho hbound hb X,divergenceL_lipschitzMul_ae ho hbound hb X, + H1.lipschitzMul_grad_ae ho hbound hb u,H1.lipschitzMul_value_ae ho hbound hb u] with x hV hD hG hu + exact (congrArg₂ (fun V : Plane => fun F : ℝ => + inner ℝ V (H1.grad u x)+F*H1.value u x) hV hD).trans + ((normal_multiplier_algebra _ _ _ _ _ _).trans + (congrArg₂ (fun G : Plane => fun v : ℝ => inner ℝ (vectorValue X x) G+divergenceL X x*v) hG hu).symm) + + +theorem TangentWeak.lipschitzMul {X : Fin 2 → H1 Ω} (hX : TangentWeak X) : + TangentWeak (fun i => H1.lipschitzMul ho hbound hb (X i)) := by + intro u + have he := normal_pair_lipschitzMul ho hbound hb X u + have hz := hX (H1.lipschitzMul ho hbound hb u) + linarith only [he,hz] + +theorem boundaryClass_lipschitz_multiplier_identity (μ : ℝ) (X Y Z : Fin 2 → H1 Ω) + (hX : TangentWeak X) + (hY : ∀ i, ∃ w : H10 ho, Y i-H1.lipschitzMul ho hbound hb (X i)=w.val) + (hZ : ∀ i, ∃ w : H10 ho, + Z i-H1.lipschitzMul ho hbound hb (H1.lipschitzMul ho hbound hb (X i))=w.val) + (hpos : ∀ V : Fin 2 → H1 Ω, TangentWeak V → 0 ≤ vectorForm μ V V) + (hnull : vectorForm μ X X=0) : + vectorForm μ Y Y=cartesianForm μ Y Y-cartesianForm μ X Z := by + let M := H1.lipschitzMul ho hbound hb + have htZ : TangentWeak Z := TangentWeak.of_class ho + ((hX.lipschitzMul ho hbound hb).lipschitzMul ho hbound hb) hZ + have hz : vectorForm μ X Z=0 := vectorForm_null_pair μ X Z hX htZ hpos hnull + have hYY : boundaryDefect Y Y = boundaryDefect (fun i => M (X i)) (fun i => M (X i)) := + boundaryDefect_class ho Y Y _ _ hY hY + have hZZ : boundaryDefect X Z = boundaryDefect X (fun i => M (M (X i))) := + boundaryDefect_class_right ho X Z _ hZ + have he : boundaryDefect Y Y = boundaryDefect X Z := + hYY.trans ((boundaryDefect_lipschitz_multiplier ho hbound hb X).trans hZZ.symm) + have hqY := vectorForm_eq_cartesian_add_defect μ Y Y + have hqZ := vectorForm_eq_cartesian_add_defect μ X Z + linarith only [hqY,hqZ,he,hz] + + +end StrictHotSpots.Hodge +end +end LipschitzVectorMultiplier + +section PhysicalMultiplierLimit + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal Topology +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen Hodge +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) (hΩ : AdmissibleDomain Ω) +variable (hμ : 0 < firstPositiveNeumannValue Ω) +variable {L : ℝ} (hl : firstPositiveNeumannValue Ω < L) + (hD : ∀ j : H10 hΩ.2.1, L*‖H10.value hΩ.2.1 j‖^2 ≤ ‖H10.grad hΩ.2.1 j‖^2) + +lemma scalarSolution_weak {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) + (v : H10 hΩ.2.1) : + PhysicalHelmholtz.pair (firstPositiveNeumannValue Ω) + (c.scalarSolution hΩ.2.2.1 hΩ.2.2.2.2 hμ hw) v.val=0 := + c.physicalSolution_weak hΩ.2.2.1 hΩ.2.2.2.2 hμ.le hΩ.1 hμ hw _ v + +lemma class_difference {S : Set Plane} (ho : IsOpen S) {a b f : H1 S} + (ha : ∃ v : H10 ho, a-f=v.val) (hb : ∃ v : H10 ho, b-f=v.val) : + ∃ v : H10 ho, a-b=v.val := by + obtain ⟨v,hv⟩ := ha + obtain ⟨w,hw⟩ := hb + refine ⟨v-w,?_⟩ + change a-b=v.val-w.val + exact (show a-b=(a-f)-(b-f) from by abel).trans + (congrArg₂ (fun x y : H1 S => x-y) hv hw) + +lemma scalarSolution_eq_extension {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) : + c.scalarSolution hΩ.2.2.1 hΩ.2.2.2.2 hμ hw = + PhysicalHelmholtz.extension hΩ.2.1 hΩ.2.2.1 hμ.le hl hD + (smooth_closure_H1 hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 hw).toH1 := by + apply PhysicalHelmholtz.unique hΩ.2.1 hΩ.2.2.1 hμ.le hl hD + (c.scalarSolution_weak hΩ hμ hw) + (PhysicalHelmholtz.extension_weak hΩ.2.1 hΩ.2.2.1 hμ.le hl hD _) + exact class_difference hΩ.2.1 (c.scalarSolution_class hΩ.2.2.1 hΩ.2.2.2.2 hμ hw) + (PhysicalHelmholtz.extension_class hΩ.2.1 hΩ.2.2.1 hμ.le hl hD _) + +lemma multipliedGradient_eq_extension {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) + {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) + (i : Fin 2) : c.multipliedGradient hΩ hu hμ hb i = + PhysicalHelmholtz.extension hΩ.2.1 hΩ.2.2.1 hμ.le hl hD + (H1.smoothMul hb hb0 hb1 (eigenGradientField hΩ hu i)) := by + have hh := c.scalarSolution_eq_extension hΩ hμ hl hD + (hb.contDiffOn.mul (closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 (Hodge.e i))) + have he := smoothMul_smooth_closure hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 hb hb0 hb1 + (closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 (Hodge.e i)) + exact hh.trans (congrArg (PhysicalHelmholtz.extension hΩ.2.1 hΩ.2.2.1 hμ.le hl hD) he.symm) + + +def lipschitzMultipliedGradient {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) + {b : Plane → ℝ} {B : ℝ≥0} (hb : LipschitzWith B b) : Fin 2 → H1 Ω := fun i => + PhysicalHelmholtz.extension hΩ.2.1 hΩ.2.2.1 hμ.le hl hD + (H1.lipschitzMul hΩ.2.1 hΩ.2.2.1 hb (eigenGradientField hΩ hu i)) + +lemma multipliedGradient_tendsto {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) + {b : Plane → ℝ} {B : ℝ≥0} (hb : LipschitzWith B b) (i : Fin 2) : + Tendsto (fun n => c.multipliedGradient hΩ hu hμ (ambientSmooth_smooth (planeApproxBump n) hb) i) + atTop (𝓝 (lipschitzMultipliedGradient hΩ hμ hl hD hu hb i)) := by + have ht := (PhysicalHelmholtz.extension hΩ.2.1 hΩ.2.2.1 hμ.le hl hD).continuous.continuousAt.tendsto.comp + (smoothMul_tendsto_lipschitzMul hΩ.2.1 hΩ.2.2.1 hb (eigenGradientField hΩ hu i)) + apply ht.congr' + exact Eventually.of_forall fun n => (c.multipliedGradient_eq_extension hΩ hμ hl hD hu + (ambientSmooth_smooth (planeApproxBump n) hb) + (continuous_closure_memLp_top hΩ.2.1 hΩ.2.2.1 + (ambientSmooth_lipschitz (planeApproxBump n) hb).continuous.continuousOn) + (lipschitz_gradient_memLp_top (ambientSmooth_lipschitz (planeApproxBump n) hb)) i).symm + +lemma lipschitzMultipliedGradient_class {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) + {b : Plane → ℝ} {B : ℝ≥0} (hb : LipschitzWith B b) (i : Fin 2) : + ∃ w : H10 hΩ.2.1, lipschitzMultipliedGradient hΩ hμ hl hD hu hb i- + H1.lipschitzMul hΩ.2.1 hΩ.2.2.1 hb (eigenGradientField hΩ hu i)=w.val := + PhysicalHelmholtz.extension_class hΩ.2.1 hΩ.2.2.1 hμ.le hl hD _ + +lemma lipschitzMultipliedGradient_tangent {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) + {b : Plane → ℝ} {B : ℝ≥0} (hb : LipschitzWith B b) : + TangentWeak (lipschitzMultipliedGradient hΩ hμ hl hD hu hb) := + TangentWeak.of_class hΩ.2.1 ((eigenGradientField_null hΩ hu).1.lipschitzMul hΩ.2.1 hΩ.2.2.1 hb) + (lipschitzMultipliedGradient_class hΩ hμ hl hD hu hb) + +end StrictHotSpots.Conformal.ClosedDiskChart + +namespace StrictHotSpots.Hodge +variable {Ω : Set Plane} +lemma vectorForm_tendsto {X : ℕ → Fin 2 → H1 Ω} {Y : Fin 2 → H1 Ω} + (h : ∀ i, Tendsto (fun n => X n i) atTop (𝓝 (Y i))) (μ : ℝ) : + Tendsto (fun n => vectorForm μ (X n) (X n)) atTop (𝓝 (vectorForm μ Y Y)) := by + have hg (i : Fin 2) := H1.grad.continuous.continuousAt.tendsto.comp (h i) + have hv (i : Fin 2) := H1.value.continuous.continuousAt.tendsto.comp (h i) + have hp (i j : Fin 2) := (coordinateL Ω i).continuous.continuousAt.tendsto.comp (hg j) + have ha (i : Fin 2) := (axisL Ω i).continuous.continuousAt.tendsto.comp (hv i) + have hd := (hp 0 0).add (hp 1 1) + have hc := (hp 0 1).sub (hp 1 0) + have hb := (ha 0).add (ha 1) + exact ((hd.inner hd).add (hc.inner hc)).sub ((hb.inner hb).const_mul μ) +end StrictHotSpots.Hodge +end +end PhysicalMultiplierLimit + +section MultiplierKernelConvergence + +noncomputable section +open Set MeasureTheory Filter Metric +open scoped ENNReal NNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +lemma harmonic_square_bound {b : Boundary → ℝ} {B : ℝ≥0} + (hb : LipschitzWith B b) (s t : Boundary) : + ‖boundaryInteraction s t*(b s-b t)^2‖ ≤ (B:ℝ)*B/Real.pi := by + simpa only [Real.inner_apply,pow_two] using harmonic_boundary_bound hb hb s t + +lemma multiplier_integrand_bound {R : Boundary → Boundary → ℝ} + {g : Boundary → E} {b : Boundary → ℝ} {B : ℝ≥0} + (hb : LipschitzWith B b) {M G : ℝ} (_hM : 0 ≤ M) (hG : 0 ≤ G) + (hbM : ∀ s, ‖b s‖ ≤ M) (hgG : ∀ s, ‖g s‖ ≤ G) (s t : Boundary) : + ‖(boundaryInteraction s t+R s t)*(b s-b t)^2*inner ℝ (g s) (g t)‖ ≤ + ((B:ℝ)*B/Real.pi+(M+M)^2*‖R s t‖)*(G*G) := by + have hd : ‖b s-b t‖ ≤ M+M := (norm_sub_le _ _).trans (add_le_add (hbM s) (hbM t)) + have hi : ‖inner ℝ (g s) (g t)‖ ≤ G*G := + (norm_inner_le_norm _ _).trans (mul_le_mul (hgG s) (hgG t) (norm_nonneg _) hG) + have hr : ‖R s t*(b s-b t)^2‖ ≤ (M+M)^2*‖R s t‖ := by + rw [norm_mul,norm_pow,mul_comm] + exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (norm_nonneg _) hd 2) (norm_nonneg _) + have he : (boundaryInteraction s t+R s t)*(b s-b t)^2 = + boundaryInteraction s t*(b s-b t)^2+R s t*(b s-b t)^2 := by ring + rw [he,norm_mul] + exact mul_le_mul ((norm_add_le _ _).trans (add_le_add (harmonic_square_bound hb s t) hr)) + hi (norm_nonneg _) (by positivity) + + + + +theorem multiplier_kernel_tendsto {R : Boundary → Boundary → ℝ} + (hR : Integrable (fun z : Boundary × Boundary => R z.1 z.2) (boundaryMeasure.prod boundaryMeasure)) + {g : Boundary → E} (hg : Continuous g) {b : Boundary → ℝ} {bn : ℕ → Boundary → ℝ} + {B : ℝ≥0} (hb : ∀ n, LipschitzWith B (bn n)) {M : ℝ} (hM : 0 ≤ M) + (hMb : ∀ n s, ‖bn n s‖ ≤ M) (ht : ∀ s, Tendsto (fun n => bn n s) atTop (𝓝 (b s))) : + Tendsto (fun n => ∫ z : Boundary × Boundary, + (boundaryInteraction z.1 z.2+R z.1 z.2)*(bn n z.1-bn n z.2)^2* + inner ℝ (g z.1) (g z.2) ∂boundaryMeasure.prod boundaryMeasure) atTop + (𝓝 (∫ z : Boundary × Boundary, + (boundaryInteraction z.1 z.2+R z.1 z.2)*(b z.1-b z.2)^2* + inner ℝ (g z.1) (g z.2) ∂boundaryMeasure.prod boundaryMeasure)) := by + obtain ⟨G,hG,hGb⟩ := boundary_continuous_bound hg + apply tendsto_integral_of_dominated_convergence + (fun z : Boundary × Boundary => ((B:ℝ)*B/Real.pi+(M+M)^2*‖R z.1 z.2‖)*(G*G)) + · intro n + exact ((boundaryInteraction_measurable.aestronglyMeasurable.add hR.aestronglyMeasurable).mul + ((((hb n).continuous.comp continuous_fst).sub ((hb n).continuous.comp continuous_snd)).pow 2).aestronglyMeasurable).mul + ((hg.comp continuous_fst).inner (hg.comp continuous_snd)).aestronglyMeasurable + · exact ((integrable_const _).add (hR.norm.const_mul ((M+M)^2))).mul_const (G*G) + · intro n + exact Eventually.of_forall fun z => multiplier_integrand_bound (hb n) hM hG (hMb n) hGb z.1 z.2 + · exact Eventually.of_forall fun z => + ((((ht z.1).sub (ht z.2)).pow 2).const_mul _).mul_const _ + +end StrictHotSpots.PlaneGreen +end +end MultiplierKernelConvergence + +section ScalarBoundaryForm + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen Hodge +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) +variable (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) +variable (hμ : 0 < firstPositiveNeumannValue Ω) + +lemma scalarSolution_form (hne : Ω.Nonempty) + {w z : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) + (hz : ContDiffOn ℝ ∞ z (closure Ω)) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hb + H1.form (firstPositiveNeumannValue Ω) (c.scalarSolution hb hs hμ hw) + (c.scalarSolution hb hs hμ hz) = + boundaryForm (fullBoundaryR c.densityBound_ne_top (c.density_bound hμ.le)) 0 + (fun s : Boundary => w (c.F s)) (fun s : Boundary => z (c.F s)) := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hb + have he := c.scalarSolution_energy hb hs hμ hne hw hz + simp only [boundaryForm,Pi.zero_apply,zero_mul,integral_zero,add_zero, + RCLike.inner_apply,conj_trivial] at ⊢ + change _ = _ + rw [show H1.form (firstPositiveNeumannValue Ω) (c.scalarSolution hb hs hμ hw) + (c.scalarSolution hb hs hμ hz) = _ from he] + congr 1 + congr 1 + funext q + ring + +end StrictHotSpots.Conformal.ClosedDiskChart +namespace StrictHotSpots.Hodge +lemma cartesianForm_eq_sum {Ω : Set Plane} (μ : ℝ) (X Y : Fin 2 → H1 Ω) : + cartesianForm μ X Y=H1.form μ (X 0) (Y 0)+H1.form μ (X 1) (Y 1) := by + simp only [cartesianForm,cartesianEnergy,H1.form] + ring +end StrictHotSpots.Hodge +end +end ScalarBoundaryForm + +section SmoothMultiplierKernel + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen Hodge +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) (hΩ : AdmissibleDomain Ω) +variable {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) +variable (hμ : 0 < firstPositiveNeumannValue Ω) + +lemma multipliedGradient_coordinate_difference {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) (i : Fin 2) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + H1.form (firstPositiveNeumannValue Ω) (c.multipliedGradient hΩ hu hμ hb i) + (c.multipliedGradient hΩ hu hμ hb i)- + H1.form (firstPositiveNeumannValue Ω) (eigenGradientField hΩ hu i) + (c.multipliedGradient hΩ hu hμ (hb.mul hb) i) = + (1/2:ℝ)*∫ z : Boundary × Boundary, + (boundaryInteraction z.1 z.2+fullBoundaryR c.densityBound_ne_top (c.density_bound hμ.le) z.1 z.2)* + (b (c.F z.1)-b (c.F z.2))^2* + inner ℝ (fderivWithin ℝ u (closure Ω) (c.F z.1) (Hodge.e i)) + (fderivWithin ℝ u (closure Ω) (c.F z.2) (Hodge.e i)) ∂boundaryMeasure.prod boundaryMeasure := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + let hw := closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 (Hodge.e i) + have hx : eigenGradientField hΩ hu i = c.scalarSolution hΩ.2.2.1 hΩ.2.2.2.2 hμ hw := + (c.scalarSolution_eq_of_helmholtz hΩ.2.2.1 hΩ.2.2.2.2 hμ hΩ.1 hw + (fun _ hx => closed_directional_helmholtz hΩ.2.1 hu (Hodge.e i) hx)).symm + rw [hx] + change H1.form _ (c.scalarSolution _ _ hμ (hb.contDiffOn.mul hw)) + (c.scalarSolution _ _ hμ (hb.contDiffOn.mul hw))- + H1.form _ (c.scalarSolution _ _ hμ hw) + (c.scalarSolution _ _ hμ ((hb.contDiffOn.mul hb.contDiffOn).mul hw)) = _ + rw [c.scalarSolution_form _ _ _ hΩ.1,c.scalarSolution_form _ _ _ hΩ.1] + obtain ⟨A,hA⟩ := c.datumTrace_lipschitz hΩ.2.2.1 hΩ.2.2.2.2 hw + obtain ⟨B,hB⟩ := c.datumTrace_lipschitz hΩ.2.2.1 hΩ.2.2.2.2 hb.contDiffOn + change LipschitzWith A (fun s : Boundary => fderivWithin ℝ u (closure Ω) (c.F s) (Hodge.e i)) at hA + change LipschitzWith B (fun s : Boundary => b (c.F s)) at hB + exact (by simpa only [smul_eq_mul,pow_two] using + (boundaryForm_multiplier_difference (c := (0 : Boundary → ℝ)) + (fullBoundaryR_integrable c.densityBound_ne_top (c.density_bound hμ.le)) + (fullBoundaryR_symm c.densityBound_ne_top (c.density_bound hμ.le) + (c.operator_norm_lt_one hΩ.2.2.1 hΩ.1 hμ)) hA hB)) + +lemma datum_multiplier_integrable {w b : Plane → ℝ} + (hw : ContDiffOn ℝ ∞ w (closure Ω)) (hb : ContDiff ℝ ∞ b) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + Integrable (fun z : Boundary × Boundary => + (boundaryInteraction z.1 z.2+fullBoundaryR c.densityBound_ne_top (c.density_bound hμ.le) z.1 z.2)* + (b (c.F z.1)-b (c.F z.2))^2 * inner ℝ (w (c.F z.1)) (w (c.F z.2))) + (boundaryMeasure.prod boundaryMeasure) := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + obtain ⟨A,hA⟩ := c.datumTrace_lipschitz hΩ.2.2.1 hΩ.2.2.2.2 hw + obtain ⟨B,hB⟩ := c.datumTrace_lipschitz hΩ.2.2.1 hΩ.2.2.2.2 hb.contDiffOn + change LipschitzWith A (fun s : Boundary => w (c.F s)) at hA + change LipschitzWith B (fun s : Boundary => b (c.F s)) at hB + have hR : Integrable (fun z : Boundary × Boundary => + fullBoundaryR c.densityBound_ne_top (c.density_bound hμ.le) z.1 z.2) + (boundaryMeasure.prod boundaryMeasure) := + fullBoundaryR_integrable c.densityBound_ne_top (c.density_bound hμ.le) + exact multiplier_integrand_integrable (E := ℝ) (g := fun s : Boundary => w (c.F s)) + (b := fun s : Boundary => b (c.F s)) hR hA hB + + + +theorem smooth_multiplier_kernel {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + vectorForm (firstPositiveNeumannValue Ω) (c.multipliedGradient hΩ hu hμ hb) + (c.multipliedGradient hΩ hu hμ hb) = + (1/2:ℝ)*∫ z : Boundary × Boundary, + (boundaryInteraction z.1 z.2+fullBoundaryR c.densityBound_ne_top (c.density_bound hμ.le) z.1 z.2)* + (b (c.F z.1)-b (c.F z.2))^2* + inner ℝ (closedGradient Ω u (c.F z.1)) (closedGradient Ω u (c.F z.2)) + ∂boundaryMeasure.prod boundaryMeasure := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + let T (i : Fin 2) (z : Boundary × Boundary) := + (boundaryInteraction z.1 z.2+fullBoundaryR c.densityBound_ne_top (c.density_bound hμ.le) z.1 z.2)* + (b (c.F z.1)-b (c.F z.2))^2* + inner ℝ (fderivWithin ℝ u (closure Ω) (c.F z.1) (Hodge.e i)) + (fderivWithin ℝ u (closure Ω) (c.F z.2) (Hodge.e i)) + have hi (i : Fin 2) : Integrable (T i) (boundaryMeasure.prod boundaryMeasure) := + c.datum_multiplier_integrable hΩ hμ + (closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 (Hodge.e i)) hb + rw [c.multipliedGradient_identity hΩ hu hμ hb hb0 hb1, + cartesianForm_eq_sum,cartesianForm_eq_sum] + have h0 := c.multipliedGradient_coordinate_difference hΩ hu hμ hb 0 + have h1 := c.multipliedGradient_coordinate_difference hΩ hu hμ hb 1 + change _ = (1/2:ℝ)* _ at h0 h1 + have ha : (∫ z, T 0 z ∂boundaryMeasure.prod boundaryMeasure)+ + (∫ z, T 1 z ∂boundaryMeasure.prod boundaryMeasure) = + ∫ z : Boundary × Boundary, + (boundaryInteraction z.1 z.2+fullBoundaryR c.densityBound_ne_top (c.density_bound hμ.le) z.1 z.2)* + (b (c.F z.1)-b (c.F z.2))^2* + inner ℝ (closedGradient Ω u (c.F z.1)) (closedGradient Ω u (c.F z.2)) + ∂boundaryMeasure.prod boundaryMeasure := by + rw [← integral_add (hi 0) (hi 1)] + apply integral_congr_ae + filter_upwards [] with z + rw [Hodge.inner_two] + simp only [T,Hodge.c,closedGradient, + InnerProductSpace.toDual_symm_apply,Real.inner_apply] + ring + change (∫ z, T 0 z ∂boundaryMeasure.prod boundaryMeasure)+ + (∫ z, T 1 z ∂boundaryMeasure.prod boundaryMeasure) = _ at ha + change _ = (1/2:ℝ)*(∫ z, T 0 z ∂boundaryMeasure.prod boundaryMeasure) at h0 + change _ = (1/2:ℝ)*(∫ z, T 1 z ∂boundaryMeasure.prod boundaryMeasure) at h1 + linarith + +include hu in + +theorem smooth_multiplier_kernel_nonneg {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + 0 ≤ (1/2:ℝ)*∫ z : Boundary × Boundary, + (boundaryInteraction z.1 z.2+fullBoundaryR c.densityBound_ne_top (c.density_bound hμ.le) z.1 z.2)* + (b (c.F z.1)-b (c.F z.2))^2* + inner ℝ (closedGradient Ω u (c.F z.1)) (closedGradient Ω u (c.F z.2)) + ∂boundaryMeasure.prod boundaryMeasure := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + change 0 ≤ (1/2:ℝ) * _ + rw [← c.smooth_multiplier_kernel hΩ hu hμ hb hb0 hb1] + exact c.multipliedGradient_nonneg hΩ hu hμ hb hb0 hb1 +end StrictHotSpots.Conformal.ClosedDiskChart +end +end SmoothMultiplierKernel + +section LipschitzMultiplierKernel + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal Topology +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen Hodge +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) (hΩ : AdmissibleDomain Ω) +variable {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) +variable (hμ : 0 < firstPositiveNeumannValue Ω) +variable {L : ℝ} (hl : firstPositiveNeumannValue Ω < L) + (hD : ∀ j : H10 hΩ.2.1, L*‖H10.value hΩ.2.1 j‖^2 ≤ ‖H10.grad hΩ.2.1 j‖^2) + +include hΩ hu in +lemma closedGradient_trace_continuous : + Continuous (fun s : Boundary => closedGradient Ω u (c.F s)) := by + apply (closedGradient_continuous hΩ.2.1 hΩ.2.2.2.2 hu.1).comp_continuous + (c.lipschitz.continuous.comp continuous_subtype_val) + intro s + exact c.maps_closed (boundary_mem_closed s) + +lemma physical_boundary_lipschitz {b : Plane → ℝ} {B : ℝ≥0} + (hb : LipschitzWith B b) : LipschitzWith ((B*c.Lip)*1) + (fun s : Boundary => b (c.F s)) := + (hb.comp c.lipschitz).comp (LipschitzWith.subtype_val _) + +include hΩ in +lemma smooth_physical_boundary_bound {b : Plane → ℝ} {B : ℝ≥0} + (hb : LipschitzWith B b) : ∃ M : ℝ, 0 ≤ M ∧ ∀ n (s : Boundary), + ‖ambientSmooth (planeApproxBump n) b (c.F s)‖ ≤ M := by + have hc : Bornology.IsBounded (closure Ω) := hΩ.2.2.1.closure + obtain ⟨M,hM,hMb⟩ := ambientSmooth_uniform_bound hc hb + exact ⟨M,hM,fun n s => hMb n (c.F s) (c.maps_closed (boundary_mem_closed s))⟩ + +include hΩ in +lemma physical_multiplier_integral_tendsto + {R : Boundary → Boundary → ℝ} + (hR : Integrable (fun z : Boundary × Boundary => R z.1 z.2) + (boundaryMeasure.prod boundaryMeasure)) + {g : Boundary → Plane} (hg : Continuous g) + {b : Plane → ℝ} {B : ℝ≥0} (hb : LipschitzWith B b) : + Tendsto (fun n => ∫ z : Boundary × Boundary, + (boundaryInteraction z.1 z.2+R z.1 z.2)* + (ambientSmooth (planeApproxBump n) b (c.F z.1)-ambientSmooth (planeApproxBump n) b (c.F z.2))^2* + inner ℝ (g z.1) (g z.2) ∂boundaryMeasure.prod boundaryMeasure) atTop + (𝓝 (∫ z : Boundary × Boundary, + (boundaryInteraction z.1 z.2+R z.1 z.2)*(b (c.F z.1)-b (c.F z.2))^2* + inner ℝ (g z.1) (g z.2) ∂boundaryMeasure.prod boundaryMeasure)) := by + let bn : ℕ → Boundary → ℝ := fun n s => ambientSmooth (planeApproxBump n) b (c.F s) + have hn (n : ℕ) : LipschitzWith ((B*c.Lip)*1) (bn n) := + c.physical_boundary_lipschitz (ambientSmooth_lipschitz (planeApproxBump n) hb) + obtain ⟨M,hM,hMb⟩ := c.smooth_physical_boundary_bound hΩ hb + have hm (n : ℕ) (s : Boundary) : ‖bn n s‖ ≤ M := hMb n s + have ht (s : Boundary) : Tendsto (fun n => bn n s) atTop (𝓝 (b (c.F s))) := + ambientSmooth_tendsto planeApproxBump_rOut_tendsto hb (c.F s) + exact multiplier_kernel_tendsto (bn:=bn) (B:=(B*c.Lip)*1) hR hg hn hM hm ht + + + +theorem lipschitz_multiplier_kernel {b : Plane → ℝ} {B : ℝ≥0} + (hb : LipschitzWith B b) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + vectorForm (firstPositiveNeumannValue Ω) + (lipschitzMultipliedGradient hΩ hμ hl hD hu hb) + (lipschitzMultipliedGradient hΩ hμ hl hD hu hb) = + (1/2:ℝ)*∫ z : Boundary × Boundary, + (boundaryInteraction z.1 z.2+fullBoundaryR c.densityBound_ne_top (c.density_bound hμ.le) z.1 z.2)* + (b (c.F z.1)-b (c.F z.2))^2* + inner ℝ (closedGradient Ω u (c.F z.1)) (closedGradient Ω u (c.F z.2)) + ∂boundaryMeasure.prod boundaryMeasure := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + have hlhs := vectorForm_tendsto (c.multipliedGradient_tendsto hΩ hμ hl hD hu hb) + (firstPositiveNeumannValue Ω) + have hrhs := (c.physical_multiplier_integral_tendsto hΩ + (fullBoundaryR_integrable c.densityBound_ne_top (c.density_bound hμ.le)) + (c.closedGradient_trace_continuous hΩ hu) hb).const_mul (1/2:ℝ) + apply tendsto_nhds_unique hlhs + apply hrhs.congr' + exact Eventually.of_forall fun n => (c.smooth_multiplier_kernel hΩ hu hμ + (ambientSmooth_smooth (planeApproxBump n) hb) + (continuous_closure_memLp_top hΩ.2.1 hΩ.2.2.1 + (ambientSmooth_lipschitz (planeApproxBump n) hb).continuous.continuousOn) + (lipschitz_gradient_memLp_top (ambientSmooth_lipschitz (planeApproxBump n) hb))).symm + +lemma lipschitzMultipliedGradient_nonneg {b : Plane → ℝ} {B : ℝ≥0} (hb : LipschitzWith B b) : + 0 ≤ vectorForm (firstPositiveNeumannValue Ω) + (lipschitzMultipliedGradient hΩ hμ hl hD hu hb) + (lipschitzMultipliedGradient hΩ hμ hl hD hu hb) := + vectorForm_nonneg hΩ.2.1 hΩ.1 hΩ.2.2.2.1 hΩ.2.2.1 hμ hl hD _ + (lipschitzMultipliedGradient_tangent hΩ hμ hl hD hu hb) + +end StrictHotSpots.Conformal.ClosedDiskChart +end +end LipschitzMultiplierKernel + +section HilbertMultiplierSum + +noncomputable section +open Set MeasureTheory Metric Function +open scoped InnerProductSpace Topology +namespace StrictHotSpots.HilbertMultipliers + +lemma orthonormal_countable {H ι : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] + [TopologicalSpace.SeparableSpace H] {e : ι → H} (he : Orthonormal ℝ e) : Countable ι := by + have hp : Pairwise (Disjoint on fun i => ball (e i) (1/2:ℝ)) := by + intro i j hij + apply disjoint_left.mpr + intro x hxi hxj + have hd : dist (e i) (e j) < 1 := by + have h := dist_triangle (e i) x (e j) + have hi : dist (e i) x < 1/2 := by simpa [dist_comm] using hxi + have hj : dist x (e j) < 1/2 := hxj + linarith + have hn : ‖e i-e j‖^2 = 2 := by + rw [norm_sub_sq_real,he.1 i,he.1 j,he.2 hij] + norm_num + rw [dist_eq_norm] at hd + nlinarith [norm_nonneg (e i-e j)] + exact hp.countable_of_isOpen_disjoint (fun _ => isOpen_ball) + (fun i => ⟨e i,mem_ball_self (by norm_num)⟩) + +lemma coordinate_hasSum {H ι : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] + (e : HilbertBasis ι ℝ H) (x : H) : + HasSum (fun i => (inner ℝ (e i) x)^2) (‖x‖^2) := by + have h := e.hasSum_inner_mul_inner x x + simpa only [real_inner_comm x,← pow_two,real_inner_self_eq_norm_sq] using h + + + +theorem coordinate_energy_sum {X H E ι : Type*} [MeasurableSpace X] + [NormedAddCommGroup H] [InnerProductSpace ℝ H] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + [Countable ι] (μ : Measure X) [SFinite μ] (e : HilbertBasis ι ℝ H) + (N : X → X → ℝ) (K : X → ℝ) (b : X → H) (g : X → E) + (hN : ∀ s t, 0 ≤ N s t) + (hidentity : ∀ᵐ z : X × X ∂μ.prod μ, N z.1 z.2 * ‖b z.1-b z.2‖^2 = K z.1*K z.2) + (hKg : Integrable (fun s => K s • g s) μ) + (hbound : Integrable (fun z : X × X => + N z.1 z.2 * ‖b z.1-b z.2‖^2 * (‖g z.1‖*‖g z.2‖)) (μ.prod μ)) + (hF : ∀ i, AEStronglyMeasurable (fun z : X × X => N z.1 z.2 * + (inner ℝ (e i) (b z.1-b z.2))^2 * inner ℝ (g z.1) (g z.2)) (μ.prod μ)) : + HasSum (fun i => (1/2:ℝ) * ∫ z : X × X, N z.1 z.2 * + (inner ℝ (e i) (b z.1-b z.2))^2 * inner ℝ (g z.1) (g z.2) ∂μ.prod μ) + ((1/2:ℝ)*‖∫ s, K s • g s ∂μ‖^2) := by + let B : ι → X × X → ℝ := fun i z => + N z.1 z.2 * (inner ℝ (e i) (b z.1-b z.2))^2 * (‖g z.1‖*‖g z.2‖) + have hB (z : X × X) : HasSum (fun i => B i z) + (N z.1 z.2 * ‖b z.1-b z.2‖^2 * (‖g z.1‖*‖g z.2‖)) := + ((coordinate_hasSum e (b z.1-b z.2)).mul_left (N z.1 z.2)).mul_right _ + have hsum := hasSum_integral_of_dominated_convergence (μ := μ.prod μ) B hF + (fun i => Filter.Eventually.of_forall (fun z => by + rw [Real.norm_eq_abs,abs_mul,abs_mul,abs_of_nonneg (hN _ _),abs_of_nonneg (sq_nonneg _)] + exact mul_le_mul_of_nonneg_left (abs_real_inner_le_norm _ _) (mul_nonneg (hN _ _) (sq_nonneg _)))) + (Filter.Eventually.of_forall (fun z => (hB z).summable)) + (hbound.congr (Filter.Eventually.of_forall (fun z => (hB z).tsum_eq.symm))) + (Filter.Eventually.of_forall (fun z => + ((coordinate_hasSum e (b z.1-b z.2)).mul_left (N z.1 z.2)).mul_right (inner ℝ (g z.1) (g z.2)))) + have hint : (∫ z : X × X, N z.1 z.2 * ‖b z.1-b z.2‖^2 * + inner ℝ (g z.1) (g z.2) ∂μ.prod μ) = ‖∫ s, K s • g s ∂μ‖^2 := by + calc + _ = ∫ z : X × X, inner ℝ (K z.1 • g z.1) (K z.2 • g z.2) ∂μ.prod μ := by + apply integral_congr_ae + filter_upwards [hidentity] with z hz + rw [hz,real_inner_smul_left,real_inner_smul_right] + ring + _ = ∫ s, ∫ t, inner ℝ (K s • g s) (K t • g t) ∂μ ∂μ := by + exact integral_prod _ (Integrable.op_fst_snd (op := inner ℝ) (continuous_fst.inner continuous_snd) + ⟨1, fun x y => by simpa only [one_mul] using norm_inner_le_norm x y⟩ hKg hKg) + _ = ∫ s, inner ℝ (K s • g s) (∫ t, K t • g t ∂μ) ∂μ := by + apply integral_congr_ae + exact Filter.Eventually.of_forall (fun s => integral_inner hKg _) + _ = ∫ s, inner ℝ (∫ t, K t • g t ∂μ) (K s • g s) ∂μ := by + apply integral_congr_ae + exact Filter.Eventually.of_forall (fun s => real_inner_comm _ _) + _ = inner ℝ (∫ s, K s • g s ∂μ) (∫ s, K s • g s ∂μ) := integral_inner hKg _ + _ = _ := real_inner_self_eq_norm_sq _ + rw [hint] at hsum + exact hsum.mul_left (1/2:ℝ) + +lemma nonnegative_coordinate_energy_zero {ι : Type*} {E : ι → ℝ} + (hs : HasSum E 0) (hE : ∀ i, 0 ≤ E i) (i : ι) : E i = 0 := by + apply le_antisymm _ (hE i) + simpa only [hs.tsum_eq] using hs.summable.le_tsum i (fun j _ => hE j) + +end StrictHotSpots.HilbertMultipliers +end +end HilbertMultiplierSum + +section HilbertKernelCoordinates + +noncomputable section +open Set MeasureTheory Filter Metric Function +open scoped ENNReal NNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) + +lemma fullBoundaryN_nonneg (hT : ‖weightedIntegralOperator hC hν‖ < 1) (s t : Boundary) : + 0 ≤ fullBoundaryN hC hν s t := by + rw [fullBoundaryN_eq] + exact add_nonneg (by unfold boundaryInteraction DiskFormula.boundaryInteraction; positivity) (fullBoundaryR_nonneg hC hν hT s t) + +lemma boundary_pair_ne : ∀ᵐ z : Boundary × Boundary ∂boundaryMeasure.prod boundaryMeasure, z.1 ≠ z.2 := by + apply (Measure.ae_prod_iff_ae_ae (isClosed_eq continuous_fst continuous_snd).isOpen_compl.measurableSet).mpr + exact Eventually.of_forall fun s => (boundaryMeasure.ae_ne s).mono fun _ h => h.symm + + +lemma full_embedding_identity {H : Type*} [NormedAddCommGroup H] (p : disk) + (hT : ‖weightedIntegralOperator hC hν‖ < 1) {b : Boundary → H} + (hb : ∀ s t, ‖b s-b t‖^2 = fullDistanceKernel hC hν p s t) : + ∀ᵐ z : Boundary × Boundary ∂boundaryMeasure.prod boundaryMeasure, + fullBoundaryN hC hν z.1 z.2 * ‖b z.1-b z.2‖^2 = + fullBoundaryK hC hν p z.1 * fullBoundaryK hC hν p z.2 := by + filter_upwards [boundary_pair_ne] with z hz + rw [hb,fullDistanceKernel,ite_eq_right hz] + exact mul_div_cancel₀ _ (fullBoundaryN_pos hC hν hT _ _ hz).ne' + + +theorem full_embedding_coordinate_sum {H E ι : Type*} [NormedAddCommGroup H] + [InnerProductSpace ℝ H] [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + [Countable ι] (e : HilbertBasis ι ℝ H) + (p : disk) (hT : ‖weightedIntegralOperator hC hν‖ < 1) {b : Boundary → H} + (hb : Continuous b) (hid : ∀ s t, ‖b s-b t‖^2 = fullDistanceKernel hC hν p s t) + {g : Boundary → E} (hg : Continuous g) : + HasSum (fun i => (1/2:ℝ)*∫ z : Boundary × Boundary, + fullBoundaryN hC hν z.1 z.2 * (inner ℝ (e i) (b z.1-b z.2))^2 * + inner ℝ (g z.1) (g z.2) ∂boundaryMeasure.prod boundaryMeasure) + ((1/2:ℝ)*‖∫ s, fullBoundaryK hC hν p s • g s ∂boundaryMeasure‖^2) := by + have hidentity := full_embedding_identity hC hν p hT hid + obtain ⟨B,hB,hBK⟩ := fullBoundaryK_bounded hC hν p + obtain ⟨M,hM,hMg⟩ := boundary_continuous_bound hg + have hKg : Integrable (fun s => fullBoundaryK hC hν p s • g s) boundaryMeasure := by + apply Integrable.of_bound ((fullBoundaryK_measurable hC hν p).aestronglyMeasurable.smul + hg.aestronglyMeasurable) (B*M) + exact Eventually.of_forall fun s => by + change ‖fullBoundaryK hC hν p s • g s‖ ≤ B*M + rw [norm_smul,Real.norm_of_nonneg (fullBoundaryK_pos hC hν hT p s).le] + exact mul_le_mul (hBK s) (hMg s) (norm_nonneg _) hB + have hKn : Integrable (fun s => fullBoundaryK hC hν p s * ‖g s‖) boundaryMeasure := by + apply hKg.norm.congr + exact Eventually.of_forall fun s => by + change ‖fullBoundaryK hC hν p s • g s‖ = _ + rw [norm_smul,Real.norm_of_nonneg (fullBoundaryK_pos hC hν hT p s).le] + apply HilbertMultipliers.coordinate_energy_sum boundaryMeasure e (fullBoundaryN hC hν) + (fullBoundaryK hC hν p) b g (fullBoundaryN_nonneg hC hν hT) hidentity hKg + · apply (hKn.mul_prod hKn).congr + filter_upwards [hidentity] with z hz + rw [hz] + ring + · intro i + exact ((fullBoundaryN_measurable hC hν).mul + ((continuous_const.inner ((hb.comp continuous_fst).sub (hb.comp continuous_snd))).measurable.pow_const 2)).mul + ((hg.comp continuous_fst).inner (hg.comp continuous_snd)).measurable |>.aestronglyMeasurable + +end StrictHotSpots.PlaneGreen +end +end HilbertKernelCoordinates + +section OriginalGradientVector + +noncomputable section +open Set MeasureTheory Filter Metric Function +open scoped ENNReal NNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +variable {ν : Measure Plane} [IsFiniteMeasure ν] {C : ℝ≥0∞} + (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict disk) +lemma boundary_K_vector_integrable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (p : disk) (hT : ‖weightedIntegralOperator hC hν‖ < 1) {g : Boundary → E} + (hg : Continuous g) : Integrable (fun s => fullBoundaryK hC hν p s • g s) boundaryMeasure := by + obtain ⟨B,hB,hBK⟩ := fullBoundaryK_bounded hC hν p + obtain ⟨M,_,hMg⟩ := boundary_continuous_bound hg + apply Integrable.of_bound ((fullBoundaryK_measurable hC hν p).aestronglyMeasurable.smul + hg.aestronglyMeasurable) (B*M) + exact Eventually.of_forall fun s => by + change ‖fullBoundaryK hC hν p s • g s‖ ≤ B*M + rw [norm_smul,Real.norm_of_nonneg (fullBoundaryK_pos hC hν hT p s).le] + exact mul_le_mul (hBK s) (hMg s) (norm_nonneg _) hB +end StrictHotSpots.PlaneGreen +namespace StrictHotSpots.Conformal.ClosedDiskChart +open PlaneGreen DiskH10 +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) +lemma boundary_gradient_integral_zero (hΩ : AdmissibleDomain Ω) + {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) (hne : ∃ x ∈ Ω, u x ≠ 0) + (p : disk) (hz : gradient u (c.F p) = 0) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + (∫ s, fullBoundaryK c.densityBound_ne_top + (c.density_bound (firstPositiveNeumannValue_pos_of_eigenfunction hΩ hu hne).le) p s • + closedGradient Ω u (c.F s) ∂boundaryMeasure) = 0 := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + have hμ := firstPositiveNeumannValue_pos_of_eigenfunction hΩ hu hne + have hi := boundary_K_vector_integrable c.densityBound_ne_top (c.density_bound hμ.le) p + (c.operator_norm_lt_one hΩ.2.2.1 hΩ.1 hμ) (c.closedGradient_trace_continuous hΩ hu) + apply integral_eq_zero_of_forall_integral_inner_eq_zero ℝ _ hi + intro e + calc + _ = ∫ s, fullBoundaryK c.densityBound_ne_top (c.density_bound hμ.le) p s * + inner ℝ (closedGradient Ω u (c.F s)) e ∂boundaryMeasure := by + apply integral_congr_ae + exact Eventually.of_forall fun s => by simp only [real_inner_smul_right,real_inner_comm] + _ = inner ℝ (gradient u (c.F p)) e := (c.gradient_K_representation hΩ hu hne p e).symm + _ = 0 := by rw [hz,inner_zero_left] +end StrictHotSpots.Conformal.ClosedDiskChart +end +end OriginalGradientVector + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Poisson.lean b/lean/OAI/Analysis/HotSpots/Poisson.lean new file mode 100644 index 0000000000000000000000000000000000000000..a4ccc522d03927dd5953ab5af8a733c0589bae3b --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Poisson.lean @@ -0,0 +1,713 @@ +import OAI.Analysis.HotSpots.Trace +import OAI.Analysis.HotSpots.BoundaryKernel + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section DouglasBoundaryClassCombinedLayer +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ComplexConjugate ContDiff InnerProductSpace +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma planeSeries_boundary (f : C(AddCircle τ, ℂ)) + (h : Summable (fun m => ‖fourierCoeff f m‖)) (s : AddCircle τ) : + planeSeries (fourierCoeff f) (complexIso s.toCircle) = (f s).re := by + simp only [planeSeries,LinearIsometryEquiv.symm_apply_apply,harmonicSeries_fourier_boundary f h] + + + + +theorem harmonicSeries_boundary_class (f : C(AddCircle τ, ℂ)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖fourierCoeff f m‖)) + {φ : Plane → ℝ} (hφ : ContDiff ℝ ∞ φ) + (hb : ∀ s : AddCircle τ, φ (complexIso s.toCircle) = (f s).re) : + (planeSeries_gradient (summable_norm_of_firstMoment h1) h1).toH1 - + (smooth_memH1 (by norm_num : (1:ℝ) < 2) hφ.contDiffOn).toH1 ∈ h10Submodule (show IsOpen disk from isOpen_ball) := by + let a := fourierCoeff f + have h0 := summable_norm_of_firstMoment h1 + let hu := planeSeries_gradient h0 h1 + let hv := smooth_memH1 (by norm_num : (1:ℝ) < 2) hφ.contDiffOn + have hs := planeSeries_contDiffOn h0 + have hsub : HasH1Gradient disk (planeSeries a - φ) (gradient (planeSeries a - φ)) := by + apply (hu.sub hv).congr (ae_of_all _ (fun _ => rfl)) + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + simp only [gradient,Pi.sub_apply] + rw [fderiv_sub (((hs x hx).contDiffAt (isOpen_ball.mem_nhds hx)).differentiableAt (by simp)) + (hφ.differentiable (by simp) x),map_sub] + have hhc : ContinuousOn (planeSeries a - φ) (closure disk) := by + have hc := (planeSeries_continuousOn h0).sub hφ.continuous.continuousOn + simpa only [disk,closure_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0)] using hc + have hz : ∀ x ∈ frontier disk, (planeSeries a - φ) x = 0 := by + intro x hx + have hn : ‖x‖ = 1 := by + simpa only [disk,frontier_ball (0:Plane) (by norm_num : (1:ℝ) ≠ 0),mem_sphere_zero_iff_norm] using hx + let c : Circle := ⟨complexIso.symm x, by + change complexIso.symm x ∈ sphere (0:ℂ) 1 + simpa only [mem_sphere_zero_iff_norm,LinearIsometryEquiv.norm_map] using hn⟩ + obtain ⟨s,hs⟩ := (AddCircle.homeomorphCircle (by positivity : τ ≠ 0)).surjective c + have hsc : (s.toCircle:ℂ) = complexIso.symm x := by + have he := congrArg (fun c : Circle => (c:ℂ)) hs + simpa only [AddCircle.homeomorphCircle_apply,c] using he + have hxc : complexIso s.toCircle = x := by rw [hsc]; exact complexIso.apply_symm_apply x + rw [← hxc] + exact sub_eq_zero.mpr ((planeSeries_boundary f h0 s).trans (hb s).symm) + have hm := interior_smooth_zero_trace_memH10 (Ω:=disk) isOpen_ball (hs.sub hφ.contDiffOn) hhc hsub + isBounded_ball hz + have he : hu.toH1 - hv.toH1 = hsub.toH1 := by + apply H1.value_injective (Ω:=disk) isOpen_ball + rw [map_sub,H1.value_toH1,H1.value_toH1,H1.value_toH1] + apply Lp.ext + filter_upwards [hu.1.coeFn_toLp,hv.1.coeFn_toLp,hsub.1.coeFn_toLp, + Lp.coeFn_sub (hu.1.toLp _) (hv.1.toLp _)] with x hux hvx hsx hdiff + rw [hdiff,Pi.sub_apply,hux,hvx,hsx] + rfl + exact he.symm ▸ hm + + + +theorem C3_boundary_class (f0 f1 f2 f3 : C(AddCircle τ, ℂ)) + (h01 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f0 t) (f1 t) t) + (h12 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f1 t) (f2 t) t) + (h23 : ∀ t : ℝ, HasDerivAt (fun t : ℝ => f2 t) (f3 t) t) + {φ : Plane → ℝ} (hφ : ContDiff ℝ ∞ φ) + (hb : ∀ s : AddCircle τ, φ (complexIso s.toCircle) = (f0 s).re) : + let h1 := summable_firstMoment_fourierCoeff f0 f1 f2 f3 h01 h12 h23 + (planeSeries_gradient (summable_norm_of_firstMoment h1) h1).toH1 - + (smooth_memH1 (by norm_num : (1:ℝ) < 2) hφ.contDiffOn).toH1 ∈ h10Submodule (show IsOpen disk from isOpen_ball) := by + exact harmonicSeries_boundary_class f0 + (summable_firstMoment_fourierCoeff f0 f1 f2 f3 h01 h12 h23) hφ hb + +end StrictHotSpots.Douglas +end DouglasBoundaryClassCombinedLayer + +section SubcriticalExtensionCombinedLayer +open Set MeasureTheory +open scoped InnerProductSpace ENNReal +namespace StrictHotSpots.SubcriticalExtension +variable {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) +variable {ν : Measure Plane} {C : ℝ≥0∞} (hC : C ≠ ∞) (hν : ν ≤ C • volume.restrict Ω) +local instance : NormedSpace ℝ (H10 ho) := (H10.innerProductSpace ho).toNormedSpace +local instance : NormedSpace ℝ (H1 Ω) := (h1Graph Ω).normedSpace + +def observe : H1 Ω →L[ℝ] Lp ℝ 2 ν := + (Lp.LpToLpOfMeasureLeSMul hC hν).comp H1.value + +def solve : Lp ℝ 2 ν →L[ℝ] H10 ho := + DirichletOperator.solution (H10.energy ho) (H10.energy_coercive ho hb) + (H10.weightedValue ho hC hν) + +lemma solve_spec (f : Lp ℝ 2 ν) (v : H10 ho) : + inner ℝ (H10.grad ho (solve ho hb hC hν f)) (H10.grad ho v) = + inner ℝ f (H10.weightedValue ho hC hν v) := by + exact DirichletOperator.solution_spec (H10.energy ho) (H10.energy_coercive ho hb) + (H10.weightedValue ho hC hν) f v + +lemma observe_coe (v : H10 ho) : observe hC hν v.val = H10.weightedValue ho hC hν v := rfl +lemma observe_solve (f : Lp ℝ 2 ν) : + observe hC hν (solve ho hb hC hν f).val = H10.greenOperator ho hb hC hν f := rfl + +lemma grad_add_coe (A : H1 Ω) (v : H10 ho) : + H1.grad (A+v.val) = H1.grad A + H10.grad ho v := H1.grad.map_add A v.val +lemma observe_add_coe (A : H1 Ω) (v : H10 ho) : + observe hC hν (A+v.val) = observe hC hν A + H10.weightedValue ho hC hν v := + (observe hC hν).map_add A v.val + + +def extension (A : H1 Ω) : H1 Ω := A + (solve ho hb hC hν + (BanachResolvent.resolvent (H10.greenOperator ho hb hC hν) (observe hC hν A))).val + +def Harmonic (A : H1 Ω) : Prop := + ∀ v : H10 ho, inner ℝ (H1.grad A) (H10.grad ho v) = 0 + +lemma extension_observe (hT : ‖H10.greenOperator ho hb hC hν‖ < 1) (A : H1 Ω) : + observe hC hν (extension ho hb hC hν A) = + BanachResolvent.resolvent (H10.greenOperator ho hb hC hν) (observe hC hν A) := by + let T := H10.greenOperator ho hb hC hν + let f := observe hC hν A + have hh := congrArg (fun B : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν => B f) + (BanachResolvent.resolvent_left T hT) + change (BanachResolvent.resolvent T) f - T ((BanachResolvent.resolvent T) f) = f at hh + change observe hC hν (A + (solve ho hb hC hν ((BanachResolvent.resolvent T) f)).val) = _ + rw [observe_add_coe] + change f + T ((BanachResolvent.resolvent T) f) = _ + exact eq_sub_iff_add_eq.mp hh.symm + +lemma extension_grad (A : H1 Ω) : + H1.grad (extension ho hb hC hν A) = H1.grad A + + H10.grad ho (solve ho hb hC hν + (BanachResolvent.resolvent (H10.greenOperator ho hb hC hν) (observe hC hν A))) := by + exact H1.grad.map_add A _ + +lemma extension_weak (hT : ‖H10.greenOperator ho hb hC hν‖ < 1) + (A : H1 Ω) (hA : Harmonic ho A) (v : H10 ho) : + inner ℝ (H1.grad (extension ho hb hC hν A)) (H10.grad ho v) = + inner ℝ (observe hC hν (extension ho hb hC hν A)) (H10.weightedValue ho hC hν v) := by + let w := solve ho hb hC hν + (BanachResolvent.resolvent (H10.greenOperator ho hb hC hν) (observe hC hν A)) + have hg : H1.grad (extension ho hb hC hν A) = H1.grad A + H10.grad ho w := + extension_grad ho hb hC hν A + have hi := congrArg (fun z : Lp Plane 2 (volume.restrict Ω) => inner ℝ z (H10.grad ho v)) hg + have hs := solve_spec ho hb hC hν + (BanachResolvent.resolvent (H10.greenOperator ho hb hC hν) (observe hC hν A)) v + have he := extension_observe ho hb hC hν hT A + calc + _ = inner ℝ (H1.grad A + H10.grad ho w) (H10.grad ho v) := hi + _ = inner ℝ (H1.grad A) (H10.grad ho v) + inner ℝ (H10.grad ho w) (H10.grad ho v) := + inner_add_left _ _ _ + _ = 0 + inner ℝ (H10.grad ho w) (H10.grad ho v) := + congrArg (fun r : ℝ => r + inner ℝ (H10.grad ho w) (H10.grad ho v)) (hA v) + _ = inner ℝ (H10.grad ho w) (H10.grad ho v) := zero_add _ + _ = inner ℝ (BanachResolvent.resolvent (H10.greenOperator ho hb hC hν) (observe hC hν A)) + (H10.weightedValue ho hC hν v) := hs + _ = _ := congrArg (fun z : Lp ℝ 2 ν => inner ℝ z (H10.weightedValue ho hC hν v)) he.symm + +end StrictHotSpots.SubcriticalExtension +end SubcriticalExtensionCombinedLayer + +section HarmonicLiftCombinedLayer +open Set MeasureTheory +open scoped InnerProductSpace ENNReal +namespace StrictHotSpots.SubcriticalExtension +variable {Ω : Set Plane} (ho : IsOpen Ω) (hb : Bornology.IsBounded Ω) +local instance : NormedSpace ℝ (H10 ho) := (H10.innerProductSpace ho).toNormedSpace +local instance : NormedSpace ℝ (H1 Ω) := (h1Graph Ω).normedSpace + + + +def harmonicLift (F : H1 Ω) : H1 Ω := F - + (DirichletOperator.solution (H10.energy ho) (H10.energy_coercive ho hb) + (H10.grad ho) (H1.grad F)).val + +lemma harmonicLift_difference (F : H1 Ω) : + ∃ v : H10 ho, harmonicLift ho hb F - F = v.val := by + refine ⟨-(DirichletOperator.solution (H10.energy ho) (H10.energy_coercive ho hb) + (H10.grad ho) (H1.grad F)), ?_⟩ + change (F-(DirichletOperator.solution (H10.energy ho) (H10.energy_coercive ho hb) + (H10.grad ho) (H1.grad F)).val)-F = -_ + abel + +lemma harmonicLift_harmonic (F : H1 Ω) : Harmonic ho (harmonicLift ho hb F) := by + let v := DirichletOperator.solution (H10.energy ho) (H10.energy_coercive ho hb) + (H10.grad ho) (H1.grad F) + have hv (w : H10 ho) : inner ℝ (H10.grad ho v) (H10.grad ho w) = + inner ℝ (H1.grad F) (H10.grad ho w) := + DirichletOperator.solution_spec (H10.energy ho) (H10.energy_coercive ho hb) + (H10.grad ho) (H1.grad F) w + intro w + have hg : H1.grad (harmonicLift ho hb F) = H1.grad F - H10.grad ho v := + H1.grad.map_sub F v.val + calc + _ = inner ℝ (H1.grad F - H10.grad ho v) (H10.grad ho w) := + congrArg (fun g : Lp Plane 2 (volume.restrict Ω) => inner ℝ g (H10.grad ho w)) hg + _ = inner ℝ (H1.grad F) (H10.grad ho w) - inner ℝ (H10.grad ho v) (H10.grad ho w) := + inner_sub_left _ _ _ + _ = 0 := sub_eq_zero.mpr (hv w).symm + +include hb in +lemma h10_eq_zero_of_grad_norm_sq (v : H10 ho) (hv : ‖H10.grad ho v‖^2 = 0) : v = 0 := by + obtain ⟨K,hK,h⟩ := H10.energy_coercive ho hb + have he : H10.energy ho v v = 0 := (real_inner_self_eq_norm_sq _).trans hv + have hm : K * ‖v‖^2 ≤ 0 := by + calc + _ = K * ‖v‖ * ‖v‖ := by ring + _ ≤ H10.energy ho v v := h v + _ = 0 := he + have : ‖v‖^2 ≤ 0 := by nlinarith [sq_nonneg ‖v‖] + exact norm_eq_zero.mp (sq_eq_zero_iff.mp (le_antisymm this (sq_nonneg _))) + +include hb in +lemma harmonic_zero_class (F : H1 Ω) (hF : Harmonic ho F) + (hv : ∃ v : H10 ho, F = v.val) : F = 0 := by + obtain ⟨v,rfl⟩ := hv + have he : ‖H10.grad ho v‖^2 = 0 := (real_inner_self_eq_norm_sq _).symm.trans (hF v) + have hz := h10_eq_zero_of_grad_norm_sq ho hb v he + exact congrArg (fun v : H10 ho => v.val) hz + +lemma harmonic_sub (F G : H1 Ω) (hF : Harmonic ho F) (hG : Harmonic ho G) : + Harmonic ho (F-G) := by + intro v + have hg := H1.grad.map_sub F G + calc + _ = inner ℝ (H1.grad F-H1.grad G) (H10.grad ho v) := + congrArg (fun g : Lp Plane 2 (volume.restrict Ω) => inner ℝ g (H10.grad ho v)) hg + _ = inner ℝ (H1.grad F) (H10.grad ho v) - inner ℝ (H1.grad G) (H10.grad ho v) := + inner_sub_left _ _ _ + _ = 0 := by linarith [hF v,hG v] + +lemma harmonicLift_unique (F G : H1 Ω) (hG : Harmonic ho G) + (hGF : ∃ v : H10 ho, G-F = v.val) : G = harmonicLift ho hb F := by + apply sub_eq_zero.mp + apply harmonic_zero_class ho hb (G-harmonicLift ho hb F) + (harmonic_sub ho G (harmonicLift ho hb F) hG (harmonicLift_harmonic ho hb F)) + obtain ⟨v,hv⟩ := hGF + obtain ⟨w,hw⟩ := harmonicLift_difference ho hb F + refine ⟨v-w, ?_⟩ + change G-harmonicLift ho hb F = v.val-w.val + calc + _ = (G-F)-(harmonicLift ho hb F-F) := by abel + _ = _ := congrArg₂ (fun a b : H1 Ω => a-b) hv hw +end StrictHotSpots.SubcriticalExtension +end HarmonicLiftCombinedLayer + +section DouglasHarmonicLiftCombinedLayer +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ComplexConjugate ContDiff InnerProductSpace Laplacian + +namespace StrictHotSpots.PlaneGreen +lemma poissonAverage_harmonic {f : ℂ → ℝ} (hf : CircleIntegrable f 0 1) : + InnerProductSpace.HarmonicOnNhd + (fun z => Real.circleAverage (poissonKernel 0 z • f) 0 1) (ball 0 1) := by + have hfc : CircleIntegrable (fun z => (f z : ℂ)) 0 1 := by + simp only [CircleIntegrable,intervalIntegrable_iff] at hf ⊢ + exact Complex.ofRealCLM.integrable_comp hf + have hball : ball (0 : ℂ) 1 ⊆ (sphere (0 : ℂ) |(1 : ℝ)|)ᶜ := by + intro z hz + rw [Set.mem_compl_iff, abs_one, Metric.mem_sphere] + exact ne_of_lt (Metric.mem_ball.mp hz) + have ha := (analyticOnNhd_circleAverage_herglotzRieszKernel_smul hfc).mono hball + intro z hz + apply (InnerProductSpace.harmonicAt_congr_nhds (f₂ := fun z => + (Real.circleAverage (fun ζ => herglotzRieszKernel 0 z ζ • (f ζ : ℂ)) 0 1).re) ?_).2 + · exact (ha z hz).harmonicAt_re + · filter_upwards [isOpen_ball.mem_nhds hz] with w hw + rw [re_circleAverage_herglotzRieszKernel_smul hf (hball hw)] + congr 1 + funext ζ + simp only [poissonKernel_eq_re_herglotzRieszKernel] + +lemma harmonicAt_comp_linearIsometryEquiv + {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] + (g : E ≃ₗᵢ[ℝ] F) {f : F → ℝ} {x : E} + (hf : InnerProductSpace.HarmonicAt f (g x)) : + InnerProductSpace.HarmonicAt (f ∘ g) x := by + refine ⟨hf.1.comp x g.contDiff.contDiffAt,?_⟩ + filter_upwards [g.continuous.continuousAt.eventually hf.2] with y hy + change Δ (f ∘ g) y = 0 + exact (laplacian_comp_linearIsometryEquiv g f y).trans hy + +end StrictHotSpots.PlaneGreen +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 SubcriticalExtension +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma harmonicSeries_re_harmonic {a : ℤ → ℂ} (ha : Summable (fun m => ‖a m‖)) : + InnerProductSpace.HarmonicOnNhd (fun z => (harmonicSeries a z).re) (ball 0 1) := by + have hc := Complex.continuous_re.comp_continuousOn + ((harmonicSeries_continuousOn ha).mono sphere_subset_closedBall) + have hh := PlaneGreen.poissonAverage_harmonic (hc.circleIntegrable (by norm_num : (0:ℝ) ≤ 1)) + intro z hz + apply (InnerProductSpace.harmonicAt_congr_nhds (f₂ := fun w => + Real.circleAverage (poissonKernel 0 w • (fun ζ => (harmonicSeries a ζ).re)) 0 1) ?_).2 (hh z hz) + filter_upwards [isOpen_ball.mem_nhds hz] with w hw + exact (harmonicSeries_re_poisson ha hw).symm + +lemma planeSeries_harmonic {a : ℤ → ℂ} (ha : Summable (fun m => ‖a m‖)) : + InnerProductSpace.HarmonicOnNhd (planeSeries a) disk := by + intro x hx + have hz : complexIso.symm x ∈ ball (0:ℂ) 1 := by + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + exact harmonicAt_comp_linearIsometryEquiv complexIso.symm (harmonicSeries_re_harmonic ha _ hz) + +lemma planeSeries_weak_harmonic {a : ℤ → ℂ} + (h0 : Summable (fun m => ‖a m‖)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) : + Harmonic (show IsOpen disk from isOpen_ball) (planeSeries_gradient h0 h1).toH1 := by + intro v + rw [H1.grad_toH1] + have hp : ∀ x ∈ disk, Laplacian.laplacian (planeSeries a) x = -(0:ℝ)*planeSeries a x := by + intro x hx + simpa using (planeSeries_harmonic h0 x hx).2.self_of_nhds + simpa using H10.helmholtz_pair (Ω:=disk) isOpen_ball (planeSeries_contDiffOn h0) + (planeSeries_gradient h0 h1).1 (planeSeries_gradient h0 h1).2.1 hp v + + + +theorem harmonicSeries_eq_harmonicLift (f : C(AddCircle τ, ℂ)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖fourierCoeff f m‖)) + {φ : Plane → ℝ} (hφ : ContDiff ℝ ∞ φ) + (hb : ∀ s : AddCircle τ, φ (complexIso s.toCircle) = (f s).re) : + (planeSeries_gradient (summable_norm_of_firstMoment h1) h1).toH1 = + harmonicLift (show IsOpen disk from isOpen_ball) isBounded_ball + (smooth_memH1 (by norm_num : (1:ℝ) < 2) hφ.contDiffOn).toH1 := by + apply harmonicLift_unique (Ω:=disk) isOpen_ball isBounded_ball _ _ + (planeSeries_weak_harmonic (summable_norm_of_firstMoment h1) h1) + exact ⟨⟨_,harmonicSeries_boundary_class f h1 hφ hb⟩,rfl⟩ + +end StrictHotSpots.Douglas +end DouglasHarmonicLiftCombinedLayer + +section CircleMollifierCombinedLayer +open Set MeasureTheory Filter Metric AddCircle Function ContinuousLinearMap +open scoped Topology ComplexConjugate ContDiff Convolution +namespace StrictHotSpots.Douglas +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma chord_translate (s t u : AddCircle τ) : + ‖((s-u).toCircle:ℂ)-((t-u).toCircle:ℂ)‖ = ‖(s.toCircle:ℂ)-(t.toCircle:ℂ)‖ := by + rw [show s-u=s+(-u) from sub_eq_add_neg s u,show t-u=t+(-u) from sub_eq_add_neg t u] + simp only [AddCircle.toCircle_add,Circle.coe_mul,← sub_mul,norm_mul,Circle.norm_coe,mul_one] + + +def angleSmooth (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) : ℝ → ℂ := + φ.normed volume ⋆[lsmul ℝ ℝ,volume] (fun t : ℝ => f t) + +lemma angleSmooth_smooth (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) : + ContDiff ℝ ∞ (angleSmooth φ f) := + φ.hasCompactSupport_normed.contDiff_convolution_left _ φ.contDiff_normed + (f.continuous.comp (AddCircle.continuous_mk' τ)).locallyIntegrable + +lemma angleSmooth_periodic (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) : + Periodic (angleSmooth φ f) τ := by + intro t + unfold angleSmooth + simp only [convolution_def,lsmul_apply] + apply integral_congr_ae (ae_of_all _ fun u => ?_) + congr 2 + rw [show t+τ-u = (t-u)+τ by ring,AddCircle.coe_add,AddCircle.coe_period,add_zero] + +lemma angleSmooth_integrable (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) (t : ℝ) : + Integrable (fun u : ℝ => φ.normed volume u • f ((t-u:ℝ):AddCircle τ)) := by + exact φ.hasCompactSupport_normed.convolutionExists_left_of_continuous_right + (lsmul ℝ ℝ) φ.integrable_normed.locallyIntegrable + (f.continuous.comp (AddCircle.continuous_mk' τ)) t + +lemma angleSmooth_chordLipschitz (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) + {K : ℝ} (h : ChordLipschitz K f) (s t : ℝ) : + ‖angleSmooth φ f s-angleSmooth φ f t‖ ≤ + K*‖(AddCircle.toCircle (s:AddCircle τ):ℂ)-(AddCircle.toCircle (t:AddCircle τ):ℂ)‖ := by + have hi := (angleSmooth_integrable φ f s).sub (angleSmooth_integrable φ f t) + have hp (u : ℝ) : ‖φ.normed volume u • f ((s-u:ℝ):AddCircle τ) - + φ.normed volume u • f ((t-u:ℝ):AddCircle τ)‖ ≤ + φ.normed volume u * (K*‖(AddCircle.toCircle (s:AddCircle τ):ℂ)-(AddCircle.toCircle (t:AddCircle τ):ℂ)‖) := by + rw [← smul_sub,norm_smul,Real.norm_eq_abs,abs_of_nonneg (φ.nonneg_normed u)] + apply mul_le_mul_of_nonneg_left _ (φ.nonneg_normed u) + have hh := h ((s-u:ℝ):AddCircle τ) ((t-u:ℝ):AddCircle τ) + simpa only [AddCircle.coe_sub,chord_translate] using hh + change ‖(∫ u : ℝ, φ.normed volume u • f ((s-u:ℝ):AddCircle τ))- + (∫ u : ℝ, φ.normed volume u • f ((t-u:ℝ):AddCircle τ))‖ ≤ _ + rw [← integral_sub (angleSmooth_integrable φ f s) (angleSmooth_integrable φ f t)] + calc + _ ≤ ∫ u : ℝ, ‖φ.normed volume u • f ((s-u:ℝ):AddCircle τ) - + φ.normed volume u • f ((t-u:ℝ):AddCircle τ)‖ := norm_integral_le_integral_norm _ + _ ≤ ∫ u : ℝ, φ.normed volume u * + (K*‖(AddCircle.toCircle (s:AddCircle τ):ℂ)-(AddCircle.toCircle (t:AddCircle τ):ℂ)‖) := + integral_mono hi.norm (φ.integrable_normed.mul_const _) hp + _ = _ := by rw [integral_mul_const,φ.integral_normed,one_mul] + +lemma periodic_lift_continuous {g : ℝ → ℂ} (hg : Periodic g τ) (hc : Continuous g) : + Continuous hg.lift := by + apply (QuotientAddGroup.isQuotientMap_mk (AddSubgroup.zmultiples τ)).continuous_iff.2 + exact hc + + +def circleSmooth (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) : C(AddCircle τ,ℂ) := + ⟨(angleSmooth_periodic φ f).lift, + periodic_lift_continuous _ (angleSmooth_smooth φ f).continuous⟩ + +lemma circleSmooth_coe (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) (t : ℝ) : + circleSmooth φ f t = angleSmooth φ f t := rfl + +lemma circleSmooth_chordLipschitz (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) + {K : ℝ} (h : ChordLipschitz K f) : ChordLipschitz K (circleSmooth φ f) := by + intro s t + induction s using QuotientAddGroup.induction_on with | H s => + induction t using QuotientAddGroup.induction_on with | H t => + exact angleSmooth_chordLipschitz φ f h s t + +lemma circleSmooth_tendsto {ι : Type*} {l : Filter ι} {φ : ι → ContDiffBump (0:ℝ)} + (hφ : Tendsto (fun i => (φ i).rOut) l (𝓝 0)) (f : C(AddCircle τ,ℂ)) (s : AddCircle τ) : + Tendsto (fun i => circleSmooth (φ i) f s) l (𝓝 (f s)) := by + induction s using QuotientAddGroup.induction_on with | H t => + exact ContDiffBump.convolution_tendsto_right_of_continuous hφ + (f.continuous.comp (AddCircle.continuous_mk' τ)) t + +end StrictHotSpots.Douglas +end CircleMollifierCombinedLayer + +section CircleSmoothFourierCombinedLayer +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff +namespace StrictHotSpots.Douglas +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma periodic_deriv {g : ℝ → ℂ} (hg : Periodic g τ) : Periodic (deriv g) τ := by + intro t + rw [← deriv_comp_add_const] + exact congrArg (fun h : ℝ → ℂ => deriv h t) (funext hg) + +lemma angleLift_periodic (f : C(AddCircle τ,ℂ)) : Periodic (fun t : ℝ => f t) τ := by + intro t + dsimp only + rw [AddCircle.coe_add,AddCircle.coe_period,add_zero] + + + +theorem summable_firstMoment_of_smooth_lift (f : C(AddCircle τ,ℂ)) + (hf : ContDiff ℝ ∞ (fun t : ℝ => f t)) : + Summable (fun m : ℤ => (m.natAbs:ℝ)*‖fourierCoeff f m‖) := by + let g : ℝ → ℂ := fun t => f t + have hp : Periodic g τ := angleLift_periodic f + have h1 : ContDiff ℝ ∞ (deriv g) := (contDiff_infty_iff_deriv.mp hf).2 + have h2 : ContDiff ℝ ∞ (deriv (deriv g)) := (contDiff_infty_iff_deriv.mp h1).2 + have h3 : ContDiff ℝ ∞ (deriv (deriv (deriv g))) := (contDiff_infty_iff_deriv.mp h2).2 + let f1 : C(AddCircle τ,ℂ) := ⟨(periodic_deriv hp).lift, + periodic_lift_continuous _ h1.continuous⟩ + let f2 : C(AddCircle τ,ℂ) := ⟨(periodic_deriv (periodic_deriv hp)).lift, + periodic_lift_continuous _ h2.continuous⟩ + let f3 : C(AddCircle τ,ℂ) := ⟨(periodic_deriv (periodic_deriv (periodic_deriv hp))).lift, + periodic_lift_continuous _ h3.continuous⟩ + apply summable_firstMoment_fourierCoeff f f1 f2 f3 + · intro t + exact (hf.differentiable (by simp) t).hasDerivAt + · intro t + exact (h1.differentiable (by simp) t).hasDerivAt + · intro t + exact (h2.differentiable (by simp) t).hasDerivAt + +lemma circleSmooth_firstMoment (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) : + Summable (fun m : ℤ => (m.natAbs:ℝ)*‖fourierCoeff (circleSmooth φ f) m‖) := + summable_firstMoment_of_smooth_lift _ (angleSmooth_smooth φ f) + + +theorem douglas_smooth_lift (f : C(AddCircle τ,ℂ)) + (hf : ContDiff ℝ ∞ (fun t : ℝ => f t)) : + diskEnergy (poissonExtension f) = (1/τ)*boundaryEnergy f := by + have h1 := summable_firstMoment_of_smooth_lift f hf + have h0 := summable_norm_of_firstMoment h1 + have he : EqOn (poissonExtension f) (harmonicSeries (fourierCoeff f)) (ball 0 1) := + fun z hz => poissonExtension_eq_harmonicSeries f h0 hz + have hE : diskEnergy (poissonExtension f) = diskEnergy (harmonicSeries (fourierCoeff f)) := by + apply setIntegral_congr_fun measurableSet_ball + intro z hz + have hd := (he.eventuallyEq_of_mem (isOpen_ball.mem_nhds hz)).fderiv_eq (𝕜:=ℝ) + dsimp only + rw [hd] + rw [hE,douglas_series h0 h1] + have hb : (fun s : AddCircle τ => harmonicSeries (fourierCoeff f) s.toCircle) = f := + funext (harmonicSeries_fourier_boundary f h0) + rw [hb] + + + + +theorem smooth_poisson_energy_tendsto {ι : Type*} {l : Filter ι} [l.IsCountablyGenerated] + {φ : ι → ContDiffBump (0:ℝ)} (hφ : Tendsto (fun i => (φ i).rOut) l (𝓝 0)) + (f : C(AddCircle τ,ℂ)) {K : ℝ} (hK : 0 ≤ K) (h : ChordLipschitz K f) : + Tendsto (fun i => diskEnergy (poissonExtension (circleSmooth (φ i) f))) l + (𝓝 ((1/τ)*boundaryEnergy f)) := by + have hb := boundaryEnergy_tendsto_filter hK + (fun i => (circleSmooth (φ i) f).continuous) + (fun i => circleSmooth_chordLipschitz (φ i) f h) (circleSmooth_tendsto hφ f) + have he (i : ι) : diskEnergy (poissonExtension (circleSmooth (φ i) f)) = + (1/τ)*boundaryEnergy (circleSmooth (φ i) f) := + douglas_smooth_lift _ (angleSmooth_smooth (φ i) f) + simpa only [he] using hb.const_mul (1/τ) + +end StrictHotSpots.Douglas +end CircleSmoothFourierCombinedLayer + +section CircleApproximationCombinedLayer +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff +namespace StrictHotSpots.Douglas +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma chordLipschitz_sub {T : ℝ} {f g : AddCircle T → ℂ} {K L : ℝ} + (hf : ChordLipschitz K f) (hg : ChordLipschitz L g) : + ChordLipschitz (K+L) (fun s => f s-g s) := by + intro s t + rw [show (f s-g s)-(f t-g t) = (f s-f t)-(g s-g t) by ring] + exact (norm_sub_le _ _).trans ((add_le_add (hf s t) (hg s t)).trans_eq (add_mul _ _ _).symm) + +@[simp] lemma boundaryEnergy_zero {T : ℝ} [Fact (0 < T)] : boundaryEnergy (fun _ : AddCircle T => (0:ℂ)) = 0 := by + simp [boundaryEnergy,boundaryDifference] + + + + +theorem circleSmooth_boundaryError_tendsto {ι : Type*} {l : Filter ι} + [l.IsCountablyGenerated] {φ : ι → ContDiffBump (0:ℝ)} + (hφ : Tendsto (fun i => (φ i).rOut) l (𝓝 0)) (f : C(AddCircle τ,ℂ)) + {K : ℝ} (hK : 0 ≤ K) (h : ChordLipschitz K f) : + Tendsto (fun i => boundaryEnergy (fun s => circleSmooth (φ i) f s-f s)) + l (𝓝 0) := by + have hh := boundaryEnergy_tendsto_filter (add_nonneg hK hK) + (fun i => (circleSmooth (φ i) f).continuous.sub f.continuous) + (fun i => chordLipschitz_sub (circleSmooth_chordLipschitz (φ i) f h) h) + (fun s => (circleSmooth_tendsto hφ f s).sub_const (f s)) + convert hh using 1 + simp only [sub_self,boundaryEnergy_zero] + + + + +theorem circleSmooth_poisson_cauchy {ι : Type*} {l : Filter ι} + [l.IsCountablyGenerated] {φ : ι → ContDiffBump (0:ℝ)} + (hφ : Tendsto (fun i => (φ i).rOut) l (𝓝 0)) (f : C(AddCircle τ,ℂ)) + {K : ℝ} (hK : 0 ≤ K) (h : ChordLipschitz K f) : + Tendsto (fun p : ι × ι => diskEnergy (poissonExtension + (circleSmooth (φ p.1) f-circleSmooth (φ p.2) f))) (l ×ˢ l) (𝓝 0) := by + have hh := boundaryEnergy_tendsto_filter (add_nonneg hK hK) + (l:=l ×ˢ l) + (fun p : ι × ι => (circleSmooth (φ p.1) f).continuous.sub (circleSmooth (φ p.2) f).continuous) + (fun p : ι × ι => chordLipschitz_sub (circleSmooth_chordLipschitz (φ p.1) f h) + (circleSmooth_chordLipschitz (φ p.2) f h)) + (fun s => ((circleSmooth_tendsto hφ f s).comp tendsto_fst).sub + ((circleSmooth_tendsto hφ f s).comp tendsto_snd)) + have hz : Tendsto (fun p : ι × ι => (1/τ)*boundaryEnergy + (circleSmooth (φ p.1) f-circleSmooth (φ p.2) f)) (l ×ˢ l) (𝓝 0) := by + simpa only [Pi.sub_apply, ContinuousMap.coe_sub, sub_self,boundaryEnergy_zero,mul_zero] using hh.const_mul (1/τ) + apply hz.congr' + exact Eventually.of_forall fun p => (douglas_smooth_lift + (circleSmooth (φ p.1) f-circleSmooth (φ p.2) f) + ((angleSmooth_smooth (φ p.1) f).sub (angleSmooth_smooth (φ p.2) f))).symm + +end StrictHotSpots.Douglas +end CircleApproximationCombinedLayer + +section CirclePoissonConvergenceCombinedLayer +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff +namespace StrictHotSpots.Douglas +local instance : Fact (0 < 2*Real.pi) := ⟨by positivity⟩ +local notation "τ" => (2*Real.pi) + +lemma angleSmooth_norm_le (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) (t : ℝ) : + ‖angleSmooth φ f t‖ ≤ ‖f‖ := by + change ‖∫ u : ℝ, φ.normed volume u • f ((t-u:ℝ):AddCircle τ)‖ ≤ ‖f‖ + calc + _ ≤ ∫ u : ℝ, ‖φ.normed volume u • f ((t-u:ℝ):AddCircle τ)‖ := norm_integral_le_integral_norm _ + _ ≤ ∫ u : ℝ, φ.normed volume u * ‖f‖ := by + apply integral_mono (angleSmooth_integrable φ f t).norm (φ.integrable_normed.mul_const _) + intro u + dsimp only + rw [norm_smul,Real.norm_eq_abs,abs_of_nonneg (φ.nonneg_normed u)] + exact mul_le_mul_of_nonneg_left (f.norm_coe_le_norm _) (φ.nonneg_normed u) + _ = ‖f‖ := by rw [integral_mul_const,φ.integral_normed,one_mul] + +lemma circleSmooth_norm_le (φ : ContDiffBump (0:ℝ)) (f : C(AddCircle τ,ℂ)) (s : AddCircle τ) : + ‖circleSmooth φ f s‖ ≤ ‖f‖ := by + induction s using QuotientAddGroup.induction_on with | H s => exact angleSmooth_norm_le φ f s + + + +theorem circleSmooth_poisson_tendsto {ι : Type*} {l : Filter ι} [l.IsCountablyGenerated] + {φ : ι → ContDiffBump (0:ℝ)} (hφ : Tendsto (fun i => (φ i).rOut) l (𝓝 0)) + (f : C(AddCircle τ,ℂ)) {z : ℂ} (hz : z ∈ ball 0 1) : + Tendsto (fun i => poissonExtension (circleSmooth (φ i) f) z) l + (𝓝 (poissonExtension f z)) := by + have hk := poissonKernel_continuousOn_sphere hz + obtain ⟨C,hC⟩ := (isCompact_sphere (0:ℂ) 1).exists_bound_of_continuousOn hk + have hmap (t : ℝ) : circleMap (0:ℂ) 1 t ∈ sphere 0 1 := + circleMap_mem_sphere (0:ℂ) (by norm_num) t + have hkc : Continuous (fun t : ℝ => poissonKernel 0 z (circleMap 0 1 t)) := + hk.comp_continuous (continuous_circleMap 0 1) hmap + unfold poissonExtension + apply Filter.Tendsto.smul tendsto_const_nhds + apply intervalIntegral.tendsto_integral_filter_of_dominated_convergence (fun _ : ℝ => C*‖f‖) + · exact Eventually.of_forall fun i => + (hkc.smul ((circleSmooth (φ i) f).continuous.comp (AddCircle.continuous_mk' τ))).aestronglyMeasurable + · exact Eventually.of_forall fun i => ae_of_all _ fun t _ => by + rw [norm_smul] + exact mul_le_mul (hC _ (hmap t)) (circleSmooth_norm_le (φ i) f t) + (norm_nonneg _) (le_trans (norm_nonneg _) (hC _ (hmap t))) + · exact intervalIntegrable_const + · exact ae_of_all _ fun t _ => tendsto_const_nhds.smul (circleSmooth_tendsto hφ f t) + +end StrictHotSpots.Douglas +end CirclePoissonConvergenceCombinedLayer + +section DouglasRealEnergyCombinedLayer +open Set MeasureTheory Filter Metric AddCircle Function +open scoped Topology ComplexConjugate ContDiff InnerProductSpace +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 + +lemma real_component_gradient_bound (L : ℂ →L[ℝ] ℂ) : + ‖(InnerProductSpace.toDual ℝ Plane).symm ((Complex.reCLM.comp L).comp + complexIso.symm.toContinuousLinearEquiv.toContinuousLinearMap)‖^2 ≤ + ‖L 1‖^2+‖L Complex.I‖^2 := by + let v : Plane := (InnerProductSpace.toDual ℝ Plane).symm ((Complex.reCLM.comp L).comp + complexIso.symm.toContinuousLinearEquiv.toContinuousLinearMap) + have hi (z : ℂ) : inner ℝ v (complexIso z) = (L z).re := by + rw [show v = (InnerProductSpace.toDual ℝ Plane).symm ((Complex.reCLM.comp L).comp + complexIso.symm.toContinuousLinearEquiv.toContinuousLinearMap) from rfl, + InnerProductSpace.toDual_symm_apply] + simp only [ContinuousLinearMap.comp_apply,ContinuousLinearEquiv.coe_coe, + LinearIsometryEquiv.coe_coe,LinearIsometryEquiv.symm_apply_apply,Complex.reCLM_apply] + have hi' (z : ℂ) : inner ℝ (complexIso z) v = (L z).re := by + rw [real_inner_comm] + exact hi z + have he := (Complex.orthonormalBasisOneI.map complexIso).sum_inner_mul_inner v v + simp only [Fin.sum_univ_two,OrthonormalBasis.map_apply,Complex.coe_orthonormalBasisOneI, + Matrix.cons_val_zero,Matrix.cons_val_one] at he + simp only [hi,hi',real_inner_self_eq_norm_sq] at he + change ‖v‖^2 ≤ _ + rw [← he,← sq,← sq] + exact add_le_add (by simpa only [Complex.normSq_eq_norm_sq,pow_two] using Complex.re_sq_le_normSq (L 1)) + (by simpa only [Complex.normSq_eq_norm_sq,pow_two] using Complex.re_sq_le_normSq (L Complex.I)) + + + +theorem planeSeries_energy_le {a : ℤ → ℂ} + (h0 : Summable (fun m => ‖a m‖)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) : + (∫ x : Plane in disk, ‖gradient (planeSeries a) x‖^2) ≤ diskEnergy (harmonicSeries a) := by + have hm (x : Plane) (hx : x ∈ disk) : + ‖gradient (planeSeries a) x‖^2 ≤ + ‖fderiv ℝ (harmonicSeries a) (complexIso.symm x) 1‖^2+ + ‖fderiv ℝ (harmonicSeries a) (complexIso.symm x) Complex.I‖^2 := by + have hz : complexIso.symm x ∈ ball (0:ℂ) 1 := by + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + rw [(harmonicSeries_hasFDerivAt h0 h1 hz).fderiv] + have hp := (planeSeries_hasFDerivAt h0 h1 hx).fderiv + simp only [gradient] + rw [hp] + exact real_component_gradient_bound (harmonicD a (complexIso.symm x)) + have hI : Integrable (fun x : Plane => + ‖fderiv ℝ (harmonicSeries a) (complexIso.symm x) 1‖^2+ + ‖fderiv ℝ (harmonicSeries a) (complexIso.symm x) Complex.I‖^2) (volume.restrict disk) := by + have hi : Integrable (fun x : Plane => ‖harmonicD a (complexIso.symm x) 1‖^2+ + ‖harmonicD a (complexIso.symm x) Complex.I‖^2) (volume.restrict disk) := by + have hc : ContinuousOn (fun x : Plane => harmonicD a (complexIso.symm x)) + (closedBall 0 1) := (harmonicD_continuousOn h1).comp complexIso.symm.continuous.continuousOn (by + intro x hx + simpa only [mem_closedBall_zero_iff,LinearIsometryEquiv.norm_map] using hx) + have he : ContinuousOn (fun x : Plane => ‖harmonicD a (complexIso.symm x) 1‖^2+ + ‖harmonicD a (complexIso.symm x) Complex.I‖^2) (closedBall 0 1) := + ((hc.clm_apply continuousOn_const).norm.pow 2).add + ((hc.clm_apply continuousOn_const).norm.pow 2) + exact (he.integrableOn_compact (isCompact_closedBall (0:Plane) 1)).mono_set ball_subset_closedBall + apply hi.congr + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + have hz : complexIso.symm x ∈ ball (0:ℂ) 1 := by + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + rw [(harmonicSeries_hasFDerivAt h0 h1 hz).fderiv] + rfl + calc + _ ≤ ∫ x : Plane in disk, + ‖fderiv ℝ (harmonicSeries a) (complexIso.symm x) 1‖^2+ + ‖fderiv ℝ (harmonicSeries a) (complexIso.symm x) Complex.I‖^2 := + integral_mono_ae ((memLp_two_iff_integrable_sq_norm + (planeSeries_gradient h0 h1).2.1.aestronglyMeasurable).mp (planeSeries_gradient h0 h1).2.1) + hI ((ae_restrict_mem measurableSet_ball).mono fun x hx => hm x hx) + _ = _ := complexIso_disk_preserving.integral_comp complexIso.symm.toHomeomorph.measurableEmbedding + (fun z : ℂ => ‖fderiv ℝ (harmonicSeries a) z 1‖^2+‖fderiv ℝ (harmonicSeries a) z Complex.I‖^2) + +end StrictHotSpots.Douglas +end DouglasRealEnergyCombinedLayer +end +end DouglasLipschitzBase + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Potentials.lean b/lean/OAI/Analysis/HotSpots/Potentials.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b11e0f901c47c87ea364599d1a0436b0aba694b --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Potentials.lean @@ -0,0 +1,989 @@ +import OAI.Analysis.HotSpots.Trace + +namespace OAI + +section ActualVectorSupport + +noncomputable section + +section HarmonicRadialRegularityBaseLayer +open Set MeasureTheory Metric Complex Function Filter Real +open scoped Topology ContDiff Laplacian +namespace StrictHotSpots.Weyl + +def radialBump (R : ℝ) (z : ℂ) : ℝ := expNegInvGlue (R^2-‖z‖^2) + +lemma radialBump_contDiff (R : ℝ) : ContDiff ℝ ∞ (radialBump R) := + expNegInvGlue.contDiff.comp (contDiff_const.sub (contDiff_norm_sq ℝ)) + +lemma radialBump_zero {R : ℝ} (hR : 0 ≤ R) {z : ℂ} (hz : R ≤ ‖z‖) : + radialBump R z = 0 := by + apply expNegInvGlue.zero_of_nonpos + nlinarith [norm_nonneg z] + +lemma radialBump_support {R : ℝ} (hR : 0 ≤ R) : + tsupport (radialBump R) ⊆ closedBall (0:ℂ) R := by + apply closure_minimal _ isClosed_closedBall + intro z hz + rw [mem_closedBall,dist_zero_right] + by_contra h + exact hz (radialBump_zero hR (le_of_not_ge h)) + +lemma radialBump_compact {R : ℝ} (hR : 0 ≤ R) : HasCompactSupport (radialBump R) := + (isCompact_closedBall (0:ℂ) R).of_isClosed_subset (isClosed_tsupport _) (radialBump_support hR) + +lemma radialBump_integral_pos {R : ℝ} (hR : 0 < R) : 0 < ∫ z, radialBump R z := by + apply (integral_pos_iff_support_of_nonneg (fun z => expNegInvGlue.nonneg _) + ((radialBump_contDiff R).continuous.integrable_of_hasCompactSupport (radialBump_compact hR.le))).mpr + have hb : ball (0:ℂ) R ⊆ support (radialBump R) := by + intro z hz + apply ne_of_gt + apply expNegInvGlue.pos_of_pos + have hn : ‖z‖ < R := by simpa only [mem_ball,dist_zero_right] using hz + nlinarith [norm_nonneg z] + exact (measure_ball_pos volume (0:ℂ) hR).trans_le (measure_mono hb) + +lemma radialBump_polar (R r θ : ℝ) : radialBump R (Complex.polarCoord.symm (r,θ)) = + expNegInvGlue (R^2-r^2) := by simp only [radialBump,Complex.norm_polarCoord_symm,sq_abs] + +lemma polar_continuous : Continuous (Complex.polarCoord.symm : ℝ × ℝ → ℂ) := by + have he : (Complex.polarCoord.symm : ℝ × ℝ → ℂ) = + fun p => (p.1:ℂ) * (Real.cos p.2 + Real.sin p.2 * Complex.I) := + funext Complex.polarCoord_symm_apply + rw [he] + fun_prop + +lemma polar_circle (x : ℂ) (r θ : ℝ) : x-Complex.polarCoord.symm (r,θ) = circleMap x (-r) θ := by + rw [circleMap,Complex.polarCoord_symm_apply,Complex.exp_mul_I] + push_cast + ring + +lemma angle_integral {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] + (f : ℂ → F) (x : ℂ) (r : ℝ) : + (∫ θ in Ioo (-Real.pi) Real.pi, f (circleMap x r θ)) = (2*Real.pi) • circleAverage f x r := by + have hp : Periodic (fun θ => f (circleMap x r θ)) (2*Real.pi) := + fun θ => congrArg f (periodic_circleMap x r θ) + have he := hp.intervalIntegral_add_eq 0 (-Real.pi) + rw [zero_add] at he + have he' : (∫ θ in -Real.pi..Real.pi, f (circleMap x r θ)) = + ∫ θ in 0..2*Real.pi, f (circleMap x r θ) := by + convert he.symm using 1 + ring_nf + rw [← integral_Ioc_eq_integral_Ioo, ← intervalIntegral.integral_of_le (by linarith [Real.pi_pos]),he',circleAverage_def] + rw [smul_smul,mul_inv_cancel₀ (mul_ne_zero two_ne_zero Real.pi_ne_zero),one_smul] + +lemma polar_bump_integrable {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] + {R : ℝ} (hR : 0 < R) {f : ℂ → F} (hf : Continuous f) (x : ℂ) : + IntegrableOn (fun p : ℝ × ℝ => p.1 • (radialBump R (Complex.polarCoord.symm p) • + f (x-Complex.polarCoord.symm p))) (Ioi 0 ×ˢ Ioo (-Real.pi) Real.pi) := by + apply IntegrableOn.of_inter_support (measurableSet_Ioi.prod measurableSet_Ioo) + have hc : Continuous (fun p : ℝ × ℝ => p.1 • (radialBump R (Complex.polarCoord.symm p) • + f (x-Complex.polarCoord.symm p))) := + continuous_fst.smul (((radialBump_contDiff R).continuous.comp polar_continuous).smul + (hf.comp (continuous_const.sub polar_continuous))) + apply (hc.continuousOn.integrableOn_compact (isCompact_Icc.prod isCompact_Icc)).mono_set + intro p hp + refine ⟨⟨hp.1.1.le,?_⟩,⟨hp.1.2.1.le,hp.1.2.2.le⟩⟩ + by_contra hh + have hz : radialBump R (Complex.polarCoord.symm p) = 0 := by + apply radialBump_zero hR.le + rw [Complex.norm_polarCoord_symm,abs_of_pos hp.1.1] + exact (lt_of_not_ge hh).le + exact hp.2 (by simp only [hz,zero_smul,smul_zero]) + + +theorem radial_average {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] + {R : ℝ} (hR : 0 < R) {f : ℂ → F} (hf : Continuous f) (x : ℂ) + (hh : InnerProductSpace.HarmonicOnNhd f (ball x R)) : + (∫ z, radialBump R z • f (x-z)) = (∫ z, radialBump R z) • f x := by + rw [← integral_smul_const] + rw [← Complex.integral_comp_polarCoord_symm, ← Complex.integral_comp_polarCoord_symm] + change (∫ p in Ioi 0 ×ˢ Ioo (-Real.pi) Real.pi, + p.1 • (radialBump R (Complex.polarCoord.symm p) • f (x-Complex.polarCoord.symm p))) = + ∫ p in Ioi 0 ×ˢ Ioo (-Real.pi) Real.pi, + p.1 • (radialBump R (Complex.polarCoord.symm p) • f x) + rw [Measure.volume_eq_prod] + rw [setIntegral_prod _ (by simpa only [Measure.volume_eq_prod] using polar_bump_integrable hR hf x), + setIntegral_prod _ (by simpa only [Measure.volume_eq_prod] using polar_bump_integrable hR (f := fun _ => f x) continuous_const (0:ℂ))] + apply setIntegral_congr_fun measurableSet_Ioi + intro r hr + simp_rw [radialBump_polar,polar_circle,integral_smul] + by_cases hrR : r < R + · have hh' : InnerProductSpace.HarmonicOnNhd f (closedBall x |(-r)|) := by + rw [abs_neg,abs_of_pos hr] + exact hh.mono (closedBall_subset_ball hrR) + rw [angle_integral,hh'.circleAverage_eq] + simp only [integral_const] + rw [Measure.real,Measure.restrict_apply_univ,volume_Ioo,ENNReal.toReal_ofReal (by linarith [Real.pi_pos] : 0 ≤ Real.pi- -Real.pi)] + congr 2 + ring_nf + · have hzero : expNegInvGlue (R^2-r^2) = 0 := by + apply expNegInvGlue.zero_of_nonpos + have hr' : R ≤ r := le_of_not_gt hrR + nlinarith + simp only [hzero,zero_smul,smul_zero] + +end StrictHotSpots.Weyl +end HarmonicRadialRegularityBaseLayer + +section ConvolutionShuffleRegularityBaseLayer +open Set MeasureTheory Metric Complex Function Filter ContinuousLinearMap +open scoped Topology ContDiff Laplacian Convolution +namespace StrictHotSpots.Weyl +open Helmholtz + +lemma convolution_assoc_scalar {u : ℂ → ℂ} {g k : ℂ → ℝ} + (hu : LocallyIntegrable u volume) (hg : Continuous g) (hcg : HasCompactSupport g) + (hk : Continuous k) (hck : HasCompactSupport k) : + (u ⋆[smulFlip] g) ⋆[smulFlip] k = u ⋆[smulFlip] (g ⋆[mul ℝ ℝ] k) := by + funext x + apply convolution_assoc smulFlip smulFlip smulFlip (mul ℝ ℝ) + (fun z a b => by simp only [smulFlip,ContinuousLinearMap.flip_apply, + ContinuousLinearMap.lsmul_apply,ContinuousLinearMap.mul_apply',smul_smul]; rw [mul_comm]) + hu.aestronglyMeasurable hg.aestronglyMeasurable hk.aestronglyMeasurable + · exact Eventually.of_forall (hcg.convolutionExists_right _ hu hg) + · exact Eventually.of_forall (hck.norm.convolutionExists_right _ hg.norm.locallyIntegrable hk.norm) + · exact (hcg.norm.convolution (mul ℝ ℝ) hck.norm).convolutionExists_right _ (fun x => (hu x).norm) + (hck.norm.continuous_convolution_right _ hg.norm.locallyIntegrable hk.norm) x + +lemma convolution_shuffle {u : ℂ → ℂ} {g k : ℂ → ℝ} + (hu : LocallyIntegrable u volume) (hg : Continuous g) (hcg : HasCompactSupport g) + (hk : Continuous k) (hck : HasCompactSupport k) : + (u ⋆[smulFlip] g) ⋆[smulFlip] k = (u ⋆[smulFlip] k) ⋆[smulFlip] g := by + rw [convolution_assoc_scalar hu hg hcg hk hck,convolution_assoc_scalar hu hk hck hg hcg] + have hh : (mul ℝ ℝ).flip = mul ℝ ℝ := by + apply ContinuousLinearMap.ext + intro x + apply ContinuousLinearMap.ext + intro y + simp only [ContinuousLinearMap.flip_apply,ContinuousLinearMap.mul_apply'] + exact mul_comm y x + rw [← convolution_flip (L := mul ℝ ℝ),hh] + +end StrictHotSpots.Weyl +end ConvolutionShuffleRegularityBaseLayer + +section WeakWeylRegularityBaseLayer +open Set MeasureTheory Metric Complex Function Filter ContinuousLinearMap +open scoped Topology ContDiff Laplacian Convolution +namespace StrictHotSpots.Weyl +open Helmholtz + + + +theorem local_representative {u : ℂ → ℂ} {a : ℂ} {R : ℝ} + (hu : LocallyIntegrable u volume) (hR : 0 < R) (hpde : WeakEquation (ball a R) 0 u) : + ∃ f : ℂ → ℂ, ContDiff ℝ ∞ f ∧ + ∀ᵐ x ∂volume, x ∈ ball a (R/4) → f x = u x := by + let φ := radialBump (R/4) + let c : ℝ := ∫ z, φ z + have hc : 0 < c := radialBump_integral_pos (by positivity) + have hφ : ContDiff ℝ ∞ φ := radialBump_contDiff _ + have hcφ : HasCompactSupport φ := radialBump_compact (by positivity) + let v := u ⋆[smulFlip] φ + have hv : ContDiff ℝ ∞ v := hcφ.contDiff_convolution_right _ hu hφ + refine ⟨fun x => c⁻¹ • v x,?_,?_⟩ + · simpa only [Pi.smul_apply] using! (contDiff_const (c := c⁻¹)).smul hv + filter_upwards [smoothen_tendsto hu,smoothen_tendsto hv.continuous.locallyIntegrable] with x hx hxv + intro hxa + have he : ∀ᶠ n in atTop, smoothen v n x = c • smoothen u n x := by + filter_upwards [(tendsto_order.1 mollifier_radius_tendsto).2 (R/2) (by positivity)] with n hn + have hh : InnerProductSpace.HarmonicOnNhd (smoothen u n) (ball x (R/4)) := by + intro y hy + have hym : y ∈ ball a (R-(mollifier n).rOut) := by + rw [mem_ball] at hy hxa ⊢ + have ht := dist_triangle y x a + linarith + refine ⟨((smoothen_contDiff hu n).of_le (show (2:ℕ∞ω) ≤ ∞ by decide)).contDiffAt,?_⟩ + filter_upwards [isOpen_ball.mem_nhds hym] with z hz + simpa only [neg_zero,zero_smul,Pi.zero_apply] using smoothen_PDE hu hpde n hz + calc + smoothen v n x = (smoothen u n ⋆[smulFlip] φ) x := + (congrFun (convolution_shuffle hu (mollifier n).continuous_normed + (mollifier n).hasCompactSupport_normed hφ.continuous hcφ) x).symm + _ = c • smoothen u n x := by + rw [← convolution_flip] + exact radial_average (by positivity) (smoothen_contDiff hu n).continuous x hh + have ht : Tendsto (fun n => smoothen v n x) atTop (𝓝 (c • u x)) := + (hx.const_smul c).congr' (he.mono (fun _ h => h.symm)) + have hvx : v x = c • u x := tendsto_nhds_unique hxv ht + rw [hvx,smul_smul,inv_mul_cancel₀ hc.ne',one_smul] + + + +theorem representative {u : ℂ → ℂ} {Ω : Set ℂ} (ho : IsOpen Ω) + (hu : LocallyIntegrable u volume) (hpde : WeakEquation Ω 0 u) : + ∃ f : ℂ → ℂ, ContDiffOn ℝ ∞ f Ω ∧ ∀ᵐ x ∂volume, x ∈ Ω → f x = u x := by + classical + have hball (x : Ω) : ∃ R : ℝ, 0 < R ∧ ball (x:ℂ) R ⊆ Ω := + Metric.isOpen_iff.mp ho x x.property + choose R hR hRΩ using hball + choose f hf hfu using fun x : Ω => local_representative hu (hR x) (hpde.mono (hRΩ x)) + have hsmall (x : Ω) : ball (x:ℂ) (R x/4) ⊆ Ω := + (ball_subset_ball (by linarith [hR x])).trans (hRΩ x) + have heq (x y : Ω) : EqOn (f x) (f y) (ball (x:ℂ) (R x/4) ∩ ball (y:ℂ) (R y/4)) := by + apply MeasureTheory.Measure.eqOn_open_of_ae_eq (μ := volume) _ (isOpen_ball.inter isOpen_ball) + (hf x).continuous.continuousOn (hf y).continuous.continuousOn + apply (ae_restrict_iff' (measurableSet_ball.inter measurableSet_ball)).mpr + filter_upwards [hfu x,hfu y] with z hx hy + intro hz + exact (hx hz.1).trans (hy hz.2).symm + let g : ℂ → ℂ := fun x => if hx : x ∈ Ω then f ⟨x,hx⟩ x else 0 + have hgf (x : Ω) {z : ℂ} (hz : z ∈ ball (x:ℂ) (R x/4)) : g z = f x z := by + have hzΩ := hsmall x hz + dsimp only [g] + rw [dite_eq_left hzΩ] + exact heq ⟨z,hzΩ⟩ x ⟨mem_ball_self (by linarith [hR ⟨z,hzΩ⟩]),hz⟩ + refine ⟨g,?_,?_⟩ + · intro x hx + let x' : Ω := ⟨x,hx⟩ + have he : g =ᶠ[𝓝 x] f x' := by + filter_upwards [ball_mem_nhds x (by linarith [hR x'] : 0 < R x'/4)] with z hz + exact hgf x' hz + exact ((hf x').contDiffAt.congr_of_eventuallyEq he).contDiffWithinAt + · obtain ⟨T,hT,hcover⟩ := (IsLindelof.of_coe (s := Ω)).elim_nhds_subcover' + (fun x hx => ball x (R ⟨x,hx⟩/4)) (fun x hx => ball_mem_nhds x (by linarith [hR ⟨x,hx⟩])) + have ha : ∀ᵐ z ∂volume, ∀ x ∈ T, z ∈ ball (x:ℂ) (R x/4) → f x z = u z := + (eventually_countable_ball hT).mpr (fun x _ => hfu x) + filter_upwards [ha] with z hz + intro hzΩ + obtain ⟨x,hx,hzB⟩ := mem_iUnion₂.mp (hcover hzΩ) + exact (hgf x hzB).trans (hz x hx hzB) + +end StrictHotSpots.Weyl +end WeakWeylRegularityBaseLayer + + + + +section PlaneDifferentialInteriorSupportLayer + +open Set MeasureTheory InnerProductSpace +open scoped ContDiff Laplacian +namespace StrictHotSpots.Hodge +abbrev e (i : Fin 2) : Plane := planeBasis i +abbrev c (i : Fin 2) (x : Plane) : ℝ := inner ℝ x (e i) + +lemma expand (x : Plane) : c 0 x • e 0 + c 1 x • e 1 = x := by + simpa only [Fin.sum_univ_two, OrthonormalBasis.repr_apply_apply, real_inner_comm] using planeBasis.sum_repr x +lemma basis_inner (i j : Fin 2) : inner ℝ (e i) (e j) = if i=j then 1 else 0 := + planeBasis.inner_eq_ite i j +lemma inner_two (x y : Plane) : inner ℝ x y = c 0 x*c 0 y+c 1 x*c 1 y := by + simpa only [Fin.sum_univ_two,real_inner_comm (e 0) y,real_inner_comm (e 1) y] using + (planeBasis.sum_inner_mul_inner x y).symm + +def rot : Plane →L[ℝ] Plane := + (innerSL ℝ (e 0)).smulRight (e 1) - (innerSL ℝ (e 1)).smulRight (e 0) +lemma rot_apply (x : Plane) : rot x = c 0 x • e 1-c 1 x • e 0 := by + simp only [rot,sub_apply,ContinuousLinearMap.smulRight_apply, + innerSL_apply_apply,real_inner_comm] +lemma c_rot (x : Plane) : c 0 (rot x) = -c 1 x ∧ c 1 (rot x) = c 0 x := by + rw [rot_apply] + simp only [c,inner_sub_left,inner_smul_left,conj_trivial,basis_inner] + norm_num +lemma rot_rot (x : Plane) : rot (rot x) = -x := by + rw [rot_apply,(c_rot x).1,(c_rot x).2] + calc + _ = -(c 0 x • e 0+c 1 x • e 1) := by module + _ = -x := by rw [expand] +lemma rot_inner (x y : Plane) : inner ℝ (rot x) (rot y) = inner ℝ x y := by + rw [inner_two,inner_two,(c_rot x).1,(c_rot x).2,(c_rot y).1,(c_rot y).2] + ring +lemma rot_skew (x y : Plane) : inner ℝ (rot x) y = -inner ℝ x (rot y) := by + rw [inner_two,inner_two,(c_rot x).1,(c_rot x).2,(c_rot y).1,(c_rot y).2] + ring +lemma rot_norm (x : Plane) : ‖rot x‖ = ‖x‖ := by + have hh := rot_inner x x + simp only [real_inner_self_eq_norm_sq] at hh + nlinarith [norm_nonneg (rot x),norm_nonneg x] + +abbrev D (i : Fin 2) (φ : Plane → ℝ) := directionalDerivative φ (e i) +lemma D_smooth {φ : Plane → ℝ} (hφ : ContDiff ℝ ∞ φ) (i : Fin 2) : ContDiff ℝ ∞ (D i φ) := + (hφ.fderiv_right (by simp)).clm_apply contDiff_const +lemma D_compact {φ : Plane → ℝ} (hc : HasCompactSupport φ) (i : Fin 2) : HasCompactSupport (D i φ) := + hc.fderiv_apply ℝ (e i) +lemma D_support (φ : Plane → ℝ) (i : Fin 2) : tsupport (D i φ) ⊆ tsupport φ := + tsupport_fderiv_apply_subset ℝ (e i) +lemma gradient_c (φ : Plane → ℝ) (i : Fin 2) (x : Plane) : c i (gradient φ x) = D i φ x := + inner_gradient_left +lemma D_D {φ : Plane → ℝ} (hφ : ContDiff ℝ ∞ φ) (i j : Fin 2) (x : Plane) : + D i (D j φ) x = D j (D i φ) x := by + have hd : DifferentiableAt ℝ (fderiv ℝ φ) x := + (hφ.fderiv_right (by simp) : ContDiff ℝ ∞ (fderiv ℝ φ)).differentiable (by simp) x + change fderiv ℝ (fun y => fderiv ℝ φ y (e j)) x (e i) = + fderiv ℝ (fun y => fderiv ℝ φ y (e i)) x (e j) + rw [fderiv_clm_apply hd (differentiableAt_const _),fderiv_clm_apply hd (differentiableAt_const _)] + simp only [fderiv_fun_const,Pi.zero_apply,ContinuousLinearMap.comp_zero,zero_add,ContinuousLinearMap.flip_apply] + exact (hφ.contDiffAt.isSymmSndFDerivAt (by + simp only [minSmoothness_of_isRCLikeNormedField] + exact WithTop.coe_le_coe.mpr (show (2 : ℕ∞) ≤ ⊤ from le_top))) _ _ + +lemma laplace_two {φ : Plane → ℝ} (hφ : ContDiff ℝ ∞ φ) (x : Plane) : + Δ φ x = D 0 (D 0 φ) x + D 1 (D 1 φ) x := by + simpa only [Fin.sum_univ_two] using + laplacian_eq_sum_directional isOpen_univ hφ.contDiffOn (mem_univ x) + +lemma inner_gradient (Z : Plane) (φ : Plane → ℝ) (x : Plane) : + inner ℝ Z (gradient φ x) = c 0 Z*D 0 φ x+c 1 Z*D 1 φ x := by + rw [inner_two,gradient_c,gradient_c] +lemma inner_rot_gradient (Z : Plane) (φ : Plane → ℝ) (x : Plane) : + inner ℝ Z (rot (gradient φ x)) = c 1 Z*D 0 φ x-c 0 Z*D 1 φ x := by + rw [inner_two,(c_rot _).1,(c_rot _).2,gradient_c,gradient_c] + ring +end StrictHotSpots.Hodge + + +end PlaneDifferentialInteriorSupportLayer + + +section PlaneWeakWeylInteriorSupportLayer + + +open Set MeasureTheory Filter Metric +open scoped ContDiff Laplacian Topology +namespace StrictHotSpots.Weyl + +private def coord : ℂ ≃ₗᵢ[ℝ] Plane := Complex.orthonormalBasisOneI.repr + +private def complexExtension (Ω : Set Plane) (u : Plane → ℝ) (z : ℂ) : ℂ := + Complex.ofReal (Ω.indicator u (coord z)) + +private lemma complexExtension_integral (Ω : Set Plane) (hΩ : MeasurableSet Ω) + (u : Plane → ℝ) (ψ : ℂ → ℝ) : + (∫ z, ψ z • complexExtension Ω u z) = + Complex.ofReal (∫ x in Ω, u x * ψ (coord.symm x)) := by + have he : (fun z => ψ z • complexExtension Ω u z) = + (fun z => ((Ω.indicator (fun x => u x * ψ (coord.symm x))) (coord z) : ℂ)) := by + funext z + by_cases hz : coord z ∈ Ω + · simp [complexExtension,indicator_of_mem hz,Complex.real_smul,mul_comm] + · simp [complexExtension,indicator_of_notMem hz] + rw [he,integral_complex_ofReal, + coord.measurePreserving.integral_comp coord.toHomeomorph.measurableEmbedding, + integral_indicator hΩ] + +private lemma complexExtension_integrable {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : MeasurableSet Ω) (hu : IntegrableOn u Ω) : + Integrable (complexExtension Ω u) volume := by + have hi := (integrable_indicator_iff hΩ).mpr hu + have hj := coord.measurePreserving.integrable_comp_of_integrable hi + exact Complex.ofRealCLM.integrable_comp hj + +private lemma complexExtension_weak {Ω : Set Plane} {μ : ℝ} {u : Plane → ℝ} + (hΩ : MeasurableSet Ω) (hp : PlaneWeakEquation Ω μ u) : + Helmholtz.WeakEquation (coord ⁻¹' Ω) μ (complexExtension Ω u) := by + intro φ hφ hc hs + have ht : ContDiff ℝ ∞ (φ ∘ coord.symm) := + hφ.comp coord.symm.toContinuousLinearEquiv.contDiff + have htc : HasCompactSupport (φ ∘ coord.symm) := hc.comp_homeomorph coord.symm.toHomeomorph + have hts : tsupport (φ ∘ coord.symm) ⊆ Ω := by + change tsupport (φ ∘ coord.symm.toHomeomorph) ⊆ Ω + rw [tsupport_comp_eq_preimage φ coord.symm.toHomeomorph] + intro x hx + have h : coord (coord.symm x) ∈ Ω := hs hx + simpa only [coord.apply_symm_apply] using h + have h := hp _ ht htc hts + simp only [laplacian_comp_linearIsometryEquiv,Function.comp_apply] at h + rw [complexExtension_integral Ω hΩ u (Δ φ),complexExtension_integral Ω hΩ u φ,h] + simp + + + +theorem plane_representative {Ω : Set Plane} {u : Plane → ℝ} + (ho : IsOpen Ω) (hu : IntegrableOn u Ω) (hp : PlaneWeakEquation Ω 0 u) : + ∃ f : Plane → ℝ, ContDiffOn ℝ ∞ f Ω ∧ ∀ᵐ x ∂volume.restrict Ω, f x = u x := by + obtain ⟨f,hf,hfu⟩ := representative (ho.preimage coord.continuous) + (complexExtension_integrable ho.measurableSet hu).locallyIntegrable + (complexExtension_weak ho.measurableSet hp) + refine ⟨fun x => (f (coord.symm x)).re,?_,?_⟩ + · exact Complex.reCLM.contDiff.comp_contDiffOn (hf.comp + coord.symm.toContinuousLinearEquiv.contDiff.contDiffOn + (fun x hx => by simpa only [mem_preimage,coord.apply_symm_apply] using hx)) + · apply (ae_restrict_iff' ho.measurableSet).mpr + filter_upwards [coord.symm.measurePreserving.quasiMeasurePreserving.ae hfu] with x hx + intro hxm + have he := hx (show coord.symm x ∈ coord ⁻¹' Ω by simpa using hxm) + simpa only [complexExtension,coord.apply_symm_apply,indicator_of_mem hxm,Complex.ofReal_re] using congrArg Complex.re he + +end StrictHotSpots.Weyl + +end PlaneWeakWeylInteriorSupportLayer + + +section PrimitiveAtlasInteriorSupportLayer + + + + +open Set Filter Bundle +open scoped Topology +namespace StrictHotSpots.Primitives + +structure DiscreteReal where + val : ℝ + +instance : TopologicalSpace DiscreteReal := ⊥ +instance : DiscreteTopology DiscreteReal := ⟨rfl⟩ + +@[ext] lemma DiscreteReal.ext {x y : DiscreteReal} (h : x.val = y.val) : x = y := by + cases x + cases y + cases h + rfl + +structure Atlas (X ι : Type*) [TopologicalSpace X] where + U : ι → Set X + isOpen_U : ∀ i, IsOpen (U i) + idx : X → ι + mem_U : ∀ x, x ∈ U (idx x) + potential : ι → X → ℝ + constant_overlap : ∀ i j x y, x ∈ U i ∩ U j → y ∈ U i ∩ U j → + potential i x-potential j x = potential i y-potential j y + +namespace Atlas +variable {X ι : Type*} [TopologicalSpace X] (A : Atlas X ι) + +def core : FiberBundleCore ι X DiscreteReal where + baseSet := A.U + isOpen_baseSet := A.isOpen_U + indexAt := A.idx + mem_baseSet_at := A.mem_U + coordChange i j x d := ⟨d.val+A.potential i x-A.potential j x⟩ + coordChange_self := by + intro i x _ d + ext + dsimp + ring + continuousOn_coordChange := by + intro i j + by_cases hn : (A.U i ∩ A.U j).Nonempty + · obtain ⟨z,hz⟩ := hn + have hc : Continuous (fun d : DiscreteReal => + (⟨d.val+(A.potential i z-A.potential j z)⟩ : DiscreteReal)) := continuous_of_discreteTopology + apply (hc.comp continuous_snd).continuousOn.congr + intro p hp + ext + dsimp + have he := A.constant_overlap i j p.1 z hp.1 hz + linarith + · have he : (A.U i ∩ A.U j) ×ˢ (univ : Set DiscreteReal) = ∅ := by + rw [not_nonempty_iff_eq_empty.mp hn,empty_prod] + rw [he] + exact continuousOn_empty _ + coordChange_comp := by + intro i j k x _ d + ext + dsimp + ring + + + +theorem exists_locally_potential [SimplyConnectedSpace X] [LocallyPathConnectedSpace X] + (x₀ : X) : ∃ g : X → ℝ, ∀ x : X, ∃ c : ℝ, + ∀ᶠ y in 𝓝 x, g y = A.potential (A.idx x) y+c := by + let Z := A.core + have hcov : IsCoveringMap Z.proj := IsFiberBundle.isCoveringMap (fun x => + ⟨Z.localTriv (Z.indexAt x),Z.mem_baseSet_at x⟩) + let e₀ : Z.TotalSpace := ⟨x₀,⟨0⟩⟩ + obtain ⟨F,⟨_,hF⟩,_⟩ := hcov.existsUnique_continuousMap_lifts (ContinuousMap.id X) x₀ e₀ rfl + have hproj (x : X) : (F x).1 = x := congrFun hF x + let g : X → ℝ := fun x => (F x).2.val+A.potential (A.idx (F x).1) (F x).1 + refine ⟨g,fun x => ?_⟩ + let i := A.idx x + let c : X → DiscreteReal := fun y => (Z.localTriv i (F y)).2 + have hc : ContinuousAt c x := by + apply ContinuousAt.snd + have hm : F x ∈ (Z.localTriv i).source := by + change Z.proj (F x) ∈ Z.baseSet i + rw [show Z.proj (F x) = x from hproj x] + exact A.mem_U x + exact ((Z.localTriv i).continuousAt hm).comp F.continuous.continuousAt + have he (y : X) : g y = A.potential i y+(c y).val := by + dsimp only [g,c] + rw [Z.localTriv_apply] + change (F y).2.val+A.potential (A.idx (F y).1) (F y).1 = + A.potential i y+((F y).2.val+A.potential (A.idx (F y).1) (F y).1-A.potential i (F y).1) + rw [hproj y] + ring + have hn : ∀ᶠ y in 𝓝 x, c y = c x := by + have hh : {c x} ∈ 𝓝 (c x) := by simp + exact hc hh + refine ⟨(c x).val,?_⟩ + filter_upwards [hn] with y hy + rw [he y,hy] + +end Atlas +end StrictHotSpots.Primitives + +end PrimitiveAtlasInteriorSupportLayer + + +section SimplyConnectedPoincareInteriorSupportLayer + +open Set Filter Metric +open scoped Topology +namespace StrictHotSpots.Primitives + + + +theorem exists_primitive {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + {Ω : Set E} (ho : IsOpen Ω) (hs : IsSimplyConnected Ω) + {ω : E → E →L[ℝ] ℝ} (hω : DifferentiableOn ℝ ω Ω) + (hd : ∀ a ∈ Ω, ∀ x y, fderiv ℝ ω a x y = fderiv ℝ ω a y x) : + ∃ f : E → ℝ, ∀ a ∈ Ω, HasFDerivAt f (ω a) a := by + classical + let : SimplyConnectedSpace Ω := hs + let : LocallyPathConnectedSpace Ω := ho.locallyPathConnectedSpace + have hb (p : Ω) : ∃ r : ℝ, 0 < r ∧ ball (p : E) r ⊆ Ω := + Metric.isOpen_iff.mp ho p p.property + choose r hr hrΩ using hb + have hprim (p : Ω) : ∃ F : E → ℝ, ∀ a ∈ ball (p : E) (r p), HasFDerivAt F (ω a) a := + (convex_ball (p : E) (r p)).exists_forall_hasFDerivAt_of_fderiv_symmetric isOpen_ball + (hω.mono (hrΩ p)) (fun a ha => hd a (hrΩ p ha)) + choose F hF using hprim + let A : Atlas Ω Ω := { + U := fun p => Subtype.val ⁻¹' ball (p : E) (r p) + isOpen_U := fun p => isOpen_ball.preimage continuous_subtype_val + idx := id + mem_U := fun p => mem_ball_self (hr p) + potential := fun p x => F p x + constant_overlap := by + intro p q x y hx hy + let U := ball (p : E) (r p) ∩ ball (q : E) (r q) + have hu : IsOpen U := isOpen_ball.inter isOpen_ball + have hh (z : E) (hz : z ∈ U) : HasFDerivAt (fun z => F p z-F q z) (0 : E →L[ℝ] ℝ) z := by + simpa only [sub_self,Pi.sub_apply] using! (hF p z hz.1).sub (hF q z hz.2) + apply ((convex_ball (p : E) (r p)).inter (convex_ball (q : E) (r q))).is_const_of_fderivWithin_eq_zero + (fun z hz => (hh z hz).differentiableAt.differentiableWithinAt) + (fun z hz => (hh z hz).hasFDerivWithinAt.fderivWithin (hu.uniqueDiffOn z hz)) hx hy } + obtain ⟨x₀⟩ := (inferInstance : Nonempty Ω) + obtain ⟨g,hg⟩ := A.exists_locally_potential x₀ + let f : E → ℝ := fun x => if hx : x ∈ Ω then g ⟨x,hx⟩ else 0 + refine ⟨f,fun a ha => ?_⟩ + let a' : Ω := ⟨a,ha⟩ + obtain ⟨c,hc⟩ := hg a' + have he : ∀ᶠ x in 𝓝 a, f x = F a' x+c := by + have hsub : ∀ᶠ x : Ω in 𝓝 a', g x = F a' x+c := hc + rw [nhds_subtype_eq_comap] at hsub + obtain ⟨s,hsn,hss⟩ := Filter.mem_comap.mp hsub + filter_upwards [hsn,ho.mem_nhds ha] with x hx hxΩ + have hm := hss (show (⟨x,hxΩ⟩ : Ω) ∈ Subtype.val ⁻¹' s from hx) + change g ⟨x,hxΩ⟩ = F a' x+c at hm + simpa only [f,dite_eq_left hxΩ] using hm + exact ((hF a' a (mem_ball_self (hr a'))).add_const c).congr_of_eventuallyEq he + +end StrictHotSpots.Primitives + +end SimplyConnectedPoincareInteriorSupportLayer + + +section SmoothTruncationInteriorSupportLayer + +open Set Filter MeasureTheory Metric +open scoped Topology ContDiff +namespace StrictHotSpots.Truncation + +def trunc (n : ℕ) (t : ℝ) : ℝ := ((n:ℝ)+1) * Real.arctan (t/((n:ℝ)+1)) +lemma smooth (n : ℕ) : ContDiff ℝ ∞ (trunc n) := by + exact contDiff_const.mul (Real.contDiff_arctan.comp (contDiff_id.div_const _)) +lemma derivative (n : ℕ) (t : ℝ) : + HasDerivAt (trunc n) (1 / (1 + (t/((n:ℝ)+1))^2)) t := by + have hn : (n:ℝ)+1 ≠ 0 := by positivity + convert (((hasDerivAt_id t).div_const ((n:ℝ)+1)).arctan.const_mul ((n:ℝ)+1)) using 1 <;> try rfl + simp only [id_eq] + field_simp +lemma deriv_bound (n : ℕ) (t : ℝ) : ‖deriv (trunc n) t‖ ≤ 1 := by + rw [(derivative n t).deriv, Real.norm_of_nonneg (by positivity)] + exact (div_le_one (by positivity)).mpr (by nlinarith [sq_nonneg (t/((n:ℝ)+1))]) +lemma norm_le (n : ℕ) (t : ℝ) : ‖trunc n t‖ ≤ ‖t‖ := by + have h := Convex.norm_image_sub_le_of_norm_deriv_le (f := trunc n) (s := univ) + (fun x _ => (derivative n x).differentiableAt) + (fun x _ => deriv_bound n x) convex_univ (mem_univ t) (mem_univ (0:ℝ)) + simpa [trunc] using h +lemma bounded (n : ℕ) (t : ℝ) : ‖trunc n t‖ ≤ ((n:ℝ)+1)*(Real.pi/2) := by + rw [trunc,norm_mul,Real.norm_of_nonneg (by positivity)] + apply mul_le_mul_of_nonneg_left _ (by positivity) + rw [Real.norm_eq_abs,abs_le] + exact ⟨(Real.neg_pi_div_two_lt_arctan _).le,(Real.arctan_lt_pi_div_two _).le⟩ +lemma tends (t : ℝ) : Tendsto (fun n => trunc n t) atTop (𝓝 t) := by + by_cases ht : t = 0 + · subst t + simp [trunc] + have ht0 : Tendsto (fun n : ℕ => t/((n:ℝ)+1)) atTop (𝓝 0) := by + exact tendsto_const_nhds.div_atTop (by simpa only [Function.comp_def,Nat.cast_add,Nat.cast_one] using (tendsto_natCast_atTop_atTop.comp (tendsto_add_atTop_nat 1) : Tendsto (fun n : ℕ => ((n+1:ℕ):ℝ)) atTop atTop)) + have htne : Tendsto (fun n : ℕ => t/((n:ℝ)+1)) atTop (𝓝[≠] 0) := + tendsto_nhdsWithin_iff.mpr ⟨ht0,Eventually.of_forall (fun n => by simpa using div_ne_zero ht (by positivity : (n:ℝ)+1 ≠ 0))⟩ + have hh := ((Real.hasDerivAt_arctan 0).tendsto_slope_zero.comp htne).const_mul t + convert hh using 1 + · ext n + simp only [Function.comp_apply,zero_add, Real.arctan_zero,sub_zero,smul_eq_mul,trunc] + field_simp + · simp +end StrictHotSpots.Truncation + +end SmoothTruncationInteriorSupportLayer + + +section AnchoredEstimateInteriorSupportLayer + +open Set MeasureTheory Filter +namespace StrictHotSpots + + +lemma anchored_l2_bound {α : Type*} [MeasurableSpace α] {μ : Measure α} [IsFiniteMeasure μ] + {B : Set α} (_hB : MeasurableSet B) (hβ : 0 < (μ B).toReal) + {f : α → ℝ} (hf : MemLp f 2 μ) {m M D : ℝ} + (ha : ∀ᵐ x ∂μ.restrict B, ‖f x‖ ≤ M) + (hv : (∫ x, (f x-m)^2 ∂μ) ≤ D) : + (∫ x, (f x)^2 ∂μ) ≤ 2*D + 2*((2*D + 2*M^2*(μ B).toReal)/(μ B).toReal)*(μ univ).toReal := by + have hfi : Integrable (fun x => (f x)^2) μ := (memLp_two_iff_integrable_sq hf.aestronglyMeasurable).mp hf + have hfm : MemLp (fun x => f x-m) 2 μ := hf.sub (memLp_const m) + have hvI : Integrable (fun x => (f x-m)^2) μ := (memLp_two_iff_integrable_sq hfm.aestronglyMeasurable).mp hfm + have hvB : (∫ x in B, (f x-m)^2 ∂μ) ≤ D := + (setIntegral_le_integral hvI (Eventually.of_forall (fun x => sq_nonneg _))).trans hv + have hmB : m^2*(μ B).toReal ≤ 2*D + 2*M^2*(μ B).toReal := by + have he : (∫ _ in B, m^2 ∂μ) ≤ ∫ x in B, 2*(f x-m)^2 + 2*M^2 ∂μ := by + apply integral_mono_ae (integrable_const _) ((hvI.restrict.const_mul 2).add (integrable_const _)) + filter_upwards [ha] with x hx + have hM := (sq_le_sq₀ (norm_nonneg _) ((norm_nonneg _).trans hx)).mpr hx + simp only [Real.norm_eq_abs,sq_abs] at hM + change m^2 ≤ 2*(f x-m)^2+2*M^2 + nlinarith [sq_nonneg (2*f x-m)] + rw [integral_add (hvI.restrict.const_mul 2) (integrable_const _),integral_const_mul] at he + simp only [integral_const,smul_eq_mul,measureReal_def,Measure.restrict_apply_univ] at he + nlinarith + have hm : m^2 ≤ (2*D + 2*M^2*(μ B).toReal)/(μ B).toReal := + (le_div_iff₀ hβ).mpr hmB + have he : (∫ x, (f x)^2 ∂μ) ≤ ∫ x, 2*(f x-m)^2+2*m^2 ∂μ := by + apply integral_mono_ae hfi ((hvI.const_mul 2).add (integrable_const _)) + exact Eventually.of_forall fun x => by + change (f x)^2 ≤ 2*(f x-m)^2+2*m^2 + nlinarith [sq_nonneg (f x-2*m)] + rw [integral_add (hvI.const_mul 2) (integrable_const _),integral_const_mul] at he + simp only [integral_const,smul_eq_mul,measureReal_def] at he + exact he.trans (add_le_add (mul_le_mul_of_nonneg_left hv (by norm_num)) + (by nlinarith [mul_le_mul_of_nonneg_right hm (ENNReal.toReal_nonneg (a := μ univ))])) +end StrictHotSpots + +end AnchoredEstimateInteriorSupportLayer + + +section FiniteEnergyPrimitiveInteriorSupportLayer + +open Set Filter MeasureTheory Metric +open scoped Topology ContDiff InnerProductSpace +namespace StrictHotSpots + + + +theorem finiteEnergy_hasH1Gradient {Ω : Set Plane} (ho : IsOpen Ω) + (hne : Ω.Nonempty) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) {r : Plane → ℝ} + (hr : ContDiffOn ℝ ∞ r Ω) (hg : MemLp (gradient r) 2 (volume.restrict Ω)) : + HasH1Gradient Ω r (gradient r) := by + let : IsFiniteMeasure (volume.restrict Ω) := ⟨by simpa using hb.measure_lt_top⟩ + have hvol : 0 < (volume Ω).toReal := + ENNReal.toReal_pos (ne_of_gt (ho.measure_pos volume hne)) hb.measure_lt_top.ne + have hrm : AEStronglyMeasurable r (volume.restrict Ω) := hr.continuousOn.aestronglyMeasurable ho.measurableSet + let F (n : ℕ) (x : Plane) := Truncation.trunc n (r x) + have hF (n : ℕ) : ContDiffOn ℝ ∞ (F n) Ω := (Truncation.smooth n).comp_contDiffOn hr + have hmF (n : ℕ) : MemLp (F n) 2 (volume.restrict Ω) := by + apply (memLp_const (((n:ℝ)+1)*(Real.pi/2))).mono + ((hF n).continuousOn.aestronglyMeasurable ho.measurableSet) + exact Eventually.of_forall fun x => (Truncation.bounded n (r x)).trans (le_abs_self _) + have hgrad (n : ℕ) {x : Plane} (hx : x ∈ Ω) : + gradient (F n) x = deriv (Truncation.trunc n) (r x) • gradient r x := by + apply (InnerProductSpace.toDual ℝ Plane).injective + simp only [gradient,map_smul,LinearIsometryEquiv.apply_symm_apply] + have hdx := ((hr.contDiffAt (ho.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt + exact (((Truncation.smooth n).differentiable (by simp)).differentiableAt.hasDerivAt.comp_hasFDerivAt x hdx).fderiv + have hgradle (n : ℕ) : ∀ᵐ x ∂volume.restrict Ω, ‖gradient (F n) x‖ ≤ ‖gradient r x‖ := by + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + rw [hgrad n hx,norm_smul] + exact mul_le_of_le_one_left (norm_nonneg _) (Truncation.deriv_bound n (r x)) + have hmG (n : ℕ) : MemLp (gradient (F n)) 2 (volume.restrict Ω) := by + apply hg.mono _ (hgradle n) + have hd : ContDiffOn ℝ ∞ (fderiv ℝ (F n)) Ω := (hF n).fderiv_of_isOpen ho (by simp) + have hc : ContinuousOn (gradient (F n)) Ω := + (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp_continuousOn + hd.continuousOn + exact hc.aestronglyMeasurable ho.measurableSet + have hH (n : ℕ) : HasH1Gradient Ω (F n) (gradient (F n)) := + HasH1Gradient.of_contDiffOn ho (hF n) (hmF n) (hmG n) + let m (n : ℕ) := (∫ x in Ω, F n x)/(volume Ω).toReal + let G := ∫ x in Ω, ‖gradient r x‖^2 + have hm (n : ℕ) : (∫ x in Ω, F n x-m n) = 0 := by + rw [integral_sub ((hmF n).integrable (by norm_num)) (integrable_const _)] + simp only [integral_const,measureReal_restrict_apply_univ,smul_eq_mul] + change (∫ x in Ω, F n x)-(volume Ω).toReal*m n = 0 + dsimp [m] + field_simp + ring + have hvar (n : ℕ) : (∫ x in Ω, (F n x-m n)^2) ≤ G/firstPositiveNeumannValue Ω := by + have hH' : HasH1Gradient Ω (fun x => F n x-m n) (gradient (F n)) := by + simpa only [sub_zero] using! (hH n).sub (HasH1Gradient.const hb (m n)) + have he := rayleigh_inequality_all hH' (hm n) + have he' : (∫ x in Ω, ‖gradient (F n) x‖^2) ≤ G := by + apply integral_mono_ae ((memLp_two_iff_integrable_sq_norm (hmG n).aestronglyMeasurable).mp (hmG n)) + ((memLp_two_iff_integrable_sq_norm hg.aestronglyMeasurable).mp hg) + exact (hgradle n).mono fun x hx => (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mpr hx + exact (le_div_iff₀ hμ).mpr (by nlinarith) + obtain ⟨a,ha⟩ := hne + have heΩ : ∀ᶠ x in 𝓝 a, x ∈ Ω := ho.mem_nhds ha + have he : ∀ᶠ x in 𝓝 a, x ∈ Ω ∧ ‖r x‖ < ‖r a‖+1 := + heΩ.and (((hr.continuousOn a ha).continuousAt (ho.mem_nhds ha)).norm.eventually + (gt_mem_nhds (by linarith : ‖r a‖ < ‖r a‖+1))) + obtain ⟨ε,hε,hεs⟩ := Metric.mem_nhds_iff.mp he + have hBΩ : ball a ε ⊆ Ω := fun x hx => (hεs hx).1 + have hβ : 0 < ((volume.restrict Ω) (ball a ε)).toReal := by + rw [Measure.restrict_apply measurableSet_ball,inter_eq_left.mpr hBΩ] + exact ENNReal.toReal_pos (ne_of_gt (isOpen_ball.measure_pos volume (nonempty_ball.mpr hε))) + (measure_ball_lt_top.ne) + let C := 2*(G/firstPositiveNeumannValue Ω) + + 2*((2*(G/firstPositiveNeumannValue Ω)+2*(‖r a‖+1)^2*((volume.restrict Ω) (ball a ε)).toReal)/ + ((volume.restrict Ω) (ball a ε)).toReal)*((volume.restrict Ω) univ).toReal + have hbound (n : ℕ) : (∫ x in Ω, (F n x)^2) ≤ C := by + apply anchored_l2_bound measurableSet_ball hβ (hmF n) (m := m n) + · filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + exact (Truncation.norm_le n (r x)).trans (hεs hx).2.le + · exact hvar n + have hLP (n : ℕ) : eLpNorm (F n) 2 (volume.restrict Ω) ≤ ENNReal.ofReal (Real.sqrt (max C 0)) := by + rw [(hmF n).eLpNorm_eq_integral_rpow_norm (by norm_num) (by norm_num)] + norm_num only [ENNReal.toReal_ofNat,Real.rpow_two,Real.norm_eq_abs,sq_abs] + rw [← Real.sqrt_eq_rpow] + exact ENNReal.ofReal_le_ofReal (Real.sqrt_le_sqrt ((hbound n).trans (le_max_left C 0))) + have hrL : MemLp r 2 (volume.restrict Ω) := by + exact (Lp.eLpNorm_le_of_ae_tendsto (Eventually.of_forall hLP) + (fun n => (hmF n).aestronglyMeasurable) hrm + (Eventually.of_forall (fun x => Truncation.tends (r x)))).trans_lt + ENNReal.ofReal_lt_top + exact HasH1Gradient.of_contDiffOn ho hr hrL hg +end StrictHotSpots + +end FiniteEnergyPrimitiveInteriorSupportLayer + + +section SmoothClosedPotentialInteriorSupportLayer + +open Set MeasureTheory +open scoped ContDiff InnerProductSpace +namespace StrictHotSpots + + + +theorem closed_finiteEnergy_potential {Ω : Set Plane} (ho : IsOpen Ω) + (hs : IsSimplyConnected Ω) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) + {Z : Plane → Plane} (hZ : ContDiffOn ℝ ∞ Z Ω) + (hm : MemLp Z 2 (volume.restrict Ω)) + (hd : ∀ a ∈ Ω, ∀ x y, + fderiv ℝ (fun a => innerSL ℝ (Z a)) a x y = + fderiv ℝ (fun a => innerSL ℝ (Z a)) a y x) : + ∃ r : Plane → ℝ, ContDiffOn ℝ ∞ r Ω ∧ HasH1Gradient Ω r Z := by + have hw : ContDiffOn ℝ ∞ (fun a => innerSL ℝ (Z a)) Ω := + (innerSL ℝ (E := Plane)).contDiff.comp_contDiffOn hZ + obtain ⟨r,hr⟩ := Primitives.exists_primitive ho hs (hw.differentiableOn (by simp)) hd + have he : EqOn (fderiv ℝ r) (fun a => innerSL ℝ (Z a)) Ω := fun a ha => (hr a ha).fderiv + have hrs : ContDiffOn ℝ ∞ r Ω := by + rw [contDiffOn_infty_iff_fderiv_of_isOpen ho] + exact ⟨fun a ha => (hr a ha).differentiableAt.differentiableWithinAt, hw.congr he⟩ + have heg : ∀ a ∈ Ω, gradient r a = Z a := by + intro a ha + apply (InnerProductSpace.toDual ℝ Plane).injective + change (InnerProductSpace.toDual ℝ Plane) ((InnerProductSpace.toDual ℝ Plane).symm (fderiv ℝ r a)) = _ + rw [LinearIsometryEquiv.apply_symm_apply,he ha] + ext y + rfl + have hae : gradient r =ᵐ[volume.restrict Ω] Z := + (ae_restrict_mem ho.measurableSet).mono fun a ha => heg a ha + have hgr : MemLp (gradient r) 2 (volume.restrict Ω) := (memLp_congr_ae hae).mpr hm + have hne : Ω.Nonempty := by + let : SimplyConnectedSpace Ω := hs + obtain ⟨x⟩ := (inferInstance : Nonempty Ω) + exact ⟨x,x.property⟩ + refine ⟨r,hrs,?_⟩ + exact (finiteEnergy_hasH1Gradient ho hne hb hμ hrs hgr).congr (Filter.Eventually.of_forall (fun _ => rfl)) hae + + + +theorem closed_orthogonal_gradient_zero {Ω : Set Plane} (ho : IsOpen Ω) + (hs : IsSimplyConnected Ω) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) + {Z : Plane → Plane} (hZ : ContDiffOn ℝ ∞ Z Ω) + (hm : MemLp Z 2 (volume.restrict Ω)) + (hd : ∀ a ∈ Ω, ∀ x y, + fderiv ℝ (fun a => innerSL ℝ (Z a)) a x y = + fderiv ℝ (fun a => innerSL ℝ (Z a)) a y x) + (hz : ∀ v g, HasH1Gradient Ω v g → (∫ x in Ω, inner ℝ (Z x) (g x)) = 0) : + ∀ x ∈ Ω, Z x = 0 := by + obtain ⟨r,_,hr⟩ := closed_finiteEnergy_potential ho hs hb hμ hZ hm hd + have he := hz r Z hr + simp only [real_inner_self_eq_norm_sq] at he + have hI := (memLp_two_iff_integrable_sq_norm hm.aestronglyMeasurable).mp hm + have hae : ∀ᵐ x ∂volume.restrict Ω, ‖Z x‖^2 = 0 := + (integral_eq_zero_iff_of_nonneg_ae (Filter.Eventually.of_forall (fun x => sq_nonneg ‖Z x‖)) hI).mp he + have hae' : Z =ᵐ[volume.restrict Ω] 0 := hae.mono fun x hx => by simpa using hx + exact MeasureTheory.Measure.eqOn_open_of_ae_eq hae' ho hZ.continuousOn continuousOn_const +end StrictHotSpots + +end SmoothClosedPotentialInteriorSupportLayer + + +section WeakHodgeRegularityInteriorSupportLayer + +open Set MeasureTheory +open scoped ContDiff Laplacian +namespace StrictHotSpots.Hodge + +def WeakDivZero (Ω : Set Plane) (Z : Plane → Plane) : Prop := + ∀ φ : Plane → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ Ω → + (∫ x in Ω, inner ℝ (Z x) (gradient φ x)) = 0 + +def WeakCurlZero (Ω : Set Plane) (Z : Plane → Plane) : Prop := + ∀ φ : Plane → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ Ω → + (∫ x in Ω, inner ℝ (Z x) (rot (gradient φ x))) = 0 + +lemma weak_harmonic_coordinates {Ω : Set Plane} (ho : IsOpen Ω) + {Z : Plane → Plane} (hm : MemLp Z 2 (volume.restrict Ω)) + (hd : WeakDivZero Ω Z) (hc : WeakCurlZero Ω Z) (i : Fin 2) : + PlaneWeakEquation Ω 0 (fun x => c i (Z x)) := by + intro φ hφ hk hs + have hI (j : Fin 2) : IntegrableOn (fun x => inner ℝ (Z x) (gradient (D j φ) x)) Ω := + integrable_inner_of_memLp hm (HasH1Gradient.test ho (D_smooth hφ j) (D_compact hk j)).2.1 + have hJ (j : Fin 2) : IntegrableOn (fun x => inner ℝ (Z x) (rot (gradient (D j φ) x))) Ω := + integrable_inner_of_memLp hm (rot.comp_memLp' (HasH1Gradient.test ho (D_smooth hφ j) (D_compact hk j)).2.1) + have hD (j : Fin 2) := hd _ (D_smooth hφ j) (D_compact hk j) ((D_support φ j).trans hs) + have hC (j : Fin 2) := hc _ (D_smooth hφ j) (D_compact hk j) ((D_support φ j).trans hs) + have he0 (x : Plane) : c 0 (Z x)*Δ φ x = + inner ℝ (Z x) (gradient (D 0 φ) x) - inner ℝ (Z x) (rot (gradient (D 1 φ) x)) := by + rw [laplace_two hφ,inner_gradient,inner_rot_gradient,D_D hφ 1 0] + ring + have he1 (x : Plane) : c 1 (Z x)*Δ φ x = + inner ℝ (Z x) (gradient (D 1 φ) x) + inner ℝ (Z x) (rot (gradient (D 0 φ) x)) := by + rw [laplace_two hφ,inner_gradient,inner_rot_gradient,D_D hφ 1 0] + ring + fin_cases i + · change (∫ x in Ω, c 0 (Z x) * Δ φ x) = _ + simp_rw [he0] + rw [integral_sub (hI 0) (hJ 1),hD 0,hC 1] + simp + · change (∫ x in Ω, c 1 (Z x) * Δ φ x) = _ + simp_rw [he1] + rw [integral_add (hI 1) (hJ 0),hD 1,hC 0] + simp + + + +theorem weak_divCurl_smooth {Ω : Set Plane} (ho : IsOpen Ω) + (hb : Bornology.IsBounded Ω) {Z : Plane → Plane} (hm : MemLp Z 2 (volume.restrict Ω)) + (hd : WeakDivZero Ω Z) (hc : WeakCurlZero Ω Z) : + ∃ W : Plane → Plane, ContDiffOn ℝ ∞ W Ω ∧ W =ᵐ[volume.restrict Ω] Z := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + have hh (i : Fin 2) := Weyl.plane_representative ho + ((hm.inner_const (e i)).integrable (by norm_num)) (weak_harmonic_coordinates ho hm hd hc i) + choose f hf he using hh + refine ⟨fun x => f 0 x • e 0+f 1 x • e 1,(hf 0).smul contDiffOn_const |>.add ((hf 1).smul contDiffOn_const),?_⟩ + filter_upwards [he 0,he 1] with x hx0 hx1 + rw [hx0,hx1,expand] + +lemma smooth_curl_zero {Ω : Set Plane} (ho : IsOpen Ω) + {W : Plane → Plane} (hW : ContDiffOn ℝ ∞ W Ω) (hc : WeakCurlZero Ω W) : + ∀ x ∈ Ω, D 0 (fun y => c 1 (W y)) x = D 1 (fun y => c 0 (W y)) x := by + let a : Plane → ℝ := fun x => c 0 (W x) + let b : Plane → ℝ := fun x => c 1 (W x) + have ha : ContDiffOn ℝ ∞ a Ω := hW.inner ℝ contDiffOn_const + have hb : ContDiffOn ℝ ∞ b Ω := hW.inner ℝ contDiffOn_const + have hda := directionalDerivative_contDiffOn ho ha (e 1) + have hdb := directionalDerivative_contDiffOn ho hb (e 0) + have hcont : ContinuousOn (fun x => D 0 b x-D 1 a x) Ω := hdb.continuousOn.sub hda.continuousOn + have hz := ho.ae_eq_zero_of_integral_contDiff_smul_eq_zero + (hcont.locallyIntegrableOn ho.measurableSet (μ := volume)) ?_ + · have he : (fun x => D 0 b x-D 1 a x) =ᵐ[volume.restrict Ω] 0 := (ae_restrict_iff' ho.measurableSet).mpr hz + have hh := MeasureTheory.Measure.eqOn_open_of_ae_eq he ho hcont continuousOn_const + intro x hx + exact sub_eq_zero.mp (hh hx) + · intro φ hφ hk hs + have hi : IntegrableOn (fun x => D 0 b x*φ x) Ω := (integrable_mul_test ho hdb.continuousOn hφ.continuous hk hs).integrableOn + have hj : IntegrableOn (fun x => D 1 a x*φ x) Ω := (integrable_mul_test ho hda.continuousOn hφ.continuous hk hs).integrableOn + have hi' : IntegrableOn (fun x => b x*D 0 φ x) Ω := (integrable_mul_test ho hb.continuousOn (D_smooth hφ 0).continuous + (D_compact hk 0) ((D_support φ 0).trans hs)).integrableOn + have hj' : IntegrableOn (fun x => a x*D 1 φ x) Ω := (integrable_mul_test ho ha.continuousOn (D_smooth hφ 1).continuous + (D_compact hk 1) ((D_support φ 1).trans hs)).integrableOn + have h0 := integral_mul_test_fderiv ho hb hφ hk hs (e 0) + have h1 := integral_mul_test_fderiv ho ha hφ hk hs (e 1) + have h := hc φ hφ hk hs + simp_rw [inner_rot_gradient] at h + rw [integral_sub hi' hj'] at h + change (∫ x in Ω, b x * D 0 φ x) = -(∫ x in Ω, D 0 b x * φ x) at h0 + change (∫ x in Ω, a x * D 1 φ x) = -(∫ x in Ω, D 1 a x * φ x) at h1 + rw [h0,h1] at h + simp only [smul_eq_mul] + simp_rw [mul_comm (φ _) _] + rw [← setIntegral_mul_test hs] + simp_rw [sub_mul] + rw [integral_sub hi hj] + linarith + +lemma smooth_closed {Ω : Set Plane} (ho : IsOpen Ω) + {W : Plane → Plane} (hW : ContDiffOn ℝ ∞ W Ω) (hc : WeakCurlZero Ω W) : + ∀ a ∈ Ω, ∀ x y, + fderiv ℝ (fun a => innerSL ℝ (W a)) a x y = + fderiv ℝ (fun a => innerSL ℝ (W a)) a y x := by + intro a ha x y + have hw : DifferentiableAt ℝ W a := + (hW.differentiableOn (by simp) a ha).differentiableAt (ho.mem_nhds ha) + have hform (x y : Plane) : + fderiv ℝ (fun a => innerSL ℝ (W a)) a x y = inner ℝ (fderiv ℝ W a x) y := by + have hh : HasFDerivAt (fun a => innerSL ℝ (W a)) + ((innerSL ℝ (E := Plane)).comp (fderiv ℝ W a)) a := + (innerSL ℝ (E := Plane)).hasFDerivAt.comp a hw.hasFDerivAt + rw [hh.fderiv] + rfl + have hcoord (i j : Fin 2) : D i (fun y => c j (W y)) a = + inner ℝ (fderiv ℝ W a (e i)) (e j) := by + change fderiv ℝ (fun y => inner ℝ (W y) (e j)) a (e i) = _ + rw [fderiv_inner_apply ℝ hw (differentiableAt_const _)] + simp only [fderiv_fun_const,Pi.zero_apply,zero_apply,inner_zero_right,zero_add] + have hc' := smooth_curl_zero ho hW hc a ha + rw [hcoord,hcoord] at hc' + simp_rw [hform] + conv_lhs => rw [← expand x,← expand y] + conv_rhs => rw [← expand y,← expand x] + simp only [map_add,map_smul,inner_add_left,inner_add_right,inner_smul_left, + inner_smul_right,conj_trivial] + rw [hc'] + ring + + + + +theorem weak_divCurl_zero {Ω : Set Plane} (ho : IsOpen Ω) + (hs : IsSimplyConnected Ω) (hb : Bornology.IsBounded Ω) + (hμ : 0 < firstPositiveNeumannValue Ω) + {Z : Plane → Plane} (hm : MemLp Z 2 (volume.restrict Ω)) + (hc : WeakCurlZero Ω Z) + (hz : ∀ v g, HasH1Gradient Ω v g → (∫ x in Ω, inner ℝ (Z x) (g x)) = 0) : + Z =ᵐ[volume.restrict Ω] 0 := by + have hd : WeakDivZero Ω Z := fun φ hφ hk _ => hz φ _ (HasH1Gradient.test ho hφ hk) + obtain ⟨W,hW,he⟩ := weak_divCurl_smooth ho hb hm hd hc + have hwm : MemLp W 2 (volume.restrict Ω) := (memLp_congr_ae he).mpr hm + have heI (f : Plane → Plane) : (∫ x in Ω, inner ℝ (W x) (f x)) = + ∫ x in Ω, inner ℝ (Z x) (f x) := + integral_congr_ae (he.mono fun x hx => congrArg (fun t => inner ℝ t (f x)) hx) + have hwc : WeakCurlZero Ω W := fun φ hφ hk ht => (heI _).trans (hc φ hφ hk ht) + have hwz : ∀ v g, HasH1Gradient Ω v g → (∫ x in Ω, inner ℝ (W x) (g x)) = 0 := + fun v g hv => (heI g).trans (hz v g hv) + have hw0 := closed_orthogonal_gradient_zero ho hs hb hμ hW hwm (smooth_closed ho hW hwc) hwz + exact he.symm.trans ((ae_restrict_mem ho.measurableSet).mono fun x hx => hw0 x hx) + +end StrictHotSpots.Hodge + +end WeakHodgeRegularityInteriorSupportLayer + + + +end + +end ActualVectorSupport + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Pullback.lean b/lean/OAI/Analysis/HotSpots/Pullback.lean new file mode 100644 index 0000000000000000000000000000000000000000..4fd81f6d43590cb9196fd37e5938c4618e5dc3f2 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Pullback.lean @@ -0,0 +1,567 @@ +import OAI.Analysis.HotSpots.GreenSolution + +namespace OAI + +section ConformalSmoothEnergy + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace +namespace StrictHotSpots.Conformal + +lemma complex_real_inner_mul (a u v : ℂ) : + inner ℝ (a*u) (a*v) = ‖a‖^2 * inner ℝ u v := by + rw [← Complex.normSq_eq_norm_sq] + simp only [Complex.inner,Complex.mul_re,Complex.mul_im,Complex.conj_re, + Complex.conj_im,Complex.normSq_apply] + ring + +lemma plane_inner_gradient_comp {f : Plane → Plane} {u v : Plane → ℝ} + {a : ℂ} {x : Plane} (hf : HasFDerivAt f (planeMul a) x) + (hu : DifferentiableAt ℝ u (f x)) (hv : DifferentiableAt ℝ v (f x)) : + inner ℝ (gradient (u ∘ f) x) (gradient (v ∘ f) x) = + ‖a‖^2 * inner ℝ (gradient u (f x)) (gradient v (f x)) := by + rw [plane_gradient_comp hf hu,plane_gradient_comp hf hv,coordinate.inner_map_map, + complex_real_inner_mul,Complex.norm_conj,coordinate.symm.inner_map_map] + +lemma plane_dirichlet_pair (e : OpenPartialHomeomorph Plane Plane) + (d : Plane → ℂ) (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + {u v : Plane → ℝ} (hu : DifferentiableOn ℝ u e.target) (hv : DifferentiableOn ℝ v e.target) : + (∫ y in e.target, inner ℝ (gradient u y) (gradient v y)) = + ∫ x in e.source, inner ℝ (gradient (u ∘ e) x) (gradient (v ∘ e) x) := by + rw [plane_integral_target e d hd] + apply setIntegral_congr_fun e.open_source.measurableSet + intro x hx + exact (plane_inner_gradient_comp (hd x hx) + ((hu _ (e.map_source hx)).differentiableAt (e.open_target.mem_nhds (e.map_source hx))) + ((hv _ (e.map_source hx)).differentiableAt (e.open_target.mem_nhds (e.map_source hx)))).symm + +lemma inner_grad_toH1 {Ω : Set Plane} {u v : Plane → ℝ} + (hu : HasH1Gradient Ω u (gradient u)) (hv : HasH1Gradient Ω v (gradient v)) : + inner ℝ (H1.grad hu.toH1) (H1.grad hv.toH1) = + ∫ x in Ω, inner ℝ (gradient u x) (gradient v x) := by + rw [H1.grad_toH1,H1.grad_toH1,L2.inner_def] + apply integral_congr_ae + filter_upwards [hu.2.1.coeFn_toLp,hv.2.1.coeFn_toLp] with x hx hy + rw [hx,hy] + +lemma inner_grad_test {Ω : Set Plane} (ho : IsOpen Ω) {w : Plane → ℝ} + (hW : HasH1Gradient Ω w (gradient w)) (f : smoothTestSpace Ω) : + inner ℝ (H1.grad hW.toH1) (H10.grad ho (smoothTestToH10 ho f)) = + ∫ x in Ω, inner ℝ (gradient w x) (gradient (f : Plane → ℝ) x) := by + change inner ℝ (H1.grad hW.toH1) + (H1.grad ((HasH1Gradient.test ho f.property.1 f.property.2.1).toH1)) = _ + exact inner_grad_toH1 hW (HasH1Gradient.test ho f.property.1 f.property.2.1) + +variable (e : OpenPartialHomeomorph Plane Plane) + (he : ContDiffOn ℝ ∞ e.symm e.target) (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (hb : Bornology.IsBounded e.target) + +include d hd in +lemma transportTest_dirichlet_pair {w : Plane → ℝ} + (hw : DifferentiableOn ℝ w e.target) (f : smoothTestSpace e.source) : + (∫ x in e.target, inner ℝ (gradient w x) (gradient (transportTest e he f : Plane → ℝ) x)) = + ∫ x in e.source, inner ℝ (gradient (w ∘ e) x) (gradient (f : Plane → ℝ) x) := by + calc + _ = ∫ x in e.source, inner ℝ (gradient (w ∘ e) x) + (gradient ((transportTest e he f : Plane → ℝ) ∘ e) x) := + plane_dirichlet_pair e d hd hw + ((transportTest e he f).property.1.differentiable (by simp)).differentiableOn + _ = _ := by + apply setIntegral_congr_fun e.open_source.measurableSet + intro x hx + have hg : gradient ((CompactChart.transport e f) ∘ e) x = gradient (f : Plane → ℝ) x := by + unfold gradient + rw [(CompactChart.transport_comp_eventuallyEq e (f:=f) hx).fderiv_eq] + exact congrArg (fun a : Plane => inner ℝ (gradient (w ∘ e) x) a) hg + +include d hd in +lemma transportTest_mixed_grad {w : Plane → ℝ} (hw : DifferentiableOn ℝ w e.target) + (hW : HasH1Gradient e.target w (gradient w)) + (hV : HasH1Gradient e.source (w ∘ e) (gradient (w ∘ e))) (f : smoothTestSpace e.source) : + inner ℝ (H1.grad hW.toH1) + (H10.grad e.open_target (smoothTestToH10 e.open_target (transportTest e he f))) = + inner ℝ (H1.grad hV.toH1) (H10.grad e.open_source (smoothTestToH10 e.open_source f)) := + (inner_grad_test e.open_target hW (transportTest e he f)).trans + ((transportTest_dirichlet_pair e he d hd hw f).trans (inner_grad_test e.open_source hV f).symm) + +include d hd hb in + + +lemma transportH10_mixed_grad {w : Plane → ℝ} (hw : DifferentiableOn ℝ w e.target) + (hW : HasH1Gradient e.target w (gradient w)) + (hV : HasH1Gradient e.source (w ∘ e) (gradient (w ∘ e))) (v : H10 e.open_source) : + inner ℝ (H1.grad hW.toH1) (H10.grad e.open_target (transportH10 e he v)) = + inner ℝ (H1.grad hV.toH1) (H10.grad e.open_source v) := by + have H : (fun v : H10 e.open_source => + inner ℝ (H1.grad hW.toH1) (H10.grad e.open_target (transportH10 e he v))) = + (fun v : H10 e.open_source => inner ℝ (H1.grad hV.toH1) (H10.grad e.open_source v)) := by + apply (dense_smoothTestToH10 e.open_source).equalizer + (continuous_const.inner ((H10.grad e.open_target).continuous.comp (transportH10 e he).continuous)) + (continuous_const.inner (H10.grad e.open_source).continuous) + funext f + dsimp only [Function.comp_apply] + exact (congrArg (fun z : H10 e.open_target => + inner ℝ (H1.grad hW.toH1) (H10.grad e.open_target z)) + (transportH10_test e he d hd hb f)).trans (transportTest_mixed_grad e he d hd hw hW hV f) + exact congrFun H v + +end StrictHotSpots.Conformal +end +end ConformalSmoothEnergy + +section ConformalAffine + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal +namespace StrictHotSpots.Conformal + +variable (e : OpenPartialHomeomorph Plane Plane) + (he : ContDiffOn ℝ ∞ e.symm e.target) (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (hb : Bornology.IsBounded e.target) + +include d hd in +lemma smooth_pair_grad {w z : Plane → ℝ} + (hw : DifferentiableOn ℝ w e.target) (hz : DifferentiableOn ℝ z e.target) + (hW : HasH1Gradient e.target w (gradient w)) + (hZ : HasH1Gradient e.target z (gradient z)) + (hV : HasH1Gradient e.source (w ∘ e) (gradient (w ∘ e))) + (hU : HasH1Gradient e.source (z ∘ e) (gradient (z ∘ e))) : + inner ℝ (H1.grad hW.toH1) (H1.grad hZ.toH1) = + inner ℝ (H1.grad hV.toH1) (H1.grad hU.toH1) := + (inner_grad_toH1 hW hZ).trans ((plane_dirichlet_pair e d hd hw hz).trans + (inner_grad_toH1 hV hU).symm) + +lemma inner_sum_pair {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] (a b c d : E) (a' b' c' d' : F) + (h00 : inner ℝ a c = inner ℝ a' c') (h01 : inner ℝ a d = inner ℝ a' d') + (h10 : inner ℝ c b = inner ℝ c' b') (h11 : inner ℝ b d = inner ℝ b' d') : + inner ℝ (a+b) (c+d) = inner ℝ (a'+b') (c'+d') := by + simp only [inner_add_left,inner_add_right] + have ht : inner ℝ b c = inner ℝ b' c' := + (real_inner_comm _ _).trans (h10.trans (real_inner_comm _ _)) + rw [h00,h01,h11,ht] + +lemma inner_H1grad_add {S : Set Plane} (a b c d : H1 S) : + inner ℝ (H1.grad (a+b)) (H1.grad (c+d)) = + inner ℝ (H1.grad a+H1.grad b) (H1.grad c+H1.grad d) := by + rw [map_add,map_add] + +include d hd hb in +lemma affine_grad_pair {w z : Plane → ℝ} + (hw : DifferentiableOn ℝ w e.target) (hz : DifferentiableOn ℝ z e.target) + (hW : HasH1Gradient e.target w (gradient w)) + (hZ : HasH1Gradient e.target z (gradient z)) + (hV : HasH1Gradient e.source (w ∘ e) (gradient (w ∘ e))) + (hU : HasH1Gradient e.source (z ∘ e) (gradient (z ∘ e))) + (v u : H10 e.open_source) : + inner ℝ (H1.grad (hW.toH1+(transportH10 e he v).val)) + (H1.grad (hZ.toH1+(transportH10 e he u).val)) = + inner ℝ (H1.grad (hV.toH1+v.val)) (H1.grad (hU.toH1+u.val)) := by + have h00 := smooth_pair_grad e d hd hw hz hW hZ hV hU + have h01 := transportH10_mixed_grad e he d hd hb hw hW hV u + have h10 := transportH10_mixed_grad e he d hd hb hz hZ hU v + have h11 := transportH10_inner_grad e he d hd hb v u + exact (inner_H1grad_add hW.toH1 (transportH10 e he v).val + hZ.toH1 (transportH10 e he u).val).trans + ((inner_sum_pair _ _ _ _ _ _ _ _ h00 h01 h10 h11).trans + (inner_H1grad_add hV.toH1 v.val hU.toH1 u.val).symm) + +lemma pull_affine_value {w : Plane → ℝ} + (hW : HasH1Gradient e.target w (gradient w)) (v : H10 e.open_source) : + chartPull e d hd (H1.value (hW.toH1+(transportH10 e he v).val)) = + chartPull e d hd (H1.value hW.toH1)+weightedValue e he d hd v := by + exact (chartPull e d hd).map_add (H1.value hW.toH1) + (H1.value (transportH10 e he v).val) + +lemma value_add_H10 {S : Set Plane} (ho : IsOpen S) (a : H1 S) (v : H10 ho) : + H1.value (a+v.val) = H1.value a+H10.value ho v := H1.value.map_add a v.val + +lemma ae_lp_sums {μ ν : Measure Plane} (ha : μ ≪ ν) + (a b : Lp ℝ 2 μ) (c d : Lp ℝ 2 ν) + (hac : (a : Plane → ℝ) =ᵐ[μ] c) (hbd : (b : Plane → ℝ) =ᵐ[μ] d) : + (a+b : Lp ℝ 2 μ) =ᵐ[μ] (c+d : Lp ℝ 2 ν) := + (Lp.coeFn_add a b).trans ((hac.add hbd).trans (Filter.EventuallyEq.symm (ha.ae_le (Lp.coeFn_add c d)))) + +include hb in +lemma affine_value_ae {w : Plane → ℝ} + (hW : HasH1Gradient e.target w (gradient w)) + (hV : HasH1Gradient e.source (w ∘ e) (gradient (w ∘ e))) (v : H10 e.open_source) : + (chartPull e d hd (H1.value (hW.toH1+(transportH10 e he v).val)) : Plane → ℝ) + =ᵐ[chartMeasure e d] H1.value (hV.toH1+v.val) := by + have ha := chartPull_test_ae e d hd hW.1 + have hc := (chartMeasure_ac e d).ae_le hV.1.coeFn_toLp + have hv := weightedValue_ae e he d hd hb v + have hs := ae_lp_sums (chartMeasure_ac e d) + (chartPull e d hd (H1.value hW.toH1)) (weightedValue e he d hd v) + (H1.value hV.toH1) (H10.value e.open_source v) (ha.trans (Filter.EventuallyEq.symm hc)) hv.symm + exact (Filter.EventuallyEq.of_eq (congrArg (fun f : Lp ℝ 2 (chartMeasure e d) => (f : Plane → ℝ)) + (pull_affine_value e he d hd hW v))).trans + (hs.trans (Filter.EventuallyEq.of_eq (congrArg (fun f : Lp ℝ 2 (volume.restrict e.source) => + (f : Plane → ℝ)) (value_add_H10 e.open_source hV.toH1 v))).symm) + +lemma isometry_value_pair {μ ν : Measure Plane} + (L : Lp ℝ 2 μ →ₗᵢ[ℝ] Lp ℝ 2 ν) (a b : Lp ℝ 2 μ) {f g : Plane → ℝ} + (ha : (L a : Plane → ℝ) =ᵐ[ν] f) (hb : (L b : Plane → ℝ) =ᵐ[ν] g) : + inner ℝ a b = ∫ x, f x*g x ∂ν := by + apply (L.inner_map_map a b).symm.trans + apply (L2.inner_def _ _).trans + apply integral_congr_ae + filter_upwards [ha,hb] with x hx hy + rw [hx,hy,Real.inner_apply,mul_comm] + +include hd hb in +lemma affine_value_pair {w z : Plane → ℝ} + (hW : HasH1Gradient e.target w (gradient w)) + (hZ : HasH1Gradient e.target z (gradient z)) + (hV : HasH1Gradient e.source (w ∘ e) (gradient (w ∘ e))) + (hU : HasH1Gradient e.source (z ∘ e) (gradient (z ∘ e))) + (v u : H10 e.open_source) : + inner ℝ (H1.value (hW.toH1+(transportH10 e he v).val)) + (H1.value (hZ.toH1+(transportH10 e he u).val)) = + ∫ x, H1.value (hV.toH1+v.val) x*H1.value (hU.toH1+u.val) x ∂chartMeasure e d := + isometry_value_pair (chartPull e d hd) _ _ + (affine_value_ae e he d hd hb hW hV v) (affine_value_ae e he d hd hb hZ hU u) + +end StrictHotSpots.Conformal +end +end ConformalAffine + +section ActualPotential + +noncomputable section +open Set MeasureTheory Filter +open scoped ENNReal InnerProductSpace +namespace StrictHotSpots.Conformal +open DiskH10 + +lemma potentialMeasure_bounded {e : OpenPartialHomeomorph Plane Plane} {d : Plane → ℂ} + {μ B : ℝ} (hμ : 0 ≤ μ) (hB : 0 ≤ B) (hd : ∀ x ∈ e.source, ‖d x‖ ≤ B) : + potentialMeasure e d μ ≤ ENNReal.ofReal (μ*B^2) • volume.restrict e.source := by + rw [potentialMeasure_density e d hμ, ← withDensity_const] + apply withDensity_mono + filter_upwards [ae_restrict_mem e.open_source.measurableSet] with x hx + apply ENNReal.ofReal_le_ofReal + exact mul_le_mul_of_nonneg_left (sq_le_sq₀ (norm_nonneg _) hB |>.mpr (hd x hx)) hμ + +lemma subcritical_reindex {S T : Set Plane} (ho : IsOpen S) (ho' : IsOpen T) + (hST : S = T) {ν : Measure Plane} {δ : ℝ} + (h : ∀ v : H10 ho, (∫ x, (H10.value ho v x)^2 ∂ν) ≤ δ*‖H10.grad ho v‖^2) : + ∀ v : H10 ho', (∫ x, (H10.value ho' v x)^2 ∂ν) ≤ δ*‖H10.grad ho' v‖^2 := by + cases hST + exact h + +namespace ClosedDiskChart +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + +def potential : Measure Plane := potentialMeasure c.e c.d (firstPositiveNeumannValue Ω) +def densityBound : ℝ≥0∞ := ENNReal.ofReal (firstPositiveNeumannValue Ω*c.bound^2) + +lemma density_bound (hμ : 0 ≤ firstPositiveNeumannValue Ω) : + c.potential ≤ c.densityBound • volume.restrict disk := by + have h := potentialMeasure_bounded hμ c.bound_pos.le c.bounded_deriv + simpa only [potential,densityBound,c.source_eq] using h + +lemma densityBound_ne_top : c.densityBound ≠ ∞ := ENNReal.ofReal_ne_top + +lemma potential_finite (hb : Bornology.IsBounded Ω) : IsFiniteMeasure c.potential := + potentialMeasure_finite c.e c.d c.deriv _ (c.target_eq.symm ▸ hb) + + + +theorem subcritical (hb : Bornology.IsBounded Ω) (hne : Ω.Nonempty) + (hμ : 0 < firstPositiveNeumannValue Ω) : + ∃ δ : ℝ, 0 < δ ∧ δ < 1 ∧ ∀ v : H10 PlaneGreen.diskOpen, + ‖H10.weightedValue PlaneGreen.diskOpen c.densityBound_ne_top (c.density_bound hμ.le) v‖^2 ≤ + δ*‖H10.grad PlaneGreen.diskOpen v‖^2 := by + have hh := potentialMeasure_subcritical c.e c.d c.deriv c.inverse_smooth + (c.target_eq.symm ▸ hb) (c.target_eq.symm ▸ hne) (c.target_eq.symm ▸ hμ) + obtain ⟨δ,hδ,hδ1,hsub⟩ := hh + have hs := subcritical_reindex c.e.open_source PlaneGreen.diskOpen c.source_eq hsub + have hs' : ∀ v : H10 PlaneGreen.diskOpen, + (∫ x, (H10.value PlaneGreen.diskOpen v x)^2 ∂c.potential) ≤ δ*‖H10.grad PlaneGreen.diskOpen v‖^2 := by + simpa only [potential,c.target_eq] using hs + refine ⟨δ,hδ,hδ1,fun v => ?_⟩ + rw [L2Limits.norm_sq_eq_integral_sq] + have he := H10.weightedValue_ae PlaneGreen.diskOpen c.densityBound_ne_top (c.density_bound hμ.le) v + exact (integral_congr_ae (he.fun_comp (fun t : ℝ => t^2))).le.trans (hs' v) + + + +theorem operator_norm_lt_one (hb : Bornology.IsBounded Ω) (hne : Ω.Nonempty) + (hμ : 0 < firstPositiveNeumannValue Ω) : + ‖PlaneGreen.weightedIntegralOperator c.densityBound_ne_top (c.density_bound hμ.le)‖ < 1 := by + obtain ⟨δ,hδ,hδ1,hsub⟩ := c.subcritical hb hne hμ + exact (PlaneGreen.weightedIntegralOperator_norm_le c.densityBound_ne_top + (c.density_bound hμ.le) hδ.le hsub).trans_lt hδ1 + +end ClosedDiskChart +end StrictHotSpots.Conformal +end +end ActualPotential + +section ActualScalarPull + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal Laplacian +namespace StrictHotSpots.Conformal + +lemma observe_inner {S : Set Plane} {ν : Measure Plane} {C : ℝ≥0∞} + (hC : C ≠ (∞ : ℝ≥0∞)) (hν : ν ≤ C • volume.restrict S) (u v : H1 S) : + inner ℝ (SubcriticalExtension.observe hC hν u) (SubcriticalExtension.observe hC hν v) = + ∫ x, H1.value u x * H1.value v x ∂ν := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [Lp.coeFn_LpToLpOfMeasureLeSMul hC hν (H1.value u), + Lp.coeFn_LpToLpOfMeasureLeSMul hC hν (H1.value v)] with x hx hy + change inner ℝ (Lp.LpToLpOfMeasureLeSMul hC hν (H1.value u) x) + (Lp.LpToLpOfMeasureLeSMul hC hν (H1.value v) x) = _ + rw [hx,hy,real_inner_comm] + rfl + +variable (e : OpenPartialHomeomorph Plane Plane) + (he : ContDiffOn ℝ ∞ e.symm e.target) (d : Plane → ℂ) + (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + (hb : Bornology.IsBounded e.target) + +include d hd hb in +lemma smooth_H10_value_pair {w : Plane → ℝ} + (hW : HasH1Gradient e.target w (gradient w)) + (hV : HasH1Gradient e.source (w ∘ e) (gradient (w ∘ e))) (v : H10 e.open_source) : + inner ℝ (H1.value hW.toH1) (H10.value e.open_target (transportH10 e he v)) = + ∫ x, H1.value hV.toH1 x * H10.value e.open_source v x ∂chartMeasure e d := by + apply isometry_value_pair (chartPull e d hd) + · have ha : (H1.value hV.toH1 : Plane → ℝ) =ᵐ[chartMeasure e d] w ∘ e := + (chartMeasure_ac e d).ae_le hV.1.coeFn_toLp + exact (chartPull_test_ae e d hd hW.1).trans ha.symm + · exact (weightedValue_ae e he d hd hb v).symm + +namespace ClosedDiskChart +open DiskH10 PlaneGreen +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + +lemma potential_diskMap : potentialMeasure c.diskMap c.d (firstPositiveNeumannValue Ω) = + c.potential := congrArg (fun e => potentialMeasure e c.d (firstPositiveNeumannValue Ω)) c.diskMap_eq + +lemma smooth_mixed_mass (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) + (hμ : 0 ≤ firstPositiveNeumannValue Ω) (v : H10 diskOpen) : + inner ℝ (SubcriticalExtension.observe c.densityBound_ne_top (c.density_bound hμ) + (c.pullDatum_H1 hb hs hw).toH1) + (H10.weightedValue diskOpen c.densityBound_ne_top (c.density_bound hμ) v) = + firstPositiveNeumannValue Ω * inner ℝ + (H1.value (smooth_closure_H1 c.diskMap.open_target hb hs hw).toH1) + (H10.value c.diskMap.open_target (transportH10 c.diskMap c.diskMap_inverse_smooth v)) := by + have hh := smooth_H10_value_pair c.diskMap c.diskMap_inverse_smooth c.d c.diskMap_deriv hb + (smooth_closure_H1 c.diskMap.open_target hb hs hw) (c.pullDatum_comp_H1 hb hs hw) v + have hr := congrArg (fun U : H1 disk => + ∫ x, H1.value U x * H10.value diskOpen v x ∂chartMeasure c.diskMap c.d) + (c.pullDatum_comp_toH1 hb hs hw) + change inner ℝ (SubcriticalExtension.observe _ _ _) (SubcriticalExtension.observe _ _ v.val) = _ + apply (observe_inner c.densityBound_ne_top (c.density_bound hμ) + (c.pullDatum_H1 hb hs hw).toH1 v.val).trans + have hq := congrArg (fun ν : Measure Plane => ∫ x, + H1.value (c.pullDatum_H1 hb hs hw).toH1 x * H10.value diskOpen v x ∂ν) + c.potential_diskMap + exact hq.symm.trans ((potentialMeasure_integral c.diskMap c.d hμ _).trans + (congrArg (fun t : ℝ => firstPositiveNeumannValue Ω*t) (hh.trans hr).symm)) + +lemma smooth_pull_weak (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) + (hμ : 0 ≤ firstPositiveNeumannValue Ω) + (hp : ∀ x ∈ Ω, Δ w x = -firstPositiveNeumannValue Ω*w x) : + SubcriticalExtension.WeakPotential diskOpen c.densityBound_ne_top (c.density_bound hμ) + (c.pullDatum_H1 hb hs hw).toH1 := by + intro v + have hW := smooth_closure_H1 c.diskMap.open_target hb hs hw + have hh := transportH10_mixed_grad c.diskMap c.diskMap_inverse_smooth c.d c.diskMap_deriv hb + ((hw.mono subset_closure).differentiableOn (by simp)) hW (c.pullDatum_comp_H1 hb hs hw) v + have hr := congrArg (fun U : H1 disk => inner ℝ (H1.grad U) (H10.grad diskOpen v)) + (c.pullDatum_comp_toH1 hb hs hw) + have he := H10.helmholtz_pair c.diskMap.open_target (hw.mono subset_closure) hW.1 hW.2.1 hp + (transportH10 c.diskMap c.diskMap_inverse_smooth v) + exact (hh.trans hr).symm.trans (he.trans (c.smooth_mixed_mass hb hs hw hμ v).symm) + + + +theorem smooth_K_representation (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) + (hne : Ω.Nonempty) (hμ : 0 < firstPositiveNeumannValue Ω) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) + (hp : ∀ x ∈ Ω, Δ w x = -firstPositiveNeumannValue Ω*w x) (x : disk) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hb + w (c.F x) = ∫ s, fullBoundaryK c.densityBound_ne_top (c.density_bound hμ.le) x s * + w (c.F s) ∂boundaryMeasure := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hb + obtain ⟨δ,hδ,hδ1,hsub⟩ := c.subcritical hb hne hμ + obtain ⟨B,hB⟩ := c.datumTrace_lipschitz hb hs hw + exact value_K_of_trace c.densityBound_ne_top (c.density_bound hμ.le) hδ.le hδ1 hsub + (c.datumTrace w hw.continuousOn) hB (c.pullDatum_smooth (hw.mono subset_closure)) + (c.pullDatum_continuous hw.continuousOn) (c.pullDatum_H1 hb hs hw) (fun _ => rfl) + (c.smooth_pull_weak hb hs hw hμ.le hp) x + +end ClosedDiskChart +end StrictHotSpots.Conformal +end +end ActualScalarPull + +section OriginalGradientKernel + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff Topology InnerProductSpace Laplacian +namespace StrictHotSpots +lemma laplacian_continuousOn {Ω : Set Plane} {f : Plane → ℝ} + (hΩ : IsOpen Ω) (hf : ContDiffOn ℝ ∞ f Ω) : ContinuousOn (Δ f) Ω := by + have hh : ContinuousOn (fun x => ∑ i : Fin 2, + directionalDerivative (directionalDerivative f (planeBasis i)) (planeBasis i) x) Ω := + continuousOn_finsetSum _ fun i _ => + (directionalDerivative_contDiffOn hΩ + (directionalDerivative_contDiffOn hΩ hf (planeBasis i)) (planeBasis i)).continuousOn + exact hh.congr fun x hx => (laplacian_eq_sum_directional hΩ hf hx) + + + +lemma eigenfunction_helmholtz {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : IsOpen Ω) (hu : InFirstNeumannEigenspace Ω u) {x : Plane} (hx : x ∈ Ω) : + (Δ u) x + firstPositiveNeumannValue Ω * u x = 0 := by + have hsu : ContDiffOn ℝ ∞ u Ω := hu.1.mono subset_closure + have hcont : ContinuousOn (fun y => (Δ u) y + firstPositiveNeumannValue Ω * u y) Ω := + (laplacian_continuousOn hΩ hsu).add (hsu.continuousOn.const_mul _) + have hae := hΩ.ae_eq_zero_of_integral_contDiff_smul_eq_zero + (hcont.locallyIntegrableOn hΩ.measurableSet (μ := volume)) ?_ + · have hre : (fun y => (Δ u) y + firstPositiveNeumannValue Ω * u y) =ᵐ[volume.restrict Ω] + (fun _ => 0) := (ae_restrict_iff' hΩ.measurableSet).mpr hae + exact (Measure.eqOn_open_of_ae_eq hre hΩ hcont continuousOn_const) hx + intro φ hφ hc hs + have htest := HasH1Gradient.test hΩ hφ hc + have heq := hu.2.2.2 φ (gradient φ) htest + rw [integral_inner_gradient_test hΩ hsu hφ hc hs] at heq + have h1 : IntegrableOn (fun y => (Δ u) y * φ y) Ω := + (integrable_mul_test hΩ (laplacian_continuousOn hΩ hsu) hφ.continuous hc hs).integrableOn + have h2 : IntegrableOn (fun y => u y * φ y) Ω := + (integrable_mul_test hΩ hsu.continuousOn hφ.continuous hc hs).integrableOn + have heq0 : (∫ y in Ω, ((Δ u) y + firstPositiveNeumannValue Ω * u y) * φ y) = 0 := by + simp only [add_mul, mul_assoc] + rw [integral_add h1 (h2.const_mul _), integral_const_mul] + linarith + rw [setIntegral_mul_test hs] at heq0 + simpa only [smul_eq_mul, mul_comm] using heq0 + + +lemma directionalDerivative_commute {Ω : Set Plane} {f : Plane → ℝ} + (hΩ : IsOpen Ω) (hf : ContDiffOn ℝ ∞ f Ω) {x : Plane} (hx : x ∈ Ω) + (e d : Plane) : directionalDerivative (directionalDerivative f e) d x = + directionalDerivative (directionalDerivative f d) e x := by + have hh := (hf x hx).contDiffAt (hΩ.mem_nhds hx) + have hd : DifferentiableAt ℝ (fderiv ℝ f) x := + ((hf.fderiv_of_isOpen hΩ (by simp : (∞ : ℕ∞ω) + 1 ≤ ∞) x hx).contDiffAt + (hΩ.mem_nhds hx)).differentiableAt (by simp) + change (fderiv ℝ (fun y => (fderiv ℝ f y) e) x) d = + (fderiv ℝ (fun y => (fderiv ℝ f y) d) x) e + rw [fderiv_clm_apply hd (differentiableAt_const _), + fderiv_clm_apply hd (differentiableAt_const _)] + simpa using hh.isSymmSndFDerivAt (by rw [minSmoothness_of_isRCLikeNormedField]; decide) d e + +lemma directionalDerivative_congr {Ω : Set Plane} (hΩ : IsOpen Ω) + {f g : Plane → ℝ} (heq : EqOn f g Ω) {x : Plane} (hx : x ∈ Ω) (e : Plane) : + directionalDerivative f e x = directionalDerivative g e x := by + have hh : f =ᶠ[nhds x] g := Filter.eventually_of_mem (hΩ.mem_nhds hx) heq + exact congrArg (fun L : Plane →L[ℝ] ℝ => L e) hh.fderiv_eq + +lemma laplacian_directionalDerivative {Ω : Set Plane} {f : Plane → ℝ} + (hΩ : IsOpen Ω) (hf : ContDiffOn ℝ ∞ f Ω) {x : Plane} (hx : x ∈ Ω) (e : Plane) : + (Δ (directionalDerivative f e)) x = directionalDerivative (Δ f) e x := by + have D (d : Plane) := directionalDerivative_contDiffOn hΩ hf d + have DD (d c : Plane) := directionalDerivative_contDiffOn hΩ (D d) c + rw [laplacian_eq_sum_directional hΩ (D e) hx] + have hs : EqOn (Δ f) (fun y => ∑ i : Fin 2, + directionalDerivative (directionalDerivative f (planeBasis i)) (planeBasis i) y) Ω := + fun y hy => laplacian_eq_sum_directional hΩ hf hy + rw [directionalDerivative_congr hΩ hs hx e] + have heq (i : Fin 2) : + directionalDerivative (directionalDerivative (directionalDerivative f e) (planeBasis i)) + (planeBasis i) x = + directionalDerivative (directionalDerivative (directionalDerivative f (planeBasis i)) + (planeBasis i)) e x := by + rw [directionalDerivative_congr hΩ + (fun y hy => directionalDerivative_commute hΩ hf hy e (planeBasis i)) hx] + exact directionalDerivative_commute hΩ (D (planeBasis i)) hx e (planeBasis i) + simp_rw [heq] + unfold directionalDerivative + rw [fderiv_fun_sum] + · simp + · intro i _ + exact ((DD (planeBasis i) (planeBasis i) x hx).contDiffAt + (hΩ.mem_nhds hx)).differentiableAt (by simp) + + + +lemma eigenfunction_derivative_helmholtz {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : IsOpen Ω) (hu : InFirstNeumannEigenspace Ω u) {x : Plane} (hx : x ∈ Ω) + (e : Plane) : (Δ (directionalDerivative u e)) x + + firstPositiveNeumannValue Ω * directionalDerivative u e x = 0 := by + have hf : ContDiffOn ℝ ∞ u Ω := hu.1.mono subset_closure + have hs : EqOn (Δ u) (fun y => -(firstPositiveNeumannValue Ω) * u y) Ω := by + intro y hy + linear_combination eigenfunction_helmholtz hΩ hu hy + rw [laplacian_directionalDerivative hΩ hf hx, + directionalDerivative_congr hΩ hs hx e] + have hd := ((hf x hx).contDiffAt (hΩ.mem_nhds hx)).differentiableAt (by simp) + simp only [directionalDerivative, fderiv_const_mul hd, + smul_apply, smul_eq_mul] + ring + +end StrictHotSpots +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace Laplacian Topology +namespace StrictHotSpots +lemma closed_directional_eq {Ω : Set Plane} {u : Plane → ℝ} + (ho : IsOpen Ω) {x : Plane} (hx : x ∈ Ω) (e : Plane) : + fderivWithin ℝ u (closure Ω) x e = directionalDerivative u e x := by + rw [fderivWithin_of_mem_nhds (mem_of_superset (ho.mem_nhds hx) subset_closure)] + rfl + +namespace Conformal.ClosedDiskChart +open DiskH10 PlaneGreen +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) + + + +theorem gradient_K_representation (hΩ : AdmissibleDomain Ω) + {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) + (hne : ∃ x ∈ Ω, u x ≠ 0) (x : disk) (e : Plane) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + inner ℝ (gradient u (c.F x)) e = + ∫ s, fullBoundaryK c.densityBound_ne_top + (c.density_bound (firstPositiveNeumannValue_pos_of_eigenfunction hΩ hu hne).le) x s * + inner ℝ (closedGradient Ω u (c.F s)) e ∂boundaryMeasure := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hΩ.2.2.1 + have hh := c.smooth_K_representation hΩ.2.2.1 hΩ.2.2.2.2 hΩ.1 + (firstPositiveNeumannValue_pos_of_eigenfunction hΩ hu hne) + (closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 e) ?_ x + · have hx : c.F x ∈ Ω := by rw [← c.diskMap_agrees x.property]; exact c.diskMap.map_source x.property + rw [closed_directional_eq hΩ.2.1 hx e] at hh + simpa only [gradient,closedGradient,InnerProductSpace.toDual_symm_apply, + directionalDerivative] using hh + intro y hy + have heq : (fun z => fderivWithin ℝ u (closure Ω) z e) =ᶠ[nhds y] + directionalDerivative u e := + Filter.eventually_of_mem (hΩ.2.1.mem_nhds hy) + (fun _ hz => closed_directional_eq hΩ.2.1 hz e) + rw [(InnerProductSpace.laplacian_congr_nhds heq).eq_of_nhds, + closed_directional_eq hΩ.2.1 hy e] + linear_combination eigenfunction_derivative_helmholtz hΩ.2.1 hu hy e + +end Conformal.ClosedDiskChart +end StrictHotSpots +end +end +end OriginalGradientKernel + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Reciprocal.lean b/lean/OAI/Analysis/HotSpots/Reciprocal.lean new file mode 100644 index 0000000000000000000000000000000000000000..81dc5c2fd92f4d6fe6ca192a95ae1542addff04f --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Reciprocal.lean @@ -0,0 +1,2151 @@ +import OAI.Analysis.HotSpots.Basic + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section FullBoundaryCombinedLayer + +section SingularLayer + + + +namespace ReciprocalKernel + +open Matrix Filter Topology +open scoped BigOperators + +variable {ι : Type*} [Fintype ι] + + +def pairing (A : Matrix ι ι ℝ) (x y : ι → ℝ) : ℝ := x ⬝ᵥ A *ᵥ y + +lemma pairing_symm {A : Matrix ι ι ℝ} (hA : A.IsSymm) (x y : ι → ℝ) : + pairing A x y = pairing A y x := by + simpa only [pairing, hA.eq] using Matrix.dotProduct_transpose_mulVec A x y + +lemma pairing_sub_smul (A : Matrix ι ι ℝ) (x y : ι → ℝ) (t : ℝ) : + pairing A (y - t • x) (y - t • x) = + pairing A y y - t * pairing A y x - t * pairing A x y + t ^ 2 * pairing A x x := by + simp only [pairing, Matrix.mulVec_sub, Matrix.mulVec_smul, sub_dotProduct, + dotProduct_sub, dotProduct_smul, smul_dotProduct, smul_eq_mul] + ring + +lemma pairing_sub_smul_right (A : Matrix ι ι ℝ) (x y z : ι → ℝ) (t : ℝ) : + pairing A x (y - t • z) = pairing A x y - t * pairing A x z := by + simp only [pairing, Matrix.mulVec_sub, Matrix.mulVec_smul, dotProduct_sub, + dotProduct_smul, smul_eq_mul] + +lemma pairing_add_smul_right (A : Matrix ι ι ℝ) (x y z : ι → ℝ) (t : ℝ) : + pairing A x (y + t • z) = pairing A x y + t * pairing A x z := by + simp only [pairing, Matrix.mulVec_add, Matrix.mulVec_smul, dotProduct_add, + dotProduct_smul, smul_eq_mul] + +lemma pairing_add_smul (A : Matrix ι ι ℝ) (x y : ι → ℝ) (t : ℝ) : + pairing A (y + t • x) (y + t • x) = + pairing A y y + t * pairing A y x + t * pairing A x y + t ^ 2 * pairing A x x := by + simp only [pairing, Matrix.mulVec_add, Matrix.mulVec_smul, add_dotProduct, + dotProduct_add, dotProduct_smul, smul_dotProduct, smul_eq_mul] + ring + +lemma pairing_tendsto {A : ℕ → Matrix ι ι ℝ} {B : Matrix ι ι ℝ} + (hlim : ∀ i j, Tendsto (fun n => A n i j) atTop (𝓝 (B i j))) (x y : ι → ℝ) : + Tendsto (fun n => pairing (A n) x y) atTop (𝓝 (pairing B x y)) := by + unfold pairing dotProduct Matrix.mulVec + exact tendsto_finsetSum _ (fun i _ => tendsto_const_nhds.mul + (tendsto_finsetSum _ fun j _ => (hlim i j).mul tendsto_const_nhds)) + + + +def OnePositiveSquare (A : Matrix ι ι ℝ) : Prop := + A.IsSymm ∧ ∀ x y : ι → ℝ, 0 < pairing A x x → pairing A x y = 0 → pairing A y y ≤ 0 + + +lemma onePositiveSquare_reverse_cauchy {A : Matrix ι ι ℝ} (hA : OnePositiveSquare A) + (x y : ι → ℝ) (hx : 0 < pairing A x x) : + pairing A x x * pairing A y y ≤ (pairing A x y) ^ 2 := by + have hz : pairing A x (y - (pairing A x y / pairing A x x) • x) = 0 := by + rw [pairing_sub_smul_right] + field_simp + ring + have hn := hA.2 x _ hx hz + rw [pairing_sub_smul, pairing_symm hA.1 y x] at hn + have he : pairing A y y - (pairing A x y / pairing A x x) * pairing A x y - + (pairing A x y / pairing A x x) * pairing A x y + + (pairing A x y / pairing A x x) ^ 2 * pairing A x x = + pairing A y y - (pairing A x y) ^ 2 / pairing A x x := by + field_simp + ring + rw [he] at hn + have := (le_div_iff₀ hx).mp (sub_nonpos.mp hn) + nlinarith + +lemma onePositiveSquare_of_entrywise_tendsto {A : ℕ → Matrix ι ι ℝ} + {B : Matrix ι ι ℝ} (hA : ∀ n, OnePositiveSquare (A n)) + (hlim : ∀ i j, Tendsto (fun n => A n i j) atTop (𝓝 (B i j))) : + OnePositiveSquare B := by + refine ⟨?_, ?_⟩ + · ext i j + exact tendsto_nhds_unique (hlim j i) + ((hlim i j).congr fun n => (hA n).1.apply i j |>.symm) + · intro x y hx hxy + have hxx := pairing_tendsto hlim x x + have hyy := pairing_tendsto hlim y y + have hxy' := pairing_tendsto hlim x y + have hp : ∀ᶠ n in atTop, 0 < pairing (A n) x x := + hxx.eventually_const_lt hx + have hn : pairing B x x * pairing B y y - (pairing B x y) ^ 2 ≤ 0 := by + apply le_of_tendsto ((hxx.mul hyy).sub (hxy'.pow 2)) + filter_upwards [hp] with n hn + exact sub_nonpos.mpr (onePositiveSquare_reverse_cauchy (hA n) x y hn) + rw [hxy] at hn + nlinarith + + + +lemma onePositiveSquare_isotropic_hyperplane {A : Matrix ι ι ℝ} + (hA : OnePositiveSquare A) (z : ι → ℝ) (hz : pairing A z z = 0) + (hnonradical : ∃ y, pairing A z y ≠ 0) : + ∀ x, pairing A z x = 0 → pairing A x x ≤ 0 := by + intro x hzx + by_contra hx + have hx : 0 < pairing A x x := lt_of_not_ge hx + obtain ⟨y, hy⟩ := hnonradical + have hxz : pairing A x z = 0 := (pairing_symm hA.1 x z).trans hzx + let t := ((pairing A x y) ^ 2 / pairing A x x - pairing A y y + 1) / + (2 * pairing A z y) + have hn := onePositiveSquare_reverse_cauchy hA x (y + t • z) hx + rw [pairing_add_smul, pairing_add_smul_right, hz, hxz, + pairing_symm hA.1 y z] at hn + dsimp [t] at hn + have he : pairing A y y + + (((pairing A x y) ^ 2 / pairing A x x - pairing A y y + 1) / + (2 * pairing A z y)) * pairing A z y + + (((pairing A x y) ^ 2 / pairing A x x - pairing A y y + 1) / + (2 * pairing A z y)) * pairing A z y = + (pairing A x y) ^ 2 / pairing A x x + 1 := by + field_simp + ring + simp only [mul_zero, add_zero] at hn + rw [he] at hn + have he' : pairing A x x * ((pairing A x y) ^ 2 / pairing A x x + 1) = + (pairing A x y) ^ 2 + pairing A x x := by + field_simp + rw [he'] at hn + linarith + +lemma onePositiveSquare_of_nonpos_on_kernel {A : Matrix ι ι ℝ} + (hA : A.IsSymm) (l : ι → ℝ) + (h : ∀ x : ι → ℝ, l ⬝ᵥ x = 0 → pairing A x x ≤ 0) : + OnePositiveSquare A := by + refine ⟨hA, ?_⟩ + intro x y hx hxy + have hlx : l ⬝ᵥ x ≠ 0 := by + intro he + exact (not_le_of_gt hx) (h x he) + have hyx : pairing A y x = 0 := (pairing_symm hA y x).trans hxy + have hz : l ⬝ᵥ (y - ((l ⬝ᵥ y) / (l ⬝ᵥ x)) • x) = 0 := by + simp only [dotProduct_sub, dotProduct_smul, smul_eq_mul] + field_simp + ring + have hh := h _ hz + rw [pairing_sub_smul, hxy, hyx] at hh + nlinarith [sq_nonneg ((l ⬝ᵥ y) / (l ⬝ᵥ x))] + +lemma onePositiveSquare_rankOne_sub_psd (l : ι → ℝ) {U : Matrix ι ι ℝ} + (hU : U.PosSemidef) : + OnePositiveSquare (Matrix.vecMulVec l l - U) := by + apply onePositiveSquare_of_nonpos_on_kernel (l := l) + · apply Matrix.isHermitian_iff_isSymm.mp + exact (Matrix.posSemidef_vecMulVec_self_star l |>.isHermitian).sub hU.isHermitian + · intro x hx + have hnon := hU.dotProduct_mulVec_nonneg x + simp only [star_trivial] at hnon + simp [pairing, Matrix.sub_mulVec, Matrix.vecMulVec_mulVec, hx, hnon] + +lemma pairing_const (a : ℝ) (x y : ι → ℝ) : + pairing (Matrix.of (fun _ _ => a)) x y = a * (∑ i, x i) * (∑ j, y j) := by + simp only [pairing, Matrix.mulVec, dotProduct, Matrix.of_apply] + simp_rw [← Finset.mul_sum, ← Finset.sum_mul] + ring + +lemma pairing_scale (A : Matrix ι ι ℝ) (l x y : ι → ℝ) : + pairing (Matrix.of (fun i j => l i * A i j * l j)) x y = + pairing A (l * x) (l * y) := by + simp only [pairing, Matrix.mulVec, dotProduct, Matrix.of_apply, Pi.mul_apply, + Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + +lemma onePositiveSquare_scale {A : Matrix ι ι ℝ} (hA : OnePositiveSquare A) + (l : ι → ℝ) : + OnePositiveSquare (Matrix.of (fun i j => l i * A i j * l j)) := by + refine ⟨?_, ?_⟩ + · ext i j + simp only [Matrix.transpose_apply, Matrix.of_apply] + rw [hA.1.apply] + ring + · intro x y hx hxy + rw [pairing_scale] at hx hxy ⊢ + exact hA.2 _ _ hx hxy + +lemma onePositiveSquare_const_sub_psd (a : ℝ) {U : Matrix ι ι ℝ} + (hU : U.PosSemidef) : + OnePositiveSquare (Matrix.of (fun _ _ => a) - U) := by + apply onePositiveSquare_of_nonpos_on_kernel (l := fun _ => 1) + · ext i j + simp only [Matrix.transpose_apply, Matrix.sub_apply, Matrix.of_apply] + have hij : U j i = U i j := by simpa using hU.isHermitian.apply i j + rw [hij] + · intro x hx + have hsum : ∑ i, x i = 0 := by simpa [dotProduct] using hx + have hn := hU.dotProduct_mulVec_nonneg x + simp only [star_trivial] at hn + change pairing (Matrix.of (fun _ _ => a) - U) x x ≤ 0 + change x ⬝ᵥ (Matrix.of (fun _ _ => a) - U) *ᵥ x ≤ 0 + rw [Matrix.sub_mulVec, dotProduct_sub] + change pairing (Matrix.of (fun _ _ => a)) x x - pairing U x x ≤ 0 + rw [pairing_const, hsum] + simpa only [pairing, mul_zero, zero_sub, neg_nonpos] using hn + + + +lemma normalized_complement_posSemidef {H : Matrix ι ι ℝ} + (hH : OnePositiveSquare H) (z : ι) {a : ℝ} (ha : 0 < a) + (hrow : ∀ j, H z j = a) : + (Matrix.of (fun _ _ => a) - H).PosSemidef := by + classical + have hpair (v : ι → ℝ) : pairing H (Pi.single z 1) v = a * ∑ i, v i := by + unfold pairing + rw [single_dotProduct, one_mul] + change (∑ j, H z j * v j) = a * ∑ i, v i + simp only [hrow, Finset.mul_sum] + have he : pairing H (Pi.single z 1) (Pi.single z 1) = a := by + simp [hpair] + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg + · apply Matrix.isHermitian_iff_isSymm.mpr + apply Matrix.ext + intro i j + simp only [Matrix.transpose_apply, Matrix.sub_apply, Matrix.of_apply] + rw [hH.1.apply] + · intro v + have hz : pairing H (Pi.single z 1) (v - (∑ i, v i) • Pi.single z 1) = 0 := by + rw [hpair] + simp only [Pi.sub_apply, Pi.smul_apply, smul_eq_mul, Finset.sum_sub_distrib, + ← Finset.mul_sum] + simp + have hyn := hH.2 (Pi.single z 1) _ (he ▸ ha) hz + rw [pairing_sub_smul, he, hpair, pairing_symm hH.1 v (Pi.single z 1), hpair] at hyn + have heval : star v ⬝ᵥ (Matrix.of (fun _ _ => a) - H) *ᵥ v = + a * (∑ i, v i) ^ 2 - pairing H v v := by + simp only [star_trivial, Matrix.sub_mulVec, dotProduct_sub] + change pairing (Matrix.of (fun _ _ => a)) v v - pairing H v v = _ + rw [pairing_const] + ring + rw [heval] + nlinarith + +omit [Fintype ι] in + +lemma posSemidef_entry_sq_le {U : Matrix ι ι ℝ} (hU : U.PosSemidef) (i j : ι) : + (U i j) ^ 2 ≤ U i i * U j j := by + have h := (hU.submatrix ![i, j]).det_nonneg + simp only [Matrix.det_fin_two, Matrix.submatrix_apply, Matrix.cons_val_zero, + Matrix.cons_val_one, Matrix.cons_val_fin_one] at h + have hij : U j i = U i j := by simpa using hU.isHermitian.apply i j + rw [hij] at h + nlinarith + +omit [Fintype ι] in +lemma posSemidef_abs_entry_lt {U : Matrix ι ι ℝ} (hU : U.PosSemidef) + {a : ℝ} (ha : 0 < a) (hdiag : ∀ i, U i i < a) (i j : ι) : |U i j| < a := by + have hp : U i i * U j j < a * a := calc + U i i * U j j ≤ U i i * a := + mul_le_mul_of_nonneg_left (hdiag j).le hU.diag_nonneg + _ < a * a := mul_lt_mul_of_pos_right (hdiag i) ha + have hs := posSemidef_entry_sq_le hU i j + nlinarith [sq_abs (U i j), abs_nonneg (U i j)] + + +lemma posSemidef_entry_pow {A : Matrix ι ι ℝ} (hA : A.PosSemidef) (n : ℕ) : + (Matrix.of (fun i j => A i j ^ n)).PosSemidef := by + induction n with + | zero => + simpa [Matrix.vecMulVec] using + (Matrix.posSemidef_vecMulVec_self_star (fun _ : ι => (1 : ℝ))) + | succ n ih => + have he : Matrix.of (fun i j => A i j ^ (n + 1)) = + Matrix.of (fun i j => A i j ^ n) ⊙ A := by + ext i j + simp [pow_succ] + rw [he] + exact ih.hadamard hA + + +lemma posSemidef_of_entrywise_tendsto {A : ℕ → Matrix ι ι ℝ} {B : Matrix ι ι ℝ} + (hA : ∀ n, (A n).PosSemidef) + (hlim : ∀ i j, Tendsto (fun n => A n i j) atTop (𝓝 (B i j))) : B.PosSemidef := by + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg + · apply Matrix.isHermitian_iff_isSymm.mpr + ext i j + exact tendsto_nhds_unique (hlim j i) + ((hlim i j).congr fun n => by simpa using (hA n).isHermitian.apply j i) + · intro x + have hlimq : Tendsto (fun n => star x ⬝ᵥ A n *ᵥ x) atTop + (𝓝 (star x ⬝ᵥ B *ᵥ x)) := by + unfold dotProduct Matrix.mulVec + exact tendsto_finsetSum _ (fun i _ => tendsto_const_nhds.mul + (tendsto_finsetSum _ fun j _ => (hlim i j).mul tendsto_const_nhds)) + exact ge_of_tendsto hlimq (Filter.Eventually.of_forall fun n => + (hA n).dotProduct_mulVec_nonneg x) + + +lemma posSemidef_entry_resolvent {A : Matrix ι ι ℝ} (hA : A.PosSemidef) + (hsmall : ∀ i j, |A i j| < 1) : + (Matrix.of (fun i j => A i j / (1 - A i j))).PosSemidef := by + apply posSemidef_of_entrywise_tendsto + (A := fun n => ∑ k ∈ Finset.range n, Matrix.of (fun i j => A i j ^ (k + 1))) + · intro n + exact Matrix.posSemidef_sum _ (fun k _ => posSemidef_entry_pow hA (k + 1)) + · intro i j + have hs := (hasSum_geometric_of_norm_lt_one (show ‖A i j‖ < 1 by + simpa only [Real.norm_eq_abs] using hsmall i j)).mul_left (A i j) + simpa only [Matrix.sum_apply, Matrix.of_apply, div_eq_mul_inv, pow_succ, mul_comm] + using hs.tendsto_sum_nat + + +lemma onePositiveSquare_normalized_update {H : Matrix ι ι ℝ} + (hH : OnePositiveSquare H) (hpos : ∀ i j, 0 < H i j) + (z : ι) {a : ℝ} (hrow : ∀ j, H z j = a) {c : ℝ} (hc : 0 ≤ c) : + OnePositiveSquare (Matrix.of (fun i j => H i j / (1 + c * H i j))) := by + rcases hc.eq_or_lt with hc | hc + · subst c + have he : Matrix.of (fun i j => H i j / (1 + 0 * H i j)) = H := by + ext i j + simp + rwa [he] + have ha : 0 < a := hrow z ▸ hpos z z + let U := Matrix.of (fun _ _ => a) - H + have hU : U.PosSemidef := normalized_complement_posSemidef hH z ha hrow + have hdiag : ∀ i, U i i < a := by + intro i + change a - H i i < a + exact sub_lt_self _ (hpos i i) + have hUa : ∀ i j, |U i j| < a := posSemidef_abs_entry_lt hU ha hdiag + have hd : 0 < 1 + c * a := by positivity + let r := c / (1 + c * a) + have hr : 0 < r := div_pos hc hd + let V := r • U + have hV : V.PosSemidef := hU.smul hr.le + have hra : r * a < 1 := by + dsimp [r] + rw [div_mul_eq_mul_div, div_lt_iff₀ hd] + linarith + have hsmall : ∀ i j, |V i j| < 1 := by + intro i j + change |r * U i j| < 1 + rw [abs_mul, abs_of_pos hr] + exact (mul_lt_mul_of_pos_left (hUa i j) hr).trans hra + have hW := (posSemidef_entry_resolvent hV hsmall).smul + (show 0 ≤ (1 / (c * (1 + c * a)) : ℝ) by positivity) + have hP := onePositiveSquare_const_sub_psd (a / (1 + c * a)) hW + have he : Matrix.of (fun i j => H i j / (1 + c * H i j)) = + Matrix.of (fun _ _ => a / (1 + c * a)) - + (1 / (c * (1 + c * a))) • Matrix.of (fun i j => V i j / (1 - V i j)) := by + ext i j + have hij := hpos i j + have hden : 0 < 1 + c * H i j := by positivity + have hone : 1 - V i j ≠ 0 := ne_of_gt (sub_pos.mpr (abs_lt.mp (hsmall i j)).2) + simp only [Matrix.of_apply, Matrix.sub_apply, Matrix.smul_apply, smul_eq_mul] + dsimp [V, U, r] at hone ⊢ + field_simp [ne_of_gt hden, ne_of_gt hd, ne_of_gt hc] + ring_nf + field_simp [show 1 + H i j * c ≠ 0 by nlinarith [hden]] + ring + rw [he] + exact hP + + + +theorem reciprocal_rankOne_update {M : Matrix ι ι ℝ} (hM : M.IsSymm) + (hpos : ∀ i j, 0 < M i j) + (hrec : OnePositiveSquare (Matrix.of (fun i j => (M i j)⁻¹))) + (z : ι) {c : ℝ} (hc : 0 ≤ c) : + OnePositiveSquare (Matrix.of (fun i j => (M i j + c * M i z * M z j)⁻¹)) := by + let H := Matrix.of (fun i j => M i z * (M i j)⁻¹ * M j z) + have hH : OnePositiveSquare H := onePositiveSquare_scale hrec (fun i => M i z) + have hHp : ∀ i j, 0 < H i j := by + intro i j + change 0 < M i z * (M i j)⁻¹ * M j z + exact mul_pos (mul_pos (hpos i z) (inv_pos.mpr (hpos i j))) (hpos j z) + have hrow : ∀ j, H z j = M z z := by + intro j + change M z z * (M z j)⁻¹ * M j z = M z z + rw [hM.apply j z] + field_simp [ne_of_gt (hpos j z)] + have hnew := onePositiveSquare_normalized_update hH hHp z hrow hc + have hscaled := onePositiveSquare_scale hnew (fun i => (M i z)⁻¹) + have he : Matrix.of (fun i j => (M i j + c * M i z * M z j)⁻¹) = + Matrix.of (fun i j => (M i z)⁻¹ * (H i j / (1 + c * H i j)) * (M j z)⁻¹) := by + ext i j + have hij := hpos i j + have hiz := hpos i z + have hjz := hpos j z + have hn : 0 < M i j + c * M i z * M j z := by positivity + simp only [Matrix.of_apply] + dsimp [H] + rw [hM.apply z j] + have hzj := hpos z j + have hn' : 0 < M i j + c * M i z * M z j := by positivity + field_simp [ne_of_gt hzj, ne_of_gt hn'] + rw [he] + exact hscaled + + +def bordered (B : Matrix ι ι ℝ) (l : ι → ℝ) : Matrix (ι ⊕ Unit) (ι ⊕ Unit) ℝ := + Matrix.fromBlocks B (Matrix.of (fun i _ => l i)) (Matrix.of (fun _ j => l j)) 0 + +lemma pairing_bordered (B : Matrix ι ι ℝ) (l x y : ι → ℝ) (a b : ℝ) : + pairing (bordered B l) (Sum.elim x (fun _ => a)) (Sum.elim y (fun _ => b)) = + pairing B x y + b * (l ⬝ᵥ x) + a * (l ⬝ᵥ y) := by + simp only [pairing, bordered, Matrix.mulVec, dotProduct, Fintype.sum_sum_type, + Matrix.fromBlocks_apply₁₁, Matrix.fromBlocks_apply₁₂, Matrix.fromBlocks_apply₂₁, + Matrix.fromBlocks_apply₂₂, Matrix.of_apply, Matrix.zero_apply, + Sum.elim_inl, Sum.elim_inr, Fintype.sum_unique, zero_mul, + mul_add, Finset.sum_add_distrib] + ring_nf + congr 1 + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + ring + +lemma bordered_nonpos_on_kernel {B : Matrix ι ι ℝ} {l : ι → ℝ} + (hB : OnePositiveSquare (bordered B l)) (hl : l ≠ 0) : + ∀ x, l ⬝ᵥ x = 0 → pairing B x x ≤ 0 := by + classical + have hz : pairing (bordered B l) (Sum.elim 0 (fun _ => 1)) + (Sum.elim 0 (fun _ => 1)) = 0 := by + rw [pairing_bordered] + simp [pairing] + have hrad : ∃ y, pairing (bordered B l) (Sum.elim 0 (fun _ => 1)) y ≠ 0 := by + obtain ⟨i, hi⟩ := Function.ne_iff.mp hl + refine ⟨Sum.elim (Pi.single i 1) (fun _ => 0), ?_⟩ + rw [pairing_bordered] + simpa [pairing] using hi + have hn := onePositiveSquare_isotropic_hyperplane hB _ hz hrad + intro x hx + have horth : pairing (bordered B l) (Sum.elim 0 (fun _ => 1)) + (Sum.elim x (fun _ => 0)) = 0 := by + rw [pairing_bordered] + simp [pairing, hx] + have hh := hn _ horth + simpa [pairing_bordered] using hh + + +def ConditionallyNegative (D : Matrix ι ι ℝ) : Prop := + D.IsSymm ∧ ∀ x : ι → ℝ, (∑ i, x i) = 0 → pairing D x x ≤ 0 + + +theorem conditionalNegative_scaled_of_bordered {B : Matrix ι ι ℝ} (k : ι → ℝ) + (hk : ∀ i, k i ≠ 0) + (hB : OnePositiveSquare (bordered B (fun i => (k i)⁻¹))) : + ConditionallyNegative (Matrix.of (fun i j => k i * B i j * k j)) := by + have hsym : B.IsSymm := by + ext i j + exact hB.1.apply (Sum.inl i) (Sum.inl j) + refine ⟨?_, ?_⟩ + · ext i j + simp only [Matrix.transpose_apply, Matrix.of_apply] + rw [hsym.apply] + ring + · intro x hx + rw [pairing_scale] + by_cases hi : IsEmpty ι + · simp [pairing, dotProduct] + · have : Nonempty ι := not_isEmpty_iff.mp hi + have hl : (fun i => (k i)⁻¹) ≠ 0 := by + intro he + obtain ⟨i⟩ := ‹Nonempty ι› + have := congrFun he i + exact (inv_ne_zero (hk i)) this + apply bordered_nonpos_on_kernel hB hl + simpa [dotProduct, hk] using hx + +end ReciprocalKernel + +namespace ReciprocalKernel +open Matrix +open scoped BigOperators +variable {ι : Type*} [Fintype ι] [DecidableEq ι] + + +def eliminate (M : Matrix ι ι ℝ) (w : ι → ℝ) (z : ι) : Matrix ι ι ℝ := + Matrix.of fun i j => M i j + (w z / (1 - w z * M z z)) * M i z * M z j + +omit [Fintype ι] [DecidableEq ι] in +lemma eliminate_denominator_pos {M : Matrix ι ι ℝ} {w f : ι → ℝ} + (hM : ∀ i j, 0 < M i j) (hw : ∀ i, 0 ≤ w i) (hf : ∀ i, 0 < f i) + {S : Finset ι} {z : ι} (hz : z ∈ S) + (hb : ∀ i, ∑ j ∈ S, M i j * w j * f j < f i) : + 0 < 1 - w z * M z z := by + have hs : M z z * w z * f z ≤ ∑ j ∈ S, M z j * w j * f j := + Finset.single_le_sum (f := fun j => M z j * w j * f j) + (fun i hi => mul_nonneg (mul_nonneg (hM z i).le (hw i)) (hf i).le) hz + have hh := lt_of_le_of_lt hs (hb z) + nlinarith [hf z] + +omit [Fintype ι] [DecidableEq ι] in +lemma eliminate_symm {M : Matrix ι ι ℝ} (hM : M.IsSymm) (w : ι → ℝ) (z : ι) : + (eliminate M w z).IsSymm := by + ext i j + simp only [eliminate, Matrix.transpose_apply, Matrix.of_apply] + rw [hM.apply j i, hM.apply j z, hM.apply z i] + ring + +omit [Fintype ι] [DecidableEq ι] in +lemma eliminate_pos {M : Matrix ι ι ℝ} {w : ι → ℝ} {z : ι} + (hM : ∀ i j, 0 < M i j) (hw : 0 ≤ w z) (hz : 0 < 1 - w z * M z z) : + ∀ i j, 0 < eliminate M w z i j := by + intro i j + dsimp [eliminate] + exact add_pos_of_pos_of_nonneg (hM i j) + (mul_nonneg (mul_nonneg (div_nonneg hw hz.le) (hM i z).le) (hM z j).le) + +omit [Fintype ι] in +lemma eliminate_bound {M : Matrix ι ι ℝ} {w f : ι → ℝ} + (hM : ∀ i j, 0 < M i j) (hw : ∀ i, 0 ≤ w i) (hf : ∀ i, 0 < f i) + {S : Finset ι} {z : ι} (hz : z ∉ S) + (hb : ∀ i, ∑ j ∈ insert z S, M i j * w j * f j < f i) : + ∀ i, ∑ j ∈ S, eliminate M w z i j * w j * f j < f i := by + have hd := eliminate_denominator_pos hM hw hf (Finset.mem_insert_self z S) hb + have hc : 0 ≤ w z / (1 - w z * M z z) := div_nonneg (hw z) hd.le + have hb' : ∀ i, M i z * w z * f z + ∑ j ∈ S, M i j * w j * f j < f i := by + simpa only [Finset.sum_insert hz] using hb + intro i + have he : (∑ j ∈ S, eliminate M w z i j * w j * f j) = + (∑ j ∈ S, M i j * w j * f j) + + (w z / (1 - w z * M z z)) * M i z * (∑ j ∈ S, M z j * w j * f j) := by + simp only [eliminate, Matrix.of_apply, add_mul, Finset.sum_add_distrib, + Finset.mul_sum] + congr 1 + apply Finset.sum_congr rfl + intro j hj + ring + rw [he] + have hz' : ∑ j ∈ S, M z j * w j * f j ≤ (1 - w z * M z z) * f z := by + linarith [hb' z] + have hmul := mul_le_mul_of_nonneg_left hz' (mul_nonneg hc (hM i z).le) + have he' : w z / (1 - w z * M z z) * M i z * ((1 - w z * M z z) * f z) = + M i z * w z * f z := by field_simp + rw [he'] at hmul + linarith [hb' i] + +omit [DecidableEq ι] in +lemma eliminate_reciprocal {M : Matrix ι ι ℝ} {w : ι → ℝ} {z : ι} + (hM : M.IsSymm) (hp : ∀ i j, 0 < M i j) + (hP : OnePositiveSquare (Matrix.of fun i j => (M i j)⁻¹)) + (hw : 0 ≤ w z) (hd : 0 < 1 - w z * M z z) : + OnePositiveSquare (Matrix.of fun i j => (eliminate M w z i j)⁻¹) := + reciprocal_rankOne_update hM hp hP z (div_nonneg hw hd.le) + + + + +theorem finite_resolvent_of_superharmonic {M : Matrix ι ι ℝ} {w f : ι → ℝ} + (hM : M.IsSymm) (hp : ∀ i j, 0 < M i j) + (hP : OnePositiveSquare (Matrix.of fun i j => (M i j)⁻¹)) + (hw : ∀ i, 0 ≤ w i) (hf : ∀ i, 0 < f i) + (S : Finset ι) (hb : ∀ i, ∑ j ∈ S, M i j * w j * f j < f i) : + ∃ R : Matrix ι ι ℝ, R.IsSymm ∧ (∀ i j, 0 < R i j) ∧ + OnePositiveSquare (Matrix.of fun i j => (R i j)⁻¹) ∧ + ∀ i j, R i j = M i j + ∑ k ∈ S, M i k * w k * R k j := by + induction S using Finset.induction_on generalizing M with + | empty => exact ⟨M, hM, hp, hP, by simp⟩ + | @insert z S hz ih => + have hd := eliminate_denominator_pos hp hw hf (Finset.mem_insert_self z S) hb + obtain ⟨R, hRs, hRp, hRP, hReq⟩ := ih (eliminate_symm hM w z) + (eliminate_pos hp (hw z) hd) (eliminate_reciprocal hM hp hP (hw z) hd) + (eliminate_bound hp hw hf hz hb) + refine ⟨R, hRs, hRp, hRP, ?_⟩ + have heq (i j) : R i j = M i j + (∑ k ∈ S, M i k * w k * R k j) + + (w z / (1 - w z * M z z)) * M i z * + (M z j + ∑ k ∈ S, M z k * w k * R k j) := by + rw [hReq i j] + simp only [eliminate, Matrix.of_apply, add_mul, Finset.sum_add_distrib, + Finset.mul_sum, mul_add] + ring_nf + have hez (j) : (1 - w z * M z z) * R z j = + M z j + ∑ k ∈ S, M z k * w k * R k j := by + have hh := heq z j + field_simp at hh + nlinarith + intro i j + rw [Finset.sum_insert hz, heq i j, ← hez j] + field_simp + ring + + +open scoped Matrix.Norms.L2Operator + +lemma matrix_geometric_nonneg {T : Matrix ι ι ℝ} + (hT : ∀ i j, 0 ≤ T i j) (hn : ‖T‖ < 1) : + ∀ i j, 0 ≤ (∑' n : ℕ, T ^ n) i j := by + intro i j + have hs := summable_geometric_of_norm_lt_one hn + have ht := ((continuous_id.matrix_elem i j).tendsto (∑' n : ℕ, T ^ n)).comp hs.hasSum + apply ge_of_tendsto ht + filter_upwards [] with S + change 0 ≤ (∑ n ∈ S, T ^ n) i j + rw [Matrix.sum_apply] + exact Finset.sum_nonneg fun n _ => Matrix.pow_apply_nonneg hT n i j + + + +lemma exists_superharmonic_of_weighted_norm_lt_one {M : Matrix ι ι ℝ} {w : ι → ℝ} + (hM : ∀ i j, 0 ≤ M i j) (hw : ∀ i, 0 ≤ w i) + (hn : ‖Matrix.diagonal (fun i => Real.sqrt (w i)) * M * + Matrix.diagonal (fun i => Real.sqrt (w i))‖ < 1) : + ∃ f : ι → ℝ, (∀ i, 0 < f i) ∧ + ∀ i, ∑ j, M i j * w j * f j < f i := by + let D : Matrix ι ι ℝ := Matrix.diagonal (fun i => Real.sqrt (w i)) + let N : Matrix ι ι ℝ := M * D + let T : Matrix ι ι ℝ := D * N + let B : Matrix ι ι ℝ := ∑' n : ℕ, T ^ n + let Q : Matrix ι ι ℝ := N * B * D + have hnorm : ‖T‖ < 1 := by simpa only [T, N, Matrix.mul_assoc] using hn + have hT : ∀ i j, 0 ≤ T i j := by + intro i j + simp only [T, N, D, Matrix.diagonal_mul, Matrix.mul_diagonal] + exact mul_nonneg (Real.sqrt_nonneg _) + (mul_nonneg (hM i j) (Real.sqrt_nonneg _)) + have hB := matrix_geometric_nonneg hT hnorm + have hQ : ∀ i j, 0 ≤ Q i j := by + intro i j + simp only [Q, D, Matrix.mul_diagonal] + rw [Matrix.mul_apply] + simp only [N, D, Matrix.mul_diagonal] + apply mul_nonneg _ (Real.sqrt_nonneg _) + apply Finset.sum_nonneg + intro k hk + exact mul_nonneg (mul_nonneg (hM i k) (Real.sqrt_nonneg _)) (hB k j) + have hB' : (1 : Matrix ι ι ℝ) + T * B = B := by + have hh := mul_neg_geom_series T hnorm + change (1 - T) * B = 1 at hh + rw [sub_mul, one_mul] at hh + exact (sub_eq_iff_eq_add.mp hh).symm + have hD : D * D = Matrix.diagonal w := by + dsimp [D] + rw [Matrix.diagonal_mul_diagonal] + congr 1 + funext i + exact Real.mul_self_sqrt (hw i) + have hA : (M * Matrix.diagonal w) * (1 + Q) = Q := by + rw [← hD] + change (M * (D * D)) * (1 + N * B * D) = N * B * D + calc + _ = N * (1 + T * B) * D := by dsimp [N, T]; noncomm_ring + _ = _ := by rw [hB'] + let f : ι → ℝ := (1 + Q) *ᵥ (fun _ => 1) + have hf (i) : f i = 1 + ∑ j, Q i j := by + simp [f, Matrix.add_mulVec, Matrix.mulVec, dotProduct] + refine ⟨f, ?_, ?_⟩ + · intro i + rw [hf] + have : 0 ≤ ∑ j, Q i j := Finset.sum_nonneg fun j _ => hQ i j + linarith + · intro i + have he := congrArg (fun A : Matrix ι ι ℝ => (A *ᵥ (fun _ => 1)) i) hA + change (((M * Matrix.diagonal w) * (1 + Q)) *ᵥ (fun _ : ι => (1 : ℝ))) i = _ at he + rw [← Matrix.mulVec_mulVec] at he + change ((M * Matrix.diagonal w) *ᵥ f) i = _ at he + simp only [Matrix.mulVec, dotProduct, Matrix.mul_diagonal, mul_one] at he + rw [he, hf] + linarith + + +theorem finite_resolvent {M : Matrix ι ι ℝ} {w : ι → ℝ} + (hM : M.IsSymm) (hp : ∀ i j, 0 < M i j) + (hP : OnePositiveSquare (Matrix.of fun i j => (M i j)⁻¹)) + (hw : ∀ i, 0 ≤ w i) + (hn : ‖Matrix.diagonal (fun i => Real.sqrt (w i)) * M * + Matrix.diagonal (fun i => Real.sqrt (w i))‖ < 1) : + ∃ R : Matrix ι ι ℝ, R.IsSymm ∧ (∀ i j, 0 < R i j) ∧ + OnePositiveSquare (Matrix.of fun i j => (R i j)⁻¹) ∧ + R = M + M * Matrix.diagonal w * R := by + obtain ⟨f, hf, hb⟩ := exists_superharmonic_of_weighted_norm_lt_one + (fun i j => (hp i j).le) hw hn + obtain ⟨R, hRs, hRp, hRP, hReq⟩ := finite_resolvent_of_superharmonic hM hp hP hw hf + Finset.univ (by simpa using hb) + refine ⟨R, hRs, hRp, hRP, ?_⟩ + ext i j + change R i j = M i j + ∑ k, (M * Matrix.diagonal w) i k * R k j + simp only [Matrix.mul_diagonal] + exact hReq i j + + + +def finiteResolventKernel (M : Matrix ι ι ℝ) (w : ι → ℝ) : Matrix ι ι ℝ := + let D := Matrix.diagonal (fun i => Real.sqrt (w i)) + M + M * D * (1 - D * M * D)⁻¹ * D * M + +lemma resolvent_eq_finiteResolventKernel {M R : Matrix ι ι ℝ} {w : ι → ℝ} + (hw : ∀ i, 0 ≤ w i) + (hn : ‖Matrix.diagonal (fun i => Real.sqrt (w i)) * M * + Matrix.diagonal (fun i => Real.sqrt (w i))‖ < 1) + (hR : R = M + M * Matrix.diagonal w * R) : + R = finiteResolventKernel M w := by + let D : Matrix ι ι ℝ := Matrix.diagonal (fun i => Real.sqrt (w i)) + let N : Matrix ι ι ℝ := M * D + let T : Matrix ι ι ℝ := D * N + let B : Matrix ι ι ℝ := (1 - T)⁻¹ + let U : Matrix ι ι ℝ := 1 + N * B * D + have hnorm : ‖T‖ < 1 := by simpa only [T, N, Matrix.mul_assoc] using hn + have hu : IsUnit (1 - T) := isUnit_one_sub_of_norm_lt_one hnorm + have hBinv : (1 - T) * B = 1 := + Matrix.mul_nonsing_inv _ ((Matrix.isUnit_iff_isUnit_det _).mp hu) + have hD : D * D = Matrix.diagonal w := by + dsimp [D] + rw [Matrix.diagonal_mul_diagonal] + congr 1 + funext i + exact Real.mul_self_sqrt (hw i) + have hA : M * Matrix.diagonal w = N * D := by rw [← hD]; exact (Matrix.mul_assoc ..).symm + have hKU : (1 - N * D) * U = 1 := by + calc + _ = 1 + N * ((1 - T) * B - 1) * D := by dsimp [U, T]; noncomm_ring + _ = 1 := by rw [hBinv, sub_self, mul_zero, zero_mul, add_zero] + have hUK : U * (1 - N * D) = 1 := mul_eq_one_comm.mp hKU + have hKR : (1 - N * D) * R = M := by + rw [sub_mul, one_mul] + rw [hA] at hR + exact sub_eq_iff_eq_add.mpr hR + calc + R = (U * (1 - N * D)) * R := by rw [hUK, one_mul] + _ = U * M := by rw [Matrix.mul_assoc, hKR] + _ = finiteResolventKernel M w := by + simp only [U, N, B, T, finiteResolventKernel, D] + noncomm_ring + + + +theorem finite_quadrature_reciprocal {M : Matrix ι ι ℝ} {w : ι → ℝ} + (hM : M.IsSymm) (hp : ∀ i j, 0 < M i j) + (hP : OnePositiveSquare (Matrix.of fun i j => (M i j)⁻¹)) + (hw : ∀ i, 0 ≤ w i) + (hn : ‖Matrix.diagonal (fun i => Real.sqrt (w i)) * M * + Matrix.diagonal (fun i => Real.sqrt (w i))‖ < 1) : + (∀ i j, 0 < finiteResolventKernel M w i j) ∧ + OnePositiveSquare (Matrix.of fun i j => (finiteResolventKernel M w i j)⁻¹) := by + obtain ⟨R, _, hpos, hrec, hReq⟩ := finite_resolvent hM hp hP hw hn + rw [resolvent_eq_finiteResolventKernel hw hn hReq] at hpos hrec + exact ⟨hpos, hrec⟩ + +end ReciprocalKernel + + + + + + +open Filter +open scoped Topology +namespace StrictHotSpots.BanachResolvent +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + +def resolvent (A : E →L[ℝ] E) : E →L[ℝ] E := ∑' n : ℕ, A ^ n + +lemma resolvent_left (A : E →L[ℝ] E) (hA : ‖A‖ < 1) : + (1 - A) * resolvent A = 1 := mul_neg_geom_series A hA + +lemma resolvent_right (A : E →L[ℝ] E) (hA : ‖A‖ < 1) : + resolvent A * (1 - A) = 1 := geom_series_mul_neg A hA + +omit [CompleteSpace E] in +lemma resolvent_norm_le (A : E →L[ℝ] E) {d : ℝ} (hA : ‖A‖ ≤ d) (hd : d < 1) : + ‖resolvent A‖ ≤ (1 - d)⁻¹ := by + have h := tsum_geometric_le_of_norm_lt_one A (hA.trans_lt hd) + have h1 : ‖(1 : E →L[ℝ] E)‖ ≤ 1 := ContinuousLinearMap.norm_id_le + have hi : (1 - ‖A‖)⁻¹ ≤ (1 - d)⁻¹ := by + apply inv_anti₀ (sub_pos.mpr hd) + linarith + dsimp only [resolvent] + linarith + +lemma resolvent_identity (A B : E →L[ℝ] E) (hA : ‖A‖ < 1) (hB : ‖B‖ < 1) : + resolvent B - resolvent A = resolvent B * (B - A) * resolvent A := by + have ht : B - A = (1 - A) - (1 - B) := by abel + rw [ht, mul_sub, sub_mul, mul_assoc, resolvent_left A hA, + resolvent_right B hB, mul_one, one_mul] + +lemma resolvent_strong_tendsto (A : E →L[ℝ] E) (Q : ℕ → E →L[ℝ] E) + {d : ℝ} (hd : d < 1) (hA : ‖A‖ < 1) + (hQ : ∀ᶠ n in atTop, ‖Q n‖ ≤ d) + (hs : ∀ v, Tendsto (fun n => Q n v) atTop (𝓝 (A v))) (v : E) : + Tendsto (fun n => resolvent (Q n) v) atTop (𝓝 (resolvent A v)) := by + rw [← tendsto_sub_nhds_zero_iff] + have hz : Tendsto (fun n => (1 - d)⁻¹ * ‖(Q n - A) (resolvent A v)‖) atTop (𝓝 0) := by + have ht := ((hs (resolvent A v)).sub (tendsto_const_nhds (x := A (resolvent A v)))).norm.const_mul (1 - d)⁻¹ + simpa using ht + apply squeeze_zero_norm' _ hz + filter_upwards [hQ] with n hn + have he := congrArg (fun T : E →L[ℝ] E => T v) + (resolvent_identity A (Q n) hA (hn.trans_lt hd)) + simp only [sub_apply, mul_apply_eq_comp] at he + rw [he] + exact (ContinuousLinearMap.le_opNorm _ _).trans + (mul_le_mul_of_nonneg_right (resolvent_norm_le (Q n) hn hd) (norm_nonneg _)) + +lemma resolvent_solution (A : E →L[ℝ] E) (hA : ‖A‖ < 1) {u f : E} + (hu : u - A u = f) : u = resolvent A f := by + have h := congrArg (fun T : E →L[ℝ] E => T u) (resolvent_right A hA) + simpa only [mul_apply_eq_comp, sub_apply, + one_apply_eq_self, hu] using h.symm + +lemma resolvent_nonneg [PartialOrder E] [IsOrderedAddMonoid E] [OrderClosedTopology E] + (A : E →L[ℝ] E) (hA : ‖A‖ < 1) + (hpos : ∀ v, 0 ≤ v → 0 ≤ A v) {f : E} (hf : 0 ≤ f) : + 0 ≤ resolvent A f := by + have ht : ∀ n : ℕ, 0 ≤ (A^n) f := by + intro n + induction n with + | zero => simpa using hf + | succ n ih => simpa only [pow_succ', mul_apply_eq_comp] using hpos _ ih + have hs0 : HasSum (fun n : ℕ => A^n) (resolvent A) := + (summable_geometric_of_norm_lt_one hA).hasSum + have hs := (ContinuousLinearMap.apply ℝ E f).hasSum hs0 + change HasSum (fun n : ℕ => (A^n) f) (resolvent A f) at hs + rw [← hs.tsum_eq] + exact tsum_nonneg ht + +lemma resolvent_ge_self [PartialOrder E] [IsOrderedAddMonoid E] [OrderClosedTopology E] + (A : E →L[ℝ] E) (hA : ‖A‖ < 1) + (hpos : ∀ v, 0 ≤ v → 0 ≤ A v) {f : E} (hf : 0 ≤ f) : + f ≤ resolvent A f := by + have h := congrArg (fun T : E →L[ℝ] E => T f) (resolvent_left A hA) + simp only [mul_apply_eq_comp, sub_apply, one_apply_eq_self] at h + have hn := hpos _ (resolvent_nonneg A hA hpos hf) + calc + f = resolvent A f - A (resolvent A f) := h.symm + _ ≤ resolvent A f := sub_le_self _ hn + +end StrictHotSpots.BanachResolvent + + + + + + + +open MeasureTheory Filter Set TopologicalSpace +open scoped Topology ENNReal +namespace StrictHotSpots.CompactKernel + +variable {X : Type*} [MetricSpace X] [CompactSpace X] [MeasurableSpace X] + [BorelSpace X] (ν : Measure X) [IsFiniteMeasure ν] + +lemma kernel_integrable (C : C(X × X, ℝ)) (f : C(X, ℝ)) : + Integrable (fun z => f z • C.curry z) ν := + (f.continuous.smul C.curry.continuous).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + + + + +def kernelOp (C : C(X × X, ℝ)) : C(X, ℝ) →L[ℝ] C(X, ℝ) := + LinearMap.mkContinuous + { toFun := fun f => ∫ z, f z • C.curry z ∂ν + map_add' := by + intro f g + simp only [ContinuousMap.add_apply, add_smul] + exact integral_add (kernel_integrable ν C f) (kernel_integrable ν C g) + map_smul' := by + intro r f + simp only [ContinuousMap.smul_apply, smul_eq_mul, mul_smul] + exact integral_smul r _ } + (ν.real univ * ‖C‖) (by + intro f + calc + ‖∫ z, f z • C.curry z ∂ν‖ ≤ ∫ z, ‖f z • C.curry z‖ ∂ν := norm_integral_le_integral_norm _ + _ ≤ ∫ _ : X, ‖f‖ * ‖C‖ ∂ν := by + apply integral_mono (kernel_integrable ν C f).norm (integrable_const _) + intro z + dsimp only + rw [norm_smul] + apply mul_le_mul (f.norm_coe_le_norm z) _ (norm_nonneg _) (norm_nonneg _) + exact (ContinuousMap.norm_le _ (norm_nonneg C)).mpr fun x => C.norm_coe_le_norm (z,x) + _ = ν.real univ * ‖C‖ * ‖f‖ := by simp [integral_const]; ring) + +lemma kernelOp_apply (C : C(X × X, ℝ)) (f : C(X, ℝ)) (x : X) : + kernelOp ν C f x = ∫ z, C (z,x) * f z ∂ν := by + change (∫ z, f z • C.curry z ∂ν) x = _ + rw [ContinuousMap.integral_apply (kernel_integrable ν C f)] + simp only [ContinuousMap.smul_apply, smul_eq_mul, ContinuousMap.curry_apply, mul_comm] + +lemma kernelOp_nonneg (C : C(X × X, ℝ)) (hC : ∀ z x, 0 ≤ C (z,x)) + {f : C(X, ℝ)} (hf : 0 ≤ f) : 0 ≤ kernelOp ν C f := by + intro x + change 0 ≤ kernelOp ν C f x + rw [kernelOp_apply] + exact integral_nonneg fun z => mul_nonneg (hC z x) (hf z) + + + +lemma kernelOp_norm_le (C : C(X × X, ℝ)) (hC : ∀ z x, 0 ≤ C (z,x)) + {d : ℝ} (hd : 0 ≤ d) (hrow : ∀ x, ∫ z, C (z,x) ∂ν ≤ d) : + ‖kernelOp ν C‖ ≤ d := by + apply ContinuousLinearMap.opNorm_le_bound _ hd + intro f + apply (ContinuousMap.norm_le _ (mul_nonneg hd (norm_nonneg f))).mpr + intro x + rw [kernelOp_apply] + calc + ‖∫ z, C (z,x) * f z ∂ν‖ ≤ ∫ z, ‖C (z,x) * f z‖ ∂ν := norm_integral_le_integral_norm _ + _ ≤ ∫ z, C (z,x) * ‖f‖ ∂ν := by + apply integral_mono + · exact ((C.continuous.comp (continuous_id.prodMk continuous_const)).mul f.continuous).norm.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + · exact ((C.continuous.comp (continuous_id.prodMk continuous_const)).mul continuous_const).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + · intro z + dsimp only + rw [norm_mul, Real.norm_of_nonneg (hC z x)] + exact mul_le_mul_of_nonneg_left (f.norm_coe_le_norm z) (hC z x) + _ = (∫ z, C (z,x) ∂ν) * ‖f‖ := integral_mul_const _ _ + _ ≤ d * ‖f‖ := mul_le_mul_of_nonneg_right (hrow x) (norm_nonneg f) + + +omit [MetricSpace X] [CompactSpace X] [BorelSpace X] in +lemma integral_comp_simpleFunc {Y : Type*} {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℝ E] [CompleteSpace E] (π : SimpleFunc X Y) (F : Y → E) : + ∫ x, F (π x) ∂ν = ∑ y ∈ π.range, ν.real (π ⁻¹' {y}) • F y := by + classical + have he : (fun x => F (π x)) = fun x => + ∑ y ∈ π.range, (π ⁻¹' {y}).indicator (fun _ => F y) x := by + funext x + simp [Set.indicator_apply, eq_comm] + rw [he, integral_finsetSum] + · apply Finset.sum_congr rfl + intro y hy + exact integral_indicator_const _ (π.measurableSet_fiber y) + · intro y hy + exact (integrable_const (F y)).indicator (π.measurableSet_fiber y) + + +def sampleOp (π : SimpleFunc X X) (C : C(X × X, ℝ)) : C(X, ℝ) →L[ℝ] C(X, ℝ) := + ∑ z ∈ π.range, ν.real (π ⁻¹' {z}) • (ContinuousMap.evalCLM ℝ z).smulRight (C.curry z) + +omit [BorelSpace X] in +lemma sampleOp_eq_integral (π : SimpleFunc X X) (C : C(X × X, ℝ)) (f : C(X, ℝ)) : + sampleOp ν π C f = ∫ z, f (π z) • C.curry (π z) ∂ν := by + rw [integral_comp_simpleFunc ν π (fun z => f z • C.curry z)] + simp [sampleOp, sum_apply] + +omit [BorelSpace X] [IsFiniteMeasure ν] in +lemma sampleOp_apply (π : SimpleFunc X X) (C : C(X × X, ℝ)) (f : C(X, ℝ)) (x : X) : + sampleOp ν π C f x = ∑ z ∈ π.range, ν.real (π ⁻¹' {z}) * C (z,x) * f z := by + simp only [sampleOp, sum_apply, smul_apply, + ContinuousMap.sum_apply, ContinuousMap.smul_apply, ContinuousLinearMap.smulRight_apply, + ContinuousMap.evalCLM_apply, ContinuousMap.curry_apply, smul_eq_mul] + apply Finset.sum_congr rfl + intro z hz + ring + +omit [BorelSpace X] [IsFiniteMeasure ν] in +lemma sampleOp_nonneg (π : SimpleFunc X X) (C : C(X × X, ℝ)) (hC : ∀ z x, 0 ≤ C (z,x)) + {f : C(X, ℝ)} (hf : 0 ≤ f) : 0 ≤ sampleOp ν π C f := by + intro x + change 0 ≤ sampleOp ν π C f x + rw [sampleOp_apply] + exact Finset.sum_nonneg fun z _ => mul_nonneg + (mul_nonneg (measureReal_nonneg) (hC z x)) (hf z) + +omit [BorelSpace X] [IsFiniteMeasure ν] in +lemma sampleOp_norm_le (π : SimpleFunc X X) (C : C(X × X, ℝ)) (hC : ∀ z x, 0 ≤ C (z,x)) + {d : ℝ} (hd : 0 ≤ d) (hrow : ∀ x, sampleOp ν π C 1 x ≤ d) : + ‖sampleOp ν π C‖ ≤ d := by + apply ContinuousLinearMap.opNorm_le_bound _ hd + intro f + apply (ContinuousMap.norm_le _ (mul_nonneg hd (norm_nonneg f))).mpr + intro x + rw [sampleOp_apply] + calc + ‖∑ z ∈ π.range, ν.real (π ⁻¹' {z}) * C (z,x) * f z‖ ≤ + ∑ z ∈ π.range, ‖ν.real (π ⁻¹' {z}) * C (z,x) * f z‖ := norm_sum_le _ _ + _ ≤ ∑ z ∈ π.range, ν.real (π ⁻¹' {z}) * C (z,x) * ‖f‖ := by + apply Finset.sum_le_sum + intro z hz + rw [norm_mul, Real.norm_of_nonneg (mul_nonneg measureReal_nonneg (hC z x))] + exact mul_le_mul_of_nonneg_left (f.norm_coe_le_norm z) + (mul_nonneg measureReal_nonneg (hC z x)) + _ = sampleOp ν π C 1 x * ‖f‖ := by simp [sampleOp_apply, Finset.sum_mul] + _ ≤ d * ‖f‖ := mul_le_mul_of_nonneg_right (hrow x) (norm_nonneg f) + +variable [Nonempty X] + + + +def quantize (n : ℕ) : SimpleFunc X X := SimpleFunc.nearestPt (denseSeq X) n + +lemma quantize_tendsto (x : X) : Tendsto (fun n => quantize (X := X) n x) atTop (𝓝 x) := + SimpleFunc.tendsto_nearestPt (by rw [(denseRange_denseSeq X).closure_range]; trivial) + +lemma integral_quantize_tendsto {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [CompleteSpace E] (F : C(X, E)) : + Tendsto (fun n => ∫ z, F (quantize n z) ∂ν) atTop (𝓝 (∫ z, F z ∂ν)) := by + apply tendsto_integral_of_dominated_convergence (fun _ => ‖F‖) + · intro n + exact ((quantize n).map F).stronglyMeasurable.aestronglyMeasurable + · exact integrable_const _ + · intro n + exact Filter.Eventually.of_forall fun z => F.norm_coe_le_norm (quantize n z) + · exact Filter.Eventually.of_forall fun z => F.continuous.continuousAt.tendsto.comp + (quantize_tendsto z) + +lemma sampleOp_strong_tendsto (C : C(X × X, ℝ)) (f : C(X, ℝ)) : + Tendsto (fun n => sampleOp ν (quantize n) C f) atTop (𝓝 (kernelOp ν C f)) := by + simp only [sampleOp_eq_integral] + exact integral_quantize_tendsto ν ⟨_, f.continuous.smul C.curry.continuous⟩ + + + +lemma sampleOp_eventually_norm_le (C : C(X × X, ℝ)) + (hC : ∀ z x, 0 ≤ C (z,x)) {d d' : ℝ} (hd : 0 ≤ d) + (hdd' : d < d') (hrow : ∀ x, ∫ z, C (z,x) ∂ν ≤ d) : + ∀ᶠ n in atTop, ‖sampleOp ν (quantize n) C‖ ≤ d' := by + obtain ⟨N,hN⟩ := Metric.tendsto_atTop.mp (sampleOp_strong_tendsto ν C 1) + (d' - d) (sub_pos.mpr hdd') + filter_upwards [eventually_ge_atTop N] with n hn + apply sampleOp_norm_le ν _ C hC (hd.trans hdd'.le) + intro x + have hh := (sampleOp ν (quantize n) C 1 - kernelOp ν C 1).norm_coe_le_norm x + have hk : kernelOp ν C 1 x ≤ d := by simpa [kernelOp_apply] using hrow x + have hc : sampleOp ν (quantize n) C 1 x - kernelOp ν C 1 x ≤ + ‖sampleOp ν (quantize n) C 1 - kernelOp ν C 1‖ := + (le_abs_self _).trans hh + have he := hN n hn + rw [dist_eq_norm] at he + linarith + +end StrictHotSpots.CompactKernel + +namespace ReciprocalKernel +open Matrix +lemma onePositiveSquare_submatrix_sum_inl {ι κ : Type*} [Fintype ι] [Fintype κ] + {A : Matrix (ι ⊕ κ) (ι ⊕ κ) ℝ} (hA : OnePositiveSquare A) : + OnePositiveSquare (A.submatrix Sum.inl Sum.inl) := by + have he (u v : ι → ℝ) : pairing (A.submatrix Sum.inl Sum.inl) u v = + pairing A (Sum.elim u (fun _ => 0)) (Sum.elim v (fun _ => 0)) := by + simp [pairing, dotProduct, Matrix.mulVec, Fintype.sum_sum_type] + refine ⟨?_, ?_⟩ + · ext i j + exact hA.1.apply _ _ + · intro u v hu huv + rw [he] at hu huv ⊢ + exact hA.2 _ _ hu huv +end ReciprocalKernel + +namespace StrictHotSpots.CompactKernel +open MeasureTheory Filter Set TopologicalSpace BanachResolvent ReciprocalKernel +open scoped Topology ENNReal +variable {X : Type} [MetricSpace X] [CompactSpace X] [MeasurableSpace X] + [BorelSpace X] (ν : Measure X) [IsFiniteMeasure ν] + + +def resolvedKernel (C : C(X × X, ℝ)) (A : C(X, ℝ) →L[ℝ] C(X, ℝ)) (x y : X) : ℝ := + resolvent A (C.curry y) x + +omit [BorelSpace X] [IsFiniteMeasure ν] in + + +lemma sampled_reciprocal (π : SimpleFunc X X) (C : C(X × X, ℝ)) + (hC : ∀ z x, 0 < C (z,x)) (hsym : ∀ x y, C (x,y) = C (y,x)) + (hP : ∀ (ι : Type) [Fintype ι] (s : ι → X), + OnePositiveSquare (Matrix.of fun i j => (C (s i,s j))⁻¹)) + {d : ℝ} (hd : 0 ≤ d) (hd1 : d < 1) + (hrow : ∀ x, sampleOp ν π C 1 x ≤ d) + {ι : Type} [Fintype ι] (s : ι → X) : + (∀ i j, 0 < resolvedKernel C (sampleOp ν π C) (s i) (s j)) ∧ + OnePositiveSquare (Matrix.of fun i j => + (resolvedKernel C (sampleOp ν π C) (s i) (s j))⁻¹) := by + classical + let t : ι ⊕ π.range → X := Sum.elim s Subtype.val + let w : ι ⊕ π.range → ℝ := Sum.elim (fun _ => 0) (fun z => ν.real (π ⁻¹' {z.val})) + let M : Matrix (ι ⊕ π.range) (ι ⊕ π.range) ℝ := Matrix.of fun i j => C (t j,t i) + have hM : M.IsSymm := by ext i j; exact hsym _ _ + have hp : ∀ i j, 0 < M i j := fun i j => hC _ _ + have hrec : OnePositiveSquare (Matrix.of fun i j => (M i j)⁻¹) := by + have he : (Matrix.of fun i j => (M i j)⁻¹) = + (Matrix.of fun i j => (C (t i,t j))⁻¹) := by ext i j; simp [M, hsym] + rw [he] + exact hP _ t + have hw : ∀ i, 0 ≤ w i := by intro i; cases i <;> simp [w, measureReal_nonneg] + have hsum (i : ι ⊕ π.range) (f : C(X, ℝ)) : + ∑ j, M i j * w j * f (t j) = sampleOp ν π C f (t i) := by + simp only [Fintype.sum_sum_type, M, w, t, Sum.elim_inl, Sum.elim_inr, + Matrix.of_apply, mul_zero, zero_mul, Finset.sum_const_zero, zero_add, + sampleOp_apply] + rw [Finset.sum_subtype π.range (fun _ => Iff.rfl)] + apply Finset.sum_congr rfl + intro z hz + ring + have hb : ∀ i, ∑ j ∈ Finset.univ, M i j * w j * (1 : ℝ) < 1 := by + intro i + have he := hsum i 1 + simp only [ContinuousMap.one_apply] at he + exact (he ▸ hrow (t i)).trans_lt hd1 + obtain ⟨R,hRs,hRp,hRrec,hReq⟩ := finite_resolvent_of_superharmonic + hM hp hrec hw (fun _ => one_pos) Finset.univ hb + have hn : ‖sampleOp ν π C‖ < 1 := + (sampleOp_norm_le ν π C (fun z x => (hC z x).le) hd hrow).trans_lt hd1 + have hmatch (j : ι ⊕ π.range) : ∀ i, + R i j = resolvedKernel C (sampleOp ν π C) (t i) (t j) := by + let u : C(X, ℝ) := C.curry (t j) + + ∑ z : π.range, (ν.real (π ⁻¹' {z.val}) * R (Sum.inr z) j) • C.curry z.val + have hu (i : ι ⊕ π.range) : u (t i) = R i j := by + rw [hReq i j] + simp only [u, ContinuousMap.add_apply, ContinuousMap.sum_apply, + ContinuousMap.smul_apply, ContinuousMap.curry_apply, smul_eq_mul, + Fintype.sum_sum_type, M, w, t, Sum.elim_inl, Sum.elim_inr, + Matrix.of_apply, mul_zero, zero_mul, Finset.sum_const_zero, zero_add] + congr 1 + apply Finset.sum_congr rfl + intro z hz + ring + have he : u - sampleOp ν π C u = C.curry (t j) := by + ext x + simp only [ContinuousMap.sub_apply, sampleOp_apply] + rw [Finset.sum_subtype π.range (fun _ => Iff.rfl)] + have hz (z : π.range) : u z.val = R (Sum.inr z) j := hu (Sum.inr z) + simp only [hz, u, ContinuousMap.add_apply, ContinuousMap.sum_apply, + ContinuousMap.smul_apply, ContinuousMap.curry_apply, smul_eq_mul] + have hsum' : (∑ z : π.range, (ν.real (π ⁻¹' {↑z}) * R (Sum.inr z) j) * C (↑z,x)) = + ∑ z : π.range, ν.real (π ⁻¹' {↑z}) * C (↑z,x) * R (Sum.inr z) j := by + apply Finset.sum_congr rfl + intro z hz + ring + rw [hsum'] + abel + intro i + rw [← hu i, resolvent_solution _ hn he] + rfl + refine ⟨fun i j => ?_, ?_⟩ + · simpa only [t, Sum.elim_inl, hmatch] using hRp (Sum.inl i) (Sum.inl j) + · have hsub := onePositiveSquare_submatrix_sum_inl hRrec + convert hsub using 1 + ext i j + simp only [Matrix.submatrix_apply, Matrix.of_apply, hmatch, t, Sum.elim_inl] + +omit [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma continuousMap_orderClosed : OrderClosedTopology C(X, ℝ) := by + constructor + have he : {p : C(X, ℝ) × C(X, ℝ) | p.1 ≤ p.2} = + ⋂ x : X, {p : C(X, ℝ) × C(X, ℝ) | p.1 x ≤ p.2 x} := by + ext p + simp only [Set.mem_ofPred_eq, Set.mem_iInter] + rfl + rw [he] + exact isClosed_iInter fun x => isClosed_le + ((ContinuousMap.evalCLM ℝ x).continuous.comp continuous_fst) + ((ContinuousMap.evalCLM ℝ x).continuous.comp continuous_snd) + +omit [MeasurableSpace X] [BorelSpace X] in +lemma continuous_resolvent_nonneg (A : C(X, ℝ) →L[ℝ] C(X, ℝ)) + (hA : ‖A‖ < 1) (hpos : ∀ f : C(X, ℝ), 0 ≤ f → 0 ≤ A f) + {f : C(X, ℝ)} (hf : 0 ≤ f) : 0 ≤ resolvent A f := by + let : OrderClosedTopology C(X, ℝ) := continuousMap_orderClosed + exact resolvent_nonneg A hA hpos hf + + +omit [MeasurableSpace X] [BorelSpace X] in +lemma resolvedKernel_ge (C : C(X × X, ℝ)) {A : C(X, ℝ) →L[ℝ] C(X, ℝ)} + (hA : ‖A‖ < 1) (hpos : ∀ f : C(X, ℝ), 0 ≤ f → 0 ≤ A f) + (hC : ∀ z x, 0 ≤ C (z,x)) (x y : X) : + C (y,x) ≤ resolvedKernel C A x y := by + have hp : 0 ≤ C.curry y := fun x => hC y x + have hn := hpos _ (continuous_resolvent_nonneg A hA hpos hp) + have he := congrArg (fun T : C(X, ℝ) →L[ℝ] C(X, ℝ) => T (C.curry y)) + (resolvent_left A hA) + simp only [mul_apply_eq_comp, sub_apply, one_apply_eq_self] at he + have hex := congrArg (fun f : C(X, ℝ) => f x) he + change resolvedKernel C A x y - A (resolvent A (C.curry y)) x = C (y,x) at hex + have hnx := hn x + change 0 ≤ A (resolvent A (C.curry y)) x at hnx + linarith + +lemma resolvedKernel_tendsto [Nonempty X] (C : C(X × X, ℝ)) + (hC : ∀ z x, 0 ≤ C (z,x)) {d : ℝ} (hd : 0 ≤ d) (hd1 : d < 1) + (hrow : ∀ x, ∫ z, C (z,x) ∂ν ≤ d) (x y : X) : + Tendsto (fun n => resolvedKernel C (sampleOp ν (quantize n) C) x y) atTop + (𝓝 (resolvedKernel C (kernelOp ν C) x y)) := by + have hn := kernelOp_norm_le ν C hC hd hrow + have hh := BanachResolvent.resolvent_strong_tendsto (kernelOp ν C) + (fun n => sampleOp ν (quantize n) C) (d := (1+d)/2) (by linarith) + (hn.trans_lt hd1) + (sampleOp_eventually_norm_le ν C hC hd (by linarith) hrow) + (sampleOp_strong_tendsto ν C) (C.curry y) + exact ((ContinuousMap.evalCLM ℝ x).continuous.tendsto _).comp hh + + + + +theorem compact_reciprocal_of_row_bound [Nonempty X] (C : C(X × X, ℝ)) + (hC : ∀ z x, 0 < C (z,x)) (hsym : ∀ x y, C (x,y) = C (y,x)) + (hP : ∀ (ι : Type) [Fintype ι] (s : ι → X), + OnePositiveSquare (Matrix.of fun i j => (C (s i,s j))⁻¹)) + {d : ℝ} (hd : 0 ≤ d) (hd1 : d < 1) + (hrow : ∀ x, ∫ z, C (z,x) ∂ν ≤ d) + {ι : Type} [Fintype ι] (s : ι → X) : + (∀ i j, 0 < resolvedKernel C (kernelOp ν C) (s i) (s j)) ∧ + OnePositiveSquare (Matrix.of fun i j => + (resolvedKernel C (kernelOp ν C) (s i) (s j))⁻¹) := by + have hn := kernelOp_norm_le ν C (fun z x => (hC z x).le) hd hrow + have hp (x y : X) : 0 < resolvedKernel C (kernelOp ν C) x y := + (hC y x).trans_le (resolvedKernel_ge C (hn.trans_lt hd1) + (fun f hf => kernelOp_nonneg ν C (fun z x => (hC z x).le) hf) + (fun z x => (hC z x).le) x y) + refine ⟨fun i j => hp _ _, ?_⟩ + have he := sampleOp_eventually_norm_le ν C (fun z x => (hC z x).le) hd + (show d < (1+d)/2 by linarith) hrow + have hr : ∀ᶠ n in atTop, ∀ x, sampleOp ν (quantize n) C 1 x ≤ (1+d)/2 := by + filter_upwards [he] with n hn x + calc + sampleOp ν (quantize n) C 1 x ≤ ‖sampleOp ν (quantize n) C 1 x‖ := le_abs_self _ + _ ≤ ‖sampleOp ν (quantize n) C 1‖ := ContinuousMap.norm_coe_le_norm _ _ + _ ≤ ‖sampleOp ν (quantize n) C‖ * ‖(1 : C(X, ℝ))‖ := ContinuousLinearMap.le_opNorm _ _ + _ ≤ (1+d)/2 := by simpa using hn + obtain ⟨N,hN⟩ := eventually_atTop.mp hr + apply onePositiveSquare_of_entrywise_tendsto + (A := fun n => Matrix.of fun i j => + (resolvedKernel C (sampleOp ν (quantize (n+N)) C) (s i) (s j))⁻¹) + · intro n + exact (sampled_reciprocal ν (quantize (n+N)) C hC hsym hP + (show 0 ≤ (1+d)/2 by linarith) (by linarith) (hN _ (Nat.le_add_left _ _)) s).2 + · intro i j + exact ((resolvedKernel_tendsto ν C (fun z x => (hC z x).le) hd hd1 hrow (s i) (s j)).inv₀ + (hp _ _).ne').comp (tendsto_add_atTop_nat N) + +end StrictHotSpots.CompactKernel + + +namespace StrictHotSpots.CompactKernel +open MeasureTheory Filter Set TopologicalSpace BanachResolvent +open scoped Topology ENNReal +variable {X : Type*} [MetricSpace X] [CompactSpace X] [MeasurableSpace X] + [BorelSpace X] (ν : Measure X) [IsFiniteMeasure ν] + +lemma integral_norm_L2_le (f : Lp ℝ 2 ν) : + ∫ z, ‖f z‖ ∂ν ≤ ‖f‖ * ‖ContinuousMap.toLp 2 ν ℝ (1 : C(X, ℝ))‖ := by + have he : ∫ z, ‖f z‖ ∂ν = + inner ℝ |f| (ContinuousMap.toLp 2 ν ℝ (1 : C(X, ℝ))) := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [Lp.coeFn_abs f, ContinuousMap.coeFn_toLp (p := 2) (𝕜 := ℝ) ν (1 : C(X, ℝ))] + with z hz h1 + change ‖f z‖ = (ContinuousMap.toLp 2 ν ℝ (1 : C(X, ℝ))) z * (|f|) z + rw [hz, h1] + simp [Real.norm_eq_abs] + rw [he] + simpa only [norm_abs_eq_norm] using real_inner_le_norm |f| (ContinuousMap.toLp 2 ν ℝ (1 : C(X, ℝ))) + +lemma l2kernel_integrable (C : C(X × X, ℝ)) (f : Lp ℝ 2 ν) : + Integrable (fun z => f z • C.curry z) ν := by + apply ((Lp.memLp f).integrable (by norm_num)).norm.mul_const ‖C‖ |>.mono' + ((Lp.aestronglyMeasurable f).smul C.curry.continuous.aestronglyMeasurable) + exact Eventually.of_forall fun z => by + change ‖f z • C.curry z‖ ≤ _ + rw [norm_smul] + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + exact (ContinuousMap.norm_le _ (norm_nonneg C)).mpr fun x => C.norm_coe_le_norm (z,x) + + + +def l2SectionOp (C : C(X × X, ℝ)) : Lp ℝ 2 ν →L[ℝ] C(X, ℝ) := + LinearMap.mkContinuous + { toFun := fun f => ∫ z, f z • C.curry z ∂ν + map_add' := by + intro f g + change (∫ z, (f+g) z • C.curry z ∂ν) = _ + calc + _ = ∫ z, f z • C.curry z + g z • C.curry z ∂ν := by + apply integral_congr_ae + filter_upwards [Lp.coeFn_add f g] with z hz + rw [hz, Pi.add_apply, add_smul] + _ = _ := integral_add (l2kernel_integrable ν C f) (l2kernel_integrable ν C g) + map_smul' := by + intro r f + calc + _ = ∫ z, r • (f z • C.curry z) ∂ν := by + apply integral_congr_ae + filter_upwards [Lp.coeFn_smul r f] with z hz + simp [hz, mul_smul] + _ = _ := integral_smul r _ } + (‖C‖ * ‖ContinuousMap.toLp 2 ν ℝ (1 : C(X, ℝ))‖) (by + intro f + calc + ‖∫ z, f z • C.curry z ∂ν‖ ≤ ∫ z, ‖f z • C.curry z‖ ∂ν := norm_integral_le_integral_norm _ + _ ≤ ∫ z, ‖f z‖ * ‖C‖ ∂ν := by + apply integral_mono (l2kernel_integrable ν C f).norm + (((Lp.memLp f).integrable (by norm_num)).norm.mul_const _) + intro z + dsimp only + rw [norm_smul] + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + exact (ContinuousMap.norm_le _ (norm_nonneg C)).mpr fun x => C.norm_coe_le_norm (z,x) + _ = (∫ z, ‖f z‖ ∂ν) * ‖C‖ := integral_mul_const _ _ + _ ≤ (‖f‖ * ‖ContinuousMap.toLp 2 ν ℝ (1 : C(X, ℝ))‖) * ‖C‖ := + mul_le_mul_of_nonneg_right (integral_norm_L2_le ν f) (norm_nonneg _) + _ = _ := by ring) + +lemma l2SectionOp_apply (C : C(X × X, ℝ)) (f : Lp ℝ 2 ν) (x : X) : + l2SectionOp ν C f x = ∫ z, C (z,x) * f z ∂ν := by + change (∫ z, f z • C.curry z ∂ν) x = _ + rw [ContinuousMap.integral_apply (l2kernel_integrable ν C f)] + simp only [ContinuousMap.smul_apply, smul_eq_mul, ContinuousMap.curry_apply, mul_comm] + +lemma l2SectionOp_toLp (C : C(X × X, ℝ)) (f : C(X, ℝ)) : + l2SectionOp ν C (ContinuousMap.toLp 2 ν ℝ f) = kernelOp ν C f := by + ext x + rw [kernelOp_apply, l2SectionOp_apply] + apply integral_congr_ae + filter_upwards [ContinuousMap.coeFn_toLp (p := 2) (𝕜 := ℝ) ν f] with z hz + rw [hz] + +lemma l2SectionOp_nonneg (C : C(X × X, ℝ)) (hC : ∀ z x, 0 ≤ C (z,x)) + {f : Lp ℝ 2 ν} (hf : 0 ≤ f) : 0 ≤ l2SectionOp ν C f := by + intro x + change 0 ≤ l2SectionOp ν C f x + rw [l2SectionOp_apply] + apply integral_nonneg_of_ae + filter_upwards [(Lp.coeFn_nonneg f).mpr hf] with z hz + exact mul_nonneg (hC z x) hz + +def l2Op (C : C(X × X, ℝ)) : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν := + (ContinuousMap.toLp 2 ν ℝ).comp (l2SectionOp ν C) + +lemma l2Op_nonneg (C : C(X × X, ℝ)) (hC : ∀ z x, 0 ≤ C (z,x)) + {f : Lp ℝ 2 ν} (hf : 0 ≤ f) : 0 ≤ l2Op ν C f := by + apply (Lp.coeFn_nonneg _).mp + have he := ContinuousMap.coeFn_toLp (p := 2) (𝕜 := ℝ) ν (l2SectionOp ν C f) + filter_upwards [he] with x hx + exact (l2SectionOp_nonneg ν C hC hf x).trans_eq hx.symm + + + +theorem exists_superharmonic (C : C(X × X, ℝ)) (hC : ∀ z x, 0 ≤ C (z,x)) + (hn : ‖l2Op ν C‖ < 1) : + ∃ f : C(X, ℝ), (∀ x, 1 ≤ f x) ∧ kernelOp ν C f = f - 1 := by + let a := ContinuousMap.toLp 2 ν ℝ (1 : C(X, ℝ)) + let g := resolvent (l2Op ν C) a + let f : C(X, ℝ) := 1 + l2SectionOp ν C g + have ha : 0 ≤ a := by + apply (Lp.coeFn_nonneg _).mp + filter_upwards [ContinuousMap.coeFn_toLp (p := 2) (𝕜 := ℝ) ν (1 : C(X, ℝ))] with x hx + change 0 ≤ (ContinuousMap.toLp 2 ν ℝ (1 : C(X, ℝ))) x + rw [hx] + exact zero_le_one + have hg : 0 ≤ g := resolvent_nonneg _ hn (fun v hv => l2Op_nonneg ν C hC hv) ha + have hf : ContinuousMap.toLp 2 ν ℝ f = g := by + have he := congrArg (fun T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν => T a) + (resolvent_left (l2Op ν C) hn) + simp only [mul_apply_eq_comp, sub_apply, one_apply_eq_self] at he + change g - l2Op ν C g = a at he + dsimp only [f] + rw [map_add] + change a + l2Op ν C g = g + exact (sub_eq_iff_eq_add.mp he).symm + refine ⟨f, ?_, ?_⟩ + · intro x + have hp := l2SectionOp_nonneg ν C hC hg x + change 0 ≤ l2SectionOp ν C g x at hp + change 1 ≤ 1 + l2SectionOp ν C g x + linarith + · rw [← l2SectionOp_toLp, hf] + dsimp only [f] + abel + +end StrictHotSpots.CompactKernel + + +namespace StrictHotSpots.CompactKernel +open MeasureTheory Filter Set TopologicalSpace BanachResolvent +open scoped Topology ENNReal +variable {X : Type} [MetricSpace X] [CompactSpace X] [MeasurableSpace X] + [BorelSpace X] (ν : Measure X) [IsFiniteMeasure ν] + +def invMap (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) : C(X, ℝ) := + ⟨fun x => (f x)⁻¹, f.continuous.inv₀ (fun x => (hf x).ne')⟩ + +def scaledKernel (C : C(X × X, ℝ)) (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) : + C(X × X, ℝ) := + ⟨fun p => C p * f p.1 / f p.2, + (C.continuous.mul (f.continuous.comp continuous_fst)).div + (f.continuous.comp continuous_snd) (fun p => (hf p.2).ne')⟩ + +omit [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma scaledKernel_pos (C : C(X × X, ℝ)) (hC : ∀ z x, 0 < C (z,x)) + (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) (z x : X) : + 0 < scaledKernel C f hf (z,x) := div_pos (mul_pos (hC z x) (hf z)) (hf x) + +lemma kernelOp_scaled (C : C(X × X, ℝ)) (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) + (u : C(X, ℝ)) : + kernelOp ν (scaledKernel C f hf) u = invMap f hf * kernelOp ν C (f*u) := by + ext x + simp only [kernelOp_apply, ContinuousMap.mul_apply] + change (∫ z, (C (z,x) * f z / f x) * u z ∂ν) = + (f x)⁻¹ * ∫ z, C (z,x) * (f z * u z) ∂ν + rw [← integral_const_mul] + apply integral_congr_ae + exact Eventually.of_forall fun z => by ring + +omit [BorelSpace X] [IsFiniteMeasure ν] in +lemma sampleOp_scaled (π : SimpleFunc X X) (C : C(X × X, ℝ)) + (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) (u : C(X, ℝ)) : + sampleOp ν π (scaledKernel C f hf) u = invMap f hf * sampleOp ν π C (f*u) := by + ext x + simp only [sampleOp_apply, ContinuousMap.mul_apply] + change (∑ z ∈ π.range, ν.real (π ⁻¹' {z}) * (C (z,x) * f z / f x) * u z) = + (f x)⁻¹ * ∑ z ∈ π.range, ν.real (π ⁻¹' {z}) * C (z,x) * (f z * u z) + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro z hz + ring + +omit [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma mul_invMap (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) : f * invMap f hf = 1 := by + ext x + exact mul_inv_cancel₀ (hf x).ne' + +omit [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma invMap_mul_cancel (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) (u : C(X, ℝ)) : + f * (invMap f hf * u) = u := by rw [← mul_assoc, mul_invMap, one_mul] + + + +def rescaledKernel (C : C(X × X, ℝ)) (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) + (A : C(X, ℝ) →L[ℝ] C(X, ℝ)) (x y : X) : ℝ := + f x * resolvent A (invMap f hf * C.curry y) x + +lemma scaled_row_bound [Nonempty X] (C : C(X × X, ℝ)) + (f : C(X, ℝ)) (hf : ∀ x, 1 ≤ f x) (he : kernelOp ν C f = f - 1) : + 0 ≤ 1 - ‖f‖⁻¹ ∧ 1 - ‖f‖⁻¹ < 1 ∧ + ∀ x, ∫ z, scaledKernel C f (fun x => (hf x).trans_lt' zero_lt_one) (z,x) ∂ν + ≤ 1 - ‖f‖⁻¹ := by + have hfn : 1 ≤ ‖f‖ := by + obtain ⟨x⟩ := ‹Nonempty X› + exact (hf x).trans ((le_abs_self _).trans (f.norm_coe_le_norm x)) + have hfnpos : 0 < ‖f‖ := lt_of_lt_of_le zero_lt_one hfn + refine ⟨sub_nonneg.mpr (inv_le_one_of_one_le₀ hfn), by linarith [inv_pos.mpr hfnpos], ?_⟩ + intro x + have hx : 0 < f x := lt_of_lt_of_le zero_lt_one (hf x) + have hfx : f x ≤ ‖f‖ := (le_abs_self _).trans (f.norm_coe_le_norm x) + have hxf := inv_anti₀ hx hfx + have hr := congrArg (fun u : C(X, ℝ) => u x) + (kernelOp_scaled ν C f (fun x => lt_of_lt_of_le zero_lt_one (hf x)) 1) + simp only [mul_one, he, ContinuousMap.mul_apply, ContinuousMap.sub_apply, + ContinuousMap.one_apply, kernelOp_apply] at hr + change (∫ z, scaledKernel C f _ (z,x) ∂ν) = (f x)⁻¹ * (f x - 1) at hr + rw [hr, mul_sub, inv_mul_cancel₀ hx.ne', mul_one] + linarith + +end StrictHotSpots.CompactKernel + +namespace StrictHotSpots.CompactKernel +open MeasureTheory Filter Set TopologicalSpace BanachResolvent ReciprocalKernel +open scoped Topology ENNReal +variable {X : Type} [MetricSpace X] [CompactSpace X] [MeasurableSpace X] + [BorelSpace X] (ν : Measure X) [IsFiniteMeasure ν] + + +def l2ResolvedKernel (C : C(X × X, ℝ)) (x y : X) : ℝ := + C (y,x) + l2SectionOp ν C + (resolvent (l2Op ν C) (ContinuousMap.toLp 2 ν ℝ (C.curry y))) x + +omit [MeasurableSpace X] [BorelSpace X] in +lemma scaled_solution (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) + (A B : C(X, ℝ) →L[ℝ] C(X, ℝ)) (hB : ‖B‖ < 1) + (hscale : ∀ u, B u = invMap f hf * A (f * u)) + {u v : C(X, ℝ)} (heq : u - A u = v) : + u = f * resolvent B (invMap f hf * v) := by + have h : invMap f hf * u - B (invMap f hf * u) = invMap f hf * v := by + rw [hscale, invMap_mul_cancel, ← mul_sub, heq] + have hr := congrArg (fun z : C(X, ℝ) => f * z) (resolvent_solution B hB h) + rwa [invMap_mul_cancel] at hr + +lemma rescaledKernel_eq_l2ResolvedKernel (C : C(X × X, ℝ)) + (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) + (hL : ‖l2Op ν C‖ < 1) (hC : ‖kernelOp ν (scaledKernel C f hf)‖ < 1) + (x y : X) : + rescaledKernel C f hf (kernelOp ν (scaledKernel C f hf)) x y = + l2ResolvedKernel ν C x y := by + let g := resolvent (l2Op ν C) (ContinuousMap.toLp 2 ν ℝ (C.curry y)) + let u : C(X, ℝ) := C.curry y + l2SectionOp ν C g + have hg : ContinuousMap.toLp 2 ν ℝ u = g := by + have he := congrArg (fun T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν => + T (ContinuousMap.toLp 2 ν ℝ (C.curry y))) (resolvent_left (l2Op ν C) hL) + simp only [mul_apply_eq_comp, sub_apply, one_apply_eq_self] at he + change g - l2Op ν C g = ContinuousMap.toLp 2 ν ℝ (C.curry y) at he + change ContinuousMap.toLp 2 ν ℝ (C.curry y + l2SectionOp ν C g) = g + rw [map_add] + exact (sub_eq_iff_eq_add.mp he).symm + have hu : u - kernelOp ν C u = C.curry y := by + rw [← l2SectionOp_toLp, hg] + dsimp only [u] + abel + have hu' := scaled_solution f hf (kernelOp ν C) + (kernelOp ν (scaledKernel C f hf)) hC (kernelOp_scaled ν C f hf) hu + have h := congrArg (fun v : C(X, ℝ) => v x) hu' + exact h.symm + +lemma l2ResolvedKernel_ge (C : C(X × X, ℝ)) (hC : ∀ z x, 0 ≤ C (z,x)) + (hn : ‖l2Op ν C‖ < 1) (x y : X) : + C (y,x) ≤ l2ResolvedKernel ν C x y := by + have hy : 0 ≤ ContinuousMap.toLp 2 ν ℝ (C.curry y) := by + apply (Lp.coeFn_nonneg _).mp + filter_upwards [ContinuousMap.coeFn_toLp (p := 2) (𝕜 := ℝ) ν (C.curry y)] with z hz + rw [hz] + exact hC y z + have hp := l2SectionOp_nonneg ν C hC + (resolvent_nonneg (l2Op ν C) hn (fun v hv => l2Op_nonneg ν C hC hv) hy) x + exact le_add_of_nonneg_right hp + +omit [BorelSpace X] [IsFiniteMeasure ν] in + + +lemma sampled_rescaled_reciprocal (π : SimpleFunc X X) (C : C(X × X, ℝ)) + (hC : ∀ z x, 0 < C (z,x)) (hsym : ∀ x y, C (x,y) = C (y,x)) + (hP : ∀ (ι : Type) [Fintype ι] (s : ι → X), + OnePositiveSquare (Matrix.of fun i j => (C (s i,s j))⁻¹)) + (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) + {d : ℝ} (hd : 0 ≤ d) (hd1 : d < 1) + (hrow : ∀ x, sampleOp ν π (scaledKernel C f hf) 1 x ≤ d) + {ι : Type} [Fintype ι] (s : ι → X) : + (∀ i j, 0 < rescaledKernel C f hf (sampleOp ν π (scaledKernel C f hf)) (s i) (s j)) ∧ + OnePositiveSquare (Matrix.of fun i j => + (rescaledKernel C f hf (sampleOp ν π (scaledKernel C f hf)) (s i) (s j))⁻¹) := by + classical + let t : ι ⊕ π.range → X := Sum.elim s Subtype.val + let w : ι ⊕ π.range → ℝ := Sum.elim (fun _ => 0) (fun z => ν.real (π ⁻¹' {z.val})) + let M : Matrix (ι ⊕ π.range) (ι ⊕ π.range) ℝ := Matrix.of fun i j => C (t j,t i) + have hM : M.IsSymm := by ext i j; exact hsym _ _ + have hp : ∀ i j, 0 < M i j := fun i j => hC _ _ + have hrec : OnePositiveSquare (Matrix.of fun i j => (M i j)⁻¹) := by + have he : (Matrix.of fun i j => (M i j)⁻¹) = + (Matrix.of fun i j => (C (t i,t j))⁻¹) := by ext i j; simp [M, hsym] + rw [he] + exact hP _ t + have hw : ∀ i, 0 ≤ w i := by intro i; cases i <;> simp [w, measureReal_nonneg] + have hsum (i : ι ⊕ π.range) (v : C(X, ℝ)) : + ∑ j, M i j * w j * v (t j) = sampleOp ν π C v (t i) := by + simp only [Fintype.sum_sum_type, M, w, t, Sum.elim_inl, Sum.elim_inr, + Matrix.of_apply, mul_zero, zero_mul, Finset.sum_const_zero, zero_add, + sampleOp_apply] + rw [Finset.sum_subtype π.range (fun _ => Iff.rfl)] + apply Finset.sum_congr rfl + intro z hz + ring + have hb : ∀ i, ∑ j ∈ Finset.univ, M i j * w j * f (t j) < f (t i) := by + intro i + rw [hsum] + have he := congrArg (fun v : C(X, ℝ) => f * v) (sampleOp_scaled ν π C f hf 1) + rw [mul_one, invMap_mul_cancel] at he + have hx := congrArg (fun v : C(X, ℝ) => v (t i)) he + change f (t i) * sampleOp ν π (scaledKernel C f hf) 1 (t i) = sampleOp ν π C f (t i) at hx + rw [← hx] + exact (mul_le_mul_of_nonneg_left (hrow (t i)) (hf _).le).trans_lt + (by simpa using (mul_lt_mul_of_pos_left hd1 (hf (t i)))) + obtain ⟨R,hRs,hRp,hRrec,hReq⟩ := finite_resolvent_of_superharmonic + hM hp hrec hw (fun i => hf (t i)) Finset.univ hb + have hn : ‖sampleOp ν π (scaledKernel C f hf)‖ < 1 := + (sampleOp_norm_le ν π _ (fun z x => (scaledKernel_pos C hC f hf z x).le) hd hrow).trans_lt hd1 + have hmatch (j : ι ⊕ π.range) : ∀ i, + R i j = rescaledKernel C f hf (sampleOp ν π (scaledKernel C f hf)) (t i) (t j) := by + let u : C(X, ℝ) := C.curry (t j) + + ∑ z : π.range, (ν.real (π ⁻¹' {z.val}) * R (Sum.inr z) j) • C.curry z.val + have hu (i : ι ⊕ π.range) : u (t i) = R i j := by + rw [hReq i j] + simp only [u, ContinuousMap.add_apply, ContinuousMap.sum_apply, + ContinuousMap.smul_apply, ContinuousMap.curry_apply, smul_eq_mul, + Fintype.sum_sum_type, M, w, t, Sum.elim_inl, Sum.elim_inr, + Matrix.of_apply, mul_zero, zero_mul, Finset.sum_const_zero, zero_add] + congr 1 + apply Finset.sum_congr rfl + intro z hz + ring + have he : u - sampleOp ν π C u = C.curry (t j) := by + ext x + simp only [ContinuousMap.sub_apply, sampleOp_apply] + rw [Finset.sum_subtype π.range (fun _ => Iff.rfl)] + have hz (z : π.range) : u z.val = R (Sum.inr z) j := hu (Sum.inr z) + simp only [hz, u, ContinuousMap.add_apply, ContinuousMap.sum_apply, + ContinuousMap.smul_apply, ContinuousMap.curry_apply, smul_eq_mul] + have hsum' : (∑ z : π.range, (ν.real (π ⁻¹' {↑z}) * R (Sum.inr z) j) * C (↑z,x)) = + ∑ z : π.range, ν.real (π ⁻¹' {↑z}) * C (↑z,x) * R (Sum.inr z) j := by + apply Finset.sum_congr rfl + intro z hz + ring + rw [hsum'] + abel + have he' := scaled_solution f hf (sampleOp ν π C) + (sampleOp ν π (scaledKernel C f hf)) hn (sampleOp_scaled ν π C f hf) he + intro i + rw [← hu i, he'] + rfl + refine ⟨fun i j => ?_, ?_⟩ + · simpa only [t, Sum.elim_inl, hmatch] using hRp (Sum.inl i) (Sum.inl j) + · have hsub := onePositiveSquare_submatrix_sum_inl hRrec + convert hsub using 1 + ext i j + simp only [Matrix.submatrix_apply, Matrix.of_apply, hmatch, t, Sum.elim_inl] + +lemma rescaledKernel_tendsto [Nonempty X] (C : C(X × X, ℝ)) + (hC : ∀ z x, 0 ≤ C (z,x)) (f : C(X, ℝ)) (hf : ∀ x, 0 < f x) + {d : ℝ} (hd : 0 ≤ d) (hd1 : d < 1) + (hrow : ∀ x, ∫ z, scaledKernel C f hf (z,x) ∂ν ≤ d) (x y : X) : + Tendsto (fun n => rescaledKernel C f hf (sampleOp ν (quantize n) (scaledKernel C f hf)) x y) atTop + (𝓝 (rescaledKernel C f hf (kernelOp ν (scaledKernel C f hf)) x y)) := by + have hp (z x : X) : 0 ≤ scaledKernel C f hf (z,x) := + div_nonneg (mul_nonneg (hC z x) (hf z).le) (hf x).le + have hn := kernelOp_norm_le ν (scaledKernel C f hf) hp hd hrow + have hh := BanachResolvent.resolvent_strong_tendsto (kernelOp ν (scaledKernel C f hf)) + (fun n => sampleOp ν (quantize n) (scaledKernel C f hf)) + (d := (1+d)/2) (by linarith) (hn.trans_lt hd1) + (sampleOp_eventually_norm_le ν (scaledKernel C f hf) hp hd (by linarith) hrow) + (sampleOp_strong_tendsto ν (scaledKernel C f hf)) (invMap f hf * C.curry y) + exact (((ContinuousMap.evalCLM ℝ x).continuous.tendsto _).comp hh).const_mul (f x) + +end StrictHotSpots.CompactKernel + +namespace StrictHotSpots.CompactKernel +open MeasureTheory Filter Set TopologicalSpace BanachResolvent ReciprocalKernel +open scoped Topology ENNReal +variable {X : Type} [MetricSpace X] [CompactSpace X] [MeasurableSpace X] + [BorelSpace X] (ν : Measure X) [IsFiniteMeasure ν] + + + + +theorem compact_reciprocal_of_l2_norm_lt_one [Nonempty X] (C : C(X × X, ℝ)) + (hC : ∀ z x, 0 < C (z,x)) (hsym : ∀ x y, C (x,y) = C (y,x)) + (hP : ∀ (ι : Type) [Fintype ι] (s : ι → X), + OnePositiveSquare (Matrix.of fun i j => (C (s i,s j))⁻¹)) + (hL : ‖l2Op ν C‖ < 1) + {ι : Type} [Fintype ι] (s : ι → X) : + (∀ i j, 0 < l2ResolvedKernel ν C (s i) (s j)) ∧ + OnePositiveSquare (Matrix.of fun i j => (l2ResolvedKernel ν C (s i) (s j))⁻¹) := by + obtain ⟨f,hf,heq⟩ := exists_superharmonic ν C (fun z x => (hC z x).le) hL + let hf' : ∀ x, 0 < f x := fun x => lt_of_lt_of_le zero_lt_one (hf x) + let C' := scaledKernel C f hf' + let d : ℝ := 1 - ‖f‖⁻¹ + obtain ⟨hd,hd1,hrow⟩ := scaled_row_bound ν C f hf heq + have hp' (z x : X) : 0 ≤ C' (z,x) := (scaledKernel_pos C hC f hf' z x).le + have hn : ‖kernelOp ν C'‖ < 1 := + (kernelOp_norm_le ν C' hp' hd hrow).trans_lt hd1 + have hkernel (x y : X) : rescaledKernel C f hf' (kernelOp ν C') x y = + l2ResolvedKernel ν C x y := rescaledKernel_eq_l2ResolvedKernel ν C f hf' hL hn x y + have hp (x y : X) : 0 < l2ResolvedKernel ν C x y := + (hC y x).trans_le (l2ResolvedKernel_ge ν C (fun z x => (hC z x).le) hL x y) + refine ⟨fun i j => hp _ _, ?_⟩ + have hev := sampleOp_eventually_norm_le ν C' hp' hd + (show d < (1+d)/2 by dsimp [d]; linarith) hrow + have hr : ∀ᶠ n in atTop, ∀ x, sampleOp ν (quantize n) C' 1 x ≤ (1+d)/2 := by + filter_upwards [hev] with n hnn x + calc + sampleOp ν (quantize n) C' 1 x ≤ ‖sampleOp ν (quantize n) C' 1 x‖ := le_abs_self _ + _ ≤ ‖sampleOp ν (quantize n) C' 1‖ := ContinuousMap.norm_coe_le_norm _ _ + _ ≤ ‖sampleOp ν (quantize n) C'‖ * ‖(1 : C(X, ℝ))‖ := ContinuousLinearMap.le_opNorm _ _ + _ ≤ (1+d)/2 := by simpa using hnn + obtain ⟨N,hN⟩ := eventually_atTop.mp hr + apply onePositiveSquare_of_entrywise_tendsto + (A := fun n => Matrix.of fun i j => + (rescaledKernel C f hf' (sampleOp ν (quantize (n+N)) C') (s i) (s j))⁻¹) + · intro n + exact (sampled_rescaled_reciprocal ν (quantize (n+N)) C hC hsym hP f hf' + (show 0 ≤ (1+d)/2 by dsimp [d]; linarith) + (show (1+d)/2 < 1 by dsimp [d]; linarith) + (hN _ (Nat.le_add_left _ _)) s).2 + · intro i j + have ht := rescaledKernel_tendsto ν C (fun z x => (hC z x).le) f hf' hd hd1 hrow (s i) (s j) + rw [hkernel] at ht + exact (ht.inv₀ (hp _ _).ne').comp (tendsto_add_atTop_nat N) + +lemma l2ResolvedKernel_eq_inner (C : C(X × X, ℝ)) + (hsym : ∀ x y, C (x,y) = C (y,x)) (x y : X) : + l2ResolvedKernel ν C x y = C (x,y) + + inner ℝ (ContinuousMap.toLp 2 ν ℝ (C.curry x)) + (resolvent (l2Op ν C) (ContinuousMap.toLp 2 ν ℝ (C.curry y))) := by + unfold l2ResolvedKernel + rw [hsym y x, l2SectionOp_apply, L2.inner_def] + congr 1 + apply integral_congr_ae + filter_upwards [ContinuousMap.coeFn_toLp (p := 2) (𝕜 := ℝ) ν (C.curry x)] with z hz + rw [hz] + change C (z,x) * _ = _ * C (x,z) + rw [hsym z x, mul_comm] + +end StrictHotSpots.CompactKernel + + + + +open MeasureTheory Filter +open scoped Topology ENNReal +namespace StrictHotSpots.L2Limits +variable {X : Type*} [MeasurableSpace X] {ν : Measure X} + +lemma norm_sq_eq_integral_sq (f : Lp ℝ 2 ν) : + ‖f‖ ^ 2 = ∫ x, (f x)^2 ∂ν := by + rw [← real_inner_self_eq_norm_sq, L2.inner_def] + change (∫ x, f x * f x ∂ν) = _ + simp only [pow_two] + +lemma norm_toLp_sub_sq {f g : X → ℝ} (hf : MemLp f 2 ν) (hg : MemLp g 2 ν) : + ‖hf.toLp f - hg.toLp g‖ ^ 2 = ∫ x, (f x - g x)^2 ∂ν := by + rw [norm_sq_eq_integral_sq] + apply integral_congr_ae + filter_upwards [Lp.coeFn_sub (hf.toLp f) (hg.toLp g), hf.coeFn_toLp, hg.coeFn_toLp] + with x hx hfx hgx + simp only [hx, hfx, hgx, Pi.sub_apply] + +lemma tendsto_toLp_of_dominated {ι : Type*} {l : Filter ι} [l.IsCountablyGenerated] + {f : ι → X → ℝ} {g b : X → ℝ} + (hf : ∀ n, MemLp (f n) 2 ν) (hg : MemLp g 2 ν) (hb : MemLp b 2 ν) + (hdom : ∀ᶠ n in l, ∀ᵐ x ∂ν, ‖f n x‖ ≤ b x) + (hlim : ∀ᵐ x ∂ν, Tendsto (fun n => f n x) l (𝓝 (g x))) : + Tendsto (fun n => (hf n).toLp (f n)) l (𝓝 (hg.toLp g)) := by + have ht : Tendsto (fun n => ∫ x, (f n x - g x)^2 ∂ν) l (𝓝 0) := by + have hm : ∀ᶠ n in l, AEStronglyMeasurable (fun x => (f n x-g x)^2) ν := + Eventually.of_forall fun n => ((hf n).sub hg).aestronglyMeasurable.pow 2 + have hd : ∀ᶠ n in l, ∀ᵐ x ∂ν, ‖(f n x-g x)^2‖ ≤ (b x+‖g x‖)^2 := by + filter_upwards [hdom] with n hn + filter_upwards [hn] with x hx + have h1 : ‖f n x-g x‖ ≤ b x+‖g x‖ := + by linarith [norm_sub_le (f n x) (g x)] + rw [Real.norm_eq_abs, abs_pow, ← Real.norm_eq_abs] + exact pow_le_pow_left₀ (norm_nonneg _) h1 2 + have hl : ∀ᵐ x ∂ν, Tendsto (fun n => (f n x-g x)^2) l (𝓝 (0 : ℝ)) := by + filter_upwards [hlim] with x hx + simpa using (hx.sub_const (g x)).pow 2 + simpa using tendsto_integral_filter_of_dominated_convergence + (fun x => (b x+‖g x‖)^2) hm hd (hb.add hg.norm).integrable_sq hl + have hs : Tendsto (fun n => ‖(hf n).toLp (f n)-hg.toLp g‖^2) l (𝓝 0) := by + simpa only [norm_toLp_sub_sq] using ht + rw [tendsto_iff_norm_sub_tendsto_zero] + have hr := Real.continuous_sqrt.continuousAt.tendsto.comp hs + simpa only [Function.comp_def, Real.sqrt_sq (norm_nonneg _), Real.sqrt_zero] using hr + +lemma tendsto_L2_of_dominated {ι : Type*} {l : Filter ι} [l.IsCountablyGenerated] + (f : ι → Lp ℝ 2 ν) (g b : Lp ℝ 2 ν) + (hdom : ∀ᶠ n in l, ∀ᵐ x ∂ν, ‖f n x‖ ≤ b x) + (hlim : ∀ᵐ x ∂ν, Tendsto (fun n => f n x) l (𝓝 (g x))) : + Tendsto f l (𝓝 g) := by + have ht := tendsto_toLp_of_dominated (fun n => Lp.memLp (f n)) (Lp.memLp g) + (Lp.memLp b) hdom hlim + simpa only [Lp.toLp_coeFn] using ht + +end StrictHotSpots.L2Limits + +namespace StrictHotSpots.CompactKernel +open MeasureTheory Filter Set BanachResolvent ReciprocalKernel +open scoped Topology ENNReal +variable {X : Type} [MetricSpace X] [CompactSpace X] [MeasurableSpace X] + [BorelSpace X] (ν : Measure X) [IsFiniteMeasure ν] + +lemma l2Op_ae_integral (C : C(X × X, ℝ)) (f : Lp ℝ 2 ν) : + ∀ᵐ x ∂ν, l2Op ν C f x = ∫ z, C (z,x) * f z ∂ν := by + filter_upwards [ContinuousMap.coeFn_toLp (p := 2) (𝕜 := ℝ) ν (l2SectionOp ν C f)] + with x hx + exact hx.trans (l2SectionOp_apply ν C f x) + +lemma l2Op_abs_domination (C : C(X × X, ℝ)) (hC : ∀ z x, 0 ≤ C (z,x)) + (G : X → X → ℝ) (hG : ∀ x, MemLp (fun z => G z x) 2 ν) + (hdom : ∀ x, ∀ᵐ z ∂ν, C (z,x) ≤ G z x) + (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) + (hT : ∀ f : Lp ℝ 2 ν, ∀ᵐ x ∂ν, T f x = ∫ z, G z x * f z ∂ν) + (f : Lp ℝ 2 ν) : |l2Op ν C f| ≤ T |f| := by + apply (Lp.coeFn_le _ _).mp + filter_upwards [l2Op_ae_integral ν C f, hT |f|, Lp.coeFn_abs (l2Op ν C f)] + with x hx htx hax + rw [hax, hx, htx] + calc + |∫ z, C (z,x) * f z ∂ν| ≤ ∫ z, ‖C (z,x) * f z‖ ∂ν := + by simpa only [Real.norm_eq_abs] using norm_integral_le_integral_norm (fun z => C (z,x) * f z) + _ ≤ ∫ z, G z x * (|f|) z ∂ν := by + apply integral_mono_ae + · exact (ContinuousMap.memLp (p := (2 : ℝ≥0∞)) ν ℝ + (⟨fun z => C (z,x), C.continuous.comp (continuous_id.prodMk continuous_const)⟩ : C(X,ℝ))).integrable_mul (Lp.memLp f) |>.norm + · exact (hG x).integrable_mul (Lp.memLp |f|) + · filter_upwards [hdom x, Lp.coeFn_abs f] with z hz hfz + rw [hfz, norm_mul, Real.norm_eq_abs, abs_of_nonneg (hC z x), Real.norm_eq_abs] + exact mul_le_mul_of_nonneg_right hz (abs_nonneg _) + +lemma norm_l2Op_le_of_domination (C : C(X × X, ℝ)) (hC : ∀ z x, 0 ≤ C (z,x)) + (G : X → X → ℝ) (hG : ∀ x, MemLp (fun z => G z x) 2 ν) + (hdom : ∀ x, ∀ᵐ z ∂ν, C (z,x) ≤ G z x) + (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) + (hT : ∀ f : Lp ℝ 2 ν, ∀ᵐ x ∂ν, T f x = ∫ z, G z x * f z ∂ν) : + ‖l2Op ν C‖ ≤ ‖T‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg T) + intro f + calc + ‖l2Op ν C f‖ ≤ ‖T |f|‖ := + norm_le_norm_of_abs_le_abs ((l2Op_abs_domination ν C hC G hG hdom T hT f).trans + (le_abs_self _)) + _ ≤ ‖T‖ * ‖f‖ := by simpa only [norm_abs_eq_norm] using T.le_opNorm |f| + +lemma l2Op_strong_tendsto_of_dominated + (C : ℕ → C(X × X, ℝ)) (hC : ∀ n z x, 0 ≤ C n (z,x)) + (G : X → X → ℝ) (hG : ∀ x, MemLp (fun z => G z x) 2 ν) + (hdom : ∀ n x, ∀ᵐ z ∂ν, C n (z,x) ≤ G z x) + (hlim : ∀ x, ∀ᵐ z ∂ν, Tendsto (fun n => C n (z,x)) atTop (𝓝 (G z x))) + (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) + (hT : ∀ f : Lp ℝ 2 ν, ∀ᵐ x ∂ν, T f x = ∫ z, G z x * f z ∂ν) + (f : Lp ℝ 2 ν) : + Tendsto (fun n => l2Op ν (C n) f) atTop (𝓝 (T f)) := by + apply L2Limits.tendsto_L2_of_dominated _ _ (T |f|) + · apply Eventually.of_forall + intro n + have hd := (Lp.coeFn_le _ _).mpr (l2Op_abs_domination ν (C n) (hC n) G hG + (hdom n) T hT f) + filter_upwards [hd, Lp.coeFn_abs (l2Op ν (C n) f)] with x hx hax + simpa only [hax, Real.norm_eq_abs] using hx + · have he : ∀ᵐ x ∂ν, ∀ n, l2Op ν (C n) f x = ∫ z, C n (z,x) * f z ∂ν := + ae_all_iff.mpr fun n => l2Op_ae_integral ν (C n) f + filter_upwards [he, hT f] with x hx htx + simp only [hx, htx] + apply tendsto_integral_of_dominated_convergence (fun z => G z x * ‖f z‖) + · intro n + exact ((C n).continuous.comp (continuous_id.prodMk continuous_const)).aestronglyMeasurable.mul + (Lp.aestronglyMeasurable f) + · exact (hG x).integrable_mul (Lp.memLp f).norm + · intro n + filter_upwards [hdom n x] with z hz + rw [norm_mul, Real.norm_eq_abs, abs_of_nonneg (hC n z x)] + exact mul_le_mul_of_nonneg_right hz (norm_nonneg _) + · filter_upwards [hlim x] with z hz + exact hz.mul_const (f z) + +end StrictHotSpots.CompactKernel + +namespace StrictHotSpots.BanachResolvent +open Filter +open scoped Topology +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + +lemma resolvent_strong_tendsto_moving (A : E →L[ℝ] E) (Q : ℕ → E →L[ℝ] E) + {d : ℝ} (hd : d < 1) (hA : ‖A‖ < 1) + (hQ : ∀ᶠ n in atTop, ‖Q n‖ ≤ d) + (hs : ∀ v, Tendsto (fun n => Q n v) atTop (𝓝 (A v))) + {v : ℕ → E} {w : E} (hv : Tendsto v atTop (𝓝 w)) : + Tendsto (fun n => resolvent (Q n) (v n)) atTop (𝓝 (resolvent A w)) := by + have hz : Tendsto (fun n => resolvent (Q n) (v n-w)) atTop (𝓝 0) := by + have hb : Tendsto (fun n => (1-d)⁻¹ * ‖v n-w‖) atTop (𝓝 0) := by + simpa using (hv.sub_const w).norm.const_mul (1-d)⁻¹ + apply squeeze_zero_norm' _ hb + filter_upwards [hQ] with n hn + exact (ContinuousLinearMap.le_opNorm _ _).trans + (mul_le_mul_of_nonneg_right (resolvent_norm_le (Q n) hn hd) (norm_nonneg _)) + have ht := hz.add (resolvent_strong_tendsto A Q hd hA hQ hs w) + simpa only [map_sub, sub_add_cancel, zero_add] using ht + +end StrictHotSpots.BanachResolvent + +namespace StrictHotSpots.CompactKernel +open MeasureTheory Filter Set BanachResolvent ReciprocalKernel +open scoped Topology ENNReal +variable {X : Type} [MetricSpace X] [CompactSpace X] [MeasurableSpace X] + [BorelSpace X] (ν : Measure X) [IsFiniteMeasure ν] + +lemma l2Sections_tendsto_of_dominated + (C : ℕ → C(X × X, ℝ)) (hC : ∀ n z x, 0 ≤ C n (z,x)) + (hsym : ∀ n x y, C n (x,y) = C n (y,x)) + (G : X → X → ℝ) (hG : ∀ x, MemLp (fun z => G z x) 2 ν) + (hdom : ∀ n x, ∀ᵐ z ∂ν, C n (z,x) ≤ G z x) + (hlim : ∀ x, ∀ᵐ z ∂ν, Tendsto (fun n => C n (z,x)) atTop (𝓝 (G z x))) + (x : X) : + Tendsto (fun n => ContinuousMap.toLp 2 ν ℝ ((C n).curry x)) atTop + (𝓝 ((hG x).toLp (fun z => G z x))) := by + apply L2Limits.tendsto_L2_of_dominated _ _ ((hG x).toLp (fun z => G z x)) + · apply Eventually.of_forall + intro n + filter_upwards [ContinuousMap.coeFn_toLp (p := 2) (𝕜 := ℝ) ν ((C n).curry x), + (hG x).coeFn_toLp, hdom n x] with z hz hgz hdz + rw [hz, hgz] + change ‖C n (x,z)‖ ≤ G z x + rw [hsym n x z, Real.norm_eq_abs, abs_of_nonneg (hC n z x)] + exact hdz + · have he : ∀ᵐ z ∂ν, ∀ n, + ContinuousMap.toLp 2 ν ℝ ((C n).curry x) z = C n (x,z) := + ae_all_iff.mpr fun n => ContinuousMap.coeFn_toLp (p := 2) (𝕜 := ℝ) ν ((C n).curry x) + filter_upwards [he, (hG x).coeFn_toLp, hlim x] with z hz hgz hlz + simpa only [hz, hgz, hsym] using hlz + + + +def singularResolvedKernel (G : X → X → ℝ) + (hG : ∀ x, MemLp (fun z => G z x) 2 ν) + (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) (x y : X) : ℝ := + G x y + inner ℝ ((hG x).toLp (fun z => G z x)) + (resolvent T ((hG y).toLp (fun z => G z y))) + +lemma l2ResolvedKernel_tendsto_of_dominated + (C : ℕ → C(X × X, ℝ)) (hC : ∀ n z x, 0 ≤ C n (z,x)) + (hsym : ∀ n x y, C n (x,y) = C n (y,x)) + (G : X → X → ℝ) (hG : ∀ x, MemLp (fun z => G z x) 2 ν) + (hdom : ∀ n x, ∀ᵐ z ∂ν, C n (z,x) ≤ G z x) + (hlim : ∀ x, ∀ᵐ z ∂ν, Tendsto (fun n => C n (z,x)) atTop (𝓝 (G z x))) + (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) + (hT : ∀ f : Lp ℝ 2 ν, ∀ᵐ x ∂ν, T f x = ∫ z, G z x * f z ∂ν) + (hsub : ‖T‖ < 1) (x y : X) + (hxy : Tendsto (fun n => C n (x,y)) atTop (𝓝 (G x y))) : + Tendsto (fun n => l2ResolvedKernel ν (C n) x y) atTop + (𝓝 (singularResolvedKernel ν G hG T x y)) := by + have hs := l2Sections_tendsto_of_dominated ν C hC hsym G hG hdom hlim + have hop := l2Op_strong_tendsto_of_dominated ν C hC G hG hdom hlim T hT + have hb : ∀ᶠ n in atTop, ‖l2Op ν (C n)‖ ≤ ‖T‖ := + Eventually.of_forall fun n => norm_l2Op_le_of_domination ν (C n) (hC n) G hG + (hdom n) T hT + have hr := resolvent_strong_tendsto_moving T (fun n => l2Op ν (C n)) + hsub hsub hb hop (hs y) + have ht := hxy.add ((hs x).inner hr) + simpa only [singularResolvedKernel, l2ResolvedKernel_eq_inner ν _ (hsym _)] using ht + +lemma singularResolvedKernel_ge + (C : ℕ → C(X × X, ℝ)) (hC : ∀ n z x, 0 ≤ C n (z,x)) + (hsym : ∀ n x y, C n (x,y) = C n (y,x)) + (G : X → X → ℝ) (hG : ∀ x, MemLp (fun z => G z x) 2 ν) + (hdom : ∀ n x, ∀ᵐ z ∂ν, C n (z,x) ≤ G z x) + (hlim : ∀ x, ∀ᵐ z ∂ν, Tendsto (fun n => C n (z,x)) atTop (𝓝 (G z x))) + (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) + (hT : ∀ f : Lp ℝ 2 ν, ∀ᵐ x ∂ν, T f x = ∫ z, G z x * f z ∂ν) + (hsub : ‖T‖ < 1) (x y : X) + (hxy : Tendsto (fun n => C n (x,y)) atTop (𝓝 (G x y))) : + G x y ≤ singularResolvedKernel ν G hG T x y := by + apply le_of_tendsto_of_tendsto hxy + (l2ResolvedKernel_tendsto_of_dominated ν C hC hsym G hG hdom hlim T hT hsub x y hxy) + exact Eventually.of_forall fun n => by + dsimp only + rw [hsym n x y] + exact l2ResolvedKernel_ge ν (C n) (hC n) + ((norm_l2Op_le_of_domination ν (C n) (hC n) G hG (hdom n) T hT).trans_lt hsub) x y + + + + + +theorem singular_reciprocal_of_regularization [Nonempty X] [DecidableEq X] + (C : ℕ → C(X × X, ℝ)) (hC : ∀ n z x, 0 < C n (z,x)) + (hsym : ∀ n x y, C n (x,y) = C n (y,x)) + (hP : ∀ n (ι : Type) [Fintype ι] (s : ι → X), + OnePositiveSquare (Matrix.of fun i j => (C n (s i,s j))⁻¹)) + (G : X → X → ℝ) (hG : ∀ x, MemLp (fun z => G z x) 2 ν) + (hpos : ∀ x y, x ≠ y → 0 < G x y) + (hdom : ∀ n x, ∀ᵐ z ∂ν, C n (z,x) ≤ G z x) + (hlim : ∀ x, ∀ᵐ z ∂ν, Tendsto (fun n => C n (z,x)) atTop (𝓝 (G z x))) + (hoff : ∀ x y, x ≠ y → Tendsto (fun n => C n (x,y)) atTop (𝓝 (G x y))) + (hdiag : ∀ x, Tendsto (fun n => C n (x,x)) atTop atTop) + (T : Lp ℝ 2 ν →L[ℝ] Lp ℝ 2 ν) + (hT : ∀ f : Lp ℝ 2 ν, ∀ᵐ x ∂ν, T f x = ∫ z, G z x * f z ∂ν) + (hsub : ‖T‖ < 1) {ι : Type} [Fintype ι] (s : ι → X) : + OnePositiveSquare (Matrix.of fun i j => + if s i = s j then 0 else (singularResolvedKernel ν G hG T (s i) (s j))⁻¹) := by + classical + have hCn : ∀ n z x, 0 ≤ C n (z,x) := fun n z x => (hC n z x).le + have hb (n : ℕ) : ‖l2Op ν (C n)‖ < 1 := + (norm_l2Op_le_of_domination ν (C n) (hCn n) G hG (hdom n) T hT).trans_lt hsub + apply onePositiveSquare_of_entrywise_tendsto + (A := fun n => Matrix.of fun i j => (l2ResolvedKernel ν (C n) (s i) (s j))⁻¹) + · intro n + exact (compact_reciprocal_of_l2_norm_lt_one ν (C n) (hC n) (hsym n) (hP n) (hb n) s).2 + · intro i j + dsimp only [Matrix.of_apply] + split_ifs with hij + · have ht : Tendsto (fun n => l2ResolvedKernel ν (C n) (s i) (s j)) atTop atTop := by + apply tendsto_atTop_mono _ (hdiag (s i)) + + intro n + simpa only [← hij] using l2ResolvedKernel_ge ν (C n) (hCn n) (hb n) (s i) (s i) + exact tendsto_inv_atTop_zero.comp ht + · have hp := (hpos (s i) (s j) hij).trans_le + (singularResolvedKernel_ge ν C hCn hsym G hG hdom hlim T hT hsub + (s i) (s j) (hoff (s i) (s j) hij)) + exact (l2ResolvedKernel_tendsto_of_dominated ν C hCn hsym G hG hdom hlim T hT hsub + (s i) (s j) (hoff (s i) (s j) hij)).inv₀ hp.ne' + +end StrictHotSpots.CompactKernel + +end SingularLayer + + +end FullBoundaryCombinedLayer + +end + +end DouglasLipschitzBase + +section DouglasLipschitzBase +noncomputable section +section FullBoundaryCombinedLayer +section SquaredDistanceKernelLayer +noncomputable section +open Set Filter Topology +open scoped BigOperators InnerProductSpace +open scoped NNReal +namespace SquaredDistanceKernel + +universe u +variable {X : Type u} + + +def ConditionallyNegative (D : Matrix X X ℝ) : Prop := + D.IsHermitian ∧ (∀ x, D x x = 0) ∧ + ∀ c : X →₀ ℝ, c.sum (fun _ a => a) = 0 → + c.sum (fun x a => c.sum (fun y b => a * D x y * b)) ≤ 0 + +def anchored (D : Matrix X X ℝ) (o : X) : Matrix X X ℝ := + Matrix.of fun x y => (D x o + D y o - D x y) / 2 + +lemma anchor_sum_identity (D : X → X → ℝ) (o : X) (c : X →₀ ℝ) : (c.sum (fun x a => c.sum (fun y b => a * ((D x o + D y o - D x y) / 2) * b))) = + ((c.sum (fun x a => a * D x o * (c.sum fun _ b => b))) + + (c.sum (fun y b => (c.sum fun _ a => a) * D y o * b)) - + (c.sum (fun x a => c.sum (fun y b => a * D x y * b)))) / 2 := by + calc + _ = c.sum (fun x a => c.sum (fun y b => + (a * D x o * b + a * D y o * b - a * D x y * b) / 2)) := by + apply Finsupp.sum_congr + intro x hx + apply Finsupp.sum_congr + intro y hy + ring + _ = _ := by + simp only [Finsupp.sum] + simp only [← Finset.sum_div, Finset.sum_add_distrib, Finset.sum_sub_distrib] + congr 2 + congr 1 + · simp only [← Finset.mul_sum] + · rw [Finset.sum_comm] + simp only [← Finset.sum_mul] + +lemma anchored_posSemidef {D : Matrix X X ℝ} (hD : ConditionallyNegative D) (o : X) : + (anchored D o).PosSemidef := by + classical + have hs (x y : X) : D x y = D y x := by + simpa using (hD.1.apply x y).symm + refine ⟨?_, ?_⟩ + · ext x y + simp [Matrix.conjTranspose_apply, anchored, hs y x, add_comm] + · intro c + change 0 ≤ c.sum (fun x a => c.sum (fun y b => a * ((D x o + D y o - D x y) / 2) * b)) + let m := c.sum (fun _ a => a) + have hm : (c - Finsupp.single o m).sum (fun _ a => a) = 0 := by + simp [Finsupp.sum_sub_index, m] + have hh := hD.2.2 (c - Finsupp.single o m) hm + simp [Finsupp.sum_sub_index, sub_mul, mul_sub, Finsupp.sum_sub, + zero_mul, mul_zero, Finsupp.sum_single_index, + hD.2.1, hs o, sub_zero] at hh + dsimp [m] at hh + rw [anchor_sum_identity (fun x y => D x y) o c] + linarith + +def lifted (G : Matrix X X ℝ) : Matrix X X (ℝ →L[ℝ] ℝ) := + Matrix.of fun x y => G x y • ContinuousLinearMap.id ℝ ℝ + +lemma lifted_posSemidef {G : Matrix X X ℝ} (hG : G.PosSemidef) : + (lifted G).PosSemidef := by + have hs (x y : X) : G y x = G x y := by simpa using hG.1.apply x y + apply (RKHS.posSemidef_tfae.out 1 3).mpr + refine ⟨?_, ?_⟩ + · ext x y + simp [Matrix.conjTranspose_apply, lifted, star_smul, + ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_id, hs] + · intro c + simpa [lifted, RCLike.inner_apply, hs, mul_comm, mul_left_comm, mul_assoc] using hG.2 c + +lemma positive_kernel_realization {G : Matrix X X ℝ} (hG : G.PosSemidef) : + ∃ (H : Type u) (_ : NormedAddCommGroup H) (_ : InnerProductSpace ℝ H) + (_ : CompleteSpace H) (b : X → H), ∀ x y, inner ℝ (b x) (b y) = G x y := by + let K := lifted G + let : Fact K.PosSemidef := ⟨lifted_posSemidef hG⟩ + let H := RKHS.OfKernel K + refine ⟨H, inferInstance, inferInstance, inferInstance, fun x => RKHS.kerFun H x 1, ?_⟩ + intro x y + rw [← RKHS.kernel_inner] + change inner ℝ (RKHS.kernel (RKHS.OfKernel K) y x 1) 1 = G x y + rw [RKHS.OfKernel.kernel_ofKernel (K := K)] + simp [K, lifted, RCLike.inner_apply, + show G y x = G x y by simpa using hG.1.apply x y] +lemma squared_distance_realization {D : Matrix X X ℝ} + (hD : ConditionallyNegative D) (o : X) : + ∃ (H : Type u) (_ : NormedAddCommGroup H) (_ : InnerProductSpace ℝ H) + (_ : CompleteSpace H) (b : X → H), ∀ x y, ‖b x - b y‖ ^ 2 = D x y := by + obtain ⟨H, hn, hi, hc, b, hb⟩ := positive_kernel_realization (anchored_posSemidef hD o) + let := hn + let := hi + let := hc + refine ⟨H, hn, hi, hc, b, ?_⟩ + intro x y + rw [norm_sub_sq_real, ← real_inner_self_eq_norm_sq, ← real_inner_self_eq_norm_sq, + hb, hb, hb] + simp only [anchored, Matrix.of_apply, hD.2.1] + ring + +lemma injective_of_distance_positive {H : Type*} [NormedAddCommGroup H] + {D : Matrix X X ℝ} {b : X → H} (hb : ∀ x y, ‖b x - b y‖ ^ 2 = D x y) + (hpos : ∀ x y, x ≠ y → 0 < D x y) : Function.Injective b := by + intro x y heq + by_contra hne + have hh := hpos x y hne + rw [← hb x y, heq, sub_self, norm_zero, zero_pow (by decide)] at hh + exact lt_irrefl _ hh + +lemma lipschitz_of_distance_bound [PseudoMetricSpace X] {H : Type*} + [NormedAddCommGroup H] {D : Matrix X X ℝ} {b : X → H} {C : ℝ≥0} + (hb : ∀ x y, ‖b x - b y‖ ^ 2 = D x y) + (hbound : ∀ x y, D x y ≤ C ^ 2 * dist x y ^ 2) : LipschitzWith C b := by + apply LipschitzWith.of_dist_le_mul + intro x y + rw [dist_eq_norm] + apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg C.coe_nonneg dist_nonneg)).mp + rw [mul_pow, hb] + exact hbound x y + + + + +lemma separable_lipschitz_embedding [PseudoMetricSpace X] + [TopologicalSpace.SeparableSpace X] {D : Matrix X X ℝ} + (hD : ConditionallyNegative D) (o : X) {C : ℝ≥0} + (hpos : ∀ x y, x ≠ y → 0 < D x y) + (hbound : ∀ x y, D x y ≤ (C : ℝ) ^ 2 * dist x y ^ 2) : + ∃ (H : Type u) (_ : NormedAddCommGroup H) (_ : InnerProductSpace ℝ H) + (_ : CompleteSpace H) (_ : TopologicalSpace.SeparableSpace H) (b : X → H), + Function.Injective b ∧ LipschitzWith C b ∧ ∀ x y, ‖b x - b y‖ ^ 2 = D x y := by + obtain ⟨H, hn, hi, hc, b, hb⟩ := squared_distance_realization hD o + let := hn + let := hi + let := hc + have hl := lipschitz_of_distance_bound hb hbound + let S := (Submodule.span ℝ (Set.range b)).topologicalClosure + have hsep : TopologicalSpace.IsSeparable (S : Set H) := by + rw [Submodule.topologicalClosure_coe] + exact ((TopologicalSpace.isSeparable_range hl.continuous).span (R := ℝ)).closure + let := hsep.separableSpace + let b' : X → S := fun x => ⟨b x, + (Submodule.span ℝ (Set.range b)).le_topologicalClosure (Submodule.subset_span ⟨x, rfl⟩)⟩ + have hb' (x y : X) : ‖b' x - b' y‖ ^ 2 = D x y := hb x y + refine ⟨S, inferInstance, inferInstance, inferInstance, inferInstance, b', + injective_of_distance_positive hb' hpos, lipschitz_of_distance_bound hb' hbound, hb'⟩ + +end SquaredDistanceKernel +end +end SquaredDistanceKernelLayer + + +end FullBoundaryCombinedLayer + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Riemann.lean b/lean/OAI/Analysis/HotSpots/Riemann.lean new file mode 100644 index 0000000000000000000000000000000000000000..8eb40b8878f4af99e84375b587efe1460ac0c599 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Riemann.lean @@ -0,0 +1,1106 @@ +/- +Portions of this file have been adapted from an external source. +The source copyright header and license information are preserved below. +-/ + +import OAI.Analysis.HotSpots.Conformal + +namespace OAI + +section RiemannBiholomorphic + + + + + +noncomputable section +open Set Filter Metric Complex Function +open scoped Topology +namespace Complex +open scoped _root_.Complex + + + + + + + + + + + + +/- +Copyright (c) 2026 Yury Kudryashov. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Yury Kudryashov + +The following conformal embedding declarations are adapted from Mathlib.Analysis.Complex.RiemannMapping. +Source: https://github.com/leanprover-community/mathlib4/blob/d13f23b723b8a846827a245b89c10fc7d3f11612/Mathlib/Analysis/Complex/RiemannMapping.lean + +This code has been modified. +-/ + +theorem exists_injective_not_dense_image_deriv_ne_zero {U : Set ℂ} (hUo : IsOpen U) + (hUc : IsSimplyConnected U) (hU : U ≠ univ) : + ∃ f : ℂ → ℂ, Injective f ∧ ¬Dense (f '' U) ∧ ∀ z ∈ U, deriv f z ≠ 0 := by + + wlog hU₀ : 0 ∉ U + · rw [ne_univ_iff_exists_notMem] at hU + rcases hU with ⟨a, ha⟩ + specialize this (hUo.vadd (-a)) (by simpa) (by simp [hU]) + (by simpa [mem_vadd_set_iff_neg_vadd_mem]) + rcases this with ⟨f, hf_inj, hf_dense, hdf⟩ + refine ⟨f ∘ (-a + ·), hf_inj.comp (add_right_injective (-a)), ?_, fun z hz ↦ ?_⟩ + · simpa only [← image_vadd, Set.image_image] using! hf_dense + · simpa [Function.comp_def, deriv_comp_const_add] using hdf (-a + z) (mapsTo_image _ _ hz) + + + rcases _root_.Complex.exists_continuousOn_pow_eq hUc hUo continuousOn_id (by rwa [image_id]) two_ne_zero + with ⟨f, hfc, hf_inv⟩ + replace hf_inv : LeftInverse (· ^ 2) f := hf_inv + + have hf₀ : ∀ z ∈ U, f z ≠ 0 := by + intro z hz hfz + simpa [hfz, (ne_of_mem_of_not_mem hz hU₀).symm] using hf_inv z + + + have hdf : ∀ z ∈ U, HasStrictDerivAt f (2 * f z)⁻¹ z := by + intro z hz + apply HasStrictDerivAt.of_local_left_inverse + · exact hfc.continuousAt <| hUo.mem_nhds hz + · simpa using hasStrictDerivAt_pow 2 (f z) + · simpa using hf₀ z hz + · exact .of_forall hf_inv + + refine ⟨f, hf_inv.injective, ?_, fun z hz ↦ ?_⟩ + · + simp only [Dense, not_forall, mem_closure_iff_frequently, not_frequently] + rcases hUc.nonempty with ⟨x, hx⟩ + + use -f x + + + have : f '' U ∈ 𝓝 (f x) := by + rw [← (hdf x hx).map_nhds_eq (by simpa using hf₀ x hx)] + exact Filter.image_mem_map <| hUo.mem_nhds hx + + rw [nhds_neg, eventually_neg] + + + + filter_upwards [this] + rintro _ ⟨a, ha, rfl⟩ ⟨b, hb, hab⟩ + obtain rfl : a = b := by + rw [← hf_inv b, hab] + simp [hf_inv a] + refine hf₀ a ha ?_ + linear_combination hab / 2 + · simpa [(hdf z hz).hasDerivAt.deriv] using hf₀ z hz + + + + + + + + + + + + + +lemma exists_mapsTo_unitBall_injOn_deriv_ne_zero {U : Set ℂ} (hUo : IsOpen U) + (hUc : IsSimplyConnected U) (hU : U ≠ univ) : + ∃ f : ℂ → ℂ, MapsTo f U (ball 0 1) ∧ InjOn f U ∧ ∀ z ∈ U, deriv f z ≠ 0 := by + + + rcases exists_injective_not_dense_image_deriv_ne_zero hUo hUc hU with ⟨f, hf_inj, hfd, hdf⟩ + + obtain ⟨x, ε, hε₀, hε⟩ : ∃ (x : ℂ) (ε : ℝ), 0 < ε ∧ ∀ a ∈ U, ε < dist (f a) x := by + simpa [Dense, mem_closure_iff_nhds_basis Metric.nhds_basis_closedBall] using hfd + have hfx : ∀ z ∈ U, f z ≠ x := fun z hz ↦ by simpa using hε₀.trans (hε z hz) + + use fun z ↦ ε / (f z - x) + refine ⟨?mapsTo, ?injOn, ?deriv⟩ + case mapsTo => + intro z hz + rw [mem_ball_zero_iff, norm_div, _root_.Complex.norm_real, Real.norm_of_nonneg hε₀.le, div_lt_one₀] + · simpa [dist_eq_norm] using hε z hz + · simpa [sub_eq_zero] using hfx z hz + case injOn => + intro z hz w hw heq + simpa [div_eq_mul_inv, hε₀.ne', hf_inj.eq_iff] using heq + case deriv => + intro z hz + have hdz : DifferentiableAt ℂ f z := differentiableAt_of_deriv_ne_zero (hdf z hz) + rw [(hasDerivAt_const _ _).fun_div (hdz.hasDerivAt.sub_const _) _ |>.deriv] <;> + simp [*, ne_of_gt, sub_eq_zero] + +end Complex + +namespace StrictHotSpots.Riemann + +variable {U : Set ℂ} + + +def extend (f : C(U,ℂ)) (z : ℂ) : ℂ := by + classical + exact if hz : z ∈ U then f ⟨z,hz⟩ else 0 + +@[simp] lemma extend_coe (f : C(U,ℂ)) (z : U) : extend f z=f z := by + simp [extend,z.property] + +lemma extend_eq (f : C(U,ℂ)) {z : ℂ} (hz : z ∈ U) : extend f z=f ⟨z,hz⟩ := by + simp [extend,hz] + +lemma extend_continuousOn (f : C(U,ℂ)) : ContinuousOn (extend f) U := by + rw [continuousOn_iff_continuous_domRestrict] + change Continuous (fun z : U => extend f z) + simpa only [extend_coe] using f.continuous + +def holomorphicBall (U : Set ℂ) : Set C(U,ℂ) := + {f | DifferentiableOn ℂ (extend f) U ∧ ∀ z : U, ‖f z‖ ≤ 1} + +lemma tendsto_extend {ι : Type*} {l : Filter ι} [LocallyCompactSpace U] + {F : ι → C(U,ℂ)} {f : C(U,ℂ)} (h : Tendsto F l (𝓝 f)) : + TendstoLocallyUniformlyOn (fun i => extend (F i)) (extend f) l U := by + rw [tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe] + simpa only [Function.comp_def,extend_coe] using + (ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mp h) + +lemma holomorphicBall_isClosed (ho : IsOpen U) : IsClosed (holomorphicBall U) := by + let : LocallyCompactSpace U := ho.locallyCompactSpace + rw [isClosed_iff_forall_filter] + intro f l hl hF hf + let := hl + have hF : ∀ᶠ g in l, g ∈ holomorphicBall U := le_principal_iff.mp hF + refine ⟨(tendsto_extend (show Tendsto id l (𝓝 f) from hf)).differentiableOn (hF.mono fun _ hi => hi.1) ho,?_⟩ + intro z + have hh : Tendsto (fun i => ‖i z‖) l (𝓝 ‖f z‖) := + by simpa only [extend_coe,id] using + ((tendsto_extend (show Tendsto id l (𝓝 f) from hf)).tendsto_at z.property).norm + exact le_of_tendsto hh (hF.mono fun _ hi => hi.2 z) + +lemma holomorphicBall_dist_bound (_ho : IsOpen U) {f : C(U,ℂ)} + (hf : f ∈ holomorphicBall U) {x : U} {r : ℝ} (_hr : 0 < r) + (hball : ball (x:ℂ) r ⊆ U) {y : U} (hy : dist (y:ℂ) x < r) : + dist (f x) (f y) ≤ (2/r)*dist (x:ℂ) y := by + have hm : MapsTo (extend f) (ball (x:ℂ) r) (closedBall (extend f x) 2) := by + intro z hz + have hzu := hball hz + rw [mem_closedBall,dist_eq_norm] + calc + ‖extend f z-extend f x‖ ≤ ‖extend f z‖+‖extend f x‖ := norm_sub_le _ _ + _ ≤ 1+1 := add_le_add (by simpa only [extend_eq f hzu] using hf.2 ⟨z,hzu⟩) + (by simpa only [extend_coe,id] using hf.2 x) + _ = 2 := by norm_num + have hh := Complex.dist_le_div_mul_dist_of_mapsTo_ball (hf.1.mono hball) hm + (show (y:ℂ) ∈ ball (x:ℂ) r from hy) + simpa only [extend_coe,dist_comm] using hh + +lemma holomorphicBall_equicontinuous (ho : IsOpen U) : + Equicontinuous (fun f : holomorphicBall U => (f.val : U → ℂ)) := by + intro x + rw [Metric.equicontinuousAt_iff] + intro ε hε + obtain ⟨r,hr,hru⟩ := Metric.isOpen_iff.mp ho (x:ℂ) x.property + refine ⟨min r (ε*r/2),lt_min hr (by positivity),?_⟩ + intro y hy f + have hyr : dist (y:ℂ) x < r := lt_of_lt_of_le hy (min_le_left _ _) + have hye : dist (y:ℂ) x < ε*r/2 := lt_of_lt_of_le hy (min_le_right _ _) + apply (holomorphicBall_dist_bound ho f.property hr hru hyr).trans_lt + rw [dist_comm] + exact (mul_lt_mul_of_pos_left hye (div_pos (by norm_num) hr)).trans_eq (by field_simp) + +lemma holomorphicBall_isCompact (ho : IsOpen U) : IsCompact (holomorphicBall U) := by + let : LocallyCompactSpace U := ho.locallyCompactSpace + have : T2Space (UniformOnFun U ℂ {K : Set U | IsCompact K}) := + UniformOnFun.t2Space_of_covering (by + rw [sUnion_eq_univ_iff] + intro x + exact ⟨{x},isCompact_singleton,mem_singleton x⟩) + have hc : IsCompact (closure (holomorphicBall U)) := + ArzelaAscoli.isCompact_closure_of_isClosedEmbedding (fun _ h => h) + ContinuousMap.isUniformEmbedding_toUniformOnFunIsCompact.isClosedEmbedding + (fun K _ => (holomorphicBall_equicontinuous ho).equicontinuousOn K) + (fun K _ x _ => ⟨closedBall (0:ℂ) 1,isCompact_closedBall _ _,fun f hf => by + simpa only [mem_closedBall,dist_zero_right] using hf.2 x⟩) + simpa only [(holomorphicBall_isClosed ho).closure_eq] using hc + +lemma deriv_tendsto {ι : Type*} {l : Filter ι} [l.NeBot] (ho : IsOpen U) + {F : ι → C(U,ℂ)} {f : C(U,ℂ)} (hF : ∀ᶠ i in l, F i ∈ holomorphicBall U) + (hf : Tendsto F l (𝓝 f)) (z : U) : + Tendsto (fun i => deriv (extend (F i)) z) l (𝓝 (deriv (extend f) z)) := by + let : LocallyCompactSpace U := ho.locallyCompactSpace + exact ((tendsto_extend hf).deriv (hF.mono fun _ hi => hi.1) ho).tendsto_at z.property + +end StrictHotSpots.Riemann + + + + +noncomputable section +open Set Filter Metric Complex Function +open scoped Topology +namespace StrictHotSpots.Riemann + +lemma hurwitz_locally_zero {ι : Type*} {l : Filter ι} [l.NeBot] + {U : Set ℂ} (ho : IsOpen U) {F : ι → ℂ → ℂ} {f : ℂ → ℂ} + (hconv : TendstoLocallyUniformlyOn F f l U) + (hF : ∀ᶠ i in l, DifferentiableOn ℂ (F i) U ∧ ∀ z ∈ U, F i z ≠ 0) + {z : ℂ} (hz : z ∈ U) (hfz : f z = 0) : ∀ᶠ w in 𝓝 z, f w = 0 := by + have hfd := hconv.differentiableOn (hF.mono fun _ hi => hi.1) ho + rcases (hfd.analyticOnNhd ho z hz).eventually_eq_zero_or_eventually_ne_zero with h | h + · exact h + obtain ⟨R,hR,hRU⟩ := Metric.isOpen_iff.mp ho z hz + obtain ⟨δ,hδ,hδf⟩ := Metric.mem_nhdsWithin_iff.mp h + let r := min R δ / 2 + have hr : 0 < r := by dsimp [r]; positivity + have hrR : r < R := by dsimp [r]; linarith [min_le_left R δ] + have hrδ : r < δ := by dsimp [r]; linarith [min_le_right R δ] + have hcl : closedBall z r ⊆ U := (closedBall_subset_ball hrR).trans hRU + have hs : sphere z r ⊆ U := sphere_subset_closedBall.trans hcl + have hfs : ∀ w ∈ sphere z r, f w ≠ 0 := by + intro w hw + apply hδf + refine ⟨?_,?_⟩ + · rw [mem_ball,mem_sphere.mp hw]; exact hrδ + · simpa only [mem_compl_iff,mem_singleton_iff] using (ne_of_mem_sphere hw hr.ne') + obtain ⟨v,hv,hvm⟩ := (isCompact_sphere z r).exists_isMinOn + (NormedSpace.sphere_nonempty.mpr hr.le) (hfd.continuousOn.mono hs).norm + let m := ‖f v‖ + have hm : 0 < m := norm_pos_iff.mpr (hfs v hv) + have he : ∀ᶠ i in l, ∀ w ∈ sphere z r, dist (f w) (F i w) < m/2 := + Metric.tendstoUniformlyOn_iff.mp + ((tendstoLocallyUniformlyOn_iff_forall_isCompact ho).mp hconv + _ hs (isCompact_sphere z r)) _ (by positivity) + have hbound : ∀ᶠ i in l, 1 ≤ (2/m)*‖F i z‖ := by + filter_upwards [hF,he] with i hi hei + have hiinv := hi.1.inv hi.2 + have hnorm : ‖(F i z)⁻¹‖ ≤ 2/m := + Complex.norm_le_of_forall_mem_frontier_norm_le (isBounded_ball) + (hiinv.diffContOnCl_ball hcl) (fun w hw => by + rw [frontier_ball z hr.ne'] at hw + have hmin : m ≤ ‖f w‖ := hvm hw + have hd := norm_sub_norm_le (f w) (F i w) + have hew := hei w hw + rw [dist_eq_norm] at hew + have hlow : m/2 ≤ ‖F i w‖ := by linarith + rw [Pi.inv_apply,norm_inv,inv_eq_one_div] + calc + 1/‖F i w‖ ≤ 1/(m/2) := one_div_le_one_div_of_le (by positivity) hlow + _ = 2/m := by field_simp) + (by rw [closure_ball z hr.ne']; exact mem_closedBall_self hr.le) + rw [norm_inv,inv_eq_one_div,div_le_iff₀ (norm_pos_iff.mpr (hi.2 z hz))] at hnorm + exact hnorm + have ht : Tendsto (fun i => (2/m)*‖F i z‖) l (𝓝 0) := by + simpa only [hfz,norm_zero,mul_zero] using (hconv.tendsto_at hz).norm.const_mul (2/m) + have hcontra : (1:ℝ) ≤ 0 := ge_of_tendsto ht hbound + norm_num at hcontra + +lemma hurwitz_injective {ι : Type*} {l : Filter ι} [l.NeBot] + {U : Set ℂ} (ho : IsOpen U) (hc : IsPreconnected U) + {F : ι → ℂ → ℂ} {f : ℂ → ℂ} + (hconv : TendstoLocallyUniformlyOn F f l U) + (hF : ∀ᶠ i in l, DifferentiableOn ℂ (F i) U ∧ InjOn (F i) U) + (hf : ∃ a ∈ U, ∃ b ∈ U, f a ≠ f b) : InjOn f U := by + intro x hx y hy hxy + by_contra hne + have hfd := hconv.differentiableOn (hF.mono fun _ hi => hi.1) ho + have hcst : TendstoLocallyUniformlyOn (fun i (_ : ℂ) => F i x) (fun _ => f x) l U := + (hconv.tendsto_at hx).tendstoUniformlyOn_const U |>.tendstoLocallyUniformlyOn + have hsub : TendstoLocallyUniformlyOn (fun i z => F i z-F i x) + (fun z => f z-f x) l (U \ {x}) := (hconv.sub hcst).mono sdiff_subset + have hloc : ∀ᶠ w in 𝓝 y, f w-f x=0 := hurwitz_locally_zero + (ho.sdiff isClosed_singleton) hsub + (hF.mono fun i hi => ⟨(hi.1.sub_const _).mono sdiff_subset,by + intro z hz + exact sub_ne_zero.mpr (fun hh => hz.2 (hi.2 hz.1 hx hh))⟩) + ⟨hy,fun hyx => hne (Eq.symm (mem_singleton_iff.mp hyx))⟩ (sub_eq_zero.mpr hxy.symm) + have he : EqOn (fun z => f z-f x) 0 U := + ((hfd.sub_const _).analyticOnNhd ho).eqOn_zero_of_preconnected_of_eventuallyEq_zero hc hy hloc + obtain ⟨a,ha,b,hb,hab⟩ := hf + exact hab ((sub_eq_zero.mp (he ha)).trans (sub_eq_zero.mp (he hb)).symm) + +end StrictHotSpots.Riemann + +namespace StrictHotSpots.Riemann + +def normalizedMaps {U : Set ℂ} (a : U) : Set C(U,ℂ) := + {f | f ∈ holomorphicBall U ∧ f a=0 ∧ (Injective f ∨ f=0)} + +lemma normalizedMaps_isClosed {U : Set ℂ} (ho : IsOpen U) + (hc : IsPreconnected U) (a : U) : IsClosed (normalizedMaps a) := by + let : LocallyCompactSpace U := ho.locallyCompactSpace + rw [isClosed_iff_forall_filter] + intro f l hl hF hf + let := hl + have hF : ∀ᶠ g in l, g ∈ normalizedMaps a := le_principal_iff.mp hF + have ht : TendstoLocallyUniformlyOn (fun g => extend g) (extend f) l U := tendsto_extend hf + have hfa : f a=0 := by + apply isClosed_singleton.mem_of_tendsto (by simpa only [extend_coe] using ht.tendsto_at a.property) + exact hF.mono fun _ hg => hg.2.1 + refine ⟨(holomorphicBall_isClosed ho).mem_of_tendsto hf (hF.mono fun _ hg => hg.1),hfa,?_⟩ + by_cases hfzero : f=0 + · exact Or.inr hfzero + left + obtain ⟨b,hb⟩ : ∃ b : U, f b≠0 := by + by_contra hh + simp only [not_exists,not_not] at hh + exact hfzero (ContinuousMap.ext hh) + have hFb : ∀ᶠ g in l, g b≠0 := by + exact (show Tendsto (fun g : C(U,ℂ) => g b) l (𝓝 (f b)) from + by simpa only [extend_coe] using ht.tendsto_at b.property).eventually + (show ∀ᶠ z in 𝓝 (f b), z ≠ 0 from isOpen_compl_singleton.mem_nhds hb) + have hin : InjOn (extend f) U := hurwitz_injective ho hc ht + (by + filter_upwards [hF,hFb] with g hg hgb + refine ⟨hg.1.1,?_⟩ + have hgInj : Injective g := hg.2.2.resolve_right (by intro hg0; simp [hg0] at hgb) + intro x hx y hy hxy + exact congrArg Subtype.val (hgInj (by simpa only [extend_eq g hx,extend_eq g hy] using hxy))) + ⟨b,b.property,a,a.property,by simpa only [extend_coe,hfa] using hb⟩ + intro x y hxy + exact Subtype.ext (hin x.property y.property (by simpa only [extend_coe] using hxy)) + +lemma normalizedMaps_isCompact {U : Set ℂ} (ho : IsOpen U) + (hc : IsPreconnected U) (a : U) : IsCompact (normalizedMaps a) := + (holomorphicBall_isCompact ho).of_isClosed_subset (normalizedMaps_isClosed ho hc a) + (fun _ hf => hf.1) + +lemma deriv_continuousOn {U : Set ℂ} (ho : IsOpen U) (a : U) : + ContinuousOn (fun f : C(U,ℂ) => deriv (extend f) a) (holomorphicBall U) := by + rw [continuousOn_iff_continuous_domRestrict,continuous_iff_continuousAt] + intro f + exact deriv_tendsto ho (Eventually.of_forall fun g : holomorphicBall U => g.property) + continuous_subtype_val.continuousAt a + +lemma exists_extremal {U : Set ℂ} (ho : IsOpen U) (hc : IsPreconnected U) (a : U) + {g : C(U,ℂ)} (hg : g ∈ normalizedMaps a) (hgd : deriv (extend g) a ≠ 0) : + ∃ f ∈ normalizedMaps a, 0 < ‖deriv (extend f) a‖ ∧ + ∀ h ∈ normalizedMaps a, ‖deriv (extend h) a‖ ≤ ‖deriv (extend f) a‖ := by + obtain ⟨f,hf,hmax⟩ := (normalizedMaps_isCompact ho hc a).exists_isMaxOn ⟨g,hg⟩ + ((deriv_continuousOn ho a).mono (fun _ hh => hh.1)).norm + exact ⟨f,hf,(norm_pos_iff.mpr hgd).trans_le (hmax hg),hmax⟩ + + +lemma extend_eventuallyEq {U : Set ℂ} (ho : IsOpen U) (g : C(U,ℂ)) + {f : ℂ → ℂ} (hf : ∀ z : U, g z=f z) (a : U) : + extend g =ᶠ[𝓝 (a:ℂ)] f := by + filter_upwards [ho.mem_nhds a.property] with z hz + rw [extend_eq g hz] + exact hf ⟨z,hz⟩ + +lemma normalized_initial {U : Set ℂ} (ho : IsOpen U) (hs : IsSimplyConnected U) + (hU : U ≠ univ) (a : U) : + ∃ g ∈ normalizedMaps a, deriv (extend g) a ≠ 0 := by + obtain ⟨f,hfmap,hfinj,hfderiv⟩ := Complex.exists_mapsTo_unitBall_injOn_deriv_ne_zero ho hs hU + have hfd : DifferentiableOn ℂ f U := fun z hz => + (differentiableAt_of_deriv_ne_zero (hfderiv z hz)).differentiableWithinAt + let g : C(U,ℂ) := ⟨fun z => (f z-f a)/2, + hfd.continuousOn.domRestrict.sub continuous_const |>.div_const 2⟩ + have heq : ∀ z ∈ U, extend g z = (f z-f a)/2 := fun z hz => extend_eq g hz + refine ⟨g,⟨⟨((hfd.sub_const _).div_const 2).congr heq,?_⟩,?_,Or.inl ?_⟩,?_⟩ + · intro z + change ‖(f z-f a)/2‖ ≤ 1 + rw [norm_div,Complex.norm_ofNat,div_le_one₀ (by norm_num : (0:ℝ)<2)] + exact (norm_sub_le _ _).trans (by + have hz : ‖f z‖ < 1 := mem_ball_zero_iff.mp (hfmap z.property) + have ha : ‖f a‖ < 1 := mem_ball_zero_iff.mp (hfmap a.property) + linarith) + · change (f a-f a)/2=0 + simp + · intro x y hxy + apply Subtype.ext + apply hfinj x.property y.property + change (f x-f a)/2=(f y-f a)/2 at hxy + have h2 : f x-f a=f y-f a := (div_left_inj' (by norm_num : (2:ℂ)≠0)).mp hxy + linear_combination h2 + · rw [(extend_eventuallyEq ho g (f := fun z => (f z-f a)/2) (fun _ => rfl) a).deriv_eq,deriv_div_const, + deriv_sub_const] + exact div_ne_zero (hfderiv a a.property) (by norm_num) + +lemma exists_nonzero_extremal {U : Set ℂ} (ho : IsOpen U) (hs : IsSimplyConnected U) + (hU : U ≠ univ) (a : U) : + ∃ f ∈ normalizedMaps a, 0 < ‖deriv (extend f) a‖ ∧ + ∀ h ∈ normalizedMaps a, ‖deriv (extend h) a‖ ≤ ‖deriv (extend f) a‖ := by + obtain ⟨g,hg,hgd⟩ := normalized_initial ho hs hU a + have hc : IsPreconnected U := hs.isPathConnected.isConnected.isPreconnected + exact exists_extremal ho hc a hg hgd + +lemma normalized_norm_lt {U : Set ℂ} (ho : IsOpen U) (hc : IsPreconnected U) + (a : U) {f : C(U,ℂ)} (hf : f ∈ normalizedMaps a) (z : U) : ‖f z‖ < 1 := by + by_contra hle + have heq : ‖f z‖=1 := le_antisymm (hf.1.2 z) (not_lt.mp hle) + have hmax : IsMaxOn (norm ∘ extend f) U (z:ℂ) := by + intro w hw + change ‖extend f w‖ ≤ ‖extend f z‖ + rw [extend_eq f hw,extend_coe,heq] + exact hf.1.2 ⟨w,hw⟩ + have hh := Complex.eqOn_of_isPreconnected_of_isMaxOn_norm hc ho hf.1.1 z.property hmax a.property + simp only [extend_coe,Function.const_apply,hf.2.1] at hh + rw [← hh,norm_zero] at heq + norm_num at heq + +end StrictHotSpots.Riemann + + + + +noncomputable section +open Set Filter Metric Complex Function +open scoped Topology ComplexConjugate +namespace StrictHotSpots.Riemann + +def mobius (a z : ℂ) : ℂ := (z-a)/(1-conj a*z) + +lemma mobius_denom_ne {a z : ℂ} (ha : ‖a‖ < 1) (hz : ‖z‖ < 1) : + 1-conj a*z ≠ 0 := by + apply sub_ne_zero.mpr + intro he + have hh : ‖conj a*z‖ < 1 := by + rw [norm_mul,norm_conj] + nlinarith [norm_nonneg a,norm_nonneg z] + rw [← he,norm_one] at hh + exact lt_irrefl _ hh + +lemma mobius_norm_identity (a z : ℂ) : + ‖1-conj a*z‖^2-‖z-a‖^2=(1-‖a‖^2)*(1-‖z‖^2) := by + simp only [← Complex.normSq_eq_norm_sq,Complex.normSq_apply,sub_re,sub_im, + one_re,one_im,mul_re,mul_im,conj_re,conj_im] + ring + +lemma norm_mobius_lt {a z : ℂ} (ha : ‖a‖ < 1) (hz : ‖z‖ < 1) : + ‖mobius a z‖ < 1 := by + have hden : 0 < ‖1-conj a*z‖ := norm_pos_iff.mpr (mobius_denom_ne ha hz) + rw [mobius,norm_div,div_lt_one₀ hden] + have hpos : 0 < (1-‖a‖^2)*(1-‖z‖^2) := mul_pos + (by nlinarith [norm_nonneg a]) (by nlinarith [norm_nonneg z]) + have hh := mobius_norm_identity a z + nlinarith [norm_nonneg (z-a)] + +@[simp] lemma mobius_self (a : ℂ) : mobius a a=0 := by simp [mobius] +@[simp] lemma mobius_zero (a : ℂ) : mobius a 0 = -a := by simp [mobius] + +lemma mobius_injOn {a : ℂ} (ha : ‖a‖ < 1) : InjOn (mobius a) (ball 0 1) := by + intro x hx y hy he + have hx' := mobius_denom_ne ha (mem_ball_zero_iff.mp hx) + have hy' := mobius_denom_ne ha (mem_ball_zero_iff.mp hy) + have haa := mobius_denom_ne ha ha + have hcross := (div_eq_div_iff hx' hy').mp he + have hmul : (x-y)*(1-conj a*a)=0 := by linear_combination hcross + exact sub_eq_zero.mp ((mul_eq_zero.mp hmul).resolve_right haa) + +lemma hasDerivAt_mobius {a z : ℂ} (ha : ‖a‖ < 1) (hz : ‖z‖ < 1) : + HasDerivAt (mobius a) ((1-conj a*a)/(1-conj a*z)^2) z := by + have hh := ((hasDerivAt_id z).sub_const a).div + ((hasDerivAt_const z 1).sub ((hasDerivAt_id z).const_mul (conj a))) (mobius_denom_ne ha hz) + change HasDerivAt (fun w => (w-a)/(1-conj a*w)) + ((1*(1-conj a*z)-(z-a)*(0-conj a*1))/(1-conj a*z)^2) z at hh + have he : 1*(1-conj a*z)-(z-a)*(0-conj a*1)=1-conj a*a := by ring + rw [he] at hh + exact hh + +lemma hasDerivAt_mobius_zero {a : ℂ} (ha : ‖a‖ < 1) : + HasDerivAt (mobius a) (1-conj a*a) 0 := by + simpa using hasDerivAt_mobius ha (by simp : ‖(0:ℂ)‖<1) + +lemma norm_mobius_self_deriv {a : ℂ} (ha : ‖a‖ < 1) : + ‖(1-conj a*a)/(1-conj a*a)^2‖=1/(1-‖a‖^2) := by + have hh : 0 < 1-‖a‖^2 := by nlinarith [norm_nonneg a] + rw [← Complex.normSq_eq_conj_mul_self,Complex.normSq_eq_norm_sq] + norm_cast + rw [norm_div,norm_pow,Real.norm_of_nonneg hh.le] + field_simp + +lemma norm_mobius_zero_deriv {a : ℂ} (ha : ‖a‖ < 1) : + ‖1-conj a*a‖=1-‖a‖^2 := by + rw [← Complex.normSq_eq_conj_mul_self,Complex.normSq_eq_norm_sq] + norm_cast + exact Real.norm_of_nonneg (by nlinarith [norm_nonneg a]) + +lemma hasDerivAt_continuous_square_root {r h : ℂ → ℂ} {a d : ℂ} + (hrc : ContinuousAt r a) (hr : r a ≠ 0) (he : ∀ z, r z^2=h z) + (hh : HasDerivAt h d a) : HasDerivAt r ((2*r a)⁻¹*d) a := by + have hq : HasStrictDerivAt (fun z : ℂ => z^2) (2*r a) (r a) := by + simpa using hasStrictDerivAt_pow 2 (r a) + have hqne : 2*r a ≠ 0 := mul_ne_zero (by norm_num) hr + let k := hq.localInverse (fun z : ℂ => z^2) (2*r a) (r a) hqne + have hk : HasDerivAt k (2*r a)⁻¹ (h a) := by + rw [← he a] + exact (hq.to_localInverse hqne).hasDerivAt + have hke : (fun z => k (h z)) =ᶠ[𝓝 a] r := by + have hev := hrc.eventually (hq.eventually_left_inverse hqne) + filter_upwards [hev] with z hz + simpa only [he] using hz + exact (hk.comp a hh).congr_of_eventuallyEq hke.symm + + +lemma root_improvement_inequality {r d : ℝ} (hr : 0 < r) (hr1 : r < 1) (hd : 0 < d) : + d < (1/(1-r^2)) * ((2*r)⁻¹*((1-(r^2)^2)*d)) := by + have hp : 0 < 1-r^2 := by nlinarith + have he : (1/(1-r^2)) * ((2*r)⁻¹*((1-(r^2)^2)*d)) = + (1+r^2)/(2*r)*d := by + field_simp + ring + rw [he] + have hh : 1 < (1+r^2)/(2*r) := (lt_div_iff₀ (by positivity)).mpr (by nlinarith [sq_pos_of_pos (sub_pos.mpr hr1)]) + simpa using mul_lt_mul_of_pos_right hh hd + + + + +lemma exists_root_improvement {U : Set ℂ} (ho : IsOpen U) (hs : IsSimplyConnected U) + {a : ℂ} (ha : a ∈ U) {f : ℂ → ℂ} (hfd : DifferentiableOn ℂ f U) + (hfi : InjOn f U) (hfm : ∀ z ∈ U, ‖f z‖ < 1) (hfa : f a = 0) + (hdf : 0 < ‖deriv f a‖) {c : ℂ} (hc : ‖c‖ < 1) (hcf : c ∉ f '' U) : + ∃ g : ℂ → ℂ, DifferentiableOn ℂ g U ∧ InjOn g U ∧ + (∀ z ∈ U, ‖g z‖ < 1) ∧ g a=0 ∧ ‖deriv f a‖ < ‖deriv g a‖ := by + have hdc (z : ℂ) (hz : z ∈ U) : HasDerivAt (fun w => mobius c (f w)) + (((1-conj c*c)/(1-conj c*f z)^2)*deriv f z) z := + (hasDerivAt_mobius hc (hfm z hz)).comp z ((hfd z hz).differentiableAt (ho.mem_nhds hz)).hasDerivAt + have hcn (z : ℂ) (hz : z ∈ U) : mobius c (f z) ≠ 0 := by + rw [mobius,div_ne_zero_iff] + exact ⟨sub_ne_zero.mpr (by intro he; exact hcf ⟨z,hz,he⟩),mobius_denom_ne hc (hfm z hz)⟩ + obtain ⟨r,hrc,hreq⟩ := Complex.exists_continuousOn_pow_eq hs ho + (show ContinuousOn (fun z => mobius c (f z)) U from fun z hz => (hdc z hz).continuousAt.continuousWithinAt) + (by rintro ⟨z,hz,he⟩; exact hcn z hz he) two_ne_zero + have hrn (z : ℂ) (hz : z ∈ U) : r z ≠ 0 := by + intro he + have hh := hreq z + rw [he,zero_pow two_ne_zero] at hh + exact hcn z hz hh.symm + have hrm (z : ℂ) (hz : z ∈ U) : ‖r z‖ < 1 := by + have hh := congrArg norm (hreq z) + rw [norm_pow] at hh + have hlt := norm_mobius_lt hc (hfm z hz) + nlinarith [norm_nonneg (r z)] + have hrd (z : ℂ) (hz : z ∈ U) : HasDerivAt r + ((2*r z)⁻¹ * (((1-conj c*c)/(1-conj c*f z)^2)*deriv f z)) z := + hasDerivAt_continuous_square_root (hrc.continuousAt (ho.mem_nhds hz)) (hrn z hz) hreq (hdc z hz) + have hri : InjOn r U := by + intro x hx y hy he + apply hfi hx hy + apply mobius_injOn hc (mem_ball_zero_iff.mpr (hfm x hx)) (mem_ball_zero_iff.mpr (hfm y hy)) + rw [← hreq x,← hreq y,he] + let g : ℂ → ℂ := fun z => mobius (r a) (r z) + have hgd (z : ℂ) (hz : z ∈ U) : HasDerivAt g + (((1-conj (r a)*r a)/(1-conj (r a)*r z)^2)* + ((2*r z)⁻¹ * (((1-conj c*c)/(1-conj c*f z)^2)*deriv f z))) z := + (hasDerivAt_mobius (hrm a ha) (hrm z hz)).comp z (hrd z hz) + refine ⟨g,(fun z hz => (hgd z hz).differentiableAt.differentiableWithinAt),?_,?_,?_,?_⟩ + · intro x hx y hy he + exact hri hx hy (mobius_injOn (hrm a ha) (mem_ball_zero_iff.mpr (hrm x hx)) + (mem_ball_zero_iff.mpr (hrm y hy)) he) + · intro z hz + exact norm_mobius_lt (hrm a ha) (hrm z hz) + · exact mobius_self _ + · have hnorm : ‖c‖=‖r a‖^2 := by + have hh := congrArg norm (hreq a) + simpa only [hfa,mobius_zero,norm_pow,norm_neg] using hh.symm + rw [(hgd a ha).deriv,norm_mul,norm_mobius_self_deriv (hrm a ha),norm_mul, + norm_inv,norm_mul,Complex.norm_ofNat,norm_mul,hfa] + simp only [mul_zero,sub_zero,one_pow,div_one] + rw [norm_mobius_zero_deriv hc,hnorm] + exact root_improvement_inequality (norm_pos_iff.mpr (hrn a ha)) (hrm a ha) hdf + +end StrictHotSpots.Riemann + +namespace StrictHotSpots.Riemann + + +lemma exists_normalized_bijective {U : Set ℂ} (ho : IsOpen U) (hs : IsSimplyConnected U) + (hU : U ≠ univ) (a : U) : + ∃ f : ℂ → ℂ, f a=0 ∧ BijOn f U (ball 0 1) ∧ DifferentiableOn ℂ f U ∧ + 0 < ‖deriv f a‖ := by + obtain ⟨f,hf,hd,hmax⟩ := exists_nonzero_extremal ho hs hU a + have hfinj : Injective f := hf.2.2.resolve_right (by + intro he + subst f + have hezero : extend (0:C(U,ℂ))=0 := by ext z; simp [extend] + rw [hezero] at hd + simp at hd) + have hfi : InjOn (extend f) U := by + intro x hx y hy he + exact congrArg Subtype.val (hfinj (by simpa only [extend_eq f hx,extend_eq f hy] using he)) + have hfm : ∀ z ∈ U, ‖extend f z‖ < 1 := by + intro z hz + rw [extend_eq f hz] + exact normalized_norm_lt ho hs.isPathConnected.isConnected.isPreconnected a hf ⟨z,hz⟩ + have hfa : extend f a=0 := by simpa only [extend_coe] using hf.2.1 + refine ⟨extend f,hfa,⟨(fun z hz => mem_ball_zero_iff.mpr (hfm z hz)),hfi,?_⟩,hf.1.1,hd⟩ + intro c hc + by_contra hcf + obtain ⟨g,hgd,hgi,hgm,hga,hbetter⟩ := exists_root_improvement ho hs a.property hf.1.1 hfi hfm hfa hd + (mem_ball_zero_iff.mp hc) hcf + let G : C(U,ℂ) := ⟨U.domRestrict g,hgd.continuousOn.domRestrict⟩ + have hG : G ∈ normalizedMaps a := by + refine ⟨⟨hgd.congr (fun z hz => extend_eq G hz),?_⟩,hga,Or.inl ?_⟩ + · intro z + exact (hgm z z.property).le + · intro x y he + exact Subtype.ext (hgi x.property y.property he) + have hh := hmax G hG + rw [(extend_eventuallyEq ho G (f:=g) (fun _ => rfl) a).deriv_eq] at hh + exact (not_lt_of_ge hh) hbetter + +end StrictHotSpots.Riemann + + + + + +noncomputable section +open Set Filter Metric Complex Function +open scoped Topology +namespace StrictHotSpots.Riemann + +lemma analytic_inverse_openPartialHomeomorph (e : OpenPartialHomeomorph ℂ ℂ) + (hc : IsPreconnected e.source) (hd : DifferentiableOn ℂ e e.source) + {a : ℂ} (ha : a ∈ e.source) (hda : deriv e a ≠ 0) : + DifferentiableOn ℂ e.symm e.target ∧ ∀ x ∈ e.source, deriv e x ≠ 0 := by + have han := hd.analyticOnNhd e.open_source + have hinv (x : ℂ) (hx : x ∈ e.source) : AnalyticAt ℂ e.symm (e x) := by + have hdn : ∀ᶠ z in 𝓝[≠] x, deriv e z ≠ 0 := by + rcases (han.deriv x hx).eventually_eq_zero_or_eventually_ne_zero with he | he + · have hzero := han.deriv.eqOn_of_preconnected_of_eventuallyEq analyticOnNhd_const hc hx he + exact (hda (hzero ha)).elim + · exact he + have ht : Tendsto e.symm (𝓝[≠] e x) (𝓝[≠] x) := by + have ht0 : Tendsto e.symm (𝓝[≠] e x) (𝓝[≠] e.symm (e x)) := + tendsto_nhdsWithin_iff.mpr ⟨(e.continuousAt_symm (e.map_source hx)).tendsto.mono_left nhdsWithin_le_nhds, + e.symm.eventually_ne_nhdsWithin (e.map_source hx)⟩ + simpa only [e.left_inv hx] using ht0 + apply Complex.analyticAt_of_differentiable_on_punctured_nhds_of_continuousAt + ?_ (e.continuousAt_symm (e.map_source hx)) + filter_upwards [ht.eventually hdn,eventually_nhdsWithin_of_eventually_nhds + (e.open_target.mem_nhds (e.map_source hx))] with y hdy hy + exact (e.hasDerivAt_symm hy hdy + ((hd (e.symm y) (e.map_target hy)).differentiableAt + (e.open_source.mem_nhds (e.map_target hy))).hasDerivAt).differentiableAt + refine ⟨?_,?_⟩ + · intro y hy + have hh := hinv (e.symm y) (e.map_target hy) + rw [e.right_inv hy] at hh + exact hh.differentiableAt.differentiableWithinAt + · intro x hx + have hcomp := (hinv x hx).differentiableAt.hasDerivAt.comp x + ((hd x hx).differentiableAt (e.open_source.mem_nhds hx)).hasDerivAt + have heq : deriv e.symm (e x) * deriv e x = 1 := + hcomp.unique ((hasDerivAt_id x).congr_of_eventuallyEq (e.eventually_left_inverse hx)) + intro he + rw [he,mul_zero] at heq + exact zero_ne_one heq + +lemma exists_biholomorphic_inverse {U V : Set ℂ} (ho : IsOpen U) + (hc : IsPreconnected U) {f : ℂ → ℂ} (hfd : DifferentiableOn ℂ f U) + (hfb : BijOn f U V) {a : ℂ} (ha : a ∈ U) (hda : deriv f a ≠ 0) : + ∃ e : OpenPartialHomeomorph ℂ ℂ, (e : ℂ → ℂ)=f ∧ e.source=U ∧ e.target=V ∧ + DifferentiableOn ℂ e.symm V ∧ (∀ x ∈ U, deriv f x ≠ 0) := by + have hop : ∀ s ⊆ U, IsOpen s → IsOpen (f '' s) := by + rcases (hfd.analyticOnNhd ho).is_constant_or_isOpen hc with h | h + · obtain ⟨c,he⟩ := h + have hg : f =ᶠ[𝓝 a] fun _ => c := by + filter_upwards [ho.mem_nhds ha] with z hz + exact he z hz + exact (hda (by rw [hg.deriv_eq,deriv_const])).elim + · exact h + have hrestrict : IsOpenMap (U.domRestrict f) := by + intro s hs + have hsub : Subtype.val '' s ⊆ U := by rintro _ ⟨x,_,rfl⟩; exact x.property + change IsOpen ((fun x : U => f x) '' s) + simpa only [image_image,comp_def] using hop (Subtype.val '' s) hsub (ho.isOpenMap_subtype_val s hs) + let e := OpenPartialHomeomorph.ofContinuousOpenRestrict (hfb.toPartialEquiv f U V) + hfd.continuousOn hrestrict ho + have he : (e : ℂ → ℂ)=f := rfl + have hes : e.source=U := rfl + have het : e.target=V := rfl + have hh := analytic_inverse_openPartialHomeomorph e hc hfd ha hda + exact ⟨e,he,hes,het,hh.1,hh.2⟩ + +end StrictHotSpots.Riemann + + +namespace StrictHotSpots.Riemann + + + +theorem exists_disk_biholomorphism {U : Set ℂ} (ho : IsOpen U) + (hs : IsSimplyConnected U) (hne : U.Nonempty) (hU : U ≠ univ) : + ∃ Φ : OpenPartialHomeomorph ℂ ℂ, Φ.source = ball 0 1 ∧ Φ.target = U ∧ + DifferentiableOn ℂ Φ (ball 0 1) ∧ DifferentiableOn ℂ Φ.symm U ∧ + (∀ z ∈ ball (0:ℂ) 1, deriv Φ z ≠ 0) ∧ + (∀ w ∈ U, deriv Φ.symm w ≠ 0) := by + obtain ⟨a,ha⟩ := hne + obtain ⟨f,_,hfb,hfd,hda⟩ := exists_normalized_bijective ho hs hU ⟨a,ha⟩ + obtain ⟨e,he,hes,het,hdi,hen⟩ := exists_biholomorphic_inverse ho + hs.isPathConnected.isConnected.isPreconnected hfd hfb ha + (norm_pos_iff.mp hda) + refine ⟨e.symm,het,hes,hdi,?_,?_,?_⟩ + · simpa only [e.symm_symm,he] using hfd + · intro z hz + have hzt : z ∈ e.target := het.symm ▸ hz + have hw : e.symm z ∈ U := hes ▸ e.map_target hzt + have hd : HasDerivAt e (deriv f (e.symm z)) (e.symm z) := by + rw [he] + exact ((hfd _ hw).differentiableAt (ho.mem_nhds hw)).hasDerivAt + have hd' := e.hasDerivAt_symm hzt (hen _ hw) hd + rw [hd'.deriv] + exact inv_ne_zero (hen _ hw) + · simpa only [e.symm_symm,he] using hen + +end StrictHotSpots.Riemann +end +end +end +end +end RiemannBiholomorphic + +section RiemannDomain + + + + + +noncomputable section +open Set Filter Metric MeasureTheory +open scoped Topology ContDiff +namespace StrictHotSpots.Conformal + +lemma conjugate_contDiffOn {f : ℂ → ℂ} {U : Set ℂ} + (ho : IsOpen U) (hd : DifferentiableOn ℂ f U) : + ContDiffOn ℝ ∞ (fun x : Plane => coordinate (f (coordinate.symm x))) + (coordinate.symm ⁻¹' U) := by + exact coordinate.contDiff.comp_contDiffOn + (((hd.contDiffOn ho).restrict_scalars ℝ).comp coordinate.symm.contDiff.contDiffOn + (fun _ hx => hx)) + +lemma conjugate_hasFDerivAt {f : ℂ → ℂ} {x : Plane} + (hd : DifferentiableAt ℂ f (coordinate.symm x)) : + HasFDerivAt (fun y : Plane => coordinate (f (coordinate.symm y))) + (planeMul (deriv f (coordinate.symm x))) x := + coordinate.toContinuousLinearEquiv.toContinuousLinearMap.hasFDerivAt.comp x + ((hd.hasDerivAt.hasFDerivAt.restrictScalars ℝ).comp x + coordinate.symm.toContinuousLinearEquiv.toContinuousLinearMap.hasFDerivAt) + + + +theorem exists_interior_chart {Ω : Set Plane} (ho : IsOpen Ω) + (hs : IsSimplyConnected Ω) (hne : Ω.Nonempty) (hb : Bornology.IsBounded Ω) : + ∃ (e : OpenPartialHomeomorph Plane Plane) (d d' : Plane → ℂ), + e.source = DiskH10.disk ∧ e.target = Ω ∧ + ContDiffOn ℝ ∞ e e.source ∧ ContDiffOn ℝ ∞ e.symm e.target ∧ + (∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) ∧ + (∀ y ∈ e.target, HasFDerivAt e.symm (planeMul (d' y)) y) ∧ + (∀ x ∈ e.source, d x ≠ 0) ∧ (∀ y ∈ e.target, d' y ≠ 0) := by + let U : Set ℂ := coordinate ⁻¹' Ω + have hUo : IsOpen U := ho.preimage coordinate.continuous + have hUs : IsSimplyConnected U := + coordinate.toHomeomorph.isSimplyConnected_preimage.mpr hs + have hUne : U.Nonempty := by + obtain ⟨x,hx⟩ := hne + exact ⟨coordinate.symm x,by simpa [U] using hx⟩ + have hproper : U ≠ univ := by + intro hh + have hu : Ω = univ := by + apply eq_univ_of_forall + intro x + have hx : coordinate.symm x ∈ U := hh ▸ mem_univ _ + simpa [U] using hx + exact NormedSpace.unbounded_univ ℝ Plane (hu ▸ hb) + obtain ⟨Φ,hΦs,hΦt,hΦ,hΦi,hd,hd'⟩ := + Riemann.exists_disk_biholomorphism hUo hUs hUne hproper + let e := planeChart Φ + have hes : e.source = DiskH10.disk := by + rw [planeChart_source,hΦs] + ext x + simp only [mem_preimage,mem_ball,dist_zero_right,coordinate.symm.norm_map, + DiskH10.disk] + have het : e.target = Ω := by + rw [planeChart_target,hΦt] + ext x + simp [U] + have heq : (e : Plane → Plane) = fun x => coordinate (Φ (coordinate.symm x)) := rfl + have hiq : (e.symm : Plane → Plane) = fun x => coordinate (Φ.symm (coordinate.symm x)) := rfl + have hsrc (x : Plane) (hx : x ∈ e.source) : coordinate.symm x ∈ ball (0:ℂ) 1 := by + rwa [planeChart_source,hΦs] at hx + have htgt (x : Plane) (hx : x ∈ e.target) : coordinate.symm x ∈ U := by + rwa [planeChart_target,hΦt] at hx + refine ⟨e,fun x => deriv Φ (coordinate.symm x), + fun y => deriv Φ.symm (coordinate.symm y),hes,het,?_,?_,?_,?_,?_,?_⟩ + · rw [heq,planeChart_source,hΦs] + exact conjugate_contDiffOn isOpen_ball hΦ + · rw [hiq,planeChart_target,hΦt] + exact conjugate_contDiffOn hUo hΦi + · intro x hx + rw [heq] + exact conjugate_hasFDerivAt ((hΦ _ (hsrc x hx)).differentiableAt + (isOpen_ball.mem_nhds (hsrc x hx))) + · intro y hy + rw [hiq] + exact conjugate_hasFDerivAt ((hΦi _ (htgt y hy)).differentiableAt + (hUo.mem_nhds (htgt y hy))) + · intro x hx + exact hd _ (hsrc x hx) + · intro y hy + exact hd' _ (htgt y hy) + +end StrictHotSpots.Conformal +end +end RiemannDomain + +section ConformalPotential + + + + + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff Topology ENNReal +namespace StrictHotSpots.Conformal + +variable (e : OpenPartialHomeomorph Plane Plane) (d : Plane → ℂ) +variable (hd : ∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) + +include hd in +lemma chartMeasure_univ : chartMeasure e d univ = volume e.target := by + have hh := congrArg (fun ν : Measure Plane => ν univ) (map_chartMeasure e d hd) + rw [Measure.map_apply_of_aemeasurable (chart_aemeasurable e d) MeasurableSet.univ] at hh + simpa only [preimage_univ,Measure.restrict_apply_univ] using hh + +include hd in +lemma chartMeasure_finite (hb : Bornology.IsBounded e.target) : + IsFiniteMeasure (chartMeasure e d) := + ⟨(chartMeasure_univ e d hd).trans_lt hb.measure_lt_top⟩ + + +def potentialMeasure (μ : ℝ) : Measure Plane := + ENNReal.ofReal μ • chartMeasure e d + +lemma potentialMeasure_density {μ : ℝ} (hμ : 0 ≤ μ) : + potentialMeasure e d μ = (volume.restrict e.source).withDensity + (fun x => ENNReal.ofReal (μ*‖d x‖^2)) := by + have hh := withDensity_smul' (μ:=volume.restrict e.source) (ENNReal.ofReal μ) + (fun x => ENNReal.ofReal (‖d x‖^2)) ENNReal.ofReal_ne_top + simpa only [potentialMeasure,chartMeasure,Pi.smul_def,smul_eq_mul, + ENNReal.ofReal_mul hμ] using hh.symm + +lemma potentialMeasure_integral {μ : ℝ} (hμ : 0 ≤ μ) (f : Plane → ℝ) : + (∫ x, f x ∂potentialMeasure e d μ) = μ * ∫ x, f x ∂chartMeasure e d := by + rw [potentialMeasure,integral_smul_measure,ENNReal.toReal_ofReal hμ,smul_eq_mul] + +include hd in +lemma potentialMeasure_map (μ : ℝ) : + (potentialMeasure e d μ).map e = ENNReal.ofReal μ • volume.restrict e.target := by + rw [potentialMeasure,Measure.map_smul _ (chart_aemeasurable e d),map_chartMeasure e d hd] + +include hd in +lemma potentialMeasure_finite (μ : ℝ) (hb : Bornology.IsBounded e.target) : + IsFiniteMeasure (potentialMeasure e d μ) := by + let := chartMeasure_finite e d hd hb + exact Measure.smul_finite (chartMeasure e d) ENNReal.ofReal_ne_top + +lemma scale_gap {μ L A B : ℝ} (hμ : 0 < μ) (hL : 0 < L) + (h : L*A ≤ B) : μ*A ≤ (μ/L)*B := by + have he : μ*A = (μ/L)*(L*A) := by + rw [← mul_assoc,div_mul_cancel₀ _ hL.ne'] + exact he ▸ mul_le_mul_of_nonneg_left h (div_pos hμ hL).le + +include hd in + +theorem potentialMeasure_subcritical (he : ContDiffOn ℝ ∞ e.symm e.target) + (hb : Bornology.IsBounded e.target) (hne : e.target.Nonempty) + (hμ : 0 < firstPositiveNeumannValue e.target) : + ∃ δ : ℝ, 0 < δ ∧ δ < 1 ∧ + ∀ v : H10 e.open_source, + (∫ x, (H10.value e.open_source v x)^2 + ∂potentialMeasure e d (firstPositiveNeumannValue e.target)) ≤ + δ*‖H10.grad e.open_source v‖^2 := by + apply Exists.elim (weighted_subcritical e he d hd hb hne) + intro L h + refine ⟨firstPositiveNeumannValue e.target/L,div_pos hμ h.1, + (div_lt_one h.1).mpr h.2.1,fun v => ?_⟩ + rw [potentialMeasure_integral e d hμ.le] + exact scale_gap hμ h.1 (h.2.2 v) + + + +theorem exists_actual_subcritical_potential {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : AdmissibleDomain Ω) (hu : InFirstNeumannEigenspace Ω u) + (hu0 : ∃ x ∈ Ω, u x ≠ 0) : + ∃ (e : OpenPartialHomeomorph Plane Plane) (d d' : Plane → ℂ), + e.source = DiskH10.disk ∧ e.target = Ω ∧ + ContDiffOn ℝ ∞ e e.source ∧ ContDiffOn ℝ ∞ e.symm e.target ∧ + (∀ x ∈ e.source, HasFDerivAt e (planeMul (d x)) x) ∧ + (∀ y ∈ e.target, HasFDerivAt e.symm (planeMul (d' y)) y) ∧ + (∀ x ∈ e.source, d x ≠ 0) ∧ (∀ y ∈ e.target, d' y ≠ 0) ∧ + IsFiniteMeasure (potentialMeasure e d (firstPositiveNeumannValue Ω)) ∧ + ∃ δ : ℝ, 0 < δ ∧ δ < 1 ∧ + ∀ v : H10 e.open_source, + (∫ x, (H10.value e.open_source v x)^2 + ∂potentialMeasure e d (firstPositiveNeumannValue Ω)) ≤ + δ*‖H10.grad e.open_source v‖^2 := by + apply Exists.elim (exists_interior_chart hΩ.2.1 hΩ.2.2.2.1 hΩ.1 hΩ.2.2.1) + intro e h + apply Exists.elim h + intro d h + apply Exists.elim h + intro d' h + have hes := h.1 + have het := h.2.1 + have he := h.2.2.1 + have he' := h.2.2.2.1 + have hd := h.2.2.2.2.1 + have hd' := h.2.2.2.2.2.1 + have hn := h.2.2.2.2.2.2.1 + have hn' := h.2.2.2.2.2.2.2 + have hb : Bornology.IsBounded e.target := het.symm ▸ hΩ.2.2.1 + have hne : e.target.Nonempty := het.symm ▸ hΩ.1 + have hμ : 0 < firstPositiveNeumannValue e.target := + het.symm ▸ firstPositiveNeumannValue_pos_of_eigenfunction hΩ hu hu0 + refine ⟨e,d,d',hes,het,he,he',hd,hd',hn,hn', + potentialMeasure_finite e d hd _ hb,?_⟩ + have hh := potentialMeasure_subcritical e d hd he' hb hne hμ + simpa only [het] using hh + +end StrictHotSpots.Conformal +end +end ConformalPotential + +section RiemannSchwarz + +noncomputable section +open Set Filter Metric _root_.OAI.Complex Function +open scoped Topology ComplexConjugate +namespace StrictHotSpots.Riemann + +lemma mobius_neg_zero (z : ℂ) : mobius (-z) 0 = z := by simp + + +theorem schwarz_mobius_ball {f : ℂ → ℂ} {c x : ℂ} {r : ℝ} + (hd : DifferentiableOn ℂ f (ball c r)) + (hm : MapsTo f (ball c r) (ball 0 1)) (hx : x ∈ ball c r) : + ‖mobius (f c) (f x)‖ ≤ dist x c / r := by + have hr : 0 < r := nonempty_ball.mp ⟨x,hx⟩ + have hc : c ∈ ball c r := mem_ball_self hr + have hfc : ‖f c‖ < 1 := mem_ball_zero_iff.mp (hm hc) + let g : ℂ → ℂ := fun y => mobius (f c) (f y) + have hg0 : g c = 0 := mobius_self _ + have hgd : DifferentiableOn ℂ g (ball c r) := by + intro y hy + exact ((hasDerivAt_mobius hfc (mem_ball_zero_iff.mp (hm hy))).differentiableAt.comp y + ((hd y hy).differentiableAt (isOpen_ball.mem_nhds hy))).differentiableWithinAt + have hgm : MapsTo g (ball c r) (closedBall (g c) 1) := by + intro y hy + rw [hg0,mem_closedBall_zero_iff] + exact (norm_mobius_lt hfc (mem_ball_zero_iff.mp (hm hy))).le + have H := Complex.dist_le_div_mul_dist_of_mapsTo_ball hgd hgm hx + simpa only [g,hg0,dist_zero_right,one_div,div_eq_mul_inv,mul_comm,mul_one] using H + + + +theorem schwarz_pick_deriv {f : ℂ → ℂ} + (hd : DifferentiableOn ℂ f (ball 0 1)) + (hm : MapsTo f (ball 0 1) (ball 0 1)) {z : ℂ} (hz : z ∈ ball 0 1) : + ‖deriv f z‖ * (1-‖z‖^2) ≤ 1-‖f z‖^2 := by + have hz' : ‖z‖ < 1 := mem_ball_zero_iff.mp hz + have hfz : ‖f z‖ < 1 := mem_ball_zero_iff.mp (hm hz) + have hneg : ‖-z‖ < 1 := by simpa only [norm_neg] using hz' + let g : ℂ → ℂ := fun w => mobius (f z) (f (mobius (-z) w)) + have hg0 : g 0 = 0 := by simp [g] + have hgd (w : ℂ) (hw : w ∈ ball 0 1) : DifferentiableAt ℂ g w := by + have hw' : ‖w‖ < 1 := mem_ball_zero_iff.mp hw + have hmw : mobius (-z) w ∈ ball 0 1 := mem_ball_zero_iff.mpr (norm_mobius_lt hneg hw') + exact ((hasDerivAt_mobius hfz (mem_ball_zero_iff.mp (hm hmw))).differentiableAt.comp w + (((hd _ hmw).differentiableAt (isOpen_ball.mem_nhds hmw)).comp _ + (hasDerivAt_mobius hneg hw').differentiableAt)) + have hgm : MapsTo g (ball 0 1) (closedBall (g 0) 1) := by + intro w hw + rw [hg0,mem_closedBall_zero_iff] + exact (norm_mobius_lt hfz (mem_ball_zero_iff.mp + (hm (mem_ball_zero_iff.mpr (norm_mobius_lt hneg (mem_ball_zero_iff.mp hw)))))).le + have hle := Complex.norm_deriv_le_one_of_mapsTo_ball + (fun w hw => (hgd w hw).differentiableWithinAt) hgm (by norm_num : (0:ℝ)<1) + have hdf : HasDerivAt f (deriv f z) (mobius (-z) (0:ℂ)) := by + simpa only [mobius_neg_zero] using + ((hd z hz).differentiableAt (isOpen_ball.mem_nhds hz)).hasDerivAt + have hinner : HasDerivAt (fun w : ℂ => f (mobius (-z) w)) + (deriv f z * (1-conj (-z)*(-z))) (0:ℂ) := by + exact hdf.comp (0:ℂ) (hasDerivAt_mobius_zero hneg) + have houter : HasDerivAt (mobius (f z)) + ((1-conj (f z)*f z)/(1-conj (f z)*f z)^2) (f (mobius (-z) (0:ℂ))) := by + simpa only [mobius_neg_zero] using hasDerivAt_mobius hfz hfz + have hd0 := houter.comp (0:ℂ) hinner + change HasDerivAt g + (((1-conj (f z)*f z)/(1-conj (f z)*f z)^2)* + (deriv f z*(1-conj (-z)*(-z)))) 0 at hd0 + rw [hd0.deriv,norm_mul,norm_mul,norm_mobius_self_deriv hfz, + norm_mobius_zero_deriv hneg,norm_neg] at hle + have hpos : 0 < 1-‖f z‖^2 := by nlinarith [norm_nonneg (f z)] + have hh : (‖deriv f z‖*(1-‖z‖^2))/(1-‖f z‖^2) ≤ 1 := by + simpa only [one_div,div_eq_mul_inv,mul_comm,mul_left_comm,mul_assoc,one_mul] using hle + exact (div_le_one hpos).mp hh + +lemma mobius_deficit_identity {a y : ℂ} (ha : ‖a‖ < 1) (hy : ‖y‖ < 1) : + (1-‖mobius a y‖^2)*‖1-conj a*y‖^2 = (1-‖a‖^2)*(1-‖y‖^2) := by + have hn : ‖1-conj a*y‖ ≠ 0 := norm_ne_zero_iff.mpr (mobius_denom_ne ha hy) + rw [mobius,norm_div,div_pow] + calc + _ = ‖1-conj a*y‖^2-‖y-a‖^2 := by rw [sub_mul,one_mul,div_mul_cancel₀ _ (pow_ne_zero _ hn)] + _ = _ := mobius_norm_identity a y + + + +lemma mobius_boundary_deficit {a y : ℂ} {m t : ℝ} + (hm : m < 1) (ha : ‖a‖ ≤ m) (hy : ‖y‖ < 1) + (ht : t < 1) (hmt : ‖mobius a y‖ ≤ t) : + (1-m)^2*(1-t) ≤ 2*(1-‖y‖) := by + have ha' : ‖a‖ < 1 := ha.trans_lt hm + have ht0 : 0 ≤ t := (norm_nonneg _).trans hmt + have hm0 : 0 ≤ m := (norm_nonneg _).trans ha + have hmul : ‖a‖*‖y‖ ≤ m := + (mul_le_of_le_one_right (norm_nonneg _) hy.le).trans ha + have hden : 1-m ≤ ‖1-conj a*y‖ := by + have hh := norm_sub_norm_le (1:ℂ) (conj a*y) + simp only [norm_one,norm_mul,_root_.Complex.norm_conj] at hh + linarith + have hden2 : (1-m)^2 ≤ ‖1-conj a*y‖^2 := + pow_le_pow_left₀ (by linarith) hden 2 + have hmt2 : ‖mobius a y‖^2 ≤ t := by + have hh := pow_le_pow_left₀ (norm_nonneg _) hmt 2 + nlinarith + have hn : 0 ≤ 1-‖mobius a y‖^2 := by nlinarith + calc + _ ≤ ‖1-conj a*y‖^2*(1-‖mobius a y‖^2) := + mul_le_mul hden2 (by linarith) (by linarith) (sq_nonneg _) + _ = (1-‖a‖^2)*(1-‖y‖^2) := + (mul_comm _ _).trans (mobius_deficit_identity ha' hy) + _ ≤ 1-‖y‖^2 := mul_le_of_le_one_left + (by nlinarith [norm_nonneg y]) (by nlinarith [sq_nonneg ‖a‖]) + _ ≤ 2*(1-‖y‖) := by nlinarith [sq_nonneg (1-‖y‖)] + + + +theorem disk_distance_from_interior_ball {f : ℂ → ℂ} {c x : ℂ} {r m : ℝ} + (hd : DifferentiableOn ℂ f (ball c r)) + (hf : MapsTo f (ball c r) (ball 0 1)) (hx : x ∈ ball c r) + (hm : m < 1) (hfc : ‖f c‖ ≤ m) : + (1-m)^2*(r-dist x c) ≤ 2*r*(1-‖f x‖) := by + have hr : 0 < r := nonempty_ball.mp ⟨x,hx⟩ + have ht : dist x c/r < 1 := (div_lt_one hr).mpr hx + have H := mobius_boundary_deficit hm hfc (mem_ball_zero_iff.mp (hf hx)) ht + (schwarz_mobius_ball hd hf hx) + have H' := mul_le_mul_of_nonneg_left H hr.le + have hcancel : r*((1-m)^2*(1-dist x c/r)) = (1-m)^2*(r-dist x c) := by + field_simp + rw [hcancel] at H' + nlinarith only [H'] + +end StrictHotSpots.Riemann +end +end RiemannSchwarz + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Sobolev.lean b/lean/OAI/Analysis/HotSpots/Sobolev.lean new file mode 100644 index 0000000000000000000000000000000000000000..27acd901ba5c90c1908f65925da30424c4e0dcc7 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Sobolev.lean @@ -0,0 +1,1051 @@ +import OAI.Analysis.HotSpots.Reciprocal + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section FullBoundaryCombinedLayer +section WeightedLayer + + + +open Set MeasureTheory +open scoped ContDiff InnerProductSpace ENNReal NNReal +namespace StrictHotSpots + + +lemma existsUnique_of_coercive {V : Type*} [NormedAddCommGroup V] + [InnerProductSpace ℝ V] [CompleteSpace V] + (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) (ℓ : V →L[ℝ] ℝ) : + ∃! u : V, ∀ v : V, B u v = ℓ v := by + let e := hB.continuousLinearEquivOfBilin + let y := (InnerProductSpace.toDual ℝ V).symm ℓ + refine ⟨e.symm y, ?_, ?_⟩ + · intro v + calc + B (e.symm y) v = inner ℝ (e (e.symm y)) v := + (hB.continuousLinearEquivOfBilin_apply _ _).symm + _ = ℓ v := by simp [y, InnerProductSpace.toDual_symm_apply] + · intro u hu + apply e.injective + rw [e.apply_symm_apply] + apply ext_inner_right ℝ + intro v + calc + inner ℝ (e u) v = B u v := hB.continuousLinearEquivOfBilin_apply _ _ + _ = ℓ v := hu v + _ = inner ℝ y v := InnerProductSpace.toDual_symm_apply.symm + + + + +lemma test_memLp {Ω : Set Plane} {φ : Plane → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) : + MemLp φ 2 (volume.restrict Ω) := + MemLp.mono_measure Measure.restrict_le_self + (hφ.continuous.memLp_of_hasCompactSupport hc) + +lemma test_derivative_memLp {Ω : Set Plane} {φ : Plane → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) (e : Plane) : + MemLp (fun x => (fderiv ℝ φ x) e) 2 (volume.restrict Ω) := + MemLp.mono_measure Measure.restrict_le_self + (((hφ.continuous_fderiv (by simp)).clm_apply continuous_const).memLp_of_hasCompactSupport (hc.fderiv_apply ℝ e)) + +lemma HasH1Gradient.add {Ω : Set Plane} {v w : Plane → ℝ} {g k : Plane → Plane} + (hv : HasH1Gradient Ω v g) (hw : HasH1Gradient Ω w k) : + HasH1Gradient Ω (v + w) (g + k) := by + refine ⟨hv.1.add hw.1, hv.2.1.add hw.2.1, ?_⟩ + intro φ hφ hc hs e + have hi1 : Integrable (fun x => v x * (fderiv ℝ φ x) e) (volume.restrict Ω) := + hv.1.integrable_mul (test_derivative_memLp hφ hc e) + have hi2 : Integrable (fun x => w x * (fderiv ℝ φ x) e) (volume.restrict Ω) := + hw.1.integrable_mul (test_derivative_memLp hφ hc e) + have hj1 : Integrable (fun x => inner ℝ (g x) e * φ x) (volume.restrict Ω) := + (hv.2.1.inner_const e).integrable_mul (test_memLp hφ hc) + have hj2 : Integrable (fun x => inner ℝ (k x) e * φ x) (volume.restrict Ω) := + (hw.2.1.inner_const e).integrable_mul (test_memLp hφ hc) + simp only [Pi.add_apply, inner_add_left, add_mul] + rw [integral_add hi1 hi2, integral_add hj1 hj2, + hv.2.2 φ hφ hc hs e, hw.2.2 φ hφ hc hs e] + ring + +lemma HasH1Gradient.smul {Ω : Set Plane} {v : Plane → ℝ} {g : Plane → Plane} + (hv : HasH1Gradient Ω v g) (a : ℝ) : + HasH1Gradient Ω (a • v) (a • g) := by + refine ⟨hv.1.const_smul a, hv.2.1.const_smul a, ?_⟩ + intro φ hφ hc hs e + simp only [Pi.smul_apply, smul_eq_mul, real_inner_smul_left, mul_assoc, + integral_const_mul] + rw [hv.2.2 φ hφ hc hs e] + ring + +lemma HasH1Gradient.sub {Ω : Set Plane} {v w : Plane → ℝ} {g k : Plane → Plane} + (hv : HasH1Gradient Ω v g) (hw : HasH1Gradient Ω w k) : + HasH1Gradient Ω (v - w) (g - k) := by + simpa [sub_eq_add_neg] using hv.add (hw.smul (-1)) + +lemma integral_test_derivative_zero {φ : Plane → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) (e : Plane) : + (∫ x, (fderiv ℝ φ x) e) = 0 := by + have hdi : Integrable (fun x => (fderiv ℝ φ x) e) volume := + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const).integrable_of_hasCompactSupport (hc.fderiv_apply ℝ e) + have hint := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + (f := fun _ : Plane => (1 : ℝ)) (g := φ) (v := e) (μ := volume) + (by simp) (by simpa using hdi) + (by simpa using hφ.continuous.integrable_of_hasCompactSupport hc) + (fun x _ => differentiableAt_const (1 : ℝ)) + (fun x _ => hφ.differentiable (by simp) x) + simpa using hint + +lemma HasH1Gradient.const {Ω : Set Plane} (hbound : Bornology.IsBounded Ω) (a : ℝ) : + HasH1Gradient Ω (fun _ => a) 0 := by + let : IsFiniteMeasure (volume.restrict Ω) := + isFiniteMeasure_restrict.mpr hbound.measure_lt_top.ne + refine ⟨memLp_const a, MemLp.zero, ?_⟩ + intro φ hφ hc hs e + have hr : (∫ x in Ω, (fderiv ℝ φ x) e) = (∫ x, (fderiv ℝ φ x) e) := by + apply setIntegral_eq_integral_of_forall_compl_eq_zero + intro x hx + have hnot : x ∉ tsupport (fun y => (fderiv ℝ φ y) e) := + fun hh => hx (hs (tsupport_fderiv_apply_subset ℝ e hh)) + exact image_eq_zero_of_notMem_tsupport (f := fun y => (fderiv ℝ φ y) e) hnot + simp only [Pi.zero_apply, inner_zero_left, zero_mul, integral_zero, neg_zero, + integral_const_mul, hr, integral_test_derivative_zero hφ hc e, mul_zero] + +lemma integrable_mul_test {Ω : Set Plane} {f φ : Plane → ℝ} + (hΩ : IsOpen Ω) (hf : ContinuousOn f Ω) (hφ : Continuous φ) + (hc : HasCompactSupport φ) (hs : tsupport φ ⊆ Ω) : + Integrable (fun x => f x * φ x) volume := by + have hh : Continuous (fun x => f x * φ x) := + (hf.mul hφ.continuousOn).continuous_of_tsupport_subset hΩ + (tsupport_mul_subset_right.trans hs) + exact hh.integrable_of_hasCompactSupport hc.mul_left + +lemma setIntegral_mul_test {Ω : Set Plane} {f φ : Plane → ℝ} + (hs : tsupport φ ⊆ Ω) : + (∫ x in Ω, f x * φ x) = ∫ x, f x * φ x := by + apply setIntegral_eq_integral_of_forall_compl_eq_zero + intro x hx + rw [image_eq_zero_of_notMem_tsupport (fun hh => hx (hs hh)), mul_zero] + +lemma integral_mul_test_fderiv {Ω : Set Plane} {f φ : Plane → ℝ} + (hΩ : IsOpen Ω) (hf : ContDiffOn ℝ ∞ f Ω) + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) (hs : tsupport φ ⊆ Ω) + (e : Plane) : + (∫ x in Ω, f x * (fderiv ℝ φ x) e) = + -(∫ x in Ω, (fderiv ℝ f x) e * φ x) := by + have hdφ : Continuous (fun x => (fderiv ℝ φ x) e) := + (hφ.continuous_fderiv (by simp)).clm_apply continuous_const + have hdf : ContinuousOn (fun x => (fderiv ℝ f x) e) Ω := + (hf.continuousOn_fderiv_of_isOpen hΩ (by simp)).clm_apply continuousOn_const + have hds : tsupport (fun x => (fderiv ℝ φ x) e) ⊆ Ω := + (tsupport_fderiv_apply_subset ℝ e).trans hs + rw [setIntegral_mul_test hds, setIntegral_mul_test hs] + exact integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + (integrable_mul_test hΩ hdf hφ.continuous hc hs) + (integrable_mul_test hΩ hf.continuousOn hdφ (hc.fderiv_apply ℝ e) hds) + (integrable_mul_test hΩ hf.continuousOn hφ.continuous hc hs) + (fun x hx => ((hf x (hs hx)).contDiffAt (hΩ.mem_nhds (hs hx))).differentiableAt (by simp)) + (fun x _ => hφ.differentiable (by simp) x) + +lemma HasH1Gradient.of_contDiffOn {Ω : Set Plane} {f : Plane → ℝ} + (hΩ : IsOpen Ω) (hf : ContDiffOn ℝ ∞ f Ω) + (hv : MemLp f 2 (volume.restrict Ω)) + (hg : MemLp (gradient f) 2 (volume.restrict Ω)) : + HasH1Gradient Ω f (gradient f) := by + refine ⟨hv, hg, ?_⟩ + intro φ hφ hc hs e + simpa only [inner_gradient_left] using integral_mul_test_fderiv hΩ hf hφ hc hs e + +lemma test_gradient_memLp {Ω : Set Plane} {φ : Plane → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) : + MemLp (gradient φ) 2 (volume.restrict Ω) := by + apply MemLp.mono_measure Measure.restrict_le_self + have hdc : Continuous (gradient φ) := + (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp + (hφ.continuous_fderiv (by simp)) + apply hdc.memLp_of_hasCompactSupport + exact (hc.fderiv ℝ).comp_left (map_zero (InnerProductSpace.toDual ℝ Plane).symm) + +lemma HasH1Gradient.test {Ω : Set Plane} {φ : Plane → ℝ} + (hΩ : IsOpen Ω) (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) : + HasH1Gradient Ω φ (gradient φ) := + .of_contDiffOn hΩ hφ.contDiffOn (test_memLp hφ hc) (test_gradient_memLp hφ hc) + + +lemma test_vector_memLp {Ω : Set Plane} {φ : Plane → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) (e : Plane) : + MemLp (fun x => φ x • e) 2 (volume.restrict Ω) := + (ContinuousLinearMap.smulRight (ContinuousLinearMap.id ℝ ℝ) e).comp_memLp' + (test_memLp hφ hc) + + +structure H1Test (Ω : Set Plane) where + val : Plane → ℝ + smooth : ContDiff ℝ ∞ val + compact : HasCompactSupport val + support : tsupport val ⊆ Ω + +namespace H1Test +variable {Ω : Set Plane} +def scalar (φ : H1Test Ω) : Lp ℝ 2 (volume.restrict Ω) := + (test_memLp φ.smooth φ.compact).toLp φ.val + +def derivative (φ : H1Test Ω) (e : Plane) : Lp ℝ 2 (volume.restrict Ω) := + (test_derivative_memLp φ.smooth φ.compact e).toLp (fun x => (fderiv ℝ φ.val x) e) + +def vector (φ : H1Test Ω) (e : Plane) : Lp Plane 2 (volume.restrict Ω) := + (test_vector_memLp φ.smooth φ.compact e).toLp (fun x => φ.val x • e) +end H1Test + +abbrev H1Ambient (Ω : Set Plane) := WithLp 2 + (Lp ℝ 2 (volume.restrict Ω) × Lp Plane 2 (volume.restrict Ω)) + + +def h1Graph (Ω : Set Plane) : Submodule ℝ (H1Ambient Ω) where + carrier := {v | ∀ (φ : H1Test Ω) (e : Plane), + ⟪v.fst, φ.derivative e⟫_ℝ + ⟪v.snd, φ.vector e⟫_ℝ = 0} + zero_mem' := by simp + add_mem' := by + intro v w hv hw φ e + simp only [WithLp.add_fst, WithLp.add_snd, inner_add_left] + linear_combination hv φ e + hw φ e + smul_mem' := by + intro a v hv φ e + simp only [WithLp.smul_fst, WithLp.smul_snd, real_inner_smul_left] + linear_combination a * hv φ e + +lemma h1Graph_closed (Ω : Set Plane) : IsClosed (h1Graph Ω : Set (H1Ambient Ω)) := by + change IsClosed {v : H1Ambient Ω | ∀ (φ : H1Test Ω) (e : Plane), + ⟪v.fst, φ.derivative e⟫_ℝ + ⟪v.snd, φ.vector e⟫_ℝ = 0} + simp only [ofPred_forall] + apply isClosed_iInter + intro φ + apply isClosed_iInter + intro e + apply isClosed_eq _ continuous_const + exact (((WithLp.fstL 2 ℝ _ _).continuous.inner continuous_const).add + ((WithLp.sndL 2 ℝ _ _).continuous.inner continuous_const)) + +abbrev H1 (Ω : Set Plane) := h1Graph Ω + +instance H1.completeSpace (Ω : Set Plane) : CompleteSpace (H1 Ω) := + (h1Graph_closed Ω).completeSpace_coe + +lemma h1Graph_mem_iff (Ω : Set Plane) (v : H1Ambient Ω) : + v ∈ h1Graph Ω ↔ HasH1Gradient Ω v.fst v.snd := by + have hscalar (φ : H1Test Ω) (e : Plane) : + ⟪v.fst, φ.derivative e⟫_ℝ = ∫ x in Ω, v.fst x * (fderiv ℝ φ.val x) e := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [(test_derivative_memLp (Ω := Ω) φ.smooth φ.compact e).coeFn_toLp] with x hx + simp only [H1Test.derivative] at * + simp [hx, RCLike.inner_apply, mul_comm] + have hvector (φ : H1Test Ω) (e : Plane) : + ⟪v.snd, φ.vector e⟫_ℝ = ∫ x in Ω, inner ℝ (v.snd x) e * φ.val x := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [(test_vector_memLp (Ω := Ω) φ.smooth φ.compact e).coeFn_toLp] with x hx + simp only [H1Test.vector] at * + rw [hx, inner_smul_right] + simp [mul_comm] + constructor + · intro hv + refine ⟨Lp.memLp _, Lp.memLp _, ?_⟩ + intro φ hφ hc hs e + have h := hv (H1Test.mk φ hφ hc hs) e + rw [hscalar, hvector] at h + exact eq_neg_of_add_eq_zero_left h + · intro hv φ e + rw [hscalar, hvector, hv.2.2 φ.val φ.smooth φ.compact φ.support e] + exact neg_add_cancel _ + +lemma HasH1Gradient.congr {Ω : Set Plane} {v w : Plane → ℝ} {g k : Plane → Plane} + (h : HasH1Gradient Ω v g) (hv : v =ᵐ[volume.restrict Ω] w) + (hg : g =ᵐ[volume.restrict Ω] k) : HasH1Gradient Ω w k := by + refine ⟨(memLp_congr_ae hv).mp h.1, (memLp_congr_ae hg).mp h.2.1, ?_⟩ + intro φ hφ hc hs e + calc + (∫ x in Ω, w x * (fderiv ℝ φ x) e) = ∫ x in Ω, v x * (fderiv ℝ φ x) e := by + apply integral_congr_ae + filter_upwards [hv] with x hx + rw [hx] + _ = -(∫ x in Ω, inner ℝ (g x) e * φ x) := h.2.2 φ hφ hc hs e + _ = -(∫ x in Ω, inner ℝ (k x) e * φ x) := by + congr 1 + apply integral_congr_ae + filter_upwards [hg] with x hx + rw [hx] + +def HasH1Gradient.toH1 {Ω : Set Plane} {v : Plane → ℝ} {g : Plane → Plane} + (h : HasH1Gradient Ω v g) : H1 Ω := + ⟨WithLp.toLp 2 (h.1.toLp v, h.2.1.toLp g), + (h1Graph_mem_iff Ω _).mpr (h.congr h.1.coeFn_toLp.symm h.2.1.coeFn_toLp.symm)⟩ + +namespace H1 +variable {Ω : Set Plane} +def value : H1 Ω →L[ℝ] Lp ℝ 2 (volume.restrict Ω) := + (WithLp.fstL 2 ℝ _ _).comp (h1Graph Ω).subtypeL + +def grad : H1 Ω →L[ℝ] Lp Plane 2 (volume.restrict Ω) := + (WithLp.sndL 2 ℝ _ _).comp (h1Graph Ω).subtypeL + +lemma hasH1Gradient (u : H1 Ω) : HasH1Gradient Ω (value u) (grad u) := + (h1Graph_mem_iff Ω u.val).mp u.property + +lemma norm_sq (u : H1 Ω) : ‖u‖^2 = ‖value u‖^2 + ‖grad u‖^2 := by + exact WithLp.prod_norm_sq_eq_of_L2 u.val + +lemma value_toH1 {v : Plane → ℝ} {g : Plane → Plane} (h : HasH1Gradient Ω v g) : + value h.toH1 = h.1.toLp v := rfl + +lemma grad_toH1 {v : Plane → ℝ} {g : Plane → Plane} (h : HasH1Gradient Ω v g) : + grad h.toH1 = h.2.1.toLp g := rfl + +lemma grad_unique (hΩ : IsOpen Ω) {v : Plane → ℝ} {g k : Plane → Plane} + (hg : HasH1Gradient Ω v g) (hk : HasH1Gradient Ω v k) : + g =ᵐ[volume.restrict Ω] k := by + have hi (e : Plane) : ∀ᵐ x ∂volume.restrict Ω, inner ℝ (g x - k x) e = 0 := by + have hl := ((hg.2.1.sub hk.2.1).inner_const (𝕜 := ℝ) e).locallyIntegrable (by norm_num : (1 : ℝ≥0∞) ≤ 2) + have ht := hΩ.ae_eq_zero_of_integral_contDiff_smul_eq_zero + (μ := volume.restrict Ω) (hl.locallyIntegrableOn Ω) + (fun φ hφ hc hs => show (∫ x in Ω, φ x • inner ℝ (g x - k x) e) = 0 from by + have hgφ := hg.2.2 φ hφ hc hs e + have hkφ := hk.2.2 φ hφ hc hs e + have hgi : Integrable (fun x => inner ℝ (g x) e * φ x) (volume.restrict Ω) := + (hg.2.1.inner_const e).integrable_mul (test_memLp hφ hc) + have hki : Integrable (fun x => inner ℝ (k x) e * φ x) (volume.restrict Ω) := + (hk.2.1.inner_const e).integrable_mul (test_memLp hφ hc) + simp only [smul_eq_mul, inner_sub_left, mul_sub] + rw [integral_sub (by simpa [Pi.mul_apply, mul_comm] using hgi) (by simpa [Pi.mul_apply, mul_comm] using hki)] + simp_rw [mul_comm (φ _)] + linarith) + filter_upwards [ht, ae_restrict_mem hΩ.measurableSet] with x hx hxΩ + exact hx hxΩ + have hb : ∀ᵐ x ∂volume.restrict Ω, ∀ i : Fin 2, + inner ℝ (g x - k x) (EuclideanSpace.basisFun (Fin 2) ℝ i) = 0 := + ae_all_iff.mpr fun i => hi _ + filter_upwards [hb] with x hx + have hz : g x - k x = 0 := by + ext i + simpa [EuclideanSpace.basisFun_apply, EuclideanSpace.inner_single_right] using hx i + exact sub_eq_zero.mp hz + +lemma value_injective (hΩ : IsOpen Ω) : Function.Injective (value (Ω := Ω)) := by + intro u v huv + have hdata : (value u : Plane → ℝ) =ᵐ[volume.restrict Ω] value v := by rw [huv] + have hgrad := grad_unique hΩ ((hasH1Gradient u).congr hdata (Filter.EventuallyEq.refl _ _)) + (hasH1Gradient v) + apply Subtype.ext + apply (WithLp.prodContinuousLinearEquiv 2 ℝ _ _).injective + exact Prod.ext huv (Lp.ext hgrad) +end H1 + + +def smoothTestSpace (Ω : Set Plane) : Submodule ℝ (Plane → ℝ) where + carrier := {f | ContDiff ℝ ∞ f ∧ HasCompactSupport f ∧ tsupport f ⊆ Ω} + zero_mem' := by + refine ⟨contDiff_const, ?_, by simp⟩ + change IsCompact (tsupport (0 : Plane → ℝ)) + simp + add_mem' := by + rintro f g ⟨hf, hfc, hfs⟩ ⟨hg, hgc, hgs⟩ + exact ⟨hf.add hg, hfc.add hgc, (tsupport_add f g).trans (union_subset hfs hgs)⟩ + smul_mem' := by + rintro a f ⟨hf, hfc, hfs⟩ + exact ⟨hf.const_smul a, hfc.smul_left, + (tsupport_smul_subset_right (fun _ => a) f).trans hfs⟩ + +def smoothTestToH1 {Ω : Set Plane} (hΩ : IsOpen Ω) : smoothTestSpace Ω →ₗ[ℝ] H1 Ω where + toFun f := (HasH1Gradient.test hΩ f.property.1 f.property.2.1).toH1 + map_add' f g := by + apply H1.value_injective hΩ + exact (test_memLp (Ω := Ω) f.property.1 f.property.2.1).toLp_add + (test_memLp (Ω := Ω) g.property.1 g.property.2.1) + map_smul' a f := by + apply H1.value_injective hΩ + exact (test_memLp (Ω := Ω) f.property.1 f.property.2.1).toLp_const_smul a + +lemma smoothTestToH1_value_norm {Ω : Set Plane} (hΩ : IsOpen Ω) + (f : smoothTestSpace Ω) : + ‖H1.value (smoothTestToH1 hΩ f)‖ = + (eLpNorm (f : Plane → ℝ) 2 (volume.restrict Ω)).toReal := by + rw [show smoothTestToH1 hΩ f = + (HasH1Gradient.test hΩ f.property.1 f.property.2.1).toH1 from rfl, + H1.value_toH1] + exact Lp.norm_toLp _ _ + +lemma smoothTestToH1_grad_norm {Ω : Set Plane} (hΩ : IsOpen Ω) + (f : smoothTestSpace Ω) : + ‖H1.grad (smoothTestToH1 hΩ f)‖ = + (eLpNorm (gradient (f : Plane → ℝ)) 2 (volume.restrict Ω)).toReal := by + rw [show smoothTestToH1 hΩ f = + (HasH1Gradient.test hΩ f.property.1 f.property.2.1).toH1 from rfl, + H1.grad_toH1] + exact Lp.norm_toLp _ _ + + +def h10Submodule {Ω : Set Plane} (hΩ : IsOpen Ω) : Submodule ℝ (H1 Ω) := + (smoothTestToH1 hΩ).range.topologicalClosure + +abbrev H10 {Ω : Set Plane} (hΩ : IsOpen Ω) := h10Submodule hΩ + +instance H10.normedAddCommGroup {Ω : Set Plane} (hΩ : IsOpen Ω) : + NormedAddCommGroup (H10 hΩ) := (h10Submodule hΩ).normedAddCommGroup + +instance H10.innerProductSpace {Ω : Set Plane} (hΩ : IsOpen Ω) : + InnerProductSpace ℝ (H10 hΩ) := (h10Submodule hΩ).innerProductSpace + +instance H10.completeSpace {Ω : Set Plane} (hΩ : IsOpen Ω) : CompleteSpace (H10 hΩ) := + (LinearMap.range (smoothTestToH1 hΩ)).isClosed_topologicalClosure.completeSpace_coe + + + +lemma test_sobolev_ennreal {Ω : Set Plane} {f : Plane → ℝ} + (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) (hs : tsupport f ⊆ Ω) : + eLpNorm f 2 (volume.restrict Ω) ≤ + eLpNormLESNormFDerivOneConst (volume : Measure Plane) 2 * + eLpNorm (fderiv ℝ f) 1 (volume.restrict Ω) := by + have hn : NNReal.HolderConjugate (Module.finrank ℝ Plane) 2 := by + simpa [Plane, finrank_euclideanSpace] using NNReal.HolderConjugate.two_two + have hS := eLpNorm_le_eLpNorm_fderiv_one (volume : Measure Plane) + (hf.of_le (by simp)) hc hn + have hs' : Function.support f ⊆ Ω := (subset_tsupport _).trans hs + have hds : Function.support (fderiv ℝ f) ⊆ Ω := + (subset_tsupport _).trans ((tsupport_fderiv_subset ℝ).trans hs) + rw [eLpNorm_restrict_eq_of_support_subset hf.continuous.aestronglyMeasurable hs', + eLpNorm_restrict_eq_of_support_subset (f := fderiv ℝ f) + (p := (1 : ℝ≥0∞)) (μ := volume) + (hf.continuous_fderiv (by simp)).aestronglyMeasurable hds] + exact hS + +lemma eLpNorm_fderiv_le_L2_gradient {Ω : Set Plane} {f : Plane → ℝ} + (hf : ContDiff ℝ ∞ f) : + eLpNorm (fderiv ℝ f) 1 (volume.restrict Ω) ≤ + eLpNorm (gradient f) 2 (volume.restrict Ω) * (volume Ω) ^ (1 / 2 : ℝ) := by + have hL := eLpNorm_le_eLpNorm_mul_rpow_measure_univ + (μ := volume.restrict Ω) (f := fderiv ℝ f) + (p := 1) (q := 2) (by norm_num) + (hf.continuous_fderiv (by simp)).aestronglyMeasurable + have hG : eLpNorm (fderiv ℝ f) 2 (volume.restrict Ω) = + eLpNorm (gradient f) 2 (volume.restrict Ω) := by + apply eLpNorm_congr_norm_ae + (hf.continuous_fderiv (by simp)).aestronglyMeasurable + (((InnerProductSpace.toDual ℝ Plane).symm.continuous.comp + (hf.continuous_fderiv (by simp))).aestronglyMeasurable) + exact Filter.Eventually.of_forall fun x => + ((InnerProductSpace.toDual ℝ Plane).symm.norm_map _).symm + rw [hG] at hL + convert hL using 1 + norm_num + + +lemma test_poincare_ennreal {Ω : Set Plane} {f : Plane → ℝ} + (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) (hs : tsupport f ⊆ Ω) : + eLpNorm f 2 (volume.restrict Ω) ≤ + (eLpNormLESNormFDerivOneConst (volume : Measure Plane) 2 : ℝ≥0∞) * + (volume Ω) ^ (1 / 2 : ℝ) * eLpNorm (gradient f) 2 (volume.restrict Ω) := by + calc + _ ≤ (eLpNormLESNormFDerivOneConst (volume : Measure Plane) 2 : ℝ≥0∞) * + eLpNorm (fderiv ℝ f) 1 (volume.restrict Ω) := test_sobolev_ennreal hf hc hs + _ ≤ (eLpNormLESNormFDerivOneConst (volume : Measure Plane) 2 : ℝ≥0∞) * + (eLpNorm (gradient f) 2 (volume.restrict Ω) * (volume Ω) ^ (1 / 2 : ℝ)) := + mul_le_mul_right (eLpNorm_fderiv_le_L2_gradient hf) _ + _ = _ := by ac_rfl + +lemma test_poincare_real {Ω : Set Plane} (hb : Bornology.IsBounded Ω) + {f : Plane → ℝ} (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) + (hs : tsupport f ⊆ Ω) : + (eLpNorm f 2 (volume.restrict Ω)).toReal ≤ + ((eLpNormLESNormFDerivOneConst (volume : Measure Plane) 2 : ℝ≥0∞) * + (volume Ω) ^ (1 / 2 : ℝ)).toReal * + (eLpNorm (gradient f) 2 (volume.restrict Ω)).toReal := by + have hA : (eLpNormLESNormFDerivOneConst (volume : Measure Plane) 2 : ℝ≥0∞) ≠ (∞ : ℝ≥0∞) := + ENNReal.coe_ne_top + have hB : (volume Ω) ^ (1 / 2 : ℝ) ≠ (∞ : ℝ≥0∞) := + ENNReal.rpow_ne_top_of_nonneg (by norm_num) hb.measure_lt_top.ne + have hg := test_gradient_memLp (Ω := Ω) hf hc + have h := ENNReal.toReal_mono + (ENNReal.mul_ne_top (ENNReal.mul_ne_top hA hB) hg.eLpNorm_ne_top) + (test_poincare_ennreal hf hc hs) + rwa [ENNReal.toReal_mul] at h + + + +lemma smoothTest_poincare {Ω : Set Plane} (hΩ : IsOpen Ω) + (hb : Bornology.IsBounded Ω) : + ∃ C : ℝ, 0 < C ∧ ∀ f : smoothTestSpace Ω, + ‖H1.value (smoothTestToH1 hΩ f)‖ ≤ C * ‖H1.grad (smoothTestToH1 hΩ f)‖ := by + let A : ℝ≥0∞ := eLpNormLESNormFDerivOneConst (volume : Measure Plane) 2 + let B : ℝ≥0∞ := (volume Ω) ^ (1 / 2 : ℝ) + let C := (A * B).toReal + 1 + refine ⟨C, add_pos_of_nonneg_of_pos ENNReal.toReal_nonneg zero_lt_one, ?_⟩ + intro f + have hreal := test_poincare_real hb f.property.1 f.property.2.1 f.property.2.2 + rw [smoothTestToH1_value_norm, smoothTestToH1_grad_norm] + apply hreal.trans + exact mul_le_mul_of_nonneg_right (le_add_of_nonneg_right zero_le_one) ENNReal.toReal_nonneg + +private lemma norm_bound_on_closure {Domain : Type*} {Value : Type*} {Gradient : Type*} + [TopologicalSpace Domain] [SeminormedAddCommGroup Value] + [SeminormedAddCommGroup Gradient] (value : Domain → Value) (grad : Domain → Gradient) + (hvalue : Continuous value) (hgrad : Continuous grad) (constant : ℝ) + {tests : Set Domain} (hbound : ∀ point ∈ tests, ‖value point‖ ≤ constant * ‖grad point‖) + {point : Domain} (hpoint : point ∈ closure tests) : + ‖value point‖ ≤ constant * ‖grad point‖ := + closure_minimal hbound (isClosed_le hvalue.norm (continuous_const.mul hgrad.norm)) hpoint + +namespace H10 +variable {Ω : Set Plane} (hΩ : IsOpen Ω) + +local instance : NormedSpace ℝ (H10 hΩ) := (H10.innerProductSpace hΩ).toNormedSpace + +def value : H10 hΩ →L[ℝ] Lp ℝ 2 (volume.restrict Ω) := + H1.value.comp (h10Submodule hΩ).subtypeL + +def grad : H10 hΩ →L[ℝ] Lp Plane 2 (volume.restrict Ω) := + H1.grad.comp (h10Submodule hΩ).subtypeL + +lemma norm_sq (u : H10 hΩ) : ‖u‖ ^ 2 = ‖value hΩ u‖ ^ 2 + ‖grad hΩ u‖ ^ 2 := + H1.norm_sq u.val + +lemma poincare (hb : Bornology.IsBounded Ω) : + ∃ C : ℝ, 0 < C ∧ ∀ u : H10 hΩ, ‖value hΩ u‖ ≤ C * ‖grad hΩ u‖ := by + obtain ⟨C, hC, htest⟩ := smoothTest_poincare hΩ hb + have hsub : ∀ v ∈ ((smoothTestToH1 hΩ).range : Set (H1 Ω)), + ‖H1.value v‖ ≤ C * ‖H1.grad v‖ := by + rintro v ⟨f, rfl⟩ + exact htest f + refine ⟨C, hC, fun u => ?_⟩ + exact norm_bound_on_closure H1.value H1.grad + H1.value.continuous H1.grad.continuous C hsub u.property + + +def energy : H10 hΩ →L[ℝ] H10 hΩ →L[ℝ] ℝ := by + letI : NormedSpace ℝ (H10 hΩ) := (H10.innerProductSpace hΩ).toNormedSpace + let a : Lp Plane 2 (volume.restrict Ω) →L[ℝ] + Lp Plane 2 (volume.restrict Ω) →L[ℝ] ℝ := innerSL ℝ + let b : H10 hΩ →L[ℝ] Lp Plane 2 (volume.restrict Ω) →L[ℝ] ℝ := + a.comp (grad hΩ) + let c : Lp Plane 2 (volume.restrict Ω) →L[ℝ] H10 hΩ →L[ℝ] ℝ := ContinuousLinearMap.flip (E := H10 hΩ) (F := Lp Plane 2 (volume.restrict Ω)) b + let d : H10 hΩ →L[ℝ] H10 hΩ →L[ℝ] ℝ := c.comp (grad hΩ) + exact ContinuousLinearMap.flip (E := H10 hΩ) (F := H10 hΩ) d + +@[simp] lemma energy_apply (u v : H10 hΩ) : + energy hΩ u v = inner ℝ (grad hΩ u) (grad hΩ v) := rfl + +lemma energy_coercive (hb : Bornology.IsBounded Ω) : + @IsCoercive (H10 hΩ) (H10.normedAddCommGroup hΩ).toSeminormedAddCommGroup + (H10.innerProductSpace hΩ).toNormedSpace (energy hΩ) := by + obtain ⟨C, hC, hP⟩ := poincare hΩ hb + have hD : 0 < C ^ 2 + 1 := by positivity + refine ⟨1 / (C ^ 2 + 1), by positivity, fun u => ?_⟩ + have hsq := (sq_le_sq₀ (norm_nonneg (value hΩ u)) + (mul_nonneg hC.le (norm_nonneg (grad hΩ u)))).mpr (hP u) + have hbound : ‖u‖ ^ 2 ≤ (C ^ 2 + 1) * ‖grad hΩ u‖ ^ 2 := by + rw [norm_sq hΩ] + nlinarith + calc + (1 / (C ^ 2 + 1)) * ‖u‖ * ‖u‖ = ‖u‖ ^ 2 / (C ^ 2 + 1) := by ring + _ ≤ ‖grad hΩ u‖ ^ 2 := (div_le_iff₀ hD).mpr (by simpa [mul_comm] using hbound) + _ = energy hΩ u u := (real_inner_self_eq_norm_sq _).symm + + + +lemma existsUnique_energy_solution (hb : Bornology.IsBounded Ω) + (ℓ : H10 hΩ →L[ℝ] ℝ) : + ∃! u : H10 hΩ, ∀ v : H10 hΩ, energy hΩ u v = ℓ v := by + exact @existsUnique_of_coercive (H10 hΩ) (H10.normedAddCommGroup hΩ) + (H10.innerProductSpace hΩ) (H10.completeSpace hΩ) + (energy hΩ) (energy_coercive hΩ hb) ℓ + + +lemma existsUnique_dirichlet_solution (hb : Bornology.IsBounded Ω) + (f : Lp ℝ 2 (volume.restrict Ω)) : + ∃! u : H10 hΩ, ∀ v : H10 hΩ, + inner ℝ (grad hΩ u) (grad hΩ v) = inner ℝ f (value hΩ v) := + existsUnique_energy_solution hΩ hb ((innerSL ℝ f).comp (value hΩ)) + +end H10 +end StrictHotSpots + + + + +open Set Filter MeasureTheory InnerProductSpace NormedSpace +open scoped Topology ContDiff +namespace StrictHotSpots.DiskCutoff + +lemma transition_deriv_zero {t : ℝ} (ht : t < 0 ∨ 1 < t) : + deriv Real.smoothTransition t = 0 := by + rcases ht with ht | ht + · have h : Real.smoothTransition =ᶠ[𝓝 t] fun _ => (0 : ℝ) := by + filter_upwards [eventually_lt_nhds ht] with x hx + exact Real.smoothTransition.zero_of_nonpos hx.le + simpa using h.deriv_eq + · have h : Real.smoothTransition =ᶠ[𝓝 t] fun _ => (1 : ℝ) := by + filter_upwards [eventually_gt_nhds ht] with x hx + exact Real.smoothTransition.one_of_one_le hx.le + simpa using h.deriv_eq + +lemma transition_deriv_bound : ∃ L : ℝ, 0 ≤ L ∧ + ∀ t, ‖deriv Real.smoothTransition t‖ ≤ L := by + obtain ⟨C,hC⟩ := isCompact_Icc.exists_bound_of_continuousOn + (show ContinuousOn (deriv Real.smoothTransition) (Icc (0 : ℝ) 1) from + (Real.smoothTransition.contDiff (n := ⊤)).continuous_deriv (by simp) |>.continuousOn) + refine ⟨max C 0, le_max_right _ _, fun t => ?_⟩ + by_cases ht : t ∈ Icc (0 : ℝ) 1 + · exact (hC t ht).trans (le_max_left _ _) + · have h : t < 0 ∨ 1 < t := by simpa only [mem_Icc, not_and_or, not_le] using ht + rw [transition_deriv_zero h, norm_zero] + exact le_max_right _ _ + +variable {E : Type*} [NormedAddCommGroup E] + +def cutoff (κ : ℝ) (x : E) : ℝ := + Real.smoothTransition (κ * (1 - ‖x‖ ^ 2) - 1) + +lemma cutoff_nonneg (κ : ℝ) (x : E) : 0 ≤ cutoff κ x := + Real.smoothTransition.nonneg _ + +lemma cutoff_le_one (κ : ℝ) (x : E) : cutoff κ x ≤ 1 := + Real.smoothTransition.le_one _ + +lemma cutoff_zero {κ : ℝ} {x : E} (hκ : 0 < κ) (hx : 1 - κ⁻¹ ≤ ‖x‖ ^ 2) : + cutoff κ x = 0 := by + apply Real.smoothTransition.zero_of_nonpos + have hh : κ * κ⁻¹ = 1 := mul_inv_cancel₀ hκ.ne' + nlinarith [mul_nonneg hκ.le (sub_nonneg.mpr hx)] + +lemma cutoff_one {κ : ℝ} {x : E} (hx : 2 ≤ κ * (1 - ‖x‖ ^ 2)) : + cutoff κ x = 1 := Real.smoothTransition.one_of_one_le (by linarith) + +lemma cutoff_tsupport {κ : ℝ} (hκ : 0 < κ) : + tsupport (cutoff (E := E) κ) ⊆ {x | ‖x‖ ^ 2 ≤ 1 - κ⁻¹} := by + apply closure_minimal _ (isClosed_le (continuous_norm.pow 2) continuous_const) + intro x hx + change ‖x‖ ^ 2 ≤ 1 - κ⁻¹ + by_contra hh + exact hx (cutoff_zero hκ (le_of_lt (lt_of_not_ge hh))) + +lemma cutoff_tsupport_disk {κ : ℝ} (hκ : 0 < κ) : + tsupport (cutoff (E := E) κ) ⊆ Metric.ball 0 1 := by + intro x hx + have h := cutoff_tsupport hκ hx + change ‖x‖ ^ 2 ≤ 1 - κ⁻¹ at h + simp only [Metric.mem_ball, dist_zero_right] + have hi : 0 < κ⁻¹ := inv_pos.mpr hκ + have hn := norm_nonneg x + nlinarith + +lemma cutoff_hasCompactSupport [ProperSpace E] {κ : ℝ} (hκ : 0 < κ) : + HasCompactSupport (cutoff (E := E) κ) := + isCompact_closedBall 0 1 |>.of_isClosed_subset (isClosed_tsupport _) + ((cutoff_tsupport_disk hκ).trans Metric.ball_subset_closedBall) + +variable [InnerProductSpace ℝ E] + +lemma cutoff_contDiff (κ : ℝ) : ContDiff ℝ ∞ (cutoff (E := E) κ) := + Real.smoothTransition.contDiff.comp + ((contDiff_const.mul (contDiff_const.sub (contDiff_id.norm_sq (𝕜 := ℝ)))).sub contDiff_const) + +lemma cutoff_fderiv (κ : ℝ) (x : E) : + fderiv ℝ (cutoff κ) x = + (-2 * κ * deriv Real.smoothTransition (κ * (1 - ‖x‖ ^ 2) - 1)) • innerSL ℝ x := by + have hnorm := (hasStrictFDerivAt_norm_sq x).hasFDerivAt + have ha := ((hnorm.const_sub 1).const_mul κ).sub_const 1 + have hb := ((Real.smoothTransition.contDiff (n := ⊤)).differentiable (by simp) (κ * (1 - ‖x‖ ^ 2) - 1)).hasDerivAt + have hc := hb.comp_hasFDerivAt x ha + change fderiv ℝ (Real.smoothTransition ∘ fun x : E => κ * (1 - ‖x‖ ^ 2) - 1) x = _ + rw [hc.fderiv] + ext y + simp + ring + +lemma cutoff_fderiv_zero {κ : ℝ} {x : E} + (hx : 2 < κ * (1 - ‖x‖ ^ 2)) : fderiv ℝ (cutoff κ) x = 0 := by + rw [cutoff_fderiv, transition_deriv_zero (Or.inr (by linarith))] + simp + +lemma cutoff_eventually_one (x : E) (hx : ‖x‖ < 1) : + ∀ᶠ n : ℕ in atTop, cutoff ((n : ℝ) + 2) x = 1 ∧ + fderiv ℝ (cutoff ((n : ℝ) + 2)) x = 0 := by + have hp : 0 < 1 - ‖x‖ ^ 2 := by nlinarith [norm_nonneg x] + have ht : Tendsto (fun n : ℕ => ((n : ℝ) + 2) * (1 - ‖x‖ ^ 2)) atTop atTop := + (tendsto_atTop_add_const_right atTop 2 tendsto_natCast_atTop_atTop).atTop_mul_const hp + filter_upwards [ht.eventually (eventually_gt_atTop (2 : ℝ))] with n hn + exact ⟨cutoff_one hn.le, cutoff_fderiv_zero hn⟩ + +lemma boundary_vanishing_estimate [Nontrivial E] {f : E → ℝ} {C : ℝ} + (hC : 0 ≤ C) + (hf : ∀ x ∈ Metric.closedBall (0 : E) 1, DifferentiableAt ℝ f x) + (hd : ∀ x ∈ Metric.closedBall (0 : E) 1, ‖fderiv ℝ f x‖ ≤ C) + (hz : ∀ x : E, ‖x‖ = 1 → f x = 0) {x : E} (hx : ‖x‖ ≤ 1) : + ‖f x‖ ≤ C * (1 - ‖x‖ ^ 2) := by + have hpoint : ∃ y : E, ‖y‖ = 1 ∧ ‖y-x‖ = 1-‖x‖ := by + by_cases h : x = 0 + · obtain ⟨y,hy⟩ := exists_ne (0 : E) + exact ⟨normalize y, norm_normalize hy, by simp [h, norm_normalize hy]⟩ + · refine ⟨normalize x, norm_normalize h, ?_⟩ + calc + ‖normalize x - x‖ = ‖(1-‖x‖) • normalize x‖ := by rw [sub_smul, one_smul, norm_smul_normalize] + _ = 1-‖x‖ := by rw [norm_smul, norm_normalize h, mul_one, Real.norm_eq_abs, abs_of_nonneg (sub_nonneg.mpr hx)] + obtain ⟨y,hy,hdist⟩ := hpoint + have hh := Convex.norm_image_sub_le_of_norm_fderiv_le hf hd + (convex_closedBall (0 : E) (1 : ℝ)) + (show x ∈ Metric.closedBall (0 : E) 1 by simpa using hx) + (show y ∈ Metric.closedBall (0 : E) 1 by simp [hy]) + rw [hz y hy, zero_sub, norm_neg, hdist] at hh + apply hh.trans + apply mul_le_mul_of_nonneg_left _ hC + nlinarith [norm_nonneg x] + +lemma cutoff_mul_contDiff {f : E → ℝ} {κ R : ℝ} + (hκ : 0 < κ) (hR : 1 < R) (hf : ContDiffOn ℝ ∞ f (Metric.ball 0 R)) : + ContDiff ℝ ∞ (fun x => cutoff κ x * f x) := by + rw [contDiff_iff_contDiffAt] + intro x + by_cases hx : x ∈ tsupport (cutoff (E := E) κ) + · have hxd := cutoff_tsupport_disk hκ hx + have hxR : x ∈ Metric.ball (0 : E) R := Metric.ball_subset_ball hR.le hxd + exact (cutoff_contDiff κ).contDiffAt.mul + ((hf x hxR).contDiffAt (Metric.isOpen_ball.mem_nhds hxR)) + · have he := notMem_tsupport_iff_eventuallyEq.mp hx + apply (contDiffAt_const (c := (0 : ℝ))).congr_of_eventuallyEq + filter_upwards [he] with y hy + simp [hy] + +omit [InnerProductSpace ℝ E] in +lemma cutoff_mul_hasCompactSupport [ProperSpace E] {f : E → ℝ} {κ : ℝ} + (hκ : 0 < κ) : HasCompactSupport (fun x => cutoff κ x * f x) := + (cutoff_hasCompactSupport hκ).mul_right + +omit [InnerProductSpace ℝ E] in +lemma cutoff_mul_norm_le {f : E → ℝ} {κ C : ℝ} {x : E} (hf : ‖f x‖ ≤ C) : + ‖cutoff κ x * f x‖ ≤ C := by + rw [norm_mul, Real.norm_eq_abs, abs_of_nonneg (cutoff_nonneg _ _)] + exact (mul_le_of_le_one_left (norm_nonneg _) (cutoff_le_one _ _)).trans hf + +lemma cutoff_mul_fderiv_bound {f : E → ℝ} {κ C L : ℝ} {x : E} + (hκ : 0 < κ) (hC : 0 ≤ C) (hL : 0 ≤ L) (hx : ‖x‖ ≤ 1) + (hf : DifferentiableAt ℝ f x) (hd : ‖fderiv ℝ f x‖ ≤ C) + (hz : ‖f x‖ ≤ C * (1 - ‖x‖ ^ 2)) + (ht : ∀ t, ‖deriv Real.smoothTransition t‖ ≤ L) : + ‖fderiv ℝ (fun x => cutoff κ x * f x) x‖ ≤ C + 4 * C * L := by + rw [fderiv_fun_mul ((cutoff_contDiff κ).differentiable (by simp) x) hf] + apply (norm_add_le _ _).trans + have h1 : ‖cutoff κ x • fderiv ℝ f x‖ ≤ C := by + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (cutoff_nonneg _ _)] + exact (mul_le_of_le_one_left (norm_nonneg _) (cutoff_le_one _ _)).trans hd + have h2 : ‖f x • fderiv ℝ (cutoff κ) x‖ ≤ 4 * C * L := by + by_cases hh : 2 < κ * (1 - ‖x‖ ^ 2) + · rw [cutoff_fderiv_zero hh, smul_zero, norm_zero] + positivity + · have hh' : κ * (1 - ‖x‖ ^ 2) ≤ 2 := le_of_not_gt hh + rw [norm_smul, cutoff_fderiv, norm_smul] + simp only [norm_mul, norm_neg, Real.norm_of_nonneg hκ.le, + innerSL_apply_norm] + rw [show ‖(2 : ℝ)‖ = 2 by norm_num] + have hn : 0 ≤ 1 - ‖x‖ ^ 2 := by nlinarith [norm_nonneg x] + calc + _ ≤ (C * (1 - ‖x‖ ^ 2)) * (2 * κ * L * 1) := by + apply mul_le_mul hz _ (by positivity) (mul_nonneg hC hn) + exact mul_le_mul (mul_le_mul_of_nonneg_left (ht _) (by positivity)) hx + (norm_nonneg _) (by positivity) + _ = 2 * C * L * (κ * (1 - ‖x‖ ^ 2)) := by ring + _ ≤ 4 * C * L := by nlinarith [mul_le_mul_of_nonneg_left hh' (show 0 ≤ 2 * C * L by positivity)] + exact add_le_add h1 h2 + +end StrictHotSpots.DiskCutoff + +namespace StrictHotSpots.L2VectorLimits +variable {X : Type*} [MeasurableSpace X] {ν : Measure X} +variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F] + +lemma norm_sq_eq_integral_norm_sq (f : Lp F 2 ν) : + ‖f‖ ^ 2 = ∫ x, ‖f x‖ ^ 2 ∂ν := by + rw [← real_inner_self_eq_norm_sq, L2.inner_def] + simp only [real_inner_self_eq_norm_sq] + +lemma norm_toLp_sub_sq {f g : X → F} (hf : MemLp f 2 ν) (hg : MemLp g 2 ν) : + ‖hf.toLp f - hg.toLp g‖ ^ 2 = ∫ x, ‖f x - g x‖ ^ 2 ∂ν := by + rw [norm_sq_eq_integral_norm_sq] + apply integral_congr_ae + filter_upwards [Lp.coeFn_sub (hf.toLp f) (hg.toLp g), hf.coeFn_toLp, hg.coeFn_toLp] + with x hx hfx hgx + simp only [hx, hfx, hgx, Pi.sub_apply] + +lemma tendsto_toLp_of_dominated {ι : Type*} {l : Filter ι} [l.IsCountablyGenerated] + {f : ι → X → F} {g : X → F} {b : X → ℝ} + (hf : ∀ n, MemLp (f n) 2 ν) (hg : MemLp g 2 ν) (hb : MemLp b 2 ν) + (hdom : ∀ᶠ n in l, ∀ᵐ x ∂ν, ‖f n x‖ ≤ b x) + (hlim : ∀ᵐ x ∂ν, Tendsto (fun n => f n x) l (𝓝 (g x))) : + Tendsto (fun n => (hf n).toLp (f n)) l (𝓝 (hg.toLp g)) := by + have ht : Tendsto (fun n => ∫ x, ‖f n x - g x‖ ^ 2 ∂ν) l (𝓝 0) := by + have hm : ∀ᶠ n in l, AEStronglyMeasurable (fun x => ‖f n x-g x‖ ^ 2) ν := + Eventually.of_forall fun n => ((hf n).sub hg).aestronglyMeasurable.norm.pow 2 + have hd : ∀ᶠ n in l, ∀ᵐ x ∂ν, ‖‖f n x-g x‖ ^ 2‖ ≤ (b x+‖g x‖)^2 := by + filter_upwards [hdom] with n hn + filter_upwards [hn] with x hx + have h1 : ‖f n x-g x‖ ≤ b x+‖g x‖ := + by linarith [norm_sub_le (f n x) (g x)] + rw [Real.norm_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (norm_nonneg _) h1 2 + have hl : ∀ᵐ x ∂ν, Tendsto (fun n => ‖f n x-g x‖ ^ 2) l (𝓝 (0 : ℝ)) := by + filter_upwards [hlim] with x hx + simpa using (hx.sub_const (g x)).norm.pow 2 + simpa using tendsto_integral_filter_of_dominated_convergence + (fun x => (b x+‖g x‖)^2) hm hd (hb.add hg.norm).integrable_sq hl + have hs : Tendsto (fun n => ‖(hf n).toLp (f n)-hg.toLp g‖^2) l (𝓝 0) := by + simpa only [norm_toLp_sub_sq] using ht + rw [tendsto_iff_norm_sub_tendsto_zero] + have hr := Real.continuous_sqrt.continuousAt.tendsto.comp hs + simpa only [Function.comp_def, Real.sqrt_sq (norm_nonneg _), Real.sqrt_zero] using hr + +end StrictHotSpots.L2VectorLimits + +namespace StrictHotSpots +namespace H1 +lemma tendsto_of_value_grad {Ω : Set Plane} {ι : Type*} {l : Filter ι} + {f : ι → H1 Ω} {g : H1 Ω} + (hv : Tendsto (fun n => value (f n)) l (𝓝 (value g))) + (hg : Tendsto (fun n => grad (f n)) l (𝓝 (grad g))) : + Tendsto f l (𝓝 g) := by + have h1 := (tendsto_iff_norm_sub_tendsto_zero.mp hv).pow 2 + have h2 := (tendsto_iff_norm_sub_tendsto_zero.mp hg).pow 2 + have hsq : Tendsto (fun n => ‖f n-g‖ ^ 2) l (𝓝 0) := by + simpa only [norm_sq, map_sub, zero_pow (by norm_num : (2 : ℕ) ≠ 0), zero_add] using h1.add h2 + have hr := Real.continuous_sqrt.continuousAt.tendsto.comp hsq + rw [tendsto_iff_norm_sub_tendsto_zero] + simpa only [Function.comp_def, Real.sqrt_sq (norm_nonneg _), Real.sqrt_zero] using hr +end H1 + +namespace DiskH10 +open DiskCutoff + +def disk : Set Plane := Metric.ball 0 1 + +lemma norm_gradient_eq (f : Plane → ℝ) (x : Plane) : + ‖gradient f x‖ = ‖fderiv ℝ f x‖ := + (InnerProductSpace.toDual ℝ Plane).symm.norm_map _ + +lemma smooth_zero_boundary_bounds {f : Plane → ℝ} {R : ℝ} + (hR : 1 < R) (hf : ContDiffOn ℝ ∞ f (Metric.ball 0 R)) + (hz : ∀ x : Plane, ‖x‖ = 1 → f x = 0) : + ∃ C : ℝ, 0 ≤ C ∧ + (∀ x ∈ disk, ‖f x‖ ≤ C) ∧ + (∀ x ∈ disk, ‖fderiv ℝ f x‖ ≤ C) ∧ + (∀ x ∈ disk, ‖f x‖ ≤ C * (1 - ‖x‖ ^ 2)) := by + have hs : Metric.closedBall (0 : Plane) 1 ⊆ Metric.ball 0 R := + Metric.closedBall_subset_ball hR + have hdc := hf.continuousOn_fderiv_of_isOpen Metric.isOpen_ball (by simp) + obtain ⟨B,hB⟩ := (isCompact_closedBall (0 : Plane) 1).exists_bound_of_continuousOn + (hdc.mono hs) + let C := max B 0 + have hC : 0 ≤ C := le_max_right _ _ + have hd : ∀ x ∈ Metric.closedBall (0 : Plane) 1, ‖fderiv ℝ f x‖ ≤ C := + fun x hx => (hB x hx).trans (le_max_left _ _) + have hdiff : ∀ x ∈ Metric.closedBall (0 : Plane) 1, DifferentiableAt ℝ f x := + fun x hx => ((hf x (hs hx)).contDiffAt (Metric.isOpen_ball.mem_nhds (hs hx))).differentiableAt (by simp) + have hv : ∀ x ∈ disk, ‖f x‖ ≤ C * (1 - ‖x‖ ^ 2) := by + intro x hx + exact boundary_vanishing_estimate hC hdiff hd hz (by simpa [disk] using (Metric.ball_subset_closedBall hx)) + refine ⟨C,hC,?_,fun x hx => hd x (Metric.ball_subset_closedBall hx),hv⟩ + intro x hx + exact (hv x hx).trans (by nlinarith [sq_nonneg ‖x‖, mul_nonneg hC (sq_nonneg ‖x‖)]) + +lemma smooth_memH1 {f : Plane → ℝ} {R : ℝ} + (hR : 1 < R) (hf : ContDiffOn ℝ ∞ f (Metric.ball 0 R)) : + HasH1Gradient disk f (gradient f) := by + have hs : Metric.closedBall (0 : Plane) 1 ⊆ Metric.ball 0 R := + Metric.closedBall_subset_ball hR + let : IsFiniteMeasure (volume.restrict disk) := + isFiniteMeasure_restrict.mpr Metric.isBounded_ball.measure_lt_top.ne + have hfc := hf.continuousOn + have hgc : ContinuousOn (gradient f) (Metric.ball 0 R) := + (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp_continuousOn + (hf.continuousOn_fderiv_of_isOpen Metric.isOpen_ball (by simp)) + have hb {F : Type} [NormedAddCommGroup F] {g : Plane → F} + (hg : ContinuousOn g (Metric.ball 0 R)) : MemLp g 2 (volume.restrict disk) := by + obtain ⟨C,hC⟩ := (isCompact_closedBall (0 : Plane) 1).exists_bound_of_continuousOn (hg.mono hs) + have hm : AEStronglyMeasurable g (volume.restrict disk) := + (hg.mono ((Metric.ball_subset_closedBall).trans hs)).aestronglyMeasurable Metric.isOpen_ball.measurableSet + apply MemLp.of_bound hm C + filter_upwards [ae_restrict_mem Metric.isOpen_ball.measurableSet] with x hx + exact hC x (Metric.ball_subset_closedBall hx) + exact HasH1Gradient.of_contDiffOn Metric.isOpen_ball + (hf.mono ((Metric.ball_subset_closedBall).trans hs)) (hb hfc) (hb hgc) + + + +lemma smooth_zero_boundary_memH10 {f : Plane → ℝ} {R : ℝ} + (hR : 1 < R) (hf : ContDiffOn ℝ ∞ f (Metric.ball 0 R)) + (hz : ∀ x : Plane, ‖x‖ = 1 → f x = 0) : + (smooth_memH1 hR hf).toH1 ∈ h10Submodule (Ω := disk) Metric.isOpen_ball := by + let hΩ : IsOpen disk := Metric.isOpen_ball + let h := smooth_memH1 hR hf + let : IsFiniteMeasure (volume.restrict disk) := + isFiniteMeasure_restrict.mpr Metric.isBounded_ball.measure_lt_top.ne + obtain ⟨C,hC,hv,hd,hzC⟩ := smooth_zero_boundary_bounds hR hf hz + obtain ⟨L,hL,ht⟩ := transition_deriv_bound + let ψ : ℕ → Plane → ℝ := fun n x => cutoff ((n : ℝ) + 2) x * f x + have hκ (n : ℕ) : 0 < (n : ℝ) + 2 := by positivity + have hψ (n : ℕ) : ContDiff ℝ ∞ (ψ n) := cutoff_mul_contDiff (hκ n) hR hf + have hc (n : ℕ) : HasCompactSupport (ψ n) := cutoff_mul_hasCompactSupport (hκ n) + have hs (n : ℕ) : tsupport (ψ n) ⊆ disk := + tsupport_mul_subset_left.trans (cutoff_tsupport_disk (hκ n)) + let test : ℕ → smoothTestSpace disk := fun n => ⟨ψ n, hψ n, hc n, hs n⟩ + have hdiff (x : Plane) (hx : x ∈ disk) : DifferentiableAt ℝ f x := by + have hxR : x ∈ Metric.ball (0 : Plane) R := Metric.ball_subset_ball hR.le hx + exact ((hf x hxR).contDiffAt (Metric.isOpen_ball.mem_nhds hxR)).differentiableAt (by simp) + have hval : Tendsto (fun n => H1.value (smoothTestToH1 hΩ (test n))) atTop + (𝓝 (H1.value h.toH1)) := by + apply L2VectorLimits.tendsto_toLp_of_dominated + (fun n => test_memLp (hψ n) (hc n)) h.1 (memLp_const C) + · apply Eventually.of_forall + intro n + filter_upwards [ae_restrict_mem hΩ.measurableSet] with x hx + exact cutoff_mul_norm_le (hv x hx) + · filter_upwards [ae_restrict_mem hΩ.measurableSet] with x hx + have he : ∀ᶠ n : ℕ in atTop, ψ n x = f x := by + filter_upwards [cutoff_eventually_one x (by simpa [disk] using hx)] with n hn + simp only [ψ, hn.1, one_mul] + exact tendsto_const_nhds.congr' (Filter.EventuallyEq.symm he) + have hgrad : Tendsto (fun n => H1.grad (smoothTestToH1 hΩ (test n))) atTop + (𝓝 (H1.grad h.toH1)) := by + apply L2VectorLimits.tendsto_toLp_of_dominated + (fun n => test_gradient_memLp (hψ n) (hc n)) h.2.1 (memLp_const (C + 4 * C * L)) + · apply Eventually.of_forall + intro n + filter_upwards [ae_restrict_mem hΩ.measurableSet] with x hx + rw [norm_gradient_eq] + exact cutoff_mul_fderiv_bound (hκ n) hC hL + (by simpa [disk] using (Metric.ball_subset_closedBall hx)) + (hdiff x hx) (hd x hx) (hzC x hx) ht + · filter_upwards [ae_restrict_mem hΩ.measurableSet] with x hx + have he : ∀ᶠ n : ℕ in atTop, gradient (ψ n) x = gradient f x := by + filter_upwards [cutoff_eventually_one x (by simpa [disk] using hx)] with n hn + unfold gradient ψ + rw [fderiv_fun_mul ((cutoff_contDiff _).differentiable (by simp) x) (hdiff x hx)] + simp only [hn.1, hn.2, one_smul, smul_zero, add_zero] + exact tendsto_const_nhds.congr' (Filter.EventuallyEq.symm he) + change h.toH1 ∈ closure ((smoothTestToH1 hΩ).range : Set (H1 disk)) + exact mem_closure_of_tendsto (H1.tendsto_of_value_grad hval hgrad) + (Eventually.of_forall fun n => ⟨test n, rfl⟩) + +end DiskH10 +end StrictHotSpots + +open scoped Laplacian +namespace StrictHotSpots + +lemma integral_inner_gradient_test {Ω : Set Plane} {f φ : Plane → ℝ} + (hΩ : IsOpen Ω) (hf : ContDiffOn ℝ ∞ f Ω) + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) (hs : tsupport φ ⊆ Ω) : + (∫ x in Ω, inner ℝ (gradient f x) (gradient φ x)) = + -(∫ x in Ω, Δ f x * φ x) := by + let b := stdOrthonormalBasis ℝ Plane + have hd (i : Fin (Module.finrank ℝ Plane)) : + ContDiffOn ℝ ∞ (fun x => fderiv ℝ f x (b i)) Ω := + (hf.fderiv_of_isOpen hΩ (by simp)).clm_apply contDiffOn_const + have hdd (i : Fin (Module.finrank ℝ Plane)) : + ContDiffOn ℝ ∞ (fun x => fderiv ℝ (fun y => fderiv ℝ f y (b i)) x (b i)) Ω := + ((hd i).fderiv_of_isOpen hΩ (by simp)).clm_apply contDiffOn_const + have he (x : Plane) : inner ℝ (gradient f x) (gradient φ x) = + ∑ i, fderiv ℝ f x (b i) * fderiv ℝ φ x (b i) := by + rw [← b.sum_inner_mul_inner (gradient f x) (gradient φ x)] + simp only [inner_gradient_left, inner_gradient_right, starRingEnd_apply, star_trivial] + have hl (x : Plane) (hx : x ∈ Ω) : Δ f x = + ∑ i, fderiv ℝ (fun y => fderiv ℝ f y (b i)) x (b i) := by + rw [laplacian_eq_iteratedFDeriv_orthonormalBasis _ b] + apply Finset.sum_congr rfl + intro i _ + simp only [iteratedFDeriv_two_apply, Matrix.cons_val_zero, + Matrix.cons_val_one, Fin.isValue] + rw [fderiv_clm_apply + ((((hf x hx).contDiffAt (hΩ.mem_nhds hx)).fderiv_right (m := ∞) (by simp)).differentiableAt (by simp)) + (differentiableAt_const _)] + simp + have hi (i : Fin (Module.finrank ℝ Plane)) : Integrable + (fun x => fderiv ℝ f x (b i) * fderiv ℝ φ x (b i)) (volume.restrict Ω) := by + apply Integrable.restrict + exact integrable_mul_test hΩ (hd i).continuousOn + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const) + (hc.fderiv_apply ℝ (b i)) ((tsupport_fderiv_apply_subset ℝ (b i)).trans hs) + have hj (i : Fin (Module.finrank ℝ Plane)) : Integrable + (fun x => fderiv ℝ (fun y => fderiv ℝ f y (b i)) x (b i) * φ x) + (volume.restrict Ω) := + (integrable_mul_test hΩ (hdd i).continuousOn hφ.continuous hc hs).restrict + simp_rw [he] + rw [integral_finsetSum _ (fun i _ => hi i)] + simp_rw [integral_mul_test_fderiv hΩ (hd _) hφ hc hs] + rw [Finset.sum_neg_distrib] + congr 1 + rw [← integral_finsetSum _ (fun i _ => hj i)] + apply integral_congr_ae + filter_upwards [ae_restrict_mem hΩ.measurableSet] with x hx + rw [hl x hx, Finset.sum_mul] + +lemma inner_toLp_toLp {X F : Type*} [MeasurableSpace X] {ν : Measure X} + [NormedAddCommGroup F] [InnerProductSpace ℝ F] {f g : X → F} + (hf : MemLp f 2 ν) (hg : MemLp g 2 ν) : + inner ℝ (hf.toLp f) (hg.toLp g) = ∫ x, inner ℝ (f x) (g x) ∂ν := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hf.coeFn_toLp, hg.coeFn_toLp] with x hx hy + rw [hx, hy] + +lemma smoothTest_value {Ω : Set Plane} (hΩ : IsOpen Ω) (φ : smoothTestSpace Ω) : + H1.value (smoothTestToH1 hΩ φ) = + (test_memLp (Ω := Ω) φ.property.1 φ.property.2.1).toLp (φ : Plane → ℝ) := by + rw [show smoothTestToH1 hΩ φ = + (HasH1Gradient.test hΩ φ.property.1 φ.property.2.1).toH1 from rfl, H1.value_toH1] + +lemma smoothTest_grad {Ω : Set Plane} (hΩ : IsOpen Ω) (φ : smoothTestSpace Ω) : + H1.grad (smoothTestToH1 hΩ φ) = + (test_gradient_memLp (Ω := Ω) φ.property.1 φ.property.2.1).toLp (gradient (φ : Plane → ℝ)) := by + rw [show smoothTestToH1 hΩ φ = + (HasH1Gradient.test hΩ φ.property.1 φ.property.2.1).toH1 from rfl, H1.grad_toH1] + +lemma smooth_weak_poisson {Ω : Set Plane} {u f : Plane → ℝ} + (hΩ : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) + (huH1 : HasH1Gradient Ω u (gradient u)) + (hf : MemLp f 2 (volume.restrict Ω)) + (hp : ∀ x ∈ Ω, Δ u x = -f x) (v : H10 hΩ) : + inner ℝ (H1.grad huH1.toH1) (H10.grad hΩ v) = + inner ℝ (hf.toLp f) (H10.value hΩ v) := by + let S : Set (H1 Ω) := {w | inner ℝ (H1.grad huH1.toH1) (H1.grad w) = + inner ℝ (hf.toLp f) (H1.value w)} + have hS : IsClosed S := isClosed_eq (continuous_const.inner H1.grad.continuous) + (continuous_const.inner H1.value.continuous) + have hi : ((smoothTestToH1 hΩ).range : Set (H1 Ω)) ⊆ S := by + rintro w ⟨φ,rfl⟩ + change inner ℝ (H1.grad huH1.toH1) (H1.grad (smoothTestToH1 hΩ φ)) = + inner ℝ (hf.toLp f) (H1.value (smoothTestToH1 hΩ φ)) + rw [H1.grad_toH1, smoothTest_grad, smoothTest_value, inner_toLp_toLp, inner_toLp_toLp, + integral_inner_gradient_test hΩ hu φ.property.1 φ.property.2.1 φ.property.2.2] + simp only [RCLike.inner_apply, conj_trivial] + rw [← integral_neg] + apply integral_congr_ae + filter_upwards [ae_restrict_mem hΩ.measurableSet] with x hx + rw [hp x hx] + ring + exact (closure_minimal hi hS) v.property + +end StrictHotSpots + + + + + + + +end WeightedLayer + +end FullBoundaryCombinedLayer + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Trace.lean b/lean/OAI/Analysis/HotSpots/Trace.lean new file mode 100644 index 0000000000000000000000000000000000000000..9648f4274c69394f7153d1919d484117b2814349 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Trace.lean @@ -0,0 +1,730 @@ +import OAI.Analysis.HotSpots.Dirichlet + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section NodalSmoothingCombinedLayer + +open Set Filter MeasureTheory Metric +open scoped Topology ContDiff +namespace StrictHotSpots.Nodal + +lemma transition_deriv_zero {t : ℝ} (h : t ≤ 0 ∨ 1 ≤ t) : + deriv Real.smoothTransition t = 0 := by + rcases h with h | h + · apply IsLocalMin.deriv_eq_zero + exact Eventually.of_forall fun y => by + rw [Real.smoothTransition.zero_of_nonpos h] + exact Real.smoothTransition.nonneg y + · apply IsLocalMax.deriv_eq_zero + exact Eventually.of_forall fun y => by + rw [Real.smoothTransition.one_of_one_le h] + exact Real.smoothTransition.le_one y + +def cutoff (n : ℕ) (t : ℝ) : ℝ := t * Real.smoothTransition (((n:ℝ)+1)*t-1) + +lemma cutoff_contDiff (n : ℕ) : ContDiff ℝ ∞ (cutoff n) := by + unfold cutoff + exact contDiff_id.mul (Real.smoothTransition.contDiff.comp ((contDiff_const.mul contDiff_id).sub contDiff_const)) + +lemma cutoff_deriv (n : ℕ) (t : ℝ) : deriv (cutoff n) t = + Real.smoothTransition (((n:ℝ)+1)*t-1) + + (((n:ℝ)+1)*t) * deriv Real.smoothTransition (((n:ℝ)+1)*t-1) := by + have hh := (hasDerivAt_id t).mul + ((((Real.smoothTransition.contDiff : ContDiff ℝ ∞ _).differentiable (by simp)).differentiableAt.hasDerivAt).comp t + (((hasDerivAt_id t).const_mul ((n:ℝ)+1)).sub_const 1)) + have he : (id * Real.smoothTransition ∘ (fun x : ℝ => ((n:ℝ)+1)*id x-1)) = cutoff n := rfl + rw [he] at hh + rw [hh.deriv] + simp only [Function.comp_apply,id_eq,one_mul,mul_one] + ring + +lemma cutoff_zero (n : ℕ) {t : ℝ} (ht : t < 1/((n:ℝ)+1)) : cutoff n t = 0 := by + unfold cutoff + rw [Real.smoothTransition.zero_of_nonpos, mul_zero] + have hn : 0 < (n:ℝ)+1 := by positivity + have := (lt_div_iff₀ hn).mp ht + nlinarith + +lemma cutoff_norm_le (n : ℕ) (t : ℝ) : ‖cutoff n t‖ ≤ ‖t‖ := by + change ‖t * Real.smoothTransition (((n:ℝ)+1)*t-1)‖ ≤ ‖t‖ + rw [norm_mul,Real.norm_of_nonneg (Real.smoothTransition.nonneg _)] + exact mul_le_of_le_one_right (norm_nonneg t) (Real.smoothTransition.le_one _) + +lemma cutoff_deriv_bound : ∃ C : ℝ, 1 ≤ C ∧ ∀ n t, ‖deriv (cutoff n) t‖ ≤ C := by + obtain ⟨M,hM⟩ := isCompact_Icc.exists_bound_of_continuousOn + ((Real.smoothTransition.contDiff.continuous_deriv (by simp : (1:ℕ∞ω) ≤ ∞)).continuousOn : + ContinuousOn (deriv Real.smoothTransition) (Icc (0:ℝ) 1)) + have hM0 : 0 ≤ M := le_trans (norm_nonneg _) (hM 0 (by simp)) + refine ⟨1+2*M,by linarith,fun n t => ?_⟩ + rw [cutoff_deriv] + have hτ : ‖Real.smoothTransition (((n:ℝ)+1)*t-1)‖ ≤ 1 := by + rw [Real.norm_of_nonneg (Real.smoothTransition.nonneg _)] + exact Real.smoothTransition.le_one _ + by_cases h : ((n:ℝ)+1)*t-1 ∈ Icc (0:ℝ) 1 + · have hnt : ‖((n:ℝ)+1)*t‖ ≤ 2 := by + rw [Real.norm_eq_abs,abs_le] + constructor <;> linarith [h.1,h.2] + calc + _ ≤ ‖Real.smoothTransition (((n:ℝ)+1)*t-1)‖ + + ‖((n:ℝ)+1)*t * deriv Real.smoothTransition (((n:ℝ)+1)*t-1)‖ := norm_add_le _ _ + _ ≤ 1 + 2*M := by rw [norm_mul]; gcongr; exact hM _ h + · have hd : deriv Real.smoothTransition (((n:ℝ)+1)*t-1) = 0 := by + apply transition_deriv_zero + simp only [mem_Icc,not_and_or,not_le] at h + exact h.imp le_of_lt le_of_lt + rw [hd,mul_zero,add_zero] + linarith + +lemma cutoff_eventually_eq {t : ℝ} (ht : 0 < t) : + ∀ᶠ n : ℕ in atTop, cutoff n t = t ∧ deriv (cutoff n) t = 1 := by + have hn : Tendsto (fun n : ℕ => ((n:ℝ)+1)*t-1) atTop atTop := + by + simpa only [sub_eq_add_neg] using tendsto_atTop_add_const_right atTop (-1 : ℝ) + ((tendsto_atTop_add_const_right atTop (1 : ℝ) tendsto_natCast_atTop_atTop).atTop_mul_const ht) + filter_upwards [hn.eventually_ge_atTop 1] with n hn + constructor + · simp [cutoff,Real.smoothTransition.one_of_one_le hn] + · rw [cutoff_deriv,Real.smoothTransition.one_of_one_le hn, + transition_deriv_zero (Or.inr hn),mul_zero,add_zero] + +end StrictHotSpots.Nodal +end NodalSmoothingCombinedLayer + +section BoundarySignTestsCombinedLayer +open Set Filter MeasureTheory Metric +open scoped Topology ContDiff InnerProductSpace ENNReal +namespace StrictHotSpots.BoundarySign +variable {Ω : Set Plane} {u : Plane → ℝ} +def cut (Ω : Set Plane) (u : Plane → ℝ) (n : ℕ) : Plane → ℝ := + Ω.indicator (fun x => Nodal.cutoff n (u x)) +def cutSupport (Ω : Set Plane) (u : Plane → ℝ) (n : ℕ) : Set Plane := + closure Ω ∩ u ⁻¹' Ici (1 / ((n:ℝ)+1)) +lemma support_cut_subset (n : ℕ) : Function.support (cut Ω u n) ⊆ cutSupport Ω u n := by + intro x hx + by_cases hxΩ : x ∈ Ω + · refine ⟨subset_closure hxΩ, ?_⟩ + by_contra h + apply hx + exact (indicator_of_mem hxΩ _).trans (Nodal.cutoff_zero n (lt_of_not_ge h)) + · exact False.elim (hx (indicator_of_notMem hxΩ _)) +lemma cutSupport_closed (hu : ContinuousOn u (closure Ω)) (n : ℕ) : + IsClosed (cutSupport Ω u n) := + hu.preimage_isClosed_of_isClosed isClosed_closure isClosed_Ici +lemma cutSupport_subset (ho : IsOpen Ω) (hb : ∀ x ∈ frontier Ω, u x ≤ 0) (n : ℕ) : + cutSupport Ω u n ⊆ Ω := by + intro x hx + by_contra hn + have hf : x ∈ frontier Ω := by + rw [frontier,ho.interior_eq] + exact ⟨hx.1,hn⟩ + have hp : 0 < 1 / ((n:ℝ)+1) := by positivity + exact (not_le_of_gt hp) (hx.2.trans (hb x hf)) +lemma cut_eq_zero_nhds (hu : ContinuousOn u (closure Ω)) (n : ℕ) {x : Plane} + (hx : x ∉ cutSupport Ω u n) : cut Ω u n =ᶠ[𝓝 x] 0 := by + filter_upwards [(cutSupport_closed hu n).isOpen_compl.mem_nhds hx] with y hy + by_contra h + exact hy (support_cut_subset n h) +lemma cut_eq_nhds (ho : IsOpen Ω) (n : ℕ) {x : Plane} (hx : x ∈ Ω) : + cut Ω u n =ᶠ[𝓝 x] (fun y => Nodal.cutoff n (u y)) := by + filter_upwards [ho.mem_nhds hx] with y hy + exact indicator_of_mem hy _ +lemma cut_contDiff (ho : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u (closure Ω)) + (hb : ∀ x ∈ frontier Ω, u x ≤ 0) (n : ℕ) : ContDiff ℝ ∞ (cut Ω u n) := by + rw [contDiff_iff_contDiffAt] + intro x + by_cases hx : x ∈ Ω + · exact ((Nodal.cutoff_contDiff n).contDiffAt.comp x + ((hu.mono subset_closure).contDiffAt (ho.mem_nhds hx))).congr_of_eventuallyEq + (cut_eq_nhds ho n hx) + · exact contDiffAt_const.congr_of_eventuallyEq + (cut_eq_zero_nhds hu.continuousOn n (fun h => hx (cutSupport_subset ho hb n h))) +lemma cut_tsupport_subset (ho : IsOpen Ω) (hu : ContinuousOn u (closure Ω)) + (hb : ∀ x ∈ frontier Ω, u x ≤ 0) (n : ℕ) : tsupport (cut Ω u n) ⊆ Ω := + ((cutSupport_closed hu n).closure_subset_iff.mpr (support_cut_subset n)).trans + (cutSupport_subset ho hb n) +lemma cut_hasCompactSupport (hu : ContinuousOn u (closure Ω)) + (hb : Bornology.IsBounded Ω) (n : ℕ) : HasCompactSupport (cut Ω u n) := by + apply hb.isCompact_closure.of_isClosed_subset isClosed_closure + exact ((cutSupport_closed hu n).closure_subset_iff.mpr (support_cut_subset n)).trans + inter_subset_left + +def test (ho : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u (closure Ω)) + (hbound : Bornology.IsBounded Ω) (hb : ∀ x ∈ frontier Ω, u x ≤ 0) (n : ℕ) : + smoothTestSpace Ω := + ⟨cut Ω u n, cut_contDiff ho hu hb n, cut_hasCompactSupport hu.continuousOn hbound n, + cut_tsupport_subset ho hu.continuousOn hb n⟩ +lemma cut_gradient (ho : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u (closure Ω)) + (n : ℕ) {x : Plane} (hx : x ∈ Ω) : + gradient (cut Ω u n) x = deriv (Nodal.cutoff n) (u x) • gradient u x := by + apply (InnerProductSpace.toDual ℝ Plane).injective + simp only [gradient,map_smul] + rw [(cut_eq_nhds ho n hx).fderiv_eq] + simp only [LinearIsometryEquiv.apply_symm_apply] + exact (((Nodal.cutoff_contDiff n).differentiable (by simp)).differentiableAt.hasDerivAt.comp_hasFDerivAt x + (((hu.mono subset_closure).contDiffAt (ho.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt).fderiv + +lemma gap_test (ho : IsOpen Ω) (hu : InFirstNeumannEigenspace Ω u) + (hbound : Bornology.IsBounded Ω) (hb : ∀ x ∈ frontier Ω, u x ≤ 0) + {lam : ℝ} (hg : ∀ v : H10 ho, lam * ‖H10.value ho v‖^2 ≤ ‖H10.grad ho v‖^2) + (n : ℕ) : + lam * (∫ x in Ω, (Nodal.cutoff n (u x))^2) ≤ + ∫ x in Ω, (deriv (Nodal.cutoff n) (u x))^2 * ‖gradient u x‖^2 := by + let f := test ho hu.1 hbound hb n + have hh := hg (smoothTestToH10 ho f) + change lam * ‖(HasH1Gradient.test ho f.property.1 f.property.2.1).1.toLp f.val‖^2 ≤ + ‖(HasH1Gradient.test ho f.property.1 f.property.2.1).2.1.toLp (gradient f.val)‖^2 at hh + rw [← real_inner_self_eq_norm_sq, ← real_inner_self_eq_norm_sq, + L2Inner.toLp_pair,L2Inner.toLp_pair] at hh + have hval : (∫ x in Ω, inner ℝ (f.val x) (f.val x)) = ∫ x in Ω, (Nodal.cutoff n (u x))^2 := by + apply setIntegral_congr_fun ho.measurableSet + intro x hx + simp only [f,test,cut,indicator_of_mem hx,RCLike.inner_apply,conj_trivial,pow_two] + have hgrad : (∫ x in Ω, inner ℝ (gradient f.val x) (gradient f.val x)) = + ∫ x in Ω, (deriv (Nodal.cutoff n) (u x))^2 * ‖gradient u x‖^2 := by + apply setIntegral_congr_fun ho.measurableSet + intro x hx + dsimp only + rw [real_inner_self_eq_norm_sq] + change ‖gradient (cut Ω u n) x‖^2 = _ + rw [cut_gradient ho hu.1 n hx,norm_smul,mul_pow,Real.norm_eq_abs,sq_abs] + rwa [hval,hgrad] at hh + +lemma equation_test (ho : IsOpen Ω) (hu : InFirstNeumannEigenspace Ω u) + (hbound : Bornology.IsBounded Ω) (hb : ∀ x ∈ frontier Ω, u x ≤ 0) (n : ℕ) : + (∫ x in Ω, deriv (Nodal.cutoff n) (u x) * ‖gradient u x‖^2) = + firstPositiveNeumannValue Ω * (∫ x in Ω, u x * Nodal.cutoff n (u x)) := by + let f := test ho hu.1 hbound hb n + have hh := hu.2.2.2 f.val (gradient f.val) (HasH1Gradient.test ho f.property.1 f.property.2.1) + convert hh using 1 + · apply setIntegral_congr_fun ho.measurableSet + intro x hx + change _ = inner ℝ (gradient u x) (gradient (cut Ω u n) x) + rw [cut_gradient ho hu.1 n hx,inner_smul_right,real_inner_self_eq_norm_sq] + · congr 1 + apply setIntegral_congr_fun ho.measurableSet + intro x hx + simp only [f,test,cut,indicator_of_mem hx] +end StrictHotSpots.BoundarySign +end BoundarySignTestsCombinedLayer + +section BoundarySignLimitsCombinedLayer +open Set Filter MeasureTheory +open scoped Topology ENNReal +namespace StrictHotSpots.Nodal +lemma cutoff_nonpos (n : ℕ) {t : ℝ} (h : t ≤ 0) : cutoff n t = 0 := + cutoff_zero n (lt_of_le_of_lt h (by positivity)) +lemma cutoff_deriv_nonpos (n : ℕ) {t : ℝ} (h : t ≤ 0) : deriv (cutoff n) t = 0 := by + have he : cutoff n =ᶠ[𝓝 t] (fun _ => (0:ℝ)) := by + filter_upwards [gt_mem_nhds (show t < 1 / ((n:ℝ)+1) from lt_of_le_of_lt h (by positivity))] with y hy + exact cutoff_zero n hy + rw [he.deriv_eq] + simp +lemma cutoff_tendsto (t : ℝ) : Tendsto (fun n => cutoff n t) atTop (𝓝 (if 0 < t then t else 0)) := by + by_cases ht : 0 < t + · rw [ite_eq_left ht] + exact tendsto_const_nhds.congr' ((cutoff_eventually_eq ht).mono fun _ h => h.1.symm) + · simp only [ite_eq_right ht,cutoff_nonpos _ (le_of_not_gt ht)] + exact tendsto_const_nhds +lemma cutoff_deriv_tendsto (t : ℝ) : + Tendsto (fun n => deriv (cutoff n) t) atTop (𝓝 (if 0 < t then (1:ℝ) else 0)) := by + by_cases ht : 0 < t + · rw [ite_eq_left ht] + exact tendsto_const_nhds.congr' ((cutoff_eventually_eq ht).mono fun _ h => h.2.symm) + · simp only [ite_eq_right ht,cutoff_deriv_nonpos _ (le_of_not_gt ht)] + exact tendsto_const_nhds +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} {u : α → ℝ} +lemma cutoff_square_integral (hu : MemLp u 2 μ) : + Tendsto (fun n => ∫ x, (cutoff n (u x))^2 ∂μ) atTop + (𝓝 (∫ x, if 0 < u x then (u x)^2 else 0 ∂μ)) := by + apply tendsto_integral_of_dominated_convergence (fun x => (u x)^2) + · intro n + exact ((cutoff_contDiff n).continuous.comp_aestronglyMeasurable hu.aestronglyMeasurable).pow 2 + · exact hu.integrable_sq + · intro n + exact Eventually.of_forall fun x => by + rw [Real.norm_of_nonneg (sq_nonneg _)] + simpa only [Real.norm_eq_abs,sq_abs] using + pow_le_pow_left₀ (norm_nonneg _) (cutoff_norm_le n (u x)) 2 + · exact Eventually.of_forall fun x => by + simpa only [ite_pow,zero_pow (by decide : 2 ≠ 0)] using (cutoff_tendsto (u x)).pow 2 +lemma cutoff_product_integral (hu : MemLp u 2 μ) : + Tendsto (fun n => ∫ x, u x * cutoff n (u x) ∂μ) atTop + (𝓝 (∫ x, if 0 < u x then (u x)^2 else 0 ∂μ)) := by + apply tendsto_integral_of_dominated_convergence (fun x => (u x)^2) + · intro n + exact hu.aestronglyMeasurable.mul + ((cutoff_contDiff n).continuous.comp_aestronglyMeasurable hu.aestronglyMeasurable) + · exact hu.integrable_sq + · intro n + exact Eventually.of_forall fun x => by + rw [norm_mul] + calc + ‖u x‖ * ‖cutoff n (u x)‖ ≤ ‖u x‖ * ‖u x‖ := + mul_le_mul_of_nonneg_left (cutoff_norm_le n _) (norm_nonneg _) + _ = (u x)^2 := by rw [← pow_two,Real.norm_eq_abs,sq_abs] + · exact Eventually.of_forall fun x => by + simpa only [mul_ite,mul_zero,← pow_two] using + (tendsto_const_nhds : Tendsto (fun _ : ℕ => u x) atTop (𝓝 (u x))).mul (cutoff_tendsto (u x)) +lemma cutoff_deriv_integral (hu : AEStronglyMeasurable u μ) {g : α → ℝ} + (hg : Integrable g μ) (hgn : ∀ x, 0 ≤ g x) : + Tendsto (fun n => ∫ x, deriv (cutoff n) (u x) * g x ∂μ) atTop + (𝓝 (∫ x, if 0 < u x then g x else 0 ∂μ)) := by + obtain ⟨C,hC,hbd⟩ := cutoff_deriv_bound + apply tendsto_integral_of_dominated_convergence (fun x => C * g x) + · intro n + exact (((cutoff_contDiff n).continuous_deriv (by simp)).comp_aestronglyMeasurable hu).mul + hg.aestronglyMeasurable + · exact hg.const_mul C + · intro n + exact Eventually.of_forall fun x => by + rw [norm_mul,Real.norm_of_nonneg (hgn x)] + exact mul_le_mul_of_nonneg_right (hbd n _) (hgn x) + · exact Eventually.of_forall fun x => by + simpa only [ite_mul,one_mul,zero_mul] using (cutoff_deriv_tendsto (u x)).mul tendsto_const_nhds +lemma cutoff_deriv_square_integral (hu : AEStronglyMeasurable u μ) {g : α → ℝ} + (hg : Integrable g μ) (hgn : ∀ x, 0 ≤ g x) : + Tendsto (fun n => ∫ x, (deriv (cutoff n) (u x))^2 * g x ∂μ) atTop + (𝓝 (∫ x, if 0 < u x then g x else 0 ∂μ)) := by + obtain ⟨C,hC,hbd⟩ := cutoff_deriv_bound + apply tendsto_integral_of_dominated_convergence (fun x => C^2 * g x) + · intro n + exact ((((cutoff_contDiff n).continuous_deriv (by simp)).comp_aestronglyMeasurable hu).pow 2).mul + hg.aestronglyMeasurable + · exact hg.const_mul (C^2) + · intro n + exact Eventually.of_forall fun x => by + rw [norm_mul,Real.norm_of_nonneg (hgn x),norm_pow] + exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (norm_nonneg _) (hbd n _) 2) (hgn x) + · exact Eventually.of_forall fun x => by + simpa only [ite_pow,one_pow,zero_pow (by decide : 2 ≠ 0),ite_mul,one_mul,zero_mul] using + ((cutoff_deriv_tendsto (u x)).pow 2).mul tendsto_const_nhds +end StrictHotSpots.Nodal +end BoundarySignLimitsCombinedLayer + +section NodalRestrictionWeightedCombinedLayer + +open Set Filter MeasureTheory Metric +open scoped Topology ContDiff InnerProductSpace +namespace StrictHotSpots.Nodal + +variable {Ω U : Set Plane} {u : Plane → ℝ} + +lemma cutoff_indicator_zero_nhds (hΩ : IsOpen Ω) (hu : ContinuousOn u Ω) + (hU : IsOpen U) (hf : ∀ x ∈ frontier U ∩ Ω, u x = 0) + (n : ℕ) {x : Plane} (hx : x ∈ Ω) (hxU : x ∉ U) : + U.indicator (fun y => cutoff n (u y)) =ᶠ[𝓝 x] 0 := by + by_cases hxc : x ∈ closure U + · have hux : u x = 0 := hf x ⟨⟨hxc,by simpa [hU.interior_eq] using hxU⟩,hx⟩ + have hε : u x < 1/((n:ℝ)+1) := by rw [hux]; positivity + filter_upwards [((hu x hx).continuousAt (hΩ.mem_nhds hx)).eventually (gt_mem_nhds hε)] with y hy + by_cases hyU : y ∈ U + · simp only [Pi.zero_apply,indicator_of_mem hyU,cutoff_zero n hy] + · simp only [Pi.zero_apply,indicator_of_notMem hyU] + · filter_upwards [isClosed_closure.isOpen_compl.mem_nhds hxc] with y hy + exact indicator_of_notMem (fun hyU => hy (subset_closure hyU)) _ + +lemma cutoff_indicator_contDiffOn (hΩ : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) + (hU : IsOpen U) (hf : ∀ x ∈ frontier U ∩ Ω, u x = 0) (n : ℕ) : + ContDiffOn ℝ ∞ (U.indicator (fun x => cutoff n (u x))) Ω := by + intro x hx + apply ContDiffAt.contDiffWithinAt + by_cases hxU : x ∈ U + · apply ((cutoff_contDiff n).contDiffAt.comp x (hu.contDiffAt (hΩ.mem_nhds hx))).congr_of_eventuallyEq + filter_upwards [hU.mem_nhds hxU] with y hy + exact indicator_of_mem hy _ + · exact contDiffAt_const.congr_of_eventuallyEq (cutoff_indicator_zero_nhds hΩ hu.continuousOn hU hf n hx hxU) + +lemma cutoff_indicator_fderiv (hΩ : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) + (hU : IsOpen U) (hf : ∀ x ∈ frontier U ∩ Ω, u x = 0) (n : ℕ) + {x : Plane} (hx : x ∈ Ω) : + fderiv ℝ (U.indicator (fun y => cutoff n (u y))) x = + U.indicator (fun y => (deriv (cutoff n) (u y)) • fderiv ℝ u y) x := by + by_cases hxU : x ∈ U + · rw [indicator_of_mem hxU] + have he : U.indicator (fun y => cutoff n (u y)) =ᶠ[𝓝 x] (fun y => cutoff n (u y)) := by + filter_upwards [hU.mem_nhds hxU] with y hy + exact indicator_of_mem hy _ + rw [he.fderiv_eq] + exact (((cutoff_contDiff n).differentiable (by simp)).differentiableAt.hasDerivAt.comp_hasFDerivAt x + ((hu.contDiffAt (hΩ.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt).fderiv + · rw [indicator_of_notMem hxU,(cutoff_indicator_zero_nhds hΩ hu.continuousOn hU hf n hx hxU).fderiv_eq] + exact (hasFDerivAt_const (𝕜 := ℝ) (0 : ℝ) x).fderiv + +lemma cutoff_indicator_gradient (hΩ : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) + (hU : IsOpen U) (hf : ∀ x ∈ frontier U ∩ Ω, u x = 0) (n : ℕ) + {x : Plane} (hx : x ∈ Ω) : + gradient (U.indicator (fun y => cutoff n (u y))) x = + U.indicator (fun y => (deriv (cutoff n) (u y)) • gradient u y) x := by + apply (InnerProductSpace.toDual ℝ Plane).injective + simp only [gradient] + rw [cutoff_indicator_fderiv hΩ hu hU hf n hx] + by_cases hxU : x ∈ U + · simp only [indicator_of_mem hxU,map_smul] + · simp only [indicator_of_notMem hxU,map_zero] + +lemma cutoff_memLp (hU : IsOpen U) (hu : HasH1Gradient Ω u (gradient u)) (n : ℕ) : + MemLp (U.indicator (fun x => cutoff n (u x))) 2 (volume.restrict Ω) := by + apply hu.1.mono + (((cutoff_contDiff n).continuous.comp_aestronglyMeasurable hu.1.aestronglyMeasurable).indicator hU.measurableSet) + exact Eventually.of_forall fun x => by + by_cases hx : x ∈ U + · simpa only [indicator_of_mem hx] using cutoff_norm_le n (u x) + · simp only [indicator_of_notMem hx,norm_zero]; exact norm_nonneg _ + +lemma cutoff_grad_memLp (hU : IsOpen U) (hu : HasH1Gradient Ω u (gradient u)) (n : ℕ) : + MemLp (U.indicator (fun x => deriv (cutoff n) (u x) • gradient u x)) 2 (volume.restrict Ω) := by + obtain ⟨C,hC,hbd⟩ := cutoff_deriv_bound + apply (hu.2.1.norm.const_mul C).mono' + ((((cutoff_contDiff n).continuous_deriv (by simp)).comp_aestronglyMeasurable + hu.1.aestronglyMeasurable).smul hu.2.1.aestronglyMeasurable |>.indicator hU.measurableSet) + exact Eventually.of_forall fun x => by + by_cases hx : x ∈ U + · rw [indicator_of_mem hx] + change ‖deriv (cutoff n) (u x) • gradient u x‖ ≤ C * ‖gradient u x‖ + rw [norm_smul] + exact mul_le_mul_of_nonneg_right (hbd n (u x)) (norm_nonneg (gradient u x)) + · rw [indicator_of_notMem hx,norm_zero] + exact mul_nonneg (le_trans zero_le_one hC) (norm_nonneg _) + +lemma cutoff_hasH1Gradient (hΩ : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) + (hH : HasH1Gradient Ω u (gradient u)) + (hU : IsOpen U) (hf : ∀ x ∈ frontier U ∩ Ω, u x = 0) (n : ℕ) : + HasH1Gradient Ω (U.indicator (fun x => cutoff n (u x))) + (U.indicator (fun x => deriv (cutoff n) (u x) • gradient u x)) := by + have heq : gradient (U.indicator (fun x => cutoff n (u x))) =ᵐ[volume.restrict Ω] + U.indicator (fun x => deriv (cutoff n) (u x) • gradient u x) := + (ae_restrict_iff' hΩ.measurableSet).mpr (Eventually.of_forall fun x hx => + cutoff_indicator_gradient hΩ hu hU hf n hx) + have hg := (memLp_congr_ae heq).mpr (cutoff_grad_memLp hU hH n) + have hh := HasH1Gradient.of_contDiffOn hΩ (cutoff_indicator_contDiffOn hΩ hu hU hf n) + (cutoff_memLp hU hH n) hg + refine ⟨hh.1,cutoff_grad_memLp hU hH n,?_⟩ + intro φ hφ hc hs e + rw [hh.2.2 φ hφ hc hs e] + congr 1 + apply integral_congr_ae + filter_upwards [heq] with x hx + rw [hx] + + + +lemma hasH1Gradient_indicator (hΩ : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) + (hH : HasH1Gradient Ω u (gradient u)) (hU : IsOpen U) + (hf : ∀ x ∈ frontier U ∩ Ω, u x = 0) (hpos : ∀ x ∈ U, 0 < u x) : + HasH1Gradient Ω (U.indicator u) (U.indicator (gradient u)) := by + refine ⟨MemLp.indicator hU.measurableSet hH.1, + MemLp.indicator hU.measurableSet hH.2.1,?_⟩ + intro φ hφ hc hs e + let F (n : ℕ) := U.indicator (fun x => cutoff n (u x)) + let G (n : ℕ) := U.indicator (fun x => deriv (cutoff n) (u x) • gradient u x) + have hmF (n : ℕ) := cutoff_memLp hU hH n + have hmG (n : ℕ) := cutoff_grad_memLp hU hH n + have hlimF (x : Plane) : Tendsto (fun n => F n x) atTop (𝓝 (U.indicator u x)) := by + by_cases hx : x ∈ U + · apply tendsto_const_nhds.congr' + filter_upwards [cutoff_eventually_eq (hpos x hx)] with n hn + simp only [F,indicator_of_mem hx,hn.1] + · simpa only [F,indicator_of_notMem hx] using (tendsto_const_nhds : Tendsto (fun _ : ℕ => (0:ℝ)) atTop (𝓝 0)) + have hlimG (x : Plane) : Tendsto (fun n => G n x) atTop (𝓝 (U.indicator (gradient u) x)) := by + by_cases hx : x ∈ U + · apply tendsto_const_nhds.congr' + filter_upwards [cutoff_eventually_eq (hpos x hx)] with n hn + simp only [G,indicator_of_mem hx,hn.2,one_smul] + · simpa only [G,indicator_of_notMem hx] using (tendsto_const_nhds : Tendsto (fun _ : ℕ => (0:Plane)) atTop (𝓝 0)) + have hL := tendsto_integral_of_dominated_convergence (μ := volume.restrict Ω) + (fun x => ‖u x‖ * ‖fderiv ℝ φ x e‖) + (fun n => (hmF n).aestronglyMeasurable.mul (test_derivative_memLp hφ hc e).aestronglyMeasurable) + (hH.1.norm.integrable_mul (test_derivative_memLp hφ hc e).norm) + (fun n => Eventually.of_forall fun x => by + simp only [Pi.mul_apply,norm_mul] + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + by_cases hx : x ∈ U + · simpa only [F,indicator_of_mem hx] using cutoff_norm_le n (u x) + · simp only [indicator_of_notMem hx,norm_zero]; exact norm_nonneg _) + (Eventually.of_forall fun x => (hlimF x).mul tendsto_const_nhds) + obtain ⟨C,hC,hbd⟩ := cutoff_deriv_bound + have hR := tendsto_integral_of_dominated_convergence (μ := volume.restrict Ω) + (fun x => C * ‖gradient u x‖ * ‖e‖ * ‖φ x‖) + (fun n => ((hmG n).aestronglyMeasurable.inner (aestronglyMeasurable_const (b := e))).mul + (test_memLp hφ hc).aestronglyMeasurable) + (((hH.2.1.norm.const_mul C).mul_const ‖e‖).integrable_mul (test_memLp hφ hc).norm) + (fun n => Eventually.of_forall fun x => by + simp only [Pi.mul_apply,norm_mul] + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + apply le_trans (norm_inner_le_norm _ _) (mul_le_mul_of_nonneg_right ?_ (norm_nonneg e)) + by_cases hx : x ∈ U + · simp only [indicator_of_mem hx,norm_smul] + exact mul_le_mul_of_nonneg_right (hbd n (u x)) (norm_nonneg _) + · simp only [indicator_of_notMem hx,norm_zero] + exact mul_nonneg (le_trans zero_le_one hC) (norm_nonneg _)) + (Eventually.of_forall fun x => ((hlimG x).inner tendsto_const_nhds).mul tendsto_const_nhds) + apply tendsto_nhds_unique hL + convert hR.neg using 1 + ext n + exact (cutoff_hasH1Gradient hΩ hu hH hU hf n).2.2 φ hφ hc hs e + +lemma positive_set_open (hΩ : IsOpen Ω) (hu : ContinuousOn u Ω) : + IsOpen (Ω ∩ {x | 0 < u x}) := by + exact hu.isOpen_inter_preimage hΩ isOpen_Ioi + +lemma positive_component_frontier_zero (hΩ : IsOpen Ω) (hu : ContinuousOn u Ω) + (a : Plane) {x : Plane} (hx : x ∈ frontier (connectedComponentIn (Ω ∩ {x | 0 < u x}) a) ∩ Ω) : u x = 0 := by + let P := Ω ∩ {x | 0 < u x} + let U := connectedComponentIn P a + have hP : IsOpen P := positive_set_open hΩ hu + have hU : IsOpen U := hP.connectedComponentIn + have hxc : x ∈ closure U := hx.1.1 + have hxU : x ∉ U := by + have hh : x ∉ interior U := hx.1.2 + simpa only [hU.interior_eq] using hh + have hux : ContinuousAt u x := (hu x hx.2).continuousAt (hΩ.mem_nhds hx.2) + have hnonneg : 0 ≤ u x := by + by_contra h + have hneg : u x < 0 := lt_of_not_ge h + have hn : {y | u y < 0} ∈ 𝓝 x := hux.eventually (gt_mem_nhds hneg) + obtain ⟨ε,hε,he⟩ := Metric.mem_nhds_iff.mp hn + obtain ⟨y,hy,hd⟩ := Metric.mem_closure_iff.mp hxc ε hε + have hyneg : u y < 0 := he (by simpa [mem_ball,dist_comm] using hd) + have hypos : 0 < u y := (connectedComponentIn_subset P a hy).2 + linarith + apply le_antisymm _ hnonneg + by_contra h + have hpos : 0 < u x := lt_of_not_ge h + obtain ⟨ε,hε,he⟩ := Metric.mem_nhds_iff.mp (hP.mem_nhds ⟨hx.2,hpos⟩) + obtain ⟨y,hy,hd⟩ := Metric.mem_closure_iff.mp hxc ε hε + have hyball : y ∈ ball x ε := by simpa [mem_ball,dist_comm] using hd + have hbsub : ball x ε ⊆ connectedComponentIn P y := + (convex_ball x ε).isPreconnected.subset_connectedComponentIn hyball he + rw [← connectedComponentIn_eq hy] at hbsub + exact hxU (hbsub (mem_ball_self hε)) + +lemma positive_component_hasH1Gradient (hΩ : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) + (hH : HasH1Gradient Ω u (gradient u)) (a : Plane) : + HasH1Gradient Ω ((connectedComponentIn (Ω ∩ {x | 0 < u x}) a).indicator u) + ((connectedComponentIn (Ω ∩ {x | 0 < u x}) a).indicator (gradient u)) := by + apply hasH1Gradient_indicator hΩ hu hH (positive_set_open hΩ hu.continuousOn).connectedComponentIn + · exact fun x hx => positive_component_frontier_zero hΩ hu.continuousOn a hx + · intro x hx + exact (connectedComponentIn_subset _ a hx).2 + +end StrictHotSpots.Nodal +end NodalRestrictionWeightedCombinedLayer + +section SmoothZeroTraceCombinedLayer +open Set Filter MeasureTheory Metric +open scoped Topology ContDiff InnerProductSpace +namespace StrictHotSpots + +lemma positive_region_frontier_zero {Ω : Set Plane} {u : Plane → ℝ} + (ho : IsOpen Ω) (hu : ContinuousOn u Ω) {x : Plane} + (hx : x ∈ frontier (Ω ∩ {x | 0 < u x}) ∩ Ω) : u x = 0 := by + have hc := hu.continuousAt (ho.mem_nhds hx.2) + have hP := Nodal.positive_set_open ho hu + have hn : x ∉ Ω ∩ {x | 0 < u x} := by simpa only [hP.interior_eq] using hx.1.2 + have hle : u x ≤ 0 := le_of_not_gt (fun hp => hn ⟨hx.2,hp⟩) + apply le_antisymm hle + by_contra hp + have he : ∀ᶠ y in 𝓝 x, u y < 0 := hc.eventually (gt_mem_nhds (lt_of_not_ge hp)) + have hh := (mem_closure_iff_frequently.mp hx.1.1).and_eventually he + obtain ⟨y,hy,huy⟩ := hh.exists + exact (not_lt_of_gt hy.2) huy + +lemma positive_part_gradient {Ω : Set Plane} {u : Plane → ℝ} + (ho : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) + (hH : HasH1Gradient Ω u (gradient u)) : + HasH1Gradient Ω ((Ω ∩ {x | 0 < u x}).indicator u) + ((Ω ∩ {x | 0 < u x}).indicator (gradient u)) := + Nodal.hasH1Gradient_indicator ho hu hH (Nodal.positive_set_open ho hu.continuousOn) + (fun _ hx => positive_region_frontier_zero ho hu.continuousOn hx) (fun _ hx => hx.2) + +lemma positive_part_memH10 {Ω : Set Plane} {u : Plane → ℝ} + (ho : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u (closure Ω)) + (hH : HasH1Gradient Ω u (gradient u)) (hb : Bornology.IsBounded Ω) + (hz : ∀ x ∈ frontier Ω, u x ≤ 0) : + (positive_part_gradient ho (hu.mono subset_closure) hH).toH1 ∈ h10Submodule ho := by + let P := Ω ∩ {x | 0 < u x} + let hv := positive_part_gradient ho (hu.mono subset_closure) hH + let f (n : ℕ) := BoundarySign.test ho hu hb hz n + have hvlim : Tendsto (fun n => H1.value (smoothTestToH1 ho (f n))) atTop (𝓝 (H1.value hv.toH1)) := by + apply L2VectorLimits.tendsto_toLp_of_dominated + (fun n => (HasH1Gradient.test ho (f n).property.1 (f n).property.2.1).1) hv.1 hH.1.norm + · exact Eventually.of_forall fun n => by + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + change ‖BoundarySign.cut Ω u n x‖ ≤ ‖u x‖ + simpa only [BoundarySign.cut,indicator_of_mem hx] using Nodal.cutoff_norm_le n (u x) + · filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + change Tendsto (fun n => BoundarySign.cut Ω u n x) atTop (𝓝 (P.indicator u x)) + simp only [BoundarySign.cut,indicator_of_mem hx] + simpa only [P,indicator,mem_inter_iff,mem_ofPred_eq,hx,true_and] using Nodal.cutoff_tendsto (u x) + obtain ⟨C,hC,hbd⟩ := Nodal.cutoff_deriv_bound + have hglim : Tendsto (fun n => H1.grad (smoothTestToH1 ho (f n))) atTop (𝓝 (H1.grad hv.toH1)) := by + apply L2VectorLimits.tendsto_toLp_of_dominated + (fun n => (HasH1Gradient.test ho (f n).property.1 (f n).property.2.1).2.1) + hv.2.1 (hH.2.1.norm.const_mul C) + · exact Eventually.of_forall fun n => by + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + change ‖gradient (BoundarySign.cut Ω u n) x‖ ≤ C*‖gradient u x‖ + rw [BoundarySign.cut_gradient ho hu n hx,norm_smul] + exact mul_le_mul_of_nonneg_right (hbd n (u x)) (norm_nonneg _) + · filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + change Tendsto (fun n => gradient (BoundarySign.cut Ω u n) x) atTop + (𝓝 (P.indicator (gradient u) x)) + simp_rw [BoundarySign.cut_gradient ho hu _ hx] + simpa only [P,indicator,mem_inter_iff,mem_ofPred_eq,hx,true_and,ite_smul,one_smul,zero_smul] using + (Nodal.cutoff_deriv_tendsto (u x)).smul_const (gradient u x) + change hv.toH1 ∈ closure ((smoothTestToH1 ho).range : Set (H1 Ω)) + exact mem_closure_of_tendsto (H1.tendsto_of_value_grad hvlim hglim) + (Eventually.of_forall fun n => ⟨f n,rfl⟩) + + + + +theorem smooth_zero_trace_memH10 {Ω : Set Plane} {u : Plane → ℝ} + (ho : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u (closure Ω)) + (hH : HasH1Gradient Ω u (gradient u)) (hb : Bornology.IsBounded Ω) + (hz : ∀ x ∈ frontier Ω, u x = 0) : hH.toH1 ∈ h10Submodule ho := by + have hg : gradient (-u) = -gradient u := by + funext x + simp only [gradient,Pi.neg_apply,fderiv_neg,map_neg] + have hn : HasH1Gradient Ω (-u) (gradient (-u)) := by + simpa only [hg,neg_one_smul] using hH.smul (-1) + let vp := positive_part_gradient ho (hu.mono subset_closure) hH + let vn := positive_part_gradient ho (hu.neg.mono subset_closure) hn + have hp := positive_part_memH10 ho hu hH hb (fun x hx => (hz x hx).le) + have hq := positive_part_memH10 ho hu.neg hn hb (fun x hx => by simp only [hz x hx,neg_zero,le_refl]) + have he : hH.toH1 = vp.toH1-vn.toH1 := by + apply H1.value_injective ho + rw [map_sub,H1.value_toH1,H1.value_toH1,H1.value_toH1] + apply Lp.ext + filter_upwards [hH.1.coeFn_toLp,vp.1.coeFn_toLp,vn.1.coeFn_toLp, + Lp.coeFn_sub (vp.1.toLp _) (vn.1.toLp _),ae_restrict_mem ho.measurableSet] with x hx hpx hnx hsub hxΩ + rw [hsub,Pi.sub_apply,hx,hpx,hnx] + change u x = (Ω ∩ {x | 0 < u x}).indicator u x - + (Ω ∩ {x | 0 < (-u) x}).indicator (-u) x + by_cases h : 0 < u x + · have hn' : ¬0 < -u x := by linarith + simp only [indicator,mem_inter_iff,hxΩ,mem_ofPred_eq,true_and,Pi.neg_apply,h,hn',ite_true,ite_false,sub_zero] + · by_cases h' : u x < 0 + · have hn' : 0 < -u x := neg_pos.mpr h' + simp only [indicator,mem_inter_iff,hxΩ,mem_ofPred_eq,true_and,Pi.neg_apply,h,hn',ite_true,ite_false,zero_sub,neg_neg] + · have hx0 : u x = 0 := le_antisymm (le_of_not_gt h) (le_of_not_gt h') + simp [indicator,hx0] + rw [he] + exact (h10Submodule ho).sub_mem hp hq +end StrictHotSpots +end SmoothZeroTraceCombinedLayer + +section ContinuousZeroTraceCombinedLayer +open Set Filter MeasureTheory Metric +open scoped Topology ContDiff InnerProductSpace +namespace StrictHotSpots +namespace BoundarySign +variable {Ω : Set Plane} {u : Plane → ℝ} +lemma cut_contDiff_interior (ho : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) (hc : ContinuousOn u (closure Ω)) + (hb : ∀ x ∈ frontier Ω, u x ≤ 0) (n : ℕ) : ContDiff ℝ ∞ (cut Ω u n) := by + rw [contDiff_iff_contDiffAt] + intro x + by_cases hx : x ∈ Ω + · exact ((Nodal.cutoff_contDiff n).contDiffAt.comp x + (hu.contDiffAt (ho.mem_nhds hx))).congr_of_eventuallyEq + (cut_eq_nhds ho n hx) + · exact contDiffAt_const.congr_of_eventuallyEq + (cut_eq_zero_nhds hc n (fun h => hx (cutSupport_subset ho hb n h))) +def test_interior (ho : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) + (hc : ContinuousOn u (closure Ω)) (hbound : Bornology.IsBounded Ω) (hb : ∀ x ∈ frontier Ω, u x ≤ 0) (n : ℕ) : + smoothTestSpace Ω := + ⟨cut Ω u n, cut_contDiff_interior ho hu hc hb n, cut_hasCompactSupport hc hbound n, + cut_tsupport_subset ho hc hb n⟩ +lemma cut_gradient_interior (ho : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) + (n : ℕ) {x : Plane} (hx : x ∈ Ω) : + gradient (cut Ω u n) x = deriv (Nodal.cutoff n) (u x) • gradient u x := by + apply (InnerProductSpace.toDual ℝ Plane).injective + simp only [gradient,map_smul] + rw [(cut_eq_nhds ho n hx).fderiv_eq] + simp only [LinearIsometryEquiv.apply_symm_apply] + exact (((Nodal.cutoff_contDiff n).differentiable (by simp)).differentiableAt.hasDerivAt.comp_hasFDerivAt x + ((hu.contDiffAt (ho.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt).fderiv + +end BoundarySign +lemma positive_part_memH10_interior {Ω : Set Plane} {u : Plane → ℝ} + (ho : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) (hc : ContinuousOn u (closure Ω)) + (hH : HasH1Gradient Ω u (gradient u)) (hb : Bornology.IsBounded Ω) + (hz : ∀ x ∈ frontier Ω, u x ≤ 0) : + (positive_part_gradient ho hu hH).toH1 ∈ h10Submodule ho := by + let P := Ω ∩ {x | 0 < u x} + let hv := positive_part_gradient ho hu hH + let f (n : ℕ) := BoundarySign.test_interior ho hu hc hb hz n + have hvlim : Tendsto (fun n => H1.value (smoothTestToH1 ho (f n))) atTop (𝓝 (H1.value hv.toH1)) := by + apply L2VectorLimits.tendsto_toLp_of_dominated + (fun n => (HasH1Gradient.test ho (f n).property.1 (f n).property.2.1).1) hv.1 hH.1.norm + · exact Eventually.of_forall fun n => by + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + change ‖BoundarySign.cut Ω u n x‖ ≤ ‖u x‖ + simpa only [BoundarySign.cut,indicator_of_mem hx] using Nodal.cutoff_norm_le n (u x) + · filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + change Tendsto (fun n => BoundarySign.cut Ω u n x) atTop (𝓝 (P.indicator u x)) + simp only [BoundarySign.cut,indicator_of_mem hx] + simpa only [P,indicator,mem_inter_iff,mem_ofPred_eq,hx,true_and] using Nodal.cutoff_tendsto (u x) + obtain ⟨C,hC,hbd⟩ := Nodal.cutoff_deriv_bound + have hglim : Tendsto (fun n => H1.grad (smoothTestToH1 ho (f n))) atTop (𝓝 (H1.grad hv.toH1)) := by + apply L2VectorLimits.tendsto_toLp_of_dominated + (fun n => (HasH1Gradient.test ho (f n).property.1 (f n).property.2.1).2.1) + hv.2.1 (hH.2.1.norm.const_mul C) + · exact Eventually.of_forall fun n => by + filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + change ‖gradient (BoundarySign.cut Ω u n) x‖ ≤ C*‖gradient u x‖ + rw [BoundarySign.cut_gradient_interior ho hu n hx,norm_smul] + exact mul_le_mul_of_nonneg_right (hbd n (u x)) (norm_nonneg _) + · filter_upwards [ae_restrict_mem ho.measurableSet] with x hx + change Tendsto (fun n => gradient (BoundarySign.cut Ω u n) x) atTop + (𝓝 (P.indicator (gradient u) x)) + simp_rw [BoundarySign.cut_gradient_interior ho hu _ hx] + simpa only [P,indicator,mem_inter_iff,mem_ofPred_eq,hx,true_and,ite_smul,one_smul,zero_smul] using + (Nodal.cutoff_deriv_tendsto (u x)).smul_const (gradient u x) + change hv.toH1 ∈ closure ((smoothTestToH1 ho).range : Set (H1 Ω)) + exact mem_closure_of_tendsto (H1.tendsto_of_value_grad hvlim hglim) + (Eventually.of_forall fun n => ⟨f n,rfl⟩) + +theorem interior_smooth_zero_trace_memH10 {Ω : Set Plane} {u : Plane → ℝ} + (ho : IsOpen Ω) (hu : ContDiffOn ℝ ∞ u Ω) (hc : ContinuousOn u (closure Ω)) + (hH : HasH1Gradient Ω u (gradient u)) (hb : Bornology.IsBounded Ω) + (hz : ∀ x ∈ frontier Ω, u x = 0) : hH.toH1 ∈ h10Submodule ho := by + have hg : gradient (-u) = -gradient u := by + funext x + simp only [gradient,Pi.neg_apply,fderiv_neg,map_neg] + have hn : HasH1Gradient Ω (-u) (gradient (-u)) := by + simpa only [hg,neg_one_smul] using hH.smul (-1) + let vp := positive_part_gradient ho hu hH + let vn := positive_part_gradient ho hu.neg hn + have hp := positive_part_memH10_interior ho hu hc hH hb (fun x hx => (hz x hx).le) + have hq := positive_part_memH10_interior ho hu.neg hc.neg hn hb (fun x hx => by simp only [hz x hx,neg_zero,le_refl]) + have he : hH.toH1 = vp.toH1-vn.toH1 := by + apply H1.value_injective ho + rw [map_sub,H1.value_toH1,H1.value_toH1,H1.value_toH1] + apply Lp.ext + filter_upwards [hH.1.coeFn_toLp,vp.1.coeFn_toLp,vn.1.coeFn_toLp, + Lp.coeFn_sub (vp.1.toLp _) (vn.1.toLp _),ae_restrict_mem ho.measurableSet] with x hx hpx hnx hsub hxΩ + rw [hsub,Pi.sub_apply,hx,hpx,hnx] + change u x = (Ω ∩ {x | 0 < u x}).indicator u x - + (Ω ∩ {x | 0 < (-u) x}).indicator (-u) x + by_cases h : 0 < u x + · have hn' : ¬0 < -u x := by linarith + simp only [indicator,mem_inter_iff,hxΩ,mem_ofPred_eq,true_and,Pi.neg_apply,h,hn',ite_true,ite_false,sub_zero] + · by_cases h' : u x < 0 + · have hn' : 0 < -u x := neg_pos.mpr h' + simp only [indicator,mem_inter_iff,hxΩ,mem_ofPred_eq,true_and,Pi.neg_apply,h,hn',ite_true,ite_false,zero_sub,neg_neg] + · have hx0 : u x = 0 := le_antisymm (le_of_not_gt h) (le_of_not_gt h') + simp [indicator,hx0] + rw [he] + exact (h10Submodule ho).sub_mem hp hq +end StrictHotSpots +end ContinuousZeroTraceCombinedLayer + + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/TraceRank.lean b/lean/OAI/Analysis/HotSpots/TraceRank.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a0f6148809856d5f0a17ab98d6ced15f062c7f5 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/TraceRank.lean @@ -0,0 +1,391 @@ +import OAI.Analysis.HotSpots.Cauchy + +namespace OAI + +section ActualHilbertContradiction + + +section + +noncomputable section +open Set Function +open scoped InnerProductSpace Topology +namespace StrictHotSpots.CircleGeometry + +lemma continuous_exists_eq_antipodal (f : Circle → ℝ) (hf : Continuous f) : + ∃ s, f s = f (-s) := by + let h : Circle → ℝ := fun s => f s-f (-s) + have hc : Continuous h := hf.sub (hf.comp continuous_neg) + have hn (s : Circle) : h (-s) = -h s := by simp only [h,neg_neg]; ring + have hx : 0 ∈ Set.range h := by + apply mem_range_of_exists_le_of_exists_ge hc + · by_cases hh : h 1 ≤ 0 + · exact ⟨1,hh⟩ + · exact ⟨-1,by rw [hn]; linarith⟩ + · by_cases hh : 0 ≤ h 1 + · exact ⟨1,hh⟩ + · exact ⟨-1,by rw [hn]; linarith⟩ + obtain ⟨s,hs⟩ := hx + exact ⟨s,sub_eq_zero.mp hs⟩ + +lemma not_continuous_injective_to_real {f : Circle → ℝ} (hf : Continuous f) : + ¬Injective f := by + intro hi + obtain ⟨s,hs⟩ := continuous_exists_eq_antipodal f hf + exact Circle.neg_ne_self s (hi hs).symm + + +theorem not_subset_affine_line {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] + {b : Circle → H} (hb : Continuous b) (hi : Injective b) (a v : H) : + ¬(∀ s, ∃ t : ℝ, b s = a+t•v) := by + intro hline + have hn : v ≠ 0 := by + intro hz + apply Circle.neg_ne_self (1 : Circle) + apply hi + obtain ⟨c,hc⟩ := hline (-1) + obtain ⟨d,hd⟩ := hline 1 + simp only [hz,smul_zero,add_zero] at hc hd + exact hc.trans hd.symm + let f : Circle → ℝ := fun s => inner ℝ v (b s-a) + apply not_continuous_injective_to_real (show Continuous f by fun_prop) + intro s t hst + obtain ⟨r,hr⟩ := hline s + obtain ⟨q,hq⟩ := hline t + have hne : inner ℝ v v ≠ 0 := inner_self_ne_zero.mpr hn + have he : r=q := by + change inner ℝ v (b s-a) = inner ℝ v (b t-a) at hst + rw [hr,hq,add_sub_cancel_left,add_sub_cancel_left,real_inner_smul_right, + real_inner_smul_right] at hst + exact mul_right_cancel₀ hne hst + apply hi + rw [hr,hq,he] + +end StrictHotSpots.CircleGeometry + +end + +section + +noncomputable section +open Set Function Module +open scoped InnerProductSpace Topology +namespace StrictHotSpots.HilbertMultipliers + +variable {S E H ι : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup H] [InnerProductSpace ℝ H] + +local instance : Nontrivial Circle := ⟨⟨-1,1,Circle.neg_ne_self 1⟩⟩ + +lemma coordinate_separates (e : HilbertBasis ι ℝ H) {x y : H} (h : x ≠ y) : + ∃ i, inner ℝ (e i) x ≠ inner ℝ (e i) y := by + by_contra! hh + apply h + apply e.repr.injective + ext i + simpa only [e.repr_apply_apply] using hh i + +lemma pair_independent (T : Submodule ℝ (S → E)) (g : T) (a : S → ℝ) + (ha : (fun s => a s • g.val s) ∈ T) {s t : S} + (hs : g.val s ≠ 0) (ht : g.val t ≠ 0) (hst : a s ≠ a t) : + LinearIndependent ℝ ![(⟨fun s => a s • g.val s,ha⟩ : T),g] := by + rw [linearIndependent_fin2] + constructor + · intro hz + exact hs (congrArg (fun f : T => f.val s) hz) + · intro c hc + have hcs := congrArg (fun f : T => f.val s) hc + have hct := congrArg (fun f : T => f.val t) hc + change c • g.val s = a s • g.val s at hcs + change c • g.val t = a t • g.val t at hct + exact hst ((smul_left_injective ℝ hs hcs).symm.trans (smul_left_injective ℝ ht hct)) + +lemma rank_two_spanning {V : Type*} [AddCommGroup V] [Module ℝ V] + [FiniteDimensional ℝ V] {f g : V} (hr : finrank ℝ V ≤ 2) + (hi : LinearIndependent ℝ ![f,g]) (v : V) : ∃ a c : ℝ, a • f+c • g=v := by + have hn : Fintype.card (Fin 2) = finrank ℝ V := by + have hh := hi.fintype_card_le_finrank + simpa using (le_antisymm hh hr) + have htop := hi.span_eq_top_of_card_eq_finrank' hn + apply Submodule.mem_span_pair.mp + have he : Set.range ![f,g] = ({f,g} : Set V) := by simp [Set.pair_comm] + rw [← he,htop] + trivial + +lemma scalar_affine_elimination {A B C D P Q z : ℝ} (hne : P ≠ Q) + (hA : A=C*P+D) (hB : B=C*Q+D) : + C*z+D = A+((z-P)/(Q-P))*(B-A) := by + have hd : Q-P ≠ 0 := sub_ne_zero.mpr hne.symm + rw [hA,hB] + field_simp + ring + + + + +theorem rank_two_affine_support (e : HilbertBasis ι ℝ H) (b : S → H) + (T : Submodule ℝ (S → E)) [FiniteDimensional ℝ T] (hr : finrank ℝ T ≤ 2) + (g : T) (hmem : ∀ i, (fun s => inner ℝ (e i) (b s) • g.val s) ∈ T) + {s t : S} (hs : g.val s ≠ 0) (ht : g.val t ≠ 0) (hb : b s ≠ b t) : + ∃ j, inner ℝ (e j) (b s) ≠ inner ℝ (e j) (b t) ∧ + ∀ x, g.val x ≠ 0 → b x = b s + + ((inner ℝ (e j) (b x)-inner ℝ (e j) (b s)) / + (inner ℝ (e j) (b t)-inner ℝ (e j) (b s))) • (b t-b s) := by + obtain ⟨j,hj⟩ := coordinate_separates e hb + let f : T := ⟨fun x => inner ℝ (e j) (b x) • g.val x,hmem j⟩ + have hi : LinearIndependent ℝ ![f,g] := pair_independent T g _ (hmem j) hs ht hj + refine ⟨j,hj,?_⟩ + intro x hx + apply e.repr.injective + ext i + simp only [e.repr_apply_apply,inner_add_right,real_inner_smul_right,inner_sub_right] + obtain ⟨a,c,hac⟩ := rank_two_spanning hr hi (⟨fun y => inner ℝ (e i) (b y) • g.val y,hmem i⟩ : T) + have he (y : S) (hy : g.val y ≠ 0) : inner ℝ (e i) (b y) = a*inner ℝ (e j) (b y)+c := by + have hh := congrArg (fun f : T => f.val y) hac + change a • (inner ℝ (e j) (b y) • g.val y)+c • g.val y = + inner ℝ (e i) (b y) • g.val y at hh + rw [smul_smul,← add_smul] at hh + exact (smul_left_injective ℝ hy hh).symm + rw [he x hx] + exact scalar_affine_elimination hj (he s hs) (he t ht) + +lemma nonempty_open_two_points {S : Type*} [TopologicalSpace S] [PerfectSpace S] + {U : Set S} (hu : IsOpen U) (hne : U.Nonempty) : + ∃ s ∈ U, ∃ t ∈ U, s ≠ t := by + obtain ⟨s,hs⟩ := hne + obtain ⟨t,ht,hst⟩ := preperfect_iff_nhds.mp PerfectSpace.univ_preperfect + s (mem_univ s) U (hu.mem_nhds hs) + exact ⟨s,hs,t,ht.1,hst.symm⟩ + + + +theorem not_dense_support_of_rank_two (e : HilbertBasis ι ℝ H) + {b : Circle → H} (hb : Continuous b) (hi : Injective b) + (T : Submodule ℝ (Circle → E)) [FiniteDimensional ℝ T] (hr : finrank ℝ T ≤ 2) + (g : T) (hg : Continuous g.val) + (hmem : ∀ i, (fun s => inner ℝ (e i) (b s) • g.val s) ∈ T) : + ¬Dense {s | g.val s ≠ 0} := by + intro hd + have ho : IsOpen {s | g.val s ≠ 0} := isOpen_ne_fun hg continuous_const + obtain ⟨s,hs,t,ht,hst⟩ := nonempty_open_two_points ho hd.nonempty + obtain ⟨j,hj,hline⟩ := rank_two_affine_support e b T hr g hmem hs ht (hi.ne hst) + have hall : b = fun x => b s + + ((inner ℝ (e j) (b x)-inner ℝ (e j) (b s)) / + (inner ℝ (e j) (b t)-inner ℝ (e j) (b s))) • (b t-b s) := + Continuous.ext_on hd hb (by fun_prop) hline + apply CircleGeometry.not_subset_affine_line hb hi (b s) (b t-b s) + intro x + exact ⟨_,congrFun hall x⟩ + + + +theorem no_nonzero_multiplier_in_rank_one (e : HilbertBasis ι ℝ H) + {b : Circle → H} (hi : Injective b) + (T : Submodule ℝ (Circle → E)) [FiniteDimensional ℝ T] (hr : finrank ℝ T ≤ 1) + (g : T) (hg : Continuous g.val) + (hmem : ∀ i, (fun s => inner ℝ (e i) (b s) • g.val s) ∈ T) : g = 0 := by + by_contra hz + have hne : {s | g.val s ≠ 0}.Nonempty := by + by_contra hh + apply hz + apply Subtype.ext + funext s + exact not_ne_iff.mp (fun hs => hh ⟨s,hs⟩) + obtain ⟨s,hs,t,ht,hst⟩ := nonempty_open_two_points (isOpen_ne_fun hg continuous_const) hne + obtain ⟨j,hj⟩ := coordinate_separates e (hi.ne hst) + have hlin := pair_independent T g _ (hmem j) hs ht hj + have hn := hlin.fintype_card_le_finrank + simp only [Fintype.card_fin] at hn + omega + +end StrictHotSpots.HilbertMultipliers + +end + +section + +noncomputable section +open Set Function Module +open scoped InnerProductSpace Topology +namespace StrictHotSpots.HilbertMultipliers + +variable {S E H ι : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup H] [InnerProductSpace ℝ H] + + +def vanishingOn (T : Submodule ℝ (S → E)) (U : Set S) : Submodule ℝ (S → E) where + carrier := {f | f ∈ T ∧ ∀ x ∈ U, f x = 0} + zero_mem' := ⟨T.zero_mem,fun _ _ => rfl⟩ + add_mem' := by + intro f g hf hg + exact ⟨T.add_mem hf.1 hg.1,fun x hx => by simp [hf.2 x hx,hg.2 x hx]⟩ + smul_mem' := by + intro c f hf + exact ⟨T.smul_mem c hf.1,fun x hx => by simp [hf.2 x hx]⟩ + +lemma vanishingOn_le (T : Submodule ℝ (S → E)) (U : Set S) : vanishingOn T U ≤ T := + fun _ hf => hf.1 + +instance (T : Submodule ℝ (S → E)) [FiniteDimensional ℝ T] (U : Set S) : + FiniteDimensional ℝ (vanishingOn T U) := + FiniteDimensional.of_injective (Submodule.inclusion (vanishingOn_le T U)) + (Submodule.inclusion_injective (vanishingOn_le T U)) + + + + +theorem multiplier_contradiction (e : HilbertBasis ι ℝ H) + {b : Circle → H} (hb : Continuous b) (hi : Injective b) + (T : Submodule ℝ (Circle → E)) [FiniteDimensional ℝ T] + (hr : finrank ℝ T ≤ 2) + (hloc : ∀ U : Set Circle, IsOpen U → U.Nonempty → finrank ℝ (vanishingOn T U) ≤ 1) + (g : T) (hg : Continuous g.val) + (hmem : ∀ i, (fun s => inner ℝ (e i) (b s) • g.val s) ∈ T) : g = 0 := by + have hnd := not_dense_support_of_rank_two e hb hi T hr g hg hmem + let U : Set Circle := (closure {s | g.val s ≠ 0})ᶜ + have hU : IsOpen U := isClosed_closure.isOpen_compl + have hne : U.Nonempty := by + rw [dense_iff_closure_eq] at hnd + exact Set.nonempty_compl.mpr hnd + have hz (s : Circle) (hs : s ∈ U) : g.val s = 0 := by + by_contra hn + exact hs (subset_closure hn) + let f : vanishingOn T U := ⟨g.val,g.property,hz⟩ + have hm (i : ι) : (fun s => inner ℝ (e i) (b s) • f.val s) ∈ vanishingOn T U := by + refine ⟨hmem i,?_⟩ + intro s hs + change inner ℝ (e i) (b s) • g.val s = 0 + rw [hz s hs,smul_zero] + have hf := no_nonzero_multiplier_in_rank_one e hi (vanishingOn T U) (hloc U hU hne) f hg hm + exact Subtype.ext (congrArg (fun w : vanishingOn T U => w.val) hf) + +end StrictHotSpots.HilbertMultipliers + +end +end +end +end +end ActualHilbertContradiction + +section ClosedTraceRank + +noncomputable section +open Set Function Module +open scoped Topology +namespace StrictHotSpots +open HilbertMultipliers + + +def closedGradientTrace {Ω : Set Plane} (c : Conformal.ClosedDiskChart Ω) + (hΩ : AdmissibleDomain Ω) : closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1 →ₗ[ℝ] (Circle → Plane) where + toFun J s := J.val.2 ⟨c.circleBoundaryHomeomorph s,(c.circleBoundaryHomeomorph s).property.1⟩ + map_add' _ _ := rfl + map_smul' _ _ := rfl + +def closedTraceSpace {Ω : Set Plane} (c : Conformal.ClosedDiskChart Ω) + (hΩ : AdmissibleDomain Ω) : Submodule ℝ (Circle → Plane) := (closedGradientTrace c hΩ).range + +lemma closedTraceSpace_rank {Ω : Set Plane} (c : Conformal.ClosedDiskChart Ω) + (hΩ : AdmissibleDomain Ω) : Module.Finite ℝ (closedTraceSpace c hΩ) ∧ + finrank ℝ (closedTraceSpace c hΩ) ≤ 2 := by + obtain ⟨hf,hr⟩ := closedEigenSpace_finrank_le_two c hΩ + let : Module.Finite ℝ (closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1) := hf + refine ⟨?_,(LinearMap.finrank_range_le (closedGradientTrace c hΩ)).trans hr⟩ + change Module.Finite ℝ (closedGradientTrace c hΩ).range + infer_instance + +lemma closedTraceSpace_local_rank {Ω : Set Plane} (c : Conformal.ClosedDiskChart Ω) + (hΩ : AdmissibleDomain Ω) {U : Set Circle} (hU : IsOpen U) (hne : U.Nonempty) : + finrank ℝ (vanishingOn (closedTraceSpace c hΩ) U) ≤ 1 := by + classical + obtain ⟨O,hO,hOU⟩ := isOpen_induced_iff.mp (c.circleBoundaryHomeomorph.isOpenMap U hU) + have hmem (s : Circle) : s ∈ U ↔ (c.circleBoundaryHomeomorph s : Plane) ∈ O := by + have hh : c.circleBoundaryHomeomorph s ∈ c.circleBoundaryHomeomorph '' U ↔ s ∈ U := + c.circleBoundaryHomeomorph.injective.mem_set_image + rw [← hOU] at hh + exact hh.symm + obtain ⟨s,hs⟩ := hne + obtain ⟨hf,hr⟩ := closedPatchEigenSpace_finrank_le_one c hΩ + (c.circleBoundaryHomeomorph s).property hO ((hmem s).mp hs) + let : Module.Finite ℝ (closedPatchEigenSpace Ω O hΩ) := hf + let E := closedEigenSpace Ω hΩ.2.1 hΩ.2.2.1 + let P := closedPatchEigenSpace Ω O hΩ + let inc : P →ₗ[ℝ] E := Submodule.inclusion (fun _ h => h.1) + let L := (closedGradientTrace c hΩ).comp inc + have heq : L.range = vanishingOn (closedTraceSpace c hΩ) U := by + ext g + constructor + · rintro ⟨J,rfl⟩ + refine ⟨⟨inc J,rfl⟩,?_⟩ + intro t ht + exact J.property.2 _ ⟨(hmem t).mp ht,(c.circleBoundaryHomeomorph t).property⟩ + · rintro ⟨⟨J,hJ⟩,hz⟩ + have hpatch : J.val ∈ P := by + refine ⟨J.property,?_⟩ + intro x hx + let t := c.circleBoundaryHomeomorph.symm ⟨x,hx.2⟩ + have ht : (c.circleBoundaryHomeomorph t : Plane) = x := + congrArg Subtype.val (c.circleBoundaryHomeomorph.apply_symm_apply ⟨x,hx.2⟩) + have htU : t ∈ U := (hmem t).mpr (ht ▸ hx.1) + have hh := hz t htU + rw [← hJ] at hh + change J.val.2 ⟨c.circleBoundaryHomeomorph t,_⟩ = 0 at hh + convert hh using 1 + exact congrArg J.val.2 (Subtype.ext ht.symm) + refine ⟨⟨J.val,hpatch⟩,?_⟩ + exact hJ + rw [← heq] + exact (LinearMap.finrank_range_le L).trans hr +end StrictHotSpots +end +end ClosedTraceRank + +section ClosedTraceNonzero + +noncomputable section +open Set Filter Metric Function +open scoped Topology ContDiff InnerProductSpace +namespace StrictHotSpots.Conformal.ClosedDiskChart +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) +include c + + + + +theorem boundary_gradient_not_zero (hΩ : AdmissibleDomain Ω) + {v : Plane → ℝ} (hv : InInteriorNeumannEigenspace Ω v) + (hvc : ContinuousOn v (closure Ω)) {Y : Plane → Plane} + (hY : ContinuousOn Y (closure Ω)) (he : EqOn (gradient v) Y Ω) + (hne : ∃ x ∈ Ω, v x ≠ 0) : ¬ (∀ x ∈ frontier Ω, Y x = 0) := by + intro hz + have hd (x : Plane) (hx : x ∈ frontier Ω) : + HasFDerivWithinAt v (0 : Plane →L[ℝ] ℝ) (closure Ω) x := + c.hasFDerivWithinAt_zero_of_closedGradient_zero hv.1 hvc hY he hx.1 (hz x hx) + let f : Circle → ℝ := fun s => v (c.circleBoundaryHomeomorph s) + have hmap : Continuous (fun s : Circle => (c.circleBoundaryHomeomorph s : Plane)) := + continuous_subtype_val.comp c.circleBoundaryHomeomorph.continuous + have hc : IsLocallyConstant f := by + apply (IsLocallyConstant.iff_exists_open f).mpr + intro s + obtain ⟨V,hV,hsV,hconst⟩ := hΩ.2.2.2.2.locally_const_of_boundary_zero_jet hΩ.2.1 + (c.circleBoundaryHomeomorph s).property isOpen_univ (mem_univ _) + (fun x hx => hd x hx.2) + refine ⟨(fun s : Circle => (c.circleBoundaryHomeomorph s : Plane)) ⁻¹' V, + hV.preimage hmap,hsV,?_⟩ + intro t ht + exact hconst _ ⟨ht,(c.circleBoundaryHomeomorph t).property⟩ + obtain ⟨x,hx,hvx⟩ := InteriorBoundarySign.exists_boundary_pos hΩ.2.1 hΩ.2.2.1 hv hvc hne + obtain ⟨y,hy,hvy⟩ := InteriorBoundarySign.exists_boundary_neg hΩ.2.1 hΩ.2.2.1 hv hvc hne + have heq := hc.apply_eq_of_preconnectedSpace + (c.circleBoundaryHomeomorph.symm ⟨x,hx⟩) (c.circleBoundaryHomeomorph.symm ⟨y,hy⟩) + change v (c.circleBoundaryHomeomorph (c.circleBoundaryHomeomorph.symm ⟨x,hx⟩)) = + v (c.circleBoundaryHomeomorph (c.circleBoundaryHomeomorph.symm ⟨y,hy⟩)) at heq + simp only [Homeomorph.apply_symm_apply] at heq + linarith +end StrictHotSpots.Conformal.ClosedDiskChart +end +end ClosedTraceNonzero + + + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/Variational.lean b/lean/OAI/Analysis/HotSpots/Variational.lean new file mode 100644 index 0000000000000000000000000000000000000000..c847df6266d14a2e3bd1304d3fd6fc8685eaccd8 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/Variational.lean @@ -0,0 +1,1176 @@ +import OAI.Analysis.HotSpots.Douglas +import OAI.Analysis.HotSpots.GreenOperator + +namespace OAI + +section DouglasLipschitzBase +noncomputable section +section MainVariationalCombinedLayer +open Set MeasureTheory Filter +open scoped Topology InnerProductSpace ContDiff +namespace StrictHotSpots + + + + + + +def MainTheorem : Prop := + ∀ (Ω : Set Plane), AdmissibleDomain Ω → + ∀ (u : Plane → ℝ), InFirstNeumannEigenspace Ω u → + (∃ x ∈ Ω, u x ≠ 0) → MainConclusion Ω u + +lemma rayleighValues_nonneg {Ω : Set Plane} {r : ℝ} (hr : r ∈ rayleighValues Ω) : + 0 ≤ r := by + obtain ⟨v, g, _, _, hm, rfl⟩ := hr + exact div_nonneg (integral_nonneg fun x => sq_nonneg ‖g x‖) hm.le + +lemma firstPositiveNeumannValue_nonneg (Ω : Set Plane) : + 0 ≤ firstPositiveNeumannValue Ω := + Real.sInf_nonneg fun _ hr => rayleighValues_nonneg hr + + +lemma rayleigh_inequality {Ω : Set Plane} {v : Plane → ℝ} {g : Plane → Plane} + (hv : HasH1Gradient Ω v g) (hm : (∫ x in Ω, v x) = 0) + (hpos : 0 < ∫ x in Ω, (v x) ^ 2) : + firstPositiveNeumannValue Ω * (∫ x in Ω, (v x) ^ 2) ≤ + ∫ x in Ω, ‖g x‖ ^ 2 := by + apply (le_div_iff₀ hpos).mp + apply csInf_le + · exact ⟨0, fun _ hr => rayleighValues_nonneg hr⟩ + · exact ⟨v, g, hv, hm, hpos, rfl⟩ + +lemma eigenfunction_energy_identity {Ω : Set Plane} {u : Plane → ℝ} + (hu : InFirstNeumannEigenspace Ω u) : + (∫ x in Ω, ‖gradient u x‖ ^ 2) = + firstPositiveNeumannValue Ω * (∫ x in Ω, (u x) ^ 2) := by + simpa only [real_inner_self_eq_norm_sq, pow_two] using hu.2.2.2 u (gradient u) hu.2.1 + + + +lemma strict_boundary_extrema_of_noncritical {Ω : Set Plane} {u : Plane → ℝ} + (hne : Ω.Nonempty) (hopen : IsOpen Ω) (hbound : Bornology.IsBounded Ω) + (hu : ContinuousOn u (closure Ω)) + (hnocrit : ∀ x ∈ Ω, gradient u x ≠ 0) : MainConclusion Ω u := by + have hnotmin (x : Plane) (hx : x ∈ Ω) : ¬IsMinOn u (closure Ω) x := by + intro hm + have hl := hm.isLocalMin (Filter.mem_of_superset (hopen.mem_nhds hx) subset_closure) + apply hnocrit x hx + simp [gradient, hl.fderiv_eq_zero] + have hnotmax (x : Plane) (hx : x ∈ Ω) : ¬IsMaxOn u (closure Ω) x := by + intro hm + have hl := hm.isLocalMax (Filter.mem_of_superset (hopen.mem_nhds hx) subset_closure) + apply hnocrit x hx + simp [gradient, hl.fderiv_eq_zero] + obtain ⟨a, ha, hmin⟩ := hbound.isCompact_closure.exists_isMinOn hne.closure hu + obtain ⟨b, hb, hmax⟩ := hbound.isCompact_closure.exists_isMaxOn hne.closure hu + have hfa : a ∈ frontier Ω := by + rw [frontier, hopen.interior_eq] + exact ⟨ha, fun hx => hnotmin a hx hmin⟩ + have hfb : b ∈ frontier Ω := by + rw [frontier, hopen.interior_eq] + exact ⟨hb, fun hx => hnotmax b hx hmax⟩ + have hleast : IsLeast (u '' frontier Ω) (u a) := by + refine ⟨⟨a, hfa, rfl⟩, ?_⟩ + rintro _ ⟨y, hy, rfl⟩ + exact hmin (frontier_subset_closure hy) + have hgreatest : IsGreatest (u '' frontier Ω) (u b) := by + refine ⟨⟨b, hfb, rfl⟩, ?_⟩ + rintro _ ⟨y, hy, rfl⟩ + exact hmax (frontier_subset_closure hy) + refine ⟨hnocrit, ?_⟩ + intro x hx + rw [hleast.csInf_eq, hgreatest.csSup_eq] + constructor + · by_contra hlt + apply hnotmin x hx + intro y hy + exact (le_of_not_gt hlt).trans (hmin hy) + · by_contra hlt + apply hnotmax x hx + intro y hy + exact (hmax hy).trans (le_of_not_gt hlt) + + +lemma eigenfunction_mass_pos {Ω : Set Plane} {u : Plane → ℝ} + (hopen : IsOpen Ω) (hu : InFirstNeumannEigenspace Ω u) + (hne : ∃ x ∈ Ω, u x ≠ 0) : 0 < ∫ x in Ω, (u x) ^ 2 := by + have hn : 0 ≤ ∫ x in Ω, (u x) ^ 2 := integral_nonneg fun x => sq_nonneg (u x) + by_contra hp + have hz : (∫ x in Ω, (u x) ^ 2) = 0 := le_antisymm (le_of_not_gt hp) hn + have hae := (integral_eq_zero_iff_of_nonneg (fun x => sq_nonneg (u x)) + hu.2.1.1.integrable_sq).mp hz + have hu0 : u =ᵐ[volume.restrict Ω] 0 := by + filter_upwards [hae] with x hx + simpa using (eq_zero_of_pow_eq_zero hx : u x = 0) + have hall := Measure.eqOn_open_of_ae_eq hu0 hopen + (hu.1.continuousOn.mono subset_closure) continuousOn_const + obtain ⟨x, hx, hux⟩ := hne + exact hux (hall hx) + +lemma eigenfunction_gradient_continuous {Ω : Set Plane} {u : Plane → ℝ} + (hopen : IsOpen Ω) (hu : InFirstNeumannEigenspace Ω u) : + ContinuousOn (gradient u) Ω := by + exact (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp_continuousOn + ((hu.1.mono subset_closure).continuousOn_fderiv_of_isOpen hopen (by simp)) + + +lemma firstPositiveNeumannValue_pos_of_eigenfunction {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : AdmissibleDomain Ω) (hu : InFirstNeumannEigenspace Ω u) + (hne : ∃ x ∈ Ω, u x ≠ 0) : 0 < firstPositiveNeumannValue Ω := by + have hμ := firstPositiveNeumannValue_nonneg Ω + by_contra hp + have hz : firstPositiveNeumannValue Ω = 0 := le_antisymm (le_of_not_gt hp) hμ + have he : (∫ x in Ω, ‖gradient u x‖ ^ 2) = 0 := by + rw [eigenfunction_energy_identity hu, hz, zero_mul] + have hi : Integrable (fun x => ‖gradient u x‖ ^ 2) (volume.restrict Ω) := + hu.2.1.2.1.integrable_norm_pow (by norm_num) + have hg2 := (integral_eq_zero_iff_of_nonneg (fun x => sq_nonneg ‖gradient u x‖) hi).mp he + have hg : gradient u =ᵐ[volume.restrict Ω] 0 := by + filter_upwards [hg2] with x hx + simpa using (eq_zero_of_pow_eq_zero hx : ‖gradient u x‖ = 0) + have hg0 := Measure.eqOn_open_of_ae_eq hg hΩ.2.1 + (eigenfunction_gradient_continuous hΩ.2.1 hu) continuousOn_const + have hd0 : Ω.EqOn (fderiv ℝ u) 0 := by + intro x hx + have hh := hg0 hx + change (InnerProductSpace.toDual ℝ Plane).symm (fderiv ℝ u x) = 0 at hh + simpa using congrArg (InnerProductSpace.toDual ℝ Plane) hh + obtain ⟨x, hx, hux⟩ := hne + have hc : Ω.EqOn u (fun _ => u x) := fun y hy => + hΩ.2.1.is_const_of_fderiv_eq_zero + hΩ.2.2.2.1.isPathConnected.isConnected.isPreconnected + ((hu.1.mono subset_closure).differentiableOn (by simp)) hd0 hy hx + have hmean : (∫ y in Ω, u x) = 0 := + (setIntegral_congr_fun hΩ.2.1.measurableSet hc).symm.trans hu.2.2.1 + have hv : 0 < (volume Ω).toReal := + ENNReal.toReal_pos (ne_of_gt (hΩ.2.1.measure_pos volume hΩ.1)) + hΩ.2.2.1.measure_lt_top.ne + simp only [integral_const, measureReal_restrict_apply_univ, smul_eq_mul] at hmean + exact hux ((mul_eq_zero.mp hmean).resolve_left hv.ne') + +lemma integrable_inner_of_memLp {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + {μ : Measure Plane} {f g : Plane → E} (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) : + Integrable (fun x => inner ℝ (f x) (g x)) μ := by + exact (hf.norm.integrable_mul hg.norm).mono' (hf.aestronglyMeasurable.inner hg.aestronglyMeasurable) + (Filter.Eventually.of_forall fun x => norm_inner_le_norm _ _) + +lemma integral_norm_add_smul_sq {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + {μ : Measure Plane} {f g : Plane → E} (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) (t : ℝ) : + (∫ x, ‖f x + t • g x‖ ^ 2 ∂μ) = (∫ x, ‖f x‖ ^ 2 ∂μ) + + 2 * t * (∫ x, inner ℝ (f x) (g x) ∂μ) + t ^ 2 * (∫ x, ‖g x‖ ^ 2 ∂μ) := by + have hf2 : Integrable (fun x => ‖f x‖ ^ 2) μ := hf.integrable_norm_pow (by norm_num) + have hg2 : Integrable (fun x => ‖g x‖ ^ 2) μ := hg.integrable_norm_pow (by norm_num) + have hfg := integrable_inner_of_memLp hf hg + calc + _ = ∫ x, ‖f x‖ ^ 2 + 2 * t * inner ℝ (f x) (g x) + t ^ 2 * ‖g x‖ ^ 2 ∂μ := by + apply integral_congr_ae + filter_upwards [] with x + simp only [← real_inner_self_eq_norm_sq, inner_add_left, inner_add_right, + real_inner_smul_left, real_inner_smul_right, real_inner_comm (g x) (f x)] + ring + _ = _ := by + have hi12 : Integrable (fun x => ‖f x‖ ^ 2 + 2 * t * inner ℝ (f x) (g x)) μ := + hf2.add (hfg.const_mul (2 * t)) + rw [integral_add hi12 (hg2.const_mul (t ^ 2)), + integral_add hf2 (hfg.const_mul (2 * t)), integral_const_mul, integral_const_mul] + +lemma integral_sq_add_mul {μ : Measure Plane} {v w : Plane → ℝ} + (hv : MemLp v 2 μ) (hw : MemLp w 2 μ) (t : ℝ) : + (∫ x, (v x + t * w x) ^ 2 ∂μ) = (∫ x, (v x) ^ 2 ∂μ) + + 2 * t * (∫ x, v x * w x ∂μ) + t ^ 2 * (∫ x, (w x) ^ 2 ∂μ) := by + simpa only [smul_eq_mul, Real.norm_eq_abs, sq_abs, RCLike.inner_apply, starRingEnd_apply, star_trivial, mul_comm] using + integral_norm_add_smul_sq hv hw t + +lemma rayleigh_inequality_all {Ω : Set Plane} {v : Plane → ℝ} {g : Plane → Plane} + (hv : HasH1Gradient Ω v g) (hm : (∫ x in Ω, v x) = 0) : + firstPositiveNeumannValue Ω * (∫ x in Ω, (v x) ^ 2) ≤ ∫ x in Ω, ‖g x‖ ^ 2 := by + have hnn : 0 ≤ ∫ x in Ω, (v x) ^ 2 := integral_nonneg fun x => sq_nonneg (v x) + rcases eq_or_lt_of_le hnn with hz | hp + · rw [← hz, mul_zero] + exact integral_nonneg fun x => sq_nonneg ‖g x‖ + · exact rayleigh_inequality hv hm hp + + + +lemma minimizer_euler_mean_zero {Ω : Set Plane} {u v : Plane → ℝ} + {g k : Plane → Plane} (hb : Bornology.IsBounded Ω) + (hu : HasH1Gradient Ω u g) (hv : HasH1Gradient Ω v k) + (hmu : (∫ x in Ω, u x) = 0) (hmv : (∫ x in Ω, v x) = 0) + (he : (∫ x in Ω, ‖g x‖ ^ 2) = + firstPositiveNeumannValue Ω * (∫ x in Ω, (u x) ^ 2)) : + (∫ x in Ω, inner ℝ (g x) (k x)) = + firstPositiveNeumannValue Ω * (∫ x in Ω, u x * v x) := by + let : IsFiniteMeasure (volume.restrict Ω) := ⟨by simpa using hb.measure_lt_top⟩ + have hui : Integrable u (volume.restrict Ω) := hu.1.integrable (by norm_num) + have hvi : Integrable v (volume.restrict Ω) := hv.1.integrable (by norm_num) + have hvar (t : ℝ) := rayleigh_inequality_all (hu.add (hv.smul t)) (by + show (∫ x in Ω, u x + t * v x) = 0 + rw [integral_add hui (hvi.const_mul t), integral_const_mul, hmu, hmv] + ring) + have hpoly : ∀ t : ℝ, 0 ≤ + ((∫ x in Ω, ‖k x‖ ^ 2) - firstPositiveNeumannValue Ω * (∫ x in Ω, (v x) ^ 2)) * (t * t) + + (2 * ((∫ x in Ω, inner ℝ (g x) (k x)) - + firstPositiveNeumannValue Ω * (∫ x in Ω, u x * v x))) * t + 0 := by + intro t + have ht := hvar t + simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul] at ht + rw [integral_norm_add_smul_sq hu.2.1 hv.2.1 t, + integral_sq_add_mul hu.1 hv.1 t, he] at ht + nlinarith + have hd := discrim_le_zero hpoly + simp only [discrim, mul_zero, sub_zero] at hd + nlinarith [sq_nonneg ((∫ x in Ω, inner ℝ (g x) (k x)) - + firstPositiveNeumannValue Ω * (∫ x in Ω, u x * v x))] + + + +lemma minimizer_euler {Ω : Set Plane} {u v : Plane → ℝ} {g k : Plane → Plane} + (hb : Bornology.IsBounded Ω) (hvol : 0 < (volume Ω).toReal) + (hu : HasH1Gradient Ω u g) (hv : HasH1Gradient Ω v k) + (hmu : (∫ x in Ω, u x) = 0) + (he : (∫ x in Ω, ‖g x‖ ^ 2) = + firstPositiveNeumannValue Ω * (∫ x in Ω, (u x) ^ 2)) : + (∫ x in Ω, inner ℝ (g x) (k x)) = + firstPositiveNeumannValue Ω * (∫ x in Ω, u x * v x) := by + let : IsFiniteMeasure (volume.restrict Ω) := ⟨by simpa using hb.measure_lt_top⟩ + let c := (∫ x in Ω, v x) / (volume Ω).toReal + have hui : Integrable u (volume.restrict Ω) := hu.1.integrable (by norm_num) + have hvi : Integrable v (volume.restrict Ω) := hv.1.integrable (by norm_num) + have hw : HasH1Gradient Ω (fun x => v x - c) k := by + change HasH1Gradient Ω (v - fun _ => c) k + simpa only [sub_zero] using hv.sub (HasH1Gradient.const hb c) + have hm : (∫ x in Ω, v x - c) = 0 := by + rw [integral_sub hvi (integrable_const c)] + simp only [integral_const, measureReal_restrict_apply_univ, smul_eq_mul] + change (∫ x in Ω, v x) - (volume Ω).toReal * c = 0 + dsimp [c] + field_simp + ring + have hh := minimizer_euler_mean_zero hb hu hw hmu hm he + have hi : (∫ x in Ω, u x * (v x - c)) = (∫ x in Ω, u x * v x) := by + simp only [mul_sub] + have huv : Integrable (fun x => u x * v x) (volume.restrict Ω) := hu.1.integrable_mul hv.1 + rw [integral_sub huv (hui.mul_const c), + integral_mul_const, hmu, zero_mul, sub_zero] + rwa [hi] at hh + +lemma inFirstNeumannEigenspace_of_minimizer {Ω : Set Plane} {u : Plane → ℝ} + (hΩ : AdmissibleDomain Ω) (hs : ContDiffOn ℝ ∞ u (closure Ω)) + (hu : HasH1Gradient Ω u (gradient u)) (hm : (∫ x in Ω, u x) = 0) + (he : (∫ x in Ω, ‖gradient u x‖ ^ 2) = + firstPositiveNeumannValue Ω * (∫ x in Ω, (u x) ^ 2)) : + InFirstNeumannEigenspace Ω u := by + refine ⟨hs, hu, hm, fun v g hv => minimizer_euler hΩ.2.2.1 ?_ hu hv hm he⟩ + exact ENNReal.toReal_pos (ne_of_gt (hΩ.2.1.measure_pos volume hΩ.1)) + hΩ.2.2.1.measure_lt_top.ne + + +end StrictHotSpots +end MainVariationalCombinedLayer + +section C1WeakGradientWeightedCombinedLayer +open Set MeasureTheory +open scoped ContDiff InnerProductSpace +namespace StrictHotSpots +lemma integral_mul_test_hasFDerivAt {Ω : Set Plane} {f φ : Plane → ℝ} + {D : Plane → Plane →L[ℝ] ℝ} (ho : IsOpen Ω) + (hcF : ContinuousOn f Ω) (hcD : ContinuousOn D Ω) + (hd : ∀ x ∈ Ω, HasFDerivAt f (D x) x) + (hφ : ContDiff ℝ ∞ φ) (hk : HasCompactSupport φ) (hs : tsupport φ ⊆ Ω) + (e : Plane) : + (∫ x in Ω, f x * (fderiv ℝ φ x) e) = -(∫ x in Ω, D x e * φ x) := by + have hdφ : Continuous (fun x => (fderiv ℝ φ x) e) := + (hφ.continuous_fderiv (by simp)).clm_apply continuous_const + have hcDf : ContinuousOn (fun x => fderiv ℝ f x e) Ω := by + apply (hcD.clm_apply continuousOn_const).congr + intro x hx + exact congrArg (fun A : Plane →L[ℝ] ℝ => A e) (hd x hx).fderiv + have hds : tsupport (fun x => (fderiv ℝ φ x) e) ⊆ Ω := + (tsupport_fderiv_apply_subset ℝ e).trans hs + have hi := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + (integrable_mul_test ho hcDf hφ.continuous hk hs) + (integrable_mul_test ho hcF hdφ (hk.fderiv_apply ℝ e) hds) + (integrable_mul_test ho hcF hφ.continuous hk hs) + (fun x hx => (hd x (hs hx)).differentiableAt) + (fun x _ => hφ.differentiable (by simp) x) + rw [setIntegral_mul_test hds] + rw [hi,← setIntegral_mul_test hs] + congr 1 + apply setIntegral_congr_fun ho.measurableSet + intro x hx + change fderiv ℝ f x e * φ x = D x e * φ x + rw [(hd x hx).fderiv] + +lemma HasH1Gradient.of_hasFDerivAt {Ω : Set Plane} {f : Plane → ℝ} {g : Plane → Plane} + (ho : IsOpen Ω) (hf : ContinuousOn f Ω) (hg : ContinuousOn g Ω) + (hd : ∀ x ∈ Ω, HasFDerivAt f (InnerProductSpace.toDual ℝ Plane (g x)) x) + (hmf : MemLp f 2 (volume.restrict Ω)) (hmg : MemLp g 2 (volume.restrict Ω)) : + HasH1Gradient Ω f g := by + refine ⟨hmf,hmg,fun φ hφ hk hs e => ?_⟩ + exact integral_mul_test_hasFDerivAt ho hf + ((InnerProductSpace.toDual ℝ Plane).continuous.comp_continuousOn hg) hd hφ hk hs e +end StrictHotSpots +end C1WeakGradientWeightedCombinedLayer + +section DouglasH1CombinedLayer +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ComplexConjugate ContDiff InnerProductSpace +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 + +def planeSeries (a : ℤ → ℂ) (x : Plane) : ℝ := + (harmonicSeries a (complexIso.symm x)).re + +def planeD (a : ℤ → ℂ) (x : Plane) : Plane →L[ℝ] ℝ := + (Complex.reCLM.comp (harmonicD a (complexIso.symm x))).comp + complexIso.symm.toContinuousLinearEquiv.toContinuousLinearMap + +def planeGrad (a : ℤ → ℂ) (x : Plane) : Plane := + (InnerProductSpace.toDual ℝ Plane).symm (planeD a x) + +lemma planeSeries_continuousOn {a : ℤ → ℂ} (ha : Summable (fun m => ‖a m‖)) : + ContinuousOn (planeSeries a) (closedBall 0 1) := by + apply Complex.continuous_re.comp_continuousOn + apply (harmonicSeries_continuousOn ha).comp complexIso.symm.continuous.continuousOn + intro x hx + simpa only [mem_closedBall_zero_iff,LinearIsometryEquiv.norm_map] using hx + +lemma planeD_continuousOn {a : ℤ → ℂ} + (ha : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) : + ContinuousOn (planeD a) (closedBall 0 1) := by + have hc : ContinuousOn (fun x : Plane => harmonicD a (complexIso.symm x)) (closedBall 0 1) := by + apply (harmonicD_continuousOn ha).comp complexIso.symm.continuous.continuousOn + intro x hx + simpa only [mem_closedBall_zero_iff,LinearIsometryEquiv.norm_map] using hx + exact (continuousOn_const.clm_comp hc).clm_comp continuousOn_const + +lemma planeGrad_continuousOn {a : ℤ → ℂ} + (ha : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) : + ContinuousOn (planeGrad a) (closedBall 0 1) := + (InnerProductSpace.toDual ℝ Plane).symm.continuous.comp_continuousOn (planeD_continuousOn ha) + +lemma planeSeries_hasFDerivAt {a : ℤ → ℂ} + (h0 : Summable (fun m => ‖a m‖)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) {x : Plane} (hx : x ∈ disk) : + HasFDerivAt (planeSeries a) (planeD a x) x := by + have hz : complexIso.symm x ∈ ball (0:ℂ) 1 := by + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + exact (Complex.reCLM.hasFDerivAt.comp _ (harmonicSeries_hasFDerivAt h0 h1 hz)).comp x + complexIso.symm.toContinuousLinearEquiv.hasFDerivAt + +lemma disk_memLp_of_continuousOn {F : Type*} [NormedAddCommGroup F] + {f : Plane → F} (hf : ContinuousOn f (closedBall 0 1)) : MemLp f 2 (volume.restrict disk) := by + let : IsFiniteMeasure (volume.restrict (ball (0:Plane) 1)) := + isFiniteMeasure_restrict.mpr (isBounded_ball (x := (0:Plane)) (r := 1)).measure_lt_top.ne + obtain ⟨C,hC⟩ := (isCompact_closedBall (0:Plane) 1).exists_bound_of_continuousOn hf + apply MemLp.of_bound ((hf.mono ball_subset_closedBall).aestronglyMeasurable measurableSet_ball) C + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + exact hC x (ball_subset_closedBall hx) + + + +theorem planeSeries_hasH1Gradient {a : ℤ → ℂ} + (h0 : Summable (fun m => ‖a m‖)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) : + HasH1Gradient disk (planeSeries a) (planeGrad a) := by + apply HasH1Gradient.of_hasFDerivAt isOpen_ball + ((planeSeries_continuousOn h0).mono ball_subset_closedBall) + ((planeGrad_continuousOn h1).mono ball_subset_closedBall) + · intro x hx + simpa only [planeGrad,LinearIsometryEquiv.apply_symm_apply] using planeSeries_hasFDerivAt h0 h1 hx + · exact disk_memLp_of_continuousOn (planeSeries_continuousOn h0) + · exact disk_memLp_of_continuousOn (planeGrad_continuousOn h1) + +lemma planeSeries_gradient {a : ℤ → ℂ} + (h0 : Summable (fun m => ‖a m‖)) + (h1 : Summable (fun m => (m.natAbs:ℝ)*‖a m‖)) : + HasH1Gradient disk (planeSeries a) (gradient (planeSeries a)) := by + have h := planeSeries_hasH1Gradient h0 h1 + have he : planeGrad a =ᵐ[volume.restrict disk] gradient (planeSeries a) := by + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + unfold planeGrad gradient + rw [(planeSeries_hasFDerivAt h0 h1 hx).fderiv] + exact ⟨h.1,h.2.1.ae_eq he,fun φ hφ hc hs e => by + rw [h.2.2 φ hφ hc hs e] + congr 1 + apply integral_congr_ae + filter_upwards [he] with x hx + rw [hx]⟩ + +end StrictHotSpots.Douglas +end DouglasH1CombinedLayer + +section DouglasInteriorCombinedLayer +open Set MeasureTheory Filter Metric AddCircle +open scoped Topology ComplexConjugate ContDiff InnerProductSpace +namespace StrictHotSpots.Douglas +open PlaneGreen DiskH10 + +lemma harmonicSeries_re_poisson {a : ℤ → ℂ} (ha : Summable (fun m => ‖a m‖)) + {z : ℂ} (hz : z ∈ ball 0 1) : + Real.circleAverage (poissonKernel 0 z • (fun w => (harmonicSeries a w).re)) 0 1 = + (harmonicSeries a z).re := by + have hc := (harmonicSeries_continuousOn ha).mono sphere_subset_closedBall + have hi := ((poissonKernel_continuousOn_sphere hz).smul hc).circleIntegrable (by norm_num : (0:ℝ) ≤ 1) + have he := Complex.reCLM.circleAverage_comp_comm hi + calc + _ = (Real.circleAverage (poissonKernel 0 z • harmonicSeries a) 0 1).re := by + convert he using 1 + · congr 1 + funext w + simp [Pi.smul_apply'] + · rfl + _ = _ := congrArg Complex.re (harmonicSeries_poisson ha hz) + +lemma poissonAverage_contDiffOn {f : ℂ → ℝ} (hf : CircleIntegrable f 0 1) : + ContDiffOn ℝ ∞ (fun z => Real.circleAverage (poissonKernel 0 z • f) 0 1) (ball 0 1) := by + have hfc : CircleIntegrable (fun z => (f z : ℂ)) 0 1 := by + simp only [CircleIntegrable,intervalIntegrable_iff] at hf ⊢ + exact Complex.ofRealCLM.integrable_comp hf + have hball : ball (0 : ℂ) 1 ⊆ (sphere (0 : ℂ) |(1 : ℝ)|)ᶜ := by + intro z hz + rw [Set.mem_compl_iff, abs_one, Metric.mem_sphere] + exact ne_of_lt (Metric.mem_ball.mp hz) + have ha := (analyticOnNhd_circleAverage_herglotzRieszKernel_smul hfc).mono hball + have hc : ContDiffOn ℝ ∞ (fun z => + (Real.circleAverage (fun ζ => herglotzRieszKernel 0 z ζ • (f ζ : ℂ)) 0 1).re) + (ball 0 1) := + Complex.reCLM.contDiff.comp_contDiffOn (ha.contDiffOn_of_completeSpace.restrict_scalars ℝ) + apply hc.congr + intro z hz + rw [re_circleAverage_herglotzRieszKernel_smul hf (hball hz)] + congr 1 + funext ζ + simp only [poissonKernel_eq_re_herglotzRieszKernel] + +lemma harmonicSeries_re_contDiffOn {a : ℤ → ℂ} (ha : Summable (fun m => ‖a m‖)) : + ContDiffOn ℝ ∞ (fun z => (harmonicSeries a z).re) (ball 0 1) := by + have hc := Complex.continuous_re.comp_continuousOn + ((harmonicSeries_continuousOn ha).mono sphere_subset_closedBall) + apply (poissonAverage_contDiffOn (hc.circleIntegrable (by norm_num : (0:ℝ) ≤ 1))).congr + intro z hz + exact (harmonicSeries_re_poisson ha hz).symm + +lemma planeSeries_contDiffOn {a : ℤ → ℂ} (ha : Summable (fun m => ‖a m‖)) : + ContDiffOn ℝ ∞ (planeSeries a) disk := by + apply (harmonicSeries_re_contDiffOn ha).comp complexIso.symm.contDiff.contDiffOn + intro x hx + simpa only [disk,mem_ball_zero_iff,LinearIsometryEquiv.norm_map] using hx + +end StrictHotSpots.Douglas +end DouglasInteriorCombinedLayer + +section PlaneWavesCombinedLayer +open Set MeasureTheory Filter +open scoped Topology InnerProductSpace ContDiff Laplacian +namespace StrictHotSpots.PlaneWaves + +def cosine (k : Plane) (x : Plane) : ℝ := Real.cos (inner ℝ k x) +def sine (k : Plane) (x : Plane) : ℝ := Real.sin (inner ℝ k x) + +lemma cosine_smooth (k : Plane) : ContDiff ℝ ∞ (cosine k) := + (innerSL ℝ k).contDiff.cos +lemma sine_smooth (k : Plane) : ContDiff ℝ ∞ (sine k) := + (innerSL ℝ k).contDiff.sin + +lemma fderiv_cosine (k x : Plane) : + fderiv ℝ (cosine k) x = (-sine k x) • innerSL ℝ k := by + exact ((innerSL ℝ k).hasFDerivAt.cos).fderiv +lemma fderiv_sine (k x : Plane) : + fderiv ℝ (sine k) x = cosine k x • innerSL ℝ k := by + exact ((innerSL ℝ k).hasFDerivAt.sin).fderiv + +lemma gradient_cosine (k x : Plane) : gradient (cosine k) x = (-sine k x) • k := by + apply ext_inner_right ℝ + intro v + rw [inner_gradient_left,real_inner_smul_left,fderiv_cosine] + rfl +lemma gradient_sine (k x : Plane) : gradient (sine k) x = cosine k x • k := by + apply ext_inner_right ℝ + intro v + rw [inner_gradient_left,real_inner_smul_left,fderiv_sine] + rfl + +lemma cosine_memLp {Ω : Set Plane} (hb : Bornology.IsBounded Ω) (k : Plane) : + MemLp (cosine k) 2 (volume.restrict Ω) := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + exact MemLp.of_bound (cosine_smooth k).continuous.aestronglyMeasurable 1 + (Eventually.of_forall fun x => Real.norm_eq_abs _ ▸ Real.abs_cos_le_one _) +lemma sine_memLp {Ω : Set Plane} (hb : Bornology.IsBounded Ω) (k : Plane) : + MemLp (sine k) 2 (volume.restrict Ω) := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + exact MemLp.of_bound (sine_smooth k).continuous.aestronglyMeasurable 1 + (Eventually.of_forall fun x => Real.norm_eq_abs _ ▸ Real.abs_sin_le_one _) + +lemma cosine_h1 {Ω : Set Plane} (hΩ : IsOpen Ω) (hb : Bornology.IsBounded Ω) (k : Plane) : + HasH1Gradient Ω (cosine k) (fun x => (-sine k x) • k) := by + have he : gradient (cosine k) = fun x => (-sine k x) • k := funext (gradient_cosine k) + rw [← he] + apply HasH1Gradient.of_contDiffOn hΩ (cosine_smooth k).contDiffOn (cosine_memLp hb k) + rw [he] + exact (ContinuousLinearMap.smulRight (ContinuousLinearMap.id ℝ ℝ) k).comp_memLp' (sine_memLp hb k).neg +lemma sine_h1 {Ω : Set Plane} (hΩ : IsOpen Ω) (hb : Bornology.IsBounded Ω) (k : Plane) : + HasH1Gradient Ω (sine k) (fun x => cosine k x • k) := by + have he : gradient (sine k) = fun x => cosine k x • k := funext (gradient_sine k) + rw [← he] + apply HasH1Gradient.of_contDiffOn hΩ (sine_smooth k).contDiffOn (sine_memLp hb k) + rw [he] + exact (ContinuousLinearMap.smulRight (ContinuousLinearMap.id ℝ ℝ) k).comp_memLp' (cosine_memLp hb k) + +lemma cosine_sine_sq (k x : Plane) : cosine k x ^ 2 + sine k x ^ 2 = 1 := + Real.cos_sq_add_sin_sq _ + +lemma laplacian_cosine (k x : Plane) : Δ (cosine k) x = -‖k‖^2 * cosine k x := by + let b := stdOrthonormalBasis ℝ Plane + rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_orthonormalBasis _ b] + have hd : ∀ i, iteratedFDeriv ℝ 2 (cosine k) x ![b i, b i] = + -(inner ℝ k (b i))^2 * cosine k x := by + intro i + simp only [iteratedFDeriv_two_apply, Matrix.cons_val_zero, Matrix.cons_val_one] + have hc : fderiv ℝ (cosine k) = fun y => (-sine k y) • innerSL ℝ k := + funext (fderiv_cosine k) + rw [hc, fderiv_smul_const (c := fun y : Plane => -(sine k y)) ((sine_smooth k).differentiable (by simp) x).neg (innerSL ℝ k : Plane →L[ℝ] ℝ), + fderiv_fun_neg, fderiv_sine] + simp + ring + change (∑ i, iteratedFDeriv ℝ 2 _ x ![b i, b i]) = _ + simp_rw [hd] + rw [← Finset.sum_mul] + have hs : ∑ i, (inner ℝ k (b i))^2 = ‖k‖^2 := by + simpa only [pow_two,real_inner_self_eq_norm_sq,real_inner_comm (b _) k] using (b.sum_inner_mul_inner k k) + rw [Finset.sum_neg_distrib,hs] + +lemma laplacian_sine (k x : Plane) : Δ (sine k) x = -‖k‖^2 * sine k x := by + let b := stdOrthonormalBasis ℝ Plane + rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_orthonormalBasis _ b] + have hd : ∀ i, iteratedFDeriv ℝ 2 (sine k) x ![b i, b i] = + -(inner ℝ k (b i))^2 * sine k x := by + intro i + simp only [iteratedFDeriv_two_apply, Matrix.cons_val_zero, Matrix.cons_val_one] + have hc : fderiv ℝ (sine k) = fun y => cosine k y • innerSL ℝ k := + funext (fderiv_sine k) + rw [hc, fderiv_smul_const ((cosine_smooth k).differentiable (by simp) x) (innerSL ℝ k : Plane →L[ℝ] ℝ), + fderiv_cosine] + simp + ring + change (∑ i, iteratedFDeriv ℝ 2 _ x ![b i, b i]) = _ + simp_rw [hd] + rw [← Finset.sum_mul] + have hs : ∑ i, (inner ℝ k (b i))^2 = ‖k‖^2 := by + simpa only [pow_two,real_inner_self_eq_norm_sq,real_inner_comm (b _) k] using (b.sum_inner_mul_inner k k) + rw [Finset.sum_neg_distrib,hs] + +end StrictHotSpots.PlaneWaves +end PlaneWavesCombinedLayer + +section LowerEulerCombinedLayer +open Set MeasureTheory Filter +open scoped Topology InnerProductSpace +namespace StrictHotSpots +lemma lower_rayleigh {Ω : Set Plane} {v : Plane → ℝ} {g : Plane → Plane} {lam : ℝ} + (hle : lam ≤ firstPositiveNeumannValue Ω) + (hv : HasH1Gradient Ω v g) (hm : (∫ x in Ω, v x) = 0) : + lam * (∫ x in Ω, (v x)^2) ≤ ∫ x in Ω, ‖g x‖^2 := + (mul_le_mul_of_nonneg_right hle (integral_nonneg fun x => sq_nonneg (v x))).trans + (rayleigh_inequality_all hv hm) + + +lemma lower_euler_mean_zero {Ω : Set Plane} {u v : Plane → ℝ} + {g k : Plane → Plane} {lam : ℝ} + (hle : lam ≤ firstPositiveNeumannValue Ω) (hb : Bornology.IsBounded Ω) + (hu : HasH1Gradient Ω u g) (hv : HasH1Gradient Ω v k) + (hmu : (∫ x in Ω, u x) = 0) (hmv : (∫ x in Ω, v x) = 0) + (he : (∫ x in Ω, ‖g x‖ ^ 2) = + lam * (∫ x in Ω, (u x) ^ 2)) : + (∫ x in Ω, inner ℝ (g x) (k x)) = + lam * (∫ x in Ω, u x * v x) := by + let : IsFiniteMeasure (volume.restrict Ω) := ⟨by simpa using hb.measure_lt_top⟩ + have hui : Integrable u (volume.restrict Ω) := hu.1.integrable (by norm_num) + have hvi : Integrable v (volume.restrict Ω) := hv.1.integrable (by norm_num) + have hvar (t : ℝ) := lower_rayleigh hle (hu.add (hv.smul t)) (by + show (∫ x in Ω, u x + t * v x) = 0 + rw [integral_add hui (hvi.const_mul t), integral_const_mul, hmu, hmv] + ring) + have hpoly : ∀ t : ℝ, 0 ≤ + ((∫ x in Ω, ‖k x‖ ^ 2) - lam * (∫ x in Ω, (v x) ^ 2)) * (t * t) + + (2 * ((∫ x in Ω, inner ℝ (g x) (k x)) - + lam * (∫ x in Ω, u x * v x))) * t + 0 := by + intro t + have ht := hvar t + simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul] at ht + rw [integral_norm_add_smul_sq hu.2.1 hv.2.1 t, + integral_sq_add_mul hu.1 hv.1 t, he] at ht + nlinarith + have hd := discrim_le_zero hpoly + simp only [discrim, mul_zero, sub_zero] at hd + nlinarith [sq_nonneg ((∫ x in Ω, inner ℝ (g x) (k x)) - + lam * (∫ x in Ω, u x * v x))] + + + +lemma lower_euler {Ω : Set Plane} {u v : Plane → ℝ} {g k : Plane → Plane} {lam : ℝ} + (hle : lam ≤ firstPositiveNeumannValue Ω) + (hb : Bornology.IsBounded Ω) (hvol : 0 < (volume Ω).toReal) + (hu : HasH1Gradient Ω u g) (hv : HasH1Gradient Ω v k) + (hmu : (∫ x in Ω, u x) = 0) + (he : (∫ x in Ω, ‖g x‖ ^ 2) = + lam * (∫ x in Ω, (u x) ^ 2)) : + (∫ x in Ω, inner ℝ (g x) (k x)) = + lam * (∫ x in Ω, u x * v x) := by + let : IsFiniteMeasure (volume.restrict Ω) := ⟨by simpa using hb.measure_lt_top⟩ + let c := (∫ x in Ω, v x) / (volume Ω).toReal + have hui : Integrable u (volume.restrict Ω) := hu.1.integrable (by norm_num) + have hvi : Integrable v (volume.restrict Ω) := hv.1.integrable (by norm_num) + have hw : HasH1Gradient Ω (fun x => v x - c) k := by + change HasH1Gradient Ω (v - fun _ => c) k + simpa only [sub_zero] using hv.sub (HasH1Gradient.const hb c) + have hm : (∫ x in Ω, v x - c) = 0 := by + rw [integral_sub hvi (integrable_const c)] + simp only [integral_const, measureReal_restrict_apply_univ, smul_eq_mul] + change (∫ x in Ω, v x) - (volume Ω).toReal * c = 0 + dsimp [c] + field_simp + ring + have hh := lower_euler_mean_zero hle hb hu hw hmu hm he + have hi : (∫ x in Ω, u x * (v x - c)) = (∫ x in Ω, u x * v x) := by + simp only [mul_sub] + have huv : Integrable (fun x => u x * v x) (volume.restrict Ω) := hu.1.integrable_mul hv.1 + rw [integral_sub huv (hui.mul_const c), + integral_mul_const, hmu, zero_mul, sub_zero] + rwa [hi] at hh + + +end StrictHotSpots +end LowerEulerCombinedLayer + +section L2InnerToLpCombinedLayer +open MeasureTheory Filter +open scoped ENNReal InnerProductSpace +namespace StrictHotSpots.L2Inner +lemma toLp_pair {α E : Type*} [MeasurableSpace α] {μ : Measure α} + [NormedAddCommGroup E] [InnerProductSpace ℝ E] + {f g : α → E} (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) : + inner ℝ (hf.toLp f) (hg.toLp g) = ∫ x, inner ℝ (f x) (g x) ∂μ := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hf.coeFn_toLp,hg.coeFn_toLp] with x hx hy + rw [hx,hy] +lemma toLp_left {α E : Type*} [MeasurableSpace α] {μ : Measure α} + [NormedAddCommGroup E] [InnerProductSpace ℝ E] + {f : α → E} (hf : MemLp f 2 μ) (g : Lp E 2 μ) : + inner ℝ (hf.toLp f) g = ∫ x, inner ℝ (f x) (g x) ∂μ := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hf.coeFn_toLp] with x hx + rw [hx] +lemma toLp_right {α E : Type*} [MeasurableSpace α] {μ : Measure α} + [NormedAddCommGroup E] [InnerProductSpace ℝ E] + {g : α → E} (f : Lp E 2 μ) (hg : MemLp g 2 μ) : + inner ℝ f (hg.toLp g) = ∫ x, inner ℝ (f x) (g x) ∂μ := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hg.coeFn_toLp] with x hx + rw [hx] +end StrictHotSpots.L2Inner +end L2InnerToLpCombinedLayer + +section H1RayleighFormCombinedLayer +open Set MeasureTheory Filter +open scoped InnerProductSpace Topology +namespace StrictHotSpots +private lemma two_inner_sub_left {A B : Type*} [NormedAddCommGroup A] [InnerProductSpace ℝ A] + [NormedAddCommGroup B] [InnerProductSpace ℝ B] (lam : ℝ) (a b c : A) (x y z : B) : + inner ℝ (a-b) c - lam * inner ℝ (x-y) z = + (inner ℝ a c - lam * inner ℝ x z) - (inner ℝ b c - lam * inner ℝ y z) := by + rw [inner_sub_left,inner_sub_left] + ring +private lemma two_inner_sub_right {A B : Type*} [NormedAddCommGroup A] [InnerProductSpace ℝ A] + [NormedAddCommGroup B] [InnerProductSpace ℝ B] (lam : ℝ) (a b c : A) (x y z : B) : + inner ℝ a (b-c) - lam * inner ℝ x (y-z) = + (inner ℝ a b - lam * inner ℝ x y) - (inner ℝ a c - lam * inner ℝ x z) := by + rw [inner_sub_right,inner_sub_right] + ring +end StrictHotSpots +namespace StrictHotSpots.H1 +variable {Ω : Set Plane} +local instance : NormedSpace ℝ (H1 Ω) := (h1Graph Ω).normedSpace +def form (lam : ℝ) (u v : H1 Ω) : ℝ := + inner ℝ (grad u) (grad v) - lam * inner ℝ (value u) (value v) + +lemma form_symm (lam : ℝ) (u v : H1 Ω) : form lam u v = form lam v u := by + exact congrArg₂ (fun a b : ℝ => a - lam * b) + (real_inner_comm (grad u) (grad v)).symm (real_inner_comm (value u) (value v)).symm +lemma form_sub_left (lam : ℝ) (u v w : H1 Ω) : + form lam (u-v) w = form lam u w - form lam v w := by + exact StrictHotSpots.two_inner_sub_left lam (grad u) (grad v) (grad w) (value u) (value v) (value w) +lemma form_sub_right (lam : ℝ) (u v w : H1 Ω) : + form lam u (v-w) = form lam u v - form lam u w := by + exact StrictHotSpots.two_inner_sub_right lam (grad u) (grad v) (grad w) (value u) (value v) (value w) +lemma form_smul_left (lam c : ℝ) (u v : H1 Ω) : + form lam (c • u) v = c * form lam u v := by + unfold form + change inner ℝ (c • grad u) (grad v) - lam * inner ℝ (c • value u) (value v) = _ + rw [real_inner_smul_left,real_inner_smul_left] + ring +lemma form_smul_right (lam c : ℝ) (u v : H1 Ω) : + form lam u (c • v) = c * form lam u v := by + unfold form + change inner ℝ (grad u) (c • grad v) - lam * inner ℝ (value u) (c • value v) = _ + rw [real_inner_smul_right,real_inner_smul_right] + ring +lemma form_diag_sub (lam c : ℝ) (u v : H1 Ω) + (hv : form lam v v = 0) (huv : form lam u v = 0) : + form lam (u-c•v) (u-c•v) = form lam u u := by + rw [form_sub_left,form_sub_right,form_sub_right,form_smul_right, + form_smul_left,form_smul_left,form_smul_right,hv,huv,← form_symm lam u v,huv] + ring + +variable (hb : Bornology.IsBounded Ω) +def mean : H1 Ω →L[ℝ] ℝ := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + exact (innerSL ℝ ((memLp_const (1 : ℝ)).toLp (fun _ : Plane => (1 : ℝ)))).comp value + +lemma mean_eq (u : H1 Ω) : mean hb u = ∫ x in Ω, value u x := by + let : IsFiniteMeasure (volume.restrict Ω) := isFiniteMeasure_restrict.mpr hb.measure_lt_top.ne + change inner ℝ ((memLp_const (1 : ℝ)).toLp _) (value u) = _ + rw [L2Inner.toLp_left] + simp only [RCLike.inner_apply,RCLike.conj_to_real,mul_one] + +lemma form_self_integral (lam : ℝ) (u : H1 Ω) : + form lam u u = (∫ x in Ω, ‖grad u x‖^2) - lam * (∫ x in Ω, (value u x)^2) := by + simp only [form,L2.inner_def,real_inner_self_eq_norm_sq,Real.norm_eq_abs,sq_abs] + +lemma form_nonneg {lam : ℝ} (hle : lam ≤ firstPositiveNeumannValue Ω) + (u : H1 Ω) (hm : mean hb u = 0) : 0 ≤ form lam u u := by + rw [form_self_integral] + exact sub_nonneg.mpr (lower_rayleigh hle (hasH1Gradient u) ((mean_eq hb u).symm.trans hm)) + +lemma form_zero_euler {lam : ℝ} (hle : lam ≤ firstPositiveNeumannValue Ω) + (hvol : 0 < (volume Ω).toReal) (u : H1 Ω) (hm : mean hb u = 0) + (hz : form lam u u = 0) (v : H1 Ω) : form lam u v = 0 := by + rw [form_self_integral,sub_eq_zero] at hz + have he := lower_euler hle hb hvol (hasH1Gradient u) (hasH1Gradient v) + ((mean_eq hb u).symm.trans hm) hz + rw [form,L2.inner_def,L2.inner_def] + simp only [RCLike.inner_apply,RCLike.conj_to_real] + rw [show (fun x => value v x * value u x) = (fun x => value u x * value v x) by funext; ring,he,sub_self] + +end StrictHotSpots.H1 +end H1RayleighFormCombinedLayer + +section CompactRowsCombinedLayer + +open MeasureTheory Set Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.CompactRows +variable {α H : Type*} [MeasurableSpace α] {μ : Measure α} + [NormedAddCommGroup H] [InnerProductSpace ℝ H] + +def rowOperator : Lp H 2 μ →L[ℝ] H →L[ℝ] Lp ℝ 2 μ := + (ContinuousLinearMap.compLpL₂ 2 μ (innerSL ℝ)).flip + +lemma rowOperator_apply_ae (r : Lp H 2 μ) (v : H) : + rowOperator r v =ᵐ[μ] fun x => inner ℝ v (r x) := + (innerSL ℝ v).coeFn_compLp r + +lemma rowOperator_compact_simple (r : Lp.simpleFunc H 2 μ) : + IsCompactOperator (rowOperator (r : Lp H 2 μ)) := by + let V : Submodule ℝ H := Submodule.span ℝ (Set.range (Lp.simpleFunc.toSimpleFunc r)) + have : FiniteDimensional ℝ V := FiniteDimensional.span_of_finite ℝ (Lp.simpleFunc.toSimpleFunc r).finite_range + have he : rowOperator (r : Lp H 2 μ) = + ((rowOperator (r : Lp H 2 μ)).comp V.subtypeL).comp V.orthogonalProjectionOnto := by + apply ContinuousLinearMap.ext + intro v + apply Lp.ext + filter_upwards [rowOperator_apply_ae (r : Lp H 2 μ) v, + rowOperator_apply_ae (r : Lp H 2 μ) (V.orthogonalProjectionOnto v), + Lp.simpleFunc.toSimpleFunc_eq_toFun r] with x hx hy hr + change rowOperator (r : Lp H 2 μ) v x = + rowOperator (r : Lp H 2 μ) (V.orthogonalProjectionOnto v) x + rw [hx, hy, ← hr] + have hmem : (Lp.simpleFunc.toSimpleFunc r) x ∈ V := Submodule.subset_span ⟨x, rfl⟩ + exact (V.inner_orthogonalProjectionOnto_eq_of_mem_right ⟨_,hmem⟩ v).symm + rw [he] + exact (isCompactOperator_of_locallyCompactSpace_dom V.orthogonalProjectionOnto).clm_comp + ((rowOperator (r : Lp H 2 μ)).comp V.subtypeL) + + + +theorem rowOperator_compact (r : Lp H 2 μ) : IsCompactOperator (rowOperator r) := by + have hc : IsClosed {f : Lp H 2 μ | IsCompactOperator (rowOperator f)} := + isClosed_setOfPred_isCompactOperator.preimage + (rowOperator (μ := μ) (H := H)).continuous + apply closure_minimal (fun f hf => rowOperator_compact_simple ⟨f,hf⟩) hc + exact Lp.simpleFunc.dense (by norm_num) r + +end StrictHotSpots.CompactRows +end CompactRowsCombinedLayer + +section MeasurableRowsCombinedLayer + +open MeasureTheory Set Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.CompactRows + +lemma measurable_of_dist {α E : Type*} [MeasurableSpace α] [MetricSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + {f : α → E} (h : ∀ y, Measurable (fun x => dist (f x) y)) : Measurable f := by + let B : Set (Set E) := {s | ∃ y r, s = Metric.ball y r} + have hb : TopologicalSpace.IsTopologicalBasis B := + TopologicalSpace.isTopologicalBasis_of_isOpen_of_nhds + (by rintro s ⟨y,r,rfl⟩; exact Metric.isOpen_ball) + (by intro x s hx hs + obtain ⟨r,hr,hrs⟩ := Metric.isOpen_iff.mp hs x hx + exact ⟨Metric.ball x r, ⟨x,r,rfl⟩, Metric.mem_ball_self hr, hrs⟩) + rw [BorelSpace.measurable_eq (α := E), hb.borel_eq_generateFrom] + apply measurable_generateFrom + rintro s ⟨y,r,rfl⟩ + exact measurableSet_lt (h y) measurable_const + +variable {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {ν : Measure Y} [SFinite ν] [IsSeparable ν] + +local instance : Fact ((2 : ℝ≥0∞) ≠ ∞) := ⟨by norm_num⟩ + +local instance : MeasurableSpace (Lp ℝ 2 ν) := borel _ +local instance : BorelSpace (Lp ℝ 2 ν) := ⟨rfl⟩ + +lemma measurable_toLp_rows (K : X × Y → ℝ) (hK : Measurable K) + (hrow : ∀ x, MemLp (fun y => K (x,y)) 2 ν) : + Measurable (fun x => (hrow x).toLp (fun y => K (x,y))) := by + apply measurable_of_dist + intro f + let R := fun x => (hrow x).toLp (fun y => K (x,y)) + have he (x : X) : dist (R x) f = Real.sqrt (∫ y, (K (x,y) - f y)^2 ∂ν) := by + rw [dist_eq_norm] + have hs : ∫ y, (K (x,y) - f y)^2 ∂ν = ‖R x - f‖^2 := by + rw [← real_inner_self_eq_norm_sq, L2.inner_def] + apply integral_congr_ae + filter_upwards [Lp.coeFn_sub (R x) f, (hrow x).coeFn_toLp] with y hy hz + simp only [Pi.sub_apply] at hy + rw [real_inner_self_eq_norm_sq, hy, hz, Real.norm_eq_abs, sq_abs] + rw [hs, Real.sqrt_sq (norm_nonneg _)] + have hm : Measurable (fun p : X × Y => (K p - f p.2)^2) := + (hK.sub ((Lp.stronglyMeasurable f).measurable.comp measurable_snd)).pow_const 2 + simpa only [← he] using ((hm.stronglyMeasurable.integral_prod_right' (ν := ν)).measurable).sqrt + +end StrictHotSpots.CompactRows +end MeasurableRowsCombinedLayer + +section CompactCoerciveCombinedLayer +open Set +open scoped InnerProductSpace Topology +namespace StrictHotSpots.CompactCoercive +variable {E H V : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup H] [InnerProductSpace ℝ H] + [NormedAddCommGroup V] [InnerProductSpace ℝ V] + +lemma finite_projection_approx (T : E →L[ℝ] H) (hT : IsCompactOperator T) + {ε : ℝ} (hε : 0 < ε) : + ∃ U : Submodule ℝ H, ∃ _ : FiniteDimensional ℝ U, + ‖T - U.starProjection.comp T‖ ≤ ε := by + obtain ⟨s,hs,hcover⟩ := Metric.totallyBounded_iff.mp + (hT.isCompact_closure_image_closedBall 1).totallyBounded ε hε + let U := Submodule.span ℝ s + let : FiniteDimensional ℝ U := FiniteDimensional.span_of_finite ℝ hs + refine ⟨U,inferInstance,ContinuousLinearMap.opNorm_le_of_unit_norm hε.le ?_⟩ + intro x hx + have hmem : T x ∈ closure (T '' Metric.closedBall 0 1) := + subset_closure ⟨x,by simpa using hx.le,rfl⟩ + obtain ⟨y,hy,hxy⟩ := mem_iUnion₂.mp (hcover hmem) + change ‖T x - U.starProjection (T x)‖ ≤ ε + have hmin := U.starProjection_minimal (T x) + rw [hmin] + exact (ciInf_le (by exact ⟨0, by rintro _ ⟨z,rfl⟩; exact norm_nonneg _⟩) + (⟨y,Submodule.subset_span hy⟩ : U)).trans (by exact (show ‖T x - y‖ < ε by simpa [Metric.mem_ball, dist_eq_norm] using hxy).le) + + + +lemma observation_compact [CompleteSpace H] (B : V →L[ℝ] V →L[ℝ] ℝ) (hB : IsCoercive B) + (J : V →L[ℝ] H) (S : H →L[ℝ] V) + (hS : ∀ f v, B (S f) v = inner ℝ f (J v)) + (hc : IsCompactOperator (J.comp S)) : IsCompactOperator J := by + obtain ⟨C,hC,hcoer⟩ := hB + have hcl : J ∈ closure {A : V →L[ℝ] H | IsCompactOperator A} := by + rw [Metric.mem_closure_iff] + intro δ hδ + let q : ℝ := δ / (2 * (‖B‖ + 1)) + have hq : 0 < q := div_pos hδ (mul_pos (by norm_num) (by positivity)) + obtain ⟨U,hU,happrox⟩ := finite_projection_approx (J.comp S) hc + (mul_pos hC (sq_pos_of_pos hq)) + let : FiniteDimensional ℝ U := hU + let A : V →L[ℝ] H := U.starProjection.comp J + have hAc : IsCompactOperator A := + ((isCompactOperator_of_locallyCompactSpace_rng U.subtypeL).comp_clm + U.orthogonalProjectionOnto).comp_clm J + refine ⟨A,hAc,?_⟩ + have ha : ‖J - A‖ ≤ ‖B‖ * q := by + apply ContinuousLinearMap.opNorm_le_bound (J - A) (mul_nonneg (norm_nonneg B) hq.le) + intro v + let w := J v - U.starProjection (J v) + have hwproj : inner ℝ w (U.starProjection (J v)) = 0 := + U.starProjection_inner_eq_zero (J v) _ (U.orthogonalProjectionOnto (J v)).property + have hwJ : inner ℝ w (J v) = ‖w‖^2 := by + calc + _ = inner ℝ w (w + U.starProjection (J v)) := by + congr 1; dsimp [w]; abel + _ = _ := by rw [inner_add_right, hwproj, add_zero, real_inner_self_eq_norm_sq] + have hwTproj : inner ℝ w (U.starProjection ((J.comp S) w)) = 0 := + U.starProjection_inner_eq_zero (J v) _ (U.orthogonalProjectionOnto ((J.comp S) w)).property + have ht : inner ℝ w ((J.comp S) w) ≤ C * q^2 * ‖w‖^2 := by + calc + _ = inner ℝ w (((J.comp S) - U.starProjection.comp (J.comp S)) w) := by + change inner ℝ w (J (S w)) = inner ℝ w (J (S w) - U.starProjection (J (S w))) + have hz : inner ℝ w (U.starProjection (J (S w))) = 0 := hwTproj + rw [inner_sub_right, hz, sub_zero] + _ ≤ ‖w‖ * ‖((J.comp S) - U.starProjection.comp (J.comp S)) w‖ := + real_inner_le_norm _ _ + _ ≤ ‖w‖ * ((C * q^2) * ‖w‖) := by + gcongr + exact (((J.comp S) - U.starProjection.comp (J.comp S)).le_opNorm w).trans + (mul_le_mul_of_nonneg_right happrox (norm_nonneg _)) + _ = _ := by ring + have hs : ‖S w‖ ≤ q * ‖w‖ := by + have h0 := (hcoer (S w)).trans (by simpa only [hS, ContinuousLinearMap.comp_apply] using ht) + have h1 : ‖S w‖^2 ≤ (q * ‖w‖)^2 := by nlinarith + nlinarith [norm_nonneg (S w), mul_nonneg hq.le (norm_nonneg w)] + have hv : ‖w‖^2 ≤ ‖B‖ * ‖S w‖ * ‖v‖ := by + calc + _ = B (S w) v := (hS w v).trans hwJ |>.symm + _ ≤ ‖B (S w) v‖ := le_abs_self _ + _ ≤ ‖B (S w)‖ * ‖v‖ := (B (S w)).le_opNorm v + _ ≤ _ := mul_le_mul_of_nonneg_right (B.le_opNorm (S w)) (norm_nonneg _) + have hv' : ‖w‖^2 ≤ (‖B‖ * q * ‖v‖) * ‖w‖ := by + calc + _ ≤ ‖B‖ * ‖S w‖ * ‖v‖ := hv + _ ≤ ‖B‖ * (q * ‖w‖) * ‖v‖ := by gcongr + _ = _ := by ring + change ‖w‖ ≤ ‖B‖ * q * ‖v‖ + by_cases hw0 : ‖w‖ = 0 + · rw [hw0]; positivity + · have hwpos : 0 < ‖w‖ := lt_of_le_of_ne (norm_nonneg _) (Ne.symm hw0) + rw [pow_two] at hv' + exact (mul_le_mul_iff_left₀ hwpos).mp (by simpa only [mul_comm] using hv') + rw [dist_eq_norm] + have he : ‖B‖ * q < δ := by + dsimp [q] + have hd : 0 < 2 * (‖B‖ + 1) := by positivity + rw [← mul_div_assoc, div_lt_iff₀ hd] + nlinarith [norm_nonneg B] + simpa only [norm_sub_rev] using ha.trans_lt he + exact isClosed_setOfPred_isCompactOperator.closure_subset hcl + +end StrictHotSpots.CompactCoercive +end CompactCoerciveCombinedLayer + +section DiskCompactEmbeddingCombinedLayer +open MeasureTheory Set Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +open DiskH10 +local instance : Fact ((2 : ℝ≥0∞) ≠ ∞) := ⟨by norm_num⟩ + +private def boundedKernel (p : Plane × Plane) : ℝ := by + classical + exact if p.1 ∈ disk then kernel p.1 p.2 else 0 + +private lemma boundedKernel_measurable : Measurable boundedKernel := + Measurable.ite (diskOpen.measurableSet.preimage measurable_fst) measurable_kernel measurable_const + +private lemma boundedKernel_memLp (x : Plane) : + MemLp (fun y => boundedKernel (x,y)) 2 (volume.restrict disk) := by + by_cases hx : x ∈ disk + · simpa only [boundedKernel, ite_eq_left hx] using kernel_memLp x hx + · simp only [boundedKernel, ite_eq_right hx] + exact MemLp.zero + +private def compactRow (x : Plane) : Lp ℝ 2 (volume.restrict disk) := + (boundedKernel_memLp x).toLp (fun y => boundedKernel (x,y)) + +private lemma compactRow_memLp : MemLp compactRow 2 (volume.restrict disk) := by + let : MeasurableSpace (Lp ℝ 2 (volume.restrict disk)) := borel _ + let : BorelSpace (Lp ℝ 2 (volume.restrict disk)) := ⟨rfl⟩ + have hm : Measurable compactRow := CompactRows.measurable_toLp_rows boundedKernel + boundedKernel_measurable boundedKernel_memLp + apply MemLp.of_bound hm.aestronglyMeasurable kernel_bound.choose + filter_upwards [ae_restrict_mem diskOpen.measurableSet] with x hx + rw [compactRow, Lp.norm_toLp] + simpa only [boundedKernel, ite_eq_left hx] using kernel_bound.choose_spec.2 x hx + + + +lemma integralOperator_compact : IsCompactOperator integralOperator := by + let r := compactRow_memLp.toLp compactRow + have he : integralOperator = CompactRows.rowOperator r := by + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + filter_upwards [integralOperator_ae f, CompactRows.rowOperator_apply_ae r f, + compactRow_memLp.coeFn_toLp, ae_restrict_mem diskOpen.measurableSet] with x hx hy hr hxd + rw [hx,hy,hr,L2.inner_def] + apply integral_congr_ae + filter_upwards [(boundedKernel_memLp x).coeFn_toLp] with y hxy + change kernel x y * f y = inner ℝ (f y) (compactRow x y) + rw [RCLike.inner_apply] + change kernel x y * f y = compactRow x y * f y + congr 1 + have ht : compactRow x y = kernel x y := by + simpa only [compactRow, boundedKernel, ite_eq_left hxd] using hxy + exact ht.symm + rw [he] + exact CompactRows.rowOperator_compact r + + + +lemma value_compact : IsCompactOperator (H10.value diskOpen) := by + let B := H10.energy diskOpen + let hB := H10.energy_coercive diskOpen diskBounded + let J := H10.value diskOpen + let S := DirichletOperator.solution B hB J + apply CompactCoercive.observation_compact B hB J S + · exact DirichletOperator.solution_spec B hB J + · change IsCompactOperator variationalOperator + rw [← integralOperator_eq_variationalOperator] + exact integralOperator_compact + +end StrictHotSpots.PlaneGreen +end DiskCompactEmbeddingCombinedLayer + +section H10InclusionCombinedLayer +open Set MeasureTheory Filter +open scoped ENNReal Topology InnerProductSpace +namespace StrictHotSpots + +def smoothTestToH10 {Ω : Set Plane} (hΩ : IsOpen Ω) : smoothTestSpace Ω →ₗ[ℝ] H10 hΩ := + (smoothTestToH1 hΩ).codRestrict (h10Submodule hΩ) + (fun f => Submodule.le_topologicalClosure _ (LinearMap.mem_range_self _ f)) + +lemma dense_smoothTestToH10 {Ω : Set Plane} (hΩ : IsOpen Ω) : + DenseRange (smoothTestToH10 hΩ) := by + intro u + rw [Metric.mem_closure_iff] + intro ε hε + have hu : (u : H1 Ω) ∈ closure (Set.range (smoothTestToH1 hΩ)) := u.property + obtain ⟨v,⟨f,rfl⟩,hv⟩ := Metric.mem_closure_iff.mp hu ε hε + exact ⟨smoothTestToH10 hΩ f, ⟨f,rfl⟩, hv⟩ + +namespace H10 +variable {Ω Λ : Set Plane} (hΩ : IsOpen Ω) (hΛ : IsOpen Λ) (hsub : Ω ⊆ Λ) + +def includeTest : smoothTestSpace Ω →ₗ[ℝ] smoothTestSpace Λ where + toFun f := ⟨f.val,f.property.1,f.property.2.1,f.property.2.2.trans hsub⟩ + map_add' _ _ := rfl + map_smul' _ _ := rfl + +lemma includeTest_norm (f : smoothTestSpace Ω) : + ‖smoothTestToH10 hΛ (includeTest hsub f)‖ = ‖smoothTestToH10 hΩ f‖ := by + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + change ‖(smoothTestToH1 hΛ (includeTest hsub f))‖^2 = ‖smoothTestToH1 hΩ f‖^2 + rw [H1.norm_sq, H1.norm_sq] + rw [smoothTestToH1_value_norm, smoothTestToH1_grad_norm, + smoothTestToH1_value_norm, smoothTestToH1_grad_norm] + have hf : Function.support (f : Plane → ℝ) ⊆ Ω := (subset_tsupport _).trans f.property.2.2 + have hg : Function.support (gradient (f : Plane → ℝ)) ⊆ Ω := by + intro x hx + apply f.property.2.2 + by_contra hn + apply hx + rw [gradient, fderiv_of_notMem_tsupport ℝ hn, map_zero] + dsimp [includeTest] + have hfm := f.property.1.continuous.aestronglyMeasurable (μ := volume) + have hgm : AEStronglyMeasurable (gradient (f : Plane → ℝ)) volume := + ((InnerProductSpace.toDual ℝ Plane).symm.continuous.comp + (f.property.1.continuous_fderiv (by simp))).aestronglyMeasurable + rw [eLpNorm_restrict_eq_of_support_subset hfm (hf.trans hsub), + eLpNorm_restrict_eq_of_support_subset hgm (hg.trans hsub), + eLpNorm_restrict_eq_of_support_subset hfm hf, eLpNorm_restrict_eq_of_support_subset hgm hg] + +def inclusion : H10 hΩ →L[ℝ] H10 hΛ := + ((smoothTestToH10 hΛ).comp (includeTest hsub)).extendOfNorm (smoothTestToH10 hΩ) + +lemma inclusion_test (f : smoothTestSpace Ω) : + inclusion hΩ hΛ hsub (smoothTestToH10 hΩ f) = + smoothTestToH10 hΛ (includeTest hsub f) := + LinearMap.extendOfNorm_eq (dense_smoothTestToH10 hΩ) + ⟨1,fun f => by + rw [one_mul] + change ‖smoothTestToH10 hΛ (includeTest hsub f)‖ ≤ ‖smoothTestToH10 hΩ f‖ + exact le_of_eq (includeTest_norm hΩ hΛ hsub f)⟩ f + +def restriction : Lp ℝ 2 (volume.restrict Λ) →L[ℝ] Lp ℝ 2 (volume.restrict Ω) := + Lp.LpToLpOfMeasureLeSMul (by norm_num : (1 : ℝ≥0∞) ≠ ∞) + (by simpa using Measure.restrict_mono hsub (le_refl (volume : Measure Plane))) + +lemma value_inclusion : value hΩ = + (restriction hsub).comp ((value hΛ).comp (inclusion hΩ hΛ hsub)) := by + apply DFunLike.coe_injective + apply (dense_smoothTestToH10 hΩ).equalizer (value hΩ).continuous + ((restriction hsub).comp ((value hΛ).comp (inclusion hΩ hΛ hsub))).continuous + funext f + simp only [Function.comp_apply, ContinuousLinearMap.comp_apply, inclusion_test] + apply Lp.ext + have hs := Lp.coeFn_LpToLpOfMeasureLeSMul (by norm_num : (1 : ℝ≥0∞) ≠ ∞) + (show volume.restrict Ω ≤ (1 : ℝ≥0∞) • volume.restrict Λ by + simpa using Measure.restrict_mono hsub (le_refl (volume : Measure Plane))) + (value hΛ (smoothTestToH10 hΛ (includeTest hsub f))) + have hf := (test_memLp (Ω := Ω) f.property.1 f.property.2.1).coeFn_toLp + have hg := ((Measure.absolutelyContinuous_of_le (Measure.restrict_mono hsub le_rfl)).ae_eq + (test_memLp (Ω := Λ) f.property.1 f.property.2.1).coeFn_toLp) + exact hf.trans (hg.symm.trans hs.symm) + +include hsub in +lemma value_compact_of_subset (hc : IsCompactOperator (value hΛ)) : + IsCompactOperator (value hΩ) := by + rw [value_inclusion hΩ hΛ hsub] + exact (hc.comp_clm (inclusion hΩ hΛ hsub)).clm_comp (restriction hsub) + +end H10 +end StrictHotSpots +end H10InclusionCombinedLayer + +section H10HelmholtzCombinedLayer +open Set MeasureTheory Filter +open scoped ENNReal Topology InnerProductSpace Laplacian ContDiff +namespace StrictHotSpots.H10 +variable {Ω : Set Plane} (hΩ : IsOpen Ω) +local instance : NormedSpace ℝ (H10 hΩ) := (H10.innerProductSpace hΩ).toNormedSpace + + + +lemma helmholtz_pair {f : Plane → ℝ} {lam : ℝ} + (hf : ContDiffOn ℝ ∞ f Ω) + (hv : MemLp f 2 (volume.restrict Ω)) + (hg : MemLp (gradient f) 2 (volume.restrict Ω)) + (hp : ∀ x ∈ Ω, Δ f x = -lam * f x) (u : H10 hΩ) : + inner ℝ (hg.toLp _) (grad hΩ u) = lam * inner ℝ (hv.toLp _) (value hΩ u) := by + let A : H10 hΩ →L[ℝ] ℝ := (innerSL ℝ (hg.toLp _)).comp (grad hΩ) + let B : H10 hΩ →L[ℝ] ℝ := lam • (innerSL ℝ (hv.toLp _)).comp (value hΩ) + change A u = B u + apply isClosed_property (dense_smoothTestToH10 hΩ) (isClosed_eq A.continuous B.continuous) _ u + intro t + change inner ℝ (hg.toLp _) ((test_gradient_memLp t.property.1 t.property.2.1).toLp _) = + lam * inner ℝ (hv.toLp _) ((test_memLp t.property.1 t.property.2.1).toLp _) + rw [L2Inner.toLp_pair, L2Inner.toLp_pair] + rw [integral_inner_gradient_test hΩ hf t.property.1 t.property.2.1 t.property.2.2] + have he : (∫ x in Ω, Δ f x * (t : Plane → ℝ) x) = + -lam * ∫ x in Ω, f x * (t : Plane → ℝ) x := by + rw [← integral_const_mul] + apply integral_congr_ae + filter_upwards [ae_restrict_mem hΩ.measurableSet] with x hx + rw [hp x hx] + ring + rw [he] + simp only [RCLike.inner_apply, RCLike.conj_to_real] + rw [show (fun x => (t : Plane → ℝ) x * f x) = (fun x => f x * (t : Plane → ℝ) x) by funext; ring] + ring + +end StrictHotSpots.H10 +end H10HelmholtzCombinedLayer + + +end + +end DouglasLipschitzBase + +end OAI diff --git a/lean/OAI/Analysis/HotSpots/VectorEnergy.lean b/lean/OAI/Analysis/HotSpots/VectorEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..08b51929c4cb8dbcec802f3aa52784245e9143d9 --- /dev/null +++ b/lean/OAI/Analysis/HotSpots/VectorEnergy.lean @@ -0,0 +1,1346 @@ +import OAI.Analysis.HotSpots.Hodge +import OAI.Analysis.HotSpots.Pullback + +namespace OAI + +section ActualVectorSupport +noncomputable section +section H1SmoothMultiplierActualCompatibleLayer +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal +namespace StrictHotSpots + + + +lemma HasH1Gradient.mul_smooth {Ω : Set Plane} {u : Plane → ℝ} {g : Plane → Plane} + (hu : HasH1Gradient Ω u g) {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) + (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) : + HasH1Gradient Ω (fun x => b x*u x) (fun x => b x • g x+u x • gradient b x) := by + have hval : MemLp (fun x => b x*u x) 2 (volume.restrict Ω) := hb0.fun_mul hu.1 + have hbg : MemLp (fun x => b x • g x) 2 (volume.restrict Ω) := hb0.smul hu.2.1 + have hug : MemLp (fun x => u x • gradient b x) 2 (volume.restrict Ω) := hu.1.smul hb1 + refine ⟨hval,hbg.add hug,?_⟩ + intro φ hφ hk hs e + have hp : HasCompactSupport (fun x => b x*φ x) := hk.mul_left + have hps : tsupport (fun x => b x*φ x) ⊆ Ω := tsupport_mul_subset_right.trans hs + have h := hu.2.2 (fun x => b x*φ x) (hb.mul hφ) hp hps e + have hdb (x : Plane) : fderiv ℝ (fun x => b x*φ x) x e = + (fderiv ℝ b x e)*φ x+b x*(fderiv ℝ φ x e) := by + rw [fderiv_fun_mul (hb.differentiable (by simp) x) (hφ.differentiable (by simp) x)] + simp only [add_apply,smul_apply,smul_eq_mul] + ring + have hφ2 := test_memLp (Ω := Ω) hφ hk + have hdφ2 := test_derivative_memLp (Ω := Ω) hφ hk e + have hd : MemLp (fun x => fderiv ℝ b x e) ∞ (volume.restrict Ω) := by + simpa only [inner_gradient_left] using hb1.inner_const (𝕜 := ℝ) e + have hud : MemLp (fun x => (fderiv ℝ b x e)*u x) 2 (volume.restrict Ω) := hd.fun_mul hu.1 + have hui : Integrable (fun x => u x*(fderiv ℝ b x e)*φ x) (volume.restrict Ω) := + (hud.integrable_mul hφ2).congr (Eventually.of_forall fun x => by simp only [Pi.mul_apply]; ring) + have hvi : Integrable (fun x => b x*u x*(fderiv ℝ φ x e)) (volume.restrict Ω) := + hval.integrable_mul hdφ2 + have hgi : Integrable (fun x => inner ℝ (b x • g x) e*φ x) (volume.restrict Ω) := + (hbg.inner_const (𝕜 := ℝ) e).integrable_mul hφ2 + simp_rw [hdb,mul_add] at h + have hl : (∫ x in Ω, u x*((fderiv ℝ b x e)*φ x)+u x*(b x*(fderiv ℝ φ x e))) = + (∫ x in Ω, u x*(fderiv ℝ b x e)*φ x)+ + (∫ x in Ω, b x*u x*(fderiv ℝ φ x e)) := by + convert integral_add hui hvi using 1 + congr 1 + funext x + ring + rw [hl] at h + have hr : (∫ x in Ω, inner ℝ (g x) e*(b x*φ x)) = + ∫ x in Ω, inner ℝ (b x • g x) e*φ x := by + apply integral_congr_ae + filter_upwards [] with x + rw [real_inner_smul_left] + ring + rw [hr] at h + have hg : (∫ x in Ω, inner ℝ (b x • g x+u x • gradient b x) e*φ x) = + (∫ x in Ω,inner ℝ (b x • g x) e*φ x)+ + (∫ x in Ω,u x*(fderiv ℝ b x e)*φ x) := by + simp_rw [inner_add_left,real_inner_smul_left,inner_gradient_left,add_mul] + simpa only [real_inner_smul_left] using integral_add hgi hui + rw [hg] + linarith + +namespace H1 +variable {Ω : Set Plane} {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) + (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) + +def smoothMul (u : H1 Ω) : H1 Ω := + ((H1.hasH1Gradient u).mul_smooth hb hb0 hb1).toH1 + +lemma smoothMul_value_ae (u : H1 Ω) : H1.value (smoothMul hb hb0 hb1 u) =ᵐ[volume.restrict Ω] + fun x => b x*H1.value u x := + ((H1.hasH1Gradient u).mul_smooth hb hb0 hb1).1.coeFn_toLp + +lemma smoothMul_grad_ae (u : H1 Ω) : H1.grad (smoothMul hb hb0 hb1 u) =ᵐ[volume.restrict Ω] + fun x => b x • H1.grad u x+H1.value u x • gradient b x := + ((H1.hasH1Gradient u).mul_smooth hb hb0 hb1).2.1.coeFn_toLp +end H1 +end StrictHotSpots +end H1SmoothMultiplierActualCompatibleLayer + +section NullBoundaryFormActualCompatibleLayer +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal +namespace StrictHotSpots.Hodge +variable {Ω : Set Plane} + +lemma rotL_skew (u v : V2 Ω) : inner ℝ (rotL Ω u) v = -inner ℝ u (rotL Ω v) := by + rw [L2.inner_def,L2.inner_def,← integral_neg] + apply integral_congr_ae + filter_upwards [rotL_ae u,rotL_ae v] with x hx hy + rw [hx,hy,rot_skew] + + +def skewEnergy (u v : H1 Ω) : ℝ := inner ℝ (H1.grad u) (rotL Ω (H1.grad v)) + +lemma skewEnergy_skew (u v : H1 Ω) : skewEnergy u v = -skewEnergy v u := by + exact (real_inner_comm _ _).trans (rotL_skew _ _) + +lemma skewEnergy_zero_right (ho : IsOpen Ω) (u : H1 Ω) (v : H10 ho) : + skewEnergy u v.val = 0 := grad_rotGrad_orthogonal ho u v + +lemma skewEnergy_zero_left (ho : IsOpen Ω) (u : H10 ho) (v : H1 Ω) : + skewEnergy u.val v = 0 := (skewEnergy_skew _ _).trans (by rw [skewEnergy_zero_right ho,neg_zero]) + +lemma skewEnergy_add_left (u v w : H1 Ω) : skewEnergy (u+v) w = skewEnergy u w+skewEnergy v w := by + unfold skewEnergy + rw [map_add,inner_add_left] +lemma skewEnergy_add_right (u v w : H1 Ω) : skewEnergy u (v+w) = skewEnergy u v+skewEnergy u w := by + unfold skewEnergy + rw [map_add,map_add,inner_add_right] + + + + +def boundaryDefect (X Y : Fin 2 → H1 Ω) : ℝ := + -skewEnergy (X 0) (Y 1)+skewEnergy (X 1) (Y 0) + +lemma boundaryDefect_symm (X Y : Fin 2 → H1 Ω) : boundaryDefect X Y = boundaryDefect Y X := by + unfold boundaryDefect + rw [skewEnergy_skew (X 0),skewEnergy_skew (X 1)] + ring + +lemma boundaryDefect_zero_right (ho : IsOpen Ω) (X : Fin 2 → H1 Ω) (Y : Fin 2 → H10 ho) : + boundaryDefect X (fun i => (Y i).val) = 0 := by + unfold boundaryDefect + rw [skewEnergy_zero_right ho,skewEnergy_zero_right ho] + ring + +lemma boundaryDefect_add_right (X Y Z : Fin 2 → H1 Ω) : + boundaryDefect X (Y+Z) = boundaryDefect X Y+boundaryDefect X Z := by + unfold boundaryDefect + simp only [Pi.add_apply,skewEnergy_add_right] + ring + +lemma boundaryDefect_add_left (X Y Z : Fin 2 → H1 Ω) : + boundaryDefect (X+Y) Z = boundaryDefect X Z+boundaryDefect Y Z := by + rw [boundaryDefect_symm,boundaryDefect_add_right,boundaryDefect_symm Z X,boundaryDefect_symm Z Y] + +lemma boundaryDefect_class_right (ho : IsOpen Ω) (X Y Z : Fin 2 → H1 Ω) + (hYZ : ∀ i, ∃ w : H10 ho, Y i-Z i=w.val) : boundaryDefect X Y = boundaryDefect X Z := by + choose w hw using hYZ + have he : Y=Z+fun i => (w i).val := by + funext i + exact (sub_eq_iff_eq_add.mp (hw i)).trans (add_comm _ _) + rw [he,boundaryDefect_add_right,boundaryDefect_zero_right ho,add_zero] + +lemma boundaryDefect_class (ho : IsOpen Ω) (X Y X' Y' : Fin 2 → H1 Ω) + (hX : ∀ i, ∃ w : H10 ho, X i-X' i=w.val) + (hY : ∀ i, ∃ w : H10 ho, Y i-Y' i=w.val) : + boundaryDefect X Y=boundaryDefect X' Y' := by + rw [boundaryDefect_class_right ho X Y Y' hY,boundaryDefect_symm X Y', + boundaryDefect_class_right ho Y' X X' hX,boundaryDefect_symm Y' X'] + +lemma skewEnergy_integral (u v : H1 Ω) : skewEnergy u v = + ∫ x in Ω, inner ℝ (H1.grad u x) (rot (H1.grad v x)) := by + unfold skewEnergy + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [rotL_ae (H1.grad v)] with x hx + rw [hx] + +lemma boundaryDefect_integral (X Y : Fin 2 → H1 Ω) : boundaryDefect X Y = + ∫ x in Ω, -inner ℝ (H1.grad (X 0) x) (rot (H1.grad (Y 1) x))+ + inner ℝ (H1.grad (X 1) x) (rot (H1.grad (Y 0) x)) := by + have hi (i j : Fin 2) : Integrable (fun x => inner ℝ (H1.grad (X i) x) + (rot (H1.grad (Y j) x))) (volume.restrict Ω) := + integrable_inner_of_memLp (Lp.memLp _) (rot.comp_memLp' (Lp.memLp _)) + have hh := integral_add (hi 0 1).neg (hi 1 0) + simp only [Pi.neg_apply,integral_neg] at hh + exact (congrArg₂ (fun a b : ℝ => -a+b) + (skewEnergy_integral _ _) (skewEnergy_integral _ _)).trans hh.symm + +lemma defect_multiplier_algebra (b u v : ℝ) (A B C : Plane) : + -inner ℝ (b • A+u • C) (rot (b • B+v • C))+ + inner ℝ (b • B+v • C) (rot (b • A+u • C)) = + -inner ℝ A (rot (b • (b • B+v • C)+(b*v) • C))+ + inner ℝ B (rot (b • (b • A+u • C)+(b*u) • C)) := by + have hCA : inner ℝ C (rot A) = -inner ℝ A (rot C) := + (real_inner_comm _ _).trans (rot_skew _ _) + have hCB : inner ℝ C (rot B) = -inner ℝ B (rot C) := + (real_inner_comm _ _).trans (rot_skew _ _) + simp only [map_add,map_smul,inner_add_left,inner_add_right,real_inner_smul_left, + real_inner_smul_right,hCA,hCB] + ring + +lemma defect_multiplier_substitute (b u v u' v' : ℝ) + (A B C A' B' A'' B'' : Plane) + (hA : A' = b • A+u • C) (hB : B' = b • B+v • C) + (hu : u'=b*u) (hv : v'=b*v) + (hAA : A''=b • A'+u' • C) (hBB : B''=b • B'+v' • C) : + -inner ℝ A' (rot B')+inner ℝ B' (rot A') = + -inner ℝ A (rot B'')+inner ℝ B (rot A'') := by + rw [hAA,hBB,hA,hB,hu,hv] + exact defect_multiplier_algebra _ _ _ _ _ _ + +variable {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) + (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) + + + +theorem boundaryDefect_multiplier (X : Fin 2 → H1 Ω) : + boundaryDefect (fun i => H1.smoothMul hb hb0 hb1 (X i)) + (fun i => H1.smoothMul hb hb0 hb1 (X i)) = + boundaryDefect X (fun i => H1.smoothMul hb hb0 hb1 (H1.smoothMul hb hb0 hb1 (X i))) := by + rw [boundaryDefect_integral,boundaryDefect_integral] + apply integral_congr_ae + let M := H1.smoothMul hb hb0 hb1 + filter_upwards [H1.smoothMul_grad_ae hb hb0 hb1 (X 0), + H1.smoothMul_grad_ae hb hb0 hb1 (X 1), + H1.smoothMul_value_ae hb hb0 hb1 (X 0), + H1.smoothMul_value_ae hb hb0 hb1 (X 1), + H1.smoothMul_grad_ae hb hb0 hb1 (M (X 0)), + H1.smoothMul_grad_ae hb hb0 hb1 (M (X 1))] with x h0 h1 hv0 hv1 hh0 hh1 + change H1.grad (M (X 0)) x = _ at h0 + change H1.grad (M (X 1)) x = _ at h1 + change H1.value (M (X 0)) x = _ at hv0 + change H1.value (M (X 1)) x = _ at hv1 + change -inner ℝ (H1.grad (M (X 0)) x) (rot (H1.grad (M (X 1)) x))+ + inner ℝ (H1.grad (M (X 1)) x) (rot (H1.grad (M (X 0)) x)) = _ + exact defect_multiplier_substitute (b x) (H1.value (X 0) x) (H1.value (X 1) x) + (H1.value (M (X 0)) x) (H1.value (M (X 1)) x) + (H1.grad (X 0) x) (H1.grad (X 1) x) (gradient b x) + (H1.grad (M (X 0)) x) (H1.grad (M (X 1)) x) + (H1.grad (M (M (X 0))) x) (H1.grad (M (M (X 1))) x) + h0 h1 hv0 hv1 hh0 hh1 +end StrictHotSpots.Hodge +end NullBoundaryFormActualCompatibleLayer + +section VectorSobolevActualCompatibleLayer +open Set MeasureTheory Filter +open scoped InnerProductSpace ContDiff +namespace StrictHotSpots.Hodge +variable {Ω : Set Plane} + + +def coordinateL (Ω : Set Plane) (i : Fin 2) : V2 Ω →L[ℝ] Lp ℝ 2 (volume.restrict Ω) := + (innerSL ℝ (e i)).compLpL 2 (volume.restrict Ω) +lemma coordinateL_ae (i : Fin 2) (v : V2 Ω) : + coordinateL Ω i v =ᵐ[volume.restrict Ω] fun x => c i (v x) := by + filter_upwards [(innerSL ℝ (e i)).coeFn_compLpL v] with x hx + apply hx.trans + change inner ℝ (e i) (v x) = inner ℝ (v x) (e i) + exact real_inner_comm _ _ + + +def axisL (Ω : Set Plane) (i : Fin 2) : Lp ℝ 2 (volume.restrict Ω) →L[ℝ] V2 Ω := + ((ContinuousLinearMap.id ℝ ℝ).smulRight (e i)).compLpL 2 (volume.restrict Ω) +lemma axisL_ae (i : Fin 2) (u : Lp ℝ 2 (volume.restrict Ω)) : + axisL Ω i u =ᵐ[volume.restrict Ω] fun x => u x • e i := + ((ContinuousLinearMap.id ℝ ℝ).smulRight (e i)).coeFn_compLpL u + +def partialL (i : Fin 2) (u : H1 Ω) : Lp ℝ 2 (volume.restrict Ω) := + coordinateL Ω i (H1.grad u) + +lemma scalar_pair_L2 (u v : Lp ℝ 2 (volume.restrict Ω)) : + inner ℝ u v = ∫ x in Ω, u x*v x := by + rw [L2.inner_def] + apply integral_congr_ae + exact Eventually.of_forall fun x => by + simp only [RCLike.inner_apply,RCLike.conj_to_real] + exact mul_comm _ _ + +lemma partialL_compact_integration_by_parts (ho : IsOpen Ω) (i : Fin 2) + (u : H1 Ω) (φ : smoothTestSpace Ω) : + inner ℝ (H1.value u) (partialL i (smoothTestToH10 ho φ).val) = + -inner ℝ (partialL i u) (H10.value ho (smoothTestToH10 ho φ)) := by + have hv : H10.value ho (smoothTestToH10 ho φ) =ᵐ[volume.restrict Ω] φ.val := + (test_memLp φ.property.1 φ.property.2.1).coeFn_toLp + have hg : H10.grad ho (smoothTestToH10 ho φ) =ᵐ[volume.restrict Ω] gradient φ.val := + (test_gradient_memLp φ.property.1 φ.property.2.1).coeFn_toLp + rw [scalar_pair_L2,scalar_pair_L2] + have hl : (∫ x in Ω, H1.value u x*partialL i (smoothTestToH10 ho φ).val x) = + ∫ x in Ω, H1.value u x*(fderiv ℝ φ.val x) (e i) := by + apply integral_congr_ae + filter_upwards [coordinateL_ae i (H10.grad ho (smoothTestToH10 ho φ)),hg] with x hx hy + exact congrArg (fun a : ℝ => H1.value u x*a) + (hx.trans ((congrArg (c i) hy).trans (gradient_c _ _ _))) + have hr : (∫ x in Ω, partialL i u x*H10.value ho (smoothTestToH10 ho φ) x) = + ∫ x in Ω, inner ℝ (H1.grad u x) (e i)*φ.val x := by + apply integral_congr_ae + filter_upwards [coordinateL_ae i (H1.grad u),hv] with x hx hy + exact congrArg₂ (fun a b : ℝ => a*b) hx hy + exact hl.trans (((H1.hasH1Gradient u).2.2 φ.val φ.property.1 φ.property.2.1 + φ.property.2.2 (e i)).trans (congrArg Neg.neg hr).symm) + + + +lemma partialL_integration_by_parts (ho : IsOpen Ω) (i : Fin 2) (u : H1 Ω) (v : H10 ho) : + inner ℝ (H1.value u) (partialL i v.val) = + -inner ℝ (partialL i u) (H10.value ho v) := by + apply isClosed_property (dense_smoothTestToH10 ho) _ _ v + · exact isClosed_eq + (continuous_const.inner ((coordinateL Ω i).continuous.comp (H10.grad ho).continuous)) + ((continuous_const.inner (H10.value ho).continuous).neg) + · exact partialL_compact_integration_by_parts ho i u + +def vectorValue (X : Fin 2 → H1 Ω) : V2 Ω := + axisL Ω 0 (H1.value (X 0))+axisL Ω 1 (H1.value (X 1)) +def divergenceL (X : Fin 2 → H1 Ω) : Lp ℝ 2 (volume.restrict Ω) := + partialL 0 (X 0)+partialL 1 (X 1) +def curlL (X : Fin 2 → H1 Ω) : Lp ℝ 2 (volume.restrict Ω) := + partialL 0 (X 1)-partialL 1 (X 0) + +lemma axis_coordinate_pair (i : Fin 2) (u : Lp ℝ 2 (volume.restrict Ω)) (v : V2 Ω) : + inner ℝ (axisL Ω i u) v = inner ℝ u (coordinateL Ω i v) := by + rw [L2.inner_def,scalar_pair_L2] + apply integral_congr_ae + filter_upwards [axisL_ae i u,coordinateL_ae i v] with x hx hy + rw [hx,hy,real_inner_smul_left] + exact congrArg (fun t : ℝ => u x*t) (real_inner_comm _ _) + +lemma coordinateL_rot_zero (v : V2 Ω) : + coordinateL Ω 0 (rotL Ω v) = -coordinateL Ω 1 v := by + apply Lp.ext + filter_upwards [coordinateL_ae 0 (rotL Ω v),rotL_ae v, + coordinateL_ae 1 v,Lp.coeFn_neg (coordinateL Ω 1 v)] with x h0 hr h1 hn + rw [h0,hr,hn,Pi.neg_apply,h1,(c_rot _).1] + +lemma coordinateL_rot_one (v : V2 Ω) : + coordinateL Ω 1 (rotL Ω v) = coordinateL Ω 0 v := by + apply Lp.ext + filter_upwards [coordinateL_ae 1 (rotL Ω v),rotL_ae v, + coordinateL_ae 0 v] with x h0 hr h1 + rw [h0,hr,h1,(c_rot _).2] + +lemma axis_sum_pair (a b : Lp ℝ 2 (volume.restrict Ω)) (v : V2 Ω) : + inner ℝ (axisL Ω 0 a+axisL Ω 1 b) v = + inner ℝ a (coordinateL Ω 0 v)+inner ℝ b (coordinateL Ω 1 v) := by + rw [inner_add_left,axis_coordinate_pair,axis_coordinate_pair] + +lemma axis_sum_rot_pair (a b : Lp ℝ 2 (volume.restrict Ω)) (v : V2 Ω) : + inner ℝ (axisL Ω 0 a+axisL Ω 1 b) (rotL Ω v) = + -inner ℝ a (coordinateL Ω 1 v)+inner ℝ b (coordinateL Ω 0 v) := by + rw [axis_sum_pair,coordinateL_rot_zero,coordinateL_rot_one,inner_neg_right] + +lemma partialL_test_curl (ho : IsOpen Ω) (X : Fin 2 → H1 Ω) (v : H10 ho) : + inner ℝ (vectorValue X) (rotL Ω (H10.grad ho v)) = + -inner ℝ (curlL X) (H10.value ho v) := by + calc + _ = -inner ℝ (H1.value (X 0)) (partialL 1 v.val)+ + inner ℝ (H1.value (X 1)) (partialL 0 v.val) := axis_sum_rot_pair _ _ _ + _ = -(-inner ℝ (partialL 1 (X 0)) (H10.value ho v))+ + (-inner ℝ (partialL 0 (X 1)) (H10.value ho v)) := + congrArg₂ (fun a b : ℝ => -a+b) (partialL_integration_by_parts ho 1 (X 0) v) + (partialL_integration_by_parts ho 0 (X 1) v) + _ = _ := by simp only [curlL,inner_sub_left]; ring + +lemma vectorValue_zero_trace_normal (ho : IsOpen Ω) (X : Fin 2 → H10 ho) (u : H1 Ω) : + inner ℝ (vectorValue (fun i => (X i).val)) (H1.grad u) = + -inner ℝ (divergenceL (fun i => (X i).val)) (H1.value u) := by + have h0 : inner ℝ (H1.value (X 0).val) (partialL 0 u) = + -inner ℝ (partialL 0 (X 0).val) (H1.value u) := by + have hh := partialL_integration_by_parts ho 0 u (X 0) + change inner ℝ (H1.value u) (partialL 0 (X 0).val) = + -inner ℝ (partialL 0 u) (H1.value (X 0).val) at hh + linarith only [hh,real_inner_comm (H1.value u) (partialL 0 (X 0).val), + real_inner_comm (H1.value (X 0).val) (partialL 0 u)] + have h1 : inner ℝ (H1.value (X 1).val) (partialL 1 u) = + -inner ℝ (partialL 1 (X 1).val) (H1.value u) := by + have hh := partialL_integration_by_parts ho 1 u (X 1) + change inner ℝ (H1.value u) (partialL 1 (X 1).val) = + -inner ℝ (partialL 1 u) (H1.value (X 1).val) at hh + linarith only [hh,real_inner_comm (H1.value u) (partialL 1 (X 1).val), + real_inner_comm (H1.value (X 1).val) (partialL 1 u)] + calc + _ = inner ℝ (H1.value (X 0).val) (partialL 0 u)+ + inner ℝ (H1.value (X 1).val) (partialL 1 u) := axis_sum_pair _ _ _ + _ = -inner ℝ (partialL 0 (X 0).val) (H1.value u)+ + -inner ℝ (partialL 1 (X 1).val) (H1.value u) := congrArg₂ (·+·) h0 h1 + _ = _ := by simp only [divergenceL,inner_add_left,neg_add_rev]; ring +end StrictHotSpots.Hodge +end VectorSobolevActualCompatibleLayer + +section VectorDefectEnergyActualCompatibleLayer +open Set MeasureTheory Filter +open scoped InnerProductSpace ContDiff +namespace StrictHotSpots.Hodge +variable {Ω : Set Plane} + +lemma axis_coordinates (v : V2 Ω) : + axisL Ω 0 (coordinateL Ω 0 v)+axisL Ω 1 (coordinateL Ω 1 v)=v := by + apply Lp.ext + filter_upwards [axisL_ae 0 (coordinateL Ω 0 v),axisL_ae 1 (coordinateL Ω 1 v), + coordinateL_ae 0 v,coordinateL_ae 1 v, + Lp.coeFn_add (axisL Ω 0 (coordinateL Ω 0 v)) (axisL Ω 1 (coordinateL Ω 1 v))] + with x ha hb h0 h1 hadd + rw [hadd,Pi.add_apply,ha,hb,h0,h1,expand] + +lemma coordinate_pair (u v : V2 Ω) : inner ℝ u v = + inner ℝ (coordinateL Ω 0 u) (coordinateL Ω 0 v)+ + inner ℝ (coordinateL Ω 1 u) (coordinateL Ω 1 v) := + (congrArg (fun x : V2 Ω => inner ℝ x v) (axis_coordinates u)).symm.trans (axis_sum_pair _ _ _) + +lemma coordinate_rot_pair (u v : V2 Ω) : inner ℝ u (rotL Ω v) = + -inner ℝ (coordinateL Ω 0 u) (coordinateL Ω 1 v)+ + inner ℝ (coordinateL Ω 1 u) (coordinateL Ω 0 v) := by + rw [coordinate_pair,coordinateL_rot_zero,coordinateL_rot_one,inner_neg_right] + +lemma axis_inner_point (a b c d : ℝ) : + inner ℝ (a • e 0+b • e 1) (c • e 0+d • e 1)=a*c+b*d := by + simp only [inner_add_left,inner_add_right,real_inner_smul_left, + real_inner_smul_right,basis_inner] + norm_num + ring + +lemma axis_sum_ae (a b : Lp ℝ 2 (volume.restrict Ω)) : + axisL Ω 0 a+axisL Ω 1 b =ᵐ[volume.restrict Ω] fun x => a x • e 0+b x • e 1 := by + filter_upwards [axisL_ae 0 a,axisL_ae 1 b,Lp.coeFn_add (axisL Ω 0 a) (axisL Ω 1 b)] + with x ha hb hs + exact hs.trans (congrArg₂ (fun u v : Plane => u+v) ha hb) + +lemma axis_sum_inner (a b c d : Lp ℝ 2 (volume.restrict Ω)) : + inner ℝ (axisL Ω 0 a+axisL Ω 1 b) (axisL Ω 0 c+axisL Ω 1 d) = + inner ℝ a c+inner ℝ b d := by + rw [L2.inner_def,scalar_pair_L2,scalar_pair_L2] + have hi := (Lp.memLp a).integrable_mul (Lp.memLp c) + have hj := (Lp.memLp b).integrable_mul (Lp.memLp d) + calc + _ = ∫ x in Ω, a x*c x+b x*d x := by + apply integral_congr_ae + filter_upwards [axis_sum_ae a b,axis_sum_ae c d] with x hx hy + exact (congrArg₂ (inner ℝ) hx hy).trans (axis_inner_point _ _ _ _) + _ = _ := integral_add hi hj + +lemma divcurl_pair_algebra (A B C D : V2 Ω) : + inner ℝ (coordinateL Ω 0 A+coordinateL Ω 1 B) (coordinateL Ω 0 C+coordinateL Ω 1 D)+ + inner ℝ (coordinateL Ω 0 B-coordinateL Ω 1 A) (coordinateL Ω 0 D-coordinateL Ω 1 C) = + inner ℝ A C+inner ℝ B D-inner ℝ A (rotL Ω D)+inner ℝ B (rotL Ω C) := by + rw [coordinate_rot_pair,coordinate_rot_pair,coordinate_pair A C,coordinate_pair B D] + simp only [inner_add_left,inner_add_right,inner_sub_left,inner_sub_right] + ring + +def cartesianEnergy (X Y : Fin 2 → H1 Ω) : ℝ := + inner ℝ (H1.grad (X 0)) (H1.grad (Y 0))+inner ℝ (H1.grad (X 1)) (H1.grad (Y 1)) + +def vectorForm (μ : ℝ) (X Y : Fin 2 → H1 Ω) : ℝ := + inner ℝ (divergenceL X) (divergenceL Y)+inner ℝ (curlL X) (curlL Y)- + μ*inner ℝ (vectorValue X) (vectorValue Y) + +def cartesianForm (μ : ℝ) (X Y : Fin 2 → H1 Ω) : ℝ := + cartesianEnergy X Y-μ*(inner ℝ (H1.value (X 0)) (H1.value (Y 0))+ + inner ℝ (H1.value (X 1)) (H1.value (Y 1))) + +lemma vectorValue_pair (X Y : Fin 2 → H1 Ω) : + inner ℝ (vectorValue X) (vectorValue Y) = + inner ℝ (H1.value (X 0)) (H1.value (Y 0))+ + inner ℝ (H1.value (X 1)) (H1.value (Y 1)) := axis_sum_inner _ _ _ _ + + + +theorem vectorForm_eq_cartesian_add_defect (μ : ℝ) (X Y : Fin 2 → H1 Ω) : + vectorForm μ X Y=cartesianForm μ X Y+boundaryDefect X Y := by + have h := divcurl_pair_algebra (H1.grad (X 0)) (H1.grad (X 1)) + (H1.grad (Y 0)) (H1.grad (Y 1)) + change inner ℝ (divergenceL X) (divergenceL Y)+inner ℝ (curlL X) (curlL Y) = + cartesianEnergy X Y-skewEnergy (X 0) (Y 1)+skewEnergy (X 1) (Y 0) at h + unfold vectorForm cartesianForm boundaryDefect + rw [h,vectorValue_pair] + ring +end StrictHotSpots.Hodge +end VectorDefectEnergyActualCompatibleLayer + +section TangentVectorClassActualCompatibleLayer +open Set MeasureTheory Filter +open scoped InnerProductSpace ContDiff +namespace StrictHotSpots.Hodge +variable {Ω : Set Plane} + + +def TangentWeak (X : Fin 2 → H1 Ω) : Prop := + WeakNormalDiv (vectorValue X) (divergenceL X) + +lemma vectorValue_add (X Y : Fin 2 → H1 Ω) : + vectorValue (X+Y)=vectorValue X+vectorValue Y := by + simp only [vectorValue,Pi.add_apply,map_add] + abel +lemma vectorValue_smul (r : ℝ) (X : Fin 2 → H1 Ω) : + vectorValue (r • X)=r • vectorValue X := by + simp only [vectorValue,Pi.smul_apply,map_smul,smul_add] +lemma partialL_add (i : Fin 2) (u v : H1 Ω) : partialL i (u+v)=partialL i u+partialL i v := by + simp only [partialL,map_add] +lemma partialL_smul (i : Fin 2) (r : ℝ) (u : H1 Ω) : partialL i (r • u)=r • partialL i u := by + simp only [partialL,map_smul] +lemma divergenceL_add (X Y : Fin 2 → H1 Ω) : + divergenceL (X+Y)=divergenceL X+divergenceL Y := by + simp only [divergenceL,Pi.add_apply,partialL_add] + abel +lemma divergenceL_smul (r : ℝ) (X : Fin 2 → H1 Ω) : + divergenceL (r • X)=r • divergenceL X := by + simp only [divergenceL,Pi.smul_apply,partialL_smul,smul_add] +lemma curlL_add (X Y : Fin 2 → H1 Ω) : curlL (X+Y)=curlL X+curlL Y := by + simp only [curlL,Pi.add_apply,partialL_add] + abel +lemma curlL_smul (r : ℝ) (X : Fin 2 → H1 Ω) : curlL (r • X)=r • curlL X := by + simp only [curlL,Pi.smul_apply,partialL_smul,smul_sub] + +lemma TangentWeak.add {X Y : Fin 2 → H1 Ω} (hX : TangentWeak X) (hY : TangentWeak Y) : + TangentWeak (X+Y) := by + intro u + rw [vectorValue_add,divergenceL_add,inner_add_left,inner_add_left,hX u,hY u] + ring +lemma TangentWeak.smul {X : Fin 2 → H1 Ω} (hX : TangentWeak X) (r : ℝ) : + TangentWeak (r • X) := by + intro u + rw [vectorValue_smul,divergenceL_smul,real_inner_smul_left,real_inner_smul_left,hX u] + ring +lemma tangentWeak_zero_trace (ho : IsOpen Ω) (X : Fin 2 → H10 ho) : + TangentWeak (fun i => (X i).val) := vectorValue_zero_trace_normal ho X + + +lemma TangentWeak.of_class (ho : IsOpen Ω) {X Y : Fin 2 → H1 Ω} + (hY : TangentWeak Y) (hXY : ∀ i, ∃ w : H10 ho, X i-Y i=w.val) : TangentWeak X := by + choose w hw using hXY + have he : X=Y+fun i => (w i).val := by + funext i + exact (sub_eq_iff_eq_add.mp (hw i)).trans (add_comm _ _) + rw [he] + exact hY.add (tangentWeak_zero_trace ho w) + +lemma vectorForm_symm (μ : ℝ) (X Y : Fin 2 → H1 Ω) : vectorForm μ X Y=vectorForm μ Y X := by + unfold vectorForm + rw [real_inner_comm (divergenceL X),real_inner_comm (curlL X),real_inner_comm (vectorValue X)] +lemma vectorForm_add_left (μ : ℝ) (X Y Z : Fin 2 → H1 Ω) : + vectorForm μ (X+Y) Z=vectorForm μ X Z+vectorForm μ Y Z := by + simp only [vectorForm,divergenceL_add,curlL_add,vectorValue_add,inner_add_left] + ring +lemma vectorForm_smul_left (μ r : ℝ) (X Y : Fin 2 → H1 Ω) : + vectorForm μ (r • X) Y=r*vectorForm μ X Y := by + simp only [vectorForm,divergenceL_smul,curlL_smul,vectorValue_smul,real_inner_smul_left] + ring +lemma vectorForm_add_right (μ : ℝ) (X Y Z : Fin 2 → H1 Ω) : + vectorForm μ X (Y+Z)=vectorForm μ X Y+vectorForm μ X Z := by + rw [vectorForm_symm,vectorForm_add_left,vectorForm_symm μ Y X,vectorForm_symm μ Z X] +lemma vectorForm_smul_right (μ r : ℝ) (X Y : Fin 2 → H1 Ω) : + vectorForm μ X (r • Y)=r*vectorForm μ X Y := by + rw [vectorForm_symm,vectorForm_smul_left,vectorForm_symm μ Y X] + + +theorem vectorForm_nonneg (ho : IsOpen Ω) (hne : Ω.Nonempty) (hs : IsSimplyConnected Ω) + (hb : Bornology.IsBounded Ω) (hμ : 0 < firstPositiveNeumannValue Ω) + {L : ℝ} (hl : firstPositiveNeumannValue Ω < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + (X : Fin 2 → H1 Ω) (hX : TangentWeak X) : + 0 ≤ vectorForm (firstPositiveNeumannValue Ω) X X := by + have hh := vector_inequality ho hne hs hb hμ hl hD (vectorValue X) + (divergenceL X) (curlL X) hX (partialL_test_curl ho X) + simpa only [vectorForm,real_inner_self_eq_norm_sq,sub_nonneg] using hh + +lemma quadratic_null_pair {b c : ℝ} (h : ∀ r : ℝ, 0 ≤ 2*r*b+r^2*c) : b=0 := by + have h1 := h 1 + have hm := h (-1) + have hc : 0 ≤ c := by nlinarith + by_cases hz : c=0 + · rw [hz] at h1 hm + nlinarith + · have hp : 0 < c := lt_of_le_of_ne hc (Ne.symm hz) + have hh := h (-b/c) + have hd := mul_nonneg hh (sq_nonneg c) + have he : (2*(-b/c)*b+(-b/c)^2*c)*c^2 = -b^2*c := by field_simp; ring + rw [he] at hd + have hs : 0 ≤ -b^2 := nonneg_of_mul_nonneg_left hd hp + nlinarith [sq_nonneg b] + + + +theorem vectorForm_null_pair (μ : ℝ) (X Y : Fin 2 → H1 Ω) + (hX : TangentWeak X) (hY : TangentWeak Y) + (hpos : ∀ Z : Fin 2 → H1 Ω, TangentWeak Z → 0 ≤ vectorForm μ Z Z) + (hz : vectorForm μ X X=0) : vectorForm μ X Y=0 := by + apply quadratic_null_pair (c := vectorForm μ Y Y) + intro r + have hh := hpos (X+r • Y) (hX.add (hY.smul r)) + rw [vectorForm_add_left,vectorForm_add_right,vectorForm_add_right, + vectorForm_smul_left,vectorForm_smul_right,vectorForm_smul_right,hz, + vectorForm_symm μ Y X,vectorForm_smul_left] at hh + convert hh using 1 + ring +end StrictHotSpots.Hodge +end TangentVectorClassActualCompatibleLayer + +section NormalMultiplierActualCompatibleLayer +open Set MeasureTheory Filter +open scoped InnerProductSpace ContDiff ENNReal +namespace StrictHotSpots.Hodge +variable {Ω : Set Plane} + +lemma divergenceL_ae (X : Fin 2 → H1 Ω) : divergenceL X =ᵐ[volume.restrict Ω] + fun x => c 0 (H1.grad (X 0) x)+c 1 (H1.grad (X 1) x) := by + filter_upwards [coordinateL_ae 0 (H1.grad (X 0)),coordinateL_ae 1 (H1.grad (X 1)), + Lp.coeFn_add (partialL 0 (X 0)) (partialL 1 (X 1))] with x h0 h1 ha + exact ha.trans (congrArg₂ (fun a b : ℝ => a+b) h0 h1) +lemma vectorValue_ae (X : Fin 2 → H1 Ω) : vectorValue X =ᵐ[volume.restrict Ω] + fun x => H1.value (X 0) x • e 0+H1.value (X 1) x • e 1 := axis_sum_ae _ _ + +lemma divergence_multiplier_algebra (b u v : ℝ) (A B C : Plane) : + c 0 (b • A+u • C)+c 1 (b • B+v • C) = + b*(c 0 A+c 1 B)+inner ℝ (u • e 0+v • e 1) C := by + have h0 : inner ℝ (e 0) C = inner ℝ C (e 0) := real_inner_comm _ _ + have h1 : inner ℝ (e 1) C = inner ℝ C (e 1) := real_inner_comm _ _ + simp only [c,inner_add_left,real_inner_smul_left,h0,h1] + ring + +variable {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) + (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) + +lemma vectorValue_smoothMul_ae (X : Fin 2 → H1 Ω) : + vectorValue (fun i => H1.smoothMul hb hb0 hb1 (X i)) =ᵐ[volume.restrict Ω] + fun x => b x • vectorValue X x := by + let M := H1.smoothMul hb hb0 hb1 + filter_upwards [vectorValue_ae (fun i => M (X i)),vectorValue_ae X, + H1.smoothMul_value_ae hb hb0 hb1 (X 0),H1.smoothMul_value_ae hb hb0 hb1 (X 1)] + with x hV hX h0 h1 + apply hV.trans + exact (congrArg₂ (fun a d : ℝ => a • e 0+d • e 1) h0 h1).trans + (by rw [hX]; module) + +lemma divergenceL_smoothMul_ae (X : Fin 2 → H1 Ω) : + divergenceL (fun i => H1.smoothMul hb hb0 hb1 (X i)) =ᵐ[volume.restrict Ω] + fun x => b x*divergenceL X x+inner ℝ (vectorValue X x) (gradient b x) := by + let M := H1.smoothMul hb hb0 hb1 + filter_upwards [divergenceL_ae (fun i => M (X i)),divergenceL_ae X,vectorValue_ae X, + H1.smoothMul_grad_ae hb hb0 hb1 (X 0),H1.smoothMul_grad_ae hb hb0 hb1 (X 1)] + with x hD hX hV h0 h1 + apply hD.trans + exact (congrArg₂ (fun A B : Plane => c 0 A+c 1 B) h0 h1).trans + ((divergence_multiplier_algebra _ _ _ _ _ _).trans + (congrArg₂ (fun d : ℝ => fun V : Plane => b x*d+inner ℝ V (gradient b x)) hX hV).symm) + +lemma normal_pair_integral (X : Fin 2 → H1 Ω) (u : H1 Ω) : + inner ℝ (vectorValue X) (H1.grad u)+inner ℝ (divergenceL X) (H1.value u) = + ∫ x in Ω, inner ℝ (vectorValue X x) (H1.grad u x)+divergenceL X x*H1.value u x := by + have hi := integrable_inner_of_memLp (Lp.memLp (vectorValue X)) (Lp.memLp (H1.grad u)) + have hj := (Lp.memLp (divergenceL X)).integrable_mul (Lp.memLp (H1.value u)) + exact (congrArg₂ (fun a b : ℝ => a+b) (L2.inner_def _ _) (scalar_pair_L2 _ _)).trans + (integral_add hi hj).symm + +lemma normal_multiplier_algebra (b u F : ℝ) (V G C : Plane) : + inner ℝ (b • V) G+(b*F+inner ℝ V C)*u = + inner ℝ V (b • G+u • C)+F*(b*u) := by + simp only [real_inner_smul_left,inner_add_right,real_inner_smul_right] + ring + +lemma normal_pair_smoothMul (X : Fin 2 → H1 Ω) (u : H1 Ω) : + inner ℝ (vectorValue (fun i => H1.smoothMul hb hb0 hb1 (X i))) (H1.grad u)+ + inner ℝ (divergenceL (fun i => H1.smoothMul hb hb0 hb1 (X i))) (H1.value u) = + inner ℝ (vectorValue X) (H1.grad (H1.smoothMul hb hb0 hb1 u))+ + inner ℝ (divergenceL X) (H1.value (H1.smoothMul hb hb0 hb1 u)) := by + refine Eq.trans (normal_pair_integral _ _) (Eq.trans ?_ (normal_pair_integral _ _).symm) + apply integral_congr_ae + filter_upwards [vectorValue_smoothMul_ae hb hb0 hb1 X,divergenceL_smoothMul_ae hb hb0 hb1 X, + H1.smoothMul_grad_ae hb hb0 hb1 u,H1.smoothMul_value_ae hb hb0 hb1 u] with x hV hD hG hu + exact (congrArg₂ (fun V : Plane => fun F : ℝ => + inner ℝ V (H1.grad u x)+F*H1.value u x) hV hD).trans + ((normal_multiplier_algebra _ _ _ _ _ _).trans + (congrArg₂ (fun G : Plane => fun v : ℝ => inner ℝ (vectorValue X x) G+divergenceL X x*v) hG hu).symm) + + +theorem TangentWeak.smoothMul {X : Fin 2 → H1 Ω} (hX : TangentWeak X) : + TangentWeak (fun i => H1.smoothMul hb hb0 hb1 (X i)) := by + intro u + have he := normal_pair_smoothMul hb hb0 hb1 X u + have hz := hX (H1.smoothMul hb hb0 hb1 u) + linarith only [he,hz] +end StrictHotSpots.Hodge +end NormalMultiplierActualCompatibleLayer + +section BoundaryClassMultiplierActualCompatibleLayer +open Set MeasureTheory +open scoped ContDiff InnerProductSpace ENNReal +namespace StrictHotSpots.Hodge +variable {Ω : Set Plane} (ho : IsOpen Ω) +variable {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) + (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) + + + + +theorem boundaryClass_multiplier_identity (μ : ℝ) (X Y Z : Fin 2 → H1 Ω) + (hX : TangentWeak X) + (hY : ∀ i, ∃ w : H10 ho, Y i-H1.smoothMul hb hb0 hb1 (X i)=w.val) + (hZ : ∀ i, ∃ w : H10 ho, + Z i-H1.smoothMul hb hb0 hb1 (H1.smoothMul hb hb0 hb1 (X i))=w.val) + (hpos : ∀ V : Fin 2 → H1 Ω, TangentWeak V → 0 ≤ vectorForm μ V V) + (hnull : vectorForm μ X X=0) : + vectorForm μ Y Y=cartesianForm μ Y Y-cartesianForm μ X Z := by + let M := H1.smoothMul hb hb0 hb1 + have htZ : TangentWeak Z := TangentWeak.of_class ho + ((hX.smoothMul hb hb0 hb1).smoothMul hb hb0 hb1) hZ + have hz : vectorForm μ X Z=0 := vectorForm_null_pair μ X Z hX htZ hpos hnull + have hYY : boundaryDefect Y Y = boundaryDefect (fun i => M (X i)) (fun i => M (X i)) := + boundaryDefect_class ho Y Y _ _ hY hY + have hZZ : boundaryDefect X Z = boundaryDefect X (fun i => M (M (X i))) := + boundaryDefect_class_right ho X Z _ hZ + have he : boundaryDefect Y Y = boundaryDefect X Z := + hYY.trans ((boundaryDefect_multiplier hb hb0 hb1 X).trans hZZ.symm) + have hqY := vectorForm_eq_cartesian_add_defect μ Y Y + have hqZ := vectorForm_eq_cartesian_add_defect μ X Z + linarith only [hqY,hqZ,he,hz] + + + +theorem boundaryClass_multiplier_nonneg (hne : Ω.Nonempty) (hs : IsSimplyConnected Ω) + (hbounded : Bornology.IsBounded Ω) (hμ : 0 < firstPositiveNeumannValue Ω) + {L : ℝ} (hl : firstPositiveNeumannValue Ω < L) + (hD : ∀ j : H10 ho, L*‖H10.value ho j‖^2 ≤ ‖H10.grad ho j‖^2) + (X Y Z : Fin 2 → H1 Ω) (hX : TangentWeak X) + (hY : ∀ i, ∃ w : H10 ho, Y i-H1.smoothMul hb hb0 hb1 (X i)=w.val) + (hZ : ∀ i, ∃ w : H10 ho, + Z i-H1.smoothMul hb hb0 hb1 (H1.smoothMul hb hb0 hb1 (X i))=w.val) + (hnull : vectorForm (firstPositiveNeumannValue Ω) X X=0) : + 0 ≤ cartesianForm (firstPositiveNeumannValue Ω) Y Y- + cartesianForm (firstPositiveNeumannValue Ω) X Z := by + have hp := vectorForm_nonneg ho hne hs hbounded hμ hl hD + have he := boundaryClass_multiplier_identity ho hb hb0 hb1 + (firstPositiveNeumannValue Ω) X Y Z hX hY hZ hp hnull + have htY := TangentWeak.of_class ho (hX.smoothMul hb hb0 hb1) hY + exact he ▸ hp Y htY +end StrictHotSpots.Hodge +end BoundaryClassMultiplierActualCompatibleLayer + +section GradientVectorEnergyActualCompatibleLayer +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal Topology +namespace StrictHotSpots +namespace Hodge +variable {Ω : Set Plane} + +lemma scalar_eq_zero_of_H10_pair (ho : IsOpen Ω) (f : Lp ℝ 2 (volume.restrict Ω)) + (h : ∀ v : H10 ho, inner ℝ f (H10.value ho v)=0) : f=0 := by + apply eq_zero_of_inner_smoothTest_eq_zero ho f + intro φ + exact (real_inner_comm _ _).trans (h (smoothTestToH10 ho φ)) + +lemma vectorValue_test_normal (ho : IsOpen Ω) (X : Fin 2 → H1 Ω) (v : H10 ho) : + inner ℝ (vectorValue X) (H10.grad ho v) = + -inner ℝ (divergenceL X) (H10.value ho v) := by + calc + _ = inner ℝ (H1.value (X 0)) (partialL 0 v.val)+ + inner ℝ (H1.value (X 1)) (partialL 1 v.val) := axis_sum_pair _ _ _ + _ = -inner ℝ (partialL 0 (X 0)) (H10.value ho v)+ + -inner ℝ (partialL 1 (X 1)) (H10.value ho v) := + congrArg₂ (·+·) (partialL_integration_by_parts ho 0 (X 0) v) + (partialL_integration_by_parts ho 1 (X 1) v) + _ = _ := by simp only [divergenceL,inner_add_left,neg_add_rev]; ring + +lemma gradient_curl_zero (ho : IsOpen Ω) (X : Fin 2 → H1 Ω) (u : H1 Ω) + (hX : vectorValue X=H1.grad u) : curlL X=0 := by + apply scalar_eq_zero_of_H10_pair ho + intro v + have hh := partialL_test_curl ho X v + have hz := grad_rotGrad_orthogonal ho u v + rw [hX] at hh + linarith only [hh,hz] + + +def NeumannEuler (μ : ℝ) (u : H1 Ω) : Prop := ∀ w : H1 Ω, + inner ℝ (H1.grad u) (H1.grad w)=μ*inner ℝ (H1.value u) (H1.value w) + +lemma inner_add_smul_zero {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (a b c : E) (μ t : ℝ) (ha : t = -inner ℝ a c) (hb : t = μ*inner ℝ b c) : + inner ℝ (a+μ • b) c=0 := by + rw [inner_add_left, real_inner_smul_left] + linarith only [ha,hb] + +lemma gradient_divergence (ho : IsOpen Ω) (μ : ℝ) (X : Fin 2 → H1 Ω) (u : H1 Ω) + (hX : vectorValue X=H1.grad u) (hu : NeumannEuler μ u) : + divergenceL X=(-μ) • H1.value u := by + have hz : divergenceL X+μ • H1.value u=0 := by + apply scalar_eq_zero_of_H10_pair ho + intro v + have hh := vectorValue_test_normal ho X v + have he := hu v.val + rw [hX] at hh + change inner ℝ (H1.grad u) (H10.grad ho v)= + μ*inner ℝ (H1.value u) (H10.value ho v) at he + exact inner_add_smul_zero (divergenceL X) (H1.value u) (H10.value ho v) μ + (inner ℝ (H1.grad u) (H10.grad ho v)) hh he + exact (eq_neg_of_add_eq_zero_left hz).trans (neg_smul μ (H1.value u)).symm + +lemma gradient_tangent (ho : IsOpen Ω) (μ : ℝ) (X : Fin 2 → H1 Ω) (u : H1 Ω) + (hX : vectorValue X=H1.grad u) (hu : NeumannEuler μ u) : TangentWeak X := by + have hd := gradient_divergence ho μ X u hX hu + intro w + rw [hX,hd,real_inner_smul_left,hu w] + ring + +lemma gradient_form_algebra {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + (μ : ℝ) (g : E) (v : F) (he : inner ℝ g g=μ*inner ℝ v v) : + inner ℝ ((-μ) • v) ((-μ) • v)+inner ℝ (0:F) (0:F)-μ*inner ℝ g g=0 := by + simp only [real_inner_smul_left,real_inner_smul_right,inner_zero_left,he] + ring + + + +theorem gradient_vector_null (ho : IsOpen Ω) (μ : ℝ) (X : Fin 2 → H1 Ω) (u : H1 Ω) + (hX : vectorValue X=H1.grad u) (hu : NeumannEuler μ u) : + TangentWeak X ∧ vectorForm μ X X=0 := by + refine ⟨gradient_tangent ho μ X u hX hu,?_⟩ + have hd := gradient_divergence ho μ X u hX hu + have hc := gradient_curl_zero ho X u hX + unfold vectorForm + rw [hd,hc,hX] + exact gradient_form_algebra μ (H1.grad u) (H1.value u) (hu u) +end Hodge +end StrictHotSpots +end GradientVectorEnergyActualCompatibleLayer + +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace Topology +namespace StrictHotSpots +namespace Hodge +variable {Ω : Set Plane} {u : Plane → ℝ} + + + + +def eigenGradientField (hΩ : AdmissibleDomain Ω) (hu : InFirstNeumannEigenspace Ω u) : + Fin 2 → H1 Ω := fun i => + (smooth_closure_H1 hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 + (closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 (e i))).toH1 + +lemma eigenGradientField_value_ae (hΩ : AdmissibleDomain Ω) + (hu : InFirstNeumannEigenspace Ω u) (i : Fin 2) : + H1.value (eigenGradientField hΩ hu i) =ᵐ[volume.restrict Ω] + fun x => fderivWithin ℝ u (closure Ω) x (e i) := + (smooth_closure_H1 hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 + (closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 (e i))).1.coeFn_toLp + +lemma eigenGradientField_vector (hΩ : AdmissibleDomain Ω) + (hu : InFirstNeumannEigenspace Ω u) : + vectorValue (eigenGradientField hΩ hu)=H1.grad hu.2.1.toH1 := by + apply Lp.ext + filter_upwards [axis_sum_ae (H1.value (eigenGradientField hΩ hu 0)) + (H1.value (eigenGradientField hΩ hu 1)),eigenGradientField_value_ae hΩ hu 0, + eigenGradientField_value_ae hΩ hu 1,hu.2.1.2.1.coeFn_toLp, + ae_restrict_mem hΩ.2.1.measurableSet] with x hv h0 h1 hg hx + change (vectorValue (eigenGradientField hΩ hu)) x = _ at hv + change (H1.grad hu.2.1.toH1) x = gradient u x at hg + have he (i : Fin 2) : fderivWithin ℝ u (closure Ω) x (e i)=c i (gradient u x) := by + rw [fderivWithin_of_mem_nhds (mem_of_superset (hΩ.2.1.mem_nhds hx) subset_closure)] + exact (gradient_c u i x).symm + exact hv.trans ((congrArg₂ (fun a b : ℝ => a • e 0+b • e 1) + (h0.trans (he 0)) (h1.trans (he 1))).trans ((expand _).trans hg.symm)) + +lemma eigen_NeumannEuler (hu : InFirstNeumannEigenspace Ω u) : + NeumannEuler (firstPositiveNeumannValue Ω) hu.2.1.toH1 := by + intro w + have hl : inner ℝ (H1.grad hu.2.1.toH1) (H1.grad w) = + ∫ x in Ω, inner ℝ (gradient u x) (H1.grad w x) := by + refine (L2.inner_def _ _).trans (integral_congr_ae ?_) + filter_upwards [hu.2.1.2.1.coeFn_toLp] with x hx + exact congrArg (fun v : Plane => inner ℝ v (H1.grad w x)) hx + have hr : inner ℝ (H1.value hu.2.1.toH1) (H1.value w) = + ∫ x in Ω, u x*H1.value w x := by + refine (scalar_pair_L2 _ _).trans (integral_congr_ae ?_) + filter_upwards [hu.2.1.1.coeFn_toLp] with x hx + exact congrArg (fun v : ℝ => v*H1.value w x) hx + exact hl.trans ((hu.2.2.2 _ _ (H1.hasH1Gradient w)).trans + (congrArg (fun t : ℝ => firstPositiveNeumannValue Ω*t) hr).symm) + + + + +theorem eigenGradientField_null (hΩ : AdmissibleDomain Ω) + (hu : InFirstNeumannEigenspace Ω u) : + TangentWeak (eigenGradientField hΩ hu) ∧ + vectorForm (firstPositiveNeumannValue Ω) (eigenGradientField hΩ hu) + (eigenGradientField hΩ hu)=0 := + gradient_vector_null hΩ.2.1 (firstPositiveNeumannValue Ω) (eigenGradientField hΩ hu) + hu.2.1.toH1 (eigenGradientField_vector hΩ hu) (eigen_NeumannEuler hu) +end Hodge +end StrictHotSpots +end +end ActualVectorSupport + +section ActualScalarEnergy + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) +variable (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) +variable (hμ : 0 ≤ firstPositiveNeumannValue Ω) + +lemma boundarySolution_datum_class {w : Plane → ℝ} + (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) : + ∃ v : H10 diskOpen, + boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl = (c.pullDatum_H1 hb hs hw).toH1+v.val := by + obtain ⟨a,ha⟩ := boundarySolution_class c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl + obtain ⟨b,hb'⟩ := c.pullDatum_Poisson_class hb hs hw hl + refine ⟨a-b,?_⟩ + change _ = _+(a.val-b.val) + rw [← ha,← hb'] + abel + + + +def datumCorrection {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) : H10 diskOpen := + (c.boundarySolution_datum_class hb hs hμ hw hl).choose + +lemma datumCorrection_spec {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) : + boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl = + (c.pullDatum_H1 hb hs hw).toH1+(c.datumCorrection hb hs hμ hw hl).val := + (c.boundarySolution_datum_class hb hs hμ hw hl).choose_spec + +def physicalSolution {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) : H1 Ω := + (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hw).toH1+ + (show H1 Ω from (transportH10 c.diskMap c.diskMap_inverse_smooth + (c.datumCorrection hb hs hμ hw hl)).val) + +lemma physicalSolution_class {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) : + ∃ v : H10 (show IsOpen Ω from c.diskMap.open_target), c.physicalSolution hb hs hμ hw hl- + (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hw).toH1=v.val := by + refine ⟨transportH10 c.diskMap c.diskMap_inverse_smooth (c.datumCorrection hb hs hμ hw hl),?_⟩ + exact add_sub_cancel_left _ _ + +lemma physicalSolution_grad_pair {w z : Plane → ℝ} + (hw : ContDiffOn ℝ ∞ w (closure Ω)) (hz : ContDiffOn ℝ ∞ z (closure Ω)) {B D : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) + (hk : LipschitzWith D (c.datumTrace z hz.continuousOn)) : + inner ℝ (H1.grad (c.physicalSolution hb hs hμ hw hl)) + (H1.grad (c.physicalSolution hb hs hμ hz hk)) = + inner ℝ (H1.grad (boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl)) + (H1.grad (boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace z hz.continuousOn) hk)) := by + have hh := affine_grad_pair c.diskMap c.diskMap_inverse_smooth c.d c.diskMap_deriv hb + ((hw.mono subset_closure).differentiableOn (by simp)) + ((hz.mono subset_closure).differentiableOn (by simp)) + (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hw) + (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hz) + (c.pullDatum_comp_H1 hb hs hw) (c.pullDatum_comp_H1 hb hs hz) + (c.datumCorrection hb hs hμ hw hl) (c.datumCorrection hb hs hμ hz hk) + apply hh.trans + apply congrArg₂ (fun U V : H1 disk => inner ℝ (H1.grad U) (H1.grad V)) + · exact (congrArg (fun U : H1 disk => U+(c.datumCorrection hb hs hμ hw hl).val) + (c.pullDatum_comp_toH1 hb hs hw)).trans (c.datumCorrection_spec hb hs hμ hw hl).symm + · exact (congrArg (fun U : H1 disk => U+(c.datumCorrection hb hs hμ hz hk).val) + (c.pullDatum_comp_toH1 hb hs hz)).trans (c.datumCorrection_spec hb hs hμ hz hk).symm + +lemma physicalSolution_mass_pair {w z : Plane → ℝ} + (hw : ContDiffOn ℝ ∞ w (closure Ω)) (hz : ContDiffOn ℝ ∞ z (closure Ω)) {B D : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) + (hk : LipschitzWith D (c.datumTrace z hz.continuousOn)) : + firstPositiveNeumannValue Ω * inner ℝ (H1.value (c.physicalSolution hb hs hμ hw hl)) + (H1.value (c.physicalSolution hb hs hμ hz hk)) = + inner ℝ (SubcriticalExtension.observe c.densityBound_ne_top (c.density_bound hμ) + (boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl)) + (SubcriticalExtension.observe c.densityBound_ne_top (c.density_bound hμ) + (boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace z hz.continuousOn) hk)) := by + let S := boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace w hw.continuousOn) hl + let T := boundarySolution c.densityBound_ne_top (c.density_bound hμ) + (c.datumTrace z hz.continuousOn) hk + have hh := affine_value_pair c.diskMap c.diskMap_inverse_smooth c.d c.diskMap_deriv hb + (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hw) + (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hz) + (c.pullDatum_comp_H1 hb hs hw) (c.pullDatum_comp_H1 hb hs hz) + (c.datumCorrection hb hs hμ hw hl) (c.datumCorrection hb hs hμ hz hk) + have hw' : (c.pullDatum_comp_H1 hb hs hw).toH1+(c.datumCorrection hb hs hμ hw hl).val=S := + (congrArg (fun U : H1 disk => U+(c.datumCorrection hb hs hμ hw hl).val) + (c.pullDatum_comp_toH1 hb hs hw)).trans (c.datumCorrection_spec hb hs hμ hw hl).symm + have hz' : (c.pullDatum_comp_H1 hb hs hz).toH1+(c.datumCorrection hb hs hμ hz hk).val=T := + (congrArg (fun U : H1 disk => U+(c.datumCorrection hb hs hμ hz hk).val) + (c.pullDatum_comp_toH1 hb hs hz)).trans (c.datumCorrection_spec hb hs hμ hz hk).symm + have hr := congrArg₂ (fun U V : H1 disk => + ∫ x, H1.value U x*H1.value V x ∂chartMeasure c.diskMap c.d) hw' hz' + have hp := potentialMeasure_integral c.diskMap c.d hμ (fun x => H1.value S x*H1.value T x) + have hq := congrArg (fun ν : Measure Plane => ∫ x, H1.value S x*H1.value T x ∂ν) + c.potential_diskMap + exact (congrArg (fun t : ℝ => firstPositiveNeumannValue Ω*t) (hh.trans hr)).trans + (hp.symm.trans (hq.trans (observe_inner c.densityBound_ne_top (c.density_bound hμ) S T).symm)) + + + +theorem physicalSolution_energy (hne : Ω.Nonempty) (hμp : 0 < firstPositiveNeumannValue Ω) + {w z : Plane → ℝ} + (hw : ContDiffOn ℝ ∞ w (closure Ω)) (hz : ContDiffOn ℝ ∞ z (closure Ω)) {B D : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) + (hk : LipschitzWith D (c.datumTrace z hz.continuousOn)) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hb + inner ℝ (H1.grad (c.physicalSolution hb hs hμ hw hl)) + (H1.grad (c.physicalSolution hb hs hμ hz hk)) - + firstPositiveNeumannValue Ω * inner ℝ (H1.value (c.physicalSolution hb hs hμ hw hl)) + (H1.value (c.physicalSolution hb hs hμ hz hk)) = + (1/2:ℝ)*(∫ q : Boundary × Boundary, boundaryInteraction q.1 q.2 * + inner ℝ (w (c.F q.1)-w (c.F q.2)) (z (c.F q.1)-z (c.F q.2)) + ∂boundaryMeasure.prod boundaryMeasure) - + (∫ q : Boundary × Boundary, fullBoundaryR c.densityBound_ne_top (c.density_bound hμ) q.1 q.2 * + w (c.F q.1) * z (c.F q.2) ∂boundaryMeasure.prod boundaryMeasure) := by + let _ : IsFiniteMeasure c.potential := c.potential_finite hb + have he := boundarySolution_energy c.densityBound_ne_top (c.density_bound hμ) + (c.operator_norm_lt_one hb hne hμp) (c.datumTrace w hw.continuousOn) + (c.datumTrace z hz.continuousOn) hl hk + exact (congrArg₂ (fun a b : ℝ => a-b) + (c.physicalSolution_grad_pair hb hs hμ hw hz hl hk) + (c.physicalSolution_mass_pair hb hs hμ hw hz hl hk)).trans he + +end StrictHotSpots.Conformal.ClosedDiskChart +end +end ActualScalarEnergy + +section ActualVectorEnergy + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal Laplacian +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen Hodge +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) +variable (hb : Bornology.IsBounded Ω) (hs : SmoothBoundary Ω) +variable (hμ : 0 < firstPositiveNeumannValue Ω) + + +def scalarSolution {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) : H1 Ω := + c.physicalSolution hb hs hμ.le hw (c.datumTrace_lipschitz hb hs hw).choose_spec + +lemma scalarSolution_class {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) : + ∃ v : H10 (show IsOpen Ω from c.diskMap.open_target), c.scalarSolution hb hs hμ hw- + (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hw).toH1=v.val := + c.physicalSolution_class hb hs hμ.le hw (c.datumTrace_lipschitz hb hs hw).choose_spec + +lemma datumCorrection_eq_zero_of_helmholtz (hne : Ω.Nonempty) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) + (hp : ∀ x ∈ Ω, Δ w x = -firstPositiveNeumannValue Ω*w x) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) : + c.datumCorrection hb hs hμ.le hw hl = 0 := by + obtain ⟨δ,hδ,hδ1,hsub⟩ := c.subcritical hb hne hμ + have he := boundarySolution_eq_of_trace c.densityBound_ne_top (c.density_bound hμ.le) + hδ.le hδ1 hsub (c.datumTrace w hw.continuousOn) hl + (c.pullDatum_smooth (hw.mono subset_closure)) (c.pullDatum_continuous hw.continuousOn) + (c.pullDatum_H1 hb hs hw) (fun _ => rfl) (c.smooth_pull_weak hb hs hw hμ.le hp) + apply Subtype.ext + have ha := (c.datumCorrection_spec hb hs hμ.le hw hl).symm.trans he + exact add_left_cancel (ha.trans (add_zero _).symm) + +lemma physicalSolution_eq_of_helmholtz (hne : Ω.Nonempty) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) + (hp : ∀ x ∈ Ω, Δ w x = -firstPositiveNeumannValue Ω*w x) {B : ℝ≥0} + (hl : LipschitzWith B (c.datumTrace w hw.continuousOn)) : + c.physicalSolution hb hs hμ.le hw hl = + (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hw).toH1 := by + have hz := c.datumCorrection_eq_zero_of_helmholtz hb hs hμ hne hw hp hl + have ht : (transportH10 c.diskMap c.diskMap_inverse_smooth + (c.datumCorrection hb hs hμ.le hw hl)).val = (0 : H1 Ω) := by + exact (congrArg (fun v : H10 diskOpen => + (transportH10 c.diskMap c.diskMap_inverse_smooth v).val) hz).trans + (congrArg (fun v : H10 (show IsOpen Ω from c.diskMap.open_target) => v.val) + (map_zero (transportH10 c.diskMap c.diskMap_inverse_smooth))) + exact (congrArg (fun U : H1 Ω => + (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hw).toH1+U) ht).trans + (add_zero _) + +lemma scalarSolution_eq_of_helmholtz (hne : Ω.Nonempty) + {w : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) + (hp : ∀ x ∈ Ω, Δ w x = -firstPositiveNeumannValue Ω*w x) : + c.scalarSolution hb hs hμ hw = (smooth_closure_H1 (Ω := Ω) (show IsOpen Ω from c.diskMap.open_target) hb hs hw).toH1 := + c.physicalSolution_eq_of_helmholtz hb hs hμ hne hw hp _ + +lemma scalarSolution_energy (hne : Ω.Nonempty) + {w z : Plane → ℝ} (hw : ContDiffOn ℝ ∞ w (closure Ω)) + (hz : ContDiffOn ℝ ∞ z (closure Ω)) : + let _ : IsFiniteMeasure c.potential := c.potential_finite hb + inner ℝ (H1.grad (c.scalarSolution hb hs hμ hw)) (H1.grad (c.scalarSolution hb hs hμ hz)) - + firstPositiveNeumannValue Ω*inner ℝ (H1.value (c.scalarSolution hb hs hμ hw)) + (H1.value (c.scalarSolution hb hs hμ hz)) = + (1/2:ℝ)*(∫ q : Boundary × Boundary, boundaryInteraction q.1 q.2 * + inner ℝ (w (c.F q.1)-w (c.F q.2)) (z (c.F q.1)-z (c.F q.2)) + ∂boundaryMeasure.prod boundaryMeasure) - + (∫ q : Boundary × Boundary, fullBoundaryR c.densityBound_ne_top (c.density_bound hμ.le) q.1 q.2 * + w (c.F q.1) * z (c.F q.2) ∂boundaryMeasure.prod boundaryMeasure) := + c.physicalSolution_energy hb hs hμ.le hne hμ hw hz _ _ + +end StrictHotSpots.Conformal.ClosedDiskChart +namespace StrictHotSpots + +lemma smoothMul_smooth_closure {Ω : Set Plane} (ho : IsOpen Ω) (hbound : Bornology.IsBounded Ω) + (hs : SmoothBoundary Ω) {b w : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) + (hw : ContDiffOn ℝ ∞ w (closure Ω)) : + H1.smoothMul hb hb0 hb1 (smooth_closure_H1 ho hbound hs hw).toH1 = + (smooth_closure_H1 ho hbound hs (hb.contDiffOn.mul hw)).toH1 := by + apply H1.value_injective ho + apply Lp.ext + filter_upwards [H1.smoothMul_value_ae hb hb0 hb1 (smooth_closure_H1 ho hbound hs hw).toH1, + (smooth_closure_H1 ho hbound hs hw).1.coeFn_toLp, + (smooth_closure_H1 ho hbound hs (hb.contDiffOn.mul hw)).1.coeFn_toLp] with x h1 h2 h3 + exact h1.trans ((congrArg (fun t : ℝ => b x*t) h2).trans h3.symm) + +lemma closed_directional_helmholtz {Ω : Set Plane} (ho : IsOpen Ω) + {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) (e : Plane) {x : Plane} (hx : x ∈ Ω) : + Δ (fun z => fderivWithin ℝ u (closure Ω) z e) x = + -firstPositiveNeumannValue Ω * fderivWithin ℝ u (closure Ω) x e := by + have heq : (fun z => fderivWithin ℝ u (closure Ω) z e) =ᶠ[nhds x] + directionalDerivative u e := + Filter.eventually_of_mem (ho.mem_nhds hx) (fun _ hz => closed_directional_eq ho hz e) + rw [(InnerProductSpace.laplacian_congr_nhds heq).eq_of_nhds,closed_directional_eq ho hx e] + linear_combination eigenfunction_derivative_helmholtz ho hu hx e + +end StrictHotSpots +end +end ActualVectorEnergy + +section ActualBoundaryMultiplier + +noncomputable section +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology InnerProductSpace +namespace StrictHotSpots.PlaneGreen +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +lemma harmonic_multiplier_integral {g : Boundary → E} {b : Boundary → ℝ} {A B : ℝ≥0} + (hg : LipschitzWith A g) (hb : LipschitzWith B b) : + (∫ z : Boundary × Boundary, boundaryInteraction z.1 z.2 * + inner ℝ (b z.1 • g z.1-b z.2 • g z.2) (b z.1 • g z.1-b z.2 • g z.2) + ∂boundaryMeasure.prod boundaryMeasure) - + (∫ z : Boundary × Boundary, boundaryInteraction z.1 z.2 * + inner ℝ (g z.1-g z.2) (b z.1^2 • g z.1-b z.2^2 • g z.2) + ∂boundaryMeasure.prod boundaryMeasure) = + ∫ z : Boundary × Boundary, boundaryInteraction z.1 z.2 * (b z.1-b z.2)^2 * + inner ℝ (g z.1) (g z.2) ∂boundaryMeasure.prod boundaryMeasure := by + obtain ⟨L,hL⟩ := boundary_smul_lipschitz hb hg + obtain ⟨D,hD⟩ := boundary_smul_lipschitz hb hb + have hD' : LipschitzWith D (fun s => b s^2) := by simpa only [smul_eq_mul,pow_two] using hD + obtain ⟨F,hF⟩ := boundary_smul_lipschitz hD' hg + rw [← integral_sub (harmonic_boundary_integrable hL hL) (harmonic_boundary_integrable hg hF)] + apply integral_congr_ae + filter_upwards [] with z + rw [← mul_sub,harmonic_multiplier_algebra,mul_assoc] + +lemma interaction_multiplier_integral {R : Boundary → Boundary → ℝ} + (hR : Integrable (fun z : Boundary × Boundary => R z.1 z.2) (boundaryMeasure.prod boundaryMeasure)) + (hRs : ∀ s t, R s t = R t s) {g : Boundary → E} {b : Boundary → ℝ} + (hg : Continuous g) (hb : Continuous b) : + (∫ z : Boundary × Boundary, R z.1 z.2 * inner ℝ (g z.1) (b z.2^2 • g z.2) + ∂boundaryMeasure.prod boundaryMeasure) - + (∫ z : Boundary × Boundary, R z.1 z.2 * inner ℝ (b z.1 • g z.1) (b z.2 • g z.2) + ∂boundaryMeasure.prod boundaryMeasure) = + (1/2:ℝ) * ∫ z : Boundary × Boundary, R z.1 z.2 * (b z.1-b z.2)^2 * + inner ℝ (g z.1) (g z.2) ∂boundaryMeasure.prod boundaryMeasure := by + let q : Measure (Boundary × Boundary) := boundaryMeasure.prod boundaryMeasure + let f₁ := fun z : Boundary × Boundary => R z.1 z.2 * inner ℝ (b z.1^2 • g z.1) (g z.2) + let f₂ := fun z : Boundary × Boundary => R z.1 z.2 * inner ℝ (g z.1) (b z.2^2 • g z.2) + let f₃ := fun z : Boundary × Boundary => R z.1 z.2 * inner ℝ (b z.1 • g z.1) (b z.2 • g z.2) + have h1 : Integrable f₁ q := interaction_boundary_integrable hR ((hb.pow 2).smul hg) hg + have h2 : Integrable f₂ q := interaction_boundary_integrable hR hg ((hb.pow 2).smul hg) + have h3 : Integrable f₃ q := interaction_boundary_integrable hR (hb.smul hg) (hb.smul hg) + have hswap : (∫ z, f₁ z ∂q) = ∫ z, f₂ z ∂q := by + change (∫ z, f₁ z ∂boundaryMeasure.prod boundaryMeasure) = _ + rw [← integral_prod_swap f₁] + apply integral_congr_ae + filter_upwards [] with z + dsimp [f₁,f₂] + rw [hRs z.2 z.1,real_inner_comm (g z.1) (b z.2^2 • g z.2)] + have he : (fun z : Boundary × Boundary => R z.1 z.2 * (b z.1-b z.2)^2 * inner ℝ (g z.1) (g z.2)) = + fun z => f₁ z+f₂ z-2*f₃ z := by + funext z + dsimp [f₁,f₂,f₃] + simp only [real_inner_smul_left,real_inner_smul_right] + ring + rw [he] + change (∫ z, f₂ z ∂q)-(∫ z, f₃ z ∂q) = (1/2:ℝ)*(∫ z, f₁ z+f₂ z-2*f₃ z ∂q) + have h12 : Integrable (fun z => f₁ z+f₂ z) q := h1.add h2 + rw [integral_sub h12 (h3.const_mul 2),integral_add h1 h2,integral_const_mul,hswap] + ring + +lemma multiplier_integrand_integrable {R : Boundary → Boundary → ℝ} + (hR : Integrable (fun z : Boundary × Boundary => R z.1 z.2) (boundaryMeasure.prod boundaryMeasure)) + {g : Boundary → E} {b : Boundary → ℝ} {A B : ℝ≥0} + (hg : LipschitzWith A g) (hb : LipschitzWith B b) : + Integrable (fun z : Boundary × Boundary => (boundaryInteraction z.1 z.2+R z.1 z.2) * + (b z.1-b z.2)^2 * inner ℝ (g z.1) (g z.2)) (boundaryMeasure.prod boundaryMeasure) := by + obtain ⟨L,hL⟩ := boundary_smul_lipschitz hb hg + obtain ⟨D,hD⟩ := boundary_smul_lipschitz hb hb + have hD' : LipschitzWith D (fun s => b s^2) := by simpa only [smul_eq_mul,pow_two] using hD + obtain ⟨F,hF⟩ := boundary_smul_lipschitz hD' hg + have h0 := (harmonic_boundary_integrable hL hL).sub (harmonic_boundary_integrable hg hF) + have h1 := interaction_boundary_integrable hR hF.continuous hg.continuous + have h2 := interaction_boundary_integrable hR hg.continuous hF.continuous + have h3 := interaction_boundary_integrable hR hL.continuous hL.continuous + apply (h0.add ((h1.add h2).sub (h3.const_mul 2))).congr + filter_upwards [] with z + simp only [Pi.add_apply,Pi.sub_apply] + rw [← mul_sub,harmonic_multiplier_algebra] + simp only [real_inner_smul_left,real_inner_smul_right] + ring + + +theorem boundaryForm_multiplier_difference {R : Boundary → Boundary → ℝ} {c : Boundary → ℝ} + (hR : Integrable (fun z : Boundary × Boundary => R z.1 z.2) (boundaryMeasure.prod boundaryMeasure)) + (hRs : ∀ s t, R s t = R t s) + {g : Boundary → E} {b : Boundary → ℝ} {A B : ℝ≥0} + (hg : LipschitzWith A g) (hb : LipschitzWith B b) : + boundaryForm R c (fun s => b s • g s) (fun s => b s • g s) - + boundaryForm R c g (fun s => b s^2 • g s) = + (1/2:ℝ) * ∫ z : Boundary × Boundary, (boundaryInteraction z.1 z.2+R z.1 z.2) * + (b z.1-b z.2)^2 * inner ℝ (g z.1) (g z.2) ∂boundaryMeasure.prod boundaryMeasure := by + have hcurv : (∫ s, c s * inner ℝ (b s • g s) (b s • g s) ∂boundaryMeasure) = + ∫ s, c s * inner ℝ (g s) (b s^2 • g s) ∂boundaryMeasure := by + apply integral_congr_ae + filter_upwards [] with s + simp only [real_inner_smul_left,real_inner_smul_right] + ring + obtain ⟨L,hL⟩ := boundary_smul_lipschitz hb hg + obtain ⟨D,hD⟩ := boundary_smul_lipschitz hb hb + have hD' : LipschitzWith D (fun s => b s^2) := by simpa only [smul_eq_mul,pow_two] using hD + obtain ⟨F,hF⟩ := boundary_smul_lipschitz hD' hg + have h0 : Integrable (fun z : Boundary × Boundary => boundaryInteraction z.1 z.2 * + (b z.1-b z.2)^2 * inner ℝ (g z.1) (g z.2)) (boundaryMeasure.prod boundaryMeasure) := by + apply ((harmonic_boundary_integrable hL hL).sub (harmonic_boundary_integrable hg hF)).congr + filter_upwards [] with z + simp only [Pi.sub_apply] + rw [← mul_sub,harmonic_multiplier_algebra,mul_assoc] + have h1 : Integrable (fun z : Boundary × Boundary => R z.1 z.2 * + (b z.1-b z.2)^2 * inner ℝ (g z.1) (g z.2)) (boundaryMeasure.prod boundaryMeasure) := by + have := (multiplier_integrand_integrable hR hg hb).sub h0 + apply this.congr + filter_upwards [] with z + simp only [Pi.sub_apply] + ring + have he : (fun z : Boundary × Boundary => (boundaryInteraction z.1 z.2+R z.1 z.2) * + (b z.1-b z.2)^2 * inner ℝ (g z.1) (g z.2)) = + fun z => boundaryInteraction z.1 z.2*(b z.1-b z.2)^2*inner ℝ (g z.1) (g z.2) + + R z.1 z.2*(b z.1-b z.2)^2*inner ℝ (g z.1) (g z.2) := by + funext z; ring + rw [he,integral_add h0 h1] + have hh := harmonic_multiplier_integral hg hb + have hi := interaction_multiplier_integral hR hRs hg.continuous hb.continuous + unfold boundaryForm + rw [hcurv] + linarith + +end StrictHotSpots.PlaneGreen +end +end ActualBoundaryMultiplier + +section SmoothPhysicalMultiplier + +noncomputable section +open Set MeasureTheory Filter +open scoped ContDiff InnerProductSpace ENNReal NNReal +namespace StrictHotSpots.Conformal.ClosedDiskChart +open DiskH10 PlaneGreen Hodge +variable {Ω : Set Plane} (c : ClosedDiskChart Ω) (hΩ : AdmissibleDomain Ω) +variable {u : Plane → ℝ} (hu : InFirstNeumannEigenspace Ω u) +variable (hμ : 0 < firstPositiveNeumannValue Ω) + + + +def multipliedGradient {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) : Fin 2 → H1 Ω := fun i => + c.scalarSolution hΩ.2.2.1 hΩ.2.2.2.2 hμ + (hb.contDiffOn.mul (closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 (Hodge.e i))) + +lemma multipliedGradient_class {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) + (i : Fin 2) : ∃ w : H10 hΩ.2.1, + c.multipliedGradient hΩ hu hμ hb i-H1.smoothMul hb hb0 hb1 (eigenGradientField hΩ hu i)=w.val := by + have he := smoothMul_smooth_closure hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 hb hb0 hb1 + (closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 (Hodge.e i)) + exact he.symm ▸ c.scalarSolution_class hΩ.2.2.1 hΩ.2.2.2.2 hμ + (hb.contDiffOn.mul (closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 (Hodge.e i))) + +lemma multipliedGradient_square_class {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) + (i : Fin 2) : ∃ w : H10 hΩ.2.1, + c.multipliedGradient hΩ hu hμ (hb.mul hb) i- + H1.smoothMul hb hb0 hb1 (H1.smoothMul hb hb0 hb1 (eigenGradientField hΩ hu i))=w.val := by + let hw := closure_directional_smooth hΩ.2.1 hΩ.2.2.2.2 hu.1 (Hodge.e i) + have h1 := smoothMul_smooth_closure hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 hb hb0 hb1 hw + have h2 := smoothMul_smooth_closure hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 hb hb0 hb1 (hb.contDiffOn.mul hw) + have h3 : (fun x => b x*(b x*fderivWithin ℝ u (closure Ω) x (Hodge.e i))) = + (fun x => (b x*b x)*fderivWithin ℝ u (closure Ω) x (Hodge.e i)) := by funext x; ring + have he : H1.smoothMul hb hb0 hb1 (H1.smoothMul hb hb0 hb1 (eigenGradientField hΩ hu i)) = + (smooth_closure_H1 hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 ((hb.contDiffOn.mul hb.contDiffOn).mul hw)).toH1 := by + apply H1.value_injective hΩ.2.1 + change H1.value (H1.smoothMul hb hb0 hb1 (H1.smoothMul hb hb0 hb1 + (smooth_closure_H1 hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 hw).toH1)) = _ + rw [h1,h2] + apply Lp.ext + filter_upwards [(smooth_closure_H1 hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 (hb.contDiffOn.mul (hb.contDiffOn.mul hw))).1.coeFn_toLp, + (smooth_closure_H1 hΩ.2.1 hΩ.2.2.1 hΩ.2.2.2.2 ((hb.contDiffOn.mul hb.contDiffOn).mul hw)).1.coeFn_toLp] + with x hx hy + exact hx.trans ((congrFun h3 x).trans hy.symm) + exact he.symm ▸ c.scalarSolution_class hΩ.2.2.1 hΩ.2.2.2.2 hμ + ((hb.contDiffOn.mul hb.contDiffOn).mul hw) + + + +theorem multipliedGradient_identity {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) : + vectorForm (firstPositiveNeumannValue Ω) (c.multipliedGradient hΩ hu hμ hb) + (c.multipliedGradient hΩ hu hμ hb) = + cartesianForm (firstPositiveNeumannValue Ω) (c.multipliedGradient hΩ hu hμ hb) + (c.multipliedGradient hΩ hu hμ hb)- + cartesianForm (firstPositiveNeumannValue Ω) (eigenGradientField hΩ hu) + (c.multipliedGradient hΩ hu hμ (hb.mul hb)) := by + obtain ⟨L,_hL,hLμ,hD⟩ := H10.subcritical hΩ.2.1 hΩ.1 hΩ.2.2.1 + have hp := vectorForm_nonneg hΩ.2.1 hΩ.1 hΩ.2.2.2.1 hΩ.2.2.1 hμ hLμ hD + exact boundaryClass_multiplier_identity hΩ.2.1 hb hb0 hb1 _ _ _ _ + (eigenGradientField_null hΩ hu).1 + (c.multipliedGradient_class hΩ hu hμ hb hb0 hb1) + (c.multipliedGradient_square_class hΩ hu hμ hb hb0 hb1) hp + (eigenGradientField_null hΩ hu).2 + +lemma multipliedGradient_tangent {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) : + TangentWeak (c.multipliedGradient hΩ hu hμ hb) := + TangentWeak.of_class hΩ.2.1 ((eigenGradientField_null hΩ hu).1.smoothMul hb hb0 hb1) + (c.multipliedGradient_class hΩ hu hμ hb hb0 hb1) + +lemma multipliedGradient_nonneg {b : Plane → ℝ} (hb : ContDiff ℝ ∞ b) + (hb0 : MemLp b ∞ (volume.restrict Ω)) (hb1 : MemLp (gradient b) ∞ (volume.restrict Ω)) : + 0 ≤ vectorForm (firstPositiveNeumannValue Ω) (c.multipliedGradient hΩ hu hμ hb) + (c.multipliedGradient hΩ hu hμ hb) := by + obtain ⟨L,_hL,hLμ,hD⟩ := H10.subcritical hΩ.2.1 hΩ.1 hΩ.2.2.1 + exact vectorForm_nonneg hΩ.2.1 hΩ.1 hΩ.2.2.2.1 hΩ.2.2.1 hμ hLμ hD _ + (c.multipliedGradient_tangent hΩ hu hμ hb hb0 hb1) + +end StrictHotSpots.Conformal.ClosedDiskChart +end +end SmoothPhysicalMultiplier + + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones.lean b/lean/OAI/Analysis/HyperbolicCones.lean new file mode 100644 index 0000000000000000000000000000000000000000..644e8b9aa9b13cb5409f2c1688933284503f395f --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones.lean @@ -0,0 +1,17 @@ +import OAI.Analysis.HyperbolicCones.Main +import OAI.Analysis.HyperbolicCones.Form +import OAI.Analysis.HyperbolicCones.RootFactorization +import OAI.Analysis.HyperbolicCones.ConeOpen +import OAI.Analysis.HyperbolicCones.InverseBounds +import OAI.Analysis.HyperbolicCones.LeastEigenvalue +import OAI.Analysis.HyperbolicCones.NormBounds +import OAI.Analysis.HyperbolicCones.MaxEigenvalue +import OAI.Analysis.HyperbolicCones.RankInverse +import OAI.Analysis.HyperbolicCones.TangentExpansion +import OAI.Analysis.HyperbolicCones.ConstantRank +import OAI.Analysis.HyperbolicCones.RankQuadratics +import OAI.Analysis.HyperbolicCones.ResolventFormula +import OAI.Analysis.HyperbolicCones.ResolventPositive +import OAI.Analysis.HyperbolicCones.TangentFigure + +/-! A nonspectrahedral hyperbolicity cone and real-zero quadratic deformations. -/ diff --git a/lean/OAI/Analysis/HyperbolicCones/BlockNormalization.lean b/lean/OAI/Analysis/HyperbolicCones/BlockNormalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..90be38000fdc13c610b3a76058be4d3596dc5d84 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/BlockNormalization.lean @@ -0,0 +1,48 @@ +import OAI.Analysis.HyperbolicCones.RawBlocks +import OAI.Analysis.HyperbolicCones.CongruenceMaps + +namespace OAI + +/-! Fixed positive-definite diagonal congruence makes both positive maps unital. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix Set +namespace Paper256 + +noncomputable def RawBlockPencil.normalize {K : Set Ambient} (P : RawBlockPencil K) : + BlockPencil K := by + let S := inverseSquareRoot (P.D 1) + let T := inverseSquareRoot (P.E 1) + refine { + a := P.a + c := P.c + a_pos := P.a_pos + c_pos := P.c_pos + D := (congruenceSym S).comp P.D + E := (congruenceSym T).comp P.E + F := (congruenceSym S).comp P.F + C := (congruenceRect S T).comp P.C + A := (congruenceSym S).comp P.A + B := (congruenceRect S T).comp P.B + G := (congruenceSym T).comp P.G + D_positive := fun X hX => congruenceSym_positive S (P.D X) (P.D_positive X hX) + E_positive := fun Z hZ => congruenceSym_positive T (P.E Z) (P.E_positive Z hZ) + D_unital := congruenceSym_inverseSquareRoot_self (P.D 1) P.D_identity_posDef + E_unital := congruenceSym_inverseSquareRoot_self (P.E 1) P.E_identity_posDef + represents := ?_ } + intro X Z y + rw [P.represents] + have h := block_congruence_posSemidef_iff S T + (inverseSquareRoot_isUnit (P.D 1) P.D_identity_posDef) + (inverseSquareRoot_isUnit (P.E 1) P.E_identity_posDef) + ((P.D X : Mat P.a ℝ) + (P.F Z : Mat P.a ℝ) + (P.A y : Mat P.a ℝ)) + (P.C Z + P.B y) ((P.E Z : Mat P.c ℝ) + (P.G y : Mat P.c ℝ)) + simpa only [LinearMap.comp_apply, congruenceSym_val, congruenceRect_apply, + Matrix.mul_add, Matrix.add_mul] using h.symm + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/BlockReduction.lean b/lean/OAI/Analysis/HyperbolicCones/BlockReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..47edfcb067006b8515a686a75c24a30b24dd792e --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/BlockReduction.lean @@ -0,0 +1,46 @@ +import OAI.Analysis.HyperbolicCones.PencilBlocks +import OAI.Analysis.HyperbolicCones.RescalingBasic + +namespace OAI + +noncomputable section + +open Set Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256.BlockPencil + +theorem G_eq_zero {K : Set Ambient} (P : BlockPencil K) + (hSlice : ∀ (X Z : Sym 4) (y : Fin 3 → ℝ), (X : Mat 4 ℝ).PosDef → + (((X, Z), y) ∈ K ↔ ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef)) + (y : Fin 3 → ℝ) : P.G y = 0 := by + let Z0 : Sym 4 := ⟨phi y (1 : Mat 4 ℝ), phi_isHermitian y 1 Matrix.isHermitian_one⟩ + apply linear_term_zero_of_quadratic_posSemidef (P.E Z0) (P.G y) + intro s + have hm : (((1, s ^ 2 • Z0), s • y) : Ambient) ∈ K := by + apply (hSlice 1 (s ^ 2 • Z0) (s • y) Matrix.PosDef.one).mpr + simp [Z0, phi_scaling] + exact Matrix.PosSemidef.zero + have hp := (P.represents 1 (s ^ 2 • Z0) (s • y)).mp hm + have hb := hp.submatrix Sum.inr + convert hb using 1 + ext i j + simp [Matrix.submatrix, Matrix.fromBlocks] + +theorem scaled_isHermitian {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) (s : ℝ) : (P.scaled X Z y s).IsHermitian := by + apply Matrix.IsHermitian.fromBlocks + · exact ((P.D X).property.add ((IsSelfAdjoint.all s).smul (P.A y).property)).add + ((IsSelfAdjoint.all (s ^ 2)).smul (P.F Z).property) + · simp + · exact (P.E Z).property + +theorem scaled_zero {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) : P.scaled X Z y 0 = P.limit X Z y := by + simp [scaled, limit] + +end Paper256.BlockPencil + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/BlockScaling.lean b/lean/OAI/Analysis/HyperbolicCones/BlockScaling.lean new file mode 100644 index 0000000000000000000000000000000000000000..8febd5b898509543f862820ff8b54304d4cd3936 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/BlockScaling.lean @@ -0,0 +1,52 @@ +import OAI.Analysis.HyperbolicCones.BlockReduction +import OAI.Analysis.HyperbolicCones.ScalingAlgebra + +namespace OAI + +noncomputable section + +open Matrix Set +open scoped Matrix.Norms.L2Operator + +namespace Paper256.BlockPencil + +theorem scaled_congruence {K : Set Ambient} (P : BlockPencil K) + (hSlice : ∀ (X Z : Sym 4) (y : Fin 3 → ℝ), (X : Mat 4 ℝ).PosDef → + (((X, Z), y) ∈ K ↔ ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef)) + (X Z : Sym 4) (y : Fin 3 → ℝ) (s : ℝ) (hs : s ≠ 0) : + blockScalar P.a P.c s⁻¹ * P.matrix X (s ^ 2 • Z) (s • y) * blockScalar P.a P.c s⁻¹ = + P.scaled X Z y s := by + have hG := P.G_eq_zero hSlice y + simpa [matrix, scaled, hG] using + block_scaling_identity (P.D X : Mat P.a ℝ) (P.A y : Mat P.a ℝ) + (P.F Z : Mat P.a ℝ) (P.B y) (P.C Z) (P.E Z : Mat P.c ℝ) s hs + +theorem scaled_posSemidef_iff {K : Set Ambient} (P : BlockPencil K) + (hSlice : ∀ (X Z : Sym 4) (y : Fin 3 → ℝ), (X : Mat 4 ℝ).PosDef → + (((X, Z), y) ∈ K ↔ ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef)) + (X Z : Sym 4) (y : Fin 3 → ℝ) (hX : (X : Mat 4 ℝ).PosDef) (s : ℝ) (hs : s ≠ 0) : + (P.scaled X Z y s).PosSemidef ↔ + ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef := by + let R := blockScalar P.a P.c s⁻¹ + have hR : IsUnit R := blockScalar_isUnit P.a P.c s⁻¹ (inv_ne_zero hs) + have hRt : Rᴴ = R := by + simpa only [Matrix.conjTranspose_eq_transpose_of_trivial] using + blockScalar_transpose P.a P.c s⁻¹ + calc + (P.scaled X Z y s).PosSemidef ↔ (P.matrix X (s ^ 2 • Z) (s • y)).PosSemidef := by + rw [← P.scaled_congruence hSlice X Z y s hs] + simpa only [Matrix.star_eq_conjTranspose, hRt] using + hR.posSemidef_star_right_conjugate_iff (x := P.matrix X (s ^ 2 • Z) (s • y)) + _ ↔ (((X, s ^ 2 • Z), s • y) : Ambient) ∈ K := + (P.represents X (s ^ 2 • Z) (s • y)).symm + _ ↔ (s ^ 2 • ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹)).PosSemidef := by + rw [hSlice X (s ^ 2 • Z) (s • y) hX] + simp only [selfAdjoint.val_smul, phi_scaling, smul_sub] + _ ↔ ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef := by + exact posSemidef_smul_iff (sq_pos_of_ne_zero hs) + +end Paper256.BlockPencil + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ComplexPositive.lean b/lean/OAI/Analysis/HyperbolicCones/ComplexPositive.lean new file mode 100644 index 0000000000000000000000000000000000000000..0740d20662dbec73fd929a9c0cbc2bb39d8c1def --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ComplexPositive.lean @@ -0,0 +1,100 @@ +import OAI.Analysis.HyperbolicCones.MatrixComplex +import OAI.Analysis.HyperbolicCones.FormPositive + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix.Norms.L2Operator MatrixOrder ComplexOrder +open Matrix + +universe u + +namespace Paper256 + +theorem qMatrix_transpose {R : Type u} [CommRing R] (y : Fin 3 → R) : + (qMatrix y)ᵀ = qMatrix y := by + ext i j + by_cases h : i = j + · subst j; rfl + · simp [qMatrix, h, Ne.symm h, mul_comm] + +theorem phi_transpose {R : Type u} [CommRing R] (y : Fin 3 → R) (X : Mat 4 R) : + phi y Xᵀ = (phi y X)ᵀ := by + have hQ (i j : Fin 3) : qMatrix y j i = qMatrix y i j := + congrFun (congrFun (qMatrix_transpose y) i) j + ext i j + refine Fin.cases ?_ (fun i => ?_) i <;> + refine Fin.cases ?_ (fun j => ?_) j + · change Matrix.trace (qMatrix y * (X.submatrix Fin.succ Fin.succ)ᵀ) = + Matrix.trace (qMatrix y * X.submatrix Fin.succ Fin.succ) + conv_lhs => rw [← qMatrix_transpose y] + rw [← Matrix.transpose_mul, Matrix.trace_transpose, Matrix.trace_mul_comm] + · simp only [phi, Fin.cases_zero, Fin.cases_succ, Matrix.transpose_apply] + congr 1 + apply Finset.sum_congr rfl + intro k _ + rw [hQ] + ring + · simp only [phi, Fin.cases_zero, Fin.cases_succ, Matrix.transpose_apply] + congr 1 + apply Finset.sum_congr rfl + intro k _ + rw [hQ] + ring + · simp only [phi, Fin.cases_succ, Matrix.transpose_apply] + rw [hQ] + +theorem phi_conjTranspose (y : Fin 3 → ℝ) (X : Mat 4 ℂ) : + (phi (fun i => (y i : ℂ)) X)ᴴ = phi (fun i => (y i : ℂ)) Xᴴ := by + change ((phi (fun i => (y i : ℂ)) X)ᵀ).map (starRingEnd ℂ) = _ + rw [← phi_transpose, phi_map] + have hy : (fun i => (starRingEnd ℂ) (y i : ℂ)) = (fun i => (y i : ℂ)) := + funext fun i => Complex.conj_ofReal (y i) + rw [hy] + rfl + +theorem phi_complex_rank_one (y : Fin 3 → ℝ) (u v : Fin 4 → ℂ) : + dotProduct (star u) + (phi (fun i => (y i : ℂ)) (vecMulVec v (star v)) *ᵥ u) = + dotProduct (star (fun i : Fin 3 => v 0 * u i.succ - u 0 * v i.succ)) + (qMatrix (fun i => (y i : ℂ)) *ᵥ + (fun i : Fin 3 => v 0 * u i.succ - u 0 * v i.succ)) := by + simp [dotProduct, mulVec, phi, qMatrix, Matrix.trace, Matrix.mul_apply, + Matrix.submatrix, vecMulVec, Fin.sum_univ_succ] + ring + +theorem phi_complex_outer_posSemidef (y : Fin 3 → ℝ) (v : Fin 4 → ℂ) : + (phi (fun i => (y i : ℂ)) (vecMulVec v (star v))).PosSemidef := by + have hq : (qMatrix (fun i => (y i : ℂ))).PosSemidef := by + have h := posSemidef_complexify (qMatrix y) (qMatrix_posSemidef y) + change ((qMatrix y).map (algebraMap ℝ ℂ)).PosSemidef at h + rw [qMatrix_map] at h + exact h + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg + · show (phi (fun i => (y i : ℂ)) (vecMulVec v (star v)))ᴴ = _ + rw [phi_conjTranspose, (posSemidef_vecMulVec_self_star v).isHermitian.eq] + · intro u + rw [phi_complex_rank_one] + exact hq.dotProduct_mulVec_nonneg _ + +theorem phi_complex_posSemidef (y : Fin 3 → ℝ) (X : Mat 4 ℂ) (hX : X.PosSemidef) : + (phi (fun i => (y i : ℂ)) X).PosSemidef := by + obtain ⟨B, hB⟩ := CStarAlgebra.nonneg_iff_eq_star_mul_self.mp hX.nonneg + have hx : X = ∑ i, vecMulVec (star (B i)) (B i) := by + rw [hB] + ext i j + simp [Matrix.mul_apply, Matrix.sum_apply, vecMulVec] + rw [hx] + change ((phiLinear (fun i => (y i : ℂ))) (∑ i, vecMulVec (star (B i)) (B i))).PosSemidef + rw [map_sum] + apply Matrix.posSemidef_sum + intro i _ + change (phi (fun i => (y i : ℂ)) (vecMulVec (star (B i)) (B i))).PosSemidef + simpa only [star_star] using phi_complex_outer_posSemidef y (star (B i)) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/CompressionBasic.lean b/lean/OAI/Analysis/HyperbolicCones/CompressionBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd9d5b41825435d81630ec0b6ebf5c7ffa3a65f8 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/CompressionBasic.lean @@ -0,0 +1,57 @@ +import OAI.Analysis.HyperbolicCones.MatrixLinear + +namespace OAI + +noncomputable section + +open Matrix + +universe u v + +namespace Paper256 + +theorem posSemidef_fromBlocks_diagonal_iff {ι : Type u} {κ : Type v} [Fintype ι] [Fintype κ] + (A : Matrix ι ι ℝ) (B : Matrix κ κ ℝ) : + (Matrix.fromBlocks A 0 0 B).PosSemidef ↔ A.PosSemidef ∧ B.PosSemidef := by + constructor + · intro h + constructor + · convert h.submatrix Sum.inl using 1 + ext i j + rfl + · convert h.submatrix Sum.inr using 1 + ext i j + rfl + · rintro ⟨hA, hB⟩ + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg + (Matrix.IsHermitian.fromBlocks hA.isHermitian (by simp) hB.isHermitian) + intro v + have ha := hA.dotProduct_mulVec_nonneg (v ∘ Sum.inl) + have hb := hB.dotProduct_mulVec_nonneg (v ∘ Sum.inr) + simpa [Matrix.fromBlocks_mulVec, dotProduct, Fintype.sum_sum_type] using add_nonneg ha hb + +theorem matrix_compression_posSemidef_iff {ι : Type u} [Fintype ι] + (p : ι → Prop) [DecidablePred p] (M : Matrix ι ι ℝ) (hM : M.IsHermitian) + (hzero : ∀ i, ¬p i → ∀ j, M i j = 0) : + M.PosSemidef ↔ (M.submatrix (Subtype.val : {i // p i} → ι) Subtype.val).PosSemidef := by + let e := Equiv.sumCompl p + have heq : M.submatrix e e = Matrix.fromBlocks + (M.submatrix (Subtype.val : {i // p i} → ι) Subtype.val) 0 0 0 := by + ext (i | i) (j | j) + · rfl + · change M i.val j.val = 0 + have hs : M i.val j.val = M j.val i.val := by simpa using hM.apply j.val i.val + rw [hs, hzero j.val j.property] + · exact hzero i.val i.property j.val + · exact hzero i.val i.property j.val + calc + M.PosSemidef ↔ (M.submatrix e e).PosSemidef := (Matrix.posSemidef_submatrix_equiv e).symm + _ ↔ (M.submatrix (Subtype.val : {i // p i} → ι) Subtype.val).PosSemidef := by + rw [heq, posSemidef_fromBlocks_diagonal_iff] + simp only [Matrix.PosSemidef.zero, and_true] + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ConeContinuity.lean b/lean/OAI/Analysis/HyperbolicCones/ConeContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a2e09c5b31ca8392774f319a8dd4b2c1c7a6eb6 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ConeContinuity.lean @@ -0,0 +1,50 @@ +import OAI.Analysis.HyperbolicCones.ConeMatrix + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +theorem continuous_qMatrix : Continuous (qMatrix : (Fin 3 → ℝ) → Mat 3 ℝ) := by + apply continuous_pi + intro i + apply continuous_pi + intro j + by_cases h : i = j + · simp only [qMatrix, ite_eq_left h] + fun_prop + · simp only [qMatrix, ite_eq_right h] + fun_prop + +theorem continuous_phi : + Continuous (fun z : (Fin 3 → ℝ) × Mat 4 ℝ => phi z.1 z.2) := by + have hq : Continuous (fun z : (Fin 3 → ℝ) × Mat 4 ℝ => qMatrix z.1) := + continuous_qMatrix.comp continuous_fst + apply continuous_pi + intro i + apply continuous_pi + intro j + refine Fin.cases ?_ (fun i => ?_) i <;> + refine Fin.cases ?_ (fun j => ?_) j <;> + simp only [phi, Fin.cases_zero, Fin.cases_succ, Matrix.trace, + Matrix.submatrix] <;> fun_prop + +theorem continuous_phiSym_joint : + Continuous (fun z : (Fin 3 → ℝ) × Sym 4 => phiSym z.1 z.2) := by + let f : (Fin 3 → ℝ) × Sym 4 → (Fin 3 → ℝ) × Mat 4 ℝ := + fun z => (z.1, (z.2 : Mat 4 ℝ)) + have hf : Continuous f := continuous_fst.prodMk + (continuous_subtype_val.comp continuous_snd) + have hc : Continuous (fun z : (Fin 3 → ℝ) × Sym 4 => phi z.1 (z.2 : Mat 4 ℝ)) := + continuous_phi.comp (f := f) hf + exact hc.subtype_mk (fun z => phi_isHermitian z.1 (z.2 : Mat 4 ℝ) z.2.property) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ConeInterior.lean b/lean/OAI/Analysis/HyperbolicCones/ConeInterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8a4eecc1df2889153a0aaaa25fdb0423c507ee9 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ConeInterior.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.HyperbolicCones.ConePositive +import OAI.Analysis.HyperbolicCones.ConeContinuity + +namespace OAI + +noncomputable section + +open Set Filter Matrix +open scoped Topology Matrix.Norms.L2Operator + +namespace Paper256 + +theorem basePoint_mem_interior_cone : basePoint ∈ interior cone := by + let R : Ambient → Sym 4 := fun x => x.1.2 - phiSym x.2 (symInverse x.1.1) + have hX : Continuous (fun x : Ambient => x.1.1) := continuous_fst.fst + have hZ : Continuous (fun x : Ambient => x.1.2) := continuous_fst.snd + have hY : Continuous (fun x : Ambient => x.2) := continuous_snd + have hInv : ContinuousAt (fun x : Ambient => symInverse x.1.1) basePoint := + (continuousAt_symInverse (1 : Sym 4) Matrix.PosDef.one.isUnit).comp + (f := fun x : Ambient => x.1.1) (x := basePoint) hX.continuousAt + have hPhi : ContinuousAt (fun x : Ambient => phiSym x.2 (symInverse x.1.1)) basePoint := + continuous_phiSym_joint.continuousAt.comp + (f := fun x : Ambient => (x.2, symInverse x.1.1)) (x := basePoint) + (hY.continuousAt.prodMk hInv) + have hR : ContinuousAt R basePoint := hZ.continuousAt.sub hPhi + have hRone : R basePoint = 1 := by + apply Subtype.ext + change (1 : Mat 4 ℝ) - phi (0 : Fin 3 → ℝ) (1 : Mat 4 ℝ)⁻¹ = 1 + rw [phi_zero_parameter, sub_zero] + have hN : ∀ᶠ H : Sym 4 in 𝓝 (1 : Sym 4), (H : Mat 4 ℝ).PosDef := + (isOpen_posDef 4).mem_nhds Matrix.PosDef.one + have heX : ∀ᶠ x : Ambient in 𝓝 basePoint, (x.1.1 : Mat 4 ℝ).PosDef := by + have hxat : ContinuousAt (fun x : Ambient => x.1.1) basePoint := hX.continuousAt + exact hxat.eventually hN + have heR : ∀ᶠ x : Ambient in 𝓝 basePoint, (R x : Mat 4 ℝ).PosDef := by + have hRN : ∀ᶠ H : Sym 4 in 𝓝 (R basePoint), (H : Mat 4 ℝ).PosDef := by + rw [hRone] + exact hN + have h := hR.eventually hRN + exact h + rw [mem_interior_iff_mem_nhds] + filter_upwards [heX, heR] with x hx hr + exact (cone_positive_slice x.1.1 x.1.2 x.2 hx).mpr hr.posSemidef + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ConeMatrix.lean b/lean/OAI/Analysis/HyperbolicCones/ConeMatrix.lean new file mode 100644 index 0000000000000000000000000000000000000000..47b1011ffe10a04cd727636d02f953e79d39c2f8 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ConeMatrix.lean @@ -0,0 +1,58 @@ +import OAI.Analysis.HyperbolicCones.MatrixPositive + +namespace OAI + +noncomputable section + +open Set Filter Matrix +open scoped Topology Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +def symInverse {n : ℕ} (X : Sym n) : Sym n := + ⟨(X : Mat n ℝ)⁻¹, Matrix.IsHermitian.inv X.property⟩ + +def phiSym (y : Fin 3 → ℝ) (X : Sym 4) : Sym 4 := + ⟨phi y (X : Mat 4 ℝ), phi_isHermitian y _ X.property⟩ + +def coneResidual (X Z : Sym 4) (y : Fin 3 → ℝ) (t : ℝ) : Sym 4 := + Z + t • 1 - phiSym y (symInverse (X + t • 1)) + +theorem continuousAt_symInverse {n : ℕ} (X : Sym n) + (hX : IsUnit (X : Mat n ℝ)) : ContinuousAt symInverse X := by + have hd : (X : Mat n ℝ).det ≠ 0 := + ((Matrix.isUnit_iff_isUnit_det _).mp hX).ne_zero + have hi : ContinuousAt Inv.inv (X : Mat n ℝ) := + continuousAt_matrix_inv _ (by + simpa only [Ring.inverse_eq_inv'] using (continuousAt_inv₀ hd)) + apply tendsto_subtype_rng.mpr + exact hi.comp (f := fun H : Sym n => (H : Mat n ℝ)) (x := X) + continuous_subtype_val.continuousAt + +theorem continuous_phiSym (y : Fin 3 → ℝ) : Continuous (phiSym y) := by + exact ((phiLinear y).continuous_of_finiteDimensional.comp continuous_subtype_val).subtype_mk _ + +theorem positive_shift {n : ℕ} (X : Sym n) (hX : (X : Mat n ℝ).PosDef) + (t : ℝ) (ht : 0 ≤ t) : ((X + t • 1 : Sym n) : Mat n ℝ).PosDef := + hX.add_posSemidef (Matrix.PosSemidef.one.smul ht) + +theorem continuousAt_coneResidual (X Z : Sym 4) (y : Fin 3 → ℝ) (t : ℝ) + (ht : ((X + t • 1 : Sym 4) : Mat 4 ℝ).PosDef) : + ContinuousAt (coneResidual X Z y) t := by + have hX : Continuous (fun s : ℝ => X + s • (1 : Sym 4)) := by fun_prop + have hZ : Continuous (fun s : ℝ => Z + s • (1 : Sym 4)) := by fun_prop + have hi : ContinuousAt (fun s : ℝ => symInverse (X + s • (1 : Sym 4))) t := + (continuousAt_symInverse _ ht.isUnit).comp + (f := fun s : ℝ => X + s • (1 : Sym 4)) hX.continuousAt + exact hZ.continuousAt.sub ((continuous_phiSym y).continuousAt.comp hi) + +theorem continuousOn_coneResidual (X Z : Sym 4) (y : Fin 3 → ℝ) + (hX : (X : Mat 4 ℝ).PosDef) : ContinuousOn (coneResidual X Z y) (Ici 0) := by + intro t ht + exact (continuousAt_coneResidual X Z y t (positive_shift X hX t ht)).continuousWithinAt + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ConeOpen.lean b/lean/OAI/Analysis/HyperbolicCones/ConeOpen.lean new file mode 100644 index 0000000000000000000000000000000000000000..689f358898d2bf3455a0e8569d750c00d33d67f8 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ConeOpen.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.HyperbolicCones.ConePositive +import OAI.Analysis.HyperbolicCones.ConeContinuity + +namespace OAI + +noncomputable section + +open Set Filter Matrix +open scoped Topology Matrix.Norms.L2Operator + +namespace Paper256 + +def ambientResidual (x : Ambient) : Sym 4 := x.1.2 - phiSym x.2 (symInverse x.1.1) + +theorem continuousAt_ambientResidual (x : Ambient) (hX : (x.1.1 : Mat 4 ℝ).PosDef) : + ContinuousAt ambientResidual x := by + have hfirst : Continuous (fun z : Ambient => z.1.1) := continuous_fst.fst + have hsecond : Continuous (fun z : Ambient => z.1.2) := continuous_fst.snd + have hy : Continuous (fun z : Ambient => z.2) := continuous_snd + have hi : ContinuousAt (fun z : Ambient => symInverse z.1.1) x := + (continuousAt_symInverse x.1.1 hX.isUnit).comp + (f := fun z : Ambient => z.1.1) (x := x) hfirst.continuousAt + have hp : ContinuousAt (fun z : Ambient => phiSym z.2 (symInverse z.1.1)) x := + continuous_phiSym_joint.continuousAt.comp + (f := fun z : Ambient => (z.2, symInverse z.1.1)) (x := x) + (hy.continuousAt.prodMk hi) + exact hsecond.continuousAt.sub hp + +theorem isOpen_strict_positive_slice : + IsOpen {x : Ambient | (x.1.1 : Mat 4 ℝ).PosDef ∧ + (ambientResidual x : Mat 4 ℝ).PosDef} := by + apply isOpen_iff_mem_nhds.mpr + intro x hx + have hf : ContinuousAt (fun z : Ambient => z.1.1) x := + (continuous_fst.fst : Continuous (fun z : Ambient => z.1.1)).continuousAt + have hNX : ∀ᶠ H : Sym 4 in 𝓝 x.1.1, (H : Mat 4 ℝ).PosDef := + (isOpen_posDef 4).mem_nhds hx.1 + have hNR : ∀ᶠ H : Sym 4 in 𝓝 (ambientResidual x), (H : Mat 4 ℝ).PosDef := + (isOpen_posDef 4).mem_nhds hx.2 + have heX := hf.eventually hNX + have heR := (continuousAt_ambientResidual x hx.1).eventually hNR + filter_upwards [heX, heR] with z hz hr + exact ⟨hz, hr⟩ + +theorem strict_positive_slice_subset_cone : + {x : Ambient | (x.1.1 : Mat 4 ℝ).PosDef ∧ (ambientResidual x : Mat 4 ℝ).PosDef} ⊆ + cone := by + intro x hx + apply (cone_positive_slice x.1.1 x.1.2 x.2 hx.1).mpr + exact hx.2.posSemidef + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ConePositive.lean b/lean/OAI/Analysis/HyperbolicCones/ConePositive.lean new file mode 100644 index 0000000000000000000000000000000000000000..1be92490180eb38c8b03d126e96cb49cbe1c1ecb --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ConePositive.lean @@ -0,0 +1,25 @@ +import OAI.Analysis.HyperbolicCones.PositiveCore +import OAI.Analysis.HyperbolicCones.InverseOrder + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +theorem cone_positive_slice (X Z : Sym 4) (y : Fin 3 → ℝ) (hX : (X : Mat 4 ℝ).PosDef) : + ((X, Z), y) ∈ cone ↔ ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef := by + have h := cone_positive_slice_of_inverse_order X Z y hX + (fun t ht => posDef_inverse_sub_shift_inverse_posSemidef X hX t ht) + simp only [coneResidual, zero_smul, add_zero] at h + change ((X, Z), y) ∈ cone ↔ ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef at h + exact h + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ConeRoots.lean b/lean/OAI/Analysis/HyperbolicCones/ConeRoots.lean new file mode 100644 index 0000000000000000000000000000000000000000..72d0f0e722554912b8661bf7f317a98bf75075df --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ConeRoots.lean @@ -0,0 +1,44 @@ +import OAI.Analysis.HyperbolicCones.Hyperbolicity +import OAI.Analysis.HyperbolicCones.LineShift + +namespace OAI + +noncomputable section + +namespace Paper256 + +theorem cone_iff_nonnegative_real_roots (x : Ambient) : x ∈ cone ↔ + ∀ t : ℝ, (linePolynomial x).eval t = 0 → 0 ≤ t := by + constructor + · intro hx t ht + have hc : (linePolynomial x).aeval (t : ℂ) = 0 := by rw [real_aeval, ht]; rfl + exact (hx (t : ℂ) hc).2 + · intro hx z hz + have hi := linePolynomial_complex_roots_real x z hz + refine ⟨hi, hx z.re ?_⟩ + have he : (z.re : ℂ) = z := by + apply Complex.ext + · rfl + · simpa only [Complex.ofReal_im] using hi.symm + have hr : Complex.ofReal ((linePolynomial x).eval z.re) = 0 := by + rw [← real_aeval, he, hz] + exact_mod_cast hr + +theorem cone_iff_no_positive_shift (x : Ambient) : x ∈ cone ↔ + ∀ t : ℝ, 0 < t → MvPolynomial.eval (coordinates (x + t • basePoint)) polynomial ≠ 0 := by + rw [cone_iff_nonnegative_real_roots] + constructor + · intro hx t ht he + have h := hx (-t) ((linePolynomial_eval_neg x t).trans he) + linarith + · intro hx t ht + by_contra hn + have hpos : 0 < -t := by linarith + apply hx (-t) hpos + rw [← linePolynomial_eval_neg, neg_neg, ht] + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ConeZero.lean b/lean/OAI/Analysis/HyperbolicCones/ConeZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..343068b9e957ef49600fa267f6dcd505f9e0fe82 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ConeZero.lean @@ -0,0 +1,55 @@ +import OAI.Analysis.HyperbolicCones.ConeRoots +import OAI.Analysis.HyperbolicCones.ZeroPolynomial + +namespace OAI + +noncomputable section + +open Matrix Polynomial +open scoped BigOperators Matrix.Norms.L2Operator + +namespace Paper256 + +theorem charpoly_eval_eigenvalue (n : ℕ) (X : Sym n) (i : Fin n) : + (X : Mat n ℝ).charpoly.eval ((sym_isHermitian X).eigenvalues i) = 0 := by + rw [(sym_isHermitian X).charpoly_eq] + simp only [Polynomial.eval_prod, Polynomial.eval_sub, Polynomial.eval_X, + Polynomial.eval_C, RCLike.ofReal_real_eq_id, id_eq] + apply Finset.prod_eq_zero (Finset.mem_univ i) + simp + +theorem charpoly_real_roots_nonnegative (n : ℕ) (X : Sym n) + (hX : (X : Mat n ℝ).PosSemidef) (t : ℝ) + (ht : (X : Mat n ℝ).charpoly.eval t = 0) : 0 ≤ t := by + rw [(sym_isHermitian X).charpoly_eq] at ht + simp only [Polynomial.eval_prod, Polynomial.eval_sub, Polynomial.eval_X, + Polynomial.eval_C, RCLike.ofReal_real_eq_id, id_eq, Finset.prod_eq_zero_iff, + Finset.mem_univ, true_and, sub_eq_zero] at ht + obtain ⟨i, rfl⟩ := ht + exact hX.eigenvalues_nonneg i + +theorem cone_zero_slice (X Z : Sym 4) : ((X, Z), (0 : Fin 3 → ℝ)) ∈ cone ↔ + (X : Mat 4 ℝ).PosSemidef ∧ (Z : Mat 4 ℝ).PosSemidef := by + rw [cone_iff_nonnegative_real_roots, linePolynomial_zero_parameter] + constructor + · intro h + constructor + · apply (sym_isHermitian X).posSemidef_iff_eigenvalues_nonneg.mpr + intro i + apply h ((sym_isHermitian X).eigenvalues i) + simp [charpoly_eval_eigenvalue] + · apply (sym_isHermitian Z).posSemidef_iff_eigenvalues_nonneg.mpr + intro i + apply h ((sym_isHermitian Z).eigenvalues i) + simp [charpoly_eval_eigenvalue] + · rintro ⟨hX, hZ⟩ t ht + simp only [Polynomial.eval_mul, Polynomial.eval_pow, mul_eq_zero, + pow_eq_zero_iff (by norm_num : (4 : ℕ) ≠ 0)] at ht + exact ht.elim (charpoly_real_roots_nonnegative 4 X hX t) + (charpoly_real_roots_nonnegative 4 Z hZ t) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/CongruenceMaps.lean b/lean/OAI/Analysis/HyperbolicCones/CongruenceMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..c9d536ac9afb261db8d60d0f85d8b4bf4153d4f1 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/CongruenceMaps.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.HyperbolicCones.KernelSpectrum + +namespace OAI + +/-! Linear congruence maps and preservation of a two-block matrix pencil. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix +namespace Paper256 + +def congruenceSym {n : ℕ} (S : Mat n ℝ) : Sym n →ₗ[ℝ] Sym n where + toFun X := ⟨Sᵀ * (X : Mat n ℝ) * S, by + change (Sᵀ * (X : Mat n ℝ) * S).IsHermitian + simpa only [conjTranspose_eq_transpose_of_trivial] using + Matrix.isHermitian_conjTranspose_mul_mul S (show (X : Mat n ℝ).IsHermitian from X.property)⟩ + map_add' X Y := by + apply Subtype.ext + change Sᵀ * ((X : Mat n ℝ) + (Y : Mat n ℝ)) * S = + Sᵀ * (X : Mat n ℝ) * S + Sᵀ * (Y : Mat n ℝ) * S + simp only [Matrix.mul_add, Matrix.add_mul] + map_smul' r X := by + apply Subtype.ext + simp only [selfAdjoint.val_smul, RingHom.id_apply, Matrix.mul_smul, Matrix.smul_mul] + +@[simp] theorem congruenceSym_val {n : ℕ} (S : Mat n ℝ) (X : Sym n) : + (congruenceSym S X : Mat n ℝ) = Sᵀ * (X : Mat n ℝ) * S := rfl + +def congruenceRect {m n : ℕ} (S : Mat m ℝ) (T : Mat n ℝ) : + Matrix (Fin m) (Fin n) ℝ →ₗ[ℝ] Matrix (Fin m) (Fin n) ℝ where + toFun A := Sᵀ * A * T + map_add' A B := by simp only [Matrix.mul_add, Matrix.add_mul] + map_smul' r A := by simp only [RingHom.id_apply, Matrix.mul_smul, Matrix.smul_mul] + +@[simp] theorem congruenceRect_apply {m n : ℕ} (S : Mat m ℝ) (T : Mat n ℝ) + (A : Matrix (Fin m) (Fin n) ℝ) : congruenceRect S T A = Sᵀ * A * T := rfl + +theorem congruenceSym_positive {n : ℕ} (S : Mat n ℝ) (X : Sym n) + (hX : (X : Mat n ℝ).PosSemidef) : (congruenceSym S X : Mat n ℝ).PosSemidef := by + simpa only [congruenceSym_val, conjTranspose_eq_transpose_of_trivial] using + hX.conjTranspose_mul_mul_same S + +theorem congruenceSym_inverseSquareRoot_self {n : ℕ} (H : Sym n) + (hH : (H : Mat n ℝ).PosDef) : congruenceSym (inverseSquareRoot H) H = 1 := by + apply Subtype.ext + exact inverseSquareRoot_conjugate H hH + +theorem block_congruence_identity {m n : ℕ} (S : Mat m ℝ) (T : Mat n ℝ) + (A : Mat m ℝ) (B : Matrix (Fin m) (Fin n) ℝ) (D : Mat n ℝ) : + (Matrix.fromBlocks S 0 0 T)ᵀ * Matrix.fromBlocks A B Bᵀ D * + Matrix.fromBlocks S 0 0 T = + Matrix.fromBlocks (Sᵀ * A * S) (Sᵀ * B * T) + (Sᵀ * B * T)ᵀ (Tᵀ * D * T) := by + simp only [Matrix.fromBlocks_transpose, transpose_zero, Matrix.fromBlocks_multiply, + Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add, transpose_mul, + transpose_transpose, Matrix.mul_assoc] + +theorem block_congruence_posSemidef_iff {m n : ℕ} (S : Mat m ℝ) (T : Mat n ℝ) + (hS : IsUnit S) (hT : IsUnit T) + (A : Mat m ℝ) (B : Matrix (Fin m) (Fin n) ℝ) (D : Mat n ℝ) : + (Matrix.fromBlocks (Sᵀ * A * S) (Sᵀ * B * T) + (Sᵀ * B * T)ᵀ (Tᵀ * D * T)).PosSemidef ↔ + (Matrix.fromBlocks A B Bᵀ D).PosSemidef := by + have hU : IsUnit (Matrix.fromBlocks S (0 : Matrix (Fin m) (Fin n) ℝ) 0 T) := + Matrix.isUnit_fromBlocks_zero₂₁.mpr ⟨hS, hT⟩ + rw [← block_congruence_identity S T A B D] + simpa only [Matrix.star_eq_conjTranspose, conjTranspose_eq_transpose_of_trivial] using + hU.posSemidef_star_left_conjugate_iff (x := Matrix.fromBlocks A B Bᵀ D) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ConstantRank.lean b/lean/OAI/Analysis/HyperbolicCones/ConstantRank.lean new file mode 100644 index 0000000000000000000000000000000000000000..921ac77872c2a28eaadc1bdd79b26d30bf69b4b1 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ConstantRank.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.HyperbolicCones.KernelSmooth + +namespace OAI + +noncomputable section + +open scoped ContDiff RealInnerProductSpace +open Set ContinuousLinearMap + +universe u v + +namespace Paper256 + +theorem exists_constant_rank_neighborhood + {W : Type u} {F : Type v} [NormedAddCommGroup W] [NormedSpace ℝ W] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] + (S : Set W) (hne : S.Nonempty) (A : W → F →L[ℝ] F) + (hA : ContDiff ℝ ∞ A) (hs : ∀ u ∈ S, IsSelfAdjoint (A u)) : + ∃ v ∈ S, ∃ U : Set W, IsOpen U ∧ v ∈ U ∧ + (∀ u ∈ S, Module.finrank ℝ (A u).range ≤ Module.finrank ℝ (A v).range) ∧ + ∀ u ∈ U, u ∈ S → Module.finrank ℝ (A u).range = Module.finrank ℝ (A v).range := by + let ranks : Set ℕ := (fun u => Module.finrank ℝ (A u).range) '' S + have hfin : ranks.Finite := Set.finite_iff_bddAbove.mpr ⟨Module.finrank ℝ F, by + rintro _ ⟨u, _, rfl⟩ + exact Submodule.finrank_le _⟩ + obtain ⟨r, hr, hmax⟩ := Set.exists_max_image ranks id hfin (hne.image _) + obtain ⟨v, hv, rfl⟩ := hr + let R : Submodule ℝ F := (A v).range + let T : W → R →L[ℝ] F := fun u => (A u).comp R.subtypeL + have hTv : Function.Injective (T v) := by + apply LinearMap.ker_eq_bot.mp + apply LinearMap.ker_eq_bot'.mpr + intro x hx + change A v (x : F) = 0 at hx + have hxo : (x : F) ∈ Rᗮ := by + change (x : F) ∈ (A v).rangeᗮ + rw [(A v).orthogonal_range, (hs v hv).adjoint_eq] + exact hx + apply Subtype.ext + exact inner_self_eq_zero.mp (hxo x x.property) + have ht : ContDiff ℝ ∞ T := hA.clm_comp contDiff_const + have hadj : ContDiff ℝ ∞ (fun B : R →L[ℝ] F => B.adjoint) := + (ContinuousLinearMap.adjoint : (R →L[ℝ] F) ≃ₗᵢ[ℝ] (F →L[ℝ] R)).contDiff + let G : W → R →L[ℝ] R := fun u => (T u).adjoint.comp (T u) + have hg : ContDiff ℝ ∞ G := (hadj.comp ht).clm_comp ht + let U : Set W := {u | IsUnit (G u)} + have huopen : IsOpen U := by + change IsOpen (G ⁻¹' {K : R →L[ℝ] R | IsUnit K}) + apply IsOpen.preimage hg.continuous + exact Units.isOpen (R := R →L[ℝ] R) + have hvu : v ∈ U := gram_isUnit_of_injective (T v) hTv + refine ⟨v, hv, U, huopen, hvu, ?_, ?_⟩ + · intro u hu + exact hmax _ ⟨u, hu, rfl⟩ + · intro u hu hus + have hTu : Function.Injective (T u) := by + have hGi := (ContinuousLinearMap.isUnit_iff_bijective.mp hu).1 + intro x y hxy + apply hGi + exact congrArg (T u).adjoint hxy + apply le_antisymm (hmax _ ⟨u, hus, rfl⟩) + have hrange : (T u).range ≤ (A u).range := by + rintro _ ⟨x, rfl⟩ + exact ⟨(x : F), rfl⟩ + calc + Module.finrank ℝ (A v).range = Module.finrank ℝ (T u).range := + (LinearMap.finrank_range_of_inj hTu).symm + _ ≤ Module.finrank ℝ (A u).range := Submodule.finrank_mono hrange + +theorem kernel_rank_constant_neighborhood (c : ℕ) (E : Sym 4 →ₗ[ℝ] Sym c) : + ∃ (v : Vec 4) (U : Set (Vec 4)), ‖v‖ = 1 ∧ v 0 ≠ 0 ∧ IsOpen U ∧ v ∈ U ∧ + (∀ u : Vec 4, ‖u‖ = 1 → u 0 ≠ 0 → + Module.finrank ℝ (symmetricOperatorLinear c (E (1 - outerSym u))).range ≤ + Module.finrank ℝ (symmetricOperatorLinear c (E (1 - outerSym v))).range) ∧ + ∀ u ∈ U, ‖u‖ = 1 → u 0 ≠ 0 → + Module.finrank ℝ (symmetricOperatorLinear c (E (1 - outerSym u))).range = + Module.finrank ℝ (symmetricOperatorLinear c (E (1 - outerSym v))).range := by + let S : Set (Vec 4) := {u | ‖u‖ = 1 ∧ u 0 ≠ 0} + have hne : S.Nonempty := ⟨PiLp.single 2 0 1, by simp [S]⟩ + obtain ⟨v, hv, U, hU, hvU, hmax, hrank⟩ := exists_constant_rank_neighborhood S hne + (fun u => symmetricOperatorLinear c (E (1 - outerSym u))) + (contDiff_kernelFamily c E) (fun u _ => kernelFamily_isSelfAdjoint c E u) + exact ⟨v, U, hv.1, hv.2, hU, hvU, fun u hu hu0 => hmax u ⟨hu, hu0⟩, + fun u hu hunit hu0 => hrank u hu ⟨hunit, hu0⟩⟩ + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/Coordinates.lean b/lean/OAI/Analysis/HyperbolicCones/Coordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..e032dfc710bc94a952d4fabff6ef3ec70a031188 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/Coordinates.lean @@ -0,0 +1,57 @@ +import OAI.Analysis.HyperbolicCones.Model + +namespace OAI + +noncomputable section + +open scoped Matrix.Norms.L2Operator +open Matrix + +namespace Paper256 + +theorem symIndex_card : Fintype.card SymIndex = 10 := by decide + +theorem coordinate_card : Fintype.card Coord = 23 := by decide + +theorem symmetricCoordinates_isHermitian (v : SymIndex → ℝ) : + (symmetricCoordinates v).IsHermitian := by + change (symmetricCoordinates v)ᴴ = symmetricCoordinates v + ext i j + simp only [Matrix.conjTranspose_apply, star_trivial] + by_cases hij : i ≤ j + · by_cases hji : j ≤ i + · have h : i = j := le_antisymm hij hji + subst j + rfl + · simp [symmetricCoordinates, hij, hji] + · have hji : j ≤ i := le_of_lt (lt_of_not_ge hij) + simp [symmetricCoordinates, hij, hji] + +def symmetricCoordinateEquiv : Sym 4 ≃ₗ[ℝ] (SymIndex → ℝ) where + toFun X ij := (X : Mat 4 ℝ) ij.val.1 ij.val.2 + invFun v := ⟨symmetricCoordinates v, symmetricCoordinates_isHermitian v⟩ + left_inv X := by + apply Subtype.ext + ext i j + by_cases h : i ≤ j + · simp [symmetricCoordinates, h] + · have hX : (X : Mat 4 ℝ).IsHermitian := X.property + simpa [symmetricCoordinates, h] using hX.apply i j + right_inv v := by + funext ij + simp [symmetricCoordinates, ij.property] + map_add' _ _ := rfl + map_smul' _ _ := rfl + +theorem symmetric_finrank : Module.finrank ℝ (Sym 4) = 10 := by + rw [symmetricCoordinateEquiv.finrank_eq] + simp [symIndex_card] + +theorem ambient_finrank : Module.finrank ℝ Ambient = 23 := by + simp [Ambient, Module.finrank_prod, symmetric_finrank] + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/Deformation.lean b/lean/OAI/Analysis/HyperbolicCones/Deformation.lean new file mode 100644 index 0000000000000000000000000000000000000000..ee007be1588fd6fb3eb06df4da1eaf46c451a144 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/Deformation.lean @@ -0,0 +1 @@ +import OAI.Analysis.HyperbolicCones.QuadraticDeformation diff --git a/lean/OAI/Analysis/HyperbolicCones/DeformationBasic.lean b/lean/OAI/Analysis/HyperbolicCones/DeformationBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..05c2d70d1148544c9b3f00a6a59a30f3355f219a --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/DeformationBasic.lean @@ -0,0 +1,107 @@ +import OAI.Analysis.HyperbolicCones.Model + +namespace OAI + +noncomputable section + +open Set Polynomial +open scoped ContDiff Matrix.Norms.L2Operator Topology + +namespace Paper256 + +theorem timeScale_positive (η t : ℝ) (hη : 0 < η) : 0 < timeScale η t := by + unfold timeScale + positivity + +theorem timeScale_endpoints (η : ℝ) : timeScale η 0 = 1 ∧ timeScale η 1 = 1 := by + simp [timeScale] + +theorem timeScale_strict_interior (η t : ℝ) (hη : 0 < η) (ht : t ∈ Ioo (0 : ℝ) 1) : + 1 < timeScale η t := by + have hs : 0 < Real.sin (Real.pi * t) := + Real.sin_pos_of_pos_of_lt_pi (mul_pos Real.pi_pos ht.1) + (by nlinarith [Real.pi_pos, ht.2]) + unfold timeScale + have := mul_pos hη (sq_pos_of_pos hs) + linarith + +theorem timeScale_smooth (η : ℝ) : ContDiff ℝ ∞ (timeScale η) := by + unfold timeScale + fun_prop + +theorem deformedPolynomial_eval (a b η t x : ℝ) : + (deformedPolynomial a b η t).eval x = + (1 - timeScale η t * x / a) * (1 + timeScale η t * x / b) := by + simp [deformedPolynomial, intervalPolynomial, div_eq_mul_inv] + ring + +theorem deformedPolynomial_eval_zero (a b η t : ℝ) : + (deformedPolynomial a b η t).eval 0 = 1 := by + simp [deformedPolynomial_eval] + +theorem deformedPolynomial_factor (a b η t : ℝ) : + deformedPolynomial a b η t = + (1 - C (timeScale η t / a) * X) * (1 + C (timeScale η t / b) * X) := by + simp [deformedPolynomial, intervalPolynomial, div_eq_mul_inv, map_mul] + ring + +theorem deformedPolynomial_scaled (a b η t : ℝ) : + deformedPolynomial a b η t = + intervalPolynomial (a / timeScale η t) (b / timeScale η t) := by + rw [deformedPolynomial_factor] + simp [intervalPolynomial, div_eq_mul_inv] + +theorem deformedPolynomial_expanded (a b η t : ℝ) : + deformedPolynomial a b η t = + 1 + C (timeScale η t * (b⁻¹ - a⁻¹)) * X + + C (-(a⁻¹ * b⁻¹ * timeScale η t ^ 2)) * X ^ 2 := by + rw [deformedPolynomial_factor] + simp [div_eq_mul_inv, map_mul, map_sub, map_neg, map_pow] + ring + +theorem deformedCoefficients_eq (a b η t : ℝ) : + deformedCoefficients a b η t = + ![1, timeScale η t * (b⁻¹ - a⁻¹), -(a⁻¹ * b⁻¹ * timeScale η t ^ 2)] := by + funext i + fin_cases i <;> simp only [deformedCoefficients, deformedPolynomial_expanded, + coeff_add, coeff_C_mul_X_pow, coeff_C_mul_X, coeff_one] <;> norm_num + +theorem deformedCoefficients_smooth (a b η : ℝ) : + ContDiff ℝ ∞ (deformedCoefficients a b η) := by + apply contDiff_pi.mpr + intro i + fin_cases i <;> simp [deformedCoefficients_eq, timeScale] <;> fun_prop + +theorem deformedPencil_eq (a b η t x : ℝ) : + deformedPencil a b η t x = + 1 + (timeScale η t * x) • Matrix.diagonal ![-a⁻¹, b⁻¹] := by + ext i j + fin_cases i <;> fin_cases j <;> simp [deformedPencil, Matrix.diagonal, div_eq_mul_inv] + ring + +theorem deformedPencil_smooth (a b η : ℝ) : + ContDiff ℝ ∞ (fun tx : ℝ × ℝ => deformedPencil a b η tx.1 tx.2) := by + simp_rw [deformedPencil_eq] + have hf : ContDiff ℝ ∞ (fun tx : ℝ × ℝ => timeScale η tx.1 * tx.2) := by + unfold timeScale + fun_prop + exact contDiff_const.add (hf.smul contDiff_const) + +theorem deformedPencil_det (a b η t x : ℝ) : + Matrix.det (deformedPencil a b η t x) = (deformedPolynomial a b η t).eval x := by + simp [deformedPencil, deformedPolynomial_eval] + +theorem deformedPencil_zero (a b η t : ℝ) : deformedPencil a b η t 0 = 1 := by + ext i j + fin_cases i <;> fin_cases j <;> simp [deformedPencil, Matrix.diagonal] + +theorem deformedPolynomial_endpoints (a b η : ℝ) : + deformedPolynomial a b η 0 = intervalPolynomial a b ∧ + deformedPolynomial a b η 1 = intervalPolynomial a b := by + simp [deformedPolynomial, timeScale] + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/DeformationCone.lean b/lean/OAI/Analysis/HyperbolicCones/DeformationCone.lean new file mode 100644 index 0000000000000000000000000000000000000000..80a6a14e59d5d66d1f4a23bae9d76574943ac295 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/DeformationCone.lean @@ -0,0 +1,84 @@ +import OAI.Analysis.HyperbolicCones.DeformationRoots + +namespace OAI + +noncomputable section + +open Set Polynomial + +namespace Paper256 + +theorem intervalPolynomial_component (a b : ℝ) (ha : 0 < a) (hb : 0 < b) : + connectedComponentIn {x : ℝ | (intervalPolynomial a b).eval x ≠ 0} 0 = + Ioo (-b) a := by + let S := {x : ℝ | (intervalPolynomial a b).eval x ≠ 0} + have h0 : (0 : ℝ) ∈ S := by simp [S, intervalPolynomial_eval] + have hz := mem_connectedComponentIn h0 + have hc : OrdConnected (connectedComponentIn S 0) := + isPreconnected_connectedComponentIn.ordConnected + apply subset_antisymm + · intro x hx + constructor + · by_contra h + have hm : -b ∈ connectedComponentIn S 0 := + hc.out hx hz ⟨le_of_not_gt h, by linarith⟩ + have hn := connectedComponentIn_subset S 0 hm + simp [S, intervalPolynomial_eval, hb.ne'] at hn + · by_contra h + have hm : a ∈ connectedComponentIn S 0 := + hc.out hz hx ⟨ha.le, le_of_not_gt h⟩ + have hn := connectedComponentIn_subset S 0 hm + simp [S, intervalPolynomial_eval, ha.ne'] at hn + · apply isPreconnected_Ioo.subset_connectedComponentIn + · exact ⟨by linarith, ha⟩ + · intro x hx hn + have hr : (intervalPolynomial a b).IsRoot x := hn + rcases (intervalPolynomial_isRoot_iff a b x ha.ne' hb.ne').mp hr with h | h + · exact (ne_of_gt hx.1) h + · exact (ne_of_lt hx.2) h + +theorem intervalPolynomial_rigidlyConvexSet (a b : ℝ) (ha : 0 < a) (hb : 0 < b) : + rigidlyConvexSet (intervalPolynomial a b) = Icc (-b) a := by + rw [rigidlyConvexSet, intervalPolynomial_component a b ha hb, + closure_Ioo (by linarith : -b ≠ a)] + +theorem deformedPolynomial_rigidlyConvexSet (a b η t : ℝ) + (ha : 0 < a) (hb : 0 < b) (hη : 0 < η) : + rigidlyConvexSet (deformedPolynomial a b η t) = + Icc (-b / timeScale η t) (a / timeScale η t) := by + rw [deformedPolynomial_scaled, intervalPolynomial_rigidlyConvexSet _ _ + (div_pos ha (timeScale_positive η t hη)) + (div_pos hb (timeScale_positive η t hη)), neg_div] + +theorem deformedPolynomial_strict_subset (a b η t : ℝ) + (ha : 0 < a) (hb : 0 < b) (hη : 0 < η) (ht : t ∈ Ioo (0 : ℝ) 1) : + rigidlyConvexSet (deformedPolynomial a b η t) ⊂ + rigidlyConvexSet (intervalPolynomial a b) := by + rw [deformedPolynomial_rigidlyConvexSet a b η t ha hb hη, + intervalPolynomial_rigidlyConvexSet a b ha hb] + have hc := timeScale_strict_interior η t hη ht + have hleft : -b ≤ -b / timeScale η t := by + rw [neg_div] + exact neg_le_neg (div_le_self hb.le hc.le) + have hright := div_lt_self ha hc + refine ssubset_iff_subset_ne.mpr ⟨Icc_subset_Icc hleft hright.le, ?_⟩ + intro h + have hm : a ∈ Icc (-b / timeScale η t) (a / timeScale η t) := by + rw [h] + exact ⟨by linarith, le_rfl⟩ + exact (not_le_of_gt hright) hm.2 + +theorem arbitrarily_small_deformation (a b ε : ℝ) + (ha : 0 < a) (hb : 0 < b) (hε : 0 < ε) : + ∃ η : ℝ, 0 < η ∧ η < ε ∧ ∀ t ∈ Ioo (0 : ℝ) 1, + rigidlyConvexSet (deformedPolynomial a b η t) ⊂ + rigidlyConvexSet (intervalPolynomial a b) := by + refine ⟨ε / 2, by positivity, by linarith, ?_⟩ + intro t ht + exact deformedPolynomial_strict_subset a b (ε / 2) t ha hb (by positivity) ht + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/DeformationFamily.lean b/lean/OAI/Analysis/HyperbolicCones/DeformationFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..6d6e4cc0a07ba5aef62a30439d7da15a877152e7 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/DeformationFamily.lean @@ -0,0 +1,103 @@ +import OAI.Analysis.HyperbolicCones.DeformationBasic + +namespace OAI + +noncomputable section + +open Polynomial Set + +namespace Paper256 + +theorem intervalPolynomial_expanded (a b : ℝ) : + intervalPolynomial a b = 1 + C (b⁻¹ - a⁻¹) * X + C (-(a⁻¹ * b⁻¹)) * X ^ 2 := by + simp [intervalPolynomial, map_sub, map_neg, map_mul] + ring + +theorem quadratic_expansion (p : Polynomial ℝ) (hdegree : p.natDegree ≤ 2) + (hzero : p.coeff 0 = 1) : + p = 1 + C (p.coeff 1) * X + C (p.coeff 2) * X ^ 2 := by + calc + p = ∑ i ∈ Finset.range 3, C (p.coeff i) * X ^ i := + p.as_sum_range_C_mul_X_pow' (by omega) + _ = _ := by simp [Finset.sum_range_succ, hzero] + +theorem normalized_quadratic_representation (p : Polynomial ℝ) + (hdegree : p.natDegree = 2) (hzero : p.coeff 0 = 1) (hlead : p.coeff 2 < 0) : + ∃ a b : ℝ, 0 < a ∧ 0 < b ∧ p = intervalPolynomial a b := by + let c := p.coeff 1 + let d := p.coeff 2 + let r := Real.sqrt (c ^ 2 - 4 * d) + have hd : d < 0 := hlead + have hdisc : 0 < c ^ 2 - 4 * d := by nlinarith [sq_nonneg c] + have hr : 0 ≤ r := Real.sqrt_nonneg _ + have hr2 : r ^ 2 = c ^ 2 - 4 * d := Real.sq_sqrt hdisc.le + have hminus : 0 < r - c := by nlinarith + have hplus : 0 < r + c := by nlinarith + let a := 2 / (r - c) + let b := 2 / (r + c) + have ha : 0 < a := div_pos (by norm_num) hminus + have hb : 0 < b := div_pos (by norm_num) hplus + have hc : b⁻¹ - a⁻¹ = c := by dsimp [a, b]; rw [inv_div, inv_div]; ring + have hd' : -(a⁻¹ * b⁻¹) = d := by + dsimp [a, b] + rw [inv_div, inv_div] + nlinarith [hr2] + refine ⟨a, b, ha, hb, ?_⟩ + rw [intervalPolynomial_expanded, hc, hd'] + exact quadratic_expansion p hdegree.le hzero + +theorem intervalPolynomial_natDegree_le (a b : ℝ) : + (intervalPolynomial a b).natDegree ≤ 2 := by + rw [intervalPolynomial_expanded] + apply natDegree_add_le_of_degree_le + · apply natDegree_add_le_of_degree_le + · simp + · simpa using (natDegree_C_mul_X_pow_le (b⁻¹ - a⁻¹) 1).trans (by norm_num : 1 ≤ 2) + · exact natDegree_C_mul_X_pow_le _ _ + +theorem intervalPolynomial_coeff_two (a b : ℝ) : + (intervalPolynomial a b).coeff 2 = -(a⁻¹ * b⁻¹) := by + rw [intervalPolynomial_expanded] + simp only [coeff_add, coeff_C_mul_X, coeff_C_mul_X_pow, coeff_one] + norm_num + +theorem intervalPolynomial_natDegree (a b : ℝ) (ha : 0 < a) (hb : 0 < b) : + (intervalPolynomial a b).natDegree = 2 := by + apply natDegree_eq_of_le_of_coeff_ne_zero (intervalPolynomial_natDegree_le a b) + rw [intervalPolynomial_coeff_two] + exact neg_ne_zero.mpr (mul_ne_zero (inv_ne_zero ha.ne') (inv_ne_zero hb.ne')) + +theorem deformedPolynomial_natDegree (a b η t : ℝ) + (ha : 0 < a) (hb : 0 < b) (hη : 0 < η) : + (deformedPolynomial a b η t).natDegree = 2 := by + rw [deformedPolynomial_scaled] + exact intervalPolynomial_natDegree _ _ (div_pos ha (timeScale_positive η t hη)) + (div_pos hb (timeScale_positive η t hη)) + +/-- In coefficient coordinates on normalized quadratics, negative leading coefficient is open. -/ +theorem normalized_negative_quadratics_open : + IsOpen {v : Fin 2 → ℝ | v 1 < 0} := by + exact isOpen_lt (continuous_apply 1) continuous_const + +/-- Every point of that open coefficient family is exactly one of the displayed quadratics. -/ +theorem normalized_negative_quadratics_representation (v : Fin 2 → ℝ) (hv : v 1 < 0) : + ∃ a b : ℝ, 0 < a ∧ 0 < b ∧ + 1 + C (v 0) * X + C (v 1) * X ^ 2 = intervalPolynomial a b := by + apply normalized_quadratic_representation + · apply natDegree_eq_of_le_of_coeff_ne_zero + · apply natDegree_add_le_of_degree_le + · apply natDegree_add_le_of_degree_le + · simp + · simpa using (natDegree_C_mul_X_pow_le (v 0) 1).trans (by norm_num : 1 ≤ 2) + · exact natDegree_C_mul_X_pow_le _ _ + · norm_num only [coeff_add, coeff_C_mul_X, coeff_C_mul_X_pow, coeff_one] + simpa using hv.ne + · simp + · norm_num only [coeff_add, coeff_C_mul_X, coeff_C_mul_X_pow, coeff_one] + simpa using hv + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/DeformationRoots.lean b/lean/OAI/Analysis/HyperbolicCones/DeformationRoots.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c2674da9fe1e2d35692839438be6bc31a0b0068 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/DeformationRoots.lean @@ -0,0 +1,112 @@ +import OAI.Analysis.HyperbolicCones.DeformationBasic + +namespace OAI + +noncomputable section + +open Set Polynomial + +namespace Paper256 + +theorem intervalPolynomial_eval (a b x : ℝ) : + (intervalPolynomial a b).eval x = (1 - x / a) * (1 + x / b) := by + simp [intervalPolynomial, div_eq_mul_inv] + ring + +theorem intervalPolynomial_isRoot_iff (a b x : ℝ) (ha : a ≠ 0) (hb : b ≠ 0) : + (intervalPolynomial a b).IsRoot x ↔ x = -b ∨ x = a := by + rw [Polynomial.IsRoot, intervalPolynomial_eval, mul_eq_zero] + constructor + · rintro (h | h) + · right + field_simp at h + linarith + · left + field_simp at h + linarith + · rintro (rfl | rfl) <;> simp [ha, hb] + +theorem deformedPolynomial_root_set (a b η t : ℝ) + (ha : 0 < a) (hb : 0 < b) (hη : 0 < η) : + {x : ℝ | (deformedPolynomial a b η t).IsRoot x} = + {-b / timeScale η t, a / timeScale η t} := by + rw [deformedPolynomial_scaled] + ext x + simp only [mem_ofPred_eq, intervalPolynomial_isRoot_iff _ _ _ + (div_ne_zero ha.ne' (timeScale_positive η t hη).ne') + (div_ne_zero hb.ne' (timeScale_positive η t hη).ne'), + mem_insert_iff, mem_singleton_iff, neg_div] + +theorem deformedPolynomial_roots_compact (a b η t : ℝ) + (ha : 0 < a) (hb : 0 < b) (hη : 0 < η) : + IsCompact {x : ℝ | (deformedPolynomial a b η t).IsRoot x} := by + rw [deformedPolynomial_root_set a b η t ha hb hη] + exact (Set.toFinite _).isCompact + +theorem intervalPolynomial_derivative_eval (a b x : ℝ) : + (intervalPolynomial a b).derivative.eval x = + b⁻¹ - a⁻¹ - 2 * (a⁻¹ * b⁻¹) * x := by + simp [intervalPolynomial, Polynomial.derivative_mul] + ring + +theorem intervalPolynomial_roots_simple (a b x : ℝ) (ha : 0 < a) (hb : 0 < b) + (hx : (intervalPolynomial a b).IsRoot x) : + (intervalPolynomial a b).derivative.eval x ≠ 0 := by + rw [intervalPolynomial_isRoot_iff a b x ha.ne' hb.ne'] at hx + rcases hx with rfl | rfl <;> rw [intervalPolynomial_derivative_eval] <;> + intro h <;> field_simp at h <;> nlinarith + +theorem deformedPolynomial_roots_simple (a b η t : ℝ) + (ha : 0 < a) (hb : 0 < b) (hη : 0 < η) (x : ℝ) + (hx : (deformedPolynomial a b η t).IsRoot x) : + (deformedPolynomial a b η t).derivative.eval x ≠ 0 := by + rw [deformedPolynomial_scaled] at hx ⊢ + exact intervalPolynomial_roots_simple _ _ x + (div_pos ha (timeScale_positive η t hη)) + (div_pos hb (timeScale_positive η t hη)) hx + +theorem intervalPolynomial_radial_aeval (a b x : ℝ) (z : ℂ) : + ((intervalPolynomial a b).comp (C x * X)).aeval z = + (1 - (a⁻¹ : ℝ) * (x * z)) * (1 + (b⁻¹ : ℝ) * (x * z)) := by + simp [intervalPolynomial] + +theorem intervalPolynomial_real_zero (a b x : ℝ) (z : ℂ) + (hz : ((intervalPolynomial a b).comp (C x * X)).aeval z = 0) : + z.im = 0 := by + rw [intervalPolynomial_radial_aeval, mul_eq_zero] at hz + rcases hz with hz | hz + · have hre := congrArg Complex.re hz + have him := congrArg Complex.im hz + simp only [Complex.sub_re, Complex.one_re, Complex.mul_re, Complex.ofReal_re, + Complex.ofReal_im, zero_mul, sub_zero, Complex.zero_re] at hre + simp only [Complex.sub_im, Complex.one_im, Complex.mul_im, Complex.ofReal_re, + Complex.ofReal_im, zero_mul, add_zero, Complex.zero_im] at him + simp only [← mul_assoc] at hre him + have hax : a⁻¹ * x ≠ 0 := by + intro h + simp [h] at hre + exact (mul_eq_zero.mp (show (a⁻¹ * x) * z.im = 0 by nlinarith)).resolve_left hax + · have hre := congrArg Complex.re hz + have him := congrArg Complex.im hz + simp only [Complex.add_re, Complex.one_re, Complex.mul_re, Complex.ofReal_re, + Complex.ofReal_im, zero_mul, sub_zero, Complex.zero_re] at hre + simp only [Complex.add_im, Complex.one_im, Complex.mul_im, Complex.ofReal_re, + Complex.ofReal_im, zero_mul, add_zero, zero_add, Complex.zero_im] at him + simp only [← mul_assoc] at hre him + have hbx : b⁻¹ * x ≠ 0 := by + intro h + simp [h] at hre + exact (mul_eq_zero.mp (show (b⁻¹ * x) * z.im = 0 by nlinarith)).resolve_left hbx + +theorem deformedPolynomial_real_zero (a b η t x : ℝ) + (_ha : 0 < a) (_hb : 0 < b) (_hη : 0 < η) (z : ℂ) + (hz : ((deformedPolynomial a b η t).comp (C x * X)).aeval z = 0) : + z.im = 0 := by + rw [deformedPolynomial_scaled] at hz + exact intervalPolynomial_real_zero _ _ x z hz + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/FiniteTopology.lean b/lean/OAI/Analysis/HyperbolicCones/FiniteTopology.lean new file mode 100644 index 0000000000000000000000000000000000000000..478152468018665f0e576ce40a0afafa1ff0d580 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/FiniteTopology.lean @@ -0,0 +1,111 @@ +import OAI.Analysis.HyperbolicCones.PencilTopology + +namespace OAI + +noncomputable section + +open Set Filter Matrix +open scoped Topology Matrix.Norms.L2Operator MatrixOrder + +universe u v + +namespace Paper256.FiniteMatrix + +theorem sym_neg_norm_le {ι : Type u} [Fintype ι] [DecidableEq ι] (X : selfAdjoint (Matrix ι ι ℝ)) : + -(‖(X : Matrix ι ι ℝ)‖) • (1 : Matrix ι ι ℝ) ≤ (X : Matrix ι ι ℝ) := by + classical + rcases isEmpty_or_nonempty (ι) with h | h + · have := h + exact (Subsingleton.elim _ _).le + · have := h + rw [← Algebra.algebraMap_eq_smul_one] + apply (algebraMap_le_iff_le_spectrum (R := ℝ) (p := IsSelfAdjoint) X.property).mpr + intro x hx + have hh := spectrum.norm_le_norm_of_mem hx + have hl := neg_abs_le x + simpa only [Real.norm_eq_abs] using le_trans (neg_le_neg hh) hl + +theorem sym_le_norm {ι : Type u} [Fintype ι] [DecidableEq ι] (X : selfAdjoint (Matrix ι ι ℝ)) : + (X : Matrix ι ι ℝ) ≤ ‖(X : Matrix ι ι ℝ)‖ • (1 : Matrix ι ι ℝ) := by + classical + rcases isEmpty_or_nonempty (ι) with h | h + · have := h + exact (Subsingleton.elim _ _).le + · have := h + rw [← Algebra.algebraMap_eq_smul_one] + apply (le_algebraMap_iff_spectrum_le (R := ℝ) (p := IsSelfAdjoint) X.property).mpr + intro x hx + exact (le_abs_self x).trans (spectrum.norm_le_norm_of_mem hx) + +theorem posDef_of_scalar_lower_bound {ι : Type u} [Fintype ι] [DecidableEq ι] {X : Matrix ι ι ℝ} {c : ℝ} + (hc : 0 < c) (hX : c • (1 : Matrix ι ι ℝ) ≤ X) : X.PosDef := by + have h := (Matrix.PosDef.one.smul hc).add_posSemidef hX + simpa only [add_sub_cancel] using h + +theorem posDef_scalar_lower_bound {ι : Type u} [Fintype ι] [DecidableEq ι] (X : Matrix ι ι ℝ) (hX : X.PosDef) : + ∃ c : ℝ, 0 < c ∧ c • (1 : Matrix ι ι ℝ) ≤ X := by + classical + rcases isEmpty_or_nonempty (ι) with h | h + · have := h + exact ⟨1, zero_lt_one, (Subsingleton.elim _ _).le⟩ + · have := h + have hh := (CFC.exists_pos_algebraMap_le_iff X hX.isHermitian).mpr + (fun x hx => by + rw [hX.isHermitian.spectrum_real_eq_range_eigenvalues] at hx + obtain ⟨i, rfl⟩ := hx + exact hX.eigenvalues_pos i) + simpa only [Algebra.algebraMap_eq_smul_one] using hh + +theorem isOpen_posDef (ι : Type u) [Fintype ι] [DecidableEq ι] : IsOpen {X : selfAdjoint (Matrix ι ι ℝ) | (X : Matrix ι ι ℝ).PosDef} := by + apply Metric.isOpen_iff.mpr + intro H hH + obtain ⟨c, hc, hbound⟩ := posDef_scalar_lower_bound (H : Matrix ι ι ℝ) hH + refine ⟨c / 2, by positivity, ?_⟩ + intro X hX + have hnorm : ‖((X - H : selfAdjoint (Matrix ι ι ℝ)) : Matrix ι ι ℝ)‖ < c / 2 := by + simpa only [Metric.mem_ball, dist_eq_norm, AddSubgroup.coe_norm] using hX + have hlower : -(c / 2) • (1 : Matrix ι ι ℝ) ≤ ((X - H : selfAdjoint (Matrix ι ι ℝ)) : Matrix ι ι ℝ) := + (smul_le_smul_of_nonneg_right (by linarith : -(c / 2) ≤ -‖((X - H : selfAdjoint (Matrix ι ι ℝ)) : Matrix ι ι ℝ)‖) + Matrix.PosSemidef.one.nonneg).trans (sym_neg_norm_le (X - H)) + apply posDef_of_scalar_lower_bound (show 0 < c / 2 by positivity) + have hh : c • (1 : Matrix ι ι ℝ) + -(c / 2) • (1 : Matrix ι ι ℝ) ≤ + (H : Matrix ι ι ℝ) + ((X : Matrix ι ι ℝ) - (H : Matrix ι ι ℝ)) := add_le_add hbound hlower + convert hh using 1 <;> module + +def quadraticEvaluation {ι : Type u} [Fintype ι] [DecidableEq ι] (v : ι → ℝ) : selfAdjoint (Matrix ι ι ℝ) →ₗ[ℝ] ℝ where + toFun X := v ⬝ᵥ ((X : Matrix ι ι ℝ) *ᵥ v) + map_add' X Y := by simp [add_mulVec, dotProduct_add] + map_smul' c X := by simp [smul_mulVec, dotProduct_smul] + +theorem isClosed_posSemidef (ι : Type u) [Fintype ι] [DecidableEq ι] : IsClosed {X : selfAdjoint (Matrix ι ι ℝ) | (X : Matrix ι ι ℝ).PosSemidef} := by + have : FiniteDimensional ℝ (selfAdjoint (Matrix ι ι ℝ)) := + FiniteDimensional.finiteDimensional_submodule + (selfAdjoint.submodule ℝ (Matrix ι ι ℝ)) + have heq : {X : selfAdjoint (Matrix ι ι ℝ) | (X : Matrix ι ι ℝ).PosSemidef} = + ⋂ v : ι → ℝ, {X | 0 ≤ quadraticEvaluation v X} := by + ext X + simp only [mem_iInter, mem_ofPred_eq] + constructor + · intro h v + simpa only [quadraticEvaluation, LinearMap.coe_mk, AddHom.coe_mk, star_trivial] + using h.dotProduct_mulVec_nonneg v + · intro h + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg X.property + intro v + simpa only [quadraticEvaluation, LinearMap.coe_mk, AddHom.coe_mk, star_trivial] + using h v + rw [heq] + exact isClosed_iInter fun v => isClosed_le continuous_const + (quadraticEvaluation v).continuous_of_finiteDimensional + +theorem posSemidef_of_tendsto {α : Type u} {f : Filter α} [f.NeBot] {ι : Type v} [Fintype ι] [DecidableEq ι] + {A : α → selfAdjoint (Matrix ι ι ℝ)} {H : selfAdjoint (Matrix ι ι ℝ)} (hA : Tendsto A f (𝓝 H)) + (h : ∀ᶠ x in f, (A x : Matrix ι ι ℝ).PosSemidef) : (H : Matrix ι ι ℝ).PosSemidef := + (isClosed_posSemidef ι).mem_of_tendsto hA h + + +end Paper256.FiniteMatrix + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/Form.lean b/lean/OAI/Analysis/HyperbolicCones/Form.lean new file mode 100644 index 0000000000000000000000000000000000000000..f348beadb051949d24878661df48d3641def09f9 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/Form.lean @@ -0,0 +1,3 @@ +import OAI.Analysis.HyperbolicCones.FormPositive +import OAI.Analysis.HyperbolicCones.FormRigidity +import OAI.Analysis.HyperbolicCones.FormSign diff --git a/lean/OAI/Analysis/HyperbolicCones/FormBasic.lean b/lean/OAI/Analysis/HyperbolicCones/FormBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9060d0a69239223a8a79257bb717f5f9afa7ccd --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/FormBasic.lean @@ -0,0 +1,110 @@ +import OAI.Analysis.HyperbolicCones.Model + +namespace OAI + +/-! Exact identities for the Choi–Lam form. -/ + +noncomputable section + +open scoped Matrix.Norms.L2Operator +open Matrix + +universe u + +namespace Paper256 + +theorem choiLam_expand {R : Type u} [CommRing R] (z y : Fin 3 → R) : + choiLam z y = + z 0 ^ 2 * y 0 ^ 2 + z 1 ^ 2 * y 1 ^ 2 + z 2 ^ 2 * y 2 ^ 2 - + 2 * (z 0 * y 0 * z 1 * y 1 + z 0 * y 0 * z 2 * y 2 + + z 1 * y 1 * z 2 * y 2) + + (z 0 ^ 2 * y 1 ^ 2 + z 1 ^ 2 * y 2 ^ 2 + z 2 ^ 2 * y 0 ^ 2) := by + simp [choiLam, Fin.sum_univ_succ] + ring + +theorem qMatrix_isHermitian (y : Fin 3 → ℝ) : (qMatrix y).IsHermitian := by + show (qMatrix y)ᴴ = qMatrix y + ext i j + by_cases hij : i = j + · subst j + simp [qMatrix, Matrix.conjTranspose_apply] + · simp [qMatrix, Matrix.conjTranspose_apply, hij, Ne.symm hij, mul_comm] + +theorem zMatrix_isHermitian (z : Fin 3 → ℝ) : (zMatrix z).IsHermitian := by + show (zMatrix z)ᴴ = zMatrix z + ext i j + by_cases hij : i = j + · subst j + simp [zMatrix, Matrix.conjTranspose_apply] + · simp [zMatrix, Matrix.conjTranspose_apply, hij, Ne.symm hij, mul_comm] + +theorem qMatrix_quadratic (z y : Fin 3 → ℝ) : + dotProduct z (qMatrix y *ᵥ z) = choiLam z y := by + simp [dotProduct, Matrix.mulVec, qMatrix, choiLam, Fin.sum_univ_succ] + ring + +theorem zMatrix_quadratic (z y : Fin 3 → ℝ) : + dotProduct y (zMatrix z *ᵥ y) = choiLam z y := by + simp [dotProduct, Matrix.mulVec, zMatrix, choiLam, Fin.sum_univ_succ] + ring + +theorem zMatrix_diag_nonnegative (z : Fin 3 → ℝ) (i : Fin 3) : + 0 ≤ zMatrix z i i := by + simp only [zMatrix, ↓reduceIte] + positivity + +theorem zMatrix_principal_minor_two (z : Fin 3 → ℝ) (i : Fin 3) : + Matrix.det ((zMatrix z).submatrix + (fun j : Fin 2 => if j = 0 then i else i + 1) + (fun j : Fin 2 => if j = 0 then i else i + 1)) = + (z i ^ 2) ^ 2 + z (i + 2) ^ 2 * (z i ^ 2 + z (i + 1) ^ 2) := by + fin_cases i <;> simp [Matrix.det_fin_two, Matrix.submatrix, zMatrix, + Fin.reduceAdd, Fin.reduceEq] <;> ring + +theorem zMatrix_principal_minor_two_nonnegative (z : Fin 3 → ℝ) (i : Fin 3) : + 0 ≤ Matrix.det ((zMatrix z).submatrix + (fun j : Fin 2 => if j = 0 then i else i + 1) + (fun j : Fin 2 => if j = 0 then i else i + 1)) := by + rw [zMatrix_principal_minor_two] + positivity + +theorem zMatrix_det (z : Fin 3 → ℝ) : + Matrix.det (zMatrix z) = + (z 0 ^ 2) ^ 2 * z 1 ^ 2 + (z 1 ^ 2) ^ 2 * z 2 ^ 2 + + (z 2 ^ 2) ^ 2 * z 0 ^ 2 - 3 * z 0 ^ 2 * z 1 ^ 2 * z 2 ^ 2 := by + simp [Matrix.det_fin_three, zMatrix] + ring + +theorem choiLam_nonzero : + choiLam (![1, 0, 0] : Fin 3 → ℝ) (![1, 0, 0] : Fin 3 → ℝ) = 1 := by + simp [choiLam_expand, Matrix.cons_val] + +theorem choiLam_cyclic_zero (i : Fin 3) : + choiLam (Pi.single i 1 : Fin 3 → ℝ) (Pi.single (i + 2) 1) = 0 := by + fin_cases i <;> simp [choiLam_expand, Fin.reduceAdd, Fin.reduceEq] + +theorem choiLam_sign_zero (σ : Fin 3 → ℝ) + (hσ : ∀ i, σ i = 1 ∨ σ i = -1) : choiLam σ σ = 0 := by + rcases hσ 0 with h0 | h0 <;> rcases hσ 1 with h1 | h1 <;> + rcases hσ 2 with h2 | h2 <;> norm_num [choiLam_expand, h0, h1, h2] + +theorem choiLam_curve (i : Fin 3) (s : ℝ) : + choiLam ((Pi.single i 1 : Fin 3 → ℝ) + s • Pi.single (i + 2) 1) + (Pi.single (i + 2) 1 + s • Pi.single i 1) = s ^ 4 := by + fin_cases i <;> simp [choiLam_expand, Fin.reduceAdd, Fin.reduceEq] <;> ring + +theorem choiLam_smul_left (z y : Fin 3 → ℝ) (s : ℝ) : + choiLam (s • z) y = s ^ 2 * choiLam z y := by + simp only [choiLam_expand, Pi.smul_apply, smul_eq_mul] + ring + +theorem choiLam_smul_right (z y : Fin 3 → ℝ) (s : ℝ) : + choiLam z (s • y) = s ^ 2 * choiLam z y := by + simp only [choiLam_expand, Pi.smul_apply, smul_eq_mul] + ring + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/FormPositive.lean b/lean/OAI/Analysis/HyperbolicCones/FormPositive.lean new file mode 100644 index 0000000000000000000000000000000000000000..30e3d0b1b28926bb84b79ebc8d8ea8b85fcfab23 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/FormPositive.lean @@ -0,0 +1,116 @@ +import OAI.Analysis.HyperbolicCones.FormBasic + +namespace OAI + +/-! Positivity of the Choi--Lam form, including its principal-minor argument. -/ + +noncomputable section + +open scoped Matrix.Norms.L2Operator +open Matrix + +namespace Paper256 + +theorem cyclic_cubic_nonnegative (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) : + 0 ≤ a ^ 2 * b + b ^ 2 * c + c ^ 2 * a - 3 * a * b * c := by + have aux (a b c : ℝ) (hc : 0 ≤ c) (hca : c ≤ a) (hcb : c ≤ b) : + 0 ≤ a ^ 2 * b + b ^ 2 * c + c ^ 2 * a - 3 * a * b * c := by + have h := add_nonneg + (mul_nonneg hc (add_nonneg (sq_nonneg (a - b)) + (mul_nonneg (sub_nonneg.mpr hca) (sub_nonneg.mpr hcb)))) + (mul_nonneg (sq_nonneg (a - c)) (sub_nonneg.mpr hcb)) + nlinarith only [h] + rcases le_total a b with hab | hba + · rcases le_total a c with hac | hca + · nlinarith only [aux b c a ha hab hac] + · exact aux a b c hc hca (hca.trans hab) + · rcases le_total b c with hbc | hcb + · nlinarith only [aux c a b hb hbc hba] + · exact aux a b c hc (hcb.trans hba) hcb + +theorem zMatrix_det_nonnegative (z : Fin 3 → ℝ) : 0 ≤ Matrix.det (zMatrix z) := by + rw [zMatrix_det] + exact cyclic_cubic_nonnegative _ _ _ (sq_nonneg _) (sq_nonneg _) (sq_nonneg _) + +private theorem quadratic_two_nonnegative (a b c x y : ℝ) + (ha : 0 ≤ a) (hc : 0 ≤ c) (hdet : b ^ 2 ≤ a * c) : + 0 ≤ a * x ^ 2 + 2 * b * x * y + c * y ^ 2 := by + by_cases ha0 : a = 0 + · have hb0 : b = 0 := by nlinarith [sq_nonneg b] + simpa [ha0, hb0] using mul_nonneg hc (sq_nonneg y) + · have hapos : 0 < a := lt_of_le_of_ne ha (Ne.symm ha0) + have h := add_nonneg (sq_nonneg (a * x + b * y)) + (mul_nonneg (sub_nonneg.mpr hdet) (sq_nonneg y)) + have hm : 0 ≤ a * (a * x ^ 2 + 2 * b * x * y + c * y ^ 2) := by + nlinarith only [h] + exact nonneg_of_mul_nonneg_right hm hapos + +private theorem quadratic_three_nonnegative (a b c d e f x y z : ℝ) + (ha : 0 ≤ a) (hd : 0 ≤ d) (hf : 0 ≤ f) + (hab : b ^ 2 ≤ a * d) (hac : c ^ 2 ≤ a * f) (hdf : e ^ 2 ≤ d * f) + (hdet : 0 ≤ a * d * f - a * e ^ 2 - b ^ 2 * f + 2 * b * c * e - c ^ 2 * d) : + 0 ≤ a * x ^ 2 + d * y ^ 2 + f * z ^ 2 + + 2 * b * x * y + 2 * c * x * z + 2 * e * y * z := by + by_cases ha0 : a = 0 + · have hb0 : b = 0 := by nlinarith [sq_nonneg b] + have hc0 : c = 0 := by nlinarith [sq_nonneg c] + have h := quadratic_two_nonnegative d e f y z hd hf hdf + simpa [ha0, hb0, hc0, add_comm, add_left_comm, add_assoc] using h + · have hapos : 0 < a := lt_of_le_of_ne ha (Ne.symm ha0) + have hsmall : (a * e - b * c) ^ 2 ≤ (a * d - b ^ 2) * (a * f - c ^ 2) := by + nlinarith only [mul_nonneg ha hdet] + have hs := quadratic_two_nonnegative (a * d - b ^ 2) (a * e - b * c) + (a * f - c ^ 2) y z (sub_nonneg.mpr hab) (sub_nonneg.mpr hac) hsmall + have hm : 0 ≤ a * (a * x ^ 2 + d * y ^ 2 + f * z ^ 2 + + 2 * b * x * y + 2 * c * x * z + 2 * e * y * z) := by + nlinarith only [sq_nonneg (a * x + b * y + c * z), hs] + exact nonneg_of_mul_nonneg_right hm hapos + +/-- For a symmetric three-by-three matrix, its principal minors certify positivity. -/ +theorem posSemidef_three_of_principal_minors (M : Mat 3 ℝ) (hM : M.IsHermitian) + (hdiag : ∀ i, 0 ≤ M i i) + (h01 : M 0 1 ^ 2 ≤ M 0 0 * M 1 1) + (h02 : M 0 2 ^ 2 ≤ M 0 0 * M 2 2) + (h12 : M 1 2 ^ 2 ≤ M 1 1 * M 2 2) (hdet : 0 ≤ Matrix.det M) : + M.PosSemidef := by + have h10 : M 1 0 = M 0 1 := by simpa using hM.apply 0 1 + have h20 : M 2 0 = M 0 2 := by simpa using hM.apply 0 2 + have h21 : M 2 1 = M 1 2 := by simpa using hM.apply 1 2 + have hd : 0 ≤ M 0 0 * M 1 1 * M 2 2 - M 0 0 * M 1 2 ^ 2 - + M 0 1 ^ 2 * M 2 2 + 2 * M 0 1 * M 0 2 * M 1 2 - M 0 2 ^ 2 * M 1 1 := by + rw [Matrix.det_fin_three, h10, h20, h21] at hdet + nlinarith only [hdet] + refine Matrix.PosSemidef.of_dotProduct_mulVec_nonneg hM fun x => ?_ + have h := quadratic_three_nonnegative (M 0 0) (M 0 1) (M 0 2) + (M 1 1) (M 1 2) (M 2 2) (x 0) (x 1) (x 2) + (hdiag 0) (hdiag 1) (hdiag 2) h01 h02 h12 hd + simp [dotProduct, Matrix.mulVec, Fin.sum_univ_succ, h10, h20, h21] + nlinarith only [h] + +theorem zMatrix_posSemidef (z : Fin 3 → ℝ) : (zMatrix z).PosSemidef := by + apply posSemidef_three_of_principal_minors _ (zMatrix_isHermitian z) + (zMatrix_diag_nonnegative z) + · have h := zMatrix_principal_minor_two_nonnegative z 0 + simp [Matrix.det_fin_two, Matrix.submatrix, zMatrix, Fin.reduceAdd] at h ⊢ + nlinarith only [h] + · have h := zMatrix_principal_minor_two_nonnegative z 2 + simp [Matrix.det_fin_two, Matrix.submatrix, zMatrix, Fin.reduceAdd, Fin.reduceEq] at h ⊢ + nlinarith only [h] + · have h := zMatrix_principal_minor_two_nonnegative z 1 + simp [Matrix.det_fin_two, Matrix.submatrix, zMatrix, Fin.reduceAdd, Fin.reduceEq] at h ⊢ + nlinarith only [h] + · exact zMatrix_det_nonnegative z + +theorem choiLam_nonnegative (z y : Fin 3 → ℝ) : 0 ≤ choiLam z y := by + have h := (zMatrix_posSemidef z).dotProduct_mulVec_nonneg y + simpa only [star_trivial, zMatrix_quadratic] using h + +theorem qMatrix_posSemidef (y : Fin 3 → ℝ) : (qMatrix y).PosSemidef := by + refine Matrix.PosSemidef.of_dotProduct_mulVec_nonneg (qMatrix_isHermitian y) fun z => ?_ + simpa only [star_trivial, qMatrix_quadratic] using choiLam_nonnegative z y + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/FormRigidity.lean b/lean/OAI/Analysis/HyperbolicCones/FormRigidity.lean new file mode 100644 index 0000000000000000000000000000000000000000..14ac998ec9462b56cb9eaebbb43a4e280416cf9e --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/FormRigidity.lean @@ -0,0 +1,168 @@ +import OAI.Analysis.HyperbolicCones.FormBasic + +namespace OAI + +/-! A bilinear square dominated by the Choi--Lam form vanishes. -/ + +noncomputable section + +open scoped Matrix.Norms.L2Operator + +universe u + +namespace Paper256 + +theorem form_linear_coordinates {W : Type u} [AddCommGroup W] [Module ℝ W] + (f : (Fin 3 → ℝ) →ₗ[ℝ] W) (x : Fin 3 → ℝ) : + f x = ∑ i, x i • f (Pi.single i 1) := by + have hx : x = ∑ i, x i • (Pi.single i 1 : Fin 3 → ℝ) := by + ext j + simp [Finset.sum_apply, Pi.single_apply] + conv_lhs => rw [hx] + simp + +theorem form_bilinear_coordinates + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) (z y : Fin 3 → ℝ) : + l z y = ∑ i, ∑ j, (z i * y j) * l (Pi.single i 1) (Pi.single j 1) := by + rw [form_linear_coordinates l z] + simp only [LinearMap.sum_apply, LinearMap.smul_apply, smul_eq_mul] + apply Finset.sum_congr rfl + intro i _ + rw [form_linear_coordinates (l (Pi.single i 1)) y] + simp [Finset.mul_sum, mul_assoc] + +theorem dominated_form_vanishes_at_zero + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) + (z y : Fin 3 → ℝ) (hz : choiLam z y = 0) : l z y = 0 := by + have hh := h z y + rw [hz] at hh + nlinarith [sq_nonneg (l z y)] + +theorem dominated_form_cyclic_coefficient + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) (i : Fin 3) : + l (Pi.single i 1) (Pi.single (i + 2) 1) = 0 := + dominated_form_vanishes_at_zero l h _ _ (choiLam_cyclic_zero i) + +theorem dominated_form_sign_zero + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) + (σ : Fin 3 → ℝ) (hσ : ∀ i, σ i = 1 ∨ σ i = -1) : l σ σ = 0 := + dominated_form_vanishes_at_zero l h σ σ (choiLam_sign_zero σ hσ) + +theorem dominated_form_symmetric_coefficients + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) : + (l (Pi.single 0 1) (Pi.single 1 1) + l (Pi.single 1 1) (Pi.single 0 1) = 0) ∧ + (l (Pi.single 0 1) (Pi.single 2 1) + l (Pi.single 2 1) (Pi.single 0 1) = 0) ∧ + (l (Pi.single 1 1) (Pi.single 2 1) + l (Pi.single 2 1) (Pi.single 1 1) = 0) := by + have h0 := dominated_form_vanishes_at_zero l h ![1, 1, 1] ![1, 1, 1] + (by simp [choiLam_expand, Matrix.cons_val]; norm_num) + have h1 := dominated_form_vanishes_at_zero l h ![1, 1, -1] ![1, 1, -1] + (by simp [choiLam_expand, Matrix.cons_val]; norm_num) + have h2 := dominated_form_vanishes_at_zero l h ![1, -1, 1] ![1, -1, 1] + (by simp [choiLam_expand, Matrix.cons_val]; norm_num) + have h3 := dominated_form_vanishes_at_zero l h ![-1, 1, 1] ![-1, 1, 1] + (by simp [choiLam_expand, Matrix.cons_val]; norm_num) + rw [form_bilinear_coordinates] at h0 h1 h2 h3 + simp [Fin.sum_univ_succ] at h0 h1 h2 h3 + constructor + · linarith + constructor <;> linarith + +theorem dominated_form_off_diagonal + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) (i j : Fin 3) (hij : i ≠ j) : + l (Pi.single i 1) (Pi.single j 1) = 0 := by + obtain ⟨h01, h02, h12⟩ := dominated_form_symmetric_coefficients l h + have h20 := dominated_form_cyclic_coefficient l h 0 + have h10 := dominated_form_cyclic_coefficient l h 1 + have h21 := dominated_form_cyclic_coefficient l h 2 + simp only [Fin.reduceAdd] at h20 h10 h21 + fin_cases i <;> fin_cases j <;> simp_all [Fin.reduceEq] + +theorem form_curve_of_off_diagonal + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (hoff : ∀ i j : Fin 3, i ≠ j → l (Pi.single i 1) (Pi.single j 1) = 0) + (i : Fin 3) (s : ℝ) : + l ((Pi.single i 1 : Fin 3 → ℝ) + s • Pi.single (i + 2) 1) + (Pi.single (i + 2) 1 + s • Pi.single i 1) = + s * (l (Pi.single i 1) (Pi.single i 1) + + l (Pi.single (i + 2) 1) (Pi.single (i + 2) 1)) := by + have hi : i ≠ i + 2 := by fin_cases i <;> decide + simp [map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply, + hoff i (i + 2) hi, hoff (i + 2) i hi.symm] + ring + +theorem dominated_form_diagonal_formula + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) (z y : Fin 3 → ℝ) : + l z y = ∑ i, z i * y i * l (Pi.single i 1) (Pi.single i 1) := by + rw [form_bilinear_coordinates] + apply Finset.sum_congr rfl + intro i _ + rw [Finset.sum_eq_single i] + · intro j _ hji + simp [dominated_form_off_diagonal l h i j (Ne.symm hji)] + · simp + +theorem dominated_form_diagonal_pair_bound + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) (i : Fin 3) (s : ℝ) (hs : s ≠ 0) : + (l (Pi.single i 1) (Pi.single i 1) + + l (Pi.single (i + 2) 1) (Pi.single (i + 2) 1)) ^ 2 ≤ s ^ 2 := by + have hh := h ((Pi.single i 1 : Fin 3 → ℝ) + s • Pi.single (i + 2) 1) + (Pi.single (i + 2) 1 + s • Pi.single i 1) + rw [choiLam_curve, form_curve_of_off_diagonal l (dominated_form_off_diagonal l h)] at hh + apply le_of_mul_le_mul_left (a := s ^ 2) _ (sq_pos_of_ne_zero hs) + nlinarith only [hh] + +theorem dominated_form_diagonal_pair_zero + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) (i : Fin 3) : + l (Pi.single i 1) (Pi.single i 1) + + l (Pi.single (i + 2) 1) (Pi.single (i + 2) 1) = 0 := by + let c := l (Pi.single i 1) (Pi.single i 1) + + l (Pi.single (i + 2) 1) (Pi.single (i + 2) 1) + change c = 0 + by_contra hc + have hh := dominated_form_diagonal_pair_bound l h i (c / 2) (div_ne_zero hc (by norm_num)) + change c ^ 2 ≤ (c / 2) ^ 2 at hh + nlinarith [sq_pos_of_ne_zero hc] + +theorem dominated_form_diagonal_zero + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) (i : Fin 3) : + l (Pi.single i 1) (Pi.single i 1) = 0 := by + have h0 := dominated_form_diagonal_pair_zero l h 0 + have h1 := dominated_form_diagonal_pair_zero l h 1 + have h2 := dominated_form_diagonal_pair_zero l h 2 + simp only [Fin.reduceAdd] at h0 h1 h2 + fin_cases i <;> simp only [Fin.reduceFinMk] <;> linarith + +theorem dominated_form_coefficient_zero + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) (i j : Fin 3) : + l (Pi.single i 1) (Pi.single j 1) = 0 := by + by_cases hij : i = j + · subst j + exact dominated_form_diagonal_zero l h i + · exact dominated_form_off_diagonal l h i j hij + +theorem choiLam_no_dominated_square + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) : l = 0 := by + apply LinearMap.ext + intro z + apply LinearMap.ext + intro y + change l z y = 0 + rw [form_bilinear_coordinates] + simp [dominated_form_coefficient_zero l h] + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/FormSign.lean b/lean/OAI/Analysis/HyperbolicCones/FormSign.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e0fe5d4f28b904a96b0a2a789d155e118e830fa --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/FormSign.lean @@ -0,0 +1,42 @@ +import OAI.Analysis.HyperbolicCones.FormRigidity + +namespace OAI + +/-! The sign-vector coefficient identity for the Choi–Lam form. -/ + +noncomputable section + +namespace Paper256 + +theorem form_sign_expansion + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (σ : Fin 3 → ℝ) (hσ : ∀ i, σ i = 1 ∨ σ i = -1) : + l σ σ = (∑ i, l (Pi.single i 1) (Pi.single i 1)) + + (l (Pi.single 0 1) (Pi.single 1 1) + l (Pi.single 1 1) (Pi.single 0 1)) * σ 0 * σ 1 + + (l (Pi.single 0 1) (Pi.single 2 1) + l (Pi.single 2 1) (Pi.single 0 1)) * σ 0 * σ 2 + + (l (Pi.single 1 1) (Pi.single 2 1) + l (Pi.single 2 1) (Pi.single 1 1)) * σ 1 * σ 2 := by + have hs (i : Fin 3) : σ i ^ 2 = 1 := by + rcases hσ i with hi | hi <;> simp [hi] + rw [form_bilinear_coordinates] + simp [Fin.sum_univ_succ] + linear_combination + l (Pi.single 0 1) (Pi.single 0 1) * hs 0 + + l (Pi.single 1 1) (Pi.single 1 1) * hs 1 + + l (Pi.single 2 1) (Pi.single 2 1) * hs 2 + +theorem dominated_form_sign_relation + (l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ) + (h : ∀ z y, (l z y) ^ 2 ≤ choiLam z y) + (σ : Fin 3 → ℝ) (hσ : ∀ i, σ i = 1 ∨ σ i = -1) : + 0 = (∑ i, l (Pi.single i 1) (Pi.single i 1)) + + (l (Pi.single 0 1) (Pi.single 1 1) + l (Pi.single 1 1) (Pi.single 0 1)) * σ 0 * σ 1 + + (l (Pi.single 0 1) (Pi.single 2 1) + l (Pi.single 2 1) (Pi.single 0 1)) * σ 0 * σ 2 + + (l (Pi.single 1 1) (Pi.single 2 1) + l (Pi.single 2 1) (Pi.single 1 1)) * σ 1 * σ 2 := by + rw [← form_sign_expansion l σ hσ] + exact (dominated_form_sign_zero l h σ hσ).symm + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/GramProjection.lean b/lean/OAI/Analysis/HyperbolicCones/GramProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..3fd550c56385f95ae6c3ff041e14344c69c5e007 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/GramProjection.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.HyperbolicCones.Model + +namespace OAI + +noncomputable section + +open scoped ContDiff +open ContinuousLinearMap + +universe u v w + +namespace Paper256 + +section Gram + +variable {E : Type u} {F : Type v} {W : Type w} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [NormedAddCommGroup W] [NormedSpace ℝ W] + [CompleteSpace E] [CompleteSpace F] + +def gramProjection (T : E →L[ℝ] F) : F →L[ℝ] F := + T.comp ((Ring.inverse (T.adjoint.comp T)).comp T.adjoint) + +theorem gram_isUnit_of_injective [FiniteDimensional ℝ E] + (T : E →L[ℝ] F) (hT : Function.Injective T) : IsUnit (T.adjoint.comp T) := by + have hk : (T.adjoint.comp T).ker = ⊥ := by + rw [T.ker_adjoint_comp_self] + exact LinearMap.ker_eq_bot.mpr hT + have hi : Function.Injective (T.adjoint.comp T) := LinearMap.ker_eq_bot.mp hk + exact ContinuousLinearMap.isUnit_iff_bijective.mpr + ⟨hi, LinearMap.surjective_of_injective hi⟩ + +theorem gramProjection_eq [FiniteDimensional ℝ F] + (T : E →L[ℝ] F) (hT : IsUnit (T.adjoint.comp T)) : + gramProjection T = T.range.starProjection := by + ext y + symm + apply Submodule.eq_starProjection_of_mem_orthogonal + · exact ⟨Ring.inverse (T.adjoint.comp T) (T.adjoint y), rfl⟩ + · rw [T.orthogonal_range] + change T.adjoint (y - T (Ring.inverse (T.adjoint.comp T) (T.adjoint y))) = 0 + rw [map_sub] + change T.adjoint y - ((T.adjoint.comp T) * Ring.inverse (T.adjoint.comp T)) + (T.adjoint y) = 0 + rw [Ring.mul_inverse_cancel _ hT] + simp + +theorem one_sub_gramProjection_eq_kernel [FiniteDimensional ℝ F] + (T : E →L[ℝ] F) (hT : IsUnit (T.adjoint.comp T)) + (A : F →L[ℝ] F) (hA : IsSelfAdjoint A) (hr : T.range = A.range) : + 1 - gramProjection T = A.ker.starProjection := by + rw [gramProjection_eq T hT, hr] + change ContinuousLinearMap.id ℝ F - A.range.starProjection = A.ker.starProjection + rw [← Submodule.starProjection_orthogonal] + simp only [A.orthogonal_range, hA.adjoint_eq] + +theorem contDiffOn_gramProjection (T : W → E →L[ℝ] F) (U : Set W) + (hT : ContDiffOn ℝ ∞ T U) + (hu : ∀ x ∈ U, IsUnit ((T x).adjoint.comp (T x))) : + ContDiffOn ℝ ∞ (fun x => gramProjection (T x)) U := by + have hadj : ContDiff ℝ ∞ (fun A : E →L[ℝ] F => A.adjoint) := + (ContinuousLinearMap.adjoint : (E →L[ℝ] F) ≃ₗᵢ[ℝ] (F →L[ℝ] E)).contDiff + have htadj : ContDiffOn ℝ ∞ (fun x => (T x).adjoint) U := hadj.comp_contDiffOn hT + have hg := htadj.clm_comp hT + have hi : ContDiffOn ℝ ∞ (fun x => Ring.inverse ((T x).adjoint.comp (T x))) U := by + intro x hx + exact ((contDiffAt_ringInverse ℝ (hu x hx).unit).congr_of_eventuallyEq + (by exact Filter.Eventually.of_forall fun _ => rfl)).comp_contDiffWithinAt x + (hg x hx) + exact hT.clm_comp (hi.clm_comp htadj) + +end Gram + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/Hyperbolicity.lean b/lean/OAI/Analysis/HyperbolicCones/Hyperbolicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..56225d686ef0ada80446b222a8c42ecba1201e50 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/Hyperbolicity.lean @@ -0,0 +1,48 @@ +import OAI.Analysis.HyperbolicCones.ComplexPositive +import OAI.Analysis.HyperbolicCones.MatrixResolvent +import OAI.Analysis.HyperbolicCones.LineEvaluation + +namespace OAI + +noncomputable section + +open scoped Matrix.Norms.L2Operator ComplexOrder +open Matrix + +namespace Paper256 + +theorem matrixValue_nonzero_nonreal (X Z : Sym 4) (y : Fin 3 → ℝ) + (z : ℂ) (hz : z.im ≠ 0) : + matrixValue (z • (1 : Mat 4 ℂ) - (X : Mat 4 ℝ).map Complex.ofReal) + (z • (1 : Mat 4 ℂ) - (Z : Mat 4 ℝ).map Complex.ofReal) + (fun i => -(y i : ℂ)) ≠ 0 := by + have hu := complex_resolvent_isUnit (X : Mat 4 ℝ) X.property z hz + have hd := (Matrix.isUnit_iff_isUnit_det _).1 hu + have hh := positive_map_resolvent_isUnit + ((X : Mat 4 ℝ).map Complex.ofReal) ((Z : Mat 4 ℝ).map Complex.ofReal) + (isHermitian_complexify _ X.property) (isHermitian_complexify _ Z.property) + (phiLinear (fun i => ((-y) i : ℂ))) + (fun M => phi_conjTranspose (-y) M) + (fun M hM => phi_complex_posSemidef (-y) M hM) z hz + change IsUnit (z • (1 : Mat 4 ℂ) - (Z : Mat 4 ℝ).map Complex.ofReal - + phi (fun i => ((-y) i : ℂ)) + ((z • (1 : Mat 4 ℂ) - (X : Mat 4 ℝ).map Complex.ofReal)⁻¹)) at hh + simp only [Pi.neg_apply, Complex.ofReal_neg] at hh + rw [matrixValue_inverse _ _ _ hd] + exact mul_ne_zero (pow_ne_zero 4 hd.ne_zero) + ((Matrix.isUnit_iff_isUnit_det _).1 hh).ne_zero + +theorem linePolynomial_complex_roots_real (x : Ambient) (z : ℂ) + (hz : (linePolynomial x).aeval z = 0) : z.im = 0 := by + rcases x with ⟨⟨X, Z⟩, y⟩ + by_contra hn + apply matrixValue_nonzero_nonreal X Z y z hn + change (linePolynomial ((X, Z), y)).eval₂ (algebraMap ℝ ℂ) z = 0 at hz + rw [linePolynomial_eval₂] at hz + exact hz + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/InverseBounds.lean b/lean/OAI/Analysis/HyperbolicCones/InverseBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f548e2ef77f3c95e31b75b7f38992fe1800bec3 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/InverseBounds.lean @@ -0,0 +1,62 @@ +import OAI.Analysis.HyperbolicCones.ConePositive + +namespace OAI + +noncomputable section + +open Matrix Filter +open scoped Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +theorem inverse_shift_le_scalar {n : ℕ} (X : Sym n) + (hX : (X : Mat n ℝ).PosDef) (t : ℝ) (ht : 0 < t) : + ((X : Mat n ℝ) + t • 1)⁻¹ ≤ t⁻¹ • (1 : Mat n ℝ) := by + rw [posDef_shift_inverse_eq_cfc X hX t ht.le] + calc + cfc (fun x : ℝ => (x + t)⁻¹) (X : Mat n ℝ) ≤ + cfc (fun _ : ℝ => t⁻¹) (X : Mat n ℝ) := by + apply cfc_mono _ (X.val.finite_real_spectrum.continuousOn _) + (X.val.finite_real_spectrum.continuousOn _) + intro x hx + exact inv_anti₀ ht (le_add_of_nonneg_left (posDef_real_spectrum_positive hX hx).le) + _ = algebraMap ℝ (Mat n ℝ) t⁻¹ := cfc_const t⁻¹ (X : Mat n ℝ) X.property + _ = t⁻¹ • (1 : Mat n ℝ) := Algebra.algebraMap_eq_smul_one _ + +theorem phi_inverse_shift_bounds (X : Sym 4) (hX : (X : Mat 4 ℝ).PosDef) + (y : Fin 3 → ℝ) (t : ℝ) (ht : 0 < t) : + 0 ≤ phi y ((X : Mat 4 ℝ) + t • 1)⁻¹ ∧ + phi y ((X : Mat 4 ℝ) + t • 1)⁻¹ ≤ t⁻¹ • phi y (1 : Mat 4 ℝ) := by + constructor + · exact (phi_posSemidef y _ (positive_shift X hX t ht.le).inv.posSemidef).nonneg + · have h := (phi_monotone y) (inverse_shift_le_scalar X hX t ht) + simpa only [phi_smul] using h + +theorem coneResidual_eventually_posDef (X Z : Sym 4) (y : Fin 3 → ℝ) + (hX : (X : Mat 4 ℝ).PosDef) : + ∀ᶠ t : ℝ in atTop, (coneResidual X Z y t : Mat 4 ℝ).PosDef := by + filter_upwards [eventually_gt_atTop ‖(coneResidual X Z y 0 : Mat 4 ℝ)‖] with t ht + have ht0 : 0 < t := lt_of_le_of_lt (norm_nonneg _) ht + exact posDef_of_shift_bound (coneResidual X Z y 0) (coneResidual X Z y t) t + (coneResidual_lower_bound X Z y t + (posDef_inverse_sub_shift_inverse_posSemidef X hX t ht0.le)) ht + +theorem coneResidual_exists_singular (X Z : Sym 4) (y : Fin 3 → ℝ) + (hX : (X : Mat 4 ℝ).PosDef) + (h0 : ¬ (coneResidual X Z y 0 : Mat 4 ℝ).PosSemidef) : + ∃ t : ℝ, 0 < t ∧ (coneResidual X Z y t : Mat 4 ℝ).det = 0 := by + by_contra! h + apply h0 + apply posSemidef_of_nonsingular_path (coneResidual X Z y) + (continuousOn_coneResidual X Z y hX) + (continuousAt_coneResidual X Z y 0 (by simpa using hX)) + · intro t ht + exact (Matrix.isUnit_iff_isUnit_det _).mpr (isUnit_iff_ne_zero.mpr (h t ht)) + · exact coneResidual_exists_posDef X Z y + (fun t ht => posDef_inverse_sub_shift_inverse_posSemidef X hX t ht) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/InverseOrder.lean b/lean/OAI/Analysis/HyperbolicCones/InverseOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe66133f89cc1829035241089a34d57301e16555 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/InverseOrder.lean @@ -0,0 +1,61 @@ +import OAI.Analysis.HyperbolicCones.KernelSpectrum + +namespace OAI + +/-! Simultaneous spectral comparison of a positive matrix and its scalar shifts. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix +namespace Paper256 + +theorem matrix_cfc_affine {n : ℕ} (H : Sym n) (a b : ℝ) : + cfc (fun x : ℝ => a + b * x) (H : Mat n ℝ) = + a • (1 : Mat n ℝ) + b • (H : Mat n ℝ) := by + calc + _ = algebraMap ℝ (Mat n ℝ) a + cfc (fun x : ℝ => b * x) (H : Mat n ℝ) := + cfc_const_add a (fun x : ℝ => b * x) (H : Mat n ℝ) + (H.val.finite_real_spectrum.continuousOn _) H.property + _ = _ := by + have hmul : cfc (fun x : ℝ => b * x) (H : Mat n ℝ) = b • (H : Mat n ℝ) := + cfc_const_mul_id b (H : Mat n ℝ) H.property + rw [hmul, Algebra.algebraMap_eq_smul_one] + +theorem posDef_inverse_eq_cfc {n : ℕ} (H : Sym n) (hH : (H : Mat n ℝ).PosDef) : + (H : Mat n ℝ)⁻¹ = cfc (fun x : ℝ => x⁻¹) (H : Mat n ℝ) := by + have hi := cfc_inv (fun x : ℝ => x) (H : Mat n ℝ) + (fun x hx => (posDef_real_spectrum_positive hH hx).ne') + (H.val.finite_real_spectrum.continuousOn _) H.property + have hid : cfc (fun x : ℝ => x) (H : Mat n ℝ) = (H : Mat n ℝ) := + cfc_id' ℝ (H : Mat n ℝ) H.property + rw [hid, ← Matrix.nonsing_inv_eq_ringInverse] at hi + exact hi.symm + +theorem posDef_shift_inverse_eq_cfc {n : ℕ} (H : Sym n) + (hH : (H : Mat n ℝ).PosDef) (t : ℝ) (ht : 0 ≤ t) : + ((H : Mat n ℝ) + t • 1)⁻¹ = + cfc (fun x : ℝ => (x + t)⁻¹) (H : Mat n ℝ) := by + have hi := cfc_inv (fun x : ℝ => x + t) (H : Mat n ℝ) + (fun x hx => (add_pos_of_pos_of_nonneg (posDef_real_spectrum_positive hH hx) ht).ne') + (H.val.finite_real_spectrum.continuousOn _) H.property + have hshift : cfc (fun x : ℝ => x + t) (H : Mat n ℝ) = + (H : Mat n ℝ) + t • 1 := by + simpa only [add_comm, one_mul, one_smul] using matrix_cfc_affine H t 1 + rw [hshift, ← Matrix.nonsing_inv_eq_ringInverse] at hi + exact hi.symm + +theorem posDef_inverse_sub_shift_inverse_posSemidef {n : ℕ} (H : Sym n) + (hH : (H : Mat n ℝ).PosDef) (t : ℝ) (ht : 0 ≤ t) : + ((H : Mat n ℝ)⁻¹ - ((H : Mat n ℝ) + t • 1)⁻¹).PosSemidef := by + apply Matrix.nonneg_iff_posSemidef.mp + rw [sub_nonneg, posDef_inverse_eq_cfc H hH, posDef_shift_inverse_eq_cfc H hH t ht] + apply cfc_mono _ (H.val.finite_real_spectrum.continuousOn _) + (H.val.finite_real_spectrum.continuousOn _) + intro x hx + exact inv_anti₀ (posDef_real_spectrum_positive hH hx) (le_add_of_nonneg_right ht) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/KernelLimit.lean b/lean/OAI/Analysis/HyperbolicCones/KernelLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..e859d4eaece8bf9981b97216139200a7191434b8 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/KernelLimit.lean @@ -0,0 +1,50 @@ +import OAI.Analysis.HyperbolicCones.SpectralContinuity +import OAI.Analysis.HyperbolicCones.InverseOrder + +namespace OAI + +/-! The inverse-square-root kernel limit for every finite positive semidefinite matrix. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix Filter Topology +namespace Paper256 + +theorem inverseSquareRoot_affine_eq_cfc {n : ℕ} (H : Sym n) (t : ℝ) : + inverseSquareRoot (1 + (t - 1) • H) = + cfc (fun x : ℝ => (Real.sqrt (1 + (t - 1) * x))⁻¹) (H : Mat n ℝ) := by + have haff : cfc (fun x : ℝ => 1 + (t - 1) * x) (H : Mat n ℝ) = + ((1 + (t - 1) • H : Sym n) : Mat n ℝ) := by + simpa using matrix_cfc_affine H 1 (t - 1) + have hcomp := cfc_comp (fun x : ℝ => (Real.sqrt x)⁻¹) + (fun x : ℝ => 1 + (t - 1) * x) (H : Mat n ℝ) H.property + ((H.val.finite_real_spectrum.image _).continuousOn _) + (H.val.finite_real_spectrum.continuousOn _) + rw [haff] at hcomp + exact (inverseSquareRoot_eq_cfc _).trans hcomp.symm + +theorem inverseSquareRoot_affine_tendsto {n : ℕ} (H : Sym n) + (hH : (H : Mat n ℝ).PosSemidef) : + Tendsto (fun t : ℝ => inverseSquareRoot (1 + (t - 1) • H)) atTop + (𝓝 (kernelProjection (H : Mat n ℝ))) := by + have hc := matrix_cfc_tendsto (H : Mat n ℝ) H.property + (fun t x : ℝ => (Real.sqrt (1 + (t - 1) * x))⁻¹) + (fun x : ℝ => if x = 0 then 1 else 0) + (fun i => inverse_sqrt_affine_scalar_tendsto _ (hH.eigenvalues_nonneg i)) + simpa only [← inverseSquareRoot_affine_eq_cfc, ← kernelProjection_eq_cfc] using hc + +theorem inverseSquareRoot_kernel_limit (n : ℕ) (H : Sym n) + (hH : (H : Mat n ℝ).PosSemidef) : + Tendsto (fun t : ℝ => operatorNorm + (inverseSquareRoot (1 + (t - 1) • H) - kernelProjection (H : Mat n ℝ))) + atTop (𝓝 0) := by + have h := ((inverseSquareRoot_affine_tendsto H hH).sub_const + (kernelProjection (H : Mat n ℝ))).norm + have hop (A : Mat n ℝ) : operatorNorm A = ‖A‖ := (Matrix.l2_opNorm_def A).symm + simpa only [hop, sub_self, norm_zero] using h + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/KernelLocal.lean b/lean/OAI/Analysis/HyperbolicCones/KernelLocal.lean new file mode 100644 index 0000000000000000000000000000000000000000..f67a987a8964dd7fa61605386265451d1608a85e --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/KernelLocal.lean @@ -0,0 +1,72 @@ +import OAI.Analysis.HyperbolicCones.GramProjection + +namespace OAI + +noncomputable section + +open scoped ContDiff RealInnerProductSpace +open Set ContinuousLinearMap + +universe u v + +namespace Paper256 + +theorem exists_smooth_kernel_extension + {W : Type u} {F : Type v} [NormedAddCommGroup W] [NormedSpace ℝ W] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] + (S : Set W) (hne : S.Nonempty) (A : W → F →L[ℝ] F) + (hA : ContDiff ℝ ∞ A) (hs : ∀ u ∈ S, IsSelfAdjoint (A u)) : + ∃ v ∈ S, ∃ (U : Set W) (P : W → F →L[ℝ] F), + IsOpen U ∧ v ∈ U ∧ ContDiffOn ℝ ∞ P U ∧ + ∀ u ∈ U, u ∈ S → P u = (A u).ker.starProjection := by + let ranks : Set ℕ := (fun u => Module.finrank ℝ (A u).range) '' S + have hfin : ranks.Finite := Set.finite_iff_bddAbove.mpr ⟨Module.finrank ℝ F, by + rintro _ ⟨u, _, rfl⟩ + exact Submodule.finrank_le _⟩ + obtain ⟨r, hr, hmax⟩ := Set.exists_max_image ranks id hfin (hne.image _) + obtain ⟨v, hv, rfl⟩ := hr + let R : Submodule ℝ F := (A v).range + let T : W → R →L[ℝ] F := fun u => (A u).comp R.subtypeL + have hTv : Function.Injective (T v) := by + apply LinearMap.ker_eq_bot.mp + apply LinearMap.ker_eq_bot'.mpr + intro x hx + change A v (x : F) = 0 at hx + have hxo : (x : F) ∈ Rᗮ := by + change (x : F) ∈ (A v).rangeᗮ + rw [(A v).orthogonal_range, (hs v hv).adjoint_eq] + exact hx + apply Subtype.ext + exact inner_self_eq_zero.mp (hxo x x.property) + have ht : ContDiff ℝ ∞ T := hA.clm_comp contDiff_const + have hadj : ContDiff ℝ ∞ (fun B : R →L[ℝ] F => B.adjoint) := + (ContinuousLinearMap.adjoint : (R →L[ℝ] F) ≃ₗᵢ[ℝ] (F →L[ℝ] R)).contDiff + let G : W → R →L[ℝ] R := fun u => (T u).adjoint.comp (T u) + have hg : ContDiff ℝ ∞ G := (hadj.comp ht).clm_comp ht + let U : Set W := {u | IsUnit (G u)} + have huopen : IsOpen U := by + change IsOpen (G ⁻¹' {K : R →L[ℝ] R | IsUnit K}) + apply IsOpen.preimage hg.continuous + exact Units.isOpen (R := R →L[ℝ] R) + have hvu : v ∈ U := gram_isUnit_of_injective (T v) hTv + refine ⟨v, hv, U, fun u => 1 - gramProjection (T u), huopen, hvu, ?_, ?_⟩ + · exact contDiffOn_const.sub (contDiffOn_gramProjection T U ht.contDiffOn (fun _ hu => hu)) + · intro u hu hus + have hTu : Function.Injective (T u) := by + have hGi := (ContinuousLinearMap.isUnit_iff_bijective.mp hu).1 + intro x y hxy + apply hGi + exact congrArg (T u).adjoint hxy + have hrange : (T u).range = (A u).range := by + apply Submodule.eq_of_le_of_finrank_le + · rintro _ ⟨x, rfl⟩ + exact ⟨(x : F), rfl⟩ + · rw [LinearMap.finrank_range_of_inj hTu] + exact hmax _ ⟨u, hus, rfl⟩ + exact one_sub_gramProjection_eq_kernel (T u) hu (A u) (hs u hus) hrange + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/KernelSmooth.lean b/lean/OAI/Analysis/HyperbolicCones/KernelSmooth.lean new file mode 100644 index 0000000000000000000000000000000000000000..5477d6cdc84455cdc0edc6c3c39833dc69c19c6f --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/KernelSmooth.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.HyperbolicCones.KernelLocal +import OAI.Analysis.HyperbolicCones.Coordinates + +namespace OAI + +noncomputable section + +open scoped ContDiff Matrix.Norms.L2Operator +open Set Matrix ContinuousLinearMap + +namespace Paper256 + +theorem contDiff_outerSym : ContDiff ℝ ∞ (outerSym : Vec 4 → Sym 4) := by + have hcoord : ContDiff ℝ ∞ (fun v : Vec 4 => + fun ij : SymIndex => v ij.val.1 * v ij.val.2) := by + apply contDiff_pi.mpr + intro ij + exact (contDiff_piLp_apply (𝕜 := ℝ) (p := 2) (i := ij.val.1)).mul + (contDiff_piLp_apply (𝕜 := ℝ) (p := 2) (i := ij.val.2)) + have heq : (outerSym : Vec 4 → Sym 4) = fun v => + symmetricCoordinateEquiv.symm (fun ij => v ij.val.1 * v ij.val.2) := by + funext v + apply symmetricCoordinateEquiv.injective + rw [LinearEquiv.apply_symm_apply] + rfl + rw [heq] + exact symmetricCoordinateEquiv.symm.toContinuousLinearEquiv.contDiff.comp hcoord + +def symmetricOperatorLinear (c : ℕ) : Sym c →ₗ[ℝ] (Vec c →L[ℝ] Vec c) := + (Matrix.toEuclideanCLM (n := Fin c) (𝕜 := ℝ)).toAlgEquiv.toLinearEquiv.toLinearMap.comp + (selfAdjoint.submodule ℝ (Mat c ℝ)).subtype + +theorem contDiff_kernelFamily (c : ℕ) (E : Sym 4 →ₗ[ℝ] Sym c) : + ContDiff ℝ ∞ (fun u => symmetricOperatorLinear c (E (1 - outerSym u))) := by + exact (symmetricOperatorLinear c).toContinuousLinearMap.contDiff.comp + (E.toContinuousLinearMap.contDiff.comp (contDiff_const.sub contDiff_outerSym)) + +theorem kernelFamily_isSelfAdjoint (c : ℕ) (E : Sym 4 →ₗ[ℝ] Sym c) (u : Vec 4) : + IsSelfAdjoint (symmetricOperatorLinear c (E (1 - outerSym u))) := + (E (1 - outerSym u)).property.map (Matrix.toEuclideanCLM (n := Fin c) (𝕜 := ℝ)) + +theorem kernel_projection_smooth_local_extension (c : ℕ) (_hC : 0 < c) + (E : Sym 4 →ₗ[ℝ] Sym c) : + ∃ (v : Vec 4) (U : Set (Vec 4)) (F : Vec 4 → Mat c ℝ), + ‖v‖ = 1 ∧ v 0 ≠ 0 ∧ IsOpen U ∧ v ∈ U ∧ ContDiffOn ℝ ∞ F U ∧ + ∀ u ∈ U, ‖u‖ = 1 → + F u = kernelProjection (E (1 - outerSym u) : Mat c ℝ) := by + let A : Vec 4 → Vec c →L[ℝ] Vec c := fun u => symmetricOperatorLinear c (E (1 - outerSym u)) + have hA : ContDiff ℝ ∞ A := contDiff_kernelFamily c E + let S : Set (Vec 4) := {u | ‖u‖ = 1 ∧ u 0 ≠ 0} + have hs : S.Nonempty := ⟨PiLp.single 2 0 1, by simp [S]⟩ + have hself (u : Vec 4) (_hu : u ∈ S) : IsSelfAdjoint (A u) := + kernelFamily_isSelfAdjoint c E u + obtain ⟨v, hv, U, P, hU, hvU, hP, heq⟩ := exists_smooth_kernel_extension S hs A hA hself + let U' := U ∩ {u : Vec 4 | u 0 ≠ 0} + let F : Vec 4 → Mat c ℝ := fun u => + (Matrix.toEuclideanCLM (n := Fin c) (𝕜 := ℝ)).symm (P u) + refine ⟨v, U', F, hv.1, hv.2, ?_, ⟨hvU, hv.2⟩, ?_, ?_⟩ + · have hc : Continuous (fun u : Vec 4 => u 0) := + (contDiff_piLp_apply (𝕜 := ℝ) (p := 2) (n := ∞) (i := (0 : Fin 4))).continuous + exact hU.inter (isOpen_ne.preimage hc) + · exact (Matrix.toEuclideanCLM (n := Fin c) (𝕜 := ℝ)).symm.toAlgEquiv.toLinearEquiv.toContinuousLinearEquiv.contDiff.comp_contDiffOn + (hP.mono (fun _ hu => hu.1)) + · intro u hu hunit + apply (Matrix.toEuclideanCLM (n := Fin c) (𝕜 := ℝ)).injective + change (Matrix.toEuclideanCLM (n := Fin c) (𝕜 := ℝ)) + ((Matrix.toEuclideanCLM (n := Fin c) (𝕜 := ℝ)).symm (P u)) = _ + rw [StarAlgEquiv.apply_symm_apply, heq u hu.1 ⟨hunit, hu.2⟩] + apply ContinuousLinearMap.coe_injective + change _ = Matrix.toEuclideanLin (kernelProjection (E (1 - outerSym u) : Mat c ℝ)) + rw [kernelProjection, LinearEquiv.apply_symm_apply] + rfl + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/KernelSpectrum.lean b/lean/OAI/Analysis/HyperbolicCones/KernelSpectrum.lean new file mode 100644 index 0000000000000000000000000000000000000000..9deab3fb0b68469c6837c155d6aab379e550c9cf --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/KernelSpectrum.lean @@ -0,0 +1,96 @@ +import OAI.Analysis.HyperbolicCones.MatrixPositive + +namespace OAI + +/-! Spectral identities for the inverse square root. -/ + +noncomputable section + +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix + +namespace Paper256 + +theorem inverseSquareRoot_eq_cfc {n : ℕ} (H : Sym n) : + inverseSquareRoot H = cfc (fun x : ℝ => (Real.sqrt x)⁻¹) (H : Mat n ℝ) := by + let hH : (H : Mat n ℝ).IsHermitian := H.property + rw [hH.cfc_eq] + simp [inverseSquareRoot, Matrix.IsHermitian.cfc, Unitary.conjStarAlgAut_apply, + Function.comp_def, Matrix.star_eq_conjTranspose] + +theorem matrix_cfc_mul {n : ℕ} (H : Sym n) (f g : ℝ → ℝ) : + cfc (fun x => f x * g x) (H : Mat n ℝ) = + cfc f (H : Mat n ℝ) * cfc g (H : Mat n ℝ) := + cfc_mul f g _ (H.val.finite_real_spectrum.continuousOn f) + (H.val.finite_real_spectrum.continuousOn g) + +theorem inverseSquareRoot_isHermitian {n : ℕ} (H : Sym n) : + (inverseSquareRoot H).IsHermitian := by + rw [inverseSquareRoot_eq_cfc] + exact IsSelfAdjoint.cfc + +theorem inverseSquareRoot_transpose {n : ℕ} (H : Sym n) : + (inverseSquareRoot H)ᵀ = inverseSquareRoot H := + Matrix.isHermitian_iff_isSymm.mp (inverseSquareRoot_isHermitian H) + +theorem posDef_real_spectrum_positive {n : ℕ} {A : Mat n ℝ} (hA : A.PosDef) + {x : ℝ} (hx : x ∈ spectrum ℝ A) : 0 < x := by + rw [hA.isHermitian.spectrum_real_eq_range_eigenvalues] at hx + obtain ⟨i, rfl⟩ := hx + exact hA.eigenvalues_pos i + +theorem inverseSquareRoot_conjugate {n : ℕ} (H : Sym n) (hH : (H : Mat n ℝ).PosDef) : + (inverseSquareRoot H)ᵀ * (H : Mat n ℝ) * inverseSquareRoot H = 1 := by + rw [inverseSquareRoot_transpose, inverseSquareRoot_eq_cfc] + let f : ℝ → ℝ := fun x => (Real.sqrt x)⁻¹ + have hid : cfc (fun x : ℝ => x) (H : Mat n ℝ) = (H : Mat n ℝ) := + cfc_id' ℝ (H : Mat n ℝ) H.property + change cfc f (H : Mat n ℝ) * (H : Mat n ℝ) * cfc f (H : Mat n ℝ) = 1 + calc + cfc f (H : Mat n ℝ) * (H : Mat n ℝ) * cfc f (H : Mat n ℝ) = + cfc (fun x => f x * x * f x) (H : Mat n ℝ) := by + rw [matrix_cfc_mul H (fun x => f x * x) f, + matrix_cfc_mul H f (fun x => x)] + rw [hid] + _ = cfc (fun _ : ℝ => 1) (H : Mat n ℝ) := by + apply cfc_congr + intro x hx + have hxpos := posDef_real_spectrum_positive hH hx + have hs : Real.sqrt x ≠ 0 := (Real.sqrt_pos.mpr hxpos).ne' + dsimp [f] + field_simp + exact (Real.sq_sqrt hxpos.le).symm + _ = 1 := cfc_const_one ℝ (H : Mat n ℝ) H.property + +theorem inverseSquareRoot_isUnit {n : ℕ} (H : Sym n) (hH : (H : Mat n ℝ).PosDef) : + IsUnit (inverseSquareRoot H) := by + rw [Matrix.isUnit_iff_isUnit_det, isUnit_iff_ne_zero] + intro hs + have h := congrArg Matrix.det (inverseSquareRoot_conjugate H hH) + simp [Matrix.det_mul, Matrix.det_transpose, hs] at h + +theorem inverseSquareRoot_commute {n : ℕ} (H : Sym n) : + Commute (inverseSquareRoot H) (H : Mat n ℝ) := by + rw [inverseSquareRoot_eq_cfc] + have hid : cfc (fun x : ℝ => x) (H : Mat n ℝ) = (H : Mat n ℝ) := + cfc_id' ℝ (H : Mat n ℝ) H.property + simpa only [hid] using + cfc_commute_cfc (fun x : ℝ => (Real.sqrt x)⁻¹) (fun x => x) (H : Mat n ℝ) + +theorem inverseSquareRoot_sq {n : ℕ} (H : Sym n) (hH : (H : Mat n ℝ).PosDef) : + inverseSquareRoot H * inverseSquareRoot H = (H : Mat n ℝ)⁻¹ := by + have h := inverseSquareRoot_conjugate H hH + rw [inverseSquareRoot_transpose] at h + have hi : (inverseSquareRoot H * inverseSquareRoot H) * (H : Mat n ℝ) = 1 := by + calc + _ = inverseSquareRoot H * (inverseSquareRoot H * (H : Mat n ℝ)) := mul_assoc _ _ _ + _ = inverseSquareRoot H * ((H : Mat n ℝ) * inverseSquareRoot H) := by + rw [(inverseSquareRoot_commute H).eq] + _ = 1 := by simpa only [mul_assoc] using h + exact (Matrix.inv_eq_left_inv hi).symm + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/KernelTangent.lean b/lean/OAI/Analysis/HyperbolicCones/KernelTangent.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b7dd2f8ecd1f7f17348b0ca31835ba96231b96a --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/KernelTangent.lean @@ -0,0 +1,40 @@ +import OAI.Analysis.HyperbolicCones.KernelSmooth +import OAI.Analysis.HyperbolicCones.TangentBasic + +namespace OAI + +noncomputable section + +open scoped ContDiff Topology RealInnerProductSpace Matrix.Norms.L2Operator +open Set Filter + +namespace Paper256 + +theorem kernel_projection_tangent_derivative (c : ℕ) (hC : 0 < c) + (E : Sym 4 →ₗ[ℝ] Sym c) : + ∃ (v : Vec 4) (T : Vec 4 →ₗ[ℝ] Mat c ℝ), + ‖v‖ = 1 ∧ v 0 ≠ 0 ∧ ∀ h : Vec 4, inner ℝ v h = 0 → + HasDerivAt (fun s : ℝ => kernelProjection + (E (1 - outerSym (tangentCurve v h s)) : Mat c ℝ)) (T h) 0 := by + obtain ⟨v, U, F, hv, hv0, hU, hvU, hF, heq⟩ := + kernel_projection_smooth_local_extension c hC E + have hd : DifferentiableAt ℝ F v := + (hF.contDiffAt (hU.mem_nhds hvU)).differentiableAt (by norm_num) + refine ⟨v, (fderiv ℝ F v).toLinearMap, hv, hv0, ?_⟩ + intro h hh + have hc := tangentCurve_derivative v h + have hcomp : HasDerivAt (fun s => F (tangentCurve v h s)) ((fderiv ℝ F v) h) 0 := by + simpa only [Function.comp_apply] using! + hd.hasFDerivAt.comp_hasDerivAt_of_eq 0 hc (by simp [tangentCurve]) + apply hcomp.congr_of_eventuallyEq + have hmem : ∀ᶠ s in 𝓝 (0 : ℝ), tangentCurve v h s ∈ U := by + apply hc.continuousAt.preimage_mem_nhds + simpa [tangentCurve] using hU.mem_nhds hvU + filter_upwards [hmem] with s hs + exact (heq _ hs (tangentCurve_unit v h hv hh s)).symm + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/LeastEigenvalue.lean b/lean/OAI/Analysis/HyperbolicCones/LeastEigenvalue.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e56920bb9b04bdb0658ea3525d7f934eb48938d --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/LeastEigenvalue.lean @@ -0,0 +1,116 @@ +import OAI.Analysis.HyperbolicCones.MaxEigenvalue + +namespace OAI + +/-! The least spectral value and its continuity in the real symmetric matrix space. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix Filter Topology +universe u + +namespace Paper256 + +def leastEigenvalue {n : ℕ} (H : Sym n) : ℝ := + ‖(H : Mat n ℝ)‖ - ‖‖(H : Mat n ℝ)‖ • (1 : Mat n ℝ) - (H : Mat n ℝ)‖ + +theorem leastEigenvalue_isLeast {n : ℕ} [NeZero n] (H : Sym n) : + IsLeast (spectrum ℝ (H : Mat n ℝ)) (leastEigenvalue H) := by + let A : Mat n ℝ := H + let B : Mat n ℝ := ‖A‖ • 1 - A + have hB : B.PosSemidef := by + apply (posSemidef_scalar_sub_iff A H.property ‖A‖).mpr + intro x hx + exact (le_abs_self x).trans (spectrum.norm_le_norm_of_mem hx) + have hshift : cfc (fun x : ℝ => ‖A‖ - x) A = B := by + simpa only [A, B, neg_one_mul, neg_one_smul, sub_eq_add_neg] using matrix_cfc_affine H ‖A‖ (-1) + have hspec : spectrum ℝ B = (fun x : ℝ => ‖A‖ - x) '' spectrum ℝ A := by + have h := cfc_map_spectrum (fun x : ℝ => ‖A‖ - x) A H.property + (A.finite_real_spectrum.continuousOn _) + rwa [hshift] at h + have hg := posSemidef_norm_isGreatest B hB + constructor + · have hm := hg.1 + rw [hspec] at hm + obtain ⟨x, hx, heq⟩ := hm + have hm : leastEigenvalue H = x := by + change ‖A‖ - ‖B‖ = x + linarith + simpa only [hm] using hx + · intro x hx + have hb : ‖A‖ - x ≤ ‖B‖ := hg.2 (hspec.symm ▸ ⟨x, hx, rfl⟩) + change ‖A‖ - ‖B‖ ≤ x + linarith + +theorem leastEigenvalue_nonneg_iff {n : ℕ} [NeZero n] (H : Sym n) : + 0 ≤ leastEigenvalue H ↔ (H : Mat n ℝ).PosSemidef := by + constructor + · intro h + apply Matrix.nonneg_iff_posSemidef.mp + apply (StarOrderedRing.nonneg_iff_spectrum_nonneg (R := ℝ) (p := IsSelfAdjoint) + (H : Mat n ℝ) H.property).mpr + intro x hx + exact h.trans ((leastEigenvalue_isLeast H).2 hx) + · intro h + exact spectrum_nonneg_of_nonneg h.nonneg (leastEigenvalue_isLeast H).1 + +theorem leastEigenvalue_neg_iff {n : ℕ} [NeZero n] (H : Sym n) : + leastEigenvalue H < 0 ↔ ¬(H : Mat n ℝ).PosSemidef := by + rw [← not_le, leastEigenvalue_nonneg_iff] + +theorem continuous_leastEigenvalue (n : ℕ) : Continuous (@leastEigenvalue n) := by + unfold leastEigenvalue + exact continuous_subtype_val.norm.sub + ((continuous_subtype_val.norm.smul continuous_const).sub continuous_subtype_val).norm + +theorem leastEigenvalue_tendsto {n : ℕ} {T : Type u} {L : Filter T} + {H : T → Sym n} {H₀ : Sym n} (hH : Tendsto H L (𝓝 H₀)) : + Tendsto (fun t => leastEigenvalue (H t)) L (𝓝 (leastEigenvalue H₀)) := + (continuous_leastEigenvalue n).continuousAt.tendsto.comp hH + +theorem leastEigenvalue_pos_iff {n : ℕ} [NeZero n] (H : Sym n) : + 0 < leastEigenvalue H ↔ (H : Mat n ℝ).PosDef := by + constructor + · intro h + have hH : (H : Mat n ℝ).IsHermitian := H.property + apply hH.posDef_iff_eigenvalues_pos.mpr + intro i + apply h.trans_le ((leastEigenvalue_isLeast H).2 ?_) + rw [hH.spectrum_real_eq_range_eigenvalues] + exact ⟨i, rfl⟩ + · intro h + exact posDef_real_spectrum_positive h (leastEigenvalue_isLeast H).1 + +theorem det_eq_zero_of_leastEigenvalue_eq_zero {n : ℕ} [NeZero n] + (H : Sym n) (h : leastEigenvalue H = 0) : Matrix.det (H : Mat n ℝ) = 0 := by + have hz : (0 : ℝ) ∈ spectrum ℝ (H : Mat n ℝ) := by + simpa only [h] using (leastEigenvalue_isLeast H).1 + have hi := spectrum.not_isUnit_of_zero_mem ℝ hz + simpa only [Matrix.isUnit_iff_isUnit_det, isUnit_iff_ne_zero, not_not] using hi + +theorem exists_positive_singular_on_segment {n : ℕ} [NeZero n] + (F : ℝ → Sym n) (T : ℝ) (hT : 0 < T) + (hF : ContinuousOn F (Set.Icc 0 T)) + (hzero : ¬(F 0 : Mat n ℝ).PosSemidef) (hend : (F T : Mat n ℝ).PosDef) : + ∃ t ∈ Set.Ioo 0 T, Matrix.det (F t : Mat n ℝ) = 0 := by + have hneg : leastEigenvalue (F 0) < 0 := (leastEigenvalue_neg_iff _).mpr hzero + have hpos : 0 < leastEigenvalue (F T) := (leastEigenvalue_pos_iff _).mpr hend + have hcont : ContinuousOn (fun t => leastEigenvalue (F t)) (Set.Icc 0 T) := + (continuous_leastEigenvalue n).comp_continuousOn hF + obtain ⟨t, ht, heq⟩ := intermediate_value_Icc hT.le hcont ⟨hneg.le, hpos.le⟩ + have ht0 : t ≠ 0 := by + intro h + subst t + linarith + have htT : t ≠ T := by + intro h + subst t + linarith + exact ⟨t, ⟨lt_of_le_of_ne ht.1 (Ne.symm ht0), lt_of_le_of_ne ht.2 htT⟩, + det_eq_zero_of_leastEigenvalue_eq_zero (F t) heq⟩ + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/LineEvaluation.lean b/lean/OAI/Analysis/HyperbolicCones/LineEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..2735c085c97519776917b8459980e457b725bbba --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/LineEvaluation.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.HyperbolicCones.PolynomialEvaluation + +namespace OAI + +noncomputable section + +open Matrix Polynomial MvPolynomial +open scoped Matrix.Norms.L2Operator + +universe u + +namespace Paper256 + +theorem polynomial_eval₂ {K : Type u} [CommRing K] (f : ℝ →+* K) (v : Coord → K) : + MvPolynomial.eval₂ f v polynomial = matrixValue + (symmetricCoordinates fun ij => v (Sum.inl (Sum.inl ij))) + (symmetricCoordinates fun ij => v (Sum.inl (Sum.inr ij))) + (fun i => v (Sum.inr i)) := by + change (MvPolynomial.eval₂Hom f v) (matrixValue _ _ _) = _ + rw [matrixValue_map, symmetricCoordinates_map, symmetricCoordinates_map] + simp + +theorem symmetricCoordinates_affine {K : Type u} [CommRing K] + (f : ℝ →+* K) (X : Sym 4) (t : K) : + symmetricCoordinates (fun ij => f ((1 : Mat 4 ℝ) ij.val.1 ij.val.2) * t - + f ((X : Mat 4 ℝ) ij.val.1 ij.val.2)) = + t • (1 : Mat 4 K) - (X : Mat 4 ℝ).map f := by + classical + ext i j + have hX : (X : Mat 4 ℝ).IsHermitian := X.property + have hsym : (X : Mat 4 ℝ) j i = (X : Mat 4 ℝ) i j := by + simpa using hX.apply i j + by_cases h : i ≤ j + · simp [symmetricCoordinates, h, Matrix.one_apply, Matrix.smul_apply, smul_eq_mul, + mul_comm] + · simp [symmetricCoordinates, h, Matrix.one_apply, Matrix.smul_apply, smul_eq_mul, + eq_comm, hsym, mul_comm] + +theorem linePolynomial_eval₂ {K : Type u} [CommRing K] + (f : ℝ →+* K) (X Z : Sym 4) (y : Fin 3 → ℝ) (t : K) : + (linePolynomial ((X, Z), y)).eval₂ f t = matrixValue + (t • (1 : Mat 4 K) - (X : Mat 4 ℝ).map f) + (t • (1 : Mat 4 K) - (Z : Mat 4 ℝ).map f) + (fun i => -f (y i)) := by + let g := Polynomial.eval₂RingHom f t + have hg : g.comp Polynomial.C = f := by + ext a + simp [g] + change g ((MvPolynomial.eval₂Hom Polynomial.C + (fun i => Polynomial.C (coordinates basePoint i) * Polynomial.X - + Polynomial.C (coordinates ((X, Z), y) i))) polynomial) = _ + rw [MvPolynomial.map_eval₂Hom, hg] + change MvPolynomial.eval₂ f _ polynomial = _ + rw [polynomial_eval₂] + simp only [g, Polynomial.coe_eval₂RingHom, Polynomial.eval₂_sub, + Polynomial.eval₂_mul, Polynomial.eval₂_C, Polynomial.eval₂_X] + change matrixValue + (symmetricCoordinates (fun ij => f ((1 : Mat 4 ℝ) ij.val.1 ij.val.2) * t - + f ((X : Mat 4 ℝ) ij.val.1 ij.val.2))) + (symmetricCoordinates (fun ij => f ((1 : Mat 4 ℝ) ij.val.1 ij.val.2) * t - + f ((Z : Mat 4 ℝ) ij.val.1 ij.val.2))) + (fun i => f 0 * t - f (y i)) = _ + rw [symmetricCoordinates_affine, symmetricCoordinates_affine] + simp + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/LinePolynomial.lean b/lean/OAI/Analysis/HyperbolicCones/LinePolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..443f269f406acfa25980b99d01685480b25cafb2 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/LinePolynomial.lean @@ -0,0 +1,89 @@ +import OAI.Analysis.HyperbolicCones.PolynomialBasic + +namespace OAI + +noncomputable section + +open Polynomial +open scoped BigOperators + +universe u + +namespace Paper256 + +theorem polynomial_prod_top {ι : Type u} (s : Finset ι) + (f : ι → Polynomial ℝ) (d : ι → ℕ) + (h : ∀ i ∈ s, (f i).natDegree ≤ d i) : + (∏ i ∈ s, f i).natDegree ≤ ∑ i ∈ s, d i ∧ + (∏ i ∈ s, f i).coeff (∑ i ∈ s, d i) = ∏ i ∈ s, (f i).coeff (d i) := by + classical + revert h + induction s using Finset.induction_on with + | empty => simp + | @insert a s ha ih => + intro h + have hfa := h a (Finset.mem_insert_self a s) + have hs := ih (fun i hi => h i (Finset.mem_insert_of_mem hi)) + simp only [Finset.prod_insert ha, Finset.sum_insert ha] + refine ⟨natDegree_mul_le_of_le hfa hs.1, ?_⟩ + rw [coeff_mul_add_eq_of_natDegree_le hfa hs.1, hs.2] + +theorem affine_substitution_top {σ : Type u} [Fintype σ] + (p : MvPolynomial σ ℝ) (d : ℕ) (hp : p.IsHomogeneous d) (e x : σ → ℝ) : + let q := MvPolynomial.eval₂ Polynomial.C + (fun i => Polynomial.C (e i) * Polynomial.X - Polynomial.C (x i)) p + q.natDegree ≤ d ∧ q.coeff d = MvPolynomial.eval e p := by + classical + let l : σ → Polynomial ℝ := fun i => C (e i) * X - C (x i) + have hl (i : σ) : (l i).natDegree ≤ 1 := by + apply (natDegree_sub_le _ _).trans + exact max_le (le_trans (natDegree_C_mul_le _ _) (by simp)) (by simp) + have hc (i : σ) : (l i).coeff 1 = e i := by simp [l] + have hm (a : σ →₀ ℕ) : + (∏ i, l i ^ a i).natDegree ≤ a.degree ∧ + (∏ i, l i ^ a i).coeff a.degree = ∏ i, e i ^ a i := by + have h := polynomial_prod_top Finset.univ (fun i => l i ^ a i) a + (fun i _ => by simpa using natDegree_pow_le_of_le (a i) (hl i)) + rw [Finsupp.degree_eq_sum] + refine ⟨h.1, h.2.trans ?_⟩ + apply Finset.prod_congr rfl + intro i _ + simpa [hc] using (coeff_pow_of_natDegree_le (m := a i) (hl i)) + dsimp + change (MvPolynomial.eval₂ C l p).natDegree ≤ d ∧ + (MvPolynomial.eval₂ C l p).coeff d = MvPolynomial.eval e p + rw [MvPolynomial.eval₂_eq', MvPolynomial.eval_eq'] + constructor + · apply natDegree_sum_le_of_forall_le + intro a ha + have hd : a.degree = d := by + simpa only [Finsupp.degree_eq_weight_one, Pi.one_def] using + hp (MvPolynomial.mem_support_iff.mp ha) + exact (natDegree_C_mul_le _ _).trans ((hm a).1.trans_eq hd) + · rw [finsetSum_coeff] + apply Finset.sum_congr rfl + intro a ha + have hd : a.degree = d := by + simpa only [Finsupp.degree_eq_weight_one, Pi.one_def] using + hp (MvPolynomial.mem_support_iff.mp ha) + rw [coeff_C_mul, ← hd, (hm a).2] + +theorem linePolynomial_top (x : Ambient) : + (linePolynomial x).natDegree ≤ 20 ∧ (linePolynomial x).coeff 20 = 1 := by + have h := affine_substitution_top polynomial 20 polynomial_homogeneous + (coordinates basePoint) (coordinates x) + simpa [linePolynomial, polynomial_basePoint] using h + +theorem linePolynomial_natDegree (x : Ambient) : (linePolynomial x).natDegree = 20 := by + apply le_antisymm (linePolynomial_top x).1 + exact le_natDegree_of_ne_zero (by rw [(linePolynomial_top x).2]; norm_num) + +theorem linePolynomial_monic (x : Ambient) : (linePolynomial x).Monic := by + change (linePolynomial x).leadingCoeff = 1 + rw [← coeff_natDegree, linePolynomial_natDegree, (linePolynomial_top x).2] + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/LineShift.lean b/lean/OAI/Analysis/HyperbolicCones/LineShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..17cb9bb9dad96dab433d5a5b5f579d721b566d8a --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/LineShift.lean @@ -0,0 +1,44 @@ +import OAI.Analysis.HyperbolicCones.PolynomialScaling +import OAI.Analysis.HyperbolicCones.LineEvaluation + +namespace OAI + +noncomputable section + +namespace Paper256 + +theorem linePolynomial_eval (x : Ambient) (t : ℝ) : + (linePolynomial x).eval t = + MvPolynomial.eval (coordinates (t • basePoint - x)) polynomial := by + rw [coordinates_sub, coordinates_smul] + change (Polynomial.evalRingHom t) ((MvPolynomial.eval₂Hom Polynomial.C + (fun i => Polynomial.C (coordinates basePoint i) * Polynomial.X - + Polynomial.C (coordinates x i))) polynomial) = + (MvPolynomial.eval₂Hom (RingHom.id ℝ) + (t • coordinates basePoint - coordinates x)) polynomial + rw [MvPolynomial.map_eval₂Hom] + congr 2 + · ext r + simp + · ext i + simp only [Polynomial.coe_evalRingHom, Polynomial.eval_sub, Polynomial.eval_mul, + Polynomial.eval_C, Polynomial.eval_X, Pi.sub_apply, Pi.smul_apply, smul_eq_mul] + rw [mul_comm] + +theorem linePolynomial_eval_neg (x : Ambient) (t : ℝ) : + (linePolynomial x).eval (-t) = + MvPolynomial.eval (coordinates (x + t • basePoint)) polynomial := by + rw [linePolynomial_eval] + have h : (-t) • basePoint - x = -(x + t • basePoint) := by + simp [neg_add_rev, sub_eq_add_neg] + rw [h, polynomial_eval_neg] + +theorem real_aeval (p : Polynomial ℝ) (t : ℝ) : + p.aeval (t : ℂ) = Complex.ofReal (p.eval t) := + Polynomial.aeval_algebraMap_apply_eq_algebraMap_eval t p + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/Main.lean b/lean/OAI/Analysis/HyperbolicCones/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..6354d30d59359984f364c48341f1bc0d151d260b --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/Main.lean @@ -0,0 +1,40 @@ +import OAI.Analysis.HyperbolicCones.Pencil +import OAI.Analysis.HyperbolicCones.TangentObstruction +import OAI.Analysis.HyperbolicCones.Deformation +import OAI.Analysis.HyperbolicCones.LinePolynomial +import OAI.Analysis.HyperbolicCones.ConeZero +import OAI.Analysis.HyperbolicCones.Coordinates + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +theorem cone_not_spectrahedral (N : ℕ) (hN : 0 < N) (L : Ambient →ₗ[ℝ] Sym N) : + cone ≠ {x | (L x : Mat N ℝ).PosSemidef} := by + intro hL + obtain ⟨P⟩ := pencil_normalization N hN L hL + exact P.impossible + +/-- An explicit degree-20 hyperbolic polynomial in a 23-dimensional real space +whose closed hyperbolicity cone is not spectrahedral. -/ +theorem main_result : + Module.finrank ℝ Ambient = 23 ∧ + polynomial.IsHomogeneous 20 ∧ + polynomial.totalDegree = 20 ∧ + MvPolynomial.eval (coordinates basePoint) polynomial = 1 ∧ + (∀ (x : Ambient) (z : ℂ), (linePolynomial x).aeval z = 0 → z.im = 0) ∧ + ∀ (N : ℕ) (_hN : 0 < N) (L : Ambient →ₗ[ℝ] Sym N), + cone ≠ {x | (L x : Mat N ℝ).PosSemidef} := by + exact ⟨ambient_finrank, polynomial_homogeneous, polynomial_totalDegree, + polynomial_basePoint, linePolynomial_complex_roots_real, cone_not_spectrahedral⟩ + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/MatrixBasic.lean b/lean/OAI/Analysis/HyperbolicCones/MatrixBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..1578555218bfb65950fa51393f568581785868fb --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/MatrixBasic.lean @@ -0,0 +1,80 @@ +import OAI.Analysis.HyperbolicCones.Model + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix.Norms.L2Operator +open Matrix + +universe u + +namespace Paper256 + +theorem sym_isHermitian {n : ℕ} (X : Sym n) : (X : Mat n ℝ).IsHermitian := X.property + +theorem qMatrix_smul {R : Type u} [CommRing R] (y : Fin 3 → R) (s : R) : + qMatrix (s • y) = s ^ 2 • qMatrix y := by + ext i j + by_cases h : i = j <;> simp [qMatrix, h, mul_pow] <;> ring + +theorem phi_add {R : Type u} [CommRing R] (y : Fin 3 → R) (X Z : Mat 4 R) : + phi y (X + Z) = phi y X + phi y Z := by + ext i j + refine Fin.cases ?_ (fun i => ?_) i <;> + refine Fin.cases ?_ (fun j => ?_) j <;> + simp [phi, Matrix.trace, Matrix.mul_apply, Matrix.submatrix, + Finset.sum_add_distrib, mul_add, add_mul, add_comm] + +theorem phi_smul {R : Type u} [CommRing R] (y : Fin 3 → R) (s : R) (X : Mat 4 R) : + phi y (s • X) = s • phi y X := by + ext i j + refine Fin.cases ?_ (fun i => ?_) i <;> + refine Fin.cases ?_ (fun j => ?_) j <;> + simp [phi, Matrix.trace, Matrix.mul_apply, Matrix.submatrix, + ← Finset.mul_sum, mul_left_comm, mul_assoc] + +theorem phi_zero {R : Type u} [CommRing R] (y : Fin 3 → R) : phi y (0 : Mat 4 R) = 0 := by + simpa using phi_smul y 0 (0 : Mat 4 R) + +theorem phi_scaling_general {R : Type u} [CommRing R] + (y : Fin 3 → R) (s : R) (X : Mat 4 R) : + phi (s • y) X = s ^ 2 • phi y X := by + ext i j + refine Fin.cases ?_ (fun i => ?_) i <;> + refine Fin.cases ?_ (fun j => ?_) j <;> + simp [phi, qMatrix_smul, Matrix.trace, Matrix.mul_apply, Matrix.submatrix, + ← Finset.mul_sum, mul_left_comm, mul_assoc] + +theorem phi_scaling (y : Fin 3 → ℝ) (s : ℝ) (X : Mat 4 ℝ) : + phi (s • y) X = s ^ 2 • phi y X := + phi_scaling_general y s X + +theorem phi_zero_parameter {R : Type u} [CommRing R] (X : Mat 4 R) : + phi (0 : Fin 3 → R) X = 0 := by + simpa using phi_scaling_general (0 : Fin 3 → R) 0 X + +theorem phi_neg_parameter {R : Type u} [CommRing R] (y : Fin 3 → R) (X : Mat 4 R) : + phi (-y) X = phi y X := by + simpa using phi_scaling_general y (-1) X + +theorem phi_rank_one (y : Fin 3 → ℝ) (u v : Vec 4) : + dotProduct (fun i => u i) (phi y (outer v) *ᵥ (fun i => u i)) = + choiLam (wedgeCoordinates v u) y := by + simp [dotProduct, mulVec, phi, Matrix.trace, Matrix.mul_apply, Matrix.submatrix, + qMatrix, outer, wedgeCoordinates, choiLam, Fin.sum_univ_succ] + ring + +theorem matrixValue_inverse {K : Type u} [Field K] (X Z : Mat 4 K) (y : Fin 3 → K) + (hX : IsUnit (Matrix.det X)) : + matrixValue X Z y = Matrix.det X ^ 4 * Matrix.det (Z - phi y X⁻¹) := by + have hadj : X.adjugate = X.det • X⁻¹ := by + rw [Matrix.inv_def, smul_smul, Ring.mul_inverse_cancel _ hX, one_smul] + rw [matrixValue, hadj, phi_smul, ← smul_sub, Matrix.det_smul] + rfl + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/MatrixComplex.lean b/lean/OAI/Analysis/HyperbolicCones/MatrixComplex.lean new file mode 100644 index 0000000000000000000000000000000000000000..c293ef84d4b7ab9352f2d39ed760f9e3b28f9f32 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/MatrixComplex.lean @@ -0,0 +1,73 @@ +import OAI.Analysis.HyperbolicCones.MatrixLinear +import OAI.Analysis.HyperbolicCones.PolynomialEvaluation + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix.Norms.L2Operator MatrixOrder ComplexOrder +open Matrix + +namespace Paper256 + +theorem isHermitian_complexify {n : ℕ} (A : Mat n ℝ) (hA : A.IsHermitian) : + (A.map Complex.ofReal).IsHermitian := + hA.map _ (by intro x; simp) + +theorem complex_quadratic_re {n : ℕ} (A : Mat n ℝ) (w : Fin n → ℂ) : + (dotProduct (star w) (A.map Complex.ofReal *ᵥ w)).re = + dotProduct (fun i => (w i).re) (A *ᵥ fun i => (w i).re) + + dotProduct (fun i => (w i).im) (A *ᵥ fun i => (w i).im) := by + have ht (i j : Fin n) : (star (w i) * ((A i j : ℂ) * w j)).re = + (w i).re * (A i j * (w j).re) + (w i).im * (A i j * (w j).im) := by + simp [Complex.mul_re, Complex.mul_im] + simp only [dotProduct, mulVec, Matrix.map_apply, Pi.star_apply, Finset.mul_sum, + Complex.re_sum, ht, Finset.sum_add_distrib] + +theorem posSemidef_complexify {n : ℕ} (A : Mat n ℝ) (hA : A.PosSemidef) : + (A.map Complex.ofReal).PosSemidef := by + have hh := isHermitian_complexify A hA.isHermitian + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg hh + intro w + apply RCLike.nonneg_iff.2 + refine ⟨?_, hh.im_star_dotProduct_mulVec_self w⟩ + rw [show RCLike.re (dotProduct (star w) (A.map Complex.ofReal *ᵥ w)) = + (dotProduct (star w) (A.map Complex.ofReal *ᵥ w)).re from rfl, complex_quadratic_re] + exact add_nonneg (by simpa using hA.dotProduct_mulVec_nonneg (fun i => (w i).re)) + (by simpa using hA.dotProduct_mulVec_nonneg (fun i => (w i).im)) + +theorem posDef_complexify {n : ℕ} (A : Mat n ℝ) (hA : A.PosDef) : + (A.map Complex.ofReal).PosDef := by + have hh := isHermitian_complexify A hA.isHermitian + apply Matrix.PosDef.of_dotProduct_mulVec_pos hh + intro w hw + apply RCLike.pos_iff.2 + refine ⟨?_, hh.im_star_dotProduct_mulVec_self w⟩ + change 0 < (dotProduct (star w) (A.map Complex.ofReal *ᵥ w)).re + rw [complex_quadratic_re] + by_cases hr : (fun i => (w i).re) = 0 + · have hi : (fun i => (w i).im) ≠ 0 := by + intro hi + apply hw + funext i + apply Complex.ext + · exact congrFun hr i + · exact congrFun hi i + exact add_pos_of_nonneg_of_pos + (by simpa using hA.posSemidef.dotProduct_mulVec_nonneg (fun i => (w i).re)) + (by simpa using hA.dotProduct_mulVec_pos hi) + · exact add_pos_of_pos_of_nonneg (by simpa using hA.dotProduct_mulVec_pos hr) + (by simpa using hA.posSemidef.dotProduct_mulVec_nonneg (fun i => (w i).im)) + +theorem complex_resolvent_isUnit {n : ℕ} (A : Mat n ℝ) (hA : A.IsHermitian) + (z : ℂ) (hz : z.im ≠ 0) : IsUnit (z • (1 : Mat n ℂ) - A.map Complex.ofReal) := by + by_contra hn + apply hz + apply (isHermitian_complexify A hA).isSelfAdjoint.im_eq_zero_of_mem_spectrum + simpa only [spectrum.mem_iff, Algebra.algebraMap_eq_smul_one] using hn + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/MatrixLinear.lean b/lean/OAI/Analysis/HyperbolicCones/MatrixLinear.lean new file mode 100644 index 0000000000000000000000000000000000000000..dce6482ba7a7bb86e5ecd1bf6e6a595c06ae32b4 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/MatrixLinear.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.HyperbolicCones.MatrixBasic + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix.Norms.L2Operator MatrixOrder +open Matrix + +universe u + +namespace Paper256 + +def phiLinear {R : Type u} [CommRing R] (y : Fin 3 → R) : Mat 4 R →ₗ[R] Mat 4 R where + toFun := phi y + map_add' := phi_add y + map_smul' := phi_smul y + +theorem phi_isHermitian (y : Fin 3 → ℝ) (X : Mat 4 ℝ) (hX : X.IsHermitian) : + (phi y X).IsHermitian := by + have hQ (i j : Fin 3) : qMatrix y j i = qMatrix y i j := by + by_cases h : i = j + · subst j; rfl + · simp [qMatrix, h, Ne.symm h, mul_comm] + have hXs (i j : Fin 4) : X j i = X i j := by simpa using hX.apply i j + apply Matrix.IsHermitian.ext + intro i j + simp only [star_trivial] + refine Fin.cases ?_ (fun i => ?_) i <;> + refine Fin.cases ?_ (fun j => ?_) j + · rfl + · simp only [phi, Fin.cases_zero, Fin.cases_succ] + congr 1 + apply Finset.sum_congr rfl + intro k _ + rw [hQ, hXs 0 k.succ] + ring + · simp only [phi, Fin.cases_zero, Fin.cases_succ] + congr 1 + apply Finset.sum_congr rfl + intro k _ + rw [hQ, hXs 0 k.succ] + ring + · simp only [phi, Fin.cases_succ] + rw [hQ] + +theorem posSemidef_sum_outer {n : ℕ} (X : Mat n ℝ) (hX : X.PosSemidef) : + ∃ v : Fin n → Vec n, X = ∑ i, outer (v i) := by + obtain ⟨B, hB⟩ := CStarAlgebra.nonneg_iff_eq_star_mul_self.mp hX.nonneg + refine ⟨fun i => WithLp.toLp 2 (B i), ?_⟩ + rw [hB] + ext i j + simp [Matrix.mul_apply, Matrix.sum_apply, outer] + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/MatrixPositive.lean b/lean/OAI/Analysis/HyperbolicCones/MatrixPositive.lean new file mode 100644 index 0000000000000000000000000000000000000000..a38539dd707679dd0f88fdeb28dc6388d70cac9e --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/MatrixPositive.lean @@ -0,0 +1,41 @@ +import OAI.Analysis.HyperbolicCones.MatrixLinear +import OAI.Analysis.HyperbolicCones.FormPositive + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix.Norms.L2Operator MatrixOrder +open Matrix + +namespace Paper256 + +theorem phi_outer_posSemidef (y : Fin 3 → ℝ) (v : Vec 4) : + (phi y (outer v)).PosSemidef := by + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg + (phi_isHermitian y (outer v) (outerSym v).property) + intro u + have hr := phi_rank_one y (WithLp.toLp 2 u) v + simpa only [star_trivial, hr] using choiLam_nonnegative + (wedgeCoordinates v (WithLp.toLp 2 u)) y + +theorem phi_posSemidef (y : Fin 3 → ℝ) (X : Mat 4 ℝ) (hX : X.PosSemidef) : + (phi y X).PosSemidef := by + obtain ⟨v, rfl⟩ := posSemidef_sum_outer X hX + change ((phiLinear y) (∑ i, outer (v i))).PosSemidef + rw [map_sum] + exact Matrix.posSemidef_sum _ fun i _ => phi_outer_posSemidef y (v i) + +theorem phi_monotone (y : Fin 3 → ℝ) : Monotone (phi y) := by + intro X Z hXZ + have hp := phi_posSemidef y (Z - X) hXZ + change (phi y Z - phi y X).PosSemidef + change ((phiLinear y) (Z - X)).PosSemidef at hp + rw [map_sub] at hp + exact hp + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/MatrixResolvent.lean b/lean/OAI/Analysis/HyperbolicCones/MatrixResolvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..823dc824218ba404ca6501b258c0712dc331e061 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/MatrixResolvent.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.HyperbolicCones.MatrixComplex + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix.Norms.L2Operator MatrixOrder ComplexOrder +open Matrix + +namespace Paper256 + +theorem isUnit_of_adjoint_difference_posDef {n : ℕ} (H M : Mat n ℂ) (δ : ℂ) + (hδ : δ ≠ 0) (hM : M.PosDef) (hdiff : H - Hᴴ = δ • M) : IsUnit H := by + apply Matrix.mulVec_injective_iff_isUnit.mp + change Function.Injective H.mulVecLin + apply LinearMap.ker_eq_bot.mp + apply LinearMap.ker_eq_bot'.2 + intro w hw + change H *ᵥ w = 0 at hw + by_contra hw0 + have hq : dotProduct (star w) ((H - Hᴴ) *ᵥ w) = 0 := by + rw [Matrix.sub_mulVec, dotProduct_sub, hw, dotProduct_zero] + rw [dotProduct_mulVec, vecMul_conjTranspose, star_star, hw, star_zero, + zero_dotProduct, sub_self] + rw [hdiff, Matrix.smul_mulVec, dotProduct_smul, smul_eq_mul] at hq + exact (ne_of_gt (hM.dotProduct_mulVec_pos hw0)) ((mul_eq_zero.mp hq).resolve_left hδ) + +theorem resolvent_adjoint_difference {n : ℕ} (A : Mat n ℂ) (hA : A.IsHermitian) + (z : ℂ) (hAz : IsUnit (Matrix.det (z • (1 : Mat n ℂ) - A))) : + (z • (1 : Mat n ℂ) - A)⁻¹ - ((z • (1 : Mat n ℂ) - A)⁻¹)ᴴ = + -(z - star z) • (((z • (1 : Mat n ℂ) - A)⁻¹)ᴴ * + (z • (1 : Mat n ℂ) - A)⁻¹) := by + let T := z • (1 : Mat n ℂ) - A + have ht : T * T⁻¹ = 1 := Matrix.mul_nonsing_inv T hAz + have hts : T⁻¹ᴴ * Tᴴ = 1 := by + rw [← Matrix.conjTranspose_mul, ht, Matrix.conjTranspose_one] + have hd : Tᴴ - T = -(z - star z) • (1 : Mat n ℂ) := by + simp only [T, Matrix.conjTranspose_sub, Matrix.conjTranspose_smul, + Matrix.conjTranspose_one, hA.eq] + module + change T⁻¹ - T⁻¹ᴴ = -(z - star z) • (T⁻¹ᴴ * T⁻¹) + calc + T⁻¹ - T⁻¹ᴴ = T⁻¹ᴴ * (Tᴴ - T) * T⁻¹ := by + rw [Matrix.mul_sub, Matrix.sub_mul, hts, Matrix.one_mul, Matrix.mul_assoc, ht, + Matrix.mul_one] + _ = -(z - star z) • (T⁻¹ᴴ * T⁻¹) := by + rw [hd, Matrix.mul_smul, Matrix.mul_one, Matrix.smul_mul] + +theorem positive_map_resolvent_isUnit {n m : ℕ} (A : Mat n ℂ) (B : Mat m ℂ) + (hA : A.IsHermitian) (hB : B.IsHermitian) + (Φ : Mat n ℂ →ₗ[ℂ] Mat m ℂ) + (hΦstar : ∀ X, (Φ X)ᴴ = Φ Xᴴ) + (hΦpos : ∀ X, X.PosSemidef → (Φ X).PosSemidef) + (z : ℂ) (hz : z.im ≠ 0) : + IsUnit (z • (1 : Mat m ℂ) - B - Φ ((z • (1 : Mat n ℂ) - A)⁻¹)) := by + have hu : IsUnit (z • (1 : Mat n ℂ) - A) := by + by_contra hn + apply hz + apply hA.isSelfAdjoint.im_eq_zero_of_mem_spectrum + simpa only [spectrum.mem_iff, Algebra.algebraMap_eq_smul_one] using hn + have hd := resolvent_adjoint_difference A hA z ((Matrix.isUnit_iff_isUnit_det _).1 hu) + let R := (z • (1 : Mat n ℂ) - A)⁻¹ + let M := (1 : Mat m ℂ) + Φ (Rᴴ * R) + have hm : M.PosDef := Matrix.PosDef.one.add_posSemidef + (hΦpos _ (Matrix.posSemidef_conjTranspose_mul_self R)) + refine isUnit_of_adjoint_difference_posDef _ M (z - star z) ?_ hm ?_ + · intro he + have hi := congrArg Complex.im he + simp only [Complex.sub_im, Complex.star_def, Complex.conj_im, Complex.zero_im] at hi + apply hz + linarith + · have hd' : R - Rᴴ = -(z - star z) • (Rᴴ * R) := hd + calc + _ = (z - star z) • (1 : Mat m ℂ) - Φ (R - Rᴴ) := by + simp only [Matrix.conjTranspose_sub, Matrix.conjTranspose_smul, + Matrix.conjTranspose_one, hB.eq, hΦstar, map_sub] + module + _ = (z - star z) • M := by + rw [hd', map_smul] + dsimp [M] + module + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/MaxEigenvalue.lean b/lean/OAI/Analysis/HyperbolicCones/MaxEigenvalue.lean new file mode 100644 index 0000000000000000000000000000000000000000..267d990d345febd085b4349bb7d89aa4f7e3e279 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/MaxEigenvalue.lean @@ -0,0 +1,43 @@ +import OAI.Analysis.HyperbolicCones.NormThreshold + +namespace OAI + +/-! On the positive cone, the largest eigenvalue is the operator norm, including zero. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix Filter Topology +universe u + +namespace Paper256 + +theorem posSemidef_norm_isGreatest {n : ℕ} [NeZero n] + (A : Mat n ℝ) (hA : A.PosSemidef) : IsGreatest (spectrum ℝ A) ‖A‖ := by + have hgreat := IsometricContinuousFunctionalCalculus.isGreatest_norm_spectrum + (𝕜 := ℝ) (p := IsSelfAdjoint) A hA.isHermitian + constructor + · obtain ⟨x, hx, hnorm⟩ := hgreat.1 + have hx0 : 0 ≤ x := spectrum_nonneg_of_nonneg hA.nonneg hx + have heq : ‖A‖ = x := by + simpa only [Real.norm_eq_abs, abs_of_nonneg hx0] using hnorm.symm + rwa [heq] + · intro x hx + exact (le_abs_self x).trans (hgreat.2 ⟨x, hx, rfl⟩) + +theorem posSemidef_largestEigenvalue_tendsto {n : ℕ} [NeZero n] + {T : Type u} {L : Filter T} {A : T → Mat n ℝ} {A₀ : Mat n ℝ} + (hA : ∀ t, (A t).PosSemidef) (hA₀ : A₀.PosSemidef) + (hlim : Tendsto A L (𝓝 A₀)) (eig : T → ℝ) (eig₀ : ℝ) + (heig : ∀ t, IsGreatest (spectrum ℝ (A t)) (eig t)) + (heig₀ : IsGreatest (spectrum ℝ A₀) eig₀) : Tendsto eig L (𝓝 eig₀) := by + have heq : eig = fun t => ‖A t‖ := funext fun t => + (heig t).unique (posSemidef_norm_isGreatest (A t) (hA t)) + have heq₀ : eig₀ = ‖A₀‖ := heig₀.unique (posSemidef_norm_isGreatest A₀ hA₀) + rw [heq, heq₀] + exact hlim.norm + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/Model.lean b/lean/OAI/Analysis/HyperbolicCones/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..36b24f20ca8cf612adce94ceda3aef0db7791a29 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/Model.lean @@ -0,0 +1,156 @@ +import Mathlib + +namespace OAI + +/-! The Choi–Lam form, determinant polynomial, root-defined cone, and quadratic deformation. -/ + +noncomputable section + +open scoped Matrix.Norms.L2Operator + +universe u + +namespace Paper256 + +abbrev Mat (n : ℕ) (R : Type u) := Matrix (Fin n) (Fin n) R + +abbrev Sym (n : ℕ) := selfAdjoint (Mat n ℝ) + +instance instFiniteDimensionalSym (n : ℕ) : FiniteDimensional ℝ (Sym n) := + FiniteDimensional.finiteDimensional_submodule (selfAdjoint.submodule ℝ (Mat n ℝ)) + +abbrev Ambient := (Sym 4 × Sym 4) × (Fin 3 → ℝ) + +abbrev SymIndex := {ij : Fin 4 × Fin 4 // ij.1 ≤ ij.2} + +abbrev Coord := (SymIndex ⊕ SymIndex) ⊕ Fin 3 + +def qMatrix {R : Type u} [CommRing R] (y : Fin 3 → R) : Mat 3 R := + fun i j => if i = j then y i ^ 2 + y (i + 1) ^ 2 else -(y i * y j) + +def phi {R : Type u} [CommRing R] (y : Fin 3 → R) (X : Mat 4 R) : Mat 4 R := + fun i j => Fin.cases + (Fin.cases + (Matrix.trace (qMatrix y * X.submatrix Fin.succ Fin.succ)) + (fun j => -(∑ k, X 0 k.succ * qMatrix y k j)) j) + (fun i => Fin.cases + (-(∑ k, qMatrix y i k * X k.succ 0)) + (fun j => X 0 0 * qMatrix y i j) j) i + +def matrixValue {R : Type u} [CommRing R] + (X Z : Mat 4 R) (y : Fin 3 → R) : R := + Matrix.det ((Matrix.det X) • Z - phi y (Matrix.adjugate X)) + +def symmetricCoordinates {R : Type u} (v : SymIndex → R) : Mat 4 R := + fun i j => if h : i ≤ j then v ⟨(i, j), h⟩ + else v ⟨(j, i), le_of_lt (lt_of_not_ge h)⟩ + +def polynomial : MvPolynomial Coord ℝ := + matrixValue + (symmetricCoordinates fun ij => MvPolynomial.X (Sum.inl (Sum.inl ij))) + (symmetricCoordinates fun ij => MvPolynomial.X (Sum.inl (Sum.inr ij))) + (fun i => MvPolynomial.X (Sum.inr i)) + +def coordinates (x : Ambient) : Coord → ℝ := + Sum.elim (Sum.elim + (fun ij => (x.1.1 : Mat 4 ℝ) ij.val.1 ij.val.2) + (fun ij => (x.1.2 : Mat 4 ℝ) ij.val.1 ij.val.2)) x.2 + +def basePoint : Ambient := ((1, 1), 0) + +def linePolynomial (x : Ambient) : Polynomial ℝ := + MvPolynomial.eval₂ Polynomial.C + (fun i => Polynomial.C (coordinates basePoint i) * Polynomial.X - + Polynomial.C (coordinates x i)) polynomial + +def cone : Set Ambient := + {x | ∀ t : ℂ, (linePolynomial x).aeval t = 0 → t.im = 0 ∧ 0 ≤ t.re} + +def choiLam {R : Type u} [CommRing R] (z y : Fin 3 → R) : R := + (∑ i, z i ^ 2 * y i ^ 2) - + 2 * (z 0 * y 0 * z 1 * y 1 + z 0 * y 0 * z 2 * y 2 + + z 1 * y 1 * z 2 * y 2) + + (∑ i, z i ^ 2 * y (i + 1) ^ 2) + +def zMatrix {R : Type u} [CommRing R] (z : Fin 3 → R) : Mat 3 R := + fun i j => if i = j then z i ^ 2 + z (i + 2) ^ 2 else -(z i * z j) + +def intervalPolynomial (a b : ℝ) : Polynomial ℝ := + (1 - Polynomial.C a⁻¹ * Polynomial.X) * (1 + Polynomial.C b⁻¹ * Polynomial.X) + +def timeScale (η t : ℝ) : ℝ := 1 + η * Real.sin (Real.pi * t) ^ 2 + +def deformedPolynomial (a b η t : ℝ) : Polynomial ℝ := + (intervalPolynomial a b).comp (Polynomial.C (timeScale η t) * Polynomial.X) + +def rigidlyConvexSet (p : Polynomial ℝ) : Set ℝ := + closure (connectedComponentIn {x : ℝ | p.eval x ≠ 0} 0) + +open scoped BigOperators RealInnerProductSpace +open Set Filter Matrix + +abbrev Vec (n : ℕ) := EuclideanSpace ℝ (Fin n) + +def outer {n : ℕ} (v : Vec n) : Mat n ℝ := fun i j => v i * v j + +def outerSym {n : ℕ} (v : Vec n) : Sym n := + ⟨outer v, by + change (outer v)ᴴ = outer v + ext i j + simp [outer, Matrix.conjTranspose_apply, mul_comm]⟩ + +def operatorNorm {m n : ℕ} (A : Matrix (Fin m) (Fin n) ℝ) : ℝ := + ‖A.toEuclideanLin.toContinuousLinearMap‖ + +def kernelProjection {n : ℕ} (A : Mat n ℝ) : Mat n ℝ := + Matrix.toEuclideanLin.symm (A.toEuclideanLin.ker.starProjection.toLinearMap) + +def inverseSquareRoot {n : ℕ} (A : Sym n) : Mat n ℝ := + let hA : (A : Mat n ℝ).IsHermitian := A.property + let U : Mat n ℝ := hA.eigenvectorUnitary + U * Matrix.diagonal (fun i => (Real.sqrt (hA.eigenvalues i))⁻¹) * Uᴴ + +/-- The vector v₀u′−u₀v′ in the rank-one and operator-norm identities. -/ +def wedgeCoordinates (v u : Vec 4) : Fin 3 → ℝ := + fun i => v 0 * u i.succ - u 0 * v i.succ + +def tangentCurve (v h : Vec 4) (s : ℝ) : Vec 4 := + (Real.sqrt (1 + s ^ 2 * ‖h‖ ^ 2))⁻¹ • (v + s • h) + +def tangentSpace (v : Vec 4) : Submodule ℝ (Vec 4) := (innerSL ℝ v).ker + +/-- Positive unital diagonal blocks with an exact Schur-complement equivalence. -/ +structure NormalizedPencil where + a : ℕ + c : ℕ + a_pos : 0 < a + c_pos : 0 < c + D : Sym 4 →ₗ[ℝ] Sym a + E : Sym 4 →ₗ[ℝ] Sym c + B : (Fin 3 → ℝ) →ₗ[ℝ] Matrix (Fin a) (Fin c) ℝ + D_positive : ∀ X : Sym 4, (X : Mat 4 ℝ).PosSemidef → (D X : Mat a ℝ).PosSemidef + E_positive : ∀ X : Sym 4, (X : Mat 4 ℝ).PosSemidef → (E X : Mat c ℝ).PosSemidef + D_unital : D 1 = 1 + E_unital : E 1 = 1 + schur_equivalence : ∀ (X Z : Sym 4) (y : Fin 3 → ℝ) (_hX : (X : Mat 4 ℝ).PosDef), + ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef ↔ + ((E Z : Mat c ℝ) - (B y)ᵀ * (D X : Mat a ℝ)⁻¹ * B y).PosSemidef + +def NormalizedPencil.leftProjection (P : NormalizedPencil) (v : Vec 4) : Mat P.a ℝ := + kernelProjection (P.D (1 - outerSym v) : Mat P.a ℝ) + +def NormalizedPencil.rightProjection (P : NormalizedPencil) (v : Vec 4) : Mat P.c ℝ := + kernelProjection (P.E (1 - outerSym v) : Mat P.c ℝ) + +def deformedPencil (a b η t x : ℝ) : Mat 2 ℝ := + Matrix.diagonal ![1 - timeScale η t * x / a, 1 + timeScale η t * x / b] + +def deformedCoefficients (a b η t : ℝ) : Fin 3 → ℝ := + fun i => (deformedPolynomial a b η t).coeff i.val + + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/NormBounds.lean b/lean/OAI/Analysis/HyperbolicCones/NormBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..902dd659794bf3cd57f9a7d17d93882d9a11fe41 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/NormBounds.lean @@ -0,0 +1,44 @@ +import OAI.Analysis.HyperbolicCones.NormCongruence +import OAI.Analysis.HyperbolicCones.NormLimits + +namespace OAI + +/-! The positivity bounds and individual scalar rays in the proof of the norm identity. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix +namespace Paper256 + +theorem affine_ge_one {n : ℕ} (H : Sym n) (hH : (H : Mat n ℝ).PosSemidef) + (t : ℝ) (ht : 1 ≤ t) : + (1 : Mat n ℝ) ≤ ((1 + (t - 1) • H : Sym n) : Mat n ℝ) := by + change (1 : Mat n ℝ) ≤ 1 + (t - 1) • (H : Mat n ℝ) + exact le_add_of_nonneg_right ((hH.smul (sub_nonneg.mpr ht)).nonneg) + +theorem positive_unital_map_affine_ge_one {m n : ℕ} (D : Sym m →ₗ[ℝ] Sym n) + (hD : ∀ H : Sym m, (H : Mat m ℝ).PosSemidef → (D H : Mat n ℝ).PosSemidef) + (hI : D 1 = 1) (H : Sym m) (hH : (H : Mat m ℝ).PosSemidef) + (t : ℝ) (ht : 1 ≤ t) : + (1 : Mat n ℝ) ≤ (D (1 + (t - 1) • H) : Mat n ℝ) := by + simpa only [map_add, map_smul, hI] using affine_ge_one (D H) (hD H hH) t ht + +theorem whitened_phi_posSemidef (X Z : Sym 4) (hX : (X : Mat 4 ℝ).PosDef) + (y : Fin 3 → ℝ) : + (inverseSquareRoot Z * phi y (X : Mat 4 ℝ)⁻¹ * inverseSquareRoot Z).PosSemidef := by + have h := (phi_posSemidef y _ hX.inv.posSemidef).conjTranspose_mul_mul_same + (inverseSquareRoot Z) + simpa only [conjTranspose_eq_transpose_of_trivial, inverseSquareRoot_transpose] using h + +theorem whitened_phi_threshold (X Z : Sym 4) (hX : (X : Mat 4 ℝ).PosDef) + (hZ : (Z : Mat 4 ℝ).PosDef) (y : Fin 3 → ℝ) (r : ℝ) : + (r • (Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef ↔ + ‖inverseSquareRoot Z * phi y (X : Mat 4 ℝ)⁻¹ * inverseSquareRoot Z‖ ≤ r := by + rw [inverseSquareRoot_congruence Z hZ] + exact posSemidef_norm_threshold _ (whitened_phi_posSemidef X Z hX y) r + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/NormCongruence.lean b/lean/OAI/Analysis/HyperbolicCones/NormCongruence.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9d4f20432660b31ddfd6252cd5224ba84b1996c --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/NormCongruence.lean @@ -0,0 +1,66 @@ +import OAI.Analysis.HyperbolicCones.NormThreshold + +namespace OAI + +/-! The scalar Schur thresholds are preserved by inverse-square-root congruence. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix +namespace Paper256 + +theorem inverseSquareRoot_congruence {n : ℕ} (Z : Sym n) + (hZ : (Z : Mat n ℝ).PosDef) (F : Mat n ℝ) (r : ℝ) : + (r • (Z : Mat n ℝ) - F).PosSemidef ↔ + (r • (1 : Mat n ℝ) - inverseSquareRoot Z * F * inverseSquareRoot Z).PosSemidef := by + have heq : (inverseSquareRoot Z)ᵀ * (r • (Z : Mat n ℝ) - F) * + inverseSquareRoot Z = + r • (1 : Mat n ℝ) - inverseSquareRoot Z * F * inverseSquareRoot Z := by + rw [mul_sub, sub_mul, mul_smul_comm, smul_mul_assoc, + inverseSquareRoot_conjugate Z hZ, inverseSquareRoot_transpose] + have hc := (inverseSquareRoot_isUnit Z hZ).posSemidef_star_left_conjugate_iff + (x := r • (Z : Mat n ℝ) - F) + simpa only [Matrix.star_eq_conjTranspose, conjTranspose_eq_transpose_of_trivial, heq] using hc.symm + +theorem inverseSquareRoot_gram {m n : ℕ} (X : Sym m) (Z : Sym n) + (hX : (X : Mat m ℝ).PosDef) (B : Matrix (Fin m) (Fin n) ℝ) : + (inverseSquareRoot X * B * inverseSquareRoot Z)ᵀ * + (inverseSquareRoot X * B * inverseSquareRoot Z) = + inverseSquareRoot Z * (Bᵀ * (X : Mat m ℝ)⁻¹ * B) * inverseSquareRoot Z := by + rw [transpose_mul, transpose_mul, inverseSquareRoot_transpose, + inverseSquareRoot_transpose, ← inverseSquareRoot_sq X hX] + simp only [Matrix.mul_assoc] + +theorem NormalizedPencil.positive_threshold (P : NormalizedPencil) + (X Z : Sym 4) (y : Fin 3 → ℝ) + (hX : (X : Mat 4 ℝ).PosDef) (hZ : (Z : Mat 4 ℝ).PosDef) + (hDX : (P.D X : Mat P.a ℝ).PosDef) (hEZ : (P.E Z : Mat P.c ℝ).PosDef) : + ‖inverseSquareRoot Z * phi y (X : Mat 4 ℝ)⁻¹ * inverseSquareRoot Z‖ = + ‖inverseSquareRoot (P.D X) * P.B y * inverseSquareRoot (P.E Z)‖ ^ 2 := by + let : NeZero P.c := ⟨Nat.ne_of_gt P.c_pos⟩ + let A := inverseSquareRoot Z * phi y (X : Mat 4 ℝ)⁻¹ * inverseSquareRoot Z + let C := inverseSquareRoot (P.D X) * P.B y * inverseSquareRoot (P.E Z) + have hA : A.PosSemidef := by + have hp := (phi_posSemidef y _ hX.inv.posSemidef).conjTranspose_mul_mul_same + (inverseSquareRoot Z) + simpa only [conjTranspose_eq_transpose_of_trivial, inverseSquareRoot_transpose] using hp + have hr (r : ℝ) : ‖A‖ ≤ r ↔ ‖C‖ ^ 2 ≤ r := by + calc + _ ↔ (r • (1 : Mat 4 ℝ) - A).PosSemidef := (posSemidef_norm_threshold A hA r).symm + _ ↔ (r • (Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef := + (inverseSquareRoot_congruence Z hZ _ r).symm + _ ↔ ((P.E (r • Z) : Mat P.c ℝ) - (P.B y)ᵀ * + (P.D X : Mat P.a ℝ)⁻¹ * P.B y).PosSemidef := by + simpa only [selfAdjoint.val_smul] using P.schur_equivalence X (r • Z) y hX + _ ↔ (r • (1 : Mat P.c ℝ) - Cᵀ * C).PosSemidef := by + have hc := inverseSquareRoot_congruence (P.E Z) hEZ + ((P.B y)ᵀ * (P.D X : Mat P.a ℝ)⁻¹ * P.B y) r + simpa only [map_smul, selfAdjoint.val_smul, ← inverseSquareRoot_gram (P.D X) (P.E Z) hDX] using hc + _ ↔ ‖C‖ ^ 2 ≤ r := posSemidef_gram_threshold C r + exact le_antisymm ((hr _).mpr le_rfl) ((hr _).mp le_rfl) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/NormIdentity.lean b/lean/OAI/Analysis/HyperbolicCones/NormIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..63d7b84225006c2d167c748e4eec8a7293f8d739 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/NormIdentity.lean @@ -0,0 +1,81 @@ +import OAI.Analysis.HyperbolicCones.NormCongruence +import OAI.Analysis.HyperbolicCones.NormLimits +import OAI.Analysis.HyperbolicCones.MaxEigenvalue +import OAI.Analysis.HyperbolicCones.RankNorm +import OAI.Analysis.HyperbolicCones.OperatorEntries + +namespace OAI + +/-! The norm identity follows from the exact scalar thresholds and their rank-one limits. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix Filter Topology +namespace Paper256 + +theorem NormalizedPencil.norm_identity (P : NormalizedPencil) + (u v : Vec 4) (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) (y : Fin 3 → ℝ) : + choiLam (wedgeCoordinates v u) y = + operatorNorm (P.leftProjection v * P.B y * P.rightProjection u) ^ 2 := by + let X (w : Vec 4) (t : ℝ) : Sym 4 := 1 + (t - 1) • (1 - outerSym w) + have hH (w : Vec 4) (hw : ‖w‖ = 1) : + ((1 - outerSym w : Sym 4) : Mat 4 ℝ).PosSemidef := + one_sub_outer_posSemidef w hw + have hX (w : Vec 4) (hw : ‖w‖ = 1) (t : ℝ) (ht : 1 ≤ t) : + (X w t : Mat 4 ℝ).PosDef := affine_posDef _ (hH w hw) t ht + have hS (w : Vec 4) (hw : ‖w‖ = 1) : + Tendsto (fun t => inverseSquareRoot (X w t)) atTop (𝓝 (outer w)) := by + have h := inverseSquareRoot_affine_tendsto (1 - outerSym w) (hH w hw) + change Tendsto (fun t => inverseSquareRoot (X w t)) atTop + (𝓝 (kernelProjection (1 - outer w))) at h + simpa only [kernelProjection_one_sub_outer w hw] using h + have hXi : Tendsto (fun t => (X v t : Mat 4 ℝ)⁻¹) atTop (𝓝 (outer v)) := by + have h := (hS v hv).mul (hS v hv) + rw [outer_mul_self v hv] at h + apply h.congr' + filter_upwards [eventually_ge_atTop (1 : ℝ)] with t ht + exact inverseSquareRoot_sq (X v t) (hX v hv t ht) + let A (t : ℝ) := inverseSquareRoot (X u t) * phi y (X v t : Mat 4 ℝ)⁻¹ * + inverseSquareRoot (X u t) + let C (t : ℝ) := inverseSquareRoot (P.D (X v t)) * P.B y * + inverseSquareRoot (P.E (X u t)) + have hthreshold : (fun t => ‖A t‖) =ᶠ[atTop] fun t => ‖C t‖ ^ 2 := by + filter_upwards [eventually_ge_atTop (1 : ℝ)] with t ht + exact P.positive_threshold (X v t) (X u t) y (hX v hv t ht) (hX u hu t ht) + (positive_unital_map_affine_posDef P.D P.D_positive P.D_unital _ (hH v hv) t ht) + (positive_unital_map_affine_posDef P.E P.E_positive P.E_unital _ (hH u hu) t ht) + have hphi : Tendsto (fun t => phi y (X v t : Mat 4 ℝ)⁻¹) atTop + (𝓝 (phi y (outer v))) := + (phiLinear y).continuous_of_finiteDimensional.continuousAt.tendsto.comp hXi + have hA : Tendsto A atTop (𝓝 (choiLam (wedgeCoordinates v u) y • outer u)) := by + have h := ((hS u hu).mul hphi).mul (hS u hu) + simpa only [outer_mul_mul_outer, phi_rank_one] using h + have hA' : Tendsto (fun t => ‖A t‖) atTop (𝓝 (choiLam (wedgeCoordinates v u) y)) := by + simpa only [norm_smul, Real.norm_eq_abs, abs_of_nonneg (choiLam_nonnegative _ _), + norm_outer_unit u hu, mul_one] using hA.norm + have hD : Tendsto (fun t => inverseSquareRoot (P.D (X v t))) atTop + (𝓝 (P.leftProjection v)) := + positive_unital_map_inverseSquareRoot_tendsto P.D P.D_positive P.D_unital _ (hH v hv) + have hE : Tendsto (fun t => inverseSquareRoot (P.E (X u t))) atTop + (𝓝 (P.rightProjection u)) := + positive_unital_map_inverseSquareRoot_tendsto P.E P.E_positive P.E_unital _ (hH u hu) + have hC : Tendsto C atTop (𝓝 (P.leftProjection v * P.B y * P.rightProjection u)) := + matrix_mul_tendsto (matrix_mul_tendsto hD tendsto_const_nhds) hE + have heq := tendsto_nhds_unique (hA'.congr' hthreshold) (hC.norm.pow 2) + simpa only [operatorNorm_eq_norm] using heq + +theorem NormalizedPencil.same_direction_zero (P : NormalizedPencil) + (v : Vec 4) (hv : ‖v‖ = 1) (y : Fin 3 → ℝ) : + P.leftProjection v * P.B y * P.rightProjection v = 0 := by + have h := P.norm_identity v v hv hv y + have hz : wedgeCoordinates v v = 0 := by ext i; simp [wedgeCoordinates] + rw [hz] at h + have hc : choiLam (0 : Fin 3 → ℝ) y = 0 := by simp [choiLam] + rw [hc, operatorNorm_eq_norm] at h + exact norm_eq_zero.mp (sq_eq_zero_iff.mp h.symm) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/NormLimits.lean b/lean/OAI/Analysis/HyperbolicCones/NormLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..d0f56af7ac381989b8158f1a05b2e9cc10ef053a --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/NormLimits.lean @@ -0,0 +1,48 @@ +import OAI.Analysis.HyperbolicCones.KernelLimit + +namespace OAI + +/-! The positive affine paths used in the norm identity and their matrix limits. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix Filter Topology +universe u + +namespace Paper256 + +theorem matrix_mul_tendsto {m n k : ℕ} {T : Type u} {L : Filter T} + {A : T → Matrix (Fin m) (Fin n) ℝ} {B : T → Matrix (Fin n) (Fin k) ℝ} + {A₀ : Matrix (Fin m) (Fin n) ℝ} {B₀ : Matrix (Fin n) (Fin k) ℝ} + (hA : Tendsto A L (𝓝 A₀)) (hB : Tendsto B L (𝓝 B₀)) : + Tendsto (fun t => A t * B t) L (𝓝 (A₀ * B₀)) := + ((continuous_fst.matrix_mul continuous_snd).tendsto (A₀, B₀)).comp + (hA.prodMk_nhds hB) + +theorem affine_posDef {n : ℕ} (H : Sym n) (hH : (H : Mat n ℝ).PosSemidef) + (t : ℝ) (ht : 1 ≤ t) : + ((1 + (t - 1) • H : Sym n) : Mat n ℝ).PosDef := by + change ((1 : Mat n ℝ) + (t - 1) • (H : Mat n ℝ)).PosDef + exact Matrix.PosDef.one.add_posSemidef (hH.smul (sub_nonneg.mpr ht)) + +theorem positive_unital_map_affine_posDef {m n : ℕ} (D : Sym m →ₗ[ℝ] Sym n) + (hD : ∀ H : Sym m, (H : Mat m ℝ).PosSemidef → (D H : Mat n ℝ).PosSemidef) + (hI : D 1 = 1) (H : Sym m) (hH : (H : Mat m ℝ).PosSemidef) + (t : ℝ) (ht : 1 ≤ t) : + (D (1 + (t - 1) • H) : Mat n ℝ).PosDef := by + simpa only [map_add, map_smul, hI] using affine_posDef (D H) (hD H hH) t ht + +theorem positive_unital_map_inverseSquareRoot_tendsto {m n : ℕ} + (D : Sym m →ₗ[ℝ] Sym n) + (hD : ∀ H : Sym m, (H : Mat m ℝ).PosSemidef → (D H : Mat n ℝ).PosSemidef) + (hI : D 1 = 1) (H : Sym m) (hH : (H : Mat m ℝ).PosSemidef) : + Tendsto (fun t : ℝ => inverseSquareRoot (D (1 + (t - 1) • H))) atTop + (𝓝 (kernelProjection (D H : Mat n ℝ))) := by + simpa only [map_add, map_smul, hI] using + inverseSquareRoot_affine_tendsto (D H) (hD H hH) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/NormThreshold.lean b/lean/OAI/Analysis/HyperbolicCones/NormThreshold.lean new file mode 100644 index 0000000000000000000000000000000000000000..7258a8b9938017308fae412830cc239b46fa07d6 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/NormThreshold.lean @@ -0,0 +1,52 @@ +import OAI.Analysis.HyperbolicCones.InverseOrder + +namespace OAI + +/-! The exact scalar threshold of a positive semidefinite matrix. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix +namespace Paper256 + +theorem posSemidef_scalar_sub_iff {n : ℕ} (A : Mat n ℝ) (hA : A.IsHermitian) (r : ℝ) : + (r • (1 : Mat n ℝ) - A).PosSemidef ↔ ∀ x ∈ spectrum ℝ A, x ≤ r := by + let H : Sym n := ⟨A, hA⟩ + have hshift : cfc (fun x : ℝ => r - x) A = r • (1 : Mat n ℝ) - A := by + simpa only [neg_one_mul, neg_one_smul, sub_eq_add_neg] using matrix_cfc_affine H r (-1) + rw [← Matrix.nonneg_iff_posSemidef, ← hshift] + have h := cfc_nonneg_iff (fun x : ℝ => r - x) A + (A.finite_real_spectrum.continuousOn _) hA + simpa only [sub_nonneg] using h + +theorem posSemidef_norm_threshold {n : ℕ} [NeZero n] (A : Mat n ℝ) + (hA : A.PosSemidef) (r : ℝ) : + (r • (1 : Mat n ℝ) - A).PosSemidef ↔ ‖A‖ ≤ r := by + rw [posSemidef_scalar_sub_iff A hA.isHermitian r] + have hgreat := IsometricContinuousFunctionalCalculus.isGreatest_norm_spectrum (𝕜 := ℝ) (p := IsSelfAdjoint) A hA.isHermitian + constructor + · intro h + obtain ⟨x, hx, hnorm⟩ := hgreat.1 + have hx0 : 0 ≤ x := spectrum_nonneg_of_nonneg hA.nonneg hx + calc + ‖A‖ = x := by simpa only [Real.norm_eq_abs, abs_of_nonneg hx0] using hnorm.symm + _ ≤ r := h x hx + · intro h x hx + exact (le_abs_self x).trans ((hgreat.2 ⟨x, hx, rfl⟩).trans h) + +theorem posSemidef_gram_threshold {m n : ℕ} [NeZero n] + (C : Matrix (Fin m) (Fin n) ℝ) (r : ℝ) : + (r • (1 : Mat n ℝ) - Cᵀ * C).PosSemidef ↔ ‖C‖ ^ 2 ≤ r := by + have hp : (Cᵀ * C).PosSemidef := by + simpa only [conjTranspose_eq_transpose_of_trivial] using Matrix.posSemidef_conjTranspose_mul_self C + rw [posSemidef_norm_threshold _ hp] + have hn : ‖Cᵀ * C‖ = ‖C‖ ^ 2 := by + simpa only [conjTranspose_eq_transpose_of_trivial, pow_two] using + Matrix.l2_opNorm_conjTranspose_mul_self C + rw [hn] + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/OperatorEntries.lean b/lean/OAI/Analysis/HyperbolicCones/OperatorEntries.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d9f112a82a9abb6057641b023290d0b109b3c9e --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/OperatorEntries.lean @@ -0,0 +1,44 @@ +import OAI.Analysis.HyperbolicCones.Model + +namespace OAI + +noncomputable section + +open scoped Matrix.Norms.L2Operator +open Matrix + +namespace Paper256 + +theorem operatorNorm_eq_norm {m n : ℕ} (A : Matrix (Fin m) (Fin n) ℝ) : + operatorNorm A = ‖A‖ := rfl + +theorem operatorNorm_smul {m n : ℕ} (s : ℝ) (A : Matrix (Fin m) (Fin n) ℝ) : + operatorNorm (s • A) = |s| * operatorNorm A := by + simp only [operatorNorm_eq_norm, norm_smul, Real.norm_eq_abs] + +theorem operatorNorm_continuous {m n : ℕ} : + Continuous (operatorNorm (m := m) (n := n)) := by + simpa only [operatorNorm_eq_norm] using! + (continuous_norm : Continuous (fun A : Matrix (Fin m) (Fin n) ℝ => ‖A‖)) + +theorem abs_entry_le_operatorNorm {m n : ℕ} (A : Matrix (Fin m) (Fin n) ℝ) + (i : Fin m) (j : Fin n) : |A i j| ≤ operatorNorm A := by + let f := A.toEuclideanLin.toContinuousLinearMap + have he : f (PiLp.single 2 j 1) i = A i j := by + simp [f, Matrix.toEuclideanLin, Matrix.toLpLin_apply, Matrix.mulVec_single] + have h₁ := PiLp.norm_apply_le (f (PiLp.single 2 j 1)) i + have h₂ := f.unit_le_opNorm (PiLp.single 2 j 1) + (by rw [PiLp.norm_single]; norm_num : ‖(PiLp.single 2 j (1 : ℝ) : Vec n)‖ ≤ 1) + simpa only [he, Real.norm_eq_abs] using! h₁.trans h₂ + +theorem entry_sq_le_operatorNorm_sq {m n : ℕ} (A : Matrix (Fin m) (Fin n) ℝ) + (i : Fin m) (j : Fin n) : (A i j) ^ 2 ≤ operatorNorm A ^ 2 := by + have h := abs_entry_le_operatorNorm A i j + have hn : 0 ≤ operatorNorm A := norm_nonneg _ + nlinarith [sq_abs (A i j), abs_nonneg (A i j)] + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/Pencil.lean b/lean/OAI/Analysis/HyperbolicCones/Pencil.lean new file mode 100644 index 0000000000000000000000000000000000000000..dec141f315ce3a7eb8509debd9dcdb7bb8c84060 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/Pencil.lean @@ -0,0 +1,25 @@ +import OAI.Analysis.HyperbolicCones.PencilRepresentation +import OAI.Analysis.HyperbolicCones.PencilSplit +import OAI.Analysis.HyperbolicCones.PencilRecovery +import OAI.Analysis.HyperbolicCones.PencilRegularization +import OAI.Analysis.HyperbolicCones.ConeInterior +import OAI.Analysis.HyperbolicCones.ConeZero + +namespace OAI + +noncomputable section + +namespace Paper256 + +theorem pencil_normalization (N : ℕ) (_hN : 0 < N) (L : Ambient →ₗ[ℝ] Sym N) + (hL : cone = {x | (L x : Mat N ℝ).PosSemidef}) : Nonempty NormalizedPencil := by + obtain ⟨m, hm, C, hC, hrep⟩ := representation_compression_of_zero_slice cone L hL + basePoint_mem_interior_cone cone_zero_slice + obtain ⟨P⟩ := blockPencil_exists cone m hm C hC hrep cone_zero_slice + exact P.normalized_exists cone_positive_slice + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PencilBlocks.lean b/lean/OAI/Analysis/HyperbolicCones/PencilBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d0b9424ebafa365ef97fdaf9297a6b535067004 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PencilBlocks.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.HyperbolicCones.MatrixLinear + +namespace OAI + +noncomputable section + +open Set Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +/-- The actual finite blocks after common-kernel compression and fixed diagonal congruence. -/ +structure BlockPencil (K : Set Ambient) where + a : ℕ + c : ℕ + a_pos : 0 < a + c_pos : 0 < c + D : Sym 4 →ₗ[ℝ] Sym a + E : Sym 4 →ₗ[ℝ] Sym c + F : Sym 4 →ₗ[ℝ] Sym a + C : Sym 4 →ₗ[ℝ] Matrix (Fin a) (Fin c) ℝ + A : (Fin 3 → ℝ) →ₗ[ℝ] Sym a + B : (Fin 3 → ℝ) →ₗ[ℝ] Matrix (Fin a) (Fin c) ℝ + G : (Fin 3 → ℝ) →ₗ[ℝ] Sym c + D_positive : ∀ X : Sym 4, (X : Mat 4 ℝ).PosSemidef → (D X : Mat a ℝ).PosSemidef + E_positive : ∀ X : Sym 4, (X : Mat 4 ℝ).PosSemidef → (E X : Mat c ℝ).PosSemidef + D_unital : D 1 = 1 + E_unital : E 1 = 1 + represents : ∀ (X Z : Sym 4) (y : Fin 3 → ℝ), ((X, Z), y) ∈ K ↔ + (Matrix.fromBlocks ((D X : Mat a ℝ) + (F Z : Mat a ℝ) + (A y : Mat a ℝ)) + (C Z + B y) (C Z + B y)ᵀ ((E Z : Mat c ℝ) + (G y : Mat c ℝ))).PosSemidef + +namespace BlockPencil + +def matrix {K : Set Ambient} (P : BlockPencil K) (X Z : Sym 4) (y : Fin 3 → ℝ) : + Matrix (Fin P.a ⊕ Fin P.c) (Fin P.a ⊕ Fin P.c) ℝ := + Matrix.fromBlocks ((P.D X : Mat P.a ℝ) + (P.F Z : Mat P.a ℝ) + (P.A y : Mat P.a ℝ)) + (P.C Z + P.B y) (P.C Z + P.B y)ᵀ ((P.E Z : Mat P.c ℝ) + (P.G y : Mat P.c ℝ)) + +def scaled {K : Set Ambient} (P : BlockPencil K) (X Z : Sym 4) (y : Fin 3 → ℝ) (s : ℝ) : + Matrix (Fin P.a ⊕ Fin P.c) (Fin P.a ⊕ Fin P.c) ℝ := + Matrix.fromBlocks ((P.D X : Mat P.a ℝ) + s • (P.A y : Mat P.a ℝ) + + s ^ 2 • (P.F Z : Mat P.a ℝ)) + (P.B y + s • P.C Z) (P.B y + s • P.C Z)ᵀ (P.E Z : Mat P.c ℝ) + +def limit {K : Set Ambient} (P : BlockPencil K) (X Z : Sym 4) (y : Fin 3 → ℝ) : + Matrix (Fin P.a ⊕ Fin P.c) (Fin P.a ⊕ Fin P.c) ℝ := + Matrix.fromBlocks (P.D X : Mat P.a ℝ) (P.B y) (P.B y)ᵀ (P.E Z : Mat P.c ℝ) + +theorem matrix_isHermitian {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) : (P.matrix X Z y).IsHermitian := by + apply Matrix.IsHermitian.fromBlocks + · exact ((P.D X).property.add (P.F Z).property).add (P.A y).property + · simp + · exact (P.E Z).property.add (P.G y).property + +theorem limit_isHermitian {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) : (P.limit X Z y).IsHermitian := by + apply Matrix.IsHermitian.fromBlocks + · exact (P.D X).property + · simp + · exact (P.E Z).property + +end BlockPencil + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PencilCompression.lean b/lean/OAI/Analysis/HyperbolicCones/PencilCompression.lean new file mode 100644 index 0000000000000000000000000000000000000000..0900e1c80d0bffaef4fd11749e87cf2dc671357c --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PencilCompression.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.HyperbolicCones.PencilConjugation +import OAI.Analysis.HyperbolicCones.PencilKernel + +namespace OAI + +noncomputable section + +open Matrix Set +open scoped Matrix.Norms.L2Operator + +universe u + +namespace Paper256 + +variable {V : Type u} [AddCommGroup V] [Module ℝ V] + +theorem pencil_compression {n : ℕ} (L : V →ₗ[ℝ] Sym n) (e : V) + (he : (L e : Mat n ℝ).PosSemidef) + (hker : ∀ x : V, ∀ v : Fin n → ℝ, + (L e : Mat n ℝ) *ᵥ v = 0 → (L x : Mat n ℝ) *ᵥ v = 0) : + ∃ m : ℕ, ∃ C : V →ₗ[ℝ] Sym m, + (C e : Mat m ℝ).PosDef ∧ + ∀ x : V, (L x : Mat n ℝ).PosSemidef ↔ (C x : Mat m ℝ).PosSemidef := by + classical + let p : Fin n → Prop := fun i => 0 < (sym_isHermitian (L e)).eigenvalues i + let J := {i : Fin n // p i} + let m := Fintype.card J + let q : Fin m ≃ J := (Fintype.equivFin J).symm + let f : Fin m → Fin n := fun i => (q i).val + let U : Mat n ℝ := (sym_isHermitian (L e)).eigenvectorUnitary + let T := conjugatePencil L U + let C := restrictPencil T f + have hf : Function.Injective f := Subtype.val_injective.comp q.injective + refine ⟨m, C, ?_, ?_⟩ + · change ((Uᴴ * (L e : Mat n ℝ) * U).submatrix f f).PosDef + rw [spectral_conjugate_diagonal (L e), Matrix.submatrix_diagonal _ f hf] + exact Matrix.PosDef.diagonal fun i => (q i).property + · intro x + have hT : (T x : Mat n ℝ).IsHermitian := (T x).property + have hzero : ∀ i, ¬p i → ∀ j, (T x : Mat n ℝ) i j = 0 := by + intro i hi j + exact spectral_conjugate_zero_row (L e) (L x) he (hker x) i hi j + have hp := matrix_compression_posSemidef_iff p (T x : Mat n ℝ) hT hzero + have hq := Matrix.posSemidef_submatrix_equiv + (M := (T x : Mat n ℝ).submatrix (Subtype.val : J → Fin n) Subtype.val) q + calc + (L x : Mat n ℝ).PosSemidef ↔ (T x : Mat n ℝ).PosSemidef := + (conjugatePencil_posSemidef_iff L U + (Unitary.isUnit_coe (U := (sym_isHermitian (L e)).eigenvectorUnitary)) x).symm + _ ↔ ((T x : Mat n ℝ).submatrix (Subtype.val : J → Fin n) Subtype.val).PosSemidef := hp + _ ↔ (C x : Mat m ℝ).PosSemidef := by + simpa [C, restrictPencil, f, Matrix.submatrix_submatrix, Function.comp_def] using hq.symm + +theorem pencil_compression_positive {n : ℕ} (L : V →ₗ[ℝ] Sym n) (e : V) + (he : (L e : Mat n ℝ).PosSemidef) + (hker : ∀ x : V, ∀ v : Fin n → ℝ, + (L e : Mat n ℝ) *ᵥ v = 0 → (L x : Mat n ℝ) *ᵥ v = 0) + (hproper : ∃ x : V, ¬(L x : Mat n ℝ).PosSemidef) : + ∃ m : ℕ, 0 < m ∧ ∃ C : V →ₗ[ℝ] Sym m, + (C e : Mat m ℝ).PosDef ∧ + ∀ x : V, (L x : Mat n ℝ).PosSemidef ↔ (C x : Mat m ℝ).PosSemidef := by + obtain ⟨m, C, hC, hrep⟩ := pencil_compression L e he hker + refine ⟨m, ?_, C, hC, hrep⟩ + by_contra hm + have hm0 : m = 0 := Nat.eq_zero_of_not_pos hm + subst m + obtain ⟨x, hx⟩ := hproper + apply hx + apply (hrep x).mpr + have hz : (C x : Mat 0 ℝ) = 0 := Subsingleton.elim _ _ + rw [hz] + exact Matrix.PosSemidef.zero + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PencilConjugation.lean b/lean/OAI/Analysis/HyperbolicCones/PencilConjugation.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b29f63f97904405c65bf60b2b106d72003c4250 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PencilConjugation.lean @@ -0,0 +1,79 @@ +import OAI.Analysis.HyperbolicCones.CompressionBasic + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator + +universe u + +namespace Paper256 + +variable {V : Type u} [AddCommGroup V] [Module ℝ V] + +def conjugatePencil {n : ℕ} (L : V →ₗ[ℝ] Sym n) (U : Mat n ℝ) : V →ₗ[ℝ] Sym n where + toFun x := ⟨Uᴴ * (L x : Mat n ℝ) * U, + Matrix.isHermitian_conjTranspose_mul_mul U (L x).property⟩ + map_add' x y := by + apply Subtype.ext + simp [mul_add, add_mul] + map_smul' c x := by + apply Subtype.ext + simp + +def restrictPencil {m n : ℕ} (L : V →ₗ[ℝ] Sym n) (f : Fin m → Fin n) : + V →ₗ[ℝ] Sym m where + toFun x := ⟨(L x : Mat n ℝ).submatrix f f, (sym_isHermitian (L x)).submatrix f⟩ + map_add' x y := by apply Subtype.ext; ext i j; simp + map_smul' c x := by apply Subtype.ext; ext i j; simp + +theorem conjugatePencil_posSemidef_iff {n : ℕ} (L : V →ₗ[ℝ] Sym n) + (U : Mat n ℝ) (hU : IsUnit U) (x : V) : + (conjugatePencil L U x : Mat n ℝ).PosSemidef ↔ (L x : Mat n ℝ).PosSemidef := by + change (Uᴴ * (L x : Mat n ℝ) * U).PosSemidef ↔ _ + simpa only [Matrix.star_eq_conjTranspose] using hU.posSemidef_star_left_conjugate_iff + +theorem spectral_conjugate_diagonal {n : ℕ} (A : Sym n) : + ((sym_isHermitian A).eigenvectorUnitary : Mat n ℝ)ᴴ * (A : Mat n ℝ) * + ((sym_isHermitian A).eigenvectorUnitary : Mat n ℝ) = Matrix.diagonal (sym_isHermitian A).eigenvalues := by + simpa [Unitary.conjStarAlgAut_star_apply, Matrix.star_eq_conjTranspose, + Function.comp_def] using (sym_isHermitian A).conjStarAlgAut_star_eigenvectorUnitary + +theorem spectral_conjugate_zero_column {n : ℕ} (A B : Sym n) + (hA : (A : Mat n ℝ).PosSemidef) + (hker : ∀ v : Fin n → ℝ, (A : Mat n ℝ) *ᵥ v = 0 → (B : Mat n ℝ) *ᵥ v = 0) + (i : Fin n) (hi : ¬ 0 < (sym_isHermitian A).eigenvalues i) (j : Fin n) : + (((sym_isHermitian A).eigenvectorUnitary : Mat n ℝ)ᴴ * (B : Mat n ℝ) * + ((sym_isHermitian A).eigenvectorUnitary : Mat n ℝ)) j i = 0 := by + let U : Mat n ℝ := (sym_isHermitian A).eigenvectorUnitary + have heig : (sym_isHermitian A).eigenvalues i = 0 := + le_antisymm (le_of_not_gt hi) (hA.eigenvalues_nonneg i) + have ha : (A : Mat n ℝ) *ᵥ (U *ᵥ Pi.single i 1) = 0 := by + rw [show U *ᵥ Pi.single i 1 = ⇑((sym_isHermitian A).eigenvectorBasis i) from + (sym_isHermitian A).eigenvectorUnitary_mulVec i] + rw [(sym_isHermitian A).mulVec_eigenvectorBasis, heig, zero_smul] + have hb := hker (U *ᵥ Pi.single i 1) ha + have hz : (Uᴴ * (B : Mat n ℝ) * U) *ᵥ Pi.single i 1 = 0 := by + rw [← mulVec_mulVec, ← mulVec_mulVec, hb, mulVec_zero] + have hv := congrFun hz j + simpa using hv + +theorem spectral_conjugate_zero_row {n : ℕ} (A B : Sym n) + (hA : (A : Mat n ℝ).PosSemidef) + (hker : ∀ v : Fin n → ℝ, (A : Mat n ℝ) *ᵥ v = 0 → (B : Mat n ℝ) *ᵥ v = 0) + (i : Fin n) (hi : ¬ 0 < (sym_isHermitian A).eigenvalues i) (j : Fin n) : + (((sym_isHermitian A).eigenvectorUnitary : Mat n ℝ)ᴴ * (B : Mat n ℝ) * + ((sym_isHermitian A).eigenvectorUnitary : Mat n ℝ)) i j = 0 := by + have hh := Matrix.isHermitian_conjTranspose_mul_mul + ((sym_isHermitian A).eigenvectorUnitary : Mat n ℝ) B.property + have hs := hh.apply j i + have hz := spectral_conjugate_zero_column A B hA hker i hi j + simpa using hs.trans hz + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PencilKernel.lean b/lean/OAI/Analysis/HyperbolicCones/PencilKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..25d750d40278b2079cde76a7802cfb590a46c265 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PencilKernel.lean @@ -0,0 +1,62 @@ +import OAI.Analysis.HyperbolicCones.MatrixLinear + +namespace OAI + +noncomputable section + +open Set Filter Matrix +open scoped Topology Matrix.Norms.L2Operator MatrixOrder + +universe u + +namespace Paper256 + +theorem posSemidef_pair_kernel {n : ℕ} {A H : Mat n ℝ} + (hplus : (A + H).PosSemidef) (hminus : (A - H).PosSemidef) + (v : Fin n → ℝ) (hv : A *ᵥ v = 0) : H *ᵥ v = 0 := by + have hp := hplus.dotProduct_mulVec_nonneg v + have hm := hminus.dotProduct_mulVec_nonneg v + simp only [star_trivial, add_mulVec, sub_mulVec, hv, zero_add, zero_sub, + dotProduct_neg] at hp hm + have hz : v ⬝ᵥ ((A + H) *ᵥ v) = 0 := by + simp only [add_mulVec, hv, zero_add] + linarith + have hh := hplus.dotProduct_mulVec_zero_iff.mp (by simpa only [star_trivial] using hz) + simpa only [add_mulVec, hv, zero_add] using hh + +theorem interior_line_pair {V : Type u} [NormedAddCommGroup V] [NormedSpace ℝ V] + {K : Set V} {e : V} (he : e ∈ interior K) (x : V) : + ∃ ε : ℝ, 0 < ε ∧ e + ε • x ∈ K ∧ e - ε • x ∈ K := by + have hp : Tendsto (fun t : ℝ => e + t • x) (𝓝 0) (𝓝 e) := by + have h : Continuous (fun t : ℝ => e + t • x) := by fun_prop + simpa using h.tendsto (0 : ℝ) + have hm : Tendsto (fun t : ℝ => e - t • x) (𝓝 0) (𝓝 e) := by + have h : Continuous (fun t : ℝ => e - t • x) := by fun_prop + simpa using h.tendsto (0 : ℝ) + have hh := (hp.eventually (mem_interior_iff_mem_nhds.mp he)).and + (hm.eventually (mem_interior_iff_mem_nhds.mp he)) + obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp hh + refine ⟨r / 2, by positivity, hball ?_⟩ + simp only [Metric.mem_ball, dist_zero_right, Real.norm_eq_abs, abs_of_pos (half_pos hr)] + linarith + +theorem pencil_common_kernel {N : ℕ} (K : Set Ambient) + (L : Ambient →ₗ[ℝ] Sym N) (hL : K = {x | (L x : Mat N ℝ).PosSemidef}) + (he : basePoint ∈ interior K) (x : Ambient) (v : Fin N → ℝ) + (hv : (L basePoint : Mat N ℝ) *ᵥ v = 0) : + (L x : Mat N ℝ) *ᵥ v = 0 := by + obtain ⟨ε, hε, hp, hm⟩ := interior_line_pair he x + rw [hL] at hp hm + have hp' : ((L basePoint : Mat N ℝ) + ε • (L x : Mat N ℝ)).PosSemidef := by + simpa using hp + have hm' : ((L basePoint : Mat N ℝ) - ε • (L x : Mat N ℝ)).PosSemidef := by + simpa using hm + have hz := posSemidef_pair_kernel hp' hm' v hv + rw [smul_mulVec] at hz + exact (smul_eq_zero.mp hz).resolve_left hε.ne' + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PencilLimit.lean b/lean/OAI/Analysis/HyperbolicCones/PencilLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..166cd07b663bd67bb3d902edf497ce490cec730c --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PencilLimit.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.HyperbolicCones.BlockScaling +import OAI.Analysis.HyperbolicCones.FiniteTopology + +namespace OAI + +noncomputable section + +open Matrix Set Filter +open scoped Topology Matrix.Norms.L2Operator + +namespace Paper256.BlockPencil + +def scaledSelfAdjoint {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) (s : ℝ) : + selfAdjoint (Matrix (Fin P.a ⊕ Fin P.c) (Fin P.a ⊕ Fin P.c) ℝ) := + ⟨P.scaled X Z y s, P.scaled_isHermitian X Z y s⟩ + +def limitSelfAdjoint {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) : + selfAdjoint (Matrix (Fin P.a ⊕ Fin P.c) (Fin P.a ⊕ Fin P.c) ℝ) := + ⟨P.limit X Z y, P.limit_isHermitian X Z y⟩ + +theorem scaled_polynomial {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) (s : ℝ) : + P.scaled X Z y s = P.limit X Z y + + s • Matrix.fromBlocks (P.A y : Mat P.a ℝ) (P.C Z) (P.C Z)ᵀ (0 : Mat P.c ℝ) + + s ^ 2 • Matrix.fromBlocks (P.F Z : Mat P.a ℝ) 0 0 (0 : Mat P.c ℝ) := by + ext (i | i) (j | j) <;> simp [scaled, limit, Matrix.fromBlocks] + +theorem scaled_continuous {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) : Continuous (P.scaled X Z y) := by + change Continuous (fun s : ℝ => P.scaled X Z y s) + simp_rw [P.scaled_polynomial X Z y] + fun_prop + +theorem scaledSelfAdjoint_continuous {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) : Continuous (P.scaledSelfAdjoint X Z y) := + (P.scaled_continuous X Z y).subtype_mk _ + +theorem scaledSelfAdjoint_zero {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) : + P.scaledSelfAdjoint X Z y 0 = P.limitSelfAdjoint X Z y := by + apply Subtype.ext + exact P.scaled_zero X Z y + +theorem scaled_tendsto {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) : + Tendsto (P.scaledSelfAdjoint X Z y) (𝓝 0) (𝓝 (P.limitSelfAdjoint X Z y)) := by + simpa only [P.scaledSelfAdjoint_zero X Z y] using + (P.scaledSelfAdjoint_continuous X Z y).tendsto (0 : ℝ) + +theorem limit_posSemidef_of_target {K : Set Ambient} (P : BlockPencil K) + (hSlice : ∀ (X Z : Sym 4) (y : Fin 3 → ℝ), (X : Mat 4 ℝ).PosDef → + (((X, Z), y) ∈ K ↔ ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef)) + (X Z : Sym 4) (y : Fin 3 → ℝ) (hX : (X : Mat 4 ℝ).PosDef) + (hZ : ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef) : + (P.limit X Z y).PosSemidef := by + have hsne : ∀ᶠ s : ℝ in 𝓝[≠] 0, s ≠ 0 := by + filter_upwards [eventually_mem_nhdsWithin] with s hs + simpa using hs + apply FiniteMatrix.posSemidef_of_tendsto (f := 𝓝[≠] (0 : ℝ)) + ((P.scaled_tendsto X Z y).mono_left inf_le_left) + filter_upwards [hsne] with s hs + exact (P.scaled_posSemidef_iff hSlice X Z y hX s hs).mpr hZ + +end Paper256.BlockPencil + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PencilOrder.lean b/lean/OAI/Analysis/HyperbolicCones/PencilOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..c2b0c06611d0d61e3850f320bc8898fddd0c40c2 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PencilOrder.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.HyperbolicCones.KernelSpectrum + +namespace OAI + +noncomputable section + +open Set Filter Matrix +open scoped Topology Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +theorem sym_neg_norm_le {n : ℕ} (X : Sym n) : + -(‖(X : Mat n ℝ)‖) • (1 : Mat n ℝ) ≤ (X : Mat n ℝ) := by + classical + rcases isEmpty_or_nonempty (Fin n) with h | h + · have := h + exact (Subsingleton.elim _ _).le + · have := h + rw [← Algebra.algebraMap_eq_smul_one] + apply (algebraMap_le_iff_le_spectrum (R := ℝ) (p := IsSelfAdjoint) X.property).mpr + intro x hx + have hh := spectrum.norm_le_norm_of_mem hx + have hl := neg_abs_le x + simpa only [Real.norm_eq_abs] using le_trans (neg_le_neg hh) hl + +theorem sym_le_norm {n : ℕ} (X : Sym n) : + (X : Mat n ℝ) ≤ ‖(X : Mat n ℝ)‖ • (1 : Mat n ℝ) := by + classical + rcases isEmpty_or_nonempty (Fin n) with h | h + · have := h + exact (Subsingleton.elim _ _).le + · have := h + rw [← Algebra.algebraMap_eq_smul_one] + apply (le_algebraMap_iff_spectrum_le (R := ℝ) (p := IsSelfAdjoint) X.property).mpr + intro x hx + exact (le_abs_self x).trans (spectrum.norm_le_norm_of_mem hx) + +theorem posDef_of_scalar_lower_bound {n : ℕ} {X : Mat n ℝ} {c : ℝ} + (hc : 0 < c) (hX : c • (1 : Mat n ℝ) ≤ X) : X.PosDef := by + have h := (Matrix.PosDef.one.smul hc).add_posSemidef hX + simpa only [add_sub_cancel] using h + +theorem posDef_scalar_lower_bound {n : ℕ} (X : Mat n ℝ) (hX : X.PosDef) : + ∃ c : ℝ, 0 < c ∧ c • (1 : Mat n ℝ) ≤ X := by + classical + rcases isEmpty_or_nonempty (Fin n) with h | h + · have := h + exact ⟨1, zero_lt_one, (Subsingleton.elim _ _).le⟩ + · have := h + have hh := (CFC.exists_pos_algebraMap_le_iff X hX.isHermitian).mpr + (fun x hx => posDef_real_spectrum_positive hX hx) + simpa only [Algebra.algebraMap_eq_smul_one] using hh + +theorem isOpen_posDef (n : ℕ) : IsOpen {X : Sym n | (X : Mat n ℝ).PosDef} := by + apply Metric.isOpen_iff.mpr + intro H hH + obtain ⟨c, hc, hbound⟩ := posDef_scalar_lower_bound (H : Mat n ℝ) hH + refine ⟨c / 2, by positivity, ?_⟩ + intro X hX + have hnorm : ‖((X - H : Sym n) : Mat n ℝ)‖ < c / 2 := by + simpa only [Metric.mem_ball, dist_eq_norm, AddSubgroup.coe_norm] using hX + have hlower : -(c / 2) • (1 : Mat n ℝ) ≤ ((X - H : Sym n) : Mat n ℝ) := + (smul_le_smul_of_nonneg_right (by linarith : -(c / 2) ≤ -‖((X - H : Sym n) : Mat n ℝ)‖) + Matrix.PosSemidef.one.nonneg).trans (sym_neg_norm_le (X - H)) + apply posDef_of_scalar_lower_bound (show 0 < c / 2 by positivity) + have hh : c • (1 : Mat n ℝ) + -(c / 2) • (1 : Mat n ℝ) ≤ + (H : Mat n ℝ) + ((X : Mat n ℝ) - (H : Mat n ℝ)) := add_le_add hbound hlower + convert hh using 1 <;> module + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PencilRecovery.lean b/lean/OAI/Analysis/HyperbolicCones/PencilRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa1d38e25ba9d7f0a56988a0bcad0c7b36e46cde --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PencilRecovery.lean @@ -0,0 +1,99 @@ +import OAI.Analysis.HyperbolicCones.PencilLimit +import OAI.Analysis.HyperbolicCones.PositiveMaps +import OAI.Analysis.HyperbolicCones.StrictBlock + +namespace OAI + +noncomputable section + +open Matrix Set Filter +open scoped Topology Matrix.Norms.L2Operator + +namespace Paper256.BlockPencil + +theorem limit_add_identity {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) (δ : ℝ) : + P.limit X (Z + δ • 1) y = + Matrix.fromBlocks (P.D X : Mat P.a ℝ) (P.B y) (P.B y)ᵀ + ((P.E Z : Mat P.c ℝ) + δ • 1) := by + simp [limit, P.E_unital] + +theorem limit_add_identity_posDef {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) (hX : (X : Mat 4 ℝ).PosDef) + (hM : (P.limit X Z y).PosSemidef) (δ : ℝ) (hδ : 0 < δ) : + (P.limit X (Z + δ • 1) y).PosDef := by + rw [P.limit_add_identity] + exact fromBlocks_add_lower_posDef (P.D X) (P.E Z) (P.B y) + (positive_unital_map_posDef P.D P.D_positive P.D_unital X hX) hM δ hδ + +theorem target_of_limit_posSemidef {K : Set Ambient} (P : BlockPencil K) + (hSlice : ∀ (X Z : Sym 4) (y : Fin 3 → ℝ), (X : Mat 4 ℝ).PosDef → + (((X, Z), y) ∈ K ↔ ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef)) + (X Z : Sym 4) (y : Fin 3 → ℝ) (hX : (X : Mat 4 ℝ).PosDef) + (hM : (P.limit X Z y).PosSemidef) : + ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef := by + have hregular (δ : ℝ) (hδ : 0 < δ) : + (((Z + δ • 1 : Sym 4) : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef := by + have hp := P.limit_add_identity_posDef X Z y hX hM δ hδ + have hnb : {H : selfAdjoint (Matrix (Fin P.a ⊕ Fin P.c) (Fin P.a ⊕ Fin P.c) ℝ) | + (H : Matrix (Fin P.a ⊕ Fin P.c) (Fin P.a ⊕ Fin P.c) ℝ).PosDef} ∈ + 𝓝 (P.limitSelfAdjoint X (Z + δ • 1) y) := + (FiniteMatrix.isOpen_posDef (Fin P.a ⊕ Fin P.c)).mem_nhds hp + have he := (P.scaled_tendsto X (Z + δ • 1) y).eventually hnb + have hsne : ∀ᶠ s : ℝ in 𝓝[≠] 0, s ≠ 0 := by + filter_upwards [eventually_mem_nhdsWithin] with s hs + simpa using hs + have he' := (he.filter_mono nhdsWithin_le_nhds).and hsne + obtain ⟨s, hps, hs⟩ := he'.exists + exact (P.scaled_posSemidef_iff hSlice X (Z + δ • 1) y hX s hs).mp hps.posSemidef + let T : Sym 4 := ⟨phi y (X : Mat 4 ℝ)⁻¹, phi_isHermitian y _ hX.inv.isHermitian⟩ + have hcont : Continuous (fun δ : ℝ => Z + δ • (1 : Sym 4) - T) := by fun_prop + have hconv : Tendsto (fun δ : ℝ => Z + δ • (1 : Sym 4) - T) + (𝓝[>] 0) (𝓝 (Z - T)) := by + simpa using (hcont.tendsto (0 : ℝ)).mono_left nhdsWithin_le_nhds + have hevent : ∀ᶠ δ : ℝ in 𝓝[>] 0, + ((Z + δ • 1 - T : Sym 4) : Mat 4 ℝ).PosSemidef := by + filter_upwards [eventually_mem_nhdsWithin] with δ hδ + simpa [T] using hregular δ hδ + have hclosed := posSemidef_of_tendsto hconv hevent + simpa [T] using hclosed + +theorem limit_posSemidef_iff {K : Set Ambient} (P : BlockPencil K) + (hSlice : ∀ (X Z : Sym 4) (y : Fin 3 → ℝ), (X : Mat 4 ℝ).PosDef → + (((X, Z), y) ∈ K ↔ ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef)) + (X Z : Sym 4) (y : Fin 3 → ℝ) (hX : (X : Mat 4 ℝ).PosDef) : + (P.limit X Z y).PosSemidef ↔ + ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef := + ⟨P.target_of_limit_posSemidef hSlice X Z y hX, + P.limit_posSemidef_of_target hSlice X Z y hX⟩ + +theorem normalized_exists {K : Set Ambient} (P : BlockPencil K) + (hSlice : ∀ (X Z : Sym 4) (y : Fin 3 → ℝ), (X : Mat 4 ℝ).PosDef → + (((X, Z), y) ∈ K ↔ ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef)) : + Nonempty NormalizedPencil := by + refine ⟨{ + a := P.a + c := P.c + a_pos := P.a_pos + c_pos := P.c_pos + D := P.D + E := P.E + B := P.B + D_positive := P.D_positive + E_positive := P.E_positive + D_unital := P.D_unital + E_unital := P.E_unital + schur_equivalence := ?_ + }⟩ + intro X Z y hX + have hD := positive_unital_map_posDef P.D P.D_positive P.D_unital X hX + let := hD.isUnit.invertible + rw [← P.limit_posSemidef_iff hSlice X Z y hX] + simpa only [limit, Matrix.conjTranspose_eq_transpose_of_trivial] using + Matrix.PosDef.fromBlocks₁₁ (P.B y) (P.E Z : Mat P.c ℝ) hD + +end Paper256.BlockPencil + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PencilRegularization.lean b/lean/OAI/Analysis/HyperbolicCones/PencilRegularization.lean new file mode 100644 index 0000000000000000000000000000000000000000..e0b0ecf43793ad80d78bf1e86c9270606bca0889 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PencilRegularization.lean @@ -0,0 +1,53 @@ +import OAI.Analysis.HyperbolicCones.PencilRecovery +import OAI.Analysis.HyperbolicCones.SpectralBounds + +namespace OAI + +noncomputable section + +open Matrix Set Filter +open scoped Topology Matrix.Norms.L2Operator + +namespace Paper256 + +theorem linear_term_positive_and_negative {n : ℕ} (E G : Sym n) + (h : ∀ s : ℝ, (s ^ 2 • (E : Mat n ℝ) + s • (G : Mat n ℝ)).PosSemidef) : + (G : Mat n ℝ).PosSemidef ∧ (-(G : Mat n ℝ)).PosSemidef := by + have hz := linear_term_zero_of_quadratic_posSemidef E G h + subst G + exact ⟨Matrix.PosSemidef.zero, by simpa using (Matrix.PosSemidef.zero (n := Fin n) (R := ℝ))⟩ + +namespace BlockPencil + +theorem limit_add_identity_eq_add {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) (δ : ℝ) : + P.limit X (Z + δ • 1) y = P.limit X Z y + + Matrix.fromBlocks (0 : Mat P.a ℝ) 0 0 (δ • (1 : Mat P.c ℝ)) := by + rw [P.limit_add_identity] + ext (i | i) (j | j) <;> simp [limit, Matrix.fromBlocks] + +theorem scaled_eventually_posDef {K : Set Ambient} (P : BlockPencil K) + (X Z : Sym 4) (y : Fin 3 → ℝ) (hP : (P.limit X Z y).PosDef) : + ∀ᶠ s : ℝ in 𝓝 0, (P.scaled X Z y s).PosDef := by + have hnb : {H : selfAdjoint (Matrix (Fin P.a ⊕ Fin P.c) (Fin P.a ⊕ Fin P.c) ℝ) | + (H : Matrix (Fin P.a ⊕ Fin P.c) (Fin P.a ⊕ Fin P.c) ℝ).PosDef} ∈ + 𝓝 (P.limitSelfAdjoint X Z y) := + (FiniteMatrix.isOpen_posDef (Fin P.a ⊕ Fin P.c)).mem_nhds hP + exact (P.scaled_tendsto X Z y).eventually hnb + +theorem regularized_target_of_limit {K : Set Ambient} (P : BlockPencil K) + (hSlice : ∀ (X Z : Sym 4) (y : Fin 3 → ℝ), (X : Mat 4 ℝ).PosDef → + (((X, Z), y) ∈ K ↔ ((Z : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef)) + (X Z : Sym 4) (y : Fin 3 → ℝ) (hX : (X : Mat 4 ℝ).PosDef) + (hM : (P.limit X Z y).PosSemidef) (δ : ℝ) (hδ : 0 < δ) : + (((Z + δ • 1 : Sym 4) : Mat 4 ℝ) - phi y (X : Mat 4 ℝ)⁻¹).PosSemidef := + P.target_of_limit_posSemidef hSlice X (Z + δ • 1) y hX + (P.limit_add_identity_posDef X Z y hX hM δ hδ).posSemidef + +end BlockPencil + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PencilRepresentation.lean b/lean/OAI/Analysis/HyperbolicCones/PencilRepresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..e43a7ad7c0cf344221275881f32a7ac5f3fbd446 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PencilRepresentation.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.HyperbolicCones.PencilCompression + +namespace OAI + +noncomputable section + +open Set Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +theorem zero_slice_proper (K : Set Ambient) + (hzero : ∀ X Z : Sym 4, ((X, Z), (0 : Fin 3 → ℝ)) ∈ K ↔ + (X : Mat 4 ℝ).PosSemidef ∧ (Z : Mat 4 ℝ).PosSemidef) : + (((-1, 1), 0) : Ambient) ∉ K := by + intro h + have hp := ((hzero (-1) 1).mp h).1 + have hd := hp.diag_nonneg (i := (0 : Fin 4)) + norm_num at hd + +theorem representation_compression {n : ℕ} (K : Set Ambient) + (L : Ambient →ₗ[ℝ] Sym n) (hL : K = {x | (L x : Mat n ℝ).PosSemidef}) + (he : basePoint ∈ interior K) (hproper : ∃ x : Ambient, x ∉ K) : + ∃ m : ℕ, 0 < m ∧ ∃ C : Ambient →ₗ[ℝ] Sym m, + (C basePoint : Mat m ℝ).PosDef ∧ K = {x | (C x : Mat m ℝ).PosSemidef} := by + have hb : (L basePoint : Mat n ℝ).PosSemidef := by + have h := interior_subset he + rwa [hL] at h + have hn : ∃ x : Ambient, ¬(L x : Mat n ℝ).PosSemidef := by + simpa only [hL, mem_ofPred_eq] using hproper + obtain ⟨m, hm, C, hC, hrep⟩ := pencil_compression_positive L basePoint hb + (pencil_common_kernel K L hL he) hn + refine ⟨m, hm, C, hC, ?_⟩ + ext x + rw [hL] + exact hrep x + +theorem representation_compression_of_zero_slice {n : ℕ} (K : Set Ambient) + (L : Ambient →ₗ[ℝ] Sym n) (hL : K = {x | (L x : Mat n ℝ).PosSemidef}) + (he : basePoint ∈ interior K) + (hzero : ∀ X Z : Sym 4, ((X, Z), (0 : Fin 3 → ℝ)) ∈ K ↔ + (X : Mat 4 ℝ).PosSemidef ∧ (Z : Mat 4 ℝ).PosSemidef) : + ∃ m : ℕ, 0 < m ∧ ∃ C : Ambient →ₗ[ℝ] Sym m, + (C basePoint : Mat m ℝ).PosDef ∧ K = {x | (C x : Mat m ℝ).PosSemidef} := + representation_compression K L hL he ⟨(((-1, 1), 0) : Ambient), zero_slice_proper K hzero⟩ + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PencilSplit.lean b/lean/OAI/Analysis/HyperbolicCones/PencilSplit.lean new file mode 100644 index 0000000000000000000000000000000000000000..8eba5ab34874b79c4f73189ae2facda81d29a1ea --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PencilSplit.lean @@ -0,0 +1,80 @@ +import OAI.Analysis.HyperbolicCones.SplitAssembly +import OAI.Analysis.HyperbolicCones.BlockNormalization + +namespace OAI + +noncomputable section + +open Set Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +theorem rawBlockPencil_exists {m : ℕ} (K : Set Ambient) + (C : Ambient →ₗ[ℝ] Sym m) (hC : (C basePoint : Mat m ℝ).PosDef) + (hrep : K = {x | (C x : Mat m ℝ).PosSemidef}) + (hzero : ∀ X Z : Sym 4, ((X, Z), (0 : Fin 3 → ℝ)) ∈ K ↔ + (X : Mat 4 ℝ).PosSemidef ∧ (Z : Mat 4 ℝ).PosSemidef) : + Nonempty (RawBlockPencil K) := by + classical + let A := pencilFirst C 1 + have hfirst := (pencil_components_positive K C hrep hzero).1 + have hA : (A : Mat m ℝ).PosSemidef := hfirst 1 Matrix.PosSemidef.one + obtain ⟨S⟩ := pencilSpectralSplit_exists A hA + (pencil_first_identity_ne_zero K C hrep hzero) + (pencil_first_identity_not_posDef K C hrep hzero) + let U : Mat m ℝ := (sym_isHermitian A).eigenvectorUnitary + have hU : IsUnit U := Unitary.isUnit_coe (U := (sym_isHermitian A).eigenvectorUnitary) + let L := conjugatePencil C U + have hrepL : K = {x | (L x : Mat m ℝ).PosSemidef} := by + ext x + rw [hrep] + exact (conjugatePencil_posSemidef_iff C U hU x).symm + have hpos := pencil_components_positive K L hrepL hzero + have hrow (X : Sym 4) (i : Fin S.c) (j : Fin m) : + (pencilFirst L X : Mat m ℝ) (S.index (Sum.inr i)) j = 0 := by + exact spectral_conjugate_zero_row A (pencilFirst C X) hA + (positiveLinearMap_common_kernel (pencilFirst C) hfirst X) + _ (S.nonpositive i) j + let f := S.index ∘ Sum.inl + let g := S.index ∘ Sum.inr + have hf : Function.Injective f := S.index.injective.comp Sum.inl_injective + have hg : Function.Injective g := S.index.injective.comp Sum.inr_injective + have hD : ((pencilFirst L 1 : Mat m ℝ).submatrix f f).PosDef := by + change ((Uᴴ * (A : Mat m ℝ) * U).submatrix f f).PosDef + rw [spectral_conjugate_diagonal A, Matrix.submatrix_diagonal _ f hf] + exact Matrix.PosDef.diagonal S.positive + have hbase : (L basePoint : Mat m ℝ).PosDef := conjugatePencil_posDef C U hU basePoint hC + have hE : ((pencilSecond L 1 : Mat m ℝ).submatrix g g).PosDef := by + have heq : (L basePoint : Mat m ℝ).submatrix g g = + (pencilSecond L 1 : Mat m ℝ).submatrix g g := by + ext i j + change (L (((1, 1), 0) : Ambient) : Mat m ℝ) (g i) (g j) = _ + rw [pencil_decomposition] + change (pencilFirst L 1 : Mat m ℝ) (g i) (g j) + + (pencilSecond L 1 : Mat m ℝ) (g i) (g j) + + (pencilParameter L 0 : Mat m ℝ) (g i) (g j) = _ + rw [map_zero] + change (pencilFirst L 1 : Mat m ℝ) (S.index (Sum.inr i)) (g j) + + (pencilSecond L 1 : Mat m ℝ) (g i) (g j) + 0 = + (pencilSecond L 1 : Mat m ℝ) (g i) (g j) + rw [hrow, zero_add, add_zero] + rw [← heq] + exact hbase.submatrix hg + exact rawBlockPencil_of_partition K L S.a_pos S.c_pos S.index hrepL + hpos.1 hpos.2 hrow hD hE + +theorem blockPencil_exists (K : Set Ambient) (m : ℕ) (_hm : 0 < m) + (C : Ambient →ₗ[ℝ] Sym m) (hC : (C basePoint : Mat m ℝ).PosDef) + (hrep : K = {x | (C x : Mat m ℝ).PosSemidef}) + (hzero : ∀ X Z : Sym 4, ((X, Z), (0 : Fin 3 → ℝ)) ∈ K ↔ + (X : Mat 4 ℝ).PosSemidef ∧ (Z : Mat 4 ℝ).PosSemidef) : + Nonempty (BlockPencil K) := by + obtain ⟨P⟩ := rawBlockPencil_exists K C hC hrep hzero + exact ⟨P.normalize⟩ + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PencilTopology.lean b/lean/OAI/Analysis/HyperbolicCones/PencilTopology.lean new file mode 100644 index 0000000000000000000000000000000000000000..86decca33f067b4d2677e3073c72b1631e662dcb --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PencilTopology.lean @@ -0,0 +1,46 @@ +import OAI.Analysis.HyperbolicCones.PencilOrder + +namespace OAI + +noncomputable section + +open Set Filter Matrix +open scoped Topology Matrix.Norms.L2Operator MatrixOrder + +universe u + +namespace Paper256 + +def quadraticEvaluation {n : ℕ} (v : Fin n → ℝ) : Sym n →ₗ[ℝ] ℝ where + toFun X := v ⬝ᵥ ((X : Mat n ℝ) *ᵥ v) + map_add' X Y := by simp [add_mulVec, dotProduct_add] + map_smul' c X := by simp [smul_mulVec, dotProduct_smul] + +theorem isClosed_posSemidef (n : ℕ) : IsClosed {X : Sym n | (X : Mat n ℝ).PosSemidef} := by + have heq : {X : Sym n | (X : Mat n ℝ).PosSemidef} = + ⋂ v : Fin n → ℝ, {X | 0 ≤ quadraticEvaluation v X} := by + ext X + simp only [mem_iInter, mem_ofPred_eq] + constructor + · intro h v + simpa only [quadraticEvaluation, LinearMap.coe_mk, AddHom.coe_mk, star_trivial] + using h.dotProduct_mulVec_nonneg v + · intro h + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg X.property + intro v + simpa only [quadraticEvaluation, LinearMap.coe_mk, AddHom.coe_mk, star_trivial] + using h v + rw [heq] + exact isClosed_iInter fun v => isClosed_le continuous_const + (quadraticEvaluation v).continuous_of_finiteDimensional + +theorem posSemidef_of_tendsto {α : Type u} {f : Filter α} [f.NeBot] {n : ℕ} + {A : α → Sym n} {H : Sym n} (hA : Tendsto A f (𝓝 H)) + (h : ∀ᶠ x in f, (A x : Mat n ℝ).PosSemidef) : (H : Mat n ℝ).PosSemidef := + (isClosed_posSemidef n).mem_of_tendsto hA h + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PolynomialBasic.lean b/lean/OAI/Analysis/HyperbolicCones/PolynomialBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..f42dc58a4324a9befd2a8da29c0accd757783f79 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PolynomialBasic.lean @@ -0,0 +1,31 @@ +import OAI.Analysis.HyperbolicCones.PolynomialHomogeneous +import OAI.Analysis.HyperbolicCones.PolynomialEvaluation +import OAI.Analysis.HyperbolicCones.MatrixBasic + +namespace OAI + +noncomputable section + +open Matrix MvPolynomial +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +theorem polynomial_basePoint : MvPolynomial.eval (coordinates basePoint) polynomial = 1 := by + change MvPolynomial.eval (coordinates (((1 : Sym 4), 1), 0)) polynomial = 1 + rw [polynomial_evaluation] + simp [matrixValue, phi_zero_parameter] + +theorem polynomial_ne_zero : polynomial ≠ 0 := by + intro h + have hp := polynomial_basePoint + simp [h] at hp + +theorem polynomial_totalDegree : polynomial.totalDegree = 20 := + polynomial_homogeneous.totalDegree polynomial_ne_zero + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PolynomialEvaluation.lean b/lean/OAI/Analysis/HyperbolicCones/PolynomialEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..0ba9c6583248a38558b34bbb67f68ef64e448e32 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PolynomialEvaluation.lean @@ -0,0 +1,69 @@ +import OAI.Analysis.HyperbolicCones.Coordinates + +namespace OAI + +noncomputable section + +open Matrix MvPolynomial +open scoped BigOperators Matrix.Norms.L2Operator + +universe u v + +namespace Paper256 + +theorem qMatrix_map {R : Type u} {S : Type v} [CommRing R] [CommRing S] + (f : R →+* S) (y : Fin 3 → R) : + (qMatrix y).map f = qMatrix (fun i => f (y i)) := by + ext i j + by_cases h : i = j <;> simp [qMatrix, h] + +theorem phi_map {R : Type u} {S : Type v} [CommRing R] [CommRing S] + (f : R →+* S) (y : Fin 3 → R) (X : Mat 4 R) : + (phi y X).map f = phi (fun i => f (y i)) (X.map f) := by + ext i j + have hq (a b : Fin 3) : f (qMatrix y a b) = qMatrix (fun k => f (y k)) a b := + congrFun (congrFun (qMatrix_map f y) a) b + refine Fin.cases ?_ (fun i => ?_) i + · refine Fin.cases ?_ (fun j => ?_) j + · simp [phi, Matrix.trace, Matrix.diag, Matrix.mul_apply, hq] + · simp [phi, hq] + · refine Fin.cases ?_ (fun j => ?_) j + · simp [phi, hq] + · simp [phi, hq] + +theorem matrixValue_map {R : Type u} {S : Type v} [CommRing R] [CommRing S] + (f : R →+* S) (X Z : Mat 4 R) (y : Fin 3 → R) : + f (matrixValue X Z y) = matrixValue (X.map f) (Z.map f) (fun i => f (y i)) := by + unfold matrixValue + rw [f.map_det] + congr 1 + have hp := phi_map f y X.adjugate + have ha : X.adjugate.map f = (X.map f).adjugate := f.map_adjugate X + rw [ha] at hp + ext i j + have hp' := congrFun (congrFun hp i) j + simpa [Matrix.map_apply, Matrix.smul_apply, smul_eq_mul, f.map_det] using + congrArg (fun z => f X.det * f (Z i j) - z) hp' + +theorem symmetricCoordinates_map {R : Type u} {S : Type v} (f : R → S) (v : SymIndex → R) : + (symmetricCoordinates v).map f = symmetricCoordinates (fun i => f (v i)) := by + ext i j + by_cases h : i ≤ j <;> simp [symmetricCoordinates, h] + +theorem symmetricCoordinates_entries (X : Sym 4) : + symmetricCoordinates (fun ij => (X : Mat 4 ℝ) ij.val.1 ij.val.2) = (X : Mat 4 ℝ) := by + exact congrArg Subtype.val (symmetricCoordinateEquiv.left_inv X) + +theorem polynomial_evaluation (X Z : Sym 4) (y : Fin 3 → ℝ) : + MvPolynomial.eval (coordinates ((X, Z), y)) polynomial = + matrixValue (X : Mat 4 ℝ) (Z : Mat 4 ℝ) y := by + let f := MvPolynomial.eval₂Hom (RingHom.id ℝ) (coordinates ((X, Z), y)) + change f (matrixValue _ _ _) = _ + rw [matrixValue_map, symmetricCoordinates_map, symmetricCoordinates_map] + simp [f, coordinates, symmetricCoordinates_entries] + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PolynomialHomogeneous.lean b/lean/OAI/Analysis/HyperbolicCones/PolynomialHomogeneous.lean new file mode 100644 index 0000000000000000000000000000000000000000..d27a316b52d86e90fea0ae5e7e926ab2e5c3c8a5 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PolynomialHomogeneous.lean @@ -0,0 +1,109 @@ +import OAI.Analysis.HyperbolicCones.Model + +namespace OAI + +noncomputable section + +open Matrix MvPolynomial +open scoped BigOperators + +universe u v + +namespace Paper256 + +theorem determinant_homogeneous {ι : Type u} {σ : Type v} [Fintype ι] [DecidableEq ι] + (M : Matrix ι ι (MvPolynomial σ ℝ)) (d : ℕ) + (hM : ∀ i j, (M i j).IsHomogeneous d) : + M.det.IsHomogeneous (Fintype.card ι * d) := by + classical + rw [Matrix.det_apply'] + apply IsHomogeneous.sum + intro p _ + have hp : (∏ i, M (p i) i).IsHomogeneous (Fintype.card ι * d) := by + simpa using IsHomogeneous.prod Finset.univ (fun i => M (p i) i) + (fun _ => d) (fun i _ => hM (p i) i) + simpa using hp.C_mul ((Equiv.Perm.sign p : ℤ) : ℝ) + +theorem adjugate_homogeneous {σ : Type u} {n : ℕ} + (M : Mat (n + 1) (MvPolynomial σ ℝ)) (d : ℕ) + (hM : ∀ i j, (M i j).IsHomogeneous d) (i j : Fin (n + 1)) : + (M.adjugate i j).IsHomogeneous (n * d) := by + classical + rw [Matrix.adjugate_fin_succ_eq_det_submatrix] + have hc : ((-1 : MvPolynomial σ ℝ) ^ (j.val + i.val)).IsHomogeneous 0 := by + simpa using (isHomogeneous_one (σ := σ) (R := ℝ)).neg.pow (j.val + i.val) + have hm := determinant_homogeneous (M.submatrix j.succAbove i.succAbove) d + (fun a b => hM (j.succAbove a) (i.succAbove b)) + simpa using hc.mul hm + +theorem qMatrix_homogeneous {σ : Type u} (y : Fin 3 → MvPolynomial σ ℝ) + (hy : ∀ i, (y i).IsHomogeneous 1) (i j : Fin 3) : + (qMatrix y i j).IsHomogeneous 2 := by + classical + by_cases h : i = j + · simpa [qMatrix, h] using ((hy i).pow 2).add ((hy (i + 1)).pow 2) + · simpa [qMatrix, h] using ((hy i).mul (hy j)).neg + +theorem phi_homogeneous {σ : Type u} (y : Fin 3 → MvPolynomial σ ℝ) + (M : Mat 4 (MvPolynomial σ ℝ)) + (hy : ∀ i, (y i).IsHomogeneous 1) + (hM : ∀ i j, (M i j).IsHomogeneous 3) (i j : Fin 4) : + (phi y M i j).IsHomogeneous 5 := by + classical + have hq := qMatrix_homogeneous y hy + refine Fin.cases ?_ (fun i => ?_) i + · refine Fin.cases ?_ (fun j => ?_) j + · simp only [phi, Fin.cases_zero, Matrix.trace, Matrix.diag, Matrix.mul_apply, + Matrix.submatrix_apply] + apply IsHomogeneous.sum + intro a _ + apply IsHomogeneous.sum + intro b _ + exact (hq a b).mul (hM b.succ a.succ) + · simp only [phi, Fin.cases_zero, Fin.cases_succ] + apply IsHomogeneous.neg + apply IsHomogeneous.sum + intro a _ + exact (hM 0 a.succ).mul (hq a j) + · refine Fin.cases ?_ (fun j => ?_) j + · simp only [phi, Fin.cases_succ, Fin.cases_zero] + apply IsHomogeneous.neg + apply IsHomogeneous.sum + intro a _ + exact (hq i a).mul (hM a.succ 0) + · simp only [phi, Fin.cases_succ] + exact (hM 0 0).mul (hq i j) + +theorem polynomial_homogeneous : polynomial.IsHomogeneous 20 := by + classical + let X : Mat 4 (MvPolynomial Coord ℝ) := + symmetricCoordinates fun ij => MvPolynomial.X (Sum.inl (Sum.inl ij)) + let Z : Mat 4 (MvPolynomial Coord ℝ) := + symmetricCoordinates fun ij => MvPolynomial.X (Sum.inl (Sum.inr ij)) + let y : Fin 3 → MvPolynomial Coord ℝ := fun i => MvPolynomial.X (Sum.inr i) + have hX : ∀ i j, (X i j).IsHomogeneous 1 := by + intro i j + dsimp [X, symmetricCoordinates] + split <;> exact isHomogeneous_X _ _ + have hZ : ∀ i j, (Z i j).IsHomogeneous 1 := by + intro i j + dsimp [Z, symmetricCoordinates] + split <;> exact isHomogeneous_X _ _ + have hy : ∀ i, (y i).IsHomogeneous 1 := fun i => isHomogeneous_X _ _ + have hd : X.det.IsHomogeneous 4 := by + simpa using determinant_homogeneous X 1 hX + have ha : ∀ i j, (X.adjugate i j).IsHomogeneous 3 := by + intro i j + simpa using adjugate_homogeneous X 1 hX i j + have hp := phi_homogeneous y X.adjugate hy ha + have hm : ∀ i j, (((X.det) • Z - phi y X.adjugate) i j).IsHomogeneous 5 := by + intro i j + exact (hd.mul (hZ i j)).sub (hp i j) + simpa [polynomial, matrixValue, X, Z, y] using + determinant_homogeneous ((X.det) • Z - phi y X.adjugate) 5 hm + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PolynomialScaling.lean b/lean/OAI/Analysis/HyperbolicCones/PolynomialScaling.lean new file mode 100644 index 0000000000000000000000000000000000000000..3bf45eae6bbe86c2c1c417050a4d295c3620f4b4 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PolynomialScaling.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.HyperbolicCones.PolynomialBasic + +namespace OAI + +noncomputable section + +open scoped BigOperators + +universe u + +namespace Paper256 + +theorem homogeneous_eval_smul {σ : Type u} [Fintype σ] + (p : MvPolynomial σ ℝ) (d : ℕ) (hp : p.IsHomogeneous d) + (s : ℝ) (v : σ → ℝ) : + MvPolynomial.eval (s • v) p = s ^ d * MvPolynomial.eval v p := by + classical + rw [MvPolynomial.eval_eq', MvPolynomial.eval_eq', Finset.mul_sum] + apply Finset.sum_congr rfl + intro a ha + have hd : a.degree = d := by + simpa only [Finsupp.degree_eq_weight_one, Pi.one_def] using + hp (MvPolynomial.mem_support_iff.mp ha) + simp only [Pi.smul_apply, smul_eq_mul, mul_pow, Finset.prod_mul_distrib, + Finset.prod_pow_eq_pow_sum] + rw [← Finsupp.degree_eq_sum, hd] + ring + +theorem coordinates_smul (s : ℝ) (x : Ambient) : + coordinates (s • x) = s • coordinates x := by + funext i + rcases i with (i | i) | i <;> rfl + +theorem coordinates_sub (x z : Ambient) : + coordinates (x - z) = coordinates x - coordinates z := by + funext i + rcases i with (i | i) | i <;> rfl + +theorem polynomial_eval_smul (s : ℝ) (x : Ambient) : + MvPolynomial.eval (coordinates (s • x)) polynomial = + s ^ 20 * MvPolynomial.eval (coordinates x) polynomial := by + rw [coordinates_smul] + exact homogeneous_eval_smul polynomial 20 polynomial_homogeneous s (coordinates x) + +theorem polynomial_eval_neg (x : Ambient) : + MvPolynomial.eval (coordinates (-x)) polynomial = + MvPolynomial.eval (coordinates x) polynomial := by + have h := polynomial_eval_smul (-1) x + norm_num at h + exact h + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PositiveCore.lean b/lean/OAI/Analysis/HyperbolicCones/PositiveCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8726f11b0de25c3efab0860e2986c095332ae2d --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PositiveCore.lean @@ -0,0 +1,43 @@ +import OAI.Analysis.HyperbolicCones.ConeRoots +import OAI.Analysis.HyperbolicCones.ResidualOrder +import OAI.Analysis.HyperbolicCones.ResidualBound +import OAI.Analysis.HyperbolicCones.ShiftValue +import OAI.Analysis.HyperbolicCones.PositivePath + +namespace OAI + +noncomputable section + +open Set Filter Matrix +open scoped Topology Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +theorem cone_positive_slice_of_inverse_order (X Z : Sym 4) (y : Fin 3 → ℝ) + (hX : (X : Mat 4 ℝ).PosDef) + (hOrder : ∀ t : ℝ, 0 ≤ t → + ((X : Mat 4 ℝ)⁻¹ - ((X + t • 1 : Sym 4) : Mat 4 ℝ)⁻¹).PosSemidef) : + ((X, Z), y) ∈ cone ↔ (coneResidual X Z y 0 : Mat 4 ℝ).PosSemidef := by + rw [cone_iff_no_positive_shift] + constructor + · intro h + apply posSemidef_of_nonsingular_path (coneResidual X Z y) + (continuousOn_coneResidual X Z y hX) + (continuousAt_coneResidual X Z y 0 (by simpa using hX)) + · intro t ht + rw [Matrix.isUnit_iff_isUnit_det, isUnit_iff_ne_zero] + intro hz + apply h t ht + rw [polynomial_shift_inverse X Z y t (positive_shift X hX t ht.le), hz, mul_zero] + · exact coneResidual_exists_posDef X Z y hOrder + · intro h0 t ht + have hXt := positive_shift X hX t ht.le + have hFt := coneResidual_posDef X Z y t ht h0 (hOrder t ht.le) + rw [polynomial_shift_inverse X Z y t hXt] + exact mul_ne_zero (pow_ne_zero _ (ne_of_gt hXt.det_pos)) (ne_of_gt hFt.det_pos) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PositiveMaps.lean b/lean/OAI/Analysis/HyperbolicCones/PositiveMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..c0992608f357bfbe22e07950882fa73c6e94ccf3 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PositiveMaps.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.HyperbolicCones.PencilKernel +import OAI.Analysis.HyperbolicCones.PencilTopology + +namespace OAI + +noncomputable section + +open Set Matrix +open scoped Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +theorem positiveLinearMap_monotone {m n : ℕ} (D : Sym m →ₗ[ℝ] Sym n) + (hD : ∀ X : Sym m, (X : Mat m ℝ).PosSemidef → (D X : Mat n ℝ).PosSemidef) + (X Y : Sym m) (hXY : (X : Mat m ℝ) ≤ (Y : Mat m ℝ)) : + (D X : Mat n ℝ) ≤ (D Y : Mat n ℝ) := by + have h := hD (Y - X) hXY + change ((D Y : Mat n ℝ) - (D X : Mat n ℝ)).PosSemidef + simpa using h + +theorem positive_unital_map_posDef {m n : ℕ} (D : Sym m →ₗ[ℝ] Sym n) + (hD : ∀ X : Sym m, (X : Mat m ℝ).PosSemidef → (D X : Mat n ℝ).PosSemidef) + (hI : D 1 = 1) (X : Sym m) (hX : (X : Mat m ℝ).PosDef) : + (D X : Mat n ℝ).PosDef := by + obtain ⟨c, hc, hcX⟩ := posDef_scalar_lower_bound (X : Mat m ℝ) hX + apply posDef_of_scalar_lower_bound hc + have h := positiveLinearMap_monotone D hD (c • 1) X hcX + simpa [hI] using h + +theorem positiveLinearMap_common_kernel {m n : ℕ} (D : Sym m →ₗ[ℝ] Sym n) + (hD : ∀ X : Sym m, (X : Mat m ℝ).PosSemidef → (D X : Mat n ℝ).PosSemidef) + (X : Sym m) (v : Fin n → ℝ) (hv : (D 1 : Mat n ℝ) *ᵥ v = 0) : + (D X : Mat n ℝ) *ᵥ v = 0 := by + have hI : (1 : Sym m) ∈ interior {Y : Sym m | (Y : Mat m ℝ).PosDef} := by + rw [(isOpen_posDef m).interior_eq] + exact Matrix.PosDef.one + obtain ⟨ε, hε, hp, hm⟩ := interior_line_pair hI X + have hp' := hD (1 + ε • X) hp.posSemidef + have hm' := hD (1 - ε • X) hm.posSemidef + have hz : (ε • (D X : Mat n ℝ)) *ᵥ v = 0 := by + apply posSemidef_pair_kernel (A := (D 1 : Mat n ℝ)) _ _ v hv + · simpa using hp' + · simpa using hm' + rw [smul_mulVec] at hz + exact (smul_eq_zero.mp hz).resolve_left hε.ne' + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/PositivePath.lean b/lean/OAI/Analysis/HyperbolicCones/PositivePath.lean new file mode 100644 index 0000000000000000000000000000000000000000..92a965bacdef3277fe9a87eec902dde9eec9cc16 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/PositivePath.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.HyperbolicCones.PencilTopology + +namespace OAI + +noncomputable section + +open Set Filter Matrix +open scoped Topology Matrix.Norms.L2Operator + +namespace Paper256 + +/-- A continuous symmetric matrix path with no singularities at positive times +cannot change from indefinite to positive definite. -/ +theorem posSemidef_of_nonsingular_path {n : ℕ} (F : ℝ → Sym n) + (hF : ContinuousOn F (Ici 0)) (hF0 : ContinuousAt F 0) + (hunit : ∀ t : ℝ, 0 < t → IsUnit (F t : Mat n ℝ)) + (hpos : ∃ t : ℝ, 0 < t ∧ (F t : Mat n ℝ).PosDef) : + (F 0 : Mat n ℝ).PosSemidef := by + let : PreconnectedSpace (Ioi (0 : ℝ)) := + Subtype.preconnectedSpace isPreconnected_Ioi + have hc : Continuous (fun t : Ioi (0 : ℝ) => F t) := + continuousOn_iff_continuous_domRestrict.mp (hF.mono Ioi_subset_Ici_self) + let S : Set (Ioi (0 : ℝ)) := {t | (F t : Mat n ℝ).PosSemidef} + have hclosed : IsClosed S := (isClosed_posSemidef n).preimage hc + have heq : S = {t : Ioi (0 : ℝ) | (F t : Mat n ℝ).PosDef} := by + ext t + constructor + · intro ht + exact ht.posDef_iff_isUnit.mpr (hunit t t.property) + · exact fun ht => ht.posSemidef + have hopen : IsOpen S := by + rw [heq] + exact (isOpen_posDef n).preimage hc + have hSne : S.Nonempty := by + obtain ⟨t, ht, hFt⟩ := hpos + exact ⟨⟨t, ht⟩, hFt.posSemidef⟩ + have hSuniv : S = univ := (show IsClopen S from ⟨hclosed, hopen⟩).eq_univ hSne + have hall : ∀ t : ℝ, 0 < t → (F t : Mat n ℝ).PosSemidef := by + intro t ht + have hm : (⟨t, ht⟩ : Ioi (0 : ℝ)) ∈ S := by rw [hSuniv]; trivial + exact hm + apply posSemidef_of_tendsto (f := 𝓝[Ioi (0 : ℝ)] 0) + (hF0.tendsto.mono_left nhdsWithin_le_nhds) + filter_upwards [self_mem_nhdsWithin] with t ht + exact hall t ht + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/QuadraticDeformation.lean b/lean/OAI/Analysis/HyperbolicCones/QuadraticDeformation.lean new file mode 100644 index 0000000000000000000000000000000000000000..53127e2b141d3a9fdb3888a217cb72ec10cd5986 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/QuadraticDeformation.lean @@ -0,0 +1,89 @@ +import OAI.Analysis.HyperbolicCones.DeformationCone +import OAI.Analysis.HyperbolicCones.DeformationFamily + +namespace OAI + +noncomputable section + +open Set Polynomial + +namespace Paper256 + +theorem intervalPolynomial_coeff_zero (a b : ℝ) : + (intervalPolynomial a b).coeff 0 = 1 := by + simp [intervalPolynomial] + +theorem intervalPolynomial_coeff_two_neg (a b : ℝ) (ha : 0 < a) (hb : 0 < b) : + (intervalPolynomial a b).coeff 2 < 0 := by + rw [intervalPolynomial_coeff_two] + exact neg_neg_of_pos (mul_pos (inv_pos.mpr ha) (inv_pos.mpr hb)) + +theorem normalized_quadratic_iff (p : Polynomial ℝ) : + (p.natDegree = 2 ∧ p.coeff 0 = 1 ∧ p.coeff 2 < 0) ↔ + ∃ a b : ℝ, 0 < a ∧ 0 < b ∧ p = intervalPolynomial a b := by + constructor + · rintro ⟨hd, hz, hl⟩ + exact normalized_quadratic_representation p hd hz hl + · rintro ⟨a, b, ha, hb, rfl⟩ + exact ⟨intervalPolynomial_natDegree a b ha hb, intervalPolynomial_coeff_zero a b, + intervalPolynomial_coeff_two_neg a b ha hb⟩ + +theorem deformedPencil_isSymm (a b η t x : ℝ) : + (deformedPencil a b η t x).IsSymm := + Matrix.isSymm_diagonal _ + +theorem intervalPolynomial_root_set (a b : ℝ) (ha : 0 < a) (hb : 0 < b) : + {x : ℝ | (intervalPolynomial a b).IsRoot x} = {-b, a} := by + ext x + change (intervalPolynomial a b).IsRoot x ↔ x = -b ∨ x = a + exact intervalPolynomial_isRoot_iff a b x ha.ne' hb.ne' + +theorem intervalPolynomial_roots_compact (a b : ℝ) (ha : 0 < a) (hb : 0 < b) : + IsCompact {x : ℝ | (intervalPolynomial a b).IsRoot x} := by + rw [intervalPolynomial_root_set a b ha hb] + exact (Set.toFinite _).isCompact + +theorem deformedPolynomial_roots_ordered (a b η t : ℝ) + (ha : 0 < a) (hb : 0 < b) (hη : 0 < η) : + -b / timeScale η t < a / timeScale η t := + (div_lt_div_iff_of_pos_right (timeScale_positive η t hη)).mpr (by linarith) + +theorem intervalPolynomial_tangent_product (a b x : ℝ) : + (1 + x / b) * (1 - x / a) = (intervalPolynomial a b).eval x := by + rw [intervalPolynomial_eval, mul_comm] + +theorem normalized_affine_tangent (m r x : ℝ) (hm : m ≠ 0) (hr : r ≠ 0) : + m * (x - r) / (m * -r) = 1 - x / r := by + field_simp + ring + +theorem intervalPolynomial_tangent_negative (a b x : ℝ) (ha : 0 < a) (hb : 0 < b) : + ((intervalPolynomial a b).derivative.eval (-b) * (x - -b)) / + ((intervalPolynomial a b).derivative.eval (-b) * b) = 1 + x / b := by + have hm := intervalPolynomial_roots_simple a b (-b) ha hb + ((intervalPolynomial_isRoot_iff a b (-b) ha.ne' hb.ne').mpr (Or.inl rfl)) + simpa [div_neg] using normalized_affine_tangent + ((intervalPolynomial a b).derivative.eval (-b)) (-b) x hm (neg_ne_zero.mpr hb.ne') + +theorem intervalPolynomial_tangent_positive (a b x : ℝ) (ha : 0 < a) (hb : 0 < b) : + ((intervalPolynomial a b).derivative.eval a * (x - a)) / + ((intervalPolynomial a b).derivative.eval a * -a) = 1 - x / a := by + have hm := intervalPolynomial_roots_simple a b a ha hb + ((intervalPolynomial_isRoot_iff a b a ha.ne' hb.ne').mpr (Or.inr rfl)) + exact normalized_affine_tangent ((intervalPolynomial a b).derivative.eval a) a x hm ha.ne' + +theorem deformedPolynomial_not_contains (a b η t : ℝ) + (ha : 0 < a) (hb : 0 < b) (hη : 0 < η) (ht : t ∈ Ioo (0 : ℝ) 1) : + ¬ rigidlyConvexSet (intervalPolynomial a b) ⊆ + rigidlyConvexSet (deformedPolynomial a b η t) := + (deformedPolynomial_strict_subset a b η t ha hb hη ht).not_subset + +theorem deformedPolynomial_endpoint_cofactor (a b η : ℝ) : + deformedPolynomial a b η 1 = 1 * intervalPolynomial a b := by + simpa using (deformedPolynomial_endpoints a b η).2 + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/RankInverse.lean b/lean/OAI/Analysis/HyperbolicCones/RankInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..0380d6177c9a57d41573c99ce486452debeb51b7 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/RankInverse.lean @@ -0,0 +1,55 @@ +import OAI.Analysis.HyperbolicCones.RankNorm +import OAI.Analysis.HyperbolicCones.KernelLimit + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +theorem rankOne_path_eq_affine {n : ℕ} (v : Vec n) (t : ℝ) : + outerSym v + t • (1 - outerSym v) = 1 + (t - 1) • (1 - outerSym v) := by + module + +theorem rankOne_path_inverse {n : ℕ} (v : Vec n) (hv : ‖v‖ = 1) + (t : ℝ) (ht : t ≠ 0) : + (outer v + t • (1 - outer v))⁻¹ = outer v + t⁻¹ • (1 - outer v) := by + apply Matrix.inv_eq_left_inv + have hp := outer_isStarProjection v hv + rw [add_mul, mul_add, mul_add, Matrix.mul_smul, Matrix.smul_mul, + Matrix.mul_smul, Matrix.smul_mul, smul_smul, + hp.isIdempotentElem, hp.mul_one_sub_self, hp.one_sub_mul_self, + hp.one_sub.isIdempotentElem] + simp [mul_inv_cancel₀ ht] + +theorem rankOne_path_inverseSquareRoot {n : ℕ} (v : Vec n) (hv : ‖v‖ = 1) + (t : ℝ) : + inverseSquareRoot (outerSym v + t • (1 - outerSym v)) = + outer v + (Real.sqrt t)⁻¹ • (1 - outer v) := by + rw [rankOne_path_eq_affine, inverseSquareRoot_affine_eq_cfc] + let H : Sym n := 1 - outerSym v + have hidem : IsIdempotentElem (H : Mat n ℝ) := + (outer_isStarProjection v hv).one_sub.isIdempotentElem + have hspec : spectrum ℝ (H : Mat n ℝ) ⊆ {0, 1} := + (isIdempotentElem_iff_spectrum_subset ℝ (H : Mat n ℝ) H.property).mp hidem + change cfc (fun x : ℝ => (Real.sqrt (1 + (t - 1) * x))⁻¹) (H : Mat n ℝ) = _ + calc + _ = cfc (fun x : ℝ => 1 + ((Real.sqrt t)⁻¹ - 1) * x) (H : Mat n ℝ) := by + apply cfc_congr + intro x hx + have hx' : x = 0 ∨ x = 1 := by simpa using hspec hx + rcases hx' with rfl | rfl <;> simp + _ = 1 • (1 : Mat n ℝ) + ((Real.sqrt t)⁻¹ - 1) • (H : Mat n ℝ) := + matrix_cfc_affine H 1 ((Real.sqrt t)⁻¹ - 1) + _ = outer v + (Real.sqrt t)⁻¹ • (1 - outer v) := by + dsimp [H, outerSym] + module + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/RankNorm.lean b/lean/OAI/Analysis/HyperbolicCones/RankNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..b44c7789a140fd770f92e4577ea142420823e46e --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/RankNorm.lean @@ -0,0 +1,85 @@ +import OAI.Analysis.HyperbolicCones.Model + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +theorem outer_toEuclideanCLM {n : ℕ} (v : Vec n) : + Matrix.toEuclideanCLM (𝕜 := ℝ) (n := Fin n) (outer v) = + InnerProductSpace.rankOne ℝ v v := by + have h : Matrix.toEuclideanLin.symm + (InnerProductSpace.rankOne ℝ v v).toLinearMap = outer v := by + rw [InnerProductSpace.symm_toEuclideanLin_rankOne] + ext i j + simp [outer, Matrix.vecMulVec_apply] + apply ContinuousLinearMap.ext + intro x + change Matrix.toEuclideanLin (outer v) x = _ + rw [← h, LinearEquiv.apply_symm_apply] + rfl + +theorem outer_mul_self {n : ℕ} (v : Vec n) (hv : ‖v‖ = 1) : + outer v * outer v = outer v := by + apply (Matrix.toEuclideanCLM (𝕜 := ℝ) (n := Fin n)).injective + change Matrix.toEuclideanCLM (𝕜 := ℝ) (outer v * outer v) = + Matrix.toEuclideanCLM (𝕜 := ℝ) (outer v) + rw [map_mul, outer_toEuclideanCLM] + exact InnerProductSpace.isIdempotentElem_rankOne_self hv + +theorem outer_isStarProjection {n : ℕ} (v : Vec n) (hv : ‖v‖ = 1) : + IsStarProjection (outer v) := ⟨outer_mul_self v hv, (outerSym v).property⟩ + +theorem one_sub_outer_posSemidef {n : ℕ} (v : Vec n) (hv : ‖v‖ = 1) : + (1 - outer v).PosSemidef := (outer_isStarProjection v hv).one_sub.nonneg.posSemidef + +theorem norm_outer_unit {n : ℕ} (v : Vec n) (hv : ‖v‖ = 1) : ‖outer v‖ = 1 := by + rw [Matrix.cstar_norm_def, outer_toEuclideanCLM, InnerProductSpace.norm_rankOne, hv, + mul_one] + +theorem kernelProjection_one_sub_of_isStarProjection {n : ℕ} (P : Mat n ℝ) + (hP : IsStarProjection P) : kernelProjection (1 - P) = P := by + let φ := Matrix.toEuclideanCLM (𝕜 := ℝ) (n := Fin n) + have hp : IsStarProjection (φ P) := hP.map φ + have hrange : (φ P).range = (φ (1 - P)).ker := by + rw [map_sub, map_one] + exact LinearMap.IsIdempotentElem.range_eq_ker_one_sub + (ContinuousLinearMap.IsIdempotentElem.toLinearMap hp.isIdempotentElem) + have hproj : φ P = (φ (1 - P)).ker.starProjection := by + apply (ContinuousLinearMap.IsStarProjection.ext_iff hp + (isStarProjection_starProjection (U := (φ (1 - P)).ker))).mpr + rw [Submodule.range_starProjection] + exact hrange + apply φ.injective + change φ (kernelProjection (1 - P)) = φ P + rw [hproj] + apply ContinuousLinearMap.ext + intro x + change Matrix.toEuclideanLin (kernelProjection (1 - P)) x = _ + rw [kernelProjection, LinearEquiv.apply_symm_apply] + rfl + +theorem kernelProjection_one_sub_outer {n : ℕ} (v : Vec n) (hv : ‖v‖ = 1) : + kernelProjection (1 - outer v) = outer v := + kernelProjection_one_sub_of_isStarProjection (outer v) (outer_isStarProjection v hv) + +theorem outer_mul_mul_outer {n : ℕ} (u : Vec n) (A : Mat n ℝ) : + outer u * A * outer u = + (dotProduct (fun i => u i) (A *ᵥ fun i => u i)) • outer u := by + change Matrix.vecMulVec (fun i => u i) (fun i => u i) * A * + Matrix.vecMulVec (fun i => u i) (fun i => u i) = _ + rw [Matrix.vecMulVec_mul, Matrix.vecMulVec_mul_vecMulVec] + ext i j + simp only [Matrix.vecMulVec_apply, Pi.smul_apply, Matrix.smul_apply, smul_eq_mul, + outer, Matrix.dotProduct_mulVec] + ring + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/RankQuadratics.lean b/lean/OAI/Analysis/HyperbolicCones/RankQuadratics.lean new file mode 100644 index 0000000000000000000000000000000000000000..a735fb66fadda0e4990de4fceb7c4f055ce681af --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/RankQuadratics.lean @@ -0,0 +1,43 @@ +import OAI.Analysis.HyperbolicCones.MatrixPositive +import OAI.Analysis.HyperbolicCones.PolynomialEvaluation + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +theorem phi_rank_one_quadratic (y : Fin 3 → ℝ) (u v : Vec 4) : + dotProduct (fun i => u i) (phi y (outer v) *ᵥ (fun i => u i)) = + dotProduct (wedgeCoordinates v u) (qMatrix y *ᵥ wedgeCoordinates v u) := by + rw [phi_rank_one, qMatrix_quadratic] + +theorem phi_rank_one_expansion (y : Fin 3 → ℝ) (u v : Vec 4) : + dotProduct (fun i => u i) (phi y (outer v) *ᵥ (fun i => u i)) = + v 0 ^ 2 * dotProduct (fun i : Fin 3 => u i.succ) + (qMatrix y *ᵥ fun i : Fin 3 => u i.succ) - + 2 * u 0 * v 0 * dotProduct (fun i : Fin 3 => u i.succ) + (qMatrix y *ᵥ fun i : Fin 3 => v i.succ) + + u 0 ^ 2 * dotProduct (fun i : Fin 3 => v i.succ) + (qMatrix y *ᵥ fun i : Fin 3 => v i.succ) := by + rw [phi_rank_one] + simp [dotProduct, mulVec, qMatrix, wedgeCoordinates, choiLam, Fin.sum_univ_succ] + ring + +theorem phi_imaginary (y : Fin 3 → ℝ) (A : Mat 4 ℂ) : + (phi (fun i => (y i : ℂ)) A).map Complex.im = phi y (A.map Complex.im) := by + have hq (i j : Fin 3) : qMatrix (fun k => (y k : ℂ)) i j = ((qMatrix y i j : ℝ) : ℂ) := + (congrFun (congrFun (qMatrix_map Complex.ofRealHom y) i) j).symm + ext i j + refine Fin.cases ?_ (fun i => ?_) i <;> + refine Fin.cases ?_ (fun j => ?_) j <;> + simp [phi, Matrix.trace, Matrix.diag, Matrix.mul_apply, hq, Complex.mul_im] + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/RawBlocks.lean b/lean/OAI/Analysis/HyperbolicCones/RawBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..08e66e58c5d03c330eeb314efdbbd8ac6a9217a3 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/RawBlocks.lean @@ -0,0 +1,38 @@ +import OAI.Analysis.HyperbolicCones.PencilBlocks + +namespace OAI + +noncomputable section + +open Set Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +/-- The finite blocks after splitting the support of the first positive pencil component. -/ +structure RawBlockPencil (K : Set Ambient) where + a : ℕ + c : ℕ + a_pos : 0 < a + c_pos : 0 < c + D : Sym 4 →ₗ[ℝ] Sym a + E : Sym 4 →ₗ[ℝ] Sym c + F : Sym 4 →ₗ[ℝ] Sym a + C : Sym 4 →ₗ[ℝ] Matrix (Fin a) (Fin c) ℝ + A : (Fin 3 → ℝ) →ₗ[ℝ] Sym a + B : (Fin 3 → ℝ) →ₗ[ℝ] Matrix (Fin a) (Fin c) ℝ + G : (Fin 3 → ℝ) →ₗ[ℝ] Sym c + D_positive : ∀ X : Sym 4, (X : Mat 4 ℝ).PosSemidef → (D X : Mat a ℝ).PosSemidef + E_positive : ∀ X : Sym 4, (X : Mat 4 ℝ).PosSemidef → (E X : Mat c ℝ).PosSemidef + D_identity_posDef : (D 1 : Mat a ℝ).PosDef + E_identity_posDef : (E 1 : Mat c ℝ).PosDef + represents : ∀ (X Z : Sym 4) (y : Fin 3 → ℝ), ((X, Z), y) ∈ K ↔ + (Matrix.fromBlocks ((D X : Mat a ℝ) + (F Z : Mat a ℝ) + (A y : Mat a ℝ)) + (C Z + B y) (C Z + B y)ᵀ ((E Z : Mat c ℝ) + (G y : Mat c ℝ))).PosSemidef + + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/RescalingBasic.lean b/lean/OAI/Analysis/HyperbolicCones/RescalingBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..c34cbb3223c8d9f63ee8d295e32ddcfbb8ddb001 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/RescalingBasic.lean @@ -0,0 +1,53 @@ +import OAI.Analysis.HyperbolicCones.MatrixLinear + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +theorem linear_coefficient_zero_of_quadratic_nonneg (a b : ℝ) + (h : ∀ s : ℝ, 0 ≤ a * s ^ 2 + b * s) : b = 0 := by + have ha : 0 ≤ a := by nlinarith [h 1, h (-1)] + rcases eq_or_lt_of_le ha with hzero | hpos + · have ht := h (-b) + rw [← hzero] at ht + nlinarith [sq_nonneg b] + · have ht := h (-b / (2 * a)) + have heq : a * (-b / (2 * a)) ^ 2 + b * (-b / (2 * a)) = + -b ^ 2 / (4 * a) := by + field_simp + ring + rw [heq] at ht + have hb := (le_div_iff₀ (by positivity : 0 < 4 * a)).mp ht + nlinarith [sq_nonneg b] + +theorem linear_term_zero_of_quadratic_posSemidef {n : ℕ} (E G : Sym n) + (h : ∀ s : ℝ, (s ^ 2 • (E : Mat n ℝ) + s • (G : Mat n ℝ)).PosSemidef) : + G = 0 := by + have hq (v : Fin n → ℝ) : v ⬝ᵥ ((G : Mat n ℝ) *ᵥ v) = 0 := by + apply linear_coefficient_zero_of_quadratic_nonneg (v ⬝ᵥ ((E : Mat n ℝ) *ᵥ v)) + intro s + have hs := (h s).dotProduct_mulVec_nonneg v + simpa only [star_trivial, add_mulVec, smul_mulVec, dotProduct_add, dotProduct_smul, + smul_eq_mul, mul_comm] using hs + have hg : (G : Mat n ℝ).PosSemidef := by + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg G.property + intro v + simpa only [star_trivial, hq] using (le_refl (0 : ℝ)) + have hneg : (-(G : Mat n ℝ)).PosSemidef := by + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg G.property.neg + intro v + simpa only [star_trivial, neg_mulVec, dotProduct_neg, hq, neg_zero] + using (le_refl (0 : ℝ)) + apply Subtype.ext + exact le_antisymm (neg_nonneg.mp hneg.nonneg) hg.nonneg + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ResidualBound.lean b/lean/OAI/Analysis/HyperbolicCones/ResidualBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e267fd17345e1ed9c3804835c44df5097d1c6ba --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ResidualBound.lean @@ -0,0 +1,41 @@ +import OAI.Analysis.HyperbolicCones.ResidualOrder +import OAI.Analysis.HyperbolicCones.PencilOrder + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +theorem posDef_of_shift_bound {n : ℕ} (H F : Sym n) (t : ℝ) + (hbound : (H : Mat n ℝ) + t • 1 ≤ (F : Mat n ℝ)) + (ht : ‖(H : Mat n ℝ)‖ < t) : (F : Mat n ℝ).PosDef := by + apply posDef_of_scalar_lower_bound (n := n) (X := (F : Mat n ℝ)) + (c := t - ‖(H : Mat n ℝ)‖) (sub_pos.mpr ht) + have hnorm : ((H : Mat n ℝ) - (-‖(H : Mat n ℝ)‖) • 1).PosSemidef := + sym_neg_norm_le H + have hdiff : ((F : Mat n ℝ) - ((H : Mat n ℝ) + t • 1)).PosSemidef := hbound + change ((F : Mat n ℝ) - (t - ‖(H : Mat n ℝ)‖) • 1).PosSemidef + convert Matrix.PosSemidef.add hdiff hnorm using 1 + module + +theorem coneResidual_exists_posDef (X Z : Sym 4) (y : Fin 3 → ℝ) + (hOrder : ∀ t : ℝ, 0 ≤ t → + ((X : Mat 4 ℝ)⁻¹ - ((X + t • 1 : Sym 4) : Mat 4 ℝ)⁻¹).PosSemidef) : + ∃ t : ℝ, 0 < t ∧ (coneResidual X Z y t : Mat 4 ℝ).PosDef := by + let m := ‖(coneResidual X Z y 0 : Mat 4 ℝ)‖ + have hm : 0 ≤ m := norm_nonneg _ + have ht : 0 < m + 1 := by linarith + refine ⟨m + 1, ht, ?_⟩ + apply posDef_of_shift_bound (coneResidual X Z y 0) (coneResidual X Z y (m + 1)) (m + 1) + (coneResidual_lower_bound X Z y (m + 1) (hOrder (m + 1) ht.le)) + exact lt_add_one m + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ResidualOrder.lean b/lean/OAI/Analysis/HyperbolicCones/ResidualOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7b3e76e020414362fda9ae50fcf57e1e76426a1 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ResidualOrder.lean @@ -0,0 +1,44 @@ +import OAI.Analysis.HyperbolicCones.ConeMatrix + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +theorem coneResidual_identity (X Z : Sym 4) (y : Fin 3 → ℝ) (t : ℝ) : + (coneResidual X Z y t : Mat 4 ℝ) = + (coneResidual X Z y 0 : Mat 4 ℝ) + t • 1 + + phi y ((X : Mat 4 ℝ)⁻¹ - ((X + t • 1 : Sym 4) : Mat 4 ℝ)⁻¹) := by + have hp := (phiLinear y).map_sub (X : Mat 4 ℝ)⁻¹ + ((X + t • 1 : Sym 4) : Mat 4 ℝ)⁻¹ + change phi y (_ - _) = phi y _ - phi y _ at hp + rw [hp] + change (Z : Mat 4 ℝ) + t • 1 - phi y ((X : Mat 4 ℝ) + t • 1)⁻¹ = + ((Z : Mat 4 ℝ) + (0 : ℝ) • 1 - phi y ((X : Mat 4 ℝ) + (0 : ℝ) • 1)⁻¹) + + t • 1 + (phi y (X : Mat 4 ℝ)⁻¹ - phi y ((X : Mat 4 ℝ) + t • 1)⁻¹) + simp only [zero_smul, add_zero] + module + +theorem coneResidual_lower_bound (X Z : Sym 4) (y : Fin 3 → ℝ) (t : ℝ) + (hInv : ((X : Mat 4 ℝ)⁻¹ - ((X + t • 1 : Sym 4) : Mat 4 ℝ)⁻¹).PosSemidef) : + (coneResidual X Z y 0 : Mat 4 ℝ) + t • 1 ≤ (coneResidual X Z y t : Mat 4 ℝ) := by + conv_rhs => rw [coneResidual_identity] + exact le_add_of_nonneg_right (phi_posSemidef y _ hInv).nonneg + +theorem coneResidual_posDef (X Z : Sym 4) (y : Fin 3 → ℝ) (t : ℝ) + (ht : 0 < t) (h0 : (coneResidual X Z y 0 : Mat 4 ℝ).PosSemidef) + (hInv : ((X : Mat 4 ℝ)⁻¹ - ((X + t • 1 : Sym 4) : Mat 4 ℝ)⁻¹).PosSemidef) : + (coneResidual X Z y t : Mat 4 ℝ).PosDef := by + rw [coneResidual_identity] + exact (Matrix.PosDef.posSemidef_add h0 (Matrix.PosDef.one.smul ht)).add_posSemidef + (phi_posSemidef y _ hInv) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ResolventFormula.lean b/lean/OAI/Analysis/HyperbolicCones/ResolventFormula.lean new file mode 100644 index 0000000000000000000000000000000000000000..a97141be547ab00b5257d7eb2c6b72ddcc2e9b2a --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ResolventFormula.lean @@ -0,0 +1,72 @@ +import OAI.Analysis.HyperbolicCones.ResolventImaginary + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace Paper256 + +theorem complex_resolvent_isSymm {n : ℕ} (X : Mat n ℝ) (hX : X.IsHermitian) + (z : ℂ) : ((z • (1 : Mat n ℂ) - X.map Complex.ofReal)⁻¹).IsSymm := by + have hXt : Xᵀ = X := by + simpa only [Matrix.conjTranspose_eq_transpose_of_trivial] using hX.eq + have hc : (X.map Complex.ofReal)ᵀ = X.map Complex.ofReal := by + ext i j + exact congrArg Complex.ofReal (congrFun (congrFun hXt i) j) + change ((z • (1 : Mat n ℂ) - X.map Complex.ofReal)⁻¹)ᵀ = _ + rw [Matrix.transpose_nonsing_inv] + congr 1 + simp [Matrix.transpose_sub, Matrix.transpose_smul, hc] + +theorem resolvent_inverse_gram {n : ℕ} (X : Mat n ℝ) (hX : X.IsHermitian) + (a η : ℝ) (hη : 0 < η) : + (((((a : ℂ) + (η : ℂ) * Complex.I) • (1 : Mat n ℂ) - X.map Complex.ofReal)⁻¹)ᴴ * + ((((a : ℂ) + (η : ℂ) * Complex.I) • (1 : Mat n ℂ) - X.map Complex.ofReal)⁻¹)) = + (((a • (1 : Mat n ℝ) - X) ^ 2 + η ^ 2 • 1)⁻¹).map Complex.ofReal := by + rw [Matrix.conjTranspose_nonsing_inv, ← Matrix.mul_inv_rev, + resolvent_mul_adjoint X hX a η] + exact complexify_nonsing_inv _ (resolvent_denominator_posDef X hX a η hη).isUnit + +theorem resolvent_imaginary_formula {n : ℕ} (X : Mat n ℝ) (hX : X.IsHermitian) + (a η : ℝ) (hη : 0 < η) : + (((((a : ℂ) + (η : ℂ) * Complex.I) • (1 : Mat n ℂ) - X.map Complex.ofReal)⁻¹).map + Complex.im) = -(η : ℝ) • (((a • (1 : Mat n ℝ) - X) ^ 2 + η ^ 2 • 1)⁻¹) := by + let z : ℂ := (a : ℂ) + (η : ℂ) * Complex.I + let R := (z • (1 : Mat n ℂ) - X.map Complex.ofReal)⁻¹ + have hz : z.im ≠ 0 := by simpa [z] using ne_of_gt hη + have hd := resolvent_adjoint_difference (X.map Complex.ofReal) + (isHermitian_complexify X hX) z + ((Matrix.isUnit_iff_isUnit_det _).mp (complex_resolvent_isUnit X hX z hz)) + have hg := resolvent_inverse_gram X hX a η hη + change Rᴴ * R = _ at hg + change R - Rᴴ = -(z - star z) • (Rᴴ * R) at hd + rw [hg] at hd + have hs : R.IsSymm := complex_resolvent_isSymm X hX z + ext i j + have hsij : R j i = R i j := congrFun (congrFun hs i) j + have hij := congrArg Complex.im (congrFun (congrFun hd i) j) + simp only [Matrix.sub_apply, Matrix.conjTranspose_apply, Matrix.smul_apply, + smul_eq_mul, Matrix.map_apply, hsij, Complex.sub_im, Complex.star_def, + Complex.conj_im, Complex.mul_im, Complex.neg_re, Complex.neg_im, + Complex.sub_re, Complex.conj_re, Complex.ofReal_re, Complex.ofReal_im] at hij + change (R i j).im = -η * _ + simp only [z, Complex.add_im, Complex.ofReal_im, Complex.mul_im, + Complex.ofReal_re, Complex.I_im, Complex.I_re, mul_one, mul_zero, + zero_add, add_zero] at hij + linarith + +theorem resolvent_negative_imaginary_posDef {n : ℕ} (X : Mat n ℝ) + (hX : X.IsHermitian) (a η : ℝ) (hη : 0 < η) : + (-(((((a : ℂ) + (η : ℂ) * Complex.I) • (1 : Mat n ℂ) - X.map Complex.ofReal)⁻¹).map + Complex.im)).PosDef := by + rw [resolvent_imaginary_formula X hX a η hη, neg_smul, neg_neg] + exact (resolvent_denominator_posDef X hX a η hη).inv.smul hη + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ResolventImaginary.lean b/lean/OAI/Analysis/HyperbolicCones/ResolventImaginary.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e17482c69c181d9682eac77c4d9c8705603b5d5 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ResolventImaginary.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.HyperbolicCones.MatrixResolvent + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace Paper256 + +theorem complex_symmetric_imaginary {n : ℕ} (A : Mat n ℂ) (hA : A.IsSymm) : + (A.map Complex.im).map Complex.ofReal = (2 * Complex.I)⁻¹ • (A - Aᴴ) := by + ext i j + have h := congrFun (congrFun hA i) j + change A j i = A i j at h + simp only [Matrix.map_apply, Matrix.smul_apply, smul_eq_mul, + Matrix.sub_apply, Matrix.conjTranspose_apply, h] + apply Complex.ext <;> simp [Complex.mul_re, Complex.mul_im, Complex.inv_re, + Complex.inv_im, Complex.normSq] + ring + +theorem complex_symmetric_imaginary_isSymm {n : ℕ} (A : Mat n ℂ) (hA : A.IsSymm) : + (A.map Complex.im).IsSymm := by + ext i j + exact congrArg Complex.im (congrFun (congrFun hA i) j) + +theorem complexify_nonsing_inv {n : ℕ} (A : Mat n ℝ) (hA : IsUnit A) : + (A.map Complex.ofReal)⁻¹ = A⁻¹.map Complex.ofReal := by + apply Matrix.inv_eq_right_inv + have hf : (Complex.ofRealHom : ℝ → ℂ) = Complex.ofReal := by + funext x + rfl + have h := Matrix.mul_nonsing_inv A ((Matrix.isUnit_iff_isUnit_det A).mp hA) + have ho : (1 : Mat n ℝ).map Complex.ofRealHom = 1 := by + ext i j + by_cases hij : i = j <;> simp [Matrix.map_apply, Matrix.one_apply, hij] + have hc := congrArg (fun M : Mat n ℝ => M.map Complex.ofRealHom) h + rw [Matrix.map_mul, ho] at hc + simpa only [hf] using hc + +theorem resolvent_denominator_posDef {n : ℕ} (X : Mat n ℝ) (hX : X.IsHermitian) + (a η : ℝ) (hη : 0 < η) : + ((a • (1 : Mat n ℝ) - X) ^ 2 + η ^ 2 • 1).PosDef := by + have hR : (a • (1 : Mat n ℝ) - X).IsHermitian := + ((Matrix.isHermitian_one).smul (IsSelfAdjoint.all a)).sub hX + have hsq : ((a • (1 : Mat n ℝ) - X) ^ 2).PosSemidef := by + simpa only [pow_two, hR.eq] using + Matrix.posSemidef_conjTranspose_mul_self (a • (1 : Mat n ℝ) - X) + exact Matrix.PosDef.posSemidef_add hsq (Matrix.PosDef.one.smul (sq_pos_of_pos hη)) + +theorem resolvent_mul_adjoint {n : ℕ} (X : Mat n ℝ) (hX : X.IsHermitian) + (a η : ℝ) : + (((a : ℂ) + (η : ℂ) * Complex.I) • (1 : Mat n ℂ) - X.map Complex.ofReal) * + (((a : ℂ) + (η : ℂ) * Complex.I) • (1 : Mat n ℂ) - X.map Complex.ofReal)ᴴ = + (((a • (1 : Mat n ℝ) - X) ^ 2 + η ^ 2 • 1).map Complex.ofReal) := by + rw [Matrix.conjTranspose_sub, Matrix.conjTranspose_smul, Matrix.conjTranspose_one, + (isHermitian_complexify X hX).eq] + have hf : (Complex.ofRealHom : ℝ → ℂ) = Complex.ofReal := by + funext x + rfl + have hm : ((a • (1 : Mat n ℝ) - X) ^ 2).map Complex.ofReal = + ((a • (1 : Mat n ℝ) - X).map Complex.ofReal) * + ((a • (1 : Mat n ℝ) - X).map Complex.ofReal) := by + simpa only [pow_two, hf] using (Matrix.map_mul (f := Complex.ofRealHom) + (L := a • (1 : Mat n ℝ) - X) (M := a • (1 : Mat n ℝ) - X)) + have hr : (a • (1 : Mat n ℝ) - X).map Complex.ofReal = + (a : ℂ) • 1 - X.map Complex.ofReal := by + ext i j + by_cases hij : i = j <;> + simp [Matrix.map_apply, Matrix.smul_apply, smul_eq_mul, hij] + have hb : (((a • (1 : Mat n ℝ) - X) ^ 2 + η ^ 2 • 1).map Complex.ofReal) = + (((a • (1 : Mat n ℝ) - X) ^ 2).map Complex.ofReal) + (η : ℂ)^2 • 1 := by + ext i j + by_cases hij : i = j <;> + simp [Matrix.map_apply, Matrix.smul_apply, smul_eq_mul, hij] + rw [hb, hm, hr] + simp only [Matrix.sub_mul, Matrix.mul_sub, Matrix.smul_mul, Matrix.mul_smul, + Matrix.one_mul, Matrix.mul_one] + ext i j + simp only [Matrix.sub_apply, Matrix.add_apply, Matrix.smul_apply, smul_eq_mul] + simp only [map_add, map_mul, Complex.star_def, Complex.conj_ofReal, Complex.conj_I] + ring_nf + simp + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ResolventPositive.lean b/lean/OAI/Analysis/HyperbolicCones/ResolventPositive.lean new file mode 100644 index 0000000000000000000000000000000000000000..a5a4dd3b183d441d3e56f995edf6f0dd6e2bdb8f --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ResolventPositive.lean @@ -0,0 +1,66 @@ +import OAI.Analysis.HyperbolicCones.ResolventFormula +import OAI.Analysis.HyperbolicCones.RankQuadratics + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +theorem complex_symmetric_imaginary_posDef_isUnit {n : ℕ} (H : Mat n ℂ) + (hH : H.IsSymm) (him : (H.map Complex.im).PosDef) : IsUnit H := by + have hδ : (2 * Complex.I : ℂ) ≠ 0 := by norm_num + apply isUnit_of_adjoint_difference_posDef H ((H.map Complex.im).map Complex.ofReal) + (2 * Complex.I) hδ (posDef_complexify _ him) + rw [complex_symmetric_imaginary H hH, smul_smul, mul_inv_cancel₀ hδ, one_smul] + +theorem resolvent_schur_imaginary_lower_bound (X Z : Mat 4 ℝ) (hX : X.IsHermitian) + (y : Fin 3 → ℝ) (a η : ℝ) (hη : 0 < η) : + η • (1 : Mat 4 ℝ) ≤ + ((((a : ℂ) + (η : ℂ) * Complex.I) • (1 : Mat 4 ℂ) - Z.map Complex.ofReal - + phi (fun i => (y i : ℂ)) + ((((a : ℂ) + (η : ℂ) * Complex.I) • (1 : Mat 4 ℂ) - + X.map Complex.ofReal)⁻¹)).map Complex.im) := by + let z : ℂ := (a : ℂ) + (η : ℂ) * Complex.I + let R := (z • (1 : Mat 4 ℂ) - X.map Complex.ofReal)⁻¹ + have hneg : (-R.map Complex.im).PosSemidef := + (resolvent_negative_imaginary_posDef X hX a η hη).posSemidef + have hsub (A B : Mat 4 ℂ) : (A - B).map Complex.im = + A.map Complex.im - B.map Complex.im := by + ext i j + exact Complex.sub_im _ _ + have him : (z • (1 : Mat 4 ℂ) - Z.map Complex.ofReal).map Complex.im = + η • (1 : Mat 4 ℝ) := by + ext i j + by_cases hij : i = j <;> + simp [z, Matrix.map_apply, Matrix.sub_apply, Matrix.smul_apply, smul_eq_mul, hij] + change (((z • (1 : Mat 4 ℂ) - Z.map Complex.ofReal - + phi (fun i => (y i : ℂ)) R).map Complex.im) - η • 1).PosSemidef + rw [hsub, him, phi_imaginary] + have hphi : phi y (-R.map Complex.im) = -phi y (R.map Complex.im) := by + exact (phiLinear y).map_neg _ + have heq : η • (1 : Mat 4 ℝ) - phi y (R.map Complex.im) - η • 1 = + phi y (-R.map Complex.im) := by + rw [hphi] + abel + rw [heq] + exact phi_posSemidef y _ hneg + +theorem resolvent_schur_imaginary_posDef (X Z : Mat 4 ℝ) (hX : X.IsHermitian) + (y : Fin 3 → ℝ) (a η : ℝ) (hη : 0 < η) : + ((((a : ℂ) + (η : ℂ) * Complex.I) • (1 : Mat 4 ℂ) - Z.map Complex.ofReal - + phi (fun i => (y i : ℂ)) + ((((a : ℂ) + (η : ℂ) * Complex.I) • (1 : Mat 4 ℂ) - + X.map Complex.ofReal)⁻¹)).map Complex.im).PosDef := by + have h := (Matrix.PosDef.one.smul hη).add_posSemidef + (resolvent_schur_imaginary_lower_bound X Z hX y a η hη) + simpa only [add_sub_cancel] using h + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/RootFactorization.lean b/lean/OAI/Analysis/HyperbolicCones/RootFactorization.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a38600a4114a05e7259b2dd71b242cc570f14ad --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/RootFactorization.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.HyperbolicCones.ConeRoots +import OAI.Analysis.HyperbolicCones.LinePolynomial + +namespace OAI + +noncomputable section + +open Polynomial + +namespace Paper256 + +theorem linePolynomial_splits (x : Ambient) : (linePolynomial x).Splits := by + apply Polynomial.Splits.of_splits_map_of_injective + (algebraMap ℝ ℂ).injective (IsAlgClosed.splits _) + intro z hz + have hm : (linePolynomial x).map (algebraMap ℝ ℂ) ≠ 0 := + ((linePolynomial_monic x).map (algebraMap ℝ ℂ)).ne_zero + have hr := (Polynomial.mem_roots hm).mp hz + have hz0 : (linePolynomial x).aeval z = 0 := by + simpa only [Polynomial.IsRoot, Polynomial.eval_map_algebraMap] using hr + have hi := linePolynomial_complex_roots_real x z hz0 + refine ⟨z.re, ?_⟩ + apply Complex.ext + · rfl + · change (0 : ℝ) = z.im + exact hi.symm + +theorem linePolynomial_card_roots (x : Ambient) : (linePolynomial x).roots.card = 20 := by + rw [← (linePolynomial_splits x).natDegree_eq_card_roots, linePolynomial_natDegree] + +theorem cone_iff_roots_nonnegative (x : Ambient) : + x ∈ cone ↔ ∀ r ∈ (linePolynomial x).roots, 0 ≤ r := by + rw [cone_iff_nonnegative_real_roots] + simp only [Polynomial.mem_roots (linePolynomial_monic x).ne_zero, Polynomial.IsRoot] + +theorem polynomial_shift_product (x : Ambient) (t : ℝ) : + MvPolynomial.eval (coordinates (x + t • basePoint)) polynomial = + ((linePolynomial x).roots.map (fun r => t + r)).prod := by + rw [← linePolynomial_eval_neg, + (linePolynomial_splits x).eval_eq_prod_roots_of_monic (linePolynomial_monic x)] + have he : (linePolynomial x).roots.map (fun r => -t - r) = + ((linePolynomial x).roots.map (fun r => t + r)).map (fun r => -r) := by + rw [Multiset.map_map] + congr 1 + funext r + simp [neg_add_rev, sub_eq_add_neg, add_comm] + rw [he, Multiset.prod_map_neg, Multiset.card_map, linePolynomial_card_roots] + norm_num + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ScalingAlgebra.lean b/lean/OAI/Analysis/HyperbolicCones/ScalingAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..d1b1ef057324133941965bf7fb4b41c948aaafef --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ScalingAlgebra.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.HyperbolicCones.PencilBlocks + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator + +universe u + +namespace Paper256 + +def blockScalar (a c : ℕ) (s : ℝ) : + Matrix (Fin a ⊕ Fin c) (Fin a ⊕ Fin c) ℝ := + Matrix.fromBlocks 1 0 0 (s • (1 : Mat c ℝ)) + +theorem blockScalar_transpose (a c : ℕ) (s : ℝ) : + (blockScalar a c s)ᵀ = blockScalar a c s := by + simp [blockScalar, Matrix.fromBlocks_transpose] + +theorem blockScalar_isUnit (a c : ℕ) (s : ℝ) (hs : s ≠ 0) : + IsUnit (blockScalar a c s) := by + refine ⟨⟨blockScalar a c s, blockScalar a c s⁻¹, ?_, ?_⟩, rfl⟩ <;> + simp [blockScalar, Matrix.fromBlocks_multiply, smul_smul, hs] + +theorem block_scaling_identity {a c : ℕ} (D A F : Mat a ℝ) + (B C : Matrix (Fin a) (Fin c) ℝ) (E : Mat c ℝ) (s : ℝ) (hs : s ≠ 0) : + blockScalar a c s⁻¹ * + Matrix.fromBlocks (D + s ^ 2 • F + s • A) (s ^ 2 • C + s • B) + (s ^ 2 • C + s • B)ᵀ (s ^ 2 • E) * blockScalar a c s⁻¹ = + Matrix.fromBlocks (D + s • A + s ^ 2 • F) (B + s • C) (B + s • C)ᵀ E := by + simp only [blockScalar, Matrix.fromBlocks_multiply] + ext (i | i) (j | j) <;> + simp [Matrix.fromBlocks, Matrix.transpose_add, Matrix.transpose_smul, + mul_add, smul_smul] <;> + field_simp <;> ring + +theorem posSemidef_smul_iff {ι : Type u} [Fintype ι] {H : Matrix ι ι ℝ} {s : ℝ} + (hs : 0 < s) : (s • H).PosSemidef ↔ H.PosSemidef := by + constructor + · intro h + have hh := h.smul (inv_pos.mpr hs).le + simpa only [smul_smul, inv_mul_cancel₀ hs.ne', one_smul] using hh + · exact fun h => h.smul hs.le + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ShiftValue.lean b/lean/OAI/Analysis/HyperbolicCones/ShiftValue.lean new file mode 100644 index 0000000000000000000000000000000000000000..0cebdc08a2c4d2dfe1a95285228ff2004a0025eb --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ShiftValue.lean @@ -0,0 +1,29 @@ +import OAI.Analysis.HyperbolicCones.ConeMatrix +import OAI.Analysis.HyperbolicCones.PolynomialEvaluation + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +theorem ambient_shift (X Z : Sym 4) (y : Fin 3 → ℝ) (t : ℝ) : + (((X, Z), y) : Ambient) + t • basePoint = ((X + t • 1, Z + t • 1), y) := by + simp [basePoint] + +theorem polynomial_shift_inverse (X Z : Sym 4) (y : Fin 3 → ℝ) (t : ℝ) + (ht : ((X + t • 1 : Sym 4) : Mat 4 ℝ).PosDef) : + MvPolynomial.eval (coordinates ((((X, Z), y) : Ambient) + t • basePoint)) polynomial = + ((X + t • 1 : Sym 4) : Mat 4 ℝ).det ^ 4 * + (coneResidual X Z y t : Mat 4 ℝ).det := by + rw [ambient_shift, polynomial_evaluation] + exact matrixValue_inverse _ _ _ ((Matrix.isUnit_iff_isUnit_det _).mp ht.isUnit) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/SpectralBounds.lean b/lean/OAI/Analysis/HyperbolicCones/SpectralBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e5f60cda7b29295e77210bb59f36834c329e83c --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/SpectralBounds.lean @@ -0,0 +1,44 @@ +import OAI.Analysis.HyperbolicCones.PositiveMaps +import OAI.Analysis.HyperbolicCones.PencilConjugation + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator MatrixOrder + +namespace Paper256 + +def minimumEigenvalue (X : Sym 4) : ℝ := + Finset.univ.inf' Finset.univ_nonempty (sym_isHermitian X).eigenvalues + +theorem minimumEigenvalue_pos (X : Sym 4) (hX : (X : Mat 4 ℝ).PosDef) : + 0 < minimumEigenvalue X := by + apply (Finset.lt_inf'_iff _).mpr + intro i _ + exact hX.eigenvalues_pos i + +theorem minimumEigenvalue_smul_le (X : Sym 4) : + minimumEigenvalue X • (1 : Mat 4 ℝ) ≤ (X : Mat 4 ℝ) := by + rw [← Algebra.algebraMap_eq_smul_one] + apply (algebraMap_le_iff_le_spectrum (R := ℝ) (p := IsSelfAdjoint) X.property).mpr + intro x hx + rw [(sym_isHermitian X).spectrum_real_eq_range_eigenvalues] at hx + obtain ⟨i, rfl⟩ := hx + exact Finset.inf'_le _ (Finset.mem_univ i) + +theorem positive_unital_map_minimumEigenvalue_bound {n : ℕ} + (D : Sym 4 →ₗ[ℝ] Sym n) + (hD : ∀ X : Sym 4, (X : Mat 4 ℝ).PosSemidef → (D X : Mat n ℝ).PosSemidef) + (hI : D 1 = 1) (X : Sym 4) : + minimumEigenvalue X • (1 : Mat n ℝ) ≤ (D X : Mat n ℝ) := by + have h := positiveLinearMap_monotone D hD (minimumEigenvalue X • 1) X + (minimumEigenvalue_smul_le X) + simpa [hI] using h + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/SpectralContinuity.lean b/lean/OAI/Analysis/HyperbolicCones/SpectralContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b474679ae4770b6aa3e968d5fcb9e5c7197bf0d --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/SpectralContinuity.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.HyperbolicCones.SpectralProjection + +namespace OAI + +/-! Finite spectral convergence, including eigenvalues equal to zero. -/ + +noncomputable section +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix Filter Topology +universe u + +namespace Paper256 + +theorem matrix_cfc_tendsto {n : ℕ} (A : Mat n ℝ) (hA : A.IsHermitian) {T : Type u} {L : Filter T} + (f : T → ℝ → ℝ) (g : ℝ → ℝ) + (hf : ∀ i, Tendsto (fun t => f t (hA.eigenvalues i)) L + (𝓝 (g (hA.eigenvalues i)))) : + Tendsto (fun t => cfc (f t) A) L (𝓝 (cfc g A)) := by + have hcoord : Tendsto (fun t i => f t (hA.eigenvalues i)) L + (𝓝 (fun i => g (hA.eigenvalues i))) := tendsto_pi_nhds.mpr hf + have hdiag := (continuous_id.matrix_diagonal.tendsto + (fun i => g (hA.eigenvalues i))).comp hcoord + have hprod := ((tendsto_const_nhds (x := (hA.eigenvectorUnitary : Mat n ℝ))).mul hdiag).mul + (tendsto_const_nhds (x := ((hA.eigenvectorUnitary : Mat n ℝ)ᴴ))) + simpa only [hA.cfc_eq, Matrix.IsHermitian.cfc, + Unitary.conjStarAlgAut_apply, Matrix.star_eq_conjTranspose, + Function.comp_def, RCLike.ofReal_real_eq_id, id_eq] using + (hprod : Tendsto (fun t => (hA.eigenvectorUnitary : Mat n ℝ) * + diagonal (fun i => f t (hA.eigenvalues i)) * + (hA.eigenvectorUnitary : Mat n ℝ)ᴴ) L + (𝓝 ((hA.eigenvectorUnitary : Mat n ℝ) * + diagonal (fun i => g (hA.eigenvalues i)) * + (hA.eigenvectorUnitary : Mat n ℝ)ᴴ))) + +theorem inverse_sqrt_affine_scalar_tendsto (μ : ℝ) (hμ : 0 ≤ μ) : + Tendsto (fun t : ℝ => (Real.sqrt (1 + (t - 1) * μ))⁻¹) atTop + (𝓝 (if μ = 0 then 1 else 0)) := by + by_cases hzero : μ = 0 + · simp [hzero] + · have hpos : 0 < μ := lt_of_le_of_ne hμ (Ne.symm hzero) + have haff : Tendsto (fun t : ℝ => 1 + (t - 1) * μ) atTop atTop := by + have hm := (tendsto_id.const_mul_atTop hpos).atTop_add + (tendsto_const_nhds (x := 1 - μ)) + convert hm using 1 + ext t + simp only [id_eq] + ring + simpa [hzero, Function.comp_def] using tendsto_inv_atTop_zero.comp (Real.tendsto_sqrt_atTop.comp haff) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/SpectralProjection.lean b/lean/OAI/Analysis/HyperbolicCones/SpectralProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..23de8e6e08a1b3df807814289db9a3dcbcc76d53 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/SpectralProjection.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.HyperbolicCones.KernelSpectrum + +namespace OAI + +/-! The kernel projection is the zero-eigenvalue spectral projection. -/ + +noncomputable section + +open scoped Matrix.Norms.L2Operator MatrixOrder +open Matrix + +namespace Paper256 + +theorem matrix_cfc_add {n : ℕ} (H : Sym n) (f g : ℝ → ℝ) : + cfc (fun x => f x + g x) (H : Mat n ℝ) = + cfc f (H : Mat n ℝ) + cfc g (H : Mat n ℝ) := + cfc_add (H : Mat n ℝ) f g (H.val.finite_real_spectrum.continuousOn f) + (H.val.finite_real_spectrum.continuousOn g) + +theorem kernelProjection_eq_cfc {n : ℕ} (H : Sym n) : + kernelProjection (H : Mat n ℝ) = + cfc (fun x : ℝ => if x = 0 then 1 else 0) (H : Mat n ℝ) := by + let f : ℝ → ℝ := fun x => if x = 0 then 1 else 0 + let P : Mat n ℝ := cfc f (H : Mat n ℝ) + let G : Mat n ℝ := cfc (fun x : ℝ => x⁻¹) (H : Mat n ℝ) + have hid : cfc (fun x : ℝ => x) (H : Mat n ℝ) = (H : Mat n ℝ) := + cfc_id' ℝ (H : Mat n ℝ) H.property + have hPP : P * P = P := by + change cfc f (H : Mat n ℝ) * cfc f (H : Mat n ℝ) = cfc f (H : Mat n ℝ) + rw [← matrix_cfc_mul H f f] + apply cfc_congr + intro x _ + by_cases hx : x = 0 <;> simp [f, hx] + have hHP : (H : Mat n ℝ) * P = 0 := by + calc + _ = cfc (fun x : ℝ => x) (H : Mat n ℝ) * cfc f (H : Mat n ℝ) := by rw [hid] + _ = cfc (fun x : ℝ => x * f x) (H : Mat n ℝ) := (matrix_cfc_mul H _ _).symm + _ = cfc (fun _ : ℝ => 0) (H : Mat n ℝ) := by + apply cfc_congr + intro x _ + by_cases hx : x = 0 <;> simp [f, hx] + _ = 0 := cfc_const_zero ℝ (H : Mat n ℝ) + have hPGH : P + G * (H : Mat n ℝ) = 1 := by + calc + _ = cfc f (H : Mat n ℝ) + cfc (fun x : ℝ => x⁻¹ * x) (H : Mat n ℝ) := by + rw [matrix_cfc_mul H (fun x : ℝ => x⁻¹) (fun x => x), hid] + _ = cfc (fun x : ℝ => f x + x⁻¹ * x) (H : Mat n ℝ) := (matrix_cfc_add H _ _).symm + _ = cfc (fun _ : ℝ => 1) (H : Mat n ℝ) := by + apply cfc_congr + intro x _ + by_cases hx : x = 0 <;> simp [f, hx] + _ = 1 := cfc_const_one ℝ (H : Mat n ℝ) H.property + let φ := Matrix.toEuclideanCLM (𝕜 := ℝ) (n := Fin n) + have hp : IsStarProjection P := ⟨hPP, IsSelfAdjoint.cfc⟩ + have hrange : (φ P).range = (φ (H : Mat n ℝ)).ker := by + ext x + constructor + · rintro ⟨y, rfl⟩ + change φ (H : Mat n ℝ) (φ P y) = 0 + have hm : φ (H : Mat n ℝ) * φ P = 0 := by + simpa only [map_mul, map_zero] using congrArg φ hHP + simpa using congrArg (fun T : Vec n →L[ℝ] Vec n => T y) hm + · intro hx + refine ⟨x, ?_⟩ + change φ (H : Mat n ℝ) x = 0 at hx + have hm : φ P + φ G * φ (H : Mat n ℝ) = 1 := by + simpa only [map_add, map_mul, map_one] using congrArg φ hPGH + simpa [hx] using congrArg (fun T : Vec n →L[ℝ] Vec n => T x) hm + have hproj : φ P = (φ (H : Mat n ℝ)).ker.starProjection := by + apply (ContinuousLinearMap.IsStarProjection.ext_iff (hp.map φ) + (isStarProjection_starProjection (U := (φ (H : Mat n ℝ)).ker))).mpr + rw [Submodule.range_starProjection] + exact hrange + apply φ.injective + change φ (kernelProjection (H : Mat n ℝ)) = φ P + rw [hproj] + apply ContinuousLinearMap.ext + intro x + change Matrix.toEuclideanLin (kernelProjection (H : Mat n ℝ)) x = _ + rw [kernelProjection, LinearEquiv.apply_symm_apply] + rfl + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/SplitAssembly.lean b/lean/OAI/Analysis/HyperbolicCones/SplitAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..95e95d850b7b675132bc47cbdca5e5e353b15e53 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/SplitAssembly.lean @@ -0,0 +1,94 @@ +import OAI.Analysis.HyperbolicCones.SplitFrame + +namespace OAI + +noncomputable section + +open Set Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +theorem pencil_reindex_blocks {m a c : ℕ} (L : Ambient →ₗ[ℝ] Sym m) + (e : (Fin a ⊕ Fin c) ≃ Fin m) + (hrow : ∀ (X : Sym 4) (i : Fin c) (j : Fin m), + (pencilFirst L X : Mat m ℝ) (e (Sum.inr i)) j = 0) + (X Z : Sym 4) (y : Fin 3 → ℝ) : + (L ((X, Z), y) : Mat m ℝ).submatrix e e = + Matrix.fromBlocks + ((pencilFirst L X : Mat m ℝ).submatrix (e ∘ Sum.inl) (e ∘ Sum.inl) + + (pencilSecond L Z : Mat m ℝ).submatrix (e ∘ Sum.inl) (e ∘ Sum.inl) + + (pencilParameter L y : Mat m ℝ).submatrix (e ∘ Sum.inl) (e ∘ Sum.inl)) + ((pencilSecond L Z : Mat m ℝ).submatrix (e ∘ Sum.inl) (e ∘ Sum.inr) + + (pencilParameter L y : Mat m ℝ).submatrix (e ∘ Sum.inl) (e ∘ Sum.inr)) + (((pencilSecond L Z : Mat m ℝ).submatrix (e ∘ Sum.inl) (e ∘ Sum.inr) + + (pencilParameter L y : Mat m ℝ).submatrix (e ∘ Sum.inl) (e ∘ Sum.inr))ᵀ) + ((pencilSecond L Z : Mat m ℝ).submatrix (e ∘ Sum.inr) (e ∘ Sum.inr) + + (pencilParameter L y : Mat m ℝ).submatrix (e ∘ Sum.inr) (e ∘ Sum.inr)) := by + have hdec (i j : Fin m) : (L ((X, Z), y) : Mat m ℝ) i j = + (pencilFirst L X : Mat m ℝ) i j + (pencilSecond L Z : Mat m ℝ) i j + + (pencilParameter L y : Mat m ℝ) i j := by + rw [pencil_decomposition] + rfl + have hcol (i : Fin m) (j : Fin c) : + (pencilFirst L X : Mat m ℝ) i (e (Sum.inr j)) = 0 := by + have hh := (sym_isHermitian (pencilFirst L X)).apply (e (Sum.inr j)) i + simpa using hh.trans (hrow X j i) + have hs (H : Sym m) (i j : Fin m) : (H : Mat m ℝ) i j = (H : Mat m ℝ) j i := by + simpa using (sym_isHermitian H).apply j i + ext (i | i) (j | j) + · exact hdec _ _ + · change (L ((X, Z), y) : Mat m ℝ) _ _ = _ + _ + rw [hdec, hcol, zero_add] + rfl + · change (L ((X, Z), y) : Mat m ℝ) _ _ = _ + _ + rw [hdec, hrow, zero_add, hs (pencilSecond L Z), hs (pencilParameter L y)] + rfl + · change (L ((X, Z), y) : Mat m ℝ) _ _ = _ + _ + rw [hdec, hrow, zero_add] + rfl + +theorem rawBlockPencil_of_partition {m a c : ℕ} (K : Set Ambient) + (L : Ambient →ₗ[ℝ] Sym m) (ha : 0 < a) (hc : 0 < c) + (e : (Fin a ⊕ Fin c) ≃ Fin m) + (hrep : K = {x | (L x : Mat m ℝ).PosSemidef}) + (hfirst : ∀ X : Sym 4, (X : Mat 4 ℝ).PosSemidef → + (pencilFirst L X : Mat m ℝ).PosSemidef) + (hsecond : ∀ X : Sym 4, (X : Mat 4 ℝ).PosSemidef → + (pencilSecond L X : Mat m ℝ).PosSemidef) + (hrow : ∀ (X : Sym 4) (i : Fin c) (j : Fin m), + (pencilFirst L X : Mat m ℝ) (e (Sum.inr i)) j = 0) + (hD : ((pencilFirst L 1 : Mat m ℝ).submatrix (e ∘ Sum.inl) (e ∘ Sum.inl)).PosDef) + (hE : ((pencilSecond L 1 : Mat m ℝ).submatrix (e ∘ Sum.inr) (e ∘ Sum.inr)).PosDef) : + Nonempty (RawBlockPencil K) := by + let f := e ∘ Sum.inl + let g := e ∘ Sum.inr + refine ⟨{ + a := a + c := c + a_pos := ha + c_pos := hc + D := restrictPencil (pencilFirst L) f + E := restrictPencil (pencilSecond L) g + F := restrictPencil (pencilSecond L) f + C := rectangularPencil (pencilSecond L) f g + A := restrictPencil (pencilParameter L) f + B := rectangularPencil (pencilParameter L) f g + G := restrictPencil (pencilParameter L) g + D_positive := fun X hX => (hfirst X hX).submatrix f + E_positive := fun X hX => (hsecond X hX).submatrix g + D_identity_posDef := hD + E_identity_posDef := hE + represents := ?_ }⟩ + intro X Z y + rw [hrep] + change (L ((X, Z), y) : Mat m ℝ).PosSemidef ↔ _ + rw [← Matrix.posSemidef_submatrix_equiv e, + pencil_reindex_blocks L e hrow X Z y] + rfl + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/SplitBasic.lean b/lean/OAI/Analysis/HyperbolicCones/SplitBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..41e55735c9d7daa39d789b1199692989cf0a24f1 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/SplitBasic.lean @@ -0,0 +1,95 @@ +import OAI.Analysis.HyperbolicCones.RawBlocks +import OAI.Analysis.HyperbolicCones.PencilConjugation +import OAI.Analysis.HyperbolicCones.PositiveMaps + +namespace OAI + +noncomputable section + +open Set Matrix +open scoped Matrix.Norms.L2Operator + +namespace Paper256 + +def pencilFirst {m : ℕ} (L : Ambient →ₗ[ℝ] Sym m) : Sym 4 →ₗ[ℝ] Sym m where + toFun X := L ((X, 0), 0) + map_add' X Y := by simpa using L.map_add ((X, 0), 0) ((Y, 0), 0) + map_smul' s X := by simpa using L.map_smul s ((X, 0), 0) + +def pencilSecond {m : ℕ} (L : Ambient →ₗ[ℝ] Sym m) : Sym 4 →ₗ[ℝ] Sym m where + toFun X := L ((0, X), 0) + map_add' X Y := by simpa using L.map_add ((0, X), 0) ((0, Y), 0) + map_smul' s X := by simpa using L.map_smul s ((0, X), 0) + +def pencilParameter {m : ℕ} (L : Ambient →ₗ[ℝ] Sym m) : (Fin 3 → ℝ) →ₗ[ℝ] Sym m where + toFun y := L ((0, 0), y) + map_add' x y := by simpa using L.map_add ((0, 0), x) ((0, 0), y) + map_smul' s y := by simpa using L.map_smul s ((0, 0), y) + +theorem pencil_decomposition {m : ℕ} (L : Ambient →ₗ[ℝ] Sym m) + (X Z : Sym 4) (y : Fin 3 → ℝ) : + L ((X, Z), y) = pencilFirst L X + pencilSecond L Z + pencilParameter L y := by + change L ((X, Z), y) = L ((X, 0), 0) + L ((0, Z), 0) + L ((0, 0), y) + rw [← map_add, ← map_add] + simp + +theorem pencil_components_positive {m : ℕ} (K : Set Ambient) + (L : Ambient →ₗ[ℝ] Sym m) (hrep : K = {x | (L x : Mat m ℝ).PosSemidef}) + (hzero : ∀ X Z : Sym 4, ((X, Z), (0 : Fin 3 → ℝ)) ∈ K ↔ + (X : Mat 4 ℝ).PosSemidef ∧ (Z : Mat 4 ℝ).PosSemidef) : + (∀ X : Sym 4, (X : Mat 4 ℝ).PosSemidef → (pencilFirst L X : Mat m ℝ).PosSemidef) ∧ + (∀ Z : Sym 4, (Z : Mat 4 ℝ).PosSemidef → (pencilSecond L Z : Mat m ℝ).PosSemidef) := by + constructor + · intro X hX + have h := (hzero X 0).mpr ⟨hX, Matrix.PosSemidef.zero⟩ + simpa only [hrep, mem_ofPred_eq] using! h + · intro Z hZ + have h := (hzero 0 Z).mpr ⟨Matrix.PosSemidef.zero, hZ⟩ + simpa only [hrep, mem_ofPred_eq] using! h + +theorem pencil_first_identity_ne_zero {m : ℕ} (K : Set Ambient) + (L : Ambient →ₗ[ℝ] Sym m) (hrep : K = {x | (L x : Mat m ℝ).PosSemidef}) + (hzero : ∀ X Z : Sym 4, ((X, Z), (0 : Fin 3 → ℝ)) ∈ K ↔ + (X : Mat 4 ℝ).PosSemidef ∧ (Z : Mat 4 ℝ).PosSemidef) : + (pencilFirst L 1 : Mat m ℝ) ≠ 0 := by + intro hz + have hz' : pencilFirst L 1 = 0 := Subtype.ext hz + have hpositive := (pencil_components_positive K L hrep hzero).2 1 Matrix.PosSemidef.one + have heq : L (((-1, 1), 0) : Ambient) = pencilSecond L 1 := by + rw [pencil_decomposition, map_neg, hz', map_zero] + simp + have hmem : (((-1, 1), 0) : Ambient) ∈ K := by + rw [hrep] + change (L (((-1, 1), 0) : Ambient) : Mat m ℝ).PosSemidef + rwa [heq] + have hh := ((hzero (-1) 1).mp hmem).1.diag_nonneg (i := (0 : Fin 4)) + norm_num at hh + +theorem pencil_first_identity_not_posDef {m : ℕ} (K : Set Ambient) + (L : Ambient →ₗ[ℝ] Sym m) (hrep : K = {x | (L x : Mat m ℝ).PosSemidef}) + (hzero : ∀ X Z : Sym 4, ((X, Z), (0 : Fin 3 → ℝ)) ∈ K ↔ + (X : Mat 4 ℝ).PosSemidef ∧ (Z : Mat 4 ℝ).PosSemidef) : + ¬ (pencilFirst L 1 : Mat m ℝ).PosDef := by + intro hpos + have hi : pencilFirst L 1 ∈ interior {Y : Sym m | (Y : Mat m ℝ).PosDef} := by + rw [(isOpen_posDef m).interior_eq] + exact hpos + obtain ⟨ε, hε, _, hminus⟩ := interior_line_pair hi (pencilSecond L 1) + have heq : L (((1, -(ε • 1)), 0) : Ambient) = + pencilFirst L 1 - ε • pencilSecond L 1 := by + rw [pencil_decomposition, map_neg, map_smul, map_zero] + simp [sub_eq_add_neg] + have hmem : (((1, -(ε • 1)), 0) : Ambient) ∈ K := by + rw [hrep] + change (L (((1, -(ε • 1)), 0) : Ambient) : Mat m ℝ).PosSemidef + rw [heq] + exact hminus.posSemidef + have hh := ((hzero 1 (-(ε • 1))).mp hmem).2.diag_nonneg (i := (0 : Fin 4)) + have : 0 ≤ -ε := by simpa using hh + linarith + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/SplitFrame.lean b/lean/OAI/Analysis/HyperbolicCones/SplitFrame.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2cc7a6955fae7593e57cac4e82e726f638dc2bb --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/SplitFrame.lean @@ -0,0 +1,65 @@ +import OAI.Analysis.HyperbolicCones.SplitBasic + +namespace OAI + +noncomputable section + +open Set Matrix +open scoped Matrix.Norms.L2Operator + +universe u + +namespace Paper256 + +structure PencilSpectralSplit {m : ℕ} (A : Sym m) where + a : ℕ + c : ℕ + a_pos : 0 < a + c_pos : 0 < c + index : (Fin a ⊕ Fin c) ≃ Fin m + positive : ∀ i, 0 < (sym_isHermitian A).eigenvalues (index (Sum.inl i)) + nonpositive : ∀ i, ¬ 0 < (sym_isHermitian A).eigenvalues (index (Sum.inr i)) + +theorem pencilSpectralSplit_exists {m : ℕ} (A : Sym m) + (hA : (A : Mat m ℝ).PosSemidef) (hne : (A : Mat m ℝ) ≠ 0) + (hnpd : ¬ (A : Mat m ℝ).PosDef) : Nonempty (PencilSpectralSplit A) := by + classical + let p : Fin m → Prop := fun i => 0 < (sym_isHermitian A).eigenvalues i + have hp : ∃ i, p i := by + by_contra! hh + apply hne + apply (sym_isHermitian A).eigenvalues_eq_zero_iff.mp + funext i + exact le_antisymm (le_of_not_gt (hh i)) (hA.eigenvalues_nonneg i) + have hn : ∃ i, ¬ p i := by + by_contra! hh + exact hnpd ((sym_isHermitian A).posDef_iff_eigenvalues_pos.mpr hh) + let J := {i : Fin m // p i} + let Q := {i : Fin m // ¬ p i} + let a := Fintype.card J + let c := Fintype.card Q + let f : Fin a ≃ J := (Fintype.equivFin J).symm + let g : Fin c ≃ Q := (Fintype.equivFin Q).symm + let e : (Fin a ⊕ Fin c) ≃ Fin m := (Equiv.sumCongr f g).trans (Equiv.sumCompl p) + have ha : 0 < a := Fintype.card_pos_iff.mpr ⟨⟨hp.choose, hp.choose_spec⟩⟩ + have hc : 0 < c := Fintype.card_pos_iff.mpr ⟨⟨hn.choose, hn.choose_spec⟩⟩ + exact ⟨⟨a, c, ha, hc, e, fun i => (f i).property, fun i => (g i).property⟩⟩ + +def rectangularPencil {V : Type u} [AddCommGroup V] [Module ℝ V] + {m a c : ℕ} (L : V →ₗ[ℝ] Sym m) (f : Fin a → Fin m) (g : Fin c → Fin m) : + V →ₗ[ℝ] Matrix (Fin a) (Fin c) ℝ where + toFun x := (L x : Mat m ℝ).submatrix f g + map_add' x y := by ext i j; simp + map_smul' s x := by ext i j; simp + +theorem conjugatePencil_posDef {V : Type u} [AddCommGroup V] [Module ℝ V] + {m : ℕ} (L : V →ₗ[ℝ] Sym m) (U : Mat m ℝ) (hU : IsUnit U) (x : V) + (hx : (L x : Mat m ℝ).PosDef) : (conjugatePencil L U x : Mat m ℝ).PosDef := by + change (Uᴴ * (L x : Mat m ℝ) * U).PosDef + exact hx.conjTranspose_mul_mul_same (Matrix.mulVec_injective_of_isUnit hU) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/StrictBlock.lean b/lean/OAI/Analysis/HyperbolicCones/StrictBlock.lean new file mode 100644 index 0000000000000000000000000000000000000000..91b5d2fdeefcc74c9eb079b6c3fc2682104cb990 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/StrictBlock.lean @@ -0,0 +1,62 @@ +import OAI.Analysis.HyperbolicCones.CompressionBasic + +namespace OAI + +noncomputable section + +open Matrix +open scoped Matrix.Norms.L2Operator + +universe u v + +namespace Paper256 + +theorem fromBlocks_quadratic {ι : Type u} {κ : Type v} [Fintype ι] [Fintype κ] + (A : Matrix ι ι ℝ) (B : Matrix ι κ ℝ) (C : Matrix κ ι ℝ) (D : Matrix κ κ ℝ) + (u : ι → ℝ) (v : κ → ℝ) : + Sum.elim u v ⬝ᵥ (Matrix.fromBlocks A B C D *ᵥ Sum.elim u v) = + u ⬝ᵥ (A *ᵥ u) + u ⬝ᵥ (B *ᵥ v) + v ⬝ᵥ (C *ᵥ u) + v ⬝ᵥ (D *ᵥ v) := by + simp [Matrix.fromBlocks_mulVec, sumElim_dotProduct_sumElim, + dotProduct_add, Function.comp_def] + ring + +theorem fromBlocks_add_lower_posDef {a c : ℕ} (A : Sym a) (E : Sym c) + (B : Matrix (Fin a) (Fin c) ℝ) (hA : (A : Mat a ℝ).PosDef) + (hM : (Matrix.fromBlocks (A : Mat a ℝ) B Bᵀ (E : Mat c ℝ)).PosSemidef) + (δ : ℝ) (hδ : 0 < δ) : + (Matrix.fromBlocks (A : Mat a ℝ) B Bᵀ ((E : Mat c ℝ) + δ • 1)).PosDef := by + apply Matrix.PosDef.of_dotProduct_mulVec_pos + (Matrix.IsHermitian.fromBlocks A.property (by simp) + (E.property.add (Matrix.PosDef.one.smul hδ).isHermitian)) + intro w hw + let u := w ∘ Sum.inl + let v := w ∘ Sum.inr + have hsplit : w = Sum.elim u v := by ext (i | i) <;> rfl + have hbase := hM.dotProduct_mulVec_nonneg w + rw [hsplit] at hbase ⊢ + simp only [star_trivial] at hbase ⊢ + by_cases hv : v = 0 + · have hu : u ≠ 0 := by + intro hu + apply hw + rw [hsplit, hu, hv] + ext (i | i) <;> rfl + have hp := hA.dotProduct_mulVec_pos hu + simpa only [fromBlocks_quadratic, hv, mulVec_zero, dotProduct_zero, + zero_dotProduct, add_zero, star_trivial] using hp + · have hp := (Matrix.PosDef.one.smul hδ : (δ • (1 : Mat c ℝ)).PosDef).dotProduct_mulVec_pos hv + have hq : + Sum.elim u v ⬝ᵥ + (Matrix.fromBlocks (A : Mat a ℝ) B Bᵀ ((E : Mat c ℝ) + δ • 1) *ᵥ Sum.elim u v) = + Sum.elim u v ⬝ᵥ (Matrix.fromBlocks (A : Mat a ℝ) B Bᵀ (E : Mat c ℝ) *ᵥ Sum.elim u v) + + v ⬝ᵥ ((δ • (1 : Mat c ℝ)) *ᵥ v) := by + rw [fromBlocks_quadratic, fromBlocks_quadratic, add_mulVec, dotProduct_add] + ring + rw [hq] + exact add_pos_of_nonneg_of_pos hbase (by simpa only [star_trivial] using hp) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/TangentBasic.lean b/lean/OAI/Analysis/HyperbolicCones/TangentBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..7a4983794311247f3600403f126b9b213aabb2ed --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/TangentBasic.lean @@ -0,0 +1,89 @@ +import OAI.Analysis.HyperbolicCones.Model + +namespace OAI + +noncomputable section + +open scoped RealInnerProductSpace + +namespace Paper256 + +theorem tangentCurve_unit (v h : Vec 4) (hv : ‖v‖ = 1) + (hh : inner ℝ v h = 0) (s : ℝ) : ‖tangentCurve v h s‖ = 1 := by + have hp : 0 < 1 + s ^ 2 * ‖h‖ ^ 2 := by positivity + have hn : ‖v + s • h‖ = Real.sqrt (1 + s ^ 2 * ‖h‖ ^ 2) := by + symm + apply (Real.sqrt_eq_iff_eq_sq hp.le (norm_nonneg _)).2 + symm + rw [norm_add_sq_real, real_inner_smul_right, hh, hv, norm_smul, + Real.norm_eq_abs, mul_pow, sq_abs] + ring + rw [tangentCurve, norm_smul, Real.norm_eq_abs, abs_inv, + abs_of_pos (Real.sqrt_pos.2 hp), hn, inv_mul_cancel₀ (ne_of_gt (Real.sqrt_pos.2 hp))] + +theorem tangentCurve_derivative (v h : Vec 4) : HasDerivAt (tangentCurve v h) h 0 := by + have hg : HasDerivAt (fun s : ℝ => 1 + s ^ 2 * ‖h‖ ^ 2) 0 0 := by + simpa using (((hasDerivAt_id (0 : ℝ)).pow 2).mul_const (‖h‖ ^ 2)).const_add 1 + have hs : HasDerivAt (fun s : ℝ => (Real.sqrt (1 + s ^ 2 * ‖h‖ ^ 2))⁻¹) 0 0 := by + simpa using! (hg.sqrt (by norm_num)).inv (by norm_num) + simpa [tangentCurve] using! hs.smul (((hasDerivAt_id (0 : ℝ)).smul_const h).const_add v) + +theorem tangentCurve_wedge (v h : Vec 4) (s : ℝ) : + wedgeCoordinates v (tangentCurve v h s) = + (s / Real.sqrt (1 + s ^ 2 * ‖h‖ ^ 2)) • wedgeCoordinates v h := by + funext i + simp [wedgeCoordinates, tangentCurve, div_eq_mul_inv] + ring + +def tangentCoordinates (v : Vec 4) : tangentSpace v →ₗ[ℝ] (Fin 3 → ℝ) where + toFun h := wedgeCoordinates v h.val + map_add' h k := by ext i; simp [wedgeCoordinates]; ring + map_smul' s h := by ext i; simp [wedgeCoordinates]; ring + +theorem tangent_coordinates_isomorphism (v : Vec 4) (hv : ‖v‖ = 1) (hv0 : v 0 ≠ 0) : + ∃ J : tangentSpace v ≃ₗ[ℝ] (Fin 3 → ℝ), + ∀ h : tangentSpace v, J h = wedgeCoordinates v h.val := by + have hf : (innerSL ℝ v).toLinearMap ≠ 0 := by + intro hf + have := LinearMap.congr_fun hf v + simp only [ContinuousLinearMap.coe_coe, innerSL_apply_apply, + LinearMap.zero_apply, real_inner_self_eq_norm_sq, hv, one_pow] at this + exact one_ne_zero this + have hdim : Module.finrank ℝ (tangentSpace v) = + Module.finrank ℝ (Fin 3 → ℝ) := by + have ht := Module.Dual.finrank_ker_add_one_of_ne_zero hf + simp only [finrank_euclideanSpace, Fintype.card_fin] at ht + simp only [Module.finrank_pi_fintype, Module.finrank_self, Finset.sum_const, + Finset.card_univ, Fintype.card_fin, smul_eq_mul, mul_one] + change Module.finrank ℝ (LinearMap.ker (innerSL ℝ v).toLinearMap) = 3 + omega + have hinj : Function.Injective (tangentCoordinates v) := by + apply LinearMap.ker_eq_bot.mp + apply LinearMap.ker_eq_bot'.2 + intro h hh + have hw (i : Fin 3) : v 0 * h.val i.succ - h.val 0 * v i.succ = 0 := by + exact congrFun hh i + have he : h.val = (h.val 0 / v 0) • v := by + apply PiLp.ext + intro i + refine Fin.cases ?_ (fun i => ?_) i + · simp [div_mul_cancel₀ _ hv0] + · dsimp + calc + h.val i.succ = (h.val 0 * v i.succ) / v 0 := + (eq_div_iff hv0).2 (by nlinarith [hw i]) + _ = (h.val 0 / v 0) * v i.succ := by ring + have hz : h.val 0 / v 0 = 0 := by + have hm := h.property + change inner ℝ v h.val = 0 at hm + rw [he, real_inner_smul_right, real_inner_self_eq_norm_sq, hv] at hm + simpa using hm + apply Subtype.ext + simpa [hz] using he + exact ⟨(tangentCoordinates v).linearEquivOfInjective hinj hdim, fun _ => rfl⟩ + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/TangentExpansion.lean b/lean/OAI/Analysis/HyperbolicCones/TangentExpansion.lean new file mode 100644 index 0000000000000000000000000000000000000000..04cdc25a5385c481813ade492850bef040fd44b4 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/TangentExpansion.lean @@ -0,0 +1,45 @@ +import OAI.Analysis.HyperbolicCones.TangentIdentity + +namespace OAI + +noncomputable section + +open scoped Matrix.Norms.L2Operator RealInnerProductSpace Topology +open Matrix Filter Asymptotics + +namespace Paper256 + +theorem NormalizedPencil.tangent_difference_quotient (P : NormalizedPencil) + (v h : Vec 4) (hv : ‖v‖ = 1) (hh : inner ℝ v h = 0) + (y : Fin 3 → ℝ) (s : ℝ) (hs : s ≠ 0) : + choiLam (wedgeCoordinates v h) y / (1 + s ^ 2 * ‖h‖ ^ 2) = + operatorNorm (P.leftProjection v * P.B y * + (s⁻¹ • (P.rightProjection (tangentCurve v h s) - P.rightProjection v))) ^ 2 := by + have hval := P.norm_identity (tangentCurve v h s) v + (tangentCurve_unit v h hv hh s) hv y + rw [tangentCurve_wedge, choiLam_smul_left] at hval + change (s / Real.sqrt (1 + s ^ 2 * ‖h‖ ^ 2)) ^ 2 * + choiLam (wedgeCoordinates v h) y = _ at hval + rw [div_pow, Real.sq_sqrt (by positivity)] at hval + rw [Matrix.mul_smul, Matrix.mul_sub, P.same_direction_zero v hv y, sub_zero, + operatorNorm_smul, mul_pow, sq_abs, ← hval] + have hd : 1 + s ^ 2 * ‖h‖ ^ 2 ≠ 0 := ne_of_gt (by positivity) + field_simp + +theorem kernel_projection_tangent_expansion (c : ℕ) (hC : 0 < c) + (E : Sym 4 →ₗ[ℝ] Sym c) : + ∃ (v : Vec 4) (T : Vec 4 →ₗ[ℝ] Mat c ℝ), + ‖v‖ = 1 ∧ v 0 ≠ 0 ∧ ∀ h : Vec 4, inner ℝ v h = 0 → + (fun s : ℝ => kernelProjection (E (1 - outerSym (tangentCurve v h s)) : Mat c ℝ) - + kernelProjection (E (1 - outerSym v) : Mat c ℝ) - s • T h) =o[𝓝 0] + (fun s : ℝ => s) := by + obtain ⟨v, T, hv, hv0, ht⟩ := kernel_projection_tangent_derivative c hC E + refine ⟨v, T, hv, hv0, ?_⟩ + intro h hh + simpa [tangentCurve] using (ht h hh).isLittleO + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/TangentFigure.lean b/lean/OAI/Analysis/HyperbolicCones/TangentFigure.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed5cda15631f07a0ecc5eb99c1f52d1fe9484604 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/TangentFigure.lean @@ -0,0 +1,125 @@ +import OAI.Analysis.HyperbolicCones.ConstantRank +import OAI.Analysis.HyperbolicCones.TangentExpansion + +namespace OAI + +noncomputable section + +open scoped ContDiff Matrix.Norms.L2Operator +open Set ContinuousLinearMap + +universe u v + +namespace Paper256 + +theorem exists_smooth_constant_rank_extension + {W : Type u} {F : Type v} [NormedAddCommGroup W] [NormedSpace ℝ W] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] + (S : Set W) (hne : S.Nonempty) (A : W → F →L[ℝ] F) + (hA : ContDiff ℝ ∞ A) (hs : ∀ u ∈ S, IsSelfAdjoint (A u)) : + ∃ v ∈ S, ∃ (U : Set W) (P : W → F →L[ℝ] F), IsOpen U ∧ v ∈ U ∧ + ContDiffOn ℝ ∞ P U ∧ + (∀ u ∈ S, Module.finrank ℝ (A u).range ≤ Module.finrank ℝ (A v).range) ∧ + (∀ u ∈ U, u ∈ S → Module.finrank ℝ (A u).range = Module.finrank ℝ (A v).range) ∧ + ∀ u ∈ U, u ∈ S → P u = (A u).ker.starProjection := by + obtain ⟨v, hv, U, hU, hvU, hmax, hrank⟩ := exists_constant_rank_neighborhood S hne A hA hs + obtain ⟨w, hw, V, P, hV, hwV, hP, heq⟩ := exists_smooth_kernel_extension (S ∩ U) + ⟨v, hv, hvU⟩ A hA (fun u hu => hs u hu.1) + refine ⟨w, hw.1, U ∩ V, P, hU.inter hV, ⟨hw.2, hwV⟩, + hP.mono (fun _ hu => hu.2), ?_, ?_, ?_⟩ + · intro u hu + rw [hrank w hw.2 hw.1] + exact hmax u hu + · intro u hu hus + rw [hrank w hw.2 hw.1] + exact hrank u hu.1 hus + · intro u hu hus + exact heq u hu.2 ⟨hus, hu.1⟩ + +theorem tangentCurve_mem_span (v h : Vec 4) (s : ℝ) : + tangentCurve v h s ∈ Submodule.span ℝ ({v, h} : Set (Vec 4)) := by + apply Submodule.smul_mem + apply Submodule.add_mem + · exact Submodule.subset_span (by simp) + · exact Submodule.smul_mem _ _ (Submodule.subset_span (by simp)) + +theorem tangentCurve_zero (v h : Vec 4) : tangentCurve v h 0 = v := by + simp [tangentCurve] + +theorem kernelProjection_zero (c : ℕ) : kernelProjection (0 : Mat c ℝ) = 1 := by + apply Matrix.toEuclideanLin.injective + simp [kernelProjection, Matrix.toEuclideanLin, Submodule.starProjection_top] + +theorem kernelProjection_eq_one_of_rank_zero {c : ℕ} (A : Mat c ℝ) + (hA : Module.finrank ℝ (Matrix.toEuclideanLin A).range = 0) : kernelProjection A = 1 := by + have hz : Matrix.toEuclideanLin A = 0 := + LinearMap.range_eq_bot.mp (Submodule.finrank_eq_zero.mp hA) + have hzero : A = 0 := Matrix.toEuclideanLin.injective (by simpa using hz) + rw [hzero, kernelProjection_zero] + +theorem matrix_independent_spanning_columns {m n : ℕ} (A : Matrix (Fin m) (Fin n) ℝ) : + ∃ f : Fin A.rank → Fin n, Function.Injective f ∧ + LinearIndependent ℝ (fun i => A.col (f i)) ∧ + Submodule.span ℝ (Set.range (fun i => A.col (f i))) = + Submodule.span ℝ (Set.range A.col) := by + classical + rw [Matrix.rank_eq_finrank_span_cols] + obtain ⟨v, hv, hspan, hlin⟩ := + Submodule.exists_fun_fin_finrank_span_eq ℝ (Set.range A.col) + choose f hf using hv + have heq : (fun i => A.col (f i)) = v := funext hf + refine ⟨f, ?_, ?_, ?_⟩ + · intro i j hij + apply hlin.injective + rw [← hf i, ← hf j, hij] + · simpa only [heq] using hlin + · simpa only [heq] using hspan + +theorem matrix_columns_independent_neighborhood + {W : Type u} [TopologicalSpace W] {m n q : ℕ} + (A : W → Matrix (Fin m) (Fin n) ℝ) (hA : Continuous A) + (v : W) (f : Fin q → Fin n) + (hf : LinearIndependent ℝ (fun i => (A v).col (f i))) : + ∃ U : Set W, IsOpen U ∧ v ∈ U ∧ + ∀ u ∈ U, LinearIndependent ℝ (fun i => (A u).col (f i)) := by + have hcol : Continuous (fun u => fun i : Fin q => (A u).col (f i)) := by + apply continuous_pi + intro i + apply continuous_pi + intro j + exact (Matrix.entryLinearMap ℝ ℝ j (f i)).continuous_of_finiteDimensional.comp hA + let U : Set W := {u | LinearIndependent ℝ (fun i => (A u).col (f i))} + have hU : IsOpen U := isOpen_setOfPred_linearIndependent.preimage hcol + exact ⟨U, hU, hf, fun _ hu => hu⟩ + +theorem matrix_columns_span_of_rank_le {m n q : ℕ} + (A : Matrix (Fin m) (Fin n) ℝ) (f : Fin q → Fin n) + (hf : LinearIndependent ℝ (fun i => A.col (f i))) (hrank : A.rank ≤ q) : + Submodule.span ℝ (Set.range (fun i => A.col (f i))) = + Submodule.span ℝ (Set.range A.col) := by + apply Submodule.eq_of_le_of_finrank_le + · apply Submodule.span_mono + rintro _ ⟨i, rfl⟩ + exact ⟨f i, rfl⟩ + · rw [finrank_span_eq_card hf, Fintype.card_fin, ← Matrix.rank_eq_finrank_span_cols] + exact hrank + +theorem matrix_fixed_columns_local_frame + {W : Type u} [TopologicalSpace W] {m n : ℕ} + (A : W → Matrix (Fin m) (Fin n) ℝ) (hA : Continuous A) + (S : Set W) (v : W) (hmax : ∀ u ∈ S, (A u).rank ≤ (A v).rank) : + ∃ (f : Fin (A v).rank → Fin n) (U : Set W), Function.Injective f ∧ + IsOpen U ∧ v ∈ U ∧ ∀ u ∈ U, u ∈ S → + LinearIndependent ℝ (fun i => (A u).col (f i)) ∧ + Submodule.span ℝ (Set.range (fun i => (A u).col (f i))) = + Submodule.span ℝ (Set.range (A u).col) := by + obtain ⟨f, hf, hlin, _⟩ := matrix_independent_spanning_columns (A v) + obtain ⟨U, hU, hvU, hlocal⟩ := matrix_columns_independent_neighborhood A hA v f hlin + exact ⟨f, U, hf, hU, hvU, fun u hu hus => + ⟨hlocal u hu, matrix_columns_span_of_rank_le (A u) f (hlocal u hu) (hmax u hus)⟩⟩ + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/TangentIdentity.lean b/lean/OAI/Analysis/HyperbolicCones/TangentIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..25060cf81234ee40ee6c9e7ca02648fe35a90afb --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/TangentIdentity.lean @@ -0,0 +1,50 @@ +import OAI.Analysis.HyperbolicCones.KernelTangent +import OAI.Analysis.HyperbolicCones.TangentLimit +import OAI.Analysis.HyperbolicCones.OperatorEntries +import OAI.Analysis.HyperbolicCones.NormIdentity + +namespace OAI + +noncomputable section + +open scoped Matrix.Norms.L2Operator RealInnerProductSpace +open Matrix + +namespace Paper256 + +theorem NormalizedPencil.tangent_identity (P : NormalizedPencil) : + ∃ (v : Vec 4) (T : Vec 4 →ₗ[ℝ] Mat P.c ℝ), + ‖v‖ = 1 ∧ v 0 ≠ 0 ∧ ∀ h : Vec 4, inner ℝ v h = 0 → ∀ y : Fin 3 → ℝ, + choiLam (wedgeCoordinates v h) y = + operatorNorm (P.leftProjection v * P.B y * T h) ^ 2 := by + obtain ⟨v, T, hv, hv0, ht⟩ := kernel_projection_tangent_derivative P.c P.c_pos P.E + refine ⟨v, T, hv, hv0, ?_⟩ + intro h hh y + let M := mulLeftLinearMap (Fin P.c) ℝ (P.leftProjection v * P.B y) + let f : ℝ → Matrix (Fin P.a) (Fin P.c) ℝ := + fun s => P.leftProjection v * P.B y * P.rightProjection (tangentCurve v h s) + have hderiv : HasDerivAt f (P.leftProjection v * P.B y * T h) 0 := by + simpa only [f, M, NormalizedPencil.rightProjection, Function.comp_apply, + LinearMap.coe_toContinuousLinearMap', mulLeftLinearMap_apply] using! + M.toContinuousLinearMap.hasFDerivAt.comp_hasDerivAt 0 (ht h hh) + have hzero : f 0 = 0 := by + simpa [f, tangentCurve] using P.same_direction_zero v hv y + have hval (s : ℝ) : ‖f s‖ ^ 2 = + s ^ 2 / (1 + s ^ 2 * ‖h‖ ^ 2) * choiLam (wedgeCoordinates v h) y := by + have he := P.norm_identity (tangentCurve v h s) v + (tangentCurve_unit v h hv hh s) hv y + rw [tangentCurve_wedge, choiLam_smul_left, operatorNorm_eq_norm] at he + change (s / Real.sqrt (1 + s ^ 2 * ‖h‖ ^ 2)) ^ 2 * + choiLam (wedgeCoordinates v h) y = ‖f s‖ ^ 2 at he + rw [div_pow, Real.sq_sqrt (by positivity)] at he + exact he.symm + have hlim := norm_sq_derivative_of_quadratic_curve f + (P.leftProjection v * P.B y * T h) (choiLam (wedgeCoordinates v h) y) + (‖h‖ ^ 2) (sq_nonneg _) hderiv hzero hval + simpa only [operatorNorm_eq_norm] using hlim.symm + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/TangentLimit.lean b/lean/OAI/Analysis/HyperbolicCones/TangentLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..ac36ba10bb6c7fa6640436bf385057ded3d27435 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/TangentLimit.lean @@ -0,0 +1,39 @@ +import OAI.Analysis.HyperbolicCones.Model + +namespace OAI + +noncomputable section + +open scoped Topology +open Filter + +universe u + +namespace Paper256 + +theorem norm_sq_derivative_of_quadratic_curve + {F : Type u} [NormedAddCommGroup F] [NormedSpace ℝ F] + (f : ℝ → F) (v : F) (α β : ℝ) (hβ : 0 ≤ β) + (hf : HasDerivAt f v 0) (hzero : f 0 = 0) + (hval : ∀ s : ℝ, ‖f s‖ ^ 2 = s ^ 2 / (1 + s ^ 2 * β) * α) : + ‖v‖ ^ 2 = α := by + have ht : Tendsto (fun s : ℝ => ‖s⁻¹ • f s‖ ^ 2) (𝓝[≠] 0) (𝓝 (‖v‖ ^ 2)) := by + simpa only [zero_add, hzero, sub_zero] using hf.tendsto_slope_zero.norm.pow 2 + have hc : ContinuousAt (fun s : ℝ => α / (1 + s ^ 2 * β)) 0 := by + fun_prop (disch := norm_num) + have hr : Tendsto (fun s : ℝ => α / (1 + s ^ 2 * β)) (𝓝[≠] 0) (𝓝 α) := by + simpa using hc.tendsto.mono_left nhdsWithin_le_nhds + have he : (fun s : ℝ => ‖s⁻¹ • f s‖ ^ 2) =ᶠ[𝓝[≠] 0] + (fun s : ℝ => α / (1 + s ^ 2 * β)) := by + filter_upwards [self_mem_nhdsWithin] with s hs + have hs0 : s ≠ 0 := hs + have hd : 1 + s ^ 2 * β ≠ 0 := ne_of_gt (by positivity) + rw [norm_smul, Real.norm_eq_abs, mul_pow, sq_abs, hval] + field_simp + exact tendsto_nhds_unique ht (hr.congr' he.symm) + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/TangentObstruction.lean b/lean/OAI/Analysis/HyperbolicCones/TangentObstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..03bfd8f0d7a234fed17539a72033c92ec1889858 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/TangentObstruction.lean @@ -0,0 +1,14 @@ +import OAI.Analysis.HyperbolicCones.TangentIdentity +import OAI.Analysis.HyperbolicCones.TangentRigidity + +namespace OAI + +namespace Paper256 + +theorem NormalizedPencil.impossible (P : NormalizedPencil) : False := by + obtain ⟨v, T, hv, hv0, hformula⟩ := P.tangent_identity + exact impossible_of_tangent_formula P v T hv hv0 hformula + +end Paper256 + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/TangentRigidity.lean b/lean/OAI/Analysis/HyperbolicCones/TangentRigidity.lean new file mode 100644 index 0000000000000000000000000000000000000000..6fcede54ec776792dcd02024ad5919322705497e --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/TangentRigidity.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.HyperbolicCones.TangentBasic +import OAI.Analysis.HyperbolicCones.OperatorEntries +import OAI.Analysis.HyperbolicCones.FormRigidity + +namespace OAI + +noncomputable section + +open scoped Matrix.Norms.L2Operator RealInnerProductSpace +open Matrix + +namespace Paper256 + +theorem impossible_of_tangent_formula (P : NormalizedPencil) + (v : Vec 4) (T : Vec 4 →ₗ[ℝ] Mat P.c ℝ) + (hv : ‖v‖ = 1) (hv0 : v 0 ≠ 0) + (hformula : ∀ h : Vec 4, inner ℝ v h = 0 → ∀ y : Fin 3 → ℝ, + choiLam (wedgeCoordinates v h) y = + operatorNorm (P.leftProjection v * P.B y * T h) ^ 2) : False := by + obtain ⟨J, hJ⟩ := tangent_coordinates_isomorphism v hv hv0 + let D : (Fin 3 → ℝ) →ₗ[ℝ] Mat P.c ℝ := + T.comp ((tangentSpace v).subtype.comp J.symm.toLinearMap) + let C : (Fin 3 → ℝ) →ₗ[ℝ] Matrix (Fin P.a) (Fin P.c) ℝ := + (mulLeftLinearMap (Fin P.c) ℝ (P.leftProjection v)).comp P.B + let b : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] Matrix (Fin P.a) (Fin P.c) ℝ := + (mulLinearMap ℝ).flip.compl₁₂ D C + have hb (z y : Fin 3 → ℝ) : choiLam z y = operatorNorm (b z y) ^ 2 := by + have ht : inner ℝ v (J.symm z).val = 0 := (J.symm z).property + have hj : wedgeCoordinates v (J.symm z).val = z := by + rw [← hJ, J.apply_symm_apply] + change choiLam z y = operatorNorm (P.leftProjection v * P.B y * T (J.symm z).val) ^ 2 + simpa only [hj] using hformula (J.symm z).val ht y + have hz (z y : Fin 3 → ℝ) : b z y = 0 := by + ext i j + let l : (Fin 3 → ℝ) →ₗ[ℝ] (Fin 3 → ℝ) →ₗ[ℝ] ℝ := + b.compr₂ (Matrix.entryLinearMap ℝ ℝ i j) + have hl : l = 0 := choiLam_no_dominated_square l (fun z y => by + change (b z y i j) ^ 2 ≤ choiLam z y + rw [hb] + exact entry_sq_le_operatorNorm_sq (b z y) i j) + have he := LinearMap.congr_fun (LinearMap.congr_fun hl z) y + exact he + have hc := hb ![1, 0, 0] ![1, 0, 0] + rw [choiLam_nonzero, hz, operatorNorm_eq_norm, norm_zero, zero_pow (by decide)] at hc + exact one_ne_zero hc + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/HyperbolicCones/ZeroPolynomial.lean b/lean/OAI/Analysis/HyperbolicCones/ZeroPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..c59f99875be780811c72abe461404731ca37fe45 --- /dev/null +++ b/lean/OAI/Analysis/HyperbolicCones/ZeroPolynomial.lean @@ -0,0 +1,55 @@ +import OAI.Analysis.HyperbolicCones.LineEvaluation +import OAI.Analysis.HyperbolicCones.MatrixBasic + +namespace OAI + +noncomputable section + +open Matrix Polynomial +open scoped Matrix.Norms.L2Operator + +universe u + +namespace Paper256 + +theorem matrixValue_zero_parameter {K : Type u} [CommRing K] (X Z : Mat 4 K) : + matrixValue X Z (0 : Fin 3 → K) = X.det ^ 4 * Z.det := by + rw [matrixValue, phi_zero_parameter, sub_zero, Matrix.det_smul] + rfl + +theorem linePolynomial_zero_parameter (X Z : Sym 4) : + linePolynomial ((X, Z), (0 : Fin 3 → ℝ)) = + (X : Mat 4 ℝ).charpoly ^ 4 * (Z : Mat 4 ℝ).charpoly := by + apply Polynomial.funext + intro t + have he := linePolynomial_eval₂ (RingHom.id ℝ) X Z (0 : Fin 3 → ℝ) t + simp only [Polynomial.eval₂_id, RingHom.id_apply, Pi.zero_apply, + neg_zero] at he + rw [he] + change matrixValue (t • 1 - (X : Mat 4 ℝ)) (t • 1 - (Z : Mat 4 ℝ)) + (0 : Fin 3 → ℝ) = _ + rw [matrixValue_zero_parameter] + simp only [Polynomial.eval_mul, Polynomial.eval_pow, Matrix.eval_charpoly] + have hs : Matrix.scalar (Fin 4) t = t • (1 : Mat 4 ℝ) := by + ext i j + simp [Matrix.scalar, Matrix.diagonal, Matrix.one_apply, Matrix.smul_apply] + rw [hs] + +theorem linePolynomial_repeated_roots : + linePolynomial ((1, 0), 0) = (Polynomial.X - 1) ^ 16 * Polynomial.X ^ 4 := by + rw [linePolynomial_zero_parameter] + simp [Matrix.charpoly_one, Matrix.charpoly_zero, ← pow_mul] + +theorem repeated_root_point_not_scalar_basePoint : + ¬ ∃ t : ℝ, (((1, 0), 0) : Ambient) = t • basePoint := by + rintro ⟨t, ht⟩ + have hx := congrArg (fun x : Ambient => (x.1.1 : Mat 4 ℝ) 0 0) ht + have hz := congrArg (fun x : Ambient => (x.1.2 : Mat 4 ℝ) 0 0) ht + simp [basePoint] at hx hz + linarith + +end Paper256 + +end + +end OAI diff --git a/lean/OAI/Analysis/Hyperinvariant.lean b/lean/OAI/Analysis/Hyperinvariant.lean new file mode 100644 index 0000000000000000000000000000000000000000..bdc51c109ca6bf30c20398bdbd296adccb4564a1 --- /dev/null +++ b/lean/OAI/Analysis/Hyperinvariant.lean @@ -0,0 +1 @@ +import OAI.Analysis.Hyperinvariant.Main diff --git a/lean/OAI/Analysis/Hyperinvariant/CommutantTopology.lean b/lean/OAI/Analysis/Hyperinvariant/CommutantTopology.lean new file mode 100644 index 0000000000000000000000000000000000000000..402a35d82c4259f68e8c4d8dcd5c1c5aae63b854 --- /dev/null +++ b/lean/OAI/Analysis/Hyperinvariant/CommutantTopology.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.Hyperinvariant.Specification +import Mathlib.Analysis.LocallyConvex.SeparatingDual +import Mathlib.Analysis.Normed.Operator.Mul +import Mathlib.Topology.Separation.Hausdorff + +namespace OAI + +namespace Hyperinvariant +open Filter +open scoped Topology +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +/-- Membership is commutation in all bounded operators on H. -/ +theorem mem_commutant_iff (T A : H →L[ℂ] H) : + A ∈ commutant T ↔ A * T = T * A := by + simp only [commutant, Subalgebra.mem_centralizer_iff, Set.mem_singleton_iff, forall_eq] + exact eq_comm + +/-- The ordinary commutant is closed for the pointwise-norm strong-operator topology. -/ +theorem commutant_isClosed_strong [CompleteSpace H] (T : H →L[ℂ] H) : + @IsClosed (H →L[ℂ] H) strongOperatorTopology (commutant T : Set (H →L[ℂ] H)) := by + let : TopologicalSpace (H →L[ℂ] H) := strongOperatorTopology + have heval : ∀ x : H, Continuous (fun A : H →L[ℂ] H => A x) := by + intro x + exact (continuous_apply x).comp continuous_induced_dom + have hset : (commutant T : Set (H →L[ℂ] H)) = + ⋂ x : H, {A : H →L[ℂ] H | A (T x) = T (A x)} := by + ext A + simp only [Set.mem_iInter, Set.mem_ofPred_eq, SetLike.mem_coe, mem_commutant_iff] + constructor + · intro h x + exact congrArg (fun B : H →L[ℂ] H => B x) h + · intro h + ext x + exact h x + rw [hset] + exact isClosed_iInter (fun x => isClosed_eq (heval (T x)) (T.continuous.comp (heval x))) + +/-- If an operator commutes with every bounded operator, it is scalar. +The center is scalar because the continuous dual separates points. -/ +theorem scalar_of_commutant_top [CompleteSpace H] (T : H →L[ℂ] H) + (h : commutant T = ⊤) : + ∃ c : ℂ, algebraMap ℂ (H →L[ℂ] H) c = T := by + have hc : T ∈ Subalgebra.center ℂ (H →L[ℂ] H) := by + rw [Subalgebra.mem_center_iff] + intro A + apply (mem_commutant_iff T A).mp + rw [h] + trivial + rw [Algebra.IsCentral.center_eq_bot] at hc + exact Algebra.mem_bot.mp hc + +/-- Nonzero norm-quasinilpotence excludes scalar bounded operators. This +uses the actual root-norm limit from the statement, not a spectral surrogate. -/ +theorem commutant_ne_top_of_nonzero_quasinilpotent [CompleteSpace H] [Nontrivial H] + (T : H →L[ℂ] H) (hT : T ≠ 0) + (hlim : Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) atTop (𝓝 0)) : + commutant T ≠ ⊤ := by + intro htop + obtain ⟨c, hc⟩ := scalar_of_commutant_top T htop + have hroot (n : ℕ) (hn : n ≠ 0) : ‖T ^ n‖ ^ (1 / (n : ℝ)) = ‖c‖ := by + rw [← hc, Algebra.algebraMap_eq_smul_one, smul_pow, one_pow, + norm_smul, norm_pow, norm_one, mul_one, one_div] + exact Real.pow_rpow_inv_natCast (norm_nonneg c) hn + have hevent : (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) =ᶠ[atTop] + (fun _ : ℕ => ‖c‖) := by + filter_upwards [eventually_gt_atTop 0] with n hn + exact hroot n (Nat.ne_of_gt hn) + have hconst : Tendsto (fun _ : ℕ => ‖c‖) atTop (𝓝 0) := hlim.congr' hevent + have hc0 : ‖c‖ = 0 := tendsto_nhds_unique tendsto_const_nhds hconst + apply hT + rw [← hc, norm_eq_zero.mp hc0, map_zero] + +variable [CompleteSpace H] + +/-- Adds the two generic commutant conclusions to a genuine main witness. -/ +theorem fullClaim_of_mainClaim [Nontrivial H] (h : MainClaim (H := H)) : + FullClaim (H := H) := by + obtain ⟨T, hT, hlim, htrans⟩ := h + exact ⟨T, hT, hlim, htrans, + commutant_ne_top_of_nonzero_quasinilpotent T hT hlim, + commutant_isClosed_strong T⟩ + +end Hyperinvariant + +end OAI diff --git a/lean/OAI/Analysis/Hyperinvariant/HilbertClassification.lean b/lean/OAI/Analysis/Hyperinvariant/HilbertClassification.lean new file mode 100644 index 0000000000000000000000000000000000000000..d91ca86980ba85b51a7666a0b221c3c046c5caf8 --- /dev/null +++ b/lean/OAI/Analysis/Hyperinvariant/HilbertClassification.lean @@ -0,0 +1,67 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Topology.Bases +import Mathlib.Basic.Denumerable + +namespace OAI + +namespace Hyperinvariant +open Submodule TopologicalSpace +universe u v +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +/-- An orthonormal subset of a separable Hilbert space is countable. -/ +theorem orthonormal_subtype_countable [CompleteSpace H] [SeparableSpace H] (w : Set H) + (hw : Orthonormal ℂ (Subtype.val : w → H)) : Countable w := by + classical + let : DiscreteTopology w := discreteTopology_iff_isOpen_singleton.mpr (by + intro i + have ho : IsOpen {j : w | (1 / 2 : ℝ) < ‖inner ℂ (i : H) (j : H)‖} := + isOpen_lt continuous_const (continuous_const.inner continuous_subtype_val).norm + have he : {j : w | (1 / 2 : ℝ) < ‖inner ℂ (i : H) (j : H)‖} = {i} := by + ext j + rw [Set.mem_ofPred_eq, orthonormal_iff_ite.mp hw i j] + by_cases hij : i = j <;> simp [hij, eq_comm]; norm_num + rwa [he] at ho) + exact separableSpace_iff_countable.mp inferInstance + +variable [CompleteSpace H] [SeparableSpace H] + +/-- Every infinite-dimensional separable complex Hilbert space has a +Hilbert basis indexed by the natural numbers. -/ +theorem exists_nat_hilbertBasis (hInf : ¬FiniteDimensional ℂ H) : + Nonempty (HilbertBasis ℕ ℂ H) := by + classical + obtain ⟨w, b, hb⟩ := exists_hilbertBasis ℂ H + have hw : Orthonormal ℂ (Subtype.val : w → H) := by + simpa only [hb] using b.orthonormal + let : Countable w := orthonormal_subtype_countable w hw + let : Infinite w := by + refine not_finite_iff_infinite.mp ?_ + intro hfin + let : Finite w := hfin + let : Fintype w := Fintype.ofFinite w + exact hInf (Module.Finite.of_basis b.toOrthonormalBasis.toBasis) + let e : ℕ ≃ w := Classical.choice (inferInstance : Nonempty (ℕ ≃ w)) + have ho : Orthonormal ℂ (b ∘ e) := b.orthonormal.comp e e.injective + have hr : Set.range (b ∘ e) = Set.range b := by + ext x + constructor + · rintro ⟨n, rfl⟩ + exact ⟨e n, rfl⟩ + · rintro ⟨i, rfl⟩ + exact ⟨e.symm i, by simp⟩ + exact ⟨HilbertBasis.mk ho (by rw [hr, b.dense_span])⟩ + +/-- This handles arbitrary ambient Hilbert spaces, not just a canonical model. -/ +theorem nonempty_linearIsometryEquiv + {K : Type v} [NormedAddCommGroup K] [InnerProductSpace ℂ K] + [CompleteSpace K] [SeparableSpace K] + (hH : ¬FiniteDimensional ℂ H) (hK : ¬FiniteDimensional ℂ K) : + Nonempty (H ≃ₗᵢ[ℂ] K) := by + obtain ⟨bH⟩ := exists_nat_hilbertBasis hH + obtain ⟨bK⟩ := exists_nat_hilbertBasis hK + exact ⟨bH.repr.trans bK.repr.symm⟩ + +end Hyperinvariant + +end OAI diff --git a/lean/OAI/Analysis/Hyperinvariant/Main.lean b/lean/OAI/Analysis/Hyperinvariant/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..39d61aca6d5f40b886cc548db2204219f932c613 --- /dev/null +++ b/lean/OAI/Analysis/Hyperinvariant/Main.lean @@ -0,0 +1,27 @@ +import OAI.Analysis.Hyperinvariant.Witness +import OAI.Analysis.Hyperinvariant.HilbertClassification +import OAI.Analysis.Hyperinvariant.Transport +import OAI.Analysis.Hyperinvariant.CommutantTopology + +namespace OAI + +namespace Hyperinvariant +universe u +variable (H : Type u) [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] [TopologicalSpace.SeparableSpace H] + +/-- Every infinite-dimensional separable complex Hilbert space admits a nonzero +norm-quasinilpotent operator with a proper strongly closed transitive commutant. -/ +theorem main_theorem (hInf : ¬FiniteDimensional ℂ H) : FullClaim (H := H) := by + let : Nontrivial H := not_subsingleton_iff_nontrivial.mp (by + intro hs + let : Subsingleton H := hs + exact hInf inferInstance) + obtain ⟨e⟩ := nonempty_linearIsometryEquiv + (H := FiniteFactor.SourceHilbert FiniteFactor.SourceCoordinate) + (K := H) source_infiniteDimensional hInf + exact fullClaim_of_mainClaim (mainClaim_transport e source_mainClaim) + +end Hyperinvariant + +end OAI diff --git a/lean/OAI/Analysis/Hyperinvariant/ProjectionBridge.lean b/lean/OAI/Analysis/Hyperinvariant/ProjectionBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..ab6cab4a02243ce0ce604b29399e557e875f24c0 --- /dev/null +++ b/lean/OAI/Analysis/Hyperinvariant/ProjectionBridge.lean @@ -0,0 +1,46 @@ +import OAI.Analysis.Hyperinvariant.Specification + +namespace OAI + +namespace Hyperinvariant +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- Triviality of invariant projections in a von Neumann algebra implies +hyperinvariant-subspace triviality in the entire bounded-operator algebra. -/ +theorem transitiveCommutant_of_invariantProjections + (M : VonNeumannAlgebra H) (T : H →L[ℂ] H) (hT : T ∈ M) + (hproj : ∀ p ∈ M, IsStarProjection p → (1 - p) * T * p = 0 → + p = 0 ∨ p = 1) : TransitiveCommutant T := by + intro K hK hInv + let : CompleteSpace K := hK.completeSpace_coe + have hp : IsStarProjection K.starProjection := isStarProjection_starProjection + have hpM : K.starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff hp M).2 + intro A hA + rw [Submodule.range_starProjection] + rw [Module.End.mem_invtSubmodule_iff_forall_mem_of_mem] + exact hInv A ((VonNeumannAlgebra.mem_commutant_iff.mp hA) T hT).symm + have hi : (1 - K.starProjection) * T * K.starProjection = 0 := by + ext x + have hm : T (K.starProjection x) ∈ K := + hInv T rfl _ (K.starProjection_apply_mem x) + simp only [mul_apply_eq_comp, sub_apply, one_apply_eq_self, zero_apply] + exact sub_eq_zero.mpr (Submodule.starProjection_eq_self_iff.mpr hm).symm + rcases hproj K.starProjection hpM hp hi with hz | ho + · left + apply le_antisymm _ bot_le + intro x hx + have hf : K.starProjection x = x := Submodule.starProjection_eq_self_iff.mpr hx + have he : K.starProjection x = 0 := congrArg (fun A : H →L[ℂ] H => A x) hz + exact hf.symm.trans he + · right + apply le_antisymm le_top + intro x _ + have he : K.starProjection x = x := congrArg (fun A : H →L[ℂ] H => A x) ho + have hm := K.starProjection_apply_mem x + rwa [he] at hm + +end Hyperinvariant + +end OAI diff --git a/lean/OAI/Analysis/Hyperinvariant/Specification.lean b/lean/OAI/Analysis/Hyperinvariant/Specification.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ebac126d70445ccf72296737c0c49f40606ee03 --- /dev/null +++ b/lean/OAI/Analysis/Hyperinvariant/Specification.lean @@ -0,0 +1,42 @@ +import Mathlib.Analysis.VonNeumannAlgebra.Basic +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Analysis.Normed.Module.FiniteDimension + +namespace OAI + +namespace Hyperinvariant +open Filter +open scoped Topology +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- The ordinary commutant in all bounded operators, not only in a chosen factor. -/ +def commutant (T : H →L[ℂ] H) : Subalgebra ℂ (H →L[ℂ] H) := + Subalgebra.centralizer ℂ ({T} : Set (H →L[ℂ] H)) + +/-- Closed common invariant subspaces, including all closed complex subspaces. -/ +def TransitiveCommutant (T : H →L[ℂ] H) : Prop := + ∀ K : Submodule ℂ H, IsClosed (K : Set H) → + (∀ A : H →L[ℂ] H, A * T = T * A → ∀ x ∈ K, A x ∈ K) → + K = ⊥ ∨ K = ⊤ + +/-- Pointwise norm convergence restricted to bounded linear operators. -/ +@[instance_reducible] def strongOperatorTopology : TopologicalSpace (H →L[ℂ] H) := + TopologicalSpace.induced (fun A : H →L[ℂ] H => (fun x : H => A x)) inferInstance + +/-- Nonzero, norm-quasinilpotent, and with no nontrivial closed hyperinvariant subspace. -/ +def MainClaim : Prop := + ∃ T : H →L[ℂ] H, T ≠ 0 ∧ + Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) atTop (𝓝 0) ∧ + TransitiveCommutant T + +/-- The same witness has a proper strongly closed unital complex commutant. -/ +def FullClaim : Prop := + ∃ T : H →L[ℂ] H, T ≠ 0 ∧ + Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) atTop (𝓝 0) ∧ + TransitiveCommutant T ∧ commutant T ≠ ⊤ ∧ + @IsClosed (H →L[ℂ] H) strongOperatorTopology (commutant T : Set (H →L[ℂ] H)) + +end Hyperinvariant + +end OAI diff --git a/lean/OAI/Analysis/Hyperinvariant/Transport.lean b/lean/OAI/Analysis/Hyperinvariant/Transport.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe475226525e094276d0383036092edf42a86795 --- /dev/null +++ b/lean/OAI/Analysis/Hyperinvariant/Transport.lean @@ -0,0 +1,75 @@ +import OAI.Analysis.Hyperinvariant.Specification + +namespace OAI + +namespace Hyperinvariant +open Filter +open scoped Topology +universe u v +variable {H : Type u} {K : Type v} + [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup K] [InnerProductSpace ℂ K] [CompleteSpace K] + +theorem norm_conjugate_le (e : H ≃ₗᵢ[ℂ] K) (T : H →L[ℂ] H) : + ‖e.conjStarAlgEquiv T‖ ≤ ‖T‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) + intro x + change ‖e (T (e.symm x))‖ ≤ ‖T‖ * ‖x‖ + rw [e.norm_map] + simpa only [e.symm.norm_map] using T.le_opNorm (e.symm x) + +theorem norm_conjugate (e : H ≃ₗᵢ[ℂ] K) (T : H →L[ℂ] H) : + ‖e.conjStarAlgEquiv T‖ = ‖T‖ := by + apply le_antisymm (norm_conjugate_le e T) + have he : e.symm.conjStarAlgEquiv (e.conjStarAlgEquiv T) = T := by + ext x + simp only [LinearIsometryEquiv.conjStarAlgEquiv_apply_apply, + LinearIsometryEquiv.symm_symm, LinearIsometryEquiv.symm_apply_apply] + have h := norm_conjugate_le e.symm (e.conjStarAlgEquiv T) + rwa [he] at h + +/-- Hyperinvariance is transported through a genuine surjective complex-linear isometry. -/ +theorem transitiveCommutant_conjugate (e : H ≃ₗᵢ[ℂ] K) (T : H →L[ℂ] H) + (hT : TransitiveCommutant T) : TransitiveCommutant (e.conjStarAlgEquiv T) := by + intro W hW hInv + let U : Submodule ℂ H := W.comap e.toLinearMap + have hU : IsClosed (U : Set H) := hW.preimage e.continuous + have hUI : ∀ A : H →L[ℂ] H, A * T = T * A → ∀ x ∈ U, A x ∈ U := by + intro A hA x hx + change e (A x) ∈ W + have hc : e.conjStarAlgEquiv A * e.conjStarAlgEquiv T = + e.conjStarAlgEquiv T * e.conjStarAlgEquiv A := by + simpa only [map_mul] using congrArg e.conjStarAlgEquiv hA + have hm := hInv (e.conjStarAlgEquiv A) hc (e x) hx + simpa using hm + rcases hT U hU hUI with hz | ho + · left + apply le_antisymm _ bot_le + intro y hy + have hx : e.symm y ∈ U := by change e (e.symm y) ∈ W; simpa using hy + rw [hz] at hx + have hzero : e.symm y = 0 := hx + have := congrArg e hzero + simpa using this + · right + apply le_antisymm le_top + intro y _ + have hx : e.symm y ∈ U := by rw [ho]; trivial + change e (e.symm y) ∈ W at hx + simpa using hx + +/-- Nonzero and the exact norm-root limit are both preserved by unitary conjugation. -/ +theorem mainClaim_transport (e : H ≃ₗᵢ[ℂ] K) (h : MainClaim (H := H)) : + MainClaim (H := K) := by + obtain ⟨T, hT0, hq, ht⟩ := h + refine ⟨e.conjStarAlgEquiv T, ?_, ?_, transitiveCommutant_conjugate e T ht⟩ + · exact fun hzero => hT0 (e.conjStarAlgEquiv.injective (by simpa using hzero)) + · have he : (fun n : ℕ => ‖(e.conjStarAlgEquiv T) ^ n‖ ^ (1 / (n : ℝ))) = + (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) := by + funext n + rw [← map_pow, norm_conjugate] + rwa [he] + +end Hyperinvariant + +end OAI diff --git a/lean/OAI/Analysis/Hyperinvariant/Witness.lean b/lean/OAI/Analysis/Hyperinvariant/Witness.lean new file mode 100644 index 0000000000000000000000000000000000000000..385a697ab4adcc551df116be192267903e64b242 --- /dev/null +++ b/lean/OAI/Analysis/Hyperinvariant/Witness.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.Hyperinvariant.ProjectionBridge +import OAI.Analysis.FiniteFactor.CrossedProduct.PreparedFactor +import OAI.Analysis.FiniteFactor.CrossedProduct.InvariantProjection +import OAI.Analysis.FiniteFactor.CrossedProduct.HilbertSeparable +import OAI.Analysis.FiniteFactor.Matrix.Entries + +namespace OAI + +namespace Hyperinvariant +open FiniteFactor MeasureTheory Filter +open scoped Topology +noncomputable section + +/-- The fiber indicators form an orthonormal family in the complex Hilbert space. -/ +theorem source_basis_orthonormal : Orthonormal ℂ sourceBasis := by + classical + apply orthonormal_iff_ite.mpr + intro i j + rw [sourceBasis, sourceBasis, sourceFiberIndicator, sourceFiberIndicator, + L2.inner_indicatorConstLp_one_indicatorConstLp_one + (hμs := sourceFiberMeasure_ne_top Set.univ i) + (hμt := sourceFiberMeasure_ne_top Set.univ j)] + by_cases hij : i = j + · subst j + simp [measureReal_def, sourceMeasure, Measure.prod_prod] + · have he : ((Set.univ : Set (SourceCoordinate → ℝ)) ×ˢ {i}) ∩ + (Set.univ ×ˢ {j}) = ∅ := by + ext z + simp only [Set.mem_inter_iff, Set.mem_prod, Set.mem_univ, Set.mem_singleton_iff, + true_and, Set.mem_empty_iff_false, iff_false, not_and] + exact fun hi hj => hij (hi.symm.trans hj) + simp [he, hij] + +theorem source_infiniteDimensional : ¬FiniteDimensional ℂ (SourceHilbert SourceCoordinate) := by + intro hfin + let : FiniteDimensional ℂ (SourceHilbert SourceCoordinate) := hfin + exact Module.Finite.not_linearIndependent_of_infinite sourceBasis + source_basis_orthonormal.linearIndependent + +/-- The finite-factor construction yields a nonzero norm-quasinilpotent operator +whose ordinary commutant has no nontrivial closed invariant subspace. -/ +theorem source_mainClaim : MainClaim (H := SourceHilbert SourceCoordinate) := by + obtain ⟨θ, hr, hphase, hs, _he, _hcenter, _hfinite, _hminimal, _hpredual, + hθ, hT, hT0, _hinj, _hcontract, hqn⟩ := exists_source_prepared_factor + refine ⟨sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg, + hT0, hqn, ?_⟩ + apply transitiveCommutant_of_invariantProjections (sourceAlgebra θ) _ hT + intro p hp hproj hinv + exact sourceInvariantProjection_trivial θ hθ hr hs hphase hp hproj hinv + +end +end Hyperinvariant + +end OAI diff --git a/lean/OAI/Analysis/IncompressibleFlow/AffineExtension.lean b/lean/OAI/Analysis/IncompressibleFlow/AffineExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..deb271df6a6a93125a5eb982361aadcaa2f3e082 --- /dev/null +++ b/lean/OAI/Analysis/IncompressibleFlow/AffineExtension.lean @@ -0,0 +1,715 @@ +import Mathlib + +namespace OAI + +/-! Solid-box geometry and compactly supported solenoidal extensions of diagonal affine fields. -/ + +namespace BoxTransport + +noncomputable section +open scoped BigOperators ContDiff + +abbrev Space := Fin 3 → ℝ +abbrev Spacetime := Fin 4 → ℝ +abbrev RationalPoint := Fin 3 → ℚ +abbrev Velocity := ℝ → Space → Space + +def solidBox (c h : Space) : Set Space := + {x | ∀ j, |x j - c j| ≤ h j} + +def ofRat (q : RationalPoint) : Space := fun j => (q j : ℝ) + +def rationalBox (c h : RationalPoint) : Set Space := + solidBox (ofRat c) (ofRat h) + +def assignedMap (a b h k : RationalPoint) (x : Space) : Space := + fun j => (b j : ℝ) + ((k j / h j : ℚ) : ℝ) * (x j - (a j : ℝ)) + +def inCoordinates (V : Velocity) : Spacetime → Space := + fun z => V (z 0) (fun j => z j.succ) + +noncomputable def mixedPartial : List (Fin 4) → (Spacetime → Space) → Spacetime → Space + | [], F => F + | j :: js, F => fun z => fderiv ℝ (mixedPartial js F) z (Pi.single j 1) + +abbrev RationalCode := ℤ × ℕ +abbrev PointCode := RationalCode × RationalCode × RationalCode × RationalCode +abbrev DerivativeQuery := List (Fin 4) × Fin 3 × PointCode × ℕ + +def decodeRational (q : RationalCode) : ℝ := + (q.1 : ℝ) / ((q.2 : ℝ) + 1) + +def decodePoint (q : PointCode) : Spacetime := + ![decodeRational q.1, decodeRational q.2.1, + decodeRational q.2.2.1, decodeRational q.2.2.2] + +def dyadicError (n : ℕ) : ℝ := (1 / 2 : ℝ) ^ n + +def EffectiveField (V : Velocity) : Prop := + ∃ evaluate : DerivativeQuery → RationalCode, + ∃ precision : List (Fin 4) × ℕ → ℕ, + ∃ bound : List (Fin 4) → ℕ, + Computable evaluate ∧ Computable precision ∧ Computable bound ∧ + (∀ d j q n z, + (∀ l, |z l - decodePoint q l| ≤ dyadicError (precision (d, n))) → + |mixedPartial d (inCoordinates V) z j - decodeRational (evaluate (d, j, q, n))| + ≤ dyadicError n) ∧ + (∀ d z j, |mixedPartial d (inCoordinates V) z j| ≤ (bound d : ℝ)) + +noncomputable def divergence (V : Velocity) (t : ℝ) (x : Space) : ℝ := + ∑ j : Fin 3, (fderiv ℝ (V t) x (Pi.single j 1)) j + +def Solenoidal (V : Velocity) : Prop := ∀ t x, divergence V t x = 0 + +def IsMaterialFlow (V : Velocity) (Φ : ℝ → Space → Space) : Prop := + (∀ x, Φ 0 x = x) ∧ + ∀ x t, HasDerivAt (fun s => Φ s x) (V t (Φ t x)) t + +def RoutingConclusion {N : ℕ} (a b h k : Fin N → RationalPoint) : Prop := + ∃ V : Velocity, ∃ Φ : ℝ → Space → Space, + ContDiff ℝ ∞ (inCoordinates V) ∧ + HasCompactSupport (inCoordinates V) ∧ + Solenoidal V ∧ + (∀ t, t ∉ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) → ∀ x, V t x = 0) ∧ + EffectiveField V ∧ + IsMaterialFlow V Φ ∧ + ∀ i, ∃ U : Set Space, IsOpen U ∧ rationalBox (a i) (h i) ⊆ U ∧ + ∀ x ∈ U, Φ 1 x = assignedMap (a i) (b i) (h i) (k i) x + +@[simp] theorem mem_solidBox {c h x : Space} : + x ∈ solidBox c h ↔ ∀ j, |x j - c j| ≤ h j := Iff.rfl + +theorem center_mem_solidBox (c h : Space) (hh : ∀ j, 0 ≤ h j) : + c ∈ solidBox c h := by + simpa only [mem_solidBox, sub_self, abs_zero] using hh + +theorem solidBox_eq_pi (c h : Space) : + solidBox c h = Set.univ.pi (fun j => Set.Icc (c j - h j) (c j + h j)) := by + ext x + simp only [mem_solidBox, Set.mem_pi, Set.mem_univ, true_implies, Set.mem_Icc] + apply forall_congr' + intro j + rw [abs_le] + constructor <;> rintro ⟨h₁, h₂⟩ <;> constructor <;> linarith + +theorem isCompact_solidBox (c h : Space) : IsCompact (solidBox c h) := by + rw [solidBox_eq_pi] + exact isCompact_univ_pi (fun _ => isCompact_Icc) + +theorem disjoint_solidBox_of_gap {a b h k : Space} {j : Fin 3} + (hgap : h j + k j < |a j - b j|) : + Disjoint (solidBox a h) (solidBox b k) := by + rw [Set.disjoint_left] + intro x hxa hxb + have ha := (abs_le.mp (hxa j)) + have hb := (abs_le.mp (hxb j)) + have : |a j - b j| ≤ h j + k j := abs_le.mpr (by constructor <;> linarith) + exact (not_lt_of_ge this) hgap + +theorem disjoint_solidBox_iff {a b h k : Space} + (hh : ∀ j, 0 ≤ h j) (hk : ∀ j, 0 ≤ k j) : + Disjoint (solidBox a h) (solidBox b k) ↔ + ∃ j, h j + k j < |a j - b j| := by + constructor + · intro hd + by_contra! hgap + let x : Space := fun j => max (a j - h j) (b j - k j) + have hxa : x ∈ solidBox a h := by + intro j + have hj := abs_le.mp (hgap j) + have hl : a j - h j ≤ x j := le_max_left _ _ + have hu : x j ≤ a j + h j := max_le (by linarith [hh j]) (by linarith) + exact abs_le.mpr (by constructor <;> linarith) + have hxb : x ∈ solidBox b k := by + intro j + have hj := abs_le.mp (hgap j) + have hl : b j - k j ≤ x j := le_max_right _ _ + have hu : x j ≤ b j + k j := max_le (by linarith) (by linarith [hk j]) + exact abs_le.mpr (by constructor <;> linarith) + exact Set.disjoint_left.mp hd hxa hxb + · rintro ⟨j, hj⟩ + exact disjoint_solidBox_of_gap hj + +theorem centers_ne_of_disjoint {a b h k : Space} + (hh : ∀ j, 0 ≤ h j) (hk : ∀ j, 0 ≤ k j) + (hd : Disjoint (solidBox a h) (solidBox b k)) : a ≠ b := by + intro hab + subst b + exact Set.disjoint_left.mp hd (center_mem_solidBox a h hh) + (center_mem_solidBox a k hk) + +theorem gap_le_expanded_gap (a b h k : Space) (j : Fin 3) {lam : ℝ} + (hlam : 1 ≤ lam) : + |a j - b j| - h j - k j ≤ |lam * a j - lam * b j| - h j - k j := by + rw [← mul_sub, abs_mul, abs_of_nonneg (by linarith : 0 ≤ lam)] + nlinarith [abs_nonneg (a j - b j)] + +theorem disjoint_solidBox_expand {a b h k : Space} {lam : ℝ} + (hh : ∀ j, 0 ≤ h j) (hk : ∀ j, 0 ≤ k j) (hlam : 1 ≤ lam) + (hd : Disjoint (solidBox a h) (solidBox b k)) : + Disjoint (solidBox (fun j => lam * a j) h) (solidBox (fun j => lam * b j) k) := by + obtain ⟨j, hj⟩ := (disjoint_solidBox_iff hh hk).mp hd + apply disjoint_solidBox_of_gap (j := j) + have hg := gap_le_expanded_gap a b h k j hlam + linarith + +theorem disjoint_padded_solidBox {a b h k : Space} {η : ℝ} {j : Fin 3} + (hgap : 4 * η < |a j - b j| - h j - k j) : + Disjoint (solidBox a (fun j => h j + 2 * η)) + (solidBox b (fun j => k j + 2 * η)) := by + apply disjoint_solidBox_of_gap (j := j) + linarith + +def diagonalAffine (a b s : Space) (x : Space) : Space := + fun j => b j + s j * (x j - a j) + +theorem diagonalAffine_mem_iff {a b h s x : Space} (hs : ∀ j, 0 < s j) : + diagonalAffine a b s x ∈ solidBox b (fun j => s j * h j) ↔ + x ∈ solidBox a h := by + simp only [mem_solidBox, diagonalAffine, add_sub_cancel_left, abs_mul, + abs_of_pos (hs _), mul_le_mul_iff_right₀ (hs _)] + +theorem diagonalAffine_inverse (a b s x : Space) (hs : ∀ j, s j ≠ 0) : + diagonalAffine b a (fun j => (s j)⁻¹) (diagonalAffine a b s x) = x := by + ext j + simp only [diagonalAffine, add_sub_cancel_left] + rw [← mul_assoc, inv_mul_cancel₀ (hs j), one_mul] + ring + +theorem diagonalAffine_image (a b h s : Space) (hs : ∀ j, 0 < s j) : + diagonalAffine a b s '' solidBox a h = solidBox b (fun j => s j * h j) := by + ext x + constructor + · rintro ⟨y, hy, rfl⟩ + exact (diagonalAffine_mem_iff hs).mpr hy + · intro hx + let y := diagonalAffine b a (fun j => (s j)⁻¹) x + have hxy : diagonalAffine a b s y = x := by + ext j + dsimp [y, diagonalAffine] + rw [add_sub_cancel_left, ← mul_assoc, mul_inv_cancel₀ (ne_of_gt (hs j)), one_mul] + ring + refine ⟨y, ?_, hxy⟩ + exact (diagonalAffine_mem_iff hs).mp (hxy.symm ▸ hx) + +theorem assignedMap_image (a b h k : RationalPoint) + (hh : ∀ j, 0 < h j) (hk : ∀ j, 0 < k j) : + assignedMap a b h k '' rationalBox a h = rationalBox b k := by + let s : Space := fun j => (k j : ℝ) / (h j : ℝ) + have hs : ∀ j, 0 < s j := fun j => div_pos (by exact_mod_cast hk j) + (by exact_mod_cast hh j) + have hw : (fun j => s j * ofRat h j) = ofRat k := by + funext j + dsimp [s, ofRat] + exact div_mul_cancel₀ _ (by exact_mod_cast (ne_of_gt (hh j))) + have hf : assignedMap a b h k = diagonalAffine (ofRat a) (ofRat b) s := by + ext x j + simp [assignedMap, diagonalAffine, ofRat, s] + rw [rationalBox, hf, diagonalAffine_image _ _ _ _ hs, hw] + rfl + +theorem rationalBox_separating_coordinate {a b h k : RationalPoint} + (hh : ∀ j, 0 ≤ h j) (hk : ∀ j, 0 ≤ k j) + (hd : Disjoint (rationalBox a h) (rationalBox b k)) : + ∃ j, 0 < |a j - b j| - h j - k j := by + obtain ⟨j, hj⟩ := (disjoint_solidBox_iff + (fun j => show 0 ≤ (h j : ℝ) by exact_mod_cast hh j) + (fun j => show 0 ≤ (k j : ℝ) by exact_mod_cast hk j)).mp hd + refine ⟨j, ?_⟩ + change (h j : ℝ) + (k j : ℝ) < |(a j : ℝ) - (b j : ℝ)| at hj + have hjq : h j + k j < |a j - b j| := by exact_mod_cast hj + linarith + +private theorem finite_positive_lower_bound {ι : Type*} (s : Finset ι) (f : ι → ℚ) + (hf : ∀ i ∈ s, 0 < f i) : ∃ ε : ℚ, 0 < ε ∧ ∀ i ∈ s, ε < f i := by + classical + induction s using Finset.induction_on with + | empty => exact ⟨1, by norm_num, by simp⟩ + | @insert a s has ih => + obtain ⟨ε, hε, hεs⟩ := ih (fun i hi => hf i (Finset.mem_insert_of_mem hi)) + have ha : 0 < f a := hf a (Finset.mem_insert_self _ _) + refine ⟨min ε (f a / 2), lt_min hε (by linarith), ?_⟩ + intro i hi + rcases Finset.mem_insert.mp hi with rfl | his + · exact lt_of_le_of_lt (min_le_right _ _) (by linarith) + · exact lt_of_le_of_lt (min_le_left _ _) (hεs i his) + +theorem exists_uniform_rational_gap {N : ℕ} (a h : Fin N → RationalPoint) + (hh : ∀ i j, 0 ≤ h i j) + (hd : Pairwise (fun i l => Disjoint (rationalBox (a i) (h i)) + (rationalBox (a l) (h l)))) : + ∃ δ : ℚ, 0 < δ ∧ ∀ i l, i ≠ l → + ∃ j, δ < |a i j - a l j| - h i j - h l j := by + classical + let P := {p : Fin N × Fin N // p.1 ≠ p.2} + have hp : ∀ p : P, ∃ j, 0 < |a p.1.1 j - a p.1.2 j| - h p.1.1 j - h p.1.2 j := + fun p => @rationalBox_separating_coordinate (a p.1.1) (a p.1.2) (h p.1.1) (h p.1.2) + (hh _) (hh _) (hd p.2) + let j : P → Fin 3 := fun p => Classical.choose (hp p) + let g : P → ℚ := fun p => + |a p.1.1 (j p) - a p.1.2 (j p)| - h p.1.1 (j p) - h p.1.2 (j p) + have hg : ∀ p : P, 0 < g p := fun p => Classical.choose_spec (hp p) + obtain ⟨δ, hδ, hδp⟩ := finite_positive_lower_bound Finset.univ g (fun p _ => hg p) + refine ⟨δ, hδ, ?_⟩ + intro i l hil + exact ⟨j ⟨(i, l), hil⟩, hδp ⟨(i, l), hil⟩ (Finset.mem_univ _)⟩ + +theorem exists_common_center_expansion {N : ℕ} (a b : Fin N → RationalPoint) + (ha : Function.Injective a) (hb : Function.Injective b) (R : ℚ) : + ∃ L : ℚ, 10 < L ∧ + (∀ i l, i ≠ l → ∃ j, 20 * R < |L * a i j - L * a l j|) ∧ + (∀ i l, i ≠ l → ∃ j, 20 * R < |L * b i j - L * b l j|) := by + let f : Fin N × Fin N × Fin 3 → ℚ := fun p => + max (20 * |R| / |a p.1 p.2.2 - a p.2.1 p.2.2|) + (20 * |R| / |b p.1 p.2.2 - b p.2.1 p.2.2|) + obtain ⟨M, hM⟩ := (Set.finite_range f).bddAbove + let L := max 11 (M + 1) + have hL : 10 < L := lt_of_lt_of_le (by norm_num) (le_max_left _ _) + have hML : M < L := lt_of_lt_of_le (by linarith) (le_max_right _ _) + have bound : ∀ p, f p < L := + fun p => lt_of_le_of_lt (hM (Set.mem_range_self p)) hML + have expand : ∀ c : Fin N → RationalPoint, Function.Injective c → + (∀ i l j, 20 * |R| / |c i j - c l j| < L) → + ∀ i l, i ≠ l → ∃ j, 20 * R < |L * c i j - L * c l j| := by + intro c hc hbound i l hil + have hne : c i ≠ c l := fun h => hil (hc h) + have hex : ∃ j, c i j ≠ c l j := by + by_contra! hall + exact hne (funext hall) + obtain ⟨j, hj⟩ := hex + have hd : 0 < |c i j - c l j| := abs_pos.mpr (sub_ne_zero.mpr hj) + have hm := (div_lt_iff₀ hd).mp (hbound i l j) + refine ⟨j, ?_⟩ + rw [← mul_sub, abs_mul, abs_of_pos (by linarith : 0 < L)] + nlinarith [le_abs_self R] + refine ⟨L, hL, expand a ha ?_, expand b hb ?_⟩ + · intro i l j + exact lt_of_le_of_lt (le_max_left _ _) (bound (i, l, j)) + · intro i l j + exact lt_of_le_of_lt (le_max_right _ _) (bound (i, l, j)) + +theorem rational_centers_injective {N : ℕ} (a h : Fin N → RationalPoint) + (hh : ∀ i j, 0 ≤ h i j) + (hd : Pairwise (fun i l => Disjoint (rationalBox (a i) (h i)) + (rationalBox (a l) (h l)))) : Function.Injective a := by + intro i l hil + by_contra hne + have hn := centers_ne_of_disjoint + (fun j => show 0 ≤ (h i j : ℝ) by exact_mod_cast hh i j) + (fun j => show 0 ≤ (h l j : ℝ) by exact_mod_cast hh l j) (hd hne) + exact hn (congrArg ofRat hil) + +theorem disjoint_padded_of_center_clearance {a b h k : Space} {R η : ℝ} + (hh : ∀ j, h j ≤ R) (hk : ∀ j, k j ≤ R) + (hη : η < R / 2) (hclear : ∃ j, 4 * R ≤ |a j - b j|) : + Disjoint (solidBox a (fun j => h j + 2 * η)) + (solidBox b (fun j => k j + 2 * η)) := by + obtain ⟨j, hj⟩ := hclear + apply disjoint_padded_solidBox (j := j) + linarith [hh j, hk j] + +def shapeScale (s : Space) (θ : ℝ) : Space := + fun j => Real.exp (θ * Real.log (s j)) + +@[simp] theorem shapeScale_zero (s : Space) : shapeScale s 0 = (fun _ => 1) := by + ext j + simp [shapeScale] + +@[simp] theorem shapeScale_one (s : Space) (hs : ∀ j, 0 < s j) : shapeScale s 1 = s := by + ext j + simp [shapeScale, Real.exp_log (hs j)] + +theorem shapeScale_pos (s : Space) (θ : ℝ) (j : Fin 3) : 0 < shapeScale s θ j := + Real.exp_pos _ + +theorem sum_log_eq_zero {s : Space} (hs : ∀ j, 0 < s j) + (hbal : ∏ j, s j = 1) : ∑ j, Real.log (s j) = 0 := by + rw [← Real.log_prod (fun j _ => ne_of_gt (hs j)), hbal, Real.log_one] + +theorem shapeScale_balanced {s : Space} (hs : ∀ j, 0 < s j) + (hbal : ∏ j, s j = 1) (θ : ℝ) : ∏ j, shapeScale s θ j = 1 := by + simp only [shapeScale] + rw [← Real.exp_sum, ← Finset.mul_sum, sum_log_eq_zero hs hbal, mul_zero, Real.exp_zero] + +theorem shapeScale_det_eq_one {s : Space} (hs : ∀ j, 0 < s j) + (hbal : ∏ j, s j = 1) (θ : ℝ) : + (Matrix.diagonal (shapeScale s θ)).det = 1 := by + rw [Matrix.det_diagonal] + exact shapeScale_balanced hs hbal θ + +theorem geometric_width_eq {h k : ℝ} (hh : 0 < h) (hk : 0 < k) (θ : ℝ) : + h * Real.exp (θ * Real.log (k / h)) = + Real.exp ((1 - θ) * Real.log h + θ * Real.log k) := by + rw [Real.log_div (ne_of_gt hk) (ne_of_gt hh)] + calc + h * Real.exp (θ * (Real.log k - Real.log h)) = + Real.exp (Real.log h) * Real.exp (θ * (Real.log k - Real.log h)) := by + rw [Real.exp_log hh] + _ = Real.exp ((1 - θ) * Real.log h + θ * Real.log k) := by + rw [← Real.exp_add] + congr 1 + ring + +theorem geometric_width_le_max {h k θ : ℝ} (hh : 0 < h) (hk : 0 < k) + (hθ : θ ∈ Set.Icc (0 : ℝ) 1) : + h * Real.exp (θ * Real.log (k / h)) ≤ max h k := by + rw [geometric_width_eq hh hk] + have hm : 0 < max h k := lt_of_lt_of_le hh (le_max_left _ _) + conv_rhs => rw [← Real.exp_log hm] + apply Real.exp_le_exp.mpr + have hhlog := Real.log_le_log hh (le_max_left h k) + have hklog := Real.log_le_log hk (le_max_right h k) + have h₁ := mul_le_mul_of_nonneg_left hhlog (sub_nonneg.mpr hθ.2) + have h₂ := mul_le_mul_of_nonneg_left hklog hθ.1 + nlinarith + +theorem shapeScale_width_bound {h k : Space} (hh : ∀ j, 0 < h j) + (hk : ∀ j, 0 < k j) {R θ : ℝ} + (hhR : ∀ j, h j ≤ R) (hkR : ∀ j, k j ≤ R) (hθ : θ ∈ Set.Icc (0 : ℝ) 1) : + ∀ j, h j * shapeScale (fun l => k l / h l) θ j ≤ R := by + intro j + exact le_trans (geometric_width_le_max (hh j) (hk j) hθ) (max_le (hhR j) (hkR j)) + +theorem real_balance_of_rational {s : RationalPoint} (hs : ∏ j, s j = 1) : + ∏ j, (s j : ℝ) = 1 := by + exact_mod_cast hs + +@[simp] theorem mixedPartial_zero (d : List (Fin 4)) : + mixedPartial d (fun _ : Spacetime => (0 : Space)) = (fun _ => 0) := by + induction d with + | nil => rfl + | cons j d ih => + funext z + simp [mixedPartial, ih] + +theorem effective_zero : EffectiveField (fun _ _ => 0) := by + have h0 : inCoordinates (fun _ _ => 0) = (fun _ : Spacetime => (0 : Space)) := rfl + refine ⟨(fun _ => (0, 0)), (fun _ => 0), (fun _ => 0), + Computable.const _, Computable.const _, Computable.const _, ?_, ?_⟩ + · intro d j q n z _ + rw [h0, mixedPartial_zero] + simp only [decodeRational, Int.cast_zero, + Nat.cast_zero, zero_div, Pi.zero_apply, sub_self, abs_zero] + exact pow_nonneg (by norm_num : 0 ≤ (1 / 2 : ℝ)) n + · intro d z j + rw [h0, mixedPartial_zero] + simp only [Nat.cast_zero, Pi.zero_apply, abs_zero, + le_refl] + +theorem solenoidal_zero : Solenoidal (fun _ _ => 0) := by + intro t x + simp [divergence] + +theorem identity_isMaterialFlow : IsMaterialFlow (fun _ _ => 0) (fun _ x => x) := by + refine ⟨fun _ => rfl, ?_⟩ + intro x t + exact hasDerivAt_const t x + +theorem routingConclusion_empty (a b h k : Fin 0 → RationalPoint) : + RoutingConclusion a b h k := by + refine ⟨(fun _ _ => 0), (fun _ x => x), contDiff_const, + HasCompactSupport.zero, solenoidal_zero, ?_, effective_zero, + identity_isMaterialFlow, ?_⟩ + · intro t ht x + rfl + · intro i + exact Fin.elim0 i + +theorem assignedMap_self (a h : RationalPoint) (hh : ∀ j, h j ≠ 0) (x : Space) : + assignedMap a a h h x = x := by + ext j + simp [assignedMap, div_self (hh j)] + +theorem routingConclusion_reflexive {N : ℕ} (a h : Fin N → RationalPoint) + (hh : ∀ i j, h i j ≠ 0) : RoutingConclusion a a h h := by + refine ⟨(fun _ _ => 0), (fun _ x => x), contDiff_const, + HasCompactSupport.zero, solenoidal_zero, ?_, effective_zero, + identity_isMaterialFlow, ?_⟩ + · intro t ht x + rfl + · intro i + exact ⟨Set.univ, isOpen_univ, Set.subset_univ _, + fun x _ => (assignedMap_self _ _ (hh i) x).symm⟩ + +def direction (j : Fin 3) : Space := Pi.single j 1 + +def jacobianEntry (i j : Fin 3) : (Space →L[ℝ] Space) →L[ℝ] ℝ := + (ContinuousLinearMap.proj i).comp ((ContinuousLinearMap.apply ℝ Space) (direction j)) + +def curlFromJacobian : (Space →L[ℝ] Space) →L[ℝ] Space := + ContinuousLinearMap.pi ![jacobianEntry 2 1 - jacobianEntry 1 2, + jacobianEntry 0 2 - jacobianEntry 2 0, + jacobianEntry 1 0 - jacobianEntry 0 1] + +noncomputable def curl (A : Space → Space) : Space → Space := + curlFromJacobian ∘ fderiv ℝ A + +theorem curl_apply (A : Space → Space) (x : Space) : + curl A x = ![(fderiv ℝ A x (direction 1)) 2 - (fderiv ℝ A x (direction 2)) 1, + (fderiv ℝ A x (direction 2)) 0 - (fderiv ℝ A x (direction 0)) 2, + (fderiv ℝ A x (direction 0)) 1 - (fderiv ℝ A x (direction 1)) 0] := by + ext j + fin_cases j <;> rfl + +theorem contDiff_curl {A : Space → Space} (hA : ContDiff ℝ ∞ A) : + ContDiff ℝ ∞ (curl A) := by + exact curlFromJacobian.contDiff.comp (hA.fderiv_right (by simp)) + +theorem hasCompactSupport_curl {A : Space → Space} (hA : HasCompactSupport A) : + HasCompactSupport (curl A) := + (hA.fderiv ℝ).comp_left (map_zero curlFromJacobian) + +theorem divergence_curl {A : Space → Space} (hA : ContDiff ℝ ∞ A) (t : ℝ) (x : Space) : + divergence (fun _ => curl A) t x = 0 := by + have hdA : Differentiable ℝ (fderiv ℝ A) := + (hA.fderiv_right (m := ∞) (by simp)).differentiable (by simp) + have hder : fderiv ℝ (curl A) x = curlFromJacobian.comp (fderiv ℝ (fderiv ℝ A) x) := by + exact (curlFromJacobian.hasFDerivAt.comp x (hdA x).hasFDerivAt).fderiv + have hsym := hA.contDiffAt (x := x) |>.isSymmSndFDerivAt (by simp only [minSmoothness_of_isRCLikeNormedField]; norm_cast) + unfold divergence + rw [hder, Fin.sum_univ_three] + change + ((fderiv ℝ (fderiv ℝ A) x (direction 0)) (direction 1)) 2 - + ((fderiv ℝ (fderiv ℝ A) x (direction 0)) (direction 2)) 1 + + (((fderiv ℝ (fderiv ℝ A) x (direction 1)) (direction 2)) 0 - + ((fderiv ℝ (fderiv ℝ A) x (direction 1)) (direction 0)) 2) + + (((fderiv ℝ (fderiv ℝ A) x (direction 2)) (direction 0)) 1 - + ((fderiv ℝ (fderiv ℝ A) x (direction 2)) (direction 1)) 0) = 0 + rw [hsym.eq (direction 0) (direction 1), hsym.eq (direction 0) (direction 2), + hsym.eq (direction 1) (direction 2)] + ring + +theorem curl_eq_of_eventuallyEq {A B : Space → Space} {x : Space} + (hAB : A =ᶠ[nhds x] B) : curl A x = curl B x := by + simp only [curl, Function.comp_apply, hAB.fderiv_eq] + +theorem curl_cutoff_eq {χ : Space → ℝ} (A : Space → Space) {x : Space} + (hχ : χ =ᶠ[nhds x] (fun _ => 1)) : + curl (fun y => χ y • A y) x = curl A x := by + apply curl_eq_of_eventuallyEq + filter_upwards [hχ] with y hy + simp [hy] + +def potentialComponent (c v l : Space) (i j : Fin 3) (x : Space) : ℝ := + (1 / 2 : ℝ) * (v i * (x j - c j) - v j * (x i - c i)) + + ((1 / 3 : ℝ) * (l i - l j)) * (x i - c i) * (x j - c j) + +def affinePotential (c v l : Space) (x : Space) : Space := + ![potentialComponent c v l 1 2 x, potentialComponent c v l 2 0 x, + potentialComponent c v l 0 1 x] + +theorem affinePotential_eq_cross (c v l x : Space) : + affinePotential c v l x = (1 / 2 : ℝ) • crossProduct v (x - c) + + (1 / 3 : ℝ) • crossProduct (fun j => l j * (x j - c j)) (x - c) := by + ext j + fin_cases j <;> simp [affinePotential, potentialComponent, cross_apply] <;> ring + +theorem contDiff_potentialComponent (c v l : Space) (i j : Fin 3) : + ContDiff ℝ ∞ (potentialComponent c v l i j) := by + unfold potentialComponent + fun_prop + +theorem contDiff_affinePotential (c v l : Space) : ContDiff ℝ ∞ (affinePotential c v l) := by + apply contDiff_pi.mpr + intro j + fin_cases j + · exact contDiff_potentialComponent c v l 1 2 + · exact contDiff_potentialComponent c v l 2 0 + · exact contDiff_potentialComponent c v l 0 1 + +theorem potentialComponent_fderiv (c v l x z : Space) (i j : Fin 3) : + fderiv ℝ (potentialComponent c v l i j) x z = + (1 / 2 : ℝ) * (v i * z j - v j * z i) + + ((1 / 3 : ℝ) * (l i - l j)) * ((x i - c i) * z j + (x j - c j) * z i) := by + have hi := HasFDerivAt.sub_const (c i) (hasFDerivAt_apply (𝕜 := ℝ) i x) + have hj := HasFDerivAt.sub_const (c j) (hasFDerivAt_apply (𝕜 := ℝ) j x) + have hlin := ((hj.const_mul (v i)).sub (hi.const_mul (v j))).const_mul (1 / 2 : ℝ) + have hquad := (hi.const_mul ((1 / 3 : ℝ) * (l i - l j))).mul hj + have hd := hlin.add hquad + change HasFDerivAt (potentialComponent c v l i j) _ x at hd + rw [hd.fderiv] + simp only [add_apply, sub_apply, + smul_apply, ContinuousLinearMap.proj_apply, smul_eq_mul] + ring + +theorem curl_affinePotential (c v l x : Space) : + curl (affinePotential c v l) x = + fun j => v j + l j * (x j - c j) - (∑ i, l i) / 3 * (x j - c j) := by + have hentry (i j : Fin 3) : + (fderiv ℝ (affinePotential c v l) x (direction j)) i = + fderiv ℝ (fun y => affinePotential c v l y i) x (direction j) := by + rw [fderiv_apply ((contDiff_affinePotential c v l).differentiable (by simp) x)] + rfl + rw [curl_apply] + ext j + fin_cases j <;> + simp only [Matrix.cons_val_zero', Matrix.cons_val_succ'] <;> + rw [hentry, hentry] <;> + simp only [affinePotential, Matrix.cons_val_zero, Matrix.cons_val_one, + Matrix.cons_val_two, Matrix.head_cons, Matrix.tail_cons] <;> + rw [potentialComponent_fderiv, potentialComponent_fderiv] <;> + simp [direction, Fin.sum_univ_three] <;> ring + +theorem curl_affinePotential_trace_zero (c v l x : Space) (hl : ∑ j, l j = 0) : + curl (affinePotential c v l) x = (fun j => v j + l j * (x j - c j)) := by + simpa only [hl, zero_div, zero_mul, sub_zero] using curl_affinePotential c v l x + +theorem localized_affine_extension (c v l : Space) (hl : ∑ j, l j = 0) + {U : Set Space} (hU : IsOpen U) {χ : Space → ℝ} + (hχ : ContDiff ℝ ∞ χ) (hχc : HasCompactSupport χ) + (hplateau : Set.EqOn χ (fun _ => 1) U) : + ∃ W : Space → Space, ContDiff ℝ ∞ W ∧ HasCompactSupport W ∧ + Solenoidal (fun _ => W) ∧ + Set.EqOn W (fun x j => v j + l j * (x j - c j)) U := by + have hA : ContDiff ℝ ∞ (fun y => χ y • affinePotential c v l y) := + hχ.smul (contDiff_affinePotential c v l) + refine ⟨curl (fun y => χ y • affinePotential c v l y), contDiff_curl hA, + hasCompactSupport_curl hχc.smul_right, ?_, ?_⟩ + · exact divergence_curl hA + · intro x hx + have he : χ =ᶠ[nhds x] (fun _ => 1) := by + filter_upwards [hU.mem_nhds hx] with y hy + exact hplateau hy + rw [curl_cutoff_eq _ he, curl_affinePotential_trace_zero c v l x hl] + +def openBox (c h : Space) : Set Space := {x | ∀ j, |x j - c j| < h j} + +theorem isOpen_openBox (c h : Space) : IsOpen (openBox c h) := by + change IsOpen {x : Space | ∀ j, |x j - c j| < h j} + simp only [Set.ofPred_forall] + exact isOpen_iInter_of_finite fun j => + isOpen_lt (((continuous_apply j).sub continuous_const).abs) continuous_const + +theorem solidBox_subset_openBox_padded (c h : Space) {η : ℝ} (hη : 0 < η) : + solidBox c h ⊆ openBox c (fun j => h j + η) := by + intro x hx j + exact lt_of_le_of_lt (hx j) (lt_add_of_pos_right _ hη) + +theorem exists_padded_box_cutoff (c h : Space) (hh : ∀ j, 0 ≤ h j) + {η : ℝ} (hη : 0 < η) : + ∃ χ : Space → ℝ, ContDiff ℝ ∞ χ ∧ HasCompactSupport χ ∧ + tsupport χ ⊆ solidBox c (fun j => h j + 2 * η) ∧ + Set.EqOn χ (fun _ => 1) (solidBox c (fun j => h j + η)) := by + let f (j : Fin 3) : ContDiffBump (c j) := + { rIn := h j + η + rOut := h j + 2 * η + rIn_pos := by linarith [hh j] + rIn_lt_rOut := by linarith } + let χ : Space → ℝ := fun x => ∏ j, f j (x j) + have hs : Function.support χ ⊆ solidBox c (fun j => h j + 2 * η) := by + intro x hx j + have hxj : f j (x j) ≠ 0 := (Finset.prod_ne_zero_iff.mp hx) j (Finset.mem_univ _) + have hj : x j ∈ Metric.ball (c j) (f j).rOut := by + rw [← (f j).support_eq] + exact hxj + exact le_of_lt (by simpa only [Metric.mem_ball, Real.dist_eq, f] using hj) + refine ⟨χ, ?_, HasCompactSupport.of_support_subset_isCompact + (isCompact_solidBox _ _) hs, closure_minimal hs (isCompact_solidBox _ _).isClosed, ?_⟩ + · exact contDiff_prod (fun j _ => (f j).contDiff.comp (contDiff_apply ℝ ℝ j)) + · intro x hx + apply Finset.prod_eq_one + intro j _ + apply (f j).one_of_mem_closedBall + simpa only [Metric.mem_closedBall, Real.dist_eq, f] using hx j + +theorem tsupport_curl_subset (A : Space → Space) : tsupport (curl A) ⊆ tsupport A := + (tsupport_comp_subset (map_zero curlFromJacobian) (fderiv ℝ A)).trans + (tsupport_fderiv_subset ℝ) + +theorem affine_extension_on_box (c h v l : Space) + (hh : ∀ j, 0 ≤ h j) (hl : ∑ j, l j = 0) {η : ℝ} (hη : 0 < η) : + ∃ W : Space → Space, ∃ U : Set Space, + IsOpen U ∧ solidBox c h ⊆ U ∧ + ContDiff ℝ ∞ W ∧ HasCompactSupport W ∧ + tsupport W ⊆ solidBox c (fun j => h j + 2 * η) ∧ + Solenoidal (fun _ => W) ∧ + Set.EqOn W (fun x j => v j + l j * (x j - c j)) U := by + obtain ⟨χ, hχ, hχc, hχs, hχp⟩ := exists_padded_box_cutoff c h hh hη + let U := openBox c (fun j => h j + η) + have hU : IsOpen U := isOpen_openBox _ _ + have hplateau : Set.EqOn χ (fun _ => 1) U := by + intro x hx + exact hχp (fun j => (hx j).le) + let A : Space → Space := fun x => χ x • affinePotential c v l x + have hA : ContDiff ℝ ∞ A := hχ.smul (contDiff_affinePotential c v l) + refine ⟨curl A, U, hU, solidBox_subset_openBox_padded _ _ hη, + contDiff_curl hA, hasCompactSupport_curl hχc.smul_right, + (tsupport_curl_subset A).trans ((tsupport_smul_subset_left χ _).trans hχs), + divergence_curl hA, ?_⟩ + intro x hx + have he : χ =ᶠ[nhds x] (fun _ => 1) := by + filter_upwards [hU.mem_nhds hx] with y hy + exact hplateau hy + exact (curl_cutoff_eq _ he).trans (curl_affinePotential_trace_zero c v l x hl) + +theorem contDiff_shapeScale (s : Space) {θ : ℝ → ℝ} (hθ : ContDiff ℝ ∞ θ) : + ContDiff ℝ ∞ (fun t => shapeScale s (θ t)) := by + exact contDiff_pi.mpr (fun j => (hθ.mul contDiff_const).exp) + +theorem hasDerivAt_shapeScale (s : Space) {θ : ℝ → ℝ} {θ' t : ℝ} + (hθ : HasDerivAt θ θ' t) : + HasDerivAt (fun u => shapeScale s (θ u)) + (fun j => θ' * Real.log (s j) * shapeScale s (θ t) j) t := by + apply hasDerivAt_pi.mpr + intro j + change HasDerivAt (fun u => Real.exp (θ u * Real.log (s j))) + (θ' * Real.log (s j) * Real.exp (θ t * Real.log (s j))) t + convert (hθ.mul_const (Real.log (s j))).exp using 1 + ring + +theorem sum_logarithmic_rate {s : Space} (hs : ∀ j, 0 < s j) + (hbal : ∏ j, s j = 1) (θ' : ℝ) : ∑ j, θ' * Real.log (s j) = 0 := by + rw [← Finset.mul_sum, sum_log_eq_zero hs hbal, mul_zero] + +def shapeMotion (a : Space) (c : ℝ → Space) (s : Space) (θ : ℝ → ℝ) + (t : ℝ) (x : Space) : Space := + fun j => c t j + shapeScale s (θ t) j * (x j - a j) + +theorem shapeMotion_hasDerivAt (a s x : Space) {c : ℝ → Space} {c' : Space} + {θ : ℝ → ℝ} {θ' t : ℝ} (hc : HasDerivAt c c' t) (hθ : HasDerivAt θ θ' t) : + HasDerivAt (fun u => shapeMotion a c s θ u x) + (fun j => c' j + θ' * Real.log (s j) * (shapeMotion a c s θ t x j - c t j)) t := by + apply hasDerivAt_pi.mpr + intro j + have hD := hasDerivAt_pi.mp (hasDerivAt_shapeScale s hθ) j + have hd := (hasDerivAt_pi.mp hc j).add (hD.mul_const (x j - a j)) + change HasDerivAt (fun u => c u j + shapeScale s (θ u) j * (x j - a j)) _ t at hd + simpa only [shapeMotion, add_sub_cancel_left, mul_assoc] using hd + +theorem shapeMotion_start (a s x : Space) {c : ℝ → Space} {θ : ℝ → ℝ} {t : ℝ} + (hc : c t = a) (hθ : θ t = 0) : shapeMotion a c s θ t x = x := by + ext j + simp [shapeMotion, hc, hθ] + +theorem shapeMotion_finish (a b s x : Space) {c : ℝ → Space} {θ : ℝ → ℝ} {t : ℝ} + (hs : ∀ j, 0 < s j) (hc : c t = b) (hθ : θ t = 1) : + shapeMotion a c s θ t x = diagonalAffine a b s x := by + ext j + simp [shapeMotion, hc, hθ, shapeScale_one s hs, diagonalAffine] + +theorem diagonalAffine_perturbation_bound (a b s x z : Space) {M δ : ℝ} + (hM : 0 < M) (hsM : ∀ j, |s j| ≤ M) (hxz : ∀ j, |x j - z j| < δ) : + ∀ j, |diagonalAffine a b s x j - diagonalAffine a b s z j| < M * δ := by + intro j + have he : diagonalAffine a b s x j - diagonalAffine a b s z j = s j * (x j - z j) := by + dsimp [diagonalAffine] + ring + rw [he, abs_mul] + exact lt_of_le_of_lt (mul_le_mul_of_nonneg_right (hsM j) (abs_nonneg _)) + (mul_lt_mul_of_pos_left (hxz j) hM) + +theorem diagonalAffine_openBox_padded {a b s h x : Space} {δ η : ℝ} + (hs : ∀ j, 0 < s j) (hscale : ∀ j, s j * δ ≤ η) + (hx : x ∈ openBox a (fun j => h j + δ)) : + diagonalAffine a b s x ∈ openBox b (fun j => s j * h j + η) := by + intro j + simp only [diagonalAffine, add_sub_cancel_left, abs_mul, abs_of_pos (hs j)] + have hj := mul_lt_mul_of_pos_left (hx j) (hs j) + rw [mul_add] at hj + linarith [hscale j] + +end + +end BoxTransport + +end OAI diff --git a/lean/OAI/Analysis/InnerProductSpace/ComplexSolvability.lean b/lean/OAI/Analysis/InnerProductSpace/ComplexSolvability.lean new file mode 100644 index 0000000000000000000000000000000000000000..1dcdff16b52cba2412cbf3c30cad7e39c5b5eb52 --- /dev/null +++ b/lean/OAI/Analysis/InnerProductSpace/ComplexSolvability.lean @@ -0,0 +1,186 @@ +import Mathlib + +namespace OAI + +noncomputable section +namespace NadelL2 +open LinearPMap WithLp +open scoped InnerProductSpace +variable {𝕜 E F : Type*} [RCLike 𝕜] +variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [CompleteSpace E] +variable [NormedAddCommGroup F] [InnerProductSpace 𝕜 F] [CompleteSpace F] + + +theorem mem_graph_of_adjoint_identity + (T : E →ₗ.[𝕜] F) (hT : Dense (T.domain : Set E)) (hclosed : T.IsClosed) + {u : E} {f : F} + (hweak : ∀ v : T†.domain, inner 𝕜 u (T† v) = inner 𝕜 f (v : F)) : + (u, f) ∈ T.graph := by + let G : Submodule 𝕜 (WithLp 2 (E × F)) := + T.graph.comap (WithLp.linearEquiv 2 𝕜 (E × F)).toLinearMap + have hGc : IsClosed (G : Set (WithLp 2 (E × F))) := + hclosed.preimage (WithLp.prod_continuous_ofLp 2 E F) + have hm : toLp 2 (u, f) ∈ Gᗮᗮ := by + rw [Submodule.mem_orthogonal'] + intro z hz + have hz' (x : T.domain) : + inner 𝕜 (ofLp z).1 (x : E) + inner 𝕜 (ofLp z).2 (T x) = 0 := by + have hx : toLp 2 ((x : E), T x) ∈ G := by + change ((x : E), T x) ∈ T.graph + exact T.mem_graph_iff.mpr ⟨x, rfl, rfl⟩ + have h := (G.mem_orthogonal' z).mp hz (toLp 2 ((x : E), T x)) hx + simpa only [prod_inner_apply, ofLp_toLp] using h + have hv : (ofLp z).2 ∈ T†.domain := by + apply LinearPMap.mem_adjoint_domain_of_exists + refine ⟨-(ofLp z).1, fun x => ?_⟩ + rw [inner_neg_left] + exact (eq_neg_of_add_eq_zero_right (hz' x)).symm + have ha : T† ⟨(ofLp z).2, hv⟩ = -(ofLp z).1 := by + apply LinearPMap.adjoint_apply_eq hT + intro x + rw [inner_neg_left] + exact (eq_neg_of_add_eq_zero_right (hz' x)).symm + have hw := hweak ⟨(ofLp z).2, hv⟩ + rw [ha, inner_neg_right] at hw + simp only [prod_inner_apply] + rw [← hw] + exact add_neg_cancel _ + rw [G.orthogonal_orthogonal_eq_closure, hGc.submodule_topologicalClosure_eq] at hm + exact hm + + + +theorem exists_solution_of_adjoint_bound + (T : E →ₗ.[𝕜] F) (hT : Dense (T.domain : Set E)) (hclosed : T.IsClosed) + (f : F) {C : ℝ} (hC : 0 ≤ C) + (hbound : ∀ v : T†.domain, ‖inner 𝕜 f (v : F)‖ ≤ C * ‖T† v‖) : + ∃ u : T.domain, T u = f ∧ ‖(u : E)‖ ≤ C := by + let A : T†.domain →ₗ[𝕜] E := T†.toFun + let ell : T†.domain →ₗ[𝕜] 𝕜 := (innerₛₗ 𝕜 f).comp T†.domain.subtype + have hk : A.ker ≤ ell.ker := by + intro v hv + rw [LinearMap.mem_ker] at hv ⊢ + change inner 𝕜 f (v : F) = 0 + apply norm_eq_zero.mp + have hb := hbound v + change ‖inner 𝕜 f (v : F)‖ ≤ C * ‖A v‖ at hb + rw [hv, norm_zero, mul_zero] at hb + exact le_antisymm hb (norm_nonneg _) + let g : A.range →ₗ[𝕜] 𝕜 := + (A.ker.liftQ ell hk).comp A.quotKerEquivRange.symm.toLinearMap + have hg (v : T†.domain) : g (A.rangeRestrict v) = ell v := by + have he : A.quotKerEquivRange (Submodule.Quotient.mk v) = A.rangeRestrict v := by + apply Subtype.ext + exact A.quotKerEquivRange_apply_mk v + simp only [g, LinearMap.comp_apply, LinearEquiv.coe_coe, ← he, + LinearEquiv.symm_apply_apply, Submodule.liftQ_apply] + have hgb (x : A.range) : ‖g x‖ ≤ C * ‖x‖ := by + obtain ⟨v, hv⟩ := x.property + have he : A.rangeRestrict v = x := Subtype.ext hv + rw [← he, hg] + exact hbound v + let gc : StrongDual 𝕜 A.range := g.mkContinuous C hgb + obtain ⟨L, hL, hnL⟩ := exists_extension_norm_eq A.range gc + let u : E := (InnerProductSpace.toDual 𝕜 E).symm L + have hun : ‖u‖ ≤ C := by + rw [show ‖u‖ = ‖L‖ from (InnerProductSpace.toDual 𝕜 E).symm.norm_map L, hnL] + exact g.mkContinuous_norm_le hC hgb + have hu : (u, f) ∈ T.graph := by + apply mem_graph_of_adjoint_identity T hT hclosed + intro v + change inner 𝕜 ((InnerProductSpace.toDual 𝕜 E).symm L) (A v) = ell v + rw [InnerProductSpace.toDual_symm_apply] + have h := hL (A.rangeRestrict v) + exact h.trans (hg v) + obtain ⟨u', hu', hTu'⟩ := T.mem_graph_iff.mp hu + exact ⟨u', hTu', hu' ▸ hun⟩ + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace 𝕜 H] + + + +theorem exists_solution_of_complex_estimate + (T : E →ₗ.[𝕜] F) (S : F →ₗ.[𝕜] H) + (hT : Dense (T.domain : Set E)) (hTc : T.IsClosed) (hSc : S.IsClosed) + (hcomplex : ∀ x : T.domain, (T x, 0) ∈ S.graph) + {ε : ℝ} (hε : 0 < ε) + (hestimate : ∀ v : T†.domain, ∀ hv : (v : F) ∈ S.domain, + ε * ‖(v : F)‖ ^ 2 ≤ ‖T† v‖ ^ 2 + ‖S ⟨(v : F), hv⟩‖ ^ 2) + {f : F} (hf : (f, 0) ∈ S.graph) : + ∃ u : T.domain, T u = f ∧ ‖(u : E)‖ ≤ ‖f‖ / Real.sqrt ε := by + let K : Submodule 𝕜 F := + S.graph.comap ((LinearMap.id : F →ₗ[𝕜] F).prod (0 : F →ₗ[𝕜] H)) + have hKc : IsClosed (K : Set F) := + hSc.preimage (continuous_id.prodMk continuous_const) + let : CompleteSpace K := hKc.completeSpace_coe + have hKf : f ∈ K := hf + have hsqrt : 0 < Real.sqrt ε := Real.sqrt_pos.mpr hε + apply exists_solution_of_adjoint_bound T hT hTc f + (div_nonneg (norm_nonneg _) hsqrt.le) + intro v + obtain ⟨p, hp, q, hq, hvpq⟩ := K.exists_add_mem_mem_orthogonal (v : F) + have hqT (x : T.domain) : inner 𝕜 q (T x) = 0 := + (K.mem_orthogonal' q).mp hq (T x) (hcomplex x) + have hqdom : q ∈ T†.domain := by + apply LinearPMap.mem_adjoint_domain_of_exists + exact ⟨0, fun x => by rw [inner_zero_left, hqT]⟩ + have hqadj : T† ⟨q, hqdom⟩ = 0 := by + apply LinearPMap.adjoint_apply_eq hT + intro x + rw [inner_zero_left, hqT] + have hpdom : p ∈ T†.domain := by + have he : p = (v : F) - q := (eq_sub_iff_add_eq).mpr hvpq.symm + rw [he] + exact T†.domain.sub_mem v.property hqdom + obtain ⟨⟨p, hpS⟩, rfl, hSp⟩ := S.mem_graph_iff.mp (show (p, 0) ∈ S.graph from hp) + let vp : T†.domain := ⟨p, hpdom⟩ + have hvsum : v = vp + ⟨q, hqdom⟩ := Subtype.ext hvpq + have hTp : T† vp = T† v := by + rw [hvsum, LinearPMap.map_add, hqadj, add_zero] + have hE : ε * ‖p‖ ^ 2 ≤ ‖T† v‖ ^ 2 := by + simpa only [vp, hSp, norm_zero, zero_pow (by decide : (2 : ℕ) ≠ 0), add_zero, + ← hTp] using hestimate vp hpS + have hnp : ‖p‖ ≤ ‖T† v‖ / Real.sqrt ε := by + apply (le_div_iff₀ hsqrt).mpr + apply (sq_le_sq₀ (mul_nonneg (norm_nonneg _) hsqrt.le) (norm_nonneg _)).mp + simpa only [mul_pow, Real.sq_sqrt hε.le, mul_comm] using hE + have hpair : inner 𝕜 f (v : F) = inner 𝕜 f p := by + rw [hvpq, inner_add_right, K.inner_right_of_mem_orthogonal hKf hq, add_zero] + rw [hpair] + calc + ‖inner 𝕜 f p‖ ≤ ‖f‖ * ‖p‖ := norm_inner_le_norm f p + _ ≤ ‖f‖ * (‖T† v‖ / Real.sqrt ε) := mul_le_mul_of_nonneg_left hnp (norm_nonneg _) + _ = (‖f‖ / Real.sqrt ε) * ‖T† v‖ := by ring + + + +def jointGraph (T : E →ₗ.[𝕜] F) (S : F →ₗ.[𝕜] H) : Set (F × E × H) := + {p | (p.1, p.2.1) ∈ T†.graph ∧ (p.1, p.2.2) ∈ S.graph} + + + +theorem exists_solution_of_core_estimate + (T : E →ₗ.[𝕜] F) (S : F →ₗ.[𝕜] H) + (hT : Dense (T.domain : Set E)) (hTc : T.IsClosed) (hSc : S.IsClosed) + (hcomplex : ∀ x : T.domain, (T x, 0) ∈ S.graph) + (D : Set (jointGraph T S)) (hD : Dense D) + {ε : ℝ} (hε : 0 < ε) + (hestimate : ∀ v ∈ D, + ε * ‖v.val.1‖ ^ 2 ≤ ‖v.val.2.1‖ ^ 2 + ‖v.val.2.2‖ ^ 2) + {f : F} (hf : (f, 0) ∈ S.graph) : + ∃ u : T.domain, T u = f ∧ ‖(u : E)‖ ≤ ‖f‖ / Real.sqrt ε := by + apply exists_solution_of_complex_estimate T S hT hTc hSc hcomplex hε _ hf + intro v hv + let p : jointGraph T S := ⟨((v : F), T† v, S ⟨(v : F), hv⟩), + T†.mem_graph_iff.mpr ⟨v, rfl, rfl⟩, + S.mem_graph_iff.mpr ⟨⟨(v : F), hv⟩, rfl, rfl⟩⟩ + have hc : IsClosed {w : jointGraph T S | + ε * ‖w.val.1‖ ^ 2 ≤ ‖w.val.2.1‖ ^ 2 + ‖w.val.2.2‖ ^ 2} := by + apply isClosed_le <;> fun_prop + exact (closure_minimal hestimate hc) (hD p) + +end NadelL2 + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/AffineArea.lean b/lean/OAI/Analysis/IntegralMeans/AffineArea.lean new file mode 100644 index 0000000000000000000000000000000000000000..7df3259a26ebfd7e707a2f10d634b7f076df6253 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/AffineArea.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.IntegralMeans.DomainArea +import OAI.Analysis.IntegralMeans.SharpModel + +namespace OAI + +noncomputable section +open Set MeasureTheory +open scoped ENNReal +namespace Brennan.Sharp + +lemma lintegral_affine_unit (a u : ℂ) (hu : ‖u‖ = 1) (f : ℂ → ℝ≥0∞) : + (∫⁻ w, f (a + u * w)) = ∫⁻ z, f z := by + have hu0 : u ≠ 0 := by + intro h + simp [h] at hu + let F : ℂ → ℂ := fun w => a + u * w + have hd (w : ℂ) : HasDerivAt F u w := by + exact (hasDerivAt_const_mul (x := w) u).const_add a + have hinj : InjOn F univ := by + intro x _ y _ h + change a + u * x = a + u * y at h + exact mul_left_cancel₀ hu0 (add_left_cancel h) + have himage : F '' univ = univ := by + apply Set.eq_univ_of_forall + intro z + refine ⟨(z - a) / u, Set.mem_univ _, ?_⟩ + dsimp [F] + field_simp [hu0] + ring + have he := conformal_lintegral_eq MeasurableSet.univ + (fun z _ => (hd z).differentiableAt) hinj f + rw [himage] at he + have hder (z : ℂ) : deriv F z = u := (hd z).deriv + simp only [setLIntegral_univ, hder, hu, one_pow, ENNReal.ofReal_one, one_mul] at he + exact he.symm + +lemma lintegral_left_disk_indicator (t : ℝ) : + (∫⁻ w, disk.indicator (fun z => ENNReal.ofReal (‖deriv koebeMap z‖ ^ t)) (-1 + w)) = + areaMoment koebeMap disk t := by + have h := lintegral_affine_unit (-1) 1 (by simp) + (disk.indicator (fun z => ENNReal.ofReal (‖deriv koebeMap z‖ ^ t))) + have hdisk : MeasurableSet disk := Metric.isOpen_ball.measurableSet + rw [lintegral_indicator hdisk] at h + simpa only [one_mul, areaMoment] using h + +lemma lintegral_right_disk_indicator (t : ℝ) : + (∫⁻ w, disk.indicator (fun z => ENNReal.ofReal (‖deriv koebeMap z‖ ^ t)) (1 - w)) = + areaMoment koebeMap disk t := by + have h := lintegral_affine_unit 1 (-1) (by simp) + (disk.indicator (fun z => ENNReal.ofReal (‖deriv koebeMap z‖ ^ t))) + have hdisk : MeasurableSet disk := Metric.isOpen_ball.measurableSet + rw [lintegral_indicator hdisk] at h + simpa only [neg_one_mul, ← sub_eq_add_neg, areaMoment] using h + +end Brennan.Sharp + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/AffineLaw.lean b/lean/OAI/Analysis/IntegralMeans/AffineLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..53ffc5639b93953f42d899b3d6c141ec1ff40928 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/AffineLaw.lean @@ -0,0 +1,528 @@ +import OAI.Analysis.IntegralMeans.Eigenmeasure + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight +attribute [local irreducible] classFun +attribute [local irreducible] rerootClass + +def positiveFunctionalCLM.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (Λ : C(X,ℝ) →ₗ[ℝ] ℝ) (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) : C(X,ℝ) →L[ℝ] ℝ := + Λ.mkContinuous (Λ 1) (positive_functional_bound Λ hp) + +def intervalFunctional.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (A : ℝ → C(X,ℝ) →L[ℝ] C(X,ℝ)) + (hc : ∀ f, Continuous (fun t => A t f)) + (hp : ∀ t f, 0 ≤ f → 0 ≤ A t f) + (Λ : C(X,ℝ) →L[ℝ] ℝ) (hΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (a b : ℝ) (hab : a ≤ b) : C(X,ℝ) →L[ℝ] ℝ := + positiveFunctionalCLM + { toFun := fun f => ∫ t in a..b, Λ (A t f) + map_add' := by + intro f g + simp only [map_add] + exact intervalIntegral.integral_add ((Λ.continuous.comp (hc f)).intervalIntegrable a b) + ((Λ.continuous.comp (hc g)).intervalIntegrable a b) + map_smul' := by + intro c f + simp only [map_smul,smul_eq_mul] + exact intervalIntegral.integral_const_mul c _ } + (by + intro f hf + exact intervalIntegral.integral_nonneg hab (fun t _ => hΛ _ (hp t f hf))) + +lemma intervalFunctional_apply.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (A : ℝ → C(X,ℝ) →L[ℝ] C(X,ℝ)) + (hc : ∀ f, Continuous (fun t => A t f)) + (hp : ∀ t f, 0 ≤ f → 0 ≤ A t f) + (Λ : C(X,ℝ) →L[ℝ] ℝ) (hΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (a b : ℝ) (hab : a ≤ b) (f : C(X,ℝ)) : + intervalFunctional A hc hp Λ hΛ a b hab f = ∫ t in a..b, Λ (A t f) := rfl + +lemma intervalFunctional_nonneg.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (A : ℝ → C(X,ℝ) →L[ℝ] C(X,ℝ)) + (hc : ∀ f, Continuous (fun t => A t f)) + (hp : ∀ t f, 0 ≤ f → 0 ≤ A t f) + (Λ : C(X,ℝ) →L[ℝ] ℝ) (hΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (a b : ℝ) (hab : a ≤ b) (f : C(X,ℝ)) (hf : 0 ≤ f) : + 0 ≤ intervalFunctional A hc hp Λ hΛ a b hab f := + intervalIntegral.integral_nonneg hab (fun t _ => hΛ _ (hp t f hf)) + +def pointOperator (x y : ℝ) (hy : 0 < y) := affineOperator (halfPoint x y hy) + +lemma pointOperator_mul (x y u v : ℝ) (hy : 0 < y) (hv : 0 < v) : + pointOperator x y hy * pointOperator u v hv = pointOperator (x+y*u) (y*v) (mul_pos hy hv) := by + simp only [pointOperator,affineOperator_mul,halfPoint_mul] + +lemma pointOperator_zero_one : pointOperator 0 1 zero_lt_one = 1 := by + have h : halfPoint 0 1 zero_lt_one = halfOne := by + apply Subtype.ext + simp [halfPoint,halfOne] + rw [pointOperator,h,affineOperator_one] + +lemma pointOperator_horizontal (x : ℝ) : pointOperator x 1 zero_lt_one = affineOperator (horizontal x) := rfl + +lemma transfer_endpoint_step (v : ℝ) (hv : 0 < v) : + transferOperator * (pointOperator (1+v) v hv-pointOperator (-1+v) v hv) = + (1/2 : ℝ) • (pointOperator (1+v/2) (v/2) (by positivity)- + pointOperator (-1+v/2) (v/2) (by positivity)) := by + change ((1/2 : ℝ) • (pointOperator (-1/2) (1/2) (by norm_num)+ + pointOperator (1/2) (1/2) (by norm_num))) * _ = _ + rw [smul_mul_assoc,add_mul,mul_sub,mul_sub] + simp only [pointOperator_mul] + have h1 : -1/2+1/2*(1+v) = v/2 := by ring + have h2 : -1/2+1/2*(-1+v) = -1+v/2 := by ring + have h3 : 1/2+1/2*(1+v) = 1+v/2 := by ring + have h4 : 1/2+1/2*(-1+v) = v/2 := by ring + simp only [h1,h2,h3,h4,show (1/2 : ℝ)*v = v/2 by ring] + congr 1 + abel + +lemma transfer_endpoint (n : ℕ) : + transferOperator^n * (affineOperator (horizontal 2)-1) = + ((1/2 : ℝ)^n) • (pointOperator (1+(1/2 : ℝ)^n) ((1/2 : ℝ)^n) (by positivity)- + pointOperator (-1+(1/2 : ℝ)^n) ((1/2 : ℝ)^n) (by positivity)) := by + induction n with + | zero => + simp only [pow_zero,one_mul,one_smul] + norm_num only [show (1+(1 : ℝ)) = 2 by norm_num,show (-1+(1 : ℝ)) = 0 by norm_num] + rw [pointOperator_zero_one,pointOperator_horizontal] + | succ n ih => + rw [pow_succ',mul_assoc,ih,mul_smul_comm,transfer_endpoint_step,smul_smul] + simp only [pow_succ,div_eq_mul_inv,one_mul] + +lemma endpoint_norm_bound (n : ℕ) : + ‖pointOperator (1+(1/2 : ℝ)^n) ((1/2 : ℝ)^n) (by positivity)- + pointOperator (-1+(1/2 : ℝ)^n) ((1/2 : ℝ)^n) (by positivity)‖ ≤ + 8192 / ((1/2 : ℝ)^n)^2 := by + let v := (1/2 : ℝ)^n + have hv : 0 < v := by positivity + have hv1 : v ≤ 1 := pow_le_one₀ (by norm_num) (by norm_num) + have hb (x : ℝ) (hx : |x| ≤ 2) : ‖pointOperator x v hv‖ ≤ 4096/v^2 := by + apply affineOperator_norm_le (by positivity) + intro g + have hq := classFun_strip_bound_two g (halfPoint x v hv) (by simpa [halfPoint] using hx) + (by simpa [halfPoint] using hv1) + simp only [halfPoint,Complex.add_im,Complex.ofReal_im,Complex.mul_im,Complex.ofReal_re,Complex.I_im,Complex.I_re,mul_one,mul_zero,add_zero,zero_add] at hq + rw [classWeight] + have hh := (sq_le_sq₀ (norm_nonneg _) (by positivity : 0 ≤ 64/v)).mpr hq + simpa only [halfPoint,div_pow,show (64 : ℝ)^2 = 4096 by norm_num] using hh + have hp := hb (1+v) (by rw [abs_le]; constructor <;> linarith) + have hm := hb (-1+v) (by rw [abs_le]; constructor <;> linarith) + calc + _ ≤ ‖pointOperator (1+v) v hv‖+‖pointOperator (-1+v) v hv‖ := norm_sub_le (pointOperator (1+v) v hv) (pointOperator (-1+v) v hv) + _ ≤ 4096/v^2+4096/v^2 := add_le_add hp hm + _ = 8192/v^2 := by ring + +lemma eigenfunctional_pow (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) (ρ : ℝ) + (hΛ : ∀ f, Λ (transferOperator f) = ρ*Λ f) (n : ℕ) (f : C(DiskClass,ℝ)) : + Λ ((transferOperator^n) f) = ρ^n*Λ f := by + induction n with + | zero => simp + | succ n ih => simp only [pow_succ',mul_apply_eq_comp,hΛ,ih]; ring + +lemma eigenfunctional_horizontal_period (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) (ρ : ℝ) + (hρ : 2 < ρ) (hΛ : ∀ f, Λ (transferOperator f) = ρ*Λ f) (f : C(DiskClass,ℝ)) : + Λ (affineOperator (horizontal 2) f) = Λ f := by + have hρ0 : 0 < ρ := by linarith + have hn (n : ℕ) : ‖Λ (affineOperator (horizontal 2) f)-Λ f‖ ≤ + (8192*‖Λ‖*‖f‖)*(2/ρ)^n := by + let v := (1/2 : ℝ)^n + let B := pointOperator (1+v) v (by positivity)-pointOperator (-1+v) v (by positivity) + have he : ρ^n*(Λ (affineOperator (horizontal 2) f)-Λ f) = v*Λ (B f) := by + rw [← map_sub,← eigenfunctional_pow Λ ρ hΛ] + change Λ ((transferOperator^n * (affineOperator (horizontal 2)-1)) f) = _ + rw [transfer_endpoint] + change Λ (v • B f) = _ + exact map_smul Λ v (B f) + have hb : ‖B‖ ≤ 8192/v^2 := endpoint_norm_bound n + have hh : ρ^n*‖Λ (affineOperator (horizontal 2) f)-Λ f‖ ≤ + v*(‖Λ‖*(8192/v^2*‖f‖)) := by + calc + _ = ‖v*Λ (B f)‖ := by rw [← he,norm_mul,Real.norm_of_nonneg (pow_nonneg hρ0.le n)] + _ ≤ v*(‖Λ‖*(‖B‖*‖f‖)) := by + rw [norm_mul,Real.norm_of_nonneg (by positivity : 0 ≤ v)] + exact mul_le_mul_of_nonneg_left ((Λ.le_opNorm _).trans + (mul_le_mul_of_nonneg_left (B.le_opNorm f) (norm_nonneg Λ))) (by positivity) + _ ≤ _ := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_right hb (norm_nonneg f)) (norm_nonneg Λ)) (by positivity) + calc + _ ≤ (v*(‖Λ‖*(8192/v^2*‖f‖)))/ρ^n := + (le_div_iff₀ (pow_pos hρ0 n)).mpr (by simpa only [mul_comm] using hh) + _ = _ := by + dsimp [v] + simp only [div_pow,one_pow] + field_simp + have ht : Tendsto (fun n : ℕ => (8192*‖Λ‖*‖f‖)*(2/ρ)^n) atTop (𝓝 0) := by + simpa using (tendsto_pow_atTop_nhds_zero_of_lt_one (by positivity : 0 ≤ 2/ρ) + ((div_lt_one hρ0).mpr hρ)).const_mul (8192*‖Λ‖*‖f‖) + exact sub_eq_zero.mp (norm_eq_zero.mp (le_antisymm (ge_of_tendsto ht (Eventually.of_forall hn)) (norm_nonneg _))) + +lemma positive_functional_strict.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [Nonempty X] (Λ : C(X,ℝ) →L[ℝ] ℝ) (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (h1 : 0 < Λ 1) (f : C(X,ℝ)) (hf : ∀ x, 0 < f x) : 0 < Λ f := by + obtain ⟨x,_,hx⟩ := isCompact_univ.exists_isMinOn Set.univ_nonempty f.continuous.continuousOn + have hlo : (f x) • (1 : C(X,ℝ)) ≤ f := by intro y; simpa using hx (mem_univ y) + have hh := hp (f-(f x) • 1) (sub_nonneg.mpr hlo) + simp only [map_sub,map_smul,smul_eq_mul] at hh + exact lt_of_lt_of_le (mul_pos (hf x) h1) (sub_nonneg.mp hh) + +def probabilityFunctional.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] (μ : ProbabilityMeasure X) : C(X,ℝ) →L[ℝ] ℝ := + positiveFunctionalCLM + { toFun := fun f => ∫ x, f x ∂(μ : Measure X) + map_add' := fun f g => integral_add (f.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)) + (g.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)) + map_smul' := fun c f => integral_smul c f } + (fun _ hf => integral_nonneg hf) + +lemma probabilityFunctional_apply.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] (μ : ProbabilityMeasure X) (f : C(X,ℝ)) : + probabilityFunctional μ f = ∫ x, f x ∂(μ : Measure X) := rfl + +lemma probabilityFunctional_one.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] (μ : ProbabilityMeasure X) : + probabilityFunctional μ 1 = 1 := by simp [probabilityFunctional_apply] + +lemma probabilityFunctional_pos.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] (μ : ProbabilityMeasure X) (f : C(X,ℝ)) (hf : 0 ≤ f) : + 0 ≤ probabilityFunctional μ f := integral_nonneg hf + +lemma periodic_dyadic_integral (F : ℝ → ℝ) (hc : Continuous F) (hp : Function.Periodic F 2) : + (∫ x in (0 : ℝ)..2, (F (-1/2+x/2)+F (1/2+x/2))) = 2*∫ x in (0 : ℝ)..2, F x := by + have hm : (∫ x in (0 : ℝ)..2, F (-1/2+x/2)) = 2*∫ x in (-1/2 : ℝ)..(1/2), F x := by + have hh := intervalIntegral.integral_comp_mul_add (a := (0 : ℝ)) (b := 2) F + (by norm_num : (1/2 : ℝ) ≠ 0) (-1/2) + convert hh using 1 <;> (try { congr 1; funext x; congr 1; ring }); norm_num + have hp' : (∫ x in (0 : ℝ)..2, F (1/2+x/2)) = 2*∫ x in (1/2 : ℝ)..(3/2), F x := by + have hh := intervalIntegral.integral_comp_mul_add (a := (0 : ℝ)) (b := 2) F + (by norm_num : (1/2 : ℝ) ≠ 0) (1/2) + convert hh using 1 <;> (try { congr 1; funext x; congr 1; ring }); norm_num + have hi : (∫ x in (-1/2 : ℝ)..(3/2), F x) = ∫ x in (0 : ℝ)..2, F x := by + convert hp.intervalIntegral_add_eq (-1/2) 0 using 1 <;> norm_num + have hcm : Continuous (fun x : ℝ => F (-1/2+x/2)) := hc.comp (continuous_const.add (continuous_id.div_const 2)) + have hcp : Continuous (fun x : ℝ => F (1/2+x/2)) := hc.comp (continuous_const.add (continuous_id.div_const 2)) + rw [intervalIntegral.integral_add (hcm.intervalIntegrable _ _) (hcp.intervalIntegrable _ _),hm,hp',← mul_add, + intervalIntegral.integral_add_adjacent_intervals (hc.intervalIntegrable _ _) (hc.intervalIntegrable _ _),hi] + +lemma continuous_pointOperator_x (y : ℝ) (hy : 0 < y) (f : C(DiskClass,ℝ)) : + Continuous (fun x : ℝ => pointOperator x y hy f) := + (continuous_affineOperator_apply f).comp (continuous_halfPoint continuous_id continuous_const (fun _ => hy)) + +lemma continuous_horizontalOperator (f : C(DiskClass,ℝ)) : + Continuous (fun x : ℝ => affineOperator (horizontal x) f) := continuous_pointOperator_x 1 zero_lt_one f + +def horizontalAverage (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) : + C(DiskClass,ℝ) →L[ℝ] ℝ := + (1/2 : ℝ) • intervalFunctional (fun x => affineOperator (horizontal x)) continuous_horizontalOperator + (fun _ => affineOperator_pos _) Λ hp 0 2 (by norm_num) + +lemma horizontalAverage_apply (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (f : C(DiskClass,ℝ)) : horizontalAverage Λ hp f = (1/2 : ℝ)*∫ x in (0 : ℝ)..2, Λ (affineOperator (horizontal x) f) := rfl + +lemma horizontalAverage_nonneg (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (f : C(DiskClass,ℝ)) (hf : 0 ≤ f) : 0 ≤ horizontalAverage Λ hp f := by + rw [horizontalAverage_apply] + apply mul_nonneg (by norm_num) + exact intervalIntegral.integral_nonneg (by norm_num) (fun x _ => hp _ (affineOperator_pos _ f hf)) + +lemma horizontalAverage_mass_pos (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (h1 : 0 < Λ 1) : 0 < horizontalAverage Λ hp 1 := by + rw [horizontalAverage_apply] + apply mul_pos (by norm_num) + apply intervalIntegral.integral_pos (by norm_num) + (Λ.continuous.comp (continuous_horizontalOperator 1)).continuousOn + (fun x _ => hp _ (affineOperator_pos _ 1 (by intro; simp))) + refine ⟨0,by norm_num,?_⟩ + change 0 < Λ (pointOperator 0 1 zero_lt_one 1) + rw [pointOperator_zero_one,one_apply_eq_self] + exact h1 + +lemma functional_point_periodic (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) + (hper : ∀ f, Λ (affineOperator (horizontal 2) f) = Λ f) + (y : ℝ) (hy : 0 < y) (f : C(DiskClass,ℝ)) : + Function.Periodic (fun x : ℝ => Λ (pointOperator x y hy f)) 2 := by + intro x + have hh := hper (pointOperator x y hy f) + rw [← pointOperator_horizontal,← mul_apply_eq_comp,pointOperator_mul] at hh + simpa only [one_mul,add_comm x 2] using hh + +lemma horizontalAverage_point (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (u v : ℝ) (hv : 0 < v) (f : C(DiskClass,ℝ)) : + horizontalAverage Λ hp (pointOperator u v hv f) = + (1/2 : ℝ)*∫ x in (0 : ℝ)..2, Λ (pointOperator (x+u) v hv f) := by + rw [horizontalAverage_apply] + congr 1 + apply intervalIntegral.integral_congr + intro x _ + dsimp only + rw [← pointOperator_horizontal,← mul_apply_eq_comp,pointOperator_mul] + simp only [one_mul] + +lemma horizontalAverage_invariant (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (hper : ∀ f, Λ (affineOperator (horizontal 2) f) = Λ f) + (t : ℝ) (f : C(DiskClass,ℝ)) : + horizontalAverage Λ hp (affineOperator (horizontal t) f) = horizontalAverage Λ hp f := by + rw [← pointOperator_horizontal,horizontalAverage_point] + rw [intervalIntegral.integral_comp_add_right (fun x => Λ (pointOperator x 1 zero_lt_one f)) t] + have hh := (functional_point_periodic Λ hper 1 zero_lt_one f).intervalIntegral_add_eq t 0 + rw [zero_add] at hh + rw [zero_add,add_comm 2 t,hh,horizontalAverage_apply] + rfl + +lemma horizontalAverage_half_scale (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (hper : ∀ f, Λ (affineOperator (horizontal 2) f) = Λ f) + (ρ : ℝ) (heig : ∀ f, Λ (transferOperator f) = ρ*Λ f) (f : C(DiskClass,ℝ)) : + horizontalAverage Λ hp (pointOperator 0 (1/2) (by norm_num) f) = ρ*horizontalAverage Λ hp f := by + have he (x : ℝ) : ρ*Λ (affineOperator (horizontal x) f) = + (1/2 : ℝ)*(Λ (pointOperator (-1/2+x/2) (1/2) (by norm_num) f)+ + Λ (pointOperator (1/2+x/2) (1/2) (by norm_num) f)) := by + rw [← heig] + change Λ (((1/2 : ℝ) • (pointOperator (-1/2) (1/2) (by norm_num)+pointOperator (1/2) (1/2) (by norm_num))) + (pointOperator x 1 zero_lt_one f)) = _ + rw [← mul_apply_eq_comp,smul_mul_assoc,add_mul] + simp only [pointOperator_mul,mul_one,smul_apply,map_smul,add_apply,map_add,smul_eq_mul] + simp only [show (1/2 : ℝ)*x = x/2 by ring] + have hc : Continuous (fun x : ℝ => Λ (pointOperator x (1/2) (by norm_num) f)) := + Λ.continuous.comp (continuous_pointOperator_x _ _ f) + have hi := periodic_dyadic_integral (fun x => Λ (pointOperator x (1/2) (by norm_num) f)) hc + (functional_point_periodic Λ hper (1/2) (by norm_num) f) + rw [horizontalAverage_point,horizontalAverage_apply] + simp only [add_zero] + rw [show ρ*((1/2 : ℝ)*∫ x in (0 : ℝ)..2, Λ (affineOperator (horizontal x) f)) = + (1/2 : ℝ)*(∫ x in (0 : ℝ)..2, ρ*Λ (affineOperator (horizontal x) f)) by + rw [intervalIntegral.integral_const_mul]; ring] + simp_rw [he] + rw [intervalIntegral.integral_const_mul,hi] + ring + +lemma period_average_invariant.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (A : ℝ → C(X,ℝ) →L[ℝ] C(X,ℝ)) + (hc : ∀ f, Continuous (fun t => A t f)) + (hp : ∀ t f, 0 ≤ f → 0 ≤ A t f) + (hm : ∀ t s, A (t+s) = A t*A s) + (Λ : C(X,ℝ) →L[ℝ] ℝ) (hΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (l : ℝ) (hl : 0 ≤ l) (hper : ∀ f, Λ (A l f) = Λ f) + (s : ℝ) (f : C(X,ℝ)) : + intervalFunctional A hc hp Λ hΛ 0 l hl (A s f) = + intervalFunctional A hc hp Λ hΛ 0 l hl f := by + have hfper : Function.Periodic (fun t : ℝ => Λ (A t f)) l := by + intro t + dsimp only + rw [add_comm t l,hm,mul_apply_eq_comp,hper] + rw [intervalFunctional_apply,intervalFunctional_apply] + have he (t : ℝ) : Λ (A t (A s f)) = Λ (A (t+s) f) := by rw [hm,mul_apply_eq_comp] + simp_rw [he] + rw [intervalIntegral.integral_comp_add_right (fun t => Λ (A t f)) s] + simpa only [zero_add,add_comm l s] using hfper.intervalIntegral_add_eq s 0 + +lemma intervalFunctional_mass_pos.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (A : ℝ → C(X,ℝ) →L[ℝ] C(X,ℝ)) + (hc : ∀ f, Continuous (fun t => A t f)) + (hp : ∀ t f, 0 ≤ f → 0 ≤ A t f) + (h0 : A 0 = 1) + (Λ : C(X,ℝ) →L[ℝ] ℝ) (hΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (h1 : 0 < Λ 1) (l : ℝ) (hl : 0 < l) : + 0 < intervalFunctional A hc hp Λ hΛ 0 l hl.le 1 := by + rw [intervalFunctional_apply] + apply intervalIntegral.integral_pos hl (Λ.continuous.comp (hc 1)).continuousOn + (fun t _ => hΛ _ (hp _ _ (by intro; simp))) + refine ⟨0,by simp [hl.le],?_⟩ + change 0 < Λ (A 0 1) + simpa only [h0,one_apply_eq_self] using h1 + +def logScaledOperator (β t : ℝ) : C(DiskClass,ℝ) →L[ℝ] C(DiskClass,ℝ) := + Real.exp (β*t) • pointOperator 0 (Real.exp t) (Real.exp_pos t) + +lemma logScaledOperator_apply (β t : ℝ) (f : C(DiskClass,ℝ)) : + logScaledOperator β t f = Real.exp (β*t) • pointOperator 0 (Real.exp t) (Real.exp_pos t) f := rfl + +lemma continuous_logScaledOperator (β : ℝ) (f : C(DiskClass,ℝ)) : + Continuous (fun t => logScaledOperator β t f) := by + exact (Real.continuous_exp.comp (continuous_const.mul continuous_id)).smul + ((continuous_affineOperator_apply f).comp + (continuous_halfPoint continuous_const Real.continuous_exp Real.exp_pos)) + +lemma logScaledOperator_pos (β t : ℝ) (f : C(DiskClass,ℝ)) (hf : 0 ≤ f) : + 0 ≤ logScaledOperator β t f := by + rw [logScaledOperator_apply] + exact smul_nonneg (Real.exp_pos _).le (affineOperator_pos _ f hf) + +lemma logScaledOperator_zero (β : ℝ) : logScaledOperator β 0 = 1 := by + simp only [logScaledOperator,mul_zero,Real.exp_zero,one_smul,pointOperator_zero_one] + +lemma logScaledOperator_add (β t s : ℝ) : + logScaledOperator β (t+s) = logScaledOperator β t*logScaledOperator β s := by + simp only [logScaledOperator,smul_mul_smul_comm,pointOperator_mul,mul_zero,add_zero,Real.exp_add,mul_add] + +lemma logScaledOperator_horizontal (β t u : ℝ) : + logScaledOperator β t*affineOperator (horizontal u) = + affineOperator (horizontal (Real.exp t*u))*logScaledOperator β t := by + simp only [logScaledOperator,← pointOperator_horizontal,smul_mul_assoc,mul_smul_comm,pointOperator_mul, + mul_one,one_mul,mul_zero,zero_add,add_zero] + +lemma horizontalAverage_log_period (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) + (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (hper : ∀ f, Λ (affineOperator (horizontal 2) f) = Λ f) + (ρ : ℝ) (hρ : 0 < ρ) (heig : ∀ f, Λ (transferOperator f) = ρ*Λ f) + (f : C(DiskClass,ℝ)) : + horizontalAverage Λ hp (logScaledOperator (Real.log ρ/Real.log 2) (Real.log 2) f) = + horizontalAverage Λ hp f := by + have he := horizontalAverage_half_scale Λ hp hper ρ heig (pointOperator 0 2 (by norm_num) f) + rw [← mul_apply_eq_comp,pointOperator_mul] at he + norm_num only [mul_zero,add_zero,show (1/2 : ℝ)*2 = 1 by norm_num,pointOperator_zero_one,one_apply_eq_self] at he + rw [logScaledOperator_apply,map_smul,smul_eq_mul] + rw [div_mul_cancel₀ _ (ne_of_gt (Real.log_pos (by norm_num : (1 : ℝ) < 2))), + Real.exp_log hρ] + simp only [Real.exp_log (by norm_num : (0 : ℝ) < 2)] + exact he.symm + +def scaleAverage (β : ℝ) (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) + (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) : C(DiskClass,ℝ) →L[ℝ] ℝ := + intervalFunctional (logScaledOperator β) (continuous_logScaledOperator β) (logScaledOperator_pos β) + Λ hp 0 (Real.log 2) (Real.log_nonneg (by norm_num)) + +lemma scaleAverage_apply (β : ℝ) (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) + (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) (f : C(DiskClass,ℝ)) : + scaleAverage β Λ hp f = ∫ t in (0 : ℝ)..Real.log 2, Λ (logScaledOperator β t f) := rfl + +lemma scaleAverage_pos (β : ℝ) (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) + (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) (f : C(DiskClass,ℝ)) (hf : 0 ≤ f) : + 0 ≤ scaleAverage β Λ hp f := + intervalFunctional_nonneg _ _ _ _ hp _ _ _ f hf + +lemma scaleAverage_mass_pos (β : ℝ) (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) + (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) (h1 : 0 < Λ 1) : 0 < scaleAverage β Λ hp 1 := + intervalFunctional_mass_pos _ _ _ (logScaledOperator_zero β) Λ hp h1 _ (Real.log_pos (by norm_num)) + +lemma scaleAverage_covariant (β : ℝ) (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) + (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (hper : ∀ f, Λ (logScaledOperator β (Real.log 2) f) = Λ f) + (y : ℝ) (hy : 0 < y) (f : C(DiskClass,ℝ)) : + scaleAverage β Λ hp (pointOperator 0 y hy f) = y^(-β)*scaleAverage β Λ hp f := by + have he := period_average_invariant (logScaledOperator β) (continuous_logScaledOperator β) + (logScaledOperator_pos β) (logScaledOperator_add β) Λ hp (Real.log 2) + (Real.log_nonneg (by norm_num)) hper (Real.log y) f + change scaleAverage β Λ hp (logScaledOperator β (Real.log y) f) = scaleAverage β Λ hp f at he + simp only [logScaledOperator_apply,map_smul,smul_eq_mul,Real.exp_log hy] at he + rw [Real.rpow_def_of_pos hy] + have hinv : Real.exp (Real.log y*(-β))*Real.exp (β*Real.log y) = 1 := by + rw [← Real.exp_add,show Real.log y*(-β)+β*Real.log y = 0 by ring,Real.exp_zero] + calc + _ = (Real.exp (Real.log y*(-β))*Real.exp (β*Real.log y))*scaleAverage β Λ hp (pointOperator 0 y hy f) := by rw [hinv,one_mul] + _ = _ := by rw [mul_assoc,he] + +lemma scaleAverage_horizontal (β : ℝ) (Λ : C(DiskClass,ℝ) →L[ℝ] ℝ) + (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) + (hh : ∀ u f, Λ (affineOperator (horizontal u) f) = Λ f) + (u : ℝ) (f : C(DiskClass,ℝ)) : + scaleAverage β Λ hp (affineOperator (horizontal u) f) = scaleAverage β Λ hp f := by + rw [scaleAverage_apply,scaleAverage_apply] + apply intervalIntegral.integral_congr + intro t _ + dsimp only + rw [← mul_apply_eq_comp,logScaledOperator_horizontal,mul_apply_eq_comp,hh] + +def transferRho : ℝ := growthRate transferOperator transferOperator_pow_norm_ge_one + +def transferBeta : ℝ := Real.log transferRho/Real.log 2 + +lemma transferBeta_gt_one (hρ : 2 < transferRho) : 1 < transferBeta := by + apply (lt_div_iff₀ (Real.log_pos (by norm_num : (1 : ℝ) < 2))).mpr + rw [one_mul] + exact Real.log_lt_log (by norm_num) hρ + +lemma exists_weighted_continuous_law (hρ : 2 < transferRho) : + ∃ P : ProbabilityMeasure DiskClass, ∀ z : halfPlane, ∀ f : C(DiskClass,ℝ), + (∫ g, classWeight g z*f (rerootClass g z) ∂(P : Measure DiskClass)) = + (z.val.im)^(-transferBeta)*(∫ g, f g ∂(P : Measure DiskClass)) := by + obtain ⟨μ,hμ⟩ := exists_growth_eigenmeasure transferOperator transferOperator_pos transferOperator_pow_norm_ge_one + let Λ := probabilityFunctional μ + have hp : ∀ f, 0 ≤ f → 0 ≤ Λ f := probabilityFunctional_pos μ + have h1 : Λ 1 = 1 := probabilityFunctional_one μ + have heig : ∀ f, Λ (transferOperator f) = transferRho*Λ f := hμ + have hper := eigenfunctional_horizontal_period Λ transferRho hρ heig + let H := horizontalAverage Λ hp + have hH : ∀ f, 0 ≤ f → 0 ≤ H f := horizontalAverage_nonneg Λ hp + have hH1 : 0 < H 1 := horizontalAverage_mass_pos Λ hp (by rw [h1]; norm_num) + have hHper : ∀ f, H (logScaledOperator transferBeta (Real.log 2) f) = H f := + horizontalAverage_log_period Λ hp hper transferRho (by linarith) heig + have hHh : ∀ u f, H (affineOperator (horizontal u) f) = H f := horizontalAverage_invariant Λ hp hper + let ν := scaleAverage transferBeta H hH + have hν : ∀ f, 0 ≤ f → 0 ≤ ν f := scaleAverage_pos transferBeta H hH + have hν1 : 0 < ν 1 := scaleAverage_mass_pos transferBeta H hH hH1 + have hνh : ∀ u f, ν (affineOperator (horizontal u) f) = ν f := scaleAverage_horizontal transferBeta H hH hHh + have hνs : ∀ y (hy : 0 < y) f, ν (pointOperator 0 y hy f) = y^(-transferBeta)*ν f := + scaleAverage_covariant transferBeta H hH hHper + let PiF : C(DiskClass,ℝ) →L[ℝ] ℝ := (ν 1)⁻¹ • ν + have hPiF : ∀ f, 0 ≤ f → 0 ≤ PiF f := fun f hf => mul_nonneg (inv_nonneg.mpr hν1.le) (hν f hf) + have hPiF1 : PiF 1 = 1 := by change (ν 1)⁻¹*ν 1 = 1; exact inv_mul_cancel₀ (ne_of_gt hν1) + obtain ⟨P,hP⟩ := probability_of_positive_functional PiF hPiF hPiF1 + refine ⟨P,fun z f => ?_⟩ + have hz : 0 < z.val.im := z.2 + have hez : affineOperator z = affineOperator (horizontal z.val.re)*pointOperator 0 z.val.im hz := by + rw [← pointOperator_horizontal,pointOperator_mul] + congr 1 + apply Subtype.ext + simpa only [halfPoint,mul_zero,add_zero,one_mul] using z.val.re_add_im.symm + change (∫ g, (affineOperator z f) g ∂(P : Measure DiskClass)) = _ + rw [hP,hP] + change (ν 1)⁻¹*ν (affineOperator z f) = _ + rw [hez,mul_apply_eq_comp,hνh,hνs] + change (ν 1)⁻¹*((z.val.im)^(-transferBeta)*ν f) = (z.val.im)^(-transferBeta)*((ν 1)⁻¹*ν f) + ring + +lemma weighted_measure_eq.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [T2Space X] [PseudoMetrizableSpace X] [MeasurableSpace X] [BorelSpace X] + (μ : Measure X) [IsFiniteMeasure μ] (w : C(X,ℝ)) (hw : ∀ x, 0 ≤ w x) + (T : C(X,X)) (c : ℝ) (hc : 0 ≤ c) + (he : ∀ f : C(X,ℝ), (∫ x, w x*f (T x) ∂μ) = c*∫ x, f x ∂μ) : + Measure.map T (μ.withDensity (fun x => ENNReal.ofReal (w x))) = ENNReal.ofReal c • μ := by + let ν := μ.withDensity (fun x => ENNReal.ofReal (w x)) + have : IsFiniteMeasure ν := isFiniteMeasure_withDensity_ofReal + (w.continuous.integrable_of_hasCompactSupport (μ := μ) (HasCompactSupport.of_compactSpace w)).hasFiniteIntegral + have : (ENNReal.ofReal c • μ).Regular := Measure.Regular.smul (μ := μ) ENNReal.ofReal_ne_top + have hwmeas : Measurable (fun x => ENNReal.ofReal (w x)) := w.continuous.measurable.ennreal_ofReal + apply Measure.ext_of_integral_eq_on_compactlySupported + intro f + change (∫ x, f.toContinuousMap x ∂Measure.map T (μ.withDensity (fun x => ENNReal.ofReal (w x)))) = ∫ x, f.toContinuousMap x ∂ENNReal.ofReal c • μ + rw [integral_map T.continuous.measurable.aemeasurable f.continuous.aestronglyMeasurable] + rw [integral_withDensity_eq_integral_toReal_smul hwmeas (Eventually.of_forall (fun _ => ENNReal.ofReal_lt_top))] + simp only [ENNReal.toReal_ofReal (hw _),smul_eq_mul] + rw [he f.toContinuousMap,integral_smul_measure,ENNReal.toReal_ofReal hc,smul_eq_mul] + +lemma weighted_lintegral_of_continuous.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [T2Space X] [PseudoMetrizableSpace X] [MeasurableSpace X] [BorelSpace X] + (μ : Measure X) [IsFiniteMeasure μ] (w : C(X,ℝ)) (hw : ∀ x, 0 ≤ w x) + (T : C(X,X)) (c : ℝ) (hc : 0 ≤ c) + (he : ∀ f : C(X,ℝ), (∫ x, w x*f (T x) ∂μ) = c*∫ x, f x ∂μ) + (f : X → ℝ≥0∞) (hf : Measurable f) : + (∫⁻ x, ENNReal.ofReal (w x)*f (T x) ∂μ) = ENNReal.ofReal c*∫⁻ x, f x ∂μ := by + have hh := weighted_measure_eq μ w hw T c hc he + have hi := congrArg (fun ν : Measure X => ∫⁻ x, f x ∂ν) hh + rw [lintegral_map hf T.continuous.measurable, lintegral_smul_measure] at hi + change (∫⁻ x, (f ∘ T) x ∂μ.withDensity (fun x => ENNReal.ofReal (w x))) = _ at hi + rw [lintegral_withDensity_eq_lintegral_mul μ w.continuous.measurable.ennreal_ofReal (hf.comp T.continuous.measurable)] at hi + simpa only [Pi.mul_apply,smul_eq_mul,Function.comp_def] using hi + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/AreaTransport.lean b/lean/OAI/Analysis/IntegralMeans/AreaTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..2431e7a3e056a1eee65020a6dd029b5b400a0cf6 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/AreaTransport.lean @@ -0,0 +1,235 @@ +import OAI.Analysis.IntegralMeans.BorelPairing + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +def fiberSum.{u_1, u_2} {X : Type u_1} {Y : Type u_2} (f : X → Y) (s : Set X) (u : X → ℝ≥0∞) (y : Y) : ℝ≥0∞ := + ∑' x : {x | x ∈ s ∧ f x = y}, u x + +lemma BorelBranches.fiberSum_eq.{u_1, u_2} {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] + {f : X → Y} {s : Set X} (B : BorelBranches f s) (u : X → ℝ≥0∞) (y : Y) : + fiberSum f s u y = ∑' n, (f '' B.part n).indicator (fun y => u (B.branch n y)) y := by + classical + have he : {x | x ∈ s ∧ f x = y} = ⋃ n, {x | x ∈ B.part n ∧ f x = y} := by + ext x + simp only [mem_ofPred_eq] + rw [show x ∈ s ↔ x ∈ ⋃ n, B.part n from by rw [B.cover]] + simp only [mem_ofPred_eq,mem_iUnion] + aesop + rw [fiberSum,he,ENNReal.tsum_biUnion] + · apply tsum_congr + intro n + by_cases hy : y ∈ f '' B.part n + · have hx : {x | x ∈ B.part n ∧ f x = y} = {B.branch n y} := by + ext x + constructor + · intro hx + exact mem_singleton_iff.mpr (B.injective n hx.1 (B.right_inv n y hy).1 + (hx.2.trans (B.right_inv n y hy).2.symm)) + · rintro rfl + exact B.right_inv n y hy + rw [hx,tsum_singleton,indicator_of_mem hy] + · have hx : {x | x ∈ B.part n ∧ f x = y} = ∅ := by + exact eq_empty_iff_forall_notMem.mpr (fun x hx => hy ⟨x,hx.1,hx.2⟩) + simp [hx,hy] + · intro n _ m _ hnm + exact (B.disjoint hnm).mono (fun _ h => h.1) (fun _ h => h.1) + +lemma BorelBranches.measurable_fiberSum.{u_1, u_2} {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] + {f : X → Y} {s : Set X} (B : BorelBranches f s) {u : X → ℝ≥0∞} (hu : Measurable u) : + Measurable (fiberSum f s u) := by + have he := funext (B.fiberSum_eq u) + rw [he] + exact Measurable.tsum (fun n => (hu.comp (B.measurable_branch n)).indicator (B.measurable_image n)) + +lemma weighted_area_formula_regular {f : ℂ → ℂ} {s : Set ℂ} + (hs : MeasurableSet s) (hf : ∀ z ∈ s, ContDiffAt ℝ 1 f z) + (hreg : ∀ z ∈ s, LinearMap.det (fderiv ℝ f z).toLinearMap ≠ 0) + {u : ℂ → ℝ≥0∞} (hu : Measurable u) : + Measurable (fiberSum f s u) ∧ + (∫⁻ z in s, ENNReal.ofReal |LinearMap.det (fderiv ℝ f z).toLinearMap| * u z) = + ∫⁻ y, fiberSum f s u y := by + let B := Classical.choice (exists_borelBranches + (fun z hz => (hf z hz).continuousAt.continuousWithinAt) + (exists_countable_injective_partition hs hf hreg)) + have hsub (n : ℕ) : B.part n ⊆ s := fun z hz => by rw [← B.cover]; exact mem_iUnion.mpr ⟨n,hz⟩ + have hder (n : ℕ) (z : ℂ) (hz : z ∈ B.part n) : + HasFDerivWithinAt f (fderiv ℝ f z) (B.part n) z := + ((hf z (hsub n hz)).differentiableAt (by norm_num)).hasFDerivAt.hasFDerivWithinAt + refine ⟨B.measurable_fiberSum hu,?_⟩ + calc + (∫⁻ z in s, ENNReal.ofReal |LinearMap.det (fderiv ℝ f z).toLinearMap| * u z) = + ∑' n, ∫⁻ z in B.part n, ENNReal.ofReal |LinearMap.det (fderiv ℝ f z).toLinearMap| * u z := by + conv_lhs => rw [← B.cover] + exact lintegral_iUnion B.measurable_part B.disjoint _ + _ = ∑' n, ∫⁻ y in f '' B.part n, u (B.branch n y) := by + apply tsum_congr + intro n + rw [lintegral_image_eq_lintegral_abs_det_fderiv_mul volume (B.measurable_part n) (hder n) (B.injective n)] + apply setLIntegral_congr_fun (B.measurable_part n) + intro z hz + dsimp only + rw [B.left_inv n z hz] + _ = ∫⁻ y, fiberSum f s u y := by + rw [funext (B.fiberSum_eq u),lintegral_tsum] + · exact tsum_congr (fun n => (lintegral_indicator (B.measurable_image n) _).symm) + · exact fun n => ((hu.comp (B.measurable_branch n)).indicator (B.measurable_image n)).aemeasurable + +lemma fiberSum_mono_injective.{u_1, u_2} {X : Type u_1} {Y : Type u_2} {f : X → Y} {s t : Set X} {u v : X → ℝ≥0∞} + (R : X → X) (y : Y) + (hR : ∀ x ∈ s, f x = y → R x ∈ t ∧ f (R x) = y) + (hinj : InjOn R {x | x ∈ s ∧ f x = y}) + (hle : ∀ x ∈ s, f x = y → u x ≤ v (R x)) : + fiberSum f s u y ≤ fiberSum f t v y := by + let e : {x | x ∈ s ∧ f x = y} → {x | x ∈ t ∧ f x = y} := fun x => + ⟨R x,hR x x.property.1 x.property.2⟩ + have hi : Injective e := fun a b h => Subtype.ext + (hinj a.property b.property (congrArg Subtype.val h)) + exact ENNReal.summable.tsum_le_tsum_of_inj e hi (fun _ _ => zero_le) + (fun x => hle x x.property.1 x.property.2) ENNReal.summable + +lemma contDiffAt_criticalMap {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z : ℂ} (hz : z ∈ halfPlane) (k : ℝ) : ContDiffAt ℝ 1 (criticalMap f k) z := by + have han : AnalyticAt ℂ f z := hf.1.analyticOnNhd isOpen_halfPlane z hz + have hc : ContDiffAt ℝ 1 (fun w : ℂ => (w.im : ℂ)) z := + Complex.ofRealCLM.contDiff.contDiffAt.comp z Complex.imCLM.contDiff.contDiffAt + exact (han.contDiffAt.restrict_scalars ℝ).sub + ((contDiffAt_const.mul hc).mul (han.deriv.contDiffAt.restrict_scalars ℝ)) + +lemma measurableSet_halfPlane_pred (P : ℂ → Prop) + (hP : MeasurableSet {z : halfPlane | P z}) : + MeasurableSet {z : ℂ | z ∈ halfPlane ∧ P z} := by + have h := isOpen_halfPlane.measurableSet.subtype_image hP + convert h using 1 + ext z + simp only [mem_ofPred_eq,mem_image,Subtype.exists,exists_prop] + aesop + +def jacobianRegion (g : DiskClass) (k σ : ℝ) : Set ℂ := + {z | z ∈ halfPlane ∧ 0 < σ * normalizedJacobian (classFun g) k z} + +lemma measurableSet_jacobianRegion (g : DiskClass) (k σ : ℝ) : + MeasurableSet (jacobianRegion g k σ) := by + apply measurableSet_halfPlane_pred + exact measurableSet_lt measurable_const + (measurable_const.mul (((continuous_class_normalizedJacobian k).comp + (continuous_const.prodMk continuous_id)).measurable)) + +lemma jacobianRegion_regular (g : DiskClass) (k σ : ℝ) {z : ℂ} + (hz : z ∈ jacobianRegion g k σ) : + LinearMap.det (fderiv ℝ (criticalMap (classFun g) k) z).toLinearMap ≠ 0 := by + intro hzero + have h := hz.2 + simp only [normalizedJacobian,hzero,zero_div,mul_zero] at h + exact lt_irrefl 0 h + +def transportDensity (g : DiskClass) (β : ℝ) (z : ℂ) : ℝ≥0∞ := + ENNReal.ofReal (z.im^(β-1)*‖reciprocalDeriv (classFun g) z‖^2) + +def targetDensity (g : DiskClass) (β : ℝ) : ℂ → ℝ≥0∞ := + halfPlane.indicator (fun z => ENNReal.ofReal (z.im^(β-1)*‖reciprocalDeriv (classFun g) z‖^4)) + +attribute [local irreducible] classWeight + +lemma measurable_targetDensity (g : DiskClass) (β : ℝ) : Measurable (targetDensity g β) := by + have hc : ContinuousOn (fun z : ℂ => ENNReal.ofReal (z.im^(β-1)*‖reciprocalDeriv (classFun g) z‖^4)) halfPlane := by + apply continuousOn_iff_continuous_domRestrict.mpr + have hm : Continuous (fun z : halfPlane => (g,z)) := continuous_const.prodMk continuous_id + have hq : Continuous (fun z : halfPlane => classWeight g z) := continuous_classWeight.comp hm + have hp : Continuous (fun z : halfPlane => z.val.im^(β-1)) := + (Complex.continuous_im.comp continuous_subtype_val).rpow_const (fun z => Or.inl (ne_of_gt z.property)) + convert ENNReal.continuous_ofReal.comp (hp.mul (hq.pow 2)) using 1 + funext z + simp only [domRestrict_apply,Function.comp_apply,Pi.mul_apply,Pi.pow_apply,classWeight,← pow_mul] + exact hc.measurable_piecewise continuousOn_const isOpen_halfPlane.measurableSet + +lemma transportDensity_jacobian (g : DiskClass) (β k σ : ℝ) (hσ : |σ| = 1) + {z : ℂ} (hz : z ∈ jacobianRegion g k σ) : + transportDensity g β z * ENNReal.ofReal (σ * normalizedJacobian (classFun g) k z) = + ENNReal.ofReal |LinearMap.det (fderiv ℝ (criticalMap (classFun g) k) z).toLinearMap| * targetDensity g β z := by + have hD : 0 < ‖deriv (classFun g) z‖ := norm_pos_iff.mpr + (univalent_deriv_ne_zero isOpen_halfPlane (classFun_schlicht g).1 hz.1) + have habs : |normalizedJacobian (classFun g) k z| = σ * normalizedJacobian (classFun g) k z := by + rw [← one_mul |normalizedJacobian (classFun g) k z|,← hσ,← abs_mul,abs_of_pos hz.2] + have hdet : |LinearMap.det (fderiv ℝ (criticalMap (classFun g) k) z).toLinearMap| = + ‖deriv (classFun g) z‖^2 * (σ * normalizedJacobian (classFun g) k z) := by + rw [← habs,normalizedJacobian,abs_div,abs_pow,abs_norm] + field_simp + rw [transportDensity,targetDensity,indicator_of_mem hz.1,hdet] + simp only [reciprocalDeriv,norm_inv] + rw [← ENNReal.ofReal_mul (mul_nonneg (Real.rpow_nonneg hz.1.le _) (sq_nonneg _)), + ← ENNReal.ofReal_mul (mul_nonneg (sq_nonneg _) hz.2.le)] + congr 1 + field_simp + +lemma transport_area (g : DiskClass) (β k σ : ℝ) (hσ : |σ| = 1) + {h : ℂ → ℝ≥0∞} (hm : Measurable h) : + (∫⁻ z in halfPlane, transportDensity g β z * + ENNReal.ofReal (σ * normalizedJacobian (classFun g) k z) * h z) = + ∫⁻ ξ, fiberSum (criticalMap (classFun g) k) (jacobianRegion g k σ) + (fun z => targetDensity g β z*h z) ξ := by + have hs := measurableSet_jacobianRegion g k σ + have he := (weighted_area_formula_regular hs + (fun z hz => contDiffAt_criticalMap (classFun_schlicht g).1 hz.1 k) + (fun z hz => jacobianRegion_regular g k σ hz) + ((measurable_targetDensity g β).mul hm)).2 + refine Eq.trans ?_ he + have hzero : (fun z => transportDensity g β z * + ENNReal.ofReal (σ * normalizedJacobian (classFun g) k z) * h z) =ᶠ[ae (volume.restrict halfPlane)] + (jacobianRegion g k σ).indicator (fun z => transportDensity g β z * + ENNReal.ofReal (σ * normalizedJacobian (classFun g) k z) * h z) := by + filter_upwards [ae_restrict_mem isOpen_halfPlane.measurableSet] with z hz + by_cases hj : 0 < σ * normalizedJacobian (classFun g) k z + · rw [indicator_of_mem (show z ∈ jacobianRegion g k σ from ⟨hz,hj⟩)] + · rw [indicator_of_notMem (show z ∉ jacobianRegion g k σ from fun h => hj h.2), + ENNReal.ofReal_eq_zero.mpr (le_of_not_gt hj),mul_zero,zero_mul] + rw [lintegral_congr_ae hzero,lintegral_indicator hs,Measure.restrict_restrict hs] + have hinter : jacobianRegion g k σ ∩ halfPlane = jacobianRegion g k σ := + inter_eq_left.mpr (fun z hz => hz.1) + rw [hinter] + apply setLIntegral_congr_fun hs + intro z hz + dsimp only + rw [transportDensity_jacobian g β k σ hσ hz,mul_assoc] + rfl + +lemma targetDensity_eq_height (g : DiskClass) {β k : ℝ} (hk : 0 < k) + (hb : β-1 = 4*(k-1)) {z : ℂ} (hz : z ∈ halfPlane) : + targetDensity g β z = ENNReal.ofReal ((criticalHeight (classFun g) k z/k)^4) := by + rw [targetDensity,indicator_of_mem hz,criticalHeight,hb,mul_comm (4 : ℝ),Real.rpow_mul hz.le] + congr 1 + simp only [Real.rpow_ofNat] + field_simp + +lemma targetDensity_le_pair (g : DiskClass) {β k : ℝ} (hk : 0 < k) + (hb : β-1 = 4*(k-1)) {z : ℂ} (hz : z ∈ halfPlane) + (hJ : 0 < normalizedJacobian (classFun g) k z) + (hg : GoodPair (classFun g) k (criticalMap (classFun g) k z)) : + targetDensity g β z ≤ targetDensity g β (criticalPair (classFun g) k z) := by + have hs := criticalPair_spec (classFun_schlicht g).1 hk hz hJ hg + rw [targetDensity_eq_height g hk hb hz,targetDensity_eq_height g hk hb hs.1] + apply ENNReal.ofReal_le_ofReal + gcongr + · exact div_nonneg (criticalHeight_pos (classFun_schlicht g).1 hk hz).le hk.le + · exact hs.2.2.2 + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/BorelPairing.lean b/lean/OAI/Analysis/IntegralMeans/BorelPairing.lean new file mode 100644 index 0000000000000000000000000000000000000000..bed8154837d3d8027cc0d359f8de8826d32652c6 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/BorelPairing.lean @@ -0,0 +1,571 @@ +import OAI.Analysis.IntegralMeans.RankPairing + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +lemma joint_locally_injective.{u_1} {P : Type u_1} [TopologicalSpace P] + {F : P → ℂ → ℂ} {DF : P → ℂ → ℂ →L[ℝ] ℂ} {s : Set ℂ} + (hs : IsOpen s) (hder : ∀ p z, z ∈ s → HasFDerivAt (F p) (DF p z) z) + (hc : ContinuousOn (fun q : P × ℂ => DF q.1 q.2) (univ ×ˢ s)) + {p : P} {z : ℂ} (hz : z ∈ s) (he : LinearMap.det (DF p z).toLinearMap ≠ 0) : + ∃ U : Set (P × ℂ), IsOpen U ∧ (p,z) ∈ U ∧ + InjOn (fun q : P × ℂ => (q.1,F q.1 q.2)) U := by + let e : ℂ ≃L[ℝ] ℂ := + (LinearMap.equivOfIsUnitDet (isUnit_iff_ne_zero.mpr he)).toContinuousLinearEquiv + have heq : (e : ℂ →L[ℝ] ℂ) = DF p z := by + ext v + exact LinearMap.equivOfIsUnitDet_apply (isUnit_iff_ne_zero.mpr he) v + let c : ℝ≥0 := ‖(e.symm : ℂ →L[ℝ] ℂ)‖₊⁻¹ / 2 + have hn : 0 < ‖(e.symm : ℂ →L[ℝ] ℂ)‖₊ := by exact_mod_cast e.symm.norm_pos + have hcpos : 0 < c := by dsimp [c]; positivity + have hclt : c < ‖(e.symm : ℂ →L[ℝ] ℂ)‖₊⁻¹ := by + dsimp [c] + exact half_lt_self (inv_pos.mpr hn) + have hcAt : ContinuousAt (fun q : P × ℂ => DF q.1 q.2) (p,z) := hc.continuousAt ((isOpen_univ.prod hs).mem_nhds ⟨mem_univ p,hz⟩) + have hnb : {q : P × ℂ | q.2 ∈ s ∧ ‖DF q.1 q.2-(e : ℂ →L[ℝ] ℂ)‖₊ < c} ∈ 𝓝 (p,z) := by + apply Filter.inter_mem + · exact continuous_snd.continuousAt.preimage_mem_nhds (hs.mem_nhds hz) + · exact ((hcAt.sub continuousAt_const).nnnorm).eventually + (gt_mem_nhds (by simpa only [Pi.sub_apply,heq,sub_self,nnnorm_zero] using hcpos)) + obtain ⟨u,hu,v,hv,huv⟩ := mem_nhds_prod_iff.mp hnb + obtain ⟨u',hu'u,hu'o,hpu⟩ := mem_nhds_iff.mp hu + obtain ⟨r,hr,hvr⟩ := Metric.mem_nhds_iff.mp hv + refine ⟨u' ×ˢ Metric.ball z r,hu'o.prod Metric.isOpen_ball,⟨hpu,Metric.mem_ball_self hr⟩,?_⟩ + rintro ⟨p1,z1⟩ h1 ⟨p2,z2⟩ h2 hh + have hp : p1 = p2 := congrArg Prod.fst hh + subst p2 + have hbound (w : ℂ) (hw : w ∈ Metric.ball z r) : + w ∈ s ∧ ‖DF p1 w-(e : ℂ →L[ℝ] ℂ)‖₊ < c := + huv (show (p1,w) ∈ u ×ˢ v from ⟨hu'u h1.1,hvr hw⟩) + have hLip : LipschitzOnWith c (fun w => F p1 w-e w) (Metric.ball z r) := by + apply (convex_ball z r).lipschitzOnWith_of_nnnorm_hasFDerivWithin_le + (fun w hw => ((hder p1 w (hbound w hw).1).sub e.hasFDerivAt).hasFDerivWithinAt) + exact fun w hw => (hbound w hw).2.le + have hInj := hLip.approximatesLinearOn.injOn (Or.inr hclt) + exact Prod.ext rfl (hInj h1.2 h2.2 (congrArg Prod.snd hh)) + +lemma countable_joint_injective_partition.{u_1} {P : Type u_1} [TopologicalSpace P] + [SecondCountableTopology P] [MeasurableSpace P] [BorelSpace P] + {F : P → ℂ → ℂ} {DF : P → ℂ → ℂ →L[ℝ] ℂ} {s : Set ℂ} + (hs : IsOpen s) (hder : ∀ p z, z ∈ s → HasFDerivAt (F p) (DF p z) z) + (hc : ContinuousOn (fun q : P × ℂ => DF q.1 q.2) (univ ×ˢ s)) : + ∃ p : ℕ → Set (P × ℂ), (∀ n, MeasurableSet (p n)) ∧ + Pairwise (Disjoint on p) ∧ + (⋃ n, p n) = {q | q.2 ∈ s ∧ LinearMap.det (DF q.1 q.2).toLinearMap ≠ 0} ∧ + ∀ n, InjOn (fun q : P × ℂ => (q.1,F q.1 q.2)) (p n) := by + classical + let t : Set (P × ℂ) := {q | q.2 ∈ s ∧ LinearMap.det (DF q.1 q.2).toLinearMap ≠ 0} + have htopen : IsOpen t := by + have h : IsOpen ((univ ×ˢ s) ∩ (fun q : P × ℂ => DF q.1 q.2) ⁻¹' {d | d.det ≠ 0}) := + hc.isOpen_inter_preimage (isOpen_univ.prod hs) + (isClosed_eq ContinuousLinearMap.continuous_det continuous_const).isOpen_compl + convert h using 1 + ext q + simp [t] + have hlocal (q : t) : ∃ U : Set (P × ℂ), IsOpen U ∧ q.val ∈ U ∧ + InjOn (fun q : P × ℂ => (q.1,F q.1 q.2)) U := + joint_locally_injective hs hder hc q.property.1 q.property.2 + choose U hUo hUq hUi using hlocal + by_cases he : t = ∅ + · refine ⟨fun _ => ∅,by simp,by simp [Pairwise],?_,by simp⟩ + simpa using he.symm + · have : Nonempty t := Set.nonempty_coe_sort.mpr (Set.nonempty_iff_ne_empty.mpr he) + obtain ⟨j,hj⟩ := (show IsLindelof t from HereditarilyLindelofSpace.isLindelof t).indexed_countable_subcover + U hUo (fun q hq => mem_iUnion.mpr ⟨⟨q,hq⟩,hUq ⟨q,hq⟩⟩) + let q : ℕ → Set (P × ℂ) := fun n => t ∩ U (j n) + refine ⟨disjointed q,?_,disjoint_disjointed q,?_,?_⟩ + · intro n + exact MeasurableSet.disjointed (fun n => htopen.measurableSet.inter (hUo (j n)).measurableSet) n + · rw [iUnion_disjointed] + ext z + simp only [mem_iUnion,mem_inter_iff,q] + exact ⟨fun ⟨_,hz,_⟩ => hz,fun hz => by obtain ⟨n,hn⟩ := mem_iUnion.mp (hj hz); exact ⟨n,hz,hn⟩⟩ + · intro n + exact (hUi (j n)).mono ((disjointed_subset q n).trans inter_subset_right) + +lemma exists_borel_partial_inverse.{u_1, u_2} {X : Type u_1} {Y : Type u_2} + [TopologicalSpace X] [PolishSpace X] [MeasurableSpace X] [BorelSpace X] [Nonempty X] + [TopologicalSpace Y] [T2Space Y] [MeasurableSpace Y] [BorelSpace Y] + {f : X → Y} {s : Set X} (hs : MeasurableSet s) (hf : ContinuousOn f s) (hi : InjOn f s) : + ∃ b : Y → X, Measurable b ∧ MeasurableSet (f '' s) ∧ + (∀ y ∈ f '' s, b y ∈ s ∧ f (b y) = y) ∧ ∀ x ∈ s, b (f x) = x := by + classical + have hm := hf.measurableEmbedding hs hi + by_cases hne : s.Nonempty + · let : Nonempty s := Set.nonempty_coe_sort.mpr hne + let b : Y → X := fun y => (hm.invFun y).val + refine ⟨b,measurable_subtype_coe.comp hm.measurable_invFun,?_,?_,?_⟩ + · simpa only [Set.range_domRestrict] using hm.measurableSet_range + · rintro y ⟨x,hx,rfl⟩ + have hb : b (f x) = x := congrArg Subtype.val (hm.leftInverse_invFun ⟨x,hx⟩) + exact ⟨hb.symm ▸ hx,congrArg f hb⟩ + · intro x hx + exact congrArg Subtype.val (hm.leftInverse_invFun ⟨x,hx⟩) + · have he : s = ∅ := not_nonempty_iff_eq_empty.mp hne + refine ⟨fun _ => Classical.arbitrary X,measurable_const,?_,?_,?_⟩ <;> simp [he] + +lemma fiber_count_eq_tsum_branches.{u_1, u_2} {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSingletonClass X] + {f : X → Y} {s : Set X} {p : ℕ → Set X} {b : ℕ → Y → X} + (hp : Pairwise (Disjoint on p)) (hu : (⋃ n, p n) = s) + (hi : ∀ n, InjOn f (p n)) + (hb : ∀ n y, y ∈ f '' p n → b n y ∈ p n ∧ f (b n y) = y) + (hinv : ∀ n x, x ∈ p n → b n (f x) = x) + (R : X → Prop) (y : Y) : + Measure.count {x | x ∈ s ∧ f x = y ∧ R x} = + ∑' n, if y ∈ f '' p n ∧ R (b n y) then (1 : ℝ≥0∞) else 0 := by + classical + have he : {x | x ∈ s ∧ f x = y ∧ R x} = ⋃ n, {x | x ∈ p n ∧ f x = y ∧ R x} := by + rw [← hu] + ext x + simp only [mem_ofPred_eq,mem_iUnion] + aesop + have hsub (n) : ({x | x ∈ p n ∧ f x = y ∧ R x} : Set X).Subsingleton := by + intro x hx z hz + exact hi n hx.1 hz.1 (hx.2.1.trans hz.2.1.symm) + rw [he,measure_iUnion] + · apply tsum_congr + intro n + by_cases hy : y ∈ f '' p n ∧ R (b n y) + · rw [ite_eq_left hy] + have hx : {x | x ∈ p n ∧ f x = y ∧ R x} = {b n y} := by + apply Set.Subsingleton.eq_singleton_of_mem (hsub n) + exact ⟨(hb n y hy.1).1,(hb n y hy.1).2,hy.2⟩ + rw [hx,Measure.count_singleton] + · rw [ite_eq_right hy] + have hx : {x | x ∈ p n ∧ f x = y ∧ R x} = ∅ := by + apply eq_empty_iff_forall_notMem.mpr + intro x hx + apply hy + refine ⟨⟨x,hx.1,hx.2.1⟩,?_⟩ + rw [← hx.2.1,hinv n x hx.1] + exact hx.2.2 + rw [hx,measure_empty] + · exact pairwise_disjoint_mono hp (fun n => fun x hx => hx.1) + · intro n + exact (hsub n).countable.measurableSet + +lemma measurable_fiber_count_branches.{u_1, u_2, u_3} {X : Type u_1} {Y : Type u_2} {Q : Type u_3} + [MeasurableSpace X] [MeasurableSingletonClass X] [MeasurableSpace Y] [MeasurableSpace Q] + {f : X → Y} {s : Set X} {p : ℕ → Set X} {b : ℕ → Y → X} + (hp : Pairwise (Disjoint on p)) (hu : (⋃ n, p n) = s) + (hi : ∀ n, InjOn f (p n)) (hbm : ∀ n, Measurable (b n)) + (hdm : ∀ n, MeasurableSet (f '' p n)) + (hb : ∀ n y, y ∈ f '' p n → b n y ∈ p n ∧ f (b n y) = y) + (hinv : ∀ n x, x ∈ p n → b n (f x) = x) + {R : Q → X → Prop} (hR : MeasurableSet {q : Q × X | R q.1 q.2}) + {y : Q → Y} (hy : Measurable y) : + Measurable (fun q => Measure.count {x | x ∈ s ∧ f x = y q ∧ R q x}) := by + classical + have he : (fun q => Measure.count {x | x ∈ s ∧ f x = y q ∧ R q x}) = + fun q => ∑' n, if y q ∈ f '' p n ∧ R q (b n (y q)) then (1 : ℝ≥0∞) else 0 := by + funext q + exact fiber_count_eq_tsum_branches hp hu hi hb hinv (R q) (y q) + rw [he] + apply Measurable.tsum + intro n + apply Measurable.ite + · exact (hdm n |>.preimage hy).inter + (hR.preimage (measurable_id.prodMk ((hbm n).comp hy))) + · exact measurable_const + · exact measurable_const + +lemma measurable_branch_selection.{u_1, u_2} {Q : Type u_1} {X : Type u_2} [MeasurableSpace Q] [MeasurableSpace X] + {b : ℕ → Q → X} {M : ℕ → Set Q} {f : Q → X} + (hb : ∀ n, Measurable (b n)) (hM : ∀ n, MeasurableSet (M n)) + (he : ∀ q, ∃ n, q ∈ M n) (hf : ∀ n q, q ∈ M n → f q = b n q) : Measurable f := by + intro T hT + have hset : f ⁻¹' T = ⋃ n, M n ∩ (b n) ⁻¹' T := by + ext q + constructor + · intro hq + obtain ⟨n,hn⟩ := he q + exact mem_iUnion.mpr ⟨n,hn,by simpa only [mem_preimage,← hf n q hn] using hq⟩ + · intro hq + obtain ⟨n,hn,ht⟩ := mem_iUnion.mp hq + simpa only [mem_preimage,hf n q hn] using ht + rw [hset] + exact MeasurableSet.iUnion (fun n => (hM n).inter (hT.preimage (hb n))) + +structure BorelBranches.{u_1, u_2} {X : Type u_1} {Y : Type u_2} [MeasurableSpace X] [MeasurableSpace Y] + (f : X → Y) (s : Set X) where + part : ℕ → Set X + branch : ℕ → Y → X + measurable_part : ∀ n, MeasurableSet (part n) + disjoint : Pairwise (Disjoint on part) + cover : (⋃ n, part n) = s + injective : ∀ n, InjOn f (part n) + measurable_branch : ∀ n, Measurable (branch n) + measurable_image : ∀ n, MeasurableSet (f '' part n) + right_inv : ∀ n y, y ∈ f '' part n → branch n y ∈ part n ∧ f (branch n y) = y + left_inv : ∀ n x, x ∈ part n → branch n (f x) = x + +lemma exists_borelBranches.{u_1, u_2} {X : Type u_1} {Y : Type u_2} + [TopologicalSpace X] [PolishSpace X] [MeasurableSpace X] [BorelSpace X] [Nonempty X] + [TopologicalSpace Y] [T2Space Y] [MeasurableSpace Y] [BorelSpace Y] + {f : X → Y} {s : Set X} (hf : ContinuousOn f s) + (hp : ∃ p : ℕ → Set X, (∀ n, MeasurableSet (p n)) ∧ Pairwise (Disjoint on p) ∧ + (⋃ n, p n) = s ∧ ∀ n, InjOn f (p n)) : Nonempty (BorelBranches f s) := by + obtain ⟨p,hpm,hpd,hpc,hpi⟩ := hp + have hb (n) := exists_borel_partial_inverse (hpm n) + (hf.mono (show p n ⊆ s from hpc ▸ subset_iUnion p n)) (hpi n) + choose b hbm him hbr hbl using hb + exact ⟨⟨p,b,hpm,hpd,hpc,hpi,hbm,him,hbr,hbl⟩⟩ + +lemma BorelBranches.measurable_count.{u_1, u_2, u_3} {X : Type u_1} {Y : Type u_2} {Q : Type u_3} + [MeasurableSpace X] [MeasurableSingletonClass X] [MeasurableSpace Y] [MeasurableSpace Q] + {f : X → Y} {s : Set X} (B : BorelBranches f s) + {R : Q → X → Prop} (hR : MeasurableSet {q : Q × X | R q.1 q.2}) + {y : Q → Y} (hy : Measurable y) : + Measurable (fun q => Measure.count {x | x ∈ s ∧ f x = y q ∧ R q x}) := + measurable_fiber_count_branches B.disjoint B.cover B.injective B.measurable_branch + B.measurable_image B.right_inv B.left_inv hR hy + +lemma count_product_fiber.{u_1, u_2, u_3} {P : Type u_1} {X : Type u_2} {Y : Type u_3} [MeasurableSpace P] [MeasurableSingletonClass P] + [MeasurableSpace X] [MeasurableSingletonClass X] (F : P → X → Y) + (R : P × X → Prop) (p : P) (y : Y) : + Measure.count {q : P × X | (q.1,F q.1 q.2) = (p,y) ∧ R q} = + Measure.count {x | F p x = y ∧ R (p,x)} := by + have he : {q : P × X | (q.1,F q.1 q.2) = (p,y) ∧ R q} = + (fun x => (p,x)) '' {x | F p x = y ∧ R (p,x)} := by + ext q + constructor + · rintro ⟨hq,hR⟩ + obtain rfl : q.1 = p := congrArg Prod.fst hq + exact ⟨q.2,⟨congrArg Prod.snd hq,hR⟩,rfl⟩ + · rintro ⟨x,⟨hx,hR⟩,rfl⟩ + exact ⟨Prod.ext rfl hx,hR⟩ + rw [he] + exact Measure.count_injective_image (fun _ _ h => congrArg Prod.snd h) _ + +lemma count_subtype_set.{u_1} {X : Type u_1} [MeasurableSpace X] [MeasurableSingletonClass X] + (s : Set X) (R : X → Prop) : + Measure.count {x : s | R x} = Measure.count {x : X | x ∈ s ∧ R x} := by + rw [← Measure.count_injective_image (f := (Subtype.val : s → X)) Subtype.val_injective] + congr 1 + ext x + simp only [mem_image,mem_ofPred_eq,Subtype.exists,exists_prop] + aesop + +instance : PolishSpace DiskClass := by + let := TopologicalSpace.metrizableSpaceMetric DiskClass + infer_instance + +instance : PolishSpace halfPlane := isOpen_halfPlane.polishSpace + +instance : Nonempty halfPlane := ⟨⟨Complex.I,by simp [halfPlane]⟩⟩ + +def identityHalf (z : ℂ) : ℂ := z-Complex.I + +lemma identityHalf_schlicht : HalfPlaneSchlicht identityHalf := by + refine ⟨⟨(differentiable_id.sub_const Complex.I).differentiableOn,?_⟩,by simp [identityHalf],?_⟩ + · exact (sub_left_injective).injOn + · exact (hasDerivAt_id Complex.I |>.sub_const Complex.I).deriv + +def identityClass : DiskClass := classOfHalf identityHalf identityHalf_schlicht + +instance : Nonempty DiskClass := ⟨identityClass⟩ + +def jointCriticalMap (k : ℝ) (q : DiskClass × halfPlane) : DiskClass × ℂ := + (q.1,criticalMap (classFun q.1) k q.2) + +def nonsingularClass (k : ℝ) : Set (DiskClass × halfPlane) := + {q | normalizedJacobian (classFun q.1) k q.2 ≠ 0} + +lemma continuous_jointCriticalMap (k : ℝ) : Continuous (jointCriticalMap k) := + continuous_fst.prodMk (continuous_class_criticalMap k) + +lemma exists_class_branches (k : ℝ) : Nonempty (BorelBranches (jointCriticalMap k) (nonsingularClass k)) := by + apply exists_borelBranches (continuous_jointCriticalMap k).continuousOn + obtain ⟨p,hpm,hpd,hpc,hpi⟩ := countable_joint_injective_partition isOpen_halfPlane + (fun g z hz => (differentiableAt_criticalMap (classFun_schlicht g).1 hz k).hasFDerivAt) + (continuousOn_prod_of_continuous_subtype (F := fun g z => fderiv ℝ (criticalMap (classFun g) k) z) (continuous_class_fderiv_criticalMap k)) + let e : DiskClass × halfPlane → DiskClass × ℂ := fun q => (q.1,q.2) + have hem : Measurable e := measurable_fst.prodMk (measurable_subtype_coe.comp measurable_snd) + let u : ℕ → Set (DiskClass × halfPlane) := fun n => e ⁻¹' p n + refine ⟨u,fun n => (hpm n).preimage hem,?_,?_,?_⟩ + · intro n m hnm + exact (hpd hnm).preimage e + · ext q + have hc : (∃ n, e q ∈ p n) ↔ (e q).2 ∈ halfPlane ∧ + LinearMap.det (fderiv ℝ (criticalMap (classFun q.1) k) q.2).toLinearMap ≠ 0 := by + rw [← mem_iUnion,hpc] + rfl + simp only [mem_iUnion,mem_preimage,u] + rw [hc] + simp only [e,q.2.property,true_and,nonsingularClass,mem_ofPred_eq,normalizedJacobian] + exact ((div_ne_zero_iff).trans (and_iff_left + (pow_ne_zero _ (norm_ne_zero_iff.mpr (univalent_deriv_ne_zero isOpen_halfPlane + (classFun_schlicht q.1).1 q.2.property))))).symm + · intro n q hq r hr he + have hz : e q = e r := hpi n hq hr he + have hfst : q.1 = r.1 := congrArg (fun x : DiskClass × ℂ => x.1) hz + have hsnd : q.2.val = r.2.val := congrArg (fun x : DiskClass × ℂ => x.2) hz + exact Prod.ext hfst (Subtype.ext hsnd) + +def classPrecedes (k : ℝ) (q r : DiskClass × halfPlane) : Prop := + criticalHeight (classFun r.1) k r.2 < criticalHeight (classFun q.1) k q.2 ∨ + criticalHeight (classFun q.1) k q.2 = criticalHeight (classFun r.1) k r.2 ∧ + (q.2.val.re < r.2.val.re ∨ q.2.val.re = r.2.val.re ∧ q.2.val.im < r.2.val.im) + +lemma measurableSet_classPrecedes (k : ℝ) : + MeasurableSet {p : (DiskClass × halfPlane) × (DiskClass × halfPlane) | classPrecedes k p.1 p.2} := by + have hH := (continuous_class_criticalHeight k).measurable + have hr : Measurable (fun q : DiskClass × halfPlane => q.2.val.re) := + Complex.continuous_re.measurable.comp (measurable_subtype_coe.comp measurable_snd) + have hi : Measurable (fun q : DiskClass × halfPlane => q.2.val.im) := + Complex.continuous_im.measurable.comp (measurable_subtype_coe.comp measurable_snd) + exact (measurableSet_lt (hH.comp measurable_snd) (hH.comp measurable_fst)).union + ((measurableSet_eq_fun (hH.comp measurable_fst) (hH.comp measurable_snd)).inter + ((measurableSet_lt (hr.comp measurable_fst) (hr.comp measurable_snd)).union + ((measurableSet_eq_fun (hr.comp measurable_fst) (hr.comp measurable_snd)).inter + (measurableSet_lt (hi.comp measurable_fst) (hi.comp measurable_snd))))) + +def classRankCount (k σ : ℝ) (q : DiskClass × halfPlane) : ℝ≥0∞ := + Measure.count {r | r ∈ nonsingularClass k ∧ jointCriticalMap k r = jointCriticalMap k q ∧ + 0 < σ * normalizedJacobian (classFun r.1) k r.2 ∧ classPrecedes k r q} + +lemma measurable_classRankCount (k σ : ℝ) : Measurable (classRankCount k σ) := by + let B := Classical.choice (exists_class_branches k) + apply B.measurable_count _ (continuous_jointCriticalMap k).measurable + exact (measurableSet_lt measurable_const + (measurable_const.mul ((continuous_class_normalizedJacobian k).measurable.comp measurable_snd))).inter + ((measurableSet_classPrecedes k).preimage measurable_swap) + +def signedFiber (f : ℂ → ℂ) (k : ℝ) (ξ : ℂ) (σ : ℝ) : Set ℂ := + {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ 0 < σ * normalizedJacobian f k z} + +lemma signedFiber_one (f : ℂ → ℂ) (k : ℝ) (ξ : ℂ) : + signedFiber f k ξ 1 = positiveFiber f k ξ := by ext z; simp [signedFiber,positiveFiber] + +lemma signedFiber_neg_one (f : ℂ → ℂ) (k : ℝ) (ξ : ℂ) : + signedFiber f k ξ (-1) = negativeFiber f k ξ := by ext z; simp [signedFiber,negativeFiber] + +lemma classRankCount_eq_count (k σ : ℝ) (q : DiskClass × halfPlane) : + classRankCount k σ q = Measure.count {w | w ∈ signedFiber (classFun q.1) k + (criticalMap (classFun q.1) k q.2) σ ∧ heightPrecedes (criticalHeight (classFun q.1) k) w q.2} := by + let R : DiskClass × halfPlane → Prop := fun r => + 0 < σ * normalizedJacobian (classFun r.1) k r.2 ∧ classPrecedes k r q + have he : {r | r ∈ nonsingularClass k ∧ jointCriticalMap k r = jointCriticalMap k q ∧ R r} = + {r : DiskClass × halfPlane | jointCriticalMap k r = jointCriticalMap k q ∧ R r} := by + ext r + constructor + · exact fun h => h.2 + · intro h + refine ⟨?_,h⟩ + intro hz + have hp := h.2.1 + rw [hz,mul_zero] at hp + exact lt_irrefl 0 hp + change Measure.count {r | r ∈ nonsingularClass k ∧ jointCriticalMap k r = jointCriticalMap k q ∧ R r} = _ + rw [he] + simp only [jointCriticalMap] + rw [count_product_fiber (fun g (z : halfPlane) => criticalMap (classFun g) k z) R] + change Measure.count {w : halfPlane | criticalMap (classFun q.1) k w = criticalMap (classFun q.1) k q.2 ∧ + 0 < σ * normalizedJacobian (classFun q.1) k w ∧ heightPrecedes (criticalHeight (classFun q.1) k) w q.2} = _ + rw [count_subtype_set halfPlane (fun w : ℂ => criticalMap (classFun q.1) k w = criticalMap (classFun q.1) k q.2 ∧ + 0 < σ * normalizedJacobian (classFun q.1) k w ∧ heightPrecedes (criticalHeight (classFun q.1) k) w q.2)] + congr 1 + ext w + simp only [mem_ofPred_eq,signedFiber] + tauto + +lemma classRankCount_eq_heightRank {k : ℝ} (hk : 0 < k) (σ : ℝ) (q : DiskClass × halfPlane) + (hg : GoodPair (classFun q.1) k (criticalMap (classFun q.1) k q.2)) : + classRankCount k σ q = + (heightRank (criticalHeight (classFun q.1) k) + (signedFiber (classFun q.1) k (criticalMap (classFun q.1) k q.2) σ) q.2 : ℝ≥0∞) := by + rw [classRankCount_eq_count,heightRank_eq_ncard] + have hpos := criticalHeight_pos (classFun_schlicht q.1).1 hk q.2.property + have hc := critical_count (classFun_schlicht q.1).1 hk hg hpos + have hf : {w | w ∈ signedFiber (classFun q.1) k (criticalMap (classFun q.1) k q.2) σ ∧ + heightPrecedes (criticalHeight (classFun q.1) k) w q.2}.Finite := by + apply hc.1.subset + intro w hw + refine ⟨hw.1.1,hw.1.2.1,?_⟩ + rw [potential_critical_height (classFun_schlicht q.1).1 hk hw.1.1 hw.1.2.1] + apply ENNReal.ofReal_le_ofReal + exact heightOrder_height_le ((heightOrder_lt_iff _ _ _).mpr hw.2) + rw [Measure.count_apply_finite _ hf,← Set.ncard_eq_toFinset_card _ hf] + +lemma heightRank_transport_on {H H' : ℂ → ℝ} {S S' : Set ℂ} (e : ℂ ≃ ℂ) + (hS : ∀ w, w ∈ S' ↔ e w ∈ S) (z : ℂ) + (hord : ∀ w ∈ S', heightPrecedes H' w z ↔ heightPrecedes H (e w) (e z)) : + heightRank H' S' z = heightRank H S (e z) := by + rw [heightRank_eq_ncard,heightRank_eq_ncard] + apply Set.ncard_congr (fun w _ => e w) + · intro w hw + exact ⟨(hS w).mp hw.1,(hord w hw.1).mp hw.2⟩ + · intro a b _ _ hab + exact e.injective hab + · intro w hw + have hm : e.symm w ∈ S' := (hS _).mpr (by simpa using hw.1) + exact ⟨e.symm w,⟨hm,(hord _ hm).mpr (by simpa using hw.2)⟩,e.apply_symm_apply w⟩ + +lemma heightPrecedes_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) (k : ℝ) + {t z w : ℂ} (ht : t ∈ halfPlane) (hz : z ∈ halfPlane) (hw : w ∈ halfPlane) : + heightPrecedes (criticalHeight (reroot f t) k) z w ↔ + heightPrecedes (criticalHeight f k) (affine t z) (affine t w) := by + have hc := heightScaleInverse_pos hf k ht + have hre (v : ℂ) : (affine t v).re = t.re+t.im*v.re := by simp [affine] + have him (v : ℂ) : (affine t v).im = t.im*v.im := by simp [affine] + simp only [heightPrecedes,criticalHeight_reroot hf k ht hz,criticalHeight_reroot hf k ht hw, + div_lt_div_iff_of_pos_right hc,div_left_inj' (ne_of_gt hc),hre,him, + add_lt_add_iff_left,add_right_inj,mul_lt_mul_iff_right₀ (show 0 < t.im from ht),mul_right_inj' (ne_of_gt (show 0 < t.im from ht))] + +lemma signedFiber_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : 0 < k) + {t : ℂ} (ht : t ∈ halfPlane) (ξ : ℂ) (σ : ℝ) (w : ℂ) : + w ∈ signedFiber (reroot f t) k (rerootTarget f t ξ) σ ↔ + affine t w ∈ signedFiber f k ξ σ := by + simp only [signedFiber,mem_ofPred_eq,affine_mem_iff ht] + apply and_congr_right + intro hw + rw [criticalMap_reroot_fiber hf k ht hw,normalizedJacobian_reroot hf ht hw k (ne_of_gt hk)] + +lemma heightRank_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : 0 < k) + {t z : ℂ} (ht : t ∈ halfPlane) (hz : z ∈ halfPlane) (ξ : ℂ) (σ : ℝ) : + heightRank (criticalHeight (reroot f t) k) (signedFiber (reroot f t) k (rerootTarget f t ξ) σ) z = + heightRank (criticalHeight f k) (signedFiber f k ξ σ) (affine t z) := by + apply heightRank_transport_on (affineHome t ht).toEquiv + (signedFiber_reroot hf hk ht ξ σ) z + intro w hw + exact heightPrecedes_reroot hf k ht hw.1 hz + +lemma criticalPair_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : 0 < k) + {t z : ℂ} (ht : t ∈ halfPlane) (hz : z ∈ halfPlane) + (hJ : 0 < normalizedJacobian f k (affine t z)) + (hg : GoodPair f k (criticalMap f k (affine t z))) : + affine t (criticalPair (reroot f t) k z) = criticalPair f k (affine t z) := by + let f' := reroot f t + have hf' : UnivalentOn f' halfPlane := (reroot_normalized hf ht).1 + have hG : criticalMap f' k z = rerootTarget f t (criticalMap f k (affine t z)) := + criticalMap_reroot hf ht hz k + have hg' : GoodPair f' k (criticalMap f' k z) := by + rw [hG] + exact (goodPair_reroot hf hk ht _).mpr hg + have hJ' : 0 < normalizedJacobian f' k z := by + rw [normalizedJacobian_reroot hf ht hz k (ne_of_gt hk)] + exact hJ + have hs := criticalPair_spec hf' hk hz hJ' hg' + have hr := rankPartner_spec (show ∃ w ∈ negativeFiber f' k (criticalMap f' k z), + heightRank (criticalHeight f' k) (negativeFiber f' k (criticalMap f' k z)) w = + heightRank (criticalHeight f' k) (positiveFiber f' k (criticalMap f' k z)) z from by + obtain ⟨w,hw,_,he⟩ := exists_critical_equalRank hf' hk hg' ⟨hz,rfl,hJ'⟩ + exact ⟨w,hw,he⟩) + have hr' : heightRank (criticalHeight f k) + (negativeFiber f k (criticalMap f k (affine t z))) (affine t (criticalPair f' k z)) = + heightRank (criticalHeight f k) (positiveFiber f k (criticalMap f k (affine t z))) (affine t z) := by + have h := hr.2 + change heightRank (criticalHeight f' k) (negativeFiber f' k (criticalMap f' k z)) (criticalPair f' k z) = _ at h + rw [← signedFiber_neg_one,← signedFiber_one,hG, + heightRank_reroot hf hk ht hs.1 _ (-1),heightRank_reroot hf hk ht hz _ 1, + signedFiber_neg_one,signedFiber_one] at h + exact h + have hm : affine t (criticalPair f' k z) ∈ negativeFiber f k (criticalMap f k (affine t z)) := by + rw [← signedFiber_neg_one,← signedFiber_reroot hf hk ht _ (-1),← hG,signedFiber_neg_one] + exact ⟨hs.1,hs.2.1,hs.2.2.1⟩ + exact (rankPartner_eq (criticalHeight_rank_inj hf hk hg).2 hm hr').symm + +lemma heightRank_congr_on {H H' : ℂ → ℝ} {S : Set ℂ} (hS : S ⊆ halfPlane) + (he : EqOn H H' halfPlane) {z : ℂ} (hz : z ∈ halfPlane) : + heightRank H S z = heightRank H' S z := by + rw [heightRank_eq_ncard,heightRank_eq_ncard] + congr 1 + ext w + apply and_congr_right + intro hw + simp only [heightPrecedes,he hz,he (hS hw)] + +lemma signedFiber_congr {f g : ℂ → ℂ} (he : EqOn f g halfPlane) (k : ℝ) (ξ : ℂ) (σ : ℝ) : + signedFiber f k ξ σ = signedFiber g k ξ σ := by + ext z + simp only [signedFiber,mem_ofPred_eq] + apply and_congr_right + intro hz + rw [criticalMap_congr he k hz,normalizedJacobian_congr he k hz] + +lemma criticalPair_congr {f g : ℂ → ℂ} (hf : UnivalentOn f halfPlane) (hg : UnivalentOn g halfPlane) + (he : EqOn f g halfPlane) {k : ℝ} (hk : 0 < k) {z : ℂ} (hz : z ∈ halfPlane) + (hJ : 0 < normalizedJacobian f k z) (hgood : GoodPair f k (criticalMap f k z)) : + criticalPair f k z = criticalPair g k z := by + have hG := criticalMap_congr he k hz + have hgood' : GoodPair g k (criticalMap g k z) := by + rw [← hG] + exact (goodPair_congr he k _).mp hgood + have hs := criticalPair_spec hf hk hz hJ hgood + have hr := rankPartner_spec (show ∃ w ∈ negativeFiber f k (criticalMap f k z), + heightRank (criticalHeight f k) (negativeFiber f k (criticalMap f k z)) w = + heightRank (criticalHeight f k) (positiveFiber f k (criticalMap f k z)) z from by + obtain ⟨w,hw,_,hr⟩ := exists_critical_equalRank hf hk hgood ⟨hz,rfl,hJ⟩ + exact ⟨w,hw,hr⟩) + have hneg : negativeFiber f k (criticalMap f k z) = negativeFiber g k (criticalMap g k z) := by + rw [← signedFiber_neg_one,← signedFiber_neg_one,signedFiber_congr he,hG] + have hpos : positiveFiber f k (criticalMap f k z) = positiveFiber g k (criticalMap g k z) := by + rw [← signedFiber_one,← signedFiber_one,signedFiber_congr he,hG] + have hr' := hr.2 + change heightRank (criticalHeight f k) (negativeFiber f k (criticalMap f k z)) (criticalPair f k z) = _ at hr' + rw [heightRank_congr_on (fun w hw => hw.1) (criticalHeight_congr he k) hs.1, + heightRank_congr_on (fun w hw => hw.1) (criticalHeight_congr he k) hz,hneg,hpos] at hr' + exact (rankPartner_eq (criticalHeight_rank_inj hg hk hgood').2 (hneg ▸ hr.1) hr').symm + +def halfOne : halfPlane := ⟨Complex.I,by simp [halfPlane]⟩ + +lemma class_normalizedJacobian_reroot (g : DiskClass) {k : ℝ} (hk : 0 < k) + (t w : halfPlane) : + normalizedJacobian (classFun (rerootClass g t)) k w = + normalizedJacobian (classFun g) k (affine t w) := by + rw [normalizedJacobian_congr (classFun_rerootClass g t) k w.property, + normalizedJacobian_reroot (classFun_schlicht g).1 t.property w.property k (ne_of_gt hk)] + +lemma class_goodPair_reroot (g : DiskClass) {k : ℝ} (hk : 0 < k) (t w : halfPlane) : + GoodPair (classFun (rerootClass g t)) k + (criticalMap (classFun (rerootClass g t)) k w) ↔ + GoodPair (classFun g) k (criticalMap (classFun g) k (affine t w)) := by + rw [criticalMap_congr (classFun_rerootClass g t) k w.property, + goodPair_congr (classFun_rerootClass g t) k, + criticalMap_reroot (classFun_schlicht g).1 t.property w.property k] + exact goodPair_reroot (classFun_schlicht g).1 hk t.property _ + +lemma class_criticalPair_reroot (g : DiskClass) {k : ℝ} (hk : 0 < k) (t w : halfPlane) + (hj : 0 < normalizedJacobian (classFun g) k (affine t w)) + (hg : GoodPair (classFun g) k (criticalMap (classFun g) k (affine t w))) : + affine t (criticalPair (classFun (rerootClass g t)) k w) = + criticalPair (classFun g) k (affine t w) := by + have hj' : 0 < normalizedJacobian (classFun (rerootClass g t)) k w := by + rw [class_normalizedJacobian_reroot g hk t w]; exact hj + have hg' := (class_goodPair_reroot g hk t w).mpr hg + rw [criticalPair_congr (classFun_schlicht (rerootClass g t)).1 + (reroot_normalized (classFun_schlicht g).1 t.property).1 + (classFun_rerootClass g t) hk w.property hj' hg'] + exact criticalPair_reroot (classFun_schlicht g).1 hk t.property w.property hj hg + +lemma class_normalizedJacobian_root (g : DiskClass) {k : ℝ} (hk : 0 < k) (z : halfPlane) : + normalizedJacobian (classFun (rerootClass g z)) k Complex.I = + normalizedJacobian (classFun g) k z := by + simpa only [halfOne,affine_I] using class_normalizedJacobian_reroot g hk z halfOne + +lemma class_goodPair_root (g : DiskClass) {k : ℝ} (hk : 0 < k) (z : halfPlane) : + GoodPair (classFun (rerootClass g z)) k + (criticalMap (classFun (rerootClass g z)) k Complex.I) ↔ + GoodPair (classFun g) k (criticalMap (classFun g) k z) := by + simpa only [halfOne,affine_I] using class_goodPair_reroot g hk z halfOne + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/BoundaryEscape.lean b/lean/OAI/Analysis/IntegralMeans/BoundaryEscape.lean new file mode 100644 index 0000000000000000000000000000000000000000..26da168aacb62172dd8fe01d294707a56c621d7a --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/BoundaryEscape.lean @@ -0,0 +1,440 @@ +import OAI.Analysis.IntegralMeans.TraceIdentity + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight +attribute [local irreducible] classFun + +lemma halfPlane_ball_subset {z : ℂ} (_hz : z ∈ halfPlane) : + Metric.ball z z.im ⊆ halfPlane := by + intro w hw + have hh : ‖w-z‖ < z.im := by simpa only [Metric.mem_ball,dist_eq_norm] using hw + have hb := Complex.abs_im_le_norm (w-z) + change 0 < w.im + simp only [Complex.sub_im] at hb + linarith [neg_le_abs (w.im-z.im)] + +lemma omitted_quarter_bound {F : ℂ → ℂ} (hf : UnivalentOn F halfPlane) + {z ξ : ℂ} (hz : z ∈ halfPlane) (hξ : ξ ∉ F '' halfPlane) : + z.im*‖deriv F z‖ ≤ 4*‖F z-ξ‖ := by + have hr : 0 < z.im := hz + have hb := univalent_ball_quarter hr + (show UnivalentOn F (Metric.ball z z.im) from ⟨hf.1.mono (halfPlane_ball_subset hz),hf.2.mono (halfPlane_ball_subset hz)⟩) + have hn : ξ ∉ Metric.ball (F z) (z.im*‖deriv F z‖/4) := by + intro hh + exact hξ ((image_mono (halfPlane_ball_subset hz)) (hb hh)) + have hn' : z.im*‖deriv F z‖/4 ≤ ‖F z-ξ‖ := by + simpa only [Metric.mem_ball,dist_eq_norm,not_lt,norm_sub_rev] using hn + linarith + +lemma class_omitted_cell_bound {M : ℝ} (hM : 0 ≤ M) + (hb : ∀ (g : DiskClass) (w : ℂ), |w.re| ≤ 1 → (1/2 : ℝ) ≤ w.im → w.im ≤ 1 → ‖classFun g w‖ ≤ M) + (g : DiskClass) {h x y x' : ℝ} {ξ : ℂ} (hh : 0 < h) + (hy : h ≤ y) (hyy : y ≤ 2*h) (hxx : |x'-x| ≤ h) + (hξ : ξ ∉ classFun g '' halfPlane) : + ‖classFun g (x'+h*Complex.I)-ξ‖ ≤ (1+4*M)*‖classFun g (x+y*Complex.I)-ξ‖ := by + let z : ℂ := x+y*Complex.I + let w : ℂ := ((x'-x)/y : ℝ)+(h/y : ℝ)*Complex.I + have hy0 : 0 < y := hh.trans_le hy + have hz : z ∈ halfPlane := by simpa [z,halfPlane] using hy0 + have hwy : w.im = h/y := by simp [w] + have hwx : w.re = (x'-x)/y := by simp [w] + have hw : w ∈ halfPlane := by simpa [halfPlane,hwy] using (div_pos hh hy0) + have hwr : |w.re| ≤ 1 := by rw [hwx,abs_div,abs_of_pos hy0]; exact (div_le_one hy0).mpr (hxx.trans hy) + have hwl : (1/2 : ℝ) ≤ w.im := by rw [hwy,le_div_iff₀ hy0]; linarith + have hwu : w.im ≤ 1 := by rw [hwy]; exact (div_le_one hy0).mpr hy + have hwa : affine z w = x'+h*Complex.I := by + apply Complex.ext <;> simp [affine,z,w,Complex.mul_re,Complex.mul_im] + · field_simp + ring + · field_simp + have hd : ‖deriv (classFun g) z‖ > 0 := norm_pos_iff.mpr (univalent_deriv_ne_zero isOpen_halfPlane (classFun_schlicht g).1 hz) + have hm := hb (rerootClass g ⟨z,hz⟩) w hwr hwl hwu + rw [classFun_rerootClass _ _ hw,reroot,hwa,norm_div,norm_mul,Complex.norm_real] at hm + have hzim : z.im = y := by simp [z] + rw [hzim,Real.norm_eq_abs,abs_of_pos hy0] at hm + have hm' := (div_le_iff₀ (mul_pos hy0 hd)).mp hm + have hq := omitted_quarter_bound (classFun_schlicht g).1 hz hξ + rw [hzim] at hq + have hsum := norm_add_le (classFun g (x'+h*Complex.I)-classFun g z) (classFun g z-ξ) + simp only [sub_add_sub_cancel] at hsum + have hhq := mul_le_mul_of_nonneg_left hq hM + dsimp only [z] at * + nlinarith + +def closedPositiveSuperlevel (F : ℂ → ℂ) (k δ : ℝ) (ξ : ℂ) : Set ℂ := + {z | 0 < z.im ∧ ‖F z-ξ‖ ≤ z.im^k/δ} + +lemma interior_positive_superlevel_height {F : ℂ → ℂ} {k δ : ℝ} + (hk : 0 < k) (_hδ : 0 < δ) + (hi : InjOn F {z : ℂ | 0 < z.im}) + (hopen : ∀ z : ℂ, 0 < z.im → map F (𝓝 z) = 𝓝 (F z)) + {ξ : ℂ} (hξ : ξ ∈ F '' {z : ℂ | 0 < z.im}) : + ∃ η : ℝ, 0 < η ∧ ∀ z : ℂ, 0 < z.im → + ‖F z-ξ‖ ≤ z.im^k/δ → η ≤ z.im := by + obtain ⟨z₀,hz₀,rfl⟩ := hξ + change 0 < z₀.im at hz₀ + have hn : {z : ℂ | z₀.im/2 < z.im} ∈ 𝓝 z₀ := + (isOpen_lt continuous_const Complex.continuous_im).mem_nhds (by change z₀.im/2 < z₀.im; linarith) + have hn' := image_mem_map (m := F) hn + rw [hopen z₀ hz₀] at hn' + obtain ⟨r,hr,hrB⟩ := Metric.mem_nhds_iff.mp hn' + have hc : ContinuousAt (fun y : ℝ => y^k/δ) 0 := + (Real.continuous_rpow_const hk.le).continuousAt.div_const δ + have he : (0 : ℝ)^k/δ = 0 := by rw [Real.zero_rpow (ne_of_gt hk),zero_div] + have hevent : ∀ᶠ y : ℝ in 𝓝 0, y^k/δ < r := by + have hh := hc.eventually (gt_mem_nhds (show (0 : ℝ)^k/δ < r by rwa [he])) + exact hh + obtain ⟨a,ha,haB⟩ := Metric.mem_nhds_iff.mp hevent + refine ⟨min a (z₀.im/2),lt_min ha (by linarith),fun z hz hzw => ?_⟩ + by_contra! hsmall + have hza : z.im < a := hsmall.trans_le (min_le_left _ _) + have hm : F z ∈ Metric.ball (F z₀) r := by + rw [Metric.mem_ball,dist_eq_norm] + exact hzw.trans_lt (haB (by simpa only [Metric.mem_ball,dist_zero_right,Real.norm_eq_abs,abs_of_pos hz] using hza)) + obtain ⟨w,hw,hwe⟩ := hrB hm + have hwH : 0 < w.im := by change z₀.im/2 < w.im at hw; linarith + have hwz : w = z := hi hwH hz hwe + subst w + change z₀.im/2 < z.im at hw + exact (not_lt_of_ge hw.le) (hsmall.trans_le (min_le_right _ _)) + +lemma positive_superlevel_compact {F : ℂ → ℂ} {k δ : ℝ} {ξ : ℂ} + (hk : 0 ≤ k) (hδ : 0 < δ) + (hc : ContinuousOn F {z : ℂ | 0 < z.im}) + (ht : HasQuarticTail F (4*k)) + (hp : ∀ K : Set ℂ, IsCompact K → ∀ η : ℝ, 0 < η → + IsCompact ({z : ℂ | η ≤ z.im} ∩ F ⁻¹' K)) + (hheight : ∃ η : ℝ, 0 < η ∧ ∀ z : ℂ, 0 < z.im → + ‖F z-ξ‖ ≤ z.im^k/δ → η ≤ z.im) : + IsCompact (closedPositiveSuperlevel F k δ ξ) := by + obtain ⟨η,hη,hηb⟩ := hheight + obtain ⟨R₀,hR₀⟩ := (hp (Metric.closedBall (0 : ℂ) (2*‖ξ‖+1)) + (isCompact_closedBall _ _) η hη).isBounded.subset_closedBall (0 : ℂ) + obtain ⟨R₁,hR₁⟩ := quartic_tail_iff_power ht (δ/2) (by linarith) + have hb : closedPositiveSuperlevel F k δ ξ ⊆ Metric.closedBall 0 (max R₀ R₁) := by + intro z hz + rw [Metric.mem_closedBall,dist_zero_right] + by_contra! hn + have hno : 2*‖ξ‖+1 < ‖F z‖ := by + by_contra! hle + have hh := hR₀ ⟨hηb z hz.1 hz.2,by simpa using hle⟩ + have hh' : ‖z‖ ≤ R₀ := by simpa using hh + linarith [le_max_left R₀ R₁] + have hFn : 0 < ‖F z‖ := by nlinarith [norm_nonneg ξ] + have ht' := hR₁ z hz.1 ((le_max_right _ _).trans hn.le) + rw [← div_eq_mul_inv,div_lt_iff₀ hFn] at ht' + have hpot := (le_div_iff₀ hδ).mp hz.2 + have hnorm : ‖F z‖ ≤ ‖F z-ξ‖+‖ξ‖ := by + simpa only [sub_add_cancel] using norm_add_le (F z-ξ) ξ + nlinarith + have he : closedPositiveSuperlevel F k δ ξ = + {z : ℂ | η ≤ z.im} ∩ (fun z => ‖F z-ξ‖-z.im^k/δ) ⁻¹' Iic 0 := by + ext z + constructor + · intro hz + exact ⟨hηb z hz.1 hz.2,sub_nonpos.mpr hz.2⟩ + · intro hz + exact ⟨hη.trans_le hz.1,sub_nonpos.mp hz.2⟩ + have hcc : ContinuousOn (fun z : ℂ => ‖F z-ξ‖-z.im^k/δ) {z : ℂ | η ≤ z.im} := by + apply ((hc.mono (fun z hz => hη.trans_le hz)).sub continuousOn_const).norm.sub + exact ((Real.continuous_rpow_const hk).comp Complex.continuous_im).continuousOn.div_const δ + apply (isCompact_closedBall (0 : ℂ) (max R₀ R₁)).of_isClosed_subset _ hb + rw [he] + exact hcc.preimage_isClosed_of_isClosed (isClosed_le continuous_const Complex.continuous_im) isClosed_Iic + +def realCell (h : ℝ) (j : ℤ) : Set ℝ := Ico ((j : ℝ)*h) (((j : ℝ)+1)*h) + +lemma realCell_disjoint {h : ℝ} (hh : 0 < h) : Pairwise (Function.onFun Disjoint (realCell h)) := by + intro i j hij + apply Set.disjoint_left.mpr + intro x hx hy + rcases lt_or_gt_of_ne hij with hij | hji + · have hhij : (i : ℝ)+1 ≤ j := by exact_mod_cast Int.add_one_le_iff.mpr hij + have hm := mul_le_mul_of_nonneg_right hhij hh.le + exact (not_lt_of_ge (hm.trans hy.1)) hx.2 + · have hhji : (j : ℝ)+1 ≤ i := by exact_mod_cast Int.add_one_le_iff.mpr hji + have hm := mul_le_mul_of_nonneg_right hhji hh.le + exact (not_lt_of_ge (hm.trans hx.1)) hy.2 + +lemma measure_realCell {h : ℝ} (_hh : 0 ≤ h) (j : ℤ) : + volume (realCell h j) = ENNReal.ofReal h := by + rw [realCell,Real.volume_Ico] + congr 1 + ring + +lemma mem_realCell_floor {h : ℝ} (hh : 0 < h) (x : ℝ) : x ∈ realCell h ⌊x/h⌋ := by + constructor + · exact (le_div_iff₀ hh).mp (Int.floor_le _) + · exact (div_lt_iff₀ hh).mp (Int.lt_floor_add_one _) + +lemma realCell_length_bound {h : ℝ} (_hh : 0 < h) {j : ℤ} {x x' : ℝ} + (hx : x ∈ realCell h j) (hx' : x' ∈ realCell h j) : |x'-x| ≤ h := by + rw [abs_le] + constructor <;> dsimp [realCell] at hx hx' <;> nlinarith [hx.1,hx.2,hx'.1,hx'.2] + +lemma cell_target_cover_bound {h r : ℝ} (hh : 0 < h) (hr : 0 ≤ r) + (W : Set ℤ) (centers : ℤ → ℂ) {S : Set ℝ} {C : ℝ≥0∞} + (hsub : ∀ j ∈ W, realCell h j ⊆ S) (hS : volume S ≤ C) : + volume (⋃ j : W, Metric.closedBall (centers j) r) ≤ + (ENNReal.ofReal (Real.pi*r^2)/ENNReal.ofReal h)*C := by + have hlen : (∑' j : W, ENNReal.ofReal h) ≤ C := by + have hd : Pairwise (Function.onFun Disjoint (fun j : W => realCell h j)) := by + intro i j hij + exact realCell_disjoint hh (fun he => hij (Subtype.ext he)) + have he := measure_iUnion (μ := volume) hd (fun _ => measurableSet_Ico) + simp only [measure_realCell hh.le] at he + rw [← he] + exact (measure_mono (iUnion_subset (fun (j : W) => hsub j.val j.property))).trans hS + have harea (j : W) : volume (Metric.closedBall (centers j) r) = ENNReal.ofReal (Real.pi*r^2) := by + rw [Complex.volume_closedBall] + have hpi : (NNReal.pi : ℝ≥0∞) = ENNReal.ofReal Real.pi := by + rw [ENNReal.ofReal,ENNReal.coe_inj] + apply Subtype.ext + exact (Real.coe_toNNReal Real.pi Real.pi_pos.le).symm + rw [hpi,ENNReal.ofReal_mul Real.pi_pos.le,ENNReal.ofReal_pow hr] + exact mul_comm _ _ + calc + _ ≤ ∑' j : W, volume (Metric.closedBall (centers j) r) := measure_iUnion_le _ + _ = ∑' j : W, (ENNReal.ofReal (Real.pi*r^2)/ENNReal.ofReal h)*ENNReal.ofReal h := by + apply tsum_congr + intro j + rw [harea] + exact (ENNReal.div_mul_cancel (ne_of_gt (ENNReal.ofReal_pos.mpr hh)) ENNReal.ofReal_ne_top).symm + _ = (ENNReal.ofReal (Real.pi*r^2)/ENNReal.ofReal h)*(∑' j : W, ENNReal.ofReal h) := ENNReal.tsum_mul_left + _ ≤ _ := mul_le_mul le_rfl hlen zero_le zero_le + +lemma summable_geometric_ofReal {r : ℝ} (hr0 : 0 ≤ r) (hr1 : r < 1) : + (∑' n : ℕ, ENNReal.ofReal (r^n)) < ∞ := by + have hs : Summable (fun n : ℕ => (⟨r^n,pow_nonneg hr0 n⟩ : ℝ≥0)) := + NNReal.summable_coe.mp (summable_geometric_of_lt_one hr0 hr1) + have ht := ENNReal.tsum_coe_ne_top_iff_summable.mpr hs + apply lt_top_iff_ne_top.mpr + convert ht using 1 + congr 1 + ext n + exact ENNReal.ofReal_eq_coe_nnreal (pow_nonneg hr0 n) + +lemma ae_eventually_outside_geometric_covers {E : ℕ → Set ℂ} {C : ℝ≥0∞} (hC : C < ∞) + {r : ℝ} (hr0 : 0 ≤ r) (hr1 : r < 1) + (hE : ∀ n, volume (E n) ≤ C*ENNReal.ofReal (r^n)) : + ∀ᵐ ξ : ℂ, ∀ᶠ n : ℕ in atTop, ξ ∉ E n := by + apply ae_eventually_notMem + apply ne_top_of_le_ne_top _ (ENNReal.tsum_le_tsum hE) + rw [ENNReal.tsum_mul_left] + exact ne_of_lt (ENNReal.mul_lt_top hC (summable_geometric_ofReal hr0 hr1)) + +def dyadicHeight (n : ℕ) : ℝ := (1/2)^n + +lemma dyadicHeight_pos (n : ℕ) : 0 < dyadicHeight n := pow_pos (by norm_num) n + +lemma dyadicHeight_le_one (n : ℕ) : dyadicHeight n ≤ 1 := pow_le_one₀ (by norm_num) (by norm_num) + +lemma exists_dyadic_slab {y : ℝ} (hy : 0 < y) (hy1 : y ≤ 1) : + ∃ n : ℕ, dyadicHeight n ≤ y ∧ y ≤ 2*dyadicHeight n := by + obtain ⟨n,hn,hn'⟩ := exists_nat_pow_near_of_lt_one hy hy1 + (by norm_num : (0 : ℝ) < 1/2) (by norm_num : (1/2 : ℝ) < 1) + refine ⟨n+1,hn.le,?_⟩ + dsimp [dyadicHeight] + rw [pow_succ] + nlinarith + +lemma dyadicHeight_antitone : Antitone dyadicHeight := by + intro m n hmn + exact pow_le_pow_of_le_one (by norm_num) (by norm_num) hmn + +lemma small_height_dyadic_slab (N : ℕ) {y : ℝ} (hy : 0 < y) (hyN : y < dyadicHeight N) : + ∃ n ≥ N, dyadicHeight n ≤ y ∧ y ≤ 2*dyadicHeight n := by + obtain ⟨n,hn,hn'⟩ := exists_dyadic_slab hy (hyN.le.trans (dyadicHeight_le_one N)) + refine ⟨n,?_,hn,hn'⟩ + by_contra! h + exact (not_lt_of_ge ((dyadicHeight_antitone h.le).trans hn)) hyN + +lemma slab_power_bound {k h y : ℝ} (hk : 1 ≤ k) (hh : 0 < h) (hh1 : h ≤ 1) + (hy : 0 ≤ y) (hyh : y ≤ 2*h) : y^k ≤ (2 : ℝ)^k*h := by + calc + y^k ≤ (2*h)^k := Real.rpow_le_rpow hy hyh (by linarith) + _ = (2 : ℝ)^k*h^k := Real.mul_rpow (by norm_num) hh.le + _ ≤ _ := mul_le_mul_of_nonneg_left (Real.rpow_le_self_of_le_one hh.le hh1 hk) (by positivity) + +def omittedTargets (F : ℂ → ℂ) (k R δ h : ℝ) : Set ℂ := + {ξ | ξ ∉ F '' {z : ℂ | 0 < z.im} ∧ ‖ξ‖ ≤ R ∧ + ∃ x y : ℝ, h ≤ y ∧ y ≤ 2*h ∧ ‖F (x+y*Complex.I)-ξ‖ ≤ y^k/δ} + +lemma omitted_targets_cover {F : ℂ → ℂ} {k L R δ : ℝ} + (hk : 1 ≤ k) (hL : 0 ≤ L) (hδ : 0 < δ) + (hcell : ∀ h x y x' : ℝ, ∀ ξ : ℂ, 0 < h → h ≤ y → y ≤ 2*h → |x'-x| ≤ h → + ξ ∉ F '' {z : ℂ | 0 < z.im} → + ‖F (x'+h*Complex.I)-ξ‖ ≤ L*‖F (x+y*Complex.I)-ξ‖) + (htrace : ∀ K : Set ℂ, IsCompact K → ∃ C : ℝ≥0∞, C < ∞ ∧ ∀ ε : ℝ, 0 < ε → + volume {x : ℝ | F (x+ε*Complex.I) ∈ K} ≤ C) : + ∃ C : ℝ≥0∞, C < ∞ ∧ ∀ h : ℝ, 0 < h → h ≤ 1 → + volume (omittedTargets F k R δ h) ≤ C*ENNReal.ofReal h := by + let D := L*(2 : ℝ)^k/δ + have hD : 0 ≤ D := div_nonneg (mul_nonneg hL (by positivity)) hδ.le + let K := Metric.closedBall (0 : ℂ) (R+D) + obtain ⟨C,hC,hCt⟩ := htrace K (isCompact_closedBall _ _) + refine ⟨ENNReal.ofReal (Real.pi*D^2)*C, ENNReal.mul_lt_top ENNReal.ofReal_lt_top hC,fun h hh hh1 => ?_⟩ + let W : Set ℤ := {j | ∃ ξ ∈ omittedTargets F k R δ h, + ∃ x y : ℝ, x ∈ realCell h j ∧ h ≤ y ∧ y ≤ 2*h ∧ ‖F (x+y*Complex.I)-ξ‖ ≤ y^k/δ} + let center (j : ℤ) := F ((((j : ℝ)+1/2)*h : ℝ)+h*Complex.I) + have hb {j : ℤ} {ξ : ℂ} (hξ : ξ ∈ omittedTargets F k R δ h) + {x y x' : ℝ} (hx : x ∈ realCell h j) (hy : h ≤ y) (hyy : y ≤ 2*h) + (hFw : ‖F (x+y*Complex.I)-ξ‖ ≤ y^k/δ) (hx' : x' ∈ realCell h j) : + ‖F (x'+h*Complex.I)-ξ‖ ≤ D*h := by + have ht := hcell h x y x' ξ hh hy hyy (realCell_length_bound hh hx hx') hξ.1 + have hp := div_le_div_of_nonneg_right (slab_power_bound hk hh hh1 (hh.le.trans hy) hyy) hδ.le + have hp' := mul_le_mul_of_nonneg_left (hFw.trans hp) hL + dsimp [D] + calc + _ ≤ L*((2 : ℝ)^k*h/δ) := ht.trans hp' + _ = _ := by ring + have hsub (j : ℤ) (hj : j ∈ W) : realCell h j ⊆ {x : ℝ | F (x+h*Complex.I) ∈ K} := by + rcases hj with ⟨ξ,hξ,x,y,hx,hy,hyy,hFw⟩ + intro x' hx' + have hhB := hb hξ hx hy hyy hFw hx' + have hn := norm_add_le (F (x'+h*Complex.I)-ξ) ξ + simp only [sub_add_cancel] at hn + change F (x'+h*Complex.I) ∈ Metric.closedBall (0 : ℂ) (R+D) + rw [Metric.mem_closedBall,dist_zero_right] + nlinarith [hξ.2.1,mul_le_of_le_one_right hD hh1] + have hcovered : omittedTargets F k R δ h ⊆ ⋃ j : W, Metric.closedBall (center j) (D*h) := by + intro ξ hξ + obtain ⟨x,y,hy,hyy,hFw⟩ := hξ.2.2 + let j : ℤ := ⌊x/h⌋ + have hx : x ∈ realCell h j := mem_realCell_floor hh _ + have hj : j ∈ W := ⟨ξ,hξ,x,y,hx,hy,hyy,hFw⟩ + apply mem_iUnion.mpr + refine ⟨⟨j,hj⟩,?_⟩ + rw [Metric.mem_closedBall,dist_eq_norm,norm_sub_rev] + change ‖F ((((j : ℝ)+1/2)*h : ℝ)+h*Complex.I)-ξ‖ ≤ D*h + exact hb (x' := ((j : ℝ)+1/2)*h) hξ hx hy hyy hFw (by constructor <;> nlinarith) + calc + _ ≤ volume (⋃ j : W, Metric.closedBall (center j) (D*h)) := measure_mono hcovered + _ ≤ (ENNReal.ofReal (Real.pi*(D*h)^2)/ENNReal.ofReal h)*C := + cell_target_cover_bound hh (mul_nonneg hD hh.le) W center hsub (hCt h hh) + _ = _ := by + rw [← ENNReal.ofReal_div_of_pos hh] + have he : Real.pi*(D*h)^2/h = (Real.pi*D^2)*h := by field_simp + rw [he,ENNReal.ofReal_mul (by positivity)] + ring + +lemma ae_omitted_positive_superlevel_height {F : ℂ → ℂ} {k L R δ : ℝ} + (hk : 1 ≤ k) (hL : 0 ≤ L) (hδ : 0 < δ) + (hcell : ∀ h x y x' : ℝ, ∀ ξ : ℂ, 0 < h → h ≤ y → y ≤ 2*h → |x'-x| ≤ h → + ξ ∉ F '' {z : ℂ | 0 < z.im} → + ‖F (x'+h*Complex.I)-ξ‖ ≤ L*‖F (x+y*Complex.I)-ξ‖) + (htrace : ∀ K : Set ℂ, IsCompact K → ∃ C : ℝ≥0∞, C < ∞ ∧ ∀ ε : ℝ, 0 < ε → + volume {x : ℝ | F (x+ε*Complex.I) ∈ K} ≤ C) : + ∀ᵐ ξ : ℂ, ξ ∉ F '' {z : ℂ | 0 < z.im} → ‖ξ‖ ≤ R → + ∃ η : ℝ, 0 < η ∧ ∀ z : ℂ, 0 < z.im → + ‖F z-ξ‖ ≤ z.im^k/δ → η ≤ z.im := by + obtain ⟨C,hC,hCb⟩ := omitted_targets_cover hk hL hδ hcell htrace (R := R) + have hae := ae_eventually_outside_geometric_covers hC + (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) < 1) + (E := fun n => omittedTargets F k R δ (dyadicHeight n)) + (fun n => hCb _ (dyadicHeight_pos n) (dyadicHeight_le_one n)) + filter_upwards [hae] with ξ hξ + intro ho hR + obtain ⟨N,hN⟩ := eventually_atTop.mp hξ + refine ⟨dyadicHeight N,dyadicHeight_pos N,fun z hz hzw => ?_⟩ + by_contra! hh + obtain ⟨n,hn,hy,hyy⟩ := small_height_dyadic_slab N hz hh + apply hN n hn + refine ⟨ho,hR,z.re,z.im,hy,hyy,?_⟩ + simpa only [Complex.re_add_im] using hzw + +lemma ae_positive_superlevel_height {F : ℂ → ℂ} {k L : ℝ} + (hk : 1 ≤ k) (hL : 0 ≤ L) + (hi : InjOn F {z : ℂ | 0 < z.im}) + (hopen : ∀ z : ℂ, 0 < z.im → map F (𝓝 z) = 𝓝 (F z)) + (hcell : ∀ h x y x' : ℝ, ∀ ξ : ℂ, 0 < h → h ≤ y → y ≤ 2*h → |x'-x| ≤ h → + ξ ∉ F '' {z : ℂ | 0 < z.im} → + ‖F (x'+h*Complex.I)-ξ‖ ≤ L*‖F (x+y*Complex.I)-ξ‖) + (htrace : ∀ K : Set ℂ, IsCompact K → ∃ C : ℝ≥0∞, C < ∞ ∧ ∀ ε : ℝ, 0 < ε → + volume {x : ℝ | F (x+ε*Complex.I) ∈ K} ≤ C) : + ∀ᵐ ξ : ℂ, ∀ δ : ℝ, 0 < δ → + ∃ η : ℝ, 0 < η ∧ ∀ z : ℂ, 0 < z.im → + ‖F z-ξ‖ ≤ z.im^k/δ → η ≤ z.im := by + have hae : ∀ᵐ ξ : ℂ, ∀ R n : ℕ, + ξ ∉ F '' {z : ℂ | 0 < z.im} → ‖ξ‖ ≤ R → + ∃ η : ℝ, 0 < η ∧ ∀ z : ℂ, 0 < z.im → + ‖F z-ξ‖ ≤ z.im^k/(1/(n+1 : ℝ)) → η ≤ z.im := by + apply ae_all_iff.mpr + intro R + apply ae_all_iff.mpr + intro n + exact ae_omitted_positive_superlevel_height hk hL (by positivity) hcell htrace + filter_upwards [hae] with ξ hξ + intro δ hδ + by_cases ho : ξ ∈ F '' {z : ℂ | 0 < z.im} + · exact interior_positive_superlevel_height (by linarith) hδ hi hopen ho + obtain ⟨R,hR⟩ := exists_nat_ge ‖ξ‖ + obtain ⟨n,hn⟩ := exists_nat_gt (1/δ) + have hn0 : 0 < (n+1 : ℝ) := by positivity + have hnδ : 1/(n+1 : ℝ) ≤ δ := by + apply (div_le_iff₀ hn0).mpr + have hh := (div_lt_iff₀ hδ).mp hn + nlinarith + obtain ⟨η,hη,hηb⟩ := hξ R n ho hR + refine ⟨η,hη,fun z hz hzw => ?_⟩ + exact hηb z hz (hzw.trans (div_le_div_of_nonneg_left (Real.rpow_nonneg hz.le _) (by positivity) hnδ)) + +lemma ae_positive_superlevel_compact {F : ℂ → ℂ} {k L : ℝ} + (hk : 1 ≤ k) (hL : 0 ≤ L) + (hc : ContinuousOn F {z : ℂ | 0 < z.im}) + (hi : InjOn F {z : ℂ | 0 < z.im}) + (hopen : ∀ z : ℂ, 0 < z.im → map F (𝓝 z) = 𝓝 (F z)) + (ht : HasQuarticTail F (4*k)) + (hp : ∀ K : Set ℂ, IsCompact K → ∀ η : ℝ, 0 < η → + IsCompact ({z : ℂ | η ≤ z.im} ∩ F ⁻¹' K)) + (hcell : ∀ h x y x' : ℝ, ∀ ξ : ℂ, 0 < h → h ≤ y → y ≤ 2*h → |x'-x| ≤ h → + ξ ∉ F '' {z : ℂ | 0 < z.im} → + ‖F (x'+h*Complex.I)-ξ‖ ≤ L*‖F (x+y*Complex.I)-ξ‖) + (htrace : ∀ K : Set ℂ, IsCompact K → ∃ C : ℝ≥0∞, C < ∞ ∧ ∀ ε : ℝ, 0 < ε → + volume {x : ℝ | F (x+ε*Complex.I) ∈ K} ≤ C) : + ∀ᵐ ξ : ℂ, ∀ δ : ℝ, 0 < δ → IsCompact (closedPositiveSuperlevel F k δ ξ) := by + filter_upwards [ae_positive_superlevel_height hk hL hi hopen hcell htrace] with ξ hξ + intro δ hδ + exact positive_superlevel_compact (by linarith) hδ hc ht hp (hξ δ hδ) + +lemma class_ae_compact_superlevels (g : DiskClass) {β : ℝ} (hβ : 1 < β) + (hfin : (∫⁻ z in outsideCore, + ENNReal.ofReal (z.im^(β+1)*‖classFun g z‖⁻¹^4)) < ∞) : + ∀ᵐ ξ : ℂ, ∀ δ : ℝ, 0 < δ → + IsCompact (closedPositiveSuperlevel (classFun g) ((β+3)/4) δ ξ) := by + obtain ⟨M,hM,hMb⟩ := uniform_relative_class_bound + have ht : HasQuarticTail (classFun g) (4*((β+3)/4)) := by + convert class_quartic_tail g hβ hfin using 1; ring + apply ae_positive_superlevel_compact (by linarith : 1 ≤ (β+3)/4) + (by linarith : 0 ≤ 1+4*M) (classFun_schlicht g).1.1.continuousOn + (classFun_schlicht g).1.2 _ ht + (fun _ hK _ hη => class_proper_preimage g hβ hfin hK hη) + (fun _ _ _ _ _ hh hy hyy hxx hξ => class_omitted_cell_bound hM hMb g hh hy hyy hxx hξ) + (fun _ hK => class_trace_bound g hβ hfin hK) + intro z hz + have hd := ((classFun_schlicht g).1.1.analyticAt (isOpen_halfPlane.mem_nhds hz)).contDiffAt (n := 1) + exact (hd.hasStrictDerivAt (by norm_num)).map_nhds_eq + (univalent_deriv_ne_zero isOpen_halfPlane (classFun_schlicht g).1 hz) + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/BoundaryTail.lean b/lean/OAI/Analysis/IntegralMeans/BoundaryTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f50e93c1729c98cf367c5f2c852f9fa395b2625 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/BoundaryTail.lean @@ -0,0 +1,327 @@ +import OAI.Analysis.IntegralMeans.AreaTransport + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight + +def outsideCore : Set ℂ := {z | z ∈ halfPlane ∧ (1/2 : ℝ) ≤ ‖diskCayley z‖} + +lemma measurable_diskCayley : Measurable diskCayley := + (measurable_id.sub_const _).div (measurable_id.add_const _) + +lemma measurableSet_outsideCore : MeasurableSet outsideCore := + isOpen_halfPlane.measurableSet.inter (measurableSet_le measurable_const measurable_diskCayley.norm) + +lemma classFun_lower_outsideCore (g : DiskClass) {z : ℂ} (hz : z ∈ outsideCore) : + (1/16 : ℝ) ≤ ‖classFun g z‖ := by + have hl := schlicht_lower_growth g.2 (diskCayley_maps hz.1) + have he : ‖classFun g z‖ = 2*‖diskExtend g.1 (diskCayley z)‖ := by + simp [classFun,diskToHalf] + rw [he] + have hm := hz.2 + linarith + +lemma classFun_ne_zero_outsideCore (g : DiskClass) {z : ℂ} (hz : z ∈ outsideCore) : + classFun g z ≠ 0 := by + exact norm_ne_zero_iff.mp (ne_of_gt (lt_of_lt_of_le (by norm_num) (classFun_lower_outsideCore g hz))) + +def planeClassValue (g : DiskClass) (z : ℂ) : ℂ := + by classical exact if z ∈ halfPlane then classFun g z else 0 + +attribute [local irreducible] classFun + +lemma measurable_planeClassValue : Measurable (fun p : DiskClass × ℂ => planeClassValue p.1 p.2) := by + classical + let s : Set (DiskClass × ℂ) := Prod.snd ⁻¹' halfPlane + have hc : Continuous (fun p : s => classFun p.val.1 p.val.2) := by + exact continuous_classFun_eval.comp + ((continuous_fst.comp continuous_subtype_val).prodMk + ((continuous_snd.comp continuous_subtype_val).subtype_mk (fun p => p.2))) + simpa only [planeClassValue,s,Set.mem_preimage,dite_eq_ite] using + hc.measurable.dite (measurable_const (a := (0 : ℂ))) + (isOpen_halfPlane.measurableSet.preimage measurable_snd) + +lemma planeClassValue_eq (g : DiskClass) {z : ℂ} (hz : z ∈ halfPlane) : + planeClassValue g z = classFun g z := by simp [planeClassValue,hz] + +lemma continuous_classFun_at (z : halfPlane) : Continuous (fun g : DiskClass => classFun g z) := + continuous_classFun_eval.comp (continuous_id.prodMk continuous_const) + +lemma measurable_classFun_at {z : ℂ} (hz : z ∈ halfPlane) : Measurable (fun g : DiskClass => classFun g z) := + (continuous_classFun_at ⟨z,hz⟩).measurable + +lemma integral_closedBall_translate.{u_1} {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] + (f : ℂ → E) (z : ℂ) (r : ℝ) : + (∫ w in Metric.closedBall (0 : ℂ) r, f (w+z)) = ∫ w in Metric.closedBall z r, f w := by + have he : (fun w : ℂ => w+z) ⁻¹' Metric.closedBall z r = Metric.closedBall 0 r := by + ext w + simp [Metric.mem_closedBall,dist_eq_norm] + rw [← he] + exact (measurePreserving_add_right volume z).setIntegral_preimage_emb + (Homeomorph.addRight z).measurableEmbedding f _ + +lemma volume_real_closedBall_complex (z : ℂ) {r : ℝ} (hr : 0 ≤ r) : + volume.real (Metric.closedBall z r) = Real.pi*r^2 := by + rw [measureReal_def,Complex.volume_closedBall,ENNReal.toReal_mul,ENNReal.toReal_pow, + ENNReal.toReal_ofReal hr] + simp only [ENNReal.coe_toReal,NNReal.coe_real_pi] + ring + +lemma holomorphic_sq_submean_center {f : ℂ → ℂ} {z : ℂ} {R r : ℝ} + (hf : DifferentiableOn ℂ f (Metric.ball z R)) (hr : 0 < r) (hrR : r < R) : + Real.pi*r^2*‖f z‖^2 ≤ ∫ w in Metric.closedBall z r, ‖f w‖^2 := by + have hfd : DifferentiableOn ℂ (fun w => f (w+z)) (Metric.ball 0 R) := by + apply hf.comp (differentiable_id.add_const z).differentiableOn + intro w hw + simpa [Metric.mem_ball,dist_eq_norm] using hw + have hh := holomorphic_sq_submean hfd hr hrR + rw [integral_closedBall_translate (fun w => ‖f w‖^2) z r] at hh + simpa only [volume_real_closedBall_complex 0 hr.le,zero_add] using hh + +lemma holomorphic_sq_submean_lintegral {f : ℂ → ℂ} {z : ℂ} {R r : ℝ} + (hf : DifferentiableOn ℂ f (Metric.ball z R)) (hr : 0 < r) (hrR : r < R) : + ENNReal.ofReal (Real.pi*r^2*‖f z‖^2) ≤ + ∫⁻ w in Metric.closedBall z r, ENNReal.ofReal (‖f w‖^2) := by + have hi : IntegrableOn (fun w => ‖f w‖^2) (Metric.closedBall z r) volume := ((hf.continuousOn.mono (Metric.closedBall_subset_ball hrR)).norm.pow 2).integrableOn_compact + (isCompact_closedBall z r) + rw [← ofReal_integral_eq_lintegral_ofReal hi (Eventually.of_forall (fun _ => sq_nonneg _))] + exact ENNReal.ofReal_le_ofReal (holomorphic_sq_submean_center hf hr hrR) + +lemma finite_density_compact_tail (s : Set ℂ) (b : ℂ → ℝ≥0∞) + (hf : (∫⁻ z in s, b z) < ∞) {ε : ℝ≥0∞} (hε : 0 < ε) : + ∃ K : Set ℂ, IsCompact K ∧ (∫⁻ z in s \ K, b z) < ε := by + let ν := (volume.restrict s).withDensity b + have : IsFiniteMeasure ν := isFiniteMeasure_withDensity hf.ne + obtain ⟨K,hKsub,hK,hKε⟩ := (MeasurableSet.univ (α := ℂ)).exists_isCompact_sdiff_lt + (μ := ν) (measure_ne_top ν univ) hε.ne' + refine ⟨K,hK,?_⟩ + have he : ν (univ \ K) = ∫⁻ z in s \ K, b z := by + dsimp only [ν] + have heK : (univ \ K : Set ℂ) = Kᶜ := by ext z; simp + rw [heK] + rw [withDensity_apply _ hK.isClosed.measurableSet.compl] + rw [Measure.restrict_restrict hK.isClosed.measurableSet.compl] + have hsK : Kᶜ ∩ s = s \ K := by ext z; simp [and_comm] + rw [hsK] + rwa [he] at hKε + +lemma weighted_holomorphic_tail {q : ℂ → ℂ} {s : Set ℂ} {a R₀ : ℝ} + (ha : 0 ≤ a) (hR₀ : 0 ≤ R₀) + (hs : ∀ z : ℂ, 0 < z.im → R₀ < ‖z‖ → z ∈ s) + (hq : ∀ z ∈ s, DifferentiableAt ℂ q z) + (hfin : (∫⁻ z in s, ENNReal.ofReal (z.im^a*‖q z‖^2)) < ∞) : + ∀ ε : ℝ, 0 < ε → ∃ R : ℝ, ∀ z : ℂ, 0 < z.im → R ≤ ‖z‖ → + z.im^(a+2)*‖q z‖^2 < ε := by + intro ε hε + let C : ℝ := 16*(2 : ℝ)^a/Real.pi + have hC : 0 < C := by dsimp [C]; positivity + obtain ⟨K,hK,hKε⟩ := finite_density_compact_tail s + (fun z => ENNReal.ofReal (z.im^a*‖q z‖^2)) hfin + (ENNReal.ofReal_pos.mpr (div_pos hε hC)) + obtain ⟨M,hM⟩ := hK.isBounded.subset_closedBall (0 : ℂ) + refine ⟨2*(max R₀ M+1),fun z hy hz => ?_⟩ + have hn : 0 < ‖z‖ := by nlinarith [le_max_left R₀ M] + have hball (w : ℂ) (hw : w ∈ Metric.ball z (z.im/2)) : + 0 < w.im ∧ R₀ < ‖w‖ ∧ w ∉ K := by + have hd : ‖w-z‖ < z.im/2 := by simpa only [Metric.mem_ball,dist_eq_norm] using hw + have hi := Complex.abs_im_le_norm (w-z) + have him : z.im/2 < w.im := by + rw [Complex.sub_im] at hi + have hl := neg_le_of_abs_le hi + linarith + have himz : z.im ≤ ‖z‖ := (le_abs_self _).trans (Complex.abs_im_le_norm z) + have hnw := norm_sub_norm_le z w + have hdist : ‖z-w‖ = ‖w-z‖ := norm_sub_rev z w + rw [hdist] at hnw + have hnw' : max R₀ M < ‖w‖ := by nlinarith + refine ⟨by linarith,lt_of_le_of_lt (le_max_left _ _) hnw',?_⟩ + intro hwK + have hm := hM hwK + simp only [Metric.mem_closedBall,dist_zero_right] at hm + exact (not_lt_of_ge (hm.trans (le_max_right _ _))) hnw' + have hhol : DifferentiableOn ℂ q (Metric.ball z (z.im/2)) := fun w hw => + (hq w (hs w (hball w hw).1 (hball w hw).2.1)).differentiableWithinAt + have hsmall : Metric.closedBall z (z.im/4) ⊆ Metric.ball z (z.im/2) := + Metric.closedBall_subset_ball (by linarith) + have hsub : Metric.closedBall z (z.im/4) ⊆ s \ K := by + intro w hw + obtain ⟨hwi,hwn,hwK⟩ := hball w (hsmall hw) + exact ⟨hs w hwi hwn,hwK⟩ + have hmean := holomorphic_sq_submean_lintegral hhol (by linarith : 0 < z.im/4) (by linarith) + have hcomp (w : ℂ) (hw : w ∈ Metric.closedBall z (z.im/4)) : + z.im^a*‖q w‖^2 ≤ (2 : ℝ)^a*(w.im^a*‖q w‖^2) := by + have hwi := (hball w (hsmall hw)).1 + have hd : ‖w-z‖ ≤ z.im/4 := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hw + have hi := Complex.abs_im_le_norm (w-z) + rw [Complex.sub_im] at hi + have hl := neg_le_of_abs_le hi + have hle : z.im ≤ 2*w.im := by linarith + have hh := Real.rpow_le_rpow hy.le hle ha + rw [Real.mul_rpow (by norm_num) hwi.le] at hh + nlinarith [sq_nonneg ‖q w‖] + have hweighted : ENNReal.ofReal (z.im^a)*(∫⁻ w in Metric.closedBall z (z.im/4), ENNReal.ofReal (‖q w‖^2)) ≤ + ENNReal.ofReal ((2 : ℝ)^a)*(∫⁻ w in s \ K, ENNReal.ofReal (w.im^a*‖q w‖^2)) := by + rw [← lintegral_const_mul' _ _ ENNReal.ofReal_ne_top, + ← lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] + apply le_trans ?_ (lintegral_mono_set hsub) + apply setLIntegral_mono' measurableSet_closedBall + intro w hw + rw [← ENNReal.ofReal_mul (Real.rpow_nonneg hy.le _), + ← ENNReal.ofReal_mul (Real.rpow_nonneg (by norm_num) _)] + exact ENNReal.ofReal_le_ofReal (hcomp w hw) + have hineq : ENNReal.ofReal (z.im^(a+2)*‖q z‖^2) ≤ + ENNReal.ofReal C*(∫⁻ w in s \ K, ENNReal.ofReal (w.im^a*‖q w‖^2)) := by + have hh := (mul_le_mul' (le_refl (ENNReal.ofReal (z.im^a))) hmean).trans hweighted + have hmul : ENNReal.ofReal (z.im^a)*ENNReal.ofReal (Real.pi*(z.im/4)^2*‖q z‖^2) = + ENNReal.ofReal (Real.pi/16)*ENNReal.ofReal (z.im^(a+2)*‖q z‖^2) := by + rw [← ENNReal.ofReal_mul (Real.rpow_nonneg hy.le _), + ← ENNReal.ofReal_mul (by positivity),Real.rpow_add hy,Real.rpow_two] + congr 1 + ring + rw [hmul] at hh + apply (ENNReal.mul_le_mul_iff_right (by positivity : ENNReal.ofReal (Real.pi/16) ≠ 0) + ENNReal.ofReal_ne_top).mp + have he : ENNReal.ofReal (Real.pi/16)*ENNReal.ofReal C = ENNReal.ofReal ((2 : ℝ)^a) := by + rw [← ENNReal.ofReal_mul (by positivity)] + congr 1 + dsimp only [C] + field_simp + rw [← mul_assoc,he] + exact hh + have hh := hineq.trans_lt ((ENNReal.mul_lt_mul_iff_right (ENNReal.ofReal_pos.mpr hC).ne' + ENNReal.ofReal_ne_top).mpr hKε) + have he : ENNReal.ofReal C*ENNReal.ofReal (ε/C) = ENNReal.ofReal ε := by + rw [← ENNReal.ofReal_mul hC.le,mul_div_cancel₀ ε (ne_of_gt hC)] + rw [he] at hh + exact (ENNReal.ofReal_lt_ofReal_iff hε).mp hh + +def HasQuarticTail (F : ℂ → ℂ) (a : ℝ) : Prop := + ∀ ε : ℝ, 0 < ε → ∃ R : ℝ, ∀ z : ℂ, 0 < z.im → R ≤ ‖z‖ → + z.im^a*‖F z‖⁻¹^4 < ε + +lemma quartic_tail_proper {F : ℂ → ℂ} {a R₀ : ℝ} + (ha : 0 ≤ a) (ht : HasQuarticTail F a) + (hzero : ∀ z : ℂ, 0 < z.im → R₀ < ‖z‖ → F z ≠ 0) + (hc : ContinuousOn F {z | 0 < z.im}) {K : Set ℂ} (hK : IsCompact K) + {η : ℝ} (hη : 0 < η) : IsCompact ({z : ℂ | η ≤ z.im} ∩ F ⁻¹' K) := by + obtain ⟨M₀,hM₀⟩ := hK.isBounded.subset_closedBall (0 : ℂ) + let M := max M₀ 1 + have hM : 0 < M := lt_of_lt_of_le (by norm_num) (le_max_right M₀ 1) + have hδ : 0 < η^a*M⁻¹^4 := mul_pos (Real.rpow_pos_of_pos hη _) (pow_pos (inv_pos.mpr hM) _) + obtain ⟨R,hR⟩ := ht (η^a*M⁻¹^4) hδ + have hb : {z : ℂ | η ≤ z.im} ∩ F ⁻¹' K ⊆ Metric.closedBall 0 (max R (R₀+1)) := by + intro z hz + rw [Metric.mem_closedBall,dist_zero_right] + by_contra! hzn + have hy : 0 < z.im := hη.trans_le hz.1 + have hznR : R ≤ ‖z‖ := (le_max_left _ _).trans hzn.le + have hzn₀ : R₀ < ‖z‖ := by linarith [le_max_right R (R₀+1)] + have hFn : 0 < ‖F z‖ := norm_pos_iff.mpr (hzero z hy hzn₀) + have hFle : ‖F z‖ ≤ M := by + have hh := hM₀ hz.2 + exact (show ‖F z‖ ≤ M₀ by simpa using hh).trans (le_max_left _ _) + have hpow : M⁻¹^4 ≤ ‖F z‖⁻¹^4 := + pow_le_pow_left₀ (inv_nonneg.mpr hM.le) ((inv_le_inv₀ hM hFn).mpr hFle) 4 + have hheight := Real.rpow_le_rpow hη.le hz.1 ha + have hle := mul_le_mul hheight hpow (by positivity) (Real.rpow_nonneg hy.le _) + exact (not_lt_of_ge hle) (hR z hy hznR) + apply (isCompact_closedBall (0 : ℂ) (max R (R₀+1))).of_isClosed_subset _ hb + exact (hc.mono (fun z hz => hη.trans_le hz)).preimage_isClosed_of_isClosed + (isClosed_le continuous_const Complex.continuous_im) hK.isClosed + +lemma quartic_tail_height_bound {F : ℂ → ℂ} {a R₀ : ℝ} + (ha : 0 ≤ a) (ht : HasQuarticTail F a) + (hzero : ∀ z : ℂ, 0 < z.im → R₀ < ‖z‖ → F z ≠ 0) + (hc : ContinuousOn F {z | 0 < z.im}) {K : Set ℂ} (hK : IsCompact K) : + ∃ H : ℝ, 0 < H ∧ ∀ z : ℂ, 0 < z.im → F z ∈ K → z.im ≤ H := by + have hk := quartic_tail_proper ha ht hzero hc hK (by norm_num : (0 : ℝ) < 1) + obtain ⟨M,hM⟩ := hk.isBounded.subset_closedBall (0 : ℂ) + refine ⟨max M 1,lt_of_lt_of_le (by norm_num) (le_max_right M 1),fun z _ hz => ?_⟩ + by_cases hy : 1 ≤ z.im + · have hh : ‖z‖ ≤ M := by simpa using hM ⟨hy,hz⟩ + exact ((le_abs_self z.im).trans (Complex.abs_im_le_norm z)).trans (hh.trans (le_max_left _ _)) + · exact (le_of_lt (lt_of_not_ge hy)).trans (le_max_right _ _) + +lemma quartic_tail_iff_power {F : ℂ → ℂ} {k : ℝ} (ht : HasQuarticTail F (4*k)) : + ∀ ε : ℝ, 0 < ε → ∃ R : ℝ, ∀ z : ℂ, 0 < z.im → R ≤ ‖z‖ → + z.im^k*‖F z‖⁻¹ < ε := by + intro ε hε + obtain ⟨R,hR⟩ := ht (ε^4) (pow_pos hε _) + refine ⟨R,fun z hz hzr => ?_⟩ + have hh := hR z hz hzr + have he : z.im^(4*k)*‖F z‖⁻¹^4 = (z.im^k*‖F z‖⁻¹)^4 := by + rw [mul_comm (4 : ℝ) k,Real.rpow_mul hz.le,Real.rpow_ofNat,mul_pow] + rw [he] at hh + by_contra! hle + exact (not_lt_of_ge (pow_le_pow_left₀ hε.le hle 4)) hh + +lemma outsideCore_of_norm {z : ℂ} (hz : z ∈ halfPlane) (hn : 3 < ‖z‖) : + z ∈ outsideCore := by + refine ⟨hz,?_⟩ + change (1/2 : ℝ) ≤ ‖(z-Complex.I)/(z+Complex.I)‖ + rw [norm_div,le_div_iff₀ (norm_pos_iff.mpr (cayley_den_ne_zero hz))] + have h₁ : ‖z‖ ≤ ‖z-Complex.I‖+1 := by + simpa only [sub_add_cancel,Complex.norm_I] using norm_add_le (z-Complex.I) Complex.I + have h₂ : ‖z+Complex.I‖ ≤ ‖z‖+1 := by + simpa only [Complex.norm_I] using norm_add_le z Complex.I + linarith + +lemma class_quartic_tail (g : DiskClass) {β : ℝ} (hβ : 1 < β) + (hfin : (∫⁻ z in outsideCore, + ENNReal.ofReal (z.im^(β+1)*‖classFun g z‖⁻¹^4)) < ∞) : + HasQuarticTail (classFun g) (β+3) := by + let q : ℂ → ℂ := fun z => (classFun g z)⁻¹^2 + have hnorm (z : ℂ) : ‖q z‖^2 = ‖classFun g z‖⁻¹^4 := by + simp only [q,norm_pow,norm_inv,← pow_mul] + have hhol (z : ℂ) (hz : z ∈ outsideCore) : DifferentiableAt ℂ q z := + (((classFun_schlicht g).1.1.differentiableAt + (isOpen_halfPlane.mem_nhds hz.1)).inv (classFun_ne_zero_outsideCore g hz)).pow 2 + have hfq : (∫⁻ z in outsideCore, ENNReal.ofReal (z.im^(β+1)*‖q z‖^2)) < ∞ := by + simpa only [hnorm] using hfin + have hh := weighted_holomorphic_tail (by linarith : 0 ≤ β+1) (by norm_num : (0 : ℝ) ≤ 3) + (fun z hz hn => outsideCore_of_norm hz hn) hhol hfq + intro ε hε + obtain ⟨R,hR⟩ := hh ε hε + refine ⟨R,fun z hz hzr => ?_⟩ + have he : β+1+2 = β+3 := by ring + simpa only [he,hnorm] using hR z hz hzr + +lemma class_proper_preimage (g : DiskClass) {β : ℝ} (hβ : 1 < β) + (hfin : (∫⁻ z in outsideCore, + ENNReal.ofReal (z.im^(β+1)*‖classFun g z‖⁻¹^4)) < ∞) + {K : Set ℂ} (hK : IsCompact K) {η : ℝ} (hη : 0 < η) : + IsCompact ({z : ℂ | η ≤ z.im} ∩ classFun g ⁻¹' K) := + quartic_tail_proper (by linarith : 0 ≤ β+3) (class_quartic_tail g hβ hfin) + (fun z hz hn => classFun_ne_zero_outsideCore g (outsideCore_of_norm hz hn)) + (classFun_schlicht g).1.1.continuousOn hK hη + +lemma class_preimage_height_bound (g : DiskClass) {β : ℝ} (hβ : 1 < β) + (hfin : (∫⁻ z in outsideCore, + ENNReal.ofReal (z.im^(β+1)*‖classFun g z‖⁻¹^4)) < ∞) + {K : Set ℂ} (hK : IsCompact K) : + ∃ H : ℝ, 0 < H ∧ ∀ z : ℂ, 0 < z.im → classFun g z ∈ K → z.im ≤ H := + quartic_tail_height_bound (by linarith : 0 ≤ β+3) (class_quartic_tail g hβ hfin) + (fun z hz hn => classFun_ne_zero_outsideCore g (outsideCore_of_norm hz hn)) + (classFun_schlicht g).1.1.continuousOn hK + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/CircleBounds.lean b/lean/OAI/Analysis/IntegralMeans/CircleBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ce7ffdb15616d27884d876c74189dfb87b0ed22 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/CircleBounds.lean @@ -0,0 +1,569 @@ +import OAI.Analysis.IntegralMeans.Moments + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology +namespace Brennan + +def circlePoint (r θ : ℝ) : ℂ := (r:ℂ)*Complex.exp ((θ:ℂ)*Complex.I) + +def arcInterval : Set ℝ := Icc (-Real.pi/4) (Real.pi/4) + +def arcD (r θ : ℝ) : ℝ := 1+2*r*Real.cos θ+r^2 + +def arcX (r θ : ℝ) : ℝ := 2*r*Real.sin θ/arcD r θ + +def arcY (r θ : ℝ) : ℝ := (1-r^2)/arcD r θ + +def arcXDeriv (r θ : ℝ) : ℝ := (4*r^2+2*r*(1+r^2)*Real.cos θ)/(arcD r θ)^2 + +lemma arc_cos_nonneg {θ : ℝ} (hθ : θ ∈ arcInterval) : 0 ≤ Real.cos θ := by + apply Real.cos_nonneg_of_mem_Icc + constructor <;> have hp := Real.pi_pos <;> dsimp [arcInterval] at hθ <;> linarith [hθ.1,hθ.2] + +lemma arcD_bounds {r θ : ℝ} (hr : 1/2 ≤ r) (hr1 : r < 1) (hθ : θ ∈ arcInterval) : + 1 ≤ arcD r θ ∧ arcD r θ ≤ (1+r)^2 ∧ arcD r θ ≤ 4 := by + have hc := arc_cos_nonneg hθ + have hc1 := Real.cos_le_one θ + have hr0 : 0 ≤ r := by linarith + have hr2 : 0 ≤ 2*r := by positivity + dsimp [arcD] + have hm := mul_nonneg hr2 hc + have hm1 := mul_le_mul_of_nonneg_left hc1 hr2 + constructor + · nlinarith [sq_nonneg r] + constructor <;> nlinarith + +lemma arcX_bounds {r θ : ℝ} (hr : 1/2 ≤ r) (hr1 : r < 1) (hθ : θ ∈ arcInterval) : + arcX r θ ∈ Icc (-1) 1 := by + have hd := arcD_bounds hr hr1 hθ + have hD : 0 < arcD r θ := by linarith [hd.1] + have hc := arc_cos_nonneg hθ + have hs := Real.neg_one_le_sin θ + have hs1 := Real.sin_le_one θ + have h2r : 0 ≤ 2*r := by linarith + have hm1 := mul_le_mul_of_nonneg_left hs h2r + have hm2 := mul_le_mul_of_nonneg_left hs1 h2r + have hD2 : 2*r ≤ arcD r θ := by + dsimp [arcD] + nlinarith [mul_nonneg h2r hc,sq_nonneg (r-1)] + constructor + · exact (le_div_iff₀ hD).mpr (by nlinarith) + · exact (div_le_iff₀ hD).mpr (by nlinarith) + +lemma arcY_bounds {r θ : ℝ} (hr : 1/2 ≤ r) (hr1 : r < 1) (hθ : θ ∈ arcInterval) : + (1-r)/2 ≤ arcY r θ ∧ arcY r θ ≤ 2*(1-r) := by + have hd := arcD_bounds hr hr1 hθ + have hD : 0 < arcD r θ := by linarith [hd.1] + have hr0 : 0 ≤ r := by linarith + have hd0 : 0 ≤ 1-r := by linarith + constructor + · apply (le_div_iff₀ hD).mpr + have h := mul_le_mul_of_nonneg_left hd.2.1 (by positivity : 0 ≤ (1-r)/2) + have hb : (1-r)/2*(1+r)^2 ≤ 1-r^2 := by nlinarith [mul_nonneg hd0 (sq_nonneg (1+r))] + exact h.trans hb + · apply (div_le_iff₀ hD).mpr + have h := mul_le_mul_of_nonneg_left hd.1 (by positivity : 0 ≤ 2*(1-r)) + nlinarith [sq_nonneg (r-1)] + +lemma arcX_hasDerivAt {r θ : ℝ} (hD : arcD r θ ≠ 0) : + HasDerivAt (arcX r) (arcXDeriv r θ) θ := by + have hn := (Real.hasDerivAt_sin θ).const_mul (2*r) + have hd := (((Real.hasDerivAt_cos θ).const_mul (2*r)).const_add 1).add_const (r^2) + have h := hn.div hd hD + change HasDerivAt (arcX r) _ θ at h + have he : arcXDeriv r θ = + (2*r*Real.cos θ*arcD r θ-2*r*Real.sin θ*(2*r * -Real.sin θ))/(arcD r θ)^2 := by + unfold arcXDeriv arcD + congr 1 + have hc := Real.sin_sq_add_cos_sq θ + nlinarith [sq_nonneg r] + rw [he] + exact h + +lemma arcXDeriv_lower {r θ : ℝ} (hr : 1/2 ≤ r) (hr1 : r < 1) (hθ : θ ∈ arcInterval) : + 1/16 ≤ arcXDeriv r θ := by + have hd := arcD_bounds hr hr1 hθ + have hD : 0 < arcD r θ := by linarith [hd.1] + have hc := arc_cos_nonneg hθ + dsimp only [arcXDeriv] + apply (le_div_iff₀ (sq_pos_of_pos hD)).mpr + have hm : 0 ≤ 2*r*(1+r^2)*Real.cos θ := mul_nonneg (by positivity) hc + have hsq : (arcD r θ)^2 ≤ 16 := by nlinarith [hd.2.2] + nlinarith [sq_nonneg (r-1/2)] + +lemma continuousOn_arcXDeriv {r : ℝ} (hr : 1/2 ≤ r) (hr1 : r < 1) : + ContinuousOn (arcXDeriv r) arcInterval := by + apply ContinuousOn.div + · fun_prop + · unfold arcD + fun_prop + · intro θ hθ + exact pow_ne_zero _ (ne_of_gt (lt_of_lt_of_le zero_lt_one (arcD_bounds hr hr1 hθ).1)) + +lemma arcX_monotone {r : ℝ} (hr : 1/2 ≤ r) (hr1 : r < 1) : MonotoneOn (arcX r) arcInterval := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc _ _) + · intro θ hθ + exact (arcX_hasDerivAt (ne_of_gt (lt_of_lt_of_le zero_lt_one (arcD_bounds hr hr1 hθ).1))).continuousAt.continuousWithinAt + · intro θ hθ + exact (arcX_hasDerivAt (ne_of_gt (lt_of_lt_of_le zero_lt_one (arcD_bounds hr hr1 (interior_subset hθ)).1))).hasDerivWithinAt + · intro θ hθ + exact le_trans (by norm_num) (arcXDeriv_lower hr hr1 (interior_subset hθ)) + +lemma circlePoint_norm (r θ : ℝ) : ‖circlePoint r θ‖ = |r| := by + simp [circlePoint,Complex.norm_exp] + +lemma circlePoint_re (r θ : ℝ) : (circlePoint r θ).re = r*Real.cos θ := by + simp [circlePoint,Complex.exp_mul_I,← Complex.ofReal_cos,← Complex.ofReal_sin] + +lemma circlePoint_im (r θ : ℝ) : (circlePoint r θ).im = r*Real.sin θ := by + simp [circlePoint,Complex.exp_mul_I,← Complex.ofReal_cos,← Complex.ofReal_sin] + +lemma one_add_circlePoint_norm_sq (r θ : ℝ) : ‖1+circlePoint r θ‖^2 = arcD r θ := by + rw [Complex.sq_norm] + simp only [Complex.normSq_apply,Complex.add_re,Complex.add_im,Complex.one_re,Complex.one_im,circlePoint_re,circlePoint_im,zero_add] + dsimp [arcD] + nlinarith [Real.sin_sq_add_cos_sq θ,sq_nonneg r] + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology +namespace Brennan +attribute [local irreducible] classFun classWeight rerootClass + +lemma circlePoint_mem_disk {r : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) (θ : ℝ) : circlePoint r θ ∈ disk := by + simpa [disk,circlePoint_norm,abs_of_nonneg hr] using hr1 + +lemma neg_circlePoint_mem_disk {r : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) (θ : ℝ) : -circlePoint r θ ∈ disk := by + simpa only [disk,Metric.mem_ball,dist_zero_right,norm_neg] using circlePoint_mem_disk hr hr1 θ + +lemma halfCayley_re (z : ℂ) : (halfCayley z).re = -2*z.im/‖1-z‖^2 := by + simp only [halfCayley,Complex.div_re,Complex.mul_re,Complex.mul_im, + Complex.I_re,Complex.I_im,Complex.add_re,Complex.add_im,Complex.one_re, + Complex.one_im,Complex.sub_re,Complex.sub_im,Complex.sq_norm,Complex.normSq_apply] + ring + +lemma halfCayley_neg_circlePoint {r : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) (θ : ℝ) : + halfCayley (-circlePoint r θ) = (arcX r θ:ℂ)+(arcY r θ:ℂ)*Complex.I := by + have hz := neg_circlePoint_mem_disk hr hr1 θ + apply Complex.ext + · rw [halfCayley_re] + simp only [Complex.neg_im,circlePoint_im,sub_neg_eq_add,one_add_circlePoint_norm_sq, + Complex.add_re,Complex.ofReal_re,Complex.mul_re,Complex.I_re,Complex.ofReal_im,Complex.I_im] + dsimp [arcX] + ring + · rw [halfCayley_im hz] + simp only [norm_neg,circlePoint_norm,abs_of_nonneg hr,sub_neg_eq_add,one_add_circlePoint_norm_sq, + Complex.add_im,Complex.ofReal_im,Complex.mul_im,Complex.I_re,Complex.ofReal_re,Complex.I_im] + simp [arcY] + +lemma classWeight_vertical_bound (g : DiskClass) {η : ℝ} (hη : 1/2 ≤ η) (hη4 : η ≤ 4) : + classWeight g (halfPoint 0 η (by linarith)) ≤ 1562500 := by + let z := halfPoint 0 η (by linarith : 0 < η) + have hb := classFun_reciprocal_bound g z + have he : ‖z.val+Complex.I‖ = η+1 := by + have hz : z.val+Complex.I = ((η+1:ℝ):ℂ)*Complex.I := by + dsimp [z,halfPoint] + push_cast + ring + rw [hz,norm_mul,Complex.norm_I,mul_one,Complex.norm_real,Real.norm_eq_abs,abs_of_pos (by linarith)] + have hη0 : 0 < η := by linarith + have ht : ‖reciprocalDeriv (classFun g) z‖ ≤ 1250 := by + rw [he] at hb + simp only [z,halfPoint,Complex.add_im,Complex.ofReal_im,Complex.mul_im,Complex.ofReal_re,Complex.I_im,Complex.I_re,mul_one,mul_zero,add_zero,zero_add] at hb + have hp : (η+1)^4 ≤ (5:ℝ)^4 := pow_le_pow_left₀ (by linarith) (by linarith) _ + apply hb.trans + apply (div_le_iff₀ hη0).mpr + norm_num at hp + linarith + unfold classWeight + change ‖reciprocalDeriv (classFun g) z‖^2 ≤ _ + nlinarith [norm_nonneg (reciprocalDeriv (classFun g) z)] + +lemma classWeight_vertical_compare (g : DiskClass) (x v y : ℝ) (hv : 0 < v) + (hy : v/2 ≤ y) (hy4 : y ≤ 4*v) : + classWeight g (halfPoint x y (by linarith)) ≤ + 1562500*classWeight g (halfPoint x v hv) := by + have hη : 1/2 ≤ y/v := (le_div_iff₀ hv).mpr (by linarith) + have hη4 : y/v ≤ 4 := (div_le_iff₀ hv).mpr hy4 + have hη0 : 0 < y/v := by linarith + have he : halfMul (halfPoint x v hv) (halfPoint 0 (y/v) hη0) = halfPoint x y (by linarith) := by + rw [halfPoint_mul] + apply Subtype.ext + dsimp [halfPoint] + congr 2 <;> simp [mul_div_cancel₀ y hv.ne'] + have hc := classWeight_cocycle g (halfPoint x v hv) (halfPoint 0 (y/v) hη0) + change _ = classWeight g (halfMul _ _) at hc + rw [he] at hc + rw [← hc,mul_comm (1562500:ℝ)] + exact mul_le_mul_of_nonneg_left (classWeight_vertical_bound _ hη hη4) (classWeight_pos g _).le + +lemma inverse_deriv_square_conversion {f : ℂ → ℂ} (hf : Schlicht f) {w : ℂ} (hw : w ∈ disk) : + ‖deriv f w‖^(-2:ℝ) ≤ 16*classWeight (classOfHalf (diskToHalf f) (diskToHalf_schlicht hf)) + ⟨halfCayley w,halfCayley_maps hw⟩ := by + let g := classOfHalf (diskToHalf f) (diskToHalf_schlicht hf) + let z : halfPlane := ⟨halfCayley w,halfCayley_maps hw⟩ + have he := (classFun_classOfHalf (diskToHalf_schlicht hf)).deriv isOpen_halfPlane z.2 + have hfhe : EqOn (halfToDisk (diskToHalf f)) f disk := fun _ hz => halfToDisk_diskToHalf hz + have hd := (hasDerivAt_halfToDisk (diskToHalf_schlicht hf).1.1 hw).deriv + rw [hfhe.deriv Metric.isOpen_ball hw] at hd + have hw1 : ‖w‖ < 1 := by simpa [disk] using hw + have hb : ‖1-w‖ ≤ 2 := (norm_sub_le _ _).trans (by simpa using (show 1+‖w‖ ≤ 2 by linarith)) + have ha : 0 < ‖deriv (diskToHalf f) (halfCayley w)‖ := norm_pos_iff.mpr + (univalent_deriv_ne_zero isOpen_halfPlane (diskToHalf_schlicht hf).1 z.2) + rw [hd,norm_div,norm_pow,Real.rpow_neg (by positivity),Real.rpow_two] + unfold classWeight + change _ ≤ 16*‖reciprocalDeriv (classFun g) z‖^2 + rw [reciprocalDeriv,he,norm_inv] + have hb4 : ‖1-w‖^4 ≤ (2:ℝ)^4 := pow_le_pow_left₀ (norm_nonneg _) hb _ + have hz0 : ‖1-w‖ ≠ 0 := norm_ne_zero_iff.mpr (halfCayley_den_ne_zero hw) + dsimp only [z] + field_simp [ha.ne',hz0] + nlinarith + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology +namespace Brennan + +attribute [local irreducible] classFun classWeight rerootClass + +lemma continuous_weightAt : Continuous weightAt := by + have he : weightAt = fun z => affineOperator z 1 := by + funext z + ext g + simp only [affineOperator_apply,ContinuousMap.one_apply,mul_one] + rfl + rw [he] + exact continuous_affineOperator_apply 1 + +def horizontalMass (v : ℝ) (hv : 0 < v) : C(DiskClass,ℝ) := + ∫ x in (-1:ℝ)..1, weightAt (halfPoint x v hv) + +lemma horizontalMass_apply (v : ℝ) (hv : 0 < v) (g : DiskClass) : + horizontalMass v hv g = ∫ x in (-1:ℝ)..1, classWeight g (halfPoint x v hv) := by + exact ((ContinuousMap.evalCLM ℝ g).intervalIntegral_comp_comm + ((continuous_weightAt.comp (continuous_halfPoint continuous_id continuous_const (fun _ => hv))).intervalIntegrable (μ := volume) _ _)).symm + +lemma continuous_horizontalWeight (g : DiskClass) (v : ℝ) (hv : 0 < v) : + Continuous (fun x => classWeight g (halfPoint x v hv)) := + continuous_classWeight.comp (continuous_const.prodMk + (continuous_halfPoint continuous_id continuous_const (fun _ => hv))) + +lemma horizontalMass_half (v : ℝ) (hv : 0 < v) : + horizontalMass (v/2) (by positivity) = transferOperator (horizontalMass v hv) := by + ext g + rw [horizontalMass_apply] + change _ = (1/2:ℝ)*(classWeight g dyadicLeft * horizontalMass v hv (rerootClass g dyadicLeft)+ + classWeight g dyadicRight * horizontalMass v hv (rerootClass g dyadicRight)) + rw [horizontalMass_apply,horizontalMass_apply,← intervalIntegral.integral_const_mul, + ← intervalIntegral.integral_const_mul] + have hL (x : ℝ) : classWeight g dyadicLeft * classWeight (rerootClass g dyadicLeft) (halfPoint x v hv) = + classWeight g (halfPoint ((1/2)*x+(-(1/2))) (v/2) (by positivity)) := by + rw [classWeight_cocycle] + congr 1 + apply Subtype.ext + apply Complex.ext <;> simp [dyadicLeft,halfPoint,affine] <;> ring + have hR (x : ℝ) : classWeight g dyadicRight * classWeight (rerootClass g dyadicRight) (halfPoint x v hv) = + classWeight g (halfPoint ((1/2)*x+1/2) (v/2) (by positivity)) := by + rw [classWeight_cocycle] + congr 1 + apply Subtype.ext + apply Complex.ext <;> simp [dyadicRight,halfPoint,affine] <;> ring + simp_rw [hL,hR] + have hl := intervalIntegral.integral_comp_mul_add + (f := fun x => classWeight g (halfPoint x (v/2) (by positivity))) + (a := (-1:ℝ)) (b := 1) (by norm_num : (1/2:ℝ) ≠ 0) (-1/2) + have hr := intervalIntegral.integral_comp_mul_add + (f := fun x => classWeight g (halfPoint x (v/2) (by positivity))) + (a := (-1:ℝ)) (b := 1) (by norm_num : (1/2:ℝ) ≠ 0) (1/2) + norm_num at hl hr + have hi := (continuous_horizontalWeight g (v/2) (by positivity)).intervalIntegrable (μ := volume) + have hs := intervalIntegral.integral_add_adjacent_intervals (hi (-1) 0) (hi 0 1) + rw [hl,hr] + linarith [hs] + +lemma horizontalMass_dyadic (n : ℕ) : + horizontalMass ((1/2:ℝ)^n) (by positivity) = (transferOperator^n) (horizontalMass 1 zero_lt_one) := by + induction n with + | zero => rfl + | succ n ih => + have he : (1/2:ℝ)^(n+1) = (1/2:ℝ)^n/2 := by rw [pow_succ]; ring + have hm : horizontalMass ((1/2:ℝ)^(n+1)) (by positivity) = horizontalMass ((1/2:ℝ)^n/2) (by positivity) := by congr 1 + rw [hm,horizontalMass_half _ (by positivity),ih,pow_succ',mul_apply_eq_comp] + +lemma horizontalMass_dyadic_le (n : ℕ) (g : DiskClass) : + (∫ x in (-1:ℝ)..1, classWeight g (halfPoint x ((1/2:ℝ)^n) (by positivity))) ≤ + ‖horizontalMass 1 zero_lt_one‖*‖transferOperator^n‖ := by + rw [← horizontalMass_apply,horizontalMass_dyadic,mul_comm] + exact (le_abs_self _).trans ((ContinuousMap.norm_coe_le_norm _ _).trans ((transferOperator^n).le_opNorm _)) + +lemma transferOperator_uniform_growth {lam : ℝ} (hlam : 2 < lam) : + ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, ‖transferOperator^n‖ ≤ C*lam^n := by + have hl : 0 < lam := by linarith + obtain ⟨N,hN⟩ := eventually_atTop.mp (norm_pow_eventually_le transferOperator transferOperator_pow_norm_ge_one + (lt_of_le_of_lt transferRho_le_two hlam)) + let C : ℝ := 1 + ∑ j ∈ Finset.range N, ‖transferOperator^j‖/lam^j + have hC : 1 ≤ C := le_add_of_nonneg_right (Finset.sum_nonneg (fun j _ => div_nonneg (norm_nonneg (transferOperator^j)) (pow_pos hl j).le)) + refine ⟨C,zero_lt_one.trans_le hC,fun n => ?_⟩ + by_cases hn : N ≤ n + · exact (hN n hn).trans (le_mul_of_one_le_left (pow_pos hl n).le hC) + · have hs : ‖transferOperator^n‖/lam^n ≤ ∑ j ∈ Finset.range N, ‖transferOperator^j‖/lam^j := + Finset.single_le_sum (fun j _ => div_nonneg (norm_nonneg (transferOperator^j)) (pow_pos hl j).le) (Finset.mem_range.mpr (lt_of_not_ge hn)) + apply (div_le_iff₀ (pow_pos hl n)).mp + exact hs.trans (by dsimp [C]; linarith) + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology +namespace Brennan +attribute [local irreducible] classFun classWeight rerootClass + +lemma continuous_circlePoint (r : ℝ) : Continuous (circlePoint r) := by + unfold circlePoint + fun_prop + +lemma continuous_circle_deriv_rpow {f : ℂ → ℂ} (hf : UnivalentOn f disk) + {r : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) (t : ℝ) : + Continuous (fun θ => ‖deriv f (circlePoint r θ)‖^t) := by + have hc : Continuous (fun θ => deriv f (circlePoint r θ)) := + ((hf.1.deriv Metric.isOpen_ball).continuousOn).comp_continuous (continuous_circlePoint r) + (circlePoint_mem_disk hr hr1) + exact hc.norm.rpow_const (fun θ => Or.inl (norm_ne_zero_iff.mpr + (univalent_deriv_ne_zero Metric.isOpen_ball hf (circlePoint_mem_disk hr hr1 θ)))) + +lemma continuous_neg_circle_deriv_rpow {f : ℂ → ℂ} (hf : UnivalentOn f disk) + {r : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) (t : ℝ) : + Continuous (fun θ => ‖deriv f (-circlePoint r θ)‖^t) := by + have hc : Continuous (fun θ => deriv f (-circlePoint r θ)) := + ((hf.1.deriv Metric.isOpen_ball).continuousOn).comp_continuous (continuous_circlePoint r).neg + (neg_circlePoint_mem_disk hr hr1) + exact hc.norm.rpow_const (fun θ => Or.inl (norm_ne_zero_iff.mpr + (univalent_deriv_ne_zero Metric.isOpen_ball hf (neg_circlePoint_mem_disk hr hr1 θ)))) + +lemma arc_integral_bound {f : ℂ → ℂ} (hf : Schlicht f) {r v : ℝ} + (hr : 1/2 ≤ r) (hr1 : r < 1) (hv : 0 < v) (hvδ : v ≤ 1-r) (hδv : 1-r ≤ 2*v) : + (∫ θ in (-Real.pi/4)..(Real.pi/4), ‖deriv f (-circlePoint r θ)‖^(-2:ℝ)) ≤ + 400000000 * horizontalMass v hv (classOfHalf (diskToHalf f) (diskToHalf_schlicht hf)) := by + let g := classOfHalf (diskToHalf f) (diskToHalf_schlicht hf) + let W : ℝ → ℝ := fun x => classWeight g (halfPoint x v hv) + have hW : Continuous W := continuous_horizontalWeight g v hv + have hab : -Real.pi/4 ≤ Real.pi/4 := by linarith [Real.pi_pos] + have hu : uIcc (-Real.pi/4) (Real.pi/4) = arcInterval := uIcc_of_le hab + have hX (θ : ℝ) (hθ : θ ∈ arcInterval) : HasDerivAt (arcX r) (arcXDeriv r θ) θ := + arcX_hasDerivAt (ne_of_gt (lt_of_lt_of_le zero_lt_one (arcD_bounds hr hr1 hθ).1)) + have hXc : ContinuousOn (arcX r) arcInterval := fun θ hθ => (hX θ hθ).continuousAt.continuousWithinAt + have hprod : ContinuousOn (fun θ => W (arcX r θ)*arcXDeriv r θ) arcInterval := + (hW.comp_continuousOn hXc).mul (continuousOn_arcXDeriv hr hr1) + have hi := intervalIntegral.integral_mono_on hab + ((continuous_neg_circle_deriv_rpow hf.1 (by linarith) hr1 (-2)).intervalIntegrable (μ := volume) _ _) + ((hprod.const_mul 400000000).intervalIntegrable_of_Icc hab) + (fun θ hθ => show ‖deriv f (-circlePoint r θ)‖^(-2:ℝ) ≤ + 400000000*(W (arcX r θ)*arcXDeriv r θ) from by + have hθ' : θ ∈ arcInterval := hθ + have hy := arcY_bounds hr hr1 hθ' + have hz : (⟨halfCayley (-circlePoint r θ),halfCayley_maps (neg_circlePoint_mem_disk (by linarith) hr1 θ)⟩ : halfPlane) = + halfPoint (arcX r θ) (arcY r θ) (by linarith) := + Subtype.ext (halfCayley_neg_circlePoint (by linarith) hr1 θ) + have hc := inverse_deriv_square_conversion hf (neg_circlePoint_mem_disk (by linarith) hr1 θ) + rw [hz] at hc + have hb := classWeight_vertical_compare g (arcX r θ) v (arcY r θ) hv (by linarith) (by linarith) + have hd := arcXDeriv_lower hr hr1 hθ' + have hWp : 0 ≤ W (arcX r θ) := (classWeight_pos g _).le + have hm := mul_nonneg hWp (sub_nonneg.mpr hd) + change _ ≤ 16*classWeight g _ at hc + change classWeight g _ ≤ 1562500*W (arcX r θ) at hb + nlinarith) + rw [intervalIntegral.integral_const_mul] at hi + have hchange := intervalIntegral.integral_comp_mul_deriv + (fun θ hθ => hX θ (hu ▸ hθ)) (hu ▸ continuousOn_arcXDeriv hr hr1) hW + change (∫ θ in (-Real.pi/4)..(Real.pi/4), W (arcX r θ)*arcXDeriv r θ) = _ at hchange + rw [hchange] at hi + have hlo : -Real.pi/4 ∈ arcInterval := ⟨le_rfl,hab⟩ + have hhi : Real.pi/4 ∈ arcInterval := ⟨hab,le_rfl⟩ + have hm := arcX_monotone hr hr1 hlo hhi hab + have hb := intervalIntegral.integral_mono_interval (arcX_bounds hr hr1 hlo).1 hm + (arcX_bounds hr hr1 hhi).2 + (Eventually.of_forall (fun x => (classWeight_pos g (halfPoint x v hv)).le)) + (hW.intervalIntegrable (μ := volume) (-1) 1) + rw [horizontalMass_apply] + exact hi.trans (mul_le_mul_of_nonneg_left hb (by norm_num)) + +lemma arc_integral_dyadic_bound {f : ℂ → ℂ} (hf : Schlicht f) {r : ℝ} + (hr : 1/2 ≤ r) (hr1 : r < 1) (n : ℕ) + (hvδ : (1/2:ℝ)^n ≤ 1-r) (hδv : 1-r ≤ 2*(1/2:ℝ)^n) : + (∫ θ in (-Real.pi/4)..(Real.pi/4), ‖deriv f (-circlePoint r θ)‖^(-2:ℝ)) ≤ + (400000000*‖horizontalMass 1 zero_lt_one‖)*‖transferOperator^n‖ := by + have hb := arc_integral_bound hf hr hr1 (by positivity) hvδ hδv + have hm := horizontalMass_dyadic_le n (classOfHalf (diskToHalf f) (diskToHalf_schlicht hf)) + rw [← horizontalMass_apply] at hm + exact hb.trans ((mul_le_mul_of_nonneg_left hm (by norm_num)).trans_eq (by ring)) + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology +namespace Brennan +attribute [local irreducible] classFun classWeight rerootClass + +def rotateDisk (f : ℂ → ℂ) (α z : ℂ) : ℂ := f (α*z)/α + +lemma rotateDisk_maps {α : ℂ} (hα : ‖α‖ = 1) : MapsTo (fun z => α*z) disk disk := by + intro z hz + simpa [disk,norm_mul,hα] using hz + +lemma rotateDisk_hasDerivAt {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f disk) + {α z : ℂ} (hα : ‖α‖ = 1) (hz : z ∈ disk) : + HasDerivAt (rotateDisk f α) (deriv f (α*z)) z := by + have hα0 : α ≠ 0 := by intro h; simp [h] at hα + have hd := ((hf _ (rotateDisk_maps hα hz)).differentiableAt + (Metric.isOpen_ball.mem_nhds (rotateDisk_maps hα hz))).hasDerivAt + convert (hd.comp z ((hasDerivAt_id z).const_mul α)).div_const α using 1 <;> try rfl + simp [hα0] + +lemma rotateDisk_schlicht {f : ℂ → ℂ} (hf : Schlicht f) {α : ℂ} (hα : ‖α‖ = 1) : + Schlicht (rotateDisk f α) := by + have hα0 : α ≠ 0 := by intro h; simp [h] at hα + refine ⟨⟨fun z hz => (rotateDisk_hasDerivAt hf.1.1 hα hz).differentiableAt.differentiableWithinAt,?_⟩,?_,?_⟩ + · intro z hz w hw he + exact mul_left_cancel₀ hα0 (hf.1.2 (rotateDisk_maps hα hz) (rotateDisk_maps hα hw) + ((div_left_inj' hα0).mp he)) + · simp [rotateDisk,hf.2.1] + · rw [(rotateDisk_hasDerivAt hf.1.1 hα (show (0:ℂ) ∈ disk by simp [disk])).deriv] + simpa using hf.2.2 + +lemma circlePoint_shift (r θ c : ℝ) : + (-Complex.exp ((c:ℂ)*Complex.I))*(-circlePoint r θ) = circlePoint r (θ+c) := by + simp only [circlePoint,Complex.ofReal_add,add_mul,Complex.exp_add,neg_mul_neg] + ring + +lemma circle_arc_dyadic_bound {f : ℂ → ℂ} (hf : Schlicht f) {r : ℝ} + (hr : 1/2 ≤ r) (hr1 : r < 1) (n : ℕ) + (hvδ : (1/2:ℝ)^n ≤ 1-r) (hδv : 1-r ≤ 2*(1/2:ℝ)^n) (c : ℝ) : + (∫ θ in (c-Real.pi/4)..(c+Real.pi/4), ‖deriv f (circlePoint r θ)‖^(-2:ℝ)) ≤ + (400000000*‖horizontalMass 1 zero_lt_one‖)*‖transferOperator^n‖ := by + let α := -Complex.exp ((c:ℂ)*Complex.I) + have hα : ‖α‖ = 1 := by simp [α,Complex.norm_exp] + have hb := arc_integral_dyadic_bound (rotateDisk_schlicht hf hα) hr hr1 n hvδ hδv + have he (θ : ℝ) : deriv (rotateDisk f α) (-circlePoint r θ) = deriv f (circlePoint r (θ+c)) := by + rw [(rotateDisk_hasDerivAt hf.1.1 hα (neg_circlePoint_mem_disk (by linarith) hr1 θ)).deriv] + rw [show α*(-circlePoint r θ) = circlePoint r (θ+c) from circlePoint_shift r θ c] + simp_rw [he] at hb + rw [intervalIntegral.integral_comp_add_right (f := fun θ => ‖deriv f (circlePoint r θ)‖^(-2:ℝ)) c] at hb + convert hb using 1 + congr 1 <;> ring + +lemma periodic_circlePoint (r : ℝ) : Periodic (circlePoint r) (2*Real.pi) := by + simpa [circlePoint,circleMap] using periodic_circleMap (0:ℂ) r + +lemma full_circle_dyadic_bound {f : ℂ → ℂ} (hf : Schlicht f) {r : ℝ} + (hr : 1/2 ≤ r) (hr1 : r < 1) (n : ℕ) + (hvδ : (1/2:ℝ)^n ≤ 1-r) (hδv : 1-r ≤ 2*(1/2:ℝ)^n) : + (∫ θ in -Real.pi..Real.pi, ‖deriv f (circlePoint r θ)‖^(-2:ℝ)) ≤ + (1600000000*‖horizontalMass 1 zero_lt_one‖)*‖transferOperator^n‖ := by + let F : ℝ → ℝ := fun θ => ‖deriv f (circlePoint r θ)‖^(-2:ℝ) + have hF := (continuous_circle_deriv_rpow hf.1 (by linarith) hr1 (-2)).intervalIntegrable (μ := volume) + have hper : Periodic F (2*Real.pi) := (periodic_circlePoint r).comp (fun z => ‖deriv f z‖^(-2:ℝ)) + have hshift := hper.intervalIntegral_add_eq (-Real.pi) (-Real.pi/4) + have h1 := circle_arc_dyadic_bound hf hr hr1 n hvδ hδv 0 + have h2 := circle_arc_dyadic_bound hf hr hr1 n hvδ hδv (Real.pi/2) + have h3 := circle_arc_dyadic_bound hf hr hr1 n hvδ hδv Real.pi + have h4 := circle_arc_dyadic_bound hf hr hr1 n hvδ hδv (3*Real.pi/2) + have e1 : (0:ℝ)-Real.pi/4 = -Real.pi/4 := by ring + have e2 : (0:ℝ)+Real.pi/4 = Real.pi/4 := by ring + have e3 : Real.pi/2-Real.pi/4 = Real.pi/4 := by ring + have e4 : Real.pi/2+Real.pi/4 = 3*Real.pi/4 := by ring + have e5 : Real.pi-Real.pi/4 = 3*Real.pi/4 := by ring + have e6 : Real.pi+Real.pi/4 = 5*Real.pi/4 := by ring + have e7 : 3*Real.pi/2-Real.pi/4 = 5*Real.pi/4 := by ring + have e8 : 3*Real.pi/2+Real.pi/4 = 7*Real.pi/4 := by ring + rw [e1,e2] at h1 + rw [e3,e4] at h2 + rw [e5,e6] at h3 + rw [e7,e8] at h4 + have ha := intervalIntegral.integral_add_adjacent_intervals (hF (-Real.pi/4) (Real.pi/4)) (hF (Real.pi/4) (3*Real.pi/4)) + have hb := intervalIntegral.integral_add_adjacent_intervals (hF (-Real.pi/4) (3*Real.pi/4)) (hF (3*Real.pi/4) (5*Real.pi/4)) + have hc := intervalIntegral.integral_add_adjacent_intervals (hF (-Real.pi/4) (5*Real.pi/4)) (hF (5*Real.pi/4) (7*Real.pi/4)) + have es1 : -Real.pi+2*Real.pi = Real.pi := by ring + have es2 : -Real.pi/4+2*Real.pi = 7*Real.pi/4 := by ring + rw [es1,es2] at hshift + dsimp only [F] at hshift + linarith + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology +namespace Brennan + +lemma dyadic_growth_compare {a δ : ℝ} (ha : 0 ≤ a) (hδ : 0 < δ) {n : ℕ} + (hn : δ ≤ 2*(1/2:ℝ)^n) : + ((2:ℝ)^a)^n ≤ (2:ℝ)^a * δ^(-a) := by + have hv : 0 < (1/2:ℝ)^n := by positivity + have he : ((2:ℝ)^a)^n = ((1/2:ℝ)^n)^(-a) := by + rw [← Real.rpow_natCast,← Real.rpow_mul (by norm_num),← Real.rpow_natCast (1/2:ℝ), + ← Real.rpow_mul (by norm_num)] + rw [show (1/2:ℝ) = 2^(-1:ℝ) by norm_num,← Real.rpow_mul (by norm_num)] + congr 1 + ring + rw [he] + have hb := Real.rpow_le_rpow_of_nonpos (by positivity : 0 < δ/2) + (show δ/2 ≤ (1/2:ℝ)^n by linarith) (neg_nonpos.mpr ha) + refine hb.trans_eq ?_ + rw [Real.div_rpow hδ.le (by norm_num),Real.rpow_neg (by norm_num : (0:ℝ) ≤ 2),div_inv_eq_mul,mul_comm] + +lemma uniform_inverse_square_bound (ε : ℝ) (hε : 0 < ε) : + ∃ C : ℝ, 0 < C ∧ ∀ f : ℂ → ℂ, Schlicht f → ∀ r : ℝ, 1/2 ≤ r → r < 1 → + integralMean f (-2) r ≤ C*(1-r)^(-1-ε) := by + have hlam : 2 < (2:ℝ)^(1+ε) := by + calc + (2:ℝ) = 2^(1:ℝ) := by rw [Real.rpow_one] + _ < 2^(1+ε) := Real.rpow_lt_rpow_of_exponent_lt (by norm_num) (by linarith) + obtain ⟨K,hK,hKn⟩ := transferOperator_uniform_growth hlam + let A := (2*Real.pi)⁻¹*(1600000000*‖horizontalMass 1 zero_lt_one‖)*K*(2:ℝ)^(1+ε) + have hA : 0 ≤ A := by dsimp [A]; positivity + refine ⟨A+1,by linarith,fun f hf r hr hr1 => ?_⟩ + obtain ⟨n,hn1,hn2⟩ := exists_nat_pow_near_of_lt_one (by linarith : 0 < 1-r) + (by linarith : 1-r ≤ 1) (by norm_num : (0:ℝ) < 1/2) (by norm_num : (1/2:ℝ) < 1) + have hn : 1-r ≤ 2*(1/2:ℝ)^(n+1) := by rw [pow_succ]; nlinarith + have hb := full_circle_dyadic_bound hf hr hr1 (n+1) hn1.le hn + have hc := dyadic_growth_compare (by linarith : 0 ≤ 1+ε) (by linarith : 0 < 1-r) hn + have hx : 0 ≤ (2*Real.pi)⁻¹ := by positivity + have hy : 0 ≤ 1600000000*‖horizontalMass 1 zero_lt_one‖ := by positivity + have he : (-1-ε:ℝ) = -(1+ε) := by ring + change (2*Real.pi)⁻¹*(∫ θ in -Real.pi..Real.pi, ‖deriv f (circlePoint r θ)‖^(-2:ℝ)) ≤ _ + calc + _ ≤ (2*Real.pi)⁻¹*((1600000000*‖horizontalMass 1 zero_lt_one‖)*‖transferOperator^(n+1)‖) := + mul_le_mul_of_nonneg_left hb hx + _ ≤ (2*Real.pi)⁻¹*((1600000000*‖horizontalMass 1 zero_lt_one‖)*(K*((2:ℝ)^(1+ε))^(n+1))) := + mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (hKn (n+1)) hy) hx + _ ≤ (2*Real.pi)⁻¹*((1600000000*‖horizontalMass 1 zero_lt_one‖)*(K*((2:ℝ)^(1+ε)*(1-r)^(-(1+ε))))) := + mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hc hK.le) hy) hx + _ = A*(1-r)^(-1-ε) := by rw [he]; dsimp [A]; ring + _ ≤ (A+1)*(1-r)^(-1-ε) := mul_le_mul_of_nonneg_right (by linarith) (Real.rpow_nonneg (by linarith) _) + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/CompactClass.lean b/lean/OAI/Analysis/IntegralMeans/CompactClass.lean new file mode 100644 index 0000000000000000000000000000000000000000..c520e80bd08aa02dde1c7f701f9439cd88f76c17 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/CompactClass.lean @@ -0,0 +1,152 @@ +import OAI.Analysis.IntegralMeans.Distortion + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +instance : LocallyCompactSpace disk := (show IsOpen disk from Metric.isOpen_ball).locallyCompactSpace + +lemma compact_closure_of_disk_bounds (S : Set C(disk,ℂ)) + (hLip : ∀ R : ℝ, R < 1 → ∃ C : ℝ, ∀ g ∈ S, ∀ z w : disk, + ‖(z : ℂ)‖ ≤ R → ‖(w : ℂ)‖ ≤ R → ‖g z-g w‖ ≤ C*‖(z : ℂ)-(w : ℂ)‖) + (hBd : ∀ z : disk, ∃ C : ℝ, ∀ g ∈ S, ‖g z‖ ≤ C) : + IsCompact (closure S) := by + let : T2Space (UniformOnFun disk ℂ {K | IsCompact K}) := + UniformOnFun.t2Space_of_covering (eq_univ_iff_forall.mpr + (fun x => mem_sUnion_of_mem (mem_singleton x) isCompact_singleton)) + have heq : Equicontinuous (fun g : S => fun z : disk => g.1 z) := by + intro z + obtain ⟨R,hzR,hR⟩ := exists_between (show ‖(z : ℂ)‖ < 1 by simpa [disk] using z.2) + obtain ⟨C,hC⟩ := hLip R hR + apply Metric.equicontinuousAt_of_continuity_modulus + (fun w : disk => C*dist (z : ℂ) (w : ℂ)) + · simpa using (tendsto_const_nhds (x := C)).mul + ((tendsto_const_nhds (x := (z : ℂ))).dist (continuous_subtype_val.tendsto z)) + · have hn : ∀ᶠ w : disk in 𝓝 z, ‖(w : ℂ)‖ < R := + (continuous_norm.comp continuous_subtype_val).continuousAt (Iio_mem_nhds hzR) + filter_upwards [hn] with w hw g + simpa [dist_eq_norm] using hC g.1 g.2 z w hzR.le hw.le + apply ArzelaAscoli.isCompact_closure_of_isClosedEmbedding + (F := fun g : C(disk,ℂ) => fun z : disk => g z) + (𝔖 := {K | IsCompact K}) (fun _ h => h) + (ContinuousMap.isUniformEmbedding_toUniformOnFunIsCompact.isClosedEmbedding) + · intro K _ + exact heq.equicontinuousOn K + · intro K _ z _ + obtain ⟨C,hC⟩ := hBd z + exact ⟨Metric.closedBall 0 C,isCompact_closedBall _ _,by simpa using hC⟩ + +def diskExtend (g : C(disk,ℂ)) (z : ℂ) : ℂ := + by classical exact if hz : z ∈ disk then g ⟨z,hz⟩ else 0 + +@[simp] lemma diskExtend_apply (g : C(disk,ℂ)) (z : disk) : diskExtend g z = g z := by + simp [diskExtend,z.2] + +lemma diskExtend_convergence.{u_1} {ι : Type u_1} {l : Filter ι} + {g : ι → C(disk,ℂ)} {f : C(disk,ℂ)} (h : Tendsto g l (𝓝 f)) : + TendstoLocallyUniformlyOn (fun i => diskExtend (g i)) (diskExtend f) l disk := by + rw [tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe] + simpa only [Function.comp_def,diskExtend_apply] using + ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mp h + +def diskSchlichtSet : Set C(disk,ℂ) := {g | Schlicht (diskExtend g)} + +lemma isClosed_diskSchlichtSet : IsClosed diskSchlichtSet := by + rw [isClosed_iff_forall_filter] + intro g l hl hs hg + let := hl + have hS : ∀ᶠ f : C(disk,ℂ) in l, Schlicht (diskExtend f) := + le_principal_iff.mp hs + have hc := diskExtend_convergence (g := id) hg + have hhol : ∀ᶠ f : C(disk,ℂ) in l, DifferentiableOn ℂ (diskExtend f) disk := + hS.mono (fun _ h => h.1.1) + have hgH := hc.differentiableOn hhol (show IsOpen disk from Metric.isOpen_ball) + refine ⟨⟨hgH,?_⟩,?_,?_⟩ + · intro z hz w hw he + by_contra hne + obtain ⟨c,hc0,hs⟩ := schlicht_uniform_separation hz hw hne + have hevent : ∀ᶠ f : C(disk,ℂ) in l, c ≤ ‖diskExtend f w-diskExtend f z‖ := + hS.mono (fun f hf => hs (diskExtend f) hf) + have ht := ((hc.tendsto_at hw).sub (hc.tendsto_at hz)).norm + have hc' := ge_of_tendsto ht hevent + rw [he,sub_self,norm_zero] at hc' + exact not_le_of_gt hc0 hc' + · apply tendsto_nhds_unique (hc.tendsto_at (show (0 : ℂ) ∈ disk by simp [disk])) + exact tendsto_const_nhds.congr' (hS.mono (fun _ hf => hf.2.1.symm)) + · apply tendsto_nhds_unique ((hc.deriv hhol (show IsOpen disk from Metric.isOpen_ball)).tendsto_at + (show (0 : ℂ) ∈ disk by simp [disk])) + exact tendsto_const_nhds.congr' (hS.mono (fun _ hf => hf.2.2.symm)) + +lemma isCompact_diskSchlichtSet : IsCompact diskSchlichtSet := by + rw [← isClosed_diskSchlichtSet.closure_eq] + apply compact_closure_of_disk_bounds + · intro R hR + refine ⟨2/(1-R)^3,?_⟩ + intro g hg z w hz hw + simpa only [diskExtend_apply] using schlicht_lipschitz_bound hg hR hz hw + · intro z + refine ⟨(2/(1-‖(z : ℂ)‖)^3)*‖(z : ℂ)‖,?_⟩ + intro g hg + simpa only [diskExtend_apply] using schlicht_local_bound hg + (show ‖(z : ℂ)‖ < 1 by simpa [disk] using z.2) le_rfl + +def DiskClass := diskSchlichtSet + +instance : TopologicalSpace DiskClass := inferInstanceAs (TopologicalSpace diskSchlichtSet) + +instance : CompactSpace DiskClass := isCompact_iff_compactSpace.mp isCompact_diskSchlichtSet + +lemma differentiableOn_iteratedDeriv_disk {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f disk) + (n : ℕ) : DifferentiableOn ℂ (iteratedDeriv n f) disk := by + induction n with + | zero => simpa using hf + | succ n ih => simpa only [iteratedDeriv_succ] using ih.deriv (show IsOpen disk from Metric.isOpen_ball) + +lemma tendstoLocallyUniformlyOn_iteratedDeriv_disk.{u_1} {ι : Type u_1} {l : Filter ι} + {f : ι → ℂ → ℂ} {g : ℂ → ℂ} (h : TendstoLocallyUniformlyOn f g l disk) + (hf : ∀ᶠ i in l, DifferentiableOn ℂ (f i) disk) (n : ℕ) : + TendstoLocallyUniformlyOn (fun i => iteratedDeriv n (f i)) (iteratedDeriv n g) l disk := by + induction n with + | zero => simpa using h + | succ n ih => + simpa only [iteratedDeriv_succ,Function.comp_def] using ih.deriv + (hf.mono (fun i h => differentiableOn_iteratedDeriv_disk h n)) + (show IsOpen disk from Metric.isOpen_ball) + +def diskClassJet (n : ℕ) (g : DiskClass) : C(disk,ℂ) := + ⟨fun z => iteratedDeriv n (diskExtend g.1) z, + continuousOn_iff_continuous_domRestrict.mp + (differentiableOn_iteratedDeriv_disk g.2.1.1 n).continuousOn⟩ + +lemma continuous_diskClassJet (n : ℕ) : Continuous (diskClassJet n) := by + rw [continuous_iff_continuousAt] + intro g + apply ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mpr + have h := tendstoLocallyUniformlyOn_iteratedDeriv_disk + (diskExtend_convergence (continuous_subtype_val.tendsto g)) + (Eventually.of_forall (fun f : DiskClass => f.2.1.1)) n + exact tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe.mp h + +lemma continuous_diskClassJet_eval (n : ℕ) : + Continuous (fun p : DiskClass × disk => iteratedDeriv n (diskExtend p.1.1) p.2) := + continuous_eval.comp ((continuous_diskClassJet n).prodMap continuous_id) + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/CriticalCount.lean b/lean/OAI/Analysis/IntegralMeans/CriticalCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..5203a76cb3743c7d1485cbd66cb095aaf7cb0b2e --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/CriticalCount.lean @@ -0,0 +1,531 @@ +import OAI.Analysis.IntegralMeans.LevelIndex + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +def squaredReciprocalPotential (f : ℂ → ℂ) (k : ℝ) (ξ z : ℂ) : ℝ := + ‖f z-ξ‖^2 * z.im^(-2*k) + +lemma squaredReciprocalPotential_eq_sq {f : ℂ → ℂ} {k : ℝ} {ξ z : ℂ} + (hz : z ∈ halfPlane) : + squaredReciprocalPotential f k ξ z = (reciprocalPotential f k ξ z)^2 := by + rw [squaredReciprocalPotential,reciprocalPotential,div_pow] + have he : z.im^(-2*k) = ((z.im^k)^2)⁻¹ := by + rw [show -2*k = -(k*2) by ring, Real.rpow_neg hz.le, Real.rpow_mul hz.le, + Real.rpow_two] + rw [he,div_eq_mul_inv] + +lemma squaredReciprocalPotential_nonneg {f : ℂ → ℂ} {k : ℝ} {ξ z : ℂ} + (hz : z ∈ halfPlane) : 0 ≤ squaredReciprocalPotential f k ξ z := by + rw [squaredReciprocalPotential_eq_sq hz] + exact sq_nonneg _ + +lemma contDiffAt_squaredReciprocalPotential {f : ℂ → ℂ} + (hf : UnivalentOn f halfPlane) {z : ℂ} (hz : z ∈ halfPlane) (k : ℝ) (ξ : ℂ) : + ContDiffAt ℝ 2 (squaredReciprocalPotential f k ξ) z := by + have hc : ContDiffAt ℝ 2 f z := + (hf.1.analyticOnNhd isOpen_halfPlane z hz).contDiffAt.restrict_scalars ℝ + exact ((hc.sub contDiffAt_const).norm_sq ℂ).mul + (Complex.imCLM.contDiff.contDiffAt.rpow_const_of_ne (ne_of_gt hz)) + +lemma potential_ge_iff_reciprocalPotential_le {f : ℂ → ℂ} {k h : ℝ} + (hk : 0 ≤ k) (hh : 0 < h) {ξ z : ℂ} (hz : z ∈ halfPlane) : + ENNReal.ofReal h ≤ potential f k ξ z ↔ reciprocalPotential f k ξ z ≤ h⁻¹ := by + have hy := Real.rpow_pos_of_pos hz k + rw [potential,ENNReal.ofReal_rpow_of_nonneg hz.le hk, + ENNReal.le_div_iff_mul_le + (Or.inr (ne_of_gt (ENNReal.ofReal_pos.mpr hy))) (Or.inl ENNReal.ofReal_ne_top), + ← ENNReal.ofReal_mul hh.le,ENNReal.ofReal_le_ofReal_iff hy.le,reciprocalPotential, + div_le_iff₀ hy,inv_mul_eq_div,le_div_iff₀ hh] + exact mul_comm h ‖f z-ξ‖ ▸ Iff.rfl + +lemma compact_squaredReciprocal_sublevel {f : ℂ → ℂ} {k : ℝ} (hk : 0 ≤ k) + {ξ : ℂ} (hg : GoodPair f k ξ) {d : ℝ} (hd : 0 < d) : + IsCompact {z | z ∈ halfPlane ∧ squaredReciprocalPotential f k ξ z ≤ d} := by + have hs : 0 < Real.sqrt d := Real.sqrt_pos.mpr hd + have he : {z | z ∈ halfPlane ∧ squaredReciprocalPotential f k ξ z ≤ d} = + {z | z ∈ halfPlane ∧ ENNReal.ofReal ((Real.sqrt d)⁻¹) ≤ potential f k ξ z} := by + ext z + constructor + · rintro ⟨hz,hzval⟩ + refine ⟨hz,(potential_ge_iff_reciprocalPotential_le hk (inv_pos.mpr hs) hz).mpr ?_⟩ + rw [inv_inv] + rw [squaredReciprocalPotential_eq_sq hz] at hzval + nlinarith [Real.sq_sqrt hd.le] + · rintro ⟨hz,hzval⟩ + have hv := (potential_ge_iff_reciprocalPotential_le hk (inv_pos.mpr hs) hz).mp hzval + rw [inv_inv] at hv + refine ⟨hz,?_⟩ + rw [squaredReciprocalPotential_eq_sq hz] + have hn : 0 ≤ reciprocalPotential f k ξ z := div_nonneg (norm_nonneg _) (Real.rpow_nonneg hz.le _) + nlinarith [Real.sq_sqrt hd.le] + rw [he] + exact hg.1 _ (inv_pos.mpr hs) + +lemma regularizedGradient_formula {f : ℂ → ℂ} {k : ℝ} (hk : k ≠ 0) + {ξ z : ℂ} (hz : z ∈ halfPlane) : + regularizedGradient f k ξ z = + ((k : ℂ)*Complex.I/(z.im : ℂ))*((‖f z-ξ‖^2 : ℝ) : ℂ) - + (f z-ξ)*conj (deriv f z) := by + have hy : (z.im : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + have hkc : (k : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hk + have he : conj (criticalMap f k z-ξ) = conj (f z-ξ) + + Complex.I/(k : ℂ)*(z.im : ℂ)*conj (deriv f z) := by + simp only [criticalMap, div_eq_mul_inv, map_sub, map_mul, map_inv₀, Complex.conj_I, Complex.conj_ofReal] + ring + rw [regularizedGradient,he,mul_add, mul_assoc _ (f z-ξ),Complex.mul_conj', + ← Complex.ofReal_pow] + field_simp + ring_nf + simp only [Complex.I_sq] + ring + +lemma fderiv_squaredReciprocalPotential_apply {f : ℂ → ℂ} + (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : k ≠ 0) + {ξ z : ℂ} (hz : z ∈ halfPlane) (v : ℂ) : + fderiv ℝ (squaredReciprocalPotential f k ξ) z v = + -2*z.im^(-2*k)*(regularizedGradient f k ξ z * conj v).re := by + have hd := (((hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz)).hasDerivAt.sub_const ξ).hasFDerivAt.restrictScalars ℝ + have hy := Complex.imCLM.hasFDerivAt.rpow_const (p := -2*k) (Or.inl (ne_of_gt hz)) + have hu := hd.norm_sq.fun_mul hy + simp only [Complex.imCLM_apply] at hu + change (fderiv ℝ (fun w => ‖f w - ξ‖ ^ 2 * w.im ^ (-2*k)) z) v = _ + rw [hu.fderiv] + simp only [smul_apply,add_apply,ContinuousLinearMap.comp_apply, + ContinuousLinearMap.coe_restrictScalars',ContinuousLinearMap.toSpanSingleton_apply, + smul_eq_mul,innerSL_apply_apply,Complex.imCLM_apply] + rw [regularizedGradient_formula hk hz,Real.rpow_sub hz,Real.rpow_one] + simp only [Complex.inner,Complex.mul_re,Complex.mul_im,Complex.conj_re,Complex.conj_im, + Complex.sub_re,Complex.sub_im,Complex.div_re,Complex.div_im,Complex.ofReal_re, + Complex.ofReal_im,Complex.I_re,Complex.I_im,Complex.normSq_ofReal] + field_simp [ne_of_gt (show 0 < z.im from hz)] + ring + +lemma fderiv_squaredReciprocalPotential_eq_zero_iff {f : ℂ → ℂ} + (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : k ≠ 0) + {ξ z : ℂ} (hz : z ∈ halfPlane) : + fderiv ℝ (squaredReciprocalPotential f k ξ) z = 0 ↔ + regularizedGradient f k ξ z = 0 := by + constructor + · intro hzero + have hh := fderiv_squaredReciprocalPotential_apply hf hk (ξ := ξ) hz + (regularizedGradient f k ξ z) + rw [hzero, zero_apply, Complex.mul_conj', ← Complex.ofReal_pow, Complex.ofReal_re] at hh + have hp := Real.rpow_pos_of_pos hz (-2*k) + have hn := norm_nonneg (regularizedGradient f k ξ z) + apply norm_eq_zero.mp + have hsq : ‖regularizedGradient f k ξ z‖^2 = 0 := + (mul_eq_zero.mp hh.symm).resolve_left (mul_ne_zero (by norm_num) (ne_of_gt hp)) + nlinarith + · intro hzero + ext v + rw [fderiv_squaredReciprocalPotential_apply hf hk hz v, hzero] + simp + +lemma det_regularizedGradient_ne_zero {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : k ≠ 0) {ξ : ℂ} (hg : GoodPair f k ξ) + {z : ℂ} (hz : z ∈ halfPlane) (hzero : regularizedGradient f k ξ z = 0) : + LinearMap.det (fderiv ℝ (regularizedGradient f k ξ) z).toLinearMap ≠ 0 := by + rcases (regularizedGradient_eq_zero_iff hk hz).mp hzero with hp | hc + · exact ne_of_gt (det_regularizedGradient_at_pole_pos hf hk hz hp) + · rw [det_regularizedGradient_at_critical hf hz hc] + apply mul_ne_zero + · apply mul_ne_zero + · exact neg_ne_zero.mpr (pow_ne_zero 2 (norm_ne_zero_iff.mpr + (mul_ne_zero (div_ne_zero (mul_ne_zero (Complex.ofReal_ne_zero.mpr hk) + Complex.I_ne_zero) (Complex.ofReal_ne_zero.mpr (ne_of_gt hz))) + (sub_ne_zero.mpr (criticalMap_ne_pole hf hk hz hc))))) + · exact pow_ne_zero 2 (norm_ne_zero_iff.mpr + (univalent_deriv_ne_zero isOpen_halfPlane hf hz)) + · exact hg.2 z hz hc + +lemma compact_convex_halfPlane_envelope {P : Set ℂ} (hP : IsCompact P) + (hPH : P ⊆ halfPlane) : + ∃ K : Set ℂ, IsCompact K ∧ Convex ℝ K ∧ P ⊆ K ∧ K ⊆ halfPlane := by + obtain ⟨η,hη,hheight⟩ := hP.exists_forall_le' Complex.continuous_im.continuousOn hPH + obtain ⟨R,hR⟩ := hP.isBounded.subset_closedBall (0 : ℂ) + refine ⟨Metric.closedBall 0 R ∩ {z : ℂ | η ≤ z.im}, + (isCompact_closedBall 0 R).inter_right (isClosed_le continuous_const Complex.continuous_im), + (convex_closedBall (0 : ℂ) R).inter (convex_halfSpace_im_ge η),?_,?_⟩ + · exact fun z hz => ⟨hR hz,hheight z hz⟩ + · exact fun z hz => hη.trans_le hz.2 + +lemma continuous_extension_near_compact {K U : Set ℂ} (hK : IsCompact K) + (hU : IsOpen U) (hKU : K ⊆ U) {x : ℂ → ℂ} + (hx : ∀ z ∈ U, ContinuousAt x z) : + ∃ X : C(ℂ,ℂ), ∀ z ∈ K, (X : ℂ → ℂ) =ᶠ[𝓝 z] x := by + obtain ⟨χ,hχc,_hχK,hχU,hχ1,_hχrange⟩ := exists_smooth_cutoff hK hU hKU + let X := fun z => (χ z : ℂ)*x z + have hX : Continuous X := by + rw [continuous_iff_continuousAt] + intro z + by_cases hz : z ∈ tsupport χ + · exact (Complex.continuous_ofReal.continuousAt.comp hχc.continuous.continuousAt).mul + (hx z (hχU hz)) + · have he : X =ᶠ[𝓝 z] fun _ => 0 := by + filter_upwards [isClosed_tsupport χ |>.isOpen_compl.mem_nhds hz] with w hw + have hzero : χ w = 0 := notMem_support.mp (fun h => hw (subset_tsupport χ h)) + simp only [X,hzero,Complex.ofReal_zero,zero_mul] + exact continuousAt_const.congr he.symm + refine ⟨⟨X,hX⟩,?_⟩ + intro z hz + filter_upwards [hχ1 z hz] with w hw + simp only [ContinuousMap.coe_mk,X,hw,Complex.ofReal_one,one_mul] + +lemma squaredReciprocalPotential_lt_windingInterior {f : ℂ → ℂ} + (hf : UnivalentOn f halfPlane) {k c : ℝ} (hk : 0 < k) (hc : 0 < c) (ξ : ℂ) + (γ : C(unitInterval,ℂ)) (hloop : γ 1 = γ 0) (hγ : ∀ t, γ t ∈ halfPlane) + (hlevel : ∀ t, squaredReciprocalPotential f k ξ (γ t) = c) + {z : ℂ} (hz : z ∈ windingInterior γ) : + z ∈ halfPlane ∧ squaredReciprocalPotential f k ξ z < c := by + have hzH := closure_windingInterior_subset_halfPlane γ hloop hγ (subset_closure hz) + have hb : 0 < Real.sqrt c := Real.sqrt_pos.mpr hc + have hl (t) : reciprocalPotential f k ξ (γ t) = Real.sqrt c := by + have hsq := hlevel t + rw [squaredReciprocalPotential_eq_sq (hγ t)] at hsq + have hn : 0 ≤ reciprocalPotential f k ξ (γ t) := + div_nonneg (norm_nonneg _) (Real.rpow_nonneg (hγ t).le _) + nlinarith [Real.sq_sqrt hc.le] + have hh := reciprocalPotential_lt_on_windingInterior hf hk hb ξ γ hloop hγ hl hz + have hn : 0 ≤ reciprocalPotential f k ξ z := + div_nonneg (norm_nonneg _) (Real.rpow_nonneg hzH.le _) + refine ⟨hzH,?_⟩ + rw [squaredReciprocalPotential_eq_sq hzH] + nlinarith [Real.sq_sqrt hc.le] + +lemma regular_potential_level_index_sum {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : 0 < k) {ξ : ℂ} (hg : GoodPair f k ξ) {c : ℝ} (hc : 0 < c) + (hreg : ∀ z ∈ halfPlane, squaredReciprocalPotential f k ξ z = c → + regularizedGradient f k ξ z ≠ 0) : + ∃ (s : Finset ℂ) (N : ℕ), + (∀ z ∈ s, z ∈ halfPlane ∧ regularizedGradient f k ξ z = 0) ∧ + (∀ z ∈ halfPlane, squaredReciprocalPotential f k ξ z < c → + (z ∈ s ↔ regularizedGradient f k ξ z = 0)) ∧ + (∑ z ∈ s, if squaredReciprocalPotential f k ξ z < c then + planeIndex (fderiv ℝ (regularizedGradient f k ξ) z) else 0) = (N : ℤ) ∧ + ((∃ z ∈ halfPlane, f z = ξ) → 1 ≤ N) := by + classical + let u := squaredReciprocalPotential f k ξ + let x := regularizedGradient f k ξ + let d := c+1 + have hcd : c < d := by dsimp [d]; linarith + have hd : 0 < d := hc.trans hcd + have hP := compact_squaredReciprocal_sublevel hk.le hg hd + obtain ⟨K,hK,hKcv,hPK,hKH⟩ := compact_convex_halfPlane_envelope hP (fun _ h => h.1) + obtain ⟨F,hFc,hFs,hFeq,hFout,hFle,hFlt⟩ := extend_compact_sublevel isOpen_halfPlane + (fun z hz => contDiffAt_squaredReciprocalPotential hf hz k ξ) hP + have hlevel (z) (hz : F z = c) : z ∈ halfPlane ∧ u z = c := by + have hh := (hFle z c hcd).mp hz.le + exact ⟨hh.1, ((hFeq z hh.1 (hh.2.trans hcd.le)).self_of_nhds).symm.trans hz⟩ + have hFreg (z) (hz : F z = c) : fderiv ℝ F z ≠ 0 := by + obtain ⟨hzH,huz⟩ := hlevel z hz + rw [(hFeq z hzH (huz.le.trans hcd.le)).fderiv_eq] + exact fun hh => hreg z hzH huz ((fderiv_squaredReciprocalPotential_eq_zero_iff + hf (ne_of_gt hk) hzH).mp hh) + have hL : IsCompact {z | F z = c} := hP.of_isClosed_subset + (isClosed_eq hFc.continuous continuous_const) + (fun z hz => ⟨(hlevel z hz).1, (hlevel z hz).2.le.trans hcd.le⟩) + obtain ⟨C,hC,hdis,hcurves⟩ := compact_regular_level_oriented_curves hFc hFs hFreg hL + let ι := {S : Set ℂ // S ∈ C} + choose γ hγrange hγc hγp hγi hγd hγm hγr hγdown using + (fun S : ι => hcurves S.1 S.2) + have hγlevel (i : ι) (t : ℝ) : F (γ i t) = c := by + have hh : γ i t ∈ ⋃ S ∈ C, S := mem_iUnion₂.mpr + ⟨i.1,i.2,hγrange i ▸ mem_range_self t⟩ + rwa [hC] at hh + have hγH (i : ι) (t : ℝ) : γ i t ∈ halfPlane := (hlevel _ (hγlevel i t)).1 + have hγu (i : ι) (t : ℝ) : u (γ i t) = c := (hlevel _ (hγlevel i t)).2 + have hcover (z) : F z = c ↔ ∃ i : ι, z ∈ range (γ i) := by + constructor + · intro hz + have hm : z ∈ ⋃ S ∈ C, S := hC.symm ▸ hz + obtain ⟨S,hS,hzS⟩ := mem_iUnion₂.mp hm + exact ⟨⟨S,hS⟩, (hγrange ⟨S,hS⟩).symm ▸ hzS⟩ + · rintro ⟨i,t,rfl⟩ + exact hγlevel i t + have hγdis (i j : ι) (hij : i ≠ j) : Disjoint (range (γ i)) (range (γ j)) := by + rw [hγrange,hγrange] + exact hdis i.1 i.2 j.1 j.2 (Subtype.val_injective.ne hij) + have hbelow (i : ι) (w : ℂ) (hw : w ∉ range (γ i)) + (hind : loopIndex (periodicLoop (hγc i).continuous 0) w ≠ 0) : F w < c := by + have hw' : w ∈ windingInterior (periodicLoop (hγc i).continuous 0) := + ⟨by rwa [periodicLoop_range _ (hγp i) 0],hind⟩ + have hh := squaredReciprocalPotential_lt_windingInterior hf hk hc ξ + (periodicLoop (hγc i).continuous 0) (periodicLoop_closed _ (hγp i) 0) + (fun t => hγH i ((t:ℝ)+0)) (fun t => hγu i ((t:ℝ)+0)) hw' + exact (hFlt w c hcd).mpr hh + have hFzero : F 0 = d := hFout 0 (by simp [halfPlane]) + have habove : ∃ z, c < F z := ⟨0,hFzero ▸ hcd⟩ + obtain ⟨X,hXeq⟩ := continuous_extension_near_compact hK isOpen_halfPlane hKH + (fun z hz => (differentiableAt_regularizedGradient hf hz k ξ).continuousAt) + have hfinite : {z | z ∈ K ∧ x z = 0}.Finite := finite_regular_zeros_on_compact hK + (fun z hz => (differentiableAt_regularizedGradient hf (hKH hz) k ξ).continuousAt.continuousWithinAt) + (fun z hz hzero => ⟨differentiableAt_regularizedGradient hf (hKH hz) k ξ, + det_regularizedGradient_ne_zero hf (ne_of_gt hk) hg (hKH hz) hzero⟩) + let s := hfinite.toFinset + have hs (z) : z ∈ s ↔ z ∈ K ∧ x z = 0 := hfinite.mem_toFinset + have hsK (z) (hz : z ∈ s) : z ∈ K := ((hs z).mp hz).1 + have hXzero (z) (hz : z ∈ K) : X z = 0 ↔ z ∈ s := by + rw [(hXeq z hz).self_of_nhds,hs] + exact ⟨fun h => ⟨hz,h⟩,fun h => h.2⟩ + have hD (z) (hz : z ∈ s) : + HasFDerivAt X (fderiv ℝ x z) z ∧ LinearMap.det (fderiv ℝ x z).toLinearMap ≠ 0 := by + refine ⟨(differentiableAt_regularizedGradient hf (hKH (hsK z hz)) k ξ).hasFDerivAt.congr_of_eventuallyEq + (hXeq z (hsK z hz)),?_⟩ + exact det_regularizedGradient_ne_zero hf (ne_of_gt hk) hg (hKH (hsK z hz)) ((hs z).mp hz).2 + have hγK (i : ι) (t : ℝ) : γ i t ∈ K := hPK ⟨hγH i t,(hγu i t).le.trans hcd.le⟩ + have hX (i : ι) (t : ℝ) : X (γ i t) ≠ 0 := by + rw [(hXeq _ (hγK i t)).self_of_nhds] + exact hreg _ (hγH i t) (hγu i t) + have horth (i : ι) (t : ℝ) : (X (γ i t)*conj (deriv (γ i) t)).re = 0 := by + have he : HasDerivAt (fun q => F (γ i q)) + (fderiv ℝ F (γ i t) (deriv (γ i) t)) t := + ((hFc.differentiable (by norm_num)) _).hasFDerivAt.comp_hasDerivAt t + (((hγc i).differentiable (by norm_num)) t).hasDerivAt + have he0 : fderiv ℝ F (γ i t) (deriv (γ i) t) = 0 := + (he.congr_of_eventuallyEq (Filter.Eventually.of_forall (fun q => (hγlevel i q).symm))).unique (hasDerivAt_const t c) + rw [(hFeq _ (hγH i t) ((hγu i t).le.trans hcd.le)).fderiv_eq, + fderiv_squaredReciprocalPotential_apply hf (ne_of_gt hk) (hγH i t)] at he0 + rw [(hXeq _ (hγK i t)).self_of_nhds] + exact (mul_eq_zero.mp he0).resolve_left (mul_ne_zero (by norm_num) + (ne_of_gt (Real.rpow_pos_of_pos (hγH i t) (-2*k)))) + have hsum := regular_level_index_sum hFc.continuous γ hγc hγp hγi hγd hγm hγr hγdown + hγlevel (fun z hz => ⟨hFc.contDiffAt.of_le (by norm_num),hFreg z hz⟩) + hcover hγdis hbelow habove hKcv hγK s X (fderiv ℝ x) hsK hXzero hD hX horth + refine ⟨s,Fintype.card ι,?_,?_,?_,?_⟩ + · intro z hz + exact ⟨hKH (hsK z hz),((hs z).mp hz).2⟩ + · intro z hzH hzu + rw [hs] + exact ⟨fun h => h.2,fun hx => ⟨hPK ⟨hzH,hzu.le.trans hcd.le⟩,hx⟩⟩ + · convert hsum using 1 + apply Finset.sum_congr rfl + intro z hz + simp only [show (F z < c) ↔ u z < c from (hFlt z c hcd).trans + (and_iff_right (hKH (hsK z hz)))] + rfl + · rintro ⟨z,hzH,hpole⟩ + have huz : u z = 0 := by simp [u,squaredReciprocalPotential,hpole] + have hFz : F z = 0 := (hFeq z hzH (huz.le.trans hd.le)).self_of_nhds.trans huz + obtain ⟨w,hw⟩ := intermediate_value_univ z 0 hFc.continuous + (show c ∈ Icc (F z) (F 0) by rw [hFz,hFzero]; exact ⟨hc.le,hcd.le⟩) + obtain ⟨i,_hi⟩ := (hcover w).mp hw + exact Nat.succ_le_iff.mpr (Fintype.card_pos_iff.mpr ⟨i⟩) + +lemma planeIndex_regularizedGradient_at_critical {f : ℂ → ℂ} + (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : k ≠ 0) + {ξ z : ℂ} (hz : z ∈ halfPlane) (hcrit : criticalMap f k z = ξ) : + planeIndex (fderiv ℝ (regularizedGradient f k ξ) z) = + if normalizedJacobian f k z < 0 then 1 else -1 := by + have hp : 0 < ‖((k : ℂ)*Complex.I/(z.im : ℂ))*(f z-ξ)‖^2 * ‖deriv f z‖^2 := by + apply mul_pos + · apply sq_pos_of_pos + apply norm_pos_iff.mpr + exact mul_ne_zero (div_ne_zero (mul_ne_zero (Complex.ofReal_ne_zero.mpr hk) + Complex.I_ne_zero) (Complex.ofReal_ne_zero.mpr (ne_of_gt hz))) + (sub_ne_zero.mpr (criticalMap_ne_pole hf hk hz hcrit)) + · exact sq_pos_of_pos (norm_pos_iff.mpr (univalent_deriv_ne_zero isOpen_halfPlane hf hz)) + rw [planeIndex,det_regularizedGradient_at_critical hf hz hcrit] + congr 1 + apply propext + rw [neg_mul,neg_mul,neg_pos] + constructor + · intro h + by_contra hn + exact (not_lt_of_ge (mul_nonneg hp.le (le_of_not_gt hn))) h + · exact mul_neg_of_pos_of_neg hp + +lemma critical_count_strict_sublevel {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : 0 < k) {ξ : ℂ} (hg : GoodPair f k ξ) {c : ℝ} (hc : 0 < c) + (hreg : ∀ z ∈ halfPlane, squaredReciprocalPotential f k ξ z = c → + regularizedGradient f k ξ z ≠ 0) : + let critical := {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ + squaredReciprocalPotential f k ξ z < c} + critical.Finite ∧ ({z ∈ critical | 0 < normalizedJacobian f k z}).ncard ≤ + ({z ∈ critical | normalizedJacobian f k z < 0}).ncard := by + classical + dsimp only + obtain ⟨s,N,hs,hsall,hsum,hpole⟩ := regular_potential_level_index_sum hf hk hg hc hreg + let u := squaredReciprocalPotential f k ξ + let p := s.filter (fun z => u z < c ∧ f z = ξ) + let m := s.filter (fun z => u z < c ∧ criticalMap f k z = ξ ∧ normalizedJacobian f k z < 0) + let a := s.filter (fun z => u z < c ∧ criticalMap f k z = ξ ∧ 0 < normalizedJacobian f k z) + have hcritmem (z) (hz : z ∈ halfPlane) (hG : criticalMap f k z = ξ) (hu : u z < c) : z ∈ s := + (hsall z hz hu).mpr ((regularizedGradient_eq_zero_iff (ne_of_gt hk) hz).mpr (Or.inr hG)) + have hfinite : {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ u z < c}.Finite := + s.finite_toSet.subset (fun z hz => hcritmem z hz.1 hz.2.1 hz.2.2) + have hmset : {z | (z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ u z < c) ∧ + normalizedJacobian f k z < 0} = (m : Set ℂ) := by + ext z + simp only [m,Finset.mem_coe,Finset.mem_filter,mem_ofPred_eq] + constructor + · rintro ⟨⟨hz,hG,hu⟩,hJ⟩ + exact ⟨hcritmem z hz hG hu,hu,hG,hJ⟩ + · rintro ⟨hz,hu,hG,hJ⟩ + exact ⟨⟨(hs z hz).1,hG,hu⟩,hJ⟩ + have haset : {z | (z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ u z < c) ∧ + 0 < normalizedJacobian f k z} = (a : Set ℂ) := by + ext z + simp only [a,Finset.mem_coe,Finset.mem_filter,mem_ofPred_eq] + constructor + · rintro ⟨⟨hz,hG,hu⟩,hJ⟩ + exact ⟨hcritmem z hz hG hu,hu,hG,hJ⟩ + · rintro ⟨hz,hu,hG,hJ⟩ + exact ⟨⟨(hs z hz).1,hG,hu⟩,hJ⟩ + have hpcard : p.card ≤ 1 := by + apply Finset.card_le_one.mpr + intro z hz w hw + obtain ⟨hz,huz,hpz⟩ := Finset.mem_filter.mp hz + obtain ⟨hw,huw,hpw⟩ := Finset.mem_filter.mp hw + exact hf.2 (hs z hz).1 (hs w hw).1 (hpz.trans hpw.symm) + have hpN : p.card ≤ N := by + by_cases hpe : p = ∅ + · simp [hpe] + · obtain ⟨z,hz⟩ := Finset.nonempty_iff_ne_empty.mpr hpe + obtain ⟨hz,huz,hpz⟩ := Finset.mem_filter.mp hz + exact hpcard.trans (hpole ⟨z,(hs z hz).1,hpz⟩) + have hterm (z) (hz : z ∈ s) : + (if u z < c then planeIndex (fderiv ℝ (regularizedGradient f k ξ) z) else 0) = + (if u z < c ∧ f z = ξ then (1 : ℤ) else 0) + + (if u z < c ∧ criticalMap f k z = ξ ∧ normalizedJacobian f k z < 0 then 1 else 0) - + (if u z < c ∧ criticalMap f k z = ξ ∧ 0 < normalizedJacobian f k z then 1 else 0) := by + by_cases hu : u z < c + · simp only [hu,true_and,ite_true] + rcases (regularizedGradient_eq_zero_iff (ne_of_gt hk) (hs z hz).1).mp (hs z hz).2 with hpz | hG + · have hGn : criticalMap f k z ≠ ξ := fun h => criticalMap_ne_pole hf (ne_of_gt hk) (hs z hz).1 h hpz + simp [hpz,hGn,planeIndex,det_regularizedGradient_at_pole_pos hf (ne_of_gt hk) (hs z hz).1 hpz] + · have hpn := criticalMap_ne_pole hf (ne_of_gt hk) (hs z hz).1 hG + rw [planeIndex_regularizedGradient_at_critical hf (ne_of_gt hk) (hs z hz).1 hG] + rcases lt_or_gt_of_ne (hg.2 z (hs z hz).1 hG) with hJ | hJ + · simp [hpn,hG,hJ,not_lt_of_ge hJ.le] + · simp [hpn,hG,hJ,not_lt_of_ge hJ.le] + · simp [hu] + have heuler : (p.card : ℤ) + m.card - a.card = N := by + rw [← hsum] + calc + (p.card : ℤ) + m.card - a.card = + ∑ z ∈ s, ((if u z < c ∧ f z = ξ then (1 : ℤ) else 0) + + (if u z < c ∧ criticalMap f k z = ξ ∧ normalizedJacobian f k z < 0 then 1 else 0) - + (if u z < c ∧ criticalMap f k z = ξ ∧ 0 < normalizedJacobian f k z then 1 else 0)) := by + simp only [Finset.sum_sub_distrib,Finset.sum_add_distrib,Finset.sum_boole,p,m,a] + _ = _ := Finset.sum_congr rfl (fun z hz => (hterm z hz).symm) + refine ⟨hfinite,?_⟩ + change ({z | (z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ u z < c) ∧ + 0 < normalizedJacobian f k z}).ncard ≤ + ({z | (z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ u z < c) ∧ + normalizedJacobian f k z < 0}).ncard + rw [haset,hmset,Set.ncard_coe_finset,Set.ncard_coe_finset] + omega + +lemma finite_critical_squared_sublevel {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : 0 ≤ k) {ξ : ℂ} (hg : GoodPair f k ξ) {d : ℝ} (hd : 0 < d) : + {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ + squaredReciprocalPotential f k ξ z ≤ d}.Finite := by + have hs : 0 < Real.sqrt d := Real.sqrt_pos.mpr hd + apply (finite_critical_superlevel hf hg (h := (Real.sqrt d)⁻¹) (inv_pos.mpr hs)).subset + intro z hz + refine ⟨hz.1,hz.2.1,(potential_ge_iff_reciprocalPotential_le hk (inv_pos.mpr hs) hz.1).mpr ?_⟩ + rw [inv_inv] + have hh := hz.2.2 + rw [squaredReciprocalPotential_eq_sq hz.1] at hh + nlinarith [Real.sq_sqrt hd.le] + +lemma potential_ge_iff_squaredReciprocal_le {f : ℂ → ℂ} {k h : ℝ} + (hk : 0 ≤ k) (hh : 0 < h) {ξ z : ℂ} (hz : z ∈ halfPlane) : + ENNReal.ofReal h ≤ potential f k ξ z ↔ + squaredReciprocalPotential f k ξ z ≤ (h⁻¹)^2 := by + rw [potential_ge_iff_reciprocalPotential_le hk hh hz,squaredReciprocalPotential_eq_sq hz] + exact (sq_le_sq₀ (div_nonneg (norm_nonneg _) (Real.rpow_nonneg hz.le _)) + (inv_nonneg.mpr hh.le)).symm + +lemma finset_gap_above (s : Finset ℝ) (r d : ℝ) (hrd : r < d) : + ∃ c, r < c ∧ c < d ∧ ∀ a ∈ s, r < a → c < a := by + classical + induction s using Finset.induction_on generalizing d with + | empty => + obtain ⟨c,hrc,hcd⟩ := exists_between hrd + exact ⟨c,hrc,hcd,by simp⟩ + | @insert a s ha ih => + by_cases hra : r < a + · obtain ⟨c,hrc,hcd,hcs⟩ := ih (min d a) (lt_min hrd hra) + refine ⟨c,hrc,hcd.trans_le (min_le_left _ _),?_⟩ + intro b hb hrb + rcases Finset.mem_insert.mp hb with rfl | hb + · exact hcd.trans_le (min_le_right _ _) + · exact hcs b hb hrb + · obtain ⟨c,hrc,hcd,hcs⟩ := ih d hrd + refine ⟨c,hrc,hcd,?_⟩ + intro b hb hrb + rcases Finset.mem_insert.mp hb with rfl | hb + · exact (hra hrb).elim + · exact hcs b hb hrb + +theorem critical_count {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : 0 < k) {ξ : ℂ} (hg : GoodPair f k ξ) {h : ℝ} (hh : 0 < h) : + let critical := {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ + ENNReal.ofReal h ≤ potential f k ξ z} + critical.Finite ∧ ({z ∈ critical | 0 < normalizedJacobian f k z}).ncard ≤ + ({z ∈ critical | normalizedJacobian f k z < 0}).ncard := by + classical + let u := squaredReciprocalPotential f k ξ + let r := (h⁻¹)^2 + have hr : 0 < r := sq_pos_of_pos (inv_pos.mpr hh) + have hd : 0 < r+1 := by linarith + have hfinite := finite_critical_squared_sublevel hf hk.le hg hd + let s := hfinite.toFinset.image u + obtain ⟨c,hrc,hcd,hcs⟩ := finset_gap_above s r (r+1) (by linarith) + have hcmem (z) (hz : z ∈ halfPlane) (hG : criticalMap f k z = ξ) + (hu : u z ≤ r+1) : u z ∈ s := + Finset.mem_image.mpr ⟨z,hfinite.mem_toFinset.mpr ⟨hz,hG,hu⟩,rfl⟩ + have hcut (z) (hz : z ∈ halfPlane) (hG : criticalMap f k z = ξ) : u z < c ↔ u z ≤ r := by + constructor + · intro huc + by_contra hn + have hru : r < u z := lt_of_not_ge hn + exact (hcs (u z) (hcmem z hz hG (huc.trans hcd).le) hru).not_gt huc + · exact fun h => h.trans_lt hrc + have hreg (z) (hz : z ∈ halfPlane) (huc : u z = c) : regularizedGradient f k ξ z ≠ 0 := by + intro hzero + rcases (regularizedGradient_eq_zero_iff (ne_of_gt hk) hz).mp hzero with hp | hG + · have huz : u z = 0 := by simp [u,squaredReciprocalPotential,hp] + linarith + · have hmem := hcmem z hz hG (huc.le.trans hcd.le) + have hcc := hcs (u z) hmem (hrc.trans_eq huc.symm) + linarith + have hc := critical_count_strict_sublevel hf hk hg (hr.trans hrc) hreg + have he : {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ ENNReal.ofReal h ≤ potential f k ξ z} = + {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ u z < c} := by + ext z + constructor + · rintro ⟨hz,hG,hV⟩ + exact ⟨hz,hG,(hcut z hz hG).mpr ((potential_ge_iff_squaredReciprocal_le hk.le hh hz).mp hV)⟩ + · rintro ⟨hz,hG,hu⟩ + exact ⟨hz,hG,(potential_ge_iff_squaredReciprocal_le hk.le hh hz).mpr ((hcut z hz hG).mp hu)⟩ + dsimp only + rw [he] + exact hc + +theorem criticalCountStatement_proved : CriticalCountStatement := by + intro f hf k hk ξ hg h hh + exact critical_count hf (lt_trans zero_lt_one hk) hg hh + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/CriticalMap.lean b/lean/OAI/Analysis/IntegralMeans/CriticalMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..df236a544d4ec87c23a647573237f8d820dc0204 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/CriticalMap.lean @@ -0,0 +1,520 @@ +import OAI.Analysis.IntegralMeans.HalfPlane + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +def logarithmicJet (f : ℂ → ℂ) (z : ℂ) : ℂ := + Complex.I * (z.im : ℂ) * deriv (reciprocalDeriv f) z / reciprocalDeriv f z + +lemma logarithmicJet_eq {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z : ℂ} (hz : z ∈ halfPlane) : + logarithmicJet f z = -Complex.I * (z.im : ℂ) * deriv (deriv f) z / deriv f z := by + have han : AnalyticAt ℂ f z := hf.1.analyticOnNhd isOpen_halfPlane z hz + have hd : deriv f z ≠ 0 := univalent_deriv_ne_zero isOpen_halfPlane hf hz + have hq : deriv (reciprocalDeriv f) z = -deriv (deriv f) z / (deriv f z)^2 := + (han.deriv.differentiableAt.hasDerivAt.inv hd).deriv + rw [logarithmicJet, hq, reciprocalDeriv] + field_simp + +def criticalMap (f : ℂ → ℂ) (k : ℝ) (z : ℂ) : ℂ := + f z - Complex.I / (k : ℂ) * (z.im : ℂ) * deriv f z + +def normalizedJacobian (f : ℂ → ℂ) (k : ℝ) (z : ℂ) : ℝ := + LinearMap.det (fderiv ℝ (criticalMap f k) z).toLinearMap / ‖deriv f z‖^2 + +lemma fderiv_criticalMap_apply {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z : ℂ} (hz : z ∈ halfPlane) (k : ℝ) (v : ℂ) : + fderiv ℝ (criticalMap f k) z v = deriv f z * v - + Complex.I / (k : ℂ) * ((v.im : ℂ) * deriv f z + + (z.im : ℂ) * (deriv (deriv f) z * v)) := by + have han : AnalyticAt ℂ f z := hf.1.analyticOnNhd isOpen_halfPlane z hz + have ha := han.differentiableAt.hasDerivAt.hasFDerivAt.restrictScalars ℝ + have hb := han.deriv.differentiableAt.hasDerivAt.hasFDerivAt.restrictScalars ℝ + have hc := Complex.ofRealCLM.hasFDerivAt.comp z Complex.imCLM.hasFDerivAt + have hG := ha.sub ((hc.const_mul (Complex.I / (k : ℂ))).mul hb) + have hG' : HasFDerivAt (criticalMap f k) + (ContinuousLinearMap.restrictScalars ℝ (ContinuousLinearMap.toSpanSingleton ℂ (deriv f z)) - + ((Complex.I / (k : ℂ) * (z.im : ℂ)) • + ContinuousLinearMap.restrictScalars ℝ (ContinuousLinearMap.toSpanSingleton ℂ (deriv (deriv f) z)) + + deriv f z • (Complex.I / (k : ℂ)) • + (Complex.ofRealCLM.comp Complex.imCLM))) z := hG + rw [hG'.fderiv] + change v * deriv f z - + ((Complex.I / (k : ℂ) * (z.im : ℂ)) * (v * deriv (deriv f) z) + + deriv f z * (Complex.I / (k : ℂ) * (v.im : ℂ))) = _ + ring + +lemma criticalMap_columns {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z : ℂ} (hz : z ∈ halfPlane) (k : ℝ) (hk : k ≠ 0) : + fderiv ℝ (criticalMap f k) z 1 = deriv f z / (k : ℂ) * ((k : ℂ) + logarithmicJet f z) ∧ + fderiv ℝ (criticalMap f k) z Complex.I = + Complex.I * (deriv f z / (k : ℂ)) * ((k : ℂ) - 1 + logarithmicJet f z) := by + have hd : deriv f z ≠ 0 := univalent_deriv_ne_zero isOpen_halfPlane hf hz + have hk' : (k : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hk + constructor <;> rw [fderiv_criticalMap_apply hf hz, logarithmicJet_eq hf hz] <;> + simp only [Complex.one_im, Complex.I_im, Complex.ofReal_zero, Complex.ofReal_one, + zero_mul, one_mul, mul_one, zero_add] <;> field_simp <;> ring + +lemma critical_columns_det (u q : ℂ) (k : ℝ) : + (u * ((k : ℂ) + q)).re * (Complex.I * u * ((k : ℂ) - 1 + q)).im - + (Complex.I * u * ((k : ℂ) - 1 + q)).re * (u * ((k : ℂ) + q)).im = + ‖u‖^2 * (k * (k-1) + (2*k-1)*q.re + ‖q‖^2) := by + simp only [Complex.mul_re, Complex.mul_im, Complex.add_re, Complex.add_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.sq_norm, Complex.normSq_apply] + ring + +lemma normalizedJacobian_formula {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z : ℂ} (hz : z ∈ halfPlane) (k : ℝ) (hk : k ≠ 0) : + k^2 * normalizedJacobian f k z = + k * (k - 1) + (2*k - 1) * (logarithmicJet f z).re + ‖logarithmicJet f z‖^2 := by + have hd : ‖deriv f z‖ ≠ 0 := norm_ne_zero_iff.mpr + (univalent_deriv_ne_zero isOpen_halfPlane hf hz) + obtain ⟨hc₁, hc₂⟩ := criticalMap_columns hf hz k hk + rw [normalizedJacobian, determinant_complex_real] + change k ^ 2 * (((fderiv ℝ (criticalMap f k) z 1).re * + (fderiv ℝ (criticalMap f k) z Complex.I).im - + (fderiv ℝ (criticalMap f k) z Complex.I).re * + (fderiv ℝ (criticalMap f k) z 1).im) / ‖deriv f z‖^2) = _ + rw [hc₁, hc₂, critical_columns_det, norm_div, Complex.norm_real, + Real.norm_eq_abs, div_pow, sq_abs] + field_simp + +lemma hasDerivAt_reciprocalDeriv {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z : ℂ} (hz : z ∈ halfPlane) : + HasDerivAt (reciprocalDeriv f) (deriv (reciprocalDeriv f) z) z := by + have han : AnalyticAt ℂ f z := hf.1.analyticOnNhd isOpen_halfPlane z hz + exact (han.deriv.differentiableAt.inv + (univalent_deriv_ne_zero isOpen_halfPlane hf hz)).hasDerivAt + +lemma logarithmicJet_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z w : ℂ} (hz : z ∈ halfPlane) (hw : w ∈ halfPlane) : + logarithmicJet (reroot f z) w = logarithmicJet f (affine z w) := by + have hqz : reciprocalDeriv f z ≠ 0 := inv_ne_zero + (univalent_deriv_ne_zero isOpen_halfPlane hf hz) + have hqw : reciprocalDeriv f (affine z w) ≠ 0 := inv_ne_zero + (univalent_deriv_ne_zero isOpen_halfPlane hf (affine_mem hz hw)) + have heq : reciprocalDeriv (reroot f z) =ᶠ[𝓝 w] + (fun u => reciprocalDeriv f (affine z u) / reciprocalDeriv f z) := by + filter_upwards [isOpen_halfPlane.mem_nhds hw] with u hu + exact reciprocalDeriv_reroot hf hz hu + have hD := ((((hasDerivAt_reciprocalDeriv hf (affine_mem hz hw)).comp w + (hasDerivAt_affine z w)).div_const (reciprocalDeriv f z)).congr_of_eventuallyEq heq).deriv + have him : ((affine z w).im : ℂ) = (z.im : ℂ) * (w.im : ℂ) := by + simp [affine] + rw [logarithmicJet, hD, reciprocalDeriv_reroot hf hz hw, logarithmicJet, him] + field_simp + +lemma criticalMap_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z w : ℂ} (hz : z ∈ halfPlane) (hw : w ∈ halfPlane) (k : ℝ) : + criticalMap (reroot f z) k w = + (criticalMap f k (affine z w) - f z) / ((z.im : ℂ) * deriv f z) := by + have hy : (z.im : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + have hd : deriv f z ≠ 0 := univalent_deriv_ne_zero isOpen_halfPlane hf hz + have him : ((affine z w).im : ℂ) = (z.im : ℂ) * (w.im : ℂ) := by + simp [affine] + rw [criticalMap, deriv_reroot hf hz hw] + simp only [reroot, criticalMap, him] + field_simp + ring + +lemma normalizedJacobian_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z w : ℂ} (hz : z ∈ halfPlane) (hw : w ∈ halfPlane) (k : ℝ) (hk : k ≠ 0) : + normalizedJacobian (reroot f z) k w = normalizedJacobian f k (affine z w) := by + apply (mul_left_cancel₀ (pow_ne_zero 2 hk)) + rw [normalizedJacobian_formula (reroot_normalized hf hz).1 hw k hk, + normalizedJacobian_formula hf (affine_mem hz hw) k hk, logarithmicJet_reroot hf hz hw] + +def potential (f : ℂ → ℂ) (k : ℝ) (ξ z : ℂ) : ℝ≥0∞ := + (ENNReal.ofReal z.im) ^ k / ENNReal.ofReal ‖f z - ξ‖ + +def GoodPair (f : ℂ → ℂ) (k : ℝ) (ξ : ℂ) : Prop := + (∀ δ : ℝ, 0 < δ → IsCompact {z | z ∈ halfPlane ∧ ENNReal.ofReal δ ≤ potential f k ξ z}) ∧ + (∀ z ∈ halfPlane, criticalMap f k z = ξ → normalizedJacobian f k z ≠ 0) + +def CriticalCountStatement : Prop := + ∀ f : ℂ → ℂ, UnivalentOn f halfPlane → ∀ k : ℝ, 1 < k → ∀ ξ : ℂ, + GoodPair f k ξ → ∀ h : ℝ, 0 < h → + let critical := {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ + ENNReal.ofReal h ≤ potential f k ξ z} + critical.Finite ∧ + ({z ∈ critical | 0 < normalizedJacobian f k z}).ncard ≤ + ({z ∈ critical | normalizedJacobian f k z < 0}).ncard + +lemma differentiableAt_criticalMap {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z : ℂ} (hz : z ∈ halfPlane) (k : ℝ) : + DifferentiableAt ℝ (criticalMap f k) z := by + have han : AnalyticAt ℂ f z := hf.1.analyticOnNhd isOpen_halfPlane z hz + exact ((han.differentiableAt.restrictScalars ℝ).sub + (((Complex.ofRealCLM.differentiableAt.comp z Complex.imCLM.differentiableAt).const_mul + (Complex.I / (k : ℂ))).mul (han.deriv.differentiableAt.restrictScalars ℝ))) + +lemma critical_fiber_discrete {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} {ξ : ℂ} (hreg : ∀ z ∈ halfPlane, + criticalMap f k z = ξ → normalizedJacobian f k z ≠ 0) : + IsDiscrete {z | z ∈ halfPlane ∧ criticalMap f k z = ξ} := by + rw [isDiscrete_iff_nhdsNE] + intro z hz + have hd : LinearMap.det (fderiv ℝ (criticalMap f k) z).toLinearMap ≠ 0 := + (div_ne_zero_iff.mp (hreg z hz.1 hz.2)).1 + let e : ℂ ≃L[ℝ] ℂ := + (LinearMap.equivOfIsUnitDet (isUnit_iff_ne_zero.mpr hd)).toContinuousLinearEquiv + have he : (e : ℂ → ℂ) = fderiv ℝ (criticalMap f k) z := by + funext w + exact LinearMap.equivOfIsUnitDet_apply (isUnit_iff_ne_zero.mpr hd) w + have ha : ∃ C, AntilipschitzWith C (fderiv ℝ (criticalMap f k) z) := by + rw [← he] + exact ⟨_, e.antilipschitz⟩ + rw [Filter.inf_principal_eq_bot] + filter_upwards [(differentiableAt_criticalMap hf hz.1 k).hasFDerivAt.eventually_ne ha] with w hw + exact fun h => hw h.2 + +lemma finite_critical_superlevel {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} {ξ : ℂ} (hg : GoodPair f k ξ) {h : ℝ} (hh : 0 < h) : + {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ + ENNReal.ofReal h ≤ potential f k ξ z}.Finite := by + let P := {z | z ∈ halfPlane ∧ ENNReal.ofReal h ≤ potential f k ξ z} + have hP : IsCompact P := hg.1 h hh + have hc : ContinuousOn (criticalMap f k) P := by + intro z hz + exact (differentiableAt_criticalMap hf hz.1 k).continuousAt.continuousWithinAt + have hclosed := hc.preimage_isClosed_of_isClosed hP.isClosed (isClosed_singleton (x := ξ)) + have hcompact : IsCompact (P ∩ (criticalMap f k) ⁻¹' {ξ}) := + hP.of_isClosed_subset hclosed inter_subset_left + have hdiscrete := (critical_fiber_discrete hf hg.2).mono + (show P ∩ (criticalMap f k) ⁻¹' {ξ} ⊆ + {z | z ∈ halfPlane ∧ criticalMap f k z = ξ} from fun _ hz => ⟨hz.1.1, hz.2⟩) + convert hcompact.finite hdiscrete using 1 + ext z + simp only [P, mem_ofPred_eq, mem_inter_iff, mem_preimage, mem_singleton_iff] + tauto + +def logPotential (f : ℂ → ℂ) (k : ℝ) (ξ z : ℂ) : ℝ := + k * Real.log z.im - Real.log ‖f z - ξ‖ + +lemma differentiableAt_log_norm {g : ℂ → ℂ} {z : ℂ} + (hg : DifferentiableAt ℂ g z) (hn : g z ≠ 0) : + DifferentiableAt ℝ (fun w => Real.log ‖g w‖) z := + ((hg.restrictScalars ℝ).norm ℂ hn).log (norm_ne_zero_iff.mpr hn) + +lemma fderiv_log_norm_apply {g : ℂ → ℂ} {d z : ℂ} (hg : HasDerivAt g d z) + (hn : g z ≠ 0) (v : ℂ) : + fderiv ℝ (fun w => Real.log ‖g w‖) z v = (d * v / g z).re := by + have heq : (fun w => Real.log ‖g w‖) = + (fun w => (1 / 2 : ℝ) * Real.log (‖g w‖ ^ 2)) := by + funext w + rw [Real.log_pow] + ring + have hh := (((hg.hasFDerivAt.restrictScalars ℝ).norm_sq).log + (pow_ne_zero 2 (norm_ne_zero_iff.mpr hn))).const_mul (1 / 2 : ℝ) + rw [heq, hh.fderiv] + simp only [smul_apply, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.coe_restrictScalars', ContinuousLinearMap.toSpanSingleton_apply, + smul_eq_mul, innerSL_apply_apply] + simp only [Complex.inner, Complex.mul_re, Complex.conj_re, Complex.conj_im, + Complex.mul_im, Complex.div_re, Complex.normSq_eq_norm_sq] + ring + +lemma differentiableAt_logPotential {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) (k : ℝ) : + DifferentiableAt ℝ (logPotential f k ξ) z := by + have hd := (hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz) + exact ((Complex.imCLM.differentiableAt.log (ne_of_gt hz)).const_mul k).sub + (differentiableAt_log_norm (hd.sub_const ξ) (sub_ne_zero.mpr hp)) + +lemma fderiv_logPotential_apply {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) (k : ℝ) (v : ℂ) : + fderiv ℝ (logPotential f k ξ) z v = + k / z.im * v.im - (deriv f z * v / (f z - ξ)).re := by + have hd := (hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz) + have ha := (Complex.imCLM.hasFDerivAt.log (ne_of_gt hz)).const_mul k + simp only [Complex.imCLM_apply] at ha + have hb := differentiableAt_log_norm (hd.sub_const ξ) (sub_ne_zero.mpr hp) + change fderiv ℝ (fun w => k * Real.log w.im - Real.log ‖f w - ξ‖) z v = _ + rw [fderiv_fun_sub ha.differentiableAt hb, + sub_apply, ha.fderiv, + fderiv_log_norm_apply (hd.hasDerivAt.sub_const ξ) (sub_ne_zero.mpr hp)] + simp only [smul_apply, smul_eq_mul, Complex.imCLM_apply, div_eq_mul_inv] + ring + +lemma criticalMap_ne_pole {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : k ≠ 0) {z ξ : ℂ} (hz : z ∈ halfPlane) + (hc : criticalMap f k z = ξ) : f z ≠ ξ := by + intro hp + have hn := mul_ne_zero (mul_ne_zero (div_ne_zero Complex.I_ne_zero + (Complex.ofReal_ne_zero.mpr hk)) (Complex.ofReal_ne_zero.mpr (ne_of_gt hz))) + (univalent_deriv_ne_zero isOpen_halfPlane hf hz) + apply hn + simpa [criticalMap, hp] using hc + +lemma critical_difference {f : ℂ → ℂ} {k : ℝ} {z ξ : ℂ} + (hc : criticalMap f k z = ξ) : + f z - ξ = Complex.I / (k : ℂ) * (z.im : ℂ) * deriv f z := by + unfold criticalMap at hc + linear_combination hc + +lemma ratio_at_critical {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} {z ξ : ℂ} (hz : z ∈ halfPlane) + (hc : criticalMap f k z = ξ) : + deriv f z / (f z - ξ) = -Complex.I * (k : ℂ) / (z.im : ℂ) := by + have hd := univalent_deriv_ne_zero isOpen_halfPlane hf hz + have hy := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + rw [critical_difference hc] + field_simp + simp [Complex.I_sq] + +lemma criticalMap_eq_of_ratio {f : ℂ → ℂ} {k : ℝ} (hk : k ≠ 0) + {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) + (hr : deriv f z / (f z - ξ) = -Complex.I * (k : ℂ) / (z.im : ℂ)) : + criticalMap f k z = ξ := by + have hy := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + have hk' := Complex.ofReal_ne_zero.mpr hk + have hdiff := sub_ne_zero.mpr hp + have hd := (div_eq_iff hdiff).mp hr + rw [criticalMap, hd] + field_simp + simp [Complex.I_sq] + +lemma critical_iff_fderiv_logPotential_zero {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : k ≠ 0) {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) : + criticalMap f k z = ξ ↔ fderiv ℝ (logPotential f k ξ) z = 0 := by + constructor + · intro hc + ext v + rw [fderiv_logPotential_apply hf hz hp] + have hr := ratio_at_critical hf hz hc + rw [show deriv f z * v / (f z - ξ) = (deriv f z / (f z - ξ)) * v by ring, hr] + simp [Complex.div_re, Complex.div_im, Complex.normSq_ofReal] + field_simp + ring + · intro heq + have hx := congrArg (fun A : ℂ →L[ℝ] ℝ => A 1) heq + have hy := congrArg (fun A : ℂ →L[ℝ] ℝ => A Complex.I) heq + rw [fderiv_logPotential_apply hf hz hp] at hx hy + simp only [Complex.one_im, mul_zero, mul_one, zero_apply, + zero_sub, neg_eq_zero] at hx + have him : (deriv f z / (f z - ξ)).im = -(k / z.im) := by + rw [show deriv f z * Complex.I / (f z - ξ) = + (deriv f z / (f z - ξ)) * Complex.I by ring] at hy + simp only [Complex.I_im, mul_one, Complex.mul_I_re, + zero_apply] at hy + linarith + apply criticalMap_eq_of_ratio hk hz hp + apply Complex.ext + · simpa using hx + · simpa [neg_div] using him + +def targetRatio (f : ℂ → ℂ) (ξ z : ℂ) : ℂ := deriv f z / (f z - ξ) + +lemma hasDerivAt_targetRatio {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) : + HasDerivAt (targetRatio f ξ) + ((deriv (deriv f) z * (f z - ξ) - deriv f z * deriv f z) / (f z - ξ)^2) z := by + have han : AnalyticAt ℂ f z := hf.1.analyticOnNhd isOpen_halfPlane z hz + exact han.deriv.differentiableAt.hasDerivAt.div + (han.differentiableAt.hasDerivAt.sub_const ξ) (sub_ne_zero.mpr hp) + +lemma deriv_targetRatio_at_critical {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : k ≠ 0) {z ξ : ℂ} (hz : z ∈ halfPlane) + (hc : criticalMap f k z = ξ) : + deriv (targetRatio f ξ) z = (k : ℂ) * (k + logarithmicJet f z) / (z.im : ℂ)^2 := by + have hd := univalent_deriv_ne_zero isOpen_halfPlane hf hz + have hy := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + have hk' := Complex.ofReal_ne_zero.mpr hk + rw [(hasDerivAt_targetRatio hf hz (criticalMap_ne_pole hf hk hz hc)).deriv, + critical_difference hc, logarithmicJet_eq hf hz] + field_simp + simp only [Complex.I_sq] + ring_nf + +def secondDirectional (u : ℂ → ℝ) (z v w : ℂ) : ℝ := + fderiv ℝ (fun t => fderiv ℝ u t v) z w + +def realHessian (u : ℂ → ℝ) (z : ℂ) : Matrix (Fin 2) (Fin 2) ℝ := + !![secondDirectional u z 1 1, secondDirectional u z 1 Complex.I; + secondDirectional u z Complex.I 1, secondDirectional u z Complex.I Complex.I] + +lemma secondDirectional_logPotential_one {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) (k : ℝ) (v : ℂ) : + secondDirectional (logPotential f k ξ) z 1 v = + -(deriv (targetRatio f ξ) z * v).re := by + have hd := (hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz) + have hn := hd.continuousAt.eventually_ne hp + have heq : (fun w => fderiv ℝ (logPotential f k ξ) w 1) =ᶠ[𝓝 z] + (fun w => -(targetRatio f ξ w).re) := by + filter_upwards [isOpen_halfPlane.mem_nhds hz, hn] with w hw hne + simp only [fderiv_logPotential_apply hf hw hne, Complex.one_im, mul_zero, + mul_one, zero_sub, targetRatio] + have hr := (hasDerivAt_targetRatio hf hz hp).differentiableAt.hasDerivAt + have hh := (Complex.reCLM.hasFDerivAt.comp z + (hr.hasFDerivAt.restrictScalars ℝ)).neg + change HasFDerivAt (fun w => -(targetRatio f ξ w).re) _ z at hh + rw [secondDirectional, heq.fderiv_eq, hh.fderiv] + simp only [neg_apply, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.coe_restrictScalars', ContinuousLinearMap.toSpanSingleton_apply, + smul_eq_mul, Complex.reCLM_apply, mul_comm v] + +lemma secondDirectional_logPotential_I {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) (k : ℝ) (v : ℂ) : + secondDirectional (logPotential f k ξ) z Complex.I v = + -k / z.im^2 * v.im + (deriv (targetRatio f ξ) z * v).im := by + have hd := (hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz) + have hn := hd.continuousAt.eventually_ne hp + have heq : (fun w => fderiv ℝ (logPotential f k ξ) w Complex.I) =ᶠ[𝓝 z] + (fun w => k / w.im + (targetRatio f ξ w).im) := by + filter_upwards [isOpen_halfPlane.mem_nhds hz, hn] with w hw hne + rw [fderiv_logPotential_apply hf hw hne, + show deriv f w * Complex.I / (f w - ξ) = + (deriv f w / (f w - ξ)) * Complex.I by ring] + simp only [Complex.I_im, mul_one, Complex.mul_I_re, sub_neg_eq_add, targetRatio] + have hr := (hasDerivAt_targetRatio hf hz hp).differentiableAt.hasDerivAt + have ha := (((hasDerivAt_inv (ne_of_gt hz)).hasFDerivAt).comp z + Complex.imCLM.hasFDerivAt).const_mul k + have hb := Complex.imCLM.hasFDerivAt.comp z (hr.hasFDerivAt.restrictScalars ℝ) + have hh := ha.add hb + change HasFDerivAt (fun w => k * w.im⁻¹ + (targetRatio f ξ w).im) _ z at hh + simp only [← div_eq_mul_inv] at hh + rw [secondDirectional, heq.fderiv_eq, hh.fderiv] + simp only [add_apply, smul_apply, smul_eq_mul, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.coe_restrictScalars', ContinuousLinearMap.toSpanSingleton_apply, + Complex.imCLM_apply, mul_comm v] + ring + +lemma realHessian_logPotential {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) (k : ℝ) : + realHessian (logPotential f k ξ) z = + !![-(deriv (targetRatio f ξ) z).re, (deriv (targetRatio f ξ) z).im; + (deriv (targetRatio f ξ) z).im, -k / z.im^2 + (deriv (targetRatio f ξ) z).re] := by + simp only [realHessian, secondDirectional_logPotential_one hf hz hp, + secondDirectional_logPotential_I hf hz hp, mul_one, Complex.mul_I_re, + Complex.mul_I_im, Complex.one_im, Complex.I_im, mul_zero, mul_one, zero_add, neg_neg] + +lemma trace_realHessian_logPotential {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) (k : ℝ) : + Matrix.trace (realHessian (logPotential f k ξ) z) = -k / z.im^2 := by + rw [realHessian_logPotential hf hz hp] + simp [Matrix.trace, Matrix.diag, Fin.sum_univ_two] + +lemma realHessian_at_critical {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : k ≠ 0) {z ξ : ℂ} (hz : z ∈ halfPlane) + (hc : criticalMap f k z = ξ) : + realHessian (logPotential f k ξ) z = + (k / z.im^2) • + !![-(k + (logarithmicJet f z).re), (logarithmicJet f z).im; + (logarithmicJet f z).im, k - 1 + (logarithmicJet f z).re] := by + rw [realHessian_logPotential hf hz (criticalMap_ne_pole hf hk hz hc), + deriv_targetRatio_at_critical hf hk hz hc] + have hre : ((k : ℂ) * (k + logarithmicJet f z) / (z.im : ℂ)^2).re = + k / z.im^2 * (k + (logarithmicJet f z).re) := by + rw [← Complex.ofReal_pow, Complex.div_ofReal_re] + simp only [Complex.mul_re, Complex.add_re, Complex.ofReal_re, Complex.ofReal_im, + zero_mul, sub_zero] + ring + have him : ((k : ℂ) * (k + logarithmicJet f z) / (z.im : ℂ)^2).im = + k / z.im^2 * (logarithmicJet f z).im := by + rw [← Complex.ofReal_pow, Complex.div_ofReal_im] + simp only [Complex.mul_im, Complex.add_im, Complex.ofReal_re, Complex.ofReal_im, + zero_mul, zero_add] + ring + rw [hre, him] + ext i j + fin_cases i <;> fin_cases j <;> dsimp <;> ring + +lemma det_realHessian_at_critical {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : k ≠ 0) {z ξ : ℂ} (hz : z ∈ halfPlane) + (hc : criticalMap f k z = ξ) : + (realHessian (logPotential f k ξ) z).det = + -(k^4 / z.im^4) * normalizedJacobian f k z := by + rw [realHessian_at_critical hf hk hz hc, Matrix.det_fin_two] + simp only [Matrix.smul_apply, smul_eq_mul, Matrix.of_apply, Matrix.cons_val_zero, + Matrix.cons_val_one] + have hJ := normalizedJacobian_formula hf hz k hk + rw [Complex.sq_norm, Complex.normSq_apply] at hJ + have hy : z.im ≠ 0 := ne_of_gt hz + field_simp + linear_combination hJ + +lemma trace_realHessian_negative {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : 0 < k) {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) : + Matrix.trace (realHessian (logPotential f k ξ) z) < 0 := by + rw [trace_realHessian_logPotential hf hz hp] + exact div_neg_of_neg_of_pos (neg_neg_of_pos hk) (sq_pos_of_pos hz) + +lemma det_realHessian_ne_zero_at_critical {f : ℂ → ℂ} + (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : k ≠ 0) {z ξ : ℂ} + (hz : z ∈ halfPlane) (hc : criticalMap f k z = ξ) + (hJ : normalizedJacobian f k z ≠ 0) : + (realHessian (logPotential f k ξ) z).det ≠ 0 := by + rw [det_realHessian_at_critical hf hk hz hc] + exact mul_ne_zero (neg_ne_zero.mpr (div_ne_zero (pow_ne_zero 4 hk) + (pow_ne_zero 4 (ne_of_gt hz)))) hJ + +lemma potential_off_pole {f : ℂ → ℂ} {k : ℝ} {ξ z : ℂ} + (hz : z ∈ halfPlane) (hp : f z ≠ ξ) : + potential f k ξ z = ENNReal.ofReal (z.im^k / ‖f z - ξ‖) := by + rw [potential, ENNReal.ofReal_rpow_of_pos hz, + ENNReal.ofReal_div_of_pos (norm_pos_iff.mpr (sub_ne_zero.mpr hp))] + +lemma potential_pos {f : ℂ → ℂ} {k : ℝ} {ξ z : ℂ} (hz : z ∈ halfPlane) : + 0 < potential f k ξ z := by + rw [potential] + exact ENNReal.div_pos (ne_of_gt (ENNReal.rpow_pos (ENNReal.ofReal_pos.mpr hz) + ENNReal.ofReal_ne_top)) ENNReal.ofReal_ne_top + +lemma potential_at_pole {f : ℂ → ℂ} {k : ℝ} {ξ z : ℂ} + (hz : z ∈ halfPlane) (hp : f z = ξ) : potential f k ξ z = ∞ := by + rw [potential, hp, sub_self, norm_zero, ENNReal.ofReal_zero] + exact ENNReal.div_zero (ne_of_gt (ENNReal.rpow_pos + (ENNReal.ofReal_pos.mpr hz) ENNReal.ofReal_ne_top)) + +lemma potential_critical_height {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : 0 < k) {z ξ : ℂ} (hz : z ∈ halfPlane) + (hc : criticalMap f k z = ξ) : + potential f k ξ z = ENNReal.ofReal (k * z.im^(k-1) * ‖reciprocalDeriv f z‖) := by + have hd := univalent_deriv_ne_zero isOpen_halfPlane hf hz + have hy : z.im ≠ 0 := ne_of_gt hz + have hn : ‖deriv f z‖ ≠ 0 := norm_ne_zero_iff.mpr hd + rw [potential_off_pole hz (criticalMap_ne_pole hf (ne_of_gt hk) hz hc), + critical_difference hc, norm_mul, norm_mul, norm_div, Complex.norm_I, + Complex.norm_real, Complex.norm_real, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_pos hk, abs_of_pos hz, Real.rpow_sub_one hy, reciprocalDeriv, norm_inv] + congr 1 + field_simp + +lemma critical_target_weight {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {β : ℝ} (hβ : 1 < β) {z ξ : ℂ} (hz : z ∈ halfPlane) + (hc : criticalMap f ((β+3)/4) z = ξ) : + z.im^(β-1) * ‖reciprocalDeriv f z‖^4 = + ((potential f ((β+3)/4) ξ z).toReal / ((β+3)/4))^4 := by + let k : ℝ := (β+3)/4 + have hk : 0 < k := by dsimp [k]; linarith + have hv : 0 ≤ k * z.im^(k-1) * ‖reciprocalDeriv f z‖ := + mul_nonneg (mul_nonneg hk.le (Real.rpow_nonneg hz.le _)) (norm_nonneg _) + rw [potential_critical_height hf hk hz hc, ENNReal.toReal_ofReal hv] + have he : β - 1 = (k - 1) * 4 := by dsimp [k]; ring + rw [he, Real.rpow_mul (le_of_lt hz)] + change (z.im ^ (k - 1)) ^ (4 : ℝ) * _ = (k * _ * _ / k) ^ (4 : ℕ) + rw [Real.rpow_ofNat] + field_simp + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/CriticalPoint.lean b/lean/OAI/Analysis/IntegralMeans/CriticalPoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b2855c09783dcc9141429e6d138f63a29e49565 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/CriticalPoint.lean @@ -0,0 +1,270 @@ +import OAI.Analysis.IntegralMeans.CriticalMap + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +lemma second_derivative_nonneg_at_min_zero {f f' : ℝ → ℝ} {b : ℝ} + (hmin : IsLocalMin f 0) (hf : ∀ᶠ x in 𝓝 0, HasDerivAt f (f' x) x) + (hf' : HasDerivAt f' b 0) : 0 ≤ b := by + by_contra hb + have hb : b < 0 := lt_of_not_ge hb + have hzero : f' 0 = 0 := hmin.hasDerivAt_eq_zero hf.self_of_nhds + have hrem := (hasDerivAt_iff_isLittleO_nhds_zero.mp hf').bound + (by linarith : 0 < -b/2) + have he : ∀ᶠ x in 𝓝 (0 : ℝ), + HasDerivAt f (f' x) x ∧ f 0 ≤ f x ∧ |f' x - x*b| ≤ (-b/2)*|x| := by + filter_upwards [hf,hmin,hrem] with x hdx hmx hrx + exact ⟨hdx,hmx,by simpa [hzero,Real.norm_eq_abs] using hrx⟩ + obtain ⟨δ,hδ,hall⟩ := Metric.eventually_nhds_iff.mp he + have hball {x : ℝ} (hx : x ∈ Icc 0 (δ/2)) : dist x 0 < δ := by + rw [Real.dist_eq, sub_zero, abs_of_nonneg hx.1] + linarith [hx.2] + have hc : ContinuousOn f (Icc 0 (δ/2)) := by + intro x hx + exact (hall (hball hx)).1.continuousAt.continuousWithinAt + obtain ⟨c,hcint,hceq⟩ := exists_deriv_eq_slope f (by linarith : 0 < δ/2) hc + (fun x hx => (hall (hball (Ioo_subset_Icc_self hx))).1.differentiableAt.differentiableWithinAt) + have hcl := hall (hball (Ioo_subset_Icc_self hcint)) + rw [hcl.1.deriv] at hceq + have hend := (hall (hball (show δ/2 ∈ Icc 0 (δ/2) by constructor <;> linarith))).2.1 + have hf'c : 0 ≤ f' c := by + rw [hceq] + exact div_nonneg (sub_nonneg.mpr hend) (by linarith) + have hupper := (le_abs_self (f' c-c*b)).trans hcl.2.2 + rw [abs_of_pos hcint.1] at hupper + nlinarith [mul_neg_of_pos_of_neg hcint.1 hb] + +lemma second_directional_nonneg_at_min {u : ℂ → ℝ} {z v : ℂ} + (hmin : IsLocalMin u z) + (hu : ∀ᶠ w in 𝓝 z, DifferentiableAt ℝ u w) + (hv : DifferentiableAt ℝ (fun w => fderiv ℝ u w v) z) : + 0 ≤ fderiv ℝ (fun w => fderiv ℝ u w v) z v := by + let g : ℝ → ℂ := fun t => z + t • v + have hg (t : ℝ) : HasDerivAt g v t := by + simpa [g] using (hasDerivAt_id t).smul_const v |>.const_add z + have hgz : g 0 = z := by simp [g] + have hmin' : IsLocalMin (u ∘ g) 0 := + (hgz ▸ hmin).comp_continuous (hg 0).continuousAt + have hu' : ∀ᶠ t in 𝓝 (0 : ℝ), HasDerivAt (u ∘ g) (fderiv ℝ u (g t) v) t := by + have ht : Tendsto g (𝓝 0) (𝓝 z) := hgz ▸ (hg 0).continuousAt + filter_upwards [ht.eventually hu] with t ht + exact ht.hasFDerivAt.comp_hasDerivAt t (hg t) + have hv' : HasDerivAt (fun t => fderiv ℝ u (g t) v) + (fderiv ℝ (fun w => fderiv ℝ u w v) z v) 0 := by + exact (hv.hasFDerivAt.comp_hasDerivAt_of_eq 0 (hg 0) hgz.symm) + exact second_derivative_nonneg_at_min_zero hmin' hu' hv' + +lemma differentiableAt_fderiv_logPotential_apply {f : ℂ → ℂ} + (hf : UnivalentOn f halfPlane) {z ξ : ℂ} (hz : z ∈ halfPlane) + (hp : f z ≠ ξ) (k : ℝ) (v : ℂ) : + DifferentiableAt ℝ (fun w => fderiv ℝ (logPotential f k ξ) w v) z := by + have hd := (hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz) + have hn := hd.continuousAt.eventually_ne hp + have heq : (fun w => fderiv ℝ (logPotential f k ξ) w v) =ᶠ[𝓝 z] + (fun w => k / w.im * v.im - (targetRatio f ξ w * v).re) := by + filter_upwards [isOpen_halfPlane.mem_nhds hz, hn] with w hw hne + rw [fderiv_logPotential_apply hf hw hne] + unfold targetRatio + congr 2 + ring + have ha : DifferentiableAt ℝ (fun w : ℂ => k / w.im * v.im) z := by + have hi := (hasDerivAt_inv (ne_of_gt hz)).differentiableAt.comp z + Complex.imCLM.differentiableAt + simpa only [div_eq_mul_inv, Function.comp_def, Complex.imCLM_apply] using + (hi.const_mul k).mul_const v.im + have hb : DifferentiableAt ℝ (fun w => (targetRatio f ξ w * v).re) z := + Complex.reCLM.differentiableAt.comp z + (((hasDerivAt_targetRatio hf hz hp).differentiableAt.restrictScalars ℝ).mul_const v) + exact (ha.sub hb).congr_of_eventuallyEq heq + +lemma not_isLocalMin_logPotential {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : 0 < k) {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) : + ¬ IsLocalMin (logPotential f k ξ) z := by + intro hmin + have hd := (hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz) + have hu : ∀ᶠ w in 𝓝 z, DifferentiableAt ℝ (logPotential f k ξ) w := by + filter_upwards [isOpen_halfPlane.mem_nhds hz, hd.continuousAt.eventually_ne hp] + with w hw hne + exact differentiableAt_logPotential hf hw hne k + have h1 := second_directional_nonneg_at_min hmin hu + (differentiableAt_fderiv_logPotential_apply hf hz hp k 1) + have hI := second_directional_nonneg_at_min hmin hu + (differentiableAt_fderiv_logPotential_apply hf hz hp k Complex.I) + have ht := trace_realHessian_negative hf hk hz hp + simp only [realHessian, Matrix.trace, Matrix.diag, Fin.sum_univ_two, + Matrix.of_apply, Matrix.cons_val_zero, Matrix.cons_val_one] at ht + change secondDirectional _ z 1 1 + secondDirectional _ z Complex.I Complex.I < 0 at ht + unfold secondDirectional at ht + linarith + +def reciprocalPotential (f : ℂ → ℂ) (k : ℝ) (ξ z : ℂ) : ℝ := + ‖f z-ξ‖ / z.im^k + +lemma continuousOn_reciprocalPotential {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + (k : ℝ) (ξ : ℂ) : ContinuousOn (reciprocalPotential f k ξ) halfPlane := by + apply ((hf.1.continuousOn.sub continuousOn_const).norm).div + (Complex.continuous_im.continuousOn.rpow_const (fun z hz => Or.inl (ne_of_gt hz))) + intro z hz + exact ne_of_gt (Real.rpow_pos_of_pos hz k) + +lemma reciprocalPotential_pos {f : ℂ → ℂ} {k : ℝ} {ξ z : ℂ} + (hz : z ∈ halfPlane) (hp : f z ≠ ξ) : 0 < reciprocalPotential f k ξ z := by + exact div_pos (norm_pos_iff.mpr (sub_ne_zero.mpr hp)) (Real.rpow_pos_of_pos hz k) + +lemma log_reciprocalPotential {f : ℂ → ℂ} {k : ℝ} {ξ z : ℂ} + (hz : z ∈ halfPlane) (hp : f z ≠ ξ) : + Real.log (reciprocalPotential f k ξ z) = -logPotential f k ξ z := by + rw [reciprocalPotential,Real.log_div (norm_ne_zero_iff.mpr (sub_ne_zero.mpr hp)) + (ne_of_gt (Real.rpow_pos_of_pos hz k)),Real.log_rpow hz,logPotential] + ring + +lemma not_isLocalMax_reciprocalPotential {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : 0 < k) {z ξ : ℂ} (hz : z ∈ halfPlane) (hp : f z ≠ ξ) : + ¬ IsLocalMax (reciprocalPotential f k ξ) z := by + intro hmax + apply not_isLocalMin_logPotential hf hk hz hp + have hd := (hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz) + filter_upwards [hmax,isOpen_halfPlane.mem_nhds hz,hd.continuousAt.eventually_ne hp] + with w hw hwH hwne + have hl := Real.log_le_log (reciprocalPotential_pos hwH hwne) hw + rw [log_reciprocalPotential hwH hwne,log_reciprocalPotential hz hp] at hl + linarith + +lemma reciprocalPotential_lt_boundary {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k b : ℝ} (hk : 0 < k) (hb : 0 < b) (ξ : ℂ) {U : Set ℂ} + (ho : IsOpen U) (hcompact : IsCompact (closure U)) + (hH : closure U ⊆ halfPlane) + (hboundary : ∀ z ∈ frontier U, reciprocalPotential f k ξ z ≤ b) + {z : ℂ} (hz : z ∈ U) : reciprocalPotential f k ξ z < b := by + have hcont := (continuousOn_reciprocalPotential hf k ξ).mono hH + obtain ⟨a,ha,hmax⟩ := hcompact.exists_isMaxOn ⟨z,subset_closure hz⟩ hcont + have hmaxle : reciprocalPotential f k ξ a ≤ b := by + by_contra hn + have hab : b < reciprocalPotential f k ξ a := lt_of_not_ge hn + have haU : a ∈ U := by + by_contra hau + have haf : a ∈ frontier U := ⟨ha,by simpa only [ho.interior_eq] using hau⟩ + exact (not_lt_of_ge (hboundary a haf)) hab + have hane : f a ≠ ξ := by + intro he + have he0 : reciprocalPotential f k ξ a = 0 := by simp [reciprocalPotential,he] + linarith + exact not_isLocalMax_reciprocalPotential hf hk (hH ha) hane + (hmax.isLocalMax (mem_of_superset (ho.mem_nhds haU) subset_closure)) + have hwhole : ∀ w ∈ closure U, reciprocalPotential f k ξ w ≤ b := + fun w hw => (hmax hw).trans hmaxle + have hzle := hwhole z (subset_closure hz) + apply lt_of_le_of_ne hzle + intro he + have hzne : f z ≠ ξ := by + intro hze + have he0 : reciprocalPotential f k ξ z = 0 := by simp [reciprocalPotential,hze] + linarith + apply not_isLocalMax_reciprocalPotential hf hk (hH (subset_closure hz)) hzne + filter_upwards [ho.mem_nhds hz] with w hw + exact (hwhole w (subset_closure hw)).trans_eq he.symm + +def regularizedGradient (f : ℂ → ℂ) (k : ℝ) (ξ z : ℂ) : ℂ := + ((k : ℂ)*Complex.I/(z.im : ℂ))*(f z-ξ)*conj (criticalMap f k z-ξ) + +lemma regularizedGradient_eq_zero_iff {f : ℂ → ℂ} {k : ℝ} (hk : k ≠ 0) + {ξ z : ℂ} (hz : z ∈ halfPlane) : + regularizedGradient f k ξ z = 0 ↔ f z = ξ ∨ criticalMap f k z = ξ := by + have hc : ((k : ℂ)*Complex.I/(z.im : ℂ)) ≠ 0 := div_ne_zero + (mul_ne_zero (Complex.ofReal_ne_zero.mpr hk) Complex.I_ne_zero) + (Complex.ofReal_ne_zero.mpr (ne_of_gt hz)) + simp only [regularizedGradient,mul_eq_zero,hc,false_or,sub_eq_zero,map_eq_zero] + +lemma differentiableAt_gradientCoefficient {z : ℂ} (hz : z ∈ halfPlane) (k : ℝ) : + DifferentiableAt ℝ (fun w : ℂ => (k : ℂ)*Complex.I/(w.im : ℂ)) z := by + have hn : (z.im : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + have hi := ((hasDerivAt_inv hn).differentiableAt.restrictScalars ℝ).comp z + ((Complex.ofRealCLM.comp Complex.imCLM).differentiableAt) + simpa only [div_eq_mul_inv,Function.comp_def,ContinuousLinearMap.comp_apply, + Complex.ofRealCLM_apply,Complex.imCLM_apply] using hi.const_mul ((k : ℂ)*Complex.I) + +lemma differentiableAt_regularizedGradient {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z : ℂ} (hz : z ∈ halfPlane) (k : ℝ) (ξ : ℂ) : + DifferentiableAt ℝ (regularizedGradient f k ξ) z := by + have hd := ((hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz)).restrictScalars ℝ + exact ((differentiableAt_gradientCoefficient hz k).mul (hd.sub_const ξ)).mul + (Complex.conjCLE.differentiableAt.comp z ((differentiableAt_criticalMap hf hz k).sub_const ξ)) + +lemma hasFDerivAt_regularizedGradient_at_critical {f : ℂ → ℂ} + (hf : UnivalentOn f halfPlane) {k : ℝ} {ξ z : ℂ} (hz : z ∈ halfPlane) + (hc : criticalMap f k z = ξ) : + HasFDerivAt (regularizedGradient f k ξ) + ((((k : ℂ)*Complex.I/(z.im : ℂ))*(f z-ξ)) • + (Complex.conjCLE.toContinuousLinearMap.comp (fderiv ℝ (criticalMap f k) z))) z := by + have hd := ((hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz)).restrictScalars ℝ + have hG := (differentiableAt_criticalMap hf hz k).hasFDerivAt.sub_const ξ + have hh := ((differentiableAt_gradientCoefficient hz k).hasFDerivAt.fun_mul + (hd.hasFDerivAt.sub_const ξ)).fun_mul (Complex.conjCLE.hasFDerivAt.comp z hG) + convert hh using 1 <;> first | rfl | simp only [Function.comp_def, hc, sub_self, map_zero, zero_smul, add_zero] + +lemma hasFDerivAt_regularizedGradient_at_pole {f : ℂ → ℂ} + (hf : UnivalentOn f halfPlane) {k : ℝ} {ξ z : ℂ} (hz : z ∈ halfPlane) + (hp : f z = ξ) : + HasFDerivAt (regularizedGradient f k ξ) + ((((k : ℂ)*Complex.I/(z.im : ℂ))*conj (criticalMap f k z-ξ)) • + (fderiv ℝ f z)) z := by + have hd := ((hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz)).restrictScalars ℝ + have hG := (differentiableAt_criticalMap hf hz k).hasFDerivAt.sub_const ξ + have hh := ((differentiableAt_gradientCoefficient hz k).hasFDerivAt.fun_mul + (hd.hasFDerivAt.sub_const ξ)).fun_mul (Complex.conjCLE.hasFDerivAt.comp z hG) + convert hh using 1 <;> first | rfl | simp only [Function.comp_def, hp, sub_self, mul_zero, zero_smul, zero_add, add_zero, smul_smul, Complex.conjCLE_apply, mul_comm] + +lemma det_conj_comp (A : ℂ →L[ℝ] ℂ) : + LinearMap.det (Complex.conjCLE.toContinuousLinearMap.comp A).toLinearMap = + -LinearMap.det A.toLinearMap := by + rw [determinant_complex_real,determinant_complex_real] + simp only [ContinuousLinearMap.coe_coe,ContinuousLinearMap.comp_apply, + ContinuousLinearEquiv.coe_coe,Complex.conjCLE_apply,Complex.conj_re,Complex.conj_im] + ring + +lemma det_regularizedGradient_at_critical {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} {ξ z : ℂ} (hz : z ∈ halfPlane) (hc : criticalMap f k z = ξ) : + LinearMap.det (fderiv ℝ (regularizedGradient f k ξ) z).toLinearMap = + -‖((k : ℂ)*Complex.I/(z.im : ℂ))*(f z-ξ)‖^2 * ‖deriv f z‖^2 * + normalizedJacobian f k z := by + rw [(hasFDerivAt_regularizedGradient_at_critical hf hz hc).fderiv, + det_complex_smul,det_conj_comp,normalizedJacobian] + have hd : ‖deriv f z‖ ≠ 0 := norm_ne_zero_iff.mpr + (univalent_deriv_ne_zero isOpen_halfPlane hf hz) + field_simp + +lemma det_regularizedGradient_at_pole_pos {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {k : ℝ} (hk : k ≠ 0) {ξ z : ℂ} (hz : z ∈ halfPlane) (hp : f z = ξ) : + 0 < LinearMap.det (fderiv ℝ (regularizedGradient f k ξ) z).toLinearMap := by + have hG : criticalMap f k z ≠ ξ := fun hc => criticalMap_ne_pole hf hk hz hc hp + rw [(hasFDerivAt_regularizedGradient_at_pole hf hz hp).fderiv,det_complex_smul, + det_fderiv_complex ((hf.1 z hz).differentiableAt (isOpen_halfPlane.mem_nhds hz))] + apply mul_pos + · apply sq_pos_of_pos + apply norm_pos_iff.mpr + exact mul_ne_zero (div_ne_zero + (mul_ne_zero (Complex.ofReal_ne_zero.mpr hk) Complex.I_ne_zero) + (Complex.ofReal_ne_zero.mpr (ne_of_gt hz))) + ((map_ne_zero (starRingEnd ℂ)).mpr (sub_ne_zero.mpr hG)) + · exact sq_pos_of_pos (norm_pos_iff.mpr (univalent_deriv_ne_zero isOpen_halfPlane hf hz)) + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/Degree.lean b/lean/OAI/Analysis/IntegralMeans/Degree.lean new file mode 100644 index 0000000000000000000000000000000000000000..247010eed5fcc4629c344771e4feaeebd6a021ed --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/Degree.lean @@ -0,0 +1,682 @@ +import OAI.Analysis.IntegralMeans.LogIncrement + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +def orientedDifference (positive : Bool) (a z : ℂ) : ℂ := + if positive then z-a else conj (z-a) + +@[simp] lemma norm_orientedDifference (p : Bool) (a z : ℂ) : + ‖orientedDifference p a z‖ = ‖z-a‖ := by cases p <;> simp only [orientedDifference, Bool.false_eq_true, ↓reduceIte, RCLike.norm_conj] + +@[simp] lemma orientedDifference_eq_zero (p : Bool) (a z : ℂ) : + orientedDifference p a z = 0 ↔ z = a := by + rw [← norm_eq_zero, norm_orientedDifference, norm_eq_zero, sub_eq_zero] + +lemma continuous_orientedDifference (p : Bool) (a : ℂ) : + Continuous (orientedDifference p a) := by + unfold orientedDifference + cases p <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop + +def radialCutoff (a : ℂ) (r : ℝ) (z : ℂ) : ℝ := + max 0 (min 1 (2-2*‖z-a‖/r)) + +lemma continuous_radialCutoff (a : ℂ) (r : ℝ) : Continuous (radialCutoff a r) := by + unfold radialCutoff + fun_prop + +lemma radialCutoff_one {a z : ℂ} {r : ℝ} (hr : 0 < r) (hz : ‖z-a‖ ≤ r/2) : + radialCutoff a r z = 1 := by + have hb : 2*‖z-a‖/r ≤ 1 := (div_le_iff₀ hr).mpr (by linarith) + simp [radialCutoff, min_eq_left (by linarith : 1 ≤ 2-2*‖z-a‖/r)] + +lemma radialCutoff_zero {a z : ℂ} {r : ℝ} (hr : 0 < r) (hz : r ≤ ‖z-a‖) : + radialCutoff a r z = 0 := by + rw [radialCutoff, max_eq_left] + apply min_le_of_right_le + rw [sub_nonpos, le_div_iff₀ hr] + linarith + +def surgeryLog (X : ℂ → ℂ) (p : Bool) (a c : ℂ) (r : ℝ) (z : ℂ) : ℂ := + (radialCutoff a r z : ℂ) * Complex.log (X z / (c*orientedDifference p a z)) + +lemma continuousAt_surgeryLog {X : ℂ → ℂ} (hX : Continuous X) + {p : Bool} {a c z : ℂ} {r : ℝ} (hr : 0 < r) (hc : c ≠ 0) (hz : z ≠ a) + (hlocal : ∀ w : ℂ, ‖w-a‖ < 2*r → w ≠ a → + X w / (c*orientedDifference p a w) ∈ Complex.slitPlane) : + ContinuousAt (surgeryLog X p a c r) z := by + by_cases hb : ‖z-a‖ < 2*r + · apply (Complex.continuous_ofReal.comp (continuous_radialCutoff a r)).continuousAt.mul + apply ContinuousAt.clog + · exact hX.continuousAt.div + (continuous_const.mul (continuous_orientedDifference p a)).continuousAt + (mul_ne_zero hc (mt (orientedDifference_eq_zero p a z).mp hz)) + · exact hlocal z hb hz + · have hlt : r < ‖z-a‖ := by linarith + have he : surgeryLog X p a c r =ᶠ[𝓝 z] fun _ => 0 := by + filter_upwards [((show ContinuousAt (fun w : ℂ => ‖w-a‖) z by fun_prop).eventually + (Ioi_mem_nhds hlt))] with w hw + simp [surgeryLog, radialCutoff_zero hr (le_of_lt hw)] + exact continuousAt_const.congr he.symm + +lemma surgeryLog_eq_zero_eventually {X : ℂ → ℂ} {p : Bool} {a c z : ℂ} {r : ℝ} + (hr : 0 < r) (hz : r < ‖z-a‖) : surgeryLog X p a c r =ᶠ[𝓝 z] fun _ => 0 := by + filter_upwards [((show ContinuousAt (fun w : ℂ => ‖w-a‖) z by fun_prop).eventually + (Ioi_mem_nhds hz))] with w hw + simp [surgeryLog, radialCutoff_zero hr (le_of_lt hw)] + +def removeZero (X : ℂ → ℂ) (p : Bool) (a c : ℂ) (r : ℝ) (z : ℂ) : ℂ := by + classical + exact if z = a then c else X z / orientedDifference p a z * + Complex.exp (-surgeryLog X p a c r z) + +lemma removeZero_eq_const_near {X : ℂ → ℂ} {p : Bool} {a c z : ℂ} {r : ℝ} + (hr : 0 < r) (hc : c ≠ 0) (hz : ‖z-a‖ < r/2) + (hlocal : ∀ w : ℂ, ‖w-a‖ < 2*r → w ≠ a → + X w / (c*orientedDifference p a w) ∈ Complex.slitPlane) : + removeZero X p a c r z = c := by + classical + by_cases hza : z = a + · simp [removeZero,hza] + · have hd : orientedDifference p a z ≠ 0 := mt (orientedDifference_eq_zero p a z).mp hza + have hslit := hlocal z (by linarith) hza + have hx : X z ≠ 0 := by + intro hx + simpa [hx] using Complex.slitPlane_ne_zero hslit + simp only [removeZero, ite_eq_right hza, surgeryLog, radialCutoff_one hr hz.le, + Complex.ofReal_one, one_mul, Complex.exp_neg, + Complex.exp_log (Complex.slitPlane_ne_zero hslit)] + field_simp + +lemma continuous_removeZero {X : ℂ → ℂ} (hX : Continuous X) + {p : Bool} {a c : ℂ} {r : ℝ} (hr : 0 < r) (hc : c ≠ 0) + (hlocal : ∀ w : ℂ, ‖w-a‖ < 2*r → w ≠ a → + X w / (c*orientedDifference p a w) ∈ Complex.slitPlane) : + Continuous (removeZero X p a c r) := by + classical + apply continuous_iff_continuousAt.mpr + intro z + by_cases hz : z = a + · subst z + have he : removeZero X p a c r =ᶠ[𝓝 a] fun _ => c := by + filter_upwards [Metric.ball_mem_nhds a (by positivity : 0 < r/2)] with w hw + exact removeZero_eq_const_near hr hc (by simpa [Metric.mem_ball,dist_eq_norm] using hw) hlocal + exact continuousAt_const.congr he.symm + · have he : removeZero X p a c r =ᶠ[𝓝 z] fun w => + X w / orientedDifference p a w * Complex.exp (-surgeryLog X p a c r w) := by + filter_upwards [isClosed_singleton.isOpen_compl.mem_nhds hz] with w hw + have hwn : w ≠ a := hw + simp [removeZero,hwn] + apply ContinuousAt.congr ?_ he.symm + exact (hX.continuousAt.div (continuous_orientedDifference p a).continuousAt + (mt (orientedDifference_eq_zero p a z).mp hz)).mul + ((continuousAt_surgeryLog hX hr hc hz hlocal).neg.cexp) + +lemma removeZero_eq_zero_iff {X : ℂ → ℂ} {p : Bool} {a c z : ℂ} {r : ℝ} + (hc : c ≠ 0) : removeZero X p a c r z = 0 ↔ X z = 0 ∧ z ≠ a := by + classical + by_cases hz : z = a + · simp [removeZero,hz,hc] + · simp [removeZero,hz,div_eq_zero_iff, + mt (orientedDifference_eq_zero p a z).mp hz,Complex.exp_ne_zero] + +lemma removeZero_factorization {X : ℂ → ℂ} {p : Bool} {a c z : ℂ} {r : ℝ} + (hz : z ≠ a) : X z = orientedDifference p a z * removeZero X p a c r z * + Complex.exp (surgeryLog X p a c r z) := by + classical + have hd : orientedDifference p a z ≠ 0 := mt (orientedDifference_eq_zero p a z).mp hz + simp only [removeZero,ite_eq_right hz,Complex.exp_neg] + field_simp + +lemma exists_slit_radius_of_derivative {X : ℂ → ℂ} {a c : ℂ} {A : ℂ →L[ℝ] ℂ} + {p : Bool} (hzero : X a = 0) (hd : HasFDerivAt X A a) + {b : ℝ} (hb : b < ‖c‖) + (herr : ∀ w : ℂ, ‖A w-c*orientedDifference p 0 w‖ ≤ b*‖w‖) : + ∃ r : ℝ, 0 < r ∧ ∀ w : ℂ, ‖w-a‖ < 2*r → w ≠ a → + X w / (c*orientedDifference p a w) ∈ Complex.slitPlane := by + have hrem := (hasFDerivAt_iff_isLittleO_nhds_zero.mp hd).bound + (by linarith : 0 < (‖c‖-b)/2) + obtain ⟨δ,hδ,hbound⟩ := Metric.eventually_nhds_iff.mp hrem + refine ⟨δ/3, by positivity, fun w hw hwa => ?_⟩ + have hwn : 0 < ‖w-a‖ := norm_pos_iff.mpr (sub_ne_zero.mpr hwa) + have hremw := hbound (show dist (w-a) 0 < δ by simpa only [dist_zero_right] using (show ‖w-a‖ < δ by linarith)) + simp only [add_sub_cancel, hzero, sub_zero] at hremw + have her := herr (w-a) + have he : orientedDifference p 0 (w-a) = orientedDifference p a w := by + simp [orientedDifference] + rw [he] at her + have hlt : ‖X w-c*orientedDifference p a w‖ < ‖c*orientedDifference p a w‖ := by + calc + ‖X w-c*orientedDifference p a w‖ = + ‖(X w-A (w-a))+(A (w-a)-c*orientedDifference p a w)‖ := by congr 1; ring + _ ≤ ‖X w-A (w-a)‖+‖A (w-a)-c*orientedDifference p a w‖ := norm_add_le _ _ + _ ≤ (‖c‖-b)/2*‖w-a‖+b*‖w-a‖ := add_le_add hremw her + _ < ‖c*orientedDifference p a w‖ := by + rw [norm_mul,norm_orientedDifference] + nlinarith + have hcn : c*orientedDifference p a w ≠ 0 := + norm_pos_iff.mp ((norm_nonneg _).trans_lt hlt) + have hratio : X w/(c*orientedDifference p a w) = + 1 + (X w-c*orientedDifference p a w)/(c*orientedDifference p a w) := by + field_simp [left_ne_zero_of_mul hcn, right_ne_zero_of_mul hcn] + ring + rw [hratio] + apply Complex.mem_slitPlane_of_norm_lt_one + rw [norm_div,div_lt_one (norm_pos_iff.mpr hcn)] + exact hlt + +lemma exists_slit_radius_pos {X : ℂ → ℂ} {a : ℂ} {A : ℂ →L[ℝ] ℂ} + (hzero : X a = 0) (hd : HasFDerivAt X A a) + (hdet : 0 < LinearMap.det A.toLinearMap) : + linearPart A ≠ 0 ∧ ∃ r : ℝ, 0 < r ∧ ∀ w : ℂ, ‖w-a‖ < 2*r → w ≠ a → + X w / (linearPart A*orientedDifference true a w) ∈ Complex.slitPlane := by + have hn : ‖antiLinearPart A‖ < ‖linearPart A‖ := by + rw [det_eq_linearParts] at hdet + nlinarith [norm_nonneg (linearPart A),norm_nonneg (antiLinearPart A)] + refine ⟨norm_pos_iff.mp ((norm_nonneg _).trans_lt hn), + exists_slit_radius_of_derivative hzero hd hn ?_⟩ + intro w + simp [realLinear_decomposition,orientedDifference] + +lemma exists_slit_radius_neg {X : ℂ → ℂ} {a : ℂ} {A : ℂ →L[ℝ] ℂ} + (hzero : X a = 0) (hd : HasFDerivAt X A a) + (hdet : LinearMap.det A.toLinearMap < 0) : + antiLinearPart A ≠ 0 ∧ ∃ r : ℝ, 0 < r ∧ ∀ w : ℂ, ‖w-a‖ < 2*r → w ≠ a → + X w / (antiLinearPart A*orientedDifference false a w) ∈ Complex.slitPlane := by + have hn : ‖linearPart A‖ < ‖antiLinearPart A‖ := by + rw [det_eq_linearParts] at hdet + nlinarith [norm_nonneg (linearPart A),norm_nonneg (antiLinearPart A)] + refine ⟨norm_pos_iff.mp ((norm_nonneg _).trans_lt hn), + exists_slit_radius_of_derivative hzero hd hn ?_⟩ + intro w + simp [realLinear_decomposition,orientedDifference] + +lemma differentiable_orientedDifference (p : Bool) (a : ℂ) : + Differentiable ℝ (orientedDifference p a) := by + unfold orientedDifference + cases p <;> simp only [Bool.false_eq_true, ↓reduceIte] + · exact Complex.conjCLE.differentiable.comp (differentiable_id.sub_const a) + · exact differentiable_id.sub_const a + +lemma hasFDerivAt_removeZero_other {X : ℂ → ℂ} {p : Bool} {a b c : ℂ} {r : ℝ} + (hr : 0 < r) (hb : b ≠ a) (hzero : X b = 0) {A : ℂ →L[ℝ] ℂ} + (hX : HasFDerivAt X A b) + (hlocal : ∀ w : ℂ, ‖w-a‖ < 2*r → w ≠ a → + X w / (c*orientedDifference p a w) ∈ Complex.slitPlane) : + HasFDerivAt (removeZero X p a c r) ((orientedDifference p a b)⁻¹ • A) b := by + have hbfar : r < ‖b-a‖ := by + by_contra hn + have he := Complex.slitPlane_ne_zero (hlocal b (by linarith) hb) + simp [hzero] at he + have he : removeZero X p a c r =ᶠ[𝓝 b] fun w => X w * (orientedDifference p a w)⁻¹ := by + filter_upwards [surgeryLog_eq_zero_eventually (X := X) (p := p) (c := c) hr hbfar, + isClosed_singleton.isOpen_compl.mem_nhds hb] with w hw hwa + have hwn : w ≠ a := hwa + simp [removeZero,hwn,hw,div_eq_mul_inv] + have hdn : orientedDifference p a b ≠ 0 := mt (orientedDifference_eq_zero p a b).mp hb + have hinv := ((hasDerivAt_inv hdn).hasFDerivAt.restrictScalars ℝ).comp b + ((differentiable_orientedDifference p a b).hasFDerivAt) + have hm := hX.fun_mul hinv + simp only [hzero,zero_smul,zero_add] at hm + exact hm.congr_of_eventuallyEq he + +lemma det_complex_smul (c : ℂ) (A : ℂ →L[ℝ] ℂ) : + LinearMap.det (c • A).toLinearMap = ‖c‖^2 * LinearMap.det A.toLinearMap := by + rw [determinant_complex_real,determinant_complex_real,← Complex.normSq_eq_norm_sq] + simp only [ContinuousLinearMap.coe_coe,smul_apply,smul_eq_mul, + Complex.mul_re,Complex.mul_im,Complex.normSq_apply] + ring + +lemma windingNumber_orientedDifference (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) + (p : Bool) (a : ℂ) (ha : ∀ t, γ t ≠ a) : + windingNumber ⟨fun t => orientedDifference p a (γ t), + (continuous_orientedDifference p a).comp γ.continuous⟩ = + (if p then 1 else -1) * loopIndex γ a := by + cases p + · change windingNumber ⟨fun t => conj (γ t-a), by fun_prop⟩ = -1 * loopIndex γ a + rw [neg_one_mul] + apply windingNumber_eq_of_logIncrement (by simp [hloop]) + have hh := (windingNumber_spec ⟨fun t => γ t-a, by fun_prop⟩ + (by simp [hloop]) (fun t => sub_ne_zero.mpr (ha t))).conj + convert hh using 1 + change ((-windingNumber ⟨fun t => γ t-a, by fun_prop⟩ : ℤ) : ℂ) * + (2*Real.pi*Complex.I) = _ + simp only [Int.cast_neg, map_mul, map_intCast, map_ofNat, + Complex.conj_ofReal, Complex.conj_I] + ring + · simp only [↓reduceIte, one_mul] + rfl + +lemma windingNumber_removeZero_add {X : ℂ → ℂ} (hX : Continuous X) + {p : Bool} {a c : ℂ} {r : ℝ} (hr : 0 < r) (hc : c ≠ 0) + (hlocal : ∀ w : ℂ, ‖w-a‖ < 2*r → w ≠ a → + X w / (c*orientedDifference p a w) ∈ Complex.slitPlane) + (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) + (ha : ∀ t, γ t ≠ a) (hγ : ∀ t, X (γ t) ≠ 0) : + windingNumber ((⟨X,hX⟩ : C(ℂ,ℂ)).comp γ) = + (if p then 1 else -1)*loopIndex γ a + + windingNumber ((⟨removeZero X p a c r,continuous_removeZero hX hr hc hlocal⟩ : C(ℂ,ℂ)).comp γ) := by + let D : C(unitInterval, ℂ) := ⟨fun t => orientedDifference p a (γ t), + (continuous_orientedDifference p a).comp γ.continuous⟩ + let Y : C(unitInterval, ℂ) := + (⟨removeZero X p a c r,continuous_removeZero hX hr hc hlocal⟩ : C(ℂ,ℂ)).comp γ + let B : C(unitInterval, ℂ) := ⟨fun t => surgeryLog X p a c r (γ t), by + apply continuous_iff_continuousAt.mpr + intro t + exact (continuousAt_surgeryLog hX hr hc (ha t) hlocal).comp γ.continuous.continuousAt⟩ + let E : C(unitInterval, ℂ) := ⟨fun t => Complex.exp (B t), by fun_prop⟩ + have hE : windingNumber E = 0 := by + apply windingNumber_eq_of_logIncrement (by simp [E,B,hloop]) + simpa using (show HasLogIncrement E 0 from ⟨B,fun _ => rfl,by simp [B,hloop]⟩) + have hD : ∀ t, D t ≠ 0 := fun t => mt (orientedDifference_eq_zero p a (γ t)).mp (ha t) + have hY : ∀ t, Y t ≠ 0 := by + intro t h + exact hγ t ((removeZero_eq_zero_iff hc).mp (show removeZero X p a c r (γ t) = 0 from h)).1 + have hfact : (⟨X,hX⟩ : C(ℂ,ℂ)).comp γ = D*Y*E := by + ext t + exact removeZero_factorization (X := X) (c := c) (r := r) (p := p) (ha t) + rw [hfact, windingNumber_mul _ _ (by simp [D,Y,hloop]) (by simp [E,B,hloop]) + (fun t => mul_ne_zero (hD t) (hY t)) (fun t => Complex.exp_ne_zero _), + hE, add_zero, windingNumber_mul _ _ (by simp [D,hloop]) (by simp [Y,hloop]) hD hY] + rw [show windingNumber D = (if p then 1 else -1)*loopIndex γ a from + windingNumber_orientedDifference γ hloop p a ha] + +lemma windingNumber_comp_zero_of_nonvanishing (X : C(ℂ,ℂ)) (hX : ∀ z, X z ≠ 0) + (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) : + windingNumber (X.comp γ) = 0 := by + obtain ⟨B,hB⟩ := exists_log_lift_of_simplyConnected (0 : ℂ) X hX + apply windingNumber_eq_of_logIncrement (by simp [hloop]) + simpa using HasLogIncrement.of_global_log X B hB γ hloop + +lemma windingNumber_comp_zero_on_convex (X : C(ℂ,ℂ)) {K : Set ℂ} + (hK : Convex ℝ K) (hX : ∀ z ∈ K, X z ≠ 0) + (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) (hγ : ∀ t, γ t ∈ K) : + windingNumber (X.comp γ) = 0 := by + let := hK.contractibleSpace ⟨γ 0,hγ 0⟩ + let := hK.locallyPathConnectedSpace + let XK : C(K,ℂ) := ⟨fun z => X z, by fun_prop⟩ + obtain ⟨B,hB⟩ := exists_log_lift_of_simplyConnected (⟨γ 0,hγ 0⟩ : K) XK + (fun z => hX z z.property) + apply windingNumber_eq_of_logIncrement (by simp [hloop]) + refine ⟨⟨fun t => B ⟨γ t,hγ t⟩, by fun_prop⟩, ?_, ?_⟩ + · intro t + exact hB ⟨γ t,hγ t⟩ + · simp only [Int.cast_zero,zero_mul] + change B ⟨γ 1,hγ 1⟩-B ⟨γ 0,hγ 0⟩=0 + simp only [hloop,sub_self] + +def planeIndex (A : ℂ →L[ℝ] ℂ) : ℤ := + if 0 < LinearMap.det A.toLinearMap then 1 else -1 + +lemma planeIndex_complex_smul {c : ℂ} (hc : c ≠ 0) (A : ℂ →L[ℝ] ℂ) : + planeIndex (c • A) = planeIndex A := by + have hp : 0 < ‖c‖^2 := sq_pos_of_pos (norm_pos_iff.mpr hc) + simp only [planeIndex,det_complex_smul,mul_pos_iff_of_pos_left hp] + +theorem windingNumber_finite_regular_zeros {K : Set ℂ} (hK : Convex ℝ K) + (s : Finset ℂ) (X : C(ℂ,ℂ)) (A : ℂ → ℂ →L[ℝ] ℂ) + (hsK : ∀ z ∈ s, z ∈ K) (hzero : ∀ z ∈ K, X z = 0 ↔ z ∈ s) + (hD : ∀ z ∈ s, HasFDerivAt X (A z) z ∧ LinearMap.det (A z).toLinearMap ≠ 0) + (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) (hγK : ∀ t, γ t ∈ K) + (hγ : ∀ t, X (γ t) ≠ 0) : + windingNumber (X.comp γ) = ∑ a ∈ s, planeIndex (A a)*loopIndex γ a := by + classical + induction s using Finset.induction_on generalizing X A with + | empty => + simp only [Finset.sum_empty] + apply windingNumber_comp_zero_on_convex X hK _ γ hloop hγK + intro z hz h + exact Finset.notMem_empty z ((hzero z hz).mp h) + | @insert a s ha ih => + have ham : a ∈ insert a s := Finset.mem_insert_self a s + have haz : X a = 0 := (hzero a (hsK a ham)).mpr ham + obtain ⟨hDa,hdet⟩ := hD a ham + obtain ⟨p,c,r,hr,hc,hsign,hlocal⟩ : ∃ (p : Bool) (c : ℂ) (r : ℝ), + 0 < r ∧ c ≠ 0 ∧ (if p then (1 : ℤ) else -1) = planeIndex (A a) ∧ + ∀ w : ℂ, ‖w-a‖ < 2*r → w ≠ a → + X w/(c*orientedDifference p a w) ∈ Complex.slitPlane := by + rcases lt_or_gt_of_ne hdet with hn | hp + · obtain ⟨hc,r,hr,hl⟩ := exists_slit_radius_neg haz hDa hn + exact ⟨false,antiLinearPart (A a),r,hr,hc,by simp [planeIndex,not_lt.mpr hn.le],hl⟩ + · obtain ⟨hc,r,hr,hl⟩ := exists_slit_radius_pos haz hDa hp + exact ⟨true,linearPart (A a),r,hr,hc,by simp [planeIndex,hp],hl⟩ + let Y : C(ℂ,ℂ) := ⟨removeZero X p a c r, + continuous_removeZero X.continuous hr hc hlocal⟩ + let D : ℂ → ℂ →L[ℝ] ℂ := fun b => (orientedDifference p a b)⁻¹ • A b + have hbne (b : ℂ) (hb : b ∈ s) : b ≠ a := by + intro he + exact ha (he ▸ hb) + have hdc (b : ℂ) (hb : b ∈ s) : (orientedDifference p a b)⁻¹ ≠ 0 := + inv_ne_zero (mt (orientedDifference_eq_zero p a b).mp (hbne b hb)) + have hsK' : ∀ z ∈ s, z ∈ K := fun z hz => hsK z (Finset.mem_insert_of_mem hz) + have hYzero : ∀ z ∈ K, Y z = 0 ↔ z ∈ s := by + intro z hz + change removeZero X p a c r z = 0 ↔ _ + rw [removeZero_eq_zero_iff hc,hzero z hz,Finset.mem_insert] + constructor + · rintro ⟨h,hne⟩ + exact h.resolve_left hne + · intro h + exact ⟨Or.inr h,hbne z h⟩ + have hDY : ∀ z ∈ s, HasFDerivAt Y (D z) z ∧ LinearMap.det (D z).toLinearMap ≠ 0 := by + intro z hz + obtain ⟨hDz,hdz⟩ := hD z (Finset.mem_insert_of_mem hz) + have hzz := (hzero z (hsK' z hz)).mpr (Finset.mem_insert_of_mem hz) + refine ⟨hasFDerivAt_removeZero_other hr (hbne z hz) hzz hDz hlocal, ?_⟩ + dsimp only [D] + rw [det_complex_smul] + exact mul_ne_zero (pow_ne_zero _ (norm_ne_zero_iff.mpr (hdc z hz))) hdz + have hγa : ∀ t, γ t ≠ a := by + intro t ht + exact hγ t (ht ▸ haz) + have hγY : ∀ t, Y (γ t) ≠ 0 := by + intro t ht + exact hγ t ((removeZero_eq_zero_iff hc).mp + (show removeZero X p a c r (γ t) = 0 from ht)).1 + have hi := ih Y D hsK' hYzero hDY hγY + have hsigns : (∑ b ∈ s, planeIndex (D b)*loopIndex γ b) = + ∑ b ∈ s, planeIndex (A b)*loopIndex γ b := by + apply Finset.sum_congr rfl + intro b hb + dsimp only [D] + rw [planeIndex_complex_smul (hdc b hb)] + rw [Finset.sum_insert ha] + have hrem := windingNumber_removeZero_add X.continuous hr hc hlocal γ hloop hγa hγ + change windingNumber (X.comp γ) = (if p then (1 : ℤ) else -1)*loopIndex γ a + + windingNumber (Y.comp γ) at hrem + rw [hrem,hsign,hi,hsigns] + +lemma exists_countable_injective_partition {f : ℂ → ℂ} {s : Set ℂ} + (hs : MeasurableSet s) (hf : ∀ z ∈ s, ContDiffAt ℝ 1 f z) + (hreg : ∀ z ∈ s, LinearMap.det (fderiv ℝ f z).toLinearMap ≠ 0) : + ∃ p : ℕ → Set ℂ, (∀ n, MeasurableSet (p n)) ∧ + Pairwise (Disjoint on p) ∧ (⋃ n, p n) = s ∧ ∀ n, InjOn f (p n) := by + classical + have hlocal (z : s) : ∃ U : Set ℂ, IsOpen U ∧ (z : ℂ) ∈ U ∧ InjOn f U := by + let e : ℂ ≃L[ℝ] ℂ := + (LinearMap.equivOfIsUnitDet (isUnit_iff_ne_zero.mpr (hreg z z.2))).toContinuousLinearEquiv + have he : (e : ℂ →L[ℝ] ℂ) = fderiv ℝ f z := by + ext v + exact LinearMap.equivOfIsUnitDet_apply (isUnit_iff_ne_zero.mpr (hreg z z.2)) v + have hd := (hf z z.2).hasStrictFDerivAt (by norm_num) + rw [← he] at hd + let e' := hd.toOpenPartialHomeomorph f + exact ⟨e'.source,e'.open_source,hd.mem_toOpenPartialHomeomorph_source,e'.injOn⟩ + choose U hUo hUz hUi using hlocal + by_cases he : s = ∅ + · subst s + exact ⟨fun _ => ∅,by simp,by simp [Pairwise],by simp,by simp⟩ + · have : Nonempty s := Set.nonempty_coe_sort.mpr (Set.nonempty_iff_ne_empty.mpr he) + obtain ⟨j,hj⟩ := (show IsLindelof s from HereditarilyLindelofSpace.isLindelof s).indexed_countable_subcover + U hUo (fun z hz => mem_iUnion.mpr ⟨⟨z,hz⟩,hUz ⟨z,hz⟩⟩) + let q : ℕ → Set ℂ := fun n => s ∩ U (j n) + refine ⟨disjointed q,?_,?_,?_,?_⟩ + · intro n + exact MeasurableSet.disjointed (fun n => hs.inter (hUo (j n)).measurableSet) n + · exact disjoint_disjointed q + · rw [iUnion_disjointed] + ext z + simp only [mem_iUnion,mem_inter_iff,q] + exact ⟨fun ⟨_,hz,_⟩ => hz,fun hz => by obtain ⟨n,hn⟩ := mem_iUnion.mp (hj hz); exact ⟨n,hz,hn⟩⟩ + · intro n + exact (hUi (j n)).mono ((disjointed_subset q n).trans inter_subset_right) + +def fiberMultiplicity (f : ℂ → ℂ) (s : Set ℂ) (w : ℂ) : ℝ≥0∞ := + Measure.count {z | z ∈ s ∧ f z = w} + +lemma fiber_subsingleton_of_injOn {f : ℂ → ℂ} {s : Set ℂ} (hf : InjOn f s) (w : ℂ) : + ({z | z ∈ s ∧ f z = w} : Set ℂ).Subsingleton := by + intro z hz z' hz' + exact hf hz.1 hz'.1 (hz.2.trans hz'.2.symm) + +lemma fiberMultiplicity_of_injOn {f : ℂ → ℂ} {s : Set ℂ} (hf : InjOn f s) (w : ℂ) : + fiberMultiplicity f s w = (f '' s).indicator (fun _ => (1 : ℝ≥0∞)) w := by + classical + by_cases hw : w ∈ f '' s + · obtain ⟨z,hz,rfl⟩ := hw + have he : {a | a ∈ s ∧ f a = f z} = {z} := by + ext a + exact ⟨fun h => hf h.1 hz h.2,fun h => by rcases h with rfl; exact ⟨hz,rfl⟩⟩ + rw [fiberMultiplicity,he,Measure.count_singleton,indicator_of_mem (mem_image_of_mem f hz)] + · have he : {a | a ∈ s ∧ f a = w} = ∅ := by + ext a + exact ⟨fun h => (hw ⟨a,h.1,h.2⟩).elim,False.elim⟩ + simp [fiberMultiplicity,he,hw] + +lemma fiberMultiplicity_partition {f : ℂ → ℂ} {s : Set ℂ} {p : ℕ → Set ℂ} + (hd : Pairwise (Disjoint on p)) (hu : (⋃ n, p n) = s) (hi : ∀ n, InjOn f (p n)) + (w : ℂ) : fiberMultiplicity f s w = + ∑' n, (f '' p n).indicator (fun _ => (1 : ℝ≥0∞)) w := by + have he : {z | z ∈ s ∧ f z = w} = ⋃ n, {z | z ∈ p n ∧ f z = w} := by + rw [← hu] + ext z + simp only [mem_ofPred_eq,mem_iUnion] + aesop + rw [fiberMultiplicity,he,measure_iUnion] + · exact tsum_congr (fun n => fiberMultiplicity_of_injOn (hi n) w) + · exact pairwise_disjoint_mono hd (fun n => inter_subset_left) + · intro n + exact (fiber_subsingleton_of_injOn (hi n) w).finite.measurableSet + +lemma area_formula_regular {f : ℂ → ℂ} {s : Set ℂ} + (hs : MeasurableSet s) (hf : ∀ z ∈ s, ContDiffAt ℝ 1 f z) + (hreg : ∀ z ∈ s, LinearMap.det (fderiv ℝ f z).toLinearMap ≠ 0) : + Measurable (fiberMultiplicity f s) ∧ + (∫⁻ z in s, ENNReal.ofReal |LinearMap.det (fderiv ℝ f z).toLinearMap| ∂volume) = + ∫⁻ w, fiberMultiplicity f s w ∂volume := by + obtain ⟨p,hpm,hpd,hpu,hpi⟩ := exists_countable_injective_partition hs hf hreg + have hps (n) : p n ⊆ s := hpu ▸ subset_iUnion p n + have hder (n) (z) (hz : z ∈ p n) : HasFDerivWithinAt f (fderiv ℝ f z) (p n) z := + ((hf z (hps n hz)).differentiableAt (by norm_num)).hasFDerivAt.hasFDerivWithinAt + have him (n) : MeasurableSet (f '' p n) := + measurable_image_of_fderivWithin (hpm n) (hder n) (hpi n) + have he := funext (fiberMultiplicity_partition hpd hpu hpi) + refine ⟨?_,?_⟩ + · rw [he] + exact Measurable.tsum (fun n => measurable_const.indicator (him n)) + · calc + (∫⁻ z in s, ENNReal.ofReal |LinearMap.det (fderiv ℝ f z).toLinearMap| ∂volume) = + ∑' n, ∫⁻ z in p n, ENNReal.ofReal |LinearMap.det (fderiv ℝ f z).toLinearMap| ∂volume := by + conv_lhs => rw [← hpu] + exact lintegral_iUnion hpm hpd _ + _ = ∑' n, volume (f '' p n) := tsum_congr (fun n => + lintegral_abs_det_fderiv_eq_addHaar_image volume (hpm n) (hder n) (hpi n)) + _ = ∫⁻ w, fiberMultiplicity f s w ∂volume := by + rw [he,lintegral_tsum] + · apply tsum_congr + intro n + rw [lintegral_indicator (him n)] + simp + · exact fun n => (measurable_const.indicator (him n)).aemeasurable + +lemma lintegral_positive_part_eq {g : ℂ → ℝ} (hg : Measurable g) (s : Set ℂ) : + (∫⁻ z in s, ENNReal.ofReal (g z) ∂volume) = + ∫⁻ z in {z | z ∈ s ∧ 0 < g z}, ENNReal.ofReal |g z| ∂volume := by + classical + have hm : MeasurableSet {z | 0 < g z} := measurableSet_lt measurable_const hg + have he : (fun z => ENNReal.ofReal (g z)) = + {z | 0 < g z}.indicator (fun z => ENNReal.ofReal |g z|) := by + funext z + by_cases hz : 0 < g z + · simp [hz,abs_of_pos hz] + · simp [hz,ENNReal.ofReal_eq_zero.mpr (le_of_not_gt hz)] + rw [he,lintegral_indicator hm,Measure.restrict_restrict hm] + exact congrArg (fun t : Set ℂ => ∫⁻ z in t, ENNReal.ofReal |g z| ∂volume) (inter_comm _ _) + +lemma integral_det_nonpos_of_fiberMultiplicity {f : ℂ → ℂ} {s : Set ℂ} + (hs : MeasurableSet s) (hf : ContDiff ℝ 1 f) + (hj : IntegrableOn (fun z => LinearMap.det (fderiv ℝ f z).toLinearMap) s volume) + (hcount : ∀ᵐ w ∂volume, + fiberMultiplicity f {z | z ∈ s ∧ 0 < LinearMap.det (fderiv ℝ f z).toLinearMap} w ≤ + fiberMultiplicity f {z | z ∈ s ∧ LinearMap.det (fderiv ℝ f z).toLinearMap < 0} w) : + ∫ z in s, LinearMap.det (fderiv ℝ f z).toLinearMap ∂volume ≤ 0 := by + let J : ℂ → ℝ := fun z => LinearMap.det (fderiv ℝ f z).toLinearMap + have hJ : Continuous J := ContinuousLinearMap.continuous_det.comp + (hf.continuous_fderiv (by norm_num)) + have hp : MeasurableSet {z | z ∈ s ∧ 0 < J z} := + hs.inter (measurableSet_lt measurable_const hJ.measurable) + have hm : MeasurableSet {z | z ∈ s ∧ J z < 0} := + hs.inter (measurableSet_lt hJ.measurable measurable_const) + have hap := (area_formula_regular hp (fun z _ => hf.contDiffAt) + (fun z hz => ne_of_gt hz.2)).2 + have ham := (area_formula_regular hm (fun z _ => hf.contDiffAt) + (fun z hz => ne_of_lt hz.2)).2 + have hle : (∫⁻ z in s, ENNReal.ofReal (J z) ∂volume) ≤ + ∫⁻ z in s, ENNReal.ofReal (-J z) ∂volume := by + rw [lintegral_positive_part_eq hJ.measurable,lintegral_positive_part_eq (g := fun z => -J z) hJ.neg.measurable] + simp only [neg_pos,abs_neg] + rw [hap,ham] + exact lintegral_mono_ae hcount + rw [integral_eq_lintegral_pos_part_sub_lintegral_neg_part hj] + exact sub_nonpos.mpr (ENNReal.toReal_mono (by + exact (lt_of_le_of_lt (lintegral_ofReal_le_lintegral_enorm _) hj.neg.2).ne) hle) + +lemma finite_regular_zeros_on_compact {K : Set ℂ} (hK : IsCompact K) + {X : ℂ → ℂ} (hc : ContinuousOn X K) + (hd : ∀ z ∈ K, X z = 0 → DifferentiableAt ℝ X z ∧ + LinearMap.det (fderiv ℝ X z).toLinearMap ≠ 0) : + {z | z ∈ K ∧ X z = 0}.Finite := by + have hZ : IsCompact {z | z ∈ K ∧ X z = 0} := + hK.of_isClosed_subset (hc.preimage_isClosed_of_isClosed hK.isClosed isClosed_singleton) + inter_subset_left + apply hZ.finite + rw [isDiscrete_iff_nhdsNE] + intro z hz + obtain ⟨hzD,hzd⟩ := hd z hz.1 hz.2 + let e : ℂ ≃L[ℝ] ℂ := + (LinearMap.equivOfIsUnitDet (isUnit_iff_ne_zero.mpr hzd)).toContinuousLinearEquiv + have he : (e : ℂ → ℂ) = fderiv ℝ X z := by + funext w + exact LinearMap.equivOfIsUnitDet_apply (isUnit_iff_ne_zero.mpr hzd) w + have ha : ∃ C, AntilipschitzWith C (fderiv ℝ X z) := by + rw [← he] + exact ⟨_,e.antilipschitz⟩ + rw [Filter.inf_principal_eq_bot] + filter_upwards [hzD.hasFDerivAt.eventually_ne ha] with w hw + exact fun h => hw (h.2.trans hz.2.symm) + +lemma loopIndex_circle_inside {r : ℝ} (hr : 0 < r) {a : ℂ} (ha : ‖a‖ < r) : + loopIndex ((r : ℂ) • circleLoop) a = 1 := by + let γ : C(unitInterval,ℂ) := (r : ℂ) • circleLoop + have hγloop : γ 1 = γ 0 := by simp [γ] + have hγnorm (t) : ‖γ t‖ = r := by simp [γ,abs_of_pos hr] + have hγne (t) : γ t ≠ 0 := norm_pos_iff.mp (by rw [hγnorm]; exact hr) + have hwone : windingNumber γ = 1 := by + apply windingNumber_eq_of_logIncrement hγloop + simpa using circleLoop_logIncrement (r : ℂ) (by exact_mod_cast hr.ne') + unfold loopIndex + rw [← hwone] + apply windingNumber_perturb hγloop (by simp) hγne + intro t + simpa [γ,sub_sub_cancel_left,abs_of_pos hr] using ha + +lemma ae_regular_value {f : ℂ → ℂ} (hf : Differentiable ℝ f) : + ∀ᵐ w ∂volume, ∀ z, f z = w → LinearMap.det (fderiv ℝ f z).toLinearMap ≠ 0 := by + have hm : volume (f '' {z | LinearMap.det (fderiv ℝ f z).toLinearMap = 0}) = 0 := + addHaar_image_eq_zero_of_det_fderivWithin_eq_zero volume + (fun z _ => (hf z).hasFDerivAt.hasFDerivWithinAt) (fun _ h => h) + have ha : ∀ᵐ w ∂volume, w ∉ f '' {z | LinearMap.det (fderiv ℝ f z).toLinearMap = 0} := + ae_iff.mpr (by simpa only [not_not,Set.ofPred_mem_eq] using hm) + filter_upwards [ha] with w hw z hz hd + exact hw ⟨z,hd,hz⟩ + +lemma signed_sum_eq_card_sub (s : Finset ℂ) (J : ℂ → ℝ) + (hJ : ∀ z ∈ s, J z ≠ 0) : + (∑ z ∈ s, if 0 < J z then (1 : ℤ) else -1) = + (s.filter (fun z => 0 < J z)).card - (s.filter (fun z => J z < 0)).card := by + classical + rw [← Finset.sum_boole (R := ℤ) (fun z => 0 < J z) s, + ← Finset.sum_boole (R := ℤ) (fun z => J z < 0) s,← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro z hz + rcases lt_or_gt_of_ne (hJ z hz) with hn | hp + · simp [hn,not_lt.mpr hn.le] + · simp [hp,not_lt.mpr hp.le] + +lemma integral_jacobian_nonpos_of_boundary_winding {f : ℂ → ℂ} (hf : ContDiff ℝ 1 f) + {r : ℝ} (hr : 0 < r) + (hw : ∀ ξ, ξ ∉ f '' Metric.sphere 0 r → + windingNumber (⟨fun t => f ((r : ℂ)*circleLoop t)-ξ, by fun_prop⟩) ≤ 0) : + ∫ z in Metric.closedBall 0 r, LinearMap.det (fderiv ℝ f z).toLinearMap ∂volume ≤ 0 := by + classical + let J : ℂ → ℝ := fun z => LinearMap.det (fderiv ℝ f z).toLinearMap + have hJc : Continuous J := ContinuousLinearMap.continuous_det.comp + (hf.continuous_fderiv (by norm_num)) + have hd := hf.differentiable (by norm_num) + have hbnull : volume (f '' Metric.sphere 0 r) = 0 := + addHaar_image_eq_zero_of_differentiableOn_of_addHaar_eq_zero volume + hd.differentiableOn (Measure.addHaar_sphere volume 0 r) + apply integral_det_nonpos_of_fiberMultiplicity measurableSet_closedBall hf + (hJc.continuousOn.integrableOn_compact (isCompact_closedBall 0 r)) + filter_upwards [ae_regular_value hd,show ∀ᵐ ξ ∂volume, ξ ∉ f '' Metric.sphere 0 r from + ae_iff.mpr (by simpa only [not_not,Set.ofPred_mem_eq] using hbnull)] with ξ hξ hξb + let X : C(ℂ,ℂ) := ⟨fun z => f z-ξ,by fun_prop⟩ + have hXD (z) : HasFDerivAt X (fderiv ℝ f z) z := (hd z).hasFDerivAt.sub_const ξ + have hfinite : {z | z ∈ Metric.closedBall 0 r ∧ X z = 0}.Finite := + finite_regular_zeros_on_compact (isCompact_closedBall 0 r) X.continuous.continuousOn + (fun z _ hz => ⟨(hXD z).differentiableAt,by + rw [(hXD z).fderiv]; exact hξ z (sub_eq_zero.mp hz)⟩) + let s := hfinite.toFinset + have hs (z) : z ∈ s ↔ z ∈ Metric.closedBall 0 r ∧ f z = ξ := by + simp [s,X,sub_eq_zero] + have hinside (z) (hz : z ∈ s) : ‖z‖ < r := by + have hz' := (hs z).mp hz + have hle : ‖z‖ ≤ r := by simpa using hz'.1 + apply lt_of_le_of_ne hle + intro he + exact hξb ⟨z,by simpa using he,hz'.2⟩ + let γ : C(unitInterval,ℂ) := (r : ℂ) • circleLoop + have hγnorm (t) : ‖γ t‖ = r := by simp [γ,abs_of_pos hr] + have hγsphere (t) : γ t ∈ Metric.sphere 0 r := by simpa using hγnorm t + have hγzero (t) : X (γ t) ≠ 0 := by + intro he + exact hξb ⟨γ t,hγsphere t,sub_eq_zero.mp he⟩ + have hreg (z) (hz : z ∈ s) : J z ≠ 0 := hξ z ((hs z).mp hz).2 + have hindex := windingNumber_finite_regular_zeros (convex_closedBall (0 : ℂ) r) s X + (fun z => fderiv ℝ f z) (fun z hz => ((hs z).mp hz).1) + (fun z hz => by simp [hs,hz,X,sub_eq_zero]) + (fun z hz => ⟨hXD z,hreg z hz⟩) γ (by simp [γ]) + (fun t => Metric.sphere_subset_closedBall (hγsphere t)) hγzero + have hloopindex (z) (hz : z ∈ s) : loopIndex γ z = 1 := + loopIndex_circle_inside hr (hinside z hz) + have hsign : (∑ z ∈ s, if 0 < J z then (1 : ℤ) else -1) ≤ 0 := by + calc + _ = windingNumber (X.comp γ) := by + rw [hindex] + apply Finset.sum_congr rfl + intro z hz + rw [hloopindex z hz,mul_one] + rfl + _ ≤ 0 := hw ξ hξb + have hcard : (s.filter (fun z => 0 < J z)).card ≤ (s.filter (fun z => J z < 0)).card := by + rw [signed_sum_eq_card_sub s J hreg] at hsign + exact_mod_cast sub_nonpos.mp hsign + have hp : {z | z ∈ {z | z ∈ Metric.closedBall 0 r ∧ 0 < J z} ∧ f z = ξ} = + ↑(s.filter (fun z => 0 < J z)) := by ext z; simp [hs]; aesop + have hn : {z | z ∈ {z | z ∈ Metric.closedBall 0 r ∧ J z < 0} ∧ f z = ξ} = + ↑(s.filter (fun z => J z < 0)) := by ext z; simp [hs]; aesop + change fiberMultiplicity f {z | z ∈ Metric.closedBall 0 r ∧ 0 < J z} ξ ≤ + fiberMultiplicity f {z | z ∈ Metric.closedBall 0 r ∧ J z < 0} ξ + simp only [fiberMultiplicity,hp,hn,Measure.count_apply_finset] + exact_mod_cast hcard + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/Distortion.lean b/lean/OAI/Analysis/IntegralMeans/Distortion.lean new file mode 100644 index 0000000000000000000000000000000000000000..2cf9998330a61582c2e6b724990be889164e5420 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/Distortion.lean @@ -0,0 +1,983 @@ +import OAI.Analysis.IntegralMeans.UnivalentArea + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +lemma polar_symm_eq_circleMap (r θ : ℝ) : + Complex.polarCoord.symm (r,θ) = circleMap 0 r θ := by + rw [Complex.polarCoord_symm_apply, circleMap, zero_add] + congr 1 + rw [Complex.exp_mul_I] + simp + +lemma circleAverage_eq_integral_neg_pi (f : ℂ → ℂ) (c : ℂ) (r : ℝ) : + Real.circleAverage f c r = + (2*Real.pi)⁻¹ • ∫ θ in -Real.pi..Real.pi, f (circleMap c r θ) := by + rw [Real.circleAverage_eq_integral_add (-Real.pi)] + rw [intervalIntegral.integral_comp_add_right (fun θ => f (circleMap c r θ))] + congr 2 <;> ring + +lemma integral_ball_polar {f : ℂ → ℂ} {R : ℝ} (hR : 0 < R) + (hf : ContinuousOn f (Metric.closedBall 0 R)) : + ∫ z in Metric.ball (0 : ℂ) R, f z = + ∫ r in (0 : ℝ)..R, (2*Real.pi*r) • Real.circleAverage f 0 r := by + let g : ℝ × ℝ → ℂ := fun p => p.1 • f (Complex.polarCoord.symm p) + have hg : IntegrableOn g (Ioo (0 : ℝ) R ×ˢ Ioo (-Real.pi) Real.pi) := by + refine (show IntegrableOn g (Icc (0 : ℝ) R ×ˢ Icc (-Real.pi) Real.pi) from ?_).mono_set ?_ + · apply ContinuousOn.integrableOn_compact (isCompact_Icc.prod isCompact_Icc) + have hpolar : Continuous (fun p : ℝ × ℝ => Complex.polarCoord.symm p) := by + simp only [Complex.polarCoord_symm_apply] + fun_prop + apply continuousOn_fst.smul (hf.comp hpolar.continuousOn ?_) + intro p hp + simp only [Metric.mem_closedBall, dist_zero_right, Complex.norm_polarCoord_symm] + exact (abs_of_nonneg hp.1.1).trans_le hp.1.2 + · exact prod_mono Ioo_subset_Icc_self Ioo_subset_Icc_self + calc + _ = ∫ p in polarCoord.target, + p.1 • (Metric.ball (0 : ℂ) R).indicator f (Complex.polarCoord.symm p) := by + rw [Complex.integral_comp_polarCoord_symm, + integral_indicator Metric.isOpen_ball.measurableSet] + _ = ∫ p in Ioo (0 : ℝ) R ×ˢ Ioo (-Real.pi) Real.pi, g p := by + rw [polarCoord_target] + have heq : (fun p : ℝ × ℝ => p.1 • + (Metric.ball (0 : ℂ) R).indicator f (Complex.polarCoord.symm p)) =ᶠ[ + ae (volume.restrict (Ioi (0 : ℝ) ×ˢ Ioo (-Real.pi) Real.pi))] + (Iio R ×ˢ (univ : Set ℝ)).indicator g := by + filter_upwards [ae_restrict_mem (measurableSet_Ioi.prod measurableSet_Ioo)] with p hp + have hp0 : 0 < p.1 := hp.1 + have hn : ‖Complex.polarCoord.symm p‖ = p.1 := by + rw [Complex.norm_polarCoord_symm,abs_of_pos hp0] + by_cases hr : p.1 < R + · rw [indicator_of_mem (by simpa [Metric.mem_ball,dist_zero_right,Complex.norm_polarCoord_symm,abs_of_pos hp0] using hr), + indicator_of_mem (show p ∈ Iio R ×ˢ (univ : Set ℝ) from ⟨hr,mem_univ _⟩)] + · rw [indicator_of_notMem (by simpa [Metric.mem_ball,dist_zero_right,Complex.norm_polarCoord_symm,abs_of_pos hp0] using hr), + indicator_of_notMem (show p ∉ Iio R ×ˢ (univ : Set ℝ) from fun h => hr h.1),smul_zero] + rw [integral_congr_ae heq, + integral_indicator (measurableSet_Iio.prod MeasurableSet.univ)] + rw [Measure.restrict_restrict (measurableSet_Iio.prod MeasurableSet.univ)] + congr 2 + ext p + simp only [mem_inter_iff, mem_prod, mem_Ioi, mem_Iio, mem_Ioo, mem_univ, and_true] + tauto + _ = ∫ r in Ioo (0 : ℝ) R, ∫ θ in Ioo (-Real.pi) Real.pi, g (r,θ) := by + exact setIntegral_prod _ (by simpa only [← Measure.volume_eq_prod] using hg) + _ = ∫ r in (0 : ℝ)..R, (2*Real.pi*r) • Real.circleAverage f 0 r := by + rw [intervalIntegral.integral_of_le hR.le, integral_Ioc_eq_integral_Ioo] + apply setIntegral_congr_fun measurableSet_Ioo + intro r hr + dsimp only + rw [circleAverage_eq_integral_neg_pi, + intervalIntegral.integral_of_le (neg_le_self Real.pi_pos.le), + integral_Ioc_eq_integral_Ioo, ← smul_assoc] + have he : (2*Real.pi*r) * (2*Real.pi)⁻¹ = r := by + field_simp + rw [smul_eq_mul, he, ← integral_smul] + apply setIntegral_congr_fun measurableSet_Ioo + intro θ hθ + simp only [g, polar_symm_eq_circleMap] + +lemma ball_closedBall_ae_eq (r : ℝ) : + Metric.ball (0 : ℂ) r =ᵐ[volume] Metric.closedBall 0 r := by + apply ae_eq_set.mpr + constructor + · rw [sdiff_eq_empty.mpr Metric.ball_subset_closedBall,measure_empty] + · rw [Metric.closedBall_sdiff_ball] + exact Measure.addHaar_sphere volume 0 r + +lemma integral_ball_holomorphic {f : ℂ → ℂ} {R r : ℝ} + (hf : DifferentiableOn ℂ f (Metric.ball (0 : ℂ) R)) + (hr : 0 < r) (hrR : r < R) : + ∫ z in Metric.ball (0 : ℂ) r, f z = volume.real (Metric.ball (0 : ℂ) r) • f 0 := by + have hfc : ContinuousOn f (Metric.closedBall 0 r) := + hf.continuousOn.mono (Metric.closedBall_subset_ball hrR) + rw [integral_ball_polar hr hfc] + have hm (t : ℝ) (ht : t ∈ Ioo 0 r) : Real.circleAverage f 0 t = f 0 := by + apply DiffContOnCl.circleAverage + rw [abs_of_pos ht.1] + apply DifferentiableOn.diffContOnCl + rw [closure_ball 0 ht.1.ne'] + exact hf.mono (Metric.closedBall_subset_ball (ht.2.trans hrR)) + have hc := integral_ball_polar (f := fun _ : ℂ => f 0) hr continuousOn_const + rw [setIntegral_const] at hc + rw [hc] + apply intervalIntegral.integral_congr + intro t ht + rw [uIcc_of_le hr.le] at ht + by_cases ht0 : t = 0 + · simp [ht0] + have htpos : 0 < t := lt_of_le_of_ne ht.1 (Ne.symm ht0) + have ht' : t ∈ Ioo 0 r ∨ t = r := by + exact (lt_or_eq_of_le ht.2).elim (fun h => Or.inl ⟨htpos,h⟩) Or.inr + have hmf : Real.circleAverage f 0 t = f 0 := by + rcases ht' with ht' | rfl + · exact hm t ht' + · apply DiffContOnCl.circleAverage + rw [abs_of_pos hr] + apply DifferentiableOn.diffContOnCl + rw [closure_ball 0 hr.ne'] + exact hf.mono (Metric.closedBall_subset_ball hrR) + simp only [hmf,Real.circleAverage_const] + +lemma integral_closedBall_holomorphic {f : ℂ → ℂ} {R r : ℝ} + (hf : DifferentiableOn ℂ f (Metric.ball (0 : ℂ) R)) + (hr : 0 < r) (hrR : r < R) : + ∫ z in Metric.closedBall (0 : ℂ) r, f z = + volume.real (Metric.closedBall (0 : ℂ) r) • f 0 := by + rw [← setIntegral_congr_set (ball_closedBall_ae_eq r), + integral_ball_holomorphic hf hr hrR] + congr 1 + exact congrArg ENNReal.toReal (measure_congr (ball_closedBall_ae_eq r)) + +lemma holomorphic_sq_submean {f : ℂ → ℂ} {R r : ℝ} + (hf : DifferentiableOn ℂ f (Metric.ball (0 : ℂ) R)) + (hr : 0 < r) (hrR : r < R) : + volume.real (Metric.closedBall (0 : ℂ) r) * ‖f 0‖^2 ≤ + ∫ z in Metric.closedBall (0 : ℂ) r, ‖f z‖^2 := by + let K : Set ℂ := Metric.closedBall 0 r + have hfc : ContinuousOn f K := hf.continuousOn.mono (Metric.closedBall_subset_ball hrR) + have hfi : IntegrableOn f K := hfc.integrableOn_compact (isCompact_closedBall 0 r) + have hf2i : IntegrableOn (fun z => ‖f z‖^2) K := + (hfc.norm.pow 2).integrableOn_compact (isCompact_closedBall 0 r) + have hconst : IntegrableOn (fun _ : ℂ => ‖f 0‖^2) K := + integrableOn_const (isCompact_closedBall 0 r).measure_ne_top + have hnonneg : 0 ≤ ∫ z in K, ‖f z-f 0‖^2 := integral_nonneg (fun _ => sq_nonneg _) + have he : (fun z => ‖f z-f 0‖^2) = + (fun z => ‖f z‖^2-2*inner ℝ (f 0) (f z)+‖f 0‖^2) := by + funext z + rw [norm_sub_sq_real,real_inner_comm] + have hsub : IntegrableOn (fun z => ‖f z‖^2-2*inner ℝ (f 0) (f z)) K := + hf2i.sub ((hfi.const_inner (f 0)).const_mul 2) + have hinner : IntegrableOn (fun z => 2*inner ℝ (f 0) (f z)) K := + (hfi.const_inner (f 0)).const_mul 2 + rw [he,integral_add hsub hconst, + integral_sub hf2i hinner, + integral_const_mul,integral_inner hfi,setIntegral_const, + integral_closedBall_holomorphic hf hr hrR,real_inner_smul_right, + real_inner_self_eq_norm_sq,smul_eq_mul] at hnonneg + dsimp only [K] at hnonneg ⊢ + linarith + +lemma meromorphic_univalent_coefficient {h H : ℂ → ℂ} + (hh : DifferentiableOn ℂ h (Metric.ball 0 1)) + (hH : DifferentiableOn ℂ H (Metric.ball 0 1 \ {0})) + (hdef : ∀ z ∈ Metric.ball (0 : ℂ) 1, z ≠ 0 → H z = z⁻¹+h z) + (hHd : ∀ z ∈ Metric.ball (0 : ℂ) 1 \ {0}, deriv H z ≠ 0) + (hHi : InjOn H (Metric.ball 0 1 \ {0})) : ‖deriv h 0‖ ≤ 1 := by + have hb (r : ℝ) (hr : 0 < r) (hr1 : r < 1) : ‖deriv h 0‖^2 ≤ (r^2)⁻¹^2 := by + have hM : 0 < volume.real (Metric.closedBall (0 : ℂ) r) := by + rw [measureReal_def,Complex.volume_closedBall,ENNReal.toReal_mul,ENNReal.toReal_pow, + ENNReal.toReal_ofReal hr.le,ENNReal.coe_toReal] + exact mul_pos (sq_pos_of_pos hr) Real.pi_pos + have hle := (holomorphic_sq_submean (hh.deriv Metric.isOpen_ball) hr hr1).trans + (meromorphic_univalent_area hh hH hdef hHd hHi hr hr1) + nlinarith + have ht : Tendsto (fun r : ℝ => (r^2)⁻¹^2) (𝓝[<] (1 : ℝ)) (𝓝 1) := by + have hc : ContinuousAt (fun r : ℝ => (r^2)⁻¹^2) 1 := + ((continuousAt_id.pow 2).inv₀ (by norm_num)).pow 2 + simpa using hc.tendsto.mono_left nhdsWithin_le_nhds + have hsq : ‖deriv h 0‖^2 ≤ 1 := by + apply ge_of_tendsto ht + filter_upwards [self_mem_nhdsWithin, + (show ∀ᶠ r : ℝ in 𝓝[<] (1 : ℝ), 0 < r from + nhdsWithin_le_nhds (Ioi_mem_nhds (by norm_num : (0 : ℝ)<1)))] with r hr1 hr + exact hb r hr hr1 + nlinarith [norm_nonneg (deriv h 0)] + +lemma nonconstant_germ_of_injOn {f : ℂ → ℂ} {U : Set ℂ} + (hU : IsOpen U) (hf : Set.InjOn f U) {a : ℂ} (ha : a ∈ U) : + ¬ ∀ᶠ z in 𝓝 a, f z = f a := by + intro hc + have heq : ∀ᶠ z in 𝓝 a, z = a := by + filter_upwards [hc, hU.mem_nhds ha] with z hz hzU + exact hf hzU ha hz + have heq' : ∀ᶠ z in 𝓝[≠] a, z = a := heq.filter_mono nhdsWithin_le_nhds + have hne' : ∀ᶠ z in 𝓝[≠] a, z ≠ a := self_mem_nhdsWithin + obtain ⟨z, hz, hne⟩ := (heq'.and hne').exists + exact hne hz + +lemma univalent_inverse_continuousAt {f : ℂ → ℂ} {U : Set ℂ} + (hU : IsOpen U) (hf : UnivalentOn f U) {a : ℂ} (ha : a ∈ U) : + ContinuousAt (Function.invFunOn f U) (f a) := by + have haan : AnalyticAt ℂ f a := (hf.1.analyticOnNhd hU) a ha + have hopen : 𝓝 (f a) ≤ Filter.map f (𝓝 a) := + haan.eventually_constant_or_nhds_le_map_nhds.resolve_left + (nonconstant_germ_of_injOn hU hf.2 ha) + have hl : ∀ᶠ z in 𝓝 a, Function.invFunOn f U (f z) = z := by + filter_upwards [hU.mem_nhds ha] with z hz + exact hf.2.leftInvOn_invFunOn hz + have ht : Tendsto (Function.invFunOn f U ∘ f) (𝓝 a) (𝓝 a) := + tendsto_id.congr' (Filter.EventuallyEq.symm hl) + rw [ContinuousAt, hf.2.leftInvOn_invFunOn ha] + exact (tendsto_map'_iff.mpr ht).mono_left hopen + +lemma univalent_deriv_ne_zero {f : ℂ → ℂ} {U : Set ℂ} + (hU : IsOpen U) (hf : UnivalentOn f U) {a : ℂ} (ha : a ∈ U) : + deriv f a ≠ 0 := by + have han : AnalyticAt ℂ f a := hf.1.analyticOnNhd hU a ha + have hd_nonconst : ¬ ∀ᶠ z in 𝓝 a, deriv f z = 0 := by + intro hc + obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp (hc.and (hU.mem_nhds ha)) + have hfball : DifferentiableOn ℂ f (Metric.ball a r) := + hf.1.mono (fun z hz => (hball hz).2) + have hcball : ∀ z ∈ Metric.ball a r, f z = f a := by + intro z hz + exact Metric.isOpen_ball.is_const_of_deriv_eq_zero (convex_ball a r).isPreconnected + hfball (fun w hw => (hball hw).1) hz (Metric.mem_ball_self hr) + apply nonconstant_germ_of_injOn hU hf.2 ha + filter_upwards [Metric.ball_mem_nhds a hr] with z hz + exact hcball z hz + have hd : ∀ᶠ z in 𝓝[≠] a, deriv f z ≠ 0 := + han.deriv.eventually_eq_zero_or_eventually_ne_zero.resolve_left hd_nonconst + let g := Function.invFunOn f U + have hgc : ContinuousAt g (f a) := univalent_inverse_continuousAt hU hf ha + have hga : g (f a) = a := hf.2.leftInvOn_invFunOn ha + have hopen : 𝓝 (f a) ≤ Filter.map f (𝓝 a) := + han.eventually_constant_or_nhds_le_map_nhds.resolve_left + (nonconstant_germ_of_injOn hU hf.2 ha) + have hright : ∀ᶠ w in 𝓝 (f a), g w ∈ U ∧ f (g w) = w := by + apply (hopen (Filter.mem_map.mpr ?_)) + filter_upwards [hU.mem_nhds ha] with z hz + exact ⟨Function.invFunOn_apply_mem hz, Function.invFunOn_apply_eq hz⟩ + have hgne : ∀ᶠ w in 𝓝[≠] (f a), g w ≠ a := by + filter_upwards [hright.filter_mono nhdsWithin_le_nhds, self_mem_nhdsWithin] + with w hw hwne + intro heq + exact hwne (hw.2.symm.trans (congrArg f heq)) + have hgt : Tendsto g (𝓝[≠] (f a)) (𝓝[≠] a) := by + apply tendsto_nhdsWithin_iff.mpr + refine ⟨?_, hgne⟩ + simpa only [hga] using (hgc.tendsto.mono_left nhdsWithin_le_nhds : + Tendsto g (𝓝[≠] (f a)) (𝓝 (g (f a)))) + have hgd : ∀ᶠ w in 𝓝[≠] (f a), DifferentiableAt ℂ g w := by + filter_upwards [hgt.eventually hd, hright.filter_mono nhdsWithin_le_nhds] + with w hwder hw + have hwan : AnalyticAt ℂ f (g w) := hf.1.analyticOnNhd hU (g w) hw.1 + have hws : HasStrictDerivAt f (deriv f (g w)) (g w) := + (hwan.contDiffAt (n := 1)).hasStrictDerivAt (by norm_num) + have hl : ∀ᶠ z in 𝓝 (g w), g (f z) = z := by + filter_upwards [hU.mem_nhds hw.1] with z hz + exact hf.2.leftInvOn_invFunOn hz + simpa [hw.2] using (hws.to_local_left_inverse hwder hl).hasDerivAt.differentiableAt + have hgan := Complex.analyticAt_of_differentiable_on_punctured_nhds_of_continuousAt + hgd hgc + have hcomp := hgan.differentiableAt.hasDerivAt.comp a han.differentiableAt.hasDerivAt + have hid : (fun z => g (f z)) =ᶠ[𝓝 a] id := by + filter_upwards [hU.mem_nhds ha] with z hz + exact hf.2.leftInvOn_invFunOn hz + have hprod : deriv g (f a) * deriv f a = 1 := by + simpa using (hcomp.congr_of_eventuallyEq hid.symm).unique (hasDerivAt_id a) + intro hzero + simp [hzero] at hprod + +lemma differentiableAt_of_continuous_root {q F : ℂ → ℂ} {z : ℂ} + (hq : ContinuousAt q z) (hF : DifferentiableAt ℂ F z) + (hroot : (fun w => q w^2) =ᶠ[𝓝 z] F) (hq0 : q z ≠ 0) : + DifferentiableAt ℂ q z := by + have hp : HasStrictDerivAt (fun w : ℂ => w^2) (2*q z) (q z) := by + have hp := (hasStrictDerivAt_id (q z)).pow 2 + change HasStrictDerivAt (fun w : ℂ => w^2) _ (q z) at hp + simpa only [id_eq, Nat.reduceSub, pow_one, Nat.cast_ofNat, mul_one] using hp + have hn : 2*q z ≠ 0 := mul_ne_zero (by norm_num) hq0 + let p := hp.localInverse _ _ _ hn + have hpD : DifferentiableAt ℂ p (F z) := by + rw [← hroot.self_of_nhds] + exact (hp.to_localInverse hn).hasDerivAt.differentiableAt + have he : q =ᶠ[𝓝 z] fun w => p (F w) := by + filter_upwards [hq.tendsto.eventually (hp.eventually_left_inverse hn),hroot] with w hw hwF + exact (hwF ▸ hw).symm + exact (hpD.comp z hF).congr_of_eventuallyEq he + +lemma exists_holomorphic_sqrt_disk {F : ℂ → ℂ} + (hF : DifferentiableOn ℂ F disk) (hF0 : ∀ z ∈ disk, F z ≠ 0) + (hFone : F 0 = 1) : + ∃ q : ℂ → ℂ, DifferentiableOn ℂ q disk ∧ q 0 = 1 ∧ + (∀ z ∈ disk, q z^2 = F z) ∧ ∀ z ∈ disk, q z ≠ 0 := by + have hdz : (0 : ℂ) ∈ disk := by simp [disk] + have hsim : IsSimplyConnected disk := by + have : ContractibleSpace disk := (convex_ball (0 : ℂ) (1 : ℝ)).contractibleSpace ⟨0,hdz⟩ + change SimplyConnectedSpace disk + exact inferInstance + obtain ⟨q,hqc,hq⟩ := Complex.exists_continuousOn_pow_eq hsim Metric.isOpen_ball hF.continuousOn + (by rintro ⟨z,hz,he⟩;exact hF0 z hz he) (n := 2) (by norm_num) + have hqn (z) (hz : z ∈ disk) : q z ≠ 0 := by + intro he + have := hq z + rw [he,zero_pow (by norm_num)] at this + exact hF0 z hz this.symm + have hqd : DifferentiableOn ℂ q disk := by + intro z hz + apply DifferentiableAt.differentiableWithinAt + apply differentiableAt_of_continuous_root + (hqc.continuousAt (Metric.isOpen_ball.mem_nhds hz)) + ((hF z hz).differentiableAt (Metric.isOpen_ball.mem_nhds hz)) + (Filter.Eventually.of_forall hq) (hqn z hz) + let Q : ℂ → ℂ := fun z => q z / q 0 + refine ⟨Q,hqd.div_const _,by simp [Q,hqn 0 hdz],?_,?_⟩ + · intro z hz + simp only [Q,div_pow,hq,hFone,div_one] + · intro z hz + exact div_ne_zero (hqn z hz) (hqn 0 hdz) + +lemma dslope_factor (f : ℂ → ℂ) (z : ℂ) : + z * dslope f 0 z = f z-f 0 := by + simpa only [sub_zero,smul_eq_mul] using sub_smul_dslope f 0 z + +lemma sq_mem_disk {z : ℂ} (hz : z ∈ disk) : z^2 ∈ disk := by + have hn : ‖z‖ < 1 := by simpa [disk] using hz + simpa [disk] using pow_lt_one₀ (norm_nonneg z) hn (by norm_num : 2 ≠ 0) + +lemma exists_odd_transform {f : ℂ → ℂ} (hf : Schlicht f) : + ∃ q g h H : ℂ → ℂ, + DifferentiableOn ℂ q disk ∧ q 0 = 1 ∧ + (∀ z ∈ disk, q z ≠ 0) ∧ + (∀ z ∈ disk, q z^2 = dslope f 0 z) ∧ + (∀ z, g z = z*q (z^2)) ∧ + UnivalentOn g disk ∧ g 0 = 0 ∧ + DifferentiableOn ℂ h disk ∧ deriv h 0 = -deriv q 0 ∧ + (∀ z ∈ disk, z ≠ 0 → H z = z⁻¹+h z) ∧ + UnivalentOn H (disk \ {0}) ∧ + deriv (deriv f) 0 = 4*deriv q 0 := by + have hdz : (0 : ℂ) ∈ disk := by simp [disk] + let F := dslope f 0 + have hFd : DifferentiableOn ℂ F disk := + (Complex.differentiableOn_dslope (Metric.isOpen_ball.mem_nhds hdz)).mpr hf.1.1 + have hFn (z) (hz : z ∈ disk) : F z ≠ 0 := by + by_cases hz0 : z = 0 + · simpa [F,hz0] using (show deriv f 0 ≠ 0 by rw [hf.2.2];norm_num) + · intro he + have hfact := dslope_factor f z + change z*F z = f z-f 0 at hfact + rw [he,mul_zero] at hfact + exact hz0 (hf.1.2 hz hdz (sub_eq_zero.mp hfact.symm)) + obtain ⟨q,hqd,hq0,hqs,hqn⟩ := exists_holomorphic_sqrt_disk hFd hFn (by simpa [F] using hf.2.2) + let Q := dslope q 0 + have hQd : DifferentiableOn ℂ Q disk := + (Complex.differentiableOn_dslope (Metric.isOpen_ball.mem_nhds hdz)).mpr hqd + let g : ℂ → ℂ := fun z => z*q (z^2) + let h : ℂ → ℂ := fun z => -z*Q (z^2)/q (z^2) + let H : ℂ → ℂ := fun z => (g z)⁻¹ + have hgd : DifferentiableOn ℂ g disk := by + exact differentiableOn_id.mul (hqd.comp (differentiableOn_id.pow 2) (fun z hz => sq_mem_disk hz)) + have hgs (z) (hz : z ∈ disk) : g z^2 = f (z^2) := by + dsimp only [g] + rw [mul_pow,hqs _ (sq_mem_disk hz)] + simpa [F,hf.2.1] using dslope_factor f (z^2) + have hgn (z) (hz : z ∈ disk) (hz0 : z ≠ 0) : g z ≠ 0 := + mul_ne_zero hz0 (hqn _ (sq_mem_disk hz)) + have hgi : InjOn g disk := by + intro z hz w hw he + have hsq : z^2 = w^2 := hf.1.2 (sq_mem_disk hz) (sq_mem_disk hw) + ((hgs z hz).symm.trans ((congrArg (fun t => t^2) he).trans (hgs w hw))) + rcases sq_eq_sq_iff_eq_or_eq_neg.mp hsq with heq | heq + · exact heq + · have hgneg : g z = -g w := by simp [g,heq] + have hw0 : w = 0 := by + by_contra hn + exact hgn w hw hn (by linear_combination (he.symm+hgneg)/2) + simpa [hw0] using heq + have hhd : DifferentiableOn ℂ h disk := by + exact (differentiableOn_id.neg.mul + (hQd.comp (differentiableOn_id.pow 2) (fun z hz => sq_mem_disk hz))).div + (hqd.comp (differentiableOn_id.pow 2) (fun z hz => sq_mem_disk hz)) + (fun z hz => hqn _ (sq_mem_disk hz)) + have hderh : deriv h 0 = -deriv q 0 := by + have hqd0 := ((hqd 0 hdz).differentiableAt (Metric.isOpen_ball.mem_nhds hdz)).hasDerivAt + have hQd0 := ((hQd 0 hdz).differentiableAt (Metric.isOpen_ball.mem_nhds hdz)).hasDerivAt + have hp : HasDerivAt (fun z : ℂ => z^2) 0 0 := by + have hp := (hasDerivAt_id (0 : ℂ)).pow 2 + change HasDerivAt (fun z : ℂ => z^2) _ 0 at hp + simpa only [id_eq,Nat.reduceSub,pow_one,Nat.cast_ofNat,mul_one,mul_zero] using hp + have hQcomp : HasDerivAt (fun z : ℂ => Q (z^2)) 0 0 := by + have hQd0' : HasDerivAt Q (deriv Q 0) ((0 : ℂ)^2) := by simpa using hQd0 + convert hQd0'.comp (h := fun z : ℂ => z^2) 0 hp using 1 <;> first | rfl | simp + have hqcomp : HasDerivAt (fun z : ℂ => q (z^2)) 0 0 := by + have hqd0' : HasDerivAt q (deriv q 0) ((0 : ℂ)^2) := by simpa using hqd0 + convert hqd0'.comp (h := fun z : ℂ => z^2) 0 hp using 1 <;> first | rfl | simp + have hD := ((hasDerivAt_id (0 : ℂ)).neg.mul hQcomp).div hqcomp + (by simpa using hqn 0 hdz) + change HasDerivAt h _ 0 at hD + simpa [Q,hq0] using hD.deriv + have hdef (z) (hz : z ∈ disk) (hz0 : z ≠ 0) : H z = z⁻¹+h z := by + have hfact := dslope_factor q (z^2) + rw [hq0] at hfact + change z^2 * Q (z^2) = q (z^2)-1 at hfact + dsimp only [H,g,h] + field_simp [hz0,hqn _ (sq_mem_disk hz)] + linear_combination hfact + have hHu : UnivalentOn H (disk \ {0}) := by + refine ⟨(hgd.mono sdiff_subset).inv (fun z hz => hgn z hz.1 hz.2),?_⟩ + intro z hz w hw he + exact hgi hz.1 hw.1 (inv_inj.mp he) + have hFq : deriv F 0 = 2*deriv q 0 := by + have hD := (((hqd 0 hdz).differentiableAt (Metric.isOpen_ball.mem_nhds hdz)).hasDerivAt).pow 2 + have he : (fun z => q z^2) =ᶠ[𝓝 (0 : ℂ)] F := by + filter_upwards [Metric.isOpen_ball.mem_nhds hdz] with z hz + exact hqs z hz + have := (hD.congr_of_eventuallyEq he.symm).deriv + simpa [hq0] using this + have hff : deriv (deriv f) 0 = 2*deriv F 0 := by + have hidentity : f = fun z => z*F z := by + funext z + simpa [hf.2.1,F] using (dslope_factor f z).symm + have he : deriv f =ᶠ[𝓝 (0 : ℂ)] fun z => F z+z*deriv F z := by + filter_upwards [Metric.isOpen_ball.mem_nhds hdz] with z hz + have hD := (hasDerivAt_id z).mul + (((hFd z hz).differentiableAt (Metric.isOpen_ball.mem_nhds hz)).hasDerivAt) + rw [hidentity] + change HasDerivAt (fun w => w*F w) _ z at hD + simpa using hD.deriv + have hD := (((hFd 0 hdz).differentiableAt (Metric.isOpen_ball.mem_nhds hdz)).hasDerivAt).add + ((hasDerivAt_id (0 : ℂ)).mul + (((hFd.deriv Metric.isOpen_ball 0 hdz).differentiableAt (Metric.isOpen_ball.mem_nhds hdz)).hasDerivAt)) + have := (hD.congr_of_eventuallyEq he).deriv + simpa [two_mul] using this + refine ⟨q,g,h,H,hqd,hq0,hqn,hqs,fun _ => rfl,⟨hgd,hgi⟩,by simp [g],hhd,hderh,hdef,hHu,?_⟩ + rw [hff,hFq] + ring + +lemma schlicht_second_deriv_bound {f : ℂ → ℂ} (hf : Schlicht f) : + ‖deriv (deriv f) 0‖ ≤ 4 := by + obtain ⟨q,g,h,H,hqd,hq0,hqn,hqs,hgd,hgu,hg0,hhd,hderh,hdef,hHu,hff⟩ := + exists_odd_transform hf + have hbound : ‖deriv h 0‖ ≤ 1 := + meromorphic_univalent_coefficient hhd hHu.1 hdef + (fun z hz => univalent_deriv_ne_zero + (Metric.isOpen_ball.sdiff isClosed_singleton) hHu hz) hHu.2 + rw [hderh,norm_neg] at hbound + rw [hff,norm_mul] + norm_num + linarith + +def diskAutomorphism (a z : ℂ) : ℂ := (z+a)/(1+starRingEnd ℂ a*z) + +lemma diskAutomorphism_den_ne_zero {a z : ℂ} (ha : a ∈ disk) (hz : z ∈ disk) : + 1+starRingEnd ℂ a*z ≠ 0 := by + have hna : ‖a‖ < 1 := by simpa [disk] using ha + have hnz : ‖z‖ < 1 := by simpa [disk] using hz + intro he + have hb : ‖starRingEnd ℂ a*z‖ < 1 := by + rw [norm_mul,Complex.norm_conj] + nlinarith [norm_nonneg a,norm_nonneg z] + have he' : starRingEnd ℂ a*z = -1 := by linear_combination he + rw [he'] at hb + norm_num at hb + +lemma diskAutomorphism_normSq_identity (a z : ℂ) : + Complex.normSq (1+starRingEnd ℂ a*z)-Complex.normSq (z+a) = + (1-Complex.normSq a)*(1-Complex.normSq z) := by + simp [Complex.normSq, Complex.mul_re, Complex.mul_im] + ring + +lemma diskAutomorphism_mem {a z : ℂ} (ha : a ∈ disk) (hz : z ∈ disk) : + diskAutomorphism a z ∈ disk := by + have hna : ‖a‖ < 1 := by simpa [disk] using ha + have hnz : ‖z‖ < 1 := by simpa [disk] using hz + have hpos : 0 < (1-Complex.normSq a)*(1-Complex.normSq z) := by + rw [← Complex.sq_norm, ← Complex.sq_norm] + apply mul_pos <;> nlinarith [norm_nonneg a,norm_nonneg z] + have hineq := diskAutomorphism_normSq_identity a z + have hd := diskAutomorphism_den_ne_zero ha hz + rw [disk,Metric.mem_ball,dist_zero_right,diskAutomorphism,norm_div,div_lt_one (norm_pos_iff.mpr hd)] + rw [← Complex.sq_norm,← Complex.sq_norm] at hineq + nlinarith [norm_nonneg (z+a),norm_nonneg (1+starRingEnd ℂ a*z)] + +lemma diskAutomorphism_deriv {a z : ℂ} (ha : a ∈ disk) (hz : z ∈ disk) : + HasDerivAt (diskAutomorphism a) + ((1-(‖a‖^2 : ℝ))/(1+starRingEnd ℂ a*z)^2) z := by + have hd := ((hasDerivAt_id z).add_const a).div + (((hasDerivAt_id z).const_mul (starRingEnd ℂ a)).const_add 1) + (diskAutomorphism_den_ne_zero ha hz) + convert hd using 1 <;> try rfl + rw [Complex.sq_norm] + rw [Complex.normSq_eq_conj_mul_self] + simp only [id_eq] + ring + +lemma diskAutomorphism_injOn {a : ℂ} (ha : a ∈ disk) : InjOn (diskAutomorphism a) disk := by + intro z hz w hw he + have he' := (div_eq_div_iff (diskAutomorphism_den_ne_zero ha hz) + (diskAutomorphism_den_ne_zero ha hw)).mp he + have hna : ‖a‖ < 1 := by simpa [disk] using ha + have hd : (1-starRingEnd ℂ a*a) ≠ 0 := by + rw [← Complex.normSq_eq_conj_mul_self,← Complex.ofReal_one,← Complex.ofReal_sub] + apply Complex.ofReal_ne_zero.mpr + rw [← Complex.sq_norm] + nlinarith [norm_nonneg a] + apply (mul_left_cancel₀ hd) + linear_combination he' + +lemma diskAutomorphism_zero (a : ℂ) : diskAutomorphism a 0 = a := by simp [diskAutomorphism] + +lemma diskAutomorphism_differentiableOn {a : ℂ} (ha : a ∈ disk) : + DifferentiableOn ℂ (diskAutomorphism a) disk := + fun _ hz => (diskAutomorphism_deriv ha hz).differentiableAt.differentiableWithinAt + +lemma diskAutomorphism_second_deriv {a : ℂ} (ha : a ∈ disk) : + deriv (deriv (diskAutomorphism a)) 0 = + -2*starRingEnd ℂ a*(1-(‖a‖^2 : ℝ)) := by + have hzero : (0 : ℂ) ∈ disk := by simp [disk] + have he : deriv (diskAutomorphism a) =ᶠ[𝓝 (0 : ℂ)] + fun z => (1-(‖a‖^2 : ℝ))/(1+starRingEnd ℂ a*z)^2 := by + filter_upwards [Metric.isOpen_ball.mem_nhds hzero] with z hz + exact (diskAutomorphism_deriv ha hz).deriv + have hd := (hasDerivAt_const (0 : ℂ) (1-((‖a‖^2 : ℝ) : ℂ))).div + ((((hasDerivAt_id (0 : ℂ)).const_mul (starRingEnd ℂ a)).const_add 1).pow 2) + (by simp) + have hd' := hd.congr_of_eventuallyEq he + rw [hd'.deriv] + simp + ring + +def diskKoebe (f : ℂ → ℂ) (a z : ℂ) : ℂ := + (f (diskAutomorphism a z)-f a)/((1-((‖a‖^2 : ℝ) : ℂ))*deriv f a) + +lemma disk_coeff_ne_zero {a : ℂ} (ha : a ∈ disk) : 1-((‖a‖^2 : ℝ) : ℂ) ≠ 0 := by + have hn : ‖a‖ < 1 := by simpa [disk] using ha + rw [← Complex.ofReal_one,← Complex.ofReal_sub,Complex.ofReal_ne_zero] + nlinarith [norm_nonneg a] + +lemma diskKoebe_univalent {f : ℂ → ℂ} {a : ℂ} (hf : UnivalentOn f disk) + (ha : a ∈ disk) (hfd : deriv f a ≠ 0) : UnivalentOn (diskKoebe f a) disk := by + refine ⟨?_,?_⟩ + · exact ((hf.1.comp (diskAutomorphism_differentiableOn ha) + (fun _ hz => diskAutomorphism_mem ha hz)).sub_const (f a)).div_const _ + · intro z hz w hw he + have he' := (div_left_inj' (mul_ne_zero (disk_coeff_ne_zero ha) hfd)).mp he + exact diskAutomorphism_injOn ha hz hw + (hf.2 (diskAutomorphism_mem ha hz) (diskAutomorphism_mem ha hw) (sub_left_inj.mp he')) + +lemma diskKoebe_deriv {f : ℂ → ℂ} {a z : ℂ} (hf : DifferentiableOn ℂ f disk) + (ha : a ∈ disk) (hz : z ∈ disk) : + HasDerivAt (diskKoebe f a) + ((deriv f (diskAutomorphism a z)*((1-((‖a‖^2 : ℝ) : ℂ))/(1+starRingEnd ℂ a*z)^2))/ + ((1-((‖a‖^2 : ℝ) : ℂ))*deriv f a)) z := by + exact ((((hf _ (diskAutomorphism_mem ha hz)).differentiableAt + (Metric.isOpen_ball.mem_nhds (diskAutomorphism_mem ha hz))).hasDerivAt.comp z + (diskAutomorphism_deriv ha hz)).sub_const (f a)).div_const _ + +lemma diskKoebe_schlicht {f : ℂ → ℂ} {a : ℂ} (hf : UnivalentOn f disk) + (ha : a ∈ disk) (hfd : deriv f a ≠ 0) : Schlicht (diskKoebe f a) := by + refine ⟨diskKoebe_univalent hf ha hfd, ?_, ?_⟩ + · simp [diskKoebe,diskAutomorphism_zero] + · have hd := (diskKoebe_deriv hf.1 ha (by simp [disk] : (0 : ℂ) ∈ disk)).deriv + rw [hd] + simp only [diskAutomorphism_zero,mul_zero,add_zero,one_pow,div_one] + rw [mul_comm (deriv f a),div_self (mul_ne_zero (disk_coeff_ne_zero ha) hfd)] + +lemma diskKoebe_second_deriv {f : ℂ → ℂ} {a : ℂ} (hf : DifferentiableOn ℂ f disk) + (ha : a ∈ disk) (hfd : deriv f a ≠ 0) : + deriv (deriv (diskKoebe f a)) 0 = + (1-((‖a‖^2 : ℝ) : ℂ))*deriv (deriv f) a/deriv f a-2*starRingEnd ℂ a := by + have hzero : (0 : ℂ) ∈ disk := by simp [disk] + have he : deriv (diskKoebe f a) =ᶠ[𝓝 (0 : ℂ)] + fun z => (deriv f (diskAutomorphism a z)* + ((1-((‖a‖^2 : ℝ) : ℂ))/(1+starRingEnd ℂ a*z)^2))/ + ((1-((‖a‖^2 : ℝ) : ℂ))*deriv f a) := by + filter_upwards [Metric.isOpen_ball.mem_nhds hzero] with z hz + exact (diskKoebe_deriv hf ha hz).deriv + have hda := ((hf.deriv Metric.isOpen_ball a ha).differentiableAt + (Metric.isOpen_ball.mem_nhds ha)).hasDerivAt + have hda' : HasDerivAt (deriv f) (deriv (deriv f) a) (diskAutomorphism a 0) := by + simpa [diskAutomorphism_zero] using hda + have hcomp := hda'.comp 0 (diskAutomorphism_deriv ha hzero) + have hrat := (hasDerivAt_const (0 : ℂ) (1-((‖a‖^2 : ℝ) : ℂ))).div + ((((hasDerivAt_id (0 : ℂ)).const_mul (starRingEnd ℂ a)).const_add 1).pow 2) + (by simp) + have hd := ((hcomp.mul hrat).div_const + ((1-((‖a‖^2 : ℝ) : ℂ))*deriv f a)).congr_of_eventuallyEq he + rw [hd.deriv] + simp only [Pi.div_apply,Pi.pow_apply,Function.comp_apply,diskAutomorphism_zero, + mul_zero,add_zero,one_pow,div_one,zero_sub,id_eq,mul_one] + have halg (A B C D : ℂ) (hB : B ≠ 0) (hC : C ≠ 0) : + (A*C*C+B*(-(C*(2*D))))/(C*B) = C*A/B-2*D := by + field_simp + ring + exact halg (deriv (deriv f) a) (deriv f a) + (1-((‖a‖^2 : ℝ) : ℂ)) (starRingEnd ℂ a) hfd (disk_coeff_ne_zero ha) + +def omittedTransform (f : ℂ → ℂ) (w z : ℂ) : ℂ := w*f z/(w-f z) + +lemma omittedTransform_univalent {f : ℂ → ℂ} {w : ℂ} + (hf : UnivalentOn f disk) (hw : w ∉ f '' disk) (hw0 : w ≠ 0) : + UnivalentOn (omittedTransform f w) disk := by + have hn (z) (hz : z ∈ disk) : w-f z ≠ 0 := by + intro he + exact hw ⟨z,hz,(sub_eq_zero.mp he).symm⟩ + refine ⟨(hf.1.const_mul w).div (hf.1.const_sub w) hn,?_⟩ + intro z hz v hv he + apply hf.2 hz hv + apply mul_left_cancel₀ (pow_ne_zero 2 hw0) + have he' := (div_eq_div_iff (hn z hz) (hn v hv)).mp he + linear_combination he' + +lemma omittedTransform_deriv {f : ℂ → ℂ} {w z : ℂ} + (hf : DifferentiableOn ℂ f disk) (hw : w ∉ f '' disk) (hz : z ∈ disk) : + HasDerivAt (omittedTransform f w) (w^2*deriv f z/(w-f z)^2) z := by + have hn : w-f z ≠ 0 := fun he => hw ⟨z,hz,(sub_eq_zero.mp he).symm⟩ + have hd := ((hf z hz).differentiableAt (Metric.isOpen_ball.mem_nhds hz)).hasDerivAt + convert (hd.const_mul w).div (hd.const_sub w) hn using 1 <;> try rfl + ring + +lemma omittedTransform_schlicht {f : ℂ → ℂ} {w : ℂ} + (hf : Schlicht f) (hw : w ∉ f '' disk) : Schlicht (omittedTransform f w) := by + have hzero : (0 : ℂ) ∈ disk := by simp [disk] + have hw0 : w ≠ 0 := fun h => hw ⟨0,hzero,hf.2.1.trans h.symm⟩ + refine ⟨omittedTransform_univalent hf.1 hw hw0,?_,?_⟩ + · simp [omittedTransform,hf.2.1] + · rw [(omittedTransform_deriv hf.1.1 hw hzero).deriv,hf.2.1,hf.2.2] + simp [hw0] + +lemma omittedTransform_second_deriv {f : ℂ → ℂ} {w : ℂ} + (hf : Schlicht f) (hw : w ∉ f '' disk) : + deriv (deriv (omittedTransform f w)) 0 = deriv (deriv f) 0+2/w := by + have hzero : (0 : ℂ) ∈ disk := by simp [disk] + have hw0 : w ≠ 0 := fun h => hw ⟨0,hzero,hf.2.1.trans h.symm⟩ + have he : deriv (omittedTransform f w) =ᶠ[𝓝 (0 : ℂ)] + fun z => w^2*deriv f z/(w-f z)^2 := by + filter_upwards [Metric.isOpen_ball.mem_nhds hzero] with z hz + exact (omittedTransform_deriv hf.1.1 hw hz).deriv + have hfd := ((hf.1.1 0 hzero).differentiableAt (Metric.isOpen_ball.mem_nhds hzero)).hasDerivAt + have hfdd := ((hf.1.1.deriv Metric.isOpen_ball 0 hzero).differentiableAt + (Metric.isOpen_ball.mem_nhds hzero)).hasDerivAt + have hd := ((hfdd.const_mul (w^2)).div ((hfd.const_sub w).pow 2) + (by simpa [hf.2.1] using pow_ne_zero 2 hw0)).congr_of_eventuallyEq he + rw [hd.deriv] + simp only [Pi.pow_apply,hf.2.1,hf.2.2,sub_zero,mul_one] + field_simp [hw0] + ring + +lemma schlicht_preSchwarzian_bound {f : ℂ → ℂ} (hf : Schlicht f) {a : ℂ} (ha : a ∈ disk) : + ‖(1-((‖a‖^2 : ℝ) : ℂ))*deriv (deriv f) a/deriv f a-2*starRingEnd ℂ a‖ ≤ 4 := by + have hn := univalent_deriv_ne_zero Metric.isOpen_ball hf.1 ha + have hb := schlicht_second_deriv_bound (diskKoebe_schlicht hf.1 ha hn) + rwa [diskKoebe_second_deriv hf.1.1 ha hn] at hb + +lemma schlicht_quarter {f : ℂ → ℂ} (hf : Schlicht f) : + Metric.ball (0 : ℂ) (1/4) ⊆ f '' disk := by + intro w hw + by_contra hnot + have hz : (0 : ℂ) ∈ disk := by simp [disk] + have hw0 : w ≠ 0 := fun h => hnot ⟨0,hz,hf.2.1.trans h.symm⟩ + have hb := schlicht_second_deriv_bound (omittedTransform_schlicht hf hnot) + rw [omittedTransform_second_deriv hf hnot] at hb + have hdiff : ‖(2 : ℂ)/w‖ ≤ 8 := by + have ht := norm_sub_le (deriv (deriv f) 0+2/w) (deriv (deriv f) 0) + have hf2 := schlicht_second_deriv_bound hf + simp only [add_sub_cancel_left] at ht + linarith + rw [norm_div] at hdiff + norm_num at hdiff + have hle := (div_le_iff₀ (norm_pos_iff.mpr hw0)).mp hdiff + have hw' : ‖w‖ < 1/4 := by simpa using hw + linarith + +lemma hasDerivAt_log_norm_real {g : ℝ → ℂ} {d : ℂ} {x : ℝ} + (hg : HasDerivAt g d x) (hn : g x ≠ 0) : + HasDerivAt (fun t => Real.log ‖g t‖) (d/g x).re x := by + have heq : (fun t => Real.log ‖g t‖) = + (fun t => (1/2 : ℝ)*Real.log (‖g t‖^2)) := by + funext t + rw [Real.log_pow] + ring + have hd := ((hg.norm_sq).log (pow_ne_zero 2 (norm_ne_zero_iff.mpr hn))).const_mul (1/2 : ℝ) + rw [heq] + convert hd using 1 + simp only [Complex.inner,Complex.conj_re,Complex.conj_im,Complex.mul_re, + Complex.div_re,Complex.normSq_eq_norm_sq] + ring + +lemma logarithmic_distortion {L D : ℝ → ℝ} {r : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) + (hL : ∀ x ∈ Icc 0 r, HasDerivAt L (D x) x) (hL0 : L 0 = 0) + (hbound : ∀ x ∈ Icc 0 r, + (2*x-4)/(1-x^2) ≤ D x ∧ D x ≤ (2*x+4)/(1-x^2)) : + Real.log (1-r)-3*Real.log (1+r) ≤ L r ∧ + L r ≤ Real.log (1+r)-3*Real.log (1-r) := by + have hp (x : ℝ) (hx : x ∈ Icc 0 r) : 0 < 1-x ∧ 0 < 1+x ∧ 0 < 1-x^2 := by + constructor + · linarith [hx.2] + constructor + · linarith [hx.1] + · have := hx.1 + nlinarith [hx.2] + let U := fun x => L x-Real.log (1+x)+3*Real.log (1-x) + let V := fun x => L x-Real.log (1-x)+3*Real.log (1+x) + have hU (x) (hx : x ∈ Icc 0 r) : HasDerivAt U + (D x-1/(1+x)-3/(1-x)) x := by + have hlogp := ((hasDerivAt_id x).const_add 1).log (ne_of_gt (hp x hx).2.1) + have hlogm := ((hasDerivAt_id x).const_sub 1).log (ne_of_gt (hp x hx).1) + convert ((hL x hx).sub hlogp).add (hlogm.const_mul 3) using 1 <;> try rfl + simp + ring + have hV (x) (hx : x ∈ Icc 0 r) : HasDerivAt V + (D x+1/(1-x)+3/(1+x)) x := by + have hlogp := ((hasDerivAt_id x).const_add 1).log (ne_of_gt (hp x hx).2.1) + have hlogm := ((hasDerivAt_id x).const_sub 1).log (ne_of_gt (hp x hx).1) + convert ((hL x hx).sub hlogm).add (hlogp.const_mul 3) using 1 <;> try rfl + simp + ring + have halg (x) (hx : x ∈ Icc 0 r) : + 1/(1+x)+3/(1-x) = (2*x+4)/(1-x^2) ∧ + -(1/(1-x)+3/(1+x)) = (2*x-4)/(1-x^2) := by + constructor <;> field_simp [(hp x hx).1.ne', (hp x hx).2.1.ne', (hp x hx).2.2.ne'] <;> ring + have hUa : AntitoneOn U (Icc 0 r) := by + apply antitoneOn_of_deriv_nonpos (convex_Icc 0 r) + (fun x hx => (hU x hx).continuousAt.continuousWithinAt) + (fun x hx => (hU x (interior_subset hx)).differentiableAt.differentiableWithinAt) + intro x hx + rw [(hU x (interior_subset hx)).deriv] + have hb := (hbound x (interior_subset hx)).2 + rw [← (halg x (interior_subset hx)).1] at hb + linarith + have hVm : MonotoneOn V (Icc 0 r) := by + apply monotoneOn_of_deriv_nonneg (convex_Icc 0 r) + (fun x hx => (hV x hx).continuousAt.continuousWithinAt) + (fun x hx => (hV x (interior_subset hx)).differentiableAt.differentiableWithinAt) + intro x hx + rw [(hV x (interior_subset hx)).deriv] + have hb := (hbound x (interior_subset hx)).1 + rw [← (halg x (interior_subset hx)).2] at hb + linarith + have hu := hUa (left_mem_Icc.mpr hr) (right_mem_Icc.mpr hr) hr + have hv := hVm (left_mem_Icc.mpr hr) (right_mem_Icc.mpr hr) hr + dsimp [U,V] at hu hv + simp only [hL0,add_zero,sub_zero,Real.log_one,mul_zero] at hu hv + constructor <;> linarith + +lemma radialDistortion_of_preSchwarzian {f : ℂ → ℂ} + (hf : DifferentiableOn ℂ f disk) (hf0 : deriv f 0 = 1) + (hfn : ∀ a ∈ disk, deriv f a ≠ 0) + (hps : ∀ a ∈ disk, + ‖(1-((‖a‖^2 : ℝ) : ℂ))*deriv (deriv f) a/deriv f a-2*starRingEnd ℂ a‖ ≤ 4) + {r : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) {ζ : ℂ} (hζ : ‖ζ‖ = 1) : + (1-r)/(1+r)^3 ≤ ‖deriv f ((r : ℂ)*ζ)‖ ∧ + ‖deriv f ((r : ℂ)*ζ)‖ ≤ (1+r)/(1-r)^3 := by + let L : ℝ → ℝ := fun x => Real.log ‖deriv f ((x : ℂ)*ζ)‖ + let D : ℝ → ℝ := fun x => (deriv (deriv f) ((x : ℂ)*ζ)*ζ/deriv f ((x : ℂ)*ζ)).re + have hn (x) (hx : x ∈ Icc 0 r) : ‖(x : ℂ)*ζ‖ = x := by + rw [norm_mul,hζ,mul_one,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg hx.1] + have hm (x) (hx : x ∈ Icc 0 r) : (x : ℂ)*ζ ∈ disk := by + simp only [disk,Metric.mem_ball,dist_zero_right,hn x hx] + exact hx.2.trans_lt hr1 + have hD (x) (hx : x ∈ Icc 0 r) : HasDerivAt L (D x) x := by + have hd := ((hf.deriv Metric.isOpen_ball _ (hm x hx)).differentiableAt + (Metric.isOpen_ball.mem_nhds (hm x hx))).hasDerivAt + have hx' : HasDerivAt (fun t : ℝ => (t : ℂ)*ζ) ζ x := by + simpa using (Complex.ofRealCLM.hasDerivAt.mul_const ζ : + HasDerivAt (fun t : ℝ => Complex.ofRealCLM t*ζ) ((Complex.ofRealCLM (1 : ℝ))*ζ) x) + have hdc : HasDerivAt (fun t : ℝ => deriv f ((t : ℂ)*ζ)) + (deriv (deriv f) ((x : ℂ)*ζ)*ζ) x := by + convert HasDerivAt.comp (𝕜 := ℝ) x hd hx' using 1 + rfl + exact hasDerivAt_log_norm_real hdc (hfn _ (hm x hx)) + have hb (x) (hx : x ∈ Icc 0 r) : + (2*x-4)/(1-x^2) ≤ D x ∧ D x ≤ (2*x+4)/(1-x^2) := by + let A : ℂ := (1-((x^2 : ℝ) : ℂ))*deriv (deriv f) ((x : ℂ)*ζ)/deriv f ((x : ℂ)*ζ) + -2*starRingEnd ℂ ((x : ℂ)*ζ) + have hA : ‖A*ζ‖ ≤ 4 := by + rw [norm_mul,hζ,mul_one] + simpa only [A,hn x hx] using hps _ (hm x hx) + have he : (A*ζ).re = (1-x^2)*D x-2*x := by + have hzz : starRingEnd ℂ ζ*ζ = 1 := by + rw [← Complex.normSq_eq_conj_mul_self,← Complex.sq_norm,hζ] + norm_num + have heq : A*ζ = ((1-x^2 : ℝ) : ℂ)* + (deriv (deriv f) ((x : ℂ)*ζ)*ζ/deriv f ((x : ℂ)*ζ))-2*(x : ℂ) := by + dsimp only [A] + rw [map_mul,Complex.conj_ofReal] + rw [Complex.ofReal_sub,Complex.ofReal_one] + linear_combination -2*(x : ℂ)*hzz + rw [heq] + simp only [D,Complex.sub_re,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im, + zero_mul,sub_zero] + norm_num + have hreal := (Complex.abs_re_le_norm (A*ζ)).trans hA + rw [he,abs_le] at hreal + have hpos : 0 < 1-x^2 := by nlinarith [hx.1,hx.2] + constructor + · rw [div_le_iff₀ hpos] + nlinarith [hreal.1] + · rw [le_div_iff₀ hpos] + nlinarith [hreal.2] + have hbnd := logarithmic_distortion hr hr1 hD (by simp [L,hf0]) hb + have hposm : 0 < 1-r := sub_pos.mpr hr1 + have hposp : 0 < 1+r := by linarith + have hnorm : 0 < ‖deriv f ((r : ℂ)*ζ)‖ := norm_pos_iff.mpr (hfn _ (hm r (right_mem_Icc.mpr hr))) + constructor + · apply (Real.log_le_log_iff (div_pos hposm (pow_pos hposp 3)) hnorm).mp + simpa only [Real.log_div hposm.ne' (pow_ne_zero 3 hposp.ne'),Real.log_pow,Nat.cast_ofNat] using hbnd.1 + · apply (Real.log_le_log_iff hnorm (div_pos hposp (pow_pos hposm 3))).mp + simpa only [Real.log_div hposp.ne' (pow_ne_zero 3 hposm.ne'),Real.log_pow,Nat.cast_ofNat] using hbnd.2 + +lemma schlicht_deriv_bounds {f : ℂ → ℂ} (hf : Schlicht f) {z : ℂ} (hz : z ∈ disk) : + (1-‖z‖)/(1+‖z‖)^3 ≤ ‖deriv f z‖ ∧ + ‖deriv f z‖ ≤ (1+‖z‖)/(1-‖z‖)^3 := by + by_cases hzero : z = 0 + · simp [hzero,hf.2.2] + have hn := norm_pos_iff.mpr hzero + have hζ : ‖z/(‖z‖ : ℂ)‖ = 1 := by + rw [norm_div,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (norm_nonneg z),div_self hn.ne'] + have heq : (‖z‖ : ℂ)*(z/(‖z‖ : ℂ)) = z := by + field_simp [show (‖z‖ : ℂ) ≠ 0 by exact_mod_cast hn.ne'] + have hb := radialDistortion_of_preSchwarzian hf.1.1 hf.2.2 + (fun _ ha => univalent_deriv_ne_zero Metric.isOpen_ball hf.1 ha) + (fun _ ha => schlicht_preSchwarzian_bound hf ha) (norm_nonneg z) + (show ‖z‖ < 1 by simpa [disk] using hz) hζ + rwa [heq] at hb + +lemma schlicht_deriv_compact_bound {f : ℂ → ℂ} (hf : Schlicht f) + {R : ℝ} (hR : R < 1) {z : ℂ} (hz : ‖z‖ ≤ R) : + ‖deriv f z‖ ≤ 2/(1-R)^3 := by + have hzm : z ∈ disk := by simpa [disk] using hz.trans_lt hR + apply (schlicht_deriv_bounds hf hzm).2.trans + have hd : 0 < 1-R := sub_pos.mpr hR + apply div_le_div₀ (by positivity) (by linarith [norm_nonneg z]) (by positivity) + exact pow_le_pow_left₀ hd.le (by linarith) 3 + +lemma schlicht_lipschitz_bound {f : ℂ → ℂ} (hf : Schlicht f) + {R : ℝ} (hR : R < 1) {z w : ℂ} (hz : ‖z‖ ≤ R) (hw : ‖w‖ ≤ R) : + ‖f z-f w‖ ≤ (2/(1-R)^3)*‖z-w‖ := by + apply Convex.norm_image_sub_le_of_norm_deriv_le (s := Metric.closedBall 0 R) + (𝕜 := ℂ) _ _ (convex_closedBall 0 R) + (by simpa using hw) (by simpa using hz) + · intro x hx + apply (hf.1.1 x _).differentiableAt + (Metric.isOpen_ball.mem_nhds (show x ∈ disk from ?_)) + all_goals simpa [disk] using (show ‖x‖ ≤ R by simpa using hx).trans_lt hR + · intro x hx + exact schlicht_deriv_compact_bound hf hR (by simpa using hx) + +lemma schlicht_local_bound {f : ℂ → ℂ} (hf : Schlicht f) + {R : ℝ} (hR : R < 1) {z : ℂ} (hz : ‖z‖ ≤ R) : + ‖f z‖ ≤ (2/(1-R)^3)*R := by + have h := schlicht_lipschitz_bound hf hR hz + (show ‖(0 : ℂ)‖ ≤ R by simpa using (norm_nonneg z).trans hz) + simp only [hf.2.1,sub_zero] at h + exact h.trans (mul_le_mul_of_nonneg_left hz (by positivity)) + +def ballNormalize (f : ℂ → ℂ) (a : ℂ) (R : ℝ) (z : ℂ) : ℂ := + (f (a+(R : ℂ)*z)-f a)/((R : ℂ)*deriv f a) + +lemma affine_disk_maps_ball (a : ℂ) {R : ℝ} (hR : 0 < R) : + MapsTo (fun z : ℂ => a+(R : ℂ)*z) disk (Metric.ball a R) := by + intro z hz + have hz' : ‖z‖ < 1 := by simpa [disk] using hz + simp only [Metric.mem_ball,dist_eq_norm,add_sub_cancel_left,norm_mul, + Complex.norm_real,Real.norm_eq_abs,abs_of_pos hR] + nlinarith + +lemma ballNormalize_deriv {f : ℂ → ℂ} {a z : ℂ} {R : ℝ} (hR : 0 < R) + (hf : DifferentiableOn ℂ f (Metric.ball a R)) (hz : z ∈ disk) : + HasDerivAt (ballNormalize f a R) + (deriv f (a+(R : ℂ)*z)/deriv f a) z := by + have hmap := affine_disk_maps_ball a hR hz + have hd := ((hf _ hmap).differentiableAt (Metric.isOpen_ball.mem_nhds hmap)).hasDerivAt + have hdz := (((hd.comp z (((hasDerivAt_id z).const_mul (R : ℂ)).const_add a)).sub_const (f a)).div_const + ((R : ℂ)*deriv f a)) + convert hdz using 1 <;> try rfl + have hRc : (R : ℂ) ≠ 0 := by exact_mod_cast hR.ne' + simp only [mul_one] + field_simp + +lemma ballNormalize_schlicht {f : ℂ → ℂ} {a : ℂ} {R : ℝ} (hR : 0 < R) + (hf : UnivalentOn f (Metric.ball a R)) (hn : deriv f a ≠ 0) : + Schlicht (ballNormalize f a R) := by + have hRc : (R : ℂ) ≠ 0 := by exact_mod_cast hR.ne' + have hmap := affine_disk_maps_ball a hR + refine ⟨⟨?_,?_⟩,?_,?_⟩ + · intro z hz + exact (ballNormalize_deriv hR hf.1 hz).differentiableAt.differentiableWithinAt + · intro z hz w hw he + apply mul_left_cancel₀ hRc + apply add_left_cancel (a := a) + apply hf.2 (hmap hz) (hmap hw) + have he' := (div_left_inj' (mul_ne_zero hRc hn)).mp he + exact sub_left_inj.mp he' + · simp [ballNormalize] + · rw [(ballNormalize_deriv hR hf.1 (show (0 : ℂ) ∈ disk by simp [disk])).deriv] + simp [hn] + +lemma univalent_ball_quarter {f : ℂ → ℂ} {a : ℂ} {R : ℝ} (hR : 0 < R) + (hf : UnivalentOn f (Metric.ball a R)) : + Metric.ball (f a) (R*‖deriv f a‖/4) ⊆ f '' Metric.ball a R := by + have ha : a ∈ Metric.ball a R := Metric.mem_ball_self hR + have hn := univalent_deriv_ne_zero Metric.isOpen_ball hf ha + have hRc : (R : ℂ) ≠ 0 := by exact_mod_cast hR.ne' + have hden := mul_ne_zero hRc hn + intro w hw + have hu : (w-f a)/((R : ℂ)*deriv f a) ∈ Metric.ball (0 : ℂ) (1/4) := by + simp only [Metric.mem_ball,dist_zero_right,norm_div,norm_mul, + Complex.norm_real,Real.norm_eq_abs,abs_of_pos hR] + rw [div_lt_iff₀ (mul_pos hR (norm_pos_iff.mpr hn))] + have hw' : ‖w-f a‖ < R*‖deriv f a‖/4 := by simpa [dist_eq_norm] using hw + linarith + obtain ⟨z,hz,he⟩ := schlicht_quarter (ballNormalize_schlicht hR hf hn) hu + refine ⟨a+(R : ℂ)*z,affine_disk_maps_ball a hR hz,?_⟩ + have hes := (div_left_inj' hden).mp he + exact sub_left_inj.mp hes + +lemma schlicht_separation {f : ℂ → ℂ} (hf : Schlicht f) + {z w : ℂ} (_hz : z ∈ disk) (hw : w ∈ disk) {R : ℝ} (hR : 0 < R) + (hsub : Metric.ball z R ⊆ disk) (hdist : R ≤ ‖w-z‖) : + R*‖deriv f z‖/4 ≤ ‖f w-f z‖ := by + by_contra! hlt + have hm : f w ∈ Metric.ball (f z) (R*‖deriv f z‖/4) := by + simpa [dist_eq_norm] using hlt + obtain ⟨v,hv,he⟩ := univalent_ball_quarter hR ⟨hf.1.1.mono hsub,hf.1.2.mono hsub⟩ hm + have hvw := hf.1.2 (hsub hv) hw he + subst v + have : ‖w-z‖ < R := by simpa [dist_eq_norm] using hv + exact (not_lt_of_ge hdist) this + +lemma schlicht_lower_growth {f : ℂ → ℂ} (hf : Schlicht f) {z : ℂ} (hz : z ∈ disk) : + ‖z‖/4 ≤ ‖f z‖ := by + by_cases hzero : z = 0 + · simp [hzero,hf.2.1] + have h := schlicht_separation hf (show (0 : ℂ) ∈ disk by simp [disk]) hz + (norm_pos_iff.mpr hzero) + (Metric.ball_subset_ball (show ‖z‖ ≤ 1 by exact le_of_lt (by simpa [disk] using hz))) + (show ‖z‖ ≤ ‖z-(0 : ℂ)‖ by simp) + simpa [hf.2.1,hf.2.2] using h + +lemma schlicht_uniform_separation {z w : ℂ} (hz : z ∈ disk) (hw : w ∈ disk) + (hne : z ≠ w) : ∃ c : ℝ, 0 < c ∧ ∀ f : ℂ → ℂ, Schlicht f → c ≤ ‖f w-f z‖ := by + have hz1 : ‖z‖ < 1 := by simpa [disk] using hz + let R := min ((1-‖z‖)/2) (‖w-z‖/2) + have hR : 0 < R := lt_min (by linarith) + (div_pos (norm_pos_iff.mpr (sub_ne_zero.mpr hne.symm)) (by norm_num)) + have hR1 : R ≤ (1-‖z‖)/2 := min_le_left _ _ + have hR2 : R ≤ ‖w-z‖/2 := min_le_right _ _ + have hsub : Metric.ball z R ⊆ disk := by + intro v hv + have hvR : ‖v-z‖ < R := by simpa [dist_eq_norm] using hv + have ht := norm_add_le (v-z) z + rw [sub_add_cancel] at ht + simp only [disk,Metric.mem_ball,dist_zero_right] + linarith + refine ⟨R*((1-‖z‖)/(1+‖z‖)^3)/4,by positivity,?_⟩ + intro f hf + have h := schlicht_separation hf hz hw hR hsub (by linarith [norm_nonneg (w-z)]) + apply le_trans _ h + exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left (schlicht_deriv_bounds hf hz).1 hR.le) + (by norm_num) + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/DomainArea.lean b/lean/OAI/Analysis/IntegralMeans/DomainArea.lean new file mode 100644 index 0000000000000000000000000000000000000000..12b298e7ac0309ba951524a8b23410d310a5ce21 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/DomainArea.lean @@ -0,0 +1,150 @@ +import OAI.Analysis.IntegralMeans.PositiveArea + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +lemma schlicht_area {f : ℂ → ℂ} (hf : Schlicht f) {t : ℝ} + (ht : -2 < t) (ht2 : t < 2/3) : IntegrableOn (fun z => ‖deriv f z‖^t) disk := by + rcases lt_trichotomy t 0 with h | h | h + · exact schlicht_negative_area hf ht h + · subst t + simp only [Real.rpow_zero] + exact integrableOn_const (by + apply ne_of_lt + exact Metric.isBounded_ball.measure_lt_top) + · exact schlicht_positive_area hf h ht2 + +def normalizeDisk (f : ℂ → ℂ) (z : ℂ) : ℂ := (f z-f 0)/deriv f 0 + +lemma normalizeDisk_hasDeriv {f : ℂ → ℂ} (hf : UnivalentOn f disk) {z : ℂ} (hz : z ∈ disk) : + HasDerivAt (normalizeDisk f) (deriv f z/deriv f 0) z := + ((hf.1.differentiableAt (Metric.isOpen_ball.mem_nhds hz)).hasDerivAt.sub_const (f 0)).div_const _ + +lemma normalizeDisk_schlicht {f : ℂ → ℂ} (hf : UnivalentOn f disk) : Schlicht (normalizeDisk f) := by + have h0 : (0:ℂ) ∈ disk := by simp [disk] + have hn := univalent_deriv_ne_zero Metric.isOpen_ball hf h0 + refine ⟨⟨?_,?_⟩,?_,?_⟩ + · intro z hz + exact (normalizeDisk_hasDeriv hf hz).differentiableAt.differentiableWithinAt + · intro z hz w hw he + have hh : f z-f 0 = f w-f 0 := (div_left_inj' hn).mp he + exact hf.2 hz hw (sub_left_inj.mp hh) + · simp [normalizeDisk] + · rw [(normalizeDisk_hasDeriv hf h0).deriv,div_self hn] + +lemma univalent_disk_area {f : ℂ → ℂ} (hf : UnivalentOn f disk) {t : ℝ} + (ht : -2 < t) (ht2 : t < 2/3) : IntegrableOn (fun z => ‖deriv f z‖^t) disk := by + have h0 : (0:ℂ) ∈ disk := by simp [disk] + have hn := univalent_deriv_ne_zero Metric.isOpen_ball hf h0 + have hg := schlicht_area (normalizeDisk_schlicht hf) ht ht2 + apply IntegrableOn.congr_fun (hg.const_mul (‖deriv f 0‖^t)) _ Metric.isOpen_ball.measurableSet + intro z hz + have he : deriv f z = deriv f 0 * deriv (normalizeDisk f) z := by + rw [(normalizeDisk_hasDeriv hf hz).deriv] + field_simp + dsimp only + rw [he,norm_mul,Real.mul_rpow (norm_nonneg _) (norm_nonneg _)] + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +lemma univalent_inverse_hasDerivAt {U : Set ℂ} (hU : IsOpen U) {φ : ℂ → ℂ} + (hφ : UnivalentOn φ U) {z : ℂ} (hz : z ∈ U) : + HasDerivAt (Function.invFunOn φ U) (deriv φ z)⁻¹ (φ z) := by + have ha := hφ.1.analyticOnNhd hU z hz + apply (ha.hasStrictDerivAt.to_local_left_inverse (univalent_deriv_ne_zero hU hφ hz) ?_).hasDerivAt + filter_upwards [hU.mem_nhds hz] with w hw + exact hφ.2.leftInvOn_invFunOn hw + +lemma bijOn_inverse_univalent {U V : Set ℂ} (hU : IsOpen U) {φ : ℂ → ℂ} + (hφ : DifferentiableOn ℂ φ U) (hb : BijOn φ U V) : + UnivalentOn (Function.invFunOn φ U) V := by + constructor + · intro w hw + obtain ⟨z,hz,rfl⟩ := hb.surjOn hw + exact (univalent_inverse_hasDerivAt hU ⟨hφ,hb.injOn⟩ hz).differentiableAt.differentiableWithinAt + · exact (Function.invFunOn_injOn_image φ U).mono hb.surjOn + +lemma bijOn_inverse_image {U V : Set ℂ} {φ : ℂ → ℂ} (hb : BijOn φ U V) : + Function.invFunOn φ U '' V = U := by + rw [← hb.image_eq] + exact hb.injOn.invFunOn_image (Subset.refl _) + +lemma conformal_lintegral_eq {F : ℂ → ℂ} {s : Set ℂ} (hs : MeasurableSet s) + (hF : ∀ z ∈ s, DifferentiableAt ℂ F z) (hi : InjOn F s) (b : ℂ → ℝ≥0∞) : + (∫⁻ w in F '' s, b w) = ∫⁻ z in s, ENNReal.ofReal (‖deriv F z‖^2)*b (F z) := by + rw [lintegral_image_eq_lintegral_abs_det_fderiv_mul volume hs + (fun z hz => (hF z hz).hasFDerivAt.restrictScalars ℝ |>.hasFDerivWithinAt) hi b] + apply setLIntegral_congr_fun hs + intro z hz + have hd := (hF z hz).hasFDerivAt.restrictScalars ℝ + have hf : (ContinuousLinearMap.restrictScalars ℝ (fderiv ℂ F z)) = fderiv ℝ F z := hd.fderiv.symm + dsimp only + have hd' : (fderiv ℝ F z).det = ‖deriv F z‖^2 := det_fderiv_complex (hF z hz) + rw [hf,hd',abs_of_nonneg (sq_nonneg _)] + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +lemma conformal_domain_area {W : Set ℂ} (hW : IsOpen W) {φ : ℂ → ℂ} + (hφ : DifferentiableOn ℂ φ W) (hb : BijOn φ W disk) {s : ℝ} + (hs : 4/3 < s) (hs4 : s < 4) : IntegrableOn (fun z => ‖deriv φ z‖^s) W := by + let f := Function.invFunOn φ W + have hf : UnivalentOn f disk := bijOn_inverse_univalent hW hφ hb + have himage : f '' disk = W := bijOn_inverse_image hb + have hfi : IntegrableOn (fun w => ‖deriv f w‖^(2-s)) disk := univalent_disk_area hf (by linarith) (by linarith) + have hderiv (w : ℂ) (hw : w ∈ disk) : deriv φ (f w) = (deriv f w)⁻¹ := by + have hz : f w ∈ W := hb.surjOn.mapsTo_invFunOn hw + have hv : φ (f w) = w := hb.surjOn.rightInvOn_invFunOn hw + have hd := (univalent_inverse_hasDerivAt hW ⟨hφ,hb.injOn⟩ hz).deriv + change deriv f (φ (f w)) = (deriv φ (f w))⁻¹ at hd + rw [hv] at hd + rw [hd,inv_inv] + have hc : ContinuousOn (fun z => ‖deriv φ z‖^s) W := by + apply (hφ.deriv hW).continuousOn.norm.rpow_const + intro z hz + exact Or.inl (norm_ne_zero_iff.mpr (univalent_deriv_ne_zero hW ⟨hφ,hb.injOn⟩ hz)) + refine ⟨hc.aestronglyMeasurable hW.measurableSet,?_⟩ + apply (hasFiniteIntegral_iff_ofReal (Eventually.of_forall (fun z : ℂ => Real.rpow_nonneg (norm_nonneg _) s))).mpr + have he := conformal_lintegral_eq Metric.isOpen_ball.measurableSet + (fun z hz => hf.1.differentiableAt (Metric.isOpen_ball.mem_nhds hz)) hf.2 + (fun z => ENNReal.ofReal (‖deriv φ z‖^s)) + change (∫⁻ z in f '' disk, ENNReal.ofReal (‖deriv φ z‖^s)) = + ∫⁻ z in disk, ENNReal.ofReal (‖deriv f z‖^2)*ENNReal.ofReal (‖deriv φ (f z)‖^s) at he + rw [himage] at he + rw [he] + have hp : (∫⁻ w in disk, ENNReal.ofReal (‖deriv f w‖^2)*ENNReal.ofReal (‖deriv φ (f w)‖^s)) = + ∫⁻ w in disk, ENNReal.ofReal (‖deriv f w‖^(2-s)) := by + apply setLIntegral_congr_fun Metric.isOpen_ball.measurableSet + intro w hw + dsimp only + rw [hderiv w hw,norm_inv,Real.inv_rpow (norm_nonneg _),← ENNReal.ofReal_mul (sq_nonneg _)] + congr 1 + have hn : 0 < ‖deriv f w‖ := norm_pos_iff.mpr (univalent_deriv_ne_zero Metric.isOpen_ball hf hw) + rw [← Real.rpow_natCast ‖deriv f w‖ 2,← Real.rpow_neg hn.le,← Real.rpow_add hn] + rfl + rw [hp] + exact (hasFiniteIntegral_iff_ofReal (Eventually.of_forall + (fun w : ℂ => Real.rpow_nonneg (norm_nonneg (deriv f w)) (2-s)))).mp hfi.hasFiniteIntegral + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/Eigenmeasure.lean b/lean/OAI/Analysis/IntegralMeans/Eigenmeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..1726584217ca7114e4cd9b5737da9ec7ee4cdaf1 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/Eigenmeasure.lean @@ -0,0 +1,426 @@ +import OAI.Analysis.IntegralMeans.TransferOperator + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight +attribute [local irreducible] classFun +attribute [local irreducible] rerootClass + +lemma positive_operator_mono.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (hp : ∀ f, 0 ≤ f → 0 ≤ L f) : Monotone L := by + intro f g h + have := hp (g-f) (sub_nonneg.mpr h) + simpa only [map_sub,sub_nonneg] using this + +lemma positive_operator_abs_bound.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (hp : ∀ f, 0 ≤ f → 0 ≤ L f) (f : C(X,ℝ)) (x : X) : + |L f x| ≤ ‖f‖ * L 1 x := by + have hlo : (-‖f‖) • (1 : C(X,ℝ)) ≤ f := by + intro x + simpa using (abs_le.mp (ContinuousMap.norm_coe_le_norm f x)).1 + have hhi : f ≤ ‖f‖ • (1 : C(X,ℝ)) := by + intro x + simpa using (abs_le.mp (ContinuousMap.norm_coe_le_norm f x)).2 + have h1 := positive_operator_mono L hp hlo x + have h2 := positive_operator_mono L hp hhi x + simp only [map_smul,ContinuousMap.toFun_eq_coe,ContinuousMap.smul_apply,smul_eq_mul,neg_mul] at h1 h2 + exact abs_le.mpr ⟨h1,h2⟩ + +lemma positive_operator_norm.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] [Nonempty X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (hp : ∀ f, 0 ≤ f → 0 ≤ L f) : ‖L‖ = ‖L 1‖ := by + apply le_antisymm + · apply L.opNorm_le_bound (norm_nonneg _) + intro f + apply (ContinuousMap.norm_le (L f) (by positivity)).mpr + intro x + calc + ‖L f x‖ = |L f x| := Real.norm_eq_abs _ + _ ≤ ‖f‖ * L 1 x := positive_operator_abs_bound L hp f x + _ ≤ ‖f‖ * ‖L 1‖ := mul_le_mul_of_nonneg_left + (le_trans (le_abs_self _) (ContinuousMap.norm_coe_le_norm (L 1) x)) (norm_nonneg _) + _ = ‖L 1‖ * ‖f‖ := mul_comm _ _ + · simpa using L.le_opNorm (1 : C(X,ℝ)) + +lemma positive_operator_pow.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (hp : ∀ f, 0 ≤ f → 0 ≤ L f) (n : ℕ) : + ∀ f, 0 ≤ f → 0 ≤ (L^n) f := by + induction n with + | zero => simp + | succ n ih => + intro f hf + simpa only [pow_succ',mul_apply_eq_comp] using hp ((L^n) f) (ih f hf) + +lemma log_norm_pow_subadditive.{u_1} {A : Type u_1} [NormedRing A] (a : A) + (h : ∀ n : ℕ, 1 ≤ ‖a^n‖) : Subadditive (fun n => Real.log ‖a^n‖) := by + intro m n + change Real.log ‖a^(m+n)‖ ≤ _ + rw [pow_add] + calc + Real.log ‖a^m*a^n‖ ≤ Real.log (‖a^m‖*‖a^n‖) := + Real.log_le_log (lt_of_lt_of_le zero_lt_one (by simpa [pow_add] using h (m+n))) (norm_mul_le _ _) + _ = Real.log ‖a^m‖ + Real.log ‖a^n‖ := Real.log_mul (by linarith [h m]) (by linarith [h n]) + +lemma log_norm_pow_bddBelow.{u_1} {A : Type u_1} [NormedRing A] (a : A) + (h : ∀ n : ℕ, 1 ≤ ‖a^n‖) : BddBelow (range (fun n : ℕ => Real.log ‖a^n‖/n)) := by + refine ⟨0,?_⟩ + rintro _ ⟨n,rfl⟩ + exact div_nonneg (Real.log_nonneg (h n)) (Nat.cast_nonneg n) + +def growthLog.{u_1} {A : Type u_1} [NormedRing A] (a : A) (h : ∀ n : ℕ, 1 ≤ ‖a^n‖) : ℝ := + (log_norm_pow_subadditive a h).lim + +def growthRate.{u_1} {A : Type u_1} [NormedRing A] (a : A) (h : ∀ n : ℕ, 1 ≤ ‖a^n‖) : ℝ := + Real.exp (growthLog a h) + +lemma tendsto_log_norm_pow.{u_1} {A : Type u_1} [NormedRing A] (a : A) + (h : ∀ n : ℕ, 1 ≤ ‖a^n‖) : + Tendsto (fun n : ℕ => Real.log ‖a^n‖/n) atTop (𝓝 (growthLog a h)) := + (log_norm_pow_subadditive a h).tendsto_lim (log_norm_pow_bddBelow a h) + +lemma growthLog_nonneg.{u_1} {A : Type u_1} [NormedRing A] (a : A) + (h : ∀ n : ℕ, 1 ≤ ‖a^n‖) : 0 ≤ growthLog a h := + ge_of_tendsto (tendsto_log_norm_pow a h) + (Eventually.of_forall (fun n => div_nonneg (Real.log_nonneg (h n)) (Nat.cast_nonneg n))) + +lemma growthRate_ge_one.{u_1} {A : Type u_1} [NormedRing A] (a : A) + (h : ∀ n : ℕ, 1 ≤ ‖a^n‖) : 1 ≤ growthRate a h := + Real.one_le_exp_iff.mpr (growthLog_nonneg a h) + +lemma norm_pow_eventually_le.{u_1} {A : Type u_1} [NormedRing A] (a : A) + (h : ∀ n : ℕ, 1 ≤ ‖a^n‖) {r : ℝ} (hr : growthRate a h < r) : + ∀ᶠ n : ℕ in atTop, ‖a^n‖ ≤ r^n := by + have hr0 : 0 < r := lt_of_lt_of_le zero_lt_one ((growthRate_ge_one a h).trans hr.le) + have hlog : growthLog a h < Real.log r := by + rwa [← Real.exp_lt_exp,Real.exp_log hr0] + filter_upwards [(tendsto_log_norm_pow a h).eventually (gt_mem_nhds hlog), + eventually_gt_atTop (0 : ℕ)] with n hn hn0 + have hnR : (0 : ℝ) < n := by exact_mod_cast hn0 + have he : Real.log ‖a^n‖ ≤ (n : ℝ)*Real.log r := by + have := (div_lt_iff₀ hnR).mp hn + linarith + have := Real.exp_le_exp.mpr he + simpa only [Real.exp_log (lt_of_lt_of_le zero_lt_one (h n)),Real.exp_nat_mul, + Real.exp_log hr0] using this + +lemma summable_scaled_pow.{u_1} {A : Type u_1} [NormedRing A] [NormedAlgebra ℝ A] [CompleteSpace A] + (a : A) (h : ∀ n : ℕ, 1 ≤ ‖a^n‖) {τ : ℝ} (hτ : growthRate a h < τ) : + Summable (fun n : ℕ => (τ⁻¹)^n • a^n) := by + obtain ⟨r,hr,hrτ⟩ := exists_between hτ + have hr0 : 0 < r := lt_of_lt_of_le zero_lt_one ((growthRate_ge_one a h).trans hr.le) + have hτ0 : 0 < τ := hr0.trans hrτ + apply Summable.of_norm_bounded_eventually (g := fun n : ℕ => (r/τ)^n) + (summable_geometric_of_lt_one (by positivity) ((div_lt_one hτ0).mpr hrτ)) + have he := norm_pow_eventually_le a h hr + rw [← Nat.cofinite_eq_atTop] at he + filter_upwards [he] with n hn + rw [norm_smul,Real.norm_eq_abs,abs_of_nonneg (by positivity : 0 ≤ (τ⁻¹)^n)] + calc + (τ⁻¹)^n * ‖a^n‖ ≤ (τ⁻¹)^n*r^n := mul_le_mul_of_nonneg_left hn (by positivity) + _ = (r/τ)^n := by rw [← mul_pow]; congr 1; ring + +lemma growthRate_le_of_pow_bound.{u_1} {A : Type u_1} [NormedRing A] (a : A) + (h : ∀ n : ℕ, 1 ≤ ‖a^n‖) {M c : ℝ} (hM : 0 < M) (_hc : 0 ≤ c) + (hb : ∀ n : ℕ, ‖a^n‖ ≤ M*c^n) : growthRate a h ≤ c := by + have hc0 : 0 < c := by + have := hb 1 + have := h 1 + simp only [pow_one] at * + nlinarith + have ht : Tendsto (fun n : ℕ => Real.log M/(n : ℝ)+Real.log c) atTop (𝓝 (Real.log c)) := by + simpa using (tendsto_const_nhds.div_atTop tendsto_natCast_atTop_atTop).add_const (Real.log c) + have hl : growthLog a h ≤ Real.log c := by + apply le_of_tendsto_of_tendsto (tendsto_log_norm_pow a h) ht + filter_upwards [eventually_gt_atTop (0 : ℕ)] with n hn + have hnR : (0 : ℝ) < n := by exact_mod_cast hn + have hlog := Real.log_le_log (lt_of_lt_of_le zero_lt_one (h n)) (hb n) + rw [Real.log_mul hM.ne' (pow_pos hc0 n).ne',Real.log_pow] at hlog + calc + Real.log ‖a^n‖/(n : ℝ) ≤ (Real.log M+(n : ℝ)*Real.log c)/(n : ℝ) := + div_le_div_of_nonneg_right hlog hnR.le + _ = Real.log M/(n : ℝ)+Real.log c := by field_simp + simpa [growthRate,Real.exp_log hc0] using Real.exp_le_exp.mpr hl + +def positiveResolvent.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (τ : ℝ) : C(X,ℝ) →L[ℝ] C(X,ℝ) := + ∑' n : ℕ, (τ⁻¹)^n • L^n + +lemma positiveResolvent_apply.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (h : ∀ n : ℕ, 1 ≤ ‖L^n‖) + {τ : ℝ} (hτ : growthRate L h < τ) (f : C(X,ℝ)) : + positiveResolvent L τ f = ∑' n : ℕ, (τ⁻¹)^n • (L^n) f := by + exact (ContinuousLinearMap.apply ℝ C(X,ℝ) f).map_tsum (summable_scaled_pow L h hτ) + +lemma summable_resolvent_eval.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (h : ∀ n : ℕ, 1 ≤ ‖L^n‖) + {τ : ℝ} (hτ : growthRate L h < τ) (f : C(X,ℝ)) (x : X) : + Summable (fun n : ℕ => (τ⁻¹)^n * (L^n) f x) := by + let e : (C(X,ℝ) →L[ℝ] C(X,ℝ)) →L[ℝ] ℝ := + (ContinuousMap.evalCLM (R := ℝ) x).comp (ContinuousLinearMap.apply ℝ C(X,ℝ) f) + have hs := e.summable (summable_scaled_pow L h hτ) + simpa only [e,ContinuousLinearMap.comp_apply,ContinuousLinearMap.apply_apply, + smul_apply,ContinuousMap.evalCLM_apply,ContinuousMap.smul_apply,smul_eq_mul] using hs + +lemma positiveResolvent_eval.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (h : ∀ n : ℕ, 1 ≤ ‖L^n‖) + {τ : ℝ} (hτ : growthRate L h < τ) (f : C(X,ℝ)) (x : X) : + positiveResolvent L τ f x = ∑' n : ℕ, (τ⁻¹)^n * (L^n) f x := by + let e : (C(X,ℝ) →L[ℝ] C(X,ℝ)) →L[ℝ] ℝ := + (ContinuousMap.evalCLM (R := ℝ) x).comp (ContinuousLinearMap.apply ℝ C(X,ℝ) f) + exact e.map_tsum (summable_scaled_pow L h hτ) + +lemma positiveResolvent_nonneg.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (hp : ∀ f, 0 ≤ f → 0 ≤ L f) + (h : ∀ n : ℕ, 1 ≤ ‖L^n‖) {τ : ℝ} (hτ : growthRate L h < τ) : + ∀ f, 0 ≤ f → 0 ≤ positiveResolvent L τ f := by + have ht : 0 < τ := lt_of_lt_of_le zero_lt_one ((growthRate_ge_one L h).trans hτ.le) + intro f hf x + change 0 ≤ positiveResolvent L τ f x + rw [positiveResolvent_eval L h hτ] + exact tsum_nonneg (fun n => mul_nonneg (pow_nonneg (inv_nonneg.mpr ht.le) n) + (positive_operator_pow L hp n f hf x)) + +lemma positiveResolvent_ge_one.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (hp : ∀ f, 0 ≤ f → 0 ≤ L f) + (h : ∀ n : ℕ, 1 ≤ ‖L^n‖) {τ : ℝ} (hτ : growthRate L h < τ) : + 1 ≤ positiveResolvent L τ 1 := by + have ht : 0 < τ := lt_of_lt_of_le zero_lt_one ((growthRate_ge_one L h).trans hτ.le) + intro x + change 1 ≤ positiveResolvent L τ 1 x + rw [positiveResolvent_eval L h hτ] + have hn (n : ℕ) : 0 ≤ (τ⁻¹)^n * (L^n) (1 : C(X,ℝ)) x := + mul_nonneg (pow_nonneg (inv_nonneg.mpr ht.le) n) (positive_operator_pow L hp n 1 (by intro; simp) x) + simpa using (summable_resolvent_eval L h hτ 1 x).le_tsum 0 (fun n _ => hn n) + +lemma positiveResolvent_mul.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (h : ∀ n : ℕ, 1 ≤ ‖L^n‖) + {τ : ℝ} (hτ : growthRate L h < τ) : + positiveResolvent L τ * L = τ • (positiveResolvent L τ-1) ∧ + L * positiveResolvent L τ = τ • (positiveResolvent L τ-1) := by + have ht : τ ≠ 0 := ne_of_gt (lt_of_lt_of_le zero_lt_one ((growthRate_ge_one L h).trans hτ.le)) + have hs := summable_scaled_pow L h hτ + have htail : ∑' n : ℕ, (τ⁻¹)^(n+1) • L^(n+1) = positiveResolvent L τ-1 := by + have he := hs.sum_add_tsum_nat_add 1 + simpa [positiveResolvent] using eq_sub_iff_add_eq.mpr (by simpa [add_comm] using he) + have he (n : ℕ) : τ • ((τ⁻¹)^(n+1) • L^(n+1)) = (τ⁻¹)^n • (L^n*L) := by + rw [smul_smul,pow_succ,pow_succ] + congr 1 + field_simp + constructor + · change (∑' n : ℕ, (τ⁻¹)^n • L^n)*L = _ + rw [show (∑' n : ℕ, (τ⁻¹)^n • L^n)*L = + ∑' n : ℕ, ((τ⁻¹)^n • L^n)*L from + ((ContinuousLinearMap.compL ℝ C(X,ℝ) C(X,ℝ) C(X,ℝ)).flip L).map_tsum hs, + ← htail,← tsum_const_smul''] + exact tsum_congr (fun n => by + rw [he]; change ((τ⁻¹)^n • L^n).comp L = (τ⁻¹)^n • ((L^n).comp L) + exact ContinuousLinearMap.smul_comp _ _ _) + · change L*(∑' n : ℕ, (τ⁻¹)^n • L^n) = _ + rw [show L*(∑' n : ℕ, (τ⁻¹)^n • L^n) = + ∑' n : ℕ, L*((τ⁻¹)^n • L^n) from + ((ContinuousLinearMap.compL ℝ C(X,ℝ) C(X,ℝ) C(X,ℝ)) L).map_tsum hs, + ← htail,← tsum_const_smul''] + apply tsum_congr + intro n + rw [he] + change L.comp ((τ⁻¹)^n • L^n) = (τ⁻¹)^n • ((L^n).comp L) + rw [ContinuousLinearMap.comp_smul] + congr 1 + change L * L^n = L^n * L + rw [← pow_succ',← pow_succ] + +lemma positive_operator_pow_bound.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] [Nonempty X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (hp : ∀ f, 0 ≤ f → 0 ≤ L f) + {g : C(X,ℝ)} (hg : 1 ≤ g) {c : ℝ} (hc : 0 ≤ c) (hLg : L g ≤ c • g) (n : ℕ) : + ‖L^n‖ ≤ ‖g‖*c^n := by + have hiter : ∀ n : ℕ, (L^n) g ≤ c^n • g := by + intro n + induction n with + | zero => simp + | succ n ih => + have h1 := positive_operator_mono L hp ih + have h2 : c^n • L g ≤ c^n • (c • g) := smul_le_smul_of_nonneg_left hLg (pow_nonneg hc n) + rw [map_smul] at h1 + have h3 := h1.trans h2 + simpa only [pow_succ',mul_apply_eq_comp,smul_smul,mul_comm] using h3 + rw [positive_operator_norm (L^n) (positive_operator_pow L hp n)] + apply (ContinuousMap.norm_le _ (mul_nonneg (norm_nonneg _) (pow_nonneg hc n))).mpr + intro x + have hn := positive_operator_pow L hp n 1 (by intro; simp) x + have h1 := positive_operator_mono (L^n) (positive_operator_pow L hp n) hg x + have h2 := hiter n x + change (L^n) g x ≤ c^n*g x at h2 + calc + ‖(L^n) 1 x‖ = (L^n) 1 x := Real.norm_of_nonneg hn + _ ≤ c^n*g x := h1.trans h2 + _ ≤ c^n*‖g‖ := mul_le_mul_of_nonneg_left + ((le_abs_self _).trans (ContinuousMap.norm_coe_le_norm g x)) (pow_nonneg hc n) + _ = ‖g‖*c^n := mul_comm _ _ + +lemma positiveResolvent_norm_bound.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] [Nonempty X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (hp : ∀ f, 0 ≤ f → 0 ≤ L f) + (h : ∀ n : ℕ, 1 ≤ ‖L^n‖) {τ : ℝ} (hτ : growthRate L h < τ) : + 1 ≤ ‖positiveResolvent L τ 1‖ ∧ + τ / ‖positiveResolvent L τ 1‖ ≤ τ - growthRate L h := by + let g := positiveResolvent L τ 1 + have hg : 1 ≤ g := positiveResolvent_ge_one L hp h hτ + have hM : 1 ≤ ‖g‖ := by + obtain ⟨x⟩ := ‹Nonempty X› + exact (hg x).trans ((le_abs_self _).trans (ContinuousMap.norm_coe_le_norm g x)) + have hM0 : 0 < ‖g‖ := zero_lt_one.trans_le hM + have ht : 0 < τ := lt_of_lt_of_le zero_lt_one ((growthRate_ge_one L h).trans hτ.le) + let c := τ*(1-1/‖g‖) + have hc : 0 ≤ c := mul_nonneg ht.le (sub_nonneg.mpr ((div_le_one hM0).mpr hM)) + have he : L g = τ • (g-1) := by + have hv := congrArg (fun A : C(X,ℝ) →L[ℝ] C(X,ℝ) => A 1) (positiveResolvent_mul L h hτ).2 + simpa only [mul_apply_eq_comp,smul_apply, + sub_apply,one_apply_eq_self] using hv + have hLg : L g ≤ c • g := by + rw [he] + intro x + change τ*(g x-1) ≤ c*g x + have hgx : g x ≤ ‖g‖ := (le_abs_self _).trans (ContinuousMap.norm_coe_le_norm g x) + have hdiv : g x / ‖g‖ ≤ 1 := (div_le_one hM0).mpr hgx + dsimp [c] + have hh := mul_le_mul_of_nonneg_left hdiv ht.le + simp only [div_eq_mul_inv,one_mul] at hh ⊢ + nlinarith + have hr := growthRate_le_of_pow_bound L h hM0 hc (positive_operator_pow_bound L hp hg hc hLg) + refine ⟨hM,?_⟩ + dsimp [c] at hr + change τ/‖g‖ ≤ τ-growthRate L h + simp only [div_eq_mul_inv,one_mul] at hr ⊢ + nlinarith + +lemma probability_of_positive_functional.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [T2Space X] [MeasurableSpace X] [BorelSpace X] + (Λ : C(X,ℝ) →L[ℝ] ℝ) (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) (h1 : Λ 1 = 1) : + ∃ μ : ProbabilityMeasure X, ∀ f : C(X,ℝ), ∫ x, f x ∂(μ : Measure X) = Λ f := by + let Λ' : C_c(X,ℝ) →ₚ[ℝ] ℝ := + { toFun := fun f => Λ f.toContinuousMap + map_add' := fun f g => map_add Λ f.toContinuousMap g.toContinuousMap + map_smul' := fun c f => map_smul Λ c f.toContinuousMap + monotone' := by + intro f g hfg + have hn : 0 ≤ Λ (g.toContinuousMap-f.toContinuousMap) := hp _ (sub_nonneg.mpr hfg) + simpa only [map_sub,sub_nonneg] using hn } + let μ := RealRMK.rieszMeasure Λ' + have hi (f : C(X,ℝ)) : ∫ x, f x ∂μ = Λ f := by + let f' : C_c(X,ℝ) := ⟨f,HasCompactSupport.of_compactSpace f⟩ + exact RealRMK.integral_rieszMeasure Λ' f' + have hμ : IsProbabilityMeasure μ := isProbabilityMeasure_iff_real.mpr (by + have hh := hi 1 + simpa [h1] using hh) + exact ⟨⟨μ,hμ⟩,hi⟩ + +lemma exists_max_of_nonneg_continuous.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [Nonempty X] (f : C(X,ℝ)) (hf : 0 ≤ f) : ∃ x : X, f x = ‖f‖ := by + obtain ⟨x,_,hx⟩ := isCompact_univ.exists_isMaxOn Set.univ_nonempty f.continuous.continuousOn + refine ⟨x,le_antisymm ((le_abs_self _).trans (ContinuousMap.norm_coe_le_norm f x)) ?_⟩ + apply (ContinuousMap.norm_le f (hf x)).mpr + intro y + calc + ‖f y‖ = f y := Real.norm_of_nonneg (hf y) + _ ≤ f x := hx (mem_univ y) + +lemma exists_resolvent_probability.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [T2Space X] [MeasurableSpace X] [BorelSpace X] [Nonempty X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (hp : ∀ f, 0 ≤ f → 0 ≤ L f) + (h : ∀ n : ℕ, 1 ≤ ‖L^n‖) {τ : ℝ} (hτ : growthRate L h < τ) : + ∃ μ : ProbabilityMeasure X, ∀ f : C(X,ℝ), + |(∫ x, L f x ∂(μ : Measure X))-τ*(∫ x, f x ∂(μ : Measure X))| ≤ + (τ-growthRate L h)*‖f‖ := by + let R := positiveResolvent L τ + let g := R 1 + have hg : 1 ≤ g := positiveResolvent_ge_one L hp h hτ + have hg0 : 0 ≤ g := le_trans (by intro; simp) hg + obtain ⟨x,hx⟩ := exists_max_of_nonneg_continuous g hg0 + have hM := positiveResolvent_norm_bound L hp h hτ + have hM0 : 0 < ‖g‖ := zero_lt_one.trans_le hM.1 + let Λ : C(X,ℝ) →L[ℝ] ℝ := (‖g‖⁻¹ • ContinuousMap.evalCLM (R := ℝ) x).comp R + have hΛ (f : C(X,ℝ)) : Λ f = R f x / ‖g‖ := by change ‖g‖⁻¹ * R f x = R f x / ‖g‖; ring + have hpΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f := by + intro f hf + rw [hΛ] + exact div_nonneg (positiveResolvent_nonneg L hp h hτ f hf x) hM0.le + have h1 : Λ 1 = 1 := by rw [hΛ]; change g x / ‖g‖ = 1; rw [hx,div_self hM0.ne'] + obtain ⟨μ,hμ⟩ := probability_of_positive_functional Λ hpΛ h1 + refine ⟨μ,fun f => ?_⟩ + rw [hμ (L f),hμ f,hΛ,hΛ] + have he : R (L f) x = τ*(R f x-f x) := by + have hv := congrArg (fun A : C(X,ℝ) →L[ℝ] C(X,ℝ) => A f x) (positiveResolvent_mul L h hτ).1 + exact hv + rw [he] + have hτ0 : 0 ≤ τ := lt_of_lt_of_le zero_lt_one ((growthRate_ge_one L h).trans hτ.le) |>.le + calc + |τ*(R f x-f x)/‖g‖-τ*(R f x/‖g‖)| = (τ/‖g‖)*|f x| := by + rw [show τ*(R f x-f x)/‖g‖-τ*(R f x/‖g‖) = -(τ/‖g‖)*f x by ring, + abs_mul,abs_neg,abs_of_nonneg (div_nonneg hτ0 hM0.le)] + _ ≤ (τ/‖g‖)*‖f‖ := mul_le_mul_of_nonneg_left (ContinuousMap.norm_coe_le_norm f x) + (div_nonneg hτ0 hM0.le) + _ ≤ (τ-growthRate L h)*‖f‖ := mul_le_mul_of_nonneg_right hM.2 (norm_nonneg f) + +lemma exists_growth_eigenmeasure.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [T2Space X] [MeasurableSpace X] [BorelSpace X] [Nonempty X] + (L : C(X,ℝ) →L[ℝ] C(X,ℝ)) (hp : ∀ f, 0 ≤ f → 0 ≤ L f) + (h : ∀ n : ℕ, 1 ≤ ‖L^n‖) : + ∃ μ : ProbabilityMeasure X, ∀ f : C(X,ℝ), + (∫ x, L f x ∂(μ : Measure X)) = growthRate L h*(∫ x, f x ∂(μ : Measure X)) := by + let ρ := growthRate L h + let τ : ℕ → ℝ := fun n => ρ+1/((n : ℝ)+1) + have hτ (n : ℕ) : growthRate L h < τ n := by + dsimp [τ,ρ] + exact lt_add_of_pos_right _ (by positivity) + choose μ hμ using fun n : ℕ => exists_resolvent_probability L hp h (hτ n) + let U := Ultrafilter.of (atTop : Filter ℕ) + let V := U.map μ + let ν := V.lim + have hν : Tendsto μ (U : Filter ℕ) (𝓝 ν) := V.le_nhds_lim + have ht : Tendsto τ (U : Filter ℕ) (𝓝 ρ) := by + have hh : Tendsto τ atTop (𝓝 ρ) := by + simpa [τ] using tendsto_one_div_add_atTop_nhds_zero_nat.const_add ρ + exact hh.mono_left (Ultrafilter.of_le atTop) + refine ⟨ν,fun f => ?_⟩ + have hi := (ProbabilityMeasure.continuous_integral_continuousMap f).tendsto ν |>.comp hν + have hLi := (ProbabilityMeasure.continuous_integral_continuousMap (L f)).tendsto ν |>.comp hν + have hb := le_of_tendsto_of_tendsto ((hLi.sub (ht.mul hi)).abs) + ((ht.sub_const ρ).mul_const ‖f‖) (Eventually.of_forall (hμ · f)) + simp only [sub_self,zero_mul] at hb + exact sub_eq_zero.mp (abs_nonpos_iff.mp hb) + +lemma positive_functional_bound.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + (Λ : C(X,ℝ) →ₗ[ℝ] ℝ) (hp : ∀ f, 0 ≤ f → 0 ≤ Λ f) (f : C(X,ℝ)) : + ‖Λ f‖ ≤ Λ 1 * ‖f‖ := by + have hlo : (-‖f‖) • (1 : C(X,ℝ)) ≤ f := by + intro x + simpa using (abs_le.mp (ContinuousMap.norm_coe_le_norm f x)).1 + have hhi : f ≤ ‖f‖ • (1 : C(X,ℝ)) := by + intro x + simpa using (abs_le.mp (ContinuousMap.norm_coe_le_norm f x)).2 + have h1 := hp (f-(-‖f‖) • 1) (sub_nonneg.mpr hlo) + have h2 := hp (‖f‖ • 1-f) (sub_nonneg.mpr hhi) + simp only [map_sub,map_smul,smul_eq_mul,neg_mul] at h1 h2 + rw [Real.norm_eq_abs] + apply abs_le.mpr + constructor <;> nlinarith + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/ExpectedDensity.lean b/lean/OAI/Analysis/IntegralMeans/ExpectedDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..86eadb8d59ac2cb30be62f1cb3f206a7a0d1e12e --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/ExpectedDensity.lean @@ -0,0 +1,117 @@ +import OAI.Analysis.IntegralMeans.AffineLaw + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight +attribute [local irreducible] classFun +attribute [local irreducible] rerootClass + +instance : PseudoMetrizableSpace DiskClass := inferInstanceAs (PseudoMetrizableSpace diskSchlichtSet) + +lemma exists_weighted_law (hρ : 2 < transferRho) : + ∃ P : ProbabilityMeasure DiskClass, ∀ z : halfPlane, ∀ f : DiskClass → ℝ≥0∞, + Measurable f → + (∫⁻ g, ENNReal.ofReal (classWeight g z)*f (rerootClass g z) ∂(P : Measure DiskClass)) = + ENNReal.ofReal ((z.val.im)^(-transferBeta))*(∫⁻ g, f g ∂(P : Measure DiskClass)) := by + obtain ⟨P,hP⟩ := exists_weighted_continuous_law hρ + refine ⟨P,fun z f hf => ?_⟩ + exact weighted_lintegral_of_continuous (P : Measure DiskClass) (weightAt z) + (fun g => (classWeight_pos g z).le) (actionAt z) ((z.val.im)^(-transferBeta)) + (Real.rpow_nonneg z.2.le _) (hP z) f hf + +def halfRetract (z : ℂ) : halfPlane := if h : z ∈ halfPlane then ⟨z,h⟩ else halfOne + +lemma halfRetract_of_mem {z : ℂ} (hz : z ∈ halfPlane) : halfRetract z = ⟨z,hz⟩ := by + simp only [halfRetract,dite_eq_left hz] + +lemma measurable_halfRetract : Measurable halfRetract := by + have hm : Measurable (fun z : ℂ => (halfRetract z : ℂ)) := by + have he : (fun z : ℂ => (halfRetract z : ℂ)) = (fun z => if z ∈ halfPlane then z else Complex.I) := by + funext z + by_cases hz : z ∈ halfPlane <;> simp [halfRetract,halfOne,hz] + rw [he] + exact measurable_id.piecewise isOpen_halfPlane.measurableSet measurable_const + exact hm.subtype_mk + +def averagedDensity (β : ℝ) (Φ : DiskClass → ℝ≥0∞) (p : DiskClass × ℂ) : ℝ≥0∞ := + {p : DiskClass × ℂ | p.2 ∈ halfPlane}.indicator + (fun p => ENNReal.ofReal (p.2.im^(β-1)) * ENNReal.ofReal (classWeight p.1 (halfRetract p.2)) * + Φ (rerootClass p.1 (halfRetract p.2))) p + +lemma measurable_averagedDensity (β : ℝ) {Φ : DiskClass → ℝ≥0∞} (hΦ : Measurable Φ) : + Measurable (averagedDensity β Φ) := by + have hm : Measurable (fun p : DiskClass × ℂ => (p.1,halfRetract p.2)) := + measurable_fst.prodMk (measurable_halfRetract.comp measurable_snd) + exact ((((Complex.measurable_im.comp measurable_snd).pow_const (β-1)).ennreal_ofReal.mul + (continuous_classWeight.measurable.comp hm).ennreal_ofReal).mul + (hΦ.comp (continuous_rerootClass.measurable.comp hm))).indicator + (isOpen_halfPlane.measurableSet.preimage measurable_snd) + +lemma averagedDensity_of_mem (β : ℝ) (Φ : DiskClass → ℝ≥0∞) (g : DiskClass) (z : halfPlane) : + averagedDensity β Φ (g,z) = transportDensity g β z * Φ (rerootClass g z) := by + rw [averagedDensity,indicator_of_mem (show (g,(z : ℂ)) ∈ {p : DiskClass × ℂ | p.2 ∈ halfPlane} from z.property)] + simp only [halfRetract_of_mem z.property] + rw [transportDensity,ENNReal.ofReal_mul (Real.rpow_nonneg z.property.le _)] + simp only [classWeight] + +lemma weighted_averagedDensity (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : ∀ z : halfPlane, ∀ f : DiskClass → ℝ≥0∞, Measurable f → + (∫⁻ g, ENNReal.ofReal (classWeight g z)*f (rerootClass g z) ∂(P : Measure DiskClass)) = + ENNReal.ofReal (z.val.im^(-β))*(∫⁻ g, f g ∂(P : Measure DiskClass))) + {Φ : DiskClass → ℝ≥0∞} (hΦ : Measurable Φ) (z : halfPlane) : + (∫⁻ g, averagedDensity β Φ (g,z) ∂(P : Measure DiskClass)) = + ENNReal.ofReal (z.val.im⁻¹) * ∫⁻ g, Φ g ∂(P : Measure DiskClass) := by + have hm : Measurable (fun g : DiskClass => ENNReal.ofReal (classWeight g z)*Φ (rerootClass g z)) := by + have hp : Measurable (fun g : DiskClass => (g,z)) := measurable_id.prodMk measurable_const + exact ((continuous_classWeight.measurable.comp hp).ennreal_ofReal).mul + (hΦ.comp (continuous_rerootClass.measurable.comp hp)) + have he : (fun g : DiskClass => averagedDensity β Φ (g,z)) = + fun g => ENNReal.ofReal (z.val.im^(β-1)) * + (ENNReal.ofReal (classWeight g z)*Φ (rerootClass g z)) := by + funext g + rw [averagedDensity,indicator_of_mem (show (g,(z : ℂ)) ∈ {p : DiskClass × ℂ | p.2 ∈ halfPlane} from z.property)] + simp only [halfRetract_of_mem z.property,mul_assoc] + rw [he,lintegral_const_mul _ hm,hP z Φ hΦ,← mul_assoc, + ← ENNReal.ofReal_mul (Real.rpow_nonneg z.property.le _),← Real.rpow_add z.property] + congr 2 + rw [show β-1 + -β = (-1 : ℝ) from by ring,Real.rpow_neg_one] + +lemma root_test_zero_of_averaging (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : ∀ z : halfPlane, ∀ f : DiskClass → ℝ≥0∞, Measurable f → + (∫⁻ g, ENNReal.ofReal (classWeight g z)*f (rerootClass g z) ∂(P : Measure DiskClass)) = + ENNReal.ofReal (z.val.im^(-β))*(∫⁻ g, f g ∂(P : Measure DiskClass))) + {Φ : DiskClass → ℝ≥0∞} (hΦ : Measurable Φ) + (hzero : ∀ᵐ g ∂(P : Measure DiskClass), (∫⁻ z in halfPlane, averagedDensity β Φ (g,z)) = 0) : + (∫⁻ g, Φ g ∂(P : Measure DiskClass)) = 0 := by + have hm := measurable_averagedDensity β hΦ + have hz : (∫⁻ z in halfPlane, ∫⁻ g, averagedDensity β Φ (g,z) ∂(P : Measure DiskClass)) = 0 := + (lintegral_lintegral_swap (f := fun g z => averagedDensity β Φ (g,z)) (μ := (P : Measure DiskClass)) (ν := volume.restrict halfPlane) hm.aemeasurable).symm.trans (lintegral_eq_zero_of_ae_eq_zero hzero) + have ha := (lintegral_eq_zero_iff hm.lintegral_prod_left').mp hz + have : (ae (volume.restrict halfPlane)).NeBot := ae_restrict_neBot.mpr + (ne_of_gt (isOpen_halfPlane.measure_pos volume ⟨Complex.I,by simp [halfPlane]⟩)) + obtain ⟨z,hz,hz0⟩ := ((ae_restrict_mem isOpen_halfPlane.measurableSet).and ha).exists + have he := weighted_averagedDensity P β hP hΦ ⟨z,hz⟩ + change (∫⁻ g, averagedDensity β Φ (g,z) ∂(P : Measure DiskClass)) = 0 at hz0 + exact (mul_eq_zero.mp (he.symm.trans hz0)).resolve_left (ne_of_gt (ENNReal.ofReal_pos.mpr (inv_pos.mpr hz))) + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/ExpectedTransport.lean b/lean/OAI/Analysis/IntegralMeans/ExpectedTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..c802f1a075588d5ea15ba5d63086a63bf4e18c3e --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/ExpectedTransport.lean @@ -0,0 +1,314 @@ +import OAI.Analysis.IntegralMeans.InverseDensity + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight +attribute [local irreducible] classFun +attribute [local irreducible] rerootClass +attribute [local irreducible] inverseDensity inverseJacDensity + +lemma lintegral_Icc_inv {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : + (∫⁻ y in Icc a b, ENNReal.ofReal y⁻¹) = ENNReal.ofReal (Real.log (b/a)) := by + have hc : ContinuousOn (fun y : ℝ => y⁻¹) (Icc a b) := + continuousOn_id.inv₀ (fun y hy => ne_of_gt (ha.trans_le hy.1)) + have hi : IntegrableOn (fun y : ℝ => y⁻¹) (Icc a b) volume := hc.integrableOn_Icc + rw [← ofReal_integral_eq_lintegral_ofReal hi] + · rw [integral_Icc_eq_integral_Ioc,← intervalIntegral.integral_of_le hab,integral_inv_of_pos ha (ha.trans_le hab)] + · filter_upwards [ae_restrict_mem measurableSet_Icc] with y hy + exact inv_nonneg.mpr (ha.le.trans hy.1) + +lemma lintegral_transportBox_inv {R a b : ℝ} (hR : 0 ≤ R) (ha : 0 < a) (hab : a ≤ b) : + (∫⁻ z in transportBox R a b, ENNReal.ofReal z.im⁻¹) = + ENNReal.ofReal (2*R*Real.log (b/a)) := by + have he : Complex.measurableEquivRealProd ⁻¹' (Icc (-R) R ×ˢ Icc a b) = transportBox R a b := by + ext z + simp only [Complex.measurableEquivRealProd_apply,mem_preimage,mem_prod,mem_Icc,transportBox,mem_ofPred_eq,abs_le] + have hprod := Complex.volume_preserving_equiv_real_prod.setLIntegral_comp_preimage_emb + Complex.measurableEquivRealProd.measurableEmbedding (fun p : ℝ × ℝ => ENNReal.ofReal p.2⁻¹) + (Icc (-R) R ×ˢ Icc a b) + rw [he] at hprod + change (∫⁻ z in transportBox R a b, ENNReal.ofReal z.im⁻¹) = _ at hprod + rw [hprod,show (volume : Measure (ℝ × ℝ)) = volume.prod volume from rfl, + setLIntegral_prod _ (by fun_prop)] + dsimp only + rw [lintegral_Icc_inv ha hab, + lintegral_const,Measure.restrict_apply_univ,Real.volume_Icc] + rw [show R - -R = 2*R from by ring,mul_comm,← ENNReal.ofReal_mul (by positivity : 0 ≤ 2*R)] + +def rootJac (k σ : ℝ) (g : DiskClass) : ℝ≥0∞ := + ENNReal.ofReal (σ * normalizedJacobian (classFun g) k Complex.I) + +lemma measurable_rootJac (k σ : ℝ) : Measurable (rootJac k σ) := by + exact (measurable_const.mul ((continuous_class_normalizedJacobian k).comp + (continuous_id.prodMk (continuous_const (y := halfOne)))).measurable).ennreal_ofReal + +lemma rootJac_reroot (g : DiskClass) {k : ℝ} (hk : 0 < k) (σ : ℝ) (z : halfPlane) : + rootJac k σ (rerootClass g z) = ENNReal.ofReal (σ * normalizedJacobian (classFun g) k z) := by + rw [rootJac,class_normalizedJacobian_root g hk z] + +def rootWindow (k N : ℝ) : Set DiskClass := {g | (g,halfOne) ∈ transportWindow k N} + +def windowTest (k N : ℝ) : DiskClass → ℝ≥0∞ := (rootWindow k N).indicator (rootJac k 1) + +lemma measurableSet_rootWindow {k : ℝ} (hk : 0 < k) (N : ℝ) : MeasurableSet (rootWindow k N) := + (measurableSet_transportWindow hk N).preimage (measurable_id.prodMk measurable_const) + +lemma measurable_windowTest {k : ℝ} (hk : 0 < k) (N : ℝ) : Measurable (windowTest k N) := + (measurable_rootJac k 1).indicator (measurableSet_rootWindow hk N) + +lemma averagedDensity_window (g : DiskClass) (β : ℝ) {k : ℝ} (hk : 0 < k) (N : ℝ) (z : halfPlane) : + averagedDensity β (windowTest k N) (g,z) = + transportDensity g β z * ENNReal.ofReal (normalizedJacobian (classFun g) k z) * + (transportSlice g k N).indicator 1 z := by + rw [averagedDensity_of_mem,windowTest] + have he : rerootClass g z ∈ rootWindow k N ↔ z.val ∈ transportSlice g k N := + (transportWindow_root g hk N z).trans (transportSlice_iff g k N z).symm + by_cases hz : z.val ∈ transportSlice g k N + · rw [indicator_of_mem (he.mpr hz),rootJac_reroot g hk 1 z,one_mul,indicator_of_mem hz] + simp + · rw [indicator_of_notMem (fun h => hz (he.mp h)),indicator_of_notMem hz] + simp + +def rootException (k : ℝ) : Set DiskClass := + {g | ¬GoodPair (classFun g) k (criticalMap (classFun g) k Complex.I)} + +def exceptionTest (k : ℝ) : DiskClass → ℝ≥0∞ := (rootException k).indicator (rootJac k 1) + +lemma measurableSet_rootException {k : ℝ} (hk : 0 < k) : MeasurableSet (rootException k) := by + have hm : Measurable (fun g : DiskClass => (g,criticalMap (classFun g) k Complex.I)) := + continuous_id.measurable.prodMk (((continuous_class_criticalMap k).comp + (continuous_id.prodMk (continuous_const (y := halfOne)))).measurable) + exact ((measurableSet_class_goodPairs hk.le).preimage hm).compl + +lemma measurable_exceptionTest {k : ℝ} (hk : 0 < k) : Measurable (exceptionTest k) := + (measurable_rootJac k 1).indicator (measurableSet_rootException hk) + +lemma averagedDensity_exception (g : DiskClass) (β : ℝ) {k : ℝ} (hk : 0 < k) (z : halfPlane) : + averagedDensity β (exceptionTest k) (g,z) = + transportDensity g β z * ENNReal.ofReal (normalizedJacobian (classFun g) k z) * + {z : ℂ | z ∈ halfPlane ∧ ¬GoodPair (classFun g) k (criticalMap (classFun g) k z)}.indicator 1 z := by + rw [averagedDensity_of_mem,exceptionTest] + have he := class_goodPair_root g hk z + by_cases hg : GoodPair (classFun g) k (criticalMap (classFun g) k z) + · rw [indicator_of_notMem (show rerootClass g z ∉ rootException k from fun h => h (he.mpr hg)), + indicator_of_notMem (show z.val ∉ {z : ℂ | z ∈ halfPlane ∧ ¬GoodPair (classFun g) k (criticalMap (classFun g) k z)} from fun h => h.2 hg)] + simp + · rw [indicator_of_mem (show rerootClass g z ∈ rootException k from fun h => hg (he.mp h)), + rootJac_reroot g hk 1 z,one_mul,indicator_of_mem (show z.val ∈ {z : ℂ | z ∈ halfPlane ∧ ¬GoodPair (classFun g) k (criticalMap (classFun g) k z)} from ⟨z.property,hg⟩)] + simp + +lemma exceptionTest_integral_zero (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : HasWeightedLaw P β) {k : ℝ} (hk : 0 < k) + (hg : ∀ᵐ g ∂(P : Measure DiskClass), ∀ᵐ ξ : ℂ, GoodPair (classFun g) k ξ) : + (∫⁻ g, exceptionTest k g ∂(P : Measure DiskClass)) = 0 := by + apply root_test_zero_of_averaging P β hP (measurable_exceptionTest hk) + filter_upwards [hg] with g hg + refine Eq.trans ?_ (exceptional_transport_zero g (β := β) hk hg) + apply setLIntegral_congr_fun isOpen_halfPlane.measurableSet + intro z hz + exact averagedDensity_exception g β hk ⟨z,hz⟩ + +lemma averagedDensity_box (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : HasWeightedLaw P β) {Φ : DiskClass → ℝ≥0∞} (hΦ : Measurable Φ) + {R a b : ℝ} (hR : 0 ≤ R) (ha : 0 < a) (hab : a ≤ b) : + (∫⁻ g, ∫⁻ z in transportBox R a b, averagedDensity β Φ (g,z) ∂volume ∂(P : Measure DiskClass)) = + ENNReal.ofReal (2*R*Real.log (b/a)) * ∫⁻ g, Φ g ∂(P : Measure DiskClass) := by + rw [lintegral_lintegral_swap (f := fun g z => averagedDensity β Φ (g,z)) (μ := (P : Measure DiskClass)) (ν := volume.restrict (transportBox R a b)) (measurable_averagedDensity β hΦ).aemeasurable] + have he : (∫⁻ z in transportBox R a b, ∫⁻ g, averagedDensity β Φ (g,z) ∂(P : Measure DiskClass)) = + ∫⁻ z in transportBox R a b, ENNReal.ofReal z.im⁻¹ * ∫⁻ g, Φ g ∂(P : Measure DiskClass) := by + apply setLIntegral_congr_fun (measurableSet_transportBox R a b) + intro z hz + exact weighted_averagedDensity P β hP hΦ ⟨z,ha.trans_le hz.2.1⟩ + rw [he,lintegral_mul_const _ (by fun_prop),lintegral_transportBox_inv hR ha hab] + +lemma setLIntegral_mul_indicator_one {S T : Set ℂ} (hS : MeasurableSet S) (hST : S ⊆ T) + (f : ℂ → ℝ≥0∞) : + (∫⁻ z in T, f z * S.indicator 1 z) = ∫⁻ z in S, f z := by + have he : (fun z => f z * S.indicator 1 z) = S.indicator f := by + funext z + by_cases hz : z ∈ S <;> simp [hz] + rw [he,setLIntegral_indicator hS,inter_eq_left.mpr hST] + +lemma transport_box_averaged (g : DiskClass) {β k N R Y : ℝ} (hk : 0 < k) + (hb : β-1 = 4*(k-1)) (hN : 1 ≤ N) : + (∫⁻ z in transportBox R 1 Y, averagedDensity β (windowTest k N) (g,z)) ≤ + ∫⁻ z in transportBox (R+N*Y) (1/N) (N*Y), averagedDensity β (rootJac k (-1)) (g,z) := by + have hn : 0 < N := lt_of_lt_of_le zero_lt_one hN + have hB : transportBox R 1 Y ⊆ halfPlane := fun z hz => lt_of_lt_of_le zero_lt_one hz.2.1 + have hB' : transportBox (R+N*Y) (1/N) (N*Y) ⊆ halfPlane := fun z hz => + lt_of_lt_of_le (one_div_pos.mpr hn) hz.2.1 + have he := transport_box g hk hb hN (R := R) (Y := Y) + have hp : (∫⁻ z in halfPlane, transportDensity g β z*ENNReal.ofReal (normalizedJacobian (classFun g) k z)* + (transportSlice g k N ∩ transportBox R 1 Y).indicator 1 z) = + ∫⁻ z in transportBox R 1 Y, averagedDensity β (windowTest k N) (g,z) := by + have hid : (fun z => transportDensity g β z*ENNReal.ofReal (normalizedJacobian (classFun g) k z)* + (transportSlice g k N ∩ transportBox R 1 Y).indicator 1 z) = + fun z => (transportDensity g β z*ENNReal.ofReal (normalizedJacobian (classFun g) k z)* + (transportSlice g k N).indicator 1 z)*(transportBox R 1 Y).indicator 1 z := by + funext z + rw [inter_indicator_one] + simp only [Pi.mul_apply,mul_assoc] + rw [hid,setLIntegral_mul_indicator_one (measurableSet_transportBox _ _ _) hB] + apply setLIntegral_congr_fun (measurableSet_transportBox _ _ _) + intro z hz + exact (averagedDensity_window g β hk N ⟨z,hB hz⟩).symm + have hm : (∫⁻ z in halfPlane, transportDensity g β z*ENNReal.ofReal (-normalizedJacobian (classFun g) k z)* + (transportBox (R+N*Y) (1/N) (N*Y)).indicator 1 z) = + ∫⁻ z in transportBox (R+N*Y) (1/N) (N*Y), averagedDensity β (rootJac k (-1)) (g,z) := by + rw [setLIntegral_mul_indicator_one (measurableSet_transportBox _ _ _) hB'] + apply setLIntegral_congr_fun (measurableSet_transportBox _ _ _) + intro z hz + symm + exact (averagedDensity_of_mem β (rootJac k (-1)) g ⟨z,hB' hz⟩).trans + (congrArg (transportDensity g β z * ·) (by simpa only [neg_one_mul] using rootJac_reroot g hk (-1) ⟨z,hB' hz⟩)) + exact hp.symm.trans_le (he.trans_eq hm) + +lemma expected_transport_box (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : HasWeightedLaw P β) {k N R Y : ℝ} (hk : 0 < k) + (hb : β-1 = 4*(k-1)) (hN : 1 ≤ N) (hR : 0 ≤ R) (hY : 1 ≤ Y) : + ENNReal.ofReal (2*R*Real.log Y) * (∫⁻ g, windowTest k N g ∂(P : Measure DiskClass)) ≤ + ENNReal.ofReal (2*(R+N*Y)*Real.log (N^2*Y)) * (∫⁻ g, rootJac k (-1) g ∂(P : Measure DiskClass)) := by + have hn : 0 < N := lt_of_lt_of_le zero_lt_one hN + have hny : 1 / N ≤ N*Y := by + rw [div_le_iff₀ hn] + have hc := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hY hn.le) hn.le + nlinarith [sq_nonneg (N-1)] + have hp := averagedDensity_box P β hP (measurable_windowTest hk N) hR zero_lt_one hY + have hm := averagedDensity_box P β hP (measurable_rootJac k (-1)) + (add_nonneg hR (mul_nonneg hn.le (zero_le_one.trans hY))) (one_div_pos.mpr hn) hny + simp only [div_one] at hp + rw [show N*Y/(1/N) = N^2*Y from by field_simp] at hm + rw [← hp,← hm] + exact lintegral_mono (fun g => transport_box_averaged g hk hb hN) + +lemma transport_ratio_tendsto (N : ℝ) : + Tendsto (fun Y : ℝ => (1+N/Y)*(1+2*Real.log N/Real.log Y)) atTop (𝓝 1) := by + have h1 : Tendsto (fun Y : ℝ => N/Y) atTop (𝓝 0) := tendsto_const_nhds.div_atTop tendsto_id + have h2 : Tendsto (fun Y : ℝ => 2*Real.log N/Real.log Y) atTop (𝓝 0) := + tendsto_const_nhds.div_atTop Real.tendsto_log_atTop + simpa using ((tendsto_const_nhds (x := (1 : ℝ))).add h1).mul ((tendsto_const_nhds (x := (1 : ℝ))).add h2) + +lemma transport_box_limit {A B : ℝ≥0∞} (hA : A ≠ ∞) (hB : B ≠ ∞) + {N : ℝ} (hN : 1 ≤ N) + (h : ∀ Y : ℝ, 1 < Y → + ENNReal.ofReal (2*Y^2*Real.log Y)*A ≤ + ENNReal.ofReal (2*(Y^2+N*Y)*Real.log (N^2*Y))*B) : A ≤ B := by + have hn : 0 < N := zero_lt_one.trans_le hN + have hineq : ∀ Y : ℝ, 1 < Y → A.toReal ≤ (1+N/Y)*(1+2*Real.log N/Real.log Y)*B.toReal := by + intro Y hY + have hy : 0 < Y := zero_lt_one.trans hY + have hl : 0 < Real.log Y := Real.log_pos hY + have hny : 1 < N^2*Y := by nlinarith [sq_nonneg (N-1)] + have hlny : 0 ≤ Real.log (N^2*Y) := Real.log_nonneg hny.le + have hb := ENNReal.toReal_mono (ENNReal.mul_ne_top ENNReal.ofReal_ne_top hB) (h Y hY) + rw [ENNReal.toReal_mul,ENNReal.toReal_mul,ENNReal.toReal_ofReal (by positivity : 0 ≤ 2*Y^2*Real.log Y), + ENNReal.toReal_ofReal (by positivity : 0 ≤ 2*(Y^2+N*Y)*Real.log (N^2*Y))] at hb + have hlog : Real.log (N^2*Y) = 2*Real.log N + Real.log Y := by + rw [Real.log_mul (by positivity) (ne_of_gt hy),Real.log_pow] + norm_num + rw [hlog] at hb + apply (mul_le_mul_iff_right₀ (show 0 < 2*Y^2*Real.log Y by positivity)).mp + calc + _ ≤ 2*(Y^2+N*Y)*(2*Real.log N+Real.log Y)*B.toReal := hb + _ = _ := by field_simp; ring + apply (ENNReal.toReal_le_toReal hA hB).mp + have ht := (transport_ratio_tendsto N).mul_const B.toReal + simp only [one_mul] at ht + apply ge_of_tendsto ht + filter_upwards [eventually_gt_atTop (1 : ℝ)] with Y hY + exact hineq Y hY + +lemma rootJac_integral_lt_top (P : ProbabilityMeasure DiskClass) (k σ : ℝ) : + (∫⁻ g, rootJac k σ g ∂(P : Measure DiskClass)) < ∞ := by + have hc : Continuous (fun g : DiskClass => σ*normalizedJacobian (classFun g) k Complex.I) := + continuous_const.mul ((continuous_class_normalizedJacobian k).comp + (continuous_id.prodMk (continuous_const (y := halfOne)))) + have hi : Integrable (fun g : DiskClass => σ*normalizedJacobian (classFun g) k Complex.I) (P : Measure DiskClass) := + hc.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + apply lt_of_le_of_lt (lintegral_mono (fun g => ENNReal.ofReal_le_ofReal (le_abs_self _))) + exact (hasFiniteIntegral_iff_norm _).mp hi.2 + +lemma windowTest_le (k N : ℝ) (g : DiskClass) : windowTest k N g ≤ rootJac k 1 g := by + by_cases hg : g ∈ rootWindow k N <;> simp [windowTest,indicator_of_mem,indicator_of_notMem,hg] + +lemma windowTest_integral_lt_top (P : ProbabilityMeasure DiskClass) (k N : ℝ) : + (∫⁻ g, windowTest k N g ∂(P : Measure DiskClass)) < ∞ := + (lintegral_mono (windowTest_le k N)).trans_lt (rootJac_integral_lt_top P k 1) + +lemma windowTest_mono {k : ℝ} (hk : 0 < k) : + Monotone (fun n : ℕ => windowTest k (n+1)) := by + intro n m hnm g + have hs : rootWindow k (n+1) ⊆ rootWindow k (m+1) := + fun g hg => transportWindow_mono hk (by exact_mod_cast Nat.add_le_add_right hnm 1) hg + by_cases hg : g ∈ rootWindow k (n+1) + · simp only [windowTest,indicator_of_mem hg,indicator_of_mem (hs hg),le_refl] + · simp only [windowTest,indicator_of_notMem hg] + exact bot_le + +lemma iSup_windowTest {k : ℝ} (hk : 0 < k) (g : DiskClass) : + (⨆ n : ℕ, windowTest k (n+1) g) = + {g : DiskClass | (g,halfOne) ∈ pairingDomain k}.indicator (rootJac k 1) g := by + by_cases hg : (g,halfOne) ∈ pairingDomain k + · rw [indicator_of_mem (show g ∈ {g : DiskClass | (g,halfOne) ∈ pairingDomain k} from hg)] + apply le_antisymm (iSup_le (fun n : ℕ => windowTest_le k (n+1) g)) + have hu : (g,halfOne) ∈ ⋃ n : ℕ, transportWindow k (n+1) := (iUnion_transportWindow hk).symm ▸ hg + obtain ⟨n,hn⟩ := mem_iUnion.mp hu + have he : windowTest k (n+1) g = rootJac k 1 g := indicator_of_mem (show g ∈ rootWindow k (n+1) from hn) _ + exact he ▸ le_iSup (fun n : ℕ => windowTest k (n+1) g) n + · rw [indicator_of_notMem (show g ∉ {g : DiskClass | (g,halfOne) ∈ pairingDomain k} from hg)] + apply le_antisymm _ bot_le + apply iSup_le + intro n + apply le_of_eq + apply indicator_of_notMem + intro hn + exact hg hn.1 + +lemma rootJac_eq_window_exception {k : ℝ} (hk : 0 < k) (g : DiskClass) : + rootJac k 1 g = (⨆ n : ℕ, windowTest k (n+1) g) + exceptionTest k g := by + rw [iSup_windowTest hk g,exceptionTest] + by_cases hG : GoodPair (classFun g) k (criticalMap (classFun g) k Complex.I) + · rw [indicator_of_notMem (show g ∉ rootException k from fun h => h hG),add_zero] + by_cases hJ : 0 < normalizedJacobian (classFun g) k Complex.I + · exact (indicator_of_mem (show g ∈ {g : DiskClass | (g,halfOne) ∈ pairingDomain k} from ⟨hJ,hG⟩) _).symm + · rw [indicator_of_notMem (show g ∉ {g : DiskClass | (g,halfOne) ∈ pairingDomain k} from fun h => hJ h.1)] + exact ENNReal.ofReal_eq_zero.mpr (by simpa only [one_mul] using le_of_not_gt hJ) + · rw [indicator_of_mem (show g ∈ rootException k from hG),indicator_of_notMem (show g ∉ {g : DiskClass | (g,halfOne) ∈ pairingDomain k} from fun h => hG h.2),zero_add] + +lemma jacobian_positive_le_negative (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : HasWeightedLaw P β) {k : ℝ} (hk : 0 < k) + (hb : β-1 = 4*(k-1)) + (hg : ∀ᵐ g ∂(P : Measure DiskClass), ∀ᵐ ξ : ℂ, GoodPair (classFun g) k ξ) : + (∫⁻ g, rootJac k 1 g ∂(P : Measure DiskClass)) ≤ ∫⁻ g, rootJac k (-1) g ∂(P : Measure DiskClass) := by + have hw (n : ℕ) : (∫⁻ g, windowTest k (n+1) g ∂(P : Measure DiskClass)) ≤ ∫⁻ g, rootJac k (-1) g ∂(P : Measure DiskClass) := by + apply transport_box_limit (N := (n:ℝ)+1) (windowTest_integral_lt_top P k (n+1)).ne (rootJac_integral_lt_top P k (-1)).ne + (by have h := Nat.cast_nonneg (α := ℝ) n; linarith : (1 : ℝ) ≤ n+1) + intro Y hY + exact expected_transport_box P β hP hk hb (by have h := Nat.cast_nonneg (α := ℝ) n; linarith) (sq_nonneg Y) hY.le + have he (g : DiskClass) := rootJac_eq_window_exception hk g + simp_rw [he] + rw [lintegral_add_left (Measurable.iSup (fun n : ℕ => measurable_windowTest hk (n+1))), + exceptionTest_integral_zero P β hP hk hg,add_zero,lintegral_iSup (fun n : ℕ => measurable_windowTest hk (n+1)) (windowTest_mono hk)] + exact iSup_le hw + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/GoodPairs.lean b/lean/OAI/Analysis/IntegralMeans/GoodPairs.lean new file mode 100644 index 0000000000000000000000000000000000000000..38f90959f2752b6ad7f8bd57ee50a0ce4a8ad69d --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/GoodPairs.lean @@ -0,0 +1,292 @@ +import OAI.Analysis.IntegralMeans.BoundaryEscape + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight +attribute [local irreducible] classFun + +lemma compact_sublevels_iff_exhaustion.{u_1} {X : Type u_1} [TopologicalSpace X] [T2Space X] + (K : CompactExhaustion X) {f : X → ℝ} (hf : Continuous f) : + (∀ r : ℝ, IsCompact {x | f x ≤ r}) ↔ + ∀ n : ℕ, ∃ m : ℕ, ∀ x : X, x ∉ K m → (n : ℝ) ≤ f x := by + constructor + · intro h n + obtain ⟨m,hm⟩ := K.exists_superset_of_isCompact (h n) + refine ⟨m,fun x hx => ?_⟩ + by_contra! hh + exact hx (hm hh.le) + · intro h r + obtain ⟨n,hn⟩ := exists_nat_gt r + obtain ⟨m,hm⟩ := h n + apply (K.isCompact m).of_isClosed_subset (isClosed_le hf continuous_const) + intro x hx + by_contra hh + exact (not_lt_of_ge ((hm x hh).trans hx)) hn + +lemma measurableSet_compact_sublevels.{u_1, u_2} {P : Type u_1} {X : Type u_2} + [TopologicalSpace P] [MeasurableSpace P] [BorelSpace P] + [TopologicalSpace X] [T2Space X] [WeaklyLocallyCompactSpace X] [SigmaCompactSpace X] + {f : P → X → ℝ} (hp : ∀ x, Continuous (fun p => f p x)) + (hx : ∀ p, Continuous (f p)) : + MeasurableSet {p | ∀ r : ℝ, IsCompact {x | f p x ≤ r}} := by + let K := CompactExhaustion.choice X + have he : {p | ∀ r : ℝ, IsCompact {x | f p x ≤ r}} = + ⋂ n : ℕ, ⋃ m : ℕ, ⋂ x : X, ⋂ (_ : x ∉ K m), {p | (n : ℝ) ≤ f p x} := by + ext p + simp only [mem_ofPred_eq,mem_iInter,mem_iUnion] + exact compact_sublevels_iff_exhaustion K (hx p) + rw [he] + apply MeasurableSet.iInter + intro n + apply MeasurableSet.iUnion + intro m + apply IsClosed.measurableSet + apply isClosed_iInter + intro x + apply isClosed_iInter + intro _ + exact isClosed_le continuous_const (hp x) + +lemma compact_sublevels_iff_positive.{u_1} {X : Type u_1} [TopologicalSpace X] [T2Space X] + {f : X → ℝ} (hf : Continuous f) : + (∀ r : ℝ, IsCompact {x | f x ≤ r}) ↔ ∀ r : ℝ, 0 < r → IsCompact {x | f x ≤ r} := by + refine ⟨fun h r _ => h r,fun h r => ?_⟩ + exact (h (max r 1) (lt_of_lt_of_le (by norm_num) (le_max_right _ _))).of_isClosed_subset + (isClosed_le hf continuous_const) (fun x hx => (show f x ≤ r from hx).trans (le_max_left _ _)) + +lemma compact_positive_superlevels_iff {F : ℂ → ℂ} (k : ℝ) (ξ : ℂ) + (hc : ContinuousOn F halfPlane) : + (∀ δ : ℝ, 0 < δ → IsCompact (closedPositiveSuperlevel F k δ ξ)) ↔ + ∀ r : ℝ, IsCompact {z : halfPlane | ‖F z-ξ‖/z.val.im^k ≤ r} := by + have hy (z : halfPlane) : 0 < z.val.im^k := Real.rpow_pos_of_pos z.property k + have hcont : Continuous (fun z : halfPlane => ‖F z-ξ‖/z.val.im^k) := by + refine ((hc.domRestrict.sub continuous_const).norm).div ?_ (fun z => ne_of_gt (hy z)) + exact (Complex.continuous_im.comp continuous_subtype_val).rpow_const + (fun z => Or.inl (ne_of_gt z.property)) + rw [compact_sublevels_iff_positive hcont] + have he (r : ℝ) (hr : 0 < r) : + Subtype.val '' {z : halfPlane | ‖F z-ξ‖/z.val.im^k ≤ r} = + closedPositiveSuperlevel F k (1/r) ξ := by + ext z + simp only [mem_image,mem_ofPred_eq,closedPositiveSuperlevel] + constructor + · rintro ⟨w,hw,rfl⟩ + refine ⟨w.property,?_⟩ + rw [div_le_iff₀ (hy w)] at hw + simpa only [one_div, div_inv_eq_mul, mul_comm r] using hw + · rintro ⟨hz,hzv⟩ + refine ⟨⟨z,hz⟩,?_,rfl⟩ + rw [div_le_iff₀ (hy ⟨z,hz⟩)] + simpa only [one_div, div_inv_eq_mul, mul_comm r] using hzv + constructor + · intro h r hr + apply Topology.IsEmbedding.subtypeVal.isCompact_iff.mpr + rw [he r hr] + exact h (1/r) (by positivity) + · intro h δ hδ + have hh := (h (1/δ) (by positivity)).image continuous_subtype_val + rw [he (1/δ) (by positivity)] at hh + simpa only [one_div_one_div] using hh + +lemma measurableSet_compact_positive_superlevels.{u_1} {P : Type u_1} + [TopologicalSpace P] [MeasurableSpace P] [BorelSpace P] + {F : P → ℂ → ℂ} (hF : Continuous (fun p : P × halfPlane => F p.1 p.2)) (k : ℝ) : + MeasurableSet {p : P × ℂ | ∀ δ : ℝ, 0 < δ → + IsCompact (closedPositiveSuperlevel (F p.1) k δ p.2)} := by + let f : (P × ℂ) → halfPlane → ℝ := fun p z => ‖F p.1 z-p.2‖/z.val.im^k + have hc (p : P × ℂ) : ContinuousOn (F p.1) halfPlane := by + apply continuousOn_iff_continuous_domRestrict.mpr + exact hF.comp (continuous_const.prodMk continuous_id) + have he : {p : P × ℂ | ∀ δ : ℝ, 0 < δ → + IsCompact (closedPositiveSuperlevel (F p.1) k δ p.2)} = + {p | ∀ r : ℝ, IsCompact {z : halfPlane | f p z ≤ r}} := by + ext p + exact compact_positive_superlevels_iff k p.2 (hc p) + rw [he] + apply measurableSet_compact_sublevels + · intro z + exact (((hF.comp (continuous_fst.prodMk continuous_const)).sub continuous_snd).norm).div_const _ + · intro p + refine (((hc p).domRestrict.sub continuous_const).norm).div ?_ + (fun z => ne_of_gt (Real.rpow_pos_of_pos z.property k)) + exact (Complex.continuous_im.comp continuous_subtype_val).rpow_const + (fun z => Or.inl (ne_of_gt z.property)) + +lemma measurableSet_regular_parameters.{u_1, u_2, u_3} {P : Type u_1} {X : Type u_2} {Y : Type u_3} + [TopologicalSpace P] [SigmaCompactSpace P] + [TopologicalSpace X] [SigmaCompactSpace X] + [TopologicalSpace Y] [T2Space Y] [T2Space P] + [MeasurableSpace P] [BorelSpace P] [MeasurableSpace Y] [BorelSpace Y] + [SecondCountableTopology P] [SecondCountableTopology Y] + {F : P → X → Y} {J : P → X → ℝ} + (hF : Continuous (fun q : P × X => F q.1 q.2)) + (hJ : Continuous (fun q : P × X => J q.1 q.2)) : + MeasurableSet {q : P × Y | ∀ x, F q.1 x = q.2 → J q.1 x ≠ 0} := by + let Z : Set (P × X) := {q | J q.1 q.2 = 0} + let M : P × X → P × Y := fun q => (q.1,F q.1 q.2) + have hZ : IsSigmaCompact Z := isSigmaCompact_univ.of_isClosed_subset + (isClosed_eq hJ continuous_const) (subset_univ _) + have hM : Continuous M := continuous_fst.prodMk hF + have him : MeasurableSet (M '' Z) := by + obtain ⟨K,hK,he⟩ := hZ.image hM + rw [← he] + exact MeasurableSet.iUnion (fun n => (hK n).isClosed.measurableSet) + have he : {q : P × Y | ∀ x, F q.1 x = q.2 → J q.1 x ≠ 0} = (M '' Z)ᶜ := by + ext q + constructor + · intro h ⟨⟨p,x⟩,hx,hq⟩ + have hp : p = q.1 := congrArg Prod.fst hq + have hf : F p x = q.2 := congrArg Prod.snd hq + exact h x (hp ▸ hf) (hp ▸ hx) + · intro h x hx hJx + exact h ⟨(q.1,x),hJx,Prod.ext rfl hx⟩ + rw [he] + exact him.compl + +lemma ae_regular_values {f : ℂ → ℂ} {s : Set ℂ} + (hf : ∀ z ∈ s, DifferentiableAt ℝ f z) : + ∀ᵐ ξ ∂volume, ∀ z ∈ s, f z = ξ → LinearMap.det (fderiv ℝ f z).toLinearMap ≠ 0 := by + let t : Set ℂ := {z | z ∈ s ∧ LinearMap.det (fderiv ℝ f z).toLinearMap = 0} + have hz : volume (f '' t) = 0 := + addHaar_image_eq_zero_of_det_fderivWithin_eq_zero volume + (fun z hz => (hf z hz.1).hasFDerivAt.hasFDerivWithinAt) (fun z hz => hz.2) + filter_upwards [show ∀ᵐ ξ ∂volume, ξ ∉ f '' t from ae_iff.mpr (by simpa only [not_not, Set.ofPred_mem_eq] using hz)] with ξ hξ z hzs hfz hdet + exact hξ ⟨z,⟨hzs,hdet⟩,hfz⟩ + +lemma potential_superlevel_eq_closed {f : ℂ → ℂ} {k δ : ℝ} (hk : 0 ≤ k) (hδ : 0 < δ) (ξ : ℂ) : + {z | z ∈ halfPlane ∧ ENNReal.ofReal δ ≤ potential f k ξ z} = + closedPositiveSuperlevel f k δ ξ := by + ext z + by_cases hz : z ∈ halfPlane + · simp only [mem_ofPred_eq,closedPositiveSuperlevel,show 0 < z.im from hz,hz,true_and] + rw [potential_ge_iff_reciprocalPotential_le hk hδ hz,reciprocalPotential, + div_le_iff₀ (Real.rpow_pos_of_pos hz k),inv_mul_eq_div] + · simp only [mem_ofPred_eq,hz,false_and,closedPositiveSuperlevel] + exact iff_false_intro (fun h => hz h.1) |>.symm + +lemma measurableSet_class_goodPairs {k : ℝ} (hk : 0 ≤ k) : + MeasurableSet {p : DiskClass × ℂ | GoodPair (classFun p.1) k p.2} := by + have hcompact := measurableSet_compact_positive_superlevels continuous_classFun_eval k + have hregular := measurableSet_regular_parameters (F := fun g (z : halfPlane) => criticalMap (classFun g) k z) (J := fun g (z : halfPlane) => normalizedJacobian (classFun g) k z) (continuous_class_criticalMap k) + (continuous_class_normalizedJacobian k) + have he : {p : DiskClass × ℂ | GoodPair (classFun p.1) k p.2} = + {p : DiskClass × ℂ | ∀ δ : ℝ, 0 < δ → + IsCompact (closedPositiveSuperlevel (classFun p.1) k δ p.2)} ∩ + {p : DiskClass × ℂ | ∀ z : halfPlane, + criticalMap (classFun p.1) k z = p.2 → normalizedJacobian (classFun p.1) k z ≠ 0} := by + ext p + simp only [mem_inter_iff,mem_ofPred_eq,GoodPair] + constructor + · rintro ⟨hc,hr⟩ + exact ⟨fun δ hδ => (potential_superlevel_eq_closed hk hδ p.2) ▸ hc δ hδ, + fun z => hr z z.property⟩ + · rintro ⟨hc,hr⟩ + exact ⟨fun δ hδ => (potential_superlevel_eq_closed hk hδ p.2).symm ▸ hc δ hδ, + fun z hz => hr ⟨z,hz⟩⟩ + rw [he] + exact hcompact.inter hregular + +lemma class_ae_goodPairs (g : DiskClass) {β : ℝ} (hβ : 1 < β) + (hfin : (∫⁻ z in outsideCore, + ENNReal.ofReal (z.im^(β+1)*‖classFun g z‖⁻¹^4)) < ∞) : + ∀ᵐ ξ : ℂ, GoodPair (classFun g) ((β+3)/4) ξ := by + have hc := class_ae_compact_superlevels g hβ hfin + have hr := ae_regular_values (s := halfPlane) + (fun z hz => differentiableAt_criticalMap (classFun_schlicht g).1 hz ((β+3)/4)) + filter_upwards [hc,hr] with ξ hc hr + refine ⟨fun δ hδ => ?_,fun z hz hG => ?_⟩ + · rw [potential_superlevel_eq_closed (by linarith : 0 ≤ (β+3)/4) hδ] + exact hc δ hδ + · exact div_ne_zero (hr z hz hG) (pow_ne_zero _ (norm_ne_zero_iff.mpr + (univalent_deriv_ne_zero isOpen_halfPlane (classFun_schlicht g).1 hz))) + +def pairingDomain (k : ℝ) : Set (DiskClass × halfPlane) := + {q | 0 < normalizedJacobian (classFun q.1) k q.2 ∧ + GoodPair (classFun q.1) k (criticalMap (classFun q.1) k q.2)} + +lemma measurableSet_pairingDomain {k : ℝ} (hk : 0 ≤ k) : MeasurableSet (pairingDomain k) := by + have hJ : Measurable (fun q : DiskClass × halfPlane => normalizedJacobian (classFun q.1) k q.2) := + (continuous_class_normalizedJacobian k).measurable + have hG := (measurableSet_class_goodPairs hk).preimage (continuous_jointCriticalMap k).measurable + change MeasurableSet {q : DiskClass × halfPlane | GoodPair (classFun q.1) k (criticalMap (classFun q.1) k q.2)} at hG + exact (measurableSet_lt measurable_const hJ).inter hG + +lemma criticalPair_eq_of_classRanks {k : ℝ} (hk : 0 < k) (q r : DiskClass × halfPlane) + (hg : GoodPair (classFun q.1) k (criticalMap (classFun q.1) k q.2)) + (he : jointCriticalMap k r = jointCriticalMap k q) + (hJ : normalizedJacobian (classFun r.1) k r.2 < 0) + (hr : classRankCount k (-1) r = classRankCount k 1 q) : + criticalPair (classFun q.1) k q.2 = r.2 := by + rcases q with ⟨g,z⟩ + rcases r with ⟨h,w⟩ + have hp : h = g := congrArg Prod.fst he + subst h + have hG : criticalMap (classFun g) k w = criticalMap (classFun g) k z := congrArg Prod.snd he + have hgw : GoodPair (classFun g) k (criticalMap (classFun g) k w) := hG ▸ hg + rw [classRankCount_eq_heightRank hk (-1) (g,w) hgw, + classRankCount_eq_heightRank hk 1 (g,z) hg,signedFiber_neg_one,signedFiber_one,hG] at hr + have heq : heightRank (criticalHeight (classFun g) k) (negativeFiber (classFun g) k (criticalMap (classFun g) k z)) w = + heightRank (criticalHeight (classFun g) k) (positiveFiber (classFun g) k (criticalMap (classFun g) k z)) z := by + exact_mod_cast hr + exact rankPartner_eq (criticalHeight_rank_inj (classFun_schlicht g).1 hk hg).2 ⟨w.property,hG,hJ⟩ heq + +lemma measurable_criticalPair {k : ℝ} (hk : 0 < k) : + Measurable (fun q : pairingDomain k => criticalPair (classFun q.val.1) k q.val.2) := by + let B := Classical.choice (exists_class_branches k) + let y : pairingDomain k → DiskClass × ℂ := fun q => jointCriticalMap k q.val + let b : ℕ → pairingDomain k → DiskClass × halfPlane := fun n q => B.branch n (y q) + let M : ℕ → Set (pairingDomain k) := fun n => {q | y q ∈ jointCriticalMap k '' B.part n ∧ + normalizedJacobian (classFun (b n q).1) k (b n q).2 < 0 ∧ + classRankCount k (-1) (b n q) = classRankCount k 1 q.val} + have hym : Measurable y := (continuous_jointCriticalMap k).measurable.comp measurable_subtype_coe + have hbm (n) : Measurable (b n) := (B.measurable_branch n).comp hym + apply measurable_branch_selection (b := fun n q => (b n q).2.val) (M := M) + · intro n + exact measurable_subtype_coe.comp ((hbm n).snd) + · intro n + exact ((B.measurable_image n).preimage hym).inter + ((measurableSet_lt ((continuous_class_normalizedJacobian k).measurable.comp (hbm n)) measurable_const).inter + (measurableSet_eq_fun ((measurable_classRankCount k (-1)).comp (hbm n)) + ((measurable_classRankCount k 1).comp measurable_subtype_coe))) + · intro q + obtain ⟨w,hw,_,hr⟩ := exists_critical_equalRank (classFun_schlicht q.val.1).1 hk q.property.2 + (show q.val.2.val ∈ positiveFiber (classFun q.val.1) k (criticalMap (classFun q.val.1) k q.val.2) from + ⟨q.val.2.property,rfl,q.property.1⟩) + let r : DiskClass × halfPlane := (q.val.1,⟨w,hw.1⟩) + have hG : jointCriticalMap k r = y q := Prod.ext rfl hw.2.1 + have hns : r ∈ nonsingularClass k := ne_of_lt hw.2.2 + obtain ⟨n,hn⟩ := mem_iUnion.mp (B.cover.symm ▸ hns) + have hb : b n q = r := by + dsimp [b] + rw [← hG] + exact B.left_inv n r hn + refine ⟨n,⟨⟨r,hn,hG⟩,?_,?_⟩⟩ + · simpa only [hb] using hw.2.2 + · rw [hb,classRankCount_eq_heightRank hk (-1) r (by simpa only [r,hw.2.1] using q.property.2), + classRankCount_eq_heightRank hk 1 q.val q.property.2,signedFiber_neg_one,signedFiber_one] + simpa only [r,hw.2.1] using congrArg (fun n : ℕ => (n : ℝ≥0∞)) hr + · intro n q hq + exact criticalPair_eq_of_classRanks hk q.val (b n q) q.property.2 + (B.right_inv n (y q) hq.1).2 hq.2.1 hq.2.2 + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/HalfPlane.lean b/lean/OAI/Analysis/IntegralMeans/HalfPlane.lean new file mode 100644 index 0000000000000000000000000000000000000000..8656e1ec13c8750069b90c9dafbd34e779f66e1d --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/HalfPlane.lean @@ -0,0 +1,418 @@ +import OAI.Analysis.IntegralMeans.CompactClass + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +def halfPlane : Set ℂ := {z | 0 < z.im} + +lemma isOpen_halfPlane : IsOpen halfPlane := + isOpen_lt continuous_const Complex.continuous_im + +def HalfPlaneSchlicht (f : ℂ → ℂ) : Prop := + UnivalentOn f halfPlane ∧ f Complex.I = 0 ∧ deriv f Complex.I = 1 + +def affine (z w : ℂ) : ℂ := (z.re : ℂ) + (z.im : ℂ) * w + +@[simp] lemma affine_I (z : ℂ) : affine z Complex.I = z := by + apply Complex.ext <;> simp [affine] + +@[simp] lemma I_affine (w : ℂ) : affine Complex.I w = w := by + simp [affine] + +lemma affine_assoc (z w u : ℂ) : affine (affine z w) u = affine z (affine w u) := by + apply Complex.ext <;> simp [affine, Complex.mul_re, Complex.mul_im] <;> ring + +lemma affine_mem {z w : ℂ} (hz : z ∈ halfPlane) (hw : w ∈ halfPlane) : + affine z w ∈ halfPlane := by + change 0 < (affine z w).im + simpa [affine] using mul_pos hz hw + +lemma affine_injective {z : ℂ} (hz : z ∈ halfPlane) : Function.Injective (affine z) := by + intro u v h + dsimp [affine] at h + exact (mul_left_cancel₀ (Complex.ofReal_ne_zero.mpr (ne_of_gt hz))) (add_left_cancel h) + +lemma hasDerivAt_affine (z w : ℂ) : HasDerivAt (affine z) (z.im : ℂ) w := by + convert (hasDerivAt_const w (z.re : ℂ)).add + ((hasDerivAt_id w).const_mul (z.im : ℂ)) using 1 <;> first | rfl | simp + +def reroot (f : ℂ → ℂ) (z w : ℂ) : ℂ := + (f (affine z w) - f z) / ((z.im : ℂ) * deriv f z) + +lemma hasDerivAt_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z w : ℂ} (hz : z ∈ halfPlane) (hw : w ∈ halfPlane) : + HasDerivAt (reroot f z) (deriv f (affine z w) / deriv f z) w := by + have hfd := (hf.1 (affine z w) (affine_mem hz hw)).differentiableAt + (isOpen_halfPlane.mem_nhds (affine_mem hz hw)) + have h := ((hfd.hasDerivAt.comp w (hasDerivAt_affine z w)).sub_const (f z)).div_const + ((z.im : ℂ) * deriv f z) + have hy : (z.im : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + have hd : deriv f z ≠ 0 := univalent_deriv_ne_zero isOpen_halfPlane hf hz + convert h using 1 <;> first | rfl | field_simp + +lemma deriv_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z w : ℂ} (hz : z ∈ halfPlane) (hw : w ∈ halfPlane) : + deriv (reroot f z) w = deriv f (affine z w) / deriv f z := + (hasDerivAt_reroot hf hz hw).deriv + +lemma reroot_normalized {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z : ℂ} (hz : z ∈ halfPlane) : HalfPlaneSchlicht (reroot f z) := by + have hy : (z.im : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + have hdf : deriv f z ≠ 0 := univalent_deriv_ne_zero isOpen_halfPlane hf hz + refine ⟨⟨?_, ?_⟩, ?_, ?_⟩ + · intro w hw + exact (hasDerivAt_reroot hf hz hw).differentiableAt.differentiableWithinAt + · intro u hu v hv h + apply affine_injective hz + apply hf.2 (affine_mem hz hu) (affine_mem hz hv) + have hh : f (affine z u) - f z = f (affine z v) - f z := + (div_left_inj' (mul_ne_zero hy hdf)).mp h + exact sub_left_injective hh + · simp [reroot] + · rw [deriv_reroot hf hz (by simp [halfPlane]), affine_I, div_self hdf] + +lemma reroot_comp {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z w : ℂ} (hz : z ∈ halfPlane) (hw : w ∈ halfPlane) : + reroot (reroot f z) w = reroot f (affine z w) := by + have hy : (z.im : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + have hv : (w.im : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hw) + have hdf : deriv f z ≠ 0 := univalent_deriv_ne_zero isOpen_halfPlane hf hz + have hdg : deriv f (affine z w) ≠ 0 := + univalent_deriv_ne_zero isOpen_halfPlane hf (affine_mem hz hw) + funext u + have him : ((affine z w).im : ℂ) = (z.im : ℂ) * (w.im : ℂ) := by + simp [affine] + change (reroot f z (affine w u) - reroot f z w) / + ((w.im : ℂ) * deriv (reroot f z) w) = _ + rw [deriv_reroot hf hz hw] + simp only [reroot, affine_assoc, him] + field_simp + ring + +def reciprocalDeriv (f : ℂ → ℂ) (z : ℂ) : ℂ := (deriv f z)⁻¹ + +lemma reciprocalDeriv_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) + {z w : ℂ} (hz : z ∈ halfPlane) (hw : w ∈ halfPlane) : + reciprocalDeriv (reroot f z) w = reciprocalDeriv f (affine z w) / reciprocalDeriv f z := by + simp [reciprocalDeriv, deriv_reroot hf hz hw, div_eq_mul_inv, mul_comm] + +def diskCayley (z : ℂ) : ℂ := (z-Complex.I)/(z+Complex.I) + +def halfCayley (z : ℂ) : ℂ := Complex.I*(1+z)/(1-z) + +lemma cayley_den_ne_zero {z : ℂ} (hz : z ∈ halfPlane) : z+Complex.I ≠ 0 := by + intro he + have := congrArg Complex.im he + simp only [Complex.add_im,Complex.I_im,Complex.zero_im] at this + change 0 < z.im at hz + linarith + +lemma halfCayley_den_ne_zero {z : ℂ} (hz : z ∈ disk) : 1-z ≠ 0 := by + intro he + have hz' : ‖z‖ < 1 := by simpa [disk] using hz + rw [← sub_eq_zero.mp he] at hz' + norm_num at hz' + +lemma diskCayley_maps {z : ℂ} (hz : z ∈ halfPlane) : diskCayley z ∈ disk := by + have hd := cayley_den_ne_zero hz + simp only [disk,Metric.mem_ball,dist_zero_right,diskCayley,norm_div] + rw [div_lt_one (norm_pos_iff.mpr hd)] + have hsql : ‖z-Complex.I‖^2 = z.re^2+(z.im-1)^2 := by + rw [Complex.sq_norm] + simp [Complex.normSq_apply] + ring + have hsqr : ‖z+Complex.I‖^2 = z.re^2+(z.im+1)^2 := by + rw [Complex.sq_norm] + simp [Complex.normSq_apply] + ring + have hz' : 0 < z.im := hz + nlinarith [norm_nonneg (z+Complex.I),norm_nonneg (z-Complex.I)] + +lemma halfCayley_im {z : ℂ} (_hz : z ∈ disk) : + (halfCayley z).im = (1-‖z‖^2)/‖1-z‖^2 := by + simp only [halfCayley,Complex.div_im,Complex.mul_re,Complex.mul_im, + Complex.I_re,Complex.I_im,Complex.add_re,Complex.add_im,Complex.one_re, + Complex.one_im,Complex.sub_re,Complex.sub_im,Complex.sq_norm,Complex.normSq_apply] + ring + +lemma halfCayley_maps {z : ℂ} (hz : z ∈ disk) : halfCayley z ∈ halfPlane := by + have hz' : ‖z‖ < 1 := by simpa [disk] using hz + change 0 < (halfCayley z).im + rw [halfCayley_im hz] + exact div_pos (by nlinarith [norm_nonneg z]) + (sq_pos_of_ne_zero (norm_ne_zero_iff.mpr (halfCayley_den_ne_zero hz))) + +lemma halfCayley_diskCayley {z : ℂ} (hz : z ∈ halfPlane) : halfCayley (diskCayley z) = z := by + have hd := cayley_den_ne_zero hz + have hd2 := halfCayley_den_ne_zero (diskCayley_maps hz) + dsimp [halfCayley,diskCayley] at * + field_simp + ring_nf + +lemma diskCayley_halfCayley {z : ℂ} (hz : z ∈ disk) : diskCayley (halfCayley z) = z := by + have hd := halfCayley_den_ne_zero hz + have hd2 := cayley_den_ne_zero (halfCayley_maps hz) + dsimp [halfCayley,diskCayley] at * + field_simp + ring + +lemma diskCayley_hasDerivAt {z : ℂ} (hz : z ∈ halfPlane) : + HasDerivAt diskCayley (2*Complex.I/(z+Complex.I)^2) z := by + convert ((hasDerivAt_id z).sub_const Complex.I).div + ((hasDerivAt_id z).add_const Complex.I) (cayley_den_ne_zero hz) using 1 <;> try rfl + simp only [id_eq,mul_one,one_mul] + ring + +lemma halfCayley_hasDerivAt {z : ℂ} (hz : z ∈ disk) : + HasDerivAt halfCayley (2*Complex.I/(1-z)^2) z := by + convert (((hasDerivAt_id z).const_add 1).const_mul Complex.I).div + ((hasDerivAt_id z).const_sub 1) (halfCayley_den_ne_zero hz) using 1 <;> try rfl + simp only [id_eq,mul_one] + ring + +@[simp] lemma diskCayley_I : diskCayley Complex.I = 0 := by simp [diskCayley] + +@[simp] lemma halfCayley_zero : halfCayley 0 = Complex.I := by simp [halfCayley] + +def diskToHalf (f : ℂ → ℂ) (z : ℂ) : ℂ := 2*Complex.I*f (diskCayley z) + +def halfToDisk (f : ℂ → ℂ) (z : ℂ) : ℂ := f (halfCayley z)/(2*Complex.I) + +lemma hasDerivAt_diskToHalf {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f disk) + {z : ℂ} (hz : z ∈ halfPlane) : HasDerivAt (diskToHalf f) + (-(4 : ℂ)*deriv f (diskCayley z)/(z+Complex.I)^2) z := by + have hd := ((hf _ (diskCayley_maps hz)).differentiableAt + (Metric.isOpen_ball.mem_nhds (diskCayley_maps hz))).hasDerivAt + convert (hd.comp z (diskCayley_hasDerivAt hz)).const_mul (2*Complex.I) using 1 <;> try rfl + ring_nf + simp [Complex.I_sq] + +lemma hasDerivAt_halfToDisk {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f halfPlane) + {z : ℂ} (hz : z ∈ disk) : HasDerivAt (halfToDisk f) + (deriv f (halfCayley z)/(1-z)^2) z := by + have hd := ((hf _ (halfCayley_maps hz)).differentiableAt + (isOpen_halfPlane.mem_nhds (halfCayley_maps hz))).hasDerivAt + convert (hd.comp z (halfCayley_hasDerivAt hz)).div_const (2*Complex.I) using 1 <;> try rfl + field_simp + +lemma diskToHalf_schlicht {f : ℂ → ℂ} (hf : Schlicht f) : + HalfPlaneSchlicht (diskToHalf f) := by + refine ⟨⟨fun z hz => (hasDerivAt_diskToHalf hf.1.1 hz).differentiableAt.differentiableWithinAt,?_⟩,?_,?_⟩ + · intro z hz w hw he + have hm := hf.1.2 (diskCayley_maps hz) (diskCayley_maps hw) + ((mul_left_cancel₀ (by simp : (2 : ℂ)*Complex.I ≠ 0)) he) + simpa only [halfCayley_diskCayley hz,halfCayley_diskCayley hw] using congrArg halfCayley hm + · simp [diskToHalf,hf.2.1] + · rw [(hasDerivAt_diskToHalf hf.1.1 (show Complex.I ∈ halfPlane by simp [halfPlane])).deriv] + norm_num [hf.2.2,add_sq,mul_assoc,Complex.I_sq,Complex.I_mul_I] + +lemma halfToDisk_schlicht {f : ℂ → ℂ} (hf : HalfPlaneSchlicht f) : + Schlicht (halfToDisk f) := by + refine ⟨⟨fun z hz => (hasDerivAt_halfToDisk hf.1.1 hz).differentiableAt.differentiableWithinAt,?_⟩,?_,?_⟩ + · intro z hz w hw he + have hm := hf.1.2 (halfCayley_maps hz) (halfCayley_maps hw) + ((div_left_inj' (by simp : (2 : ℂ)*Complex.I ≠ 0)).mp he) + simpa only [diskCayley_halfCayley hz,diskCayley_halfCayley hw] using congrArg diskCayley hm + · simp [halfToDisk,hf.2.1] + · rw [(hasDerivAt_halfToDisk hf.1.1 (show (0 : ℂ) ∈ disk by simp [disk])).deriv] + simp [hf.2.2] + +lemma diskToHalf_halfToDisk {f : ℂ → ℂ} {z : ℂ} (hz : z ∈ halfPlane) : + diskToHalf (halfToDisk f) z = f z := by + simp only [diskToHalf,halfToDisk,halfCayley_diskCayley hz] + field_simp + +lemma halfToDisk_diskToHalf {f : ℂ → ℂ} {z : ℂ} (hz : z ∈ disk) : + halfToDisk (diskToHalf f) z = f z := by + simp [diskToHalf,halfToDisk,diskCayley_halfCayley hz] + +def classFun (g : DiskClass) : ℂ → ℂ := diskToHalf (diskExtend g.1) + +lemma classFun_schlicht (g : DiskClass) : HalfPlaneSchlicht (classFun g) := + diskToHalf_schlicht g.2 + +def classOfHalf (f : ℂ → ℂ) (hf : HalfPlaneSchlicht f) : DiskClass := + ⟨⟨fun z => halfToDisk f z, continuousOn_iff_continuous_domRestrict.mp + (halfToDisk_schlicht hf).1.1.continuousOn⟩,by + have he : EqOn (diskExtend (⟨fun z => halfToDisk f z, + continuousOn_iff_continuous_domRestrict.mp + (halfToDisk_schlicht hf).1.1.continuousOn⟩ : C(disk,ℂ))) (halfToDisk f) disk := by + intro z hz + exact diskExtend_apply _ ⟨z,hz⟩ + refine ⟨⟨(halfToDisk_schlicht hf).1.1.congr he,?_⟩,?_,?_⟩ + · intro z hz w hw h + exact (halfToDisk_schlicht hf).1.2 hz hw ((he hz).symm.trans (h.trans (he hw))) + · rw [he (by simp [disk])] + exact (halfToDisk_schlicht hf).2.1 + · rw [he.deriv Metric.isOpen_ball (by simp [disk])] + exact (halfToDisk_schlicht hf).2.2⟩ + +lemma classFun_classOfHalf {f : ℂ → ℂ} (hf : HalfPlaneSchlicht f) : + EqOn (classFun (classOfHalf f hf)) f halfPlane := by + intro z hz + dsimp [classFun,diskToHalf,classOfHalf] + rw [diskExtend_apply _ (⟨diskCayley z,diskCayley_maps hz⟩ : disk)] + exact diskToHalf_halfToDisk hz + +lemma continuous_classFun_eval : Continuous (fun p : DiskClass × halfPlane => classFun p.1 p.2) := by + have hm' : Continuous (fun z : halfPlane => diskCayley z) := by + apply continuous_iff_continuousAt.mpr + intro z + exact (diskCayley_hasDerivAt z.2).continuousAt.comp continuous_subtype_val.continuousAt + have h := (continuous_diskClassJet_eval 0).comp + (continuous_id.prodMap (hm'.subtype_mk (fun z => diskCayley_maps z.2))) + simpa only [iteratedDeriv_zero,classFun,diskToHalf,Function.comp_def,Prod.map, id_eq] using h.const_mul (2*Complex.I) + +instance : LocallyCompactSpace halfPlane := isOpen_halfPlane.locallyCompactSpace + +instance : T2Space DiskClass := inferInstanceAs (T2Space diskSchlichtSet) + +instance : MeasurableSpace DiskClass := borel DiskClass + +instance : BorelSpace DiskClass := ⟨rfl⟩ + +lemma differentiableOn_iteratedDeriv_open {U : Set ℂ} (hU : IsOpen U) + {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) (n : ℕ) : + DifferentiableOn ℂ (iteratedDeriv n f) U := by + induction n with + | zero => simpa using hf + | succ n ih => simpa only [iteratedDeriv_succ] using ih.deriv hU + +lemma tendstoLocallyUniformlyOn_iteratedDeriv_open.{u_1} {U : Set ℂ} (hU : IsOpen U) + {ι : Type u_1} {l : Filter ι} {f : ι → ℂ → ℂ} {g : ℂ → ℂ} + (h : TendstoLocallyUniformlyOn f g l U) + (hf : ∀ᶠ i in l, DifferentiableOn ℂ (f i) U) (n : ℕ) : + TendstoLocallyUniformlyOn (fun i => iteratedDeriv n (f i)) (iteratedDeriv n g) l U := by + induction n with + | zero => simpa using h + | succ n ih => + simpa only [iteratedDeriv_succ,Function.comp_def] using ih.deriv + (hf.mono (fun i h => differentiableOn_iteratedDeriv_open hU h n)) hU + +def classJet (n : ℕ) (g : DiskClass) : C(halfPlane,ℂ) := + ⟨fun z => iteratedDeriv n (classFun g) z, continuousOn_iff_continuous_domRestrict.mp + (differentiableOn_iteratedDeriv_open isOpen_halfPlane (classFun_schlicht g).1.1 n).continuousOn⟩ + +lemma continuous_classJet (n : ℕ) : Continuous (classJet n) := by + have hc : Continuous (classJet 0) := + ContinuousMap.continuous_of_continuous_uncurry _ continuous_classFun_eval + rw [continuous_iff_continuousAt] + intro g + apply ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mpr + have hv := ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mp (hc.tendsto g) + have h : TendstoLocallyUniformlyOn classFun (classFun g) (𝓝 g) halfPlane := + tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe.mpr hv + exact tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe.mp + (tendstoLocallyUniformlyOn_iteratedDeriv_open isOpen_halfPlane h + (Eventually.of_forall (fun f : DiskClass => (classFun_schlicht f).1.1)) n) + +lemma continuous_classJet_eval (n : ℕ) : + Continuous (fun p : DiskClass × halfPlane => iteratedDeriv n (classFun p.1) p.2) := + continuous_eval.comp ((continuous_classJet n).prodMap continuous_id) + +def rerootClass (g : DiskClass) (z : halfPlane) : DiskClass := + classOfHalf (reroot (classFun g) z) (reroot_normalized (classFun_schlicht g).1 z.2) + +lemma classFun_rerootClass (g : DiskClass) (z : halfPlane) : + EqOn (classFun (rerootClass g z)) (reroot (classFun g) z) halfPlane := + classFun_classOfHalf _ + +lemma continuous_rerootClass : Continuous (fun p : DiskClass × halfPlane => rerootClass p.1 p.2) := by + apply Continuous.subtype_mk + apply ContinuousMap.continuous_of_continuous_uncurry + have hc : Continuous (fun p : (DiskClass × halfPlane) × disk => + (⟨halfCayley p.2,halfCayley_maps p.2.2⟩ : halfPlane)) := by + apply Continuous.subtype_mk + have hm : Continuous (fun z : disk => halfCayley z) := by + apply continuous_iff_continuousAt.mpr + intro z + exact (halfCayley_hasDerivAt z.2).continuousAt.comp continuous_subtype_val.continuousAt + exact hm.comp continuous_snd + have ha : Continuous (fun p : (DiskClass × halfPlane) × disk => + (⟨affine p.1.2 (halfCayley p.2),affine_mem p.1.2.2 (halfCayley_maps p.2.2)⟩ : halfPlane)) := by + apply Continuous.subtype_mk + have hre : Continuous (fun p : (DiskClass × halfPlane) × disk => p.1.2.val.re) := Complex.continuous_re.comp (continuous_subtype_val.comp (continuous_snd.comp continuous_fst)) + have him : Continuous (fun p : (DiskClass × halfPlane) × disk => p.1.2.val.im) := Complex.continuous_im.comp (continuous_subtype_val.comp (continuous_snd.comp continuous_fst)) + exact (Complex.continuous_ofReal.comp hre).add + ((Complex.continuous_ofReal.comp him).mul (continuous_subtype_val.comp hc)) + have hvalue := continuous_classFun_eval.comp ((continuous_fst.comp continuous_fst).prodMk ha) + have hroot : Continuous (fun p : (DiskClass × halfPlane) × disk => classFun p.1.1 p.1.2) := + continuous_classFun_eval.comp continuous_fst + have hder : Continuous (fun p : (DiskClass × halfPlane) × disk => deriv (classFun p.1.1) p.1.2) := by + simpa only [iteratedDeriv_one,Function.comp_def] using + ((continuous_classJet_eval 1).comp (continuous_fst : Continuous (Prod.fst : (DiskClass × halfPlane) × disk → DiskClass × halfPlane))) + have him : Continuous (fun p : (DiskClass × halfPlane) × disk => (p.1.2.val.im : ℂ)) := + Complex.continuous_ofReal.comp (Complex.continuous_im.comp + (continuous_subtype_val.comp (continuous_snd.comp continuous_fst))) + have hdiv := (hvalue.sub hroot).div (him.mul hder) (fun p => mul_ne_zero + (Complex.ofReal_ne_zero.mpr (ne_of_gt p.1.2.2)) + (univalent_deriv_ne_zero isOpen_halfPlane (classFun_schlicht p.1.1).1 p.1.2.2)) + exact hdiv.div_const (2*Complex.I) + +lemma class_ext {g h : DiskClass} (he : EqOn (classFun g) (classFun h) halfPlane) : g = h := by + apply Subtype.ext + apply ContinuousMap.ext + intro z + have hx := congrArg (fun q : ℂ => q/(2*Complex.I)) (he (halfCayley_maps z.2)) + have hg : (classFun g) (halfCayley z)/(2*Complex.I) = g.1 z := by + exact (halfToDisk_diskToHalf z.2).trans (diskExtend_apply _ z) + have hh : (classFun h) (halfCayley z)/(2*Complex.I) = h.1 z := by + exact (halfToDisk_diskToHalf z.2).trans (diskExtend_apply _ z) + rwa [hg,hh] at hx + +lemma reroot_congr {f g : ℂ → ℂ} (he : EqOn f g halfPlane) {z : ℂ} (hz : z ∈ halfPlane) : + EqOn (reroot f z) (reroot g z) halfPlane := by + intro w hw + simp only [reroot,he (affine_mem hz hw),he hz,he.deriv isOpen_halfPlane hz] + +lemma rerootClass_comp (g : DiskClass) (z w : halfPlane) : + rerootClass (rerootClass g z) w = rerootClass g ⟨affine z w,affine_mem z.2 w.2⟩ := by + apply class_ext + intro u hu + rw [classFun_rerootClass _ _ hu,reroot_congr (classFun_rerootClass g z) w.2 hu, + reroot_comp (classFun_schlicht g).1 z.2 w.2,classFun_rerootClass _ _ hu] + +def classWeight (g : DiskClass) (z : halfPlane) : ℝ := ‖reciprocalDeriv (classFun g) z‖^2 + +lemma classWeight_pos (g : DiskClass) (z : halfPlane) : 0 < classWeight g z := by + apply sq_pos_of_ne_zero + exact norm_ne_zero_iff.mpr (inv_ne_zero + (univalent_deriv_ne_zero isOpen_halfPlane (classFun_schlicht g).1 z.2)) + +lemma continuous_classWeight : Continuous (fun p : DiskClass × halfPlane => classWeight p.1 p.2) := by + have hd : Continuous (fun p : DiskClass × halfPlane => deriv (classFun p.1) p.2) := by + simpa only [iteratedDeriv_one] using continuous_classJet_eval 1 + exact (hd.inv₀ (fun p => univalent_deriv_ne_zero isOpen_halfPlane (classFun_schlicht p.1).1 p.2.2)).norm.pow 2 + +lemma classWeight_cocycle (g : DiskClass) (z w : halfPlane) : + classWeight g z * classWeight (rerootClass g z) w = + classWeight g ⟨affine z w,affine_mem z.2 w.2⟩ := by + have he := (classFun_rerootClass g z).deriv isOpen_halfPlane w.2 + have hq : reciprocalDeriv (classFun (rerootClass g z)) w = + reciprocalDeriv (reroot (classFun g) z) w := congrArg Inv.inv he + simp only [classWeight,hq,reciprocalDeriv_reroot (classFun_schlicht g).1 z.2 w.2,norm_div,div_pow] + have hn : ‖reciprocalDeriv (classFun g) z‖ ≠ 0 := + norm_ne_zero_iff.mpr (inv_ne_zero + (univalent_deriv_ne_zero isOpen_halfPlane (classFun_schlicht g).1 z.2)) + field_simp + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/InverseDensity.lean b/lean/OAI/Analysis/IntegralMeans/InverseDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..40c01fbd6301f1ad50e61972d32e2b8746f13f40 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/InverseDensity.lean @@ -0,0 +1,352 @@ +import OAI.Analysis.IntegralMeans.ExpectedDensity + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight +attribute [local irreducible] classFun +attribute [local irreducible] rerootClass + +def affineInverse (z : ℂ) : ℂ := (-(z.re : ℂ)+Complex.I)/(z.im : ℂ) + +lemma affineInverse_re (z : ℂ) : (affineInverse z).re = -z.re/z.im := by + simp [affineInverse,Complex.div_ofReal_re] + +lemma affineInverse_im (z : ℂ) : (affineInverse z).im = z.im⁻¹ := by + simp [affineInverse,Complex.div_ofReal_im] + +lemma affineInverse_mem {z : ℂ} (hz : z ∈ halfPlane) : affineInverse z ∈ halfPlane := by + simpa only [halfPlane,mem_ofPred_eq,affineInverse_im] using inv_pos.mpr hz + +lemma affineInverse_invol {z : ℂ} (hz : z ∈ halfPlane) : affineInverse (affineInverse z) = z := by + have hn : z.im ≠ 0 := ne_of_gt hz + apply Complex.ext + · simp only [affineInverse_re,affineInverse_im,neg_div,neg_neg,div_inv_eq_mul] + exact div_mul_cancel₀ _ hn + · simp only [affineInverse_im,inv_inv] + +lemma affineInverse_injOn : InjOn affineInverse halfPlane := by + intro z hz w hw he + simpa only [affineInverse_invol hz,affineInverse_invol hw] using congrArg affineInverse he + +lemma affineInverse_affine {z : ℂ} (hz : z ∈ halfPlane) : affine z (affineInverse z) = Complex.I := by + have hn : (z.im : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + rw [affine,affineInverse,mul_div_cancel₀ _ hn] + ring + +lemma hasFDerivAt_affineInverse {z : ℂ} (hz : z ∈ halfPlane) : + HasFDerivAt affineInverse + (((z.im : ℂ)⁻¹) • (-(Complex.ofRealCLM.comp Complex.reCLM)) + + (-(z.re : ℂ)+Complex.I) • + ((-((z.im : ℂ)^2)⁻¹) • (Complex.ofRealCLM.comp Complex.imCLM))) z := by + have hn : (z.im : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + have hi := (hasFDerivAt_inv' (𝕜 := ℝ) hn).comp z + (Complex.ofRealCLM.comp Complex.imCLM).hasFDerivAt + have h := ((Complex.ofRealCLM.comp Complex.reCLM).hasFDerivAt.neg.add_const Complex.I).mul hi + convert! h using 1 + ext v + simp only [add_apply,smul_apply,neg_apply,Pi.neg_apply,ContinuousLinearMap.comp_apply, + Complex.ofRealCLM_apply,Complex.reCLM_apply,Complex.imCLM_apply, + ContinuousLinearMap.mulLeftRight_apply,Function.comp_apply,smul_eq_mul] + ring + +lemma differentiableAt_affineInverse {z : ℂ} (hz : z ∈ halfPlane) : DifferentiableAt ℝ affineInverse z := + (hasFDerivAt_affineInverse hz).differentiableAt + +lemma fderiv_affineInverse_apply {z : ℂ} (hz : z ∈ halfPlane) (v : ℂ) : + fderiv ℝ affineInverse z v = + (-(v.re : ℂ)*(z.im : ℂ)-(-(z.re : ℂ)+Complex.I)*(v.im : ℂ))/(z.im : ℂ)^2 := by + have hn : (z.im : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + rw [(hasFDerivAt_affineInverse hz).fderiv] + simp only [add_apply,smul_apply,neg_apply, + ContinuousLinearMap.comp_apply,Complex.ofRealCLM_apply,Complex.reCLM_apply,Complex.imCLM_apply, + smul_eq_mul] + field_simp + ring + +lemma det_affineInverse {z : ℂ} (hz : z ∈ halfPlane) : + (fderiv ℝ affineInverse z).det = z.im⁻¹^3 := by + change LinearMap.det (fderiv ℝ affineInverse z).toLinearMap = _ + rw [determinant_complex_real] + change (fderiv ℝ affineInverse z 1).re*(fderiv ℝ affineInverse z Complex.I).im- + (fderiv ℝ affineInverse z Complex.I).re*(fderiv ℝ affineInverse z 1).im = _ + rw [fderiv_affineInverse_apply hz,fderiv_affineInverse_apply hz] + simp only [Complex.one_re,Complex.one_im,Complex.I_re,Complex.I_im,Complex.ofReal_one, + Complex.ofReal_zero,neg_zero,zero_mul,mul_zero,mul_one,sub_zero,zero_sub,neg_mul, + ← Complex.ofReal_pow,Complex.div_ofReal_re,Complex.div_ofReal_im, + Complex.neg_re,Complex.neg_im,Complex.ofReal_re,Complex.ofReal_im, + Complex.mul_re,Complex.mul_im,Complex.add_re,Complex.add_im] + field_simp [ne_of_gt (show 0 < z.im from hz)] + ring + +lemma affineInverse_change_variables {s : Set ℂ} (hs : MeasurableSet s) (hsub : s ⊆ halfPlane) + (hInv : affineInverse '' s = s) (f : ℂ → ℝ≥0∞) : + (∫⁻ z in s, f z ∂volume) = ∫⁻ z in s, ENNReal.ofReal (z.im⁻¹^3)*f (affineInverse z) ∂volume := by + have h := lintegral_image_eq_lintegral_abs_det_fderiv_mul volume hs + (fun z hz => (differentiableAt_affineInverse (hsub hz)).hasFDerivAt.hasFDerivWithinAt) + (affineInverse_injOn.mono hsub) f + rw [hInv] at h + refine h.trans (setLIntegral_congr_fun hs (fun z hz => ?_)) + rw [det_affineInverse (hsub hz),abs_of_nonneg (pow_nonneg (inv_nonneg.mpr (hsub hz).le) _)] + +lemma diskCayley_affineInverse {z : ℂ} (hz : z ∈ halfPlane) : + diskCayley (affineInverse z) = (z-Complex.I)/(star (z+Complex.I)) := by + have hy : (z.im : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hz) + have h₁ : affineInverse z-Complex.I = -(z-Complex.I)/(z.im : ℂ) := by + rw [affineInverse,div_sub' hy] + congr 1 + apply Complex.ext <;> simp + have h₂ : affineInverse z+Complex.I = -star (z+Complex.I)/(z.im : ℂ) := by + rw [affineInverse,div_add' _ _ _ hy] + congr 1 + apply Complex.ext <;> simp + rw [diskCayley,h₁,h₂,div_div_div_cancel_right₀ hy,neg_div_neg_eq] + +lemma diskCayley_affineInverse_norm {z : ℂ} (hz : z ∈ halfPlane) : + ‖diskCayley (affineInverse z)‖ = ‖diskCayley z‖ := by + rw [diskCayley_affineInverse hz,diskCayley,norm_div,norm_div,norm_star] + +lemma affineInverse_mem_outsideCore {z : ℂ} (hz : z ∈ outsideCore) : affineInverse z ∈ outsideCore := + ⟨affineInverse_mem hz.1,by simpa only [diskCayley_affineInverse_norm hz.1] using hz.2⟩ + +lemma affineInverse_image_outsideCore : affineInverse '' outsideCore = outsideCore := by + ext z + constructor + · rintro ⟨w,hw,rfl⟩ + exact affineInverse_mem_outsideCore hw + · intro hz + exact ⟨affineInverse z,affineInverse_mem_outsideCore hz,affineInverse_invol hz.1⟩ + +lemma reroot_at_affineInverse (g : DiskClass) {z : ℂ} (hz : z ∈ halfPlane) : + classFun (rerootClass g ⟨z,hz⟩) (affineInverse z) = + -classFun g z/((z.im : ℂ)*deriv (classFun g) z) := by + rw [classFun_rerootClass g ⟨z,hz⟩ (affineInverse_mem hz)] + simp only [reroot,affineInverse_affine hz,(classFun_schlicht g).2.1,zero_sub] + +lemma classWeight_inverse_value (g : DiskClass) {z : ℂ} (hz : z ∈ outsideCore) : + classWeight g ⟨z,hz.1⟩ * + ‖classFun (rerootClass g ⟨z,hz.1⟩) (affineInverse z)‖⁻¹^4 = + z.im^4*(‖deriv (classFun g) z‖^2*‖classFun g z‖⁻¹^4) := by + have hn := classFun_ne_zero_outsideCore g hz + have hd := univalent_deriv_ne_zero isOpen_halfPlane (classFun_schlicht g).1 hz.1 + have hy : 0 < z.im := hz.1 + rw [classWeight,reciprocalDeriv,reroot_at_affineInverse g hz.1] + simp only [norm_inv,norm_div,norm_neg,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hy] + field_simp + +lemma inverse_area_bound {f : ℂ → ℂ} {s : Set ℂ} (hs : MeasurableSet s) + (hf : ∀ z ∈ s, DifferentiableAt ℂ f z) (hi : InjOn f s) + (hmin : ∀ z ∈ s, (1/16 : ℝ) ≤ ‖f z‖) : + (∫⁻ z in s, ENNReal.ofReal (‖deriv f z‖^2*‖f z‖⁻¹^4)) ≤ + ENNReal.ofReal (256*Real.pi) := by + have hn (z : ℂ) (hz : z ∈ s) : f z ≠ 0 := by + have := hmin z hz + exact norm_ne_zero_iff.mp (ne_of_gt (by linarith)) + have hd (z : ℂ) (hz : z ∈ s) := (hf z hz).hasDerivAt.inv (hn z hz) + have hhi : InjOn (fun z => (f z)⁻¹) s := by + intro z hz w hw he + exact hi hz hw (inv_inj.mp he) + have he := lintegral_image_eq_lintegral_abs_det_fderiv_mul volume hs + (fun z hz => ((hd z hz).hasFDerivAt.restrictScalars ℝ).hasFDerivWithinAt) hhi (fun _ => (1 : ℝ≥0∞)) + have hJac (z : ℂ) (hz : z ∈ s) : + |(fderiv ℝ (fun z => (f z)⁻¹) z).det| = ‖deriv f z‖^2*‖f z‖⁻¹^4 := by + have hdet : (fderiv ℝ (fun z => (f z)⁻¹) z).det = ‖deriv (fun z => (f z)⁻¹) z‖^2 := by + exact det_fderiv_complex (hd z hz).differentiableAt + rw [hdet,abs_of_nonneg (sq_nonneg _)] + have hdr : deriv (fun z => (f z)⁻¹) z = -deriv f z/f z^2 := (hd z hz).deriv + rw [hdr] + change ‖(-deriv f z/f z^2 : ℂ)‖^2 = ‖deriv f z‖^2*‖f z‖⁻¹^4 + rw [Complex.norm_div,norm_neg,Complex.norm_pow] + simp only [div_eq_mul_inv,inv_pow] + ring + have he' : (∫⁻ z in s, ENNReal.ofReal (‖deriv f z‖^2*‖f z‖⁻¹^4)) = + volume ((fun z => (f z)⁻¹) '' s) := by + simp only [lintegral_const,one_mul,Measure.restrict_apply_univ] at he + change _ = volume (f⁻¹ '' s) + rw [he] + apply setLIntegral_congr_fun hs + intro z hz + dsimp only + rw [mul_one] + have hfm := (hd z hz).hasFDerivAt.restrictScalars ℝ + have hh : (ContinuousLinearMap.restrictScalars ℝ + (ContinuousLinearMap.toSpanSingleton ℂ (-deriv f z/f z^2))) = + fderiv ℝ (fun z => (f z)⁻¹) z := by + exact hfm.fderiv.symm + rw [hh,hJac z hz] + rw [he'] + have hsub : (fun z => (f z)⁻¹) '' s ⊆ Metric.closedBall 0 16 := by + rintro _ ⟨z,hz,rfl⟩ + simp only [Metric.mem_closedBall,dist_zero_right,norm_inv] + exact (inv_le_comm₀ (norm_pos_iff.mpr (hn z hz)) (by norm_num)).mpr (by simpa using hmin z hz) + calc + _ ≤ volume (Metric.closedBall (0 : ℂ) 16) := measure_mono hsub + _ = _ := by + rw [Complex.volume_closedBall] + have hp : (NNReal.pi : ℝ≥0∞) = ENNReal.ofReal Real.pi := by + rw [ENNReal.ofReal,ENNReal.coe_inj] + apply Subtype.ext + exact (Real.coe_toNNReal Real.pi Real.pi_pos.le).symm + rw [hp,ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 256)] + norm_num [mul_comm] + +def planeClassDeriv (g : DiskClass) (z : ℂ) : ℂ := + by classical exact if z ∈ halfPlane then deriv (classFun g) z else 0 + +lemma measurable_planeClassDeriv : Measurable (fun p : DiskClass × ℂ => planeClassDeriv p.1 p.2) := by + classical + let s : Set (DiskClass × ℂ) := Prod.snd ⁻¹' halfPlane + have hc : Continuous (fun p : s => deriv (classFun p.val.1) p.val.2) := by + have h : Continuous (fun p : DiskClass × halfPlane => deriv (classFun p.1) p.2) := by + simpa only [iteratedDeriv_one] using continuous_classJet_eval 1 + exact h.comp + ((continuous_fst.comp continuous_subtype_val).prodMk + ((continuous_snd.comp continuous_subtype_val).subtype_mk (fun p => p.2))) + simpa only [planeClassDeriv,s,Set.mem_preimage,dite_eq_ite] using + hc.measurable.dite (measurable_const (a := (0 : ℂ))) + (isOpen_halfPlane.measurableSet.preimage measurable_snd) + +lemma planeClassDeriv_eq (g : DiskClass) {z : ℂ} (hz : z ∈ halfPlane) : + planeClassDeriv g z = deriv (classFun g) z := by simp [planeClassDeriv,hz] + +def inverseDensity (g : DiskClass) (z : ℂ) : ℝ≥0∞ := + ENNReal.ofReal (‖planeClassValue g z‖⁻¹^4) + +def inverseJacDensity (g : DiskClass) (z : ℂ) : ℝ≥0∞ := + ENNReal.ofReal (‖planeClassDeriv g z‖^2*‖planeClassValue g z‖⁻¹^4) + +def weightedInverseArea (β : ℝ) (g : DiskClass) : ℝ≥0∞ := + ∫⁻ z in outsideCore, ENNReal.ofReal (z.im^(β+1))*inverseDensity g z + +lemma measurable_inverseDensity : Measurable (Function.uncurry inverseDensity) := + (measurable_planeClassValue.norm.inv.pow_const 4).ennreal_ofReal + +lemma measurable_inverseJacDensity : Measurable (Function.uncurry inverseJacDensity) := + ((measurable_planeClassDeriv.norm.pow_const 2).mul + (measurable_planeClassValue.norm.inv.pow_const 4)).ennreal_ofReal + +lemma measurable_weightedInverseArea (β : ℝ) : Measurable (weightedInverseArea β) := by + apply Measurable.lintegral_prod_right + exact (((Complex.continuous_im.comp continuous_snd).measurable.pow measurable_const).ennreal_ofReal).mul + measurable_inverseDensity + +lemma inverseJacDensity_integral_le (g : DiskClass) : + (∫⁻ z in outsideCore, inverseJacDensity g z) ≤ ENNReal.ofReal (256*Real.pi) := by + have he : (∫⁻ z in outsideCore, inverseJacDensity g z) = + ∫⁻ z in outsideCore, ENNReal.ofReal (‖deriv (classFun g) z‖^2*‖classFun g z‖⁻¹^4) := by + apply setLIntegral_congr_fun measurableSet_outsideCore + intro z hz + simp only [inverseJacDensity,planeClassValue_eq g hz.1,planeClassDeriv_eq g hz.1] + rw [he] + exact inverse_area_bound measurableSet_outsideCore + (fun _ hz => (classFun_schlicht g).1.1.differentiableAt (isOpen_halfPlane.mem_nhds hz.1)) + ((classFun_schlicht g).1.2.mono (fun _ h => h.1)) + (fun _ hz => classFun_lower_outsideCore g hz) + +def HasWeightedLaw (P : ProbabilityMeasure DiskClass) (β : ℝ) : Prop := + ∀ z : halfPlane, ∀ f : DiskClass → ℝ≥0∞, Measurable f → + (∫⁻ g, ENNReal.ofReal (classWeight g z)*f (rerootClass g z) ∂(P : Measure DiskClass)) = + ENNReal.ofReal (z.val.im^(-β))*(∫⁻ g, f g ∂(P : Measure DiskClass)) + +attribute [local irreducible] inverseDensity inverseJacDensity + +lemma weighted_inverse_identity (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : HasWeightedLaw P β) {z : ℂ} (hz : z ∈ outsideCore) : + (∫⁻ g, inverseJacDensity g z ∂(P : Measure DiskClass)) = + ENNReal.ofReal (z.im^(-β-4)) * + (∫⁻ g, inverseDensity g (affineInverse z) ∂(P : Measure DiskClass)) := by + have hy : 0 < z.im := hz.1 + have hden : Measurable (fun g => inverseDensity g (affineInverse z)) := + measurable_inverseDensity.comp (measurable_id.prodMk measurable_const) + have he := hP ⟨z,hz.1⟩ _ hden + have hid (g : DiskClass) : + ENNReal.ofReal (classWeight g ⟨z,hz.1⟩)*inverseDensity (rerootClass g ⟨z,hz.1⟩) (affineInverse z) = + ENNReal.ofReal (z.im^4)*inverseJacDensity g z := by + simp only [inverseDensity,inverseJacDensity,planeClassValue_eq _ (affineInverse_mem hz.1), + planeClassValue_eq _ hz.1,planeClassDeriv_eq _ hz.1] + rw [← ENNReal.ofReal_mul (classWeight_pos g ⟨z,hz.1⟩).le, + classWeight_inverse_value g hz,ENNReal.ofReal_mul (pow_nonneg hy.le 4)] + simp_rw [hid] at he + have hJac : Measurable (fun g => inverseJacDensity g z) := + measurable_inverseJacDensity.comp (measurable_id.prodMk measurable_const) + rw [lintegral_const_mul _ hJac] at he + have hpow : ENNReal.ofReal (z.im^4) * ENNReal.ofReal (z.im^(-β-4)) = ENNReal.ofReal (z.im^(-β)) := by + rw [← ENNReal.ofReal_mul (pow_nonneg hy.le 4),← Real.rpow_natCast,← Real.rpow_add hy] + congr 1 + congr 1 + ring + apply (ENNReal.mul_right_inj (by positivity : ENNReal.ofReal (z.im^4) ≠ 0) ENNReal.ofReal_ne_top).mp + rw [← mul_assoc,hpow] + exact he + +lemma weightedInverseArea_expectation_le (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : HasWeightedLaw P β) : + (∫⁻ g, weightedInverseArea β g ∂(P : Measure DiskClass)) ≤ ENNReal.ofReal (256*Real.pi) := by + let A (z : ℂ) := ∫⁻ g, inverseJacDensity g z ∂(P : Measure DiskClass) + let B (z : ℂ) := ∫⁻ g, inverseDensity g z ∂(P : Measure DiskClass) + have hswap : (∫⁻ g, weightedInverseArea β g ∂(P : Measure DiskClass)) = + ∫⁻ z in outsideCore, ENNReal.ofReal (z.im^(β+1))*B z := by + unfold weightedInverseArea + rw [lintegral_lintegral_swap] + · apply lintegral_congr + intro z + have hm : Measurable (fun g => inverseDensity g z) := + measurable_inverseDensity.comp (measurable_id.prodMk measurable_const) + exact lintegral_const_mul _ hm + · exact ((((Complex.continuous_im.comp continuous_snd).measurable.pow measurable_const).ennreal_ofReal).mul + measurable_inverseDensity).aemeasurable + have hpoint (z : ℂ) (hz : z ∈ outsideCore) : + ENNReal.ofReal (z.im^(β+1))*B z = ENNReal.ofReal (z.im⁻¹^3)*A (affineInverse z) := by + have hy : 0 < z.im := hz.1 + dsimp only [A] + rw [weighted_inverse_identity P β hP (affineInverse_mem_outsideCore hz), + affineInverse_invol hz.1,affineInverse_im,← mul_assoc] + congr 1 + rw [← ENNReal.ofReal_mul (pow_nonneg (inv_nonneg.mpr hy.le) 3)] + congr 1 + rw [Real.inv_rpow hy.le] + have he : (z.im⁻¹^3 : ℝ) = z.im^(-3 : ℝ) := by + rw [Real.rpow_neg hy.le] + norm_cast + simp + rw [he,← Real.rpow_neg hy.le,← Real.rpow_add hy] + congr 1 + ring + rw [hswap,setLIntegral_congr_fun measurableSet_outsideCore hpoint, + ← affineInverse_change_variables measurableSet_outsideCore (fun _ h => h.1) + affineInverse_image_outsideCore A] + have hswap₂ : (∫⁻ z in outsideCore, A z) = + ∫⁻ g, (∫⁻ z in outsideCore, inverseJacDensity g z) ∂(P : Measure DiskClass) := by + exact (lintegral_lintegral_swap measurable_inverseJacDensity.aemeasurable).symm + rw [hswap₂] + calc + _ ≤ ∫⁻ _ : DiskClass, ENNReal.ofReal (256*Real.pi) ∂(P : Measure DiskClass) := + lintegral_mono inverseJacDensity_integral_le + _ = _ := by simp + +lemma weightedInverseArea_ae_finite (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : HasWeightedLaw P β) : + ∀ᵐ g ∂(P : Measure DiskClass), weightedInverseArea β g < ∞ := + ae_lt_top (measurable_weightedInverseArea β) + (ne_top_of_le_ne_top ENNReal.ofReal_ne_top (weightedInverseArea_expectation_le P β hP)) + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/InverseMoment.lean b/lean/OAI/Analysis/IntegralMeans/InverseMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ec5d5a9a7fae22ab0dad3ac6e70fddae479f196 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/InverseMoment.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.IntegralMeans.DomainArea +import OAI.Analysis.IntegralMeans.KoebeReduction + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter +open scoped ENNReal +namespace Brennan.Sharp + +lemma koebe_inverse_areaMoment (s : ℝ) : + areaMoment koebeInverse koebeDomain s = areaMoment koebeMap disk (2 - s) := by + have hdisk : MeasurableSet disk := Metric.isOpen_ball.measurableSet + have hopen : IsOpen disk := Metric.isOpen_ball + unfold areaMoment koebeDomain + rw [conformal_lintegral_eq (F := koebeMap) (s := disk) hdisk + (fun z hz => (koebeMap_hasDerivAt hz).differentiableAt) + koebeMap_schlicht.1.2] + apply setLIntegral_congr_fun hdisk + intro z hz + change ENNReal.ofReal (‖deriv koebeMap z‖ ^ (2 : ℕ)) * + ENNReal.ofReal (‖deriv koebeInverse (koebeMap z)‖ ^ s) = + ENNReal.ofReal (‖deriv koebeMap z‖ ^ (2 - s)) + have hderiv : deriv koebeInverse (koebeMap z) = (deriv koebeMap z)⁻¹ := + (univalent_inverse_hasDerivAt hopen koebeMap_schlicht.1 hz).deriv + rw [hderiv, norm_inv, Real.inv_rpow (norm_nonneg _), + ← ENNReal.ofReal_mul (sq_nonneg _)] + congr 1 + have hn : 0 < ‖deriv koebeMap z‖ := + norm_pos_iff.mpr (univalent_deriv_ne_zero hopen koebeMap_schlicht.1 hz) + rw [← Real.rpow_natCast ‖deriv koebeMap z‖ 2, + ← Real.rpow_neg hn.le, ← Real.rpow_add hn] + rfl + +lemma not_integrable_of_areaMoment_top {f : ℂ → ℂ} {U : Set ℂ} {t : ℝ} + (h : areaMoment f U t = ⊤) : + ¬ IntegrableOn (fun z => ‖deriv f z‖ ^ t) U volume := by + intro hi + have hf := (hasFiniteIntegral_iff_ofReal (Eventually.of_forall + (fun z : ℂ => Real.rpow_nonneg (norm_nonneg (deriv f z)) t))).mp hi.hasFiniteIntegral + change areaMoment f U t < ⊤ at hf + rw [h] at hf + exact lt_irrefl _ hf + +end Brennan.Sharp + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/Koebe.lean b/lean/OAI/Analysis/IntegralMeans/Koebe.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc4dcd2095564fa64204412c757b918916b613b6 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/Koebe.lean @@ -0,0 +1,119 @@ +import OAI.Analysis.IntegralMeans.CircleBounds + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology +namespace Brennan + +def koebeMap (z : ℂ) : ℂ := z/(1-z)^2 + +lemma one_sub_ne_zero_disk {z : ℂ} (hz : z ∈ disk) : 1-z ≠ 0 := by + have h : ‖z‖ < 1 := by simpa [disk] using hz + intro he + have : z = 1 := by linear_combination -he + simp [this] at h + +lemma koebeMap_hasDerivAt {z : ℂ} (hz : z ∈ disk) : + HasDerivAt koebeMap ((1+z)/(1-z)^3) z := by + have hn := one_sub_ne_zero_disk hz + have h := (hasDerivAt_id z).div (((hasDerivAt_const z (1:ℂ)).sub (hasDerivAt_id z)).pow 2) (pow_ne_zero 2 hn) + convert h using 1 <;> try rfl + dsimp + field_simp [hn] + ring + +lemma koebeMap_schlicht : Schlicht koebeMap := by + refine ⟨⟨fun z hz => (koebeMap_hasDerivAt hz).differentiableAt.differentiableWithinAt,?_⟩,by simp [koebeMap],?_⟩ + · intro z hz w hw he + have hnz := one_sub_ne_zero_disk hz + have hnw := one_sub_ne_zero_disk hw + have he' : (z-w)*(1-z*w) = 0 := by + have hh := (div_eq_div_iff (pow_ne_zero 2 hnz) (pow_ne_zero 2 hnw)).mp he + linear_combination hh + have hzw : 1-z*w ≠ 0 := by + have hz' : ‖z‖ < 1 := by simpa [disk] using hz + have hw' : ‖w‖ < 1 := by simpa [disk] using hw + have hn : ‖z*w‖ < 1 := by rw [norm_mul]; nlinarith [norm_nonneg z,norm_nonneg w] + intro h + have : z*w = 1 := by linear_combination -h + simp [this] at hn + exact sub_eq_zero.mp ((mul_eq_zero.mp he').resolve_right hzw) + · simpa using (koebeMap_hasDerivAt (show (0:ℂ) ∈ disk by simp [disk])).deriv + +lemma koebe_arc_deriv_bound {r θ : ℝ} (hr : 1/2 ≤ r) (hr1 : r < 1) + (hθ : |θ| ≤ 1-r) : ‖deriv koebeMap (-circlePoint r θ)‖ ≤ 2*(1-r) := by + have hr0 : 0 ≤ r := by linarith + have hδ : 0 < 1-r := by linarith + have hcos : 0 ≤ Real.cos θ := Real.cos_nonneg_of_mem_Icc ⟨by + have hp := Real.pi_gt_three; have := (abs_le.mp hθ).1; linarith, + by have hp := Real.pi_gt_three; have := (abs_le.mp hθ).2; linarith⟩ + have he : ‖Complex.exp ((θ:ℂ)*Complex.I)-1‖ ≤ |θ| := by + simpa [mul_comm] using (Real.norm_exp_I_mul_ofReal_sub_one_le (x := θ)) + have hnum : ‖1-circlePoint r θ‖ ≤ 2*(1-r) := by + have hident : (1:ℂ)-circlePoint r θ = ((1-r:ℝ):ℂ)-(r:ℂ)*(Complex.exp ((θ:ℂ)*Complex.I)-1) := by + simp only [circlePoint,Complex.ofReal_sub,Complex.ofReal_one]; ring + rw [hident] + calc + _ ≤ ‖((1-r:ℝ):ℂ)‖+‖(r:ℂ)*(Complex.exp ((θ:ℂ)*Complex.I)-1)‖ := norm_sub_le _ _ + _ ≤ (1-r)+r*|θ| := by + rw [Complex.norm_real,Real.norm_eq_abs,abs_of_pos hδ,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg hr0] + exact add_le_add le_rfl (mul_le_mul_of_nonneg_left he hr0) + _ ≤ 2*(1-r) := by nlinarith [abs_nonneg θ] + have hden : 1 ≤ ‖1+circlePoint r θ‖ := by + calc + (1:ℝ) ≤ ((1:ℂ)+circlePoint r θ).re := by + simp [circlePoint,Complex.exp_mul_I,Complex.mul_re] + exact mul_nonneg hr0 hcos + _ ≤ ‖1+circlePoint r θ‖ := Complex.re_le_norm _ + rw [(koebeMap_hasDerivAt (neg_circlePoint_mem_disk hr0 hr1 θ)).deriv,norm_div,norm_pow] + simp only [← sub_eq_add_neg,sub_neg_eq_add] + exact (div_le_self (norm_nonneg _) (one_le_pow₀ hden)).trans hnum + +lemma koebe_arc_inverse_lower {r θ : ℝ} (hr : 1/2 ≤ r) (hr1 : r < 1) + (hθ : |θ| ≤ 1-r) : 1/(4*(1-r)^2) ≤ ‖deriv koebeMap (-circlePoint r θ)‖^(-2:ℝ) := by + have hn := norm_pos_iff.mpr (univalent_deriv_ne_zero Metric.isOpen_ball koebeMap_schlicht.1 + (neg_circlePoint_mem_disk (by linarith) hr1 θ)) + have hb := Real.rpow_le_rpow_of_nonpos hn (koebe_arc_deriv_bound hr hr1 hθ) (by norm_num : (-2:ℝ) ≤ 0) + refine (show 1/(4*(1-r)^2) = (2*(1-r))^(-2:ℝ) by + rw [Real.rpow_neg (by positivity),Real.rpow_two]; ring).trans_le hb + +lemma koebe_mean_lower {r : ℝ} (hr : 1/2 ≤ r) (hr1 : r < 1) : + 1/(4*Real.pi*(1-r)) ≤ integralMean koebeMap (-2) r := by + let F : ℝ → ℝ := fun θ => ‖deriv koebeMap (circlePoint r θ)‖^(-2:ℝ) + let G : ℝ → ℝ := fun θ => ‖deriv koebeMap (-circlePoint r θ)‖^(-2:ℝ) + have hF := (continuous_circle_deriv_rpow koebeMap_schlicht.1 (by linarith) hr1 (-2)).intervalIntegrable (μ := volume) + have hG := (continuous_neg_circle_deriv_rpow koebeMap_schlicht.1 (by linarith) hr1 (-2)).intervalIntegrable (μ := volume) + have hfull : (∫ θ in -Real.pi..Real.pi, G θ) = ∫ θ in -Real.pi..Real.pi, F θ := by + have he (θ : ℝ) : G θ = F (θ+Real.pi) := by + dsimp [G,F] + congr 3 + simp [circlePoint,Complex.ofReal_add,add_mul,Complex.exp_add,Complex.exp_pi_mul_I] + simp_rw [he] + rw [intervalIntegral.integral_comp_add_right (f := F) Real.pi] + have hp := ((periodic_circlePoint r).comp (fun z => ‖deriv koebeMap z‖^(-2:ℝ))).intervalIntegral_add_eq (-Real.pi) 0 + convert hp.symm using 1 <;> congr 1 <;> ring + have hδ : 0 < 1-r := by linarith + have hpart := intervalIntegral.integral_mono_on (by linarith : -(1-r) ≤ 1-r) + (intervalIntegrable_const (a := -(1-r)) (b := 1-r) (c := 1/(4*(1-r)^2))) + (hG (-(1-r)) (1-r)) (fun θ hθ => koebe_arc_inverse_lower hr hr1 (abs_le.mpr hθ)) + have heq : (∫ _ in -(1-r)..(1-r), 1/(4*(1-r)^2)) = 1/(2*(1-r)) := by + rw [intervalIntegral.integral_const,smul_eq_mul]; field_simp; ring + rw [heq] at hpart + have hlarge := intervalIntegral.integral_mono_interval + (by linarith [Real.pi_gt_three] : -Real.pi ≤ -(1-r)) (by linarith : -(1-r) ≤ 1-r) + (by linarith [Real.pi_gt_three] : 1-r ≤ Real.pi) + (Eventually.of_forall (fun θ => Real.rpow_nonneg (norm_nonneg (deriv koebeMap (-circlePoint r θ))) (-2))) (hG (-Real.pi) Real.pi) + change _ ≤ integralMean koebeMap (-2) r + calc + _ = (2*Real.pi)⁻¹*(1/(2*(1-r))) := by field_simp; ring + _ ≤ (2*Real.pi)⁻¹*(∫ θ in -Real.pi..Real.pi, G θ) := + mul_le_mul_of_nonneg_left (hpart.trans hlarge) (by positivity) + _ = integralMean koebeMap (-2) r := by rw [hfull]; rfl + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/KoebeCone.lean b/lean/OAI/Analysis/IntegralMeans/KoebeCone.lean new file mode 100644 index 0000000000000000000000000000000000000000..49d091c52ffbf29cd3ff47ac192bc87813594be1 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/KoebeCone.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.IntegralMeans.KoebeReduction + +namespace OAI + +noncomputable section + +namespace Brennan.Sharp + +lemma right_cone_mem_disk {w : ℂ} + (h0 : 0 < ‖w‖) (hsmall : ‖w‖ < 1 / 2) + (hcone : ‖w‖ / 2 ≤ w.re) : 1 - w ∈ disk := by + have hsq : ‖1 - w‖ ^ 2 = 1 - 2 * w.re + ‖w‖ ^ 2 := by + simp only [Complex.sq_norm, Complex.normSq_apply, Complex.sub_re, + Complex.sub_im, Complex.one_re, Complex.one_im] + ring + have hsmall' : ‖w‖ ^ 2 < ‖w‖ := by nlinarith + have hnorm : ‖1 - w‖ < 1 := by + nlinarith [norm_nonneg (1 - w)] + simpa only [disk, Metric.mem_ball, dist_zero_right] using hnorm + +lemma left_cone_mem_disk {w : ℂ} + (h0 : 0 < ‖w‖) (hsmall : ‖w‖ < 1 / 2) + (hcone : ‖w‖ / 2 ≤ w.re) : -1 + w ∈ disk := by + have hr := right_cone_mem_disk h0 hsmall hcone + have hid : (-1 : ℂ) + w = -(1 - w) := by ring + simpa only [disk, Metric.mem_ball, dist_zero_right, hid, norm_neg] using hr + +lemma norm_rpow_neg_two (w : ℂ) : + ‖w‖ ^ (-2 : ℝ) = 1 / ‖w‖ ^ 2 := by + simpa only [Real.rpow_two, one_div] using + Real.rpow_neg (norm_nonneg w) (2 : ℝ) + +lemma koebe_left_cone_lower {w : ℂ} + (h0 : 0 < ‖w‖) (hsmall : ‖w‖ < 1 / 2) + (hcone : ‖w‖ / 2 ≤ w.re) : + 1 / ‖w‖ ^ 2 ≤ ‖deriv koebeMap (-1 + w)‖ ^ (-2 : ℝ) := by + rw [← norm_rpow_neg_two] + exact koebe_negative_endpoint_lower (left_cone_mem_disk h0 hsmall hcone) hsmall + +lemma koebe_right_cone_lower {w : ℂ} + (h0 : 0 < ‖w‖) (hsmall : ‖w‖ < 1 / 2) + (hcone : ‖w‖ / 2 ≤ w.re) : + 1 / ‖w‖ ^ 2 ≤ ‖deriv koebeMap (1 - w)‖ ^ (2 / 3 : ℝ) := by + rw [← norm_rpow_neg_two] + exact koebe_positive_endpoint_lower (right_cone_mem_disk h0 hsmall hcone) h0 hsmall + +end Brennan.Sharp + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/KoebeDivergence.lean b/lean/OAI/Analysis/IntegralMeans/KoebeDivergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..920f62d47e07b47b468ff163cf2df36a7116fa9d --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/KoebeDivergence.lean @@ -0,0 +1,44 @@ +import OAI.Analysis.IntegralMeans.AffineArea +import OAI.Analysis.IntegralMeans.KoebePolar +import OAI.Analysis.IntegralMeans.SectorDivergence + +namespace OAI + +noncomputable section +open Set MeasureTheory +open scoped ENNReal +namespace Brennan.Sharp + +lemma koebe_negative_endpoint_area : areaMoment koebeMap disk (-2) = ⊤ := by + have h := Sector.lintegral_eq_top_of_sector_lower_bound + (fun w => disk.indicator + (fun z => ENNReal.ofReal (‖deriv koebeMap z‖ ^ (-2 : ℝ))) (-1 + w)) + (1 / 2) (-(Real.pi / 3)) (Real.pi / 3) 1 + (by norm_num) (by linarith [Real.pi_pos]) (by norm_num) + (by linarith [Real.pi_pos]) (by linarith [Real.pi_pos]) + (by + intro r hr θ hθ + rw [Set.indicator_of_mem (polar_left_mem_disk hr hθ)] + exact ENNReal.ofReal_le_ofReal (koebe_polar_left_lower hr hθ)) + rw [lintegral_left_disk_indicator] at h + exact h + +lemma koebe_positive_endpoint_area : areaMoment koebeMap disk (2 / 3) = ⊤ := by + have h := Sector.lintegral_eq_top_of_sector_lower_bound + (fun w => disk.indicator + (fun z => ENNReal.ofReal (‖deriv koebeMap z‖ ^ (2 / 3 : ℝ))) (1 - w)) + (1 / 2) (-(Real.pi / 3)) (Real.pi / 3) 1 + (by norm_num) (by linarith [Real.pi_pos]) (by norm_num) + (by linarith [Real.pi_pos]) (by linarith [Real.pi_pos]) + (by + intro r hr θ hθ + rw [Set.indicator_of_mem (polar_right_mem_disk hr hθ)] + exact ENNReal.ofReal_le_ofReal (koebe_polar_right_lower hr hθ)) + rw [lintegral_right_disk_indicator] at h + exact h + +end Brennan.Sharp + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/KoebePolar.lean b/lean/OAI/Analysis/IntegralMeans/KoebePolar.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a2cae30d0dc0689fbe0c5477f020ef82a43cbbf --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/KoebePolar.lean @@ -0,0 +1,68 @@ +import OAI.Analysis.IntegralMeans.KoebeCone +import Mathlib.Analysis.SpecialFunctions.PolarCoord + +namespace OAI + +noncomputable section + +namespace Brennan.Sharp + +lemma sector_cos_lower {θ : ℝ} + (hθ : θ ∈ Set.Ioo (-(Real.pi / 3)) (Real.pi / 3)) : + (1 : ℝ) / 2 ≤ Real.cos θ := by + have habs : |θ| ≤ Real.pi / 3 := + (abs_le.mpr ⟨hθ.1.le, hθ.2.le⟩) + have h := Real.cos_le_cos_of_nonneg_of_le_pi (abs_nonneg θ) + (by linarith [Real.pi_pos] : Real.pi / 3 ≤ Real.pi) habs + simpa only [Real.cos_pi_div_three, Real.cos_abs] using h + +lemma polar_cone_data {r θ : ℝ} (hr : 0 < r) + (hθ : θ ∈ Set.Ioo (-(Real.pi / 3)) (Real.pi / 3)) : + ‖Complex.polarCoord.symm (r, θ)‖ = r ∧ + ‖Complex.polarCoord.symm (r, θ)‖ / 2 ≤ + (Complex.polarCoord.symm (r, θ)).re := by + have hn : ‖Complex.polarCoord.symm (r, θ)‖ = r := by + simpa only [abs_of_pos hr] using Complex.norm_polarCoord_symm (r, θ) + refine ⟨hn, ?_⟩ + have hre : (Complex.polarCoord.symm (r, θ)).re = r * Real.cos θ := by + rw [Complex.polarCoord_symm_apply] + simp [Complex.cos_ofReal_re] + rw [hn, hre] + have hmul := mul_le_mul_of_nonneg_left (sector_cos_lower hθ) hr.le + nlinarith + +lemma polar_left_mem_disk {r θ : ℝ} + (hr : r ∈ Set.Ioo (0 : ℝ) (1 / 2)) + (hθ : θ ∈ Set.Ioo (-(Real.pi / 3)) (Real.pi / 3)) : + -1 + Complex.polarCoord.symm (r, θ) ∈ disk := by + obtain ⟨hn, hc⟩ := polar_cone_data hr.1 hθ + exact left_cone_mem_disk (w := Complex.polarCoord.symm (r, θ)) (by rw [hn]; exact hr.1) (by rw [hn]; exact hr.2) hc + +lemma polar_right_mem_disk {r θ : ℝ} + (hr : r ∈ Set.Ioo (0 : ℝ) (1 / 2)) + (hθ : θ ∈ Set.Ioo (-(Real.pi / 3)) (Real.pi / 3)) : + 1 - Complex.polarCoord.symm (r, θ) ∈ disk := by + obtain ⟨hn, hc⟩ := polar_cone_data hr.1 hθ + exact right_cone_mem_disk (w := Complex.polarCoord.symm (r, θ)) (by rw [hn]; exact hr.1) (by rw [hn]; exact hr.2) hc + +lemma koebe_polar_left_lower {r θ : ℝ} + (hr : r ∈ Set.Ioo (0 : ℝ) (1 / 2)) + (hθ : θ ∈ Set.Ioo (-(Real.pi / 3)) (Real.pi / 3)) : + 1 / r ^ 2 ≤ ‖deriv koebeMap (-1 + Complex.polarCoord.symm (r, θ))‖ ^ (-2 : ℝ) := by + obtain ⟨hn, hc⟩ := polar_cone_data hr.1 hθ + have h := koebe_left_cone_lower (w := Complex.polarCoord.symm (r, θ)) (by rw [hn]; exact hr.1) (by rw [hn]; exact hr.2) hc + simpa only [hn] using h + +lemma koebe_polar_right_lower {r θ : ℝ} + (hr : r ∈ Set.Ioo (0 : ℝ) (1 / 2)) + (hθ : θ ∈ Set.Ioo (-(Real.pi / 3)) (Real.pi / 3)) : + 1 / r ^ 2 ≤ ‖deriv koebeMap (1 - Complex.polarCoord.symm (r, θ))‖ ^ (2 / 3 : ℝ) := by + obtain ⟨hn, hc⟩ := polar_cone_data hr.1 hθ + have h := koebe_right_cone_lower (w := Complex.polarCoord.symm (r, θ)) (by rw [hn]; exact hr.1) (by rw [hn]; exact hr.2) hc + simpa only [hn] using h + +end Brennan.Sharp + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/KoebeReduction.lean b/lean/OAI/Analysis/IntegralMeans/KoebeReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..9be937edc6be35d4f630fd54a6963b1a6e03863e --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/KoebeReduction.lean @@ -0,0 +1,71 @@ +import OAI.Analysis.IntegralMeans.SharpModel + +namespace OAI + +noncomputable section +open Set MeasureTheory +open scoped ENNReal +namespace Brennan.Sharp + +lemma koebeInverse_left_inverse {z : ℂ} (hz : z ∈ disk) : + koebeInverse (koebeMap z) = z := + koebeMap_schlicht.1.2.leftInvOn_invFunOn hz + +lemma koebeInverse_mapsTo : MapsTo koebeInverse koebeDomain disk := by + rintro _ ⟨z, hz, rfl⟩ + rwa [koebeInverse_left_inverse hz] + +lemma koebeInverse_right_inverse {z : ℂ} (hz : z ∈ koebeDomain) : + koebeMap (koebeInverse z) = z := by + rcases hz with ⟨w, hw, rfl⟩ + rw [koebeInverse_left_inverse hw] + +lemma koebe_deriv_norm_left {w : ℂ} (hz : -1 + w ∈ disk) : + ‖deriv koebeMap (-1 + w)‖ = ‖w‖ / ‖2 - w‖ ^ 3 := by + rw [(koebeMap_hasDerivAt hz).deriv] + have hnum : 1 + (-1 + w) = w := by ring + have hden : 1 - (-1 + w) = 2 - w := by ring + rw [hnum, hden, norm_div, norm_pow] + +lemma koebe_deriv_norm_right {w : ℂ} (hz : 1 - w ∈ disk) : + ‖deriv koebeMap (1 - w)‖ = ‖2 - w‖ / ‖w‖ ^ 3 := by + rw [(koebeMap_hasDerivAt hz).deriv] + have hnum : 1 + (1 - w) = 2 - w := by ring + have hden : 1 - (1 - w) = w := by ring + rw [hnum, hden, norm_div, norm_pow] + +lemma one_le_norm_two_sub {w : ℂ} (hw : ‖w‖ < 1 / 2) : + 1 ≤ ‖2 - w‖ := by + have h := norm_sub_norm_le (2 : ℂ) w + norm_num at h + linarith + +lemma koebe_negative_endpoint_lower {w : ℂ} + (hz : -1 + w ∈ disk) (hw : ‖w‖ < 1 / 2) : + ‖w‖ ^ (-2 : ℝ) ≤ ‖deriv koebeMap (-1 + w)‖ ^ (-2 : ℝ) := by + have hd : 0 < ‖deriv koebeMap (-1 + w)‖ := + norm_pos_iff.mpr (univalent_deriv_ne_zero Metric.isOpen_ball koebeMap_schlicht.1 hz) + have hb : ‖deriv koebeMap (-1 + w)‖ ≤ ‖w‖ := by + rw [koebe_deriv_norm_left hz] + exact div_le_self (norm_nonneg _) (one_le_pow₀ (one_le_norm_two_sub hw)) + exact Real.rpow_le_rpow_of_nonpos hd hb (by norm_num) + +lemma koebe_positive_endpoint_lower {w : ℂ} + (hz : 1 - w ∈ disk) (h0 : 0 < ‖w‖) (hw : ‖w‖ < 1 / 2) : + ‖w‖ ^ (-2 : ℝ) ≤ ‖deriv koebeMap (1 - w)‖ ^ (2 / 3 : ℝ) := by + have hb : 1 / ‖w‖ ^ 3 ≤ ‖deriv koebeMap (1 - w)‖ := by + rw [koebe_deriv_norm_right hz] + exact div_le_div_of_nonneg_right (one_le_norm_two_sub hw) (by positivity) + have hp := Real.rpow_le_rpow (by positivity : 0 ≤ 1 / ‖w‖ ^ 3) hb + (by norm_num : (0 : ℝ) ≤ 2 / 3) + have he : (1 / ‖w‖ ^ 3) ^ (2 / 3 : ℝ) = ‖w‖ ^ (-2 : ℝ) := by + rw [one_div, Real.inv_rpow (by positivity), ← Real.rpow_natCast ‖w‖ 3, + ← Real.rpow_mul h0.le] + norm_num [Real.rpow_neg, Real.rpow_two] + rwa [he] at hp + +end Brennan.Sharp + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/LevelCurve.lean b/lean/OAI/Analysis/IntegralMeans/LevelCurve.lean new file mode 100644 index 0000000000000000000000000000000000000000..e725bac7ea1897adec69cb78f5f5bee5f91e79e7 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/LevelCurve.lean @@ -0,0 +1,517 @@ +import OAI.Analysis.IntegralMeans.Winding + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +def periodicLoop {γ : ℝ → ℂ} (hc : Continuous γ) (s : ℝ) : C(unitInterval,ℂ) := + ⟨fun t => γ ((t : ℝ)+s),hc.comp (continuous_subtype_val.add continuous_const)⟩ + +lemma periodicLoop_closed {γ : ℝ → ℂ} (hc : Continuous γ) + (hp : Function.Periodic γ 1) (s : ℝ) : + periodicLoop hc s 1 = periodicLoop hc s 0 := by + simpa only [periodicLoop,ContinuousMap.coe_mk,show ((1 : unitInterval) : ℝ) = 1 from rfl,show ((0 : unitInterval) : ℝ) = 0 from rfl, + zero_add,add_zero,add_comm] using hp s + +lemma periodicLoop_range {γ : ℝ → ℂ} (hc : Continuous γ) + (hp : Function.Periodic γ 1) (s : ℝ) : range (periodicLoop hc s) = range γ := by + apply Subset.antisymm + · rintro _ ⟨t,rfl⟩; exact ⟨(t : ℝ)+s,rfl⟩ + · rintro _ ⟨t,rfl⟩ + obtain ⟨u,hu,he⟩ := hp.exists_mem_Ico (by norm_num) t s + refine ⟨⟨u-s,⟨by linarith [hu.1],by linarith [hu.2]⟩⟩,?_⟩ + simpa only [periodicLoop,ContinuousMap.coe_mk,sub_add_cancel] using he.symm + +lemma loopIndex_periodic_shift {γ : ℝ → ℂ} (hc : Continuous γ) + (hp : Function.Periodic γ 1) {a : ℂ} (ha : a ∉ range γ) (s : ℝ) : + loopIndex (periodicLoop hc s) a = loopIndex (periodicLoop hc 0) a := by + let H : C(unitInterval × unitInterval,ℂ) := + ⟨fun p => γ ((p.2 : ℝ)+(p.1 : ℝ)*s)-a,by fun_prop⟩ + have hi := windingNumber_homotopy H (by + intro p; exact sub_ne_zero.mpr (fun he => ha ⟨_,he⟩)) (by + intro t + change γ (1+(t:ℝ)*s)-a = γ (0+(t:ℝ)*s)-a + simpa only [zero_add,add_zero,add_comm] using congrArg (fun z : ℂ => z-a) (hp ((t:ℝ)*s))) + simpa only [H,loopIndex,periodicLoop,show ((1 : unitInterval) : ℝ) = 1 from rfl,show ((0 : unitInterval) : ℝ) = 0 from rfl, + ContinuousMap.coe_mk,one_mul,zero_mul] using hi + +lemma transverse_displacement_not_mem {γ : ℝ → ℂ} (hp : Function.Periodic γ 1) + {d : ℂ} {δ : ℝ} + (hz : ∀ w : ℂ, |w.re| ≤ δ → |w.im| ≤ 1/2 → + (γ w.im-γ 0-w.re • (Complex.I*d) = 0 ↔ w = 0)) + {r : ℝ} (hr : r ≠ 0) (hrd : |r| ≤ δ) : + γ 0+r • (Complex.I*d) ∉ range γ := by + rintro ⟨t,ht⟩ + obtain ⟨u,hu,he⟩ := hp.exists_mem_Ico (by norm_num) t (-(1/2)) + have hui : |u| ≤ 1/2 := abs_le.mpr ⟨hu.1,by linarith [hu.2]⟩ + let w : ℂ := (r : ℂ)+(u : ℂ)*Complex.I + have hre : w.re = r := by simp [w] + have him : w.im = u := by simp [w] + have hw : w = 0 := (hz w (hre ▸ hrd) (him ▸ hui)).mp (by + rw [hre,him,← he,ht]; abel) + have h := congrArg Complex.re hw + exact hr (by simpa only [hre,Complex.zero_re] using h) + +lemma winding_jump {γ : ℝ → ℂ} (hc : Continuous γ) + (hp : Function.Periodic γ 1) (hinj : InjOn γ (Ico (0 : ℝ) 1)) + {d : ℂ} (hd : HasDerivAt γ d 0) (hdn : d ≠ 0) : + ∃ δ : ℝ, 0 < δ ∧ ∀ r : ℝ, 0 < r → r ≤ δ → + γ 0+r • (Complex.I*d) ∉ range γ ∧ γ 0-r • (Complex.I*d) ∉ range γ ∧ + loopIndex (periodicLoop hc 0) (γ 0+r • (Complex.I*d)) - + loopIndex (periodicLoop hc 0) (γ 0-r • (Complex.I*d)) = 1 := by + obtain ⟨δ,hδ,hjump⟩ := winding_jump_centred hc hp hinj hd hdn + obtain ⟨ε,hε,hzero⟩ := transverse_unique_zero_strip hc hp hinj hd hdn + refine ⟨min δ ε,lt_min hδ hε,?_⟩ + intro r hr hre + have hn₁ := transverse_displacement_not_mem hp hzero hr.ne' + (show |r| ≤ ε from (abs_of_pos hr).symm ▸ hre.trans (min_le_right _ _)) + have hn₂ : γ 0-r • (Complex.I*d) ∉ range γ := by + simpa only [neg_smul,sub_eq_add_neg] using transverse_displacement_not_mem hp hzero + (neg_ne_zero.mpr hr.ne') (show |-r| ≤ ε by + rw [abs_neg,abs_of_pos hr]; exact hre.trans (min_le_right _ _)) + refine ⟨hn₁,hn₂,?_⟩ + have hj := hjump r hr (hre.trans (min_le_left _ _)) + change loopIndex (periodicLoop hc (-(1/2))) (γ 0+r • (Complex.I*d))- + loopIndex (periodicLoop hc (-(1/2))) (γ 0-r • (Complex.I*d)) = 1 at hj + rwa [loopIndex_periodic_shift hc hp hn₁,loopIndex_periodic_shift hc hp hn₂] at hj + +lemma loopIndex_zero_of_re_lt (γ : C(unitInterval,ℂ)) (hloop : γ 1 = γ 0) + {a : ℂ} (ha : ∀ t, a.re < (γ t).re) : loopIndex γ a = 0 := by + apply windingNumber_eq_of_logIncrement (by simp [hloop]) + have h := HasLogIncrement.of_slit (⟨fun t => γ t-a,by fun_prop⟩ : C(unitInterval,ℂ)) + (fun t => Complex.mem_slitPlane_iff.mpr (Or.inl (by simpa using sub_pos.mpr (ha t)))) + simpa only [ContinuousMap.coe_mk,hloop,sub_self,Int.cast_zero,zero_mul] using h + +lemma winding_leftmost_normal {γ : ℝ → ℂ} (hc : Continuous γ) + (hp : Function.Periodic γ 1) (hinj : InjOn γ (Ico (0 : ℝ) 1)) + {d : ℂ} (hd : HasDerivAt γ d 0) (hdi : d.im < 0) + (hmin : ∀ t, (γ 0).re ≤ (γ t).re) : + ∃ δ : ℝ, 0 < δ ∧ ∀ r : ℝ, 0 < r → r ≤ δ → + γ 0+r • (Complex.I*d) ∉ range γ ∧ + loopIndex (periodicLoop hc 0) (γ 0+r • (Complex.I*d)) = 1 := by + have hdn : d ≠ 0 := by intro he; simp only [he,Complex.zero_im] at hdi; linarith + obtain ⟨δ,hδ,hj⟩ := winding_jump hc hp hinj hd hdn + refine ⟨δ,hδ,?_⟩ + intro r hr hrd + obtain ⟨hn,_,hjump⟩ := hj r hr hrd + have hzero : loopIndex (periodicLoop hc 0) (γ 0-r • (Complex.I*d)) = 0 := + loopIndex_zero_of_re_lt _ (periodicLoop_closed hc hp 0) (by + intro t + change (γ 0-r • (Complex.I*d)).re < (γ ((t:ℝ)+0)).re + simp only [Complex.sub_re,Complex.smul_re,Complex.mul_re,Complex.I_re,zero_mul, + Complex.I_im,one_mul,zero_sub,smul_eq_mul] + nlinarith [hmin ((t:ℝ)+0)]) + rw [hzero,sub_zero] at hjump + exact ⟨hn,hjump⟩ + +lemma isMIntegralCurve_iff_hasDerivAt {γ : ℝ → ℂ} {v : ℂ → ℂ} : + IsMIntegralCurve (I := 𝓘(ℝ,ℂ)) γ v ↔ ∀ t, HasDerivAt γ (v (γ t)) t := by + constructor + · intro h t + have ht : HasFDerivAt γ ((1 : ℝ →L[ℝ] ℝ).smulRight (v (γ t))) t := + hasMFDerivAt_iff_hasFDerivAt.mp (h t) + simpa only [ContinuousLinearMap.smulRight_apply, one_apply_eq_self, one_smul] using ht.hasDerivAt + · intro h t + apply hasMFDerivAt_iff_hasFDerivAt.mpr + convert (h t).hasFDerivAt using 1 + rfl + +lemma exists_global_curve {v : ℂ → ℂ} (hv : ContDiff ℝ 1 v) + (hc : HasCompactSupport v) (x : ℂ) : + ∃ γ : ℝ → ℂ, γ 0 = x ∧ ∀ t, HasDerivAt γ (v (γ t)) t := by + obtain ⟨K, hK⟩ := ContDiff.lipschitzWith_of_hasCompactSupport hc hv (by simp) + obtain ⟨B, hB⟩ := hc.exists_bound_of_continuous hv.continuous + let L : ℝ≥0 := ⟨max B 0, le_max_right _ _⟩ + have hL : ∀ z, ‖v z‖ ≤ (L : ℝ) := fun z => (hB z).trans (le_max_left _ _) + have hm : ContMDiff 𝓘(ℝ,ℂ) (𝓘(ℝ,ℂ)).tangent 1 + (fun z => (⟨z,v z⟩ : TangentBundle 𝓘(ℝ,ℂ) ℂ)) := + contMDiff_vectorSpace_iff_contDiff.mpr hv + have he : ∀ z : ℂ, ∃ γ : ℝ → ℂ, γ 0 = z ∧ + IsMIntegralCurveOn (I := 𝓘(ℝ,ℂ)) γ v (Ioo (-1) 1) := by + intro z + have hi : IsPicardLindelof (fun _ : ℝ => v) + (⟨0, by norm_num⟩ : Icc (-1 : ℝ) 1) z L 0 L K := by + refine ⟨fun _ _ => hK.lipschitzOnWith, fun _ _ => continuousOn_const, + fun _ _ w _ => hL w, ?_⟩ + simp + obtain ⟨γ,hγ0,hγ⟩ := hi.exists_eq_forall_mem_Icc_hasDerivWithinAt₀ + refine ⟨γ,hγ0,fun t ht => ?_⟩ + exact ((hγ t ⟨ht.1.le,ht.2.le⟩).hasDerivAt (Icc_mem_nhds ht.1 ht.2)).hasFDerivAt.hasMFDerivAt.hasMFDerivWithinAt + obtain ⟨γ,hγ0,hγ⟩ := exists_isMIntegralCurve_of_isMIntegralCurveOn hm (by norm_num : (0:ℝ)<1) he x + exact ⟨γ,hγ0,isMIntegralCurve_iff_hasDerivAt.mp hγ⟩ + +def transverseCoordinate (p : ℂ →L[ℝ] ℝ) : ℂ →L[ℝ] ℝ := + (-p Complex.I) • Complex.reCLM + (p 1) • Complex.imCLM + +def levelChartDerivative (p : ℂ →L[ℝ] ℝ) : ℂ →L[ℝ] ℂ := + Complex.ofRealCLM.comp p + Complex.I • (Complex.ofRealCLM.comp (transverseCoordinate p)) + +lemma realFunctional_decomposition (p : ℂ →L[ℝ] ℝ) (w : ℂ) : + p w = w.re * p 1 + w.im * p Complex.I := by + have hw : w = w.re • (1 : ℂ) + w.im • Complex.I := by + simp [Complex.real_smul, Complex.re_add_im] + conv_lhs => rw [hw, map_add, map_smul, map_smul] + simp only [smul_eq_mul] + +lemma levelChartDerivative_det (p : ℂ →L[ℝ] ℝ) : + LinearMap.det (levelChartDerivative p).toLinearMap = (p 1)^2 + (p Complex.I)^2 := by + rw [determinant_complex_real] + simp [levelChartDerivative, transverseCoordinate, Complex.mul_re, Complex.mul_im] + ring + +lemma levelChartDerivative_det_pos {p : ℂ →L[ℝ] ℝ} (hp : p ≠ 0) : + 0 < LinearMap.det (levelChartDerivative p).toLinearMap := by + rw [levelChartDerivative_det] + have hn : p 1 ≠ 0 ∨ p Complex.I ≠ 0 := by + by_contra h + push Not at h + apply hp + ext w + rw [realFunctional_decomposition, h.1, h.2] + simp + rcases hn with hn|hn + · nlinarith [sq_pos_of_ne_zero hn, sq_nonneg (p Complex.I)] + · nlinarith [sq_pos_of_ne_zero hn, sq_nonneg (p 1)] + +lemma exists_regular_level_chart {f : ℂ → ℝ} {z : ℂ} + (hf : ContDiffAt ℝ 1 f z) (hp : fderiv ℝ f z ≠ 0) : + ∃ e : OpenPartialHomeomorph ℂ ℂ, z ∈ e.source ∧ + (∀ w, (e w).re = f w) ∧ + (∀ w, (e w).im = transverseCoordinate (fderiv ℝ f z) w) := by + let p := fderiv ℝ f z + let Φ : ℂ → ℂ := fun w => (f w : ℂ) + Complex.I * (transverseCoordinate p w : ℂ) + have hc : ContDiffAt ℝ 1 Φ z := + (Complex.ofRealCLM.contDiff.contDiffAt.comp z hf).add + (contDiffAt_const.mul ((Complex.ofRealCLM.comp (transverseCoordinate p)).contDiff.contDiffAt)) + have hd : HasFDerivAt Φ (levelChartDerivative p) z := by + exact (Complex.ofRealCLM.hasFDerivAt.comp z (hf.differentiableAt (by simp)).hasFDerivAt).add + (((Complex.ofRealCLM.comp (transverseCoordinate p)).hasFDerivAt).const_mul Complex.I) + let A : ℂ ≃L[ℝ] ℂ := (LinearMap.equivOfIsUnitDet + (isUnit_iff_ne_zero.mpr (ne_of_gt (levelChartDerivative_det_pos hp)))).toContinuousLinearEquiv + have hA : (A : ℂ →L[ℝ] ℂ) = levelChartDerivative p := by + ext w + exact LinearMap.equivOfIsUnitDet_apply _ w + rw [← hA] at hd + refine ⟨hc.toOpenPartialHomeomorph Φ hd (by simp), + hc.mem_toOpenPartialHomeomorph_source hd (by simp), ?_, ?_⟩ + · intro w + change (Φ w).re = f w + simp [Φ] + · intro w + change (Φ w).im = transverseCoordinate p w + simp [Φ] + +lemma curve_local_level_cover {f : ℂ → ℝ} {γ : ℝ → ℂ} {t : ℝ} {v : ℂ} + (hf : ContDiffAt ℝ 1 f (γ t)) (hp : fderiv ℝ f (γ t) ≠ 0) + (hγ : ContDiffAt ℝ 1 γ t) (hd : HasDerivAt γ v t) (hv : v ≠ 0) + (hc : ∀ s, f (γ s) = f (γ t)) {U : Set ℝ} (hU : U ∈ 𝓝 t) : + ∀ᶠ w in 𝓝 (γ t), f w = f (γ t) → w ∈ γ '' U := by + let p := fderiv ℝ f (γ t) + let q := transverseCoordinate p + have hfd := (hf.differentiableAt (by simp)).hasFDerivAt + have hpv : p v = 0 := by + have hh := hfd.comp_hasDerivAt t hd + have he : (f ∘ γ) = fun _ => f (γ t) := funext hc + rw [he] at hh + exact hh.unique (hasDerivAt_const t _) + have hqv : q v ≠ 0 := by + intro hq + have hA : IsUnit (LinearMap.det (levelChartDerivative p).toLinearMap) := + isUnit_iff_ne_zero.mpr (ne_of_gt (levelChartDerivative_det_pos hp)) + let A := LinearMap.equivOfIsUnitDet hA + have hz : A v = A 0 := by + rw [show A v = levelChartDerivative p v from LinearMap.equivOfIsUnitDet_apply _ v, + show A 0 = levelChartDerivative p 0 from LinearMap.equivOfIsUnitDet_apply _ 0] + simp [levelChartDerivative, hpv, show transverseCoordinate p v = 0 from hq] + exact hv (A.injective hz) + let ψ : ℝ → ℝ := fun s => q (γ s) + have hψ : HasStrictDerivAt ψ (q v) t := + (q.contDiff.contDiffAt.comp t hγ).hasStrictDerivAt' + (q.hasFDerivAt.comp_hasDerivAt t hd) (by simp) + let σ := hψ.localInverse ψ (q v) t hqv + have hσ : σ (ψ t) = t := hψ.eventually_left_inverse hqv |>.self_of_nhds + have hσc : Tendsto σ (𝓝 (ψ t)) (𝓝 t) := by + have ht : Tendsto σ (𝓝 (ψ t)) (𝓝 (σ (ψ t))) := + (hψ.to_localInverse hqv).hasDerivAt.continuousAt.tendsto + rwa [hσ] at ht + obtain ⟨e,het,her,hei⟩ := exists_regular_level_chart hf hp + have hw : ∀ᶠ w in 𝓝 (γ t), w ∈ e.source := e.open_source.mem_nhds het + have hqc : Tendsto q (𝓝 (γ t)) (𝓝 (ψ t)) := q.continuous.continuousAt.tendsto + have hi : ∀ᶠ w in 𝓝 (γ t), ψ (σ (q w)) = q w := + hqc.eventually (hψ.eventually_right_inverse hqv) + have hu : ∀ᶠ w in 𝓝 (γ t), σ (q w) ∈ U := (hσc.comp hqc).eventually hU + have hs : ∀ᶠ w in 𝓝 (γ t), γ (σ (q w)) ∈ e.source := + (hγ.continuousAt.tendsto.comp (hσc.comp hqc)).eventually hw + filter_upwards [hw,hi,hu,hs] with w hw hi hu hs hfwe + refine ⟨σ (q w),hu, e.injOn hs hw ?_⟩ + apply Complex.ext + · rw [her,her,hc,hfwe] + · rw [hei,hei] + exact hi + +lemma integral_curve_contDiff_one {v : ℂ → ℂ} {γ : ℝ → ℂ} + (hv : Continuous v) (hγ : ∀ t, HasDerivAt γ (v (γ t)) t) : + ContDiff ℝ 1 γ := by + apply contDiff_one_iff_deriv.mpr + have hc : Continuous γ := continuous_iff_continuousAt.mpr fun t => (hγ t).continuousAt + refine ⟨fun t => (hγ t).differentiableAt, ?_⟩ + have he : deriv γ = v ∘ γ := funext fun t => (hγ t).deriv + rw [he] + exact hv.comp hc + +lemma integral_curve_first_integral {f : ℂ → ℝ} {v : ℂ → ℂ} {γ : ℝ → ℂ} + (hf : Differentiable ℝ f) (horth : ∀ z, fderiv ℝ f z (v z) = 0) + (hγ : ∀ t, HasDerivAt γ (v (γ t)) t) (s t : ℝ) : f (γ s) = f (γ t) := by + have hd (t : ℝ) : HasDerivAt (fun t => f (γ t)) 0 t := by + convert (hf (γ t)).hasFDerivAt.comp_hasDerivAt t (hγ t) using 1 <;> + first | rfl | simp only [horth] + exact is_const_of_deriv_eq_zero (fun t => (hd t).differentiableAt) + (fun t => (hd t).deriv) s t + +lemma integral_curves_shift_eq {v : ℂ → ℂ} {γ κ : ℝ → ℂ} + (hv : ContDiff ℝ 1 v) + (hγ : ∀ t, HasDerivAt γ (v (γ t)) t) + (hκ : ∀ t, HasDerivAt κ (v (κ t)) t) + {a b : ℝ} (he : γ a = κ b) (s : ℝ) : γ (s+a) = κ (s+b) := by + have hm : ContMDiff 𝓘(ℝ,ℂ) (𝓘(ℝ,ℂ)).tangent 1 + (fun z => (⟨z,v z⟩ : TangentBundle 𝓘(ℝ,ℂ) ℂ)) := + contMDiff_vectorSpace_iff_contDiff.mpr hv + have hh := isMIntegralCurve_Ioo_eq_of_contMDiff_boundaryless (t₀ := 0) hm + ((isMIntegralCurve_iff_hasDerivAt.mpr hγ).comp_add a) + ((isMIntegralCurve_iff_hasDerivAt.mpr hκ).comp_add b) (by simpa using he) + exact congrFun hh s + +lemma curve_isOpenMap_level {f : ℂ → ℝ} {γ : ℝ → ℂ} {c : ℝ} + (hf : ContDiff ℝ 1 f) (hp : ∀ z, f z = c → fderiv ℝ f z ≠ 0) + (hγ : ContDiff ℝ 1 γ) (hn : ∀ t, deriv γ t ≠ 0) + (hc : ∀ t, f (γ t) = c) : + IsOpenMap (fun t => (⟨γ t,hc t⟩ : {z : ℂ | f z = c})) := by + intro U hU + apply isOpen_iff_mem_nhds.mpr + rintro _ ⟨t,ht,rfl⟩ + have hh := curve_local_level_cover hf.contDiffAt (hp _ (hc t)) hγ.contDiffAt + (hγ.differentiable (by simp) t).hasDerivAt (hn t) + (fun s => (hc s).trans (hc t).symm) (hU.mem_nhds ht) + have hm : Tendsto (Subtype.val : {z : ℂ | f z = c} → ℂ) + (𝓝 ⟨γ t,hc t⟩) (𝓝 (γ t)) := continuous_subtype_val.continuousAt.tendsto + have he := hm.eventually hh + filter_upwards [he] with w hw + obtain ⟨s,hs,heq⟩ := hw (w.property.trans (hc t).symm) + exact ⟨s,hs,Subtype.ext heq⟩ + +lemma compact_regular_level_periodic {f : ℂ → ℝ} {v : ℂ → ℂ} {c : ℝ} + (hf : ContDiff ℝ 1 f) (hv : ContDiff ℝ 1 v) (hvc : HasCompactSupport v) + (horth : ∀ z, fderiv ℝ f z (v z) = 0) + (hp : ∀ z, f z = c → fderiv ℝ f z ≠ 0) + (hn : ∀ z, f z = c → v z ≠ 0) + (hK : IsCompact {z : ℂ | f z = c}) {γ : ℝ → ℂ} + (hγ : ∀ t, HasDerivAt γ (v (γ t)) t) (hγ0 : f (γ 0) = c) : + ∃ T > 0, Periodic γ T := by + let K := {z : ℂ | f z = c} + have hc (t : ℝ) : f (γ t) = c := + (integral_curve_first_integral (hf.differentiable (by simp)) horth hγ t 0).trans hγ0 + let Γ : ℝ → K := fun t => ⟨γ t,hc t⟩ + have hγc := integral_curve_contDiff_one hv.continuous hγ + have hΓo : IsOpenMap Γ := curve_isOpenMap_level hf hp hγc + (fun t => by rw [(hγ t).deriv]; exact hn _ (hc t)) hc + have hΓc : Continuous Γ := hγc.continuous.subtype_mk _ + have hclosed : IsClosed (range Γ) := by + apply isOpen_compl_iff.mp + apply isOpen_iff_mem_nhds.mpr + intro w hw + obtain ⟨κ,hκ0,hκ⟩ := exists_global_curve hv hvc w.val + have hκc (s : ℝ) : f (κ s) = c := by + rw [integral_curve_first_integral (hf.differentiable (by simp)) horth hκ s 0, hκ0] + exact w.property + let Δ : ℝ → K := fun s => ⟨κ s,hκc s⟩ + have hΔo : IsOpenMap Δ := curve_isOpenMap_level hf hp + (integral_curve_contDiff_one hv.continuous hκ) + (fun s => by rw [(hκ s).deriv]; exact hn _ (hκc s)) hκc + have hwΔ : w ∈ range Δ := ⟨0,Subtype.ext hκ0⟩ + apply mem_of_superset (hΔo.isOpen_range.mem_nhds hwΔ) + rintro y ⟨s,rfl⟩ ⟨t,ht⟩ + apply hw + have he : γ t = κ s := congrArg Subtype.val ht + refine ⟨-s+t,Subtype.ext ?_⟩ + have hh := integral_curves_shift_eq hv hγ hκ he (-s) + simpa only [neg_add_cancel,hκ0] using hh + have hcompact : IsCompact (range Γ) := by + have : CompactSpace K := isCompact_iff_compactSpace.mp hK + exact hclosed.isCompact + have hnotinj : ¬ Injective γ := by + intro hi + have hΓi : Injective Γ := fun a b h => hi (congrArg Subtype.val h) + have he := Topology.IsOpenEmbedding.of_continuous_injective_isOpenMap hΓc hΓi hΓo + apply noncompact_univ ℝ + apply he.isEmbedding.isCompact_iff.mpr + simpa only [image_univ] using hcompact + have hm : ContMDiff 𝓘(ℝ,ℂ) (𝓘(ℝ,ℂ)).tangent 1 + (fun z => (⟨z,v z⟩ : TangentBundle 𝓘(ℝ,ℂ) ℂ)) := + contMDiff_vectorSpace_iff_contDiff.mpr hv + exact (xor_iff_iff_not.mp + ((isMIntegralCurve_iff_hasDerivAt.mpr hγ).periodic_xor_injective hm)).mpr hnotinj + +lemma curve_locally_injective {γ : ℝ → ℂ} {t : ℝ} + (hγ : ContDiffAt ℝ 1 γ t) (hn : deriv γ t ≠ 0) : + ∃ ε > 0, InjOn γ (Metric.ball t ε) := by + obtain ⟨p,hp⟩ : ∃ p : ℂ →L[ℝ] ℝ, p (deriv γ t) ≠ 0 := by + by_cases hr : (deriv γ t).re = 0 + · refine ⟨Complex.imCLM,fun hi => hn (Complex.ext hr hi)⟩ + · exact ⟨Complex.reCLM,hr⟩ + have hd : HasStrictDerivAt (fun s => p (γ s)) (p (deriv γ t)) t := + (p.contDiff.contDiffAt.comp t hγ).hasStrictDerivAt' + (p.hasFDerivAt.comp_hasDerivAt t + (hγ.differentiableAt (by simp)).hasDerivAt) (by simp) + obtain ⟨ε,hε,hsub⟩ := Metric.mem_nhds_iff.mp (hd.eventually_left_inverse hp) + refine ⟨ε,hε,fun a ha b hb he => ?_⟩ + have h₁ := hsub ha + have h₂ := hsub hb + change HasStrictDerivAt.localInverse (fun s => p (γ s)) (p (deriv γ t)) t hd hp (p (γ a)) = a at h₁ + change HasStrictDerivAt.localInverse (fun s => p (γ s)) (p (deriv γ t)) t hd hp (p (γ b)) = b at h₂ + rw [he] at h₁ + exact h₁.symm.trans h₂ + +lemma integral_curve_simple_period {v : ℂ → ℂ} {γ : ℝ → ℂ} + (hv : ContDiff ℝ 1 v) (hγ : ∀ t, HasDerivAt γ (v (γ t)) t) + (hn : v (γ 0) ≠ 0) (hper : ∃ T > 0, Periodic γ T) : + ∃ T > 0, Periodic γ T ∧ InjOn γ (Ico 0 T) := by + have hγc := integral_curve_contDiff_one hv.continuous hγ + obtain ⟨ε,hε,hεinj⟩ := curve_locally_injective (t := 0) hγc.contDiffAt + (by rw [(hγ 0).deriv]; exact hn) + have hlow : ∀ t, 0 < t → γ t = γ 0 → ε ≤ t := by + intro t ht he + by_contra hh + have hlt : t < ε := lt_of_not_ge hh + have hmem : t ∈ Metric.ball (0 : ℝ) ε := by + simpa [Metric.mem_ball, Real.dist_eq, abs_of_pos ht] using hlt + have hz := hεinj hmem (Metric.mem_ball_self hε) he + linarith + obtain ⟨T,hT,hpT⟩ := hper + have hTr : γ T = γ 0 := by simpa using hpT 0 + let S := Icc ε T ∩ {t | γ t = γ 0} + have hS : IsCompact S := isCompact_Icc.inter_right + (isClosed_eq hγc.continuous continuous_const) + obtain ⟨P,hP,hmin⟩ := hS.exists_isMinOn ⟨T,⟨⟨hlow T hT hTr,le_rfl⟩,hTr⟩⟩ + continuousOn_id + have hPpos : 0 < P := hε.trans_le hP.1.1 + have hleast : ∀ t, 0 < t → γ t = γ 0 → P ≤ t := by + intro t ht he + by_cases hle : t ≤ T + · exact hmin ⟨⟨hlow t ht he,hle⟩,he⟩ + · exact hP.1.2.trans (le_of_not_ge hle) + have hm : ContMDiff 𝓘(ℝ,ℂ) (𝓘(ℝ,ℂ)).tangent 1 + (fun z => (⟨z,v z⟩ : TangentBundle 𝓘(ℝ,ℂ) ℂ)) := + contMDiff_vectorSpace_iff_contDiff.mpr hv + have hi := isMIntegralCurve_iff_hasDerivAt.mpr hγ + have hPP : Periodic γ P := by simpa using hi.periodic_of_eq hm hP.2 + refine ⟨P,hPpos,hPP,fun a ha b hb he => ?_⟩ + rcases lt_trichotomy a b with hab|hab|hab + · have hper := hi.periodic_of_eq hm he.symm + have hret : γ (b-a) = γ 0 := by simpa using hper 0 + have hh := hleast (b-a) (sub_pos.mpr hab) hret + linarith [ha.1,hb.2] + · exact hab + · have hper := hi.periodic_of_eq hm he + have hret : γ (a-b) = γ 0 := by simpa using hper 0 + have hh := hleast (a-b) (sub_pos.mpr hab) hret + linarith [hb.1,ha.2] + +lemma integral_curves_range_eq {v : ℂ → ℂ} {γ κ : ℝ → ℂ} + (hv : ContDiff ℝ 1 v) + (hγ : ∀ t, HasDerivAt γ (v (γ t)) t) + (hκ : ∀ t, HasDerivAt κ (v (κ t)) t) + {a b : ℝ} (he : γ a = κ b) : range γ = range κ := by + apply Subset.antisymm + · rintro _ ⟨s,rfl⟩ + refine ⟨s-a+b, ?_⟩ + have hh := integral_curves_shift_eq hv hγ hκ he (s-a) + simpa only [sub_add_cancel] using hh.symm + · rintro _ ⟨s,rfl⟩ + refine ⟨s-b+a, ?_⟩ + have hh := integral_curves_shift_eq hv hκ hγ he.symm (s-b) + simpa only [sub_add_cancel] using hh.symm + +lemma compact_regular_level_finite_curves {f : ℂ → ℝ} {v : ℂ → ℂ} {c : ℝ} + (hf : ContDiff ℝ 1 f) (hv : ContDiff ℝ 1 v) (hvc : HasCompactSupport v) + (horth : ∀ z, fderiv ℝ f z (v z) = 0) + (hp : ∀ z, f z = c → fderiv ℝ f z ≠ 0) + (hn : ∀ z, f z = c → v z ≠ 0) + (hK : IsCompact {z : ℂ | f z = c}) : + ∃ C : Finset (Set ℂ), (⋃ S ∈ C, S) = {z : ℂ | f z = c} ∧ + (∀ S ∈ C, ∀ T ∈ C, S ≠ T → Disjoint S T) ∧ + ∀ S ∈ C, ∃ γ : ℝ → ℂ, ∃ P > 0, + range γ = S ∧ (∀ t, HasDerivAt γ (v (γ t)) t) ∧ + Periodic γ P ∧ InjOn γ (Ico 0 P) := by + classical + let K := {z : ℂ | f z = c} + have hE : ∀ z : K, ∃ γ : ℝ → ℂ, γ 0 = z.val ∧ + ∀ t, HasDerivAt γ (v (γ t)) t := fun z => exists_global_curve hv hvc z.val + choose γ hγ0 hγ using hE + have hc (z : K) (t : ℝ) : f (γ z t) = c := by + rw [integral_curve_first_integral (hf.differentiable (by simp)) horth (hγ z) t 0, + hγ0 z] + exact z.property + let Γ (z : K) : ℝ → K := fun t => ⟨γ z t,hc z t⟩ + have hΓo (z : K) : IsOpenMap (Γ z) := curve_isOpenMap_level hf hp + (integral_curve_contDiff_one hv.continuous (hγ z)) + (fun t => by rw [(hγ z t).deriv]; exact hn _ (hc z t)) (hc z) + have : CompactSpace K := isCompact_iff_compactSpace.mp hK + obtain ⟨s,hs⟩ := isCompact_univ.elim_finite_subcover (fun z : K => range (Γ z)) + (fun z => (hΓo z).isOpen_range) (by + intro z _ + exact mem_iUnion.mpr ⟨z,0,Subtype.ext (hγ0 z)⟩) + let C := s.image (fun z => range (γ z)) + refine ⟨C,?_,?_,?_⟩ + · ext w + constructor + · intro hw + obtain ⟨S,hS,hw⟩ := mem_iUnion₂.mp hw + obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hS + obtain ⟨t,rfl⟩ := hw + exact hc z t + · intro hw + obtain ⟨z,hz,t,ht⟩ := mem_iUnion₂.mp (hs (mem_univ (⟨w,hw⟩ : K))) + refine mem_iUnion₂.mpr ⟨range (γ z),Finset.mem_image.mpr ⟨z,hz,rfl⟩,t,?_⟩ + exact congrArg Subtype.val ht + · intro S hS T hT hne + obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hS + obtain ⟨w,hw,rfl⟩ := Finset.mem_image.mp hT + apply disjoint_left.mpr + rintro a ⟨s,hs⟩ ⟨t,ht⟩ + exact hne (integral_curves_range_eq hv (hγ z) (hγ w) (hs.trans ht.symm)) + · intro S hS + obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hS + obtain ⟨P,hP,hper,hinj⟩ := integral_curve_simple_period hv (hγ z) + (hn _ (hc z 0)) + (compact_regular_level_periodic hf hv hvc horth hp hn hK (hγ z) (hc z 0)) + exact ⟨γ z,P,hP,rfl,hγ z,hper,hinj⟩ + +lemma integral_curve_contDiff_two {v : ℂ → ℂ} {γ : ℝ → ℂ} + (hv : ContDiff ℝ 1 v) (hγ : ∀ t, HasDerivAt γ (v (γ t)) t) : + ContDiff ℝ 2 γ := by + have hc := integral_curve_contDiff_one hv.continuous hγ + rw [show (2 : WithTop ℕ∞) = 1+1 from rfl, contDiff_succ_iff_deriv] + refine ⟨fun t => (hγ t).differentiableAt, by simp, ?_⟩ + have he : deriv γ = v ∘ γ := funext (fun t => (hγ t).deriv) + rw [he] + exact hv.comp hc + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/LevelIndex.lean b/lean/OAI/Analysis/IntegralMeans/LevelIndex.lean new file mode 100644 index 0000000000000000000000000000000000000000..b251b2baf604072b20075ff9931e9f085efa6f20 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/LevelIndex.lean @@ -0,0 +1,499 @@ +import OAI.Analysis.IntegralMeans.Turning + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +lemma sum_loopIndex_sublevel.{u_1} {ι : Type u_1} [Fintype ι] [DecidableEq ι] + (γ : ι → C(unitInterval,ℂ)) (hclosed : ∀ i, γ i 1 = γ i 0) + {f : ℂ → ℝ} {c : ℝ} (hf : Continuous f) + (hcover : ∀ z, f z = c ↔ ∃ i, z ∈ range (γ i)) + (hdisjoint : ∀ i j, i ≠ j → Disjoint (range (γ i)) (range (γ j))) + (hlocal : ∀ i z, z ∈ range (γ i) → ∀ᶠ w in 𝓝 z, f w ≠ c → + loopIndex (γ i) w = if f w < c then 1 else 0) + (hbelow : ∀ i w, w ∉ range (γ i) → loopIndex (γ i) w ≠ 0 → f w < c) + (habove : ∃ z, c < f z) : + ∀ z, f z ≠ c → ∑ i, loopIndex (γ i) z = if f z < c then 1 else 0 := by + let J : ℂ → ℤ := fun z => if f z = c then 0 else + ∑ i, loopIndex (γ i) z - if f z < c then 1 else 0 + have hzero (i : ι) (z : ℂ) (hz : c ≤ f z) (hoff : z ∉ range (γ i)) : + loopIndex (γ i) z = 0 := by + by_contra hn + exact (hbelow i z hoff hn).not_ge hz + have hcont : Continuous J := by + apply continuous_iff_continuousAt.mpr + intro z + by_cases hz : f z = c + · obtain ⟨i,hiz⟩ := (hcover z).mp hz + have hj : ∀ᶠ w in 𝓝 z, ∀ j, j ≠ i → loopIndex (γ j) w = 0 := by + apply Filter.eventually_all.mpr + intro j + by_cases hji : j = i + · exact Filter.Eventually.of_forall (fun _ h => (h hji).elim) + · have hoff : z ∉ range (γ j) := by + intro hjz + exact Set.disjoint_left.mp (hdisjoint i j (Ne.symm hji)) hiz hjz + have hjz := hzero j z hz.ge hoff + filter_upwards [loopIndex_eventually_eq (γ j) (hclosed j) hoff] with w hw _ + exact hw.trans hjz + have he : ∀ᶠ w in 𝓝 z, J w = 0 := by + filter_upwards [hlocal i z hiz,hj] with w hw hjw + dsimp only [J] + by_cases hwe : f w = c + · rw [ite_eq_left hwe] + · rw [ite_eq_right hwe] + have hs : ∑ j, loopIndex (γ j) w = loopIndex (γ i) w := by + apply Finset.sum_eq_single i + · intro j _ hji; exact hjw j hji + · simp + rw [hs,hw hwe,sub_self] + exact continuousAt_const.congr (he.mono fun _ h => h.symm) + · have hgood (i) : z ∉ range (γ i) := fun hi => hz ((hcover z).mpr ⟨i,hi⟩) + have hj : ∀ᶠ w in 𝓝 z, ∀ i, loopIndex (γ i) w = loopIndex (γ i) z := + Filter.eventually_all.mpr fun i => loopIndex_eventually_eq (γ i) (hclosed i) (hgood i) + have hsign : ∀ᶠ w in 𝓝 z, f w ≠ c ∧ (f w < c ↔ f z < c) := by + by_cases hlt : f z < c + · filter_upwards [(isOpen_lt hf continuous_const).mem_nhds hlt] with w hw + exact ⟨hw.ne,iff_of_true hw hlt⟩ + · have hgt : c < f z := lt_of_le_of_ne (not_lt.mp hlt) (Ne.symm hz) + filter_upwards [(isOpen_lt continuous_const hf).mem_nhds hgt] with w hw + exact ⟨hw.ne',iff_of_false hw.not_gt hlt⟩ + have he : ∀ᶠ w in 𝓝 z, J w = J z := by + filter_upwards [hj,hsign] with w hjw hw + simp only [J,ite_eq_right hz,ite_eq_right hw.1] + rw [Finset.sum_congr rfl (fun i _ => hjw i)] + simp only [hw.2] + exact continuousAt_const.congr (he.mono fun _ h => h.symm) + obtain ⟨a,ha⟩ := habove + have hJa : J a = 0 := by + have hs : ∀ i, loopIndex (γ i) a = 0 := fun i => + hzero i a ha.le (fun hi => ha.ne ((hcover a).mpr ⟨i,hi⟩).symm) + simp only [J,ite_eq_right ha.ne',ite_eq_right ha.not_gt,hs,Finset.sum_const_zero,sub_zero] + intro z hz + have he := (TotallyDisconnectedSpace.eq_of_continuous J hcont z a).trans hJa + change (if f z = c then (0 : ℤ) else _) = 0 at he + rw [ite_eq_right hz,sub_eq_zero] at he + exact he + +lemma windingNumber_normal_field {γ : ℝ → ℂ} (hγ : ContDiff ℝ 1 γ) + (hp : Function.Periodic γ 1) (hinj : InjOn γ (Ico (0 : ℝ) 1)) + (hd : ∀ t, deriv γ t ≠ 0) + (hm : ∀ t, (γ 0).re ≤ (γ t).re) + (hr : (deriv γ 0).re = 0) (hi : (deriv γ 0).im < 0) + (X : C(ℂ,ℂ)) (hX : ∀ t, X (γ t) ≠ 0) + (horth : ∀ t, (X (γ t)*(conj (deriv γ t))).re = 0) : + windingNumber (X.comp (periodicLoop hγ.continuous 0)) = 1 := by + let T : C(unitInterval,ℂ) := ⟨fun t => deriv γ t, + (hγ.continuous_deriv (by simp)).comp continuous_subtype_val⟩ + let R : C(unitInterval,ℂ) := ⟨fun t => X (γ t)/deriv γ t, by + apply Continuous.div + · exact X.continuous.comp (hγ.continuous.comp continuous_subtype_val) + · exact T.continuous + · exact fun t => hd t⟩ + have hTloop : T 1 = T 0 := (periodic_deriv hp).eq + have hRloop : R 1 = R 0 := by + change X (γ 1)/deriv γ 1 = X (γ 0)/deriv γ 0 + rw [hp.eq,(periodic_deriv hp).eq] + have hRn (t) : R t ≠ 0 := div_ne_zero (hX t) (hd t) + have hRslit (t) : R t ∈ Complex.slitPlane := by + apply Or.inr + have hre : (R t).re = 0 := by + change (X (γ t)/deriv γ t).re = 0 + rw [Complex.div_re,← add_div] + have hh := horth t + simp only [Complex.mul_re,Complex.conj_re,Complex.conj_im,mul_neg,sub_neg_eq_add] at hh + rw [hh,zero_div] + intro him + exact hRn t (Complex.ext hre him) + have hwindR : windingNumber R = 0 := by + apply windingNumber_eq_of_logIncrement hRloop + simpa only [hRloop,sub_self,Int.cast_zero,zero_mul] using HasLogIncrement.of_slit R hRslit + have hwindT : windingNumber T = 1 := by + apply windingNumber_eq_of_logIncrement hTloop + obtain ⟨A,hA,hinc⟩ := tangent_turning_log hγ hp hinj (fun t _ => hd t) + (fun t _ => hm t) hr hi + refine ⟨A,hA,?_⟩ + rw [hinc,add_sub_cancel_left] + simp only [Int.cast_one,one_mul] + push_cast + ring + have he : X.comp (periodicLoop hγ.continuous 0) = T*R := by + ext t + change X (γ ((t:ℝ)+0)) = deriv γ t*(X (γ t)/deriv γ t) + rw [add_zero,mul_div_cancel₀ _ (hd t)] + rw [he,windingNumber_mul T R hTloop hRloop (fun t => hd t) hRn,hwindT,hwindR,add_zero] + +lemma periodic_simple_eq_of_near {γ : ℝ → ℂ} (hp : Periodic γ 1) + (hinj : InjOn γ (Ico (0 : ℝ) 1)) {a b : ℝ} + (he : γ a = γ b) (hab : |a-b| < 1) : a = b := by + have hh (t : ℝ) : γ (Int.fract t) = γ t := by + simpa only [Int.fract,mul_one] using hp.sub_int_mul_eq (x := t) ⌊t⌋ + have hfr : Int.fract a = Int.fract b := hinj + ⟨Int.fract_nonneg a,Int.fract_lt_one a⟩ ⟨Int.fract_nonneg b,Int.fract_lt_one b⟩ + ((hh a).trans (he.trans (hh b).symm)) + obtain ⟨n,hn⟩ := Int.fract_eq_fract.mp hfr + rw [hn] at hab + have hnlo : (-1 : ℤ) < n := by exact_mod_cast (abs_lt.mp hab).1 + have hnhi : n < (1 : ℤ) := by exact_mod_cast (abs_lt.mp hab).2 + have hn0 : n = 0 := by omega + rw [hn0,Int.cast_zero] at hn + exact sub_eq_zero.mp hn + +lemma periodic_simple_shift {γ : ℝ → ℂ} (hp : Periodic γ 1) + (hinj : InjOn γ (Ico (0 : ℝ) 1)) (s : ℝ) : + InjOn (fun t => γ (t+s)) (Ico (0 : ℝ) 1) := by + intro a ha b hb he + have hh : |(a+s)-(b+s)| < 1 := by + rw [abs_lt] + constructor <;> linarith [ha.1,ha.2,hb.1,hb.2] + have heq := periodic_simple_eq_of_near hp hinj he hh + linarith + +lemma periodic_simple_reverse {γ : ℝ → ℂ} (hp : Periodic γ 1) + (hinj : InjOn γ (Ico (0 : ℝ) 1)) : + InjOn (fun t => γ (-t)) (Ico (0 : ℝ) 1) := by + intro a ha b hb he + have hh : |(-a)-(-b)| < 1 := by + rw [abs_lt] + constructor <;> linarith [ha.1,ha.2,hb.1,hb.2] + have heq := periodic_simple_eq_of_near hp hinj he hh + linarith + +lemma orient_unit_curve {γ : ℝ → ℂ} (hc : ContDiff ℝ 1 γ) + (hp : Periodic γ 1) (hinj : InjOn γ (Ico (0 : ℝ) 1)) + (hd : ∀ t, deriv γ t ≠ 0) : + ∃ η : ℝ → ℂ, range η = range γ ∧ ContDiff ℝ 1 η ∧ + Periodic η 1 ∧ InjOn η (Ico (0 : ℝ) 1) ∧ (∀ t, deriv η t ≠ 0) ∧ + (∀ t, (η 0).re ≤ (η t).re) ∧ (deriv η 0).re = 0 ∧ (deriv η 0).im < 0 := by + have hk : IsCompact (range γ) := by + rw [← periodicLoop_range hc.continuous hp 0] + exact isCompact_range (periodicLoop hc.continuous 0).continuous + obtain ⟨z,⟨s,hs⟩,hmin⟩ := hk.exists_isMinOn ⟨γ 0,⟨0,rfl⟩⟩ + Complex.continuous_re.continuousOn + subst z + let η : ℝ → ℂ := fun t => γ (t+s) + have hηr : range η = range γ := by + apply Subset.antisymm + · rintro _ ⟨t,rfl⟩; exact ⟨t+s,rfl⟩ + · rintro _ ⟨t,rfl⟩; exact ⟨t-s,by simp only [η,sub_add_cancel]⟩ + have hηc : ContDiff ℝ 1 η := hc.comp (contDiff_id.add contDiff_const) + have hηp : Periodic η 1 := hp.add_const s + have hηinj : InjOn η (Ico (0 : ℝ) 1) := periodic_simple_shift hp hinj s + have hηd (t) : deriv η t ≠ 0 := by + dsimp only [η] + rw [deriv_comp_add_const] + exact hd (t+s) + have hηmin (t) : (η 0).re ≤ (η t).re := by + simpa only [η,zero_add] using + (show (γ s).re ≤ (γ (t+s)).re from hmin ⟨t+s,rfl⟩) + have hlocal : IsLocalMin (fun t => (η t).re) 0 := + Filter.Eventually.of_forall hηmin + have hηre : (deriv η 0).re = 0 := hlocal.hasDerivAt_eq_zero + (Complex.reCLM.hasFDerivAt.comp_hasDerivAt 0 + ((hηc.differentiable (by simp)) 0).hasDerivAt) + by_cases hi : (deriv η 0).im < 0 + · exact ⟨η,hηr,hηc,hηp,hηinj,hηd,hηmin,hηre,hi⟩ + · have him : 0 < (deriv η 0).im := lt_of_le_of_ne (not_lt.mp hi) (by + intro he + exact hηd 0 (Complex.ext hηre he.symm)) + let κ : ℝ → ℂ := fun t => η (-t) + have hκr : range κ = range η := by + apply Subset.antisymm + · rintro _ ⟨t,rfl⟩; exact ⟨-t,rfl⟩ + · rintro _ ⟨t,rfl⟩; exact ⟨-t,by simp [κ]⟩ + refine ⟨κ,hκr.trans hηr,hηc.comp contDiff_id.neg,?_, + periodic_simple_reverse hηp hηinj,?_,?_,?_,?_⟩ + · intro t + change η (-(t+1)) = η (-t) + rw [show -(t+1) = -t-1 by ring,hηp.sub_eq] + · intro t + dsimp only [κ] + rw [deriv_comp_neg] + exact neg_ne_zero.mpr (hηd (-t)) + · intro t + simpa only [κ,neg_zero] using hηmin (-t) + · dsimp only [κ] + rw [deriv_comp_neg,neg_zero,Complex.neg_re,hηre,neg_zero] + · dsimp only [κ] + rw [deriv_comp_neg,neg_zero,Complex.neg_im] + exact neg_neg_of_pos him + +lemma orient_periodic_curve {γ : ℝ → ℂ} {P : ℝ} (hP : 0 < P) + (hc : ContDiff ℝ 1 γ) (hp : Periodic γ P) (hinj : InjOn γ (Ico (0 : ℝ) P)) + (hd : ∀ t, deriv γ t ≠ 0) : + ∃ η : ℝ → ℂ, range η = range γ ∧ ContDiff ℝ 1 η ∧ + Periodic η 1 ∧ InjOn η (Ico (0 : ℝ) 1) ∧ (∀ t, deriv η t ≠ 0) ∧ + (∀ t, (η 0).re ≤ (η t).re) ∧ (deriv η 0).re = 0 ∧ (deriv η 0).im < 0 := by + let κ : ℝ → ℂ := fun t => γ (P*t) + have hκr : range κ = range γ := by + apply Subset.antisymm + · rintro _ ⟨t,rfl⟩; exact ⟨P*t,rfl⟩ + · rintro _ ⟨t,rfl⟩; exact ⟨t/P,by simp [κ,mul_div_cancel₀ _ hP.ne']⟩ + have hκc : ContDiff ℝ 1 κ := hc.comp (contDiff_const.mul contDiff_id) + have hκp : Periodic κ 1 := by + intro t + change γ (P*(t+1)) = γ (P*t) + rw [mul_add,mul_one,hp] + have hκinj : InjOn κ (Ico (0 : ℝ) 1) := by + intro a ha b hb he + have heq := hinj ⟨mul_nonneg hP.le ha.1,by nlinarith [ha.2]⟩ + ⟨mul_nonneg hP.le hb.1,by nlinarith [hb.2]⟩ he + exact (mul_left_cancel₀ hP.ne') heq + have hκd (t) : deriv κ t ≠ 0 := by + dsimp only [κ] + rw [deriv_comp_mul_left] + exact smul_ne_zero hP.ne' (hd (P*t)) + obtain ⟨η,hηr,hh⟩ := orient_unit_curve hκc hκp hκinj hκd + exact ⟨η,hηr.trans hκr,hh⟩ + +lemma regular_level_index_sum.{u_1} {ι : Type u_1} [Fintype ι] [DecidableEq ι] + {f : ℂ → ℝ} {c : ℝ} (hf : Continuous f) + (γ : ι → ℝ → ℂ) (hc : ∀ i, ContDiff ℝ 1 (γ i)) + (hp : ∀ i, Periodic (γ i) 1) (hi : ∀ i, InjOn (γ i) (Ico (0 : ℝ) 1)) + (hd : ∀ i t, deriv (γ i) t ≠ 0) + (hm : ∀ i t, (γ i 0).re ≤ (γ i t).re) + (hr : ∀ i, (deriv (γ i) 0).re = 0) (hdown : ∀ i, (deriv (γ i) 0).im < 0) + (hlevel : ∀ i t, f (γ i t) = c) + (hfreg : ∀ z, f z = c → ContDiffAt ℝ 1 f z ∧ fderiv ℝ f z ≠ 0) + (hcover : ∀ z, f z = c ↔ ∃ i, z ∈ range (γ i)) + (hdisjoint : ∀ i j, i ≠ j → Disjoint (range (γ i)) (range (γ j))) + (hbelow : ∀ i w, w ∉ range (γ i) → + loopIndex (periodicLoop (hc i).continuous 0) w ≠ 0 → f w < c) + (habove : ∃ z, c < f z) + {K : Set ℂ} (hK : Convex ℝ K) (hγK : ∀ i t, γ i t ∈ K) + (s : Finset ℂ) (X : C(ℂ,ℂ)) (A : ℂ → ℂ →L[ℝ] ℂ) + (hsK : ∀ z ∈ s, z ∈ K) (hzero : ∀ z ∈ K, X z = 0 ↔ z ∈ s) + (hD : ∀ z ∈ s, HasFDerivAt X (A z) z ∧ LinearMap.det (A z).toLinearMap ≠ 0) + (hX : ∀ i t, X (γ i t) ≠ 0) + (horth : ∀ i t, (X (γ i t)*conj (deriv (γ i) t)).re = 0) : + ∑ a ∈ s, (if f a < c then planeIndex (A a) else 0) = (Fintype.card ι : ℤ) := by + let Γ (i : ι) := periodicLoop (hc i).continuous 0 + have hΓclosed (i) : Γ i 1 = Γ i 0 := periodicLoop_closed _ (hp i) 0 + have hΓrange (i) : range (Γ i) = range (γ i) := periodicLoop_range _ (hp i) 0 + have hΓlocal (i) (z) (hz : z ∈ range (Γ i)) : + ∀ᶠ w in 𝓝 z, f w ≠ c → loopIndex (Γ i) w = if f w < c then 1 else 0 := by + rw [hΓrange i] at hz + obtain ⟨t,rfl⟩ := hz + exact regular_level_loop_local_index (hc i).continuous (hp i) (hi i) + (((hc i).differentiable (by simp)) 0).hasDerivAt (hdown i) (hm i) + (fun t => (hfreg _ (hlevel i t)).1) (fun t => (hfreg _ (hlevel i t)).2) + (hlevel i) (hbelow i) t + have hsum := sum_loopIndex_sublevel Γ hΓclosed hf + (by intro z; simp only [hΓrange]; exact hcover z) + (by intro i j hij; rw [hΓrange,hΓrange]; exact hdisjoint i j hij) + hΓlocal (by intro i w hw; rw [hΓrange] at hw; exact hbelow i w hw) habove + have hnotlevel (a) (ha : a ∈ s) : f a ≠ c := by + intro hal + obtain ⟨i,t,ht⟩ := (hcover a).mp hal + exact hX i t (ht ▸ (hzero a (hsK a ha)).mpr ha) + have hindex (i) : (1 : ℤ) = ∑ a ∈ s, planeIndex (A a)*loopIndex (Γ i) a := by + have h := windingNumber_finite_regular_zeros hK s X A hsK hzero hD (Γ i) (hΓclosed i) + (fun t => hγK i ((t:ℝ)+0)) (fun t => hX i ((t:ℝ)+0)) + rw [windingNumber_normal_field (hc i) (hp i) (hi i) (hd i) (hm i) (hr i) + (hdown i) X (hX i) (horth i)] at h + exact h + calc + ∑ a ∈ s, (if f a < c then planeIndex (A a) else 0) = + ∑ a ∈ s, planeIndex (A a)*(∑ i, loopIndex (Γ i) a) := by + apply Finset.sum_congr rfl + intro a ha + rw [hsum a (hnotlevel a ha)] + split_ifs <;> simp + _ = ∑ i, ∑ a ∈ s, planeIndex (A a)*loopIndex (Γ i) a := by + simp only [Finset.mul_sum] + exact Finset.sum_comm + _ = ∑ _i : ι, (1 : ℤ) := by + apply Finset.sum_congr rfl + intro i _ + exact (hindex i).symm + _ = (Fintype.card ι : ℤ) := by simp + +def tangentGradient (f : ℂ → ℝ) (z : ℂ) : ℂ := + (-(fderiv ℝ f z Complex.I) : ℂ) + Complex.I*(fderiv ℝ f z 1 : ℂ) + +lemma tangentGradient_orthogonal (f : ℂ → ℝ) (z : ℂ) : + fderiv ℝ f z (tangentGradient f z) = 0 := by + rw [realFunctional_decomposition] + simp only [tangentGradient,Complex.add_re,Complex.add_im,Complex.ofReal_re, + Complex.ofReal_im,Complex.neg_re,Complex.neg_im,Complex.mul_re,Complex.mul_im, + Complex.I_re,Complex.I_im] + ring + +lemma tangentGradient_ne_zero {f : ℂ → ℝ} {z : ℂ} (h : fderiv ℝ f z ≠ 0) : + tangentGradient f z ≠ 0 := by + intro he + have hre := congrArg Complex.re he + have him := congrArg Complex.im he + simp only [tangentGradient,Complex.add_re,Complex.add_im,Complex.ofReal_re, + Complex.ofReal_im,Complex.neg_re,Complex.neg_im,Complex.mul_re,Complex.mul_im, + Complex.I_re,Complex.I_im,Complex.zero_re,Complex.zero_im] at hre him + apply h + ext w + rw [realFunctional_decomposition] + simp only [zero_mul,one_mul,sub_zero,neg_zero,zero_add,add_zero,neg_eq_zero] at hre him + simp only [him,hre,mul_zero,add_zero,zero_apply] + +lemma tangentGradient_contDiff {f : ℂ → ℝ} (hf : ContDiff ℝ 2 f) : + ContDiff ℝ 1 (tangentGradient f) := by + have hd := hf.fderiv_right (show (1 : WithTop ℕ∞)+1 ≤ 2 by norm_num) + exact ((Complex.ofRealCLM.contDiff.comp (hd.clm_apply contDiff_const)).neg).add + (contDiff_const.mul (Complex.ofRealCLM.contDiff.comp (hd.clm_apply contDiff_const))) + +lemma tangentGradient_hasCompactSupport {f : ℂ → ℝ} {d : ℝ} + (hs : HasCompactSupport (fun z => f z-d)) : HasCompactSupport (tangentGradient f) := by + have hD := hs.fderiv ℝ + apply hD.mono' + intro z hz + by_contra hn + have hzer : fderiv ℝ (fun z => f z-d) z = 0 := notMem_support.mp + (fun h => hn (subset_tsupport _ h)) + have hfzero : fderiv ℝ f z = 0 := by simpa only [fderiv_sub_const] using hzer + exact hz (by simp only [tangentGradient,hfzero,zero_apply, + Complex.ofReal_zero,neg_zero,mul_zero,add_zero]) + +lemma compact_regular_level_oriented_curves {f : ℂ → ℝ} {c d : ℝ} + (hf : ContDiff ℝ 2 f) (hs : HasCompactSupport (fun z => f z-d)) + (hreg : ∀ z, f z = c → fderiv ℝ f z ≠ 0) + (hK : IsCompact {z | f z = c}) : + ∃ C : Finset (Set ℂ), (⋃ S ∈ C, S) = {z | f z = c} ∧ + (∀ S ∈ C, ∀ T ∈ C, S ≠ T → Disjoint S T) ∧ + ∀ S ∈ C, ∃ γ : ℝ → ℂ, range γ = S ∧ ContDiff ℝ 1 γ ∧ + Periodic γ 1 ∧ InjOn γ (Ico (0 : ℝ) 1) ∧ (∀ t, deriv γ t ≠ 0) ∧ + (∀ t, (γ 0).re ≤ (γ t).re) ∧ (deriv γ 0).re = 0 ∧ (deriv γ 0).im < 0 := by + obtain ⟨C,hC,hdis,hcurves⟩ := compact_regular_level_finite_curves + (hf.of_le (by norm_num)) (tangentGradient_contDiff hf) (tangentGradient_hasCompactSupport hs) + (tangentGradient_orthogonal f) hreg (fun z hz => tangentGradient_ne_zero (hreg z hz)) hK + refine ⟨C,hC,hdis,?_⟩ + intro S hS + obtain ⟨γ,P,hP,hrange,hD,hper,hinj⟩ := hcurves S hS + have hlevel (t) : f (γ t) = c := by + have hm : γ t ∈ ⋃ S ∈ C, S := mem_iUnion₂.mpr ⟨S,hS,hrange ▸ mem_range_self t⟩ + rwa [hC] at hm + obtain ⟨η,hηrange,hη⟩ := orient_periodic_curve hP + (integral_curve_contDiff_one (tangentGradient_contDiff hf).continuous hD) + hper hinj (fun t => by rw [(hD t).deriv]; exact tangentGradient_ne_zero (hreg _ (hlevel t))) + exact ⟨η,hηrange.trans hrange,hη⟩ + +lemma loopIndex_zero_of_im_lt (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) + {a : ℂ} (ha : ∀ t, a.im < (γ t).im) : loopIndex γ a = 0 := by + have hslit (t) : γ t-a ∈ Complex.slitPlane := by + apply Complex.mem_slitPlane_iff.mpr + right + exact ne_of_gt (sub_pos.mpr (ha t)) + apply windingNumber_eq_of_logIncrement (by simp [hloop]) + refine ⟨⟨fun t => Complex.log (γ t-a), ?_⟩, ?_, ?_⟩ + · exact Continuous.clog (by fun_prop) hslit + · intro t + exact Complex.exp_log (Complex.slitPlane_ne_zero (hslit t)) + · simp [hloop] + +lemma closure_windingInterior_subset_halfPlane (γ : C(unitInterval, ℂ)) + (hloop : γ 1 = γ 0) (hγ : ∀ t, γ t ∈ halfPlane) : + closure (windingInterior γ) ⊆ halfPlane := by + obtain ⟨d,hd,hdist⟩ := isCompact_univ.exists_forall_le' + (show ContinuousOn (fun t : unitInterval => (γ t).im) univ by fun_prop) + (a := 0) (fun t _ => hγ t) + have hsub : windingInterior γ ⊆ {a : ℂ | d ≤ a.im} := by + intro a ha + by_contra hn + exact ha.2 (loopIndex_zero_of_im_lt γ hloop + (fun t => (lt_of_not_ge hn).trans_le (hdist t (mem_univ t)))) + have hc := closure_minimal hsub (isClosed_le continuous_const Complex.continuous_im) + intro a ha + exact hd.trans_le (hc ha) + +lemma reciprocalPotential_lt_on_windingInterior {f : ℂ → ℂ} + (hf : UnivalentOn f halfPlane) {k b : ℝ} (hk : 0 < k) (hb : 0 < b) (ξ : ℂ) + (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) (hγ : ∀ t, γ t ∈ halfPlane) + (hlevel : ∀ t, reciprocalPotential f k ξ (γ t) = b) + {z : ℂ} (hz : z ∈ windingInterior γ) : reciprocalPotential f k ξ z < b := by + apply reciprocalPotential_lt_boundary hf hk hb ξ (isOpen_windingInterior γ hloop) + ((isBounded_windingInterior γ hloop).isCompact_closure) + (closure_windingInterior_subset_halfPlane γ hloop hγ) _ hz + intro w hw + obtain ⟨t,rfl⟩ := frontier_windingInterior_subset γ hloop hw + exact (hlevel t).le + +lemma extend_compact_sublevel {U : Set ℂ} (hU : IsOpen U) {f : ℂ → ℝ} + (hf : ∀ z ∈ U, ContDiffAt ℝ 2 f z) {d : ℝ} + (hK : IsCompact {z | z ∈ U ∧ f z ≤ d}) : + ∃ F : ℂ → ℝ, ContDiff ℝ 2 F ∧ HasCompactSupport (fun z => F z-d) ∧ + (∀ z, z ∈ U → f z ≤ d → F =ᶠ[𝓝 z] f) ∧ + (∀ z ∉ U, F z = d) ∧ + (∀ z c, c < d → (F z ≤ c ↔ z ∈ U ∧ f z ≤ c)) ∧ + (∀ z c, c < d → (F z < c ↔ z ∈ U ∧ f z < c)) := by + obtain ⟨χ,hχc,hχK,hχU,hχ1,hχrange⟩ := exists_smooth_cutoff hK hU + (fun _ h => h.1) + let F := fun z => χ z*(f z-d)+d + have heq (z) (hz : z ∈ U) (hzd : f z ≤ d) : F =ᶠ[𝓝 z] f := by + filter_upwards [hχ1 z ⟨hz,hzd⟩] with w hw + simp only [F,hw,one_mul,sub_add_cancel] + have hzero (z) (hz : z ∉ tsupport χ) : F =ᶠ[𝓝 z] fun _ => d := by + filter_upwards [isClosed_tsupport χ |>.isOpen_compl.mem_nhds hz] with w hw + have hh : χ w = 0 := notMem_support.mp (fun h => hw (subset_tsupport χ h)) + simp only [F,hh,zero_mul,zero_add] + have hFc : ContDiff ℝ 2 F := by + rw [contDiff_iff_contDiffAt] + intro z + by_cases hz : z ∈ tsupport χ + · exact ((hχc.contDiffAt.mul ((hf z (hχU hz)).sub contDiffAt_const)).add + contDiffAt_const) + · exact contDiffAt_const.congr_of_eventuallyEq (hzero z hz) + have hFK : HasCompactSupport (fun z => F z-d) := by + apply hχK.mono' + intro z hz + by_contra hn + have hh := (hzero z hn).self_of_nhds + exact hz (sub_eq_zero.mpr hh) + have hFd (z) (hz : z ∉ U) : F z = d := + (hzero z (fun h => hz (hχU h))).self_of_nhds + have hlarge (z) (hz : z ∈ U) (hdz : d ≤ f z) : d ≤ F z := by + dsimp only [F] + exact le_add_of_nonneg_left (mul_nonneg (hχrange z).1 (sub_nonneg.mpr hdz)) + refine ⟨F,hFc,hFK,heq,hFd,?_,?_⟩ + · intro z c hc + constructor + · intro hz + have hzU : z ∈ U := by + by_contra hn + rw [hFd z hn] at hz + exact hc.not_ge hz + have hzd : f z ≤ d := by + by_contra hn + exact hc.not_ge ((hlarge z hzU (not_le.mp hn).le).trans hz) + exact ⟨hzU,(heq z hzU hzd).self_of_nhds ▸ hz⟩ + · rintro ⟨hzU,hz⟩ + rwa [(heq z hzU (hz.trans hc.le)).self_of_nhds] + · intro z c hc + constructor + · intro hz + have hzU : z ∈ U := by + by_contra hn + rw [hFd z hn] at hz + exact hc.not_gt hz + have hzd : f z ≤ d := by + by_contra hn + exact hc.not_gt ((hlarge z hzU (not_le.mp hn).le).trans_lt hz) + exact ⟨hzU,(heq z hzU hzd).self_of_nhds ▸ hz⟩ + · rintro ⟨hzU,hz⟩ + rwa [(heq z hzU (hz.le.trans hc.le)).self_of_nhds] + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/LogIncrement.lean b/lean/OAI/Analysis/IntegralMeans/LogIncrement.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d331535f847effb26f80ecac82fa13262d089bd --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/LogIncrement.lean @@ -0,0 +1,466 @@ +import OAI.Analysis.IntegralMeans.Model + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +def HasLogIncrement (γ : C(unitInterval, ℂ)) (q : ℂ) : Prop := + ∃ T : C(unitInterval, ℂ), (∀ t, Complex.exp (T t) = γ t) ∧ T 1-T 0 = q + +lemma HasLogIncrement.perturb {γ η : C(unitInterval, ℂ)} {q : ℂ} + (hγ : HasLogIncrement γ q) (hloopγ : γ 1 = γ 0) (hloopη : η 1 = η 0) + (h : ∀ t, ‖η t-γ t‖ < ‖γ t‖) : HasLogIncrement η q := by + obtain ⟨T,hT,hend⟩ := hγ + have hn (t) : γ t ≠ 0 := (hT t ▸ Complex.exp_ne_zero (T t)) + have hratio (t) : η t / γ t ∈ Complex.slitPlane := by + have he : η t / γ t = 1 + (η t-γ t)/γ t := by field_simp [hn t]; ring + rw [he] + apply Complex.mem_slitPlane_of_norm_lt_one + rw [norm_div, div_lt_one (norm_pos_iff.mpr (hn t))] + exact h t + let R : C(unitInterval, ℂ) := ⟨fun t => Complex.log (η t / γ t), by + apply Continuous.clog + · exact η.continuous.div γ.continuous hn + · exact hratio⟩ + refine ⟨T+R, ?_, ?_⟩ + · intro t + change Complex.exp (T t+Complex.log (η t/γ t)) = η t + rw [Complex.exp_add, hT t, Complex.exp_log (Complex.slitPlane_ne_zero (hratio t))] + field_simp [hn t] + · change (T 1+Complex.log (η 1/γ 1))-(T 0+Complex.log (η 0/γ 0))=q + rw [hloopγ,hloopη] + linear_combination hend + +def circleLoop : C(unitInterval, ℂ) := + ⟨fun t => Complex.exp ((2*Real.pi*(t : ℝ) : ℝ)*Complex.I), by fun_prop⟩ + +@[simp] lemma circleLoop_zero : circleLoop 0 = 1 := by simp [circleLoop] + +@[simp] lemma circleLoop_one : circleLoop 1 = 1 := by + simp [circleLoop, Complex.exp_two_pi_mul_I] + +@[simp] lemma norm_circleLoop (t : unitInterval) : ‖circleLoop t‖ = 1 := by + simp [circleLoop, Complex.norm_exp] + +lemma circleLoop_logIncrement (a : ℂ) (ha : a ≠ 0) : + HasLogIncrement (a • circleLoop) (2*Real.pi*Complex.I) := by + refine ⟨⟨fun t => Complex.log a+(2*Real.pi*(t : ℝ) : ℝ)*Complex.I, by fun_prop⟩, ?_, ?_⟩ + · intro t + simp [Complex.exp_add, Complex.exp_log ha, circleLoop] + · simp + +lemma conj_circleLoop_logIncrement (a : ℂ) (ha : a ≠ 0) : + HasLogIncrement + ⟨fun t => a*conj (circleLoop t), by fun_prop⟩ (-(2*Real.pi*Complex.I)) := by + refine ⟨⟨fun t => Complex.log a-(2*Real.pi*(t : ℝ) : ℝ)*Complex.I, by fun_prop⟩, ?_, ?_⟩ + · intro t + simp only [ContinuousMap.coe_mk, circleLoop, Complex.exp_sub, Complex.exp_log ha] + rw [← Complex.exp_conj] + simp only [map_mul, Complex.conj_ofReal, Complex.conj_I, mul_neg, + Complex.exp_neg] + rfl + · simp + +def linearPart (A : ℂ →L[ℝ] ℂ) : ℂ := (A 1-Complex.I*A Complex.I)/2 + +def antiLinearPart (A : ℂ →L[ℝ] ℂ) : ℂ := (A 1+Complex.I*A Complex.I)/2 + +lemma realLinear_decomposition (A : ℂ →L[ℝ] ℂ) (z : ℂ) : + A z = linearPart A*z+antiLinearPart A*conj z := by + have he : z = z.re • (1 : ℂ)+z.im • Complex.I := by simp [Complex.real_smul] + calc + A z = z.re • A 1+z.im • A Complex.I := by + conv_lhs => rw [he, map_add, map_smul, map_smul] + _ = linearPart A*z+antiLinearPart A*conj z := by + apply Complex.ext <;> + simp [linearPart, antiLinearPart, Complex.mul_re, Complex.mul_im, + Complex.real_smul] <;> ring + +lemma determinant_complex_real (A : ℂ →ₗ[ℝ] ℂ) : + LinearMap.det A = (A 1).re*(A Complex.I).im-(A Complex.I).re*(A 1).im := by + rw [← LinearMap.det_toMatrix Complex.basisOneI, Matrix.det_fin_two] + simp [LinearMap.toMatrix_apply, Complex.coe_basisOneI, Complex.coe_basisOneI_repr] + +lemma det_eq_linearParts (A : ℂ →L[ℝ] ℂ) : + LinearMap.det A.toLinearMap = ‖linearPart A‖^2-‖antiLinearPart A‖^2 := by + rw [determinant_complex_real] + simp only [← Complex.normSq_eq_norm_sq, linearPart, antiLinearPart, + Complex.normSq_apply, Complex.div_re, Complex.div_im, Complex.sub_re, + Complex.sub_im, Complex.add_re, Complex.add_im, Complex.mul_re, + Complex.mul_im, Complex.I_re, Complex.I_im] + norm_num + ring + +lemma linear_circle_logIncrement_pos (A : ℂ →L[ℝ] ℂ) + (hA : 0 < LinearMap.det A.toLinearMap) : + HasLogIncrement ⟨fun t => A (circleLoop t), by fun_prop⟩ (2*Real.pi*Complex.I) := by + have hn : ‖antiLinearPart A‖ < ‖linearPart A‖ := by + rw [det_eq_linearParts] at hA + nlinarith [norm_nonneg (linearPart A), norm_nonneg (antiLinearPart A)] + have ha : linearPart A ≠ 0 := norm_pos_iff.mp ((norm_nonneg _).trans_lt hn) + apply (circleLoop_logIncrement (linearPart A) ha).perturb + · simp + · simp + · intro t + simp only [ContinuousMap.coe_mk, ContinuousMap.coe_smul, Pi.smul_apply, + smul_eq_mul, realLinear_decomposition, add_sub_cancel_left, norm_mul, + RCLike.norm_conj, norm_circleLoop, mul_one] + exact hn + +lemma linear_circle_logIncrement_neg (A : ℂ →L[ℝ] ℂ) + (hA : LinearMap.det A.toLinearMap < 0) : + HasLogIncrement ⟨fun t => A (circleLoop t), by fun_prop⟩ (-(2*Real.pi*Complex.I)) := by + have hn : ‖linearPart A‖ < ‖antiLinearPart A‖ := by + rw [det_eq_linearParts] at hA + nlinarith [norm_nonneg (linearPart A), norm_nonneg (antiLinearPart A)] + have ha : antiLinearPart A ≠ 0 := norm_pos_iff.mp ((norm_nonneg _).trans_lt hn) + apply (conj_circleLoop_logIncrement (antiLinearPart A) ha).perturb + · simp + · simp + · intro t + simp only [ContinuousMap.coe_mk, realLinear_decomposition, add_sub_cancel_right, + norm_mul, RCLike.norm_conj, norm_circleLoop, mul_one] + exact hn + +lemma HasLogIncrement.smul {γ : C(unitInterval, ℂ)} {q : ℂ} + (hγ : HasLogIncrement γ q) {c : ℂ} (hc : c ≠ 0) : + HasLogIncrement (c • γ) q := by + obtain ⟨T,hT,hend⟩ := hγ + refine ⟨T+ContinuousMap.const _ (Complex.log c), ?_, ?_⟩ + · intro t + change Complex.exp (T t+Complex.log c) = c*γ t + rw [Complex.exp_add, hT t, Complex.exp_log hc, mul_comm] + · change (T 1+Complex.log c)-(T 0+Complex.log c)=q + linear_combination hend + +lemma norm_linear_lower_pos (A : ℂ →L[ℝ] ℂ) (z : ℂ) : + (‖linearPart A‖-‖antiLinearPart A‖)*‖z‖ ≤ ‖A z‖ := by + have ht := norm_sub_norm_le (linearPart A*z) (-antiLinearPart A*conj z) + rw [norm_mul, norm_mul, norm_neg, RCLike.norm_conj] at ht + simp only [neg_mul, sub_neg_eq_add, ← realLinear_decomposition] at ht + nlinarith + +lemma norm_linear_lower_neg (A : ℂ →L[ℝ] ℂ) (z : ℂ) : + (‖antiLinearPart A‖-‖linearPart A‖)*‖z‖ ≤ ‖A z‖ := by + have ht := norm_sub_norm_le (antiLinearPart A*conj z) (-linearPart A*z) + rw [norm_mul, norm_mul, norm_neg, RCLike.norm_conj] at ht + simp only [neg_mul, sub_neg_eq_add, add_comm, ← realLinear_decomposition] at ht + nlinarith + +lemma local_logIncrement_of_derivative {X : ℂ → ℂ} {z : ℂ} {A : ℂ →L[ℝ] ℂ} + (hX : Continuous X) (hzero : X z = 0) (hd : HasFDerivAt X A z) + {c : ℝ} (hc : 0 < c) (hlower : ∀ w, c*‖w‖ ≤ ‖A w‖) {q : ℂ} + (hA : HasLogIncrement ⟨fun t => A (circleLoop t), by fun_prop⟩ q) : + ∃ δ : ℝ, 0 < δ ∧ ∀ r : ℝ, 0 < r → r < δ → + HasLogIncrement ⟨fun t => X (z+(r : ℂ)*circleLoop t), by fun_prop⟩ q := by + have hrem := (hasFDerivAt_iff_isLittleO_nhds_zero.mp hd).bound (by positivity : 0 < c/2) + obtain ⟨δ,hδ,hbound⟩ := Metric.eventually_nhds_iff.mp hrem + refine ⟨δ,hδ,fun r hr hrd => ?_⟩ + have hn (t : unitInterval) : ‖(r : ℂ)*circleLoop t‖ = r := by + simp [Complex.norm_real, Real.norm_eq_abs, abs_of_pos hr] + apply (hA.smul (Complex.ofReal_ne_zero.mpr hr.ne')).perturb + · simp + · simp + · intro t + have hb := hbound (show dist ((r : ℂ)*circleLoop t) 0 < δ by simpa only [dist_zero_right, hn] using hrd) + have he : A ((r : ℂ)*circleLoop t) = (r : ℂ)*A (circleLoop t) := by + exact A.map_smul r (circleLoop t) + change ‖X (z+(r : ℂ)*circleLoop t)-(r : ℂ)*A (circleLoop t)‖ < ‖(r : ℂ)*A (circleLoop t)‖ + rw [hzero, sub_zero, he, hn] at hb + have hl := hlower ((r : ℂ)*circleLoop t) + rw [hn, he] at hl + exact hb.trans_lt ((by nlinarith : c/2*r < c*r).trans_le hl) + +lemma local_logIncrement_pos {X : ℂ → ℂ} {z : ℂ} {A : ℂ →L[ℝ] ℂ} + (hX : Continuous X) (hzero : X z = 0) (hd : HasFDerivAt X A z) + (hdet : 0 < LinearMap.det A.toLinearMap) : + ∃ δ : ℝ, 0 < δ ∧ ∀ r : ℝ, 0 < r → r < δ → + HasLogIncrement ⟨fun t => X (z+(r : ℂ)*circleLoop t), by fun_prop⟩ (2*Real.pi*Complex.I) := by + have hc : 0 < ‖linearPart A‖-‖antiLinearPart A‖ := by + rw [det_eq_linearParts] at hdet + nlinarith [norm_nonneg (linearPart A), norm_nonneg (antiLinearPart A)] + exact local_logIncrement_of_derivative hX hzero hd hc (norm_linear_lower_pos A) + (linear_circle_logIncrement_pos A hdet) + +lemma local_logIncrement_neg {X : ℂ → ℂ} {z : ℂ} {A : ℂ →L[ℝ] ℂ} + (hX : Continuous X) (hzero : X z = 0) (hd : HasFDerivAt X A z) + (hdet : LinearMap.det A.toLinearMap < 0) : + ∃ δ : ℝ, 0 < δ ∧ ∀ r : ℝ, 0 < r → r < δ → + HasLogIncrement ⟨fun t => X (z+(r : ℂ)*circleLoop t), by fun_prop⟩ (-(2*Real.pi*Complex.I)) := by + have hc : 0 < ‖antiLinearPart A‖-‖linearPart A‖ := by + rw [det_eq_linearParts] at hdet + nlinarith [norm_nonneg (linearPart A), norm_nonneg (antiLinearPart A)] + exact local_logIncrement_of_derivative hX hzero hd hc (norm_linear_lower_neg A) + (linear_circle_logIncrement_neg A hdet) + +lemma exists_log_lift (γ : C(unitInterval, ℂ)) (hγ : ∀ t, γ t ≠ 0) : + ∃ T : C(unitInterval, ℂ), ∀ t, Complex.exp (T t) = γ t := by + let := (convex_Icc (𝕜 := ℝ) (0 : ℝ) 1).contractibleSpace (show (Icc (0 : ℝ) 1).Nonempty from ⟨0, by simp⟩) + let := (convex_Icc (𝕜 := ℝ) (0 : ℝ) 1).locallyPathConnectedSpace + obtain ⟨T, ⟨-,hT⟩, -⟩ := Complex.isCoveringMapOn_exp.existsUnique_continuousMap_lifts + γ (Complex.exp_log (hγ 0)) hγ + exact ⟨T, fun t => congrFun hT t⟩ + +lemma log_lifts_difference_constant.{u_1} {X : Type u_1} [TopologicalSpace X] [PreconnectedSpace X] + {A B : X → ℂ} (hA : Continuous A) (hB : Continuous B) + (h : ∀ x, Complex.exp (A x) = Complex.exp (B x)) (x y : X) : + A y - B y = A x - B x := by + have hC : Continuous (fun z => B z + (A x - B x)) := hB.add continuous_const + have he (z) : Complex.exp (A z) = Complex.exp (B z + (A x - B x)) := by + rw [Complex.exp_add, Complex.exp_sub, h x, div_self (Complex.exp_ne_zero _), mul_one] + exact h z + have heq : A = fun z => B z + (A x - B x) := + Complex.isCoveringMap_exp.eq_of_comp_eq hA hC + (by funext z; exact Subtype.ext (he z)) x (by ring) + have hy := congrFun heq y + linear_combination hy + +lemma HasLogIncrement.unique {γ : C(unitInterval, ℂ)} {p q : ℂ} + (hp : HasLogIncrement γ p) (hq : HasLogIncrement γ q) : p = q := by + obtain ⟨A,hA,hp⟩ := hp + obtain ⟨B,hB,hq⟩ := hq + have he := log_lifts_difference_constant A.continuous B.continuous + (fun t => (hA t).trans (hB t).symm) (0 : unitInterval) 1 + linear_combination hp.symm - hq.symm + he + +lemma HasLogIncrement.mul {γ η : C(unitInterval, ℂ)} {p q : ℂ} + (hγ : HasLogIncrement γ p) (hη : HasLogIncrement η q) : + HasLogIncrement (γ * η) (p + q) := by + obtain ⟨A,hA,hp⟩ := hγ + obtain ⟨B,hB,hq⟩ := hη + refine ⟨A+B, ?_, ?_⟩ + · intro t + change Complex.exp (A t+B t) = γ t * η t + rw [Complex.exp_add, hA t, hB t] + · change (A 1+B 1)-(A 0+B 0)=p+q + linear_combination hp+hq + +lemma HasLogIncrement.inv {γ : C(unitInterval, ℂ)} {q : ℂ} + (hγ : HasLogIncrement γ q) : + HasLogIncrement ⟨fun t => (γ t)⁻¹, by + exact γ.continuous.inv₀ (fun t => by + obtain ⟨A,hA,-⟩ := hγ + exact (hA t ▸ Complex.exp_ne_zero (A t)))⟩ (-q) := by + obtain ⟨A,hA,hq⟩ := hγ + refine ⟨-A, ?_, ?_⟩ + · intro t + change Complex.exp (-A t) = (γ t)⁻¹ + rw [Complex.exp_neg, hA t] + · change -A 1-(-A 0) = -q + linear_combination -hq + +lemma HasLogIncrement.conj {γ : C(unitInterval, ℂ)} {q : ℂ} + (hγ : HasLogIncrement γ q) : + HasLogIncrement ⟨fun t => conj (γ t), by fun_prop⟩ (conj q) := by + obtain ⟨A,hA,hq⟩ := hγ + refine ⟨⟨fun t => conj (A t), by fun_prop⟩, ?_, ?_⟩ + · intro t + exact (Complex.exp_conj _).trans (congrArg conj (hA t)) + · change conj (A 1)-conj (A 0)=conj q + rw [← map_sub, hq] + +lemma HasLogIncrement.of_global_log.{u_1} {X : Type u_1} [TopologicalSpace X] + (f : C(X, ℂ)) (A : C(X, ℂ)) (hA : ∀ x, Complex.exp (A x) = f x) + (γ : C(unitInterval, X)) (hγ : γ 1 = γ 0) : + HasLogIncrement (f.comp γ) 0 := by + refine ⟨A.comp γ, fun t => hA (γ t), ?_⟩ + change A (γ 1)-A (γ 0)=0 + rw [hγ, sub_self] + +lemma HasLogIncrement.integer {γ : C(unitInterval, ℂ)} {q : ℂ} + (hγ : HasLogIncrement γ q) (hloop : γ 1 = γ 0) : + ∃ n : ℤ, q = n*(2*Real.pi*Complex.I) := by + obtain ⟨A,hA,hq⟩ := hγ + apply Complex.exp_eq_one_iff.mp + rw [← hq, Complex.exp_sub, hA 1, hA 0, hloop, + div_self (hA 0 ▸ Complex.exp_ne_zero _)] + +lemma period_ne_zero : (2*Real.pi*Complex.I : ℂ) ≠ 0 := by + exact mul_ne_zero (mul_ne_zero (by norm_num) (Complex.ofReal_ne_zero.mpr Real.pi_ne_zero)) + Complex.I_ne_zero + +lemma integer_period_injective : Function.Injective + (fun n : ℤ => (n : ℂ)*(2*Real.pi*Complex.I)) := by + intro n m h + exact_mod_cast (mul_right_cancel₀ period_ne_zero h : (n : ℂ) = m) + +lemma exists_integer_logIncrement (γ : C(unitInterval, ℂ)) + (hloop : γ 1 = γ 0) (hγ : ∀ t, γ t ≠ 0) : + ∃ n : ℤ, HasLogIncrement γ (n*(2*Real.pi*Complex.I)) := by + obtain ⟨A, hA⟩ := exists_log_lift γ hγ + have hi : HasLogIncrement γ (A 1-A 0) := ⟨A,hA,rfl⟩ + obtain ⟨n,hn⟩ := hi.integer hloop + exact ⟨n, hn ▸ hi⟩ + +def windingNumber (γ : C(unitInterval, ℂ)) : ℤ := by + classical + exact if h : γ 1 = γ 0 ∧ ∀ t, γ t ≠ 0 then + Classical.choose (exists_integer_logIncrement γ h.1 h.2) + else 0 + +lemma windingNumber_spec (γ : C(unitInterval, ℂ)) + (hloop : γ 1 = γ 0) (hγ : ∀ t, γ t ≠ 0) : + HasLogIncrement γ ((windingNumber γ)*(2*Real.pi*Complex.I)) := by + rw [windingNumber, dite_eq_left ⟨hloop,hγ⟩] + exact Classical.choose_spec (exists_integer_logIncrement γ hloop hγ) + +lemma windingNumber_eq_of_logIncrement {γ : C(unitInterval, ℂ)} {n : ℤ} + (hloop : γ 1 = γ 0) (h : HasLogIncrement γ (n*(2*Real.pi*Complex.I))) : + windingNumber γ = n := by + have hn (t) : γ t ≠ 0 := by + obtain ⟨A,hA,-⟩ := h + exact hA t ▸ Complex.exp_ne_zero _ + exact integer_period_injective ((windingNumber_spec γ hloop hn).unique h) + +lemma windingNumber_mul (γ η : C(unitInterval, ℂ)) + (hloopγ : γ 1 = γ 0) (hloopη : η 1 = η 0) + (hγ : ∀ t, γ t ≠ 0) (hη : ∀ t, η t ≠ 0) : + windingNumber (γ*η) = windingNumber γ + windingNumber η := by + apply windingNumber_eq_of_logIncrement (by simp [hloopγ,hloopη]) + convert (windingNumber_spec γ hloopγ hγ).mul (windingNumber_spec η hloopη hη) using 1 + push_cast + ring + +lemma windingNumber_perturb {γ η : C(unitInterval, ℂ)} + (hloopγ : γ 1 = γ 0) (hloopη : η 1 = η 0) (hγ : ∀ t, γ t ≠ 0) + (h : ∀ t, ‖η t-γ t‖ < ‖γ t‖) : windingNumber η = windingNumber γ := + windingNumber_eq_of_logIncrement hloopη + ((windingNumber_spec γ hloopγ hγ).perturb hloopγ hloopη h) + +lemma exists_log_lift_of_simplyConnected.{u_1} {X : Type u_1} [TopologicalSpace X] + [SimplyConnectedSpace X] [LocallyPathConnectedSpace X] (x : X) + (f : C(X, ℂ)) (hf : ∀ y, f y ≠ 0) : + ∃ A : C(X, ℂ), ∀ y, Complex.exp (A y) = f y := by + obtain ⟨A, ⟨-,hA⟩, -⟩ := Complex.isCoveringMapOn_exp.existsUnique_continuousMap_lifts + f (Complex.exp_log (hf x)) hf + exact ⟨A, fun y => congrFun hA y⟩ + +lemma HasLogIncrement.homotopy {H : C(unitInterval × unitInterval, ℂ)} + (hH : ∀ p, H p ≠ 0) (hloop : ∀ s, H (s,1) = H (s,0)) {q : ℂ} + (h : HasLogIncrement ⟨fun t => H (0,t), by fun_prop⟩ q) : + HasLogIncrement ⟨fun t => H (1,t), by fun_prop⟩ q := by + let := (convex_Icc (𝕜 := ℝ) (0 : ℝ) 1).contractibleSpace + (show (Icc (0 : ℝ) 1).Nonempty from ⟨0, by simp⟩) + let := (convex_Icc (𝕜 := ℝ) (0 : ℝ) 1).locallyPathConnectedSpace + obtain ⟨A,hA⟩ := exists_log_lift_of_simplyConnected (0,0) H hH + have hi : HasLogIncrement ⟨fun t => H (0,t), by fun_prop⟩ (A (0,1)-A (0,0)) := + ⟨⟨fun t => A (0,t), by fun_prop⟩, fun t => hA (0,t), rfl⟩ + have hc := log_lifts_difference_constant + (show Continuous (fun s => A (s,1)) by fun_prop) + (show Continuous (fun s => A (s,0)) by fun_prop) + (fun s => by rw [hA, hA, hloop]) (0 : unitInterval) 1 + refine ⟨⟨fun t => A (1,t), by fun_prop⟩, fun t => hA (1,t), ?_⟩ + change A (1,1)-A (1,0)=q + exact hc.trans (hi.unique h) + +lemma windingNumber_homotopy (H : C(unitInterval × unitInterval, ℂ)) + (hH : ∀ p, H p ≠ 0) (hloop : ∀ s, H (s,1) = H (s,0)) : + windingNumber ⟨fun t => H (1,t), by fun_prop⟩ = + windingNumber ⟨fun t => H (0,t), by fun_prop⟩ := by + apply windingNumber_eq_of_logIncrement (hloop 1) + exact (windingNumber_spec ⟨fun t => H (0,t), by fun_prop⟩ (hloop 0) + (fun t => hH (0,t))).homotopy hH hloop + +def loopIndex (γ : C(unitInterval, ℂ)) (a : ℂ) : ℤ := + windingNumber ⟨fun t => γ t-a, by fun_prop⟩ + +lemma loopIndex_eventually_eq (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) + {a : ℂ} (ha : a ∉ range γ) : ∀ᶠ b in 𝓝 a, loopIndex γ b = loopIndex γ a := by + have hn (t) : γ t-a ≠ 0 := sub_ne_zero.mpr (fun h => ha ⟨t,h⟩) + obtain ⟨d,hd,hdist⟩ := isCompact_univ.exists_forall_le' + (show ContinuousOn (fun t : unitInterval => ‖γ t-a‖) univ by fun_prop) + (a := 0) (fun t _ => norm_pos_iff.mpr (hn t)) + filter_upwards [Metric.ball_mem_nhds a hd] with b hb + apply windingNumber_perturb (by simp [hloop]) (by simp [hloop]) hn + intro t + change ‖(γ t-b)-(γ t-a)‖ < ‖γ t-a‖ + rw [show (γ t-b)-(γ t-a)=a-b by ring, norm_sub_rev] + exact (show ‖b-a‖ < d by simpa [Metric.mem_ball, dist_eq_norm] using hb).trans_le (hdist t (mem_univ t)) + +lemma continuousOn_loopIndex (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) : + ContinuousOn (loopIndex γ) (range γ)ᶜ := by + intro a ha + apply ContinuousAt.continuousWithinAt + have he : loopIndex γ =ᶠ[𝓝 a] fun _ => loopIndex γ a := + loopIndex_eventually_eq γ hloop ha + exact continuousAt_const.congr he.symm + +lemma hasLogIncrement_constant (a : ℂ) (ha : a ≠ 0) : + HasLogIncrement (ContinuousMap.const unitInterval a) 0 := by + exact ⟨ContinuousMap.const unitInterval (Complex.log a), + fun _ => Complex.exp_log ha, sub_self _⟩ + +lemma loopIndex_eq_zero_of_norm_lt (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) + {a : ℂ} (ha : ∀ t, ‖γ t‖ < ‖a‖) : loopIndex γ a = 0 := by + have hane : a ≠ 0 := norm_pos_iff.mp ((norm_nonneg (γ 0)).trans_lt (ha 0)) + apply windingNumber_eq_of_logIncrement (by simp [hloop]) + have hh : HasLogIncrement ⟨fun t => γ t-a, by fun_prop⟩ 0 := + (hasLogIncrement_constant (-a) (neg_ne_zero.mpr hane)).perturb rfl + (by simp [hloop]) (fun t => by simpa using ha t) + simpa using hh + +lemma loopIndex_zero_outside_ball (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) : + ∃ R : ℝ, 0 < R ∧ ∀ a : ℂ, R ≤ ‖a‖ → loopIndex γ a = 0 := by + obtain ⟨R,-,hR⟩ := (isCompact_range γ.continuous).isBounded.exists_pos_norm_lt + refine ⟨max R 1, lt_of_lt_of_le zero_lt_one (le_max_right _ _), ?_⟩ + intro a ha + apply loopIndex_eq_zero_of_norm_lt γ hloop + intro t + exact (hR (γ t) ⟨t,rfl⟩).trans_le ((le_max_left R 1).trans ha) + +def windingInterior (γ : C(unitInterval, ℂ)) : Set ℂ := + {a | a ∉ range γ ∧ loopIndex γ a ≠ 0} + +lemma isOpen_windingInterior (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) : + IsOpen (windingInterior γ) := by + apply isOpen_iff_mem_nhds.mpr + intro a ha + have hc := (isCompact_range γ.continuous).isClosed.isOpen_compl.mem_nhds ha.1 + filter_upwards [hc, loopIndex_eventually_eq γ hloop ha.1] with b hb heq + exact ⟨hb, heq ▸ ha.2⟩ + +lemma isBounded_windingInterior (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) : + Bornology.IsBounded (windingInterior γ) := by + obtain ⟨R,-,hR⟩ := loopIndex_zero_outside_ball γ hloop + apply (Metric.isBounded_ball (x := (0 : ℂ)) (r := R)).subset + intro a ha + rw [Metric.mem_ball, dist_zero_right] + by_contra h + exact ha.2 (hR a (le_of_not_gt h)) + +lemma frontier_windingInterior_subset (γ : C(unitInterval, ℂ)) (hloop : γ 1 = γ 0) : + frontier (windingInterior γ) ⊆ range γ := by + intro a ha + by_contra han + have hn : (range γ)ᶜ ∈ 𝓝 a := + (isCompact_range γ.continuous).isClosed.isOpen_compl.mem_nhds han + have he := loopIndex_eventually_eq γ hloop han + by_cases hi : loopIndex γ a = 0 + · have hh : (windingInterior γ)ᶜ ∈ 𝓝 a := by + filter_upwards [he] with b hb + intro hbin + exact hbin.2 (hb.trans hi) + exact (mem_closure_iff_nhds.1 ha.1 _ hh).elim (fun b hb => hb.1 hb.2) + · have hnmem := ha.2 + rw [(isOpen_windingInterior γ hloop).interior_eq] at hnmem + exact hnmem ⟨han,hi⟩ + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/Main.lean b/lean/OAI/Analysis/IntegralMeans/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..febf62e3690ebadf6831a66431d662f216872e4f --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/Main.lean @@ -0,0 +1,24 @@ +import OAI.Analysis.IntegralMeans.DomainArea + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +theorem main_theorem : MainStatement := by + refine ⟨?_,inverse_spectrum_eq_one,?_,?_⟩ + · intro ε hε + obtain ⟨C,_hC,hbound⟩ := uniform_inverse_square_bound ε hε + exact ⟨C,hbound⟩ + · intro W hW _hconnected _hsimply _hboundary φ hφ hb s hs hs4 + exact conformal_domain_area hW hφ hb hs hs4 + · intro f hf t ht ht2 + exact univalent_disk_area hf ht ht2 + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/Model.lean b/lean/OAI/Analysis/IntegralMeans/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e98e79e35522957853c2478c7f9002b71e4e3e1 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/Model.lean @@ -0,0 +1,50 @@ +import Mathlib + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter +open scoped Topology +namespace Brennan + +def disk : Set ℂ := Metric.ball 0 1 + +def UnivalentOn (f : ℂ → ℂ) (U : Set ℂ) : Prop := + DifferentiableOn ℂ f U ∧ Set.InjOn f U + +def Schlicht (f : ℂ → ℂ) : Prop := + UnivalentOn f disk ∧ f 0 = 0 ∧ deriv f 0 = 1 + +def integralMean (f : ℂ → ℂ) (t r : ℝ) : ℝ := + (2 * Real.pi)⁻¹ * ∫ θ in -Real.pi..Real.pi, + ‖deriv f ((r : ℂ) * Complex.exp ((θ : ℂ) * Complex.I))‖ ^ t + +def beta (f : ℂ → ℂ) (t : ℝ) : EReal := + Filter.limsup (fun r : ℝ => + ((Real.log (integralMean f t r) / Real.log (1 / (1 - r)) : ℝ) : EReal)) + (𝓝[<] (1 : ℝ)) + +def spectrum (t : ℝ) : EReal := + sSup {b | ∃ f : ℂ → ℂ, Schlicht f ∧ beta f t = b} + +def SphericalBoundaryNontrivial (W : Set ℂ) : Prop := + Set.Nontrivial (frontier (((↑) : ℂ → OnePoint ℂ) '' W)) + +def MainStatement : Prop := + (∀ ε : ℝ, 0 < ε → ∃ C : ℝ, ∀ f : ℂ → ℂ, Schlicht f → + ∀ r : ℝ, 1 / 2 ≤ r → r < 1 → + integralMean f (-2) r ≤ C * (1 - r) ^ (-1 - ε)) ∧ + spectrum (-2) = 1 ∧ + (∀ W : Set ℂ, IsOpen W → IsConnected W → SimplyConnectedSpace W → + SphericalBoundaryNontrivial W → ∀ φ : ℂ → ℂ, + DifferentiableOn ℂ φ W → Set.BijOn φ W disk → + ∀ s : ℝ, 4 / 3 < s → s < 4 → + IntegrableOn (fun z => ‖deriv φ z‖ ^ s) W volume) ∧ + (∀ f : ℂ → ℂ, UnivalentOn f disk → ∀ t : ℝ, + -2 < t → t < 2 / 3 → + IntegrableOn (fun z => ‖deriv f z‖ ^ t) disk volume) + +end Brennan +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/Moments.lean b/lean/OAI/Analysis/IntegralMeans/Moments.lean new file mode 100644 index 0000000000000000000000000000000000000000..462466e88dff3e772c9362acb10e5b069418ef7c --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/Moments.lean @@ -0,0 +1,433 @@ +import OAI.Analysis.IntegralMeans.ExpectedTransport + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight +attribute [local irreducible] classFun +attribute [local irreducible] rerootClass +attribute [local irreducible] inverseDensity inverseJacDensity + +lemma differentiableOn_classReciprocal (g : DiskClass) : + DifferentiableOn ℂ (reciprocalDeriv (classFun g)) halfPlane := + fun _ hz => (hasDerivAt_reciprocalDeriv (classFun_schlicht g).1 hz).differentiableAt.differentiableWithinAt + +lemma continuous_classReciprocal_eval : + Continuous (fun p : DiskClass × halfPlane => reciprocalDeriv (classFun p.1) p.2) := by + have hd : Continuous (fun p : DiskClass × halfPlane => deriv (classFun p.1) p.2) := by + simpa only [iteratedDeriv_one] using continuous_classJet_eval 1 + exact hd.inv₀ (fun p => univalent_deriv_ne_zero isOpen_halfPlane (classFun_schlicht p.1).1 p.2.2) + +def reciprocalJet (n : ℕ) (g : DiskClass) : C(halfPlane,ℂ) := + ⟨fun z => iteratedDeriv n (reciprocalDeriv (classFun g)) z, continuousOn_iff_continuous_domRestrict.mp + (differentiableOn_iteratedDeriv_open isOpen_halfPlane (differentiableOn_classReciprocal g) n).continuousOn⟩ + +lemma continuous_reciprocalJet (n : ℕ) : Continuous (reciprocalJet n) := by + have hc : Continuous (reciprocalJet 0) := + ContinuousMap.continuous_of_continuous_uncurry _ continuous_classReciprocal_eval + rw [continuous_iff_continuousAt] + intro g + apply ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mpr + have hv := ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mp (hc.tendsto g) + have h : TendstoLocallyUniformlyOn (fun a => reciprocalDeriv (classFun a)) + (reciprocalDeriv (classFun g)) (𝓝 g) halfPlane := + tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe.mpr hv + exact tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe.mp + (tendstoLocallyUniformlyOn_iteratedDeriv_open isOpen_halfPlane h + (Eventually.of_forall differentiableOn_classReciprocal) n) + +lemma continuous_reciprocalJet_eval (n : ℕ) : + Continuous (fun p : DiskClass × halfPlane => iteratedDeriv n (reciprocalDeriv (classFun p.1)) p.2) := + continuous_eval.comp ((continuous_reciprocalJet n).prodMap continuous_id) + +lemma classReciprocal_at_I (g : DiskClass) : reciprocalDeriv (classFun g) Complex.I = 1 := by + rw [reciprocalDeriv,(classFun_schlicht g).2.2,inv_one] + +lemma hasDerivAt_integral_compact.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] (μ : Measure X) [IsFiniteMeasure μ] + (F F' : ℝ → X → ℝ) {U : Set ℝ} (hU : IsOpen U) + (hF : ∀ x ∈ U, Continuous (F x)) + (hc : ContinuousOn (fun p : ℝ × X => F' p.1 p.2) (U ×ˢ univ)) + (hd : ∀ x ∈ U, ∀ a, HasDerivAt (fun t => F t a) (F' x a) x) + {x : ℝ} (hx : x ∈ U) : + HasDerivAt (fun t => ∫ a, F t a ∂μ) (∫ a, F' x a ∂μ) x := by + obtain ⟨r,hr,hsub⟩ := Metric.mem_nhds_iff.mp (hU.mem_nhds hx) + have hr2 : 0 < r/2 := half_pos hr + have hsub' : Metric.closedBall x (r/2) ⊆ U := + (Metric.closedBall_subset_ball (by linarith)).trans hsub + have hk : IsCompact (Metric.closedBall x (r/2) ×ˢ (univ : Set X)) := + (isCompact_closedBall _ _).prod isCompact_univ + obtain ⟨C,hC⟩ := hk.exists_bound_of_continuousOn (hc.mono (Set.prod_mono hsub' Subset.rfl)) + have hc0 : Continuous (F' x) := by + have hs : Continuous (fun a : X => (x,a)) := continuous_const.prodMk continuous_id + exact continuousOn_univ.mp + (hc.comp hs.continuousOn (fun a _ => ⟨hx,mem_univ a⟩)) + refine (hasDerivAt_integral_of_dominated_loc_of_deriv_le + (s := Metric.ball x (r/2)) (bound := fun _ : X => C) (Metric.ball_mem_nhds _ hr2) + ?_ ?_ ?_ ?_ ?_ ?_).2 + · filter_upwards [hU.mem_nhds hx] with y hy + exact (hF y hy).aestronglyMeasurable + · exact (hF x hx).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + · exact hc0.aestronglyMeasurable + · exact Eventually.of_forall (fun a y hy => hC (y,a) ⟨Metric.mem_closedBall.mpr (Metric.mem_ball.mp hy).le,mem_univ a⟩) + · exact integrable_const C + · exact Eventually.of_forall (fun a y hy => hd y (hsub' (Metric.ball_subset_closedBall hy)) a) + +lemma complex_line_deriv {Q : ℂ → ℂ} {z d v : ℂ} {t : ℝ} + (hQ : HasDerivAt Q d (z+(t : ℂ)*v)) : + HasDerivAt (fun s : ℝ => Q (z+(s : ℂ)*v)) (d*v) t := by + have hv : HasDerivAt (fun s : ℝ => z+(s : ℂ)*v) v t := by + simpa using ((Complex.ofRealCLM.hasDerivAt.mul_const v).const_add z : + HasDerivAt (fun s : ℝ => z+Complex.ofRealCLM s*v) (Complex.ofRealCLM 1*v) t) + convert HasDerivAt.comp (𝕜 := ℝ) t hQ hv using 1 + rfl + +def normFirst (q d v : ℂ) : ℝ := 2*inner ℝ q (d*v) + +def normSecond (q d e v : ℂ) : ℝ := + 2*(inner ℝ (d*v) (d*v)+inner ℝ q ((e*v)*v)) + +lemma norm_line_hasDerivAt {Q : ℂ → ℂ} {z d v : ℂ} {t : ℝ} + (hQ : HasDerivAt Q d (z+(t : ℂ)*v)) : + HasDerivAt (fun s : ℝ => ‖Q (z+(s : ℂ)*v)‖^2) + (normFirst (Q (z+(t : ℂ)*v)) d v) t := + (complex_line_deriv hQ).norm_sq + +lemma norm_first_hasDerivAt {Q D : ℂ → ℂ} {z d e v : ℂ} {t : ℝ} + (hQ : HasDerivAt Q d (z+(t : ℂ)*v)) + (hD : HasDerivAt D e (z+(t : ℂ)*v)) : + HasDerivAt (fun s : ℝ => normFirst (Q (z+(s : ℂ)*v)) (D (z+(s : ℂ)*v)) v) + (2*(inner ℝ (d*v) (D (z+(t : ℂ)*v)*v)+inner ℝ (Q (z+(t : ℂ)*v)) ((e*v)*v))) t := by + simpa only [normFirst, add_comm] using ((complex_line_deriv hQ).inner ℝ ((complex_line_deriv hD).mul_const v)).const_mul 2 + +lemma norm_first_one (d : ℂ) : normFirst 1 d 1 = 2*d.re := by + simp [normFirst,Complex.inner] + +lemma norm_first_I (d : ℂ) : normFirst 1 d Complex.I = -2*d.im := by + simp [normFirst,Complex.inner] + +lemma norm_second_laplacian (q d e : ℂ) : + normSecond q d e 1+normSecond q d e Complex.I = 4*‖d‖^2 := by + simp only [normSecond,mul_one] + rw [real_inner_self_eq_norm_sq,real_inner_self_eq_norm_sq] + simp only [Complex.norm_mul,Complex.norm_I,mul_one] + have he : (e*Complex.I)*Complex.I = -e := by rw [mul_assoc,Complex.I_mul_I,mul_neg_one] + rw [he,inner_neg_right] + ring + +lemma continuous_normFirst : Continuous (fun p : ℂ × ℂ × ℂ => normFirst p.1 p.2.1 p.2.2) := by + unfold normFirst + fun_prop + +lemma continuous_normSecond : Continuous (fun p : ℂ × ℂ × ℂ × ℂ => normSecond p.1 p.2.1 p.2.2.1 p.2.2.2) := by + unfold normSecond + fun_prop + +def complexLine (v : ℂ) (t : ℝ) : ℂ := Complex.I+(t : ℂ)*v + +def lineDomain (v : ℂ) : Set ℝ := {t | 0 < 1+t*v.im} + +lemma isOpen_lineDomain (v : ℂ) : IsOpen (lineDomain v) := + isOpen_lt continuous_const (by fun_prop) + +lemma complexLine_im (v : ℂ) (t : ℝ) : (complexLine v t).im = 1+t*v.im := by + simp [complexLine,Complex.mul_im] + +lemma complexLine_mem {v : ℂ} {t : ℝ} (ht : t ∈ lineDomain v) : + 0 < (complexLine v t).im := (complexLine_im v t).symm ▸ ht + +@[simp] lemma complexLine_zero (v : ℂ) : complexLine v 0 = Complex.I := by simp [complexLine] +lemma zero_mem_lineDomain (v : ℂ) : (0 : ℝ) ∈ lineDomain v := by simp [lineDomain] + +lemma continuousOn_complexLine.{u_1} {X : Type u_1} [TopologicalSpace X] (G : X → ℂ → ℂ) + (hG : Continuous (fun p : X × {z : ℂ | 0 < z.im} => G p.1 p.2)) (v : ℂ) : + ContinuousOn (fun p : ℝ × X => G p.2 (complexLine v p.1)) (lineDomain v ×ˢ univ) := by + apply continuousOn_iff_continuous_domRestrict.mpr + let H : (lineDomain v ×ˢ (univ : Set X)) → X × {z : ℂ | 0 < z.im} := + fun p => (p.val.2,⟨complexLine v p.val.1,complexLine_mem p.2.1⟩) + have hH : Continuous H := by + apply Continuous.prodMk + · exact continuous_snd.comp continuous_subtype_val + · apply Continuous.subtype_mk + exact continuous_const.add (((Complex.continuous_ofReal.comp continuous_fst).comp continuous_subtype_val).mul continuous_const) + exact hG.comp hH + +lemma continuous_prod_section.{u_1} {X : Type u_1} [TopologicalSpace X] + {U : Set ℝ} {G : ℝ × X → ℝ} (hG : ContinuousOn G (U ×ˢ univ)) {t : ℝ} (ht : t ∈ U) : + Continuous (fun a => G (t,a)) := + continuousOn_univ.mp (hG.comp (continuous_const.prodMk continuous_id).continuousOn + (fun _ _ => ⟨ht,mem_univ _⟩)) + +lemma continuousOn_normFirst_line.{u_1} {X : Type u_1} [TopologicalSpace X] + (Q D : X → ℂ → ℂ) + (hQc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => Q p.1 p.2)) + (hDc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => D p.1 p.2)) (v : ℂ) : + ContinuousOn (fun p : ℝ × X => normFirst (Q p.2 (complexLine v p.1)) (D p.2 (complexLine v p.1)) v) (lineDomain v ×ˢ univ) := by + unfold normFirst + exact continuousOn_const.mul ((continuousOn_complexLine Q hQc v).inner ((continuousOn_complexLine D hDc v).mul continuousOn_const)) + +lemma integral_norm_line_derivative.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] (μ : Measure X) [IsFiniteMeasure μ] + (Q D : X → ℂ → ℂ) + (hQc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => Q p.1 p.2)) + (hDc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => D p.1 p.2)) + (hD : ∀ a z, 0 < z.im → HasDerivAt (Q a) (D a z) z) + (v : ℂ) {t : ℝ} (ht : t ∈ lineDomain v) : + HasDerivAt (fun s => ∫ a, ‖Q a (complexLine v s)‖^2 ∂μ) + (∫ a, normFirst (Q a (complexLine v t)) (D a (complexLine v t)) v ∂μ) t := by + refine hasDerivAt_integral_compact μ + (fun s a => ‖Q a (complexLine v s)‖^2) + (fun s a => normFirst (Q a (complexLine v s)) (D a (complexLine v s)) v) + (isOpen_lineDomain v) ?_ ?_ ?_ ht + · intro s hs + exact continuous_prod_section ((continuousOn_complexLine Q hQc v).norm.pow 2) hs + · exact continuousOn_normFirst_line Q D hQc hDc v + · intro s hs a + exact norm_line_hasDerivAt (hD a _ (complexLine_mem hs)) + +lemma integral_normFirst_line_derivative.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] (μ : Measure X) [IsFiniteMeasure μ] + (Q D E : X → ℂ → ℂ) + (hQc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => Q p.1 p.2)) + (hDc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => D p.1 p.2)) + (hEc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => E p.1 p.2)) + (hD : ∀ a z, 0 < z.im → HasDerivAt (Q a) (D a z) z) + (hE : ∀ a z, 0 < z.im → HasDerivAt (D a) (E a z) z) + (v : ℂ) {t : ℝ} (ht : t ∈ lineDomain v) : + HasDerivAt (fun s => ∫ a, normFirst (Q a (complexLine v s)) (D a (complexLine v s)) v ∂μ) + (∫ a, normSecond (Q a (complexLine v t)) (D a (complexLine v t)) (E a (complexLine v t)) v ∂μ) t := by + refine hasDerivAt_integral_compact μ + (fun s a => normFirst (Q a (complexLine v s)) (D a (complexLine v s)) v) + (fun s a => normSecond (Q a (complexLine v s)) (D a (complexLine v s)) (E a (complexLine v s)) v) + (isOpen_lineDomain v) ?_ ?_ ?_ ht + · intro s hs + exact continuous_prod_section (continuousOn_normFirst_line Q D hQc hDc v) hs + · have hcQ := continuousOn_complexLine Q hQc v + have hcD := continuousOn_complexLine D hDc v + have hcE := continuousOn_complexLine E hEc v + unfold normSecond + exact continuousOn_const.mul (((hcD.mul continuousOn_const).inner (hcD.mul continuousOn_const)).add + (hcQ.inner ((hcE.mul continuousOn_const).mul continuousOn_const))) + · intro s hs a + exact norm_first_hasDerivAt (hD a _ (complexLine_mem hs)) (hE a _ (complexLine_mem hs)) + +lemma normFirst_expected.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] (μ : Measure X) [IsFiniteMeasure μ] + (Q D : X → ℂ → ℂ) + (hQc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => Q p.1 p.2)) + (hDc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => D p.1 p.2)) + (hD : ∀ a z, 0 < z.im → HasDerivAt (Q a) (D a z) z) + (β : ℝ) (hmean : ∀ z : ℂ, 0 < z.im → (∫ a, ‖Q a z‖^2 ∂μ) = z.im^(-β)) + (v : ℂ) {t : ℝ} (ht : t ∈ lineDomain v) : + (∫ a, normFirst (Q a (complexLine v t)) (D a (complexLine v t)) v ∂μ) = + v.im*(-β)*(1+t*v.im)^(-β-1) := by + have hdR := (((hasDerivAt_id t).mul_const v.im).const_add 1).rpow_const + (p := -β) (Or.inl (ne_of_gt ht)) + simp only [one_mul,id_eq] at hdR + apply (integral_norm_line_derivative μ Q D hQc hDc hD v ht).unique + apply hdR.congr_of_eventuallyEq + filter_upwards [(isOpen_lineDomain v).mem_nhds ht] with s hs + exact (hmean (complexLine v s) (complexLine_mem hs)).trans + (congrArg (fun x : ℝ => x^(-β)) (complexLine_im v s)) + +lemma compact_holomorphic_line_moments.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] (μ : Measure X) [IsFiniteMeasure μ] + (Q D E : X → ℂ → ℂ) + (hQc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => Q p.1 p.2)) + (hDc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => D p.1 p.2)) + (hEc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => E p.1 p.2)) + (hD : ∀ a z, 0 < z.im → HasDerivAt (Q a) (D a z) z) + (hE : ∀ a z, 0 < z.im → HasDerivAt (D a) (E a z) z) + (β : ℝ) (hmean : ∀ z : ℂ, 0 < z.im → (∫ a, ‖Q a z‖^2 ∂μ) = z.im^(-β)) + (v : ℂ) : + (∫ a, normFirst (Q a Complex.I) (D a Complex.I) v ∂μ) = -β*v.im ∧ + (∫ a, normSecond (Q a Complex.I) (D a Complex.I) (E a Complex.I) v ∂μ) = + β*(β+1)*v.im^2 := by + have hm' {t : ℝ} (ht : t ∈ lineDomain v) := normFirst_expected μ Q D hQc hDc hD β hmean v ht + constructor + · simpa only [complexLine_zero,zero_mul,add_zero,Real.one_rpow,mul_one,mul_comm,mul_zero] using hm' (zero_mem_lineDomain v) + · have hdR := (((((hasDerivAt_id (0 : ℝ)).mul_const v.im).const_add 1).rpow_const + (p := -β-1) (Or.inl (by norm_num))).const_mul (v.im*(-β))) + have he : (∫ a, normSecond (Q a (complexLine v 0)) (D a (complexLine v 0)) (E a (complexLine v 0)) v ∂μ) = + v.im*(-β)*(1*v.im*(-β-1)*(1+0*v.im)^((-β-1)-1)) := by + apply (integral_normFirst_line_derivative μ Q D E hQc hDc hEc hD hE v (zero_mem_lineDomain v)).unique + apply hdR.congr_of_eventuallyEq + filter_upwards [(isOpen_lineDomain v).mem_nhds (zero_mem_lineDomain v)] with s hs + exact hm' hs + simp only [complexLine_zero,one_mul,zero_mul,add_zero,Real.one_rpow,mul_one] at he + exact he.trans (by ring) + +lemma compact_holomorphic_moments.{u_1} {X : Type u_1} [TopologicalSpace X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] (μ : Measure X) [IsFiniteMeasure μ] + (Q D E : X → ℂ → ℂ) + (hQc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => Q p.1 p.2)) + (hDc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => D p.1 p.2)) + (hEc : Continuous (fun p : X × {z : ℂ | 0 < z.im} => E p.1 p.2)) + (hD : ∀ a z, 0 < z.im → HasDerivAt (Q a) (D a z) z) + (hE : ∀ a z, 0 < z.im → HasDerivAt (D a) (E a z) z) + (hQ1 : ∀ a, Q a Complex.I = 1) + (β : ℝ) (hmean : ∀ z : ℂ, 0 < z.im → (∫ a, ‖Q a z‖^2 ∂μ) = z.im^(-β)) : + (∫ a, (Complex.I*D a Complex.I).re ∂μ) = -β/2 ∧ + (∫ a, (Complex.I*D a Complex.I).im ∂μ) = 0 ∧ + (∫ a, ‖Complex.I*D a Complex.I‖^2 ∂μ) = β*(β+1)/4 := by + obtain ⟨hx,hxx⟩ := compact_holomorphic_line_moments μ Q D E hQc hDc hEc hD hE β hmean 1 + obtain ⟨hy,hyy⟩ := compact_holomorphic_line_moments μ Q D E hQc hDc hEc hD hE β hmean Complex.I + have hx' := hx + have hy' := hy + simp_rw [hQ1,norm_first_one] at hx' + simp_rw [hQ1,norm_first_I] at hy' + rw [integral_const_mul] at hx' hy' + simp only [Complex.one_im,Complex.I_im,mul_zero,mul_one] at hx' hy' hxx hyy + have hDc0 : Continuous (fun a => D a Complex.I) := + hDc.comp (continuous_id.prodMk (continuous_const (y := (⟨Complex.I,by simp⟩ : {z : ℂ | 0 < z.im})))) + have hQc0 : Continuous (fun a => Q a Complex.I) := + hQc.comp (continuous_id.prodMk (continuous_const (y := (⟨Complex.I,by simp⟩ : {z : ℂ | 0 < z.im})))) + have hEc0 : Continuous (fun a => E a Complex.I) := + hEc.comp (continuous_id.prodMk (continuous_const (y := (⟨Complex.I,by simp⟩ : {z : ℂ | 0 < z.im})))) + have hi (v : ℂ) : Integrable (fun a => normSecond (Q a Complex.I) (D a Complex.I) (E a Complex.I) v) μ := by + apply Continuous.integrable_of_hasCompactSupport _ (HasCompactSupport.of_compactSpace _) + exact continuous_normSecond.comp (hQc0.prodMk (hDc0.prodMk (hEc0.prodMk continuous_const))) + have hsum : 4*(∫ a, ‖D a Complex.I‖^2 ∂μ) = β*(β+1) := by + rw [← integral_const_mul] + calc + _ = ∫ a, normSecond (Q a Complex.I) (D a Complex.I) (E a Complex.I) 1+ + normSecond (Q a Complex.I) (D a Complex.I) (E a Complex.I) Complex.I ∂μ := by + apply integral_congr_ae + exact Eventually.of_forall (fun a => (norm_second_laplacian _ _ _).symm) + _ = _ := by rw [integral_add (hi 1) (hi Complex.I),hxx,hyy]; norm_num + simp only [Complex.mul_re,Complex.mul_im,Complex.I_re,Complex.I_im,zero_mul,one_mul, + zero_sub,zero_add,Complex.norm_mul,Complex.norm_I] + rw [integral_neg] + exact ⟨by linarith,by linarith,by linarith⟩ + +lemma class_logarithmicJet_I (g : DiskClass) : + logarithmicJet (classFun g) Complex.I = Complex.I*deriv (reciprocalDeriv (classFun g)) Complex.I := by + simp only [logarithmicJet,Complex.I_im,Complex.ofReal_one,mul_one,classReciprocal_at_I,div_one] + +lemma continuous_root_logarithmicJet : Continuous (fun g : DiskClass => logarithmicJet (classFun g) Complex.I) := by + simp_rw [class_logarithmicJet_I] + have hc : Continuous (fun p : DiskClass × halfPlane => deriv (reciprocalDeriv (classFun p.1)) p.2) := by + simpa only [iteratedDeriv_one] using continuous_reciprocalJet_eval 1 + exact (hc.comp (continuous_id.prodMk (continuous_const (y := (⟨Complex.I,by simp [halfPlane]⟩ : halfPlane))))).const_mul _ + +lemma root_logarithmicJet_bounded : ∃ C : ℝ, ∀ g : DiskClass, ‖logarithmicJet (classFun g) Complex.I‖ ≤ C := by + obtain ⟨C,hC⟩ := isCompact_univ.exists_bound_of_continuousOn continuous_root_logarithmicJet.continuousOn + exact ⟨C,fun g => hC g (mem_univ g)⟩ + +lemma weighted_law_moments (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : ∀ z : halfPlane, ∀ f : C(DiskClass,ℝ), + (∫ g, classWeight g z*f (rerootClass g z) ∂(P : Measure DiskClass)) = + (z.val.im)^(-β)*(∫ g, f g ∂(P : Measure DiskClass))) : + (∫ g, (logarithmicJet (classFun g) Complex.I).re ∂(P : Measure DiskClass)) = -β/2 ∧ + (∫ g, (logarithmicJet (classFun g) Complex.I).im ∂(P : Measure DiskClass)) = 0 ∧ + (∫ g, ‖logarithmicJet (classFun g) Complex.I‖^2 ∂(P : Measure DiskClass)) = β*(β+1)/4 := by + have hcD : Continuous (fun p : DiskClass × halfPlane => deriv (reciprocalDeriv (classFun p.1)) p.2) := by + simpa only [iteratedDeriv_one] using continuous_reciprocalJet_eval 1 + have hcE : Continuous (fun p : DiskClass × halfPlane => deriv (deriv (reciprocalDeriv (classFun p.1))) p.2) := by + simpa only [show (2 : ℕ) = 1+1 from rfl,iteratedDeriv_succ,iteratedDeriv_one,iteratedDeriv_zero] using continuous_reciprocalJet_eval 2 + have hm (z : ℂ) (hz : 0 < z.im) : + (∫ g, ‖reciprocalDeriv (classFun g) z‖^2 ∂(P : Measure DiskClass)) = z.im^(-β) := by + simpa only [classWeight,ContinuousMap.one_apply,mul_one,integral_const,ProbabilityMeasure.coeFn_univ, + probReal_univ,smul_eq_mul,one_mul] using hP ⟨z,hz⟩ 1 + have hE (g : DiskClass) (z : ℂ) (hz : 0 < z.im) : + HasDerivAt (deriv (reciprocalDeriv (classFun g))) + (deriv (deriv (reciprocalDeriv (classFun g))) z) z := + ((differentiableOn_classReciprocal g).analyticOnNhd isOpen_halfPlane z hz).deriv.differentiableAt.hasDerivAt + simp_rw [class_logarithmicJet_I] + exact compact_holomorphic_moments (P : Measure DiskClass) + (fun g => reciprocalDeriv (classFun g)) (fun g => deriv (reciprocalDeriv (classFun g))) + (fun g => deriv (deriv (reciprocalDeriv (classFun g)))) + continuous_classReciprocal_eval hcD hcE + (fun g z hz => hasDerivAt_reciprocalDeriv (classFun_schlicht g).1 hz) + hE classReciprocal_at_I β hm + +lemma jacobian_expectation_nonpos (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : HasWeightedLaw P β) (hβ : 1 < β) : + (∫ g, normalizedJacobian (classFun g) ((β+3)/4) Complex.I ∂(P : Measure DiskClass)) ≤ 0 := by + have hk : 0 < (β+3)/4 := by linarith + have hg : ∀ᵐ g ∂(P : Measure DiskClass), ∀ᵐ ξ : ℂ, GoodPair (classFun g) ((β+3)/4) ξ := by + filter_upwards [weightedInverseArea_ae_finite P β hP] with g hg + apply class_ae_goodPairs g hβ + have he : weightedInverseArea β g = (∫⁻ z in outsideCore, + ENNReal.ofReal (z.im^(β+1)*‖classFun g z‖⁻¹^4)) := by + simp only [weightedInverseArea,inverseDensity] + apply setLIntegral_congr_fun measurableSet_outsideCore + intro z hz + dsimp only + rw [planeClassValue_eq g hz.1,ENNReal.ofReal_mul (Real.rpow_nonneg hz.1.le _)] + exact he ▸ hg + have hi := jacobian_positive_le_negative P β hP hk (by ring) hg + have hc : Continuous (fun g : DiskClass => normalizedJacobian (classFun g) ((β+3)/4) Complex.I) := + (continuous_class_normalizedJacobian _).comp + (continuous_id.prodMk (continuous_const (y := halfOne))) + have hInt := hc.integrable_of_hasCompactSupport (μ := (P : Measure DiskClass)) (HasCompactSupport.of_compactSpace _) + rw [integral_eq_lintegral_pos_part_sub_lintegral_neg_part hInt] + have ht := ENNReal.toReal_mono (rootJac_integral_lt_top P ((β+3)/4) (-1)).ne hi + simpa only [rootJac,one_mul,neg_one_mul,sub_nonpos] using ht + +lemma jacobian_expectation_value (P : ProbabilityMeasure DiskClass) (β : ℝ) + (hP : ∀ z : halfPlane, ∀ f : C(DiskClass,ℝ), + (∫ g, classWeight g z*f (rerootClass g z) ∂(P : Measure DiskClass)) = + (z.val.im)^(-β)*(∫ g, f g ∂(P : Measure DiskClass))) + {k : ℝ} (hk : k ≠ 0) : + k^2 * (∫ g, normalizedJacobian (classFun g) k Complex.I ∂(P : Measure DiskClass)) = + k*(k-1) - (2*k-1)*β/2 + β*(β+1)/4 := by + obtain ⟨hr,-,hs⟩ := weighted_law_moments P β hP + have hiR : Integrable (fun g : DiskClass => (2*k-1)*(logarithmicJet (classFun g) Complex.I).re) (P : Measure DiskClass) := + (continuous_const.mul (Complex.continuous_re.comp continuous_root_logarithmicJet)).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + have hiS : Integrable (fun g : DiskClass => ‖logarithmicJet (classFun g) Complex.I‖^2) (P : Measure DiskClass) := + (continuous_root_logarithmicJet.norm.pow 2).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + rw [← integral_const_mul] + calc + _ = ∫ g, k*(k-1)+(2*k-1)*(logarithmicJet (classFun g) Complex.I).re+ + ‖logarithmicJet (classFun g) Complex.I‖^2 ∂(P : Measure DiskClass) := by + apply integral_congr_ae + exact Eventually.of_forall (fun g => normalizedJacobian_formula (classFun_schlicht g).1 (by simp [halfPlane]) k hk) + _ = _ := by + have h1 := integral_add ((integrable_const (k*(k-1))).add hiR) hiS + have h2 := integral_add (integrable_const (k*(k-1))) hiR + simp only [Pi.add_apply] at h1 h2 + rw [h1,h2] + simp only [integral_const_mul,integral_const,probReal_univ,smul_eq_mul,one_mul,hr,hs] + ring + +theorem transferRho_le_two : transferRho ≤ 2 := by + by_contra! hρ + obtain ⟨P,hP⟩ := exists_weighted_continuous_law hρ + have hPb : HasWeightedLaw P transferBeta := by + intro z f hf + exact weighted_lintegral_of_continuous (P : Measure DiskClass) (weightAt z) + (fun g => (classWeight_pos g z).le) (actionAt z) ((z.val.im)^(-transferBeta)) + (Real.rpow_nonneg z.2.le _) (hP z) f hf + have hβ := transferBeta_gt_one hρ + have hn := jacobian_expectation_nonpos P transferBeta hPb hβ + have hv := jacobian_expectation_value P transferBeta hP (k := (transferBeta+3)/4) (by linarith) + have hp : 0 < ((transferBeta+3)/4)*((transferBeta+3)/4-1) := mul_pos (by linarith) (by linarith) + have he : ((transferBeta+3)/4)*((transferBeta+3)/4-1) - + (2*((transferBeta+3)/4)-1)*transferBeta/2 + transferBeta*(transferBeta+1)/4 = + ((transferBeta+3)/4)*((transferBeta+3)/4-1) := by ring + rw [he] at hv + have hnon := mul_nonpos_of_nonneg_of_nonpos (sq_nonneg ((transferBeta+3)/4)) hn + linarith + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/NegativeArea.lean b/lean/OAI/Analysis/IntegralMeans/NegativeArea.lean new file mode 100644 index 0000000000000000000000000000000000000000..572b3cd6ada64a0d7a2a82dbc2dcfa3cb590ad68 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/NegativeArea.lean @@ -0,0 +1,270 @@ +import OAI.Analysis.IntegralMeans.Spectrum + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +lemma polar_symm_circle (p : ℝ × ℝ) : Complex.polarCoord.symm p = circlePoint p.1 p.2 := by + simp [Complex.polarCoord_symm_apply,circlePoint,Complex.exp_mul_I,← Complex.ofReal_cos,← Complex.ofReal_sin] + +lemma disk_lintegral_le_polar (F : ℂ → ℝ≥0∞) : + (∫⁻ z in disk, F z) ≤ ∫⁻ r in Ioo (0:ℝ) 1, + ENNReal.ofReal r * ∫⁻ θ in Ioo (-Real.pi) Real.pi, F (circlePoint r θ) := by + have hm : MeasurableSet disk := Metric.isOpen_ball.measurableSet + rw [← lintegral_indicator hm,← Complex.lintegral_comp_polarCoord_symm] + change (∫⁻ p in Ioi (0:ℝ) ×ˢ Ioo (-Real.pi) Real.pi, + ENNReal.ofReal p.1 * disk.indicator F (Complex.polarCoord.symm p)) ≤ _ + rw [← lintegral_indicator (measurableSet_Ioi.prod measurableSet_Ioo)] + have he : (Ioi (0:ℝ) ×ˢ Ioo (-Real.pi) Real.pi).indicator + (fun p : ℝ × ℝ => ENNReal.ofReal p.1 * disk.indicator F (Complex.polarCoord.symm p)) = + (Ioo (0:ℝ) 1 ×ˢ Ioo (-Real.pi) Real.pi).indicator + (fun p : ℝ × ℝ => ENNReal.ofReal p.1 * F (circlePoint p.1 p.2)) := by + ext p + simp_rw [polar_symm_circle] + by_cases h0 : 0 < p.1 + · have hd : circlePoint p.1 p.2 ∈ disk ↔ p.1 < 1 := by + simp [disk,circlePoint_norm,abs_of_pos h0] + by_cases h1 : p.1 < 1 <;> by_cases hθ : p.2 ∈ Ioo (-Real.pi) Real.pi <;> + simp [Set.indicator,h0,h1,hθ,hd] + · simp [Set.indicator,h0] + rw [he,lintegral_indicator (measurableSet_Ioo.prod measurableSet_Ioo)] + change (∫⁻ p in Ioo (0:ℝ) 1 ×ˢ Ioo (-Real.pi) Real.pi, + ENNReal.ofReal p.1 * F (circlePoint p.1 p.2) ∂(volume.prod volume)) ≤ _ + rw [← Measure.prod_restrict] + refine (lintegral_prod_le _).trans_eq ?_ + apply lintegral_congr + intro r + exact lintegral_const_mul' _ _ ENNReal.ofReal_ne_top + +lemma integrableOn_disk_of_circle_bound {F : ℂ → ℝ} (hF : ContinuousOn F disk) + (hFn : ∀ z ∈ disk, 0 ≤ F z) {B : ℝ → ℝ} + (hB : IntegrableOn B (Ioo (0:ℝ) 1)) + (hBn : ∀ r ∈ Ioo (0:ℝ) 1, 0 ≤ B r) + (hbound : ∀ r ∈ Ioo (0:ℝ) 1, + (∫⁻ θ in Ioo (-Real.pi) Real.pi, ENNReal.ofReal (F (circlePoint r θ))) ≤ ENNReal.ofReal (B r)) : + IntegrableOn F disk := by + refine ⟨hF.aestronglyMeasurable Metric.isOpen_ball.measurableSet,?_⟩ + have hn : ∀ᵐ z ∂(volume.restrict disk), 0 ≤ F z := ae_restrict_of_forall_mem Metric.isOpen_ball.measurableSet hFn + apply (hasFiniteIntegral_iff_ofReal hn).mpr + refine lt_of_le_of_lt (disk_lintegral_le_polar (fun z => ENNReal.ofReal (F z))) ?_ + refine lt_of_le_of_lt ?_ hB.hasFiniteIntegral + apply setLIntegral_mono' measurableSet_Ioo + intro r hr + calc + ENNReal.ofReal r * (∫⁻ θ in Ioo (-Real.pi) Real.pi, ENNReal.ofReal (F (circlePoint r θ))) ≤ + ENNReal.ofReal r * ENNReal.ofReal (B r) := mul_le_mul le_rfl (hbound r hr) zero_le zero_le + _ ≤ ENNReal.ofReal (B r) := by + exact mul_le_of_le_one_left zero_le (by exact_mod_cast hr.2.le) + _ = ‖B r‖ₑ := by rw [Real.enorm_eq_ofReal (hBn r hr)] + +lemma circle_lintegral_eq {F : ℂ → ℝ} {r : ℝ} + (hc : Continuous (fun θ : ℝ => F (circlePoint r θ))) + (hn : ∀ θ, 0 ≤ F (circlePoint r θ)) : + (∫⁻ θ in Ioo (-Real.pi) Real.pi, ENNReal.ofReal (F (circlePoint r θ))) = + ENNReal.ofReal (∫ θ in -Real.pi..Real.pi, F (circlePoint r θ)) := by + rw [restrict_Ioo_eq_restrict_Ioc] + rw [intervalIntegral.integral_of_le (by linarith [Real.pi_pos])] + exact (ofReal_integral_eq_lintegral_ofReal + (hc.continuousOn.integrableOn_Icc.mono_set Ioc_subset_Icc_self) + (Eventually.of_forall hn)).symm + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +lemma continuousOn_deriv_univalent {f : ℂ → ℂ} (hf : UnivalentOn f disk) : + ContinuousOn (deriv f) disk := + (hf.1.deriv Metric.isOpen_ball).continuousOn + +lemma continuousOn_deriv_norm_rpow {f : ℂ → ℂ} (hf : UnivalentOn f disk) (t : ℝ) : + ContinuousOn (fun z => ‖deriv f z‖^t) disk := by + apply (continuousOn_deriv_univalent hf).norm.rpow_const + intro z hz + exact Or.inl (norm_ne_zero_iff.mpr (univalent_deriv_ne_zero Metric.isOpen_ball hf hz)) + +lemma integrableOn_boundary_rpow {a : ℝ} (ha : -1 < a) : + IntegrableOn (fun r : ℝ => (1-r)^a) (Ioo (0:ℝ) 1) := by + have hi := (intervalIntegral.intervalIntegrable_rpow' (a := (0:ℝ)) (b := (1:ℝ)) ha).comp_sub_left 1 + have hi' : IntervalIntegrable (fun r : ℝ => (1-r)^a) volume 0 1 := by + simpa using hi.symm + exact hi'.1.mono_set Ioo_subset_Ioc_self + +lemma integrableOn_disk_of_power_circle_bound {F : ℂ → ℝ} (hF : ContinuousOn F disk) + (hFn : ∀ z ∈ disk, 0 ≤ F z) {C a : ℝ} (hC : 0 ≤ C) (ha : -1 < a) + (hbound : ∀ r : ℝ, 0 < r → r < 1 → + (∫⁻ θ in Ioo (-Real.pi) Real.pi, ENNReal.ofReal (F (circlePoint r θ))) ≤ + ENNReal.ofReal (C*(1-r)^a)) : + IntegrableOn F disk := + integrableOn_disk_of_circle_bound hF hFn ((integrableOn_boundary_rpow ha).const_mul C) + (fun r hr => mul_nonneg hC (Real.rpow_nonneg (by linarith [hr.2]) _)) + (fun r hr => hbound r hr.1 hr.2) + +lemma integrableOn_disk_boundary_power {a : ℝ} (ha : -1 < a) : + IntegrableOn (fun z : ℂ => (1-‖z‖)^a) disk := by + have hc : ContinuousOn (fun z : ℂ => (1-‖z‖)^a) disk := by + apply (continuous_const.sub continuous_norm).continuousOn.rpow_const + intro z hz + exact Or.inl (ne_of_gt (by simpa [disk] using sub_pos.mpr (show ‖z‖ < 1 by simpa [disk] using hz))) + apply integrableOn_disk_of_power_circle_bound hc + (fun z hz => Real.rpow_nonneg (sub_nonneg.mpr (le_of_lt (by simpa [disk] using hz))) _) (C := 2*Real.pi) + (by positivity) ha + intro r hr hr1 + have he : (fun θ : ℝ => (1-‖circlePoint r θ‖)^a) = fun _ => (1-r)^a := by + ext θ + rw [circlePoint_norm,abs_of_pos hr] + rw [circle_lintegral_eq (F := fun z => (1-‖z‖)^a) (r := r) (by rw [he]; exact continuous_const) (fun θ => Real.rpow_nonneg (by rw [circlePoint_norm,abs_of_pos hr]; linarith) _)] + rw [he,intervalIntegral.integral_const] + norm_num [smul_eq_mul] + rw [show Real.pi + Real.pi = 2*Real.pi by ring] + +lemma integrableOn_geometric_product {A B F : ℂ → ℝ} {s : Set ℂ} (hs : MeasurableSet s) + (hA : IntegrableOn A s) (hB : IntegrableOn B s) (hF : AEStronglyMeasurable F (volume.restrict s)) + {q : ℝ} (hq : 0 ≤ q) (hq1 : q ≤ 1) + (hAn : ∀ z ∈ s, 0 ≤ A z) (hBn : ∀ z ∈ s, 0 ≤ B z) + (hEq : ∀ z ∈ s, F z = A z^q * B z^(1-q)) : IntegrableOn F s := by + apply ((hA.const_mul q).add (hB.const_mul (1-q))).mono' hF + apply ae_restrict_of_forall_mem hs + intro z hz + rw [hEq z hz,Real.norm_eq_abs,abs_of_nonneg (mul_nonneg + (Real.rpow_nonneg (hAn z hz) _) (Real.rpow_nonneg (hBn z hz) _))] + exact Real.geom_mean_le_arith_mean2_weighted hq (by linarith) (hAn z hz) (hBn z hz) (by ring) + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +lemma schlicht_inverse_bound_small {f : ℂ → ℂ} (hf : Schlicht f) {z : ℂ} + (hz : ‖z‖ ≤ 1/2) : ‖deriv f z‖^(-2:ℝ) ≤ 256 := by + have hm : z ∈ disk := by simp only [disk,Metric.mem_ball,dist_zero_right]; linarith + have hb := (schlicht_deriv_bounds hf hm).1 + have hp : (1+‖z‖)^3 ≤ (2:ℝ)^3 := pow_le_pow_left₀ (by positivity) (by linarith) _ + have hl : (1/16:ℝ) ≤ (1-‖z‖)/(1+‖z‖)^3 := by + apply (le_div_iff₀ (by positivity)).mpr + nlinarith + have he := Real.rpow_le_rpow_of_nonpos (by norm_num : (0:ℝ) < 1/16) (hl.trans hb) (by norm_num : (-2:ℝ) ≤ 0) + norm_num at he + simpa only [Real.rpow_neg (norm_nonneg _), Real.rpow_ofNat] using he + +lemma inverse_square_bound_all (ε : ℝ) (hε : 0 < ε) : + ∃ C : ℝ, 0 < C ∧ ∀ f : ℂ → ℂ, Schlicht f → ∀ r : ℝ, 0 ≤ r → r < 1 → + integralMean f (-2) r ≤ C*(1-r)^(-1-ε) := by + obtain ⟨C,hC,hbound⟩ := uniform_inverse_square_bound ε hε + refine ⟨C+256,by linarith,fun f hf r hr hr1 => ?_⟩ + have hd : 0 < 1-r := by linarith + have hp : 1 ≤ (1-r)^(-1-ε) := Real.one_le_rpow_of_pos_of_le_one_of_nonpos hd (by linarith) (by linarith) + by_cases hrh : 1/2 ≤ r + · exact (hbound f hf r hrh hr1).trans (mul_le_mul_of_nonneg_right (by linarith) (Real.rpow_nonneg hd.le _)) + · have hn (θ : ℝ) : ‖deriv f (circlePoint r θ)‖^(-2:ℝ) ≤ 256 := + schlicht_inverse_bound_small hf (by rw [circlePoint_norm,abs_of_nonneg hr]; linarith) + have hi := intervalIntegral.integral_mono_on (a := -Real.pi) (b := Real.pi) (f := fun θ => ‖deriv f (circlePoint r θ)‖^(-2:ℝ)) + (g := fun _ => (256:ℝ)) (by linarith [Real.pi_pos]) + ((continuous_circle_deriv_rpow hf.1 hr hr1 (-2)).intervalIntegrable _ _) + (intervalIntegrable_const (μ := volume)) (fun θ _ => hn θ) + have hm : integralMean f (-2) r ≤ 256 := by + change (2*Real.pi)⁻¹*(∫ θ in -Real.pi..Real.pi,‖deriv f (circlePoint r θ)‖^(-2:ℝ)) ≤ _ + have hh := mul_le_mul_of_nonneg_left hi (inv_nonneg.mpr (by positivity : (0:ℝ) ≤ 2*Real.pi)) + refine hh.trans_eq ?_ + simp only [intervalIntegral.integral_const,smul_eq_mul] + field_simp + ring + nlinarith + +lemma weighted_inverse_integrable {f : ℂ → ℂ} (hf : Schlicht f) {α : ℝ} (hα : 0 < α) : + IntegrableOn (fun z => (1-‖z‖)^α*‖deriv f z‖^(-2:ℝ)) disk := by + obtain ⟨C,hC,hbound⟩ := inverse_square_bound_all (α/2) (by linarith) + have hδ (z : ℂ) (hz : z ∈ disk) : 0 < 1-‖z‖ := by + have hn : ‖z‖ < 1 := by simpa [disk] using hz + linarith + have hc : ContinuousOn (fun z : ℂ => (1-‖z‖)^α*‖deriv f z‖^(-2:ℝ)) disk := + ((continuous_const.sub continuous_norm).continuousOn.rpow_const (fun z hz => Or.inl (hδ z hz).ne')).mul + (continuousOn_deriv_norm_rpow hf.1 _) + apply integrableOn_disk_of_power_circle_bound hc + (fun z hz => mul_nonneg (Real.rpow_nonneg (hδ z hz).le _) (Real.rpow_nonneg (norm_nonneg _) _)) + (C := 2*Real.pi*C) (a := α/2-1) (by positivity) (by linarith) + intro r hr hr1 + have hd : 0 < 1-r := by linarith + have he : (fun θ => (1-‖circlePoint r θ‖)^α*‖deriv f (circlePoint r θ)‖^(-2:ℝ)) = + fun θ => (1-r)^α*‖deriv f (circlePoint r θ)‖^(-2:ℝ) := by + ext θ + rw [circlePoint_norm,abs_of_pos hr] + rw [circle_lintegral_eq (F := fun z => (1-‖z‖)^α*‖deriv f z‖^(-2:ℝ)) (r := r) (by rw [he]; exact continuous_const.mul (continuous_circle_deriv_rpow hf.1 hr.le hr1 _)) + (fun θ => by rw [circlePoint_norm,abs_of_pos hr]; positivity),he,intervalIntegral.integral_const_mul] + apply ENNReal.ofReal_le_ofReal + have hmean : (∫ θ in -Real.pi..Real.pi,‖deriv f (circlePoint r θ)‖^(-2:ℝ)) = + 2*Real.pi*integralMean f (-2) r := by + unfold integralMean circlePoint + field_simp + simp only [mul_comm Complex.I] + rw [hmean] + calc + _ ≤ (1-r)^α*(2*Real.pi*(C*(1-r)^(-1-α/2))) := + mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (hbound f hf r hr.le hr1) (by positivity)) (by positivity) + _ = 2*Real.pi*C*(1-r)^(α/2-1) := by + have hp : (1-r)^α*(1-r)^(-1-α/2) = (1-r)^(α/2-1) := by + rw [← Real.rpow_add hd] + congr 1 + ring + calc + _ = (2*Real.pi*C)*((1-r)^α*(1-r)^(-1-α/2)) := by ring + _ = _ := by rw [hp] + +lemma schlicht_negative_area {f : ℂ → ℂ} (hf : Schlicht f) {t : ℝ} + (ht : -2 < t) (ht0 : t < 0) : IntegrableOn (fun z => ‖deriv f z‖^t) disk := by + let q : ℝ := -t/2 + let α : ℝ := (1-q)/(2*q) + have hq : 0 < q := by dsimp [q]; linarith + have hq1 : q < 1 := by dsimp [q]; linarith + have hα : 0 < α := div_pos (by linarith) (by positivity) + let A : ℂ → ℝ := fun z => (1-‖z‖)^α*‖deriv f z‖^(-2:ℝ) + let B : ℂ → ℝ := fun z => (1-‖z‖)^(-1/2:ℝ) + apply integrableOn_geometric_product Metric.isOpen_ball.measurableSet + (A := A) (B := B) (weighted_inverse_integrable hf hα) + (integrableOn_disk_boundary_power (by norm_num)) + ((continuousOn_deriv_norm_rpow hf.1 t).aestronglyMeasurable Metric.isOpen_ball.measurableSet) + hq.le hq1.le + · intro z hz + dsimp [A] + apply mul_nonneg + · apply Real.rpow_nonneg + have hn : ‖z‖ < 1 := by simpa [disk] using hz + linarith + · exact Real.rpow_nonneg (norm_nonneg _) _ + · intro z hz + apply Real.rpow_nonneg + have hn : ‖z‖ < 1 := by simpa [disk] using hz + linarith + · intro z hz + have hn : ‖z‖ < 1 := by simpa [disk] using hz + have hd : 0 < 1-‖z‖ := by linarith + dsimp [A,B] + rw [Real.mul_rpow (Real.rpow_nonneg hd.le _) (Real.rpow_nonneg (norm_nonneg _) _), + ← Real.rpow_mul hd.le,← Real.rpow_mul (norm_nonneg _),← Real.rpow_mul hd.le] + have he : α*q+(-1/2)*(1-q) = 0 := by + dsimp [α] + field_simp + ring + have htq : (-2:ℝ)*q = t := by dsimp [q]; ring + rw [htq] + calc + _ = ‖deriv f z‖^t*1 := by ring + _ = ‖deriv f z‖^t*((1-‖z‖)^(α*q)*(1-‖z‖)^((-1/2)*(1-q))) := by rw [← Real.rpow_add hd,he,Real.rpow_zero] + _ = _ := by ring + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/PositiveArea.lean b/lean/OAI/Analysis/IntegralMeans/PositiveArea.lean new file mode 100644 index 0000000000000000000000000000000000000000..b72d304e62ccdf5dc97cfcf7e118fd27e74ea687 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/PositiveArea.lean @@ -0,0 +1,167 @@ +import OAI.Analysis.IntegralMeans.SmoothMeans + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +lemma schlicht_bracketSq_growth {f : ℂ → ℂ} (hf : Schlicht f) {z : ℂ} (hz : z ∈ disk) : + bracketSq (f z) ≤ 2*(1-‖z‖)^(-4:ℝ) := by + have hr : ‖z‖ < 1 := by simpa [disk] using hz + have hd : 0 < 1-‖z‖ := by linarith + have hg := schlicht_growth_upper hf hz + have hb : ‖f z‖ ≤ 1/(1-‖z‖)^2 := hg.trans (div_le_div_of_nonneg_right hr.le (sq_nonneg _)) + have hs := pow_le_pow_left₀ (norm_nonneg _) hb 2 + have hδ : (1-‖z‖)^4 ≤ 1 := pow_le_one₀ hd.le (by nlinarith [norm_nonneg z]) + rw [bracketSq_eq,Real.rpow_neg hd.le] + norm_num only [Real.rpow_ofNat] + rw [inv_eq_one_div] + have hdiv : (1/(1-‖z‖)^2)^2 = 1/(1-‖z‖)^4 := by field_simp + rw [hdiv] at hs + have hh : 1 ≤ 1/(1-‖z‖)^4 := (le_div_iff₀ (pow_pos hd _)).mpr (by simpa using hδ) + linarith + +lemma continuousOn_smoothPower_comp {f : ℂ → ℂ} (hf : Schlicht f) (a : ℝ) : + ContinuousOn (fun z => smoothPower a (f z)) disk := + (smoothPower_contDiff a 0).continuous.comp_continuousOn hf.1.1.continuousOn + +lemma schlicht_function_area {f : ℂ → ℂ} (hf : Schlicht f) {a : ℝ} (ha : a < 1/2) : + IntegrableOn (fun z => bracketSq (f z)^a) disk := by + obtain ⟨q,hq0,hq4⟩ := exists_between (show max (0:ℝ) (a-1/4) < 1/4 by + exact max_lt (by norm_num) (by linarith)) + have hq : 0 < q := (le_max_left _ _).trans_lt hq0 + have haq : a-q < 1/4 := by have hh := (le_max_right _ _).trans_lt hq0; linarith + obtain ⟨C,hC,hmean⟩ := schlicht_smooth_means hf hq hq4 + have hc : ContinuousOn (fun z => bracketSq (f z)^a) disk := continuousOn_smoothPower_comp hf a + have hm (r : ℝ) (hr : 0 < r) (hr1 : r < 1) : + IntervalIntegrable (fun θ => bracketSq (f (circlePoint r θ))^a) volume (-Real.pi) Real.pi := + (continuous_circle_smoothPower hf a r hr.le hr1).intervalIntegrable _ _ + have hqn (r : ℝ) (hr : 0 < r) (hr1 : r < 1) : + IntervalIntegrable (fun θ => smoothPower q (f (circlePoint r θ))) volume (-Real.pi) Real.pi := + (continuous_circle_smoothPower hf q r hr.le hr1).intervalIntegrable _ _ + by_cases haq0 : a ≤ q + · apply integrableOn_disk_of_power_circle_bound hc (fun z _ => Real.rpow_nonneg (bracketSq_pos _).le _) + (C := C) (a := 0) hC.le (by norm_num) + intro r hr hr1 + rw [circle_lintegral_eq (F := fun z => bracketSq (f z)^a) + (continuous_circle_smoothPower hf a r hr.le hr1) + (fun θ => Real.rpow_nonneg (bracketSq_pos _).le _),Real.rpow_zero,mul_one] + apply ENNReal.ofReal_le_ofReal + refine (intervalIntegral.integral_mono_on (a := -Real.pi) (b := Real.pi) (by linarith [Real.pi_pos]) (hm r hr hr1) (hqn r hr hr1) ?_).trans (hmean r hr hr1) + intro θ _ + exact Real.rpow_le_rpow_of_exponent_le (by rw [bracketSq_eq]; nlinarith [sq_nonneg ‖f (circlePoint r θ)‖]) haq0 + · have haqp : 0 < a-q := by linarith + apply integrableOn_disk_of_power_circle_bound hc (fun z _ => Real.rpow_nonneg (bracketSq_pos _).le _) + (C := (2:ℝ)^(a-q)*C) (a := -4*(a-q)) (by positivity) (by linarith) + intro r hr hr1 + have hd : 0 < 1-r := by linarith + rw [circle_lintegral_eq (F := fun z => bracketSq (f z)^a) + (continuous_circle_smoothPower hf a r hr.le hr1) + (fun θ => Real.rpow_nonneg (bracketSq_pos _).le _)] + apply ENNReal.ofReal_le_ofReal + have hi : (∫ θ in -Real.pi..Real.pi, bracketSq (f (circlePoint r θ))^a) ≤ + ∫ θ in -Real.pi..Real.pi, ((2:ℝ)^(a-q)*(1-r)^(-4*(a-q)))*smoothPower q (f (circlePoint r θ)) := by + apply intervalIntegral.integral_mono_on (a := -Real.pi) (b := Real.pi) (by linarith [Real.pi_pos]) (hm r hr hr1) ((hqn r hr hr1).const_mul _) + intro θ _ + have hz : circlePoint r θ ∈ disk := by simpa [disk,circlePoint_norm,abs_of_pos hr] using hr1 + have hg := schlicht_bracketSq_growth hf hz + rw [circlePoint_norm,abs_of_pos hr] at hg + have hp := Real.rpow_le_rpow (bracketSq_pos _).le hg haqp.le + rw [Real.mul_rpow (by norm_num) (Real.rpow_nonneg hd.le _),← Real.rpow_mul hd.le] at hp + calc + _ = bracketSq (f (circlePoint r θ))^(a-q)*bracketSq (f (circlePoint r θ))^q := by + rw [← Real.rpow_add (bracketSq_pos _),sub_add_cancel] + _ ≤ _ := mul_le_mul_of_nonneg_right hp (Real.rpow_nonneg (bracketSq_pos _).le _) + rw [intervalIntegral.integral_const_mul] at hi + calc + _ ≤ ((2:ℝ)^(a-q)*(1-r)^(-4*(a-q)))*(∫ θ in -Real.pi..Real.pi, smoothPower q (f (circlePoint r θ))) := hi + _ ≤ ((2:ℝ)^(a-q)*(1-r)^(-4*(a-q)))*C := mul_le_mul_of_nonneg_left (hmean r hr hr1) (by positivity) + _ = _ := by ring + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +lemma bracketSq_negative_integrable {η : ℝ} (hη : 0 < η) : + Integrable (fun z : ℂ => bracketSq z^(-1-η)) := by + have h := integrable_rpow_neg_one_add_norm_sq (E := ℂ) (μ := volume) (r := 2+2*η) + (by norm_num [Complex.finrank_real_complex]; linarith) + convert! h using 1 + ext z + rw [bracketSq_eq] + congr 1 + ring + +lemma schlicht_weighted_derivative_integrable {f : ℂ → ℂ} (hf : Schlicht f) {η : ℝ} (hη : 0 < η) : + IntegrableOn (fun z => ‖deriv f z‖^2*bracketSq (f z)^(-1-η)) disk := by + have hc : ContinuousOn (fun z => ‖deriv f z‖^2*bracketSq (f z)^(-1-η)) disk := + ((continuousOn_deriv_univalent hf.1).norm.pow 2).mul (continuousOn_smoothPower_comp hf _) + have hn : ∀ z : ℂ, 0 ≤ ‖deriv f z‖^2*bracketSq (f z)^(-1-η) := + fun z => mul_nonneg (sq_nonneg _) (Real.rpow_nonneg (bracketSq_pos _).le _) + refine ⟨hc.aestronglyMeasurable Metric.isOpen_ball.measurableSet,?_⟩ + apply (hasFiniteIntegral_iff_ofReal (Eventually.of_forall hn)).mpr + have hh := conformal_lintegral_le Metric.isOpen_ball.measurableSet + (fun z hz => hf.1.1.differentiableAt (Metric.isOpen_ball.mem_nhds hz)) hf.1.2 + (fun w => ENNReal.ofReal (bracketSq w^(-1-η))) + simp_rw [← ENNReal.ofReal_mul (sq_nonneg _)] at hh + refine lt_of_le_of_lt hh ?_ + exact (hasFiniteIntegral_iff_ofReal (Eventually.of_forall + (fun z : ℂ => Real.rpow_nonneg (bracketSq_pos z).le (-1-η)))).mp + (bracketSq_negative_integrable hη).hasFiniteIntegral + +lemma schlicht_positive_area {f : ℂ → ℂ} (hf : Schlicht f) {t : ℝ} + (ht : 0 < t) (ht2 : t < 2/3) : IntegrableOn (fun z => ‖deriv f z‖^t) disk := by + let q := t/2 + let η := (1-3*q)/(4*q) + let a := (1+η)*q/(1-q) + have hq : 0 < q := by dsimp [q]; linarith + have hq3 : q < 1/3 := by dsimp [q]; linarith + have hq1 : q < 1 := by linarith + have hη : 0 < η := div_pos (by linarith) (by positivity) + have ha : a < 1/2 := by + dsimp [a] + apply (div_lt_iff₀ (by linarith : 0 < 1-q)).mpr + have he : (1+η)*q = (1+q)/4 := by dsimp [η]; field_simp; ring + rw [he] + linarith + let A : ℂ → ℝ := fun z => ‖deriv f z‖^2*bracketSq (f z)^(-1-η) + let B : ℂ → ℝ := fun z => bracketSq (f z)^a + apply integrableOn_geometric_product Metric.isOpen_ball.measurableSet + (A := A) (B := B) (schlicht_weighted_derivative_integrable hf hη) + (schlicht_function_area hf ha) + ((continuousOn_deriv_norm_rpow hf.1 t).aestronglyMeasurable Metric.isOpen_ball.measurableSet) + hq.le hq1.le + · intro z _hz + exact mul_nonneg (sq_nonneg _) (Real.rpow_nonneg (bracketSq_pos _).le _) + · intro z _hz + exact Real.rpow_nonneg (bracketSq_pos _).le _ + · intro z _hz + dsimp [A,B] + rw [Real.mul_rpow (sq_nonneg _) (Real.rpow_nonneg (bracketSq_pos _).le _), + ← Real.rpow_natCast ‖deriv f z‖ 2,← Real.rpow_mul (norm_nonneg _), + ← Real.rpow_mul (bracketSq_pos _).le,← Real.rpow_mul (bracketSq_pos _).le] + have he : (-1-η)*q+a*(1-q) = 0 := by + dsimp [a] + rw [div_mul_cancel₀ _ (by linarith : 1-q ≠ 0)] + ring + have htq : (2:ℝ)*q = t := by dsimp [q]; ring + norm_num only [Nat.cast_ofNat] at * + rw [htq] + calc + _ = ‖deriv f z‖^t*1 := by ring + _ = ‖deriv f z‖^t*(bracketSq (f z)^((-1-η)*q)*bracketSq (f z)^(a*(1-q))) := by + rw [← Real.rpow_add (bracketSq_pos _),he,Real.rpow_zero] + _ = _ := by ring + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/RankPairing.lean b/lean/OAI/Analysis/IntegralMeans/RankPairing.lean new file mode 100644 index 0000000000000000000000000000000000000000..ab24c97b3a03698ddd2779948930a2f426b69f14 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/RankPairing.lean @@ -0,0 +1,492 @@ +import OAI.Analysis.IntegralMeans.CriticalCount + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +instance diskClassSecondCountable : SecondCountableTopology DiskClass := inferInstanceAs (SecondCountableTopology diskSchlichtSet) + +lemma continuous_class_deriv : Continuous (fun p : DiskClass × halfPlane => deriv (classFun p.1) p.2) := by + simpa only [iteratedDeriv_one] using continuous_classJet_eval 1 + +lemma continuous_class_deriv_deriv : + Continuous (fun p : DiskClass × halfPlane => deriv (deriv (classFun p.1)) p.2) := by + simpa only [show 2 = 1+1 from rfl,iteratedDeriv_succ,iteratedDeriv_one,iteratedDeriv_zero] using continuous_classJet_eval 2 + +lemma continuous_class_criticalMap (k : ℝ) : + Continuous (fun p : DiskClass × halfPlane => criticalMap (classFun p.1) k p.2) := by + exact continuous_classFun_eval.sub ((continuous_const.mul + (Complex.continuous_ofReal.comp (Complex.continuous_im.comp + (continuous_subtype_val.comp continuous_snd)))).mul continuous_class_deriv) + +lemma continuous_class_fderiv_criticalMap (k : ℝ) : + Continuous (fun p : DiskClass × halfPlane => fderiv ℝ (criticalMap (classFun p.1) k) p.2) := by + let A : ℂ →L[ℝ] ℂ := 1 + let B : ℂ →L[ℝ] ℂ := Complex.ofRealCLM.comp Complex.imCLM + have he (p : DiskClass × halfPlane) : fderiv ℝ (criticalMap (classFun p.1) k) p.2 = + deriv (classFun p.1) p.2 • A - + (Complex.I / (k : ℂ) * (p.2.val.im : ℂ) * deriv (deriv (classFun p.1)) p.2) • A - + (Complex.I / (k : ℂ) * deriv (classFun p.1) p.2) • B := by + ext v + rw [fderiv_criticalMap_apply (classFun_schlicht p.1).1 p.2.property] + change _ = deriv (classFun p.1) p.2 * v - + (Complex.I / (k : ℂ) * (p.2.val.im : ℂ) * deriv (deriv (classFun p.1)) p.2) * v - + (Complex.I / (k : ℂ) * deriv (classFun p.1) p.2) * (v.im : ℂ) + ring + simp_rw [he] + have hy : Continuous (fun p : DiskClass × halfPlane => (p.2.val.im : ℂ)) := + Complex.continuous_ofReal.comp (Complex.continuous_im.comp (continuous_subtype_val.comp continuous_snd)) + exact ((continuous_class_deriv.smul continuous_const).sub + (((continuous_const.mul hy).mul continuous_class_deriv_deriv).smul continuous_const)).sub + ((continuous_const.mul continuous_class_deriv).smul continuous_const) + +lemma continuous_class_normalizedJacobian (k : ℝ) : + Continuous (fun p : DiskClass × halfPlane => normalizedJacobian (classFun p.1) k p.2) := by + apply (ContinuousLinearMap.continuous_det.comp (continuous_class_fderiv_criticalMap k)).div + (continuous_class_deriv.norm.pow 2) + intro p + exact pow_ne_zero _ (norm_ne_zero_iff.mpr + (univalent_deriv_ne_zero isOpen_halfPlane (classFun_schlicht p.1).1 p.2.property)) + +def criticalHeight (f : ℂ → ℂ) (k : ℝ) (z : ℂ) : ℝ := + k * z.im^(k-1) * ‖reciprocalDeriv f z‖ + +lemma criticalHeight_pos {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : 0 < k) + {z : ℂ} (hz : z ∈ halfPlane) : 0 < criticalHeight f k z := by + exact mul_pos (mul_pos hk (Real.rpow_pos_of_pos hz _)) + (norm_pos_iff.mpr (inv_ne_zero (univalent_deriv_ne_zero isOpen_halfPlane hf hz))) + +lemma continuous_class_criticalHeight (k : ℝ) : + Continuous (fun p : DiskClass × halfPlane => criticalHeight (classFun p.1) k p.2) := by + have hy : Continuous (fun p : DiskClass × halfPlane => p.2.val.im^(k-1)) := + (Complex.continuous_im.comp (continuous_subtype_val.comp continuous_snd)).rpow_const + (fun p => Or.inl (ne_of_gt p.2.property)) + have hh : Continuous (fun p : DiskClass × halfPlane => + k * p.2.val.im^(k-1) * ‖deriv (classFun p.1) p.2‖⁻¹) := + (continuous_const.mul hy).mul (continuous_class_deriv.norm.inv₀ + (fun p => norm_ne_zero_iff.mpr (univalent_deriv_ne_zero isOpen_halfPlane + (classFun_schlicht p.1).1 p.2.property))) + exact hh.congr (fun p => by simp only [criticalHeight,reciprocalDeriv,norm_inv]) + +lemma continuousOn_prod_of_continuous_subtype.{u_1, u_2, u_3} {P : Type u_1} {X : Type u_2} {Y : Type u_3} + [TopologicalSpace P] [TopologicalSpace X] [TopologicalSpace Y] + {s : Set X} {F : P → X → Y} + (hF : Continuous (fun q : P × s => F q.1 q.2)) : + ContinuousOn (fun q : P × X => F q.1 q.2) (univ ×ˢ s) := by + apply continuousOn_iff_continuous_domRestrict.mpr + exact hF.comp (continuous_subtype_val.fst.prodMk + (continuous_subtype_val.snd.subtype_mk (fun q => q.property.2))) + +lemma criticalMap_congr {f g : ℂ → ℂ} (he : EqOn f g halfPlane) (k : ℝ) : + EqOn (criticalMap f k) (criticalMap g k) halfPlane := by + intro z hz + rw [criticalMap,criticalMap,he hz,he.deriv isOpen_halfPlane hz] + +lemma normalizedJacobian_congr {f g : ℂ → ℂ} (he : EqOn f g halfPlane) (k : ℝ) : + EqOn (normalizedJacobian f k) (normalizedJacobian g k) halfPlane := by + intro z hz + have hG : criticalMap f k =ᶠ[𝓝 z] criticalMap g k := by + filter_upwards [isOpen_halfPlane.mem_nhds hz] with w hw + exact criticalMap_congr he k hw + rw [normalizedJacobian,normalizedJacobian,hG.fderiv_eq,he.deriv isOpen_halfPlane hz] + +lemma criticalHeight_congr {f g : ℂ → ℂ} (he : EqOn f g halfPlane) (k : ℝ) : + EqOn (criticalHeight f k) (criticalHeight g k) halfPlane := by + intro z hz + rw [criticalHeight,criticalHeight,reciprocalDeriv,reciprocalDeriv,he.deriv isOpen_halfPlane hz] + +lemma goodPair_congr {f g : ℂ → ℂ} (he : EqOn f g halfPlane) (k : ℝ) (ξ : ℂ) : + GoodPair f k ξ ↔ GoodPair g k ξ := by + have hs (δ : ℝ) : {z | z ∈ halfPlane ∧ ENNReal.ofReal δ ≤ potential f k ξ z} = + {z | z ∈ halfPlane ∧ ENNReal.ofReal δ ≤ potential g k ξ z} := by + ext z + by_cases hz : z ∈ halfPlane + · simp only [mem_ofPred_eq,hz,true_and,potential,he hz] + · simp only [mem_ofPred_eq,hz,false_and] + simp only [GoodPair,hs] + apply and_congr_right + intro _ + constructor <;> intro h z hz hG + · rw [← normalizedJacobian_congr he k hz] + exact h z hz ((criticalMap_congr he k hz).trans hG) + · rw [normalizedJacobian_congr he k hz] + exact h z hz ((criticalMap_congr he k hz).symm.trans hG) + +def affineHome (t : ℂ) (ht : t ∈ halfPlane) : ℂ ≃ₜ ℂ := + (Homeomorph.mulLeft₀ (t.im : ℂ) (Complex.ofReal_ne_zero.mpr (ne_of_gt ht))).trans + (Homeomorph.addLeft (t.re : ℂ)) + +lemma affineHome_apply (t : ℂ) (ht : t ∈ halfPlane) (z : ℂ) : + affineHome t ht z = affine t z := rfl + +lemma affine_mem_iff {t : ℂ} (ht : t ∈ halfPlane) (z : ℂ) : + affine t z ∈ halfPlane ↔ z ∈ halfPlane := by + change 0 < (affine t z).im ↔ 0 < z.im + simp only [affine,Complex.add_im,Complex.ofReal_im,Complex.mul_im,Complex.ofReal_re, + zero_mul,zero_add,add_zero] + exact mul_pos_iff_of_pos_left ht + +def rerootTarget (f : ℂ → ℂ) (t ξ : ℂ) : ℂ := + (ξ-f t)/((t.im : ℂ)*deriv f t) + +def heightScaleInverse (f : ℂ → ℂ) (k : ℝ) (t : ℂ) : ℝ := + t.im^(k-1) / ‖deriv f t‖ + +lemma heightScaleInverse_pos {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) (k : ℝ) + {t : ℂ} (ht : t ∈ halfPlane) : 0 < heightScaleInverse f k t := + div_pos (Real.rpow_pos_of_pos ht _) (norm_pos_iff.mpr (univalent_deriv_ne_zero isOpen_halfPlane hf ht)) + +lemma reciprocalPotential_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) (k : ℝ) + {t z : ℂ} (ht : t ∈ halfPlane) (hz : z ∈ halfPlane) (ξ : ℂ) : + reciprocalPotential (reroot f t) k (rerootTarget f t ξ) z = + heightScaleInverse f k t * reciprocalPotential f k ξ (affine t z) := by + have he : reroot f t z-rerootTarget f t ξ = + (f (affine t z)-ξ)/((t.im : ℂ)*deriv f t) := by + simp only [reroot,rerootTarget,← sub_div] + congr 1 + ring + have hn : ‖deriv f t‖ ≠ 0 := norm_ne_zero_iff.mpr (univalent_deriv_ne_zero isOpen_halfPlane hf ht) + have hpow : z.im^k ≠ 0 := ne_of_gt (Real.rpow_pos_of_pos hz k) + have him : (affine t z).im = t.im*z.im := by simp [affine] + rw [reciprocalPotential,he,norm_div,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos ht, + reciprocalPotential,him,Real.mul_rpow ht.le hz.le,heightScaleInverse,Real.rpow_sub_one (ne_of_gt ht)] + have htp : t.im^k ≠ 0 := ne_of_gt (Real.rpow_pos_of_pos ht _) + field_simp + +lemma criticalHeight_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) (k : ℝ) + {t z : ℂ} (ht : t ∈ halfPlane) (hz : z ∈ halfPlane) : + criticalHeight (reroot f t) k z = criticalHeight f k (affine t z) / heightScaleInverse f k t := by + have him : (affine t z).im = t.im*z.im := by simp [affine] + have hn : ‖deriv f t‖ ≠ 0 := norm_ne_zero_iff.mpr (univalent_deriv_ne_zero isOpen_halfPlane hf ht) + have hp : t.im^(k-1) ≠ 0 := ne_of_gt (Real.rpow_pos_of_pos ht _) + rw [criticalHeight,reciprocalDeriv_reroot hf ht hz,norm_div,criticalHeight,him, + Real.mul_rpow ht.le hz.le,heightScaleInverse] + simp only [reciprocalDeriv,norm_inv] + field_simp + +lemma criticalMap_reroot_fiber {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) (k : ℝ) + {t z : ℂ} (ht : t ∈ halfPlane) (hz : z ∈ halfPlane) (ξ : ℂ) : + criticalMap (reroot f t) k z = rerootTarget f t ξ ↔ criticalMap f k (affine t z) = ξ := by + rw [criticalMap_reroot hf ht hz,rerootTarget,div_left_inj' (mul_ne_zero + (Complex.ofReal_ne_zero.mpr (ne_of_gt ht)) (univalent_deriv_ne_zero isOpen_halfPlane hf ht)),sub_left_inj] + +lemma potential_level_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : 0 ≤ k) + {t : ℂ} (ht : t ∈ halfPlane) (ξ : ℂ) {δ : ℝ} (hδ : 0 < δ) : + {z | z ∈ halfPlane ∧ ENNReal.ofReal δ ≤ potential (reroot f t) k (rerootTarget f t ξ) z} = + (affineHome t ht) ⁻¹' {w | w ∈ halfPlane ∧ + ENNReal.ofReal (δ*heightScaleInverse f k t) ≤ potential f k ξ w} := by + have hc := heightScaleInverse_pos hf k ht + ext z + simp only [mem_ofPred_eq,mem_preimage,affineHome_apply,affine_mem_iff ht] + apply and_congr_right + intro hz + rw [potential_ge_iff_reciprocalPotential_le hk hδ hz, + potential_ge_iff_reciprocalPotential_le hk (mul_pos hδ hc) (affine_mem ht hz), + reciprocalPotential_reroot hf k ht hz ξ,mul_inv_rev] + rw [mul_comm,← le_div_iff₀ hc,div_eq_mul_inv] + rw [mul_comm δ⁻¹] + +lemma goodPair_reroot {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : 0 < k) + {t : ℂ} (ht : t ∈ halfPlane) (ξ : ℂ) : + GoodPair (reroot f t) k (rerootTarget f t ξ) ↔ GoodPair f k ξ := by + have hc := heightScaleInverse_pos hf k ht + constructor + · rintro ⟨hcompact,hregular⟩ + constructor + · intro δ hδ + have h := hcompact (δ/heightScaleInverse f k t) (div_pos hδ hc) + rw [potential_level_reroot hf hk.le ht ξ (div_pos hδ hc),div_mul_cancel₀ _ (ne_of_gt hc)] at h + exact (affineHome t ht).isCompact_preimage.mp h + · intro w hw hG + let z := (affineHome t ht).symm w + have he : affine t z = w := (affineHome t ht).apply_symm_apply w + have hz : z ∈ halfPlane := (affine_mem_iff ht z).mp (he.symm ▸ hw) + have hr := hregular z hz ((criticalMap_reroot_fiber hf k ht hz ξ).mpr (he.symm ▸ hG)) + rwa [normalizedJacobian_reroot hf ht hz k (ne_of_gt hk),he] at hr + · rintro ⟨hcompact,hregular⟩ + constructor + · intro δ hδ + rw [potential_level_reroot hf hk.le ht ξ hδ] + exact (affineHome t ht).isCompact_preimage.mpr (hcompact _ (mul_pos hδ hc)) + · intro z hz hG + rw [normalizedJacobian_reroot hf ht hz k (ne_of_gt hk)] + exact hregular _ (affine_mem ht hz) ((criticalMap_reroot_fiber hf k ht hz ξ).mp hG) + +def orderRank.{u_1} {α : Type u_1} [LinearOrder α] (S : Set α) (x : α) : ℕ := (S ∩ Iio x).ncard + +lemma orderRank_strictMonoOn.{u_1} {α : Type u_1} [LinearOrder α] {S : Set α} + (hfin : ∀ x ∈ S, (S ∩ Iio x).Finite) : StrictMonoOn (orderRank S) S := by + intro x hx y hy hxy + apply Set.ncard_lt_ncard _ (hfin y hy) + refine ssubset_iff_subset_ne.mpr ⟨?_,?_⟩ + · exact fun a ha => ⟨ha.1,ha.2.trans hxy⟩ + · intro he + have : x ∈ S ∩ Iio x := he ▸ (show x ∈ S ∩ Iio y from ⟨hx,hxy⟩) + exact lt_irrefl x this.2 + +lemma orderRank_injOn.{u_1} {α : Type u_1} [LinearOrder α] {S : Set α} + (hfin : ∀ x ∈ S, (S ∩ Iio x).Finite) : InjOn (orderRank S) S := + (orderRank_strictMonoOn hfin).injOn + +lemma orderRank_finset_enum.{u_1} {α : Type u_1} [LinearOrder α] (s : Finset α) + (j : Fin s.card) : orderRank (s : Set α) (s.orderEmbOfFin rfl j) = j.val := by + classical + let e := s.orderEmbOfFin rfl + have he : (s : Set α) ∩ Iio (e j) = e '' Iio j := by + ext a + constructor + · intro ha + obtain ⟨i,rfl⟩ := (s.range_orderEmbOfFin rfl).symm ▸ ha.1 + exact ⟨i,e.lt_iff_lt.mp ha.2,rfl⟩ + · rintro ⟨i,hi,rfl⟩ + exact ⟨s.orderEmbOfFin_mem rfl i,e.strictMono hi⟩ + rw [orderRank,he,Set.ncard_image_of_injective _ e.injective] + rw [← Finset.coe_Iio,Set.ncard_coe_finset,Fin.card_Iio] + +lemma exists_orderRank_of_finite_initial.{u_1} {α : Type u_1} [LinearOrder α] + {S A : Set α} (hA : A.Finite) (hAS : A ⊆ S) + (hinit : ∀ x ∈ A, ∀ y ∈ S, y < x → y ∈ A) + {j : ℕ} (hj : j < A.ncard) : ∃ x ∈ A, orderRank S x = j := by + classical + let s := hA.toFinset + have hscard : s.card = A.ncard := (Set.ncard_eq_toFinset_card A hA).symm + let x : α := s.orderEmbOfFin rfl ⟨j,by simpa [hscard] using hj⟩ + have hx : x ∈ A := hA.mem_toFinset.mp (s.orderEmbOfFin_mem rfl ⟨j,by simpa [hscard] using hj⟩) + refine ⟨x,hx,?_⟩ + have he : S ∩ Iio x = A ∩ Iio x := by + ext y + exact ⟨fun hy => ⟨hinit x hx y hy.1 hy.2,hy.2⟩,fun hy => ⟨hAS hy.1,hy.2⟩⟩ + calc + orderRank S x = orderRank A x := congrArg Set.ncard he + _ = j := by simpa only [s,Set.Finite.coe_toFinset] using + orderRank_finset_enum s ⟨j,by simpa [hscard] using hj⟩ + +def heightKey (H : ℂ → ℝ) (z : ℂ) : Lex (ℝ × Lex (ℝ × ℝ)) := + toLex (-H z,toLex (z.re,z.im)) + +lemma heightKey_injective (H : ℂ → ℝ) : Injective (heightKey H) := by + intro z w he + have he' := congrArg (fun a : Lex (ℝ × Lex (ℝ × ℝ)) => ofLex ((ofLex a).2)) he + exact Complex.ext (congrArg Prod.fst he') (congrArg Prod.snd he') + +@[instance_reducible] def heightOrder (H : ℂ → ℝ) : LinearOrder ℂ := LinearOrder.lift' (heightKey H) (heightKey_injective H) + +def heightRank (H : ℂ → ℝ) (S : Set ℂ) (z : ℂ) : ℕ := @orderRank ℂ (heightOrder H) S z + +def heightPrecedes (H : ℂ → ℝ) (z w : ℂ) : Prop := + H w < H z ∨ H z = H w ∧ (z.re < w.re ∨ z.re = w.re ∧ z.im < w.im) + +lemma heightOrder_lt_iff (H : ℂ → ℝ) (z w : ℂ) : + @LT.lt ℂ (heightOrder H).toLT z w ↔ heightPrecedes H z w := by + change heightKey H z < heightKey H w ↔ _ + simp only [heightKey,Prod.Lex.toLex_lt_toLex,neg_lt_neg_iff,neg_inj,heightPrecedes] + +lemma heightOrder_height_le {H : ℂ → ℝ} {z w : ℂ} + (h : @LT.lt ℂ (heightOrder H).toLT z w) : H w ≤ H z := by + rcases (heightOrder_lt_iff H z w).mp h with h | ⟨h,_⟩ + · exact h.le + · exact h.ge + +lemma heightRank_pred_finite {H : ℂ → ℝ} {S : Set ℂ} {z : ℂ} + (hfin : (S ∩ {w | H z ≤ H w}).Finite) : + @Set.Finite ℂ (S ∩ @Iio ℂ (heightOrder H).toPreorder z) := by + exact hfin.subset (fun w hw => ⟨hw.1,heightOrder_height_le hw.2⟩) + +lemma heightRank_lt_segment {H : ℂ → ℝ} {S : Set ℂ} {z : ℂ} (hz : z ∈ S) + (hfin : (S ∩ {w | H z ≤ H w}).Finite) : + heightRank H S z < (S ∩ {w | H z ≤ H w}).ncard := by + let _ := heightOrder H + apply Set.ncard_lt_ncard _ hfin + refine ssubset_iff_subset_ne.mpr ⟨fun w hw => ⟨hw.1,heightOrder_height_le hw.2⟩,?_⟩ + intro he + have : z ∈ S ∩ Iio z := he ▸ (show z ∈ S ∩ {w | H z ≤ H w} from ⟨hz,show H z ≤ H z from le_refl _⟩) + exact lt_irrefl z this.2 + +lemma exists_equal_heightRank {H : ℂ → ℝ} {A B : Set ℂ} {z : ℂ} + (hz : z ∈ A) (hAf : (A ∩ {w | H z ≤ H w}).Finite) + (hBf : (B ∩ {w | H z ≤ H w}).Finite) + (hc : (A ∩ {w | H z ≤ H w}).ncard ≤ (B ∩ {w | H z ≤ H w}).ncard) : + ∃ w ∈ B, H z ≤ H w ∧ heightRank H B w = heightRank H A z := by + let _ := heightOrder H + have hj := (heightRank_lt_segment hz hAf).trans_le hc + obtain ⟨w,hw,hr⟩ := exists_orderRank_of_finite_initial hBf inter_subset_left + (fun x hx y hy hyx => ⟨hy,hx.2.trans (heightOrder_height_le hyx)⟩) hj + exact ⟨w,hw.1,hw.2,hr⟩ + +lemma heightRank_injOn {H : ℂ → ℝ} {S : Set ℂ} + (hfin : ∀ z ∈ S, (S ∩ {w | H z ≤ H w}).Finite) : InjOn (heightRank H S) S := + @orderRank_injOn ℂ (heightOrder H) S (fun z hz => heightRank_pred_finite (hfin z hz)) + +lemma heightRank_eq_ncard (H : ℂ → ℝ) (S : Set ℂ) (z : ℂ) : + heightRank H S z = {w | w ∈ S ∧ heightPrecedes H w z}.ncard := by + let := heightOrder H + rw [heightRank,orderRank] + congr 1 + ext w + exact and_congr_right (fun _ => heightOrder_lt_iff H w z) + +lemma heightRank_transport {H H' : ℂ → ℝ} {S S' : Set ℂ} (e : ℂ ≃ ℂ) + (hS : ∀ z, z ∈ S' ↔ e z ∈ S) + (hord : ∀ z w, heightPrecedes H' z w ↔ heightPrecedes H (e z) (e w)) (z : ℂ) : + heightRank H' S' z = heightRank H S (e z) := by + rw [heightRank_eq_ncard,heightRank_eq_ncard] + apply Set.ncard_congr (fun w _ => e w) + · intro w hw + exact ⟨(hS w).mp hw.1,(hord w z).mp hw.2⟩ + · intro a b _ _ hab + exact e.injective hab + · intro w hw + refine ⟨e.symm w,⟨?_,?_⟩,e.apply_symm_apply w⟩ + · exact (hS _).mpr (by simpa using hw.1) + · exact (hord _ z).mpr (by simpa using hw.2) + +def rankPartner (H : ℂ → ℝ) (A B : Set ℂ) (z : ℂ) : ℂ := + if h : ∃ w ∈ B, heightRank H B w = heightRank H A z then h.choose else z + +lemma rankPartner_spec {H : ℂ → ℝ} {A B : Set ℂ} {z : ℂ} + (h : ∃ w ∈ B, heightRank H B w = heightRank H A z) : + rankPartner H A B z ∈ B ∧ + heightRank H B (rankPartner H A B z) = heightRank H A z := by + rw [rankPartner,dite_eq_left h] + exact h.choose_spec + +lemma rankPartner_eq {H : ℂ → ℝ} {A B : Set ℂ} {z w : ℂ} + (hri : InjOn (heightRank H B) B) (hw : w ∈ B) + (hr : heightRank H B w = heightRank H A z) : rankPartner H A B z = w := by + have hs := rankPartner_spec ⟨w,hw,hr⟩ + exact hri hs.1 hw (hs.2.trans hr.symm) + +lemma rankPartner_height {H : ℂ → ℝ} {A B : Set ℂ} {z : ℂ} + (hz : z ∈ A) (hAf : (A ∩ {w | H z ≤ H w}).Finite) + (hBf : (B ∩ {w | H z ≤ H w}).Finite) + (hc : (A ∩ {w | H z ≤ H w}).ncard ≤ (B ∩ {w | H z ≤ H w}).ncard) + (hri : InjOn (heightRank H B) B) : H z ≤ H (rankPartner H A B z) := by + obtain ⟨w,hw,hh,hr⟩ := exists_equal_heightRank hz hAf hBf hc + rw [rankPartner_eq hri hw hr] + exact hh + +lemma rankPartner_injOn {H : ℂ → ℝ} {A B : Set ℂ} + (he : ∀ z ∈ A, ∃ w ∈ B, heightRank H B w = heightRank H A z) + (hri : InjOn (heightRank H A) A) : InjOn (rankPartner H A B) A := by + intro z hz w hw heq + apply hri hz hw + rw [← (rankPartner_spec (he z hz)).2,← (rankPartner_spec (he w hw)).2,heq] + +def positiveFiber (f : ℂ → ℂ) (k : ℝ) (ξ : ℂ) : Set ℂ := + {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ 0 < normalizedJacobian f k z} + +def negativeFiber (f : ℂ → ℂ) (k : ℝ) (ξ : ℂ) : Set ℂ := + {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ normalizedJacobian f k z < 0} + +lemma criticalHeight_count {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : 0 < k) + {ξ : ℂ} (hg : GoodPair f k ξ) {h : ℝ} (hh : 0 < h) : + (positiveFiber f k ξ ∩ {z | h ≤ criticalHeight f k z}).Finite ∧ + (negativeFiber f k ξ ∩ {z | h ≤ criticalHeight f k z}).Finite ∧ + (positiveFiber f k ξ ∩ {z | h ≤ criticalHeight f k z}).ncard ≤ + (negativeFiber f k ξ ∩ {z | h ≤ criticalHeight f k z}).ncard := by + have he : {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ + ENNReal.ofReal h ≤ potential f k ξ z} = + {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ h ≤ criticalHeight f k z} := by + ext z + constructor + · rintro ⟨hz,hG,hv⟩ + refine ⟨hz,hG,?_⟩ + rw [potential_critical_height hf hk hz hG] at hv + exact (ENNReal.ofReal_le_ofReal_iff (criticalHeight_pos hf hk hz).le).mp hv + · rintro ⟨hz,hG,hv⟩ + refine ⟨hz,hG,?_⟩ + rw [potential_critical_height hf hk hz hG] + exact ENNReal.ofReal_le_ofReal hv + have hc := critical_count hf hk hg hh + dsimp only at hc + rw [he] at hc + have hp : {z ∈ {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ h ≤ criticalHeight f k z} | + 0 < normalizedJacobian f k z} = positiveFiber f k ξ ∩ {z | h ≤ criticalHeight f k z} := by + ext z + simp only [mem_ofPred_eq,mem_inter_iff,positiveFiber] + tauto + have hn : {z ∈ {z | z ∈ halfPlane ∧ criticalMap f k z = ξ ∧ h ≤ criticalHeight f k z} | + normalizedJacobian f k z < 0} = negativeFiber f k ξ ∩ {z | h ≤ criticalHeight f k z} := by + ext z + simp only [mem_ofPred_eq,mem_inter_iff,negativeFiber] + tauto + refine ⟨hc.1.subset (fun z hz => ⟨hz.1.1,hz.1.2.1,hz.2⟩), + hc.1.subset (fun z hz => ⟨hz.1.1,hz.1.2.1,hz.2⟩),?_⟩ + rw [hp,hn] at hc + exact hc.2 + +lemma criticalHeight_rank_inj {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : 0 < k) + {ξ : ℂ} (hg : GoodPair f k ξ) : + InjOn (heightRank (criticalHeight f k) (positiveFiber f k ξ)) (positiveFiber f k ξ) ∧ + InjOn (heightRank (criticalHeight f k) (negativeFiber f k ξ)) (negativeFiber f k ξ) := by + constructor + · exact heightRank_injOn (fun z hz => + (criticalHeight_count hf hk hg (criticalHeight_pos hf hk hz.1)).1) + · exact heightRank_injOn (fun z hz => + (criticalHeight_count hf hk hg (criticalHeight_pos hf hk hz.1)).2.1) + +lemma exists_critical_equalRank {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : 0 < k) + {ξ : ℂ} (hg : GoodPair f k ξ) {z : ℂ} (hz : z ∈ positiveFiber f k ξ) : + ∃ w ∈ negativeFiber f k ξ, criticalHeight f k z ≤ criticalHeight f k w ∧ + heightRank (criticalHeight f k) (negativeFiber f k ξ) w = + heightRank (criticalHeight f k) (positiveFiber f k ξ) z := by + have hc := criticalHeight_count hf hk hg (criticalHeight_pos hf hk hz.1) + exact exists_equal_heightRank hz hc.1 hc.2.1 hc.2.2 + +def criticalPair (f : ℂ → ℂ) (k : ℝ) (z : ℂ) : ℂ := + rankPartner (criticalHeight f k) (positiveFiber f k (criticalMap f k z)) + (negativeFiber f k (criticalMap f k z)) z + +lemma criticalPair_spec {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : 0 < k) + {z : ℂ} (hz : z ∈ halfPlane) (hJ : 0 < normalizedJacobian f k z) + (hg : GoodPair f k (criticalMap f k z)) : + criticalPair f k z ∈ halfPlane ∧ criticalMap f k (criticalPair f k z) = criticalMap f k z ∧ + normalizedJacobian f k (criticalPair f k z) < 0 ∧ + criticalHeight f k z ≤ criticalHeight f k (criticalPair f k z) := by + obtain ⟨w,hw,hh,hr⟩ := exists_critical_equalRank hf hk hg ⟨hz,rfl,hJ⟩ + have he : criticalPair f k z = w := rankPartner_eq (criticalHeight_rank_inj hf hk hg).2 hw hr + rw [he] + exact ⟨hw.1,hw.2.1,hw.2.2,hh⟩ + +lemma criticalPair_injective {f : ℂ → ℂ} (hf : UnivalentOn f halfPlane) {k : ℝ} (hk : 0 < k) : + InjOn (criticalPair f k) {z | z ∈ halfPlane ∧ 0 < normalizedJacobian f k z ∧ + GoodPair f k (criticalMap f k z)} := by + intro z hz w hw he + have hsz := criticalPair_spec hf hk hz.1 hz.2.1 hz.2.2 + have hsw := criticalPair_spec hf hk hw.1 hw.2.1 hw.2.2 + have hG : criticalMap f k z = criticalMap f k w := by rw [← hsz.2.1,he,hsw.2.1] + have hri := (criticalHeight_rank_inj hf hk hz.2.2).1 + have hze := exists_critical_equalRank hf hk hz.2.2 (show z ∈ positiveFiber f k (criticalMap f k z) from ⟨hz.1,rfl,hz.2.1⟩) + have hwe := exists_critical_equalRank hf hk hz.2.2 (show w ∈ positiveFiber f k (criticalMap f k z) from ⟨hw.1,hG.symm,hw.2.1⟩) + have hzr := rankPartner_spec (show ∃ v ∈ negativeFiber f k (criticalMap f k z), + heightRank (criticalHeight f k) (negativeFiber f k (criticalMap f k z)) v = + heightRank (criticalHeight f k) (positiveFiber f k (criticalMap f k z)) z from by + obtain ⟨v,hv,_,hr⟩ := hze; exact ⟨v,hv,hr⟩) + have hwr := rankPartner_spec (show ∃ v ∈ negativeFiber f k (criticalMap f k z), + heightRank (criticalHeight f k) (negativeFiber f k (criticalMap f k z)) v = + heightRank (criticalHeight f k) (positiveFiber f k (criticalMap f k z)) w from by + obtain ⟨v,hv,_,hr⟩ := hwe; exact ⟨v,hv,hr⟩) + apply hri ⟨hz.1,rfl,hz.2.1⟩ ⟨hw.1,hG.symm,hw.2.1⟩ + rw [← hzr.2,← hwr.2] + apply congrArg + simpa only [criticalPair,← hG] using he + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/SectorDivergence.lean b/lean/OAI/Analysis/IntegralMeans/SectorDivergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..413358e14bfec9aacd9459c4ffbcf8a4e320dbab --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/SectorDivergence.lean @@ -0,0 +1,78 @@ +import Mathlib.Analysis.SpecialFunctions.PolarCoord +import Mathlib.Analysis.SpecialFunctions.Integrability.Basic +import Mathlib.MeasureTheory.Measure.Prod +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal + +namespace Brennan.Sector + +theorem lintegral_inv_Ioo_eq_top (R : ℝ) (hR : 0 < R) : + (∫⁻ r in Ioo (0 : ℝ) R, ENNReal.ofReal r⁻¹) = ⊤ := by + by_contra h + have hn : 0 ≤ᵐ[volume.restrict (Ioo (0 : ℝ) R)] (fun r : ℝ => r⁻¹) := by + filter_upwards [ae_restrict_mem measurableSet_Ioo] with r hr + exact inv_nonneg.mpr hr.1.le + have hf : HasFiniteIntegral (fun r : ℝ => r⁻¹) (volume.restrict (Ioo (0 : ℝ) R)) := + (hasFiniteIntegral_iff_ofReal hn).2 (lt_top_iff_ne_top.mpr h) + have hi : IntegrableOn (fun r : ℝ => r⁻¹) (Ioo (0 : ℝ) R) := + ⟨measurable_inv.aestronglyMeasurable, hf⟩ + have hp : IntegrableOn (fun r : ℝ => r ^ (-1 : ℝ)) (Ioo (0 : ℝ) R) := by + simpa only [Real.rpow_neg_one] using hi + exact (lt_irrefl (-1 : ℝ)) ((intervalIntegral.integrableOn_Ioo_rpow_iff hR).mp hp) + +theorem lintegral_eq_top_of_sector_lower_bound (f : ℂ → ℝ≥0∞) + (R a b c : ℝ) (hR : 0 < R) (hab : a < b) (hc : 0 < c) + (ha : -Real.pi ≤ a) (hb : b ≤ Real.pi) + (hlower : ∀ r ∈ Ioo (0 : ℝ) R, ∀ θ ∈ Ioo a b, + ENNReal.ofReal (c / r ^ 2) ≤ f (Complex.polarCoord.symm (r, θ))) : + (∫⁻ z, f z) = ⊤ := by + let box : Set (ℝ × ℝ) := Ioo (0 : ℝ) R ×ˢ Ioo a b + let radial : ℝ × ℝ → ℝ≥0∞ := fun p => ENNReal.ofReal c * ENNReal.ofReal p.1⁻¹ + have hradial : Measurable radial := + measurable_const.mul (ENNReal.measurable_ofReal.comp measurable_fst.inv) + have hcinv : (∫⁻ r in Ioo (0 : ℝ) R, ENNReal.ofReal c * ENNReal.ofReal r⁻¹) = ⊤ := by + have hmeas : Measurable (fun r : ℝ => ENNReal.ofReal r⁻¹) := + ENNReal.measurable_ofReal.comp measurable_inv + rw [lintegral_const_mul (ENNReal.ofReal c) hmeas, + lintegral_inv_Ioo_eq_top R hR, + ENNReal.mul_top (ne_of_gt (ENNReal.ofReal_pos.mpr hc))] + have hbox : (∫⁻ p in box, radial p) = ⊤ := by + change (∫⁻ p in Ioo (0 : ℝ) R ×ˢ Ioo a b, radial p ∂volume.prod volume) = ⊤ + rw [setLIntegral_prod_symm _ hradial.aemeasurable] + simp only [radial, hcinv] + rw [lintegral_const, Measure.restrict_apply_univ, Real.volume_Ioo, + ENNReal.top_mul (ne_of_gt (ENNReal.ofReal_pos.mpr (sub_pos.mpr hab)))] + have hsub : box ⊆ polarCoord.target := by + rw [polarCoord_target] + intro p hp + exact ⟨hp.1.1, lt_of_le_of_lt ha hp.2.1, lt_of_lt_of_le hp.2.2 hb⟩ + have hlower' (p : ℝ × ℝ) (hp : p ∈ box) : + radial p ≤ ENNReal.ofReal p.1 • f (Complex.polarCoord.symm p) := by + have hr : 0 < p.1 := hp.1.1 + have hid : ENNReal.ofReal c * ENNReal.ofReal p.1⁻¹ = + ENNReal.ofReal p.1 * ENNReal.ofReal (c / p.1 ^ 2) := by + rw [← ENNReal.ofReal_mul hc.le, ← ENNReal.ofReal_mul hr.le] + congr 1 + field_simp [ne_of_gt hr] + change ENNReal.ofReal c * ENNReal.ofReal p.1⁻¹ ≤ + ENNReal.ofReal p.1 * f (Complex.polarCoord.symm p) + rw [hid] + exact mul_le_mul_right (hlower p.1 hp.1 p.2 hp.2) _ + apply top_unique + calc + ⊤ = ∫⁻ p in box, radial p := hbox.symm + _ ≤ ∫⁻ p in box, ENNReal.ofReal p.1 • f (Complex.polarCoord.symm p) := + setLIntegral_mono' (measurableSet_Ioo.prod measurableSet_Ioo) hlower' + _ ≤ ∫⁻ p in polarCoord.target, ENNReal.ofReal p.1 • f (Complex.polarCoord.symm p) := + lintegral_mono_set hsub + _ = ∫⁻ z, f z := Complex.lintegral_comp_polarCoord_symm f + +end Brennan.Sector + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/SharpEndpoints.lean b/lean/OAI/Analysis/IntegralMeans/SharpEndpoints.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c18bfd8f6cf424fd70f7081eb246432d8f3919f --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/SharpEndpoints.lean @@ -0,0 +1,33 @@ +import OAI.Analysis.IntegralMeans.Main +import OAI.Analysis.IntegralMeans.InverseMoment +import OAI.Analysis.IntegralMeans.KoebeDivergence + +namespace OAI + +noncomputable section +open Set MeasureTheory +open scoped ENNReal +namespace Brennan.Sharp + +lemma koebe_inverse_four_area : areaMoment koebeInverse koebeDomain 4 = ⊤ := by + rw [koebe_inverse_areaMoment] + norm_num + exact koebe_negative_endpoint_area + +lemma koebe_inverse_four_thirds_area : + areaMoment koebeInverse koebeDomain (4 / 3) = ⊤ := by + rw [koebe_inverse_areaMoment] + norm_num + exact koebe_positive_endpoint_area + +theorem sharp_endpoints : SharpEndpointStatement := by + refine ⟨koebeMap_schlicht, koebe_negative_endpoint_area, + koebe_positive_endpoint_area, ?_, ?_⟩ + · exact not_integrable_of_areaMoment_top koebe_inverse_four_area + · exact not_integrable_of_areaMoment_top koebe_inverse_four_thirds_area + +end Brennan.Sharp + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/SharpModel.lean b/lean/OAI/Analysis/IntegralMeans/SharpModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..1446a94261b6ad499d4877056190d0ea58e8a11c --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/SharpModel.lean @@ -0,0 +1,29 @@ +import OAI.Analysis.IntegralMeans.Model +import OAI.Analysis.IntegralMeans.Koebe + +namespace OAI + +noncomputable section +open Set MeasureTheory +open scoped ENNReal +namespace Brennan.Sharp + +def koebeDomain : Set ℂ := koebeMap '' disk + +def koebeInverse : ℂ → ℂ := Function.invFunOn koebeMap disk + +def areaMoment (f : ℂ → ℂ) (U : Set ℂ) (t : ℝ) : ℝ≥0∞ := + ∫⁻ z in U, ENNReal.ofReal (‖deriv f z‖ ^ t) ∂volume + +def SharpEndpointStatement : Prop := + Schlicht koebeMap ∧ + areaMoment koebeMap disk (-2) = ⊤ ∧ + areaMoment koebeMap disk (2 / 3) = ⊤ ∧ + ¬ IntegrableOn (fun z => ‖deriv koebeInverse z‖ ^ (4 : ℝ)) koebeDomain volume ∧ + ¬ IntegrableOn (fun z => ‖deriv koebeInverse z‖ ^ (4 / 3 : ℝ)) koebeDomain volume + +end Brennan.Sharp + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/SmoothMeans.lean b/lean/OAI/Analysis/IntegralMeans/SmoothMeans.lean new file mode 100644 index 0000000000000000000000000000000000000000..79a26d77e03e2860cbecea982baec8268dfb0721 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/SmoothMeans.lean @@ -0,0 +1,311 @@ +import OAI.Analysis.IntegralMeans.TraceBounds + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +def logDisk (z : ℂ) : ℂ := Complex.exp (z*Complex.I) + +lemma logDisk_norm (z : ℂ) : ‖logDisk z‖ = Real.exp (-z.im) := by + simp [logDisk,Complex.norm_exp] + +lemma logDisk_mem_disk {z : ℂ} (hz : 0 < z.im) : logDisk z ∈ disk := by + simp only [disk,Metric.mem_ball,dist_zero_right,logDisk_norm] + exact Real.exp_lt_one_iff.mpr (by linarith) + +lemma logDisk_analytic (z : ℂ) : AnalyticAt ℂ logDisk z := by + exact (analyticAt_cexp).comp ((analyticAt_id.mul analyticAt_const)) + +lemma logDisk_injOn : InjOn logDisk {z : ℂ | -Real.pi < z.re ∧ z.re < Real.pi} := by + intro z hz w hw h + have he := Complex.exp_inj_of_neg_pi_lt_of_le_pi + (by simpa using hz.1 : -Real.pi < (z*Complex.I).im) + (by simpa using hz.2.le : (z*Complex.I).im ≤ Real.pi) + (by simpa using hw.1 : -Real.pi < (w*Complex.I).im) + (by simpa using hw.2.le : (w*Complex.I).im ≤ Real.pi) h + exact mul_right_cancel₀ Complex.I_ne_zero he + +lemma logDisk_realProd (x y : ℝ) : + logDisk (Complex.equivRealProdCLM.symm (x,y)) = circlePoint (Real.exp (-y)) x := by + rw [logDisk,Complex.equivRealProdCLM_symm_apply] + have he : ((x:ℂ)+y*Complex.I)*Complex.I = (-y:ℂ)+(x:ℂ)*Complex.I := by rw [add_mul,mul_assoc,Complex.I_mul_I]; ring + rw [he,Complex.exp_add,← Complex.ofReal_neg,← Complex.ofReal_exp] + rfl + +lemma logDisk_periodic (z : ℂ) : logDisk (z+2*Real.pi) = logDisk z := by + simp only [logDisk,add_mul,Complex.exp_add,Complex.exp_two_pi_mul_I,mul_one] + +lemma logStrip_smooth_periodic_side (H : ℂ → ℝ) (y : ℝ) : + fderiv ℝ ((H ∘ logDisk) ∘ Complex.equivRealProdCLM.symm) (-Real.pi,y) (1,0) = + fderiv ℝ ((H ∘ logDisk) ∘ Complex.equivRealProdCLM.symm) (Real.pi,y) (1,0) := by + let g := (H ∘ logDisk) ∘ Complex.equivRealProdCLM.symm + have he : (fun p : ℝ × ℝ => g (p+(2*Real.pi,0))) = g := by + ext p + dsimp [g] + have hz : Complex.equivRealProdCLM.symm ((p.1,p.2)+(2*Real.pi,0)) = + Complex.equivRealProdCLM.symm p+2*Real.pi := by + simp [Complex.equivRealProdCLM_symm_apply] + ring + rw [hz,logDisk_periodic] + have hd := congrArg (fun L : (ℝ × ℝ) →L[ℝ] ℝ => L (1,0)) + (fderiv_comp_add_right (𝕜 := ℝ) (f := g) (x := (-Real.pi,y)) (2*Real.pi,0)) + rw [he] at hd + have hp : (-Real.pi,y)+(2*Real.pi,0) = (Real.pi,y) := by + ext <;> dsimp <;> ring + simpa only [hp] using hd + +lemma exp_boundary_lower {y : ℝ} (hy : 0 < y) (hy1 : y ≤ 1) : y/2 ≤ 1-Real.exp (-y) := by + have he := Real.add_one_le_exp y + have hp := Real.exp_pos y + have hn : Real.exp (-y) = (Real.exp y)⁻¹ := Real.exp_neg y + rw [hn] + have hi : (Real.exp y)⁻¹ ≤ (1+y)⁻¹ := inv_anti₀ (by linarith) (by linarith) + have hden : 0 < 1+y := by linarith + have hf : y/2 ≤ 1-(1+y)⁻¹ := by + rw [inv_eq_one_div] + have hh : 1/(1+y) ≤ 1-y/2 := (div_le_iff₀ hden).mpr (by nlinarith) + linarith + linarith + +lemma logStrip_height_bound {f : ℂ → ℂ} (hf : Schlicht f) {z : ℂ} + (hz : 0 < z.im) (hz1 : z.im ≤ 1) : + z.im ≤ 3*(1+‖f (logDisk z)‖^2)^(-1/4:ℝ) := by + let y := z.im + let r := Real.exp (-y) + have hy : 0 < y := hz + have hyr : r < 1 := Real.exp_lt_one_iff.mpr (by dsimp [y]; linarith) + have hr : 0 < r := Real.exp_pos _ + have hd : 0 < 1-r := by linarith + have hg := schlicht_growth_upper hf (logDisk_mem_disk hz) + rw [logDisk_norm] at hg + change ‖f (logDisk z)‖ ≤ r/(1-r)^2 at hg + have hb : ‖f (logDisk z)‖ ≤ 4/y^2 := by + have hyb := exp_boundary_lower hy hz1 + change y/2 ≤ 1-r at hyb + calc + ‖f (logDisk z)‖ ≤ r/(1-r)^2 := hg + _ ≤ 1/(y/2)^2 := div_le_div₀ (by norm_num) hyr.le (by positivity) (by nlinarith) + _ = 4/y^2 := by field_simp; ring + have hy4 : y^4 ≤ 1 := pow_le_one₀ hy.le hz1 + have hs : (1+‖f (logDisk z)‖^2)*y^4 ≤ 17 := by + have hb' : ‖f (logDisk z)‖*y^2 ≤ 4 := (le_div_iff₀ (sq_pos_of_pos hy)).mp hb + have hsquare := pow_le_pow_left₀ (by positivity : 0 ≤ ‖f (logDisk z)‖*y^2) hb' 2 + nlinarith [hsquare] + have hbase : 0 < 1+‖f (logDisk z)‖^2 := by positivity + have hpow := Real.rpow_le_rpow (by positivity : 0 ≤ (1+‖f (logDisk z)‖^2)*y^4) hs (by norm_num : (0:ℝ) ≤ 1/4) + rw [Real.mul_rpow (by positivity) (by positivity),← Real.rpow_natCast y 4, + ← Real.rpow_mul hy.le] at hpow + norm_num at hpow + have h17 : (17:ℝ)^(1/4:ℝ) ≤ 3 := by + calc + (17:ℝ)^(1/4:ℝ) ≤ (81:ℝ)^(1/4:ℝ) := Real.rpow_le_rpow (by norm_num) (by norm_num) (by norm_num) + _ = 3 := by rw [show (81:ℝ) = 3^(4:ℝ) by norm_num,← Real.rpow_mul (by norm_num)]; norm_num + have hmul : y*(1+‖f (logDisk z)‖^2)^(1/4:ℝ) ≤ 3 := by nlinarith + have hpos := Real.rpow_pos_of_pos hbase (1/4:ℝ) + rw [show (-1/4:ℝ) = -(1/4) by ring,Real.rpow_neg hbase.le,← div_eq_mul_inv] + exact (le_div_iff₀ hpos).mpr hmul + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology +namespace Brennan + +def bracketSq (z : ℂ) : ℝ := 1+z.re^2+z.im^2 + +def smoothPower (q : ℝ) (z : ℂ) : ℝ := bracketSq z ^ q + +lemma bracketSq_eq (z : ℂ) : bracketSq z = 1+‖z‖^2 := by + rw [Complex.sq_norm] + simp [bracketSq,Complex.normSq_apply,pow_two,add_assoc] + +lemma bracketSq_pos (z : ℂ) : 0 < bracketSq z := by rw [bracketSq_eq]; positivity + +lemma bracketSq_contDiff (n : ℕ∞) : ContDiff ℝ n bracketSq := by + exact (contDiff_const.add (Complex.reCLM.contDiff.pow 2)).add (Complex.imCLM.contDiff.pow 2) + +lemma smoothPower_contDiff (q : ℝ) (n : ℕ∞) : ContDiff ℝ n (smoothPower q) := + (bracketSq_contDiff n).rpow_const_of_ne (fun z => (bracketSq_pos z).ne') + +def bracketSqDeriv (z : ℂ) : ℂ →L[ℝ] ℝ := + (2*z.re) • Complex.reCLM + (2*z.im) • Complex.imCLM + +lemma bracketSq_hasFDerivAt (z : ℂ) : HasFDerivAt bracketSq (bracketSqDeriv z) z := by + have h := (((Complex.reCLM.hasFDerivAt (x := z)).pow 2).const_add 1).add + ((Complex.imCLM.hasFDerivAt (x := z)).pow 2) + convert! h using 1 + simp [bracketSqDeriv] + +lemma smoothPower_hasFDerivAt (q : ℝ) (z : ℂ) : + HasFDerivAt (smoothPower q) ((q*bracketSq z^(q-1)) • bracketSqDeriv z) z := + (bracketSq_hasFDerivAt z).rpow_const (Or.inl (bracketSq_pos z).ne') + +lemma bracketSqDeriv_hasFDerivAt (z : ℂ) : HasFDerivAt bracketSqDeriv + ((ContinuousLinearMap.smulRight Complex.reCLM (2 • Complex.reCLM))+ + (ContinuousLinearMap.smulRight Complex.imCLM (2 • Complex.imCLM))) z := by + have h := (((Complex.reCLM.hasFDerivAt (x := z)).const_mul 2).smul_const Complex.reCLM).add + (((Complex.imCLM.hasFDerivAt (x := z)).const_mul 2).smul_const Complex.imCLM) + convert! h using 1 + ext v w + simp [ContinuousLinearMap.smulRight_apply,smul_eq_mul] + ring + +lemma smoothPower_secondReal (q : ℝ) (z u v : ℂ) : + secondReal (smoothPower q) z u v = + q*(q-1)*bracketSq z^(q-2)*(2*z.re*u.re+2*z.im*u.im)*(2*z.re*v.re+2*z.im*v.im)+ + q*bracketSq z^(q-1)*(2*u.re*v.re+2*u.im*v.im) := by + have he : fderiv ℝ (smoothPower q) = fun z => (q*bracketSq z^(q-1)) • bracketSqDeriv z := + funext (fun z => (smoothPower_hasFDerivAt q z).fderiv) + have hscalar := ((bracketSq_hasFDerivAt z).rpow_const (p := q-1) (Or.inl (bracketSq_pos z).ne')).const_mul q + have hd := (hscalar.smul (bracketSqDeriv_hasFDerivAt z)).fderiv + change fderiv ℝ (fun z => (q*bracketSq z^(q-1)) • bracketSqDeriv z) z = _ at hd + rw [secondReal,he,hd] + simp [bracketSqDeriv,ContinuousLinearMap.smulRight_apply,smul_eq_mul,show q-1-1=q-2 by ring] + ring + +lemma laplacian_smoothPower (q : ℝ) (z : ℂ) : + Laplacian.laplacian (smoothPower q) z = + 4*q*bracketSq z^(q-2)*(1+q*‖z‖^2) := by + rw [laplacian_eq_secondReal,smoothPower_secondReal,smoothPower_secondReal] + have he : bracketSq z^(q-1) = bracketSq z^(q-2)*bracketSq z := by + simpa only [show q-2+1=q-1 by ring,Real.rpow_one] using Real.rpow_add (bracketSq_pos z) (q-2) 1 + rw [he,Complex.sq_norm] + simp [Complex.normSq_apply,bracketSq] + ring + +lemma laplacian_smoothPower_bounds {q : ℝ} (hq : 0 ≤ q) (hq1 : q ≤ 1) (z : ℂ) : + 0 ≤ Laplacian.laplacian (smoothPower q) z ∧ + Laplacian.laplacian (smoothPower q) z ≤ 4*q*bracketSq z^(q-1) := by + have hz := bracketSq_pos z + rw [laplacian_smoothPower] + constructor + · positivity + · have he : bracketSq z^(q-1) = bracketSq z^(q-2)*bracketSq z := by + simpa only [show q-2+1=q-1 by ring,Real.rpow_one] using Real.rpow_add (bracketSq_pos z) (q-2) 1 + rw [he,← mul_assoc] + apply mul_le_mul_of_nonneg_left _ (by positivity) + rw [bracketSq_eq] + nlinarith [sq_nonneg ‖z‖] + +lemma bracketSq_decay_integrable {q : ℝ} (hq : q < 1/4) : + Integrable (fun z : ℂ => bracketSq z^(q-5/4)) := by + have h := integrable_rpow_neg_one_add_norm_sq (E := ℂ) (μ := volume) (r := 5/2-2*q) + (by norm_num [Complex.finrank_real_complex]; linarith) + convert! h using 1 + ext z + rw [bracketSq_eq] + congr 1 + ring + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +lemma schlicht_smooth_trace {f : ℂ → ℂ} (hf : Schlicht f) {q : ℝ} + (hq : 0 < q) (hq4 : q < 1/4) : + ∃ C : ℝ, ∀ y : ℝ, 0 < y → y ≤ 1 → + (∫ x in -Real.pi..Real.pi, smoothPower q (f (logDisk (x+y*Complex.I)))) ≤ C := by + let F : ℂ → ℂ := f ∘ logDisk + have hF (z : ℂ) (hz : 0 < z.im) : AnalyticAt ℂ F z := + ((hf.1.1.analyticOnNhd Metric.isOpen_ball _ (logDisk_mem_disk hz)).comp (logDisk_analytic z)) + apply periodic_conformal_trace_bounded (F := F) (ψ := smoothPower q) + (b := fun w => bracketSq w^(q-5/4)) (K := 12*q) hF + · intro z hz w hw he + apply logDisk_injOn ⟨hz.1,hz.2.1⟩ ⟨hw.1,hw.2.1⟩ + exact hf.1.2 (logDisk_mem_disk hz.2.2) (logDisk_mem_disk hw.2.2) he + · exact smoothPower_contDiff q 2 + · exact bracketSq_decay_integrable hq4 + · intro w + exact Real.rpow_nonneg (bracketSq_pos w).le _ + · positivity + · intro y _hy + exact logStrip_smooth_periodic_side (smoothPower q ∘ f) y + · intro z hz hz1 + rw [laplacian_holomorphic_comp (smoothPower_contDiff q 2).contDiffAt (hF z hz)] + have hl := laplacian_smoothPower_bounds hq.le (by linarith) (F z) + have hy := logStrip_height_bound hf hz hz1 + rw [← bracketSq_eq] at hy + change z.im ≤ 3*bracketSq (F z)^(-1/4:ℝ) at hy + constructor + · exact mul_nonneg (sq_nonneg _) hl.1 + · calc + _ ≤ (3*bracketSq (F z)^(-1/4:ℝ)) * (‖deriv F z‖^2*(4*q*bracketSq (F z)^(q-1))) := + mul_le_mul hy (mul_le_mul_of_nonneg_left hl.2 (sq_nonneg _)) + (mul_nonneg (sq_nonneg _) hl.1) (mul_nonneg (by norm_num) (Real.rpow_nonneg (bracketSq_pos _).le _)) + _ = _ := by + have he : bracketSq (F z)^(-1/4:ℝ)*bracketSq (F z)^(q-1) = bracketSq (F z)^(q-5/4) := by + rw [← Real.rpow_add (bracketSq_pos _)] + congr 1 + ring + calc + _ = (12*q*‖deriv F z‖^2)*(bracketSq (F z)^(-1/4:ℝ)*bracketSq (F z)^(q-1)) := by ring + _ = _ := by rw [he] + +lemma continuous_circle_smoothPower {f : ℂ → ℂ} (hf : Schlicht f) (q r : ℝ) + (hr : 0 ≤ r) (hr1 : r < 1) : Continuous (fun θ => smoothPower q (f (circlePoint r θ))) := by + apply (smoothPower_contDiff q 0).continuous.comp + apply hf.1.1.continuousOn.comp_continuous (show Continuous (circlePoint r) from by unfold circlePoint; fun_prop) + intro θ + simpa only [disk,Metric.mem_ball,dist_zero_right,circlePoint_norm,abs_of_nonneg hr] using hr1 + +lemma schlicht_smooth_means {f : ℂ → ℂ} (hf : Schlicht f) {q : ℝ} + (hq : 0 < q) (hq4 : q < 1/4) : + ∃ C : ℝ, 0 < C ∧ ∀ r : ℝ, 0 < r → r < 1 → + (∫ θ in -Real.pi..Real.pi, smoothPower q (f (circlePoint r θ))) ≤ C := by + obtain ⟨C,hC⟩ := schlicht_smooth_trace hf hq hq4 + refine ⟨|C|+2*Real.pi*(5:ℝ)^q+1,by positivity,fun r hr hr1 => ?_⟩ + by_cases hrh : r ≤ 1/2 + · have hb (θ : ℝ) : smoothPower q (f (circlePoint r θ)) ≤ (5:ℝ)^q := by + have hm : circlePoint r θ ∈ disk := by + simpa [disk,circlePoint_norm,abs_of_pos hr] using hr1 + have hg := schlicht_growth_upper hf hm + rw [circlePoint_norm,abs_of_pos hr] at hg + have hv : ‖f (circlePoint r θ)‖ ≤ 2 := by + have hd : 0 < (1-r)^2 := sq_pos_of_pos (by linarith) + have hh : r/(1-r)^2 ≤ 2 := (div_le_iff₀ hd).mpr (by nlinarith) + exact hg.trans hh + apply Real.rpow_le_rpow (bracketSq_pos _).le _ hq.le + rw [bracketSq_eq] + nlinarith [norm_nonneg (f (circlePoint r θ))] + have hi := intervalIntegral.integral_mono_on (a := -Real.pi) (b := Real.pi) (by linarith [Real.pi_pos]) + ((continuous_circle_smoothPower hf q r hr.le hr1).intervalIntegrable _ _) + (intervalIntegrable_const (μ := volume)) (fun θ _ => hb θ) + simp only [intervalIntegral.integral_const,smul_eq_mul] at hi + have hn := abs_nonneg C + nlinarith + · let y := -Real.log r + have hy : 0 < y := neg_pos.mpr (Real.log_neg hr hr1) + have hy1 : y ≤ 1 := by + have hexp : Real.exp (-1) ≤ (1/2:ℝ) := by + rw [Real.exp_neg] + have he := Real.add_one_le_exp (1:ℝ) + exact inv_le_comm₀ (Real.exp_pos _) (by norm_num) |>.mpr (by norm_num; linarith) + have hlog : -1 ≤ Real.log r := (Real.le_log_iff_exp_le hr).mpr (hexp.trans (by linarith)) + dsimp [y] + linarith + have he (x : ℝ) : logDisk ((x:ℂ)+y*Complex.I) = circlePoint r x := by + have hh := logDisk_realProd x y + rw [Complex.equivRealProdCLM_symm_apply] at hh + simpa only [y,neg_neg,Real.exp_log hr] using hh + have hs := hC y hy hy1 + simp_rw [he] at hs + have hc' := le_abs_self C + have hn : 0 ≤ 2*Real.pi*(5:ℝ)^q := by positivity + linarith + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/Spectrum.lean b/lean/OAI/Analysis/IntegralMeans/Spectrum.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f778a42e35b2c5e037ede2fef30fb8c0005254d --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/Spectrum.lean @@ -0,0 +1,104 @@ +import OAI.Analysis.IntegralMeans.Koebe + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology +namespace Brennan + +lemma integralMean_pos {f : ℂ → ℂ} (hf : UnivalentOn f disk) {r : ℝ} + (hr0 : 0 ≤ r) (hr1 : r < 1) (t : ℝ) : 0 < integralMean f t r := by + apply mul_pos (by positivity) + apply intervalIntegral.integral_pos (by linarith [Real.pi_pos]) + (continuous_circle_deriv_rpow hf hr0 hr1 t).continuousOn + (fun θ _ => Real.rpow_nonneg (norm_nonneg _) t) + refine ⟨0,⟨by linarith [Real.pi_pos],by linarith [Real.pi_pos]⟩,?_⟩ + exact Real.rpow_pos_of_pos (norm_pos_iff.mpr (univalent_deriv_ne_zero Metric.isOpen_ball hf + (circlePoint_mem_disk hr0 hr1 0))) t + +lemma tendsto_log_boundary : Tendsto (fun r : ℝ => Real.log (1/(1-r))) (𝓝[<] (1:ℝ)) atTop := by + have hδ : Tendsto (fun r : ℝ => 1-r) (𝓝[<] (1:ℝ)) (𝓝[>] (0:ℝ)) := by + apply tendsto_nhdsWithin_iff.mpr + constructor + · have hc : Continuous (fun r : ℝ => 1-r) := continuous_const.sub continuous_id + have h := hc.continuousAt.tendsto.mono_left + (nhdsWithin_le_nhds : 𝓝[<] (1:ℝ) ≤ 𝓝 1) + simpa only [sub_self] using h + · filter_upwards [self_mem_nhdsWithin] with r hr + exact sub_pos.mpr (show r < 1 from hr) + have h := tendsto_neg_atBot_atTop.comp (Real.tendsto_log_nhdsGT_zero.comp hδ) + simpa only [Function.comp_def,one_div,Real.log_inv] using h + +lemma eventually_radius : ∀ᶠ r : ℝ in 𝓝[<] (1:ℝ), 1/2 ≤ r ∧ r < 1 := by + filter_upwards [eventually_nhdsWithin_of_eventually_nhds (eventually_gt_nhds (by norm_num : (1/2:ℝ) < 1)),self_mem_nhdsWithin] with r hr hr1 + exact ⟨hr.le,hr1⟩ + +lemma log_power_upper {M C a r : ℝ} (hM : 0 < M) (hC : 0 < C) + (hr : 0 < r) (hr1 : r < 1) (h : M ≤ C*(1-r)^(-a)) : + Real.log M / Real.log (1/(1-r)) ≤ Real.log C / Real.log (1/(1-r)) + a := by + have hd : 0 < 1-r := by linarith + have hl : 0 < Real.log (1/(1-r)) := Real.log_pos ((one_lt_div hd).mpr (by linarith)) + have hb := Real.log_le_log hM h + rw [Real.log_mul hC.ne' (Real.rpow_pos_of_pos hd _).ne',Real.log_rpow hd] at hb + have he : Real.log (1/(1-r)) = -Real.log (1-r) := by simp [one_div] + rw [div_le_iff₀ hl] + calc + Real.log M ≤ Real.log C + (-a)*Real.log (1-r) := hb + _ = (Real.log C / Real.log (1/(1-r))+a)*Real.log (1/(1-r)) := by + rw [add_mul,div_mul_cancel₀ _ hl.ne',he]; ring + +lemma beta_inverse_le_one {f : ℂ → ℂ} (hf : Schlicht f) : beta f (-2) ≤ 1 := by + have hb (ε : ℝ) (hε : 0 < ε) : beta f (-2) ≤ ((1+ε:ℝ):EReal) := by + obtain ⟨C,hC,hbound⟩ := uniform_inverse_square_bound ε hε + have hc : Tendsto (fun r : ℝ => ((Real.log C/Real.log (1/(1-r))+(1+ε):ℝ):EReal)) + (𝓝[<] (1:ℝ)) (𝓝 ((1+ε:ℝ):EReal)) := by + have hh := (tendsto_log_boundary.const_div_atTop (Real.log C)).add_const (1+ε) + simpa [Function.comp_def] using continuous_coe_real_ereal.continuousAt.tendsto.comp hh + rw [← hc.limsup_eq] + refine limsup_le_limsup ?_ (by isBoundedDefault) (by isBoundedDefault) + filter_upwards [eventually_radius] with r hr + apply EReal.coe_le_coe + exact log_power_upper (integralMean_pos hf.1 (by linarith [hr.1]) hr.2 (-2)) hC + (by linarith [hr.1]) hr.2 (by simpa only [show -(1+ε) = -1-ε by ring] using hbound f hf r hr.1 hr.2) + by_contra h + obtain ⟨a,ha,hfa⟩ := EReal.exists_between_coe_real (lt_of_not_ge h) + have ha' : 1 < a := by exact_mod_cast ha + have he := hb ((a-1)/2) (by linarith) + have he' : ((1+(a-1)/2:ℝ):EReal) < a := EReal.coe_lt_coe_iff.mpr (by linarith) + exact (not_lt_of_ge he) (he'.trans hfa) + +lemma koebe_beta_ge_one : 1 ≤ beta koebeMap (-2) := by + let C : ℝ := 1/(4*Real.pi) + have hC : 0 < C := by dsimp [C]; positivity + have hc : Tendsto (fun r : ℝ => ((Real.log C/Real.log (1/(1-r))+1:ℝ):EReal)) + (𝓝[<] (1:ℝ)) (𝓝 (1:EReal)) := by + have hh := (tendsto_log_boundary.const_div_atTop (Real.log C)).add_const 1 + simpa [Function.comp_def] using continuous_coe_real_ereal.continuousAt.tendsto.comp hh + rw [← hc.limsup_eq] + refine limsup_le_limsup ?_ (by isBoundedDefault) (by isBoundedDefault) + filter_upwards [eventually_radius] with r hr + apply EReal.coe_le_coe + have hd : 0 < 1-r := by linarith [hr.2] + have hl : 0 < Real.log (1/(1-r)) := Real.log_pos ((one_lt_div hd).mpr (by linarith [hr.1])) + have hb := koebe_mean_lower hr.1 hr.2 + have hid : 1/(4*Real.pi*(1-r)) = C*(1/(1-r)) := by dsimp [C]; field_simp + rw [hid] at hb + have hh := Real.log_le_log (mul_pos hC (by positivity)) hb + rw [Real.log_mul hC.ne' (by positivity)] at hh + rw [le_div_iff₀ hl,add_mul,div_mul_cancel₀ _ hl.ne',one_mul] + exact hh + +lemma inverse_spectrum_eq_one : spectrum (-2) = 1 := by + apply le_antisymm + · apply sSup_le + rintro _ ⟨f,hf,rfl⟩ + exact beta_inverse_le_one hf + · exact koebe_beta_ge_one.trans (le_sSup (show beta koebeMap (-2) ∈ {b | ∃ f,Schlicht f ∧ beta f (-2) = b} from + ⟨koebeMap,koebeMap_schlicht,rfl⟩)) + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/TraceBounds.lean b/lean/OAI/Analysis/IntegralMeans/TraceBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..c93f849fcf502cd71565993c94c74ad42e9c06c1 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/TraceBounds.lean @@ -0,0 +1,274 @@ +import OAI.Analysis.IntegralMeans.NegativeArea + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology +namespace Brennan + +lemma rectangle_trace_periodic {g : ℝ × ℝ → ℝ} {R ε Y : ℝ} + (hR : 0 ≤ R) (hεY : ε ≤ Y) + (hg : ∀ p ∈ Icc (-R,ε) (R,Y), ContDiffAt ℝ 2 g p) + (hside : ∀ y ∈ Icc ε Y, + fderiv ℝ g (-R,y) (1,0) = fderiv ℝ g (R,y) (1,0)) : + (∫ p in Icc (-R,ε) (R,Y), (p.2-ε)*pairLaplacian g p) = + (∫ x in -R..R, traceFluxY g ε (x,Y)) + ∫ x in -R..R, g (x,ε) := by + have hf : ContinuousOn (traceFluxX g ε) (Icc (-R,ε) (R,Y)) := + fun p hp => ((traceFlux_contDiffAt (hg p hp) ε).1.continuousAt).continuousWithinAt + have hh : ContinuousOn (traceFluxY g ε) (Icc (-R,ε) (R,Y)) := + fun p hp => ((traceFlux_contDiffAt (hg p hp) ε).2.continuousAt).continuousWithinAt + have hint : IntegrableOn (fun p : ℝ × ℝ => (p.2-ε)*pairLaplacian g p) + (Icc (-R,ε) (R,Y)) volume := by + apply ContinuousOn.integrableOn_compact isCompact_Icc + intro p hp + have hc : ContinuousAt (fun p : ℝ × ℝ => (p.2-ε)*pairLaplacian g p) p := + (continuous_snd.continuousAt.sub_const ε).mul (continuousAt_pairLaplacian (hg p hp)) + exact hc.continuousWithinAt + have heq (p : ℝ × ℝ) (hp : p ∈ Icc (-R,ε) (R,Y)) := divergence_traceFlux (hg p hp) ε + have hi : IntegrableOn (fun p => fderiv ℝ (traceFluxX g ε) p (1,0)+ + fderiv ℝ (traceFluxY g ε) p (0,1)) (Icc (-R,ε) (R,Y)) volume := + hint.congr (ae_restrict_of_forall_mem measurableSet_Icc (fun p hp => (heq p hp).symm)) + have hb := integral_divergence_prod_Icc_of_hasFDerivAt_of_le + (traceFluxX g ε) (traceFluxY g ε) (fderiv ℝ (traceFluxX g ε)) + (fderiv ℝ (traceFluxY g ε)) (-R,ε) (R,Y) ⟨by linarith,hεY⟩ hf hh + (fun p hp => ((traceFlux_contDiffAt (hg p ⟨⟨hp.1.1.le,hp.2.1.le⟩,⟨hp.1.2.le,hp.2.2.le⟩⟩) ε).1.differentiableAt (by norm_num)).hasFDerivAt) + (fun p hp => ((traceFlux_contDiffAt (hg p ⟨⟨hp.1.1.le,hp.2.1.le⟩,⟨hp.1.2.le,hp.2.2.le⟩⟩) ε).2.differentiableAt (by norm_num)).hasFDerivAt) hi + rw [setIntegral_congr_fun measurableSet_Icc heq] at hb + have hsideint : (∫ y in ε..Y, traceFluxX g ε (R,y)) = + ∫ y in ε..Y, traceFluxX g ε (-R,y) := by + apply intervalIntegral.integral_congr + intro y hy + dsimp [traceFluxX] + rw [hside y (by simpa only [uIcc_of_le hεY] using hy)] + change _ = ((∫ x in -R..R, traceFluxY g ε (x,Y)) - ∫ x in -R..R, traceFluxY g ε (x,ε)) + + (∫ y in ε..Y, traceFluxX g ε (R,y)) - ∫ y in ε..Y, traceFluxX g ε (-R,y) at hb + rw [hsideint] at hb + simpa only [traceFluxY,sub_self,zero_mul,zero_sub, + intervalIntegral.integral_neg,sub_neg_eq_add, zero_add,add_zero,sub_zero,add_sub_cancel_right] using hb + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +lemma rectangle_restrict_open (a b c d : ℝ) : + (volume : Measure (ℝ × ℝ)).restrict (Icc (a,c) (b,d)) = + (volume : Measure (ℝ × ℝ)).restrict (Ioo a b ×ˢ Ioo c d) := by + rw [Icc_prod_eq] + change (volume.prod volume).restrict (Icc a b ×ˢ Icc c d) = + (volume.prod volume).restrict (Ioo a b ×ˢ Ioo c d) + rw [← Measure.prod_restrict,← Measure.prod_restrict, + restrict_Ioo_eq_restrict_Icc,restrict_Ioo_eq_restrict_Icc] + +lemma rectangle_conformal_lintegral_le {F : ℂ → ℂ} {R ε Y : ℝ} (hε : 0 < ε) + (hF : ∀ z : ℂ, 0 < z.im → DifferentiableAt ℂ F z) + (hi : InjOn F {z : ℂ | -R < z.re ∧ z.re < R ∧ 0 < z.im}) (b : ℂ → ℝ≥0∞) : + (∫⁻ p in Icc (-R,ε) (R,Y), + ENNReal.ofReal (‖deriv F (Complex.equivRealProdCLM.symm p)‖^2)* + b (F (Complex.equivRealProdCLM.symm p))) ≤ ∫⁻ w, b w := by + rw [rectangle_restrict_open] + let s : Set (ℝ × ℝ) := Ioo (-R) R ×ˢ Ioo ε Y + let E := Complex.equivRealProdCLM + have hs : MeasurableSet (E ⁻¹' s) := + (measurableSet_Ioo.prod measurableSet_Ioo).preimage E.continuous.measurable + have he := Complex.volume_preserving_equiv_real_prod.setLIntegral_comp_preimage_emb + Complex.measurableEquivRealProd.measurableEmbedding + (fun p : ℝ × ℝ => ENNReal.ofReal (‖deriv F (E.symm p)‖^2)*b (F (E.symm p))) s + have hh : (∫⁻ p in s, ENNReal.ofReal (‖deriv F (E.symm p)‖^2)*b (F (E.symm p))) = + ∫⁻ z in E ⁻¹' s, ENNReal.ofReal (‖deriv F z‖^2)*b (F z) := by + rw [← he] + apply lintegral_congr + intro z + change ENNReal.ofReal (‖deriv F (E.symm (E z))‖^2)*b (F (E.symm (E z))) = _ + rw [E.symm_apply_apply] + change (∫⁻ p in s, ENNReal.ofReal (‖deriv F (E.symm p)‖^2)*b (F (E.symm p))) ≤ _ + rw [hh] + apply conformal_lintegral_le hs + · intro z hz + exact hF z (hε.trans hz.2.1) + · apply hi.mono + intro z hz + exact ⟨hz.1.1,hz.1.2,hε.trans hz.2.1⟩ + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology ENNReal +namespace Brennan + +lemma periodic_conformal_trace_bounded {F : ℂ → ℂ} {ψ b : ℂ → ℝ} {K : ℝ} + (hF : ∀ z : ℂ, 0 < z.im → AnalyticAt ℂ F z) + (hi : InjOn F {z : ℂ | -Real.pi < z.re ∧ z.re < Real.pi ∧ 0 < z.im}) + (hψ : ContDiff ℝ 2 ψ) (hb : Integrable b) (hbn : ∀ w, 0 ≤ b w) (hK : 0 ≤ K) + (hside : ∀ y : ℝ, 0 < y → + fderiv ℝ ((ψ ∘ F) ∘ Complex.equivRealProdCLM.symm) (-Real.pi,y) (1,0) = + fderiv ℝ ((ψ ∘ F) ∘ Complex.equivRealProdCLM.symm) (Real.pi,y) (1,0)) + (hlap : ∀ z : ℂ, 0 < z.im → z.im ≤ 1 → + 0 ≤ Laplacian.laplacian (ψ ∘ F) z ∧ + z.im * Laplacian.laplacian (ψ ∘ F) z ≤ K*‖deriv F z‖^2*b (F z)) : + ∃ C : ℝ, ∀ ε : ℝ, 0 < ε → ε ≤ 1 → + (∫ x in -Real.pi..Real.pi, ψ (F (x+ε*Complex.I))) ≤ C := by + let E := Complex.equivRealProdCLM.symm + let g := (ψ ∘ F) ∘ E + have hg (p : ℝ × ℝ) (hp : 0 < p.2) : ContDiffAt ℝ 2 g p := + (hψ.contDiffAt.comp _ ((hF (E p) hp).contDiffAt.restrict_scalars ℝ)).comp _ E.contDiff.contDiffAt + have hc (x : ℝ) : ContinuousAt (fun x : ℝ => g (x,1)) x := by + exact (hg (x,1) zero_lt_one).continuousAt.comp (f := fun v : ℝ => (v,(1:ℝ))) (show ContinuousAt (fun v : ℝ => (v,(1:ℝ))) x from (continuous_id.prodMk continuous_const).continuousAt) + have hd (x : ℝ) : ContinuousAt (fun x : ℝ => fderiv ℝ g (x,1) (0,1)) x := by + have hh := ((hg (x,1) zero_lt_one).fderiv_right (m := 0) (by norm_num)).continuousAt + have hl : ContinuousAt (fun x : ℝ => fderiv ℝ g (x,1)) x := + hh.comp (f := fun v : ℝ => (v,(1:ℝ))) (show ContinuousAt (fun v : ℝ => (v,(1:ℝ))) x from (continuous_id.prodMk continuous_const).continuousAt) + exact hl.clm_apply continuousAt_const + let A : ℝ := ∫ x in -Real.pi..Real.pi, |g (x,1)|+|fderiv ℝ g (x,1) (0,1)| + have hAint : IntervalIntegrable (fun x : ℝ => |g (x,1)|+|fderiv ℝ g (x,1) (0,1)|) + volume (-Real.pi) Real.pi := + ((continuous_iff_continuousAt.mpr hc).abs.add (continuous_iff_continuousAt.mpr hd).abs).intervalIntegrable _ _ + have hIb : 0 ≤ ∫ w, b w := integral_nonneg hbn + refine ⟨K*(∫ w, b w)+A,fun ε hε hε1 => ?_⟩ + let S := Icc (-Real.pi,ε) (Real.pi,(1:ℝ)) + let U : ℝ × ℝ → ℝ := fun p => (p.2-ε)*pairLaplacian g p + have hbox (p : ℝ × ℝ) (hp : p ∈ S) : ContDiffAt ℝ 2 g p := hg p (hε.trans_le hp.1.2) + have hUi : IntegrableOn U S := by + apply ContinuousOn.integrableOn_compact isCompact_Icc + intro p hp + apply ContinuousAt.continuousWithinAt + exact (continuous_snd.continuousAt.sub_const ε).mul + (continuousAt_pairLaplacian (hbox p hp)) + have hUn (p : ℝ × ℝ) (hp : p ∈ S) : 0 ≤ U p := by + dsimp [U,g,E] + rw [pairLaplacian_complex] + exact mul_nonneg (by linarith [hp.1.2]) (hlap _ (hε.trans_le hp.1.2) hp.2.2).1 + have hUp (p : ℝ × ℝ) (hp : p ∈ S) : + U p ≤ K*‖deriv F (E p)‖^2*b (F (E p)) := by + have hx := hlap (E p) (hε.trans_le hp.1.2) hp.2.2 + dsimp only [U,g] + rw [pairLaplacian_complex] + calc + _ ≤ p.2*Laplacian.laplacian (ψ ∘ F) (E p) := mul_le_mul_of_nonneg_right (by linarith) hx.1 + _ ≤ _ := hx.2 + have hIle : (∫ p in S, U p) ≤ K*(∫ w, b w) := by + have he := ofReal_integral_eq_lintegral_ofReal hUi + (ae_restrict_of_forall_mem measurableSet_Icc hUn) + have hb' := ofReal_integral_eq_lintegral_ofReal hb (Eventually.of_forall hbn) + have hL : (∫⁻ p in S, ENNReal.ofReal (U p)) ≤ ENNReal.ofReal (K*(∫ w, b w)) := by + calc + _ ≤ ∫⁻ p in S, ENNReal.ofReal K * + (ENNReal.ofReal (‖deriv F (E p)‖^2)*ENNReal.ofReal (b (F (E p)))) := by + apply setLIntegral_mono' measurableSet_Icc + intro p hp + rw [← ENNReal.ofReal_mul (sq_nonneg _),← ENNReal.ofReal_mul hK] + apply ENNReal.ofReal_le_ofReal + simpa only [mul_assoc] using hUp p hp + _ = ENNReal.ofReal K * ∫⁻ p in S, + ENNReal.ofReal (‖deriv F (E p)‖^2)*ENNReal.ofReal (b (F (E p))) := + lintegral_const_mul' _ _ ENNReal.ofReal_ne_top + _ ≤ ENNReal.ofReal K * ∫⁻ w, ENNReal.ofReal (b w) := + mul_le_mul le_rfl (rectangle_conformal_lintegral_le hε + (fun z hz => (hF z hz).differentiableAt) hi + (fun w => ENNReal.ofReal (b w))) zero_le zero_le + _ = ENNReal.ofReal (K*(∫ w, b w)) := by rw [← hb',ENNReal.ofReal_mul hK] + rw [← he] at hL + exact (ENNReal.ofReal_le_ofReal_iff (mul_nonneg hK hIb)).mp hL + have ht := rectangle_trace_periodic Real.pi_pos.le hε1 hbox + (fun y hy => hside y (hε.trans_le hy.1)) + have htop : -(∫ x in -Real.pi..Real.pi, traceFluxY g ε (x,1)) ≤ A := by + rw [← intervalIntegral.integral_neg] + have htopc : Continuous (fun x : ℝ => -traceFluxY g ε (x,1)) := by + simp only [traceFluxY] + exact ((continuous_const.mul (continuous_iff_continuousAt.mpr hd)).sub + (continuous_iff_continuousAt.mpr hc)).neg + apply intervalIntegral.integral_mono_on (by linarith [Real.pi_pos]) + (htopc.intervalIntegrable _ _) hAint + intro x _hx + dsimp [traceFluxY] + have hgabs := le_abs_self (g (x,1)) + have hdabs := neg_le_abs (fderiv ℝ g (x,1) (0,1)) + have hmul : -(1-ε)*fderiv ℝ g (x,1) (0,1) ≤ |fderiv ℝ g (x,1) (0,1)| := by + calc + _ = (1-ε)*(-fderiv ℝ g (x,1) (0,1)) := by ring + _ ≤ (1-ε)*|fderiv ℝ g (x,1) (0,1)| := mul_le_mul_of_nonneg_left hdabs (by linarith) + _ ≤ |fderiv ℝ g (x,1) (0,1)| := mul_le_of_le_one_left (abs_nonneg _) (by linarith) + linarith + have hid : (∫ x in -Real.pi..Real.pi, ψ (F (x+ε*Complex.I))) = + ∫ x in -Real.pi..Real.pi, g (x,ε) := by + apply intervalIntegral.integral_congr + intro x _ + simp only [g,E,Function.comp_apply,Complex.equivRealProdCLM_symm_apply] + rw [hid] + change (∫ p in S, U p) = _ at ht + linarith + +end Brennan + +end + +noncomputable section +open Set MeasureTheory Filter Function +open scoped Topology +namespace Brennan + +lemma radial_growth_upper {f : ℂ → ℂ} (hf : Schlicht f) {r : ℝ} (hr : 0 ≤ r) + (hr1 : r < 1) {ζ : ℂ} (hζ : ‖ζ‖ = 1) : + ‖f ((r:ℂ)*ζ)‖ ≤ r/(1-r)^2 := by + let B : ℝ → ℝ := fun t => (1+t)/(1-t)^3 + let G : ℝ → ℝ := fun t => t/(1-t)^2 + have hn (t : ℝ) (ht : t ∈ Icc 0 r) : ‖(t:ℂ)*ζ‖ = t := by + simp [hζ,abs_of_nonneg ht.1] + have hm (t : ℝ) (ht : t ∈ Icc 0 r) : (t:ℂ)*ζ ∈ disk := by + simp only [disk,Metric.mem_ball,dist_zero_right,hn t ht] + exact ht.2.trans_lt hr1 + have hd (t : ℝ) (ht : t ∈ Icc 0 r) : + HasDerivAt (fun t : ℝ => f ((t:ℂ)*ζ)) (deriv f ((t:ℂ)*ζ)*ζ) t := by + have hdf := ((hf.1.1 _ (hm t ht)).differentiableAt (Metric.isOpen_ball.mem_nhds (hm t ht))).hasDerivAt + have hl : HasDerivAt (fun t : ℝ => (t:ℂ)*ζ) ζ t := by + simpa using (Complex.ofRealCLM.hasDerivAt.mul_const ζ : + HasDerivAt (fun t : ℝ => Complex.ofRealCLM t*ζ) ((Complex.ofRealCLM (1:ℝ))*ζ) t) + convert HasDerivAt.comp (𝕜 := ℝ) t hdf hl using 1 + rfl + have hB : ContinuousOn B (Icc 0 r) := by + unfold B + exact (continuous_const.add continuous_id).continuousOn.div ((continuous_const.sub continuous_id).pow 3).continuousOn + (fun t ht => pow_ne_zero 3 (by linarith [ht.2])) + have hG (t : ℝ) (ht : t ∈ Icc 0 r) : HasDerivAt G (B t) t := by + have hnz : 1-t ≠ 0 := by linarith [ht.2] + have hd := (hasDerivAt_id t).div (((hasDerivAt_const t (1:ℝ)).sub (hasDerivAt_id t)).pow 2) (pow_ne_zero 2 hnz) + convert hd using 1 <;> try rfl + dsimp [G,B] + field_simp [hnz] + ring + have hb := norm_sub_le_integral_of_norm_deriv_le_of_le hr + (fun t ht => (hd t ht).continuousAt.continuousWithinAt) + (fun t ht => (hd t ⟨ht.1.le,ht.2.le⟩).differentiableAt.differentiableWithinAt) + (Eventually.of_forall (fun t ht => show ‖deriv (fun t : ℝ => f ((t:ℂ)*ζ)) t‖ ≤ B t from by + rw [(hd t ⟨ht.1.le,ht.2.le⟩).deriv,norm_mul,hζ,mul_one] + simpa only [B,hn t ⟨ht.1.le,ht.2.le⟩] using (schlicht_deriv_bounds hf (hm t ⟨ht.1.le,ht.2.le⟩)).2)) + (hB.intervalIntegrable_of_Icc hr) + have hi := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t ht => hG t (by simpa [uIcc_of_le hr] using ht)) + (hB.intervalIntegrable_of_Icc hr) + rw [hi] at hb + simpa [G,hf.2.1] using hb + +lemma schlicht_growth_upper {f : ℂ → ℂ} (hf : Schlicht f) {z : ℂ} (hz : z ∈ disk) : + ‖f z‖ ≤ ‖z‖/(1-‖z‖)^2 := by + by_cases hzero : z = 0 + · simp [hzero,hf.2.1] + have hn := norm_pos_iff.mpr hzero + have hζ : ‖z/(‖z‖:ℂ)‖ = 1 := by + simp [div_self hn.ne'] + have he : (‖z‖:ℂ)*(z/(‖z‖:ℂ)) = z := by + field_simp [show (‖z‖:ℂ) ≠ 0 from Complex.ofReal_ne_zero.mpr hn.ne'] + simpa [he] using radial_growth_upper hf hn.le (by simpa [disk] using hz) hζ + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/TraceIdentity.lean b/lean/OAI/Analysis/IntegralMeans/TraceIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..563830bd84ab741878222d9c032a5ad549f53fe4 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/TraceIdentity.lean @@ -0,0 +1,492 @@ +import OAI.Analysis.IntegralMeans.BoundaryTail + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight +attribute [local irreducible] classFun + +def pairLaplacian (g : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := + fderiv ℝ (fderiv ℝ g) p (1,0) (1,0) + fderiv ℝ (fderiv ℝ g) p (0,1) (0,1) + +def traceFluxX (g : ℝ × ℝ → ℝ) (ε : ℝ) (p : ℝ × ℝ) : ℝ := + (p.2-ε)*fderiv ℝ g p (1,0) + +def traceFluxY (g : ℝ × ℝ → ℝ) (ε : ℝ) (p : ℝ × ℝ) : ℝ := + (p.2-ε)*fderiv ℝ g p (0,1)-g p + +lemma traceFlux_contDiffAt {g : ℝ × ℝ → ℝ} {p : ℝ × ℝ} + (hg : ContDiffAt ℝ 2 g p) (ε : ℝ) : + ContDiffAt ℝ 1 (traceFluxX g ε) p ∧ ContDiffAt ℝ 1 (traceFluxY g ε) p := by + have hd : ContDiffAt ℝ 1 (fderiv ℝ g) p := hg.fderiv_right (by norm_num) + have htr : ContDiffAt ℝ 1 g p := hg.of_le (by norm_num) + constructor + · unfold traceFluxX; fun_prop + · unfold traceFluxY; fun_prop + +lemma divergence_traceFlux {g : ℝ × ℝ → ℝ} {p : ℝ × ℝ} + (hg : ContDiffAt ℝ 2 g p) (ε : ℝ) : + fderiv ℝ (traceFluxX g ε) p (1,0)+fderiv ℝ (traceFluxY g ε) p (0,1) = + (p.2-ε)*pairLaplacian g p := by + have hdg := hg.differentiableAt (by norm_num) + have hddg := (hg.fderiv_right (m := 1) (by norm_num)).differentiableAt (by norm_num) + have hx := hddg.hasFDerivAt.clm_apply (hasFDerivAt_const ((1,0) : ℝ × ℝ) p) + have hy := hddg.hasFDerivAt.clm_apply (hasFDerivAt_const ((0,1) : ℝ × ℝ) p) + have hs : HasFDerivAt (fun p : ℝ × ℝ => p.2-ε) (ContinuousLinearMap.snd ℝ ℝ ℝ) p := + (ContinuousLinearMap.snd ℝ ℝ ℝ).hasFDerivAt.sub_const ε + unfold traceFluxX traceFluxY + have hfx := (hs.mul hx).fderiv + have hfy := ((hs.mul hy).sub hdg.hasFDerivAt).fderiv + change fderiv ℝ (fun p => (p.2-ε)*fderiv ℝ g p (1,0)) p = _ at hfx + change fderiv ℝ (fun p => (p.2-ε)*fderiv ℝ g p (0,1)-g p) p = _ at hfy + rw [hfx,hfy] + simp [pairLaplacian,ContinuousLinearMap.flip_apply,mul_add] + +lemma continuousAt_pairLaplacian {g : ℝ × ℝ → ℝ} {p : ℝ × ℝ} + (hg : ContDiffAt ℝ 2 g p) : ContinuousAt (pairLaplacian g) p := by + have hh : ContDiffAt ℝ 0 (fderiv ℝ (fderiv ℝ g)) p := + (hg.fderiv_right (m := 1) (by norm_num)).fderiv_right (by norm_num) + have hc := hh.continuousAt + unfold pairLaplacian + fun_prop + +lemma rectangle_trace_identity {g : ℝ × ℝ → ℝ} {R ε Y : ℝ} + (hR : 0 ≤ R) (hεY : ε ≤ Y) + (hg : ∀ p ∈ Icc (-R,ε) (R,Y), ContDiffAt ℝ 2 g p) + (htop : ∀ x ∈ Icc (-R) R, g (x,Y) = 0 ∧ fderiv ℝ g (x,Y) (0,1) = 0) + (hside : ∀ y ∈ Icc ε Y, + fderiv ℝ g (-R,y) (1,0) = 0 ∧ fderiv ℝ g (R,y) (1,0) = 0) : + (∫ p in Icc (-R,ε) (R,Y), (p.2-ε)*pairLaplacian g p) = + ∫ x in -R..R, g (x,ε) := by + have hf : ContinuousOn (traceFluxX g ε) (Icc (-R,ε) (R,Y)) := + fun p hp => ((traceFlux_contDiffAt (hg p hp) ε).1.continuousAt).continuousWithinAt + have hh : ContinuousOn (traceFluxY g ε) (Icc (-R,ε) (R,Y)) := + fun p hp => ((traceFlux_contDiffAt (hg p hp) ε).2.continuousAt).continuousWithinAt + have hint : IntegrableOn (fun p : ℝ × ℝ => (p.2-ε)*pairLaplacian g p) + (Icc (-R,ε) (R,Y)) volume := by + apply ContinuousOn.integrableOn_compact isCompact_Icc + intro p hp + have hc : ContinuousAt (fun p : ℝ × ℝ => (p.2-ε)*pairLaplacian g p) p := + (continuous_snd.continuousAt.sub_const ε).mul (continuousAt_pairLaplacian (hg p hp)) + exact hc.continuousWithinAt + have heq (p : ℝ × ℝ) (hp : p ∈ Icc (-R,ε) (R,Y)) := divergence_traceFlux (hg p hp) ε + have hi : IntegrableOn (fun p => fderiv ℝ (traceFluxX g ε) p (1,0)+ + fderiv ℝ (traceFluxY g ε) p (0,1)) (Icc (-R,ε) (R,Y)) volume := + hint.congr (ae_restrict_of_forall_mem measurableSet_Icc (fun p hp => (heq p hp).symm)) + have hb := integral_divergence_prod_Icc_of_hasFDerivAt_of_le + (traceFluxX g ε) (traceFluxY g ε) (fderiv ℝ (traceFluxX g ε)) + (fderiv ℝ (traceFluxY g ε)) (-R,ε) (R,Y) ⟨by linarith,hεY⟩ hf hh + (fun p hp => ((traceFlux_contDiffAt (hg p ⟨⟨hp.1.1.le,hp.2.1.le⟩,⟨hp.1.2.le,hp.2.2.le⟩⟩) ε).1.differentiableAt (by norm_num)).hasFDerivAt) + (fun p hp => ((traceFlux_contDiffAt (hg p ⟨⟨hp.1.1.le,hp.2.1.le⟩,⟨hp.1.2.le,hp.2.2.le⟩⟩) ε).2.differentiableAt (by norm_num)).hasFDerivAt) hi + rw [setIntegral_congr_fun measurableSet_Icc heq] at hb + have ht : (∫ x in -R..R, traceFluxY g ε (x,Y)) = 0 := by + calc + _ = ∫ _ in -R..R, (0 : ℝ) := ?_ + _ = 0 := by simp + apply intervalIntegral.integral_congr + intro x hx + have hx' : x ∈ Icc (-R) R := by simpa only [uIcc_of_le (by linarith : -R ≤ R)] using hx + simp [traceFluxY,(htop x hx').1,(htop x hx').2] + have hl : (∫ y in ε..Y, traceFluxX g ε (-R,y)) = 0 := by + calc + _ = ∫ _ in ε..Y, (0 : ℝ) := ?_ + _ = 0 := by simp + apply intervalIntegral.integral_congr + intro y hy + simp [traceFluxX,(hside y (by simpa only [uIcc_of_le hεY] using hy)).1] + have hr : (∫ y in ε..Y, traceFluxX g ε (R,y)) = 0 := by + calc + _ = ∫ _ in ε..Y, (0 : ℝ) := ?_ + _ = 0 := by simp + apply intervalIntegral.integral_congr + intro y hy + simp [traceFluxX,(hside y (by simpa only [uIcc_of_le hεY] using hy)).2] + change _ = ((∫ x in -R..R, traceFluxY g ε (x,Y)) - ∫ x in -R..R, traceFluxY g ε (x,ε)) + + (∫ y in ε..Y, traceFluxX g ε (R,y)) - ∫ y in ε..Y, traceFluxX g ε (-R,y) at hb + rw [ht,hl,hr] at hb + simpa only [traceFluxY,sub_self,zero_mul,zero_sub, + intervalIntegral.integral_neg,sub_neg_eq_add,zero_add,add_zero,sub_zero] using hb + +lemma half_trace_rectangle {g : ℝ × ℝ → ℝ} {ε : ℝ} (hε : 0 < ε) + (hc : ∀ p : ℝ × ℝ, 0 < p.2 → ContDiffAt ℝ 2 g p) + {K : Set (ℝ × ℝ)} (hK : IsCompact K) + (hs : ∀ p : ℝ × ℝ, ε/2 ≤ p.2 → g p ≠ 0 → p ∈ K) : + ∃ R : ℝ, 0 < R ∧ ε ≤ R ∧ Integrable (fun x : ℝ => g (x,ε)) ∧ + (∫ x : ℝ, g (x,ε)) = + ∫ p in Icc (-R,ε) (R,R), (p.2-ε)*pairLaplacian g p := by + obtain ⟨M,hM⟩ := hK.isBounded.subset_closedBall (0 : ℝ × ℝ) + let R := max M ε+1 + have hR : 0 < R := by dsimp only [R]; linarith [le_max_right M ε] + have hεR : ε ≤ R := by dsimp only [R]; linarith [le_max_right M ε] + have hMR : M < R := by dsimp only [R]; linarith [le_max_left M ε] + have hz (p : ℝ × ℝ) (hy : ε/2 ≤ p.2) (hn : M < ‖p‖) : g p = 0 := by + by_contra hg + have hh : ‖p‖ ≤ M := by simpa using hM (hs p hy hg) + exact (not_lt_of_ge hh) hn + have hznhd (p : ℝ × ℝ) (hy : ε/2 < p.2) (hn : M < ‖p‖) : + g =ᶠ[𝓝 p] (0 : ℝ × ℝ → ℝ) := by + have hy' : {q : ℝ × ℝ | ε/2 < q.2} ∈ 𝓝 p := + (isOpen_lt continuous_const continuous_snd).mem_nhds hy + have hn' : {q : ℝ × ℝ | M < ‖q‖} ∈ 𝓝 p := + (isOpen_lt continuous_const continuous_norm).mem_nhds hn + filter_upwards [hy',hn'] with q hq₁ hq₂ + exact hz q hq₁.le hq₂ + have hd (p : ℝ × ℝ) (hy : ε/2 < p.2) (hn : M < ‖p‖) : fderiv ℝ g p = 0 := by + rw [(hznhd p hy hn).fderiv_eq,fderiv_zero] + rfl + have htop (x : ℝ) (_hx : x ∈ Icc (-R) R) : + g (x,R) = 0 ∧ fderiv ℝ g (x,R) (0,1) = 0 := by + have hn : M < ‖(x,R)‖ := hMR.trans_le (by simpa only [Real.norm_eq_abs,abs_of_pos hR] using norm_snd_le (x,R)) + exact ⟨hz (x,R) (by linarith) hn,by rw [hd (x,R) (by linarith) hn]; rfl⟩ + have hside (y : ℝ) (hy : y ∈ Icc ε R) : + fderiv ℝ g (-R,y) (1,0) = 0 ∧ fderiv ℝ g (R,y) (1,0) = 0 := by + have h₁ : M < ‖(-R,y)‖ := hMR.trans_le (by simpa only [Real.norm_eq_abs,abs_neg,abs_of_pos hR] using norm_fst_le (-R,y)) + have h₂ : M < ‖(R,y)‖ := hMR.trans_le (by simpa only [Real.norm_eq_abs,abs_of_pos hR] using norm_fst_le (R,y)) + rw [hd (-R,y) (by linarith [hy.1]) h₁,hd (R,y) (by linarith [hy.1]) h₂] + simp + have hbox (p : ℝ × ℝ) (hp : p ∈ Icc (-R,ε) (R,R)) : ContDiffAt ℝ 2 g p := + hc p (hε.trans_le hp.1.2) + have hb := rectangle_trace_identity hR.le hεR hbox htop hside + have hzero (x : ℝ) (hx : x ∉ Icc (-R) R) : g (x,ε) = 0 := by + apply hz (x,ε) (by linarith) + have hh : R < |x| := by + have hh : x < -R ∨ R < x := by simpa only [mem_Icc,not_and_or,not_le] using hx + rcases hh with hh | hh + · exact (lt_neg_of_lt_neg hh).trans_le (neg_le_abs x) + · exact hh.trans_le (le_abs_self x) + exact hMR.trans (hh.trans_le (norm_fst_le (x,ε))) + have hcont : Continuous (fun x : ℝ => g (x,ε)) := by + apply continuous_iff_continuousAt.mpr + intro x + exact (hc (x,ε) hε).continuousAt.comp (f := fun x : ℝ => (x,ε)) + (continuous_id.prodMk continuous_const).continuousAt + have hint := hcont.continuousOn.integrableOn_compact (μ := volume) (isCompact_Icc (a := -R) (b := R)) + have hline : (∫ x in -R..R, g (x,ε)) = ∫ x : ℝ, g (x,ε) := by + rw [intervalIntegral.integral_of_le (by linarith : -R ≤ R), + setIntegral_congr_set Ioc_ae_eq_Icc] + exact setIntegral_eq_integral_of_forall_compl_eq_zero hzero + exact ⟨R,hR,hεR,hint.integrable_of_forall_notMem_eq_zero hzero,(hline.symm.trans hb.symm)⟩ + +lemma ofReal_integral_le_lintegral_abs.{u_1} {α : Type u_1} [MeasurableSpace α] + {μ : Measure α} {f : α → ℝ} (hf : Integrable f μ) : + ENNReal.ofReal (∫ x, f x ∂μ) ≤ ∫⁻ x, ENNReal.ofReal |f x| ∂μ := by + rw [← ofReal_integral_eq_lintegral_ofReal hf.abs (Eventually.of_forall (fun x => abs_nonneg (f x)))] + exact ENNReal.ofReal_le_ofReal (integral_mono hf hf.abs (fun x => le_abs_self _)) + +lemma half_trace_lintegral_le {g : ℝ × ℝ → ℝ} {ε : ℝ} (hε : 0 < ε) + (hc : ∀ p : ℝ × ℝ, 0 < p.2 → ContDiffAt ℝ 2 g p) + (hn : ∀ p : ℝ × ℝ, 0 ≤ g p) + {K : Set (ℝ × ℝ)} (hK : IsCompact K) + (hs : ∀ p : ℝ × ℝ, ε/2 ≤ p.2 → g p ≠ 0 → p ∈ K) : + (∫⁻ x : ℝ, ENNReal.ofReal (g (x,ε))) ≤ + ∫⁻ p in {p : ℝ × ℝ | ε ≤ p.2}, ENNReal.ofReal ((p.2-ε)*|pairLaplacian g p|) := by + obtain ⟨R,_,_,hi,he⟩ := half_trace_rectangle hε hc hK hs + rw [← ofReal_integral_eq_lintegral_ofReal hi (Eventually.of_forall (fun x => hn (x,ε))),he] + have hi₂ : IntegrableOn (fun p : ℝ × ℝ => (p.2-ε)*pairLaplacian g p) + (Icc (-R,ε) (R,R)) volume := by + apply ContinuousOn.integrableOn_compact isCompact_Icc + intro p hp + have hp' : 0 < p.2 := hε.trans_le hp.1.2 + have hh : ContinuousAt (fun p : ℝ × ℝ => (p.2-ε)*pairLaplacian g p) p := + (continuous_snd.continuousAt.sub_const ε).mul (continuousAt_pairLaplacian (hc p hp')) + exact hh.continuousWithinAt + refine (ofReal_integral_le_lintegral_abs hi₂).trans ?_ + calc + (∫⁻ p in Icc (-R,ε) (R,R), ENNReal.ofReal |(p.2-ε)*pairLaplacian g p|) = + ∫⁻ p in Icc (-R,ε) (R,R), ENNReal.ofReal ((p.2-ε)*|pairLaplacian g p|) := by + apply setLIntegral_congr_fun measurableSet_Icc + intro p hp + simp only [abs_mul,abs_of_nonneg (sub_nonneg.mpr hp.1.2)] + _ ≤ _ := lintegral_mono_set (fun p hp => hp.1.2) + +def secondReal (f : ℂ → ℝ) (z u v : ℂ) : ℝ := fderiv ℝ (fderiv ℝ f) z u v + +def complexSecondReal (f : ℂ → ℂ) (z u v : ℂ) : ℂ := fderiv ℝ (fderiv ℝ f) z u v + +lemma secondReal_comp {ψ : ℂ → ℝ} {F : ℂ → ℂ} {z : ℂ} + (hψ : ContDiffAt ℝ 2 ψ (F z)) (hF : ContDiffAt ℝ 2 F z) (u v : ℂ) : + secondReal (ψ ∘ F) z u v = + fderiv ℝ ψ (F z) (complexSecondReal F z u v) + + secondReal ψ (F z) (fderiv ℝ F z u) (fderiv ℝ F z v) := by + have hdψ := hψ.differentiableAt (by norm_num) + have hdF := hF.differentiableAt (by norm_num) + have hddψ := (hψ.fderiv_right (m := 1) (by norm_num)).differentiableAt (by norm_num) + have hddF := (hF.fderiv_right (m := 1) (by norm_num)).differentiableAt (by norm_num) + have he : fderiv ℝ (ψ ∘ F) =ᶠ[𝓝 z] fun w => + (fderiv ℝ ψ (F w)).comp (fderiv ℝ F w) := by + filter_upwards [hF.eventually (by simp),hdF.continuousAt.eventually (hψ.eventually (by simp))] with w hFw hψw + exact fderiv_comp w (hψw.differentiableAt (by norm_num)) (hFw.differentiableAt (by norm_num)) + have hh := ((hddψ.hasFDerivAt.comp z hdF.hasFDerivAt).clm_comp hddF.hasFDerivAt).congr_of_eventuallyEq he + rw [secondReal,hh.fderiv] + simp [secondReal,complexSecondReal,ContinuousLinearMap.compL_apply] + +lemma bilinear_complex_rotation (B : ℂ →L[ℝ] ℂ →L[ℝ] ℝ) (c : ℂ) : + B c c + B (c*Complex.I) (c*Complex.I) = ‖c‖^2*(B 1 1+B Complex.I Complex.I) := by + have hc : c = c.re • (1 : ℂ)+c.im • Complex.I := by simp + have hci : c*Complex.I = (-c.im) • (1 : ℂ)+c.re • Complex.I := by + apply Complex.ext <;> simp [Complex.mul_re,Complex.mul_im] + have hn : ‖c‖^2 = c.re^2+c.im^2 := by + rw [Complex.sq_norm] + simp [Complex.normSq_apply,pow_two] + rw [hci,hc] + simp only [map_add,map_smul,add_apply,smul_apply,smul_eq_mul] + rw [← hc,hn] + ring + +lemma laplacian_eq_secondReal (f : ℂ → ℝ) (z : ℂ) : + Laplacian.laplacian f z = secondReal f z 1 1+secondReal f z Complex.I Complex.I := by + simp [laplacian_eq_iteratedFDeriv_complexPlane,iteratedFDeriv_two_apply,secondReal] + +lemma laplacian_eq_complexSecondReal (f : ℂ → ℂ) (z : ℂ) : + Laplacian.laplacian f z = complexSecondReal f z 1 1+complexSecondReal f z Complex.I Complex.I := by + simp [laplacian_eq_iteratedFDeriv_complexPlane,iteratedFDeriv_two_apply,complexSecondReal] + +lemma fderiv_real_complex_apply {F : ℂ → ℂ} {z : ℂ} + (hF : DifferentiableAt ℂ F z) (v : ℂ) : fderiv ℝ F z v = deriv F z*v := by + rw [(hF.hasDerivAt.hasFDerivAt.restrictScalars ℝ).fderiv] + simp [smul_eq_mul,mul_comm] + +lemma laplacian_holomorphic_comp {ψ : ℂ → ℝ} {F : ℂ → ℂ} {z : ℂ} + (hψ : ContDiffAt ℝ 2 ψ (F z)) (hF : AnalyticAt ℂ F z) : + Laplacian.laplacian (ψ ∘ F) z = ‖deriv F z‖^2*Laplacian.laplacian ψ (F z) := by + rw [laplacian_eq_secondReal,secondReal_comp hψ (hF.contDiffAt.restrict_scalars ℝ), + secondReal_comp hψ (hF.contDiffAt.restrict_scalars ℝ)] + have hz := hF.harmonicAt.2.eq_of_nhds + rw [laplacian_eq_complexSecondReal] at hz + change complexSecondReal F z 1 1+complexSecondReal F z Complex.I Complex.I = 0 at hz + have he : fderiv ℝ ψ (F z) (complexSecondReal F z 1 1)+ + fderiv ℝ ψ (F z) (complexSecondReal F z Complex.I Complex.I) = 0 := by + rw [← map_add,hz,map_zero] + simp only [fderiv_real_complex_apply hF.differentiableAt,mul_one] + have hb := bilinear_complex_rotation (fderiv ℝ (fderiv ℝ ψ) (F z)) (deriv F z) + rw [laplacian_eq_secondReal] + dsimp only [secondReal] at * + linarith + +lemma pairLaplacian_complex (f : ℂ → ℝ) (p : ℝ × ℝ) : + pairLaplacian (f ∘ Complex.equivRealProdCLM.symm) p = + Laplacian.laplacian f (Complex.equivRealProdCLM.symm p) := by + have he := Complex.equivRealProdCLM.symm.iteratedFDerivWithin_comp_right + f (s := univ) uniqueDiffOn_univ (mem_univ (Complex.equivRealProdCLM.symm p)) 2 + simp only [preimage_univ,iteratedFDerivWithin_univ] at he + have h₁ := congrArg (fun B => B ![((1,0) : ℝ × ℝ),(1,0)]) he + have h₂ := congrArg (fun B => B ![((0,1) : ℝ × ℝ),(0,1)]) he + simp only [iteratedFDeriv_two_apply,ContinuousMultilinearMap.compContinuousLinearMap_apply, + Matrix.cons_val_zero,Matrix.cons_val_one,ContinuousLinearEquiv.coe_coe] at h₁ h₂ + have hc₁ : Complex.equivRealProdCLM.symm (1,0) = 1 := by simp [Complex.equivRealProdCLM_symm_apply] + have hc₂ : Complex.equivRealProdCLM.symm (0,1) = Complex.I := by simp [Complex.equivRealProdCLM_symm_apply] + rw [hc₁] at h₁ + rw [hc₂] at h₂ + rw [pairLaplacian,h₁,h₂,laplacian_eq_secondReal] + rfl + +lemma laplacian_eq_zero_outside_tsupport {ψ : ℂ → ℝ} {z : ℂ} + (hz : z ∉ tsupport ψ) : Laplacian.laplacian ψ z = 0 := by + have he := notMem_tsupport_iff_eventuallyEq.mp hz + have hh := laplacian_congr_nhds he + exact hh.eq_of_nhds.trans (by + change Laplacian.laplacian (fun _ : ℂ => (0 : ℝ)) z = 0 + rw [laplacian_const] + rfl) + +lemma continuous_laplacian {ψ : ℂ → ℝ} (hψ : ContDiff ℝ 2 ψ) : + Continuous (Laplacian.laplacian ψ) := by + have hh : ContDiff ℝ 0 (fderiv ℝ (fderiv ℝ ψ)) := + (hψ.fderiv_right (m := 1) (by norm_num)).fderiv_right (by norm_num) + have hc := hh.continuous + have he : Laplacian.laplacian ψ = fun z => secondReal ψ z 1 1+secondReal ψ z Complex.I Complex.I := + funext (laplacian_eq_secondReal ψ) + rw [he] + unfold secondReal + fun_prop + +lemma compactSupport_laplacian {ψ : ℂ → ℝ} (hψ : HasCompactSupport ψ) : + HasCompactSupport (Laplacian.laplacian ψ) := by + apply hψ.mono' + intro z hz + by_contra hn + exact hz (laplacian_eq_zero_outside_tsupport hn) + +lemma conformal_lintegral_le {F : ℂ → ℂ} {s : Set ℂ} (hs : MeasurableSet s) + (hF : ∀ z ∈ s, DifferentiableAt ℂ F z) (hi : InjOn F s) (b : ℂ → ℝ≥0∞) : + (∫⁻ z in s, ENNReal.ofReal (‖deriv F z‖^2)*b (F z)) ≤ ∫⁻ w, b w := by + have he := lintegral_image_eq_lintegral_abs_det_fderiv_mul volume hs + (fun z hz => (hF z hz).hasFDerivAt.restrictScalars ℝ |>.hasFDerivWithinAt) hi b + have hh : (∫⁻ z in s, ENNReal.ofReal (‖deriv F z‖^2)*b (F z)) = ∫⁻ w in F '' s, b w := by + rw [he] + apply setLIntegral_congr_fun hs + intro z hz + have hd := (hF z hz).hasFDerivAt.restrictScalars ℝ + have hf : (ContinuousLinearMap.restrictScalars ℝ (fderiv ℂ F z)) = fderiv ℝ F z := hd.fderiv.symm + dsimp only + rw [hf] + have hd' : (fderiv ℝ F z).det = ‖deriv F z‖^2 := det_fderiv_complex (hF z hz) + rw [hd',abs_of_nonneg (sq_nonneg _)] + rw [hh] + exact lintegral_mono' Measure.restrict_le_self le_rfl + +lemma conformal_cutoff_trace_bound {F : ℂ → ℂ} {ψ : ℂ → ℝ} + (hF : ∀ z : ℂ, 0 < z.im → AnalyticAt ℂ F z) + (hi : InjOn F {z : ℂ | 0 < z.im}) + (hψ : ContDiff ℝ 2 ψ) (hn : ∀ w, 0 ≤ ψ w) (_hψK : HasCompactSupport ψ) + (hproper : ∀ η : ℝ, 0 < η → IsCompact ({z : ℂ | η ≤ z.im} ∩ F ⁻¹' tsupport ψ)) + {H : ℝ} (hH : 0 ≤ H) + (hheight : ∀ z : ℂ, 0 < z.im → F z ∈ tsupport ψ → z.im ≤ H) : + ∀ ε : ℝ, 0 < ε → (∫⁻ x : ℝ, ENNReal.ofReal (ψ (F (x+ε*Complex.I)))) ≤ + ENNReal.ofReal H * ∫⁻ w : ℂ, ENNReal.ofReal |Laplacian.laplacian ψ w| := by + intro ε hε + let C := Complex.equivRealProdCLM.symm + let g : ℝ × ℝ → ℝ := (ψ ∘ F) ∘ C + have hc (p : ℝ × ℝ) (hp : 0 < p.2) : ContDiffAt ℝ 2 g p := by + have hz : 0 < (C p).im := hp + exact (hψ.contDiffAt.comp _ ((hF (C p) hz).contDiffAt.restrict_scalars ℝ)).comp _ C.contDiff.contDiffAt + have hK := (hproper (ε/2) (by linarith)).image Complex.equivRealProdCLM.continuous + have hs (p : ℝ × ℝ) (hp : ε/2 ≤ p.2) (hg : g p ≠ 0) : + p ∈ Complex.equivRealProdCLM '' ({z : ℂ | ε/2 ≤ z.im} ∩ F ⁻¹' tsupport ψ) := by + refine ⟨C p,⟨hp,subset_closure hg⟩,?_⟩ + exact Complex.equivRealProdCLM.apply_symm_apply p + have ht := half_trace_lintegral_le hε hc (fun p => hn _) hK hs + have ht' : (∫⁻ x : ℝ, ENNReal.ofReal (ψ (F (x+ε*Complex.I)))) ≤ + ∫⁻ z in {z : ℂ | ε ≤ z.im}, ENNReal.ofReal ((z.im-ε)*|Laplacian.laplacian (ψ ∘ F) z|) := by + have he := Complex.volume_preserving_equiv_real_prod.setLIntegral_comp_preimage_emb + Complex.measurableEquivRealProd.measurableEmbedding + (fun p : ℝ × ℝ => ENNReal.ofReal ((p.2-ε)*|pairLaplacian g p|)) {p : ℝ × ℝ | ε ≤ p.2} + have hh : (∫⁻ p in {p : ℝ × ℝ | ε ≤ p.2}, ENNReal.ofReal ((p.2-ε)*|pairLaplacian g p|)) = + ∫⁻ z in {z : ℂ | ε ≤ z.im}, ENNReal.ofReal ((z.im-ε)*|Laplacian.laplacian (ψ ∘ F) z|) := by + rw [← he] + apply lintegral_congr + intro z + dsimp only [g,C] + rw [pairLaplacian_complex] + rfl + rw [hh] at ht + simpa only [g,C,Function.comp_apply,Complex.equivRealProdCLM_symm_apply] using ht + refine ht'.trans ?_ + have hmeas : MeasurableSet {z : ℂ | ε ≤ z.im} := isClosed_le continuous_const Complex.continuous_im |>.measurableSet + calc + (∫⁻ z in {z : ℂ | ε ≤ z.im}, ENNReal.ofReal ((z.im-ε)*|Laplacian.laplacian (ψ ∘ F) z|)) ≤ + ∫⁻ z in {z : ℂ | ε ≤ z.im}, ENNReal.ofReal H * + (ENNReal.ofReal (‖deriv F z‖^2)*ENNReal.ofReal |Laplacian.laplacian ψ (F z)|) := by + apply setLIntegral_mono' hmeas + intro z hz + rw [laplacian_holomorphic_comp hψ.contDiffAt (hF z (hε.trans_le hz)), + abs_mul,abs_of_nonneg (sq_nonneg _),← ENNReal.ofReal_mul (sq_nonneg _), + ← ENNReal.ofReal_mul hH] + apply ENNReal.ofReal_le_ofReal + by_cases hd : Laplacian.laplacian ψ (F z) = 0 + · simp [hd] + have hm : F z ∈ tsupport ψ := by + by_contra hh + exact hd (laplacian_eq_zero_outside_tsupport hh) + nlinarith [sq_nonneg ‖deriv F z‖,abs_nonneg (Laplacian.laplacian ψ (F z)), + hheight z (hε.trans_le hz) hm, + mul_nonneg (sq_nonneg ‖deriv F z‖) (abs_nonneg (Laplacian.laplacian ψ (F z)))] + _ = ENNReal.ofReal H * ∫⁻ z in {z : ℂ | ε ≤ z.im}, + ENNReal.ofReal (‖deriv F z‖^2)*ENNReal.ofReal |Laplacian.laplacian ψ (F z)| := + lintegral_const_mul' _ _ ENNReal.ofReal_ne_top + _ ≤ _ := by + exact mul_le_mul le_rfl (conformal_lintegral_le hmeas + (fun z hz => (hF z (hε.trans_le hz)).differentiableAt) + (hi.mono (fun z hz => hε.trans_le hz)) + (fun w => ENNReal.ofReal |Laplacian.laplacian ψ w|)) zero_le zero_le + +lemma exists_trace_smooth_cutoff (K : Set ℂ) (hK : IsCompact K) : + ∃ ψ : ℂ → ℝ, ContDiff ℝ 2 ψ ∧ (∀ w, 0 ≤ ψ w) ∧ HasCompactSupport ψ ∧ + ∀ w ∈ K, ψ w = 1 := by + obtain ⟨R,hR⟩ := hK.isBounded.subset_closedBall (0 : ℂ) + let b : ContDiffBump (0 : ℂ) := ⟨max R 0+1,max R 0+2,by positivity,by linarith⟩ + refine ⟨b,b.contDiff,b.nonneg',b.hasCompactSupport,fun w hw => ?_⟩ + apply b.one_of_mem_closedBall + exact Metric.closedBall_subset_closedBall (by dsimp [b]; linarith [le_max_left R 0]) (hR hw) + +lemma conformal_trace_bound {F : ℂ → ℂ} + (hF : ∀ z : ℂ, 0 < z.im → AnalyticAt ℂ F z) + (hi : InjOn F {z : ℂ | 0 < z.im}) + (hproper : ∀ K : Set ℂ, IsCompact K → ∀ η : ℝ, 0 < η → + IsCompact ({z : ℂ | η ≤ z.im} ∩ F ⁻¹' K)) + (hheight : ∀ K : Set ℂ, IsCompact K → ∃ H : ℝ, 0 < H ∧ + ∀ z : ℂ, 0 < z.im → F z ∈ K → z.im ≤ H) + {K : Set ℂ} (hK : IsCompact K) : + ∃ C : ℝ≥0∞, C < ∞ ∧ ∀ ε : ℝ, 0 < ε → + volume {x : ℝ | F (x+ε*Complex.I) ∈ K} ≤ C := by + obtain ⟨ψ,hψ,hn,hψK,hψone⟩ := exists_trace_smooth_cutoff K hK + obtain ⟨H,hH,hHb⟩ := hheight (tsupport ψ) hψK + let C := ENNReal.ofReal H * ∫⁻ w : ℂ, ENNReal.ofReal |Laplacian.laplacian ψ w| + have hfin : C < ∞ := by + apply ENNReal.mul_lt_top ENNReal.ofReal_lt_top + have hi := (continuous_laplacian hψ).integrable_of_hasCompactSupport (μ := volume) (compactSupport_laplacian hψK) + simpa only [HasFiniteIntegral,← ofReal_norm,Real.norm_eq_abs] using hi.hasFiniteIntegral + refine ⟨C,hfin,fun ε hε => ?_⟩ + have hb := conformal_cutoff_trace_bound hF hi hψ hn hψK + (hproper (tsupport ψ) hψK) hH.le hHb ε hε + refine le_trans ?_ hb + have hcont : Continuous (fun x : ℝ => F (x+ε*Complex.I)) := by + apply continuous_iff_continuousAt.mpr + intro x + have hz : 0 < (x+ε*Complex.I : ℂ).im := by simpa using hε + exact (hF _ hz).continuousAt.comp (f := fun x : ℝ => (x+ε*Complex.I : ℂ)) + (by fun_prop) + have hm : MeasurableSet {x : ℝ | F (x+ε*Complex.I) ∈ K} := + hK.isClosed.measurableSet.preimage hcont.measurable + rw [← lintegral_indicator_one hm] + apply lintegral_mono + intro x + by_cases hx : F (x+ε*Complex.I) ∈ K + · simp [hx,hψone _ hx] + · simp [hx] + +lemma class_trace_bound (g : DiskClass) {β : ℝ} (hβ : 1 < β) + (hfin : (∫⁻ z in outsideCore, + ENNReal.ofReal (z.im^(β+1)*‖classFun g z‖⁻¹^4)) < ∞) + {K : Set ℂ} (hK : IsCompact K) : + ∃ C : ℝ≥0∞, C < ∞ ∧ ∀ ε : ℝ, 0 < ε → + volume {x : ℝ | classFun g (x+ε*Complex.I) ∈ K} ≤ C := by + apply conformal_trace_bound + (fun z hz => (classFun_schlicht g).1.1.analyticAt (isOpen_halfPlane.mem_nhds hz)) + (classFun_schlicht g).1.2 + (fun _ hK η hη => class_proper_preimage g hβ hfin hK hη) + (fun _ hK => class_preimage_height_bound g hβ hfin hK) hK + +lemma uniform_relative_class_bound : + ∃ M : ℝ, 0 ≤ M ∧ ∀ (g : DiskClass) (w : ℂ), |w.re| ≤ 1 → + (1/2 : ℝ) ≤ w.im → w.im ≤ 1 → ‖classFun g w‖ ≤ M := by + let B : Set (ℝ × ℝ) := Icc (-1,1/2) (1,1) + let K : Set ℂ := Complex.equivRealProdCLM.symm '' B + have hK : IsCompact K := isCompact_Icc.image Complex.equivRealProdCLM.symm.continuous + have hKsub : K ⊆ Set.range (fun w : halfPlane => (w : ℂ)) := by + rintro _ ⟨p,hp,rfl⟩ + refine ⟨⟨Complex.equivRealProdCLM.symm p,?_⟩,rfl⟩ + change 0 < p.2 + linarith [hp.1.2] + have hKs : IsCompact ((fun w : halfPlane => (w : ℂ)) ⁻¹' K) := + Topology.IsEmbedding.subtypeVal.isInducing.isCompact_preimage' hK hKsub + have hprod := (isCompact_univ (X := DiskClass)).prod hKs + obtain ⟨M,hM⟩ := hprod.exists_bound_of_continuousOn continuous_classFun_eval.continuousOn + refine ⟨max M 0,le_max_right _ _,fun g w hx hy hyy => ?_⟩ + have hw : w ∈ halfPlane := by change 0 < w.im; linarith + have hmem : (g,⟨w,hw⟩) ∈ (univ : Set DiskClass) ×ˢ ((fun w : halfPlane => (w : ℂ)) ⁻¹' K) := by + refine ⟨mem_univ _,⟨(w.re,w.im),?_,?_⟩⟩ + · exact ⟨⟨(abs_le.mp hx).1,hy⟩,⟨(abs_le.mp hx).2,hyy⟩⟩ + · exact Complex.equivRealProdCLM.symm_apply_apply w + exact (hM _ hmem).trans (le_max_left _ _) + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/TransferOperator.lean b/lean/OAI/Analysis/IntegralMeans/TransferOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..85780b34c5d6384de202fe5aa95384e222c8b4fa --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/TransferOperator.lean @@ -0,0 +1,230 @@ +import OAI.Analysis.IntegralMeans.TransportBoxes + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight +attribute [local irreducible] classFun + +def halfMul (z w : halfPlane) : halfPlane := ⟨affine z w,affine_mem z.2 w.2⟩ + +def halfPoint (x y : ℝ) (hy : 0 < y) : halfPlane := + ⟨(x : ℂ)+(y : ℂ)*Complex.I,by simpa [halfPlane]⟩ + +def horizontal (x : ℝ) : halfPlane := halfPoint x 1 zero_lt_one + +lemma halfPoint_mul (x y u v : ℝ) (hy : 0 < y) (hv : 0 < v) : + halfMul (halfPoint x y hy) (halfPoint u v hv) = halfPoint (x+y*u) (y*v) (mul_pos hy hv) := by + apply Subtype.ext + apply Complex.ext <;> simp [halfMul,halfPoint,affine] + +lemma halfMul_assoc (z w u : halfPlane) : halfMul (halfMul z w) u = halfMul z (halfMul w u) := + Subtype.ext (affine_assoc z w u) + +lemma halfOne_mul (z : halfPlane) : halfMul halfOne z = z := Subtype.ext (I_affine z) + +lemma halfMul_one (z : halfPlane) : halfMul z halfOne = z := Subtype.ext (affine_I z) + +lemma continuous_halfPoint.{u_1} {Y : Type u_1} [TopologicalSpace Y] {x y : Y → ℝ} + (hx : Continuous x) (hy : Continuous y) (hp : ∀ a, 0 < y a) : + Continuous (fun a => halfPoint (x a) (y a) (hp a)) := + ((Complex.continuous_ofReal.comp hx).add ((Complex.continuous_ofReal.comp hy).mul continuous_const)).subtype_mk _ + +lemma rerootClass_one (g : DiskClass) : rerootClass g halfOne = g := by + apply class_ext + intro z hz + rw [classFun_rerootClass _ _ hz] + simp [reroot,halfOne,(classFun_schlicht g).2.1,(classFun_schlicht g).2.2] + +lemma classWeight_one (g : DiskClass) : classWeight g halfOne = 1 := by + simp [classWeight,reciprocalDeriv,halfOne,(classFun_schlicht g).2.2] + +attribute [local irreducible] rerootClass + +def weightAt (z : halfPlane) : C(DiskClass,ℝ) := + ⟨fun g => classWeight g z,by + have hc : Continuous (fun g : DiskClass => (g,z)) := continuous_id.prodMk continuous_const + exact continuous_classWeight.comp hc⟩ + +def actionAt (z : halfPlane) : C(DiskClass,DiskClass) := + ⟨fun g => rerootClass g z,by + have hc : Continuous (fun g : DiskClass => (g,z)) := continuous_id.prodMk continuous_const + exact continuous_rerootClass.comp hc⟩ + +def affineOperator (z : halfPlane) : C(DiskClass,ℝ) →L[ℝ] C(DiskClass,ℝ) := + (ContinuousLinearMap.mul ℝ C(DiskClass,ℝ) (weightAt z)).comp (ContinuousMap.compCLM ℝ ℝ (actionAt z)) + +lemma affineOperator_apply (z : halfPlane) (f : C(DiskClass,ℝ)) (g : DiskClass) : + affineOperator z f g = classWeight g z * f (rerootClass g z) := rfl + +lemma affineOperator_pos (z : halfPlane) (f : C(DiskClass,ℝ)) (hf : 0 ≤ f) : + 0 ≤ affineOperator z f := fun g => mul_nonneg (classWeight_pos g z).le (hf _) + +lemma affineOperator_mul (z w : halfPlane) : + affineOperator z * affineOperator w = affineOperator (halfMul z w) := by + ext f g + change classWeight g z * (classWeight (rerootClass g z) w * f (rerootClass (rerootClass g z) w)) = _ + rw [← mul_assoc,classWeight_cocycle,rerootClass_comp] + rfl + +lemma affineOperator_one : affineOperator halfOne = 1 := by + ext f g + simp only [affineOperator_apply,classWeight_one,rerootClass_one,one_mul] + rfl + +lemma continuous_affineOperator_apply (f : C(DiskClass,ℝ)) : + Continuous (fun z : halfPlane => affineOperator z f) := by + apply ContinuousMap.continuous_of_continuous_uncurry + have hw : Continuous (fun p : halfPlane × DiskClass => classWeight p.2 p.1) := + continuous_classWeight.comp (continuous_swap : Continuous (Prod.swap : halfPlane × DiskClass → DiskClass × halfPlane)) + have ht : Continuous (fun p : halfPlane × DiskClass => rerootClass p.2 p.1) := + continuous_rerootClass.comp (continuous_swap : Continuous (Prod.swap : halfPlane × DiskClass → DiskClass × halfPlane)) + exact hw.mul (f.continuous.comp ht) + +lemma affineOperator_norm_le {z : halfPlane} {B : ℝ} (hB : 0 ≤ B) + (hw : ∀ g : DiskClass, classWeight g z ≤ B) : ‖affineOperator z‖ ≤ B := by + apply (affineOperator z).opNorm_le_bound hB + intro f + apply (ContinuousMap.norm_le _ (mul_nonneg hB (norm_nonneg f))).mpr + intro g + rw [affineOperator_apply,norm_mul,Real.norm_of_nonneg (classWeight_pos g z).le] + exact mul_le_mul (hw g) (ContinuousMap.norm_coe_le_norm f _) (norm_nonneg _) hB + +lemma classFun_identityClass : EqOn (classFun identityClass) identityHalf halfPlane := + classFun_classOfHalf identityHalf_schlicht + +lemma classWeight_identityClass (z : halfPlane) : classWeight identityClass z = 1 := by + have hd := classFun_identityClass.deriv isOpen_halfPlane z.2 + have hi : deriv identityHalf z = 1 := ((hasDerivAt_id (z : ℂ)).sub_const Complex.I).deriv + simp [classWeight,reciprocalDeriv,hd,hi] + +lemma reroot_identityClass (z : halfPlane) : rerootClass identityClass z = identityClass := by + apply class_ext + intro w hw + rw [classFun_rerootClass _ _ hw,reroot_congr classFun_identityClass z.2 hw,classFun_identityClass hw] + have hd : deriv identityHalf z = 1 := ((hasDerivAt_id (z : ℂ)).sub_const Complex.I).deriv + have he : (z.val.re : ℂ)+(z.val.im : ℂ)*Complex.I = z := by apply Complex.ext <;> simp + dsimp [reroot,identityHalf,affine] + rw [hd,mul_one] + apply (div_eq_iff (Complex.ofReal_ne_zero.mpr (ne_of_gt z.2))).mpr + linear_combination he + +def dyadicLeft : halfPlane := halfPoint (-1/2) (1/2) (by norm_num) + +def dyadicRight : halfPlane := halfPoint (1/2) (1/2) (by norm_num) + +def transferOperator : C(DiskClass,ℝ) →L[ℝ] C(DiskClass,ℝ) := + (1/2 : ℝ) • (affineOperator dyadicLeft+affineOperator dyadicRight) + +lemma transferOperator_pos (f : C(DiskClass,ℝ)) (hf : 0 ≤ f) : 0 ≤ transferOperator f := by + intro g + change 0 ≤ (1/2 : ℝ)*(affineOperator dyadicLeft f g+affineOperator dyadicRight f g) + exact mul_nonneg (by norm_num) (add_nonneg (affineOperator_pos _ f hf g) (affineOperator_pos _ f hf g)) + +lemma transferOperator_identityClass (f : C(DiskClass,ℝ)) : transferOperator f identityClass = f identityClass := by + change (1/2 : ℝ)*(affineOperator dyadicLeft f identityClass+affineOperator dyadicRight f identityClass) = _ + simp only [affineOperator_apply,classWeight_identityClass,reroot_identityClass,one_mul] + ring + +lemma transferOperator_pow_identityClass (n : ℕ) : (transferOperator^n) 1 identityClass = 1 := by + induction n with + | zero => rfl + | succ n ih => simpa only [pow_succ',mul_apply_eq_comp,transferOperator_identityClass] using ih + +lemma transferOperator_pow_norm_ge_one (n : ℕ) : 1 ≤ ‖transferOperator^n‖ := by + have hv := (ContinuousMap.norm_coe_le_norm ((transferOperator^n) 1) identityClass).trans + ((transferOperator^n).le_opNorm 1) + simpa only [transferOperator_pow_identityClass,norm_one,mul_one] using hv + +lemma diskCayley_norm_sq_identity {z : ℂ} (hz : z ∈ halfPlane) : + (1-‖diskCayley z‖^2)*‖z+Complex.I‖^2 = 4*z.im := by + have hd : ‖z+Complex.I‖ ≠ 0 := norm_ne_zero_iff.mpr (cayley_den_ne_zero hz) + rw [diskCayley,norm_div,div_pow] + field_simp + rw [Complex.sq_norm,Complex.sq_norm] + simp [Complex.normSq_apply] + ring + +lemma classFun_deriv_norm (g : DiskClass) (z : halfPlane) : + ‖deriv (classFun g) z‖ = 4*‖deriv (diskExtend g.1) (diskCayley z)‖/‖z.val+Complex.I‖^2 := by + have hd := (hasDerivAt_diskToHalf g.2.1.1 z.2).deriv + rw [classFun] + rw [hd,norm_div,norm_mul,norm_neg,norm_pow] + norm_num + +lemma classFun_reciprocal_norm (g : DiskClass) (z : halfPlane) : + ‖reciprocalDeriv (classFun g) z‖ = ‖z.val+Complex.I‖^2/ + (4*‖deriv (diskExtend g.1) (diskCayley z)‖) := by + rw [reciprocalDeriv,norm_inv,classFun_deriv_norm,inv_div] + +lemma classFun_reciprocal_bound (g : DiskClass) (z : halfPlane) : + ‖reciprocalDeriv (classFun g) z‖ ≤ ‖z.val+Complex.I‖^4/z.val.im := by + let r := ‖diskCayley z‖ + let D := ‖z.val+Complex.I‖^2 + let a := ‖deriv (diskExtend g.1) (diskCayley z)‖ + have hr0 : 0 ≤ r := norm_nonneg _ + have hr1 : r < 1 := by simpa [r,disk] using diskCayley_maps z.2 + have hD0 : 0 < D := sq_pos_of_ne_zero (norm_ne_zero_iff.mpr (cayley_den_ne_zero z.2)) + have ha0 : 0 < a := norm_pos_iff.mpr (univalent_deriv_ne_zero Metric.isOpen_ball g.2.1 (diskCayley_maps z.2)) + have he : (1-r^2)*D = 4*z.val.im := diskCayley_norm_sq_identity z.2 + have hlo : (1-r)/(1+r)^3 ≤ a := (schlicht_deriv_bounds g.2 (diskCayley_maps z.2)).1 + have hden : 0 < (1+r)^3 := pow_pos (by linarith) 3 + have h8 : (1+r)^3 ≤ 8 := by nlinarith [sq_nonneg (1-r),sq_nonneg r,mul_nonneg hr0 (sq_nonneg (1-r))] + have hl : 1-r ≤ 8*a := by + have hh := (div_le_iff₀ hden).mp hlo + nlinarith [mul_le_mul_of_nonneg_left h8 ha0.le] + have hD : 2*z.val.im ≤ (1-r)*D := by + have hh : (1-r^2) ≤ 2*(1-r) := by nlinarith [sq_nonneg (1-r)] + nlinarith [mul_le_mul_of_nonneg_right hh hD0.le] + have hDa : z.val.im ≤ 4*a*D := by + have hh := mul_le_mul_of_nonneg_right hl hD0.le + nlinarith + rw [classFun_reciprocal_norm] + change D/(4*a) ≤ ‖z.val+Complex.I‖^4/z.val.im + rw [div_le_div_iff₀ (by positivity : 0 < 4*a) z.2] + have hh := mul_le_mul_of_nonneg_right hDa hD0.le + dsimp [D] at * + nlinarith + +lemma classFun_strip_bound (g : DiskClass) {C₀ : ℝ} (hC : 0 ≤ C₀) (z : halfPlane) + (hx : |z.val.re| ≤ C₀) (hy : z.val.im ≤ 1) : + ‖reciprocalDeriv (classFun g) z‖ ≤ (C₀^2+4)^2/z.val.im := by + apply (classFun_reciprocal_bound g z).trans + apply div_le_div_of_nonneg_right _ z.2.le + have hD : ‖z.val+Complex.I‖^2 = z.val.re^2+(z.val.im+1)^2 := by + rw [Complex.sq_norm] + simp [Complex.normSq_apply] + ring + have hxr : z.val.re^2 ≤ C₀^2 := by nlinarith [sq_abs z.val.re,(sq_le_sq₀ (abs_nonneg _) hC).mpr hx] + have hDle : ‖z.val+Complex.I‖^2 ≤ C₀^2+4 := by + have hz0 : 0 < z.val.im := z.2 + rw [hD] + nlinarith [mul_nonneg hz0.le (sub_nonneg.mpr hy)] + nlinarith [sq_nonneg (‖z.val+Complex.I‖^2-(C₀^2+4))] + +lemma classFun_strip_bound_two (g : DiskClass) (z : halfPlane) + (hx : |z.val.re| ≤ 2) (hy : z.val.im ≤ 1) : + ‖reciprocalDeriv (classFun g) z‖ ≤ 64/z.val.im := by + convert classFun_strip_bound g (by norm_num : (0 : ℝ) ≤ 2) z hx hy using 1 + norm_num + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/TransportBoxes.lean b/lean/OAI/Analysis/IntegralMeans/TransportBoxes.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c3876b081b3e22ac485c32c0224929f8cc4576e --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/TransportBoxes.lean @@ -0,0 +1,219 @@ +import OAI.Analysis.IntegralMeans.GoodPairs + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +attribute [local irreducible] classWeight +attribute [local irreducible] classFun + +def displacementWindow (N : ℝ) (z w : ℂ) : Prop := + z.im ≤ N*w.im ∧ w.im ≤ N*z.im ∧ |w.re-z.re| ≤ N*z.im + +def transportWindow (k N : ℝ) : Set (DiskClass × halfPlane) := + {q | q ∈ pairingDomain k ∧ + displacementWindow N q.2 (criticalPair (classFun q.1) k q.2)} + +lemma measurableSet_transportWindow {k : ℝ} (hk : 0 < k) (N : ℝ) : + MeasurableSet (transportWindow k N) := by + have hr := measurable_criticalPair hk + have hz : Measurable (fun q : pairingDomain k => (q.val.2 : ℂ)) := + measurable_subtype_coe.comp (measurable_subtype_coe.snd) + have hm : MeasurableSet {q : pairingDomain k | + displacementWindow N q.val.2 (criticalPair (classFun q.val.1) k q.val.2)} := + (measurableSet_le (Complex.measurable_im.comp hz) + (measurable_const.mul (Complex.measurable_im.comp hr))).inter + ((measurableSet_le (Complex.measurable_im.comp hr) + (measurable_const.mul (Complex.measurable_im.comp hz))).inter + (measurableSet_le (((Complex.measurable_re.comp hr).sub (Complex.measurable_re.comp hz)).abs) + (measurable_const.mul (Complex.measurable_im.comp hz)))) + have h := (measurableSet_pairingDomain hk.le).subtype_image hm + convert h using 1 + ext q + simp only [transportWindow,mem_ofPred_eq,mem_image,Subtype.exists,exists_prop] + aesop + +lemma displacementWindow_affine (N : ℝ) {t : ℂ} (ht : t ∈ halfPlane) (z w : ℂ) : + displacementWindow N (affine t z) (affine t w) ↔ displacementWindow N z w := by + have him (v : ℂ) : (affine t v).im = t.im*v.im := by simp [affine] + have hre : (affine t w).re-(affine t z).re = t.im*(w.re-z.re) := by simp [affine]; ring + simp only [displacementWindow,him,hre,abs_mul,abs_of_pos (show 0 (g,z)) := measurable_const.prodMk measurable_id + have h := (measurableSet_transportWindow hk N).preimage hm + convert h using 1 + ext z + exact and_assoc.symm + +def transportBox (R a b : ℝ) : Set ℂ := {z | |z.re| ≤ R ∧ a ≤ z.im ∧ z.im ≤ b} + +lemma measurableSet_transportBox (R a b : ℝ) : MeasurableSet (transportBox R a b) := + (measurableSet_le Complex.measurable_re.abs measurable_const).inter + ((measurableSet_le measurable_const Complex.measurable_im).inter + (measurableSet_le Complex.measurable_im measurable_const)) + +lemma pair_mem_enlargedBox {N R Y : ℝ} (hN : 1 ≤ N) {z w : ℂ} + (hz : z ∈ transportBox R 1 Y) (hw : displacementWindow N z w) : + w ∈ transportBox (R+N*Y) (1/N) (N*Y) := by + have hn : 0 < N := lt_of_lt_of_le zero_lt_one hN + have hab : |w.re| ≤ |z.re|+|w.re-z.re| := by + calc |w.re| = |z.re+(w.re-z.re)| := by congr 1; ring + _ ≤ |z.re|+|w.re-z.re| := abs_add_le _ _ + refine ⟨hab.trans (add_le_add hz.1 (hw.2.2.trans (mul_le_mul_of_nonneg_left hz.2.2 hn.le))),?_, + hw.2.1.trans (mul_le_mul_of_nonneg_left hz.2.2 hn.le)⟩ + rw [div_le_iff₀ hn] + nlinarith [hw.1,hz.2.1] + +lemma fiberSum_mul_indicator.{u_1, u_2} {X : Type u_1} {Y : Type u_2} (f : X → Y) (s t : Set X) + (u : X → ℝ≥0∞) (y : Y) : + fiberSum f s (fun x => u x * t.indicator 1 x) y = fiberSum f (s ∩ t) u y := by + classical + rw [fiberSum,fiberSum,tsum_subtype {x | x ∈ s ∧ f x = y} (fun x => u x * t.indicator 1 x), + tsum_subtype {x | x ∈ s ∩ t ∧ f x = y} u] + apply tsum_congr + intro x + by_cases hs : x ∈ s <;> by_cases ht : x ∈ t <;> by_cases hy : f x = y <;> + simp [hs,ht,hy] + +lemma transport_box (g : DiskClass) {β k N R Y : ℝ} (hk : 0 < k) + (hb : β-1 = 4*(k-1)) (hN : 1 ≤ N) : + (∫⁻ z in halfPlane, transportDensity g β z * ENNReal.ofReal (normalizedJacobian (classFun g) k z) * + (transportSlice g k N ∩ transportBox R 1 Y).indicator 1 z) ≤ + ∫⁻ z in halfPlane, transportDensity g β z * ENNReal.ofReal (-normalizedJacobian (classFun g) k z) * + (transportBox (R+N*Y) (1/N) (N*Y)).indicator 1 z := by + let S := transportSlice g k N ∩ transportBox R 1 Y + let T := transportBox (R+N*Y) (1/N) (N*Y) + have hs : MeasurableSet S := (measurableSet_transportSlice g hk N).inter (measurableSet_transportBox R 1 Y) + have ht : MeasurableSet T := measurableSet_transportBox _ _ _ + have hp := transport_area g β k 1 (by norm_num) (measurable_const.indicator hs : Measurable (S.indicator (1 : ℂ → ℝ≥0∞))) + have hn := transport_area g β k (-1) (by norm_num) (measurable_const.indicator ht : Measurable (T.indicator (1 : ℂ → ℝ≥0∞))) + simp only [one_mul] at hp + simp only [neg_one_mul] at hn + apply le_trans hp.le + apply le_trans ?_ hn.symm.le + apply lintegral_mono + intro ξ + apply le_trans (fiberSum_mul_indicator (criticalMap (classFun g) k) (jacobianRegion g k 1) S (targetDensity g β) ξ).le + apply le_trans ?_ (fiberSum_mul_indicator (criticalMap (classFun g) k) (jacobianRegion g k (-1)) T (targetDensity g β) ξ).symm.le + apply fiberSum_mono_injective (criticalPair (classFun g) k) ξ + · intro z hz hG + have hsz := hz.2.1 + have hpair := criticalPair_spec (classFun_schlicht g).1 hk hsz.1 hsz.2.1 hsz.2.2.1 + exact ⟨⟨⟨hpair.1,by simpa only [neg_one_mul] using neg_pos.mpr hpair.2.2.1⟩, + pair_mem_enlargedBox hN hz.2.2 hsz.2.2.2⟩,hpair.2.1.trans hG⟩ + · apply (criticalPair_injective (classFun_schlicht g).1 hk).mono + intro z hz + exact ⟨hz.1.2.1.1,hz.1.2.1.2.1,hz.1.2.1.2.2.1⟩ + · intro z hz _ + exact targetDensity_le_pair g hk hb hz.2.1.1 hz.2.1.2.1 hz.2.1.2.2.1 + +lemma measurableSet_exceptionSlice (g : DiskClass) {k : ℝ} (hk : 0 < k) : + MeasurableSet {z : ℂ | z ∈ halfPlane ∧ ¬GoodPair (classFun g) k (criticalMap (classFun g) k z)} := by + apply measurableSet_halfPlane_pred + have hm : Measurable (fun z : halfPlane => (g,criticalMap (classFun g) k z)) := + (continuous_const.prodMk ((continuous_class_criticalMap k).comp + (show Continuous (fun z : halfPlane => (g,z)) from continuous_const.prodMk continuous_id))).measurable + exact ((measurableSet_class_goodPairs hk.le).preimage hm).compl + +lemma exceptional_transport_zero (g : DiskClass) {β k : ℝ} (hk : 0 < k) + (hg : ∀ᵐ ξ : ℂ, GoodPair (classFun g) k ξ) : + (∫⁻ z in halfPlane, transportDensity g β z * ENNReal.ofReal (normalizedJacobian (classFun g) k z) * + {z : ℂ | z ∈ halfPlane ∧ ¬GoodPair (classFun g) k (criticalMap (classFun g) k z)}.indicator 1 z) = 0 := by + have hs := measurableSet_exceptionSlice g hk + have he := transport_area g β k 1 (by norm_num) + (measurable_const.indicator hs : Measurable ({z : ℂ | z ∈ halfPlane ∧ ¬GoodPair (classFun g) k (criticalMap (classFun g) k z)}.indicator (1 : ℂ → ℝ≥0∞))) + simp only [one_mul] at he + refine he.trans ?_ + apply lintegral_eq_zero_of_ae_eq_zero + filter_upwards [hg] with ξ hξ + unfold fiberSum + apply ENNReal.tsum_eq_zero.mpr + intro z + have hn : z.val ∉ {z : ℂ | z ∈ halfPlane ∧ ¬GoodPair (classFun g) k (criticalMap (classFun g) k z)} := by + rintro ⟨_,hbad⟩ + exact hbad (z.property.2.symm ▸ hξ) + exact (congrArg (targetDensity g β z * ·) (indicator_of_notMem (f := (1 : ℂ → ℝ≥0∞)) hn)).trans (mul_zero _) + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/Turning.lean b/lean/OAI/Analysis/IntegralMeans/Turning.lean new file mode 100644 index 0000000000000000000000000000000000000000..56bcbc85672b076f45e14baf68d4296808fbc672 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/Turning.lean @@ -0,0 +1,441 @@ +import OAI.Analysis.IntegralMeans.LevelCurve + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +def secantTriangle : Set (ℝ × ℝ) := {p | 0 ≤ p.1 ∧ p.1 ≤ p.2 ∧ p.2 ≤ 1} + +lemma convex_secantTriangle : Convex ℝ secantTriangle := by + intro p hp q hq a b ha hb hab + change 0 ≤ a*p.1+b*q.1 ∧ a*p.1+b*q.1 ≤ a*p.2+b*q.2 ∧ a*p.2+b*q.2 ≤ 1 + rcases hp with ⟨hp0,hpst,hp1⟩ + rcases hq with ⟨hq0,hqst,hq1⟩ + refine ⟨add_nonneg (mul_nonneg ha hp0) (mul_nonneg hb hq0), + add_le_add (mul_le_mul_of_nonneg_left hpst ha) + (mul_le_mul_of_nonneg_left hqst hb), ?_⟩ + calc + _ ≤ a*1+b*1 := add_le_add (mul_le_mul_of_nonneg_left hp1 ha) + (mul_le_mul_of_nonneg_left hq1 hb) + _ = 1 := by simpa using hab + +lemma nonempty_secantTriangle : secantTriangle.Nonempty := ⟨(0,0), by simp [secantTriangle]⟩ + +def averagedDerivative (γ : ℝ → ℂ) (s t : ℝ) : ℂ := + ∫ u in (0 : ℝ)..1, deriv γ (s+u*(t-s)) + +lemma continuous_averagedDerivative {γ : ℝ → ℂ} (hγ : ContDiff ℝ 1 γ) : + Continuous (fun p : ℝ × ℝ => averagedDerivative γ p.1 p.2) := by + have hd : Continuous (deriv γ) := hγ.continuous_deriv (by norm_num) + have hi : Continuous (fun p : ℝ × ℝ => ∫ u in Icc (0 : ℝ) 1, deriv γ (p.1+u*(p.2-p.1))) := + continuous_parametric_integral_of_continuous (by fun_prop) isCompact_Icc + simpa [averagedDerivative, intervalIntegral.integral_of_le zero_le_one, + integral_Icc_eq_integral_Ioc] using hi + +lemma sub_smul_averagedDerivative {γ : ℝ → ℂ} (hγ : ContDiff ℝ 1 γ) (s t : ℝ) : + (t-s) • averagedDerivative γ s t = γ t-γ s := by + have hd : Continuous (deriv γ) := hγ.continuous_deriv (by norm_num) + have hD (u : ℝ) : HasDerivAt (fun v : ℝ => γ (s+v*(t-s))) + ((t-s) • deriv γ (s+u*(t-s))) u := by + simpa only [Function.comp_def, Pi.add_apply, id_eq, zero_add, one_mul] using ((hγ.differentiable (by norm_num) (s+u*(t-s))).hasDerivAt.scomp u + ((hasDerivAt_const u s).add ((hasDerivAt_id u).mul_const (t-s)))) + have hFTC := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun u _ => hD u) + (((hd.comp (show Continuous (fun u : ℝ => s+u*(t-s)) by fun_prop)).const_smul (t-s)).intervalIntegrable 0 1) + simpa [averagedDerivative, intervalIntegral.integral_smul, sub_eq_add_neg] using hFTC + +@[simp] lemma averagedDerivative_diag (γ : ℝ → ℂ) (s : ℝ) : + averagedDerivative γ s s = deriv γ s := by simp [averagedDerivative] + +def extendedSecant (γ : ℝ → ℂ) (p : ℝ × ℝ) : ℂ := + (1-(p.2-p.1)) • averagedDerivative γ p.1 p.2 - + (p.2-p.1) • averagedDerivative γ p.1 (p.2-1) + +lemma continuous_extendedSecant {γ : ℝ → ℂ} (hγ : ContDiff ℝ 1 γ) : + Continuous (extendedSecant γ) := by + have hc := continuous_averagedDerivative hγ + exact ((continuous_const.sub (continuous_snd.sub continuous_fst)).smul hc).sub + ((continuous_snd.sub continuous_fst).smul (hc.comp (show Continuous (fun p : ℝ × ℝ => (p.1,p.2-1)) by fun_prop))) + +@[simp] lemma extendedSecant_diag (γ : ℝ → ℂ) (s : ℝ) : + extendedSecant γ (s,s) = deriv γ s := by simp [extendedSecant] + +@[simp] lemma extendedSecant_corner (γ : ℝ → ℂ) : + extendedSecant γ (0,1) = -deriv γ 0 := by simp [extendedSecant] + +lemma extendedSecant_scale {γ : ℝ → ℂ} (hγ : ContDiff ℝ 1 γ) + (hp : Function.Periodic γ 1) (s t : ℝ) : + ((t-s)*(1-(t-s))) • extendedSecant γ (s,t) = + ((1-(t-s))^2+(t-s)^2) • (γ t-γ s) := by + have h₁ := sub_smul_averagedDerivative hγ s t + have h₂ := sub_smul_averagedDerivative hγ s (t-1) + rw [hp.sub_eq] at h₂ + change ((t-s)*(1-(t-s))) • ((1-(t-s)) • averagedDerivative γ s t - + (t-s) • averagedDerivative γ s (t-1)) = _ + calc + _ = (1-(t-s))^2 • ((t-s) • averagedDerivative γ s t) + + (t-s)^2 • ((t-1-s) • averagedDerivative γ s (t-1)) := by + simp only [smul_sub, smul_smul] + module + _ = _ := by rw [h₁, h₂, ← add_smul] + +lemma extendedSecant_ne_zero {γ : ℝ → ℂ} (hγ : ContDiff ℝ 1 γ) + (hp : Function.Periodic γ 1) (hinj : InjOn γ (Ico 0 1)) + (hd : ∀ t ∈ Icc (0 : ℝ) 1, deriv γ t ≠ 0) {p : ℝ × ℝ} + (hpt : p ∈ secantTriangle) : extendedSecant γ p ≠ 0 := by + rcases p with ⟨s,t⟩ + rcases hpt with ⟨hs, hst, ht⟩ + by_cases heq : s = t + · subst t + simpa using hd s ⟨hs, ht⟩ + by_cases hc : s = 0 ∧ t = 1 + · rcases hc with ⟨rfl,rfl⟩ + simpa using hd 0 (by simp) + have hst' : s < t := lt_of_le_of_ne hst heq + have hneq : γ t ≠ γ s := by + by_cases ht1 : t = 1 + · subst t + rw [hp.eq] + have hs0 : s ≠ 0 := fun h => hc ⟨h,rfl⟩ + exact fun h => hs0 ((hinj ⟨by norm_num, by norm_num⟩ ⟨hs,hst'⟩ h).symm) + · exact fun h => (ne_of_gt hst') (hinj ⟨hs.trans hst, lt_of_le_of_ne ht ht1⟩ + ⟨hs, hst'.trans_le ht⟩ h) + have hpos : 0 < (1-(t-s))^2+(t-s)^2 := by nlinarith [sq_nonneg (1-(t-s))] + intro he + have hscale := extendedSecant_scale hγ hp s t + rw [he, smul_zero] at hscale + exact hneq (sub_eq_zero.mp ((smul_eq_zero.mp hscale.symm).resolve_left hpos.ne')) + +lemma periodic_deriv {γ : ℝ → ℂ} (hp : Function.Periodic γ 1) : + Function.Periodic (deriv γ) 1 := by + intro t + rw [← deriv_comp_add_const γ 1 t] + congr 1 + exact funext hp + +lemma extendedSecant_edges {γ : ℝ → ℂ} (hγ : ContDiff ℝ 1 γ) + (hp : Function.Periodic γ 1) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : + extendedSecant γ (t,1) = -extendedSecant γ (0,t) := by + by_cases h0 : t = 0 + · subst t + simp + by_cases h1 : t = 1 + · subst t + simpa using (periodic_deriv hp).eq + have hd : t*(1-t) ≠ 0 := mul_ne_zero h0 (sub_ne_zero.mpr (Ne.symm h1)) + apply (smul_right_injective ℂ hd) + have ha := extendedSecant_scale hγ hp 0 t + have hb := extendedSecant_scale hγ hp t 1 + simp only [sub_zero] at ha + rw [hp.eq] at hb + have he : (1-t)*(1-(1-t)) = t*(1-t) := by ring + have he' : (1-(1-t))^2+(1-t)^2 = (1-t)^2+t^2 := by ring + rw [he, he'] at hb + change (t*(1-t)) • extendedSecant γ (t,1) = (t*(1-t)) • (-extendedSecant γ (0,t)) + rw [smul_neg, ha, hb, ← smul_neg] + congr 1 + module + +lemma extendedSecant_left_re_nonneg {γ : ℝ → ℂ} (hγ : ContDiff ℝ 1 γ) + (hp : Function.Periodic γ 1) (hm : ∀ t ∈ Icc (0 : ℝ) 1, (γ 0).re ≤ (γ t).re) + (hd : (deriv γ 0).re = 0) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : + 0 ≤ (extendedSecant γ (0,t)).re := by + by_cases h0 : t = 0 + · subst t + simp [hd] + by_cases h1 : t = 1 + · subst t + simp [hd] + have hpos : 0 < t*(1-t) := mul_pos (lt_of_le_of_ne ht.1 (Ne.symm h0)) + (sub_pos.mpr (lt_of_le_of_ne ht.2 h1)) + have hs := congrArg Complex.re (extendedSecant_scale hγ hp 0 t) + simp only [sub_zero, Complex.real_smul, Complex.mul_re, Complex.ofReal_re, + Complex.ofReal_im, zero_mul, sub_zero, Complex.sub_re] at hs + have hnonneg : 0 ≤ ((1-t)^2+t^2)*((γ t).re-(γ 0).re) := + mul_nonneg (add_nonneg (sq_nonneg _) (sq_nonneg _)) (sub_nonneg.mpr (hm t ht)) + nlinarith + +def triangleOrigin : secantTriangle := ⟨(0,0), by simp [secantTriangle]⟩ + +def triangleCorner : secantTriangle := ⟨(0,1), by simp [secantTriangle]⟩ + +def triangleEnd : secantTriangle := ⟨(1,1), by simp [secantTriangle]⟩ + +lemma exists_secant_log {γ : ℝ → ℂ} (hγ : ContDiff ℝ 1 γ) + (hp : Function.Periodic γ 1) (hinj : InjOn γ (Ico 0 1)) + (hd : ∀ t ∈ Icc (0 : ℝ) 1, deriv γ t ≠ 0) : + ∃ A : C(secantTriangle, ℂ), A triangleOrigin = Complex.log (deriv γ 0) ∧ + ∀ p, Complex.exp (A p) = extendedSecant γ p := by + let := convex_secantTriangle.contractibleSpace nonempty_secantTriangle + let := convex_secantTriangle.locallyPathConnectedSpace + let S : C(secantTriangle, ℂ) := + ⟨fun p => extendedSecant γ p, (continuous_extendedSecant hγ).comp continuous_subtype_val⟩ + have he : Complex.exp (Complex.log (deriv γ 0)) = S triangleOrigin := by + simpa [S, triangleOrigin] using Complex.exp_log (hd 0 (by simp)) + obtain ⟨A, ⟨hA0,hA⟩, -⟩ := Complex.isCoveringMapOn_exp.existsUnique_continuousMap_lifts S he + (fun p => extendedSecant_ne_zero hγ hp hinj hd p.property) + exact ⟨A, hA0, fun p => congrFun hA p⟩ + +lemma continuous_log_unique.{u_1} {X : Type u_1} [TopologicalSpace X] [PreconnectedSpace X] + {A B : X → ℂ} (hA : Continuous A) (hB : Continuous B) + (h : ∀ x, Complex.exp (A x) = Complex.exp (B x)) {x : X} (hx : A x = B x) : A = B := by + exact Complex.isCoveringMap_exp.eq_of_comp_eq hA hB + (by funext y; exact Subtype.ext (h y)) x hx + +def triangleLeft (t : unitInterval) : secantTriangle := + ⟨(0,t), by exact ⟨le_rfl, t.property.1, t.property.2⟩⟩ + +def triangleTop (t : unitInterval) : secantTriangle := + ⟨(t,1), by exact ⟨t.property.1, t.property.2, le_rfl⟩⟩ + +def triangleDiag (t : unitInterval) : secantTriangle := + ⟨(t,t), by exact ⟨t.property.1, le_rfl, t.property.2⟩⟩ + +lemma continuous_triangleLeft : Continuous triangleLeft := by + unfold triangleLeft + fun_prop + +lemma continuous_triangleTop : Continuous triangleTop := by + unfold triangleTop + fun_prop + +lemma continuous_triangleDiag : Continuous triangleDiag := by + unfold triangleDiag + fun_prop + +lemma mem_slitPlane_of_re_nonneg {z : ℂ} (hz : z ≠ 0) (hr : 0 ≤ z.re) : + z ∈ Complex.slitPlane := by + by_cases hi : z.im = 0 + · left + exact lt_of_le_of_ne hr (fun he => hz (Complex.ext he.symm hi)) + · exact Or.inr hi + +lemma log_neg_of_downward {z : ℂ} (hr : z.re = 0) (hi : z.im < 0) : + Complex.log (-z) = Complex.log z + (Real.pi : ℂ)*Complex.I := by + apply Complex.ext + · simp [Complex.log_re, norm_neg] + · have ha := Complex.arg_eq_neg_pi_div_two_iff.mpr ⟨hr,hi⟩ + have hb : Complex.arg (-z) = Real.pi/2 := + Complex.arg_eq_pi_div_two_iff.mpr ⟨by simpa using hr, by simpa using hi⟩ + simp only [Complex.log_im, Complex.add_im, Complex.mul_im, Complex.ofReal_re, + Complex.I_im, mul_one, Complex.ofReal_im, Complex.I_re, mul_zero, add_zero, ha, hb] + ring + +lemma tangent_turning_log {γ : ℝ → ℂ} (hγ : ContDiff ℝ 1 γ) + (hp : Function.Periodic γ 1) (hinj : InjOn γ (Ico 0 1)) + (hd : ∀ t ∈ Icc (0 : ℝ) 1, deriv γ t ≠ 0) + (hm : ∀ t ∈ Icc (0 : ℝ) 1, (γ 0).re ≤ (γ t).re) + (hr : (deriv γ 0).re = 0) (hi : (deriv γ 0).im < 0) : + ∃ T : C(unitInterval, ℂ), (∀ t, Complex.exp (T t) = deriv γ t) ∧ + T 1 = T 0 + (2*Real.pi : ℝ)*Complex.I := by + obtain ⟨A,hA0,hA⟩ := exists_secant_log hγ hp hinj hd + have hleftc : Continuous (fun t : unitInterval => + Complex.log (extendedSecant γ (triangleLeft t))) := by + rw [continuous_iff_continuousAt] + intro t + exact (continuousAt_clog (mem_slitPlane_of_re_nonneg + (extendedSecant_ne_zero hγ hp hinj hd (triangleLeft t).property) + (extendedSecant_left_re_nonneg hγ hp hm hr t.property))).comp (f := fun u : unitInterval => extendedSecant γ (triangleLeft u)) + ((continuous_extendedSecant hγ).comp + (continuous_subtype_val.comp continuous_triangleLeft)).continuousAt + have hleft : (fun t : unitInterval => A (triangleLeft t)) = + (fun t : unitInterval => Complex.log (extendedSecant γ (triangleLeft t))) := by + apply continuous_log_unique (x := (0 : unitInterval)) (A.continuous.comp continuous_triangleLeft) hleftc + · intro t + dsimp only [Function.comp_def] + rw [hA, Complex.exp_log + (extendedSecant_ne_zero hγ hp hinj hd (triangleLeft t).property)] + · simpa [Function.comp_def, triangleLeft, triangleOrigin] using hA0 + have hcorner : A triangleCorner = A triangleOrigin + (Real.pi : ℂ)*Complex.I := by + have hcl := congrFun hleft 1 + have hcl' : A triangleCorner = Complex.log (-deriv γ 0) := by + simpa [triangleLeft, triangleCorner] using hcl + rw [hcl', hA0, log_neg_of_downward hr hi] + have htop : (fun t : unitInterval => A (triangleTop t)) = + (fun t : unitInterval => A (triangleLeft t) + (Real.pi : ℂ)*Complex.I) := by + apply continuous_log_unique (x := (0 : unitInterval)) (A.continuous.comp continuous_triangleTop) + ((A.continuous.comp continuous_triangleLeft).add continuous_const) + · intro t + dsimp only [Function.comp_def, Pi.add_apply] + rw [Complex.exp_add, hA, hA, Complex.exp_pi_mul_I, mul_neg_one] + exact extendedSecant_edges hγ hp t.property + · exact hcorner + refine ⟨⟨fun t => A (triangleDiag t), A.continuous.comp continuous_triangleDiag⟩, + fun t => ?_, ?_⟩ + · exact (hA (triangleDiag t)).trans (extendedSecant_diag γ t) + · have hpt := congrFun htop 1 + change A triangleEnd = A triangleCorner + (Real.pi : ℂ)*Complex.I at hpt + change A triangleEnd = A triangleOrigin + (↑(2*Real.pi) : ℂ)*Complex.I + rw [hpt, hcorner] + push_cast + ring + +lemma regular_level_sublevel_nhds {f : ℂ → ℝ} {z : ℂ} + (hf : ContDiffAt ℝ 1 f z) (hp : fderiv ℝ f z ≠ 0) + {W : Set ℂ} (hW : W ∈ 𝓝 z) : + ∃ U : Set ℂ, IsOpen U ∧ z ∈ U ∧ U ⊆ W ∧ + IsPreconnected (U ∩ {w | f w < f z}) ∧ + (U ∩ {w | f w < f z}).Nonempty := by + obtain ⟨e,hz,her,_⟩ := exists_regular_level_chart hf hp + have het : e z ∈ e.target := e.map_source hz + have hn : e.target ∩ e.symm ⁻¹' W ∈ 𝓝 (e z) := + inter_mem (e.open_target.mem_nhds het) (by + have ht := (e.continuousAt_symm het).preimage_mem_nhds + (show W ∈ 𝓝 (e.symm (e z)) by rwa [e.left_inv hz]) + exact ht) + obtain ⟨r,hr,hball⟩ := Metric.mem_nhds_iff.mp hn + let B := Metric.ball (e z) r + let U := e.source ∩ e ⁻¹' B + have hBo : IsOpen B := Metric.isOpen_ball + have hBU : ∀ b ∈ B, b ∈ e.target ∧ e.symm b ∈ U := by + intro b hb + have hbt := (hball hb).1 + exact ⟨hbt,e.map_target hbt,by simpa only [mem_preimage,e.right_inv hbt] using hb⟩ + have hUo : IsOpen U := e.isOpen_inter_preimage hBo + have hzU : z ∈ U := ⟨hz,by simpa [B] using hr⟩ + have hUW : U ⊆ W := by + intro w hw + have h := (hball hw.2).2 + simpa only [mem_preimage,e.left_inv hw.1] using h + have he : U ∩ {w | f w < f z} = e.symm '' (B ∩ {b | b.re < f z}) := by + ext w + constructor + · rintro ⟨hw,hfw⟩ + exact ⟨e w,⟨hw.2,by simpa only [mem_ofPred,her] using hfw⟩,e.left_inv hw.1⟩ + · rintro ⟨b,⟨hb,hbr⟩,rfl⟩ + refine ⟨(hBU b hb).2,?_⟩ + have hh := her (e.symm b) + rw [e.right_inv (hBU b hb).1] at hh + change f (e.symm b) < f z + rw [← hh] + exact hbr + have hconv : Convex ℝ (B ∩ {b : ℂ | b.re < f z}) := + (convex_ball (e z) r).inter ((convex_Iio (f z)).linear_preimage Complex.reCLM.toLinearMap) + have hpc : IsPreconnected (U ∩ {w | f w < f z}) := by + rw [he] + exact hconv.isPreconnected.image e.symm (e.continuousOn_symm.mono (by + intro b hb; exact (hBU b hb.1).1)) + refine ⟨U,hUo,hzU,hUW,hpc,?_⟩ + rw [he] + apply Nonempty.image + refine ⟨e z - (r/2 : ℝ),?_,?_⟩ + · change dist (e z-(r/2 : ℝ)) (e z) < r + rw [dist_eq_norm,sub_sub_cancel_left,norm_neg,Complex.norm_real,Real.norm_eq_abs, + abs_of_pos (by linarith : (0 : ℝ) < r/2)] + linarith + · change (e z - (r/2 : ℝ)).re < f z + rw [Complex.sub_re,Complex.ofReal_re,her] + linarith + +lemma regular_level_frequently_below {f : ℂ → ℝ} {z : ℂ} + (hf : ContDiffAt ℝ 1 f z) (hp : fderiv ℝ f z ≠ 0) : + ∃ᶠ w in 𝓝 z, f w < f z := by + rw [frequently_iff] + intro P hP + obtain ⟨U,_,_,hUP,_,w,hwU,hwf⟩ := regular_level_sublevel_nhds hf hp hP + exact ⟨w,hUP hwU,hwf⟩ + +lemma regular_level_local_integer {f : ℂ → ℝ} {j : ℂ → ℤ} {c : ℝ} {z : ℂ} + (hf : ContDiffAt ℝ 1 f z) (hp : fderiv ℝ f z ≠ 0) (hz : f z = c) + (hj : ContinuousOn j {w | f w ≠ c}) (hj0 : ∀ w, c < f w → j w = 0) : + ∃ n : ℤ, ∀ᶠ w in 𝓝 z, f w ≠ c → j w = if f w < c then n else 0 := by + obtain ⟨U,hUo,hzU,_,hpc,w₀,hw₀,hfw₀⟩ := regular_level_sublevel_nhds hf hp + (show (univ : Set ℂ) ∈ 𝓝 z from univ_mem) + refine ⟨j w₀,?_⟩ + filter_upwards [hUo.mem_nhds hzU] with w hw hne + by_cases hlt : f w < c + · rw [ite_eq_left hlt] + have hdisc := (hpc.image j (hj.mono (by + intro v hv + have hh : f v < f z := hv.2 + exact ne_of_lt (by simpa only [hz] using hh)))).subsingleton + exact hdisc ⟨w,⟨hw,by change f w < f z; simpa only [hz] using hlt⟩,rfl⟩ ⟨w₀,⟨hw₀,hfw₀⟩,rfl⟩ + · rw [ite_eq_right hlt] + exact hj0 w (lt_of_le_of_ne (not_lt.mp hlt) hne.symm) + +lemma regular_level_local_integer_unique {f : ℂ → ℝ} {j : ℂ → ℤ} {c : ℝ} {z : ℂ} + (hf : ContDiffAt ℝ 1 f z) (hp : fderiv ℝ f z ≠ 0) (hz : f z = c) + {m n : ℤ} + (hm : ∀ᶠ w in 𝓝 z, f w ≠ c → j w = if f w < c then m else 0) + (hn : ∀ᶠ w in 𝓝 z, f w ≠ c → j w = if f w < c then n else 0) : m = n := by + obtain ⟨w,hw,hmw,hnw⟩ := ((regular_level_frequently_below hf hp).and_eventually + (hm.and hn)).exists + have hlt : f w < c := by simpa only [hz] using hw + have hm' := hmw hlt.ne + have hn' := hnw hlt.ne + simpa only [ite_eq_left hlt] using hm'.symm.trans hn' + +lemma regular_level_integer_constant_along {f : ℂ → ℝ} {j : ℂ → ℤ} + {c : ℝ} {γ : ℝ → ℂ} (hc : Continuous γ) + (hf : ∀ t, ContDiffAt ℝ 1 f (γ t)) (hp : ∀ t, fderiv ℝ f (γ t) ≠ 0) + (hz : ∀ t, f (γ t) = c) (hj : ContinuousOn j {w | f w ≠ c}) + (hj0 : ∀ w, c < f w → j w = 0) : + ∃ n : ℤ, ∀ t, ∀ᶠ w in 𝓝 (γ t), + f w ≠ c → j w = if f w < c then n else 0 := by + choose n hn using fun t => regular_level_local_integer (hf t) (hp t) (hz t) hj hj0 + have hnc : Continuous n := by + apply continuous_iff_continuousAt.mpr + intro t + have he : ∀ᶠ s in 𝓝 t, n s = n t := by + filter_upwards [(hc.tendsto t).eventually (hn t).eventually_nhds] with s hs + exact (regular_level_local_integer_unique (hf s) (hp s) (hz s) hs (hn s)).symm + exact continuousAt_const.congr (he.mono fun _ h => h.symm) + refine ⟨n 0,fun t => ?_⟩ + have he : n t = n 0 := TotallyDisconnectedSpace.eq_of_continuous n hnc t 0 + simpa only [he] using hn t + +lemma regular_level_loop_local_index {f : ℂ → ℝ} {c : ℝ} {γ : ℝ → ℂ} + (hc : Continuous γ) (hp : Function.Periodic γ 1) + (hinj : InjOn γ (Ico (0 : ℝ) 1)) {d : ℂ} + (hd : HasDerivAt γ d 0) (hdi : d.im < 0) + (hmin : ∀ t, (γ 0).re ≤ (γ t).re) + (hf : ∀ t, ContDiffAt ℝ 1 f (γ t)) + (hreg : ∀ t, fderiv ℝ f (γ t) ≠ 0) (hz : ∀ t, f (γ t) = c) + (hbelow : ∀ w, w ∉ range γ → loopIndex (periodicLoop hc 0) w ≠ 0 → f w < c) : + ∀ t, ∀ᶠ w in 𝓝 (γ t), f w ≠ c → + loopIndex (periodicLoop hc 0) w = if f w < c then 1 else 0 := by + have hj : ContinuousOn (loopIndex (periodicLoop hc 0)) {w | f w ≠ c} := + (continuousOn_loopIndex _ (periodicLoop_closed hc hp 0)).mono (by + intro w hw + rintro ⟨t,rfl⟩ + exact hw (hz ((t:ℝ)+0))) + have hj0 : ∀ w, c < f w → loopIndex (periodicLoop hc 0) w = 0 := by + intro w hw + by_contra hn + have hwr : w ∉ range γ := by rintro ⟨t,rfl⟩; linarith [hz t] + exact (hbelow w hwr hn).not_gt hw + obtain ⟨n,hn⟩ := regular_level_integer_constant_along hc hf hreg hz hj hj0 + obtain ⟨δ,hδ,hjump⟩ := winding_leftmost_normal hc hp hinj hd hdi hmin + have ht : Tendsto (fun r : ℝ => γ 0+r • (Complex.I*d)) (𝓝 0) (𝓝 (γ 0)) := by + have h : Continuous (fun r : ℝ => γ 0+r • (Complex.I*d)) := by fun_prop + simpa only [zero_smul,add_zero] using h.tendsto 0 + obtain ⟨ε,hε,he⟩ := Metric.mem_nhds_iff.mp (ht.eventually (hn 0)) + let r := min δ ε /2 + have hr : 0 < r := by dsimp [r]; exact half_pos (lt_min hδ hε) + have hrd : r ≤ δ := by dsimp [r]; linarith [min_le_left δ ε] + have hre : r < ε := by dsimp [r]; linarith [min_le_right δ ε] + obtain ⟨hoff,hi⟩ := hjump r hr hrd + have hlt := hbelow _ hoff (by rw [hi]; norm_num) + have hh := he (show r ∈ Metric.ball (0 : ℝ) ε by + simpa only [Metric.mem_ball,Real.dist_eq,sub_zero,abs_of_pos hr] using hre) hlt.ne + have hne : n = 1 := by simpa only [ite_eq_left hlt,hi] using hh.symm + simpa only [hne] using hn + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/UnivalentArea.lean b/lean/OAI/Analysis/IntegralMeans/UnivalentArea.lean new file mode 100644 index 0000000000000000000000000000000000000000..dae1a46c926d57e18a59537e863e1cbbfe72e57b --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/UnivalentArea.lean @@ -0,0 +1,261 @@ +import OAI.Analysis.IntegralMeans.Degree + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +lemma exists_smooth_cutoff {K U : Set ℂ} (hK : IsCompact K) (hU : IsOpen U) + (hKU : K ⊆ U) : + ∃ χ : ℂ → ℝ, ContDiff ℝ 2 χ ∧ HasCompactSupport χ ∧ tsupport χ ⊆ U ∧ + (∀ z ∈ K, χ =ᶠ[𝓝 z] fun _ => 1) ∧ ∀ z, χ z ∈ Icc 0 1 := by + obtain ⟨L,hL,hLc,hKL,hLU⟩ := exists_compact_closed_between hK hU hKU + obtain ⟨χ,hχ1,hχ0,hχrange⟩ := + exists_contMDiffMap_one_nhds_of_subset_interior 𝓘(ℝ,ℂ) hK.isClosed hKL (n := 2) + have hs : tsupport (χ : ℂ → ℝ) ⊆ L := by + apply closure_minimal _ hLc + intro z hz + by_contra hn + exact hz (hχ0 z hn) + refine ⟨χ,contMDiff_iff_contDiff.mp χ.contMDiff, + hL.of_isClosed_subset (isClosed_tsupport _) hs,hs.trans hLU,?_,hχrange⟩ + intro z hz + exact hχ1.filter_mono (nhds_le_nhdsSet hz) + +lemma det_fderiv_complex {f : ℂ → ℂ} {z : ℂ} (hd : DifferentiableAt ℂ f z) : + LinearMap.det (fderiv ℝ f z).toLinearMap = ‖deriv f z‖^2 := by + rw [(hd.hasDerivAt.hasFDerivAt.restrictScalars ℝ).fderiv,determinant_complex_real, + ← Complex.normSq_eq_norm_sq] + simp only [ContinuousLinearMap.coe_coe, ContinuousLinearMap.coe_restrictScalars', + ContinuousLinearMap.toSpanSingleton_apply, smul_eq_mul, one_mul, + Complex.I_mul, Complex.normSq_apply] + ring + +lemma smooth_extension_near_compact {K U : Set ℂ} (hK : IsCompact K) + (hU : IsOpen U) (hKU : K ⊆ U) {x : ℂ → ℂ} + (hx : ∀ z ∈ U, ContDiffAt ℝ 2 x z) : + ∃ X : ℂ → ℂ, ContDiff ℝ 2 X ∧ ∀ z ∈ K, X =ᶠ[𝓝 z] x := by + obtain ⟨χ,hχc,_hχK,hχU,hχ1,_hχrange⟩ := exists_smooth_cutoff hK hU hKU + let X := fun z => (χ z : ℂ)*x z + have hX : ContDiff ℝ 2 X := by + rw [contDiff_iff_contDiffAt] + intro z + by_cases hz : z ∈ tsupport χ + · exact (Complex.ofRealCLM.contDiff.contDiffAt.comp z hχc.contDiffAt).mul (hx z (hχU hz)) + · have he : X =ᶠ[𝓝 z] fun _ => 0 := by + filter_upwards [isClosed_tsupport χ |>.isOpen_compl.mem_nhds hz] with w hw + have hzero : χ w = 0 := notMem_support.mp (fun h => hw (subset_tsupport χ h)) + simp only [X,hzero,Complex.ofReal_zero,zero_mul] + exact contDiffAt_const.congr_of_eventuallyEq he + refine ⟨X,hX,?_⟩ + intro z hz + filter_upwards [hχ1 z hz] with w hw + simp only [X,hw,Complex.ofReal_one,one_mul] + +lemma meromorphic_boundary_winding_le_zero {h H : ℂ → ℂ} + (hh : DifferentiableOn ℂ h (Metric.ball 0 1)) + (hH : DifferentiableOn ℂ H (Metric.ball 0 1 \ {0})) + (hdef : ∀ z ∈ Metric.ball (0 : ℂ) 1, z ≠ 0 → H z = z⁻¹+h z) + (hHd : ∀ z ∈ Metric.ball (0 : ℂ) 1 \ {0}, deriv H z ≠ 0) + (hHi : InjOn H (Metric.ball 0 1 \ {0})) + {r : ℝ} (hr : 0 < r) (hr1 : r < 1) (ξ : ℂ) + (hξ : ξ ∉ H '' Metric.sphere 0 r) : + windingNumber (⟨fun t => H ((r : ℂ)*circleLoop t)-ξ, by + refine Continuous.sub ?_ continuous_const + apply hH.continuousOn.comp_continuous (by fun_prop) + intro t + have he : ‖(r : ℂ)*circleLoop t‖ = r := by simp [abs_of_pos hr] + constructor + · rw [Metric.mem_ball,dist_zero_right,he] + exact hr1 + · change (r : ℂ)*circleLoop t ≠ 0 + exact norm_pos_iff.mp (by rw [he]; exact hr)⟩) ≤ 0 := by + classical + let U : Set ℂ := Metric.ball 0 1 + let K : Set ℂ := Metric.closedBall 0 r + have hKU : K ⊆ U := Metric.closedBall_subset_ball hr1 + let x : ℂ → ℂ := fun z => 1+z*(h z-ξ) + have hx (z) (hz : z ∈ U) : AnalyticAt ℂ x z := by + exact analyticAt_const.add (analyticAt_id.mul ((hh.analyticOnNhd Metric.isOpen_ball z hz).sub analyticAt_const)) + obtain ⟨X,hXc,hX⟩ := smooth_extension_near_compact (isCompact_closedBall 0 r) + Metric.isOpen_ball hKU (fun z hz => (hx z hz).contDiffAt.restrict_scalars ℝ) + have hXval (z) (hz : z ∈ K) : X z = x z := (hX z hz).self_of_nhds + have hxzero {z} (hz : z ∈ U) : x z = 0 ↔ z ≠ 0 ∧ H z = ξ := by + by_cases hz0 : z = 0 + · simp [x,hz0] + · rw [hdef z hz hz0] + dsimp [x] + field_simp + constructor <;> intro he + · exact ⟨hz0,by linear_combination he⟩ + · linear_combination he.2 + have hss : {z | z ∈ K ∧ X z = 0}.Subsingleton := by + intro z hz w hw + obtain ⟨hz0,hzξ⟩ := (hxzero (hKU hz.1)).mp ((hXval z hz.1) ▸ hz.2) + obtain ⟨hw0,hwξ⟩ := (hxzero (hKU hw.1)).mp ((hXval w hw.1) ▸ hw.2) + exact hHi ⟨hKU hz.1,hz0⟩ ⟨hKU hw.1,hw0⟩ (hzξ.trans hwξ.symm) + let s := hss.finite.toFinset + have hs (z) : z ∈ s ↔ z ∈ K ∧ X z = 0 := by simp [s] + have hder (z) (hz : z ∈ s) : DifferentiableAt ℂ X z ∧ deriv X z ≠ 0 := by + have hzK := ((hs z).mp hz).1 + have hzero := ((hs z).mp hz).2 + obtain ⟨hz0,hzξ⟩ := (hxzero (hKU hzK)).mp (by rwa [hXval z hzK] at hzero) + have hUz : z ∈ Metric.ball (0 : ℂ) 1 \ {0} := ⟨hKU hzK,hz0⟩ + have hHd' := (hH z hUz).differentiableAt ((Metric.isOpen_ball.sdiff isClosed_singleton).mem_nhds hUz) + have heq : x =ᶠ[𝓝 z] fun w => w*(H w-ξ) := by + filter_upwards [(Metric.isOpen_ball.sdiff isClosed_singleton).mem_nhds hUz] with w hw + have hw0 : w ≠ 0 := hw.2 + rw [hdef w hw.1 hw0] + dsimp [x] + field_simp [hw0] + ring + have hD : HasDerivAt X (z*deriv H z) z := by + have hD := (hasDerivAt_id z).mul (hHd'.hasDerivAt.sub_const ξ) + simp only [hzξ,sub_self,mul_zero,zero_add] at hD + exact hD.congr_of_eventuallyEq ((hX z hzK).trans heq) + exact ⟨hD.differentiableAt,hD.deriv ▸ mul_ne_zero hz0 (hHd z hUz)⟩ + let γ : C(unitInterval,ℂ) := (r : ℂ) • circleLoop + have hγnorm (t) : ‖γ t‖ = r := by simp [γ,abs_of_pos hr] + have hγK (t) : γ t ∈ K := by simpa [K] using (hγnorm t).le + have hγU (t) : γ t ∈ U := hKU (hγK t) + have hγ0 (t) : γ t ≠ 0 := norm_pos_iff.mp (by rw [hγnorm]; exact hr) + have hγξ (t) : H (γ t) ≠ ξ := fun he => hξ ⟨γ t,by simpa using hγnorm t,he⟩ + let Y : C(ℂ,ℂ) := ⟨X,hXc.continuous⟩ + have hXY (t) : Y (γ t) = γ t*(H (γ t)-ξ) := by + rw [show Y (γ t) = X (γ t) from rfl,hXval _ (hγK t),hdef _ (hγU t) (hγ0 t)] + dsimp only [x] + field_simp [hγ0 t] + ring + have hγnonzero (t) : Y (γ t) ≠ 0 := by rw [hXY]; exact mul_ne_zero (hγ0 t) (sub_ne_zero.mpr (hγξ t)) + have hi := windingNumber_finite_regular_zeros (convex_closedBall (0 : ℂ) r) s Y + (fun z => fderiv ℝ X z) (fun z hz => ((hs z).mp hz).1) + (fun z hz => by simp [hs,show z ∈ K from hz,Y]) + (fun z hz => ⟨((hder z hz).1.restrictScalars ℝ).hasFDerivAt,by + rw [det_fderiv_complex (hder z hz).1] + exact pow_ne_zero _ (norm_ne_zero_iff.mpr (hder z hz).2)⟩) + γ (by simp [γ]) hγK hγnonzero + have hins (z) (hz : z ∈ s) : ‖z‖ < r := by + have hzK := ((hs z).mp hz).1 + have hle : ‖z‖ ≤ r := by simpa [K] using hzK + refine lt_of_le_of_ne hle ?_ + intro he + have hzero := ((hs z).mp hz).2 + have hzξ := ((hxzero (hKU hzK)).mp (by rwa [hXval z hzK] at hzero)).2 + exact hξ ⟨z,by simpa using he,hzξ⟩ + have hi' : windingNumber (Y.comp γ) = (s.card : ℤ) := by + rw [hi] + calc + _ = ∑ _z ∈ s, (1 : ℤ) := by + apply Finset.sum_congr rfl + intro z hz + rw [loopIndex_circle_inside hr (hins z hz),mul_one] + simp only [planeIndex,det_fderiv_complex (hder z hz).1, + sq_pos_of_pos (norm_pos_iff.mpr (hder z hz).2),ite_true] + _ = ↑s.card := by simp + have hcard : s.card ≤ 1 := Finset.card_le_one.mpr (by + intro z hz w hw + exact hss ((hs z).mp hz) ((hs w).mp hw)) + let η : C(unitInterval,ℂ) := ⟨fun t => H (γ t)-ξ,by + refine Continuous.sub ?_ continuous_const + apply hH.continuousOn.comp_continuous γ.continuous + exact fun t => ⟨hγU t,hγ0 t⟩⟩ + have he : Y.comp γ = γ*η := by ext t; exact hXY t + have hwγ : windingNumber γ = 1 := by + apply windingNumber_eq_of_logIncrement (by simp [γ]) + simpa [γ] using circleLoop_logIncrement (r : ℂ) (by exact_mod_cast hr.ne') + rw [he,windingNumber_mul γ η (by simp [γ]) (by simp [η,γ]) hγ0 + (fun t => sub_ne_zero.mpr (hγξ t)),hwγ] at hi' + change windingNumber η ≤ 0 + have hc : (s.card : ℤ) ≤ 1 := by exact_mod_cast hcard + omega + +lemma det_holomorphic_plus_conjugate {h : ℂ → ℂ} {z : ℂ} + (hh : DifferentiableAt ℂ h z) (a : ℝ) : + LinearMap.det (fderiv ℝ (fun w => a • conj w+h w) z).toLinearMap = + ‖deriv h z‖^2-a^2 := by + have hD := (Complex.conjCLE.hasFDerivAt.const_smul a).add + (hh.hasDerivAt.hasFDerivAt.restrictScalars ℝ) + change HasFDerivAt (fun w => a • conj w+h w) _ z at hD + rw [hD.fderiv,determinant_complex_real,← Complex.normSq_eq_norm_sq] + simp only [ContinuousLinearMap.coe_coe,add_apply, + smul_apply,ContinuousLinearMap.coe_restrictScalars', + ContinuousLinearMap.toSpanSingleton_apply, + smul_eq_mul,one_mul,Complex.real_smul,Complex.normSq_apply] + simp [Complex.add_re,Complex.add_im,Complex.mul_re,Complex.mul_im] + ring + +lemma meromorphic_univalent_area {h H : ℂ → ℂ} + (hh : DifferentiableOn ℂ h (Metric.ball 0 1)) + (hH : DifferentiableOn ℂ H (Metric.ball 0 1 \ {0})) + (hdef : ∀ z ∈ Metric.ball (0 : ℂ) 1, z ≠ 0 → H z = z⁻¹+h z) + (hHd : ∀ z ∈ Metric.ball (0 : ℂ) 1 \ {0}, deriv H z ≠ 0) + (hHi : InjOn H (Metric.ball 0 1 \ {0})) + {r : ℝ} (hr : 0 < r) (hr1 : r < 1) : + ∫ z in Metric.closedBall 0 r, ‖deriv h z‖^2 ∂volume ≤ + volume.real (Metric.closedBall (0 : ℂ) r) * (r^2)⁻¹^2 := by + let K : Set ℂ := Metric.closedBall 0 r + let x : ℂ → ℂ := fun z => (r^2)⁻¹ • conj z+h z + have hKU : K ⊆ Metric.ball 0 1 := Metric.closedBall_subset_ball hr1 + have hx (z) (hz : z ∈ Metric.ball (0 : ℂ) 1) : ContDiffAt ℝ 2 x z := by + exact (Complex.conjCLE.contDiff.contDiffAt.const_smul (r^2)⁻¹).add + ((hh.analyticOnNhd Metric.isOpen_ball z hz).contDiffAt.restrict_scalars ℝ) + obtain ⟨X,hXc,hX⟩ := smooth_extension_near_compact (isCompact_closedBall 0 r) + Metric.isOpen_ball hKU hx + have hXval (z) (hz : z ∈ K) : X z = x z := (hX z hz).self_of_nhds + have hb (z) (hz : z ∈ Metric.sphere (0 : ℂ) r) : X z = H z := by + have hn : ‖z‖ = r := by simpa using hz + have hz0 : z ≠ 0 := norm_pos_iff.mp (by rw [hn];exact hr) + rw [hXval z (Metric.sphere_subset_closedBall hz),hdef z (hKU (Metric.sphere_subset_closedBall hz)) hz0] + dsimp [x] + rw [Complex.inv_def,Complex.normSq_eq_norm_sq,hn] + congr 1 + simp [mul_comm] + have hw (ξ) (hξ : ξ ∉ X '' Metric.sphere 0 r) : + windingNumber (⟨fun t => X ((r : ℂ)*circleLoop t)-ξ,by fun_prop⟩) ≤ 0 := by + have hξ' : ξ ∉ H '' Metric.sphere 0 r := by + rintro ⟨z,hz,hzξ⟩ + exact hξ ⟨z,hz,(hb z hz).trans hzξ⟩ + have hw := meromorphic_boundary_winding_le_zero hh hH hdef hHd hHi hr hr1 ξ hξ' + convert hw using 2 + ext t + change X ((r : ℂ)*circleLoop t)-ξ = H ((r : ℂ)*circleLoop t)-ξ + rw [hb _ (by simp [abs_of_pos hr])] + have hi := integral_jacobian_nonpos_of_boundary_winding + (hXc.of_le (by norm_num)) hr hw + have hdet (z) (hz : z ∈ K) : + LinearMap.det (fderiv ℝ X z).toLinearMap = ‖deriv h z‖^2-(r^2)⁻¹^2 := by + rw [(hX z hz).fderiv_eq] + exact det_holomorphic_plus_conjugate + ((hh z (hKU hz)).differentiableAt (Metric.isOpen_ball.mem_nhds (hKU hz))) _ + have hdcont : ContinuousOn (deriv h) K := + (hh.deriv Metric.isOpen_ball).continuousOn.mono hKU + have hint : IntegrableOn (fun z => ‖deriv h z‖^2) K := + (hdcont.norm.pow 2).integrableOn_compact (isCompact_closedBall 0 r) + have hconst : IntegrableOn (fun _ : ℂ => (r^2)⁻¹^2) K := + integrableOn_const (isCompact_closedBall 0 r).measure_ne_top + have he : (∫ z in K, LinearMap.det (fderiv ℝ X z).toLinearMap) = + (∫ z in K, ‖deriv h z‖^2) - volume.real K * (r^2)⁻¹^2 := by + rw [setIntegral_congr_fun measurableSet_closedBall hdet, + integral_sub hint hconst] + simp + rw [he] at hi + exact sub_nonpos.mp hi + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/IntegralMeans/Winding.lean b/lean/OAI/Analysis/IntegralMeans/Winding.lean new file mode 100644 index 0000000000000000000000000000000000000000..a13f6588b5de17d23c6d0a92d350eb4049f6efe1 --- /dev/null +++ b/lean/OAI/Analysis/IntegralMeans/Winding.lean @@ -0,0 +1,460 @@ +import OAI.Analysis.IntegralMeans.CriticalPoint + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter Function InnerProductSpace +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open MeasureTheory Function +open Set Filter +open Set MeasureTheory Filter Function +open Set MeasureTheory Filter Function InnerProductSpace +open TopologicalSpace +open scoped CompactlySupported +open scoped ENNReal +open scoped Manifold +open scoped Topology CompactlySupported ComplexConjugate +open scoped Topology ComplexConjugate Manifold NNReal ENNReal InnerProductSpace Classical +open scoped Topology ENNReal NNReal +namespace Brennan + +lemma HasLogIncrement.path_trans {a b c : ℂ} {γ : Path a b} {η : Path b c} + {p q : ℂ} (hγ : HasLogIncrement γ.toContinuousMap p) + (hη : HasLogIncrement η.toContinuousMap q) : + HasLogIncrement (γ.trans η).toContinuousMap (p+q) := by + obtain ⟨A,hA,hp⟩ := hγ + obtain ⟨B,hB,hq⟩ := hη + let α : Path (A 0) (A 1) := ⟨A,rfl,rfl⟩ + let β : Path (A 1) (B 1+A 1-B 0) := + ⟨⟨fun t => B t+A 1-B 0, by fun_prop⟩, by simp, rfl⟩ + refine ⟨(α.trans β).toContinuousMap, ?_, ?_⟩ + · intro t + change Complex.exp ((α.trans β) t) = (γ.trans η) t + rw [Path.trans_apply,Path.trans_apply] + split_ifs with h + · exact hA _ + · dsimp only [β,ContinuousMap.coe_mk,Path.coe_mk_mk] + have heA : Complex.exp (A 1) = b := (hA 1).trans γ.target + have heB : Complex.exp (B 0) = b := (hB 0).trans η.source + have hb : b ≠ 0 := heB ▸ Complex.exp_ne_zero (B 0) + rw [Complex.exp_sub,Complex.exp_add,heA,heB,hB] + exact mul_div_cancel_right₀ _ hb + · change (α.trans β) 1-(α.trans β) 0=p+q + simp only [Path.target,Path.source] + linear_combination hp+hq + +lemma HasLogIncrement.path_symm {a b : ℂ} {γ : Path a b} {q : ℂ} + (hγ : HasLogIncrement γ.toContinuousMap q) : + HasLogIncrement γ.symm.toContinuousMap (-q) := by + obtain ⟨A,hA,hq⟩ := hγ + refine ⟨⟨fun t => A (unitInterval.symm t), by fun_prop⟩, ?_, ?_⟩ + · exact fun t => hA (unitInterval.symm t) + · simp only [ContinuousMap.coe_mk,unitInterval.symm_one,unitInterval.symm_zero] + linear_combination -hq + +lemma exists_path_logIncrement {a b : ℂ} (γ : Path a b) (hn : ∀ t, γ t ≠ 0) : + ∃ q, HasLogIncrement γ.toContinuousMap q := by + let := (convex_Icc (𝕜 := ℝ) (0 : ℝ) 1).contractibleSpace + (show (Icc (0 : ℝ) 1).Nonempty from ⟨0,by simp⟩) + let := (convex_Icc (𝕜 := ℝ) (0 : ℝ) 1).locallyPathConnectedSpace + obtain ⟨A,hA⟩ := exists_log_lift_of_simplyConnected (0 : unitInterval) γ.toContinuousMap hn + exact ⟨A 1-A 0,A,hA,rfl⟩ + +lemma HasLogIncrement.of_slit (γ : C(unitInterval,ℂ)) + (hγ : ∀ t, γ t ∈ Complex.slitPlane) : + HasLogIncrement γ (Complex.log (γ 1)-Complex.log (γ 0)) := by + exact ⟨⟨fun t => Complex.log (γ t),γ.continuous.clog hγ⟩, + fun t => Complex.exp_log (Complex.slitPlane_ne_zero (hγ t)),rfl⟩ + +lemma HasLogIncrement.of_neg_slit (γ : C(unitInterval,ℂ)) + (hγ : ∀ t, -γ t ∈ Complex.slitPlane) : + HasLogIncrement γ (Complex.log (-γ 1)-Complex.log (-γ 0)) := by + refine ⟨⟨fun t => Complex.log (-γ t)+(Real.pi : ℂ)*Complex.I, + ((γ.continuous.neg).clog hγ).add continuous_const⟩,?_,?_⟩ + · intro t + simp only [ContinuousMap.coe_mk,Complex.exp_add,Complex.exp_pi_mul_I] + rw [Complex.exp_log (Complex.slitPlane_ne_zero (hγ t))] + ring + · dsimp only [ContinuousMap.coe_mk] + ring + +lemma log_neg_of_im_neg {z : ℂ} (hi : z.im < 0) : + Complex.log (-z) = Complex.log z+(Real.pi : ℂ)*Complex.I := by + apply Complex.ext + · simp [Complex.log_re,norm_neg] + · simpa [Complex.log_im] using Complex.arg_neg_eq_arg_add_pi_of_im_neg hi + +lemma log_neg_of_im_pos {z : ℂ} (hi : 0 < z.im) : + Complex.log (-z) = Complex.log z-(Real.pi : ℂ)*Complex.I := by + apply Complex.ext + · simp [Complex.log_re,norm_neg] + · simpa [Complex.log_im] using Complex.arg_neg_eq_arg_sub_pi_of_im_pos hi + +def rectPath (r h : ℝ) : Path ((-r : ℂ)-(h : ℂ)*Complex.I) + ((-r : ℂ)-(h : ℂ)*Complex.I) := + (((Path.segment ((-r : ℂ)-(h : ℂ)*Complex.I) ((r : ℂ)-(h : ℂ)*Complex.I)).trans + (Path.segment ((r : ℂ)-(h : ℂ)*Complex.I) ((r : ℂ)+(h : ℂ)*Complex.I))).trans + (Path.segment ((r : ℂ)+(h : ℂ)*Complex.I) ((-r : ℂ)+(h : ℂ)*Complex.I))).trans + (Path.segment ((-r : ℂ)+(h : ℂ)*Complex.I) ((-r : ℂ)-(h : ℂ)*Complex.I)) + +lemma rectPath_logIncrement {r h : ℝ} (hr : 0 < r) (hh : 0 < h) : + HasLogIncrement (rectPath r h).toContinuousMap (2*Real.pi*Complex.I) := by + let a : ℂ := (-r : ℂ)-(h : ℂ)*Complex.I + let b : ℂ := (r : ℂ)-(h : ℂ)*Complex.I + let c : ℂ := (r : ℂ)+(h : ℂ)*Complex.I + let d : ℂ := (-r : ℂ)+(h : ℂ)*Complex.I + have hab (t : unitInterval) : (Path.segment a b) t ∈ Complex.slitPlane := by + apply Complex.mem_slitPlane_iff.mpr + right + simp only [Path.segment_apply,AffineMap.lineMap_apply_module,a,b,Complex.add_im, + Complex.sub_im,Complex.real_smul,Complex.mul_im,Complex.ofReal_re, + Complex.ofReal_im,Complex.I_re,Complex.I_im,Complex.neg_im] + nlinarith + have hbc (t : unitInterval) : (Path.segment b c) t ∈ Complex.slitPlane := by + apply Complex.mem_slitPlane_iff.mpr + left + simp only [Path.segment_apply,AffineMap.lineMap_apply_module,b,c,Complex.add_re, + Complex.sub_re,Complex.real_smul,Complex.mul_re,Complex.ofReal_re, + Complex.ofReal_im,Complex.I_re,Complex.I_im] + nlinarith + have hcd (t : unitInterval) : (Path.segment c d) t ∈ Complex.slitPlane := by + apply Complex.mem_slitPlane_iff.mpr + right + simp only [Path.segment_apply,AffineMap.lineMap_apply_module,c,d,Complex.add_im, + Complex.real_smul,Complex.mul_im,Complex.ofReal_re, + Complex.ofReal_im,Complex.I_re,Complex.I_im,Complex.neg_im] + nlinarith + have hda (t : unitInterval) : -(Path.segment d a) t ∈ Complex.slitPlane := by + apply Complex.mem_slitPlane_iff.mpr + left + simp only [Path.segment_apply,AffineMap.lineMap_apply_module,d,a,Complex.add_re, + Complex.sub_re,Complex.real_smul,Complex.mul_re,Complex.ofReal_re, + Complex.ofReal_im,Complex.I_re,Complex.I_im,Complex.neg_re] + nlinarith + have h₁ := HasLogIncrement.of_slit (Path.segment a b).toContinuousMap hab + have h₂ := HasLogIncrement.of_slit (Path.segment b c).toContinuousMap hbc + have h₃ := HasLogIncrement.of_slit (Path.segment c d).toContinuousMap hcd + have h₄ := HasLogIncrement.of_neg_slit (Path.segment d a).toContinuousMap hda + have he := ((h₁.path_trans h₂).path_trans h₃).path_trans h₄ + have ha : a.im < 0 := by simpa [a] using hh + have hd : 0 < d.im := by simpa [d] using hh + have hla := log_neg_of_im_neg ha + have hld := log_neg_of_im_pos hd + convert he using 1 + · rfl + · simp only [Path.coe_toContinuousMap,Path.target,Path.source] + rw [hla,hld] + ring + +lemma rectPath_winding {r h : ℝ} (hr : 0 < r) (hh : 0 < h) : + windingNumber (rectPath r h).toContinuousMap = 1 := by + apply windingNumber_eq_of_logIncrement ((rectPath r h).target.trans (rectPath r h).source.symm) + simpa only [Int.cast_one,one_mul] using rectPath_logIncrement hr hh + +lemma windingNumber_path_symm {a b : ℂ} (γ : Path a b) + (hc : γ 1 = γ 0) (hn : ∀ t, γ t ≠ 0) : + windingNumber γ.symm.toContinuousMap = -windingNumber γ.toContinuousMap := by + apply windingNumber_eq_of_logIncrement (by simpa using hc.symm) + convert (windingNumber_spec γ.toContinuousMap hc hn).path_symm using 1 + push_cast + ring + +lemma windingNumber_four_paths {a b c d : ℂ} + (α : Path a b) (β : Path b c) (χ : Path c d) (δ : Path d a) + (hβc : β 1 = β 0) (hδc : δ 1 = δ 0) + (hχ : χ.toContinuousMap = α.symm.toContinuousMap) + (hα : ∀ t, α t ≠ 0) (hβ : ∀ t, β t ≠ 0) (hδ : ∀ t, δ t ≠ 0) : + windingNumber (((α.trans β).trans χ).trans δ).toContinuousMap = + windingNumber β.toContinuousMap + windingNumber δ.toContinuousMap := by + obtain ⟨p,hp⟩ := exists_path_logIncrement α hα + have hq := windingNumber_spec β.toContinuousMap hβc hβ + have hr := windingNumber_spec δ.toContinuousMap hδc hδ + have hs : HasLogIncrement χ.toContinuousMap (-p) := hχ ▸ hp.path_symm + apply windingNumber_eq_of_logIncrement + ((((α.trans β).trans χ).trans δ).target.trans + (((α.trans β).trans χ).trans δ).source.symm) + convert ((hp.path_trans hq).path_trans hs).path_trans hr using 1 + push_cast + ring + +lemma windingNumber_rect_map (H : ℂ → ℂ) (hH : Continuous H) (r h : ℝ) + (hp : ∀ x : ℝ, H ((x : ℂ)+(h : ℂ)*Complex.I) = + H ((x : ℂ)-(h : ℂ)*Complex.I)) + (hn : ∀ z ∈ range (rectPath r h), H z ≠ 0) : + windingNumber (((rectPath r h).map hH).toContinuousMap) = + windingNumber (((Path.segment ((r : ℂ)-(h : ℂ)*Complex.I) + ((r : ℂ)+(h : ℂ)*Complex.I)).map hH).toContinuousMap) - + windingNumber (((Path.segment ((-r : ℂ)-(h : ℂ)*Complex.I) + ((-r : ℂ)+(h : ℂ)*Complex.I)).map hH).toContinuousMap) := by + let a : ℂ := (-r : ℂ)-(h : ℂ)*Complex.I + let b : ℂ := (r : ℂ)-(h : ℂ)*Complex.I + let c : ℂ := (r : ℂ)+(h : ℂ)*Complex.I + let d : ℂ := (-r : ℂ)+(h : ℂ)*Complex.I + let α := (Path.segment a b).map hH + let β := (Path.segment b c).map hH + let χ := (Path.segment c d).map hH + let δ := (Path.segment d a).map hH + have hpc : H c = H b := hp r + have hpa : H d = H a := by simpa only [Complex.ofReal_neg] using hp (-r) + have hβc : β 1 = β 0 := β.target.trans (hpc.trans β.source.symm) + have hδc : δ 1 = δ 0 := δ.target.trans (hpa.symm.trans δ.source.symm) + have hχ : χ.toContinuousMap = α.symm.toContinuousMap := by + ext t + simp only [Path.coe_toContinuousMap,χ,α,Path.map_coe,Function.comp_apply,Path.symm_apply, + Path.segment_apply,AffineMap.lineMap_apply_module] + have he₁ : (1-(t:ℝ)) • c + (t:ℝ) • d = + (((1-(t:ℝ))*r+(t:ℝ)*(-r):ℝ):ℂ)+(h:ℂ)*Complex.I := by + simp [c,d,Complex.real_smul] + ring + have he₂ : (1-(unitInterval.symm t:ℝ)) • a+(unitInterval.symm t:ℝ) • b = + (((1-(t:ℝ))*r+(t:ℝ)*(-r):ℝ):ℂ)-(h:ℂ)*Complex.I := by + simp [a,b,Complex.real_smul] + ring + rw [he₁,he₂] + exact hp _ + have hsub : range (Path.segment a b) ∪ range (Path.segment b c) ∪ + range (Path.segment c d) ∪ range (Path.segment d a) ⊆ range (rectPath r h) := by + intro z hz + change z ∈ range ((((Path.segment a b).trans (Path.segment b c)).trans + (Path.segment c d)).trans (Path.segment d a)) + simpa only [Path.trans_range] using hz + have hα : ∀ t, α t ≠ 0 := fun t => hn _ (hsub (Or.inl (Or.inl (Or.inl ⟨t,rfl⟩)))) + have hβ : ∀ t, β t ≠ 0 := fun t => hn _ (hsub (Or.inl (Or.inl (Or.inr ⟨t,rfl⟩)))) + have hδ : ∀ t, δ t ≠ 0 := fun t => hn _ (hsub (Or.inr ⟨t,rfl⟩)) + have hi := windingNumber_four_paths α β χ δ hβc hδc hχ hα hβ hδ + have hs := windingNumber_path_symm δ hδc hδ + have he : δ.symm.toContinuousMap = ((Path.segment a d).map hH).toContinuousMap := by + ext t + simp [δ,Path.segment_symm] + rw [he] at hs + have hg : (((rectPath r h).map hH).toContinuousMap) = + (((α.trans β).trans χ).trans δ).toContinuousMap := by + simp only [rectPath,Path.map_trans] + rfl + rw [hg,hi] + change windingNumber β.toContinuousMap + windingNumber δ.toContinuousMap = + windingNumber β.toContinuousMap - windingNumber ((Path.segment a d).map hH).toContinuousMap + rw [hs] + omega + +lemma transverse_hasFDerivAt {γ : ℝ → ℂ} {d : ℂ} (hd : HasDerivAt γ d 0) : + HasFDerivAt (fun w : ℂ => γ w.im-γ 0-w.re • (Complex.I*d)) + ((-Complex.I*d) • ContinuousLinearMap.id ℝ ℂ) 0 := by + have h := ((hd.hasFDerivAt.comp (0 : ℂ) (Complex.imCLM.hasFDerivAt)).sub_const + (γ 0)).sub (Complex.reCLM.hasFDerivAt.smul_const (Complex.I*d)) + have he : ContinuousLinearMap.toSpanSingleton ℝ d ∘L Complex.imCLM - + Complex.reCLM.smulRight (Complex.I*d) = + (-Complex.I*d) • ContinuousLinearMap.id ℝ ℂ := by + ext z + apply Complex.ext <;> simp [Complex.real_smul] <;> ring + rw [he] at h + exact h + +lemma det_transverse_pos {d : ℂ} (hd : d ≠ 0) : + 0 < LinearMap.det (((-Complex.I*d) • ContinuousLinearMap.id ℝ ℂ).toLinearMap) := by + rw [det_complex_smul] + simp only [ContinuousLinearMap.coe_id,LinearMap.det_id,mul_one] + exact sq_pos_of_pos (norm_pos_iff.mpr (mul_ne_zero (neg_ne_zero.mpr Complex.I_ne_zero) hd)) + +lemma periodic_simple_zero {γ : ℝ → ℂ} (hp : Function.Periodic γ 1) + (hinj : InjOn γ (Ico (0 : ℝ) 1)) {t : ℝ} (ht : t ∈ Icc (-(1/2 : ℝ)) (1/2)) + (he : γ t = γ 0) : t = 0 := by + by_cases hn : 0 ≤ t + · exact hinj ⟨hn,by linarith [ht.2]⟩ ⟨le_rfl,by norm_num⟩ he + · have hne : t+1 = 0 := hinj ⟨by linarith [ht.1],by linarith⟩ + ⟨le_rfl,by norm_num⟩ ((hp t).trans he) + linarith [ht.1] + +lemma transverse_unique_zero_strip {γ : ℝ → ℂ} (hc : Continuous γ) + (hp : Function.Periodic γ 1) (hinj : InjOn γ (Ico (0 : ℝ) 1)) + {d : ℂ} (hd : HasDerivAt γ d 0) (hdn : d ≠ 0) : + ∃ δ : ℝ, 0 < δ ∧ ∀ w : ℂ, |w.re| ≤ δ → |w.im| ≤ 1/2 → + (γ w.im-γ 0-w.re • (Complex.I*d) = 0 ↔ w = 0) := by + let H : ℂ → ℂ := fun w => γ w.im-γ 0-w.re • (Complex.I*d) + have hH0 : H 0 = 0 := by simp [H] + obtain ⟨_,r,hr,hlocal⟩ := exists_slit_radius_pos hH0 (transverse_hasFDerivAt hd) + (det_transverse_pos hdn) + let η := min (r/2) (1/4 : ℝ) + have hη : 0 < η := lt_min (by linarith) (by norm_num) + let K : Set ℝ := Icc (-(1/2 : ℝ)) (1/2) ∩ {t | η ≤ |t|} + have hK : IsCompact K := isCompact_Icc.inter_right + (isClosed_le continuous_const continuous_abs) + obtain ⟨m,hm,hbound⟩ := hK.exists_forall_le' ((hc.sub continuous_const).norm.continuousOn) + (a := (0 : ℝ)) (fun t ht => norm_pos_iff.mpr (sub_ne_zero.mpr (by + intro he + have he0 := periodic_simple_zero hp hinj ht.1 he + have hb : η ≤ |t| := ht.2 + simp only [he0,abs_zero] at hb + exact (not_le.mpr hη) hb))) + let δ := min (r/2) (m/(2*‖d‖)) + have hδ : 0 < δ := lt_min (by linarith) (div_pos hm (by positivity)) + refine ⟨δ,hδ,?_⟩ + intro w hre him + constructor + · intro hz + by_contra hwn + by_cases hi : |w.im| < η + · have hn : ‖w-0‖ < 2*r := by + simpa only [sub_zero] using calc + ‖w‖ ≤ |w.re|+|w.im| := Complex.norm_le_abs_re_add_abs_im w + _ < r/2+r/2 := by + have hδr := min_le_left (r/2) (m/(2*‖d‖)) + have hηr := min_le_left (r/2) (1/4 : ℝ) + dsimp only [δ] at hre + dsimp only [η] at hi + linarith + _ < 2*r := by linarith + have hnon := Complex.slitPlane_ne_zero (hlocal w hn hwn) + apply hnon + simp only [H,hz,zero_div] + · have hb := hbound w.im ⟨abs_le.mp him,not_lt.mp hi⟩ + change m ≤ ‖γ w.im-γ 0‖ at hb + have he : γ w.im-γ 0 = w.re • (Complex.I*d) := sub_eq_zero.mp hz + have hnorm : ‖γ w.im-γ 0‖ = |w.re| *‖d‖ := by + rw [he,norm_smul,Real.norm_eq_abs,norm_mul,Complex.norm_I,one_mul] + have hδm : δ*‖d‖ ≤ m/2 := by + have h := min_le_right (r/2) (m/(2*‖d‖)) + have hn := norm_pos_iff.mpr hdn + dsimp only [δ] + apply (le_div_iff₀ hn).mp + convert h using 1; field_simp + have : |w.re| *‖d‖ ≤ m/2 := (mul_le_mul_of_nonneg_right hre (norm_nonneg d)).trans hδm + linarith + · rintro rfl + simp + +def rectRegion (r h : ℝ) : Set ℂ := {z | |z.re| ≤ r ∧ |z.im| ≤ h} + +lemma convex_rectRegion (r h : ℝ) : Convex ℝ (rectRegion r h) := by + have he : rectRegion r h = (Complex.reCLM ⁻¹' Icc (-r) r) ∩ + (Complex.imCLM ⁻¹' Icc (-h) h) := by + ext z + simp [rectRegion,abs_le] + rw [he] + exact ((convex_Icc (-r) r).linear_preimage Complex.reCLM.toLinearMap).inter + ((convex_Icc (-h) h).linear_preimage Complex.imCLM.toLinearMap) + +lemma rectPath_mem {r h : ℝ} (hr : 0 ≤ r) (hh : 0 ≤ h) (t : unitInterval) : + rectPath r h t ∈ rectRegion r h := by + have hs (a b : ℂ) (ha : a ∈ rectRegion r h) (hb : b ∈ rectRegion r h) : + range (Path.segment a b) ⊆ rectRegion r h := by + rintro _ ⟨s,rfl⟩ + simpa only [Path.segment_apply,AffineMap.lineMap_apply_module] using + (convex_rectRegion r h) ha hb (sub_nonneg.mpr s.2.2) s.2.1 (by ring) + have h₁ : ((-r : ℂ)-(h : ℂ)*Complex.I) ∈ rectRegion r h := by + simp [rectRegion,abs_of_nonneg hr,abs_of_nonneg hh] + have h₂ : ((r : ℂ)-(h : ℂ)*Complex.I) ∈ rectRegion r h := by + simp [rectRegion,abs_of_nonneg hr,abs_of_nonneg hh] + have h₃ : ((r : ℂ)+(h : ℂ)*Complex.I) ∈ rectRegion r h := by + simp [rectRegion,abs_of_nonneg hr,abs_of_nonneg hh] + have h₄ : ((-r : ℂ)+(h : ℂ)*Complex.I) ∈ rectRegion r h := by + simp [rectRegion,abs_of_nonneg hr,abs_of_nonneg hh] + have hb : range (rectPath r h) ⊆ rectRegion r h := by + simp only [rectPath,Path.trans_range] + exact union_subset (union_subset (union_subset (hs _ _ h₁ h₂) (hs _ _ h₂ h₃)) + (hs _ _ h₃ h₄)) (hs _ _ h₄ h₁) + exact hb ⟨t,rfl⟩ + +lemma rectPath_ne_zero {r h : ℝ} (hr : 0 < r) (hh : 0 < h) (t : unitInterval) : + rectPath r h t ≠ 0 := by + obtain ⟨T,hT,_⟩ := rectPath_logIncrement hr hh + exact (hT t ▸ Complex.exp_ne_zero (T t)) + +lemma winding_jump_centred {γ : ℝ → ℂ} (hc : Continuous γ) + (hp : Function.Periodic γ 1) (hinj : InjOn γ (Ico (0 : ℝ) 1)) + {d : ℂ} (hd : HasDerivAt γ d 0) (hdn : d ≠ 0) : + ∃ δ : ℝ, 0 < δ ∧ ∀ r : ℝ, 0 < r → r ≤ δ → + loopIndex ⟨fun t : unitInterval => γ ((t : ℝ)-1/2), + hc.comp (continuous_subtype_val.sub continuous_const)⟩ + (γ 0+r • (Complex.I*d)) - + loopIndex ⟨fun t : unitInterval => γ ((t : ℝ)-1/2), + hc.comp (continuous_subtype_val.sub continuous_const)⟩ + (γ 0-r • (Complex.I*d)) = 1 := by + let H : C(ℂ,ℂ) := ⟨fun w => γ w.im-γ 0-w.re • (Complex.I*d), + ((hc.comp Complex.continuous_im).sub continuous_const).sub + (Complex.continuous_re.smul continuous_const)⟩ + let A : ℂ →L[ℝ] ℂ := (-Complex.I*d) • ContinuousLinearMap.id ℝ ℂ + obtain ⟨δ,hδ,hzero⟩ := transverse_unique_zero_strip hc hp hinj hd hdn + refine ⟨δ,hδ,?_⟩ + intro r hr hrd + let p := rectPath r (1/2) + have hp0 : ∀ t, p t ≠ 0 := rectPath_ne_zero hr (by norm_num) + have hmem : ∀ t, p t ∈ rectRegion r (1/2) := rectPath_mem hr.le (by norm_num) + have hz : ∀ z ∈ rectRegion r (1/2), H z = 0 ↔ z ∈ ({0} : Finset ℂ) := by + intro z hz + simpa only [Finset.mem_singleton,H,ContinuousMap.coe_mk] using hzero z (hz.1.trans hrd) hz.2 + have hn : ∀ t, H (p t) ≠ 0 := by + intro t ht + exact hp0 t (Finset.mem_singleton.mp ((hz _ (hmem t)).mp ht)) + have hi := windingNumber_finite_regular_zeros (convex_rectRegion r (1/2)) {0} H + (fun _ => A) (by intro z hz; simpa [Finset.mem_singleton,rectRegion] using + (show |z.re| ≤ r ∧ |z.im| ≤ 1/2 from by simpa [Finset.mem_singleton.mp hz] using + (show (0 : ℝ) ≤ r ∧ (0 : ℝ) ≤ 1/2 from ⟨hr.le,by norm_num⟩))) hz + (by intro z hz; have he := Finset.mem_singleton.mp hz; subst z + exact ⟨transverse_hasFDerivAt hd,ne_of_gt (det_transverse_pos hdn)⟩) + p.toContinuousMap (p.target.trans p.source.symm) hmem hn + have hindex : planeIndex A = 1 := by + simp only [A,planeIndex,ite_eq_left (det_transverse_pos hdn)] + have hpindex : loopIndex p.toContinuousMap 0 = 1 := by + change windingNumber (⟨fun t => p t-0,by fun_prop⟩ : C(unitInterval,ℂ)) = 1 + have he : (⟨fun t => p t-0,by fun_prop⟩ : C(unitInterval,ℂ)) = p.toContinuousMap := by + ext t; simp + rw [he] + exact rectPath_winding hr (by norm_num) + simp only [Finset.sum_singleton,hindex,hpindex,mul_one] at hi + have hperiod : ∀ x : ℝ, H ((x : ℂ)+((1/2 : ℝ) : ℂ)*Complex.I) = + H ((x : ℂ)-((1/2 : ℝ) : ℂ)*Complex.I) := by + intro x + change γ (((x : ℂ)+((1/2 : ℝ) : ℂ)*Complex.I).im)-γ 0- + (((x : ℂ)+((1/2 : ℝ) : ℂ)*Complex.I).re) • (Complex.I*d) = _ + have he : γ (1/2) = γ (-(1/2)) := by + convert hp (-(1/2)) using 1; norm_num + simpa only [H,ContinuousMap.coe_mk,Complex.add_im,Complex.sub_im,Complex.add_re, + Complex.sub_re,Complex.mul_im,Complex.mul_re,Complex.ofReal_im,Complex.ofReal_re, + Complex.I_re,Complex.I_im,zero_mul,mul_zero,mul_one,sub_zero,add_zero,zero_add, + zero_sub] using congrArg (fun z : ℂ => z-γ 0-x • (Complex.I*d)) he + have hstrip := windingNumber_rect_map H H.continuous r (1/2) hperiod (by + rintro _ ⟨t,rfl⟩; exact hn t) + have hcomp : ((rectPath r (1/2)).map H.continuous).toContinuousMap = + H.comp p.toContinuousMap := rfl + rw [hcomp,hi] at hstrip + have hright : ((Path.segment ((r : ℂ)-((1/2 : ℝ) : ℂ)*Complex.I) + ((r : ℂ)+((1/2 : ℝ) : ℂ)*Complex.I)).map H.continuous).toContinuousMap = + (⟨fun t : unitInterval => γ ((t : ℝ)-1/2), + hc.comp (continuous_subtype_val.sub continuous_const)⟩ : C(unitInterval,ℂ)) - + ContinuousMap.const _ (γ 0+r • (Complex.I*d)) := by + ext t + simp only [Path.coe_toContinuousMap,Path.map_coe,Function.comp_apply, + Path.segment_apply,AffineMap.lineMap_apply_module,H,ContinuousMap.coe_mk, + ContinuousMap.sub_apply,ContinuousMap.const_apply] + have hre : ((1-(t : ℝ)) • ((r : ℂ)-((1/2 : ℝ) : ℂ)*Complex.I)+ + (t : ℝ) • ((r : ℂ)+((1/2 : ℝ) : ℂ)*Complex.I)).re = r := by + simp [Complex.real_smul]; ring + have him : ((1-(t : ℝ)) • ((r : ℂ)-((1/2 : ℝ) : ℂ)*Complex.I)+ + (t : ℝ) • ((r : ℂ)+((1/2 : ℝ) : ℂ)*Complex.I)).im = (t : ℝ)-1/2 := by + simp [Complex.real_smul]; ring + rw [hre,him]; abel + have hleft : ((Path.segment ((-r : ℂ)-((1/2 : ℝ) : ℂ)*Complex.I) + ((-r : ℂ)+((1/2 : ℝ) : ℂ)*Complex.I)).map H.continuous).toContinuousMap = + (⟨fun t : unitInterval => γ ((t : ℝ)-1/2), + hc.comp (continuous_subtype_val.sub continuous_const)⟩ : C(unitInterval,ℂ)) - + ContinuousMap.const _ (γ 0-r • (Complex.I*d)) := by + ext t + simp only [Path.coe_toContinuousMap,Path.map_coe,Function.comp_apply, + Path.segment_apply,AffineMap.lineMap_apply_module,H,ContinuousMap.coe_mk, + ContinuousMap.sub_apply,ContinuousMap.const_apply] + have hre : ((1-(t : ℝ)) • ((-r : ℂ)-((1/2 : ℝ) : ℂ)*Complex.I)+ + (t : ℝ) • ((-r : ℂ)+((1/2 : ℝ) : ℂ)*Complex.I)).re = -r := by + simp [Complex.real_smul]; ring + have him : ((1-(t : ℝ)) • ((-r : ℂ)-((1/2 : ℝ) : ℂ)*Complex.I)+ + (t : ℝ) • ((-r : ℂ)+((1/2 : ℝ) : ℂ)*Complex.I)).im = (t : ℝ)-1/2 := by + simp [Complex.real_smul]; ring + rw [hre,him,neg_smul]; abel + rw [hright,hleft] at hstrip + exact hstrip.symm + +end Brennan + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Absorption.lean b/lean/OAI/Analysis/InterpolatedFactors/Absorption.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec8169f622e40575ca3ef5d430e27a1a062dc0e8 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Absorption.lean @@ -0,0 +1,359 @@ +import OAI.Analysis.InterpolatedFactors.Mixed + +namespace OAI + +universe u_1 u_2 u_3 u_4 u_5 + +noncomputable section +namespace FreeGroupFactorMain.RectangularAbsorption + +section +variable {A : Type u_1} [Ring A] + +def part (p q : A) (C : ℕ → A) (n : ℕ) : A := p*C n*q +def remainder (p q : A) (C : ℕ → A) (n : ℕ) : A := C n-part p q C n +def shifted (p q D : A) (C : ℕ → A) : ℕ → A + | 0 => D+remainder p q C 0 + | n+1 => part p q C n+remainder p q C (n+1) + + theorem part_supported (p q : A) (hp : p*p=p) (hq : q*q=q) (C : ℕ → A) (n : ℕ) : + p*part p q C n*q=part p q C n := by + calc + _ = (p*p)*C n*(q*q) := by dsimp [part];noncomm_ring + _ = _ := by rw [hp,hq];rfl + + theorem remainder_compression (p q : A) (hp : p*p=p) (hq : q*q=q) (C : ℕ → A) (n : ℕ) : + p*remainder p q C n*q=0 := by + rw [remainder,mul_sub,sub_mul,part_supported p q hp hq] + exact sub_self _ + + theorem shifted_zero_compression (p q D : A) (hp : p*p=p) (hq : q*q=q) + (hD : p*D*q=D) (C : ℕ → A) : p*shifted p q D C 0*q=D := by + rw [shifted,mul_add,add_mul,hD,remainder_compression p q hp hq,add_zero] + + theorem shifted_succ_compression (p q D : A) (hp : p*p=p) (hq : q*q=q) + (C : ℕ → A) (n : ℕ) : p*shifted p q D C (n+1)*q=part p q C n := by + rw [shifted,mul_add,add_mul,part_supported p q hp hq,remainder_compression p q hp hq,add_zero] + + theorem recover (p q D : A) (hp : p*p=p) (hq : q*q=q) (hD : p*D*q=D) + (C : ℕ → A) (n : ℕ) : + C n=p*shifted p q D C (n+1)*q+shifted p q D C n-p*shifted p q D C n*q := by + rw [shifted_succ_compression p q D hp hq] + cases n with + | zero => rw [shifted_zero_compression p q D hp hq hD,shifted,remainder];abel + | succ n => rw [shifted_succ_compression p q D hp hq,shifted,remainder];abel + +variable [StarRing A] +def paired (x y : A) : A := x+star y + + theorem paired_compression (p q x y : A) (hp : star p=p) (hq : star q=q) : + paired (p*x*q) (q*y*p)=p*paired x y*q := by + simp only [paired,star_mul,hp,hq,mul_add,add_mul,mul_assoc] + + theorem paired_shifted_zero (p q D E : A) (hp : star p=p) (hq : star q=q) + (C F : ℕ → A) : + paired (shifted p q D C 0) (shifted q p E F 0)= + paired D E+paired (C 0) (F 0)-p*paired (C 0) (F 0)*q := by + simp only [paired,shifted,remainder,part,star_add,star_sub,star_mul,hp,hq] + noncomm_ring + + theorem paired_shifted_succ (p q D E : A) (hp : star p=p) (hq : star q=q) + (C F : ℕ → A) (n : ℕ) : + paired (shifted p q D C (n+1)) (shifted q p E F (n+1))= + p*paired (C n) (F n)*q+paired (C (n+1)) (F (n+1))- + p*paired (C (n+1)) (F (n+1))*q := by + simp only [paired,shifted,remainder,part,star_add,star_sub,star_mul,hp,hq] + noncomm_ring + + theorem recover_paired (p q D E : A) (hp : p*p=p) (hq : q*q=q) + (hps : star p=p) (hqs : star q=q) (hD : p*D*q=D) (hE : q*E*p=E) + (C F : ℕ → A) (n : ℕ) : + paired (C n) (F n)= + p*paired (shifted p q D C (n+1)) (shifted q p E F (n+1))*q+ + paired (shifted p q D C n) (shifted q p E F n)- + p*paired (shifted p q D C n) (shifted q p E F n)*q := by + have h := congrArg₂ paired (recover p q D hp hq hD C n) (recover q p E hq hp hE F n) + rw [h] + simp only [paired,star_sub,star_add,star_mul,hps,hqs] + noncomm_ring + + theorem recover_supported_paired (p q D E : A) (hp : p*p=p) (hq : q*q=q) + (hps : star p=p) (hqs : star q=q) (hD : p*D*q=D) (hE : q*E*p=E) + (C F : ℕ → A) : + paired D E=p*paired (shifted p q D C 0) (shifted q p E F 0)*q := by + rw [← paired_compression p q _ _ hps hqs, + shifted_zero_compression p q D hp hq hD,shifted_zero_compression q p E hq hp hE] + +variable [Algebra ℂ A] [StarModule ℂ A] + + theorem generation_equivalence (p q D E : A) (hp : p*p=p) (hq : q*q=q) + (hps : star p=p) (hqs : star q=q) (hD : p*D*q=D) (hE : q*E*p=E) + (C F : ℕ → A) (M : StarSubalgebra ℂ A) (hMp : p∈M) (hMq : q∈M) : + (paired D E∈M ∧ ∀ n,paired (C n) (F n)∈M) ↔ + ∀ n,paired (shifted p q D C n) (shifted q p E F n)∈M := by + constructor + · rintro ⟨hDE,hCF⟩ n + cases n with + | zero => + rw [paired_shifted_zero p q D E hps hqs] + exact sub_mem (add_mem hDE (hCF 0)) (mul_mem (mul_mem hMp (hCF 0)) hMq) + | succ n => + rw [paired_shifted_succ p q D E hps hqs] + exact sub_mem (add_mem (mul_mem (mul_mem hMp (hCF n)) hMq) (hCF (n+1))) + (mul_mem (mul_mem hMp (hCF (n+1))) hMq) + · intro h + constructor + · rw [recover_supported_paired p q D E hp hq hps hqs hD hE C F] + exact mul_mem (mul_mem hMp (h 0)) hMq + · intro n + rw [recover_paired p q D E hp hq hps hqs hD hE C F] + exact sub_mem (add_mem (mul_mem (mul_mem hMp (h (n+1))) hMq) (h n)) + (mul_mem (mul_mem hMp (h n)) hMq) + +end +section +variable {A : Type u_2} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] + +structure Data (B : StarSubalgebra ℂ A) where + p : B + q : B + projection : IsStarProjection p + projectionq : IsStarProjection q + τ : B →ₗ[ℂ] ℂ + tracial : ∀ a b,τ (a*b)=τ (b*a) + C : ℕ → A + D : A + D_supported : (p:A)*D*(q:A)=D + C_cov : ∀ (a : B) n m,star (C n)*(a:A)*C m=if n=m then τ a • (1:A) else 0 + D_cov : ∀ (a : B),star D*(a:A)*D=τ (a*p) • (q:A) + C_D : ∀ (a : B) n,star (C n)*(a:A)*D=0 + D_C : ∀ (a : B) n,star D*(a:A)*C n=0 + +namespace Data +variable {B : StarSubalgebra ℂ A} (d : Data B) + + theorem p_square : (d.p:A)*(d.p:A)=(d.p:A) := + congrArg Subtype.val d.projection.isIdempotentElem.eq + theorem p_star : star (d.p:A)=(d.p:A) := + congrArg Subtype.val d.projection.isSelfAdjoint.star_eq + theorem q_square : (d.q:A)*(d.q:A)=(d.q:A) := + congrArg Subtype.val d.projectionq.isIdempotentElem.eq + theorem q_star : star (d.q:A)=(d.q:A) := + congrArg Subtype.val d.projectionq.isSelfAdjoint.star_eq + theorem trace_pa (a : B) : d.τ (d.p*a)=d.τ (a*d.p) := d.tracial _ _ + theorem trace_pap (a : B) : d.τ (d.p*a*d.p)=d.τ (a*d.p) := by + rw [mul_assoc,d.tracial,mul_assoc,d.projection.isIdempotentElem.eq] + + theorem part_part (a : B) (n m : ℕ) : + star (part (d.p:A) (d.q:A) d.C n)*(a:A)*part (d.p:A) (d.q:A) d.C m= + if n=m then d.τ (a*d.p) • (d.q:A) else 0 := by + calc + _ = (d.q:A)*(star (d.C n)*((d.p*a*d.p:B):A)*d.C m)*(d.q:A) := by + simp only [part,star_mul,d.p_star,d.q_star,MulMemClass.coe_mul] + noncomm_ring + _ = _ := by + rw [d.C_cov,d.trace_pap] + split_ifs <;> simp only [mul_smul_comm,smul_mul_assoc,mul_one,d.q_square,mul_zero,zero_mul] + + theorem part_remainder (a : B) (n m : ℕ) : + star (part (d.p:A) (d.q:A) d.C n)*(a:A)*remainder (d.p:A) (d.q:A) d.C m=0 := by + calc + _ = (d.q:A)*(star (d.C n)*((d.p*a:B):A)*d.C m)- + (d.q:A)*(star (d.C n)*((d.p*a*d.p:B):A)*d.C m)*(d.q:A) := by + simp only [part,remainder,star_mul,d.p_star,d.q_star,MulMemClass.coe_mul] + noncomm_ring + _ = 0 := by + rw [d.C_cov,d.C_cov,d.trace_pa,d.trace_pap] + split_ifs <;> + simp only [mul_smul_comm,smul_mul_assoc,mul_one,d.q_square,mul_zero,zero_mul,sub_self] + + theorem remainder_part (a : B) (n m : ℕ) : + star (remainder (d.p:A) (d.q:A) d.C n)*(a:A)*part (d.p:A) (d.q:A) d.C m=0 := by + have h := congrArg star (d.part_remainder (star a) m n) + simpa only [star_mul,star_star,StarMemClass.coe_star,star_zero,mul_assoc] using h + + theorem remainder_remainder (a : B) (n m : ℕ) : + star (remainder (d.p:A) (d.q:A) d.C n)*(a:A)*remainder (d.p:A) (d.q:A) d.C m= + if n=m then d.τ a • (1:A)-d.τ (a*d.p) • (d.q:A) else 0 := by + calc + _ = star (d.C n)*(a:A)*d.C m- + (star (d.C n)*((a*d.p:B):A)*d.C m)*(d.q:A)- + (d.q:A)*(star (d.C n)*((d.p*a:B):A)*d.C m)+ + (d.q:A)*(star (d.C n)*((d.p*a*d.p:B):A)*d.C m)*(d.q:A) := by + simp only [part,remainder,star_sub,star_mul,d.p_star,d.q_star,MulMemClass.coe_mul] + noncomm_ring + _ = _ := by + simp only [d.C_cov,d.trace_pa,d.trace_pap] + split_ifs <;> + simp only [mul_smul_comm,smul_mul_assoc,mul_one,one_mul,d.q_square, + mul_zero,zero_mul,sub_zero,add_zero] + all_goals abel + + theorem part_D (a : B) (n : ℕ) : + star (part (d.p:A) (d.q:A) d.C n)*(a:A)*d.D=0 := by + calc + _ = (d.q:A)*(star (d.C n)*((d.p*a:B):A)*d.D) := by + simp only [part,star_mul,d.p_star,d.q_star,MulMemClass.coe_mul,mul_assoc] + _ = 0 := by rw [d.C_D,mul_zero] + + theorem D_part (a : B) (n : ℕ) : + star d.D*(a:A)*part (d.p:A) (d.q:A) d.C n=0 := by + calc + _ = (star d.D*((a*d.p:B):A)*d.C n)*(d.q:A) := by + simp only [part,MulMemClass.coe_mul,mul_assoc] + _ = 0 := by rw [d.D_C,zero_mul] + + theorem remainder_D (a : B) (n : ℕ) : + star (remainder (d.p:A) (d.q:A) d.C n)*(a:A)*d.D=0 := by + simp only [remainder,star_sub,sub_mul,d.C_D,d.part_D,sub_self] + + theorem D_remainder (a : B) (n : ℕ) : + star d.D*(a:A)*remainder (d.p:A) (d.q:A) d.C n=0 := by + simp only [remainder,mul_sub,d.D_C,d.D_part,sub_self] + + theorem shifted_covariance (a : B) (n m : ℕ) : + star (shifted (d.p:A) (d.q:A) d.D d.C n)*(a:A)*shifted (d.p:A) (d.q:A) d.D d.C m= + if n=m then d.τ a • (1:A) else 0 := by + cases n with + | zero => + cases m with + | zero => + simp only [shifted,star_add,add_mul,mul_add,d.D_cov,d.D_remainder,d.remainder_D, + d.remainder_remainder,ite_true,add_zero,zero_add] + abel + | succ m => + simp only [shifted,star_add,add_mul,mul_add,d.D_part,d.D_remainder,d.remainder_part, + d.remainder_remainder,Nat.zero_ne_add_one,ite_false,add_zero] + | succ n => + cases m with + | zero => + simp only [shifted,star_add,add_mul,mul_add,d.part_D,d.part_remainder,d.remainder_D, + d.remainder_remainder,Nat.add_one_ne_zero,ite_false,add_zero] + | succ m => + simp only [shifted,star_add,add_mul,mul_add,d.part_part,d.part_remainder,d.remainder_part, + d.remainder_remainder,Nat.add_right_cancel_iff,add_zero,zero_add] + split_ifs <;> abel + +end Data +end +variable {A : Type u_3} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] + +def Orthogonal (B : StarSubalgebra ℂ A) (x y : A) : Prop := + ∀ a : B,star x*(a:A)*y=0 + +namespace Orthogonal +variable {B : StarSubalgebra ℂ A} {x y z : A} + theorem add_left (h : Orthogonal B x z) (k : Orthogonal B y z) : Orthogonal B (x+y) z := by + intro a + simp only [star_add,add_mul,h a,k a,add_zero] + theorem sub_left (h : Orthogonal B x z) (k : Orthogonal B y z) : Orthogonal B (x-y) z := by + intro a + simp only [star_sub,sub_mul,h a,k a,sub_self] + theorem add_right (h : Orthogonal B x y) (k : Orthogonal B x z) : Orthogonal B x (y+z) := by + intro a + simp only [mul_add,h a,k a,add_zero] + theorem sub_right (h : Orthogonal B x y) (k : Orthogonal B x z) : Orthogonal B x (y-z) := by + intro a + simp only [mul_sub,h a,k a,sub_self] + theorem symm (h : Orthogonal B x y) : Orthogonal B y x := by + intro a + have ht := congrArg star (h (star a)) + simpa only [star_mul,star_star,StarMemClass.coe_star,star_zero,mul_assoc] using ht + theorem sandwich_left (h : Orthogonal B x y) (p q : B) : + Orthogonal B ((p:A)*x*(q:A)) y := by + intro a + calc + _ = star (q:A)*(star x*((star p*a:B):A)*y) := by + simp only [star_mul,StarMemClass.coe_star,MulMemClass.coe_mul,mul_assoc] + _ = 0 := by rw [h (star p*a),mul_zero] + theorem sandwich_right (h : Orthogonal B x y) (p q : B) : + Orthogonal B x ((p:A)*y*(q:A)) := (h.symm.sandwich_left p q).symm + + theorem part_left {C : ℕ → A} (h : ∀ n,Orthogonal B (C n) y) (p q : B) (n : ℕ) : + Orthogonal B (part (p:A) (q:A) C n) y := (h n).sandwich_left p q + theorem part_right {C : ℕ → A} (h : ∀ n,Orthogonal B x (C n)) (p q : B) (n : ℕ) : + Orthogonal B x (part (p:A) (q:A) C n) := (h n).sandwich_right p q + theorem remainder_left {C : ℕ → A} (h : ∀ n,Orthogonal B (C n) y) (p q : B) (n : ℕ) : + Orthogonal B (remainder (p:A) (q:A) C n) y := (h n).sub_left (part_left h p q n) + theorem remainder_right {C : ℕ → A} (h : ∀ n,Orthogonal B x (C n)) (p q : B) (n : ℕ) : + Orthogonal B x (remainder (p:A) (q:A) C n) := (h n).sub_right (part_right h p q n) + + theorem shifted_left {C : ℕ → A} {D : A} (hD : Orthogonal B D y) + (hC : ∀ n,Orthogonal B (C n) y) (p q : B) (n : ℕ) : + Orthogonal B (shifted (p:A) (q:A) D C n) y := by + cases n with + | zero => exact hD.add_left (remainder_left hC p q 0) + | succ n => exact (part_left hC p q n).add_left (remainder_left hC p q (n+1)) + theorem shifted_right {C : ℕ → A} {D : A} (hD : Orthogonal B x D) + (hC : ∀ n,Orthogonal B x (C n)) (p q : B) (n : ℕ) : + Orthogonal B x (shifted (p:A) (q:A) D C n) := + (shifted_left hD.symm (fun n => (hC n).symm) p q n).symm + + theorem shifted {C F : ℕ → A} {D E : A} (hDE : Orthogonal B D E) + (hDF : ∀ m,Orthogonal B D (F m)) (hCE : ∀ n,Orthogonal B (C n) E) + (hCF : ∀ n m,Orthogonal B (C n) (F m)) (p q r s : B) (n m : ℕ) : + Orthogonal B (RectangularAbsorption.shifted (p:A) (q:A) D C n) + (RectangularAbsorption.shifted (r:A) (s:A) E F m) := + shifted_left (shifted_right hDE hDF r s m) + (fun n => shifted_right (hCE n) (hCF n) r s m) p q n +end Orthogonal + +structure Family (B : StarSubalgebra ℂ A) (I : Type u_4) where + data : I → Data B + CC : ∀ i j,i≠j → ∀ n m,Orthogonal B ((data i).C n) ((data j).C m) + CD : ∀ i j,i≠j → ∀ n,Orthogonal B ((data i).C n) (data j).D + DD : ∀ i j,i≠j → Orthogonal B (data i).D (data j).D + +namespace Family +open scoped Classical +variable {B : StarSubalgebra ℂ A} {I : Type u_5} (d : Family B I) + +def output (i : I) (n : ℕ) : A := + shifted ((d.data i).p:A) ((d.data i).q:A) (d.data i).D (d.data i).C n + + theorem output_cross {i j : I} (hij : i≠j) (n m : ℕ) : + Orthogonal B (d.output i n) (d.output j m) := + Orthogonal.shifted (d.DD i j hij) + (fun m => (d.CD j i hij.symm m).symm) (d.CD i j hij) (d.CC i j hij) + (d.data i).p (d.data i).q (d.data j).p (d.data j).q n m + + theorem output_covariance (i j : I) (n m : ℕ) (a : B) : + star (d.output i n)*(a:A)*d.output j m= + if i=j ∧ n=m then (d.data i).τ a • (1:A) else 0 := by + classical + by_cases hij : i=j + · subst j + simpa only [output,true_and] using (d.data i).shifted_covariance a n m + · rw [ite_eq_right (fun h => hij h.1)] + exact d.output_cross hij n m a + + theorem output_generation (σ : I → I) + (hpq : ∀ i,(d.data (σ i)).p=(d.data i).q) + (hqp : ∀ i,(d.data (σ i)).q=(d.data i).p) + (M : StarSubalgebra ℂ A) + (hpM : ∀ i,((d.data i).p:A)∈M) (hqM : ∀ i,((d.data i).q:A)∈M) : + ((∀ i,paired (d.data i).D (d.data (σ i)).D∈M) ∧ + ∀ i n,paired ((d.data i).C n) ((d.data (σ i)).C n)∈M) ↔ + ∀ i n,paired (d.output i n) (d.output (σ i) n)∈M := by + have he (i : I) : + (paired (d.data i).D (d.data (σ i)).D∈M ∧ + ∀ n,paired ((d.data i).C n) ((d.data (σ i)).C n)∈M) ↔ + ∀ n,paired (d.output i n) (d.output (σ i) n)∈M := by + have hE : ((d.data i).q:A)*(d.data (σ i)).D*((d.data i).p:A)=(d.data (σ i)).D := by + simpa only [hpq,hqp] using (d.data (σ i)).D_supported + simpa only [output,hpq,hqp] using + generation_equivalence ((d.data i).p:A) ((d.data i).q:A) (d.data i).D (d.data (σ i)).D + (d.data i).p_square (d.data i).q_square (d.data i).p_star (d.data i).q_star + (d.data i).D_supported hE (d.data i).C (d.data (σ i)).C M (hpM i) (hqM i) + constructor + · rintro ⟨hD,hC⟩ i + exact (he i).mp ⟨hD i,hC i⟩ + · intro h + exact ⟨fun i => ((he i).mpr (h i)).1,fun i => ((he i).mpr (h i)).2⟩ + +end Family +end FreeGroupFactorMain.RectangularAbsorption + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Ambient.lean b/lean/OAI/Analysis/InterpolatedFactors/Ambient.lean new file mode 100644 index 0000000000000000000000000000000000000000..2dbe9205da1c90d8c88dc8615d756646938e70b2 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Ambient.lean @@ -0,0 +1,502 @@ +import OAI.Analysis.InterpolatedFactors.Cyclic + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 + +namespace FreeGroupFactorMain.WeightedFock + +section +open FreeFock +variable {ι : Type u_1} [DecidableEq ι] + +def vertexOld (u v : ℝ) (r : Bool) : oldAlgebra u v (∅ : Set ι) := + ⟨vertex r,by cases r;exact sub_mem (one_mem _) (P_mem_old u v ∅);exact P_mem_old u v ∅⟩ + +theorem vertex_mul_vertex (r s : Bool) : (vertex r : Operator ι)*vertex s=if r=s then vertex r else 0 := by + cases r <;> cases s <;> simp only [vertex_false,vertex_true,Bool.false_eq_true,Bool.true_eq_false, + ite_true,ite_false,mul_sub,sub_mul,one_mul,mul_one,projection_P.isIdempotentElem.eq] + all_goals abel + +theorem vertex_commute_empty (u v : ℝ) (r : Bool) (T : oldAlgebra u v (∅ : Set ι)) : + Commute (vertex r : Operator ι) (T:Operator ι) := by + have hp : P∈StarSubalgebra.centralizer ℂ (insert (P : Operator ι) (S u v '' (∅ : Set ι))) := by + rw [StarSubalgebra.mem_centralizer_iff] + intro y hy + rcases hy with rfl | ⟨_,h,_⟩ + · exact ⟨rfl,by rw [projection_P.isSelfAdjoint.star_eq]⟩ + · exact False.elim h + have hc := ((StarSubalgebra.mem_centralizer_iff ℂ).mp T.property P hp).1 + cases r + · exact (Commute.one_left _).sub_left hc + · exact hc + +theorem vertex_empty_vertex (u v : ℝ) (r s : Bool) (T : oldAlgebra u v (∅ : Set ι)) : + (vertex r : Operator ι)*(T:Operator ι)*vertex s=if r=s then (T:Operator ι)*vertex r else 0 := by + rw [(vertex_commute_empty u v r T).eq,mul_assoc,vertex_mul_vertex] + split_ifs <;> simp only [mul_zero] + +def ambientRect (u v : ℝ) (i : ι) (r s : Bool) : Operator ι := vertex r*C u v i*vertex s + +theorem ambientRect_covariance (u v : ℝ) (i j : ι) (r s t q : Bool) + (T : oldAlgebra u v (∅ : Set ι)) : + star (ambientRect u v i r s)*(T:Operator ι)*ambientRect u v j t q= + if i=j ∧ r=t ∧ s=q then vacuumTrace u v ((T:Operator ι)*vertex r) • vertex s else 0 := by + have hc := fresh_C_contraction u v ∅ i j (by simp) (by simp) + (vertexOld u v r*T*vertexOld u v t) + change star (C u v i)*(vertex r*(T:Operator ι)*vertex t)*C u v j=_ at hc + have hh : star (ambientRect u v i r s)*(T:Operator ι)*ambientRect u v j t q= + if i=j then vacuumTrace u v (vertex r*(T:Operator ι)*vertex t) • (vertex s*vertex q) else 0 := by + calc + _ = vertex s*(star (C u v i)*(vertex r*(T:Operator ι)*vertex t)*C u v j)*vertex q := by + simp only [ambientRect,star_mul,vertex_star,mul_assoc] + _ = _ := by + rw [hc] + split_ifs <;> simp only [mul_smul_comm,smul_mul_assoc,mul_one,mul_zero,zero_mul] + rfl + rw [vertex_empty_vertex,vertex_mul_vertex] at hh + rw [hh] + have hz : vacuumTrace u v (0:Operator ι)=0 := by simp only [vacuumTrace,zero_apply,inner_zero_right] + by_cases hij : i=j <;> by_cases hrt : r=t <;> by_cases hsq : s=q <;> + simp [hij,hrt,hsq,hz,smul_zero (M := ℂ) (A := Operator ι),zero_smul ℂ (A := Operator ι)] + +theorem ambientRect_annihilate (u v : ℝ) (i : ι) (r s : Bool) + (T : oldAlgebra u v (∅ : Set ι)) : + star (ambientRect u v i r s) ((T:Operator ι) (vacuum u v))=0 := by + have hh := fresh_C_annihilates_old_vacuum u v ∅ i (by simp) (vertexOld u v r*T) + simp only [ambientRect,star_mul,vertex_star,mul_apply_eq_comp] + change star (C u v i) (vertex r ((T:Operator ι) (vacuum u v)))=0 at hh + rw [hh,map_zero] + +variable (u v : ℝ) (i : ι) +def diagonalCreate : Operator ι := ambientRect u v i true true+ambientRect u v i false false + +def diagonalCovariance (T : oldAlgebra u v (∅ : Set ι)) : oldAlgebra u v (∅ : Set ι) := + vacuumTrace u v ((T:Operator ι)*vertex true) • vertexOld u v true+ + vacuumTrace u v ((T:Operator ι)*vertex false) • vertexOld u v false + +theorem diagonalCreate_covariance (T : oldAlgebra u v (∅ : Set ι)) : + star (diagonalCreate u v i)*(T:Operator ι)*diagonalCreate u v i= + (diagonalCovariance u v T : Operator ι) := by + simp only [diagonalCreate,star_add (R := Operator ι),add_mul,mul_add,ambientRect_covariance, + Bool.true_eq_false,Bool.false_eq_true,and_self,and_false,ite_true,ite_false,add_zero,zero_add] + rfl + +theorem diagonalCreate_annihilate (T : oldAlgebra u v (∅ : Set ι)) : + star (diagonalCreate u v i) ((T:Operator ι) (vacuum u v))=0 := by + simp only [diagonalCreate,star_add (R := Operator ι),add_apply,ambientRect_annihilate,add_zero] + +theorem ambientRect_diagonal_orthogonal (r : Bool) (T : oldAlgebra u v (∅ : Set ι)) : + star (ambientRect u v i r (!r))*(T:Operator ι)*diagonalCreate u v i=0 := by + cases r <;> simp only [diagonalCreate,mul_add,ambientRect_covariance,Bool.not_false,Bool.not_true, + Bool.false_eq_true,Bool.true_eq_false,and_false,and_true,ite_false,add_zero] + +def diagonalBase : StarSubalgebra ℂ (Operator ι) := + Bicommutant.algebra (insert (diagonalCreate u v i+star (diagonalCreate u v i)) + (oldAlgebra u v (∅ : Set ι) : Set (Operator ι))) + +theorem diagonal_base_annihilate (r : Bool) (T : diagonalBase u v i) : + star (ambientRect u v i r (!r)) ((T:Operator ι) (vacuum u v))=0 := + GaussianExtension.annihilation_extension (oldAlgebra u v ∅) (diagonalCreate u v i) + (diagonalCovariance u v) (diagonalCreate_covariance u v i) + (ambientRect u v i r (!r)) (vacuum u v) (diagonalCreate_annihilate u v i) + (fun a => ambientRect_annihilate u v i r (!r) a) + (ambientRect_diagonal_orthogonal u v i r) T T.property + +theorem diagonal_vertex_annihilate (r : Bool) (T : oldAlgebra u v (∅ : Set ι)) : + star (diagonalCreate u v i) ((T:Operator ι) (vertex r (vacuum u v)))=0 := by + have hh := diagonalCreate_annihilate u v i (T*vertexOld u v r) + change star (diagonalCreate u v i) (((T:Operator ι)*vertex r : Operator ι) (vacuum u v))=0 at hh + exact hh + +theorem diagonal_residual_covariance (r : Bool) (T : diagonalBase u v i) : + star (ambientRect u v i r (!r))*(T:Operator ι)*ambientRect u v i r (!r)= + inner ℂ (vertex r (vacuum u v)) ((T:Operator ι) (vertex r (vacuum u v))) • vertex (!r) := by + apply GaussianExtension.covariance_extension (oldAlgebra u v ∅) (diagonalCreate u v i) + (diagonalCovariance u v) (diagonalCreate_covariance u v i) + (ambientRect u v i r (!r)) (ambientRect u v i r (!r)) (vertex (!r)) + (vertex r (vacuum u v)) (vertex r (vacuum u v)) + (diagonal_vertex_annihilate u v i r) (diagonal_vertex_annihilate u v i r) + (ambientRect_diagonal_orthogonal u v i r) + (GaussianOrthogonal.symm (ambientRect_diagonal_orthogonal u v i r)) ?_ T T.property + intro a + rw [ambientRect_covariance,ite_eq_left ⟨rfl,rfl,rfl⟩] + congr 1 + rw [← ContinuousLinearMap.adjoint_inner_right (vertex r)] + change inner ℂ (vacuum u v) (((a:Operator ι)*vertex r : Operator ι) (vacuum u v))= + inner ℂ (vacuum u v) ((star (vertex r)*((a:Operator ι)*vertex r) : Operator ι) (vacuum u v)) + rw [vertex_star,← mul_assoc,vertex_empty_vertex,ite_eq_left rfl] +end + +section +open FreeFock +variable {ι : Type u_2} [DecidableEq ι] + +theorem vertex_projection (r : Bool) : IsStarProjection (vertex r : Operator ι) := by + rw [vertex_eq_proj] + exact CoordinateProjection.projection _ + +theorem ambientRect_left (u v : ℝ) (i : ι) (r s : Bool) : + vertex r*ambientRect u v i r s=ambientRect u v i r s := by + rw [ambientRect,← mul_assoc,← mul_assoc,vertex_mul_vertex,ite_eq_left rfl] + +theorem ambientRect_right (u v : ℝ) (i : ι) (r s : Bool) : + ambientRect u v i r s*vertex s=ambientRect u v i r s := by + rw [ambientRect,mul_assoc,vertex_mul_vertex,ite_eq_left rfl] + +def diagonalLeg (u v : ℝ) (i : ι) (r : Bool) : Operator ι := + ambientRect u v i r r+star (ambientRect u v i r r) + +theorem diagonalLeg_selfAdjoint (u v : ℝ) (i : ι) (r : Bool) : + IsSelfAdjoint (diagonalLeg u v i r) := IsSelfAdjoint.add_star_self (ambientRect u v i r r) + +theorem diagonalLeg_left (u v : ℝ) (i : ι) (r : Bool) : + vertex r*diagonalLeg u v i r=diagonalLeg u v i r := by + have hs := congrArg star (ambientRect_right u v i r r) + simp only [star_mul,vertex_star] at hs + rw [diagonalLeg,mul_add,ambientRect_left,hs] + +theorem diagonalLeg_right (u v : ℝ) (i : ι) (r : Bool) : + diagonalLeg u v i r*vertex r=diagonalLeg u v i r := by + simpa only [star_mul,vertex_star,(diagonalLeg_selfAdjoint u v i r).star_eq] using + congrArg star (diagonalLeg_left u v i r) + +theorem vertexRoot_inner (u v : ℝ) (r : Bool) : + inner ℂ (vertex r (vacuum u v : H ι)) (vertex r (vacuum u v))=vacuumTrace u v (vertex r : Operator ι) := by + rw [← ContinuousLinearMap.adjoint_inner_right (vertex r : Operator ι)] + change inner ℂ (vacuum u v) ((star (vertex r)*vertex r : Operator ι) (vacuum u v))=_ + rw [vertex_star,vertex_mul_vertex,ite_eq_left rfl] + rfl + +theorem vertexRoot_ne_zero (u v : ℝ) (hu : u≠0) (hv : v≠0) (r : Bool) : + vertex r (vacuum u v : H ι)≠0 := by + intro hz + have hh := congrArg (fun ξ : H ι => ξ ([],r)) hz + cases r + · apply hv + simpa only [weight,vertex_vacuum,Bool.false_eq_true,ite_false,lp.coeFn_smul,Pi.smul_apply,smul_eq_mul, + lp.single_apply,Pi.single_eq_same,mul_one,lp.coeFn_zero,Pi.zero_apply,Complex.ofReal_eq_zero] using hh + · apply hu + simpa only [weight,vertex_vacuum,ite_true,lp.coeFn_smul,Pi.smul_apply,smul_eq_mul, + lp.single_apply,Pi.single_eq_same,mul_one,lp.coeFn_zero,Pi.zero_apply,Complex.ofReal_eq_zero] using hh + +theorem diagonalLeg_eigen_root_zero (u v : ℝ) (hu : u≠0) (hv : v≠0) (i : ι) + (r : Bool) (z : ℂ) (η : H ι) (he : diagonalLeg u v i r η=z • η) : + inner ℂ (vertex r (vacuum u v)) η=0 := by + apply SupportedSemicircle.unnormalized_eigen_root_zero + (vertex r) (ambientRect u v i r r) (vertex_projection r) + (ambientRect_left u v i r r) (ambientRect_right u v i r r) + _ (vertexRoot_ne_zero u v hu hv r) _ _ _ z η he + · exact DFunLike.congr_fun (vertex_projection (ι := ι) r).isIdempotentElem.eq _ + · rw [vertexRoot_inner] + have hh := ambientRect_covariance u v i i r r r r (1:oldAlgebra u v ∅) + simpa only [OneMemClass.coe_one,mul_one,one_mul,ite_true,and_self] using hh + · exact ambientRect_annihilate u v i r r (vertexOld u v r) + +def diagonalSelf (u v : ℝ) (i : ι) : Operator ι := diagonalLeg u v i true+diagonalLeg u v i false + +theorem diagonalSelf_eq (u v : ℝ) (i : ι) : + diagonalSelf u v i=diagonalCreate u v i+star (diagonalCreate u v i) := by + simp only [diagonalSelf,diagonalLeg,diagonalCreate,star_add (R := Operator ι)] + abel + +def diagonalShift (u v : ℝ) (i : ι) : ℝ := 2*‖diagonalSelf u v i‖+1 + +def diagonalGenerator (u v : ℝ) (i : ι) : Operator ι := diagonalSelf u v i+(diagonalShift u v i:ℂ) • P + +theorem diagonalSelf_selfAdjoint (u v : ℝ) (i : ι) : IsSelfAdjoint (diagonalSelf u v i) := by + rw [diagonalSelf_eq] + exact IsSelfAdjoint.add_star_self (diagonalCreate u v i) + +theorem diagonalGenerator_selfAdjoint (u v : ℝ) (i : ι) : IsSelfAdjoint (diagonalGenerator u v i) := by + change star (_+_)=_+_ + simp only [star_add (R := Operator ι),(diagonalSelf_selfAdjoint u v i).star_eq,star_smul,Complex.star_def, + Complex.conj_ofReal,projection_P.isSelfAdjoint.star_eq] + +theorem diagonalGenerator_eigen_root_zero (u v : ℝ) (hu : u≠0) (hv : v≠0) (i : ι) + (z : ℂ) (η : H ι) (he : diagonalGenerator u v i η=z • η) : inner ℂ (vacuum u v) η=0 := by + have hh := OrthogonalSpectralSum.eigen_root_zero (vertex true) (vertex false) + (diagonalLeg u v i true) (diagonalLeg u v i false) (vertex_projection true) (vertex_projection false) + (by rw [vertex_mul_vertex];rfl) (diagonalLeg_left u v i true) (diagonalLeg_right u v i true) + (diagonalLeg_left u v i false) (diagonalLeg_right u v i false) (vacuum u v) + (diagonalLeg_eigen_root_zero u v hu hv i true) (diagonalLeg_eigen_root_zero u v hu hv i false) + (diagonalShift u v i) z η he + simpa only [vertex_true,vertex_false,add_sub_cancel,one_apply_eq_self] using hh + +theorem P_mem_diagonalBase (u v : ℝ) (i : ι) : P∈diagonalBase u v i := + Bicommutant.subset _ (Set.mem_insert_of_mem _ (P_mem_old u v ∅)) + +theorem diagonalSelf_mem (u v : ℝ) (i : ι) : diagonalSelf u v i∈diagonalBase u v i := by + rw [diagonalSelf_eq] + exact Bicommutant.subset _ (Set.mem_insert _ _) + +theorem diagonalGenerator_mem (u v : ℝ) (i : ι) : diagonalGenerator u v i∈diagonalBase u v i := + add_mem (diagonalSelf_mem u v i) ((diagonalBase u v i).smul_mem (P_mem_diagonalBase u v i) _) + +theorem P_commute_diagonalSelf (u v : ℝ) (i : ι) : Commute P (diagonalSelf u v i) := by + have hf : Commute P (diagonalLeg u v i true) := + (diagonalLeg_left u v i true).trans (diagonalLeg_right u v i true).symm + have hq : Commute (1-P) (diagonalLeg u v i false) := + (diagonalLeg_left u v i false).trans (diagonalLeg_right u v i false).symm + have hp := (Commute.one_left (diagonalLeg u v i false)).sub_left hq + rw [sub_sub_cancel] at hp + exact hf.add_right hp + +theorem diagonalBase_eq_generated (u v : ℝ) (i : ι) : + diagonalBase u v i=Bicommutant.algebra {diagonalGenerator u v i} := by + apply le_antisymm + · have hp : P∈Bicommutant.algebra {diagonalGenerator u v i} := + SpectralSeparation.separated_projection_mem projection_P (diagonalSelf_selfAdjoint u v i) + (P_commute_diagonalSelf u v i) (diagonalShift u v i) (by dsimp [diagonalShift];linarith) + apply Bicommutant.generated_le + rintro T (rfl|hT) + · rw [← diagonalSelf_eq] + have he : diagonalSelf u v i=diagonalGenerator u v i-(diagonalShift u v i:ℂ) • P := by + rw [diagonalGenerator,add_sub_cancel_right] + rw [he] + exact sub_mem (Bicommutant.subset _ (Set.mem_singleton _)) ((Bicommutant.algebra _).smul_mem hp _) + · apply Bicommutant.generated_le {diagonalGenerator u v i} + (insert (P:Operator ι) (S u v '' (∅:Set ι))) ?_ hT + rintro a (rfl|⟨_,h,_⟩) + · exact hp + · exact False.elim h + · apply Bicommutant.generated_le + rintro T rfl + exact diagonalGenerator_mem u v i +end + +section +open FreeFock GaussianOrthogonal +variable {ι : Type u_3} [DecidableEq ι] + +theorem diagonalBase_vertex_commute (u v : ℝ) (i : ι) (r : Bool) (T : diagonalBase u v i) : + Commute (vertex r : Operator ι) (T:Operator ι) := by + have hp : P∈StarSubalgebra.centralizer ℂ {diagonalGenerator u v i} := by + rw [StarSubalgebra.mem_centralizer_iff] + rintro a rfl + have hc : Commute P (diagonalGenerator u v i) := + (P_commute_diagonalSelf u v i).add_right ((Commute.refl P).smul_right _) + exact ⟨hc.eq.symm,by rw [(diagonalGenerator_selfAdjoint u v i).star_eq];exact hc.eq.symm⟩ + have hh : (T:Operator ι)∈Bicommutant.algebra {diagonalGenerator u v i} := + (diagonalBase_eq_generated u v i).le T.property + have hc := ((StarSubalgebra.mem_centralizer_iff ℂ).mp hh P hp).1 + cases r + · exact (Commute.one_left _).sub_left hc + · exact hc + +theorem diagonal_residual_trace (u v : ℝ) (i : ι) (r : Bool) (T : diagonalBase u v i) : + star (ambientRect u v i r (!r))*(T:Operator ι)*ambientRect u v i r (!r)= + vacuumTrace u v ((T:Operator ι)*vertex r) • vertex (!r) := by + rw [diagonal_residual_covariance] + congr 1 + rw [← ContinuousLinearMap.adjoint_inner_right (vertex r : Operator ι)] + change inner ℂ (vacuum u v) ((star (vertex r)*((T:Operator ι)*vertex r) : Operator ι) (vacuum u v))=_ + rw [vertex_star,← mul_assoc,(diagonalBase_vertex_commute u v i r T).eq,mul_assoc, + vertex_mul_vertex,ite_eq_left rfl] + rfl + +theorem diagonal_residual_orthogonal (u v : ℝ) (i : ι) (r s : Bool) (hrs : r≠s) + (T : diagonalBase u v i) : + star (ambientRect u v i r (!r))*(T:Operator ι)*ambientRect u v i s (!s)=0 := by + apply GaussianExtension.orthogonality_extension (oldAlgebra u v ∅) (diagonalCreate u v i) + (diagonalCovariance u v) (diagonalCreate_covariance u v i) + (ambientRect u v i r (!r)) (ambientRect u v i s (!s)) + (ambientRect_diagonal_orthogonal u v i r) + (GaussianOrthogonal.symm (ambientRect_diagonal_orthogonal u v i s)) ?_ T T.property + intro a + rw [ambientRect_covariance,ite_eq_right (by simp only [hrs,and_false,false_and,not_false_eq_true])] + +theorem rect_paired_eq (u v : ℝ) (i : ι) (r s : Bool) : + ambientRect u v i r s+star (ambientRect u v i s r)=vertex r*S u v i*vertex s := by + change _=vertex r*(C u v i+star (C u v i))*vertex s + simp only [ambientRect,star_mul,vertex_star,mul_add,add_mul,mul_assoc] + +theorem vertex_mem_old (u v : ℝ) (J : Set ι) (r : Bool) : (vertex r : Operator ι)∈oldAlgebra u v J := by + cases r + · exact sub_mem (one_mem _) (P_mem_old u v J) + · exact P_mem_old u v J + +theorem oldAlgebra_mono (u v : ℝ) {J K : Set ι} (h : J⊆K) : oldAlgebra u v J≤oldAlgebra u v K := by + apply StarSubalgebra.centralizer_le + apply StarSubalgebra.centralizer_le + exact Set.insert_subset_insert (Set.image_mono h) + +theorem diagonalBase_le_singleton (u v : ℝ) (i : ι) : diagonalBase u v i≤oldAlgebra u v {i} := by + apply Bicommutant.generated_le + rintro T (rfl|hT) + · rw [← diagonalSelf_eq,diagonalSelf,diagonalLeg,diagonalLeg,rect_paired_eq,rect_paired_eq] + exact add_mem (mul_mem (mul_mem (vertex_mem_old u v _ _) (S_mem_old u v _ i rfl)) (vertex_mem_old u v _ _)) + (mul_mem (mul_mem (vertex_mem_old u v _ _) (S_mem_old u v _ i rfl)) (vertex_mem_old u v _ _)) + · exact oldAlgebra_mono u v (Set.empty_subset {i}) hT + +theorem diagonalBase_le_ambient (u v : ℝ) (i : ι) : diagonalBase u v i≤ambientAlgebra u v := + (diagonalBase_le_singleton u v i).trans (by + apply StarSubalgebra.centralizer_le + apply StarSubalgebra.centralizer_le + exact Set.insert_subset_insert (by rintro _ ⟨j,_,rfl⟩;exact Set.mem_range_self j)) + +theorem ambient_C_rect_empty (u v : ℝ) (i n : ι) (hn : n≠i) (r s : Bool) + (T : oldAlgebra u v (∅:Set ι)) : star (C u v n)*(T:Operator ι)*ambientRect u v i r s=0 := by + have hh := fresh_C_contraction u v ∅ n i (by simp) (by simp) (T*vertexOld u v r) + rw [ite_eq_right hn] at hh + change star (C u v n)*((T:Operator ι)*vertex r)*C u v i=0 at hh + calc + _ = (star (C u v n)*((T:Operator ι)*vertex r)*C u v i)*vertex s := by simp only [ambientRect,mul_assoc] + _ = 0 := by rw [hh,zero_mul] + +theorem ambient_C_diagonal_empty (u v : ℝ) (i n : ι) (hn : n≠i) + (T : oldAlgebra u v (∅:Set ι)) : star (C u v n)*(T:Operator ι)*diagonalCreate u v i=0 := by + rw [diagonalCreate,mul_add,ambient_C_rect_empty u v i n hn,ambient_C_rect_empty u v i n hn,add_zero] + +theorem ambient_C_residual (u v : ℝ) (i n : ι) (hn : n≠i) (r : Bool) + (T : diagonalBase u v i) : star (C u v n)*(T:Operator ι)*ambientRect u v i r (!r)=0 := by + exact GaussianExtension.orthogonality_extension (oldAlgebra u v ∅) (diagonalCreate u v i) + (diagonalCovariance u v) (diagonalCreate_covariance u v i) (C u v n) (ambientRect u v i r (!r)) + (ambient_C_diagonal_empty u v i n hn) + (GaussianOrthogonal.symm (ambientRect_diagonal_orthogonal u v i r)) + (ambient_C_rect_empty u v i n hn r (!r)) T T.property +end + +open FreeFock WeightedCornerIndex + +def residualIndex (b : Bool) : WeightedCornerIndex.Index := .inr (.inl 0,b) +def residualSlot : WeightedCornerIndex.Index → Option Bool + | .inr (.inl 0,b) => some b + | _ => none + +theorem residualSlot_some (i : WeightedCornerIndex.Index) (b : Bool) : residualSlot i=some b ↔ i=residualIndex b := by + rcases i with i|⟨(n|k),c⟩ + · simp [residualSlot,residualIndex] + · cases n <;> simp [residualSlot,residualIndex] + · simp [residualSlot,residualIndex] + +theorem residualSlot_flip (i : WeightedCornerIndex.Index) : + residualSlot (CircularRotation.flip i)=(residualSlot i).map Bool.not := by + rcases i with i|⟨(n|k),c⟩ + · rfl + · cases n <;> rfl + · rfl + +def diagonalVertex (u v : ℝ) (b : Bool) : diagonalBase u v (0:ℕ) := + ⟨vertex b,by cases b;exact sub_mem (one_mem _) (P_mem_diagonalBase u v 0);exact P_mem_diagonalBase u v 0⟩ + +def ambientLeft (u v : ℝ) (i : WeightedCornerIndex.Index) : diagonalBase u v (0:ℕ) := + (residualSlot i).elim 0 (diagonalVertex u v) +def ambientRight (u v : ℝ) (i : WeightedCornerIndex.Index) : diagonalBase u v (0:ℕ) := + (residualSlot i).elim 0 (fun b => diagonalVertex u v (!b)) +def ambientExtra (u v : ℝ) (i : WeightedCornerIndex.Index) : Operator ℕ := + (residualSlot i).elim 0 (fun b => ambientRect u v 0 b (!b)) + +theorem diagonalVertex_projection (u v : ℝ) (b : Bool) : IsStarProjection (diagonalVertex u v b) := by + constructor + · apply Subtype.ext;exact (vertex_projection b).isIdempotentElem.eq + · apply Subtype.ext;exact vertex_star b + +theorem ambientLeft_projection (u v : ℝ) (i : WeightedCornerIndex.Index) : IsStarProjection (ambientLeft u v i) := by + unfold ambientLeft + cases residualSlot i + · exact IsStarProjection.zero _ + · exact diagonalVertex_projection u v _ + +theorem ambientRight_projection (u v : ℝ) (i : WeightedCornerIndex.Index) : IsStarProjection (ambientRight u v i) := by + unfold ambientRight + cases residualSlot i + · exact IsStarProjection.zero _ + · exact diagonalVertex_projection u v _ + +theorem ambientLeft_flip (u v : ℝ) (i : WeightedCornerIndex.Index) : + ambientLeft u v (CircularRotation.flip i)=ambientRight u v i := by + simp only [ambientLeft,ambientRight,residualSlot_flip] + cases residualSlot i <;> rfl + +theorem ambientRight_flip (u v : ℝ) (i : WeightedCornerIndex.Index) : + ambientRight u v (CircularRotation.flip i)=ambientLeft u v i := by + simp only [ambientLeft,ambientRight,residualSlot_flip] + cases residualSlot i with + | none => rfl + | some b => cases b <;> rfl + +theorem ambientExtra_supported (u v : ℝ) (i : WeightedCornerIndex.Index) : + (ambientLeft u v i:Operator ℕ)*ambientExtra u v i*(ambientRight u v i:Operator ℕ)=ambientExtra u v i := by + unfold ambientLeft ambientRight ambientExtra + cases residualSlot i with + | none => simp + | some b => + change vertex b*ambientRect u v 0 b (!b)*vertex (!b)=_ + rw [ambientRect_left,ambientRect_right] + rfl + +def diagonalTrace (u v : ℝ) : diagonalBase u v (0:ℕ) →ₗ[ℂ] ℂ where + toFun a := vacuumTrace u v (a:Operator ℕ) + map_add' a b := by simp only [vacuumTrace,AddMemClass.coe_add,add_apply,inner_add_right] + map_smul' c a := by simp only [vacuumTrace,SetLike.val_smul,smul_apply,inner_smul_right,RingHom.id_apply,smul_eq_mul] + +theorem diagonalTrace_tracial (u v : ℝ) (hu : u≠0) (hv : v≠0) (a b : diagonalBase u v (0:ℕ)) : + diagonalTrace u v (a*b)=diagonalTrace u v (b*a) := + ambient_trace_mul u v hu hv ⟨(a:Operator ℕ),diagonalBase_le_ambient u v 0 a.property⟩ ⟨(b:Operator ℕ),diagonalBase_le_ambient u v 0 b.property⟩ + +theorem ambientExtra_covariance (u v : ℝ) (i j : WeightedCornerIndex.Index) (a : diagonalBase u v (0:ℕ)) : + star (ambientExtra u v i)*(a:Operator ℕ)*ambientExtra u v j= + if i=j then diagonalTrace u v (a*ambientLeft u v i) • (ambientRight u v i:Operator ℕ) else 0 := by + cases hi : residualSlot i with + | none => simp [ambientExtra,ambientLeft,ambientRight,hi,star_zero (R := Operator ℕ), + zero_smul ℂ (A := Operator ℕ)] + | some b => + cases hj : residualSlot j with + | none => + have hij : i≠j := by intro h;subst j;rw [hi] at hj;cases hj + simp [ambientExtra,hj,hij] + | some c => + have hei := (residualSlot_some i b).mp hi + have hej := (residualSlot_some j c).mp hj + have he : i=j ↔ b=c := by rw [hei,hej];simp [residualIndex] + simp only [ambientExtra,ambientLeft,ambientRight,hi,hj,Option.elim_some,he] + by_cases hbc : b=c + · subst c + rw [ite_eq_left rfl,diagonal_residual_trace] + rfl + · rw [ite_eq_right hbc] + exact diagonal_residual_orthogonal u v 0 b c hbc a + +def ambientRaw (u v : ℝ) (i : WeightedCornerIndex.Index) (n : ℕ) : Operator ℕ := C u v (reservoirCode (i,n)+1) + +theorem ambientRaw_covariance (u v : ℝ) (i j : WeightedCornerIndex.Index) (n m : ℕ) + (a : diagonalBase u v (0:ℕ)) : + star (ambientRaw u v i n)*(a:Operator ℕ)*ambientRaw u v j m= + if i=j ∧ n=m then diagonalTrace u v a • (1:Operator ℕ) else 0 := by + have hh := fresh_C_contraction u v {0} (reservoirCode (i,n)+1) (reservoirCode (j,m)+1) + (by simp) (by simp) ⟨a,diagonalBase_le_singleton u v 0 a.property⟩ + change star (C u v (reservoirCode (i,n)+1))*(a:Operator ℕ)*C u v (reservoirCode (j,m)+1)= + if i=j ∧ n=m then vacuumTrace u v (a:Operator ℕ) • (1:Operator ℕ) else 0 + simpa only [Nat.add_right_cancel_iff,reservoirCode.injective.eq_iff,Prod.mk.injEq] using hh + +theorem ambientRaw_extra (u v : ℝ) (i j : WeightedCornerIndex.Index) (n : ℕ) + (a : diagonalBase u v (0:ℕ)) : star (ambientRaw u v i n)*(a:Operator ℕ)*ambientExtra u v j=0 := by + unfold ambientExtra + cases residualSlot j with + | none => exact mul_zero _ + | some b => exact ambient_C_residual u v 0 _ (by omega) b a + +def ambientAbsorption (u v : ℝ) (hu : u≠0) (hv : v≠0) : + PairedAbsorption.Input (diagonalBase u v (0:ℕ)) SelfIndex PairIndex where + τ := diagonalTrace u v + tracial := diagonalTrace_tracial u v hu hv + p := ambientLeft u v + q := ambientRight u v + projection := ambientLeft_projection u v + projectionq := ambientRight_projection u v + pq := ambientLeft_flip u v + qp := ambientRight_flip u v + raw := ambientRaw u v + extra := ambientExtra u v + supported := ambientExtra_supported u v + raw_cov := ambientRaw_covariance u v + extra_cov := ambientExtra_covariance u v + raw_extra := ambientRaw_extra u v +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/AmbientSystem.lean b/lean/OAI/Analysis/InterpolatedFactors/AmbientSystem.lean new file mode 100644 index 0000000000000000000000000000000000000000..245019ade2d8702348a2fbac6990d9a3670599ea --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/AmbientSystem.lean @@ -0,0 +1,295 @@ +import OAI.Analysis.InterpolatedFactors.Ambient + +namespace OAI + +noncomputable section + +universe u_1 u_2 + +namespace FreeGroupFactorMain.WeightedFock + +section +open FreeFock MeasureTheory CyclicSpectral +variable {ι : Type u_1} [DecidableEq ι] + +theorem vacuum_norm_one (u v : ℝ) (hunit : u^2+v^2=1) : ‖(vacuum u v:H ι)‖=1 := by + have hh := vacuumTrace_one (ι := ι) u v + rw [hunit,Complex.ofReal_one] at hh + change inner ℂ (vacuum u v:H ι) (vacuum u v)=1 at hh + have hr := congrArg Complex.re hh + rw [inner_self_eq_norm_sq_to_K] at hr + have hr : ‖(vacuum u v:H ι)‖^2=1 := by exact_mod_cast hr + nlinarith [norm_nonneg (vacuum u v:H ι)] + +theorem diagonalGenerator_noAtoms (u v : ℝ) (hu : u≠0) (hv : v≠0) (i : ι) : + NullSingletonClass (measure (diagonalGenerator u v i) (diagonalGenerator_selfAdjoint u v i) (vacuum u v)) := by + let : InnerProductSpace ℝ (H ι) := InnerProductSpace.rclikeToReal ℂ (H ι) + apply noAtoms + intro r η hη + have he : diagonalGenerator u v i η=(r:ℂ) • η := by + exact hη.trans (by + apply Subtype.ext + funext w + change r • η w=(r:ℂ)*(η w) + exact Complex.real_smul) + have hh := diagonalGenerator_eigen_root_zero u v hu hv i (r:ℂ) η he + change (inner ℂ (vacuum u v) η).re=0 + rw [hh,Complex.zero_re] + +variable (u v : ℝ) (hu : u≠0) (hv : v≠0) (hunit : u^2+v^2=1) + +def ambientUniform : UniformAlgebra →⋆ₐ[ℂ] Operator ℕ := by + letI := probability _ (diagonalGenerator_selfAdjoint u v (0:ℕ)) (vacuum u v) (vacuum_norm_one u v hunit) + letI := diagonalGenerator_noAtoms u v hu hv (0:ℕ) + exact uniformHom (diagonalGenerator u v (0:ℕ)) (diagonalGenerator_selfAdjoint u v 0) (vacuum u v) + +theorem ambientUniform_mem (a : UniformAlgebra) : ambientUniform u v hu hv hunit a∈diagonalBase u v (0:ℕ) := by + let := probability _ (diagonalGenerator_selfAdjoint u v (0:ℕ)) (vacuum u v) (vacuum_norm_one u v hunit) + let := diagonalGenerator_noAtoms u v hu hv (0:ℕ) + exact uniformHom_mem _ _ _ _ (Set.isClosed_centralizer _) (diagonalGenerator_mem u v 0) a + +def ambientUniformBase : UniformAlgebra →⋆ₐ[ℂ] diagonalBase u v (0:ℕ) := + (ambientUniform u v hu hv hunit).codRestrict _ (ambientUniform_mem u v hu hv hunit) + +theorem ambientUniform_state (a : UniformAlgebra) : + vacuumTrace u v (ambientUniform u v hu hv hunit a)=uniformState a := by + let := probability _ (diagonalGenerator_selfAdjoint u v (0:ℕ)) (vacuum u v) (vacuum_norm_one u v hunit) + let := diagonalGenerator_noAtoms u v hu hv (0:ℕ) + exact uniformHom_state _ _ _ a +end + +section +open FreeFock WeightedCornerIndex GaussianRecognition CyclicSpectral + +def diagonalAnnihilators (u v : ℝ) : Submodule ℂ (Operator ℕ) where + carrier := {X | ∀ a : diagonalBase u v (0:ℕ),star X ((a:Operator ℕ) (vacuum u v))=0} + zero_mem' := by intro a;simp [star_zero (R := Operator ℕ)] + add_mem' := by intro X Y hX hY a;rw [star_add (R := Operator ℕ),add_apply,hX a,hY a,add_zero] + smul_mem' := by intro c X hX a;rw [star_smul,smul_apply,hX a,smul_zero] + +theorem diagonalAnnihilators_sandwich (u v : ℝ) (p q : diagonalBase u v (0:ℕ)) (X : Operator ℕ) + (hX : X∈diagonalAnnihilators u v) : (p:Operator ℕ)*X*(q:Operator ℕ)∈diagonalAnnihilators u v := by + intro a + rw [star_mul,star_mul,mul_apply_eq_comp,mul_apply_eq_comp] + have hh := hX (star p*a) + change star X (star (p:Operator ℕ) ((a:Operator ℕ) (vacuum u v)))=0 at hh + rw [hh,map_zero] + +theorem ambientExtra_annihilator (u v : ℝ) (i : WeightedCornerIndex.Index) : ambientExtra u v i∈diagonalAnnihilators u v := by + intro a + unfold ambientExtra + cases residualSlot i with + | none => simp [star_zero (R := Operator ℕ)] + | some b => exact diagonal_base_annihilate u v 0 b a + +theorem ambientRaw_annihilator (u v : ℝ) (i : WeightedCornerIndex.Index) (n : ℕ) : ambientRaw u v i n∈diagonalAnnihilators u v := by + intro a + exact fresh_C_annihilates_old_vacuum u v {0} (reservoirCode (i,n)+1) (by simp) + ⟨a,diagonalBase_le_singleton u v 0 a.property⟩ + +variable (u v : ℝ) (hu : u≠0) (hv : v≠0) (hunit : u^2+v^2=1) + +def ambientCreation (i : WeightedCornerIndex.Index × ℕ) : Operator ℕ := (ambientAbsorption u v hu hv).output i.1 i.2 + +theorem ambientCreation_annihilator (i : WeightedCornerIndex.Index × ℕ) : ambientCreation u v hu hv i∈diagonalAnnihilators u v := + (ambientAbsorption u v hu hv).output_mem (diagonalAnnihilators u v) (diagonalAnnihilators_sandwich u v) + (ambientExtra_annihilator u v) (ambientRaw_annihilator u v) i.1 i.2 + +theorem ambientCreation_covariance (i j : WeightedCornerIndex.Index × ℕ) (a : UniformAlgebra) : + star (ambientCreation u v hu hv i)*ambientUniform u v hu hv hunit a*ambientCreation u v hu hv j= + if i=j then uniformState a • (1:Operator ℕ) else 0 := by + have hh := (ambientAbsorption u v hu hv).output_cov i.1 j.1 i.2 j.2 (ambientUniformBase u v hu hv hunit a) + have hs : (ambientAbsorption u v hu hv).τ (ambientUniformBase u v hu hv hunit a)=uniformState a := + ambientUniform_state u v hu hv hunit a + rw [hs] at hh + change star (ambientCreation u v hu hv i)*ambientUniform u v hu hv hunit a*ambientCreation u v hu hv j= + (if i.1=j.1 ∧ i.2=j.2 then uniformState a • (1:Operator ℕ) else 0) at hh + simpa only [← Prod.ext_iff] using hh + +def ambientSystem : GaussianRecognition.System UniformAlgebra (H ℕ) + (WeightedCornerIndex.Index × ℕ) uniformCovariance where + coeff := ambientUniform u v hu hv hunit + root := vacuum u v + create := ambientCreation u v hu hv + contract i j a := by + rw [ambientCreation_covariance] + by_cases h : i=j + · simp only [uniformCovariance,h,ite_true,map_smul,map_one] + · simp only [uniformCovariance,ite_eq_right h,map_zero] + annihilate i a := ambientCreation_annihilator u v hu hv i (ambientUniformBase u v hu hv hunit a) +end + +section +open FreeFock CyclicSpectral GaussianRecognition Filter Topology +open scoped ENNReal +variable {ι : Type u_2} [DecidableEq ι] + +theorem path_closed_total (K : Submodule ℂ (H ι)) (hK : IsClosed (K:Set (H ι))) + (hδ : ∀ w : Path ι,lp.single 2 w (1:ℂ)∈K) : K=⊤ := by + apply top_unique + intro ξ _ + apply hK.mem_of_tendsto (lp.hasSum_single (by norm_num : (2:ℝ≥0∞)≠⊤) ξ) + filter_upwards [] with s + apply K.sum_mem + intro w _ + have he : lp.single (E := fun _ : Path ι => ℂ) 2 w (ξ w)=(ξ w) • lp.single 2 w 1 := by + ext v + simp [lp.single_apply,Pi.single_apply] + rw [he] + exact K.smul_mem _ (hδ w) + +theorem ambient_commutant_total (u v : ℝ) (hu : u≠0) (hv : v≠0) : + (Submodule.span ℂ (Set.range (fun B : StarSubalgebra.centralizer ℂ + (ambientAlgebra (ι := ι) u v:Set (Operator ι)) => (B:Operator ι) (vacuum u v)))).topologicalClosure=⊤ := by + apply path_closed_total _ (Submodule.isClosed_topologicalClosure _) + intro w + obtain ⟨B,hB,heB,_⟩ := good_right_basis u v hu hv w + have hh : B∈StarSubalgebra.centralizer ℂ (ambientAlgebra (ι := ι) u v:Set (Operator ι)) := + centralizer_bicommutant _ ⟨_,hB⟩ + apply Submodule.le_topologicalClosure _ + rw [← heB] + exact Submodule.subset_span ⟨⟨B,hh⟩,rfl⟩ + +variable (u v : ℝ) (hu : u≠0) (hv : v≠0) (hunit : u^2+v^2=1) + +theorem diagonalGenerator_mem_uniform : diagonalGenerator u v (0:ℕ)∈ + Bicommutant.algebra (Set.range (ambientUniform u v hu hv hunit)) := by + let : Nontrivial (H ℕ) := nontrivial_of_ne (vacuum u v:H ℕ) 0 (by + intro h + have hh := vacuum_norm_one (ι := ℕ) u v hunit + rw [h,norm_zero] at hh + exact zero_ne_one hh) + let := probability _ (diagonalGenerator_selfAdjoint u v (0:ℕ)) (vacuum u v) (vacuum_norm_one u v hunit) + let := diagonalGenerator_noAtoms u v hu hv (0:ℕ) + have h := operator_mem_haar_bicommutant (diagonalGenerator u v (0:ℕ)) (diagonalGenerator_selfAdjoint u v 0) + (vacuum u v) (ambientAlgebra u v) (Set.isClosed_centralizer _) + (diagonalBase_le_ambient u v 0 (diagonalGenerator_mem u v 0)) (ambient_commutant_total u v hu hv) + apply Bicommutant.mono _ (Set.range (ambientUniform u v hu hv hunit)) ?_ h + rintro T rfl + exact ⟨uniformPhase,(uniformHom_phase (diagonalGenerator u v (0:ℕ)) (diagonalGenerator_selfAdjoint u v 0) (vacuum u v)).symm⟩ + +theorem diagonalBase_le_uniform : diagonalBase u v (0:ℕ)≤ + Bicommutant.algebra (Set.range (ambientUniform u v hu hv hunit)) := by + rw [diagonalBase_eq_generated] + apply Bicommutant.generated_le + rintro T rfl + exact diagonalGenerator_mem_uniform u v hu hv hunit +end + +section +open FreeFock WeightedCornerIndex GaussianRecognition +variable (u v : ℝ) (hu : u≠0) (hv : v≠0) (hunit : u^2+v^2=1) + +theorem ambientExtra_pair_mem (i : WeightedCornerIndex.Index) : + ambientExtra u v i+star (ambientExtra u v (CircularRotation.flip i))∈ambientAlgebra u v := by + simp only [ambientExtra,residualSlot_flip] + cases residualSlot i with + | none => simp only [Option.map_none,Option.elim_none,star_zero (Operator ℕ),add_zero];exact zero_mem _ + | some b => + simp only [Option.map_some,Option.elim_some,Bool.not_not] + rw [rect_paired_eq] + have hm (r : Bool) : (vertex r : Operator ℕ)∈ambientAlgebra u v := by + cases r + · exact sub_mem (one_mem _) (P_mem_ambient u v) + · exact P_mem_ambient u v + exact mul_mem (mul_mem (hm _) (S_mem_ambient u v 0)) (hm _) + +theorem ambientOutput_pair_mem (i : WeightedCornerIndex.Index) (n : ℕ) : + (ambientAbsorption u v hu hv).output i n+ + star ((ambientAbsorption u v hu hv).output (CircularRotation.flip i) n)∈ambientAlgebra u v := by + apply ((ambientAbsorption u v hu hv).output_generation (ambientAlgebra u v) + (fun i => diagonalBase_le_ambient u v 0 (ambientLeft u v i).property) + (fun i => diagonalBase_le_ambient u v 0 (ambientRight u v i).property)).mp ?_ i n + exact ⟨ambientExtra_pair_mem u v,fun i n => S_mem_ambient u v (reservoirCode (i,n)+1)⟩ + +theorem ambientSystem_le_ambient : (ambientSystem u v hu hv hunit).generated scalarFlip≤ambientAlgebra u v := by + apply Bicommutant.generated_le + rintro T (⟨a,rfl⟩|⟨i,rfl⟩) + · exact diagonalBase_le_ambient u v 0 (ambientUniformBase u v hu hv hunit a).property + · exact ambientOutput_pair_mem u v hu hv i.1 i.2 + +theorem diagonalBase_le_system : diagonalBase u v (0:ℕ)≤(ambientSystem u v hu hv hunit).generated scalarFlip := + (diagonalBase_le_uniform u v hu hv hunit).trans + (Bicommutant.mono _ _ (fun _ h => Or.inl h)) + +theorem ambient_generator_decomposition : + S u v (0:ℕ)=diagonalSelf u v 0+ + (ambientExtra u v (residualIndex true)+star (ambientExtra u v (residualIndex false)))+ + (ambientExtra u v (residualIndex false)+star (ambientExtra u v (residualIndex true))) := by + change S u v 0=diagonalSelf u v 0+ + (ambientRect u v 0 true false+star (ambientRect u v 0 false true))+ + (ambientRect u v 0 false true+star (ambientRect u v 0 true false)) + rw [diagonalSelf,diagonalLeg,diagonalLeg,rect_paired_eq,rect_paired_eq,rect_paired_eq,rect_paired_eq] + change S u v 0=P*S u v 0*P+(1-P)*S u v 0*(1-P)+P*S u v 0*(1-P)+(1-P)*S u v 0*P + simp only [sub_mul,mul_sub,one_mul,mul_one] + abel + +theorem ambient_le_ambientSystem : ambientAlgebra u v≤(ambientSystem u v hu hv hunit).generated scalarFlip := by + let G := (ambientSystem u v hu hv hunit).generated scalarFlip + have hbase := diagonalBase_le_system u v hu hv hunit + have hout (i : WeightedCornerIndex.Index) (n : ℕ) : + (ambientAbsorption u v hu hv).output i n+ + star ((ambientAbsorption u v hu hv).output (CircularRotation.flip i) n)∈G := + Bicommutant.subset _ (Or.inr (Set.mem_range_self (i,n))) + have hgen := ((ambientAbsorption u v hu hv).output_generation G + (fun i => hbase (ambientLeft u v i).property) + (fun i => hbase (ambientRight u v i).property)).mpr hout + apply Bicommutant.generated_le + rintro T (rfl|⟨n,rfl⟩) + · exact hbase (P_mem_diagonalBase u v 0) + · cases n with + | zero => + rw [ambient_generator_decomposition u v] + exact add_mem (add_mem (hbase (diagonalSelf_mem u v 0)) (hgen.1 (residualIndex true))) + (hgen.1 (residualIndex false)) + | succ n => + obtain ⟨⟨i,k⟩,he⟩ := reservoirCode.surjective n + subst n + exact hgen.2 i k + +theorem ambient_generated_eq : (ambientSystem u v hu hv hunit).generated scalarFlip=ambientAlgebra u v := + le_antisymm (ambientSystem_le_ambient u v hu hv hunit) (ambient_le_ambientSystem u v hu hv hunit) + +theorem ambientSystem_total : + (Submodule.span ℂ (Set.range (ambientSystem u v hu hv hunit).family)).topologicalClosure=⊤ := by + apply path_closed_total _ (Submodule.isClosed_topologicalClosure _) + intro w + obtain ⟨B,hB,hh⟩ := good_basis u v hu hv w + rw [← hh] + exact (ambientSystem u v hu hv hunit).normalHull_bicommutant scalarFlip B + (ambient_le_ambientSystem u v hu hv hunit hB.1) +end + +open FreeFock GaussianRecognition CyclicSpectral +variable (u v : ℝ) (hu : u≠0) (hv : v≠0) (hunit : u^2+v^2=1) + +theorem scalar_ambient_state (a : UniformAlgebra) : + inner ℂ scalarSystem.root (scalarSystem.coeff a scalarSystem.root)= + inner ℂ (ambientSystem u v hu hv hunit).root + ((ambientSystem u v hu hv hunit).coeff a (ambientSystem u v hu hv hunit).root) := by + exact (scalarUniform_state (none:ScalarIndex) a).trans (ambientUniform_state u v hu hv hunit a).symm + +def ambientGaussianIso : (ambientSystem u v hu hv hunit).generated scalarFlip ≃⋆ₐ[ℂ] + scalarSystem.generated scalarFlip := + (ambientSystem u v hu hv hunit).generatedIso scalarSystem + (scalar_ambient_state u v hu hv hunit) + (ambientSystem_total u v hu hv hunit) scalarSystem_total scalarFlip + +theorem ambientGaussianIso_normal : + @Continuous _ _ ((ambientSystem u v hu hv hunit).generatedTopology scalarFlip) + (scalarSystem.generatedTopology scalarFlip) (ambientGaussianIso u v hu hv hunit) := + (ambientSystem u v hu hv hunit).generatedIso_normal scalarSystem + (scalar_ambient_state u v hu hv hunit) + (ambientSystem_total u v hu hv hunit) scalarSystem_total scalarFlip + +theorem ambientGaussianIso_trace (T : (ambientSystem u v hu hv hunit).generated scalarFlip) : + inner ℂ scalarSystem.root ((ambientGaussianIso u v hu hv hunit T : FreeFock.Operator ScalarIndex) scalarSystem.root)= + vacuumTrace u v (T:Operator ℕ) := + (ambientSystem u v hu hv hunit).generatedIso_trace scalarSystem + (scalar_ambient_state u v hu hv hunit) + (ambientSystem_total u v hu hv hunit) scalarSystem_total scalarFlip T +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Basic.lean b/lean/OAI/Analysis/InterpolatedFactors/Basic.lean new file mode 100644 index 0000000000000000000000000000000000000000..56253ac42faec9f2213072e0c48ada1fae6dae38 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Basic.lean @@ -0,0 +1,460 @@ +import OAI.Analysis.FreeGroupFactor.Main + +namespace OAI + +noncomputable section + +namespace FreeGroupFactorMain + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 u_10 u_11 u_12 +universe u_13 u_14 u_15 u_16 u_17 u_18 u_19 u_20 u_21 u_22 u_23 u_24 +universe u_25 u_26 u_27 u_28 u_29 u_30 u_31 u_32 u_33 u_34 u_35 u_36 +universe u_37 u_38 u_39 u_40 u_41 u_42 u_43 u_44 u_45 + +namespace Amplification + +section + +variable {A : Type u_1} {B : Type u_2} [CStarAlgebra A] [CStarAlgebra B] + +@[simp] theorem corner_one_val (p : A) (hp : IsStarProjection p) : + ((1 : Corner p hp) : A) = p := rfl + +@[simp] theorem corner_mul_val (p : A) (hp : IsStarProjection p) (x y : Corner p hp) : + ((x*y : Corner p hp) : A) = (x : A)*(y : A) := rfl + + theorem map_projection (Φ : A ≃⋆ₐ[ℂ] B) (p : A) (hp : IsStarProjection p) : + IsStarProjection (Φ p) := hp.map Φ + +def cornerCongr (Φ : A ≃⋆ₐ[ℂ] B) (p : A) (hp : IsStarProjection p) : + Corner p hp ≃⋆ₐ[ℂ] Corner (Φ p) (map_projection Φ p hp) where + toFun x := ⟨Φ x,by + constructor + · rw [← map_mul,x.property.1] + · rw [← map_mul,x.property.2]⟩ + invFun y := ⟨Φ.symm y,by + constructor + · have hy := congrArg Φ.symm y.property.1 + simpa only [map_mul,Φ.symm_apply_apply] using hy + · have hy := congrArg Φ.symm y.property.2 + simpa only [map_mul,Φ.symm_apply_apply] using hy⟩ + left_inv x := Subtype.ext (Φ.symm_apply_apply x) + right_inv y := Subtype.ext (Φ.apply_symm_apply y) + map_mul' x y := Subtype.ext (map_mul Φ (x : A) (y : A)) + map_add' x y := Subtype.ext (map_add Φ (x : A) (y : A)) + map_smul' z x := Subtype.ext (map_smul Φ z (x : A)) + map_star' x := Subtype.ext (map_star Φ (x : A)) + +end + +section +variable {A : Type u_3} {B : Type u_4} [CStarAlgebra A] [CStarAlgebra B] + + theorem cornerCongr_normal (Φ : A ≃⋆ₐ[ℂ] B) (p : A) (hp : IsStarProjection p) + (𝒯A : TopologicalSpace A) (𝒯B : TopologicalSpace B) + (hΦ : @Continuous _ _ 𝒯A 𝒯B Φ) : + @Continuous _ _ (cornerTopology 𝒯A p hp) + (cornerTopology 𝒯B (Φ p) (map_projection Φ p hp)) (cornerCongr Φ p hp) := by + let : TopologicalSpace A := 𝒯A + let : TopologicalSpace B := 𝒯B + let : TopologicalSpace (Corner p hp) := cornerTopology 𝒯A p hp + let : TopologicalSpace (Corner (Φ p) (map_projection Φ p hp)) := + cornerTopology 𝒯B (Φ p) (map_projection Φ p hp) + exact (hΦ.comp continuous_subtype_val).subtype_mk _ + + theorem normalizedCornerTrace_one (τ : A → ℂ) (t : ℝ) (ht : 0 < t) + (p : A) (hp : IsStarProjection p) (hτ : τ p = (t : ℂ)) : + normalizedCornerTrace τ t p hp 1 = 1 := by + change (t : ℂ)⁻¹ * τ p = 1 + rw [hτ,inv_mul_cancel₀ (Complex.ofReal_ne_zero.mpr ht.ne')] + + theorem cornerCongr_trace (Φ : A ≃⋆ₐ[ℂ] B) (p : A) (hp : IsStarProjection p) + (τA : A → ℂ) (τB : B → ℂ) (hτ : ∀ x, τB (Φ x) = τA x) (t : ℝ) + (x : Corner p hp) : + normalizedCornerTrace τB t (Φ p) (map_projection Φ p hp) (cornerCongr Φ p hp x) = + normalizedCornerTrace τA t p hp x := by + change (t : ℂ)⁻¹ * τB (Φ x) = (t : ℂ)⁻¹ * τA x + rw [hτ] + +end + +open scoped ENNReal + +def HasAmplificationIso (G : Type u_12) (H : Type u_13) [Group G] [Group H] (t : ℝ) + (p : stabilization G) (hp : IsStarProjection p) : Prop := + ∃ Φ : Corner p hp ≃⋆ₐ[ℂ] groupVonNeumann H, + (∀ T, canonicalTrace (Φ T) = normalizedCornerTrace stabilizedTrace t p hp T) ∧ + @Continuous _ _ (cornerTopology (stabilizationTopology G) p hp) + (groupUltraweakTopology H) Φ + +end Amplification + +namespace FreeFock +open scoped ENNReal + +abbrev Hilbert (α : Type u_14) := lp (fun _ : α => ℂ) 2 +variable {α : Type u_15} {β : Type u_16} [DecidableEq α] [DecidableEq β] + +end FreeFock +open Filter Topology + +namespace Amplification + +section +variable {A : Type u_17} {B : Type u_18} [CStarAlgebra A] [CStarAlgebra B] + +def subalgebraEquiv (M : StarSubalgebra ℂ A) (N : StarSubalgebra ℂ B) + (e : A ≃⋆ₐ[ℂ] B) (he : ∀ a, e a∈N ↔ a∈M) : M ≃⋆ₐ[ℂ] N where + toFun a := ⟨e a,(he a).mpr a.property⟩ + invFun b := ⟨e.symm b,(he _).mp (by rw [StarAlgEquiv.apply_symm_apply];exact b.property)⟩ + left_inv a := Subtype.ext (e.symm_apply_apply a) + right_inv b := Subtype.ext (e.apply_symm_apply b) + map_mul' a b := Subtype.ext (e.map_mul (a:A) (b:A)) + map_add' a b := Subtype.ext (e.map_add (a:A) (b:A)) + map_smul' c a := Subtype.ext (map_smul e c (a:A)) + map_star' a := Subtype.ext (e.map_star' (a:A)) + +variable (M : StarSubalgebra ℂ A) [IsClosed (M : Set A)] +variable (p : M) (hp : IsStarProjection p) + +variable {E : Type u_19} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +end + +section +open scoped ENNReal ComplexConjugate +local instance instDecidableEqNestedHilbert (α : Type u_20) : DecidableEq α := Classical.decEq α + +variable {I : Type u_21} {J : Type u_22} +abbrev NestedHilbert (I : Type u_23) (J : Type u_24) := lp (fun _ : I => GroupHilbert J) 2 + +def nestedDirac (ij : I × J) : NestedHilbert I J := by + classical + exact lp.single 2 ij.1 (lp.single 2 ij.2 1) + +theorem nestedDirac_inner (x y : I × J) : + inner ℂ (nestedDirac x) (nestedDirac y) = if x = y then 1 else 0 := by + classical + rcases x with ⟨i,j⟩ + rcases y with ⟨k,l⟩ + by_cases hik : i = k + · subst k + simp [nestedDirac,lp.inner_single_left,lp.single_apply,Pi.single_apply,RCLike.inner_apply] + · simp [nestedDirac,lp.inner_single_left,lp.single_apply,hik] + +theorem nestedDirac_inner_apply (ij : I × J) (ξ : NestedHilbert I J) : + inner ℂ (nestedDirac ij) ξ = ξ ij.1 ij.2 := by + classical + simp [nestedDirac,lp.inner_single_left,RCLike.inner_apply] + +theorem nestedDirac_orthogonal : + (Submodule.span ℂ (Set.range (nestedDirac (I := I) (J := J))))ᗮ = ⊥ := by + apply le_antisymm _ bot_le + intro ξ hξ + apply show ξ = 0 → ξ ∈ (⊥ : Submodule ℂ (NestedHilbert I J)) from fun h => h ▸ Submodule.zero_mem _ + ext i j + have hh := ((Submodule.mem_orthogonal _ _).mp hξ) (nestedDirac (i,j)) + (Submodule.subset_span (Set.mem_range_self (i,j))) + simpa only [nestedDirac_inner_apply,lp.coeFn_zero,Pi.zero_apply] using hh + +def nestedBasis (I : Type u_25) (J : Type u_26) : HilbertBasis (I × J) ℂ (NestedHilbert I J) := + HilbertBasis.mkOfOrthogonalEqBot (orthonormal_iff_ite.mpr nestedDirac_inner) nestedDirac_orthogonal + +@[simp] theorem nestedBasis_apply (ij : I × J) : nestedBasis I J ij = nestedDirac ij := by + simp [nestedBasis] + +def hilbertFlatten (I : Type u_27) (J : Type u_28) : NestedHilbert I J ≃ₗᵢ[ℂ] GroupHilbert (I × J) := + (nestedBasis I J).repr + +@[simp] theorem hilbertFlatten_apply (ξ : NestedHilbert I J) (ij : I × J) : + hilbertFlatten I J ξ ij = ξ ij.1 ij.2 := by + rw [hilbertFlatten,HilbertBasis.repr_apply_apply,nestedBasis_apply,nestedDirac_inner_apply] + +@[simp] theorem hilbertFlatten_symm_apply (ξ : GroupHilbert (I × J)) (i : I) (j : J) : + (hilbertFlatten I J).symm ξ i j = ξ (i,j) := by + have hh := congrArg (fun v : GroupHilbert (I × J) => v (i,j)) + ((hilbertFlatten I J).apply_symm_apply ξ) + simpa only [hilbertFlatten_apply] using hh + +def diagonalValue (A : GroupOperator J) (ξ : NestedHilbert I J) : NestedHilbert I J := + ⟨fun i => A (ξ i),((lp.memℓp ξ).norm.const_smul ‖A‖).mono (fun i => A.le_opNorm (ξ i))⟩ + +theorem diagonalValue_norm_le (A : GroupOperator J) (ξ : NestedHilbert I J) : + ‖diagonalValue A ξ‖ ≤ ‖A‖*‖ξ‖ := by + have hh := lp.norm_mono (by norm_num : (2 : ℝ≥0∞) ≠ 0) (x := diagonalValue A ξ) (y := (‖A‖ : ℝ) • ξ) (fun i => by + change ‖A (ξ i)‖ ≤ ‖(‖A‖ : ℝ) • ξ i‖ + simpa only [norm_smul,Real.norm_eq_abs,abs_of_nonneg (norm_nonneg A)] using A.le_opNorm (ξ i)) + simpa only [norm_smul,Real.norm_eq_abs,abs_of_nonneg (norm_nonneg A)] using hh + +theorem diagonalValue_add (operator : GroupOperator J) (left right : NestedHilbert I J) : + diagonalValue operator (left + right) = diagonalValue operator left + diagonalValue operator right := by + ext row column + exact congrArg (fun vector : GroupHilbert J => vector column) + (map_add operator (left row) (right row)) + +theorem diagonalValue_smul (operator : GroupOperator J) (scalar : ℂ) (vector : NestedHilbert I J) : + diagonalValue operator (scalar • vector) = scalar • diagonalValue operator vector := by + ext row column + exact congrArg (fun image : GroupHilbert J => image column) + (map_smul operator scalar (vector row)) + +theorem continuous_diagonalValue (operator : GroupOperator J) : + Continuous (diagonalValue (I := I) operator) := + (LinearMap.mkContinuous + { toFun := diagonalValue operator + map_add' := diagonalValue_add operator + map_smul' := diagonalValue_smul operator } + ‖operator‖ (diagonalValue_norm_le operator) : + NestedHilbert I J →L[ℂ] NestedHilbert I J).continuous + +def diagonalOp (I : Type u_29) (A : GroupOperator J) : + NestedHilbert I J →L[ℂ] NestedHilbert I J where + toFun := diagonalValue A + map_add' := diagonalValue_add A + map_smul' := diagonalValue_smul A + cont := continuous_diagonalValue A + +@[simp] theorem diagonalOp_apply (A : GroupOperator J) (ξ : NestedHilbert I J) (i : I) : + diagonalOp I A ξ i = A (ξ i) := rfl + +theorem diagonalOp_star (A : GroupOperator J) : + diagonalOp I (star A) = star (diagonalOp I A) := by + apply ContinuousLinearMap.ext + intro ξ + apply ext_inner_right ℂ + intro η + change inner ℂ (diagonalOp I (star A) ξ) η = + inner ℂ ((ContinuousLinearMap.adjoint (diagonalOp I A)) ξ) η + rw [ContinuousLinearMap.adjoint_inner_left] + simp only [lp.inner_eq_tsum,diagonalOp_apply] + apply tsum_congr + intro i + simpa only [ContinuousLinearMap.star_eq_adjoint,lp.inner_eq_tsum] using ContinuousLinearMap.adjoint_inner_left A (η i) (ξ i) + +def diagonalHom (I : Type u_30) (J : Type u_31) : GroupOperator J →⋆ₐ[ℂ] (NestedHilbert I J →L[ℂ] NestedHilbert I J) where + toFun := diagonalOp I + map_one' := by ext ξ i j; rfl + map_mul' A B := by ext ξ i j; rfl + map_zero' := by ext ξ i j; rfl + map_add' A B := by ext ξ i j; rfl + commutes' z := by ext ξ i j; rfl + map_star' := diagonalOp_star + +def productAmplification (I : Type u_32) (J : Type u_33) : GroupOperator J →⋆ₐ[ℂ] GroupOperator (I × J) := + (hilbertFlatten I J).conjStarAlgEquiv.toStarAlgHom.comp (diagonalHom I J) + +@[simp] theorem productAmplification_apply (A : GroupOperator J) (ξ : GroupHilbert (I × J)) + (i : I) (j : J) : + productAmplification I J A ξ (i,j) = + A ((hilbertFlatten I J).symm ξ i) j := by + change hilbertFlatten I J (diagonalOp I A ((hilbertFlatten I J).symm ξ)) (i,j) = _ + rw [hilbertFlatten_apply,diagonalOp_apply] + +end +section +open scoped ENNReal +local instance (α : Type u_34) : DecidableEq α := Classical.decEq α +variable {I : Type u_35} {J : Type u_36} + +variable {G : Type u_37} [Group G] + +theorem stabilizedRightTranslations_eq_range : + stabilizedRightTranslations G = Set.range (fun g : G => productAmplification ℕ G (rightRegular g)) := by + ext T + constructor + · rintro ⟨g,hg⟩ + refine ⟨g,?_⟩ + apply ContinuousLinearMap.ext + intro ξ + ext x + rw [hg] + rcases x with ⟨i,j⟩ + simp only [productAmplification_apply,rightRegular_apply,hilbertFlatten_symm_apply] + · rintro ⟨g,rfl⟩ + refine ⟨g,?_⟩ + intro ξ x + rcases x with ⟨i,j⟩ + simp only [productAmplification_apply,rightRegular_apply,hilbertFlatten_symm_apply] + +end + +section +open scoped ENNReal +variable {G : Type u_38} + +def pairedIndex (G : Type u_39) : (ℕ × (ℕ × G)) ≃ (ℕ × G) := + (Equiv.prodAssoc ℕ ℕ G).symm.trans (Equiv.prodCongr Nat.pairEquiv (Equiv.refl G)) + +def stabilizationFlatten (G : Type u_40) : GroupHilbert (ℕ × (ℕ × G)) ≃ₗᵢ[ℂ] GroupHilbert (ℕ × G) := + hilbertReindex (pairedIndex G) + +@[simp] theorem pairedIndex_symm_apply (k : ℕ) (g : G) : (pairedIndex G).symm (k,g)=((Nat.unpair k).1,(Nat.unpair k).2,g) := rfl + +variable [Group G] + +def doubleRight (g : G) : GroupOperator (ℕ × (ℕ × G)) := + productAmplification ℕ (ℕ × G) (productAmplification ℕ G (rightRegular g)) + +theorem doubleRight_star (g : G) : star (doubleRight g)=doubleRight g⁻¹ := by + simp only [doubleRight,←map_star,rightRegular_star] + +theorem flatten_doubleRight (g : G) : + (stabilizationFlatten G).conjStarAlgEquiv (doubleRight g)=productAmplification ℕ G (rightRegular g) := by + apply ContinuousLinearMap.ext + intro ξ + ext x + rcases x with ⟨k,h⟩ + change hilbertReindex (pairedIndex G) + (doubleRight g ((hilbertReindex (pairedIndex G)).symm ξ)) (k,h)=_ + simp only [hilbertReindex_apply,pairedIndex_symm_apply,doubleRight,productAmplification_apply, + hilbertFlatten_symm_apply,rightRegular_apply] + change ξ (Nat.pair (Nat.unpair k).1 (Nat.unpair k).2,h*g)=ξ (k,h*g) + rw [Nat.pair_unpair] + +def doubleStabilization (G : Type u_41) [Group G] : StarSubalgebra ℂ (GroupOperator (ℕ × (ℕ × G))) := + StarSubalgebra.centralizer ℂ (Set.range (doubleRight (G := G))) + +theorem mem_stabilization_iff_right (T : GroupOperator (ℕ × G)) : + T ∈ stabilization G ↔ ∀g : G,productAmplification ℕ G (rightRegular g)*T=T*productAmplification ℕ G (rightRegular g) := by + rw [stabilization,StarSubalgebra.mem_centralizer_iff,stabilizedRightTranslations_eq_range] + constructor + · intro h g + exact (h _ ⟨g,rfl⟩).1 + · rintro h _ ⟨g,rfl⟩ + refine ⟨h g,?_⟩ + rw [←map_star,rightRegular_star] + exact h g⁻¹ + +theorem mem_doubleStabilization_iff_right (T : GroupOperator (ℕ × (ℕ × G))) : + T ∈ doubleStabilization G ↔ ∀g : G,doubleRight g*T=T*doubleRight g := by + rw [doubleStabilization,StarSubalgebra.mem_centralizer_iff] + constructor + · intro h g + exact (h _ ⟨g,rfl⟩).1 + · rintro h _ ⟨g,rfl⟩ + exact ⟨h g,by rw [doubleRight_star]; exact h g⁻¹⟩ + +theorem flatten_mem_stabilization (T : GroupOperator (ℕ × (ℕ × G))) : + T ∈ doubleStabilization G ↔ (stabilizationFlatten G).conjStarAlgEquiv T ∈ stabilization G := by + rw [mem_doubleStabilization_iff_right,mem_stabilization_iff_right] + constructor + · intro h g + have hh := congrArg (stabilizationFlatten G).conjStarAlgEquiv (h g) + simpa only [map_mul,flatten_doubleRight] using hh + · intro h g + apply (stabilizationFlatten G).conjStarAlgEquiv.injective + change (stabilizationFlatten G).conjStarAlgEquiv (doubleRight g*T) = + (stabilizationFlatten G).conjStarAlgEquiv (T*doubleRight g) + simp only [map_mul,flatten_doubleRight] + exact h g + +def flattenStabilizationIso : doubleStabilization G ≃⋆ₐ[ℂ] stabilization G := + subalgebraEquiv (doubleStabilization G) (stabilization G) + (stabilizationFlatten G).conjStarAlgEquiv (fun T => (flatten_mem_stabilization T).symm) + +def doubleDiagonal (T : stabilization G) : doubleStabilization G := + ⟨productAmplification ℕ (ℕ × G) T,by + rw [mem_doubleStabilization_iff_right] + intro g + change productAmplification ℕ (ℕ × G) (productAmplification ℕ G (rightRegular g))*productAmplification ℕ (ℕ × G) (T : GroupOperator _)=_ + rw [←map_mul] + change _=productAmplification ℕ (ℕ × G) (T : GroupOperator _)*productAmplification ℕ (ℕ × G) (productAmplification ℕ G (rightRegular g)) + rw [←map_mul,(mem_stabilization_iff_right _).mp T.property g]⟩ + +def repeatFlatten (p : stabilization G) : stabilization G := flattenStabilizationIso (doubleDiagonal p) + +theorem doubleDiagonal_projection (p : stabilization G) (hp : IsStarProjection p) : IsStarProjection (doubleDiagonal p) := by + have hh := (hp.map (stabilization G).subtype).map (productAmplification ℕ (ℕ × G)) + constructor + · exact Subtype.ext hh.isIdempotentElem.eq + · exact Subtype.ext hh.isSelfAdjoint.star_eq + +theorem repeatFlatten_projection (p : stabilization G) (hp : IsStarProjection p) : IsStarProjection (repeatFlatten p) := by + let equiv : doubleStabilization G ≃⋆ₐ[ℂ] stabilization G := flattenStabilizationIso + have projection := doubleDiagonal_projection p hp + constructor + · exact (equiv.map_mul' _ _).symm.trans (congrArg equiv projection.isIdempotentElem.eq) + · exact (equiv.map_star' _).symm.trans (congrArg equiv projection.isSelfAdjoint.star_eq) + +end + +open scoped ENNReal +variable {G : Type u_45} [Group G] + +abbrev CornerStabilization (p : stabilization G) (hp : IsStarProjection p) := + Corner (repeatFlatten p) (repeatFlatten_projection p hp) + +@[instance_reducible] def cornerStabilizationTopology (p : stabilization G) (hp : IsStarProjection p) : + TopologicalSpace (CornerStabilization p hp) := + cornerTopology (stabilizationTopology G) (repeatFlatten p) (repeatFlatten_projection p hp) + +def cornerStabilizationProjectionTrace (a : ℝ) (p : stabilization G) (hp : IsStarProjection p) + (q : CornerStabilization p hp) : ℝ≥0∞ := + (ENNReal.ofReal a)⁻¹ * stabilizedProjectionTrace q.val + +def cornerStabilizationTrace (a : ℝ) (p : stabilization G) (hp : IsStarProjection p) + (x : CornerStabilization p hp) : ℂ := (a:ℂ)⁻¹ * stabilizedTrace x.val + +end Amplification + +namespace Interpolation + +open Amplification +open scoped ENNReal + +def Model.Valid : Model → Prop + | .integer n => 2≤n + | .continuous r => 1 True + +def Model.Stabilization : Model → Type + | .integer n => stabilization (FreeGroupRank n) + | .continuous r => CornerStabilization (selectedProjection (interpolationScale r)).val + (selectedProjection (interpolationScale r)).property + | .infinity => stabilization (FreeGroup ℕ) + +instance modelStabilizationCStarAlgebra (m : Model) : CStarAlgebra m.Stabilization := by + cases m <;> dsimp only [Model.Stabilization] <;> infer_instance + +@[instance_reducible] def Model.stabilizationTopology : (m : Model) → TopologicalSpace m.Stabilization + | .integer n => Amplification.stabilizationTopology (FreeGroupRank n) + | .continuous r => cornerStabilizationTopology (selectedProjection (interpolationScale r)).val + (selectedProjection (interpolationScale r)).property + | .infinity => Amplification.stabilizationTopology (FreeGroup ℕ) + +def Model.projectionTrace : (m : Model) → m.Stabilization → ℝ≥0∞ + | .integer _ => stabilizedProjectionTrace + | .continuous r => cornerStabilizationProjectionTrace (interpolationScale r) + (selectedProjection (interpolationScale r)).val (selectedProjection (interpolationScale r)).property + | .infinity => stabilizedProjectionTrace + +def Model.stabilizationTrace : (m : Model) → m.Stabilization → ℂ + | .integer _ => stabilizedTrace + | .continuous r => cornerStabilizationTrace (interpolationScale r) + (selectedProjection (interpolationScale r)).val (selectedProjection (interpolationScale r)).property + | .infinity => stabilizedTrace + +abbrev Model.Iso (m n : Model) := NormalTracialEquiv m.trace n.trace m.topology n.topology + +abbrev Model.AmplificationIso (m : Model) (t : ℝ) (p : m.Stabilization) (hp : IsStarProjection p) := + NormalTracialEquiv (normalizedCornerTrace m.stabilizationTrace t p hp) m.trace + (cornerTopology m.stabilizationTopology p hp) m.topology + +def Model.fundamentalGroup (m : Model) : Set ℝ := + {t | 0 exact P_mem_edge u v i + | true => exact edgeRange_mem_edge u v i)⟩ + +theorem pSupport_projection (u v : ℝ) (i j : ι) (r : Bool) : IsStarProjection (pSupport u v i j r) := by + constructor + · apply Subtype.ext;apply Subtype.ext + exact (legSupport_projection u v i r).isIdempotentElem.eq + · apply Subtype.ext;apply Subtype.ext + exact (legSupport_projection u v i r).isSelfAdjoint.star_eq + +theorem pSupport_false (u v : ℝ) (i j : ι) : pSupport u v i j false=1 := rfl + +theorem pFresh_covariance (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i j n m : ι) (hji : j≠i) (hni : n≠i) (hnj : n≠j) (hmi : m≠i) (hmj : m≠j) + (r s r' s' : Bool) (a : pFilled u v i j) : + star (pFresh u v i n r s)*(a : PCorner ι)*pFresh u v i m r' s'= + if n=m ∧ r=r' ∧ s=s' then + pTrace u v i j (a*pSupport u v i j r) • (pSupport u v i j s : PCorner ι) else 0 := by + apply Subtype.ext + have h := normalizedCreation_filled_covariance u v hu hv i j n m hji hni hnj hmi hmj r s r' s' (filledOfCorner a) + split_ifs with hh + · rw [ite_eq_left hh] at h + exact h + · rw [ite_eq_right hh] at h + exact h + +end FreeGroupFactorMain.WeightedFock + +end + +namespace FreeGroupFactorMain.WeightedFock + +section +open FreeFock Amplification RectangularAbsorption +variable {ι : Type u_4} [DecidableEq ι] + +theorem legSupport_mul_leg (u v : ℝ) (hv : 0 hrs ⟨h.2.1.symm,h.2.2.symm⟩)] at h + exact h + D_C a n := by + have h := pFresh_covariance u v (hv.trans hvu).ne' hv.ne' i j n₀ (f n) hji + h₀i h₀j (hfi n) (hfj n) r s false false a + rw [ite_eq_right (fun h => hrs ⟨h.2.1,h.2.2⟩)] at h + exact h +end + +open FreeFock Amplification RectangularAbsorption +variable {ι : Type u_5} [DecidableEq ι] + +def pResidualSupport (u v : ℝ) (i j : ι) : Option Bool → pFilled u v i j + | none => 1-pSupport u v i j true + | some _ => pSupport u v i j true + +@[simp] theorem pResidualSupport_val (u v : ℝ) (i j : ι) (r : Option Bool) : + ((pResidualSupport u v i j r : PCorner ι):Operator ι)=residualSupport u v i r := by + cases r <;> rfl + +theorem pResidualSupport_projection (u v : ℝ) (i j : ι) (r : Option Bool) : + IsStarProjection (pResidualSupport u v i j r) := by + cases r with + | none => exact (pSupport_projection u v i j true).one_sub + | some r => exact pSupport_projection u v i j true + +theorem residualSupport_projection (u v : ℝ) (i : ι) (r : Option Bool) : + IsStarProjection (residualSupport u v i r) := by + cases r with + | none => exact edgeDefect_projection u v i + | some r => exact edgeRange_projection u v i + +theorem residualSupport_mul_leg (u v : ℝ) (hv : 0 (z:Operator ι)) hbA.eq + exact ⟨hh,by rw [(oldBaseGenerator_selfAdjoint u v i j).star_eq];exact hh⟩ + have hh : b*x=x*b := Subtype.ext (((StarSubalgebra.mem_centralizer_iff ℂ).mp hx _ hb).1) + have he := congrArg (fun z : PCorner ι => pRepresentation z) hh + rw [hmul,hmul] at he + simpa only [StarAlgEquiv.apply_symm_apply,b] using he + rw [Bicommutant.algebra,StarSubalgebra.mem_centralizer_iff] + intro B hB + exact ⟨htest B hB,htest (star B) (star_mem hB)⟩ + +variable (u v : ℝ) (hv : 0 hbase (kindLeft u v (description i))) + (fun i => hbase (kindRight u v (description i)))).mpr hout + have he := hh.1 (indexOf k) + change kindCreator u v (description (indexOf k))+ + star (kindCreator u v (description (CircularRotation.flip (indexOf k))))∈M at he + simpa only [description_flip,description_indexOf k hk] using he + +theorem absorbed_raw_recovery (M : StarSubalgebra ℂ (PCorner ℕ)) + (hbase : ∀ a : Base u v,(a:PCorner ℕ)∈M) + (hout : ∀ i n,(cornerAbsorption u v hv hvu).output i n+ + star ((cornerAbsorption u v hv hvu).output (CircularRotation.flip i) n)∈M) + (n : ℕ) : pFresh u v 0 (n+2) false false+star (pFresh u v 0 (n+2) false false)∈M := by + have hh := ((cornerAbsorption u v hv hvu).output_generation M + (fun i => hbase (kindLeft u v (description i))) + (fun i => hbase (kindRight u v (description i)))).mpr hout + obtain ⟨⟨i,m⟩,h⟩ := reservoirCode.surjective n + simpa only [cornerAbsorption,rawReservoir,h] using hh.2 i m + +theorem absorbed_fresh_recovery (M : StarSubalgebra ℂ (PCorner ℕ)) + (hbase : ∀ a : Base u v,(a:PCorner ℕ)∈M) + (hout : ∀ i n,(cornerAbsorption u v hv hvu).output i n+ + star ((cornerAbsorption u v hv hvu).output (CircularRotation.flip i) n)∈M) + (n : ℕ) (r s : Bool) : pFresh u v 0 (n+2) r s+star (pFresh u v 0 (n+2) s r)∈M := by + by_cases hh : r=false ∧ s=false + · rcases hh with ⟨rfl,rfl⟩ + exact absorbed_raw_recovery u v hv hvu M hbase hout n + · exact absorbed_kind_recovery u v hv hvu M hbase hout (.fresh n r s) hh + +variable {ι : Type u_4} [DecidableEq ι] + +theorem vertex_C_vertex (i : ι) (r : Bool) : + vertex r*C u v i*vertex r=(weight u v r:ℂ) • edgeCreation i r r := by + cases r + · simp only [vertex,Bool.false_eq_true,ite_false,C,sub_mul,one_mul,mul_add,mul_smul_comm, + P_creation_true,P_creation_false,sub_self,smul_zero,sub_zero,zero_add, + smul_mul_assoc,weight,edgeCreation] + · simp only [vertex,ite_true,C,mul_add,mul_smul_comm,P_creation_true, + P_creation_false,smul_zero (M := ℂ) (A := Operator ι),add_zero,smul_mul_assoc,weight,edgeCreation] + +theorem pDiagonal_eq_pFresh (i : ι) (r : Bool) : + pDiagonal u v i i r=pFresh u v i i r r := by + apply Subtype.ext + change ((weight u v (!r):ℂ)/(u:ℂ)) • + (supportedLeg u v i r*edgeCreation i (!r) (!r)*star (supportedLeg u v i r))= + (u:ℂ)⁻¹ • (supportedLeg u v i r*C u v i*star (supportedLeg u v i r)) + have hh : supportedLeg u v i r*C u v i*star (supportedLeg u v i r)= + (weight u v (!r):ℂ) • + (supportedLeg u v i r*edgeCreation i (!r) (!r)*star (supportedLeg u v i r)) := by + calc + _ = supportedLeg u v i r*(vertex (!r)*C u v i*vertex (!r))*star (supportedLeg u v i r) := by + simp only [← mul_assoc,supportedLeg_vertex] + rw [mul_assoc _ (vertex (!r)),vertex_star_supportedLeg] + _ = _ := by rw [vertex_C_vertex];simp only [mul_smul_comm,smul_mul_assoc] + rw [hh,smul_smul] + congr 1 + exact div_eq_inv_mul _ _ +end + +section +open FreeFock Amplification WeightedCornerIndex +variable {ι : Type u_5} [DecidableEq ι] + +def blockCorner (u v : ℝ) (i j : ι) (r s : Bool) : PCorner ι := + sandwiched P projection_P (supportedLeg u v i r) (supportedLeg u v i s) (S u v j) + (P_mul_supportedLeg u v i r) (P_mul_supportedLeg u v i s) + +theorem blockCorner_normalized (u v : ℝ) (hu : u≠0) (i j : ι) (r s : Bool) : + blockCorner u v i j r s=(u:ℂ) • (pFresh u v i j r s+star (pFresh u v i j s r)) := by + apply Subtype.ext + change supportedLeg u v i r*S u v j*star (supportedLeg u v i s)= + (u:ℂ) • (normalizedCreation u v i j r s+star (normalizedCreation u v i j s r)) + simp only [normalizedCreation,star_smul,Complex.star_def,map_inv₀,Complex.conj_ofReal, + ← smul_add (M := ℂ) (A := Operator ι)] + rw [smul_smul,mul_inv_cancel₀ (Complex.ofReal_ne_zero.mpr hu),one_smul,supportedCreation_paired] + +def residualBlockCorner (u v : ℝ) (i j : ι) (r s : Option Bool) : PCorner ι := + sandwiched P projection_P (residualLeg u v i r) (residualLeg u v i s) (S u v j) + (P_mul_residualLeg u v i r) (P_mul_residualLeg u v i s) + +theorem residualBlockCorner_normalized (u v : ℝ) (hu : u≠0) (i j : ι) (r s : Option Bool) : + residualBlockCorner u v i j r s=(u:ℂ) • (pResidual u v i j r s+star (pResidual u v i j s r)) := by + apply Subtype.ext + change residualLeg u v i r*S u v j*star (residualLeg u v i s)= + (u:ℂ) • (normalizedResidual u v i j r s+star (normalizedResidual u v i j s r)) + simp only [normalizedResidual,star_smul,Complex.star_def,map_inv₀,Complex.conj_ofReal, + ← smul_add (M := ℂ) (A := Operator ι)] + rw [smul_smul,mul_inv_cancel₀ (Complex.ofReal_ne_zero.mpr hu),one_smul] + exact (residualPair_eq u v i j r s).symm + +theorem blockCorner_zero_off (u v : ℝ) (i : ι) : + (blockCorner u v i i false true : Operator ι)=leftModulus u v i := by + change P*S u v i*star (edgePolar u v i)=_ + have h : (1-P)*star (edgePolar u v i)=star (edgePolar u v i) := by + simpa only [star_mul,star_sub (R := Operator ι),star_one,projection_P.isSelfAdjoint.star_eq] + using congrArg star (edgePolar_right u v i) + rw [leftModulus,offDiagonal, mul_assoc _ (1-P),h] + +theorem blockCorner_star (u v : ℝ) (i j : ι) (r s : Bool) : + star (blockCorner u v i j r s)=blockCorner u v i j s r := by + apply Subtype.ext + change star (supportedLeg u v i r*S u v j*star (supportedLeg u v i s))=_ + simp only [star_mul,star_star,(S_selfAdjoint u v j).star_eq,mul_assoc] + rfl + +variable (u v : ℝ) (hv : 0 cases s + · rw [blockCorner_normalized u v hu,← pDiagonal_eq_pFresh] + exact M.smul_mem (absorbed_kind_recovery u v hv hvu M hbase hout (.diagonal false) trivial) _ + · exact old_off_block_mem u v M hbase + · rw [← blockCorner_star u v 0 0 false true] + exact star_mem (old_off_block_mem u v M hbase) + · rw [blockCorner_normalized u v hu,← pDiagonal_eq_pFresh] + exact M.smul_mem (absorbed_kind_recovery u v hv hvu M hbase hout (.diagonal true) trivial) _ + +include hbase hout in +theorem absorbed_residual_block_recovery (a b : Option Bool) : + residualBlockCorner u v (0:ℕ) 1 a b∈M := by + have hu : u≠0 := (hv.trans hvu).ne' + by_cases hab : a=none ∧ b=none + · rcases hab with ⟨rfl,rfl⟩ + apply hbase ⟨residualBlockCorner u v 0 1 none none,?_⟩ + change residualLeg u v (0:ℕ) none*S u v 1*star (residualLeg u v 0 none)∈filledEdgeAlgebra u v 0 1 + rw [← residualPair_eq,residualPair_none_none] + exact (filledEdgeAlgebra u v 0 1).smul_mem (defectSemicircle_mem_filled u v hu 0 1) _ + · rw [residualBlockCorner_normalized u v hu] + exact M.smul_mem (absorbed_kind_recovery u v hv hvu M hbase hout (.residual a b) hab) _ + +omit hv hvu M hbase hout in +theorem blockCorner_split_false_false : blockCorner u v (0:ℕ) 1 false false= + residualBlockCorner u v 0 1 none none+residualBlockCorner u v 0 1 (some false) none+ + (residualBlockCorner u v 0 1 none (some false)+residualBlockCorner u v 0 1 (some false) (some false)) := by + apply Subtype.ext + change P*S u v 1*star P=_ + simp only [AddMemClass.coe_add,residualBlockCorner,sandwiched] + rw [← residualLeg_sum u v (0:ℕ)] + simp only [star_add (R := Operator ℕ),mul_add,add_mul] + +omit hv hvu M hbase hout in +theorem blockCorner_split_false_true : blockCorner u v (0:ℕ) 1 false true= + residualBlockCorner u v 0 1 none (some true)+residualBlockCorner u v 0 1 (some false) (some true) := by + apply Subtype.ext + change P*S u v 1*star (residualLeg u v 0 (some true))=_ + simp only [AddMemClass.coe_add,residualBlockCorner,sandwiched] + rw [← residualLeg_sum u v (0:ℕ)] + simp only [add_mul] + +omit hv hvu M hbase hout in +theorem blockCorner_split_true_false : blockCorner u v (0:ℕ) 1 true false= + residualBlockCorner u v 0 1 (some true) none+residualBlockCorner u v 0 1 (some true) (some false) := by + apply Subtype.ext + change residualLeg u v 0 (some true)*S u v 1*star P=_ + simp only [AddMemClass.coe_add,residualBlockCorner,sandwiched] + rw [← residualLeg_sum u v (0:ℕ)] + simp only [star_add (R := Operator ℕ),mul_add] + +include hout hbase in +theorem absorbed_filled_block_recovery (r s : Bool) : blockCorner u v 0 1 r s∈M := by + have hres := absorbed_residual_block_recovery u v hv hvu M hbase hout + cases r <;> cases s + · rw [blockCorner_split_false_false] + exact add_mem (add_mem (hres _ _) (hres _ _)) (add_mem (hres _ _) (hres _ _)) + · rw [blockCorner_split_false_true];exact add_mem (hres _ _) (hres _ _) + · rw [blockCorner_split_true_false];exact add_mem (hres _ _) (hres _ _) + · exact hres (some true) (some true) + +include hout hbase in +theorem absorbed_block_recovery (j : ℕ) (r s : Bool) : blockCorner u v 0 j r s∈M := by + rcases j with _|(_|n) + · exact absorbed_old_block_recovery u v hv hvu M hbase hout r s + · exact absorbed_filled_block_recovery u v hv hvu M hbase hout r s + · rw [blockCorner_normalized u v (hv.trans hvu).ne'] + exact M.smul_mem (absorbed_fresh_recovery u v hv hvu M hbase hout n r s) _ +end + +open FreeFock Amplification WeightedCornerIndex GaussianRecognition +variable {ι : Type u_6} [DecidableEq ι] + + theorem full_corner_commutant (u v : ℝ) (hv : 0 (b:Operator ℕ)) + (((StarSubalgebra.mem_centralizer_iff ℂ).mp hT a ha).1)).symm + have hblocks (j : ℕ) (r s : Bool) := hc (blockCorner u v 0 j r s) + (absorbed_block_recovery u v hv hvu M hbase hout j r s) + apply Subtype.ext + apply full_corner_commutant u v hv hvu (0:ℕ) (X:Operator ℕ) (T:Operator ℕ) hX X.property T.property + · exact hc (pSupport u v 0 1 true) (hbase (pSupport u v 0 1 true)) + · intro j;rw [← blockCorner_diagonal u v 0 j];exact hblocks j false false + · intro j;rw [← blockCorner_off u v 0 j];exact hblocks j false true + · intro j + rw [← blockCorner_off u v 0 j] + exact hc (star (blockCorner u v 0 j false true)) + (star_mem (absorbed_block_recovery u v hv hvu M hbase hout j false true)) + · intro j;rw [← blockCorner_remaining u v 0 j];exact hblocks j true true + rw [StarSubalgebra.mem_centralizer_iff] + intro T hT + exact ⟨htest T hT,htest (star T) (star_mem hT)⟩ +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/CornerIndex.lean b/lean/OAI/Analysis/InterpolatedFactors/CornerIndex.lean new file mode 100644 index 0000000000000000000000000000000000000000..000be6449b5b5c02ca248d1b40def60701e910e1 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/CornerIndex.lean @@ -0,0 +1,104 @@ +import OAI.Analysis.InterpolatedFactors.Rotations + +namespace OAI + +noncomputable section +namespace FreeGroupFactorMain.WeightedCornerIndex +open CircularRotation +abbrev SelfIndex := ℕ ⊕ (Bool ⊕ Bool) +abbrev PairIndex := ℕ ⊕ Fin 3 +abbrev Index := PairedIndex SelfIndex PairIndex + +inductive Kind where + | fresh : ℕ → Bool → Bool → Kind + | residual : Option Bool → Option Bool → Kind + | diagonal : Bool → Kind + deriving DecidableEq + +namespace Kind + +def valid : Kind → Prop + | .fresh _ r s => ¬(r=false ∧ s=false) + | .residual r s => ¬(r=none ∧ s=none) + | .diagonal _ => True + +instance (k : Kind) : Decidable k.valid := by cases k <;> unfold valid <;> infer_instance + +def transpose : Kind → Kind + | .fresh n r s => .fresh n s r + | .residual r s => .residual s r + | .diagonal r => .diagonal r +end Kind + +def endpoints : Fin 3 → Option Bool × Option Bool := + Fin.cases (none,some false) (Fin.cases (none,some true) (fun _ => (some false,some true))) + +def description : Index → Kind + | .inl (.inl n) => .fresh n true true + | .inl (.inr (.inl b)) => .residual (some b) (some b) + | .inl (.inr (.inr b)) => .diagonal b + | .inr (.inl n,b) => .fresh n b (!b) + | .inr (.inr k,false) => .residual (endpoints k).1 (endpoints k).2 + | .inr (.inr k,true) => .residual (endpoints k).2 (endpoints k).1 + +def indexOf : Kind → Index + | .fresh n false false => .inl (.inl n) + | .fresh n false true => .inr (.inl n,false) + | .fresh n true false => .inr (.inl n,true) + | .fresh n true true => .inl (.inl n) + | .residual none none => .inl (.inl 0) + | .residual none (some false) => .inr (.inr 0,false) + | .residual (some false) none => .inr (.inr 0,true) + | .residual none (some true) => .inr (.inr 1,false) + | .residual (some true) none => .inr (.inr 1,true) + | .residual (some false) (some true) => .inr (.inr 2,false) + | .residual (some true) (some false) => .inr (.inr 2,true) + | .residual (some false) (some false) => .inl (.inr (.inl false)) + | .residual (some true) (some true) => .inl (.inr (.inl true)) + | .diagonal b => .inl (.inr (.inr b)) + +theorem indexOf_description (i : Index) : indexOf (description i)=i := by + rcases i with (n | (b | b)) | ⟨(n | k),b⟩ + · rfl + · cases b <;> rfl + · rfl + · cases b <;> rfl + · fin_cases k <;> cases b <;> rfl + +theorem description_injective : Function.Injective description := + Function.LeftInverse.injective indexOf_description + +theorem description_valid (i : Index) : (description i).valid := by + rcases i with (n | (b | b)) | ⟨(n | k),b⟩ + · simp [description,Kind.valid] + · simp [description,Kind.valid] + · trivial + · cases b <;> simp [description,Kind.valid] + · fin_cases k <;> cases b <;> decide + +theorem description_indexOf (k : Kind) (hk : k.valid) : description (indexOf k)=k := by + cases k with + | fresh n r s => + cases r <;> cases s + all_goals first | exact False.elim (hk ⟨rfl,rfl⟩) | rfl + | residual r s => + rcases r with _|(_|_) <;> rcases s with _|(_|_) + all_goals first | exact False.elim (hk ⟨rfl,rfl⟩) | rfl + | diagonal b => rfl + +theorem description_flip (i : Index) : + description (CircularRotation.flip i)=(description i).transpose := by + rcases i with (n | (b | b)) | ⟨(n | k),b⟩ + · rfl + · rfl + · rfl + · cases b <;> rfl + · cases b <;> rfl + +def reservoirCode : Index × ℕ ≃ ℕ := + @Denumerable.eqv _ (Classical.choice (nonempty_denumerable (Index × ℕ))) +end FreeGroupFactorMain.WeightedCornerIndex + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/CornerRange.lean b/lean/OAI/Analysis/InterpolatedFactors/CornerRange.lean new file mode 100644 index 0000000000000000000000000000000000000000..df755850e8273eabebf19327f23dca11de361e78 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/CornerRange.lean @@ -0,0 +1,247 @@ +import OAI.Analysis.InterpolatedFactors.PairedAbsorption + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 + +namespace FreeGroupFactorMain.WeightedFock +open FreeFock Amplification WeightedCornerIndex + +def oldAnnihilators (u v : ℝ) : Submodule ℂ (PCorner ℕ) where + carrier := {X | ∀ a : Base u v, star (X : Operator ℕ) ((a.val : Operator ℕ) (vacuum u v))=0} + zero_mem' := by intro a; simp [star_zero (Operator ℕ)] + add_mem' := by + intro X Y hX hY a + change star ((X : Operator ℕ)+(Y : Operator ℕ)) _=0 + rw [star_add (R := Operator ℕ),add_apply,hX a,hY a,add_zero] + smul_mem' := by + intro c X hX a + change star (c • (X : Operator ℕ)) _=0 + rw [star_smul,smul_apply,hX a,smul_zero] + +theorem oldAnnihilators_sandwich (u v : ℝ) (p q : Base u v) (X : PCorner ℕ) + (hX : X∈oldAnnihilators u v) : (p:PCorner ℕ)*X*(q:PCorner ℕ)∈oldAnnihilators u v := by + intro a + change star ((p.val : Operator ℕ)*(X : Operator ℕ)*(q.val : Operator ℕ)) _=0 + rw [star_mul,star_mul,mul_apply_eq_comp,mul_apply_eq_comp] + have hh := hX (star p*a) + change star (X : Operator ℕ) (star (p.val : Operator ℕ) ((a.val : Operator ℕ) (vacuum u v)))=0 at hh + rw [hh,map_zero] + +theorem kindCreator_annihilator (u v : ℝ) (k : Kind) (hk : k.valid) : + kindCreator u v k∈oldAnnihilators u v := by + intro a + cases k with + | fresh n r s => + exact normalizedCreation_annihilate u v (0:ℕ) 1 (n+2) + (by omega) (by omega) (by omega) r s (filledOfCorner a) + | residual r s => exact normalizedResidual_annihilate u v (0:ℕ) 1 (by omega) r s hk (filledOfCorner a) + | diagonal r => exact normalizedDiagonal_annihilate u v (0:ℕ) 1 0 (by omega) (by omega) r (filledOfCorner a) + +theorem rawReservoir_annihilator (u v : ℝ) (i : WeightedCornerIndex.Index) (n : ℕ) : + rawReservoir u v i n∈oldAnnihilators u v := by + intro a + exact normalizedCreation_annihilate u v (0:ℕ) 1 (reservoirCode (i,n)+2) + (by omega) (by omega) (by omega) false false (filledOfCorner a) + +theorem cornerAbsorption_annihilator (u v : ℝ) (hv : 0 kindCreator_annihilator u v _ (description_valid i)) (rawReservoir_annihilator u v) i n +end FreeGroupFactorMain.WeightedFock + +namespace FreeGroupFactorMain.Amplification +variable {A : Type u_1} [CStarAlgebra A] + +def cornerEqualityEquiv (p q : A) (hp : IsStarProjection p) (hq : IsStarProjection q) (h : p=q) : + Corner p hp ≃⋆ₐ[ℂ] Corner q hq := by + subst q + exact StarAlgEquiv.refl ℂ (Corner p hp) + +theorem cornerEqualityEquiv_val (p q : A) (hp : IsStarProjection p) (hq : IsStarProjection q) (h : p=q) + (x : Corner p hp) : (cornerEqualityEquiv p q hp hq h x : A)=(x:A) := by + subst q + rfl + +variable {E : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable (p : E →L[ℂ] E) (hp : IsStarProjection p) [CompleteSpace p.range] + +include hp in +theorem projectionRange_starProjection : p.range.starProjection=p := + (isStarProjection_iff_eq_starProjection_range.mp hp).choose_spec.symm + +def projectionRepresentation : Corner p hp ≃⋆ₐ[ℂ] (p.range →L[ℂ] p.range) := + (cornerEqualityEquiv p p.range.starProjection hp isStarProjection_starProjection + (projectionRange_starProjection p hp).symm).trans (cornerRepresentation p.range) + +theorem projectionRepresentation_apply (x : Corner p hp) (ξ : p.range) : + (projectionRepresentation p hp x ξ : E)=(x:E →L[ℂ] E) ξ := by + change (cornerRestrict p.range + (cornerEqualityEquiv p p.range.starProjection hp isStarProjection_starProjection + (projectionRange_starProjection p hp).symm x) ξ : E) = _ + rw [cornerRestrict_apply,cornerEqualityEquiv_val] +end FreeGroupFactorMain.Amplification + +namespace FreeGroupFactorMain.WeightedFock + +section +open FreeFock Amplification Filter Topology +open scoped ENNReal +variable {ι : Type u_3} [DecidableEq ι] + +abbrev PRange (ι : Type u_4) [DecidableEq ι] := (P : Operator ι).range +instance pRange_complete : CompleteSpace (PRange ι) := + (ContinuousLinearMap.IsIdempotentElem.isClosed_range + (projection_P (ι := ι)).isIdempotentElem).completeSpace_coe + +def pRoot : PRange ι := ⟨lp.single 2 ([],true) 1,⟨lp.single 2 ([],true) 1,P_nil_true 1⟩⟩ + +theorem pRoot_norm : ‖(pRoot : PRange ι)‖=1 := by + change ‖lp.single (E := fun _ : Path ι => ℂ) 2 ([],true) 1‖=1 + rw [lp.norm_single] <;> norm_num + +instance pRange_nontrivial : Nontrivial (PRange ι) := by + apply nontrivial_of_ne (pRoot : PRange ι) 0 + intro h + have hh := pRoot_norm (ι := ι) + rw [h,norm_zero] at hh + exact zero_ne_one hh + +abbrev pRepresentation : PCorner ι ≃⋆ₐ[ℂ] (PRange ι →L[ℂ] PRange ι) := + projectionRepresentation P projection_P + +theorem pRepresentation_apply (x : PCorner ι) (ξ : PRange ι) : + (pRepresentation x ξ : H ι)=(x:Operator ι) ξ := + projectionRepresentation_apply P projection_P x ξ + +def pProject : H ι →L[ℂ] PRange ι := (P : Operator ι).range.orthogonalProjectionOnto + +theorem pProject_val (ξ : H ι) : (pProject ξ : H ι)=P ξ := by + change (P : Operator ι).range.starProjection ξ=P ξ + rw [projectionRange_starProjection P projection_P] + +theorem pProject_coe (ξ : PRange ι) : pProject (ξ:H ι)=ξ := + Submodule.orthogonalProjectionOnto_mem_subspace_eq_self ξ + +theorem pRange_total (K : Submodule ℂ (PRange ι)) (hK : IsClosed (K : Set (PRange ι))) + (hb : ∀ w : Path ι, pProject (lp.single 2 w 1)∈K) : K=⊤ := by + apply top_unique + intro ξ _ + have hs := (lp.hasSum_single (by norm_num : (2:ℝ≥0∞)≠⊤) (ξ:H ι)).map pProject pProject.continuous + rw [pProject_coe] at hs + apply hK.mem_of_tendsto hs + filter_upwards [] with s + apply K.sum_mem + intro w _ + have he : lp.single (E := fun _ : Path ι => ℂ) 2 w ((ξ:H ι) w)= + ((ξ:H ι) w) • lp.single 2 w 1 := by + ext q + simp [lp.single_apply,Pi.single_apply] + change pProject (lp.single 2 w ((ξ:H ι) w))∈K + rw [he,map_smul] + exact K.smul_mem _ (hb w) + +def oldBaseCorner (u v : ℝ) (i j : ι) : PCorner ι := + ⟨oldBaseGenerator u v i j,oldBaseGenerator_left u v i j,oldBaseGenerator_right u v i j⟩ + +def oldBaseOp (u v : ℝ) (i j : ι) : PRange ι →L[ℂ] PRange ι := pRepresentation (oldBaseCorner u v i j) + +theorem oldBaseCorner_selfAdjoint (u v : ℝ) (i j : ι) : IsSelfAdjoint (oldBaseCorner u v i j) := + Subtype.ext (oldBaseGenerator_selfAdjoint u v i j).star_eq + +theorem oldBaseOp_selfAdjoint (u v : ℝ) (i j : ι) : IsSelfAdjoint (oldBaseOp u v i j) := +by + change star (pRepresentation (oldBaseCorner u v i j))=pRepresentation (oldBaseCorner u v i j) + exact ((pRepresentation (ι := ι)).map_star' (oldBaseCorner u v i j)).symm.trans + (congrArg (fun x : PCorner ι => pRepresentation x) (oldBaseCorner_selfAdjoint u v i j).star_eq) + +theorem oldBaseOp_eigen_root_zero (u v : ℝ) (hv : 0 (x:H ι)) he + rw [oldBaseOp,pRepresentation_apply] at hh + have hz := oldBaseGenerator_eigen_root_zero u v hv hvu i j z (η:H ι) hh + change inner ℂ (lp.single 2 ([],true) 1) (η:H ι)=0 + simpa only [lp.inner_single_left,RCLike.inner_apply,map_one,mul_one] using hz +end + +open FreeFock Amplification +variable {ι : Type u_5} [DecidableEq ι] + +def pSandwich (B : Operator ι) : PCorner ι := + ⟨P*B*P,by + constructor + · rw [← mul_assoc,← mul_assoc,projection_P.isIdempotentElem.eq] + · rw [mul_assoc,mul_assoc,projection_P.isIdempotentElem.eq,mul_assoc]⟩ + +theorem pSandwich_commute (B : Operator ι) (hBP : Commute P B) + (x : PCorner ι) (hBx : Commute (x:Operator ι) B) : Commute (pSandwich B) x := by + apply Subtype.ext + change P*B*P*(x:Operator ι)=(x:Operator ι)*(P*B*P) + calc + _ = P*(B*(x:Operator ι)) := by rw [mul_assoc (P*B),x.property.1,mul_assoc] + _ = P*((x:Operator ι)*B) := by rw [hBx.eq] + _ = (x:Operator ι)*B := by rw [← mul_assoc,x.property.1] + _ = (x:Operator ι)*(P*B*P) := by + symm + rw [← mul_assoc,← mul_assoc,x.property.2,mul_assoc,← hBP.eq,← mul_assoc,x.property.2] + +theorem pRoot_vacuum (u v : ℝ) : (P : Operator ι) (vacuum u v)=(u:ℂ) • ((pRoot : PRange ι):H ι) := by + simp only [vacuum,map_add,map_smul,P_nil_true,P_nil_false,smul_zero,add_zero,pRoot] + +theorem pSandwich_basis (u v : ℝ) (w : Path ι) (B : Operator ι) + (hBP : Commute P B) (hB : B (vacuum u v)=lp.single 2 w 1) : + (u:ℂ) • pRepresentation (pSandwich B) pRoot=pProject (lp.single 2 w 1) := by + apply Subtype.ext + change (u:ℂ) • (pRepresentation (pSandwich B) pRoot : H ι)=_ + rw [pRepresentation_apply,pProject_val,← hB] + change (u:ℂ) • ((P*B*P : Operator ι) ((pRoot : PRange ι):H ι))=P (B (vacuum u v)) + rw [← map_smul,← pRoot_vacuum] + have he : P*B*P*P=P*B := by + rw [mul_assoc (P*B),projection_P.isIdempotentElem.eq,mul_assoc,← hBP.eq, + ← mul_assoc,projection_P.isIdempotentElem.eq] + exact DFunLike.congr_fun he (vacuum u v) + +theorem centralizer_bicommutant {E : Type u_6} [Ring E] [StarRing E] [Algebra ℂ E] [StarModule ℂ E] + (S : Set E) (B : StarSubalgebra.centralizer ℂ S) : + (B:E)∈StarSubalgebra.centralizer ℂ (Bicommutant.algebra S : Set E) := by + rw [StarSubalgebra.mem_centralizer_iff] + intro T hT + exact ⟨((StarSubalgebra.mem_centralizer_iff ℂ).mp hT B B.property).1.symm, + ((StarSubalgebra.mem_centralizer_iff ℂ).mp (star_mem hT) B B.property).1.symm⟩ + +theorem oldBaseOp_commutant_total (u v : ℝ) (hu : u≠0) (hv : v≠0) (i j : ι) : + (Submodule.span ℂ (Set.range (fun B : StarSubalgebra.centralizer ℂ + (Bicommutant.algebra ({oldBaseOp u v i j} : Set (PRange ι →L[ℂ] PRange ι)) : + Set (PRange ι →L[ℂ] PRange ι)) => (B:PRange ι →L[ℂ] PRange ι) pRoot))).topologicalClosure=⊤ := by + let N := StarSubalgebra.centralizer ℂ + (Bicommutant.algebra ({oldBaseOp u v i j} : Set (PRange ι →L[ℂ] PRange ι)) : + Set (PRange ι →L[ℂ] PRange ι)) + let K := (Submodule.span ℂ (Set.range (fun B : N => (B:PRange ι →L[ℂ] PRange ι) pRoot))).topologicalClosure + apply pRange_total K (Submodule.isClosed_topologicalClosure _) + intro w + obtain ⟨B,hB,heB,_⟩ := good_right_basis u v hu hv w + have hBP : Commute P B := ((StarSubalgebra.mem_centralizer_iff ℂ).mp hB P (Set.mem_insert _ _)).1 + have hBA : Commute (oldBaseGenerator u v i j) B := + ((StarSubalgebra.mem_centralizer_iff ℂ).mp (oldBaseGenerator_mem_ambient u v hu i j) B hB).1.symm + have hc : Commute (pRepresentation (pSandwich B)) (pRepresentation (oldBaseCorner u v i j)) := by + change _ * _ = _ * _ + simpa only [map_mul] using congrArg (fun x : PCorner ι => pRepresentation x) + (pSandwich_commute B hBP (oldBaseCorner u v i j) hBA).eq + have hm : pRepresentation (pSandwich B)∈N := by + apply centralizer_bicommutant ({oldBaseOp u v i j} : Set (PRange ι →L[ℂ] PRange ι)) + ⟨pRepresentation (pSandwich B),?_⟩ + rw [StarSubalgebra.mem_centralizer_iff] + intro T hT + rcases hT with rfl + exact ⟨hc.symm,(by rw [(oldBaseOp_selfAdjoint u v i j).star_eq]; exact hc.symm)⟩ + rw [← pSandwich_basis u v w B hBP heB] + exact K.smul_mem _ (Submodule.le_topologicalClosure _ + (Submodule.subset_span (Set.mem_range_self (⟨pRepresentation (pSandwich B),hm⟩:N)))) +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/CornerRepresentation.lean b/lean/OAI/Analysis/InterpolatedFactors/CornerRepresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..db985aa13827fabb6c25d66029340377c3f435e1 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/CornerRepresentation.lean @@ -0,0 +1,73 @@ +import OAI.Analysis.InterpolatedFactors.Basic + +namespace OAI + +universe u_1 u_2 u_3 + +noncomputable section + +namespace FreeGroupFactorMain.Amplification +variable {E : Type u_3} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable (K : Submodule ℂ E) [CompleteSpace K] + +abbrev RangeCorner := Corner K.starProjection isStarProjection_starProjection + +def cornerRestrict (x : RangeCorner K) : K →L[ℂ] K := + K.orthogonalProjectionOnto.comp ((x : E →L[ℂ] E).comp K.subtypeL) + +def cornerExtend (x : K →L[ℂ] K) : RangeCorner K := + ⟨K.subtypeL.comp (x.comp K.orthogonalProjectionOnto),by + constructor + · ext ξ + exact K.starProjection_mem_subspace_eq_self (x (K.orthogonalProjectionOnto ξ)) + · ext ξ + change (x (K.orthogonalProjectionOnto (K.starProjection ξ)) : E)=_ + rw [K.orthogonalProjectionOnto_starProjection_of_le le_rfl] + rfl⟩ + +theorem cornerRestrict_extend (x : K →L[ℂ] K) : cornerRestrict K (cornerExtend K x)=x := by + ext ξ + simp only [cornerRestrict,cornerExtend,ContinuousLinearMap.comp_apply, + Submodule.subtypeL_apply,Submodule.orthogonalProjectionOnto_mem_subspace_eq_self] + +theorem cornerExtend_restrict (x : RangeCorner K) : cornerExtend K (cornerRestrict K x)=x := by + apply Subtype.ext + change K.starProjection*(x : E →L[ℂ] E)*K.starProjection=(x : E →L[ℂ] E) + rw [x.property.1,x.property.2] + +theorem cornerRestrict_apply (x : RangeCorner K) (ξ : K) : + (cornerRestrict K x ξ : E)=(x : E →L[ℂ] E) ξ := by + change K.starProjection ((x : E →L[ℂ] E) ξ)=_ + exact DFunLike.congr_fun x.property.1 (ξ:E) + +def cornerRepresentation : RangeCorner K ≃⋆ₐ[ℂ] (K →L[ℂ] K) where + toFun := cornerRestrict K + invFun := cornerExtend K + left_inv := cornerExtend_restrict K + right_inv := cornerRestrict_extend K + map_mul' x y := by + ext ξ + simp only [cornerRestrict_apply,mul_apply_eq_comp] + rfl + map_add' x y := by + ext ξ + simp only [cornerRestrict_apply,add_apply,Submodule.coe_add] + rfl + map_smul' c x := by + ext ξ + simp only [cornerRestrict_apply,smul_apply,SetLike.val_smul] + map_star' x := by + apply ContinuousLinearMap.ext + intro ξ + apply ext_inner_right ℂ + intro η + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_left] + change inner ℂ (cornerRestrict K (star x) ξ : E) (η:E)= + inner ℂ (ξ:E) (cornerRestrict K x η : E) + rw [cornerRestrict_apply,cornerRestrict_apply] + exact ContinuousLinearMap.adjoint_inner_left (x : E →L[ℂ] E) η ξ +end FreeGroupFactorMain.Amplification + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/CornerStabilization.lean b/lean/OAI/Analysis/InterpolatedFactors/CornerStabilization.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5b6f5cfc341869d9f5e232a13c6bfc04454f9cd --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/CornerStabilization.lean @@ -0,0 +1,175 @@ +import OAI.Analysis.InterpolatedFactors.Positive + +namespace OAI + +noncomputable section + +universe u_1 u_2 + +namespace FreeGroupFactorMain.Amplification + +section +open scoped ENNReal +variable {G : Type u_1} [Group G] + + theorem cornerStabilization_weight_iff (a : ℝ) (ha : 0 ENNReal.ofReal a*z) h + simpa only [←mul_assoc,ENNReal.mul_inv_cancel ha0 hat,one_mul] using hh + · intro h + rw [h,←mul_assoc,ENNReal.inv_mul_cancel ha0 hat,one_mul] + + theorem doubleDiagonal_matrix (T : stabilization G) (i j : ℕ) : + matrixEntry (doubleDiagonal T : GroupOperator (ℕ × (ℕ × G))) i j= + if i=j then (T : GroupOperator (ℕ × G)) else 0 := by + change matrixEntry (productAmplification ℕ (ℕ × G) T) i j=_ + ext ξ x + rw [matrixEntry_apply,productAmplification_productSingle,productSingle_apply] + by_cases h : i=j <;> simp [h] + + theorem doubleFiniteDiagonal_supported (n : ℕ) (p : stabilization G) (hp : IsStarProjection p) + (q : Corner p hp) : + doubleDiagonal p * doubleFiniteDiagonal n q.val=doubleFiniteDiagonal n q.val ∧ + doubleFiniteDiagonal n q.val * doubleDiagonal p=doubleFiniteDiagonal n q.val := by + constructor + · apply Subtype.ext + apply matrixEntry_ext + intro i j + change matrixEntry (productAmplification ℕ (ℕ × G) (p : GroupOperator (ℕ × G))*finiteDiagonal n (q.val : GroupOperator (ℕ × G))) i j=matrixEntry (finiteDiagonal n (q.val : GroupOperator (ℕ × G))) i j + rw [matrixEntry_diagonal_mul,finiteDiagonal_sum] + simp only [matrixEntry_sum,matrixEntry_matrixBlock,Finset.mul_sum] + apply Finset.sum_congr rfl + intro k _ + split_ifs + · exact congrArg Subtype.val q.property.1 + · exact mul_zero _ + · apply Subtype.ext + apply matrixEntry_ext + intro i j + change matrixEntry (finiteDiagonal n (q.val : GroupOperator (ℕ × G))*productAmplification ℕ (ℕ × G) (p : GroupOperator (ℕ × G))) i j=matrixEntry (finiteDiagonal n (q.val : GroupOperator (ℕ × G))) i j + rw [matrixEntry_mul_diagonal,finiteDiagonal_sum] + simp only [matrixEntry_sum,matrixEntry_matrixBlock,Finset.sum_mul] + apply Finset.sum_congr rfl + intro k _ + split_ifs + · exact congrArg Subtype.val q.property.2 + · exact zero_mul _ + +theorem finiteFlatten_supported (n : ℕ) (p : stabilization G) (hp : IsStarProjection p) + (q : Corner p hp) : repeatFlatten p * finiteFlatten n q.val=finiteFlatten n q.val ∧ + finiteFlatten n q.val * repeatFlatten p=finiteFlatten n q.val := by + obtain ⟨hl,hr⟩ := doubleFiniteDiagonal_supported n p hp q + constructor + · have h := congrArg (flattenStabilizationIso (G := G)) hl + simpa only [map_mul,repeatFlatten,finiteFlatten] using h + · have h := congrArg (flattenStabilizationIso (G := G)) hr + simpa only [map_mul,repeatFlatten,finiteFlatten] using h + +def cornerFiniteProjection (n : ℕ) (p : stabilization G) (hp : IsStarProjection p) + (q : Corner p hp) : CornerStabilization p hp := + ⟨finiteFlatten n q.val,finiteFlatten_supported n p hp q⟩ + +theorem cornerFiniteProjection_projection (n : ℕ) (p : stabilization G) (hp : IsStarProjection p) + (q : Corner p hp) (hq : IsStarProjection q) : IsStarProjection (cornerFiniteProjection n p hp q) := by + have hh := finiteFlatten_projection n q.val (nested_projection p hp q hq) + constructor + · exact Subtype.ext hh.isIdempotentElem.eq + · exact Subtype.ext hh.isSelfAdjoint.star_eq +end + +open scoped ENNReal +variable {G : Type u_2} [Group G] + +theorem projection_weight_of_trace (p : stabilization G) (hp : IsStarProjection p) + (hfin : stabilizedProjectionTrace p≠⊤) (a : ℝ) (hτ : stabilizedTrace p=(a:ℂ)) : + stabilizedProjectionTrace p=ENNReal.ofReal a := by + have h := stabilizedTrace_star_mul p hfin + rw [hp.isSelfAdjoint.star_eq,hp.isIdempotentElem.eq,hτ] at h + have he : (stabilizedProjectionTrace p).toReal=a := Complex.ofReal_injective h.symm + rw [←he,ENNReal.ofReal_toReal hfin] + +theorem corner_projection_weight (a : ℝ) (ha : 0 (a:ℂ)*z) hqτ + change (a:ℂ)*((a:ℂ)⁻¹*stabilizedTrace q.val)=(a:ℂ)*(s:ℂ) at h + rw [←mul_assoc,mul_inv_cancel₀ ha0,one_mul] at h + simpa only [Complex.ofReal_mul] using h + +theorem cornerStabilization_projection_exists + (hpos : ∀(t : ℝ),0 + intro w hn a + cases w with + | nil => simpa only [normal] using hcoeff a X.root hroot + | cons q w => + rcases q with ⟨i,b⟩ + subst n + have ht := ih w.length (by simp) w rfl b + have ha : star (X.create (σ i)) (X.normal b w)∈K := by + cases w with + | nil => rw [X.annihilate_normal_nil];exact K.zero_mem + | cons q w => + rcases q with ⟨j,c⟩ + rw [X.annihilate_normal_cons] + exact ih w.length (by simp) w rfl _ + have hh := K.sub_mem (hgen i (X.normal b w) ht) ha + have he : X.generator σ i (X.normal b w)-star (X.create (σ i)) (X.normal b w)= + X.create i (X.normal b w) := by simp only [generator,add_apply,add_sub_cancel_right] + rw [he] at hh + exact hcoeff a _ hh + exact main w.length w rfl a + +theorem normalHull_le_of_generator_invariant (σ : I → I) (K : Submodule ℂ E) + (hK : IsClosed (K : Set E)) (hroot : X.root∈K) + (hcoeff : ∀ a ξ,ξ∈K → X.coeff a ξ∈K) + (hgen : ∀ i ξ,ξ∈K → X.generator σ i ξ∈K) : X.normalHull≤K := by + apply Submodule.topologicalClosure_minimal _ ?_ hK + apply Submodule.span_le.mpr + rintro ξ ⟨⟨a,w⟩,rfl⟩ + exact X.normal_mem_of_generator_invariant σ K hroot hcoeff hgen a w +end FreeGroupFactorMain.GaussianRecognition.System + +namespace FreeGroupFactorMain.WeightedFock + +section +open FreeFock Amplification GaussianRecognition +variable {ι : Type u_4} [DecidableEq ι] + +theorem P_range_apply (ξ : PRange ι) : P (ξ:H ι)=(ξ:H ι) := by + obtain ⟨η,hη⟩ := ξ.property + rw [← hη] + exact DFunLike.congr_fun (projection_P (ι := ι)).isIdempotentElem.eq η + +def pRight : PRange ι →L[ℂ] PRange ι := pRepresentation (pSandwich rightP) + +theorem pRight_apply (ξ : PRange ι) : (pRight ξ : H ι)=rightP (ξ:H ι) := by + rw [pRight,pRepresentation_apply] + change P (rightP (P (ξ:H ι)))=rightP (ξ:H ι) + rw [P_range_apply] + have h := DFunLike.congr_fun (P_commute_rightP (ι := ι)).eq (ξ:H ι) + change P (rightP (ξ:H ι))=rightP (P (ξ:H ι)) at h + rwa [P_range_apply] at h + +theorem pRight_projection : IsStarProjection (pRight : PRange ι →L[ℂ] PRange ι) := by + constructor + · apply ContinuousLinearMap.ext + intro ξ + apply Subtype.ext + change (pRight (pRight ξ) : H ι)=(pRight ξ : H ι) + simp only [pRight_apply] + exact DFunLike.congr_fun (rightP_projection (ι := ι)).isIdempotentElem.eq (ξ:H ι) + · have hs : star (pSandwich (rightP : Operator ι))=pSandwich rightP := by + apply Subtype.ext + change star (P*rightP*P : Operator ι)=P*rightP*P + simp only [star_mul,projection_P.isSelfAdjoint.star_eq,rightP_projection.isSelfAdjoint.star_eq,mul_assoc] + exact ((pRepresentation (ι := ι)).map_star' (pSandwich rightP)).symm.trans + (congrArg (pRepresentation (ι := ι)) hs) + +theorem pRight_root : (pRight : PRange ι →L[ℂ] PRange ι) pRoot=pRoot := by + apply Subtype.ext + rw [pRight_apply] + change CoordinateProjection.proj _ (lp.single 2 ([],true) 1)=_ + simp only [CoordinateProjection.proj_single,Set.mem_ofPred_eq,ite_true] + rfl + +theorem pRight_commute_ambient (u v : ℝ) (T : representedAmbient u v) : + Commute (pRight : PRange ℕ →L[ℂ] PRange ℕ) T.val := by + let x := (pRepresentation (ι := ℕ)).symm T.val + have hx : (x:Operator ℕ)∈ambientAlgebra u v := T.property + have hc : Commute (x:Operator ℕ) rightP := + ((StarSubalgebra.mem_centralizer_iff ℂ).mp hx rightP (rightP_mem_commutant u v)).1.symm + have hh : Commute (pRepresentation (pSandwich rightP)) (pRepresentation x) := by + change _ * _ = _ * _ + simpa only [map_mul] using congrArg (fun X : PCorner ℕ => pRepresentation X) + (pSandwich_commute rightP P_commute_rightP x hc).eq + change Commute (pRepresentation (pSandwich rightP)) (pRepresentation ((pRepresentation (ι := ℕ)).symm T.val)) at hh + rw [StarAlgEquiv.apply_symm_apply] at hh + exact hh + +variable (u v : ℝ) (hv : 0 pRepresentation X) + (pSandwich_commute _ (P_commute_rightEdge u v) x hc).eq + change Commute (pRepresentation (pSandwich (rightEdge u v))) (pRepresentation ((pRepresentation (ι := ℕ)).symm T.val)) at hh + rw [StarAlgEquiv.apply_symm_apply] at hh + exact hh + +theorem pRightEdge_left : pRight*pRightEdge u v=pRightEdge u v := by + have he := congrArg (reverseConj (ι := ℕ)) (edgePolar_left u v (0:ℕ)) + rw [map_mul,reverseConj_P] at he + apply ContinuousLinearMap.ext + intro ξ + apply Subtype.ext + change (pRight (pRightEdge u v ξ) : H ℕ)=(pRightEdge u v ξ:H ℕ) + simp only [pRight_apply,pRightEdge_apply] + exact DFunLike.congr_fun he (ξ:H ℕ) + +theorem pRightEdge_right : pRightEdge u v*(1-pRight)=pRightEdge u v := by + have he := congrArg (reverseConj (ι := ℕ)) (edgePolar_right u v (0:ℕ)) + rw [map_mul,map_sub,map_one,reverseConj_P] at he + apply ContinuousLinearMap.ext + intro ξ + apply Subtype.ext + change (pRightEdge u v (ξ-pRight ξ) : H ℕ)=(pRightEdge u v ξ:H ℕ) + rw [pRightEdge_apply,pRightEdge_apply] + change rightEdge u v ((ξ:H ℕ)-(pRight ξ : H ℕ))=rightEdge u v (ξ:H ℕ) + rw [pRight_apply] + exact DFunLike.congr_fun he (ξ:H ℕ) + +theorem pRightEdge_initial (hv : 0 weightedDefect_edge_root u v i j hji a r) + (fun a => weightedDefect_edge_root u v i j hji a s) + (fun a => diagonal_weightedDefect u v i j k hji hjk a r) _ _ (T : Operator ι) T.property + · intro a + have hh := congrArg star (diagonal_weightedDefect u v i j l hji hjl (star a) s) + simpa only [star_mul,star_star,star_zero (Operator ι),StarMemClass.coe_star,mul_assoc] using hh + · intro a + have hh := diagonal_edge_contraction u v i k l a r s + split_ifs with h + · simpa [h,lp.inner_single_left] using hh + · simpa only [h,ite_false,smul_zero] using hh + +theorem diagonal_filled_annihilation (u v : ℝ) (i j k : ι) (hji : j≠i) (hjk : j≠k) + (r : Bool) (T : filledEdgeAlgebra u v i j) : + star (edgeCreation k r r) ((T : Operator ι) (vacuum u v))=0 := by + apply GaussianExtension.annihilation_extension (edgeAlgebra u v i) (weightedDefectCreation u v i j) + (defectCovariance u v i) (weightedDefect_contraction u v i j hji) + (edgeCreation k r r) (vacuum u v) (weightedDefect_annihilates_edge u v i j hji) _ + (fun a => diagonal_weightedDefect u v i j k hji hjk a r) T T.property + intro a + simp only [vacuum,map_add,map_smul,diagonal_annihilation_edge_root u v i k a, + smul_zero,add_zero] +end + +open FreeFock +variable {ι : Type u_2} [DecidableEq ι] + +theorem vertex_trace_inner (u v : ℝ) (r : Bool) (T : Operator ι) : + vacuumTrace u v (vertex r*T*vertex r)= + (weight u v r : ℂ)^2*inner ℂ (lp.single 2 ([],r) 1) (T (lp.single 2 ([],r) 1)) := by + unfold vacuumTrace + simp only [mul_apply_eq_comp] + rw [← ContinuousLinearMap.adjoint_inner_left] + change inner ℂ (star (vertex r) (vacuum u v)) (T (vertex r (vacuum u v)))=_ + rw [vertex_star,vertex_vacuum] + simp only [map_smul,inner_smul_left,inner_smul_right,Complex.conj_ofReal,pow_two,mul_assoc] + +theorem supportedLeg_vertex (u v : ℝ) (i : ι) (r : Bool) : + supportedLeg u v i r*vertex (!r)=supportedLeg u v i r := by + cases r + · exact projection_P.isIdempotentElem.eq + · exact edgePolar_right u v i + +theorem vertex_star_supportedLeg (u v : ℝ) (i : ι) (r : Bool) : + vertex (!r)*star (supportedLeg u v i r)=star (supportedLeg u v i r) := by + simpa only [star_mul,vertex_star] using congrArg star (supportedLeg_vertex u v i r) + +theorem supportedLeg_root_trace (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i : ι) (r : Bool) (T : ambientAlgebra (ι := ι) u v) : + (weight u v (!r) : ℂ)^2*inner ℂ (lp.single 2 ([],!r) 1) + ((star (supportedLeg u v i r)*(T : Operator ι)*supportedLeg u v i r) (lp.single 2 ([],!r) 1))= + vacuumTrace u v ((T : Operator ι)*legSupport u v i r) := by + rw [← vertex_trace_inner] + rw [← mul_assoc,← mul_assoc,vertex_star_supportedLeg,mul_assoc _ _ (vertex (!r)),supportedLeg_vertex] + simpa only [ite_true] using supportedLeg_trace_covariance u v hu hv i r r T + +def transportedDiagonal (u v : ℝ) (i k : ι) (r : Bool) : Operator ι := + supportedLeg u v i r*edgeCreation k (!r) (!r)*star (supportedLeg u v i r) + +def normalizedDiagonal (u v : ℝ) (i k : ι) (r : Bool) : Operator ι := + ((weight u v (!r) : ℂ)/(u:ℂ)) • transportedDiagonal u v i k r + +theorem transportedDiagonal_filled_contraction (u v : ℝ) (i j k l : ι) + (hji : j≠i) (hjk : j≠k) (hjl : j≠l) (r s : Bool) (T : filledEdgeAlgebra u v i j) : + star (transportedDiagonal u v i k r)*(T : Operator ι)*transportedDiagonal u v i l s= + if k=l ∧ r=s then (inner ℂ (lp.single 2 ([],!r) 1) + ((star (supportedLeg u v i r)*(T : Operator ι)*supportedLeg u v i r) (lp.single 2 ([],!r) 1))) • + legSupport u v i r else 0 := by + let a (b : Bool) : filledEdgeAlgebra u v i j := + ⟨supportedLeg u v i b,edgeAlgebra_le_filled u v i j (supportedLeg_mem_edge u v i b)⟩ + have h := diagonal_filled_contraction u v i j k l hji hjk hjl (!r) (!s) (star (a r)*T*a s) + calc + _ = supportedLeg u v i r*(star (edgeCreation k (!r) (!r))* + ((star (a r)*T*a s : filledEdgeAlgebra u v i j) : Operator ι)*edgeCreation l (!s) (!s))* + star (supportedLeg u v i s) := by + simp only [transportedDiagonal,StarMemClass.coe_star,MulMemClass.coe_mul,star_mul,star_star,mul_assoc] + rfl + _ = _ := by + rw [h] + by_cases hr : r=s + · subst s + by_cases hk : k=l + · simp only [hk,ite_true,true_and,mul_smul_comm,smul_mul_assoc,supportedLeg_vertex, + supportedLeg_mul_star] + rfl + · simp only [hk,false_and,ite_false,smul_zero (M := ℂ) (A := Operator ι),mul_zero,zero_mul] + · have hr' : (!r)≠(!s) := by cases r <;> cases s <;> simp_all + simp only [hr,hr',and_false,ite_false,smul_zero (M := ℂ) (A := Operator ι),mul_zero,zero_mul] + +theorem normalizedDiagonal_filled_covariance (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i j k l : ι) (hji : j≠i) (hjk : j≠k) (hjl : j≠l) + (r s : Bool) (T : filledEdgeAlgebra u v i j) : + star (normalizedDiagonal u v i k r)*(T : Operator ι)*normalizedDiagonal u v i l s= + if k=l ∧ r=s then pVacuumTrace u v ((T : Operator ι)*legSupport u v i r) • legSupport u v i r else 0 := by + simp only [normalizedDiagonal,star_smul,Complex.star_def,map_div₀,Complex.conj_ofReal, + smul_mul_assoc,mul_smul_comm] + rw [transportedDiagonal_filled_contraction u v i j k l hji hjk hjl] + by_cases h : k=l ∧ r=s + · obtain ⟨hk,hrs⟩ := h + subst l;subst s + simp only [and_self,ite_true,smul_smul] + congr 1 + unfold pVacuumTrace + rw [← supportedLeg_root_trace u v hu hv i r ⟨T,filledEdgeAlgebra_le_ambient u v i j T.property⟩] + ring + · simp only [h,ite_false,smul_zero (M := ℂ) (A := Operator ι)] +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Diffuse.lean b/lean/OAI/Analysis/InterpolatedFactors/Diffuse.lean new file mode 100644 index 0000000000000000000000000000000000000000..e927f649c7fffadfb3a990781dda3635387c31b9 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Diffuse.lean @@ -0,0 +1,431 @@ +import OAI.Analysis.InterpolatedFactors.Spectral + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 + +open Filter Topology +namespace FreeGroupFactorMain.OrthogonalSpectralSum +variable {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +abbrev Op := E →L[ℂ] E + +theorem projection_inner (r : Op) (hr : IsStarProjection r) (ξ η : E) : + inner ℂ (r ξ) (r η)=inner ℂ (r ξ) η := by + calc + _ = inner ℂ (r (r ξ)) η := by + simpa only [← ContinuousLinearMap.star_eq_adjoint,hr.isSelfAdjoint.star_eq] using + ContinuousLinearMap.adjoint_inner_right r (r ξ) η + _ = _ := by rw [← mul_apply_eq_comp,hr.isIdempotentElem.eq] + +theorem eigen_root_zero (r d f a : Op) (hr : IsStarProjection r) (hd : IsStarProjection d) + (hrd : r*d=0) (hrf : r*f=f) (hfr : f*r=f) (hda : d*a=a) (had : a*d=a) + (ξ : E) + (hf : ∀ z : ℂ, ∀ η, f η=z • η → inner ℂ (r ξ) η=0) + (ha : ∀ z : ℂ, ∀ η, a η=z • η → inner ℂ (d ξ) η=0) + (κ z : ℂ) (η : E) (he : (f+a+κ • r) η=z • η) : + inner ℂ ((r+d) ξ) η=0 := by + have hdr : d*r=0 := by + simpa only [star_mul,hr.isSelfAdjoint.star_eq,hd.isSelfAdjoint.star_eq,star_zero] + using congrArg star hrd + have hra : r*a=0 := by rw [← hda,← mul_assoc,hrd,zero_mul] + have hdf : d*f=0 := by rw [← hrf,← mul_assoc,hdr,zero_mul] + have hrB : r*(f+a+κ • r)=f+κ • r := by + rw [mul_add,mul_add,hrf,hra,add_zero,mul_smul_comm,hr.isIdempotentElem.eq] + have hdB : d*(f+a+κ • r)=a := by + rw [mul_add,mul_add,hdf,hda,zero_add,mul_smul_comm,hdr,smul_zero,add_zero] + have heR : f (r η)=(z-κ) • (r η) := by + have hh : (f+κ • r) η=z • (r η) := by + rw [← hrB,mul_apply_eq_comp,he,map_smul] + change f η+κ • (r η)=z • (r η) at hh + rw [← mul_apply_eq_comp,hfr,sub_smul] + exact eq_sub_of_add_eq hh + have heD : a (d η)=z • (d η) := by + rw [← mul_apply_eq_comp,had,← hdB,mul_apply_eq_comp,he,map_smul] + have hR := hf (z-κ) (r η) heR + have hD := ha z (d η) heD + rw [projection_inner r hr] at hR + rw [projection_inner d hd] at hD + rw [add_apply,inner_add_left,hR,hD,add_zero] + +end FreeGroupFactorMain.OrthogonalSpectralSum +namespace FreeGroupFactorMain.SpectralSeparation +variable {A : Type u_2} [NormedRing A] [NormedAlgebra ℂ A] [StarRing A] [StarModule ℂ A] + +omit [StarRing A] [StarModule ℂ A] in + +theorem cross_zero {p f t : A} (hp : IsIdempotentElem p) (hpf : Commute p f) + (κ : ℝ) (hκ : 2*‖f‖<κ) (ht : Commute (f+(κ:ℂ) • p) t) : p*t*(1-p)=0 := by + let y := p*t*(1-p) + have hpq : p*(1-p)=0 := by rw [mul_sub,mul_one,hp.eq,sub_self] + have hfq : Commute f (1-p) := (Commute.one_right f).sub_right hpf.symm + have hl : p*((f+(κ:ℂ) • p)*t)*(1-p)=f*y+(κ:ℂ) • y := by + dsimp [y] + simp only [add_mul,mul_add,smul_mul_assoc,mul_smul_comm,← mul_assoc,hp.eq,hpf.eq] + + have hr : p*(t*(f+(κ:ℂ) • p))*(1-p)=y*f := by + dsimp [y] + simp only [mul_add,add_mul,mul_smul_comm,smul_mul_assoc,mul_assoc,hpq, + mul_zero,smul_zero,add_zero,hfq.eq] + + have he : f*y+(κ:ℂ) • y=y*f := by + rw [← hl,ht.eq,hr] + have he' : (κ:ℂ) • y=y*f-f*y := + eq_sub_iff_add_eq.mpr ((add_comm _ _).trans he) + have hκ0 : 0<κ := (mul_nonneg (by norm_num : (0:ℝ)≤2) (norm_nonneg f)).trans_lt hκ + have hb : κ*‖y‖≤(2*‖f‖)*‖y‖ := by + calc + κ*‖y‖ = ‖(κ:ℂ) • y‖ := by rw [norm_smul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hκ0] + _ = ‖y*f-f*y‖ := congrArg norm he' + _ ≤ ‖y*f‖+‖f*y‖ := norm_sub_le _ _ + _ ≤ ‖y‖*‖f‖+‖f‖*‖y‖ := add_le_add (norm_mul_le _ _) (norm_mul_le _ _) + _ = (2*‖f‖)*‖y‖ := by ring + have hy : ‖y‖=0 := by nlinarith [norm_nonneg y] + exact norm_eq_zero.mp hy + +theorem separated_projection_mem {p f : A} (hp : IsStarProjection p) + (hf : IsSelfAdjoint f) (hpf : Commute p f) (κ : ℝ) (hκ : 2*‖f‖<κ) : + p ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ ({f+(κ:ℂ) • p} : Set A) : Set A) := by + have hB : IsSelfAdjoint (f+(κ:ℂ) • p) := by + show star (_+_)=_ + simp only [star_add,hf.star_eq,star_smul,hp.isSelfAdjoint.star_eq, + Complex.star_def,Complex.conj_ofReal] + have hc (t : A) (ht : t ∈ StarSubalgebra.centralizer ℂ ({f+(κ:ℂ) • p} : Set A)) : + Commute p t := by + have hb : Commute (f+(κ:ℂ) • p) t := + ((StarSubalgebra.mem_centralizer_iff ℂ).mp ht _ (Set.mem_singleton _)).1 + have hz := cross_zero hp.isIdempotentElem hpf κ hκ hb + have hbs : Commute (f+(κ:ℂ) • p) (star t) := by + simpa only [hB.star_eq] using hb.star_star + have hzs := congrArg star (cross_zero hp.isIdempotentElem hpf κ hκ hbs) + have hq : star (1-p)=1-p := hp.one_sub.isSelfAdjoint.star_eq + simp only [star_mul,star_star,hq,hp.isSelfAdjoint.star_eq,star_zero] at hzs + have h₁ : p*t=p*t*p := by + simpa only [mul_sub,mul_one,sub_eq_zero] using hz + have h₂ : t*p=p*t*p := by + simpa only [← mul_assoc,sub_mul,one_mul,sub_eq_zero] using hzs + exact h₁.trans h₂.symm + rw [StarSubalgebra.mem_centralizer_iff] + intro t ht + exact ⟨(hc t ht).symm.eq,(hc (star t) (star_mem ht)).symm.eq⟩ + +end FreeGroupFactorMain.SpectralSeparation +namespace FreeGroupFactorMain.CornerRerouting +variable {A : Type u_3} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] + +theorem single_edge_corner_commute {p v x a t : A} + (hp : IsStarProjection p) (hpv : p*v=v) (hvr : v*(1-p)=v) + (hvi : star v*v=1-p) (hpx : p*x=x) (hxr : x*(1-p)=x) + (hd : IsSelfAdjoint (x*star v)) + (ha : a ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert p {x+star x}) : Set A)) + (has : Supported p a) (ht : Supported p t) + (htr : Commute t (v*star v)) (htf : Commute t (x*star v)) : Commute t a := by + have hxp : x*p=0 := right_zero hxr + have hpsx : p*star x=0 := star_left_zero hp.isSelfAdjoint hxp + have hsxp : star x*p=star x := by + simpa only [star_mul,hp.isSelfAdjoint.star_eq] using congrArg star hpx + have hqpx : (1-p)*x=0 := by rw [sub_mul,one_mul,hpx,sub_self] + have hsxq : star x*(1-p)=0 := by rw [mul_sub,mul_one,hsxp,sub_self] + let s : Unit → A := fun _ => x+star x + have hsa : ∀ i, IsSelfAdjoint (s i) := by + intro i + show star (x+star x)=x+star x + simp only [star_add,star_star,add_comm] + have hset : Set.range s={x+star x} := by ext z; simp [s] + have hA : a ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert p (Set.range s)) : Set A) := by + simpa only [hset] using ha + apply corner_bicommutant hp hpv hvr hvi hA has ht hsa htr + · intro i + dsimp [diagonal,s] + rw [mul_add,hpx,hpsx,add_zero,hxp] + exact Commute.zero_right _ + · intro i + dsimp [offDiagonal,s] + rw [mul_add,hpx,hpsx,add_zero,hxr] + exact htf + · intro i + dsimp [offDiagonal,s] + rw [mul_add,hpx,hpsx,add_zero,hxr,hd.star_eq] + exact htf + · intro i + dsimp [remaining,s] + rw [mul_assoc v (1-p),mul_add,hqpx,zero_add,← mul_assoc, + mul_assoc (v*(1-p)),hsxq,mul_zero,zero_mul] + exact Commute.zero_right _ + +theorem single_edge_corner_generated {p v x a : A} + (hp : IsStarProjection p) (hpv : p*v=v) (hvr : v*(1-p)=v) + (hvi : star v*v=1-p) (hpx : p*x=x) (hxr : x*(1-p)=x) + (hd : IsSelfAdjoint (x*star v)) + (ha : a ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert p {x+star x}) : Set A)) + (has : Supported p a) : + a ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert p (insert (v*star v) {x*star v})) : Set A) := by + have hpsv : star v*p=star v := by + simpa only [star_mul,hp.isSelfAdjoint.star_eq] using congrArg star hpv + have hpr : Commute p (v*star v) := by + change p*(v*star v)=(v*star v)*p + rw [← mul_assoc,hpv,mul_assoc,hpsv] + have hpf : Commute p (x*star v) := by + change p*(x*star v)=(x*star v)*p + rw [← mul_assoc,hpx,mul_assoc,hpsv] + have htest (t : A) + (ht : t ∈ StarSubalgebra.centralizer ℂ (insert p (insert (v*star v) {x*star v}))) : + Commute t a := by + have hc := (StarSubalgebra.mem_centralizer_iff ℂ).mp ht + have htp : Commute p t := (hc p (Set.mem_insert _ _)).1 + have htr : Commute (v*star v) t := (hc _ (Set.mem_insert_of_mem _ (Set.mem_insert _ _))).1 + have htf : Commute (x*star v) t := + (hc _ (Set.mem_insert_of_mem _ (Set.mem_insert_of_mem _ (Set.mem_singleton _)))).1 + have hts : Supported p (p*t*p) := by + constructor + · rw [← mul_assoc,← mul_assoc,hp.isIdempotentElem.eq] + · rw [mul_assoc,hp.isIdempotentElem.eq] + have htc : p*t*p=t*p := by rw [htp.eq,mul_assoc,hp.isIdempotentElem.eq] + have he := single_edge_corner_commute hp hpv hvr hvi hpx hxr hd ha has hts + ((hpr.mul_left htr.symm).mul_left hpr) ((hpf.mul_left htf.symm).mul_left hpf) + change t*a=a*t + calc + t*a=(t*p)*a := by rw [mul_assoc,has.1] + _ = (p*t*p)*a := by rw [htc] + _ = a*(p*t*p) := he.eq + _ = a*(t*p) := by rw [htc] + _ = (a*p)*t := by rw [← htp.eq,mul_assoc] + _ = a*t := by rw [has.2] + rw [StarSubalgebra.mem_centralizer_iff] + intro t ht + exact ⟨(htest t ht).eq,(htest (star t) (star_mem ht)).eq⟩ + +end FreeGroupFactorMain.CornerRerouting +namespace FreeGroupFactorMain.WeightedFock +open FreeFock +variable {ι : Type u_4} [DecidableEq ι] + +theorem edgeRange_mul_P (u v : ℝ) (i : ι) : edgeRange u v i*P=edgeRange u v i := by + simpa only [star_mul,projection_P.isSelfAdjoint.star_eq, + (edgeRange_projection u v i).isSelfAdjoint.star_eq] using congrArg star (edgeRange_le_P u v i) + +theorem edgeRange_mul_defect (u v : ℝ) (i : ι) : edgeRange u v i*edgeDefect u v i=0 := by + rw [edgeDefect,mul_sub,edgeRange_mul_P,(edgeRange_projection u v i).isIdempotentElem.eq,sub_self] + +theorem defect_mul_edgeRange (u v : ℝ) (i : ι) : edgeDefect u v i*edgeRange u v i=0 := by + simpa only [star_mul,(edgeRange_projection u v i).isSelfAdjoint.star_eq, + (edgeDefect_projection u v i).isSelfAdjoint.star_eq,star_zero (Operator ι)] + using congrArg star (edgeRange_mul_defect u v i) + +def defectSemicircle (u v : ℝ) (i j : ι) : Operator ι := + defectCreation u v i j+star (defectCreation u v i j) + +theorem defectSemicircle_selfAdjoint (u v : ℝ) (i j : ι) : + IsSelfAdjoint (defectSemicircle u v i j) := + IsSelfAdjoint.add_star_self (defectCreation u v i j) + +theorem defectSemicircle_left (u v : ℝ) (i j : ι) : + edgeDefect u v i*defectSemicircle u v i j=defectSemicircle u v i j := by + have hh := congrArg star (defectCreation_right u v i j) + simp only [star_mul,(edgeDefect_projection u v i).isSelfAdjoint.star_eq] at hh + rw [defectSemicircle,mul_add,defectCreation_left,hh] + +theorem defectSemicircle_right (u v : ℝ) (i j : ι) : + defectSemicircle u v i j*edgeDefect u v i=defectSemicircle u v i j := by + simpa only [star_mul,(edgeDefect_projection u v i).isSelfAdjoint.star_eq, + (defectSemicircle_selfAdjoint u v i j).star_eq] + using congrArg star (defectSemicircle_left u v i j) + +theorem range_mul_defectSemicircle (u v : ℝ) (i j : ι) : + edgeRange u v i*defectSemicircle u v i j=0 := by + rw [← defectSemicircle_left u v i j,← mul_assoc,edgeRange_mul_defect,zero_mul] + +theorem defectSemicircle_mul_range (u v : ℝ) (i j : ι) : + defectSemicircle u v i j*edgeRange u v i=0 := by + simpa only [star_mul,(edgeRange_projection u v i).isSelfAdjoint.star_eq, + (defectSemicircle_selfAdjoint u v i j).star_eq,star_zero (Operator ι)] + using congrArg star (range_mul_defectSemicircle u v i j) + +theorem P_mul_leftModulus (u v : ℝ) (i : ι) : P*leftModulus u v i=leftModulus u v i := by + rw [leftModulus,← mul_assoc,offDiagonal_left] + +theorem leftModulus_mul_P (u v : ℝ) (i : ι) : leftModulus u v i*P=leftModulus u v i := by + simpa only [star_mul,projection_P.isSelfAdjoint.star_eq,(leftModulus_selfAdjoint u v i).star_eq] + using congrArg star (P_mul_leftModulus u v i) + +theorem P_mul_defectSemicircle (u v : ℝ) (i j : ι) : + P*defectSemicircle u v i j=defectSemicircle u v i j := by + rw [← defectSemicircle_left u v i j,← mul_assoc,P_mul_edgeDefect] + +theorem defectSemicircle_mul_P (u v : ℝ) (i j : ι) : + defectSemicircle u v i j*P=defectSemicircle u v i j := by + simpa only [star_mul,projection_P.isSelfAdjoint.star_eq, + (defectSemicircle_selfAdjoint u v i j).star_eq] using congrArg star (P_mul_defectSemicircle u v i j) + +theorem compressed_edge_formula (u v : ℝ) (i : ι) : + compressed u v i=(u:ℂ) • (edgeCreation i true true+star (edgeCreation i true true)) := by + rw [compressed_formula] + simp only [edgeCreation,vertex,ite_true,star_mul,projection_P.isSelfAdjoint.star_eq,P_creation_true] + have hs : star (creation i true)*P=star (creation i true) := by + simpa only [star_mul,projection_P.isSelfAdjoint.star_eq] using congrArg star (P_creation_true i) + rw [mul_assoc,hs] + +theorem defectSemicircle_smul (u v : ℝ) (i j : ι) : + (u:ℂ) • defectSemicircle u v i j=edgeDefect u v i*S u v j*edgeDefect u v i := by + have he : edgeDefect u v i*compressed u v j*edgeDefect u v i= + edgeDefect u v i*S u v j*edgeDefect u v i := by + rw [compressed,← mul_assoc,← mul_assoc,edgeDefect_mul_P,mul_assoc (edgeDefect u v i*S u v j),P_mul_edgeDefect] + rw [← he,compressed_edge_formula,mul_smul_comm,smul_mul_assoc] + congr 1 + simp only [defectSemicircle,defectCreation,star_mul, + (edgeDefect_projection u v i).isSelfAdjoint.star_eq,mul_add,add_mul,mul_assoc] + +theorem defectSemicircle_mem_ambient (u v : ℝ) (hu : u≠0) (i j : ι) : + defectSemicircle u v i j∈ambientAlgebra u v := by + have hd : edgeDefect u v i∈ambientAlgebra u v := + sub_mem (P_mem_ambient u v) (edgeRange_mem_ambient u v i) + have hm : (u:ℂ) • defectSemicircle u v i j∈ambientAlgebra u v := by + rw [defectSemicircle_smul] + exact mul_mem (mul_mem hd (S_mem_ambient u v j)) hd + have hh := (ambientAlgebra u v).smul_mem hm (u:ℂ)⁻¹ + simpa only [smul_smul,inv_mul_cancel₀ (Complex.ofReal_ne_zero.mpr hu),one_smul] using hh + +def oldBaseShift (u v : ℝ) (i j : ι) : ℝ := + 2*‖leftModulus u v i+defectSemicircle u v i j‖+1 + +def oldBaseGenerator (u v : ℝ) (i j : ι) : Operator ι := + leftModulus u v i+defectSemicircle u v i j+(oldBaseShift u v i j:ℂ) • edgeRange u v i + +theorem oldBaseGenerator_selfAdjoint (u v : ℝ) (i j : ι) : + IsSelfAdjoint (oldBaseGenerator u v i j) := by + change star (_+_)=_+_ + simp only [star_add (R := Operator ι),star_smul,(leftModulus_selfAdjoint u v i).star_eq, + (defectSemicircle_selfAdjoint u v i j).star_eq,(edgeRange_projection u v i).isSelfAdjoint.star_eq, + Complex.star_def,Complex.conj_ofReal] + +theorem oldBaseGenerator_left (u v : ℝ) (i j : ι) : + P*oldBaseGenerator u v i j=oldBaseGenerator u v i j := by + rw [oldBaseGenerator,mul_add,mul_add,P_mul_leftModulus,P_mul_defectSemicircle, + mul_smul_comm,edgeRange_le_P] + +theorem oldBaseGenerator_right (u v : ℝ) (i j : ι) : + oldBaseGenerator u v i j*P=oldBaseGenerator u v i j := by + simpa only [star_mul,projection_P.isSelfAdjoint.star_eq,(oldBaseGenerator_selfAdjoint u v i j).star_eq] + using congrArg star (oldBaseGenerator_left u v i j) + +theorem oldBaseGenerator_mem_ambient (u v : ℝ) (hu : u≠0) (i j : ι) : + oldBaseGenerator u v i j∈ambientAlgebra u v := + add_mem (add_mem (mul_mem (offDiagonal_mem_ambient u v i) (star_mem (edgePolar_mem_ambient u v i))) + (defectSemicircle_mem_ambient u v hu i j)) + ((ambientAlgebra u v).smul_mem (edgeRange_mem_ambient u v i) _) + +theorem oldBaseGenerator_eigen_root_zero (u v : ℝ) (hv : 0 StarAlgebra.adjoin_le_centralizer_centralizer ℂ S (StarAlgebra.subset_adjoin ℂ S h) + +theorem mono (S T : Set A) (h : S ⊆ T) : algebra S ≤ algebra T := + StarSubalgebra.centralizer_le ℂ _ _ (StarSubalgebra.centralizer_le ℂ _ _ h) + +theorem generated_le (S T : Set A) (h : T ⊆ algebra S) : algebra T ≤ algebra S := by + apply StarSubalgebra.centralizer_le + intro t ht + change t ∈ StarSubalgebra.centralizer ℂ T + rw [StarSubalgebra.mem_centralizer_iff] + intro x hx + exact ⟨((StarSubalgebra.mem_centralizer_iff ℂ).mp (h hx) t ht).1.symm, + ((StarSubalgebra.mem_centralizer_iff ℂ).mp (star_mem (h hx)) t ht).1.symm⟩ +end FreeGroupFactorMain.Bicommutant + +namespace FreeGroupFactorMain.WeightedFock +open FreeFock +variable {ι : Type u_6} [DecidableEq ι] + +def diffuseBase (u v : ℝ) (i j : ι) : StarSubalgebra ℂ (Operator ι) := + Bicommutant.algebra (insert P {oldBaseGenerator u v i j}) + +theorem P_mem_diffuseBase (u v : ℝ) (i j : ι) : P∈diffuseBase u v i j := + Bicommutant.subset _ (Set.mem_insert _ _) + +theorem oldBaseGenerator_mem_diffuseBase (u v : ℝ) (i j : ι) : + oldBaseGenerator u v i j∈diffuseBase u v i j := + Bicommutant.subset _ (Set.mem_insert_of_mem _ (Set.mem_singleton _)) + +theorem edgeRange_mem_diffuseBase (u v : ℝ) (hv : 0 (T : GroupOperator (ℕ × (ℕ × G))) ξ) + apply (stabilizationFlatten G).injective + rw [(stabilizationFlatten G).apply_symm_apply,flattenHilbert_single] + ext x + simp only [lp.single_apply,Pi.single_apply,Nat.pairEquiv_apply,Function.uncurry_apply_pair] + by_cases h : x=(Nat.pair i j,(1:G)) <;> simp [h] + +end Singles + +def doubleFiniteDiagonal (n : ℕ) (T : stabilization G) : doubleStabilization G := + ⟨finiteDiagonal n (T : GroupOperator (ℕ × G)),by + classical + rw [mem_doubleStabilization_iff_right] + intro g + apply matrixEntry_ext + intro i j + rw [doubleRight,matrixEntry_diagonal_mul,matrixEntry_mul_diagonal] + rw [finiteDiagonal_sum] + simp only [matrixEntry_sum,matrixEntry_matrixBlock] + by_cases hij : i=j + · subst j + by_cases hi : i simp [stabilizedProjectionTrace] + simp_rw [he'] + rw [tsum_eq_sum (s := Finset.range n)] + · simp only [Finset.sum_ite_of_true (fun i hi => Finset.mem_range.mp hi),Finset.sum_const,Finset.card_range,nsmul_eq_mul] + · intro i hi + rw [ite_eq_right (fun h => hi (Finset.mem_range.mpr h))] +end + +section +variable {G : Type u_2} [Group G] + +def finiteCornerSingletonIso (p : groupVonNeumann G) (hp : IsStarProjection p) : + FiniteCorner 1 p hp ≃⋆ₐ[ℂ] Corner p hp where + toFun x := finiteCornerEntry 1 p hp x 0 0 + invFun x := finiteCornerOfMatrix 1 p hp (fun _ _ => x) + left_inv x := by + apply finiteCorner_ext 1 p hp + intro i j + have hi : i=0 := Subsingleton.elim _ _ + have hj : j=0 := Subsingleton.elim _ _ + subst i; subst j + exact finiteCornerEntry_ofMatrix 1 p hp _ 0 0 + right_inv x := finiteCornerEntry_ofMatrix 1 p hp _ 0 0 + map_mul' x y := by + rw [finiteCornerEntry_mul] + simp + map_add' x y := finiteCornerEntry_add 1 p hp x y 0 0 + map_smul' c x := finiteCornerEntry_smul 1 p hp x c 0 0 + map_star' x := finiteCornerEntry_star 1 p hp x 0 0 + +theorem finiteCornerSingletonIso_normal (p : groupVonNeumann G) (hp : IsStarProjection p) : + @Continuous _ _ + (cornerTopology (stabilizationTopology G) (finiteProjection 1 p) (finiteProjection_projection 1 p hp)) + (cornerTopology (groupUltraweakTopology G) p hp) (finiteCornerSingletonIso p hp) := + finiteCornerEntry_normal 1 p hp 0 0 + +theorem finiteCornerSingletonIso_trace (p : groupVonNeumann G) (hp : IsStarProjection p) + (x : FiniteCorner 1 p hp) : + canonicalTrace (finiteCornerSingletonIso p hp x).val=stabilizedTrace x.val := by + rw [finiteCorner_trace] + simp only [Fin.sum_univ_one] + rfl + +end + +variable {G : Type u_3} {H : Type u_4} [Group G] [Group H] + +theorem finiteCornerIso_symm (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (q : groupVonNeumann H) (hq : IsStarProjection q) (e : Corner p hp ≃⋆ₐ[ℂ] Corner q hq) : + (finiteCornerIso n p hp q hq e).symm=finiteCornerIso n q hq p hp e.symm := by + ext x + rfl + +theorem finiteCornerSingletonIso_symm_normal (p : groupVonNeumann G) (hp : IsStarProjection p) : + @Continuous _ _ (cornerTopology (groupUltraweakTopology G) p hp) + (cornerTopology (stabilizationTopology G) (finiteProjection 1 p) (finiteProjection_projection 1 p hp)) + (finiteCornerSingletonIso p hp).symm := by + let : TopologicalSpace (Corner p hp) := cornerTopology (groupUltraweakTopology G) p hp + exact finiteCornerOfMatrix_normal 1 p hp _ (fun _ _ => continuous_id) + +theorem finite_corner_choice_both + (hbase : ∀ T : groupVonNeumann G, (∀ S : groupVonNeumann G, Commute T S) → + ∃ c : ℂ, T=c • (1 : groupVonNeumann G)) + (t : ℝ) (p q : stabilization G) (hp : IsStarProjection p) (hq : IsStarProjection q) + (htrace : stabilizedProjectionTrace p=stabilizedProjectionTrace q) + (hfinite : stabilizedProjectionTrace p ≠ ⊤) : + ∃ Φ : Corner p hp ≃⋆ₐ[ℂ] Corner q hq, + (∀ x, normalizedCornerTrace stabilizedTrace t q hq (Φ x)= + normalizedCornerTrace stabilizedTrace t p hp x) ∧ + @Continuous _ _ (cornerTopology (stabilizationTopology G) p hp) + (cornerTopology (stabilizationTopology G) q hq) Φ ∧ + @Continuous _ _ (cornerTopology (stabilizationTopology G) q hq) + (cornerTopology (stabilizationTopology G) p hp) Φ.symm := by + have hv : ∃ u : stabilization G, star u*u=p ∧ u*star u=q := + equal_finite_trace_equivalence (G := G) hbase p q hp hq htrace hfinite + rcases hv with ⟨u,hu,hu'⟩ + refine ⟨equivalentCorner p q hp hq u hu hu',?_,?_,?_⟩ + · exact equivalentCorner_normalized_finite_trace p q hp hq hfinite (htrace ▸ hfinite) u hu hu' t + · exact equivalentCorner_normal p q hp hq u hu hu' (stabilizationTopology G) + (stabilizationUltraweak_mul_conjugate u) + · have h1 : star (star u)*star u=q := by rwa [star_star] + have h2 : star u*star (star u)=p := by rwa [star_star] + have he : (equivalentCorner p q hp hq u hu hu').symm=equivalentCorner q p hq hp (star u) h1 h2 := by + apply StarAlgEquiv.ext + intro x + apply Subtype.ext + change star u*(x : stabilization G)*u=star u*(x : stabilization G)*star (star u) + rw [star_star] + rw [he] + exact equivalentCorner_normal q p hq hp (star u) h1 h2 (stabilizationTopology G) + (stabilizationUltraweak_mul_conjugate (star u)) +end FreeGroupFactorMain.Amplification + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/FiniteCorners.lean b/lean/OAI/Analysis/InterpolatedFactors/FiniteCorners.lean new file mode 100644 index 0000000000000000000000000000000000000000..7a8f6e202e141e921aa9a31eaa1623aa76182801 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/FiniteCorners.lean @@ -0,0 +1,279 @@ +import OAI.Analysis.InterpolatedFactors.OperatorSums + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 + +namespace FreeGroupFactorMain.Amplification + +section +open scoped ENNReal +variable {G : Type u_1} [Group G] + +noncomputable def stabilizationDelta (G : Type u_2) [Group G] (j : ℕ) : GroupHilbert (ℕ × G) := by + classical + exact lp.single 2 (j,1) (1 : ℂ) + + theorem finite_weight_summable (T : stabilization G) (hT : stabilizedProjectionTrace T ≠ ⊤) : + Summable (fun j => ‖(T : GroupOperator (ℕ × G)) (stabilizationDelta G j)‖^2) := by + have hs := ENNReal.summable_toReal hT + simpa only [stabilizedProjectionTrace,stabilizationDelta,ENNReal.toReal_ofReal (sq_nonneg _)] using hs + + theorem finite_weight_left_mul (A B : stabilization G) (hB : stabilizedProjectionTrace B ≠ ⊤) : + stabilizedProjectionTrace (A*B) ≠ ⊤ := by + have hs := (finite_weight_summable B hB).mul_left (‖(A : GroupOperator (ℕ × G))‖^2) + have hle (j : ℕ) : ‖((A*B : stabilization G) : GroupOperator (ℕ × G)) (stabilizationDelta G j)‖^2 ≤ + ‖(A : GroupOperator (ℕ × G))‖^2*‖(B : GroupOperator (ℕ × G)) (stabilizationDelta G j)‖^2 := by + change ‖(A : GroupOperator (ℕ × G)) ((B : GroupOperator (ℕ × G)) (stabilizationDelta G j))‖^2 ≤ _ + have h := (A : GroupOperator (ℕ × G)).le_opNorm ((B : GroupOperator (ℕ × G)) (stabilizationDelta G j)) + nlinarith [norm_nonneg ((A : GroupOperator (ℕ × G)) ((B : GroupOperator (ℕ × G)) (stabilizationDelta G j))), + mul_nonneg (norm_nonneg (A : GroupOperator (ℕ × G))) (norm_nonneg ((B : GroupOperator (ℕ × G)) (stabilizationDelta G j)))] + have hs' := Summable.of_nonneg_of_le (fun j => sq_nonneg _) hle hs + exact hs'.tsum_ofReal_ne_top + + theorem finite_weight_star (T : stabilization G) (hT : stabilizedProjectionTrace T ≠ ⊤) : + stabilizedProjectionTrace (star T) ≠ ⊤ := by + classical + rwa [stabilizedProjectionTrace_star] + + theorem finite_weight_toReal (T : stabilization G) : + (stabilizedProjectionTrace T).toReal = + ∑' j, ‖(T : GroupOperator (ℕ × G)) (stabilizationDelta G j)‖^2 := by + rw [stabilizedProjectionTrace,ENNReal.tsum_toReal_eq (fun _ => ENNReal.ofReal_ne_top)] + apply tsum_congr + intro j + exact ENNReal.toReal_ofReal (sq_nonneg _) + + theorem stabilizedTrace_star_mul (T : stabilization G) (hT : stabilizedProjectionTrace T ≠ ⊤) : + stabilizedTrace (star T*T)=((stabilizedProjectionTrace T).toReal : ℂ) := by + rw [finite_weight_toReal] + have hs := finite_weight_summable T hT + calc + stabilizedTrace (star T*T) = ∑' j, ((‖(T : GroupOperator (ℕ × G)) (stabilizationDelta G j)‖^2 : ℝ) : ℂ) := by + apply tsum_congr + intro j + change inner ℂ (stabilizationDelta G j) + (star (T : GroupOperator (ℕ × G)) ((T : GroupOperator (ℕ × G)) (stabilizationDelta G j)))=_ + have he := (ContinuousLinearMap.adjoint_inner_right (T : GroupOperator (ℕ × G)) + (stabilizationDelta G j) ((T : GroupOperator (ℕ × G)) (stabilizationDelta G j))).trans + (inner_self_eq_norm_sq_to_K ((T : GroupOperator (ℕ × G)) (stabilizationDelta G j))) + rw [ContinuousLinearMap.star_eq_adjoint] + exact he.trans (Complex.ofReal_pow _ _).symm + _ = _ := (Complex.ofRealCLM.map_tsum hs).symm + + theorem stabilizedTrace_star_mul_comm (T : stabilization G) (hT : stabilizedProjectionTrace T ≠ ⊤) : + stabilizedTrace (star T*T)=stabilizedTrace (T*star T) := by + classical + rw [stabilizedTrace_star_mul T hT] + have he := stabilizedTrace_star_mul (star T) (finite_weight_star T hT) + rw [star_star,stabilizedProjectionTrace_star] at he + exact he.symm + + theorem corner_diag_bound (p : stabilization G) (hp : IsStarProjection p) (x : Corner p hp) (j : ℕ) : + ‖inner ℂ (stabilizationDelta G j) + (((x : stabilization G) : GroupOperator (ℕ × G)) (stabilizationDelta G j))‖ ≤ + ‖x‖*‖(p : GroupOperator (ℕ × G)) (stabilizationDelta G j)‖^2 := by + let P := (p : GroupOperator (ℕ × G)) + let X := ((x : stabilization G) : GroupOperator (ℕ × G)) + let ξ := stabilizationDelta G j + have hself : star P=P := congrArg Subtype.val hp.isSelfAdjoint.star_eq + have hleft : P*X=X := congrArg Subtype.val x.property.1 + have hright : X*P=X := congrArg Subtype.val x.property.2 + have hi : inner ℂ ξ (X ξ)=inner ℂ (P ξ) (X ξ) := by + have he := ContinuousLinearMap.adjoint_inner_right P ξ (X ξ) + rw [← ContinuousLinearMap.star_eq_adjoint,hself] at he + have hh : P (X ξ)=X ξ := congrArg (fun U : GroupOperator (ℕ × G) => U ξ) hleft + rw [hh] at he + exact he + change ‖inner ℂ ξ (X ξ)‖ ≤ ‖X‖*‖P ξ‖^2 + rw [hi,← congrArg (fun U : GroupOperator (ℕ × G) => U ξ) hright] + change ‖inner ℂ (P ξ) (X (P ξ))‖ ≤ _ + calc + _ ≤ ‖P ξ‖*‖X (P ξ)‖ := norm_inner_le_norm _ _ + _ ≤ ‖P ξ‖*(‖X‖*‖P ξ‖) := mul_le_mul_of_nonneg_left (X.le_opNorm _) (norm_nonneg _) + _ = _ := by ring + + theorem corner_diag_summable (p : stabilization G) (hp : IsStarProjection p) + (hfinite : stabilizedProjectionTrace p ≠ ⊤) (x : Corner p hp) : + Summable (fun j => inner ℂ (stabilizationDelta G j) + (((x : stabilization G) : GroupOperator (ℕ × G)) (stabilizationDelta G j))) := by + apply Summable.of_norm + exact Summable.of_nonneg_of_le (fun _ => norm_nonneg _) (corner_diag_bound p hp x) + ((finite_weight_summable p hfinite).mul_left ‖x‖) + + def finiteCornerTraceLinear (p : stabilization G) (hp : IsStarProjection p) + (hfinite : stabilizedProjectionTrace p ≠ ⊤) : Corner p hp →ₗ[ℂ] ℂ where + toFun x := stabilizedTrace (x : stabilization G) + map_add' x y := by + change (∑' j, inner ℂ (stabilizationDelta G j) + ((((x+y : Corner p hp) : stabilization G) : GroupOperator (ℕ × G)) (stabilizationDelta G j)))=_ + have he (j : ℕ) : inner ℂ (stabilizationDelta G j) + ((((x+y : Corner p hp) : stabilization G) : GroupOperator (ℕ × G)) (stabilizationDelta G j))= + inner ℂ (stabilizationDelta G j) (((x : stabilization G) : GroupOperator (ℕ × G)) (stabilizationDelta G j))+ + inner ℂ (stabilizationDelta G j) (((y : stabilization G) : GroupOperator (ℕ × G)) (stabilizationDelta G j)) := + inner_add_right _ _ _ + simp_rw [he] + exact (corner_diag_summable p hp hfinite x).tsum_add (corner_diag_summable p hp hfinite y) + map_smul' c x := by + change (∑' j, inner ℂ (stabilizationDelta G j) + ((((c • x : Corner p hp) : stabilization G) : GroupOperator (ℕ × G)) (stabilizationDelta G j)))=_ + have he (j : ℕ) : inner ℂ (stabilizationDelta G j) + ((((c • x : Corner p hp) : stabilization G) : GroupOperator (ℕ × G)) (stabilizationDelta G j))= + c • inner ℂ (stabilizationDelta G j) (((x : stabilization G) : GroupOperator (ℕ × G)) (stabilizationDelta G j)) := + inner_smul_right _ _ _ + simp_rw [he] + exact (corner_diag_summable p hp hfinite x).tsum_mul_left c + + theorem finite_weight_corner (p : stabilization G) (hp : IsStarProjection p) + (hfinite : stabilizedProjectionTrace p ≠ ⊤) (x : Corner p hp) : + stabilizedProjectionTrace (x : stabilization G) ≠ ⊤ := by + have he := finite_weight_left_mul (x : stabilization G) p hfinite + rwa [x.property.2] at he + +end + +variable {A : Type u_3} [CStarAlgebra A] + + theorem quadratic_polarization (x : A) : + (4 : ℂ) • x = star (x+1)*(x+1)-star (x-1)*(x-1)+ + Complex.I • (star (x+Complex.I • 1)*(x+Complex.I • 1)- + star (x-Complex.I • 1)*(x-Complex.I • 1)) := by + simp only [star_add,star_sub,star_smul,star_one,Complex.star_def,Complex.conj_I, + add_mul,mul_add,sub_mul,mul_sub,smul_mul_assoc,mul_smul_comm,smul_smul,mul_one,one_mul, + smul_add,smul_sub,smul_neg,neg_mul,Complex.I_mul_I,neg_neg,one_smul,neg_smul] + module + + theorem linearMap_ext_star_mul (φ ψ : A →ₗ[ℂ] ℂ) + (h : ∀ x, φ (star x*x)=ψ (star x*x)) : φ=ψ := by + apply LinearMap.ext + intro x + have he := quadratic_polarization x + have hφ := congrArg φ he + have hψ := congrArg ψ he + simp only [map_smul,map_add,map_sub,h] at hφ hψ + have hh : (4 : ℂ)*φ x=4*ψ x := hφ.trans hψ.symm + exact (mul_left_cancel₀ (by norm_num : (4 : ℂ) ≠ 0)) hh + +end FreeGroupFactorMain.Amplification + +namespace FreeGroupFactorMain + +def operatorSequenceMap {G : Type u_4} {H : Type u_5} (A : GroupHilbert G →L[ℂ] GroupHilbert H) + (ξ : lp (fun _ : ℕ => GroupHilbert G) 2) : lp (fun _ : ℕ => GroupHilbert H) 2 := + ⟨fun n => A (ξ n), ((lp.memℓp ξ).norm.const_smul ‖A‖).mono (fun n => A.le_opNorm (ξ n))⟩ + + theorem ultraweak_mul_conjugate {G : Type u_6} (u : GroupOperator G) : + @Continuous _ _ (ultraweakOperatorTopology G) (ultraweakOperatorTopology G) + (fun T : GroupOperator G => u*T*star u) := by + apply continuous_iInf_rng.mpr + intro ξ + apply continuous_iInf_rng.mpr + intro η + apply continuous_induced_rng.mpr + have heq : + (fun T : GroupOperator G => ∑' k : ℕ, inner ℂ (η k) ((u*T*star u) (ξ k))) = + (fun T : GroupOperator G => ∑' k : ℕ, + inner ℂ (operatorSequenceMap (star u) η k) (T (operatorSequenceMap (star u) ξ k))) := by + funext T + apply tsum_congr + intro k + change inner ℂ (η k) (u (T ((star u) (ξ k)))) = + inner ℂ ((star u) (η k)) (T ((star u) (ξ k))) + exact (ContinuousLinearMap.adjoint_inner_left u _ _).symm + change @Continuous _ _ (ultraweakOperatorTopology G) _ + (fun T : GroupOperator G => ∑' k : ℕ, inner ℂ (η k) ((u*T*star u) (ξ k))) + rw [heq] + exact continuous_iInf_dom (i := operatorSequenceMap (star u) ξ) + (continuous_iInf_dom (i := operatorSequenceMap (star u) η) continuous_induced_dom) + + theorem groupUltraweak_mul_conjugate {G : Type u_7} [Group G] (u : groupVonNeumann G) : + @Continuous _ _ (groupUltraweakTopology G) (groupUltraweakTopology G) + (fun T : groupVonNeumann G => u*T*star u) := by + let : TopologicalSpace (GroupOperator G) := ultraweakOperatorTopology G + let : TopologicalSpace (groupVonNeumann G) := groupUltraweakTopology G + apply continuous_induced_rng.mpr + exact (ultraweak_mul_conjugate (u : GroupOperator G)).comp continuous_induced_dom + +end FreeGroupFactorMain + +namespace FreeGroupFactorMain.Amplification +open scoped ENNReal +variable {G : Type u_8} [Group G] + + theorem equivalentCorner_finite_trace (p q : stabilization G) + (hp : IsStarProjection p) (hq : IsStarProjection q) + (hpfinite : stabilizedProjectionTrace p ≠ ⊤) (hqfinite : stabilizedProjectionTrace q ≠ ⊤) + (u : stabilization G) (hu : star u*u=p) (hu' : u*star u=q) + (x : Corner p hp) : + stabilizedTrace (equivalentCorner p q hp hq u hu hu' x : stabilization G)= + stabilizedTrace (x : stabilization G) := by + let Φ := equivalentCorner p q hp hq u hu hu' + let φ := (finiteCornerTraceLinear q hq hqfinite).comp Φ.toAlgEquiv.toLinearMap + let ψ := finiteCornerTraceLinear p hp hpfinite + have he : φ=ψ := by + apply linearMap_ext_star_mul + intro z + let Z := (z : stabilization G) + have hZ := finite_weight_corner p hp hpfinite z + have hZs := finite_weight_star Z hZ + have hUZ := finite_weight_left_mul u (star Z) hZs + have hr : Z*p=Z := z.property.2 + have halg : star (u*star Z)*(u*star Z)=Z*star Z := by + simp only [star_mul,star_star] + calc + (Z*star u)*(u*star Z)=(Z*(star u*u))*star Z := by noncomm_ring + _ = Z*star Z := by rw [hu,hr] + change stabilizedTrace (u*(star Z*Z)*star u)=stabilizedTrace (star Z*Z) + calc + _ = stabilizedTrace ((u*star Z)*star (u*star Z)) := by + simp only [star_mul,star_star,mul_assoc] + _ = stabilizedTrace (star (u*star Z)*(u*star Z)) := (stabilizedTrace_star_mul_comm _ hUZ).symm + _ = stabilizedTrace (Z*star Z) := congrArg stabilizedTrace halg + _ = _ := (stabilizedTrace_star_mul_comm Z hZ).symm + exact congrArg (fun f : Corner p hp →ₗ[ℂ] ℂ => f x) he + + theorem equivalentCorner_normalized_finite_trace (p q : stabilization G) + (hp : IsStarProjection p) (hq : IsStarProjection q) + (hpfinite : stabilizedProjectionTrace p ≠ ⊤) (hqfinite : stabilizedProjectionTrace q ≠ ⊤) + (u : stabilization G) (hu : star u*u=p) (hu' : u*star u=q) + (t : ℝ) (x : Corner p hp) : + normalizedCornerTrace stabilizedTrace t q hq (equivalentCorner p q hp hq u hu hu' x)= + normalizedCornerTrace stabilizedTrace t p hp x := by + unfold normalizedCornerTrace + rw [equivalentCorner_finite_trace p q hp hq hpfinite hqfinite u hu hu'] + + theorem stabilizationUltraweak_mul_conjugate (u : stabilization G) : + @Continuous _ _ (stabilizationTopology G) (stabilizationTopology G) + (fun T : stabilization G => u*T*star u) := by + let : TopologicalSpace (GroupOperator (ℕ × G)) := ultraweakOperatorTopology (ℕ × G) + let : TopologicalSpace (stabilization G) := stabilizationTopology G + apply continuous_induced_rng.mpr + exact (ultraweak_mul_conjugate (u : GroupOperator (ℕ × G))).comp continuous_induced_dom + + theorem finite_corner_choice_independence + (hbase : ∀ T : groupVonNeumann G, (∀ S : groupVonNeumann G, Commute T S) → + ∃ c : ℂ, T=c • (1 : groupVonNeumann G)) + (t : ℝ) (p q : stabilization G) (hp : IsStarProjection p) (hq : IsStarProjection q) + (htrace : stabilizedProjectionTrace p=stabilizedProjectionTrace q) + (hfinite : stabilizedProjectionTrace p ≠ ⊤) : + ∃ Φ : Corner p hp ≃⋆ₐ[ℂ] Corner q hq, + (∀ x, normalizedCornerTrace stabilizedTrace t q hq (Φ x)= + normalizedCornerTrace stabilizedTrace t p hp x) ∧ + @Continuous _ _ (cornerTopology (stabilizationTopology G) p hp) + (cornerTopology (stabilizationTopology G) q hq) Φ := by + classical + have hv : ∃ u : stabilization G, star u*u=p ∧ u*star u=q := + equal_finite_trace_equivalence (G := G) hbase p q hp hq htrace hfinite + rcases hv with ⟨u,hu,hu'⟩ + refine ⟨equivalentCorner p q hp hq u hu hu',?_,?_⟩ + · exact equivalentCorner_normalized_finite_trace p q hp hq hfinite (htrace ▸ hfinite) u hu hu' t + · exact equivalentCorner_normal p q hp hq u hu hu' (stabilizationTopology G) + (stabilizationUltraweak_mul_conjugate u) + +end FreeGroupFactorMain.Amplification + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Fock.lean b/lean/OAI/Analysis/InterpolatedFactors/Fock.lean new file mode 100644 index 0000000000000000000000000000000000000000..2262aac2073174f0fb5d273e9b2374ee4330c459 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Fock.lean @@ -0,0 +1,1015 @@ +import OAI.Analysis.InterpolatedFactors.CornerRepresentation + +namespace OAI + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 u_10 u_11 u_12 +universe u_13 u_14 u_15 + +noncomputable section +namespace FreeGroupFactorMain.FreeFock +open scoped ENNReal + +abbrev Op (α : Type u_1) := Hilbert α →L[ℂ] Hilbert α +variable {α : Type u_2} {β : Type u_3} [DecidableEq α] [DecidableEq β] + + theorem operator_basis_ext (T U : Op α) + (h : ∀ a, T (lp.single 2 a 1)=U (lp.single 2 a 1)) : T=U := by + classical + apply ContinuousLinearMap.ext + intro ξ + have hT := (lp.hasSum_single (by norm_num : (2 : ℝ≥0∞) ≠ ⊤) ξ).mapL T + have hU := (lp.hasSum_single (by norm_num : (2 : ℝ≥0∞) ≠ ⊤) ξ).mapL U + have he (a : α) : T (lp.single 2 a (ξ a))=U (lp.single 2 a (ξ a)) := by + have hc : lp.single (E := fun _ : α => ℂ) 2 a (ξ a)= + (ξ a) • lp.single (E := fun _ : α => ℂ) 2 a 1 := by + ext b + simp [lp.single_apply,Pi.single_apply] + rw [hc,map_smul,map_smul,h] + simp only [he] at hT + exact hT.unique hU + + def basisEmbedding (a : α) : ℂ →ₗᵢ[ℂ] Hilbert α where + toLinearMap := lp.lsingle (𝕜 := ℂ) (E := fun _ : α => ℂ) 2 a + norm_map' z := lp.norm_single (E := fun _ : α => ℂ) (by norm_num : 0 < (2 : ℝ≥0∞)) a z + +omit [DecidableEq α] in + theorem embedding_orthogonal (f : α ↪ β) : + OrthogonalFamily ℂ (fun _ : α => ℂ) (fun a => basisEmbedding (f a)) := by + classical + intro a b hab z w + change inner ℂ (lp.single (E := fun _ : β => ℂ) 2 (f a) z) (lp.single (E := fun _ : β => ℂ) 2 (f b) w)=0 + have hn : f a ≠ f b := fun he => hab (f.injective he) + simp [lp.inner_single_left,lp.single_apply,hn] + + def hilbertEmbedding (f : α ↪ β) : Hilbert α →ₗᵢ[ℂ] Hilbert β := + (embedding_orthogonal f).linearIsometry + +@[simp] theorem hilbertEmbedding_single (f : α ↪ β) (a : α) (z : ℂ) : + hilbertEmbedding f (lp.single 2 a z)=lp.single 2 (f a) z := + (embedding_orthogonal f).linearIsometry_apply_single z + + abbrev Fock (α : Type u_4) := Hilbert (List α) + abbrev Operator (α : Type u_5) := Op (List α) + + def consEmbedding (a : α) : List α ↪ List α := ⟨List.cons a,fun _ _ h => (List.cons.inj h).2⟩ + + def creation (a : α) : Operator α := (hilbertEmbedding (consEmbedding a)).toContinuousLinearMap + +@[simp] theorem creation_single (a : α) (w : List α) (z : ℂ) : + creation a (lp.single 2 w z)=lp.single 2 (a::w) z := by + exact hilbertEmbedding_single (consEmbedding a) w z + + theorem creation_norm (a : α) (ξ : Fock α) : ‖creation a ξ‖=‖ξ‖ := + (hilbertEmbedding (consEmbedding a)).norm_map ξ + + theorem annihilation_single_nil (a : α) (z : ℂ) : + star (creation a) (lp.single 2 [] z)=0 := by + classical + ext w + have hi := ContinuousLinearMap.adjoint_inner_right (creation a) (lp.single 2 w 1) (lp.single 2 [] z) + rw [creation_single,lp.inner_single_left,lp.inner_single_left] at hi + simpa [ContinuousLinearMap.star_eq_adjoint,RCLike.inner_apply,lp.single_apply] using hi + + theorem annihilation_single_cons (a b : α) (w : List α) (z : ℂ) : + star (creation a) (lp.single 2 (b::w) z)=if a=b then lp.single 2 w z else 0 := by + classical + ext v + have hi := ContinuousLinearMap.adjoint_inner_right (creation a) (lp.single 2 v 1) (lp.single 2 (b::w) z) + rw [creation_single,lp.inner_single_left,lp.inner_single_left] at hi + change (star (creation a) (lp.single 2 (b::w) z)) v=_ + have he : (star (creation a) (lp.single 2 (b::w) z)) v=(lp.single (E := fun _ : List α => ℂ) 2 (b::w) z) (a::v) := by + simpa [ContinuousLinearMap.star_eq_adjoint,RCLike.inner_apply] using hi + rw [he] + by_cases hab : a=b + · subst b + simp only [lp.single_apply,Pi.single_apply,List.cons.injEq,true_and,ite_true] + · simp only [lp.single_apply,Pi.single_apply,List.cons.injEq,hab,false_and,ite_false,lp.coeFn_zero,Pi.zero_apply] + + theorem annihilation_creation (a b : α) : + star (creation a)*creation b=if a=b then 1 else 0 := by + classical + apply operator_basis_ext (α := List α) + intro w + rw [mul_apply_eq_comp] + rw [creation_single,annihilation_single_cons] + by_cases h : a=b <;> simp [h] + + def semicircular (a : α) : Operator α := creation a+star (creation a) + + theorem semicircular_selfAdjoint (a : α) : IsSelfAdjoint (semicircular a) := by + change star (creation a+star (creation a))=creation a+star (creation a) + simp only [star_add (R := Operator α),star_star,add_comm] + + def vacuum : Fock α := lp.single 2 [] 1 + +@[simp] theorem semicircular_vacuum (a : α) : semicircular a vacuum=lp.single 2 [a] 1 := by + change creation a (lp.single 2 [] 1)+star (creation a) (lp.single 2 [] 1)=_ + rw [creation_single,annihilation_single_nil,add_zero] + + def vacuumTrace (T : Operator α) : ℂ := inner ℂ vacuum (T vacuum) + + theorem vacuumTrace_one : vacuumTrace (1 : Operator α)=1 := by + classical + simp only [vacuumTrace,vacuum,one_apply_eq_self,lp.inner_single_left,lp.single_apply_self] + norm_num + + theorem vacuumTrace_semicircular (a : α) : vacuumTrace (semicircular a)=0 := by + classical + rw [vacuumTrace,semicircular_vacuum] + simp [vacuum,lp.inner_single_left,lp.single_apply] + +end FreeGroupFactorMain.FreeFock +namespace FreeGroupFactorMain.CoordinateProjection + +variable {α : Type u_6} [DecidableEq α] +open scoped Classical + +@[simp] theorem proj_single (s : Set α) (a : α) (z : ℂ) : + proj s (lp.single 2 a z)=if a ∈ s then lp.single (E := fun _ : α => ℂ) 2 a z else 0 := by + classical + ext b + by_cases ha : a ∈ s + · by_cases hb : b=a <;> simp [proj_apply,Set.indicator,lp.single_apply,ha,hb] + · by_cases hb : b=a <;> simp [proj_apply,Set.indicator,lp.single_apply,ha,hb] + + theorem projection (s : Set α) : IsStarProjection (proj s) := by + refine ⟨?_,star_proj s⟩ + apply FreeFock.operator_basis_ext + intro a + simp only [mul_apply_eq_comp,proj_single] + split_ifs <;> simp_all + + theorem commute (s t : Set α) : Commute (proj s) (proj t) := by + change _ * _ = _ * _ + apply FreeFock.operator_basis_ext + intro a + simp only [mul_apply_eq_comp,proj_single] + split_ifs <;> simp_all + + theorem commute_embedding (s : Set α) (f : α ↪ α) + (hf : ∀ a, f a ∈ s ↔ a ∈ s) : + Commute (proj s) (FreeFock.hilbertEmbedding f).toContinuousLinearMap := by + change _ * _ = _ * _ + apply FreeFock.operator_basis_ext + intro a + change proj s (FreeFock.hilbertEmbedding f (lp.single 2 a 1))= + FreeFock.hilbertEmbedding f (proj s (lp.single 2 a 1)) + rw [FreeFock.hilbertEmbedding_single,proj_single,proj_single] + simp only [hf] + split_ifs <;> simp_all + +end FreeGroupFactorMain.CoordinateProjection + +namespace FreeGroupFactorMain.WeightedFock + +section +open FreeFock +variable {ι : Type u_7} [DecidableEq ι] + +abbrev Path (ι : Type u_8) := List (ι × Bool) × Bool +abbrev H (ι : Type u_9) := Hilbert (Path ι) +abbrev Operator (ι : Type u_10) := Op (Path ι) + +def start (w : Path ι) : Bool := match w.1 with + | [] => w.2 + | (_,r)::_ => r + +def prepend (i : ι) (r : Bool) : Path ι ↪ Path ι := + ⟨fun w => ((i,r)::w.1,w.2), by + rintro ⟨v,s⟩ ⟨w,t⟩ h + have he := Prod.mk.inj h + exact Prod.ext (List.cons.inj he.1).2 he.2⟩ + +def creation (i : ι) (r : Bool) : Operator ι := + (hilbertEmbedding (prepend i r)).toContinuousLinearMap + +@[simp] theorem creation_single (i : ι) (r : Bool) (w : Path ι) (z : ℂ) : + creation i r (lp.single 2 w z)=lp.single 2 ((i,r)::w.1,w.2) z := + hilbertEmbedding_single (prepend i r) w z + + theorem annihilation_single_nil (i : ι) (r s : Bool) (z : ℂ) : + star (creation i r) (lp.single 2 ([],s) z)=0 := by + ext w + have hi := ContinuousLinearMap.adjoint_inner_right (creation i r) + (lp.single 2 w 1) (lp.single 2 ([],s) z) + rw [creation_single,lp.inner_single_left,lp.inner_single_left] at hi + simpa [ContinuousLinearMap.star_eq_adjoint,RCLike.inner_apply,lp.single_apply] using hi + + theorem annihilation_single_cons (i j : ι) (r s e : Bool) + (w : List (ι × Bool)) (z : ℂ) : + star (creation i r) (lp.single 2 ((j,s)::w,e) z)= + if (i,r)=(j,s) then lp.single 2 (w,e) z else 0 := by + ext v + have hi := ContinuousLinearMap.adjoint_inner_right (creation i r) + (lp.single 2 v 1) (lp.single 2 ((j,s)::w,e) z) + rw [creation_single,lp.inner_single_left,lp.inner_single_left] at hi + have he : (star (creation i r) (lp.single 2 ((j,s)::w,e) z)) v= + (lp.single (E := fun _ : Path ι => ℂ) 2 ((j,s)::w,e) z) ((i,r)::v.1,v.2) := by + simpa [ContinuousLinearMap.star_eq_adjoint,RCLike.inner_apply] using hi + rw [he] + rcases v with ⟨v,t⟩ + by_cases hab : (i,r)=(j,s) + · simp only [lp.single_apply,Pi.single_apply,Prod.mk.injEq,List.cons.injEq,hab, + true_and,ite_true] + · simp only [lp.single_apply,Pi.single_apply,Prod.mk.injEq,List.cons.injEq,hab, + false_and,ite_false,lp.coeFn_zero,Pi.zero_apply] + +def P : Operator ι := CoordinateProjection.proj {w : Path ι | start w=true} +def K : Operator ι := CoordinateProjection.proj + {w : Path ι | w.2=true ∧ ∀ x ∈ w.1, x.2=true} + +theorem projection_P : IsStarProjection (P : Operator ι) := CoordinateProjection.projection _ +theorem projection_K : IsStarProjection (K : Operator ι) := CoordinateProjection.projection _ +theorem K_commute_P : Commute (K : Operator ι) P := CoordinateProjection.commute _ _ + +theorem K_commute_creation (i : ι) : Commute (K : Operator ι) (creation i true) := by + apply CoordinateProjection.commute_embedding + intro w + change (w.2=true ∧ ∀ x ∈ ((i,true)::w.1), x.2=true) ↔ + (w.2=true ∧ ∀ x ∈ w.1, x.2=true) + simp + +theorem P_creation_false (i : ι) : (P : Operator ι)*creation i false=0 := by + apply operator_basis_ext + intro w + simp [mul_apply_eq_comp,creation_single,P,CoordinateProjection.proj_single,start] + +def S (u v : ℝ) (i : ι) : Operator ι := + (u:ℂ) • creation i true + (v:ℂ) • creation i false + + star ((u:ℂ) • creation i true + (v:ℂ) • creation i false) + +theorem S_selfAdjoint (u v : ℝ) (i : ι) : IsSelfAdjoint (S u v i) := by + exact IsSelfAdjoint.add_star_self (R := Operator ι) _ + +def compressed (u v : ℝ) (i : ι) : Operator ι := P*S u v i*P + +theorem compressed_formula (u v : ℝ) (i : ι) : + compressed u v i=(u:ℂ) • (P*creation i true*P + P*star (creation i true)*P) := by + have hf : star (creation i false)*(P : Operator ι)=0 := by + have h := congrArg star (P_creation_false i) + simpa only [star_mul,projection_P.isSelfAdjoint.star_eq,star_zero (Operator ι)] using h + simp only [compressed,S,mul_add,add_mul,star_add (R := Operator ι),star_smul,Complex.star_def, + Complex.conj_ofReal,mul_smul_comm,smul_mul_assoc,mul_assoc,P_creation_false,hf, + mul_zero,zero_mul,smul_zero,add_zero,smul_add] + +theorem K_commute_compressed (u v : ℝ) (i : ι) : Commute (K : Operator ι) (compressed u v i) := by + rw [compressed_formula] + have hc := K_commute_creation i + have hs : Commute (K : Operator ι) (star (creation i true)) := by + have h := hc.star_star + rw [projection_K.isSelfAdjoint.star_eq] at h + exact h + exact ((K_commute_P.mul_right hc).mul_right K_commute_P |>.add_right + ((K_commute_P.mul_right hs).mul_right K_commute_P)).smul_right _ + +end + +section +open FreeFock +variable {ι : Type u_11} [DecidableEq ι] + +@[simp] theorem P_single (w : Path ι) (z : ℂ) : + (P : Operator ι) (lp.single 2 w z)=if start w=true then lp.single 2 w z else 0 := +by + classical + have hp := CoordinateProjection.proj_single {w : Path ι | start w=true} w z + simp only [Set.mem_ofPred_eq] at hp + unfold P + by_cases h : start w=true + · rw [ite_eq_left h] + rw [ite_eq_left h] at hp + exact hp + · rw [ite_eq_right h] + rw [ite_eq_right h] at hp + exact hp + +@[simp] theorem P_nil_true (z : ℂ) : (P : Operator ι) (lp.single 2 ([],true) z)= + lp.single 2 ([],true) z := by simp [start] + +@[simp] theorem P_nil_false (z : ℂ) : (P : Operator ι) (lp.single 2 ([],false) z)=0 := by simp [start] + +@[simp] theorem P_cons (i : ι) (r e : Bool) (w : List (ι×Bool)) (z : ℂ) : + (P : Operator ι) (lp.single 2 ((i,r)::w,e) z)= + if r=true then lp.single 2 ((i,r)::w,e) z else 0 := by + rw [P_single] + change (if r=true then _ else _) = _ + split_ifs <;> rfl + +@[simp] theorem K_nil_true (z : ℂ) : (K : Operator ι) (lp.single 2 ([],true) z)= + lp.single 2 ([],true) z := by simp [K,CoordinateProjection.proj_single] + +@[simp] theorem K_mixed (a b : ι) (z : ℂ) : + (K : Operator ι) (lp.single 2 ([(a,true),(b,false)],true) z)=0 := by + simp [K,CoordinateProjection.proj_single] + +def excursion (u v : ℝ) (a b : ι) : Operator ι := P*S u v a*(1-P)*S u v b*P + +theorem S_nil (u v : ℝ) (i : ι) (e : Bool) (z : ℂ) : + S u v i (lp.single 2 ([],e) z)= + (u:ℂ) • lp.single 2 ([(i,true)],e) z + + (v:ℂ) • lp.single 2 ([(i,false)],e) z := by + simp only [S,add_apply,star_add (R := Operator ι),star_smul,Complex.star_def,Complex.conj_ofReal, + _root_.smul_apply,creation_single,annihilation_single_nil,smul_zero,add_zero] + +theorem S_cons_distinct (u v : ℝ) (a b : ι) (hab : a≠b) + (r e : Bool) (w : List (ι×Bool)) (z : ℂ) : + S u v a (lp.single 2 ((b,r)::w,e) z)= + (u:ℂ) • lp.single 2 ((a,true)::(b,r)::w,e) z + + (v:ℂ) • lp.single 2 ((a,false)::(b,r)::w,e) z := by + simp only [S,add_apply,star_add (R := Operator ι),star_smul,Complex.star_def,Complex.conj_ofReal, + _root_.smul_apply,creation_single,annihilation_single_cons,Prod.mk.injEq,hab, + false_and,ite_false,smul_zero,add_zero] + +theorem excursion_start (u v : ℝ) (a b : ι) (hab : a≠b) : + excursion u v a b (lp.single 2 ([],true) 1)= + ((u:ℂ)*(v:ℂ)) • lp.single 2 ([(a,true),(b,false)],true) 1 := by + simp only [excursion,mul_apply_eq_comp,P_nil_true,S_nil,map_add,map_smul, + sub_apply,one_apply_eq_self,P_cons,Bool.false_eq_true,ite_false,ite_true, + sub_self,sub_zero,smul_zero,zero_add,map_zero] + rw [S_cons_distinct u v a b hab] + simp only [map_add,map_smul,P_cons,Bool.false_eq_true,ite_false,ite_true, + smul_zero,add_zero,smul_smul] + rw [mul_comm] + +def compressedAlgebra (u v : ℝ) : StarSubalgebra ℂ (Operator ι) := + StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (Set.range (compressed u v : ι → Operator ι)) : Set (Operator ι)) + +theorem compressed_selfAdjoint (u v : ℝ) (i : ι) : + IsSelfAdjoint (compressed u v i) := by + change star (P*S u v i*P)=P*S u v i*P + simp only [star_mul,projection_P.isSelfAdjoint.star_eq,(S_selfAdjoint u v i).star_eq,mul_assoc] + +theorem K_in_compressedCommutant (u v : ℝ) : + (K : Operator ι) ∈ StarSubalgebra.centralizer ℂ (Set.range (compressed u v : ι → Operator ι)) := by + rw [StarSubalgebra.mem_centralizer_iff] + rintro _ ⟨i,rfl⟩ + refine ⟨(K_commute_compressed u v i).eq.symm,?_⟩ + rw [(compressed_selfAdjoint u v i).star_eq] + exact (K_commute_compressed u v i).eq.symm + +theorem excursion_not_in_compressedAlgebra (u v : ℝ) (hu : u≠0) (hv : v≠0) + (a b : ι) (hab : a≠b) : excursion u v a b ∉ compressedAlgebra u v := by + intro h + have hc := ((StarSubalgebra.mem_centralizer_iff ℂ).mp h _ (K_in_compressedCommutant u v)).1 + have he := DFunLike.congr_fun hc (lp.single 2 ([],true) 1) + simp only [mul_apply_eq_comp,excursion_start u v a b hab,K_nil_true,map_smul, + K_mixed,smul_zero] at he + have hw := congrArg (fun ξ : H ι => ξ ([(a,true),(b,false)],true)) he + simp only [lp.coeFn_zero,Pi.zero_apply,lp.coeFn_smul,Pi.smul_apply, + lp.single_apply_self,smul_eq_mul,mul_one] at hw + exact mul_ne_zero (Complex.ofReal_ne_zero.mpr hu) (Complex.ofReal_ne_zero.mpr hv) hw.symm + +def ambientAlgebra (u v : ℝ) : StarSubalgebra ℂ (Operator ι) := + StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ + (insert P (Set.range (S u v : ι → Operator ι))) : Set (Operator ι)) + +theorem P_mem_ambient (u v : ℝ) : (P : Operator ι) ∈ ambientAlgebra u v := + StarAlgebra.adjoin_le_centralizer_centralizer ℂ _ + (StarAlgebra.subset_adjoin ℂ _ (Set.mem_insert _ _)) + +theorem S_mem_ambient (u v : ℝ) (i : ι) : S u v i ∈ ambientAlgebra u v := + StarAlgebra.adjoin_le_centralizer_centralizer ℂ _ + (StarAlgebra.subset_adjoin ℂ _ (Set.mem_insert_of_mem _ (Set.mem_range_self i))) + +theorem excursion_mem_ambient (u v : ℝ) (a b : ι) : + excursion u v a b ∈ ambientAlgebra u v := by + unfold excursion + exact (ambientAlgebra u v).mul_mem ((ambientAlgebra u v).mul_mem + ((ambientAlgebra u v).mul_mem ((ambientAlgebra u v).mul_mem + (P_mem_ambient u v) (S_mem_ambient u v a)) + ((ambientAlgebra u v).sub_mem (ambientAlgebra u v).one_mem (P_mem_ambient u v))) + (S_mem_ambient u v b)) (P_mem_ambient u v) + +theorem excursion_in_corner (u v : ℝ) (a b : ι) : + P*excursion u v a b=excursion u v a b ∧ + excursion u v a b*P=excursion u v a b := by + have hp : (P : Operator ι)*P=P := projection_P.isIdempotentElem.eq + constructor + · simp only [excursion,← mul_assoc,hp] + · simp only [excursion,mul_assoc,hp] + +theorem compression_generation_obstruction (u v : ℝ) (hu : u≠0) (hv : v≠0) + (a b : ι) (hab : a≠b) : + ∃ E : Operator ι, E ∈ ambientAlgebra u v ∧ P*E=E ∧ E*P=E ∧ E ∉ compressedAlgebra u v := by + exact ⟨excursion u v a b,excursion_mem_ambient u v a b, + (excursion_in_corner u v a b).1,(excursion_in_corner u v a b).2, + excursion_not_in_compressedAlgebra u v hu hv a b hab⟩ + +end + +section +open FreeFock +variable {ι : Type u_12} + +def appendPath (w : Path ι) (i : ι) (r : Bool) : Path ι := (w.1++[(i,w.2)],r) +def reverseList : List (ι × Bool) → Bool → Path ι + | [],e => ([],e) + | (i,r)::w,e => appendPath (reverseList w e) i r + +def reversePath (w : Path ι) : Path ι := reverseList w.1 w.2 + +@[simp] theorem reverse_nil (e : Bool) : reversePath (([],e) : Path ι)=([],e) := rfl +@[simp] theorem reverse_cons (i : ι) (r e : Bool) (w : List (ι×Bool)) : + reversePath ((i,r)::w,e)=appendPath (reversePath (w,e)) i r := rfl + +@[simp] theorem start_appendPath (w : Path ι) (i : ι) (r : Bool) : + start (appendPath w i r)=start w := by + rcases w with ⟨w,e⟩ + cases w <;> rfl + +theorem reverse_append (w : List (ι×Bool)) (i : ι) (r e : Bool) : + reversePath (w++[(i,r)],e)=prepend i e (reversePath (w,r)) := by + induction w with + | nil => rfl + | cons p w ih => + rcases p with ⟨j,s⟩ + change appendPath (reversePath (w++[(i,r)],e)) j s= + prepend i e (appendPath (reversePath (w,r)) j s) + rw [ih] + rfl + +theorem reversePath_involutive : Function.Involutive (reversePath : Path ι → Path ι) := by + rintro ⟨w,e⟩ + induction w generalizing e with + | nil => rfl + | cons p w ih => + rcases p with ⟨i,r⟩ + rw [reverse_cons] + change reversePath ((reversePath (w,e)).1++[(i,(reversePath (w,e)).2)],r)=_ + rw [reverse_append] + change prepend i r (reversePath (reversePath (w,e)))=_ + rw [ih] + rfl + +@[simp] theorem end_reverse (w : Path ι) : (reversePath w).2=start w := by + rcases w with ⟨w,e⟩ + cases w with + | nil => rfl + | cons a w => cases a; rfl + +@[simp] theorem start_reverse (w : Path ι) : start (reversePath w)=w.2 := by + have h := end_reverse (reversePath w) + rw [reversePath_involutive] at h + exact h.symm + +@[simp] theorem reversePath_reverse (w : Path ι) : reversePath (reversePath w)=w := + reversePath_involutive w + +variable [DecidableEq ι] + +def reverseEmbedding : Path ι ↪ Path ι := ⟨reversePath,reversePath_involutive.injective⟩ +def reverseIsometry : H ι →ₗᵢ[ℂ] H ι := hilbertEmbedding reverseEmbedding +def reverseOperator : Operator ι := reverseIsometry.toContinuousLinearMap + +@[simp] theorem reverseOperator_single (w : Path ι) (z : ℂ) : + reverseOperator (lp.single 2 w z)=lp.single 2 (reversePath w) z := + hilbertEmbedding_single reverseEmbedding w z + +theorem reverseOperator_square : (reverseOperator : Operator ι)*reverseOperator=1 := by + apply operator_basis_ext + intro w + simp [mul_apply_eq_comp,reverseOperator_single] + +theorem reverseOperator_involutive (ξ : H ι) : reverseOperator (reverseOperator ξ)=ξ := + DFunLike.congr_fun reverseOperator_square ξ + +def reverseEquiv : H ι ≃ₗᵢ[ℂ] H ι := + LinearIsometryEquiv.ofSurjective reverseIsometry (fun ξ => + ⟨reverseOperator ξ,reverseOperator_involutive ξ⟩) + +@[simp] theorem reverseEquiv_apply (ξ : H ι) : reverseEquiv ξ=reverseOperator ξ := rfl +@[simp] theorem reverseEquiv_symm_apply (ξ : H ι) : reverseEquiv.symm ξ=reverseOperator ξ := by + apply reverseEquiv.injective + rw [LinearIsometryEquiv.apply_symm_apply,reverseEquiv_apply,reverseOperator_involutive] + +def reverseConj : Operator ι ≃⋆ₐ[ℂ] Operator ι := reverseEquiv.conjStarAlgEquiv + +@[simp] theorem reverseConj_apply (T : Operator ι) (ξ : H ι) : + reverseConj T ξ=reverseOperator (T (reverseOperator ξ)) := by + simp only [reverseConj,LinearIsometryEquiv.conjStarAlgEquiv_apply_apply, + reverseEquiv_apply,reverseEquiv_symm_apply] + +def appendEmbedding (i : ι) (r : Bool) : Path ι ↪ Path ι := + ⟨fun w => appendPath w i r, by + intro w v h + apply reversePath_involutive.injective + have he := congrArg reversePath h + change reversePath (w.1++[(i,w.2)],r)=reversePath (v.1++[(i,v.2)],r) at he + rw [reverse_append,reverse_append] at he + exact (prepend i r).injective he⟩ + +def rightCreation (i : ι) (r : Bool) : Operator ι := + (hilbertEmbedding (appendEmbedding i r)).toContinuousLinearMap + +@[simp] theorem rightCreation_single (i : ι) (r : Bool) (w : Path ι) (z : ℂ) : + rightCreation i r (lp.single 2 w z)=lp.single 2 (appendPath w i r) z := + hilbertEmbedding_single (appendEmbedding i r) w z + +theorem reverseConj_creation (i : ι) (r : Bool) : + reverseConj (creation i r)=rightCreation i r := by + apply operator_basis_ext + intro w + simp only [reverseConj_apply,reverseOperator_single,creation_single,rightCreation_single, + reverse_cons,Prod.eta,reversePath_reverse] + +def rightP : Operator ι := CoordinateProjection.proj {w : Path ι | w.2=true} + +theorem reverseConj_P : reverseConj (P : Operator ι)=rightP := by + apply operator_basis_ext + intro w + simp only [reverseConj_apply,reverseOperator_single,P_single,start_reverse, + rightP,CoordinateProjection.proj_single,Set.mem_ofPred_eq] + split_ifs <;> simp [reverseOperator_single] + +def vacuum (u v : ℝ) : H ι := (u:ℂ) • lp.single 2 ([],true) 1 + + (v:ℂ) • lp.single 2 ([],false) 1 + +@[simp] theorem reverse_vacuum (u v : ℝ) : reverseOperator (vacuum u v : H ι)=vacuum u v := by + simp only [vacuum,map_add,map_smul,reverseOperator_single,reverse_nil] + + theorem right_creation_commute (i j : ι) (r s : Bool) : + Commute (creation i r) (rightCreation j s) := by + change _*_=_*_ + apply operator_basis_ext + intro w + simp only [mul_apply_eq_comp,creation_single,rightCreation_single,appendPath] + rfl + + theorem P_commute_rightCreation (i : ι) (r : Bool) : + Commute (P : Operator ι) (rightCreation i r) := by + apply CoordinateProjection.commute_embedding + intro w + change start (appendPath w i r)=true ↔ start w=true + rw [start_appendPath] + + theorem rightP_commute_creation (i : ι) (r : Bool) : + Commute (rightP : Operator ι) (creation i r) := by + apply CoordinateProjection.commute_embedding + intro w + rfl + + theorem P_commute_rightP : Commute (P : Operator ι) rightP := CoordinateProjection.commute _ _ + +end + +section +open FreeFock +variable {ι : Type u_13} [DecidableEq ι] + +def vacuumMatrix (r s : Bool) : Operator ι := + InnerProductSpace.rankOne ℂ (lp.single 2 ([],s) 1) (lp.single 2 ([],r) 1) + +@[simp] theorem vacuumMatrix_nil (r s e : Bool) (z : ℂ) : + (vacuumMatrix r s : Operator ι) (lp.single 2 ([],e) z)= + if r=e then lp.single 2 ([],s) z else 0 := by + classical + by_cases hr : r=e + · subst e + ext w + simp [vacuumMatrix,InnerProductSpace.rankOne_apply,lp.inner_single_left, + lp.single_apply,Pi.single_apply] + · simp [vacuumMatrix,InnerProductSpace.rankOne_apply,lp.inner_single_left, + lp.single_apply,hr] + +@[simp] theorem vacuumMatrix_cons (r s e : Bool) (i : ι) (t : Bool) + (w : List (ι×Bool)) (z : ℂ) : + (vacuumMatrix r s : Operator ι) (lp.single 2 ((i,t)::w,e) z)=0 := by + simp [vacuumMatrix,InnerProductSpace.rankOne_apply,lp.inner_single_left,lp.single_apply] + +@[simp] theorem star_vacuumMatrix (r s : Bool) : + star (vacuumMatrix r s : Operator ι)=vacuumMatrix s r := by + simp only [vacuumMatrix,ContinuousLinearMap.star_eq_adjoint,InnerProductSpace.adjoint_rankOne] + + theorem annihilation_rightCreation (i j : ι) (r s : Bool) : + star (creation i r)*rightCreation j s= + rightCreation j s*star (creation i r)+(if i=j then vacuumMatrix r s else 0) := by + apply operator_basis_ext + rintro ⟨w,e⟩ + cases w with + | nil => + simp only [mul_apply_eq_comp,add_apply,rightCreation_single,appendPath,List.nil_append, + annihilation_single_cons,annihilation_single_nil,map_zero,zero_add] + by_cases hij : i=j + · subst j + simp [vacuumMatrix_nil] + · simp only [Prod.mk.injEq,hij,false_and,ite_false] + rfl + | cons a w => + rcases a with ⟨k,t⟩ + simp only [mul_apply_eq_comp,add_apply,rightCreation_single,appendPath,List.cons_append, + annihilation_single_cons] + have hm : (if i=j then (vacuumMatrix r s : Operator ι) else 0) + (lp.single 2 ((k,t)::w,e) 1)=0 := by + split_ifs <;> simp + rw [hm,add_zero] + by_cases h : (i,r)=(k,t) + · simp only [h,ite_true,rightCreation_single,appendPath] + · simp only [h,ite_false,map_zero] + +def C (u v : ℝ) (i : ι) : Operator ι := + (u:ℂ) • creation i true+(v:ℂ) • creation i false + +def rightC (u v : ℝ) (i : ι) : Operator ι := + (u:ℂ) • rightCreation i true+(v:ℂ) • rightCreation i false + +theorem reverseConj_C (u v : ℝ) (i : ι) : reverseConj (C u v i)=rightC u v i := by + simp only [C,rightC,map_add,map_smul,reverseConj_creation] + +theorem S_eq (u v : ℝ) (i : ι) : S u v i=C u v i+star (C u v i) := rfl + +def rightS (u v : ℝ) (i : ι) : Operator ι := rightC u v i+star (rightC u v i) + +theorem reverseConj_S (u v : ℝ) (i : ι) : reverseConj (S u v i)=rightS u v i := by + have hs : reverseConj (star (C u v i)) = star (reverseConj (C u v i)) := + reverseConj.map_star' (C u v i) + simp only [S_eq,map_add,hs,reverseConj_C,rightS] + +def vacuumCorrection (u v : ℝ) : Operator ι := + ((u:ℂ)^2) • vacuumMatrix true true + + ((u:ℂ)*(v:ℂ)) • vacuumMatrix true false + + ((u:ℂ)*(v:ℂ)) • vacuumMatrix false true + + ((v:ℂ)^2) • vacuumMatrix false false + +theorem vacuumCorrection_selfAdjoint (u v : ℝ) : + IsSelfAdjoint (vacuumCorrection u v : Operator ι) := by + change star (vacuumCorrection u v)=vacuumCorrection u v + simp only [vacuumCorrection,star_add (R := Operator ι),star_smul,star_vacuumMatrix,Complex.star_def, + map_pow,map_mul,Complex.conj_ofReal] + abel + +theorem C_commute_rightC (u v : ℝ) (i j : ι) : Commute (C u v i) (rightC u v j) := by + unfold C rightC + exact (((right_creation_commute i j true true).smul_left _).smul_right _ |>.add_right + (((right_creation_commute i j true false).smul_left _).smul_right _)).add_left + ((((right_creation_commute i j false true).smul_left _).smul_right _ |>.add_right + (((right_creation_commute i j false false).smul_left _).smul_right _))) + +theorem C_annihilation_rightC (u v : ℝ) (i j : ι) : + star (C u v i)*rightC u v j=rightC u v j*star (C u v i)+ + (if i=j then vacuumCorrection u v else 0) := by + simp only [C,rightC,star_add (R := Operator ι),star_smul,Complex.star_def,Complex.conj_ofReal, + add_mul,mul_add,smul_mul_assoc,mul_smul_comm,annihilation_rightCreation,smul_add, + smul_smul] + by_cases hij : i=j + · simp only [hij,ite_true,vacuumCorrection] + module + · simp only [hij,ite_false,add_zero] + module + + omit [DecidableEq ι] in +theorem add_star_commute_of_correction {A B D : Operator ι} + (hAB : A*B=B*A) (h : star A*B=B*star A+D) (hD : star D=D) : + Commute (A+star A) (B+star B) := by + have habs : star A*star B=star B*star A := by + have he := congrArg star hAB + simpa only [star_mul] using he.symm + have has : A*star B=star B*A-D := by + have he := congrArg star h + simp only [star_mul,star_star,star_add (R := Operator ι),hD] at he + exact eq_sub_iff_add_eq.mpr he.symm + change _*_=_*_ + rw [add_mul,mul_add,mul_add,hAB,has,h,habs] + simp only [mul_add,add_mul] + abel + + theorem S_commute_rightS (u v : ℝ) (i j : ι) : + Commute (S u v i) (rightS u v j) := by + rw [S_eq,rightS] + apply add_star_commute_of_correction (C_commute_rightC u v i j).eq + (C_annihilation_rightC u v i j) + split_ifs + · exact (vacuumCorrection_selfAdjoint u v).star_eq + · exact star_zero (Operator ι) + + theorem rightP_projection : IsStarProjection (rightP : Operator ι) := CoordinateProjection.projection _ + + theorem P_commute_rightS (u v : ℝ) (i : ι) : Commute (P : Operator ι) (rightS u v i) := by + have hc : Commute (P : Operator ι) (rightC u v i) := + ((P_commute_rightCreation i true).smul_right _).add_right + ((P_commute_rightCreation i false).smul_right _) + have hs := hc.star_star + rw [projection_P.isSelfAdjoint.star_eq] at hs + exact hc.add_right hs + + theorem rightP_commute_S (u v : ℝ) (i : ι) : Commute (rightP : Operator ι) (S u v i) := by + have hc : Commute (rightP : Operator ι) (C u v i) := + ((rightP_commute_creation i true).smul_right _).add_right + ((rightP_commute_creation i false).smul_right _) + have hs := hc.star_star + rw [rightP_projection.isSelfAdjoint.star_eq] at hs + exact hc.add_right hs + +end + +section +open FreeFock +open scoped ComplexConjugate +variable {ι : Type u_14} [DecidableEq ι] + +def ambientCommutant (u v : ℝ) : StarSubalgebra ℂ (Operator ι) := + StarSubalgebra.centralizer ℂ (insert P (Set.range (S u v : ι → Operator ι))) + +def Good (u v : ℝ) (A : Operator ι) : Prop := + A ∈ ambientAlgebra u v ∧ reverseConj A ∈ ambientCommutant u v ∧ + reverseConj A (vacuum u v)=star A (vacuum u v) + +theorem good_one (u v : ℝ) : Good u v (1 : Operator ι) := by + refine ⟨(ambientAlgebra u v).one_mem,?_,?_⟩ + · rw [map_one]; exact (ambientCommutant u v).one_mem + · simp only [map_one,star_one] + +theorem good_zero (u v : ℝ) : Good u v (0 : Operator ι) := by + refine ⟨(ambientAlgebra u v).zero_mem,?_,?_⟩ + · rw [map_zero]; exact (ambientCommutant u v).zero_mem + · simp only [map_zero,star_zero (Operator ι)] + +theorem good_add {u v : ℝ} {A B : Operator ι} (hA : Good u v A) (hB : Good u v B) : + Good u v (A+B) := by + refine ⟨(ambientAlgebra u v).add_mem hA.1 hB.1,?_,?_⟩ + · rw [map_add]; exact (ambientCommutant u v).add_mem hA.2.1 hB.2.1 + · simp only [map_add,add_apply,star_add (R := Operator ι),hA.2.2,hB.2.2] + +theorem good_sub {u v : ℝ} {A B : Operator ι} (hA : Good u v A) (hB : Good u v B) : + Good u v (A-B) := by + refine ⟨(ambientAlgebra u v).sub_mem hA.1 hB.1,?_,?_⟩ + · rw [map_sub]; exact (ambientCommutant u v).sub_mem hA.2.1 hB.2.1 + · simp only [map_sub,sub_apply,star_sub (R := Operator ι),hA.2.2,hB.2.2] + +theorem good_smul {u v : ℝ} {A : Operator ι} (c : ℝ) (hA : Good u v A) : + Good u v ((c:ℂ) • A) := by + refine ⟨(ambientAlgebra u v).smul_mem hA.1 _,?_,?_⟩ + · rw [map_smul]; exact (ambientCommutant u v).smul_mem hA.2.1 _ + · simp only [map_smul,_root_.smul_apply,star_smul,Complex.star_def, + Complex.conj_ofReal,hA.2.2] + +theorem good_mul {u v : ℝ} {A B : Operator ι} (hA : Good u v A) (hB : Good u v B) : + Good u v (A*B) := by + refine ⟨(ambientAlgebra u v).mul_mem hA.1 hB.1,?_,?_⟩ + · rw [map_mul]; exact (ambientCommutant u v).mul_mem hA.2.1 hB.2.1 + · have hc := ((StarSubalgebra.mem_centralizer_iff ℂ).mp + (star_mem hB.1) _ hA.2.1).1 + rw [map_mul,mul_apply_eq_comp,hB.2.2,← mul_apply_eq_comp,hc, + mul_apply_eq_comp,hA.2.2,star_mul,mul_apply_eq_comp] + +theorem reverseConj_vacuum (A : Operator ι) (u v : ℝ) : + reverseConj A (vacuum u v)=reverseOperator (A (vacuum u v)) := by + rw [reverseConj_apply,reverse_vacuum] + +theorem rightP_mem_commutant (u v : ℝ) : (rightP : Operator ι) ∈ ambientCommutant u v := by + rw [ambientCommutant,StarSubalgebra.mem_centralizer_iff] + intro A hA + rcases Set.mem_insert_iff.mp hA with hA | ⟨i,rfl⟩ + · subst A + refine ⟨(CoordinateProjection.commute _ _).eq,?_⟩ + rw [projection_P.isSelfAdjoint.star_eq] + exact (CoordinateProjection.commute _ _).eq + · refine ⟨(rightP_commute_S u v i).eq.symm,?_⟩ + rw [(S_selfAdjoint u v i).star_eq] + exact (rightP_commute_S u v i).eq.symm + +theorem rightS_mem_commutant (u v : ℝ) (j : ι) : rightS u v j ∈ ambientCommutant u v := by + rw [ambientCommutant,StarSubalgebra.mem_centralizer_iff] + intro A hA + rcases Set.mem_insert_iff.mp hA with hA | ⟨i,rfl⟩ + · subst A + refine ⟨(P_commute_rightS u v j).eq,?_⟩ + rw [projection_P.isSelfAdjoint.star_eq] + exact (P_commute_rightS u v j).eq + · refine ⟨(S_commute_rightS u v i j).eq,?_⟩ + rw [(S_selfAdjoint u v i).star_eq] + exact (S_commute_rightS u v i j).eq + +theorem good_P (u v : ℝ) : Good u v (P : Operator ι) := by + refine ⟨P_mem_ambient u v,?_,?_⟩ + · rw [reverseConj_P]; exact rightP_mem_commutant u v + · rw [reverseConj_vacuum,projection_P.isSelfAdjoint.star_eq] + simp only [vacuum,map_add,map_smul,P_nil_true,P_nil_false,smul_zero,add_zero, + reverseOperator_single,reverse_nil] + +theorem good_S (u v : ℝ) (i : ι) : Good u v (S u v i) := by + refine ⟨S_mem_ambient u v i,?_,?_⟩ + · rw [reverseConj_S]; exact rightS_mem_commutant u v i + · rw [reverseConj_vacuum,(S_selfAdjoint u v i).star_eq] + simp only [vacuum,map_add,map_smul,S_nil,reverseOperator_single,reverse_cons, + reverse_nil,appendPath,List.nil_append,smul_add,smul_smul] + module + +def vertex (r : Bool) : Operator ι := if r then P else 1-P + +def weight (u v : ℝ) (r : Bool) : ℝ := if r then u else v + +theorem good_vertex (u v : ℝ) (r : Bool) : Good u v (vertex r : Operator ι) := by + cases r + · exact good_sub (good_one u v) (good_P u v) + · exact good_P u v + +theorem weight_ne_zero {u v : ℝ} (hu : u≠0) (hv : v≠0) (r : Bool) : weight u v r ≠ 0 := by + cases r <;> assumption + +@[simp] theorem vertex_single (r : Bool) (w : Path ι) (z : ℂ) : + (vertex r : Operator ι) (lp.single 2 w z)=if start w=r then lp.single 2 w z else 0 := by + cases r <;> cases h : start w <;> simp [vertex,P_single,h] + + theorem vertex_S_nil (u v : ℝ) (i : ι) (r e : Bool) : + (vertex r : Operator ι) (S u v i (lp.single 2 ([],e) 1))= + ((weight u v r):ℂ) • lp.single 2 ([(i,r)],e) 1 := by + rw [S_nil] + simp only [map_add,map_smul] + cases r <;> simp only [vertex_single,start,weight,Bool.false_eq_true,Bool.true_eq_false, + ite_true,ite_false,smul_zero,zero_add,add_zero] + + theorem S_cons (u v : ℝ) (i j : ι) (s e : Bool) (w : List (ι×Bool)) : + S u v i (lp.single 2 ((j,s)::w,e) 1)= + (u:ℂ) • lp.single 2 ((i,true)::(j,s)::w,e) 1+ + (v:ℂ) • lp.single 2 ((i,false)::(j,s)::w,e) 1+ + (if i=j then ((weight u v s):ℂ) • lp.single 2 (w,e) 1 else 0) := by + simp only [S,star_add (R := Operator ι),star_smul,Complex.star_def,Complex.conj_ofReal,add_apply, + _root_.smul_apply,creation_single,annihilation_single_cons,Prod.mk.injEq] + cases s <;> by_cases hij : i=j <;> simp [hij,weight] + + theorem vertex_S_cons (u v : ℝ) (i j : ι) (r s e : Bool) (w : List (ι×Bool)) : + (vertex r : Operator ι) (S u v i (lp.single 2 ((j,s)::w,e) 1))= + ((weight u v r):ℂ) • lp.single 2 ((i,r)::(j,s)::w,e) 1+ + (if i=j then ((weight u v s):ℂ) • (vertex r : Operator ι) (lp.single 2 (w,e) 1) else 0) := by + rw [S_cons,map_add,map_add] + cases r <;> cases s <;> by_cases hij : i=j <;> + simp only [hij,ite_true,ite_false,map_smul,map_zero,vertex_single,start,weight, + Bool.false_eq_true,Bool.true_eq_false,smul_zero,zero_add,add_zero] + + theorem vertex_vacuum (u v : ℝ) (r : Bool) : + (vertex r : Operator ι) (vacuum u v)=((weight u v r):ℂ) • lp.single 2 ([],r) 1 := by + simp only [vacuum,map_add,map_smul] + cases r <;> simp only [vertex_single,start,weight,Bool.false_eq_true,Bool.true_eq_false, + ite_true,ite_false,smul_zero,zero_add,add_zero] + + theorem good_basis (u v : ℝ) (hu : u≠0) (hv : v≠0) (w : Path ι) : + ∃ A : Operator ι, Good u v A ∧ A (vacuum u v)=lp.single 2 w 1 := by + have h : ∀ l : List (ι×Bool), + (∀ e, ∃ A : Operator ι, Good u v A ∧ A (vacuum u v)=lp.single 2 (l,e) 1) ∧ + (∀ i r e, ∃ A : Operator ι, Good u v A ∧ A (vacuum u v)=lp.single 2 ((i,r)::l,e) 1) := by + intro l + induction l with + | nil => + have root (e : Bool) : ∃ A : Operator ι, Good u v A ∧ + A (vacuum u v)=lp.single 2 ([],e) 1 := by + refine ⟨(((weight u v e)⁻¹:ℝ):ℂ) • vertex e,good_smul _ (good_vertex u v e),?_⟩ + rw [_root_.smul_apply,vertex_vacuum,smul_smul] + simp only [Complex.ofReal_inv,inv_mul_cancel₀ (Complex.ofReal_ne_zero.mpr + (weight_ne_zero hu hv e)),one_smul] + refine ⟨root,?_⟩ + intro i r e + obtain ⟨A,hA,he⟩ := root e + refine ⟨(((weight u v r)⁻¹:ℝ):ℂ) • (vertex r*S u v i*A), + good_smul _ (good_mul (good_mul (good_vertex u v r) (good_S u v i)) hA),?_⟩ + simp only [_root_.smul_apply,mul_apply_eq_comp,he,vertex_S_nil,smul_smul, + Complex.ofReal_inv,inv_mul_cancel₀ (Complex.ofReal_ne_zero.mpr + (weight_ne_zero hu hv r)),one_smul] + | cons b l ih => + rcases b with ⟨j,s⟩ + refine ⟨ih.2 j s,?_⟩ + intro i r e + obtain ⟨A,hA,heA⟩ := ih.2 j s e + obtain ⟨B,hB,heB⟩ := ih.1 e + let D : Operator ι := if i=j then ((weight u v s):ℂ) • (vertex r*B) else 0 + have hD : Good u v D := by + dsimp [D] + split_ifs + · exact good_smul _ (good_mul (good_vertex u v r) hB) + · exact good_zero u v + have heD : D (vacuum u v)=if i=j then ((weight u v s):ℂ) • + (vertex r : Operator ι) (lp.single 2 (l,e) 1) else 0 := by + dsimp [D] + split_ifs + · change ((weight u v s):ℂ) • ((vertex r : Operator ι) (B (vacuum u v)))=_ + rw [heB] + ext x + simp only [lp.coeFn_smul,Pi.smul_apply] + rfl + · rfl + refine ⟨(((weight u v r)⁻¹:ℝ):ℂ) • (vertex r*S u v i*A-D), + good_smul _ (good_sub (good_mul (good_mul (good_vertex u v r) (good_S u v i)) hA) hD),?_⟩ + simp only [_root_.smul_apply,sub_apply,mul_apply_eq_comp,heA,vertex_S_cons, + heD,add_sub_cancel_right,smul_smul,Complex.ofReal_inv, + inv_mul_cancel₀ (Complex.ofReal_ne_zero.mpr (weight_ne_zero hu hv r)),one_smul] + exact (h w.1).1 w.2 + +end + +open FreeFock +open scoped ComplexConjugate +variable {ι : Type u_15} [DecidableEq ι] + + theorem good_star {u v : ℝ} {A : Operator ι} (hA : Good u v A) : + Good u v (star A) := by + refine ⟨star_mem hA.1,?_,?_⟩ + · have hs : reverseConj (star A) = star (reverseConj A) := reverseConj.map_star' A + rw [hs]; exact star_mem hA.2.1 + · rw [reverseConj_vacuum,star_star,← hA.2.2,reverseConj_vacuum, + reverseOperator_involutive] + + theorem good_right_basis (u v : ℝ) (hu : u≠0) (hv : v≠0) (w : Path ι) : + ∃ B : Operator ι, B ∈ ambientCommutant u v ∧ + B (vacuum u v)=lp.single 2 w 1 ∧ star B (vacuum u v)=lp.single 2 (reversePath w) 1 := by + obtain ⟨A,hA,heA⟩ := good_basis u v hu hv (reversePath w) + refine ⟨reverseConj A,hA.2.1,?_,?_⟩ + · rw [reverseConj_vacuum,heA,reverseOperator_single,reversePath_reverse] + · have hs : reverseConj (star A) = star (reverseConj A) := reverseConj.map_star' A + rw [← hs,(good_star hA).2.2,star_star,heA] + + theorem ambient_separating (u v : ℝ) (hu : u≠0) (hv : v≠0) + (T : ambientAlgebra (ι := ι) u v) (hT : (T : Operator ι) (vacuum u v)=0) : T=0 := by + apply Subtype.ext + apply operator_basis_ext + intro w + obtain ⟨B,hB,heB,_⟩ := good_right_basis u v hu hv w + have hc := ((StarSubalgebra.mem_centralizer_iff ℂ).mp T.property _ hB).1 + have he := DFunLike.congr_fun hc (vacuum u v) + simp only [mul_apply_eq_comp,heB,hT,map_zero] at he + exact he.symm + + theorem ambient_star_vector (u v : ℝ) (hu : u≠0) (hv : v≠0) + (T : ambientAlgebra (ι := ι) u v) (w : Path ι) : + ((star (T : Operator ι)) (vacuum u v)) w= + conj (((T : Operator ι) (vacuum u v)) (reversePath w)) := by + obtain ⟨B,hB,heB,hesB⟩ := good_right_basis u v hu hv w + have hc := ((StarSubalgebra.mem_centralizer_iff ℂ).mp T.property _ hB).1 + have hec := DFunLike.congr_fun hc (vacuum u v) + simp only [mul_apply_eq_comp,heB] at hec + have he : inner ℂ (lp.single 2 w 1) ((star (T : Operator ι)) (vacuum u v))= + inner ℂ ((T : Operator ι) (vacuum u v)) (lp.single 2 (reversePath w) 1) := by + calc + _ = inner ℂ ((T : Operator ι) (lp.single 2 w 1)) (vacuum u v) := by + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + _ = inner ℂ (B ((T : Operator ι) (vacuum u v))) (vacuum u v) := by rw [hec] + _ = inner ℂ ((T : Operator ι) (vacuum u v)) ((star B) (vacuum u v)) := by + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + _ = _ := by rw [hesB] + simpa [lp.inner_single_left,lp.inner_single_right,RCLike.inner_apply] using he + + def vacuumTrace (u v : ℝ) (T : Operator ι) : ℂ := inner ℂ (vacuum u v) (T (vacuum u v)) + + theorem ambient_trace_mul (u v : ℝ) (hu : u≠0) (hv : v≠0) + (S T : ambientAlgebra (ι := ι) u v) : + vacuumTrace u v ((S : Operator ι)*(T : Operator ι))= + vacuumTrace u v ((T : Operator ι)*(S : Operator ι)) := by + have hf (A B : ambientAlgebra (ι := ι) u v) : + vacuumTrace u v ((A : Operator ι)*(B : Operator ι))= + ∑' w : Path ι, ((A : Operator ι) (vacuum u v)) (reversePath w)* + ((B : Operator ι) (vacuum u v)) w := by + unfold vacuumTrace + rw [mul_apply_eq_comp,← ContinuousLinearMap.adjoint_inner_left] + change inner ℂ ((star (A : Operator ι)) (vacuum u v)) ((B : Operator ι) (vacuum u v))=_ + rw [lp.inner_eq_tsum] + congr 1 + funext w + rw [ambient_star_vector u v hu hv] + simp [RCLike.inner_apply,mul_comm] + rw [hf,hf] + let e : Path ι ≃ Path ι := ⟨reversePath,reversePath, + reversePath_involutive,reversePath_involutive⟩ + have hs := e.tsum_eq (fun w : Path ι => ((T : Operator ι) (vacuum u v)) (reversePath w)* + ((S : Operator ι) (vacuum u v)) w) + change (∑' w : Path ι, ((T : Operator ι) (vacuum u v)) (reversePath (reversePath w))* + ((S : Operator ι) (vacuum u v)) (reversePath w))=_ at hs + simpa only [reversePath_reverse,mul_comm] using hs + + theorem vacuumTrace_star_mul (u v : ℝ) (T : Operator ι) : + vacuumTrace u v (star T*T)=inner ℂ (T (vacuum u v)) (T (vacuum u v)) := by + simp only [vacuumTrace,mul_apply_eq_comp,ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_right] + + theorem ambient_trace_faithful (u v : ℝ) (hu : u≠0) (hv : v≠0) + (T : ambientAlgebra (ι := ι) u v) + (hT : vacuumTrace u v (star (T : Operator ι)*(T : Operator ι))=0) : T=0 := by + rw [vacuumTrace_star_mul,inner_self_eq_zero] at hT + exact ambient_separating u v hu hv T hT + + theorem vacuumTrace_one (u v : ℝ) : vacuumTrace u v (1 : Operator ι)=((u^2+v^2:ℝ):ℂ) := by + simp only [vacuumTrace,one_apply_eq_self,vacuum,inner_add_left,inner_add_right, + inner_smul_left,inner_smul_right,lp.inner_single_left] + simp [lp.single_apply,RCLike.inner_apply,pow_two] + + theorem vacuumTrace_P (u v : ℝ) : vacuumTrace u v (P : Operator ι)=((u^2:ℝ):ℂ) := by + simp only [vacuumTrace,vacuum,map_add,map_smul,P_nil_true,P_nil_false,smul_zero, + add_zero,inner_add_left,inner_smul_left,inner_smul_right,lp.inner_single_left] + simp [lp.single_apply,RCLike.inner_apply,pow_two] + + theorem tracial_compression_generation_obstruction (u v : ℝ) + (hu : u≠0) (hv : v≠0) (hunit : u^2+v^2=1) (a b : ι) (hab : a≠b) : + vacuumTrace u v (1 : Operator ι)=1 ∧ + (∀ S T : ambientAlgebra (ι := ι) u v, + vacuumTrace u v ((S : Operator ι)*(T : Operator ι))= + vacuumTrace u v ((T : Operator ι)*(S : Operator ι))) ∧ + (∀ T : ambientAlgebra (ι := ι) u v, + vacuumTrace u v (star (T : Operator ι)*(T : Operator ι))=0 → T=0) ∧ + (∃ E : Operator ι, E ∈ ambientAlgebra u v ∧ P*E=E ∧ E*P=E ∧ E ∉ compressedAlgebra u v) := by + refine ⟨?_,ambient_trace_mul u v hu hv,ambient_trace_faithful u v hu hv, + compression_generation_obstruction u v hu hv a b hab⟩ + rw [vacuumTrace_one,hunit,Complex.ofReal_one] + +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Fresh.lean b/lean/OAI/Analysis/InterpolatedFactors/Fresh.lean new file mode 100644 index 0000000000000000000000000000000000000000..11190664cfd803802d9347b13768bedf2b5b1c44 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Fresh.lean @@ -0,0 +1,312 @@ +import OAI.Analysis.InterpolatedFactors.Gaussian + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 + +namespace FreeGroupFactorMain.WeightedFock + +section +open FreeFock +variable {ι : Type u_1} [DecidableEq ι] + +theorem P_mem_old (u v : ℝ) (J : Set ι) : (P : Operator ι)∈oldAlgebra u v J := + Bicommutant.subset _ (Set.mem_insert _ _) + +theorem S_mem_old (u v : ℝ) (J : Set ι) (i : ι) (hi : i∈J) : S u v i∈oldAlgebra u v J := + Bicommutant.subset _ (Set.mem_insert_of_mem _ ⟨i,hi,rfl⟩) + +theorem offDiagonal_mem_old (u v : ℝ) (J : Set ι) (i : ι) (hi : i∈J) : + offDiagonal u v i∈oldAlgebra u v J := by + unfold offDiagonal + exact mul_mem (mul_mem (P_mem_old u v J) (S_mem_old u v J i hi)) + (sub_mem (one_mem _) (P_mem_old u v J)) + +theorem edgeAlgebra_le_old (u v : ℝ) (J : Set ι) (i : ι) (hi : i∈J) : + edgeAlgebra u v i≤oldAlgebra u v J := by + apply Bicommutant.generated_le + rintro T (rfl|hT) + · exact P_mem_old u v J + · have he : T=offDiagonal u v i+star (offDiagonal u v i) := hT + rw [he] + exact add_mem (offDiagonal_mem_old u v J i hi) (star_mem (offDiagonal_mem_old u v J i hi)) + +def weightedDefectCreation (u v : ℝ) (i j : ι) : Operator ι := + edgeDefect u v i*C u v j*edgeDefect u v i + +def defectCovariance (u v : ℝ) (i : ι) (a : edgeAlgebra u v i) : edgeAlgebra u v i := + ⟨vacuumTrace u v (edgeDefect u v i*(a : Operator ι)*edgeDefect u v i) • edgeDefect u v i, + (edgeAlgebra u v i).smul_mem (edgeDefect_mem_edge u v i) _⟩ + +theorem weightedDefect_contraction (u v : ℝ) (i j : ι) (hji : j≠i) (a : edgeAlgebra u v i) : + star (weightedDefectCreation u v i j)*(a : Operator ι)*weightedDefectCreation u v i j= + (defectCovariance u v i a : Operator ι) := by + let d : edgeAlgebra u v i := ⟨edgeDefect u v i,edgeDefect_mem_edge u v i⟩ + let b : oldAlgebra u v {i} := ⟨(d*a*d : edgeAlgebra u v i), + edgeAlgebra_le_old u v {i} i (Set.mem_singleton i) (d*a*d).property⟩ + have hc := fresh_C_contraction u v {i} j j hji hji b + simp only [ite_true] at hc + change star (C u v j)*(edgeDefect u v i*(a : Operator ι)*edgeDefect u v i)*C u v j=_ at hc + calc + _ = edgeDefect u v i*(star (C u v j)*(edgeDefect u v i*(a : Operator ι)*edgeDefect u v i)* + C u v j)*edgeDefect u v i := by + simp only [weightedDefectCreation,star_mul,(edgeDefect_projection u v i).isSelfAdjoint.star_eq] + noncomm_ring + _ = _ := by + rw [hc,mul_smul_comm,smul_mul_assoc,mul_one,(edgeDefect_projection u v i).isIdempotentElem.eq] + rfl + +theorem weightedDefect_annihilates_edge (u v : ℝ) (i j : ι) (hji : j≠i) (a : edgeAlgebra u v i) : + star (weightedDefectCreation u v i j) ((a : Operator ι) (vacuum u v))=0 := by + let b : oldAlgebra u v {i} := ⟨edgeDefect u v i*(a : Operator ι), + edgeAlgebra_le_old u v {i} i (Set.mem_singleton i) + (mul_mem (edgeDefect_mem_edge u v i) a.property)⟩ + have hc := fresh_C_annihilates_old_vacuum u v {i} j hji b + rw [weightedDefectCreation,star_mul,star_mul,(edgeDefect_projection u v i).isSelfAdjoint.star_eq] + change edgeDefect u v i (star (C u v j) (edgeDefect u v i ((a : Operator ι) (vacuum u v))))=0 + rw [show star (C u v j) (edgeDefect u v i ((a : Operator ι) (vacuum u v)))=0 from hc,map_zero] + +theorem fresh_C_weightedDefect (u v : ℝ) (i j n : ι) (hji : j≠i) (hni : n≠i) (hnj : n≠j) + (a : edgeAlgebra u v i) : star (C u v n)*(a : Operator ι)*weightedDefectCreation u v i j=0 := by + let b : oldAlgebra u v {i} := ⟨(a : Operator ι)*edgeDefect u v i, + edgeAlgebra_le_old u v {i} i (Set.mem_singleton i) + (mul_mem a.property (edgeDefect_mem_edge u v i))⟩ + have hc := fresh_C_contraction u v {i} n j hni hji b + rw [ite_eq_right hnj] at hc + change star (C u v n)*((a : Operator ι)*edgeDefect u v i)*C u v j=0 at hc + rw [weightedDefectCreation] + calc + _ = (star (C u v n)*((a : Operator ι)*edgeDefect u v i)*C u v j)*edgeDefect u v i := by + simp only [mul_assoc] + _ = 0 := by rw [hc,zero_mul] + +def filledEdgeAlgebra (u v : ℝ) (i j : ι) : StarSubalgebra ℂ (Operator ι) := + Bicommutant.algebra (insert (weightedDefectCreation u v i j+star (weightedDefectCreation u v i j)) + (edgeAlgebra u v i : Set (Operator ι))) + +theorem fresh_C_filled_contraction (u v : ℝ) (i j n m : ι) (hji : j≠i) + (hni : n≠i) (hnj : n≠j) (hmi : m≠i) (hmj : m≠j) (T : filledEdgeAlgebra u v i j) : + star (C u v n)*(T : Operator ι)*C u v m= + if n=m then vacuumTrace u v (T : Operator ι) • 1 else 0 := by + have hD := weightedDefect_annihilates_edge u v i j hji + have hR (a : edgeAlgebra u v i) : star (weightedDefectCreation u v i j)*(a : Operator ι)*C u v m=0 := by + have hh := congrArg star (fresh_C_weightedDefect u v i j m hji hmi hmj (star a)) + simpa only [star_mul,star_star,StarMemClass.coe_star,star_zero (Operator ι),mul_assoc] using hh + have hb (a : edgeAlgebra u v i) : star (C u v n)*(a : Operator ι)*C u v m= + (inner ℂ (vacuum u v) ((a : Operator ι) (vacuum u v))) • (if n=m then (1 : Operator ι) else 0) := by + have hh := fresh_C_contraction u v {i} n m hni hmi + ⟨a,edgeAlgebra_le_old u v {i} i (Set.mem_singleton i) a.property⟩ + split_ifs with h <;> simpa only [vacuumTrace,h,ite_true,ite_false, + smul_zero (M := ℂ) (A := Operator ι)] using hh + have hh := GaussianExtension.covariance_extension (edgeAlgebra u v i) (weightedDefectCreation u v i j) + (defectCovariance u v i) (weightedDefect_contraction u v i j hji) + (C u v n) (C u v m) (if n=m then (1 : Operator ι) else 0) (vacuum u v) (vacuum u v) + hD hD (fresh_C_weightedDefect u v i j n hji hni hnj) hR hb (T : Operator ι) T.property + split_ifs with h <;> simpa only [vacuumTrace,h,ite_true,ite_false, + smul_zero (M := ℂ) (A := Operator ι)] using hh + +theorem fresh_C_filled_annihilation (u v : ℝ) (i j n : ι) (hji : j≠i) (hni : n≠i) (hnj : n≠j) + (T : filledEdgeAlgebra u v i j) : star (C u v n) ((T : Operator ι) (vacuum u v))=0 := by + apply GaussianExtension.annihilation_extension (edgeAlgebra u v i) (weightedDefectCreation u v i j) + (defectCovariance u v i) (weightedDefect_contraction u v i j hji) + (C u v n) (vacuum u v) (weightedDefect_annihilates_edge u v i j hji) + _ (fresh_C_weightedDefect u v i j n hji hni hnj) (T : Operator ι) T.property + intro a + exact fresh_C_annihilates_old_vacuum u v {i} n hni + ⟨a,edgeAlgebra_le_old u v {i} i (Set.mem_singleton i) a.property⟩ +end +section +open FreeFock +variable {ι : Type u_2} [DecidableEq ι] + +theorem edgeAlgebra_le_ambient (u v : ℝ) (i : ι) : edgeAlgebra u v i≤ambientAlgebra u v := by + apply Bicommutant.generated_le + rintro T (rfl|hT) + · exact P_mem_ambient u v + · have he : T=offDiagonal u v i+star (offDiagonal u v i) := hT + rw [he] + exact add_mem (offDiagonal_mem_ambient u v i) (star_mem (offDiagonal_mem_ambient u v i)) + +theorem edgeAlgebra_le_filled (u v : ℝ) (i j : ι) : edgeAlgebra u v i≤filledEdgeAlgebra u v i j := + fun _ h => Bicommutant.subset _ (Set.mem_insert_of_mem _ h) + +theorem weightedDefect_semicircle_mem_filled (u v : ℝ) (i j : ι) : + weightedDefectCreation u v i j+star (weightedDefectCreation u v i j)∈filledEdgeAlgebra u v i j := + Bicommutant.subset _ (Set.mem_insert _ _) + +theorem filledEdgeAlgebra_le_ambient (u v : ℝ) (i j : ι) : filledEdgeAlgebra u v i j≤ambientAlgebra u v := by + apply Bicommutant.generated_le + rintro T (rfl|hT) + · have he : weightedDefectCreation u v i j+star (weightedDefectCreation u v i j)= + edgeDefect u v i*S u v j*edgeDefect u v i := by + simp only [weightedDefectCreation,S_eq,star_mul,(edgeDefect_projection u v i).isSelfAdjoint.star_eq, + mul_add,add_mul,mul_assoc] + rw [he] + have hd := edgeAlgebra_le_ambient u v i (edgeDefect_mem_edge u v i) + exact mul_mem (mul_mem hd (S_mem_ambient u v j)) hd + · exact edgeAlgebra_le_ambient u v i hT + +theorem weightedDefectCreation_eq (u v : ℝ) (i j : ι) : + weightedDefectCreation u v i j=(u:ℂ) • defectCreation u v i j := by + have he : P*C u v j*P=(u:ℂ) • edgeCreation j true true := by + simp only [C,mul_add,mul_smul_comm,smul_mul_assoc,P_creation_true,P_creation_false, + smul_zero (M := ℂ) (A := Operator ι),add_zero,edgeCreation,vertex_true] + calc + _ = edgeDefect u v i*(P*C u v j*P)*edgeDefect u v i := by + simp only [weightedDefectCreation,mul_assoc,P_mul_edgeDefect] + rw [← mul_assoc (edgeDefect u v i) P,edgeDefect_mul_P] + _ = _ := by rw [he,mul_smul_comm,smul_mul_assoc]; rfl + +theorem defectSemicircle_mem_filled (u v : ℝ) (hu : u≠0) (i j : ι) : + defectSemicircle u v i j∈filledEdgeAlgebra u v i j := by + have he : weightedDefectCreation u v i j+star (weightedDefectCreation u v i j)= + (u:ℂ) • defectSemicircle u v i j := by + simp only [weightedDefectCreation_eq,star_smul,Complex.star_def,Complex.conj_ofReal, + defectSemicircle,smul_add] + have hh := (filledEdgeAlgebra u v i j).smul_mem (weightedDefect_semicircle_mem_filled u v i j) (u:ℂ)⁻¹ + rw [he,smul_smul,inv_mul_cancel₀ (Complex.ofReal_ne_zero.mpr hu),one_smul] at hh + exact hh + +theorem diffuseBase_le_filled (u v : ℝ) (hu : u≠0) (i j : ι) : + diffuseBase u v i j≤filledEdgeAlgebra u v i j := by + apply Bicommutant.generated_le + rintro T (rfl|hT) + · exact edgeAlgebra_le_filled u v i j (P_mem_edge u v i) + · have he : T=oldBaseGenerator u v i j := hT + rw [he,oldBaseGenerator] + apply add_mem + · apply add_mem + · exact edgeAlgebra_le_filled u v i j + (mul_mem (offDiagonal_mem_edge u v i) (star_mem (edgePolar_mem_edge u v i))) + · exact defectSemicircle_mem_filled u v hu i j + · exact (filledEdgeAlgebra u v i j).smul_mem + (edgeAlgebra_le_filled u v i j (edgeRange_mem_edge u v i)) _ +end + +open FreeFock +variable {ι : Type u_3} [DecidableEq ι] + +theorem edgePolar_mul_P (u v : ℝ) (i : ι) : edgePolar u v i*P=0 := + CornerRerouting.right_zero (edgePolar_right u v i) + +theorem P_mul_star_edgePolar (u v : ℝ) (i : ι) : P*star (edgePolar u v i)=0 := + CornerRerouting.star_left_zero projection_P.isSelfAdjoint (edgePolar_mul_P u v i) + +def supportedLeg (u v : ℝ) (i₀ : ι) (r : Bool) : Operator ι := + if r then edgePolar u v i₀ else P + +def legSupport (u v : ℝ) (i₀ : ι) (r : Bool) : Operator ι := + if r then edgeRange u v i₀ else P + +theorem supportedLeg_mem_edge (u v : ℝ) (i : ι) (r : Bool) : + supportedLeg u v i r∈edgeAlgebra u v i := by + cases r + · exact P_mem_edge u v i + · exact edgePolar_mem_edge u v i + +theorem supportedLeg_mem_ambient (u v : ℝ) (i : ι) (r : Bool) : + supportedLeg u v i r∈ambientAlgebra u v := + edgeAlgebra_le_ambient u v i (supportedLeg_mem_edge u v i r) + +theorem supportedLeg_mul_star (u v : ℝ) (i : ι) (r s : Bool) : + supportedLeg u v i r*star (supportedLeg u v i s)= + if r=s then legSupport u v i r else 0 := by + cases r <;> cases s <;> + simp only [supportedLeg,legSupport,Bool.false_eq_true,ite_false,ite_true, + projection_P.isSelfAdjoint.star_eq,projection_P.isIdempotentElem.eq, + P_mul_star_edgePolar,edgePolar_mul_P,Bool.true_eq_false,edgeRange] + +theorem supportedLeg_trace_covariance (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i : ι) (r s : Bool) (T : ambientAlgebra (ι := ι) u v) : + vacuumTrace u v (star (supportedLeg u v i r)*(T : Operator ι)*supportedLeg u v i s)= + if r=s then vacuumTrace u v ((T : Operator ι)*legSupport u v i r) else 0 := by + have ht := ambient_trace_mul u v hu hv + ⟨star (supportedLeg u v i r),star_mem (supportedLeg_mem_ambient u v i r)⟩ + (T*⟨supportedLeg u v i s,supportedLeg_mem_ambient u v i s⟩) + change vacuumTrace u v (star (supportedLeg u v i r)*((T : Operator ι)*supportedLeg u v i s))= + vacuumTrace u v (((T : Operator ι)*supportedLeg u v i s)*star (supportedLeg u v i r)) at ht + rw [mul_assoc,ht,mul_assoc,supportedLeg_mul_star] + by_cases h : r=s + · subst s + simp only [ite_true] + · simp only [h,Ne.symm h,ite_false,mul_zero,vacuumTrace,zero_apply,inner_zero_right] + +def supportedCreation (u v : ℝ) (i₀ i : ι) (r s : Bool) : Operator ι := + supportedLeg u v i₀ r*C u v i*star (supportedLeg u v i₀ s) + +theorem supportedCreation_filled_covariance (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i j n m : ι) (hji : j≠i) (hni : n≠i) (hnj : n≠j) (hmi : m≠i) (hmj : m≠j) + (r s r' s' : Bool) (T : filledEdgeAlgebra u v i j) : + star (supportedCreation u v i n r s)*(T : Operator ι)*supportedCreation u v i m r' s'= + if n=m ∧ r=r' ∧ s=s' then + vacuumTrace u v ((T : Operator ι)*legSupport u v i r) • legSupport u v i s else 0 := by + let a (b : Bool) : filledEdgeAlgebra u v i j := + ⟨supportedLeg u v i b,edgeAlgebra_le_filled u v i j (supportedLeg_mem_edge u v i b)⟩ + have hc := fresh_C_filled_contraction u v i j n m hji hni hnj hmi hmj (star (a r)*T*a r') + change star (C u v n)*(star (supportedLeg u v i r)*(T : Operator ι)*supportedLeg u v i r')*C u v m=_ at hc + calc + _ = supportedLeg u v i s*(star (C u v n)* + (star (supportedLeg u v i r)*(T : Operator ι)*supportedLeg u v i r')*C u v m)* + star (supportedLeg u v i s') := by simp only [supportedCreation,star_mul,star_star,mul_assoc] + _ = _ := by + rw [hc] + change (supportedLeg u v i s*(if n=m then + vacuumTrace u v (star (supportedLeg u v i r)*(T : Operator ι)*supportedLeg u v i r') • 1 else 0)* + star (supportedLeg u v i s'))=_ + rw [supportedLeg_trace_covariance u v hu hv i r r' + ⟨T,filledEdgeAlgebra_le_ambient u v i j T.property⟩] + by_cases hnm : n=m + · rw [ite_eq_left hnm,mul_smul_comm,smul_mul_assoc,mul_one,supportedLeg_mul_star] + by_cases hr : r=r' <;> by_cases hs : s=s' <;> + simp only [hnm,hr,hs,ite_true,ite_false,zero_smul ℂ (A := Operator ι), + smul_zero (M := ℂ) (A := Operator ι),true_and,false_and,and_false] + · simp only [hnm,ite_false,mul_zero,zero_mul,false_and] + +theorem supportedCreation_filled_annihilation (u v : ℝ) + (i j n : ι) (hji : j≠i) (hni : n≠i) (hnj : n≠j) + (r s : Bool) (T : filledEdgeAlgebra u v i j) : + star (supportedCreation u v i n r s) ((T : Operator ι) (vacuum u v))=0 := by + let a : filledEdgeAlgebra u v i j := + ⟨star (supportedLeg u v i r),star_mem + (edgeAlgebra_le_filled u v i j (supportedLeg_mem_edge u v i r))⟩*T + have hh := fresh_C_filled_annihilation u v i j n hji hni hnj a + simp only [supportedCreation,star_mul,star_star,mul_apply_eq_comp] + change supportedLeg u v i s (star (C u v n) ((a : Operator ι) (vacuum u v)))=0 + rw [hh,map_zero] + +def pVacuumTrace (u v : ℝ) (T : Operator ι) : ℂ := (u:ℂ)⁻¹*(u:ℂ)⁻¹*vacuumTrace u v T + +def normalizedCreation (u v : ℝ) (i n : ι) (r s : Bool) : Operator ι := + (u:ℂ)⁻¹ • supportedCreation u v i n r s + +theorem normalizedCreation_filled_covariance (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i j n m : ι) (hji : j≠i) (hni : n≠i) (hnj : n≠j) (hmi : m≠i) (hmj : m≠j) + (r s r' s' : Bool) (T : filledEdgeAlgebra u v i j) : + star (normalizedCreation u v i n r s)*(T : Operator ι)*normalizedCreation u v i m r' s'= + if n=m ∧ r=r' ∧ s=s' then + pVacuumTrace u v ((T : Operator ι)*legSupport u v i r) • legSupport u v i s else 0 := by + simp only [normalizedCreation,star_smul,Complex.star_def,map_inv₀,Complex.conj_ofReal, + smul_mul_assoc,mul_smul_comm] + rw [supportedCreation_filled_covariance u v hu hv i j n m hji hni hnj hmi hmj] + split_ifs <;> simp only [smul_zero (M := ℂ) (A := Operator ι),smul_smul,pVacuumTrace,mul_assoc] + +theorem supportedCreation_paired (u v : ℝ) (i n : ι) (r s : Bool) : + supportedCreation u v i n r s+star (supportedCreation u v i n s r)= + supportedLeg u v i r*S u v n*star (supportedLeg u v i s) := by + simp only [supportedCreation,S_eq,star_mul,star_star,mul_add,add_mul,mul_assoc] + +theorem normalizedCreation_paired_mem (u v : ℝ) (i n : ι) (r s : Bool) : + normalizedCreation u v i n r s+star (normalizedCreation u v i n s r)∈ambientAlgebra u v := by + simp only [normalizedCreation,star_smul,Complex.star_def,map_inv₀,Complex.conj_ofReal, + ← smul_add (M := ℂ) (A := Operator ι)] + rw [supportedCreation_paired] + exact (ambientAlgebra u v).smul_mem + (mul_mem (mul_mem (supportedLeg_mem_ambient u v i r) (S_mem_ambient u v n)) + (star_mem (supportedLeg_mem_ambient u v i s))) _ +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Gaussian.lean b/lean/OAI/Analysis/InterpolatedFactors/Gaussian.lean new file mode 100644 index 0000000000000000000000000000000000000000..573b5e633516ee951effa2409827c1b3a2a255be --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Gaussian.lean @@ -0,0 +1,393 @@ +import OAI.Analysis.InterpolatedFactors.Diffuse + +namespace OAI + +universe u_1 u_2 u_3 u_4 u_5 + +noncomputable section +namespace FreeGroupFactorMain +variable {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +def algebraCyclic (A : StarSubalgebra ℂ (E →L[ℂ] E)) (ξ : E) : Submodule ℂ E where + carrier := {η | ∃ T ∈ A, T ξ=η} + zero_mem' := ⟨0,A.zero_mem,rfl⟩ + add_mem' := by + rintro x y ⟨S,hS,rfl⟩ ⟨T,hT,rfl⟩ + exact ⟨S+T,A.add_mem hS hT,rfl⟩ + smul_mem' := by + rintro c x ⟨T,hT,rfl⟩ + exact ⟨c • T,A.smul_mem hT c,rfl⟩ + + theorem algebraCyclic_invariant (A : StarSubalgebra ℂ (E →L[ℂ] E)) (ξ : E) + (T : E →L[ℂ] E) (hT : T ∈ A) {η : E} (hη : η ∈ algebraCyclic A ξ) : + T η ∈ algebraCyclic A ξ := by + obtain ⟨S,hS,rfl⟩ := hη + exact ⟨T*S,A.mul_mem hT hS,rfl⟩ + + theorem algebraCyclic_closure_invariant (A : StarSubalgebra ℂ (E →L[ℂ] E)) (ξ : E) + (T : E →L[ℂ] E) (hT : T ∈ A) {η : E} (hη : η ∈ (algebraCyclic A ξ).topologicalClosure) : + T η ∈ (algebraCyclic A ξ).topologicalClosure := by + exact closure_minimal (t := {x : E | T x ∈ (algebraCyclic A ξ).topologicalClosure}) + (fun x hx => (algebraCyclic A ξ).le_topologicalClosure (algebraCyclic_invariant A ξ T hT hx)) + ((algebraCyclic A ξ).isClosed_topologicalClosure.preimage T.continuous) hη + + theorem projection_commutes_of_invariant (K : Submodule ℂ E) [K.HasOrthogonalProjection] + (T : E →L[ℂ] E) (hT : ∀ η ∈ K, T η ∈ K) + (hTs : ∀ η ∈ K, (star T) η ∈ K) : Commute K.starProjection T := by + apply ContinuousLinearMap.ext + intro η + change K.starProjection (T η)=T (K.starProjection η) + apply K.eq_starProjection_of_mem_of_inner_eq_zero (hT _ (K.starProjection_apply_mem η)) + intro z hz + rw [← map_sub,← ContinuousLinearMap.adjoint_inner_right] + exact K.starProjection_inner_eq_zero η _ (hTs _ hz) + + theorem bicommutant_vector_mem_cyclic (S : Set (E →L[ℂ] E)) (ξ : E) + (T : E →L[ℂ] E) + (hT : T ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ S : Set (E →L[ℂ] E))) : + T ξ ∈ (algebraCyclic (StarAlgebra.adjoin ℂ S) ξ).topologicalClosure := by + let A := StarAlgebra.adjoin ℂ S + let K := (algebraCyclic A ξ).topologicalClosure + have hP : K.starProjection ∈ StarSubalgebra.centralizer ℂ S := by + rw [StarSubalgebra.mem_centralizer_iff] + intro U hU + have hUa : U ∈ A := StarAlgebra.subset_adjoin ℂ S hU + have hc (V : E →L[ℂ] E) (hV : V ∈ A) : Commute K.starProjection V := + projection_commutes_of_invariant K V + (fun _ h => algebraCyclic_closure_invariant A ξ V hV h) + (fun _ h => algebraCyclic_closure_invariant A ξ (star V) (star_mem hV) h) + exact ⟨(hc U hUa).eq.symm,(hc (star U) (star_mem hUa)).eq.symm⟩ + have hξ : ξ ∈ K := (algebraCyclic A ξ).le_topologicalClosure ⟨1,A.one_mem,rfl⟩ + have hc := DFunLike.congr_fun (((StarSubalgebra.mem_centralizer_iff ℂ).mp hT _ hP).1) ξ + change K.starProjection (T ξ)=T (K.starProjection ξ) at hc + rw [K.starProjection_eq_self_iff.mpr hξ] at hc + exact K.starProjection_eq_self_iff.mp hc +end FreeGroupFactorMain +namespace FreeGroupFactorMain.PairCyclic + +section +variable {E : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℂ E] +local notation "Pair" => WithLp 2 (E × E) +local notation "Op" => (E →L[ℂ] E) + +def diag (T : Op) : Pair →L[ℂ] Pair := + (WithLp.prodContinuousLinearEquiv 2 ℂ E E).symm.toContinuousLinearMap ∘L + T.prodMap T ∘L (WithLp.prodContinuousLinearEquiv 2 ℂ E E).toContinuousLinearMap + +theorem diag_apply (T : Op) (x : Pair) : diag T x=WithLp.toLp 2 (T x.fst,T x.snd) := rfl + +theorem diag_star [CompleteSpace E] (T : Op) : star (diag T)=diag (star T) := by + rw [ContinuousLinearMap.star_eq_adjoint] + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro x y + simp only [diag_apply,WithLp.prod_inner_apply, + ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_left] + rfl + +def coord (i : Bool) : Pair →L[ℂ] E := + if i then WithLp.sndL 2 ℂ E E else WithLp.fstL 2 ℂ E E + +def embed (i : Bool) : E →L[ℂ] Pair := + (WithLp.prodContinuousLinearEquiv 2 ℂ E E).symm.toContinuousLinearMap ∘L + (if i then ContinuousLinearMap.inr ℂ E E else ContinuousLinearMap.inl ℂ E E) + +theorem coord_diag (i : Bool) (T : Op) (x : Pair) : coord i (diag T x)=T (coord i x) := by + cases i <;> rfl + +theorem diag_embed (i : Bool) (T : Op) (x : E) : diag T (embed i x)=embed i (T x) := by + cases i <;> apply (WithLp.prodContinuousLinearEquiv 2 ℂ E E).injective <;> + simp [diag,embed,ContinuousLinearMap.prodMap] + +theorem pair_decompose (x : Pair) : x=embed false (coord false x)+embed true (coord true x) := by + apply (WithLp.prodContinuousLinearEquiv 2 ℂ E E).injective + simp [embed,coord] + rfl + +def block (Q : Pair →L[ℂ] Pair) (i j : Bool) : Op := coord i ∘L Q ∘L embed j + +theorem block_commute {Q : Pair →L[ℂ] Pair} {T : Op} (h : Commute Q (diag T)) (i j : Bool) : + Commute (block Q i j) T := by + ext x + have hh := congrArg (fun y : Pair => coord i y) (DFunLike.congr_fun h.eq (embed j x)) + simpa only [mul_apply_eq_comp,diag_embed,coord_diag,block,ContinuousLinearMap.comp_apply] using hh + +theorem diag_commute_of_blocks {Q : Pair →L[ℂ] Pair} {T : Op} + (h : ∀ i j, Commute (block Q i j) T) : Commute Q (diag T) := by + ext x + have hc (i : Bool) : coord i (Q (diag T x))=coord i (diag T (Q x)) := by + have hh (j : Bool) := DFunLike.congr_fun (h i j).eq (coord j x) + simp only [mul_apply_eq_comp,block,ContinuousLinearMap.comp_apply] at hh + rw [coord_diag, pair_decompose x, map_add,map_add,map_add,map_add,diag_embed,diag_embed, + hh false,hh true] + simp only [map_add] + apply (WithLp.prodContinuousLinearEquiv 2 ℂ E E).injective + exact Prod.ext (hc false) (hc true) + +variable [CompleteSpace E] + +def orbit (A : StarSubalgebra ℂ Op) (x : Pair) : Submodule ℂ Pair where + carrier := {y | ∃ T∈A,diag T x=y} + zero_mem' := ⟨0,A.zero_mem,by apply (WithLp.prodContinuousLinearEquiv 2 ℂ E E).injective; rfl⟩ + add_mem' := by + rintro y z ⟨S,hS,rfl⟩ ⟨T,hT,rfl⟩ + exact ⟨S+T,add_mem hS hT,rfl⟩ + smul_mem' := by + rintro c y ⟨T,hT,rfl⟩ + exact ⟨c • T,A.smul_mem hT c,rfl⟩ + +theorem orbit_invariant (A : StarSubalgebra ℂ Op) (x : Pair) (T : Op) (hT : T∈A) + {y : Pair} (hy : y∈orbit A x) : diag T y∈orbit A x := by + obtain ⟨S,hS,rfl⟩ := hy + exact ⟨T*S,mul_mem hT hS,rfl⟩ + +theorem closure_invariant (A : StarSubalgebra ℂ Op) (x : Pair) (T : Op) (hT : T∈A) + {y : Pair} (hy : y∈(orbit A x).topologicalClosure) : diag T y∈(orbit A x).topologicalClosure := by + exact closure_minimal (t := {y : Pair | diag T y∈(orbit A x).topologicalClosure}) + (fun y hy => (orbit A x).le_topologicalClosure (orbit_invariant A x T hT hy)) + ((orbit A x).isClosed_topologicalClosure.preimage (diag T).continuous) hy + +theorem bicommutant_mem_closure (S : Set Op) (x : Pair) (T : Op) + (hT : T∈StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ S : Set Op)) : + diag T x∈(orbit (StarAlgebra.adjoin ℂ S) x).topologicalClosure := by + let A := StarAlgebra.adjoin ℂ S + let K := (orbit A x).topologicalClosure + have hc (U : Op) (hU : U∈A) : Commute K.starProjection (diag U) := + projection_commutes_of_invariant K (diag U) + (fun _ hy => closure_invariant A x U hU hy) + (fun y hy => by rw [diag_star]; exact closure_invariant A x (star U) (star_mem hU) hy) + have hb (i j : Bool) : block K.starProjection i j∈StarSubalgebra.centralizer ℂ S := by + rw [StarSubalgebra.mem_centralizer_iff] + intro U hU + have hUa : U∈A := StarAlgebra.subset_adjoin ℂ S hU + exact ⟨(block_commute (hc U hUa) i j).symm.eq, + (block_commute (hc (star U) (star_mem hUa)) i j).symm.eq⟩ + have hcomm : Commute K.starProjection (diag T) := diag_commute_of_blocks (fun i j => + (((StarSubalgebra.mem_centralizer_iff ℂ).mp hT _ (hb i j)).1)) + have hx : x∈K := (orbit A x).le_topologicalClosure ⟨1,A.one_mem,rfl⟩ + have he := DFunLike.congr_fun hcomm.eq x + change K.starProjection (diag T x)=diag T (K.starProjection x) at he + rw [K.starProjection_eq_self_iff.mpr hx] at he + exact K.starProjection_eq_self_iff.mp he + +end +variable {E : Type u_3} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +local notation "Pair" => WithLp 2 (E × E) +local notation "Op" => (E →L[ℂ] E) + +theorem invariant_bicommutant (S : Set Op) (K : Submodule ℂ Pair) [K.HasOrthogonalProjection] + (hS : ∀ U∈S, ∀ y∈K, diag U y∈K) + (hSs : ∀ U∈S, ∀ y∈K, diag (star U) y∈K) + (T : Op) (hT : T∈StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ S : Set Op)) + (x : Pair) (hx : x∈K) : diag T x∈K := by + have hc (U : Op) (hU : U∈S) : Commute K.starProjection (diag U) := + projection_commutes_of_invariant K (diag U) (hS U hU) + (fun y hy => by rw [diag_star]; exact hSs U hU y hy) + have hcs (U : Op) (hU : U∈S) : Commute K.starProjection (diag (star U)) := by + have hs := (hc U hU).star_star + simpa only [(isSelfAdjoint_starProjection K).star_eq,diag_star] using hs + have hb (i j : Bool) : block K.starProjection i j∈StarSubalgebra.centralizer ℂ S := by + rw [StarSubalgebra.mem_centralizer_iff] + intro U hU + exact ⟨(block_commute (hc U hU) i j).symm.eq,(block_commute (hcs U hU) i j).symm.eq⟩ + have hcomm := diag_commute_of_blocks (fun i j => + (((StarSubalgebra.mem_centralizer_iff ℂ).mp hT _ (hb i j)).1)) + have he := DFunLike.congr_fun hcomm.eq x + change K.starProjection (diag T x)=diag T (K.starProjection x) at he + rw [K.starProjection_eq_self_iff.mpr hx] at he + exact K.starProjection_eq_self_iff.mp he +end FreeGroupFactorMain.PairCyclic +namespace FreeGroupFactorMain.GaussianExtension + +section +variable {E : Type u_4} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +local notation "Pair" => WithLp 2 (E × E) +variable (B : StarSubalgebra ℂ (E →L[ℂ] E)) (D : E →L[ℂ] E) + +def creationWord (ξ : E) (a : B) (w : List B) : E := + (a : (E →L[ℂ] E)) (w.foldr (fun b y => D ((b : (E →L[ℂ] E)) y)) ξ) + +def pairNormal (ξ η : E) (w : B × List B) : Pair := + WithLp.toLp 2 (creationWord B D ξ w.1 w.2,creationWord B D η w.1 w.2) + +def creationWordSpan (ξ η : E) : Submodule ℂ Pair := + Submodule.span ℂ (Set.range (pairNormal B D ξ η)) + +theorem creationWord_coeff (ξ : E) (a b : B) (w : List B) : + (a : (E →L[ℂ] E)) (creationWord B D ξ b w)=creationWord B D ξ (a*b) w := by + cases w <;> rfl + +theorem creationWord_create (ξ : E) (a : B) (w : List B) : + D (creationWord B D ξ a w)=creationWord B D ξ 1 (a::w) := rfl + +variable (κ : B → B) (hκ : ∀ a : B,star D*(a : (E →L[ℂ] E))*D=(κ a : (E →L[ℂ] E))) + +theorem creationWord_annihilate_nil (ξ : E) (hξ : ∀ a : B,star D ((a : (E →L[ℂ] E)) ξ)=0) (a : B) : + star D (creationWord B D ξ a [])=0 := hξ a + +include hκ in +theorem creationWord_annihilate_cons (ξ : E) (a b : B) (w : List B) : + star D (creationWord B D ξ a (b::w))=creationWord B D ξ (κ a*b) w := by + have hh := DFunLike.congr_fun (hκ a) (creationWord B D ξ b w) + exact hh + +theorem pairNormal_coeff (ξ η : E) (a : B) (w : B × List B) : + PairCyclic.diag (a : (E →L[ℂ] E)) (pairNormal B D ξ η w)=pairNormal B D ξ η (a*w.1,w.2) := by + simp only [pairNormal,PairCyclic.diag_apply,WithLp.toLp_fst,WithLp.toLp_snd,creationWord_coeff] + +theorem pairNormal_create (ξ η : E) (w : B × List B) : + PairCyclic.diag D (pairNormal B D ξ η w)=pairNormal B D ξ η (1,w.1::w.2) := by + simp only [pairNormal,PairCyclic.diag_apply,WithLp.toLp_fst,WithLp.toLp_snd,creationWord_create] + +include hκ in +theorem pairNormal_semicircle_mem (ξ η : E) + (hξ : ∀ a : B,star D ((a : (E →L[ℂ] E)) ξ)=0) (hη : ∀ a : B,star D ((a : (E →L[ℂ] E)) η)=0) + (w : B × List B) : PairCyclic.diag (D+star D) (pairNormal B D ξ η w)∈creationWordSpan B D ξ η := by + have hcreate : PairCyclic.diag D (pairNormal B D ξ η w)∈creationWordSpan B D ξ η := by + rw [pairNormal_create] + exact Submodule.subset_span (Set.mem_range_self _) + have hann : PairCyclic.diag (star D) (pairNormal B D ξ η w)∈creationWordSpan B D ξ η := by + rcases w with ⟨a,w⟩ + cases w with + | nil => + have hz : PairCyclic.diag (star D) (pairNormal B D ξ η (a,[]))=0 := by + simp only [pairNormal,PairCyclic.diag_apply,WithLp.toLp_fst,WithLp.toLp_snd, + creationWord_annihilate_nil B D ξ hξ,creationWord_annihilate_nil B D η hη] + rfl + rw [hz] + exact (creationWordSpan B D ξ η).zero_mem + | cons b w => + have he : PairCyclic.diag (star D) (pairNormal B D ξ η (a,b::w))= + pairNormal B D ξ η (κ a*b,w) := by + simp only [pairNormal,PairCyclic.diag_apply,WithLp.toLp_fst,WithLp.toLp_snd, + creationWord_annihilate_cons B D κ hκ] + rw [he] + exact Submodule.subset_span (Set.mem_range_self _) + exact (creationWordSpan B D ξ η).add_mem hcreate hann + +theorem span_invariant_of_family (ξ η : E) (T : (E →L[ℂ] E)) + (hT : ∀ w,PairCyclic.diag T (pairNormal B D ξ η w)∈creationWordSpan B D ξ η) + (z : Pair) (hz : z∈creationWordSpan B D ξ η) : PairCyclic.diag T z∈creationWordSpan B D ξ η := by + have hh : creationWordSpan B D ξ η≤(creationWordSpan B D ξ η).comap (PairCyclic.diag T).toLinearMap := by + apply Submodule.span_le.mpr + rintro _ ⟨w,rfl⟩ + exact hT w + exact hh hz + +theorem closure_invariant_of_family (ξ η : E) (T : (E →L[ℂ] E)) + (hT : ∀ w,PairCyclic.diag T (pairNormal B D ξ η w)∈creationWordSpan B D ξ η) + (z : Pair) (hz : z∈(creationWordSpan B D ξ η).topologicalClosure) : + PairCyclic.diag T z∈(creationWordSpan B D ξ η).topologicalClosure := by + exact closure_minimal (t := {z : Pair | PairCyclic.diag T z∈(creationWordSpan B D ξ η).topologicalClosure}) + (fun z hz => (creationWordSpan B D ξ η).le_topologicalClosure (span_invariant_of_family B D ξ η T hT z hz)) + ((creationWordSpan B D ξ η).isClosed_topologicalClosure.preimage (PairCyclic.diag T).continuous) hz + +include hκ in +theorem bicommutant_pair_creationWord (ξ η : E) + (hξ : ∀ a : B,star D ((a : (E →L[ℂ] E)) ξ)=0) (hη : ∀ a : B,star D ((a : (E →L[ℂ] E)) η)=0) + (T : (E →L[ℂ] E)) + (hT : T∈StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert (D+star D) (B : Set (E →L[ℂ] E))) : Set (E →L[ℂ] E))) : + PairCyclic.diag T (WithLp.toLp 2 (ξ,η))∈(creationWordSpan B D ξ η).topologicalClosure := by + have hS (U : (E →L[ℂ] E)) (hU : U∈insert (D+star D) (B : Set (E →L[ℂ] E))) : + ∀ z∈(creationWordSpan B D ξ η).topologicalClosure, + PairCyclic.diag U z∈(creationWordSpan B D ξ η).topologicalClosure := by + apply closure_invariant_of_family B D ξ η U + intro w + rcases hU with rfl|hU + · exact pairNormal_semicircle_mem B D κ hκ ξ η hξ hη w + · rw [pairNormal_coeff B D ξ η ⟨U,hU⟩] + exact Submodule.subset_span (Set.mem_range_self _) + have hSs (U : (E →L[ℂ] E)) (hU : U∈insert (D+star D) (B : Set (E →L[ℂ] E))) : + star U∈insert (D+star D) (B : Set (E →L[ℂ] E)) := by + rcases hU with rfl|hU + · rw [(IsSelfAdjoint.add_star_self D).star_eq] + exact Set.mem_insert _ _ + · exact Set.mem_insert_of_mem _ (star_mem hU) + apply PairCyclic.invariant_bicommutant _ (creationWordSpan B D ξ η).topologicalClosure hS + (fun U hU => hS (star U) (hSs U hU)) T hT + apply (creationWordSpan B D ξ η).le_topologicalClosure + exact Submodule.subset_span ⟨(1,[]),rfl⟩ + +def constraint (ξ : E) (L : (E →L[ℂ] E)) (z : E) : Pair →L[ℂ] E := + (star L) ∘L WithLp.fstL 2 ℂ E E- + (ContinuousLinearMap.toSpanSingleton ℂ z) ∘L (innerSL ℂ ξ) ∘L WithLp.sndL 2 ℂ E E + +theorem constraint_apply (ξ : E) (L : (E →L[ℂ] E)) (z : E) (x : Pair) : + constraint ξ L z x=star L x.fst-(inner ℂ ξ x.snd) • z := rfl + +include hκ in + +theorem covariance_extension (L R Q : (E →L[ℂ] E)) (ξ ζ : E) + (hξ : ∀ a : B,star D ((a : (E →L[ℂ] E)) ξ)=0) + (hζ : ∀ a : B,star D ((a : (E →L[ℂ] E)) ζ)=0) + (hL : ∀ a : B,star L*(a : (E →L[ℂ] E))*D=0) + (hR : ∀ a : B,star D*(a : (E →L[ℂ] E))*R=0) + (hbase : ∀ a : B,star L*(a : (E →L[ℂ] E))*R=(inner ℂ ξ ((a : (E →L[ℂ] E)) ζ)) • Q) + (T : (E →L[ℂ] E)) + (hT : T∈StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert (D+star D) (B : Set (E →L[ℂ] E))) : Set (E →L[ℂ] E))) : + star L*T*R=(inner ℂ ξ (T ζ)) • Q := by + ext η + let F := constraint ξ L (Q η) + have hroot : ∀ a : B,star D ((a : (E →L[ℂ] E)) (R η))=0 := by + intro a + have hh := DFunLike.congr_fun (hR a) η + exact hh + have hfamily (w : B × List B) : F (pairNormal B D (R η) ζ w)=0 := by + rcases w with ⟨a,w⟩ + cases w with + | nil => + have hh := DFunLike.congr_fun (hbase a) η + change star L ((a : (E →L[ℂ] E)) (R η))=(inner ℂ ξ ((a : (E →L[ℂ] E)) ζ)) • (Q η) at hh + change star L ((a : (E →L[ℂ] E)) (R η))-(inner ℂ ξ ((a : (E →L[ℂ] E)) ζ)) • (Q η)=0 + exact sub_eq_zero.mpr hh + | cons b w => + have hz : star L ((a : (E →L[ℂ] E)) (D (creationWord B D (R η) b w)))=0 := + DFunLike.congr_fun (hL a) _ + have hi : inner ℂ ξ ((a : (E →L[ℂ] E)) (D (creationWord B D ζ b w)))=0 := by + rw [← ContinuousLinearMap.adjoint_inner_left,← ContinuousLinearMap.adjoint_inner_left] + change inner ℂ (star D (((star a : B) : (E →L[ℂ] E)) ξ)) _=0 + rw [hξ (star a),inner_zero_left] + change star L ((a : (E →L[ℂ] E)) (D (creationWord B D (R η) b w)))- + (inner ℂ ξ ((a : (E →L[ℂ] E)) (D (creationWord B D ζ b w)))) • (Q η)=0 + rw [hz,hi,zero_smul,sub_self] + have hspan : creationWordSpan B D (R η) ζ≤LinearMap.ker F.toLinearMap := by + apply Submodule.span_le.mpr + rintro _ ⟨w,rfl⟩ + exact hfamily w + have hclosure := (creationWordSpan B D (R η) ζ).topologicalClosure_minimal hspan + F.isClosed_ker + have hh := hclosure (bicommutant_pair_creationWord B D κ hκ (R η) ζ hroot hζ T hT) + change star L (T (R η))-(inner ℂ ξ (T ζ)) • (Q η)=0 at hh + exact sub_eq_zero.mp hh + +end +variable {E : Type u_5} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable (B : StarSubalgebra ℂ (E →L[ℂ] E)) (D : E →L[ℂ] E) +variable (κ : B → B) (hκ : ∀ a : B,star D*(a : E →L[ℂ] E)*D=(κ a : E →L[ℂ] E)) +include hκ in + +theorem annihilation_extension (L : E →L[ℂ] E) (ξ : E) + (hDξ : ∀ a : B,star D ((a : E →L[ℂ] E) ξ)=0) + (hLξ : ∀ a : B,star L ((a : E →L[ℂ] E) ξ)=0) + (hLD : ∀ a : B,star L*(a : E →L[ℂ] E)*D=0) + (T : E →L[ℂ] E) + (hT : T∈StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert (D+star D) (B : Set (E →L[ℂ] E))) : Set (E →L[ℂ] E))) : + star L (T ξ)=0 := by + let F := (star L) ∘L WithLp.fstL 2 ℂ E E + have hspan : creationWordSpan B D ξ ξ≤LinearMap.ker F.toLinearMap := by + apply Submodule.span_le.mpr + rintro _ ⟨⟨a,w⟩,rfl⟩ + cases w with + | nil => exact hLξ a + | cons b w => exact DFunLike.congr_fun (hLD a) (creationWord B D ξ b w) + have hclosure := (creationWordSpan B D ξ ξ).topologicalClosure_minimal hspan F.isClosed_ker + exact hclosure (bicommutant_pair_creationWord B D κ hκ ξ ξ hDξ hDξ T hT) +end FreeGroupFactorMain.GaussianExtension + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/GaussianAlgebra.lean b/lean/OAI/Analysis/InterpolatedFactors/GaussianAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..1084c60c8de3dc92f4bd1ccaeeffb6be323c489b --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/GaussianAlgebra.lean @@ -0,0 +1,257 @@ +import OAI.Analysis.InterpolatedFactors.ScalarSystem + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 u_10 + +namespace FreeGroupFactorMain.GaussianRecognition +section Algebraic +variable {A : Type u_1} {B : Type u_2} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] + [Ring B] [StarRing B] [Algebra ℂ B] [StarModule ℂ B] + +theorem centralizer_transport (Φ : A ≃⋆ₐ[ℂ] B) (s : Set A) (T : A) : + Φ T ∈ StarSubalgebra.centralizer ℂ (Φ '' s) ↔ T ∈ StarSubalgebra.centralizer ℂ s := by + rw [StarSubalgebra.mem_centralizer_iff,StarSubalgebra.mem_centralizer_iff] + constructor + · intro h g hg + have hh := h (Φ g) ⟨g,hg,rfl⟩ + constructor + · apply Φ.injective + change Φ (g*T)=Φ (T*g) + simpa only [map_mul] using hh.1 + · apply Φ.injective + change Φ (star g*T)=Φ (T*star g) + simpa only [map_mul,map_star] using hh.2 + · rintro h _ ⟨g,hg,rfl⟩ + exact ⟨by simpa only [map_mul] using congrArg Φ (h g hg).1, + by simpa only [map_mul,map_star] using congrArg Φ (h g hg).2⟩ + +theorem centralizer_image (Φ : A ≃⋆ₐ[ℂ] B) (s : Set A) : + (StarSubalgebra.centralizer ℂ (Φ '' s) : Set B)= + Φ '' (StarSubalgebra.centralizer ℂ s : Set A) := by + ext T + constructor + · intro h + refine ⟨Φ.symm T,?_,Φ.apply_symm_apply T⟩ + apply (centralizer_transport Φ s (Φ.symm T)).mp + rw [Φ.apply_symm_apply] + exact h + · rintro ⟨T,h,rfl⟩ + exact (centralizer_transport Φ s T).mpr h + +theorem bicommutant_transport (Φ : A ≃⋆ₐ[ℂ] B) (s : Set A) (T : A) : + Φ T ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (Φ '' s) : Set B) ↔ + T ∈ StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ s : Set A) := by + rw [centralizer_image,centralizer_transport] +end Algebraic + +variable {E : Type u_3} {F : Type u_4} + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + [NormedAddCommGroup F] [InnerProductSpace ℂ F] [CompleteSpace F] + +@[instance_reducible] def ultraweak (E : Type u_5) [NormedAddCommGroup E] + [InnerProductSpace ℂ E] : TopologicalSpace (Operator E) := + ⨅ (ξ : lp (fun _ : ℕ => E) 2) (η : lp (fun _ : ℕ => E) 2), + TopologicalSpace.induced (fun T : Operator E => ∑' k : ℕ, inner ℂ (η k) (T (ξ k))) inferInstance + +def sequenceMap (W : E ≃ₗᵢ[ℂ] F) (ξ : lp (fun _ : ℕ => E) 2) : lp (fun _ : ℕ => F) 2 := + ⟨fun n => W (ξ n),Memℓp.of_norm (by simpa only [W.norm_map] using (lp.memℓp ξ).norm)⟩ + +theorem spatial_normal (W : E ≃ₗᵢ[ℂ] F) : + @Continuous _ _ (ultraweak E) (ultraweak F) W.conjStarAlgEquiv := by + apply continuous_iInf_rng.mpr + intro ξ + apply continuous_iInf_rng.mpr + intro η + apply continuous_induced_rng.mpr + have heq : + (fun T : Operator E => ∑' k : ℕ,inner ℂ (η k) (W.conjStarAlgEquiv T (ξ k)))= + (fun T : Operator E => ∑' k : ℕ, + inner ℂ (sequenceMap W.symm η k) (T (sequenceMap W.symm ξ k))) := by + funext T + apply tsum_congr + intro k + change inner ℂ (η k) (W (T (W.symm (ξ k)))) = + inner ℂ (W.symm (η k)) (T (W.symm (ξ k))) + rw [← W.inner_map_map] + simp + change @Continuous _ _ (ultraweak E) _ + (fun T : Operator E => ∑' k : ℕ,inner ℂ (η k) (W.conjStarAlgEquiv T (ξ k))) + rw [heq] + exact continuous_iInf_dom (i := sequenceMap W.symm ξ) + (continuous_iInf_dom (i := sequenceMap W.symm η) continuous_induced_dom) + +namespace System +variable {A : Type u_6} {I : Type u_7} [Ring A] [StarRing A] [Algebra ℂ A] +variable {covariance : I → I → A → A} +variable (X : System A E I covariance) (Y : System A F I covariance) +variable + (hstate : ∀ a,inner ℂ Y.root (Y.coeff a Y.root)=inner ℂ X.root (X.coeff a X.root)) + (hX : (Submodule.span ℂ (Set.range X.family)).topologicalClosure=⊤) + (hY : (Submodule.span ℂ (Set.range Y.family)).topologicalClosure=⊤) + +def generators (σ : I → I) : Set (Operator E) := Set.range X.coeff ∪ Set.range (X.generator σ) +def generated (σ : I → I) : StarSubalgebra ℂ (Operator E) := + StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ (X.generators σ) : Set (Operator E)) + +@[instance_reducible] def generatedTopology (σ : I → I) : TopologicalSpace (X.generated σ) := + TopologicalSpace.induced (fun T : X.generated σ => (T : Operator E)) (ultraweak E) + +theorem spatial_generators (σ : I → I) : + (X.spatial Y hstate hX hY).conjStarAlgEquiv '' X.generators σ=Y.generators σ := by + rw [generators, generators, Set.image_union] + congr 1 + · ext T + constructor + · rintro ⟨_,⟨a,rfl⟩,rfl⟩ + exact ⟨a,(spatial_coeff X Y hstate hX hY a).symm⟩ + · rintro ⟨a,rfl⟩ + exact ⟨X.coeff a,⟨a,rfl⟩,spatial_coeff X Y hstate hX hY a⟩ + · ext T + constructor + · rintro ⟨_,⟨i,rfl⟩,rfl⟩ + exact ⟨i,(spatial_generator X Y hstate hX hY σ i).symm⟩ + · rintro ⟨i,rfl⟩ + exact ⟨X.generator σ i,⟨i,rfl⟩,spatial_generator X Y hstate hX hY σ i⟩ + +theorem spatial_generated (σ : I → I) (T : Operator E) : + (X.spatial Y hstate hX hY).conjStarAlgEquiv T ∈ Y.generated σ ↔ T ∈ X.generated σ := by + have hh := bicommutant_transport (X.spatial Y hstate hX hY).conjStarAlgEquiv + (X.generators σ) T + rw [spatial_generators X Y hstate hX hY σ] at hh + exact hh + +def generatedIso (σ : I → I) : X.generated σ ≃⋆ₐ[ℂ] Y.generated σ where + toFun T := ⟨(X.spatial Y hstate hX hY).conjStarAlgEquiv T, + (spatial_generated X Y hstate hX hY σ T).mpr T.property⟩ + invFun T := ⟨(X.spatial Y hstate hX hY).conjStarAlgEquiv.symm T, + (spatial_generated X Y hstate hX hY σ _).mp (by + rw [StarAlgEquiv.apply_symm_apply]; exact T.property)⟩ + left_inv T := Subtype.ext (StarAlgEquiv.symm_apply_apply + (X.spatial Y hstate hX hY).conjStarAlgEquiv (T : Operator E)) + right_inv T := Subtype.ext (StarAlgEquiv.apply_symm_apply + (X.spatial Y hstate hX hY).conjStarAlgEquiv (T : Operator F)) + map_mul' T U := Subtype.ext (map_mul _ (T : Operator E) (U : Operator E)) + map_add' T U := Subtype.ext (map_add _ (T : Operator E) (U : Operator E)) + map_smul' c T := Subtype.ext (map_smul _ c (T : Operator E)) + map_star' T := Subtype.ext (map_star _ (T : Operator E)) + +theorem generatedIso_normal (σ : I → I) : + @Continuous _ _ (X.generatedTopology σ) (Y.generatedTopology σ) + (X.generatedIso Y hstate hX hY σ) := by + let : TopologicalSpace (Operator E) := ultraweak E + let : TopologicalSpace (Operator F) := ultraweak F + let : TopologicalSpace (X.generated σ) := X.generatedTopology σ + let : TopologicalSpace (Y.generated σ) := Y.generatedTopology σ + apply continuous_induced_rng.mpr + have hi : Continuous (fun T : X.generated σ => (T : Operator E)) := continuous_induced_dom + exact (spatial_normal (X.spatial Y hstate hX hY)).comp hi + +theorem generatedIso_trace (σ : I → I) (T : X.generated σ) : + inner ℂ Y.root ((X.generatedIso Y hstate hX hY σ T : Operator F) Y.root)= + inner ℂ X.root ((T : Operator E) X.root) := + X.spatial_trace Y hstate hX hY (T : Operator E) + +end System +end FreeGroupFactorMain.GaussianRecognition + +namespace FreeGroupFactorMain.GaussianRecognition.System +variable {A : Type u_8} {E : Type u_9} {I : Type u_10} [Ring A] [StarRing A] [Algebra ℂ A] +variable [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable {covariance : I → I → A → A} (X : System A E I covariance) + +def normalSpan : Submodule ℂ E := Submodule.span ℂ (Set.range X.family) +def normalHull : Submodule ℂ E := X.normalSpan.topologicalClosure + +instance normalHull_complete : CompleteSpace X.normalHull := by + unfold normalHull + infer_instance + +theorem normal_mem (a : A) (w : List (I×A)) : X.normal a w∈X.normalSpan := + Submodule.subset_span ⟨(a,w),rfl⟩ + +theorem normalSpan_coeff (a : A) {ξ : E} (hξ : ξ∈X.normalSpan) : X.coeff a ξ∈X.normalSpan := by + induction hξ using Submodule.span_induction with + | mem ξ hξ => obtain ⟨⟨b,w⟩,rfl⟩ := hξ; exact (X.coeff_normal a b w) ▸ X.normal_mem (a*b) w + | zero => simpa only [map_zero] using X.normalSpan.zero_mem + | add ξ η _ _ hξ hη => simpa only [map_add] using X.normalSpan.add_mem hξ hη + | smul c ξ _ hξ => simpa only [map_smul] using X.normalSpan.smul_mem c hξ + +theorem normalSpan_create (i : I) {ξ : E} (hξ : ξ∈X.normalSpan) : X.create i ξ∈X.normalSpan := by + induction hξ using Submodule.span_induction with + | mem ξ hξ => obtain ⟨⟨a,w⟩,rfl⟩ := hξ; exact (X.create_normal i a w) ▸ X.normal_mem 1 ((i,a)::w) + | zero => simpa only [map_zero] using X.normalSpan.zero_mem + | add ξ η _ _ hξ hη => simpa only [map_add] using X.normalSpan.add_mem hξ hη + | smul c ξ _ hξ => simpa only [map_smul] using X.normalSpan.smul_mem c hξ + +theorem normalSpan_annihilate (i : I) {ξ : E} (hξ : ξ∈X.normalSpan) : star (X.create i) ξ∈X.normalSpan := by + induction hξ using Submodule.span_induction with + | mem ξ hξ => + obtain ⟨⟨a,w⟩,rfl⟩ := hξ + change star (X.create i) (X.normal a w)∈X.normalSpan + cases w with + | nil => rw [X.annihilate_normal_nil]; exact X.normalSpan.zero_mem + | cons q w => rcases q with ⟨j,b⟩; rw [X.annihilate_normal_cons]; exact X.normal_mem _ _ + | zero => simpa only [map_zero] using X.normalSpan.zero_mem + | add ξ η _ _ hξ hη => simpa only [map_add] using X.normalSpan.add_mem hξ hη + | smul c ξ _ hξ => simpa only [map_smul] using X.normalSpan.smul_mem c hξ + +theorem normalHull_preserve (T : Operator E) (hT : ∀ ξ∈X.normalSpan,T ξ∈X.normalSpan) + {ξ : E} (hξ : ξ∈X.normalHull) : T ξ∈X.normalHull := + closure_minimal (t := {ξ:E | T ξ∈X.normalHull}) + (fun ξ hξ => X.normalSpan.le_topologicalClosure (hT ξ hξ)) + (X.normalSpan.isClosed_topologicalClosure.preimage T.continuous) hξ + +theorem normalHull_root : X.root∈X.normalHull := by + have hh := X.normalSpan.le_topologicalClosure (X.normal_mem 1 []) + simpa only [normal,map_one,one_apply_eq_self,normalHull] using hh + +theorem normalHull_coeff (a : A) {ξ : E} (hξ : ξ∈X.normalHull) : X.coeff a ξ∈X.normalHull := + X.normalHull_preserve _ (fun _ h => X.normalSpan_coeff a h) hξ + +theorem normalHull_create (i : I) {ξ : E} (hξ : ξ∈X.normalHull) : X.create i ξ∈X.normalHull := + X.normalHull_preserve _ (fun _ h => X.normalSpan_create i h) hξ + +theorem normalHull_annihilate (i : I) {ξ : E} (hξ : ξ∈X.normalHull) : star (X.create i) ξ∈X.normalHull := + X.normalHull_preserve _ (fun _ h => X.normalSpan_annihilate i h) hξ + +theorem normalHull_projection_coeff (a : A) : Commute X.normalHull.starProjection (X.coeff a) := by + apply projection_commutes_of_invariant X.normalHull + · exact fun _ h => X.normalHull_coeff a h + · simpa only [← map_star] using (fun ξ h => X.normalHull_coeff (star a) (ξ := ξ) h) + +theorem normalHull_projection_create (i : I) : Commute X.normalHull.starProjection (X.create i) := + projection_commutes_of_invariant X.normalHull _ + (fun _ h => X.normalHull_create i h) (fun _ h => X.normalHull_annihilate i h) + +theorem normalHull_projection_annihilate (i : I) : Commute X.normalHull.starProjection (star (X.create i)) := + projection_commutes_of_invariant X.normalHull _ + (fun _ h => X.normalHull_annihilate i h) (by simpa only [star_star] using (fun ξ h => X.normalHull_create i (ξ := ξ) h)) + +theorem normalHull_projection_generator (σ : I → I) (i : I) : + Commute X.normalHull.starProjection (X.generator σ i) := + (X.normalHull_projection_create i).add_right (X.normalHull_projection_annihilate (σ i)) + +theorem normalHull_bicommutant (σ : I → I) (T : Operator E) (hT : T∈X.generated σ) : T X.root∈X.normalHull := by + have hP : X.normalHull.starProjection∈StarSubalgebra.centralizer ℂ (X.generators σ) := by + rw [StarSubalgebra.mem_centralizer_iff] + intro U hU + rcases hU with ⟨a,rfl⟩ | ⟨i,rfl⟩ + · exact ⟨(X.normalHull_projection_coeff a).eq.symm, + (by simpa only [map_star] using (X.normalHull_projection_coeff (star a)).eq.symm)⟩ + · refine ⟨(X.normalHull_projection_generator σ i).eq.symm,?_⟩ + change star (X.create i+star (X.create (σ i)))*_= _*star (X.create i+star (X.create (σ i))) + rw [star_add (R := Operator E),star_star] + exact ((X.normalHull_projection_annihilate i).add_right (X.normalHull_projection_create (σ i))).eq.symm + have hh := DFunLike.congr_fun ((StarSubalgebra.mem_centralizer_iff ℂ).mp hT _ hP).1 X.root + change X.normalHull.starProjection (T X.root)=T (X.normalHull.starProjection X.root) at hh + rw [X.normalHull.starProjection_eq_self_iff.mpr X.normalHull_root] at hh + exact X.normalHull.starProjection_eq_self_iff.mp hh +end FreeGroupFactorMain.GaussianRecognition.System + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/GroupBridge.lean b/lean/OAI/Analysis/InterpolatedFactors/GroupBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..edee433b4b0532aa6a179136e9eaafca15e7481c --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/GroupBridge.lean @@ -0,0 +1,979 @@ +import OAI.Analysis.InterpolatedFactors.AmbientSystem + +namespace OAI + +noncomputable section + +namespace FreeGroupFactorMain + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 u_10 u_11 u_12 +universe u_13 u_14 u_15 u_16 u_17 u_18 u_19 u_20 u_21 u_22 u_23 u_24 +universe u_25 u_26 u_27 u_28 u_29 u_30 u_31 u_32 u_33 u_34 u_35 u_36 +universe u_37 u_38 u_39 u_40 u_41 u_42 u_43 u_44 u_45 u_46 u_47 u_48 +universe u_49 + +open Filter Topology + +namespace FreeFock +open Filter Topology +open scoped ENNReal +variable {α : Type u_6} [DecidableEq α] + + theorem semicircular_no_eigenprojection (i : α) (z : ℂ) (E : gaussianAlgebra α) + (hE : IsStarProjection (E : Operator α)) + (hA : semicircular i*(E : Operator α)=z • (E : Operator α)) : E=0 := by + have he : semicircular i ((E : Operator α) vacuum)=z • ((E : Operator α) vacuum) := + DFunLike.congr_fun hA vacuum + have hr := semicircular_eigen_root_zero i z _ he + have hvac : (E : Operator α) vacuum=0 := by + apply (inner_self_eq_zero (𝕜 := ℂ)).mp + calc + inner ℂ ((E : Operator α) vacuum) ((E : Operator α) vacuum)= + inner ℂ vacuum (star (E : Operator α) ((E : Operator α) vacuum)) := by + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + _ = inner ℂ vacuum ((E : Operator α) vacuum) := by + rw [hE.isSelfAdjoint.star_eq] + have hh := DFunLike.congr_fun hE.isIdempotentElem.eq vacuum + rw [mul_apply_eq_comp] at hh + rw [hh] + _ = 0 := by simp [vacuum,lp.inner_single_left,RCLike.inner_apply] at hr ⊢;exact hr + exact gaussian_separating E hvac + +end FreeFock +open MeasureTheory Set CompactlySupported +open scoped ENNReal +namespace CyclicSpectral +variable {H : Type u_7} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +local instance : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) +end CyclicSpectral + +open MeasureTheory ProbabilityTheory Filter Set Function +open scoped Topology ENNReal + +namespace CyclicSpectral + +section +open MeasureTheory +variable {H : Type u_19} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +local instance : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) + +end +section +open MeasureTheory Filter +variable {H : Type u_20} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +local instance : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) + +end +open MeasureTheory Filter +variable {H : Type u_21} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +local instance : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) + +end CyclicSpectral +namespace FreeFock + +section +open MeasureTheory +variable {α : Type u_22} [DecidableEq α] +local instance : InnerProductSpace ℝ (Fock α) := InnerProductSpace.rclikeToReal ℂ (Fock α) + +end +open MeasureTheory +variable {α : Type u_23} [DecidableEq α] + +instance semicircular_spectral_probability (i : α) : + IsProbabilityMeasure (CyclicSpectral.measure (semicircular i) (semicircular_selfAdjoint i) vacuum) := by + apply CyclicSpectral.probability + simp [vacuum,lp.norm_single] + +instance semicircular_spectral_diffuse (i : α) : + NullSingletonClass (CyclicSpectral.measure (semicircular i) (semicircular_selfAdjoint i) vacuum) := + semicircular_spectral_noAtoms i + + theorem spectralHaar_mem (i : α) : + (CyclicSpectral.haarUnitary (semicircular i) (semicircular_selfAdjoint i) vacuum : Operator α) + ∈ gaussianAlgebra α := by + apply CyclicSpectral.complexHom_mem + · rw [gaussianAlgebra,StarSubalgebra.coe_centralizer] + exact Set.isClosed_centralizer _ + · exact StarAlgebra.adjoin_le_centralizer_centralizer ℂ _ + (StarAlgebra.subset_adjoin ℂ _ (Set.mem_range_self i)) + +def spectralHaar (i : α) : unitary (gaussianAlgebra α) := by + let U := CyclicSpectral.haarUnitary (semicircular i) (semicircular_selfAdjoint i) vacuum + refine ⟨⟨U,spectralHaar_mem i⟩,Unitary.mem_iff.mpr ⟨?_,?_⟩⟩ + · apply Subtype.ext + exact (Unitary.mem_iff.mp U.property).1 + · apply Subtype.ext + exact (Unitary.mem_iff.mp U.property).2 + + theorem spectralHaar_moment (i : α) (n : ℕ) : + vacuumTrace ((((spectralHaar i : gaussianAlgebra α) : Operator α)^n))=if n=0 then 1 else 0 := + CyclicSpectral.haarUnitary_moment (semicircular i) (semicircular_selfAdjoint i) vacuum n + +end FreeFock +open Filter Topology +open scoped ENNReal + theorem lp_strong_limit_of_bounded_basis {α : Type u_24} [DecidableEq α] + (T : ℕ → lp (fun _ : α => ℂ) 2 →L[ℂ] lp (fun _ : α => ℂ) 2) + (A : lp (fun _ : α => ℂ) 2 →L[ℂ] lp (fun _ : α => ℂ) 2) + (C : ℝ) (hbound : ∀ n, ‖T n‖ ≤ C) + (hbasis : ∀ a, Tendsto (fun n => T n (lp.single 2 a 1)) atTop (𝓝 (A (lp.single 2 a 1)))) + (ξ : lp (fun _ : α => ℂ) 2) : Tendsto (fun n => T n ξ) atTop (𝓝 (A ξ)) := by + have heq : Equicontinuous (fun n => (T n : lp (fun _ : α => ℂ) 2 → lp (fun _ : α => ℂ) 2)) := by + apply Metric.equicontinuous_of_continuity_modulus (fun r : ℝ => C*r) + (by simpa using (tendsto_const_nhds.mul (tendsto_id : Tendsto (id : ℝ → ℝ) (𝓝 0) (𝓝 0)))) + intro x y n + rw [dist_eq_norm,← map_sub] + exact (T n).le_opNorm (x-y) |>.trans + (by simpa only [dist_eq_norm] using mul_le_mul_of_nonneg_right (hbound n) (norm_nonneg (x-y))) + have hc := heq.isClosed_setOfPred_tendsto (l := atTop) A.continuous + apply hc.mem_of_tendsto (lp.hasSum_single (by norm_num : (2:ℝ≥0∞)≠⊤) ξ) + filter_upwards [] with s + have hs (a : α) : Tendsto (fun n => T n (lp.single 2 a (ξ a))) atTop (𝓝 (A (lp.single 2 a (ξ a)))) := by + have h : lp.single (E := fun _ : α => ℂ) 2 a (ξ a)=(ξ a) • lp.single 2 a 1 := by + ext b + simp [lp.single_apply,Pi.single_apply] + simpa only [h,map_smul] using (hbasis a).const_smul (ξ a) + simpa only [map_sum] using tendsto_finsetSum s (fun a _ => hs a) +namespace FreeFock + +section +open Filter Topology Set MeasureTheory +variable {α : Type u_25} [DecidableEq α] + + theorem semicircular_mem_haar_bicommutant (i : α) : + semicircular i ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ ({(CyclicSpectral.haarUnitary (semicircular i) + (semicircular_selfAdjoint i) vacuum : Operator α)} : Set (Operator α)) : Set (Operator α)) := by + let : Nontrivial (Fock α) := ⟨⟨vacuum,0,by + intro h + have he := congrArg (fun v : Fock α => v []) h + simp [vacuum,lp.single_apply] at he⟩⟩ + have hb (n : ℕ) := CyclicSpectral.bounded_haar_approx (semicircular i) + (semicircular_selfAdjoint i) vacuum (1/((n:ℝ)+1)) (by positivity) + choose T hmem hnorm herr using hb + have hS : semicircular i ∈ gaussianAlgebra α := + StarAlgebra.adjoin_le_centralizer_centralizer ℂ _ (StarAlgebra.subset_adjoin ℂ _ (Set.mem_range_self i)) + have hG : IsClosed (gaussianAlgebra α : Set (Operator α)) := by + rw [gaussianAlgebra,StarSubalgebra.coe_centralizer] + exact Set.isClosed_centralizer _ + have hT (n : ℕ) : T n ∈ gaussianAlgebra α := + StarAlgebra.elemental.le_of_mem hG (spectralHaar_mem i) (hmem n) + have hv : Tendsto (fun n => T n vacuum) atTop (𝓝 (semicircular i vacuum)) := by + have h := squeeze_zero_norm (fun n => (herr n).le) + (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)) + have hh := h.add_const (semicircular i vacuum) + simpa only [sub_add_cancel,zero_add] using hh + have hstrong : ∀ ξ, Tendsto (fun n => T n ξ) atTop (𝓝 (semicircular i ξ)) := by + apply lp_strong_limit_of_bounded_basis T (semicircular i) ‖semicircular i‖ hnorm + intro w + have he (D : Operator α) (hD : D ∈ gaussianAlgebra α) : + D (lp.single 2 w 1)=rightWick w.reverse (D vacuum) := by + have h := DFunLike.congr_fun (gaussian_commute_rightWick ⟨D,hD⟩ w.reverse) vacuum + simpa only [mul_apply_eq_comp,rightWick_vacuum,List.reverse_reverse] using h.symm + simpa only [he _ (hT _),he _ hS,Function.comp_def] using (rightWick w.reverse).continuous.continuousAt.tendsto.comp hv + let B := StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ ({(CyclicSpectral.haarUnitary (semicircular i) + (semicircular_selfAdjoint i) vacuum : Operator α)} : Set (Operator α)) : Set (Operator α)) + have hB : IsClosed (B : Set (Operator α)) := by + dsimp [B] + exact Set.isClosed_centralizer _ + have hU : (CyclicSpectral.haarUnitary (semicircular i) (semicircular_selfAdjoint i) vacuum : Operator α) ∈ B := + StarAlgebra.adjoin_le_centralizer_centralizer ℂ _ (StarAlgebra.subset_adjoin ℂ _ (Set.mem_singleton _)) + have hTB (n : ℕ) : T n ∈ B := StarAlgebra.elemental.le_of_mem hB hU (hmem n) + rw [StarSubalgebra.mem_centralizer_iff] + intro C hC + have hl (D : Operator α) (hD : D ∈ StarSubalgebra.centralizer ℂ + ({(CyclicSpectral.haarUnitary (semicircular i) (semicircular_selfAdjoint i) vacuum : Operator α)} : Set (Operator α))) : + D*semicircular i=semicircular i*D := by + apply ContinuousLinearMap.ext + intro ξ + have he n := congrArg (fun Q : Operator α => Q ξ) + ((StarSubalgebra.mem_centralizer_iff ℂ).mp (hTB n) D hD).1 + exact tendsto_nhds_unique ((D.continuous.continuousAt.tendsto.comp (hstrong ξ)).congr + (fun n => he n)) (hstrong (D ξ)) + exact ⟨hl C hC,hl (star C) (star_mem hC)⟩ +end +section +open Set +variable {α : Type u_26} [DecidableEq α] + +def spectralHaarOperator (i : α) : Operator α := + CyclicSpectral.haarUnitary (semicircular i) (semicircular_selfAdjoint i) vacuum + +theorem haar_gaussian_commutant : + StarSubalgebra.centralizer ℂ (Set.range (spectralHaarOperator : α → Operator α))=gaussianCommutant α := by + ext C + constructor + · intro hC + rw [gaussianCommutant,StarSubalgebra.mem_centralizer_iff] + rintro _ ⟨i,rfl⟩ + have hi : C ∈ StarSubalgebra.centralizer ℂ ({spectralHaarOperator i} : Set (Operator α)) := + StarSubalgebra.centralizer_le ℂ _ _ (Set.singleton_subset_iff.mpr (Set.mem_range_self i)) hC + have hh := ((StarSubalgebra.mem_centralizer_iff ℂ).mp (semicircular_mem_haar_bicommutant i) C hi).1 + exact ⟨hh.symm,by rw [(semicircular_selfAdjoint i).star_eq]; exact hh.symm⟩ + · intro hC + rw [StarSubalgebra.mem_centralizer_iff] + rintro _ ⟨i,rfl⟩ + have hi : spectralHaarOperator i ∈ gaussianAlgebra α := spectralHaar_mem i + exact ⟨((StarSubalgebra.mem_centralizer_iff ℂ).mp hi C hC).1.symm, + ((StarSubalgebra.mem_centralizer_iff ℂ).mp (show star (spectralHaarOperator i) ∈ gaussianAlgebra α from star_mem hi) C hC).1.symm⟩ + +theorem haar_generated_gaussian : + StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (Set.range (spectralHaarOperator : α → Operator α)) : Set (Operator α))= + gaussianAlgebra α := by + rw [haar_gaussian_commutant] + rfl +end + +section +open Filter Topology +open scoped ENNReal +variable {α : Type u_28} [DecidableEq α] + + theorem spectralHaar_cyclic_total : + (algebraCyclic (StarAlgebra.adjoin ℂ (Set.range (spectralHaarOperator : α → Operator α))) + vacuum).topologicalClosure=⊤ := by + let A := StarAlgebra.adjoin ℂ (Set.range (spectralHaarOperator : α → Operator α)) + let K := (algebraCyclic A vacuum).topologicalClosure + have hδ (w : List α) : lp.single 2 w (1:ℂ) ∈ K := by + have hw : wick w ∈ gaussianAlgebra α := wick_mem_any _ + (fun i => StarAlgebra.adjoin_le_centralizer_centralizer ℂ _ + (StarAlgebra.subset_adjoin ℂ _ (Set.mem_range_self i))) w + rw [← haar_generated_gaussian] at hw + have hh := bicommutant_vector_mem_cyclic (Set.range (spectralHaarOperator : α → Operator α)) + vacuum (wick w) hw + simpa only [wick_vacuum] using hh + apply top_unique + intro ξ _ + apply (algebraCyclic A vacuum).isClosed_topologicalClosure.mem_of_tendsto + (lp.hasSum_single (by norm_num : (2:ℝ≥0∞)≠⊤) ξ) + filter_upwards [] with s + apply K.sum_mem + intro w _ + have he : lp.single (E := fun _ : List α => ℂ) 2 w (ξ w)=(ξ w) • lp.single 2 w 1 := by + ext v + simp [lp.single_apply,Pi.single_apply] + rw [he] + exact K.smul_mem _ (hδ w) + +end +section +open scoped ComplexConjugate +variable {α : Type u_29} [DecidableEq α] + + theorem vacuumTrace_star (T : Operator α) : vacuumTrace (star T)=conj (vacuumTrace T) := by + unfold vacuumTrace + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + exact (inner_conj_symm (𝕜 := ℂ) (T vacuum) vacuum).symm + + theorem spectralHaar_integer_moment (i : α) (k : ℤ) : + vacuumTrace (((spectralHaar i ^ k : unitary (gaussianAlgebra α)) : gaussianAlgebra α) : Operator α)= + if k=0 then 1 else 0 := by + cases k with + | ofNat n => + simpa using spectralHaar_moment i n + | negSucc n => + rw [ite_eq_right (Int.negSucc_ne_zero n),zpow_negSucc,← Unitary.star_eq_inv] + change vacuumTrace (star ((((spectralHaar i : gaussianAlgebra α) : Operator α)^(n+1))))=0 + rw [vacuumTrace_star,spectralHaar_moment] + simp + +end +section +variable {α : Type u_30} [DecidableEq α] + + theorem wick_replicate_boundary (i j : α) (hij : i≠j) (w : List α) (n : ℕ) : + wick (List.replicate n i)*wick (j::w)=wick (List.replicate n i++j::w) := by + suffices ∀ n, (wick (List.replicate n i)*wick (j::w)=wick (List.replicate n i++j::w)) ∧ + (wick (List.replicate (n+1) i)*wick (j::w)=wick (List.replicate (n+1) i++j::w)) from (this n).1 + intro n + induction n with + | zero => + constructor + · simp + · simp only [Nat.zero_add,List.replicate_one,List.cons_append,List.nil_append] + rw [wick_semicircular_cons i [],wick_nil,mul_one,sub_zero, + wick_semicircular_cons i (j::w)] + simp only [hij,ite_false,sub_zero] + | succ n ih => + refine ⟨ih.2,?_⟩ + have hleft : wick (List.replicate (n+1+1) i)= + semicircular i*wick (List.replicate (n+1) i)-wick (List.replicate n i) := by + conv_lhs => rw [List.replicate_succ,wick_semicircular_cons] + simp only [List.replicate_succ,ite_true] + have hright : wick (List.replicate (n+1+1) i++j::w)= + semicircular i*wick (List.replicate (n+1) i++j::w)-wick (List.replicate n i++j::w) := by + conv_lhs => rw [List.replicate_succ,List.cons_append,wick_semicircular_cons] + simp only [List.replicate_succ,List.cons_append,ite_true] + rw [hleft,sub_mul,mul_assoc,ih.1,ih.2,hright] +end +variable {α : Type u_31} [DecidableEq α] + +def blockLetters (L : List (α × ℕ)) : List α := + L.flatMap (fun p => List.replicate p.2 p.1) + +def blockProduct : List (α × ℕ) → Operator α + | [] => 1 + | (i,n)::L => wick (List.replicate n i)*blockProduct L + +def blocksReduced : List (α × ℕ) → Prop + | [] => True + | (i,n)::L => 0 < n ∧ blocksReduced L ∧ + match L with | [] => True | (j,_)::_ => i≠j + + theorem wick_blocks_concatenate (L : List (α × ℕ)) (hL : blocksReduced L) : + blockProduct L=wick (blockLetters L) := by + induction L with + | nil => simp [blockProduct,blockLetters] + | cons p L ih => + rcases p with ⟨i,n⟩ + obtain ⟨hn,hL,hsep⟩ := hL + cases L with + | nil => simp [blockProduct,blockLetters] + | cons q L => + rcases q with ⟨j,m⟩ + have hm : 0 < m := hL.1 + obtain ⟨k,rfl⟩ := Nat.exists_eq_succ_of_ne_zero (Nat.ne_of_gt hm) + rw [blockProduct,ih hL] + change wick (List.replicate n i)*wick ((List.replicate (k+1) j)++blockLetters L)= + wick (List.replicate n i++(List.replicate (k+1) j++blockLetters L)) + simpa only [List.replicate_succ,List.cons_append] using + wick_replicate_boundary i j hsep (List.replicate k j++blockLetters L) n + + omit [DecidableEq α] in + theorem blockLetters_nonempty {L : List (α × ℕ)} (hL : blocksReduced L) (h : L≠[]) : + blockLetters L≠[] := by + cases L with + | nil => exact False.elim (h rfl) + | cons p L => + rcases p with ⟨i,n⟩ + have hn : 0 < n := hL.1 + obtain ⟨k,rfl⟩ := Nat.exists_eq_succ_of_ne_zero (Nat.ne_of_gt hn) + simp [blockLetters,List.replicate_succ] + + theorem wick_blocks_centered_moment (L : List (α × ℕ)) (hL : blocksReduced L) (h : L≠[]) : + vacuumTrace (blockProduct L)=0 := by + rw [wick_blocks_concatenate L hL] + have hne := blockLetters_nonempty hL h + unfold vacuumTrace + rw [wick_vacuum] + simp [vacuum,lp.inner_single_left,lp.single_apply,hne] +end FreeFock +section + +variable {A : Type u_32} [NormedRing A] [NormedAlgebra ℂ A] + +theorem mul_mem_closed_span_image2 (s t : Set A) (x y : A) + (hx : x∈(Submodule.span ℂ s).topologicalClosure) + (hy : y∈(Submodule.span ℂ t).topologicalClosure) : + x*y∈(Submodule.span ℂ (Set.image2 (·*·) s t)).topologicalClosure := by + let K := (Submodule.span ℂ (Set.image2 (·*·) s t)).topologicalClosure + have hbase (b : A) (hb : b∈t) : x*b∈K := by + have hc : IsClosed {a : A | a*b∈K} := + (Submodule.isClosed_topologicalClosure _).preimage (continuous_id.mul continuous_const) + apply closure_minimal (t := {a : A | a*b∈K}) ?_ hc hx + intro a ha + induction ha using Submodule.span_induction with + | mem a ha => + exact Submodule.le_topologicalClosure _ + (Submodule.subset_span ⟨a,ha,b,hb,rfl⟩) + | zero => simp + | add a c _ _ ha hc => simpa only [Set.mem_ofPred_eq,add_mul] using K.add_mem ha hc + | smul z a _ ha => simpa only [Set.mem_ofPred_eq,smul_mul_assoc] using K.smul_mem z ha + have hc : IsClosed {b : A | x*b∈K} := + (Submodule.isClosed_topologicalClosure _).preimage (continuous_const.mul continuous_id) + apply closure_minimal (t := {b : A | x*b∈K}) ?_ hc hy + intro b hb + induction hb using Submodule.span_induction with + | mem b hb => exact hbase b hb + | zero => simp + | add b c _ _ hb hc => simpa only [Set.mem_ofPred_eq,mul_add] using K.add_mem hb hc + | smul z b _ hb => simpa only [Set.mem_ofPred_eq,mul_smul_comm] using K.smul_mem z hb + +end +namespace FreeFock + +section +variable {α : Type u_33} [DecidableEq α] + + theorem center_run_mem (i : α) (x : Operator α) (hx : x∈runSpan i) : + x-vacuumTrace x • 1∈positiveRunSpan i := by + induction hx using Submodule.span_induction with + | mem x hx => + obtain ⟨n,rfl⟩ := hx + cases n with + | zero => simp [vacuumTrace_one] + | succ n => + rw [vacuumTrace_run,ite_eq_right (Nat.succ_ne_zero n),zero_smul ℂ (A := Operator α),sub_zero] + exact Submodule.subset_span (Set.mem_range_self n) + | zero => simpa only [vacuumTrace_linear.map_zero,zero_smul ℂ (A := Operator α),sub_self] using (positiveRunSpan i).zero_mem + | add x y _ _ hx hy => + rw [vacuumTrace_linear.map_add,add_smul (R := ℂ) (M := Operator α),add_sub_add_comm] + exact (positiveRunSpan i).add_mem hx hy + | smul c x _ hx => + rw [vacuumTrace_linear.map_smul,smul_eq_mul,← smul_smul,← smul_sub] + exact (positiveRunSpan i).smul_mem c hx + + theorem center_run_closure (i : α) (x : Operator α) + (hx : x∈(runSpan i).topologicalClosure) : + x-vacuumTrace x • 1∈(positiveRunSpan i).topologicalClosure := by + have hc : Continuous (fun x : Operator α => x-vacuumTrace x • 1) := + continuous_id.sub (vacuumTrace_continuous.smul continuous_const) + apply closure_minimal (t := {x | x-vacuumTrace x • 1∈(positiveRunSpan i).topologicalClosure}) ?_ ?_ hx + · intro a ha + exact (positiveRunSpan i).le_topologicalClosure (center_run_mem i a ha) + · exact (positiveRunSpan i).isClosed_topologicalClosure.preimage hc + + theorem spectralHaar_run_closure (i : α) : + spectralHaarOperator i ∈ (runSpan i).topologicalClosure := by + change spectralHaarOperator i ∈ (runAlgebra i).topologicalClosure + apply CyclicSpectral.complexHom_mem + · exact StarSubalgebra.isClosed_topologicalClosure _ + · apply StarSubalgebra.le_topologicalClosure + change semicircular i∈runSpan i + simpa [wick_semicircular_cons] using run_mem i 1 + + theorem spectralHaar_power_positive_run_closure (i : α) (k : ℤ) (hk : k≠0) : + ((((spectralHaar i)^k : unitary (gaussianAlgebra α)) : gaussianAlgebra α) : Operator α) ∈ + (positiveRunSpan i).topologicalClosure := by + have hrun : ((((spectralHaar i)^k : unitary (gaussianAlgebra α)) : gaussianAlgebra α) : Operator α) ∈ + (runSpan i).topologicalClosure := by + change ((↑((spectralHaar i)^k) : gaussianAlgebra α) : Operator α) ∈ + (runAlgebra i).topologicalClosure + have hh : spectralHaarOperator i∈(runAlgebra i).topologicalClosure := spectralHaar_run_closure i + cases k with + | ofNat n => + rw [Int.ofNat_eq_natCast,zpow_natCast] + change spectralHaarOperator i^n ∈ (runAlgebra i).topologicalClosure + exact pow_mem hh n + | negSucc n => + rw [zpow_negSucc,← Unitary.star_eq_inv] + change star (spectralHaarOperator i^(n+1))∈(runAlgebra i).topologicalClosure + exact star_mem (pow_mem hh (n+1)) + have hc := center_run_closure i _ hrun + rw [spectralHaar_integer_moment,ite_eq_right hk,zero_smul ℂ (A := Operator α),sub_zero] at hc + exact hc + +end +variable {α : Type u_34} [DecidableEq α] + +def colorsReduced : List α → Prop + | [] => True + | i::L => colorsReduced L ∧ (match L with | [] => True | j::_ => i≠j) + +def runProducts : List α → Set (Operator α) + | [] => {1} + | i::L => Set.image2 (·*·) (Set.range (fun n : ℕ => wick (List.replicate (n+1) i))) (runProducts L) + + theorem runProducts_blocks (L : List α) (X : Operator α) (hX : X∈runProducts L) : + ∃ K : List (α×ℕ), K.map Prod.fst=L ∧ (∀ p∈K,0 exact ⟨[],rfl,by simp,by simpa [runProducts,blockProduct] using hX⟩ + | cons i L ih => + obtain ⟨a,⟨n,rfl⟩,b,hb,rfl⟩ := hX + obtain ⟨K,hK,hpos,rfl⟩ := ih b hb + refine ⟨(i,n+1)::K,by simp [hK],?_,rfl⟩ + intro p hp + rcases List.mem_cons.mp hp with rfl | hp + · exact Nat.succ_pos n + · exact hpos p hp + + omit [DecidableEq α] in + theorem blocksReduced_of_colors (K : List (α×ℕ)) + (h : colorsReduced (K.map Prod.fst)) (hpos : ∀ p∈K,0 trivial + | cons p K ih => + rcases p with ⟨i,n⟩ + refine ⟨hpos (i,n) (by simp),ih h.1 (fun p hp => hpos p (by simp [hp])),?_⟩ + cases K with + | nil => trivial + | cons q K => exact h.2 + + theorem runProducts_trace_zero (L : List α) (h : colorsReduced L) (hne : L≠[]) + (X : Operator α) (hX : X∈runProducts L) : vacuumTrace X=0 := by + obtain ⟨K,hK,hpos,rfl⟩ := runProducts_blocks L X hX + apply wick_blocks_centered_moment + · apply blocksReduced_of_colors K + · simpa only [hK] using h + · exact hpos + · intro he + apply hne + simpa only [he,List.map_nil] using hK.symm + + theorem vacuumTrace_span_zero (S : Set (Operator α)) (hS : ∀ X∈S,vacuumTrace X=0) + (X : Operator α) (hX : X∈(Submodule.span ℂ S).topologicalClosure) : vacuumTrace X=0 := by + apply closure_minimal (t := {X : Operator α | vacuumTrace X=0}) ?_ + (isClosed_eq vacuumTrace_continuous continuous_const) hX + intro X hX + induction hX using Submodule.span_induction with + | mem X hX => exact hS X hX + | zero => exact vacuumTrace_linear.map_zero + | add X Y _ _ hX hY => + change vacuumTrace X=0 at hX + change vacuumTrace Y=0 at hY + simp only [Set.mem_ofPred_eq,vacuumTrace_linear.map_add,hX,hY,add_zero] + | smul c X _ hX => + change vacuumTrace X=0 at hX + simp only [Set.mem_ofPred_eq,vacuumTrace_linear.map_smul,hX,smul_zero] + +def haarProduct : List (α×ℤ) → Operator α + | [] => 1 + | (i,k)::L => (((spectralHaar i ^ k : unitary (gaussianAlgebra α)) : gaussianAlgebra α) : Operator α)*haarProduct L + + theorem haarProduct_mem_runProducts (L : List (α×ℤ)) (hL : ∀ p∈L,p.2≠0) : + haarProduct L∈(Submodule.span ℂ (runProducts (L.map Prod.fst))).topologicalClosure := by + induction L with + | nil => + exact Submodule.le_topologicalClosure _ (Submodule.subset_span (by simp [runProducts,haarProduct])) + | cons p L ih => + rcases p with ⟨i,k⟩ + exact mul_mem_closed_span_image2 _ _ _ _ + (spectralHaar_power_positive_run_closure i k (hL (i,k) (by simp))) + (ih (fun p hp => hL p (by simp [hp]))) + + theorem spectralHaar_mixed_moment (L : List (α×ℤ)) + (hL : ∀ p∈L,p.2≠0) (hred : colorsReduced (L.map Prod.fst)) (hne : L≠[]) : + vacuumTrace (haarProduct L)=0 := by + apply vacuumTrace_span_zero (runProducts (L.map Prod.fst)) + · exact runProducts_trace_zero _ hred (by simpa using hne) + · exact haarProduct_mem_runProducts L hL + +end FreeFock + +section +variable {α : Type u_35} + +def adjacentDistinct : List α → Prop + | [] => True + | i::L => adjacentDistinct L ∧ (match L with | [] => True | j::_ => i≠j) + +def expandSignedRuns (R : List ((α×Bool)×ℕ)) : List (α×Bool) := + R.flatMap (fun p => List.replicate p.2 p.1) + +theorem reduced_signed_runs (L : List (α×Bool)) (hL : FreeGroup.IsReduced L) : + ∃ R : List ((α×Bool)×ℕ), L=expandSignedRuns R ∧ + (∀ p∈R,0 p.1.1)) := by + classical + induction L with + | nil => exact ⟨[],rfl,by simp,by trivial⟩ + | cons x L ih => + have ht : FreeGroup.IsReduced L := hL.tail + obtain ⟨R,hR,hpos,hred⟩ := ih ht + rcases x with ⟨i,b⟩ + cases R with + | nil => + have hnil : L=[] := hR + subst L + exact ⟨[((i,b),1)],by simp [expandSignedRuns],by simp,by trivial⟩ + | cons p R => + rcases p with ⟨⟨j,c⟩,m⟩ + have hm := hpos ((j,c),m) (by simp) + obtain ⟨n,rfl⟩ := Nat.exists_eq_succ_of_ne_zero (Nat.ne_of_gt hm) + have he : L=(j,c)::(List.replicate n (j,c)++expandSignedRuns R) := by + simpa [expandSignedRuns,List.replicate_succ] using hR + by_cases hij : i=j + · subst j + have hpair : FreeGroup.IsReduced ((i,b)::(i,c)::(List.replicate n (i,c)++expandSignedRuns R)) := by + simpa only [he] using hL + have hbc : b=c := (FreeGroup.isReduced_cons_cons.mp hpair).1 rfl + subst c + refine ⟨((i,b),n+2)::R,?_,?_,hred⟩ + · simp only [expandSignedRuns,List.flatMap_cons,List.replicate_succ,List.cons_append,he] + · intro p hp + rcases List.mem_cons.mp hp with rfl | hp + · omega + · exact hpos p (List.mem_cons_of_mem _ hp) + · refine ⟨((i,b),1)::((j,c),n+1)::R,?_,?_,?_⟩ + · simpa [expandSignedRuns] using congrArg (List.cons (i,b)) hR + · intro p hp + rcases List.mem_cons.mp hp with rfl | hp + · exact Nat.zero_lt_one + · exact hpos p hp + · exact ⟨hred,hij⟩ + +end +section +variable {α : Type u_36} {G : Type u_37} [Group G] + +def signedExponent (b : Bool) (n : ℕ) : ℤ := bif b then (n : ℤ) else -(n : ℤ) + +theorem signedExponent_ne_zero (b : Bool) (n : ℕ) (hn : 0 simp [signedExponent,ne_of_gt hn] + +theorem signedPower (b : Bool) (n : ℕ) (x : G) : + x^signedExponent b n = (bif b then x else x⁻¹)^n := by + cases b <;> simp [signedExponent] + +def signedRunBlocks (R : List ((α×Bool)×ℕ)) : List (α×ℤ) := + R.map (fun p => (p.1.1,signedExponent p.1.2 p.2)) + +theorem lift_expandSignedRuns (f : α→G) (R : List ((α×Bool)×ℕ)) : + FreeGroup.lift f (FreeGroup.mk (expandSignedRuns R))= + ((signedRunBlocks R).map (fun p => f p.1^p.2)).prod := by + rw [FreeGroup.lift_mk] + induction R with + | nil => rfl + | cons p R ih => + rcases p with ⟨⟨i,b⟩,n⟩ + simpa only [expandSignedRuns,List.flatMap_cons,List.map_append,List.prod_append, + List.map_replicate,List.prod_replicate,signedRunBlocks,List.map_cons,List.prod_cons, + signedPower] using congrArg (fun x : G => (bif b then f i else (f i)⁻¹)^n*x) ih + +end +namespace FreeFock +variable {α : Type u_38} [DecidableEq α] + +def haarRepresentation : FreeGroup α →* unitary (gaussianAlgebra α) := + FreeGroup.lift spectralHaar + +def haarOperatorRepresentation : FreeGroup α →* Operator α := + (gaussianAlgebra α).subtype.toMonoidHom.comp + ((unitary (gaussianAlgebra α)).subtype.comp haarRepresentation) + + theorem haarProduct_eq_prod (L : List (α×ℤ)) : + haarProduct L = (((L.map (fun p => (spectralHaar p.1)^p.2)).prod : unitary (gaussianAlgebra α)) : gaussianAlgebra α) := by + induction L with + | nil => rfl + | cons p L ih => + rcases p with ⟨i,k⟩ + change ((spectralHaar i ^ k : unitary (gaussianAlgebra α)) : gaussianAlgebra α) * haarProduct L = _ + change ((spectralHaar i ^ k : unitary (gaussianAlgebra α)) : gaussianAlgebra α) * haarProduct L = + (((spectralHaar i ^ k : unitary (gaussianAlgebra α)) : gaussianAlgebra α) : Operator α) * _ + exact congrArg (fun x : Operator α => + (((spectralHaar i ^ k : unitary (gaussianAlgebra α)) : gaussianAlgebra α) : Operator α)*x) ih + + theorem haarRepresentation_run_moment (R : List ((α×Bool)×ℕ)) + (hpos : ∀p∈R,0 p.1.1))) (hne : R≠[]) : + vacuumTrace (haarOperatorRepresentation (FreeGroup.mk (expandSignedRuns R)))=0 := by + change vacuumTrace (((FreeGroup.lift (spectralHaar (α := α)) (FreeGroup.mk (expandSignedRuns R)) : unitary (gaussianAlgebra α)) : gaussianAlgebra α) : Operator α)=0 + rw [lift_expandSignedRuns,← haarProduct_eq_prod] + apply spectralHaar_mixed_moment + · intro p hp + obtain ⟨q,hq,rfl⟩ := List.mem_map.mp hp + exact signedExponent_ne_zero _ _ (hpos q hq) + · have he : ∀ L : List α, colorsReduced L=adjacentDistinct L := by + intro L + induction L with + | nil => rfl + | cons i L ih => simp only [colorsReduced,adjacentDistinct,ih] + rw [he] + simpa only [signedRunBlocks,List.map_map,Function.comp_def] using hred + · simpa [signedRunBlocks] using hne + + theorem haarRepresentation_moment (g : FreeGroup α) : + vacuumTrace (haarOperatorRepresentation g)=if g=1 then 1 else 0 := by + classical + by_cases hg : g=1 + · subst g + simp only [map_one,ite_true,vacuumTrace_one] + · rw [ite_eq_right hg] + obtain ⟨R,hR,hpos,hred⟩ := reduced_signed_runs g.toWord FreeGroup.isReduced_toWord + have hne : R≠[] := by + intro he + have hn : g.toWord=[] := by simpa only [he,expandSignedRuns,List.flatMap_nil] using hR + apply hg + rw [← FreeGroup.mk_toWord (x := g),hn] + rfl + rw [← FreeGroup.mk_toWord (x := g),hR] + exact haarRepresentation_run_moment R hpos hred hne + +end FreeFock + +namespace CyclicUnitary +open scoped ENNReal +variable {G : Type u_42} {E : Type u_43} [Group G] [DecidableEq G] +variable [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable (ρ : G →* (E →L[ℂ] E)) (hstar : ∀ g,star (ρ g)=ρ g⁻¹) (ξ : E) + +omit [DecidableEq G] in +include hstar in + +theorem adjoin_range_span : + (StarAlgebra.adjoin ℂ (Set.range ρ)).toSubalgebra.toSubmodule= + Submodule.span ℂ (Set.range ρ) := by + rw [StarAlgebra.adjoin_eq_span] + have hs : star (Set.range ρ)=Set.range ρ := by + ext T + change (star T∈Set.range ρ) ↔ T∈Set.range ρ + constructor + · rintro ⟨g,hg⟩ + refine ⟨g⁻¹,?_⟩ + rw [← hstar,hg,star_star] + · rintro ⟨g,rfl⟩ + exact ⟨g⁻¹,(hstar g).symm⟩ + rw [hs,Set.union_self] + let M : Submonoid (E →L[ℂ] E) := + { carrier := Set.range ρ + one_mem' := ⟨1,map_one ρ⟩ + mul_mem' := by + rintro _ _ ⟨g,rfl⟩ ⟨h,rfl⟩ + exact ⟨g*h,map_mul ρ g h⟩ } + change Submodule.span ℂ ((Submonoid.closure (M : Set (E →L[ℂ] E))) : Set (E →L[ℂ] E))=_ + rw [Submonoid.closure_eq] + rfl + +def orbitSpan : Submodule ℂ E := Submodule.span ℂ (Set.range (fun g => ρ g ξ)) + +omit [DecidableEq G] in +include hstar in +theorem apply_mem_orbitSpan (T : (E →L[ℂ] E)) (hT : T∈StarAlgebra.adjoin ℂ (Set.range ρ)) : + T ξ∈orbitSpan ρ ξ := by + change T∈(StarAlgebra.adjoin ℂ (Set.range ρ)).toSubalgebra.toSubmodule at hT + rw [adjoin_range_span ρ hstar] at hT + induction hT using Submodule.span_induction with + | mem T hT => + obtain ⟨g,rfl⟩ := hT + exact Submodule.subset_span (Set.mem_range_self g) + | zero => exact (orbitSpan ρ ξ).zero_mem + | add T U _ _ hT hU => exact (orbitSpan ρ ξ).add_mem hT hU + | smul c T _ hT => exact (orbitSpan ρ ξ).smul_mem c hT + +include hstar in +theorem orbit_inner (htrace : ∀ g,inner ℂ ξ (ρ g ξ)=if g=1 then 1 else 0) (g h : G) : + inner ℂ (ρ g ξ) (ρ h ξ)=if g=h then 1 else 0 := by + classical + calc + _ = inner ℂ ξ (star (ρ g) (ρ h ξ)) := + (ContinuousLinearMap.adjoint_inner_right (ρ g) ξ (ρ h ξ)).symm + _ = inner ℂ ξ (ρ (g⁻¹*h) ξ) := by rw [hstar,map_mul]; rfl + _ = _ := by rw [htrace]; simp only [inv_mul_eq_one] + +def basis (g : G) : lp (fun _ : G => ℂ) 2 := lp.single 2 g 1 + +omit [Group G] [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] in + theorem basis_inner (g h : G) : + inner ℂ (basis g) (basis h)=if g=h then 1 else 0 := by + simp [basis,lp.inner_single_left,lp.single_apply,Pi.single_apply] + +omit [Group G] [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] in + theorem basis_total : (Submodule.span ℂ (Set.range (basis (G := G)))).topologicalClosure=⊤ := by + let K := (Submodule.span ℂ (Set.range (basis (G := G)))).topologicalClosure + apply top_unique + intro η _ + apply (Submodule.span ℂ (Set.range (basis (G := G)))).isClosed_topologicalClosure.mem_of_tendsto + (lp.hasSum_single (by norm_num : (2:ℝ≥0∞)≠⊤) η) + filter_upwards [] with s + apply K.sum_mem + intro g _ + have he : lp.single (E := fun _ : G => ℂ) 2 g (η g)=(η g) • basis g := by + ext h + simp [basis,lp.single_apply,Pi.single_apply] + rw [he] + exact K.smul_mem _ (Submodule.le_topologicalClosure _ (Submodule.subset_span (Set.mem_range_self g))) + +def spatial (htrace : ∀ g,inner ℂ ξ (ρ g ξ)=if g=1 then 1 else 0) + (htotal : (orbitSpan ρ ξ).topologicalClosure=⊤) : + lp (fun _ : G => ℂ) 2 ≃ₗᵢ[ℂ] E := + GramSpatial.spatial basis (fun g => ρ g ξ) + (fun g h => (orbit_inner ρ hstar ξ htrace g h).trans (basis_inner g h).symm) + basis_total htotal + +theorem spatial_basis (htrace : ∀ g,inner ℂ ξ (ρ g ξ)=if g=1 then 1 else 0) + (htotal : (orbitSpan ρ ξ).topologicalClosure=⊤) (g : G) : + spatial ρ hstar ξ htrace htotal (basis g)=ρ g ξ := + GramSpatial.spatial_family _ _ _ _ _ g + +end CyclicUnitary +namespace FreeFock +variable {α : Type u_44} [DecidableEq α] + + theorem haarOperatorRepresentation_star (g : FreeGroup α) : + star (haarOperatorRepresentation g)=haarOperatorRepresentation g⁻¹ := by + change star (((haarRepresentation g : unitary (gaussianAlgebra α)) : gaussianAlgebra α) : Operator α) = + (((haarRepresentation g⁻¹ : unitary (gaussianAlgebra α)) : gaussianAlgebra α) : Operator α) + rw [map_inv] + rfl + + theorem haarOperatorRepresentation_of (i : α) : + haarOperatorRepresentation (FreeGroup.of i)=spectralHaarOperator i := by + change ((((FreeGroup.lift (spectralHaar (α := α))) (FreeGroup.of i) : unitary (gaussianAlgebra α)) : gaussianAlgebra α) : Operator α) = _ + rw [FreeGroup.lift_apply_of] + rfl + + theorem haarGroup_cyclic_total : + (CyclicUnitary.orbitSpan (haarOperatorRepresentation (α := α)) vacuum).topologicalClosure=⊤ := by + apply top_unique + rw [← spectralHaar_cyclic_total (α := α)] + apply Submodule.topologicalClosure_mono + rintro η ⟨T,hT,rfl⟩ + apply CyclicUnitary.apply_mem_orbitSpan haarOperatorRepresentation haarOperatorRepresentation_star + apply StarAlgebra.adjoin_mono _ hT + rintro _ ⟨i,rfl⟩ + exact ⟨FreeGroup.of i,haarOperatorRepresentation_of i⟩ + +def haarSpatial : lp (fun _ : FreeGroup α => ℂ) 2 ≃ₗᵢ[ℂ] Fock α := + CyclicUnitary.spatial haarOperatorRepresentation haarOperatorRepresentation_star vacuum + haarRepresentation_moment haarGroup_cyclic_total + + theorem haarSpatial_basis (g : FreeGroup α) : + haarSpatial (CyclicUnitary.basis g)=haarOperatorRepresentation g vacuum := + CyclicUnitary.spatial_basis _ _ _ _ _ g + + theorem haarSpatial_vacuum : haarSpatial (CyclicUnitary.basis (1 : FreeGroup α))=vacuum := by + rw [haarSpatial_basis,map_one] + rfl + +end FreeFock + +section + +variable {A : Type u_45} {B : Type u_46} [Ring A] [Ring B] [Algebra ℂ A] [Algebra ℂ B] + [StarRing A] [StarRing B] [StarModule ℂ A] [StarModule ℂ B] + +theorem equiv_mem_centralizer (e : A ≃⋆ₐ[ℂ] B) (S : Set A) (T : A) : + e T∈StarSubalgebra.centralizer ℂ (e '' S) ↔ T∈StarSubalgebra.centralizer ℂ S := by + simp only [StarSubalgebra.mem_centralizer_iff] + constructor + · intro h U hU + have h := h (e U) ⟨U,hU,rfl⟩ + constructor + · apply (EquivLike.injective e); simpa only [map_mul] using h.1 + · apply (EquivLike.injective e); simpa only [map_mul,map_star] using h.2 + · rintro h _ ⟨U,hU,rfl⟩ + have h := h U hU + constructor + · simpa only [map_mul] using congrArg e h.1 + · simpa only [map_mul,map_star] using congrArg e h.2 + +theorem equiv_image_centralizer (e : A ≃⋆ₐ[ℂ] B) (S : Set A) : + e '' (StarSubalgebra.centralizer ℂ S : Set A)= + (StarSubalgebra.centralizer ℂ (e '' S) : Set B) := by + ext T + constructor + · rintro ⟨U,hU,rfl⟩ + exact (equiv_mem_centralizer e S U).mpr hU + · intro hT + refine ⟨e.symm T,?_,e.apply_symm_apply T⟩ + apply (equiv_mem_centralizer e S _).mp + rw [e.apply_symm_apply] + exact hT + +theorem equiv_mem_bicommutant (e : A ≃⋆ₐ[ℂ] B) (S : Set A) (T : A) : + e T∈StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (e '' S) : Set B) ↔ + T∈StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ S : Set A) := by + rw [← equiv_image_centralizer] + exact equiv_mem_centralizer e _ T +def restrictStarAlgEquiv (e : A ≃⋆ₐ[ℂ] B) (S : StarSubalgebra ℂ A) (T : StarSubalgebra ℂ B) + (he : ∀ a,e a∈T ↔ a∈S) : S ≃⋆ₐ[ℂ] T where + toFun a := ⟨e a,(he a).mpr a.property⟩ + invFun b := ⟨e.symm b,(he _).mp (by rw [e.apply_symm_apply]; exact b.property)⟩ + left_inv a := Subtype.ext (e.symm_apply_apply a) + right_inv b := Subtype.ext (e.apply_symm_apply b) + map_mul' a b := Subtype.ext (map_mul e (a : A) (b : A)) + map_add' a b := Subtype.ext (map_add e (a : A) (b : A)) + map_smul' c a := Subtype.ext (map_smul e c (a : A)) + map_star' a := Subtype.ext (map_star e (a : A)) + +end +open scoped ENNReal +variable {G : Type u_47} [Group G] [DecidableEq G] + +theorem leftRegular_basis (g h : G) : + leftRegular g (CyclicUnitary.basis h)=CyclicUnitary.basis (g*h) := by + ext k + simp only [leftRegular_apply,CyclicUnitary.basis,lp.single_apply,Pi.single_apply] + congr 1 + exact propext (inv_mul_eq_iff_eq_mul) + +namespace FreeFock +variable {α : Type u_48} [DecidableEq α] + +theorem haarSpatial_intertwines (g : FreeGroup α) : + haarSpatial.conjStarAlgEquiv (leftRegular g)=haarOperatorRepresentation g := by + have h : (haarSpatial (α := α)).toContinuousLinearEquiv.toContinuousLinearMap.comp (leftRegular g)= + (haarOperatorRepresentation g).comp haarSpatial.toContinuousLinearEquiv.toContinuousLinearMap := by + apply lp.ext_continuousLinearMap (by norm_num : (2:ℝ≥0∞)≠⊤) + intro h + apply ContinuousLinearMap.ext + intro z + have hz : lp.single (E := fun _ : FreeGroup α => ℂ) 2 h z=z • CyclicUnitary.basis h := by + ext k + simp [CyclicUnitary.basis,lp.single_apply,Pi.single_apply] + change haarSpatial (leftRegular g (lp.single 2 h z))= + haarOperatorRepresentation g (haarSpatial (lp.single 2 h z)) + rw [hz,map_smul,map_smul,map_smul,map_smul] + congr 1 + rw [leftRegular_basis,haarSpatial_basis,haarSpatial_basis] + exact DFunLike.congr_fun (map_mul haarOperatorRepresentation g h) vacuum + apply ContinuousLinearMap.ext + intro ξ + have h := DFunLike.congr_fun h (haarSpatial.symm ξ) + simpa only [LinearIsometryEquiv.conjStarAlgEquiv_apply_apply,ContinuousLinearMap.comp_apply,LinearIsometryEquiv.coe_toContinuousLinearEquiv, + ContinuousLinearEquiv.coe_coe,LinearIsometryEquiv.apply_symm_apply] using h + +theorem haarRepresentation_commutant : + StarSubalgebra.centralizer ℂ (Set.range (haarOperatorRepresentation (α := α)))= + gaussianCommutant α := by + rw [← haar_gaussian_commutant] + apply le_antisymm + · apply StarSubalgebra.centralizer_le ℂ + rintro _ ⟨i,rfl⟩ + exact ⟨FreeGroup.of i,haarOperatorRepresentation_of i⟩ + · intro C hC + rw [haar_gaussian_commutant] at hC + rw [StarSubalgebra.mem_centralizer_iff] + rintro _ ⟨g,rfl⟩ + have hg : haarOperatorRepresentation g∈gaussianAlgebra α := + (haarRepresentation g : gaussianAlgebra α).property + exact ⟨((StarSubalgebra.mem_centralizer_iff ℂ).mp hg C hC).1.symm, + ((StarSubalgebra.mem_centralizer_iff ℂ).mp (star_mem hg) C hC).1.symm⟩ + +theorem haarSpatial_mem_vonNeumann (T : GroupOperator (FreeGroup α)) : + haarSpatial.conjStarAlgEquiv T∈gaussianAlgebra α ↔ T∈groupVonNeumann (FreeGroup α) := by + have he : haarSpatial.conjStarAlgEquiv '' leftTranslations (FreeGroup α)= + Set.range (haarOperatorRepresentation (α := α)) := by + rw [leftTranslations_eq_range,← Set.range_comp] + congr 1 + funext g + exact haarSpatial_intertwines g + have h := equiv_mem_bicommutant haarSpatial.conjStarAlgEquiv (leftTranslations (FreeGroup α)) T + rw [he,haarRepresentation_commutant] at h + exact h + +def gaussianGroupIso : groupVonNeumann (FreeGroup α) ≃⋆ₐ[ℂ] gaussianAlgebra α := + restrictStarAlgEquiv haarSpatial.conjStarAlgEquiv _ _ haarSpatial_mem_vonNeumann + +theorem gaussianGroupIso_trace (T : groupVonNeumann (FreeGroup α)) : + vacuumTrace ((gaussianGroupIso T : gaussianAlgebra α) : Operator α)=canonicalTrace T := by + have hcoe : ((gaussianGroupIso T : gaussianAlgebra α) : Operator α)= + (haarSpatial (α := α)).conjStarAlgEquiv (T : GroupOperator (FreeGroup α)) := rfl + rw [hcoe] + unfold vacuumTrace + rw [← haarSpatial_vacuum (α := α),LinearIsometryEquiv.conjStarAlgEquiv_apply_apply, + haarSpatial.symm_apply_apply,haarSpatial.inner_map_map] + simp only [CyclicUnitary.basis,lp.inner_single_left,RCLike.inner_apply,map_one,mul_one] + unfold canonicalTrace + exact congrArg (fun ξ : GroupHilbert (FreeGroup α) => ((T : GroupOperator (FreeGroup α)) ξ) 1) (by + ext g + simp only [lp.single_apply,Pi.single_apply] + split_ifs <;> rfl) + +@[instance_reducible] def gaussianUltraweakTopology (α : Type u_49) [DecidableEq α] : + TopologicalSpace (gaussianAlgebra α) := + TopologicalSpace.induced (fun T : gaussianAlgebra α => (T : Operator α)) + (ultraweakOperatorTopology (List α)) + +theorem gaussianGroupIso_normal : + @Continuous _ _ (groupUltraweakTopology (FreeGroup α)) (gaussianUltraweakTopology α) + (gaussianGroupIso (α := α)) := by + let : TopologicalSpace (GroupOperator (FreeGroup α)) := ultraweakOperatorTopology (FreeGroup α) + let : TopologicalSpace (Operator α) := ultraweakOperatorTopology (List α) + let : TopologicalSpace (groupVonNeumann (FreeGroup α)) := groupUltraweakTopology (FreeGroup α) + let : TopologicalSpace (gaussianAlgebra α) := gaussianUltraweakTopology α + exact ((spatial_ultraweak_continuous haarSpatial).comp continuous_subtype_val).subtype_mk _ + +end FreeFock + +end FreeGroupFactorMain + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Haar.lean b/lean/OAI/Analysis/InterpolatedFactors/Haar.lean new file mode 100644 index 0000000000000000000000000000000000000000..4383769d8a858b00a319ee0fb73d4032ffceb968 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Haar.lean @@ -0,0 +1,880 @@ +import OAI.Analysis.InterpolatedFactors.CornerRange + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 u_10 u_11 u_12 +universe u_13 u_14 u_15 + +open MeasureTheory Set CompactlySupported +open scoped ENNReal +namespace FreeGroupFactorMain.CyclicSpectral + +section +variable {H : Type u_1} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +local instance : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) +abbrev Space := spectrum ℝ A + +instance compactSpace : CompactSpace (Space A) := isCompact_iff_compactSpace.mp (spectrum.isCompact A) + +def functional : C_c(Space A,ℝ) →ₚ[ℝ] ℝ where + toFun f := (inner ℂ ξ (cfcHom hA f.toContinuousMap ξ)).re + map_add' f g := by + change (inner ℂ ξ (cfcHom hA (f.toContinuousMap+g.toContinuousMap) ξ)).re=_ + rw [map_add,add_apply,inner_add_right,Complex.add_re] + map_smul' c f := by + change (inner ℂ ξ (cfcHom hA (c • f.toContinuousMap) ξ)).re=_ + rw [map_smul,_root_.smul_apply] + change inner ℝ ξ (c • cfcHom hA f.toContinuousMap ξ)=c * inner ℝ ξ (cfcHom hA f.toContinuousMap ξ) + exact real_inner_smul_right _ _ _ + monotone' f g hfg := by + have hn : 0 ≤ cfcHom hA (g.toContinuousMap-f.toContinuousMap) := + (cfcHom_nonneg_iff hA).mpr (sub_nonneg.mpr hfg) + have hi := (ContinuousLinearMap.nonneg_iff_isPositive.mp hn).re_inner_nonneg_right ξ + rw [map_sub,sub_apply,inner_sub_right] at hi + change 0 ≤ (inner ℂ ξ (cfcHom hA g.toContinuousMap ξ)).re- + (inner ℂ ξ (cfcHom hA f.toContinuousMap ξ)).re at hi + exact sub_nonneg.mp hi + +def measure : Measure (Space A) := RealRMK.rieszMeasure (functional A hA ξ) + +instance measure_regular : (measure A hA ξ).Regular := inferInstanceAs + (RealRMK.rieszMeasure (functional A hA ξ)).Regular + +instance measure_finite : IsFiniteMeasure (measure A hA ξ) := inferInstance + + theorem integral_continuous (f : C(Space A,ℝ)) : + ∫ x, f x ∂measure A hA ξ=(inner ℂ ξ (cfcHom hA f ξ)).re := by + exact RealRMK.integral_rieszMeasure (functional A hA ξ) + (CompactlySupportedContinuousMap.continuousMapEquiv f) + + theorem measure_univ : measure A hA ξ univ=ENNReal.ofReal (‖ξ‖^2) := by + have hi := integral_continuous A hA ξ (1 : C(Space A,ℝ)) + simp only [ContinuousMap.one_apply,integral_const,map_one,one_apply_eq_self] at hi + have hh : (measure A hA ξ).real univ=‖ξ‖^2 := by + simpa only [smul_eq_mul,mul_one] using hi.trans (norm_sq_eq_re_inner (𝕜 := ℂ) ξ).symm + rw [← hh,Measure.real,ENNReal.ofReal_toReal (measure_ne_top _ _)] + + theorem integral_sq (f : C(Space A,ℝ)) : + ∫ x, (f x)^2 ∂measure A hA ξ=‖cfcHom hA f ξ‖^2 := by + have hi := integral_continuous A hA ξ (f*f) + have hs : IsSelfAdjoint (cfcHom hA f) := cfcHom_predicate hA f + calc + _ = (inner ℂ ξ (cfcHom hA (f*f) ξ)).re := by + simpa only [ContinuousMap.mul_apply,pow_two] using hi + _ = (inner ℂ (cfcHom hA f ξ) (cfcHom hA f ξ)).re := by + rw [map_mul,mul_apply_eq_comp] + have he : inner ℂ ξ (cfcHom hA f (cfcHom hA f ξ))= + inner ℂ (cfcHom hA f ξ) (cfcHom hA f ξ) := by + calc + _ = inner ℂ ξ (star (cfcHom hA f) (cfcHom hA f ξ)) := by rw [hs.star_eq] + _ = _ := by rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + exact congrArg Complex.re he + _ = _ := (norm_sq_eq_re_inner (𝕜 := ℂ) _).symm + + theorem probability (hξ : ‖ξ‖=1) : IsProbabilityMeasure (measure A hA ξ) := by + constructor + rw [measure_univ,hξ,one_pow,ENNReal.ofReal_one] + +end +section +open MeasureTheory +variable {H : Type u_2} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) + +def complexHom : C(Space A,ℂ) →⋆ₐ[ℂ] (H →L[ℂ] H) := + let e := SpectrumRestricts.homeomorph (f := ⟨Complex.re,Complex.continuous_re⟩) hA.spectrumRestricts + (cfcHom hA.isStarNormal).comp (ContinuousMap.compStarAlgHom' ℂ ℂ ⟨e,e.continuous⟩) + +def complexLift (f : C(Space A,ℝ)) : C(Space A,ℂ) := + ⟨fun x => (f x:ℂ), Complex.continuous_ofReal.comp f.continuous⟩ + + theorem complexHom_real (f : C(Space A,ℝ)) : + complexHom A hA (complexLift A f)=cfcHom hA f := by + rw [SpectrumRestricts.cfcHom_eq_restrict ⟨Complex.re,Complex.continuous_re⟩ hA hA.isStarNormal hA.spectrumRestricts] + rfl + + theorem real_inner_im (f : C(Space A,ℝ)) : + (inner ℂ ξ (cfcHom hA f ξ)).im=0 := by + have hs := cfcHom_predicate hA f + have he : star (inner ℂ ξ (cfcHom hA f ξ))=inner ℂ ξ (cfcHom hA f ξ) := by + change (starRingEnd ℂ) (inner ℂ ξ (cfcHom hA f ξ))=_ + rw [inner_conj_symm] + calc + _ = inner ℂ ξ (star (cfcHom hA f) ξ) := by + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + _ = _ := by rw [hs.star_eq] + have hh := congrArg Complex.im he + simp only [Complex.star_def,Complex.conj_im] at hh + linarith + + theorem integral_complexLift (f : C(Space A,ℝ)) : + ∫ x, complexLift A f x ∂measure A hA ξ=inner ℂ ξ (complexHom A hA (complexLift A f) ξ) := by + rw [complexHom_real] + change (∫ x, (f x:ℂ) ∂measure A hA ξ)=_ + rw [integral_complex_ofReal,integral_continuous] + apply Complex.ext + · rfl + · simp only [Complex.ofReal_im,real_inner_im] + + theorem integral_complex (f : C(Space A,ℂ)) : + ∫ x, f x ∂measure A hA ξ=inner ℂ ξ (complexHom A hA f ξ) := by + let fr : C(Space A,ℝ) := ⟨fun x => (f x).re,Complex.continuous_re.comp f.continuous⟩ + let fi : C(Space A,ℝ) := ⟨fun x => (f x).im,Complex.continuous_im.comp f.continuous⟩ + have hf : f=complexLift A fr+Complex.I • complexLift A fi := by + ext x + change f x=(f x).re+(Complex.I:ℂ)*(f x).im + simpa only [mul_comm Complex.I] using (Complex.re_add_im (f x)).symm + rw [hf,map_add,map_smul,add_apply,_root_.smul_apply,inner_add_right,inner_smul_right] + simp only [ContinuousMap.add_apply,ContinuousMap.smul_apply] + have hir : Integrable (fun x => complexLift A fr x) (measure A hA ξ) := + (complexLift A fr).continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + have hii : Integrable (fun x => Complex.I • complexLift A fi x) (measure A hA ξ) := + (((complexLift A fi).continuous.const_smul Complex.I).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)) + rw [integral_add hir hii,integral_smul,integral_complexLift,integral_complexLift] + rfl + +end +section +variable {H : Type u_3} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) + theorem complexHom_mem (S : StarSubalgebra ℂ (H →L[ℂ] H)) + (hS : IsClosed (S : Set (H →L[ℂ] H))) (hAS : A ∈ S) (f : C(Space A,ℂ)) : + complexHom A hA f ∈ S := by + apply StarSubalgebra.topologicalClosure_minimal (t := S) (by simpa) hS + (cfcHom_mem_elemental hA.isStarNormal _) +end +open MeasureTheory +variable {H : Type u_4} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) + +def complexEvaluate : C(Space A,ℂ) →ₗ[ℂ] H := + (ContinuousLinearMap.apply ℂ H ξ).toLinearMap.comp (complexHom A hA).toAlgHom.toLinearMap + + theorem complexEvaluate_inner (f g : C(Space A,ℂ)) : + inner ℂ (complexEvaluate A hA ξ f) (complexEvaluate A hA ξ g)= + inner ℂ (ContinuousMap.toLp 2 (measure A hA ξ) ℂ f) + (ContinuousMap.toLp 2 (measure A hA ξ) ℂ g) := by + rw [ContinuousMap.inner_toLp] + have hi := integral_complex A hA ξ (star f*g) + rw [map_mul,map_star] at hi + change (∫ x, star (f x)*g x ∂measure A hA ξ)= + inner ℂ ξ (star (complexHom A hA f) (complexHom A hA g ξ)) at hi + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] at hi + refine hi.symm.trans ?_ + apply integral_congr_ae + filter_upwards [] with x + exact mul_comm _ _ + + theorem complexEvaluate_norm (f : C(Space A,ℂ)) : + ‖complexEvaluate A hA ξ f‖=‖ContinuousMap.toLp 2 (measure A hA ξ) ℂ f‖ := by + have he := complexEvaluate_inner A hA ξ f f + have hr : ‖complexEvaluate A hA ξ f‖^2=‖ContinuousMap.toLp 2 (measure A hA ξ) ℂ f‖^2 := by + calc + _ = (inner ℂ (complexEvaluate A hA ξ f) (complexEvaluate A hA ξ f)).re := + (inner_self_eq_norm_sq (𝕜 := ℂ) _).symm + _ = _ := congrArg Complex.re he + _ = _ := inner_self_eq_norm_sq (𝕜 := ℂ) _ + nlinarith [norm_nonneg (complexEvaluate A hA ξ f),norm_nonneg (ContinuousMap.toLp 2 (measure A hA ξ) ℂ f)] + +def complexRealize : Lp ℂ 2 (measure A hA ξ) →L[ℂ] H := + (complexEvaluate A hA ξ).extendOfNorm (ContinuousMap.toLp 2 (measure A hA ξ) ℂ).toLinearMap + + theorem complexRealize_continuous (f : C(Space A,ℂ)) : + complexRealize A hA ξ (ContinuousMap.toLp 2 (measure A hA ξ) ℂ f)=complexHom A hA f ξ := by + apply LinearMap.extendOfNorm_eq + · exact ContinuousMap.toLp_denseRange ℂ (measure A hA ξ) ℂ (p := 2) (by norm_num) + · refine ⟨1,fun g => ?_⟩ + change ‖complexEvaluate A hA ξ g‖ ≤ 1 * ‖ContinuousMap.toLp 2 (measure A hA ξ) ℂ g‖ + rw [one_mul,complexEvaluate_norm] + + theorem complexRealize_norm (f : Lp ℂ 2 (measure A hA ξ)) : ‖complexRealize A hA ξ f‖=‖f‖ := by + have hd := ContinuousMap.toLp_denseRange ℂ (measure A hA ξ) ℂ (p := 2) (by norm_num : (2:ℝ≥0∞)≠∞) + refine hd.induction_on (p := fun f => ‖complexRealize A hA ξ f‖=‖f‖) f + (isClosed_eq ((complexRealize A hA ξ).continuous.norm) continuous_norm) ?_ + intro q + rw [complexRealize_continuous] + exact complexEvaluate_norm A hA ξ q + +def complexIsometry : Lp ℂ 2 (measure A hA ξ) →ₗᵢ[ℂ] H where + toLinearMap := (complexRealize A hA ξ).toLinearMap + norm_map' := complexRealize_norm A hA ξ + +end FreeGroupFactorMain.CyclicSpectral +open MeasureTheory ProbabilityTheory Filter Set Function +open scoped Topology ENNReal +namespace FreeGroupFactorMain.ProbabilityTransform + +section +variable (μ : Measure ℝ) [IsProbabilityMeasure μ] [NullSingletonClass μ] + + theorem continuous_cdf : Continuous (cdf μ) := by + apply continuous_iff_continuousAt.mpr + intro x + apply (cdf μ).mono.continuousAt_iff_leftLim_eq_rightLim.mpr + rw [(cdf μ).rightLim_eq] + apply le_antisymm ((cdf μ).mono.leftLim_le le_rfl) + have h : ENNReal.ofReal (cdf μ x-leftLim (cdf μ) x)=0 := by + rw [← (cdf μ).measure_singleton,measure_cdf,measure_singleton] + exact sub_nonpos.mp (ENNReal.ofReal_eq_zero.mp h) + + theorem level_greatest (r : ℝ) (hr : 0 (not_le_of_gt (ha.trans hb)) ((cdf μ).mono h.le)) + have hne : ({x:ℝ | cdf μ x=r}:Set ℝ).Nonempty := by + obtain ⟨x,_,hxr⟩ := intermediate_value_Icc hab (continuous_cdf μ).continuousOn ⟨ha.le,hb.le⟩ + exact ⟨x,hxr⟩ + have hsub : {x:ℝ | cdf μ x=r} ⊆ Icc a b := by + intro x hx + constructor + · apply le_of_not_gt + intro h + have hh := (cdf μ).mono h.le + rw [hx] at hh + exact (not_le_of_gt ha) hh + · exact le_of_not_gt (fun h => (not_le_of_gt hb) ((cdf μ).mono h.le |>.trans_eq hx)) + have hc : IsCompact {x:ℝ | cdf μ x=r} := + isCompact_Icc.of_isClosed_subset (isClosed_eq (continuous_cdf μ) continuous_const) hsub + obtain ⟨x,hx,hmax⟩ := hc.exists_isGreatest hne + refine ⟨x,hx,fun y => ⟨fun hy => ?_,fun hy => ((cdf μ).mono hy).trans_eq hx⟩⟩ + by_contra h + have hxy : x≤y := (lt_of_not_ge h).le + exact h (hmax (le_antisymm hy (hx ▸ (cdf μ).mono hxy))) + + theorem measure_cdf_sublevel (r : ℝ) (hr : 0 hx.trans hr.le) + _ = ENNReal.ofReal r := measure_cdf_sublevel μ r hr hr1 + _ ≤ ENNReal.ofReal (ε:ℝ) := ENNReal.ofReal_le_ofReal (min_le_left _ _) + _ = (ε:ℝ≥0∞) := ENNReal.ofReal_coe_nnreal + + theorem map_cdf : Measure.map (cdf μ) μ=volume.restrict (Icc (0:ℝ) 1) := by + apply Measure.ext_of_Iic + intro r + rw [Measure.map_apply (continuous_cdf μ).measurable measurableSet_Iic, + Measure.restrict_apply measurableSet_Iic] + have hs : Iic r ∩ Icc (0:ℝ) 1=Icc 0 (min r 1) := by + ext x + simp only [mem_inter_iff,mem_Iic,mem_Icc,le_min_iff] + tauto + rw [hs,Real.volume_Icc,sub_zero] + change μ {x:ℝ | cdf μ x≤r}=ENNReal.ofReal (min r 1) + by_cases hr : 0 hx.trans hr') + _ = 0 := measure_cdf_zero μ + rw [hz,ENNReal.ofReal_eq_zero.mpr ((min_le_left _ _).trans hr')] + +end +section +open MeasureTheory ProbabilityTheory Set +variable (μ : Measure ℝ) [IsProbabilityMeasure μ] [NullSingletonClass μ] + +def phase (x : ℝ) : ℂ := Complex.exp ((2*Real.pi*Complex.I)*x) + + theorem phase_continuous : Continuous phase := by + exact Complex.continuous_exp.comp (continuous_const.mul Complex.continuous_ofReal) + + theorem phase_star_mul (x : ℝ) : star (phase x)*phase x=1 := by + change (starRingEnd ℂ) (Complex.exp ((2*Real.pi*Complex.I)*x))*Complex.exp ((2*Real.pi*Complex.I)*x)=1 + rw [← Complex.exp_conj,← Complex.exp_add] + have he : (starRingEnd ℂ) ((2*Real.pi*Complex.I)*x)+(2*Real.pi*Complex.I)*x=0 := by + simp only [map_mul,Complex.conj_ofReal,Complex.conj_I,map_ofNat] + ring + rw [he,Complex.exp_zero] + + theorem phase_uniform_moment (n : ℕ) : + ∫ x:ℝ, phase x^n ∂volume.restrict (Icc (0:ℝ) 1) = if n=0 then 1 else 0 := by + by_cases hn : n=0 + · simp [hn,Measure.real,Real.volume_Icc] + · rw [ite_eq_right hn] + have hrew (x : ℝ) : phase x^n=Complex.exp ((n:ℂ)*(2*Real.pi*Complex.I)*x) := by + rw [phase,← Complex.exp_nat_mul] + congr 1 + ring + simp_rw [hrew] + rw [integral_Icc_eq_integral_Ioc,← intervalIntegral.integral_of_le (by norm_num : (0:ℝ)≤1)] + have hc : (n:ℂ)*(2*Real.pi*Complex.I)≠0 := by + apply mul_ne_zero (by exact_mod_cast hn) + exact mul_ne_zero (mul_ne_zero (by norm_num) (by exact_mod_cast Real.pi_ne_zero)) Complex.I_ne_zero + rw [integral_exp_mul_complex hc] + simp only [Complex.ofReal_one,mul_one,Complex.ofReal_zero,mul_zero,Complex.exp_zero] + have he : Complex.exp ((n:ℂ)*(2*Real.pi*Complex.I))=1 := by + exact_mod_cast Complex.exp_int_mul_two_pi_mul_I (n:ℤ) + rw [he,sub_self,zero_div] + + theorem phase_cdf_moment (n : ℕ) : + ∫ x:ℝ, phase (cdf μ x)^n ∂μ=if n=0 then 1 else 0 := by + have hi := integral_map (μ := μ) (continuous_cdf μ).measurable.aemeasurable + (phase_continuous.pow n).aestronglyMeasurable + rw [map_cdf μ] at hi + exact hi.symm.trans (phase_uniform_moment n) + +end +section +open MeasureTheory ProbabilityTheory Set Filter +variable (μ : Measure ℝ) [IsProbabilityMeasure μ] [NullSingletonClass μ] + + theorem measure_cdf_le (r : ℝ) (hr : 0≤r) (hr1 : r≤1) : + μ {x:ℝ | cdf μ x≤r}=ENNReal.ofReal r := by + by_cases h0 : r=0 + · subst r + simpa using measure_cdf_zero μ + by_cases h1 : r=1 + · subst r + have hs : {x:ℝ | cdf μ x≤1}=univ := by + ext x + simp [cdf_le_one] + rw [hs,measure_univ,ENNReal.ofReal_one] + exact measure_cdf_sublevel μ r (lt_of_le_of_ne hr (Ne.symm h0)) (lt_of_le_of_ne hr1 h1) + + theorem cdf_cut_ae (r : ℝ) : ∀ᵐ x ∂μ, x≤r ↔ cdf μ x≤cdf μ r := by + have he : (Iic r : Set ℝ)=ᵐ[μ] {x:ℝ | cdf μ x≤cdf μ r} := by + apply ae_eq_of_subset_of_measure_ge + · exact fun x hx => (cdf μ).mono hx + · rw [measure_cdf_le μ _ (cdf_nonneg μ r) (cdf_le_one μ r),ofReal_cdf] + · exact measurableSet_Iic.nullMeasurableSet + · exact measure_ne_top _ _ + filter_upwards [he] with x hx + exact iff_of_eq hx + + theorem cdf_injective_conull : + ∃ s : Set ℝ, μ sᶜ=0 ∧ Set.InjOn (cdf μ) s := by + let s : Set ℝ := {x | ∀ q:ℚ, x≤(q:ℝ) ↔ cdf μ x≤cdf μ (q:ℝ)} + refine ⟨s,?_,?_⟩ + · have he : ∀ᵐ x ∂μ, ∀ q:ℚ, x≤(q:ℝ) ↔ cdf μ x≤cdf μ (q:ℝ) := + ae_all_iff.mpr (fun q => cdf_cut_ae μ (q:ℝ)) + exact ae_iff.mp he + · intro x hx y hy hxy + apply le_antisymm + · by_contra h + obtain ⟨q,hyq,hqx⟩ := exists_rat_btwn (lt_of_not_ge h) + have hyc := (hy q).mp hyq.le + rw [← hxy] at hyc + exact (not_le_of_gt hqx) ((hx q).mpr hyc) + · by_contra h + obtain ⟨q,hxq,hqy⟩ := exists_rat_btwn (lt_of_not_ge h) + have hxc := (hx q).mp hxq.le + rw [hxy] at hxc + exact (not_le_of_gt hqy) ((hy q).mpr hxc) + + theorem cdf_between_ae : ∀ᵐ x ∂μ, 0 phase (cdf μ x)) s := by + obtain ⟨s,hs,hinj⟩ := cdf_injective_conull μ + refine ⟨s ∩ {x | 0 phase (cdf μ y) + have hf : Measurable f := + (phase_continuous.comp (continuous_cdf μ)).measurable.comp measurable_subtype_coe + have hfi : Injective f := by + intro y z he + apply Subtype.ext + exact hinj (hts y.property) (hts z.property) he + let e : MeasurableEmbedding f := hf.measurableEmbedding hfi + refine ⟨fun z => (e.invFun z:ℝ),measurable_subtype_coe.comp e.measurable_invFun,?_⟩ + filter_upwards [hae] with y hy + exact congrArg Subtype.val (e.leftInverse_invFun (⟨y,hy⟩:t)) + +end +open MeasureTheory ProbabilityTheory Set Function Filter +variable (μ : Measure ℝ) [IsProbabilityMeasure μ] [NullSingletonClass μ] + +def haarMeasure : Measure ℂ := μ.map (fun x => phase (cdf μ x)) + + theorem haarTransform_measurable : Measurable (fun x => phase (cdf μ x)) := + (phase_continuous.comp (continuous_cdf μ)).measurable + + theorem haarTransform_preserving : + MeasurePreserving (fun x => phase (cdf μ x)) μ (haarMeasure μ) := + ⟨haarTransform_measurable μ,rfl⟩ + + theorem haarPullback_surjective : Function.Surjective + (Lp.compMeasurePreservingₗᵢ ℂ (fun x => phase (cdf μ x)) + (haarTransform_preserving μ) : Lp ℂ 2 (haarMeasure μ) →ₗᵢ[ℂ] Lp ℂ 2 μ) := by + obtain ⟨g,hg,hleft⟩ := exists_measurable_phase_inverse μ + have hpres : MeasurePreserving g (haarMeasure μ) μ := by + refine ⟨hg,?_⟩ + change (μ.map (fun x => phase (cdf μ x))).map g=μ + rw [Measure.map_map hg (haarTransform_measurable μ)] + exact (Measure.map_congr hleft).trans (Measure.map_id) + intro u + let v := Lp.compMeasurePreserving g hpres u + refine ⟨v,?_⟩ + apply Lp.ext + have hv := (haarTransform_preserving μ).quasiMeasurePreserving.ae + (Lp.coeFn_compMeasurePreserving u hpres) + have hc := Lp.coeFn_compMeasurePreserving v (haarTransform_preserving μ) + filter_upwards [hc,hv,hleft] with x hxc hxv hxl + exact hxc.trans (hxv.trans (congrArg (fun y => u y) hxl)) + +noncomputable def haarL2Equiv : Lp ℂ 2 (haarMeasure μ) ≃ₗᵢ[ℂ] Lp ℂ 2 μ := + LinearIsometryEquiv.ofSurjective + (Lp.compMeasurePreservingₗᵢ ℂ (fun x => phase (cdf μ x)) (haarTransform_preserving μ)) + (haarPullback_surjective μ) + + theorem haarL2Equiv_apply (u : Lp ℂ 2 (haarMeasure μ)) : + haarL2Equiv μ u =ᵐ[μ] fun x => u (phase (cdf μ x)) := + Lp.coeFn_compMeasurePreserving u (haarTransform_preserving μ) + +instance haarMeasure_probability : IsProbabilityMeasure (haarMeasure μ) := + (Measure.isProbabilityMeasure_map_iff (haarTransform_measurable μ).aemeasurable).mpr + inferInstance + + theorem haar_boundedContinuous_dense : DenseRange + (fun f : BoundedContinuousFunction ℂ ℂ => haarL2Equiv μ + (BoundedContinuousFunction.toLp 2 (haarMeasure μ) ℂ f)) := by + exact (haarL2Equiv μ).surjective.denseRange.comp + (BoundedContinuousFunction.toLp_denseRange ℂ (haarMeasure μ) ℂ (p := 2) (by norm_num)) + (haarL2Equiv μ).continuous + +end FreeGroupFactorMain.ProbabilityTransform +namespace FreeGroupFactorMain.SpectralPullback +open MeasureTheory Function Filter +variable {X : Type u_5} {Y : Type u_6} [MeasurableSpace X] [MeasurableSpace Y] +variable (μ : Measure X) {f : X → Y} (e : MeasurableEmbedding f) [Nonempty X] + +theorem pullback_surjective : Function.Surjective + (Lp.compMeasurePreservingₗᵢ ℂ f ⟨e.measurable,rfl⟩ : + Lp ℂ 2 (μ.map f) →ₗᵢ[ℂ] Lp ℂ 2 μ) := by + have hleft : e.invFun ∘ f=id := funext e.leftInverse_invFun + have hpres : MeasurePreserving e.invFun (μ.map f) μ := by + refine ⟨e.measurable_invFun,?_⟩ + rw [Measure.map_map e.measurable_invFun e.measurable,hleft,Measure.map_id] + intro u + let v := Lp.compMeasurePreserving e.invFun hpres u + let hp : MeasurePreserving f μ (μ.map f) := ⟨e.measurable,rfl⟩ + refine ⟨v,?_⟩ + apply Lp.ext + have hv := hp.quasiMeasurePreserving.ae (Lp.coeFn_compMeasurePreserving u hpres) + have hc := Lp.coeFn_compMeasurePreserving v hp + filter_upwards [hc,hv] with x hxc hxv + exact hxc.trans (hxv.trans (congrArg (fun y => u y) (e.leftInverse_invFun x))) + +noncomputable def equivalence : Lp ℂ 2 (μ.map f) ≃ₗᵢ[ℂ] Lp ℂ 2 μ := + LinearIsometryEquiv.ofSurjective (Lp.compMeasurePreservingₗᵢ ℂ f ⟨e.measurable,rfl⟩) + (pullback_surjective μ e) + + theorem equivalence_apply (u : Lp ℂ 2 (μ.map f)) : + equivalence μ e u =ᵐ[μ] fun x => u (f x) := + Lp.coeFn_compMeasurePreserving u ⟨e.measurable,rfl⟩ +end FreeGroupFactorMain.SpectralPullback +namespace FreeGroupFactorMain.CyclicSpectral + +section +open MeasureTheory ProbabilityTheory Set +variable {H : Type u_7} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) + +def realMeasure : Measure ℝ := Measure.map (fun x : Space A => (x:ℝ)) (measure A hA ξ) + +instance realMeasure_probability [IsProbabilityMeasure (measure A hA ξ)] : + IsProbabilityMeasure (realMeasure A hA ξ) := + (Measure.isProbabilityMeasure_map_iff measurable_subtype_coe.aemeasurable).mpr inferInstance + +instance realMeasure_noAtoms [NullSingletonClass (measure A hA ξ)] : + NullSingletonClass (realMeasure A hA ξ) where + measure_singleton x := by + rw [realMeasure,Measure.map_apply measurable_subtype_coe (measurableSet_singleton x)] + by_cases hx : x ∈ Space A + · have he : (fun y : Space A => (y:ℝ)) ⁻¹' {x}={⟨x,hx⟩} := by + ext y + simp only [mem_preimage,mem_singleton_iff,Subtype.ext_iff] + rw [he,measure_singleton] + · have he : (fun y : Space A => (y:ℝ)) ⁻¹' {x}=∅ := by + ext y + simp only [mem_preimage,mem_singleton_iff,mem_empty_iff_false,iff_false] + intro hy + exact hx (hy ▸ y.property) + rw [he,measure_empty] + +variable [IsProbabilityMeasure (measure A hA ξ)] [NullSingletonClass (measure A hA ξ)] + +def haarFunction : C(Space A,ℂ) := + ⟨fun x => ProbabilityTransform.phase (cdf (realMeasure A hA ξ) x), + ProbabilityTransform.phase_continuous.comp + ((ProbabilityTransform.continuous_cdf (realMeasure A hA ξ)).comp continuous_subtype_val)⟩ + + theorem haarFunction_unitary : haarFunction A hA ξ ∈ unitary C(Space A,ℂ) := by + apply Unitary.mem_iff.mpr + constructor + · ext x + change star (ProbabilityTransform.phase _)*ProbabilityTransform.phase _=1 + exact ProbabilityTransform.phase_star_mul _ + · ext x + change ProbabilityTransform.phase _*star (ProbabilityTransform.phase _)=1 + rw [mul_comm] + exact ProbabilityTransform.phase_star_mul _ + +def haarUnitary : unitary (H →L[ℂ] H) := + ⟨complexHom A hA (haarFunction A hA ξ),Unitary.map_mem (complexHom A hA) (haarFunction_unitary A hA ξ)⟩ + + theorem haarUnitary_moment (n : ℕ) : + inner ℂ ξ (((haarUnitary A hA ξ : H →L[ℂ] H)^n) ξ)=if n=0 then 1 else 0 := by + change inner ℂ ξ (((complexHom A hA (haarFunction A hA ξ))^n) ξ)=_ + rw [← map_pow,← integral_complex] + change (∫ x:Space A, ProbabilityTransform.phase (cdf (realMeasure A hA ξ) x)^n ∂measure A hA ξ)=_ + have hi := integral_map (μ := measure A hA ξ) measurable_subtype_coe.aemeasurable + (((ProbabilityTransform.phase_continuous.comp + (ProbabilityTransform.continuous_cdf (realMeasure A hA ξ))).pow n).aestronglyMeasurable) + exact hi.symm.trans (ProbabilityTransform.phase_cdf_moment (realMeasure A hA ξ) n) + +end +section +open MeasureTheory Set Function Filter +variable {H : Type u_8} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) +variable [IsProbabilityMeasure (measure A hA ξ)] [NullSingletonClass (measure A hA ξ)] + +noncomputable def realL2Equiv : Lp ℂ 2 (realMeasure A hA ξ) ≃ₗᵢ[ℂ] Lp ℂ 2 (measure A hA ξ) := by + let : Nonempty (Space A) := nonempty_of_isProbabilityMeasure (measure A hA ξ) + exact SpectralPullback.equivalence (measure A hA ξ) + (MeasurableEmbedding.subtype_coe (spectrum.isClosed A).measurableSet) + +omit [NullSingletonClass (measure A hA ξ)] in + theorem realL2Equiv_apply (u : Lp ℂ 2 (realMeasure A hA ξ)) : + realL2Equiv A hA ξ u =ᵐ[measure A hA ξ] fun x => u (x:ℝ) := by + exact Lp.coeFn_compMeasurePreserving u ⟨measurable_subtype_coe,rfl⟩ + +noncomputable def haarSpectralTransfer : + Lp ℂ 2 (ProbabilityTransform.haarMeasure (realMeasure A hA ξ)) ≃ₗᵢ[ℂ] + Lp ℂ 2 (measure A hA ξ) := + (ProbabilityTransform.haarL2Equiv (realMeasure A hA ξ)).trans (realL2Equiv A hA ξ) + + theorem haarSpectralTransfer_continuous (q : BoundedContinuousFunction ℂ ℂ) : + haarSpectralTransfer A hA ξ + (BoundedContinuousFunction.toLp 2 (ProbabilityTransform.haarMeasure (realMeasure A hA ξ)) ℂ q) + = ContinuousMap.toLp 2 (measure A hA ξ) ℂ (q.toContinuousMap.comp (haarFunction A hA ξ)) := by + let μ := realMeasure A hA ξ + let u := BoundedContinuousFunction.toLp 2 (ProbabilityTransform.haarMeasure μ) ℂ q + let hp : MeasurePreserving (fun x : Space A => (x:ℝ)) (measure A hA ξ) μ := + ⟨measurable_subtype_coe,rfl⟩ + have h1 := realL2Equiv_apply A hA ξ (ProbabilityTransform.haarL2Equiv μ u) + have h2 := hp.quasiMeasurePreserving.ae (ProbabilityTransform.haarL2Equiv_apply μ u) + have h3 := hp.quasiMeasurePreserving.ae + ((ProbabilityTransform.haarTransform_preserving μ).quasiMeasurePreserving.ae + (BoundedContinuousFunction.coeFn_toLp 2 (ProbabilityTransform.haarMeasure μ) ℂ q)) + have h4 := ContinuousMap.coeFn_toLp (𝕜 := ℂ) (p := 2) (measure A hA ξ) (q.toContinuousMap.comp (haarFunction A hA ξ)) + apply Lp.ext + filter_upwards [h1,h2,h3,h4] with x hx1 hx2 hx3 hx4 + exact hx1.trans (hx2.trans (hx3.trans hx4.symm)) + + theorem haar_spectral_functions_dense : DenseRange + (fun q : BoundedContinuousFunction ℂ ℂ => ContinuousMap.toLp 2 (measure A hA ξ) ℂ + (q.toContinuousMap.comp (haarFunction A hA ξ))) := by + have hd := (haarSpectralTransfer A hA ξ).surjective.denseRange.comp + (BoundedContinuousFunction.toLp_denseRange ℂ + (ProbabilityTransform.haarMeasure (realMeasure A hA ξ)) ℂ (p := 2) (by norm_num)) + (haarSpectralTransfer A hA ξ).continuous + convert hd using 1 + funext q + exact (haarSpectralTransfer_continuous A hA ξ q).symm + +end +section +open MeasureTheory Set Function Filter +variable {H : Type u_9} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) +variable [IsProbabilityMeasure (measure A hA ξ)] [NullSingletonClass (measure A hA ξ)] + + theorem haar_cyclic_contains_continuous (f : C(Space A,ℂ)) : + complexHom A hA f ξ ∈ closure (Set.range (fun q : BoundedContinuousFunction ℂ ℂ => + complexHom A hA (q.toContinuousMap.comp (haarFunction A hA ξ)) ξ)) := by + let s := closure (Set.range (fun q : BoundedContinuousFunction ℂ ℂ => + complexHom A hA (q.toContinuousMap.comp (haarFunction A hA ξ)) ξ)) + have hd := haar_spectral_functions_dense A hA ξ + have hall : ∀ v : Lp ℂ 2 (measure A hA ξ), complexRealize A hA ξ v ∈ s := by + intro v + refine hd.induction_on (p := fun v => complexRealize A hA ξ v ∈ s) v + (isClosed_closure.preimage (complexRealize A hA ξ).continuous) ?_ + intro q + rw [complexRealize_continuous] + exact subset_closure (Set.mem_range_self q) + simpa only [complexRealize_continuous] using hall (ContinuousMap.toLp 2 (measure A hA ξ) ℂ f) + + theorem haar_cyclic_contains_operator : + A ξ ∈ closure (Set.range (fun q : BoundedContinuousFunction ℂ ℂ => + complexHom A hA (q.toContinuousMap.comp (haarFunction A hA ξ)) ξ)) := by + have h := haar_cyclic_contains_continuous A hA ξ + (complexLift A ((ContinuousMap.id ℝ).restrict (spectrum ℝ A))) + rwa [complexHom_real,cfcHom_id] at h + +end +section +variable {H : Type u_10} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) + + theorem complexHom_continuous : Continuous (complexHom A hA) := by + exact AddMonoidHomClass.continuous_of_bound (complexHom A hA) 1 + (by simpa only [one_mul] using NonUnitalStarAlgHom.norm_apply_le (complexHom A hA)) + + theorem complexHom_composition (f : C(Space A,ℂ)) (q : C(ℂ,ℂ)) : + complexHom A hA (q.comp f)=cfc q (complexHom A hA f) := by + have he : cfc q f=q.comp f := by + ext x + have hh := (ContinuousMap.evalStarAlgHom ℂ ℂ x).map_cfc q f + q.continuous.continuousOn (continuous_eval_const x) + change cfc q f x=cfc q (f x) at hh + rw [hh] + exact cfc_algebraMap (A := ℂ) (f x) q + rw [← he] + exact (complexHom A hA).map_cfc q f q.continuous.continuousOn (complexHom_continuous A hA) + + theorem complexHom_composition_mem (f : C(Space A,ℂ)) (q : C(ℂ,ℂ)) + (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : IsClosed (S : Set (H →L[ℂ] H))) + (hf : complexHom A hA f ∈ S) : complexHom A hA (q.comp f) ∈ S := by + rw [complexHom_composition] + apply StarSubalgebra.topologicalClosure_minimal (t := S) (by simpa) hS + (cfc_mem_elemental _ _) + +end +section +open MeasureTheory Set Function Filter + +def scalarClip (R : ℝ) (z : ℂ) : ℂ := (max (-R) (min R z.re) : ℝ) + theorem continuous_scalarClip (R : ℝ) : Continuous (scalarClip R) := by + unfold scalarClip + fun_prop + theorem norm_scalarClip (R : ℝ) (hR : 0 ≤ R) (z : ℂ) : ‖scalarClip R z‖ ≤ R := by + simp only [scalarClip,Complex.norm_real,Real.norm_eq_abs,abs_le] + exact ⟨le_max_left _ _, max_le (by linarith) (min_le_left _ _)⟩ + theorem scalarClip_error (R x : ℝ) (hx : |x| ≤ R) (z : ℂ) : + ‖scalarClip R z-(x:ℂ)‖ ≤ ‖z-(x:ℂ)‖ := by + have hx' := abs_le.mp hx + have he : |max (-R) (min R z.re)-x| ≤ |z.re-x| := by + by_cases hz : z.re ≤ R + · rw [min_eq_right hz] + by_cases hl : -R ≤ z.re + · rw [max_eq_right hl] + · rw [max_eq_left (le_of_not_ge hl),abs_of_nonpos (by linarith)] + exact (by linarith [neg_le_abs (z.re-x)]) + · rw [min_eq_left (le_of_not_ge hz),max_eq_right (by linarith),abs_of_nonneg (by linarith)] + exact (by linarith [le_abs_self (z.re-x)]) + calc + _ = |max (-R) (min R z.re)-x| := by + rw [scalarClip,← Complex.ofReal_sub,Complex.norm_real,Real.norm_eq_abs] + _ ≤ |z.re-x| := he + _ ≤ _ := by simpa using Complex.abs_re_le_norm (z-(x:ℂ)) + +variable {H : Type u_11} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) + +def clipFunction (q : C(ℂ,ℂ)) : C(ℂ,ℂ) := ⟨scalarClip ‖A‖ ∘ q,(continuous_scalarClip ‖A‖).comp q.continuous⟩ + + theorem clipFunction_norm (q : C(ℂ,ℂ)) (f : C(Space A,ℂ)) : + ‖complexHom A hA ((clipFunction A q).comp f)‖ ≤ ‖A‖ := by + apply (NonUnitalStarAlgHom.norm_apply_le _ _).trans + apply (ContinuousMap.norm_le _ (norm_nonneg _)).mpr + intro x + exact norm_scalarClip ‖A‖ (norm_nonneg _) _ +end +open MeasureTheory Set Function Filter +variable {H : Type u_12} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] [Nontrivial H] +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) +variable [IsProbabilityMeasure (measure A hA ξ)] [NullSingletonClass (measure A hA ξ)] + +def coordinate : C(Space A,ℂ) := complexLift A ((ContinuousMap.id ℝ).restrict (spectrum ℝ A)) +omit [Nontrivial H] in + theorem complexHom_coordinate : complexHom A hA (coordinate A)=A := by + rw [coordinate,complexHom_real,cfcHom_id] + +omit [IsProbabilityMeasure (measure A hA ξ)] [NullSingletonClass (measure A hA ξ)] in + theorem clip_vector_error (q : C(ℂ,ℂ)) (f : C(Space A,ℂ)) : + ‖complexHom A hA ((clipFunction A q).comp f) ξ-A ξ‖ ≤ + ‖complexHom A hA (q.comp f) ξ-A ξ‖ := by + have hc : A ξ=complexHom A hA (coordinate A) ξ := + congrArg (fun T : H →L[ℂ] H => T ξ) (complexHom_coordinate A hA).symm + rw [hc] + have heval (g : C(Space A,ℂ)) : complexEvaluate A hA ξ (g-coordinate A)= + complexHom A hA g ξ-complexHom A hA (coordinate A) ξ := by + simp [complexEvaluate] + rw [← heval,← heval] + rw [complexEvaluate_norm,complexEvaluate_norm] + apply Lp.norm_le_norm_of_ae_le + filter_upwards [ContinuousMap.coeFn_toLp (𝕜 := ℂ) (p := 2) (measure A hA ξ) + (((clipFunction A q).comp f)-coordinate A), + ContinuousMap.coeFn_toLp (𝕜 := ℂ) (p := 2) (measure A hA ξ) (q.comp f-coordinate A)] with x h1 h2 + rw [h1,h2] + apply scalarClip_error + change |(x:ℝ)| ≤ ‖A‖ + simpa only [Real.norm_eq_abs] using spectrum.norm_le_norm_of_mem x.property + + theorem bounded_haar_approx (ε : ℝ) (hε : 0 < ε) : + ∃ T : H →L[ℂ] H, + T ∈ StarAlgebra.elemental ℂ (haarUnitary A hA ξ : H →L[ℂ] H) ∧ + ‖T‖ ≤ ‖A‖ ∧ ‖T ξ-A ξ‖ < ε := by + obtain ⟨v,⟨q,rfl⟩,hq⟩ := Metric.mem_closure_iff.mp + (haar_cyclic_contains_operator A hA ξ) ε hε + refine ⟨complexHom A hA ((clipFunction A q.toContinuousMap).comp (haarFunction A hA ξ)),?_, + clipFunction_norm A hA _ _,?_⟩ + · apply complexHom_composition_mem + · exact StarAlgebra.elemental.isClosed _ _ + · exact StarAlgebra.elemental.self_mem _ _ + · exact (clip_vector_error A hA ξ _ _).trans_lt (by simpa only [dist_eq_norm,norm_sub_rev] using hq) +end FreeGroupFactorMain.CyclicSpectral +namespace FreeGroupFactorMain +open Filter Topology +variable {E : Type u_13} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +omit [CompleteSpace E] in +theorem strong_limit_of_bounded_total {ι : Type u_14} + (T : ℕ → E →L[ℂ] E) (A : E →L[ℂ] E) (C : ℝ) (hbound : ∀ n, ‖T n‖ ≤ C) + (v : ι → E) (htotal : (Submodule.span ℂ (Set.range v)).topologicalClosure=⊤) + (hv : ∀ i, Tendsto (fun n => T n (v i)) atTop (𝓝 (A (v i)))) + (ξ : E) : Tendsto (fun n => T n ξ) atTop (𝓝 (A ξ)) := by + have heq : Equicontinuous (fun n => (T n : E → E)) := by + apply Metric.equicontinuous_of_continuity_modulus (fun r : ℝ => C*r) + (by simpa using (tendsto_const_nhds.mul (tendsto_id : Tendsto (id : ℝ → ℝ) (𝓝 0) (𝓝 0)))) + intro x y n + rw [dist_eq_norm,← map_sub] + exact (T n).le_opNorm (x-y) |>.trans + (by simpa only [dist_eq_norm] using mul_le_mul_of_nonneg_right (hbound n) (norm_nonneg (x-y))) + let L : Submodule ℂ E := { + carrier := {ξ | Tendsto (fun n => T n ξ) atTop (𝓝 (A ξ))} + zero_mem' := by simp + add_mem' := by + intro x y hx hy + simpa only [Set.mem_ofPred_eq,map_add] using hx.add hy + smul_mem' := by + intro c x hx + simpa only [Set.mem_ofPred_eq,map_smul] using hx.const_smul c } + have hclosed : IsClosed (L : Set E) := heq.isClosed_setOfPred_tendsto A.continuous + have hle : Submodule.span ℂ (Set.range v) ≤ L := + Submodule.span_le.mpr (by rintro _ ⟨i,rfl⟩; exact hv i) + have hh := Submodule.topologicalClosure_minimal _ hle hclosed + rw [htotal] at hh + exact hh (Submodule.mem_top) +end FreeGroupFactorMain + +namespace FreeGroupFactorMain.CyclicSpectral +open Filter Topology Set MeasureTheory +variable {E : Type u_15} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] [Nontrivial E] +variable (A : E →L[ℂ] E) (hA : IsSelfAdjoint A) (ξ : E) +variable [IsProbabilityMeasure (measure A hA ξ)] [NullSingletonClass (measure A hA ξ)] + +theorem operator_mem_haar_bicommutant (M : StarSubalgebra ℂ (E →L[ℂ] E)) + (hM : IsClosed (M : Set (E →L[ℂ] E))) (hAM : A∈M) + (htotal : (Submodule.span ℂ (Set.range (fun B : StarSubalgebra.centralizer ℂ (M : Set (E →L[ℂ] E)) => + (B : E →L[ℂ] E) ξ))).topologicalClosure=⊤) : + A ∈ StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ + ({(haarUnitary A hA ξ : E →L[ℂ] E)} : Set (E →L[ℂ] E)) : Set (E →L[ℂ] E)) := by + have hU : (haarUnitary A hA ξ : E →L[ℂ] E)∈M := by + exact complexHom_mem A hA M hM hAM _ + have hb (n : ℕ) := bounded_haar_approx A hA ξ (1/((n:ℝ)+1)) (by positivity) + choose T hmem hnorm herr using hb + have hT (n : ℕ) : T n∈M := StarAlgebra.elemental.le_of_mem hM hU (hmem n) + have hv : Tendsto (fun n => T n ξ) atTop (𝓝 (A ξ)) := by + have h := squeeze_zero_norm (fun n => (herr n).le) + (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)) + simpa only [sub_add_cancel,zero_add] using h.add_const (A ξ) + have hstrong : ∀ ζ, Tendsto (fun n => T n ζ) atTop (𝓝 (A ζ)) := by + apply strong_limit_of_bounded_total T A ‖A‖ hnorm _ htotal + intro B + have hB (D : E →L[ℂ] E) (hD : D∈M) : D ((B : E →L[ℂ] E) ξ)=(B : E →L[ℂ] E) (D ξ) := + DFunLike.congr_fun (((StarSubalgebra.mem_centralizer_iff ℂ).mp B.property D hD).1) ξ + simpa only [hB _ (hT _),hB _ hAM,Function.comp_def] using + (B : E →L[ℂ] E).continuous.continuousAt.tendsto.comp hv + let N := StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ + ({(haarUnitary A hA ξ : E →L[ℂ] E)} : Set (E →L[ℂ] E)) : Set (E →L[ℂ] E)) + have hN : IsClosed (N : Set (E →L[ℂ] E)) := Set.isClosed_centralizer _ + have hUN : (haarUnitary A hA ξ : E →L[ℂ] E)∈N := + StarAlgebra.adjoin_le_centralizer_centralizer ℂ _ (StarAlgebra.subset_adjoin ℂ _ (Set.mem_singleton _)) + have hTN (n : ℕ) : T n∈N := StarAlgebra.elemental.le_of_mem hN hUN (hmem n) + rw [StarSubalgebra.mem_centralizer_iff] + intro B hB + have hb' (D : E →L[ℂ] E) (hD : D∈StarSubalgebra.centralizer ℂ + ({(haarUnitary A hA ξ : E →L[ℂ] E)} : Set (E →L[ℂ] E))) : D*A=A*D := by + ext ζ + have he n := congrArg (fun Q : E →L[ℂ] E => Q ζ) + ((StarSubalgebra.mem_centralizer_iff ℂ).mp (hTN n) D hD).1 + exact tendsto_nhds_unique ((D.continuous.continuousAt.tendsto.comp (hstrong ζ)).congr + (fun n => he n)) (hstrong (D ζ)) + exact ⟨hb' B hB,hb' (star B) (star_mem hB)⟩ +end FreeGroupFactorMain.CyclicSpectral + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Interpolation.lean b/lean/OAI/Analysis/InterpolatedFactors/Interpolation.lean new file mode 100644 index 0000000000000000000000000000000000000000..02ed2bdb906deef0e7a164c41759f27d4d3b78ea --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Interpolation.lean @@ -0,0 +1,255 @@ +import OAI.Analysis.InterpolatedFactors.NormalTransport + +namespace OAI + +noncomputable section + +universe u_1 + +namespace FreeGroupFactorMain.Interpolation +open Amplification +open scoped ENNReal + +theorem selectedProjection_trace (a : ℝ) (ha : 0 stabilizedProjectionTrace p.val=ENNReal.ofReal a) + obtain ⟨p,hp,ht⟩ := (rankTwo_allPositiveScaling a ha).1 + exact ⟨⟨p,hp⟩,ht⟩ + +theorem interpolationScale_pos (r : ℝ) (hr : 1 exact groupNormal_of_iso (finiteRank_to_two n hm) + | continuous r => + exact (rankTwo_allPositiveScaling _ (interpolationScale_pos r hm)).2 _ _ + (selectedProjection_trace _ (interpolationScale_pos r hm)) + | infinity => exact groupNormal_of_iso (rankTwo.trans rankThreeInfinite).symm + +theorem Model.allIsomorphic (m n : Model) (hm : m.Valid) (hn : n.Valid) : + Nonempty (m.Iso n) := by + obtain ⟨E⟩ := m.toRankTwo hm + obtain ⟨F⟩ := n.toRankTwo hn + exact ⟨E.trans F.symm⟩ + +theorem Model.projection_exists (m : Model) (hm : m.Valid) (t : ℝ) (ht : 0 exact (groupAllPositive_of_rankTwo (finiteRank_to_two n hm) t ht).1 + | infinity => exact (infinite_allPositiveScaling t ht).1 + | continuous r => + exact cornerStabilization_projection_exists + (fun a ha => (rankTwo_allPositiveScaling a ha).2) rankTwo_smallScaling + _ (interpolationScale_pos r hm) (selectedProjection (interpolationScale r)).val + (selectedProjection (interpolationScale r)).property (selectedProjection_trace _ (interpolationScale_pos r hm)) t ht + +theorem Model.allPositive (m : Model) (hm : m.Valid) (t : ℝ) (ht : 0 exact (groupAllPositive_of_rankTwo (finiteRank_to_two n hm) t ht).2 p hp hpτ + | infinity => exact (infinite_allPositiveScaling t ht).2 p hp hpτ + | continuous r => + exact cornerStabilization_allPositive (fun a ha => (rankTwo_allPositiveScaling a ha).2) + _ (interpolationScale_pos r hm) _ _ (selectedProjection_trace _ (interpolationScale_pos r hm)) + t ht p hp hpτ + +theorem Model.fundamentalGroup_eq (m : Model) (hm : m.Valid) : m.fundamentalGroup=Set.Ioi (0:ℝ) := by + ext t + constructor + · exact fun h => h.1 + · intro ht + obtain ⟨p,hp,hpτ⟩ := m.projection_exists hm t ht + exact ⟨ht,p,hp,hpτ,m.allPositive hm t ht p hp hpτ⟩ + +@[simp] theorem parameterModel_top : parameterModel ⊤=Model.infinity := by + classical + simp [parameterModel] + +@[simp] theorem parameterModel_nat (n : ℕ) : parameterModel (n:ℝ≥0∞)=Model.integer n := by + classical + have hn : ∃k : ℕ,(n:ℝ≥0∞)=(k:ℝ≥0∞) := ⟨n,rfl⟩ + simp only [parameterModel,ENNReal.natCast_ne_top,ite_false,dite_eq_left hn] + congr 1 + exact_mod_cast hn.choose_spec.symm + +theorem parameterModel_nonnatural (r : ℝ≥0∞) (hrtop : r≠⊤) + (hrnat : ¬∃n : ℕ,r=(n:ℝ≥0∞)) : parameterModel r=Model.continuous r.toReal := by + classical + simp only [parameterModel,ite_eq_right hrtop,dite_eq_right hrnat] + +theorem parameterModel_valid (r : ℝ≥0∞) (hr : 1 matrixEntry S i j) hl + · simpa only [matrixEntry_mul_diagonal] using congrArg (fun S => matrixEntry S i j) hr + · intro h + refine ⟨fun i j => (h i j).1,?_,?_⟩ + · apply matrixEntry_ext + intro i j + rw [matrixEntry_diagonal_mul] + exact (h i j).2.1 + · apply matrixEntry_ext + intro i j + rw [matrixEntry_mul_diagonal] + exact (h i j).2.2 + +variable [DecidableEq G] + +theorem corner_weight_tensor_formula (a : ℝ) (p : stabilization G) (hp : IsStarProjection p) + (x : CornerStabilization p hp) : + cornerStabilizationProjectionTrace a p hp x = + (ENNReal.ofReal a)⁻¹ * ∑' i : ℕ, ∑' j : ℕ, + ENNReal.ofReal (‖(flattenStabilizationIso.symm x.val : GroupOperator (ℕ × (ℕ × G))) + (lp.single 2 (i,j,1) (1:ℂ))‖^2) := by + unfold cornerStabilizationProjectionTrace + apply congrArg ((ENNReal.ofReal a)⁻¹ * ·) + simpa only [StarAlgEquiv.apply_symm_apply] using + (flatten_projectionTrace ((flattenStabilizationIso (G := G)).symm x.val)) + +end FreeGroupFactorMain.Amplification + +namespace FreeGroupFactorMain.Interpolation +open Amplification +open scoped ENNReal + +theorem standardCornerScale_pos (n : ℕ) (hn : 2≤n) (r : ℝ) (hr : 1.mpr hr + +theorem interpolatedFactor_nat (n : ℕ) : + InterpolatedFactor (n:ℝ≥0∞)=groupVonNeumann (FreeGroupRank n) := by + unfold InterpolatedFactor + rw [parameterModel_nat] + rfl + +theorem interpolatedFactor_infinity : InterpolatedFactor ⊤=groupVonNeumann (FreeGroup ℕ) := by + unfold InterpolatedFactor + rw [parameterModel_top] + rfl + +theorem interpolatedTrace_one (r : ℝ≥0∞) (hr : 1 + K.subtypeL.comp ((T:K →L[ℂ] K).comp K.orthogonalProjectionOnto)) := + (HilbertUltraweak.sandwich_continuous K.subtypeL K.orthogonalProjectionOnto).comp continuous_subtype_val + have hc := HilbertUltraweak.add_continuous he + ((HilbertUltraweak.sandwich_continuous (star v) v).comp he) + convert hc using 1 + rfl +end FreeGroupFactorMain.FullReducingCorner + +namespace FreeGroupFactorMain.GaussianRecognition.System +open ReducingSubspace FullReducingCorner +variable {A : Type u_6} {E : Type u_7} {I : Type u_8} [Ring A] [StarRing A] [Algebra ℂ A] +variable [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable {covariance : I → I → A → A} (X : System A E I covariance) +variable (σ : I → I) (v : E →L[ℂ] E) (hvs : v∈StarSubalgebra.centralizer ℂ (X.generators σ)) +variable (hpv : X.normalHull.starProjection*v=v) (hvr : v*(1-X.normalHull.starProjection)=v) +variable (hvi : star v*v=1-X.normalHull.starProjection) + +theorem fullReductionIso_symm_normal : + @Continuous _ _ (X.reducedSystem.generatedTopology σ) (X.generatedTopology σ) + (X.fullReductionIso σ v hvs hpv hvr hvi).symm := by + let : TopologicalSpace (Operator E) := ultraweak E + let : TopologicalSpace (X.normalHull →L[ℂ] X.normalHull) := ultraweak X.normalHull + let : TopologicalSpace (X.reducedSystem.generated σ) := X.reducedSystem.generatedTopology σ + apply continuous_induced_rng.mpr + have he : Continuous (fun T : X.reducedSystem.generated σ => + X.normalHull.subtypeL.comp ((T:X.normalHull →L[ℂ] X.normalHull).comp X.normalHull.orthogonalProjectionOnto)) := + (HilbertUltraweak.sandwich_continuous X.normalHull.subtypeL X.normalHull.orthogonalProjectionOnto).comp continuous_subtype_val + have hc := HilbertUltraweak.add_continuous he + ((HilbertUltraweak.sandwich_continuous (star v) v).comp he) + convert hc using 1 + rfl +end FreeGroupFactorMain.GaussianRecognition.System + +namespace FreeGroupFactorMain.WeightedFock +open FreeFock GaussianRecognition +variable (u v : ℝ) (hv : 0 (reduced_weighted_scalar_state u v hv hvu a).symm) + (weightedSystem u v hv hvu).reducedSystem_total scalarSystem_total scalarFlip + +theorem fullGaussianIso_symm_normal : + @Continuous _ _ (scalarSystem.generatedTopology scalarFlip) + ((weightedSystem u v hv hvu).generatedTopology scalarFlip) (fullGaussianIso u v hv hvu).symm := by + let : TopologicalSpace ((weightedSystem u v hv hvu).generated scalarFlip) := + (weightedSystem u v hv hvu).generatedTopology scalarFlip + let : TopologicalSpace ((weightedSystem u v hv hvu).reducedSystem.generated scalarFlip) := + (weightedSystem u v hv hvu).reducedSystem.generatedTopology scalarFlip + let : TopologicalSpace (scalarSystem.generated scalarFlip) := scalarSystem.generatedTopology scalarFlip + exact ((weightedSystem u v hv hvu).fullReductionIso_symm_normal scalarFlip (pRightEdge u v) + (pRightEdge_mem_weightedCommutant u v hv hvu) (weightedFull_left u v hv hvu) + (weightedFull_right u v hv hvu) (weightedFull_initial u v hv hvu)).comp + (reducedGaussianIso_symm_normal u v hv hvu) + +variable (hu : u≠0) (hv' : v≠0) (hunit : u^2+v^2=1) +theorem ambientGaussianIso_symm_normal : + @Continuous _ _ (scalarSystem.generatedTopology scalarFlip) + ((ambientSystem u v hu hv' hunit).generatedTopology scalarFlip) (ambientGaussianIso u v hu hv' hunit).symm := + (ambientSystem u v hu hv' hunit).generatedIso_symm_normal scalarSystem + (scalar_ambient_state u v hu hv' hunit) + (ambientSystem_total u v hu hv' hunit) scalarSystem_total scalarFlip +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Jacobi.lean b/lean/OAI/Analysis/InterpolatedFactors/Jacobi.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed8c35625d6ab80789e2338e22a4ee999abd812e --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Jacobi.lean @@ -0,0 +1,389 @@ +import OAI.Analysis.InterpolatedFactors.Rerouting + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 + +open Filter Topology +namespace FreeGroupFactorMain.JacobiNonatom + +def invariant (a c : ℂ) (x : ℕ → ℂ) (n : ℕ) : ℂ := + a*((x n)^2+(x (n+1))^2)-c*x n*x (n+1) + + theorem invariant_step (a c : ℂ) (ha : a≠0) (x : ℕ → ℂ) + (h : ∀ n,a*x (n+2)=c*x (n+1)-a*x n) (n : ℕ) : + invariant a c x (n+1)=invariant a c x n := by + apply mul_left_cancel₀ ha + calc + a*invariant a c x (n+1)=a*invariant a c x n+ + (a*x (n+2)-a*x n)*(a*x (n+2)+a*x n-c*x (n+1)) := by + simp only [invariant,Nat.add_assoc] + ring + _ = a*invariant a c x n := by rw [h];ring + + theorem invariant_constant (a c : ℂ) (ha : a≠0) (x : ℕ → ℂ) + (h : ∀ n,a*x (n+2)=c*x (n+1)-a*x n) (n : ℕ) : + invariant a c x n=invariant a c x 0 := by + induction n with + | zero => rfl + | succ n ih => rw [invariant_step a c ha x h,ih] + + theorem invariant_zero (a c : ℂ) (ha : a≠0) (x : ℕ → ℂ) + (h : ∀ n,a*x (n+2)=c*x (n+1)-a*x n) + (hx : Tendsto x atTop (𝓝 0)) : invariant a c x 0=0 := by + have hx' := hx.comp (tendsto_add_atTop_nat 1) + have hl : Tendsto (invariant a c x) atTop (𝓝 0) := by + have h₁ : Tendsto (fun n => a*((x n)^2+(x (n+1))^2)) atTop + (𝓝 (a*((0:ℂ)^2+0^2))) := + tendsto_const_nhds.mul ((hx.pow 2).add (hx'.pow 2)) + have h₂ : Tendsto (fun n => c*x n*x (n+1)) atTop (𝓝 (c*0*0)) := + (tendsto_const_nhds.mul hx).mul hx' + change Tendsto (fun n => a*((x n)^2+(x (n+1))^2)-c*x n*x (n+1)) atTop (𝓝 0) + simpa only [zero_pow (by decide : (2:ℕ)≠0),zero_add,mul_zero,sub_zero] + using h₁.sub h₂ + have he : invariant a c x=(fun _ : ℕ => invariant a c x 0) := + funext (invariant_constant a c ha x h) + rw [he] at hl + exact tendsto_nhds_unique tendsto_const_nhds hl + + theorem nonzero_eigenvector_zero (u v z : ℂ) (hu : u≠0) (hv : v≠0) (hz : z≠0) + (x : ℕ → ℂ) (hx : Tendsto x atTop (𝓝 0)) + (hfirst : (u*v)*x 1=(z-u^2)*x 0) + (hstep : ∀ n,(u*v)*x (n+2)=(z-u^2-v^2)*x (n+1)-(u*v)*x n) : + ∀ n,x n=0 := by + have hi := invariant_zero (u*v) (z-u^2-v^2) (mul_ne_zero hu hv) x hstep hx + have hb : (u*v)*invariant (u*v) (z-u^2-v^2) x 0=z*v^2*(x 0)^2 := by + calc + _ = (u*v)^2*(x 0)^2+((u*v)*x 1)^2- + (z-u^2-v^2)*x 0*((u*v)*x 1) := by simp only [invariant];ring + _ = _ := by rw [hfirst];ring + rw [hi,mul_zero] at hb + have h0 : x 0=0 := by + have hz : (x 0)^2=0 := (mul_eq_zero.mp hb.symm).resolve_left + (mul_ne_zero hz (pow_ne_zero 2 hv)) + exact (sq_eq_zero_iff).mp hz + have h1 : x 1=0 := by + rw [h0,mul_zero] at hfirst + exact (mul_eq_zero.mp hfirst).resolve_left (mul_ne_zero hu hv) + intro n + induction n using Nat.twoStepInduction with + | zero => exact h0 + | one => exact h1 + | more n hn hn1 => + have h := hstep n + rw [hn,hn1,mul_zero,mul_zero,sub_self] at h + exact (mul_eq_zero.mp h).resolve_left (mul_ne_zero hu hv) + +end FreeGroupFactorMain.JacobiNonatom +namespace FreeGroupFactorMain.WeightedFock + +section +open FreeFock Filter Topology +open scoped ENNReal +variable {ι : Type u_1} [DecidableEq ι] + +def jacobiList (i : ι) : ℕ → List (ι × Bool) + | 0 => [] + | n+1 => (i,false)::(i,true)::jacobiList i n + +def jacobiPath (i : ι) (n : ℕ) : Path ι := (jacobiList i n,false) +def oddJacobiPath (i : ι) (n : ℕ) : Path ι := ((i,true)::jacobiList i n,false) +def jacobiBasis (i : ι) (n : ℕ) : H ι := lp.single 2 (jacobiPath i n) 1 +def oddJacobiBasis (i : ι) (n : ℕ) : H ι := lp.single 2 (oddJacobiPath i n) 1 + +omit [DecidableEq ι] in +@[simp] theorem jacobiList_length (i : ι) (n : ℕ) : (jacobiList i n).length=2*n := by + induction n with + | zero => rfl + | succ n ih => simp only [jacobiList,List.length_cons,ih];omega + +omit [DecidableEq ι] in + theorem jacobiPath_injective (i : ι) : Function.Injective (jacobiPath i) := by + intro n m h + have hh := congrArg (fun w : Path ι => w.1.length) h + simp only [jacobiPath,jacobiList_length] at hh + omega + +omit [DecidableEq ι] in +@[simp] theorem jacobiPath_start (i : ι) (n : ℕ) : start (jacobiPath i n)=false := by + cases n <;> rfl +omit [DecidableEq ι] in +@[simp] theorem oddJacobiPath_start (i : ι) (n : ℕ) : start (oddJacobiPath i n)=true := rfl + + theorem offDiagonal_jacobi_zero (u v : ℝ) (i : ι) : + offDiagonal u v i (jacobiBasis i 0)=(u:ℂ) • oddJacobiBasis i 0 := by + simp only [offDiagonal_edges,jacobiBasis,jacobiPath,jacobiList,oddJacobiBasis, + oddJacobiPath,_root_.smul_apply,add_apply,edgeCreation_single,edgeAnnihilation_nil, + smul_zero,add_zero] + rfl + + theorem offDiagonal_jacobi_succ (u v : ℝ) (i : ι) (n : ℕ) : + offDiagonal u v i (jacobiBasis i (n+1))= + (u:ℂ) • oddJacobiBasis i (n+1)+(v:ℂ) • oddJacobiBasis i n := by + simp only [offDiagonal_edges,jacobiBasis,jacobiPath,jacobiList,oddJacobiBasis, + oddJacobiPath,_root_.smul_apply,add_apply,edgeCreation_single,edgeAnnihilation_cons, + start,ite_true,eq_self,true_and] + + theorem offDiagonalStar_oddJacobi (u v : ℝ) (i : ι) (n : ℕ) : + star (offDiagonal u v i) (oddJacobiBasis i n)= + (u:ℂ) • jacobiBasis i n+(v:ℂ) • jacobiBasis i (n+1) := by + cases n <;> + simp only [offDiagonal_edges,star_add (R := Operator ι),star_smul,star_star,Complex.star_def, + Complex.conj_ofReal,jacobiBasis,jacobiPath,jacobiList,oddJacobiBasis,oddJacobiPath, + _root_.smul_apply,add_apply,edgeCreation_single,edgeAnnihilation_cons, + start,ite_true,eq_self,true_and] + + def edgeSquare (u v : ℝ) (i : ι) : Operator ι := star (offDiagonal u v i)*offDiagonal u v i + + theorem edgeSquare_selfAdjoint (u v : ℝ) (i : ι) : IsSelfAdjoint (edgeSquare u v i) := by + simp [IsSelfAdjoint,edgeSquare,star_mul] + + theorem edgeSquare_jacobi_zero (u v : ℝ) (i : ι) : + edgeSquare u v i (jacobiBasis i 0)= + ((u:ℂ)^2) • jacobiBasis i 0+((u:ℂ)*v) • jacobiBasis i 1 := by + rw [edgeSquare,mul_apply_eq_comp,offDiagonal_jacobi_zero,map_smul,offDiagonalStar_oddJacobi] + simp only [smul_add,smul_smul,pow_two] + + theorem edgeSquare_jacobi_succ (u v : ℝ) (i : ι) (n : ℕ) : + edgeSquare u v i (jacobiBasis i (n+1))= + ((u:ℂ)*v) • jacobiBasis i n+ + ((u:ℂ)^2+(v:ℂ)^2) • jacobiBasis i (n+1)+ + ((u:ℂ)*v) • jacobiBasis i (n+2) := by + rw [edgeSquare,mul_apply_eq_comp,offDiagonal_jacobi_succ,map_add,map_smul, + map_smul,offDiagonalStar_oddJacobi,offDiagonalStar_oddJacobi] + simp only [smul_add,smul_smul,pow_two,add_smul,Nat.add_assoc] + module + +omit [DecidableEq ι] in + theorem jacobi_coordinates_decay (i : ι) (ξ : H ι) : + Tendsto (fun n => ξ (jacobiPath i n)) atTop (𝓝 0) := by + have hs : Summable (fun w : Path ι => ‖ξ w‖^2) := by + simpa using (lp.memℓp ξ).summable (by norm_num : (0:ℝ)<(2:ℝ≥0∞).toReal) + have ht := (hs.comp_injective (jacobiPath_injective i)).tendsto_atTop_zero + have hh := Real.continuous_sqrt.continuousAt.tendsto.comp ht + have hn : Tendsto (fun n => ‖ξ (jacobiPath i n)‖) atTop (𝓝 0) := by + simpa only [Function.comp_def,Real.sqrt_sq_eq_abs,abs_norm,Real.sqrt_zero] using hh + exact tendsto_zero_iff_norm_tendsto_zero.mpr hn + + theorem edgeSquare_eigen_coordinates (u v : ℝ) (i : ι) (z : ℂ) (ξ : H ι) + (hξ : edgeSquare u v i ξ=z • ξ) : + ((u:ℂ)*v)*ξ (jacobiPath i 1)=(z-(u:ℂ)^2)*ξ (jacobiPath i 0) ∧ + ∀ n,((u:ℂ)*v)*ξ (jacobiPath i (n+2))= + (z-(u:ℂ)^2-(v:ℂ)^2)*ξ (jacobiPath i (n+1))- + ((u:ℂ)*v)*ξ (jacobiPath i n) := by + have he (n : ℕ) : inner ℂ (edgeSquare u v i (jacobiBasis i n)) ξ= + z*ξ (jacobiPath i n) := by + rw [← (edgeSquare_selfAdjoint u v i).star_eq,ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_left,hξ,inner_smul_right] + simp [jacobiBasis,lp.inner_single_left,RCLike.inner_apply] + constructor + · have h := he 0 + rw [edgeSquare_jacobi_zero] at h + simp [jacobiBasis,lp.inner_single_left, + RCLike.inner_apply] at h + linear_combination h + · intro n + have h := he (n+1) + rw [edgeSquare_jacobi_succ] at h + simp [jacobiBasis,lp.inner_single_left, + RCLike.inner_apply] at h + linear_combination h + + theorem edgeSquare_eigen_root_zero (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i : ι) (z : ℂ) (hz : z≠0) (ξ : H ι) (hξ : edgeSquare u v i ξ=z • ξ) : + ξ ([],false)=0 := by + have h := edgeSquare_eigen_coordinates u v i z ξ hξ + exact JacobiNonatom.nonzero_eigenvector_zero (u:ℂ) (v:ℂ) z + (Complex.ofReal_ne_zero.mpr hu) (Complex.ofReal_ne_zero.mpr hv) hz + (fun n => ξ (jacobiPath i n)) (jacobi_coordinates_decay i ξ) h.1 h.2 0 + +end + +section +open FreeFock +variable {ι : Type u_2} + +def flipPath : Path ι ≃ Path ι where + toFun w := (w.1.map (fun a => (a.1,!a.2)),!w.2) + invFun w := (w.1.map (fun a => (a.1,!a.2)),!w.2) + left_inv w := by + rcases w with ⟨l,b⟩ + simp only [List.map_map,Function.comp_def,Bool.not_not] + simp + right_inv w := by + rcases w with ⟨l,b⟩ + simp only [List.map_map,Function.comp_def,Bool.not_not] + simp + +@[simp] theorem flipPath_apply (w : Path ι) : flipPath w=(w.1.map (fun a => (a.1,!a.2)),!w.2) := rfl + +@[simp] theorem flipPath_involutive (w : Path ι) : flipPath (flipPath w)=w := by + rcases w with ⟨l,b⟩ + simp only [flipPath_apply,List.map_map,Function.comp_def,Bool.not_not] + simp + +@[simp] theorem flipPath_symm (w : Path ι) : flipPath.symm w=flipPath w := by + apply flipPath.injective + rw [Equiv.apply_symm_apply,flipPath_involutive] + +@[simp] theorem start_flipPath (w : Path ι) : start (flipPath w)=!(start w) := by + rcases w with ⟨l,b⟩ + cases l <;> rfl + +def flipSpatial : H ι ≃ₗᵢ[ℂ] H ι := hilbertReindex flipPath + +@[simp] theorem flipSpatial_apply (ξ : H ι) (w : Path ι) : flipSpatial ξ w=ξ (flipPath w) := by + simp only [flipSpatial,hilbertReindex_apply,flipPath_symm] + +variable [DecidableEq ι] + +theorem flipSpatial_single (w : Path ι) (z : ℂ) : + flipSpatial (lp.single 2 w z)=lp.single 2 (flipPath w) z := by + ext a + simp only [flipSpatial_apply,lp.single_apply,Pi.single_apply] + by_cases h : flipPath w=a + · subst a + simp only [flipPath_involutive,ite_true] + · have hh : w≠flipPath a := by + intro he + apply h + rw [he,flipPath_involutive] + simp_all [eq_comm] + +theorem flipSpatial_vertex_intertwines (r : Bool) (ξ : H ι) : + flipSpatial (vertex r ξ)=vertex (!r) (flipSpatial ξ) := by + have he : flipSpatial.toContinuousLinearEquiv.toContinuousLinearMap*(vertex r : Operator ι)= + vertex (!r)*flipSpatial.toContinuousLinearEquiv.toContinuousLinearMap := by + apply operator_basis_ext + intro w + simp only [mul_apply_eq_comp,LinearIsometryEquiv.coe_toContinuousLinearEquiv, + ContinuousLinearEquiv.coe_coe,vertex_single,flipSpatial_single,start_flipPath] + split_ifs with h h' h' <;> simp_all [flipSpatial_single] + exact DFunLike.congr_fun he ξ + +theorem flipSpatial_conjugates_vertex (r : Bool) : + flipSpatial.conjStarAlgEquiv (vertex r : Operator ι)=vertex (!r) := by + ext ξ + simp only [LinearIsometryEquiv.conjStarAlgEquiv_apply_apply] + rw [flipSpatial_vertex_intertwines,LinearIsometryEquiv.apply_symm_apply] + +theorem flipSpatial_creation_intertwines (i : ι) (r : Bool) (ξ : H ι) : + flipSpatial (creation i r ξ)=creation i (!r) (flipSpatial ξ) := by + have he : flipSpatial.toContinuousLinearEquiv.toContinuousLinearMap*creation i r= + creation i (!r)*flipSpatial.toContinuousLinearEquiv.toContinuousLinearMap := by + apply operator_basis_ext + intro w + simp only [mul_apply_eq_comp,LinearIsometryEquiv.coe_toContinuousLinearEquiv, + ContinuousLinearEquiv.coe_coe,creation_single,flipSpatial_single,flipPath_apply,List.map_cons] + exact DFunLike.congr_fun he ξ + +theorem flipSpatial_conjugates_creation (i : ι) (r : Bool) : + flipSpatial.conjStarAlgEquiv (creation i r)=creation i (!r) := by + ext ξ + simp only [LinearIsometryEquiv.conjStarAlgEquiv_apply_apply] + rw [flipSpatial_creation_intertwines,LinearIsometryEquiv.apply_symm_apply] + +theorem flipSpatial_conjugates_edgeCreation (i : ι) (r s : Bool) : + flipSpatial.conjStarAlgEquiv (edgeCreation i r s)=edgeCreation i (!r) (!s) := by + rw [edgeCreation,map_mul,flipSpatial_conjugates_creation,flipSpatial_conjugates_vertex] + rfl + +theorem flipSpatial_conjugates_offDiagonal (u v : ℝ) (i : ι) : + flipSpatial.conjStarAlgEquiv (offDiagonal u v i)=star (offDiagonal v u i) := by + simp only [offDiagonal_edges,map_add,map_smul,map_star,flipSpatial_conjugates_edgeCreation, + Bool.not_true,Bool.not_false,star_add (R := Operator ι),star_smul,star_star,Complex.star_def,Complex.conj_ofReal] + exact add_comm _ _ + +theorem flipSpatial_conjugates_edgeSquare (u v : ℝ) (i : ι) : + flipSpatial.conjStarAlgEquiv (edgeSquare u v i)=offDiagonal v u i*star (offDiagonal v u i) := by + rw [edgeSquare,map_mul,map_star,flipSpatial_conjugates_offDiagonal,star_star] + +theorem leftEdgeSquare_eigen_root_zero (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i : ι) (z : ℂ) (hz : z≠0) (ξ : H ι) + (hξ : (offDiagonal u v i*star (offDiagonal u v i)) ξ=z • ξ) : ξ ([],true)=0 := by + have he : edgeSquare v u i (flipSpatial.symm ξ)=z • flipSpatial.symm ξ := by + apply flipSpatial.injective + rw [map_smul,LinearIsometryEquiv.apply_symm_apply] + have hh := DFunLike.congr_fun (flipSpatial_conjugates_edgeSquare v u i) ξ + simpa only [LinearIsometryEquiv.conjStarAlgEquiv_apply_apply] using hh.trans hξ + have hh := edgeSquare_eigen_root_zero v u hv hu i z hz (flipSpatial.symm ξ) he + have hh' : flipSpatial.symm ξ=flipSpatial ξ := by + apply flipSpatial.injective + rw [LinearIsometryEquiv.apply_symm_apply] + ext w + simp only [flipSpatial_apply,flipPath_involutive] + rw [hh',flipSpatial_apply] at hh + exact hh + +end +open FreeFock Amplification.Polar +variable {ι : Type u_3} [DecidableEq ι] + +def leftModulus (u v : ℝ) (i : ι) : Operator ι := offDiagonal u v i*star (edgePolar u v i) + +theorem leftModulus_selfAdjoint (u v : ℝ) (i : ι) : IsSelfAdjoint (leftModulus u v i) := + edge_left_modulus_selfAdjoint u v i + +theorem leftModulus_square (u v : ℝ) (hv : 0≤v) (hvu : v rfl + +@[simp] theorem matrixEntry_matrixBlock (i j k l : ℕ) (T : GroupOperator G) : + matrixEntry (matrixBlock i j T) k l=if k=i ∧ l=j then T else 0 := by + ext ξ g + simp only [matrixEntry_apply,matrixBlock_apply,productCoordinate_productSingle] + by_cases hk : k=i <;> by_cases hl : l=j <;> simp [hk,hl,show (j=l) ↔ (l=j) from eq_comm] + +@[simp] theorem matrixBlock_zero (i j : ℕ) : matrixBlock i j (0 : GroupOperator G)=0 := by + ext ξ ⟨k,g⟩ + simp + +@[simp] theorem matrixBlock_mul (i j k l : ℕ) (T S : GroupOperator G) : + matrixBlock i j T * matrixBlock k l S=if j=k then matrixBlock i l (T*S) else 0 := by + ext ξ ⟨m,g⟩ + simp only [mul_apply_eq_comp,matrixBlock_apply] + have hc : productCoordinate ℕ G j (matrixBlock k l S ξ)= + if j=k then S (productCoordinate ℕ G l ξ) else 0 := by + change productCoordinate ℕ G j (productSingle ℕ G k (S (productCoordinate ℕ G l ξ)))=_ + rw [productCoordinate_productSingle] + rw [hc] + by_cases hj : j=k <;> by_cases hm : m=i <;> simp [hj,hm,mul_apply_eq_comp] + +@[simp] theorem matrixBlock_star (i j : ℕ) (T : GroupOperator G) : + star (matrixBlock i j T)=matrixBlock j i (star T) := by + apply matrixEntry_ext + intro k l + rw [matrixEntry_star,matrixEntry_matrixBlock,matrixEntry_matrixBlock] + by_cases h : l=i ∧ k=j + · simp only [ite_eq_left h,ite_eq_left (And.symm h)] + · simp only [ite_eq_right h,ite_eq_right (fun hh => h (And.symm hh)),star_zero (GroupOperator G)] + +theorem matrixBlock_mem [Group G] (i j : ℕ) (T : groupVonNeumann G) : + matrixBlock i j (T : GroupOperator G)∈stabilization G := by + rw [mem_stabilization_iff_matrix] + intro k l + rw [matrixEntry_matrixBlock] + split_ifs + · exact T.property + · exact (groupVonNeumann G).zero_mem + +def finiteMatrix (n : ℕ) (X : Fin n → Fin n → GroupOperator G) : GroupOperator (ℕ × G) := + ∑ i : Fin n, ∑ j : Fin n, matrixBlock i.val j.val (X i j) + +@[simp] theorem matrixEntry_sum {ι : Type u_2} (s : Finset ι) (X : ι → GroupOperator (ℕ × G)) (i j : ℕ) : + matrixEntry (∑ k∈s,X k) i j=∑ k∈s,matrixEntry (X k) i j := by + classical + induction s using Finset.induction_on with + | empty => ext ξ g; simp [matrixEntry_apply] + | @insert a s ha ih => + simp only [Finset.sum_insert ha] + rw [show matrixEntry (X a + ∑ k∈s,X k) i j=matrixEntry (X a) i j+matrixEntry (∑ k∈s,X k) i j by ext ξ g; simp [matrixEntry_apply],ih] + +theorem matrixEntry_finiteMatrix (n : ℕ) (X : Fin n → Fin n → GroupOperator G) (i j : Fin n) : + matrixEntry (finiteMatrix n X) i.val j.val=X i j := by + classical + simp [finiteMatrix,matrixEntry_sum,matrixEntry_matrixBlock,Fin.val_inj,ite_and] + +theorem matrixEntry_finiteMatrix_out (n : ℕ) (X : Fin n → Fin n → GroupOperator G) (i j : ℕ) + (h : n ≤ i ∨ n ≤ j) : matrixEntry (finiteMatrix n X) i j=0 := by + classical + simp only [finiteMatrix,matrixEntry_sum,matrixEntry_matrixBlock] + apply Finset.sum_eq_zero + intro a _ + apply Finset.sum_eq_zero + intro b _ + rw [ite_eq_right] + rintro ⟨rfl,rfl⟩ + cases h with + | inl h => exact (not_le_of_gt a.isLt) h + | inr h => exact (not_le_of_gt b.isLt) h + +theorem finiteMatrix_mem [Group G] (n : ℕ) (X : Fin n → Fin n → groupVonNeumann G) : + finiteMatrix n (fun i j => (X i j : GroupOperator G))∈stabilization G := by + classical + exact (stabilization G).sum_mem (fun i _ => (stabilization G).sum_mem (fun j _ => matrixBlock_mem i.val j.val (X i j))) + +@[simp] theorem matrixBlock_add (i j : ℕ) (T S : GroupOperator G) : + matrixBlock i j (T+S)=matrixBlock i j T+matrixBlock i j S := by + ext ξ ⟨k,g⟩ + by_cases h : k=i <;> simp [h] + +@[simp] theorem matrixBlock_smul (i j : ℕ) (c : ℂ) (T : GroupOperator G) : + matrixBlock i j (c • T)=c • matrixBlock i j T := by + ext ξ ⟨k,g⟩ + by_cases h : k=i <;> simp [h] + +@[simp] theorem matrixBlock_sum {ι : Type u_3} (i j : ℕ) (s : Finset ι) (T : ι → GroupOperator G) : + matrixBlock i j (∑ k∈s,T k)=∑ k∈s,matrixBlock i j (T k) := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert a s ha ih => simp [ha,ih] + + theorem matrixBlock_mul_finiteMatrix (n : ℕ) (i : ℕ) (j : Fin n) (T : GroupOperator G) + (Y : Fin n → Fin n → GroupOperator G) : + matrixBlock i j.val T * finiteMatrix n Y=∑ l : Fin n,matrixBlock i l.val (T*Y j l) := by + classical + simp only [finiteMatrix,Finset.mul_sum,matrixBlock_mul,Fin.val_inj] + rw [Finset.sum_comm] + congr 1 + ext l + simp + + theorem finiteMatrix_mul (n : ℕ) (X Y : Fin n → Fin n → GroupOperator G) : + finiteMatrix n X * finiteMatrix n Y=finiteMatrix n (fun i j => ∑ k : Fin n,X i k*Y k j) := by + classical + simp only [finiteMatrix,Finset.sum_mul] + change (∑ i : Fin n,∑ j : Fin n,matrixBlock i.val j.val (X i j)*finiteMatrix n Y)=_ + simp only [matrixBlock_mul_finiteMatrix,matrixBlock_sum] + apply Finset.sum_congr rfl + intro i _ + exact Finset.sum_comm + + theorem finiteMatrix_add (n : ℕ) (X Y : Fin n → Fin n → GroupOperator G) : + finiteMatrix n (fun i j => X i j+Y i j)=finiteMatrix n X+finiteMatrix n Y := by + classical + simp [finiteMatrix,Finset.sum_add_distrib] + + theorem finiteMatrix_star (n : ℕ) (X : Fin n → Fin n → GroupOperator G) : + star (finiteMatrix n X)=finiteMatrix n (fun i j => star (X j i)) := by + classical + simp only [finiteMatrix,star_sum (R := GroupOperator (ℕ × G)),matrixBlock_star] + exact Finset.sum_comm + + theorem finiteMatrix_smul (n : ℕ) (X : Fin n → Fin n → GroupOperator G) (c : ℂ) : + finiteMatrix n (fun i j => c • X i j)=c • finiteMatrix n X := by + classical + simp [finiteMatrix,Finset.smul_sum] + + def finiteDiagonal (n : ℕ) (T : GroupOperator G) : GroupOperator (ℕ × G) := + finiteMatrix n (fun i j => if i=j then T else 0) + + theorem finiteDiagonal_sum (n : ℕ) (T : GroupOperator G) : + finiteDiagonal n T=∑ i : Fin n,matrixBlock i.val i.val T := by + classical + simp only [finiteDiagonal,finiteMatrix] + apply Finset.sum_congr rfl + intro i _ + have hh (j : Fin n) : matrixBlock i.val j.val (if i=j then T else 0)=if i=j then matrixBlock i.val j.val T else 0 := by split_ifs <;> simp + simp_rw [hh] + simp + + theorem finiteDiagonal_mul (n : ℕ) (T S : GroupOperator G) : + finiteDiagonal n T*finiteDiagonal n S=finiteDiagonal n (T*S) := by + classical + rw [finiteDiagonal,finiteDiagonal,finiteMatrix_mul] + congr 1 + funext i j + simp + + theorem finiteDiagonal_star (n : ℕ) (T : GroupOperator G) : + star (finiteDiagonal n T)=finiteDiagonal n (star T) := by + classical + rw [finiteDiagonal,finiteMatrix_star] + congr 1 + funext i j + split_ifs <;> simp_all [eq_comm,star_zero (R := GroupOperator G)] + +theorem matrixBlock_sandwich (i j k l : ℕ) (A B : GroupOperator G) (T : GroupOperator (ℕ × G)) : + matrixBlock i j A*T*matrixBlock k l B=matrixBlock i l (A*matrixEntry T j k*B) := by + apply ContinuousLinearMap.ext + intro ξ + rfl + + theorem finiteDiagonal_sandwich (n : ℕ) (A B : GroupOperator G) (T : GroupOperator (ℕ × G)) : + finiteDiagonal n A*T*finiteDiagonal n B= + finiteMatrix n (fun i j => A*matrixEntry T i.val j.val*B) := by + classical + simp only [finiteDiagonal_sum,Finset.sum_mul,Finset.mul_sum,matrixBlock_sandwich,finiteMatrix] + exact Finset.sum_comm + +variable [Group G] + + def finiteProjection (n : ℕ) (p : groupVonNeumann G) : stabilization G := + ⟨finiteDiagonal n (p : GroupOperator G),by + classical + rw [finiteDiagonal_sum] + exact (stabilization G).sum_mem (fun i _ => matrixBlock_mem i.val i.val p)⟩ + + theorem finiteProjection_projection (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) : + IsStarProjection (finiteProjection n p) := by + constructor + · apply Subtype.ext + change finiteDiagonal n (p : GroupOperator G)*finiteDiagonal n (p : GroupOperator G)=_ + rw [finiteDiagonal_mul] + exact congrArg (finiteDiagonal n) (congrArg Subtype.val hp.isIdempotentElem.eq) + · apply Subtype.ext + change star (finiteDiagonal n (p : GroupOperator G))=_ + rw [finiteDiagonal_star] + exact congrArg (finiteDiagonal n) (congrArg Subtype.val hp.isSelfAdjoint.star_eq) + + theorem finiteDiagonal_entries (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (x : Corner (finiteProjection n p) (finiteProjection_projection n p hp)) : + finiteMatrix n (fun i j => (p : GroupOperator G)*matrixEntry (x.val : GroupOperator (ℕ × G)) i.val j.val*(p : GroupOperator G))= + (x.val : GroupOperator (ℕ × G)) := by + rw [←finiteDiagonal_sandwich] + change ((finiteProjection n p * x.val * finiteProjection n p : stabilization G) : GroupOperator (ℕ × G))=_ + rw [x.property.1,x.property.2] + +end + +open scoped ENNReal +variable {G : Type u_4} [Group G] + +abbrev FiniteCorner (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) := + Corner (finiteProjection n p) (finiteProjection_projection n p hp) + +theorem finiteCorner_entry_sandwich (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (x : FiniteCorner n p hp) (i j : Fin n) : + (p : GroupOperator G)*matrixEntry (x.val : GroupOperator (ℕ × G)) i.val j.val*(p : GroupOperator G)= + matrixEntry (x.val : GroupOperator (ℕ × G)) i.val j.val := by + have hh := congrArg (fun T : GroupOperator (ℕ × G) => matrixEntry T i.val j.val) + (finiteDiagonal_entries n p hp x) + rwa [matrixEntry_finiteMatrix] at hh + +def finiteCornerEntry (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (x : FiniteCorner n p hp) (i j : Fin n) : Corner p hp := by + let T : groupVonNeumann G := ⟨matrixEntry (x.val : GroupOperator (ℕ × G)) i.val j.val, + (mem_stabilization_iff_matrix _).mp x.val.property i.val j.val⟩ + have hh : p*T*p=T := Subtype.ext (finiteCorner_entry_sandwich n p hp x i j) + refine ⟨T,?_,?_⟩ + · calc p*T=p*(p*T*p) := congrArg (p*·) hh.symm + _=p*T*p := by rw [←mul_assoc,←mul_assoc,hp.isIdempotentElem.eq] + _=T := hh + · calc T*p=(p*T*p)*p := congrArg (·*p) hh.symm + _=p*T*p := by rw [mul_assoc (p*T),hp.isIdempotentElem.eq] + _=T := hh + +theorem finiteCorner_reconstruct (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (x : FiniteCorner n p hp) : + finiteMatrix n (fun i j => ((finiteCornerEntry n p hp x i j).val : GroupOperator G))= + (x.val : GroupOperator (ℕ × G)) := by + have he : (fun i j : Fin n => ((finiteCornerEntry n p hp x i j).val : GroupOperator G))= + (fun i j : Fin n => (p : GroupOperator G)*matrixEntry (x.val : GroupOperator (ℕ × G)) i.val j.val*(p : GroupOperator G)) := by + funext i j + exact (finiteCorner_entry_sandwich n p hp x i j).symm + rw [he] + exact finiteDiagonal_entries n p hp x + +theorem finiteCorner_ext (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (x y : FiniteCorner n p hp) (h : ∀ i j,finiteCornerEntry n p hp x i j=finiteCornerEntry n p hp y i j) : x=y := by + apply Subtype.ext + apply Subtype.ext + rw [←finiteCorner_reconstruct n p hp x,←finiteCorner_reconstruct n p hp y] + congr 1 + funext i j + rw [h i j] + + def finiteCornerOfMatrix (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (X : Fin n → Fin n → Corner p hp) : FiniteCorner n p hp := by + let T : stabilization G := ⟨finiteMatrix n (fun i j => ((X i j).val : GroupOperator G)), + finiteMatrix_mem n (fun i j => (X i j).val)⟩ + refine ⟨T,?_,?_⟩ + · apply Subtype.ext + change finiteMatrix n (fun i j => if i=j then (p : GroupOperator G) else 0)*finiteMatrix n _=_ + rw [finiteMatrix_mul] + congr 1 + funext i j + simp only [ite_mul,zero_mul,Finset.sum_ite_eq,Finset.mem_univ,ite_true] + exact congrArg Subtype.val (X i j).property.1 + · apply Subtype.ext + change finiteMatrix n _*finiteMatrix n (fun i j => if i=j then (p : GroupOperator G) else 0)=_ + rw [finiteMatrix_mul] + congr 1 + funext i j + simp only [mul_ite,mul_zero,Finset.sum_ite_eq',Finset.mem_univ,ite_true] + exact congrArg Subtype.val (X i j).property.2 + +@[simp] theorem finiteCornerEntry_ofMatrix (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (X : Fin n → Fin n → Corner p hp) (i j : Fin n) : + finiteCornerEntry n p hp (finiteCornerOfMatrix n p hp X) i j=X i j := by + apply Subtype.ext + apply Subtype.ext + exact matrixEntry_finiteMatrix n _ i j + +@[simp] theorem finiteCornerEntry_add (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (x y : FiniteCorner n p hp) (i j : Fin n) : + finiteCornerEntry n p hp (x+y) i j=finiteCornerEntry n p hp x i j+finiteCornerEntry n p hp y i j := by + apply Subtype.ext + apply Subtype.ext + ext ξ g + simp [finiteCornerEntry,matrixEntry_apply] + +@[simp] theorem finiteCornerEntry_smul (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (x : FiniteCorner n p hp) (c : ℂ) (i j : Fin n) : + finiteCornerEntry n p hp (c • x) i j=c • finiteCornerEntry n p hp x i j := by + apply Subtype.ext + apply Subtype.ext + ext ξ g + simp [finiteCornerEntry,matrixEntry_apply] + +@[simp] theorem finiteCornerEntry_star (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (x : FiniteCorner n p hp) (i j : Fin n) : + finiteCornerEntry n p hp (star x) i j=star (finiteCornerEntry n p hp x j i) := by + apply Subtype.ext + apply Subtype.ext + exact matrixEntry_star _ i.val j.val + + theorem finiteCornerEntry_mul (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (x y : FiniteCorner n p hp) (i j : Fin n) : + finiteCornerEntry n p hp (x*y) i j=∑ k : Fin n,finiteCornerEntry n p hp x i k*finiteCornerEntry n p hp y k j := by + apply Subtype.ext + apply Subtype.ext + change matrixEntry ((x.val : GroupOperator (ℕ × G))*(y.val : GroupOperator (ℕ × G))) i.val j.val=_ + rw [←finiteCorner_reconstruct n p hp x,←finiteCorner_reconstruct n p hp y,finiteMatrix_mul,matrixEntry_finiteMatrix] + simp + +variable {H : Type u_5} [Group H] + +def finiteCornerIso (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (q : groupVonNeumann H) (hq : IsStarProjection q) (e : Corner p hp ≃⋆ₐ[ℂ] Corner q hq) : + FiniteCorner n p hp ≃⋆ₐ[ℂ] FiniteCorner n q hq where + toFun x := finiteCornerOfMatrix n q hq (fun i j => e (finiteCornerEntry n p hp x i j)) + invFun x := finiteCornerOfMatrix n p hp (fun i j => e.symm (finiteCornerEntry n q hq x i j)) + left_inv x := by + apply finiteCorner_ext n p hp + intro i j + simp only [finiteCornerEntry_ofMatrix,StarAlgEquiv.symm_apply_apply] + right_inv x := by + apply finiteCorner_ext n q hq + intro i j + simp only [finiteCornerEntry_ofMatrix,StarAlgEquiv.apply_symm_apply] + map_mul' x y := by + apply finiteCorner_ext n q hq + intro i j + simp only [finiteCornerEntry_ofMatrix,finiteCornerEntry_mul] + rw [map_sum] + apply Finset.sum_congr rfl + intro k _ + exact e.map_mul' _ _ + map_add' x y := by + apply finiteCorner_ext n q hq + intro i j + simp only [finiteCornerEntry_add,finiteCornerEntry_ofMatrix] + exact e.map_add' _ _ + map_smul' c x := by + apply finiteCorner_ext n q hq + intro i j + simp only [finiteCornerEntry_smul,finiteCornerEntry_ofMatrix] + exact e.map_smul' c _ + map_star' x := by + apply finiteCorner_ext n q hq + intro i j + simp only [finiteCornerEntry_star,finiteCornerEntry_ofMatrix] + exact e.map_star' _ + +end FreeGroupFactorMain.Amplification + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/MatrixNormal.lean b/lean/OAI/Analysis/InterpolatedFactors/MatrixNormal.lean new file mode 100644 index 0000000000000000000000000000000000000000..14cb450f28204dd7dba6e82a77f581aa33dd0c33 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/MatrixNormal.lean @@ -0,0 +1,199 @@ +import OAI.Analysis.InterpolatedFactors.Matrices + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 + +section +namespace FreeGroupFactorMain.HilbertUltraweak +variable {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℂ E] +variable {X : Type u_2} [TopologicalSpace X] + +theorem finset_sum_continuous {ι : Type u_3} (s : Finset ι) (f : ι → X → (E →L[ℂ] E)) + (hf : ∀ i∈s,@Continuous _ _ _ (topology E) (f i)) : + @Continuous _ _ _ (topology E) (fun x => ∑ i∈s,f i x) := by + classical + induction s using Finset.induction_on with + | empty => simpa only [Finset.sum_empty] using (@continuous_const X _ _ (topology E) (0 : E →L[ℂ] E)) + | @insert a s ha ih => + simp only [Finset.sum_insert ha] + exact add_continuous (hf a (Finset.mem_insert_self _ _)) + (ih (fun i hi => hf i (Finset.mem_insert_of_mem hi))) +end FreeGroupFactorMain.HilbertUltraweak + +namespace FreeGroupFactorMain.Amplification +variable {G : Type u_4} {H : Type u_5} + + theorem matrixEntry_normal (i j : ℕ) : + @Continuous _ _ (ultraweakOperatorTopology (ℕ × G)) (ultraweakOperatorTopology G) + (fun T : GroupOperator (ℕ × G) => matrixEntry T i j) := by + have hc := HilbertUltraweak.sandwich_continuous (productCoordinate ℕ G i) (productSingle ℕ G j) + convert hc using 1 + rfl + + theorem matrixBlock_normal (i j : ℕ) : + @Continuous _ _ (ultraweakOperatorTopology G) (ultraweakOperatorTopology (ℕ × G)) + (matrixBlock (G := G) i j) := + HilbertUltraweak.sandwich_continuous (productSingle ℕ G i) (productCoordinate ℕ G j) + +variable [Group G] [Group H] + + theorem finiteCornerEntry_normal (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) (i j : Fin n) : + @Continuous _ _ (cornerTopology (stabilizationTopology G) (finiteProjection n p) (finiteProjection_projection n p hp)) + (cornerTopology (groupUltraweakTopology G) p hp) (fun x => finiteCornerEntry n p hp x i j) := by + let : TopologicalSpace (GroupOperator (ℕ × G)) := ultraweakOperatorTopology (ℕ × G) + let : TopologicalSpace (GroupOperator G) := ultraweakOperatorTopology G + let : TopologicalSpace (stabilization G) := stabilizationTopology G + let : TopologicalSpace (groupVonNeumann G) := groupUltraweakTopology G + let : TopologicalSpace (FiniteCorner n p hp) := cornerTopology (stabilizationTopology G) (finiteProjection n p) (finiteProjection_projection n p hp) + let : TopologicalSpace (Corner p hp) := cornerTopology (groupUltraweakTopology G) p hp + exact (((matrixEntry_normal i.val j.val).comp (continuous_subtype_val.comp continuous_subtype_val)).subtype_mk _).subtype_mk _ + + theorem finiteCornerOfMatrix_normal (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + {X : Type u_6} [TopologicalSpace X] (f : X → Fin n → Fin n → Corner p hp) + (hf : ∀ i j,@Continuous _ _ _ (cornerTopology (groupUltraweakTopology G) p hp) (fun x => f x i j)) : + @Continuous _ _ _ (cornerTopology (stabilizationTopology G) (finiteProjection n p) (finiteProjection_projection n p hp)) + (fun x => finiteCornerOfMatrix n p hp (f x)) := by + let : TopologicalSpace (GroupOperator (ℕ × G)) := ultraweakOperatorTopology (ℕ × G) + let : TopologicalSpace (GroupOperator G) := ultraweakOperatorTopology G + let : TopologicalSpace (stabilization G) := stabilizationTopology G + let : TopologicalSpace (groupVonNeumann G) := groupUltraweakTopology G + let : TopologicalSpace (Corner p hp) := cornerTopology (groupUltraweakTopology G) p hp + have hc : Continuous (fun x => finiteMatrix n (fun i j => ((f x i j).val : GroupOperator G))) := by + apply HilbertUltraweak.finset_sum_continuous + intro i _ + apply HilbertUltraweak.finset_sum_continuous + intro j _ + exact (matrixBlock_normal i.val j.val).comp (continuous_subtype_val.comp (continuous_subtype_val.comp (hf i j))) + exact (hc.subtype_mk _).subtype_mk _ + + theorem finiteCornerIso_normal (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (q : groupVonNeumann H) (hq : IsStarProjection q) (e : Corner p hp ≃⋆ₐ[ℂ] Corner q hq) + (he : @Continuous _ _ (cornerTopology (groupUltraweakTopology G) p hp) + (cornerTopology (groupUltraweakTopology H) q hq) e) : + @Continuous _ _ (cornerTopology (stabilizationTopology G) (finiteProjection n p) (finiteProjection_projection n p hp)) + (cornerTopology (stabilizationTopology H) (finiteProjection n q) (finiteProjection_projection n q hq)) + (finiteCornerIso n p hp q hq e) := by + let : TopologicalSpace (FiniteCorner n p hp) := cornerTopology (stabilizationTopology G) (finiteProjection n p) (finiteProjection_projection n p hp) + let : TopologicalSpace (Corner p hp) := cornerTopology (groupUltraweakTopology G) p hp + let : TopologicalSpace (Corner q hq) := cornerTopology (groupUltraweakTopology H) q hq + exact finiteCornerOfMatrix_normal n q hq _ (fun i j => he.comp (finiteCornerEntry_normal n p hp i j)) + +end FreeGroupFactorMain.Amplification + +end + +namespace FreeGroupFactorMain.Amplification +open scoped ENNReal +variable {G : Type u_7} + + theorem productSingle_norm (i : ℕ) (ξ : GroupHilbert G) : ‖productSingle ℕ G i ξ‖=‖ξ‖ := by + classical + let : DecidableEq ℕ := Classical.decEq ℕ + simp only [productSingle,ContinuousLinearMap.comp_apply,lp.singleContinuousLinearMap_apply, + ContinuousLinearEquiv.coe_coe,LinearIsometryEquiv.coe_toContinuousLinearEquiv] + rw [LinearIsometryEquiv.norm_map,lp.norm_single (by norm_num : (0 : ℝ≥0∞)<2)] + + theorem matrixBlock_productSingle (i j k : ℕ) (T : GroupOperator G) (ξ : GroupHilbert G) : + matrixBlock i j T (productSingle ℕ G k ξ)=if j=k then productSingle ℕ G i (T ξ) else 0 := by + simp only [matrixBlock,ContinuousLinearMap.comp_apply,productCoordinate_productSingle] + split_ifs <;> simp + + theorem finiteDiagonal_productSingle (n : ℕ) (T : GroupOperator G) (k : ℕ) (ξ : GroupHilbert G) : + finiteDiagonal n T (productSingle ℕ G k ξ)=if k (Fin.ext_iff (a := i) (b := j)).symm + simp only [he,Finset.sum_ite_eq',Finset.mem_univ,ite_true] + rfl + · rw [ite_eq_right hk] + apply Finset.sum_eq_zero + intro i _ + rw [ite_eq_right] + intro hi + exact hk (hi ▸ i.isLt) + +variable [Group G] + + theorem finiteProjection_trace (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (a : ℝ) (_ha : 0≤a) (hpa : canonicalTrace p=(a:ℂ)) : + stabilizedProjectionTrace (finiteProjection n p)=ENNReal.ofReal (n*a) := by + classical + have hv : ‖(p : GroupOperator G) (lp.single 2 (1:G) (1:ℂ))‖^2=a := by + apply Complex.ofReal_injective + have hh := canonicalTrace_star_mul p + rw [hp.isSelfAdjoint.star_eq,hp.isIdempotentElem.eq,hpa] at hh + simpa only [Complex.ofReal_pow] using hh.symm + change (∑' k : ℕ,ENNReal.ofReal (‖finiteDiagonal n (p : GroupOperator G) (lp.single 2 (k,1) (1:ℂ))‖^2))=_ + have he (k : ℕ) : ENNReal.ofReal (‖finiteDiagonal n (p : GroupOperator G) (lp.single 2 (k,1) (1:ℂ))‖^2)= + if k ite_eq_left (Finset.mem_range.mp hk)) + rw [hh] + simp only [Finset.sum_const,Finset.card_range,nsmul_eq_mul] + rw [ENNReal.ofReal_mul (Nat.cast_nonneg n),ENNReal.ofReal_natCast] + · intro k hk + rw [ite_eq_right (fun h => hk (Finset.mem_range.mpr h))] + + theorem stabilizedTrace_matrix (T : stabilization G) : + stabilizedTrace T=∑' k : ℕ,canonicalTrace + (⟨matrixEntry (T : GroupOperator (ℕ × G)) k k,(mem_stabilization_iff_matrix _).mp T.property k k⟩ : groupVonNeumann G) := by + classical + apply tsum_congr + intro k + rw [←productSingle_single,productSingle_inner_left,canonicalTrace_eq_inner] + rfl + + theorem finiteCorner_trace (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) (x : FiniteCorner n p hp) : + stabilizedTrace x.val=∑ i : Fin n,canonicalTrace (finiteCornerEntry n p hp x i i).val := by + classical + rw [stabilizedTrace_matrix] + have he (k : ℕ) : canonicalTrace + (⟨matrixEntry (x.val : GroupOperator (ℕ × G)) k k,(mem_stabilization_iff_matrix _).mp x.val.property k k⟩ : groupVonNeumann G)= + if hk : k hk (Finset.mem_range.mpr h))] + +variable {H : Type u_8} [Group H] + theorem finiteCornerIso_trace (n : ℕ) (p : groupVonNeumann G) (hp : IsStarProjection p) + (q : groupVonNeumann H) (hq : IsStarProjection q) (e : Corner p hp ≃⋆ₐ[ℂ] Corner q hq) + (c : ℂ) (hc : ∀ x,canonicalTrace (e x : groupVonNeumann H)=c*canonicalTrace (x : groupVonNeumann G)) + (x : FiniteCorner n p hp) : + stabilizedTrace (finiteCornerIso n p hp q hq e x).val=c*stabilizedTrace x.val := by + rw [finiteCorner_trace,finiteCorner_trace,Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + change canonicalTrace (finiteCornerEntry n q hq (finiteCornerOfMatrix n q hq _) i i).val=_ + rw [finiteCornerEntry_ofMatrix,hc] + +end FreeGroupFactorMain.Amplification + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Mixed.lean b/lean/OAI/Analysis/InterpolatedFactors/Mixed.lean new file mode 100644 index 0000000000000000000000000000000000000000..b621c23019da2e7a822156cdaeba6f2dc309d918 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Mixed.lean @@ -0,0 +1,279 @@ +import OAI.Analysis.InterpolatedFactors.Splitting + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 + +namespace FreeGroupFactorMain.WeightedFock +open FreeFock +variable {ι : Type u_1} [DecidableEq ι] + +theorem residualCreation_filled_annihilation (u v : ℝ) (i j : ι) (hji : j≠i) + (r s : Option Bool) (hrs : ¬(r=none ∧ s=none)) (T : filledEdgeAlgebra u v i j) : + star (residualCreation u v i j r s) ((T : Operator ι) (vacuum u v))=0 := by + let a : filledEdgeAlgebra u v i j := + ⟨star (residualLeg u v i r),star_mem + (edgeAlgebra_le_filled u v i j (residualLeg_mem_edge u v i r))⟩*T + have hh := splitBlock_filled_annihilation u v i j hji (residualCut r) (residualCut s) + (residual_allowed r s hrs) a + rw [residualCreation_split] + simp only [star_mul,star_star,mul_apply_eq_comp] + change residualLeg u v i s (star (splitBlock u v i j (residualCut r) (residualCut s)) + ((a : Operator ι) (vacuum u v)))=0 + rw [hh,map_zero] + +def normalizedResidual (u v : ℝ) (i j : ι) (r s : Option Bool) : Operator ι := + (u:ℂ)⁻¹ • residualCreation u v i j r s + +theorem normalizedResidual_filled_covariance (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i j : ι) (hji : j≠i) (r s r' s' : Option Bool) + (hrs : ¬(r=none ∧ s=none)) (hrs' : ¬(r'=none ∧ s'=none)) + (T : filledEdgeAlgebra u v i j) : + star (normalizedResidual u v i j r s)*(T : Operator ι)*normalizedResidual u v i j r' s'= + if r=r' ∧ s=s' then + pVacuumTrace u v ((T : Operator ι)*residualSupport u v i r) • residualSupport u v i s else 0 := by + simp only [normalizedResidual,star_smul,Complex.star_def,map_inv₀,Complex.conj_ofReal, + smul_mul_assoc,mul_smul_comm] + rw [residualCreation_filled_covariance u v hu hv i j hji r s r' s' hrs hrs'] + split_ifs <;> simp only [smul_zero (M := ℂ) (A := Operator ι),smul_smul,pVacuumTrace,mul_assoc] + +def residualPair (u v : ℝ) (i j : ι) (r s : Option Bool) : Operator ι := + residualCreation u v i j r s+star (residualCreation u v i j s r) + +theorem residualPair_eq (u v : ℝ) (i j : ι) (r s : Option Bool) : + residualPair u v i j r s=residualLeg u v i r*S u v j*star (residualLeg u v i s) := by + simp only [residualPair,residualCreation,S_eq,star_mul,star_star,mul_add,add_mul,mul_assoc] + +theorem residualPair_mem_ambient (u v : ℝ) (i j : ι) (r s : Option Bool) : + residualPair u v i j r s∈ambientAlgebra u v := by + rw [residualPair_eq] + exact mul_mem (mul_mem (edgeAlgebra_le_ambient u v i (residualLeg_mem_edge u v i r)) + (S_mem_ambient u v j)) (star_mem (edgeAlgebra_le_ambient u v i (residualLeg_mem_edge u v i s))) + +theorem normalizedResidual_paired_mem (u v : ℝ) (i j : ι) (r s : Option Bool) : + normalizedResidual u v i j r s+star (normalizedResidual u v i j s r)∈ambientAlgebra u v := by + simp only [normalizedResidual,star_smul,Complex.star_def,map_inv₀,Complex.conj_ofReal, + ← smul_add (M := ℂ) (A := Operator ι)] + exact (ambientAlgebra u v).smul_mem (residualPair_mem_ambient u v i j r s) _ + +theorem residualPair_none_none (u v : ℝ) (i j : ι) : + residualPair u v i j none none=(u:ℂ) • defectSemicircle u v i j := by + rw [residualPair_eq] + change edgeDefect u v i*S u v j*star (edgeDefect u v i)=_ + rw [(edgeDefect_projection u v i).isSelfAdjoint.star_eq,defectSemicircle_smul] + +theorem residualLeg_sum (u v : ℝ) (i : ι) : + residualLeg u v i none+residualLeg u v i (some false)=P := by + change (P-edgeRange u v i)+edgeRange u v i=P + abel + +theorem filledLabel_generation (u v : ℝ) (i j : ι) (M : StarSubalgebra ℂ (Operator ι)) + (hD : (u:ℂ) • defectSemicircle u v i j∈M) + (hR : ∀ r s : Option Bool,¬(r=none ∧ s=none) → residualPair u v i j r s∈M) + (r s : Bool) : + supportedCreation u v i j r s+star (supportedCreation u v i j s r)∈M := by + have h (a b : Option Bool) : residualPair u v i j a b∈M := by + by_cases hh : a=none ∧ b=none + · rcases hh with ⟨rfl,rfl⟩; rwa [residualPair_none_none] + · exact hR a b hh + rw [supportedCreation_paired] + cases r <;> cases s + · change P*S u v j*star P∈M + rw [← residualLeg_sum u v i] + simpa only [star_add (R := Operator ι),mul_add,add_mul,← residualPair_eq] using + add_mem (add_mem (h none none) (h (some false) none)) + (add_mem (h none (some false)) (h (some false) (some false))) + · change P*S u v j*star (residualLeg u v i (some true))∈M + rw [← residualLeg_sum u v i] + simpa only [add_mul,← residualPair_eq] using add_mem (h none (some true)) (h (some false) (some true)) + · change residualLeg u v i (some true)*S u v j*star P∈M + rw [← residualLeg_sum u v i] + simpa only [star_add (R := Operator ι),mul_add,← residualPair_eq] using add_mem (h (some true) none) (h (some true) (some false)) + · simpa only [residualPair_eq,residualLeg,supportedLeg,ite_true] using h (some true) (some true) +end FreeGroupFactorMain.WeightedFock + +section +namespace FreeGroupFactorMain.GaussianExtension +variable {E : Type u_2} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable (B : StarSubalgebra ℂ (E →L[ℂ] E)) (D : E →L[ℂ] E) +variable (κ : B → B) (hκ : ∀ a : B,star D*(a : E →L[ℂ] E)*D=(κ a : E →L[ℂ] E)) +include hκ in +theorem orthogonality_extension (L R : E →L[ℂ] E) + (hLD : ∀ a : B,star L*(a : E →L[ℂ] E)*D=0) + (hDR : ∀ a : B,star D*(a : E →L[ℂ] E)*R=0) + (hLR : ∀ a : B,star L*(a : E →L[ℂ] E)*R=0) + (T : E →L[ℂ] E) + (hT : T∈StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert (D+star D) (B : Set (E →L[ℂ] E))) : Set (E →L[ℂ] E))) : + star L*T*R=0 := by + have hh := covariance_extension B D κ hκ L R 0 0 0 + (fun _ => by simp only [map_zero]) (fun _ => by simp only [map_zero]) hLD hDR + (fun a => by simpa only [smul_zero (M := ℂ) (A := E →L[ℂ] E)] using hLR a) T hT + simpa only [smul_zero (M := ℂ) (A := E →L[ℂ] E)] using hh +end FreeGroupFactorMain.GaussianExtension + +namespace FreeGroupFactorMain.GaussianOrthogonal +variable {A : Type u_3} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] +def Relation (B : StarSubalgebra ℂ A) (L R : A) := ∀ a : B,star L*(a:A)*R=0 +variable {B : StarSubalgebra ℂ A} {L R : A} +theorem symm (h : Relation B L R) : Relation B R L := by + intro a + have hh := congrArg star (h (star a)) + simpa only [star_mul,star_star,star_zero,StarMemClass.coe_star,mul_assoc] using hh + +theorem sandwich_left (h : Relation B L R) (a b : B) : Relation B ((a:A)*L*(b:A)) R := by + intro T + calc + _ = star (b:A)*(star L*((star a*T:B):A)*R) := by + simp only [star_mul,StarMemClass.coe_star,MulMemClass.coe_mul,mul_assoc] + _ = 0 := by rw [h (star a*T),mul_zero] + +theorem sandwich_right (h : Relation B L R) (a b : B) : Relation B L ((a:A)*R*(b:A)) := + symm (sandwich_left (symm h) a b) +end FreeGroupFactorMain.GaussianOrthogonal +namespace FreeGroupFactorMain.WeightedFock +open FreeFock GaussianOrthogonal +variable {ι : Type u_4} [DecidableEq ι] + +theorem fresh_C_edge_orthogonal (u v : ℝ) (i n m : ι) (hni : n≠i) (hmi : m≠i) (hnm : n≠m) : + Relation (edgeAlgebra u v i) (C u v n) (C u v m) := by + intro a + have hh := fresh_C_contraction u v {i} n m hni hmi + ⟨a,edgeAlgebra_le_old u v {i} i (Set.mem_singleton i) a.property⟩ + simpa only [ite_eq_right hnm] using hh + +theorem splitBlock_weightedDefect (u v : ℝ) (i j : ι) (hji : j≠i) + (r s : Bool) (hrs : ¬(r=true ∧ s=true)) : + Relation (edgeAlgebra u v i) (splitBlock u v i j r s) (weightedDefectCreation u v i j) := + GaussianSplit.block_D (edgeAlgebra u v i) (C u v j) (vacuum u v) + (fresh_C_edge_contraction u v i j hji) (defectAsEdge u v i) (defectAsEdge_projection u v i) + (defectAsEdge_central u v i) r s hrs + +theorem fresh_diagonal_filled (u v : ℝ) (i j n k : ι) (hji : j≠i) + (hni : n≠i) (hnj : n≠j) (hnk : n≠k) (hjk : j≠k) (r : Bool) : + Relation (filledEdgeAlgebra u v i j) (C u v n) (edgeCreation k r r) := by + intro T + exact GaussianExtension.orthogonality_extension (edgeAlgebra u v i) (weightedDefectCreation u v i j) + (defectCovariance u v i) (weightedDefect_contraction u v i j hji) (C u v n) (edgeCreation k r r) + (fresh_C_weightedDefect u v i j n hji hni hnj) + (symm (fun a => diagonal_weightedDefect u v i j k hji hjk a r)) + (fun a => fresh_C_diagonal_edge u v i n k hni hnk a r) T T.property + +theorem fresh_split_filled (u v : ℝ) (i j n : ι) (hji : j≠i) + (hni : n≠i) (hnj : n≠j) (r s : Bool) (hrs : ¬(r=true ∧ s=true)) : + Relation (filledEdgeAlgebra u v i j) (C u v n) (splitBlock u v i j r s) := by + intro T + exact GaussianExtension.orthogonality_extension (edgeAlgebra u v i) (weightedDefectCreation u v i j) + (defectCovariance u v i) (weightedDefect_contraction u v i j hji) (C u v n) (splitBlock u v i j r s) + (fresh_C_weightedDefect u v i j n hji hni hnj) + (symm (splitBlock_weightedDefect u v i j hji r s hrs)) + (sandwich_right (fresh_C_edge_orthogonal u v i n j hni hji hnj) + (GaussianSplit.cut (edgeAlgebra u v i) (defectAsEdge u v i) r) + (GaussianSplit.cut (edgeAlgebra u v i) (defectAsEdge u v i) s)) T T.property + +theorem split_diagonal_filled (u v : ℝ) (i j k : ι) (hji : j≠i) (hjk : j≠k) + (r s t : Bool) (hrs : ¬(r=true ∧ s=true)) : + Relation (filledEdgeAlgebra u v i j) (splitBlock u v i j r s) (edgeCreation k t t) := by + intro T + exact GaussianExtension.orthogonality_extension (edgeAlgebra u v i) (weightedDefectCreation u v i j) + (defectCovariance u v i) (weightedDefect_contraction u v i j hji) (splitBlock u v i j r s) (edgeCreation k t t) + (splitBlock_weightedDefect u v i j hji r s hrs) + (symm (fun a => diagonal_weightedDefect u v i j k hji hjk a t)) + (sandwich_left (fun a => fresh_C_diagonal_edge u v i j k hji hjk a t) + (GaussianSplit.cut (edgeAlgebra u v i) (defectAsEdge u v i) r) + (GaussianSplit.cut (edgeAlgebra u v i) (defectAsEdge u v i) s)) T T.property +end FreeGroupFactorMain.WeightedFock + +end + +namespace FreeGroupFactorMain.GaussianOrthogonal +variable {A : Type u_5} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] +variable {B : StarSubalgebra ℂ A} {L R : A} +theorem smul_left (h : Relation B L R) (z : ℂ) : Relation B (z • L) R := by + intro a + simp only [star_smul,smul_mul_assoc,h a,smul_zero] +theorem smul_right (h : Relation B L R) (z : ℂ) : Relation B L (z • R) := by + intro a + simp only [mul_smul_comm,h a,smul_zero] +end FreeGroupFactorMain.GaussianOrthogonal + +namespace FreeGroupFactorMain.WeightedFock +open FreeFock GaussianOrthogonal +variable {ι : Type u_6} [DecidableEq ι] + +def legAsFilled (u v : ℝ) (i j : ι) (r : Bool) : filledEdgeAlgebra u v i j := + ⟨supportedLeg u v i r,edgeAlgebra_le_filled u v i j (supportedLeg_mem_edge u v i r)⟩ +def residualLegAsFilled (u v : ℝ) (i j : ι) (r : Option Bool) : filledEdgeAlgebra u v i j := + ⟨residualLeg u v i r,edgeAlgebra_le_filled u v i j (residualLeg_mem_edge u v i r)⟩ + +theorem normalized_fresh_diagonal (u v : ℝ) (i j n k : ι) (hji : j≠i) + (hni : n≠i) (hnj : n≠j) (hnk : n≠k) (hjk : j≠k) (r s t : Bool) : + Relation (filledEdgeAlgebra u v i j) (normalizedCreation u v i n r s) + (normalizedDiagonal u v i k t) := by + exact smul_right (smul_left (sandwich_right (sandwich_left + (fresh_diagonal_filled u v i j n k hji hni hnj hnk hjk (!t)) + (legAsFilled u v i j r) (star (legAsFilled u v i j s))) + (legAsFilled u v i j t) (star (legAsFilled u v i j t))) _) _ + +theorem normalized_fresh_residual (u v : ℝ) (i j n : ι) (hji : j≠i) + (hni : n≠i) (hnj : n≠j) (r s : Bool) (a b : Option Bool) + (hab : ¬(a=none ∧ b=none)) : + Relation (filledEdgeAlgebra u v i j) (normalizedCreation u v i n r s) + (normalizedResidual u v i j a b) := by + have hh := sandwich_right (sandwich_left + (fresh_split_filled u v i j n hji hni hnj (residualCut a) (residualCut b) + (residual_allowed a b hab)) + (legAsFilled u v i j r) (star (legAsFilled u v i j s))) + (residualLegAsFilled u v i j a) (star (residualLegAsFilled u v i j b)) + change Relation _ (supportedCreation u v i n r s) + (residualLeg u v i a*splitBlock u v i j (residualCut a) (residualCut b)*star (residualLeg u v i b)) at hh + rw [← residualCreation_split] at hh + exact smul_right (smul_left hh _) _ + +theorem normalized_residual_diagonal (u v : ℝ) (i j k : ι) (hji : j≠i) (hjk : j≠k) + (a b : Option Bool) (hab : ¬(a=none ∧ b=none)) (r : Bool) : + Relation (filledEdgeAlgebra u v i j) (normalizedResidual u v i j a b) + (normalizedDiagonal u v i k r) := by + have hh := sandwich_right (sandwich_left + (split_diagonal_filled u v i j k hji hjk (residualCut a) (residualCut b) (!r) + (residual_allowed a b hab)) + (residualLegAsFilled u v i j a) (star (residualLegAsFilled u v i j b))) + (legAsFilled u v i j r) (star (legAsFilled u v i j r)) + change Relation _ + (residualLeg u v i a*splitBlock u v i j (residualCut a) (residualCut b)*star (residualLeg u v i b)) + (transportedDiagonal u v i k r) at hh + rw [← residualCreation_split] at hh + exact smul_right (smul_left hh _) _ + +theorem normalizedCreation_annihilate (u v : ℝ) (i j n : ι) (hji : j≠i) + (hni : n≠i) (hnj : n≠j) (r s : Bool) (T : filledEdgeAlgebra u v i j) : + star (normalizedCreation u v i n r s) ((T : Operator ι) (vacuum u v))=0 := by + simp only [normalizedCreation,star_smul,_root_.smul_apply, + supportedCreation_filled_annihilation u v i j n hji hni hnj r s T,smul_zero] + +theorem normalizedResidual_annihilate (u v : ℝ) (i j : ι) (hji : j≠i) + (r s : Option Bool) (hrs : ¬(r=none ∧ s=none)) (T : filledEdgeAlgebra u v i j) : + star (normalizedResidual u v i j r s) ((T : Operator ι) (vacuum u v))=0 := by + simp only [normalizedResidual,star_smul,_root_.smul_apply, + residualCreation_filled_annihilation u v i j hji r s hrs T,smul_zero] + +theorem transportedDiagonal_annihilate (u v : ℝ) (i j k : ι) (hji : j≠i) (hjk : j≠k) + (r : Bool) (T : filledEdgeAlgebra u v i j) : + star (transportedDiagonal u v i k r) ((T : Operator ι) (vacuum u v))=0 := by + have hh := diagonal_filled_annihilation u v i j k hji hjk (!r) (star (legAsFilled u v i j r)*T) + simp only [transportedDiagonal,star_mul,star_star,mul_apply_eq_comp] + change star (edgeCreation k (!r) (!r)) (star (supportedLeg u v i r) ((T : Operator ι) (vacuum u v)))=0 at hh + rw [hh,map_zero] + +theorem normalizedDiagonal_annihilate (u v : ℝ) (i j k : ι) (hji : j≠i) (hjk : j≠k) + (r : Bool) (T : filledEdgeAlgebra u v i j) : + star (normalizedDiagonal u v i k r) ((T : Operator ι) (vacuum u v))=0 := by + simp only [normalizedDiagonal,star_smul,_root_.smul_apply, + transportedDiagonal_annihilate u v i j k hji hjk r T,smul_zero] +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/NormalEquiv.lean b/lean/OAI/Analysis/InterpolatedFactors/NormalEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..b30794db2cf5dad0ca0a41ade26ae54c6214a273 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/NormalEquiv.lean @@ -0,0 +1,140 @@ +import OAI.Analysis.InterpolatedFactors.Scaling + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 + +namespace FreeGroupFactorMain.Amplification + +section +variable {A : Type u_1} {B : Type u_2} {C : Type u_3} [CStarAlgebra A] [CStarAlgebra B] [CStarAlgebra C] + +namespace NormalTracialEquiv +variable {τA : A → ℂ} {τB : B → ℂ} {τC : C → ℂ} +variable {𝒯A : TopologicalSpace A} {𝒯B : TopologicalSpace B} {𝒯C : TopologicalSpace C} + +def symm (e : NormalTracialEquiv τA τB 𝒯A 𝒯B) : NormalTracialEquiv τB τA 𝒯B 𝒯A where + equiv := e.equiv.symm + trace_eq x := by simpa only [StarAlgEquiv.apply_symm_apply] using (e.trace_eq (e.equiv.symm x)).symm + normal := e.inverse_normal + inverse_normal := e.normal + +def trans (e : NormalTracialEquiv τA τB 𝒯A 𝒯B) (f : NormalTracialEquiv τB τC 𝒯B 𝒯C) : + NormalTracialEquiv τA τC 𝒯A 𝒯C where + equiv := e.equiv.trans f.equiv + trace_eq x := (f.trace_eq (e.equiv x)).trans (e.trace_eq x) + normal := by + let : TopologicalSpace A := 𝒯A + let : TopologicalSpace B := 𝒯B + let : TopologicalSpace C := 𝒯C + exact f.normal.comp e.normal + inverse_normal := by + let : TopologicalSpace A := 𝒯A + let : TopologicalSpace B := 𝒯B + let : TopologicalSpace C := 𝒯C + exact e.inverse_normal.comp f.inverse_normal + +end NormalTracialEquiv +end + +open scoped ENNReal +variable {G : Type u_4} [Group G] + +abbrev GroupCornerNormalIso (t : ℝ) (p : stabilization G) (hp : IsStarProjection p) := + NormalTracialEquiv (normalizedCornerTrace stabilizedTrace t p hp) canonicalTrace + (cornerTopology (stabilizationTopology G) p hp) (groupUltraweakTopology G) + +def unitNormalIso {A : Type u_5} [CStarAlgebra A] (τ : A → ℂ) (𝒯 : TopologicalSpace A) : + NormalTracialEquiv (fun x : Corner (1:A) (IsStarProjection.one A) => τ x.val) τ + (cornerTopology 𝒯 1 (IsStarProjection.one A)) 𝒯 where + equiv := unitCornerEquiv.symm + trace_eq _ := rfl + normal := by + let : TopologicalSpace A := 𝒯 + exact continuous_subtype_val + inverse_normal := by + let : TopologicalSpace A := 𝒯 + exact continuous_id.subtype_mk _ + +def finiteSingletonNormalIso (p : groupVonNeumann G) (hp : IsStarProjection p) : + NormalTracialEquiv (normalizedCornerTrace stabilizedTrace 1 (finiteProjection 1 p) + (finiteProjection_projection 1 p hp)) (fun x : Corner p hp => canonicalTrace x.val) + (cornerTopology (stabilizationTopology G) (finiteProjection 1 p) (finiteProjection_projection 1 p hp)) + (cornerTopology (groupUltraweakTopology G) p hp) where + equiv := finiteCornerSingletonIso p hp + trace_eq x := by + simp only [normalizedCornerTrace,Complex.ofReal_one,inv_one,one_mul] + exact finiteCornerSingletonIso_trace p hp x + normal := finiteCornerSingletonIso_normal p hp + inverse_normal := finiteCornerSingletonIso_symm_normal p hp + +def finiteUnitCornerIso : GroupCornerNormalIso (G := G) 1 + (finiteProjection 1 (1 : groupVonNeumann G)) (finiteProjection_projection 1 1 (IsStarProjection.one _)) := + (finiteSingletonNormalIso (1 : groupVonNeumann G) (IsStarProjection.one _)).trans + (unitNormalIso canonicalTrace (groupUltraweakTopology G)) + +theorem canonicalTrace_one : canonicalTrace (1 : groupVonNeumann G)=1 := by + classical + simp [canonicalTrace,lp.single_apply] + +theorem finiteUnitProjection_trace : + stabilizedProjectionTrace (finiteProjection 1 (1 : groupVonNeumann G))=ENNReal.ofReal 1 := by + rw [finiteProjection_trace 1 1 (IsStarProjection.one _) 1 zero_le_one canonicalTrace_one] + norm_num + +theorem preferred_unit_iso + (hbase : ∀ T : groupVonNeumann G, (∀ S : groupVonNeumann G,Commute T S) → + ∃ c : ℂ,T=c • (1 : groupVonNeumann G)) + (p : stabilization G) (hp : IsStarProjection p) (hptr : stabilizedProjectionTrace p=ENNReal.ofReal 1) : + Nonempty (GroupCornerNormalIso 1 p hp) := by + obtain ⟨e,heτ,hen,hein⟩ := finite_corner_choice_both (G := G) hbase 1 p + (finiteProjection 1 (1 : groupVonNeumann G)) hp (finiteProjection_projection 1 1 (IsStarProjection.one _)) + (hptr.trans finiteUnitProjection_trace.symm) (hptr ▸ ENNReal.ofReal_ne_top) + let E : NormalTracialEquiv (normalizedCornerTrace stabilizedTrace 1 p hp) + (normalizedCornerTrace stabilizedTrace 1 (finiteProjection 1 (1 : groupVonNeumann G)) + (finiteProjection_projection 1 1 (IsStarProjection.one _))) + (cornerTopology (stabilizationTopology G) p hp) + (cornerTopology (stabilizationTopology G) (finiteProjection 1 (1 : groupVonNeumann G)) + (finiteProjection_projection 1 1 (IsStarProjection.one _))) := ⟨e,heτ,hen,hein⟩ + exact ⟨E.trans finiteUnitCornerIso⟩ + +theorem scaling_ratio_trace (t : ℝ) (ht : 0 center_scalar_of_iso e rankTwo_center_scalar T hT) + (fun s hs hs1 => smallScaling_transport_group hinv (rankTwo_smallScaling s hs hs1)) t ht + +end FreeGroupFactorMain.Amplification +namespace FreeGroupFactorMain + +theorem groupIso_refl (G : Type u_3) [Group G] : HasNormalTracialIso G G := + ⟨StarAlgEquiv.refl ℂ (groupVonNeumann G),fun _ => rfl,@continuous_id _ (groupUltraweakTopology G)⟩ + +theorem finiteRank_to_two (n : ℕ) (hn : 2≤n) : HasNormalTracialIso (FreeGroupRank n) (FreeGroupRank 2) := by + induction n, hn using Nat.le_induction with + | base => exact groupIso_refl _ + | succ n hn ih => + have he : HasNormalTracialIso (FreeGroupRank n) (FreeGroupRank (n+1)) := by + rcases eq_or_lt_of_le hn with h | h + · subst n + exact rankTwo + · exact rankStep n (by omega) + exact he.symm.trans ih + +end FreeGroupFactorMain + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/OperatorSums.lean b/lean/OAI/Analysis/InterpolatedFactors/OperatorSums.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b461542ddb3042ce328b68d96d2fce0c92a815a --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/OperatorSums.lean @@ -0,0 +1,636 @@ +import OAI.Analysis.InterpolatedFactors.Stabilization + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 u_10 u_11 u_12 +universe u_13 u_14 u_15 u_16 u_17 u_18 u_19 u_20 u_21 u_22 u_23 u_24 +universe u_25 + +namespace FreeGroupFactorMain.Amplification +namespace OperatorSum +variable {E : Type u_5} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +abbrev Operator (E : Type u_6) [NormedAddCommGroup E] [InnerProductSpace ℂ E] := E →L[ℂ] E + +def IsPartial (U : Operator E) : Prop := U*star U*U=U + + theorem initial_projection {U : Operator E} (h : IsPartial U) : IsStarProjection (star U*U) := by + constructor + · change (star U*U)*(star U*U)=star U*U + calc + _ = star U*(U*star U*U) := by noncomm_ring + _ = _ := by rw [h] + · simp only [IsSelfAdjoint,star_mul,star_star] + + theorem partial_star {U : Operator E} (h : IsPartial U) : IsPartial (star U) := by + have hs := congrArg star h + simpa only [IsPartial,star_mul,star_star,mul_assoc] using hs + + theorem partial_norm_le {U : Operator E} (h : IsPartial U) : ‖U‖ ≤ 1 := by + have hn := (initial_projection h).norm_le (star U*U) + rw [CStarRing.norm_star_mul_self] at hn + nlinarith [norm_nonneg U] + +structure OrthogonalPartials {ι : Type u_7} (U : ι → Operator E) : Prop where + isPartial : ∀ i, IsPartial (U i) + initial : Pairwise (fun i j => star (U i)*U j=0) + final : Pairwise (fun i j => U i*star (U j)=0) + + theorem OrthogonalPartials.adjoint {ι : Type u_8} {U : ι → Operator E} (h : OrthogonalPartials U) : + OrthogonalPartials (fun i => star (U i)) where + isPartial i := partial_star (h.isPartial i) + initial i j hij := by simpa only [star_star] using h.final hij + final i j hij := by simpa only [star_star] using h.initial hij + + theorem OrthogonalPartials.finite_offdiag {ι : Type u_9} {U : ι → Operator E} + (h : OrthogonalPartials U) (s : Finset ι) : + star (∑ i ∈ s, U i)*(∑ i ∈ s, U i) = ∑ i ∈ s, star (U i)*U i := by + classical + simp only [star_sum,Finset.sum_mul,Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + exact Finset.sum_eq_single_of_mem i hi (fun j _ hji => h.initial hji) + + theorem OrthogonalPartials.finite_partial {ι : Type u_10} {U : ι → Operator E} + (h : OrthogonalPartials U) (s : Finset ι) : IsPartial (∑ i ∈ s, U i) := by + classical + change (∑i ∈ s,U i)*star (∑i ∈ s,U i)*(∑i ∈ s,U i) = _ + have hs : (∑i ∈ s,U i)*star (∑i ∈ s,U i) = ∑i ∈ s,U i*star (U i) := by + simpa only [star_sum,star_star] using h.adjoint.finite_offdiag s + rw [hs,Finset.sum_mul] + apply Finset.sum_congr rfl + intro i hi + rw [Finset.mul_sum] + rw [Finset.sum_eq_single_of_mem i hi] + · exact h.isPartial i + · intro j _ hji + rw [mul_assoc,h.initial (Ne.symm hji),mul_zero] + + theorem OrthogonalPartials.ranges {ι : Type u_11} {U : ι → Operator E} + (h : OrthogonalPartials U) : + OrthogonalFamily ℂ (fun i => U i |>.toLinearMap.range) + (fun i => (U i).toLinearMap.range.subtypeₗᵢ) := by + rintro i j hij ⟨_,x,rfl⟩ ⟨_,y,rfl⟩ + change inner ℂ (U i x) (U j y) = 0 + rw [← ContinuousLinearMap.adjoint_inner_right] + change inner ℂ x ((star (U i)*U j) y) = 0 + rw [h.initial hij,zero_apply,inner_zero_right] + + theorem OrthogonalPartials.apply_summable {ι : Type u_12} {U : ι → Operator E} + (h : OrthogonalPartials U) (x : E) : Summable (fun i => U i x) := by + let f : ∀ i, (U i).toLinearMap.range := fun i => ⟨U i x,LinearMap.mem_range_self _ x⟩ + apply (h.ranges.summable_iff_norm_sq_summable f).mpr + apply summable_of_sum_le (fun i => sq_nonneg ‖f i‖) (c := ‖x‖^2) + intro s + rw [← h.ranges.norm_sum f s] + have hn : ‖∑i ∈ s, U i x‖ ≤ ‖x‖ := by + have hb := (∑i ∈ s, U i).le_opNorm x + have ho := partial_norm_le (h.finite_partial s) + calc + _ = ‖(∑i ∈ s,U i) x‖ := by simp only [sum_apply] + _ ≤ ‖∑i ∈ s,U i‖*‖x‖ := hb + _ ≤ 1*‖x‖ := mul_le_mul_of_nonneg_right ho (norm_nonneg _) + _ = _ := one_mul _ + change ‖∑i ∈ s,U i x‖^2 ≤ ‖x‖^2 + simpa only [pow_two] using mul_self_le_mul_self (norm_nonneg _) hn + + theorem OrthogonalPartials.tsum_bound {ι : Type u_13} {U : ι → Operator E} + (h : OrthogonalPartials U) (x : E) : ‖∑'i, U i x‖ ≤ ‖x‖ := by + apply le_of_tendsto ((h.apply_summable x).hasSum.norm) + apply Filter.Eventually.of_forall + intro s + calc + _ = ‖(∑i ∈ s,U i) x‖ := by simp only [sum_apply] + _ ≤ ‖∑i ∈ s,U i‖*‖x‖ := (∑i ∈ s,U i).le_opNorm x + _ ≤ 1*‖x‖ := mul_le_mul_of_nonneg_right (partial_norm_le (h.finite_partial s)) (norm_nonneg _) + _ = _ := one_mul _ + + def OrthogonalPartials.sum {ι : Type u_14} {U : ι → Operator E} (h : OrthogonalPartials U) : Operator E := + LinearMap.mkContinuous + { toFun := fun x => ∑'i,U i x + map_add' := fun x y => by + simp only [map_add] + exact (h.apply_summable x).tsum_add (h.apply_summable y) + map_smul' := fun c x => by + simp only [map_smul,RingHom.id_apply] + exact (h.apply_summable x).tsum_const_smul c } + 1 (fun x => by + change ‖∑' i, U i x‖ ≤ 1 * ‖x‖ + rw [one_mul] + exact h.tsum_bound x) + + theorem OrthogonalPartials.sum_apply {ι : Type u_15} {U : ι → Operator E} + (h : OrthogonalPartials U) (x : E) : h.sum x = ∑'i,U i x := rfl + +end OperatorSum +end FreeGroupFactorMain.Amplification +namespace FreeGroupFactorMain.Amplification.OperatorSum + +section +variable {E : Type u_16} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable {ι : Type u_17} {U : ι → Operator E} + + theorem OrthogonalPartials.sum_star (h : OrthogonalPartials U) : + h.adjoint.sum = star h.sum := by + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + rw [h.adjoint.sum_apply,h.sum_apply] + change (innerSL ℂ y) (∑' i, star (U i) x) = ((innerSL ℂ).flip x) (∑' i, U i y) + rw [(innerSL ℂ y).map_tsum (h.adjoint.apply_summable x)] + have hr := ((innerSL ℂ).flip x).map_tsum (h.apply_summable y) + rw [hr] + apply tsum_congr + intro i + exact ContinuousLinearMap.adjoint_inner_right (U i) y x + + theorem OrthogonalPartials.star_single_mul_sum (h : OrthogonalPartials U) (i : ι) : + star (U i)*h.sum = star (U i)*U i := by + classical + apply ContinuousLinearMap.ext + intro x + rw [mul_apply_eq_comp,h.sum_apply,(star (U i)).map_tsum (h.apply_summable x)] + rw [tsum_eq_single i] + · rfl + · intro j hji + change (star (U i)*U j) x = 0 + rw [h.initial hji.symm,zero_apply] + + theorem OrthogonalPartials.star_sum_mul_single (h : OrthogonalPartials U) (i : ι) : + star h.sum*U i = star (U i)*U i := by + have he := congrArg star (h.star_single_mul_sum i) + simpa only [star_mul,star_star] using he + + theorem OrthogonalPartials.sum_mul_star_single (h : OrthogonalPartials U) (i : ι) : + h.sum*star (U i) = U i*star (U i) := by + have he := h.adjoint.star_sum_mul_single i + simpa only [h.sum_star,star_star] using he + + theorem OrthogonalPartials.sum_partial (h : OrthogonalPartials U) : IsPartial h.sum := by + apply ContinuousLinearMap.ext + intro x + change (h.sum*star h.sum) (h.sum x) = h.sum x + rw [h.sum_apply,(h.sum*star h.sum).map_tsum (h.apply_summable x)] + apply tsum_congr + intro i + change (h.sum*star h.sum*U i) x = U i x + rw [mul_assoc,h.star_sum_mul_single,← mul_assoc,h.sum_mul_star_single,h.isPartial] + + theorem OrthogonalPartials.sum_mem_centralizer (h : OrthogonalPartials U) + (s : Set (Operator E)) (hU : ∀ i, U i ∈ StarSubalgebra.centralizer ℂ s) : + h.sum ∈ StarSubalgebra.centralizer ℂ s := by + rw [StarSubalgebra.mem_centralizer_iff] + intro S hS + have hc (i) := (StarSubalgebra.mem_centralizer_iff ℂ).mp (hU i) S hS + constructor + · apply ContinuousLinearMap.ext + intro x + change S (h.sum x) = h.sum (S x) + rw [h.sum_apply,h.sum_apply,S.map_tsum (h.apply_summable x)] + apply tsum_congr + intro i + exact DFunLike.congr_fun (hc i).1 x + · apply ContinuousLinearMap.ext + intro x + change star S (h.sum x) = h.sum (star S x) + rw [h.sum_apply,h.sum_apply,(star S).map_tsum (h.apply_summable x)] + apply tsum_congr + intro i + exact DFunLike.congr_fun (hc i).2 x + + theorem OrthogonalPartials.sum_left_support (h : OrthogonalPartials U) + (q : Operator E) (hq : ∀ i, q*U i=U i) : q*h.sum=h.sum := by + apply ContinuousLinearMap.ext + intro x + rw [mul_apply_eq_comp,h.sum_apply,q.map_tsum (h.apply_summable x)] + apply tsum_congr + intro i + exact DFunLike.congr_fun (hq i) x + + theorem OrthogonalPartials.sum_right_support (h : OrthogonalPartials U) + (p : Operator E) (hp : ∀ i, U i*p=U i) : h.sum*p=h.sum := by + apply ContinuousLinearMap.ext + intro x + rw [mul_apply_eq_comp,h.sum_apply,h.sum_apply] + apply tsum_congr + intro i + exact DFunLike.congr_fun (hp i) x + +end +variable {E : Type u_18} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + + theorem residual_projection {p e : Operator E} (hp : IsStarProjection p) + (he : IsStarProjection e) (hep : e*p=e) : IsStarProjection (p-e) := by + have hpe : p*e=e := by + have h := congrArg star hep + simpa only [star_mul,hp.isSelfAdjoint.star_eq,he.isSelfAdjoint.star_eq] using h + exact ⟨he.isIdempotentElem.sub hp.isIdempotentElem hep hpe,hp.isSelfAdjoint.sub he.isSelfAdjoint⟩ + + theorem OrthogonalPartials.sum_final_mul_single {ι : Type u_19} {U : ι → Operator E} + (h : OrthogonalPartials U) (i : ι) : h.sum*star h.sum*U i=U i := by + rw [mul_assoc,h.star_sum_mul_single,← mul_assoc,h.sum_mul_star_single,h.isPartial] + + theorem OrthogonalPartials.single_mul_sum_initial {ι : Type u_20} {U : ι → Operator E} + (h : OrthogonalPartials U) (i : ι) : U i*star h.sum*h.sum=U i := by + have he := congrArg star (h.adjoint.sum_final_mul_single i) + simpa only [h.sum_star,star_mul,star_star,mul_assoc] using he + + theorem IsPartial.initial_zero {U : Operator E} (h : star U*U=0) : U=0 := by + have hn := congrArg norm h + rw [CStarRing.norm_star_mul_self,norm_zero] at hn + exact norm_eq_zero.mp (by nlinarith [norm_nonneg U]) + +def PartialFamily (s : Set (Operator E)) (p q : Operator E) (F : Set (Operator E)) : Prop := + (∀ U ∈ F, U ≠ 0 ∧ U ∈ StarSubalgebra.centralizer ℂ s ∧ IsPartial U ∧ q*U=U ∧ U*p=U) ∧ + F.Pairwise (fun U V => star U*V=0 ∧ U*star V=0) + + theorem maximal_partial_family (s : Set (Operator E)) (p q : Operator E) : + ∃ F, Maximal (PartialFamily s p q) F := by + apply zorn_subset {F | PartialFamily s p q F} + intro c hc hchain + refine ⟨⋃₀ c,⟨?_,?_⟩,fun S hS => Set.subset_sUnion_of_mem hS⟩ + · intro U hU + obtain ⟨F,hF,hUF⟩ := Set.mem_sUnion.mp hU + exact (hc hF).1 U hUF + · intro U hU V hV hne + obtain ⟨F,hF,hUF⟩ := Set.mem_sUnion.mp hU + obtain ⟨G,hG,hVG⟩ := Set.mem_sUnion.mp hV + rcases hchain.total hF hG with hFG|hGF + · exact (hc hG).2 (hFG hUF) hVG hne + · exact (hc hF).2 hUF (hGF hVG) hne + + theorem PartialFamily.orthogonal {s : Set (Operator E)} {p q : Operator E} + {F : Set (Operator E)} (h : PartialFamily s p q F) : + OrthogonalPartials (fun U : F => (U : Operator E)) where + isPartial U := (h.1 U U.property).2.2.1 + initial := by + intro U V hne + exact (h.2 U.property V.property (fun he => hne (Subtype.ext he))).1 + final := by + intro U V hne + exact (h.2 U.property V.property (fun he => hne (Subtype.ext he))).2 + + theorem commutant_maximal_partial (s : Set (Operator E)) (p q : Operator E) + (hp : IsStarProjection p) (hq : IsStarProjection q) + (hpm : p ∈ StarSubalgebra.centralizer ℂ s) (hqm : q ∈ StarSubalgebra.centralizer ℂ s) : + ∃ V ∈ StarSubalgebra.centralizer ℂ s, IsPartial V ∧ q*V=V ∧ V*p=V ∧ + ∀ T ∈ StarSubalgebra.centralizer ℂ s, (q-V*star V)*T*(p-star V*V)=0 := by + classical + obtain ⟨F,hF⟩ := maximal_partial_family s p q + let h := hF.1.orthogonal + let V := h.sum + have hV : V ∈ StarSubalgebra.centralizer ℂ s := + h.sum_mem_centralizer s (fun U => (hF.1.1 U U.property).2.1) + have hVp : V*p=V := h.sum_right_support p (fun U => (hF.1.1 U U.property).2.2.2.2) + have hqV : q*V=V := h.sum_left_support q (fun U => (hF.1.1 U U.property).2.2.2.1) + refine ⟨V,hV,h.sum_partial,hqV,hVp,?_⟩ + intro T hT + let pr := p-star V*V + let qr := q-V*star V + have hpr : IsStarProjection pr := residual_projection hp (initial_projection h.sum_partial) (by rw [mul_assoc,hVp]) + have hqr : IsStarProjection qr := residual_projection hq (by simpa only [star_star] using initial_projection (partial_star h.sum_partial)) (by + have he := congrArg star hqV + simp only [star_mul,hq.isSelfAdjoint.star_eq] at he + rw [mul_assoc,he]) + have hprm : pr ∈ StarSubalgebra.centralizer ℂ s := sub_mem hpm (mul_mem (star_mem hV) hV) + have hqrm : qr ∈ StarSubalgebra.centralizer ℂ s := sub_mem hqm (mul_mem hV (star_mem hV)) + have hq_qr : q*qr=qr := by + dsimp [qr] + rw [mul_sub,hq.isIdempotentElem,← mul_assoc,hqV] + have hpr_p : pr*p=pr := by + dsimp [pr] + rw [sub_mul,hp.isIdempotentElem,mul_assoc,hVp] + by_contra hne + let W := Polar.partialIsometry (qr*T*pr) + have hWne : W ≠ 0 := Polar.partialIsometry_nonzero hne + have hWm : W ∈ StarSubalgebra.centralizer ℂ s := + Polar.partialIsometry_mem_centralizer s (mul_mem (mul_mem hqrm hT) hprm) + have hWp : W*pr=W := Polar.partialIsometry_right_support hpr.isSelfAdjoint (by rw [mul_assoc,hpr.isIdempotentElem]) + have hqW : qr*W=W := Polar.partialIsometry_left_support (by rw [← mul_assoc,← mul_assoc,hqr.isIdempotentElem]) + have hWpartial : IsPartial W := Polar.partialIsometry_partial _ + have hWp' : W*p=W := by rw [← hWp,mul_assoc,hpr_p] + have hqW' : q*W=W := by rw [← hqW,← mul_assoc,hq_qr] + have hqrU (U : F) : qr*U=0 := by + change (q-V*star V)*(U : Operator E)=0 + rw [sub_mul,(hF.1.1 U U.property).2.2.2.1,h.sum_final_mul_single] + exact sub_self _ + have hUpr (U : F) : (U : Operator E)*pr=0 := by + change (U : Operator E)*(p-star V*V)=0 + rw [mul_sub,(hF.1.1 U U.property).2.2.2.2,← mul_assoc,h.single_mul_sum_initial] + exact sub_self _ + have hUW (U : F) : star (U : Operator E)*W=0 ∧ (U : Operator E)*star W=0 := by + have he := congrArg star (hqrU U) + simp only [star_mul,hqr.isSelfAdjoint.star_eq,star_zero (Operator E)] at he + have hw := congrArg star hWp + simp only [star_mul,hpr.isSelfAdjoint.star_eq] at hw + constructor + · rw [← hqW,← mul_assoc,he,zero_mul] + · rw [← hw,← mul_assoc,hUpr,zero_mul] + have hWU (U : F) : star W*(U : Operator E)=0 ∧ W*star (U : Operator E)=0 := by + constructor + · simpa only [star_mul,star_star,star_zero (Operator E)] using congrArg star (hUW U).1 + · simpa only [star_mul,star_star,star_zero (Operator E)] using congrArg star (hUW U).2 + have hinsert : PartialFamily s p q (insert W F) := by + constructor + · intro U hU + rcases Set.mem_insert_iff.mp hU with rfl|hU + · exact ⟨hWne,hWm,hWpartial,hqW',hWp'⟩ + · exact hF.1.1 U hU + · apply hF.1.2.insert + intro U hU _ + exact ⟨hWU ⟨U,hU⟩,hUW ⟨U,hU⟩⟩ + have hWF : W ∈ F := hF.2 hinsert (Set.subset_insert _ _) (Set.mem_insert _ _) + exact hWne (IsPartial.initial_zero (hUW ⟨W,hWF⟩).1) + +end FreeGroupFactorMain.Amplification.OperatorSum +namespace FreeGroupFactorMain.Amplification.Polar +variable {E : Type u_21} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +def centralSupportSpace (A : StarSubalgebra ℂ (Operator E)) (p : Operator E) : Submodule ℂ E := + (Submodule.span ℂ {x | ∃ T ∈ A, ∃ y, x=T (p y)}).topologicalClosure + +instance centralSupportSpace_complete (A : StarSubalgebra ℂ (Operator E)) (p : Operator E) : + CompleteSpace (centralSupportSpace A p) := + (Submodule.isClosed_topologicalClosure _).isComplete.completeSpace_coe + + theorem centralSupportSpace_invariant (A : StarSubalgebra ℂ (Operator E)) (p S : Operator E) + (h : ∀ T ∈ A, ∀ y, ∃ U ∈ A, ∃ z, S (T (p y))=U (p z)) : + ∀ x ∈ centralSupportSpace A p, S x ∈ centralSupportSpace A p := by + let K := Submodule.span ℂ {x | ∃ T ∈ A, ∃ y, x=T (p y)} + have hi : K ∈ Module.End.invtSubmodule S := by + rw [Module.End.mem_invtSubmodule_iff_map_le,Submodule.map_le_iff_le_comap] + apply Submodule.span_le.mpr + rintro x ⟨T,hT,y,rfl⟩ + change S (T (p y)) ∈ K + obtain ⟨U,hU,z,he⟩ := h T hT y + exact Submodule.subset_span ⟨U,hU,z,he⟩ + exact Submodule.topologicalClosure_mem_invtSubmodule hi + + theorem centralSupport_commutes (A : StarSubalgebra ℂ (Operator E)) (p S : Operator E) + (hS : S ∈ A) : Commute (centralSupportSpace A p).starProjection S := by + apply starProjection_commute + · apply centralSupportSpace_invariant + intro T hT y + exact ⟨S*T,mul_mem hS hT,y,rfl⟩ + · apply centralSupportSpace_invariant + intro T hT y + exact ⟨star S*T,mul_mem (star_mem hS) hT,y,rfl⟩ + + theorem centralSupport_mem_centralizer (s : Set (Operator E)) (p : Operator E) + (hp : p ∈ StarSubalgebra.centralizer ℂ s) : + (centralSupportSpace (StarSubalgebra.centralizer ℂ s) p).starProjection ∈ + StarSubalgebra.centralizer ℂ s := by + rw [StarSubalgebra.mem_centralizer_iff] + intro S hS + have hinv (S' : Operator E) (he : ∀ T ∈ StarSubalgebra.centralizer ℂ s, S'*T=T*S') : + ∀ x ∈ centralSupportSpace (StarSubalgebra.centralizer ℂ s) p, + S' x ∈ centralSupportSpace (StarSubalgebra.centralizer ℂ s) p := by + apply centralSupportSpace_invariant + intro T hT y + refine ⟨T,hT,S' y,?_⟩ + change (S'*T*p) y=(T*p*S') y + rw [he T hT,mul_assoc,he p hp,← mul_assoc] + have h₁ : ∀ T ∈ StarSubalgebra.centralizer ℂ s, S*T=T*S := + fun T hT => ((StarSubalgebra.mem_centralizer_iff ℂ).mp hT S hS).1 + have h₂ : ∀ T ∈ StarSubalgebra.centralizer ℂ s, star S*T=T*star S := + fun T hT => ((StarSubalgebra.mem_centralizer_iff ℂ).mp hT S hS).2 + have hc := starProjection_commute _ S (hinv S h₁) (hinv (star S) h₂) + have hcs := starProjection_commute _ (star S) (hinv (star S) h₂) (by simpa only [star_star] using hinv S h₁) + exact ⟨hc.eq.symm,hcs.eq.symm⟩ + + theorem centralSupport_fixes (A : StarSubalgebra ℂ (Operator E)) (p : Operator E) : + (centralSupportSpace A p).starProjection*p=p := by + apply ContinuousLinearMap.ext + intro x + apply Submodule.starProjection_eq_self_iff.mpr + apply Submodule.le_topologicalClosure + exact Submodule.subset_span ⟨1,one_mem A,x,by simp⟩ + + theorem centralSupport_annihilated (A : StarSubalgebra ℂ (Operator E)) (p q : Operator E) + (h : ∀ T ∈ A, q*T*p=0) : q*(centralSupportSpace A p).starProjection=0 := by + have hK : centralSupportSpace A p ≤ q.ker := by + apply Submodule.topologicalClosure_minimal + · apply Submodule.span_le.mpr + rintro x ⟨T,hT,y,rfl⟩ + change (q*T*p) y=0 + rw [h T hT,zero_apply] + · exact q.isClosed_ker + apply ContinuousLinearMap.ext + intro x + exact hK (Submodule.starProjection_apply_mem _ x) + + theorem cross_corner_nonzero (s : Set (Operator E)) + (hfactor : ∀ P ∈ StarSubalgebra.centralizer ℂ s, IsStarProjection P → + (∀ S ∈ StarSubalgebra.centralizer ℂ s, Commute P S) → P=0 ∨ P=1) + (p q : Operator E) (hp : p ∈ StarSubalgebra.centralizer ℂ s) (hpne : p ≠ 0) (hqne : q ≠ 0) : + ∃ T ∈ StarSubalgebra.centralizer ℂ s, q*T*p ≠ 0 := by + by_contra! h + let A := StarSubalgebra.centralizer ℂ s + let P := (centralSupportSpace A p).starProjection + have hm : P ∈ A := centralSupport_mem_centralizer s p hp + have hf : P*p=p := centralSupport_fixes A p + rcases hfactor P hm isStarProjection_starProjection (fun S hS => centralSupport_commutes A p S hS) with hP|hP + · apply hpne + rw [hP,zero_mul] at hf + exact hf.symm + · apply hqne + have hh := centralSupport_annihilated A p q h + change q*P=0 at hh + simpa only [hP,mul_one] using hh + +end FreeGroupFactorMain.Amplification.Polar +namespace FreeGroupFactorMain.Amplification.OperatorSum +variable {E : Type u_22} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + + theorem factor_partial_comparison (s : Set (Operator E)) + (hfactor : ∀ P ∈ StarSubalgebra.centralizer ℂ s, IsStarProjection P → + (∀ S ∈ StarSubalgebra.centralizer ℂ s, Commute P S) → P=0 ∨ P=1) + (p q : Operator E) (hp : IsStarProjection p) (hq : IsStarProjection q) + (hpm : p ∈ StarSubalgebra.centralizer ℂ s) (hqm : q ∈ StarSubalgebra.centralizer ℂ s) : + ∃ V ∈ StarSubalgebra.centralizer ℂ s, IsPartial V ∧ q*V=V ∧ V*p=V ∧ + (star V*V=p ∨ V*star V=q) := by + obtain ⟨V,hV,hpart,hqV,hVp,hcross⟩ := commutant_maximal_partial s p q hp hq hpm hqm + refine ⟨V,hV,hpart,hqV,hVp,?_⟩ + by_cases h : p-star V*V=0 + · exact Or.inl (sub_eq_zero.mp h).symm + · by_cases h' : q-V*star V=0 + · exact Or.inr (sub_eq_zero.mp h').symm + · obtain ⟨T,hT,hne⟩ := Polar.cross_corner_nonzero s hfactor (p-star V*V) (q-V*star V) + (sub_mem hpm (mul_mem (star_mem hV) hV)) h h' + exact (hne (hcross T hT)).elim + +end FreeGroupFactorMain.Amplification.OperatorSum +namespace FreeGroupFactorMain.Amplification + +section +open scoped ENNReal +open OperatorSum +variable {E : Type u_23} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + + theorem projection_inner (p : E →L[ℂ] E) (hp : IsStarProjection p) (x : E) : + inner ℂ x (p x)=(‖p x‖^2 : ℂ) := by + have he := ContinuousLinearMap.adjoint_inner_right p x (p x) + rw [← ContinuousLinearMap.star_eq_adjoint,hp.isSelfAdjoint.star_eq] at he + have hh : p (p x)=p x := congrArg (fun T : E →L[ℂ] E => T x) hp.isIdempotentElem.eq + rw [hh] at he + exact he.trans (inner_self_eq_norm_sq_to_K (p x)) + + theorem partial_initial_norm_sq (V : E →L[ℂ] E) (hV : IsPartial V) (x : E) : + ‖(star V*V) x‖^2=‖V x‖^2 := by + have he : (‖(star V*V) x‖ : ℂ)^2=(‖V x‖ : ℂ)^2 := by + rw [← projection_inner _ (initial_projection hV)] + exact (ContinuousLinearMap.adjoint_inner_right V x (V x)).trans (inner_self_eq_norm_sq_to_K (V x)) + exact_mod_cast he + + theorem orthogonal_projection_norm_sq (p q : E →L[ℂ] E) + (hp : IsSelfAdjoint p) (hpq : p*q=0) (x : E) : + ‖(p+q) x‖^2=‖p x‖^2+‖q x‖^2 := by + change ‖p x+q x‖^2=_ + rw [sq,sq,sq] + apply norm_add_sq_eq_norm_sq_add_norm_sq_of_inner_eq_zero (𝕜 := ℂ) + have he := ContinuousLinearMap.adjoint_inner_right p x (q x) + rw [← ContinuousLinearMap.star_eq_adjoint,hp.star_eq] at he + have hz : p (q x)=0 := congrArg (fun T : E →L[ℂ] E => T x) hpq + rw [hz,inner_zero_right] at he + exact he.symm + + variable {G : Type u_24} [Group G] + + theorem stabilizedProjectionTrace_faithful (T : stabilization G) + (h : stabilizedProjectionTrace T=0) : T=0 := by + classical + have hdelta (j : ℕ) : (T : GroupOperator (ℕ × G)) (lp.single 2 (j,1) (1 : ℂ))=0 := by + have hh := (ENNReal.tsum_eq_zero.mp h) j + have hzero : ‖(T : GroupOperator (ℕ × G)) (lp.single 2 (j,1) (1 : ℂ))‖^2=0 := + le_antisymm (ENNReal.ofReal_eq_zero.mp hh) (sq_nonneg _) + exact norm_eq_zero.mp (sq_eq_zero_iff.mp hzero) + apply Subtype.ext + apply matrixEntry_ext + intro i j + have hm := (mem_stabilization_iff_matrix _).mp T.property i j + have hz : matrixEntry (T : GroupOperator (ℕ × G)) i j (lp.single 2 (1 : G) (1 : ℂ))=0 := by + ext g + rw [matrixEntry_apply,productSingle_single,hdelta] + rfl + have he := groupVN_separating ⟨_,hm⟩ hz + calc + matrixEntry (T : GroupOperator (ℕ × G)) i j=0 := congrArg (fun A : groupVonNeumann G => (A : GroupOperator G)) he + _ = matrixEntry (0 : GroupOperator (ℕ × G)) i j := by + apply ContinuousLinearMap.ext + intro ξ + ext g + rw [matrixEntry_apply] + rfl + + theorem stabilizedProjectionTrace_initial (V : stabilization G) + (hV : IsPartial (V : GroupOperator (ℕ × G))) : + stabilizedProjectionTrace (star V*V)=stabilizedProjectionTrace V := by + classical + apply tsum_congr + intro j + congr 1 + exact partial_initial_norm_sq (V : GroupOperator (ℕ × G)) hV _ + + theorem stabilizedProjectionTrace_initial_final (V : stabilization G) + (hV : IsPartial (V : GroupOperator (ℕ × G))) : + stabilizedProjectionTrace (star V*V)=stabilizedProjectionTrace (V*star V) := by + classical + rw [stabilizedProjectionTrace_initial V hV] + have he := stabilizedProjectionTrace_initial (star V) (partial_star hV) + rw [star_star,stabilizedProjectionTrace_star] at he + exact he.symm + + theorem stabilizedProjectionTrace_orthogonal_add (p q : stabilization G) + (hp : IsSelfAdjoint p) (hpq : p*q=0) : + stabilizedProjectionTrace (p+q)=stabilizedProjectionTrace p+stabilizedProjectionTrace q := by + classical + rw [stabilizedProjectionTrace,stabilizedProjectionTrace,stabilizedProjectionTrace,← ENNReal.tsum_add] + apply tsum_congr + intro j + change ENNReal.ofReal (‖((p : GroupOperator (ℕ × G))+(q : GroupOperator (ℕ × G))) (lp.single 2 (j,1) (1 : ℂ))‖^2)=_ + rw [orthogonal_projection_norm_sq (p : GroupOperator (ℕ × G)) q + (show IsSelfAdjoint (p : GroupOperator (ℕ × G)) from congrArg Subtype.val hp) + (congrArg Subtype.val hpq),ENNReal.ofReal_add (sq_nonneg _) (sq_nonneg _)] + + theorem finite_trace_equal_projection_of_le (p e : stabilization G) + (_hp : IsStarProjection p) (he : IsStarProjection e) (hep : e*p=e) + (htrace : stabilizedProjectionTrace p=stabilizedProjectionTrace e) + (hfinite : stabilizedProjectionTrace p ≠ ⊤) : p=e := by + have he' : e*(p-e)=0 := by rw [mul_sub,hep,he.isIdempotentElem,sub_self] + have hs := stabilizedProjectionTrace_orthogonal_add e (p-e) he.isSelfAdjoint he' + rw [add_sub_cancel,htrace] at hs + have hzero : stabilizedProjectionTrace (p-e)=0 := by + have hf : stabilizedProjectionTrace e ≠ ⊤ := htrace ▸ hfinite + exact (ENNReal.add_right_inj hf).mp (by simpa only [add_zero] using hs.symm) + exact sub_eq_zero.mp (stabilizedProjectionTrace_faithful (p-e) hzero) + +end +open scoped ENNReal +open OperatorSum + + theorem equal_finite_trace_equivalence {G : Type u_25} [Group G] + (hbase : ∀ T : groupVonNeumann G, (∀ S : groupVonNeumann G, Commute T S) → + ∃ c : ℂ, T=c • (1 : groupVonNeumann G)) + (p q : stabilization G) (hp : IsStarProjection p) (hq : IsStarProjection q) + (htrace : stabilizedProjectionTrace p=stabilizedProjectionTrace q) + (hfinite : stabilizedProjectionTrace p ≠ ⊤) : + ∃ V : stabilization G, star V*V=p ∧ V*star V=q := by + have hfac := stabilization_center_projection hbase + have hp' : IsStarProjection (p : GroupOperator (ℕ × G)) := hp.map (stabilization G).subtype + have hq' : IsStarProjection (q : GroupOperator (ℕ × G)) := hq.map (stabilization G).subtype + obtain ⟨V,hV,hpart,hqV,hVp,hside⟩ := factor_partial_comparison (stabilizedRightTranslations G) + hfac p q hp' hq' p.property q.property + let U : stabilization G := ⟨V,hV⟩ + have hpart' : IsPartial (U : GroupOperator (ℕ × G)) := hpart + have hi : IsStarProjection (star U*U) := by + constructor + · apply Subtype.ext + exact (initial_projection hpart).isIdempotentElem + · apply Subtype.ext + exact (initial_projection hpart).isSelfAdjoint + have hf : IsStarProjection (U*star U) := by + constructor + · apply Subtype.ext + change (V*star V)*(V*star V)=V*star V + simpa only [star_star] using (initial_projection (partial_star hpart)).isIdempotentElem.eq + · apply Subtype.ext + change star (V*star V)=V*star V + simpa only [star_star] using (initial_projection (partial_star hpart)).isSelfAdjoint.star_eq + have hitrace := stabilizedProjectionTrace_initial_final U hpart' + refine ⟨U,?_⟩ + rcases hside with he|he + · have hu : star U*U=p := Subtype.ext he + have hle : (U*star U)*q=U*star U := by + apply Subtype.ext + have he' := congrArg star hqV + simp only [star_mul,hq'.isSelfAdjoint.star_eq] at he' + change (V*star V)*(q : GroupOperator (ℕ × G))=V*star V + rw [mul_assoc,he'] + rw [hu] at hitrace + have ht : stabilizedProjectionTrace q=stabilizedProjectionTrace (U*star U) := htrace.symm.trans hitrace + exact ⟨hu,(finite_trace_equal_projection_of_le q (U*star U) hq hf hle ht (htrace ▸ hfinite)).symm⟩ + · have hu : U*star U=q := Subtype.ext he + have hle : (star U*U)*p=star U*U := by + apply Subtype.ext + change (star V*V)*(p : GroupOperator (ℕ × G))=star V*V + rw [mul_assoc,hVp] + rw [hu] at hitrace + have ht : stabilizedProjectionTrace p=stabilizedProjectionTrace (star U*U) := htrace.trans hitrace.symm + exact ⟨(finite_trace_equal_projection_of_le p (star U*U) hp hi hle ht hfinite).symm,hu⟩ + + theorem infinite_equal_finite_trace_equivalence + (p q : stabilization (FreeGroup ℕ)) (hp : IsStarProjection p) (hq : IsStarProjection q) + (htrace : stabilizedProjectionTrace p=stabilizedProjectionTrace q) + (hfinite : stabilizedProjectionTrace p ≠ ⊤) : + ∃ V : stabilization (FreeGroup ℕ), star V*V=p ∧ V*star V=q := + equal_finite_trace_equivalence + (fun T hT => ⟨canonicalTrace T,infinite_free_group_center_scalar T hT⟩) p q hp hq htrace hfinite + +end FreeGroupFactorMain.Amplification + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/PairedAbsorption.lean b/lean/OAI/Analysis/InterpolatedFactors/PairedAbsorption.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf551fe1e13962957d5de48378f57ef98b9972c7 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/PairedAbsorption.lean @@ -0,0 +1,268 @@ +import OAI.Analysis.InterpolatedFactors.CornerIndex + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 u_10 + +namespace FreeGroupFactorMain.PairedAbsorption +open RectangularAbsorption CircularRotation +variable {A : Type u_1} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] +variable {S : Type u_2} {P : Type u_3} [DecidableEq S] [DecidableEq P] +abbrev Index (S : Type u_4) (P : Type u_5) := PairedIndex S P + +structure Input (B : StarSubalgebra ℂ A) (S : Type u_6) (P : Type u_7) [DecidableEq S] [DecidableEq P] where + τ : B →ₗ[ℂ] ℂ + tracial : ∀ a b,τ (a*b)=τ (b*a) + p : Index S P → B + q : Index S P → B + projection : ∀ i,IsStarProjection (p i) + projectionq : ∀ i,IsStarProjection (q i) + pq : ∀ i,p (CircularRotation.flip i)=q i + qp : ∀ i,q (CircularRotation.flip i)=p i + raw : Index S P → ℕ → A + extra : Index S P → A + supported : ∀ i,(p i:A)*extra i*(q i:A)=extra i + raw_cov : ∀ i j n m (a : B),star (raw i n)*(a:A)*raw j m= + if i=j ∧ n=m then τ a • (1:A) else 0 + extra_cov : ∀ i j (a : B),star (extra i)*(a:A)*extra j= + if i=j then τ (a*p i) • (q i:A) else 0 + raw_extra : ∀ i j n (a : B),star (raw i n)*(a:A)*extra j=0 + +namespace Input +variable {B : StarSubalgebra ℂ A} (d : Input B S P) + +def reservoir (i : Index S P) (n : ℕ) : A := rotate (fun k => d.raw k n) i + +theorem reservoir_cov (i j : Index S P) (n m : ℕ) (a : B) : + star (d.reservoir i n)*(a:A)*d.reservoir j m= + if i=j ∧ n=m then d.τ a • (1:A) else 0 := by + by_cases hnm : n=m + · subst m + have hh := rotate_covariance (fun k => d.raw k n) (a:A) (d.τ a • (1:A)) + (fun i j => by simpa only [and_true] using d.raw_cov i j n n a) i j + simpa only [reservoir,and_true] using hh + · rcases i with i | ⟨i,b⟩ <;> rcases j with j | ⟨j,c⟩ + · simpa only [reservoir,rotate,hnm,and_false,ite_false] using d.raw_cov (.inl i) (.inl j) n m a + · cases c <;> simp [reservoir,rotate,plus,minus,mul_add,mul_sub,d.raw_cov,hnm] + · cases b <;> simp [reservoir,rotate,plus,minus,star_smul,star_add,star_sub,add_mul,d.raw_cov,hnm] + · cases b <;> cases c <;> + simp [reservoir,rotate,plus,minus,star_smul,star_add,star_sub,add_mul,mul_add,mul_sub,d.raw_cov,hnm] + +theorem reservoir_extra (i j : Index S P) (n : ℕ) (a : B) : + star (d.reservoir i n)*(a:A)*d.extra j=0 := by + rcases i with i | ⟨i,b⟩ + · exact d.raw_extra (.inl i) j n a + · cases b <;> simp [reservoir,rotate,plus,minus,star_smul,star_add,star_sub,add_mul,d.raw_extra] + +def data (i : Index S P) : Data B where + τ := d.τ + tracial := d.tracial + p := d.p i + q := d.q i + projection := d.projection i + projectionq := d.projectionq i + C := d.reservoir i + D := d.extra i + D_supported := d.supported i + C_cov a n m := by simpa only [true_and] using d.reservoir_cov i i n m a + D_cov a := by simpa only [ite_true] using d.extra_cov i i a + C_D a n := d.reservoir_extra i i n a + D_C a n := (Orthogonal.symm (d.reservoir_extra i i n)) a + +def family : Family B (Index S P) where + data := d.data + CC i j hij n m a := by simpa only [data,hij,false_and,ite_false] using d.reservoir_cov i j n m a + CD i j _ n a := d.reservoir_extra i j n a + DD i j hij a := by simpa only [data,ite_eq_right hij] using d.extra_cov i j a + +def output (i : Index S P) (n : ℕ) : A := d.family.output i n + +theorem output_cov (i j : Index S P) (n m : ℕ) (a : B) : + star (d.output i n)*(a:A)*d.output j m= + if i=j ∧ n=m then d.τ a • (1:A) else 0 := by + have hh := d.family.output_covariance i j n m a + split_ifs with h + · rw [ite_eq_left h] at hh; exact hh + · rw [ite_eq_right h] at hh; exact hh + +theorem output_generation (M : StarSubalgebra ℂ A) + (hpM : ∀ i,(d.p i:A)∈M) (hqM : ∀ i,(d.q i:A)∈M) : + ((∀ i,d.extra i+star (d.extra (CircularRotation.flip i))∈M) ∧ + ∀ i n,d.raw i n+star (d.raw i n)∈M) ↔ + ∀ i n,d.output i n+star (d.output (CircularRotation.flip i) n)∈M := by + have hh := d.family.output_generation CircularRotation.flip d.pq d.qp M hpM hqM + change ((∀ i,d.extra i+star (d.extra (CircularRotation.flip i))∈M) ∧ + ∀ i n,d.reservoir i n+star (d.reservoir (CircularRotation.flip i) n)∈M) ↔ + ∀ i n,d.output i n+star (d.output (CircularRotation.flip i) n)∈M at hh + rw [← hh] + apply and_congr_right + intro _ + constructor + · intro h i n + exact (rotate_generation (fun k => d.raw k n) M).mp (fun k => h k n) i + · intro h i n + exact (rotate_generation (fun k => d.raw k n) M).mpr (fun k => h k n) i +end Input +end FreeGroupFactorMain.PairedAbsorption + +namespace FreeGroupFactorMain.WeightedFock +open FreeFock Amplification RectangularAbsorption WeightedCornerIndex + +abbrev Base (u v : ℝ) := pFilled u v (0:ℕ) 1 + +def kindCreator (u v : ℝ) : Kind → PCorner ℕ + | .fresh n r s => pFresh u v 0 (n+2) r s + | .residual r s => pResidual u v 0 1 r s + | .diagonal r => pDiagonal u v 0 0 r + +def kindLeft (u v : ℝ) : Kind → Base u v + | .fresh _ r _ => pSupport u v 0 1 r + | .residual r _ => pResidualSupport u v 0 1 r + | .diagonal r => pSupport u v 0 1 r + +def kindRight (u v : ℝ) : Kind → Base u v + | .fresh _ _ s => pSupport u v 0 1 s + | .residual _ s => pResidualSupport u v 0 1 s + | .diagonal r => pSupport u v 0 1 r + +theorem kindLeft_projection (u v : ℝ) (k : Kind) : IsStarProjection (kindLeft u v k) := by + cases k + · exact pSupport_projection u v 0 1 _ + · exact pResidualSupport_projection u v 0 1 _ + · exact pSupport_projection u v 0 1 _ + +theorem kindRight_projection (u v : ℝ) (k : Kind) : IsStarProjection (kindRight u v k) := by + cases k + · exact pSupport_projection u v 0 1 _ + · exact pResidualSupport_projection u v 0 1 _ + · exact pSupport_projection u v 0 1 _ + +theorem kindLeft_transpose (u v : ℝ) (k : Kind) : kindLeft u v k.transpose=kindRight u v k := by + cases k <;> rfl + +theorem kindRight_transpose (u v : ℝ) (k : Kind) : kindRight u v k.transpose=kindLeft u v k := by + cases k <;> rfl + +theorem kindCreator_supported (u v : ℝ) (hv : 0 + cases l with + | fresh m t w => + have hh := pFresh_covariance u v hu hv (0:ℕ) 1 (n+2) (m+2) (by omega) + (by omega) (by omega) (by omega) (by omega) r s t w a + simpa only [kindCreator,kindLeft,kindRight,Kind.fresh.injEq,Nat.add_right_cancel_iff] using hh + | residual t w => + rw [ite_eq_right (by simp)] + exact pFresh_residual u v (0:ℕ) 1 (n+2) (by omega) (by omega) (by omega) r s t w hl a + | diagonal t => + rw [ite_eq_right (by simp)] + exact pFresh_diagonal u v (0:ℕ) 1 (n+2) 0 (by omega) (by omega) (by omega) (by omega) (by omega) r s t a + | residual r s => + cases l with + | fresh m t w => + rw [ite_eq_right (by simp)] + exact (pFresh_residual u v (0:ℕ) 1 (m+2) (by omega) (by omega) (by omega) t w r s hk).symm a + | residual t w => + simpa only [kindCreator,kindLeft,kindRight,Kind.residual.injEq] + using pResidual_covariance u v hu hv (0:ℕ) 1 (by omega) r s t w hk hl a + | diagonal t => + rw [ite_eq_right (by simp)] + exact pResidual_diagonal u v (0:ℕ) 1 0 (by omega) (by omega) r s hk t a + | diagonal r => + cases l with + | fresh m t w => + rw [ite_eq_right (by simp)] + exact (pFresh_diagonal u v (0:ℕ) 1 (m+2) 0 (by omega) (by omega) (by omega) (by omega) (by omega) t w r).symm a + | residual t w => + rw [ite_eq_right (by simp)] + exact (pResidual_diagonal u v (0:ℕ) 1 0 (by omega) (by omega) t w hl r).symm a + | diagonal t => + simpa only [kindCreator,kindLeft,kindRight,Kind.diagonal.injEq,true_and] + using pDiagonal_covariance u v hu hv (0:ℕ) 1 0 0 (by omega) (by omega) (by omega) r t a + +def rawReservoir (u v : ℝ) (i : WeightedCornerIndex.Index) (n : ℕ) : PCorner ℕ := + pFresh u v 0 (reservoirCode (i,n)+2) false false + +theorem rawReservoir_covariance (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i j : WeightedCornerIndex.Index) (n m : ℕ) (a : Base u v) : + star (rawReservoir u v i n)*(a : PCorner ℕ)*rawReservoir u v j m= + if i=j ∧ n=m then pTrace u v 0 1 a • (1:PCorner ℕ) else 0 := by + have hh := pFresh_covariance u v hu hv (0:ℕ) 1 (reservoirCode (i,n)+2) (reservoirCode (j,m)+2) + (by omega) (by omega) (by omega) (by omega) (by omega) false false false false a + simpa only [rawReservoir,and_true,pSupport_false,mul_one,OneMemClass.coe_one, + Nat.add_right_cancel_iff,reservoirCode.injective.eq_iff,Prod.mk.injEq] using hh + +theorem rawReservoir_extra (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i : WeightedCornerIndex.Index) (n : ℕ) (k : Kind) (hk : k.valid) (a : Base u v) : + star (rawReservoir u v i n)*(a : PCorner ℕ)*kindCreator u v k=0 := by + cases k with + | fresh m r s => + have hh := pFresh_covariance u v hu hv (0:ℕ) 1 (reservoirCode (i,n)+2) (m+2) + (by omega) (by omega) (by omega) (by omega) (by omega) false false r s a + rw [ite_eq_right (fun h => hk ⟨h.2.1.symm,h.2.2.symm⟩)] at hh + exact hh + | residual r s => + exact pFresh_residual u v (0:ℕ) 1 (reservoirCode (i,n)+2) + (by omega) (by omega) (by omega) false false r s hk a + | diagonal r => + exact pFresh_diagonal u v (0:ℕ) 1 (reservoirCode (i,n)+2) 0 + (by omega) (by omega) (by omega) (by omega) (by omega) false false r a + +def cornerAbsorption (u v : ℝ) (hv : 0 exact K.add_mem (hextra i) (hrem 0) + | succ n => exact K.add_mem (hp n) (hrem (n+1)) +end FreeGroupFactorMain.PairedAbsorption.Input + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Polar.lean b/lean/OAI/Analysis/InterpolatedFactors/Polar.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ba3988a8c355e6d5c8fa50f3f6b2b9e78020a84 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Polar.lean @@ -0,0 +1,585 @@ +import OAI.Analysis.InterpolatedFactors.Fock + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 + +namespace FreeGroupFactorMain.Amplification.Polar + +section + +variable {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +abbrev Operator (E : Type u_2) [NormedAddCommGroup E] [InnerProductSpace ℂ E] := E →L[ℂ] E + +def modulus (T : Operator E) : Operator E := CFC.sqrt (star T*T) + +theorem modulus_star (T : Operator E) : star (modulus T) = modulus T := + (IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg _)).star_eq + +theorem modulus_sq (T : Operator E) : modulus T*modulus T = star T*T := + CFC.sqrt_mul_sqrt_self _ (star_mul_self_nonneg T) + +theorem modulus_norm (T : Operator E) (x : E) : ‖modulus T x‖ = ‖T x‖ := by + have hinner : inner ℂ (modulus T x) (modulus T x) = inner ℂ (T x) (T x) := by + calc + _ = inner ℂ ((star (modulus T)*modulus T) x) x := by + exact (ContinuousLinearMap.adjoint_inner_left (modulus T) x (modulus T x)).symm + _ = inner ℂ ((star T*T) x) x := by rw [modulus_star,modulus_sq] + _ = _ := ContinuousLinearMap.adjoint_inner_left T x (T x) + have hs : ‖modulus T x‖^2 = ‖T x‖^2 := by + simpa only [inner_self_eq_norm_sq] using congrArg (RCLike.re : ℂ → ℝ) hinner + nlinarith [norm_nonneg (modulus T x),norm_nonneg (T x)] + +def closedRange (T : Operator E) : Submodule ℂ E := T.toLinearMap.range.topologicalClosure + +instance closedRange_complete (T : Operator E) : CompleteSpace (closedRange T) := + (Submodule.isClosed_topologicalClosure _).isComplete.completeSpace_coe + +def intoClosedRange (T : Operator E) : E →L[ℂ] closedRange T := + T.codRestrict (closedRange T) (fun x => Submodule.le_topologicalClosure _ (LinearMap.mem_range_self _ x)) + +omit [CompleteSpace E] in +theorem intoClosedRange_dense (T : Operator E) : DenseRange (intoClosedRange T) := by + rw [DenseRange,Subtype.dense_iff,← Set.range_comp] + change (closedRange T : Set E) ⊆ closure (Set.range (fun x : E => T x)) + rw [closedRange,Submodule.topologicalClosure_coe] + exact Set.Subset.rfl + +def polarSpatial (T : Operator E) : closedRange (modulus T) ≃ₗᵢ[ℂ] closedRange T := + (LinearEquiv.refl ℂ E).extendOfIsometry (intoClosedRange (modulus T)).toLinearMap + (intoClosedRange T).toLinearMap (intoClosedRange_dense _) (intoClosedRange_dense _) + (fun x => (modulus_norm T x).symm) + +theorem polarSpatial_modulus (T : Operator E) (x : E) : + polarSpatial T (intoClosedRange (modulus T) x) = intoClosedRange T x := + LinearEquiv.extendOfIsometry_eq _ _ _ _ _ _ x + +def partialIsometry (T : Operator E) : Operator E := + (closedRange T).subtypeL.comp ((polarSpatial T).toContinuousLinearEquiv.toContinuousLinearMap.comp + (closedRange (modulus T)).orthogonalProjectionOnto) + +theorem partialIsometry_factorization (T : Operator E) : partialIsometry T * modulus T = T := by + apply ContinuousLinearMap.ext + intro x + change ((polarSpatial T) ((closedRange (modulus T)).orthogonalProjectionOnto (modulus T x)) : E) = T x + have he : (closedRange (modulus T)).orthogonalProjectionOnto (modulus T x) = intoClosedRange (modulus T) x := + Submodule.orthogonalProjectionOnto_mem_subspace_eq_self (intoClosedRange (modulus T) x) + rw [he,polarSpatial_modulus] + rfl + +theorem partialIsometry_on_range (T : Operator E) (x : closedRange (modulus T)) : + partialIsometry T x = (polarSpatial T x : E) := by + change ((polarSpatial T) ((closedRange (modulus T)).orthogonalProjectionOnto x) : E) = _ + rw [Submodule.orthogonalProjectionOnto_mem_subspace_eq_self] + +theorem partialIsometry_inner (T : Operator E) (x y : E) : + inner ℂ (partialIsometry T x) (partialIsometry T y) = + inner ℂ ((closedRange (modulus T)).starProjection x) y := by + change inner ℂ (polarSpatial T ((closedRange (modulus T)).orthogonalProjectionOnto x)) + (polarSpatial T ((closedRange (modulus T)).orthogonalProjectionOnto y)) = _ + rw [(polarSpatial T).inner_map_map] + exact Submodule.inner_orthogonalProjectionOnto_eq_of_mem_left _ _ + +theorem partialIsometry_initial (T : Operator E) : + star (partialIsometry T)*partialIsometry T = (closedRange (modulus T)).starProjection := by + apply ContinuousLinearMap.ext + intro x + apply ext_inner_right ℂ + intro y + rw [mul_apply_eq_comp,ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_left,partialIsometry_inner] + +theorem partialIsometry_adjoint (T : Operator E) (x : E) : + star (partialIsometry T) x = + ((polarSpatial T).symm ((closedRange T).orthogonalProjectionOnto x) : E) := by + apply ext_inner_right ℂ + intro y + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_left] + change inner ℂ x ((polarSpatial T) ((closedRange (modulus T)).orthogonalProjectionOnto y) : E) = _ + rw [← Submodule.inner_orthogonalProjectionOnto_eq_of_mem_right + ((polarSpatial T) ((closedRange (modulus T)).orthogonalProjectionOnto y)) x] + rw [← (polarSpatial T).symm.inner_map_map,(polarSpatial T).symm_apply_apply] + exact Submodule.inner_orthogonalProjectionOnto_eq_of_mem_left _ _ + +theorem partialIsometry_final (T : Operator E) : + partialIsometry T*star (partialIsometry T) = (closedRange T).starProjection := by + apply ContinuousLinearMap.ext + intro x + rw [mul_apply_eq_comp,partialIsometry_adjoint,partialIsometry_on_range, + (polarSpatial T).apply_symm_apply] + rfl + +end +section +variable {E : Type u_3} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + + theorem modulus_commute {T S : Operator E} (h : Commute T S) (hstar : Commute (star T) S) : + Commute (modulus T) S := + (hstar.mul_left h).cfcₙ_nnreal NNReal.sqrt + +omit [CompleteSpace E] in + theorem closedRange_invariant {T S : Operator E} (h : Commute T S) : + ∀ x ∈ closedRange T, S x ∈ closedRange T := by + have hi : T.toLinearMap.range ∈ Module.End.invtSubmodule S := by + rw [Module.End.mem_invtSubmodule_iff_map_le] + rintro _ ⟨_,⟨x,rfl⟩,rfl⟩ + refine ⟨S x,?_⟩ + exact DFunLike.congr_fun h.eq x + exact Submodule.topologicalClosure_mem_invtSubmodule hi + + theorem orthogonal_invariant (K : Submodule ℂ E) (S : Operator E) + (h : ∀ x ∈ K, star S x ∈ K) : ∀ x ∈ Kᗮ, S x ∈ Kᗮ := by + intro x hx + rw [Submodule.mem_orthogonal] at hx ⊢ + intro y hy + rw [← ContinuousLinearMap.adjoint_inner_left] + exact hx (star S y) (h y hy) + + theorem starProjection_commute (K : Submodule ℂ E) [K.HasOrthogonalProjection] (S : Operator E) + (h : ∀ x ∈ K, S x ∈ K) (hstar : ∀ x ∈ K, star S x ∈ K) : + Commute K.starProjection S := by + apply ContinuousLinearMap.ext + intro x + change K.starProjection (S x) = S (K.starProjection x) + apply Submodule.eq_starProjection_of_mem_orthogonal + · exact h _ (K.orthogonalProjectionOnto x).property + · rw [← map_sub] + exact orthogonal_invariant K S hstar _ (K.sub_starProjection_mem_orthogonal x) + + theorem partialIsometry_projection (T : Operator E) : + partialIsometry T * (closedRange (modulus T)).starProjection = partialIsometry T := by + apply ContinuousLinearMap.ext + intro x + change ((polarSpatial T) ((closedRange (modulus T)).orthogonalProjectionOnto + ((closedRange (modulus T)).orthogonalProjectionOnto x)) : E) = _ + rw [Submodule.orthogonalProjectionOnto_mem_subspace_eq_self] + rfl + + theorem partialIsometry_commute {T S : Operator E} + (h : Commute T S) (hstar : Commute (star T) S) + (hs : Commute T (star S)) (hstars : Commute (star T) (star S)) : + Commute (partialIsometry T) S := by + have hm := modulus_commute h hstar + have hms := modulus_commute hs hstars + have hp := starProjection_commute (closedRange (modulus T)) S + (closedRange_invariant hm) (closedRange_invariant hms) + have he : Set.EqOn (partialIsometry T * S) (S * partialIsometry T) + (closedRange (modulus T) : Set E) := by + apply Set.EqOn.closure _ (partialIsometry T * S).continuous (S * partialIsometry T).continuous + rintro _ ⟨x,rfl⟩ + change partialIsometry T (S (modulus T x)) = S (partialIsometry T (modulus T x)) + have hmx : modulus T (S x) = S (modulus T x) := DFunLike.congr_fun hm.eq x + rw [← hmx] + change (partialIsometry T * modulus T) (S x) = S ((partialIsometry T * modulus T) x) + rw [partialIsometry_factorization] + exact DFunLike.congr_fun h.eq x + apply ContinuousLinearMap.ext + intro x + have hx := he ((closedRange (modulus T)).orthogonalProjectionOnto x).property + change (partialIsometry T * S) x = (S * partialIsometry T) x + calc + _ = (partialIsometry T * (closedRange (modulus T)).starProjection * S) x := by + rw [partialIsometry_projection] + _ = (partialIsometry T * S * (closedRange (modulus T)).starProjection) x := by + rw [mul_assoc,hp.eq,← mul_assoc] + _ = (S * partialIsometry T * (closedRange (modulus T)).starProjection) x := hx + _ = _ := by rw [mul_assoc,partialIsometry_projection] + +end +section +variable {E : Type u_4} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + + theorem partialIsometry_mem_centralizer (s : Set (Operator E)) {T : Operator E} + (hT : T ∈ StarSubalgebra.centralizer ℂ s) : + partialIsometry T ∈ StarSubalgebra.centralizer ℂ s := by + have ht := (StarSubalgebra.mem_centralizer_iff ℂ).mp hT + have hts := (StarSubalgebra.mem_centralizer_iff ℂ).mp + (star_mem hT) + rw [StarSubalgebra.mem_centralizer_iff] + intro S hS + have h₁ : Commute T S := (ht S hS).1.symm + have h₂ : Commute (star T) S := (hts S hS).1.symm + have h₃ : Commute T (star S) := (ht S hS).2.symm + have h₄ : Commute (star T) (star S) := (hts S hS).2.symm + exact ⟨(partialIsometry_commute h₁ h₂ h₃ h₄).eq.symm, + (partialIsometry_commute h₃ h₄ (by simpa using h₁) (by simpa using h₂)).eq.symm⟩ + + theorem closedRange_eq_orthogonal_ker (T : Operator E) : + closedRange T = (star T).kerᗮ := by + simpa only [closedRange,ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_adjoint] + using (ContinuousLinearMap.orthogonal_ker (star T)).symm + + theorem modulus_ker (T : Operator E) : (modulus T).ker = T.ker := by + ext x + change modulus T x = 0 ↔ T x = 0 + calc + _ ↔ ‖modulus T x‖ = 0 := norm_eq_zero.symm + _ ↔ ‖T x‖ = 0 := by rw [modulus_norm] + _ ↔ _ := norm_eq_zero + + theorem modulus_closedRange (T : Operator E) : closedRange (modulus T) = T.kerᗮ := by + rw [closedRange_eq_orthogonal_ker,modulus_star,modulus_ker] + + theorem closedRange_projection_mem_centralizer (s : Set (Operator E)) {T : Operator E} + (hT : T ∈ StarSubalgebra.centralizer ℂ s) : + (closedRange T).starProjection ∈ StarSubalgebra.centralizer ℂ s := by + rw [← partialIsometry_final] + have hu := partialIsometry_mem_centralizer s hT + exact mul_mem hu (star_mem hu) + + theorem partialIsometry_nonzero {T : Operator E} (hT : T ≠ 0) : partialIsometry T ≠ 0 := by + intro h + apply hT + rw [← partialIsometry_factorization T,h,zero_mul] + +end +variable {E : Type u_5} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +omit [CompleteSpace E] in + theorem fixed_on_closedRange {q T : Operator E} (h : q*T=T) (x : closedRange T) : q x=x := by + have he : Set.EqOn q id (Set.range T) := by + rintro _ ⟨y,rfl⟩ + exact DFunLike.congr_fun h y + have hc := he.closure q.continuous continuous_id + apply hc + have hx := x.property + change (x : E) ∈ (↑(T.toLinearMap.range.topologicalClosure) : Set E) at hx + rw [Submodule.topologicalClosure_coe] at hx + exact hx + + theorem partialIsometry_left_support {q T : Operator E} (h : q*T=T) : + q*partialIsometry T=partialIsometry T := by + apply ContinuousLinearMap.ext + intro x + exact fixed_on_closedRange h ((polarSpatial T) ((closedRange (modulus T)).orthogonalProjectionOnto x)) + + theorem modulus_right_support {p T : Operator E} (h : T*p=T) : modulus T*p=modulus T := by + apply ContinuousLinearMap.ext + intro x + have hz : T (p x-x)=0 := by rw [map_sub]; exact sub_eq_zero.mpr (DFunLike.congr_fun h x) + have hn : ‖modulus T (p x-x)‖=0 := by rw [modulus_norm,hz,norm_zero] + change modulus T (p x)=modulus T x + simpa only [map_sub,sub_eq_zero] using norm_eq_zero.mp hn + + theorem partialIsometry_right_support {p T : Operator E} (hp : IsSelfAdjoint p) (h : T*p=T) : + partialIsometry T*p=partialIsometry T := by + have hm := congrArg star (modulus_right_support h) + simp only [star_mul,hp.star_eq,modulus_star] at hm + have ha : p*star (partialIsometry T)=star (partialIsometry T) := by + apply ContinuousLinearMap.ext + intro x + rw [mul_apply_eq_comp,partialIsometry_adjoint] + exact fixed_on_closedRange hm ((polarSpatial T).symm ((closedRange T).orthogonalProjectionOnto x)) + have he := congrArg star ha + simpa only [star_mul,star_star,hp.star_eq] using he + + theorem partialIsometry_partial (T : Operator E) : + partialIsometry T*star (partialIsometry T)*partialIsometry T=partialIsometry T := by + rw [partialIsometry_final] + apply ContinuousLinearMap.ext + intro x + apply Submodule.starProjection_eq_self_iff.mpr + exact ((polarSpatial T) ((closedRange (modulus T)).orthogonalProjectionOnto x)).property + +end FreeGroupFactorMain.Amplification.Polar + +namespace FreeGroupFactorMain.WeightedFock +open FreeFock +open Amplification.Polar +variable {ι : Type u_6} [DecidableEq ι] + + theorem weighted_creation_norm (i : ι) (r : Bool) (ξ : H ι) : + ‖creation i r ξ‖=‖ξ‖ := (hilbertEmbedding (prepend i r)).norm_map ξ + + theorem weighted_creation_opNorm_le (i : ι) (r : Bool) : ‖creation i r‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro ξ + rw [weighted_creation_norm,one_mul] + + theorem P_creation_true (i : ι) : (P : Operator ι)*creation i true=creation i true := by + apply operator_basis_ext + rintro ⟨w,e⟩ + simp only [mul_apply_eq_comp,creation_single,P_cons,ite_true] + + def offDiagonal (u v : ℝ) (i : ι) : Operator ι := P*S u v i*(1-P) + + theorem offDiagonal_formula (u v : ℝ) (i : ι) : + offDiagonal u v i=(u:ℂ) • (creation i true*(1-P)) + + (v:ℂ) • (P*star (creation i false)) := by + have ht : star (creation i true)*(1-P : Operator ι)=0 := by + have hh := congrArg star (P_creation_true i) + simp only [star_mul,projection_P.isSelfAdjoint.star_eq] at hh + rw [mul_sub,mul_one,hh,sub_self] + have hf : star (creation i false)*(1-P : Operator ι)=star (creation i false) := by + have hh := congrArg star (P_creation_false i) + simp only [star_mul,projection_P.isSelfAdjoint.star_eq,star_zero (Operator ι)] at hh + rw [mul_sub,mul_one,hh,sub_zero] + simp only [offDiagonal,S,mul_add,add_mul,star_add (R := Operator ι),star_smul,Complex.star_def, + Complex.conj_ofReal,mul_smul_comm,smul_mul_assoc,P_creation_true,P_creation_false, + mul_assoc,ht,hf,mul_zero,zero_mul,smul_zero,add_zero,zero_add] + + theorem offDiagonal_right (u v : ℝ) (i : ι) : + offDiagonal u v i*(1-P)=offDiagonal u v i := by + unfold offDiagonal + simp only [mul_assoc,projection_P.one_sub.isIdempotentElem.eq] + + theorem offDiagonal_left (u v : ℝ) (i : ι) : + P*offDiagonal u v i=offDiagonal u v i := by + rw [offDiagonal,← mul_assoc,← mul_assoc,projection_P.isIdempotentElem.eq] + + theorem offDiagonal_lower_bound (u v : ℝ) (hu : 0 ≤ u) (hv : 0 ≤ v) + (i : ι) (ξ : H ι) (hξ : (1-P : Operator ι) ξ=ξ) : + (u-v)*‖ξ‖ ≤ ‖offDiagonal u v i ξ‖ := by + have hP : ‖(P : Operator ι)‖ ≤ 1 := CoordinateProjection.norm_proj_le _ + have hc : ‖star (creation i false) ξ‖ ≤ ‖ξ‖ := by + calc + _ ≤ ‖star (creation i false)‖*‖ξ‖ := ContinuousLinearMap.le_opNorm _ _ + _ ≤ 1*‖ξ‖ := mul_le_mul_of_nonneg_right (by simpa only [ContinuousLinearMap.star_eq_adjoint,LinearIsometryEquiv.norm_map] using weighted_creation_opNorm_le i false) (norm_nonneg _) + _ = _ := one_mul _ + have hpc : ‖P (star (creation i false) ξ)‖ ≤ ‖ξ‖ := by + calc + _ ≤ ‖(P : Operator ι)‖*‖star (creation i false) ξ‖ := ContinuousLinearMap.le_opNorm _ _ + _ ≤ 1*‖star (creation i false) ξ‖ := mul_le_mul_of_nonneg_right hP (norm_nonneg _) + _ ≤ ‖ξ‖ := by simpa only [one_mul] using hc + rw [offDiagonal_formula] + change (u-v)*‖ξ‖ ≤ ‖(u:ℂ) • creation i true ((1-P : Operator ι) ξ)+ + (v:ℂ) • P (star (creation i false) ξ)‖ + rw [hξ] + have hb := norm_sub_norm_le ((u:ℂ) • creation i true ξ) + (-((v:ℂ) • P (star (creation i false) ξ))) + simp only [norm_neg,sub_neg_eq_add,norm_smul,Complex.norm_real,Real.norm_eq_abs, + abs_of_nonneg hu,abs_of_nonneg hv,weighted_creation_norm] at hb + have hpv := mul_le_mul_of_nonneg_left hpc hv + nlinarith + + theorem offDiagonal_ker (u v : ℝ) (hv : 0 ≤ v) (hvu : v w + | n+1 => ((i,false)::(i,true)::(alternatingExtension i w n).1,(alternatingExtension i w n).2) + +omit [DecidableEq ι] in + theorem alternatingExtension_length (i : ι) (w : Path ι) (n : ℕ) : + (alternatingExtension i w n).1.length=2*n+w.1.length := by + induction n with + | zero => simp [alternatingExtension] + | succ n ih => simp only [alternatingExtension,List.length_cons,ih]; omega + +omit [DecidableEq ι] in + theorem alternatingExtension_injective (i : ι) (w : Path ι) : + Function.Injective (alternatingExtension i w) := by + intro n m h + have hh := congrArg (fun a : Path ι => a.1.length) h + simp only [alternatingExtension_length] at hh + omega + + theorem offDiagonal_balanced_recurrence (u : ℝ) (hu : u≠0) (i : ι) + (ξ : H ι) (hs : (1-P : Operator ι) ξ=ξ) + (hx : offDiagonal u u i ξ=0) (w : Path ι) : + ξ ((i,false)::(i,true)::w.1,w.2) = -ξ w := by + have he := congrArg (fun η : H ι => η ((i,true)::w.1,w.2)) hx + rw [offDiagonal_formula] at he + change (u:ℂ)*(creation i true ((1-P : Operator ι) ξ)) ((i,true)::w.1,w.2) + + (u:ℂ)*(P (star (creation i false) ξ)) ((i,true)::w.1,w.2)=0 at he + rw [hs,creation_apply_prepend,P_apply_prepend_true,annihilation_apply,← mul_add] at he + have he' := (mul_eq_zero.mp he).resolve_left (Complex.ofReal_ne_zero.mpr hu) + linear_combination he' + + theorem offDiagonal_balanced_injective (u : ℝ) (hu : u≠0) (i : ι) + (ξ : H ι) (hs : (1-P : Operator ι) ξ=ξ) + (hx : offDiagonal u u i ξ=0) : ξ=0 := by + ext w + have he (n : ℕ) : ‖ξ (alternatingExtension i w n)‖=‖ξ w‖ := by + induction n with + | zero => rfl + | succ n ih => + rw [alternatingExtension,offDiagonal_balanced_recurrence u hu i ξ hs hx,norm_neg,ih] + have hsum : Summable (fun w : Path ι => ‖ξ w‖^2) := by + have hh := (memℓp_gen_iff (by norm_num : 0 < (2:ℝ≥0∞).toReal)).mp (lp.memℓp ξ) + simpa using hh + have hj := hsum.comp_injective (alternatingExtension_injective i w) + have hc : Summable (fun _ : ℕ => ‖ξ w‖^2) := by + simpa only [Function.comp_def,he] using hj + have hz : ‖ξ w‖^2=0 := (summable_const_iff _).mp hc + have hn : ‖ξ w‖=0 := by nlinarith [norm_nonneg (ξ w)] + have hh : ξ w=0 := norm_eq_zero.mp hn + exact hh + + theorem offDiagonal_ker_balanced (u : ℝ) (hu : u≠0) (i : ι) : + (offDiagonal u u i).ker=(1-P : Operator ι).ker := by + ext ξ + change offDiagonal u u i ξ=0 ↔ (1-P : Operator ι) ξ=0 + constructor + · intro hx + apply offDiagonal_balanced_injective u hu i + · exact DFunLike.congr_fun projection_P.one_sub.isIdempotentElem.eq ξ + · have he : offDiagonal u u i ((1-P : Operator ι) ξ)=offDiagonal u u i ξ := + DFunLike.congr_fun (offDiagonal_right u u i) ξ + rw [he,hx] + · intro hx + have he : offDiagonal u u i ((1-P : Operator ι) ξ)=offDiagonal u u i ξ := + DFunLike.congr_fun (offDiagonal_right u u i) ξ + rw [← he,hx,map_zero] + + theorem edgePolar_initial_balanced (u : ℝ) (hu : u≠0) (i : ι) : + star (edgePolar u u i)*edgePolar u u i=1-P := by + simp only [edgePolar,partialIsometry_initial,modulus_closedRange, + offDiagonal_ker_balanced u hu i,kernel_orthogonal_projection projection_P.one_sub] + + theorem edgePolar_trace_balanced (u : ℝ) (hu : u≠0) (i : ι) : + vacuumTrace u u (edgeRange u u i)=(u^2:ℝ) := by + have ht := ambient_trace_mul u u hu hu + ⟨edgePolar u u i,edgePolar_mem_ambient u u i⟩ + ⟨star (edgePolar u u i),star_mem (edgePolar_mem_ambient u u i)⟩ + change vacuumTrace u u (edgePolar u u i*star (edgePolar u u i))= + vacuumTrace u u (star (edgePolar u u i)*edgePolar u u i) at ht + rw [edgePolar_initial_balanced u hu i] at ht + rw [edgeRange,ht] + simp only [vacuumTrace,sub_apply,one_apply_eq_self,inner_sub_right] + change vacuumTrace u u 1-vacuumTrace u u P=(u^2:ℝ) + rw [vacuumTrace_one,vacuumTrace_P] + push_cast + ring + + theorem edgeRange_balanced (u : ℝ) (hu : u≠0) (i : ι) : edgeRange u u i=P := by + have hproj := (edgeRange_projection u u i).sub_of_mul_eq_right projection_P (edgeRange_le_P u u i) + have hm : P-edgeRange u u i ∈ ambientAlgebra u u := + sub_mem (P_mem_ambient u u) (edgeRange_mem_ambient u u i) + have htrace : vacuumTrace u u (star (P-edgeRange u u i)*(P-edgeRange u u i))=0 := by + rw [hproj.isSelfAdjoint.star_eq,hproj.isIdempotentElem.eq] + simp only [vacuumTrace,sub_apply,inner_sub_right] + change vacuumTrace u u P-vacuumTrace u u (edgeRange u u i)=0 + rw [vacuumTrace_P,edgePolar_trace_balanced u hu i,sub_self] + have hz := ambient_trace_faithful u u hu hu ⟨P-edgeRange u u i,hm⟩ htrace + have hz' : P-edgeRange u u i=0 := congrArg Subtype.val hz + exact (sub_eq_zero.mp hz').symm + +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Positive.lean b/lean/OAI/Analysis/InterpolatedFactors/Positive.lean new file mode 100644 index 0000000000000000000000000000000000000000..e44695d75f023cf3f51a83b8b4620dae65a7bc2d --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Positive.lean @@ -0,0 +1,138 @@ +import OAI.Analysis.InterpolatedFactors.NormalEquiv + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 + +namespace FreeGroupFactorMain.Amplification +open scoped ENNReal +variable {G : Type u_1} [Group G] + +theorem finiteProjection_trace_div (n : ℕ) (hn : 0<(n:ℝ)) (t : ℝ) (ht : 0≤t) + (p : groupVonNeumann G) (hp : IsStarProjection p) (hpτ : canonicalTrace p=((t/(n:ℝ):ℝ):ℂ)) : + stabilizedProjectionTrace (finiteProjection n p)=ENNReal.ofReal t := by + rw [finiteProjection_trace n p hp _ (div_nonneg ht hn.le) hpτ] + congr 1 + field_simp + +theorem preferred_scaling_model + (hbase : ∀ T : groupVonNeumann G, (∀ S : groupVonNeumann G,Commute T S) → + ∃ c : ℂ,T=c • (1 : groupVonNeumann G)) + (hsmall : ∀t : ℝ,0 ⟨canonicalTrace T,infinite_free_group_center_scalar T hT⟩) + infinite_hasCornerScaling t ht +end FreeGroupFactorMain.Amplification + +namespace FreeGroupFactorMain + +theorem HasNormalTracialIso.symm {G : Type u_2} {H : Type u_3} [Group G] [Group H] + (h : HasNormalTracialIso G H) : HasNormalTracialIso H G := by + classical + obtain ⟨Φ,hΦ,_⟩ := h + obtain ⟨e,hδ,he⟩ := Amplification.spatial_of_trace_iso Φ hΦ + refine ⟨(spatialGroupIso e he).symm,?_,spatialGroupIso_symm_normal e he⟩ + intro T + rw [canonicalTrace_eq_inner,canonicalTrace_eq_inner] + change inner ℂ deltaOne (e.symm ((T : GroupOperator H) (e deltaOne)))=_ + rw [hδ,←e.inner_map_map,e.apply_symm_apply,hδ] + +theorem center_scalar_of_iso {G : Type u_4} {H : Type u_5} [Group G] [Group H] + (e : groupVonNeumann G ≃⋆ₐ[ℂ] groupVonNeumann H) + (hH : ∀ T : groupVonNeumann H,(∀ S : groupVonNeumann H,Commute T S) → ∃ c : ℂ,T=c • 1) + (T : groupVonNeumann G) (hT : ∀ S : groupVonNeumann G,Commute T S) : + ∃ c : ℂ,T=c • 1 := by + have he : ∀ S : groupVonNeumann H,Commute (e T) S := by + intro S + have hh := (hT (e.symm S)).map e + simpa only [StarAlgEquiv.apply_symm_apply] using hh + obtain ⟨c,hc⟩ := hH (e T) he + have hec : e (c • (1 : groupVonNeumann G))=c • (1 : groupVonNeumann H) := by + change e.toFun (c • (1 : groupVonNeumann G))=_ + rw [e.map_smul'] + change c • e (1 : groupVonNeumann G)=_ + rw [map_one] + exact ⟨c,e.injective (hc.trans hec.symm)⟩ + +end FreeGroupFactorMain +namespace FreeGroupFactorMain.Amplification +open scoped ENNReal + +theorem rankTwo_smallScaling (t : ℝ) (ht : 0 ⟨canonicalTrace S,infinite_free_group_center_scalar S hS⟩) T hT + +theorem rankTwo_allPositiveScaling (t : ℝ) (ht : 0 X.coeff a X.root + | (i,b)::w => X.coeff a (X.create i (normal b w)) + +def family (w : Word A I) : E := X.normal w.1 w.2 + +theorem coeff_normal (c a : A) (w : List (I × A)) : + X.coeff c (X.normal a w)=X.normal (c*a) w := by + cases w with + | nil => simp only [normal,map_mul,mul_apply_eq_comp] + | cons z w => rcases z with ⟨i,b⟩; simp only [normal,map_mul,mul_apply_eq_comp] + +theorem create_normal (i : I) (a : A) (w : List (I × A)) : + X.create i (X.normal a w)=X.normal 1 ((i,a)::w) := by + simp only [normal,map_one,one_apply_eq_self] + +theorem annihilate_normal_nil (i : I) (a : A) : + star (X.create i) (X.normal a [])=0 := X.annihilate i a + +theorem annihilate_normal_cons (i j : I) (a b : A) (w : List (I × A)) : + star (X.create i) (X.normal a ((j,b)::w))= + X.normal (covariance i j a*b) w := by + have hc := DFunLike.congr_fun (X.contract i j a) (X.normal b w) + simpa only [normal,mul_apply_eq_comp,coeff_normal] using hc + +theorem left_inner (i j : I) (a b : A) (ξ ζ : E) : + inner ℂ (X.coeff a (X.create i ξ)) (X.coeff b (X.create j ζ))= + inner ℂ ξ (X.coeff (covariance i j (star a*b)) ζ) := by + have hc := X.contract i j (star a*b) + rw [map_mul,map_star] at hc + calc + _ = inner ℂ ξ ((star (X.create i)*(star (X.coeff a)*X.coeff b)*X.create j) ζ) := by + simp only [mul_apply_eq_comp,ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_right] + _ = _ := by rw [hc] + +theorem old_left_inner (i : I) (a b : A) (ζ : E) : + inner ℂ (X.coeff a X.root) (X.coeff b (X.create i ζ))=0 := by + have hz := X.annihilate i (star b*a) + rw [map_mul,map_star,mul_apply_eq_comp] at hz + calc + _ = inner ℂ (star (X.create i) (star (X.coeff b) (X.coeff a X.root))) ζ := by + simp only [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_left] + _ = _ := by rw [hz,inner_zero_left] + +theorem root_inner (a b : A) : + inner ℂ (X.normal a []) (X.normal b [])= + inner ℂ X.root (X.coeff (star a*b) X.root) := by + simp only [normal,map_mul,map_star,mul_apply_eq_comp,ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_right] + +variable {F : Type u_9} [NormedAddCommGroup F] [InnerProductSpace ℂ F] [CompleteSpace F] +variable (Y : System A F I covariance) + +theorem normal_inner_eq + (hstate : ∀ a, inner ℂ Y.root (Y.coeff a Y.root)=inner ℂ X.root (X.coeff a X.root)) + (a b : A) (w z : List (I × A)) : + inner ℂ (Y.normal a w) (Y.normal b z)=inner ℂ (X.normal a w) (X.normal b z) := by + induction w generalizing a b z with + | nil => + cases z with + | nil => rw [root_inner,root_inner,hstate] + | cons q z => + rcases q with ⟨j,c⟩ + simp only [normal,old_left_inner] + | cons q w ih => + rcases q with ⟨i,c⟩ + cases z with + | nil => + have hX := X.old_left_inner i b a (X.normal c w) + have hY := Y.old_left_inner i b a (Y.normal c w) + have hcX := inner_conj_symm (𝕜 := ℂ) (X.normal a ((i,c)::w)) (X.normal b []) + have hcY := inner_conj_symm (𝕜 := ℂ) (Y.normal a ((i,c)::w)) (Y.normal b []) + change star (inner ℂ (X.coeff b X.root) (X.coeff a (X.create i (X.normal c w))))=_ at hcX + change star (inner ℂ (Y.coeff b Y.root) (Y.coeff a (Y.create i (Y.normal c w))))=_ at hcY + rw [hX,star_zero] at hcX + rw [hY,star_zero] at hcY + exact hcY.symm.trans hcX + | cons q z => + rcases q with ⟨j,d⟩ + change inner ℂ (Y.coeff a (Y.create i (Y.normal c w))) + (Y.coeff b (Y.create j (Y.normal d z)))= + inner ℂ (X.coeff a (X.create i (X.normal c w))) + (X.coeff b (X.create j (X.normal d z))) + rw [Y.left_inner,X.left_inner,Y.coeff_normal,X.coeff_normal] + exact ih c (covariance i j (star a*b)*d) z + +def generator (σ : I → I) (i : I) : Operator E := X.create i+star (X.create (σ i)) + +def generatorRule (σ : I → I) (covariance : I → I → A → A) (i : I) + (w : Word A I) : Word A I →₀ ℂ := by + classical + exact Finsupp.single ((1:A),(i,w.1)::w.2) (1:ℂ) + + match w.2 with + | [] => 0 + | (j,b)::z => Finsupp.single (covariance (σ i) j w.1*b,z) (1:ℂ) + +theorem generator_family (σ : I → I) (i : I) (w : Word A I) : + X.generator σ i (X.family w)= + Finsupp.linearCombination ℂ X.family (generatorRule σ covariance i w) := by + classical + rcases w with ⟨a,w⟩ + cases w with + | nil => + simp only [generator,family,add_apply,annihilate_normal_nil,add_zero, + generatorRule,Finsupp.linearCombination_single,one_smul,create_normal] + | cons q w => + rcases q with ⟨j,b⟩ + simp only [generator,family,add_apply,annihilate_normal_cons, + generatorRule,map_add,Finsupp.linearCombination_single,one_smul,create_normal] + +def coeffRule (c : A) (w : Word A I) : Word A I →₀ ℂ := by + classical + exact Finsupp.single (c*w.1,w.2) 1 + +theorem coeff_family (c : A) (w : Word A I) : + X.coeff c (X.family w)=Finsupp.linearCombination ℂ X.family (coeffRule c w) := by + classical + simp only [family,coeffRule,Finsupp.linearCombination_single,one_smul,coeff_normal] + +variable + (hstate : ∀ a, inner ℂ Y.root (Y.coeff a Y.root)=inner ℂ X.root (X.coeff a X.root)) + (hX : (Submodule.span ℂ (Set.range X.family)).topologicalClosure=⊤) + (hY : (Submodule.span ℂ (Set.range Y.family)).topologicalClosure=⊤) + +def spatial : E ≃ₗᵢ[ℂ] F := + GramSpatial.spatial X.family Y.family + (fun w z => normal_inner_eq X Y hstate w.1 z.1 w.2 z.2) hX hY + +theorem spatial_coeff (a : A) : + (spatial X Y hstate hX hY).conjStarAlgEquiv (X.coeff a)=Y.coeff a := by + apply GramSpatial.spatial_intertwines X.family Y.family _ hX hY + (X.coeff a) (Y.coeff a) (coeffRule a) + · exact X.coeff_family a + · exact Y.coeff_family a + +theorem spatial_generator (σ : I → I) (i : I) : + (spatial X Y hstate hX hY).conjStarAlgEquiv (X.generator σ i)=Y.generator σ i := by + apply GramSpatial.spatial_intertwines X.family Y.family _ hX hY + (X.generator σ i) (Y.generator σ i) (generatorRule σ covariance i) + · exact X.generator_family σ i + · exact Y.generator_family σ i + +theorem spatial_root : spatial X Y hstate hX hY X.root=Y.root := by + have h := GramSpatial.spatial_family X.family Y.family + (fun w z => normal_inner_eq X Y hstate w.1 z.1 w.2 z.2) hX hY (1,[]) + simpa only [spatial,family,normal,map_one,one_apply_eq_self] using h + +theorem spatial_trace (T : Operator E) : + inner ℂ Y.root ((spatial X Y hstate hX hY).conjStarAlgEquiv T Y.root)= + inner ℂ X.root (T X.root) := by + have h := GramSpatial.spatial_trace X.family Y.family + (fun w z => normal_inner_eq X Y hstate w.1 z.1 w.2 z.2) hX hY (1,[]) T + simpa only [spatial,family,normal,map_one,one_apply_eq_self] using h + +end System +end FreeGroupFactorMain.GaussianRecognition + +end + +namespace FreeGroupFactorMain.GaussianRecognition +open CyclicSpectral + +def uniformCovariance {I : Type u_10} [DecidableEq I] (i j : I) (a : UniformAlgebra) : UniformAlgebra := + if i=j then uniformState a • 1 else 0 +end FreeGroupFactorMain.GaussianRecognition + +namespace FreeGroupFactorMain.WeightedFock +open FreeFock Amplification CyclicSpectral GaussianRecognition WeightedCornerIndex + +theorem weightedUniformBase_rep (u v : ℝ) (hv : 0 pRepresentation X) hc + simp only [map_mul,hs,hm,map_one] at hh + rw [weightedUniformBase_rep] at hh + exact hh + +theorem absorbedCreation_cov_off (u v : ℝ) (hv : 0 h (Prod.ext he.1 he.2) + rw [ite_eq_right hn] at hc + have hs (X : PCorner ℕ) : pRepresentation (star X)=star (pRepresentation X) := + (pRepresentation (ι := ℕ)).map_star' X + have hh := congrArg (fun X : PCorner ℕ => pRepresentation X) hc + simp only [map_mul,hs,map_zero] at hh + rw [weightedUniformBase_rep] at hh + exact hh + +theorem absorbedCreation_annihilate (u v : ℝ) (hv : 0 (z:A)) + (((StarSubalgebra.mem_centralizer_iff ℂ).mp ha b hb).1) + change (p*B*p)*(a:A)=(a:A)*(p*B*p) at hh + rwa [compress_mul_corner p hp B hBp,corner_mul_compress p hp B hBp] at hh + intro B hB + exact ⟨htest B hB,htest (star B) (star_mem hB)⟩ +end FreeGroupFactorMain.Amplification + +namespace FreeGroupFactorMain.FreeFock + +section +open scoped ENNReal +variable {α : Type u_2} [DecidableEq α] + + def creationWord : List α → Operator α + | [] => 1 + | a::w => creation a*creationWord w + +@[simp] theorem creationWord_nil : creationWord ([] : List α)=1 := rfl +@[simp] theorem creationWord_cons (a : α) (w : List α) : + creationWord (a::w)=creation a*creationWord w := rfl + + theorem creationWord_append (v w : List α) : + creationWord (v++w)=creationWord v*creationWord w := by + induction v with + | nil => simp + | cons a v ih => simp only [List.cons_append,creationWord_cons,ih,mul_assoc] + + theorem creationWord_vacuum (w : List α) : creationWord w vacuum=lp.single 2 w 1 := by + induction w with + | nil => rfl + | cons a w ih => + change creation a (creationWord w vacuum)=_ + rw [ih,creation_single] + + theorem creationWord_star_vacuum (w : List α) : + star (creationWord w) vacuum=if w=[] then vacuum else 0 := by + cases w with + | nil => simp + | cons a w => + simp only [creationWord_cons,star_mul,List.cons_ne_nil,ite_false] + change star (creationWord w) (star (creation a) (lp.single 2 [] 1))=0 + rw [annihilation_single_nil,map_zero] + + def wick (w : List α) : Operator α := + ∑ k ∈ Finset.range (w.length+1), creationWord (w.take k)*star (creationWord (w.drop k).reverse) + + @[simp] theorem wick_nil : wick ([] : List α)=1 := by simp [wick] + + theorem wick_star (w : List α) : star (wick w)=wick w.reverse := by + rw [wick,star_sum (R := Operator α)] + simp only [star_mul,star_star] + have hs := Finset.sum_range_reflect + (fun k => creationWord (w.reverse.take k)*star (creationWord (w.reverse.drop k).reverse)) (w.length+1) + calc + _ = ∑ k ∈ Finset.range (w.length+1), + creationWord (w.reverse.take (w.length+1-1-k))* + star (creationWord (w.reverse.drop (w.length+1-1-k)).reverse) := by + apply Finset.sum_congr rfl + intro k hk + have hk' : k ≤ w.length := Nat.le_of_lt_succ (Finset.mem_range.mp hk) + simp only [Nat.add_sub_cancel,List.take_reverse,List.drop_reverse,List.reverse_reverse] + rw [Nat.sub_sub_self hk'] + _ = wick w.reverse := by simpa only [wick,List.length_reverse] using hs + + theorem wick_vacuum (w : List α) : wick w vacuum=lp.single 2 w 1 := by + classical + rw [wick,sum_apply] + calc + _ = (creationWord (w.take w.length)*star (creationWord (w.drop w.length).reverse)) vacuum := by + apply Finset.sum_eq_single w.length + · intro k hk hkn + have hk' : k < w.length := lt_of_le_of_ne (Nat.le_of_lt_succ (Finset.mem_range.mp hk)) hkn + change creationWord (w.take k) (star (creationWord (w.drop k).reverse) vacuum)=0 + rw [creationWord_star_vacuum] + have hn : (w.drop k).reverse ≠ [] := by + intro he + have hh := congrArg List.length he + simp only [List.length_reverse,List.length_drop,List.length_nil] at hh + omega + rw [ite_eq_right hn,map_zero] + · intro h + exact False.elim (h (Finset.mem_range.mpr (Nat.lt_succ_self _))) + _ = _ := by + simp only [List.take_length,List.drop_length,List.reverse_nil,creationWord_nil,star_one,mul_one] + exact creationWord_vacuum w + + theorem wick_creation_formula (a : α) (w : List α) : + wick (a::w)=creation a*wick w+star (creation a)*star (creationWord w.reverse) := by + rw [wick,List.length_cons,Finset.sum_range_succ'] + have he (k : ℕ) : + creationWord ((a::w).take (k+1))*star (creationWord ((a::w).drop (k+1)).reverse)= + creation a*(creationWord (w.take k)*star (creationWord (w.drop k).reverse)) := by + simp only [List.take_succ_cons,List.drop_succ_cons,creationWord_cons,mul_assoc] + simp_rw [he] + rw [← Finset.mul_sum] + simp only [List.take_zero,List.drop_zero,creationWord_nil,one_mul,List.reverse_cons, + creationWord_append,creationWord_cons,creationWord_nil,mul_one,star_mul] + rfl + + theorem wick_semicircular_cons (a : α) (w : List α) : + wick (a::w)=semicircular a*wick w- + (match w with | [] => 0 | b::v => if a=b then wick v else 0) := by + cases w with + | nil => simp [wick_creation_formula,semicircular] + | cons b v => + rw [wick_creation_formula a,wick_creation_formula b] + change creation a*(creation b*wick v+star (creation b)*star (creationWord v.reverse))+ + star (creation a)*star (creationWord (b::v).reverse)= + (creation a+star (creation a))*(creation b*wick v+star (creation b)*star (creationWord v.reverse))- + (if a=b then wick v else 0) + simp only [List.reverse_cons,creationWord_append,creationWord_cons,creationWord_nil,mul_one,star_mul] + have he : (star (creation a)*creation b)*wick v=if a=b then wick v else 0 := by + rw [annihilation_creation] + by_cases h : a=b <;> simp [h] + rw [← he] + noncomm_ring + +end + +section +variable {α : Type u_3} [DecidableEq α] + +def runSpan (i : α) : Submodule ℂ (Operator α) := + Submodule.span ℂ (Set.range (fun n : ℕ => wick (List.replicate n i))) + +def positiveRunSpan (i : α) : Submodule ℂ (Operator α) := + Submodule.span ℂ (Set.range (fun n : ℕ => wick (List.replicate (n+1) i))) + + theorem run_mem (i : α) (n : ℕ) : wick (List.replicate n i) ∈ runSpan i := + Submodule.subset_span (Set.mem_range_self n) + + theorem semicircular_mul_runSpan (i : α) (x : Operator α) (hx : x∈runSpan i) : + semicircular i*x∈runSpan i := by + induction hx using Submodule.span_induction with + | mem x hx => + obtain ⟨n,rfl⟩ := hx + have h := wick_semicircular_cons i (List.replicate n i) + cases n with + | zero => simpa [wick_semicircular_cons] using run_mem i 1 + | succ n => + have he : semicircular i*wick (List.replicate (n+1) i)= + wick (List.replicate (n+2) i)+wick (List.replicate n i) := by + simpa only [List.replicate_succ,ite_true] using (eq_add_of_sub_eq h.symm) + rw [he] + exact (runSpan i).add_mem (run_mem i (n+2)) (run_mem i n) + | zero => simp + | add x y _ _ hx hy => simpa only [mul_add] using (runSpan i).add_mem hx hy + | smul c x _ hx => simpa only [mul_smul_comm] using (runSpan i).smul_mem c hx + + theorem run_mul_runSpan (i : α) (n : ℕ) (x : Operator α) (hx : x∈runSpan i) : + wick (List.replicate n i)*x∈runSpan i := by + suffices ∀ n, (wick (List.replicate n i)*x∈runSpan i) ∧ + (wick (List.replicate (n+1) i)*x∈runSpan i) from (this n).1 + intro n + induction n with + | zero => + constructor + · simpa using hx + · simpa [wick_semicircular_cons] using semicircular_mul_runSpan i x hx + | succ n ih => + refine ⟨ih.2,?_⟩ + have he : wick (List.replicate (n+1+1) i)= + semicircular i*wick (List.replicate (n+1) i)-wick (List.replicate n i) := by + conv_lhs => rw [List.replicate_succ,wick_semicircular_cons] + simp only [List.replicate_succ,ite_true] + rw [he,sub_mul,mul_assoc] + exact (runSpan i).sub_mem (semicircular_mul_runSpan i _ ih.2) ih.1 + +def runAlgebra (i : α) : StarSubalgebra ℂ (Operator α) where + carrier := (runSpan i : Set (Operator α)) + zero_mem' := (runSpan i).zero_mem + add_mem' := (runSpan i).add_mem + algebraMap_mem' c := by + change algebraMap ℂ (Operator α) c∈runSpan i + simpa only [Algebra.algebraMap_eq_smul_one] using + (runSpan i).smul_mem c (show (1 : Operator α)∈runSpan i by simpa using run_mem i 0) + one_mem' := by simpa using run_mem i 0 + mul_mem' {a b} hx hy := by + change a∈runSpan i at hx + change b∈runSpan i at hy + change a*b∈runSpan i + induction hx using Submodule.span_induction with + | mem x hx => obtain ⟨n,rfl⟩ := hx; exact run_mul_runSpan i n _ hy + | zero => simp + | add x y _ _ hx hy => simpa only [add_mul] using (runSpan i).add_mem hx hy + | smul c x _ hx => simpa only [smul_mul_assoc] using (runSpan i).smul_mem c hx + star_mem' {a} hx := by + change a∈runSpan i at hx + change star a∈runSpan i + induction hx using Submodule.span_induction with + | mem x hx => obtain ⟨n,rfl⟩ := hx; simpa only [wick_star,List.reverse_replicate] using run_mem i n + | zero => simpa only [star_zero (R := Operator α)] using (runSpan i).zero_mem + | add x y _ _ hx hy => simpa only [star_add (R := Operator α)] using (runSpan i).add_mem hx hy + | smul c x _ hx => simpa only [star_smul] using (runSpan i).smul_mem (star c) hx + + theorem vacuumTrace_linear : IsLinearMap ℂ (@vacuumTrace α _) where + map_add := by intro x y; simp [vacuumTrace] + map_smul := by intro c x; simp [vacuumTrace] + + theorem vacuumTrace_continuous : Continuous (@vacuumTrace α _) := by + exact continuous_const.inner (continuous_id.clm_apply continuous_const) + + theorem vacuumTrace_run (i : α) (n : ℕ) : + vacuumTrace (wick (List.replicate n i))=if n=0 then 1 else 0 := by + cases n with + | zero => simpa using (vacuumTrace_one (α := α)) + | succ n => + unfold vacuumTrace + rw [wick_vacuum] + simp [vacuum,lp.inner_single_left,lp.single_apply] + +end +variable {α : Type u_4} [DecidableEq α] + +theorem run_star_creation (a j : α) (h : a≠j) (n : ℕ) : + star (creationWord (List.replicate (n+1) a))*creation j=0 := by + rw [List.replicate_succ,creationWord_cons,star_mul,mul_assoc,annihilation_creation,ite_eq_right h,mul_zero] + +theorem run_creation (a j : α) (h : a≠j) (n : ℕ) : + wick (List.replicate n a)*creation j=creationWord (List.replicate n a)*creation j := by + induction n with + | zero => simp + | succ n ih => + rw [List.replicate_succ,wick_creation_formula,add_mul,mul_assoc,ih] + have hz : star (creation a)*star (creationWord (List.replicate n a).reverse)*creation j=0 := by + rw [List.reverse_replicate] + have he : star (creation a)*star (creationWord (List.replicate n a))= + star (creationWord (List.replicate (n+1) a)) := by + rw [show List.replicate (n+1) a=List.replicate n a++[a] from (List.replicate_add _ _ _).trans (by simp), + creationWord_append,star_mul,creationWord_cons,creationWord_nil,mul_one] + rw [he,run_star_creation a j h] + rw [hz,add_zero,creationWord_cons,mul_assoc] + +theorem run_coarse_covariance (a i j : α) (hi : i≠a) (hj : j≠a) (n : ℕ) : + star (creation i)*wick (List.replicate n a)*creation j= + vacuumTrace (wick (List.replicate n a)) • (if i=j then (1:Operator α) else 0) := by + rw [mul_assoc,run_creation a j hj.symm,vacuumTrace_run] + cases n with + | zero => simp [annihilation_creation] + | succ n => + rw [List.replicate_succ,creationWord_cons,← mul_assoc,← mul_assoc,annihilation_creation, + ite_eq_right hi,zero_mul,zero_mul] + simp [zero_smul ℂ (A := Operator α)] + +theorem polynomial_coarse_covariance (a i j : α) (hi : i≠a) (hj : j≠a) + (T : Operator α) (hT : T∈runSpan a) : + star (creation i)*T*creation j=vacuumTrace T • (if i=j then (1:Operator α) else 0) := by + induction hT using Submodule.span_induction with + | mem T hT => obtain ⟨n,rfl⟩ := hT; exact run_coarse_covariance a i j hi hj n + | zero => simp [vacuumTrace,zero_smul ℂ (A := Operator α)] + | add T U _ _ hT hU => + simp only [mul_add,add_mul,hT,hU,(vacuumTrace_linear (α := α)).map_add, + add_smul (R := ℂ) (M := Operator α)] + | smul c T _ hT => + simp only [mul_smul_comm,smul_mul_assoc,hT,(vacuumTrace_linear (α := α)).map_smul,smul_smul,smul_eq_mul] + +theorem closed_coarse_covariance (a i j : α) (hi : i≠a) (hj : j≠a) + (T : (runAlgebra a).topologicalClosure) : + star (creation i)*(T:Operator α)*creation j=vacuumTrace (T:Operator α) • (if i=j then (1:Operator α) else 0) := by + exact closure_minimal (fun x hx => polynomial_coarse_covariance a i j hi hj x hx) + (isClosed_eq ((continuous_const.mul continuous_id).mul continuous_const) + (vacuumTrace_continuous.smul continuous_const)) T.property + +theorem closed_coefficient_annihilation (a i : α) (hi : i≠a) + (T : (runAlgebra a).topologicalClosure) : star (creation i) ((T:Operator α) vacuum)=0 := by + apply closure_minimal (t := {T:Operator α | star (creation i) (T vacuum)=0}) ?_ + (isClosed_eq ((star (creation i)).continuous.comp (continuous_id.clm_apply continuous_const)) continuous_const) T.property + intro T hT + change T∈runSpan a at hT + change star (creation i) (T vacuum)=0 + induction hT using Submodule.span_induction with + | mem T hT => + obtain ⟨n,rfl⟩ := hT + rw [wick_vacuum] + cases n with + | zero => exact annihilation_single_nil i 1 + | succ n => rw [List.replicate_succ,annihilation_single_cons,ite_eq_right hi] + | zero => simp + | add T U _ _ hT hU => simp only [add_apply,map_add,hT,hU,add_zero] + | smul c T _ hT => simp only [smul_apply,map_smul,hT,smul_zero] +end FreeGroupFactorMain.FreeFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Rerouting.lean b/lean/OAI/Analysis/InterpolatedFactors/Rerouting.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd7e6e0f8ab0184fcab50179a067976529457333 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Rerouting.lean @@ -0,0 +1,907 @@ +import OAI.Analysis.InterpolatedFactors.Polar + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 + +namespace FreeGroupFactorMain.CornerRerouting + +section +variable {A : Type u_1} [Ring A] [StarRing A] + + def Supported (p x : A) : Prop := p*x=x ∧ x*p=x + def lift (v t : A) : A := t+star v*t*v + +omit [StarRing A] in + theorem right_zero {p v : A} (h : v*(1-p)=v) : v*p=0 := by + have hh : v-v*p=v := by simpa only [mul_sub,mul_one] using h + exact sub_eq_self.mp hh + + theorem star_left_zero {p v : A} (hp : IsSelfAdjoint p) (h : v*p=0) : p*star v=0 := by + have hh := congrArg star h + simpa only [star_mul,hp.star_eq,star_zero] using hh + + theorem supported_star {p t : A} (hp : IsSelfAdjoint p) (ht : Supported p t) : + Supported p (star t) := by + constructor + · simpa only [star_mul,hp.star_eq] using congrArg star ht.2 + · simpa only [star_mul,hp.star_eq] using congrArg star ht.1 + + theorem supported_mul_star_zero {p v t : A} (hvp : v*p=0) (hp : IsSelfAdjoint p) + (ht : Supported p t) : t*star v=0 := by + calc + _ = (t*p)*star v := by rw [ht.2] + _ = t*(p*star v) := mul_assoc _ _ _ + _ = 0 := by rw [star_left_zero hp hvp,mul_zero] + +omit [StarRing A] in + theorem mul_supported_zero {p v t : A} (hvp : v*p=0) (ht : Supported p t) : v*t=0 := by + calc + _ = v*(p*t) := by rw [ht.1] + _ = (v*p)*t := (mul_assoc _ _ _).symm + _ = 0 := by rw [hvp,zero_mul] + + theorem lift_mul_supported {p v t y : A} (hvp : v*p=0) (hy : Supported p y) : + lift v t*y=t*y := by + unfold lift + rw [add_mul,mul_assoc (star v*t),mul_supported_zero hvp hy,mul_zero,add_zero] + + theorem supported_mul_lift {p v t y : A} (hp : IsSelfAdjoint p) (hvp : v*p=0) + (hy : Supported p y) : y*lift v t=y*t := by + unfold lift + rw [mul_add,← mul_assoc y,← mul_assoc y,supported_mul_star_zero hvp hp hy, + zero_mul,zero_mul,add_zero] + + theorem lift_commute_supported {p v t y : A} (hp : IsSelfAdjoint p) (hvp : v*p=0) + (hy : Supported p y) (h : Commute t y) : Commute (lift v t) y := by + change lift v t*y=y*lift v t + rw [lift_mul_supported hvp hy,supported_mul_lift hp hvp hy] + exact h.eq + +omit [StarRing A] in + theorem square_zero {p v : A} (hpv : p*v=v) (hvp : v*p=0) : v*v=0 := by + calc + _ = v*(p*v) := by rw [hpv] + _ = (v*p)*v := (mul_assoc _ _ _).symm + _ = 0 := by rw [hvp,zero_mul] + + theorem range_mul {p v : A} (hi : star v*v=1-p) (hr : v*(1-p)=v) : + (v*star v)*v=v := by rw [mul_assoc,hi,hr] + + theorem lift_commute_edge {p v t : A} (hpv : p*v=v) (hvp : v*p=0) + (hi : star v*v=1-p) (hr : v*(1-p)=v) (ht : Supported p t) + (htr : Commute t (v*star v)) : Commute (lift v t) v := by + change lift v t*v=v*lift v t + have hleft : lift v t*v=t*v := by + unfold lift + rw [add_mul,mul_assoc (star v*t),square_zero hpv hvp,mul_zero,add_zero] + have hright : v*lift v t=t*v := by + unfold lift + rw [mul_add,mul_supported_zero hvp ht,zero_add,← mul_assoc v,← mul_assoc v, + ← htr.eq,mul_assoc t,range_mul hi hr] + exact hleft.trans hright.symm + + theorem star_lift (v t : A) : star (lift v t)=lift v (star t) := by + simp only [lift,star_add,star_mul,star_star,mul_assoc] + + theorem lift_commute_edge_star {p v t : A} (hp : IsSelfAdjoint p) + (hpv : p*v=v) (hvp : v*p=0) (hi : star v*v=1-p) (hr : v*(1-p)=v) + (ht : Supported p t) (htr : Commute t (v*star v)) : + Commute (lift v t) (star v) := by + have hs : Commute (star t) (v*star v) := by + simpa only [star_mul,star_star] using htr.star_star + have hh := (lift_commute_edge hpv hvp hi hr (supported_star hp ht) hs).star_star + simpa only [star_lift,star_star] using hh + + def diagonal (p s : A) : A := p*s*p + def offDiagonal (p v s : A) : A := p*s*(1-p)*star v + def remaining (p v s : A) : A := v*(1-p)*s*(1-p)*star v + +omit [StarRing A] in + theorem diagonal_supported {p s : A} (hp : IsIdempotentElem p) : Supported p (diagonal p s) := by + constructor + · simp only [diagonal,← mul_assoc,hp.eq] + · simp only [diagonal,mul_assoc,hp.eq] + + theorem offDiagonal_supported {p v s : A} (hp : IsStarProjection p) (hpv : p*v=v) : + Supported p (offDiagonal p v s) := by + have hvsp : star v*p=star v := by + simpa only [star_mul,hp.isSelfAdjoint.star_eq] using congrArg star hpv + constructor + · simp only [offDiagonal,← mul_assoc,hp.isIdempotentElem.eq] + · simp only [offDiagonal,mul_assoc,hvsp] + + theorem remaining_supported {p v s : A} (hp : IsSelfAdjoint p) (hpv : p*v=v) : + Supported p (remaining p v s) := by + have hvsp : star v*p=star v := by + simpa only [star_mul,hp.star_eq] using congrArg star hpv + constructor + · simp only [remaining,← mul_assoc,hpv] + · simp only [remaining,mul_assoc,hvsp] + + theorem reconstruct {p v s : A} (hp : IsStarProjection p) (hi : star v*v=1-p) + (hs : IsSelfAdjoint s) : + s=diagonal p s + offDiagonal p v s*v + star v*star (offDiagonal p v s) + + star v*remaining p v s*v := by + have hq : (1-p)*(1-p)=1-p := hp.one_sub.isIdempotentElem.eq + have h₁ : offDiagonal p v s*v=p*s*(1-p) := by + simp only [offDiagonal,mul_assoc,hi] + rw [hq] + have h₂ : star v*star (offDiagonal p v s)=(1-p)*s*p := by + unfold offDiagonal + rw [star_mul,star_mul,star_mul,star_star,star_sub,star_one, + hp.isSelfAdjoint.star_eq,hs.star_eq] + simp only [← mul_assoc,hi,hq] + have h₃ : star v*remaining p v s*v=(1-p)*s*(1-p) := by + simp only [remaining,← mul_assoc,hi,hq] + simp only [mul_assoc,hi] + rw [← mul_assoc (1-p),hq,mul_assoc] + rw [h₁,h₂,h₃,diagonal] + noncomm_ring + + theorem lift_commute_generator {p v t s : A} (hp : IsStarProjection p) + (hpv : p*v=v) (hr : v*(1-p)=v) (hi : star v*v=1-p) + (ht : Supported p t) (hs : IsSelfAdjoint s) + (htr : Commute t (v*star v)) (ha : Commute t (diagonal p s)) + (hb : Commute t (offDiagonal p v s)) (hbs : Commute t (star (offDiagonal p v s))) + (hc : Commute t (remaining p v s)) : Commute (lift v t) s := by + have hvp := right_zero hr + have ha' := lift_commute_supported hp.isSelfAdjoint hvp (diagonal_supported hp.isIdempotentElem) ha + have hb' := lift_commute_supported hp.isSelfAdjoint hvp (offDiagonal_supported hp hpv) hb + have hbs' := lift_commute_supported hp.isSelfAdjoint hvp + (supported_star hp.isSelfAdjoint (offDiagonal_supported hp hpv)) hbs + have hc' := lift_commute_supported hp.isSelfAdjoint hvp (remaining_supported hp.isSelfAdjoint hpv) hc + have hv' := lift_commute_edge hpv hvp hi hr ht htr + have hvs' := lift_commute_edge_star hp.isSelfAdjoint hpv hvp hi hr ht htr + rw [reconstruct hp hi hs] + exact ((ha'.add_right (hb'.mul_right hv')).add_right (hvs'.mul_right hbs')).add_right + ((hvs'.mul_right hc').mul_right hv') + +end +section +variable {A : Type u_2} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] +variable {ι : Type u_3} + + theorem corner_bicommutant {p v x t : A} {s : ι → A} + (hp : IsStarProjection p) (hpv : p*v=v) (hr : v*(1-p)=v) (hi : star v*v=1-p) + (hx : x ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert p (Set.range s)) : Set A)) + (hxs : Supported p x) (ht : Supported p t) (hs : ∀ i, IsSelfAdjoint (s i)) + (htr : Commute t (v*star v)) (ha : ∀ i, Commute t (diagonal p (s i))) + (hb : ∀ i, Commute t (offDiagonal p v (s i))) + (hbs : ∀ i, Commute t (star (offDiagonal p v (s i)))) + (hc : ∀ i, Commute t (remaining p v (s i))) : Commute t x := by + have hvp := right_zero hr + have htp : Commute t p := ht.2.trans ht.1.symm + have hpp : Supported p p := ⟨hp.isIdempotentElem.eq,hp.isIdempotentElem.eq⟩ + have hLP := lift_commute_supported hp.isSelfAdjoint hvp hpp htp + have hLS (i : ι) : Commute (lift v t) (s i) := + lift_commute_generator hp hpv hr hi ht (hs i) htr (ha i) (hb i) (hbs i) (hc i) + have hL : lift v t ∈ StarSubalgebra.centralizer ℂ (insert p (Set.range s)) := by + rw [StarSubalgebra.mem_centralizer_iff] + intro y hy + rcases Set.mem_insert_iff.mp hy with rfl | ⟨i,rfl⟩ + · exact ⟨hLP.symm,by simpa only [hp.isSelfAdjoint.star_eq] using hLP.symm.eq⟩ + · exact ⟨(hLS i).symm,by simpa only [(hs i).star_eq] using (hLS i).symm.eq⟩ + have he := ((StarSubalgebra.mem_centralizer_iff ℂ).mp hx (lift v t) hL).1 + change t*x=x*t + simpa only [lift_mul_supported hvp hxs,supported_mul_lift hp.isSelfAdjoint hvp hxs] using he + +end +variable {A : Type u_4} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] + +theorem single_edge_corner_abelian {p v x a b : A} + (hp : IsStarProjection p) (hpv : p*v=v) (hvr : v*(1-p)=v) + (hvi : star v*v=1-p) (hpx : p*x=x) (hxr : x*(1-p)=x) + (hd : IsSelfAdjoint (x*star v)) + (ha : a ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert p {x+star x}) : Set A)) + (hb : b ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert p {x+star x}) : Set A)) + (has : Supported p a) (hbs : Supported p b) : Commute a b := by + have hxp : x*p=0 := right_zero hxr + have hpsx : p*star x=0 := star_left_zero hp.isSelfAdjoint hxp + have hsxp : star x*p=star x := by + simpa only [star_mul,hp.isSelfAdjoint.star_eq] using congrArg star hpx + have hqpx : (1-p)*x=0 := by rw [sub_mul,one_mul,hpx,sub_self] + have hsxq : star x*(1-p)=0 := by rw [mul_sub,mul_one,hsxp,sub_self] + let d := x*star v + let r := v*star v + have hsd : star d=d := hd + have hsr : star r=r := by simp only [r,star_mul,star_star] + have hdr : d*r=d := by + dsimp [d,r] + rw [mul_assoc x,← mul_assoc (star v),hvi,← mul_assoc,hxr] + have hrd : r*d=d := by + simpa only [star_mul,hsr,hsd] using congrArg star hdr + have hrdc : Commute r d := hrd.trans hdr.symm + have hpsv : star v*p=star v := by + simpa only [star_mul,hp.isSelfAdjoint.star_eq] using congrArg star hpv + have hds : Supported p d := by + constructor + · dsimp [d]; rw [← mul_assoc,hpx] + · dsimp [d]; rw [mul_assoc,hpsv] + have hrs : Supported p r := by + constructor + · dsimp [r]; rw [← mul_assoc,hpv] + · dsimp [r]; rw [mul_assoc,hpsv] + let s : Unit → A := fun _ => x+star x + have hsa : ∀ i, IsSelfAdjoint (s i) := by + intro i + show star (x+star x)=x+star x + simp only [star_add,star_star,add_comm] + have hset : Set.range s={x+star x} := by ext z; simp [s] + have hdiag (i : Unit) : diagonal p (s i)=0 := by + dsimp [diagonal,s] + rw [mul_add,hpx,hpsx,add_zero,hxp] + have hoff (i : Unit) : offDiagonal p v (s i)=d := by + dsimp [offDiagonal,s,d] + rw [mul_add,hpx,hpsx,add_zero,hxr] + have hrem (i : Unit) : remaining p v (s i)=0 := by + dsimp [remaining,s] + rw [mul_assoc v (1-p),mul_add,hqpx,zero_add,← mul_assoc, + mul_assoc (v*(1-p)),hsxq,mul_zero,zero_mul] + have hA : a ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert p (Set.range s)) : Set A) := by + simpa only [hset] using ha + have hB : b ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert p (Set.range s)) : Set A) := by + simpa only [hset] using hb + have had : Commute d a := by + apply corner_bicommutant hp hpv hvr hvi hA has hds hsa hrdc.symm + · intro i; rw [hdiag i]; exact Commute.zero_right _ + · intro i; rw [hoff i] + · intro i; rw [hoff i,hsd] + · intro i; rw [hrem i]; exact Commute.zero_right _ + have har : Commute r a := by + apply corner_bicommutant hp hpv hvr hvi hA has hrs hsa (Commute.refl _) + · intro i; rw [hdiag i]; exact Commute.zero_right _ + · intro i; rw [hoff i]; exact hrdc + · intro i; rw [hoff i,hsd]; exact hrdc + · intro i; rw [hrem i]; exact Commute.zero_right _ + apply corner_bicommutant hp hpv hvr hvi hB hbs has hsa har.symm + · intro i; rw [hdiag i]; exact Commute.zero_right _ + · intro i; rw [hoff i]; exact had.symm + · intro i; rw [hoff i,hsd]; exact had.symm + · intro i; rw [hrem i]; exact Commute.zero_right _ + +end FreeGroupFactorMain.CornerRerouting +namespace FreeGroupFactorMain.WeightedFock + +section +open FreeFock Amplification.Polar +variable {ι : Type u_5} [DecidableEq ι] + +def edgeAlgebra (u v : ℝ) (i : ι) : StarSubalgebra ℂ (Operator ι) := + StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ + (insert P {offDiagonal u v i+star (offDiagonal u v i)}) : Set (Operator ι)) + +theorem edge_left_modulus_selfAdjoint (u v : ℝ) (i : ι) : + IsSelfAdjoint (offDiagonal u v i*star (edgePolar u v i)) := by + have hf := partialIsometry_factorization (offDiagonal u v i) + change edgePolar u v i*modulus (offDiagonal u v i)=offDiagonal u v i at hf + rw [← hf] + change star ((edgePolar u v i*modulus (offDiagonal u v i))*star (edgePolar u v i))=_ + simp only [star_mul,star_star,modulus_star,mul_assoc] + +theorem edge_corner_commutative (u v : ℝ) (hv : 0 ≤ v) (hvu : v (x.1 ++ [(j,x.2)] ++ w.1,w.2), by + rintro ⟨a,r⟩ ⟨b,s⟩ h + have h₁ := List.append_cancel_right (Prod.mk.inj h).1 + have h₂ := List.append_singleton_inj.mp h₁ + exact Prod.ext h₂.1 (Prod.mk.inj h₂.2).2⟩ + +def rightInsert (j : ι) (w : Path ι) : Operator ι := + (hilbertEmbedding (rightInsertEmbedding j w)).toContinuousLinearMap + +@[simp] theorem rightInsert_single (j : ι) (w x : Path ι) (z : ℂ) : + rightInsert j w (lp.single 2 x z)= + lp.single 2 (x.1++[(j,x.2)]++w.1,w.2) z := + hilbertEmbedding_single (rightInsertEmbedding j w) x z + +theorem P_commute_rightInsert (j : ι) (w : Path ι) : + Commute (P : Operator ι) (rightInsert j w) := by + apply CoordinateProjection.commute_embedding + rintro ⟨a,r⟩ + cases a with + | nil => rfl + | cons k a => cases k; rfl + +theorem creation_commute_rightInsert (i j : ι) (r : Bool) (w : Path ι) : + Commute (creation i r) (rightInsert j w) := by + change _*_=_*_ + apply operator_basis_ext + intro x + simp only [mul_apply_eq_comp,rightInsert_single,creation_single,List.cons_append] + +def vacuumTo (w : Path ι) (r : Bool) : Operator ι := + InnerProductSpace.rankOne ℂ (lp.single 2 w 1) (lp.single 2 ([],r) 1) + +@[simp] theorem vacuumTo_nil (w : Path ι) (r s : Bool) (z : ℂ) : + vacuumTo w r (lp.single 2 ([],s) z)=if r=s then lp.single 2 w z else 0 := by + classical + by_cases h : r=s + · subst s + ext x + simp [vacuumTo,InnerProductSpace.rankOne_apply,lp.inner_single_left, + lp.single_apply,Pi.single_apply] + · simp [vacuumTo,InnerProductSpace.rankOne_apply,lp.inner_single_left, + lp.single_apply,h] + +@[simp] theorem vacuumTo_cons (w : Path ι) (r s e : Bool) (i : ι) + (a : List (ι×Bool)) (z : ℂ) : + vacuumTo w r (lp.single 2 ((i,s)::a,e) z)=0 := by + simp [vacuumTo,InnerProductSpace.rankOne_apply,lp.inner_single_left,lp.single_apply] + +theorem annihilation_rightInsert (i j : ι) (r : Bool) (w : Path ι) : + star (creation i r)*rightInsert j w=rightInsert j w*star (creation i r)+ + if i=j then vacuumTo w r else 0 := by + apply operator_basis_ext + rintro ⟨a,e⟩ + cases a with + | nil => + simp only [mul_apply_eq_comp,add_apply,rightInsert_single,List.nil_append, + List.singleton_append,annihilation_single_cons,annihilation_single_nil,map_zero,zero_add] + by_cases h : i=j + · subst j + simp [vacuumTo_nil] + · simp only [Prod.mk.injEq,h,false_and,ite_false] + rfl + | cons k a => + rcases k with ⟨k,s⟩ + simp only [mul_apply_eq_comp,add_apply,rightInsert_single,List.cons_append, + annihilation_single_cons] + have hm : (if i=j then vacuumTo w r else 0) (lp.single 2 ((k,s)::a,e) 1)=0 := by + split_ifs <;> simp + rw [hm,add_zero] + by_cases h : (i,r)=(k,s) + · simp only [h,ite_true,rightInsert_single] + · simp only [h,ite_false,map_zero] + +theorem S_commute_rightInsert (u v : ℝ) (i j : ι) (hij : i≠j) (w : Path ι) : + Commute (S u v i) (rightInsert j w) := by + have ha (r : Bool) : Commute (star (creation i r)) (rightInsert j w) := by + change _*_=_*_ + simpa only [hij,ite_false,add_zero] using annihilation_rightInsert i j r w + simp only [S,star_add (R := Operator ι),star_smul,Complex.star_def,Complex.conj_ofReal] + exact (((creation_commute_rightInsert i j true w).smul_left _).add_left + ((creation_commute_rightInsert i j false w).smul_left _)).add_left + (((ha true).smul_left _).add_left ((ha false).smul_left _)) + +def oldPaths (J : Set ι) : Set (Path ι) := {w | ∀ x∈w.1, x.1∈J} +def oldProjection (J : Set ι) : Operator ι := CoordinateProjection.proj (oldPaths J) +def oldAlgebra (u v : ℝ) (J : Set ι) : StarSubalgebra ℂ (Operator ι) := + StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ + (insert P ((S u v) '' J)) : Set (Operator ι)) + +theorem oldProjection_commute_creation (J : Set ι) (i : ι) (hi : i∈J) (r : Bool) : + Commute (oldProjection J) (creation i r) := by + apply CoordinateProjection.commute_embedding + intro w + change (∀ x∈(i,r)::w.1, x.1∈J) ↔ (∀ x∈w.1, x.1∈J) + simp [hi] + +theorem oldProjection_commute_S (u v : ℝ) (J : Set ι) (i : ι) (hi : i∈J) : + Commute (oldProjection J) (S u v i) := by + have ha (r : Bool) := (oldProjection_commute_creation J i hi r).star_star + have hp : star (oldProjection J)=oldProjection J := CoordinateProjection.star_proj _ + simp only [hp] at ha + simp only [S,star_add (R := Operator ι),star_smul,Complex.star_def,Complex.conj_ofReal] + exact (((oldProjection_commute_creation J i hi true).smul_right _).add_right + ((oldProjection_commute_creation J i hi false).smul_right _)).add_right + (((ha true).smul_right _).add_right ((ha false).smul_right _)) + +theorem oldProjection_mem_commutant (u v : ℝ) (J : Set ι) : + oldProjection J ∈ StarSubalgebra.centralizer ℂ (insert P ((S u v) '' J)) := by + rw [StarSubalgebra.mem_centralizer_iff] + intro T hT + rcases hT with hT | ⟨i,hi,rfl⟩ + · subst T + have hc : Commute (oldProjection J) P := CoordinateProjection.commute _ _ + exact ⟨hc.eq.symm, by rw [projection_P.isSelfAdjoint.star_eq]; exact hc.eq.symm⟩ + · have hc := oldProjection_commute_S u v J i hi + exact ⟨hc.eq.symm, by rw [(S_selfAdjoint u v i).star_eq]; exact hc.eq.symm⟩ + +theorem rightInsert_mem_oldCommutant (u v : ℝ) (J : Set ι) + (j : ι) (hj : j∉J) (w : Path ι) : + rightInsert j w ∈ StarSubalgebra.centralizer ℂ (insert P ((S u v) '' J)) := by + rw [StarSubalgebra.mem_centralizer_iff] + intro T hT + rcases hT with hT | ⟨i,hi,rfl⟩ + · subst T + have hc := P_commute_rightInsert j w + exact ⟨hc.eq,by rw [projection_P.isSelfAdjoint.star_eq]; exact hc.eq⟩ + · have hij : i≠j := by rintro rfl; exact hj hi + have hc := S_commute_rightInsert u v i j hij w + exact ⟨hc.eq,by rw [(S_selfAdjoint u v i).star_eq]; exact hc.eq⟩ + +theorem annihilation_oldProjection (J : Set ι) (i : ι) (hi : i∉J) (r : Bool) : + star (creation i r)*oldProjection J=0 := by + apply operator_basis_ext + rintro ⟨a,e⟩ + cases a with + | nil => simp [mul_apply_eq_comp,oldProjection,CoordinateProjection.proj_single, + oldPaths,annihilation_single_nil] + | cons k a => + rcases k with ⟨j,s⟩ + by_cases h : ((j,s)::a,e)∈oldPaths J + · have hj : j∈J := h (j,s) (List.mem_cons_self ..) + have hij : i≠j := by rintro rfl; exact hi hj + simp [mul_apply_eq_comp,oldProjection,CoordinateProjection.proj_single,h, + annihilation_single_cons,Prod.mk.injEq,hij] + · simp [mul_apply_eq_comp,oldProjection,CoordinateProjection.proj_single,h] + +theorem old_root_fixed (u v : ℝ) (J : Set ι) (T : oldAlgebra u v J) (s : Bool) : + oldProjection J ((T : Operator ι) (lp.single 2 ([],s) 1))= + (T : Operator ι) (lp.single 2 ([],s) 1) := by + have hc := ((StarSubalgebra.mem_centralizer_iff ℂ).mp T.property _ + (oldProjection_mem_commutant u v J)).1 + have ht := DFunLike.congr_fun hc (lp.single 2 ([],s) 1) + simpa only [mul_apply_eq_comp,oldProjection,CoordinateProjection.proj_single, + oldPaths,Set.mem_ofPred_eq,List.not_mem_nil,forall_const,false_implies, + implies_true,ite_true] using ht + +theorem annihilation_old_root (u v : ℝ) (J : Set ι) (i : ι) (hi : i∉J) + (T : oldAlgebra u v J) (r s : Bool) : + star (creation i r) ((T : Operator ι) (lp.single 2 ([],s) 1))=0 := by + have ht := DFunLike.congr_fun (annihilation_oldProjection J i hi r) + ((T : Operator ι) (lp.single 2 ([],s) 1)) + simpa only [mul_apply_eq_comp,old_root_fixed,zero_apply] using ht + +@[simp] theorem vacuumTo_apply (w : Path ι) (r : Bool) (ξ : H ι) : + vacuumTo w r ξ=ξ ([],r) • lp.single 2 w 1 := by + simp [vacuumTo,InnerProductSpace.rankOne_apply,lp.inner_single_left,RCLike.inner_apply] + +theorem fresh_creation_contraction (u v : ℝ) (J : Set ι) + (i j : ι) (hi : i∉J) (hj : j∉J) (T : oldAlgebra u v J) (r s : Bool) : + star (creation i r)*(T : Operator ι)*creation j s= + if i=j then (((T : Operator ι) (lp.single 2 ([],s) 1)) ([],r)) • 1 else 0 := by + apply operator_basis_ext + intro w + have hc := ((StarSubalgebra.mem_centralizer_iff ℂ).mp T.property _ + (rightInsert_mem_oldCommutant u v J j hj w)).1 + have ht := DFunLike.congr_fun hc (lp.single 2 ([],s) 1) + simp only [mul_apply_eq_comp,rightInsert_single,List.nil_append,List.singleton_append] at ht + have ha := DFunLike.congr_fun (annihilation_rightInsert i j r w) + ((T : Operator ι) (lp.single 2 ([],s) 1)) + simp only [mul_apply_eq_comp,add_apply,annihilation_old_root u v J i hi T, + map_zero,zero_add] at ha + simp only [mul_apply_eq_comp,creation_single,← ht,ha] + by_cases hij : i=j + · simp only [hij,ite_true,vacuumTo_apply,_root_.smul_apply,one_apply_eq_self] + · simp only [hij,ite_false,zero_apply] + +theorem vacuumTrace_root_expansion (u v : ℝ) (T : Operator ι) : + vacuumTrace u v T = + (u:ℂ)*(u:ℂ)*(T (lp.single 2 ([],true) 1)) ([],true) + + (u:ℂ)*(v:ℂ)*(T (lp.single 2 ([],false) 1)) ([],true) + + (v:ℂ)*(u:ℂ)*(T (lp.single 2 ([],true) 1)) ([],false) + + (v:ℂ)*(v:ℂ)*(T (lp.single 2 ([],false) 1)) ([],false) := by + simp only [vacuumTrace,vacuum,map_add,map_smul,inner_add_left,inner_add_right, + inner_smul_left,inner_smul_right,lp.inner_single_left,RCLike.inner_apply, + map_one,Complex.conj_ofReal] + ring + +theorem fresh_C_contraction (u v : ℝ) (J : Set ι) + (i j : ι) (hi : i∉J) (hj : j∉J) (T : oldAlgebra u v J) : + star (C u v i)*(T : Operator ι)*C u v j= + if i=j then vacuumTrace u v (T : Operator ι) • 1 else 0 := by + simp only [C,star_add (R := Operator ι),star_smul,Complex.star_def,Complex.conj_ofReal, + add_mul,mul_add,smul_mul_assoc,mul_smul_comm, + fresh_creation_contraction u v J i j hi hj T] + by_cases h : i=j + · simp only [h,ite_true,smul_smul, + ← add_smul (R := ℂ) (M := Operator ι)] + rw [vacuumTrace_root_expansion] + congr 1 + ring + · simp only [h,ite_false,smul_zero (M := ℂ) (A := Operator ι),add_zero] + +theorem fresh_block_covariance (u v : ℝ) (J : Set ι) + (i j : ι) (hi : i∉J) (hj : j∉J) (a b c d : oldAlgebra u v J) : + star ((a : Operator ι)*C u v i*(b : Operator ι))* + ((c : Operator ι)*C u v j*(d : Operator ι))= + if i=j then vacuumTrace u v (star (a : Operator ι)*(c : Operator ι)) • + (star (b : Operator ι)*(d : Operator ι)) else 0 := by + have hc := fresh_C_contraction u v J i j hi hj (star a*c) + change star (C u v i)*(star (a : Operator ι)*(c : Operator ι))*C u v j=_ at hc + calc + _ = star (b : Operator ι)* + (star (C u v i)*(star (a : Operator ι)*(c : Operator ι))*C u v j)* + (d : Operator ι) := by simp only [star_mul,mul_assoc] + _ = _ := by + rw [hc] + split_ifs <;> simp only [mul_smul_comm,smul_mul_assoc,mul_one,mul_zero,zero_mul] + rfl + +theorem fresh_C_annihilates_old_vacuum (u v : ℝ) (J : Set ι) + (i : ι) (hi : i∉J) (T : oldAlgebra u v J) : + star (C u v i) ((T : Operator ι) (vacuum u v))=0 := by + simp only [vacuum,C,star_add (R := Operator ι),star_smul,Complex.star_def,Complex.conj_ofReal, + map_add,map_smul,add_apply,_root_.smul_apply, + annihilation_old_root u v J i hi T,smul_zero,add_zero] + +end + +section +open FreeFock +variable {ι : Type u_7} [DecidableEq ι] + +def terminalVertex (r : Bool) : Operator ι := CoordinateProjection.proj {w | w.2=r} +def edgeCreation (i : ι) (r s : Bool) : Operator ι := creation i r*vertex s + +theorem vertex_eq_proj (r : Bool) : (vertex r : Operator ι)= + CoordinateProjection.proj {w | start w=r} := by + classical + apply operator_basis_ext + intro w + by_cases h : start w=r <;> simp [vertex_single,CoordinateProjection.proj_single,h] + +@[simp] theorem vertex_star (r : Bool) : star (vertex r : Operator ι)=vertex r := by + rw [vertex_eq_proj,CoordinateProjection.star_proj] +omit [DecidableEq ι] in +@[simp] theorem terminalVertex_star (r : Bool) : star (terminalVertex r : Operator ι)=terminalVertex r := + CoordinateProjection.star_proj _ +@[simp] theorem terminalVertex_single (r : Bool) (w : Path ι) (z : ℂ) : + terminalVertex r (lp.single 2 w z)=if w.2=r then lp.single 2 w z else 0 := by + classical + by_cases h : w.2=r <;> simp [terminalVertex,CoordinateProjection.proj_single,h] + +@[simp] theorem edgeCreation_single (i : ι) (r s : Bool) (w : Path ι) (z : ℂ) : + edgeCreation i r s (lp.single 2 w z)= + if start w=s then lp.single 2 ((i,r)::w.1,w.2) z else 0 := by + simp only [edgeCreation,mul_apply_eq_comp,vertex_single] + split_ifs <;> simp only [creation_single,map_zero] + +@[simp] theorem edgeAnnihilation_nil (i : ι) (r s e : Bool) (z : ℂ) : + star (edgeCreation i r s) (lp.single 2 ([],e) z)=0 := by + simp only [edgeCreation,star_mul,vertex_star,mul_apply_eq_comp,annihilation_single_nil,map_zero] + +@[simp] theorem edgeAnnihilation_cons (i j : ι) (r s t e : Bool) + (w : List (ι×Bool)) (z : ℂ) : + star (edgeCreation i r s) (lp.single 2 ((j,t)::w,e) z)= + if (i,r)=(j,t) ∧ start (w,e)=s then lp.single 2 (w,e) z else 0 := by + simp only [edgeCreation,star_mul,vertex_star,mul_apply_eq_comp,annihilation_single_cons] + by_cases h : (i,r)=(j,t) <;> simp [h] + + theorem vertex_commute_rightInsert (r : Bool) (j : ι) (w : Path ι) : + Commute (vertex r : Operator ι) (rightInsert j w) := by + rw [vertex_eq_proj] + apply CoordinateProjection.commute_embedding + rintro ⟨a,e⟩ + cases a with + | nil => rfl + | cons k a => cases k; rfl + + theorem terminalVertex_commute_creation (e : Bool) (i : ι) (r : Bool) : + Commute (terminalVertex e : Operator ι) (creation i r) := by + apply CoordinateProjection.commute_embedding + intro w + rfl + + theorem terminalVertex_commute_edgeCreation (e : Bool) (i : ι) (r s : Bool) : + Commute (terminalVertex e : Operator ι) (edgeCreation i r s) := + (terminalVertex_commute_creation e i r).mul_right (by + rw [vertex_eq_proj];exact CoordinateProjection.commute _ _) + + theorem edgeCreation_commute_rightInsert (i j : ι) (r s : Bool) (w : Path ι) : + Commute (edgeCreation i r s) (rightInsert j w) := + (creation_commute_rightInsert i j r w).mul_left (vertex_commute_rightInsert s j w) + + def diagonalInsert (j : ι) (w : Path ι) : Operator ι := + rightInsert j w*terminalVertex (start w) + + theorem vertex_commute_diagonalInsert (r : Bool) (j : ι) (w : Path ι) : + Commute (vertex r : Operator ι) (diagonalInsert j w) := + (vertex_commute_rightInsert r j w).mul_right (by + rw [vertex_eq_proj];exact CoordinateProjection.commute _ _) + + theorem edgeCreation_commute_diagonalInsert (i j : ι) (r s : Bool) (w : Path ι) : + Commute (edgeCreation i r s) (diagonalInsert j w) := + (edgeCreation_commute_rightInsert i j r s w).mul_right + (terminalVertex_commute_edgeCreation (start w) i r s).symm + + theorem vacuumTo_terminal (w : Path ι) (r s : Bool) : + vacuumTo w r*terminalVertex s=if r=s then vacuumTo w r else 0 := by + apply operator_basis_ext + rintro ⟨a,e⟩ + cases a with + | nil => + cases r <;> cases s <;> cases e <;> + simp [mul_apply_eq_comp,terminalVertex_single] + | cons k a => + rcases k with ⟨i,t⟩ + simp only [mul_apply_eq_comp,terminalVertex_single] + split_ifs <;> simp only [vacuumTo_cons,map_zero,zero_apply] + + theorem vertex_vacuumTo (w : Path ι) (r s : Bool) : + vertex s*vacuumTo w r=if start w=s then vacuumTo w r else 0 := by + apply ContinuousLinearMap.ext + intro ξ + simp only [mul_apply_eq_comp,vacuumTo_apply,map_smul,vertex_single] + split_ifs <;> simp only [vacuumTo_apply,smul_zero,zero_apply] + + theorem crossAnnihilation_commute_diagonalInsert (i j : ι) (r s : Bool) + (hrs : r≠s) (w : Path ι) : + Commute (star (edgeCreation i r s)) (diagonalInsert j w) := by + have hbase := annihilation_rightInsert i j r w + have hterm := (terminalVertex_commute_creation (start w) i r).star_star + simp only [terminalVertex_star] at hterm + have hvertex := vertex_commute_rightInsert s j w + have hvt : Commute (vertex s : Operator ι) (terminalVertex (start w)) := by + rw [vertex_eq_proj];exact CoordinateProjection.commute _ _ + change _*_=_*_ + simp only [edgeCreation,star_mul,vertex_star,diagonalInsert] + calc + (vertex s*star (creation i r))*(rightInsert j w*terminalVertex (start w)) = + vertex s*(star (creation i r)*rightInsert j w)*terminalVertex (start w) := by + simp only [mul_assoc] + _ = (rightInsert j w*terminalVertex (start w))*(vertex s*star (creation i r)) + + vertex s*(if i=j then vacuumTo w r else 0)*terminalVertex (start w) := by + rw [hbase,mul_add,add_mul] + congr 1 + calc + vertex s*(rightInsert j w*star (creation i r))*terminalVertex (start w) = + rightInsert j w*(vertex s*star (creation i r)*terminalVertex (start w)) := by + rw [← mul_assoc, hvertex.eq]; simp only [mul_assoc] + _ = _ := by + rw [mul_assoc (vertex s),← hterm.eq,← mul_assoc (vertex s),hvt.eq] + simp only [mul_assoc] + _ = _ := by + have hz : vertex s*(if i=j then vacuumTo w r else 0)*terminalVertex (start w)=0 := by + by_cases hij : i=j + · rw [ite_eq_left hij,mul_assoc,vacuumTo_terminal] + by_cases hr : r=start w + · rw [ite_eq_left hr,vertex_vacuumTo,ite_eq_right (by simpa only [← hr] using hrs)] + · rw [ite_eq_right hr,mul_zero] + · rw [ite_eq_right hij,mul_zero,zero_mul] + rw [hz,add_zero] + +end + +section +open FreeFock +variable {ι : Type u_8} [DecidableEq ι] + +omit [DecidableEq ι] in +@[simp] theorem vertex_true : (vertex true : Operator ι)=P := rfl +omit [DecidableEq ι] in +@[simp] theorem vertex_false : (vertex false : Operator ι)=1-P := rfl + + theorem offDiagonal_edges (u v : ℝ) (i : ι) : + offDiagonal u v i=(u:ℂ) • edgeCreation i true false+ + (v:ℂ) • star (edgeCreation i false true) := by + rw [offDiagonal_formula] + simp only [edgeCreation,star_mul,vertex_true,vertex_false,projection_P.isSelfAdjoint.star_eq] + + theorem offDiagonal_commute_diagonalInsert (u v : ℝ) (i j : ι) (w : Path ι) : + Commute (offDiagonal u v i) (diagonalInsert j w) := by + rw [offDiagonal_edges] + exact ((edgeCreation_commute_diagonalInsert i j true false w).smul_left _).add_left + ((crossAnnihilation_commute_diagonalInsert i j false true Bool.false_ne_true w).smul_left _) + + theorem offDiagonalStar_commute_diagonalInsert (u v : ℝ) (i j : ι) (w : Path ι) : + Commute (star (offDiagonal u v i)) (diagonalInsert j w) := by + rw [offDiagonal_edges] + simp only [star_add (R := Operator ι),star_smul,star_star] + exact ((crossAnnihilation_commute_diagonalInsert i j true false (by decide) w).smul_left _).add_left + ((edgeCreation_commute_diagonalInsert i j false true w).smul_left _) + + theorem diagonalInsert_mem_edgeCommutant (u v : ℝ) (i j : ι) (w : Path ι) : + diagonalInsert j w ∈ StarSubalgebra.centralizer ℂ + (insert P {offDiagonal u v i+star (offDiagonal u v i)}) := by + rw [StarSubalgebra.mem_centralizer_iff] + intro T hT + rcases hT with hT | hT + · subst T + have hc := vertex_commute_diagonalInsert true j w + rw [vertex_true] at hc + exact ⟨hc.eq,by rw [projection_P.isSelfAdjoint.star_eq];exact hc.eq⟩ + · have hT' : T=offDiagonal u v i+star (offDiagonal u v i) := hT + subst T + have hc := (offDiagonal_commute_diagonalInsert u v i j w).add_left + (offDiagonalStar_commute_diagonalInsert u v i j w) + exact ⟨hc.eq,by rw [(IsSelfAdjoint.add_star_self (R := Operator ι) _).star_eq];exact hc.eq⟩ + + def alternatingList (e : Bool) : List (ι×Bool) → Prop + | [] => True + | (_,r)::a => r≠start (a,e) ∧ alternatingList e a + def alternatingProjection : Operator ι := + CoordinateProjection.proj {w | alternatingList w.2 w.1} + + theorem alternatingProjection_pos (w : Path ι) (z : ℂ) + (h : alternatingList w.2 w.1) : + alternatingProjection (lp.single 2 w z)=lp.single 2 w z := by + classical + unfold alternatingProjection + rw [CoordinateProjection.proj_single] + apply ite_eq_left + exact h + + theorem alternatingProjection_neg (w : Path ι) (z : ℂ) + (h : ¬alternatingList w.2 w.1) : + alternatingProjection (lp.single 2 w z)=0 := by + classical + unfold alternatingProjection + rw [CoordinateProjection.proj_single] + apply ite_eq_right + exact h + + theorem alternating_commute_edgeCreation (i : ι) (r s : Bool) (hrs : r≠s) : + Commute (alternatingProjection : Operator ι) (edgeCreation i r s) := by + classical + change _*_=_*_ + apply operator_basis_ext + intro w + simp only [mul_apply_eq_comp] + by_cases hs : start w=s + · have hneq : r≠start w := by simpa only [hs] using hrs + by_cases ha : alternatingList w.2 w.1 + · have hn : alternatingList w.2 ((i,r)::w.1) := ⟨hneq,ha⟩ + rw [edgeCreation_single,ite_eq_left hs,alternatingProjection_pos _ _ hn, + alternatingProjection_pos _ _ ha,edgeCreation_single,ite_eq_left hs] + · have hn : ¬alternatingList w.2 ((i,r)::w.1) := fun h => ha h.2 + rw [edgeCreation_single,ite_eq_left hs,alternatingProjection_neg _ _ hn, + alternatingProjection_neg _ _ ha,map_zero] + · rw [edgeCreation_single,ite_eq_right hs,map_zero] + by_cases ha : alternatingList w.2 w.1 + · rw [alternatingProjection_pos _ _ ha,edgeCreation_single,ite_eq_right hs] + · rw [alternatingProjection_neg _ _ ha,map_zero] + + theorem alternating_commute_edgeAnnihilation (i : ι) (r s : Bool) (hrs : r≠s) : + Commute (alternatingProjection : Operator ι) (star (edgeCreation i r s)) := by + have h := (alternating_commute_edgeCreation i r s hrs).star_star + simpa only [alternatingProjection,CoordinateProjection.star_proj] using h + + theorem alternating_mem_edgeCommutant (u v : ℝ) (i : ι) : + (alternatingProjection : Operator ι) ∈ StarSubalgebra.centralizer ℂ + (insert P {offDiagonal u v i+star (offDiagonal u v i)}) := by + have hc : Commute (alternatingProjection : Operator ι) (offDiagonal u v i) := by + rw [offDiagonal_edges] + exact ((alternating_commute_edgeCreation i true false (by decide)).smul_right _).add_right + ((alternating_commute_edgeAnnihilation i false true Bool.false_ne_true).smul_right _) + have hcs := hc.star_star + simp only [alternatingProjection,CoordinateProjection.star_proj] at hcs + rw [StarSubalgebra.mem_centralizer_iff] + intro T hT + rcases hT with hT | hT + · subst T + have hh : Commute (alternatingProjection : Operator ι) P := CoordinateProjection.commute _ _ + exact ⟨hh.eq.symm,by rw [projection_P.isSelfAdjoint.star_eq];exact hh.eq.symm⟩ + · have hT' : T=offDiagonal u v i+star (offDiagonal u v i) := hT + subst T + have hh := hc.add_right hcs + exact ⟨hh.eq.symm,by rw [(IsSelfAdjoint.add_star_self (R := Operator ι) _).star_eq];exact hh.eq.symm⟩ + + theorem diagonal_annihilation_alternating (i : ι) (r : Bool) : + star (edgeCreation i r r)*alternatingProjection=0 := by + classical + apply operator_basis_ext + rintro ⟨a,e⟩ + simp only [mul_apply_eq_comp,zero_apply] + cases a with + | nil => + rw [alternatingProjection_pos _ _ (show alternatingList e [] from trivial), + edgeAnnihilation_nil] + | cons k a => + rcases k with ⟨j,s⟩ + by_cases ha : alternatingList e ((j,s)::a) + · rw [alternatingProjection_pos _ _ ha,edgeAnnihilation_cons] + apply ite_eq_right + rintro ⟨heq,hs⟩ + exact ha.1 ((Prod.mk.inj heq).2.symm.trans hs.symm) + · rw [alternatingProjection_neg _ _ ha,map_zero] + + theorem alternating_edge_root (u v : ℝ) (i : ι) (T : edgeAlgebra u v i) (s : Bool) : + alternatingProjection ((T : Operator ι) (lp.single 2 ([],s) 1))= + (T : Operator ι) (lp.single 2 ([],s) 1) := by + have hc := ((StarSubalgebra.mem_centralizer_iff ℂ).mp T.property _ + (alternating_mem_edgeCommutant u v i)).1 + have ht := DFunLike.congr_fun hc (lp.single 2 ([],s) 1) + simpa only [mul_apply_eq_comp,alternatingProjection_pos ([],s) 1 + (show alternatingList s [] from trivial)] using ht + + theorem diagonal_annihilation_edge_root (u v : ℝ) (i j : ι) + (T : edgeAlgebra u v i) (r s : Bool) : + star (edgeCreation j r r) ((T : Operator ι) (lp.single 2 ([],s) 1))=0 := by + have ht := DFunLike.congr_fun (diagonal_annihilation_alternating j r) + ((T : Operator ι) (lp.single 2 ([],s) 1)) + simpa only [mul_apply_eq_comp,alternating_edge_root,zero_apply] using ht + +end +open FreeFock +variable {ι : Type u_9} [DecidableEq ι] + + theorem edgeAnnihilation_diagonalInsert_formula (i j : ι) (r s : Bool) (w : Path ι) : + star (edgeCreation i r s)*diagonalInsert j w= + diagonalInsert j w*star (edgeCreation i r s)+ + vertex s*(if i=j then vacuumTo w r else 0)*terminalVertex (start w) := by + have hbase := annihilation_rightInsert i j r w + have hterm := (terminalVertex_commute_creation (start w) i r).star_star + simp only [terminalVertex_star] at hterm + have hvertex := vertex_commute_rightInsert s j w + have hvt : Commute (vertex s : Operator ι) (terminalVertex (start w)) := by + rw [vertex_eq_proj];exact CoordinateProjection.commute _ _ + simp only [edgeCreation,star_mul,vertex_star,diagonalInsert] + calc + (vertex s*star (creation i r))*(rightInsert j w*terminalVertex (start w)) = + vertex s*(star (creation i r)*rightInsert j w)*terminalVertex (start w) := by + simp only [mul_assoc] + _ = _ := by + rw [hbase,mul_add,add_mul] + congr 1 + calc + vertex s*(rightInsert j w*star (creation i r))*terminalVertex (start w) = + rightInsert j w*(vertex s*star (creation i r)*terminalVertex (start w)) := by + rw [← mul_assoc, hvertex.eq]; simp only [mul_assoc] + _ = _ := by + rw [mul_assoc (vertex s),← hterm.eq,← mul_assoc (vertex s),hvt.eq] + simp only [mul_assoc] + + theorem diagonalAnnihilation_diagonalInsert (i j : ι) (r : Bool) (w : Path ι) : + star (edgeCreation i r r)*diagonalInsert j w= + diagonalInsert j w*star (edgeCreation i r r)+ + if i=j ∧ start w=r then vacuumTo w r else 0 := by + rw [edgeAnnihilation_diagonalInsert_formula] + congr 1 + by_cases hij : i=j + · rw [ite_eq_left hij,mul_assoc,vacuumTo_terminal] + by_cases hr : start w=r + · simp only [hr,ite_true,vertex_vacuumTo,hij,true_and] + · simp only [ite_eq_right (Ne.symm hr),mul_zero,hij,true_and,hr,ite_false] + · simp only [hij,ite_false,mul_zero,zero_mul,false_and] + + theorem diagonalInsert_nil (j : ι) (w : Path ι) (s : Bool) : + diagonalInsert j w (lp.single 2 ([],s) 1)= + if s=start w then lp.single 2 ((j,s)::w.1,w.2) 1 else 0 := by + simp only [diagonalInsert,mul_apply_eq_comp,terminalVertex_single] + split_ifs <;> simp only [rightInsert_single,List.nil_append,List.singleton_append,map_zero] + + theorem diagonal_edge_contraction (u v : ℝ) (i j k : ι) + (T : edgeAlgebra u v i) (r s : Bool) : + star (edgeCreation j r r)*(T : Operator ι)*edgeCreation k s s= + if j=k ∧ r=s then + (((T : Operator ι) (lp.single 2 ([],s) 1)) ([],r)) • vertex s else 0 := by + apply operator_basis_ext + intro w + by_cases hs : start w=s + · have hc := ((StarSubalgebra.mem_centralizer_iff ℂ).mp T.property _ + (diagonalInsert_mem_edgeCommutant u v i k w)).1 + have ht := DFunLike.congr_fun hc (lp.single 2 ([],s) 1) + simp only [mul_apply_eq_comp,diagonalInsert_nil,hs,ite_true] at ht + have ha := DFunLike.congr_fun (diagonalAnnihilation_diagonalInsert j k r w) + ((T : Operator ι) (lp.single 2 ([],s) 1)) + simp only [mul_apply_eq_comp,add_apply,diagonal_annihilation_edge_root u v i j T, + map_zero,zero_add,hs] at ha + simp only [mul_apply_eq_comp,edgeCreation_single,hs,ite_true,← ht,ha] + by_cases hjk : j=k + · by_cases hrs : r=s + · simp [hjk,hrs,vacuumTo_apply,_root_.smul_apply,vertex_single,hs] + · simp only [hjk,true_and,Ne.symm hrs,hrs,ite_false,zero_apply] + · simp only [hjk,false_and,ite_false,zero_apply] + · simp only [mul_apply_eq_comp,edgeCreation_single,hs,ite_false,map_zero] + split_ifs <;> simp only [_root_.smul_apply,vertex_single,hs,ite_false,smul_zero,zero_apply] + +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Restriction.lean b/lean/OAI/Analysis/InterpolatedFactors/Restriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce9a83bb467a8c05a1b4631f6edea36e719605ba --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Restriction.lean @@ -0,0 +1,198 @@ +import OAI.Analysis.InterpolatedFactors.Ultraweak + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 + +section +namespace FreeGroupFactorMain.FullReducingCorner +open Amplification GaussianRecognition ReducingSubspace +variable {A : Type u_1} {B : Type u_2} [CStarAlgebra A] [CStarAlgebra B] + +def transport (Φ : A ≃⋆ₐ[ℂ] B) (s : Set A) (t : Set B) (he : Φ '' s=t) : + bicomm s ≃⋆ₐ[ℂ] bicomm t where + toFun T := ⟨Φ T,by + rw [← he] + exact (bicommutant_transport Φ s T).mpr T.property⟩ + invFun T := ⟨Φ.symm T,by + apply (bicommutant_transport Φ s (Φ.symm T)).mp + rw [StarAlgEquiv.apply_symm_apply,he] + exact T.property⟩ + left_inv T := Subtype.ext (StarAlgEquiv.symm_apply_apply Φ (T:A)) + right_inv T := Subtype.ext (StarAlgEquiv.apply_symm_apply Φ (T:B)) + map_mul' T U := Subtype.ext (Φ.map_mul (T:A) (U:A)) + map_add' T U := Subtype.ext (Φ.map_add (T:A) (U:A)) + map_smul' c T := Subtype.ext (map_smul Φ c (T:A)) + map_star' T := Subtype.ext (Φ.map_star' (T:A)) + +variable {E : Type u_3} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable (K : Submodule ℂ E) [CompleteSpace K] + +theorem representation_compress (T : E →L[ℂ] E) : + cornerRepresentation K (compress K.starProjection isStarProjection_starProjection T)=reduce K T := by + apply ContinuousLinearMap.ext + intro ξ + change K.orthogonalProjectionOnto (K.starProjection (T (K.starProjection (ξ:E))))= + K.orthogonalProjectionOnto (T ξ) + rw [K.starProjection_mem_subspace_eq_self ξ,K.orthogonalProjectionOnto_starProjection_of_le le_rfl] + +def reductionImage (s : Set (E →L[ℂ] E)) : Set (K →L[ℂ] K) := reduce K '' s + +theorem representation_compressedSet (s : Set (E →L[ℂ] E)) : + cornerRepresentation K '' compressedSet K.starProjection isStarProjection_starProjection s=reductionImage K s := by + rw [compressedSet,Set.image_image] + simp only [representation_compress,reductionImage] + +variable (s : Set (E →L[ℂ] E)) +variable (hps : K.starProjection∈StarSubalgebra.centralizer ℂ s) +variable (v : E →L[ℂ] E) (hvs : v∈StarSubalgebra.centralizer ℂ s) +variable (hpv : K.starProjection*v=v) (hvr : v*(1-K.starProjection)=v) (hvi : star v*v=1-K.starProjection) + +def restrictionIso : bicomm s ≃⋆ₐ[ℂ] bicomm (reductionImage K s) := + (iso K.starProjection isStarProjection_starProjection s hps v hvs hpv hvr hvi).trans + (transport (cornerRepresentation K) _ _ (representation_compressedSet K s)) + +theorem restrictionIso_apply (T : bicomm s) : + (restrictionIso K s hps v hvs hpv hvr hvi T : K →L[ℂ] K)=reduce K (T:E →L[ℂ] E) := + representation_compress K T + +@[instance_reducible] def operatorTopology {F : Type u_4} [NormedAddCommGroup F] + [InnerProductSpace ℂ F] [CompleteSpace F] (t : Set (F →L[ℂ] F)) : TopologicalSpace (bicomm t) := + TopologicalSpace.induced (fun T : bicomm t => (T:F →L[ℂ] F)) (HilbertUltraweak.topology F) + +theorem restrictionIso_normal : + @Continuous _ _ (operatorTopology s) (operatorTopology (reductionImage K s)) + (restrictionIso K s hps v hvs hpv hvr hvi) := by + let : TopologicalSpace (E →L[ℂ] E) := HilbertUltraweak.topology E + let : TopologicalSpace (bicomm s) := operatorTopology s + let : TopologicalSpace (K →L[ℂ] K) := HilbertUltraweak.topology K + apply continuous_induced_rng.mpr + have he : (fun T : bicomm s => (restrictionIso K s hps v hvs hpv hvr hvi T : K →L[ℂ] K))= + (fun T : bicomm s => reduce K (T:E →L[ℂ] E)) := funext (restrictionIso_apply K s hps v hvs hpv hvr hvi) + change @Continuous _ _ (operatorTopology s) (HilbertUltraweak.topology K) + (fun T : bicomm s => (restrictionIso K s hps v hvs hpv hvr hvi T : K →L[ℂ] K)) + rw [he] + exact (HilbertUltraweak.sandwich_continuous K.orthogonalProjectionOnto K.subtypeL).comp continuous_subtype_val +end FreeGroupFactorMain.FullReducingCorner + +namespace FreeGroupFactorMain.GaussianRecognition.System +open ReducingSubspace FullReducingCorner +variable {A : Type u_5} {E : Type u_6} {I : Type u_7} [Ring A] [StarRing A] [Algebra ℂ A] +variable [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable {covariance : I → I → A → A} (X : System A E I covariance) + +theorem normalHull_projection_mem (σ : I → I) : + X.normalHull.starProjection∈StarSubalgebra.centralizer ℂ (X.generators σ) := by + rw [StarSubalgebra.mem_centralizer_iff] + intro U hU + rcases hU with ⟨a,rfl⟩ | ⟨i,rfl⟩ + · exact ⟨(X.normalHull_projection_coeff a).eq.symm, + (by simpa only [map_star] using (X.normalHull_projection_coeff (star a)).eq.symm)⟩ + · refine ⟨(X.normalHull_projection_generator σ i).eq.symm,?_⟩ + change star (X.create i+star (X.create (σ i)))*_= _*star (X.create i+star (X.create (σ i))) + rw [star_add (R := Operator E),star_star] + exact ((X.normalHull_projection_annihilate i).add_right (X.normalHull_projection_create (σ i))).eq.symm + +theorem reduced_generators (σ : I → I) : + reductionImage X.normalHull (X.generators σ)=X.reducedSystem.generators σ := by + have hgen (i : I) : reduce X.normalHull (X.generator σ i)=X.reducedSystem.generator σ i := by + change reduce X.normalHull (X.create i+star (X.create (σ i)))= + reduce X.normalHull (X.create i)+star (reduce X.normalHull (X.create (σ i))) + rw [reduce_add,reduce_star] + change reduce X.normalHull '' (Set.range X.coeff ∪ Set.range (X.generator σ))= + Set.range X.reducedSystem.coeff ∪ Set.range (X.reducedSystem.generator σ) + rw [Set.image_union,← Set.range_comp,← Set.range_comp] + have hg : reduce X.normalHull ∘ X.generator σ=X.reducedSystem.generator σ := funext hgen + rw [hg] + rfl + +variable (σ : I → I) (v : E →L[ℂ] E) (hvs : v∈StarSubalgebra.centralizer ℂ (X.generators σ)) +variable (hpv : X.normalHull.starProjection*v=v) (hvr : v*(1-X.normalHull.starProjection)=v) +variable (hvi : star v*v=1-X.normalHull.starProjection) + +def fullReductionIso : X.generated σ ≃⋆ₐ[ℂ] X.reducedSystem.generated σ := by + have he := X.reduced_generators σ + exact (restrictionIso X.normalHull (X.generators σ) (X.normalHull_projection_mem σ) v hvs hpv hvr hvi).trans + (transport (StarAlgEquiv.refl ℂ _) _ _ (by simpa only [StarAlgEquiv.coe_refl,Set.image_id] using he)) + +theorem fullReductionIso_apply (T : X.generated σ) : + (X.fullReductionIso σ v hvs hpv hvr hvi T : X.normalHull →L[ℂ] X.normalHull)=reduce X.normalHull (T:Operator E) := + restrictionIso_apply X.normalHull _ _ v hvs hpv hvr hvi T + +theorem fullReductionIso_normal : + @Continuous _ _ (X.generatedTopology σ) (X.reducedSystem.generatedTopology σ) + (X.fullReductionIso σ v hvs hpv hvr hvi) := by + let : TopologicalSpace (Operator E) := ultraweak E + let : TopologicalSpace (X.generated σ) := X.generatedTopology σ + let : TopologicalSpace (X.normalHull →L[ℂ] X.normalHull) := ultraweak X.normalHull + apply continuous_induced_rng.mpr + have he : (fun T : X.generated σ => (X.fullReductionIso σ v hvs hpv hvr hvi T : X.normalHull →L[ℂ] X.normalHull))= + (fun T : X.generated σ => reduce X.normalHull (T:Operator E)) := funext (X.fullReductionIso_apply σ v hvs hpv hvr hvi) + change @Continuous _ _ (X.generatedTopology σ) (ultraweak X.normalHull) + (fun T : X.generated σ => (X.fullReductionIso σ v hvs hpv hvr hvi T : X.normalHull →L[ℂ] X.normalHull)) + rw [he] + exact (HilbertUltraweak.sandwich_continuous X.normalHull.orthogonalProjectionOnto X.normalHull.subtypeL).comp + continuous_subtype_val + +theorem fullReductionIso_trace (T : X.generated σ) : + inner ℂ X.reducedSystem.root ((X.fullReductionIso σ v hvs hpv hvr hvi T : X.normalHull →L[ℂ] X.normalHull) + X.reducedSystem.root)=inner ℂ X.root ((T:Operator E) X.root) := by + rw [fullReductionIso_apply] + exact inner_reduce X.normalHull _ _ _ +end FreeGroupFactorMain.GaussianRecognition.System + +end + +namespace FreeGroupFactorMain.WeightedFock +open FreeFock Amplification GaussianRecognition ReducingSubspace +variable (u v : ℝ) (hv : 0 .inl i + | .inr (j,b) => .inr (j,!b) + +def rotate (R : PairedIndex S P → A) : PairedIndex S P → A + | .inl i => R (.inl i) + | .inr (j,false) => plus (R (.inr (j,false))) (R (.inr (j,true))) + | .inr (j,true) => minus (R (.inr (j,false))) (R (.inr (j,true))) + + theorem rotate_covariance [DecidableEq S] [DecidableEq P] (R : PairedIndex S P → A) (a Z : A) + (h : ∀ i j,star (R i)*a*R j=if i=j then Z else 0) (i j : PairedIndex S P) : + star (rotate R i)*a*rotate R j=if i=j then Z else 0 := by + rcases i with i | ⟨i,b⟩ <;> rcases j with j | ⟨j,c⟩ + · exact h (.inl i) (.inl j) + · cases c <;> simp [rotate,plus,minus,mul_add,mul_sub,h] + · cases b <;> simp [rotate,plus,minus,star_add,star_sub,star_smul,add_mul,h] + · by_cases hij : i=j + · subst j + have hXX : star (R (.inr (i,false)))*a*R (.inr (i,false))=Z := by simpa using h (.inr (i,false)) (.inr (i,false)) + have hYY : star (R (.inr (i,true)))*a*R (.inr (i,true))=Z := by simpa using h (.inr (i,true)) (.inr (i,true)) + have hXY : star (R (.inr (i,false)))*a*R (.inr (i,true))=0 := by simpa using h (.inr (i,false)) (.inr (i,true)) + have hYX : star (R (.inr (i,true)))*a*R (.inr (i,false))=0 := by simpa using h (.inr (i,true)) (.inr (i,false)) + have hh := contraction _ _ a Z hXX hYY hXY hYX + cases b <;> cases c + · simpa only [rotate,ite_true] using hh.1 + · simpa [rotate] using hh.2.2.1 + · simpa [rotate] using hh.2.2.2 + · simpa only [rotate,ite_true] using hh.2.1 + · cases b <;> cases c <;> + simp [rotate,plus,minus,star_add,star_sub,star_smul,add_mul,mul_add,mul_sub,h,hij] + +theorem rotate_generation (R : PairedIndex S P → A) (M : StarSubalgebra ℂ A) : + (∀ i,R i+star (R i)∈M) ↔ (∀ i,rotate R i+star (rotate R (flip i))∈M) := by + constructor + · intro h i + rcases i with i | ⟨j,(_|_)⟩ + · exact h (.inl i) + · exact ((generation _ _ M).mp ⟨h (.inr (j,false)),h (.inr (j,true))⟩).1 + · exact ((generation _ _ M).mp ⟨h (.inr (j,false)),h (.inr (j,true))⟩).2 + · intro h i + rcases i with i | ⟨j,(_|_)⟩ + · exact h (.inl i) + · exact ((generation _ _ M).mpr ⟨h (.inr (j,false)),h (.inr (j,true))⟩).1 + · exact ((generation _ _ M).mpr ⟨h (.inr (j,false)),h (.inr (j,true))⟩).2 +end FreeGroupFactorMain.CircularRotation + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/ScalarGeneration.lean b/lean/OAI/Analysis/InterpolatedFactors/ScalarGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f3aeb4d046b7dbbdd63424bfbd1b8b7c0076b96 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/ScalarGeneration.lean @@ -0,0 +1,438 @@ +import OAI.Analysis.InterpolatedFactors.GaussianAlgebra + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 + +namespace FreeGroupFactorMain.FreeFock + +section +open scoped ENNReal +variable {α : Type u_1} [DecidableEq α] + + def appendEmbedding (b : α) : List α ↪ List α := + ⟨fun w => w++[b],fun _ _ h => List.append_cancel_right h⟩ + + def rightCreation (b : α) : Operator α := + (hilbertEmbedding (appendEmbedding b)).toContinuousLinearMap + +@[simp] theorem rightCreation_single (b : α) (w : List α) (z : ℂ) : + rightCreation b (lp.single 2 w z)=lp.single 2 (w++[b]) z := + hilbertEmbedding_single (appendEmbedding b) w z + + theorem creation_rightCreation (a b : α) : + creation a*rightCreation b=rightCreation b*creation a := by + apply operator_basis_ext (α := List α) + intro w + simp only [mul_apply_eq_comp,creation_single,rightCreation_single,List.cons_append] + + def vacuumProjection : Operator α := InnerProductSpace.rankOne ℂ vacuum vacuum + +@[simp] theorem vacuumProjection_nil (z : ℂ) : + vacuumProjection (lp.single 2 ([] : List α) z)=lp.single 2 [] z := by + classical + ext w + simp [vacuumProjection,InnerProductSpace.rankOne_apply,vacuum,lp.inner_single_left, + lp.single_apply,Pi.single_apply] + +@[simp] theorem vacuumProjection_cons (a : α) (w : List α) (z : ℂ) : + vacuumProjection (lp.single 2 (a::w) z)=0 := by + simp [vacuumProjection,InnerProductSpace.rankOne_apply,vacuum,lp.inner_single_left,lp.single_apply] + + theorem annihilation_rightCreation (a b : α) : + star (creation a)*rightCreation b= + rightCreation b*star (creation a)+(if a=b then vacuumProjection else 0) := by + apply operator_basis_ext (α := List α) + intro w + cases w with + | nil => + simp only [mul_apply_eq_comp,add_apply,rightCreation_single, + List.nil_append,annihilation_single_cons,annihilation_single_nil,map_zero,zero_add] + by_cases h : a=b <;> simp [h] + | cons c w => + simp only [mul_apply_eq_comp,add_apply,rightCreation_single, + List.cons_append,annihilation_single_cons] + have hp : (if a=b then (vacuumProjection : Operator α) else 0) (lp.single 2 (c::w) 1)=0 := by + split_ifs <;> simp + rw [hp,add_zero] + by_cases h : a=c + · rw [ite_eq_left h,ite_eq_left h,rightCreation_single] + · rw [ite_eq_right h,ite_eq_right h,map_zero] + + theorem vacuumProjection_selfAdjoint : star (vacuumProjection (α := α))=vacuumProjection := by + simp [vacuumProjection,ContinuousLinearMap.star_eq_adjoint] + + theorem creation_rightAnnihilation (a b : α) : + creation a*star (rightCreation b)= + star (rightCreation b)*creation a-(if a=b then vacuumProjection else 0) := by + have h := congrArg star (annihilation_rightCreation a b) + simp only [star_mul,star_star,star_add (R := Operator α)] at h + have he : star (if a=b then (vacuumProjection : Operator α) else 0)= + if a=b then vacuumProjection else 0 := by + split_ifs <;> simp [vacuumProjection_selfAdjoint,star_zero (R := Operator α)] + rw [he] at h + exact eq_sub_of_add_eq h.symm + + def rightSemicircular (a : α) : Operator α := rightCreation a+star (rightCreation a) + + theorem semicircular_rightSemicircular (a b : α) : + Commute (semicircular a) (rightSemicircular b) := by + have hc := creation_rightCreation a b + have ha := congrArg star hc + simp only [star_mul] at ha + have hL := annihilation_rightCreation a b + have hR := creation_rightAnnihilation a b + change (creation a+star (creation a))*(rightCreation b+star (rightCreation b))= + (rightCreation b+star (rightCreation b))*(creation a+star (creation a)) + noncomm_ring [hc,ha,hL,hR] + +end +section +open scoped ENNReal ComplexConjugate +variable {α : Type u_2} [DecidableEq α] + + def reverseEmbedding : List α ↪ List α := ⟨List.reverse,List.reverse_injective⟩ + def reverseIsometry : Fock α →ₗᵢ[ℂ] Fock α := hilbertEmbedding reverseEmbedding + def reverseOperator : Operator α := reverseIsometry.toContinuousLinearMap + +@[simp] theorem reverseOperator_single (w : List α) (z : ℂ) : + reverseOperator (lp.single 2 w z)=lp.single 2 w.reverse z := + hilbertEmbedding_single reverseEmbedding w z + + theorem reverseOperator_square : (reverseOperator : Operator α)*reverseOperator=1 := by + apply operator_basis_ext (α := List α) + intro w + simp only [mul_apply_eq_comp,reverseOperator_single,List.reverse_reverse,one_apply_eq_self] + + theorem reverseOperator_involutive (ξ : Fock α) : + reverseOperator (reverseOperator ξ)=ξ := by + have hi := DFunLike.congr_fun (reverseOperator_square (α := α)) ξ + exact hi + + def reverseEquiv : Fock α ≃ₗᵢ[ℂ] Fock α := + LinearIsometryEquiv.ofSurjective reverseIsometry (fun ξ => + ⟨reverseOperator ξ,reverseOperator_involutive ξ⟩) + +@[simp] theorem reverseEquiv_apply (ξ : Fock α) : reverseEquiv ξ=reverseOperator ξ := rfl +@[simp] theorem reverseEquiv_symm_apply (ξ : Fock α) : reverseEquiv.symm ξ=reverseOperator ξ := by + apply reverseEquiv.injective + rw [LinearIsometryEquiv.apply_symm_apply,reverseEquiv_apply,reverseOperator_involutive] + + theorem reverse_conj_creation (a : α) : + reverseEquiv.conjStarAlgEquiv (creation a)=rightCreation a := by + apply operator_basis_ext (α := List α) + intro w + simp only [LinearIsometryEquiv.conjStarAlgEquiv_apply_apply,reverseEquiv_symm_apply, + reverseEquiv_apply,reverseOperator_single,creation_single,rightCreation_single, + List.reverse_cons,List.reverse_reverse] + + theorem reverse_conj_semicircular (a : α) : + reverseEquiv.conjStarAlgEquiv (semicircular a)=rightSemicircular a := by + simp only [semicircular,map_add,map_star,reverse_conj_creation,rightSemicircular] + + theorem wick_mem_any (A : StarSubalgebra ℂ (Operator α)) + (h : ∀ a, semicircular a ∈ A) (w : List α) : wick w ∈ A := by + suffices ∀ w : List α, wick w ∈ A ∧ ∀ a, wick (a::w) ∈ A from (this w).1 + intro w + induction w with + | nil => + refine ⟨by rw [wick_nil]; exact A.one_mem,?_⟩ + intro a + simpa only [wick_semicircular_cons,wick_nil,mul_one,sub_zero] using h a + | cons b w ih => + refine ⟨ih.2 b,?_⟩ + intro a + rw [wick_semicircular_cons] + refine A.sub_mem (A.mul_mem (h a) (ih.2 b)) ?_ + change (if a=b then wick w else 0) ∈ A + by_cases hab : a=b + · rw [ite_eq_left hab]; exact ih.1 + · rw [ite_eq_right hab]; exact A.zero_mem + + def gaussianCommutant (α : Type u_3) [DecidableEq α] : StarSubalgebra ℂ (Operator α) := + StarSubalgebra.centralizer ℂ (Set.range (semicircular : α → Operator α)) + + def gaussianAlgebra (α : Type u_4) [DecidableEq α] : StarSubalgebra ℂ (Operator α) := + StarSubalgebra.centralizer ℂ (gaussianCommutant α : Set (Operator α)) + + theorem rightSemicircular_mem (b : α) : rightSemicircular b ∈ gaussianCommutant α := by + rw [gaussianCommutant,StarSubalgebra.mem_centralizer_iff] + rintro _ ⟨a,rfl⟩ + have hs := (semicircular_selfAdjoint a).star_eq + refine ⟨(semicircular_rightSemicircular a b).eq,?_⟩ + rw [hs] + exact (semicircular_rightSemicircular a b).eq + + def rightWick (w : List α) : Operator α := reverseEquiv.conjStarAlgEquiv (wick w) + + theorem rightWick_mem (w : List α) : rightWick w ∈ gaussianCommutant α := by + apply wick_mem_any ((gaussianCommutant α).comap reverseEquiv.conjStarAlgEquiv.toStarAlgHom) + intro a + change reverseEquiv.conjStarAlgEquiv (semicircular a) ∈ gaussianCommutant α + rw [reverse_conj_semicircular] + exact rightSemicircular_mem a + +@[simp] theorem rightWick_vacuum (w : List α) : rightWick w vacuum=lp.single 2 w.reverse 1 := by + simp only [rightWick,LinearIsometryEquiv.conjStarAlgEquiv_apply_apply, + reverseEquiv_symm_apply,reverseEquiv_apply] + have hv : reverseOperator (vacuum : Fock α)=vacuum := reverseOperator_single [] 1 + rw [hv,wick_vacuum,reverseOperator_single] + + theorem rightWick_star (w : List α) : star (rightWick w)=rightWick w.reverse := by + simp only [rightWick,← map_star,wick_star] + + theorem gaussian_commute_rightWick (T : gaussianAlgebra α) (w : List α) : + rightWick w*(T : Operator α)=(T : Operator α)*rightWick w := + ((StarSubalgebra.mem_centralizer_iff ℂ).mp T.property _ (rightWick_mem w)).1 + + theorem gaussian_separating (T : gaussianAlgebra α) (hT : (T : Operator α) vacuum=0) : T=0 := by + apply Subtype.ext + apply operator_basis_ext (α := List α) + intro w + have hc := DFunLike.congr_fun (gaussian_commute_rightWick T w.reverse) vacuum + simp only [mul_apply_eq_comp,rightWick_vacuum,List.reverse_reverse,hT,map_zero] at hc + change (T : Operator α) (lp.single 2 w 1)=0 + exact hc.symm + + theorem gaussian_star_vector (T : gaussianAlgebra α) (w : List α) : + ((star (T : Operator α)) vacuum) w=conj (((T : Operator α) vacuum) w.reverse) := by + have hc := DFunLike.congr_fun (gaussian_commute_rightWick T w.reverse) vacuum + simp only [mul_apply_eq_comp,rightWick_vacuum,List.reverse_reverse] at hc + have hv : (star (rightWick w.reverse)) vacuum=lp.single 2 w.reverse 1 := by + rw [rightWick_star,rightWick_vacuum,List.reverse_reverse] + have he : inner ℂ (lp.single 2 w 1) ((star (T : Operator α)) vacuum)= + inner ℂ ((T : Operator α) vacuum) (lp.single 2 w.reverse 1) := by + calc + _ = inner ℂ ((T : Operator α) (lp.single 2 w 1)) vacuum := by + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + _ = inner ℂ ((rightWick w.reverse) ((T : Operator α) vacuum)) vacuum := by rw [hc] + _ = inner ℂ ((T : Operator α) vacuum) ((star (rightWick w.reverse)) vacuum) := by + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + _ = _ := by rw [hv] + simpa [lp.inner_single_left,lp.inner_single_right,RCLike.inner_apply] using he + + theorem gaussian_trace_mul (S T : gaussianAlgebra α) : + vacuumTrace ((S : Operator α)*(T : Operator α))= + vacuumTrace ((T : Operator α)*(S : Operator α)) := by + have hf (A B : gaussianAlgebra α) : + vacuumTrace ((A : Operator α)*(B : Operator α))= + ∑' w : List α, ((A : Operator α) vacuum) w.reverse*((B : Operator α) vacuum) w := by + unfold vacuumTrace + rw [mul_apply_eq_comp,← ContinuousLinearMap.adjoint_inner_left] + change inner ℂ ((star (A : Operator α)) vacuum) ((B : Operator α) vacuum)=_ + rw [lp.inner_eq_tsum] + congr 1 + funext w + rw [gaussian_star_vector] + simp [RCLike.inner_apply,mul_comm] + rw [hf,hf] + let e : List α ≃ List α := ⟨List.reverse,List.reverse, List.reverse_reverse,List.reverse_reverse⟩ + have hs := e.tsum_eq (fun w : List α => ((T : Operator α) vacuum) w.reverse*((S : Operator α) vacuum) w) + simpa only [e,Equiv.coe_fn_mk,List.reverse_reverse,mul_comm] using hs + +end +open GaussianRecognition CyclicSpectral CircularRotation +open Filter Topology +open scoped ENNReal +variable {α : Type u_5} [DecidableEq α] + +theorem fock_closed_total (K : Submodule ℂ (Fock α)) (hK : IsClosed (K:Set (Fock α))) + (hδ : ∀ w : List α,lp.single 2 w (1:ℂ)∈K) : K=⊤ := by + apply top_unique + intro ξ _ + apply hK.mem_of_tendsto (lp.hasSum_single (by norm_num : (2:ℝ≥0∞)≠⊤) ξ) + filter_upwards [] with s + apply K.sum_mem + intro w _ + have he : lp.single (E := fun _ : List α => ℂ) 2 w (ξ w)=(ξ w) • lp.single 2 w 1 := by + ext v + simp [lp.single_apply,Pi.single_apply] + rw [he] + exact K.smul_mem _ (hδ w) + +theorem gaussian_commutant_total : + (Submodule.span ℂ (Set.range (fun B : StarSubalgebra.centralizer ℂ + (gaussianAlgebra α:Set (Operator α)) => (B:Operator α) vacuum))).topologicalClosure=⊤ := by + apply fock_closed_total _ (Submodule.isClosed_topologicalClosure _) + intro w + have hB : rightWick w.reverse∈StarSubalgebra.centralizer ℂ (gaussianAlgebra α:Set (Operator α)) := + WeightedFock.centralizer_bicommutant (Set.range (semicircular : α → Operator α)) + ⟨_,rightWick_mem w.reverse⟩ + apply Submodule.le_topologicalClosure _ + have hh : rightWick w.reverse vacuum=lp.single 2 w 1 := by + rw [rightWick_vacuum,List.reverse_reverse] + rw [← hh] + exact Submodule.subset_span ⟨⟨rightWick w.reverse,hB⟩,rfl⟩ + +theorem semicircular_mem_uniform_bicommutant (i : α) : + semicircular i∈Bicommutant.algebra (Set.range (scalarUniform i)) := by + let : Nontrivial (Fock α) := by + apply nontrivial_of_ne (vacuum : Fock α) 0 + intro h + have hh := congrArg (fun ξ : Fock α => ξ []) h + simp [vacuum,lp.single_apply] at hh + let := semicircular_spectral_noAtoms i + have h := operator_mem_haar_bicommutant (semicircular i) (semicircular_selfAdjoint i) vacuum + (gaussianAlgebra α) (Set.isClosed_centralizer _) + (Bicommutant.subset (Set.range (semicircular : α → Operator α)) (Set.mem_range_self i)) + gaussian_commutant_total + apply Bicommutant.mono _ (Set.range (scalarUniform i)) ?_ h + intro T hT + rcases hT with rfl + exact ⟨uniformPhase,(uniformHom_phase (semicircular i) (semicircular_selfAdjoint i) vacuum).symm⟩ + +def scalarFlip (i : WeightedCornerIndex.Index × ℕ) : WeightedCornerIndex.Index × ℕ := (flip i.1,i.2) + +theorem scalarCoeff_mem_gaussian (a : UniformAlgebra) : + scalarSystem.coeff a∈gaussianAlgebra ScalarIndex := by + let := semicircular_spectral_noAtoms (none:ScalarIndex) + exact uniformHom_mem (semicircular (none:ScalarIndex)) (semicircular_selfAdjoint none) vacuum + (gaussianAlgebra ScalarIndex) (Set.isClosed_centralizer _) + (Bicommutant.subset _ (Set.mem_range_self none)) a + +theorem scalarGenerator_mem_gaussian (i : WeightedCornerIndex.Index × ℕ) : + scalarSystem.generator scalarFlip i∈gaussianAlgebra ScalarIndex := by + exact (rotate_generation (fun j => creation (some (j,i.2))) (gaussianAlgebra ScalarIndex)).mp + (fun j => Bicommutant.subset (Set.range (semicircular : ScalarIndex → Operator ScalarIndex)) + (Set.mem_range_self (some (j,i.2)))) i.1 + +theorem scalar_semicircular_mem_generated (i : ScalarIndex) : + semicircular i∈scalarSystem.generated scalarFlip := by + cases i with + | none => + exact Bicommutant.mono _ _ (Set.subset_union_left) + (semicircular_mem_uniform_bicommutant (none:ScalarIndex)) + | some i => + exact (rotate_generation (fun j => creation (some (j,i.2))) + (scalarSystem.generated scalarFlip)).mpr + (fun j => Bicommutant.subset _ (Set.mem_union_right _ (Set.mem_range_self (j,i.2)))) i.1 + +theorem scalar_generated_eq_gaussian : scalarSystem.generated scalarFlip=gaussianAlgebra ScalarIndex := by + apply le_antisymm + · apply Bicommutant.generated_le + rintro T (⟨a,rfl⟩ | ⟨i,rfl⟩) + · exact scalarCoeff_mem_gaussian a + · exact scalarGenerator_mem_gaussian i + · apply Bicommutant.generated_le + rintro T ⟨i,rfl⟩ + exact scalar_semicircular_mem_generated i + +theorem scalarSystem_total : + (Submodule.span ℂ (Set.range scalarSystem.family)).topologicalClosure=⊤ := by + apply fock_closed_total _ (Submodule.isClosed_topologicalClosure _) + intro w + have hw : wick w∈scalarSystem.generated scalarFlip := by + rw [scalar_generated_eq_gaussian] + exact wick_mem_any _ (fun i => Bicommutant.subset _ (Set.mem_range_self i)) w + have h := scalarSystem.normalHull_bicommutant scalarFlip (wick w) hw + change lp.single 2 w 1∈scalarSystem.normalHull + simpa only [show scalarSystem.root=(vacuum : Fock ScalarIndex) from rfl,wick_vacuum] using h +end FreeGroupFactorMain.FreeFock + +namespace FreeGroupFactorMain.WeightedFock +open FreeFock Amplification WeightedCornerIndex GaussianRecognition +variable (u v : ℝ) (hv : 0 filledEdgeAlgebra_le_ambient u v (0:ℕ) 1 ha + +theorem kindPair_mem_pAmbient (k : Kind) : + kindCreator u v k+star (kindCreator u v k.transpose)∈pAmbient u v := by + cases k with + | fresh n r s => exact normalizedCreation_paired_mem u v (0:ℕ) (n+2) r s + | residual r s => exact normalizedResidual_paired_mem u v (0:ℕ) 1 r s + | diagonal r => + change pDiagonal u v 0 0 r+star (pDiagonal u v 0 0 r)∈pAmbient u v + rw [pDiagonal_eq_pFresh] + exact normalizedCreation_paired_mem u v (0:ℕ) 0 r r + +theorem outputPair_mem_pAmbient (i : WeightedCornerIndex.Index) (n : ℕ) : + (cornerAbsorption u v hv hvu).output i n+ + star ((cornerAbsorption u v hv hvu).output (CircularRotation.flip i) n)∈pAmbient u v := by + apply ((cornerAbsorption u v hv hvu).output_generation (pAmbient u v) + (fun i => pFilled_le_pAmbient u v (kindLeft u v (description i)).property) + (fun i => pFilled_le_pAmbient u v (kindRight u v (description i)).property)).mp ?_ i n + constructor + · intro i + change kindCreator u v (description i)+star (kindCreator u v (description (CircularRotation.flip i)))∈pAmbient u v + rw [description_flip] + exact kindPair_mem_pAmbient u v (description i) + · intro i n + exact normalizedCreation_paired_mem u v (0:ℕ) (reservoirCode (i,n)+2) false false + +theorem representedAmbient_saturated : + Bicommutant.algebra (representedAmbient u v : Set (PRange ℕ →L[ℂ] PRange ℕ))≤representedAmbient u v := by + intro T hT + have him : (representedAmbient u v : Set (PRange ℕ →L[ℂ] PRange ℕ))= + pRepresentation '' (pAmbient (ι := ℕ) u v : Set (PCorner ℕ)) := by + ext B + constructor + · intro h;exact ⟨(pRepresentation (ι := ℕ)).symm B,h,StarAlgEquiv.apply_symm_apply _ _⟩ + · rintro ⟨b,hb,rfl⟩ + change (pRepresentation (ι := ℕ)).symm (pRepresentation b)∈pAmbient u v + rw [StarAlgEquiv.symm_apply_apply] + exact hb + change (pRepresentation (ι := ℕ)).symm T∈pAmbient u v + apply relative_corner_bicommutant (insert P (Set.range (S u v : ℕ → Operator ℕ))) + P projection_P (P_mem_ambient u v) + apply (bicommutant_transport (A := PCorner ℕ) (B := PRange ℕ →L[ℂ] PRange ℕ) (pRepresentation (ι := ℕ)) (pAmbient (ι := ℕ) u v : Set (PCorner ℕ)) + ((pRepresentation (ι := ℕ)).symm T)).mp + rw [StarAlgEquiv.apply_symm_apply,← him] + exact hT + +theorem weighted_generated_le_ambient : (weightedSystem u v hv hvu).generated scalarFlip≤representedAmbient u v := by + apply le_trans (Bicommutant.mono _ (representedAmbient u v : Set (PRange ℕ →L[ℂ] PRange ℕ)) ?_) + (representedAmbient_saturated u v) + rintro T (⟨a,rfl⟩|⟨i,rfl⟩) + · exact pFilled_le_pAmbient u v (weightedUniform_mem u v hv hvu a) + · change (pRepresentation (ι := ℕ)).symm + (pRepresentation ((cornerAbsorption u v hv hvu).output i.1 i.2)+ + star (pRepresentation ((cornerAbsorption u v hv hvu).output (CircularRotation.flip i.1) i.2)))∈pAmbient u v + rw [← pRep_star,← pRep_add,StarAlgEquiv.symm_apply_apply] + exact outputPair_mem_pAmbient u v hv hvu i.1 i.2 + +theorem representedAmbient_le_weightedGenerated : representedAmbient u v≤(weightedSystem u v hv hvu).generated scalarFlip := by + let G := (weightedSystem u v hv hvu).generated scalarFlip + let M := G.comap (pRepresentation (ι := ℕ)).toStarAlgHom + have hbase (a : Base u v) : (a:PCorner ℕ)∈M := by + apply Bicommutant.mono (Set.range (weightedUniform u v hv hvu)) + ((weightedSystem u v hv hvu).generators scalarFlip) (fun _ h => Or.inl h) + apply representedBase_le_weightedUniform u v hv hvu + change (pRepresentation (ι := ℕ)).symm (pRepresentation a.val)∈Base u v + simpa only [StarAlgEquiv.symm_apply_apply] using a.property + have hout (i : WeightedCornerIndex.Index) (n : ℕ) : + (cornerAbsorption u v hv hvu).output i n+ + star ((cornerAbsorption u v hv hvu).output (CircularRotation.flip i) n)∈M := by + change pRepresentation (_+star _)∈G + rw [pRep_add,pRep_star] + exact Bicommutant.subset ((weightedSystem u v hv hvu).generators scalarFlip) + (Or.inr (Set.mem_range_self (i,n))) + intro T hT + have hr := pAmbient_recovered u v hv hvu M hbase hout hT + have hh := (bicommutant_transport (A := PCorner ℕ) (B := PRange ℕ →L[ℂ] PRange ℕ) (pRepresentation (ι := ℕ)) (M : Set (PCorner ℕ)) + ((pRepresentation (ι := ℕ)).symm T)).mpr hr + rw [StarAlgEquiv.apply_symm_apply] at hh + apply Bicommutant.generated_le ((weightedSystem u v hv hvu).generators scalarFlip) + (pRepresentation '' (M : Set (PCorner ℕ))) ?_ hh + rintro _ ⟨b,hb,rfl⟩ + exact hb + +theorem weighted_generated_eq_ambient : + (weightedSystem u v hv hvu).generated scalarFlip=representedAmbient u v := + le_antisymm (weighted_generated_le_ambient u v hv hvu) (representedAmbient_le_weightedGenerated u v hv hvu) +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/ScalarSystem.lean b/lean/OAI/Analysis/InterpolatedFactors/ScalarSystem.lean new file mode 100644 index 0000000000000000000000000000000000000000..7272b3ab3becf4abf4e0a99819c0a60ff84892dc --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/ScalarSystem.lean @@ -0,0 +1,198 @@ +import OAI.Analysis.InterpolatedFactors.RelativeClosure + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 + +namespace FreeGroupFactorMain.FreeFock + +section +open Filter Topology +open scoped ENNReal +variable {α : Type u_1} [DecidableEq α] + +omit [DecidableEq α] in + theorem repeat_coordinates_decay (i : α) (ξ : Fock α) : + Tendsto (fun n => ξ (List.replicate n i)) atTop (𝓝 0) := by + have hf : Function.Injective (fun n => List.replicate n i) := by + intro n m h + simpa only [List.length_replicate] using congrArg List.length h + have hs : Summable (fun w : List α => ‖ξ w‖^2) := by + simpa using (lp.memℓp ξ).summable (by norm_num : (0:ℝ)<(2:ℝ≥0∞).toReal) + have ht := (hs.comp_injective hf).tendsto_atTop_zero + have hh := Real.continuous_sqrt.continuousAt.tendsto.comp ht + apply tendsto_zero_iff_norm_tendsto_zero.mpr + simpa only [Function.comp_def,Real.sqrt_sq_eq_abs,abs_norm,Real.sqrt_zero] using hh + + theorem semicircular_repeat_zero (i : α) : + semicircular i (lp.single 2 [] 1)=lp.single 2 [i] 1 := by + simp only [semicircular,add_apply,creation_single,annihilation_single_nil,add_zero] + + theorem semicircular_repeat_succ (i : α) (n : ℕ) : + semicircular i (lp.single 2 (List.replicate (n+1) i) 1)= + lp.single 2 (List.replicate (n+2) i) 1+lp.single 2 (List.replicate n i) 1 := by + simp only [semicircular,add_apply,creation_single,List.replicate_succ, + annihilation_single_cons,ite_true] + + theorem semicircular_eigen_root_zero (i : α) (z : ℂ) (ξ : Fock α) + (hξ : semicircular i ξ=z • ξ) : ξ []=0 := by + have he (n : ℕ) : inner ℂ (semicircular i (lp.single 2 (List.replicate n i) 1)) ξ= + z*ξ (List.replicate n i) := by + rw [← (semicircular_selfAdjoint i).star_eq,ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_left,hξ,inner_smul_right] + simp [lp.inner_single_left,RCLike.inner_apply] + have hb : (1:ℂ)*ξ (List.replicate 1 i)=z*ξ (List.replicate 0 i) := by + have h := he 0 + rw [List.replicate_zero,semicircular_repeat_zero] at h + simpa only [lp.inner_single_left,RCLike.inner_apply,map_one,mul_one,one_mul, + List.replicate_one,List.replicate_zero] using h + have ht (n : ℕ) : (1:ℂ)*ξ (List.replicate (n+2) i)= + z*ξ (List.replicate (n+1) i)-(1:ℂ)*ξ (List.replicate n i) := by + have h := he (n+1) + rw [semicircular_repeat_succ] at h + simp only [inner_add_left,lp.inner_single_left,RCLike.inner_apply,map_one,mul_one] at h + linear_combination h + exact JacobiNonatom.semicircular_eigenvector_zero 1 z one_ne_zero + (fun n => ξ (List.replicate n i)) (repeat_coordinates_decay i ξ) hb ht 0 + +end + +section +open MeasureTheory +variable {α : Type u_2} [DecidableEq α] +local instance : InnerProductSpace ℝ (Fock α) := InnerProductSpace.rclikeToReal ℂ (Fock α) + + theorem semicircular_spectral_noAtoms (i : α) : + NullSingletonClass (CyclicSpectral.measure (semicircular i) (semicircular_selfAdjoint i) vacuum) := by + apply CyclicSpectral.noAtoms + intro r η hη + have hc : semicircular i η=(r:ℂ) • η := by + exact hη.trans (by + apply Subtype.ext + funext w + change r • η w=(r:ℂ)*η w + exact Complex.real_smul) + have hz := semicircular_eigen_root_zero i (r:ℂ) η hc + change (inner ℂ vacuum η).re=0 + simp only [vacuum,lp.inner_single_left,RCLike.inner_apply,map_one,mul_one,hz,Complex.zero_re] + +end +section +open CyclicSpectral MeasureTheory +variable {α : Type u_3} [DecidableEq α] + +instance scalarSpectral_probability (i : α) : + IsProbabilityMeasure (measure (semicircular i) (semicircular_selfAdjoint i) (vacuum : Fock α)) := + probability _ _ _ (by simp [vacuum,lp.norm_single]) + +def scalarUniform (i : α) : UniformAlgebra →⋆ₐ[ℂ] Operator α := by + letI := semicircular_spectral_noAtoms i + exact uniformHom (semicircular i) (semicircular_selfAdjoint i) vacuum + +theorem scalarUniform_state (i : α) (a : UniformAlgebra) : + vacuumTrace (scalarUniform i a)=uniformState a := by + let := semicircular_spectral_noAtoms i + exact uniformHom_state _ _ _ a + +theorem scalarUniform_mem (i : α) (a : UniformAlgebra) : + scalarUniform i a∈(runAlgebra i).topologicalClosure := by + let := semicircular_spectral_noAtoms i + apply uniformHom_mem (semicircular i) (semicircular_selfAdjoint i) vacuum + ((runAlgebra i).topologicalClosure) (StarSubalgebra.isClosed_topologicalClosure _) ?_ a + apply StarSubalgebra.le_topologicalClosure + change semicircular i∈runSpan i + simpa [wick_semicircular_cons] using run_mem i 1 + +theorem scalarUniform_covariance {I : Type u_4} [DecidableEq I] (i j : I) (a : UniformAlgebra) : + star (creation (some i))*scalarUniform (none : Option I) a*creation (some j)= + if i=j then uniformState a • (1:Operator (Option I)) else 0 := by + have h := closed_coarse_covariance (none : Option I) (some i) (some j) + (by simp) (by simp) ⟨_,scalarUniform_mem none a⟩ + change _=vacuumTrace (scalarUniform (none:Option I) a) • (if some i=some j then 1 else 0) at h + rw [scalarUniform_state] at h + by_cases he : i=j + · simpa only [he,ite_true] using h + · simpa only [Option.some.injEq,ite_eq_right he, + smul_zero (M := ℂ) (A := Operator (Option I))] using h + +theorem scalarUniform_annihilation {I : Type u_5} [DecidableEq I] (i : I) (a : UniformAlgebra) : + star (creation (some i)) (scalarUniform (none : Option I) a vacuum)=0 := + closed_coefficient_annihilation none (some i) (by simp) ⟨_,scalarUniform_mem none a⟩ +end + +open CyclicSpectral GaussianRecognition CircularRotation WeightedCornerIndex + +abbrev ScalarIndex := Option (WeightedCornerIndex.Index × ℕ) +instance scalarIndexDecidableEq : DecidableEq ScalarIndex := + fun a b => @Option.instDecidableEq (WeightedCornerIndex.Index × ℕ) + (fun x y => instDecidableEqProd x y) a b + +def rotatedCreation (i : WeightedCornerIndex.Index × ℕ) : Operator ScalarIndex := + rotate (fun j => creation (some (j,i.2))) i.1 + +theorem rotatedCreation_covariance (i j : WeightedCornerIndex.Index × ℕ) (a : UniformAlgebra) : + star (rotatedCreation i)*scalarUniform (none : ScalarIndex) a*rotatedCreation j= + if i=j then uniformState a • (1:Operator ScalarIndex) else 0 := by + rcases i with ⟨i,n⟩ + rcases j with ⟨j,m⟩ + by_cases hnm : n=m + · subst m + have hh := rotate_covariance (fun i : WeightedCornerIndex.Index => creation (some (i,n))) + (scalarUniform (none : ScalarIndex) a) (uniformState a • (1:Operator ScalarIndex)) + (fun i j => by simpa only [Prod.mk.injEq,and_true] using scalarUniform_covariance (i,n) (j,n) a) i j + simpa only [rotatedCreation,Prod.mk.injEq,and_true] using hh + · have he (i j : WeightedCornerIndex.Index) : + star (creation (some (i,n)))*scalarUniform (none : ScalarIndex) a*creation (some (j,m))=0 := by + simpa only [Prod.mk.injEq,hnm,and_false,ite_false] using scalarUniform_covariance (i,n) (j,m) a + simp only [Prod.mk.injEq,hnm,and_false,ite_false] + rcases i with i | ⟨i,b⟩ <;> rcases j with j | ⟨j,c⟩ + · exact he (.inl i) (.inl j) + · cases c <;> simp [rotatedCreation,rotate,plus,minus,mul_add,mul_sub,he] + · cases b <;> simp only [rotatedCreation,rotate,plus,minus,star_smul, + star_add (R := Operator ScalarIndex),star_sub (R := Operator ScalarIndex),add_mul, + sub_mul,smul_mul_assoc (α := ℂ) (β := Operator ScalarIndex),he, + smul_zero (M := ℂ) (A := Operator ScalarIndex),add_zero,sub_zero] + · cases b <;> cases c <;> + simp only [rotatedCreation,rotate,plus,minus,star_smul, + star_add (R := Operator ScalarIndex),star_sub (R := Operator ScalarIndex),add_mul, + sub_mul,mul_add,mul_sub,smul_mul_assoc (α := ℂ) (β := Operator ScalarIndex), + mul_smul_comm (α := ℂ) (β := Operator ScalarIndex),he, + smul_zero (M := ℂ) (A := Operator ScalarIndex),add_zero,sub_zero] + +theorem rotatedCreation_annihilation (i : WeightedCornerIndex.Index × ℕ) (a : UniformAlgebra) : + star (rotatedCreation i) (scalarUniform (none : ScalarIndex) a vacuum)=0 := by + rcases i with ⟨i,n⟩ + rcases i with i | ⟨i,b⟩ + · exact scalarUniform_annihilation (I := WeightedCornerIndex.Index × ℕ) (.inl i,n) a + · have hf := scalarUniform_annihilation (I := WeightedCornerIndex.Index × ℕ) (.inr (i,false),n) a + have ht := scalarUniform_annihilation (I := WeightedCornerIndex.Index × ℕ) (.inr (i,true),n) a + cases b <;> simp only [rotatedCreation,rotate,plus,minus,star_smul, + star_add (R := Operator ScalarIndex),star_sub (R := Operator ScalarIndex), + add_apply,sub_apply,smul_apply,hf,ht,smul_zero,add_zero,sub_zero] + +def scalarSystem : GaussianRecognition.System UniformAlgebra (Fock ScalarIndex) + (WeightedCornerIndex.Index × ℕ) uniformCovariance where + coeff := scalarUniform none + root := vacuum + create := rotatedCreation + contract i j a := by + rw [rotatedCreation_covariance] + by_cases h : i=j + · simp only [uniformCovariance,h,ite_true,map_smul,map_one] + · simp only [uniformCovariance,ite_eq_right h,map_zero] + annihilate := rotatedCreation_annihilation + +theorem scalar_weighted_state (u v : ℝ) (hv : 0 simpa only [pow_zero] using HasCornerScaling.one τ 𝒯 hτ + | succ n ih => simpa only [pow_succ] using ih.mul τ 𝒯 ht + + theorem HasCornerScaling.of_near_one (τ : A → ℂ) (𝒯 : TopologicalSpace A) (hτ : τ 1=1) + (hnear : ∀ t : ℝ,1/2 vacuumTrace u v (T : WeightedFock.Operator ℕ)) + scalarTrace (ambientTopology u v) (scalarSystem.generatedTopology scalarFlip) + (ambientP u v) (ambientP_projection u v) (u^2) (pow_ne_zero 2 hu) + (vacuumTrace_P u v) (ambientScalarIso u v hu hv' hunit) + (ambientScalarIso_normal u v hu hv' hunit) (ambientScalarIso_symm_normal u v hu hv' hunit) + (ambientScalarIso_trace u v hu hv' hunit) (ambientCornerGaussianIso u v hv hvu) + (ambientCornerGaussianIso_normal u v hv hvu) (ambientCornerGaussianIso_symm_normal u v hv hvu) + intro x + change inner ℂ scalarSystem.root + ((ambientCornerGaussianIso u v hv hvu x : FreeFock.Operator ScalarIndex) scalarSystem.root)=_ + rw [ambientCornerGaussianIso_trace,pVacuumTrace,Complex.ofReal_pow,←inv_pow] + ring + + theorem scalar_hasCornerScaling_near_one (t : ℝ) (ht : 1/2 ?_) (scalar_hasCornerScaling t ht ht1) + simpa only [StarAlgEquiv.apply_symm_apply] using (scalarGroupIso_trace (scalarGroupIso.symm T)).symm +end FreeGroupFactorMain.WeightedFock + +namespace FreeGroupFactorMain.Amplification +open WeightedFock FreeFock + +theorem smallScaling_transport_group {G : Type u_6} {H : Type u_7} [Group G] [Group H] + (h : HasNormalTracialIso G H) {t : ℝ} + (ht : HasCornerScaling (canonicalTrace (G := G)) (groupUltraweakTopology G) t) : + HasCornerScaling (canonicalTrace (G := H)) (groupUltraweakTopology H) t := by + classical + obtain ⟨Φ,hΦ,_⟩ := h + obtain ⟨e,hδ,he⟩ := spatial_of_trace_iso Φ hΦ + apply HasCornerScaling.transport canonicalTrace canonicalTrace + (groupUltraweakTopology G) (groupUltraweakTopology H) + (spatialGroupIso e he) (spatialGroupIso_normal e he) (spatialGroupIso_symm_normal e he) ?_ ht + intro T + rw [canonicalTrace_eq_inner,canonicalTrace_eq_inner] + change inner ℂ deltaOne (e ((T : GroupOperator G) (e.symm deltaOne)))=_ + rw [←hδ,e.symm_apply_apply,e.inner_map_map] + +theorem infinite_hasCornerScaling (t : ℝ) (ht : 0 z • groupUnitary g) + +theorem groupPolynomial_dense (ξ : GroupHilbert G) {ε : ℝ} (hε : 0 < ε) : + ∃ p : G →₀ ℂ, ‖groupL2 (groupPolynomial p)-ξ‖ < ε := by + classical + let K := Submodule.span ℂ (Set.range (fun g : G => groupL2 (groupUnitary g))) + have ht : ⊤ ≤ K.topologicalClosure := by + apply group_single_total _ (Submodule.isClosed_topologicalClosure _) + intro g + rw [← groupL2_groupUnitary g] + exact Submodule.le_topologicalClosure _ (Submodule.subset_span ⟨g,rfl⟩) + have hx : ξ ∈ closure (K : Set (GroupHilbert G)) := by + rw [← Submodule.topologicalClosure_coe] + exact ht trivial + obtain ⟨x,hx,hd⟩ := Metric.mem_closure_iff.mp hx ε hε + obtain ⟨p,hp⟩ := Finsupp.mem_span_range_iff_exists_finsupp.mp hx + refine ⟨p,?_⟩ + have he : groupL2 (groupPolynomial p) = x := by + rw [groupPolynomial,Finsupp.sum] + simp only [map_sum,map_smul] + exact hp + rw [he,← dist_eq_norm,dist_comm] + exact hd + +theorem trace_iso_orbit_total (Φ : groupVonNeumann G ≃⋆ₐ[ℂ] groupVonNeumann H) + (ht : ∀ T, canonicalTrace (Φ T) = canonicalTrace T) : + ⊤ ≤ (Submodule.span ℂ (Set.range (fun g : G => groupL2 (Φ (groupUnitary g))))).topologicalClosure := by + classical + let K := Submodule.span ℂ (Set.range (fun g : G => groupL2 (Φ (groupUnitary g)))) + apply group_single_total _ (Submodule.isClosed_topologicalClosure _) + intro h + change lp.single 2 h (1 : ℂ) ∈ K.topologicalClosure + change lp.single 2 h (1 : ℂ) ∈ closure (K : Set (GroupHilbert H)) + apply Metric.mem_closure_iff.mpr + intro ε hε + obtain ⟨p,hp⟩ := groupPolynomial_dense (groupL2 (Φ.symm (groupUnitary h))) hε + refine ⟨groupL2 (Φ (groupPolynomial p)),?_,?_⟩ + · change groupL2 (Φ (groupPolynomial p)) ∈ K + rw [groupPolynomial,Finsupp.sum] + simp only [map_sum,map_smul] + exact Submodule.sum_mem K (fun g _ => Submodule.smul_mem K _ + (Submodule.subset_span ⟨g,rfl⟩)) + · rw [dist_comm,dist_eq_norm,← groupL2_groupUnitary h,← map_sub] + change twoNorm (Φ (groupPolynomial p)-groupUnitary h) < ε + rw [← Φ.apply_symm_apply (groupUnitary h),← map_sub,twoNorm_iso Φ ht] + change ‖groupL2 (groupPolynomial p-Φ.symm (groupUnitary h))‖ < ε + rw [map_sub] + exact hp + +theorem spatial_of_trace_iso (Φ : groupVonNeumann G ≃⋆ₐ[ℂ] groupVonNeumann H) + (ht : ∀ T, canonicalTrace (Φ T) = canonicalTrace T) : + ∃ e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H, + e deltaOne = deltaOne ∧ + ∀ T : GroupOperator G, T ∈ groupVonNeumann G ↔ + e.conjStarAlgEquiv T ∈ groupVonNeumann H := by + classical + let ρ : G →* groupVonNeumann H := Φ.toMonoidHom.comp + ((unitary (groupVonNeumann G)).subtype.comp (groupUnitaryUHom G)) + have hρ (g : G) : ρ g = Φ (groupUnitary g) := rfl + obtain ⟨e,he,_hgen,hmem⟩ := spatial_of_haar_total ρ (fun g => by + change star (Φ (groupUnitary g)) = Φ (groupUnitary g⁻¹) + exact (Φ.map_star' (groupUnitary g)).symm.trans + (congrArg Φ (groupUnitary_inv g).symm)) (fun g => by + rw [hρ,ht,canonicalTrace_groupUnitary]) (trace_iso_orbit_total Φ ht) + exact ⟨e,he,hmem⟩ + +end + +open scoped ENNReal +variable {I : Type u_3} {G : Type u_4} {H : Type u_5} + +def nestedSpatialValue (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (ξ : NestedHilbert I G) : NestedHilbert I H := + ⟨fun i => e (ξ i), (lp.memℓp ξ).norm.mono (fun i => by rw [e.norm_map])⟩ + +@[simp] theorem nestedSpatialValue_apply (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (ξ : NestedHilbert I G) (i : I) : nestedSpatialValue e ξ i = e (ξ i) := rfl + +def nestedSpatial (I : Type u_6) (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) : + NestedHilbert I G ≃ₗᵢ[ℂ] NestedHilbert I H where + toFun := nestedSpatialValue e + invFun := nestedSpatialValue e.symm + left_inv ξ := by ext i j; change e.symm (e (ξ i)) j = ξ i j; rw [e.symm_apply_apply] + right_inv ξ := by ext i j; change e (e.symm (ξ i)) j = ξ i j; rw [e.apply_symm_apply] + map_add' ξ η := by ext i j; change e (ξ i+η i) j = (e (ξ i)+e (η i)) j; rw [map_add] + map_smul' z ξ := by ext i j; change e (z • ξ i) j = (z • e (ξ i)) j; rw [map_smul] + norm_map' ξ := by + apply le_antisymm + · apply lp.norm_mono (by norm_num : (2 : ℝ≥0∞) ≠ 0) + intro i + exact (e.norm_map (ξ i)).le + · apply lp.norm_mono (by norm_num : (2 : ℝ≥0∞) ≠ 0) + intro i + exact (e.norm_map (ξ i)).ge + +@[simp] theorem nestedSpatial_apply (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (ξ : NestedHilbert I G) (i : I) : nestedSpatial I e ξ i = e (ξ i) := rfl + +def productSpatial (I : Type u_7) (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) : + GroupHilbert (I × G) ≃ₗᵢ[ℂ] GroupHilbert (I × H) := + ((hilbertFlatten I G).symm.trans (nestedSpatial I e)).trans (hilbertFlatten I H) + +@[simp] theorem productSpatial_apply (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (ξ : GroupHilbert (I × G)) (i : I) (h : H) : + productSpatial I e ξ (i,h) = e ((hilbertFlatten I G).symm ξ i) h := by + simp only [productSpatial,LinearIsometryEquiv.trans_apply,hilbertFlatten_apply,nestedSpatial_apply] + +@[simp] theorem productSpatial_symm (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) : + (productSpatial I e).symm = productSpatial I e.symm := by + rfl + +theorem productSpatial_productSingle (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (j : I) (ξ : GroupHilbert G) : + productSpatial I e (productSingle I G j ξ) = productSingle I H j (e ξ) := by + classical + ext x + rcases x with ⟨i,h⟩ + rw [productSpatial_apply,productSingle_apply] + have he : (hilbertFlatten I G).symm (productSingle I G j ξ) i = if i=j then ξ else 0 := by + ext g + simp only [hilbertFlatten_symm_apply,productSingle_apply] + split_ifs <;> rfl + rw [he] + split_ifs <;> simp + +theorem matrixEntry_spatial (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (T : GroupOperator (I × G)) (i j : I) : + matrixEntry ((productSpatial I e).conjStarAlgEquiv T) i j = + e.conjStarAlgEquiv (matrixEntry T i j) := by + apply ContinuousLinearMap.ext + intro ξ + ext h + rw [matrixEntry_apply] + change (productSpatial I e) (T ((productSpatial I e).symm (productSingle I H j ξ))) (i,h) = + e ((matrixEntry T i j) (e.symm ξ)) h + rw [productSpatial_symm,productSpatial_productSingle,productSpatial_apply] + rfl + +variable [Group G] [Group H] + +theorem productSpatial_stabilization (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (he : ∀ T : GroupOperator G, T ∈ groupVonNeumann G ↔ e.conjStarAlgEquiv T ∈ groupVonNeumann H) + (T : GroupOperator (ℕ × G)) : + T ∈ stabilization G ↔ (productSpatial ℕ e).conjStarAlgEquiv T ∈ stabilization H := by + rw [mem_stabilization_iff_matrix,mem_stabilization_iff_matrix] + simp only [matrixEntry_spatial,← he] + +end FreeGroupFactorMain.Amplification + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Spectral.lean b/lean/OAI/Analysis/InterpolatedFactors/Spectral.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8ebc069e427c03963dbd7dbb1a7e81171eeff80 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Spectral.lean @@ -0,0 +1,479 @@ +import OAI.Analysis.InterpolatedFactors.Jacobi + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 + +open Filter Topology +namespace FreeGroupFactorMain.BicommutantAtom +open InnerProductSpace +variable {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +local notation "Op" => E →L[ℂ] E + +theorem rankOne_commute_fixed (A : Op) (hA : IsSelfAdjoint A) (x y : E) + (hx : A x=x) (hy : A y=y) : Commute A (rankOne ℂ x y) := by + apply ContinuousLinearMap.ext + intro z + change A (inner ℂ y z • x)=inner ℂ y (A z) • x + rw [map_smul,hx,← ContinuousLinearMap.adjoint_inner_left] + change inner ℂ y z • x=inner ℂ (star A y) z • x + rw [hA.star_eq,hy] + +theorem rankOne_commute_zero (A : Op) (hA : IsSelfAdjoint A) (x y : E) + (hx : A x=0) (hy : A y=0) : Commute A (rankOne ℂ x y) := by + apply ContinuousLinearMap.ext + intro z + change A (inner ℂ y z • x)=inner ℂ y (A z) • x + rw [map_smul,hx,← ContinuousLinearMap.adjoint_inner_left] + change inner ℂ y z • (0:E)=inner ℂ (star A y) z • x + rw [hA.star_eq,hy,inner_zero_left,zero_smul,smul_zero] + +omit [CompleteSpace E] in + +theorem scalar_of_rankOne_commutes (d T : Op) + (h : ∀ x y : E, Commute T (rankOne ℂ (d x) (d y))) : + ∃ c : ℂ,T*d=c • d := by + by_cases hd : d=0 + · exact ⟨0,by simp [hd]⟩ + have hx : ∃ x : E,d x≠0 := by + by_contra! hn + apply hd + ext x + exact hn x + obtain ⟨x,hx⟩ := hx + let η := d x + let a := inner ℂ η η + have ha : a≠0 := by + dsimp [a,η] + exact fun hh => hx ((inner_self_eq_zero (𝕜 := ℂ)).mp hh) + let b := inner ℂ η (T η) + refine ⟨a⁻¹*b,?_⟩ + ext z + have he := DFunLike.congr_fun (h z x).eq η + change T (a • d z)=b • d z at he + rw [map_smul] at he + change T (d z)=(a⁻¹*b) • d z + calc + _ = a⁻¹ • (a • T (d z)) := by rw [smul_smul,inv_mul_cancel₀ ha,one_smul] + _ = _ := by rw [he,smul_smul] + +theorem common_kernel_scalar (p s d T : Op) (hp : IsSelfAdjoint p) (hs : IsSelfAdjoint s) + (hpd : p*d=d) (hsd : s*d=0) + (hT : T∈StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (insert p {s}) : Set Op)) : + ∃ c : ℂ,T*d=c • d := by + apply scalar_of_rankOne_commutes d T + intro x y + have hpx (z : E) : p (d z)=d z := DFunLike.congr_fun hpd z + have hsx (z : E) : s (d z)=0 := DFunLike.congr_fun hsd z + have hR : rankOne ℂ (d x) (d y)∈StarSubalgebra.centralizer ℂ (insert p {s}) := by + rw [StarSubalgebra.mem_centralizer_iff] + intro A hA + rcases Set.mem_insert_iff.mp hA with hA | hA + · subst A + have hh := rankOne_commute_fixed p hp (d x) (d y) (hpx x) (hpx y) + exact ⟨hh.eq,by simpa only [hp.star_eq] using hh.eq⟩ + · have hA' : A=s := hA + subst A + have hh := rankOne_commute_zero s hs (d x) (d y) (hsx x) (hsx y) + exact ⟨hh.eq,by simpa only [hs.star_eq] using hh.eq⟩ + exact ((StarSubalgebra.mem_centralizer_iff ℂ).mp hT _ hR).1.symm +end FreeGroupFactorMain.BicommutantAtom +namespace FreeGroupFactorMain.WeightedFock +open FreeFock Amplification.Polar +variable {ι : Type u_2} [DecidableEq ι] + +theorem P_mem_edge (u v : ℝ) (i : ι) : (P : Operator ι)∈edgeAlgebra u v i := + StarAlgebra.adjoin_le_centralizer_centralizer ℂ _ + (StarAlgebra.subset_adjoin ℂ _ (Set.mem_insert _ _)) + +theorem edge_sum_mem_edge (u v : ℝ) (i : ι) : + offDiagonal u v i+star (offDiagonal u v i)∈edgeAlgebra u v i := + StarAlgebra.adjoin_le_centralizer_centralizer ℂ _ + (StarAlgebra.subset_adjoin ℂ _ (Set.mem_insert_of_mem _ (Set.mem_singleton _))) + +theorem offDiagonal_mul_P (u v : ℝ) (i : ι) : offDiagonal u v i*P=0 := + CornerRerouting.right_zero (offDiagonal_right u v i) + +theorem offDiagonal_mem_edge (u v : ℝ) (i : ι) : offDiagonal u v i∈edgeAlgebra u v i := by + have hz : P*star (offDiagonal u v i)=0 := by + simpa only [star_mul,star_zero (Operator ι),projection_P.isSelfAdjoint.star_eq] + using congrArg star (offDiagonal_mul_P u v i) + have he : P*(offDiagonal u v i+star (offDiagonal u v i))=offDiagonal u v i := by + rw [mul_add,offDiagonal_left,hz,add_zero] + rw [← he] + exact mul_mem (P_mem_edge u v i) (edge_sum_mem_edge u v i) + +theorem edgePolar_mem_edge (u v : ℝ) (i : ι) : edgePolar u v i∈edgeAlgebra u v i := + partialIsometry_mem_centralizer _ (offDiagonal_mem_edge u v i) + +theorem edgeRange_mem_edge (u v : ℝ) (i : ι) : edgeRange u v i∈edgeAlgebra u v i := + mul_mem (edgePolar_mem_edge u v i) (star_mem (edgePolar_mem_edge u v i)) + +def edgeDefect (u v : ℝ) (i : ι) : Operator ι := P-edgeRange u v i + +theorem edgeDefect_projection (u v : ℝ) (i : ι) : IsStarProjection (edgeDefect u v i) := + (edgeRange_projection u v i).sub_of_mul_eq_right projection_P (edgeRange_le_P u v i) + +theorem edgeDefect_mem_edge (u v : ℝ) (i : ι) : edgeDefect u v i∈edgeAlgebra u v i := + sub_mem (P_mem_edge u v i) (edgeRange_mem_edge u v i) + +theorem edgeRange_mul_offDiagonal (u v : ℝ) (i : ι) : + edgeRange u v i*offDiagonal u v i=offDiagonal u v i := by + have hf := partialIsometry_factorization (offDiagonal u v i) + change edgePolar u v i*modulus (offDiagonal u v i)=offDiagonal u v i at hf + calc + _ = edgeRange u v i*(edgePolar u v i*modulus (offDiagonal u v i)) := by rw [hf] + _ = edgePolar u v i*modulus (offDiagonal u v i) := by + rw [← mul_assoc] + exact congrArg (fun U => U*modulus (offDiagonal u v i)) (partialIsometry_partial _) + _ = _ := hf + +theorem P_mul_edgeDefect (u v : ℝ) (i : ι) : P*edgeDefect u v i=edgeDefect u v i := by + rw [edgeDefect,mul_sub,projection_P.isIdempotentElem.eq,edgeRange_le_P] + +theorem edgeDefect_mul_P (u v : ℝ) (i : ι) : edgeDefect u v i*P=edgeDefect u v i := by + simpa only [star_mul,projection_P.isSelfAdjoint.star_eq,(edgeDefect_projection u v i).isSelfAdjoint.star_eq] + using congrArg star (P_mul_edgeDefect u v i) + +theorem edgeSum_mul_defect (u v : ℝ) (i : ι) : + (offDiagonal u v i+star (offDiagonal u v i))*edgeDefect u v i=0 := by + have hx : offDiagonal u v i*edgeDefect u v i=0 := by + rw [← P_mul_edgeDefect u v i,← mul_assoc,offDiagonal_mul_P,zero_mul] + have hxp : star (offDiagonal u v i)*P=star (offDiagonal u v i) := by + simpa only [star_mul,projection_P.isSelfAdjoint.star_eq] + using congrArg star (offDiagonal_left u v i) + have hxr : star (offDiagonal u v i)*edgeRange u v i=star (offDiagonal u v i) := by + simpa only [star_mul,(edgeRange_projection u v i).isSelfAdjoint.star_eq] + using congrArg star (edgeRange_mul_offDiagonal u v i) + rw [add_mul,hx,zero_add,edgeDefect,mul_sub,hxp,hxr,sub_self] + +theorem edge_algebra_scalar_on_defect (u v : ℝ) (i : ι) (T : edgeAlgebra u v i) : + ∃ c : ℂ,(T : Operator ι)*edgeDefect u v i=c • edgeDefect u v i := + BicommutantAtom.common_kernel_scalar P (offDiagonal u v i+star (offDiagonal u v i)) + (edgeDefect u v i) T projection_P.isSelfAdjoint + (by show star (_+_)=_;simp only [star_add,star_star,add_comm]) + (P_mul_edgeDefect u v i) (edgeSum_mul_defect u v i) T.property + +theorem edgeDefect_trace (u v : ℝ) (hv : 0 exact h0 + | one => exact h1 + | more n hn hn1 => + have h := hstep n + rw [hn,hn1,mul_zero,mul_zero,sub_self] at h + exact (mul_eq_zero.mp h).resolve_left ha + +end FreeGroupFactorMain.JacobiNonatom +namespace FreeGroupFactorMain.IsometricSemicircle +open Filter Topology +variable {E : Type u_3} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable (L : E →L[ℂ] E) (hL : star L*L=1) (ξ : E) (hξ : inner ℂ ξ ξ=1) + (hroot : star L ξ=0) + +def chain (n : ℕ) : E := (L^n) ξ + +omit [CompleteSpace E] in +theorem chain_zero : chain L ξ 0=ξ := by simp [chain] +omit [CompleteSpace E] in +theorem chain_succ (n : ℕ) : chain L ξ (n+1)=L (chain L ξ n) := by + simp only [chain,pow_succ',mul_apply_eq_comp] + +include hL in +theorem inner_map (x y : E) : inner ℂ (L x) (L y)=inner ℂ x y := by + apply (ContinuousLinearMap.inner_map_map_iff_adjoint_comp_self L).mpr + exact hL + +include hroot in +theorem inner_root_succ (n : ℕ) : inner ℂ ξ (chain L ξ (n+1))=0 := by + rw [chain_succ,← ContinuousLinearMap.adjoint_inner_left] + change inner ℂ (star L ξ) (chain L ξ n)=0 + rw [hroot,inner_zero_left] + +include hL hξ hroot in +theorem chain_inner (n m : ℕ) : inner ℂ (chain L ξ n) (chain L ξ m)=if n=m then 1 else 0 := by + induction n generalizing m with + | zero => + cases m with + | zero => simpa only [chain_zero,ite_true] using hξ + | succ m => simpa only [chain_zero,Nat.succ_ne_zero,Nat.zero_ne_add_one,ite_false] + using inner_root_succ L ξ hroot m + | succ n ih => + cases m with + | zero => + rw [chain_zero,← inner_conj_symm,inner_root_succ L ξ hroot] + simp + | succ m => + rw [chain_succ,chain_succ,inner_map L hL,ih] + simp + +include hL hξ hroot in +theorem chain_orthonormal : Orthonormal ℂ (chain L ξ) := + orthonormal_iff_ite.mpr (chain_inner L hL ξ hξ hroot) + +include hL hξ hroot in +theorem chain_coeff_decay (η : E) : Tendsto (fun n => inner ℂ (chain L ξ n) η) atTop (𝓝 0) := by + have h := ((chain_orthonormal L hL ξ hξ hroot).inner_products_summable η).tendsto_atTop_zero + have hs := Real.continuous_sqrt.continuousAt.tendsto.comp h + have hn : Tendsto (fun n => ‖inner ℂ (chain L ξ n) η‖) atTop (𝓝 0) := by + simpa only [Function.comp_def,Real.sqrt_sq_eq_abs,abs_norm,Real.sqrt_zero] using hs + exact tendsto_zero_iff_norm_tendsto_zero.mpr hn + +include hL in +theorem adjoint_chain_succ (n : ℕ) : star L (chain L ξ (n+1))=chain L ξ n := by + rw [chain_succ] + change (star L*L) (chain L ξ n)=_ + rw [hL,one_apply_eq_self] + +include hroot in +theorem sum_chain_zero : (L+star L) (chain L ξ 0)=chain L ξ 1 := by + rw [chain_zero,add_apply,hroot,add_zero,chain_succ,chain_zero] + +include hL in +theorem sum_chain_succ (n : ℕ) : + (L+star L) (chain L ξ (n+1))=chain L ξ (n+2)+chain L ξ n := by + rw [add_apply,adjoint_chain_succ L hL] + exact congrArg (fun x => x+chain L ξ n) (chain_succ L ξ (n+1)).symm + +include hL hξ hroot in + +theorem eigen_root_zero (z : ℂ) (η : E) (he : (L+star L) η=z • η) : inner ℂ ξ η=0 := by + have hself : star (L+star L)=L+star L := by simp [add_comm] + have h (n : ℕ) : inner ℂ ((L+star L) (chain L ξ n)) η= + z*inner ℂ (chain L ξ n) η := by + rw [← ContinuousLinearMap.adjoint_inner_right] + change inner ℂ (chain L ξ n) (star (L+star L) η)=_ + rw [hself,he,inner_smul_right] + have hb : (1:ℂ)*inner ℂ (chain L ξ 1) η=z*inner ℂ (chain L ξ 0) η := by + rw [one_mul] + simpa only [sum_chain_zero L ξ hroot] using h 0 + have ht (n : ℕ) : (1:ℂ)*inner ℂ (chain L ξ (n+2)) η= + z*inner ℂ (chain L ξ (n+1)) η-(1:ℂ)*inner ℂ (chain L ξ n) η := by + have hn := h (n+1) + rw [sum_chain_succ L hL,inner_add_left] at hn + linear_combination hn + simpa only [chain_zero] using JacobiNonatom.semicircular_eigenvector_zero 1 z one_ne_zero + (fun n => inner ℂ (chain L ξ n) η) (chain_coeff_decay L hL ξ hξ hroot η) hb ht 0 + +end FreeGroupFactorMain.IsometricSemicircle +namespace FreeGroupFactorMain.SupportedSemicircle +variable {E : Type u_4} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable (d L : (E →L[ℂ] E)) (hd : IsStarProjection d) (hleft : d*L=L) (hright : L*d=L) + (hL : star L*L=d) + +def extension : (E →L[ℂ] E) := L+(1-d) + +include hd hleft hL in +theorem extension_isometry : star (extension d L)*extension d L=1 := by + have hsright : star L*d=star L := by + simpa only [star_mul,hd.isSelfAdjoint.star_eq] using congrArg star hleft + have hqL : (1-d)*L=0 := by rw [sub_mul,one_mul,hleft,sub_self] + have hLq : star L*(1-d)=0 := by rw [mul_sub,mul_one,hsright,sub_self] + rw [extension,star_add,hd.one_sub.isSelfAdjoint.star_eq,add_mul,mul_add,mul_add, + hL,hLq,hqL,hd.one_sub.isIdempotentElem.eq,add_zero,zero_add,add_sub_cancel] + +include hd hleft hright in +theorem supported_sum_left : d*(L+star L)=L+star L := by + have hs : d*star L=star L := by + simpa only [star_mul,hd.isSelfAdjoint.star_eq] using congrArg star hright + rw [mul_add,hleft,hs] + +include hd hleft hright in +theorem supported_sum_right : (L+star L)*d=L+star L := by + have hs : star L*d=star L := by + simpa only [star_mul,hd.isSelfAdjoint.star_eq] using congrArg star hleft + rw [add_mul,hright,hs] + +include hd hleft hright hL in + +theorem eigen_root_zero (ξ : E) (hξ : inner ℂ ξ ξ=1) (hdξ : d ξ=ξ) + (hroot : star L ξ=0) (z : ℂ) (η : E) (he : (L+star L) η=z • η) : + inner ℂ ξ η=0 := by + have hqξ : (1-d : (E →L[ℂ] E)) ξ=0 := by rw [sub_apply,one_apply_eq_self,hdξ,sub_self] + have hroot' : star (extension d L) ξ=0 := by + rw [extension,star_add,hd.one_sub.isSelfAdjoint.star_eq,add_apply,hroot,hqξ,add_zero] + have hqη : (1-d : (E →L[ℂ] E)) (d η)=0 := by + change ((1-d)*d) η=0 + rw [sub_mul,one_mul,hd.isIdempotentElem.eq,sub_self,zero_apply] + have he' : (extension d L+star (extension d L)) (d η)=z • d η := by + have hs : (L+star L) (d η)=z • d η := by + calc + _ = (L+star L) η := DFunLike.congr_fun (supported_sum_right d L hd hleft hright) η + _ = d ((L+star L) η) := (DFunLike.congr_fun (supported_sum_left d L hd hleft hright) η).symm + _ = _ := by rw [he,map_smul] + simp only [extension,star_add,hd.one_sub.isSelfAdjoint.star_eq,add_apply,hqη,add_zero] at ⊢ + exact hs + have hz := IsometricSemicircle.eigen_root_zero (extension d L) + (extension_isometry d L hd hleft hL) ξ hξ hroot' z (d η) he' + rw [← ContinuousLinearMap.adjoint_inner_left] at hz + change inner ℂ (star d ξ) η=0 at hz + rwa [hd.isSelfAdjoint.star_eq,hdξ] at hz + +end FreeGroupFactorMain.SupportedSemicircle +namespace FreeGroupFactorMain.WeightedFock +open FreeFock +variable {ι : Type u_5} [DecidableEq ι] + +theorem vacuumTrace_supported_root (u v : ℝ) (T : Operator ι) + (hl : P*T=T) (hr : T*P=T) : + vacuumTrace u v T=(u:ℂ)^2*(T (lp.single 2 ([],true) 1)) ([],true) := by + have hnil : T (lp.single 2 ([],false) 1)=0 := by + rw [← hr,mul_apply_eq_comp,P_nil_false,map_zero] + have hcoord : (T (lp.single 2 ([],true) 1)) ([],false)=0 := by + have hh := DFunLike.congr_fun hl (lp.single 2 ([],true) 1) + have hc := congrArg (fun ξ : H ι => ξ ([],false)) hh + simpa only [mul_apply_eq_comp,P,CoordinateProjection.proj_apply, + Set.indicator_of_notMem (by simp [start] : ([], false) ∉ {w : Path ι | start w = true})] using hc.symm + rw [vacuumTrace_root_expansion,hnil,hcoord] + simp only [lp.coeFn_zero,Pi.zero_apply,mul_zero,add_zero,pow_two] + +def defectCreation (u v : ℝ) (i j : ι) : Operator ι := + edgeDefect u v i*edgeCreation j true true*edgeDefect u v i + +theorem defectCreation_left (u v : ℝ) (i j : ι) : + edgeDefect u v i*defectCreation u v i j=defectCreation u v i j := by + rw [defectCreation,← mul_assoc,← mul_assoc,(edgeDefect_projection u v i).isIdempotentElem.eq] + +theorem defectCreation_right (u v : ℝ) (i j : ι) : + defectCreation u v i j*edgeDefect u v i=defectCreation u v i j := by + rw [defectCreation,mul_assoc,(edgeDefect_projection u v i).isIdempotentElem.eq] + +theorem defectCreation_covariance (u v : ℝ) (i j : ι) : + star (defectCreation u v i j)*defectCreation u v i j= + ((edgeDefect u v i (lp.single 2 ([],true) 1)) ([],true)) • edgeDefect u v i := by + let d := edgeDefect u v i + have hid : d*d=d := (edgeDefect_projection u v i).isIdempotentElem.eq + have hstar : star d=d := (edgeDefect_projection u v i).isSelfAdjoint.star_eq + have hcov := diagonal_edge_contraction u v i j j + ⟨d,edgeDefect_mem_edge u v i⟩ true true + simp only [true_and,ite_true,vertex] at hcov + change star (edgeCreation j true true)*d*edgeCreation j true true=_ at hcov + change star (d*edgeCreation j true true*d)*(d*edgeCreation j true true*d)=_ + calc + _ = d*(star (edgeCreation j true true)*d*edgeCreation j true true)*d := by + simp only [star_mul,hstar,mul_assoc,← mul_assoc d d,hid] + _ = _ := by + rw [hcov,mul_smul_comm,smul_mul_assoc] + change _ • (edgeDefect u v i*P*edgeDefect u v i)=_ + rw [edgeDefect_mul_P,hid] + +theorem defectCreation_root (u v : ℝ) (i j : ι) : + star (defectCreation u v i j) (edgeDefect u v i (lp.single 2 ([],true) 1))=0 := by + have hroot := diagonal_annihilation_edge_root u v i j + (⟨edgeDefect u v i,edgeDefect_mem_edge u v i⟩ : edgeAlgebra u v i) true true + change star (edgeCreation j true true) (edgeDefect u v i (lp.single 2 ([], true) 1))=0 at hroot + rw [defectCreation,star_mul,star_mul,(edgeDefect_projection u v i).isSelfAdjoint.star_eq, + mul_apply_eq_comp,mul_apply_eq_comp] + have hd : edgeDefect u v i (edgeDefect u v i (lp.single 2 ([],true) 1))= + edgeDefect u v i (lp.single 2 ([],true) 1) := + DFunLike.congr_fun (edgeDefect_projection u v i).isIdempotentElem.eq _ + rw [hd,hroot,map_zero] + +end FreeGroupFactorMain.WeightedFock +namespace FreeGroupFactorMain.SupportedSemicircle +variable {E : Type u_6} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +theorem unnormalized_eigen_root_zero (d L : E →L[ℂ] E) (hd : IsStarProjection d) + (hleft : d*L=L) (hright : L*d=L) (ξ : E) (hξ : ξ≠0) (hdξ : d ξ=ξ) + (hL : star L*L=inner ℂ ξ ξ • d) (hroot : star L ξ=0) + (z : ℂ) (η : E) (he : (L+star L) η=z • η) : inner ℂ ξ η=0 := by + let c : ℂ := (‖ξ‖:ℂ)⁻¹ + have hn : (‖ξ‖:ℂ)≠0 := Complex.ofReal_ne_zero.mpr (norm_ne_zero_iff.mpr hξ) + have hc : c≠0 := inv_ne_zero hn + have hsc : star c=c := by simp only [c,star_inv₀,Complex.star_def,Complex.conj_ofReal] + have hu : c*c*inner ℂ ξ ξ=1 := by + rw [inner_self_eq_norm_sq_to_K] + dsimp [c] + field_simp + have hnorm : inner ℂ (c • ξ) (c • ξ)=1 := by + rw [inner_smul_left,inner_smul_right] + change star c*(c*inner ℂ ξ ξ)=1 + rw [hsc,← mul_assoc,hu] + have hcov : star (c • L)*(c • L)=d := by + rw [star_smul,hsc,smul_mul_assoc,mul_smul_comm,hL,smul_smul,smul_smul] + rw [hu,one_smul] + have hl : d*(c • L)=c • L := by rw [mul_smul_comm,hleft] + have hr : (c • L)*d=c • L := by rw [smul_mul_assoc,hright] + have hdv : d (c • ξ)=c • ξ := by rw [map_smul,hdξ] + have hov : star (c • L) (c • ξ)=0 := by + rw [star_smul,hsc,_root_.smul_apply,map_smul,hroot,smul_zero,smul_zero] + have hev : ((c • L)+star (c • L)) η=(c*z) • η := by + rw [star_smul,hsc,← smul_add,_root_.smul_apply,he,smul_smul] + have hh := eigen_root_zero d (c • L) hd hl hr hcov (c • ξ) hnorm hdv hov (c*z) η hev + rw [inner_smul_left] at hh + change star c*inner ℂ ξ η=0 at hh + rw [hsc] at hh + exact (mul_eq_zero.mp hh).resolve_left hc + +end FreeGroupFactorMain.SupportedSemicircle +namespace FreeGroupFactorMain.WeightedFock +open FreeFock +variable {ι : Type u_7} [DecidableEq ι] + +theorem edgeDefect_root_ne_zero (u v : ℝ) (hv : 0 simp only [cut,Bool.false_eq_true,ite_false,ite_true,star_sub (R := B),star_one,hd.isSelfAdjoint.star_eq] + +include hd in +theorem cut_d (r : Bool) : cut B d r*d=if r then d else 0 := by + cases r <;> simp only [cut,Bool.false_eq_true,ite_false,ite_true,sub_mul,one_mul,hd.isIdempotentElem.eq,sub_self] + +include hd hcentral in +theorem cut_false_a_d (a : B) : cut B d false*a*d=0 := by + rw [mul_assoc,← (hcentral a).eq,← mul_assoc,cut_d B d hd] + simp only [Bool.false_eq_true,ite_false,zero_mul] + +def block (r s : Bool) : E →L[ℂ] E := (cut B d r : E →L[ℂ] E)*C*(cut B d s : E →L[ℂ] E) + +def D : E →L[ℂ] E := (d : E →L[ℂ] E)*C*(d : E →L[ℂ] E) + +def covariance (a : B) : B := (inner ℂ Ω (((d*a*d : B) : E →L[ℂ] E) Ω)) • d + +include hC hd in +theorem D_contraction (a : B) : star (D B C d)*(a : E →L[ℂ] E)*D B C d= + (covariance B Ω d a : E →L[ℂ] E) := by + have he := hC (d*a*d) + have hs : star (d : E →L[ℂ] E)=(d : E →L[ℂ] E) := congrArg Subtype.val hd.isSelfAdjoint.star_eq + have hid : (d : E →L[ℂ] E)*(d : E →L[ℂ] E)=(d : E →L[ℂ] E) := congrArg Subtype.val hd.isIdempotentElem.eq + change star C*((d : E →L[ℂ] E)*(a : E →L[ℂ] E)*(d : E →L[ℂ] E))*C=_ at he + calc + _ = (d : E →L[ℂ] E)*(star C*((d : E →L[ℂ] E)*(a : E →L[ℂ] E)*(d : E →L[ℂ] E))*C)*(d : E →L[ℂ] E) := by + simp only [D,star_mul,hs,mul_assoc] + _ = _ := by rw [he,mul_smul_comm,smul_mul_assoc,mul_one,hid];rfl + +include hΩ hd in +theorem D_annihilation (a : B) : star (D B C d) ((a : E →L[ℂ] E) Ω)=0 := by + have he := hΩ (d*a) + have hs : star (d : E →L[ℂ] E)=(d : E →L[ℂ] E) := congrArg Subtype.val hd.isSelfAdjoint.star_eq + simp only [D,star_mul,hs,mul_apply_eq_comp] + change star C ((d : E →L[ℂ] E) ((a : E →L[ℂ] E) Ω))=0 at he + rw [he,map_zero] + +include hC hd in +theorem block_contraction (r s r' s' : Bool) (a : B) : + star (block B C d r s)*(a : E →L[ℂ] E)*block B C d r' s'= + (inner ℂ ((cut B d r : E →L[ℂ] E) Ω) + ((a : E →L[ℂ] E) ((cut B d r' : E →L[ℂ] E) Ω))) • + ((cut B d s : E →L[ℂ] E)*(cut B d s' : E →L[ℂ] E)) := by + have hs (r) : star (cut B d r : E →L[ℂ] E)=(cut B d r : E →L[ℂ] E) := + congrArg Subtype.val (cut_star B d hd r) + have he := hC (cut B d r*a*cut B d r') + change star C*((cut B d r : E →L[ℂ] E)*(a : E →L[ℂ] E)*(cut B d r' : E →L[ℂ] E))*C=_ at he + calc + _ = (cut B d s : E →L[ℂ] E)* + (star C*((cut B d r : E →L[ℂ] E)*(a : E →L[ℂ] E)*(cut B d r' : E →L[ℂ] E))*C)* + (cut B d s' : E →L[ℂ] E) := by simp only [block,star_mul,hs,mul_assoc] + _ = _ := by + rw [he,mul_smul_comm,smul_mul_assoc,mul_one] + congr 1 + change inner ℂ Ω ((cut B d r : E →L[ℂ] E) ((a : E →L[ℂ] E) ((cut B d r' : E →L[ℂ] E) Ω)))=_ + rw [← ContinuousLinearMap.adjoint_inner_left] + change inner ℂ ((star (cut B d r : E →L[ℂ] E)) Ω) _=_ + rw [hs r] + +include hΩ hd in +theorem block_annihilation (r s : Bool) (a : B) : star (block B C d r s) ((a : E →L[ℂ] E) Ω)=0 := by + have he := hΩ (cut B d r*a) + have hs (r) : star (cut B d r : E →L[ℂ] E)=(cut B d r : E →L[ℂ] E) := + congrArg Subtype.val (cut_star B d hd r) + simp only [block,star_mul,hs,mul_apply_eq_comp] + change star C ((cut B d r : E →L[ℂ] E) ((a : E →L[ℂ] E) Ω))=0 at he + rw [he,map_zero] + +include hC hd hcentral in +theorem block_D (r s : Bool) (hrs : ¬(r=true ∧ s=true)) (a : B) : + star (block B C d r s)*(a : E →L[ℂ] E)*D B C d=0 := by + have he := block_contraction B C Ω hC d hd r s true true a + change star (block B C d r s)*(a : E →L[ℂ] E)*D B C d= + (inner ℂ ((cut B d r : E →L[ℂ] E) Ω) + ((a : E →L[ℂ] E) ((d : E →L[ℂ] E) Ω))) • + ((cut B d s : E →L[ℂ] E)*(d : E →L[ℂ] E)) at he + rw [he] + cases s with + | false => + have hz : (cut B d false : E →L[ℂ] E)*(d : E →L[ℂ] E)=0 := + congrArg Subtype.val (cut_d B d hd false) + rw [hz,smul_zero (M := ℂ) (A := E →L[ℂ] E)] + | true => + have hr : r=false := by cases r <;> simp_all + subst r + have hz := congrArg Subtype.val (cut_false_a_d B d hd hcentral a) + change (cut B d false : E →L[ℂ] E)*(a : E →L[ℂ] E)*(d : E →L[ℂ] E)=0 at hz + have hs : star (cut B d false : E →L[ℂ] E)=(cut B d false : E →L[ℂ] E) := + congrArg Subtype.val (cut_star B d hd false) + rw [← ContinuousLinearMap.adjoint_inner_right] + change inner ℂ Ω ((star (cut B d false : E →L[ℂ] E)*(a : E →L[ℂ] E)*(d : E →L[ℂ] E)) Ω) • _=0 + rw [hs,hz,zero_apply,inner_zero_right,zero_smul ℂ (A := E →L[ℂ] E)] + +def filled : StarSubalgebra ℂ (E →L[ℂ] E) := + StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ + (insert (D B C d+star (D B C d)) (B : Set (E →L[ℂ] E))) : Set (E →L[ℂ] E)) + +include hC hΩ hd hcentral in + +theorem residual_covariance (r s r' s' : Bool) (hrs : ¬(r=true ∧ s=true)) + (hrs' : ¬(r'=true ∧ s'=true)) (T : filled B C d) : + star (block B C d r s)*(T : E →L[ℂ] E)*block B C d r' s'= + (inner ℂ ((cut B d r : E →L[ℂ] E) Ω) + ((T : E →L[ℂ] E) ((cut B d r' : E →L[ℂ] E) Ω))) • + ((cut B d s : E →L[ℂ] E)*(cut B d s' : E →L[ℂ] E)) := by + apply GaussianExtension.covariance_extension B (D B C d) (covariance B Ω d) + (D_contraction B C Ω hC d hd) (block B C d r s) (block B C d r' s') _ + ((cut B d r : E →L[ℂ] E) Ω) ((cut B d r' : E →L[ℂ] E) Ω) + (fun a => D_annihilation B C Ω hΩ d hd (a*cut B d r)) + (fun a => D_annihilation B C Ω hΩ d hd (a*cut B d r')) + (block_D B C Ω hC d hd hcentral r s hrs) _ + (block_contraction B C Ω hC d hd r s r' s') (T : E →L[ℂ] E) T.property + intro a + have he := congrArg star (block_D B C Ω hC d hd hcentral r' s' hrs' (star a)) + simpa only [star_mul,star_star,star_zero (E →L[ℂ] E),StarMemClass.coe_star,mul_assoc] using he + +include hC hΩ hd hcentral in +theorem residual_annihilation (r s : Bool) (hrs : ¬(r=true ∧ s=true)) (T : filled B C d) : + star (block B C d r s) ((T : E →L[ℂ] E) Ω)=0 := + GaussianExtension.annihilation_extension B (D B C d) (covariance B Ω d) + (D_contraction B C Ω hC d hd) (block B C d r s) Ω + (D_annihilation B C Ω hΩ d hd) (block_annihilation B C Ω hΩ d hd r s) + (block_D B C Ω hC d hd hcentral r s hrs) T T.property +end FreeGroupFactorMain.GaussianSplit + +namespace FreeGroupFactorMain.WeightedFock + +section +open FreeFock +variable {ι : Type u_2} [DecidableEq ι] + +theorem edgeDefect_commute (u v : ℝ) (i : ι) (T : edgeAlgebra u v i) : + Commute (edgeDefect u v i) (T : Operator ι) := by + have hl (a : edgeAlgebra u v i) : + edgeDefect u v i*(a : Operator ι)*edgeDefect u v i=(a : Operator ι)*edgeDefect u v i := by + obtain ⟨c,hc⟩ := edge_algebra_scalar_on_defect u v i a + rw [mul_assoc,hc,mul_smul_comm,(edgeDefect_projection u v i).isIdempotentElem.eq] + have hr := congrArg star (hl (star T)) + simp only [star_mul,StarMemClass.coe_star,star_star, + (edgeDefect_projection u v i).isSelfAdjoint.star_eq,← mul_assoc] at hr + exact hr.symm.trans (hl T) + +def defectAsEdge (u v : ℝ) (i : ι) : edgeAlgebra u v i := + ⟨edgeDefect u v i,edgeDefect_mem_edge u v i⟩ + +theorem defectAsEdge_projection (u v : ℝ) (i : ι) : IsStarProjection (defectAsEdge u v i) := by + constructor + · apply Subtype.ext + exact (edgeDefect_projection u v i).isIdempotentElem.eq + · apply Subtype.ext + exact (edgeDefect_projection u v i).isSelfAdjoint.star_eq + +theorem defectAsEdge_central (u v : ℝ) (i : ι) (a : edgeAlgebra u v i) : + Commute (defectAsEdge u v i) a := Subtype.ext (edgeDefect_commute u v i a).eq + +theorem fresh_C_edge_contraction (u v : ℝ) (i j : ι) (hji : j≠i) (a : edgeAlgebra u v i) : + star (C u v j)*(a : Operator ι)*C u v j= + (inner ℂ (vacuum u v) ((a : Operator ι) (vacuum u v))) • 1 := by + have hh := fresh_C_contraction u v {i} j j hji hji + ⟨a,edgeAlgebra_le_old u v {i} i (Set.mem_singleton i) a.property⟩ + simpa only [ite_true,vacuumTrace] using hh + +theorem fresh_C_edge_annihilation (u v : ℝ) (i j : ι) (hji : j≠i) (a : edgeAlgebra u v i) : + star (C u v j) ((a : Operator ι) (vacuum u v))=0 := + fresh_C_annihilates_old_vacuum u v {i} j hji + ⟨a,edgeAlgebra_le_old u v {i} i (Set.mem_singleton i) a.property⟩ + +def splitCut (u v : ℝ) (i : ι) (b : Bool) : Operator ι := + GaussianSplit.cut (edgeAlgebra u v i) (defectAsEdge u v i) b + +def splitBlock (u v : ℝ) (i j : ι) (r s : Bool) : Operator ι := + GaussianSplit.block (edgeAlgebra u v i) (C u v j) (defectAsEdge u v i) r s + +theorem splitBlock_filled_covariance (u v : ℝ) (i j : ι) (hji : j≠i) + (r s r' s' : Bool) (hrs : ¬(r=true ∧ s=true)) (hrs' : ¬(r'=true ∧ s'=true)) + (T : filledEdgeAlgebra u v i j) : + star (splitBlock u v i j r s)*(T : Operator ι)*splitBlock u v i j r' s'= + (inner ℂ (splitCut u v i r (vacuum u v)) + ((T : Operator ι) (splitCut u v i r' (vacuum u v)))) • + (splitCut u v i s*splitCut u v i s') := + GaussianSplit.residual_covariance (edgeAlgebra u v i) (C u v j) (vacuum u v) + (fresh_C_edge_contraction u v i j hji) (fresh_C_edge_annihilation u v i j hji) + (defectAsEdge u v i) (defectAsEdge_projection u v i) (defectAsEdge_central u v i) + r s r' s' hrs hrs' T + +theorem splitBlock_filled_annihilation (u v : ℝ) (i j : ι) (hji : j≠i) + (r s : Bool) (hrs : ¬(r=true ∧ s=true)) (T : filledEdgeAlgebra u v i j) : + star (splitBlock u v i j r s) ((T : Operator ι) (vacuum u v))=0 := + GaussianSplit.residual_annihilation (edgeAlgebra u v i) (C u v j) (vacuum u v) + (fresh_C_edge_contraction u v i j hji) (fresh_C_edge_annihilation u v i j hji) + (defectAsEdge u v i) (defectAsEdge_projection u v i) (defectAsEdge_central u v i) + r s hrs T + +theorem splitCut_mem_edge (u v : ℝ) (i : ι) (b : Bool) : splitCut u v i b∈edgeAlgebra u v i := + (GaussianSplit.cut (edgeAlgebra u v i) (defectAsEdge u v i) b).property + +theorem splitCut_selfAdjoint (u v : ℝ) (i : ι) (b : Bool) : IsSelfAdjoint (splitCut u v i b) := + congrArg Subtype.val (GaussianSplit.cut_star (edgeAlgebra u v i) (defectAsEdge u v i) + (defectAsEdge_projection u v i) b) + +def splitPair (u v : ℝ) (i j : ι) (r s : Bool) : Operator ι := + splitBlock u v i j r s+star (splitBlock u v i j s r) + +theorem splitPair_eq (u v : ℝ) (i j : ι) (r s : Bool) : + splitPair u v i j r s=splitCut u v i r*S u v j*splitCut u v i s := by + change splitCut u v i r*C u v j*splitCut u v i s+ + star (splitCut u v i s*C u v j*splitCut u v i r)=_ + simp only [S_eq,star_mul,(splitCut_selfAdjoint u v i r).star_eq, + (splitCut_selfAdjoint u v i s).star_eq,mul_add,add_mul,mul_assoc] + +theorem splitPair_mem_ambient (u v : ℝ) (i j : ι) (r s : Bool) : + splitPair u v i j r s∈ambientAlgebra u v := by + rw [splitPair_eq] + exact mul_mem (mul_mem (edgeAlgebra_le_ambient u v i (splitCut_mem_edge u v i r)) + (S_mem_ambient u v j)) (edgeAlgebra_le_ambient u v i (splitCut_mem_edge u v i s)) + +theorem splitPair_reconstruct (u v : ℝ) (i j : ι) : + S u v j=splitPair u v i j false false+splitPair u v i j false true+ + splitPair u v i j true false+splitPair u v i j true true := by + simp only [splitPair_eq] + change S u v j=(1-edgeDefect u v i)*S u v j*(1-edgeDefect u v i)+ + (1-edgeDefect u v i)*S u v j*edgeDefect u v i+ + edgeDefect u v i*S u v j*(1-edgeDefect u v i)+ + edgeDefect u v i*S u v j*edgeDefect u v i + simp only [sub_mul, mul_sub, one_mul, mul_one] + abel + +end + +open FreeFock +variable {ι : Type u_3} [DecidableEq ι] + +def residualLeg (u v : ℝ) (i : ι) : Option Bool → Operator ι + | none => edgeDefect u v i + | some false => edgeRange u v i + | some true => edgePolar u v i + +def residualSupport (u v : ℝ) (i : ι) : Option Bool → Operator ι + | none => edgeDefect u v i + | some _ => edgeRange u v i + +def residualCut : Option Bool → Bool + | none => true + | some _ => false + +theorem residualLeg_mem_edge (u v : ℝ) (i : ι) (r : Option Bool) : + residualLeg u v i r∈edgeAlgebra u v i := by + cases r with + | none => exact edgeDefect_mem_edge u v i + | some r => cases r + · exact edgeRange_mem_edge u v i + · exact edgePolar_mem_edge u v i + +theorem P_mul_residualLeg (u v : ℝ) (i : ι) (r : Option Bool) : + P*residualLeg u v i r=residualLeg u v i r := by + cases r with + | none => exact P_mul_edgeDefect u v i + | some r => cases r + · exact edgeRange_le_P u v i + · exact edgePolar_left u v i + +theorem edgePolar_mul_defect (u v : ℝ) (i : ι) : edgePolar u v i*edgeDefect u v i=0 := by + rw [← P_mul_edgeDefect u v i,← mul_assoc,edgePolar_mul_P,zero_mul] + +theorem edgePolar_mul_range (u v : ℝ) (i : ι) : edgePolar u v i*edgeRange u v i=0 := by + rw [← edgeRange_le_P u v i,← mul_assoc,edgePolar_mul_P,zero_mul] + +theorem defect_mul_star_edgePolar (u v : ℝ) (i : ι) : + edgeDefect u v i*star (edgePolar u v i)=0 := by + simpa only [star_mul,(edgeDefect_projection u v i).isSelfAdjoint.star_eq,star_zero (Operator ι)] + using congrArg star (edgePolar_mul_defect u v i) + +theorem range_mul_star_edgePolar (u v : ℝ) (i : ι) : + edgeRange u v i*star (edgePolar u v i)=0 := by + simpa only [star_mul,(edgeRange_projection u v i).isSelfAdjoint.star_eq,star_zero (Operator ι)] + using congrArg star (edgePolar_mul_range u v i) + +theorem residualLeg_mul_star (u v : ℝ) (i : ι) (r s : Option Bool) : + residualLeg u v i r*star (residualLeg u v i s)= + if r=s then residualSupport u v i r else 0 := by + rcases r with _ | (_ | _) <;> rcases s with _ | (_ | _) + all_goals simp only [residualLeg,residualSupport,Option.some.injEq,Option.some_ne_none, + reduceCtorEq,Bool.false_eq_true,Bool.true_eq_false,ite_true,ite_false] + · rw [(edgeDefect_projection u v i).isSelfAdjoint.star_eq] + exact (edgeDefect_projection u v i).isIdempotentElem.eq + · rw [(edgeRange_projection u v i).isSelfAdjoint.star_eq,defect_mul_edgeRange] + · exact defect_mul_star_edgePolar u v i + · rw [(edgeDefect_projection u v i).isSelfAdjoint.star_eq,edgeRange_mul_defect] + · rw [(edgeRange_projection u v i).isSelfAdjoint.star_eq] + exact (edgeRange_projection u v i).isIdempotentElem.eq + · exact range_mul_star_edgePolar u v i + · rw [(edgeDefect_projection u v i).isSelfAdjoint.star_eq,edgePolar_mul_defect] + · rw [(edgeRange_projection u v i).isSelfAdjoint.star_eq,edgePolar_mul_range] + · rfl + +theorem residualLeg_cut (u v : ℝ) (i : ι) (r : Option Bool) : + residualLeg u v i r*splitCut u v i (residualCut r)=residualLeg u v i r := by + rcases r with _ | (_ | _) + · exact (edgeDefect_projection u v i).isIdempotentElem.eq + · change edgeRange u v i*(1-edgeDefect u v i)=edgeRange u v i + rw [mul_sub,mul_one,edgeRange_mul_defect,sub_zero] + · change edgePolar u v i*(1-edgeDefect u v i)=edgePolar u v i + rw [mul_sub,mul_one,edgePolar_mul_defect,sub_zero] + +theorem cut_star_residualLeg (u v : ℝ) (i : ι) (r : Option Bool) : + splitCut u v i (residualCut r)*star (residualLeg u v i r)=star (residualLeg u v i r) := by + simpa only [star_mul,(splitCut_selfAdjoint u v i (residualCut r)).star_eq] + using congrArg star (residualLeg_cut u v i r) + +theorem residualLeg_trace_covariance (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i : ι) (r s : Option Bool) (T : ambientAlgebra (ι := ι) u v) : + vacuumTrace u v (star (residualLeg u v i r)*(T : Operator ι)*residualLeg u v i s)= + if r=s then vacuumTrace u v ((T : Operator ι)*residualSupport u v i r) else 0 := by + have ht := ambient_trace_mul u v hu hv + ⟨star (residualLeg u v i r),star_mem (edgeAlgebra_le_ambient u v i (residualLeg_mem_edge u v i r))⟩ + (T*⟨residualLeg u v i s,edgeAlgebra_le_ambient u v i (residualLeg_mem_edge u v i s)⟩) + change vacuumTrace u v (star (residualLeg u v i r)*((T : Operator ι)*residualLeg u v i s))= + vacuumTrace u v (((T : Operator ι)*residualLeg u v i s)*star (residualLeg u v i r)) at ht + rw [mul_assoc,ht,mul_assoc,residualLeg_mul_star] + by_cases h : r=s + · subst s; simp only [ite_true] + · simp only [h,Ne.symm h,ite_false,mul_zero,vacuumTrace,zero_apply,inner_zero_right] + +def residualCreation (u v : ℝ) (i j : ι) (r s : Option Bool) : Operator ι := + residualLeg u v i r*C u v j*star (residualLeg u v i s) + +theorem residualCreation_split (u v : ℝ) (i j : ι) (r s : Option Bool) : + residualCreation u v i j r s= + residualLeg u v i r*splitBlock u v i j (residualCut r) (residualCut s)*star (residualLeg u v i s) := by + change _=residualLeg u v i r*(splitCut u v i (residualCut r)*C u v j* + splitCut u v i (residualCut s))*star (residualLeg u v i s) + simp only [mul_assoc] + rw [cut_star_residualLeg] + rw [← mul_assoc, residualLeg_cut] + rfl + +theorem residual_allowed (r s : Option Bool) (h : ¬(r=none ∧ s=none)) : + ¬(residualCut r=true ∧ residualCut s=true) := by + rcases r with _ | (_ | _) <;> rcases s with _ | (_ | _) <;> simp_all [residualCut] + +theorem residualCreation_filled_covariance (u v : ℝ) (hu : u≠0) (hv : v≠0) + (i j : ι) (hji : j≠i) (r s r' s' : Option Bool) + (hrs : ¬(r=none ∧ s=none)) (hrs' : ¬(r'=none ∧ s'=none)) + (T : filledEdgeAlgebra u v i j) : + star (residualCreation u v i j r s)*(T : Operator ι)*residualCreation u v i j r' s'= + if r=r' ∧ s=s' then + vacuumTrace u v ((T : Operator ι)*residualSupport u v i r) • residualSupport u v i s else 0 := by + let a (t : Option Bool) : filledEdgeAlgebra u v i j := + ⟨residualLeg u v i t,edgeAlgebra_le_filled u v i j (residualLeg_mem_edge u v i t)⟩ + have hc := splitBlock_filled_covariance u v i j hji (residualCut r) (residualCut s) + (residualCut r') (residualCut s') (residual_allowed r s hrs) (residual_allowed r' s' hrs') + (star (a r)*T*a r') + have hi : inner ℂ (splitCut u v i (residualCut r) (vacuum u v)) + (((star (a r)*T*a r' : filledEdgeAlgebra u v i j) : Operator ι) + (splitCut u v i (residualCut r') (vacuum u v)))= + vacuumTrace u v (star (residualLeg u v i r)*(T : Operator ι)*residualLeg u v i r') := by + rw [← ContinuousLinearMap.adjoint_inner_right] + change inner ℂ (vacuum u v) ((star (splitCut u v i (residualCut r))* + (star (residualLeg u v i r)*(T : Operator ι)*residualLeg u v i r')* + splitCut u v i (residualCut r')) (vacuum u v))=_ + rw [(splitCut_selfAdjoint u v i (residualCut r)).star_eq] + simp only [← mul_assoc,cut_star_residualLeg] + rw [mul_assoc _ _ (splitCut u v i (residualCut r')),residualLeg_cut] + rfl + rw [hi] at hc + calc + _ = residualLeg u v i s*(star (splitBlock u v i j (residualCut r) (residualCut s))* + (star (residualLeg u v i r)*(T : Operator ι)*residualLeg u v i r')* + splitBlock u v i j (residualCut r') (residualCut s'))*star (residualLeg u v i s') := by + rw [residualCreation_split,residualCreation_split] + simp only [star_mul,star_star,mul_assoc] + _ = _ := by + change (residualLeg u v i s*(star (splitBlock u v i j (residualCut r) (residualCut s))* + ((star (a r)*T*a r' : filledEdgeAlgebra u v i j) : Operator ι)* + splitBlock u v i j (residualCut r') (residualCut s'))*star (residualLeg u v i s'))=_ + rw [hc,mul_smul_comm,smul_mul_assoc] + rw [← mul_assoc,mul_assoc _ (splitCut u v i (residualCut s')), + cut_star_residualLeg,residualLeg_cut,residualLeg_mul_star] + rw [residualLeg_trace_covariance u v hu hv i r r' + ⟨T,filledEdgeAlgebra_le_ambient u v i j T.property⟩] + by_cases hr : r=r' <;> by_cases hs : s=s' <;> + simp only [hr,hs,ite_true,ite_false,zero_smul ℂ (A := Operator ι), + smul_zero (M := ℂ) (A := Operator ι),true_and,false_and,and_false] + +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Stabilization.lean b/lean/OAI/Analysis/InterpolatedFactors/Stabilization.lean new file mode 100644 index 0000000000000000000000000000000000000000..7a8ddb40b64706b5abda717990f2cc9806249605 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Stabilization.lean @@ -0,0 +1,644 @@ +import OAI.Analysis.InterpolatedFactors.Subalgebras + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 u_10 u_11 u_12 +universe u_13 u_14 u_15 u_16 u_17 u_18 u_19 u_20 u_21 u_22 u_23 u_24 +universe u_25 u_26 u_27 u_28 u_29 u_30 u_31 + +namespace FreeGroupFactorMain +namespace InfiniteICC + + theorem reduced_append_fresh {α : Type u_1} {L : List (α × Bool)} (hL : FreeGroup.IsReduced L) + (a : α) (b : Bool) (ha : ∀ x ∈ L, x.1 ≠ a) : FreeGroup.IsReduced (L++[(a,b)]) := by + induction L with + | nil => exact FreeGroup.IsReduced.singleton + | cons x L ih => + cases L with + | nil => + rw [List.cons_append,List.nil_append,FreeGroup.isReduced_cons_cons] + exact ⟨fun he => (ha x (by simp) he).elim,FreeGroup.IsReduced.singleton⟩ + | cons y L => + rw [FreeGroup.isReduced_cons_cons] at hL + simp only [List.cons_append] + rw [FreeGroup.isReduced_cons_cons] + exact ⟨hL.1,ih hL.2 (fun z hz => ha z (List.mem_cons_of_mem _ hz))⟩ + + theorem reduced_conjugate_fresh {α : Type u_2} {L : List (α × Bool)} (hL : FreeGroup.IsReduced L) + (hne : L ≠ []) (a : α) (ha : ∀ x ∈ L, x.1 ≠ a) : + FreeGroup.IsReduced ((a,true)::(L++[(a,false)])) := by + cases L with + | nil => exact (hne rfl).elim + | cons x L => + rw [List.cons_append,FreeGroup.isReduced_cons_cons] + refine ⟨fun he => (ha x (by simp) he.symm).elim,?_⟩ + exact reduced_append_fresh hL a false ha + + theorem conjugate_word (g : FreeGroup ℕ) (hg : g ≠ 1) (a : ℕ) + (ha : ∀ x ∈ g.toWord, x.1 ≠ a) : + (FreeGroup.of a*g*(FreeGroup.of a)⁻¹).toWord= + (a,true)::(g.toWord++[(a,false)]) := by + have he : FreeGroup.of a*g*(FreeGroup.of a)⁻¹ = + FreeGroup.mk ((a,true)::(g.toWord++[(a,false)])) := by + rw [← List.singleton_append,← List.append_assoc,← FreeGroup.mul_mk,← FreeGroup.mul_mk, + FreeGroup.mk_toWord] + rfl + rw [he,FreeGroup.toWord_mk] + exact (reduced_conjugate_fresh FreeGroup.isReduced_toWord (FreeGroup.toWord_eq_nil_iff.not.mpr hg) a ha).reduce_eq + + theorem infinite_conjugates (g : FreeGroup ℕ) (hg : g ≠ 1) : + ∃ c : ℕ → FreeGroup ℕ, Function.Injective c ∧ ∀ n, ∃ a, c n=a*g*a⁻¹ := by + classical + let S : Finset ℕ := (g.toWord.map Prod.fst).toFinset + let M := S.sup id + let a (n : ℕ) := M+1+n + have hfresh (n : ℕ) (x) (hx : x ∈ g.toWord) : x.1 ≠ a n := by + have hm : x.1 ≤ M := Finset.le_sup (f := id) (by simpa only [S,List.mem_toFinset,List.mem_map] using ⟨x,hx,rfl⟩) + dsimp [a] + omega + refine ⟨fun n => FreeGroup.of (a n)*g*(FreeGroup.of (a n))⁻¹,?_,fun n => ⟨FreeGroup.of (a n),rfl⟩⟩ + intro m n h + have hw := congrArg FreeGroup.toWord h + rw [conjugate_word g hg (a m) (hfresh m),conjugate_word g hg (a n) (hfresh n)] at hw + have he : a m=a n := congrArg Prod.fst (List.cons.inj hw).1 + dsimp [a] at he + omega + +end InfiniteICC + + theorem central_coefficient_conjugate {G : Type u_3} [Group G] [DecidableEq G] + (T : groupVonNeumann G) (hT : ∀ S : groupVonNeumann G, Commute T S) (a g : G) : + ((T : GroupOperator G) deltaOne) (a*g*a⁻¹)=((T : GroupOperator G) deltaOne) g := by + have he : (T : GroupOperator G)*leftRegular a=leftRegular a*(T : GroupOperator G) := + congrArg (fun A : groupVonNeumann G => (A : GroupOperator G)) (hT (groupUnitary a)).eq + have hd : leftRegular a deltaOne=lp.single 2 a 1 := by + ext x + simp [leftRegular_apply,deltaOne,lp.single_apply,Pi.single_apply,inv_mul_eq_one,eq_comm] + have hx := congrArg (fun A : GroupOperator G => A deltaOne (a*g)) he + simp only [mul_apply_eq_comp,hd,leftRegular_apply,inv_mul_cancel_left] at hx + rw [groupVN_matrix] at hx + exact hx + + theorem group_center_scalar_of_infinite_conjugates {G : Type u_4} [Group G] + (hICC : ∀ g : G, g ≠ 1 → ∃ c : ℕ → G, Function.Injective c ∧ ∀ n, ∃ a, c n=a*g*a⁻¹) + (T : groupVonNeumann G) (hT : ∀ S : groupVonNeumann G, Commute T S) : + T=canonicalTrace T • (1 : groupVonNeumann G) := by + classical + have hz (g : G) (hg : g ≠ 1) : ((T : GroupOperator G) deltaOne) g=0 := by + obtain ⟨c,hc,hconj⟩ := hICC g hg + have hs : Summable (fun x : G => ‖((T : GroupOperator G) deltaOne) x‖^2) := by + simpa only [ENNReal.toReal_ofNat,Real.rpow_two] using + (lp.memℓp ((T : GroupOperator G) deltaOne)).summable (by norm_num) + have hcst : Summable (fun _ : ℕ => ‖((T : GroupOperator G) deltaOne) g‖^2) := by + have hh := hs.comp_injective hc + change Summable (fun n : ℕ => ‖((T : GroupOperator G) deltaOne) (c n)‖^2) at hh + have he : (fun n : ℕ => ‖((T : GroupOperator G) deltaOne) (c n)‖^2) = + (fun _ : ℕ => ‖((T : GroupOperator G) deltaOne) g‖^2) := by + funext n + obtain ⟨a,ha⟩ := hconj n + rw [ha,central_coefficient_conjugate T hT] + rwa [he] at hh + have hh := (summable_const_iff _).mp hcst + exact norm_eq_zero.mp (by nlinarith [norm_nonneg (((T : GroupOperator G) deltaOne) g)]) + apply sub_eq_zero.mp + apply groupVN_separating + rw [← deltaOne_eq] + ext g + change ((T : GroupOperator G) deltaOne) g-canonicalTrace T*deltaOne g=(0 : ℂ) + by_cases hg : g=1 + · subst g + simp only [deltaOne,lp.single_apply,Pi.single_eq_same,mul_one,canonicalTrace] + exact sub_self _ + · rw [hz g hg] + simp [deltaOne,lp.single_apply,hg] + + theorem infinite_free_group_center_scalar (T : groupVonNeumann (FreeGroup ℕ)) + (hT : ∀ S : groupVonNeumann (FreeGroup ℕ), Commute T S) : + T=canonicalTrace T • (1 : groupVonNeumann (FreeGroup ℕ)) := + group_center_scalar_of_infinite_conjugates InfiniteICC.infinite_conjugates T hT + +end FreeGroupFactorMain + +namespace FreeGroupFactorMain.Amplification + +section +variable {A : Type u_9} [CStarAlgebra A] + +def equivalentCorner (p q : A) (hp : IsStarProjection p) (hq : IsStarProjection q) + (u : A) (hu : star u*u=p) (hu' : u*star u=q) : Corner p hp ≃⋆ₐ[ℂ] Corner q hq where + toFun x := ⟨u*(x : A)*star u,by + constructor + · rw [← hu'] + calc + (u*star u)*(u*(x : A)*star u) = u*((star u*u)*(x : A))*star u := by noncomm_ring + _ = u*(x : A)*star u := by rw [hu,x.property.1] + · rw [← hu'] + calc + (u*(x : A)*star u)*(u*star u) = u*((x : A)*(star u*u))*star u := by noncomm_ring + _ = u*(x : A)*star u := by rw [hu,x.property.2]⟩ + invFun y := ⟨star u*(y : A)*u,by + constructor + · rw [← hu] + calc + (star u*u)*(star u*(y : A)*u) = star u*((u*star u)*(y : A))*u := by noncomm_ring + _ = star u*(y : A)*u := by rw [hu',y.property.1] + · rw [← hu] + calc + (star u*(y : A)*u)*(star u*u) = star u*((y : A)*(u*star u))*u := by noncomm_ring + _ = star u*(y : A)*u := by rw [hu',y.property.2]⟩ + left_inv x := by + apply Subtype.ext + change star u*(u*(x : A)*star u)*u = (x : A) + rw [← mul_assoc,← mul_assoc,hu,x.property.1,mul_assoc,hu,x.property.2] + right_inv y := by + apply Subtype.ext + change u*(star u*(y : A)*u)*star u = (y : A) + rw [← mul_assoc,← mul_assoc,hu',y.property.1,mul_assoc,hu',y.property.2] + map_mul' x y := by + apply Subtype.ext + change u*((x : A)*(y : A))*star u = (u*(x : A)*star u)*(u*(y : A)*star u) + simp only [mul_assoc] + rw [← mul_assoc (star u),hu,← mul_assoc p,y.property.1] + map_add' x y := by + apply Subtype.ext + change u*((x : A)+(y : A))*star u = _ + simp only [mul_add,add_mul] + rfl + map_smul' z x := by + apply Subtype.ext + change u*(z • (x : A))*star u = _ + simp only [mul_smul_comm,smul_mul_assoc] + rfl + map_star' x := by + apply Subtype.ext + change u*star (x : A)*star u = star (u*(x : A)*star u) + simp only [star_mul,star_star,mul_assoc] + + theorem equivalentCorner_trace (p q : A) (hp : IsStarProjection p) (hq : IsStarProjection q) + (u : A) (hu : star u*u=p) (hu' : u*star u=q) + (τ : A → ℂ) (hτ : ∀ x y, τ (x*y)=τ (y*x)) (t : ℝ) (x : Corner p hp) : + normalizedCornerTrace τ t q hq (equivalentCorner p q hp hq u hu hu' x) = + normalizedCornerTrace τ t p hp x := by + change (t : ℂ)⁻¹ * τ (u*(x : A)*star u) = (t : ℂ)⁻¹ * τ (x : A) + rw [hτ,← mul_assoc,hu,x.property.1] + + theorem equivalentCorner_normal (p q : A) (hp : IsStarProjection p) (hq : IsStarProjection q) + (u : A) (hu : star u*u=p) (hu' : u*star u=q) + (𝒯 : TopologicalSpace A) + (hmul : @Continuous _ _ 𝒯 𝒯 (fun x : A => u*x*star u)) : + @Continuous _ _ (cornerTopology 𝒯 p hp) (cornerTopology 𝒯 q hq) + (equivalentCorner p q hp hq u hu hu') := by + let : TopologicalSpace A := 𝒯 + let : TopologicalSpace (Corner p hp) := cornerTopology 𝒯 p hp + let : TopologicalSpace (Corner q hq) := cornerTopology 𝒯 q hq + exact (hmul.comp continuous_subtype_val).subtype_mk _ + +end +section +open scoped ENNReal ComplexConjugate +local instance (α : Type u_10) : DecidableEq α := Classical.decEq α + +variable {I : Type u_11} {J : Type u_12} +end +section +open scoped ENNReal + +local instance (α : Type u_13) : DecidableEq α := Classical.decEq α +variable {I : Type u_14} {J : Type u_15} + +def contractionFamilyValue (A : I → GroupOperator J) (hA : ∀ i, ‖A i‖ ≤ 1) + (ξ : NestedHilbert I J) : NestedHilbert I J := + ⟨fun i => A i (ξ i),(lp.memℓp ξ).norm.mono (fun i => + ((A i).le_opNorm (ξ i)).trans (by simpa using mul_le_mul_of_nonneg_right (hA i) (norm_nonneg (ξ i))))⟩ + +theorem contractionFamilyValue_norm_le (A : I → GroupOperator J) (hA : ∀ i, ‖A i‖ ≤ 1) + (ξ : NestedHilbert I J) : ‖contractionFamilyValue A hA ξ‖ ≤ ‖ξ‖ := by + apply lp.norm_mono (by norm_num : (2 : ℝ≥0∞) ≠ 0) + intro i + exact ((A i).le_opNorm (ξ i)).trans (by simpa using mul_le_mul_of_nonneg_right (hA i) (norm_nonneg (ξ i))) + +def contractionFamily (A : I → GroupOperator J) (hA : ∀ i, ‖A i‖ ≤ 1) : + NestedHilbert I J →L[ℂ] NestedHilbert I J := + LinearMap.mkContinuous + { toFun := contractionFamilyValue A hA + map_add' := fun ξ η => by ext i j; exact congrArg (fun v : GroupHilbert J => v j) (map_add (A i) (ξ i) (η i)) + map_smul' := fun z ξ => by ext i j; exact congrArg (fun v : GroupHilbert J => v j) (map_smul (A i) z (ξ i)) } + 1 (fun ξ => by simpa using contractionFamilyValue_norm_le A hA ξ) + +@[simp] theorem contractionFamily_apply (A : I → GroupOperator J) (hA : ∀ i, ‖A i‖ ≤ 1) + (ξ : NestedHilbert I J) (i : I) : contractionFamily A hA ξ i = A i (ξ i) := rfl + +theorem contractionFamily_star (A : I → GroupOperator J) (hA : ∀ i, ‖A i‖ ≤ 1) : + contractionFamily (fun i => star (A i)) (by intro i; exact (norm_star (A i)).le.trans (hA i)) = + star (contractionFamily A hA) := by + apply ContinuousLinearMap.ext + intro ξ + apply ext_inner_right ℂ + intro η + change inner ℂ (contractionFamily (fun i => star (A i)) _ ξ) η = + inner ℂ ((ContinuousLinearMap.adjoint (contractionFamily A hA)) ξ) η + rw [ContinuousLinearMap.adjoint_inner_left] + simp only [lp.inner_eq_tsum,contractionFamily_apply] + apply tsum_congr + intro i + simpa only [ContinuousLinearMap.star_eq_adjoint,lp.inner_eq_tsum] using + ContinuousLinearMap.adjoint_inner_left (A i) (η i) (ξ i) + +theorem contractionFamily_projection (A : I → GroupOperator J) (hA : ∀ i, ‖A i‖ ≤ 1) + (hp : ∀ i, IsStarProjection (A i)) : IsStarProjection (contractionFamily A hA) := by + constructor + · apply ContinuousLinearMap.ext + intro ξ + ext i j + change (A i) (A i (ξ i)) j = A i (ξ i) j + exact congrArg (fun B : GroupOperator J => B (ξ i) j) (hp i).isIdempotentElem.eq + · change star (contractionFamily A hA) = contractionFamily A hA + rw [← contractionFamily_star] + congr 1 + funext i + exact (hp i).isSelfAdjoint.star_eq + +def productFamily (A : I → GroupOperator J) (hA : ∀ i, ‖A i‖ ≤ 1) : GroupOperator (I × J) := + (hilbertFlatten I J).conjStarAlgEquiv (contractionFamily A hA) + +@[simp] theorem productFamily_apply (A : I → GroupOperator J) (hA : ∀ i, ‖A i‖ ≤ 1) + (ξ : GroupHilbert (I × J)) (i : I) (j : J) : + productFamily A hA ξ (i,j) = A i ((hilbertFlatten I J).symm ξ i) j := by + change hilbertFlatten I J (contractionFamily A hA ((hilbertFlatten I J).symm ξ)) (i,j) = _ + rw [hilbertFlatten_apply,contractionFamily_apply] + +theorem productFamily_projection (A : I → GroupOperator J) (hA : ∀ i, ‖A i‖ ≤ 1) + (hp : ∀ i, IsStarProjection (A i)) : IsStarProjection (productFamily A hA) := + (contractionFamily_projection A hA hp).map (hilbertFlatten I J).conjStarAlgEquiv + +variable {G : Type u_16} [Group G] + +theorem productFamily_mem_stabilization (A : ℕ → groupVonNeumann G) + (hA : ∀ i, ‖(A i : GroupOperator G)‖ ≤ 1) : + productFamily (fun i => (A i : GroupOperator G)) hA ∈ stabilization G := by + rw [stabilization,StarSubalgebra.mem_centralizer_iff,stabilizedRightTranslations_eq_range] + intro S hS + obtain ⟨g,rfl⟩ := hS + have hc (g : G) : productAmplification ℕ G (rightRegular g) * + productFamily (fun i => (A i : GroupOperator G)) hA = + productFamily (fun i => (A i : GroupOperator G)) hA * + productAmplification ℕ G (rightRegular g) := by + apply ContinuousLinearMap.ext + intro ξ + ext x + rcases x with ⟨i,j⟩ + simp only [mul_apply_eq_comp,productAmplification_apply,productFamily_apply, + rightRegular_apply,hilbertFlatten_symm_apply] + have he : (hilbertFlatten ℕ G).symm (productAmplification ℕ G (rightRegular g) ξ) i = + rightRegular g ((hilbertFlatten ℕ G).symm ξ i) := by + ext k + simp only [productAmplification_apply,hilbertFlatten_symm_apply,rightRegular_apply] + rw [he] + simpa only [mul_apply_eq_comp,rightRegular_apply] using congrArg + (fun B : GroupOperator G => B ((hilbertFlatten ℕ G).symm ξ i) j) + (groupVN_commute_right (A i) g) + constructor + · exact hc g + · rw [← map_star,rightRegular_star] + exact hc g⁻¹ + +end +section +open scoped ENNReal +variable {I : Type u_17} {J : Type u_18} + +def productSingle (I : Type u_19) (J : Type u_20) (j : I) : GroupHilbert J →L[ℂ] GroupHilbert (I × J) := by + classical + exact (hilbertFlatten I J).toContinuousLinearEquiv.toContinuousLinearMap.comp + (lp.singleContinuousLinearMap ℂ (fun _ : I => GroupHilbert J) 2 j) + +@[simp] theorem productSingle_apply [DecidableEq I] (j i : I) (ξ : GroupHilbert J) (k : J) : + productSingle I J j ξ (i,k) = if i = j then ξ k else 0 := by + classical + by_cases hi : i = j <;> simp [productSingle,hilbertFlatten_apply,lp.single_apply,hi] + +def matrixEntry (T : GroupOperator (I × J)) (i j : I) : GroupOperator J := + (lp.evalCLM ℂ (fun _ : I => GroupHilbert J) 2 i).comp + ((hilbertFlatten I J).symm.toContinuousLinearEquiv.toContinuousLinearMap.comp + (T.comp (productSingle I J j))) + +@[simp] theorem matrixEntry_apply (T : GroupOperator (I × J)) (i j : I) + (ξ : GroupHilbert J) (k : J) : + matrixEntry T i j ξ k = T (productSingle I J j ξ) (i,k) := by + exact hilbertFlatten_symm_apply _ _ _ + +theorem productSingle_single [DecidableEq I] [DecidableEq J] [DecidableEq (I × J)] + (j : I) (g : J) : productSingle I J j (lp.single 2 g 1) = lp.single 2 (j,g) 1 := by + classical + ext x + rcases x with ⟨i,k⟩ + simp only [productSingle_apply,lp.single_apply,Pi.single_apply,Prod.mk.injEq] + split_ifs <;> simp_all + +theorem matrixEntry_ext (T U : GroupOperator (I × J)) + (h : ∀ i j, matrixEntry T i j = matrixEntry U i j) : T = U := by + classical + apply operator_matrix_ext + intro x + rcases x with ⟨j,g⟩ + rw [← productSingle_single] + ext y + rcases y with ⟨i,k⟩ + simpa only [matrixEntry_apply] using congrArg (fun A : GroupOperator J => A (lp.single 2 g 1) k) (h i j) + +theorem productAmplification_productSingle (S : GroupOperator J) (j : I) (ξ : GroupHilbert J) : + productAmplification I J S (productSingle I J j ξ) = productSingle I J j (S ξ) := by + classical + ext x + rcases x with ⟨i,k⟩ + rw [productAmplification_apply,productSingle_apply] + have he : (hilbertFlatten I J).symm (productSingle I J j ξ) i = if i=j then ξ else 0 := by + ext l + simp only [hilbertFlatten_symm_apply,productSingle_apply] + split_ifs <;> rfl + rw [he] + split_ifs <;> simp + +theorem matrixEntry_diagonal_mul (S : GroupOperator J) (T : GroupOperator (I × J)) (i j : I) : + matrixEntry (productAmplification I J S * T) i j = S * matrixEntry T i j := by + apply ContinuousLinearMap.ext + intro ξ + ext k + simp only [matrixEntry_apply,mul_apply_eq_comp,productAmplification_apply] + rfl + +theorem matrixEntry_mul_diagonal (S : GroupOperator J) (T : GroupOperator (I × J)) (i j : I) : + matrixEntry (T * productAmplification I J S) i j = matrixEntry T i j * S := by + apply ContinuousLinearMap.ext + intro ξ + ext k + simp only [matrixEntry_apply,mul_apply_eq_comp,productAmplification_productSingle] + +variable {G : Type u_21} [Group G] + +theorem mem_stabilization_iff_matrix (T : GroupOperator (ℕ × G)) : + T ∈ stabilization G ↔ ∀ i j, matrixEntry T i j ∈ groupVonNeumann G := by + rw [stabilization,StarSubalgebra.mem_centralizer_iff,stabilizedRightTranslations_eq_range] + constructor + · intro h i j + rw [mem_groupVN_iff_commute_right] + intro g + have hh := (h _ ⟨g,rfl⟩).1 + have he := congrArg (fun A => matrixEntry A i j) hh + simpa only [matrixEntry_diagonal_mul,matrixEntry_mul_diagonal] using he + · intro h S hS + obtain ⟨g,rfl⟩ := hS + have hc (g : G) : productAmplification ℕ G (rightRegular g) * T = + T * productAmplification ℕ G (rightRegular g) := by + apply matrixEntry_ext + intro i j + rw [matrixEntry_diagonal_mul,matrixEntry_mul_diagonal] + exact (mem_groupVN_iff_commute_right _).mp (h i j) g + exact ⟨hc g,by rw [← map_star,rightRegular_star]; exact hc g⁻¹⟩ + +end +section +variable {I : Type u_22} {J : Type u_23} + + def productCoordinate (I : Type u_24) (J : Type u_25) (i : I) : GroupHilbert (I × J) →L[ℂ] GroupHilbert J := + (lp.evalCLM ℂ (fun _ : I => GroupHilbert J) 2 i).comp + (hilbertFlatten I J).symm.toContinuousLinearEquiv.toContinuousLinearMap + + theorem productCoordinate_apply (i : I) (ξ : GroupHilbert (I × J)) (j : J) : + productCoordinate I J i ξ j=ξ (i,j) := hilbertFlatten_symm_apply _ _ _ + + def matrixUnit (I : Type u_26) (J : Type u_27) (i j : I) : GroupOperator (I × J) := + (productSingle I J i).comp (productCoordinate I J j) + + theorem matrixUnit_apply [DecidableEq I] (i j k : I) (ξ : GroupHilbert (I × J)) (g : J) : + matrixUnit I J i j ξ (k,g)=if k=i then ξ (j,g) else 0 := by + simp only [matrixUnit,ContinuousLinearMap.comp_apply,productSingle_apply,productCoordinate_apply] + + theorem matrixUnit_productSingle [DecidableEq I] (i j l : I) (ξ : GroupHilbert J) : + matrixUnit I J i j (productSingle I J l ξ)=if j=l then productSingle I J i ξ else 0 := by + by_cases h : j=l + · subst l + rw [ite_eq_left rfl] + ext x + rcases x with ⟨k,g⟩ + simp only [matrixUnit_apply,productSingle_apply,ite_true] + · rw [ite_eq_right h] + ext x + rcases x with ⟨k,g⟩ + simp only [matrixUnit_apply,productSingle_apply,ite_eq_right h,ite_self,lp.coeFn_zero,Pi.zero_apply] + + theorem matrixEntry_matrixUnit_mul [DecidableEq I] (i j k l : I) (T : GroupOperator (I × J)) : + matrixEntry (matrixUnit I J i j*T) k l=if k=i then matrixEntry T j l else 0 := by + apply ContinuousLinearMap.ext + intro ξ + ext g + simp only [matrixEntry_apply,mul_apply_eq_comp,matrixUnit_apply] + split_ifs <;> simp only [matrixEntry_apply,zero_apply,lp.coeFn_zero,Pi.zero_apply] + + theorem matrixEntry_mul_matrixUnit [DecidableEq I] (i j k l : I) (T : GroupOperator (I × J)) : + matrixEntry (T*matrixUnit I J i j) k l=if j=l then matrixEntry T k i else 0 := by + apply ContinuousLinearMap.ext + intro ξ + ext g + simp only [matrixEntry_apply,mul_apply_eq_comp,matrixUnit_productSingle] + split_ifs <;> simp + + theorem matrixEntry_matrixUnit [DecidableEq I] (i j k l : I) : + matrixEntry (matrixUnit I J i j) k l=if k=i ∧ j=l then 1 else 0 := by + apply ContinuousLinearMap.ext + intro ξ + ext g + simp only [matrixEntry_apply,matrixUnit_apply,productSingle_apply] + split_ifs <;> simp_all + + theorem matrixEntry_productAmplification [DecidableEq I] (S : GroupOperator J) (i j : I) : + matrixEntry (productAmplification I J S) i j=if i=j then S else 0 := by + apply ContinuousLinearMap.ext + intro ξ + ext g + rw [matrixEntry_apply,productAmplification_productSingle,productSingle_apply] + split_ifs <;> rfl + + variable {G : Type u_28} [Group G] + + theorem matrixUnit_mem_stabilization (i j : ℕ) : matrixUnit ℕ G i j ∈ stabilization G := by + rw [mem_stabilization_iff_matrix] + intro k l + rw [matrixEntry_matrixUnit] + split_ifs + · exact one_mem _ + · exact zero_mem _ + + theorem diagonal_mem_stabilization (S : groupVonNeumann G) : + productAmplification ℕ G (S : GroupOperator G) ∈ stabilization G := by + rw [mem_stabilization_iff_matrix] + intro k l + rw [matrixEntry_productAmplification] + split_ifs + · exact S.property + · exact zero_mem _ + + theorem stabilization_center_diagonal (T : stabilization G) + (hc : ∀ S : stabilization G, Commute T S) : + (T : GroupOperator (ℕ × G))=productAmplification ℕ G (matrixEntry (T : GroupOperator (ℕ × G)) 0 0) := by + have hm (i j : ℕ) : (T : GroupOperator (ℕ × G))*matrixUnit ℕ G i j= + matrixUnit ℕ G i j*(T : GroupOperator (ℕ × G)) := + congrArg (fun A : stabilization G => (A : GroupOperator (ℕ × G))) (hc ⟨_,matrixUnit_mem_stabilization i j⟩).eq + have hoff (i j : ℕ) (hij : i ≠ j) : matrixEntry (T : GroupOperator (ℕ × G)) i j=0 := by + have he := congrArg (fun A => matrixEntry A i j) (hm j j) + simpa only [matrixEntry_mul_matrixUnit,matrixEntry_matrixUnit_mul,ite_true,ite_eq_right hij] using he + have hdiag (i : ℕ) : matrixEntry (T : GroupOperator (ℕ × G)) i i=matrixEntry (T : GroupOperator (ℕ × G)) 0 0 := by + have he := congrArg (fun A => matrixEntry A i 0) (hm i 0) + simpa only [matrixEntry_mul_matrixUnit,matrixEntry_matrixUnit_mul,ite_true] using he + apply matrixEntry_ext + intro i j + rw [matrixEntry_productAmplification] + split_ifs with hij + · subst j + exact hdiag i + · exact hoff i j hij + + theorem stabilization_center_scalar + (hbase : ∀ T : groupVonNeumann G, (∀ S : groupVonNeumann G, Commute T S) → + ∃ c : ℂ, T=c • (1 : groupVonNeumann G)) + (T : stabilization G) (hc : ∀ S : stabilization G, Commute T S) : + ∃ c : ℂ, (T : GroupOperator (ℕ × G))=c • (1 : GroupOperator (ℕ × G)) := by + let A : groupVonNeumann G := ⟨matrixEntry (T : GroupOperator (ℕ × G)) 0 0, + (mem_stabilization_iff_matrix _).mp T.property 0 0⟩ + have hA : ∀ S : groupVonNeumann G, Commute A S := by + intro S + apply Subtype.ext + have he := congrArg (fun U : stabilization G => matrixEntry (U : GroupOperator (ℕ × G)) 0 0) + (hc ⟨_,diagonal_mem_stabilization S⟩).eq + change matrixEntry ((T : GroupOperator (ℕ × G))*productAmplification ℕ G (S : GroupOperator G)) 0 0= + matrixEntry (productAmplification ℕ G (S : GroupOperator G)*(T : GroupOperator (ℕ × G))) 0 0 at he + change matrixEntry (T : GroupOperator (ℕ × G)) 0 0*(S : GroupOperator G)= + (S : GroupOperator G)*matrixEntry (T : GroupOperator (ℕ × G)) 0 0 + simpa only [matrixEntry_mul_diagonal,matrixEntry_diagonal_mul] using he + obtain ⟨c,hcA⟩ := hbase A hA + refine ⟨c,?_⟩ + rw [stabilization_center_diagonal T hc] + have he : matrixEntry (T : GroupOperator (ℕ × G)) 0 0=c • (1 : GroupOperator G) := + congrArg (fun U : groupVonNeumann G => (U : GroupOperator G)) hcA + rw [he,map_smul,map_one] + + theorem stabilization_center_projection + (hbase : ∀ T : groupVonNeumann G, (∀ S : groupVonNeumann G, Commute T S) → + ∃ c : ℂ, T=c • (1 : groupVonNeumann G)) + (P : GroupOperator (ℕ × G)) (hP : P ∈ stabilization G) (hp : IsStarProjection P) + (hc : ∀ S ∈ stabilization G, Commute P S) : P=0 ∨ P=1 := by + classical + have hc' : ∀ S : stabilization G, Commute (⟨P,hP⟩ : stabilization G) S := + fun S => Subtype.ext (hc S S.property).eq + obtain ⟨c,he⟩ := stabilization_center_scalar hbase ⟨P,hP⟩ hc' + change P=c • (1 : GroupOperator (ℕ × G)) at he + have hh := congrArg (fun A : GroupOperator (ℕ × G) => A (lp.single 2 (0,1) (1 : ℂ)) (0,1)) hp.isIdempotentElem + rw [he] at hh + have hcc : c*c=c := by + change c*(c*(lp.single 2 (0,1) (1 : ℂ) : GroupHilbert (ℕ × G)) (0,1))= + c*(lp.single 2 (0,1) (1 : ℂ) : GroupHilbert (ℕ × G)) (0,1) at hh + simpa only [lp.single_apply,Pi.single_eq_same,mul_one] using hh + have hzero : c*(c-1)=0 := by linear_combination hcc + rcases mul_eq_zero.mp hzero with hz|ho + · left + simpa only [hz,zero_smul ℂ (A := GroupOperator (ℕ × G))] using he + · right + have ho : c=1 := sub_eq_zero.mp ho + simpa only [ho,one_smul] using he + + theorem infinite_stabilization_center_projection (P : GroupOperator (ℕ × FreeGroup ℕ)) + (hP : P ∈ stabilization (FreeGroup ℕ)) (hp : IsStarProjection P) + (hc : ∀ S ∈ stabilization (FreeGroup ℕ), Commute P S) : P=0 ∨ P=1 := + stabilization_center_projection (fun T hT => ⟨canonicalTrace T,infinite_free_group_center_scalar T hT⟩) P hP hp hc + +end +open scoped ENNReal +variable {I : Type u_29} {J : Type u_30} + + theorem hilbert_ofReal_norm_sq (ξ : lp (fun _ : I => GroupHilbert J) 2) : + ENNReal.ofReal (‖ξ‖^2)=∑' i, ENNReal.ofReal (‖ξ i‖^2) := by + have hs : HasSum (fun i => ‖ξ i‖^2) (‖ξ‖^2) := by + simpa only [ENNReal.toReal_ofNat,Real.rpow_two] using lp.hasSum_norm (by norm_num : (0:ℝ)<(2:ℝ≥0∞).toReal) ξ + rw [← hs.tsum_eq,ENNReal.ofReal_tsum_of_nonneg (fun i => sq_nonneg _) hs.summable] + + theorem productSingle_inner_right (i : I) (ξ : GroupHilbert (I × J)) (η : GroupHilbert J) : + inner ℂ ξ (productSingle I J i η)=inner ℂ (productCoordinate I J i ξ) η := by + classical + change inner ℂ ξ ((hilbertFlatten I J) (lp.single 2 i η))= + inner ℂ (((hilbertFlatten I J).symm ξ) i) η + have he := (hilbertFlatten I J).inner_map_map ((hilbertFlatten I J).symm ξ) (lp.single 2 i η) + simpa only [LinearIsometryEquiv.apply_symm_apply,lp.inner_single_right] using he + + theorem productSingle_inner_left (i : I) (ξ : GroupHilbert (I × J)) (η : GroupHilbert J) : + inner ℂ (productSingle I J i η) ξ=inner ℂ η (productCoordinate I J i ξ) := by + have he := congrArg (star : ℂ → ℂ) (productSingle_inner_right i ξ η) + change (starRingEnd ℂ) (inner ℂ ξ (productSingle I J i η))= + (starRingEnd ℂ) (inner ℂ (productCoordinate I J i ξ) η) at he + simpa only [inner_conj_symm] using he + + theorem matrixEntry_star (T : GroupOperator (I × J)) (i j : I) : + matrixEntry (star T) i j=star (matrixEntry T j i) := by + apply ContinuousLinearMap.ext + intro ξ + apply ext_inner_left ℂ + intro η + have he (T : GroupOperator (I × J)) (i j : I) (ξ : GroupHilbert J) : + matrixEntry T i j ξ=productCoordinate I J i (T (productSingle I J j ξ)) := rfl + rw [he,← productSingle_inner_left,ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_right,productSingle_inner_right] + change inner ℂ (matrixEntry T j i η) ξ=inner ℂ η (star (matrixEntry T j i) ξ) + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + + variable {G : Type u_31} [Group G] [DecidableEq G] + + theorem stabilizedProjectionTrace_eq_matrix (T : stabilization G) : + stabilizedProjectionTrace T=∑' j : ℕ, ∑' i : ℕ, + ENNReal.ofReal (‖matrixEntry (T : GroupOperator (ℕ × G)) i j (lp.single 2 (1 : G) (1 : ℂ))‖^2) := by + classical + apply tsum_congr + intro j + rw [← (hilbertFlatten ℕ G).symm.norm_map,hilbert_ofReal_norm_sq] + apply tsum_congr + intro i + congr 2 + congr 1 + ext g + rw [matrixEntry_apply,productSingle_single,hilbertFlatten_symm_apply] + apply congrArg (fun ξ : GroupHilbert (ℕ × G) => (T : GroupOperator (ℕ × G)) ξ (i,g)) + ext x + simp only [lp.single_apply,Pi.single_apply] + split_ifs <;> rfl + + theorem groupVN_adjoint_delta_norm (T : groupVonNeumann G) : + ‖(star T : GroupOperator G) (lp.single 2 (1 : G) (1 : ℂ))‖^2= + ‖(T : GroupOperator G) (lp.single 2 (1 : G) (1 : ℂ))‖^2 := by + classical + have ht : canonicalTrace (T*star T)=(‖(star T : GroupOperator G) (lp.single 2 (1 : G) (1 : ℂ))‖^2 : ℂ) := by + simpa only [star_star,StarMemClass.coe_star] using canonicalTrace_star_mul (star T) + have he' : (‖(T : GroupOperator G) (lp.single 2 (1 : G) (1 : ℂ))‖^2 : ℂ)= + (‖(star T : GroupOperator G) (lp.single 2 (1 : G) (1 : ℂ))‖^2 : ℂ) := by + rw [← canonicalTrace_star_mul,← ht] + exact canonicalTrace_mul (star T) T + have hh := congrArg Complex.re he' + simpa only [← Complex.ofReal_pow,Complex.ofReal_re] using hh.symm + + theorem stabilizedProjectionTrace_star (T : stabilization G) : + stabilizedProjectionTrace (star T)=stabilizedProjectionTrace T := by + classical + rw [stabilizedProjectionTrace_eq_matrix,stabilizedProjectionTrace_eq_matrix,ENNReal.tsum_comm] + apply tsum_congr + intro i + apply tsum_congr + intro j + congr 1 + simp only [StarMemClass.coe_star] + rw [matrixEntry_star] + exact groupVN_adjoint_delta_norm ⟨_,(mem_stabilization_iff_matrix _).mp T.property j i⟩ + +end FreeGroupFactorMain.Amplification + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/StabilizationIso.lean b/lean/OAI/Analysis/InterpolatedFactors/StabilizationIso.lean new file mode 100644 index 0000000000000000000000000000000000000000..1eee9cdf4d2c563ddb27c8dfad19253a35a9ef01 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/StabilizationIso.lean @@ -0,0 +1,125 @@ +import OAI.Analysis.InterpolatedFactors.Spatial + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 + +namespace FreeGroupFactorMain.Amplification + +section +variable {G : Type u_1} {H : Type u_2} [Group G] [Group H] + +def stabilizationIso (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (he : ∀ T : GroupOperator G, T ∈ groupVonNeumann G ↔ e.conjStarAlgEquiv T ∈ groupVonNeumann H) : + stabilization G ≃⋆ₐ[ℂ] stabilization H where + toFun T := ⟨(productSpatial ℕ e).conjStarAlgEquiv T, (productSpatial_stabilization e he T).mp T.property⟩ + invFun T := ⟨(productSpatial ℕ e).conjStarAlgEquiv.symm T, + (productSpatial_stabilization e he _).mpr (by + rw [(productSpatial ℕ e).conjStarAlgEquiv.apply_symm_apply]; exact T.property)⟩ + left_inv T := Subtype.ext ((productSpatial ℕ e).conjStarAlgEquiv.symm_apply_apply T) + right_inv T := Subtype.ext ((productSpatial ℕ e).conjStarAlgEquiv.apply_symm_apply T) + map_mul' T U := Subtype.ext (map_mul (productSpatial ℕ e).conjStarAlgEquiv + (T : GroupOperator (ℕ × G)) (U : GroupOperator (ℕ × G))) + map_add' T U := Subtype.ext (map_add (productSpatial ℕ e).conjStarAlgEquiv + (T : GroupOperator (ℕ × G)) (U : GroupOperator (ℕ × G))) + map_star' T := Subtype.ext (map_star (productSpatial ℕ e).conjStarAlgEquiv (T : GroupOperator (ℕ × G))) + map_smul' c T := Subtype.ext (map_smul (productSpatial ℕ e).conjStarAlgEquiv c (T : GroupOperator (ℕ × G))) + +theorem stabilizationIso_normal (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (he : ∀ T : GroupOperator G, T ∈ groupVonNeumann G ↔ e.conjStarAlgEquiv T ∈ groupVonNeumann H) : + @Continuous _ _ (stabilizationTopology G) (stabilizationTopology H) (stabilizationIso e he) := by + let : TopologicalSpace (GroupOperator (ℕ × G)) := ultraweakOperatorTopology (ℕ × G) + let : TopologicalSpace (GroupOperator (ℕ × H)) := ultraweakOperatorTopology (ℕ × H) + let : TopologicalSpace (stabilization G) := stabilizationTopology G + let : TopologicalSpace (stabilization H) := stabilizationTopology H + exact ((spatial_ultraweak_continuous (productSpatial ℕ e)).comp continuous_subtype_val).subtype_mk _ + +theorem stabilizationDelta_eq_single [DecidableEq (ℕ × G)] (k : ℕ) : + stabilizationDelta G k = lp.single 2 (k,1) 1 := by + classical + ext x + by_cases hx : x=(k,1) <;> simp [stabilizationDelta,lp.single_apply,hx] + +theorem productSpatial_delta (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (hδ : e deltaOne = deltaOne) (k : ℕ) : + productSpatial ℕ e (stabilizationDelta G k) = stabilizationDelta H k := by + classical + have hg : stabilizationDelta G k=productSingle ℕ G k deltaOne := (productSingle_single k (1:G)).symm + have hh : stabilizationDelta H k=productSingle ℕ H k deltaOne := (productSingle_single k (1:H)).symm + rw [hg,hh,productSpatial_productSingle,hδ] + +theorem stabilizationIso_projectionTrace (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (he : ∀ T : GroupOperator G, T ∈ groupVonNeumann G ↔ e.conjStarAlgEquiv T ∈ groupVonNeumann H) + (hδ : e deltaOne = deltaOne) (T : stabilization G) : + stabilizedProjectionTrace (stabilizationIso e he T) = stabilizedProjectionTrace T := by + classical + unfold stabilizedProjectionTrace + apply tsum_congr + intro k + rw [← stabilizationDelta_eq_single,← stabilizationDelta_eq_single] + change ENNReal.ofReal (‖(productSpatial ℕ e) ((T : GroupOperator (ℕ × G)) + ((productSpatial ℕ e).symm (stabilizationDelta H k)))‖^2) = _ + rw [← productSpatial_delta e hδ,(productSpatial ℕ e).symm_apply_apply,(productSpatial ℕ e).norm_map] + +theorem stabilizationIso_trace (e : GroupHilbert G ≃ₗᵢ[ℂ] GroupHilbert H) + (he : ∀ T : GroupOperator G, T ∈ groupVonNeumann G ↔ e.conjStarAlgEquiv T ∈ groupVonNeumann H) + (hδ : e deltaOne = deltaOne) (T : stabilization G) : + stabilizedTrace (stabilizationIso e he T) = stabilizedTrace T := by + classical + unfold stabilizedTrace + apply tsum_congr + intro k + rw [← stabilizationDelta_eq_single,← stabilizationDelta_eq_single] + change inner ℂ (stabilizationDelta H k) ((productSpatial ℕ e) ((T : GroupOperator (ℕ × G)) + ((productSpatial ℕ e).symm (stabilizationDelta H k)))) = _ + rw [← productSpatial_delta e hδ,(productSpatial ℕ e).symm_apply_apply,(productSpatial ℕ e).inner_map_map] + +theorem amplification_functoriality (h : HasNormalTracialIso G H) : + ∃ Φ : stabilization G ≃⋆ₐ[ℂ] stabilization H, + (∀ p, stabilizedProjectionTrace (Φ p) = stabilizedProjectionTrace p) ∧ + (∀ T, stabilizedTrace (Φ T) = stabilizedTrace T) ∧ + @Continuous _ _ (stabilizationTopology G) (stabilizationTopology H) Φ := by + obtain ⟨Ψ,ht,_⟩ := h + obtain ⟨e,hδ,he⟩ := spatial_of_trace_iso Ψ ht + exact ⟨stabilizationIso e he,stabilizationIso_projectionTrace e he hδ, + stabilizationIso_trace e he hδ,stabilizationIso_normal e he⟩ + +end + +open scoped ENNReal +variable {G : Type u_3} + +@[simp] theorem pairedIndex_apply (i j : ℕ) (g : G) : pairedIndex G (i,j,g)=(Nat.pair i j,g) := rfl +variable [Group G] + +instance doubleStabilization_isClosed : IsClosed (doubleStabilization G : Set (GroupOperator (ℕ × (ℕ × G)))) := by + rw [doubleStabilization,StarSubalgebra.coe_centralizer] + exact Set.isClosed_centralizer _ + +instance doubleStabilization_CStarAlgebra : CStarAlgebra (doubleStabilization G) := inferInstance + +theorem mem_doubleStabilization_iff_matrix (T : GroupOperator (ℕ × (ℕ × G))) : + T ∈ doubleStabilization G ↔ ∀i j,matrixEntry T i j ∈ stabilization G := by + rw [mem_doubleStabilization_iff_right] + constructor + · intro h i j + rw [mem_stabilization_iff_right] + intro g + have hh := congrArg (fun S => matrixEntry S i j) (h g) + simpa only [doubleRight,matrixEntry_diagonal_mul,matrixEntry_mul_diagonal] using hh + · intro h g + apply matrixEntry_ext + intro i j + change matrixEntry (productAmplification ℕ (ℕ × G) (productAmplification ℕ G (rightRegular g))*T) i j=_ + rw [matrixEntry_diagonal_mul] + change _=matrixEntry (T*productAmplification ℕ (ℕ × G) (productAmplification ℕ G (rightRegular g))) i j + rw [matrixEntry_mul_diagonal] + exact (mem_stabilization_iff_right _).mp (h i j) g + +end FreeGroupFactorMain.Amplification + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/Subalgebras.lean b/lean/OAI/Analysis/InterpolatedFactors/Subalgebras.lean new file mode 100644 index 0000000000000000000000000000000000000000..ffab10634df71bf62e06f9c17bdd442c921461f6 --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/Subalgebras.lean @@ -0,0 +1,289 @@ +import OAI.Analysis.InterpolatedFactors.Restriction + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 u_10 + +namespace FreeGroupFactorMain.Amplification + +section +variable {A : Type u_3} {B : Type u_4} [CStarAlgebra A] [CStarAlgebra B] + +def subalgebraEqualityEquiv (M N : StarSubalgebra ℂ A) (he : M=N) : M ≃⋆ₐ[ℂ] N := + subalgebraEquiv M N (StarAlgEquiv.refl ℂ A) (fun a => by change a∈N ↔ a∈M;rw [he]) + +@[simp] theorem subalgebraEqualityEquiv_val (M N : StarSubalgebra ℂ A) (he : M=N) (x : M) : + (subalgebraEqualityEquiv M N he x:A)=(x:A) := rfl + +variable (M : StarSubalgebra ℂ A) [IsClosed (M : Set A)] +variable (p : M) (hp : IsStarProjection p) + +omit [IsClosed (M : Set A)] in +include hp in +theorem subtype_projection : IsStarProjection (p:A) := + hp.map M.subtype + +def cornerSubtypeEquiv : Corner p hp ≃⋆ₐ[ℂ] subalgebraCorner M (p:A) (subtype_projection M p hp) p.property where + toFun x := ⟨⟨x.val.val,⟨congrArg Subtype.val x.property.1,congrArg Subtype.val x.property.2⟩⟩,x.val.property⟩ + invFun x := ⟨⟨x.val.val,x.property⟩,⟨Subtype.ext x.val.property.1,Subtype.ext x.val.property.2⟩⟩ + left_inv _ := rfl + right_inv _ := rfl + map_mul' _ _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + map_star' _ := rfl + +variable {E : Type u_5} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + + theorem projectionRepresentation_normal (p : E →L[ℂ] E) (hp : IsStarProjection p) [CompleteSpace p.range] : + @Continuous _ _ (cornerTopology (HilbertUltraweak.topology E) p hp) + (HilbertUltraweak.topology p.range) (projectionRepresentation p hp) := by + let : TopologicalSpace (E →L[ℂ] E) := HilbertUltraweak.topology E + let : TopologicalSpace (p.range →L[ℂ] p.range) := HilbertUltraweak.topology p.range + let : TopologicalSpace (Corner p hp) := cornerTopology (HilbertUltraweak.topology E) p hp + have he : (fun x : Corner p hp => projectionRepresentation p hp x)= + (fun x : Corner p hp => p.range.orthogonalProjectionOnto.comp ((x:E →L[ℂ] E).comp p.range.subtypeL)) := by + funext x + change cornerRestrict p.range (cornerEqualityEquiv p p.range.starProjection hp isStarProjection_starProjection + (projectionRange_starProjection p hp).symm x)=_ + unfold cornerRestrict + rw [cornerEqualityEquiv_val] + change Continuous (fun x : Corner p hp => projectionRepresentation p hp x) + rw [he] + exact (HilbertUltraweak.sandwich_continuous p.range.orthogonalProjectionOnto p.range.subtypeL).comp continuous_subtype_val + + theorem projectionRepresentation_symm_normal (p : E →L[ℂ] E) (hp : IsStarProjection p) [CompleteSpace p.range] : + @Continuous _ _ (HilbertUltraweak.topology p.range) + (cornerTopology (HilbertUltraweak.topology E) p hp) (projectionRepresentation p hp).symm := by + let : TopologicalSpace (E →L[ℂ] E) := HilbertUltraweak.topology E + let : TopologicalSpace (p.range →L[ℂ] p.range) := HilbertUltraweak.topology p.range + apply continuous_induced_rng.mpr + have he : (fun x : p.range →L[ℂ] p.range => ((projectionRepresentation p hp).symm x : E →L[ℂ] E))= + (fun x : p.range →L[ℂ] p.range => p.range.subtypeL.comp (x.comp p.range.orthogonalProjectionOnto)) := by + funext x + have h := cornerEqualityEquiv_val p p.range.starProjection hp isStarProjection_starProjection + (projectionRange_starProjection p hp).symm + ((cornerEqualityEquiv p p.range.starProjection hp isStarProjection_starProjection + (projectionRange_starProjection p hp).symm).symm ((cornerRepresentation p.range).symm x)) + rw [StarAlgEquiv.apply_symm_apply] at h + exact h.symm + change Continuous (fun x : p.range →L[ℂ] p.range => ((projectionRepresentation p hp).symm x : E →L[ℂ] E)) + rw [he] + exact HilbertUltraweak.sandwich_continuous p.range.subtypeL p.range.orthogonalProjectionOnto +end + +variable {A : Type u_6} {B : Type u_7} [CStarAlgebra A] [CStarAlgebra B] +@[instance_reducible] def subalgebraTopology (𝒯 : TopologicalSpace A) (M : StarSubalgebra ℂ A) : TopologicalSpace M := + TopologicalSpace.induced (fun x : M => (x:A)) 𝒯 + +theorem subalgebraEquiv_normal (M : StarSubalgebra ℂ A) (N : StarSubalgebra ℂ B) + (e : A ≃⋆ₐ[ℂ] B) (he : ∀ a,e a∈N ↔ a∈M) + (𝒯A : TopologicalSpace A) (𝒯B : TopologicalSpace B) (hn : @Continuous _ _ 𝒯A 𝒯B e) : + @Continuous _ _ (subalgebraTopology 𝒯A M) (subalgebraTopology 𝒯B N) (subalgebraEquiv M N e he) := by + let : TopologicalSpace A := 𝒯A + let : TopologicalSpace B := 𝒯B + let : TopologicalSpace M := subalgebraTopology 𝒯A M + exact (hn.comp continuous_subtype_val).subtype_mk _ + +theorem subalgebraEquiv_symm_normal (M : StarSubalgebra ℂ A) (N : StarSubalgebra ℂ B) + (e : A ≃⋆ₐ[ℂ] B) (he : ∀ a,e a∈N ↔ a∈M) + (𝒯A : TopologicalSpace A) (𝒯B : TopologicalSpace B) (hn : @Continuous _ _ 𝒯B 𝒯A e.symm) : + @Continuous _ _ (subalgebraTopology 𝒯B N) (subalgebraTopology 𝒯A M) (subalgebraEquiv M N e he).symm := by + let : TopologicalSpace A := 𝒯A + let : TopologicalSpace B := 𝒯B + let : TopologicalSpace N := subalgebraTopology 𝒯B N + exact (hn.comp continuous_subtype_val).subtype_mk _ + +theorem subalgebraEqualityEquiv_normal (M N : StarSubalgebra ℂ A) (he : M=N) (𝒯 : TopologicalSpace A) : + @Continuous _ _ (subalgebraTopology 𝒯 M) (subalgebraTopology 𝒯 N) (subalgebraEqualityEquiv M N he) := + subalgebraEquiv_normal M N (StarAlgEquiv.refl ℂ A) _ 𝒯 𝒯 (@continuous_id A 𝒯) + +theorem subalgebraEqualityEquiv_symm_normal (M N : StarSubalgebra ℂ A) (he : M=N) (𝒯 : TopologicalSpace A) : + @Continuous _ _ (subalgebraTopology 𝒯 N) (subalgebraTopology 𝒯 M) (subalgebraEqualityEquiv M N he).symm := + subalgebraEquiv_symm_normal M N (StarAlgEquiv.refl ℂ A) _ 𝒯 𝒯 (@continuous_id A 𝒯) + +theorem cornerCongr_symm_normal (Φ : A ≃⋆ₐ[ℂ] B) (p : A) (hp : IsStarProjection p) + (𝒯A : TopologicalSpace A) (𝒯B : TopologicalSpace B) + (hΦ : @Continuous _ _ 𝒯B 𝒯A Φ.symm) : + @Continuous _ _ (cornerTopology 𝒯B (Φ p) (map_projection Φ p hp)) + (cornerTopology 𝒯A p hp) (cornerCongr Φ p hp).symm := by + let : TopologicalSpace A := 𝒯A + let : TopologicalSpace B := 𝒯B + let : TopologicalSpace (Corner (Φ p) (map_projection Φ p hp)) := + cornerTopology 𝒯B (Φ p) (map_projection Φ p hp) + exact (hΦ.comp continuous_subtype_val).subtype_mk _ + +variable (M : StarSubalgebra ℂ A) [IsClosed (M : Set A)] (p : M) (hp : IsStarProjection p) + +theorem cornerSubtypeEquiv_normal (𝒯 : TopologicalSpace A) : + @Continuous _ _ (cornerTopology (subalgebraTopology 𝒯 M) p hp) + (subalgebraTopology (cornerTopology 𝒯 (p:A) (subtype_projection M p hp)) + (subalgebraCorner M (p:A) (subtype_projection M p hp) p.property)) (cornerSubtypeEquiv M p hp) := by + let : TopologicalSpace A := 𝒯 + let : TopologicalSpace M := subalgebraTopology 𝒯 M + let : TopologicalSpace (Corner p hp) := cornerTopology (subalgebraTopology 𝒯 M) p hp + let : TopologicalSpace (Corner (p:A) (subtype_projection M p hp)) := cornerTopology 𝒯 (p:A) (subtype_projection M p hp) + exact ((continuous_subtype_val.comp continuous_subtype_val).subtype_mk _).subtype_mk _ + +theorem cornerSubtypeEquiv_symm_normal (𝒯 : TopologicalSpace A) : + @Continuous _ _ (subalgebraTopology (cornerTopology 𝒯 (p:A) (subtype_projection M p hp)) + (subalgebraCorner M (p:A) (subtype_projection M p hp) p.property)) + (cornerTopology (subalgebraTopology 𝒯 M) p hp) (cornerSubtypeEquiv M p hp).symm := by + let : TopologicalSpace A := 𝒯 + let : TopologicalSpace M := subalgebraTopology 𝒯 M + let : TopologicalSpace (Corner (p:A) (subtype_projection M p hp)) := cornerTopology 𝒯 (p:A) (subtype_projection M p hp) + let : TopologicalSpace (subalgebraCorner M (p:A) (subtype_projection M p hp) p.property) := + subalgebraTopology (cornerTopology 𝒯 (p:A) (subtype_projection M p hp)) + (subalgebraCorner M (p:A) (subtype_projection M p hp) p.property) + exact ((continuous_subtype_val.comp continuous_subtype_val).subtype_mk _).subtype_mk _ +end FreeGroupFactorMain.Amplification + +namespace FreeGroupFactorMain.FreeFock +open Amplification +variable {α : Type u_8} [DecidableEq α] + +theorem gaussianGroupIso_symm_normal : + @Continuous _ _ (gaussianUltraweakTopology α) (groupUltraweakTopology (FreeGroup α)) + (gaussianGroupIso (α := α)).symm := by + let : TopologicalSpace (GroupOperator (FreeGroup α)) := ultraweakOperatorTopology (FreeGroup α) + let : TopologicalSpace (Operator α) := ultraweakOperatorTopology (List α) + let : TopologicalSpace (groupVonNeumann (FreeGroup α)) := groupUltraweakTopology (FreeGroup α) + let : TopologicalSpace (gaussianAlgebra α) := gaussianUltraweakTopology α + have hc := ((spatial_ultraweak_continuous (haarSpatial (α := α)).symm).comp continuous_subtype_val).subtype_mk + (fun x : gaussianAlgebra α => ((gaussianGroupIso (α := α)).symm x).property) + convert hc using 1 + rfl + +instance scalarGeneratedClosed : IsClosed (scalarSystem.generated scalarFlip : Set (Operator ScalarIndex)) := + Set.isClosed_centralizer _ + +def scalarGroupIso : groupVonNeumann (FreeGroup ScalarIndex) ≃⋆ₐ[ℂ] scalarSystem.generated scalarFlip := + gaussianGroupIso.trans (subalgebraEqualityEquiv _ _ scalar_generated_eq_gaussian.symm) + +theorem scalarGroupIso_normal : + @Continuous _ _ (groupUltraweakTopology (FreeGroup ScalarIndex)) (scalarSystem.generatedTopology scalarFlip) + scalarGroupIso := by + let : TopologicalSpace (groupVonNeumann (FreeGroup ScalarIndex)) := groupUltraweakTopology (FreeGroup ScalarIndex) + let : TopologicalSpace (gaussianAlgebra ScalarIndex) := gaussianUltraweakTopology ScalarIndex + let : TopologicalSpace (scalarSystem.generated scalarFlip) := scalarSystem.generatedTopology scalarFlip + exact (subalgebraEqualityEquiv_normal _ _ scalar_generated_eq_gaussian.symm + (HilbertUltraweak.topology (Fock ScalarIndex))).comp gaussianGroupIso_normal + +theorem scalarGroupIso_symm_normal : + @Continuous _ _ (scalarSystem.generatedTopology scalarFlip) (groupUltraweakTopology (FreeGroup ScalarIndex)) + scalarGroupIso.symm := by + let : TopologicalSpace (groupVonNeumann (FreeGroup ScalarIndex)) := groupUltraweakTopology (FreeGroup ScalarIndex) + let : TopologicalSpace (gaussianAlgebra ScalarIndex) := gaussianUltraweakTopology ScalarIndex + let : TopologicalSpace (scalarSystem.generated scalarFlip) := scalarSystem.generatedTopology scalarFlip + have hc := gaussianGroupIso_symm_normal.comp (subalgebraEqualityEquiv_symm_normal _ _ + scalar_generated_eq_gaussian.symm (HilbertUltraweak.topology (Fock ScalarIndex))) + convert hc using 1 + rfl + +def scalarTrace (T : scalarSystem.generated scalarFlip) : ℂ := vacuumTrace (T:Operator ScalarIndex) + +theorem scalarGroupIso_trace (T : groupVonNeumann (FreeGroup ScalarIndex)) : + scalarTrace (scalarGroupIso T)=canonicalTrace T := gaussianGroupIso_trace T +end FreeGroupFactorMain.FreeFock + +namespace FreeGroupFactorMain.Amplification +variable {A : Type u_9} {B : Type u_10} [CStarAlgebra A] [CStarAlgebra B] +variable (p : A) (hp : IsStarProjection p) (q : Corner p hp) (hq : IsStarProjection q) + +include hq in +theorem nested_projection : IsStarProjection (q:A) := + ⟨congrArg Subtype.val hq.isIdempotentElem.eq,congrArg Subtype.val hq.isSelfAdjoint.star_eq⟩ + +theorem nested_supported (x : A) (hx : (q:A)*x=x ∧ x*(q:A)=x) : p*x=x ∧ x*p=x := by + constructor + · calc p*x=p*((q:A)*x) := congrArg (p*·) hx.1.symm + _=(p*(q:A))*x := (mul_assoc _ _ _).symm + _=x := by rw [q.property.1,hx.1] + · calc x*p=(x*(q:A))*p := congrArg (·*p) hx.2.symm + _=x*((q:A)*p) := mul_assoc _ _ _ + _=x := by rw [q.property.2,hx.2] + +def nestedCornerEquiv : Corner q hq ≃⋆ₐ[ℂ] Corner (q:A) (nested_projection p hp q hq) where + toFun x := ⟨x.val.val,⟨congrArg Subtype.val x.property.1,congrArg Subtype.val x.property.2⟩⟩ + invFun x := ⟨⟨x.val,nested_supported p hp q x.val x.property⟩, + ⟨Subtype.ext x.property.1,Subtype.ext x.property.2⟩⟩ + left_inv _ := rfl + right_inv _ := rfl + map_mul' _ _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + map_star' _ := rfl + +theorem nestedCornerEquiv_normal (𝒯 : TopologicalSpace A) : + @Continuous _ _ (cornerTopology (cornerTopology 𝒯 p hp) q hq) + (cornerTopology 𝒯 (q:A) (nested_projection p hp q hq)) (nestedCornerEquiv p hp q hq) := by + let : TopologicalSpace A := 𝒯 + let : TopologicalSpace (Corner p hp) := cornerTopology 𝒯 p hp + let : TopologicalSpace (Corner q hq) := cornerTopology (cornerTopology 𝒯 p hp) q hq + exact (continuous_subtype_val.comp continuous_subtype_val).subtype_mk _ + +theorem nestedCornerEquiv_symm_normal (𝒯 : TopologicalSpace A) : + @Continuous _ _ (cornerTopology 𝒯 (q:A) (nested_projection p hp q hq)) + (cornerTopology (cornerTopology 𝒯 p hp) q hq) (nestedCornerEquiv p hp q hq).symm := by + let : TopologicalSpace A := 𝒯 + let : TopologicalSpace (Corner p hp) := cornerTopology 𝒯 p hp + let : TopologicalSpace (Corner (q:A) (nested_projection p hp q hq)) := + cornerTopology 𝒯 (q:A) (nested_projection p hp q hq) + exact (continuous_subtype_val.subtype_mk _).subtype_mk _ + +variable (τ : A → ℂ) (𝒯 : TopologicalSpace A) + +def HasCornerScaling (t : ℝ) : Prop := + ∃ (p : A) (hp : IsStarProjection p) (e : A ≃⋆ₐ[ℂ] Corner p hp), + τ p=(t:ℂ) ∧ + @Continuous _ _ 𝒯 (cornerTopology 𝒯 p hp) e ∧ + @Continuous _ _ (cornerTopology 𝒯 p hp) 𝒯 e.symm ∧ + ∀ x : A, τ (e x : A)=(t:ℂ)*τ x + + theorem HasCornerScaling.mul {t s : ℝ} (ht : HasCornerScaling τ 𝒯 t) + (hs : HasCornerScaling τ 𝒯 s) : HasCornerScaling τ 𝒯 (t*s) := by + rcases ht with ⟨p,hp,e,hpτ,hen,hein,heτ⟩ + rcases hs with ⟨q,hq,f,hqτ,hfn,hfin,hfτ⟩ + let r : Corner p hp := e q + have hr : IsStarProjection r := map_projection e q hq + let g := f.trans ((cornerCongr e q hq).trans (nestedCornerEquiv p hp r hr)) + refine ⟨(r:A),nested_projection p hp r hr,g,?_,?_,?_,?_⟩ + · change τ (e q : A)=(t*s:ℝ) + rw [heτ,hqτ,Complex.ofReal_mul] + · let : TopologicalSpace A := 𝒯 + let : TopologicalSpace (Corner p hp) := cornerTopology 𝒯 p hp + let : TopologicalSpace (Corner q hq) := cornerTopology 𝒯 q hq + let : TopologicalSpace (Corner r hr) := cornerTopology (cornerTopology 𝒯 p hp) r hr + exact (nestedCornerEquiv_normal p hp r hr 𝒯).comp + ((cornerCongr_normal e q hq 𝒯 (cornerTopology 𝒯 p hp) hen).comp hfn) + · let : TopologicalSpace A := 𝒯 + let : TopologicalSpace (Corner p hp) := cornerTopology 𝒯 p hp + let : TopologicalSpace (Corner q hq) := cornerTopology 𝒯 q hq + let : TopologicalSpace (Corner r hr) := cornerTopology (cornerTopology 𝒯 p hp) r hr + let : TopologicalSpace (Corner (r:A) (nested_projection p hp r hr)) := + cornerTopology 𝒯 (r:A) (nested_projection p hp r hr) + exact hfin.comp ((cornerCongr_symm_normal e q hq 𝒯 (cornerTopology 𝒯 p hp) hein).comp + (nestedCornerEquiv_symm_normal p hp r hr 𝒯)) + · intro x + change τ (e (f x : A) : A)=((t*s:ℝ):ℂ)*τ x + rw [heτ,hfτ,Complex.ofReal_mul,mul_assoc] + + theorem HasCornerScaling.normalized {t : ℝ} (ht : 0 E) 2) (η : lp (fun _ : ℕ => E) 2), + TopologicalSpace.induced (fun T : E →L[ℂ] E => ∑' k : ℕ, inner ℂ (η k) (T (ξ k))) inferInstance + +variable {E} {F : Type u_2} [NormedAddCommGroup F] [InnerProductSpace ℂ F] [CompleteSpace F] +def sequenceMap (L : E →L[ℂ] F) (ξ : lp (fun _ : ℕ => E) 2) : lp (fun _ : ℕ => F) 2 := + ⟨fun k => L (ξ k),((lp.memℓp ξ).norm.const_mul ‖L‖).mono (fun k => L.le_opNorm (ξ k))⟩ + +omit [CompleteSpace E] in +theorem functional_continuous (ξ η : lp (fun _ : ℕ => E) 2) : + @Continuous _ _ (topology E) _ (fun T : E →L[ℂ] E => ∑' k : ℕ,inner ℂ (η k) (T (ξ k))) := + continuous_iInf_dom (i := ξ) (continuous_iInf_dom (i := η) continuous_induced_dom) + +theorem sandwich_continuous (L : E →L[ℂ] F) (R : F →L[ℂ] E) : + @Continuous _ _ (topology E) (topology F) (fun T : E →L[ℂ] E => L.comp (T.comp R)) := by + apply continuous_iInf_rng.mpr + intro ξ + apply continuous_iInf_rng.mpr + intro η + apply continuous_induced_rng.mpr + have he : (fun T : E →L[ℂ] E => ∑' k : ℕ,inner ℂ (η k) (L (T (R (ξ k)))))= + (fun T : E →L[ℂ] E => ∑' k : ℕ,inner ℂ (sequenceMap (ContinuousLinearMap.adjoint L) η k) + (T (sequenceMap R ξ k))) := by + funext T + apply tsum_congr + intro k + exact (ContinuousLinearMap.adjoint_inner_left L (T (R (ξ k))) (η k)).symm + change @Continuous _ _ (topology E) _ (fun T : E →L[ℂ] E => ∑' k : ℕ,inner ℂ (η k) (L (T (R (ξ k))))) + rw [he] + exact functional_continuous _ _ + +theorem spatial_continuous (U : E ≃ₗᵢ[ℂ] F) : + @Continuous _ _ (topology E) (topology F) U.conjStarAlgEquiv := + sandwich_continuous U.toContinuousLinearEquiv.toContinuousLinearMap U.symm.toContinuousLinearEquiv.toContinuousLinearMap + +omit [CompleteSpace E] in +theorem add_continuous {X : Type u_3} [TopologicalSpace X] {f g : X → (E →L[ℂ] E)} + (hf : @Continuous _ _ _ (topology E) f) (hg : @Continuous _ _ _ (topology E) g) : + @Continuous _ _ _ (topology E) (fun x => f x+g x) := by + let : TopologicalSpace (E →L[ℂ] E) := topology E + apply continuous_iInf_rng.mpr + intro ξ + apply continuous_iInf_rng.mpr + intro η + apply continuous_induced_rng.mpr + have he (x : X) : + (∑' k : ℕ,inner ℂ (η k) ((f x+g x) (ξ k)))= + (∑' k : ℕ,inner ℂ (η k) (f x (ξ k)))+(∑' k : ℕ,inner ℂ (η k) (g x (ξ k))) := by + simp only [add_apply,inner_add_right] + exact (lp.summable_inner η (sequenceMap (f x) ξ)).tsum_add (lp.summable_inner η (sequenceMap (g x) ξ)) + change Continuous (fun x : X => ∑' k : ℕ,inner ℂ (η k) ((f x+g x) (ξ k))) + simp_rw [he] + exact ((functional_continuous ξ η).comp hf).add ((functional_continuous ξ η).comp hg) +end FreeGroupFactorMain.HilbertUltraweak + +section +namespace FreeGroupFactorMain.CornerRerouting +variable {A : Type u_4} [Ring A] [StarRing A] + +theorem lift_commute_four {p v t z : A} (hp : IsStarProjection p) + (hpv : p*v=v) (hvr : v*(1-p)=v) (hvi : star v*v=1-p) + (ht : Supported p t) (htr : Commute t (v*star v)) + (ha : Commute t (p*z*p)) (hb : Commute t (p*z*star v)) + (hc : Commute t (v*z*p)) (hd : Commute t (v*z*star v)) : Commute (lift v t) z := by + have hvp := right_zero hvr + have hvsp : star v*p=star v := by + simpa only [star_mul,hp.isSelfAdjoint.star_eq] using congrArg star hpv + have hsupport (a b : A) (hal : p*a=a) (hbr : b*p=b) : Supported p (a*z*b) := by + exact ⟨by rw [← mul_assoc,← mul_assoc,hal],by rw [mul_assoc,hbr]⟩ + have ha' := lift_commute_supported hp.isSelfAdjoint hvp (hsupport p p hp.isIdempotentElem.eq hp.isIdempotentElem.eq) ha + have hb' := lift_commute_supported hp.isSelfAdjoint hvp (hsupport p (star v) hp.isIdempotentElem.eq hvsp) hb + have hc' := lift_commute_supported hp.isSelfAdjoint hvp (hsupport v p hpv hp.isIdempotentElem.eq) hc + have hd' := lift_commute_supported hp.isSelfAdjoint hvp (hsupport v (star v) hpv hvsp) hd + have hv' := lift_commute_edge hpv hvp hvi hvr ht htr + have hvs' := lift_commute_edge_star hp.isSelfAdjoint hpv hvp hvi hvr ht htr + have hz : z=p*z*p+(p*z*star v)*v+star v*(v*z*p)+star v*(v*z*star v)*v := by + calc + z = (p+star v*v)*z*(p+star v*v) := by rw [hvi]; noncomm_ring + _ = _ := by noncomm_ring + rw [hz] + exact ((ha'.add_right (hb'.mul_right hv')).add_right (hvs'.mul_right hc')).add_right + ((hvs'.mul_right hd').mul_right hv') +end FreeGroupFactorMain.CornerRerouting + +namespace FreeGroupFactorMain.FullReducingCorner +open Amplification CornerRerouting +variable {A : Type u_5} [CStarAlgebra A] + +def bicomm (s : Set A) : StarSubalgebra ℂ A := + StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ s : Set A) + +def compress (p : A) (hp : IsStarProjection p) (a : A) : Corner p hp := + ⟨p*a*p,by rw [← mul_assoc,← mul_assoc,hp.isIdempotentElem.eq],by rw [mul_assoc,hp.isIdempotentElem.eq]⟩ + +theorem compress_star (p : A) (hp : IsStarProjection p) (a : A) : + compress p hp (star a)=star (compress p hp a) := by + apply Subtype.ext + change p*star a*p=star (p*a*p) + simp only [star_mul,hp.isSelfAdjoint.star_eq,mul_assoc] + +def compressedSet (p : A) (hp : IsStarProjection p) (s : Set A) : Set (Corner p hp) := compress p hp '' s + +variable (p : A) (hp : IsStarProjection p) (s : Set A) +variable (hps : p∈StarSubalgebra.centralizer ℂ s) + +theorem supported_commutant (x : Corner p hp) (hx : (x:A)∈StarSubalgebra.centralizer ℂ s) : + x∈StarSubalgebra.centralizer ℂ (compressedSet p hp s) := by + rw [StarSubalgebra.mem_centralizer_iff] + rintro _ ⟨y,hy,rfl⟩ + have hpy : Commute p (x:A) := x.property.1.trans x.property.2.symm + have hyx : Commute y (x:A) := ((StarSubalgebra.mem_centralizer_iff ℂ).mp hx y hy).1 + have he : Commute (compress p hp y) x := by + apply Subtype.ext + exact ((hpy.mul_left hyx).mul_left hpy).eq + have hyx' : Commute (star y) (x:A) := + ((StarSubalgebra.mem_centralizer_iff ℂ).mp hx y hy).2 + have he' : Commute (compress p hp (star y)) x := by + apply Subtype.ext + exact ((hpy.mul_left hyx').mul_left hpy).eq + rw [compress_star] at he' + exact ⟨he.eq,he'.eq⟩ + +include hps in +theorem commutant_of_supported (x : Corner p hp) + (hx : x∈StarSubalgebra.centralizer ℂ (compressedSet p hp s)) : + (x:A)∈StarSubalgebra.centralizer ℂ s := by + have htest (y : A) (hyP : Commute y p) (hh : Commute (compress p hp y) x) : Commute y (x:A) := by + have hh' := congrArg Subtype.val hh.eq + change (p*y*p)*(x:A)=(x:A)*(p*y*p) at hh' + change y*(x:A)=(x:A)*y + calc + y*(x:A)= (p*y*p)*(x:A) := by + calc + y*(x:A) = (y*p)*(x:A) := by rw [mul_assoc,x.property.1] + _ = (p*y)*(x:A) := by rw [hyP] + _ = (p*y*p)*(x:A) := by rw [mul_assoc (p*y),x.property.1] + _ = (x:A)*(p*y*p) := hh' + _ = (x:A)*y := by + calc + (x:A)*(p*y*p) = (x:A)*(y*p) := by rw [← mul_assoc,← mul_assoc,x.property.2,mul_assoc] + _ = (x:A)*(p*y) := by rw [hyP] + _ = (x:A)*y := by rw [← mul_assoc,x.property.2] + rw [StarSubalgebra.mem_centralizer_iff] + intro y hy + have hc := (StarSubalgebra.mem_centralizer_iff ℂ).mp hx _ ⟨y,hy,rfl⟩ + have hpY := (StarSubalgebra.mem_centralizer_iff ℂ).mp hps y hy + refine ⟨(htest y hpY.1 hc.1).eq,?_⟩ + apply htest (star y) hpY.2 + change compress p hp (star y)*x=x*compress p hp (star y) + rw [compress_star] + exact hc.2 + +include hps in +theorem compress_mem (a : bicomm s) : compress p hp (a:A)∈bicomm (compressedSet p hp s) := by + rw [bicomm,StarSubalgebra.mem_centralizer_iff] + intro x hx + have ht (z : Corner p hp) (hz : z∈StarSubalgebra.centralizer ℂ (compressedSet p hp s)) : + Commute z (compress p hp (a:A)) := by + have hzA := commutant_of_supported p hp s hps z hz + have hza := ((StarSubalgebra.mem_centralizer_iff ℂ).mp a.property (z:A) hzA).1 + have hzp : Commute (z:A) p := z.property.2.trans z.property.1.symm + apply Subtype.ext + exact ((hzp.mul_right hza).mul_right hzp).eq + exact ⟨(ht x hx).eq,(ht (star x) (star_mem hx)).eq⟩ + +variable (v : A) (hvs : v∈StarSubalgebra.centralizer ℂ s) +variable (hpv : p*v=v) (hvr : v*(1-p)=v) (hvi : star v*v=1-p) + +include hps hvs hpv hvr hvi in +theorem lift_mem (x : bicomm (compressedSet p hp s)) : lift v (x.val:A)∈bicomm s := by + have hsupport (a b : A) (hal : p*a=a) (hbr : b*p=b) : Supported p (a*b) := + ⟨by rw [← mul_assoc,hal],by rw [mul_assoc,hbr]⟩ + have hvsp : star v*p=star v := by + simpa only [star_mul,hp.isSelfAdjoint.star_eq] using congrArg star hpv + have hx (z : A) (hz : z∈StarSubalgebra.centralizer ℂ s) (hzp : Supported p z) : + Commute (x.val:A) z := by + let z' : Corner p hp := ⟨z,hzp⟩ + have hm := supported_commutant p hp s z' hz + have hh := ((StarSubalgebra.mem_centralizer_iff ℂ).mp x.property z' hm).1 + exact (congrArg Subtype.val hh).symm + have htest (z : A) (hz : z∈StarSubalgebra.centralizer ℂ s) : Commute (lift v (x.val:A)) z := by + apply lift_commute_four hp hpv hvr hvi x.val.property + · exact hx _ (mul_mem hvs (star_mem hvs)) (hsupport v (star v) hpv hvsp) + · exact hx _ (mul_mem (mul_mem hps hz) hps) + (hsupport (p*z) p (by rw [← mul_assoc,hp.isIdempotentElem.eq]) hp.isIdempotentElem.eq) + · exact hx _ (mul_mem (mul_mem hps hz) (star_mem hvs)) + (hsupport (p*z) (star v) (by rw [← mul_assoc,hp.isIdempotentElem.eq]) hvsp) + · exact hx _ (mul_mem (mul_mem hvs hz) hps) + (hsupport (v*z) p (by rw [← mul_assoc,hpv]) hp.isIdempotentElem.eq) + · exact hx _ (mul_mem (mul_mem hvs hz) (star_mem hvs)) + (hsupport (v*z) (star v) (by rw [← mul_assoc,hpv]) hvsp) + rw [bicomm,StarSubalgebra.mem_centralizer_iff] + intro z hz + exact ⟨(htest z hz).symm.eq,(htest (star z) (star_mem hz)).symm.eq⟩ + +include hps hvs hpv hvi in +theorem lift_compress (a : bicomm s) : lift v (compress p hp (a:A):A)=(a:A) := by + have hap := ((StarSubalgebra.mem_centralizer_iff ℂ).mp a.property p hps).1 + have havs := ((StarSubalgebra.mem_centralizer_iff ℂ).mp a.property v hvs).2 + change p*(a:A)*p+star v*(p*(a:A)*p)*v=(a:A) + rw [hap,mul_assoc,hp.isIdempotentElem.eq,← mul_assoc (star v),havs,mul_assoc,hpv,mul_assoc,hvi] + noncomm_ring + +include hvr in +theorem compress_lift (x : Corner p hp) : compress p hp (lift v (x:A))=x := by + have hvp := right_zero hvr + apply Subtype.ext + change p*lift v (x:A)*p=(x:A) + rw [mul_assoc,lift_mul_supported hvp ⟨hp.isIdempotentElem.eq,hp.isIdempotentElem.eq⟩,x.property.2,x.property.1] + +def iso : bicomm s ≃⋆ₐ[ℂ] bicomm (compressedSet p hp s) where + toFun a := ⟨compress p hp a,compress_mem p hp s hps a⟩ + invFun x := ⟨lift v (x.val:A),lift_mem p hp s hps v hvs hpv hvr hvi x⟩ + left_inv a := Subtype.ext (lift_compress p hp s hps v hvs hpv hvi a) + right_inv x := Subtype.ext (compress_lift p hp v hvr x.val) + map_mul' a b := by + apply Subtype.ext + apply Subtype.ext + have hpA := ((StarSubalgebra.mem_centralizer_iff ℂ).mp a.property p hps).1 + change p*((a:A)*(b:A))*p=(p*(a:A)*p)*(p*(b:A)*p) + calc + p*((a:A)*(b:A))*p = (p*(a:A))*((b:A)*p) := by simp only [mul_assoc] + _ = ((a:A)*p)*((b:A)*p) := by rw [hpA] + _ = (p*(a:A)*p)*(p*(b:A)*p) := by + rw [hpA] + simp only [mul_assoc,← mul_assoc p p,hp.isIdempotentElem.eq] + map_add' a b := by + apply Subtype.ext; apply Subtype.ext + change p*((a:A)+(b:A))*p=p*(a:A)*p+p*(b:A)*p + simp only [mul_add,add_mul] + map_smul' c a := by + apply Subtype.ext; apply Subtype.ext + change p*(c • (a:A))*p=c • (p*(a:A)*p) + simp only [mul_smul_comm,smul_mul_assoc] + map_star' a := Subtype.ext (compress_star p hp (a:A)) +end FreeGroupFactorMain.FullReducingCorner + +end + +namespace FreeGroupFactorMain.ReducingSubspace +variable {E : Type u_6} [NormedAddCommGroup E] [InnerProductSpace ℂ E] +variable (K : Submodule ℂ E) [CompleteSpace K] + +def reduce (T : E →L[ℂ] E) : K →L[ℂ] K := + K.orthogonalProjectionOnto.comp (T.comp K.subtypeL) + +theorem reduce_apply (T : E →L[ℂ] E) (hT : ∀ ξ∈K,T ξ∈K) (ξ : K) : + (reduce K T ξ:E)=T ξ := K.starProjection_eq_self_iff.mpr (hT ξ ξ.property) + +theorem reduce_one : reduce K (1:E →L[ℂ] E)=1 := by + apply ContinuousLinearMap.ext + intro ξ + exact K.orthogonalProjectionOnto_mem_subspace_eq_self ξ + +theorem reduce_add (T U : E →L[ℂ] E) : reduce K (T+U)=reduce K T+reduce K U := by + apply ContinuousLinearMap.ext + intro ξ + exact K.orthogonalProjectionOnto.map_add _ _ + +theorem reduce_smul (c : ℂ) (T : E →L[ℂ] E) : reduce K (c • T)=c • reduce K T := by + apply ContinuousLinearMap.ext + intro ξ + exact K.orthogonalProjectionOnto.map_smul c _ + +theorem inner_reduce (T : E →L[ℂ] E) (ξ η : K) : + inner ℂ ξ (reduce K T η)=inner ℂ (ξ:E) (T η) := + K.inner_orthogonalProjectionOnto_eq_of_mem_left ξ (T η) + +variable [CompleteSpace E] + +theorem reduce_star (T : E →L[ℂ] E) : reduce K (star T)=star (reduce K T) := by + apply ContinuousLinearMap.ext + intro ξ + apply ext_inner_left ℂ + intro η + rw [inner_reduce,ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + exact (K.inner_orthogonalProjectionOnto_eq_of_mem_right ξ (T η)).symm + +omit [CompleteSpace E] in +theorem reduce_mul (T U : E →L[ℂ] E) (hU : ∀ ξ∈K,U ξ∈K) : + reduce K (T*U)=reduce K T*reduce K U := by + apply ContinuousLinearMap.ext + intro ξ + change K.orthogonalProjectionOnto (T (U ξ))=K.orthogonalProjectionOnto (T (reduce K U ξ:E)) + rw [reduce_apply K U hU] +end FreeGroupFactorMain.ReducingSubspace + +namespace FreeGroupFactorMain.GaussianRecognition.System +open ReducingSubspace +variable {A : Type u_7} {E : Type u_8} {I : Type u_9} [Ring A] [StarRing A] [Algebra ℂ A] +variable [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable {covariance : I → I → A → A} (X : System A E I covariance) + +def reducedCoeff : A →⋆ₐ[ℂ] (X.normalHull →L[ℂ] X.normalHull) where + toFun a := reduce X.normalHull (X.coeff a) + map_zero' := by simp [reduce] + map_one' := by rw [map_one,reduce_one] + map_add' a b := by rw [map_add,reduce_add] + map_mul' a b := by rw [map_mul,reduce_mul X.normalHull _ _ (fun _ h => X.normalHull_coeff b h)] + commutes' c := by + rw [Algebra.algebraMap_eq_smul_one,map_smul,map_one,reduce_smul,reduce_one,Algebra.algebraMap_eq_smul_one] + map_star' a := by rw [map_star,reduce_star] + +def reducedSystem : System A X.normalHull I covariance where + coeff := X.reducedCoeff + root := ⟨X.root,X.normalHull_root⟩ + create i := reduce X.normalHull (X.create i) + contract i j a := by + change star (reduce X.normalHull (X.create i))*reduce X.normalHull (X.coeff a)* + reduce X.normalHull (X.create j)=reduce X.normalHull (X.coeff (covariance i j a)) + rw [← reduce_star,← reduce_mul X.normalHull _ _ (fun _ h => X.normalHull_coeff a h), + ← reduce_mul X.normalHull _ _ (fun _ h => X.normalHull_create j h),X.contract] + annihilate i a := by + apply Subtype.ext + rw [← reduce_star,reduce_apply X.normalHull _ (fun _ h => X.normalHull_annihilate i h)] + change star (X.create i) ((reduce X.normalHull (X.coeff a) ⟨X.root,X.normalHull_root⟩):E)=0 + rw [reduce_apply X.normalHull _ (fun _ h => X.normalHull_coeff a h),X.annihilate] + +theorem reducedSystem_normal (a : A) (w : List (I × A)) : + (X.reducedSystem.normal a w:E)=X.normal a w := by + induction w generalizing a with + | nil => exact reduce_apply X.normalHull _ (fun _ h => X.normalHull_coeff a h) _ + | cons q w ih => + rcases q with ⟨i,b⟩ + change (reduce X.normalHull (X.coeff a) + (reduce X.normalHull (X.create i) (X.reducedSystem.normal b w)):E)=_ + rw [reduce_apply X.normalHull _ (fun _ h => X.normalHull_coeff a h), + reduce_apply X.normalHull _ (fun _ h => X.normalHull_create i h),ih] + rfl + +theorem reducedSystem_family (w : Word A I) : (X.reducedSystem.family w:E)=X.family w := + X.reducedSystem_normal _ _ + +theorem reducedSystem_state (a : A) : + inner ℂ X.reducedSystem.root (X.reducedSystem.coeff a X.reducedSystem.root)= + inner ℂ X.root (X.coeff a X.root) := inner_reduce X.normalHull _ _ _ + +theorem reducedSystem_total : + (Submodule.span ℂ (Set.range X.reducedSystem.family)).topologicalClosure=⊤ := by + have hi : (Subtype.val '' (Submodule.span ℂ (Set.range X.reducedSystem.family) : Set X.normalHull))= + (X.normalSpan:Set E) := by + change ((Submodule.span ℂ (Set.range X.reducedSystem.family)).map X.normalHull.subtype : Set E)=_ + rw [Submodule.map_span,← Set.range_comp] + change (Submodule.span ℂ (Set.range (fun w => (X.reducedSystem.family w:E))) : Set E)=_ + simp only [X.reducedSystem_family,normalSpan] + apply top_unique + intro ξ _ + change ξ∈closure (Submodule.span ℂ (Set.range X.reducedSystem.family) : Set X.normalHull) + rw [Topology.IsEmbedding.subtypeVal.closure_eq_preimage_closure_image,hi] + exact ξ.property +end FreeGroupFactorMain.GaussianRecognition.System + +namespace FreeGroupFactorMain.WeightedFock +open FreeFock Amplification CyclicSpectral GaussianRecognition +variable (u v : ℝ) (hv : 0 (reduced_weighted_scalar_state u v hv hvu a).symm) + (weightedSystem u v hv hvu).reducedSystem_total scalarSystem_total scalarFlip + +theorem reducedGaussianIso_normal : + @Continuous _ _ ((weightedSystem u v hv hvu).reducedSystem.generatedTopology scalarFlip) + (scalarSystem.generatedTopology scalarFlip) (reducedGaussianIso u v hv hvu) := + (weightedSystem u v hv hvu).reducedSystem.generatedIso_normal scalarSystem + (fun a => (reduced_weighted_scalar_state u v hv hvu a).symm) + (weightedSystem u v hv hvu).reducedSystem_total scalarSystem_total scalarFlip + +theorem reducedGaussianIso_trace (T : (weightedSystem u v hv hvu).reducedSystem.generated scalarFlip) : + inner ℂ scalarSystem.root ((reducedGaussianIso u v hv hvu T : FreeFock.Operator ScalarIndex) scalarSystem.root)= + inner ℂ (weightedSystem u v hv hvu).reducedSystem.root + ((T : (weightedSystem u v hv hvu).normalHull →L[ℂ] (weightedSystem u v hv hvu).normalHull) + (weightedSystem u v hv hvu).reducedSystem.root) := + (weightedSystem u v hv hvu).reducedSystem.generatedIso_trace scalarSystem + (fun a => (reduced_weighted_scalar_state u v hv hvu a).symm) + (weightedSystem u v hv hvu).reducedSystem_total scalarSystem_total scalarFlip T +end FreeGroupFactorMain.WeightedFock + +end + +end OAI diff --git a/lean/OAI/Analysis/InterpolatedFactors/UniformSpectral.lean b/lean/OAI/Analysis/InterpolatedFactors/UniformSpectral.lean new file mode 100644 index 0000000000000000000000000000000000000000..221ba6bfbdecfffe79cb791dc5b5dfaae628681a --- /dev/null +++ b/lean/OAI/Analysis/InterpolatedFactors/UniformSpectral.lean @@ -0,0 +1,365 @@ +import OAI.Analysis.InterpolatedFactors.Haar + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 + +namespace FreeGroupFactorMain.CyclicSpectral +open MeasureTheory ProbabilityTheory Set +variable {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +variable (A : E →L[ℂ] E) (hA : IsSelfAdjoint A) (ξ : E) +variable [IsProbabilityMeasure (measure A hA ξ)] [NullSingletonClass (measure A hA ξ)] + +abbrev UniformAlgebra := C(Icc (0:ℝ) 1,ℂ) + +def cdfMap : C(Space A,Icc (0:ℝ) 1) := + ⟨fun x => ⟨cdf (realMeasure A hA ξ) x,cdf_nonneg _ _,cdf_le_one _ _⟩, + ((ProbabilityTransform.continuous_cdf (realMeasure A hA ξ)).comp + continuous_subtype_val).subtype_mk _⟩ + +def uniformHom : UniformAlgebra →⋆ₐ[ℂ] (E →L[ℂ] E) := + (complexHom A hA).comp (ContinuousMap.compStarAlgHom' ℂ ℂ (cdfMap A hA ξ)) + +def uniformState (f : UniformAlgebra) : ℂ := + ∫ x:ℝ, f (projIcc 0 1 (by norm_num) x) ∂volume.restrict (Icc (0:ℝ) 1) + +theorem uniformHom_state (f : UniformAlgebra) : + inner ℂ ξ (uniformHom A hA ξ f ξ)=uniformState f := by + let g : ℝ → ℂ := fun x => f (projIcc 0 1 (by norm_num) x) + have hg : Continuous g := f.continuous.comp continuous_projIcc + have he (x : ℝ) : g (cdf (realMeasure A hA ξ) x)=f ⟨cdf (realMeasure A hA ξ) x, + cdf_nonneg _ _,cdf_le_one _ _⟩ := by + dsimp only [g] + congr 1 + exact projIcc_of_mem (by norm_num) ⟨cdf_nonneg _ _,cdf_le_one _ _⟩ + have hi := integral_map (μ := measure A hA ξ) measurable_subtype_coe.aemeasurable + (hg.comp (ProbabilityTransform.continuous_cdf (realMeasure A hA ξ))).aestronglyMeasurable + have hj := integral_map (μ := realMeasure A hA ξ) + (ProbabilityTransform.continuous_cdf (realMeasure A hA ξ)).aemeasurable hg.aestronglyMeasurable + rw [ProbabilityTransform.map_cdf] at hj + rw [uniformHom,StarAlgHom.comp_apply,← integral_complex] + calc + _ = ∫ x : Space A, g (cdf (realMeasure A hA ξ) x) ∂measure A hA ξ := by + apply integral_congr_ae + filter_upwards [] with x + exact (he x).symm + _ = ∫ x : ℝ, g (cdf (realMeasure A hA ξ) x) ∂realMeasure A hA ξ := hi.symm + _ = uniformState f := hj.symm + +def uniformPhase : UniformAlgebra := + ⟨fun x => ProbabilityTransform.phase x,ProbabilityTransform.phase_continuous.comp continuous_subtype_val⟩ + +theorem uniformHom_phase : uniformHom A hA ξ uniformPhase=(haarUnitary A hA ξ : E →L[ℂ] E) := rfl + +theorem uniformHom_mem (M : StarSubalgebra ℂ (E →L[ℂ] E)) + (hM : IsClosed (M : Set (E →L[ℂ] E))) (hAM : A∈M) (f : UniformAlgebra) : + uniformHom A hA ξ f∈M := complexHom_mem A hA M hM hAM _ +end FreeGroupFactorMain.CyclicSpectral + +section +open scoped ENNReal + +namespace FreeGroupFactorMain.CyclicSpectral + +section +open MeasureTheory +variable {H : Type u_2} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +local instance : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) + +def evaluate : C(Space A,ℝ) →ₗ[ℝ] H := + (((ContinuousLinearMap.apply ℂ H ξ).restrictScalars ℝ).comp (cfcL hA)).toLinearMap + + theorem evaluate_norm (f : C(Space A,ℝ)) : + ‖evaluate A hA ξ f‖=‖ContinuousMap.toLp 2 (measure A hA ξ) ℝ f‖ := by + have hs : ‖evaluate A hA ξ f‖^2=‖ContinuousMap.toLp 2 (measure A hA ξ) ℝ f‖^2 := by + calc + _ = ∫ x, (f x)^2 ∂measure A hA ξ := (integral_sq A hA ξ f).symm + _ = inner ℝ (ContinuousMap.toLp 2 (measure A hA ξ) ℝ f) + (ContinuousMap.toLp 2 (measure A hA ξ) ℝ f) := by + rw [MeasureTheory.ContinuousMap.inner_toLp] + congr 1 + funext x + simp only [pow_two,RCLike.conj_to_real] + _ = _ := real_inner_self_eq_norm_sq _ + nlinarith [norm_nonneg (evaluate A hA ξ f),norm_nonneg (ContinuousMap.toLp 2 (measure A hA ξ) ℝ f)] + +def realize : Lp ℝ 2 (measure A hA ξ) →L[ℝ] H := + (evaluate A hA ξ).extendOfNorm (ContinuousMap.toLp 2 (measure A hA ξ) ℝ).toLinearMap + + theorem realize_continuous (f : C(Space A,ℝ)) : + realize A hA ξ (ContinuousMap.toLp 2 (measure A hA ξ) ℝ f)=cfcHom hA f ξ := by + apply LinearMap.extendOfNorm_eq + · exact ContinuousMap.toLp_denseRange ℝ (measure A hA ξ) ℝ (p := 2) (by norm_num) + · refine ⟨1,fun g => ?_⟩ + change ‖evaluate A hA ξ g‖ ≤ 1 * ‖ContinuousMap.toLp 2 (measure A hA ξ) ℝ g‖ + rw [one_mul,evaluate_norm] + + theorem realize_norm (f : Lp ℝ 2 (measure A hA ξ)) : ‖realize A hA ξ f‖=‖f‖ := by + have hd := ContinuousMap.toLp_denseRange ℝ (measure A hA ξ) ℝ (p := 2) (by norm_num : (2:ℝ≥0∞)≠∞) + refine hd.induction_on (p := fun f => ‖realize A hA ξ f‖=‖f‖) f + (isClosed_eq ((realize A hA ξ).continuous.norm) continuous_norm) ?_ + intro q + rw [realize_continuous] + exact evaluate_norm A hA ξ q + +def isometry : Lp ℝ 2 (measure A hA ξ) →ₗᵢ[ℝ] H where + toLinearMap := (realize A hA ξ).toLinearMap + norm_map' := realize_norm A hA ξ + +end +section +open MeasureTheory Filter +variable {H : Type u_3} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +local instance : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) + + theorem mul_memLp (g : C(Space A,ℝ)) (f : Lp ℝ 2 (measure A hA ξ)) : + MemLp (fun x => g x*f x) 2 (measure A hA ξ) := by + apply (Lp.memLp f).of_le_mul (c := ‖g‖) + · exact g.continuous.aestronglyMeasurable.mul (Lp.aestronglyMeasurable f) + · exact Eventually.of_forall (fun x => by rw [norm_mul];exact mul_le_mul_of_nonneg_right (g.norm_coe_le_norm x) (norm_nonneg _)) + +def multiply (g : C(Space A,ℝ)) : Lp ℝ 2 (measure A hA ξ) →L[ℝ] Lp ℝ 2 (measure A hA ξ) := + LinearMap.mkContinuous + { toFun := fun f => (mul_memLp A hA ξ g f).toLp (fun x => g x*f x) + map_add' := by + intro f k + apply Lp.ext + filter_upwards [(mul_memLp A hA ξ g (f+k)).coeFn_toLp, + (mul_memLp A hA ξ g f).coeFn_toLp,(mul_memLp A hA ξ g k).coeFn_toLp, + Lp.coeFn_add f k,Lp.coeFn_add ((mul_memLp A hA ξ g f).toLp _) ((mul_memLp A hA ξ g k).toLp _)] with x h₁ h₂ h₃ h₄ h₅ + simp only [h₁,h₅,Pi.add_apply,h₂,h₃,h₄] + exact mul_add _ _ _ + map_smul' := by + intro c f + apply Lp.ext + filter_upwards [(mul_memLp A hA ξ g (c • f)).coeFn_toLp, + (mul_memLp A hA ξ g f).coeFn_toLp,Lp.coeFn_smul c f, + Lp.coeFn_smul c ((mul_memLp A hA ξ g f).toLp _)] with x h₁ h₂ h₃ h₄ + simp only [RingHom.id_apply,h₁,h₄,Pi.smul_apply,smul_eq_mul,h₂,h₃] + ring } + ‖g‖ (by + intro f + change ‖(mul_memLp A hA ξ g f).toLp (fun x => g x*f x)‖ ≤ ‖g‖ * ‖f‖ + apply Lp.norm_le_mul_norm_of_ae_le_mul + filter_upwards [(mul_memLp A hA ξ g f).coeFn_toLp] with x hx + rw [hx,norm_mul] + exact mul_le_mul_of_nonneg_right (g.norm_coe_le_norm x) (norm_nonneg _)) + + theorem multiply_ae (g : C(Space A,ℝ)) (f : Lp ℝ 2 (measure A hA ξ)) : + multiply A hA ξ g f =ᵐ[measure A hA ξ] (fun x => g x*f x) := + (mul_memLp A hA ξ g f).coeFn_toLp + + theorem multiply_continuous (g f : C(Space A,ℝ)) : + multiply A hA ξ g (ContinuousMap.toLp 2 (measure A hA ξ) ℝ f)= + ContinuousMap.toLp 2 (measure A hA ξ) ℝ (g*f) := by + apply Lp.ext + filter_upwards [multiply_ae A hA ξ g (ContinuousMap.toLp 2 (measure A hA ξ) ℝ f), + f.coeFn_toLp (𝕜 := ℝ) (p := 2) (measure A hA ξ), + (g*f).coeFn_toLp (𝕜 := ℝ) (p := 2) (measure A hA ξ)] with x h₁ h₂ h₃ + rw [h₁,h₂,h₃] + rfl + + theorem realize_multiply (g : C(Space A,ℝ)) (f : Lp ℝ 2 (measure A hA ξ)) : + realize A hA ξ (multiply A hA ξ g f)=cfcHom hA g (realize A hA ξ f) := by + have hd := ContinuousMap.toLp_denseRange ℝ (measure A hA ξ) ℝ (p := 2) (by norm_num : (2:ℝ≥0∞)≠∞) + refine hd.induction_on (p := fun f => realize A hA ξ (multiply A hA ξ g f)=cfcHom hA g (realize A hA ξ f)) f (isClosed_eq ((realize A hA ξ).continuous.comp (multiply A hA ξ g).continuous) + ((cfcHom hA g).continuous.comp (realize A hA ξ).continuous)) ?_ + intro q + rw [multiply_continuous,realize_continuous,realize_continuous,map_mul,mul_apply_eq_comp] + + theorem realize_coordinate (f : Lp ℝ 2 (measure A hA ξ)) : + realize A hA ξ (multiply A hA ξ ((ContinuousMap.id ℝ).restrict (spectrum ℝ A)) f)= + A (realize A hA ξ f) := by + rw [realize_multiply,cfcHom_id] + +end +open MeasureTheory Filter +variable {H : Type u_4} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +local instance : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H +variable (A : H →L[ℂ] H) (hA : IsSelfAdjoint A) (ξ : H) + +def atom (x : Space A) : Lp ℝ 2 (measure A hA ξ) := + indicatorConstLp 2 (measurableSet_singleton x) (measure_ne_top _ _) (1:ℝ) + + theorem atom_ae (x : Space A) : + atom A hA ξ x =ᵐ[measure A hA ξ] ({x} : Set (Space A)).indicator (fun _ => (1:ℝ)) := + indicatorConstLp_coeFn + + theorem multiply_atom (x : Space A) : + multiply A hA ξ ((ContinuousMap.id ℝ).restrict (spectrum ℝ A)) (atom A hA ξ x)= + (x:ℝ) • atom A hA ξ x := by + classical + apply Lp.ext + filter_upwards [multiply_ae A hA ξ ((ContinuousMap.id ℝ).restrict (spectrum ℝ A)) (atom A hA ξ x), + atom_ae A hA ξ x,Lp.coeFn_smul (x:ℝ) (atom A hA ξ x)] with y h₁ h₂ h₃ + rw [h₁,h₃] + change (y:ℝ)*atom A hA ξ x y=(x:ℝ)*atom A hA ξ x y + rw [h₂] + by_cases hy : y=x + · subst y; rfl + · simp [Set.indicator_of_notMem,hy] + + theorem realize_atom_eigen (x : Space A) : + A (realize A hA ξ (atom A hA ξ x))=(x:ℝ) • realize A hA ξ (atom A hA ξ x) := by + rw [← realize_coordinate,multiply_atom,map_smul] + + theorem realize_one : realize A hA ξ (ContinuousMap.toLp 2 (measure A hA ξ) ℝ (1:C(Space A,ℝ)))=ξ := by + rw [realize_continuous,map_one,one_apply_eq_self] + + theorem realize_atom_inner (x : Space A) : + inner ℝ ξ (realize A hA ξ (atom A hA ξ x))=(measure A hA ξ).real {x} := by + have hm := (isometry A hA ξ).inner_map_map + (ContinuousMap.toLp 2 (measure A hA ξ) ℝ (1:C(Space A,ℝ))) (atom A hA ξ x) + change inner ℝ (realize A hA ξ (ContinuousMap.toLp 2 (measure A hA ξ) ℝ (1:C(Space A,ℝ)))) + (realize A hA ξ (atom A hA ξ x))=_ at hm + rw [realize_one] at hm + rw [hm,real_inner_comm] + change inner ℝ (indicatorConstLp 2 (measurableSet_singleton x) (measure_ne_top _ _) (1:ℝ)) + (ContinuousMap.toLp 2 (measure A hA ξ) ℝ (1:C(Space A,ℝ)))=_ + rw [L2.inner_indicatorConstLp_one] + calc + _ = ∫ _ in ({x}:Set (Space A)), (1:ℝ) ∂measure A hA ξ := by + apply setIntegral_congr_ae (measurableSet_singleton x) + exact ((1:C(Space A,ℝ)).coeFn_toLp (𝕜 := ℝ) (p := 2) (measure A hA ξ)).mono (fun y hy _ => hy) + _ = _ := by simp [Measure.real] + + theorem singleton_eq_zero (x : Space A) + (he : ∀ η : H, A η=(x:ℝ) • η → inner ℝ ξ η=0) : measure A hA ξ {x}=0 := by + have hm : (measure A hA ξ).real {x}=0 := + (realize_atom_inner A hA ξ x).symm.trans (he _ (realize_atom_eigen A hA ξ x)) + exact (ENNReal.toReal_eq_zero_iff _).mp hm |>.resolve_right (measure_ne_top _ _) + + theorem noAtoms (he : ∀ (r:ℝ) (η:H), A η=r • η → inner ℝ ξ η=0) : + NullSingletonClass (measure A hA ξ) := by + constructor + intro x + exact singleton_eq_zero A hA ξ x (he x) + +end FreeGroupFactorMain.CyclicSpectral + +end + +namespace FreeGroupFactorMain.WeightedFock + +section +open FreeFock Amplification MeasureTheory CyclicSpectral + +instance oldBaseOp_probability (u v : ℝ) : + IsProbabilityMeasure (measure (oldBaseOp u v (0:ℕ) 1) (oldBaseOp_selfAdjoint u v 0 1) pRoot) := + probability _ _ _ pRoot_norm + +theorem oldBaseOp_noAtoms (u v : ℝ) (hv : 0 ((pRepresentation (ι := ℕ)).symm T : Operator ℕ)) := by + simp_rw [pRepresentation_symm_val] + exact continuous_const.clm_comp (continuous_id.clm_comp continuous_const) + +theorem representedBase_closed : IsClosed (representedBase u v : Set (PRange ℕ →L[ℂ] PRange ℕ)) := by + have hF : IsClosed (filledEdgeAlgebra u v (0:ℕ) 1 : Set (Operator ℕ)) := Set.isClosed_centralizer _ + exact hF.preimage pRepresentation_symm_coe_continuous + +theorem oldBaseOp_mem_representedBase (hv : 0 by + simpa only [representedBase, StarSubalgebra.mem_comap, StarAlgHom.comp_apply] using + (weightedUniform_mem u v hv hvu a)) + +theorem weightedUniform_state (hv : 0 (hgood x hx).2), + fun x hx => (hgood x hx).1⟩ + +end Invariant233.SimultaneousLusin + +namespace Invariant233.StrongLusin + +theorem exists_compact_strong_and_continuousOn_of_ae {𝕜 X E F ι J : Type*} + {Y : J → Type*} + [RCLike 𝕜] [TopologicalSpace X] [PolishSpace X] + [MeasurableSpace X] [BorelSpace X] + [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] + [NormedAddCommGroup F] [NormedSpace 𝕜 F] + [MeasurableSpace F] [BorelSpace F] [SecondCountableTopology F] + [∀ j, TopologicalSpace (Y j)] [∀ j, MeasurableSpace (Y j)] + [∀ j, OpensMeasurableSpace (Y j)] [∀ j, SecondCountableTopology (Y j)] + [Countable ι] [Countable J] (μ : Measure X) [IsFiniteMeasure μ] + (A : X → E →L[𝕜] F) {C : ℝ} (hC : 0 ≤ C) + (hbound : ∀ᵐ x ∂μ, ‖A x‖ ≤ C) (b : HilbertBasis ι 𝕜 E) + (hcolumns : ∀ i, AEMeasurable (fun x => A x (b i)) μ) + (g : ∀ j, X → Y j) (hg : ∀ j, AEMeasurable (g j) μ) + {p : X → Prop} (hp : ∀ᵐ x ∂μ, p x) + {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ Q : Set X, IsCompact Q ∧ μ Qᶜ < ε ∧ + (∀ v : E, ContinuousOn (fun x => A x v) Q) ∧ + (∀ j, ContinuousOn (g j) Q) ∧ + ∀ x ∈ Q, p x ∧ ‖A x‖ ≤ C := by + have hmeas : AEMeasurable (fun x => ((fun i => A x (b i)), (fun j => g j x))) μ := + (AEMeasurable.of_eval hcolumns).prodMk (AEMeasurable.of_eval hg) + obtain ⟨Q, hQ, hsmall, hcont, hgood⟩ := + SimultaneousLusin.exists_compact_continuousOn_of_aemeasurable μ hmeas (hp.and hbound) hε + refine ⟨Q, hQ, hsmall, ?_, continuousOn_pi.mp hcont.snd, hgood⟩ + exact fun v => StrongContinuityFromColumns.continuousOn_apply_of_hilbertBasis A hC + (fun x hx => (hgood x hx).2) b (continuousOn_pi.mp hcont.fst) v + +end Invariant233.StrongLusin + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/AtomOrbit.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/AtomOrbit.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7c875889924a74e1ccfe77d0542fb97920bd482 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/AtomOrbit.lean @@ -0,0 +1,134 @@ +import Mathlib + +namespace OAI + +namespace Invariant233.AtomOrbit + +open scoped BigOperators + +variable {α : Type*} [DistribLattice α] [BoundedOrder α] +variable (mass : α → ℝ) +variable (mass_bot : mass ⊥ = 0) +variable (mass_mono : Monotone mass) +variable (mass_sup : ∀ a b, Disjoint a b → mass (a ⊔ b) = mass a + mass b) + +include mass_bot mass_sup in + +theorem mass_finset_sup_of_atoms (s : Finset α) + (hs : ∀ a ∈ s, IsAtom a) : + mass (s.sup id) = ∑ a ∈ s, mass a := by + classical + induction s using Finset.induction_on with + | empty => simpa using mass_bot + | @insert a s ha ih => + have hsa : IsAtom a := hs a (Finset.mem_insert_self a s) + have hss : ∀ b ∈ s, IsAtom b := fun b hb => hs b (Finset.mem_insert_of_mem hb) + have hd : Disjoint a (s.sup id) := by + apply Finset.disjoint_sup_right.mpr + intro b hb + exact hsa.disjoint_of_ne (hss b hb) (fun hab => ha (hab ▸ hb)) + rw [Finset.sup_insert] + change mass (a ⊔ s.sup id) = ∑ b ∈ insert a s, mass b + rw [mass_sup a (s.sup id) hd, ih hss, Finset.sum_insert ha] + +include mass_bot mass_mono mass_sup in + +theorem sum_atoms_le_total (s : Finset α) (hs : ∀ a ∈ s, IsAtom a) : + (∑ a ∈ s, mass a) ≤ mass ⊤ := by + rw [← mass_finset_sup_of_atoms mass mass_bot mass_sup s hs] + exact mass_mono le_top + +include mass_bot mass_mono mass_sup in + +theorem finite_atoms_mass_ge {δ : ℝ} (hδ : 0 < δ) : + {a : α | IsAtom a ∧ δ ≤ mass a}.Finite := by + classical + by_contra hfin + have hinf : Set.Infinite {a : α | IsAtom a ∧ δ ≤ mass a} := hfin + obtain ⟨n, hn⟩ := exists_nat_gt (mass ⊤ / δ) + obtain ⟨s, hs, hcard⟩ := hinf.exists_subset_card_eq n + have hsmall : (n : ℝ) * δ ≤ ∑ a ∈ s, mass a := by + calc + (n : ℝ) * δ = ∑ _a ∈ s, δ := by simp [hcard] + _ ≤ ∑ a ∈ s, mass a := Finset.sum_le_sum fun a ha => (hs ha).2 + have hbound := sum_atoms_le_total mass mass_bot mass_mono mass_sup s + (fun a ha => (hs ha).1) + have hlarge : mass ⊤ < (n : ℝ) * δ := (div_lt_iff₀ hδ).mp hn + linarith + +theorem isAtom_iterate (e : α ≃o α) {a : α} (ha : IsAtom a) (n : ℕ) : + IsAtom ((e : α → α)^[n] a) := by + induction n with + | zero => exact ha + | succ n ih => + rw [Function.iterate_succ_apply'] + exact (e.isAtom_iff _).mpr ih + +omit [BoundedOrder α] in +theorem mass_iterate [BoundedOrder α] (e : α ≃o α) (he : ∀ a, mass (e a) = mass a) + (a : α) (n : ℕ) : mass ((e : α → α)^[n] a) = mass a := by + induction n with + | zero => rfl + | succ n ih => + rw [Function.iterate_succ_apply', he, ih] + +include mass_bot mass_mono mass_sup in + +theorem finite_orbit_of_atom (e : α ≃o α) (he : ∀ a, mass (e a) = mass a) + {a : α} (ha : IsAtom a) (hpos : 0 < mass a) : + (Set.range fun n : ℕ => (e : α → α)^[n] a).Finite := by + apply (finite_atoms_mass_ge mass mass_bot mass_mono mass_sup hpos).subset + rintro b ⟨n, rfl⟩ + exact ⟨isAtom_iterate e ha n, (mass_iterate mass e he a n).ge⟩ + +omit [BoundedOrder α] in +theorem exists_pos_period_of_finite_orbit [BoundedOrder α] (e : α ≃o α) (a : α) + (hfin : (Set.range fun n : ℕ => (e : α → α)^[n] a).Finite) : + ∃ n : ℕ, 0 < n ∧ (e : α → α)^[n] a = a := by + classical + have hnot : ¬ Function.Injective (fun n : ℕ => (e : α → α)^[n] a) := by + intro hinj + exact (Set.infinite_range_of_injective hinj) hfin + simp only [Function.Injective, not_forall] at hnot + obtain ⟨m, n, heq, hne⟩ := hnot + rcases lt_or_gt_of_ne hne with hlt | hlt + · exact ⟨n - m, Nat.sub_pos_of_lt hlt, Function.iterate_cancel e.injective heq.symm⟩ + · exact ⟨m - n, Nat.sub_pos_of_lt hlt, Function.iterate_cancel e.injective heq⟩ + +include mass_bot mass_mono mass_sup in + +theorem exists_pos_period_of_atom (e : α ≃o α) (he : ∀ a, mass (e a) = mass a) + {a : α} (ha : IsAtom a) (hpos : 0 < mass a) : + ∃ n : ℕ, 0 < n ∧ (e : α → α)^[n] a = a := + exists_pos_period_of_finite_orbit e a + (finite_orbit_of_atom mass mass_bot mass_mono mass_sup e he ha hpos) + +include mass_bot mass_mono mass_sup in + +theorem atom_eq_top_of_total_ergodicity (e : α ≃o α) + (he : ∀ a, mass (e a) = mass a) + (hfaithful : ∀ a, a ≠ ⊥ → 0 < mass a) + (htotal : ∀ (n : ℕ), 0 < n → ∀ a, (e : α → α)^[n] a = a → a = ⊥ ∨ a = ⊤) + {a : α} (ha : IsAtom a) : a = ⊤ := by + obtain ⟨n, hn, hperiod⟩ := exists_pos_period_of_atom mass mass_bot mass_mono + mass_sup e he ha (hfaithful a ha.ne_bot) + exact (htotal n hn a hperiod).resolve_left ha.ne_bot + +include mass_bot mass_mono mass_sup in + +theorem no_atoms_of_total_ergodicity (e : α ≃o α) + (he : ∀ a, mass (e a) = mass a) + (hfaithful : ∀ a, a ≠ ⊥ → 0 < mass a) + (htotal : ∀ (n : ℕ), 0 < n → ∀ a, (e : α → α)^[n] a = a → a = ⊥ ∨ a = ⊤) + (hnontrivial : ∃ b : α, b ≠ ⊥ ∧ b ≠ ⊤) : + ∀ a : α, ¬ IsAtom a := by + intro a ha + have hatop := atom_eq_top_of_total_ergodicity mass mass_bot mass_mono mass_sup + e he hfaithful htotal ha + obtain ⟨b, hb0, hb1⟩ := hnontrivial + have hbat : b ≤ a := hatop ▸ le_top + exact (ha.le_iff.mp hbat).elim hb0 (fun hba => hb1 (hba.trans hatop)) + +end Invariant233.AtomOrbit + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/AttenuationChoice.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/AttenuationChoice.lean new file mode 100644 index 0000000000000000000000000000000000000000..f90079762239545a4e9e243948e6efa6e7adcd3e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/AttenuationChoice.lean @@ -0,0 +1,67 @@ +import Mathlib +import OAI.Analysis.IrrationalRotation.Analysis.FiniteConvolution + +namespace OAI + +namespace InvariantProjection + +theorem exists_attenuation (K : ℕ) (j ε Lprev : ℝ) + (hj : 0 < j) (hε : 0 < ε) : + ∃ L : ℝ, 1 ≤ L ∧ Lprev ≤ L ∧ + (2 * (K : ℝ) + 1) * 3 * Real.exp (-L / 10000) ≤ ε / j := by + have hlim : Filter.Tendsto + (fun L : ℝ => (2 * (K : ℝ) + 1) * 3 * Real.exp (-L / 10000)) + Filter.atTop (nhds 0) := by + have hneg : Filter.Tendsto (fun L : ℝ => -L / 10000) + Filter.atTop Filter.atBot := by + simpa only [neg_div, Function.comp_def, id_eq] using + (Filter.tendsto_neg_atTop_atBot.comp + (Filter.tendsto_id.atTop_div_const (by norm_num : (0 : ℝ) < 10000))) + simpa using (Real.tendsto_exp_atBot.comp hneg).const_mul + ((2 * (K : ℝ) + 1) * 3) + have herr := hlim.eventually (gt_mem_nhds (div_pos hε hj)) + obtain ⟨L, hL, hp, he⟩ := Filter.Eventually.exists + ((Filter.eventually_ge_atTop (1 : ℝ)).and + ((Filter.eventually_ge_atTop Lprev).and herr)) + exact ⟨L, hL, hp, le_of_lt he⟩ + +theorem exists_sqrt_threshold (κ L : ℝ) (hκ : 0 < κ) : + ∃ G : ℕ, 1 ≤ G ∧ L ≤ κ * Real.sqrt G := by + obtain ⟨G, hG⟩ := exists_nat_gt (max 1 (max L 0 / κ) ^ 2) + have hG1 : 1 ≤ G := by + have : (1 : ℝ) < G := lt_of_le_of_lt (by nlinarith [le_max_left (1 : ℝ) (max L 0 / κ)]) hG + exact_mod_cast (le_of_lt this) + have hx : 0 ≤ max L 0 / κ := div_nonneg (le_max_right _ _) hκ.le + have hsq : (max L 0 / κ) ^ 2 ≤ (G : ℝ) := by + refine le_trans ?_ hG.le + have hmax : max L 0 / κ ≤ max 1 (max L 0 / κ) := le_max_right _ _ + nlinarith [le_max_left (1 : ℝ) (max L 0 / κ)] + have hsqrt : max L 0 / κ ≤ Real.sqrt (G : ℝ) := + (Real.le_sqrt hx (by positivity : (0 : ℝ) ≤ G)).mpr hsq + refine ⟨G, hG1, ?_⟩ + have hmul := mul_le_mul_of_nonneg_left hsqrt hκ.le + calc L ≤ max L 0 := le_max_left _ _ + _ = κ * (max L 0 / κ) := by field_simp + _ ≤ κ * Real.sqrt G := hmul + +theorem exists_coefficient_attenuation (K : ℕ) (D j Lprev : ℝ) + (hj : 0 < j) : + ∃ ε L : ℝ, ∃ G : ℕ, + 0 < ε ∧ 1 ≤ L ∧ Lprev ≤ L ∧ 1 ≤ G ∧ + (2 * (K : ℝ) + 1) * 3 * Real.exp (-L / 10000) ≤ ε / j ∧ + L ≤ (1 / (100 * (j + 1))) * Real.sqrt G ∧ + ∀ a b : FiniteConvolution.Coefficients K, + (∀ i, ‖a i‖ ≤ D) → (∀ i, ‖b i‖ ≤ D) → + 1 / j ≤ ‖a (FiniteConvolution.center K)‖ → + 1 / j ≤ ‖b (FiniteConvolution.center K)‖ → + ∃ n : Fin (2 * K + 1), ε ≤ ‖FiniteConvolution.lowProduct a b n‖ := by + obtain ⟨ε, hε, hcoeff⟩ := + FiniteConvolution.uniform_lower_bound K D (1 / j) (by positivity) + obtain ⟨L, hL, hprev, hsmall⟩ := exists_attenuation K j ε Lprev hj hε + obtain ⟨G, hG, hlarge⟩ := + exists_sqrt_threshold (1 / (100 * (j + 1))) L (by positivity) + exact ⟨ε, L, G, hε, hL, hprev, hG, hsmall, hlarge, hcoeff⟩ + +end InvariantProjection + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BVDiscrepancy.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BVDiscrepancy.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd0b9e4d52f3a0ec37645cfdf1dcb9837e1efae8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BVDiscrepancy.lean @@ -0,0 +1,387 @@ +import Mathlib.Analysis.BoundedVariation +import Mathlib.MeasureTheory.Integral.DominatedConvergence +import Mathlib.MeasureTheory.Function.Floor +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Tactic + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology BigOperators ENNReal + +namespace Invariant233.BVDiscrepancy + +def unitMeasure : Measure ℝ := volume.restrict (Icc 0 1) + +instance : IsProbabilityMeasure unitMeasure := by + constructor + simp [unitMeasure] + +def tail (a x : ℝ) : ℂ := (Icc a 1).indicator (fun _ => 1) x + +lemma measurable_tail (a : ℝ) : Measurable (tail a) := + measurable_const.indicator measurableSet_Icc + +lemma norm_tail_le_one (a x : ℝ) : ‖tail a x‖ ≤ 1 := by + by_cases hx : x ∈ Icc a 1 <;> simp [tail, hx] + +lemma integrable_tail {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + [IsFiniteMeasure μ] {X : Ω → ℝ} (hX : Measurable X) (a : ℝ) : + Integrable (fun ω => tail a (X ω)) μ := by + apply Integrable.mono' (integrable_const (1 : ℝ)) + ((measurable_tail a).comp hX).aestronglyMeasurable + exact Filter.Eventually.of_forall fun ω => norm_tail_le_one a (X ω) + +lemma integral_tail {a : ℝ} (ha : a ∈ Icc 0 1) : + ∫ x, tail a x ∂unitMeasure = ((1 - a : ℝ) : ℂ) := by + simp only [tail] + rw [integral_indicator measurableSet_Icc] + simp only [unitMeasure, Measure.restrict_restrict measurableSet_Icc] + rw [inter_eq_left.mpr (Icc_subset_Icc ha.1 le_rfl)] + simp [max_eq_left (sub_nonneg.mpr ha.2)] + +def coefficient (f : ℝ → ℂ) (N k : ℕ) : ℂ := + if k = 0 then f 0 else f ((k : ℝ) / N) - f (((k - 1 : ℕ) : ℝ) / N) + +def step (f : ℝ → ℂ) (N : ℕ) (x : ℝ) : ℂ := + ∑ k ∈ Finset.range (N + 1), coefficient f N k * tail ((k : ℝ) / N) x + +@[simp] lemma coefficient_zero (f : ℝ → ℂ) (N : ℕ) : coefficient f N 0 = f 0 := by + simp [coefficient] + +@[simp] lemma coefficient_succ (f : ℝ → ℂ) (N k : ℕ) : + coefficient f N (k + 1) = f (((k : ℝ) + 1) / N) - f ((k : ℝ) / N) := by + simp [coefficient] + +lemma sum_coefficient (f : ℝ → ℂ) (N r : ℕ) : + ∑ k ∈ Finset.range (r + 1), coefficient f N k = f ((r : ℝ) / N) := by + induction r with + | zero => simp + | succ r hr => + rw [Finset.sum_range_succ, hr, coefficient_succ] + simp only [Nat.cast_add, Nat.cast_one] + abel + +lemma sum_norm_coefficient_le (f : ℝ → ℂ) {N : ℕ} (hN : 0 < N) + (hf : BoundedVariationOn f (Icc (0 : ℝ) 1)) : + ∑ k ∈ Finset.range (N + 1), ‖coefficient f N k‖ ≤ + ‖f 0‖ + (eVariationOn f (Icc (0 : ℝ) 1)).toReal := by + rw [Finset.sum_range_succ'] + simp only [coefficient_zero, coefficient_succ] + have hNp : (0 : ℝ) < N := Nat.cast_pos.mpr hN + have hv := eVariationOn.sum_le_of_monotoneOn_Iic (f := f) (s := Icc (0 : ℝ) 1) (n := N) + (u := fun k : ℕ => (k : ℝ) / N) + (fun i _ j _ hij => div_le_div_of_nonneg_right (Nat.cast_le.mpr hij) hNp.le) + (fun i hi => ⟨div_nonneg (Nat.cast_nonneg _) hNp.le, + (div_le_one hNp).mpr (Nat.cast_le.mpr hi)⟩) + have hv' : + ENNReal.ofReal (∑ k ∈ Finset.range N, + ‖f (((k : ℝ) + 1) / N) - f ((k : ℝ) / N)‖) ≤ + eVariationOn f (Icc (0 : ℝ) 1) := by + rw [ENNReal.ofReal_sum_of_nonneg (fun _ _ => norm_nonneg _)] + simpa only [edist_dist, dist_eq_norm, Nat.cast_add, Nat.cast_one] using hv + have := (ENNReal.toReal_mono hf hv') + rw [ENNReal.toReal_ofReal (Finset.sum_nonneg fun _ _ => norm_nonneg _)] at this + linarith + +lemma measurable_step (f : ℝ → ℂ) (N : ℕ) : Measurable (step f N) := by + unfold step + exact Finset.measurable_sum _ fun k _ => measurable_const.mul (measurable_tail _) + +lemma norm_step_le (f : ℝ → ℂ) {N : ℕ} (hN : 0 < N) + (hf : BoundedVariationOn f (Icc (0 : ℝ) 1)) (x : ℝ) : + ‖step f N x‖ ≤ ‖f 0‖ + (eVariationOn f (Icc (0 : ℝ) 1)).toReal := by + calc + ‖step f N x‖ ≤ ∑ k ∈ Finset.range (N + 1), + ‖coefficient f N k * tail ((k : ℝ) / N) x‖ := norm_sum_le _ _ + _ ≤ ∑ k ∈ Finset.range (N + 1), ‖coefficient f N k‖ := by + apply Finset.sum_le_sum + intro k hk + rw [norm_mul] + exact mul_le_of_le_one_right (norm_nonneg _) (norm_tail_le_one _ _) + _ ≤ _ := sum_norm_coefficient_le f hN hf + +lemma step_eq_floor (f : ℝ → ℂ) {N : ℕ} (hN : 0 < N) + {x : ℝ} (hx : x ∈ Icc 0 1) : + step f N x = f ((⌊(N : ℝ) * x⌋₊ : ℝ) / N) := by + have hNp : (0 : ℝ) < N := Nat.cast_pos.mpr hN + have hNx : 0 ≤ (N : ℝ) * x := mul_nonneg hNp.le hx.1 + have hr : ⌊(N : ℝ) * x⌋₊ ≤ N := by + apply Nat.floor_le_of_le + simpa using mul_le_mul_of_nonneg_left hx.2 hNp.le + have htail (k : ℕ) : tail ((k : ℝ) / N) x = + if k ≤ ⌊(N : ℝ) * x⌋₊ then 1 else 0 := by + have hiff : (k : ℝ) / N ≤ x ↔ k ≤ ⌊(N : ℝ) * x⌋₊ := by + rw [div_le_iff₀ hNp, Nat.le_floor_iff hNx] + rw [mul_comm] + simp [tail, Set.indicator_apply, hx.2, hiff] + unfold step + simp_rw [htail, mul_ite, mul_one, mul_zero] + calc + ∑ k ∈ Finset.range (N + 1), + (if k ≤ ⌊(N : ℝ) * x⌋₊ then coefficient f N k else 0) = + ∑ k ∈ Finset.range (⌊(N : ℝ) * x⌋₊ + 1), coefficient f N k := by + calc + _ = ∑ k ∈ Finset.range (⌊(N : ℝ) * x⌋₊ + 1), + (if k ≤ ⌊(N : ℝ) * x⌋₊ then coefficient f N k else 0) := by + symm + apply Finset.sum_subset (Finset.range_mono (Nat.succ_le_succ hr)) + intro k hk hkr + simp only [Finset.mem_range, not_lt] at hkr + simp [show ¬ k ≤ ⌊(N : ℝ) * x⌋₊ by omega] + _ = _ := by + apply Finset.sum_congr rfl + intro k hk + simp only [Finset.mem_range] at hk + simp [Nat.le_of_lt_succ hk] + _ = _ := sum_coefficient f N _ + +lemma tendsto_step_of_continuousAt (f : ℝ → ℂ) {x : ℝ} + (hx : x ∈ Icc 0 1) (hcont : ContinuousAt f x) : + Tendsto (fun n : ℕ => step f (n + 1) x) atTop (𝓝 (f x)) := by + have hgrid := (tendsto_nat_floor_mul_div_atTop hx.1).comp + (tendsto_natCast_atTop_atTop.comp (tendsto_add_atTop_nat 1)) + have hgrid' : Tendsto (fun n : ℕ => + (⌊(((n + 1 : ℕ) : ℝ) * x)⌋₊ : ℝ) / (n + 1 : ℕ)) atTop (𝓝 x) := by + simpa only [Function.comp_def, mul_comm x] using hgrid + convert hcont.tendsto.comp hgrid' using 1 + funext n + exact step_eq_floor f (Nat.succ_pos n) hx + +lemma ae_tendsto_step (f : ℝ → ℂ) + (hf : BoundedVariationOn f (Icc (0 : ℝ) 1)) : + ∀ᵐ x ∂unitMeasure, + Tendsto (fun n : ℕ => step f (n + 1) x) atTop (𝓝 (f x)) := by + have hf' : BoundedVariationOn f (uIcc (0 : ℝ) 1) := by simpa using hf + have hdiff := hf'.ae_differentiableAt_of_mem_uIcc + have hdiff' : ∀ᵐ x ∂unitMeasure, x ∈ Icc (0 : ℝ) 1 → DifferentiableAt ℝ f x := by + exact ae_restrict_of_ae (by simpa using hdiff) + filter_upwards [hdiff', ae_restrict_mem (μ := volume) measurableSet_Icc] with x hd hx + exact tendsto_step_of_continuousAt f hx (hd hx).continuousAt + +lemma ae_tendsto_step_comp {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} + {X : Ω → ℝ} (hX : Measurable X) (hXac : μ.map X ≪ unitMeasure) + (f : ℝ → ℂ) (hf : BoundedVariationOn f (Icc (0 : ℝ) 1)) : + ∀ᵐ ω ∂μ, Tendsto (fun n : ℕ => step f (n + 1) (X ω)) atTop (𝓝 (f (X ω))) := + ae_of_ae_map hX.aemeasurable (hXac.ae_le (ae_tendsto_step f hf)) + +lemma integrable_tail_mul {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + [IsFiniteMeasure μ] {X Y : Ω → ℝ} (hX : Measurable X) (hY : Measurable Y) + (a b : ℝ) : Integrable (fun ω => tail a (X ω) * tail b (Y ω)) μ := by + apply Integrable.mono' (integrable_const (1 : ℝ)) + (((measurable_tail a).comp hX).mul ((measurable_tail b).comp hY)).aestronglyMeasurable + apply Filter.Eventually.of_forall + intro ω + change ‖tail a (X ω) * tail b (Y ω)‖ ≤ 1 + rw [norm_mul] + calc + _ ≤ 1 * ‖tail b (Y ω)‖ := + mul_le_mul_of_nonneg_right (norm_tail_le_one _ _) (norm_nonneg _) + _ ≤ 1 := by simpa only [one_mul] using norm_tail_le_one b (Y ω) + +theorem finite_test_discrepancy {Ω ι κ : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) (s : Finset ι) (t : Finset κ) + (a : ι → ℂ) (b : κ → ℂ) (u : ι → Ω → ℂ) (v : κ → Ω → ℂ) + (m : ι → ℂ) (n : κ → ℂ) (ε : ℝ) + (hint : ∀ i ∈ s, ∀ j ∈ t, Integrable (fun ω => u i ω * v j ω) μ) + (hdisc : ∀ i ∈ s, ∀ j ∈ t, + ‖(∫ ω, u i ω * v j ω ∂μ) - m i * n j‖ ≤ ε) : + ‖(∫ ω, (∑ i ∈ s, a i * u i ω) * (∑ j ∈ t, b j * v j ω) ∂μ) - + (∑ i ∈ s, a i * m i) * (∑ j ∈ t, b j * n j)‖ ≤ + ε * (∑ i ∈ s, ‖a i‖) * (∑ j ∈ t, ‖b j‖) := by + have hint' (i : ι) (hi : i ∈ s) (j : κ) (hj : j ∈ t) : + Integrable (fun ω => (a i * u i ω) * (b j * v j ω)) μ := by + simpa only [mul_assoc, mul_left_comm, mul_comm] using + (hint i hi j hj).const_mul (a i * b j) + have hI : + (∫ ω, (∑ i ∈ s, a i * u i ω) * (∑ j ∈ t, b j * v j ω) ∂μ) = + ∑ i ∈ s, ∑ j ∈ t, (a i * b j) * (∫ ω, u i ω * v j ω ∂μ) := by + simp_rw [Finset.sum_mul_sum] + rw [integral_finsetSum s (fun i hi => integrable_finsetSum t (hint' i hi))] + apply Finset.sum_congr rfl + intro i hi + rw [integral_finsetSum t (hint' i hi)] + apply Finset.sum_congr rfl + intro j hj + have heq : (fun ω => a i * u i ω * (b j * v j ω)) = + fun ω => (a i * b j) * (u i ω * v j ω) := by funext ω; ring + rw [heq, integral_const_mul] + have hrewrite : + (∫ ω, (∑ i ∈ s, a i * u i ω) * (∑ j ∈ t, b j * v j ω) ∂μ) - + (∑ i ∈ s, a i * m i) * (∑ j ∈ t, b j * n j) = + ∑ i ∈ s, ∑ j ∈ t, (a i * b j) * ((∫ ω, u i ω * v j ω ∂μ) - m i * n j) := by + rw [hI, Finset.sum_mul_sum] + simp_rw [← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro i hi + apply Finset.sum_congr rfl + intro j hj + ring + rw [hrewrite] + calc + ‖∑ i ∈ s, ∑ j ∈ t, + (a i * b j) * ((∫ ω, u i ω * v j ω ∂μ) - m i * n j)‖ ≤ + ∑ i ∈ s, ∑ j ∈ t, + ‖(a i * b j) * ((∫ ω, u i ω * v j ω ∂μ) - m i * n j)‖ := by + exact (norm_sum_le _ _).trans (Finset.sum_le_sum fun _ _ => norm_sum_le _ _) + _ ≤ ∑ i ∈ s, ∑ j ∈ t, ‖a i‖ * ‖b j‖ * ε := by + apply Finset.sum_le_sum + intro i hi + apply Finset.sum_le_sum + intro j hj + simp only [norm_mul] + exact mul_le_mul_of_nonneg_left (hdisc i hi j hj) + (mul_nonneg (norm_nonneg _) (norm_nonneg _)) + _ = ε * (∑ i ∈ s, ‖a i‖) * (∑ j ∈ t, ‖b j‖) := by + simp only [Finset.mul_sum, Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i hi + apply Finset.sum_congr rfl + intro j hj + ring + +lemma integral_step (f : ℝ → ℂ) (N : ℕ) : + ∫ x, step f N x ∂unitMeasure = + ∑ k ∈ Finset.range (N + 1), coefficient f N k * (∫ x, tail ((k : ℝ) / N) x ∂unitMeasure) := by + unfold step + rw [integral_finsetSum] + · simp only [integral_const_mul] + · intro k hk + exact (integrable_tail unitMeasure measurable_id _).const_mul _ + +theorem step_discrepancy {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) [IsFiniteMeasure μ] {X Y : Ω → ℝ} + (hX : Measurable X) (hY : Measurable Y) {ε : ℝ} (hε : 0 ≤ ε) + (hrect : ∀ a ∈ Icc (0 : ℝ) 1, ∀ b ∈ Icc (0 : ℝ) 1, + ‖(∫ ω, tail a (X ω) * tail b (Y ω) ∂μ) - + ((1 - a : ℝ) : ℂ) * ((1 - b : ℝ) : ℂ)‖ ≤ ε) + (f g : ℝ → ℂ) (hf : BoundedVariationOn f (Icc (0 : ℝ) 1)) + (hg : BoundedVariationOn g (Icc (0 : ℝ) 1)) {N : ℕ} (hN : 0 < N) : + ‖(∫ ω, step f N (X ω) * step g N (Y ω) ∂μ) - + (∫ x, step f N x ∂unitMeasure) * (∫ y, step g N y ∂unitMeasure)‖ ≤ + ε * (‖f 0‖ + (eVariationOn f (Icc (0 : ℝ) 1)).toReal) * + (‖g 0‖ + (eVariationOn g (Icc (0 : ℝ) 1)).toReal) := by + have hgrid (k : ℕ) (hk : k ∈ Finset.range (N + 1)) : + (k : ℝ) / N ∈ Icc (0 : ℝ) 1 := by + have hNp : (0 : ℝ) < N := Nat.cast_pos.mpr hN + exact ⟨div_nonneg (Nat.cast_nonneg _) hNp.le, + (div_le_one hNp).mpr (Nat.cast_le.mpr (Nat.le_of_lt_succ (Finset.mem_range.mp hk)))⟩ + have h := finite_test_discrepancy μ (Finset.range (N + 1)) (Finset.range (N + 1)) + (coefficient f N) (coefficient g N) + (fun i ω => tail ((i : ℝ) / N) (X ω)) + (fun j ω => tail ((j : ℝ) / N) (Y ω)) + (fun i => ∫ x, tail ((i : ℝ) / N) x ∂unitMeasure) + (fun j => ∫ y, tail ((j : ℝ) / N) y ∂unitMeasure) ε + (fun i _ j _ => integrable_tail_mul μ hX hY _ _) + (fun i hi j hj => by + rw [integral_tail (hgrid i hi), integral_tail (hgrid j hj)] + exact hrect _ (hgrid i hi) _ (hgrid j hj)) + rw [← integral_step f N, ← integral_step g N] at h + change ‖(∫ ω, step f N (X ω) * step g N (Y ω) ∂μ) - + (∫ x, step f N x ∂unitMeasure) * (∫ y, step g N y ∂unitMeasure)‖ ≤ _ at h + apply h.trans + apply mul_le_mul + · exact mul_le_mul_of_nonneg_left (sum_norm_coefficient_le f hN hf) hε + · exact sum_norm_coefficient_le g hN hg + · exact Finset.sum_nonneg fun _ _ => norm_nonneg _ + · positivity + +lemma tendsto_integral_step (f : ℝ → ℂ) + (hf : BoundedVariationOn f (Icc (0 : ℝ) 1)) : + Tendsto (fun n : ℕ => ∫ x, step f (n + 1) x ∂unitMeasure) atTop + (𝓝 (∫ x, f x ∂unitMeasure)) := by + apply tendsto_integral_of_dominated_convergence + (fun _ => ‖f 0‖ + (eVariationOn f (Icc (0 : ℝ) 1)).toReal) + · intro n + exact (measurable_step f (n + 1)).aestronglyMeasurable + · exact integrable_const _ + · intro n + exact Filter.Eventually.of_forall (norm_step_le f (Nat.succ_pos n) hf) + · exact ae_tendsto_step f hf + +theorem boundedVariation_discrepancy_endpoint {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) [IsFiniteMeasure μ] {X Y : Ω → ℝ} + (hX : Measurable X) (hY : Measurable Y) + (haX : μ.map X ≪ unitMeasure) (haY : μ.map Y ≪ unitMeasure) + {ε : ℝ} (hε : 0 ≤ ε) + (hrect : ∀ a ∈ Icc (0 : ℝ) 1, ∀ b ∈ Icc (0 : ℝ) 1, + ‖(∫ ω, tail a (X ω) * tail b (Y ω) ∂μ) - + ((1 - a : ℝ) : ℂ) * ((1 - b : ℝ) : ℂ)‖ ≤ ε) + (f g : ℝ → ℂ) (hf : BoundedVariationOn f (Icc (0 : ℝ) 1)) + (hg : BoundedVariationOn g (Icc (0 : ℝ) 1)) : + ‖(∫ ω, f (X ω) * g (Y ω) ∂μ) - + (∫ x, f x ∂unitMeasure) * (∫ y, g y ∂unitMeasure)‖ ≤ + ε * (‖f 0‖ + (eVariationOn f (Icc (0 : ℝ) 1)).toReal) * + (‖g 0‖ + (eVariationOn g (Icc (0 : ℝ) 1)).toReal) := by + have hprod : Tendsto (fun n : ℕ => + ∫ ω, step f (n + 1) (X ω) * step g (n + 1) (Y ω) ∂μ) atTop + (𝓝 (∫ ω, f (X ω) * g (Y ω) ∂μ)) := by + apply tendsto_integral_of_dominated_convergence + (fun _ => (‖f 0‖ + (eVariationOn f (Icc (0 : ℝ) 1)).toReal) * + (‖g 0‖ + (eVariationOn g (Icc (0 : ℝ) 1)).toReal)) + · intro n + exact (((measurable_step f (n + 1)).comp hX).mul + ((measurable_step g (n + 1)).comp hY)).aestronglyMeasurable + · exact integrable_const _ + · intro n + apply Filter.Eventually.of_forall + intro ω + rw [norm_mul] + exact mul_le_mul (norm_step_le f (Nat.succ_pos n) hf _) + (norm_step_le g (Nat.succ_pos n) hg _) (norm_nonneg _) (by positivity) + · filter_upwards [ae_tendsto_step_comp hX haX f hf, + ae_tendsto_step_comp hY haY g hg] with ω hfx hgy + exact hfx.mul hgy + have hlim := (hprod.sub ((tendsto_integral_step f hf).mul + (tendsto_integral_step g hg))).norm + apply le_of_tendsto hlim + exact Filter.Eventually.of_forall fun n => + step_discrepancy μ hX hY hε hrect f g hf hg (Nat.succ_pos n) + +lemma norm_bddAbove_of_boundedVariation (f : ℝ → ℂ) + (hf : BoundedVariationOn f (Icc (0 : ℝ) 1)) : + BddAbove ((fun x => ‖f x‖) '' Icc (0 : ℝ) 1) := by + refine ⟨‖f 0‖ + (eVariationOn f (Icc (0 : ℝ) 1)).toReal, ?_⟩ + rintro z ⟨x, hx, rfl⟩ + have hv := hf.dist_le hx (show (0 : ℝ) ∈ Icc 0 1 by norm_num) + calc + ‖f x‖ = ‖(f x - f 0) + f 0‖ := by rw [sub_add_cancel] + _ ≤ ‖f x - f 0‖ + ‖f 0‖ := norm_add_le _ _ + _ ≤ ‖f 0‖ + (eVariationOn f (Icc (0 : ℝ) 1)).toReal := by + rw [dist_eq_norm] at hv + linarith + +theorem boundedVariation_discrepancy {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) [IsFiniteMeasure μ] {X Y : Ω → ℝ} + (hX : Measurable X) (hY : Measurable Y) + (haX : μ.map X ≪ unitMeasure) (haY : μ.map Y ≪ unitMeasure) + {ε : ℝ} (hε : 0 ≤ ε) + (hrect : ∀ a ∈ Icc (0 : ℝ) 1, ∀ b ∈ Icc (0 : ℝ) 1, + ‖(∫ ω, tail a (X ω) * tail b (Y ω) ∂μ) - + ((1 - a : ℝ) : ℂ) * ((1 - b : ℝ) : ℂ)‖ ≤ ε) + (f g : ℝ → ℂ) (hf : BoundedVariationOn f (Icc (0 : ℝ) 1)) + (hg : BoundedVariationOn g (Icc (0 : ℝ) 1)) : + ‖(∫ ω, f (X ω) * g (Y ω) ∂μ) - + (∫ x, f x ∂unitMeasure) * (∫ y, g y ∂unitMeasure)‖ ≤ + ε * (sSup ((fun x => ‖f x‖) '' Icc (0 : ℝ) 1) + + (eVariationOn f (Icc (0 : ℝ) 1)).toReal) * + (sSup ((fun x => ‖g x‖) '' Icc (0 : ℝ) 1) + + (eVariationOn g (Icc (0 : ℝ) 1)).toReal) := by + have hfs : ‖f 0‖ ≤ sSup ((fun x => ‖f x‖) '' Icc (0 : ℝ) 1) := + le_csSup (norm_bddAbove_of_boundedVariation f hf) ⟨0, by norm_num, rfl⟩ + have hgs : ‖g 0‖ ≤ sSup ((fun x => ‖g x‖) '' Icc (0 : ℝ) 1) := + le_csSup (norm_bddAbove_of_boundedVariation g hg) ⟨0, by norm_num, rfl⟩ + apply (boundedVariation_discrepancy_endpoint μ hX hY haX haY hε hrect f g hf hg).trans + apply mul_le_mul + · exact mul_le_mul_of_nonneg_left (add_le_add hfs le_rfl) hε + · exact add_le_add hgs le_rfl + · positivity + · exact mul_nonneg hε (add_nonneg ((norm_nonneg _).trans hfs) ENNReal.toReal_nonneg) + +end Invariant233.BVDiscrepancy + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundBumps.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundBumps.lean new file mode 100644 index 0000000000000000000000000000000000000000..d06013d0fee130ff77b1a682ac26f774ce566871 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundBumps.lean @@ -0,0 +1,124 @@ +import Mathlib + +namespace OAI + +open Filter Set MeasureTheory +open scoped Topology ENNReal + +namespace Invariant233.BackgroundCost + +theorem exists_disjoint_closedBalls {ι X : Type*} [Finite ι] [MetricSpace X] + (f : ι → X) (hf : Function.Injective f) : + ∃ r : ℝ, 0 < r ∧ Pairwise (fun i j => + Disjoint (Metric.closedBall (f i) r) (Metric.closedBall (f j) r)) := by + have hmul : Tendsto (fun r : ℝ => 2 * r) (𝓝 0) (𝓝 0) := by + have hc : Continuous (fun r : ℝ => 2 * r) := by fun_prop + have h := hc.continuousAt (x := 0) + change Tendsto (fun r : ℝ => 2 * r) (𝓝 0) (𝓝 (2 * 0)) at h + simpa only [mul_zero] using h + have he : ∀ᶠ r : ℝ in 𝓝 0, ∀ i j : ι, i ≠ j → 2 * r < dist (f i) (f j) := by + apply eventually_all.2 + intro i + apply eventually_all.2 + intro j + by_cases hij : i = j + · exact Eventually.of_forall (fun _ h => (h hij).elim) + · have hd : 0 < dist (f i) (f j) := dist_pos.mpr (hf.ne hij) + exact (hmul.eventually (eventually_lt_nhds hd)).mono fun _ h _ => h + have hrpos : ∀ᶠ r : ℝ in 𝓝[>] 0, 0 < r := self_mem_nhdsWithin + have he' : ∀ᶠ r : ℝ in 𝓝[>] 0, + 0 < r ∧ ∀ i j : ι, i ≠ j → 2 * r < dist (f i) (f j) := + hrpos.and (he.filter_mono nhdsWithin_le_nhds) + obtain ⟨r, hr, hsep⟩ := he'.exists + refine ⟨r, hr, ?_⟩ + intro i j hij + apply Set.disjoint_left.2 + intro x hxi hxj + have hi : dist (f i) x ≤ r := by + simpa only [Metric.mem_closedBall, dist_comm] using hxi + have hj : dist x (f j) ≤ r := hxj + have ht := dist_triangle (f i) x (f j) + have hs := hsep i j hij + linarith + +theorem exists_small_closedBall {X : Type*} [MetricSpace X] + [MeasurableSpace X] (μ : Measure X) [μ.OuterRegular] + [NullSingletonClass μ] (a : X) {R : ℝ} (hR : 0 < R) + {ε : ℝ≥0∞} (hε : 0 < ε) : + ∃ r : ℝ, 0 < r ∧ r < R ∧ μ (Metric.closedBall a r) < ε := by + obtain ⟨U, haU, hU, hμU⟩ := + Set.exists_isOpen_lt_of_lt (μ := μ) ({a} : Set X) ε (by simpa using hε) + have ha : a ∈ U := haU (by simp) + obtain ⟨δ, hδ, hδU⟩ := Metric.mem_nhds_iff.1 (hU.mem_nhds ha) + refine ⟨min (δ / 2) (R / 2), lt_min (by linarith) (by linarith), ?_, ?_⟩ + · exact (min_le_right _ _).trans_lt (by linarith) + · apply lt_of_le_of_lt (measure_mono ?_) hμU + intro x hx + apply hδU + have hd : dist x a ≤ δ / 2 := hx.trans (min_le_left _ _) + show dist x a < δ + linarith + +theorem exists_tent_bump {X : Type*} [MetricSpace X] (a : X) + {r : ℝ} (hr : 0 < r) : + ∃ v : X → ℝ, Continuous v ∧ v a = 1 ∧ + (∀ x, 0 ≤ v x ∧ v x ≤ 1) ∧ + Function.support v ⊆ Metric.closedBall a r := by + refine ⟨fun x => max (1 - dist x a / r) 0, ?_, ?_, ?_, ?_⟩ + · fun_prop + · simp + · intro x + constructor + · exact le_max_right _ _ + · apply max_le + · have hd : 0 ≤ dist x a / r := div_nonneg dist_nonneg hr.le + linarith + · norm_num + · intro x hx + have hh : 0 < max (1 - dist x a / r) 0 := + lt_of_le_of_ne (le_max_right _ _) (Ne.symm hx) + have hpos : 0 < 1 - dist x a / r := (lt_max_iff.mp hh).resolve_right (lt_irrefl _) + have hd : dist x a < r := (div_lt_one hr).1 (by linarith) + exact hd.le + +theorem exists_bump_disjoint_images {ι X : Type*} [Finite ι] [MetricSpace X] + [MeasurableSpace X] (μ : Measure X) [μ.OuterRegular] + [NullSingletonClass μ] (a : X) (T : ι → X → X) + (hT : ∀ i, Isometry (T i)) (ha : Function.Injective (fun i => T i a)) + {R : ℝ} (hR : 0 < R) {ε : ℝ≥0∞} (hε : 0 < ε) : + ∃ (r : ℝ) (v : X → ℝ), 0 < r ∧ r < R ∧ + μ (Metric.closedBall a r) < ε ∧ Continuous v ∧ v a = 1 ∧ + (∀ x, 0 ≤ v x ∧ v x ≤ 1) ∧ + Function.support v ⊆ Metric.closedBall a r ∧ + Pairwise (fun i j => Disjoint (T i '' Metric.closedBall a r) + (T j '' Metric.closedBall a r)) := by + obtain ⟨R₀, hR₀, hsep⟩ := exists_disjoint_closedBalls (fun i => T i a) ha + obtain ⟨r, hr, hrR, hμr⟩ := + exists_small_closedBall μ a (lt_min hR hR₀) hε + obtain ⟨v, hv, hva, hv01, hsupp⟩ := exists_tent_bump a hr + refine ⟨r, v, hr, hrR.trans_le (min_le_left _ _), hμr, + hv, hva, hv01, hsupp, ?_⟩ + have himage : ∀ i, T i '' Metric.closedBall a r ⊆ Metric.closedBall (T i a) R₀ := by + intro i y hy + obtain ⟨x, hx, rfl⟩ := hy + show dist (T i x) (T i a) ≤ R₀ + rw [(hT i).dist_eq] + exact hx.trans (hrR.le.trans (min_le_right _ _)) + intro i j hij + exact (hsep hij).mono (himage i) (himage j) + +theorem disjoint_support_comp_symm {ι X : Type*} (T : ι → X ≃ X) + (v : X → ℝ) (s : Set X) (hs : Function.support v ⊆ s) + (hd : Pairwise (fun i j => Disjoint (T i '' s) (T j '' s))) : + Pairwise (fun i j => Disjoint + (Function.support (fun x => v ((T i).symm x))) + (Function.support (fun x => v ((T j).symm x)))) := by + have hsub : ∀ i, Function.support (fun x => v ((T i).symm x)) ⊆ T i '' s := by + intro i x hx + exact ⟨(T i).symm x, hs hx, (T i).apply_symm_apply x⟩ + intro i j hij + exact (hd hij).mono (hsub i) (hsub j) + +end Invariant233.BackgroundCost + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundConstruction.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundConstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..601b7e6886064051f39bd571af311a978a43107b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundConstruction.lean @@ -0,0 +1,27 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CircleBackgroundCost +import OAI.Analysis.IrrationalRotation.Analysis.BackgroundTransfer + +namespace OAI + +noncomputable section +open MeasureTheory Set Filter +open scoped Topology + +namespace Invariant233.BackgroundCost + +theorem exists_background_coboundary (θ : ℝ) (hθ : Irrational θ) : + ∃ g b : Circle → ℝ, Measurable g ∧ Measurable b ∧ + ContinuousOn g ({0}ᶜ : Set Circle) ∧ (∀ x, 1 / 2 ≤ g x) ∧ + Tendsto g (𝓝[≠] (0 : Circle)) atTop ∧ Integrable g circleMeasure ∧ + g =ᵐ[circleMeasure] (fun x => 1 + b (x + (θ : Circle)) - b x) := by + obtain ⟨d⟩ := exists_backgroundBumpData θ hθ + exact ⟨backgroundCost d, backgroundTransferSum d, measurable_backgroundCost d, + measurable_backgroundTransferSum d, continuousOn_backgroundCost d, + backgroundCost_ge_half d, tendsto_backgroundCost_atTop d, + integrable_backgroundCost d, backgroundCost_ae_coboundary d⟩ + +end Invariant233.BackgroundCost + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundCost.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e4ff2df15de6c25709bdcb246c31faddaad5bad --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundCost.lean @@ -0,0 +1,221 @@ +import Mathlib + +namespace OAI + +open scoped Topology BigOperators ENNReal +open Filter Set MeasureTheory + +namespace Invariant233.BackgroundCost + +theorem sum_le_one_of_disjoint_support {ι X : Type*} (s : Finset ι) + (v : ι → X → ℝ) (hv : ∀ i x, v i x ≤ 1) + (hd : Pairwise (fun i j => Disjoint (Function.support (v i)) + (Function.support (v j)))) (x : X) : + (∑ i ∈ s, v i x) ≤ 1 := by + classical + by_cases h : ∃ i ∈ s, v i x ≠ 0 + · obtain ⟨i, hi, hix⟩ := h + have hz : ∀ j ∈ s, j ≠ i → v j x = 0 := by + intro j _ hji + by_contra hjx + exact Set.disjoint_left.mp (hd hji) hjx hix + rw [Finset.sum_eq_single i (fun j hj hji => hz j hj hji) + (fun hni => False.elim (hni hi))] + exact hv i x + · have hz : ∀ i ∈ s, v i x = 0 := by + intro i hi + by_contra hix + exact h ⟨i, hi, hix⟩ + simp only [Finset.sum_eq_zero hz] + norm_num + +theorem average_bounds_of_disjoint_support {ι X : Type*} (s : Finset ι) + (v : ι → X → ℝ) (hv0 : ∀ i x, 0 ≤ v i x) (hv1 : ∀ i x, v i x ≤ 1) + (hd : Pairwise (fun i j => Disjoint (Function.support (v i)) + (Function.support (v j)))) {W : ℝ} (hW : 0 < W) (x : X) : + 0 ≤ (∑ i ∈ s, v i x) / W ∧ (∑ i ∈ s, v i x) / W ≤ 1 / W := by + constructor + · exact div_nonneg (Finset.sum_nonneg fun i _ => hv0 i x) hW.le + · exact div_le_div_of_nonneg_right + (sum_le_one_of_disjoint_support s v hv1 hd x) hW.le + +theorem continuous_negative_cost {X : Type*} [TopologicalSpace X] + (w : ℕ → X → ℝ) (c : ℕ → ℝ) (hw : ∀ n, Continuous (w n)) + (hc : Summable c) (hbound : ∀ n x, ‖w n x‖ ≤ c n) : + Continuous (fun x => ∑' n, w n x) := + continuous_tsum hw hc hbound + +theorem continuousOn_tsum_of_locally_finite {X : Type*} [TopologicalSpace X] + (v : ℕ → X → ℝ) (s : Set X) (hv : ∀ n, Continuous (v n)) + (hlocal : ∀ x ∈ s, ∃ t : Finset ℕ, + ∀ᶠ y in 𝓝 x, ∀ n ∉ t, v n y = 0) : + ContinuousOn (fun x => ∑' n, v n x) s := by + intro x hx + obtain ⟨t, ht⟩ := hlocal x hx + have hfinite : Continuous (fun y => ∑ n ∈ t, v n y) := + continuous_finsetSum t (fun n _ => hv n) + apply ContinuousAt.continuousWithinAt + apply hfinite.continuousAt.congr_of_eventuallyEq + exact ht.mono fun y hy => tsum_eq_sum hy + +theorem locally_finite_of_support_shrinks {X : Type*} [MetricSpace X] + (a : X) (v : ℕ → X → ℝ) (r : ℕ → ℝ) + (hr : Tendsto r atTop (𝓝 0)) + (hsupp : ∀ n x, v n x ≠ 0 → dist x a ≤ r n) : + ∀ x ≠ a, ∃ t : Finset ℕ, + ∀ᶠ y in 𝓝 x, ∀ n ∉ t, v n y = 0 := by + intro x hxa + have hd : 0 < dist x a := dist_pos.mpr hxa + have he : ∀ᶠ n in atTop, r n < dist x a / 2 := + hr.eventually (eventually_lt_nhds (by linarith)) + obtain ⟨N, hN⟩ := eventually_atTop.1 he + refine ⟨Finset.range N, ?_⟩ + filter_upwards [Metric.ball_mem_nhds x (show 0 < dist x a / 2 by linarith)] + with y hy + intro n hn + have hn' : N ≤ n := Nat.le_of_not_gt (by simpa using hn) + by_contra hv + have hya := hsupp n y hv + have hnsmall := hN n hn' + have htri := dist_triangle x y a + have hxy : dist x y < dist x a / 2 := by + simpa [Metric.mem_ball, dist_comm] using hy + linarith + +theorem summable_of_support_shrinks {X : Type*} [MetricSpace X] + (a : X) (v : ℕ → X → ℝ) (r : ℕ → ℝ) + (hr : Tendsto r atTop (𝓝 0)) + (hsupp : ∀ n x, v n x ≠ 0 → dist x a ≤ r n) + {x : X} (hx : x ≠ a) : Summable (fun n => v n x) := by + obtain ⟨t, ht⟩ := locally_finite_of_support_shrinks a v r hr hsupp x hx + exact summable_of_ne_finset_zero (mem_of_mem_nhds ht) + +theorem hasSum_background_majorant : + HasSum (fun n : ℕ => (1 : ℝ) / 2 ^ (n + 2)) (1 / 2) := by + have h := (hasSum_geometric_of_lt_one (by norm_num : (0 : ℝ) ≤ 1 / 2) + (by norm_num : (1 / 2 : ℝ) < 1)).mul_left (1 / 4 : ℝ) + have heq : (fun n : ℕ => (1 : ℝ) / 2 ^ (n + 2)) = + (fun n : ℕ => (1 / 4 : ℝ) * (1 / 2) ^ n) := by + funext n + simp only [pow_add, div_pow, one_pow] + norm_num + rw [heq] + simpa only [show (1 / 4 : ℝ) * (1 - 1 / 2)⁻¹ = 1 / 2 by norm_num] using h + +theorem negative_cost_le {X : Type*} (w : ℕ → X → ℝ) (c : ℕ → ℝ) + (hc : Summable c) (hw0 : ∀ n x, 0 ≤ w n x) + (hwc : ∀ n x, w n x ≤ c n) (x : X) : + (∑' n, w n x) ≤ ∑' n, c n := by + have hw : Summable (fun n => w n x) := + Summable.of_nonneg_of_le (fun n => hw0 n x) (fun n => hwc n x) hc + exact hw.tsum_le_tsum (fun n => hwc n x) hc + +theorem background_cost_ge_half {X : Type*} (v w : ℕ → X → ℝ) (c : ℕ → ℝ) + (hc : Summable c) (hcsum : (∑' n, c n) ≤ 1 / 2) + (hv0 : ∀ n x, 0 ≤ v n x) (hw0 : ∀ n x, 0 ≤ w n x) + (hwc : ∀ n x, w n x ≤ c n) (x : X) : + 1 / 2 ≤ 1 + (∑' n, v n x) - (∑' n, w n x) := by + have hp : 0 ≤ ∑' n, v n x := tsum_nonneg (fun n => hv0 n x) + have hn := (negative_cost_le w c hc hw0 hwc x).trans hcsum + linarith + +theorem background_cost_continuousOn {X : Type*} [MetricSpace X] + (a : X) (v w : ℕ → X → ℝ) (r c : ℕ → ℝ) + (hv : ∀ n, Continuous (v n)) (hw : ∀ n, Continuous (w n)) + (hr : Tendsto r atTop (𝓝 0)) + (hsupp : ∀ n x, v n x ≠ 0 → dist x a ≤ r n) + (hc : Summable c) (hw0 : ∀ n x, 0 ≤ w n x) + (hwc : ∀ n x, w n x ≤ c n) : + ContinuousOn (fun x => 1 + (∑' n, v n x) - (∑' n, w n x)) {a}ᶜ := by + have hp : ContinuousOn (fun x => ∑' n, v n x) {a}ᶜ := + continuousOn_tsum_of_locally_finite v _ hv + (fun x hx => locally_finite_of_support_shrinks a v r hr hsupp x hx) + have hn : Continuous (fun x => ∑' n, w n x) := + continuous_negative_cost w c hw hc (fun n x => by + simpa only [Real.norm_eq_abs, abs_of_nonneg (hw0 n x)] using hwc n x) + exact (continuousOn_const.add hp).sub hn.continuousOn + +theorem tendsto_background_atTop {X : Type*} [TopologicalSpace X] + (a : X) (v w : ℕ → X → ℝ) (c : ℕ → ℝ) + (hv : ∀ n, Continuous (v n)) (hva : ∀ n, v n a = 1) + (hv0 : ∀ n x, 0 ≤ v n x) + (hvs : ∀ x, x ≠ a → Summable (fun n => v n x)) + (hc : Summable c) (hw0 : ∀ n x, 0 ≤ w n x) + (hwc : ∀ n x, w n x ≤ c n) : + Tendsto (fun x => 1 + (∑' n, v n x) - (∑' n, w n x)) + (𝓝[≠] a) atTop := by + apply tendsto_atTop.2 + intro b + obtain ⟨N, hN⟩ := exists_nat_gt (b + ∑' n, c n) + have hpartial : Continuous (fun x => ∑ n ∈ Finset.range N, v n x) := + continuous_finsetSum _ (fun n _ => hv n) + have hcenter : (∑ n ∈ Finset.range N, v n a) = (N : ℝ) := by + simp [hva] + have he : ∀ᶠ x in 𝓝 a, + b + (∑' n, c n) ≤ ∑ n ∈ Finset.range N, v n x := by + apply hpartial.continuousAt.eventually + exact eventually_ge_nhds (by simpa [hcenter] using hN) + filter_upwards [he.filter_mono nhdsWithin_le_nhds, + self_mem_nhdsWithin] with x hx hxa + have hxa' : x ≠ a := hxa + have hp : (∑ n ∈ Finset.range N, v n x) ≤ ∑' n, v n x := + (hvs x hxa').sum_le_tsum _ (fun n _ => hv0 n x) + have hn := negative_cost_le w c hc hw0 hwc x + linarith + +theorem lintegral_bump_le_measure {X : Type*} [MeasurableSpace X] + (μ : Measure X) (v : X → ℝ) (s : Set X) + (hv : ∀ x, v x ≤ 1) (hs : Function.support v ⊆ s) : + (∫⁻ x, ENNReal.ofReal (v x) ∂μ) ≤ μ s := by + apply (lintegral_mono (fun x => ?_)).trans (lintegral_indicator_one_le s) + by_cases hx : x ∈ s + · simpa only [Set.indicator_of_mem hx, Pi.one_apply] using + (ENNReal.ofReal_le_one.2 (hv x)) + · have hz : v x = 0 := Function.support_subset_iff'.1 hs x hx + simp only [Set.indicator_of_notMem hx, hz, ENNReal.ofReal_zero, le_refl] + +theorem integrable_bump_series {X : Type*} [MeasurableSpace X] + (μ : Measure X) (v : ℕ → X → ℝ) (s : ℕ → Set X) + (hv : ∀ n, Measurable (v n)) (hv0 : ∀ n x, 0 ≤ v n x) + (hv1 : ∀ n x, v n x ≤ 1) + (hsupp : ∀ n, Function.support (v n) ⊆ s n) + (hsum : ∀ᵐ x ∂μ, Summable (fun n => v n x)) + (hμsum : (∑' n, μ (s n)) < ∞) : + Integrable (fun x => ∑' n, v n x) μ := by + refine ⟨AEStronglyMeasurable.tsum (fun n => (hv n).aestronglyMeasurable), ?_⟩ + rw [hasFiniteIntegral_iff_ofReal + (Eventually.of_forall (fun x => tsum_nonneg (fun n => hv0 n x)))] + calc + (∫⁻ x, ENNReal.ofReal (∑' n, v n x) ∂μ) = + ∫⁻ x, ∑' n, ENNReal.ofReal (v n x) ∂μ := by + apply lintegral_congr_ae + exact hsum.mono (fun x hx => ENNReal.ofReal_tsum_of_nonneg (fun n => hv0 n x) hx) + _ = ∑' n, ∫⁻ x, ENNReal.ofReal (v n x) ∂μ := + lintegral_tsum (fun n => (hv n).ennreal_ofReal.aemeasurable) + _ ≤ ∑' n, μ (s n) := ENNReal.tsum_le_tsum + (fun n => lintegral_bump_le_measure μ (v n) (s n) (hv1 n) (hsupp n)) + _ < ∞ := hμsum + +theorem integrable_background_cost {X : Type*} [MeasurableSpace X] + (μ : Measure X) [IsFiniteMeasure μ] (v w : ℕ → X → ℝ) + (s : ℕ → Set X) (c : ℕ → ℝ) + (hv : ∀ n, Measurable (v n)) (hw : ∀ n, Measurable (w n)) + (hv0 : ∀ n x, 0 ≤ v n x) (hv1 : ∀ n x, v n x ≤ 1) + (hsupp : ∀ n, Function.support (v n) ⊆ s n) + (hvs : ∀ᵐ x ∂μ, Summable (fun n => v n x)) + (hμsum : (∑' n, μ (s n)) < ∞) + (hc : Summable c) (hw0 : ∀ n x, 0 ≤ w n x) + (hwc : ∀ n x, w n x ≤ c n) : + Integrable (fun x => 1 + (∑' n, v n x) - (∑' n, w n x)) μ := by + have hp := integrable_bump_series μ v s hv hv0 hv1 hsupp hvs hμsum + have hn : Integrable (fun x => ∑' n, w n x) μ := by + apply (integrable_const (∑' n, c n)).mono' + (AEStronglyMeasurable.tsum (fun n => (hw n).aestronglyMeasurable)) + filter_upwards with x + rw [Real.norm_eq_abs, abs_of_nonneg (tsum_nonneg (fun n => hw0 n x))] + exact negative_cost_le w c hc hw0 hwc x + exact ((integrable_const (1 : ℝ)).add hp).sub hn + +end Invariant233.BackgroundCost + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundTransfer.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..e3959f25f660d0dea422602020b987b673387455 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BackgroundTransfer.lean @@ -0,0 +1,131 @@ +import OAI.Analysis.IrrationalRotation.Model.BackgroundData +import OAI.Analysis.IrrationalRotation.Analysis.ContinuityCoboundary +import OAI.Analysis.IrrationalRotation.Analysis.TransferSupport + +namespace OAI + +open MeasureTheory Set Filter Function +open scoped ENNReal + +namespace InvariantProjection.Continuity + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem measurable_backgroundTransfer (σ : X ≃ᵐ X) (v : X → ℝ) + (W : ℕ) (hv : Measurable v) : + Measurable (backgroundTransfer σ.toEquiv v W) := by + unfold backgroundTransfer backwardSum + apply Measurable.const_mul + apply Finset.measurable_sum + intro n hn + apply Finset.measurable_sum + intro r hr + exact hv.comp (σ.symm.measurable.iterate (r + 1)) + +omit [MeasurableSpace X] in + +theorem support_backgroundTransfer_subset (σ : X ≃ X) (v : X → ℝ) (W : ℕ) : + support (backgroundTransfer σ v W) ⊆ + ⋃ r ∈ Finset.range W, ((σ.symm : X → X)^[r + 1]) ⁻¹' support v := by + intro x hx + have hsum : (∑ n ∈ Finset.range W, backwardSum σ v (n + 1) x) ≠ 0 := + (mul_ne_zero_iff.mp hx).2 + obtain ⟨n, hn, hnx⟩ := Finset.exists_ne_zero_of_sum_ne_zero hsum + obtain ⟨r, hr, hrx⟩ := Finset.exists_ne_zero_of_sum_ne_zero hnx + refine Set.mem_iUnion.mpr ⟨r, Set.mem_iUnion.mpr ⟨?_, hrx⟩⟩ + apply Finset.mem_range.mpr + have hn' := Finset.mem_range.mp hn + have hr' := Finset.mem_range.mp hr + omega + +theorem measure_support_backgroundTransfer_le (σ : X ≃ᵐ X) + (hσ : MeasurePreserving σ μ μ) (v : X → ℝ) (W : ℕ) : + μ (support (backgroundTransfer σ.toEquiv v W)) ≤ + (W : ℝ≥0∞) * μ (support v) := by + calc + _ ≤ μ (⋃ r ∈ Finset.range W, + ((σ.symm : X → X)^[r + 1]) ⁻¹' support v) := + measure_mono (support_backgroundTransfer_subset σ.toEquiv v W) + _ ≤ ∑ r ∈ Finset.range W, + μ (((σ.symm : X → X)^[r + 1]) ⁻¹' support v) := + measure_biUnion_finset_le _ _ + _ ≤ ∑ _r ∈ Finset.range W, μ (support v) := by + exact Finset.sum_le_sum fun r _ => ((hσ.symm σ).iterate (r + 1)).measure_preimage_le _ + _ = _ := by simp + +end InvariantProjection.Continuity + +namespace Invariant233.BackgroundCost + +open InvariantProjection.Continuity Invariant233.TransferSupport + +variable {θ : ℝ} (d : BackgroundBumpData θ) + +theorem tsum_measure_backgroundTransfer_support_ne_top : + (∑' n, circleMeasure (support (backgroundTransfer + (Equiv.addRight (θ : Circle)) (d.bump n) (2 ^ (n + 2))))) ≠ ∞ := by + apply ne_top_of_le_ne_top (show (1 / 2 : ℝ≥0∞) ≠ ∞ by norm_num) + apply le_trans _ d.weighted_support_bound + apply ENNReal.tsum_le_tsum + intro n + calc + _ ≤ ((2 ^ (n + 2) : ℕ) : ℝ≥0∞) * circleMeasure (support (d.bump n)) := + measure_support_backgroundTransfer_le (MeasurableEquiv.addRight (θ : Circle)) + (measurePreserving_add_right volume _) _ _ + _ ≤ (2 : ℝ≥0∞) ^ (n + 2) * circleMeasure (Metric.closedBall 0 (d.radius n)) := by + simpa only [Nat.cast_pow, Nat.cast_ofNat] using + mul_le_mul_right (measure_mono (d.bump_support n)) + (((2 ^ (n + 2) : ℕ) : ℝ≥0∞)) + +theorem tsum_measure_backgroundBump_support_ne_top : + (∑' n, circleMeasure (support (d.bump n))) ≠ ∞ := by + apply ne_top_of_le_ne_top (show (1 / 2 : ℝ≥0∞) ≠ ∞ by norm_num) + apply le_trans _ d.weighted_support_bound + apply ENNReal.tsum_le_tsum + intro n + calc + _ ≤ circleMeasure (Metric.closedBall 0 (d.radius n)) := measure_mono (d.bump_support n) + _ ≤ (2 : ℝ≥0∞) ^ (n + 2) * circleMeasure (Metric.closedBall 0 (d.radius n)) := by + exact le_mul_of_one_le_left' (one_le_pow₀ (by norm_num)) + +theorem ae_finite_backgroundTransfer_support : + ∀ᵐ x ∂circleMeasure, (support (fun n => backgroundTransfer + (Equiv.addRight (θ : Circle)) (d.bump n) (2 ^ (n + 2)) x)).Finite := + ae_finite_transfer_support _ (tsum_measure_backgroundTransfer_support_ne_top d) + +theorem measurable_backgroundTransferSum : Measurable (backgroundTransferSum d) := by + apply Measurable.tsum + intro n + exact measurable_backgroundTransfer (MeasurableEquiv.addRight (θ : Circle)) + _ _ (d.continuous_bump n).measurable + +theorem backgroundCost_ae_coboundary : + backgroundCost d =ᵐ[circleMeasure] fun x => + 1 + backgroundTransferSum d (x + (θ : Circle)) - backgroundTransferSum d x := by + have hsum : ∀ᵐ x ∂circleMeasure, Summable (fun n => d.bump n x) := + (ae_finite_transfer_support _ (tsum_measure_backgroundBump_support_ne_top d)).mono + (fun _ hx => summable_of_hasFiniteSupport hx) + have hneg := ae_tsum_coboundary d.bump (backgroundNegative d) + (fun n => backgroundTransfer (Equiv.addRight (θ : Circle)) (d.bump n) (2 ^ (n + 2))) + (fun x : Circle => x + (θ : Circle)) + (measurePreserving_add_right volume _).quasiMeasurePreserving + (tsum_measure_backgroundTransfer_support_ne_top d) hsum (fun n => by + apply Eventually.of_forall + intro x + have h := background_coboundary (Equiv.addRight (θ : Circle)) (d.bump n) + (2 ^ (n + 2)) (pow_ne_zero _ (by norm_num)) x + change backgroundNegative d n x = _ + change d.bump n x - backgroundNegative d n x = _ at h + change d.bump n x - backgroundNegative d n x = + backgroundTransfer (Equiv.addRight (θ : Circle)) (d.bump n) (2 ^ (n + 2)) + (x + (θ : Circle)) - + backgroundTransfer (Equiv.addRight (θ : Circle)) (d.bump n) (2 ^ (n + 2)) x at h + linarith) + filter_upwards [hneg] with x hx + unfold backgroundCost backgroundTransferSum + rw [hx.2] + ring + +end Invariant233.BackgroundCost + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BanachPeriodicIntervalDiscrepancy.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BanachPeriodicIntervalDiscrepancy.lean new file mode 100644 index 0000000000000000000000000000000000000000..5917da376261865c74c12f591d4d5e6cccfccb4b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BanachPeriodicIntervalDiscrepancy.lean @@ -0,0 +1,132 @@ +import OAI.Analysis.IrrationalRotation.Analysis.PeriodicIntervalDiscrepancy +import Mathlib.Analysis.Normed.Module.HahnBanach + +namespace OAI + +namespace Invariant233.PeriodicIntervalDiscrepancy + +open Set MeasureTheory +open scoped ENNReal + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + +theorem norm_integral_sub_length_smul_integral_le {f : ℝ → E} + (hperiod : Function.Periodic f 1) (hint : IntervalIntegrable f volume 0 1) + {a b : ℝ} (hab : a ≤ b) : + ‖(∫ x in a..b, f x) - (b - a) • (∫ x in (0 : ℝ)..1, f x)‖ ≤ + ∫ x in (0 : ℝ)..1, ‖f x‖ := by + obtain ⟨L, hL, hLeq⟩ := exists_dual_vector'' ℝ + ((∫ x in a..b, f x) - (b - a) • (∫ x in (0 : ℝ)..1, f x)) + have hLf : IntervalIntegrable (fun x => L (f x)) volume 0 1 := + ⟨L.integrable_comp hint.1, L.integrable_comp hint.2⟩ + have hperiodL : Function.Periodic (fun x => L (f x)) 1 := by + intro x + change L (f (x + 1)) = L (f x) + rw [hperiod x] + have hint' := hperiod.intervalIntegrable₀ (by norm_num : (1 : ℝ) ≠ 0) hint + have h := abs_integral_sub_length_mul_integral_le hperiodL hLf hab + rw [L.intervalIntegral_comp_comm (hint' a b), L.intervalIntegral_comp_comm hint, + ← smul_eq_mul, ← L.map_smul, ← L.map_sub, hLeq] at h + simp only [RCLike.ofReal_real_eq_id, id_eq, abs_of_nonneg (norm_nonneg _)] at h + refine h.trans (intervalIntegral.integral_mono_on (by norm_num) hLf.abs hint.norm ?_) + intro x _ + calc + |L (f x)| = ‖L (f x)‖ := (Real.norm_eq_abs _).symm + _ ≤ ‖L‖ * ‖f x‖ := L.le_opNorm _ + _ ≤ 1 * ‖f x‖ := mul_le_mul_of_nonneg_right hL (norm_nonneg _) + _ = ‖f x‖ := one_mul _ + +omit [CompleteSpace E] in + +theorem integral_cond_Ioc_smul {f : ℝ → E} {a b : ℝ} (hab : a < b) : + (∫ x, f x ∂ProbabilityTheory.cond volume (Ioc a b)) = + (b - a)⁻¹ • ∫ x in a..b, f x := by + rw [ProbabilityTheory.cond, integral_smul_measure, ENNReal.toReal_inv, + Real.volume_Ioc, ENNReal.toReal_ofReal (sub_pos.mpr hab).le, + intervalIntegral.integral_of_le hab.le] + +theorem norm_integral_cond_sub_integral_le {f : ℝ → E} + (hperiod : Function.Periodic f 1) (hint : IntervalIntegrable f volume 0 1) + {a b : ℝ} (hab : a < b) : + ‖(∫ x, f x ∂ProbabilityTheory.cond volume (Ioc a b)) - + (∫ x in (0 : ℝ)..1, f x)‖ ≤ + (b - a)⁻¹ * ∫ x in (0 : ℝ)..1, ‖f x‖ := by + have hlen : 0 < b - a := sub_pos.mpr hab + rw [integral_cond_Ioc_smul hab] + have heq : (b - a)⁻¹ • (∫ x in a..b, f x) - (∫ x in (0 : ℝ)..1, f x) = + (b - a)⁻¹ • ((∫ x in a..b, f x) - + (b - a) • (∫ x in (0 : ℝ)..1, f x)) := by + rw [smul_sub, smul_smul, inv_mul_cancel₀ hlen.ne', one_smul] + rw [heq, norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hlen)] + exact mul_le_mul_of_nonneg_left + (norm_integral_sub_length_smul_integral_le hperiod hint hab.le) + (inv_nonneg.mpr hlen.le) + +omit [NormedSpace ℝ E] [CompleteSpace E] in + +theorem intervalIntegrable_fract_comp_banach {g : ℝ → E} + (hg : IntervalIntegrable g volume 0 1) : + IntervalIntegrable (fun x => g (Int.fract x)) volume 0 1 := by + apply hg.congr_uIoo + simpa only [uIoo_of_le (by norm_num : (0 : ℝ) ≤ 1)] using (fract_comp_eqOn g).symm + +omit [CompleteSpace E] in + +theorem integral_cond_Ioc_mul_banach {f : ℝ → E} {a b k : ℝ} + (hab : a < b) (hk : 0 < k) : + (∫ x, f (k * x) ∂ProbabilityTheory.cond volume (Ioc a b)) = + ∫ x, f x ∂ProbabilityTheory.cond volume (Ioc (k * a) (k * b)) := by + rw [integral_cond_Ioc_smul hab, integral_cond_Ioc_smul (mul_lt_mul_of_pos_left hab hk), + intervalIntegral.integral_comp_mul_left f hk.ne', smul_smul] + rw [← mul_sub, mul_inv_rev] + +theorem uniform_angle_test_norm_le {N n : ℝ} (hN : 0 < N) (hn : 0 < n) + {g : ℝ → E} (hg : IntervalIntegrable g volume 0 1) : + ‖(∫ θ, g (Int.fract (n * θ)) + ∂ProbabilityTheory.cond volume (Icc (1 / N) (2 / N))) - + (∫ t in (0 : ℝ)..1, g t)‖ ≤ (N / n) * ∫ t in (0 : ℝ)..1, ‖g t‖ := by + have hab : (1 : ℝ) / N < 2 / N := + (div_lt_div_iff_of_pos_right hN).mpr (by norm_num) + have hperiod : Function.Periodic (fun x => g (Int.fract x)) 1 := by + intro x + simp only [Int.fract_add_one] + have h := norm_integral_cond_sub_integral_le hperiod + (intervalIntegrable_fract_comp_banach hg) (mul_lt_mul_of_pos_left hab hn) + have hmean : (∫ t in (0 : ℝ)..1, g (Int.fract t)) = ∫ t in (0 : ℝ)..1, g t := + intervalIntegral.integral_congr_Ioo_of_le (by norm_num) (fract_comp_eqOn g) + have hnorm : (∫ t in (0 : ℝ)..1, ‖g (Int.fract t)‖) = + ∫ t in (0 : ℝ)..1, ‖g t‖ := + intervalIntegral.integral_congr_Ioo_of_le (by norm_num) (fract_comp_eqOn (fun t => ‖g t‖)) + have hlen : (n * (2 / N) - n * (1 / N))⁻¹ = N / n := by + rw [← mul_sub, ← sub_div, show (2 : ℝ) - 1 = 1 by norm_num] + field_simp + rw [hmean, hnorm, hlen] at h + rw [ModuloIntervalMeasure.cond_Icc_eq_cond_Ioc, + integral_cond_Ioc_mul_banach (f := fun x => g (Int.fract x)) hab hn] + exact h + +omit [NormedSpace ℝ E] [CompleteSpace E] in + +theorem integrable_uniform_angle_test {N n : ℝ} (hN : 0 < N) (hn : n ≠ 0) + {g : ℝ → E} (hg : IntervalIntegrable g volume 0 1) : + Integrable (fun θ => g (Int.fract (n * θ))) + (ProbabilityTheory.cond volume (Icc (1 / N) (2 / N))) := by + have hab : (1 : ℝ) / N < 2 / N := + (div_lt_div_iff_of_pos_right hN).mpr (by norm_num) + have hperiod : Function.Periodic (fun x => g (Int.fract x)) 1 := by + intro x + simp only [Int.fract_add_one] + have hint := hperiod.intervalIntegrable₀ (by norm_num : (1 : ℝ) ≠ 0) + (intervalIntegrable_fract_comp_banach hg) (n * (1 / N)) (n * (2 / N)) + have hint' : IntervalIntegrable (fun θ => g (Int.fract (n * θ))) volume + (1 / N) (2 / N) := by + convert hint.comp_mul_left (c := n) using 1 <;> field_simp + rw [ModuloIntervalMeasure.cond_Icc_eq_cond_Ioc, ProbabilityTheory.cond] + apply hint'.1.smul_measure + apply ENNReal.inv_ne_top.mpr + rw [Real.volume_Ioc] + exact ne_of_gt (ENNReal.ofReal_pos.mpr (sub_pos.mpr hab)) + +end Invariant233.PeriodicIntervalDiscrepancy + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockAngleConstruction.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockAngleConstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..43175429a5f0c65b1809125964490811afa55170 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockAngleConstruction.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.IrrationalRotation.Product.IndependentAngles +import OAI.Analysis.IrrationalRotation.Analysis.BlockReciprocalSum +import OAI.Analysis.IrrationalRotation.Analysis.ConsecutiveBlocks + +namespace OAI + +open scoped BigOperators +open MeasureTheory ProbabilityTheory + +namespace InvariantProjection.IndependentAngles + +theorem exists_summable_block_angles (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) + (K : ℕ → ℝ) (hK : ∀ j, 0 < K j) + (hsum : Summable (fun j => 1 / K j)) : + ∃ (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ), + (∀ i : Σ j, Fin (m j), e.symm i = (∑ r ∈ Finset.range i.1, m r) + i.2.val) ∧ + (∀ i, θ i ∈ Set.Icc (1 / ((m (e i).1 : ℝ) * K (e i).1)) + (2 / ((m (e i).1 : ℝ) * K (e i).1))) ∧ + Summable θ ∧ (∑' i, θ i) ≤ 2 * (∑' j, 1 / K j) ∧ + LinearIndependent ℚ (fun o : Option ℕ => o.elim 1 θ) := by + obtain ⟨e, he⟩ := exists_consecutiveBlocks_equiv m hm + let N : ℕ → ℝ := fun i => (m (e i).1 : ℝ) * K (e i).1 + have hN : ∀ i, 0 < N i := fun i => + mul_pos (Nat.cast_pos.mpr (hm (e i).1)) (hK (e i).1) + have hblock := enumerated_block_reciprocal m hm K hK hsum e + have hNs : Summable (fun i => 1 / N i) := hblock.1 + obtain ⟨θ, hθ, hsθ, htθ, hlθ, _⟩ := + exists_prescribed_summable_independent_and N hN hNs + (P := fun _ => True) (Filter.Eventually.of_forall fun _ => True.intro) + refine ⟨e, θ, he, hθ, hsθ, ?_, hlθ⟩ + change (∑' i, θ i) ≤ 2 * (∑' i, 1 / ((m (e i).1 : ℝ) * K (e i).1)) at htθ + simpa only [hblock.2] using htθ + +theorem exists_summable_block_angles_unitInterval + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) + (K : ℕ → ℝ) (hK : ∀ j, 0 < K j) + (hscale : ∀ j, 2 < (m j : ℝ) * K j) + (hsum : Summable (fun j => 1 / K j)) : + ∃ (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ), + (∀ i : Σ j, Fin (m j), e.symm i = (∑ r ∈ Finset.range i.1, m r) + i.2.val) ∧ + (∀ i, θ i ∈ Set.Icc (1 / ((m (e i).1 : ℝ) * K (e i).1)) + (2 / ((m (e i).1 : ℝ) * K (e i).1))) ∧ + (∀ i, 0 < θ i ∧ θ i < 1) ∧ Summable θ ∧ + (∑' i, θ i) ≤ 2 * (∑' j, 1 / K j) ∧ + LinearIndependent ℚ (fun o : Option ℕ => o.elim 1 θ) := by + obtain ⟨e, θ, he, hθ, hsθ, htθ, hlθ⟩ := exists_summable_block_angles m hm K hK hsum + refine ⟨e, θ, he, hθ, ?_, hsθ, htθ, hlθ⟩ + intro i + have hN : 0 < (m (e i).1 : ℝ) * K (e i).1 := + mul_pos (Nat.cast_pos.mpr (hm (e i).1)) (hK (e i).1) + exact ⟨lt_of_lt_of_le (one_div_pos.mpr hN) (hθ i).1, + lt_of_le_of_lt (hθ i).2 ((div_lt_one hN).mpr (hscale (e i).1))⟩ + +end InvariantProjection.IndependentAngles + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockAverageSum.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockAverageSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..e61000f79abf32942304c2334c617b2be6e4ec1c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockAverageSum.lean @@ -0,0 +1,41 @@ +import OAI.Analysis.IrrationalRotation.Analysis.BlockReciprocalSum + +namespace OAI + +open scoped BigOperators +namespace InvariantProjection.IndependentAngles + +theorem tsum_fin_block_average {m : ℕ} (hm : 0 < m) (u : ℝ) : + (∑' _i : Fin m, u / (m : ℝ)) = u := by + have hm0 : (m : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hm) + simp only [tsum_fintype, Finset.sum_const, Finset.card_univ, Fintype.card_fin, + nsmul_eq_mul] + field_simp + +theorem summable_block_average (m : ℕ → ℕ) (hm : ∀ s, 0 < m s) + (u : ℕ → ℝ) (hu : ∀ s, 0 ≤ u s) (hsum : Summable u) : + Summable (fun i : Σ s, Fin (m s) => u i.1 / (m i.1 : ℝ)) := by + apply (summable_sigma_of_nonneg (fun i => + div_nonneg (hu i.1) (Nat.cast_nonneg _))).2 + refine ⟨fun _ => (hasSum_fintype _).summable, ?_⟩ + simpa only [tsum_fin_block_average (hm _)] using hsum + +theorem tsum_block_average (m : ℕ → ℕ) (hm : ∀ s, 0 < m s) + (u : ℕ → ℝ) (hu : ∀ s, 0 ≤ u s) (hsum : Summable u) : + (∑' i : Σ s, Fin (m s), u i.1 / (m i.1 : ℝ)) = ∑' s, u s := by + rw [(summable_block_average m hm u hu hsum).tsum_sigma' + (fun _ => (hasSum_fintype _).summable)] + simp only [tsum_fin_block_average (hm _)] + +theorem enumerated_block_average {ι : Type*} (m : ℕ → ℕ) (hm : ∀ s, 0 < m s) + (u : ℕ → ℝ) (hu : ∀ s, 0 ≤ u s) (hsum : Summable u) + (e : ι ≃ Σ s, Fin (m s)) : + Summable (fun i => u (e i).1 / (m (e i).1 : ℝ)) ∧ + (∑' i, u (e i).1 / (m (e i).1 : ℝ)) = ∑' s, u s := by + constructor + · exact e.summable_iff.mpr (summable_block_average m hm u hu hsum) + · exact (e.tsum_eq _).trans (tsum_block_average m hm u hu hsum) + +end InvariantProjection.IndependentAngles + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockMassRegrouping.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockMassRegrouping.lean new file mode 100644 index 0000000000000000000000000000000000000000..e1feeb46e218b2c6e7acd4d68d9c1de476099b42 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockMassRegrouping.lean @@ -0,0 +1,127 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CircleParameterBlocks +import Mathlib.Topology.Algebra.InfiniteSum.Real +import Mathlib.Analysis.PSeries + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Invariant233 +namespace CircleParameterData + +def normalizedBlockMass (p : CircleParameterData) (a : ℕ → ℝ) (i : ℕ) : ℝ := + if i = 0 then 0 else a (p.blockIndex i) / (p.m (p.blockIndex i) : ℝ) + +private def budgetBlocks (p : CircleParameterData) (j : ℕ) : Finset ℕ := + if j = 0 then {0} else p.block j + +private theorem budgetBlocks_partition (p : CircleParameterData) + (hm : ∀ j, 1 ≤ j → 0 < p.m j) : + ∀ i : ℕ, ∃! j : ℕ, i ∈ budgetBlocks p j := by + intro i + by_cases hi : i = 0 + · subst i + refine ⟨0, by simp [budgetBlocks], ?_⟩ + intro j hj + by_contra h + have hb : 0 ∈ p.block j := by simpa [budgetBlocks, h] using hj + have hb' := (p.mem_block_iff j 0).mp hb + omega + · obtain ⟨j, hj, hij⟩ := p.exists_mem_block hm i (by omega) + have hj0 : j ≠ 0 := by omega + refine ⟨j, by simpa [budgetBlocks, hj0] using hij, ?_⟩ + intro k hik + have hk0 : k ≠ 0 := by + intro hk + subst k + simp [budgetBlocks, hi] at hik + have hk : i ∈ p.block k := by simpa [budgetBlocks, hk0] using hik + exact p.block_index_unique hm hk hij + +theorem sum_normalizedBlockMass (p : CircleParameterData) + (hm : ∀ j, 1 ≤ j → 0 < p.m j) (a : ℕ → ℝ) + (j : ℕ) (hj : 1 ≤ j) : + (∑ i ∈ p.block j, p.normalizedBlockMass a i) = a j := by + have hm0 : (p.m j : ℝ) ≠ 0 := by exact_mod_cast (hm j hj).ne' + calc + (∑ i ∈ p.block j, p.normalizedBlockMass a i) = + ∑ _i ∈ p.block j, a j / (p.m j : ℝ) := by + apply Finset.sum_congr rfl + intro i hi + have hi0 : i ≠ 0 := by + have hu := (p.mem_block_iff j i).mp hi + omega + simp only [normalizedBlockMass, ite_eq_right hi0, p.blockIndex_eq_of_mem hm hi] + _ = a j := by + simp only [Finset.sum_const, nsmul_eq_mul, p.card_block j hj] + field_simp + +private theorem tsum_budgetBlock (p : CircleParameterData) + (hm : ∀ j, 1 ≤ j → 0 < p.m j) (a : ℕ → ℝ) (ha0 : a 0 = 0) + (j : ℕ) : + (∑' i : (budgetBlocks p j : Set ℕ), p.normalizedBlockMass a i) = a j := by + classical + by_cases hj : j = 0 + · subst j + simp [budgetBlocks, normalizedBlockMass, ha0] + · rw [tsum_fintype] + change (∑ i ∈ (budgetBlocks p j).attach, p.normalizedBlockMass a i) = a j + rw [Finset.sum_attach] + simpa only [budgetBlocks, ite_eq_right hj] using + p.sum_normalizedBlockMass hm a j (by omega) + +theorem summable_normalizedBlockMass (p : CircleParameterData) + (hm : ∀ j, 1 ≤ j → 0 < p.m j) (a : ℕ → ℝ) + (ha : ∀ j, 0 ≤ a j) (ha0 : a 0 = 0) (hs : Summable a) : + Summable (p.normalizedBlockMass a) := by + classical + have hnonneg : 0 ≤ p.normalizedBlockMass a := by + intro i + simp only [normalizedBlockMass] + split_ifs + · exact le_rfl + · exact div_nonneg (ha _) (Nat.cast_nonneg _) + apply (summable_partition hnonneg (p.budgetBlocks_partition hm)).mpr + constructor + · intro j + exact (hasSum_fintype _).summable + · simpa only [p.tsum_budgetBlock hm a ha0] using hs + +theorem tsum_normalizedBlockMass (p : CircleParameterData) + (hm : ∀ j, 1 ≤ j → 0 < p.m j) (a : ℕ → ℝ) + (ha : ∀ j, 0 ≤ a j) (ha0 : a 0 = 0) (hs : Summable a) : + (∑' i, p.normalizedBlockMass a i) = ∑' j, a j := by + classical + let e := Set.sigmaEquiv (fun j => (budgetBlocks p j : Set ℕ)) + (p.budgetBlocks_partition hm) + have hsum := p.summable_normalizedBlockMass hm a ha ha0 hs + have he : ∀ z, e z = z.2.val := fun _ => rfl + have hsig : Summable (fun z : (j : ℕ) × (budgetBlocks p j : Set ℕ) => + p.normalizedBlockMass a z.2.val) := by + apply (e.summable_iff.mpr hsum).congr + intro z + exact congrArg (p.normalizedBlockMass a) (he z) + calc + (∑' i, p.normalizedBlockMass a i) = + ∑' z, p.normalizedBlockMass a (e z) := (e.tsum_eq _).symm + _ = ∑' z : (j : ℕ) × (budgetBlocks p j : Set ℕ), + p.normalizedBlockMass a z.2.val := tsum_congr (fun z => congrArg _ (he z)) + _ = ∑' j, ∑' i : (budgetBlocks p j : Set ℕ), p.normalizedBlockMass a i := + hsig.tsum_sigma + _ = ∑' j, a j := tsum_congr (p.tsum_budgetBlock hm a ha0) + +theorem summable_kappa_sq : Summable (fun j : ℕ => kappa j ^ 2) := by + have h : Summable (fun j : ℕ => 1 / (j : ℝ) ^ 2) := + Real.summable_one_div_nat_pow.mpr (by norm_num) + apply (h.mul_left ((1 / 100 : ℝ) ^ 2)).congr + intro j + simp only [kappa, one_div, mul_inv_rev, mul_pow] + ring + +end CircleParameterData +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockReciprocalSum.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockReciprocalSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..ecfabfa9c190d8e6bca1ad23c1d22a8deb9aaa73 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockReciprocalSum.lean @@ -0,0 +1,50 @@ +import Mathlib.Topology.Algebra.InfiniteSum.Real +import Mathlib.Analysis.Normed.Group.InfiniteSum +import Mathlib.Tactic + +namespace OAI + +open scoped BigOperators + +namespace InvariantProjection.IndependentAngles + +theorem tsum_fin_block_reciprocal {m : ℕ} (hm : 0 < m) (K : ℝ) : + (∑' _i : Fin m, 1 / ((m : ℝ) * K)) = 1 / K := by + have hm0 : (m : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hm) + simp only [tsum_fintype, Finset.sum_const, Finset.card_univ, Fintype.card_fin, + nsmul_eq_mul] + by_cases hK : K = 0 + · simp [hK] + · field_simp + +theorem summable_block_reciprocal (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) + (K : ℕ → ℝ) (hK : ∀ j, 0 < K j) + (hsum : Summable (fun j => 1 / K j)) : + Summable (fun i : Σ j, Fin (m j) => 1 / ((m i.1 : ℝ) * K i.1)) := by + apply (summable_sigma_of_nonneg (fun i => div_nonneg (by norm_num) + (mul_nonneg (Nat.cast_nonneg _) (hK i.1).le))).2 + refine ⟨fun _ => (hasSum_fintype _).summable, ?_⟩ + simpa only [tsum_fin_block_reciprocal (hm _) (K _)] using hsum + +theorem tsum_block_reciprocal (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) + (K : ℕ → ℝ) (hK : ∀ j, 0 < K j) + (hsum : Summable (fun j => 1 / K j)) : + (∑' i : Σ j, Fin (m j), 1 / ((m i.1 : ℝ) * K i.1)) = ∑' j, 1 / K j := by + rw [(summable_block_reciprocal m hm K hK hsum).tsum_sigma' (fun _ => (hasSum_fintype _).summable)] + simp only [tsum_fin_block_reciprocal (hm _) (K _)] + +theorem enumerated_block_reciprocal {ι : Type*} (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) + (K : ℕ → ℝ) (hK : ∀ j, 0 < K j) + (hsum : Summable (fun j => 1 / K j)) (e : ι ≃ Σ j, Fin (m j)) : + Summable (fun i => 1 / ((m (e i).1 : ℝ) * K (e i).1)) ∧ + (∑' i, 1 / ((m (e i).1 : ℝ) * K (e i).1)) = ∑' j, 1 / K j := by + constructor + · exact e.summable_iff.mpr (summable_block_reciprocal m hm K hK hsum) + · calc + (∑' i, 1 / ((m (e i).1 : ℝ) * K (e i).1)) = + ∑' i : Σ j, Fin (m j), 1 / ((m i.1 : ℝ) * K i.1) := e.tsum_eq (fun i : Σ j, Fin (m j) => 1 / ((m i.1 : ℝ) * K i.1)) + _ = ∑' j, 1 / K j := tsum_block_reciprocal m hm K hK hsum + +end InvariantProjection.IndependentAngles + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedConvolutionIdentity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedConvolutionIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..98292964eda9ae3b869feeba5a820cf63d3f6415 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedConvolutionIdentity.lean @@ -0,0 +1,98 @@ +import OAI.Analysis.IrrationalRotation.Operators.BlockedProjectionWindow +import OAI.Analysis.IrrationalRotation.Product.ProductOrbitPair + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped BigOperators ComplexConjugate ENNReal + +namespace Invariant233.ProductModel + +theorem pairIdentity_diagonal_weight (θ c : ℕ → ℝ) (x y : Base) + (hr : ∀ k, 0 < cocycleRatio θ c x y k ∧ cocycleRatio θ c x y k ≤ 1) : + ∃ r : WeightedShift.Weight, + (∀ k, r k = (cocycleRatio θ c x y k : ℂ)) ∧ + WeightedShift.diagonal r = ratioDiagonal θ c x y := by + let r : WeightedShift.Weight := ⟨fun k => (cocycleRatio θ c x y k : ℂ), + memℓp_infty (by + refine ⟨1, ?_⟩ + rintro t ⟨k, rfl⟩ + simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (hr k).1] + using (hr k).2)⟩ + exact ⟨r, fun _ => rfl, (boundedDiagonal_weight r).symm⟩ + +theorem cocycle_convolution_of_pairIdentity + (θ c : ℕ → ℝ) (F : Base → Fiber →L[ℂ] Fiber) (x y : Base) + (hproj : IsStarProjection (F y)) + (hinv : (1 - F y) * WeightedShift.operator (actualWeightField θ c y) * F y = 0) + (hpair : PairIdentity θ c F (x, y)) (n : ℕ) + (hprod : ∀ v : ℤ, (∏ i ∈ Finset.range n, + weight θ c (rotationIterate θ (v + i) y)) = + ProductCocycle.cocycleVersion θ c n (rotationIterate θ v y)) + (hadd : ∀ v : ℤ, ProductCocycle.cocycleVersion θ c (v + n) y = + ProductCocycle.cocycleVersion θ c n (rotationIterate θ v y) * + ProductCocycle.cocycleVersion θ c v y) + (ξ η : Fiber) : + let A : ℤ → ℂ := fun v => F x ξ v / (ProductCocycle.cocycleVersion θ c v x : ℂ) + let B : ℤ → ℂ := fun v => (ProductCocycle.cocycleVersion θ c (-v) y : ℂ) * + conj ((1 - F y) η (-v)) + Summable (fun v : ℤ => ‖A v * B (-(n : ℤ) - v)‖) ∧ + (∑' v : ℤ, A v * B (-(n : ℤ) - v)) = 0 := by + obtain ⟨r, hr, hdiag⟩ := pairIdentity_diagonal_weight θ c x y hpair.1 + apply OrbitInvariance.cocycle_coefficients_absolute_and_zero + (actualWeightField θ c y) r + (fun v => ProductCocycle.cocycleVersion θ c v x) + (fun v => ProductCocycle.cocycleVersion θ c v y) hproj hinv + (by rw [hdiag]; exact hpair.2) n ξ η + intro v + rw [WeightedShift.orbitProduct_apply, hr] + change (∏ i ∈ Finset.range n, (weight θ c (rotationIterate θ (v + i) y) : ℂ)) * + (ProductCocycle.cocycleVersion θ c v y / + ProductCocycle.cocycleVersion θ c v x : ℝ) = _ + rw [← Complex.ofReal_prod, hprod v, hadd v, Complex.ofReal_div, Complex.ofReal_mul] + ring + +end Invariant233.ProductModel + +namespace Invariant233.BlockedProductCoupling + +theorem ae_source_convolution_absolute_and_zero {p : ProductScaleData} + (hp : ProductScaleLaws p) (e : ℕ ≃ Σ s, Fin (p.m s)) + (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθsum : Summable θ) + (P : ProductModel.Hilbert →L[ℂ] ProductModel.Hilbert) (F : ProjectionField) + (hrep : ∀ ξ : ProductModel.Hilbert, + P ξ =ᵐ[ProductModel.baseMeasure] fun x => F x (ξ x)) + (hinv : (1 - P) * ProductModel.weightedOperator θ (fun i => p.C (e i).1) * P = 0) + (hproj : ∀ᵐ x ∂ProductModel.baseMeasure, IsStarProjection (F x)) + (j : ℕ) + (hpair : ∀ᵐ z ∂sourceLaw p j, ProductModel.PairIdentity θ (fun i => p.C (e i).1) + F (circleLeftEndpoint e z, circleRightEndpoint e z)) : + ∀ᵐ z ∂sourceLaw p j, ∀ n : ℕ, + Summable (fun v : ℤ => ‖sourceCoefficientA p e θ F z v * + sourceCoefficientB p e θ F z (-(n : ℤ) - v)‖) ∧ + (∑' v : ℤ, sourceCoefficientA p e θ F z v * + sourceCoefficientB p e θ F z (-(n : ℤ) - v)) = 0 := by + let c : ℕ → ℝ := fun i => p.C (e i).1 + have hc : ∀ i, 0 ≤ c i := fun i => (hp.C_pos (e i).1).le + have hright := sourceLaw_quasiMeasurePreserving_right hp e j + have hInv := ProductModel.ae_actualWeightField_invariant θ c P F hrep hinv + obtain ⟨s, _, hfull, _, _, hlaw⟩ := + ProductCocycle.exists_invariant_cocycle_core θ hθ0 hθsum + have hProd : ∀ᵐ y ∂ProductModel.baseMeasure, ∀ n : ℕ, ∀ v : ℤ, + (∏ i ∈ Finset.range n, ProductModel.weight θ c (ProductModel.rotationIterate θ (v + i) y)) = + ProductCocycle.cocycleVersion θ c n (ProductModel.rotationIterate θ v y) := + ae_all_iff.mpr (fun n => ProductModel.ae_weight_orbit_product_eq_cocycleVersion + θ c hθ0 hc hθsum n) + filter_upwards [hpair, hright.ae hproj, hright.ae hInv, + hright.ae hProd, hright.ae hfull] with z hz hpz hiz hprod hcore + intro n + exact ProductModel.cocycle_convolution_of_pairIdentity θ c F + (circleLeftEndpoint e z) (circleRightEndpoint e z) hpz hiz hz n (hprod n) + (fun v => hlaw _ hcore c v n) sourceBasisZero sourceBasisZero + +end Invariant233.BlockedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedEventConditions.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedEventConditions.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8f5a30d8ebf3847a7da1351e4537abc5f2de564 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedEventConditions.lean @@ -0,0 +1,40 @@ +import OAI.Analysis.IrrationalRotation.Couplings.BlockedProductCoupling + +namespace OAI + +open Set + +namespace Invariant233.BlockedProductCoupling + +theorem not_mem_futureBad_iff {m : ℕ → ℕ} {K : ℕ → ℝ} + {j : ℕ} {z : Sample m} : + z ∉ futureBad m K j ↔ + ∀ s, j < s → ∀ i : Fin (m s), + (z s i).2.1 < 1 - 2 * K j / ((m s : ℝ) * K s) ∧ + 2 * K j / ((m s : ℝ) * K s) < (z s i).2.2 := by + simp only [futureBad, mem_iUnion, mem_ofPred_eq, not_exists, not_or, not_le] + constructor + · intro h s hs + obtain ⟨n, hn⟩ := Nat.exists_eq_add_of_le (Nat.succ_le_of_lt hs) + subst s + exact h n + · intro h n i + exact h (j + 1 + n) (by omega) i + +theorem mem_retainedEvent_iff {X : Type*} {m : ℕ → ℕ} {K : ℕ → ℝ} + {r : X → ℝ} {x y : Sample m → X} {j : ℕ} {z : Sample m} : + z ∈ retainedEvent m K r x y j ↔ + (∃ i, (z j i).1 = some (4 : Fin 5)) ∧ + (∀ i, (z j i).2.1 < 1 - 2 / (m j : ℝ) ∧ + 2 / (m j : ℝ) < (z j i).2.2) ∧ + (∀ s, j < s → ∀ i : Fin (m s), + (z s i).2.1 < 1 - 2 * K j / ((m s : ℝ) * K s) ∧ + 2 * K j / ((m s : ℝ) * K s) < (z s i).2.2) ∧ + 1 / (j : ℝ) ≤ r (x z) ∧ 1 / (j : ℝ) ≤ 1 - r (y z) := by + simp only [retainedEvent, mem_sdiff, mem_union, not_or, not_mem_futureBad_iff, + currentEvent, mem_ofPred_eq, not_lt] + tauto + +end Invariant233.BlockedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedPositiveEvent.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedPositiveEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c3ed8d302ae7d4b42c558edcc80ded41d82a70f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedPositiveEvent.lean @@ -0,0 +1,101 @@ +import OAI.Analysis.IrrationalRotation.Couplings.BlockedProductCoupling +import OAI.Analysis.IrrationalRotation.Couplings.BlockedCouplingDensity +import OAI.Analysis.IrrationalRotation.Analysis.EndpointLoss +import OAI.Analysis.IrrationalRotation.Analysis.ParameterTails + +namespace OAI + +open Filter MeasureTheory Set +open scoped Topology + +namespace Invariant233.BlockedProductCoupling + +variable {m : ℕ → ℕ} {κ : ℕ → ℝ} + {a b : (s : ℕ) → Fin (m s) → ℝ} + (hm : ∀ s, 100 ≤ m s) (hκ0 : ∀ s, 0 ≤ κ s) (hκ : ∀ s, κ s ≤ 1 / 100) + (ha : ∀ s i, 1 / (m s : ℝ) ≤ a s i) (ha' : ∀ s i, a s i ≤ 1 / 4) + (hb : ∀ s i, 1 / (m s : ℝ) ≤ b s i) (hb' : ∀ s i, b s i ≤ 1 / 4) + +include hm hκ0 hκ ha ha' hb hb' + +theorem futureBad_mass_le_ratio {K : ℕ → ℝ} (hK : ∀ s, 0 < K s) + (hd : ∀ s, 2 * K s ≤ K (s + 1)) (j : ℕ) : + (law m κ a b j).real (futureBad m K j) ≤ 80 * (K j / K (j + 1)) := by + have hs : Summable (fun n : ℕ => 1 / K (j + 1 + n)) := by + simpa only [Function.comp_def, Nat.add_comm] using + (ParameterTails.summable_reciprocal hK hd).comp_injective + (show Function.Injective (fun n : ℕ => n + (j + 1)) from + fun _ _ h => Nat.add_right_cancel h) + calc + _ ≤ 40 * K j * ∑' n : ℕ, 1 / K (j + 1 + n) := + futureBad_mass_le hm hκ0 hκ ha ha' hb hb' hK j hs + _ ≤ 40 * K j * (2 / K (j + 1)) := + mul_le_mul_of_nonneg_left (ParameterTails.reciprocal_tail_bound hK hd j) + (mul_nonneg (by norm_num) (hK j).le) + _ = 80 * (K j / K (j + 1)) := by ring + +theorem tendsto_futureBad_mass_zero {K : ℕ → ℝ} (hK : ∀ s, 0 < K s) + (hd : ∀ s, 2 * K s ≤ K (s + 1)) + (hratio : Tendsto (fun j => K j / K (j + 1)) atTop (𝓝 0)) : + Tendsto (fun j => (law m κ a b j).real (futureBad m K j)) atTop (𝓝 0) := by + apply squeeze_zero (fun _ => measureReal_nonneg) + (futureBad_mass_le_ratio hm hκ0 hκ ha ha' hb hb' hK hd) + simpa using tendsto_const_nhds.mul hratio + +theorem eventually_retainedEvent_mass + {K : ℕ → ℝ} (hK : ∀ s, 0 < K s) + (hd : ∀ s, 2 * K s ≤ K (s + 1)) + (hratio : Tendsto (fun j => K j / K (j + 1)) atTop (𝓝 0)) + {X : Type*} [MeasurableSpace X] (μ : Measure X) [IsFiniteMeasure μ] + {r : X → ℝ} (hr : Measurable r) (hi : ∀ᵐ x ∂μ, 0 < r x ∧ r x < 1) + (x y : Sample m → X) (hx : Measurable x) (hy : Measurable y) + (h₁ h₂ : ℕ → X → ℝ) + (hh₁ : ∀ j, MemLp (h₁ j) 2 μ) (hh₂ : ∀ j, MemLp (h₂ j) 2 μ) + (hn₁ : ∀ j, 0 ≤ᵐ[μ] h₁ j) (hn₂ : ∀ j, 0 ≤ᵐ[μ] h₂ j) + (H₁ H₂ : ℝ) + (hH₁ : ∀ j, Real.sqrt (∫ z, h₁ j z ^ 2 ∂μ) ≤ H₁) + (hH₂ : ∀ j, Real.sqrt (∫ z, h₂ j z ^ 2 ∂μ) ≤ H₂) + (hmap₁ : ∀ j, (law m κ a b j).map x = + μ.withDensity (fun z => ENNReal.ofReal (h₁ j z))) + (hmap₂ : ∀ j, (law m κ a b j).map y = + μ.withDensity (fun z => ENNReal.ofReal (h₂ j z))) : + ∀ᶠ j in atTop, Real.exp (-82) / 2 ≤ + (law m κ a b j).real (retainedEvent m K r x y j) := by + have := law_isProbabilityMeasure hm hκ0 hκ ha ha' hb hb' + have hdiag := EndpointLoss.tendsto_endpoint_bad_union_zero μ hr hi + (law m κ a b) (fun _ => x) (fun _ => y) (fun _ => hx) (fun _ => hy) + h₁ h₂ hh₁ hh₂ hn₁ hn₂ H₁ H₂ hH₁ hH₂ hmap₁ hmap₂ + have hfuture := tendsto_futureBad_mass_zero hm hκ0 hκ ha ha' hb hb' hK hd hratio + have hloss : Tendsto (fun j => (law m κ a b j).real + (futureBad m K j ∪ ({z | r (x z) < 1 / (j : ℝ)} ∪ + {z | 1 - r (y z) < 1 / (j : ℝ)}))) atTop (𝓝 0) := by + apply squeeze_zero (fun _ => measureReal_nonneg) (fun _ => measureReal_union_le _ _) + simpa only [zero_add] using hfuture.add hdiag + exact InvariantRotation.TaggedEventBounds.eventually_half_le_measureReal_sdiff + (law m κ a b) (currentEvent m) _ (Real.exp_pos _) + (Eventually.of_forall (currentEvent_mass hm hκ0 hκ ha ha' hb hb')) hloss + +theorem eventually_actual_retainedEvent_mass + (hsq : Summable (fun s => κ s ^ 2)) + (e : ℕ ≃ Σ s, Fin (m s)) + {K : ℕ → ℝ} (hK : ∀ s, 0 < K s) + (hd : ∀ s, 2 * K s ≤ K (s + 1)) + (hratio : Tendsto (fun j => K j / K (j + 1)) atTop (𝓝 0)) + {r : OrderedProductCoupling.Endpoint → ℝ} (hr : Measurable r) + (hi : ∀ᵐ x ∂OrderedProductCoupling.baseMeasure, 0 < r x ∧ r x < 1) : + ∀ᶠ j in atTop, Real.exp (-82) / 2 ≤ + (law m κ a b j).real + (retainedEvent m K r (leftEndpoint e) (rightEndpoint e) j) := by + choose h₁ hh₁ hn₁ hH₁ hmap₁ using + exists_left_density_of_blocks hm hκ0 hκ ha ha' hb hb' hsq e + choose h₂ hh₂ hn₂ hH₂ hmap₂ using + exists_right_density_of_blocks hm hκ0 hκ ha ha' hb hb' hsq e + apply eventually_retainedEvent_mass hm hκ0 hκ ha ha' hb hb' hK hd hratio + OrderedProductCoupling.baseMeasure hr hi (leftEndpoint e) (rightEndpoint e) + (by unfold leftEndpoint flatten OrderedProductCoupling.leftEndpoint; fun_prop) + (by unfold rightEndpoint flatten OrderedProductCoupling.rightEndpoint; fun_prop) + h₁ h₂ hh₁ hh₂ hn₁ hn₂ _ _ hH₁ hH₂ hmap₁ hmap₂ + +end Invariant233.BlockedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedSourceEvent.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedSourceEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..10d1db8b914ca85ce8c1d16026fe9260685cb098 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedSourceEvent.lean @@ -0,0 +1,132 @@ +import OAI.Analysis.IrrationalRotation.Model.BlockedSourceEvent +import OAI.Analysis.IrrationalRotation.Rotation.BlockedCircleEvent +import OAI.Analysis.IrrationalRotation.Analysis.BlockedEventConditions +import OAI.Analysis.IrrationalRotation.Product.ProductScaleConsequences +import Mathlib.Analysis.PSeries + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped Topology + +namespace Invariant233.BlockedProductCoupling + +theorem mem_sourceRetainedEvent_iff {X : Type*} {m : ℕ → ℕ} {K : ℕ → ℝ} + {r : X → ℝ} {x y : Sample m → X} {j : ℕ} {z : Sample m} : + z ∈ sourceRetainedEvent m K r x y j ↔ + (∃ i, (z j i).1 = some (4 : Fin 5)) ∧ + (∀ i, (z j i).2.1 < 1 - 2 / (m j : ℝ) ∧ + 2 / (m j : ℝ) < (z j i).2.2) ∧ + (∀ s, j < s → ∀ i : Fin (m s), + (z s i).2.1 < 1 - 2 * K j / ((m s : ℝ) * K s) ∧ + 2 * K j / ((m s : ℝ) * K s) < (z s i).2.2) ∧ + 1 / ((j + 1 : ℕ) : ℝ) ≤ r (x z) ∧ + 1 / ((j + 1 : ℕ) : ℝ) ≤ 1 - r (y z) := by + simp only [sourceRetainedEvent, Set.mem_sdiff, mem_union, not_or, + not_mem_futureBad_iff, currentEvent, mem_ofPred_eq, not_lt] + tauto + +theorem retainedEvent_subset_sourceRetainedEvent {X : Type*} + (m : ℕ → ℕ) (K : ℕ → ℝ) (r : X → ℝ) (x y : Sample m → X) + (j : ℕ) (hj : 1 ≤ j) : + retainedEvent m K r x y j ⊆ sourceRetainedEvent m K r x y j := by + intro z hz + obtain ⟨htag, hcur, hfuture, hx, hy⟩ := mem_retainedEvent_iff.mp hz + have hdiv : 1 / ((j + 1 : ℕ) : ℝ) ≤ 1 / (j : ℝ) := + one_div_le_one_div_of_le (by exact_mod_cast (by omega : 0 < j)) + (by exact_mod_cast Nat.le_succ j) + exact mem_sourceRetainedEvent_iff.mpr ⟨htag, hcur, hfuture, hdiv.trans hx, hdiv.trans hy⟩ + +theorem source_kappa_nonneg (j : ℕ) : 0 ≤ ProductScaleData.kappa j := by + unfold ProductScaleData.kappa + positivity + +theorem source_kappa_le (j : ℕ) : ProductScaleData.kappa j ≤ 1 / 100 := by + apply one_div_le_one_div_of_le (by norm_num) + have hj : (1 : ℝ) ≤ ((j + 1 : ℕ) : ℝ) := by exact_mod_cast Nat.succ_pos j + linarith + +theorem source_kappa_sq_summable : Summable (fun j => ProductScaleData.kappa j ^ 2) := by + have hs : Summable (fun j : ℕ => 1 / (j : ℝ) ^ 2) := + Real.summable_one_div_nat_pow.mpr (by norm_num) + have ht := (summable_nat_add_iff 1).mpr hs + apply (ht.mul_left (1 / (100 : ℝ) ^ 2)).congr + intro j + dsimp [ProductScaleData.kappa] + ring + +theorem sourceLaw_isProbabilityMeasure {p : ProductScaleData} + (hp : ProductScaleLaws p) (j : ℕ) : IsProbabilityMeasure (sourceLaw p j) := + law_isProbabilityMeasure hp.m_ge_100 source_kappa_nonneg source_kappa_le + (fun s _ => (hp.a_bounds s).1) (fun s _ => (hp.a_bounds s).2) + (fun s _ => (hp.b_bounds s).1) (fun s _ => (hp.b_bounds s).2) j + +theorem sourceLaw_quasiMeasurePreserving_hybrid {p : ProductScaleData} + (hp : ProductScaleLaws p) (e : ℕ ≃ Σ s, Fin (p.m s)) (j : ℕ) + (sel : ℕ → Bool) : + Measure.QuasiMeasurePreserving + (toCircle ∘ (OrderedProductCoupling.hybridEndpoint sel ∘ flatten e)) + (sourceLaw p j) ProductModel.baseMeasure := by + apply measurePreserving_toCircle.quasiMeasurePreserving.comp + refine ⟨(OrderedProductCoupling.hybridEndpoint_measurable sel).comp + (by unfold flatten; fun_prop), ?_⟩ + obtain ⟨H, _, _, _, _, hmap⟩ := exists_hybrid_density_of_blocks + hp.m_ge_100 source_kappa_nonneg source_kappa_le + (fun s _ => (hp.a_bounds s).1) (fun s _ => (hp.a_bounds s).2) + (fun s _ => (hp.b_bounds s).1) (fun s _ => (hp.b_bounds s).2) + source_kappa_sq_summable e j sel + change (sourceLaw p j).map _ = _ at hmap + rw [hmap] + exact withDensity_absolutelyContinuous _ _ + +theorem sourceLaw_quasiMeasurePreserving_left {p : ProductScaleData} + (hp : ProductScaleLaws p) (e : ℕ ≃ Σ s, Fin (p.m s)) (j : ℕ) : + Measure.QuasiMeasurePreserving (circleLeftEndpoint e) + (sourceLaw p j) ProductModel.baseMeasure := by + exact sourceLaw_quasiMeasurePreserving_hybrid hp e j (fun _ => false) + +theorem sourceLaw_quasiMeasurePreserving_right {p : ProductScaleData} + (hp : ProductScaleLaws p) (e : ℕ ≃ Σ s, Fin (p.m s)) (j : ℕ) : + Measure.QuasiMeasurePreserving (circleRightEndpoint e) + (sourceLaw p j) ProductModel.baseMeasure := by + exact sourceLaw_quasiMeasurePreserving_hybrid hp e j (fun _ => true) + +theorem source_cutoff_ratio_tendsto {p : ProductScaleData} (hp : ProductScaleLaws p) : + Tendsto (fun j => (p.K j : ℝ) / p.K (j + 1)) atTop (𝓝 0) := by + have hH := SamplingHorizon.tendsto_horizon_ratio_of_pow_two_le + (m := fun j => (p.m j : ℝ)) (K := fun j => (p.K j : ℝ)) + (fun j => by exact_mod_cast hp.m_ge_pow_self j) + (fun j => by rw [hp.next_K j]; exact Nat.le_ceil _) + apply squeeze_zero (fun j => div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _)) _ hH + intro j + apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg _) + calc + (p.K j : ℝ) ≤ p.m j := by exact_mod_cast hp.m_ge_K j + _ ≤ (p.m j : ℝ) ^ ((7 / 10 : ℝ) * p.m j) := by + have hm : (100 : ℝ) ≤ p.m j := by exact_mod_cast hp.m_ge_100 j + simpa only [Real.rpow_one] using + Real.rpow_le_rpow_of_exponent_le (by linarith : (1 : ℝ) ≤ p.m j) + (by linarith : (1 : ℝ) ≤ (7 / 10 : ℝ) * p.m j) + +theorem eventually_sourceEvent_mass {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) {r : ProductModel.Base → ℝ} + (hr : Measurable r) (hi : ∀ᵐ x ∂ProductModel.baseMeasure, 0 < r x ∧ r x < 1) : + ∀ᶠ j in atTop, Real.exp (-82) / 2 ≤ (sourceLaw p j).real (sourceEvent p e r j) := by + have h := eventually_circle_retainedEvent_mass hp.m_ge_100 + source_kappa_nonneg source_kappa_le + (fun s _ => (hp.a_bounds s).1) (fun s _ => (hp.a_bounds s).2) + (fun s _ => (hp.b_bounds s).1) (fun s _ => (hp.b_bounds s).2) + source_kappa_sq_summable e hp.real_K_pos hp.real_K_double + (source_cutoff_ratio_tendsto hp) hr hi + filter_upwards [h, eventually_ge_atTop 1] with j hj hjpos + have := sourceLaw_isProbabilityMeasure hp j + change Real.exp (-82) / 2 ≤ (sourceLaw p j).real _ at hj + exact hj.trans (measureReal_mono + (retainedEvent_subset_sourceRetainedEvent _ _ _ _ _ j hjpos)) + +end Invariant233.BlockedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedSourceTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedSourceTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..29bdacd0a4eeeb2961a3c1cea798d9b093765376 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BlockedSourceTransport.lean @@ -0,0 +1,178 @@ +import OAI.Analysis.IrrationalRotation.Operators.BlockedProjectionWindow +import OAI.Analysis.IrrationalRotation.Model.PhaseBlocks + +namespace OAI + +open scoped BigOperators + +noncomputable section +open MeasureTheory Set Filter + +namespace Invariant233.BlockedProductCoupling + +@[simp] theorem unflatten_flatten {m : ℕ → ℕ} (e : ℕ ≃ Σ s, Fin (m s)) (z : Sample m) : + unflatten e (flatten e z) = z := by + funext s i + change (fun q : Σ t, Fin (m t) => z q.1 q.2) (e (e.symm ⟨s, i⟩)) = z s i + rw [e.apply_symm_apply] + +@[simp] theorem flatten_unflatten {m : ℕ → ℕ} (e : ℕ ≃ Σ s, Fin (m s)) + (ω : OrderedProductCoupling.Sample) : flatten e (unflatten e ω) = ω := by + funext i + simp [unflatten, flatten] + +theorem measurable_unflatten {m : ℕ → ℕ} (e : ℕ ≃ Σ s, Fin (m s)) : + Measurable (unflatten e) := by unfold unflatten; fun_prop + +theorem measurable_flatten {m : ℕ → ℕ} (e : ℕ ≃ Σ s, Fin (m s)) : + Measurable (flatten e) := by unfold flatten; fun_prop + +theorem source_measurePreserving_flatten {p : ProductScaleData} + (hp : ProductScaleLaws p) (e : ℕ ≃ Σ s, Fin (p.m s)) (j : ℕ) : + MeasurePreserving (flatten e) (sourceLaw p j) + (OrderedProductCoupling.law (OrderedProductCoupling.sourceBlocks p.m p.a p.b + hp.m_ge_100 (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j)) := by + refine ⟨measurable_flatten e, ?_⟩ + change (law _ _ _ _ _).map _ = _ + rw [law_map_flatten hp.m_ge_100 source_kappa_nonneg source_kappa_le + (fun s _ => (hp.a_bounds s).1) (fun s _ => (hp.a_bounds s).2) + (fun s _ => (hp.b_bounds s).1) (fun s _ => (hp.b_bounds s).2)] + congr 1 + simp [parameters, OrderedProductCoupling.sourceBlocks, OrderedProductCoupling.ofBlocks, + OrderedProductCoupling.sourceKappa, ProductScaleData.kappa, Nat.cast_add, Nat.cast_one] + +theorem source_measurePreserving_unflatten {p : ProductScaleData} + (hp : ProductScaleLaws p) (e : ℕ ≃ Σ s, Fin (p.m s)) (j : ℕ) : + MeasurePreserving (unflatten e) + (OrderedProductCoupling.law (OrderedProductCoupling.sourceBlocks p.m p.a p.b + hp.m_ge_100 (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j)) + (sourceLaw p j) := by + refine ⟨measurable_unflatten e, ?_⟩ + rw [← (source_measurePreserving_flatten hp e j).map_eq, + Measure.map_map (measurable_unflatten e) (measurable_flatten e)] + rw [show unflatten e ∘ flatten e = id from funext (unflatten_flatten e)] + exact Measure.map_id + +theorem measurable_flatSourceEvent (p : ProductScaleData) + (e : ℕ ≃ Σ s, Fin (p.m s)) {r : ProductModel.Base → ℝ} (hr : Measurable r) (j : ℕ) : + MeasurableSet (flatSourceEvent p e r j) := + (measurable_sourceEvent p e hr j).preimage (measurable_unflatten e) + +theorem flatSourceEvent_mass_eq {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) {r : ProductModel.Base → ℝ} (hr : Measurable r) (j : ℕ) : + (OrderedProductCoupling.law (OrderedProductCoupling.sourceBlocks p.m p.a p.b + hp.m_ge_100 (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j)).real + (flatSourceEvent p e r j) = (sourceLaw p j).real (sourceEvent p e r j) := by + rw [← (source_measurePreserving_unflatten hp e j).map_eq, + map_measureReal_apply (measurable_unflatten e) (measurable_sourceEvent p e hr j)] + rfl + +@[simp] theorem circleLeftEndpoint_unflatten {m : ℕ → ℕ} + (e : ℕ ≃ Σ s, Fin (m s)) (ω : OrderedProductCoupling.Sample) : + circleLeftEndpoint e (unflatten e ω) = OrderedProductCoupling.circleLeftEndpoint ω := by + change toCircle (OrderedProductCoupling.leftEndpoint (flatten e (unflatten e ω))) = _ + rw [flatten_unflatten] + rfl + +@[simp] theorem circleRightEndpoint_unflatten {m : ℕ → ℕ} + (e : ℕ ≃ Σ s, Fin (m s)) (ω : OrderedProductCoupling.Sample) : + circleRightEndpoint e (unflatten e ω) = OrderedProductCoupling.circleRightEndpoint ω := by + change toCircle (OrderedProductCoupling.rightEndpoint (flatten e (unflatten e ω))) = _ + rw [flatten_unflatten] + rfl + +theorem eventually_flatSourceEvent_mass {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) {r : ProductModel.Base → ℝ} (hr : Measurable r) + (hi : ∀ᵐ x ∂ProductModel.baseMeasure, 0 < r x ∧ r x < 1) : + ∀ᶠ j in atTop, Real.exp (-82) / 2 ≤ + (OrderedProductCoupling.law (OrderedProductCoupling.sourceBlocks p.m p.a p.b + hp.m_ge_100 (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j)).real + (flatSourceEvent p e r j) := by + filter_upwards [eventually_sourceEvent_mass hp e hr hi] with j hj + rwa [flatSourceEvent_mass_eq hp e hr j] + +theorem ae_flatSourceEvent_coefficient_properties {p : ProductScaleData} + (hp : ProductScaleLaws p) (e : ℕ ≃ Σ s, Fin (p.m s)) (θ : ℕ → ℝ) + (hphase : ∀ i, θ i ∈ Icc (1 / p.N (e i).1) (2 / p.N (e i).1)) + (P : ProjectionField) (hP : ∀ᵐ x ∂ProductModel.baseMeasure, IsStarProjection (P x)) (j : ℕ) : + ∀ᵐ ω ∂OrderedProductCoupling.law (OrderedProductCoupling.sourceBlocks p.m p.a p.b + hp.m_ge_100 (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j), + ω ∈ flatSourceEvent p e (projectionDiagonal P) j → + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖sourceCoefficientA p e θ P (unflatten e ω) v‖ ≤ p.coefficientBound j) ∧ + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖sourceCoefficientB p e θ P (unflatten e ω) v‖ ≤ p.coefficientBound j) ∧ + 1 / ((j + 1 : ℕ) : ℝ) ≤ ‖sourceCoefficientA p e θ P (unflatten e ω) 0‖ ∧ + 1 / ((j + 1 : ℕ) : ℝ) ≤ ‖sourceCoefficientB p e θ P (unflatten e ω) 0‖ := + (source_measurePreserving_unflatten hp e j).quasiMeasurePreserving.ae + (ae_sourceEvent_coefficient_properties hp e θ hphase P hP j) + +theorem ae_sourceEvent_tag_endpoints {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) + (he : ∀ a : Σ s, Fin (p.m s), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) + (r : ProductModel.Base → ℝ) (j : ℕ) : + ∀ᵐ z ∂sourceLaw p j, z ∈ sourceEvent p e r j → + ∃ k ∈ ProductPhases.consecutiveBlock p.m j, + circleRepresentative (circleLeftEndpoint e z k) < 1 / (p.m j : ℝ) ∧ + 1 - 1 / (p.m j : ℝ) ≤ circleRepresentative (circleRightEndpoint e z k) := by + have ht : ∀ᵐ z ∂sourceLaw p j, ∀ i : Fin (p.m j), + (z j i).1 = some (4 : Fin 5) → + (z j i).2.1 < 1 / (p.m j : ℝ) ∧ 1 - 1 / (p.m j : ℝ) ≤ (z j i).2.2 := by + apply ae_all_iff.mpr + intro i + have h := OneCoordinateCoupling.labelledLaw_ae_tag_interval + (ProductScaleData.kappa j) (p.m j) (p.a j) (p.b j) (if j = j then 1 else 0) + rw [← law_map_coordinate hp.m_ge_100 source_kappa_nonneg source_kappa_le + (fun s _ => (hp.a_bounds s).1) (fun s _ => (hp.a_bounds s).2) + (fun s _ => (hp.b_bounds s).1) (fun s _ => (hp.b_bounds s).2) j j i] at h + exact ae_of_ae_map (by fun_prop : Measurable (fun z : Sample p.m => z j i)).aemeasurable h + have hrep := ae_circle_representatives hp.m_ge_100 source_kappa_nonneg source_kappa_le + (fun s _ => (hp.a_bounds s).1) (fun s _ => (hp.a_bounds s).2) + (fun s _ => (hp.b_bounds s).1) (fun s _ => (hp.b_bounds s).2) e j + filter_upwards [ht, hrep] with z hz hr + intro hE + obtain ⟨i, hi⟩ := (mem_sourceRetainedEvent_iff.mp hE).1 + let k := e.symm ⟨j, i⟩ + have hk : k ∈ ProductPhases.consecutiveBlock p.m j := by + dsimp [k] + rw [he] + simp only [ProductPhases.consecutiveBlock, Finset.mem_Ico] + have := i.isLt + omega + have hcoord : flatten e z k = z j i := by + change (fun q : Σ s, Fin (p.m s) => z q.1 q.2) (e (e.symm ⟨j, i⟩)) = _ + rw [e.apply_symm_apply] + refine ⟨k, hk, ?_⟩ + rw [(hr k).1, (hr k).2] + change (flatten e z k).2.1 < _ ∧ _ ≤ (flatten e z k).2.2 + rw [hcoord] + exact hz i hi + +theorem ae_flatSourceEvent_tag_endpoints {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) + (he : ∀ a : Σ s, Fin (p.m s), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) + (r : ProductModel.Base → ℝ) (j : ℕ) : + ∀ᵐ ω ∂OrderedProductCoupling.law (OrderedProductCoupling.sourceBlocks p.m p.a p.b + hp.m_ge_100 (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j), + ω ∈ flatSourceEvent p e r j → + ∃ k ∈ ProductPhases.consecutiveBlock p.m j, + circleRepresentative (OrderedProductCoupling.circleLeftEndpoint ω k) < 1 / (p.m j : ℝ) ∧ + 1 - 1 / (p.m j : ℝ) ≤ circleRepresentative (OrderedProductCoupling.circleRightEndpoint ω k) := by + have h := (source_measurePreserving_unflatten hp e j).quasiMeasurePreserving.ae + (ae_sourceEvent_tag_endpoints hp e he r j) + simpa only [circleLeftEndpoint_unflatten, circleRightEndpoint_unflatten, + flatSourceEvent, mem_preimage] using h + +end Invariant233.BlockedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/BoundedLusinApproximation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/BoundedLusinApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..d69132e64cb5bc596382b28543f1702905bbe0fb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/BoundedLusinApproximation.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.IrrationalRotation.Analysis.IndividualLusin +import Mathlib.Topology.TietzeExtension +import Mathlib.MeasureTheory.OuterMeasure.BorelCantelli + +namespace OAI + +noncomputable section +open Set MeasureTheory Filter +open scoped ENNReal Topology + +namespace Invariant233.Lusin + +variable {X : Type*} [TopologicalSpace X] [MeasurableSpace X] + [BorelSpace X] [T2Space X] [CompactSpace X] [NormalSpace X] + (μ : Measure X) [IsFiniteMeasure μ] [Measure.InnerRegularCompactLTTop μ] + +theorem exists_bounded_continuous_eq_on_large_compact + {g : X → ℂ} (hg : Measurable g) {C : ℝ} (hC : 0 ≤ C) + (hb : ∀ x, ‖g x‖ ≤ C) {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ (a : C(X, ℂ)) (K : Set X), IsCompact K ∧ μ Kᶜ < ε ∧ + (∀ x, ‖a x‖ ≤ 2 * C) ∧ Set.EqOn a g K := by + obtain ⟨K, hK, hμK, hgK⟩ := exists_compact_continuousOn μ hg hε + let gre : C(K, ℝ) := ⟨fun x => (g x).re, Complex.continuous_re.comp hgK.domRestrict⟩ + let gim : C(K, ℝ) := ⟨fun x => (g x).im, Complex.continuous_im.comp hgK.domRestrict⟩ + have hre : ∀ x : K, gre x ∈ Icc (-C) C := by + intro x + exact abs_le.mp ((Complex.abs_re_le_norm (g x)).trans (hb x)) + have him : ∀ x : K, gim x ∈ Icc (-C) C := by + intro x + exact abs_le.mp ((Complex.abs_im_le_norm (g x)).trans (hb x)) + have hne : (Icc (-C) C).Nonempty := ⟨0, by constructor <;> linarith⟩ + obtain ⟨are, hare, heqre⟩ := gre.exists_restrict_eq_forall_mem_of_closed hre hne hK.isClosed + obtain ⟨aim, haim, heqim⟩ := gim.exists_restrict_eq_forall_mem_of_closed him hne hK.isClosed + let a : C(X, ℂ) := ⟨fun x => (are x : ℂ) + (aim x : ℂ) * Complex.I, by fun_prop⟩ + refine ⟨a, K, hK, hμK, ?_, ?_⟩ + · intro x + change ‖(are x : ℂ) + (aim x : ℂ) * Complex.I‖ ≤ 2 * C + calc + _ ≤ ‖(are x : ℂ)‖ + ‖(aim x : ℂ) * Complex.I‖ := norm_add_le _ _ + _ = |are x| + |aim x| := by simp + _ ≤ C + C := add_le_add (abs_le.mpr (hare x)) (abs_le.mpr (haim x)) + _ = 2 * C := by ring + · intro x hx + have hr := DFunLike.congr_fun heqre ⟨x, hx⟩ + have hi := DFunLike.congr_fun heqim ⟨x, hx⟩ + change are x = (g x).re at hr + change aim x = (g x).im at hi + change (are x : ℂ) + (aim x : ℂ) * Complex.I = g x + rw [hr, hi, Complex.re_add_im] + +theorem exists_bounded_continuous_eventuallyEq + {g : X → ℂ} (hg : Measurable g) {C : ℝ} (hC : 0 ≤ C) + (hb : ∀ x, ‖g x‖ ≤ C) : + ∃ a : ℕ → C(X, ℂ), (∀ n x, ‖a n x‖ ≤ 2 * C) ∧ + ∀ᵐ x ∂μ, ∀ᶠ n in atTop, a n x = g x := by + obtain ⟨δ, hδpos, hδsum⟩ := ENNReal.exists_pos_sum_of_countable' (by simp : (1 : ℝ≥0∞) ≠ 0) ℕ + choose a K hK hμK hbA heq using + (fun n => exists_bounded_continuous_eq_on_large_compact μ hg hC hb (hδpos n).ne') + have hsum : (∑' n, μ (K n)ᶜ) ≠ ∞ := by + apply ne_of_lt + calc + _ ≤ ∑' n, δ n := ENNReal.tsum_le_tsum fun n => (hμK n).le + _ < 1 := hδsum + _ < ∞ := by simp + refine ⟨a, hbA, ?_⟩ + filter_upwards [ae_eventually_notMem hsum] with x hx + filter_upwards [hx] with n hn + exact heq n (by simpa using hn) + +end Invariant233.Lusin + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/CappedRatios.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/CappedRatios.lean new file mode 100644 index 0000000000000000000000000000000000000000..9887e045c7f2d69c5530b4fef1951c0add72a394 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/CappedRatios.lean @@ -0,0 +1,40 @@ +import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic +import Mathlib.Topology.Order.Lattice + +namespace OAI + +namespace Invariant233 + +variable {X : Type*} + +theorem norm_capped_ratio_le {B a b : ℝ} + (hB : 0 ≤ B) (ha : 0 ≤ a) (hb : 0 ≤ b) : + ‖(Complex.ofReal (min B (a / b)))‖ ≤ B := by + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (le_min hB (div_nonneg ha hb))] + exact min_le_left _ _ + +theorem capped_ratio_eq_of_le {B a b : ℝ} (h : a / b ≤ B) : + (Complex.ofReal (min B (a / b))) = (a / b : ℝ) := by + rw [min_eq_right h] + +theorem measurable_capped_ratio [MeasurableSpace X] + (F : X → ℝ) (hF : Measurable F) (B : ℝ) : + Measurable (fun t : X × X => (Complex.ofReal (min B (F t.2 / F t.1)))) := + Complex.measurable_ofReal.comp + (measurable_const.min ((hF.comp measurable_snd).div (hF.comp measurable_fst))) + +theorem continuousOn_capped_ratio [TopologicalSpace X] + (F : X → ℝ) (Q : Set X) (hF : ContinuousOn F Q) + (hFp : ∀ x ∈ Q, F x ≠ 0) (B : ℝ) : + ContinuousOn (fun t : X × X => (Complex.ofReal (min B (F t.2 / F t.1)))) (Q ×ˢ Q) := by + have hfst : ContinuousOn (fun t : X × X => F t.1) (Q ×ˢ Q) := + hF.comp continuous_fst.continuousOn (fun _ ht => ht.1) + have hsnd : ContinuousOn (fun t : X × X => F t.2) (Q ×ˢ Q) := + hF.comp continuous_snd.continuousOn (fun _ ht => ht.2) + have hratio : ContinuousOn (fun t : X × X => F t.2 / F t.1) (Q ×ˢ Q) := + hsnd.div hfst (fun t ht => hFp t.1 ht.1) + exact Complex.continuous_ofReal.comp_continuousOn (continuousOn_const.inf hratio) + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ChoKoLeeComparison.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ChoKoLeeComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..6720a276ac7c03159f7d5fb41cea861b612fb3fc --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ChoKoLeeComparison.lean @@ -0,0 +1,47 @@ +import OAI.Analysis.IrrationalRotation.Operators.ConjugationDefect +import OAI.Analysis.IrrationalRotation.Operators.CommutantAlgebra + +namespace OAI + +noncomputable section +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem cho_ko_lee_comparison_of_witness (Q : H →L[ℂ] H) + (hne : Q ≠ 0) (hQ : NormQuasinilpotent Q) + (hhyper : HasNoNontrivialHyperinvariantSubspace Q) : + Q ≠ 0 ∧ NormQuasinilpotent Q ∧ + ∀ C : HilbertConjugation H, + IsInfiniteConjugationIsometry C (1 + Q) ∧ + operatorCommutant (1 + Q) = operatorCommutant Q ∧ + HasNoNontrivialHyperinvariantSubspace (1 + Q) := by + refine ⟨hne, hQ, fun C => ?_⟩ + exact ⟨isInfiniteConjugationIsometry_one_add C hQ, + operatorCommutant_one_add Q, + (hasNoNontrivialHyperinvariantSubspace_one_add_iff Q).2 hhyper⟩ + +theorem isInfiniteConjugationIsometry_one_add_of_isConjugation + {C : H → H} (hC : IsConjugation C) {Q : H →L[ℂ] H} + (hQ : NormQuasinilpotent Q) : + IsInfiniteConjugationIsometry hC.toHilbertConjugation (1 + Q) := + isInfiniteConjugationIsometry_one_add hC.toHilbertConjugation hQ + +omit [CompleteSpace H] in +theorem cho_ko_lee_comparison_of_exists [CompleteSpace H] + (hex : ∃ Q : H →L[ℂ] H, Q ≠ 0 ∧ NormQuasinilpotent Q ∧ + HasNoNontrivialHyperinvariantSubspace Q) : + ∃ Q : H →L[ℂ] H, Q ≠ 0 ∧ NormQuasinilpotent Q ∧ + HasNoNontrivialHyperinvariantSubspace Q ∧ + operatorCommutant (1 + Q) = operatorCommutant Q ∧ + ∀ C : H → H, IsConjugation C → + HasNoNontrivialHyperinvariantSubspace (1 + Q) := by + obtain ⟨Q, hne, hQ, hhyper⟩ := hex + exact ⟨Q, hne, hQ, hhyper, operatorCommutant_one_add Q, + fun _ _ => (hasNoNontrivialHyperinvariantSubspace_one_add_iff Q).2 hhyper⟩ + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ChoKoLeeCompleteComparison.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ChoKoLeeCompleteComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..31b97e40001f7e9d4eca88eb668f4c15882ad698 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ChoKoLeeCompleteComparison.lean @@ -0,0 +1,39 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ChoKoLeeComparison +import OAI.Analysis.IrrationalRotation.Operators.HilbertConjugationExistence + +namespace OAI + +noncomputable section +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem cho_ko_lee_complete_comparison_of_exists + (hex : ∃ Q : H →L[ℂ] H, Q ≠ 0 ∧ NormQuasinilpotent Q ∧ + HasNoNontrivialHyperinvariantSubspace Q) : + ∃ Q : H →L[ℂ] H, Q ≠ 0 ∧ NormQuasinilpotent Q ∧ + HasNoNontrivialHyperinvariantSubspace Q ∧ + operatorCommutant (1 + Q) = operatorCommutant Q ∧ + ∀ C : H → H, ∀ hC : IsConjugation C, + IsInfiniteConjugationIsometry hC.toHilbertConjugation (1 + Q) ∧ + HasNoNontrivialHyperinvariantSubspace (1 + Q) := by + obtain ⟨Q, hne, hQ, hhyper⟩ := hex + refine ⟨Q, hne, hQ, hhyper, operatorCommutant_one_add Q, fun C hC => ?_⟩ + exact ⟨isInfiniteConjugationIsometry_one_add_of_isConjugation hC hQ, + (hasNoNontrivialHyperinvariantSubspace_one_add_iff Q).2 hhyper⟩ + +theorem exists_conjugation_comparison_of_witness + {Q : H →L[ℂ] H} (hQ : NormQuasinilpotent Q) + (hhyper : HasNoNontrivialHyperinvariantSubspace Q) : + ∃ (C : H → H) (hC : IsConjugation C), + IsInfiniteConjugationIsometry hC.toHilbertConjugation (1 + Q) ∧ + HasNoNontrivialHyperinvariantSubspace (1 + Q) := by + obtain ⟨C, hC⟩ := exists_isConjugation (H := H) + exact ⟨C, hC, isInfiniteConjugationIsometry_one_add_of_isConjugation hC hQ, + (hasNoNontrivialHyperinvariantSubspace_one_add_iff Q).2 hhyper⟩ + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ClosedRangeTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ClosedRangeTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..e1ca53e2f4858808385ab58cc153196116bda515 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ClosedRangeTransport.lean @@ -0,0 +1,191 @@ +import Mathlib.Analysis.VonNeumannAlgebra.Basic +import Mathlib.Analysis.InnerProductSpace.Projection.Basic +import Mathlib.Analysis.Normed.Operator.Banach + +namespace OAI + +noncomputable section +open scoped NNReal + +namespace InvariantRotation.ClosedRangeTransport + +variable {𝕜 E : Type*} [RCLike 𝕜] +variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [CompleteSpace E] +variable (p : Submodule 𝕜 E) [CompleteSpace p] +variable (f : p →L[𝕜] E) (hinj : Function.Injective f) +variable (hclosed : IsClosed (Set.range f)) + +omit [CompleteSpace p] in + +private theorem range_hasOrthogonalProjection (hclosed : IsClosed (Set.range f)) : + f.range.HasOrthogonalProjection := by + let : IsClosed (f.range : Set E) := hclosed + infer_instance + +def partialInverse : E →L[𝕜] E := by + letI := range_hasOrthogonalProjection p f hclosed + exact p.subtypeL.comp + ((f.equivRange hinj hclosed).symm.toContinuousLinearMap.comp + f.range.orthogonalProjectionOnto) + +def forward : E →L[𝕜] E := + f.comp p.orthogonalProjectionOnto + +@[simp] +theorem partialInverse_apply_image (x : p) : + partialInverse p f hinj hclosed (f x) = (x : E) := by + let := range_hasOrthogonalProjection p f hclosed + change (((f.equivRange hinj hclosed).symm + (f.range.orthogonalProjectionOnto (f x)) : p) : E) = x + have hproj : f.range.orthogonalProjectionOnto (f x) = ⟨f x, f.mem_range_self x⟩ := + f.range.orthogonalProjectionOnto_mem_subspace_eq_self ⟨f x, f.mem_range_self x⟩ + rw [hproj, f.equivRange_symm_apply hinj hclosed x] + +theorem partialInverse_comp_forward : + (partialInverse p f hinj hclosed).comp (forward p f) = p.starProjection := by + ext x + exact partialInverse_apply_image p f hinj hclosed (p.orthogonalProjectionOnto x) + +theorem forward_comp_partialInverse : + letI := range_hasOrthogonalProjection p f hclosed + (forward p f).comp (partialInverse p f hinj hclosed) = f.range.starProjection := by + let := range_hasOrthogonalProjection p f hclosed + ext x + change f (p.orthogonalProjectionOnto + (((f.equivRange hinj hclosed).symm (f.range.orthogonalProjectionOnto x) : p) : E)) = _ + rw [p.orthogonalProjectionOnto_mem_subspace_eq_self] + have h := (f.equivRange hinj hclosed).apply_symm_apply + (f.range.orthogonalProjectionOnto x) + exact congrArg (fun z : f.range => (z : E)) h + +theorem functional_eq_of_cyclic (τ : (E →L[𝕜] E) → 𝕜) + (hτ : τ ((partialInverse p f hinj hclosed).comp (forward p f)) = + τ ((forward p f).comp (partialInverse p f hinj hclosed))) : + letI := range_hasOrthogonalProjection p f hclosed + τ p.starProjection = τ f.range.starProjection := by + let := range_hasOrthogonalProjection p f hclosed + rw [partialInverse_comp_forward, forward_comp_partialInverse] at hτ + exact hτ + +omit [CompleteSpace E] in + +theorem range_forward : (forward p f).range = f.range := by + ext y + constructor + · rintro ⟨x, rfl⟩ + exact ⟨p.orthogonalProjectionOnto x, rfl⟩ + · rintro ⟨x, rfl⟩ + refine ⟨x, ?_⟩ + change f (p.orthogonalProjectionOnto x) = f x + rw [p.orthogonalProjectionOnto_mem_subspace_eq_self] + +theorem partialInverse_mem (x : E) : partialInverse p f hinj hclosed x ∈ p := by + let := range_hasOrthogonalProjection p f hclosed + exact ((f.equivRange hinj hclosed).symm (f.range.orthogonalProjectionOnto x)).property + +theorem projection_comp_partialInverse : + p.starProjection.comp (partialInverse p f hinj hclosed) = + partialInverse p f hinj hclosed := by + ext x + exact Submodule.starProjection_eq_self_iff.mpr + (partialInverse_mem p f hinj hclosed x) + +section Algebra + +variable {R : Type*} [Monoid R] + +theorem commute_partialInverse {a b p q w : R} + (hba : b * a = p) (hab : a * b = q) (hpb : p * b = b) + (hwa : Commute w a) (hwp : Commute w p) (hwq : Commute w q) : + Commute w b := by + have hbq : b * q = b := by rw [← hab, ← mul_assoc, hba, hpb] + change w * b = b * w + calc + w * b = w * (p * b) := by rw [hpb] + _ = (w * p) * b := (mul_assoc _ _ _).symm + _ = (p * w) * b := by rw [hwp.eq] + _ = ((b * a) * w) * b := by rw [hba] + _ = (b * (a * w)) * b := by rw [mul_assoc b a w] + _ = (b * (w * a)) * b := by rw [hwa.eq] + _ = (b * w) * (a * b) := by simp only [mul_assoc] + _ = (b * w) * q := by rw [hab] + _ = b * (w * q) := mul_assoc _ _ _ + _ = b * (q * w) := by rw [hwq.eq] + _ = (b * q) * w := (mul_assoc _ _ _).symm + _ = b * w := by rw [hbq] + +end Algebra + +section VonNeumann + +variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℂ F] [CompleteSpace F] + +theorem range_projection_mem (M : VonNeumannAlgebra F) (a : F →L[ℂ] F) + (ha : a ∈ M) (hc : IsClosed (Set.range a)) : + letI : IsClosed (a.range : Set F) := hc + a.range.starProjection ∈ M := by + let : IsClosed (a.range : Set F) := hc + apply (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mpr + intro w hw + rw [Submodule.range_starProjection] + apply (Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mpr + rintro y ⟨x, rfl⟩ + refine ⟨w x, ?_⟩ + exact congrArg (fun v : F →L[ℂ] F => v x) + ((VonNeumannAlgebra.mem_commutant_iff.mp hw) a ha) + +theorem partialInverse_mem_algebra + (M : VonNeumannAlgebra F) (p : Submodule ℂ F) [CompleteSpace p] + (f : p →L[ℂ] F) (hinj : Function.Injective f) + (hc : IsClosed (Set.range f)) + (hp : p.starProjection ∈ M) (hf : forward p f ∈ M) : + partialInverse p f hinj hc ∈ M := by + let := range_hasOrthogonalProjection p f hc + have hfc : IsClosed (Set.range (forward p f)) := by + change IsClosed ((forward p f).range : Set F) + rw [range_forward] + exact hc + have hr : f.range.starProjection ∈ M := by + have hr' := range_projection_mem M (forward p f) hf hfc + simpa only [range_forward] using hr' + rw [← M.commutant_commutant] + apply VonNeumannAlgebra.mem_commutant_iff.mpr + intro w hw + exact (commute_partialInverse + (a := forward p f) (b := partialInverse p f hinj hc) + (p := p.starProjection) (q := f.range.starProjection) + (partialInverse_comp_forward p f hinj hc) + (forward_comp_partialInverse p f hinj hc) + (projection_comp_partialInverse p f hinj hc) + ((VonNeumannAlgebra.mem_commutant_iff.mp hw) _ hf).symm + ((VonNeumannAlgebra.mem_commutant_iff.mp hw) _ hp).symm + ((VonNeumannAlgebra.mem_commutant_iff.mp hw) _ hr).symm).eq + +theorem trace_range_eq + (M : VonNeumannAlgebra F) (p : Submodule ℂ F) [CompleteSpace p] + (f : p →L[ℂ] F) (hinj : Function.Injective f) + (hc : IsClosed (Set.range f)) + (hp : p.starProjection ∈ M) (hf : forward p f ∈ M) + (τ : (F →L[ℂ] F) → ℂ) + (hτ : ∀ a ∈ M, ∀ b ∈ M, τ (a * b) = τ (b * a)) : + letI := range_hasOrthogonalProjection p f hc + τ p.starProjection = τ f.range.starProjection := by + apply functional_eq_of_cyclic p f hinj hc τ + exact hτ _ (partialInverse_mem_algebra M p f hinj hc hp hf) _ hf + +end VonNeumann + +omit [CompleteSpace E] in + +theorem injective_closedRange_of_bound (K : ℝ≥0) + (hbound : ∀ x : p, ‖x‖ ≤ K * ‖f x‖) : + Function.Injective f ∧ IsClosed (Set.range f) := by + have hanti := f.antilipschitz_of_bound hbound + exact ⟨hanti.injective, hanti.isClosed_range f.uniformContinuous⟩ + +end InvariantRotation.ClosedRangeTransport + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/CompactTransfer.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/CompactTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf8f2cfcaf606bcd0311d80ca9b3abf7d60017fb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/CompactTransfer.lean @@ -0,0 +1,92 @@ +import Mathlib.MeasureTheory.Measure.Portmanteau +import Mathlib.Topology.Algebra.Order.LiminfLimsup +import OAI.Analysis.IrrationalRotation.Analysis.LusinCompact + +namespace OAI + +open Set MeasureTheory Filter +open scoped Topology ENNReal NNReal + +namespace Invariant233.CompactTransfer + +theorem measure_compl_le_of_tendsto {X ι : Type*} + [MeasurableSpace X] [TopologicalSpace X] [OpensMeasurableSpace X] + [HasOuterApproxClosed X] {L : Filter ι} [L.NeBot] + {ν : FiniteMeasure X} {νs : ι → FiniteMeasure X} + (hν : Tendsto νs L (𝓝 ν)) {K : Set X} (hK : IsClosed K) + {ε : ℝ≥0∞} (hbound : ∀ᶠ i in L, (νs i : Measure X) Kᶜ ≤ ε) : + (ν : Measure X) Kᶜ ≤ ε := by + have hmass : Tendsto (fun i => (νs i : Measure X) Set.univ) L + (𝓝 ((ν : Measure X) Set.univ)) := by + simpa only [← FiniteMeasure.ennreal_mass, Function.comp_def] using + ENNReal.continuous_coe.continuousAt.tendsto.comp hν.mass + have hparts : ∀ᶠ i in L, + (νs i : Measure X) Set.univ ≤ (νs i : Measure X) K + ε := by + filter_upwards [hbound] with i hi + rw [← measure_add_measure_compl hK.measurableSet] + exact add_le_add le_rfl hi + have hlim := Filter.limsup_le_limsup hparts + rw [hmass.limsup_eq, + limsup_add_const L (fun i => (νs i : Measure X) K) ε + (by isBoundedDefault) (by isBoundedDefault)] at hlim + have htotal := hlim.trans (add_le_add + (FiniteMeasure.limsup_measure_closed_le_of_tendsto hν hK) le_rfl) + rw [measure_compl hK.measurableSet (measure_ne_top _ _), tsub_le_iff_right] + simpa only [add_comm] using htotal + +theorem ae_mem_of_closed_approximation {X ι : Type*} + [MeasurableSpace X] [TopologicalSpace X] [OpensMeasurableSpace X] + [HasOuterApproxClosed X] {L : Filter ι} [L.NeBot] + {ν : FiniteMeasure X} {νs : ι → FiniteMeasure X} + (hν : Tendsto νs L (𝓝 ν)) {S : Set X} + (happrox : ∀ ε : ℝ≥0, 0 < ε → ∃ K : Set X, + IsClosed K ∧ K ⊆ S ∧ ∀ᶠ i in L, (νs i : Measure X) Kᶜ ≤ ε) : + ∀ᵐ x ∂(ν : Measure X), x ∈ S := by + apply ae_iff.mpr + change (ν : Measure X) Sᶜ = 0 + apply le_antisymm ?_ bot_le + apply ENNReal.le_of_forall_pos_le_add + intro ε hε _ + obtain ⟨K, hK, hKS, hbound⟩ := happrox ε hε + simpa using + (measure_mono (Set.compl_subset_compl.mpr hKS)).trans + (measure_compl_le_of_tendsto hν hK hbound) + +theorem ae_relation_of_uniform_marginals {X ι κ : Type*} {Y : κ → Type*} + [TopologicalSpace X] [PolishSpace X] [MeasurableSpace X] [BorelSpace X] + [Countable κ] [∀ k, TopologicalSpace (Y k)] + [∀ k, SecondCountableTopology (Y k)] + [∀ k, MeasurableSpace (Y k)] [∀ k, OpensMeasurableSpace (Y k)] + (μ : Measure X) [IsFiniteMeasure μ] + {f : ∀ k, X → Y k} (hf : ∀ k, Measurable (f k)) + {L : Filter ι} [L.NeBot] {ν : FiniteMeasure (X × X)} + {νs : ι → FiniteMeasure (X × X)} (hν : Tendsto νs L (𝓝 ν)) + {S : Set (X × X)} + (hclosed : ∀ K : Set X, IsCompact K → + (∀ k, ContinuousOn (f k) K) → IsClosed ((K ×ˢ K) ∩ S)) + (hsmall : ∀ ε : ℝ≥0, 0 < ε → ∃ δ : ℝ≥0∞, δ ≠ 0 ∧ + ∀ A : Set X, MeasurableSet A → μ A < δ → ∀ i, + (νs i : Measure (X × X)) (A ×ˢ Set.univ) + + (νs i : Measure (X × X)) (Set.univ ×ˢ A) ≤ ε) + (hS : ∀ i, ∀ᵐ z ∂(νs i : Measure (X × X)), z ∈ S) : + ∀ᵐ z ∂(ν : Measure (X × X)), z ∈ S := by + apply ae_mem_of_closed_approximation hν + intro ε hε + obtain ⟨δ, hδ, hδsmall⟩ := hsmall ε hε + obtain ⟨K, hK, hμK, hcont⟩ := exists_isCompact_forall_continuousOn μ hf hδ + refine ⟨(K ×ˢ K) ∩ S, hclosed K hK hcont, Set.inter_subset_right, + Filter.Eventually.of_forall ?_⟩ + intro i + have hsub : ∀ᵐ z ∂(νs i : Measure (X × X)), + z ∈ ((K ×ˢ K) ∩ S)ᶜ → z ∈ (K ×ˢ K)ᶜ := by + filter_upwards [hS i] with z hz + intro hzbad hzK + exact hzbad ⟨hzK, hz⟩ + apply (measure_mono_ae hsub).trans + rw [Set.compl_prod_eq_union] + exact (measure_union_le _ _).trans + (hδsmall Kᶜ hK.isClosed.measurableSet.compl hμK i) + +end Invariant233.CompactTransfer + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualComplete.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualComplete.lean new file mode 100644 index 0000000000000000000000000000000000000000..64a1123c52063ffd7f59823c64b17a1442c60e73 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualComplete.lean @@ -0,0 +1,39 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ConcretePredualRepresentation +import OAI.Analysis.IrrationalRotation.Analysis.ConcretePredualEvaluation +import OAI.Analysis.IrrationalRotation.Analysis.ConcretePredualSeparable + +namespace OAI + +noncomputable section +namespace Invariant233.ConcretePredual + +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +local instance completedPredualNormedAddCommGroup (M : VonNeumannAlgebra H) : + NormedAddCommGroup (predual M) := (predual M).normedAddCommGroup +local instance completedPredualNormedSpace (M : VonNeumannAlgebra H) : + NormedSpace ℂ (predual M) := (predual M).normedSpace + +def evaluationLinearIsometryEquiv (M : VonNeumannAlgebra H) : + M ≃ₗᵢ[ℂ] StrongDual ℂ (predual M) := + LinearIsometryEquiv.ofSurjective (evaluationLinearIsometry M) + (evaluation_surjective M) + +@[simp] +theorem evaluationLinearIsometryEquiv_apply (M : VonNeumannAlgebra H) (A : M) : + evaluationLinearIsometryEquiv M A = evaluation M A := rfl + +theorem hasSeparablePredual (M : VonNeumannAlgebra H) + [TopologicalSpace.SeparableSpace H] : HasSeparablePredual M := by + let : CompleteSpace (predual M) := by + unfold predual + infer_instance + exact ⟨predual M, inferInstance, inferInstance, inferInstance, inferInstance, + ⟨(evaluationLinearIsometryEquiv M).symm⟩⟩ + +end Invariant233.ConcretePredual + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualCore.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..4155faffb5d313e81dac27bc1b85674a5a5a0165 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualCore.lean @@ -0,0 +1,46 @@ +import OAI.Analysis.IrrationalRotation.Model.VectorTraceState +import Mathlib.Analysis.InnerProductSpace.Dual +import Mathlib.Topology.Algebra.Module.Basic + +namespace OAI + +noncomputable section +namespace Invariant233.ConcretePredual + +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +def vectorFunctional (M : VonNeumannAlgebra H) (x y : H) : StrongDual ℂ M := + ((innerSL ℂ x).comp ((ContinuousLinearMap.apply ℂ H) y)).comp + M.toSubalgebra.toSubmodule.subtypeL + +@[simp] theorem vectorFunctional_apply (M : VonNeumannAlgebra H) (x y : H) (A : M) : + vectorFunctional M x y A = inner ℂ x ((A : H →L[ℂ] H) y) := rfl + +def predual (M : VonNeumannAlgebra H) : Submodule ℂ (StrongDual ℂ M) := + (Submodule.span ℂ (Set.range (fun xy : H × H => vectorFunctional M xy.1 xy.2))).topologicalClosure + +theorem vectorFunctional_mem (M : VonNeumannAlgebra H) (x y : H) : + vectorFunctional M x y ∈ predual M := + Submodule.le_topologicalClosure _ (Submodule.subset_span ⟨(x, y), rfl⟩) + +def vector (M : VonNeumannAlgebra H) (x y : H) : predual M := + ⟨vectorFunctional M x y, vectorFunctional_mem M x y⟩ + +@[simp] theorem vector_coe (M : VonNeumannAlgebra H) (x y : H) : + (vector M x y : StrongDual ℂ M) = vectorFunctional M x y := rfl + +def evaluation (M : VonNeumannAlgebra H) (A : M) : StrongDual ℂ (predual M) := + ((ContinuousLinearMap.apply ℂ ℂ) A).comp (predual M).subtypeL + +@[simp] theorem evaluation_apply (M : VonNeumannAlgebra H) (A : M) (f : predual M) : + evaluation M A f = (f : StrongDual ℂ M) A := rfl + +@[simp] theorem evaluation_vector (M : VonNeumannAlgebra H) (A : M) (x y : H) : + evaluation M A (vector M x y) = inner ℂ x ((A : H →L[ℂ] H) y) := rfl + +end Invariant233.ConcretePredual + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualEvaluation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..e3507aaa9c20892f2e060107d414907be606aa79 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualEvaluation.lean @@ -0,0 +1,81 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ConcretePredualCore +import Mathlib.Analysis.InnerProductSpace.LinearMap + +namespace OAI + +noncomputable section +namespace Invariant233.ConcretePredual + +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +local instance evaluationPredualNormedAddCommGroup (M : VonNeumannAlgebra H) : NormedAddCommGroup (predual M) := + (predual M).normedAddCommGroup +local instance evaluationPredualNormedSpace (M : VonNeumannAlgebra H) : NormedSpace ℂ (predual M) := + (predual M).normedSpace + +private theorem vector_norm_bound (M : VonNeumannAlgebra H) (x y : H) : + ‖vector M x y‖ ≤ ‖x‖ * ‖y‖ := by + change ‖vectorFunctional M x y‖ ≤ ‖x‖ * ‖y‖ + apply ContinuousLinearMap.opNorm_le_bound _ (mul_nonneg (norm_nonneg _) (norm_nonneg _)) + intro A + change ‖inner ℂ x ((A : H →L[ℂ] H) y)‖ ≤ (‖x‖ * ‖y‖) * ‖A‖ + calc + ‖inner ℂ x ((A : H →L[ℂ] H) y)‖ ≤ ‖x‖ * ‖(A : H →L[ℂ] H) y‖ := + norm_inner_le_norm _ _ + _ ≤ ‖x‖ * (‖(A : H →L[ℂ] H)‖ * ‖y‖) := + mul_le_mul_of_nonneg_left ((A : H →L[ℂ] H).le_opNorm y) (norm_nonneg _) + _ = (‖x‖ * ‖y‖) * ‖A‖ := by change _ = (‖x‖ * ‖y‖) * ‖(A : H →L[ℂ] H)‖; ring + +theorem norm_evaluation_le (M : VonNeumannAlgebra H) (A : M) : + ‖evaluation M A‖ ≤ ‖A‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) + intro f + calc + ‖evaluation M A f‖ ≤ ‖(f : StrongDual ℂ M)‖ * ‖A‖ := + (f : StrongDual ℂ M).le_opNorm A + _ = ‖A‖ * ‖f‖ := mul_comm _ _ + +theorem norm_le_evaluation (M : VonNeumannAlgebra H) (A : M) : + ‖A‖ ≤ ‖evaluation M A‖ := by + change ‖(A : H →L[ℂ] H)‖ ≤ ‖evaluation M A‖ + apply ContinuousLinearMap.opNorm_le_of_re_inner_le (norm_nonneg _) + intro x y hx hy + calc + (inner ℂ ((A : H →L[ℂ] H) x) y).re = + (inner ℂ y ((A : H →L[ℂ] H) x)).re := inner_re_symm (𝕜 := ℂ) _ _ + _ ≤ ‖inner ℂ y ((A : H →L[ℂ] H) x)‖ := Complex.re_le_norm _ + _ = ‖evaluation M A (vector M y x)‖ := rfl + _ ≤ ‖evaluation M A‖ * ‖vector M y x‖ := + (evaluation M A).le_opNorm _ + _ ≤ ‖evaluation M A‖ * (‖y‖ * ‖x‖) := + mul_le_mul_of_nonneg_left (vector_norm_bound M y x) (norm_nonneg _) + _ = ‖evaluation M A‖ := by rw [hy, hx]; ring + +@[simp] theorem norm_evaluation (M : VonNeumannAlgebra H) (A : M) : + ‖evaluation M A‖ = ‖A‖ := + le_antisymm (norm_evaluation_le M A) (norm_le_evaluation M A) + +def evaluationLinearIsometry (M : VonNeumannAlgebra H) : + M →ₗᵢ[ℂ] StrongDual ℂ (predual M) where + toFun := evaluation M + map_add' A B := by + ext f + exact (f : StrongDual ℂ M).map_add A B + map_smul' c A := by + ext f + exact (f : StrongDual ℂ M).map_smul c A + norm_map' := norm_evaluation M + +@[simp] theorem evaluationLinearIsometry_apply (M : VonNeumannAlgebra H) (A : M) : + evaluationLinearIsometry M A = evaluation M A := rfl + +theorem evaluation_injective (M : VonNeumannAlgebra H) : + Function.Injective (evaluation M) := + (evaluationLinearIsometry M).injective + +end Invariant233.ConcretePredual + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualModels.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualModels.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e03ef740cc62cb9a848abe51927fa17a38d72b2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualModels.lean @@ -0,0 +1,22 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ConcretePredualComplete +import OAI.Analysis.IrrationalRotation.Rotation.RotationHilbert +import OAI.Analysis.IrrationalRotation.Product.ProductHilbert + +namespace OAI + +noncomputable section +namespace Invariant233 + +theorem Rotation.algebra_hasSeparablePredual (θ : ℝ) : + HasSeparablePredual (Rotation.algebra θ) := + ConcretePredual.hasSeparablePredual _ + +theorem ProductModel.factor_hasSeparablePredual (θ : ℕ → ℝ) : + HasSeparablePredual (ProductModel.factor θ) := + ConcretePredual.hasSeparablePredual _ + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualRepresentation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualRepresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ebe6be9930eafff74f409245c6b3b39e9324bc1 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualRepresentation.lean @@ -0,0 +1,119 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ConcretePredualCore +import Mathlib.Analysis.Normed.Module.HahnBanach +import Mathlib.Analysis.Normed.Module.DoubleDual + +namespace OAI + +noncomputable section +namespace Invariant233.ConcretePredual + +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +@[simp] theorem vectorFunctional_add_left (M : VonNeumannAlgebra H) (x z y : H) : + vectorFunctional M (x + z) y = vectorFunctional M x y + vectorFunctional M z y := by + ext A + simp + +@[simp] theorem vectorFunctional_add_right (M : VonNeumannAlgebra H) (x y z : H) : + vectorFunctional M x (y + z) = vectorFunctional M x y + vectorFunctional M x z := by + ext A + simp + +@[simp] theorem vectorFunctional_smul_left (M : VonNeumannAlgebra H) (c : ℂ) (x y : H) : + vectorFunctional M (c • x) y = star c • vectorFunctional M x y := by + ext A + simp [mul_comm] + +@[simp] theorem vectorFunctional_smul_right (M : VonNeumannAlgebra H) (c : ℂ) (x y : H) : + vectorFunctional M x (c • y) = c • vectorFunctional M x y := by + ext A + simp + +theorem norm_vectorFunctional_le (M : VonNeumannAlgebra H) (x y : H) : + ‖vectorFunctional M x y‖ ≤ ‖x‖ * ‖y‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (mul_nonneg (norm_nonneg _) (norm_nonneg _)) + intro A + calc + ‖vectorFunctional M x y A‖ ≤ ‖x‖ * ‖(A : H →L[ℂ] H) y‖ := norm_inner_le_norm _ _ + _ ≤ ‖x‖ * (‖A‖ * ‖y‖) := + mul_le_mul_of_nonneg_left ((A : H →L[ℂ] H).le_opNorm y) (norm_nonneg _) + _ = (‖x‖ * ‖y‖) * ‖A‖ := by ring + +def representingForm (M : VonNeumannAlgebra H) + (Φ : StrongDual ℂ (StrongDual ℂ M)) : H →L⋆[ℂ] H →L[ℂ] ℂ := + LinearMap.mkContinuous₂ + { toFun := fun x => + { toFun := fun y => Φ (vectorFunctional M x y) + map_add' := by intro y z; simp + map_smul' := by intro c y; simp } + map_add' := by intro x z; ext y; simp + map_smul' := by intro c x; ext y; simp } ‖Φ‖ + (by + intro x y + exact (Φ.le_opNorm _).trans (by + calc + ‖Φ‖ * ‖vectorFunctional M x y‖ ≤ ‖Φ‖ * (‖x‖ * ‖y‖) := + mul_le_mul_of_nonneg_left (norm_vectorFunctional_le M x y) (norm_nonneg Φ) + _ = ‖Φ‖ * ‖x‖ * ‖y‖ := by ring)) + +def representingOperator (M : VonNeumannAlgebra H) + (Φ : StrongDual ℂ (StrongDual ℂ M)) : H →L[ℂ] H := + (InnerProductSpace.continuousLinearMapOfBilin (representingForm M Φ)).adjoint + +@[simp] theorem inner_representingOperator (M : VonNeumannAlgebra H) + (Φ : StrongDual ℂ (StrongDual ℂ M)) (x y : H) : + inner ℂ x (representingOperator M Φ y) = Φ (vectorFunctional M x y) := by + rw [representingOperator, ContinuousLinearMap.adjoint_inner_right, + InnerProductSpace.continuousLinearMapOfBilin_apply] + rfl + +theorem representingOperator_mem (M : VonNeumannAlgebra H) + (Φ : StrongDual ℂ (StrongDual ℂ M)) : representingOperator M Φ ∈ M := by + have hmem : representingOperator M Φ ∈ M.commutant.commutant := by + rw [VonNeumannAlgebra.mem_commutant_iff] + intro B hB + ext y + apply ext_inner_left ℂ + intro x + change inner ℂ x (B (representingOperator M Φ y)) = + inner ℂ x (representingOperator M Φ (B y)) + rw [← ContinuousLinearMap.adjoint_inner_left B (representingOperator M Φ y) x, + inner_representingOperator, inner_representingOperator] + congr 1 + ext A + rw [vectorFunctional_apply, vectorFunctional_apply, + ContinuousLinearMap.adjoint_inner_left] + congr 1 + exact congrArg (fun Q : H →L[ℂ] H => Q y) + ((VonNeumannAlgebra.mem_commutant_iff.mp hB) A A.property).symm + simpa only [M.commutant_commutant] using hmem + +theorem evaluation_surjective (M : VonNeumannAlgebra H) : + Function.Surjective (evaluation M) := by + intro ℓ + obtain ⟨Φ, hΦ, _hΦnorm⟩ := exists_extension_norm_eq (predual M) ℓ + let A : M := ⟨representingOperator M Φ, representingOperator_mem M Φ⟩ + let Ψ : StrongDual ℂ (StrongDual ℂ M) := + Φ - NormedSpace.inclusionInDoubleDual ℂ M A + have hker : predual M ≤ Ψ.ker := by + apply Submodule.topologicalClosure_minimal + · apply Submodule.span_le.mpr + rintro f ⟨⟨x, y⟩, rfl⟩ + change Φ (vectorFunctional M x y) - (vectorFunctional M x y) A = 0 + rw [vectorFunctional_apply] + change Φ (vectorFunctional M x y) - inner ℂ x (representingOperator M Φ y) = 0 + simp + · exact Ψ.isClosed_ker + refine ⟨A, ?_⟩ + ext f + have hf := hker f.property + change Φ (f : StrongDual ℂ M) - (f : StrongDual ℂ M) A = 0 at hf + rw [evaluation_apply, ← sub_eq_zero.mp hf] + exact hΦ f + +end Invariant233.ConcretePredual + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualSeparable.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualSeparable.lean new file mode 100644 index 0000000000000000000000000000000000000000..6000aac4d020f24562af2ccb90a66b81594bc3e8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcretePredualSeparable.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ConcretePredualCore + +namespace OAI + +noncomputable section +namespace Invariant233.ConcretePredual +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem continuous_vectorFunctional (M : VonNeumannAlgebra H) : + Continuous (fun xy : H × H => vectorFunctional M xy.1 xy.2) := by + exact (((innerSL ℂ).continuous.comp continuous_fst).clm_comp + ((ContinuousLinearMap.apply ℂ H).continuous.comp continuous_snd)).clm_comp_const + M.toSubalgebra.toSubmodule.subtypeL + +theorem isSeparable_predual (M : VonNeumannAlgebra H) + [TopologicalSpace.SeparableSpace H] : + TopologicalSpace.IsSeparable (predual M : Set (StrongDual ℂ M)) := by + exact ((TopologicalSpace.isSeparable_range (continuous_vectorFunctional M)).span).closure + +instance separableSpace_predual (M : VonNeumannAlgebra H) + [TopologicalSpace.SeparableSpace H] : + TopologicalSpace.SeparableSpace (predual M) := + (isSeparable_predual M).separableSpace + +end Invariant233.ConcretePredual + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcreteTagEvent.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcreteTagEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..b089c2f92d576d010bc5523e2a482342e823d4a4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConcreteTagEvent.lean @@ -0,0 +1,123 @@ +import OAI.Analysis.IrrationalRotation.Product.OneCoordinateDensity +import OAI.Analysis.IrrationalRotation.Analysis.TruncationEvent + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal ProbabilityTheory + +namespace Invariant233.OneCoordinateCoupling + +open CouplingMixture CouplingMarginalBounds + +theorem labelledLaw_ae_tag_interval (κ m a b t : ℝ) : + ∀ᵐ z ∂labelledLaw κ m a b t, z.1 = some (4 : Fin 5) → + z.2.1 < 1 / m ∧ 1 - 1 / m ≤ z.2.2 := by + let P : Option (Fin 5) × (ℝ × ℝ) → Prop := fun z => + z.1 = some (4 : Fin 5) → z.2.1 < 1 / m ∧ 1 - 1 / m ≤ z.2.2 + have hP : MeasurableSet {z | P z} := by + simp only [P, imp_iff_not_or] + change MeasurableSet ({z : Option (Fin 5) × (ℝ × ℝ) | z.1 = some (4 : Fin 5)}ᶜ ∪ + {z : Option (Fin 5) × (ℝ × ℝ) | z.2.1 < 1 / m ∧ 1 - 1 / m ≤ z.2.2}) + exact (measurable_fst (measurableSet_singleton _)).compl.union + ((measurableSet_lt (measurable_fst.comp measurable_snd) measurable_const).inter + (measurableSet_le measurable_const (measurable_snd.comp measurable_snd))) + change ∀ᵐ z ∂labelledLaw κ m a b t, P z + rw [labelledLaw, labelledMixture, ae_add_measure_iff, ae_finsetSum_measure_iff] + constructor + · apply Measure.ae_smul_measure + apply (ae_map_iff (measurable_const.prodMk measurable_id).aemeasurable hP).2 + exact Filter.Eventually.of_forall (by intro z; simp [P]) + · intro i _ + apply Measure.ae_smul_measure + apply (ae_map_iff (measurable_const.prodMk measurable_id).aemeasurable hP).2 + by_cases hi : i = 4 + · subst i + change ∀ᵐ z ∂(intervalLaw 0 (1 / m)).prod (intervalLaw (1 - 1 / m) 1), + P (some 4, z) + have : IsZeroOrProbabilityMeasure (intervalLaw 0 (1 / m)) := inferInstanceAs + (IsZeroOrProbabilityMeasure (volume[|Ico 0 (1 / m)])) + have : IsZeroOrProbabilityMeasure (intervalLaw (1 - 1 / m) 1) := inferInstanceAs + (IsZeroOrProbabilityMeasure (volume[|Ico (1 - 1 / m) 1])) + have hs : MeasurableSet {z : ℝ × ℝ | P (some 4, z)} := + hP.preimage (measurable_const.prodMk measurable_id) + rw [Measure.ae_prod_iff_ae_ae hs] + filter_upwards [intervalLaw_ae_mem 0 (1 / m)] with x hx + filter_upwards [intervalLaw_ae_mem (1 - 1 / m) 1] with y hy + exact fun _ => ⟨hx.2, hy.1⟩ + · exact Filter.Eventually.of_forall (by intro z; simp [P, hi]) + +theorem labelledLaw_left_map (κ m a b t : ℝ) : + (labelledLaw κ m a b t).map (fun z => z.2.1) = (pairLaw κ m a b t).fst := by + change _ = (pairLaw κ m a b t).map Prod.fst + rw [← labelledLaw_map_snd, Measure.map_map measurable_fst measurable_snd] + rfl + +theorem labelledLaw_right_map (κ m a b t : ℝ) : + (labelledLaw κ m a b t).map (fun z => z.2.2) = (pairLaw κ m a b t).snd := by + change _ = (pairLaw κ m a b t).map Prod.snd + rw [← labelledLaw_map_snd, Measure.map_map measurable_snd measurable_snd] + rfl + +theorem concrete_product_currentBlock_mass (m : ℕ) (hm : 100 ≤ m) + (κ : ℝ) (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) + (a b : Fin m → ℝ) + (ha : ∀ i, 1 / (m : ℝ) ≤ a i) (ha' : ∀ i, a i ≤ 1 / 4) + (hb : ∀ i, 1 / (m : ℝ) ≤ b i) (hb' : ∀ i, b i ≤ 1 / 4) : + Real.exp (-82) ≤ + (Measure.pi (fun i => labelledLaw κ m (a i) (b i) 1)).real + {z | (∃ i, (z i).1 = some (4 : Fin 5)) ∧ + ∀ i, (z i).2.1 < 1 - 2 / (m : ℝ) ∧ 2 / (m : ℝ) < (z i).2.2} := by + have hmR : (100 : ℝ) ≤ m := by exact_mod_cast hm + have hm0 : (0 : ℝ) < m := by linarith + have hm2 : (2 : ℝ) ≤ m := by linarith + let μ := fun i : Fin m => labelledLaw κ m (a i) (b i) 1 + have : ∀ i, IsProbabilityMeasure (μ i) := fun i => + labelledLaw_isProbabilityMeasure hκ0 hκ hmR (ha i) (ha' i) (hb i) (hb' i) + (by norm_num) (by norm_num) + let T : Fin m → Set (Option (Fin 5) × (ℝ × ℝ)) := + fun _ => {z | z.1 = some (4 : Fin 5)} + have hT : ∀ i, MeasurableSet (T i) := fun _ => + measurable_fst (measurableSet_singleton _) + have hTag : ∀ i, (μ i).real (T i) = 1 / (m : ℝ) := by + intro i + change (labelledLaw κ m (a i) (b i) 1).real {z | z.1 = some (4 : Fin 5)} = _ + rw [measureReal_def, labelledLaw_tag_mass hm2 (width_pos hm0 (ha i)) (ha' i) + (width_pos hm0 (hb i)) (hb' i), ENNReal.toReal_ofReal (by positivity)] + have hinv : 1 / (m : ℝ) ≤ 1 / 100 := + (div_le_div_iff₀ hm0 (by norm_num)).2 (by linarith) + have hSafe : ∀ i, ∀ᵐ z ∂μ i, z ∈ T i → + z.2.1 < 1 - 2 / (m : ℝ) ∧ 2 / (m : ℝ) < z.2.2 := by + intro i + filter_upwards [labelledLaw_ae_tag_interval κ m (a i) (b i) 1] with z hz + intro ht + obtain ⟨hx, hy⟩ := hz ht + rw [show (2 : ℝ) / m = 2 * (1 / (m : ℝ)) by ring] + constructor <;> linarith + have hdomX : ∀ i, (μ i).map (fun z => z.2.1) ≤ + ENNReal.ofReal 10 • volume.restrict (Ico (0 : ℝ) 1) := by + intro i + change (labelledLaw κ m (a i) (b i) 1).map _ ≤ _ + rw [labelledLaw_left_map, ← baseLaw_eq_restrict] + simpa using pairLaw_fst_le_ten hκ0 hκ hmR (ha i) (ha' i) (hb i) (hb' i) + (t := 1) (by norm_num) (by norm_num) + have hdomY : ∀ i, (μ i).map (fun z => z.2.2) ≤ + ENNReal.ofReal 10 • volume.restrict (Ico (0 : ℝ) 1) := by + intro i + change (labelledLaw κ m (a i) (b i) 1).map _ ≤ _ + rw [labelledLaw_right_map, ← baseLaw_eq_restrict] + simpa using pairLaw_snd_le_ten hκ0 hκ hmR (ha i) (ha' i) (hb i) (hb' i) + (t := 1) (by norm_num) (by norm_num) + have hbudget : 0 ≤ 1 - (1 + 2 * ((10 : ℝ) * 2)) / (m : ℝ) := by + apply sub_nonneg.mpr + exact (div_le_one hm0).mpr (by linarith) + have h := InvariantRotation.TruncationEvent.currentBlock_mass_lower_bound_ae m + (by omega) μ T hT (fun _ => measurable_fst.comp measurable_snd) + (fun _ => measurable_snd.comp measurable_snd) (C := 10) (a := 2) + (by norm_num) (by norm_num) hbudget hTag hSafe hdomX hdomY + norm_num only [show (1 : ℝ) + 2 * (10 * 2) = 41 by norm_num] at h + exact (InvariantRotation.TaggedEventBounds.product_tag_bound m hm).trans h + +end Invariant233.OneCoordinateCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConsecutiveBlocks.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConsecutiveBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..182d469317567fedd45300ff8766e6298391c8ba --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConsecutiveBlocks.lean @@ -0,0 +1,76 @@ +import Mathlib.Data.Nat.Find +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Order.Monotone.Basic +import Mathlib.Tactic + +namespace OAI + +open scoped BigOperators + +namespace InvariantProjection.IndependentAngles + +theorem consecutiveBlocks_bijective (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) : + Function.Bijective + (fun i : Σ j, Fin (m j) => (∑ r ∈ Finset.range i.1, m r) + i.2.val) := by + let d : ℕ → ℕ := fun j => ∑ r ∈ Finset.range j, m r + have hd0 : d 0 = 0 := by simp [d] + have hstep : ∀ j, d (j + 1) = d j + m j := fun j => Finset.sum_range_succ m j + have hmono : Monotone d := fun j k hjk => + Finset.sum_le_sum_of_subset (Finset.range_mono hjk) + have hlarge : ∀ j, j ≤ d j := by + intro j + induction j with + | zero => omega + | succ j hj => + have hp := hm j + rw [hstep] + omega + have hgap : ∀ {j k}, j < k → d j + m j ≤ d k := by + intro j k hjk + rw [← hstep] + exact hmono (by omega) + constructor + · rintro ⟨j, u⟩ ⟨k, v⟩ heq + change d j + u.val = d k + v.val at heq + have hjk : j = k := by + rcases lt_trichotomy j k with h | h | h + · have hg := hgap h + have hu := u.isLt + omega + · exact h + · have hg := hgap h + have hv := v.isLt + omega + subst k + have huv : u = v := Fin.ext (by omega) + subst v + rfl + · intro n + have hex : ∃ j, n < d (j + 1) := ⟨n, by have := hlarge (n + 1); omega⟩ + let j := Nat.find hex + have hupper : n < d (j + 1) := Nat.find_spec hex + have hlower : d j ≤ n := by + by_cases hj : j = 0 + · simp [hj, hd0] + · have hjpos : 0 < j := Nat.pos_of_ne_zero hj + have hn : ¬n < d (j - 1 + 1) := Nat.find_min hex (by change j - 1 < j; omega) + have hpred : j - 1 + 1 = j := by omega + rw [hpred] at hn + omega + have hi : n - d j < m j := by + rw [hstep] at hupper + omega + refine ⟨⟨j, ⟨n - d j, hi⟩⟩, ?_⟩ + change d j + (n - d j) = n + omega + +theorem exists_consecutiveBlocks_equiv (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) : + ∃ e : ℕ ≃ Σ j, Fin (m j), ∀ i : Σ j, Fin (m j), + e.symm i = (∑ r ∈ Finset.range i.1, m r) + i.2.val := by + let e : (Σ j, Fin (m j)) ≃ ℕ := + Equiv.ofBijective _ (consecutiveBlocks_bijective m hm) + exact ⟨e.symm, fun _ => rfl⟩ + +end InvariantProjection.IndependentAngles + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuityCoboundary.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuityCoboundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..c747fb911875cfb9def630e0ec61c28cabaffa41 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuityCoboundary.lean @@ -0,0 +1,248 @@ +import OAI.Analysis.IrrationalRotation.Model.ContinuityCoboundary +import Mathlib.MeasureTheory.Integral.Bochner.Basic +import Mathlib.Tactic + +namespace OAI + +namespace InvariantProjection.Continuity + +variable {X : Type*} + +@[simp] theorem backwardSum_zero (σ : X ≃ X) (v : X → ℝ) (x : X) : + backwardSum σ v 0 x = 0 := by + simp [backwardSum] + +theorem backwardSum_succ (σ : X ≃ X) (v : X → ℝ) (n : ℕ) (x : X) : + backwardSum σ v (n + 1) x = + backwardSum σ v n x + v ((σ.symm : X → X)^[n + 1] x) := by + simp [backwardSum, Finset.sum_range_succ] + +theorem backwardSum_sub_comp (σ : X ≃ X) (v : X → ℝ) (n : ℕ) (x : X) : + backwardSum σ v n x - backwardSum σ v n (σ x) = + v ((σ.symm : X → X)^[n] x) - v x := by + induction n with + | zero => simp + | succ n ih => + rw [backwardSum_succ, backwardSum_succ] + have hcancel : (σ.symm : X → X)^[n + 1] (σ x) = + (σ.symm : X → X)^[n] x := by + rw [Function.iterate_succ_apply] + simp + rw [hcancel] + linarith + +theorem relocated_eq_add_coboundary (σ : X ≃ X) (h : X → ℝ) + (φ : ℕ → X → ℝ) (H : ℕ) (x : X) + (hpartition : ∑ n ∈ Finset.range (H + 1), φ n x = 1) : + relocated σ h φ H x = h x + relocationTransfer σ h φ H x - + relocationTransfer σ h φ H (σ x) := by + have ht : relocationTransfer σ h φ H x - + relocationTransfer σ h φ H (σ x) = relocated σ h φ H x - h x := by + unfold relocationTransfer + rw [← Finset.sum_sub_distrib] + simp_rw [backwardSum_sub_comp] + rw [Finset.sum_sub_distrib] + change relocated σ h φ H x - + (∑ n ∈ Finset.range (H + 1), h x * φ n x) = _ + rw [← Finset.mul_sum, hpartition, mul_one] + linarith + +theorem relocationTransfer_eq_zero (σ : X ≃ X) (h : X → ℝ) + (φ : ℕ → X → ℝ) (H : ℕ) (x : X) + (hzero : ∀ r, 1 ≤ r → r ≤ H → h ((σ.symm : X → X)^[r] x) = 0) : + relocationTransfer σ h φ H x = 0 := by + apply Finset.sum_eq_zero + intro n hn + apply Finset.sum_eq_zero + intro r hr + have hn' : n ≤ H := Nat.le_of_lt_succ (Finset.mem_range.mp hn) + have hr' : r + 1 ≤ n := Finset.mem_range.mp hr + change h ((σ.symm : X → X)^[r + 1] x) * + φ n ((σ.symm : X → X)^[r + 1] x) = 0 + rw [hzero (r + 1) (by omega) (by omega), zero_mul] + +theorem background_coboundary (σ : X ≃ X) (v : X → ℝ) + (W : ℕ) (hW : W ≠ 0) (x : X) : + v x - backwardAverage σ v W x = + backgroundTransfer σ v W (σ x) - backgroundTransfer σ v W x := by + have ht : (∑ n ∈ Finset.range W, backwardSum σ v (n + 1) x) - + (∑ n ∈ Finset.range W, backwardSum σ v (n + 1) (σ x)) = + backwardSum σ v W x - (W : ℝ) * v x := by + rw [← Finset.sum_sub_distrib] + simp_rw [backwardSum_sub_comp] + rw [Finset.sum_sub_distrib] + simp [backwardSum] + have hW' : (W : ℝ) ≠ 0 := by exact_mod_cast hW + unfold backwardAverage backgroundTransfer + field_simp + nlinarith + +end InvariantProjection.Continuity + +namespace InvariantProjection.Continuity + +open Function MeasureTheory +open scoped ENNReal + +variable {X : Type*} + +theorem relocated_nonneg (σ : X ≃ X) (h : X → ℝ) (φ : ℕ → X → ℝ) + (H : ℕ) (hh : ∀ x, 0 ≤ h x) (hφ : ∀ n ≤ H, ∀ x, 0 ≤ φ n x) (x : X) : + 0 ≤ relocated σ h φ H x := by + apply Finset.sum_nonneg + intro n hn + exact mul_nonneg (hh _) (hφ n (Nat.le_of_lt_succ (Finset.mem_range.mp hn)) _) + +theorem support_relocated_subset (σ : X ≃ X) (h : X → ℝ) + (φ : ℕ → X → ℝ) (H : ℕ) (O : Set X) + (hφ : ∀ n ≤ H, (σ : X → X)^[n] '' support (φ n) ⊆ O) : + support (relocated σ h φ H) ⊆ O := by + intro x hx + by_contra hxO + apply hx + apply Finset.sum_eq_zero + intro n hn + have hz : φ n ((σ.symm : X → X)^[n] x) = 0 := by + by_contra hne + apply hxO + apply hφ n (Nat.le_of_lt_succ (Finset.mem_range.mp hn)) + refine ⟨(σ.symm : X → X)^[n] x, hne, ?_⟩ + exact (Function.LeftInverse.iterate σ.apply_symm_apply n) x + rw [hz, mul_zero] + +theorem continuous_relocated [TopologicalSpace X] (σ : X ≃ₜ X) + (h : X → ℝ) (φ : ℕ → X → ℝ) (H : ℕ) (hh : Continuous h) + (hφ : ∀ n ≤ H, Continuous (φ n)) : + Continuous (relocated σ.toEquiv h φ H) := by + apply continuous_finsetSum + intro n hn + exact (hh.comp (σ.symm.continuous.iterate n)).mul + ((hφ n (Nat.le_of_lt_succ (Finset.mem_range.mp hn))).comp + (σ.symm.continuous.iterate n)) + +theorem continuous_relocationTransfer [TopologicalSpace X] (σ : X ≃ₜ X) + (h : X → ℝ) (φ : ℕ → X → ℝ) (H : ℕ) (hh : Continuous h) + (hφ : ∀ n ≤ H, Continuous (φ n)) : + Continuous (relocationTransfer σ.toEquiv h φ H) := by + apply continuous_finsetSum + intro n hn + apply continuous_finsetSum + intro r _hr + exact (hh.comp (σ.symm.continuous.iterate (r + 1))).mul + ((hφ n (Nat.le_of_lt_succ (Finset.mem_range.mp hn))).comp + (σ.symm.continuous.iterate (r + 1))) + +theorem tsupport_relocated_subset [TopologicalSpace X] (σ : X ≃ₜ X) + (h : X → ℝ) (φ : ℕ → X → ℝ) (H : ℕ) (O : Set X) + (hφ : ∀ n ≤ H, (σ : X → X)^[n] '' tsupport (φ n) ⊆ O) : + tsupport (relocated σ.toEquiv h φ H) ⊆ O := by + have hsub : support (relocated σ.toEquiv h φ H) ⊆ + ⋃ n ∈ Finset.range (H + 1), ((σ.symm : X → X)^[n]) ⁻¹' tsupport (φ n) := by + intro x hx + by_contra hout + apply hx + apply Finset.sum_eq_zero + intro n hn + have hz : φ n ((σ.symm : X → X)^[n] x) = 0 := by + apply image_eq_zero_of_notMem_tsupport + intro hm + exact hout (Set.mem_iUnion.mpr ⟨n, Set.mem_iUnion.mpr ⟨hn, hm⟩⟩) + exact mul_eq_zero_of_right _ hz + have hclosed : IsClosed + (⋃ n ∈ Finset.range (H + 1), ((σ.symm : X → X)^[n]) ⁻¹' tsupport (φ n)) := + isClosed_biUnion_finset (fun n _ => + (isClosed_tsupport (φ n)).preimage (σ.symm.continuous.iterate n)) + intro x hx + obtain ⟨n, hn⟩ := Set.mem_iUnion.mp (closure_minimal hsub hclosed hx) + obtain ⟨hn, hx⟩ := Set.mem_iUnion.mp hn + apply hφ n (Nat.le_of_lt_succ (Finset.mem_range.mp hn)) + refine ⟨(σ.symm : X → X)^[n] x, hx, ?_⟩ + exact (Function.LeftInverse.iterate σ.apply_symm_apply n) x + +theorem support_relocationTransfer_subset (σ : X ≃ X) (h : X → ℝ) + (φ : ℕ → X → ℝ) (H : ℕ) : + support (relocationTransfer σ h φ H) ⊆ + ⋃ r ∈ Finset.range H, ((σ.symm : X → X)^[r + 1]) ⁻¹' support h := by + intro x hx + by_contra hxU + apply hx + apply relocationTransfer_eq_zero + intro r hr hrH + by_contra hne + apply hxU + refine Set.mem_iUnion.mpr ⟨r - 1, Set.mem_iUnion.mpr ⟨?_, ?_⟩⟩ + · exact Finset.mem_range.mpr (by omega) + · change h ((σ.symm : X → X)^[r - 1 + 1] x) ≠ 0 + simpa [Nat.sub_add_cancel hr] using hne + +end InvariantProjection.Continuity + +namespace InvariantProjection.Continuity + +open Function MeasureTheory +open scoped ENNReal + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +private theorem measurableEmbedding_iterate (σ : X ≃ᵐ X) (n : ℕ) : + MeasurableEmbedding (σ : X → X)^[n] := by + induction n with + | zero => exact MeasurableEmbedding.id + | succ n ih => + rw [Function.iterate_succ] + exact ih.comp σ.measurableEmbedding + +theorem integral_relocated (σ : X ≃ᵐ X) (hσ : MeasurePreserving σ μ μ) + (h : X → ℝ) (φ : ℕ → X → ℝ) (H : ℕ) + (hint : ∀ n ≤ H, Integrable (fun x => h x * φ n x) μ) + (hpartition : ∀ x, ∑ n ∈ Finset.range (H + 1), φ n x = 1) : + ∫ x, relocated σ.toEquiv h φ H x ∂μ = ∫ x, h x ∂μ := by + have hb := hσ.symm σ + have hp (n : ℕ) : MeasurePreserving (σ.symm : X → X)^[n] μ μ := hb.iterate n + unfold relocated + rw [integral_finsetSum] + · calc + (∑ n ∈ Finset.range (H + 1), + ∫ x, h ((σ.symm : X → X)^[n] x) * + φ n ((σ.symm : X → X)^[n] x) ∂μ) = + ∑ n ∈ Finset.range (H + 1), ∫ x, h x * φ n x ∂μ := by + apply Finset.sum_congr rfl + intro n hn + exact (hp n).integral_comp (measurableEmbedding_iterate σ.symm n) + (fun x : X => h x * φ n x) + _ = ∫ x, ∑ n ∈ Finset.range (H + 1), h x * φ n x ∂μ := by + symm + apply integral_finsetSum + intro n hn + exact hint n (Nat.le_of_lt_succ (Finset.mem_range.mp hn)) + _ = ∫ x, h x ∂μ := by + congr 1 + funext x + rw [← Finset.mul_sum, hpartition x, mul_one] + · intro n hn + exact (hp n).integrable_comp_of_integrable + (hint n (Nat.le_of_lt_succ (Finset.mem_range.mp hn))) + +theorem measure_support_relocationTransfer_le (σ : X ≃ᵐ X) + (hσ : MeasurePreserving σ μ μ) (h : X → ℝ) (hh : Measurable h) + (φ : ℕ → X → ℝ) (H : ℕ) : + μ (support (relocationTransfer σ.toEquiv h φ H)) ≤ + (H : ℝ≥0∞) * μ (support h) := by + have hb := hσ.symm σ + calc + μ (support (relocationTransfer σ.toEquiv h φ H)) ≤ + μ (⋃ r ∈ Finset.range H, + ((σ.symm : X → X)^[r + 1]) ⁻¹' support h) := + measure_mono (support_relocationTransfer_subset σ.toEquiv h φ H) + _ ≤ ∑ r ∈ Finset.range H, + μ (((σ.symm : X → X)^[r + 1]) ⁻¹' support h) := + measure_biUnion_finset_le _ _ + _ = ∑ _r ∈ Finset.range H, μ (support h) := by + apply Finset.sum_congr rfl + intro r hr + exact (hb.iterate (r + 1)).measure_preimage (measurableSet_support hh).nullMeasurableSet + _ = (H : ℝ≥0∞) * μ (support h) := by simp + +end InvariantProjection.Continuity + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousConstruction.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousConstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d7461dd15c99e58d73e3ff58fd1cff9032fa237 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousConstruction.lean @@ -0,0 +1,79 @@ +import OAI.Analysis.IrrationalRotation.Model.ContinuousConstruction +import OAI.Analysis.IrrationalRotation.Analysis.ParameterSmoothing +import OAI.Analysis.IrrationalRotation.Analysis.BackgroundTransfer +import OAI.Analysis.IrrationalRotation.Analysis.RelocationSeries + +namespace OAI + +open MeasureTheory Filter Function Set +open scoped ENNReal + +namespace Invariant233.CircleParameterLaws + +open InvariantProjection.Continuity TransferSupport + +variable {θ : ℝ} {p : CircleParameterData} + +theorem measurable_relocatedBlockTransfer (j : ℕ) : + Measurable (p.relocatedBlockTransfer θ j) := + measurable_relocationTransfer (MeasurableEquiv.addRight (θ : Circle)) _ _ _ + (continuous_smoothBlock p θ j).measurable (fun n => (p.partition j n).measurable) + +theorem measurable_continuousTransfer (d : BackgroundBumpData θ) : + Measurable (p.continuousTransfer θ d) := + (BackgroundCost.measurable_backgroundTransferSum d).sub (Measurable.tsum fun n => + (measurable_smoothBlockTransfer p θ (n + 1)).add + (measurable_relocatedBlockTransfer (p := p) (θ := θ) (n + 1))) + +variable (hp : CircleParameterLaws θ p) +include hp + +theorem ae_summable_rawBlock : + ∀ᵐ x ∂circleMeasure, Summable (fun n : ℕ => p.rawBlock θ (n + 1) x) := by + have hfin := hp.ae_finite_smoothing_and_relocation_support + have hfinshift := (measurePreserving_add_right (volume : Measure Circle) + (θ : Circle)).quasiMeasurePreserving.ae hfin + filter_upwards [hfin, hfinshift] with x hx hxσ + have hs : Summable (fun n : ℕ => p.smoothBlock θ (n + 1) x) := + summable_of_hasFiniteSupport hx.1 + have hd : Summable (fun n : ℕ => p.smoothBlockTransfer θ (n + 1) x) := + summable_of_hasFiniteSupport hx.2.1 + have hdσ : Summable (fun n : ℕ => p.smoothBlockTransfer θ (n + 1) (x + (θ : Circle))) := + summable_of_hasFiniteSupport hxσ.2.1 + apply ((hs.sub hd).add hdσ).congr + intro n + have h := smoothBlock_eq_add_coboundary (p := p) (θ := θ) (n + 1) x + linarith + +theorem relocatedBlock_eq_raw_add_coboundary (j : ℕ) (hj : 1 ≤ j) (x : Circle) : + p.relocatedBlock θ j x = p.rawBlock θ j x + + (p.smoothBlockTransfer θ j x + p.relocatedBlockTransfer θ j x) - + (p.smoothBlockTransfer θ j (x + (θ : Circle)) + + p.relocatedBlockTransfer θ j (x + (θ : Circle))) := by + rw [hp.relocatedBlock_eq_add_coboundary j hj x, + smoothBlock_eq_add_coboundary j x] + ring + +theorem continuousCost_ae_coboundary (d : BackgroundBumpData θ) : + p.continuousCost θ d =ᵐ[circleMeasure] fun x => p.rawCost θ x + 1 + + p.continuousTransfer θ d (x + (θ : Circle)) - p.continuousTransfer θ d x := by + obtain ⟨b, hb, hformula, heq⟩ := assemble_continuous_coboundary + (fun n => p.rawBlock θ (n + 1)) (fun n => p.relocatedBlock θ (n + 1)) + (fun n => p.smoothBlockTransfer θ (n + 1)) + (fun n => p.relocatedBlockTransfer θ (n + 1)) + (backgroundCost d) (backgroundTransferSum d) (fun x : Circle => x + (θ : Circle)) + (measurePreserving_add_right volume _).quasiMeasurePreserving + (BackgroundCost.measurable_backgroundTransferSum d) + (fun n => measurable_smoothBlockTransfer p θ (n + 1)) + (fun n => measurable_relocatedBlockTransfer (n + 1)) + hp.tsum_smoothBlockTransfer_support_ne_top hp.tsum_relocatedBlockTransfer_support_ne_top + hp.ae_summable_rawBlock + (fun n => Eventually.of_forall (hp.relocatedBlock_eq_raw_add_coboundary (n + 1) (by omega))) + (BackgroundCost.backgroundCost_ae_coboundary d) + have hbdef : b = p.continuousTransfer θ d := funext hformula + filter_upwards [heq] with x hx + simpa only [hbdef, CircleParameterData.continuousCost, CircleParameterData.rawCost] using hx + +end Invariant233.CircleParameterLaws + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousCounterexampleAssembly.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousCounterexampleAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..a24787b4c0e4d17248bd3bcf0df75915c54908a8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousCounterexampleAssembly.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.IrrationalRotation.Model.ParameterCircleOperator +import OAI.Analysis.IrrationalRotation.Operators.ContinuousProjectionTransport +import OAI.Analysis.IrrationalRotation.Spectral.RotationDeterminant +import OAI.Analysis.IrrationalRotation.Rotation.RotationAlgebra +import OAI.Analysis.IrrationalRotation.Rotation.CircleBackgroundBumps + +namespace OAI + +/-! Continuous weights with the invariant-projection obstruction and their spectral properties. -/ + +noncomputable section +namespace Invariant233.CircleParameterLaws + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) + +theorem continuousWeight_obstruction_of_measurableOperator + (d : BackgroundBumpData θ) + (hstar : HasOnlyTrivialInvariantProjections (Rotation.algebra θ) + (p.measurableOperator θ hp)) : + HasOnlyTrivialInvariantProjections (Rotation.algebra θ) + (Rotation.weightedReal θ + ⟨p.continuousWeight θ d, (hp.isContinuousCircleWeight_continuousWeight d).1⟩) := by + apply hp.continuousWeight_hasOnlyTrivialInvariantProjections d + exact hstar + +theorem exists_continuous_invariant_weight + (hθ : Irrational θ) + (hstar : HasOnlyTrivialInvariantProjections (Rotation.algebra θ) + (p.measurableOperator θ hp)) : + ∃ f : C(Circle, ℝ), IsContinuousCircleWeight f ∧ + Rotation.weightedReal θ f ∈ Rotation.algebra θ ∧ + HasOnlyTrivialInvariantProjections (Rotation.algebra θ) (Rotation.weightedReal θ f) := by + obtain ⟨d⟩ := BackgroundCost.exists_backgroundBumpData θ hθ + let f : C(Circle, ℝ) := + ⟨p.continuousWeight θ d, (hp.isContinuousCircleWeight_continuousWeight d).1⟩ + have hf : IsContinuousCircleWeight f := hp.isContinuousCircleWeight_continuousWeight d + exact ⟨f, hf, Rotation.weightedReal_mem_algebra θ f, + hp.continuousWeight_obstruction_of_measurableOperator d hstar⟩ + +theorem exists_continuous_counterexample_of_measurable_obstruction + (hθ : Irrational θ) + (hstar : HasOnlyTrivialInvariantProjections (Rotation.algebra θ) + (p.measurableOperator θ hp)) : + ∃ f : C(Circle, ℝ), IsContinuousCircleWeight f ∧ + Rotation.weightedReal θ f ∈ Rotation.algebra θ ∧ + HasOnlyTrivialInvariantProjections (Rotation.algebra θ) (Rotation.weightedReal θ f) ∧ + Rotation.weightedReal θ f ≠ 0 ∧ NormQuasinilpotent (Rotation.weightedReal θ f) ∧ + vectorFugledeKadisonDeterminant Rotation.vacuum (Rotation.weightedReal θ f) = 0 := by + obtain ⟨f, hf, hmem, hinv⟩ := hp.exists_continuous_invariant_weight hθ hstar + exact ⟨f, hf, hmem, hinv, Rotation.continuous_weight_spectral_bundle θ hθ f hf⟩ + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousExtendedCost.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousExtendedCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..630194a9f76a1bf898d02982d221bd47bbce8744 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousExtendedCost.lean @@ -0,0 +1,103 @@ +import OAI.Analysis.IrrationalRotation.Model.ContinuousExtendedCost +import OAI.Analysis.IrrationalRotation.Rotation.ContinuousWeightAssembly +import OAI.Analysis.IrrationalRotation.Analysis.ExtendedExponential + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology + +namespace Invariant233.CircleParameterData + +variable (p : CircleParameterData) (θ : ℝ) (d : BackgroundBumpData θ) + +@[simp] theorem extendedContinuousCost_zero : p.extendedContinuousCost θ d 0 = ∞ := by + classical + simp [extendedContinuousCost] + +theorem extendedContinuousCost_of_ne_zero {x : Circle} (hx : x ≠ 0) : + p.extendedContinuousCost θ d x = ENNReal.ofReal (p.continuousCost θ d x) := by + classical + exact Function.update_of_ne hx _ _ + +theorem extendedContinuousCost_eq_top_iff (x : Circle) : + p.extendedContinuousCost θ d x = ∞ ↔ x = 0 := by + classical + by_cases hx : x = 0 + · simp [hx] + · simp [extendedContinuousCost_of_ne_zero p θ d hx, hx] + +theorem negLogCost_continuousWeight (x : Circle) : + negLogCost (p.continuousWeight θ d x) = p.extendedContinuousCost θ d x := by + classical + by_cases hx : x = 0 + · subst x + simp [continuousWeight, negLogCost] + · rw [extendedContinuousCost_of_ne_zero p θ d hx] + unfold continuousWeight + rw [Function.update_of_ne hx] + simp [negLogCost, Real.exp_ne_zero, abs_of_pos (Real.exp_pos _), Real.log_exp] + +end Invariant233.CircleParameterData + +namespace Invariant233.CircleParameterLaws + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem continuous_extendedContinuousCost (d : BackgroundBumpData θ) : + Continuous (p.extendedContinuousCost θ d) := by + classical + unfold CircleParameterData.extendedContinuousCost + rw [continuous_iff_continuousAt] + intro x + by_cases hx : x = 0 + · subst x + rw [continuousAt_update_same] + exact ENNReal.tendsto_ofReal_atTop.comp (hp.tendsto_continuousCost_atTop d) + · rw [continuousAt_update_of_ne hx] + have hc : ContinuousAt (p.continuousCost θ d) x := + (hp.continuousOn_continuousCost d x hx).continuousAt + (isOpen_compl_singleton.mem_nhds hx) + exact ENNReal.continuous_ofReal.continuousAt.comp hc + +theorem extendedContinuousCost_ge_half (d : BackgroundBumpData θ) (x : Circle) : + ENNReal.ofReal (1 / 2) ≤ p.extendedContinuousCost θ d x := by + by_cases hx : x = 0 + · simp [hx] + · rw [p.extendedContinuousCost_of_ne_zero θ d hx] + exact ENNReal.ofReal_le_ofReal (hp.continuousCost_ge_half d x) + +theorem continuousWeight_eq_extendedExpNeg (d : BackgroundBumpData θ) (x : Circle) : + p.continuousWeight θ d x = + (EReal.exp (-(p.extendedContinuousCost θ d x : EReal))).toReal := by + classical + by_cases hx : x = 0 + · subst x + simp [CircleParameterData.continuousWeight] + · rw [p.extendedContinuousCost_of_ne_zero θ d hx, + extendedExpNeg_eq_exp_toReal _ ENNReal.ofReal_ne_top, + ENNReal.toReal_ofReal] + · exact Function.update_of_ne hx _ _ + · exact (show (0 : ℝ) ≤ 1 / 2 by norm_num).trans (hp.continuousCost_ge_half d x) + +theorem lintegral_extendedContinuousCost_eq_top (d : BackgroundBumpData θ) : + (∫⁻ x, p.extendedContinuousCost θ d x ∂circleMeasure) = ∞ := by + simp_rw [← p.negLogCost_continuousWeight θ d] + exact (hp.isContinuousCircleWeight_continuousWeight d).2.2.2 + +theorem extendedContinuousCost_ae_coboundary (d : BackgroundBumpData θ) : + p.extendedContinuousCost θ d =ᵐ[circleMeasure] fun x => ENNReal.ofReal + (p.rawCost θ x + 1 + p.continuousTransfer θ d (x + (θ : Circle)) - + p.continuousTransfer θ d x) := by + have hne : ∀ᵐ x ∂circleMeasure, x ≠ (0 : Circle) := by + simpa only [ae_iff, not_not, Set.ofPred_eq_eq_singleton] using circleMeasure_singleton 0 + filter_upwards [hne, hp.continuousCost_ae_coboundary d] with x hx hc + rw [p.extendedContinuousCost_of_ne_zero θ d hx, hc] + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousLpInfinityNorm.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousLpInfinityNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e3c19e736edd6f14dd814a5a9b1ea80c83383b2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousLpInfinityNorm.lean @@ -0,0 +1,48 @@ +import Mathlib.MeasureTheory.Function.LpSpace.ContinuousFunctions +import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm +import Mathlib.MeasureTheory.Measure.OpenPos + +namespace OAI + +open Filter MeasureTheory +open scoped ENNReal Topology + +namespace Invariant233 + +variable {X E 𝕜 : Type*} [TopologicalSpace X] [MeasurableSpace X] [BorelSpace X] + [CompactSpace X] [NormedAddCommGroup E] [NontriviallyNormedField 𝕜] + [NormedSpace 𝕜 E] [SecondCountableTopologyEither X E] + {μ : Measure X} [IsFiniteMeasure μ] + +omit [BorelSpace X] [CompactSpace X] [SecondCountableTopologyEither X E] + [IsFiniteMeasure μ] in + +theorem continuous_norm_le_of_ae [μ.IsOpenPosMeasure] (f : C(X, E)) {C : ℝ} + (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) : ∀ x, ‖f x‖ ≤ C := by + have hclosed : IsClosed {x | ‖f x‖ ≤ C} := + isClosed_le f.continuous.norm continuous_const + intro x + have hx := (μ.dense_of_ae h) x + rwa [hclosed.closure_eq] at hx + +theorem norm_continuous_toLp_top [μ.IsOpenPosMeasure] (f : C(X, E)) : + ‖ContinuousMap.toLp (E := E) ∞ μ 𝕜 f‖ = ‖f‖ := by + let u : Lp E ∞ μ := ContinuousMap.toLp ∞ μ 𝕜 f + have hrep : u =ᵐ[μ] f := ContinuousMap.coeFn_toLp (p := ∞) (𝕜 := 𝕜) μ f + have hnorm : ‖u‖ = lpNorm f ∞ μ := by + rw [Lp.norm_def, eLpNorm_congr_ae hrep, toReal_eLpNorm] + apply le_antisymm + · have hb : ∀ᵐ x ∂μ, ‖u x‖ ≤ ‖f‖ := by + filter_upwards [hrep] with x hx + rw [hx] + exact f.norm_coe_le_norm x + have hu := Lp.norm_le_of_ae_bound (norm_nonneg f) hb + simpa using hu + · apply (ContinuousMap.norm_le f (norm_nonneg _)).mpr + apply continuous_norm_le_of_ae (μ := μ) f + rw [hnorm] + exact ae_le_lpNorm_exponent_top (ContinuousMap.memLp (p := ∞) μ 𝕜 f) + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousMultiplierNorm.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousMultiplierNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..5198ba811e0e4043373e1db8b9c191ba195c0b3c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ContinuousMultiplierNorm.lean @@ -0,0 +1,66 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplier +import OAI.Analysis.IrrationalRotation.Analysis.ContinuousLpInfinityNorm + +namespace OAI + +open MeasureTheory Filter +open scoped ENNReal + +namespace Invariant233.L2Multiplication + +variable {X E : Type*} [MeasurableSpace X] {μ : Measure X} + [NormedAddCommGroup E] [NormedSpace ℂ E] + +theorem norm_compLp_unitVector (e : E) (he : ‖e‖ = 1) (f : Lp ℂ 2 μ) : + ‖(ContinuousLinearMap.toSpanSingleton ℂ e).compLp f‖ = ‖f‖ := by + rw [Lp.norm_def, Lp.norm_def] + congr 1 + apply eLpNorm_congr_norm_ae (Lp.aestronglyMeasurable _) (Lp.aestronglyMeasurable f) + filter_upwards [(ContinuousLinearMap.toSpanSingleton ℂ e).coeFn_compLp f] with x hx + rw [hx] + simp [norm_smul, he] + +theorem multiplier_compLp_unitVector (g : Lp ℂ ∞ μ) (e : E) (f : Lp ℂ 2 μ) : + multiplier g ((ContinuousLinearMap.toSpanSingleton ℂ e).compLp f) = + (ContinuousLinearMap.toSpanSingleton ℂ e).compLp (multiplier g f) := by + apply Lp.ext + filter_upwards [multiplier_coe g ((ContinuousLinearMap.toSpanSingleton ℂ e).compLp f), + (ContinuousLinearMap.toSpanSingleton ℂ e).coeFn_compLp f, + (ContinuousLinearMap.toSpanSingleton ℂ e).coeFn_compLp (multiplier g f), + multiplier_coe g f] with x hmul hemb hresult hscalar + rw [hmul, hemb, hresult, hscalar] + simp [smul_smul] + +theorem norm_multiplier_eq_of_unitVector [IsFiniteMeasure μ] + (g : Lp ℂ ∞ μ) (e : E) (he : ‖e‖ = 1) : + ‖(multiplier g : Lp E 2 μ →L[ℂ] Lp E 2 μ)‖ = ‖g‖ := by + apply le_antisymm (norm_multiplier_le g) + rw [← norm_scalar_multiplier g] + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) + intro f + rw [← norm_compLp_unitVector e he (multiplier g f), + ← multiplier_compLp_unitVector] + calc + ‖multiplier g ((ContinuousLinearMap.toSpanSingleton ℂ e).compLp f)‖ ≤ + ‖(multiplier g : Lp E 2 μ →L[ℂ] Lp E 2 μ)‖ * + ‖(ContinuousLinearMap.toSpanSingleton ℂ e).compLp f‖ := + (multiplier (E := E) g).le_opNorm ((ContinuousLinearMap.toSpanSingleton ℂ e).compLp f) + _ = _ := by rw [norm_compLp_unitVector e he] + + +variable [TopologicalSpace X] [BorelSpace X] [CompactSpace X] + [IsFiniteMeasure μ] [μ.IsOpenPosMeasure] + +theorem norm_continuous_scalar_multiplier (f : C(X, ℂ)) : + ‖(multiplier (ContinuousMap.toLp ∞ μ ℂ f) : Lp ℂ 2 μ →L[ℂ] Lp ℂ 2 μ)‖ = + ‖f‖ := by + rw [norm_scalar_multiplier, Invariant233.norm_continuous_toLp_top] + +theorem norm_continuous_multiplier (f : C(X, ℂ)) (e : E) (he : ‖e‖ = 1) : + ‖(multiplier (ContinuousMap.toLp ∞ μ ℂ f) : Lp E 2 μ →L[ℂ] Lp E 2 μ)‖ = + ‖f‖ := by + rw [norm_multiplier_eq_of_unitVector _ e he, Invariant233.norm_continuous_toLp_top] + +end Invariant233.L2Multiplication + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionAbsoluteBound.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionAbsoluteBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e935a0bbbdb27a110092abf8d6bfca989f2c734 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionAbsoluteBound.lean @@ -0,0 +1,64 @@ +import OAI.Analysis.IrrationalRotation.Rotation.WeightedOrbitInvariance + +namespace OAI + +noncomputable section +namespace Invariant233.ConvolutionAbsoluteBound +open WeightedShift + +theorem shifted_norm_products (ξ γ : Hilbert) (n : ℤ) : + (Summable (fun v : ℤ => ‖ξ v‖ * ‖γ (v + n)‖)) ∧ + (∑' v : ℤ, ‖ξ v‖ * ‖γ (v + n)‖) ≤ ‖ξ‖ * ‖γ‖ := by + have h := lp.tsum_mul_le_mul_norm (p := 2) (q := 2) + (by rw [Real.holderConjugate_iff]; norm_num) ξ (shift (-n) γ) + simpa only [shift_apply, sub_neg_eq_add, LinearIsometryEquiv.norm_map] using h + +theorem weighted_shifted_products (a : ℤ → ℂ) (ha : ∀ v, ‖a v‖ ≤ 1) + (ξ γ : Hilbert) (n : ℤ) : + (Summable (fun v : ℤ => ‖a v * ξ v * star (γ (v + n))‖)) ∧ + (∑' v : ℤ, ‖a v * ξ v * star (γ (v + n))‖) ≤ ‖ξ‖ * ‖γ‖ := by + have hCS := shifted_norm_products ξ γ n + have hb (v : ℤ) : ‖a v * ξ v * star (γ (v + n))‖ ≤ + ‖ξ v‖ * ‖γ (v + n)‖ := by + rw [norm_mul, norm_mul, norm_star] + calc + ‖a v‖ * ‖ξ v‖ * ‖γ (v + n)‖ ≤ 1 * ‖ξ v‖ * ‖γ (v + n)‖ := + mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_right (ha v) (norm_nonneg _)) (norm_nonneg _) + _ = ‖ξ v‖ * ‖γ (v + n)‖ := by ring + have hs := Summable.of_nonneg_of_le (fun v => norm_nonneg _) hb hCS.1 + exact ⟨hs, (hs.tsum_le_tsum hb hCS.1).trans hCS.2⟩ + +theorem coefficient_sequences (Fx Fy : ℤ → ℝ) (ξ γ : Hilbert) (n : ℤ) + (hratio : ∀ v : ℤ, ‖(Fy (v + n) : ℂ) / (Fx v : ℂ)‖ ≤ 1) : + let A : ℤ → ℂ := fun v => ξ v / (Fx v : ℂ) + let B : ℤ → ℂ := fun v => (Fy (-v) : ℂ) * star (γ (-v)) + (Summable (fun v : ℤ => ‖A v * B (-n - v)‖)) ∧ + (∑' v : ℤ, ‖A v * B (-n - v)‖) ≤ ‖ξ‖ * ‖γ‖ := by + dsimp only + have heq (v : ℤ) : ξ v / (Fx v : ℂ) * + ((Fy (-(-n - v)) : ℂ) * star (γ (-(-n - v)))) = + ((Fy (v + n) : ℂ) / (Fx v : ℂ)) * ξ v * star (γ (v + n)) := by + have hi : -(-n - v) = v + n := by omega + rw [hi] + simp only [div_eq_mul_inv] + ring + simp_rw [heq] + exact weighted_shifted_products _ hratio ξ γ n + +theorem coefficient_sequences_le_one (Fx Fy : ℤ → ℝ) (ξ γ : Hilbert) (n : ℤ) + (hratio : ∀ v : ℤ, ‖(Fy (v + n) : ℂ) / (Fx v : ℂ)‖ ≤ 1) + (hξ : ‖ξ‖ ≤ 1) (hγ : ‖γ‖ ≤ 1) : + let A : ℤ → ℂ := fun v => ξ v / (Fx v : ℂ) + let B : ℤ → ℂ := fun v => (Fy (-v) : ℂ) * star (γ (-v)) + (Summable (fun v : ℤ => ‖A v * B (-n - v)‖)) ∧ + (∑' v : ℤ, ‖A v * B (-n - v)‖) ≤ 1 := by + have h := coefficient_sequences Fx Fy ξ γ n hratio + refine ⟨h.1, h.2.trans ?_⟩ + simpa only [one_mul] using mul_le_mul hξ hγ (norm_nonneg γ) zero_le_one + +end Invariant233.ConvolutionAbsoluteBound + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionContradiction.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionContradiction.lean new file mode 100644 index 0000000000000000000000000000000000000000..89ff571feb8fab0acd5d58960145ea4635326b0c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionContradiction.lean @@ -0,0 +1,68 @@ +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Tactic + +namespace OAI + +namespace Invariant233.ConvolutionContradiction + +theorem sqrt_exp_attenuation (L : ℝ) : + Real.sqrt (Real.exp (-L / 400)) = Real.exp (-L / 800) := by + rw [← Real.exp_half] + congr 1 + ring + +theorem tail_attenuation_le (L : ℝ) (hL : 0 ≤ L) : + Real.exp (-L) + 2 * Real.sqrt (Real.exp (-L / 400)) ≤ + 3 * Real.exp (-L / 10000) := by + rw [sqrt_exp_attenuation] + have h₁ : Real.exp (-L) ≤ Real.exp (-L / 10000) := + Real.exp_le_exp.mpr (by linarith) + have h₂ : Real.exp (-L / 800) ≤ Real.exp (-L / 10000) := + Real.exp_le_exp.mpr (by linarith) + linarith + +theorem coefficient_tail_le (K : ℕ) (L ε j : ℝ) (hL : 0 ≤ L) + (hchoice : (2 * (K : ℝ) + 1) * 3 * Real.exp (-L / 10000) ≤ ε / j) : + (2 * (K : ℝ) + 1) * + (Real.exp (-L) + 2 * Real.sqrt (Real.exp (-L / 400))) ≤ ε / j := by + calc + _ ≤ (2 * (K : ℝ) + 1) * (3 * Real.exp (-L / 10000)) := + mul_le_mul_of_nonneg_left (tail_attenuation_le L hL) (by positivity) + _ = (2 * (K : ℝ) + 1) * 3 * Real.exp (-L / 10000) := by ring + _ ≤ ε / j := hchoice + +theorem fixed_stage_contradiction (c ε j : ℝ) (hε : 0 < ε) + (hstage : 1 / j < c) (hbound : c * ε ≤ ε / j) : False := by + have hstrict : ε / j < c * ε := by + calc + ε / j = (1 / j) * ε := by ring + _ < c * ε := mul_lt_mul_of_pos_right hstage hε + exact (not_lt_of_ge hbound) hstrict + +theorem not_eventually_small_error (c : ℝ) (ε : ℕ → ℝ) (hc : 0 < c) + (hε : ∀ᶠ j in Filter.atTop, 0 < ε j) : + ¬ ∀ᶠ j in Filter.atTop, c * ε j ≤ ε j / (j : ℝ) := by + intro hbound + have hstage : ∀ᶠ j : ℕ in Filter.atTop, 1 / (j : ℝ) < c := + (tendsto_one_div_atTop_nhds_zero_nat (𝕜 := ℝ)).eventually (gt_mem_nhds hc) + obtain ⟨j, hjε, hjstage, hjbound⟩ := + (hε.and (hstage.and hbound)).exists + exact fixed_stage_contradiction c (ε j) (j : ℝ) hjε hjstage hjbound + +theorem not_eventually_conditional_obstruction + (c : ℝ) (K : ℕ → ℕ) (L ε : ℕ → ℝ) (hc : 0 < c) + (hε : ∀ᶠ j in Filter.atTop, 0 < ε j) + (hL : ∀ᶠ j in Filter.atTop, 0 ≤ L j) + (hchoice : ∀ᶠ j in Filter.atTop, + (2 * (K j : ℝ) + 1) * 3 * Real.exp (-L j / 10000) ≤ ε j / (j : ℝ)) : + ¬ ∀ᶠ j in Filter.atTop, c * ε j ≤ (2 * (K j : ℝ) + 1) * + (Real.exp (-L j) + 2 * Real.sqrt (Real.exp (-L j / 400))) := by + intro hbound + apply not_eventually_small_error c ε hc hε + filter_upwards [hL, hchoice, hbound] with j hjL hjchoice hjbound + exact hjbound.trans (coefficient_tail_le (K j) (L j) (ε j) (j : ℝ) hjL hjchoice) + +end Invariant233.ConvolutionContradiction + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionIntegralLower.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionIntegralLower.lean new file mode 100644 index 0000000000000000000000000000000000000000..337caa16d5ddeb20b4ccb4721e1b76eb5bcbb36f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionIntegralLower.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FiniteConvolution + +namespace OAI + +open MeasureTheory + +namespace InvariantProjection.FiniteConvolution + +theorem sum_lower_of_coefficient_lower {K : ℕ} {ε : ℝ} + (a b : Coefficients K) + (h : ∃ n : Fin (2 * K + 1), ε ≤ ‖lowProduct a b n‖) : + ε ≤ ∑ n : Fin (2 * K + 1), ‖lowProduct a b n‖ := by + obtain ⟨n, hn⟩ := h + exact hn.trans (Finset.single_le_sum (fun i _ => norm_nonneg _) (Finset.mem_univ n)) + +theorem integral_lower_of_uniform_bound + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] + (K : ℕ) (D δ ε : ℝ) + (hcoeff : ∀ a b : Coefficients K, + (∀ i, ‖a i‖ ≤ D) → (∀ i, ‖b i‖ ≤ D) → + δ ≤ ‖a (center K)‖ → δ ≤ ‖b (center K)‖ → + ∃ n : Fin (2 * K + 1), ε ≤ ‖lowProduct a b n‖) + (E : Set Ω) (a b : Ω → Coefficients K) + (hint : IntegrableOn (fun ω => ∑ n : Fin (2 * K + 1), + ‖lowProduct (a ω) (b ω) n‖) E μ) + (hE : ∀ᵐ ω ∂μ.restrict E, + (∀ i, ‖a ω i‖ ≤ D) ∧ (∀ i, ‖b ω i‖ ≤ D) ∧ + δ ≤ ‖a ω (center K)‖ ∧ δ ≤ ‖b ω (center K)‖) : + ε * μ.real E ≤ ∫ ω in E, ∑ n : Fin (2 * K + 1), + ‖lowProduct (a ω) (b ω) n‖ ∂μ := by + have hpoint : ∀ᵐ ω ∂μ.restrict E, + ε ≤ ∑ n : Fin (2 * K + 1), ‖lowProduct (a ω) (b ω) n‖ := by + filter_upwards [hE] with ω hω + exact sum_lower_of_coefficient_lower (a ω) (b ω) + (hcoeff (a ω) (b ω) hω.1 hω.2.1 hω.2.2.1 hω.2.2.2) + have h := integral_mono_ae (integrable_const ε) hint hpoint + simpa only [setIntegral_const, smul_eq_mul, mul_comm] using h + +theorem uniform_integral_lower_bound + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] + (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) : + ∃ ε > 0, ∀ (E : Set Ω) (a b : Ω → Coefficients K), + IntegrableOn (fun ω => ∑ n : Fin (2 * K + 1), + ‖lowProduct (a ω) (b ω) n‖) E μ → + (∀ᵐ ω ∂μ.restrict E, + (∀ i, ‖a ω i‖ ≤ D) ∧ (∀ i, ‖b ω i‖ ≤ D) ∧ + δ ≤ ‖a ω (center K)‖ ∧ δ ≤ ‖b ω (center K)‖) → + ε * μ.real E ≤ ∫ ω in E, ∑ n : Fin (2 * K + 1), + ‖lowProduct (a ω) (b ω) n‖ ∂μ := by + obtain ⟨ε, hε, hcoeff⟩ := uniform_lower_bound K D δ hδ + exact ⟨ε, hε, fun E a b hi hE => + integral_lower_of_uniform_bound μ K D δ ε hcoeff E a b hi hE⟩ + +end InvariantProjection.FiniteConvolution + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionRatios.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionRatios.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f7a48799ad81864a8917d1228db26631f26b2ed --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionRatios.lean @@ -0,0 +1,75 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Tactic + +namespace OAI + +open scoped ComplexConjugate ENNReal lp + +namespace InvariantProjection + +theorem cocycle_two_ratio_bounds + (Fx Fy : ℤ → ℝ) (hFx : ∀ k, 0 < Fx k) (hFy : ∀ k, 0 < Fy k) + (hx : Antitone Fx) (hy : Antitone Fy) + (hxy : ∀ k, Fy k / Fx k ≤ 1) (n : ℕ) (v : ℤ) : + 0 < Fy ((n : ℤ) + v) / Fx v ∧ + Fy ((n : ℤ) + v) / Fx v ≤ min (Fy v / Fx v) + (Fy ((n : ℤ) + v) / Fx ((n : ℤ) + v)) ∧ + min (Fy v / Fx v) (Fy ((n : ℤ) + v) / Fx ((n : ℤ) + v)) ≤ 1 := by + have hv : v ≤ (n : ℤ) + v := by omega + refine ⟨div_pos (hFy _) (hFx _), le_min ?_ ?_, (min_le_left _ _).trans (hxy v)⟩ + · exact div_le_div_of_nonneg_right (hy hv) (le_of_lt (hFx v)) + · exact div_le_div_of_nonneg_left (le_of_lt (hFy _)) (hFx _) (hx hv) + +theorem l2_reindexed_absolute_products (ξ γ : ℓ²(ℤ, ℂ)) (e : ℤ ≃ ℤ) : + (Summable fun v : ℤ => ‖ξ v‖ * ‖γ (e v)‖) ∧ + (∑' v : ℤ, ‖ξ v‖ * ‖γ (e v)‖) ≤ ‖ξ‖ * ‖γ‖ := by + let γe : ℓ²(ℤ, ℂ) := ⟨fun v => γ (e v), by + apply memℓp_gen + exact e.summable_iff.mpr ((lp.memℓp γ).summable (by norm_num))⟩ + have hnorm : ‖γe‖ = ‖γ‖ := by + rw [lp.norm_eq_tsum_rpow (by norm_num), lp.norm_eq_tsum_rpow (by norm_num)] + congr 1 + exact e.tsum_eq (fun v => ‖γ v‖ ^ (2 : ℝ≥0∞).toReal) + simpa only [hnorm] using lp.tsum_mul_le_mul_norm + (p := 2) (q := 2) (by simpa using Real.HolderConjugate.two_two) ξ γe + +theorem l2_reindexed_multiplier_bound (ξ γ : ℓ²(ℤ, ℂ)) (e : ℤ ≃ ℤ) + (r : ℤ → ℝ) (hr : ∀ v, 0 ≤ r v ∧ r v ≤ 1) : + (Summable fun v : ℤ => ‖(r v : ℂ) * ξ v * conj (γ (e v))‖) ∧ + (∑' v : ℤ, ‖(r v : ℂ) * ξ v * conj (γ (e v))‖) ≤ ‖ξ‖ * ‖γ‖ := by + have hbase := l2_reindexed_absolute_products ξ γ e + have hbound (v : ℤ) : + ‖(r v : ℂ) * ξ v * conj (γ (e v))‖ ≤ ‖ξ v‖ * ‖γ (e v)‖ := by + simp only [norm_mul, Complex.norm_conj, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (hr v).1] + calc + r v * ‖ξ v‖ * ‖γ (e v)‖ ≤ 1 * ‖ξ v‖ * ‖γ (e v)‖ := by gcongr; exact (hr v).2 + _ = _ := by ring + have hs := Summable.of_nonneg_of_le (fun v => norm_nonneg _) hbound hbase.1 + exact ⟨hs, (Summable.tsum_le_tsum hbound hs hbase.1).trans hbase.2⟩ + +theorem cocycle_convolution_absolute + (Fx Fy : ℤ → ℝ) (hFx : ∀ k, 0 < Fx k) (hFy : ∀ k, 0 < Fy k) + (hx : Antitone Fx) (hy : Antitone Fy) + (hxy : ∀ k, Fy k / Fx k ≤ 1) (n : ℕ) (ξ γ : ℓ²(ℤ, ℂ)) : + (Summable fun v : ℤ => + ‖((Fy ((n : ℤ) + v) / Fx v : ℝ) : ℂ) * ξ v * conj (γ ((n : ℤ) + v))‖) ∧ + (∑' v : ℤ, + ‖((Fy ((n : ℤ) + v) / Fx v : ℝ) : ℂ) * ξ v * conj (γ ((n : ℤ) + v))‖) + ≤ ‖ξ‖ * ‖γ‖ := by + apply l2_reindexed_multiplier_bound ξ γ (Equiv.addLeft (n : ℤ)) + (fun v => Fy ((n : ℤ) + v) / Fx v) + intro v + have h := cocycle_two_ratio_bounds Fx Fy hFx hFy hx hy hxy n v + exact ⟨h.1.le, h.2.1.trans h.2.2⟩ + +theorem convolution_coefficient_factorization + (Fx Fy : ℤ → ℝ) (ξ γ : ℤ → ℂ) (n v : ℤ) : + (ξ v / (Fx v : ℂ)) * ((Fy (n + v) : ℂ) * conj (γ (n + v))) = + ((Fy (n + v) / Fx v : ℝ) : ℂ) * ξ v * conj (γ (n + v)) := by + push_cast + ring + +end InvariantProjection + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionUniformConstant.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionUniformConstant.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea316856f7c7a10472043ddf4c37de41ba371d66 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ConvolutionUniformConstant.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ConditionalConvolution + +namespace OAI + +open MeasureTheory + +namespace InvariantProjection.ConditionalConvolution + +theorem Data.obstruction_of_coefficient_bound + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {K : ℕ} {D a c η δ ε : ℝ} (d : Data Ω μ K D a c η δ) + (hε : 0 ≤ ε) + (hcoeff : ∀ A B : ℤ → ℂ, + (∀ v : ℤ, |v| ≤ (K : ℤ) → ‖A v‖ ≤ D) → + (∀ v : ℤ, |v| ≤ (K : ℤ) → ‖B v‖ ≤ D) → + a ≤ ‖A 0‖ → a ≤ ‖B 0‖ → + ∃ n : ℕ, n ≤ 2 * K ∧ ε ≤ ‖truncated K n A B‖) + (hη : 0 ≤ η) (hδ : 0 ≤ δ) : + c * ε ≤ ((2 * K + 1 : ℕ) : ℝ) * (η + 2 * Real.sqrt δ) := by + have hsum : ∀ A B : ℤ → ℂ, + (∀ v : ℤ, |v| ≤ (K : ℤ) → ‖A v‖ ≤ D) → + (∀ v : ℤ, |v| ≤ (K : ℤ) → ‖B v‖ ≤ D) → + a ≤ ‖A 0‖ → a ≤ ‖B 0‖ → + ε ≤ ∑ n ∈ Finset.range (2 * K + 1), ‖truncated K n A B‖ := by + intro A B hA hB hA0 hB0 + obtain ⟨n, hn, hnc⟩ := hcoeff A B hA hB hA0 hB0 + have hnmem : n ∈ Finset.range (2 * K + 1) := + Finset.mem_range.mpr (Nat.lt_succ_iff.mpr hn) + exact hnc.trans (Finset.single_le_sum + (fun k (_ : k ∈ Finset.range (2 * K + 1)) => norm_nonneg (truncated K k A B)) hnmem) + exact d.obstruction_of_pointwise hε hsum hη hδ + (fun n hn => d.pointwise_truncated_bound n hn hη) + +theorem uniform_coefficient_and_conditional_bound + (K : ℕ) (D a : ℝ) (ha : 0 < a) : + ∃ ε > 0, + (∀ A B : ℤ → ℂ, + (∀ v : ℤ, |v| ≤ (K : ℤ) → ‖A v‖ ≤ D) → + (∀ v : ℤ, |v| ≤ (K : ℤ) → ‖B v‖ ≤ D) → + a ≤ ‖A 0‖ → a ≤ ‖B 0‖ → + ∃ n : ℕ, n ≤ 2 * K ∧ ε ≤ ‖truncated K n A B‖) ∧ + (∀ {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + [IsProbabilityMeasure μ] (c η δ : ℝ), + 0 ≤ η → 0 ≤ δ → ∀ _ : Data Ω μ K D a c η δ, + c * ε ≤ ((2 * K + 1 : ℕ) : ℝ) * (η + 2 * Real.sqrt δ)) := by + obtain ⟨ε, hε, hcoeff⟩ := + Invariant233.FiniteWindow.uniform_convolution_lower_bound K D a ha + refine ⟨ε, hε, hcoeff, ?_⟩ + intro Ω mΩ μ hμ c η δ hη hδ d + exact d.obstruction_of_coefficient_bound hε.le hcoeff hη hδ + +end InvariantProjection.ConditionalConvolution + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/CountableFiberAtoms.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/CountableFiberAtoms.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b86f2cb82ba61e86d7529db76a327cc13fbde93 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/CountableFiberAtoms.lean @@ -0,0 +1,153 @@ +import Mathlib + +namespace OAI + +open Set Filter MeasureTheory + +namespace InvariantProjection.CountableFiberAtoms + +variable {X Y : Type*} [MeasurableSpace X] +variable {μ : Measure X} {f : X → Y} {C : Set Y} + +theorem ae_fiber_measure_ne_zero (hC : C.Countable) + (hf : ∀ᵐ x ∂μ, f x ∈ C) : + ∀ᵐ x ∂μ, μ (f ⁻¹' {f x}) ≠ 0 := by + have havoid : ∀ᵐ x ∂μ, ∀ y ∈ C, μ (f ⁻¹' {y}) = 0 → f x ≠ y := by + apply (ae_ball_iff hC).2 + intro y hy + by_cases hz : μ (f ⁻¹' {y}) = 0 + · filter_upwards [measure_eq_zero_iff_ae_notMem.1 hz] with x hx + intro _ + simpa using hx + · exact Filter.Eventually.of_forall (fun _ h => (hz h).elim) + filter_upwards [hf, havoid] with x hx havoid + intro hz + exact havoid (f x) hx hz rfl + +theorem ae_mem_positive_fiber_union (hC : C.Countable) + (hf : ∀ᵐ x ∂μ, f x ∈ C) : + ∀ᵐ x ∂μ, x ∈ ⋃ y ∈ {y ∈ C | μ (f ⁻¹' {y}) ≠ 0}, f ⁻¹' {y} := by + filter_upwards [hf, ae_fiber_measure_ne_zero hC hf] with x hx hpos + exact Set.mem_iUnion.2 ⟨f x, Set.mem_iUnion.2 ⟨⟨hx, hpos⟩, rfl⟩⟩ + +omit [MeasurableSpace X] in + +theorem pairwise_disjoint_fibers (f : X → Y) : + Pairwise (fun y z => Disjoint (f ⁻¹' {y}) (f ⁻¹' {z})) := by + intro y z hyz + rw [Set.disjoint_left] + intro x hxy hxz + exact hyz (hxy.symm.trans hxz) + +theorem exists_nontrivial_fiber [IsProbabilityMeasure μ] + (hC : C.Countable) (hf : ∀ᵐ x ∂μ, f x ∈ C) + (hnonconstant : ¬ ∃ y : Y, f =ᵐ[μ] fun _ => y) : + ∃ y ∈ C, μ (f ⁻¹' {y}) ≠ 0 ∧ μ (f ⁻¹' {y})ᶜ ≠ 0 := by + obtain ⟨x, hxC, hx⟩ := (hf.and (ae_fiber_measure_ne_zero hC hf)).exists + refine ⟨f x, hxC, hx, ?_⟩ + intro hnull + apply hnonconstant + refine ⟨f x, ?_⟩ + filter_upwards [measure_eq_zero_iff_ae_notMem.1 hnull] with z hz + simpa only [Set.mem_compl_iff, not_not, Set.mem_preimage, + Set.mem_singleton_iff] using hz + + +variable [mY : MeasurableSpace Y] [MeasurableSingletonClass Y] + +omit [MeasurableSpace X] in + +theorem measurableAtom_comap (f : X → Y) (x : X) : + @measurableAtom X (mY.comap f) x = f ⁻¹' {f x} := by + apply Set.Subset.antisymm + · exact @measurableAtom_subset X (mY.comap f) (f ⁻¹' {f x}) x + ⟨{f x}, measurableSet_singleton _, rfl⟩ rfl + · intro z hz + simp only [measurableAtom, Set.mem_iInter] + intro s hx hs + obtain ⟨t, ht, rfl⟩ := hs + change f z ∈ t + change f x ∈ t at hx + change f z = f x at hz + simpa [hz] using hx + +omit [MeasurableSpace X] [MeasurableSingletonClass Y] in + +theorem fiber_subset_or_disjoint {s : Set X} + (hs : MeasurableSet[mY.comap f] s) (y : Y) : + f ⁻¹' {y} ⊆ s ∨ Disjoint (f ⁻¹' {y}) s := by + obtain ⟨t, ht, rfl⟩ := hs + by_cases hy : y ∈ t + · left + intro x hx + change f x ∈ t + change f x = y at hx + simpa [hx] using hy + · right + rw [Set.disjoint_left] + intro x hx hxt + change f x = y at hx + exact hy (hx ▸ hxt) + +omit [MeasurableSingletonClass Y] in + +theorem exists_positive_fiber_subset (hC : C.Countable) + (hf : ∀ᵐ x ∂μ, f x ∈ C) {s : Set X} + (hs : MeasurableSet[mY.comap f] s) (hμs : μ s ≠ 0) : + ∃ y ∈ C, μ (f ⁻¹' {y}) ≠ 0 ∧ f ⁻¹' {y} ⊆ s := by + have hfreq : ∃ᵐ x ∂μ, x ∈ s := frequently_ae_mem_iff.2 hμs + obtain ⟨x, hxs, hxC, hxpos⟩ := + (hfreq.and_eventually (hf.and (ae_fiber_measure_ne_zero hC hf))).exists + refine ⟨f x, hxC, hxpos, ?_⟩ + rcases fiber_subset_or_disjoint hs (f x) with hsub | hdisj + · exact hsub + · exact (Set.disjoint_left.1 hdisj rfl hxs).elim + +theorem ae_measurableAtom_comap_measure_ne_zero (hC : C.Countable) + (hf : ∀ᵐ x ∂μ, f x ∈ C) : + ∀ᵐ x ∂μ, μ (@measurableAtom X (mY.comap f) x) ≠ 0 := by + simpa only [measurableAtom_comap] using ae_fiber_measure_ne_zero hC hf + +theorem map_eq_sum_dirac (hC : C.Countable) (hf : Measurable f) + (hmem : ∀ᵐ x ∂μ, f x ∈ C) : + μ.map f = Measure.sum (fun y : C => μ (f ⁻¹' {y.val}) • Measure.dirac y.val) := by + apply Measure.ext + intro s hs + rw [Measure.map_apply hf hs, Measure.sum_apply _ hs] + calc + μ (f ⁻¹' s) = μ ((f ⁻¹' C) ∩ (f ⁻¹' s)) := by + apply measure_congr + filter_upwards [hmem] with x hx + change (f x ∈ s) = (f x ∈ C ∧ f x ∈ s) + simp only [hx, true_and] + _ = (μ.restrict (f ⁻¹' s)) (f ⁻¹' C) := + (Measure.restrict_apply (hf hC.measurableSet)).symm + _ = ∑' y : C, (μ.restrict (f ⁻¹' s)) (f ⁻¹' {y.val}) := + (tsum_measure_preimage_singleton hC (fun y _ => hf (measurableSet_singleton y))).symm + _ = ∑' y : C, (μ (f ⁻¹' {y.val}) • Measure.dirac y.val) s := by + apply tsum_congr + intro y + rw [Measure.restrict_apply (hf (measurableSet_singleton _)), + Measure.smul_apply, Measure.dirac_apply' _ hs] + by_cases hy : y.val ∈ s + · rw [Set.indicator_of_mem hy] + simp only [Pi.one_apply, smul_eq_mul, mul_one] + apply congrArg μ + apply Set.inter_eq_left.2 + intro x hx + change f x = y.val at hx + change f x ∈ s + simpa [hx] using hy + · rw [Set.indicator_of_notMem hy] + simp only [smul_eq_mul, mul_zero] + have hdisj : Disjoint (f ⁻¹' {y.val}) (f ⁻¹' s) := by + rw [Set.disjoint_left] + intro x hx hxs + change f x = y.val at hx + exact hy (hx ▸ hxs) + rw [Set.disjoint_iff_inter_eq_empty.1 hdisj, measure_empty] + + +end InvariantProjection.CountableFiberAtoms + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/CountableGraphTransfer.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/CountableGraphTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca7aaafd264e05e24a2c7baab5b4ff3270b8379c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/CountableGraphTransfer.lean @@ -0,0 +1,39 @@ +import Mathlib.MeasureTheory.Measure.AbsolutelyContinuous +import Mathlib.MeasureTheory.Measure.Map +import Mathlib.MeasureTheory.MeasurableSpace.Constructions + +namespace OAI + +open MeasureTheory + +namespace Invariant233.Fields + +variable {X Y Ω ι : Type*} [MeasurableSpace X] [MeasurableSpace Ω] + [Countable ι] {μ : Measure X} {ν : Measure Ω} + +theorem ae_relation_of_countable_graphs + (P : X → Y → Prop) (t : ι → X → Y) (x : Ω → X) (y : Ω → Y) + (hx : AEMeasurable x ν) (hμ : ν.map x ≪ μ) + (hgraph : ∀ i, ∀ᵐ z ∂μ, P z (t i z)) + (hsupport : ∀ᵐ ω ∂ν, ∃ i, y ω = t i (x ω)) : + ∀ᵐ ω ∂ν, P (x ω) (y ω) := by + have hcommon : ∀ᵐ z ∂μ, ∀ i, P z (t i z) := ae_all_iff.mpr hgraph + have hpull : ∀ᵐ ω ∂ν, ∀ i, P (x ω) (t i (x ω)) := + ae_of_ae_map hx (hμ.ae_le hcommon) + filter_upwards [hpull, hsupport] with ω hω hωsupport + obtain ⟨i, hi⟩ := hωsupport + rw [hi] + exact hω i + +theorem ae_pair_relation_of_countable_graphs [MeasurableSpace Y] + {β : Measure (X × Y)} (P : X → Y → Prop) (t : ι → X → Y) + (hμ : β.map Prod.fst ≪ μ) + (hgraph : ∀ i, ∀ᵐ z ∂μ, P z (t i z)) + (hsupport : ∀ᵐ z ∂β, ∃ i, z.2 = t i z.1) : + ∀ᵐ z ∂β, P z.1 z.2 := + ae_relation_of_countable_graphs P t Prod.fst Prod.snd + measurable_fst.aemeasurable hμ hgraph hsupport + +end Invariant233.Fields + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/CrossingAvoidance.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/CrossingAvoidance.lean new file mode 100644 index 0000000000000000000000000000000000000000..c32d8cf21cdc22b9da6ddbd8e1543a724472db79 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/CrossingAvoidance.lean @@ -0,0 +1,131 @@ +import Mathlib.Probability.Independence.Basic +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.MeasureTheory.Measure.Real +import Mathlib.Tactic + +namespace OAI + +open MeasureTheory ProbabilityTheory +open scoped BigOperators + +namespace Invariant233.CrossingAvoidance + +variable {ι Ω : Type*} [MeasurableSpace Ω] + +theorem measureReal_avoid_eq_prod (μ : Measure Ω) [IsProbabilityMeasure μ] + (events : ι → Set Ω) (hind : iIndepSet events μ) + (hmeas : ∀ i, MeasurableSet (events i)) (s : Finset ι) : + μ.real (⋂ i ∈ s, (events i)ᶜ) = ∏ i ∈ s, (1 - μ.real (events i)) := by + have hprod : μ (⋂ i ∈ s, (events i)ᶜ) = ∏ i ∈ s, μ ((events i)ᶜ) := by + apply (iIndepSet_iff events μ).mp hind s + intro i hi + exact (MeasurableSpace.measurableSet_generateFrom (by simp)).compl + change (μ (⋂ i ∈ s, (events i)ᶜ)).toReal = _ + rw [hprod, ENNReal.toReal_prod] + congr 1 + funext i + change μ.real ((events i)ᶜ) = _ + rw [measureReal_compl (hmeas i), probReal_univ] + +theorem measureReal_avoid_le_exp (μ : Measure Ω) [IsProbabilityMeasure μ] + (events : ι → Set Ω) (hind : iIndepSet events μ) + (hmeas : ∀ i, MeasurableSet (events i)) (s : Finset ι) (p : ℝ) + (hp : ∀ i ∈ s, p ≤ μ.real (events i)) : + μ.real (⋂ i ∈ s, (events i)ᶜ) ≤ Real.exp (-(s.card : ℝ) * p) := by + rw [measureReal_avoid_eq_prod μ events hind hmeas s] + calc + ∏ i ∈ s, (1 - μ.real (events i)) ≤ ∏ _i ∈ s, Real.exp (-p) := by + apply Finset.prod_le_prod₀ + · intro i hi + rw [← probReal_univ (μ := μ)] + exact sub_nonneg.mpr (measureReal_mono (Set.subset_univ _)) + · intro i hi + exact (sub_le_sub_left (hp i hi) 1).trans (Real.one_sub_le_exp_neg p) + _ = Real.exp (-(s.card : ℝ) * p) := by + rw [← Real.exp_sum] + congr 1 + simp + +theorem measureReal_le_exp_of_subset_avoid (μ : Measure Ω) [IsProbabilityMeasure μ] + (events : ι → Set Ω) (hind : iIndepSet events μ) + (hmeas : ∀ i, MeasurableSet (events i)) (s : Finset ι) (p : ℝ) + (hp : ∀ i ∈ s, p ≤ μ.real (events i)) (bad : Set Ω) + (hbad : bad ⊆ ⋂ i ∈ s, (events i)ᶜ) : + μ.real bad ≤ Real.exp (-(s.card : ℝ) * p) := + (measureReal_mono hbad).trans (measureReal_avoid_le_exp μ events hind hmeas s p hp) + +theorem exp_card_bound (s : Finset ι) (m ρ : ℝ) (hρ : 0 ≤ ρ) + (hcard : m / 40 ≤ (s.card : ℝ)) : + Real.exp (-(s.card : ℝ) * (ρ / 10)) ≤ Real.exp (-m * ρ / 400) := by + apply Real.exp_le_exp.mpr + have h := mul_le_mul_of_nonneg_right hcard hρ + nlinarith + +theorem measureReal_le_exp_four_hundred (μ : Measure Ω) [IsProbabilityMeasure μ] + (events : ι → Set Ω) (hind : iIndepSet events μ) + (hmeas : ∀ i, MeasurableSet (events i)) (s : Finset ι) (m ρ : ℝ) + (hρ : 0 ≤ ρ) (hcard : m / 40 ≤ (s.card : ℝ)) + (hp : ∀ i ∈ s, ρ / 10 ≤ μ.real (events i)) (bad : Set Ω) + (hbad : bad ⊆ ⋂ i ∈ s, (events i)ᶜ) : + μ.real bad ≤ Real.exp (-m * ρ / 400) := + (measureReal_le_exp_of_subset_avoid μ events hind hmeas s (ρ / 10) hp bad hbad).trans + (exp_card_bound s m ρ hρ hcard) + +theorem measureReal_le_exp_intensity (μ : Measure Ω) [IsProbabilityMeasure μ] + (events : ι → Set Ω) (hind : iIndepSet events μ) + (hmeas : ∀ i, MeasurableSet (events i)) (s : Finset ι) (m ρ L : ℝ) + (hρ : 0 ≤ ρ) (hcard : m / 40 ≤ (s.card : ℝ)) (hL : L ≤ m * ρ) + (hp : ∀ i ∈ s, ρ / 10 ≤ μ.real (events i)) (bad : Set Ω) + (hbad : bad ⊆ ⋂ i ∈ s, (events i)ᶜ) : + μ.real bad ≤ Real.exp (-L / 400) := by + refine (measureReal_le_exp_four_hundred μ events hind hmeas s m ρ hρ hcard hp bad hbad).trans ?_ + apply Real.exp_le_exp.mpr + linarith + + +variable {α : Type*} [LinearOrder α] (s : Finset ι) (x y u : ι → α) + +theorem below_iff_of_no_crossing + (horder : ∀ i ∈ s, x i ≤ y i) + (hno : ∀ i ∈ s, ¬ (x i < u i ∧ u i ≤ y i)) : + ∀ i ∈ s, x i < u i ↔ y i < u i := by + intro i hi + constructor + · intro hxu + exact lt_of_not_ge (fun huy => hno i hi ⟨hxu, huy⟩) + · intro hyu + exact lt_of_le_of_lt (horder i hi) hyu + +theorem below_card_add_above_card + (horder : ∀ i ∈ s, x i ≤ y i) + (hno : ∀ i ∈ s, ¬ (x i < u i ∧ u i ≤ y i)) : + (s.filter (fun i => x i < u i)).card + + (s.filter (fun i => u i ≤ y i)).card = s.card := by + classical + have heq : s.filter (fun i => u i ≤ y i) = s.filter (fun i => ¬ x i < u i) := by + apply Finset.filter_congr + intro i hi + rw [below_iff_of_no_crossing s x y u horder hno i hi, not_lt] + rw [heq] + exact Finset.card_filter_add_card_filter_not _ + +theorem above_half_of_below_not_half + (horder : ∀ i ∈ s, x i ≤ y i) + (hno : ∀ i ∈ s, ¬ (x i < u i ∧ u i ≤ y i)) + (hsmall : ¬ s.card ≤ 2 * (s.filter (fun i => x i < u i)).card) : + s.card ≤ 2 * (s.filter (fun i => u i ≤ y i)).card := by + classical + have hsum := below_card_add_above_card s x y u horder hno + omega + +theorem eligible_card_lower_bound (eligible : Finset ι) (m : ℝ) + (hcandidates : m / 20 ≤ (s.card : ℝ)) + (heligible : s.card ≤ 2 * eligible.card) : + m / 40 ≤ (eligible.card : ℝ) := by + have hcast : (s.card : ℝ) ≤ 2 * (eligible.card : ℝ) := by exact_mod_cast heligible + linarith + + +end Invariant233.CrossingAvoidance + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/DensityMeasureConvergence.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/DensityMeasureConvergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..02f3040a5d1fe2b6964d116eaf579aa6113cb95e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/DensityMeasureConvergence.lean @@ -0,0 +1,78 @@ +import Mathlib + +namespace OAI + +open MeasureTheory Filter Set BoundedContinuousFunction +open scoped Topology ENNReal + +namespace Invariant233.GraphMeasureConvergence + +variable {X : Type*} [TopologicalSpace X] [MeasurableSpace X] [BorelSpace X] + +theorem tendsto_of_density_L1 + (μ : FiniteMeasure X) (ν : ℕ → FiniteMeasure X) (ρ : ℕ → X → ℝ) + (hρ : ∀ n, Integrable (ρ n) (μ : Measure X)) + (hnonneg : ∀ n, 0 ≤ᵐ[(μ : Measure X)] ρ n) + (hν : ∀ n, (ν n : Measure X) = + (μ : Measure X).withDensity (fun x => ENNReal.ofReal (ρ n x))) + (hL1 : Tendsto (fun n => ∫ x, ‖ρ n x - 1‖ ∂(μ : Measure X)) atTop (𝓝 0)) : + Tendsto ν atTop (𝓝 μ) := by + apply FiniteMeasure.tendsto_of_forall_integral_tendsto + intro f + have heq (n : ℕ) : (∫ x, f x ∂(ν n : Measure X)) - + (∫ x, f x ∂(μ : Measure X)) = + ∫ x, (ρ n x - 1) * f x ∂(μ : Measure X) := by + rw [hν n, integral_withDensity_eq_integral_toReal_smul₀ + (hρ n).aestronglyMeasurable.aemeasurable.ennreal_ofReal + (Eventually.of_forall fun _ => ENNReal.ofReal_lt_top)] + have hprod : Integrable (fun x => ρ n x * f x) (μ : Measure X) := + (hρ n).mul_bdd f.continuous.measurable.aestronglyMeasurable + (Eventually.of_forall fun x => f.norm_coe_le_norm x) + have hi : (∫ x, (ENNReal.ofReal (ρ n x)).toReal • f x ∂(μ : Measure X)) = + ∫ x, ρ n x * f x ∂(μ : Measure X) := by + apply integral_congr_ae + filter_upwards [hnonneg n] with x hx + simp only [ENNReal.toReal_ofReal hx, smul_eq_mul] + rw [hi, ← integral_sub hprod (f.integrable _)] + congr 1 + funext x + ring + have hbound (n : ℕ) : + ‖(∫ x, f x ∂(ν n : Measure X)) - (∫ x, f x ∂(μ : Measure X))‖ ≤ + (∫ x, ‖ρ n x - 1‖ ∂(μ : Measure X)) * ‖f‖ := by + rw [heq] + calc + ‖∫ x, (ρ n x - 1) * f x ∂(μ : Measure X)‖ ≤ + ∫ x, ‖ρ n x - 1‖ * ‖f‖ ∂(μ : Measure X) := by + apply norm_integral_le_of_norm_le (((hρ n).sub (integrable_const 1)).norm.mul_const ‖f‖) + exact Eventually.of_forall fun x => by + rw [norm_mul] + exact mul_le_mul_of_nonneg_left (f.norm_coe_le_norm x) (norm_nonneg _) + _ = (∫ x, ‖ρ n x - 1‖ ∂(μ : Measure X)) * ‖f‖ := integral_mul_const _ _ + have hdiff := squeeze_zero_norm hbound (by simpa only [zero_mul] using hL1.mul_const ‖f‖) + have hsum := hdiff.add (tendsto_const_nhds (x := ∫ x, f x ∂(μ : Measure X))) + simpa only [sub_add_cancel, zero_add] using hsum + +theorem tendsto_of_density_L2 + (μ : FiniteMeasure X) [IsProbabilityMeasure (μ : Measure X)] + (ν : ℕ → FiniteMeasure X) (ρ : ℕ → X → ℝ) + (hρ : ∀ n, MemLp (ρ n) 2 (μ : Measure X)) + (hnonneg : ∀ n, 0 ≤ᵐ[(μ : Measure X)] ρ n) + (hν : ∀ n, (ν n : Measure X) = + (μ : Measure X).withDensity (fun x => ENNReal.ofReal (ρ n x))) + (hL2 : Tendsto (fun n => eLpNorm (fun x => ρ n x - 1) 2 (μ : Measure X)) + atTop (𝓝 0)) : Tendsto ν atTop (𝓝 μ) := by + apply tendsto_of_density_L1 μ ν ρ (fun n => (hρ n).integrable (by norm_num)) hnonneg hν + have he (n : ℕ) : MemLp (fun x => ρ n x - 1) 2 (μ : Measure X) := + (hρ n).sub (memLp_const 1) + apply squeeze_zero (fun _ => integral_nonneg fun _ => norm_nonneg _) + (fun n => ?_) (by simpa only [ENNReal.toReal_zero] using + (ENNReal.tendsto_toReal ENNReal.zero_ne_top).comp hL2) + rw [integral_norm_eq_lintegral_enorm (he n).aestronglyMeasurable, + ← eLpNorm_one_eq_lintegral_enorm (he n).aestronglyMeasurable] + exact ENNReal.toReal_mono (he n).eLpNorm_ne_top + (eLpNorm_le_eLpNorm_of_exponent_le (by norm_num)) + +end Invariant233.GraphMeasureConvergence + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/DensityTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/DensityTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7f452471316f04a6971055e07aedc32c4553e4a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/DensityTransport.lean @@ -0,0 +1,86 @@ +import Mathlib.MeasureTheory.Measure.WithDensity +import Mathlib.MeasureTheory.Integral.Lebesgue.Map +import Mathlib.MeasureTheory.Function.LpSeminorm.Basic +import Mathlib.Tactic + +namespace OAI + +open MeasureTheory +open scoped ENNReal + +namespace Invariant233.DensityTransport + +variable {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {μ : Measure X} {ν : Measure Y} {F : X → Y} {G : Y → X} + +theorem map_inverse_eq (hF : Measurable F) (hG : Measurable G) + (hmap : μ.map F = ν) (hinv : ∀ᵐ x ∂μ, G (F x) = x) : ν.map G = μ := by + rw [← hmap, Measure.map_map hG hF] + calc + μ.map (G ∘ F) = μ.map id := Measure.map_congr hinv + _ = μ := Measure.map_id + +theorem map_withDensity_eq (hF : Measurable F) (hG : Measurable G) + (hmap : μ.map F = ν) (hinv : ∀ᵐ x ∂μ, G (F x) = x) + {h : X → ℝ≥0∞} (hh : Measurable h) : + (μ.withDensity h).map F = ν.withDensity (h ∘ G) := by + ext s hs + rw [Measure.map_apply hF hs, withDensity_apply _ (hF hs), withDensity_apply _ hs, + ← hmap, Measure.restrict_map hF hs, + lintegral_map' (hh.comp hG).aemeasurable hF.aemeasurable] + apply lintegral_congr_ae + filter_upwards [ae_restrict_of_ae hinv] with x hx + simp only [Function.comp_apply, hx] + +theorem eLpNorm_comp_inverse {E : Type*} [NormedAddCommGroup E] + (hF : Measurable F) (hG : Measurable G) + (hmap : μ.map F = ν) (hinv : ∀ᵐ x ∂μ, G (F x) = x) + {h : X → E} (hh : AEStronglyMeasurable h μ) (p : ℝ≥0∞) : + eLpNorm (h ∘ G) p ν = eLpNorm h p μ := by + exact eLpNorm_comp_measurePreserving hh + ⟨hG, map_inverse_eq hF hG hmap hinv⟩ + +theorem real_density_transport (hF : Measurable F) (hG : Measurable G) + (hmap : μ.map F = ν) (hinv : ∀ᵐ x ∂μ, G (F x) = x) + {h : X → ℝ} (hh : Measurable h) : + (μ.withDensity (fun x => ENNReal.ofReal (h x))).map F = + ν.withDensity (fun y => ENNReal.ofReal (h (G y))) ∧ + eLpNorm (h ∘ G) 2 ν = eLpNorm h 2 μ := by + constructor + · exact map_withDensity_eq hF hG hmap hinv hh.ennreal_ofReal + · exact eLpNorm_comp_inverse hF hG hmap hinv hh.aestronglyMeasurable 2 + +theorem real_density_transport_ae (hF : Measurable F) (hG : Measurable G) + (hmap : μ.map F = ν) (hinv : ∀ᵐ x ∂μ, G (F x) = x) + {h : X → ℝ} (hh : AEMeasurable h μ) : + (μ.withDensity (fun x => ENNReal.ofReal (h x))).map F = + ν.withDensity (fun y => ENNReal.ofReal (h (G y))) ∧ + eLpNorm (h ∘ G) 2 ν = eLpNorm h 2 μ := by + have hback : ν.map G = μ := map_inverse_eq hF hG hmap hinv + have ht : Filter.Tendsto G (ae ν) (ae μ) := by + rw [← hback] + exact Measure.tendsto_ae_map hG.aemeasurable + have heq : h =ᵐ[μ] hh.mk h := hh.ae_eq_mk + have heqG : h ∘ G =ᵐ[ν] hh.mk h ∘ G := heq.comp_tendsto ht + obtain ⟨hweighted, hnorm⟩ := real_density_transport hF hG hmap hinv hh.measurable_mk + constructor + · have hx : μ.withDensity (fun x => ENNReal.ofReal (h x)) = + μ.withDensity (fun x => ENNReal.ofReal (hh.mk h x)) := by + apply withDensity_congr_ae + filter_upwards [heq] with x hx + rw [hx] + have hy : ν.withDensity (fun y => ENNReal.ofReal (h (G y))) = + ν.withDensity (fun y => ENNReal.ofReal (hh.mk h (G y))) := by + apply withDensity_congr_ae + filter_upwards [heqG] with y hy + exact congrArg ENNReal.ofReal hy + rw [hx, hy] + exact hweighted + · calc + eLpNorm (h ∘ G) 2 ν = eLpNorm (hh.mk h ∘ G) 2 ν := eLpNorm_congr_ae heqG + _ = eLpNorm (hh.mk h) 2 μ := hnorm + _ = eLpNorm h 2 μ := (eLpNorm_congr_ae heq).symm + +end Invariant233.DensityTransport + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/DiffuseFromSmallPartitions.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/DiffuseFromSmallPartitions.lean new file mode 100644 index 0000000000000000000000000000000000000000..cdd7ab7e45139e70998b661f4d049ebc67eced9e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/DiffuseFromSmallPartitions.lean @@ -0,0 +1,99 @@ +import OAI.Analysis.IrrationalRotation.Operators.ProjectionMeetTrace + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Invariant233 +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem projectionAtom_mul_eq_zero_of_trace_lt + (M : VonNeumannAlgebra H) (ξ : H) + (htrace : ∀ a b : H →L[ℂ] H, a ∈ M → b ∈ M → + vectorTrace ξ (a * b) = vectorTrace ξ (b * a)) + (p q : Submodule ℂ H) [CompleteSpace p] [CompleteSpace q] + (hp : IsProjectionAtom M p.starProjection) (hq : q.starProjection ∈ M) + (hlt : (vectorTrace ξ q.starProjection).re < (vectorTrace ξ p.starProjection).re) : + q.starProjection * p.starProjection = 0 := by + have hqorth : qᗮ.starProjection ∈ M := by + simpa only [Submodule.starProjection_orthogonal, ContinuousLinearMap.one_def] using + sub_mem (one_mem M) hq + have hr := ProjectionMeetTrace.meet_projection_mem M p qᗮ hp.1 hqorth + have hRp : (p ⊓ qᗮ).starProjection * p.starProjection = (p ⊓ qᗮ).starProjection := + Submodule.starProjection_comp_starProjection_of_le inf_le_left + rcases hp.2.2.2 (p ⊓ qᗮ).starProjection hr isStarProjection_starProjection hRp with hzero | heq + · have hb := ProjectionMeetTrace.vectorTrace_meet_lower_bound M ξ htrace p qᗮ hp.1 hqorth + have hc : (vectorTrace ξ qᗮ.starProjection).re = + ‖ξ‖ ^ 2 - (vectorTrace ξ q.starProjection).re := by + rw [TracialProjectionTransport.vectorTrace_projection_orthogonal] + simp only [Complex.sub_re] + norm_cast + rw [hc, hzero] at hb + simp only [vectorTrace, zero_apply, inner_zero_right, Complex.zero_re] at hb + change (inner ℂ ξ (q.starProjection ξ)).re < (inner ℂ ξ (p.starProjection ξ)).re at hlt + linarith + · have hpq : p ≤ qᗮ := by + intro x hx + have hfix := p.starProjection_eq_self_iff.mpr hx + rw [← heq] at hfix + exact ((p ⊓ qᗮ).starProjection_eq_self_iff.mp hfix).2 + ext x + exact q.starProjection_apply_eq_zero_iff.mpr (hpq (p.starProjection_apply_mem x)) + +theorem isDiffuse_of_small_trace_separating_families + (M : VonNeumannAlgebra H) (ξ : H) (hξ : IsFaithfulTracialVector M ξ) + (hpart : ∀ ε : ℝ, 0 < ε → ∃ (n : ℕ) (Q : Fin n → H →L[ℂ] H), + (∀ i, Q i ∈ M) ∧ (∀ i, IsStarProjection (Q i)) ∧ + (∀ i, (vectorTrace ξ (Q i)).re < ε) ∧ + (∀ v : H, (∀ i, Q i v = 0) → v = 0)) : + IsDiffuseVonNeumannAlgebra M := by + intro P hP + obtain ⟨hproj, hPeq⟩ := isStarProjection_iff_eq_starProjection_range.mp hP.2.1 + let := hproj + let : CompleteSpace P.range := (ContinuousLinearMap.IsIdempotentElem.isClosed_range hP.2.1.isIdempotentElem).completeSpace_coe + have hPpos : P.IsPositive := by + apply ContinuousLinearMap.nonneg_iff_isPositive.mp + simpa only [hP.2.1.isSelfAdjoint.star_eq, hP.2.1.isIdempotentElem.eq] using + star_mul_self_nonneg P + have hnonneg : 0 ≤ (vectorTrace ξ P).re := hPpos.re_inner_nonneg_right ξ + have hmass : 0 < (vectorTrace ξ P).re := by + by_contra hn + have hzre : (vectorTrace ξ P).re = 0 := le_antisymm (le_of_not_gt hn) hnonneg + have hz : vectorTrace ξ P = 0 := by + rw [hPeq, TracialProjectionTransport.vectorTrace_projection] at hzre ⊢ + exact_mod_cast hzre + exact hP.2.2.1 (hξ.2.2 P hP.1 hPpos hz) + obtain ⟨n, Q, hQmem, hQproj, hQmass, hQsep⟩ := hpart _ hmass + have hzero (i : Fin n) : Q i * P = 0 := by + obtain ⟨hqproj, hQeq⟩ := isStarProjection_iff_eq_starProjection_range.mp (hQproj i) + let := hqproj + let : CompleteSpace (Q i).range := (ContinuousLinearMap.IsIdempotentElem.isClosed_range (hQproj i).isIdempotentElem).completeSpace_coe + rw [hPeq, hQeq] + apply projectionAtom_mul_eq_zero_of_trace_lt M ξ hξ.2.1 P.range (Q i).range + · simpa only [← hPeq] using hP + · simpa only [← hQeq] using hQmem i + · simpa only [← hPeq, ← hQeq] using hQmass i + apply hP.2.2.1 + ext v + apply hQsep + intro i + exact congrArg (fun A : H →L[ℂ] H => A v) (hzero i) + +theorem isDiffuse_of_small_trace_partitions + (M : VonNeumannAlgebra H) (ξ : H) (hξ : IsFaithfulTracialVector M ξ) + (hpart : ∀ ε : ℝ, 0 < ε → ∃ (n : ℕ) (Q : Fin n → H →L[ℂ] H), + (∀ i, Q i ∈ M) ∧ (∀ i, IsStarProjection (Q i)) ∧ + (∀ i, (vectorTrace ξ (Q i)).re < ε) ∧ ∑ i, Q i = 1) : + IsDiffuseVonNeumannAlgebra M := by + apply isDiffuse_of_small_trace_separating_families M ξ hξ + intro ε hε + obtain ⟨n, Q, hmem, hproj, hmass, hsum⟩ := hpart ε hε + refine ⟨n, Q, hmem, hproj, hmass, ?_⟩ + intro v hv + have h := congrArg (fun A : H →L[ℂ] H => A v) hsum + simpa only [sum_apply, hv, Finset.sum_const_zero, one_apply_eq_self] using h.symm +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/DisjointBumpSupports.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/DisjointBumpSupports.lean new file mode 100644 index 0000000000000000000000000000000000000000..884a5cff4ada2b542292afddb618479ec537bf9e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/DisjointBumpSupports.lean @@ -0,0 +1,56 @@ +import Mathlib + +namespace OAI + +open Set Filter MeasureTheory +open scoped Topology ENNReal + +namespace Invariant233.BackgroundConstruction + +variable {X ι : Type*} [TopologicalSpace X] [T2Space X] + +theorem exists_open_pairwise_disjoint_images [Finite ι] + (F : ι → X → X) (hF : ∀ i, Continuous (F i)) (x₀ : X) + (hdistinct : Function.Injective (fun i => F i x₀)) : + ∃ V : Set X, IsOpen V ∧ x₀ ∈ V ∧ Pairwise (fun i j => Disjoint (F i '' V) (F j '' V)) := by + classical + obtain ⟨U, hU, hdisj⟩ := (Set.finite_range (fun i => F i x₀)).t2_separation + let V : Set X := ⋂ i, F i ⁻¹' U (F i x₀) + have hVo : IsOpen V := isOpen_iInter_of_finite fun i => (hU _).2.preimage (hF i) + have hx : x₀ ∈ V := Set.mem_iInter.mpr fun i => (hU _).1 + refine ⟨V, hVo, hx, ?_⟩ + intro i j hij + have hsub (k : ι) : F k '' V ⊆ U (F k x₀) := by + rintro _ ⟨x, hx, rfl⟩ + exact Set.mem_iInter.mp hx k + exact (hdisj (Set.mem_range_self i) (Set.mem_range_self j) + (fun h => hij (hdistinct h))).mono (hsub i) (hsub j) + +theorem exists_small_bump_pairwise_disjoint_images [Finite ι] [LocallyCompactSpace X] + [MeasurableSpace X] (μ : Measure X) [μ.OuterRegular] + (F : ι → X → X) (hF : ∀ i, Continuous (F i)) (x₀ : X) + (hdistinct : Function.Injective (fun i => F i x₀)) (hzero : μ {x₀} = 0) + (O : Set X) (hOo : IsOpen O) (hxO : x₀ ∈ O) + (ε : ℝ≥0∞) (hε : 0 < ε) : + ∃ v : C(X, ℝ), v x₀ = 1 ∧ (∀ x, v x ∈ Set.Icc 0 1) ∧ + IsCompact (tsupport v) ∧ tsupport v ⊆ O ∧ μ (tsupport v) < ε ∧ + Pairwise (fun i j => Disjoint (F i '' tsupport v) (F j '' tsupport v)) := by + obtain ⟨V, hVo, hxV, hdisj⟩ := exists_open_pairwise_disjoint_images F hF x₀ hdistinct + obtain ⟨U, hxU, hUo, hUμ⟩ := + Set.exists_isOpen_lt_of_lt (μ := μ) ({x₀} : Set X) ε (by rwa [hzero]) + have hx : x₀ ∈ V ∩ U ∩ O := ⟨⟨hxV, hxU (by simp)⟩, hxO⟩ + obtain ⟨v, hv1, hvcompact, hvsub, hvrange⟩ := + exists_continuousMap_one_of_isCompact_subset_isOpen isCompact_singleton + ((hVo.inter hUo).inter hOo) (Set.singleton_subset_iff.mpr hx) + refine ⟨v, ?_, hvrange, hvcompact, ?_, ?_, ?_⟩ + · exact hv1 (Set.mem_singleton x₀) + · exact hvsub.trans Set.inter_subset_right + · exact (measure_mono (hvsub.trans (Set.inter_subset_left.trans Set.inter_subset_right))).trans_lt hUμ + · intro i j hij + exact (hdisj hij).mono + (Set.image_mono (hvsub.trans (Set.inter_subset_left.trans Set.inter_subset_left))) + (Set.image_mono (hvsub.trans (Set.inter_subset_left.trans Set.inter_subset_left))) + +end Invariant233.BackgroundConstruction + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/DominatedL2Density.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/DominatedL2Density.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce7b8fbf29df5a6ab8e35def6592c37e3076358b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/DominatedL2Density.lean @@ -0,0 +1,107 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductSampling +import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym +import Mathlib.MeasureTheory.Function.LpSpace.Basic +import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal + +namespace Invariant233.TailTrimming + +theorem exists_dominated_l2_density {X : Type*} [MeasurableSpace X] + {μ ν : Measure X} [IsFiniteMeasure μ] + (f : Lp ℝ 2 μ) (hf : ∀ᵐ x ∂μ, 0 ≤ f x) + (hν : ν ≤ μ.withDensity (fun x => ENNReal.ofReal (f x))) : + ∃ g : Lp ℝ 2 μ, + (∀ᵐ x ∂μ, 0 ≤ g x ∧ g x ≤ f x) ∧ + ν = μ.withDensity (fun x => ENNReal.ofReal (g x)) ∧ ‖g‖ ≤ ‖f‖ := by + have : IsFiniteMeasure (μ.withDensity (fun x => ENNReal.ofReal (f x))) := + isFiniteMeasure_withDensity_ofReal ((Lp.memLp f).integrable (by norm_num)).2 + have : IsFiniteMeasure ν := isFiniteMeasure_of_le _ hν + have hac : ν ≪ μ := hν.absolutelyContinuous.trans (withDensity_absolutelyContinuous _ _) + have hbound : ν.rnDeriv μ ≤ᵐ[μ] (fun x => ENNReal.ofReal (f x)) := by + apply ae_le_of_forall_setLIntegral_le_of_sigmaFinite (Measure.measurable_rnDeriv ν μ) + intro s hs _hfinite + exact (Measure.setLIntegral_rnDeriv_le s).trans + ((hν s).trans_eq (withDensity_apply _ hs)) + let d : X → ℝ := fun x => (ν.rnDeriv μ x).toReal + have hd0 (x : X) : 0 ≤ d x := ENNReal.toReal_nonneg + have hdmeas : AEStronglyMeasurable d μ := + (Measure.measurable_rnDeriv ν μ).ennreal_toReal.aestronglyMeasurable + have hdle : ∀ᵐ x ∂μ, d x ≤ f x := by + filter_upwards [hbound, hf] with x hx hx0 + have h := ENNReal.toReal_mono ENNReal.ofReal_ne_top hx + simpa only [ENNReal.toReal_ofReal hx0] using h + have hd : MemLp d 2 μ := by + apply (Lp.memLp f).mono' hdmeas + filter_upwards [hdle] with x hx + simpa only [Real.norm_eq_abs, abs_of_nonneg (hd0 x)] using hx + let g : Lp ℝ 2 μ := hd.toLp d + have hgeq : (fun x => g x) =ᵐ[μ] d := hd.coeFn_toLp + refine ⟨g, ?_, ?_, ?_⟩ + · filter_upwards [hgeq, hdle] with x hx hxle + rw [hx] + exact ⟨ENNReal.toReal_nonneg, hxle⟩ + · calc + ν = μ.withDensity (ν.rnDeriv μ) := (Measure.withDensity_rnDeriv_eq ν μ hac).symm + _ = μ.withDensity (fun x => ENNReal.ofReal (g x)) := by + apply withDensity_congr_ae + filter_upwards [hgeq, hbound] with x hx hxb + rw [hx] + exact (ENNReal.ofReal_toReal (ne_top_of_le_ne_top ENNReal.ofReal_ne_top hxb)).symm + · apply Lp.norm_le_norm_of_ae_le + filter_upwards [hgeq, hdle, hf] with x hx hxle hx0 + rw [hx] + simpa only [Real.norm_eq_abs, abs_of_nonneg (hd0 x), + abs_of_nonneg hx0] using hxle + +end Invariant233.TailTrimming + +namespace Invariant233.ProductModel + +theorem HasUniformL2Marginals.isFiniteMeasure {η : ℕ → Measure EndpointPair} + (hη : HasUniformL2Marginals η) (l : ℕ) : IsFiniteMeasure (η l) := by + obtain ⟨H, hH, hη⟩ := hη + obtain ⟨f, g, hf0, hg0, hf, hg, hfH, hgH⟩ := hη l + have : IsFiniteMeasure (baseMeasure.withDensity (fun x => ENNReal.ofReal (f x))) := + isFiniteMeasure_withDensity_ofReal ((Lp.memLp f).integrable (by norm_num)).2 + have : IsFiniteMeasure ((η l).map Prod.fst) := by + rw [hf] + infer_instance + exact Measure.isFiniteMeasure_of_map measurable_fst.aemeasurable + +theorem HasUniformL2Marginals.mono {η ζ : ℕ → Measure EndpointPair} + (hη : HasUniformL2Marginals η) (hζ : ∀ l, ζ l ≤ η l) : + HasUniformL2Marginals ζ := by + obtain ⟨H, hH, hη⟩ := hη + refine ⟨H, hH, ?_⟩ + intro l + obtain ⟨f, g, hf0, hg0, hf, hg, hfH, hgH⟩ := hη l + have hfst : (ζ l).map Prod.fst ≤ + baseMeasure.withDensity (fun x => ENNReal.ofReal (f x)) := by + rw [← hf] + exact Measure.map_mono (hζ l) measurable_fst + have hsnd : (ζ l).map Prod.snd ≤ + baseMeasure.withDensity (fun x => ENNReal.ofReal (g x)) := by + rw [← hg] + exact Measure.map_mono (hζ l) measurable_snd + obtain ⟨f', hf'0, hf', hf'norm⟩ := + Invariant233.TailTrimming.exists_dominated_l2_density f hf0 hfst + obtain ⟨g', hg'0, hg', hg'norm⟩ := + Invariant233.TailTrimming.exists_dominated_l2_density g hg0 hsnd + exact ⟨f', g', hf'0.mono (fun _ h => h.1), hg'0.mono (fun _ h => h.1), + hf', hg', hf'norm.trans hfH, hg'norm.trans hgH⟩ + +theorem HasUniformL2Marginals.restrict {η : ℕ → Measure EndpointPair} + (hη : HasUniformL2Marginals η) (S : ℕ → Set EndpointPair) : + HasUniformL2Marginals (fun l => (η l).restrict (S l)) := + hη.mono (fun _ => Measure.restrict_le_self) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/EndpointIntervalBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/EndpointIntervalBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..f16b89cd601a2a1f8669b8deb88d655ae7628e37 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/EndpointIntervalBounds.lean @@ -0,0 +1,165 @@ +import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +import Mathlib.MeasureTheory.Measure.Real +import Mathlib.MeasureTheory.Measure.WithDensity +import Mathlib.Tactic + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal + +namespace InvariantRotation.EndpointIntervalBounds + +theorem withDensity_le_smul_of_ae_le {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) {f : Ω → ℝ≥0∞} {C : ℝ≥0∞} + (hf : ∀ᵐ x ∂μ, f x ≤ C) : μ.withDensity f ≤ C • μ := by + rw [← withDensity_const] + exact withDensity_mono hf + +theorem measureReal_le_mul_of_le_smul {Ω : Type*} [MeasurableSpace Ω] + {μ ν : Measure Ω} {C : ℝ} (hC : 0 ≤ C) + (hdom : ν ≤ ENNReal.ofReal C • μ) (A : Set Ω) (hA : μ A ≠ ∞) : + ν.real A ≤ C * μ.real A := by + have hb : ν A ≤ ENNReal.ofReal C * μ A := by + simpa only [Measure.smul_apply, smul_eq_mul] using hdom A + have hfinite : ENNReal.ofReal C * μ A ≠ ∞ := + ENNReal.mul_ne_top ENNReal.ofReal_ne_top hA + have hreal := ENNReal.toReal_mono hfinite hb + simpa only [measureReal_def, ENNReal.toReal_mul, ENNReal.toReal_ofReal hC] using hreal + +theorem intervalMeasure_lower_tail_le {d : ℝ} (hd : 0 ≤ d) : + (volume.restrict (Ico (0 : ℝ) 1)).real (Iic d) ≤ d := by + rw [measureReal_restrict_apply measurableSet_Iic] + calc + volume.real (Iic d ∩ Ico 0 1) ≤ volume.real (Icc 0 d) := + measureReal_mono (fun x hx => ⟨hx.2.1, hx.1⟩) (by simp) + _ = d := by rw [Real.volume_real_Icc_of_le hd]; ring + +theorem intervalMeasure_upper_tail_le {d : ℝ} (hd : 0 ≤ d) : + (volume.restrict (Ico (0 : ℝ) 1)).real (Ici (1 - d)) ≤ d := by + rw [measureReal_restrict_apply measurableSet_Ici] + calc + volume.real (Ici (1 - d) ∩ Ico 0 1) ≤ volume.real (Icc (1 - d) 1) := + measureReal_mono (fun x hx => ⟨hx.1, hx.2.2.le⟩) (by simp) + _ = d := by rw [Real.volume_real_Icc_of_le (by linarith)]; ring + +theorem lower_endpoint_loss_le {ν : Measure ℝ} {C d : ℝ} (hC : 0 ≤ C) (hd : 0 ≤ d) + (hdom : ν ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) : + ν.real (Iic d) ≤ C * d := by + refine (measureReal_le_mul_of_le_smul hC hdom (Iic d) ?_).trans + (mul_le_mul_of_nonneg_left (intervalMeasure_lower_tail_le hd) hC) + rw [Measure.restrict_apply measurableSet_Iic] + exact (measure_mono (show Iic d ∩ Ico (0 : ℝ) 1 ⊆ Ico 0 1 from inter_subset_right) + |>.trans_lt (by simp)).ne + +theorem upper_endpoint_loss_le {ν : Measure ℝ} {C d : ℝ} (hC : 0 ≤ C) (hd : 0 ≤ d) + (hdom : ν ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) : + ν.real (Ici (1 - d)) ≤ C * d := by + refine (measureReal_le_mul_of_le_smul hC hdom (Ici (1 - d)) ?_).trans + (mul_le_mul_of_nonneg_left (intervalMeasure_upper_tail_le hd) hC) + rw [Measure.restrict_apply measurableSet_Ici] + exact (measure_mono inter_subset_right |>.trans_lt (by simp)).ne + +theorem endpoint_function_lower_loss_le {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) {X : Ω → ℝ} (hX : Measurable X) {C d : ℝ} + (hC : 0 ≤ C) (hd : 0 ≤ d) + (hdom : μ.map X ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) : + μ.real {ω | X ω ≤ d} ≤ C * d := by + have h := lower_endpoint_loss_le hC hd hdom + have heq : X ⁻¹' Iic d = {ω | X ω ≤ d} := by ext ω; simp + simpa only [measureReal_def, Measure.map_apply hX measurableSet_Iic, heq] using h + +theorem endpoint_function_upper_loss_le {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) {X : Ω → ℝ} (hX : Measurable X) {C d : ℝ} + (hC : 0 ≤ C) (hd : 0 ≤ d) + (hdom : μ.map X ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) : + μ.real {ω | 1 - d ≤ X ω} ≤ C * d := by + have h := upper_endpoint_loss_le hC hd hdom + have heq : X ⁻¹' Ici (1 - d) = {ω | 1 - d ≤ X ω} := by ext ω; simp + simpa only [measureReal_def, Measure.map_apply hX measurableSet_Ici, heq] using h + +theorem endpoint_pair_loss_le {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) {X Y : Ω → ℝ} (hX : Measurable X) (hY : Measurable Y) + {C d : ℝ} (hC : 0 ≤ C) (hd : 0 ≤ d) + (hdomX : μ.map X ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) + (hdomY : μ.map Y ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) : + μ.real {ω | 1 - d ≤ X ω ∨ Y ω ≤ d} ≤ 2 * C * d := by + have hXb := endpoint_function_upper_loss_le μ hX hC hd hdomX + have hYb := endpoint_function_lower_loss_le μ hY hC hd hdomY + have h := (measureReal_union_le {ω | 1 - d ≤ X ω} {ω | Y ω ≤ d}).trans + (add_le_add hXb hYb) + have heq : {ω | 1 - d ≤ X ω} ∪ {ω | Y ω ≤ d} = + {ω | 1 - d ≤ X ω ∨ Y ω ≤ d} := by ext ω; simp + rw [heq] at h + linarith + +theorem measureReal_iUnion_le_tsum_budget {Ω ι : Type*} + [MeasurableSpace Ω] [Countable ι] (μ : Measure Ω) [IsFiniteMeasure μ] + (E : ι → Set Ω) {b : ι → ℝ} (hb : ∀ i, 0 ≤ b i) (hs : Summable b) + (hE : ∀ i, μ.real (E i) ≤ b i) : + μ.real (⋃ i, E i) ≤ ∑' i, b i := by + have hE' : ∀ i, μ (E i) ≤ ENNReal.ofReal (b i) := by + intro i + rw [← ENNReal.ofReal_toReal (measure_ne_top μ (E i))] + exact ENNReal.ofReal_le_ofReal (hE i) + have hbound : μ (⋃ i, E i) ≤ ENNReal.ofReal (∑' i, b i) := calc + _ ≤ ∑' i, μ (E i) := measure_iUnion_le E + _ ≤ ∑' i, ENNReal.ofReal (b i) := ENNReal.tsum_le_tsum hE' + _ = _ := (ENNReal.ofReal_tsum_of_nonneg hb hs).symm + have hreal := ENNReal.toReal_mono ENNReal.ofReal_ne_top hbound + simpa only [measureReal_def, ENNReal.toReal_ofReal (tsum_nonneg hb)] using hreal + +theorem countable_endpoint_pair_loss_le {Ω ι : Type*} + [MeasurableSpace Ω] [Countable ι] (μ : Measure Ω) [IsFiniteMeasure μ] + {X Y : ι → Ω → ℝ} (hX : ∀ i, Measurable (X i)) (hY : ∀ i, Measurable (Y i)) + {C : ℝ} {d : ι → ℝ} (hC : 0 ≤ C) (hd : ∀ i, 0 ≤ d i) (hs : Summable d) + (hdomX : ∀ i, μ.map (X i) ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) + (hdomY : ∀ i, μ.map (Y i) ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) : + μ.real (⋃ i, {ω | 1 - d i ≤ X i ω ∨ Y i ω ≤ d i}) ≤ 2 * C * ∑' i, d i := by + have h := measureReal_iUnion_le_tsum_budget μ + (fun i => {ω | 1 - d i ≤ X i ω ∨ Y i ω ≤ d i}) + (b := fun i => 2 * C * d i) (fun i => mul_nonneg (mul_nonneg (by norm_num) hC) (hd i)) (hs.mul_left (2 * C)) + (fun i => endpoint_pair_loss_le μ (hX i) (hY i) hC (hd i) (hdomX i) (hdomY i)) + simpa only [tsum_mul_left] using h + +theorem blocked_future_endpoint_loss_le {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) [IsFiniteMeasure μ] (m : ℕ → ℕ) (hm : ∀ s, 0 < m s) + {K : ℕ → ℝ} (hK : ∀ s, 0 < K s) (hs : Summable (fun s => 1 / K s)) + {X Y : (s : ℕ) → Fin (m s) → Ω → ℝ} + (hX : ∀ s i, Measurable (X s i)) (hY : ∀ s i, Measurable (Y s i)) + {C a W : ℝ} (hC : 0 ≤ C) (ha : 0 ≤ a) (hW : 0 ≤ W) + (hdomX : ∀ s i, μ.map (X s i) ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) + (hdomY : ∀ s i, μ.map (Y s i) ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) : + μ.real (⋃ s, ⋃ i : Fin (m s), + {ω | 1 - a * W / ((m s : ℝ) * K s) ≤ X s i ω ∨ + Y s i ω ≤ a * W / ((m s : ℝ) * K s)}) ≤ + (2 * C * a * W) * ∑' s, 1 / K s := by + let E : ℕ → Set Ω := fun s => ⋃ i : Fin (m s), + {ω | 1 - a * W / ((m s : ℝ) * K s) ≤ X s i ω ∨ + Y s i ω ≤ a * W / ((m s : ℝ) * K s)} + have hblock (s : ℕ) : μ.real (E s) ≤ (2 * C * a * W) * (1 / K s) := by + have hmR : (0 : ℝ) < m s := by exact_mod_cast hm s + have hd : 0 ≤ a * W / ((m s : ℝ) * K s) := + div_nonneg (mul_nonneg ha hW) (mul_nonneg hmR.le (hK s).le) + calc + μ.real (E s) ≤ ∑ i : Fin (m s), μ.real + {ω | 1 - a * W / ((m s : ℝ) * K s) ≤ X s i ω ∨ + Y s i ω ≤ a * W / ((m s : ℝ) * K s)} := + measureReal_iUnion_fintype_le _ + _ ≤ ∑ _i : Fin (m s), 2 * C * (a * W / ((m s : ℝ) * K s)) := by + apply Finset.sum_le_sum + intro i hi + exact endpoint_pair_loss_le μ (hX s i) (hY s i) hC hd (hdomX s i) (hdomY s i) + _ = (2 * C * a * W) * (1 / K s) := by + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + field_simp + have hcoef : 0 ≤ 2 * C * a * W := by positivity + have h := measureReal_iUnion_le_tsum_budget μ E + (b := fun s => (2 * C * a * W) * (1 / K s)) + (fun s => mul_nonneg hcoef (one_div_nonneg.mpr (hK s).le)) + (hs.mul_left (2 * C * a * W)) hblock + simpa only [E, tsum_mul_left] using h + +end InvariantRotation.EndpointIntervalBounds + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/EndpointKernelGeometry.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/EndpointKernelGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f181f15f447374e2d9e1b8e7f8b0e1260995848 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/EndpointKernelGeometry.lean @@ -0,0 +1,457 @@ +import OAI.Analysis.IrrationalRotation.Sampling.ScalarSampling +import OAI.Analysis.IrrationalRotation.Analysis.ScalarEndpointDensity + +namespace OAI + +open MeasureTheory Set + +namespace Invariant233.ScalarSampling + +theorem rawKernel_uncut_zero_of_nonpos {h x v : ℝ} (hh : 0 ≤ h) + (hx : x ≤ 0) (_hv : 0 ≤ v) : rawKernel h 0 x v = 0 := by + unfold rawKernel + split_ifs with hd + · apply Set.indicator_of_notMem + intro hmem + have hdelta : delta x ≤ 0 := (min_le_left _ _).trans hx + have : h * delta x ≤ 0 := mul_nonpos_of_nonneg_of_nonpos hh hdelta + linarith [hmem.1, hmem.2] + · rfl + +theorem uncut_endpoint_no_wrap {h s v : ℝ} (hh0 : 0 ≤ h) (hh1 : h ≤ 1) + (hs0 : 0 < s) (hs1 : s < 1) (hv0 : 0 < v) (hv1 : v < 1) : + circleKernel h 0 (s - v) v = rawKernel h 0 (s - v) v := by + unfold circleKernel + rw [Int.fract_eq_self.mpr ⟨hv0.le, hv1⟩] + by_cases hvs : v ≤ s + · rw [Int.fract_eq_self.mpr ⟨by linarith, by linarith⟩] + · have hsv : s < v := lt_of_not_ge hvs + rw [rawKernel_uncut_zero_of_nonpos (x := s - v) hh0 (by linarith) hv0.le] + have hfloor : ⌊s - v⌋ = -1 := by + apply Int.floor_eq_iff.mpr + norm_num + constructor <;> linarith + have hfract : Int.fract (s - v) = s - v + 1 := by + rw [Int.fract, hfloor] + norm_num + rw [hfract] + unfold rawKernel + split_ifs + · apply Set.indicator_of_notMem + intro hmem + have hdelta0 : 0 ≤ delta (s - v + 1) := by + apply delta_nonneg + constructor <;> linarith + have hdelta : delta (s - v + 1) ≤ v - s := by + unfold delta + exact (min_le_right _ _).trans (by linarith) + have hmul : h * delta (s - v + 1) ≤ delta (s - v + 1) := + (mul_le_mul_of_nonneg_right hh1 hdelta0).trans_eq (one_mul _) + linarith [hmem.2] + · rfl + +theorem rawKernel_le_uncut {h α s v : ℝ} (hh : 0 ≤ h) + (hs : s ∈ Icc (0 : ℝ) 1) : rawKernel h α s v ≤ rawKernel h 0 s v := by + have hd : 0 ≤ delta s := delta_nonneg hs + unfold rawKernel + rw [ite_eq_left hd] + split_ifs + · exact le_rfl + · exact Set.indicator_nonneg (fun _ _ => inv_nonneg.mpr (mul_nonneg hh hd)) _ + +theorem uncut_endpoint_left_formula {h s : ℝ} (hh0 : 0 < h) + (hs0 : 0 < s) (hs1 : s ≤ 1 / 2) (v : ℝ) : + rawKernel h 0 (s - v) v = + (Ioo 0 (h * s / (1 + h))).indicator (fun v => (h * (s - v))⁻¹) v := by + have hp : 0 < 1 + h := by linarith + have heq : v < h * (s - v) ↔ v < h * s / (1 + h) := by + rw [lt_div_iff₀ hp] + constructor <;> intro hineq <;> nlinarith + by_cases hv : 0 < v + · have hd : delta (s - v) = s - v := by + unfold delta + rw [min_eq_left (by linarith)] + unfold rawKernel + rw [hd] + by_cases hvs : v < h * s / (1 + h) + · have hvbound : v < s := by + have := heq.mpr hvs + nlinarith + simp only [ite_eq_left (show 0 ≤ s - v by linarith), Set.indicator_apply, mem_Ioo, + hv, heq.mpr hvs, hvs, and_self, ite_true] + · have hvnot : ¬ v < h * (s - v) := fun h => hvs (heq.mp h) + simp only [Set.indicator_apply, mem_Ioo, hv, hvnot, hvs, and_false, ite_false, + ite_self] + · unfold rawKernel + simp only [Set.indicator_apply, mem_Ioo, hv, false_and, ite_false, ite_self] + +theorem integral_uncut_endpoint_left {h s : ℝ} (hh0 : 0 < h) + (hs0 : 0 < s) (hs1 : s ≤ 1 / 2) : + (∫ v in (0 : ℝ)..1, rawKernel h 0 (s - v) v) = h⁻¹ * Real.log (1 + h) := by + have hp : 0 < 1 + h := by linarith + have hL0 : 0 < h * s / (1 + h) := div_pos (mul_pos hh0 hs0) hp + have hLs : h * s / (1 + h) < s := by + rw [div_lt_iff₀ hp] + nlinarith + have hL1 : h * s / (1 + h) < 1 := by linarith + have hfun : (fun v => rawKernel h 0 (s - v) v) = + (Ioo 0 (h * s / (1 + h))).indicator (fun v => (h * (s - v))⁻¹) := by + funext v + exact uncut_endpoint_left_formula hh0 hs0 hs1 v + rw [hfun, intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] + rw [setIntegral_eq_integral_of_forall_compl_eq_zero] + · rw [integral_indicator measurableSet_Ioo, ← integral_Ioc_eq_integral_Ioo, + ← intervalIntegral.integral_of_le hL0.le] + simp_rw [mul_inv] + rw [intervalIntegral.integral_const_mul, + intervalIntegral.integral_comp_sub_left (fun z : ℝ => z⁻¹) s] + simp only [sub_zero] + rw [integral_inv_of_pos (by linarith : 0 < s - h * s / (1 + h)) hs0] + have hratio : s / (s - h * s / (1 + h)) = 1 + h := by + field_simp + ring + rw [hratio] + · intro v hv + apply Set.indicator_of_notMem + intro hmem + exact hv ⟨hmem.1, hmem.2.le.trans hL1.le⟩ + +theorem averagedDensity_left_formula {h s : ℝ} (hh0 : 0 < h) (hs1 : s ≤ 1 / 2) : + ScalarEndpointDensity.averagedDensity h s = h⁻¹ * Real.log (1 + h) := by + have hp : 0 < 1 + h := by linarith + unfold ScalarEndpointDensity.averagedDensity + congr 1 + calc + _ = ∫ t in (0 : ℝ)..h, (1 + t)⁻¹ := by + apply intervalIntegral.integral_congr_Ioo_of_le hh0.le + intro t ht + simp only [ScalarEndpointDensity.slopeDensity, + ite_eq_left (show s ≤ ScalarEndpointDensity.midpoint t by + unfold ScalarEndpointDensity.midpoint + linarith [ht.1])] + _ = Real.log (1 + h) := by + rw [intervalIntegral.integral_comp_add_left (fun t : ℝ => t⁻¹) 1] + simp only [add_zero] + rw [integral_inv_of_pos (by norm_num : (0 : ℝ) < 1) hp] + simp + +theorem integral_uncut_circleEndpoint_left {h s : ℝ} (hh0 : 0 < h) (hh1 : h ≤ 1) + (hs0 : 0 < s) (hs1 : s ≤ 1 / 2) : + (∫ v in (0 : ℝ)..1, circleKernel h 0 (s - v) v) = + ScalarEndpointDensity.averagedDensity h s := by + rw [averagedDensity_left_formula hh0 hs1] + calc + _ = ∫ v in (0 : ℝ)..1, rawKernel h 0 (s - v) v := by + apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num) + intro v hv + exact uncut_endpoint_no_wrap hh0.le hh1 hs0 (by linarith) hv.1 hv.2 + _ = _ := integral_uncut_endpoint_left hh0 hs0 hs1 + +theorem uncut_endpoint_right_formula {h s : ℝ} (hh0 : 0 < h) (_hh1 : h < 1) + (hs0 : (1 + h) / 2 ≤ s) (hs1 : s < 1) (v : ℝ) : + rawKernel h 0 (s - v) v = + (Ioo 0 (h * (1 - s) / (1 - h))).indicator + (fun v => (h * (1 - s + v))⁻¹) v := by + have hp : 0 < 1 + h := by linarith + have hn : 0 < 1 - h := by linarith + have hR : h * (1 - s) / (1 - h) ≤ s - 1 / 2 := by + rw [div_le_iff₀ hn] + nlinarith + have hL : h * s / (1 + h) ≤ s - 1 / 2 := by + rw [div_le_iff₀ hp] + nlinarith + have heqR : v < h * (1 - s + v) ↔ v < h * (1 - s) / (1 - h) := by + rw [lt_div_iff₀ hn] + constructor <;> intro hh <;> nlinarith + have heqL : v < h * (s - v) ↔ v < h * s / (1 + h) := by + rw [lt_div_iff₀ hp] + constructor <;> intro hh <;> nlinarith + by_cases hv : 0 < v + · by_cases hvb : v ≤ s - 1 / 2 + · have hd : delta (s - v) = 1 - s + v := by + unfold delta + rw [min_eq_right (by linarith)] + ring + unfold rawKernel + rw [hd, ite_eq_left (by linarith)] + simp only [Set.indicator_apply, mem_Ioo, heqR] + · have hd : delta (s - v) = s - v := by + unfold delta + rw [min_eq_left (by linarith)] + have hvR : ¬v < h * (1 - s) / (1 - h) := by linarith + have hvL : ¬v < h * (s - v) := by + rw [heqL] + linarith + unfold rawKernel + rw [hd] + simp only [Set.indicator_apply, mem_Ioo, hvR, hvL, and_false, ite_false, ite_self] + · unfold rawKernel + simp only [Set.indicator_apply, mem_Ioo, hv, false_and, ite_false, ite_self] + +theorem integral_uncut_endpoint_right {h s : ℝ} (hh0 : 0 < h) (hh1 : h < 1) + (hs0 : (1 + h) / 2 ≤ s) (hs1 : s < 1) : + (∫ v in (0 : ℝ)..1, rawKernel h 0 (s - v) v) = + h⁻¹ * Real.log ((1 - h)⁻¹) := by + have hn : 0 < 1 - h := by linarith + have hR0 : 0 < h * (1 - s) / (1 - h) := div_pos (mul_pos hh0 (by linarith)) hn + have hR1 : h * (1 - s) / (1 - h) < 1 := by + rw [div_lt_iff₀ hn] + nlinarith + have hfun : (fun v => rawKernel h 0 (s - v) v) = + (Ioo 0 (h * (1 - s) / (1 - h))).indicator + (fun v => (h * (1 - s + v))⁻¹) := by + funext v + exact uncut_endpoint_right_formula hh0 hh1 hs0 hs1 v + rw [hfun, intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] + rw [setIntegral_eq_integral_of_forall_compl_eq_zero] + · rw [integral_indicator measurableSet_Ioo, ← integral_Ioc_eq_integral_Ioo, + ← intervalIntegral.integral_of_le hR0.le] + simp_rw [mul_inv] + rw [intervalIntegral.integral_const_mul, + intervalIntegral.integral_comp_add_left (fun z : ℝ => z⁻¹) (1 - s)] + simp only [add_zero] + rw [integral_inv_of_pos (by linarith : 0 < 1 - s) + (by linarith : 0 < 1 - s + h * (1 - s) / (1 - h))] + have hratio : (1 - s + h * (1 - s) / (1 - h)) / (1 - s) = (1 - h)⁻¹ := by + field_simp [ne_of_gt (show 0 < 1 - s by linarith), hn.ne'] + ring + rw [hratio] + · intro v hv + apply Set.indicator_of_notMem + intro hmem + exact hv ⟨hmem.1, hmem.2.le.trans hR1.le⟩ + +theorem averagedDensity_right_formula {h s : ℝ} (hh0 : 0 < h) (hh1 : h < 1) + (hs0 : (1 + h) / 2 ≤ s) : + ScalarEndpointDensity.averagedDensity h s = h⁻¹ * Real.log ((1 - h)⁻¹) := by + unfold ScalarEndpointDensity.averagedDensity + congr 1 + calc + _ = ∫ t in (0 : ℝ)..h, (1 - t)⁻¹ := by + apply intervalIntegral.integral_congr_Ioo_of_le hh0.le + intro t ht + simp only [ScalarEndpointDensity.slopeDensity, + ite_eq_right (show ¬s ≤ ScalarEndpointDensity.midpoint t by + unfold ScalarEndpointDensity.midpoint + linarith [ht.2])] + _ = Real.log ((1 - h)⁻¹) := by + rw [intervalIntegral.integral_comp_sub_left (fun t : ℝ => t⁻¹) 1] + simp only [sub_zero] + rw [integral_inv_of_pos (by linarith : 0 < 1 - h) (by norm_num : (0 : ℝ) < 1)] + simp only [one_div] + +theorem integral_uncut_circleEndpoint_right {h s : ℝ} (hh0 : 0 < h) (hh1 : h < 1) + (hs0 : (1 + h) / 2 ≤ s) (hs1 : s < 1) : + (∫ v in (0 : ℝ)..1, circleKernel h 0 (s - v) v) = + ScalarEndpointDensity.averagedDensity h s := by + rw [averagedDensity_right_formula hh0 hh1 hs0] + calc + _ = ∫ v in (0 : ℝ)..1, rawKernel h 0 (s - v) v := by + apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num) + intro v hv + exact uncut_endpoint_no_wrap hh0.le hh1.le (by linarith) hs1 hv.1 hv.2 + _ = _ := integral_uncut_endpoint_right hh0 hh1 hs0 hs1 + +theorem uncut_endpoint_middle_formula {h s : ℝ} (hh0 : 0 < h) (hh1 : h < 1) + (hs0 : 1 / 2 < s) (hs1 : s < (1 + h) / 2) (v : ℝ) : + rawKernel h 0 (s - v) v = + (Ioc 0 (s - 1 / 2)).indicator (fun v => (h * (1 - s + v))⁻¹) v + + (Ioo (s - 1 / 2) (h * s / (1 + h))).indicator + (fun v => (h * (s - v))⁻¹) v := by + have hp : 0 < 1 + h := by linarith + have hn : 0 < 1 - h := by linarith + have hsunit : s < 1 := by linarith + have hR : s - 1 / 2 < h * (1 - s) / (1 - h) := by + rw [lt_div_iff₀ hn] + nlinarith + have heqR : v < h * (1 - s + v) ↔ v < h * (1 - s) / (1 - h) := by + rw [lt_div_iff₀ hn] + constructor <;> intro hh <;> nlinarith + have heqL : v < h * (s - v) ↔ v < h * s / (1 + h) := by + rw [lt_div_iff₀ hp] + constructor <;> intro hh <;> nlinarith + by_cases hv : 0 < v + · by_cases hvb : v ≤ s - 1 / 2 + · have hd : delta (s - v) = 1 - s + v := by + unfold delta + rw [min_eq_right (by linarith)] + ring + have hvR : v < h * (1 - s + v) := heqR.mpr (lt_of_le_of_lt hvb hR) + have hvnot : ¬ s - 1 / 2 < v := not_lt_of_ge hvb + unfold rawKernel + rw [hd, ite_eq_left (by linarith)] + simp only [Set.indicator_apply, mem_Ioc, mem_Ioo, hv, hvb, hvR, hvnot, + and_self, false_and, ite_true, ite_false, add_zero] + · have hvb' : s - 1 / 2 < v := lt_of_not_ge hvb + have hd : delta (s - v) = s - v := by + unfold delta + rw [min_eq_left (by linarith)] + unfold rawKernel + rw [hd] + by_cases hvL : v < h * s / (1 + h) + · have hvs : v < s := by + have := heqL.mpr hvL + nlinarith + simp only [ite_eq_left (show 0 ≤ s - v by linarith), Set.indicator_apply, + mem_Ioc, mem_Ioo, hv, hvb, hvb', hvL, heqL.mpr hvL, + and_self, and_false, ite_true, ite_false, zero_add] + · have hvnot : ¬v < h * (s - v) := fun hh => hvL (heqL.mp hh) + simp only [Set.indicator_apply, mem_Ioc, mem_Ioo, hv, hvb, hvL, hvnot, + and_false, ite_false, ite_self, add_zero] + · have hvb : ¬s - 1 / 2 < v := by linarith + unfold rawKernel + simp only [Set.indicator_apply, mem_Ioc, mem_Ioo, hv, hvb, + false_and, ite_false, ite_self, add_zero] + +theorem integral_uncut_endpoint_middle {h s : ℝ} (hh0 : 0 < h) (hh1 : h < 1) + (hs0 : 1 / 2 < s) (hs1 : s < (1 + h) / 2) : + (∫ v in (0 : ℝ)..1, rawKernel h 0 (s - v) v) = + h⁻¹ * Real.log ((1 + h) / (4 * s * (1 - s))) := by + have hp : 0 < 1 + h := by linarith + have hspos : 0 < s := by linarith + have hsunit : s < 1 := by linarith + have hB0 : 0 < s - 1 / 2 := by linarith + have hL : s - 1 / 2 < h * s / (1 + h) := by + rw [lt_div_iff₀ hp] + nlinarith + have hLs : h * s / (1 + h) < s := by + rw [div_lt_iff₀ hp] + nlinarith + have hB1 : s - 1 / 2 < 1 := by linarith + have hL1 : h * s / (1 + h) < 1 := by linarith + let fR : ℝ → ℝ := (Ioc 0 (s - 1 / 2)).indicator (fun v => (h * (1 - s + v))⁻¹) + let fL : ℝ → ℝ := (Ioo (s - 1 / 2) (h * s / (1 + h))).indicator + (fun v => (h * (s - v))⁻¹) + have hfR : Integrable fR := by + apply IntegrableOn.integrable_indicator _ measurableSet_Ioc + apply IntegrableOn.mono_set _ Ioc_subset_Icc_self + apply ContinuousOn.integrableOn_Icc + apply ContinuousOn.inv₀ (by fun_prop) + intro v hv + exact ne_of_gt (mul_pos hh0 (by linarith [hv.1])) + have hfL : Integrable fL := by + apply IntegrableOn.integrable_indicator _ measurableSet_Ioo + apply IntegrableOn.mono_set _ Ioo_subset_Icc_self + apply ContinuousOn.integrableOn_Icc + apply ContinuousOn.inv₀ (by fun_prop) + intro v hv + exact ne_of_gt (mul_pos hh0 (by linarith [hv.2])) + have hfun : (fun v => rawKernel h 0 (s - v) v) = fun v => fR v + fL v := by + funext v + exact uncut_endpoint_middle_formula hh0 hh1 hs0 hs1 v + have hRint : (∫ v, fR v) = h⁻¹ * Real.log ((1 / 2) / (1 - s)) := by + dsimp only [fR] + rw [integral_indicator measurableSet_Ioc, ← intervalIntegral.integral_of_le hB0.le] + simp_rw [mul_inv] + rw [intervalIntegral.integral_const_mul, + intervalIntegral.integral_comp_add_left (fun z : ℝ => z⁻¹) (1 - s)] + have hb : 1 - s + (s - 1 / 2) = (1 / 2 : ℝ) := by ring + rw [hb] + simp only [add_zero] + rw [integral_inv_of_pos (by linarith : 0 < 1 - s) (by norm_num : (0 : ℝ) < 1 / 2)] + have hLint : (∫ v, fL v) = h⁻¹ * Real.log ((1 / 2) / (s - h * s / (1 + h))) := by + dsimp only [fL] + rw [integral_indicator measurableSet_Ioo, ← integral_Ioc_eq_integral_Ioo, + ← intervalIntegral.integral_of_le hL.le] + simp_rw [mul_inv] + rw [intervalIntegral.integral_const_mul, + intervalIntegral.integral_comp_sub_left (fun z : ℝ => z⁻¹) s] + have hb : s - (s - 1 / 2) = (1 / 2 : ℝ) := by ring + rw [hb, integral_inv_of_pos (by linarith : 0 < s - h * s / (1 + h)) + (by norm_num : (0 : ℝ) < 1 / 2)] + rw [hfun, intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] + rw [setIntegral_eq_integral_of_forall_compl_eq_zero] + · rw [integral_add hfR hfL, hRint, hLint, ← mul_add, + ← Real.log_mul (by positivity) (by positivity)] + congr 2 + field_simp [ne_of_gt (show 0 < 1 - s by linarith), hspos.ne', hp.ne'] + ring + · intro v hv + have hnotR : v ∉ Ioc 0 (s - 1 / 2) := + fun ht => hv ⟨ht.1, ht.2.trans hB1.le⟩ + have hnotL : v ∉ Ioo (s - 1 / 2) (h * s / (1 + h)) := + fun ht => hv ⟨lt_trans hB0 ht.1, ht.2.le.trans hL1.le⟩ + simp only [fR, fL, Set.indicator_of_notMem hnotR, Set.indicator_of_notMem hnotL, add_zero] + +theorem averagedDensity_middle_formula {h s : ℝ} (hh0 : 0 < h) (hh1 : h < 1) + (hs0 : 1 / 2 < s) (hs1 : s < (1 + h) / 2) : + ScalarEndpointDensity.averagedDensity h s = + h⁻¹ * Real.log ((1 + h) / (4 * s * (1 - s))) := by + have hp : 0 < 1 + h := by linarith + have hspos : 0 < s := by linarith + have hsunit : s < 1 := by linarith + have hC0 : 0 < 2 * s - 1 := by linarith + have hCh : 2 * s - 1 < h := by linarith + have hC1 : 2 * s - 1 < 1 := by linarith + have hd := ScalarEndpointDensity.slopeDensity_parameter_integrable hh0.le hh1 s + have hdl : IntervalIntegrable (fun t => ScalarEndpointDensity.slopeDensity t s) + volume 0 (2 * s - 1) := hd.mono_set (by + rw [uIcc_of_le hC0.le, uIcc_of_le hh0.le] + exact Icc_subset_Icc le_rfl hCh.le) + have hdr : IntervalIntegrable (fun t => ScalarEndpointDensity.slopeDensity t s) + volume (2 * s - 1) h := hd.mono_set (by + rw [uIcc_of_le hCh.le, uIcc_of_le hh0.le] + exact Icc_subset_Icc hC0.le le_rfl) + have hleft : (∫ t in (0 : ℝ)..(2 * s - 1), ScalarEndpointDensity.slopeDensity t s) = + Real.log (1 / (1 - (2 * s - 1))) := by + calc + _ = ∫ t in (0 : ℝ)..(2 * s - 1), (1 - t)⁻¹ := by + apply intervalIntegral.integral_congr_Ioo_of_le hC0.le + intro t ht + simp only [ScalarEndpointDensity.slopeDensity, + ite_eq_right (show ¬s ≤ ScalarEndpointDensity.midpoint t by + unfold ScalarEndpointDensity.midpoint + linarith [ht.2])] + _ = _ := by + rw [intervalIntegral.integral_comp_sub_left (fun t : ℝ => t⁻¹) 1] + simp only [sub_zero] + rw [integral_inv_of_pos (by linarith : 0 < 1 - (2 * s - 1)) + (by norm_num : (0 : ℝ) < 1)] + have hright : (∫ t in (2 * s - 1)..h, ScalarEndpointDensity.slopeDensity t s) = + Real.log ((1 + h) / (1 + (2 * s - 1))) := by + calc + _ = ∫ t in (2 * s - 1)..h, (1 + t)⁻¹ := by + apply intervalIntegral.integral_congr_Ioo_of_le hCh.le + intro t ht + simp only [ScalarEndpointDensity.slopeDensity, + ite_eq_left (show s ≤ ScalarEndpointDensity.midpoint t by + unfold ScalarEndpointDensity.midpoint + linarith [ht.1])] + _ = _ := by + rw [intervalIntegral.integral_comp_add_left (fun t : ℝ => t⁻¹) 1] + rw [integral_inv_of_pos (by linarith : 0 < 1 + (2 * s - 1)) hp] + unfold ScalarEndpointDensity.averagedDensity + rw [← intervalIntegral.integral_add_adjacent_intervals hdl hdr, hleft, hright, + ← Real.log_mul (by positivity) (by positivity)] + congr 2 + field_simp [hspos.ne', ne_of_gt (show 0 < 1 - s by linarith), + ne_of_gt (show 0 < 1 - (2 * s - 1) by linarith), + ne_of_gt (show 0 < 1 + (2 * s - 1) by linarith), + show (2 : ℝ) - s * 2 ≠ 0 by linarith] + ring + +theorem integral_uncut_circleEndpoint_middle {h s : ℝ} (hh0 : 0 < h) (hh1 : h < 1) + (hs0 : 1 / 2 < s) (hs1 : s < (1 + h) / 2) : + (∫ v in (0 : ℝ)..1, circleKernel h 0 (s - v) v) = + ScalarEndpointDensity.averagedDensity h s := by + rw [averagedDensity_middle_formula hh0 hh1 hs0 hs1] + calc + _ = ∫ v in (0 : ℝ)..1, rawKernel h 0 (s - v) v := by + apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num) + intro v hv + exact uncut_endpoint_no_wrap hh0.le hh1.le (by linarith) (by linarith) hv.1 hv.2 + _ = _ := integral_uncut_endpoint_middle hh0 hh1 hs0 hs1 + +theorem integral_uncut_circleEndpoint {h s : ℝ} (hh0 : 0 < h) (hh1 : h < 1) + (hs0 : 0 < s) (hs1 : s < 1) : + (∫ v in (0 : ℝ)..1, circleKernel h 0 (s - v) v) = + ScalarEndpointDensity.averagedDensity h s := by + by_cases hleft : s ≤ 1 / 2 + · exact integral_uncut_circleEndpoint_left hh0 hh1.le hs0 hleft + · by_cases hright : (1 + h) / 2 ≤ s + · exact integral_uncut_circleEndpoint_right hh0 hh1 hright hs1 + · exact integral_uncut_circleEndpoint_middle hh0 hh1 (lt_of_not_ge hleft) (lt_of_not_ge hright) + +end Invariant233.ScalarSampling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/EndpointLoss.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/EndpointLoss.lean new file mode 100644 index 0000000000000000000000000000000000000000..89b514172f4bfc54fd2ed8e7bd48d55fc673bbe5 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/EndpointLoss.lean @@ -0,0 +1,211 @@ +import Mathlib + +namespace OAI + +open Filter MeasureTheory Set +open scoped Topology RealInnerProductSpace + +namespace Invariant233.EndpointLoss + +variable {X : Type*} [MeasurableSpace X] + +theorem sqrt_integral_sq_eq_norm {μ : Measure X} (f : Lp ℝ 2 μ) : + Real.sqrt (∫ x, f x ^ 2 ∂μ) = ‖f‖ := by + have hs : (∫ x, f x ^ 2 ∂μ) = ‖f‖ ^ 2 := by + rw [← real_inner_self_eq_norm_sq f, L2.inner_def] + simp only [real_inner_self_eq_norm_sq, Real.norm_eq_abs, sq_abs] + rw [hs, Real.sqrt_sq (norm_nonneg f)] + +theorem sqrt_integral_sq_eq_toReal_eLpNorm {μ : Measure X} {h : X → ℝ} (hh : MemLp h 2 μ) : + Real.sqrt (∫ x, h x ^ 2 ∂μ) = (eLpNorm h 2 μ).toReal := by + rw [← Lp.norm_toLp h hh, ← sqrt_integral_sq_eq_norm] + congr 1 + apply integral_congr_ae + filter_upwards [hh.coeFn_toLp] with x hx + rw [hx] + +theorem tendsto_measure_sublevel_zero + (μ : Measure X) [IsFiniteMeasure μ] {r : X → ℝ} + (hr : Measurable r) (hpos : ∀ᵐ x ∂μ, 0 < r x) + {t : ℕ → ℝ} (ht_mono : Antitone t) + (ht_zero : Tendsto t atTop (𝓝 0)) : + Tendsto (fun n => μ {x | r x < t n}) atTop (𝓝 0) := by + let s : ℕ → Set X := fun n => {x | r x < t n} + have hs : ∀ n, MeasurableSet (s n) := fun n => measurableSet_lt hr measurable_const + have hm : Antitone s := by + intro n m hnm x hx + exact lt_of_lt_of_le hx (ht_mono hnm) + have hnull : μ (⋂ n, s n) = 0 := by + apply measure_mono_null (t := {x | ¬ 0 < r x}) + · intro x hx + simp only [mem_iInter, mem_ofPred_eq, s] at hx ⊢ + have hle : r x ≤ 0 := ge_of_tendsto' ht_zero (fun n => (hx n).le) + exact not_lt.mpr hle + · exact ae_iff.mp hpos + have hlim := tendsto_measure_iInter_atTop + (fun n => (hs n).nullMeasurableSet) hm ⟨0, measure_ne_top μ _⟩ + simpa only [hnull, Function.comp_def, s] using hlim + +theorem tendsto_measureReal_sublevel_zero + (μ : Measure X) [IsFiniteMeasure μ] {r : X → ℝ} + (hr : Measurable r) (hpos : ∀ᵐ x ∂μ, 0 < r x) + {t : ℕ → ℝ} (ht_mono : Antitone t) + (ht_zero : Tendsto t atTop (𝓝 0)) : + Tendsto (fun n => μ.real {x | r x < t n}) atTop (𝓝 0) := by + exact (ENNReal.tendsto_toReal ENNReal.zero_ne_top).comp + (tendsto_measure_sublevel_zero μ hr hpos ht_mono ht_zero) + +theorem tendsto_measureReal_reciprocal_sublevel_zero + (μ : Measure X) [IsFiniteMeasure μ] {r : X → ℝ} + (hr : Measurable r) (hpos : ∀ᵐ x ∂μ, 0 < r x) : + Tendsto (fun n : ℕ => μ.real {x | r x < 1 / ((n : ℝ) + 1)}) + atTop (𝓝 0) := by + apply tendsto_measureReal_sublevel_zero μ hr hpos + · intro n m hnm + exact one_div_le_one_div_of_le (by positivity) (by exact_mod_cast Nat.add_le_add_right hnm 1) + · exact tendsto_one_div_add_atTop_nhds_zero_nat + +theorem setIntegral_density_le_sqrt + (μ : Measure X) [IsFiniteMeasure μ] {h : X → ℝ} + (hh : MemLp h 2 μ) (h_nonneg : 0 ≤ᵐ[μ] h) + {s : Set X} (hs : MeasurableSet s) : + (∫ x in s, h x ∂μ) ≤ + Real.sqrt (∫ x, h x ^ 2 ∂μ) * Real.sqrt (μ.real s) := by + have hCS := integral_mul_le_Lp_mul_Lq_of_nonneg + Real.HolderConjugate.two_two h_nonneg + (show 0 ≤ᵐ[μ] s.indicator (fun _ : X => (1 : ℝ)) from + Filter.Eventually.of_forall (fun x => by + change 0 ≤ s.indicator (fun _ : X => (1 : ℝ)) x + by_cases hx : x ∈ s <;> simp [hx])) + (by simpa using hh) (by simpa using (MemLp.indicator hs (memLp_const (1 : ℝ)))) + have hmul : (fun x => h x * s.indicator (fun _ : X => (1 : ℝ)) x) = + s.indicator h := by + funext x + by_cases hx : x ∈ s <;> simp [hx] + have hpow : (fun x => (s.indicator (fun _ : X => (1 : ℝ)) x) ^ (2 : ℝ)) = + s.indicator (fun _ : X => (1 : ℝ)) := by + funext x + by_cases hx : x ∈ s <;> simp [hx] + rw [hmul, integral_indicator hs, hpow] at hCS + simp only [Real.rpow_two, ← Real.sqrt_eq_rpow] at hCS + have hmass : (∫ x, s.indicator (fun _ : X => (1 : ℝ)) x ∂μ) = μ.real s := by + rw [integral_indicator hs] + simp + simpa only [hmass] using hCS + +theorem withDensity_measureReal_le_sqrt + (μ : Measure X) [IsFiniteMeasure μ] {h : X → ℝ} + (hh : MemLp h 2 μ) (h_nonneg : 0 ≤ᵐ[μ] h) + {s : Set X} (hs : MeasurableSet s) : + (μ.withDensity (fun x => ENNReal.ofReal (h x))).real s ≤ + Real.sqrt (∫ x, h x ^ 2 ∂μ) * Real.sqrt (μ.real s) := by + rw [measureReal_def, withDensity_apply _ hs] + rw [← integral_eq_lintegral_of_nonneg_ae + (ae_restrict_of_ae h_nonneg) hh.aestronglyMeasurable.restrict] + exact setIntegral_density_le_sqrt μ hh h_nonneg hs + +theorem tendsto_measureReal_of_uniform_sqrt_bound + (μ : Measure X) (ν : ℕ → Measure X) (H : ℝ) {s : ℕ → Set X} + (hbound : ∀ n, (ν n).real (s n) ≤ H * Real.sqrt (μ.real (s n))) + (hzero : Tendsto (fun n => μ.real (s n)) atTop (𝓝 0)) : + Tendsto (fun n => (ν n).real (s n)) atTop (𝓝 0) := by + apply squeeze_zero (fun _ => measureReal_nonneg) hbound + simpa using tendsto_const_nhds.mul (Real.continuous_sqrt.continuousAt.tendsto.comp hzero) + +theorem tendsto_measureReal_one_div_sublevel_zero + (μ : Measure X) [IsFiniteMeasure μ] {r : X → ℝ} + (hr : Measurable r) (hpos : ∀ᵐ x ∂μ, 0 < r x) : + Tendsto (fun n : ℕ => μ.real {x | r x < 1 / (n : ℝ)}) + atTop (𝓝 0) := by + apply (tendsto_add_atTop_iff_nat 1).mp + simpa only [Nat.cast_add, Nat.cast_one] using + tendsto_measureReal_reciprocal_sublevel_zero μ hr hpos + +theorem tendsto_withDensity_sublevel_zero + (μ : Measure X) [IsFiniteMeasure μ] {r : X → ℝ} + (hr : Measurable r) (hpos : ∀ᵐ x ∂μ, 0 < r x) + (h : ℕ → X → ℝ) (hh : ∀ n, MemLp (h n) 2 μ) + (h_nonneg : ∀ n, 0 ≤ᵐ[μ] h n) (H : ℝ) + (hbound : ∀ n, Real.sqrt (∫ x, h n x ^ 2 ∂μ) ≤ H) : + Tendsto (fun n : ℕ => + (μ.withDensity (fun x => ENNReal.ofReal (h n x))).real + {x | r x < 1 / (n : ℝ)}) atTop (𝓝 0) := by + apply tendsto_measureReal_of_uniform_sqrt_bound μ _ H + · intro n + exact (withDensity_measureReal_le_sqrt μ (hh n) (h_nonneg n) + (measurableSet_lt hr measurable_const)).trans + (mul_le_mul_of_nonneg_right (hbound n) (Real.sqrt_nonneg _)) + · exact tendsto_measureReal_one_div_sublevel_zero μ hr hpos + +theorem tendsto_two_endpoint_losses_zero + (μ : Measure X) [IsFiniteMeasure μ] {r : X → ℝ} + (hr : Measurable r) (hinterior : ∀ᵐ x ∂μ, 0 < r x ∧ r x < 1) + (h₁ h₂ : ℕ → X → ℝ) + (hh₁ : ∀ n, MemLp (h₁ n) 2 μ) (hh₂ : ∀ n, MemLp (h₂ n) 2 μ) + (hn₁ : ∀ n, 0 ≤ᵐ[μ] h₁ n) (hn₂ : ∀ n, 0 ≤ᵐ[μ] h₂ n) + (H₁ H₂ : ℝ) + (hb₁ : ∀ n, Real.sqrt (∫ x, h₁ n x ^ 2 ∂μ) ≤ H₁) + (hb₂ : ∀ n, Real.sqrt (∫ x, h₂ n x ^ 2 ∂μ) ≤ H₂) : + Tendsto (fun n : ℕ => + (μ.withDensity (fun x => ENNReal.ofReal (h₁ n x))).real + {x | r x < 1 / (n : ℝ)} + + (μ.withDensity (fun x => ENNReal.ofReal (h₂ n x))).real + {x | 1 - r x < 1 / (n : ℝ)}) atTop (𝓝 0) := by + have hp : ∀ᵐ x ∂μ, 0 < r x := hinterior.mono (fun _ hx => hx.1) + have hq : ∀ᵐ x ∂μ, 0 < 1 - r x := hinterior.mono (fun _ hx => sub_pos.mpr hx.2) + simpa only [zero_add, Pi.sub_apply] using + (tendsto_withDensity_sublevel_zero μ hr hp h₁ hh₁ hn₁ H₁ hb₁).add + (tendsto_withDensity_sublevel_zero μ (measurable_const.sub hr) hq + h₂ hh₂ hn₂ H₂ hb₂) + +theorem tendsto_pullback_sublevel_zero + (μ : Measure X) [IsFiniteMeasure μ] {r : X → ℝ} + (hr : Measurable r) (hpos : ∀ᵐ x ∂μ, 0 < r x) + {Ω : ℕ → Type*} [∀ n, MeasurableSpace (Ω n)] + (P : (n : ℕ) → Measure (Ω n)) (x : (n : ℕ) → Ω n → X) + (hx : ∀ n, Measurable (x n)) + (h : ℕ → X → ℝ) (hh : ∀ n, MemLp (h n) 2 μ) + (hn : ∀ n, 0 ≤ᵐ[μ] h n) (H : ℝ) + (hb : ∀ n, Real.sqrt (∫ z, h n z ^ 2 ∂μ) ≤ H) + (hmap : ∀ n, (P n).map (x n) = + μ.withDensity (fun z => ENNReal.ofReal (h n z))) : + Tendsto (fun n : ℕ => (P n).real {ω | r (x n ω) < 1 / (n : ℝ)}) + atTop (𝓝 0) := by + have ht := tendsto_withDensity_sublevel_zero μ hr hpos h hh hn H hb + convert ht using 1 + funext n + rw [← hmap n, map_measureReal_apply (hx n) (measurableSet_lt hr measurable_const)] + rfl + +theorem tendsto_endpoint_bad_union_zero + (μ : Measure X) [IsFiniteMeasure μ] {r : X → ℝ} + (hr : Measurable r) (hi : ∀ᵐ z ∂μ, 0 < r z ∧ r z < 1) + {Ω : ℕ → Type*} [∀ n, MeasurableSpace (Ω n)] + (P : (n : ℕ) → Measure (Ω n)) + (x y : (n : ℕ) → Ω n → X) + (hx : ∀ n, Measurable (x n)) (hy : ∀ n, Measurable (y n)) + (h₁ h₂ : ℕ → X → ℝ) + (hh₁ : ∀ n, MemLp (h₁ n) 2 μ) (hh₂ : ∀ n, MemLp (h₂ n) 2 μ) + (hn₁ : ∀ n, 0 ≤ᵐ[μ] h₁ n) (hn₂ : ∀ n, 0 ≤ᵐ[μ] h₂ n) + (H₁ H₂ : ℝ) + (hb₁ : ∀ n, Real.sqrt (∫ z, h₁ n z ^ 2 ∂μ) ≤ H₁) + (hb₂ : ∀ n, Real.sqrt (∫ z, h₂ n z ^ 2 ∂μ) ≤ H₂) + (hm₁ : ∀ n, (P n).map (x n) = + μ.withDensity (fun z => ENNReal.ofReal (h₁ n z))) + (hm₂ : ∀ n, (P n).map (y n) = + μ.withDensity (fun z => ENNReal.ofReal (h₂ n z))) : + Tendsto (fun n : ℕ => (P n).real + ({ω | r (x n ω) < 1 / (n : ℝ)} ∪ + {ω | 1 - r (y n ω) < 1 / (n : ℝ)})) atTop (𝓝 0) := by + apply squeeze_zero (fun _ => measureReal_nonneg) + (fun _ => measureReal_union_le _ _) + have hp : ∀ᵐ z ∂μ, 0 < r z := hi.mono (fun _ hz => hz.1) + have hq : ∀ᵐ z ∂μ, 0 < 1 - r z := hi.mono (fun _ hz => sub_pos.mpr hz.2) + simpa only [zero_add, Pi.sub_apply] using + (tendsto_pullback_sublevel_zero μ hr hp P x hx h₁ hh₁ hn₁ H₁ hb₁ hm₁).add + (tendsto_pullback_sublevel_zero μ (measurable_const.sub hr) hq + P y hy h₂ hh₂ hn₂ H₂ hb₂ hm₂) + +end Invariant233.EndpointLoss + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ErgodicAtoms.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ErgodicAtoms.lean new file mode 100644 index 0000000000000000000000000000000000000000..0cdd1482c8c81256e7aa9f8bd270743a8780a300 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ErgodicAtoms.lean @@ -0,0 +1,116 @@ +import Mathlib.Dynamics.Ergodic.Ergodic +import Mathlib.Dynamics.Ergodic.Conservative + +namespace OAI + +open Set Filter Function MeasureTheory + +namespace Invariant233.ErgodicAtoms + +variable {X : Type*} [m : MeasurableSpace X] {μ : Measure X} + +theorem exists_positive_period_of_disjoint_or_equal + [IsFiniteMeasure μ] {T : X → X} (hT : MeasurePreserving T μ μ) + {s : Set X} (hs : MeasurableSet s) (hpos : μ s ≠ 0) + (horbit : ∀ n : ℕ, 0 < n → + μ (s ∩ T^[n] ⁻¹' s) = 0 ∨ T^[n] ⁻¹' s =ᵐ[μ] s) : + ∃ n : ℕ, 0 < n ∧ T^[n] ⁻¹' s =ᵐ[μ] s := by + obtain ⟨n, hn, hinter⟩ := + hT.conservative.exists_gt_measure_inter_ne_zero hs.nullMeasurableSet hpos 0 + exact ⟨n, hn, (horbit n hn).resolve_left hinter⟩ + +theorem ae_eq_univ_of_positive_period + {T : X → X} (hT : ∀ n : ℕ, 0 < n → Ergodic T^[n] μ) + {s : Set X} (hs : MeasurableSet s) (hpos : μ s ≠ 0) + (hperiod : ∃ n : ℕ, 0 < n ∧ T^[n] ⁻¹' s =ᵐ[μ] s) : + s =ᵐ[μ] Set.univ := by + obtain ⟨n, hn, hperiod⟩ := hperiod + rcases (hT n hn).quasiErgodic.ae_empty_or_univ₀ hs.nullMeasurableSet hperiod with h | h + · exact False.elim (hpos (by simpa using measure_congr h)) + · exact h + +theorem ae_eq_univ_of_disjoint_or_equal + [IsFiniteMeasure μ] {T : X → X} + (hT : ∀ n : ℕ, 0 < n → Ergodic T^[n] μ) + {s : Set X} (hs : MeasurableSet s) (hpos : μ s ≠ 0) + (horbit : ∀ n : ℕ, 0 < n → + μ (s ∩ T^[n] ⁻¹' s) = 0 ∨ T^[n] ⁻¹' s =ᵐ[μ] s) : + s =ᵐ[μ] Set.univ := by + apply ae_eq_univ_of_positive_period hT hs hpos + have hT1 : MeasurePreserving T μ μ := by + simpa using (hT 1 (by decide)).toMeasurePreserving + exact exists_positive_period_of_disjoint_or_equal hT1 hs hpos horbit + +theorem ae_eq_univ_of_measurable_atom + [IsFiniteMeasure μ] {T : X → X} + (hT : ∀ n : ℕ, 0 < n → Ergodic T^[n] μ) + (m₀ : MeasurableSpace X) (hm₀ : m₀ ≤ m) + (hT₀ : @Measurable X X m₀ m₀ T) + {s : Set X} (hs₀ : @MeasurableSet X m₀ s) (hpos : μ s ≠ 0) + (hatom : ∀ t : Set X, @MeasurableSet X m₀ t → t ⊆ s → + μ t = 0 ∨ μ (s \ t) = 0) : + s =ᵐ[μ] Set.univ := by + let : MeasurableSpace X := m + have hs : MeasurableSet s := hm₀ s hs₀ + have hT1 : MeasurePreserving T μ μ := by + simpa using (hT 1 (by decide)).toMeasurePreserving + obtain ⟨n, hn, hinter⟩ := + hT1.conservative.exists_gt_measure_inter_ne_zero hs.nullMeasurableSet hpos 0 + have hint₀ : @MeasurableSet X m₀ (s ∩ T^[n] ⁻¹' s) := + hs₀.inter ((hT₀.iterate n) hs₀) + have hnull : μ (s \ (s ∩ T^[n] ⁻¹' s)) = 0 := + (hatom _ hint₀ inter_subset_left).resolve_left hinter + have hle : s ≤ᵐ[μ] T^[n] ⁻¹' s := by + apply ae_le_set.mpr + simpa only [inter_comm s, sdiff_inter_self_eq_sdiff] using hnull + rcases (hT n hn).ae_empty_or_univ_of_ae_le_preimage hs.nullMeasurableSet hle with h | h + · exact False.elim (hpos (by simpa using measure_congr h)) + · exact h + +theorem ae_empty_or_univ_of_conull_atom + (m₀ : MeasurableSpace X) + {s : Set X} (hs₀ : @MeasurableSet X m₀ s) (hfull : s =ᵐ[μ] Set.univ) + (hatom : ∀ t : Set X, @MeasurableSet X m₀ t → t ⊆ s → + μ t = 0 ∨ μ (s \ t) = 0) + {t : Set X} (ht₀ : @MeasurableSet X m₀ t) : + t =ᵐ[μ] (∅ : Set X) ∨ t =ᵐ[μ] Set.univ := by + let : MeasurableSpace X := m + have hinter : (s ∩ t : Set X) =ᵐ[μ] t := + inter_ae_eq_right_of_ae_eq_univ hfull + rcases hatom (s ∩ t) (hs₀.inter ht₀) inter_subset_left with h | h + · left + apply ae_eq_empty.mpr + rwa [measure_congr hinter] at h + · right + have hle : s ≤ᵐ[μ] t := by + apply ae_le_set.mpr + simpa only [inter_comm s, sdiff_inter_self_eq_sdiff] using h + exact EventuallyLE.antisymm (subset_univ t).eventuallyLE (hfull.symm.le.trans hle) + +theorem exists_nontrivial_measurable_subset + [IsFiniteMeasure μ] {T : X → X} + (hT : ∀ n : ℕ, 0 < n → Ergodic T^[n] μ) + (m₀ : MeasurableSpace X) (hm₀ : m₀ ≤ m) + (hT₀ : @Measurable X X m₀ m₀ T) + (hnontrivial : ∃ t : Set X, @MeasurableSet X m₀ t ∧ μ t ≠ 0 ∧ μ tᶜ ≠ 0) + {s : Set X} (hs₀ : @MeasurableSet X m₀ s) (hpos : μ s ≠ 0) : + ∃ t : Set X, @MeasurableSet X m₀ t ∧ t ⊆ s ∧ μ t ≠ 0 ∧ μ (s \ t) ≠ 0 := by + let : MeasurableSpace X := m + by_contra hsplit + have hatom : ∀ t : Set X, @MeasurableSet X m₀ t → t ⊆ s → + μ t = 0 ∨ μ (s \ t) = 0 := by + intro t ht hts + by_cases hzero : μ t = 0 + · exact Or.inl hzero + · right + by_contra hcomp + exact hsplit ⟨t, ht, hts, hzero, hcomp⟩ + have hfull := ae_eq_univ_of_measurable_atom hT m₀ hm₀ hT₀ hs₀ hpos hatom + obtain ⟨t, ht, htpos, htcomp⟩ := hnontrivial + rcases ae_empty_or_univ_of_conull_atom m₀ hs₀ hfull hatom ht with h | h + · exact htpos (ae_eq_empty.mp h) + · exact htcomp (ae_eq_univ.mp h) + +end Invariant233.ErgodicAtoms + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ExponentialDecay.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ExponentialDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea523d37a02b0d97550f938f1489f39d6fc32eaf --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ExponentialDecay.lean @@ -0,0 +1,117 @@ +import Mathlib.Analysis.Normed.Algebra.GelfandFormula +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Tactic + +namespace OAI + +open Filter Topology +open scoped BigOperators ENNReal + +namespace Invariant233 + +theorem prod_le_exp_sum_truncated_log {ι : Type*} (s : Finset ι) + (f : ι → ℝ) (M : ℝ) (hf : ∀ i ∈ s, 0 ≤ f i) : + (∏ i ∈ s, f i) ≤ + Real.exp (∑ i ∈ s, Real.log (max (f i) (Real.exp (-M)))) := by + rw [Real.exp_sum] + apply Finset.prod_le_prod₀ hf + intro i hi + rw [Real.exp_log (lt_of_lt_of_le (Real.exp_pos _) (le_max_right _ _))] + exact le_max_left _ _ + +theorem prod_le_exp_of_sum_truncated_log_le {ι : Type*} (s : Finset ι) + (f : ι → ℝ) (M B : ℝ) (hf : ∀ i ∈ s, 0 ≤ f i) + (hs : (∑ i ∈ s, Real.log (max (f i) (Real.exp (-M)))) ≤ B) : + (∏ i ∈ s, f i) ≤ Real.exp B := + (prod_le_exp_sum_truncated_log s f M hf).trans (Real.exp_le_exp.mpr hs) + +theorem tendsto_root_zero_of_exponential_decay (u : ℕ → ℝ) + (hu : ∀ n, 0 ≤ u n) + (hdecay : ∀ a : ℝ, 0 < a → ∀ᶠ n : ℕ in atTop, + u n ≤ Real.exp (-a * (n : ℝ))) : + Tendsto (fun n : ℕ => (u n) ^ (1 / (n : ℝ))) atTop (𝓝 0) := by + apply tendsto_order.mpr + constructor + · intro c hc + exact Filter.Eventually.of_forall fun n => + hc.trans_le (Real.rpow_nonneg (hu n) _) + · intro ε hε + have he : ∀ᶠ a : ℝ in atTop, Real.exp (-a) < ε := + (tendsto_order.mp Real.tendsto_exp_neg_atTop_nhds_zero).2 ε hε + obtain ⟨a, ha, hae⟩ := ((eventually_gt_atTop (0 : ℝ)).and he).exists + filter_upwards [hdecay a ha, eventually_gt_atTop (0 : ℕ)] with n hn hnpos + have hnzero : n ≠ 0 := Nat.ne_of_gt hnpos + have hroot := Real.rpow_le_rpow (hu n) hn (by positivity : 0 ≤ 1 / (n : ℝ)) + have heq : Real.exp (-a * (n : ℝ)) = (Real.exp (-a)) ^ n := by + rw [mul_comm, Real.exp_nat_mul] + rw [heq, one_div, Real.pow_rpow_inv_natCast (Real.exp_nonneg _) hnzero] at hroot + simpa only [one_div] using hroot.trans_lt hae + +theorem norm_quasinilpotent_of_exponential_decay {A : Type*} [NormedRing A] + (T : A) + (hdecay : ∀ a : ℝ, 0 < a → ∀ᶠ n : ℕ in atTop, + ‖T ^ n‖ ≤ Real.exp (-a * (n : ℝ))) : + Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) atTop (𝓝 0) := + tendsto_root_zero_of_exponential_decay (fun n => ‖T ^ n‖) + (fun _ => norm_nonneg _) hdecay + +theorem spectralRadius_zero_of_norm_root_tendsto_zero {A : Type*} [NormedRing A] + [NormedAlgebra ℂ A] [CompleteSpace A] (T : A) + (hroot : Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) atTop (𝓝 0)) : + spectralRadius ℂ T = 0 := by + have hzero : Tendsto + (fun n : ℕ => ENNReal.ofReal (‖T ^ n‖ ^ (1 / (n : ℝ)))) + atTop (𝓝 (0 : ℝ≥0∞)) := by + simpa only [Function.comp_def, ENNReal.ofReal_zero] using + (ENNReal.continuous_ofReal.tendsto (0 : ℝ)).comp hroot + exact tendsto_nhds_unique + (spectrum.pow_norm_pow_one_div_tendsto_nhds_spectralRadius T) hzero + +theorem spectralRadius_zero_of_exponential_decay {A : Type*} [NormedRing A] + [NormedAlgebra ℂ A] [CompleteSpace A] (T : A) + (hdecay : ∀ a : ℝ, 0 < a → ∀ᶠ n : ℕ in atTop, + ‖T ^ n‖ ≤ Real.exp (-a * (n : ℝ))) : + spectralRadius ℂ T = 0 := + spectralRadius_zero_of_norm_root_tendsto_zero T + (norm_quasinilpotent_of_exponential_decay T hdecay) + +theorem spectrum_subset_zero_of_spectralRadius_zero {𝕜 A : Type*} + [NormedField 𝕜] [Ring A] [Algebra 𝕜 A] (T : A) + (hzero : spectralRadius 𝕜 T = 0) : + spectrum 𝕜 T ⊆ {0} := by + intro z hz + have hnorm : (‖z‖₊ : ℝ≥0∞) ≤ spectralRadius 𝕜 T := by + rw [spectralRadius_eq_of_unital] + exact le_iSup₂ (f := fun scalar (_ : scalar ∈ spectrum 𝕜 T) => + (‖scalar‖₊ : ℝ≥0∞)) z hz + rw [hzero] at hnorm + simpa using hnorm + +theorem spectrum_eq_zero_of_spectralRadius_zero {A : Type*} [NormedRing A] + [NormedAlgebra ℂ A] [CompleteSpace A] [Nontrivial A] (T : A) + (hzero : spectralRadius ℂ T = 0) : spectrum ℂ T = {0} := by + have hsub := spectrum_subset_zero_of_spectralRadius_zero T hzero + apply Set.Subset.antisymm hsub + obtain ⟨z, hz⟩ := spectrum.nonempty T + have hz0 : z = 0 := hsub hz + simpa only [Set.singleton_subset_iff, hz0] using hz + +theorem spectrum_eq_zero_of_norm_root_tendsto_zero {A : Type*} [NormedRing A] + [NormedAlgebra ℂ A] [CompleteSpace A] [Nontrivial A] (T : A) + (hroot : Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) atTop (𝓝 0)) : + spectrum ℂ T = {0} := + spectrum_eq_zero_of_spectralRadius_zero T + (spectralRadius_zero_of_norm_root_tendsto_zero T hroot) + +theorem spectrum_eq_zero_of_exponential_decay {A : Type*} [NormedRing A] + [NormedAlgebra ℂ A] [CompleteSpace A] [Nontrivial A] (T : A) + (hdecay : ∀ a : ℝ, 0 < a → ∀ᶠ n : ℕ in atTop, + ‖T ^ n‖ ≤ Real.exp (-a * (n : ℝ))) : + spectrum ℂ T = {0} := + spectrum_eq_zero_of_spectralRadius_zero T + (spectralRadius_zero_of_exponential_decay T hdecay) + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ExponentialExtension.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ExponentialExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..465865b0e58f14f6dc984c1f00d72af91b1db7ac --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ExponentialExtension.lean @@ -0,0 +1,92 @@ +import OAI.Analysis.IrrationalRotation.Model.ExponentialWeight +import Mathlib.Analysis.SpecialFunctions.Log.Basic +import Mathlib.Topology.Piecewise + +namespace OAI + +open Filter Set Topology + +namespace Invariant233 + +variable {X : Type*} {x₀ x : X} {g : X → ℝ} + +@[simp] theorem exponentialWeight_self (x₀ : X) (g : X → ℝ) : + exponentialWeight x₀ g x₀ = 0 := by + classical + simp [exponentialWeight] + +theorem exponentialWeight_of_ne (h : x ≠ x₀) : + exponentialWeight x₀ g x = Real.exp (-g x) := by + classical + simp [exponentialWeight, h] + +@[simp] theorem exponentialWeight_eq_zero_iff : + exponentialWeight x₀ g x = 0 ↔ x = x₀ := by + by_cases h : x = x₀ + · subst x + simp + · rw [exponentialWeight_of_ne h] + simp [Real.exp_ne_zero, h] + +theorem exponentialWeight_pos (h : x ≠ x₀) : + 0 < exponentialWeight x₀ g x := by + rw [exponentialWeight_of_ne h] + exact Real.exp_pos _ + +theorem exponentialWeight_nonneg (x₀ : X) (g : X → ℝ) (x : X) : + 0 ≤ exponentialWeight x₀ g x := by + by_cases h : x = x₀ + · subst x + simp + · exact (exponentialWeight_pos h).le + +theorem exponentialWeight_le_one (hg : ∀ x ≠ x₀, 0 ≤ g x) (x : X) : + exponentialWeight x₀ g x ≤ 1 := by + by_cases h : x = x₀ + · subst x + simp + · rw [exponentialWeight_of_ne h, Real.exp_le_one_iff] + exact neg_nonpos.mpr (hg x h) + +theorem exponentialWeight_mem_Icc (hg : ∀ x ≠ x₀, 0 ≤ g x) (x : X) : + exponentialWeight x₀ g x ∈ Icc (0 : ℝ) 1 := + ⟨exponentialWeight_nonneg _ _ _, exponentialWeight_le_one hg x⟩ + +theorem exponentialWeight_zero_set (x₀ : X) (g : X → ℝ) : + (exponentialWeight x₀ g) ⁻¹' {0} = {x₀} := by + ext x + simp + +theorem log_exponentialWeight_of_ne (h : x ≠ x₀) : + Real.log (exponentialWeight x₀ g x) = -g x := by + rw [exponentialWeight_of_ne h, Real.log_exp] + + +variable [TopologicalSpace X] [T1Space X] + +theorem continuous_exponentialWeight + (hg : ContinuousOn g {x₀}ᶜ) + (hlim : Tendsto g (𝓝[≠] x₀) atTop) : + Continuous (exponentialWeight x₀ g) := by + classical + rw [continuous_iff_continuousAt] + intro x + by_cases h : x = x₀ + · subst x + rw [exponentialWeight, continuousAt_update_same] + exact Real.tendsto_exp_atBot.comp (tendsto_neg_atTop_atBot.comp hlim) + · rw [exponentialWeight, continuousAt_update_of_ne h] + exact Real.continuous_exp.continuousAt.comp + (hg.continuousAt (isOpen_compl_singleton.mem_nhds h)).neg + +omit [T1Space X] in +theorem continuous_truncatedLog {f : X → ℝ} (hf : Continuous f) (M : ℝ) : + Continuous (fun x => Real.log (max (f x) (Real.exp (-M)))) := by + apply Continuous.log (hf.max continuous_const) + intro x + exact ne_of_gt (lt_of_lt_of_le (Real.exp_pos _) (le_max_right _ _)) + + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ExtendedExponential.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ExtendedExponential.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ac9c10497d11555fc809f4204743cf9d4ad205a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ExtendedExponential.lean @@ -0,0 +1,40 @@ +import OAI.Analysis.IrrationalRotation.Model.Analytic + +namespace OAI + +open scoped ENNReal + +namespace Invariant233 + +theorem extendedExpNeg_eq_exp_toReal (a : ℝ≥0∞) (ha : a ≠ ∞) : + (EReal.exp (-(a : EReal))).toReal = Real.exp (-a.toReal) := by + rw [← EReal.coe_ennreal_toReal ha, ← EReal.coe_neg, EReal.exp_coe, + ENNReal.toReal_ofReal (Real.exp_pos _).le] + +theorem extendedExpNeg_eq_zero_iff (a : ℝ≥0∞) : + (EReal.exp (-(a : EReal))).toReal = 0 ↔ a = ∞ := by + by_cases ha : a = ∞ + · simp [ha] + · rw [extendedExpNeg_eq_exp_toReal a ha] + simp [Real.exp_ne_zero, ha] + +theorem extendedExpNeg_mem_Icc (a : ℝ≥0∞) : + (EReal.exp (-(a : EReal))).toReal ∈ Set.Icc (0 : ℝ) 1 := by + by_cases ha : a = ∞ + · simp [ha] + · rw [extendedExpNeg_eq_exp_toReal a ha] + exact ⟨(Real.exp_pos _).le, + Real.exp_le_one_iff.mpr (neg_nonpos.mpr ENNReal.toReal_nonneg)⟩ + +theorem negLogCost_extendedExpNeg (a : ℝ≥0∞) : + negLogCost ((EReal.exp (-(a : EReal))).toReal) = a := by + by_cases ha : a = ∞ + · simp [ha, negLogCost] + · rw [extendedExpNeg_eq_exp_toReal a ha] + simp only [negLogCost, Real.exp_ne_zero, ite_false, + abs_of_pos (Real.exp_pos _), Real.log_exp, neg_neg] + exact ENNReal.ofReal_toReal ha + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerApproximation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..18768c280eb5a9fd89f432b1642b79ed7d936ad0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerApproximation.lean @@ -0,0 +1,82 @@ +import OAI.Analysis.IrrationalRotation.Model.FejerApproximation +import OAI.Analysis.IrrationalRotation.Analysis.FejerKernel +import OAI.Analysis.IrrationalRotation.Rotation.CircleKernelConvolution + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators + +namespace Invariant233.Fejer + +private def bundledKernel (H : ℕ) : C(UnitAddCircle, ℝ) := + ⟨kernel H, continuous_kernel H⟩ + +theorem approximation_bounds (H : ℕ) (hH : H ≠ 0) + {f : Circle → ℝ} (hf : Measurable f) + (hf0 : ∀ x, 0 ≤ f x) (hf1 : ∀ x, f x ≤ 1) (x : Circle) : + 0 ≤ approximation H f x ∧ approximation H f x ≤ 1 := + CircleKernelConvolution.convolution_bounds (bundledKernel H) + (kernel_nonneg H) (integral_kernel_volume H hH) hf hf0 hf1 x + +theorem integral_approximation (H : ℕ) (hH : H ≠ 0) + {f : Circle → ℝ} (hf : Measurable f) + (hf0 : ∀ x, 0 ≤ f x) (hf1 : ∀ x, f x ≤ 1) : + (∫ x, approximation H f x) = ∫ x, f x := + CircleKernelConvolution.integral_convolution (bundledKernel H) + (integral_kernel_volume H hH) hf hf0 hf1 + +theorem approximation_eq_polynomial (H : ℕ) + {f : Circle → ℝ} (hf : Measurable f) + (hf0 : ∀ x, 0 ≤ f x) (hf1 : ∀ x, f x ≤ 1) (x : Circle) : + (approximation H f x : ℂ) = FourierSampling.polynomial (frequencies H) + (approximationCoefficient H f) x := + CircleKernelConvolution.convolution_eq_polynomial (bundledKernel H) + (frequencies H) (coefficient H) (kernel_eq_finite_fourier_sum H) hf hf0 hf1 x + +theorem approximationCoefficient_norm_le_one (H : ℕ) (hH : H ≠ 0) + {f : Circle → ℝ} (hf : Measurable f) + (hf0 : ∀ x, 0 ≤ f x) (hf1 : ∀ x, f x ≤ 1) (v : ℤ) : + ‖approximationCoefficient H f v‖ ≤ 1 := by + rw [approximationCoefficient, norm_mul] + have h₁ := coefficient_norm_le_one H hH v + have h₂ := CircleKernelConvolution.norm_testCoefficient_le_one hf hf0 hf1 v + change ‖coefficient H v‖ * ‖CircleKernelConvolution.testCoefficient f v‖ ≤ 1 + nlinarith [norm_nonneg (coefficient H v), norm_nonneg (CircleKernelConvolution.testCoefficient f v)] + +@[simp] theorem approximationCoefficient_zero (H : ℕ) (hH : H ≠ 0) (f : Circle → ℝ) : + approximationCoefficient H f 0 = (∫ x, f x : ℝ) := by + simp [approximationCoefficient, coefficient_zero H hH, integral_complex_ofReal] + +theorem continuous_approximation (H : ℕ) + {f : Circle → ℝ} (hf : Measurable f) + (hf0 : ∀ x, 0 ≤ f x) (hf1 : ∀ x, f x ≤ 1) : + Continuous (approximation H f) := by + have hpoly : Continuous (fun x : Circle => + FourierSampling.polynomial (frequencies H) (approximationCoefficient H f) x) := by + unfold FourierSampling.polynomial + exact continuous_finsetSum _ (fun v hv => continuous_const.mul (fourier v).continuous) + have heq : approximation H f = fun x => + (FourierSampling.polynomial (frequencies H) (approximationCoefficient H f) x).re := by + funext x + rw [← approximation_eq_polynomial H hf hf0 hf1 x] + rfl + rw [heq] + exact Complex.continuous_re.comp hpoly + +theorem approximation_l1_error_le (H : ℕ) (hH : H ≠ 0) + {f : Circle → ℝ} (hf : Measurable f) + (hf0 : ∀ x, 0 ≤ f x) (hf1 : ∀ x, f x ≤ 1) + {B : Set Circle} (hB : MeasurableSet B) {δ ε : ℝ} (hδ : 0 ≤ δ) + (hsmall : ∀ t ∈ B, CircleKernelConvolution.translationError f t ≤ δ) + (htail : (∫ t in Bᶜ, kernel H t) ≤ ε) : + (∫ x, |approximation H f x - f x|) ≤ δ + ε := + CircleKernelConvolution.l1_error_le_small_translation_and_tail (bundledKernel H) + (kernel_nonneg H) (integral_kernel_volume H hH) hf hf0 hf1 hB hδ hsmall htail + +end Invariant233.Fejer + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerBanachApproximation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerBanachApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e9a7cdf7ca62498cf75937ff1b441e49680c0da --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerBanachApproximation.lean @@ -0,0 +1,65 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FejerKernel +import Mathlib.MeasureTheory.Integral.PeakFunction + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped Topology +namespace Invariant233.Fejer + +theorem kernel_tendstoUniformlyOn_compl + (u : Set Circle) (hu : IsOpen u) (h0 : (0 : Circle) ∈ u) : + TendstoUniformlyOn (fun n : ℕ => kernel (n + 1)) 0 atTop uᶜ := by + obtain ⟨η, hη, hball⟩ := Metric.isOpen_iff.mp hu 0 h0 + have hn : Tendsto (fun n : ℕ => ((n + 1 : ℕ) : ℝ)) atTop atTop := + tendsto_natCast_atTop_atTop.comp (tendsto_add_atTop_nat 1) + have hb : Tendsto (fun n : ℕ => (1 / (4 * η ^ 2)) / (n + 1 : ℕ)) + atTop (𝓝 (0 : ℝ)) := tendsto_const_nhds.div_atTop hn + apply Metric.tendstoUniformlyOn_iff.mpr + intro ε hε + filter_upwards [hb.eventually (gt_mem_nhds hε)] with n hnε + intro x hx + have hdist : η ≤ dist x 0 := by + by_contra h + exact hx (hball (show x ∈ Metric.ball 0 η from lt_of_not_ge h)) + have hk := kernel_le_of_distance_ge (n + 1) (Nat.succ_ne_zero n) hη x hdist + have heq : 1 / (4 * (n + 1 : ℕ) * η ^ 2) = + (1 / (4 * η ^ 2)) / (n + 1 : ℕ) := by ring + rw [heq] at hk + simpa only [Pi.zero_apply, dist_zero_left, Real.norm_eq_abs, + abs_of_nonneg (kernel_nonneg (n + 1) x)] using hk.trans_lt hnε + +theorem tendsto_integral_kernel_smul + {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + {g : Circle → E} (hg : Integrable g AddCircle.haarAddCircle) + (h0 : ContinuousAt g 0) : + Tendsto (fun n : ℕ => ∫ t, kernel (n + 1) t • g t ∂AddCircle.haarAddCircle) + atTop (𝓝 (g 0)) := by + apply tendsto_integral_peak_smul_of_integrable_of_tendsto + (t := Set.univ) MeasurableSet.univ (by simp) (measure_ne_top _ _) + · exact Eventually.of_forall fun n t => kernel_nonneg (n + 1) t + · exact kernel_tendstoUniformlyOn_compl + · have heq : (fun n : ℕ => ∫ t in Set.univ, kernel (n + 1) t + ∂AddCircle.haarAddCircle) = fun _ => (1 : ℝ) := by + funext n + rw [MeasureTheory.setIntegral_univ, integral_kernel (n + 1) (Nat.succ_ne_zero n)] + rw [heq] + exact tendsto_const_nhds + · exact Eventually.of_forall fun n => (continuous_kernel (n + 1)).aestronglyMeasurable + · exact hg + · exact h0 + +theorem tendsto_integral_kernel_smul_of_continuous + {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + {g : Circle → E} (hg : Continuous g) : + Tendsto (fun n : ℕ => ∫ t, kernel (n + 1) t • g t ∂AddCircle.haarAddCircle) + atTop (𝓝 (g 0)) := + tendsto_integral_kernel_smul + (hg.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace g)) hg.continuousAt + +end Invariant233.Fejer + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerCoefficients.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerCoefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a32c806af57af643ced8afc27a9e7f415608192 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerCoefficients.lean @@ -0,0 +1,99 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FejerKernel + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators +namespace Invariant233.Fejer + +theorem difference_pair_sum_nat (N r : ℕ) : + (∑ k ∈ Finset.range N, ∑ l ∈ Finset.range N, + if (k : ℤ) - (l : ℤ) = (r : ℤ) then (1 : ℂ) else 0) = (N - r : ℕ) := by + rw [Finset.sum_comm] + have hinner (l : ℕ) : + (∑ k ∈ Finset.range N, + if (k : ℤ) - (l : ℤ) = (r : ℤ) then (1 : ℂ) else 0) = + if l + r < N then 1 else 0 := by + have heq (k : ℕ) : ((k : ℤ) - (l : ℤ) = (r : ℤ)) ↔ k = l + r := by omega + simp_rw [heq] + simp + simp_rw [hinner] + rw [Finset.sum_boole] + have hfilter : (Finset.range N).filter (fun l => l + r < N) = Finset.range (N - r) := by + ext l + simp only [Finset.mem_filter, Finset.mem_range] + omega + rw [hfilter, Finset.card_range] + +theorem difference_pair_sum_neg (N : ℕ) (r : ℤ) : + (∑ k ∈ Finset.range N, ∑ l ∈ Finset.range N, + if (k : ℤ) - (l : ℤ) = -r then (1 : ℂ) else 0) = + ∑ k ∈ Finset.range N, ∑ l ∈ Finset.range N, + if (k : ℤ) - (l : ℤ) = r then (1 : ℂ) else 0 := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro k hk + apply Finset.sum_congr rfl + intro l hl + have heq : ((l : ℤ) - (k : ℤ) = -r) ↔ (k : ℤ) - (l : ℤ) = r := by omega + simp only [heq] + +theorem coefficient_eq_natAbs (N : ℕ) (r : ℤ) : + coefficient N r = ((N - r.natAbs : ℕ) : ℂ) / (N : ℂ) := by + rw [coefficient_expansion, div_eq_mul_inv, mul_comm] + congr 1 + obtain ⟨n, rfl | rfl⟩ := Int.eq_nat_or_neg r + · simpa using difference_pair_sum_nat N n + · rw [difference_pair_sum_neg] + simpa using difference_pair_sum_nat N n + +theorem coefficient_eq_triangular (N : ℕ) (r : ℤ) : + coefficient N r = + if r.natAbs < N then 1 - (r.natAbs : ℂ) / (N : ℂ) else 0 := by + rw [coefficient_eq_natAbs] + split_ifs with h + · rw [Nat.cast_sub (Nat.le_of_lt h)] + have hN : (N : ℂ) ≠ 0 := by exact_mod_cast (show N ≠ 0 by omega) + field_simp + · rw [Nat.sub_eq_zero_of_le (Nat.le_of_not_gt h)] + simp + +@[simp] theorem coefficient_size_zero (r : ℤ) : coefficient 0 r = 0 := by + simp [coefficient_eq_natAbs] + +theorem coefficient_nonneg_real (N : ℕ) (r : ℤ) : + coefficient N r = (coefficient N r).re ∧ 0 ≤ (coefficient N r).re := by + rw [coefficient_eq_natAbs] + simp only [Complex.div_natCast_re, Complex.natCast_re, Complex.ofReal_div, + Complex.ofReal_natCast] + constructor + · norm_cast + · positivity + +theorem mem_frequencies_iff_natAbs_lt (N : ℕ) (r : ℤ) : + r ∈ frequencies N ↔ r.natAbs < N := by + rw [frequencies, Finset.mem_Ioo, ← abs_lt, ← Int.natCast_natAbs, Nat.cast_lt] + +theorem coefficient_eq_on_frequencies {N : ℕ} {r : ℤ} (hr : r ∈ frequencies N) : + coefficient N r = 1 - (r.natAbs : ℂ) / (N : ℂ) := by + rw [coefficient_eq_triangular, ite_eq_left ((mem_frequencies_iff_natAbs_lt N r).mp hr)] + +theorem kernel_eq_triangular_fourier_sum (N : ℕ) (t : Circle) : + (kernel N t : ℂ) = ∑ r ∈ frequencies N, + (1 - (r.natAbs : ℂ) / (N : ℂ)) * fourier r t := by + rw [kernel_eq_finite_fourier_sum] + apply Finset.sum_congr rfl + intro r hr + rw [coefficient_eq_on_frequencies hr] + +theorem sum_triangular_coefficients (N : ℕ) : + (∑ r ∈ frequencies N, (1 - (r.natAbs : ℂ) / (N : ℂ))) = N := by + have h := kernel_eq_triangular_fourier_sum N 0 + simpa only [kernel_zero, Complex.ofReal_natCast, fourier_eval_zero, mul_one] using h.symm + +end Invariant233.Fejer + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerKernel.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..94308ed054a0c83781512ddc4bb54ae552796d9f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FejerKernel.lean @@ -0,0 +1,319 @@ +import OAI.Analysis.IrrationalRotation.Model.Fejer +import OAI.Analysis.IrrationalRotation.Analysis.GeometricAverage +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ComplexConjugate + +namespace Invariant233.Fejer + + theorem kernel_nonneg (H : ℕ) (x : Circle) : 0 ≤ kernel H x := + div_nonneg (Complex.normSq_nonneg _) (Nat.cast_nonneg _) + + theorem continuous_geometricPolynomial (H : ℕ) : Continuous (geometricPolynomial H) := by + unfold geometricPolynomial + exact continuous_finsetSum _ (fun _ _ => (fourier _).continuous) + + theorem continuous_kernel (H : ℕ) : Continuous (kernel H) := by + unfold kernel + simpa only [Complex.normSq_eq_norm_sq, Pi.pow_apply] using + ((continuous_geometricPolynomial H).norm.pow 2).div_const (H : ℝ) + + theorem geometricPolynomial_eq_sum_pow (H : ℕ) (x : Circle) : + geometricPolynomial H x = ∑ k ∈ Finset.range H, (fourier 1 x) ^ k := by + apply Finset.sum_congr rfl + intro k hk + simp only [fourier_apply, one_zsmul] + rw [natCast_zsmul, AddCircle.toCircle_nsmul, Circle.coe_pow] + + theorem kernel_complex_expansion (H : ℕ) (x : Circle) : + (kernel H x : ℂ) = (H : ℂ)⁻¹ * + ∑ k ∈ Finset.range H, ∑ l ∈ Finset.range H, + fourier ((k : ℤ) - (l : ℤ)) x := by + rw [kernel, Complex.ofReal_div, Complex.ofReal_natCast, + Complex.normSq_eq_conj_mul_self] + unfold geometricPolynomial + rw [map_sum, Finset.sum_mul] + simp_rw [Finset.mul_sum] + rw [Finset.sum_comm, div_eq_inv_mul] + simp_rw [sub_eq_add_neg, fourier_add, fourier_neg] + simp_rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro k hk + apply Finset.sum_congr rfl + intro l hl + ring + + theorem integral_fourier (n : ℤ) : + (∫ x : Circle, fourier n x ∂AddCircle.haarAddCircle) = if n = 0 then 1 else 0 := by + have h := congrFun (fourierCoeff_fourier (T := (1 : ℝ)) n) 0 + simpa [fourierCoeff, Pi.single_apply, eq_comm] using h + + theorem integral_kernel_complex (H : ℕ) (hH : H ≠ 0) : + (∫ x : Circle, (kernel H x : ℂ) ∂AddCircle.haarAddCircle) = 1 := by + simp_rw [kernel_complex_expansion] + rw [integral_const_mul] + rw [integral_finsetSum] + · simp_rw [integral_finsetSum _ (fun l hl => (fourier _).continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)), + integral_fourier] + have hsum : (∑ k ∈ Finset.range H, ∑ l ∈ Finset.range H, + (if (k : ℤ) - (l : ℤ) = 0 then (1 : ℂ) else 0)) = H := by + simp only [sub_eq_zero, Nat.cast_inj] + calc + _ = ∑ k ∈ Finset.range H, (1 : ℂ) := by + apply Finset.sum_congr rfl + intro k hk + simp only [Finset.sum_ite_eq, hk, ite_true] + _ = H := by simp + rw [hsum, inv_mul_cancel₀ (by exact_mod_cast hH)] + · intro k hk + exact integrable_finsetSum _ (fun l hl => (fourier _).continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)) + + theorem integral_kernel (H : ℕ) (hH : H ≠ 0) : + (∫ x : Circle, kernel H x ∂AddCircle.haarAddCircle) = 1 := by + have h := integral_kernel_complex H hH + have hcast := integral_ofReal (f := kernel H) (𝕜 := ℂ) + (μ := (AddCircle.haarAddCircle : Measure Circle)) + have hcast2 : (∫ x : Circle, (kernel H x : ℂ) ∂AddCircle.haarAddCircle) = + Complex.ofReal (∫ x : Circle, kernel H x ∂AddCircle.haarAddCircle) := hcast + rw [hcast2] at h + exact_mod_cast h + + theorem integrable_fourier (n : ℤ) : + Integrable (fun x : Circle => fourier n x) AddCircle.haarAddCircle := + (fourier n).continuous.integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + + theorem integrable_kernel (H : ℕ) : + Integrable (kernel H) AddCircle.haarAddCircle := + (continuous_kernel H).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + + theorem coefficient_norm_le_one (H : ℕ) (hH : H ≠ 0) (n : ℤ) : + ‖coefficient H n‖ ≤ 1 := by + unfold coefficient fourierCoeff + calc + _ ≤ ∫ x : Circle, ‖fourier (-n) x • (kernel H x : ℂ)‖ + ∂AddCircle.haarAddCircle := norm_integral_le_integral_norm _ + _ = ∫ x : Circle, kernel H x ∂AddCircle.haarAddCircle := by + apply integral_congr_ae + filter_upwards [] with x + simp only [smul_eq_mul, norm_mul, fourier_apply, Circle.norm_coe, + one_mul, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (kernel_nonneg H x)] + _ = 1 := integral_kernel H hH + + theorem difference_mem_frequencies {H k l : ℕ} + (hk : k ∈ Finset.range H) (hl : l ∈ Finset.range H) : + (k : ℤ) - (l : ℤ) ∈ frequencies H := by + simp only [frequencies, Finset.mem_Ioo] + simp only [Finset.mem_range] at hk hl + omega + + theorem coefficient_expansion (H : ℕ) (n : ℤ) : + coefficient H n = (H : ℂ)⁻¹ * + ∑ k ∈ Finset.range H, ∑ l ∈ Finset.range H, + if (k : ℤ) - (l : ℤ) = n then (1 : ℂ) else 0 := by + unfold coefficient + have heq : (fun x : Circle => (kernel H x : ℂ)) = fun x => + (H : ℂ)⁻¹ * ∑ k ∈ Finset.range H, ∑ l ∈ Finset.range H, + fourier ((k : ℤ) - (l : ℤ)) x := funext (kernel_complex_expansion H) + rw [heq, fourierCoeff.const_mul] + congr 1 + have houter : (fun x : Circle => ∑ k ∈ Finset.range H, ∑ l ∈ Finset.range H, + fourier ((k : ℤ) - (l : ℤ)) x) = + ∑ k ∈ Finset.range H, ∑ l ∈ Finset.range H, + (fun x : Circle => fourier ((k : ℤ) - (l : ℤ)) x) := by + ext x + simp + rw [houter, fourierCoeff.sum] + · simp only [Finset.sum_apply] + apply Finset.sum_congr rfl + intro k hk + rw [fourierCoeff.sum] + · simp only [Finset.sum_apply] + apply Finset.sum_congr rfl + intro l hl + simp only [fourierCoeff_fourier, Pi.single_apply, eq_comm] + · intro l hl + exact integrable_fourier _ + · intro k hk + exact integrable_finsetSum' _ (fun l hl => integrable_fourier _) + + theorem kernel_eq_finite_fourier_sum (H : ℕ) (x : Circle) : + (kernel H x : ℂ) = ∑ n ∈ frequencies H, coefficient H n * fourier n x := by + rw [kernel_complex_expansion] + symm + simp_rw [coefficient_expansion, mul_assoc, Finset.sum_mul] + rw [← Finset.mul_sum] + congr 1 + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro k hk + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro l hl + simp only [ite_mul, one_mul, zero_mul, Finset.sum_ite_eq, + difference_mem_frequencies hk hl, ite_true] + + theorem coefficient_eq_zero_outside {H : ℕ} {n : ℤ} + (hn : n ∉ frequencies H) : coefficient H n = 0 := by + rw [coefficient_expansion] + have hzero : (∑ k ∈ Finset.range H, ∑ l ∈ Finset.range H, + if (k : ℤ) - (l : ℤ) = n then (1 : ℂ) else 0) = 0 := by + apply Finset.sum_eq_zero + intro k hk + apply Finset.sum_eq_zero + intro l hl + have hne : (k : ℤ) - (l : ℤ) ≠ n := by + intro heq + apply hn + rw [← heq] + exact difference_mem_frequencies hk hl + simp only [hne, ite_false] + rw [hzero, mul_zero] + + theorem kernel_le_chord_bound (H : ℕ) (x : Circle) (hx : fourier 1 x ≠ 1) : + kernel H x ≤ 4 / ((H : ℝ) * ‖fourier 1 x - 1‖ ^ 2) := by + have hb := Invariant233.norm_geometric_sum_le (fourier 1 x) hx + (Circle.norm_coe _) H + rw [← geometricPolynomial_eq_sum_pow] at hb + rw [kernel, Complex.normSq_eq_norm_sq] + have hs : ‖geometricPolynomial H x‖ ^ 2 ≤ (2 / ‖fourier 1 x - 1‖) ^ 2 := + pow_le_pow_left₀ (norm_nonneg _) hb 2 + calc + _ ≤ (2 / ‖fourier 1 x - 1‖) ^ 2 / H := + div_le_div_of_nonneg_right hs (Nat.cast_nonneg H) + _ = 4 / ((H : ℝ) * ‖fourier 1 x - 1‖ ^ 2) := by + rw [div_pow, div_div] + congr 1 <;> ring + + theorem chord_lower_bound_coe {t : ℝ} (ht : |t| ≤ 1 / 2) : + 4 * |t| ≤ ‖fourier 1 (t : Circle) - 1‖ := by + have hangle : |Real.pi * t| ≤ Real.pi / 2 := by + rw [abs_mul, abs_of_pos Real.pi_pos] + nlinarith [Real.pi_pos] + have hsin := Real.mul_abs_le_abs_sin hangle + rw [abs_mul, abs_of_pos Real.pi_pos] at hsin + have hc : 2 * (Real.pi : ℂ) * Complex.I * (1 : ℂ) * (t : ℂ) / (1 : ℂ) = + Complex.I * ((2 * Real.pi * t : ℝ) : ℂ) := by + push_cast + ring + rw [fourier_coe_apply] + norm_num only [Complex.ofReal_one, Int.cast_one] at * + rw [hc, Complex.norm_exp_I_mul_ofReal_sub_one] + have hhalf : 2 * Real.pi * t / 2 = Real.pi * t := by ring + rw [hhalf, Real.norm_eq_abs, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] + have hcanc : 2 / Real.pi * (Real.pi * |t|) = 2 * |t| := by + field_simp + rw [hcanc] at hsin + linarith + + theorem chord_lower_bound (x : Circle) : + 4 * dist x 0 ≤ ‖fourier 1 x - 1‖ := by + induction x using QuotientAddGroup.induction_on with + | H t => + have hround : (((round t : ℤ) : ℝ) : Circle) = 0 := by + have hc := AddCircle.coe_zsmul (p := (1 : ℝ)) (n := round t) (x := (1 : ℝ)) + simpa only [zsmul_eq_mul, mul_one, AddCircle.coe_period, smul_zero] using hc + have hcoe : ((t - round t : ℝ) : Circle) = (t : Circle) := by + rw [QuotientAddGroup.mk_sub, hround, sub_zero] + have h := chord_lower_bound_coe (abs_sub_round t) + rw [hcoe] at h + simpa only [dist_zero_right, UnitAddCircle.norm_eq] using h + + theorem volume_eq_haar : (volume : Measure Circle) = AddCircle.haarAddCircle := by + simp only [AddCircle.volume_eq_smul_haarAddCircle, ENNReal.ofReal_one, one_smul] + + theorem integral_kernel_volume (H : ℕ) (hH : H ≠ 0) : + (∫ x : Circle, kernel H x) = 1 := by + rw [volume_eq_haar] + exact integral_kernel H hH + + theorem kernel_le_distance_bound (H : ℕ) (hH : H ≠ 0) + (x : Circle) (hx : x ≠ 0) : + kernel H x ≤ 1 / (4 * (H : ℝ) * (dist x 0) ^ 2) := by + have hHpos : (0 : ℝ) < H := by exact_mod_cast Nat.pos_of_ne_zero hH + have hd : 0 < dist x 0 := dist_pos.mpr hx + have hc := chord_lower_bound x + have hcpos : 0 < ‖fourier 1 x - 1‖ := lt_of_lt_of_le (by positivity) hc + have hxchar : fourier 1 x ≠ 1 := by + intro heq + simp only [heq, sub_self, norm_zero, lt_self_iff_false] at hcpos + calc + kernel H x ≤ 4 / ((H : ℝ) * ‖fourier 1 x - 1‖ ^ 2) := + kernel_le_chord_bound H x hxchar + _ ≤ 4 / ((H : ℝ) * (4 * dist x 0) ^ 2) := by + apply div_le_div_of_nonneg_left (by norm_num) (by positivity) + exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (by positivity) hc 2) hHpos.le + _ = 1 / (4 * (H : ℝ) * (dist x 0) ^ 2) := by + field_simp + + theorem kernel_le_of_distance_ge (H : ℕ) (hH : H ≠ 0) + {η : ℝ} (hη : 0 < η) (x : Circle) (hx : η ≤ dist x 0) : + kernel H x ≤ 1 / (4 * (H : ℝ) * η ^ 2) := by + have hHpos : (0 : ℝ) < H := by exact_mod_cast Nat.pos_of_ne_zero hH + have hx0 : x ≠ 0 := by + intro heq + subst x + simp only [dist_self] at hx + linarith + apply (kernel_le_distance_bound H hH x hx0).trans + apply div_le_div_of_nonneg_left (by norm_num) (by positivity) + exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hη.le hx 2) (by positivity) + + theorem card_frequencies_le (H : ℕ) : (frequencies H).card ≤ 2 * H := by + simp only [frequencies, Int.card_Ioo] + omega + + theorem coefficient_zero (H : ℕ) (hH : H ≠ 0) : coefficient H 0 = 1 := by + simpa only [coefficient, fourierCoeff, neg_zero, fourier_zero, one_smul] + using integral_kernel_complex H hH + + theorem norm_fourier_sub_one_coe (n : ℤ) (t : ℝ) : + ‖fourier n (t : Circle) - 1‖ = 2 * |Real.sin (Real.pi * n * t)| := by + rw [fourier_coe_apply] + have hc : 2 * (Real.pi : ℂ) * Complex.I * (n : ℂ) * (t : ℂ) / (1 : ℂ) = + Complex.I * ((2 * Real.pi * n * t : ℝ) : ℂ) := by + push_cast + ring + norm_num only [Complex.ofReal_one] + rw [hc, Complex.norm_exp_I_mul_ofReal_sub_one] + have heq : 2 * Real.pi * n * t / 2 = Real.pi * n * t := by ring + rw [heq, Real.norm_eq_abs, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] + + theorem kernel_eq_sine_formula (H : ℕ) (t : ℝ) + (ht : Real.sin (Real.pi * t) ≠ 0) : + kernel H (t : Circle) = (1 / (H : ℝ)) * + (Real.sin (Real.pi * H * t) / Real.sin (Real.pi * t)) ^ 2 := by + have hnorm : ‖fourier 1 (t : Circle) - 1‖ = 2 * |Real.sin (Real.pi * t)| := by + simpa only [Int.cast_one, mul_one] using norm_fourier_sub_one_coe 1 t + have hx : fourier 1 (t : Circle) ≠ 1 := by + intro heq + rw [heq, sub_self, norm_zero] at hnorm + have hp := abs_pos.mpr ht + linarith + have hpow : (fourier 1 (t : Circle)) ^ H = fourier (H : ℤ) (t : Circle) := by + simp only [fourier_apply, one_zsmul, natCast_zsmul, + AddCircle.toCircle_nsmul, Circle.coe_pow] + rw [kernel, Complex.normSq_eq_norm_sq, geometricPolynomial_eq_sum_pow, + geom_sum_eq hx, norm_div, hpow, norm_fourier_sub_one_coe, hnorm] + simp only [Int.cast_natCast, div_pow, mul_pow, sq_abs] + ring + + theorem kernel_zero (H : ℕ) : kernel H 0 = H := by + simp only [kernel, geometricPolynomial, fourier_eval_zero, Finset.sum_const, + Finset.card_range, nsmul_eq_mul, mul_one, Complex.normSq_eq_norm_sq, norm_natCast] + by_cases hH : H = 0 + · simp [hH] + · have hHr : (H : ℝ) ≠ 0 := by exact_mod_cast hH + field_simp + +end Invariant233.Fejer + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FiberCentrality.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiberCentrality.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ecb6a2462aa614f6d035307fa0f452684114d61 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiberCentrality.lean @@ -0,0 +1,113 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Analysis.InnerProductSpace.Adjoint +import Mathlib.Analysis.SpecialFunctions.Complex.Circle +import Mathlib.NumberTheory.Real.Irrational +import Mathlib.Tactic + +namespace OAI + +namespace Invariant233.FiberCentrality + +open scoped ENNReal + +local notation "K" => lp (fun _ : ℤ => ℂ) 2 + +theorem map_single_eq_smul_of_commute_diagonal + (A D : K →L[ℂ] K) (d : ℤ → ℂ) + (hd : Function.Injective d) + (hD : ∀ (v : K) (k : ℤ), D v k = d k * v k) + (hAD : A * D = D * A) (j : ℤ) : + A (lp.single 2 j (1 : ℂ)) = + (A (lp.single 2 j (1 : ℂ)) j) • lp.single 2 j (1 : ℂ) := by + have hDe : D (lp.single 2 j (1 : ℂ)) = + d j • lp.single 2 j (1 : ℂ) := by + ext k + by_cases h : j = k + · subst k + simp [hD] + · simp [hD, lp.single_apply, h] + ext k + by_cases h : j = k + · subst k + simp + · have heq := congrArg + (fun L : K →L[ℂ] K => L (lp.single 2 j (1 : ℂ)) k) hAD + have heq' : d j * A (lp.single 2 j (1 : ℂ)) k = + d k * A (lp.single 2 j (1 : ℂ)) k := by + simpa only [mul_apply_eq_comp, hDe, map_smul, + lp.coeFn_smul, Pi.smul_apply, smul_eq_mul, hD] using heq + have hz : A (lp.single 2 j (1 : ℂ)) k = 0 := by + have hp : (d j - d k) * A (lp.single 2 j (1 : ℂ)) k = 0 := by + rw [sub_mul, heq', sub_self] + exact (mul_eq_zero.mp hp).resolve_left (sub_ne_zero.mpr (fun e => h (hd e))) + simp [lp.single_apply, h, hz] + +theorem scalar_of_commute_diagonal_and_shift + (A D S : K →L[ℂ] K) (d : ℤ → ℂ) + (hd : Function.Injective d) + (hD : ∀ (v : K) (k : ℤ), D v k = d k * v k) + (hS : ∀ j : ℤ, S (lp.single 2 j (1 : ℂ)) = lp.single 2 (j + 1) (1 : ℂ)) + (hAD : A * D = D * A) (hAS : A * S = S * A) : + ∃ c : ℂ, A = c • (1 : K →L[ℂ] K) := by + let a : ℤ → ℂ := fun j => A (lp.single 2 j (1 : ℂ)) j + have hAe (j : ℤ) : A (lp.single 2 j (1 : ℂ)) = + a j • lp.single 2 j (1 : ℂ) := + map_single_eq_smul_of_commute_diagonal A D d hd hD hAD j + have hsucc (j : ℤ) : a (j + 1) = a j := by + have heq : A (S (lp.single 2 j (1 : ℂ))) = + S (A (lp.single 2 j (1 : ℂ))) := + congrArg (fun L : K →L[ℂ] K => L (lp.single 2 j (1 : ℂ))) hAS + rw [hS, hAe, hAe, map_smul, hS] at heq + have hcoord := congrArg (fun v : K => v (j + 1)) heq + simpa using hcoord + have ha (j : ℤ) : a j = a 0 := by + induction j using Int.induction_on with + | zero => rfl + | succ n ih => exact (hsucc n).trans ih + | pred n ih => + have h := hsucc (-(n : ℤ) - 1) + simp only [sub_add_cancel] at h + exact h.symm.trans ih + refine ⟨a 0, ?_⟩ + apply lp.ext_continuousLinearMap (by norm_num) + intro j + apply ContinuousLinearMap.ext_ring + change A (lp.single 2 j (1 : ℂ)) = a 0 • lp.single 2 j (1 : ℂ) + rw [hAe, ha] + +theorem injective_integer_rotation_orbit (θ : ℝ) (hθ : Irrational θ) + (x : AddCircle (1 : ℝ)) : + Function.Injective (fun k : ℤ => x + k • (θ : AddCircle (1 : ℝ))) := by + intro j k heq + have hzero : (j - k) • (θ : AddCircle (1 : ℝ)) = 0 := by + rw [sub_zsmul, ← sub_eq_add_neg, sub_eq_zero] + exact add_left_cancel heq + have hreal : (((j - k : ℤ) : ℝ) * θ : AddCircle (1 : ℝ)) = 0 := by + simpa only [← QuotientAddGroup.mk_zsmul, zsmul_eq_mul] using hzero + obtain ⟨n, hn⟩ := (AddCircle.coe_eq_zero_iff (p := (1 : ℝ))).mp hreal + by_contra hjk + apply (hθ.intCast_mul (sub_ne_zero.mpr hjk)).ne_int n + simpa only [zsmul_eq_mul, mul_one] using hn.symm + +theorem injective_irrational_diagonal (θ : ℝ) (hθ : Irrational θ) + (x : AddCircle (1 : ℝ)) : + Function.Injective (fun k : ℤ => + (AddCircle.toCircle (x + k • (θ : AddCircle (1 : ℝ))) : ℂ)) := by + intro j k h + apply injective_integer_rotation_orbit θ hθ x + exact AddCircle.injective_toCircle one_ne_zero (Subtype.ext h) + +theorem scalar_of_commute_irrational_diagonal_and_shift + (A D S : K →L[ℂ] K) (θ : ℝ) (hθ : Irrational θ) + (x : AddCircle (1 : ℝ)) + (hD : ∀ (v : K) (k : ℤ), D v k = + (AddCircle.toCircle (x + k • (θ : AddCircle (1 : ℝ))) : ℂ) * v k) + (hS : ∀ j : ℤ, S (lp.single 2 j (1 : ℂ)) = lp.single 2 (j + 1) (1 : ℂ)) + (hAD : A * D = D * A) (hAS : A * S = S * A) : + ∃ c : ℂ, A = c • (1 : K →L[ℂ] K) := + scalar_of_commute_diagonal_and_shift A D S _ + (injective_irrational_diagonal θ hθ x) hD hS hAD hAS + +end Invariant233.FiberCentrality + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldCentrality.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldCentrality.lean new file mode 100644 index 0000000000000000000000000000000000000000..45d7dede87469de9cea247547465549de8d38ff0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldCentrality.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FiberCentrality +import Mathlib.Dynamics.Ergodic.Function +import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex + +namespace OAI + +namespace Invariant233.FiberCentrality + +open MeasureTheory Filter +open scoped ENNReal + +local notation "K" => lp (fun _ : ℤ => ℂ) 2 + +theorem ae_eq_scalar_of_ergodic_covariance + {X : Type*} [MeasurableSpace X] (μ : Measure X) (σ : X → X) + (hσ : Ergodic σ μ) (A : X → K →L[ℂ] K) (S : K →L[ℂ] K) + (hS : ∀ j : ℤ, S (lp.single 2 j (1 : ℂ)) = lp.single 2 (j + 1) (1 : ℂ)) + (hm : NullMeasurable (fun x => A x (lp.single 2 (0 : ℤ) (1 : ℂ)) 0) μ) + (hscalar : ∀ᵐ x ∂μ, ∃ c : ℂ, A x = c • (1 : K →L[ℂ] K)) + (hcov : ∀ᵐ x ∂μ, S * A (σ x) = A x * S) : + ∃ c : ℂ, ∀ᵐ x ∂μ, A x = c • (1 : K →L[ℂ] K) := by + let a : X → ℂ := fun x => A x (lp.single 2 (0 : ℤ) (1 : ℂ)) 0 + have hscalar' : ∀ᵐ x ∂μ, A x = a x • (1 : K →L[ℂ] K) := by + filter_upwards [hscalar] with x hx + obtain ⟨c, hc⟩ := hx + have ha : a x = c := by + dsimp [a] + simp [hc] + rw [ha] + exact hc + have hscalarσ : ∀ᵐ x ∂μ, A (σ x) = a (σ x) • (1 : K →L[ℂ] K) := + hσ.toMeasurePreserving.quasiMeasurePreserving.ae hscalar' + have hSminus : S (lp.single 2 (-1 : ℤ) (1 : ℂ)) = + lp.single 2 (0 : ℤ) (1 : ℂ) := by + simpa using hS (-1) + have hinv : a ∘ σ =ᵐ[μ] a := by + filter_upwards [hscalar', hscalarσ, hcov] with x hx hσx hcovx + have hv : S (A (σ x) (lp.single 2 (-1 : ℤ) (1 : ℂ))) = + A x (S (lp.single 2 (-1 : ℤ) (1 : ℂ))) := + congrArg (fun L : K →L[ℂ] K => L (lp.single 2 (-1 : ℤ) (1 : ℂ))) hcovx + rw [hσx, hx] at hv + simp only [smul_apply, one_apply_eq_self, + map_smul, hSminus] at hv + have hv0 := congrArg (fun v : K => v (0 : ℤ)) hv + simpa [a, Function.comp_def] using hv0 + obtain ⟨c, hc⟩ := hσ.ae_eq_const_of_ae_eq_comp₀ hm hinv + refine ⟨c, ?_⟩ + filter_upwards [hscalar', hc] with x hx hcx + exact hx.trans (congrArg (fun z : ℂ => z • (1 : K →L[ℂ] K)) hcx) + +theorem ae_eq_scalar_of_diagonal_shift_and_ergodic_covariance + {X : Type*} [MeasurableSpace X] (μ : Measure X) (σ : X → X) + (hσ : Ergodic σ μ) (A D : X → K →L[ℂ] K) (S : K →L[ℂ] K) + (d : X → ℤ → ℂ) + (hS : ∀ j : ℤ, S (lp.single 2 j (1 : ℂ)) = lp.single 2 (j + 1) (1 : ℂ)) + (hm : NullMeasurable (fun x => A x (lp.single 2 (0 : ℤ) (1 : ℂ)) 0) μ) + (hd : ∀ᵐ x ∂μ, Function.Injective (d x)) + (hD : ∀ᵐ x ∂μ, ∀ (v : K) (k : ℤ), D x v k = d x k * v k) + (hAD : ∀ᵐ x ∂μ, A x * D x = D x * A x) + (hAS : ∀ᵐ x ∂μ, A x * S = S * A x) + (hcov : ∀ᵐ x ∂μ, S * A (σ x) = A x * S) : + ∃ c : ℂ, ∀ᵐ x ∂μ, A x = c • (1 : K →L[ℂ] K) := by + apply ae_eq_scalar_of_ergodic_covariance μ σ hσ A S hS hm _ hcov + filter_upwards [hd, hD, hAD, hAS] with x hdx hDx hADx hASx + exact scalar_of_commute_diagonal_and_shift (A x) (D x) S (d x) + hdx hDx hS hADx hASx + +end Invariant233.FiberCentrality + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldCovariance.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..1281a552db407d507176d2cc95058c04c9de88be --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldCovariance.lean @@ -0,0 +1,119 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FieldVectorState +import OAI.Analysis.IrrationalRotation.Operators.HilbertModelSize +import OAI.Analysis.IrrationalRotation.Model.ShiftedPullback + +namespace OAI + +open MeasureTheory Filter +open scoped InnerProductSpace Topology + +namespace Invariant233.FieldTraceCyclic + +variable {Ω E : Type*} [MeasurableSpace Ω] + [NormedAddCommGroup E] [InnerProductSpace ℂ E] + {μ : Measure Ω} [IsFiniteMeasure μ] + +omit [IsFiniteMeasure μ] in + +theorem shiftedPullback_ae (S : E →L[ℂ] E) (σ : Ω → Ω) + (hσ : MeasurePreserving σ μ μ) (ξ : Lp E 2 μ) : + ∀ᵐ x ∂μ, (DirectIntegral.shiftedPullback S σ hσ ξ) x = S (ξ (σ x)) := by + filter_upwards [S.coeFn_compLpL (Lp.compMeasurePreserving σ hσ ξ), + Lp.coeFn_compMeasurePreserving ξ hσ] with x hSx hσx + exact hSx.trans (congrArg S hσx) + +theorem ae_covariance_apply_of_commute + (T J : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : Ω → E →L[ℂ] E) + (S : E →L[ℂ] E) (σ : Ω → Ω) (hσ : MeasurePreserving σ μ μ) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (hJ : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (J ξ) x = S (ξ (σ x))) + (hcomm : Commute T J) (v : E) : + ∀ᵐ x ∂μ, A x (S v) = S (A (σ x) v) := by + let c := Lp.const 2 μ v + have hc : ∀ᵐ x ∂μ, c (σ x) = v := + hσ.quasiMeasurePreserving.ae (Lp.coeFn_const 2 μ v) + have hTc : ∀ᵐ x ∂μ, (T c) (σ x) = A (σ x) (c (σ x)) := + hσ.quasiMeasurePreserving.ae (hT c) + have heq : T (J c) = J (T c) := + congrArg (fun R : Lp E 2 μ →L[ℂ] Lp E 2 μ => R c) hcomm.eq + filter_upwards [hT (J c), hJ c, hJ (T c), hc, hTc] with x hTx hJx hJTx hcx hTcx + have heqx := congrArg (fun ξ : Lp E 2 μ => ξ x) heq + rw [hTx, hJx, hJTx, hTcx, hcx] at heqx + exact heqx + +theorem ae_covariance_of_commute [TopologicalSpace.SeparableSpace E] + (T J : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : Ω → E →L[ℂ] E) + (S : E →L[ℂ] E) (σ : Ω → Ω) (hσ : MeasurePreserving σ μ μ) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (hJ : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (J ξ) x = S (ξ (σ x))) + (hcomm : Commute T J) : + ∀ᵐ x ∂μ, A x * S = S * A (σ x) := by + let v := TopologicalSpace.denseSeq E + have hv : DenseRange v := TopologicalSpace.denseRange_denseSeq E + have hall : ∀ᵐ x ∂μ, ∀ n : ℕ, A x (S (v n)) = S (A (σ x) (v n)) := + ae_all_iff.mpr (fun n => ae_covariance_apply_of_commute T J A S σ hσ hT hJ hcomm (v n)) + filter_upwards [hall] with x hx + apply ContinuousLinearMap.ext + intro w + exact hv.induction_on w + (isClosed_eq ((A x).continuous.comp S.continuous) + (S.continuous.comp (A (σ x)).continuous)) hx + +theorem ae_matrix_covariance_of_commute + (b : HilbertBasis ℤ ℂ E) + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : Ω → E →L[ℂ] E) + (J : ℤ → Lp E 2 μ →L[ℂ] Lp E 2 μ) + (S : ℤ → E →ₗᵢ[ℂ] E) (σ : ℤ → Ω → Ω) + (hσ : ∀ r, MeasurePreserving (σ r) μ μ) + (hS : ∀ r k : ℤ, S r (b k) = b (k + r)) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (hJ : ∀ r (ξ : Lp E 2 μ), ∀ᵐ x ∂μ, (J r ξ) x = S r (ξ (σ r x))) + (hcomm : ∀ r, Commute T (J r)) : + ∀ r k l : ℤ, ∀ᵐ x ∂μ, + inner ℂ (b k) (A (σ r x) (b l)) = + inner ℂ (b (k + r)) (A x (b (l + r))) := by + intro r k l + have hv := ae_covariance_apply_of_commute T (J r) A (S r).toContinuousLinearMap + (σ r) (hσ r) hT (hJ r) (hcomm r) (b l) + filter_upwards [hv] with x hx + change A x (S r (b l)) = S r (A (σ r x) (b l)) at hx + calc + inner ℂ (b k) (A (σ r x) (b l)) = + inner ℂ (S r (b k)) (S r (A (σ r x) (b l))) := + ((S r).inner_map_map (b k) (A (σ r x) (b l))).symm + _ = inner ℂ (b (k + r)) (A x (b (l + r))) := by + rw [hS, ← hx, hS] + +omit [IsFiniteMeasure μ] in + +theorem commute_shiftedPullback_of_covariance + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : Ω → E →L[ℂ] E) + (S : E →L[ℂ] E) (σ : Ω → Ω) (hσ : MeasurePreserving σ μ μ) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (hcov : ∀ᵐ x ∂μ, A x * S = S * A (σ x)) : + Commute T (DirectIntegral.shiftedPullback S σ hσ) := by + change T * DirectIntegral.shiftedPullback S σ hσ = + DirectIntegral.shiftedPullback S σ hσ * T + apply ContinuousLinearMap.ext + intro ξ + apply Lp.ext + filter_upwards [hT (DirectIntegral.shiftedPullback S σ hσ ξ), + shiftedPullback_ae S σ hσ ξ, shiftedPullback_ae S σ hσ (T ξ), + hσ.quasiMeasurePreserving.ae (hT ξ), hcov] with x hTx hJx hJTx hTσx hcovx + change (T (DirectIntegral.shiftedPullback S σ hσ ξ)) x = + (DirectIntegral.shiftedPullback S σ hσ (T ξ)) x + rw [hTx, hJx, hJTx, hTσx] + exact congrArg (fun R : E →L[ℂ] E => R (ξ (σ x))) hcovx + +theorem commute_shiftedPullback_iff_covariance [TopologicalSpace.SeparableSpace E] + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : Ω → E →L[ℂ] E) + (S : E →L[ℂ] E) (σ : Ω → Ω) (hσ : MeasurePreserving σ μ μ) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) : + Commute T (DirectIntegral.shiftedPullback S σ hσ) ↔ + ∀ᵐ x ∂μ, A x * S = S * A (σ x) := by + exact ⟨ae_covariance_of_commute T _ A S σ hσ hT (shiftedPullback_ae S σ hσ), + commute_shiftedPullback_of_covariance T A S σ hσ hT⟩ + +end Invariant233.FieldTraceCyclic + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldHalflineNonmembership.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldHalflineNonmembership.lean new file mode 100644 index 0000000000000000000000000000000000000000..ccda8421c7692e8b1cbcdd903ab44d1333e65b96 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldHalflineNonmembership.lean @@ -0,0 +1,65 @@ +import OAI.Analysis.IrrationalRotation.Rotation.FieldWeightedShiftHalfline +import OAI.Analysis.IrrationalRotation.Model.ShiftedPullback + +namespace OAI + +noncomputable section +open MeasureTheory Filter +namespace Invariant233.WeightedShift +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem commute_of_constantField_commute_shiftedPullback + [IsFiniteMeasure μ] [NeZero μ] + (A S : Hilbert →L[ℂ] Hilbert) (σ : X → X) + (hσ : MeasurePreserving σ μ μ) + (h : Commute (A.compLpL 2 μ) (DirectIntegral.shiftedPullback S σ hσ)) : + Commute A S := by + have hJ (f : Lp Hilbert 2 μ) : + DirectIntegral.shiftedPullback S σ hσ f =ᵐ[μ] fun x => S (f (σ x)) := by + filter_upwards [S.coeFn_compLpL (Lp.compMeasurePreserving σ hσ f), + Lp.coeFn_compMeasurePreserving f hσ] with x hSx hσx + exact hSx.trans (congrArg S hσx) + change A * S = S * A + apply ContinuousLinearMap.ext + intro v + let f : Lp Hilbert 2 μ := Lp.const 2 μ v + have hconst : ∀ᵐ x ∂μ, f (σ x) = v := + hσ.quasiMeasurePreserving.ae (Lp.coeFn_const 2 μ v) + have hA : ∀ᵐ x ∂μ, A.compLpL 2 μ f (σ x) = A (f (σ x)) := + hσ.quasiMeasurePreserving.ae (constantField_ae A f) + have he : ∀ᵐ x ∂μ, A (S v) = S (A v) := by + filter_upwards [constantField_ae A (DirectIntegral.shiftedPullback S σ hσ f), + hJ f, hJ (A.compLpL 2 μ f), hconst, hA] with x ha hj hja hc haf + have hex := congrArg + (fun T : Lp Hilbert 2 μ →L[ℂ] Lp Hilbert 2 μ => T f x) h.eq + change A.compLpL 2 μ (DirectIntegral.shiftedPullback S σ hσ f) x = + DirectIntegral.shiftedPullback S σ hσ (A.compLpL 2 μ f) x at hex + rw [ha, hj, hja, haf, hc] at hex + exact hex + exact he.exists.choose_spec + +theorem tailProjection_not_commute_shift (m : ℤ) : + ¬ Commute (tailProjection m) (shift 1).toLinearIsometry.toContinuousLinearMap := by + intro h + have he := congrArg + (fun T : Hilbert →L[ℂ] Hilbert => T (lp.single 2 (m-1) 1) m) h.eq + have hm : ¬ m ≤ m-1 := by omega + change (tailProjection m (shift 1 (lp.single 2 (m-1) 1))) m = + (shift 1 (tailProjection m (lp.single 2 (m-1) 1))) m at he + simp [shift_apply, hm] at he + +theorem fieldTailProjection_not_commute_shiftedPullback + [IsFiniteMeasure μ] [NeZero μ] (m : ℤ) (σ : X → X) + (hσ : MeasurePreserving σ μ μ) : + ¬ Commute (fieldTailProjection (μ := μ) m) + (DirectIntegral.shiftedPullback + (shift 1).toLinearIsometry.toContinuousLinearMap σ hσ) := by + intro h + exact tailProjection_not_commute_shift m + (commute_of_constantField_commute_shiftedPullback _ _ σ hσ h) + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldKoopman.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldKoopman.lean new file mode 100644 index 0000000000000000000000000000000000000000..41ce14b9759cbc8221f47d35867358f4a4f5d003 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldKoopman.lean @@ -0,0 +1,126 @@ +import OAI.Analysis.IrrationalRotation.Model.ShiftedPullback +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped Topology + +namespace Invariant233.FieldKoopman + +variable {X E : Type*} [MeasurableSpace X] + [NormedAddCommGroup E] [NormedSpace ℂ E] {μ : Measure X} + +open DirectIntegral + +theorem operator_ae (S : E →L[ℂ] E) (σ : X → X) (hσ : MeasurePreserving σ μ μ) + (ξ : Lp E 2 μ) : + shiftedPullback S σ hσ ξ =ᵐ[μ] fun x => S (ξ (σ x)) := by + filter_upwards [S.coeFn_compLpL (Lp.compMeasurePreserving σ hσ ξ), + Lp.coeFn_compMeasurePreserving ξ hσ] with x hx hy + exact hx.trans (congrArg S hy) + +theorem operator_mul (S R : E →L[ℂ] E) (σ τ : X → X) + (hσ : MeasurePreserving σ μ μ) (hτ : MeasurePreserving τ μ μ) : + shiftedPullback S σ hσ * shiftedPullback R τ hτ = + shiftedPullback (S * R) (τ ∘ σ) (hτ.comp hσ) := by + apply ContinuousLinearMap.ext + intro ξ + apply Lp.ext + filter_upwards [operator_ae S σ hσ (shiftedPullback R τ hτ ξ), + hσ.quasiMeasurePreserving.ae (operator_ae R τ hτ ξ), + operator_ae (S * R) (τ ∘ σ) (hτ.comp hσ) ξ] with x hx hy hz + change shiftedPullback S σ hσ (shiftedPullback R τ hτ ξ) x = _ + rw [hx, hy, hz] + rfl + +theorem operator_one_id : + shiftedPullback (1 : E →L[ℂ] E) id (MeasurePreserving.id μ) = 1 := by + apply ContinuousLinearMap.ext + intro ξ + apply Lp.ext + filter_upwards [operator_ae (1 : E →L[ℂ] E) id (MeasurePreserving.id μ) ξ] with x hx + exact hx + +theorem operator_mul_eq_one (S R : E →L[ℂ] E) (σ τ : X → X) + (hσ : MeasurePreserving σ μ μ) (hτ : MeasurePreserving τ μ μ) + (hSR : S * R = 1) (hτσ : τ ∘ σ = id) : + shiftedPullback S σ hσ * shiftedPullback R τ hτ = 1 := by + rw [operator_mul, hSR] + simpa only [hτσ] using (operator_one_id (E := E) (μ := μ)) + +theorem commute_of_represented_covariance + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : X → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (S : E →L[ℂ] E) (σ : X → X) (hσ : MeasurePreserving σ μ μ) + (hcov : ∀ᵐ x ∂μ, A x * S = S * A (σ x)) : + Commute T (shiftedPullback S σ hσ) := by + apply ContinuousLinearMap.ext + intro ξ + apply Lp.ext + filter_upwards [hT (shiftedPullback S σ hσ ξ), operator_ae S σ hσ ξ, + operator_ae S σ hσ (T ξ), hσ.quasiMeasurePreserving.ae (hT ξ), hcov] + with x hTx hJx hJTx hTσx hcovx + change T (shiftedPullback S σ hσ ξ) x = shiftedPullback S σ hσ (T ξ) x + rw [hTx, hJx, hJTx, hTσx] + exact congrArg (fun B : E →L[ℂ] E => B (ξ (σ x))) hcovx + +theorem commute_const (R S : E →L[ℂ] E) (σ : X → X) + (hσ : MeasurePreserving σ μ μ) (hRS : Commute R S) : + Commute (R.compLpL 2 μ) (shiftedPullback S σ hσ) := by + apply commute_of_represented_covariance (R.compLpL 2 μ) (fun _ => R) + (fun ξ => R.coeFn_compLpL ξ) S σ hσ + exact Filter.Eventually.of_forall (fun _ => hRS.eq) + +theorem norm_operator (S : E ≃ₗᵢ[ℂ] E) (σ : X → X) + (hσ : MeasurePreserving σ μ μ) (ξ : Lp E 2 μ) : + ‖shiftedPullback S.toLinearIsometry.toContinuousLinearMap σ hσ ξ‖ = ‖ξ‖ := by + rw [Lp.norm_def, Lp.norm_def] + congr 1 + calc + eLpNorm (shiftedPullback S.toLinearIsometry.toContinuousLinearMap σ hσ ξ) 2 μ = + eLpNorm (fun x => ξ (σ x)) 2 μ := by + apply eLpNorm_congr_norm_ae (Lp.aestronglyMeasurable _) + ((Lp.aestronglyMeasurable ξ).comp_measurePreserving hσ) + filter_upwards [operator_ae S.toLinearIsometry.toContinuousLinearMap σ hσ ξ] + with x hx + rw [hx] + exact S.norm_map _ + _ = eLpNorm ξ 2 μ := + eLpNorm_comp_measurePreserving (Lp.aestronglyMeasurable ξ) hσ + +def equivalence (S : E ≃ₗᵢ[ℂ] E) (σ τ : X → X) + (hσ : MeasurePreserving σ μ μ) (hτ : MeasurePreserving τ μ μ) + (hτσ : τ ∘ σ = id) (hστ : σ ∘ τ = id) : + Lp E 2 μ ≃ₗᵢ[ℂ] Lp E 2 μ where + toFun := shiftedPullback S.toLinearIsometry.toContinuousLinearMap σ hσ + invFun := shiftedPullback S.symm.toLinearIsometry.toContinuousLinearMap τ hτ + map_add' := map_add _ + map_smul' := map_smul _ + left_inv ξ := by + have h := operator_mul_eq_one S.symm.toLinearIsometry.toContinuousLinearMap + S.toLinearIsometry.toContinuousLinearMap τ σ hτ hσ + (by ext v; exact S.symm_apply_apply v) hστ + exact congrArg (fun T : Lp E 2 μ →L[ℂ] Lp E 2 μ => T ξ) h + right_inv ξ := by + have h := operator_mul_eq_one S.toLinearIsometry.toContinuousLinearMap + S.symm.toLinearIsometry.toContinuousLinearMap σ τ hσ hτ + (by ext v; exact S.apply_symm_apply v) hτσ + exact congrArg (fun T : Lp E 2 μ →L[ℂ] Lp E 2 μ => T ξ) h + norm_map' := norm_operator S σ hσ + +theorem operator_mem_unitary + {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℂ F] [CompleteSpace F] + (S : F ≃ₗᵢ[ℂ] F) (σ τ : X → X) + (hσ : MeasurePreserving σ μ μ) (hτ : MeasurePreserving τ μ μ) + (hτσ : τ ∘ σ = id) (hστ : σ ∘ τ = id) : + shiftedPullback S.toLinearIsometry.toContinuousLinearMap σ hσ ∈ + unitary (Lp F 2 μ →L[ℂ] Lp F 2 μ) := by + exact (Unitary.linearIsometryEquiv.symm (equivalence S σ τ hσ hτ hτσ hστ)).property + +end Invariant233.FieldKoopman + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldKoopmanGenerated.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldKoopmanGenerated.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e28dd7752371d462d83f712788701cfc617e2f3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldKoopmanGenerated.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.IrrationalRotation.Rotation.FieldKoopmanDiagonal +import OAI.Analysis.IrrationalRotation.Analysis.GeneratedVonNeumann + +namespace OAI + +namespace Invariant233.FieldKoopman +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem commute_star_left_of_unitary {A J : H →L[ℂ] H} + (hJ : J ∈ unitary (H →L[ℂ] H)) (h : Commute A J) : Commute (star A) J := by + apply Commute.symm + apply (commute_unitary_iff_star_left_conjugate hJ).mpr + have heq := congrArg star ((commute_unitary_iff_star_left_conjugate hJ).mp h.symm) + simpa only [star_mul, star_star, mul_assoc] using heq + +theorem commute_of_mem_generated_of_unitary + (s : Set (H →L[ℂ] H)) {J : H →L[ℂ] H} + (hJ : J ∈ unitary (H →L[ℂ] H)) + (hs : ∀ A ∈ s, Commute A J) {T : H →L[ℂ] H} + (hT : T ∈ vonNeumannGenerated s) : Commute T J := by + have hmem : J ∈ (vonNeumannGenerated s).commutant := by + apply (mem_commutant_vonNeumannGenerated_iff s J).mpr + intro A hA + exact ⟨(hs A hA).eq, (commute_star_left_of_unitary hJ (hs A hA)).eq⟩ + change T * J = J * T + exact (VonNeumannAlgebra.mem_commutant_iff.mp hmem) T hT + +end Invariant233.FieldKoopman + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierAdjoint.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierAdjoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1690f9c138972687ecf83578e32d543a31469f2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierAdjoint.lean @@ -0,0 +1,272 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FieldUnboundedMultiplier +import OAI.Analysis.IrrationalRotation.Rotation.FieldDiagonal + +namespace OAI + +noncomputable section +open MeasureTheory Filter Topology +open scoped ENNReal +namespace Invariant233.WeightedShift +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +private def boundedFieldWeight (a : X → ℤ → ℂ) (ha : ∀ x k, ‖a x k‖ ≤ 1) + (x : X) : Weight := + ⟨a x, memℓp_infty ⟨1, by rintro r ⟨k, rfl⟩; exact ha x k⟩⟩ + +omit [MeasurableSpace X] in +private theorem boundedFieldWeight_norm (a : X → ℤ → ℂ) (ha : ∀ x k, ‖a x k‖ ≤ 1) + (x : X) : ‖boundedFieldWeight a ha x‖ ≤ 1 := + lp.norm_le_of_forall_le (by norm_num) (ha x) + +private def boundedField (a : X → ℤ → ℂ) (ha : ∀ x k, ‖a x k‖ ≤ 1) + (hm : ∀ k, AEStronglyMeasurable (fun x => a x k) μ) : + FieldHilbert μ →L[ℂ] FieldHilbert μ := + fieldDiagonal (boundedFieldWeight a ha) 1 (by norm_num) + (boundedFieldWeight_norm a ha) hm + +private theorem boundedField_ae (a : X → ℤ → ℂ) (ha : ∀ x k, ‖a x k‖ ≤ 1) + (hm : ∀ k, AEStronglyMeasurable (fun x => a x k) μ) (ξ : FieldHilbert μ) : + ∀ᵐ x ∂μ, ∀ k, boundedField a ha hm ξ x k = a x k * ξ x k := + fieldDiagonal_coordinate_ae _ _ _ _ _ ξ + +private def normalizer (z : ℂ) : ℂ := ((1 + ‖z‖)⁻¹ : ℝ) + +private theorem normalizer_ne_zero (z : ℂ) : normalizer z ≠ 0 := by + apply Complex.ofReal_ne_zero.mpr + exact inv_ne_zero (by positivity) + +private theorem normalizer_star (z : ℂ) : star (normalizer z) = normalizer z := by + simp [normalizer] + +private theorem norm_normalizer (z : ℂ) : ‖normalizer z‖ = (1 + ‖z‖)⁻¹ := by + simp only [normalizer, Complex.norm_real, Real.norm_eq_abs] + exact abs_of_nonneg (by positivity) + +private theorem normalizer_bound (z : ℂ) : ‖normalizer z‖ ≤ 1 := by + rw [norm_normalizer] + have hn := norm_nonneg z + exact (inv_le_one₀ (by positivity)).mpr (by linarith) + +private theorem normalized_bound (z : ℂ) : ‖z * normalizer z‖ ≤ 1 := by + rw [norm_mul, norm_normalizer, ← div_eq_mul_inv] + exact (div_le_one (by positivity)).mpr (by linarith [norm_nonneg z]) + +private theorem normalizer_measurable (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) (k : ℤ) : + AEStronglyMeasurable (fun x => normalizer (h x k)) μ := + Complex.continuous_ofReal.comp_aestronglyMeasurable (((hm k).norm.const_add 1).inv₀) + +private def normalizerOperator (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + FieldHilbert μ →L[ℂ] FieldHilbert μ := + boundedField (fun x k => normalizer (h x k)) + (fun x k => normalizer_bound (h x k)) (normalizer_measurable h hm) + +private def normalizedOperator (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + FieldHilbert μ →L[ℂ] FieldHilbert μ := + boundedField (fun x k => h x k * normalizer (h x k)) + (fun x k => normalized_bound (h x k)) + (fun k => (hm k).mul (normalizer_measurable h hm k)) + +private theorem normalizerOperator_ae (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) (ξ : FieldHilbert μ) : + ∀ᵐ x ∂μ, ∀ k, normalizerOperator h hm ξ x k = normalizer (h x k) * ξ x k := + boundedField_ae _ _ _ ξ + +private theorem normalizedOperator_ae (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) (ξ : FieldHilbert μ) : + ∀ᵐ x ∂μ, ∀ k, normalizedOperator h hm ξ x k = + (h x k * normalizer (h x k)) * ξ x k := + boundedField_ae _ _ _ ξ + +private theorem normalizerOperator_selfAdjoint (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + IsSelfAdjoint (normalizerOperator h hm) := by + rw [isSelfAdjoint_iff, ContinuousLinearMap.star_eq_adjoint] + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro ξ η + rw [L2.inner_def, L2.inner_def] + apply integral_congr_ae + filter_upwards [normalizerOperator_ae h hm ξ, normalizerOperator_ae h hm η] + with x hξ hη + rw [lp.inner_eq_tsum, lp.inner_eq_tsum] + apply tsum_congr + intro k + rw [hξ, hη] + simp only [RCLike.inner_apply', map_mul, starRingEnd_apply, normalizer_star] + ring + +private theorem normalizerOperator_injective (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + Function.Injective (normalizerOperator h hm) := by + intro ξ η heq + apply fieldHilbert_ext + filter_upwards [normalizerOperator_ae h hm ξ, normalizerOperator_ae h hm η] + with x hξ hη + intro k + apply mul_left_cancel₀ (normalizer_ne_zero (h x k)) + rw [← hξ, ← hη, heq] + +private theorem normalizer_mem_domain (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) (ξ : FieldHilbert μ) : + normalizerOperator h hm ξ ∈ (fieldUnboundedMultiplier μ h).domain := by + apply (mem_fieldUnboundedMultiplier_domain_iff h _).mpr + refine ⟨normalizedOperator h hm ξ, ?_⟩ + filter_upwards [normalizerOperator_ae h hm ξ, normalizedOperator_ae h hm ξ] + with x hR hS + intro k + rw [hR, hS, mul_assoc] + +private theorem multiplier_normalizer (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) (ξ : FieldHilbert μ) : + fieldUnboundedMultiplier μ h + ⟨normalizerOperator h hm ξ, normalizer_mem_domain h hm ξ⟩ = + normalizedOperator h hm ξ := by + apply fieldUnboundedMultiplier_eq_of_ae + filter_upwards [normalizerOperator_ae h hm ξ, normalizedOperator_ae h hm ξ] + with x hR hS + intro k + rw [hR, hS, mul_assoc] + +theorem dense_fieldUnboundedMultiplier_domain (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + Dense ((fieldUnboundedMultiplier μ h).domain : Set (FieldHilbert μ)) := by + let R := normalizerOperator h hm + have hs : R.adjoint = R := by + simpa only [ContinuousLinearMap.star_eq_adjoint] using + (normalizerOperator_selfAdjoint h hm).star_eq + have hk : R.ker = ⊥ := LinearMap.ker_eq_bot.mpr (normalizerOperator_injective h hm) + have hc : R.range.topologicalClosure = ⊤ := by + have heq := R.orthogonal_ker + rw [hs, hk, Submodule.bot_orthogonal_eq_top] at heq + exact heq.symm + have hd : Dense (R.range : Set (FieldHilbert μ)) := + Submodule.dense_iff_topologicalClosure_eq_top.mpr hc + apply hd.mono + rintro ξ ⟨η, rfl⟩ + exact normalizer_mem_domain h hm η + +private def normalizedStarOperator (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + FieldHilbert μ →L[ℂ] FieldHilbert μ := + boundedField (fun x k => star (h x k * normalizer (h x k))) + (fun x k => by simpa only [norm_star] using normalized_bound (h x k)) + (fun k => ((hm k).mul (normalizer_measurable h hm k)).star) + +private theorem normalizedStarOperator_ae (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) (ξ : FieldHilbert μ) : + ∀ᵐ x ∂μ, ∀ k, normalizedStarOperator h hm ξ x k = + (star (h x k) * normalizer (h x k)) * ξ x k := by + filter_upwards [boundedField_ae + (fun x k => star (h x k * normalizer (h x k))) + (fun x k => by simpa only [norm_star] using normalized_bound (h x k)) + (fun k => ((hm k).mul (normalizer_measurable h hm k)).star) ξ] with x hx + intro k + simpa only [normalizedStarOperator, star_mul, normalizer_star, mul_comm] using hx k + +private theorem normalizedOperator_adjoint (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + (normalizedOperator h hm).adjoint = normalizedStarOperator h hm := by + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro ξ η + rw [L2.inner_def, L2.inner_def] + apply integral_congr_ae + filter_upwards [normalizedStarOperator_ae h hm ξ, normalizedOperator_ae h hm η] + with x hξ hη + rw [lp.inner_eq_tsum, lp.inner_eq_tsum] + apply tsum_congr + intro k + rw [hξ, hη] + simp only [RCLike.inner_apply', map_mul, starRingEnd_apply, star_star, normalizer_star] + ring + +theorem adjoint_fieldUnboundedMultiplier_apply_ae (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) + (ξ : (fieldUnboundedMultiplier μ h).adjoint.domain) : + ∀ᵐ x ∂μ, ∀ k, (fieldUnboundedMultiplier μ h).adjoint ξ x k = + star (h x k) * ξ.val x k := by + let R := normalizerOperator h hm + let S := normalizedOperator h hm + have hs : R.adjoint = R := by + simpa only [ContinuousLinearMap.star_eq_adjoint] using + (normalizerOperator_selfAdjoint h hm).star_eq + have heq : R ((fieldUnboundedMultiplier μ h).adjoint ξ) = S.adjoint ξ.val := by + apply ext_inner_right ℂ + intro η + calc + inner ℂ (R ((fieldUnboundedMultiplier μ h).adjoint ξ)) η = + inner ℂ ((fieldUnboundedMultiplier μ h).adjoint ξ) (R η) := by + simpa only [hs] using + R.adjoint_inner_left η ((fieldUnboundedMultiplier μ h).adjoint ξ) + _ = inner ℂ ξ.val (S η) := by + have hf := LinearPMap.adjoint_isFormalAdjoint + (dense_fieldUnboundedMultiplier_domain h hm) ξ + ⟨R η, normalizer_mem_domain h hm η⟩ + simpa only [R, S, multiplier_normalizer] using hf + _ = inner ℂ (S.adjoint ξ.val) η := (S.adjoint_inner_left η ξ.val).symm + have heq' : normalizerOperator h hm ((fieldUnboundedMultiplier μ h).adjoint ξ) = + normalizedStarOperator h hm ξ.val := by + simpa only [R, S, normalizedOperator_adjoint] using heq + filter_upwards [normalizerOperator_ae h hm ((fieldUnboundedMultiplier μ h).adjoint ξ), + normalizedStarOperator_ae h hm ξ.val] with x hR hS + intro k + apply mul_left_cancel₀ (normalizer_ne_zero (h x k)) + calc + normalizer (h x k) * (fieldUnboundedMultiplier μ h).adjoint ξ x k = + normalizerOperator h hm ((fieldUnboundedMultiplier μ h).adjoint ξ) x k := + (hR k).symm + _ = normalizedStarOperator h hm ξ.val x k := by rw [heq'] + _ = (star (h x k) * normalizer (h x k)) * ξ.val x k := hS k + _ = normalizer (h x k) * (star (h x k) * ξ.val x k) := by ring + +theorem adjoint_fieldUnboundedMultiplier (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + (fieldUnboundedMultiplier μ h).adjoint = + fieldUnboundedMultiplier μ (fun x k => star (h x k)) := by + apply le_antisymm + · constructor + · intro ξ hξ + apply (mem_fieldUnboundedMultiplier_domain_iff _ _).mpr + exact ⟨(fieldUnboundedMultiplier μ h).adjoint ⟨ξ, hξ⟩, + adjoint_fieldUnboundedMultiplier_apply_ae h hm ⟨ξ, hξ⟩⟩ + · intro ξ η hξη + symm + apply fieldUnboundedMultiplier_eq_of_ae + filter_upwards [adjoint_fieldUnboundedMultiplier_apply_ae h hm ξ] with x hx + intro k + rw [hx, hξη] + · exact LinearPMap.IsFormalAdjoint.le_adjoint + (dense_fieldUnboundedMultiplier_domain h hm) + (fieldUnboundedMultiplier_formalAdjoint h) + +theorem isSelfAdjoint_fieldUnboundedMultiplier_real (h : X → ℤ → ℝ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + IsSelfAdjoint (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))) := by + rw [LinearPMap.isSelfAdjoint_def, + adjoint_fieldUnboundedMultiplier _ + (fun k => Complex.continuous_ofReal.comp_aestronglyMeasurable (hm k))] + congr 1 + funext x k + simp + +theorem isClosed_fieldUnboundedMultiplier_real (h : X → ℤ → ℝ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).IsClosed := + (isSelfAdjoint_fieldUnboundedMultiplier_real h hm).isClosed + +theorem fieldMultiplier_denseRange (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) + (hh : ∀ᵐ x ∂μ, ∀ k, h x k ≠ 0) : + DenseRange (fieldUnboundedMultiplier μ h) := by + change Dense (LinearMap.range (fieldUnboundedMultiplier μ h).toFun : Set (FieldHilbert μ)) + rw [fieldMultiplier_range h hh] + exact dense_fieldUnboundedMultiplier_domain _ (fun k => (hm k).inv₀) + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierClosed.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierClosed.lean new file mode 100644 index 0000000000000000000000000000000000000000..3083405bfe97c4f56198a2521fc641467758a180 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierClosed.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FieldMultiplierAdjoint + +namespace OAI + +noncomputable section +open MeasureTheory Filter +namespace Invariant233.WeightedShift +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem fieldUnboundedMultiplier_congr_ae {h g : X → ℤ → ℂ} + (hhg : ∀ᵐ x ∂μ, ∀ k, h x k = g x k) : + fieldUnboundedMultiplier μ h = fieldUnboundedMultiplier μ g := by + apply LinearPMap.eq_of_eq_graph + rw [fieldUnboundedMultiplier_graph, fieldUnboundedMultiplier_graph] + ext p + constructor + · intro hp + filter_upwards [hp, hhg] with x hp hx + intro k + rw [← hx k] + exact hp k + · intro hp + filter_upwards [hp, hhg] with x hp hx + intro k + rw [hx k] + exact hp k + +theorem fieldUnboundedMultiplier_isClosed (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + (fieldUnboundedMultiplier μ h).IsClosed := by + have hc := LinearPMap.adjoint_isClosed + (dense_fieldUnboundedMultiplier_domain (fun x k => star (h x k)) + (fun k => (hm k).star)) + rw [adjoint_fieldUnboundedMultiplier (fun x k => star (h x k)) + (fun k => (hm k).star)] at hc + simpa only [star_star] using hc + +theorem isClosed_fieldMultiplierGraph (h : X → ℤ → ℂ) + (hm : ∀ k, AEStronglyMeasurable (fun x => h x k) μ) : + IsClosed (fieldMultiplierGraph μ h : Set (FieldHilbert μ × FieldHilbert μ)) := by + have hc := fieldUnboundedMultiplier_isClosed h hm + rw [LinearPMap.IsClosed, fieldUnboundedMultiplier_graph] at hc + exact hc + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierCutoff.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..d98e265205aa57a6e3812e0a8dbabbfee0e5f0cb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierCutoff.lean @@ -0,0 +1,381 @@ +import OAI.Analysis.IrrationalRotation.Model.SpectralCutoff +import OAI.Analysis.IrrationalRotation.Analysis.FieldMultiplierAdjoint +import Mathlib.Analysis.Normed.Group.Tannery +import Mathlib.MeasureTheory.Integral.DominatedConvergence + +namespace OAI + +noncomputable section +open MeasureTheory Filter Topology +open scoped ENNReal +namespace Invariant233.WeightedShift.SpectralCutoff +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem boundedOperator_ae (a : X → ℤ → ℂ) (C : ℝ) (hC : 0 ≤ C) + (ha : ∀ x k, ‖a x k‖ ≤ C) + (hm : ∀ k, AEStronglyMeasurable (fun x => a x k) μ) (ξ : FieldHilbert μ) : + ∀ᵐ x ∂μ, ∀ k, boundedOperator a C hC ha hm ξ x k = a x k * ξ x k := + fieldDiagonal_coordinate_ae _ _ _ _ _ ξ + +theorem projection_ae (h : X → ℤ → ℝ) (hm : ∀ k, Measurable (fun x => h x k)) + (n : ℕ) (ξ : FieldHilbert μ) : + ∀ᵐ x ∂μ, ∀ k, projection h hm n ξ x k = symbol n (h x k) * ξ x k := + boundedOperator_ae _ _ _ _ _ ξ + +theorem symbol_mul_self (n : ℕ) (r : ℝ) : symbol n r * symbol n r = symbol n r := by + classical + by_cases hr : r ∈ window n <;> simp [symbol, hr] + +theorem star_symbol (n : ℕ) (r : ℝ) : star (symbol n r) = symbol n r := by + classical + by_cases hr : r ∈ window n <;> simp [symbol, hr] + +theorem projection_isStarProjection (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + IsStarProjection (projection (μ := μ) h hm n) := by + constructor + · change projection h hm n * projection h hm n = projection h hm n + apply ContinuousLinearMap.ext + intro ξ + apply fieldHilbert_ext + filter_upwards [projection_ae h hm n ξ, + projection_ae h hm n (projection h hm n ξ)] with x hξ hE + intro k + change projection h hm n (projection h hm n ξ) x k = projection h hm n ξ x k + rw [hE, hξ, ← mul_assoc, symbol_mul_self] + · rw [isSelfAdjoint_iff, ContinuousLinearMap.star_eq_adjoint] + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro ξ η + rw [L2.inner_def, L2.inner_def] + apply integral_congr_ae + filter_upwards [projection_ae h hm n ξ, projection_ae h hm n η] with x hξ hη + rw [lp.inner_eq_tsum, lp.inner_eq_tsum] + apply tsum_congr + intro k + rw [hξ, hη] + simp only [RCLike.inner_apply', map_mul, starRingEnd_apply, star_symbol] + ring + +theorem symbol_eventually_one {r : ℝ} (hr : 0 < r) : + ∀ᶠ n : ℕ in atTop, symbol n r = 1 := by + obtain ⟨N, hN⟩ := exists_nat_gt (max r r⁻¹) + filter_upwards [eventually_ge_atTop N] with n hn + have hNn : (N : ℝ) ≤ n := by exact_mod_cast hn + have hrn : r ≤ n + 1 := by have := le_max_left r r⁻¹; linarith + have hirn : r⁻¹ ≤ n + 1 := by have := le_max_right r r⁻¹; linarith + have hin : r ∈ window n := + ⟨(inv_le_comm₀ (by positivity) hr).mpr hirn, hrn⟩ + simp [symbol, hin] + +theorem fiber_error_norm_le (h : ℤ → ℝ) (n : ℕ) (ξ : Hilbert) : + ‖diagonal (boundedWeight (fun (_ : Unit) k => symbol n (h k)) 1 + (fun _ k => norm_symbol_le n (h k)) ()) ξ - ξ‖ ≤ ‖ξ‖ := by + apply lp.norm_mono (by norm_num) + intro k + change ‖symbol n (h k) * ξ k - ξ k‖ ≤ ‖ξ k‖ + classical + by_cases hk : h k ∈ window n <;> simp [symbol, hk] + +theorem fiber_error_sq_tendsto (h : ℤ → ℝ) (hh : ∀ k, 0 < h k) (ξ : Hilbert) : + Tendsto (fun n => ‖diagonal (boundedWeight (fun (_ : Unit) k => symbol n (h k)) 1 + (fun _ k => norm_symbol_le n (h k)) ()) ξ - ξ‖ ^ 2) atTop (𝓝 0) := by + have hsum : Summable (fun k => ‖ξ k‖ ^ 2) := by + simpa using (lp.memℓp ξ).summable (by norm_num : 0 < (2 : ENNReal).toReal) + have ht := tendsto_tsum_of_dominated_convergence + (f := fun n k => ‖symbol n (h k) * ξ k - ξ k‖ ^ 2) + (g := fun _ : ℤ => (0 : ℝ)) hsum + (fun k => tendsto_const_nhds.congr' ((symbol_eventually_one (hh k)).mono + (fun n hn => by simp [hn]))) + (Filter.Eventually.of_forall fun n k => by + classical + by_cases hk : h k ∈ window n <;> simp [symbol, hk]) + have heq (n : ℕ) : + ‖diagonal (boundedWeight (fun (_ : Unit) k => symbol n (h k)) 1 + (fun _ k => norm_symbol_le n (h k)) ()) ξ - ξ‖ ^ 2 = + ∑' k, ‖symbol n (h k) * ξ k - ξ k‖ ^ 2 := by + simpa [boundedWeight] using lp.norm_rpow_eq_tsum (by norm_num : 0 < (2 : ENNReal).toReal) + (diagonal (boundedWeight (fun (_ : Unit) k => symbol n (h k)) 1 + (fun _ k => norm_symbol_le n (h k)) ()) ξ - ξ) + simpa only [← heq, tsum_zero] using ht + +theorem norm_sq_eq_integral (ξ : FieldHilbert μ) : + ‖ξ‖ ^ 2 = ∫ x, ‖ξ x‖ ^ 2 ∂μ := by + rw [← inner_self_eq_norm_sq (𝕜 := ℂ), L2.inner_def] + have hr := integral_re (L2.integrable_inner (𝕜 := ℂ) ξ ξ) + simp only [RCLike.re_eq_complex_re] at hr ⊢ + rw [← hr] + apply integral_congr_ae + exact Filter.Eventually.of_forall fun x => inner_self_eq_norm_sq (𝕜 := ℂ) (ξ x) + +theorem projection_tendsto (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) + (hh : ∀ᵐ x ∂μ, ∀ k, 0 < h x k) (ξ : FieldHilbert μ) : + Tendsto (fun n => projection h hm n ξ) atTop (𝓝 ξ) := by + let D : ℕ → FieldHilbert μ := fun n => projection h hm n ξ - ξ + have hD (n : ℕ) : ∀ᵐ x ∂μ, D n x = + diagonal (boundedWeight (fun (_ : Unit) k => symbol n (h x k)) 1 + (fun _ k => norm_symbol_le n (h x k)) ()) (ξ x) - ξ x := by + filter_upwards [projection_ae h hm n ξ, Lp.coeFn_sub (projection h hm n ξ) ξ] + with x hE hsub + change (projection h hm n ξ - ξ) x = _ + rw [hsub] + apply lp.ext + funext k + change projection h hm n ξ x k - ξ x k = symbol n (h x k) * ξ x k - ξ x k + rw [hE] + have hlim : ∀ᵐ x ∂μ, Tendsto (fun n => ‖D n x‖ ^ 2) atTop (𝓝 (0 : ℝ)) := by + filter_upwards [ae_all_iff.mpr hD, hh] with x hx hh + simp only [hx] + exact fiber_error_sq_tendsto (h x) hh (ξ x) + have hb (n : ℕ) : ∀ᵐ x ∂μ, ‖‖D n x‖ ^ 2‖ ≤ ‖ξ x‖ ^ 2 := by + filter_upwards [hD n] with x hx + rw [Real.norm_of_nonneg (sq_nonneg _), hx] + exact pow_le_pow_left₀ (norm_nonneg _) (fiber_error_norm_le (h x) n (ξ x)) 2 + have hi : Integrable (fun x => ‖ξ x‖ ^ 2) μ := + (memLp_two_iff_integrable_sq_norm (Lp.aestronglyMeasurable ξ)).mp (Lp.memLp ξ) + have ht := tendsto_integral_of_dominated_convergence (fun x => ‖ξ x‖ ^ 2) + (fun n => ((Lp.aestronglyMeasurable (D n)).norm).pow 2) hi hb hlim + have hs : Tendsto (fun n => ‖D n‖ ^ 2) atTop (𝓝 (0 : ℝ)) := by + simpa only [Pi.pow_apply, ← norm_sq_eq_integral, integral_zero] using ht + rw [tendsto_iff_norm_sub_tendsto_zero] + simpa only [Real.sqrt_sq (norm_nonneg _), Real.sqrt_zero] using hs.sqrt + +theorem norm_boundedOperator_le (a : X → ℤ → ℂ) (C : ℝ) (hC : 0 ≤ C) + (ha : ∀ x k, ‖a x k‖ ≤ C) + (hm : ∀ k, AEStronglyMeasurable (fun x => a x k) μ) : + ‖boundedOperator a C hC ha hm‖ ≤ C := + norm_fieldDiagonal_le _ _ _ _ _ + +theorem productOperator_ae (h : X → ℤ → ℝ) (hm : ∀ k, Measurable (fun x => h x k)) + (n : ℕ) (ξ : FieldHilbert μ) : + ∀ᵐ x ∂μ, ∀ k, productOperator h hm n ξ x k = productSymbol n (h x k) * ξ x k := + boundedOperator_ae _ _ _ _ _ ξ + +theorem inverseOperator_ae (h : X → ℤ → ℝ) (hm : ∀ k, Measurable (fun x => h x k)) + (n : ℕ) (ξ : FieldHilbert μ) : + ∀ᵐ x ∂μ, ∀ k, inverseOperator h hm n ξ x k = inverseSymbol n (h x k) * ξ x k := + boundedOperator_ae _ _ _ _ _ ξ + +theorem norm_productOperator_le (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + ‖productOperator (μ := μ) h hm n‖ ≤ n + 1 := norm_boundedOperator_le _ _ _ _ _ + +theorem norm_inverseOperator_le (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + ‖inverseOperator (μ := μ) h hm n‖ ≤ n + 1 := norm_boundedOperator_le _ _ _ _ _ + +theorem projection_mem_domain (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) (ξ : FieldHilbert μ) : + projection h hm n ξ ∈ (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).domain := by + apply (mem_fieldUnboundedMultiplier_domain_iff _ _).mpr + refine ⟨productOperator h hm n ξ, ?_⟩ + filter_upwards [projection_ae h hm n ξ, productOperator_ae h hm n ξ] with x hP hT + intro k + rw [hP, hT] + exact mul_assoc _ _ _ + +theorem multiplier_projection (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) (ξ : FieldHilbert μ) : + fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ)) + ⟨projection h hm n ξ, projection_mem_domain h hm n ξ⟩ = productOperator h hm n ξ := by + apply fieldUnboundedMultiplier_eq_of_ae + filter_upwards [projection_ae h hm n ξ, productOperator_ae h hm n ξ] with x hP hT + intro k + rw [hP, hT] + exact mul_assoc _ _ _ + +theorem inverseSymbol_mul_productSymbol (n : ℕ) (r : ℝ) : + inverseSymbol n r * productSymbol n r = symbol n r := by + classical + by_cases hr : r ∈ window n + · have hr0 : r ≠ 0 := ne_of_gt (lt_of_lt_of_le (by positivity) hr.1) + simp [inverseSymbol, productSymbol, symbol, hr, hr0] + · simp [inverseSymbol, productSymbol, symbol, hr] + +theorem inverseOperator_mul_productOperator (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + inverseOperator (μ := μ) h hm n * productOperator h hm n = projection h hm n := by + apply ContinuousLinearMap.ext + intro ξ + apply fieldHilbert_ext + filter_upwards [projection_ae h hm n ξ, productOperator_ae h hm n ξ, + inverseOperator_ae h hm n (productOperator h hm n ξ)] with x hP hT hI + intro k + change inverseOperator h hm n (productOperator h hm n ξ) x k = projection h hm n ξ x k + rw [hI, hT, hP, ← mul_assoc, inverseSymbol_mul_productSymbol] + +theorem projection_apply_of_mem_range (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) + {ξ : FieldHilbert μ} (hξ : ξ ∈ (projection h hm n).range) : projection h hm n ξ = ξ := by + obtain ⟨η, rfl⟩ := hξ + exact congrArg (fun A : FieldHilbert μ →L[ℂ] FieldHilbert μ => A η) + (projection_isStarProjection h hm n).isIdempotentElem.eq + +theorem projection_range_le_domain (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + (projection h hm n).range ≤ + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).domain := by + rintro ξ ⟨η, rfl⟩ + exact projection_mem_domain h hm n η + +theorem multiplier_on_range (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) + (ξ : (projection (μ := μ) h hm n).range) : + fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ)) + ⟨ξ.val, projection_range_le_domain h hm n ξ.property⟩ = productOperator h hm n ξ.val := by + have hmP := multiplier_projection h hm n ξ.val + have heq := projection_apply_of_mem_range h hm n ξ.property + simpa only [heq] using hmP + +theorem multiplier_range_bounds (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) + (ξ : (projection (μ := μ) h hm n).range) : + let η := fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ)) + ⟨ξ.val, projection_range_le_domain h hm n ξ.property⟩ + ‖η‖ ≤ (n + 1 : ℝ) * ‖ξ.val‖ ∧ ‖ξ.val‖ ≤ (n + 1 : ℝ) * ‖η‖ := by + dsimp only + rw [multiplier_on_range] + constructor + · exact (productOperator h hm n).le_of_opNorm_le (norm_productOperator_le h hm n) ξ.val + · have heq : inverseOperator h hm n (productOperator h hm n ξ.val) = ξ.val := by + have he := congrArg (fun A : FieldHilbert μ →L[ℂ] FieldHilbert μ => A ξ.val) + (inverseOperator_mul_productOperator (μ := μ) h hm n) + exact he.trans (projection_apply_of_mem_range h hm n ξ.property) + have hb := (inverseOperator h hm n).le_of_opNorm_le (norm_inverseOperator_le h hm n) + (productOperator h hm n ξ.val) + rwa [heq] at hb + +theorem real_mul_inverseSymbol (n : ℕ) (r : ℝ) : + (r : ℂ) * inverseSymbol n r = symbol n r := by + classical + by_cases hr : r ∈ window n + · have hr0 : r ≠ 0 := ne_of_gt (lt_of_lt_of_le (by positivity) hr.1) + simp [inverseSymbol, symbol, hr, hr0] + · simp [inverseSymbol, symbol, hr] + +theorem inverseOperator_mem_domain (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) (ξ : FieldHilbert μ) : + inverseOperator h hm n ξ ∈ + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).domain := by + apply (mem_fieldUnboundedMultiplier_domain_iff _ _).mpr + refine ⟨projection h hm n ξ, ?_⟩ + filter_upwards [projection_ae h hm n ξ, inverseOperator_ae h hm n ξ] with x hP hI + intro k + rw [hP, hI, ← mul_assoc, real_mul_inverseSymbol] + +theorem multiplier_inverseOperator (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) (ξ : FieldHilbert μ) : + fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ)) + ⟨inverseOperator h hm n ξ, inverseOperator_mem_domain h hm n ξ⟩ = projection h hm n ξ := by + apply fieldUnboundedMultiplier_eq_of_ae + filter_upwards [projection_ae h hm n ξ, inverseOperator_ae h hm n ξ] with x hP hI + intro k + rw [hP, hI, ← mul_assoc, real_mul_inverseSymbol] + +theorem projection_mem_inverse_domain (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) (ξ : FieldHilbert μ) : + projection h hm n ξ ∈ + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).inverse.domain := by + rw [LinearPMap.inverse_domain] + exact ⟨⟨inverseOperator h hm n ξ, inverseOperator_mem_domain h hm n ξ⟩, + multiplier_inverseOperator h hm n ξ⟩ + +theorem projection_range_le_inverse_domain (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + (projection h hm n).range ≤ + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).inverse.domain := by + rintro ξ ⟨η, rfl⟩ + exact projection_mem_inverse_domain h hm n η + +theorem inverse_multiplier_projection (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) + (hh : ∀ᵐ x ∂μ, ∀ k, 0 < h x k) (n : ℕ) (ξ : FieldHilbert μ) : + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).inverse + ⟨projection h hm n ξ, projection_mem_inverse_domain h hm n ξ⟩ = inverseOperator h hm n ξ := by + have hker : (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).ker = ⊥ := by + apply LinearPMap.ker_eq_bot.mpr + apply fieldUnboundedMultiplier_injective + filter_upwards [hh] with x hx k + exact Complex.ofReal_ne_zero.mpr (ne_of_gt (hx k)) + exact LinearPMap.inverse_apply_eq + (y := ⟨projection h hm n ξ, projection_mem_inverse_domain h hm n ξ⟩) + (x := ⟨inverseOperator h hm n ξ, inverseOperator_mem_domain h hm n ξ⟩) + hker (multiplier_inverseOperator h hm n ξ) + +theorem inverse_multiplier_on_range (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) + (hh : ∀ᵐ x ∂μ, ∀ k, 0 < h x k) (n : ℕ) + (ξ : (projection (μ := μ) h hm n).range) : + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).inverse + ⟨ξ.val, projection_range_le_inverse_domain h hm n ξ.property⟩ = inverseOperator h hm n ξ.val := by + have hmP := inverse_multiplier_projection h hm hh n ξ.val + have heq := projection_apply_of_mem_range h hm n ξ.property + simpa only [heq] using hmP + +theorem productOperator_mul_inverseOperator (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + productOperator (μ := μ) h hm n * inverseOperator h hm n = projection h hm n := by + apply ContinuousLinearMap.ext + intro ξ + apply fieldHilbert_ext + filter_upwards [projection_ae h hm n ξ, inverseOperator_ae h hm n ξ, + productOperator_ae h hm n (inverseOperator h hm n ξ)] with x hP hI hT + intro k + change productOperator h hm n (inverseOperator h hm n ξ) x k = projection h hm n ξ x k + rw [hT, hI, hP, ← mul_assoc, mul_comm (productSymbol n _) (inverseSymbol n _), + inverseSymbol_mul_productSymbol] + +theorem inverse_multiplier_range_bounds (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) + (hh : ∀ᵐ x ∂μ, ∀ k, 0 < h x k) (n : ℕ) + (ξ : (projection (μ := μ) h hm n).range) : + let η := (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).inverse + ⟨ξ.val, projection_range_le_inverse_domain h hm n ξ.property⟩ + ‖η‖ ≤ (n + 1 : ℝ) * ‖ξ.val‖ ∧ ‖ξ.val‖ ≤ (n + 1 : ℝ) * ‖η‖ := by + dsimp only + rw [inverse_multiplier_on_range h hm hh] + constructor + · exact (inverseOperator h hm n).le_of_opNorm_le (norm_inverseOperator_le h hm n) ξ.val + · have heq : productOperator h hm n (inverseOperator h hm n ξ.val) = ξ.val := by + have he := congrArg (fun A : FieldHilbert μ →L[ℂ] FieldHilbert μ => A ξ.val) + (productOperator_mul_inverseOperator (μ := μ) h hm n) + exact he.trans (projection_apply_of_mem_range h hm n ξ.property) + have hb := (productOperator h hm n).le_of_opNorm_le (norm_productOperator_le h hm n) + (inverseOperator h hm n ξ.val) + rwa [heq] at hb + +theorem cutoffSpace_eq_range (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + cutoffSpace (μ := μ) h hm n = (projection h hm n).range := by + exact (ContinuousLinearMap.IsIdempotentElem.isClosed_range + (projection_isStarProjection h hm n).isIdempotentElem).submodule_topologicalClosure_eq + +theorem cutoffSpace_starProjection (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + (cutoffSpace (μ := μ) h hm n).starProjection = projection h hm n := by + obtain ⟨hi, he⟩ := isStarProjection_iff_eq_starProjection_range.mp + (projection_isStarProjection (μ := μ) h hm n) + let := hi + simpa only [cutoffSpace_eq_range] using he.symm + +theorem cutoffSpace_tendsto (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) + (hh : ∀ᵐ x ∂μ, ∀ k, 0 < h x k) (ξ : FieldHilbert μ) : + Tendsto (fun n => (cutoffSpace h hm n).starProjection ξ) atTop (𝓝 ξ) := by + simpa only [cutoffSpace_starProjection] using projection_tendsto h hm hh ξ + +theorem cutoffSpace_le_domains (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + cutoffSpace (μ := μ) h hm n ≤ + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).domain ∧ + cutoffSpace (μ := μ) h hm n ≤ + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).inverse.domain := by + rw [cutoffSpace_eq_range] + exact ⟨projection_range_le_domain h hm n, projection_range_le_inverse_domain h hm n⟩ + +end Invariant233.WeightedShift.SpectralCutoff + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierInverse.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..518b4bd7fe1fe026e73ce86e808bb0251259a440 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierInverse.lean @@ -0,0 +1,42 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FieldUnboundedMultiplier + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal + +namespace Invariant233.WeightedShift + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem inverse_fieldUnboundedMultiplier (h : X → ℤ → ℂ) + (hh : ∀ᵐ x ∂μ, ∀ k, h x k ≠ 0) : + (fieldUnboundedMultiplier μ h).inverse = + fieldUnboundedMultiplier μ (fun x k => (h x k)⁻¹) := by + apply LinearPMap.ext + · rw [LinearPMap.inverse_domain, fieldMultiplier_range h hh] + · intro ξ hξ hη + have hk : (fieldUnboundedMultiplier μ h).toFun.ker = ⊥ := + LinearMap.ker_eq_bot.mpr (fieldUnboundedMultiplier_injective h hh) + have hpartialker : (fieldUnboundedMultiplier μ h).ker = ⊥ := by + simp [LinearPMap.ker, hk] + exact LinearPMap.inverse_apply_eq hpartialker + (x := ⟨fieldUnboundedMultiplier μ (fun x k => (h x k)⁻¹) ⟨ξ, hη⟩, + inverseFieldMultiplier_mem_domain h hh ⟨ξ, hη⟩⟩) + (y := ⟨ξ, hξ⟩) (fieldMultiplier_mul_inverse h hh ⟨ξ, hη⟩) + +theorem inverse_exponential_fieldUnboundedMultiplier (b : X → ℤ → ℝ) : + (fieldUnboundedMultiplier μ (fun x k => (Real.exp (b x k) : ℂ))).inverse = + fieldUnboundedMultiplier μ (fun x k => (Real.exp (-b x k) : ℂ)) := by + rw [inverse_fieldUnboundedMultiplier _ + (Eventually.of_forall fun x k => Complex.ofReal_ne_zero.mpr (Real.exp_ne_zero (b x k)))] + congr 1 + funext x k + simp only [Real.exp_neg, Complex.ofReal_inv] + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..8461e9c1d929e6d3dc3167b0addc0ad337ed657c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldMultiplierTransport.lean @@ -0,0 +1,113 @@ +import OAI.Analysis.IrrationalRotation.Operators.AffiliatedTransport +import OAI.Analysis.IrrationalRotation.Analysis.FieldMultiplierAdjoint +import OAI.Analysis.IrrationalRotation.Model.Rotation + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.WeightedShift + +open InvariantRotation.AffiliatedTransport +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem field_transported_invariant + (h f g : X → ℤ → ℂ) (c : ℂ) (hc : c ≠ 0) + (A B : FieldHilbert μ →L[ℂ] FieldHilbert μ) + (hA : ∀ ξ, ∀ᵐ x ∂μ, ∀ k, A ξ x k = f x (k - 1) * ξ x (k - 1)) + (hB : ∀ ξ, ∀ᵐ x ∂μ, ∀ k, B ξ x k = g x (k - 1) * ξ x (k - 1)) + (hfg : ∀ᵐ x ∂μ, ∀ k, h x (k + 1) * f x k = c * g x k * h x k) + (p : Submodule ℂ (FieldHilbert μ)) (hp : ∀ ξ ∈ p, A ξ ∈ p) : + ∀ η ∈ transported (fieldUnboundedMultiplier μ h) p, + B η ∈ transported (fieldUnboundedMultiplier μ h) p := by + have hD : ∀ ξ ∈ (fieldUnboundedMultiplier μ h).domain, + A ξ ∈ (fieldUnboundedMultiplier μ h).domain := by + intro ξ hξ + exact field_operator_mem_multiplierDomain h f g c A B hA hB hfg ⟨ξ, hξ⟩ + have hAB : ∀ ξ : (fieldUnboundedMultiplier μ h).domain, + fieldUnboundedMultiplier μ h ⟨A ξ, hD ξ ξ.property⟩ = + (c • B) (fieldUnboundedMultiplier μ h ξ) := by + intro ξ + exact field_multiplier_intertwines h f g c A B hA hB hfg ξ + have hinv := transported_invariant (fieldUnboundedMultiplier μ h) p A (c • B) + hp hD hAB + intro η hη + have hm := (transported (fieldUnboundedMultiplier μ h) p).smul_mem c⁻¹ (hinv η hη) + simpa only [smul_apply, smul_smul, inv_mul_cancel₀ hc, one_smul] using hm + +theorem field_transported_projection_invariant + (h f g : X → ℤ → ℂ) (c : ℂ) (hc : c ≠ 0) + (A B : FieldHilbert μ →L[ℂ] FieldHilbert μ) + (hA : ∀ ξ, ∀ᵐ x ∂μ, ∀ k, A ξ x k = f x (k - 1) * ξ x (k - 1)) + (hB : ∀ ξ, ∀ᵐ x ∂μ, ∀ k, B ξ x k = g x (k - 1) * ξ x (k - 1)) + (hfg : ∀ᵐ x ∂μ, ∀ k, h x (k + 1) * f x k = c * g x k * h x k) + (p : Submodule ℂ (FieldHilbert μ)) (hp : ∀ ξ ∈ p, A ξ ∈ p) : + let P := (transported (fieldUnboundedMultiplier μ h) p).starProjection + (1 - P) * B * P = 0 := by + let S := transported (fieldUnboundedMultiplier μ h) p + have hrange : S.starProjection.range ∈ Module.End.invtSubmodule B.toLinearMap := by + rw [Submodule.range_starProjection] + apply (Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mpr + exact field_transported_invariant h f g c hc A B hA hB hfg p hp + have heq := (ContinuousLinearMap.IsIdempotentElem.range_mem_invtSubmodule_iff + S.isIdempotentElem_starProjection).mp hrange + change S.starProjection * B * S.starProjection = B * S.starProjection at heq + change (1 - S.starProjection) * B * S.starProjection = 0 + rw [sub_mul, one_mul, sub_mul, heq, sub_self] + +theorem field_exponential_inverse_transported_orthogonal + (b : X → ℤ → ℝ) (hm : ∀ k, AEStronglyMeasurable (fun x => b x k) μ) + (p : Submodule ℂ (FieldHilbert μ)) : + transported (fieldUnboundedMultiplier μ + (fun x k => (Real.exp (b x k) : ℂ))).inverse pᗮ ≤ + (transported (fieldUnboundedMultiplier μ + (fun x k => (Real.exp (b x k) : ℂ))) p)ᗮ := by + apply inverse_transported_le_orthogonal_of_selfAdjoint + · exact isSelfAdjoint_fieldUnboundedMultiplier_real (fun x k => Real.exp (b x k)) + (fun k => Real.continuous_exp.comp_aestronglyMeasurable (hm k)) + · apply LinearMap.ker_eq_bot.mpr + apply fieldUnboundedMultiplier_injective + exact Filter.Eventually.of_forall fun x k => + Complex.ofReal_ne_zero.mpr (Real.exp_ne_zero (b x k)) + +end Invariant233.WeightedShift + +namespace Invariant233.Rotation + +open InvariantRotation.AffiliatedTransport + +theorem transport_weighted_coordinate_ae (θ : ℝ) (a : C(Circle, ℂ)) (ξ : Hilbert) : + ∀ᵐ x ∂circleMeasure, ∀ k, + weighted θ a ξ x k = a (action θ (k - 1) x) * ξ x (k - 1) := by + have hd : ∀ᵐ x ∂circleMeasure, ∀ k, + representation θ a ξ x k = a (action θ k x) * ξ x k := by + exact WeightedShift.fieldDiagonal_coordinate_ae _ _ _ _ _ ξ + have hu := (WeightedShift.shift 1).toLinearIsometry.toContinuousLinearMap.coeFn_compLpL + (p := 2) (representation θ a ξ) + filter_upwards [hd, hu] with x hd hu + intro k + change ((WeightedShift.shift 1).toLinearIsometry.toContinuousLinearMap.compLpL + 2 circleMeasure (representation θ a ξ)) x k = _ + rw [hu] + exact hd (k - 1) + +theorem weighted_transported_projection_invariant + (θ : ℝ) (h : Circle → ℤ → ℂ) (a b : C(Circle, ℂ)) + (c : ℂ) (hc : c ≠ 0) + (hfg : ∀ᵐ x ∂circleMeasure, ∀ k, + h x (k + 1) * a (action θ k x) = c * b (action θ k x) * h x k) + (p : Submodule ℂ Hilbert) (hp : ∀ ξ ∈ p, weighted θ a ξ ∈ p) : + let P := (transported (WeightedShift.fieldUnboundedMultiplier circleMeasure h) p).starProjection + (1 - P) * weighted θ b * P = 0 := + WeightedShift.field_transported_projection_invariant h + (fun x k => a (action θ k x)) (fun x k => b (action θ k x)) c hc + (weighted θ a) (weighted θ b) + (transport_weighted_coordinate_ae θ a) (transport_weighted_coordinate_ae θ b) + hfg p hp + +end Invariant233.Rotation + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldPositivity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldPositivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc8947fc5687577e949f32224afb5faf660a3d65 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldPositivity.lean @@ -0,0 +1,91 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FieldVectorState +import Mathlib.MeasureTheory.Function.AEEqOfIntegral + +namespace OAI + +open MeasureTheory Filter +open scoped InnerProductSpace Topology ComplexOrder + +namespace Invariant233.FieldTraceCyclic + +variable {Ω E : Type*} [MeasurableSpace Ω] + [NormedAddCommGroup E] [InnerProductSpace ℂ E] + {μ : Measure Ω} [IsFiniteMeasure μ] + +theorem indicator_quadratic_eq_setIntegral + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : Ω → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (v : E) (s : Set Ω) (hs : MeasurableSet s) : + inner ℂ (T (indicatorConstLp 2 hs (measure_ne_top μ s) v)) + (indicatorConstLp 2 hs (measure_ne_top μ s) v) = + ∫ x in s, inner ℂ (A x v) v ∂μ := by + rw [L2.inner_def, ← integral_indicator hs] + apply integral_congr_ae + filter_upwards [indicatorConstLp_coeFn (p := 2) (hs := hs) + (hμs := measure_ne_top μ s) (c := v), + hT (indicatorConstLp 2 hs (measure_ne_top μ s) v)] with x hx hTx + rw [hTx, hx] + by_cases hxs : x ∈ s + · simp only [Set.indicator_of_mem hxs] + · simp only [Set.indicator_of_notMem hxs, map_zero, inner_zero_left] + +theorem integrable_represented_quadratic + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : Ω → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) (v : E) : + Integrable (fun x => inner ℂ (A x v) v) μ := by + apply (L2.integrable_inner (𝕜 := ℂ) (T (Lp.const 2 μ v)) + (Lp.const 2 μ v)).congr + filter_upwards [Lp.coeFn_const 2 μ v, hT (Lp.const 2 μ v)] with x hx hTx + rw [hTx, hx] + rfl + +theorem ae_represented_quadratic_nonneg + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : Ω → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (hpos : T.IsPositive) (v : E) : + ∀ᵐ x ∂μ, 0 ≤ (inner ℂ (A x v) v).re ∧ (inner ℂ (A x v) v).im = 0 := by + have hi := integrable_represented_quadratic T A hT v + have hlocal (s : Set Ω) (hs : MeasurableSet s) : + 0 ≤ ∫ x in s, inner ℂ (A x v) v ∂μ := by + rw [← indicator_quadratic_eq_setIntegral T A hT v s hs] + exact hpos.inner_nonneg_left _ + have hreal : 0 ≤ᵐ[μ] fun x => (inner ℂ (A x v) v).re := by + apply ae_nonneg_of_forall_setIntegral_nonneg hi.re + intro s hs _ + rw [integral_re hi.integrableOn] + exact (Complex.nonneg_iff.mp (hlocal s hs)).1 + have him : (fun x => (inner ℂ (A x v) v).im) =ᵐ[μ] 0 := by + apply hi.im.ae_eq_zero_of_forall_setIntegral_eq_zero + intro s hs _ + rw [integral_im hi.integrableOn] + exact (Complex.nonneg_iff.mp (hlocal s hs)).2.symm + filter_upwards [hreal, him] with x hr hm + exact ⟨hr, hm⟩ + +theorem ae_isPositive_of_represented_isPositive [TopologicalSpace.SeparableSpace E] + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : Ω → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (hpos : T.IsPositive) : ∀ᵐ x ∂μ, (A x).IsPositive := by + let v := TopologicalSpace.denseSeq E + have hv : DenseRange v := TopologicalSpace.denseRange_denseSeq E + have hall : ∀ᵐ x ∂μ, ∀ n : ℕ, + 0 ≤ (inner ℂ (A x (v n)) (v n)).re ∧ + (inner ℂ (A x (v n)) (v n)).im = 0 := + ae_all_iff.mpr (fun n => ae_represented_quadratic_nonneg T A hT hpos (v n)) + filter_upwards [hall] with x hx + apply (ContinuousLinearMap.isPositive_iff_complex (A x)).mpr + intro w + have hc : Continuous (fun w => inner ℂ (A x w) w) := + (A x).continuous.inner continuous_id + have hm : 0 ≤ (inner ℂ (A x w) w).re ∧ (inner ℂ (A x w) w).im = 0 := + hv.induction_on w + ((isClosed_le continuous_const (Complex.continuous_re.comp hc)).inter + (isClosed_eq (Complex.continuous_im.comp hc) continuous_const)) hx + refine ⟨?_, hm.1⟩ + apply Complex.ext + · simp + · simpa using hm.2.symm + +end Invariant233.FieldTraceCyclic + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldPowerBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldPowerBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d4a0ac21b0f6a733c9f8c4015cee82114bd5fb0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldPowerBounds.lean @@ -0,0 +1,63 @@ +import Mathlib.MeasureTheory.Function.LpSpace.Basic +import Mathlib.Analysis.Normed.Operator.Basic +import Mathlib.Analysis.Complex.Basic +import OAI.Analysis.IrrationalRotation.Analysis.ExponentialDecay + +namespace OAI + +noncomputable section +open Filter MeasureTheory +open scoped Topology ENNReal + +namespace InvariantProjection.FieldPowerBounds + +variable {X E : Type*} [MeasurableSpace X] +variable [NormedAddCommGroup E] [NormedSpace ℂ E] +variable {μ : Measure X} + +theorem ae_pow_apply (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : X → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ⇑(T ξ) =ᵐ[μ] fun x => A x (ξ x)) + (n : ℕ) (ξ : Lp E 2 μ) : + ⇑((T ^ n) ξ) =ᵐ[μ] fun x => (A x ^ n) (ξ x) := by + induction n with + | zero => simp + | succ n ih => + rw [pow_succ', mul_apply_eq_comp] + filter_upwards [hT ((T ^ n) ξ), ih] with x hx hix + rw [hx, hix, pow_succ', mul_apply_eq_comp] + +theorem norm_pow_le (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : X → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ⇑(T ξ) =ᵐ[μ] fun x => A x (ξ x)) + (n : ℕ) {B : ℝ} (hB : 0 ≤ B) (hA : ∀ᵐ x ∂μ, ‖A x ^ n‖ ≤ B) : + ‖T ^ n‖ ≤ B := by + apply ContinuousLinearMap.opNorm_le_bound _ hB + intro ξ + apply Lp.norm_le_mul_norm_of_ae_le_mul + filter_upwards [ae_pow_apply T A hT n ξ, hA] with x hx hAx + rw [hx] + exact ((A x ^ n).le_opNorm (ξ x)).trans + (mul_le_mul_of_nonneg_right hAx (norm_nonneg _)) + +theorem all_rates_norm_decay (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (A : X → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ⇑(T ξ) =ᵐ[μ] fun x => A x (ξ x)) + (hA : ∀ a : ℝ, 0 < a → ∀ᶠ (n : ℕ) in atTop, + ∀ᵐ x ∂μ, ‖A x ^ n‖ ≤ Real.exp (-a * n)) : + ∀ a : ℝ, 0 < a → ∀ᶠ (n : ℕ) in atTop, + ‖T ^ n‖ ≤ Real.exp (-a * n) := by + intro a ha + filter_upwards [hA a ha] with n hn + exact norm_pow_le T A hT n (Real.exp_nonneg _) hn + +theorem norm_quasinilpotent (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : X → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ⇑(T ξ) =ᵐ[μ] fun x => A x (ξ x)) + (hA : ∀ a : ℝ, 0 < a → ∀ᶠ (n : ℕ) in atTop, + ∀ᵐ x ∂μ, ‖A x ^ n‖ ≤ Real.exp (-a * n)) : + Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) atTop (𝓝 0) := + Invariant233.norm_quasinilpotent_of_exponential_decay T (all_rates_norm_decay T A hT hA) + +end InvariantProjection.FieldPowerBounds + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldShiftMoments.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldShiftMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..6839b023a9dd2defa300ec745d05c0787de68393 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldShiftMoments.lean @@ -0,0 +1,111 @@ +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties +import OAI.Analysis.IrrationalRotation.Model.Product +import OAI.Analysis.IrrationalRotation.Analysis.FieldPowerBounds +import OAI.Analysis.IrrationalRotation.Rotation.WeightedShiftPowers +import OAI.Analysis.IrrationalRotation.Spectral.QuasinilpotentSeries + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal + +namespace Invariant233.WeightedShift + +theorem inner_single_operator_pow_eq_zero (w : Weight) (n : ℕ) (hn : 0 < n) + (k : ℤ) (a : ℂ) : + inner ℂ (lp.single 2 k a) ((operator w ^ n) (lp.single 2 k a)) = 0 := by + rw [lp.inner_single_left, operator_pow_apply] + have hk : k - (n : ℤ) ≠ k := by omega + simp [lp.single_apply, hk] + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} [IsFiniteMeasure μ] + +theorem vectorTrace_const_pow_eq_zero + (T : Lp Hilbert 2 μ →L[ℂ] Lp Hilbert 2 μ) (w : X → Weight) + (hT : ∀ ξ : Lp Hilbert 2 μ, T ξ =ᵐ[μ] fun x => operator (w x) (ξ x)) + (n : ℕ) (hn : 0 < n) (k : ℤ) (a : ℂ) : + vectorTrace (Lp.const 2 μ (lp.single 2 k a)) (T ^ n) = 0 := by + unfold vectorTrace + rw [L2.inner_def] + apply integral_eq_zero_of_ae + filter_upwards [InvariantProjection.FieldPowerBounds.ae_pow_apply T + (fun x => operator (w x)) hT n (Lp.const 2 μ (lp.single 2 k a)), + Lp.coeFn_const 2 μ (lp.single 2 k a : Hilbert)] with x hpow hconst + rw [hpow, hconst] + exact inner_single_operator_pow_eq_zero (w x) n hn k a + +end Invariant233.WeightedShift + +namespace Invariant233.ProductModel + +theorem shift_mul_multiplier_on_vector_ae (θ : ℕ → ℝ) (g : Base → ℂ) + (C : ℝ) (hC : 0 ≤ C) (hg : Measurable g) (hb : ∀ x, ‖g x‖ ≤ C) + (ξ : Hilbert) : + (shiftOperator * multiplier θ g C hC hg hb) ξ =ᵐ[baseMeasure] + fun x => WeightedShift.operator (multiplierField θ g C hb x) (ξ x) := by + have hm : multiplier θ g C hC hg hb ξ =ᵐ[baseMeasure] + fun x => WeightedShift.diagonal (multiplierField θ g C hb x) (ξ x) := by + unfold multiplier WeightedShift.fieldDiagonal WeightedShift.fieldDiagonalLinear + exact WeightedShift.fieldDiagonalVec_ae (multiplierField θ g C hb) C hC + (fun _x => lp.norm_le_of_forall_le hC (fun _k => hb _)) + (fun k => (hg.comp (Measurable.of_eval + (fun i => (measurable_pi_apply i).add_const _))).aestronglyMeasurable) ξ + filter_upwards [ + (WeightedShift.shift 1).toLinearIsometry.toContinuousLinearMap.coeFn_compLpL + (multiplier θ g C hC hg hb ξ), hm] with x hs hm + change shiftOperator (multiplier θ g C hC hg hb ξ) x = _ + rw [shiftOperator, hs, hm] + rfl + +theorem vectorTrace_shift_mul_multiplier_pow_eq_zero (θ : ℕ → ℝ) (g : Base → ℂ) + (C : ℝ) (hC : 0 ≤ C) (hg : Measurable g) (hb : ∀ x, ‖g x‖ ≤ C) + (n : ℕ) (hn : 0 < n) : + vectorTrace traceVector ((shiftOperator * multiplier θ g C hC hg hb) ^ n) = 0 := + WeightedShift.vectorTrace_const_pow_eq_zero _ _ + (shift_mul_multiplier_on_vector_ae θ g C hC hg hb) n hn 0 1 + +theorem vectorTrace_weightedOperator_pow_eq_zero (θ c : ℕ → ℝ) + (n : ℕ) (hn : 0 < n) : + vectorTrace traceVector (weightedOperator θ c ^ n) = 0 := by + unfold weightedOperator + exact vectorTrace_shift_mul_multiplier_pow_eq_zero θ _ _ _ _ _ n hn + +theorem vectorTrace_traceVector_one : vectorTrace traceVector 1 = 1 := by + unfold vectorTrace + rw [one_apply_eq_self, L2.inner_def] + calc + (∫ x, inner ℂ (traceVector x) (traceVector x) ∂baseMeasure) = + ∫ _x, (1 : ℂ) ∂baseMeasure := by + apply integral_congr_ae + filter_upwards [Lp.coeFn_const 2 baseMeasure + (lp.single 2 (0 : ℤ) (1 : ℂ) : Fiber)] with x hx + change traceVector x = _ at hx + simp [hx] + _ = 1 := by simp + +theorem vectorTrace_weightedOperator_inverse_one_sub_smul (θ c : ℕ → ℝ) + (hT : NormQuasinilpotent (weightedOperator θ c)) (z : ℂ) : + vectorTrace traceVector (Ring.inverse (1 - z • weightedOperator θ c)) = 1 := by + rw [vectorTrace_inverse_one_sub_smul traceVector hT + (vectorTrace_weightedOperator_pow_eq_zero θ c), vectorTrace_traceVector_one] + +theorem vectorTrace_weightedOperator_resolvent (θ c : ℕ → ℝ) + (hT : NormQuasinilpotent (weightedOperator θ c)) (z : ℂ) (hz : z ≠ 0) : + vectorTrace traceVector (resolvent (weightedOperator θ c) z) = z⁻¹ := by + rw [vectorTrace_resolvent_of_moments_zero traceVector hT + (vectorTrace_weightedOperator_pow_eq_zero θ c) z hz, + vectorTrace_traceVector_one, mul_one] + +theorem vectorTrace_weightedOperator_logSeries_eq_zero (θ c : ℕ → ℝ) + (hT : NormQuasinilpotent (weightedOperator θ c)) (z : ℂ) : + vectorTrace traceVector (∑' n : ℕ, + (-(z ^ (n + 1) / (n + 1 : ℂ))) • weightedOperator θ c ^ (n + 1)) = 0 := + vectorTrace_logSeries_eq_zero traceVector hT + (vectorTrace_weightedOperator_pow_eq_zero θ c) z + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldUnboundedMultiplier.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldUnboundedMultiplier.lean new file mode 100644 index 0000000000000000000000000000000000000000..55eabcbb83e155455ffead13f975db0a139c16ec --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldUnboundedMultiplier.lean @@ -0,0 +1,246 @@ +import OAI.Analysis.IrrationalRotation.Model.FieldUnboundedMultiplier +import Mathlib.Analysis.InnerProductSpace.LinearPMap +import Mathlib.Tactic + +namespace OAI + +noncomputable section +open MeasureTheory Filter Topology +open scoped ENNReal +namespace Invariant233.WeightedShift +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem fieldHilbert_ext {ξ η : FieldHilbert μ} + (h : ∀ᵐ x ∂μ, ∀ k, ξ x k = η x k) : ξ = η := by + apply Lp.ext + filter_upwards [h] with x hx + exact lp.ext (funext hx) + +theorem fieldMultiplierGraph_unique (h : X → ℤ → ℂ) + {ξ η ζ : FieldHilbert μ} + (hη : (ξ, η) ∈ fieldMultiplierGraph μ h) + (hζ : (ξ, ζ) ∈ fieldMultiplierGraph μ h) : η = ζ := by + apply fieldHilbert_ext + filter_upwards [hη, hζ] with x hη hζ + intro k + exact (hη k).trans (hζ k).symm + +theorem fieldMultiplierGraph_zero (h : X → ℤ → ℂ) + (p : FieldHilbert μ × FieldHilbert μ) + (hp : p ∈ fieldMultiplierGraph μ h) (hzero : p.1 = 0) : p.2 = 0 := by + apply fieldHilbert_ext + filter_upwards [hp, Lp.coeFn_zero Hilbert 2 μ] with x hx hz + intro k + rw [hx, hzero, hz] + simp + +theorem fieldUnboundedMultiplier_graph (h : X → ℤ → ℂ) : + (fieldUnboundedMultiplier μ h).graph = fieldMultiplierGraph μ h := + (fieldMultiplierGraph μ h).toLinearPMap_graph_eq (fieldMultiplierGraph_zero h) + +theorem mem_fieldUnboundedMultiplier_domain_iff (h : X → ℤ → ℂ) + (ξ : FieldHilbert μ) : + ξ ∈ (fieldUnboundedMultiplier μ h).domain ↔ + ∃ η : FieldHilbert μ, ∀ᵐ x ∂μ, ∀ k, η x k = h x k * ξ x k := by + change ξ ∈ (fieldMultiplierGraph μ h).map (LinearMap.fst ℂ _ _) ↔ _ + constructor + · rintro ⟨⟨ζ, η⟩, hζη, hζ⟩ + change ζ = ξ at hζ + subst ζ + exact ⟨η, hζη⟩ + · rintro ⟨η, hη⟩ + exact ⟨(ξ, η), hη, rfl⟩ + +theorem fieldUnboundedMultiplier_apply_ae (h : X → ℤ → ℂ) + (ξ : (fieldUnboundedMultiplier μ h).domain) : + ∀ᵐ x ∂μ, ∀ k, fieldUnboundedMultiplier μ h ξ x k = h x k * ξ.val x k := + (fieldMultiplierGraph μ h).mem_graph_toLinearPMap (fieldMultiplierGraph_zero h) ξ + +theorem fieldUnboundedMultiplier_eq_of_ae (h : X → ℤ → ℂ) + (ξ : (fieldUnboundedMultiplier μ h).domain) (η : FieldHilbert μ) + (hη : ∀ᵐ x ∂μ, ∀ k, η x k = h x k * ξ.val x k) : + fieldUnboundedMultiplier μ h ξ = η := + fieldMultiplierGraph_unique h (fieldUnboundedMultiplier_apply_ae h ξ) hη + +theorem fieldUnboundedMultiplier_injective (h : X → ℤ → ℂ) + (hh : ∀ᵐ x ∂μ, ∀ k, h x k ≠ 0) : + Function.Injective (fieldUnboundedMultiplier μ h) := by + intro ξ η heq + apply Subtype.ext + apply fieldHilbert_ext + filter_upwards [fieldUnboundedMultiplier_apply_ae h ξ, + fieldUnboundedMultiplier_apply_ae h η, hh] with x hξ hη hh + intro k + apply mul_left_cancel₀ (hh k) + rw [← hξ, ← hη, heq] + +theorem field_operator_mem_multiplierDomain + (h f g : X → ℤ → ℂ) (c : ℂ) + (A B : FieldHilbert μ →L[ℂ] FieldHilbert μ) + (hA : ∀ ξ, ∀ᵐ x ∂μ, ∀ k, A ξ x k = f x (k - 1) * ξ x (k - 1)) + (hB : ∀ ξ, ∀ᵐ x ∂μ, ∀ k, B ξ x k = g x (k - 1) * ξ x (k - 1)) + (hfg : ∀ᵐ x ∂μ, ∀ k, h x (k + 1) * f x k = c * g x k * h x k) + (ξ : (fieldUnboundedMultiplier μ h).domain) : + A ξ.val ∈ (fieldUnboundedMultiplier μ h).domain := by + apply (mem_fieldUnboundedMultiplier_domain_iff h _).mpr + refine ⟨c • B (fieldUnboundedMultiplier μ h ξ), ?_⟩ + filter_upwards [hA ξ.val, hB (fieldUnboundedMultiplier μ h ξ), + fieldUnboundedMultiplier_apply_ae h ξ, hfg, + Lp.coeFn_smul c (B (fieldUnboundedMultiplier μ h ξ))] + with x hA hB hH hfg hsmul + intro k + rw [hsmul] + change c * B (fieldUnboundedMultiplier μ h ξ) x k = h x k * A ξ.val x k + rw [hA, hB, hH] + have hk := hfg (k - 1) + simp only [sub_add_cancel] at hk + rw [← mul_assoc (h x k), hk] + ring + +theorem field_multiplier_intertwines + (h f g : X → ℤ → ℂ) (c : ℂ) + (A B : FieldHilbert μ →L[ℂ] FieldHilbert μ) + (hA : ∀ ξ, ∀ᵐ x ∂μ, ∀ k, A ξ x k = f x (k - 1) * ξ x (k - 1)) + (hB : ∀ ξ, ∀ᵐ x ∂μ, ∀ k, B ξ x k = g x (k - 1) * ξ x (k - 1)) + (hfg : ∀ᵐ x ∂μ, ∀ k, h x (k + 1) * f x k = c * g x k * h x k) + (ξ : (fieldUnboundedMultiplier μ h).domain) : + fieldUnboundedMultiplier μ h + ⟨A ξ.val, field_operator_mem_multiplierDomain h f g c A B hA hB hfg ξ⟩ = + c • B (fieldUnboundedMultiplier μ h ξ) := by + apply fieldUnboundedMultiplier_eq_of_ae + filter_upwards [hA ξ.val, hB (fieldUnboundedMultiplier μ h ξ), + fieldUnboundedMultiplier_apply_ae h ξ, hfg, + Lp.coeFn_smul c (B (fieldUnboundedMultiplier μ h ξ))] + with x hA hB hH hfg hsmul + intro k + rw [hsmul] + change c * B (fieldUnboundedMultiplier μ h ξ) x k = h x k * A ξ.val x k + rw [hA, hB, hH] + have hk := hfg (k - 1) + simp only [sub_add_cancel] at hk + rw [← mul_assoc (h x k), hk] + ring + +theorem fieldUnboundedMultiplier_formalAdjoint (h : X → ℤ → ℂ) : + (fieldUnboundedMultiplier μ h).IsFormalAdjoint + (fieldUnboundedMultiplier μ (fun x k => star (h x k))) := by + intro ξ η + rw [L2.inner_def, L2.inner_def] + apply integral_congr_ae + filter_upwards [fieldUnboundedMultiplier_apply_ae h ξ, + fieldUnboundedMultiplier_apply_ae (fun x k => star (h x k)) η] with x hξ hη + rw [lp.inner_eq_tsum, lp.inner_eq_tsum] + apply tsum_congr + intro k + rw [hξ, hη] + simp only [RCLike.inner_apply', map_mul, starRingEnd_apply] + ring + +theorem fieldUnboundedMultiplier_nonnegative (h : X → ℤ → ℝ) + (hh : ∀ᵐ x ∂μ, ∀ k, 0 ≤ h x k) + (ξ : (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).domain) : + 0 ≤ (inner ℂ ξ.val + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ)) ξ)).re := by + let η := fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ)) ξ + change 0 ≤ (inner ℂ ξ.val η).re + rw [L2.inner_def] + have hre := integral_re (L2.integrable_inner (𝕜 := ℂ) ξ.val η) + simp only [RCLike.re_eq_complex_re] at hre + rw [← hre] + apply integral_nonneg_of_ae + filter_upwards [fieldUnboundedMultiplier_apply_ae (fun x k => (h x k : ℂ)) ξ, + hh] with x hξ hh + change 0 ≤ (inner ℂ (ξ.val x) (η x)).re + rw [lp.inner_eq_tsum, Complex.re_tsum (lp.summable_inner _ _)] + apply tsum_nonneg + intro k + change 0 ≤ (inner ℂ (ξ.val x k) + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ)) ξ x k)).re + rw [hξ] + change 0 ≤ (inner ℂ (ξ.val x k) ((h x k : ℂ) • ξ.val x k)).re + rw [inner_smul_right] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] + exact mul_nonneg (hh k) (inner_self_nonneg (𝕜 := ℂ) (x := ξ.val x k)) + +theorem fieldMultiplier_mem_inverseDomain (h : X → ℤ → ℂ) + (hh : ∀ᵐ x ∂μ, ∀ k, h x k ≠ 0) + (ξ : (fieldUnboundedMultiplier μ h).domain) : + fieldUnboundedMultiplier μ h ξ ∈ + (fieldUnboundedMultiplier μ (fun x k => (h x k)⁻¹)).domain := by + apply (mem_fieldUnboundedMultiplier_domain_iff _ _).mpr + refine ⟨ξ.val, ?_⟩ + filter_upwards [fieldUnboundedMultiplier_apply_ae h ξ, hh] with x hξ hh + intro k + rw [hξ, ← mul_assoc, inv_mul_cancel₀ (hh k), one_mul] + +theorem inverse_fieldMultiplier_mul (h : X → ℤ → ℂ) + (hh : ∀ᵐ x ∂μ, ∀ k, h x k ≠ 0) + (ξ : (fieldUnboundedMultiplier μ h).domain) : + fieldUnboundedMultiplier μ (fun x k => (h x k)⁻¹) + ⟨fieldUnboundedMultiplier μ h ξ, fieldMultiplier_mem_inverseDomain h hh ξ⟩ = ξ.val := by + apply fieldUnboundedMultiplier_eq_of_ae + filter_upwards [fieldUnboundedMultiplier_apply_ae h ξ, hh] with x hξ hh + intro k + rw [hξ, ← mul_assoc, inv_mul_cancel₀ (hh k), one_mul] + +theorem inverseFieldMultiplier_mem_domain (h : X → ℤ → ℂ) + (hh : ∀ᵐ x ∂μ, ∀ k, h x k ≠ 0) + (ξ : (fieldUnboundedMultiplier μ (fun x k => (h x k)⁻¹)).domain) : + fieldUnboundedMultiplier μ (fun x k => (h x k)⁻¹) ξ ∈ + (fieldUnboundedMultiplier μ h).domain := by + apply (mem_fieldUnboundedMultiplier_domain_iff _ _).mpr + refine ⟨ξ.val, ?_⟩ + filter_upwards [fieldUnboundedMultiplier_apply_ae (fun x k => (h x k)⁻¹) ξ, hh] + with x hξ hh + intro k + rw [hξ, ← mul_assoc, mul_inv_cancel₀ (hh k), one_mul] + +theorem fieldMultiplier_mul_inverse (h : X → ℤ → ℂ) + (hh : ∀ᵐ x ∂μ, ∀ k, h x k ≠ 0) + (ξ : (fieldUnboundedMultiplier μ (fun x k => (h x k)⁻¹)).domain) : + fieldUnboundedMultiplier μ h + ⟨fieldUnboundedMultiplier μ (fun x k => (h x k)⁻¹) ξ, + inverseFieldMultiplier_mem_domain h hh ξ⟩ = ξ.val := by + apply fieldUnboundedMultiplier_eq_of_ae + filter_upwards [fieldUnboundedMultiplier_apply_ae (fun x k => (h x k)⁻¹) ξ, hh] + with x hξ hh + intro k + rw [hξ, ← mul_assoc, mul_inv_cancel₀ (hh k), one_mul] + +theorem fieldMultiplier_range (h : X → ℤ → ℂ) + (hh : ∀ᵐ x ∂μ, ∀ k, h x k ≠ 0) : + LinearMap.range (fieldUnboundedMultiplier μ h).toFun = + (fieldUnboundedMultiplier μ (fun x k => (h x k)⁻¹)).domain := by + ext ξ + constructor + · rintro ⟨η, rfl⟩ + exact fieldMultiplier_mem_inverseDomain h hh η + · intro hξ + refine ⟨⟨fieldUnboundedMultiplier μ (fun x k => (h x k)⁻¹) ⟨ξ, hξ⟩, + inverseFieldMultiplier_mem_domain h hh ⟨ξ, hξ⟩⟩, ?_⟩ + exact fieldMultiplier_mul_inverse h hh ⟨ξ, hξ⟩ + +theorem inverse_fieldMultiplier_inner (h : X → ℤ → ℝ) + (hh : ∀ᵐ x ∂μ, ∀ k, h x k ≠ 0) + (η : (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ)⁻¹)).domain) + (ζ : (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).domain) : + inner ℂ (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ)⁻¹) η) + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ)) ζ) = + inner ℂ η.val ζ.val := by + have hh' : ∀ᵐ x ∂μ, ∀ k, (h x k : ℂ) ≠ 0 := by + filter_upwards [hh] with x hx k + exact Complex.ofReal_ne_zero.mpr (hx k) + have hf : (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))).IsFormalAdjoint + (fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ))) := by + simpa using fieldUnboundedMultiplier_formalAdjoint (μ := μ) (fun x k => (h x k : ℂ)) + have heq := hf + ⟨fieldUnboundedMultiplier μ (fun x k => (h x k : ℂ)⁻¹) η, + inverseFieldMultiplier_mem_domain (fun x k => (h x k : ℂ)) hh' η⟩ ζ + rw [fieldMultiplier_mul_inverse _ hh'] at heq + exact heq.symm + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldVectorState.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldVectorState.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c0b3646badd1013a588096061a69dd59781676e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldVectorState.lean @@ -0,0 +1,94 @@ +import OAI.Analysis.IrrationalRotation.Operators.FieldTraceCyclic +import Mathlib.MeasureTheory.Function.LpSpace.Indicator + +namespace OAI + +open MeasureTheory Filter +open scoped InnerProductSpace Topology + +namespace Invariant233.FieldTraceCyclic + +variable {Ω E : Type*} [MeasurableSpace Ω] + [NormedAddCommGroup E] [InnerProductSpace ℂ E] + {μ : Measure Ω} [IsFiniteMeasure μ] + +theorem constant_vector_state_eq_integral + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : Ω → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) (v : E) : + inner ℂ (Lp.const 2 μ v) (T (Lp.const 2 μ v)) = + ∫ x, inner ℂ v (A x v) ∂μ := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [Lp.coeFn_const 2 μ v, hT (Lp.const 2 μ v)] with x hx hTx + rw [hTx, hx] + rfl + +theorem constant_vector_state_mul_eq_integral + (T S : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A B : Ω → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (hS : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (S ξ) x = B x (ξ x)) (v : E) : + inner ℂ (Lp.const 2 μ v) ((T * S) (Lp.const 2 μ v)) = + ∫ x, inner ℂ v (A x (B x v)) ∂μ := by + change inner ℂ (Lp.const 2 μ v) (T (S (Lp.const 2 μ v))) = _ + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [Lp.coeFn_const 2 μ v, hT (S (Lp.const 2 μ v)), + hS (Lp.const 2 μ v)] with x hx hTx hSx + rw [hTx, hSx, hx] + rfl + +theorem constant_vector_state_cyclic_of_covariance [CompleteSpace E] + (b : HilbertBasis ℤ ℂ E) (T S : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (A B : Ω → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (hS : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (S ξ) x = B x (ξ x)) + (hA : ∀ r : ℤ, AEStronglyMeasurable (fun x => A x (b r)) μ) + (hB : ∀ r : ℤ, AEStronglyMeasurable (fun x => B x (b r)) μ) + (CA CB : ℝ) (hCA : 0 ≤ CA) (hCB : 0 ≤ CB) + (hAbound : ∀ᵐ x ∂μ, ‖A x‖ ≤ CA) (hBbound : ∀ᵐ x ∂μ, ‖B x‖ ≤ CB) + (σ : ℤ → Ω → Ω) (hσ : ∀ r, MeasurePreserving (σ r) μ μ) + (hcovA : ∀ r k l : ℤ, ∀ᵐ x ∂μ, + inner ℂ (b k) (A (σ r x) (b l)) = inner ℂ (b (k + r)) (A x (b (l + r)))) + (hcovB : ∀ r k l : ℤ, ∀ᵐ x ∂μ, + inner ℂ (b k) (B (σ r x) (b l)) = inner ℂ (b (k + r)) (B x (b (l + r)))) : + inner ℂ (Lp.const 2 μ (b 0)) ((T * S) (Lp.const 2 μ (b 0))) = + inner ℂ (Lp.const 2 μ (b 0)) ((S * T) (Lp.const 2 μ (b 0))) := by + rw [constant_vector_state_mul_eq_integral T S A B hT hS, + constant_vector_state_mul_eq_integral S T B A hS hT] + exact integral_central_matrix_product_cyclic b A B hA hB CA CB hCA hCB + hAbound hBbound σ hσ hcovA hcovB + +theorem constant_vector_state_one [IsProbabilityMeasure μ] (v : E) (hv : ‖v‖ = 1) : + inner ℂ (Lp.const 2 μ v) ((1 : Lp E 2 μ →L[ℂ] Lp E 2 μ) (Lp.const 2 μ v)) = 1 := by + change inner ℂ (Lp.const 2 μ v) (Lp.const 2 μ v) = _ + rw [inner_self_eq_norm_sq_to_K, Lp.norm_const' 2 μ v (by norm_num) (by norm_num)] + simp [hv] + +theorem constant_vector_state_nonneg + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (hT : T.IsPositive) (v : E) : + 0 ≤ (inner ℂ (Lp.const 2 μ v) (T (Lp.const 2 μ v))).re := + hT.re_inner_nonneg_right (Lp.const 2 μ v) + +theorem norm_constant_vector_state_le [IsProbabilityMeasure μ] + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (v : E) (hv : ‖v‖ = 1) : + ‖inner ℂ (Lp.const 2 μ v) (T (Lp.const 2 μ v))‖ ≤ ‖T‖ := by + have hc : ‖Lp.const 2 μ v‖ = 1 := by + rw [Lp.norm_const' 2 μ v (by norm_num) (by norm_num)] + simp [hv] + calc + ‖inner ℂ (Lp.const 2 μ v) (T (Lp.const 2 μ v))‖ ≤ + ‖Lp.const 2 μ v‖ * ‖T (Lp.const 2 μ v)‖ := norm_inner_le_norm _ _ + _ ≤ ‖Lp.const 2 μ v‖ * (‖T‖ * ‖Lp.const 2 μ v‖) := + mul_le_mul_of_nonneg_left (T.le_opNorm _) (norm_nonneg _) + _ = ‖T‖ := by simp [hc] + +theorem tendsto_constant_vector_state {ι : Type*} {l : Filter ι} + (T : ι → Lp E 2 μ →L[ℂ] Lp E 2 μ) (S : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (h : ∀ ξ, Tendsto (fun i => T i ξ) l (𝓝 (S ξ))) (v : E) : + Tendsto (fun i => inner ℂ (Lp.const 2 μ v) (T i (Lp.const 2 μ v))) l + (𝓝 (inner ℂ (Lp.const 2 μ v) (S (Lp.const 2 μ v)))) := by + exact tendsto_const_nhds.inner (h (Lp.const 2 μ v)) + +end Invariant233.FieldTraceCyclic + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldsBundle.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldsBundle.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ae71f58f7e166179dbf733767a26e3cc5fe96ad --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldsBundle.lean @@ -0,0 +1,19 @@ +import OAI.Analysis.IrrationalRotation.Analysis.StrongFieldMeasurability +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplier +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplierFields +import OAI.Analysis.IrrationalRotation.Operators.ColumnOperator +import OAI.Analysis.IrrationalRotation.Analysis.CountableGraphTransfer +import OAI.Analysis.IrrationalRotation.Analysis.FieldsNorm +import OAI.Analysis.IrrationalRotation.Analysis.FieldsTransfer +import OAI.Analysis.IrrationalRotation.Analysis.IndividualLusin +import OAI.Analysis.IrrationalRotation.Analysis.SimultaneousLusin +import OAI.Analysis.IrrationalRotation.Analysis.StrongLusin +import OAI.Analysis.IrrationalRotation.Analysis.StrongFieldContinuity +import OAI.Analysis.IrrationalRotation.Rotation.DiagonalContinuity +import OAI.Analysis.IrrationalRotation.Analysis.CappedRatios +import OAI.Analysis.IrrationalRotation.Rotation.UnrestrictedDiagonal +import OAI.Analysis.IrrationalRotation.Rotation.ProjectionDiagonal +import OAI.Analysis.IrrationalRotation.Rotation.PositiveDiagonalFields +import OAI.Analysis.IrrationalRotation.Operators.CovariantTracialVector + + diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldsNorm.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldsNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..75975a295333b22b1278767b532877926cd217f0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldsNorm.lean @@ -0,0 +1,58 @@ +import Mathlib.MeasureTheory.Function.AEEqOfIntegral +import Mathlib.Analysis.Normed.Operator.Basic +import Mathlib.Topology.DenseEmbedding +import Mathlib.Tactic + +namespace OAI + +open MeasureTheory Filter Set + +namespace Invariant233.Fields + +variable {Y : Type*} [MeasurableSpace Y] {μ : Measure Y} + +theorem ae_norm_le_of_local_square_integral [IsFiniteMeasure μ] + {E : Type*} [NormedAddCommGroup E] {v : Y → E} {C : ℝ} + (hC : 0 ≤ C) (hv : Integrable (fun y => ‖v y‖ ^ 2) μ) + (hlocal : ∀ s, MeasurableSet s → + (∫ y in s, ‖v y‖ ^ 2 ∂μ) ≤ C ^ 2 * μ.real s) : + ∀ᵐ y ∂μ, ‖v y‖ ≤ C := by + have hsq : (fun y => ‖v y‖ ^ 2) ≤ᵐ[μ] (fun _ => C ^ 2) := by + apply ae_le_of_forall_setIntegral_le hv (integrable_const _) + intro s hs _ + simpa only [setIntegral_const, smul_eq_mul, mul_comm] using hlocal s hs + filter_upwards [hsq] with y hy + nlinarith [norm_nonneg (v y)] + + +variable {𝕜 E F ι : Type*} [NontriviallyNormedField 𝕜] + [NormedAddCommGroup E] [NormedAddCommGroup F] + [NormedSpace 𝕜 E] [NormedSpace 𝕜 F] [Countable ι] + +theorem ae_eq_of_countable_columns {A B : Y → E →L[𝕜] F} {v : ι → E} + (hv : Dense (Submodule.span 𝕜 (Set.range v) : Set E)) + (hcol : ∀ i, ∀ᵐ y ∂μ, A y (v i) = B y (v i)) : + A =ᵐ[μ] B := by + have hcols : ∀ᵐ y ∂μ, ∀ i, A y (v i) = B y (v i) := + ae_all_iff.mpr hcol + filter_upwards [hcols] with y hy + apply ContinuousLinearMap.ext_on hv + rintro _ ⟨i, rfl⟩ + exact hy i + +theorem ae_opNorm_le_of_countable_dense {A : Y → E →L[𝕜] F} {v : ι → E} + (hv : DenseRange v) {C : ℝ} (hC : 0 ≤ C) + (hbound : ∀ i, ∀ᵐ y ∂μ, ‖A y (v i)‖ ≤ C * ‖v i‖) : + ∀ᵐ y ∂μ, ‖A y‖ ≤ C := by + have hall : ∀ᵐ y ∂μ, ∀ i, ‖A y (v i)‖ ≤ C * ‖v i‖ := + ae_all_iff.mpr hbound + filter_upwards [hall] with y hy + apply (A y).opNorm_le_bound hC + intro x + exact hv.induction_on (p := fun x => ‖A y x‖ ≤ C * ‖x‖) x + (isClosed_le (A y).continuous.norm (continuous_const.mul continuous_norm)) hy + + +end Invariant233.Fields + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldsTransfer.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldsTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9a51dfbc8797c6fdd220e81bf4e3e2303becbf5 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FieldsTransfer.lean @@ -0,0 +1,48 @@ +import Mathlib.MeasureTheory.Measure.Portmanteau +import Mathlib.Topology.Algebra.Order.LiminfLimsup +import Mathlib.Tactic + +namespace OAI + +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology + +namespace Invariant233.Fields + +variable {X : Type*} [PseudoMetricSpace X] [MeasurableSpace X] [BorelSpace X] + +theorem ae_mem_of_closed_approximation + {βn : ℕ → FiniteMeasure X} {β : FiniteMeasure X} + (hβ : Tendsto βn atTop (𝓝 β)) {Z : Set X} (hZ : MeasurableSet Z) + (happrox : ∀ ε : ℝ≥0, 0 < ε → ∃ K : Set X, + IsClosed K ∧ K ⊆ Z ∧ ∀ n, + (βn n : Measure X) univ ≤ (βn n : Measure X) K + (ε : ℝ≥0∞)) : + ∀ᵐ x ∂(β : Measure X), x ∈ Z := by + have hmass : Tendsto (fun n => (βn n : Measure X) univ) atTop + (𝓝 ((β : Measure X) univ)) := by + simpa only [Function.comp_def, FiniteMeasure.ennreal_mass] using + (ENNReal.continuous_coe.tendsto β.mass).comp hβ.mass + have hle : (β : Measure X) univ ≤ (β : Measure X) Z := by + apply ENNReal.le_of_forall_pos_le_add + intro ε hε _ + obtain ⟨K, hKclosed, hKZ, hKn⟩ := happrox ε hε + calc + (β : Measure X) univ = limsup (fun n => (βn n : Measure X) univ) atTop := + hmass.limsup_eq.symm + _ ≤ limsup (fun n => (βn n : Measure X) K + (ε : ℝ≥0∞)) atTop := + limsup_le_limsup (Eventually.of_forall hKn) + _ = limsup (fun n => (βn n : Measure X) K) atTop + (ε : ℝ≥0∞) := + limsup_add_const _ _ _ (by isBoundedDefault) (by isBoundedDefault) + _ ≤ (β : Measure X) K + (ε : ℝ≥0∞) := + add_le_add (FiniteMeasure.limsup_measure_closed_le_of_tendsto hβ hKclosed) le_rfl + _ ≤ (β : Measure X) Z + (ε : ℝ≥0∞) := + add_le_add (measure_mono hKZ) le_rfl + have heq : (β : Measure X) Z = (β : Measure X) univ := + le_antisymm (measure_mono (subset_univ _)) hle + rw [ae_iff] + change (β : Measure X) Zᶜ = 0 + rw [measure_compl hZ (measure_ne_top _ _), heq, tsub_self] + +end Invariant233.Fields + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteConvolution.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..b64ea92560e9b637c1bfba9fec4225653c72a5f7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteConvolution.lean @@ -0,0 +1,76 @@ +import OAI.Analysis.IrrationalRotation.Model.FiniteConvolution +import OAI.Analysis.IrrationalRotation.Operators.FiniteConvolutionAlgebra + +namespace OAI + +namespace InvariantProjection.FiniteConvolution + +@[simp] theorem polynomial_coeff {K : ℕ} (a : Coefficients K) + (i : Fin (2 * K + 1)) : (polynomial a).coeff (i : ℕ) = a i := by + classical + simp [polynomial, Polynomial.coeff_monomial, + Fin.val_inj] + +theorem continuous_lowProduct (K : ℕ) : + Continuous (fun p : Coefficients K × Coefficients K => lowProduct p.1 p.2) := by + classical + apply continuous_pi + intro n + simp only [lowProduct, polynomial, Finset.sum_mul, Finset.mul_sum, + Polynomial.finsetSum_coeff, Polynomial.monomial_mul_monomial] + apply continuous_finsetSum + intro i hi + apply continuous_finsetSum + intro j hj + simp only [Polynomial.coeff_monomial] + split_ifs <;> fun_prop + +theorem uniform_lower_bound (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) : + ∃ ε > 0, ∀ a b : Coefficients K, + (∀ i, ‖a i‖ ≤ D) → (∀ i, ‖b i‖ ≤ D) → + δ ≤ ‖a (center K)‖ → δ ≤ ‖b (center K)‖ → + ∃ n : Fin (2 * K + 1), ε ≤ ‖lowProduct a b n‖ := by + classical + let S : Set (Coefficients K) := + Metric.closedBall 0 D ∩ {a | δ ≤ ‖a (center K)‖} + have hS : IsCompact S := + (isCompact_closedBall (0 : Coefficients K) D).inter_right + (isClosed_le continuous_const (continuous_apply (center K)).norm) + have hpositive : ∀ p ∈ S ×ˢ S, 0 < ‖lowProduct p.1 p.2‖ := by + intro p hp + apply norm_pos_iff.mpr + have ha : (polynomial p.1).coeff K ≠ 0 := by + change (polynomial p.1).coeff ((center K) : ℕ) ≠ 0 + rw [polynomial_coeff] + exact norm_pos_iff.mp (lt_of_lt_of_le hδ hp.1.2) + have hb : (polynomial p.2).coeff K ≠ 0 := by + change (polynomial p.2).coeff ((center K) : ℕ) ≠ 0 + rw [polynomial_coeff] + exact norm_pos_iff.mp (lt_of_lt_of_le hδ hp.2.2) + obtain ⟨n, hn, hne⟩ := + InvariantProjection.exists_nonzero_product_coeff_le_two_mul + (polynomial p.1) (polynomial p.2) K ha hb + intro hz + apply hne + have he := congrFun hz (⟨n, by omega⟩ : Fin (2 * K + 1)) + simpa only [lowProduct, Pi.zero_apply] using he + obtain ⟨ε, hε, hbound⟩ := (hS.prod hS).exists_forall_le' + (continuous_lowProduct K).norm.continuousOn hpositive + refine ⟨ε, hε, ?_⟩ + intro a b ha hb hca hcb + have haS : a ∈ S := by + refine ⟨?_, hca⟩ + simpa only [Metric.mem_closedBall, dist_zero_right] using + ((pi_norm_le_iff_of_nonneg ((norm_nonneg _).trans (ha (center K)))).mpr ha) + have hbS : b ∈ S := by + refine ⟨?_, hcb⟩ + simpa only [Metric.mem_closedBall, dist_zero_right] using + ((pi_norm_le_iff_of_nonneg ((norm_nonneg _).trans (hb (center K)))).mpr hb) + have hnorm := hbound (a, b) ⟨haS, hbS⟩ + by_contra h + push Not at h + exact (not_lt_of_ge hnorm) ((pi_norm_lt_iff hε).mpr h) + +end InvariantProjection.FiniteConvolution + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteConvolutionMeasurability.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteConvolutionMeasurability.lean new file mode 100644 index 0000000000000000000000000000000000000000..765fa731b8c34ab242e666d441109e8aff7393f9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteConvolutionMeasurability.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.IrrationalRotation.Model.LaurentConvolution +import Mathlib + +namespace OAI + +noncomputable section + +namespace Invariant233.FiniteWindow + +open MeasureTheory +open scoped ENNReal + +variable {Ω : Type*} [MeasurableSpace Ω] + +theorem measurable_convolution (K n : ℕ) (a b : Ω → ℤ → ℂ) + (ha : ∀ i, Measurable (fun ω => a ω i)) + (hb : ∀ i, Measurable (fun ω => b ω i)) : + Measurable (fun ω => convolution K (a ω) (b ω) n) := by + unfold convolution + fun_prop + +theorem norm_convolution_le (K n : ℕ) (D : ℝ) (a b : ℤ → ℂ) + (ha : ∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a i‖ ≤ D) + (hb : ∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b i‖ ≤ D) : + ‖convolution K a b n‖ ≤ (2 * K + 1 : ℕ) * D ^ 2 := by + classical + have hD : 0 ≤ D := (norm_nonneg (a 0)).trans (ha 0 (by simp)) + unfold convolution + calc + ‖∑ i ∈ (Finset.Icc (-(K : ℤ)) (K : ℤ)).filter + (fun i => |(n : ℤ) + i| ≤ (K : ℤ)), a i * b (-(n : ℤ) - i)‖ + ≤ ∑ i ∈ (Finset.Icc (-(K : ℤ)) (K : ℤ)).filter + (fun i => |(n : ℤ) + i| ≤ (K : ℤ)), ‖a i * b (-(n : ℤ) - i)‖ := + norm_sum_le _ _ + _ ≤ ∑ i ∈ (Finset.Icc (-(K : ℤ)) (K : ℤ)).filter + (fun i => |(n : ℤ) + i| ≤ (K : ℤ)), D ^ 2 := by + apply Finset.sum_le_sum + intro i hi + obtain ⟨his, hin⟩ := Finset.mem_filter.mp hi + have hiK : |i| ≤ (K : ℤ) := abs_le.mpr (Finset.mem_Icc.mp his) + have hniK : |-(n : ℤ) - i| ≤ (K : ℤ) := by + simpa only [show -(n : ℤ) - i = -((n : ℤ) + i) by omega, abs_neg] using hin + rw [norm_mul, pow_two] + exact mul_le_mul (ha i hiK) (hb _ hniK) (norm_nonneg _) hD + _ ≤ ∑ i ∈ Finset.Icc (-(K : ℤ)) (K : ℤ), D ^ 2 := by + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) + (fun i hi hnot => sq_nonneg D) + _ = (2 * K + 1 : ℕ) * D ^ 2 := by + simp only [Finset.sum_const, nsmul_eq_mul, Int.card_Icc] + congr 2 + omega + +theorem integrableOn_convolution (μ : Measure Ω) (E : Set Ω) + (hE : μ E < ∞) (K n : ℕ) (D : ℝ) (a b : Ω → ℤ → ℂ) + (ha : ∀ i, Measurable (fun ω => a ω i)) + (hb : ∀ i, Measurable (fun ω => b ω i)) + (haD : ∀ᵐ ω ∂μ.restrict E, ∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a ω i‖ ≤ D) + (hbD : ∀ᵐ ω ∂μ.restrict E, ∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b ω i‖ ≤ D) : + IntegrableOn (fun ω => convolution K (a ω) (b ω) n) E μ := by + apply IntegrableOn.of_bound hE (measurable_convolution K n a b ha hb).aestronglyMeasurable + ((2 * K + 1 : ℕ) * D ^ 2) + filter_upwards [haD, hbD] with ω hωa hωb + exact norm_convolution_le K n D (a ω) (b ω) hωa hωb + +theorem integrableOn_norm_convolution (μ : Measure Ω) (E : Set Ω) + (hE : μ E < ∞) (K n : ℕ) (D : ℝ) (a b : Ω → ℤ → ℂ) + (ha : ∀ i, Measurable (fun ω => a ω i)) + (hb : ∀ i, Measurable (fun ω => b ω i)) + (haD : ∀ᵐ ω ∂μ.restrict E, ∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a ω i‖ ≤ D) + (hbD : ∀ᵐ ω ∂μ.restrict E, ∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b ω i‖ ≤ D) : + IntegrableOn (fun ω => ‖convolution K (a ω) (b ω) n‖) E μ := + (integrableOn_convolution μ E hE K n D a b ha hb haD hbD).norm + +end Invariant233.FiniteWindow + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteKernelMixture.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteKernelMixture.lean new file mode 100644 index 0000000000000000000000000000000000000000..6adf967f668d053c0679ea98238ffa896b039165 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteKernelMixture.lean @@ -0,0 +1,164 @@ +import OAI.Analysis.IrrationalRotation.Model.FiniteKernelMixture +import Mathlib.Tactic + +namespace OAI + +open MeasureTheory ProbabilityTheory +open scoped ENNReal ProbabilityTheory + +namespace Invariant233.FiniteKernelMixture + +variable {I X Y : Type*} [Fintype I] [MeasurableSpace X] [MeasurableSpace Y] + +@[simp] theorem weightedKernel_apply (κ : I → Kernel X Y) (w : I → X → ℝ≥0∞) + (hw : ∀ i, Measurable (w i)) (x : X) : + weightedKernel κ w hw x = ∑ i, w i x • κ i x := rfl + +@[simp] theorem normalizedKernel_apply (κ : I → Kernel X Y) (w : I → X → ℝ≥0∞) + (hw : ∀ i, Measurable (w i)) (x : X) : + normalizedKernel κ w hw x = ∑ i, (w i x / ∑ j, w j x) • κ i x := rfl + +theorem normalizedKernel_isMarkov (κ : I → Kernel X Y) [∀ i, IsMarkovKernel (κ i)] + (w : I → X → ℝ≥0∞) (hw : ∀ i, Measurable (w i)) + (h0 : ∀ x, (∑ i, w i x) ≠ 0) (ht : ∀ x, (∑ i, w i x) ≠ ∞) : + IsMarkovKernel (normalizedKernel κ w hw) := by + constructor + intro x + constructor + simp only [normalizedKernel_apply, Measure.finsetSum_apply, + Measure.smul_apply, smul_eq_mul, measure_univ, mul_one] + simp_rw [div_eq_mul_inv] + rw [← Finset.sum_mul] + exact ENNReal.mul_inv_cancel (h0 x) (ht x) + +theorem normalizedKernel_disintegration (μ : Measure X) [SFinite μ] + (κ : I → Kernel X Y) [∀ i, IsMarkovKernel (κ i)] + (w : I → X → ℝ≥0∞) (hw : ∀ i, Measurable (w i)) + (h0 : ∀ x, (∑ i, w i x) ≠ 0) (ht : ∀ x, (∑ i, w i x) ≠ ∞) : + (μ.withDensity (fun x => ∑ i, w i x)) ⊗ₘ normalizedKernel κ w hw = + ∑ i, (μ.withDensity (w i)) ⊗ₘ κ i := by + let := normalizedKernel_isMarkov κ w hw h0 ht + have hsum : Measurable (fun x => ∑ i, w i x) := + Finset.measurable_sum _ (fun i _ => hw i) + ext s hs + rw [Measure.compProd_apply hs, + lintegral_withDensity_eq_lintegral_mul _ hsum + (Kernel.measurable_kernel_prodMk_left hs)] + simp only [normalizedKernel_apply, Measure.finsetSum_apply, + Measure.smul_apply, smul_eq_mul] + have heach (i : I) : + ((μ.withDensity (w i)) ⊗ₘ κ i) s = + ∫⁻ x, w i x * κ i x (Prod.mk x ⁻¹' s) ∂μ := by + rw [Measure.compProd_apply hs, + lintegral_withDensity_eq_lintegral_mul _ (hw i) + (Kernel.measurable_kernel_prodMk_left hs)] + rfl + simp_rw [heach] + calc + _ = ∫⁻ x, ∑ i, w i x * κ i x (Prod.mk x ⁻¹' s) ∂μ := by + apply lintegral_congr + intro x + change (∑ i, w i x) * (∑ i, (w i x / ∑ j, w j x) * κ i x (Prod.mk x ⁻¹' s)) = _ + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + rw [← mul_assoc, ENNReal.mul_div_cancel (h0 x) (ht x)] + _ = _ := lintegral_finsetSum _ (fun i _ => + (hw i).mul (Kernel.measurable_kernel_prodMk_left hs)) + +theorem diagonalReplacementKernel_apply (q : ℝ≥0∞) (p : I → ℝ≥0∞) + (u : I → X → ℝ≥0∞) (hu : ∀ i, Measurable (u i)) + (ν : I → Measure X) (x : X) : + diagonalReplacementKernel q p u hu ν x = + (q / (q + ∑ i, p i * u i x)) • Measure.dirac x + + ∑ i, (p i * u i x / (q + ∑ j, p j * u j x)) • ν i := by + simp only [diagonalReplacementKernel, normalizedKernel_apply, + Fintype.sum_option, Kernel.id_apply, Kernel.const_apply] + +theorem diagonalReplacementKernel_isMarkov (q : ℝ≥0∞) (hq : q ≠ 0) + (p : I → ℝ≥0∞) (u : I → X → ℝ≥0∞) (hu : ∀ i, Measurable (u i)) + (ν : I → Measure X) [∀ i, IsProbabilityMeasure (ν i)] + (ht : ∀ x, (q + ∑ i, p i * u i x) ≠ ∞) : + IsMarkovKernel (diagonalReplacementKernel q p u hu ν) := by + let κ : Option I → Kernel X X := fun o => match o with + | none => Kernel.id + | some i => Kernel.const X (ν i) + have : ∀ o, IsMarkovKernel (κ o) := by + intro o + cases o <;> dsimp [κ] <;> infer_instance + apply normalizedKernel_isMarkov (κ := κ) + · intro x h + have h' : q + ∑ i, p i * u i x = 0 := by + simpa only [Fintype.sum_option] using h + exact hq (add_eq_zero.mp h').1 + · intro x + simpa only [Fintype.sum_option] using ht x + +theorem diagonalReplacementKernel_disintegration (μ : Measure X) [SFinite μ] + (q : ℝ≥0∞) (hq : q ≠ 0) (p : I → ℝ≥0∞) + (u : I → X → ℝ≥0∞) (hu : ∀ i, Measurable (u i)) + (ν : I → Measure X) [∀ i, IsProbabilityMeasure (ν i)] + (ht : ∀ x, (q + ∑ i, p i * u i x) ≠ ∞) : + (μ.withDensity (fun x => q + ∑ i, p i * u i x)) ⊗ₘ + diagonalReplacementKernel q p u hu ν = + q • μ.map (fun x => (x, x)) + + ∑ i, p i • (μ.withDensity (u i)).prod (ν i) := by + let κ : Option I → Kernel X X := fun o => match o with + | none => Kernel.id + | some i => Kernel.const X (ν i) + let w : Option I → X → ℝ≥0∞ := fun o x => match o with + | none => q + | some i => p i * u i x + have hw : ∀ o, Measurable (w o) := by + intro o + cases o with + | none => exact measurable_const + | some i => exact measurable_const.mul (hu i) + have : ∀ o, IsMarkovKernel (κ o) := by + intro o + cases o <;> dsimp [κ] <;> infer_instance + have h0 (x : X) : (∑ o, w o x) ≠ 0 := by + intro h + have h' : q + ∑ i, p i * u i x = 0 := by + simpa only [Fintype.sum_option, w] using h + exact hq (add_eq_zero.mp h').1 + have hfin (x : X) : (∑ o, w o x) ≠ ∞ := by + simpa only [Fintype.sum_option, w] using ht x + have hdis := normalizedKernel_disintegration μ κ w hw h0 hfin + simp only [Fintype.sum_option, κ, w] at hdis + change (μ.withDensity (fun x => q + ∑ i, p i * u i x)) ⊗ₘ + diagonalReplacementKernel q p u hu ν = _ at hdis + rw [hdis] + congr 1 + · rw [withDensity_const, Measure.compProd_smul_left, Measure.compProd_id] + rfl + · apply Finset.sum_congr rfl + intro i _ + rw [Measure.compProd_const] + change (μ.withDensity (p i • u i)).prod (ν i) = _ + rw [withDensity_smul (p i) (hu i), Measure.prod_smul_left] + +theorem diagonalReplacementKernel_event_lower (q : ℝ≥0∞) (p : I → ℝ≥0∞) + (u : I → X → ℝ≥0∞) (hu : ∀ i, Measurable (u i)) + (ν : I → Measure X) (x : X) (s : Set X) (i : I) (C : ℝ≥0∞) + (hui : 1 ≤ u i x) (hC : (q + ∑ j, p j * u j x) ≤ C) + (hν : ν i s = 1) : + p i / C ≤ diagonalReplacementKernel q p u hu ν x s := by + classical + rw [diagonalReplacementKernel_apply] + simp only [Measure.add_apply, Measure.smul_apply, smul_eq_mul, + Measure.finsetSum_apply] + calc + p i / C ≤ p i * u i x / (q + ∑ j, p j * u j x) := by + apply ENNReal.div_le_div ?_ hC + simpa only [mul_one] using mul_le_mul_right hui (p i) + _ = (p i * u i x / (q + ∑ j, p j * u j x)) * ν i s := by rw [hν, mul_one] + _ ≤ ∑ j, (p j * u j x / (q + ∑ k, p k * u k x)) * ν j s := + Finset.single_le_sum + (f := fun j => (p j * u j x / (q + ∑ k, p k * u k x)) * ν j s) + (fun _ _ => bot_le) (Finset.mem_univ i) + _ ≤ _ := le_add_self + +end Invariant233.FiniteKernelMixture + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteMeasureApproximation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteMeasureApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..04e16bece401dbcdfacdad44df4d16d1ef9be1ae --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteMeasureApproximation.lean @@ -0,0 +1,62 @@ +import Mathlib.MeasureTheory.Function.LocallyIntegrable +import Mathlib.MeasureTheory.Integral.Bochner.Basic +import Mathlib.MeasureTheory.Integral.IntegrableOn +import Mathlib.Topology.ContinuousMap.Bounded.Normed +import Mathlib.Topology.MetricSpace.UniformConvergence +import Mathlib.Tactic + +namespace OAI + +noncomputable section +open Filter MeasureTheory Set +open scoped Topology + +namespace Invariant233.FiniteMeasureApproximation + +variable {X : Type*} [TopologicalSpace X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] + +theorem tendsto_integral_of_uniform_approximation + (μ : ℕ → Measure X) (ν : Measure X) + [∀ n, IsFiniteMeasure (μ n)] [IsFiniteMeasure ν] + (M : ℝ) (hM : 0 ≤ M) (hmass : ∀ n, (μ n).real univ ≤ M) + (f : C(X, ℝ)) (g : ℕ → C(X, ℝ)) + (happrox : TendstoUniformly (fun k x => g k x) f atTop) + (hconv : ∀ k, Tendsto (fun n => ∫ x, g k x ∂μ n) atTop (𝓝 (∫ x, g k x ∂ν))) : + Tendsto (fun n => ∫ x, f x ∂μ n) atTop (𝓝 (∫ x, f x ∂ν)) := by + rw [Metric.tendsto_atTop] + intro ε hε + let C : ℝ := M + ν.real univ + 1 + have hν : 0 ≤ ν.real univ := ENNReal.toReal_nonneg + have hC : 0 < C := by dsimp [C]; linarith + let δ : ℝ := (ε / 3) / C + have hδ : 0 < δ := div_pos (by positivity) hC + have hδC : δ * C = ε / 3 := div_mul_cancel₀ _ (ne_of_gt hC) + obtain ⟨k, hk⟩ := ((Metric.tendstoUniformly_iff.mp happrox) δ hδ).exists + have herr (ρ : Measure X) [IsFiniteMeasure ρ] (hρ : ρ.real univ ≤ C) : + dist (∫ x, f x ∂ρ) (∫ x, g k x ∂ρ) ≤ ε / 3 := by + rw [dist_eq_norm, ← integral_sub + (f.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)) + ((g k).continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _))] + calc + ‖∫ x, f x - g k x ∂ρ‖ ≤ δ * ρ.real univ := by + apply norm_integral_le_of_norm_le_const + filter_upwards with x + simpa only [dist_eq_norm] using (hk x).le + _ ≤ δ * C := mul_le_mul_of_nonneg_left hρ hδ.le + _ = ε / 3 := hδC + obtain ⟨N, hN⟩ := (Metric.tendsto_atTop.mp (hconv k)) (ε / 3) (by positivity) + refine ⟨N, fun n hn => ?_⟩ + have ha := herr (μ n) (by have := hmass n; dsimp [C]; linarith) + have hb := hN n hn + have hc := herr ν (by dsimp [C]; linarith) + have htri := dist_triangle (∫ x, f x ∂μ n) (∫ x, g k x ∂μ n) (∫ x, f x ∂ν) + have htri' := dist_triangle (∫ x, g k x ∂μ n) (∫ x, g k x ∂ν) (∫ x, f x ∂ν) + rw [dist_comm (∫ x, g k x ∂ν) (∫ x, f x ∂ν)] at htri' + linarith + +end Invariant233.FiniteMeasureApproximation + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteMeasureCylinderConvergence.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteMeasureCylinderConvergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..106e6103801d5b6c1526407ee2612d20142db4ae --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteMeasureCylinderConvergence.lean @@ -0,0 +1,107 @@ +import OAI.Analysis.IrrationalRotation.Sampling.SamplingCylinderWeak + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set TopologicalSpace +open scoped Topology + +namespace Invariant233.SamplingWeak + +theorem tendsto_finiteMeasure_of_piSystem + {X J : Type*} [Nonempty X] [MeasurableSpace X] + [TopologicalSpace X] [SecondCountableTopology X] [OpensMeasurableSpace X] + {S : Set (Set X)} (hS : IsPiSystem S) + {μ : J → FiniteMeasure X} {ν : FiniteMeasure X} + {l : Filter J} [l.IsCountablyGenerated] + (hmeas : ∀ s ∈ S, MeasurableSet s) + (hsmall : ∀ u : Set X, IsOpen u → ∀ x ∈ u, + ∃ s ∈ S, s ∈ 𝓝 x ∧ s ⊆ u) + (hmass : Tendsto (fun j => (μ j).mass) l (𝓝 ν.mass)) + (hconv : ∀ s ∈ S, Tendsto (fun j => μ j s) l (𝓝 (ν s))) : + Tendsto μ l (𝓝 ν) := by + exact SamplingCylinderWeak.tendsto_finiteMeasure_of_piSystem hS hmeas hsmall hmass hconv + +abbrev rationalCylinder {ι : Type*} (F : Finset (ι × ℚ × ℚ)) : Set (ι → ℝ) := + SamplingCylinderWeak.cylinder F + +@[simp] theorem rationalCylinder_empty {ι : Type*} : + rationalCylinder (∅ : Finset (ι × ℚ × ℚ)) = Set.univ := by + exact SamplingCylinderWeak.cylinder_empty + +@[simp] theorem rationalCylinder_union {ι : Type*} [DecidableEq ι] + (F G : Finset (ι × ℚ × ℚ)) : + rationalCylinder (F ∪ G) = rationalCylinder F ∩ rationalCylinder G := by + exact SamplingCylinderWeak.cylinder_union F G + +theorem rationalCylinder_isOpen {ι : Type*} (F : Finset (ι × ℚ × ℚ)) : + IsOpen (rationalCylinder F) := by + exact SamplingCylinderWeak.cylinder_isOpen F + +theorem rationalCylinder_isPiSystem (ι : Type*) : + IsPiSystem (Set.range (rationalCylinder (ι := ι))) := by + exact SamplingCylinderWeak.cylinder_piSystem + +theorem rationalCylinder_isBasis (ι : Type*) : + IsTopologicalBasis (Set.range (rationalCylinder (ι := ι))) := by + refine isTopologicalBasis_of_isOpen_of_nhds ?_ ?_ + · rintro _ ⟨F, rfl⟩ + exact rationalCylinder_isOpen F + · intro x u hx hu + obtain ⟨F, hF, hFu⟩ := SamplingCylinderWeak.exists_cylinder_nhds_subset u hu x hx + exact ⟨rationalCylinder F, ⟨F, rfl⟩, mem_of_mem_nhds hF, hFu⟩ + +theorem rationalCylinder_normal_form {ι : Type*} (F : Finset (ι × ℚ × ℚ)) : + ∃ (D : Finset ι) (a b : ι → ℚ), + rationalCylinder F = {x | ∀ i ∈ D, (a i : ℝ) < x i ∧ x i < (b i : ℝ)} := by + classical + let D : Finset ι := F.image Prod.fst + have hinterval (i : D) : ∃ a b : ℚ, ∀ r : ℝ, + (∀ p ∈ F, p.1 = i.val → (p.2.1 : ℝ) < r ∧ r < (p.2.2 : ℝ)) ↔ + (a : ℝ) < r ∧ r < (b : ℝ) := by + let G := F.filter (fun p => p.1 = i.val) + have hG : G.Nonempty := by + obtain ⟨p, hp, hpi⟩ := Finset.mem_image.mp i.property + exact ⟨p, Finset.mem_filter.mpr ⟨hp, hpi⟩⟩ + obtain ⟨p, hp, hsup⟩ := Finset.exists_mem_eq_sup' hG (fun p => (p.2.1 : ℝ)) + obtain ⟨q, hq, hinf⟩ := Finset.exists_mem_eq_inf' hG (fun p => (p.2.2 : ℝ)) + refine ⟨p.2.1, q.2.2, fun r => ?_⟩ + rw [← hsup, ← hinf, Finset.sup'_lt_iff, Finset.lt_inf'_iff] + constructor + · intro h + exact ⟨fun p hp => (h p (Finset.mem_filter.mp hp).1 (Finset.mem_filter.mp hp).2).1, + fun p hp => (h p (Finset.mem_filter.mp hp).1 (Finset.mem_filter.mp hp).2).2⟩ + · rintro ⟨hl, hu⟩ p hp hpi + have hpg : p ∈ G := Finset.mem_filter.mpr ⟨hp, hpi⟩ + exact ⟨hl p hpg, hu p hpg⟩ + choose a b hab using hinterval + let a' : ι → ℚ := fun i => if hi : i ∈ D then a ⟨i, hi⟩ else 0 + let b' : ι → ℚ := fun i => if hi : i ∈ D then b ⟨i, hi⟩ else 0 + refine ⟨D, a', b', ?_⟩ + ext x + constructor + · intro hx i hi + simp only [a', b', dite_eq_left hi] + apply (hab ⟨i, hi⟩ (x i)).mp + intro p hp hpi + simpa only [hpi] using hx p hp + · intro hx p hp + have hi : p.1 ∈ D := Finset.mem_image.mpr ⟨p, hp, rfl⟩ + have hxi := hx p.1 hi + simp only [a', b', dite_eq_left hi] at hxi + exact (hab ⟨p.1, hi⟩ (x p.1)).mpr hxi p hp rfl + +theorem tendsto_of_rationalCylinder + {ι J : Type*} [Countable ι] + {μ : J → FiniteMeasure (ι → ℝ)} {ν : FiniteMeasure (ι → ℝ)} + {l : Filter J} [l.IsCountablyGenerated] + (h : ∀ F : Finset (ι × ℚ × ℚ), + Tendsto (fun j => μ j (rationalCylinder F)) l (𝓝 (ν (rationalCylinder F)))) : + Tendsto μ l (𝓝 ν) := by + exact SamplingCylinderWeak.tendsto_finiteMeasure_of_cylinders h + +end Invariant233.SamplingWeak + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteMixturePosterior.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteMixturePosterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..98407c4ba33f556876b5b81002b11f5d22125c33 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteMixturePosterior.lean @@ -0,0 +1,136 @@ +import Mathlib.Probability.Kernel.Posterior +import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym +import Mathlib.MeasureTheory.Integral.Lebesgue.Countable +import Mathlib.Tactic + +namespace OAI + +open MeasureTheory ProbabilityTheory +open scoped ENNReal ProbabilityTheory + +namespace Invariant233.FiniteMixturePosterior + +variable {I X : Type*} [Fintype I] [MeasurableSpace I] + [MeasurableSingletonClass I] [MeasurableSpace X] + +theorem comp_eq_withDensity (π : Measure I) (μ : Measure X) + (κ : Kernel I X) (u : I → X → ℝ≥0∞) + (hu : ∀ i, Measurable (u i)) + (hκ : ∀ i, κ i = μ.withDensity (u i)) : + κ ∘ₘ π = μ.withDensity (fun x => ∑ i, π {i} * u i x) := by + ext s hs + rw [Measure.bind_apply hs κ.aemeasurable, withDensity_apply _ hs, + lintegral_fintype, lintegral_finsetSum] + · apply Finset.sum_congr rfl + intro i _ + rw [hκ i, withDensity_apply _ hs, lintegral_const_mul _ (hu i)] + exact mul_comm _ _ + · intro i _ + exact measurable_const.mul (hu i) + +theorem rnDeriv_density_ratio (μ : Measure X) [SigmaFinite μ] + {a b : X → ℝ≥0∞} (ha : Measurable a) (hb : Measurable b) + [SigmaFinite (μ.withDensity a)] [SigmaFinite (μ.withDensity b)] : + (μ.withDensity a).rnDeriv (μ.withDensity b) =ᵐ[μ.withDensity b] + fun x => a x / b x := by + have hbμ : μ.withDensity b ≪ μ := withDensity_absolutelyContinuous μ b + filter_upwards [Measure.rnDeriv_eq_div + (withDensity_absolutelyContinuous μ a) hbμ, + hbμ (Measure.rnDeriv_withDensity μ ha), + hbμ (Measure.rnDeriv_withDensity μ hb)] with x hx hax hbx + simpa only [hax, hbx] using hx + + +variable [Nonempty I] [StandardBorelSpace I] + +theorem posterior_singletons (π : Measure I) [IsFiniteMeasure π] + (μ : Measure X) [SigmaFinite μ] + (κ : Kernel I X) [IsFiniteKernel κ] + (u : I → X → ℝ≥0∞) (hu : ∀ i, Measurable (u i)) + (hκ : ∀ i, κ i = μ.withDensity (u i)) : + ∀ᵐ x ∂κ ∘ₘ π, ∀ i : I, + (κ†π) x {i} = π {i} * u i x / (∑ j, π {j} * u j x) := by + let h : X → ℝ≥0∞ := fun x => ∑ i, π {i} * u i x + have hh : Measurable h := by + exact Finset.measurable_sum _ (fun i _ => measurable_const.mul (hu i)) + have hμeq : κ ∘ₘ π = μ.withDensity h := comp_eq_withDensity π μ κ u hu hκ + have : IsFiniteMeasure (μ.withDensity h) := hμeq ▸ inferInstance + have hratio (i : I) : (κ i).rnDeriv (κ ∘ₘ π) =ᵐ[κ ∘ₘ π] + fun x => u i x / h x := by + have : IsFiniteMeasure (μ.withDensity (u i)) := hκ i ▸ inferInstance + rw [hκ i, hμeq] + exact rnDeriv_density_ratio μ (hu i) hh + filter_upwards [posterior_eq_withDensity_of_countable κ π, + ae_all_iff.mpr hratio] with x hx hxr i + rw [hx] + simp only [withDensity_apply _ (measurableSet_singleton i), + lintegral_singleton, hxr i] + change u i x / h x * π {i} = π {i} * u i x / h x + rw [div_eq_mul_inv, div_eq_mul_inv] + ac_rfl + +theorem posterior_disintegration (π : Measure I) [IsFiniteMeasure π] + (μ : Measure X) (κ : Kernel I X) [IsFiniteKernel κ] + (u : I → X → ℝ≥0∞) (hu : ∀ i, Measurable (u i)) + (hκ : ∀ i, κ i = μ.withDensity (u i)) : + (μ.withDensity (fun x => ∑ i, π {i} * u i x)) ⊗ₘ (κ†π) = + (π ⊗ₘ κ).map Prod.swap := by + rw [← comp_eq_withDensity π μ κ u hu hκ] + exact compProd_posterior_eq_map_swap + +theorem posterior_lower_bound (π : Measure I) [IsFiniteMeasure π] + (μ : Measure X) [SigmaFinite μ] + (κ : Kernel I X) [IsFiniteKernel κ] + (u : I → X → ℝ≥0∞) (hu : ∀ i, Measurable (u i)) + (hκ : ∀ i, κ i = μ.withDensity (u i)) (C : ℝ≥0∞) : + ∀ᵐ x ∂κ ∘ₘ π, ∀ i : I, 1 ≤ u i x → + (∑ j, π {j} * u j x) ≤ C → π {i} / C ≤ (κ†π) x {i} := by + filter_upwards [posterior_singletons π μ κ u hu hκ] with x hx i hi hC + rw [hx i] + apply ENNReal.div_le_div ?_ hC + simpa only [mul_one] using mul_le_mul_right hi (π {i}) + +theorem posterior_discrete_singletons {D : Type*} [MeasurableSpace D] + [Countable D] [MeasurableSingletonClass D] + (π : Measure I) [IsFiniteMeasure π] + (κ : Kernel I D) [IsFiniteKernel κ] : + ∀ᵐ d ∂κ ∘ₘ π, ∀ i : I, + (κ†π) d {i} = π {i} * κ i {d} / (∑ j, π {j} * κ j {d}) := by + apply posterior_singletons π Measure.count κ (fun i d => κ i {d}) + · intro i + exact measurable_of_countable _ + · intro i + simp only [count_withDensity, Measure.sum_smul_dirac] + +theorem posterior_quantized_singletons {D : Type*} [MeasurableSpace D] + [Countable D] [MeasurableSingletonClass D] + (π : Measure I) [IsFiniteMeasure π] + (κ : Kernel I X) [IsFiniteKernel κ] + (Q : X → D) (hQ : Measurable Q) : + ∀ᵐ d ∂κ.map Q ∘ₘ π, ∀ i : I, + ((κ.map Q)†π) d {i} = + π {i} * κ i (Q ⁻¹' {d}) / (∑ j, π {j} * κ j (Q ⁻¹' {d})) := by + filter_upwards [posterior_discrete_singletons π (κ.map Q)] with d hd i + simpa only [Kernel.map_apply' κ hQ _ (measurableSet_singleton _)] using hd i + +theorem posterior_quantized_lower_bound {D : Type*} [MeasurableSpace D] + [Countable D] [MeasurableSingletonClass D] + (π : Measure I) [IsFiniteMeasure π] + (κ : Kernel I X) [IsFiniteKernel κ] + (Q : X → D) (hQ : Measurable Q) (μ : Measure X) (C : ℝ≥0∞) : + ∀ᵐ d ∂κ.map Q ∘ₘ π, ∀ i : I, + μ (Q ⁻¹' {d}) ≠ 0 → μ (Q ⁻¹' {d}) ≠ ∞ → + μ (Q ⁻¹' {d}) ≤ κ i (Q ⁻¹' {d}) → + (∑ j, π {j} * κ j (Q ⁻¹' {d})) ≤ C * μ (Q ⁻¹' {d}) → + π {i} / C ≤ ((κ.map Q)†π) d {i} := by + filter_upwards [posterior_quantized_singletons π κ Q hQ] with d hd i h0 ht hi hC + rw [hd i] + calc + π {i} / C = (π {i} * μ (Q ⁻¹' {d})) / (C * μ (Q ⁻¹' {d})) := + (ENNReal.mul_div_mul_right _ _ h0 ht).symm + _ ≤ π {i} * κ i (Q ⁻¹' {d}) / (∑ j, π {j} * κ j (Q ⁻¹' {d})) := + ENNReal.div_le_div (mul_le_mul_right hi _) hC + +end Invariant233.FiniteMixturePosterior + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteOrbitAtomic.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteOrbitAtomic.lean new file mode 100644 index 0000000000000000000000000000000000000000..23d4270076dbece6fb537781297af9b3c5f4ca13 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteOrbitAtomic.lean @@ -0,0 +1,109 @@ +import OAI.Analysis.IrrationalRotation.Operators.JointProjectionAtomic +import OAI.Analysis.IrrationalRotation.Analysis.MultiplicationPurePoint + +namespace OAI + +noncomputable section +open MeasureTheory Filter + +namespace Invariant233 + +variable {X κ : Type*} [MeasurableSpace X] {μ : Measure X} [Countable κ] + +theorem isSelfAdjoint_of_real_sequence_diagonal + (g : κ → X → ℝ) + (T : Lp (lp (fun _ : κ => ℂ) 2) 2 μ →L[ℂ] + Lp (lp (fun _ : κ => ℂ) 2) 2 μ) + (hT : ∀ (v : Lp (lp (fun _ : κ => ℂ) 2) 2 μ) k, + ∀ᵐ x ∂μ, T v x k = (g k x : ℂ) * v x k) : + IsSelfAdjoint T := by + apply ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric.mpr + intro v w + change inner ℂ (T v) w = inner ℂ v (T w) + rw [L2.inner_def, L2.inner_def] + apply integral_congr_ae + have hv : ∀ᵐ x ∂μ, ∀ k, T v x k = (g k x : ℂ) * v x k := ae_all_iff.2 (hT v) + have hw : ∀ᵐ x ∂μ, ∀ k, T w x k = (g k x : ℂ) * w x k := ae_all_iff.2 (hT w) + filter_upwards [hv, hw] with x hvx hwx + rw [lp.inner_eq_tsum, lp.inner_eq_tsum] + apply tsum_congr + intro k + rw [hvx k, hwx k] + simp only [RCLike.inner_apply', map_mul, Complex.conj_ofReal] + ring + +theorem commute_of_sequence_diagonal + (g h : κ → X → ℂ) + (S T : Lp (lp (fun _ : κ => ℂ) 2) 2 μ →L[ℂ] + Lp (lp (fun _ : κ => ℂ) 2) 2 μ) + (hS : ∀ (v : Lp (lp (fun _ : κ => ℂ) 2) 2 μ) k, + ∀ᵐ x ∂μ, S v x k = g k x * v x k) + (hT : ∀ (v : Lp (lp (fun _ : κ => ℂ) 2) 2 μ) k, + ∀ᵐ x ∂μ, T v x k = h k x * v x k) : Commute S T := by + apply ContinuousLinearMap.ext + intro v + apply Lp.ext + have hST : ∀ᵐ x ∂μ, ∀ k, S (T v) x k = g k x * T v x k := ae_all_iff.2 (hS (T v)) + have hTS : ∀ᵐ x ∂μ, ∀ k, T (S v) x k = h k x * S v x k := ae_all_iff.2 (hT (S v)) + have hSv : ∀ᵐ x ∂μ, ∀ k, S v x k = g k x * v x k := ae_all_iff.2 (hS v) + have hTv : ∀ᵐ x ∂μ, ∀ k, T v x k = h k x * v x k := ae_all_iff.2 (hT v) + filter_upwards [hST, hTS, hSv, hTv] with x hSTx hTSx hSvx hTvx + apply lp.ext + funext k + change S (T v) x k = T (S v) x k + rw [hSTx k, hTSx k, hSvx k, hTvx k] + ring + +theorem commute_of_mem_generated_selfAdjoint_family + {H I : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + (D : I → H →L[ℂ] H) (hD : ∀ i, IsSelfAdjoint (D i)) + (hDD : ∀ i j, Commute (D i) (D j)) + {S T : H →L[ℂ] H} (hS : S ∈ vonNeumannGenerated (Set.range D)) + (hT : T ∈ vonNeumannGenerated (Set.range D)) : Commute S T := by + have hle : vonNeumannGenerated (Set.range D) ≤ + (vonNeumannGenerated (Set.range D)).commutant := by + apply vonNeumannGenerated_le + rintro _ ⟨i, rfl⟩ + change D i ∈ (vonNeumannGenerated (Set.range D)).commutant + rw [mem_commutant_vonNeumannGenerated_iff] + rintro _ ⟨j, rfl⟩ + exact ⟨(hDD j i).eq, by simpa only [(hD j).star_eq] using (hDD j i).eq⟩ + exact VonNeumannAlgebra.mem_commutant_iff.mp (hle hT) S hS + +theorem finite_orbit_diagonal_algebra_atomic_and_commutative + {J : Type*} [Finite J] (n : J → ℤ) + (σ : ℤ → X → X) (hσ : ∀ k, MeasurePreserving (σ k) μ μ) + (f : X → ℝ) (hf : Measurable f) + (hcount : ∃ C : Set ℝ, C.Countable ∧ ∀ᵐ x ∂μ, f x ∈ C) + (D : J → Lp (lp (fun _ : ℤ => ℂ) 2) 2 μ →L[ℂ] + Lp (lp (fun _ : ℤ => ℂ) 2) 2 μ) + (hD : ∀ j (v : Lp (lp (fun _ : ℤ => ℂ) 2) 2 μ) k, + ∀ᵐ x ∂μ, D j v x k = (f (σ (k - n j) x) : ℂ) * v x k) : + IsAtomicVonNeumannAlgebra (vonNeumannGenerated (Set.range D)) ∧ + ∀ S ∈ vonNeumannGenerated (Set.range D), + ∀ T ∈ vonNeumannGenerated (Set.range D), Commute S T := by + have hself (j : J) : IsSelfAdjoint (D j) := + isSelfAdjoint_of_real_sequence_diagonal (fun k x => f (σ (k - n j) x)) (D j) (hD j) + have hcomm (i j : J) : Commute (D i) (D j) := + commute_of_sequence_diagonal + (fun k x => (f (σ (k - n i) x) : ℂ)) + (fun k x => (f (σ (k - n j) x) : ℂ)) (D i) (D j) (hD i) (hD j) + constructor + · have hcomplex : ∃ C : Set ℂ, C.Countable ∧ ∀ᵐ x ∂μ, (f x : ℂ) ∈ C := by + obtain ⟨C, hC, hmem⟩ := hcount + refine ⟨Complex.ofReal '' C, hC.image _, ?_⟩ + filter_upwards [hmem] with x hx + exact Set.mem_image_of_mem Complex.ofReal hx + obtain ⟨C, _hC, hdense⟩ := + MultiplicationPurePoint.finite_orbit_family_dense_jointEigenspaces n σ hσ + (fun x => (f x : ℂ)) (Complex.continuous_ofReal.measurable.comp hf) hcomplex D hD + apply atomic_generated_of_dense_jointEigenspaces D (fun y : C => y.val) hself + simpa only [jointEigenspace] using hdense + · intro S hS T hT + exact commute_of_mem_generated_selfAdjoint_family D hself hcomm hS hT + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteTestSelection.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteTestSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..9d65f84907a49614cc14efa7cea56558756587c2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteTestSelection.lean @@ -0,0 +1,91 @@ +import Mathlib + +namespace OAI + +namespace Invariant233 + +open Set MeasureTheory +open scoped ENNReal + +theorem exists_outside_bad_with_finite_tests + {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] + (s : Finset ι) (F : ι → Ω → ℝ≥0∞) (ε : ι → ℝ≥0∞) (bad : Set Ω) + (hF : ∀ i ∈ s, AEMeasurable (F i) μ) + (hε0 : ∀ i ∈ s, ε i ≠ 0) (hεtop : ∀ i ∈ s, ε i ≠ ∞) + (hbudget : μ bad + ∑ i ∈ s, (∫⁻ ω, F i ω ∂μ) / ε i < 1) : + ∃ ω, ω ∉ bad ∧ ∀ i ∈ s, F i ω < ε i := by + classical + let E := bad ∪ ⋃ i ∈ s, {ω | ε i ≤ F i ω} + have hmeasure : μ E < 1 := by + calc + μ E ≤ μ bad + μ (⋃ i ∈ s, {ω | ε i ≤ F i ω}) := measure_union_le _ _ + _ ≤ μ bad + ∑ i ∈ s, μ {ω | ε i ≤ F i ω} := + add_le_add_right (measure_biUnion_finset_le s _) _ + _ ≤ μ bad + ∑ i ∈ s, (∫⁻ ω, F i ω ∂μ) / ε i := by + apply add_le_add_right + apply Finset.sum_le_sum + intro i hi + exact meas_ge_le_lintegral_div (hF i hi) (hε0 i hi) (hεtop i hi) + _ < 1 := hbudget + have hE : E ≠ univ := by + intro heq + rw [heq, measure_univ] at hmeasure + exact lt_irrefl _ hmeasure + obtain ⟨ω, hω⟩ := Set.nonempty_compl.mpr hE + refine ⟨ω, ?_, ?_⟩ + · intro hbad + exact hω (Or.inl hbad) + · intro i hi + apply lt_of_not_ge + intro htest + exact hω (Or.inr (mem_iUnion.mpr ⟨i, mem_iUnion.mpr ⟨hi, htest⟩⟩)) + +theorem exists_outside_bad_with_finite_tests_and_ae + {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] + (s : Finset ι) (F : ι → Ω → ℝ≥0∞) (ε : ι → ℝ≥0∞) (bad : Set Ω) + (hF : ∀ i ∈ s, AEMeasurable (F i) μ) + (hε0 : ∀ i ∈ s, ε i ≠ 0) (hεtop : ∀ i ∈ s, ε i ≠ ∞) + (hbudget : μ bad + ∑ i ∈ s, (∫⁻ ω, F i ω ∂μ) / ε i < 1) + (P : Ω → Prop) (hP : ∀ᵐ ω ∂μ, P ω) : + ∃ ω, P ω ∧ ω ∉ bad ∧ ∀ i ∈ s, F i ω < ε i := by + have hnull : μ {ω | ¬ P ω} = 0 := ae_iff.mp hP + have hbudget' : μ (bad ∪ {ω | ¬ P ω}) + + ∑ i ∈ s, (∫⁻ ω, F i ω ∂μ) / ε i < 1 := by + calc + _ ≤ (μ bad + μ {ω | ¬ P ω}) + + ∑ i ∈ s, (∫⁻ ω, F i ω ∂μ) / ε i := + add_le_add_left (measure_union_le _ _) _ + _ = μ bad + ∑ i ∈ s, (∫⁻ ω, F i ω ∂μ) / ε i := by rw [hnull, add_zero] + _ < 1 := hbudget + obtain ⟨ω, hω, htests⟩ := exists_outside_bad_with_finite_tests μ s F ε + (bad ∪ {ω | ¬ P ω}) hF hε0 hεtop hbudget' + refine ⟨ω, ?_, ?_, htests⟩ + · by_contra hnot + exact hω (Or.inr hnot) + · intro hb + exact hω (Or.inl hb) + +theorem exists_finite_tests_of_uniform_expectation_bound + {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] + (s : Finset ι) (F : ι → Ω → ℝ≥0∞) (bad : Set Ω) + {ε δ β : ℝ≥0∞} (hε0 : ε ≠ 0) (hεtop : ε ≠ ∞) + (hF : ∀ i ∈ s, AEMeasurable (F i) μ) + (hδ : ∀ i ∈ s, (∫⁻ ω, F i ω ∂μ) ≤ δ) + (hbad : μ bad ≤ β) (hbudget : β + (s.card : ℝ≥0∞) * (δ / ε) < 1) + (P : Ω → Prop) (hP : ∀ᵐ ω ∂μ, P ω) : + ∃ ω, P ω ∧ ω ∉ bad ∧ ∀ i ∈ s, F i ω < ε := by + apply exists_outside_bad_with_finite_tests_and_ae μ s F (fun _ => ε) bad hF + (fun _ _ => hε0) (fun _ _ => hεtop) _ P hP + calc + μ bad + ∑ i ∈ s, (∫⁻ ω, F i ω ∂μ) / ε ≤ β + ∑ _i ∈ s, δ / ε := by + apply add_le_add hbad + apply Finset.sum_le_sum + intro i hi + gcongr + exact hδ i hi + _ = β + (s.card : ℝ≥0∞) * (δ / ε) := by simp [nsmul_eq_mul] + _ < 1 := hbudget + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteUniformLaw.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteUniformLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..1240075bb62d336f6cce4da4d84aa20520b23f07 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteUniformLaw.lean @@ -0,0 +1,62 @@ +import Mathlib.Probability.Distributions.Uniform +import Mathlib.Probability.ProductMeasure +import Mathlib.Tactic + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal BigOperators Classical + +namespace Invariant233.FiniteUniformLaw + +theorem map_equiv {α β : Type*} [Fintype α] [Fintype β] [Nonempty α] [Nonempty β] + [MeasurableSpace α] [MeasurableSpace β] + [MeasurableSingletonClass α] [MeasurableSingletonClass β] (e : α ≃ β) : + (PMF.uniformOfFintype α).toMeasure.map e = (PMF.uniformOfFintype β).toMeasure := by + apply Measure.ext_of_singleton + intro b + rw [Measure.map_apply (measurable_of_finite _) (measurableSet_singleton b)] + have he : e ⁻¹' {b} = {e.symm b} := by + ext a + exact e.eq_symm_apply.symm + rw [he, PMF.toMeasure_apply_singleton _ _ (measurableSet_singleton _), + PMF.toMeasure_apply_singleton _ _ (measurableSet_singleton _)] + simp only [PMF.uniformOfFintype_apply, Fintype.card_congr e] + +theorem pi_uniform {ι : Type*} [Fintype ι] (α : ι → Type*) + [∀ i, Fintype (α i)] [∀ i, Nonempty (α i)] + [∀ i, MeasurableSpace (α i)] [∀ i, MeasurableSingletonClass (α i)] : + Measure.pi (fun i => (PMF.uniformOfFintype (α i)).toMeasure) = + (PMF.uniformOfFintype ((i : ι) → α i)).toMeasure := by + apply Measure.ext_of_singleton + intro a + rw [Measure.pi_singleton] + simp only [PMF.toMeasure_apply_singleton _ _ (measurableSet_singleton _), + PMF.uniformOfFintype_apply, Fintype.card_pi, Nat.cast_prod] + symm + apply ENNReal.prod_inv_distrib + intro i hi j hj hij + exact Or.inr (ENNReal.natCast_ne_top _) + +theorem infinitePi_restrict_uniform {ι : Type*} (α : ι → Type*) + [∀ i, Fintype (α i)] [∀ i, Nonempty (α i)] + [∀ i, MeasurableSpace (α i)] [∀ i, MeasurableSingletonClass (α i)] (s : Finset ι) : + (Measure.infinitePi (fun i => (PMF.uniformOfFintype (α i)).toMeasure)).map s.restrict = + (PMF.uniformOfFintype ((i : s) → α i)).toMeasure := by + rw [Measure.infinitePi_map_restrict] + apply Measure.ext_of_singleton + intro a + rw [Measure.pi_singleton] + simp only [PMF.toMeasure_apply_singleton _ _ (measurableSet_singleton _), + PMF.uniformOfFintype_apply, Fintype.card_pi, Nat.cast_prod] + symm + apply ENNReal.prod_inv_distrib + intro i hi j hj hij + exact Or.inr (ENNReal.natCast_ne_top _) + +end Invariant233.FiniteUniformLaw + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteWindowIntegralLower.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteWindowIntegralLower.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d973a39bc12c5c22a07678c5abcb3e2aeea6706 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FiniteWindowIntegralLower.lean @@ -0,0 +1,89 @@ +import OAI.Analysis.IrrationalRotation.Analysis.LaurentNoncancellation +import OAI.Analysis.IrrationalRotation.Analysis.FiniteConvolutionMeasurability +import Mathlib.MeasureTheory.Integral.Bochner.Set + +namespace OAI + +open MeasureTheory + +namespace Invariant233.FiniteWindow + +theorem integrableOn_convolution_sum + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] + (K : ℕ) (D : ℝ) (E : Set Ω) (a b : Ω → ℤ → ℂ) + (ha : ∀ i, Measurable (fun ω => a ω i)) + (hb : ∀ i, Measurable (fun ω => b ω i)) + (hE : ∀ᵐ ω ∂μ.restrict E, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a ω i‖ ≤ D) ∧ + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b ω i‖ ≤ D)) : + IntegrableOn (fun ω => ∑ n ∈ Finset.range (2 * K + 1), + ‖convolution K (a ω) (b ω) n‖) E μ := by + classical + exact integrable_finsetSum _ (fun n _ => + integrableOn_norm_convolution μ E (measure_lt_top μ E) K n D a b ha hb + (hE.mono (fun _ h => h.1)) (hE.mono (fun _ h => h.2))) + +theorem integral_lower_of_sum_bound + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] + (K : ℕ) (D δ ε : ℝ) + (hcoeff : ∀ a b : ℤ → ℂ, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a i‖ ≤ D) → + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b i‖ ≤ D) → + δ ≤ ‖a 0‖ → δ ≤ ‖b 0‖ → + ε ≤ ∑ n ∈ Finset.range (2 * K + 1), ‖convolution K a b n‖) + (E : Set Ω) (a b : Ω → ℤ → ℂ) + (ha : ∀ i, Measurable (fun ω => a ω i)) + (hb : ∀ i, Measurable (fun ω => b ω i)) + (hE : ∀ᵐ ω ∂μ.restrict E, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a ω i‖ ≤ D) ∧ + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b ω i‖ ≤ D) ∧ + δ ≤ ‖a ω 0‖ ∧ δ ≤ ‖b ω 0‖) : + ε * μ.real E ≤ ∫ ω in E, ∑ n ∈ Finset.range (2 * K + 1), + ‖convolution K (a ω) (b ω) n‖ ∂μ := by + have hbounds : ∀ᵐ ω ∂μ.restrict E, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a ω i‖ ≤ D) ∧ + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b ω i‖ ≤ D) := + hE.mono (fun _ h => ⟨h.1, h.2.1⟩) + have hi := integrableOn_convolution_sum μ K D E a b ha hb hbounds + have hpoint : ∀ᵐ ω ∂μ.restrict E, + ε ≤ ∑ n ∈ Finset.range (2 * K + 1), ‖convolution K (a ω) (b ω) n‖ := + hE.mono (fun ω h => hcoeff (a ω) (b ω) h.1 h.2.1 h.2.2.1 h.2.2.2) + have h := integral_mono_ae (integrable_const ε) hi hpoint + simpa only [setIntegral_const, smul_eq_mul, mul_comm] using h + +theorem finite_sum_obstruction + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (E : Set Ω) (N : ℕ) (F : ℕ → Ω → ℝ) (c ε C : ℝ) + (hε : 0 ≤ ε) (hmass : c ≤ μ.real E) + (hint : ∀ n ∈ Finset.range N, IntegrableOn (F n) E μ) + (hlower : ε * μ.real E ≤ ∫ ω in E, ∑ n ∈ Finset.range N, F n ω ∂μ) + (hupper : ∀ n ∈ Finset.range N, (∫ ω in E, F n ω ∂μ) ≤ C) : + c * ε ≤ (N : ℝ) * C := by + calc + c * ε ≤ ε * μ.real E := by + simpa only [mul_comm] using mul_le_mul_of_nonneg_right hmass hε + _ ≤ ∫ ω in E, ∑ n ∈ Finset.range N, F n ω ∂μ := hlower + _ = ∑ n ∈ Finset.range N, ∫ ω in E, F n ω ∂μ := + integral_finsetSum _ hint + _ ≤ ∑ n ∈ Finset.range N, C := Finset.sum_le_sum hupper + _ = (N : ℝ) * C := by simp [nsmul_eq_mul] + +theorem uniform_event_integral_lower_bound + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] + (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) : + ∃ ε > 0, ∀ (E : Set Ω) (a b : Ω → ℤ → ℂ), + (∀ i, Measurable (fun ω => a ω i)) → + (∀ i, Measurable (fun ω => b ω i)) → + (∀ᵐ ω ∂μ.restrict E, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a ω i‖ ≤ D) ∧ + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b ω i‖ ≤ D) ∧ + δ ≤ ‖a ω 0‖ ∧ δ ≤ ‖b ω 0‖) → + ε * μ.real E ≤ ∫ ω in E, ∑ n ∈ Finset.range (2 * K + 1), + ‖convolution K (a ω) (b ω) n‖ ∂μ := by + obtain ⟨ε, hε, hcoeff⟩ := uniform_convolution_sum_lower_bound K D δ hδ + exact ⟨ε, hε, fun E a b ha hb hE => + integral_lower_of_sum_bound μ K D δ ε hcoeff E a b ha hb hE⟩ + +end Invariant233.FiniteWindow + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FrequencySplice.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FrequencySplice.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c626c669ae8cda9291b33ddaf56787f5aa674e3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FrequencySplice.lean @@ -0,0 +1,75 @@ +import Mathlib.Order.Monotone.Basic +import Mathlib.Tactic + +namespace OAI + +namespace Invariant233.PrescribedPhaseRealization + +def spliceFrequency (old new : ℕ → ℕ) (p : ℕ) (i : ℕ) : ℕ := + if i ≤ p then old i else new (i - p) + +theorem spliceFrequency_eq_old (old new : ℕ → ℕ) {p i : ℕ} (hi : i ≤ p) : + spliceFrequency old new p i = old i := by + simp [spliceFrequency, hi] + +theorem spliceFrequency_eq_new (old new : ℕ → ℕ) {p i : ℕ} + (hboundary : new 0 = old p) (hi : p ≤ i) : + spliceFrequency old new p i = new (i - p) := by + rcases eq_or_lt_of_le hi with rfl | hi + · simp [spliceFrequency, hboundary] + · simp [spliceFrequency, Nat.not_le.mpr hi] + +@[simp] theorem spliceFrequency_add (old new : ℕ → ℕ) (p i : ℕ) + (hboundary : new 0 = old p) : + spliceFrequency old new p (p + i) = new i := by + simpa using spliceFrequency_eq_new old new hboundary (Nat.le_add_right p i) + +theorem spliceFrequency_pos (old new : ℕ → ℕ) (p : ℕ) + (hold : ∀ i ≤ p, 0 < old i) (hnew : ∀ i, 0 < new i) : + ∀ i, 0 < spliceFrequency old new p i := by + intro i + by_cases hi : i ≤ p + · simpa [spliceFrequency, hi] using hold i hi + · simpa [spliceFrequency, hi] using hnew (i - p) + +theorem spliceFrequency_strictMono (old new : ℕ → ℕ) (p : ℕ) + (hboundary : new 0 = old p) + (hold : ∀ i < p, old i < old (i + 1)) (hnew : StrictMono new) : + StrictMono (spliceFrequency old new p) := by + apply strictMono_nat_of_lt_succ + intro i + by_cases hi : i < p + · rw [spliceFrequency_eq_old old new (by omega), + spliceFrequency_eq_old old new (by omega)] + exact hold i hi + · rw [spliceFrequency_eq_new old new hboundary (by omega), + spliceFrequency_eq_new old new hboundary (by omega)] + apply hnew + omega + +theorem spliceFrequency_divisible (old new : ℕ → ℕ) (p : ℕ) + (hboundary : new 0 = old p) + (hold : ∀ i < p, old i ∣ old (i + 1)) + (hnew : ∀ i, new i ∣ new (i + 1)) : + ∀ i, spliceFrequency old new p i ∣ spliceFrequency old new p (i + 1) := by + intro i + by_cases hi : i < p + · rw [spliceFrequency_eq_old old new (by omega), + spliceFrequency_eq_old old new (by omega)] + exact hold i hi + · rw [spliceFrequency_eq_new old new hboundary (by omega), + spliceFrequency_eq_new old new hboundary (by omega)] + have he : i + 1 - p = (i - p) + 1 := by omega + rw [he] + exact hnew (i - p) + +theorem spliceFrequency_ratio (old new : ℕ → ℕ) (p i : ℕ) + (hboundary : new 0 = old p) : + (spliceFrequency old new p (p + i + 1) : ℝ) / + spliceFrequency old new p (p + i) = (new (i + 1) : ℝ) / new i := by + rw [Nat.add_assoc, spliceFrequency_add old new p (i + 1) hboundary, + spliceFrequency_add old new p i hboundary] + +end Invariant233.PrescribedPhaseRealization + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/FrequencyTower.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/FrequencyTower.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9b27c2f8a117c301694a434017124289e08745b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/FrequencyTower.lean @@ -0,0 +1,62 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FrequencySplice + +namespace OAI + +namespace Invariant233.PrescribedPhaseRealization + +theorem frequencyTower_stable (d : ℕ → ℕ) (q : ℕ → ℕ → ℕ) + (hd : Monotone d) + (hkeep : ∀ j i, i ≤ d j → q (j + 1) i = q j i) + {j k i : ℕ} (hjk : j ≤ k) (hi : i ≤ d j) : q k i = q j i := by + induction k with + | zero => + have hj : j = 0 := by omega + subst j + rfl + | succ k ih => + by_cases hj : j = k + 1 + · subst j + rfl + · have hjk' : j ≤ k := by omega + calc + q (k + 1) i = q k i := hkeep k i (hi.trans (hd hjk')) + _ = q j i := ih hjk' + +theorem exists_frequency_of_prefix_tower (d : ℕ → ℕ) (q : ℕ → ℕ → ℕ) + (hd : Monotone d) (hcover : ∀ j, j ≤ d j) + (hkeep : ∀ j i, i ≤ d j → q (j + 1) i = q j i) + (hpos : ∀ j i, i ≤ d j → 0 < q j i) + (hmono : ∀ j i, i < d j → q j i < q j (i + 1)) + (hdiv : ∀ j i, i < d j → q j i ∣ q j (i + 1)) : + ∃ Q : ℕ → ℕ, (∀ j i, i ≤ d j → Q i = q j i) ∧ + (∀ i, 0 < Q i) ∧ StrictMono Q ∧ (∀ i, Q i ∣ Q (i + 1)) := by + let Q : ℕ → ℕ := fun i => q i i + have hagree : ∀ j i, i ≤ d j → Q i = q j i := by + intro j i hi + have ha := frequencyTower_stable d q hd hkeep (le_max_right j i) (hcover i) + have hb := frequencyTower_stable d q hd hkeep (le_max_left j i) hi + exact ha.symm.trans hb + refine ⟨Q, hagree, ?_, ?_, ?_⟩ + · intro i + exact hpos i i (hcover i) + · apply strictMono_nat_of_lt_succ + intro i + have hi : i < d (i + 1) := (Nat.lt_succ_self i).trans_le (hcover (i + 1)) + rw [hagree (i + 1) i hi.le, hagree (i + 1) (i + 1) (hcover (i + 1))] + exact hmono (i + 1) i hi + · intro i + have hi : i < d (i + 1) := (Nat.lt_succ_self i).trans_le (hcover (i + 1)) + rw [hagree (i + 1) i hi.le, hagree (i + 1) (i + 1) (hcover (i + 1))] + exact hdiv (i + 1) i hi + +theorem prefix_test_eq {ι α : Type*} (Q q : ℕ → ℕ) (p : ℕ) + (hkeep : ∀ i ≤ p, Q i = q i) (indices : ι → ℕ) + (hindices : ∀ i, indices i ≤ p) (test : (ι → ℕ) → α) : + test (fun i => Q (indices i)) = test (fun i => q (indices i)) := by + congr 1 + funext i + exact hkeep (indices i) (hindices i) + +end Invariant233.PrescribedPhaseRealization + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/GaugeIndicator.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/GaugeIndicator.lean new file mode 100644 index 0000000000000000000000000000000000000000..073b0e91fdfe4c45699fcf4998dc72198a4bbeee --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/GaugeIndicator.lean @@ -0,0 +1,111 @@ +import OAI.Analysis.IrrationalRotation.Rotation.DiagonalGauge +import Mathlib.MeasureTheory.Function.LpSpace.Indicator + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal +namespace Invariant233.DiagonalGauge + +theorem fiberOperator_single (t : Circle) (k : ℤ) (c : ℂ) : + fiberOperator t (lp.single 2 k c) = fourier k t • (lp.single 2 k c : Fiber) := by + apply lp.ext + funext j + change fourier j t * (lp.single 2 k c : Fiber) j = + fourier k t * (lp.single 2 k c : Fiber) j + by_cases hj : j = k + · subst j; rfl + · simp [lp.single_apply, hj] + +theorem fiberOperator_default_basis (t : Circle) (k : ℤ) : + fiberOperator t ((default : HilbertBasis ℤ ℂ Fiber) k) = + fourier k t • ((default : HilbertBasis ℤ ℂ Fiber) k) := by + have hb : (default : HilbertBasis ℤ ℂ Fiber) k = + (lp.single 2 k (1 : ℂ) : Fiber) := + (HilbertBasis.repr_symm_single (default : HilbertBasis ℤ ℂ Fiber) k).symm + rw [hb] + exact fiberOperator_single t k 1 + +variable {X : Type*} [MeasurableSpace X] (μ : Measure X) + +theorem fieldOperator_indicator (t : Circle) (s : Set X) + (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (v : Fiber) : + fieldOperator μ t (indicatorConstLp 2 hs hμs v) = + indicatorConstLp 2 hs hμs (fiberOperator t v) := by + apply Lp.ext + filter_upwards [fieldOperator_ae μ t (indicatorConstLp 2 hs hμs v), + (indicatorConstLp_coeFn (p := 2) (hs := hs) (hμs := hμs) (c := v)), + (indicatorConstLp_coeFn (p := 2) (hs := hs) (hμs := hμs) + (c := fiberOperator t v))] with x hf hx hy + rw [hf, hx, hy] + by_cases hxs : x ∈ s <;> simp [hxs] + +theorem fieldOperator_indicator_single (t : Circle) (s : Set X) + (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (k : ℤ) (c : ℂ) : + fieldOperator μ t (indicatorConstLp 2 hs hμs (lp.single 2 k c : Fiber)) = + fourier k t • indicatorConstLp 2 hs hμs (lp.single 2 k c : Fiber) := by + rw [fieldOperator_indicator, fiberOperator_single] + apply Lp.ext + filter_upwards + [indicatorConstLp_coeFn (p := 2) (hs := hs) (hμs := hμs) + (c := fourier k t • (lp.single 2 k c : Fiber)), + indicatorConstLp_coeFn (p := 2) (hs := hs) (hμs := hμs) + (c := (lp.single 2 k c : Fiber)), + Lp.coeFn_smul (fourier k t) (indicatorConstLp 2 hs hμs (lp.single 2 k c : Fiber))] + with x hleft hbase hright + rw [hleft, hright] + change s.indicator (fun _ => fourier k t • (lp.single 2 k c : Fiber)) x = + fourier k t • indicatorConstLp 2 hs hμs (lp.single 2 k c : Fiber) x + rw [hbase] + by_cases hxs : x ∈ s <;> simp [hxs] + +theorem fieldOperator_indicator_basis (t : Circle) (s : Set X) + (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (k : ℤ) : + fieldOperator μ t (indicatorConstLp 2 hs hμs ((default : HilbertBasis ℤ ℂ Fiber) k)) = + fourier k t • indicatorConstLp 2 hs hμs ((default : HilbertBasis ℤ ℂ Fiber) k) := by + have hb : (default : HilbertBasis ℤ ℂ Fiber) k = + (lp.single 2 k (1 : ℂ) : Fiber) := + (HilbertBasis.repr_symm_single (default : HilbertBasis ℤ ℂ Fiber) k).symm + rw [hb] + exact fieldOperator_indicator_single μ t s hs hμs k 1 + +theorem fourier_neg_parameter (k : ℤ) (t : Circle) : + fourier k (-t) = star (fourier k t) := by + simp only [fourier_apply, smul_neg, fourier_neg', Complex.star_def] + +theorem inner_conjugate_of_eigenvectors + (A : Lp Fiber 2 μ →L[ℂ] Lp Fiber 2 μ) (v w : Lp Fiber 2 μ) + (j k : ℤ) + (hv : ∀ t : Circle, fieldOperator μ t v = fourier j t • v) + (hw : ∀ t : Circle, fieldOperator μ t w = fourier k t • w) + (t : Circle) : + inner ℂ w (conjugate μ A t v) = fourier (k-j) t * inner ℂ w (A v) := by + change inner ℂ w (fieldOperator μ t (A (fieldOperator μ (-t) v))) = _ + rw [← ContinuousLinearMap.adjoint_inner_left, fieldOperator_adjoint, + hw, hv, map_smul, inner_smul_left, inner_smul_right] + have hchar : star (fourier k (-t)) * fourier j (-t) = fourier (k-j) t := by + rw [fourier_neg_parameter, star_star, fourier_neg_parameter] + rw [sub_eq_add_neg, fourier_add, fourier_neg] + rfl + change star (fourier k (-t)) * (fourier j (-t) * inner ℂ w (A v)) = _ + rw [← mul_assoc, hchar] + +theorem inner_conjugate_indicator_basis + (A : Lp Fiber 2 μ →L[ℂ] Lp Fiber 2 μ) + (s u : Set X) (hs : MeasurableSet s) (hu : MeasurableSet u) + (hμs : μ s ≠ ∞) (hμu : μ u ≠ ∞) (j k : ℤ) (t : Circle) : + inner ℂ (indicatorConstLp 2 hu hμu ((default : HilbertBasis ℤ ℂ Fiber) k)) + (conjugate μ A t (indicatorConstLp 2 hs hμs ((default : HilbertBasis ℤ ℂ Fiber) j))) = + fourier (k-j) t * inner ℂ + (indicatorConstLp 2 hu hμu ((default : HilbertBasis ℤ ℂ Fiber) k)) + (A (indicatorConstLp 2 hs hμs ((default : HilbertBasis ℤ ℂ Fiber) j))) := + inner_conjugate_of_eigenvectors μ A _ _ j k + (fun t => fieldOperator_indicator_basis μ t s hs hμs j) + (fun t => fieldOperator_indicator_basis μ t u hu hμu k) t + +end Invariant233.DiagonalGauge + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/GeneratedVonNeumann.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/GeneratedVonNeumann.lean new file mode 100644 index 0000000000000000000000000000000000000000..97ed966d2ca64f85cc00f1aa8e4e9e459781ce6d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/GeneratedVonNeumann.lean @@ -0,0 +1,68 @@ +import OAI.Analysis.IrrationalRotation.Model.GeneratedVonNeumann + +namespace OAI + +open scoped Pointwise + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +@[simp] +theorem coe_vonNeumannGenerated (s : Set (H →L[ℂ] H)) : + (vonNeumannGenerated s : Set (H →L[ℂ] H)) = + (s ∪ star s).centralizer.centralizer := by + exact StarSubalgebra.coe_centralizer_centralizer ℂ s + +theorem subset_vonNeumannGenerated (s : Set (H →L[ℂ] H)) : + s ⊆ vonNeumannGenerated s := by + rw [coe_vonNeumannGenerated] + exact Set.Subset.trans Set.subset_union_left Set.subset_centralizer_centralizer + +theorem vonNeumannGenerated_le (s : Set (H →L[ℂ] H)) (M : VonNeumannAlgebra H) + (hs : s ⊆ M) : vonNeumannGenerated s ≤ M := by + change (vonNeumannGenerated s : Set (H →L[ℂ] H)) ⊆ M + rw [coe_vonNeumannGenerated, ← M.centralizer_centralizer] + apply Set.centralizer_subset + apply Set.centralizer_subset + intro T hT + rcases hT with hT | hT + · exact hs hT + · have hstar : star T ∈ s := hT + simpa using (star_mem (hs hstar) : star (star T) ∈ M) + +theorem vonNeumannGenerated_le_iff (s : Set (H →L[ℂ] H)) (M : VonNeumannAlgebra H) : + vonNeumannGenerated s ≤ M ↔ s ⊆ M := by + exact ⟨fun h => Set.Subset.trans (subset_vonNeumannGenerated s) h, + vonNeumannGenerated_le s M⟩ + +theorem vonNeumannGenerated_mono {s t : Set (H →L[ℂ] H)} (hst : s ⊆ t) : + vonNeumannGenerated s ≤ vonNeumannGenerated t := + vonNeumannGenerated_le s _ (hst.trans (subset_vonNeumannGenerated t)) + +@[simp] +theorem vonNeumannGenerated_coe (M : VonNeumannAlgebra H) : + vonNeumannGenerated (M : Set (H →L[ℂ] H)) = M := by + apply le_antisymm + · exact vonNeumannGenerated_le _ _ (Set.Subset.refl _) + · exact subset_vonNeumannGenerated _ + +@[simp] +theorem coe_commutant_vonNeumannGenerated (s : Set (H →L[ℂ] H)) : + ((vonNeumannGenerated s).commutant : Set (H →L[ℂ] H)) = + (s ∪ star s).centralizer := by + rw [VonNeumannAlgebra.coe_commutant, coe_vonNeumannGenerated, + Set.centralizer_centralizer_centralizer] + +theorem mem_commutant_vonNeumannGenerated_iff (s : Set (H →L[ℂ] H)) + (T : H →L[ℂ] H) : + T ∈ (vonNeumannGenerated s).commutant ↔ + ∀ A ∈ s, A * T = T * A ∧ star A * T = T * star A := by + change T ∈ ((vonNeumannGenerated s).commutant : Set (H →L[ℂ] H)) ↔ _ + rw [coe_commutant_vonNeumannGenerated] + exact StarSubalgebra.mem_centralizer_iff ℂ + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/GeometricAverage.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/GeometricAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..971886af72481148c13f53e1530e88466d8d281f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/GeometricAverage.lean @@ -0,0 +1,91 @@ +import Mathlib.Analysis.Fourier.AddCircle +import Mathlib.NumberTheory.Real.Irrational +import Mathlib.Algebra.Field.GeomSum +import Mathlib.Tactic + +namespace OAI + +open Filter Topology +open scoped BigOperators + +namespace Invariant233 + +theorem norm_geometric_sum_le (r : ℂ) (hr : r ≠ 1) (hrnorm : ‖r‖ = 1) + (n : ℕ) : + ‖∑ k ∈ Finset.range n, r ^ k‖ ≤ 2 / ‖r - 1‖ := by + rw [geom_sum_eq hr, norm_div] + apply div_le_div_of_nonneg_right _ (norm_nonneg _) + calc + ‖r ^ n - 1‖ ≤ ‖r ^ n‖ + ‖(1 : ℂ)‖ := norm_sub_le _ _ + _ = 2 := by norm_num [norm_pow, hrnorm] + +theorem norm_geometric_average_le (r z : ℂ) (hr : r ≠ 1) + (hrnorm : ‖r‖ = 1) (n : ℕ) : + ‖(∑ k ∈ Finset.range n, z * r ^ k) / (n : ℂ)‖ ≤ + (‖z‖ * (2 / ‖r - 1‖)) / (n : ℝ) := by + rw [← Finset.mul_sum, norm_div, norm_mul, norm_natCast] + apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg n) + exact mul_le_mul_of_nonneg_left (norm_geometric_sum_le r hr hrnorm n) (norm_nonneg z) + +theorem norm_geometric_average_le_of_norm_le_one (r z : ℂ) (hr : r ≠ 1) + (hrnorm : ‖r‖ = 1) (hz : ‖z‖ ≤ 1) (n : ℕ) : + ‖(∑ k ∈ Finset.range n, z * r ^ k) / (n : ℂ)‖ ≤ + (2 / ‖r - 1‖) / (n : ℝ) := by + apply (norm_geometric_average_le r z hr hrnorm n).trans + apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg n) + simpa using mul_le_mul_of_nonneg_right hz + (show 0 ≤ 2 / ‖r - 1‖ by positivity) + +theorem tendstoUniformlyOn_geometric_average (r : ℂ) (hr : r ≠ 1) + (hrnorm : ‖r‖ = 1) : + TendstoUniformlyOn + (fun n : ℕ => fun z : ℂ => (∑ k ∈ Finset.range n, z * r ^ k) / (n : ℂ)) + (fun _ => 0) atTop {z : ℂ | ‖z‖ ≤ 1} := by + apply Metric.tendstoUniformlyOn_iff.mpr + intro ε hε + have hlim : Tendsto (fun n : ℕ => (2 / ‖r - 1‖) / (n : ℝ)) + atTop (𝓝 0) := tendsto_const_nhds.div_atTop tendsto_natCast_atTop_atTop + filter_upwards [(tendsto_order.mp hlim).2 ε hε] with n hn + intro z hz + simpa only [dist_zero_left] using + (norm_geometric_average_le_of_norm_le_one r z hr hrnorm hz n).trans_lt hn + +theorem fourier_rotation_orbit (m : ℤ) (x θ : AddCircle (1 : ℝ)) (k : ℕ) : + fourier m (x + k • θ) = fourier m x * (fourier m θ) ^ k := by + simp only [fourier_apply, zsmul_add, smul_comm m k, AddCircle.toCircle_add, + AddCircle.toCircle_nsmul, Circle.coe_mul, Circle.coe_pow] + +theorem fourier_irrational_ne_one {θ : ℝ} (hθ : Irrational θ) + {m : ℤ} (hm : m ≠ 0) : + fourier m (θ : AddCircle (1 : ℝ)) ≠ 1 := by + intro h + have hc : AddCircle.toCircle (m • (θ : AddCircle (1 : ℝ))) = 1 := by + apply Subtype.ext + exact h + have hz : m • (θ : AddCircle (1 : ℝ)) = 0 := + AddCircle.injective_toCircle one_ne_zero (hc.trans AddCircle.toCircle_zero.symm) + have hreal : (((m : ℝ) * θ : ℝ) : AddCircle (1 : ℝ)) = 0 := by + simpa only [← AddCircle.coe_zsmul, zsmul_eq_mul] using hz + obtain ⟨j, hj⟩ := (AddCircle.coe_eq_zero_iff (1 : ℝ)).mp hreal + exact (hθ.intCast_mul hm).ne_int j (by simpa using hj.symm) + +theorem tendstoUniformly_fourier_rotation {θ : ℝ} (hθ : Irrational θ) + {m : ℤ} (hm : m ≠ 0) : + TendstoUniformly + (fun n : ℕ => fun x : AddCircle (1 : ℝ) => + (∑ k ∈ Finset.range n, fourier m (x + k • (θ : AddCircle (1 : ℝ)))) / + (n : ℂ)) + (fun _ => 0) atTop := by + apply Metric.tendstoUniformly_iff.mpr + intro ε hε + have hr : fourier m (θ : AddCircle (1 : ℝ)) ≠ 1 := fourier_irrational_ne_one hθ hm + have hrnorm : ‖fourier m (θ : AddCircle (1 : ℝ))‖ = 1 := Circle.norm_coe _ + have hlim := tendstoUniformlyOn_geometric_average _ hr hrnorm + filter_upwards [(Metric.tendstoUniformlyOn_iff.mp hlim) ε hε] with n hn + intro x + have hx : ‖fourier m x‖ ≤ 1 := le_of_eq (Circle.norm_coe _) + simpa only [fourier_rotation_orbit] using hn (fourier m x) hx + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/GeometricTails.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/GeometricTails.lean new file mode 100644 index 0000000000000000000000000000000000000000..9966b383a05933d777e124209c5cdae29484d5cb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/GeometricTails.lean @@ -0,0 +1,85 @@ +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Topology.Algebra.InfiniteSum.Order +import Mathlib.Tactic + +namespace OAI + +namespace InvariantProjection.GeometricTails + +theorem reciprocal_step {K : ℕ → ℝ} (hpos : ∀ j, 0 < K j) + (hdouble : ∀ j, 2 * K j ≤ K (j + 1)) (j : ℕ) : + 1 / K (j + 1) ≤ (1 / 2 : ℝ) * (1 / K j) := by + calc + 1 / K (j + 1) ≤ 1 / (2 * K j) := + one_div_le_one_div_of_le (mul_pos (by norm_num) (hpos j)) (hdouble j) + _ = (1 / 2 : ℝ) * (1 / K j) := by ring + +theorem reciprocal_add_le {K : ℕ → ℝ} (hpos : ∀ j, 0 < K j) + (hdouble : ∀ j, 2 * K j ≤ K (j + 1)) (j n : ℕ) : + 1 / K (j + n) ≤ (1 / K j) * (1 / 2 : ℝ) ^ n := by + induction n with + | zero => simp + | succ n ih => + calc + 1 / K (j + (n + 1)) ≤ (1 / 2 : ℝ) * (1 / K (j + n)) := by + simpa only [Nat.add_assoc] using reciprocal_step hpos hdouble (j + n) + _ ≤ (1 / 2 : ℝ) * ((1 / K j) * (1 / 2 : ℝ) ^ n) := by + exact mul_le_mul_of_nonneg_left ih (by norm_num) + _ = (1 / K j) * (1 / 2 : ℝ) ^ (n + 1) := by rw [pow_succ]; ring + +theorem summable_reciprocal {K : ℕ → ℝ} (hpos : ∀ j, 0 < K j) + (hdouble : ∀ j, 2 * K j ≤ K (j + 1)) : + Summable (fun j => 1 / K j) := by + apply Summable.of_nonneg_of_le (fun j => le_of_lt (one_div_pos.mpr (hpos j))) + · intro j + simpa using reciprocal_add_le hpos hdouble 0 j + · simpa using summable_geometric_two.mul_left (1 / K 0) + +theorem tsum_reciprocal_add_le {K : ℕ → ℝ} (hpos : ∀ j, 0 < K j) + (hdouble : ∀ j, 2 * K j ≤ K (j + 1)) (j : ℕ) : + (∑' n : ℕ, 1 / K (j + n)) ≤ 2 / K j := by + have hs : Summable (fun n : ℕ => 1 / K (j + n)) := by + simpa only [Nat.add_comm] using (summable_nat_add_iff j).mpr + (summable_reciprocal hpos hdouble) + calc + (∑' n : ℕ, 1 / K (j + n)) ≤ + ∑' n : ℕ, (1 / K j) * (1 / 2 : ℝ) ^ n := + hs.tsum_le_tsum (reciprocal_add_le hpos hdouble j) + (summable_geometric_two.mul_left (1 / K j)) + _ = 2 / K j := by rw [tsum_mul_left, tsum_geometric_two]; ring + +theorem tsum_reciprocal_tail_le {K : ℕ → ℝ} (hpos : ∀ j, 0 < K j) + (hdouble : ∀ j, 2 * K j ≤ K (j + 1)) (j : ℕ) : + (∑' n : ℕ, 1 / K (j + 1 + n)) ≤ 2 / K (j + 1) := + tsum_reciprocal_add_le hpos hdouble (j + 1) + +theorem summable_height_div {K H : ℕ → ℝ} (hK : ∀ j, 0 < K j) + (hH : ∀ j, 0 ≤ H j) + (hbound : ∀ j, H (j + 1) / K (j + 1) ≤ (1 / 2 : ℝ) ^ j) : + Summable (fun j => H j / K j) := by + apply (summable_nat_add_iff 1).mp + exact Summable.of_nonneg_of_le + (fun j => div_nonneg (hH (j + 1)) (hK (j + 1)).le) + hbound summable_geometric_two + +theorem summable_one_add_height_div {K H : ℕ → ℝ} (hK : ∀ j, 0 < K j) + (hdouble : ∀ j, 2 * K j ≤ K (j + 1)) (hH : ∀ j, 0 ≤ H j) + (hbound : ∀ j, H (j + 1) / K (j + 1) ≤ (1 / 2 : ℝ) ^ j) : + Summable (fun j => (1 + H j) / K j) := by + simpa only [add_div] using + (summable_reciprocal hK hdouble).add (summable_height_div hK hH hbound) + +theorem tsum_height_div_tail_le {K H : ℕ → ℝ} (hK : ∀ j, 0 < K j) + (hH : ∀ j, 0 ≤ H j) + (hbound : ∀ j, H (j + 1) / K (j + 1) ≤ (1 / 2 : ℝ) ^ j) : + (∑' j : ℕ, H (j + 1) / K (j + 1)) ≤ 2 := by + have hs : Summable (fun j : ℕ => H (j + 1) / K (j + 1)) := + (summable_nat_add_iff 1).mpr (summable_height_div hK hH hbound) + calc + (∑' j : ℕ, H (j + 1) / K (j + 1)) ≤ ∑' j : ℕ, (1 / 2 : ℝ) ^ j := + hs.tsum_le_tsum hbound summable_geometric_two + _ = 2 := tsum_geometric_two + +end InvariantProjection.GeometricTails + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/GraphMeasureConvergence.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/GraphMeasureConvergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec11aa35964f972a0ecaa2f37e9d308fa9b081e9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/GraphMeasureConvergence.lean @@ -0,0 +1,172 @@ +import Mathlib +import OAI.Analysis.IrrationalRotation.Analysis.DensityMeasureConvergence +import OAI.Analysis.IrrationalRotation.Analysis.UniformAbsoluteContinuityLimits + +namespace OAI + +open MeasureTheory Filter Set BoundedContinuousFunction +open scoped Topology + +namespace Invariant233.GraphMeasureConvergence + +variable {X Y : Type*} + [PseudoMetricSpace X] [CompactSpace X] [MeasurableSpace X] [BorelSpace X] + [PseudoMetricSpace Y] [CompactSpace Y] [MeasurableSpace Y] [BorelSpace Y] + +theorem tendsto_integral_sub_graph + (ν : ℕ → FiniteMeasure (X × Y)) (g : X → Y) (hg : Continuous g) + (M : ℝ) (hM : ∀ᶠ n in atTop, (ν n : Measure (X × Y)).real univ ≤ M) + (hnear : ∀ δ : ℝ, 0 < δ → ∀ᶠ n in atTop, + ∀ᵐ z ∂(ν n : Measure (X × Y)), dist z.2 (g z.1) < δ) + (f : (X × Y) →ᵇ ℝ) : + Tendsto (fun n => (∫ z, f z ∂(ν n : Measure (X × Y))) - + ∫ z, f (z.1, g z.1) ∂(ν n : Measure (X × Y))) atTop (𝓝 0) := by + let B : ℝ := |M| + 1 + have hB : 0 < B := by dsimp [B]; positivity + let G : C(X × Y, X × Y) := + ⟨fun z => (z.1, g z.1), continuous_fst.prodMk (hg.comp continuous_fst)⟩ + apply Metric.tendsto_nhds.mpr + intro ε hε + have hη : 0 < ε / (2 * B) := div_pos hε (by positivity) + obtain ⟨δ, hδ, hδf⟩ := Metric.uniformContinuous_iff.mp + (CompactSpace.uniformContinuous_of_continuous f.continuous) (ε / (2 * B)) hη + filter_upwards [hM, hnear δ hδ] with n hn hclose + have hpoint : ∀ᵐ z ∂(ν n : Measure (X × Y)), + ‖f z - f (z.1, g z.1)‖ ≤ ε / (2 * B) := by + filter_upwards [hclose] with z hz + have hd : dist z (z.1, g z.1) < δ := by + simpa only [Prod.dist_eq, dist_self, max_eq_right dist_nonneg] using hz + simpa only [dist_eq_norm] using (hδf hd).le + have hfg : Integrable (fun z : X × Y => f (z.1, g z.1)) + (ν n : Measure (X × Y)) := (f.compContinuous G).integrable _ + rw [dist_zero_right, ← integral_sub (f.integrable _) hfg] + calc + ‖∫ z, f z - f (z.1, g z.1) ∂(ν n : Measure (X × Y))‖ ≤ + (ε / (2 * B)) * (ν n : Measure (X × Y)).real univ := + norm_integral_le_of_norm_le_const hpoint + _ ≤ (ε / (2 * B)) * B := by + apply mul_le_mul_of_nonneg_left _ hη.le + exact hn.trans (by dsimp [B]; linarith [le_abs_self M]) + _ = ε / 2 := by field_simp + _ < ε := by linarith + +theorem tendsto_graph_of_first_marginal + (ν : ℕ → FiniteMeasure (X × Y)) (μ : FiniteMeasure X) + (g : X → Y) (hg : Continuous g) + (hfirst : Tendsto (fun n => (ν n).map Prod.fst) atTop (𝓝 μ)) + (hnear : ∀ δ : ℝ, 0 < δ → ∀ᶠ n in atTop, + ∀ᵐ z ∂(ν n : Measure (X × Y)), dist z.2 (g z.1) < δ) : + Tendsto ν atTop (𝓝 (μ.map (fun x => (x, g x)))) := by + have hmass : Tendsto (fun n => (ν n : Measure (X × Y)).real univ) + atTop (𝓝 ((μ : Measure X).real univ)) := by + have h := NNReal.continuous_coe.continuousAt.tendsto.comp hfirst.mass + simpa only [Function.comp_def, FiniteMeasure.measureReal_eq_coe_coeFn, + FiniteMeasure.mass, FiniteMeasure.map_apply _ measurable_fst MeasurableSet.univ, + Set.preimage_univ] using h + let M := (μ : Measure X).real univ + 1 + have hM : ∀ᶠ n in atTop, (ν n : Measure (X × Y)).real univ ≤ M := + (hmass.eventually_lt_const (by dsimp [M]; linarith)).mono (fun _ h => h.le) + apply FiniteMeasure.tendsto_of_forall_integral_tendsto + intro f + let G : C(X, X × Y) := ⟨fun x => (x, g x), continuous_id.prodMk hg⟩ + have hgraph := FiniteMeasure.tendsto_iff_forall_integral_tendsto.mp hfirst + (f.compContinuous G) + have heq : ∀ n, (∫ x, (f.compContinuous G) x ∂((ν n).map Prod.fst : Measure X)) = + ∫ z, f (z.1, g z.1) ∂(ν n : Measure (X × Y)) := by + intro n + exact integral_map measurable_fst.aemeasurable + ((f.compContinuous G).continuous.measurable.aestronglyMeasurable) + simp_rw [heq] at hgraph + have hlim := (tendsto_integral_sub_graph ν g hg M hM hnear f).add hgraph + have hmap : (∫ z, f z ∂(μ.map (fun x => (x, g x)) : Measure (X × Y))) = + ∫ x, (f.compContinuous G) x ∂(μ : Measure X) := + integral_map (continuous_id.prodMk hg).measurable.aemeasurable + f.continuous.measurable.aestronglyMeasurable + rw [hmap] + simpa only [sub_add_cancel, zero_add] using hlim + +theorem tendsto_restrict_of_compl_mass_tendsto_zero + {Z : Type*} [TopologicalSpace Z] [MeasurableSpace Z] [OpensMeasurableSpace Z] + (ν : ℕ → FiniteMeasure Z) (μ : FiniteMeasure Z) + (hν : Tendsto ν atTop (𝓝 μ)) (s : ℕ → Set Z) + (hs : ∀ n, MeasurableSet (s n)) + (hremoved : Tendsto (fun n => (ν n : Measure Z).real (s n)ᶜ) atTop (𝓝 0)) : + Tendsto (fun n => (ν n).restrict (s n)) atTop (𝓝 μ) := by + apply FiniteMeasure.tendsto_of_forall_integral_tendsto + intro f + have hdiff : Tendsto (fun n => (∫ z, f z ∂(ν n : Measure Z)) - + ∫ z in s n, f z ∂(ν n : Measure Z)) atTop (𝓝 0) := by + apply squeeze_zero_norm + (fun n => norm_integral_sub_setIntegral_le + (Eventually.of_forall fun z => f.norm_coe_le_norm z) (hs n) (f.integrable _)) + simpa only [zero_mul] using hremoved.mul_const ‖f‖ + have htest := FiniteMeasure.tendsto_iff_forall_integral_tendsto.mp hν f + simpa only [sub_sub_cancel, sub_zero, FiniteMeasure.restrict_measure_eq] using htest.sub hdiff + +theorem tendsto_trimmed_graph_of_first_marginal + (ν : ℕ → FiniteMeasure (X × Y)) (μ : FiniteMeasure X) + (g : X → Y) (hg : Continuous g) + (hfirst : Tendsto (fun n => (ν n).map Prod.fst) atTop (𝓝 μ)) + (hnear : ∀ δ : ℝ, 0 < δ → ∀ᶠ n in atTop, + ∀ᵐ z ∂(ν n : Measure (X × Y)), dist z.2 (g z.1) < δ) + (s : ℕ → Set (X × Y)) (hs : ∀ n, MeasurableSet (s n)) + (hremoved : Tendsto (fun n => (ν n : Measure (X × Y)).real (s n)ᶜ) + atTop (𝓝 0)) : + Tendsto (fun n => (ν n).restrict (s n)) atTop + (𝓝 (μ.map (fun x => (x, g x)))) := + tendsto_restrict_of_compl_mass_tendsto_zero ν _ + (tendsto_graph_of_first_marginal ν μ g hg hfirst hnear) s hs hremoved + +theorem tendsto_graph_of_first_marginal_of_dist_le + (ν : ℕ → FiniteMeasure (X × Y)) (μ : FiniteMeasure X) + (g : X → Y) (hg : Continuous g) + (hfirst : Tendsto (fun n => (ν n).map Prod.fst) atTop (𝓝 μ)) + (ε : ℕ → ℝ) (hε : Tendsto ε atTop (𝓝 0)) + (hnear : ∀ n, ∀ᵐ z ∂(ν n : Measure (X × Y)), dist z.2 (g z.1) ≤ ε n) : + Tendsto ν atTop (𝓝 (μ.map (fun x => (x, g x)))) := by + apply tendsto_graph_of_first_marginal ν μ g hg hfirst + intro δ hδ + filter_upwards [hε.eventually_lt_const hδ] with n hn + exact (hnear n).mono (fun _ hz => hz.trans_lt hn) + +theorem tendsto_graph_of_first_density_L2 + (ν : ℕ → FiniteMeasure (X × Y)) (μ : FiniteMeasure X) + [IsProbabilityMeasure (μ : Measure X)] + (g : X → Y) (hg : Continuous g) (ρ : ℕ → X → ℝ) + (hρ : ∀ n, MemLp (ρ n) 2 (μ : Measure X)) + (hnonneg : ∀ n, 0 ≤ᵐ[(μ : Measure X)] ρ n) + (hfirst : ∀ n, ((ν n).map Prod.fst : Measure X) = + (μ : Measure X).withDensity (fun x => ENNReal.ofReal (ρ n x))) + (hL2 : Tendsto (fun n => eLpNorm (fun x => ρ n x - 1) 2 (μ : Measure X)) + atTop (𝓝 0)) + (hnear : ∀ δ : ℝ, 0 < δ → ∀ᶠ n in atTop, + ∀ᵐ z ∂(ν n : Measure (X × Y)), dist z.2 (g z.1) < δ) : + Tendsto ν atTop (𝓝 (μ.map (fun x => (x, g x)))) := + tendsto_graph_of_first_marginal ν μ g hg + (tendsto_of_density_L2 μ (fun n => (ν n).map Prod.fst) ρ hρ hnonneg hfirst hL2) hnear + +theorem tendsto_trimmed_graph_of_uniform_first_marginal + (ν : ℕ → FiniteMeasure (X × Y)) (μ : FiniteMeasure X) + (g : X → Y) (hg : Continuous g) + (hfirst : Tendsto (fun n => (ν n).map Prod.fst) atTop (𝓝 μ)) + (hnear : ∀ δ : ℝ, 0 < δ → ∀ᶠ n in atTop, + ∀ᵐ z ∂(ν n : Measure (X × Y)), dist z.2 (g z.1) < δ) + (huac : UniformlyAbsolutelyContinuous (μ : Measure X) + (fun n => (ν n : Measure (X × Y)).map Prod.fst)) + (s : ℕ → Set X) (hs : ∀ n, MeasurableSet (s n)) + (hbase : Tendsto (fun n => (μ : Measure X).real (s n)ᶜ) atTop (𝓝 0)) : + Tendsto (fun n => (ν n).restrict (Prod.fst ⁻¹' s n)) atTop + (𝓝 (μ.map (fun x => (x, g x)))) := by + apply tendsto_trimmed_graph_of_first_marginal ν μ g hg hfirst hnear + (fun n => Prod.fst ⁻¹' s n) (fun n => (hs n).preimage measurable_fst) + have h := huac.tendsto_real_apply_of_base_real_tendsto_zero + (fun n => (s n)ᶜ) (fun n => (hs n).compl) hbase + have heq (n : ℕ) : ((ν n : Measure (X × Y)).map Prod.fst).real (s n)ᶜ = + (ν n : Measure (X × Y)).real (Prod.fst ⁻¹' s n)ᶜ := by + rw [map_measureReal_apply measurable_fst (hs n).compl] + rfl + simpa only [heq] using h + +end Invariant233.GraphMeasureConvergence + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/HeightScaleConstruction.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/HeightScaleConstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..164a8adf3a41660ab0c06e90db58103a7057d945 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/HeightScaleConstruction.lean @@ -0,0 +1,233 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductScales +import OAI.Analysis.IrrationalRotation.Sampling.SamplingHorizon +import OAI.Analysis.IrrationalRotation.Analysis.LaurentNoncancellation +import OAI.Analysis.IrrationalRotation.Analysis.OrbitPartition +import OAI.Analysis.IrrationalRotation.Product.ProductScaleConsequences +import OAI.Analysis.IrrationalRotation.Analysis.GeometricTails + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Invariant233.HeightScaleConstruction + +open SamplingHorizon FiniteWindow + +variable (height lower : ℕ → ℕ) + +private structure State where + K : ℕ + G : ℕ + count : ℕ + cost : ℝ + previousL : ℝ + +private structure Step (height lower : ℕ → ℕ) (n : ℕ) (s : State) where + m : ℕ + Gnext : ℕ + L : ℝ + ε : ℝ + epsilon_pos : 0 < ε + L_one : 1 ≤ L + L_previous : s.previousL ≤ L + gain_one : 1 ≤ Gnext + gain : L ≤ ProductScaleData.kappa (n + 1) * Real.sqrt (Gnext : ℝ) + m_K : s.K ≤ m + m_pow : 2 ^ (n + 1) ≤ m + m_G : 4 * s.G ≤ m + m_large : 200 ≤ m + m_lower : lower n ≤ m + height_bound : (height (n + 1) : ℝ) / + (⌈(m : ℝ) ^ ((3 / 4 : ℝ) * m)⌉₊ : ℝ) ≤ (1 / 2 : ℝ) ^ (n + 1) + count_bound : (s.count : ℝ) ≤ (m : ℝ) / 100 + attenuation_m : L ≤ ProductScaleData.kappa n * (m : ℝ) ^ (1 / 40 : ℝ) + gap : (Gnext : ℝ) * (⌈(m : ℝ) ^ ((3 / 4 : ℝ) * m)⌉₊ : ℝ) < + (m : ℝ) ^ ((4 / 5 : ℝ) * m) + double : 2 * s.K < ⌈(m : ℝ) ^ ((3 / 4 : ℝ) * m)⌉₊ + attenuation : ((2 * s.K + 1 : ℕ) : ℝ) * 3 * Real.exp (-L / 10000) ≤ + ε / ((n + 1 : ℕ) : ℝ) + polynomial : ∀ A B : ℤ → ℂ, + (∀ i, |i| ≤ (s.K : ℤ) → ‖A i‖ ≤ Real.exp (((s.K : ℝ) + 1) * s.cost)) → + (∀ i, |i| ≤ (s.K : ℤ) → ‖B i‖ ≤ Real.exp (((s.K : ℝ) + 1) * s.cost)) → + 1 / ((n + 1 : ℕ) : ℝ) ≤ ‖A 0‖ → 1 / ((n + 1 : ℕ) : ℝ) ≤ ‖B 0‖ → + ∃ i : ℕ, i ≤ 2 * s.K ∧ ε ≤ ‖convolution s.K A B i‖ + +private theorem step_exists (n : ℕ) (s : State) : Nonempty (Step height lower n s) := by + have hn : (0 : ℝ) < ((n + 1 : ℕ) : ℝ) := by positivity + obtain ⟨ε, hε, hpoly⟩ := uniform_convolution_lower_bound s.K + (Real.exp (((s.K : ℝ) + 1) * s.cost)) (1 / ((n + 1 : ℕ) : ℝ)) (by positivity) + obtain ⟨L, hL1, hLprev, hL⟩ := exists_attenuation + (((2 * s.K + 1 : ℕ) : ℝ) * 3) s.previousL + (ε / ((n + 1 : ℕ) : ℝ)) (div_pos hε hn) + have hk : 0 < ProductScaleData.kappa (n + 1) := by + unfold ProductScaleData.kappa + positivity + obtain ⟨G, hG, hgain⟩ := exists_next_gain (ProductScaleData.kappa (n + 1)) L hk + obtain ⟨m, hmstage, hmlower⟩ := ((eventually_stage_size (n + 1) (by omega) + s.K s.G G L (height (n + 1)) s.count).and + (Filter.eventually_ge_atTop (lower n))).exists + obtain ⟨hmK, hmpow, hmG, hmlarge, hcount, hmL, hgap, hheight, hdouble⟩ := hmstage + exact ⟨{ + m := m, Gnext := G, L := L, ε := ε + epsilon_pos := hε, L_one := hL1, L_previous := hLprev + gain_one := hG, gain := hgain + m_K := by exact_mod_cast hmK + m_pow := by exact_mod_cast hmpow + m_G := by exact_mod_cast hmG + m_large := hmlarge + m_lower := hmlower + height_bound := hheight + count_bound := hcount + attenuation_m := hmL + gap := hgap + double := by exact_mod_cast hdouble + attenuation := hL + polynomial := hpoly }⟩ + +private def chooseStep (n : ℕ) (s : State) : Step height lower n s := + Classical.choice (step_exists height lower n s) + +private def nextState (n : ℕ) (s : State) : State := + let t := chooseStep height lower n s + { K := ⌈(t.m : ℝ) ^ ((3 / 4 : ℝ) * t.m)⌉₊ + G := t.Gnext + count := s.count + t.m + cost := s.cost + max t.L ((s.K : ℝ) ^ 2) * t.m + previousL := t.L } + +private def states : ℕ → State := + Nat.rec ⟨100, 1, 0, 0, 0⟩ (nextState height lower) + +private def choices (n : ℕ) : Step height lower n (states height lower n) := + chooseStep height lower n (states height lower n) + +def constructed : ProductScaleData where + m n := (choices height lower n).m + K n := (states height lower n).K + G n := (states height lower n).G + L n := (choices height lower n).L + C n := max (choices height lower n).L (((states height lower n).K : ℝ) ^ 2) + ε n := (choices height lower n).ε + +private theorem count_eq (n : ℕ) : (states height lower n).count = (constructed height lower).prefixCount n := by + induction n with + | zero => simp [states, ProductScaleData.prefixCount] + | succ n ih => + change (states height lower n).count + (choices height lower n).m = (constructed height lower).prefixCount (n + 1) + rw [ih] + simp [ProductScaleData.prefixCount, Finset.sum_range_succ, constructed] + +private theorem cost_eq (n : ℕ) : (states height lower n).cost = (constructed height lower).prefixCost n := by + induction n with + | zero => simp [states, ProductScaleData.prefixCost] + | succ n ih => + change (states height lower n).cost + max (choices height lower n).L (((states height lower n).K : ℝ) ^ 2) * + (choices height lower n).m = (constructed height lower).prefixCost (n + 1) + rw [ih] + simp [ProductScaleData.prefixCost, Finset.sum_range_succ, constructed] + +theorem constructed_laws : ProductScaleLaws (constructed height lower) := by + refine { + initial_K := rfl + initial_G := rfl + K_pos := ?_ + G_pos := ?_ + epsilon_pos := fun n => (choices height lower n).epsilon_pos + L_ge_one := fun n => (choices height lower n).L_one + L_monotone := ?_ + C_eq := fun _ => rfl + polynomial_lower := ?_ + polynomial_attenuation := fun n => (choices height lower n).attenuation + gain_attenuation := fun n => (choices height lower n).gain + m_ge_K := fun n => (choices height lower n).m_K + m_ge_pow := fun n => (choices height lower n).m_pow + m_ge_G := fun n => (choices height lower n).m_G + m_ge_100 := fun n => le_trans (by decide) (choices height lower n).m_large + prefix_count_le := ?_ + m_attenuation := fun n => (choices height lower n).attenuation_m + next_K := fun _ => rfl + next_gap := fun n => (choices height lower n).gap + K_double := fun n => (choices height lower n).double } + · intro n + induction n with + | zero => norm_num [constructed, states] + | succ n ih => + have h := (choices height lower n).double + change 0 < ⌈((choices height lower n).m : ℝ) ^ ((3 / 4 : ℝ) * (choices height lower n).m)⌉₊ + omega + · intro n + cases n with + | zero => norm_num [constructed, states] + | succ n => exact Nat.zero_lt_of_lt (choices height lower n).gain_one + · apply monotone_nat_of_le_succ + intro n + exact (choices height lower (n + 1)).L_previous + · intro n + unfold ProductScaleData.coefficientBound + rw [← cost_eq height lower n] + exact (choices height lower n).polynomial + · intro n + rw [← count_eq height lower n] + exact (choices height lower n).count_bound + +theorem constructed_height_bound (n : ℕ) : + (height (n + 1) : ℝ) / (constructed height lower).K (n + 1) ≤ + (1 / 2 : ℝ) ^ (n + 1) := + (choices height lower n).height_bound + +theorem constructed_m_ge_two_hundred (n : ℕ) : + 200 ≤ (constructed height lower).m n := + (choices height lower n).m_large + +theorem constructed_m_ge_lower (n : ℕ) : + lower n ≤ (constructed height lower).m n := + (choices height lower n).m_lower + +theorem constructed_summable_height : + Summable (fun n => (1 + (height n : ℝ)) / (constructed height lower).K n) := by + let p := constructed height lower + have hp : ProductScaleLaws p := constructed_laws height lower + apply InvariantProjection.GeometricTails.summable_one_add_height_div + hp.real_K_pos hp.real_K_double (fun n => Nat.cast_nonneg (height n)) + intro n + exact (constructed_height_bound height lower n).trans + (pow_le_pow_of_le_one (by norm_num : (0 : ℝ) ≤ 1 / 2) + (by norm_num : (1 / 2 : ℝ) ≤ 1) (Nat.le_succ n)) + +theorem exists_scales_with_heights : + ∃ p : ProductScaleData, ProductScaleLaws p ∧ + (∀ n, 200 ≤ p.m n) ∧ (∀ n, lower n ≤ p.m n) ∧ + (∀ n, (height (n + 1) : ℝ) / p.K (n + 1) ≤ (1 / 2 : ℝ) ^ (n + 1)) ∧ + Summable (fun n => (1 + (height n : ℝ)) / p.K n) := + ⟨constructed height lower, constructed_laws height lower, + constructed_m_ge_two_hundred height lower, + constructed_m_ge_lower height lower, + constructed_height_bound height lower, + constructed_summable_height height lower⟩ + +theorem exists_partitions_and_scales {θ : ℝ} (hθ : Irrational θ) + (lower : ℕ → ℕ) : + ∃ height : ℕ → ℕ, ∃ φ : ℕ → ℕ → C(AddCircle (1 : ℝ), ℝ), + ∃ p : ProductScaleData, + (∀ j n x, 0 ≤ φ j n x) ∧ + (∀ j x, ∑ n ∈ Finset.range (height j + 1), φ j n x = 1) ∧ + (∀ j, 1 ≤ j → ∀ n, ∀ x ∈ tsupport (φ j n), + dist (x + (((n : ℝ) * θ : ℝ) : AddCircle (1 : ℝ))) 0 < + 1 / (10 * (j : ℝ))) ∧ + (∀ j n, height j < n → φ j n = 0) ∧ + ProductScaleLaws p ∧ (∀ n, 200 ≤ p.m n) ∧ + (∀ n, lower n ≤ p.m n) ∧ + (∀ n, (height (n + 2) : ℝ) / p.K (n + 1) ≤ (1 / 2 : ℝ) ^ (n + 1)) ∧ + Summable (fun n => (1 + (height (n + 1) : ℝ)) / p.K n) := by + obtain ⟨height, φ, hnonneg, hsum, hsupport, hzero⟩ := + exists_preparatory_partitions hθ + obtain ⟨p, hp, hm, hlower, hheight, hsummable⟩ := + exists_scales_with_heights (fun n => height (n + 1)) lower + exact ⟨height, φ, p, hnonneg, hsum, hsupport, hzero, hp, hm, hlower, + hheight, hsummable⟩ + +end Invariant233.HeightScaleConstruction + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/IndividualLusin.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/IndividualLusin.lean new file mode 100644 index 0000000000000000000000000000000000000000..c63813ff6e058a34384396ffab0793ee235720b4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/IndividualLusin.lean @@ -0,0 +1,88 @@ +import Mathlib + +namespace OAI + +open Set MeasureTheory TopologicalSpace +open scoped ENNReal + +namespace Invariant233.Lusin + +variable {X : Type*} [TopologicalSpace X] [MeasurableSpace X] + [OpensMeasurableSpace X] [T2Space X] [CompactSpace X] + (μ : Measure X) [IsFiniteMeasure μ] [Measure.InnerRegularCompactLTTop μ] + +theorem exists_compact_clopen_restrictions (A : ℕ → Set X) + (hA : ∀ n, MeasurableSet (A n)) {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ K : Set X, IsCompact K ∧ μ Kᶜ < ε ∧ + ∀ n, ∃ U : Set X, IsOpen U ∧ A n ∩ K = U ∩ K := by + classical + obtain ⟨δ, hδpos, hδsum⟩ := ENNReal.exists_pos_sum_of_countable' hε (ℕ × Bool) + let E : ℕ × Bool → Set X := fun p => if p.2 then A p.1 else (A p.1)ᶜ + have hE : ∀ p, MeasurableSet (E p) := by + rintro ⟨n, b⟩ + cases b <;> simp only [E, Bool.false_eq_true, ↓reduceIte] <;> + first | exact hA n | exact (hA n).compl + have happrox : ∀ p : ℕ × Bool, ∃ C : Set X, + C ⊆ E p ∧ IsCompact C ∧ μ (E p \ C) < δ p := by + intro p + exact (hE p).exists_isCompact_sdiff_lt (measure_ne_top μ (E p)) (hδpos p).ne' + choose C hCsub hCcompact hCmeasure using happrox + let K : Set X := ⋂ n : ℕ, C (n, true) ∪ C (n, false) + have hKclosed : IsClosed K := + isClosed_iInter fun n => (hCcompact (n, true)).isClosed.union (hCcompact (n, false)).isClosed + have hKmem : ∀ {x : X}, x ∈ K → ∀ n, x ∈ C (n, true) ∪ C (n, false) := by + intro x hx n + exact mem_iInter.mp hx n + have hbad : Kᶜ ⊆ ⋃ p : ℕ × Bool, E p \ C p := by + intro x hx + have hn : ∃ n : ℕ, x ∉ C (n, true) ∪ C (n, false) := by + simpa only [K, mem_compl_iff, mem_iInter, not_forall] using hx + obtain ⟨n, hn⟩ := hn + by_cases ha : x ∈ A n + · apply mem_iUnion.mpr + refine ⟨(n, true), ?_, ?_⟩ + · simpa [E] using ha + · exact fun hc => hn (Or.inl hc) + · apply mem_iUnion.mpr + refine ⟨(n, false), ?_, ?_⟩ + · simpa [E] using ha + · exact fun hc => hn (Or.inr hc) + refine ⟨K, hKclosed.isCompact, ?_, ?_⟩ + · calc + μ Kᶜ ≤ μ (⋃ p : ℕ × Bool, E p \ C p) := measure_mono hbad + _ ≤ ∑' p : ℕ × Bool, μ (E p \ C p) := measure_iUnion_le _ + _ ≤ ∑' p : ℕ × Bool, δ p := ENNReal.tsum_le_tsum fun p => (hCmeasure p).le + _ < ε := hδsum + · intro n + refine ⟨(C (n, false))ᶜ, (hCcompact (n, false)).isClosed.isOpen_compl, ?_⟩ + ext x + constructor + · rintro ⟨ha, hk⟩ + refine ⟨?_, hk⟩ + intro hc + have : x ∈ (A n)ᶜ := by simpa [E] using hCsub (n, false) hc + exact this ha + · rintro ⟨hc, hk⟩ + refine ⟨?_, hk⟩ + rcases hKmem hk n with ht | hf + · simpa [E] using hCsub (n, true) ht + · exact False.elim (hc hf) + +theorem exists_compact_continuousOn {Y : Type*} [TopologicalSpace Y] + [MeasurableSpace Y] [OpensMeasurableSpace Y] [SecondCountableTopology Y] + {f : X → Y} (hf : Measurable f) {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ K : Set X, IsCompact K ∧ μ Kᶜ < ε ∧ ContinuousOn f K := by + obtain ⟨B, hB⟩ := TopologicalSpace.exists_seq_basis Y + have hA : ∀ n : ℕ, MeasurableSet (f ⁻¹' B n) := by + intro n + exact hf (hB.isOpen (mem_range_self n)).measurableSet + obtain ⟨K, hK, hμK, hrestr⟩ := + exists_compact_clopen_restrictions μ (fun n => f ⁻¹' B n) hA hε + refine ⟨K, hK, hμK, hB.continuousOn_iff.mpr ?_⟩ + intro U hU + obtain ⟨n, rfl⟩ := hU + exact hrestr n + +end Invariant233.Lusin + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/InfiniteRatioCaps.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/InfiniteRatioCaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9da697dabbb3f8d5ea32321da620d6ac9331292 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/InfiniteRatioCaps.lean @@ -0,0 +1,119 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CircleCocycle + +namespace OAI + +open Function +open scoped BigOperators + +namespace Invariant233.InfiniteRatioCaps + +private theorem summable_finset_mask {I : Type*} [DecidableEq I] (c : I → ℝ) (s : Finset I) : + Summable (fun i => if i ∈ s then c i else 0) := by + classical + apply summable_of_hasFiniteSupport + apply s.finite_toSet.subset + intro i hi + by_contra hn + change i ∉ s at hn + exact hi (by simp [hn]) + +private theorem tsum_finset_mask {I : Type*} [DecidableEq I] (c : I → ℝ) (s : Finset I) : + (∑' i, if i ∈ s then c i else 0) = ∑ i ∈ s, c i := by + classical + rw [tsum_eq_sum (s := s) (by intro i hi; simp [hi])] + exact Finset.sum_congr rfl (by intro i hi; simp [hi]) + +theorem ratio_le_exp_exception_sub_crossings {I : Type*} + (x y t c : I → ℝ) (a s : Finset I) + (hx01 : ∀ i, x i ∈ Set.Ico (0 : ℝ) 1) + (hy01 : ∀ i, y i ∈ Set.Ico (0 : ℝ) 1) + (hc : ∀ i, 0 ≤ c i) (hxy : ∀ i, i ∉ a → x i ≤ y i) + (hx : HasFiniteSupport (fun i => Int.floor (x i + t i))) + (hy : HasFiniteSupport (fun i => Int.floor (y i + t i))) + (hcross : ∀ i ∈ s, x i < 1 - Int.fract (t i) ∧ + 1 - Int.fract (t i) ≤ y i) : + Real.exp (-(∑' i, c i * (Int.floor (y i + t i) : ℝ))) / + Real.exp (-(∑' i, c i * (Int.floor (x i + t i) : ℝ))) ≤ + Real.exp ((∑ i ∈ a, c i) - ∑ i ∈ s, c i) := by + classical + have hsx := FiniteSupportCocycle.summable_weighted_int c hx + have hsy := FiniteSupportCocycle.summable_weighted_int c hy + have hbound (i : I) : + c i * (Int.floor (x i + t i) : ℝ) - c i * (Int.floor (y i + t i) : ℝ) ≤ + (if i ∈ a then c i else 0) - (if i ∈ s then c i else 0) := by + by_cases his : i ∈ s + · have hci := hcross i his + have horder : x i ≤ y i := hci.1.le.trans hci.2 + have hdiff : (Int.floor (y i + t i) : ℝ) - + (Int.floor (x i + t i) : ℝ) = 1 := by + exact_mod_cast (FloorCocycle.floor_sub_eq_one_iff + (hx01 i).1 (hx01 i).2 (hy01 i).1 (hy01 i).2 horder (t i)).mpr hci + simp only [ite_eq_left his] + by_cases hia : i ∈ a + · simp only [ite_eq_left hia] + nlinarith [hc i] + · simp only [ite_eq_right hia] + nlinarith [hc i] + · by_cases hia : i ∈ a + · have hdiff : (Int.floor (x i + t i) : ℝ) - + (Int.floor (y i + t i) : ℝ) ≤ 1 := by + exact_mod_cast (FloorCocycle.floor_sub_bounds + (hy01 i).1 (hy01 i).2 (hx01 i).1 (hx01 i).2 (t i)).2 + simp only [ite_eq_left hia, ite_eq_right his, sub_zero] + have := mul_le_mul_of_nonneg_left hdiff (hc i) + nlinarith + · have hfloor : (Int.floor (x i + t i) : ℝ) ≤ + (Int.floor (y i + t i) : ℝ) := by + apply Int.cast_le.mpr + apply Int.floor_mono + linarith [hxy i hia] + simp only [ite_eq_right hia, ite_eq_right his, sub_self] + exact sub_nonpos.mpr (mul_le_mul_of_nonneg_left hfloor (hc i)) + have hsum := (hsx.sub hsy).tsum_le_tsum hbound + ((summable_finset_mask c a).sub (summable_finset_mask c s)) + rw [hsx.tsum_sub hsy, (summable_finset_mask c a).tsum_sub + (summable_finset_mask c s), tsum_finset_mask, tsum_finset_mask] at hsum + rw [← Real.exp_sub] + apply Real.exp_le_exp.mpr + linarith + +end Invariant233.InfiniteRatioCaps + +namespace Invariant233.CircleWeights + +theorem cocycle_ratio_cap_with_crossings {ι : Type*} + (θ : ℝ) (q : ι → ℤ) (c : ι → ℝ) (k : ℤ) + (x y : UnitAddCircle) (a s : Finset ι) + (hc : ∀ i, 0 ≤ c i) + (hxy : ∀ i, i ∉ a → coordinate q i x ≤ coordinate q i y) + (hx : HasFiniteSupport (fun i => + Int.floor (coordinate q i x + (k : ℝ) * phase θ q i))) + (hy : HasFiniteSupport (fun i => + Int.floor (coordinate q i y + (k : ℝ) * phase θ q i))) + (hcross : ∀ i ∈ s, coordinate q i x < 1 - Int.fract ((k : ℝ) * phase θ q i) ∧ + 1 - Int.fract ((k : ℝ) * phase θ q i) ≤ coordinate q i y) : + cocycle θ q c k y / cocycle θ q c k x ≤ + Real.exp ((∑ i ∈ a, c i) - ∑ i ∈ s, c i) := by + exact InfiniteRatioCaps.ratio_le_exp_exception_sub_crossings + (fun i => coordinate q i x) (fun i => coordinate q i y) + (fun i => (k : ℝ) * phase θ q i) c a s + (fun i => coordinate_mem_Ico q i x) (fun i => coordinate_mem_Ico q i y) + hc hxy hx hy hcross + +theorem cocycle_ratio_cap_finite_exceptions {ι : Type*} + (θ : ℝ) (q : ι → ℤ) (c : ι → ℝ) (k : ℤ) + (x y : UnitAddCircle) (a : Finset ι) + (hc : ∀ i, 0 ≤ c i) + (hxy : ∀ i, i ∉ a → coordinate q i x ≤ coordinate q i y) + (hx : HasFiniteSupport (fun i => + Int.floor (coordinate q i x + (k : ℝ) * phase θ q i))) + (hy : HasFiniteSupport (fun i => + Int.floor (coordinate q i y + (k : ℝ) * phase θ q i))) : + cocycle θ q c k y / cocycle θ q c k x ≤ Real.exp (∑ i ∈ a, c i) := by + simpa only [Finset.sum_empty, sub_zero] using + cocycle_ratio_cap_with_crossings θ q c k x y a ∅ hc hxy hx hy + (by intro i hi; simp at hi) + +end Invariant233.CircleWeights + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/IntervalIndicatorTranslation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/IntervalIndicatorTranslation.lean new file mode 100644 index 0000000000000000000000000000000000000000..bc909f8510ac73c25053ef5e795494b09d0d5647 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/IntervalIndicatorTranslation.lean @@ -0,0 +1,152 @@ +import Mathlib + +namespace OAI + +open Set MeasureTheory + +namespace Invariant233.IntervalIndicatorTranslation + +theorem differing_membership_subset_strips {a b t η : ℝ} (hη : 0 ≤ η) + (ht : |t| ≤ η) : + {x : ℝ | x ∈ Ico 0 1 ∧ + ¬ (Int.fract (x - t) ∈ Icc a b ↔ x ∈ Icc a b)} ⊆ + Icc 0 η ∪ Icc (1 - η) 1 ∪ Icc (a - η) (a + η) ∪ Icc (b - η) (b + η) := by + intro x hx + by_contra hn + have ht' := abs_le.mp ht + have hx0 := hx.1.1 + have hx1 := hx.1.2 + have hn0 : x ∉ Icc 0 η := by exact fun h => hn (Or.inl (Or.inl (Or.inl h))) + have hn1 : x ∉ Icc (1 - η) 1 := by exact fun h => hn (Or.inl (Or.inl (Or.inr h))) + have hna : x ∉ Icc (a - η) (a + η) := by exact fun h => hn (Or.inl (Or.inr h)) + have hnb : x ∉ Icc (b - η) (b + η) := by exact fun h => hn (Or.inr h) + have hxη : η < x := by + by_contra h + exact hn0 ⟨hx0, le_of_not_gt h⟩ + have hxη' : x < 1 - η := by + by_contra h + exact hn1 ⟨le_of_not_gt h, hx1.le⟩ + have hfract : Int.fract (x - t) = x - t := by + apply Int.fract_eq_self.mpr + constructor <;> linarith + apply hx.2 + rw [hfract] + constructor + · intro hxt + constructor + · by_contra h + apply hna + constructor <;> linarith [hxt.1] + · by_contra h + apply hnb + constructor <;> linarith [hxt.2] + · intro hxI + constructor + · by_contra h + apply hna + constructor <;> linarith [hxI.1] + · by_contra h + apply hnb + constructor <;> linarith [hxI.2] + +theorem measure_differing_membership_le {a b t η : ℝ} (hη : 0 ≤ η) (ht : |t| ≤ η) : + volume.real {x : ℝ | x ∈ Ico 0 1 ∧ + ¬ (Int.fract (x - t) ∈ Icc a b ↔ x ∈ Icc a b)} ≤ 6 * η := by + have hfinite : volume (Icc (0 : ℝ) η ∪ Icc (1 - η) 1 ∪ + Icc (a - η) (a + η) ∪ Icc (b - η) (b + η)) ≠ ⊤ := + (((isCompact_Icc.union isCompact_Icc).union isCompact_Icc).union isCompact_Icc).measure_ne_top + calc + _ ≤ volume.real (Icc (0 : ℝ) η ∪ Icc (1 - η) 1 ∪ + Icc (a - η) (a + η) ∪ Icc (b - η) (b + η)) := + measureReal_mono (differing_membership_subset_strips hη ht) hfinite + _ ≤ (volume.real (Icc (0 : ℝ) η) + volume.real (Icc (1 - η) 1)) + + volume.real (Icc (a - η) (a + η)) + volume.real (Icc (b - η) (b + η)) := by + calc + _ ≤ volume.real (Icc (0 : ℝ) η ∪ Icc (1 - η) 1 ∪ Icc (a - η) (a + η)) + + volume.real (Icc (b - η) (b + η)) := measureReal_union_le _ _ + _ ≤ (volume.real (Icc (0 : ℝ) η ∪ Icc (1 - η) 1) + + volume.real (Icc (a - η) (a + η))) + volume.real (Icc (b - η) (b + η)) := + by + have h := measureReal_union_le (μ := volume) + (Icc (0 : ℝ) η ∪ Icc (1 - η) 1) (Icc (a - η) (a + η)) + linarith + _ ≤ _ := by + have h := measureReal_union_le (μ := volume) (Icc (0 : ℝ) η) (Icc (1 - η) 1) + linarith + _ = 6 * η := by + rw [Real.volume_real_Icc_of_le hη, + Real.volume_real_Icc_of_le (show 1 - η ≤ (1 : ℝ) by linarith), + Real.volume_real_Icc_of_le (show a - η ≤ a + η by linarith), + Real.volume_real_Icc_of_le (show b - η ≤ b + η by linarith)] + ring + +theorem integral_indicator_translation_le {a b t η : ℝ} (hη : 0 ≤ η) (ht : |t| ≤ η) : + (∫ x in (0 : ℝ)..1, + |(Icc a b).indicator (fun _ => (1 : ℝ)) (Int.fract (x - t)) - + (Icc a b).indicator (fun _ => (1 : ℝ)) (Int.fract x)|) ≤ 6 * η := by + classical + let s : Set ℝ := {x | ¬ (Int.fract (x - t) ∈ Icc a b ↔ x ∈ Icc a b)} + have hs : MeasurableSet s := by + apply MeasurableSet.compl + exact (measurableSet_Icc.preimage (measurable_fract.comp (measurable_id.sub_const t))).iff + measurableSet_Icc + have heq : (∫ x in (0 : ℝ)..1, + |(Icc a b).indicator (fun _ => (1 : ℝ)) (Int.fract (x - t)) - + (Icc a b).indicator (fun _ => (1 : ℝ)) (Int.fract x)|) = + ∫ x in (0 : ℝ)..1, s.indicator (fun _ => (1 : ℝ)) x := by + apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num) + intro x hx + dsimp only + rw [Int.fract_eq_self.mpr ⟨hx.1.le, hx.2⟩] + simp only [Set.indicator_apply, s, Set.mem_ofPred_eq] + by_cases h1 : Int.fract (x - t) ∈ Icc a b <;> + by_cases h2 : x ∈ Icc a b <;> simp [h1, h2] + rw [heq, intervalIntegral.integral_of_le (by norm_num), + ← integral_Ico_eq_integral_Ioc, integral_indicator_const 1 hs, measureReal_restrict_apply hs] + simp only [smul_eq_mul, mul_one] + have hset : s ∩ Ico 0 1 = {x : ℝ | x ∈ Ico 0 1 ∧ + ¬ (Int.fract (x - t) ∈ Icc a b ↔ x ∈ Icc a b)} := by + ext x + exact and_comm + rw [hset] + exact measure_differing_membership_le hη ht + +theorem circle_integral_indicator_translation_le {a b t η : ℝ} + (hη : 0 ≤ η) (ht : |t| ≤ η) : + (∫ x : UnitAddCircle, + |(Icc a b).indicator (fun _ => (1 : ℝ)) + (AddCircle.equivIco (1 : ℝ) 0 (x - (t : UnitAddCircle)) : ℝ) - + (Icc a b).indicator (fun _ => (1 : ℝ)) + (AddCircle.equivIco (1 : ℝ) 0 x : ℝ)|) ≤ 6 * η := by + have h := UnitAddCircle.intervalIntegral_preimage 0 (fun x : UnitAddCircle => + |(Icc a b).indicator (fun _ => (1 : ℝ)) + (AddCircle.equivIco (1 : ℝ) 0 (x - (t : UnitAddCircle)) : ℝ) - + (Icc a b).indicator (fun _ => (1 : ℝ)) + (AddCircle.equivIco (1 : ℝ) 0 x : ℝ)|) + rw [← h] + have heq (x : ℝ) : + (AddCircle.equivIco (1 : ℝ) 0 ((x : UnitAddCircle) - (t : UnitAddCircle)) : ℝ) = + Int.fract (x - t) := by + rw [← AddCircle.coe_sub] + simpa using AddCircle.coe_equivIco_mk_apply (p := (1 : ℝ)) (x - t) + have heq' (x : ℝ) : (AddCircle.equivIco (1 : ℝ) 0 (x : UnitAddCircle) : ℝ) = + Int.fract x := by + simp + simpa only [zero_add, heq, heq'] using integral_indicator_translation_le hη ht + +theorem circle_integral_indicator_translation_le_of_min {a b t η : ℝ} + (hη : 0 ≤ η) (ht : t ∈ Icc (0 : ℝ) 1) (hnear : min t (1 - t) ≤ η) : + (∫ x : UnitAddCircle, + |(Icc a b).indicator (fun _ => (1 : ℝ)) + (AddCircle.equivIco (1 : ℝ) 0 (x - (t : UnitAddCircle)) : ℝ) - + (Icc a b).indicator (fun _ => (1 : ℝ)) + (AddCircle.equivIco (1 : ℝ) 0 x : ℝ)|) ≤ 6 * η := by + rcases min_le_iff.mp hnear with hleft | hright + · exact circle_integral_indicator_translation_le hη (by rwa [abs_of_nonneg ht.1]) + · have h := circle_integral_indicator_translation_le (a := a) (b := b) hη + (t := t - 1) (by rwa [abs_of_nonpos (by linarith [ht.2]), neg_sub]) + simpa only [AddCircle.coe_sub, AddCircle.coe_period, sub_zero] using h + +end Invariant233.IntervalIndicatorTranslation + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/InvariantConull.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/InvariantConull.lean new file mode 100644 index 0000000000000000000000000000000000000000..f0fc4cef44a36466b27296dbb96124278c3cc1ad --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/InvariantConull.lean @@ -0,0 +1,124 @@ +import Mathlib + +namespace OAI + +open MeasureTheory Set Filter +open scoped ENNReal + +namespace Invariant233 + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem measurePreserving_equiv_zpow (σ : X ≃ᵐ X) + (hσ : MeasurePreserving σ μ μ) (n : ℤ) : + MeasurePreserving (σ.toEquiv ^ n) μ μ := by + cases n with + | ofNat n => + change MeasurePreserving (σ.toEquiv ^ (n : ℤ)) μ μ + simpa only [zpow_natCast, Equiv.Perm.coe_pow, MeasurableEquiv.coe_toEquiv] using + hσ.iterate n + | negSucc n => + rw [zpow_negSucc, ← inv_pow] + simpa only [Equiv.Perm.coe_pow, Equiv.Perm.inv_def, + MeasurableEquiv.coe_toEquiv_symm] using + (hσ.symm σ).iterate (n + 1) + +theorem ae_forall_equiv_zpow (σ : X ≃ᵐ X) (hσ : MeasurePreserving σ μ μ) + {P : X → Prop} (hP : ∀ᵐ x ∂μ, P x) : + ∀ᵐ x ∂μ, ∀ n : ℤ, P ((σ.toEquiv ^ n) x) := by + exact ae_all_iff.mpr fun n => + (measurePreserving_equiv_zpow σ hσ n).quasiMeasurePreserving.ae hP + +theorem exists_invariant_conull_subset_equiv (σ : X ≃ᵐ X) + (hσ : MeasurePreserving σ μ μ) {s : Set X} (hs : MeasurableSet s) + (hae : ∀ᵐ x ∂μ, x ∈ s) : + ∃ t : Set X, MeasurableSet t ∧ t ⊆ s ∧ μ tᶜ = 0 ∧ + ∀ n : ℤ, (σ.toEquiv ^ n) ⁻¹' t = t := by + let t : Set X := ⋂ n : ℤ, (σ.toEquiv ^ n) ⁻¹' s + have htm : MeasurableSet t := MeasurableSet.iInter fun n => + hs.preimage (measurePreserving_equiv_zpow σ hσ n).measurable + have ht : ∀ᵐ x ∂μ, x ∈ t := by + simpa only [t, mem_iInter, mem_preimage] using ae_forall_equiv_zpow σ hσ hae + refine ⟨t, htm, ?_, ?_, ?_⟩ + · intro x hx + have hx0 := Set.mem_iInter.mp hx 0 + simpa only [mem_preimage, zpow_zero, Equiv.Perm.one_apply] using hx0 + · exact mem_ae_iff.mp ht + · intro n + ext x + simp only [t, mem_preimage, mem_iInter] + constructor + · intro hx k + have h := hx (k - n) + simpa only [← Equiv.Perm.mul_apply, ← zpow_add, sub_add_cancel] using h + · intro hx k + simpa only [← Equiv.Perm.mul_apply, ← zpow_add] using hx (k + n) + +theorem exists_invariant_exponential_coboundary_domain (σ : X ≃ᵐ X) + (hσ : MeasurePreserving σ μ μ) (g gstar b : X → ℝ) + (hg : Measurable g) (hgs : Measurable gstar) (hb : Measurable b) + (heq : g =ᵐ[μ] fun x => gstar x + 1 + b (σ x) - b x) : + ∃ s : Set X, MeasurableSet s ∧ μ sᶜ = 0 ∧ + (∀ n : ℤ, (σ.toEquiv ^ n) ⁻¹' s = s) ∧ + ∀ x ∈ s, ∀ k : ℤ, + Real.exp (b ((σ.toEquiv ^ (k + 1)) x)) * + Real.exp (-g ((σ.toEquiv ^ k) x)) = + Real.exp (-1) * Real.exp (-gstar ((σ.toEquiv ^ k) x)) * + Real.exp (b ((σ.toEquiv ^ k) x)) := by + have hmeas : MeasurableSet {x | g x = gstar x + 1 + b (σ x) - b x} := + measurableSet_eq_fun hg (((hgs.add_const 1).add (hb.comp σ.measurable)).sub hb) + obtain ⟨s, hsm, hsub, hnull, hinv⟩ := exists_invariant_conull_subset_equiv σ hσ hmeas heq + refine ⟨s, hsm, hnull, hinv, ?_⟩ + intro x hx k + have hxk : (σ.toEquiv ^ k) x ∈ s := by + change x ∈ (σ.toEquiv ^ k) ⁻¹' s + rwa [hinv k] + have hrel := hsub hxk + have hnext : (σ.toEquiv ^ (k + 1)) x = σ ((σ.toEquiv ^ k) x) := by + rw [show k + 1 = 1 + k by omega, zpow_add, zpow_one, Equiv.Perm.mul_apply] + rfl + rw [hnext, ← Real.exp_add, ← Real.exp_add, ← Real.exp_add] + congr 1 + change g ((σ.toEquiv ^ k) x) = + gstar ((σ.toEquiv ^ k) x) + 1 + b (σ ((σ.toEquiv ^ k) x)) - + b ((σ.toEquiv ^ k) x) at hrel + linarith + +theorem exists_invariant_weight_coboundary_domain (σ : X ≃ᵐ X) + (hσ : MeasurePreserving σ μ μ) (g gstar b f fstar : X → ℝ) + (hg : Measurable g) (hgs : Measurable gstar) (hb : Measurable b) + (hmf : Measurable f) (hmfs : Measurable fstar) + (heq : g =ᵐ[μ] fun x => gstar x + 1 + b (σ x) - b x) + (hf : f =ᵐ[μ] fun x => Real.exp (-g x)) + (hfs : fstar =ᵐ[μ] fun x => Real.exp (-gstar x)) : + ∃ s : Set X, MeasurableSet s ∧ μ sᶜ = 0 ∧ + (∀ n : ℤ, (σ.toEquiv ^ n) ⁻¹' s = s) ∧ + ∀ x ∈ s, ∀ k : ℤ, + Real.exp (b ((σ.toEquiv ^ (k + 1)) x)) * f ((σ.toEquiv ^ k) x) = + Real.exp (-1) * fstar ((σ.toEquiv ^ k) x) * + Real.exp (b ((σ.toEquiv ^ k) x)) := by + obtain ⟨s₀, hs₀, hn₀, hi₀, hscalar⟩ := + exists_invariant_exponential_coboundary_domain σ hσ g gstar b hg hgs hb heq + have hm : MeasurableSet {x | f x = Real.exp (-g x) ∧ + fstar x = Real.exp (-gstar x)} := + (measurableSet_eq_fun hmf (Real.continuous_exp.measurable.comp hg.neg)).inter + (measurableSet_eq_fun hmfs (Real.continuous_exp.measurable.comp hgs.neg)) + obtain ⟨t, htm, hsub, htn, hti⟩ := + exists_invariant_conull_subset_equiv σ hσ hm (hf.and hfs) + refine ⟨s₀ ∩ t, hs₀.inter htm, ?_, ?_, ?_⟩ + · rw [Set.compl_inter] + exact measure_union_null hn₀ htn + · intro n + rw [Set.preimage_inter, hi₀ n, hti n] + · intro x hx k + have hxk : (σ.toEquiv ^ k) x ∈ t := by + change x ∈ (σ.toEquiv ^ k) ⁻¹' t + rw [hti k] + exact hx.2 + obtain ⟨hfx, hfsx⟩ := hsub hxk + rw [hfx, hfsx] + exact hscalar x hx.1 k + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/InvariantConullCore.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/InvariantConullCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..df68a6965209cd21ae6c2ae4489584561315aaab --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/InvariantConullCore.lean @@ -0,0 +1,85 @@ +import Mathlib.Dynamics.Ergodic.MeasurePreserving +import Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving + +namespace OAI + +open MeasureTheory Set + +namespace Invariant233 + +theorem exists_invariant_conull_subset + {X : Type*} [MeasurableSpace X] {μ : Measure X} + (σ : ℤ → X → X) + (hzero : ∀ x, σ 0 x = x) + (hadd : ∀ k n x, σ (k + n) x = σ n (σ k x)) + (hmp : ∀ k, MeasurePreserving (σ k) μ μ) + {s : Set X} (hs : MeasurableSet s) (hfull : ∀ᵐ x ∂μ, x ∈ s) : + ∃ t : Set X, MeasurableSet t ∧ t ⊆ s ∧ + (∀ᵐ x ∂μ, x ∈ t) ∧ ∀ k, σ k ⁻¹' t = t := by + let t : Set X := ⋂ k : ℤ, σ k ⁻¹' s + have ht_mem : ∀ x, x ∈ t ↔ ∀ k, σ k x ∈ s := by + intro x + simp only [t, mem_iInter, mem_preimage] + refine ⟨t, MeasurableSet.iInter (fun k ↦ hs.preimage (hmp k).measurable), ?_, ?_, ?_⟩ + · intro x hx + simpa only [hzero] using (ht_mem x).mp hx 0 + · have h : ∀ᵐ x ∂μ, ∀ k : ℤ, σ k x ∈ s := + ae_all_iff.mpr (fun k ↦ (hmp k).quasiMeasurePreserving.ae hfull) + exact h.mono fun x hx ↦ (ht_mem x).mpr hx + · intro k + ext x + change σ k x ∈ t ↔ x ∈ t + rw [ht_mem, ht_mem] + constructor + · intro hx n + have h := hx (n - k) + rw [← hadd] at h + rw [← add_sub_assoc, add_comm k n, add_sub_cancel_right] at h + exact h + · intro hx n + rw [← hadd] + exact hx (k + n) + +theorem exists_invariant_conull_property + {X : Type*} [MeasurableSpace X] {μ : Measure X} + (σ : ℤ → X → X) + (hzero : ∀ x, σ 0 x = x) + (hadd : ∀ k n x, σ (k + n) x = σ n (σ k x)) + (hmp : ∀ k, MeasurePreserving (σ k) μ μ) + (P : X → Prop) (hP : ∀ᵐ x ∂μ, P x) : + ∃ t : Set X, MeasurableSet t ∧ (∀ᵐ x ∂μ, x ∈ t) ∧ + (∀ x ∈ t, P x) ∧ ∀ k, σ k ⁻¹' t = t := by + obtain ⟨u, hsub, hu, hnull⟩ := + exists_measurable_superset_of_null (ae_iff.mp hP) + have hfull : ∀ᵐ x ∂μ, x ∈ uᶜ := by + rw [ae_iff] + simpa using hnull + obtain ⟨t, ht, htu, htf, hinv⟩ := + exists_invariant_conull_subset σ hzero hadd hmp hu.compl hfull + refine ⟨t, ht, htf, ?_, hinv⟩ + intro x hx + by_contra hbad + exact htu hx (hsub hbad) + +theorem exists_invariant_conull_forall + {X I : Type*} [MeasurableSpace X] [Countable I] {μ : Measure X} + (σ : ℤ → X → X) + (hzero : ∀ x, σ 0 x = x) + (hadd : ∀ k n x, σ (k + n) x = σ n (σ k x)) + (hmp : ∀ k, MeasurePreserving (σ k) μ μ) + (P : I → X → Prop) (hP : ∀ i, ∀ᵐ x ∂μ, P i x) : + ∃ t : Set X, MeasurableSet t ∧ (∀ᵐ x ∂μ, x ∈ t) ∧ + (∀ x ∈ t, ∀ k i, P i (σ k x)) ∧ ∀ k, σ k ⁻¹' t = t := by + obtain ⟨t, ht, htf, hprop, hinv⟩ := + exists_invariant_conull_property σ hzero hadd hmp + (fun x ↦ ∀ i, P i x) (ae_all_iff.mpr hP) + refine ⟨t, ht, htf, ?_, hinv⟩ + intro x hx k i + apply hprop (σ k x) _ i + change x ∈ σ k ⁻¹' t + rw [hinv] + exact hx + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/InverseSelfAdjoint.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/InverseSelfAdjoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..83088bbc78e3867c57fca2cfd3fe025c3381a925 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/InverseSelfAdjoint.lean @@ -0,0 +1,112 @@ +import OAI.Analysis.IrrationalRotation.Model.NormalAffiliation +import Mathlib.Analysis.InnerProductSpace.Projection.Submodule + +namespace OAI + +noncomputable section + +namespace Invariant233 + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + +theorem inverse_graph_mem_iff {H : E →ₗ.[ℂ] E} + (hinj : Function.Injective H) {x y : E} : + (x, y) ∈ H.inverse.graph ↔ (y, x) ∈ H.graph := by + rw [LinearPMap.inverse_graph (LinearPMap.ker_eq_bot.mpr hinj)] + simp only [Submodule.map_equiv_eq_comap_symm, Submodule.mem_comap, + LinearEquiv.symm_prodComm, LinearEquiv.coe_coe, LinearEquiv.prodComm_apply, + Prod.swap_prod_mk] + +theorem injective_inverse {H : E →ₗ.[ℂ] E} (hinj : Function.Injective H) : + Function.Injective H.inverse := by + intro y z hyz + apply Subtype.ext + exact H.mem_graph_snd_inj + ((inverse_graph_mem_iff hinj).mp (H.inverse.mem_graph y)) + ((inverse_graph_mem_iff hinj).mp (H.inverse.mem_graph z)) hyz + +theorem inverse_inverse {H : E →ₗ.[ℂ] E} (hinj : Function.Injective H) : + H.inverse.inverse = H := by + apply LinearPMap.eq_of_eq_graph + ext z + rcases z with ⟨x, y⟩ + rw [inverse_graph_mem_iff (injective_inverse hinj), inverse_graph_mem_iff hinj] + +variable [CompleteSpace E] + +theorem dense_range_of_selfAdjoint_injective {H : E →ₗ.[ℂ] E} + (hH : IsSelfAdjoint H) (hinj : Function.Injective H) : + Dense (H.toFun.range : Set E) := by + rw [Submodule.dense_iff_topologicalClosure_eq_top, + Submodule.topologicalClosure_eq_top_iff, Submodule.eq_bot_iff] + intro y hy + have hinner : ∀ x : H.domain, inner ℂ y (H x) = 0 := by + intro x + exact (H.toFun.range.mem_orthogonal' y).mp hy (H x) ⟨x, rfl⟩ + have hyD : y ∈ H.adjoint.domain := + LinearPMap.mem_adjoint_domain_of_exists y ⟨0, by + intro x + simp only [inner_zero_left, hinner x]⟩ + have hyA : H.adjoint ⟨y, hyD⟩ = 0 := + LinearPMap.adjoint_apply_eq hH.dense_domain _ (by + intro x + simp only [inner_zero_left, hinner x]) + have hyG : (y, 0) ∈ H.graph := by + rw [← LinearPMap.isSelfAdjoint_def.mp hH] + exact H.adjoint.mem_graph_iff.mpr ⟨⟨y, hyD⟩, rfl, hyA⟩ + obtain ⟨x, hxy, hx0⟩ := H.mem_graph_iff.mp hyG + have hx : x = 0 := hinj (hx0.trans H.toFun.map_zero.symm) + exact hxy.symm.trans (congrArg Subtype.val hx) + +theorem dense_domain_inverse_of_selfAdjoint_injective {H : E →ₗ.[ℂ] E} + (hH : IsSelfAdjoint H) (hinj : Function.Injective H) : + Dense (H.inverse.domain : Set E) := by + rw [LinearPMap.inverse_domain] + exact dense_range_of_selfAdjoint_injective hH hinj + +theorem selfAdjoint_inverse_of_injective {H : E →ₗ.[ℂ] E} + (hH : IsSelfAdjoint H) (hinj : Function.Injective H) : + IsSelfAdjoint H.inverse := by + rw [LinearPMap.isSelfAdjoint_def] + apply LinearPMap.eq_of_eq_graph + rw [LinearPMap.adjoint_graph_eq_graph_adjoint + (dense_domain_inverse_of_selfAdjoint_injective hH hinj)] + ext z + rw [Submodule.mem_adjoint_iff] + constructor + · intro hz + have hswap : (z.2, z.1) ∈ H.adjoint.graph := by + rw [LinearPMap.adjoint_graph_eq_graph_adjoint hH.dense_domain, + Submodule.mem_adjoint_iff] + intro a b hab + have h := hz b a ((inverse_graph_mem_iff hinj).mpr hab) + exact sub_eq_zero.mpr (sub_eq_zero.mp h).symm + rw [LinearPMap.isSelfAdjoint_def.mp hH] at hswap + exact (inverse_graph_mem_iff hinj).mpr hswap + · intro hz a b hab + have hswap := (inverse_graph_mem_iff hinj).mp hz + rw [← LinearPMap.isSelfAdjoint_def.mp hH, + LinearPMap.adjoint_graph_eq_graph_adjoint hH.dense_domain, + Submodule.mem_adjoint_iff] at hswap + have h := hswap b a ((inverse_graph_mem_iff hinj).mp hab) + exact sub_eq_zero.mpr (sub_eq_zero.mp h).symm + +omit [CompleteSpace E] in +theorem IsPositivePartial.inverse {H : E →ₗ.[ℂ] E} + (hpos : IsPositivePartial H) (hinj : Function.Injective H) : + IsPositivePartial H.inverse := by + intro y + have hy : (y : E) ∈ H.toFun.range := by + simpa only [LinearPMap.inverse_domain] using y.property + obtain ⟨x, hx⟩ := hy + have hxy : H x = (y : E) := hx + rw [LinearPMap.inverse_apply_eq (LinearPMap.ker_eq_bot.mpr hinj) hxy, ← hxy] + change 0 ≤ RCLike.re (inner ℂ (H x) (x : E)) + rw [inner_re_symm] + exact hpos x + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/L2UniformAbsoluteContinuity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/L2UniformAbsoluteContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..2195ceef42348c88b88d079630b31d5fd9e15388 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/L2UniformAbsoluteContinuity.lean @@ -0,0 +1,77 @@ +import OAI.Analysis.IrrationalRotation.Model.CompactTransfer +import OAI.Analysis.IrrationalRotation.Analysis.EndpointLoss + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal + +namespace Invariant233.EndpointLoss + +variable {X ι : Type*} [MeasurableSpace X] + +theorem uniformlyAbsolutelyContinuous_of_uniform_sqrt_bound + (μ : Measure X) [IsFiniteMeasure μ] (ν : ι → Measure X) + (hfinite : ∀ i, IsFiniteMeasure (ν i)) (H : ℝ) + (hbound : ∀ i A, MeasurableSet A → (ν i).real A ≤ H * Real.sqrt (μ.real A)) : + UniformlyAbsolutelyContinuous μ ν := by + intro ε hε + have he : 0 < (ε : ℝ) := by exact_mod_cast hε + have hB : 0 < |H| + 1 := by positivity + have hd : 0 < (ε : ℝ) / (|H| + 1) := div_pos he hB + refine ⟨⟨((ε : ℝ) / (|H| + 1)) ^ 2, sq_nonneg _⟩, ?_, ?_⟩ + · change 0 < ((ε : ℝ) / (|H| + 1)) ^ 2 + positivity + · intro A hA hsmall i + let := hfinite i + have hreal : μ.real A < ((ε : ℝ) / (|H| + 1)) ^ 2 := by + exact (ENNReal.toReal_lt_toReal (measure_ne_top μ A) ENNReal.coe_ne_top).2 hsmall + have hsqrt : Real.sqrt (μ.real A) < (ε : ℝ) / (|H| + 1) := by + have ht := Real.sqrt_lt_sqrt (measureReal_nonneg) hreal + simpa only [Real.sqrt_sq hd.le] using ht + have hH : H ≤ |H| + 1 := by linarith [le_abs_self H] + have hν : (ν i).real A < (ε : ℝ) := calc + (ν i).real A ≤ H * Real.sqrt (μ.real A) := hbound i A hA + _ ≤ (|H| + 1) * Real.sqrt (μ.real A) := + mul_le_mul_of_nonneg_right hH (Real.sqrt_nonneg _) + _ < (|H| + 1) * ((ε : ℝ) / (|H| + 1)) := + mul_lt_mul_of_pos_left hsqrt hB + _ = (ε : ℝ) := mul_div_cancel₀ _ hB.ne' + exact (ENNReal.toReal_lt_toReal (measure_ne_top (ν i) A) ENNReal.coe_ne_top).1 hν + +theorem uniformlyAbsolutelyContinuous_withDensity + (μ : Measure X) [IsFiniteMeasure μ] (h : ι → X → ℝ) + (hh : ∀ i, MemLp (h i) 2 μ) (hn : ∀ i, 0 ≤ᵐ[μ] h i) (H : ℝ) + (hb : ∀ i, Real.sqrt (∫ x, h i x ^ 2 ∂μ) ≤ H) : + UniformlyAbsolutelyContinuous μ + (fun i => μ.withDensity (fun x => ENNReal.ofReal (h i x))) := by + have hfin : ∀ i, IsFiniteMeasure (μ.withDensity (fun x => ENNReal.ofReal (h i x))) := + fun i => isFiniteMeasure_withDensity_ofReal ((hh i).integrable (by norm_num)).2 + apply uniformlyAbsolutelyContinuous_of_uniform_sqrt_bound μ _ hfin H + intro i A hA + exact (withDensity_measureReal_le_sqrt μ (hh i) (hn i) hA).trans + (mul_le_mul_of_nonneg_right (hb i) (Real.sqrt_nonneg _)) + +theorem uniformlyAbsolutelyContinuous_Lp_withDensity + (μ : Measure X) [IsFiniteMeasure μ] (f : ι → Lp ℝ 2 μ) + (hn : ∀ i, 0 ≤ᵐ[μ] (f i : X → ℝ)) (H : ℝ) (hb : ∀ i, ‖f i‖ ≤ H) : + UniformlyAbsolutelyContinuous μ + (fun i => μ.withDensity (fun x => ENNReal.ofReal (f i x))) := by + apply uniformlyAbsolutelyContinuous_withDensity μ (fun i => f i) (fun i => Lp.memLp (f i)) hn H + intro i + simpa only [sqrt_integral_sq_eq_norm] using hb i + +theorem uniformlyAbsolutelyContinuous_of_Lp_densities + (μ : Measure X) [IsFiniteMeasure μ] (ν : ι → Measure X) (H : ℝ) + (hν : ∀ i, ∃ f : Lp ℝ 2 μ, (0 ≤ᵐ[μ] (f : X → ℝ)) ∧ + ν i = μ.withDensity (fun x => ENNReal.ofReal (f x)) ∧ ‖f‖ ≤ H) : + UniformlyAbsolutelyContinuous μ ν := by + choose f hn heq hb using hν + have hfun : ν = fun i => μ.withDensity (fun x => ENNReal.ofReal (f i x)) := + funext heq + rw [hfun] + exact uniformlyAbsolutelyContinuous_Lp_withDensity μ f hn H hb + +end Invariant233.EndpointLoss + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/LaurentNoncancellation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/LaurentNoncancellation.lean new file mode 100644 index 0000000000000000000000000000000000000000..5bad90ffbb340080f8b5c69395ffa22a60b2b427 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/LaurentNoncancellation.lean @@ -0,0 +1,210 @@ +import OAI.Analysis.IrrationalRotation.Analysis.LaurentWindow +import OAI.Analysis.IrrationalRotation.Analysis.FiniteConvolution +import OAI.Analysis.IrrationalRotation.Model.LaurentConvolution + +namespace OAI + +noncomputable section + +namespace Invariant233.LaurentWindow + +open InvariantProjection.FiniteConvolution + +theorem laurent_lower_bound_of_finite_bound (K : ℕ) (D δ ε : ℝ) + (hbound : ∀ a b : Coefficients K, + (∀ i, ‖a i‖ ≤ D) → (∀ i, ‖b i‖ ≤ D) → + δ ≤ ‖a (center K)‖ → δ ≤ ‖b (center K)‖ → + ∃ n : Fin (2 * K + 1), ε ≤ ‖lowProduct a b n‖) : + ∀ A B : LaurentPolynomial ℂ, + (∀ i : ℤ, i < -(K : ℤ) ∨ (K : ℤ) < i → A.coeff i = 0) → + (∀ i : ℤ, i < -(K : ℤ) ∨ (K : ℤ) < i → B.coeff i = 0) → + (∀ i : ℤ, ‖A.coeff i‖ ≤ D) → + (∀ i : ℤ, ‖B.coeff i‖ ≤ D) → + δ ≤ ‖A.coeff 0‖ → δ ≤ ‖B.coeff 0‖ → + ∃ n : ℕ, n ≤ 2 * K ∧ ε ≤ ‖(A * B).coeff (-(n : ℤ))‖ := by + intro A B hAs hBs hA hB hA0 hB0 + let a : Coefficients K := fun i => A.coeff ((i : ℤ) - (K : ℤ)) + let b : Coefficients K := fun i => B.coeff ((i : ℤ) - (K : ℤ)) + have ha0 : δ ≤ ‖a (center K)‖ := by simpa [a, center] using hA0 + have hb0 : δ ≤ ‖b (center K)‖ := by simpa [b, center] using hB0 + obtain ⟨n, hn⟩ := hbound a b (fun i => hA _) (fun i => hB _) ha0 hb0 + have hpa : polynomial a = LaurentPolynomial.trunc + (A * LaurentPolynomial.T (K : ℤ)) := + (trunc_shift_eq_fin_sum K A (fun i hi => hAs i (Or.inr hi))).symm + have hpb : polynomial b = LaurentPolynomial.trunc + (B * LaurentPolynomial.T (K : ℤ)) := + (trunc_shift_eq_fin_sum K B (fun i hi => hBs i (Or.inr hi))).symm + have hc : lowProduct a b n = (A * B).coeff ((n : ℤ) - 2 * (K : ℤ)) := by + unfold lowProduct + rw [hpa, hpb] + exact coeff_shifted_product K (n : ℕ) A B + (fun i hi => hAs i (Or.inl hi)) (fun i hi => hBs i (Or.inl hi)) + refine ⟨2 * K - (n : ℕ), Nat.sub_le _ _, ?_⟩ + have he : -((2 * K - (n : ℕ) : ℕ) : ℤ) = (n : ℤ) - 2 * (K : ℤ) := by + have := n.isLt + omega + rw [he, ← hc] + exact hn + +theorem uniform_laurent_lower_bound (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) : + ∃ ε > 0, ∀ A B : LaurentPolynomial ℂ, + (∀ i : ℤ, i < -(K : ℤ) ∨ (K : ℤ) < i → A.coeff i = 0) → + (∀ i : ℤ, i < -(K : ℤ) ∨ (K : ℤ) < i → B.coeff i = 0) → + (∀ i : ℤ, ‖A.coeff i‖ ≤ D) → + (∀ i : ℤ, ‖B.coeff i‖ ≤ D) → + δ ≤ ‖A.coeff 0‖ → δ ≤ ‖B.coeff 0‖ → + ∃ n : ℕ, n ≤ 2 * K ∧ ε ≤ ‖(A * B).coeff (-(n : ℤ))‖ := by + obtain ⟨ε, hε, hbound⟩ := uniform_lower_bound K D δ hδ + exact ⟨ε, hε, laurent_lower_bound_of_finite_bound K D δ ε hbound⟩ + +end Invariant233.LaurentWindow + +namespace Invariant233.FiniteWindow + +open Invariant233.LaurentWindow +open InvariantProjection.FiniteConvolution + +@[simp] theorem laurent_coeff (K : ℕ) (a : ℤ → ℂ) (i : ℤ) : + (laurent K a).coeff i = if |i| ≤ (K : ℤ) then a i else 0 := by + rw [laurent, coeff_window_sum] + simp only [Finset.mem_Icc, abs_le] + +@[simp] theorem laurent_coeff_zero (K : ℕ) (a : ℤ → ℂ) : + (laurent K a).coeff 0 = a 0 := by + simp only [laurent_coeff, abs_zero, Int.natCast_nonneg, ite_true] + +theorem coeff_laurent_product (K : ℕ) (a b : ℤ → ℂ) (n : ℕ) : + (laurent K a * laurent K b).coeff (-(n : ℤ)) = convolution K a b n := + coeff_symmetric_window_product K a b (n : ℤ) + +theorem convolution_lower_bound_of_finite_bound (K : ℕ) (D δ ε : ℝ) + (hfinite : ∀ a b : Coefficients K, + (∀ i, ‖a i‖ ≤ D) → (∀ i, ‖b i‖ ≤ D) → + δ ≤ ‖a (center K)‖ → δ ≤ ‖b (center K)‖ → + ∃ n : Fin (2 * K + 1), ε ≤ ‖lowProduct a b n‖) : + ∀ a b : ℤ → ℂ, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a i‖ ≤ D) → + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b i‖ ≤ D) → + δ ≤ ‖a 0‖ → δ ≤ ‖b 0‖ → + ∃ n : ℕ, n ≤ 2 * K ∧ ε ≤ ‖convolution K a b n‖ := by + have hbound := laurent_lower_bound_of_finite_bound K D δ ε hfinite + intro a b ha hb ha0 hb0 + have hD : 0 ≤ D := (norm_nonneg (a 0)).trans (ha 0 (by simp)) + have support_zero : ∀ c : ℤ → ℂ, ∀ i : ℤ, + i < -(K : ℤ) ∨ (K : ℤ) < i → (laurent K c).coeff i = 0 := by + intro c i hi + rw [laurent_coeff, ite_eq_right] + simp only [abs_le] + omega + have coeff_bound : ∀ c : ℤ → ℂ, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖c i‖ ≤ D) → + ∀ i : ℤ, ‖(laurent K c).coeff i‖ ≤ D := by + intro c hc i + rw [laurent_coeff] + split_ifs with hi + · exact hc i hi + · simpa only [norm_zero] using hD + obtain ⟨n, hn, hnc⟩ := hbound (laurent K a) (laurent K b) + (support_zero a) (support_zero b) (coeff_bound a ha) (coeff_bound b hb) + (by simpa only [laurent_coeff_zero] using ha0) + (by simpa only [laurent_coeff_zero] using hb0) + exact ⟨n, hn, by simpa only [coeff_laurent_product] using hnc⟩ + +theorem convolution_sum_lower_bound_of_finite_bound (K : ℕ) (D δ ε : ℝ) + (hfinite : ∀ a b : Coefficients K, + (∀ i, ‖a i‖ ≤ D) → (∀ i, ‖b i‖ ≤ D) → + δ ≤ ‖a (center K)‖ → δ ≤ ‖b (center K)‖ → + ∃ n : Fin (2 * K + 1), ε ≤ ‖lowProduct a b n‖) : + ∀ a b : ℤ → ℂ, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a i‖ ≤ D) → + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b i‖ ≤ D) → + δ ≤ ‖a 0‖ → δ ≤ ‖b 0‖ → + ε ≤ ∑ n ∈ Finset.range (2 * K + 1), ‖convolution K a b n‖ := by + intro a b ha hb ha0 hb0 + obtain ⟨n, hn, hnc⟩ := + convolution_lower_bound_of_finite_bound K D δ ε hfinite a b ha hb ha0 hb0 + exact hnc.trans (Finset.single_le_sum (fun k hk => norm_nonneg _) + (Finset.mem_range.mpr (by omega))) + +theorem uniform_convolution_lower_bound (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) : + ∃ ε > 0, ∀ a b : ℤ → ℂ, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a i‖ ≤ D) → + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b i‖ ≤ D) → + δ ≤ ‖a 0‖ → δ ≤ ‖b 0‖ → + ∃ n : ℕ, n ≤ 2 * K ∧ ε ≤ ‖convolution K a b n‖ := by + obtain ⟨ε, hε, hbound⟩ := uniform_lower_bound K D δ hδ + exact ⟨ε, hε, convolution_lower_bound_of_finite_bound K D δ ε hbound⟩ + +theorem uniform_convolution_sum_lower_bound (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) : + ∃ ε > 0, ∀ a b : ℤ → ℂ, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a i‖ ≤ D) → + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b i‖ ≤ D) → + δ ≤ ‖a 0‖ → δ ≤ ‖b 0‖ → + ε ≤ ∑ n ∈ Finset.range (2 * K + 1), ‖convolution K a b n‖ := by + obtain ⟨ε, hε, hbound⟩ := uniform_convolution_lower_bound K D δ hδ + refine ⟨ε, hε, ?_⟩ + intro a b ha hb ha0 hb0 + obtain ⟨n, hn, hnc⟩ := hbound a b ha hb ha0 hb0 + exact hnc.trans (Finset.single_le_sum (fun k hk => norm_nonneg _) + (Finset.mem_range.mpr (by omega))) + +theorem support_laurent_coeff_subset (K : ℕ) (a : ℤ → ℂ) : + Function.support (laurent K a).coeff ⊆ Set.Icc (-(K : ℤ)) (K : ℤ) := by + intro i hi + have hne := Function.mem_support.mp hi + by_contra h + have habs : ¬ |i| ≤ (K : ℤ) := by simpa only [abs_le, Set.mem_Icc] using h + exact hne (by simp only [laurent_coeff, ite_eq_right habs]) + +theorem sum_laurent_coeff_eq_convolution (K : ℕ) (a b : ℤ → ℂ) (n : ℕ) : + (∑ v ∈ Finset.Icc (-(K : ℤ)) (K : ℤ), + (laurent K a).coeff v * (laurent K b).coeff (-(n : ℤ) - v)) = + convolution K a b n := by + classical + unfold convolution + rw [Finset.sum_filter] + apply Finset.sum_congr rfl + intro v hv + have hvabs : |v| ≤ (K : ℤ) := abs_le.mpr (Finset.mem_Icc.mp hv) + have hneg : |-(n : ℤ) - v| = |(n : ℤ) + v| := by + rw [show -(n : ℤ) - v = -((n : ℤ) + v) by ring, abs_neg] + rw [laurent_coeff, ite_eq_left hvabs, laurent_coeff, hneg] + split_ifs <;> simp + +theorem convolution_sum_lower_bound_of_supported_bound (K : ℕ) (D δ ε : ℝ) + (hsource : ∀ A B : ℤ → ℂ, + Function.support A ⊆ Set.Icc (-(K : ℤ)) (K : ℤ) → + Function.support B ⊆ Set.Icc (-(K : ℤ)) (K : ℤ) → + (∀ i, ‖A i‖ ≤ D) → (∀ i, ‖B i‖ ≤ D) → + δ ≤ ‖A 0‖ → δ ≤ ‖B 0‖ → + ∃ n ∈ Finset.Icc 0 (2 * K), ε ≤ ‖∑ v ∈ Finset.Icc (-(K : ℤ)) (K : ℤ), + A v * B (-(n : ℤ) - v)‖) : + ∀ a b : ℤ → ℂ, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖a i‖ ≤ D) → + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖b i‖ ≤ D) → + δ ≤ ‖a 0‖ → δ ≤ ‖b 0‖ → + ε ≤ ∑ n ∈ Finset.range (2 * K + 1), ‖convolution K a b n‖ := by + intro a b ha hb ha0 hb0 + have hD : 0 ≤ D := (norm_nonneg (a 0)).trans (ha 0 (by simp)) + have coeff_bound : ∀ c : ℤ → ℂ, + (∀ i : ℤ, |i| ≤ (K : ℤ) → ‖c i‖ ≤ D) → + ∀ i, ‖(laurent K c).coeff i‖ ≤ D := by + intro c hc i + rw [laurent_coeff] + split_ifs with hi + · exact hc i hi + · simpa only [norm_zero] using hD + obtain ⟨n, hn, hc⟩ := hsource (laurent K a).coeff (laurent K b).coeff + (support_laurent_coeff_subset K a) (support_laurent_coeff_subset K b) + (coeff_bound a ha) (coeff_bound b hb) + (by simpa only [laurent_coeff_zero] using ha0) + (by simpa only [laurent_coeff_zero] using hb0) + rw [sum_laurent_coeff_eq_convolution] at hc + exact hc.trans (Finset.single_le_sum (fun k hk => norm_nonneg _) + (Finset.mem_range.mpr (Nat.lt_succ_of_le (Finset.mem_Icc.mp hn).2))) + +end Invariant233.FiniteWindow + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/LaurentWindow.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/LaurentWindow.lean new file mode 100644 index 0000000000000000000000000000000000000000..f35b15070f72f4f33aed810a204eeafd34c02772 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/LaurentWindow.lean @@ -0,0 +1,153 @@ +import Mathlib.Algebra.Polynomial.Laurent +import Mathlib.Basic.Complex.Basic +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +namespace Invariant233.LaurentWindow + +open Polynomial LaurentPolynomial + +variable {R : Type*} [Semiring R] + +@[simp] theorem coeff_trunc (A : LaurentPolynomial R) (n : ℕ) : + (LaurentPolynomial.trunc A).coeff n = A.coeff (n : ℤ) := by + rfl + +@[simp] theorem coeff_trunc_mul_T (A : LaurentPolynomial R) (k : ℤ) (n : ℕ) : + (LaurentPolynomial.trunc (A * LaurentPolynomial.T k)).coeff n = + A.coeff ((n : ℤ) - k) := by + rw [coeff_trunc, LaurentPolynomial.T, AddMonoidAlgebra.coeff_mul_single_apply] + simp only [mul_one, sub_eq_add_neg] + +@[simp] theorem coeff_toLaurent_nat (p : Polynomial R) (n : ℕ) : + p.toLaurent.coeff (n : ℤ) = p.coeff n := by + change (Finsupp.mapDomain (fun n : ℕ => (n : ℤ)) p.toFinsupp.coeff) n = _ + exact Finsupp.mapDomain_apply_of_injective Nat.cast_injective _ n + +@[simp] theorem coeff_toLaurent_neg (p : Polynomial R) (n : ℤ) (hn : n < 0) : + p.toLaurent.coeff n = 0 := by + change (Finsupp.mapDomain (fun n : ℕ => (n : ℤ)) p.toFinsupp.coeff) n = 0 + apply Finsupp.mapDomain_of_notMem_range + rintro ⟨m, rfl⟩ + exact (not_lt_of_ge (Int.natCast_nonneg m)) hn + +@[simp] theorem coeff_mul_T (A : LaurentPolynomial R) (k n : ℤ) : + (A * LaurentPolynomial.T k).coeff n = A.coeff (n - k) := by + rw [LaurentPolynomial.T, AddMonoidAlgebra.coeff_mul_single_apply] + simp only [mul_one, sub_eq_add_neg] + +theorem toLaurent_trunc_of_nonnegative (A : LaurentPolynomial R) + (hA : ∀ n : ℤ, n < 0 → A.coeff n = 0) : + (LaurentPolynomial.trunc A).toLaurent = A := by + ext n + by_cases hn : 0 ≤ n + · lift n to ℕ using hn + simp only [coeff_toLaurent_nat, coeff_trunc] + · rw [coeff_toLaurent_neg _ n (lt_of_not_ge hn), hA n (lt_of_not_ge hn)] + +theorem toLaurent_trunc_shift (K : ℕ) (A : LaurentPolynomial R) + (hA : ∀ n : ℤ, n < -(K : ℤ) → A.coeff n = 0) : + (LaurentPolynomial.trunc (A * LaurentPolynomial.T (K : ℤ))).toLaurent = + A * LaurentPolynomial.T (K : ℤ) := by + apply toLaurent_trunc_of_nonnegative + intro n hn + rw [coeff_mul_T] + apply hA + omega + +theorem coeff_trunc_shift_above (K n : ℕ) (A : LaurentPolynomial R) + (hA : ∀ i : ℤ, (K : ℤ) < i → A.coeff i = 0) (hn : 2 * K < n) : + (LaurentPolynomial.trunc (A * LaurentPolynomial.T (K : ℤ))).coeff n = 0 := by + rw [coeff_trunc_mul_T] + apply hA + omega + +theorem coeff_fin_sum_monomial (N : ℕ) (a : Fin N → R) (i : Fin N) : + (∑ j : Fin N, Polynomial.monomial (j : ℕ) (a j)).coeff (i : ℕ) = a i := by + classical + simp [Polynomial.coeff_monomial, Fin.val_inj] + +theorem coeff_fin_sum_monomial_above (N n : ℕ) (a : Fin N → R) (hn : N ≤ n) : + (∑ j : Fin N, Polynomial.monomial (j : ℕ) (a j)).coeff n = 0 := by + classical + simp only [Polynomial.finsetSum_coeff, Polynomial.coeff_monomial] + apply Finset.sum_eq_zero + intro j _ + rw [ite_eq_right] + omega + +theorem trunc_shift_eq_fin_sum (K : ℕ) (A : LaurentPolynomial R) + (hA : ∀ i : ℤ, (K : ℤ) < i → A.coeff i = 0) : + LaurentPolynomial.trunc (A * LaurentPolynomial.T (K : ℤ)) = + ∑ i : Fin (2 * K + 1), Polynomial.monomial (i : ℕ) + (A.coeff ((i : ℤ) - (K : ℤ))) := by + ext n + by_cases hn : n < 2 * K + 1 + · exact (coeff_trunc_mul_T A (K : ℤ) n).trans + (coeff_fin_sum_monomial (2 * K + 1) + (fun i : Fin (2 * K + 1) => A.coeff ((i : ℤ) - (K : ℤ))) ⟨n, hn⟩).symm + · rw [coeff_fin_sum_monomial_above _ n _ (le_of_not_gt hn), + coeff_trunc_shift_above K n A hA (by omega)] + +theorem coeff_window_sum (s : Finset ℤ) (a : ℤ → R) (n : ℤ) : + (∑ i ∈ s, (AddMonoidAlgebra.single i (a i) : LaurentPolynomial R)).coeff n = + if n ∈ s then a n else 0 := by + classical + simp only [AddMonoidAlgebra.coeff_sum, Finsupp.finsetSum_apply, + AddMonoidAlgebra.coeff_single, Finsupp.single_apply] + simp + +theorem coeff_window_product (s t : Finset ℤ) (a b : ℤ → R) (n : ℤ) : + ((∑ i ∈ s, (AddMonoidAlgebra.single i (a i) : LaurentPolynomial R)) * + (∑ j ∈ t, (AddMonoidAlgebra.single j (b j) : LaurentPolynomial R))).coeff n = + ∑ i ∈ s, if n - i ∈ t then a i * b (n - i) else 0 := by + classical + simp only [Finset.sum_mul, Finset.mul_sum, AddMonoidAlgebra.single_mul_single, + AddMonoidAlgebra.coeff_sum, Finsupp.finsetSum_apply, AddMonoidAlgebra.coeff_single, + Finsupp.single_apply] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i hi + simp_rw [show ∀ j : ℤ, i + j = n ↔ j = n - i by intro j; omega] + simp + +theorem coeff_symmetric_window_product (K : ℕ) (a b : ℤ → R) (n : ℤ) : + ((∑ i ∈ Finset.Icc (-(K : ℤ)) (K : ℤ), + (AddMonoidAlgebra.single i (a i) : LaurentPolynomial R)) * + (∑ j ∈ Finset.Icc (-(K : ℤ)) (K : ℤ), + (AddMonoidAlgebra.single j (b j) : LaurentPolynomial R))).coeff (-n) = + ∑ i ∈ (Finset.Icc (-(K : ℤ)) (K : ℤ)).filter (fun i => |n + i| ≤ (K : ℤ)), + a i * b (-n - i) := by + classical + rw [coeff_window_product, Finset.sum_filter] + apply Finset.sum_congr rfl + intro i hi + have hiff : -n - i ∈ Finset.Icc (-(K : ℤ)) (K : ℤ) ↔ |n + i| ≤ (K : ℤ) := by + simp only [Finset.mem_Icc, abs_le] + omega + simp only [hiff] + + +variable {S : Type*} [CommSemiring S] + +theorem coeff_shifted_product (K n : ℕ) (A B : LaurentPolynomial S) + (hA : ∀ i : ℤ, i < -(K : ℤ) → A.coeff i = 0) + (hB : ∀ i : ℤ, i < -(K : ℤ) → B.coeff i = 0) : + ((LaurentPolynomial.trunc (A * LaurentPolynomial.T (K : ℤ))) * + (LaurentPolynomial.trunc (B * LaurentPolynomial.T (K : ℤ)))).coeff n = + (A * B).coeff ((n : ℤ) - 2 * (K : ℤ)) := by + rw [← coeff_toLaurent_nat, map_mul, + toLaurent_trunc_shift K A hA, toLaurent_trunc_shift K B hB] + rw [mul_mul_mul_comm, ← LaurentPolynomial.T_add, coeff_mul_T] + congr 1 + omega + + +end Invariant233.LaurentWindow + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/LimitLaw.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/LimitLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..70272d8df86c3e8828a65ba0d9bbe1c06ab9da32 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/LimitLaw.lean @@ -0,0 +1,29 @@ +import Mathlib.MeasureTheory.Function.ConvergenceInDistribution + +namespace OAI + +open MeasureTheory ProbabilityTheory Filter +open scoped Topology + +namespace Invariant233 + +theorem map_eq_of_ae_limits_of_map_eq + {Ω Ω' : Type*} [MeasurableSpace Ω] [MeasurableSpace Ω'] + {μ : Measure Ω} {ν : Measure Ω'} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + {X : ℕ → Ω → ℝ} {Y : ℕ → Ω' → ℝ} {Z : Ω → ℝ} {W : Ω' → ℝ} + (hX : ∀ n, AEMeasurable (X n) μ) (hY : ∀ n, AEMeasurable (Y n) ν) + (hZ : AEMeasurable Z μ) (hW : AEMeasurable W ν) + (hXZ : ∀ᵐ ω ∂μ, Tendsto (fun n => X n ω) atTop (𝓝 (Z ω))) + (hYW : ∀ᵐ ω ∂ν, Tendsto (fun n => Y n ω) atTop (𝓝 (W ω))) + (hXY : ∀ n, μ.map (X n) = ν.map (Y n)) : μ.map Z = ν.map W := by + have h₁ := tendstoInDistribution_of_ae_tendsto hX hZ hXZ + have h₂ := tendstoInDistribution_of_ae_tendsto hY hW hYW + have h₃ : TendstoInDistribution X atTop W (fun _ => μ) ν := + { forall_aemeasurable := hX + aemeasurable_limit := hW + tendsto := by simpa only [hXY] using h₂.tendsto } + exact tendstoInDistribution_unique X h₁ h₃ + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/LogNonconstant.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/LogNonconstant.lean new file mode 100644 index 0000000000000000000000000000000000000000..83e3bbae8e2a7895b6f218d9de9632c1b13c07e4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/LogNonconstant.lean @@ -0,0 +1,47 @@ +import OAI.Analysis.IrrationalRotation.Model.Analytic +import OAI.Analysis.IrrationalRotation.Analysis.CountableFiberAtoms + +namespace OAI + +open MeasureTheory Filter Set +open scoped ENNReal + +namespace Invariant233 + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem not_ae_constant_of_positive_of_infiniteLog [IsProbabilityMeasure μ] + {f : X → ℝ} (hpos : ∀ᵐ x ∂μ, 0 < f x) + (hinf : HasNegInfiniteLogIntegral μ f) : + ¬ ∃ c : ℝ, f =ᵐ[μ] fun _ => c := by + rintro ⟨c, hc⟩ + have hcpos : 0 < c := by + obtain ⟨x, hx, hxc⟩ := (hpos.and hc).exists + simpa only [hxc] using hx + have hlin : (∫⁻ x, negLogCost (f x) ∂μ) = negLogCost c := by + calc + (∫⁻ x, negLogCost (f x) ∂μ) = ∫⁻ _x, negLogCost c ∂μ := by + apply lintegral_congr_ae + filter_upwards [hc] with x hx + rw [hx] + _ = negLogCost c := by simp + have hfinite : negLogCost c ≠ ∞ := by + rw [negLogCost, ite_eq_right (ne_of_gt hcpos)] + exact ENNReal.ofReal_ne_top + exact hfinite (hlin.symm.trans hinf) + +theorem exists_nontrivial_level_of_positive_of_infiniteLog [IsProbabilityMeasure μ] + {f : X → ℝ} (hf : Measurable f) (hpos : ∀ᵐ x ∂μ, 0 < f x) + (hinf : HasNegInfiniteLogIntegral μ f) + (hcount : ∃ C : Set ℝ, C.Countable ∧ ∀ᵐ x ∂μ, f x ∈ C) : + ∃ c : ℝ, MeasurableSet (f ⁻¹' {c}) ∧ + μ (f ⁻¹' {c}) ≠ 0 ∧ μ (f ⁻¹' {c})ᶜ ≠ 0 := by + obtain ⟨C, hC, hmem⟩ := hcount + obtain ⟨c, _, hc, hc'⟩ := + InvariantProjection.CountableFiberAtoms.exists_nontrivial_fiber hC hmem + (not_ae_constant_of_positive_of_infiniteLog hpos hinf) + exact ⟨c, hf (measurableSet_singleton c), hc, hc'⟩ + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/LogPotentialUpperSemicontinuity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/LogPotentialUpperSemicontinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..09401b9627a7445fddbadc2846e8f441a5c50203 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/LogPotentialUpperSemicontinuity.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.IrrationalRotation.Model.Spectral + +namespace OAI + +noncomputable section +open scoped ENNReal +namespace Invariant233 + +open MeasureTheory + +theorem continuous_regularizedLogIntegral (μ : Measure ℂ) [IsFiniteMeasure μ] + (hμ : IsCompact μ.support) (ε : ℝ) (hε : 0 < ε) : + Continuous (fun z : ℂ => ∫ w, Real.log (‖w - z‖ ^ 2 + ε) ∂μ) := by + have hf : Continuous (fun p : ℂ × ℂ => Real.log (‖p.2 - p.1‖ ^ 2 + ε)) := by + apply Continuous.log (by fun_prop) + intro p + exact ne_of_gt (add_pos_of_nonneg_of_pos (sq_nonneg _) hε) + have h := continuous_parametric_integral_of_continuous + (μ := μ) (f := fun z w : ℂ => Real.log (‖w - z‖ ^ 2 + ε)) hf hμ + change Continuous (fun z : ℂ => + ∫ w, Real.log (‖w - z‖ ^ 2 + ε) ∂μ.restrict μ.support) at h + have hr : μ.restrict μ.support = μ := + Measure.restrict_eq_self_of_ae_mem (s := μ.support) μ.support_mem_ae + rw [hr] at h + exact h + +theorem continuous_regularizedPotentialDeterminant (μ : Measure ℂ) [IsFiniteMeasure μ] + (hμ : IsCompact μ.support) (ε : ℝ) (hε : 0 < ε) : + Continuous (fun z : ℂ => ENNReal.ofReal + (Real.exp ((∫ w, Real.log (‖w - z‖ ^ 2 + ε) ∂μ) / 2))) := by + exact ENNReal.continuous_ofReal.comp (Real.continuous_exp.comp + ((continuous_regularizedLogIntegral μ hμ ε hε).div_const 2)) + +theorem upperSemicontinuous_logarithmicPotentialDeterminant + (μ : Measure ℂ) [IsFiniteMeasure μ] (hμ : IsCompact μ.support) : + UpperSemicontinuous (logarithmicPotentialDeterminant μ) := by + exact upperSemicontinuous_iInf fun ε => + (continuous_regularizedPotentialDeterminant μ hμ ε.val ε.property).upperSemicontinuous + +theorem continuousAt_logarithmicPotentialDeterminant_of_eq_zero + (μ : Measure ℂ) [IsFiniteMeasure μ] (hμ : IsCompact μ.support) + {z : ℂ} (hz : logarithmicPotentialDeterminant μ z = 0) : + ContinuousAt (logarithmicPotentialDeterminant μ) z := by + refine continuousAt_iff_lower_upperSemicontinuousAt.mpr + ⟨?_, upperSemicontinuous_logarithmicPotentialDeterminant μ hμ z⟩ + intro r hr + rw [hz] at hr + exact (not_lt_of_ge (show (0 : ℝ≥0∞) ≤ r from bot_le) hr).elim + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/LpContinuousBasisDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/LpContinuousBasisDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8f5003d1054aedb0a69e6fdc261193ebec1f363 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/LpContinuousBasisDensity.lean @@ -0,0 +1,80 @@ +import OAI.Analysis.IrrationalRotation.Operators.LpOperatorExt +import Mathlib.MeasureTheory.Function.ContinuousMapDense + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Invariant233.Fields + +variable {X H ι : Type*} [MeasurableSpace X] + [NormedAddCommGroup H] [InnerProductSpace ℂ H] {μ : Measure X} + +def scalarVectorLp (v : H) : Lp ℂ 2 μ →L[ℂ] Lp H 2 μ := + (ContinuousLinearMap.toSpanSingleton ℂ v).compLpL 2 μ + +theorem scalarVectorLp_ae (v : H) (f : Lp ℂ 2 μ) : + scalarVectorLp (μ := μ) v f =ᵐ[μ] fun x => f x • v := + ContinuousLinearMap.coeFn_compLpL _ _ + +theorem scalarVectorLp_indicator (v : H) (s : Set X) (hs : MeasurableSet s) + (hμs : μ s ≠ ∞) : + scalarVectorLp (μ := μ) v (indicatorConstLp 2 hs hμs (1 : ℂ)) = + indicatorConstLp 2 hs hμs v := by + apply Lp.ext + filter_upwards [scalarVectorLp_ae v (indicatorConstLp 2 hs hμs (1 : ℂ)), + indicatorConstLp_coeFn (p := 2) (μ := μ) (hs := hs) (hμs := hμs) (c := (1 : ℂ)), + indicatorConstLp_coeFn (p := 2) (μ := μ) (hs := hs) (hμs := hμs) (c := v)] + with x hx hf hv + rw [hx, hf, hv] + by_cases hxs : x ∈ s <;> simp [hxs] + +variable [TopologicalSpace X] [CompactSpace X] [BorelSpace X] + [SecondCountableTopology X] [T2Space X] [IsFiniteMeasure μ] [μ.WeaklyRegular] + +theorem closed_submodule_eq_top_of_continuous_basis + (e : HilbertBasis ι ℂ H) (K : Submodule ℂ (Lp H 2 μ)) + (hK : IsClosed (K : Set (Lp H 2 μ))) + (h : ∀ (i : ι) (a : C(X, ℂ)), + scalarVectorLp (μ := μ) (e i) (ContinuousMap.toLp 2 μ ℂ a) ∈ K) : + K = ⊤ := by + have hi (i : ι) (f : Lp ℂ 2 μ) : scalarVectorLp (μ := μ) (e i) f ∈ K := by + have hs : Set.range (ContinuousMap.toLp 2 μ ℂ : C(X, ℂ) → Lp ℂ 2 μ) ⊆ + (scalarVectorLp (μ := μ) (e i)) ⁻¹' (K : Set (Lp H 2 μ)) := by + rintro _ ⟨a, rfl⟩ + exact h i a + have hc := closure_minimal hs + (hK.preimage (scalarVectorLp (μ := μ) (e i)).continuous) + rw [(ContinuousMap.toLp_denseRange ℂ μ ℂ (by norm_num : (2 : ℝ≥0∞) ≠ ∞)).closure_range] + at hc + exact hc (Set.mem_univ f) + have hb (s : Set X) (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (v : H) : + indicatorConstLp 2 hs hμs v ∈ K := by + let C : H →L[ℂ] Lp H 2 μ := indicatorConstLpCLM s hs hμs + have hbasis : Set.range e ⊆ C ⁻¹' (K : Set (Lp H 2 μ)) := by + rintro _ ⟨i, rfl⟩ + change indicatorConstLp 2 hs hμs (e i) ∈ K + rw [← scalarVectorLp_indicator] + exact hi i _ + have hspan : (Submodule.span ℂ (Set.range e) : Set H) ⊆ C ⁻¹' K := by + change Submodule.span ℂ (Set.range e) ≤ K.comap C.toLinearMap + exact Submodule.span_le.mpr hbasis + have hc := closure_minimal hspan (hK.preimage C.continuous) + change ((Submodule.span ℂ (Set.range e)).topologicalClosure : Set H) ⊆ _ at hc + rw [e.dense_span] at hc + exact hc Submodule.mem_top + apply top_unique + intro f _ + apply Lp.induction (by norm_num : (2 : ℝ≥0∞) ≠ ∞) (fun g => g ∈ K) _ _ hK f + · intro v s hs hμs + exact hb s hs hμs.ne v + · intro f g hf hg hdis hfK hgK + exact K.add_mem hfK hgK + +end Invariant233.Fields + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/LusinCompact.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/LusinCompact.lean new file mode 100644 index 0000000000000000000000000000000000000000..1264eccd37d847d627ae35244ae5dd2cb3bc20eb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/LusinCompact.lean @@ -0,0 +1,70 @@ +import Mathlib.MeasureTheory.Constructions.Polish.Basic +import Mathlib.MeasureTheory.Measure.RegularityCompacts +import Mathlib.Topology.Homeomorph.Lemmas + +namespace OAI + +open Set MeasureTheory +open scoped Topology ENNReal + +namespace Invariant233.CompactTransfer + +theorem continuousOn_of_finer_compact {X Y : Type*} + {t t' : TopologicalSpace X} [TopologicalSpace Y] [@T2Space X t] + (hle : t' ≤ t) {K : Set X} (hK : @IsCompact X t' K) + {f : X → Y} (hf : @Continuous X Y t' _ f) : + @ContinuousOn X Y t _ f K := by + let s : TopologicalSpace K := @TopologicalSpace.induced K X Subtype.val t + let s' : TopologicalSpace K := @TopologicalSpace.induced K X Subtype.val t' + have hcomp : @CompactSpace K s' := (@isCompact_iff_compactSpace X t' K).mp hK + have hT2 : @T2Space K s := inferInstance + have hid : @Continuous K K s' s id := continuous_id_of_le (induced_mono hle) + let e : @Homeomorph K K s' s := + @Continuous.homeoOfEquivCompactToT2 K K s' s hcomp hT2 (Equiv.refl K) hid + apply (@continuousOn_iff_continuous_domRestrict X Y t _ f K).mpr + have hff : @Continuous K Y s' _ (K.domRestrict f) := + @Continuous.comp K X Y s' t' _ Subtype.val f hf (@continuous_subtype_val X t' K) + exact @Continuous.comp K K Y s s' _ _ _ hff + (@Homeomorph.continuous K K s s' (@Homeomorph.symm K K s' s e)) + +theorem exists_isCompact_continuousOn {X Y : Type*} + [t : TopologicalSpace X] [PolishSpace X] [MeasurableSpace X] [BorelSpace X] + [TopologicalSpace Y] [SecondCountableTopology Y] + [MeasurableSpace Y] [OpensMeasurableSpace Y] + (μ : Measure X) [IsFiniteMeasure μ] {f : X → Y} (hf : Measurable f) + {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ K : Set X, IsCompact K ∧ μ Kᶜ < ε ∧ ContinuousOn f K := by + obtain ⟨t', hle, hcont, hpolish⟩ := hf.exists_continuous + have hborel : @BorelSpace X t' _ := by + constructor + exact (@BorelSpace.measurable_eq X t _ inferInstance).trans + (@borel_eq_borel_of_le X t' t hpolish (inferInstance : @PolishSpace X t) hle).symm + have hregular : @Measure.InnerRegularCompactLTTop X _ t' μ := by + let := t' + let := hpolish + let := hborel + infer_instance + obtain ⟨K, _, hK, hμK⟩ := @MeasurableSet.exists_isCompact_sdiff_lt X _ μ t' + (by let := t'; let := hborel; infer_instance) + (by let := t'; let := hpolish; infer_instance) + hregular Set.univ MeasurableSet.univ (measure_ne_top μ Set.univ) ε hε + refine ⟨K, ?_, ?_, continuousOn_of_finer_compact hle hK hcont⟩ + · simpa only [Set.image_id] using + (@IsCompact.image X X t' t K id hK (continuous_id_of_le hle)) + · simpa only [Set.compl_eq_univ_sdiff] using hμK + +theorem exists_isCompact_forall_continuousOn {X ι : Type*} {Y : ι → Type*} + [Countable ι] [TopologicalSpace X] [PolishSpace X] + [MeasurableSpace X] [BorelSpace X] + [∀ i, TopologicalSpace (Y i)] [∀ i, SecondCountableTopology (Y i)] + [∀ i, MeasurableSpace (Y i)] [∀ i, OpensMeasurableSpace (Y i)] + (μ : Measure X) [IsFiniteMeasure μ] {f : ∀ i, X → Y i} + (hf : ∀ i, Measurable (f i)) {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ K : Set X, IsCompact K ∧ μ Kᶜ < ε ∧ ∀ i, ContinuousOn (f i) K := by + obtain ⟨K, hK, hμK, hcont⟩ := exists_isCompact_continuousOn μ + (Measurable.of_eval hf) hε + exact ⟨K, hK, hμK, fun i => (continuous_apply i).comp_continuousOn hcont⟩ + +end Invariant233.CompactTransfer + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/MaskedCauchySchwarz.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/MaskedCauchySchwarz.lean new file mode 100644 index 0000000000000000000000000000000000000000..200b976b380f81e0ddf00986587474adead678e8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/MaskedCauchySchwarz.lean @@ -0,0 +1,114 @@ +import Mathlib.MeasureTheory.Function.L2Space +import Mathlib.MeasureTheory.Function.ConditionalExpectation.PullOut +import Mathlib.MeasureTheory.Integral.Prod +import Mathlib.MeasureTheory.Integral.Bochner.Basic + +namespace OAI + +open MeasureTheory +open scoped ENNReal + +namespace InvariantProjection + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {μ : Measure Ω} + +theorem integral_mul_le_sqrt_sq_mul_sqrt_sq {f g : Ω → ℝ} + (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) + (hf_nonneg : 0 ≤ᵐ[μ] f) (hg_nonneg : 0 ≤ᵐ[μ] g) : + (∫ ω, f ω * g ω ∂μ) ≤ + Real.sqrt (∫ ω, f ω ^ 2 ∂μ) * Real.sqrt (∫ ω, g ω ^ 2 ∂μ) := by + have h := integral_mul_le_Lp_mul_Lq_of_nonneg Real.HolderConjugate.two_two + hf_nonneg hg_nonneg (by simpa using hf) (by simpa using hg) + simpa only [Real.rpow_two, ← Real.sqrt_eq_rpow] using h + +theorem integral_mul_le_sqrt_of_sq_integral_le {f g : Ω → ℝ} {δ : ℝ} + (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) + (hf_nonneg : 0 ≤ᵐ[μ] f) (hg_nonneg : 0 ≤ᵐ[μ] g) + (hf_sq : (∫ ω, f ω ^ 2 ∂μ) ≤ δ) + (hg_sq : (∫ ω, g ω ^ 2 ∂μ) ≤ 1) : + (∫ ω, f ω * g ω ∂μ) ≤ Real.sqrt δ := by + calc + (∫ ω, f ω * g ω ∂μ) ≤ + Real.sqrt (∫ ω, f ω ^ 2 ∂μ) * Real.sqrt (∫ ω, g ω ^ 2 ∂μ) := + integral_mul_le_sqrt_sq_mul_sqrt_sq hf hg hf_nonneg hg_nonneg + _ ≤ Real.sqrt δ * Real.sqrt 1 := + mul_le_mul (Real.sqrt_le_sqrt hf_sq) (Real.sqrt_le_sqrt hg_sq) + (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) + _ = Real.sqrt δ := by simp + +theorem integral_indicator_le_of_condExp_indicator_le + {m : MeasurableSpace Ω} (hm : m ≤ mΩ) + [IsFiniteMeasure μ] {H : Set Ω} (hH : MeasurableSet[mΩ] H) + {w : Ω → ℝ} {δ : ℝ} (hw : Integrable w μ) + (hwm : StronglyMeasurable[m] w) (hw_nonneg : 0 ≤ᵐ[μ] w) + (hcond : μ[H.indicator (fun _ => (1 : ℝ)) | m] ≤ᵐ[μ] fun _ => δ) : + (∫ ω, H.indicator w ω ∂μ) ≤ δ * ∫ ω, w ω ∂μ := by + have hmul : w * H.indicator (fun _ => (1 : ℝ)) = H.indicator w := by + funext ω + by_cases hω : ω ∈ H <;> simp [hω] + have hpull := condExp_mul_of_stronglyMeasurable_left hwm + (show Integrable (w * H.indicator (fun _ => (1 : ℝ))) μ by + rw [hmul] + exact hw.indicator hH) + ((integrable_const (1 : ℝ)).indicator hH) + have hprod : Integrable (w * μ[H.indicator (fun _ => (1 : ℝ)) | m]) μ := + integrable_condExp.congr hpull + calc + (∫ ω, H.indicator w ω ∂μ) = + ∫ ω, μ[w * H.indicator (fun _ => (1 : ℝ)) | m] ω ∂μ := by + rw [integral_condExp hm, hmul] + _ = ∫ ω, w ω * μ[H.indicator (fun _ => (1 : ℝ)) | m] ω ∂μ := + integral_congr_ae hpull + _ ≤ ∫ ω, δ * w ω ∂μ := by + apply integral_mono_ae hprod (hw.const_mul δ) + filter_upwards [hcond, hw_nonneg] with ω hω hwω + simpa only [Pi.mul_apply, mul_comm] using mul_le_mul_of_nonneg_left hω hwω + _ = δ * ∫ ω, w ω ∂μ := integral_const_mul δ w + +theorem lintegral_tsum_indicator_le_of_condExp_indicator_le + {ι : Type*} [Countable ι] {m : MeasurableSpace Ω} (hm : m ≤ mΩ) + [IsFiniteMeasure μ] {H : ι → Set Ω} (hH : ∀ i, MeasurableSet[mΩ] (H i)) + {w : ι → Ω → ℝ} {δ : ℝ} (hδ : 0 ≤ δ) + (hw : ∀ i, Integrable (w i) μ) + (hwm : ∀ i, StronglyMeasurable[m] (w i)) + (hw_nonneg : ∀ i, 0 ≤ᵐ[μ] w i) + (hcond : ∀ i, μ[(H i).indicator (fun _ => (1 : ℝ)) | m] ≤ᵐ[μ] fun _ => δ) : + (∫⁻ ω, ∑' i, ENNReal.ofReal ((H i).indicator (w i) ω) ∂μ) ≤ + ENNReal.ofReal δ * ∫⁻ ω, ∑' i, ENNReal.ofReal (w i ω) ∂μ := by + rw [lintegral_tsum (fun i => ((hw i).indicator (hH i)).aemeasurable.ennreal_ofReal), + lintegral_tsum (fun i => (hw i).aemeasurable.ennreal_ofReal), + ← ENNReal.tsum_mul_left] + apply ENNReal.tsum_le_tsum + intro i + have hmask_nonneg : 0 ≤ᵐ[μ] (H i).indicator (w i) := by + filter_upwards [hw_nonneg i] with ω hω + by_cases hi : ω ∈ H i + · simpa only [Set.indicator_of_mem hi, Pi.zero_apply] using hω + · simp [hi] + rw [← ofReal_integral_eq_lintegral_ofReal ((hw i).indicator (hH i)) hmask_nonneg, + ← ofReal_integral_eq_lintegral_ofReal (hw i) (hw_nonneg i), + ← ENNReal.ofReal_mul hδ] + exact ENNReal.ofReal_le_ofReal + (integral_indicator_le_of_condExp_indicator_le (mΩ := mΩ) hm (hH i) (hw i) (hwm i) + (hw_nonneg i) (hcond i)) + +theorem lintegral_tsum_indicator_le_of_condExp_indicator_le_of_energy_le_one + {ι : Type*} [Countable ι] {m : MeasurableSpace Ω} (hm : m ≤ mΩ) + [IsFiniteMeasure μ] {H : ι → Set Ω} (hH : ∀ i, MeasurableSet[mΩ] (H i)) + {w : ι → Ω → ℝ} {δ : ℝ} (hδ : 0 ≤ δ) + (hw : ∀ i, Integrable (w i) μ) + (hwm : ∀ i, StronglyMeasurable[m] (w i)) + (hw_nonneg : ∀ i, 0 ≤ᵐ[μ] w i) + (hcond : ∀ i, μ[(H i).indicator (fun _ => (1 : ℝ)) | m] ≤ᵐ[μ] fun _ => δ) + (henergy : (∫⁻ ω, ∑' i, ENNReal.ofReal (w i ω) ∂μ) ≤ 1) : + (∫⁻ ω, ∑' i, ENNReal.ofReal ((H i).indicator (w i) ω) ∂μ) ≤ + ENNReal.ofReal δ := by + calc + _ ≤ ENNReal.ofReal δ * ∫⁻ ω, ∑' i, ENNReal.ofReal (w i ω) ∂μ := + lintegral_tsum_indicator_le_of_condExp_indicator_le (mΩ := mΩ) hm hH hδ hw hwm hw_nonneg hcond + _ ≤ ENNReal.ofReal δ * 1 := mul_le_mul_right henergy _ + _ = ENNReal.ofReal δ := mul_one _ + +end InvariantProjection + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/MaskedConvolutionTail.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/MaskedConvolutionTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..943314f15fd806b13702fa4ea826cc716bbc0c8c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/MaskedConvolutionTail.lean @@ -0,0 +1,96 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Tactic + +namespace OAI + +namespace InvariantProjection + +theorem norm_finset_sum_le_complement + {ι : Type*} (s : Finset ι) (c : ι → ℂ) + (hc : Summable fun i => ‖c i‖) (hz : (∑' i, c i) = 0) : + ‖∑ i ∈ s, c i‖ ≤ ∑' i : ↑((s : Set ι)ᶜ), ‖c i‖ := by + have hsplit := hc.of_norm.sum_add_tsum_compl (s := s) + rw [hz] at hsplit + have heq : (∑ i ∈ s, c i) = -(∑' i : ↑((s : Set ι)ᶜ), c i) := by + simpa using eq_neg_of_add_eq_zero_left hsplit + rw [heq, norm_neg] + exact norm_tsum_le_tsum_norm (hc.subtype fun i => i ∈ (s : Set ι)ᶜ) + +theorem norm_finset_sum_le_two_tails + {ι : Type*} (s : Finset ι) (c : ι → ℂ) (w e₁ e₂ : ι → ℝ) (η : ℝ) + (hc : Summable fun i => ‖c i‖) (hz : (∑' i, c i) = 0) + (hw : Summable w) (hw0 : ∀ i, 0 ≤ w i) (hη : 0 ≤ η) + (h₁ : ∀ i, 0 ≤ e₁ i ∧ e₁ i ≤ w i) (h₂ : ∀ i, 0 ≤ e₂ i ∧ e₂ i ≤ w i) + (hb : ∀ i, i ∉ s → ‖c i‖ ≤ η * w i + e₁ i + e₂ i) : + ‖∑ i ∈ s, c i‖ ≤ η * (∑' i, w i) + + (∑' i : ↑((s : Set ι)ᶜ), e₁ i) + (∑' i : ↑((s : Set ι)ᶜ), e₂ i) := by + have hs₁ : Summable e₁ := Summable.of_nonneg_of_le + (fun i => (h₁ i).1) (fun i => (h₁ i).2) hw + have hs₂ : Summable e₂ := Summable.of_nonneg_of_le + (fun i => (h₂ i).1) (fun i => (h₂ i).2) hw + have hwc := hw.subtype (fun i => i ∈ (s : Set ι)ᶜ) + have h₁c := hs₁.subtype (fun i => i ∈ (s : Set ι)ᶜ) + have h₂c := hs₂.subtype (fun i => i ∈ (s : Set ι)ᶜ) + have hct := hc.subtype (fun i => i ∈ (s : Set ι)ᶜ) + simp only [Function.comp_def] at hwc h₁c h₂c hct + have htail : (∑' i : ↑((s : Set ι)ᶜ), ‖c i‖) ≤ + ∑' i : ↑((s : Set ι)ᶜ), (η * w i + e₁ i + e₂ i) := + Summable.tsum_le_tsum (fun i => hb i i.property) hct + (((hwc.mul_left η).add h₁c).add h₂c) + have hwle : (∑' i : ↑((s : Set ι)ᶜ), w i) ≤ ∑' i, w i := by + have hsplit := hw.sum_add_tsum_compl (s := s) + have hsum : 0 ≤ ∑ i ∈ s, w i := Finset.sum_nonneg fun i hi => hw0 i + simpa using (le_add_of_nonneg_left hsum).trans_eq hsplit + calc + ‖∑ i ∈ s, c i‖ ≤ ∑' i : ↑((s : Set ι)ᶜ), ‖c i‖ := + norm_finset_sum_le_complement s c hc hz + _ ≤ ∑' i : ↑((s : Set ι)ᶜ), (η * w i + e₁ i + e₂ i) := htail + _ = η * (∑' i : ↑((s : Set ι)ᶜ), w i) + + (∑' i : ↑((s : Set ι)ᶜ), e₁ i) + (∑' i : ↑((s : Set ι)ᶜ), e₂ i) := by + rw [((hwc.mul_left η).add h₁c).tsum_add h₂c, (hwc.mul_left η).tsum_add h₁c, + tsum_mul_left] + _ ≤ η * (∑' i, w i) + + (∑' i : ↑((s : Set ι)ᶜ), e₁ i) + (∑' i : ↑((s : Set ι)ᶜ), e₂ i) := by + gcongr + +theorem norm_finset_sum_le_masked_tail + {ι : Type*} (s : Finset ι) (c : ι → ℂ) (w : ι → ℝ) (η : ℝ) + (H₁ H₂ : Set ι) + (hc : Summable fun i => ‖c i‖) (hz : (∑' i, c i) = 0) + (hw : Summable w) (hw0 : ∀ i, 0 ≤ w i) (hη : 0 ≤ η) + (hb : ∀ i, i ∉ s → ‖c i‖ ≤ + (η + H₁.indicator (fun _ => (1 : ℝ)) i + + H₂.indicator (fun _ => (1 : ℝ)) i) * w i) : + ‖∑ i ∈ s, c i‖ ≤ η * (∑' i, w i) + + (∑' i : ↑((s : Set ι)ᶜ), H₁.indicator w i) + + (∑' i : ↑((s : Set ι)ᶜ), H₂.indicator w i) := by + classical + apply norm_finset_sum_le_two_tails s c w (H₁.indicator w) (H₂.indicator w) + η hc hz hw hw0 hη + · intro i + by_cases hi : i ∈ H₁ <;> simp [Set.indicator_of_mem, Set.indicator_of_notMem, hi, hw0 i] + · intro i + by_cases hi : i ∈ H₂ <;> simp [Set.indicator_of_mem, Set.indicator_of_notMem, hi, hw0 i] + · intro i hi + convert hb i hi using 1 + simp only [Set.indicator_apply] + split_ifs <;> ring + +theorem omitted_index_selector (K n v : ℤ) + (h : ¬ (|v| ≤ K ∧ |n + v| ≤ K)) : + K < |if K < |v| then v else n + v| := by + split_ifs with hv + · exact hv + · have hv' : |v| ≤ K := le_of_not_gt hv + exact lt_of_not_ge (fun hn => h ⟨hv', hn⟩) + +theorem omitted_index_ratio_bound (K n v : ℤ) (R : ℤ → ℝ) (r : ℝ) + (hr : r ≤ min (R v) (R (n + v))) : + r ≤ R (if K < |v| then v else n + v) := by + split_ifs + · exact hr.trans (min_le_left _ _) + · exact hr.trans (min_le_right _ _) + +end InvariantProjection + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/MaskedTail.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/MaskedTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..31409d21ea8fd70fd8b86cb304a7a33e347e9c55 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/MaskedTail.lean @@ -0,0 +1,218 @@ +import Mathlib.MeasureTheory.Integral.MeanInequalities +import Mathlib.MeasureTheory.Integral.Lebesgue.Countable +import Mathlib.MeasureTheory.Measure.Prod +import Mathlib.MeasureTheory.Function.ConditionalLExpectation +import Mathlib.MeasureTheory.Integral.Bochner.Basic +import Mathlib.Tactic + +namespace OAI + +open MeasureTheory +open scoped ENNReal + +namespace Invariant233.MaskedTail + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {μ : Measure Ω} + +theorem lintegral_mul_le_sqrt + {a b : Ω → ℝ≥0∞} {δ : ℝ≥0∞} + (ha : AEMeasurable a μ) (hb : AEMeasurable b μ) + (ha2 : (∫⁻ ω, a ω ^ (2 : ℕ) ∂μ) ≤ δ) + (hb2 : (∫⁻ ω, b ω ^ (2 : ℕ) ∂μ) ≤ 1) : + (∫⁻ ω, a ω * b ω ∂μ) ≤ δ ^ (1 / 2 : ℝ) := by + have hconj : (2 : ℝ).HolderConjugate 2 := by + rw [Real.holderConjugate_iff] + norm_num + have hcs := ENNReal.lintegral_mul_le_Lp_mul_Lq μ hconj ha hb + simp only [Pi.mul_apply, ENNReal.rpow_two] at hcs + calc + (∫⁻ ω, a ω * b ω ∂μ) ≤ + (∫⁻ ω, a ω ^ (2 : ℕ) ∂μ) ^ (1 / 2 : ℝ) * + (∫⁻ ω, b ω ^ (2 : ℕ) ∂μ) ^ (1 / 2 : ℝ) := hcs + _ ≤ δ ^ (1 / 2 : ℝ) * (1 : ℝ≥0∞) ^ (1 / 2 : ℝ) := + mul_le_mul' (ENNReal.rpow_le_rpow ha2 (by norm_num)) + (ENNReal.rpow_le_rpow hb2 (by norm_num)) + _ = δ ^ (1 / 2 : ℝ) := by simp + +theorem lintegral_indicator_mul_le_sqrt + {a b : Ω → ℝ≥0∞} {δ : ℝ≥0∞} {H : Set Ω} + (hH : MeasurableSet H) + (ha : AEMeasurable a μ) (hb : AEMeasurable b μ) + (ha2 : (∫⁻ ω, H.indicator (fun ω => a ω ^ (2 : ℕ)) ω ∂μ) ≤ δ) + (hb2 : (∫⁻ ω, b ω ^ (2 : ℕ) ∂μ) ≤ 1) : + (∫⁻ ω, H.indicator (fun ω => a ω * b ω) ω ∂μ) ≤ + δ ^ (1 / 2 : ℝ) := by + have hpow : (fun ω => (H.indicator a ω) ^ (2 : ℕ)) = + H.indicator (fun ω => a ω ^ (2 : ℕ)) := by + funext ω + by_cases hω : ω ∈ H <;> simp [hω] + have hmul : (fun ω => H.indicator a ω * b ω) = + H.indicator (fun ω => a ω * b ω) := by + funext ω + by_cases hω : ω ∈ H <;> simp [hω] + have h := lintegral_mul_le_sqrt (ha.indicator hH) hb (by simpa [hpow] using ha2) hb2 + simpa [hmul] using h + +theorem lintegral_tsum_indicator_mul_le_sqrt + {ι : Type*} [MeasurableSpace ι] [MeasurableSingletonClass ι] [Countable ι] + {a b : Ω × ι → ℝ≥0∞} {δ : ℝ≥0∞} {H : Set (Ω × ι)} + (hH : MeasurableSet H) + (ha : AEMeasurable a (μ.prod Measure.count)) + (hb : AEMeasurable b (μ.prod Measure.count)) + (ha2 : (∫⁻ ω, ∑' i, H.indicator (fun z => a z ^ (2 : ℕ)) (ω, i) ∂μ) ≤ δ) + (hb2 : (∫⁻ ω, ∑' i, b (ω, i) ^ (2 : ℕ) ∂μ) ≤ 1) : + (∫⁻ ω, ∑' i, H.indicator (fun z => a z * b z) (ω, i) ∂μ) ≤ + δ ^ (1 / 2 : ℝ) := by + have ha2' : (∫⁻ z, H.indicator (fun z => a z ^ (2 : ℕ)) z + ∂μ.prod Measure.count) ≤ δ := by + rw [lintegral_prod _ ((ha.pow_const 2).indicator hH)] + simpa only [lintegral_count] using ha2 + have hb2' : (∫⁻ z, b z ^ (2 : ℕ) ∂μ.prod Measure.count) ≤ 1 := by + rw [lintegral_prod _ (hb.pow_const 2)] + simpa only [lintegral_count] using hb2 + have h := lintegral_indicator_mul_le_sqrt hH ha hb ha2' hb2' + change (∫⁻ z, H.indicator (a * b) z ∂μ.prod Measure.count) ≤ _ at h + rw [lintegral_prod _ ((ha.mul hb).indicator hH)] at h + simpa only [lintegral_count, Pi.mul_def] using h + +theorem lintegral_tsum_indicator_mul_le_sqrt_right + {ι : Type*} [MeasurableSpace ι] [MeasurableSingletonClass ι] [Countable ι] + {a b : Ω × ι → ℝ≥0∞} {δ : ℝ≥0∞} {H : Set (Ω × ι)} + (hH : MeasurableSet H) + (ha : AEMeasurable a (μ.prod Measure.count)) + (hb : AEMeasurable b (μ.prod Measure.count)) + (ha2 : (∫⁻ ω, ∑' i, a (ω, i) ^ (2 : ℕ) ∂μ) ≤ 1) + (hb2 : (∫⁻ ω, ∑' i, H.indicator (fun z => b z ^ (2 : ℕ)) (ω, i) ∂μ) ≤ δ) : + (∫⁻ ω, ∑' i, H.indicator (fun z => a z * b z) (ω, i) ∂μ) ≤ + δ ^ (1 / 2 : ℝ) := by + simpa only [mul_comm] using + lintegral_tsum_indicator_mul_le_sqrt hH hb ha hb2 ha2 + +theorem lintegral_mul_le_of_condLExp_le + {m : MeasurableSpace Ω} (hm : m ≤ mΩ) + [SigmaFinite (μ.trim hm)] {a h : Ω → ℝ≥0∞} {δ : ℝ≥0∞} + (ha : Measurable[m] a) (hh : Measurable[mΩ] h) + (hcond : ∀ᵐ ω ∂μ, condLExp m μ h ω ≤ δ) : + (∫⁻ ω, h ω * a ω ∂μ) ≤ δ * ∫⁻ ω, a ω ∂μ := by + have hmeasure : (μ.withDensity h).trim hm ≤ δ • μ.trim hm := by + apply Measure.le_iff.mpr + intro s hs + rw [trim_measurableSet_eq hm hs, Measure.smul_apply, + trim_measurableSet_eq hm hs, withDensity_apply _ (hm s hs)] + rw [← setLIntegral_condLExp hm μ h hs] + calc + (∫⁻ ω in s, condLExp m μ h ω ∂μ) ≤ ∫⁻ _ in s, δ ∂μ := + lintegral_mono_ae (ae_restrict_of_ae hcond) + _ = δ * μ s := by simp + have haFull : Measurable[mΩ] a := ha.mono hm le_rfl + calc + (∫⁻ ω, h ω * a ω ∂μ) = ∫⁻ ω, a ω ∂μ.withDensity h := by + simpa only [Pi.mul_apply] using + (lintegral_withDensity_eq_lintegral_mul μ hh haFull).symm + _ = ∫⁻ ω, a ω ∂(μ.withDensity h).trim hm := (lintegral_trim hm ha).symm + _ ≤ ∫⁻ ω, a ω ∂δ • μ.trim hm := lintegral_mono' hmeasure le_rfl + _ = δ * ∫⁻ ω, a ω ∂μ := by rw [lintegral_smul_measure, lintegral_trim hm ha]; rfl + +theorem lintegral_tsum_ofReal_indicator_mul_le_sqrt + {ι : Type*} [MeasurableSpace ι] [MeasurableSingletonClass ι] [Countable ι] + {a b : ι → Ω → ℝ} {H : ι → Set Ω} {δ : ℝ} + (ha : ∀ i, Measurable (a i)) (hb : ∀ i, Measurable (b i)) + (hH : ∀ i, MeasurableSet (H i)) + (ha_nonneg : ∀ i ω, 0 ≤ a i ω) (hb_nonneg : ∀ i ω, 0 ≤ b i ω) + (hδ : 0 ≤ δ) + (ha2 : (∫⁻ ω, ∑' i, ENNReal.ofReal ((H i).indicator + (fun ω => a i ω ^ (2 : ℕ)) ω) ∂μ) ≤ ENNReal.ofReal δ) + (hb2 : (∫⁻ ω, ∑' i, ENNReal.ofReal (b i ω ^ (2 : ℕ)) ∂μ) ≤ 1) : + (∫⁻ ω, ∑' i, ENNReal.ofReal ((H i).indicator + (fun ω => a i ω * b i ω) ω) ∂μ) ≤ ENNReal.ofReal (Real.sqrt δ) := by + let A : Ω × ι → ℝ≥0∞ := fun z => ENNReal.ofReal ((H z.2).indicator (a z.2) z.1) + let B : Ω × ι → ℝ≥0∞ := fun z => ENNReal.ofReal (b z.2 z.1) + have hA : Measurable A := measurable_from_prod_countable_left fun i => + ((ha i).indicator (hH i)).ennreal_ofReal + have hB : Measurable B := measurable_from_prod_countable_left fun i => + (hb i).ennreal_ofReal + have hA2 : ∀ z : Ω × ι, A z ^ (2 : ℕ) = + ENNReal.ofReal ((H z.2).indicator (fun ω => a z.2 ω ^ (2 : ℕ)) z.1) := by + intro z + by_cases hz : z.1 ∈ H z.2 + · simp [A, hz, ENNReal.ofReal_pow (ha_nonneg z.2 z.1)] + · simp [A, hz] + have hB2 : ∀ z : Ω × ι, B z ^ (2 : ℕ) = + ENNReal.ofReal (b z.2 z.1 ^ (2 : ℕ)) := by + intro z + exact (ENNReal.ofReal_pow (hb_nonneg z.2 z.1) 2).symm + have hAB : ∀ z : Ω × ι, A z * B z = + ENNReal.ofReal ((H z.2).indicator (fun ω => a z.2 ω * b z.2 ω) z.1) := by + intro z + by_cases hz : z.1 ∈ H z.2 + · simp [A, B, hz, ENNReal.ofReal_mul (ha_nonneg z.2 z.1)] + · simp [A, B, hz] + have hA2' : (∫⁻ z, A z ^ (2 : ℕ) ∂μ.prod Measure.count) ≤ ENNReal.ofReal δ := by + rw [lintegral_prod _ (hA.pow_const 2).aemeasurable] + simpa only [lintegral_count, hA2] using ha2 + have hB2' : (∫⁻ z, B z ^ (2 : ℕ) ∂μ.prod Measure.count) ≤ 1 := by + rw [lintegral_prod _ (hB.pow_const 2).aemeasurable] + simpa only [lintegral_count, hB2] using hb2 + have h := lintegral_mul_le_sqrt hA.aemeasurable hB.aemeasurable hA2' hB2' + change (∫⁻ z, (A * B) z ∂μ.prod Measure.count) ≤ _ at h + rw [lintegral_prod _ (hA.mul hB).aemeasurable] at h + simp only [lintegral_count, Pi.mul_apply, hAB] at h + rw [Real.sqrt_eq_rpow, ← ENNReal.ofReal_rpow_of_nonneg hδ (by norm_num)] + exact h + +theorem real_tsum_integrable_of_lintegral_bound + {ι : Type*} [Countable ι] {f : ι → Ω → ℝ} {C : ℝ} + (hf : ∀ i, Measurable (f i)) (hf_nonneg : ∀ i ω, 0 ≤ f i ω) + (hC : 0 ≤ C) + (hbound : (∫⁻ ω, ∑' i, ENNReal.ofReal (f i ω) ∂μ) ≤ ENNReal.ofReal C) : + (∀ᵐ ω ∂μ, Summable (fun i => f i ω)) ∧ + Integrable (fun ω => ∑' i, f i ω) μ ∧ + (∫ ω, ∑' i, f i ω ∂μ) ≤ C := by + have hsum_meas : Measurable (fun ω => ∑' i, ENNReal.ofReal (f i ω)) := + Measurable.tsum fun i => (hf i).ennreal_ofReal + have hfinite : (∫⁻ ω, ∑' i, ENNReal.ofReal (f i ω) ∂μ) ≠ ⊤ := + (hbound.trans_lt ENNReal.ofReal_lt_top).ne + have hsummable : ∀ᵐ ω ∂μ, Summable (fun i => f i ω) := by + filter_upwards [ae_lt_top hsum_meas hfinite] with ω hω + have h := ENNReal.summable_toReal hω.ne + simpa only [ENNReal.toReal_ofReal (hf_nonneg _ _)] using h + have hpoint : ∀ ω, ENNReal.ofReal (∑' i, f i ω) ≤ ∑' i, ENNReal.ofReal (f i ω) := by + intro ω + by_cases h : Summable (fun i => f i ω) + · exact (ENNReal.ofReal_tsum_of_nonneg (fun i => hf_nonneg i ω) h).le + · simp [tsum_eq_zero_of_not_summable h] + have hlin : (∫⁻ ω, ENNReal.ofReal (∑' i, f i ω) ∂μ) ≤ ENNReal.ofReal C := + (lintegral_mono hpoint).trans hbound + have hmeas : Measurable (fun ω => ∑' i, f i ω) := Measurable.tsum hf + have hnonneg : ∀ᵐ ω ∂μ, 0 ≤ ∑' i, f i ω := + Filter.Eventually.of_forall fun ω => tsum_nonneg (fun i => hf_nonneg i ω) + have hint : Integrable (fun ω => ∑' i, f i ω) μ := + ⟨hmeas.aestronglyMeasurable, (hasFiniteIntegral_iff_ofReal hnonneg).2 + (hlin.trans_lt ENNReal.ofReal_lt_top)⟩ + refine ⟨hsummable, hint, ?_⟩ + rw [integral_eq_lintegral_of_nonneg_ae hnonneg hmeas.aestronglyMeasurable] + exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top hlin).trans_eq (ENNReal.toReal_ofReal hC) + +theorem integral_tsum_indicator_mul_le_sqrt + {ι : Type*} [MeasurableSpace ι] [MeasurableSingletonClass ι] [Countable ι] + {a b : ι → Ω → ℝ} {H : ι → Set Ω} {δ : ℝ} + (ha : ∀ i, Measurable (a i)) (hb : ∀ i, Measurable (b i)) + (hH : ∀ i, MeasurableSet (H i)) + (ha_nonneg : ∀ i ω, 0 ≤ a i ω) (hb_nonneg : ∀ i ω, 0 ≤ b i ω) + (hδ : 0 ≤ δ) + (ha2 : (∫⁻ ω, ∑' i, ENNReal.ofReal ((H i).indicator + (fun ω => a i ω ^ (2 : ℕ)) ω) ∂μ) ≤ ENNReal.ofReal δ) + (hb2 : (∫⁻ ω, ∑' i, ENNReal.ofReal (b i ω ^ (2 : ℕ)) ∂μ) ≤ 1) : + (∀ᵐ ω ∂μ, Summable (fun i => (H i).indicator (fun ω => a i ω * b i ω) ω)) ∧ + Integrable (fun ω => ∑' i, (H i).indicator (fun ω => a i ω * b i ω) ω) μ ∧ + (∫ ω, ∑' i, (H i).indicator (fun ω => a i ω * b i ω) ω ∂μ) ≤ Real.sqrt δ := by + apply real_tsum_integrable_of_lintegral_bound + (fun i => ((ha i).mul (hb i)).indicator (hH i)) + (fun i ω => Set.indicator_nonneg (fun ω _ => mul_nonneg (ha_nonneg i ω) + (hb_nonneg i ω)) ω) + (Real.sqrt_nonneg δ) + exact lintegral_tsum_ofReal_indicator_mul_le_sqrt ha hb hH ha_nonneg hb_nonneg hδ ha2 hb2 + +end Invariant233.MaskedTail + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/MeasurableCounterexampleEndpoint.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/MeasurableCounterexampleEndpoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..b44c641fbcd65c752661e0fb4023b871d6610a60 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/MeasurableCounterexampleEndpoint.lean @@ -0,0 +1,32 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CircleMeasurableObstruction +import OAI.Analysis.IrrationalRotation.Analysis.ParameterOrbitIdentity +import OAI.Analysis.IrrationalRotation.Rotation.RotationHilbert + +namespace OAI + +noncomputable section +namespace Invariant233 + +theorem measurable_counterexample_proof (θ : ℝ) + (_hθ0 : 0 < θ) (_hθ1 : θ < 1) (hθ : Irrational θ) + (p : CircleParameterData) (hp : CircleParameterLaws θ p) : + p.measurableOperator θ hp ∈ Rotation.algebra θ ∧ + ∀ P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert, + P ∈ Rotation.algebra θ → IsStarProjection P → + 0 < (Rotation.vacuumFunctional P).re → + (Rotation.vacuumFunctional P).re < 1 → + (1 - P) * p.measurableOperator θ hp * P ≠ 0 := by + refine ⟨hp.measurableOperator_mem_algebra, ?_⟩ + intro P hmem hP htrace0 htrace1 hinv + rcases hp.measurableOperator_hasOnlyTrivialInvariantProjections hθ P hmem hP hinv + with hzero | hone + · subst P + simp [Rotation.vacuumFunctional] at htrace0 + · subst P + simp [Rotation.vacuumFunctional_one] at htrace1 + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ModuloIntervalMeasure.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ModuloIntervalMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..29b6ffebced2e14212ba5f3c42e2980adac531b9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ModuloIntervalMeasure.lean @@ -0,0 +1,216 @@ +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic +import Mathlib.MeasureTheory.Function.Floor +import Mathlib.Probability.ConditionalProbability +import Mathlib.Tactic + +namespace OAI + +namespace Invariant233.ModuloIntervalMeasure + +open Set MeasureTheory +open scoped ENNReal + +theorem integral_periodic_le_length_add_one {f : ℝ → ℝ} + (hperiod : Function.Periodic f 1) (hf : ∀ x, 0 ≤ f x) + (hint : IntervalIntegrable f volume 0 1) {a b : ℝ} (hab : a ≤ b) : + (∫ x in a..b, f x) ≤ (b - a + 1) * ∫ x in (0 : ℝ)..1, f x := by + let n : ℕ := ⌈b - a⌉₊ + have hn : b ≤ a + n := by + have := Nat.le_ceil (b - a) + dsimp [n] + linarith + have hn' : (n : ℝ) ≤ b - a + 1 := by + exact (Nat.ceil_lt_add_one (sub_nonneg.mpr hab)).le + have hint' := hperiod.intervalIntegrable₀ (by norm_num : (1 : ℝ) ≠ 0) hint + have hmass : 0 ≤ ∫ x in (0 : ℝ)..1, f x := + intervalIntegral.integral_nonneg_of_forall (by norm_num) hf + calc + (∫ x in a..b, f x) ≤ ∫ x in a..a + n, f x := + intervalIntegral.integral_mono_interval le_rfl hab hn + (Filter.Eventually.of_forall hf) (hint' _ _) + _ = (n : ℝ) * ∫ x in (0 : ℝ)..1, f x := by + have h := hperiod.intervalIntegral_add_zsmul_eq (n : ℤ) a hint' + simpa only [zsmul_eq_mul, Int.cast_natCast, mul_one, + hperiod.intervalIntegral_add_eq a 0, zero_add] using h + _ ≤ (b - a + 1) * ∫ x in (0 : ℝ)..1, f x := + mul_le_mul_of_nonneg_right hn' hmass + +theorem periodic_fract_indicator (s : Set ℝ) : + Function.Periodic ((Int.fract ⁻¹' s).indicator (fun _ => (1 : ℝ))) 1 := by + classical + intro x + change (if Int.fract (x + 1) ∈ s then (1 : ℝ) else 0) = + (if Int.fract x ∈ s then 1 else 0) + rw [Int.fract_add_one] + +theorem intervalIntegrable_indicator_one {s : Set ℝ} (hs : MeasurableSet s) + (a b : ℝ) : IntervalIntegrable (s.indicator (fun _ => (1 : ℝ))) volume a b := by + exact ⟨(integrable_const (1 : ℝ)).indicator hs, + (integrable_const (1 : ℝ)).indicator hs⟩ + +theorem integral_fract_indicator_one_period {s : Set ℝ} (hs : MeasurableSet s) : + (∫ x in (0 : ℝ)..1, (Int.fract ⁻¹' s).indicator (fun _ => (1 : ℝ)) x) = + volume.real (s ∩ Ico 0 1) := by + calc + (∫ x in (0 : ℝ)..1, (Int.fract ⁻¹' s).indicator (fun _ => (1 : ℝ)) x) = + ∫ x in (0 : ℝ)..1, s.indicator (fun _ => (1 : ℝ)) x := by + apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num) + classical + intro x hx + have hfract := Int.fract_eq_self.mpr ⟨hx.1.le, hx.2⟩ + change (if Int.fract x ∈ s then (1 : ℝ) else 0) = + (if x ∈ s then 1 else 0) + rw [hfract] + _ = volume.real (s ∩ Ico 0 1) := by + rw [intervalIntegral.integral_of_le (by norm_num), ← integral_Ico_eq_integral_Ioc, + integral_indicator_const 1 hs, measureReal_restrict_apply hs] + simp + +theorem volume_fract_preimage_inter_Ioc_le {s : Set ℝ} (hs : MeasurableSet s) + {a b : ℝ} (hab : a ≤ b) : + volume.real (Int.fract ⁻¹' s ∩ Ioc a b) ≤ + (b - a + 1) * volume.real (s ∩ Ico 0 1) := by + have hs' : MeasurableSet (Int.fract ⁻¹' s) := hs.preimage measurable_fract + have hnonneg : ∀ x, 0 ≤ (Int.fract ⁻¹' s).indicator (fun _ => (1 : ℝ)) x := by + intro x + exact Set.indicator_nonneg (fun _ _ => zero_le_one) x + have h := integral_periodic_le_length_add_one (periodic_fract_indicator s) hnonneg + (intervalIntegrable_indicator_one hs' 0 1) hab + rw [integral_fract_indicator_one_period hs, intervalIntegral.integral_of_le hab, + integral_indicator_const 1 hs', measureReal_restrict_apply hs'] at h + simpa only [smul_eq_mul, mul_one] using h + +theorem cond_fract_preimage_le {s : Set ℝ} (hs : MeasurableSet s) + {a b : ℝ} (hab : a < b) : + (ProbabilityTheory.cond volume (Ioc a b)).real (Int.fract ⁻¹' s) ≤ + (1 + 1 / (b - a)) * volume.real (s ∩ Ico 0 1) := by + have hr : 0 < b - a := sub_pos.mpr hab + have h := mul_le_mul_of_nonneg_left + (volume_fract_preimage_inter_Ioc_le hs hab.le) (inv_nonneg.mpr hr.le) + rw [ProbabilityTheory.cond, measureReal_ennreal_smul_apply, + measureReal_restrict_apply (hs.preimage measurable_fract), + ENNReal.toReal_inv, Real.volume_Ioc, ENNReal.toReal_ofReal hr.le] + calc + _ ≤ (b - a)⁻¹ * ((b - a + 1) * volume.real (s ∩ Ico 0 1)) := h + _ = (1 + 1 / (b - a)) * volume.real (s ∩ Ico 0 1) := by + rw [← mul_assoc, mul_add, inv_mul_cancel₀ hr.ne', mul_one, one_div] + +theorem threshold_miss_unit_volume_le {w : ℝ} (hw : 0 ≤ w) : + volume.real ({u : ℝ | 1 - u ∉ Icc w (1 - w)} ∩ Ico 0 1) ≤ 2 * w := by + have hsub : {u : ℝ | 1 - u ∉ Icc w (1 - w)} ∩ Ico 0 1 ⊆ + Ico 0 w ∪ Ioo (1 - w) 1 := by + intro u hu + rcases hu with ⟨hbad, hu0, hu1⟩ + by_cases huw : u < w + · exact Or.inl ⟨hu0, huw⟩ + · right + refine ⟨?_, hu1⟩ + by_contra h + apply hbad + constructor <;> linarith + calc + volume.real ({u : ℝ | 1 - u ∉ Icc w (1 - w)} ∩ Ico 0 1) ≤ + volume.real (Ico 0 w ∪ Ioo (1 - w) 1) := measureReal_mono hsub (measure_union_lt_top + (by rw [Real.volume_Ico]; exact ENNReal.ofReal_lt_top) + (by rw [Real.volume_Ioo]; exact ENNReal.ofReal_lt_top)).ne + _ ≤ volume.real (Ico 0 w) + volume.real (Ioo (1 - w) 1) := + measureReal_union_le _ _ + _ = 2 * w := by + rw [Real.volume_real_Ico_of_le hw, Real.volume_real_Ioo_of_le (by linarith)] + ring + +theorem cond_threshold_miss_le {a b w : ℝ} (hlen : (1 : ℝ) / 4 ≤ b - a) + (hw : 0 ≤ w) : + (ProbabilityTheory.cond volume (Ioc a b)).real + {t : ℝ | 1 - Int.fract t ∉ Icc w (1 - w)} ≤ 10 * w := by + have hab : a < b := by linarith + have hs : MeasurableSet {u : ℝ | 1 - u ∉ Icc w (1 - w)} := + (measurableSet_Icc.preimage (measurable_const.sub measurable_id)).compl + have h := cond_fract_preimage_le hs hab + have hr : 0 < b - a := sub_pos.mpr hab + have hfactor : 1 + 1 / (b - a) ≤ 5 := by + have : 1 / (b - a) ≤ 4 := (div_le_iff₀ hr).mpr (by linarith) + linarith + change (ProbabilityTheory.cond volume (Ioc a b)).real (Int.fract ⁻¹' + {u : ℝ | 1 - u ∉ Icc w (1 - w)}) ≤ 10 * w + calc + _ ≤ (1 + 1 / (b - a)) * volume.real + ({u : ℝ | 1 - u ∉ Icc w (1 - w)} ∩ Ico 0 1) := h + _ ≤ 5 * (2 * w) := mul_le_mul hfactor (threshold_miss_unit_volume_le hw) + measureReal_nonneg (by norm_num) + _ = 10 * w := by ring + +theorem cond_Icc_eq_cond_Ioc (a b : ℝ) : + ProbabilityTheory.cond volume (Icc a b) = ProbabilityTheory.cond volume (Ioc a b) := by + simp only [ProbabilityTheory.cond, Real.volume_Icc, Real.volume_Ioc] + rw [Measure.restrict_congr_set (Ioc_ae_eq_Icc (μ := volume)).symm] + +theorem cond_uIcc_mul_preimage (a b k : ℝ) (hk : k ≠ 0) (s : Set ℝ) : + (ProbabilityTheory.cond volume (uIcc a b)).real ((k * ·) ⁻¹' s) = + (ProbabilityTheory.cond volume (uIcc (k * a) (k * b))).real s := by + have hpre : (k * ·) ⁻¹' uIcc (k * a) (k * b) = uIcc a b := by + rw [preimage_const_mul_uIcc hk] + field_simp + have hbase : volume (uIcc a b) = + ENNReal.ofReal |k⁻¹| * volume (uIcc (k * a) (k * b)) := by + rw [← hpre, Real.volume_preimage_mul_left hk] + have hinter : volume (uIcc a b ∩ (k * ·) ⁻¹' s) = + ENNReal.ofReal |k⁻¹| * volume (uIcc (k * a) (k * b) ∩ s) := by + rw [← hpre, ← preimage_inter, Real.volume_preimage_mul_left hk] + simp only [measureReal_def, ProbabilityTheory.cond_apply measurableSet_uIcc, + hbase, hinter, ENNReal.toReal_mul, ENNReal.toReal_inv, + ENNReal.toReal_ofReal (abs_nonneg k⁻¹), mul_inv_rev] + have hscale : |k⁻¹| ≠ 0 := abs_ne_zero.mpr (inv_ne_zero hk) + rw [mul_assoc, ← mul_assoc |k⁻¹|⁻¹, inv_mul_cancel₀ hscale, one_mul] + +theorem cond_uIcc_threshold_miss_le {a b w : ℝ} + (hlen : (1 : ℝ) / 4 ≤ |b - a|) (hw : 0 ≤ w) : + (ProbabilityTheory.cond volume (uIcc a b)).real + {t : ℝ | 1 - Int.fract t ∉ Icc w (1 - w)} ≤ 10 * w := by + rw [uIcc, cond_Icc_eq_cond_Ioc] + apply cond_threshold_miss_le _ hw + simpa only [max_sub_min_eq_abs] using hlen + +theorem uniform_angle_threshold_miss_le {N k w : ℝ} (hN : 0 < N) + (hk : N / 4 ≤ |k|) (hw : 0 ≤ w) : + (ProbabilityTheory.cond volume (Icc (1 / N) (2 / N))).real + {θ : ℝ | 1 - Int.fract (k * θ) ∉ Icc w (1 - w)} ≤ 10 * w := by + have hk0 : k ≠ 0 := by + intro h + simp only [h, abs_zero] at hk + linarith + have hab : (1 : ℝ) / N ≤ 2 / N := by + apply div_le_div_of_nonneg_right (by norm_num) hN.le + rw [← uIcc_of_le hab] + change (ProbabilityTheory.cond volume (uIcc (1 / N) (2 / N))).real + ((k * ·) ⁻¹' {t : ℝ | 1 - Int.fract t ∉ Icc w (1 - w)}) ≤ 10 * w + rw [cond_uIcc_mul_preimage _ _ _ hk0] + apply cond_uIcc_threshold_miss_le _ hw + have hlength : |k * (2 / N) - k * (1 / N)| = |k| / N := by + rw [← mul_sub, ← sub_div, show (2 : ℝ) - 1 = 1 by norm_num, + mul_one_div, abs_div, abs_of_pos hN] + rw [hlength] + exact (le_div_iff₀ hN).mpr (by linarith) + +theorem uniform_angle_isProbabilityMeasure {N : ℝ} (hN : 0 < N) : + IsProbabilityMeasure (ProbabilityTheory.cond volume (Icc (1 / N) (2 / N))) := by + apply ProbabilityTheory.cond_isProbabilityMeasure_of_finite + · rw [Real.volume_Icc] + apply ne_of_gt + apply ENNReal.ofReal_pos.mpr + exact sub_pos.mpr ((div_lt_div_iff_of_pos_right hN).mpr (by norm_num)) + · rw [Real.volume_Icc] + exact ENNReal.ofReal_ne_top + +theorem uniform_angle_threshold_miss_le_ennreal {N k w : ℝ} (hN : 0 < N) + (hk : N / 4 ≤ |k|) (hw : 0 ≤ w) : + (ProbabilityTheory.cond volume (Icc (1 / N) (2 / N))) + {θ : ℝ | 1 - Int.fract (k * θ) ∉ Icc w (1 - w)} ≤ ENNReal.ofReal (10 * w) := by + let := uniform_angle_isProbabilityMeasure hN + have h := ENNReal.ofReal_le_ofReal (uniform_angle_threshold_miss_le hN hk hw) + rw [ofReal_measureReal (measure_ne_top _ _)] at h + exact h + +end Invariant233.ModuloIntervalMeasure + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/MultiplicationPurePoint.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/MultiplicationPurePoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..63e4c33ee2b1e4733ca78b7cfd7458e6c110839a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/MultiplicationPurePoint.lean @@ -0,0 +1,340 @@ +import Mathlib + +namespace OAI + +open Set Filter MeasureTheory + +namespace Invariant233.MultiplicationPurePoint + +variable {X E : Type*} [MeasurableSpace X] {μ : Measure X} +variable [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +theorem topologicalClosure_iSup_eigenspace_eq_top + (f : X → ℂ) (hf : Measurable f) {C : Set ℂ} (hC : C.Countable) + (hmem : ∀ᵐ x ∂μ, f x ∈ C) + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (hT : ∀ v : Lp E 2 μ, (T v : X → E) =ᵐ[μ] fun x => f x • v x) : + (⨆ y : C, Module.End.eigenspace T.toLinearMap y.val).topologicalClosure = ⊤ := by + let : Countable C := hC.to_subtype + rw [Submodule.topologicalClosure_eq_top_iff, Submodule.eq_bot_iff] + intro v hv + have hfiber (y : C) : ∀ᵐ x ∂μ, f x = y.val → v x = 0 := by + let s : Set X := f ⁻¹' {y.val} + have hs : MeasurableSet s := hf (measurableSet_singleton _) + have hvi : MemLp (s.indicator (fun x => v x)) 2 μ := (Lp.memLp v).indicator hs + let w : Lp E 2 μ := MemLp.toLp (s.indicator (fun x => v x)) hvi + have hw : (w : X → E) =ᵐ[μ] s.indicator (fun x => v x) := hvi.coeFn_toLp + have heigen : w ∈ Module.End.eigenspace T.toLinearMap y.val := by + rw [Module.End.mem_eigenspace_iff] + apply Lp.ext + filter_upwards [hT w, Lp.coeFn_smul y.val w, hw] with x hTx hsx hwx + change (T w : X → E) x = (y.val • w : Lp E 2 μ) x + rw [hTx, hsx] + change f x • w x = y.val • w x + by_cases hx : x ∈ s + · have hxy : f x = y.val := hx + rw [hxy] + · have hw0 : w x = 0 := hwx.trans (Set.indicator_of_notMem hx _) + simp only [hw0, smul_zero] + have hinner : inner ℂ w v = 0 := + (Submodule.mem_orthogonal _ _).1 hv w (Submodule.mem_iSup_of_mem y heigen) + have hself : inner ℂ w w = inner ℂ w v := by + rw [L2.inner_def, L2.inner_def] + apply integral_congr_ae + filter_upwards [hw] with x hwx + by_cases hx : x ∈ s + · have hwv : w x = v x := hwx.trans (Set.indicator_of_mem hx _) + rw [hwv] + · have hw0 : w x = 0 := hwx.trans (Set.indicator_of_notMem hx _) + simp only [hw0, inner_zero_left] + have hw_eq_zero : w = 0 := inner_self_eq_zero.1 (hself.trans hinner) + have hwzero : (w : X → E) =ᵐ[μ] 0 := by + rw [hw_eq_zero] + exact Lp.coeFn_zero E 2 μ + filter_upwards [hw, hwzero] with x hwx hz hx + have hxs : x ∈ s := hx + exact (hwx.trans (Set.indicator_of_mem hxs _)).symm.trans hz + have hall : ∀ᵐ x ∂μ, ∀ y : C, f x = y.val → v x = 0 := ae_all_iff.2 hfiber + apply Lp.ext + filter_upwards [hmem, hall, Lp.coeFn_zero E 2 μ] with x hx hall hz + exact (hall ⟨f x, hx⟩ rfl).trans hz.symm + +theorem topologicalClosure_iSup_eigenspace_eq_top_of_basis + {ι : Type*} [Countable ι] (b : HilbertBasis ι ℂ E) + (f : ι → X → ℂ) (hf : ∀ i, Measurable (f i)) + {C : Set ℂ} (hC : C.Countable) + (hmem : ∀ i, ∀ᵐ x ∂μ, f i x ∈ C) + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (hT : ∀ (v : Lp E 2 μ) i, ∀ᵐ x ∂μ, + inner ℂ (b i) (T v x) = f i x * inner ℂ (b i) (v x)) : + (⨆ y : C, Module.End.eigenspace T.toLinearMap y.val).topologicalClosure = ⊤ := by + let : Countable C := hC.to_subtype + rw [Submodule.topologicalClosure_eq_top_iff, Submodule.eq_bot_iff] + intro v hv + have hfiber (i : ι) (y : C) : + ∀ᵐ x ∂μ, f i x = y.val → inner ℂ (b i) (v x) = 0 := by + let s : Set X := f i ⁻¹' {y.val} + have hs : MeasurableSet s := hf i (measurableSet_singleton _) + let P : E →L[ℂ] E := InnerProductSpace.rankOne ℂ (b i) (b i) + have hvp : MemLp (fun x => inner ℂ (b i) (v x) • b i) 2 μ := P.comp_memLp v + have hvi : MemLp (s.indicator (fun x => inner ℂ (b i) (v x) • b i)) 2 μ := + hvp.indicator hs + let w : Lp E 2 μ := + MemLp.toLp (s.indicator (fun x => inner ℂ (b i) (v x) • b i)) hvi + have hw : (w : X → E) =ᵐ[μ] s.indicator (fun x => inner ℂ (b i) (v x) • b i) := + hvi.coeFn_toLp + have heigen : w ∈ Module.End.eigenspace T.toLinearMap y.val := by + rw [Module.End.mem_eigenspace_iff] + apply Lp.ext + have hTall : ∀ᵐ x ∂μ, ∀ j, inner ℂ (b j) (T w x) = + f j x * inner ℂ (b j) (w x) := ae_all_iff.2 (hT w) + filter_upwards [hTall, Lp.coeFn_smul y.val w, hw] with x hTx hsx hwx + change (T w : X → E) x = (y.val • w : Lp E 2 μ) x + rw [hsx] + apply b.repr.injective + ext j + rw [b.repr_apply_apply, b.repr_apply_apply, hTx j] + change f j x * inner ℂ (b j) (w x) = inner ℂ (b j) (y.val • w x) + rw [inner_smul_right] + by_cases hx : x ∈ s + · have hwv : w x = inner ℂ (b i) (v x) • b i := + hwx.trans (Set.indicator_of_mem hx _) + by_cases hji : j = i + · subst j + have hxy : f i x = y.val := hx + rw [hxy] + · rw [hwv, inner_smul_right, b.orthonormal.inner_eq_zero hji] + simp only [mul_zero] + · have hw0 : w x = 0 := hwx.trans (Set.indicator_of_notMem hx _) + simp only [hw0, inner_zero_right, mul_zero] + have hinner : inner ℂ w v = 0 := + (Submodule.mem_orthogonal _ _).1 hv w (Submodule.mem_iSup_of_mem y heigen) + have hself : inner ℂ w w = inner ℂ w v := by + rw [L2.inner_def, L2.inner_def] + apply integral_congr_ae + filter_upwards [hw] with x hwx + by_cases hx : x ∈ s + · have hwv : w x = inner ℂ (b i) (v x) • b i := + hwx.trans (Set.indicator_of_mem hx _) + rw [hwv, inner_smul_left, inner_smul_right, inner_smul_left] + rw [inner_self_eq_norm_sq_to_K, b.orthonormal.norm_eq_one] + norm_num + · have hw0 : w x = 0 := hwx.trans (Set.indicator_of_notMem hx _) + simp only [hw0, inner_zero_left] + have hw_eq_zero : w = 0 := inner_self_eq_zero.1 (hself.trans hinner) + have hwzero : (w : X → E) =ᵐ[μ] 0 := by + rw [hw_eq_zero] + exact Lp.coeFn_zero E 2 μ + filter_upwards [hw, hwzero] with x hwx hz hx + have hxs : x ∈ s := hx + have hsmul : inner ℂ (b i) (v x) • b i = 0 := + (hwx.trans (Set.indicator_of_mem hxs _)).symm.trans hz + have hnorm : b i ≠ 0 := by + intro hzero + have := b.orthonormal.norm_eq_one i + simp only [hzero, norm_zero, zero_ne_one] at this + exact (smul_eq_zero.1 hsmul).resolve_right hnorm + have hall : ∀ᵐ x ∂μ, ∀ (i : ι) (y : C), f i x = y.val → inner ℂ (b i) (v x) = 0 := + ae_all_iff.2 (fun i => ae_all_iff.2 (hfiber i)) + have hmemall : ∀ᵐ x ∂μ, ∀ i, f i x ∈ C := ae_all_iff.2 hmem + apply Lp.ext + filter_upwards [hmemall, hall, Lp.coeFn_zero E 2 μ] with x hx hall hz + rw [hz] + apply b.repr.injective + ext i + rw [b.repr_apply_apply, b.repr_apply_apply] + change inner ℂ (b i) (v x) = inner ℂ (b i) 0 + rw [inner_zero_right] + exact hall i ⟨f i x, hx i⟩ rfl + +theorem topologicalClosure_iSup_jointEigenspace_eq_top_of_basis + {ι J : Type*} [Countable ι] [Countable J] (b : HilbertBasis ι ℂ E) + (f : ι → X → J → ℂ) (hf : ∀ i, Measurable (f i)) + {C : Set (J → ℂ)} (hC : C.Countable) + (hmem : ∀ i, ∀ᵐ x ∂μ, f i x ∈ C) + (T : J → Lp E 2 μ →L[ℂ] Lp E 2 μ) + (hT : ∀ (j : J) (v : Lp E 2 μ) i, ∀ᵐ x ∂μ, + inner ℂ (b i) (T j v x) = f i x j * inner ℂ (b i) (v x)) : + (⨆ y : C, ⨅ j : J, Module.End.eigenspace (T j).toLinearMap (y.val j)).topologicalClosure = ⊤ := by + let : Countable C := hC.to_subtype + rw [Submodule.topologicalClosure_eq_top_iff, Submodule.eq_bot_iff] + intro v hv + have hfiber (i : ι) (y : C) : + ∀ᵐ x ∂μ, f i x = y.val → inner ℂ (b i) (v x) = 0 := by + let s : Set X := f i ⁻¹' {y.val} + have hs : MeasurableSet s := hf i (measurableSet_singleton _) + let P : E →L[ℂ] E := InnerProductSpace.rankOne ℂ (b i) (b i) + have hvp : MemLp (fun x => inner ℂ (b i) (v x) • b i) 2 μ := P.comp_memLp v + have hvi : MemLp (s.indicator (fun x => inner ℂ (b i) (v x) • b i)) 2 μ := + hvp.indicator hs + let w : Lp E 2 μ := + MemLp.toLp (s.indicator (fun x => inner ℂ (b i) (v x) • b i)) hvi + have hw : (w : X → E) =ᵐ[μ] s.indicator (fun x => inner ℂ (b i) (v x) • b i) := + hvi.coeFn_toLp + have heigen : w ∈ ⨅ j : J, Module.End.eigenspace (T j).toLinearMap (y.val j) := by + rw [Submodule.mem_iInf] + intro j + rw [Module.End.mem_eigenspace_iff] + apply Lp.ext + have hTall : ∀ᵐ x ∂μ, ∀ k, inner ℂ (b k) (T j w x) = + f k x j * inner ℂ (b k) (w x) := ae_all_iff.2 (hT j w) + filter_upwards [hTall, Lp.coeFn_smul (y.val j) w, hw] with x hTx hsx hwx + change (T j w : X → E) x = (y.val j • w : Lp E 2 μ) x + rw [hsx] + apply b.repr.injective + ext k + rw [b.repr_apply_apply, b.repr_apply_apply, hTx k] + change f k x j * inner ℂ (b k) (w x) = inner ℂ (b k) (y.val j • w x) + rw [inner_smul_right] + by_cases hx : x ∈ s + · have hwv : w x = inner ℂ (b i) (v x) • b i := + hwx.trans (Set.indicator_of_mem hx _) + by_cases hki : k = i + · subst k + have hxy : f i x = y.val := hx + rw [hxy] + · rw [hwv, inner_smul_right, b.orthonormal.inner_eq_zero hki] + simp only [mul_zero] + · have hw0 : w x = 0 := hwx.trans (Set.indicator_of_notMem hx _) + simp only [hw0, inner_zero_right, mul_zero] + have hinner : inner ℂ w v = 0 := + (Submodule.mem_orthogonal _ _).1 hv w (Submodule.mem_iSup_of_mem y heigen) + have hself : inner ℂ w w = inner ℂ w v := by + rw [L2.inner_def, L2.inner_def] + apply integral_congr_ae + filter_upwards [hw] with x hwx + by_cases hx : x ∈ s + · have hwv : w x = inner ℂ (b i) (v x) • b i := + hwx.trans (Set.indicator_of_mem hx _) + rw [hwv, inner_smul_left, inner_smul_right, inner_smul_left] + rw [inner_self_eq_norm_sq_to_K, b.orthonormal.norm_eq_one] + norm_num + · have hw0 : w x = 0 := hwx.trans (Set.indicator_of_notMem hx _) + simp only [hw0, inner_zero_left] + have hw_eq_zero : w = 0 := inner_self_eq_zero.1 (hself.trans hinner) + have hwzero : (w : X → E) =ᵐ[μ] 0 := by + rw [hw_eq_zero] + exact Lp.coeFn_zero E 2 μ + filter_upwards [hw, hwzero] with x hwx hz hx + have hxs : x ∈ s := hx + have hsmul : inner ℂ (b i) (v x) • b i = 0 := + (hwx.trans (Set.indicator_of_mem hxs _)).symm.trans hz + have hnorm : b i ≠ 0 := by + intro hzero + have := b.orthonormal.norm_eq_one i + simp only [hzero, norm_zero, zero_ne_one] at this + exact (smul_eq_zero.1 hsmul).resolve_right hnorm + have hall : ∀ᵐ x ∂μ, ∀ (i : ι) (y : C), f i x = y.val → inner ℂ (b i) (v x) = 0 := + ae_all_iff.2 (fun i => ae_all_iff.2 (hfiber i)) + have hmemall : ∀ᵐ x ∂μ, ∀ i, f i x ∈ C := ae_all_iff.2 hmem + apply Lp.ext + filter_upwards [hmemall, hall, Lp.coeFn_zero E 2 μ] with x hx hall hz + rw [hz] + apply b.repr.injective + ext i + rw [b.repr_apply_apply, b.repr_apply_apply] + change inner ℂ (b i) (v x) = inner ℂ (b i) 0 + rw [inner_zero_right] + exact hall i ⟨f i x, hx i⟩ rfl + +theorem topologicalClosure_iSup_jointEigenspace_eq_top_of_sequence + {ι J : Type*} [Countable ι] [Countable J] + (f : ι → X → J → ℂ) (hf : ∀ i, Measurable (f i)) + {C : Set (J → ℂ)} (hC : C.Countable) + (hmem : ∀ i, ∀ᵐ x ∂μ, f i x ∈ C) + (T : J → Lp (lp (fun _ : ι => ℂ) 2) 2 μ →L[ℂ] + Lp (lp (fun _ : ι => ℂ) 2) 2 μ) + (hT : ∀ j (v : Lp (lp (fun _ : ι => ℂ) 2) 2 μ) i, + ∀ᵐ x ∂μ, T j v x i = f i x j * v x i) : + (⨆ y : C, ⨅ j : J, Module.End.eigenspace (T j).toLinearMap (y.val j)).topologicalClosure = ⊤ := by + let b : HilbertBasis ι ℂ (lp (fun _ : ι => ℂ) 2) := + HilbertBasis.ofRepr (LinearIsometryEquiv.refl ℂ _) + have hb (v : lp (fun _ : ι => ℂ) 2) (i : ι) : inner ℂ (b i) v = v i := + (b.repr_apply_apply v i).symm + apply topologicalClosure_iSup_jointEigenspace_eq_top_of_basis b f hf hC hmem T + intro j v i + simpa only [hb] using hT j v i + +theorem finite_orbit_family_dense_jointEigenspaces + {J : Type*} [Finite J] (n : J → ℤ) + (σ : ℤ → X → X) (hσ : ∀ k, MeasurePreserving (σ k) μ μ) + (f : X → ℂ) (hf : Measurable f) + (hcount : ∃ C : Set ℂ, C.Countable ∧ ∀ᵐ x ∂μ, f x ∈ C) + (T : J → Lp (lp (fun _ : ℤ => ℂ) 2) 2 μ →L[ℂ] + Lp (lp (fun _ : ℤ => ℂ) 2) 2 μ) + (hT : ∀ j (v : Lp (lp (fun _ : ℤ => ℂ) 2) 2 μ) k, + ∀ᵐ x ∂μ, T j v x k = f (σ (k - n j) x) * v x k) : + ∃ C : Set (J → ℂ), C.Countable ∧ + (⨆ y : C, ⨅ j : J, Module.End.eigenspace (T j).toLinearMap (y.val j)).topologicalClosure = ⊤ := by + obtain ⟨C, hC, hmem⟩ := hcount + let R : Set (J → ℂ) := {g | ∀ j, g j ∈ C} + have hR : R.Countable := Set.countable_pi (fun _ => hC) + refine ⟨R, hR, ?_⟩ + apply topologicalClosure_iSup_jointEigenspace_eq_top_of_sequence + (fun k x j => f (σ (k - n j) x)) _ hR _ T hT + · intro k + exact Measurable.of_eval (fun j => hf.comp (hσ (k - n j)).measurable) + · intro k + exact ae_all_iff.2 (fun j => (hσ (k - n j)).quasiMeasurePreserving.ae hmem) + +theorem topologicalClosure_iSup_jointEigenspace_eq_top_of_sequence_real + {ι J : Type*} [Countable ι] [Countable J] + (f : ι → X → J → ℝ) (hf : ∀ i, Measurable (f i)) + {C : Set (J → ℝ)} (hC : C.Countable) + (hmem : ∀ i, ∀ᵐ x ∂μ, f i x ∈ C) + (T : J → Lp (lp (fun _ : ι => ℂ) 2) 2 μ →L[ℂ] + Lp (lp (fun _ : ι => ℂ) 2) 2 μ) + (hT : ∀ j (v : Lp (lp (fun _ : ι => ℂ) 2) 2 μ) i, + ∀ᵐ x ∂μ, T j v x i = (f i x j : ℂ) * v x i) : + (⨆ y : C, ⨅ j : J, + Module.End.eigenspace (T j).toLinearMap (y.val j : ℂ)).topologicalClosure = ⊤ := by + let e : (J → ℝ) → (J → ℂ) := fun r j => (r j : ℂ) + let D : Set (J → ℂ) := e '' C + have hD : D.Countable := hC.image e + have hdense : (⨆ y : D, ⨅ j : J, + Module.End.eigenspace (T j).toLinearMap (y.val j)).topologicalClosure = ⊤ := by + apply topologicalClosure_iSup_jointEigenspace_eq_top_of_sequence + (fun i x j => (f i x j : ℂ)) _ hD _ T hT + · intro i + exact Measurable.of_eval + (fun j => ((measurable_pi_apply j).comp (hf i)).complex_ofReal) + · intro i + filter_upwards [hmem i] with x hx + exact ⟨f i x, hx, rfl⟩ + apply top_le_iff.1 + rw [← hdense] + apply Submodule.topologicalClosure_mono + apply iSup_le + intro y + obtain ⟨r, hr, he⟩ := y.property + have he' : y.val = e r := he.symm + simpa only [he', e] using + (le_iSup (fun z : C => ⨅ j : J, + Module.End.eigenspace (T j).toLinearMap (z.val j : ℂ)) ⟨r, hr⟩) + +theorem finite_orbit_family_dense_jointEigenspaces_real + {J : Type*} [Finite J] (n : J → ℤ) + (σ : ℤ → X → X) (hσ : ∀ k, MeasurePreserving (σ k) μ μ) + (f : X → ℝ) (hf : Measurable f) + (hcount : ∃ C : Set ℝ, C.Countable ∧ ∀ᵐ x ∂μ, f x ∈ C) + (T : J → Lp (lp (fun _ : ℤ => ℂ) 2) 2 μ →L[ℂ] + Lp (lp (fun _ : ℤ => ℂ) 2) 2 μ) + (hT : ∀ j (v : Lp (lp (fun _ : ℤ => ℂ) 2) 2 μ) k, + ∀ᵐ x ∂μ, T j v x k = (f (σ (k - n j) x) : ℂ) * v x k) : + ∃ C : Set (J → ℝ), C.Countable ∧ + (⨆ y : C, ⨅ j : J, + Module.End.eigenspace (T j).toLinearMap (y.val j : ℂ)).topologicalClosure = ⊤ := by + obtain ⟨C, hC, hmem⟩ := hcount + let R : Set (J → ℝ) := {g | ∀ j, g j ∈ C} + have hR : R.Countable := Set.countable_pi (fun _ => hC) + refine ⟨R, hR, ?_⟩ + apply topologicalClosure_iSup_jointEigenspace_eq_top_of_sequence_real + (fun k x j => f (σ (k - n j) x)) _ hR _ T hT + · intro k + exact Measurable.of_eval (fun j => hf.comp (hσ (k - n j)).measurable) + · intro k + exact ae_all_iff.2 (fun j => (hσ (k - n j)).quasiMeasurePreserving.ae hmem) + +end Invariant233.MultiplicationPurePoint + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/NestedReturnSegments.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/NestedReturnSegments.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe3bd15da621eb8c35a6b742925a830f701a228f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/NestedReturnSegments.lean @@ -0,0 +1,110 @@ +import Mathlib.Data.Nat.Find +import Mathlib.Logic.Function.Iterate +import Lean.Elab.Tactic.Omega + +namespace OAI + +namespace Invariant233.NestedReturnSegments + +variable {X : Type*} (f : X → X) {A B : Set X} {x : X} + +theorem return_segment_fits {r h H : ℕ} (hr : r < H) + (hH : f^[H] x ∈ A) + (havoid : ∀ t : ℕ, 0 < t → t < h → f^[t] (f^[r] x) ∉ A) : + r + h ≤ H := by + by_contra hbad + have hpos : 0 < H - r := Nat.sub_pos_of_lt hr + have hsmall : H - r < h := by omega + have hnot := havoid (H - r) hpos hsmall + apply hnot + rw [← Function.iterate_add_apply, Nat.sub_add_cancel (Nat.le_of_lt hr)] + exact hH + +theorem nested_return_segment_fits {r h H : ℕ} (hBA : B ⊆ A) (hr : r < H) + (hH : f^[H] x ∈ B) + (havoid : ∀ t : ℕ, 0 < t → t < h → f^[t] (f^[r] x) ∉ A) : + r + h ≤ H := + return_segment_fits f hr (hBA hH) havoid + +theorem exists_contained_first_return_segment {H k : ℕ} + (hx : x ∈ A) (hH : f^[H] x ∈ A) (hk : k < H) : + ∃ r h : ℕ, r ≤ k ∧ k < r + h ∧ r + h ≤ H ∧ + f^[r] x ∈ A ∧ 0 < h ∧ f^[h] (f^[r] x) ∈ A ∧ + ∀ t : ℕ, 0 < t → t < h → f^[t] (f^[r] x) ∉ A := by + classical + let P : ℕ → Prop := fun r => f^[r] x ∈ A + let r := Nat.findGreatest P k + have hr : r ≤ k := Nat.findGreatest_le k + have hrA : f^[r] x ∈ A := + Nat.findGreatest_spec (P := P) (Nat.zero_le k) (by simpa [P] using hx) + have hrH : r < H := by omega + have hpos : 0 < H - r := Nat.sub_pos_of_lt hrH + have hend : f^[H - r] (f^[r] x) ∈ A := by + rw [← Function.iterate_add_apply, Nat.sub_add_cancel (Nat.le_of_lt hrH)] + exact hH + have hex : ∃ h : ℕ, 0 < h ∧ f^[h] (f^[r] x) ∈ A := + ⟨H - r, hpos, hend⟩ + let h := Nat.find hex + have hh : 0 < h ∧ f^[h] (f^[r] x) ∈ A := Nat.find_spec hex + have hbound : h ≤ H - r := Nat.find_min' hex ⟨hpos, hend⟩ + have hcover : k < r + h := by + by_contra hbad + have hle : r + h ≤ k := by omega + have hlt : r < r + h := by omega + have hnot : ¬P (r + h) := Nat.findGreatest_is_greatest hlt hle + apply hnot + dsimp [P] + rw [Nat.add_comm, Function.iterate_add_apply] + exact hh.2 + refine ⟨r, h, hr, hcover, by omega, hrA, hh.1, hh.2, ?_⟩ + intro t ht hth hmem + exact Nat.find_min hex hth ⟨ht, hmem⟩ + +theorem exists_nested_first_return_segment {H k : ℕ} + (hBA : B ⊆ A) (hx : x ∈ B) (hH : f^[H] x ∈ B) (hk : k < H) : + ∃ r h : ℕ, r ≤ k ∧ k < r + h ∧ r + h ≤ H ∧ + f^[r] x ∈ A ∧ 0 < h ∧ f^[h] (f^[r] x) ∈ A ∧ + ∀ t : ℕ, 0 < t → t < h → f^[t] (f^[r] x) ∉ A := + exists_contained_first_return_segment f (hBA hx) (hBA hH) hk + +theorem first_return_time_unique {y : X} {h j : ℕ} + (hh : 0 < h) (hj : 0 < j) + (hhA : f^[h] y ∈ A) (hjA : f^[j] y ∈ A) + (havoid : ∀ t : ℕ, 0 < t → t < h → f^[t] y ∉ A) + (javoid : ∀ t : ℕ, 0 < t → t < j → f^[t] y ∉ A) : h = j := by + apply Nat.le_antisymm + · by_contra hbad + exact havoid j hj (by omega) hjA + · by_contra hbad + exact javoid h hh (by omega) hhA + +theorem first_return_segment_start_unique {r h s j k : ℕ} + (hr : r ≤ k) (hrk : k < r + h) (hs : s ≤ k) (hsk : k < s + j) + (hrA : f^[r] x ∈ A) (hsA : f^[s] x ∈ A) + (havoid : ∀ t : ℕ, 0 < t → t < h → f^[t] (f^[r] x) ∉ A) + (javoid : ∀ t : ℕ, 0 < t → t < j → f^[t] (f^[s] x) ∉ A) : + r = s := by + apply Nat.le_antisymm + · by_contra hbad + have hsr : s < r := by omega + have hfit := return_segment_fits f hsr hrA javoid + omega + · by_contra hbad + have hrs : r < s := by omega + have hfit := return_segment_fits f hrs hsA havoid + omega + +theorem first_return_segment_unique {r h s j k : ℕ} + (hr : r ≤ k) (hrk : k < r + h) (hs : s ≤ k) (hsk : k < s + j) + (hrA : f^[r] x ∈ A) (hsA : f^[s] x ∈ A) + (hhA : f^[h] (f^[r] x) ∈ A) (hjA : f^[j] (f^[s] x) ∈ A) + (havoid : ∀ t : ℕ, 0 < t → t < h → f^[t] (f^[r] x) ∉ A) + (javoid : ∀ t : ℕ, 0 < t → t < j → f^[t] (f^[s] x) ∉ A) : + r = s ∧ h = j := by + have hrs := first_return_segment_start_unique f hr hrk hs hsk hrA hsA havoid javoid + subst s + exact ⟨rfl, first_return_time_unique f (by omega) (by omega) hhA hjA havoid javoid⟩ + +end Invariant233.NestedReturnSegments + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/NestedTowerRefinement.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/NestedTowerRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb99959cbd5ed71d842c705ee2dc32f8460dddca --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/NestedTowerRefinement.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.IrrationalRotation.Analysis.NestedReturnSegments +import Mathlib.MeasureTheory.MeasurableSpace.Basic +import Mathlib.Data.Set.Image + +namespace OAI + +namespace Invariant233.NestedTowerRefinement + +variable {X ι : Type*} (f : X → X) + +def piece (C D : Set X) (r : ℕ) : Set X := D ∩ (f^[r]) ⁻¹' C + +theorem cell_eq_iUnion_pieces (C : Set X) (B : ι → Set X) (height : ι → ℕ) + (hcover : ∀ y : X, ∃ i, ∃ r : Fin (height i), y ∈ (f^[r.val]) '' B i) : + C = ⋃ i, ⋃ r : Fin (height i), (f^[r.val]) '' piece f C (B i) r.val := by + apply Set.ext + intro y + simp only [Set.mem_iUnion, Set.mem_image] + constructor + · intro hy + obtain ⟨i, r, z, hz, rfl⟩ := hcover y + exact ⟨i, r, z, ⟨hz, hy⟩, rfl⟩ + · rintro ⟨i, r, z, hz, rfl⟩ + exact hz.2 + +theorem image_piece_subset (C D : Set X) (r : ℕ) : + (f^[r]) '' piece f C D r ⊆ (f^[r]) '' D := + Set.image_mono Set.inter_subset_left + +theorem disjoint_image_pieces {C₁ C₂ D₁ D₂ : Set X} {r s : ℕ} + (hd : Disjoint ((f^[r]) '' D₁) ((f^[s]) '' D₂)) : + Disjoint ((f^[r]) '' piece f C₁ D₁ r) ((f^[s]) '' piece f C₂ D₂ s) := + hd.mono (image_piece_subset f C₁ D₁ r) (image_piece_subset f C₂ D₂ s) + +theorem height_le_of_piece_nonempty {A C D : Set X} {r h H : ℕ} + (hr : r < H) (hend : ∀ z ∈ D, f^[H] z ∈ A) + (havoid : ∀ y ∈ C, ∀ t : ℕ, 0 < t → t < h → f^[t] y ∉ A) + (hne : (piece f C D r).Nonempty) : r + h ≤ H := by + obtain ⟨z, hzD, hzC⟩ := hne + exact NestedReturnSegments.return_segment_fits f hr (hend z hzD) + (havoid (f^[r] z) hzC) + +theorem piece_eq_empty_of_height_lt {A C D : Set X} {r h H : ℕ} + (hr : r < H) (hend : ∀ z ∈ D, f^[H] z ∈ A) + (havoid : ∀ y ∈ C, ∀ t : ℕ, 0 < t → t < h → f^[t] y ∉ A) + (hbad : H < r + h) : piece f C D r = ∅ := by + apply Set.eq_empty_iff_forall_notMem.mpr + intro z hz + have hle := height_le_of_piece_nonempty f hr hend havoid ⟨z, hz⟩ + omega + +theorem cell_eq_iUnion_fitting_pieces (A C : Set X) (B : ι → Set X) + (height : ι → ℕ) (h : ℕ) + (hcover : ∀ y : X, ∃ i, ∃ r : Fin (height i), y ∈ (f^[r.val]) '' B i) + (hend : ∀ i z, z ∈ B i → f^[height i] z ∈ A) + (havoid : ∀ y ∈ C, ∀ t : ℕ, 0 < t → t < h → f^[t] y ∉ A) : + C = ⋃ i, ⋃ r : Fin (height i), ⋃ (_ : r.val + h ≤ height i), + (f^[r.val]) '' piece f C (B i) r.val := by + apply Set.ext + intro y + simp only [Set.mem_iUnion, Set.mem_image] + constructor + · intro hy + obtain ⟨i, r, z, hz, rfl⟩ := hcover y + have hfit : r.val + h ≤ height i := + height_le_of_piece_nonempty f r.isLt (hend i) havoid ⟨z, hz, hy⟩ + exact ⟨i, r, hfit, z, ⟨hz, hy⟩, rfl⟩ + · rintro ⟨i, r, hfit, z, hz, rfl⟩ + exact hz.2 + +theorem measurableSet_piece [MeasurableSpace X] (hf : Measurable f) + {C D : Set X} (hC : MeasurableSet C) (hD : MeasurableSet D) (r : ℕ) : + MeasurableSet (piece f C D r) := + hD.inter (hC.preimage (hf.iterate r)) + +end Invariant233.NestedTowerRefinement + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/NonnegativeCostIntegral.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/NonnegativeCostIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..5650ed00c0f14ecfd3e39a5e730ae91c4448117b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/NonnegativeCostIntegral.lean @@ -0,0 +1,74 @@ +import Mathlib.MeasureTheory.Integral.Lebesgue.Add +import Mathlib.Topology.Algebra.InfiniteSum.ENNReal + +namespace OAI + +open Filter MeasureTheory +open scoped ENNReal + +namespace Invariant233 + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem ae_summable_of_eventually_zero_off_point (u : ℕ → X → ℝ) + (a : X) (ha : μ {a} = 0) + (hfinite : ∀ x ≠ a, ∃ N : ℕ, ∀ n ≥ N, u n x = 0) : + ∀ᵐ x ∂μ, Summable (fun n => u n x) := by + have hne : ∀ᵐ x ∂μ, x ≠ a := by + simpa only [ae_iff, not_not, Set.ofPred_eq_eq_singleton] using ha + filter_upwards [hne] with x hx + obtain ⟨N, hN⟩ := hfinite x hx + apply summable_of_ne_finset_zero (s := Finset.range N) + intro n hn + exact hN n (Nat.le_of_not_gt (by simpa using hn)) + +theorem lintegral_ofReal_tsum_nonnegative (u : ℕ → X → ℝ) + (hm : ∀ n, Measurable (u n)) (hu : ∀ n x, 0 ≤ u n x) + (hs : ∀ᵐ x ∂μ, Summable (fun n => u n x)) : + (∫⁻ x, ENNReal.ofReal (∑' n, u n x) ∂μ) = + ∑' n, ∫⁻ x, ENNReal.ofReal (u n x) ∂μ := by + calc + (∫⁻ x, ENNReal.ofReal (∑' n, u n x) ∂μ) = + ∫⁻ x, ∑' n, ENNReal.ofReal (u n x) ∂μ := by + apply lintegral_congr_ae + filter_upwards [hs] with x hx + exact ENNReal.ofReal_tsum_of_nonneg (fun n => hu n x) hx + _ = _ := lintegral_tsum (fun n => (hm n).ennreal_ofReal.aemeasurable) + +theorem lintegral_tsum_eq_top_of_block_lower_bound (u : ℕ → X → ℝ) + (hm : ∀ n, Measurable (u n)) (hu : ∀ n x, 0 ≤ u n x) + (hs : ∀ᵐ x ∂μ, Summable (fun n => u n x)) + (c : ℝ≥0∞) (hc : c ≠ 0) + (hblock : ∀ n, c ≤ ∫⁻ x, ENNReal.ofReal (u n x) ∂μ) : + (∫⁻ x, ENNReal.ofReal (∑' n, u n x) ∂μ) = ∞ := by + rw [lintegral_ofReal_tsum_nonnegative u hm hu hs] + apply top_unique + calc + ∞ = ∑' _ : ℕ, c := (ENNReal.tsum_const_eq_top_of_ne_zero hc).symm + _ ≤ _ := ENNReal.tsum_le_tsum hblock + +theorem lintegral_cost_add_background_eq_top (g b : X → ℝ) + (hg : (∫⁻ x, ENNReal.ofReal (g x) ∂μ) = ∞) + (hb : ∀ᵐ x ∂μ, 0 ≤ b x) : + (∫⁻ x, ENNReal.ofReal (b x + g x) ∂μ) = ∞ := by + apply top_unique + rw [← hg] + apply lintegral_mono_ae + filter_upwards [hb] with x hx + exact ENNReal.ofReal_le_ofReal (le_add_of_nonneg_left hx) + +theorem lintegral_relocated_background_eq_top + (u : ℕ → X → ℝ) (b : X → ℝ) (a : X) (ha : μ {a} = 0) + (hm : ∀ n, Measurable (u n)) (hu : ∀ n x, 0 ≤ u n x) + (hfinite : ∀ x ≠ a, ∃ N : ℕ, ∀ n ≥ N, u n x = 0) + (hb : ∀ᵐ x ∂μ, 0 ≤ b x) + (c : ℝ≥0∞) (hc : c ≠ 0) + (hblock : ∀ n, c ≤ ∫⁻ x, ENNReal.ofReal (u n x) ∂μ) : + (∫⁻ x, ENNReal.ofReal (b x + ∑' n, u n x) ∂μ) = ∞ := by + apply lintegral_cost_add_background_eq_top _ b _ hb + exact lintegral_tsum_eq_top_of_block_lower_bound u hm hu + (ae_summable_of_eventually_zero_off_point u a ha hfinite) c hc hblock + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ObservationConditioning.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ObservationConditioning.lean new file mode 100644 index 0000000000000000000000000000000000000000..f2dcf23c46f5edc55ae86da45c85c1a3fd3d6161 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ObservationConditioning.lean @@ -0,0 +1,123 @@ +import Mathlib.Probability.Kernel.CondDistrib +import Mathlib.Probability.Independence.Conditional + +namespace OAI + +open MeasureTheory ProbabilityTheory +open scoped BigOperators + +namespace Invariant233.ObservationConditioning + +variable {Ω A B : Type*} [MeasurableSpace Ω] + {mA : MeasurableSpace A} {mB : MeasurableSpace B} + +theorem condExp_comap_congr_ae (μ : Measure Ω) [IsFiniteMeasure μ] + {X X' : Ω → A} (hX : Measurable X) (hX' : Measurable X') + (hXX' : X =ᵐ[μ] X') (f : Ω → ℝ) : + μ[f | mA.comap X] =ᵐ[μ] μ[f | mA.comap X'] := by + by_cases hf : Integrable f μ + · have hkernel : condDistrib f X μ = condDistrib f X' μ := + condDistrib_congr_right hXX' + filter_upwards [condExp_ae_eq_integral_condDistrib' hX hf, + condExp_ae_eq_integral_condDistrib' hX' hf, hXX'] with ω h₁ h₂ hω + rw [h₁, h₂, hkernel, hω] + · simp only [condExp_of_not_integrable hf] + rfl + +theorem comap_eq_of_measurable_leftInverse {r : B → A} {q : A → B} + (hr : Measurable r) (hq : Measurable q) (hqr : Function.LeftInverse q r) : + mA.comap r = mB := by + apply le_antisymm hr.comap_le + intro s hs + refine ⟨q ⁻¹' s, hq hs, ?_⟩ + ext b + change q (r b) ∈ s ↔ b ∈ s + rw [hqr b] + +theorem condExp_comap_of_ae_section (μ : Measure Ω) [IsFiniteMeasure μ] + {X : Ω → A} {Y : Ω → B} (hX : Measurable X) (hY : Measurable Y) + {r : B → A} {q : A → B} (hr : Measurable r) (hq : Measurable q) + (hqr : Function.LeftInverse q r) (hrep : (r ∘ Y) =ᵐ[μ] X) + (f : Ω → ℝ) : + μ[f | mA.comap X] =ᵐ[μ] μ[f | mB.comap Y] := by + have h := condExp_comap_congr_ae μ hX (hr.comp hY) hrep.symm f + have heq : mA.comap (r ∘ Y) = mB.comap Y := by + rw [← MeasurableSpace.comap_comp, + comap_eq_of_measurable_leftInverse hr hq hqr] + simpa only [heq] using h + +theorem iCondIndepSet_comap_iff_of_ae_section {ι : Type*} [Countable ι] + [StandardBorelSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] + {X : Ω → A} {Y : Ω → B} (hX : Measurable X) (hY : Measurable Y) + {r : B → A} {q : A → B} (hr : Measurable r) (hq : Measurable q) + (hqr : Function.LeftInverse q r) (hrep : (r ∘ Y) =ᵐ[μ] X) + (events : ι → Set Ω) (hmeas : ∀ i, MeasurableSet (events i)) : + iCondIndepSet (mA.comap X) hX.comap_le events μ ↔ + iCondIndepSet (mB.comap Y) hY.comap_le events μ := by + have hsingle : ∀ᵐ ω ∂μ, ∀ i, + (μ[(events i).indicator (fun _ => (1 : ℝ)) | mA.comap X]) ω = + (μ[(events i).indicator (fun _ => (1 : ℝ)) | mB.comap Y]) ω := + ae_all_iff.mpr (fun i => condExp_comap_of_ae_section μ hX hY hr hq hqr hrep _) + rw [iCondIndepSet_iff _ _ events hmeas μ, + iCondIndepSet_iff _ _ events hmeas μ] + constructor + · intro h S + filter_upwards [h S, hsingle, + condExp_comap_of_ae_section μ hX hY hr hq hqr hrep + ((⋂ i ∈ S, events i).indicator (fun _ => (1 : ℝ)))] with ω hω hs hi + rw [← hi, hω] + simp only [Finset.prod_apply] + exact Finset.prod_congr rfl (fun i _ => hs i) + · intro h S + filter_upwards [h S, hsingle, + condExp_comap_of_ae_section μ hX hY hr hq hqr hrep + ((⋂ i ∈ S, events i).indicator (fun _ => (1 : ℝ)))] with ω hω hs hi + rw [hi, hω] + simp only [Finset.prod_apply] + exact Finset.prod_congr rfl (fun i _ => (hs i).symm) + +omit [MeasurableSpace Ω] in + +theorem iCondIndepSet_iff_of_events_ae_eq {ι : Type*} [Countable ι] + (m : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω] + (hm : m ≤ mΩ) (μ : Measure Ω) [IsFiniteMeasure μ] + (events events' : ι → Set Ω) + (hmeas : ∀ i, MeasurableSet (events i)) + (hmeas' : ∀ i, MeasurableSet (events' i)) + (heq : ∀ i, events i =ᵐ[μ] events' i) : + iCondIndepSet m hm events μ ↔ iCondIndepSet m hm events' μ := by + have hsingle : ∀ᵐ ω ∂μ, ∀ i, + (μ[(events i).indicator (fun _ => (1 : ℝ)) | m]) ω = + (μ[(events' i).indicator (fun _ => (1 : ℝ)) | m]) ω := + ae_all_iff.mpr (fun i => condExp_congr_ae (indicator_ae_eq_of_ae_eq_set (heq i))) + have hinter (S : Finset ι) : (⋂ i ∈ S, events i) =ᵐ[μ] (⋂ i ∈ S, events' i) := by + filter_upwards [ae_all_iff.mpr heq] with ω hω + change (ω ∈ ⋂ i ∈ S, events i) = (ω ∈ ⋂ i ∈ S, events' i) + apply propext + simp only [Set.mem_iInter] + constructor <;> intro h i hi + · exact (hω i).mp (h i hi) + · exact (hω i).mpr (h i hi) + rw [iCondIndepSet_iff _ _ events hmeas μ, + iCondIndepSet_iff _ _ events' hmeas' μ] + constructor + · intro h S + filter_upwards [h S, hsingle, + condExp_congr_ae (m := m) + (indicator_ae_eq_of_ae_eq_set (f := fun _ => (1 : ℝ)) (hinter S))] + with ω hω hs hi + rw [← hi, hω] + simp only [Finset.prod_apply] + exact Finset.prod_congr rfl (fun i _ => hs i) + · intro h S + filter_upwards [h S, hsingle, + condExp_congr_ae (m := m) + (indicator_ae_eq_of_ae_eq_set (f := fun _ => (1 : ℝ)) (hinter S))] + with ω hω hs hi + rw [hi, hω] + simp only [Finset.prod_apply] + exact Finset.prod_congr rfl (fun i _ => (hs i).symm) + +end Invariant233.ObservationConditioning + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/OmittedEvents.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/OmittedEvents.lean new file mode 100644 index 0000000000000000000000000000000000000000..23e1d08e59a330222ab2a0a79170d6cfca060124 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/OmittedEvents.lean @@ -0,0 +1,79 @@ +import OAI.Analysis.IrrationalRotation.Model.ConditionalConvolution +import OAI.Analysis.IrrationalRotation.Model.LaurentConvolution +import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic +import Mathlib + +namespace OAI + +noncomputable section + +namespace InvariantProjection.ConditionalConvolution + +open MeasureTheory + +@[simp] theorem mem_window_iff (K n : ℕ) (v : ℤ) : + v ∈ window K n ↔ |v| ≤ (K : ℤ) ∧ |(n : ℤ) + v| ≤ (K : ℤ) := by + simp only [window, Finset.mem_filter, Finset.mem_Icc, abs_le] + +theorem selector_outside (K n : ℕ) (v : ℤ) (hv : v ∉ window K n) : + (K : ℤ) < |selector K n v| := by + unfold selector + split_ifs with h + · exact h + · have hv' := mt (mem_window_iff K n v).mpr hv + push Not at hv' + exact hv' (le_of_not_gt h) + +theorem truncated_eq_convolution (K n : ℕ) (A B : ℤ → ℂ) : + truncated K n A B = Invariant233.FiniteWindow.convolution K A B n := rfl + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] + +theorem measurableSet_omittedEvent (H : ℤ → Set Ω) (K n : ℕ) + (hH : ∀ k : ℤ, (K : ℤ) < |k| → MeasurableSet (H k)) (v : ℤ) : + MeasurableSet (omittedEvent H K n v) := by + unfold omittedEvent + split_ifs with hv + · exact MeasurableSet.empty + · exact hH _ (selector_outside K n v hv) + +theorem measurableSet_omittedMask (H : ℤ → Set Ω) (K n : ℕ) + (hH : ∀ k : ℤ, (K : ℤ) < |k| → MeasurableSet (H k)) : + MeasurableSet {z : Ω × ℤ | z.1 ∈ omittedEvent H K n z.2} := by + have he : {z : Ω × ℤ | z.1 ∈ omittedEvent H K n z.2} = + ⋃ v : ℤ, (omittedEvent H K n v) ×ˢ ({v} : Set ℤ) := by + ext z + simp + rw [he] + exact MeasurableSet.iUnion (fun v => + (measurableSet_omittedEvent H K n hH v).prod (measurableSet_singleton v)) + +theorem condExp_omittedEvent_le (μ : Measure Ω) (m : MeasurableSpace Ω) + (H : ℤ → Set Ω) (K n : ℕ) {δ : ℝ} (hδ : 0 ≤ δ) + (hH : ∀ k : ℤ, (K : ℤ) < |k| → + μ[(H k).indicator (fun _ => (1 : ℝ)) | m] ≤ᵐ[μ] fun _ => δ) : + ∀ v : ℤ, μ[(omittedEvent H K n v).indicator (fun _ => (1 : ℝ)) | m] + ≤ᵐ[μ] fun _ => δ := by + intro v + by_cases hv : v ∈ window K n + · simp only [omittedEvent, ite_eq_left hv, Set.indicator_empty] + change μ[(0 : Ω → ℝ) | m] ≤ᵐ[μ] fun _ => δ + rw [condExp_zero] + exact Filter.Eventually.of_forall (fun _ => hδ) + · simpa only [omittedEvent, ite_eq_right hv] using hH _ (selector_outside K n v hv) + +theorem condExp_omittedMask_section_le (μ : Measure Ω) (m : MeasurableSpace Ω) + (H : ℤ → Set Ω) (K n : ℕ) {δ : ℝ} (hδ : 0 ≤ δ) + (hH : ∀ k : ℤ, (K : ℤ) < |k| → + μ[(H k).indicator (fun _ => (1 : ℝ)) | m] ≤ᵐ[μ] fun _ => δ) : + ∀ v : ℤ, + μ[({ω | (ω, v) ∈ {z : Ω × ℤ | z.1 ∈ omittedEvent H K n z.2}}).indicator + (fun _ => (1 : ℝ)) | m] ≤ᵐ[μ] fun _ => δ := by + let : MeasurableSpace Ω := mΩ + exact condExp_omittedEvent_le (mΩ := mΩ) μ m H K n hδ hH + +end InvariantProjection.ConditionalConvolution + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitFiberNull.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitFiberNull.lean new file mode 100644 index 0000000000000000000000000000000000000000..192b83822dea5f3c37bad8e2e5c6866eec372d24 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitFiberNull.lean @@ -0,0 +1,82 @@ +import OAI.Analysis.IrrationalRotation.Analysis.OrbitMeasurable +import OAI.Analysis.IrrationalRotation.Spectral.PolarStructure + +namespace OAI + +open Set Filter Function MeasureTheory + +namespace Invariant233 + +variable {X Y : Type*} [m : MeasurableSpace X] [MeasurableSpace Y] + [Nonempty Y] [MeasurableSpace.CountablySeparated Y] [MeasurableSingletonClass Y] + {μ : Measure X} [IsFiniteMeasure μ] + +theorem orbit_joint_fiber_measure_zero + (σ : Equiv.Perm X) (hσ : Measurable σ) (hinv : Measurable σ.symm) + (htotal : ∀ n : ℕ, 0 < n → Ergodic (σ : X → X)^[n] μ) + {f : X → Y} (hf : Measurable f) + (hnonconstant : ¬ ∃ c : Y, f =ᵐ[μ] Function.const X c) + (z : ℤ → Y) : + μ {x | ∀ n : ℤ, f ((σ ^ n) x) = z n} = 0 := by + let F : X → (ℤ → Y) := fun x n => f ((σ ^ n) x) + have hspace : MeasurableSpace.comap F inferInstance = orbitMeasurableSpace σ f := by + exact MeasurableSpace.comap_process_pi (fun n x => f ((σ ^ n) x)) + have hs : @MeasurableSet X (orbitMeasurableSpace σ f) (F ⁻¹' {z}) := by + rw [← hspace] + exact ⟨{z}, measurableSet_singleton z, rfl⟩ + have hnull : μ (F ⁻¹' {z}) = 0 := by + by_contra hpos + obtain ⟨t, ht, hsub, htpos, hdiff⟩ := + orbitMeasurableSpace_atomless σ hσ hinv htotal hf hnonconstant hs hpos + have ht' : MeasurableSet[MeasurableSpace.comap F inferInstance] t := by + rwa [hspace] + rcases InvariantProjection.PolarStructure.fiber_is_atom_in_comap F z ht' hsub with + hzero | hfull + · exact htpos (by simp [hzero]) + · exact hdiff (by simp [hfull]) + have heq : {x | ∀ n : ℤ, f ((σ ^ n) x) = z n} = F ⁻¹' {z} := by + ext x + exact (funext_iff : F x = z ↔ ∀ n, F x n = z n).symm + rwa [heq] + +theorem orbit_joint_fiber_measure_zero_of_negInfiniteLogIntegral + (σ : Equiv.Perm X) (hσ : Measurable σ) (hinv : Measurable σ.symm) + (htotal : ∀ n : ℕ, 0 < n → Ergodic (σ : X → X)^[n] μ) + {f : X → ℝ} (hf : Measurable f) + (hnonzero : ∀ᵐ x ∂μ, f x ≠ 0) (hlog : HasNegInfiniteLogIntegral μ f) + (z : ℤ → ℝ) : + μ {x | ∀ n : ℤ, f ((σ ^ n) x) = z n} = 0 := + orbit_joint_fiber_measure_zero σ hσ hinv htotal hf + (not_ae_constant_of_negInfiniteLogIntegral hnonzero hlog) z + +omit [IsFiniteMeasure μ] in + +theorem ae_zero_of_null_joint_fibers + {I E : Type*} [Countable I] [AddCommGroup E] [Module ℂ E] + {g : I → X → ℂ} + (hnull : ∀ z : I → ℂ, μ {x | ∀ i, g i x = z i} = 0) + {v : X → E} (z : I → ℂ) + (hv : ∀ i, ∀ᵐ x ∂μ, g i x • v x = z i • v x) : + v =ᵐ[μ] 0 := by + have havoid := measure_eq_zero_iff_ae_notMem.mp (hnull z) + filter_upwards [ae_all_iff.mpr hv, havoid] with x hx hnot + by_contra hne + apply hnot + intro i + exact smul_left_injective ℂ hne (hx i) + +theorem ae_zero_of_orbit_joint_eigenrelation + {E : Type*} [AddCommGroup E] [Module ℂ E] + (σ : Equiv.Perm X) (hσ : Measurable σ) (hinv : Measurable σ.symm) + (htotal : ∀ n : ℕ, 0 < n → Ergodic (σ : X → X)^[n] μ) + {f : X → ℂ} (hf : Measurable f) + (hnonconstant : ¬ ∃ c : ℂ, f =ᵐ[μ] Function.const X c) + {v : X → E} (z : ℤ → ℂ) + (hv : ∀ n, ∀ᵐ x ∂μ, f ((σ ^ n) x) • v x = z n • v x) : + v =ᵐ[μ] 0 := + ae_zero_of_null_joint_fibers + (orbit_joint_fiber_measure_zero σ hσ hinv htotal hf hnonconstant) z hv + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitFibersNull.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitFibersNull.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6f419dc8eb4da464ecdc2be7eff4bcdad59e2c0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitFibersNull.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.IrrationalRotation.Analysis.OrbitMeasurable + +namespace OAI + +open Set Filter Function MeasureTheory + +namespace Invariant233 + +variable {X Y : Type*} [m : MeasurableSpace X] [mY : MeasurableSpace Y] + +omit m in + +theorem orbitMeasurableSpace_eq_comap_tuple (σ : Equiv.Perm X) (f : X → Y) : + orbitMeasurableSpace σ f = + MeasurableSpace.comap (fun x => fun n : ℤ => f ((σ ^ n) x)) inferInstance := by + exact (MeasurableSpace.comap_process_pi (fun n x => f ((σ ^ n) x))).symm + +theorem measure_orbit_fiber_eq_zero + [Nonempty Y] [MeasurableSpace.CountablySeparated Y] [MeasurableSingletonClass Y] + {μ : Measure X} [IsFiniteMeasure μ] + (σ : Equiv.Perm X) (hσ : Measurable σ) (hinv : Measurable σ.symm) + (htotal : ∀ n : ℕ, 0 < n → Ergodic (σ : X → X)^[n] μ) + {f : X → Y} (hf : Measurable f) + (hnonconstant : ¬ ∃ c : Y, f =ᵐ[μ] Function.const X c) + (v : ℤ → Y) : + μ {x | ∀ n : ℤ, f ((σ ^ n) x) = v n} = 0 := by + let F : X → ℤ → Y := fun x n => f ((σ ^ n) x) + let s : Set X := F ⁻¹' {v} + have hs : @MeasurableSet X (orbitMeasurableSpace σ f) s := by + rw [orbitMeasurableSpace_eq_comap_tuple] + exact ⟨{v}, measurableSet_singleton v, rfl⟩ + have hzero : μ s = 0 := by + by_contra hpos + obtain ⟨t, ht, hts, htpos, hdiff⟩ := + orbitMeasurableSpace_atomless σ hσ hinv htotal hf hnonconstant hs hpos + rw [orbitMeasurableSpace_eq_comap_tuple] at ht + obtain ⟨B, _hB, rfl⟩ := MeasurableSpace.measurableSet_comap.mp ht + by_cases hv : v ∈ B + · have hst : s ⊆ F ⁻¹' B := by + intro x hx + change F x = v at hx + change F x ∈ B + rwa [hx] + exact hdiff (by rw [Set.sdiff_eq_empty.mpr hst, measure_empty]) + · have hempty : F ⁻¹' B = ∅ := by + apply Set.eq_empty_iff_forall_notMem.mpr + intro x hx + have hxv : F x = v := hts hx + exact hv (hxv ▸ hx) + exact htpos (by rw [hempty, measure_empty]) + have heq : {x | ∀ n : ℤ, f ((σ ^ n) x) = v n} = s := by + ext x + simp only [s, F, Set.mem_ofPred_eq, Set.mem_preimage, Set.mem_singleton_iff, + funext_iff] + rwa [heq] + +theorem measure_orbit_fiber_eq_zero_of_negInfiniteLogIntegral + {μ : Measure X} [IsFiniteMeasure μ] + (σ : Equiv.Perm X) (hσ : Measurable σ) (hinv : Measurable σ.symm) + (htotal : ∀ n : ℕ, 0 < n → Ergodic (σ : X → X)^[n] μ) + {f : X → ℝ} (hf : Measurable f) + (hnonzero : ∀ᵐ x ∂μ, f x ≠ 0) (hlog : HasNegInfiniteLogIntegral μ f) + (v : ℤ → ℝ) : + μ {x | ∀ n : ℤ, f ((σ ^ n) x) = v n} = 0 := + measure_orbit_fiber_eq_zero σ hσ hinv htotal hf + (not_ae_constant_of_negInfiniteLogIntegral hnonzero hlog) v + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitInvariance.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitInvariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e1b14b012e6c37f2a3baa4bad13f66160644af0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitInvariance.lean @@ -0,0 +1,150 @@ +import Mathlib.Algebra.Group.Idempotent +import Mathlib.Algebra.Algebra.Basic +import Mathlib.Analysis.Normed.Operator.Basic +import Mathlib.Tactic + +namespace OAI + +namespace Invariant233.OrbitInvariance + +section Ring +variable {A : Type*} [Ring A] {p T : A} + +theorem invariant_iff_compression : + (1 - p) * T * p = 0 ↔ p * T * p = T * p := by + rw [sub_mul, one_mul, sub_mul] + exact sub_eq_zero.trans eq_comm + +theorem invariant_pow (hp : IsIdempotentElem p) + (hT : (1 - p) * T * p = 0) (n : ℕ) : + (1 - p) * T ^ n * p = 0 := by + have hTp : p * T * p = T * p := invariant_iff_compression.mp hT + apply invariant_iff_compression.mpr + induction n with + | zero => simpa using hp.eq + | succ n ih => + calc + p * T ^ (n + 1) * p = p * T ^ n * (T * p) := by rw [pow_succ]; simp [mul_assoc] + _ = p * T ^ n * (p * T * p) := by rw [hTp] + _ = (p * T ^ n * p) * T * p := by simp [mul_assoc] + _ = (T ^ n * p) * T * p := by rw [ih] + _ = T ^ n * (p * T * p) := by simp [mul_assoc] + _ = T ^ n * (T * p) := by rw [hTp] + _ = T ^ (n + 1) * p := by rw [pow_succ]; simp [mul_assoc] + +theorem orbit_inclusion (W : Aˣ) (D : A) + (h : (1 - p) * ((W : A) * D) * p = 0) : + (1 - (↑(W⁻¹) * p * (W : A))) * D * p = 0 := by + have heq : ↑(W⁻¹) * ((1 - p) * ((W : A) * D) * p) = + (1 - (↑(W⁻¹) * p * (W : A))) * D * p := by + simp only [mul_sub, sub_mul, one_mul, mul_assoc] + simp + rw [← heq, h, mul_zero] + +theorem orbit_inclusion_pow (hp : IsIdempotentElem p) + (hT : (1 - p) * T * p = 0) (n : ℕ) (W : Aˣ) (D : A) + (hfactor : T ^ n = (W : A) * D) : + (1 - (↑(W⁻¹) * p * (W : A))) * D * p = 0 := by + apply orbit_inclusion W D + rw [← hfactor] + exact invariant_pow hp hT n + +theorem endpoint_inclusion_pow {q D : A} (hq : IsIdempotentElem q) + (hT : (1 - q) * T * q = 0) (hD : (1 - q) * D * p = 0) (n : ℕ) : + (1 - q) * T ^ n * D * p = 0 := by + have hD' : q * (D * p) = D * p := by + rw [sub_mul, one_mul, sub_mul, sub_eq_zero] at hD + simpa only [mul_assoc] using hD.symm + calc + (1 - q) * T ^ n * D * p = ((1 - q) * T ^ n) * (D * p) := by + simp only [mul_assoc] + _ = ((1 - q) * T ^ n) * (q * (D * p)) := by rw [hD'] + _ = ((1 - q) * T ^ n * q) * (D * p) := by simp only [mul_assoc] + _ = 0 := by rw [invariant_pow hq hT n, zero_mul] + +end Ring + +section Algebra +variable {𝕜 A : Type*} [Field 𝕜] [Ring A] [Algebra 𝕜 A] {p T : A} + +theorem invariant_smul_iff {c : 𝕜} (hc : c ≠ 0) : + (1 - p) * (c • T) * p = 0 ↔ (1 - p) * T * p = 0 := by + rw [mul_smul_comm, smul_mul_assoc, smul_eq_zero] + exact or_iff_right hc + +theorem orbit_inclusion_normalized (W : Aˣ) (D : A) {c : 𝕜} + (h : (1 - p) * ((W : A) * D) * p = 0) : + (1 - (↑(W⁻¹) * p * (W : A))) * (c⁻¹ • D) * p = 0 := by + rw [mul_smul_comm, smul_mul_assoc, orbit_inclusion W D h, smul_zero] + +end Algebra + +section WeightedPowers +variable {B A : Type*} [CommRing B] [Ring A] +variable (π : B →+* A) (σ : B →+* B) (U : A) +variable (hcov : ∀ b : B, π b * U = U * π (σ b)) +include hcov + +theorem covariance_pow (b : B) (n : ℕ) : + π b * U ^ n = U ^ n * π ((σ : B → B)^[n] b) := by + induction n with + | zero => simp + | succ n ih => + calc + π b * U ^ (n + 1) = (π b * U ^ n) * U := by rw [pow_succ, mul_assoc] + _ = (U ^ n * π ((σ : B → B)^[n] b)) * U := by rw [ih] + _ = U ^ n * (π ((σ : B → B)^[n] b) * U) := by rw [mul_assoc] + _ = U ^ n * (U * π (σ ((σ : B → B)^[n] b))) := by rw [hcov] + _ = U ^ (n + 1) * π ((σ : B → B)^[n + 1] b) := by + rw [pow_succ, Function.iterate_succ_apply', mul_assoc] + +theorem weighted_pow (f : B) (n : ℕ) : + (U * π f) ^ n = U ^ n * π (∏ k ∈ Finset.range n, (σ : B → B)^[k] f) := by + induction n with + | zero => simp + | succ n ih => + rw [pow_succ', ih] + calc + U * π f * (U ^ n * π (∏ k ∈ Finset.range n, (σ : B → B)^[k] f)) = + U * (π f * U ^ n) * π (∏ k ∈ Finset.range n, (σ : B → B)^[k] f) := by + simp only [mul_assoc] + _ = U * (U ^ n * π ((σ : B → B)^[n] f)) * + π (∏ k ∈ Finset.range n, (σ : B → B)^[k] f) := by + rw [covariance_pow π σ U hcov f n] + _ = U ^ (n + 1) * π ((σ : B → B)^[n] f * + ∏ k ∈ Finset.range n, (σ : B → B)^[k] f) := by + rw [map_mul, pow_succ']; simp only [mul_assoc] + _ = U ^ (n + 1) * π (∏ k ∈ Finset.range (n + 1), (σ : B → B)^[k] f) := by + rw [Finset.prod_range_succ, mul_comm ((σ : B → B)^[n] f)] + +end WeightedPowers + +variable {𝕜 E : Type*} [NontriviallyNormedField 𝕜] +variable [NormedAddCommGroup E] [NormedSpace 𝕜 E] +variable {p T : E →L[𝕜] E} + +theorem invariant_iff_mapsTo_range (hp : IsIdempotentElem p) : + (1 - p) * T * p = 0 ↔ Set.MapsTo T (p.range : Set E) (p.range : Set E) := by + rw [invariant_iff_compression] + constructor + · intro h x hx + rcases hx with ⟨y, rfl⟩ + refine ⟨T (p y), ?_⟩ + exact congrArg (fun A : E →L[𝕜] E => A y) h + · intro h + ext x + rcases h (show p x ∈ p.range from ⟨x, rfl⟩) with ⟨y, hy⟩ + change p (T (p x)) = T (p x) + rw [← hy] + exact congrArg (fun A : E →L[𝕜] E => A y) hp.eq + +theorem mapsTo_range_pow (hp : IsIdempotentElem p) + (hT : Set.MapsTo T (p.range : Set E) (p.range : Set E)) (n : ℕ) : + Set.MapsTo (T ^ n) (p.range : Set E) (p.range : Set E) := by + exact (invariant_iff_mapsTo_range hp).mp + (invariant_pow hp ((invariant_iff_mapsTo_range hp).mpr hT) n) + + +end Invariant233.OrbitInvariance + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitMeasurable.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitMeasurable.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5a995bd2a5f61431afd2298adc3b92d955547b4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitMeasurable.lean @@ -0,0 +1,143 @@ +import OAI.Analysis.IrrationalRotation.Model.OrbitMeasurable +import OAI.Analysis.IrrationalRotation.Model.Analytic +import OAI.Analysis.IrrationalRotation.Analysis.ErgodicAtoms +import Mathlib.Dynamics.Ergodic.Function +import Mathlib.Analysis.SpecialFunctions.Log.Basic +import Mathlib.MeasureTheory.Integral.Lebesgue.Basic + +namespace OAI + +open Set Filter Function MeasureTheory +open scoped ENNReal + +namespace Invariant233 + +variable {X Y : Type*} [m : MeasurableSpace X] [mY : MeasurableSpace Y] + +omit m in + +theorem measurable_orbit_observable (σ : Equiv.Perm X) (f : X → Y) (n : ℤ) : + @Measurable X Y (orbitMeasurableSpace σ f) mY (fun x => f ((σ ^ n) x)) := + Measurable.of_comap_le (le_iSup (fun n : ℤ => + MeasurableSpace.comap (fun x => f ((σ ^ n) x)) mY) n) + +omit m in + +theorem measurable_base_observable (σ : Equiv.Perm X) (f : X → Y) : + @Measurable X Y (orbitMeasurableSpace σ f) mY f := by + simpa using measurable_orbit_observable σ f 0 + +theorem measurable_perm_zpow (σ : Equiv.Perm X) + (hσ : Measurable σ) (hinv : Measurable σ.symm) (n : ℤ) : + Measurable (σ ^ n) := by + cases n with + | ofNat n => simpa [Equiv.Perm.coe_pow] using hσ.iterate n + | negSucc n => + simpa [zpow_negSucc, ← inv_pow, Equiv.Perm.coe_pow] using hinv.iterate (n + 1) + +theorem orbitMeasurableSpace_le (σ : Equiv.Perm X) {f : X → Y} + (hσ : Measurable σ) (hinv : Measurable σ.symm) (hf : Measurable f) : + orbitMeasurableSpace σ f ≤ m := by + apply iSup_le + intro n + exact (hf.comp (measurable_perm_zpow σ hσ hinv n)).comap_le + +omit m in + +theorem measurable_perm_zpow_orbit (σ : Equiv.Perm X) (f : X → Y) (k : ℤ) : + @Measurable X X (orbitMeasurableSpace σ f) (orbitMeasurableSpace σ f) ((σ ^ k : Equiv.Perm X) : X → X) := by + apply Measurable.of_comap_le + unfold orbitMeasurableSpace + rw [MeasurableSpace.comap_iSup] + apply iSup_le + intro n + rw [MeasurableSpace.comap_comp] + have heq : (fun x => f ((σ ^ n) x)) ∘ (σ ^ k) = + fun x => f ((σ ^ (n + k)) x) := by + funext x + simp only [comp_apply, zpow_add, Equiv.Perm.mul_apply] + rw [heq] + exact le_iSup (fun n : ℤ => + MeasurableSpace.comap (fun x => f ((σ ^ n) x)) mY) (n + k) + +theorem exists_nontrivial_set_of_not_ae_constant + [Nonempty Y] [MeasurableSpace.CountablySeparated Y] + {μ : Measure X} (m₀ : MeasurableSpace X) {f : X → Y} + (hf : @Measurable X Y m₀ mY f) + (hnonconstant : ¬ ∃ c : Y, f =ᵐ[μ] Function.const X c) : + ∃ s : Set X, @MeasurableSet X m₀ s ∧ μ s ≠ 0 ∧ μ sᶜ ≠ 0 := by + let : MeasurableSpace X := m + by_contra hsets + apply hnonconstant + refine Filter.exists_eventuallyEq_const_of_forall_separating MeasurableSet ?_ + intro U hU + have hpre : @MeasurableSet X m₀ (f ⁻¹' U) := hf hU + by_cases hz : μ (f ⁻¹' U) = 0 + · right + exact eventuallyEqSet_empty.mp (ae_eq_empty.mpr hz) + · left + have hc : μ (f ⁻¹' U)ᶜ = 0 := by + by_contra hc + exact hsets ⟨f ⁻¹' U, hpre, hz, hc⟩ + exact eventuallyEqSet_univ.mp (ae_eq_univ.mpr hc) + +theorem orbitMeasurableSpace_atomless + [Nonempty Y] [MeasurableSpace.CountablySeparated Y] + {μ : Measure X} [IsFiniteMeasure μ] + (σ : Equiv.Perm X) (hσ : Measurable σ) (hinv : Measurable σ.symm) + (htotal : ∀ n : ℕ, 0 < n → Ergodic (σ : X → X)^[n] μ) + {f : X → Y} (hf : Measurable f) + (hnonconstant : ¬ ∃ c : Y, f =ᵐ[μ] Function.const X c) + {s : Set X} (hs : @MeasurableSet X (orbitMeasurableSpace σ f) s) + (hpos : μ s ≠ 0) : + ∃ t : Set X, @MeasurableSet X (orbitMeasurableSpace σ f) t ∧ + t ⊆ s ∧ μ t ≠ 0 ∧ μ (s \ t) ≠ 0 := by + apply ErgodicAtoms.exists_nontrivial_measurable_subset htotal + (orbitMeasurableSpace σ f) (orbitMeasurableSpace_le σ hσ hinv hf) ?_ ?_ hs hpos + · simpa using measurable_perm_zpow_orbit σ f 1 + · exact exists_nontrivial_set_of_not_ae_constant (orbitMeasurableSpace σ f) + (measurable_base_observable σ f) hnonconstant + +theorem not_ae_constant_of_infinite_log_cost + {μ : Measure X} [IsFiniteMeasure μ] {f : X → ℝ} + (hlog : (∫⁻ x, ENNReal.ofReal (-Real.log (f x)) ∂μ) = ∞) : + ¬ ∃ c : ℝ, f =ᵐ[μ] Function.const X c := by + rintro ⟨c, hc⟩ + have hcost : (fun x => ENNReal.ofReal (-Real.log (f x))) =ᵐ[μ] + fun _ => ENNReal.ofReal (-Real.log c) := by + filter_upwards [hc] with x hx + simp only [hx, Function.const_apply] + have hfinite : (∫⁻ x, ENNReal.ofReal (-Real.log (f x)) ∂μ) ≠ ∞ := by + rw [lintegral_congr_ae hcost, lintegral_const] + exact ENNReal.mul_ne_top ENNReal.ofReal_ne_top (measure_ne_top μ Set.univ) + exact hfinite hlog + +theorem not_ae_constant_of_negInfiniteLogIntegral + {μ : Measure X} [IsFiniteMeasure μ] {f : X → ℝ} + (hnonzero : ∀ᵐ x ∂μ, f x ≠ 0) + (hlog : HasNegInfiniteLogIntegral μ f) : + ¬ ∃ c : ℝ, f =ᵐ[μ] Function.const X c := by + apply not_ae_constant_of_infinite_log_cost + change (∫⁻ x, negLogCost (f x) ∂μ) = ∞ at hlog + have hphase : (fun x => negLogCost (f x)) =ᵐ[μ] + fun x => ENNReal.ofReal (-Real.log (f x)) := by + filter_upwards [hnonzero] with x hx + simp only [negLogCost, ite_eq_right hx, Real.log_abs] + rwa [lintegral_congr_ae hphase] at hlog + +theorem orbitMeasurableSpace_atomless_of_negInfiniteLogIntegral + {μ : Measure X} [IsFiniteMeasure μ] + (σ : Equiv.Perm X) (hσ : Measurable σ) (hinv : Measurable σ.symm) + (htotal : ∀ n : ℕ, 0 < n → Ergodic (σ : X → X)^[n] μ) + {f : X → ℝ} (hf : Measurable f) + (hnonzero : ∀ᵐ x ∂μ, f x ≠ 0) (hlog : HasNegInfiniteLogIntegral μ f) + {s : Set X} (hs : @MeasurableSet X (orbitMeasurableSpace σ f) s) + (hpos : μ s ≠ 0) : + ∃ t : Set X, @MeasurableSet X (orbitMeasurableSpace σ f) t ∧ + t ⊆ s ∧ μ t ≠ 0 ∧ μ (s \ t) ≠ 0 := by + exact orbitMeasurableSpace_atomless σ hσ hinv htotal hf + (not_ae_constant_of_negInfiniteLogIntegral hnonzero hlog) hs hpos + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitPartition.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..291e5a3b6c4cbd33e5112884c11c2486db764b95 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrbitPartition.lean @@ -0,0 +1,109 @@ +import Mathlib +import OAI.Analysis.IrrationalRotation.Sampling.PrescribedPhaseRealization + +namespace OAI + +namespace Invariant233 + +open Set Function + +theorem exists_finite_partition_of_nat_open_cover + {X : Type*} [TopologicalSpace X] [CompactSpace X] [T2Space X] + (U : ℕ → Set X) (hUopen : ∀ n, IsOpen (U n)) + (hcover : ∀ x, ∃ n, x ∈ U n) : + ∃ H : ℕ, ∃ φ : ℕ → C(X, ℝ), + (∀ n x, 0 ≤ φ n x) ∧ + (∀ x, ∑ n ∈ Finset.range (H + 1), φ n x = 1) ∧ + (∀ n, tsupport (φ n) ⊆ U n) ∧ + (∀ n, H < n → φ n = 0) := by + classical + obtain ⟨φ, hφsub⟩ := PartitionOfUnity.exists_isSubordinate isClosed_univ U hUopen + (by intro x _; simpa only [mem_iUnion] using hcover x) + have hfinite : {n | (support (φ n)).Nonempty}.Finite := + φ.locallyFinite.finite_nonempty_of_compact + let S := hfinite.toFinset + let H := S.sup id + have hindex : ∀ n x, φ n x ≠ 0 → n ≤ H := by + intro n x hx + apply Finset.le_sup (f := id) + exact hfinite.mem_toFinset.mpr ⟨x, hx⟩ + refine ⟨H, fun n => φ n, φ.nonneg, ?_, hφsub, ?_⟩ + · intro x + rw [← finsum_eq_sum_of_support_subset (fun n => φ n x)] + · exact φ.sum_eq_one (mem_univ x) + · intro n hn + exact Finset.mem_range.mpr (Nat.lt_succ_iff.mpr (hindex n x hn)) + · intro n hn + ext x + by_contra hx + exact (not_le_of_gt hn) (hindex n x hx) + +theorem exists_finite_orbit_partition + {X : Type*} [TopologicalSpace X] [CompactSpace X] [T2Space X] + (σ : X → X) (hσ : Continuous σ) + (hdense : ∀ x, DenseRange (fun n : ℕ => σ^[n] x)) + (O : Set X) (hO : IsOpen O) (hOne : O.Nonempty) : + ∃ H : ℕ, ∃ φ : ℕ → C(X, ℝ), + (∀ n x, 0 ≤ φ n x) ∧ + (∀ x, ∑ n ∈ Finset.range (H + 1), φ n x = 1) ∧ + (∀ n, σ^[n] '' tsupport (φ n) ⊆ O) ∧ + (∀ n, H < n → φ n = 0) := by + obtain ⟨H, φ, hφpos, hφsum, hφsupport, hφzero⟩ := + exists_finite_partition_of_nat_open_cover (fun n => σ^[n] ⁻¹' O) + (fun n => hO.preimage (hσ.iterate n)) + (fun x => (hdense x).exists_mem_open hO hOne) + refine ⟨H, φ, hφpos, hφsum, ?_, hφzero⟩ + intro n y hy + obtain ⟨x, hx, rfl⟩ := hy + exact hφsupport n hx + +theorem exists_irrational_rotation_partition {θ : ℝ} (hθ : Irrational θ) + (O : Set (AddCircle (1 : ℝ))) (hO : IsOpen O) (hOne : O.Nonempty) : + ∃ H : ℕ, ∃ φ : ℕ → C(AddCircle (1 : ℝ), ℝ), + (∀ n x, 0 ≤ φ n x) ∧ + (∀ x, ∑ n ∈ Finset.range (H + 1), φ n x = 1) ∧ + (∀ n, (fun x => x + n • (θ : AddCircle (1 : ℝ))) '' tsupport (φ n) ⊆ O) ∧ + (∀ n, H < n → φ n = 0) := by + have hn : DenseRange (fun n : ℕ => n • (θ : AddCircle (1 : ℝ))) := by + simpa only [Nat.add_zero] using + PrescribedPhaseRealization.dense_positive_orbit_tail hθ 0 + have horbit : ∀ x : AddCircle (1 : ℝ), + DenseRange (fun n : ℕ => (fun y => y + (θ : AddCircle (1 : ℝ)))^[n] x) := by + intro x + have hd := (Homeomorph.addLeft x).surjective.denseRange.comp hn + (Homeomorph.addLeft x).continuous + change DenseRange (fun n : ℕ => x + n • (θ : AddCircle (1 : ℝ))) at hd + simpa only [add_right_iterate] using hd + obtain ⟨H, φ, hφpos, hφsum, hφsupport, hφzero⟩ := + exists_finite_orbit_partition (fun x : AddCircle (1 : ℝ) => x + θ) + (continuous_id.add continuous_const) horbit O hO hOne + refine ⟨H, φ, hφpos, hφsum, ?_, hφzero⟩ + simpa only [add_right_iterate] using hφsupport + +theorem exists_preparatory_partitions {θ : ℝ} (hθ : Irrational θ) : + ∃ height : ℕ → ℕ, ∃ φ : ℕ → ℕ → C(AddCircle (1 : ℝ), ℝ), + (∀ j n x, 0 ≤ φ j n x) ∧ + (∀ j x, ∑ n ∈ Finset.range (height j + 1), φ j n x = 1) ∧ + (∀ j, 1 ≤ j → ∀ n, ∀ x ∈ tsupport (φ j n), + dist (x + (((n : ℝ) * θ : ℝ) : AddCircle (1 : ℝ))) 0 < + 1 / (10 * (j : ℝ))) ∧ + (∀ j n, height j < n → φ j n = 0) := by + have hr : ∀ j : ℕ, 0 < (1 : ℝ) / (10 * ((j + 1 : ℕ) : ℝ)) := by + intro j + positivity + choose H φ hnon hsum hsupport hzero using fun j : ℕ => + exists_irrational_rotation_partition hθ + (Metric.ball 0 (1 / (10 * ((j + 1 : ℕ) : ℝ)))) + Metric.isOpen_ball ⟨0, Metric.mem_ball_self (hr j)⟩ + refine ⟨fun j => H (j - 1), fun j => φ (j - 1), + (fun j => hnon (j - 1)), (fun j => hsum (j - 1)), ?_, + (fun j => hzero (j - 1))⟩ + intro j hj n x hx + have h := hsupport (j - 1) n ⟨x, hx, rfl⟩ + change dist (x + n • (θ : AddCircle (1 : ℝ))) 0 < + 1 / (10 * ((j - 1 + 1 : ℕ) : ℝ)) at h + simpa only [Nat.sub_add_cancel hj, ← AddCircle.coe_nsmul, nsmul_eq_mul] using h + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/OrderedHaarRigidity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrderedHaarRigidity.lean new file mode 100644 index 0000000000000000000000000000000000000000..26203bead0b2d47ae4fa5c6d8dc22e97fda84843 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrderedHaarRigidity.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductBase +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory Filter + +namespace Invariant233.ProductModel.OrderedRigidity + +theorem representative_injective : Function.Injective circleRepresentative := by + intro x y h + apply (AddCircle.equivIco (1 : ℝ) 0).injective + exact Subtype.ext h + +theorem representative_measurable : Measurable circleRepresentative := + measurable_subtype_coe.comp (AddCircle.measurableEquivIco (1 : ℝ) 0).measurable + +theorem representative_bounds (x : Circle) : + 0 ≤ circleRepresentative x ∧ circleRepresentative x < 1 := by + simpa [circleRepresentative] using (AddCircle.equivIco (1 : ℝ) 0 x).property + +theorem coordinate_integrable {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} [IsFiniteMeasure μ] {f : Ω → Base} + (hf : Measurable f) (i : ℕ) : + Integrable (fun ω => circleRepresentative (f ω i)) μ := by + apply Integrable.of_bound + ((representative_measurable.comp ((measurable_pi_apply i).comp hf)).aestronglyMeasurable) + 1 + exact Filter.Eventually.of_forall fun ω => by + change ‖circleRepresentative (f ω i)‖ ≤ 1 + rw [Real.norm_eq_abs, abs_of_nonneg (representative_bounds (f ω i)).1] + exact (representative_bounds (f ω i)).2.le + +theorem ae_eq_of_ordered_equal_marginals + (η : Measure (Base × Base)) [IsFiniteMeasure η] + (hmarg : η.map Prod.fst = η.map Prod.snd) + (horder : ∀ᵐ xy ∂η, Ordered xy.1 xy.2) : + ∀ᵐ xy ∂η, xy.1 = xy.2 := by + have hcoord (i : ℕ) : + (fun xy : Base × Base => circleRepresentative (xy.1 i)) =ᵐ[η] + fun xy => circleRepresentative (xy.2 i) := by + apply (integral_eq_iff_of_ae_le + (coordinate_integrable measurable_fst i) + (coordinate_integrable measurable_snd i) + (horder.mono fun xy hxy => hxy i)).1 + let g : Base → ℝ := fun x => circleRepresentative (x i) + have hg : StronglyMeasurable g := + (representative_measurable.comp (measurable_pi_apply i)).stronglyMeasurable + calc + (∫ xy, circleRepresentative (xy.1 i) ∂η) = ∫ x, g x ∂η.map Prod.fst := + (integral_map_of_stronglyMeasurable measurable_fst hg).symm + _ = ∫ x, g x ∂η.map Prod.snd := by rw [hmarg] + _ = ∫ xy, circleRepresentative (xy.2 i) ∂η := + integral_map_of_stronglyMeasurable measurable_snd hg + filter_upwards [ae_all_iff.2 hcoord] with xy hxy + funext i + exact representative_injective (hxy i) + +theorem eq_diagonal_of_ordered_equal_marginals + (η : Measure (Base × Base)) [IsFiniteMeasure η] + (hmarg : η.map Prod.fst = η.map Prod.snd) + (horder : ∀ᵐ xy ∂η, Ordered xy.1 xy.2) : + η = (η.map Prod.fst).map (fun x : Base => (x, x)) := by + rw [Measure.map_map (show Measurable (fun x : Base => (x, x)) from + measurable_id.prodMk measurable_id) measurable_fst] + calc + η = η.map id := Measure.map_id.symm + _ = η.map ((fun x : Base => (x, x)) ∘ Prod.fst) := by + apply Measure.map_congr + filter_upwards [ae_eq_of_ordered_equal_marginals η hmarg horder] with xy hxy + exact Prod.ext rfl hxy.symm + +theorem eq_diagonal_haar_of_ordered + (η : Measure (Base × Base)) + (hfst : η.map Prod.fst = baseMeasure) + (hsnd : η.map Prod.snd = baseMeasure) + (horder : ∀ᵐ xy ∂η, Ordered xy.1 xy.2) : + η = baseMeasure.map (fun x : Base => (x, x)) := by + have : IsProbabilityMeasure (η.map Prod.fst) := hfst ▸ baseMeasure_probability + have : IsProbabilityMeasure η := + Measure.isProbabilityMeasure_of_map measurable_fst.aemeasurable + simpa [hfst] using eq_diagonal_of_ordered_equal_marginals η + (hfst.trans hsnd.symm) horder + +end Invariant233.ProductModel.OrderedRigidity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/OrderedRelationTopology.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrderedRelationTopology.lean new file mode 100644 index 0000000000000000000000000000000000000000..de430b0353b885a88f03f617b98e6e661870c195 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrderedRelationTopology.lean @@ -0,0 +1,85 @@ +import OAI.Analysis.IrrationalRotation.Analysis.OrderedHaarRigidity + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped Topology + +namespace Invariant233.ProductModel.OrderedRigidity + +theorem orderedRelation_measurable : + MeasurableSet {xy : Base × Base | Ordered xy.1 xy.2} := by + unfold Ordered + simp only [ofPred_forall] + apply MeasurableSet.iInter + intro i + exact measurableSet_le + (representative_measurable.comp ((measurable_pi_apply i).comp measurable_fst)) + (representative_measurable.comp ((measurable_pi_apply i).comp measurable_snd)) + +theorem representative_coe {t : ℝ} (ht : t ∈ Ico (0 : ℝ) 1) : + circleRepresentative (t : Circle) = t := by + exact AddCircle.equivIco_coe_of_mem (by simpa using ht) + +def orderedApproximant (n : ℕ) : Base × Base := + ((fun _ => ((1 / 2 : ℝ) : Circle)), + fun _ => ((1 - 1 / ((n : ℝ) + 2) : ℝ) : Circle)) + +def unorderedLimit : Base × Base := + ((fun _ => ((1 / 2 : ℝ) : Circle)), fun _ => 0) + +theorem orderedApproximant_ordered (n : ℕ) : + Ordered (orderedApproximant n).1 (orderedApproximant n).2 := by + have hd : 0 < (n : ℝ) + 2 := by positivity + have hsmall : 1 / ((n : ℝ) + 2) ≤ 1 / 2 := by + apply (div_le_iff₀ hd).2 + nlinarith [Nat.cast_nonneg (α := ℝ) n] + have hpos : 0 < 1 / ((n : ℝ) + 2) := one_div_pos.mpr hd + intro i + change circleRepresentative ((1 / 2 : ℝ) : Circle) ≤ + circleRepresentative ((1 - 1 / ((n : ℝ) + 2) : ℝ) : Circle) + rw [representative_coe (by norm_num), representative_coe (by + constructor <;> linarith)] + linarith + +theorem unorderedLimit_not_ordered : + ¬ Ordered unorderedLimit.1 unorderedLimit.2 := by + intro h + have h0 := h 0 + change circleRepresentative ((1 / 2 : ℝ) : Circle) ≤ + circleRepresentative ((0 : ℝ) : Circle) at h0 + rw [representative_coe (by norm_num), representative_coe (by norm_num)] at h0 + norm_num at h0 + +theorem orderedApproximant_tendsto : + Tendsto orderedApproximant atTop (𝓝 unorderedLimit) := by + have hfrac : Tendsto (fun n : ℕ => (1 : ℝ) / ((n : ℝ) + 2)) atTop (𝓝 0) := by + have h := (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).comp + (tendsto_add_atTop_nat 1) + simpa only [Function.comp_def, Nat.cast_add, Nat.cast_one, add_assoc, + one_add_one_eq_two] using h + have hreal : Tendsto (fun n : ℕ => 1 - 1 / ((n : ℝ) + 2)) atTop (𝓝 (1 : ℝ)) := by + simpa using tendsto_const_nhds.sub hfrac + have hcircle : Tendsto + (fun n : ℕ => ((1 - 1 / ((n : ℝ) + 2) : ℝ) : Circle)) atTop (𝓝 0) := by + have h := (AddCircle.continuous_mk' (1 : ℝ)).continuousAt.tendsto.comp hreal + change Tendsto (fun n : ℕ => ((1 - 1 / ((n : ℝ) + 2) : ℝ) : Circle)) + atTop (𝓝 ((1 : ℝ) : Circle)) at h + simpa only [AddCircle.coe_period] using h + apply Tendsto.prodMk_nhds + · exact tendsto_const_nhds + · exact tendsto_pi_nhds.2 (fun _ => hcircle) + +theorem orderedRelation_not_isClosed : + ¬ IsClosed {xy : Base × Base | Ordered xy.1 xy.2} := by + intro hclosed + exact unorderedLimit_not_ordered + (hclosed.mem_of_tendsto orderedApproximant_tendsto + (Filter.Eventually.of_forall orderedApproximant_ordered)) + +end Invariant233.ProductModel.OrderedRigidity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/OrdinaryTailNonmembership.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrdinaryTailNonmembership.lean new file mode 100644 index 0000000000000000000000000000000000000000..5a74832585e48806fc87f065e7c1d522255ab312 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrdinaryTailNonmembership.lean @@ -0,0 +1,37 @@ +import OAI.Analysis.IrrationalRotation.Analysis.OrdinaryTailSubspaces +import OAI.Analysis.IrrationalRotation.Product.ProductCovariance +import OAI.Analysis.IrrationalRotation.Rotation.RotationHalfline + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.ProductModel + +theorem fieldTailProjection_not_mem_factor (θ : ℕ → ℝ) (m : ℤ) : + WeightedShift.fieldTailProjection (μ := baseMeasure) m ∉ factor θ := by + intro hmem + have hcov := field_covariance hmem (fun _ => WeightedShift.tailProjection m) + (WeightedShift.fieldTailProjection_ae m) + obtain ⟨x, hx⟩ := hcov.exists + exact WeightedShift.tailProjection_not_commute_shift m (hx 1) + +theorem ordinary_tail_projection (θ c : ℕ → ℝ) (m : ℤ) : + IsStarProjection (WeightedShift.fieldTailProjection (μ := baseMeasure) m) ∧ + WeightedShift.fieldTailProjection (μ := baseMeasure) m ≠ 0 ∧ + WeightedShift.fieldTailProjection (μ := baseMeasure) m ≠ 1 ∧ + (1 - WeightedShift.fieldTailProjection (μ := baseMeasure) m) * weightedOperator θ c * + WeightedShift.fieldTailProjection (μ := baseMeasure) m = 0 ∧ + WeightedShift.fieldTailProjection (μ := baseMeasure) m ∉ factor θ := + ⟨WeightedShift.fieldTailProjection_isStarProjection m, + WeightedShift.fieldTailProjection_ne_zero m, + WeightedShift.fieldTailProjection_ne_one m, + WeightedShift.fieldTailProjection_invariant _ _ _ _ _ m, + fieldTailProjection_not_mem_factor θ m⟩ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/OrdinaryTailSubspaces.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrdinaryTailSubspaces.lean new file mode 100644 index 0000000000000000000000000000000000000000..4148013c1c24c7354c6d2710bb1fa793480e0e26 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/OrdinaryTailSubspaces.lean @@ -0,0 +1,213 @@ +import OAI.Analysis.IrrationalRotation.Model.TailSubspace +import OAI.Analysis.IrrationalRotation.Rotation.FieldWeightedShiftHalfline +import OAI.Analysis.IrrationalRotation.Product.ProductHilbert +import OAI.Analysis.IrrationalRotation.Rotation.Rotation +import Mathlib.Analysis.InnerProductSpace.Projection.Basic + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal + +namespace Invariant233.WeightedShift + +theorem tailProjection_isStarProjection (m : ℤ) : + IsStarProjection (tailProjection m) := isStarProjection_tailProjection m + +@[simp] theorem tailProjection_single (m k : ℤ) (z : ℂ) : + tailProjection m (lp.single 2 k z) = + if m ≤ k then lp.single 2 k z else 0 := by + ext j + by_cases hj : j = k + · subst j + by_cases hk : m ≤ k <;> simp [tailProjection_apply, hk] + · by_cases hk : m ≤ k <;> simp [tailProjection_apply, lp.single_apply, hj, hk] + +theorem tailProjection_range_eq_closedSpan (m : ℤ) : + (tailProjection m).range = + (Submodule.span ℂ ((fun k : ℤ => (lp.single 2 k (1 : ℂ) : Hilbert)) '' + Set.Ici m)).topologicalClosure := by + classical + let b : HilbertBasis ℤ ℂ Hilbert := default + have hb (k : ℤ) : b k = (lp.single 2 k (1 : ℂ) : Hilbert) := + (HilbertBasis.repr_symm_single b k).symm + apply le_antisymm + · rintro ξ ⟨η, rfl⟩ + refine mem_closure_of_tendsto ((tailProjection m).hasSum (b.hasSum_repr η)) + (Eventually.of_forall ?_) + intro s + apply Submodule.sum_mem + intro k hk + rw [map_smul, hb, tailProjection_single] + by_cases hmk : m ≤ k + · rw [ite_eq_left hmk] + exact Submodule.smul_mem _ _ (Submodule.subset_span ⟨k, hmk, rfl⟩) + · rw [ite_eq_right hmk, smul_zero] + exact Submodule.zero_mem _ + · apply Submodule.topologicalClosure_minimal + · apply Submodule.span_le.mpr + rintro ξ ⟨k, hk, rfl⟩ + change m ≤ k at hk + refine ⟨lp.single 2 k (1 : ℂ), ?_⟩ + change tailProjection m (lp.single 2 k (1 : ℂ)) = lp.single 2 k (1 : ℂ) + simp only [tailProjection_single, ite_eq_left hk] + · exact ContinuousLinearMap.IsIdempotentElem.isClosed_range + (isStarProjection_tailProjection m).isIdempotentElem + +theorem mem_range_tailProjection_iff (m : ℤ) (ξ : Hilbert) : + ξ ∈ (tailProjection m).range ↔ ∀ k : ℤ, k < m → ξ k = 0 := by + constructor + · rintro ⟨η, rfl⟩ k hk + change tailProjection m η k = 0 + simp only [tailProjection_apply, ite_eq_right (not_le.mpr hk)] + · intro hξ + refine ⟨ξ, ?_⟩ + ext k + change tailProjection m ξ k = ξ k + rw [tailProjection_apply] + split_ifs with hk + · rfl + · exact (hξ k (lt_of_not_ge hk)).symm + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem fieldTailProjection_ae (m : ℤ) (ξ : Lp Hilbert 2 μ) : + fieldTailProjection (μ := μ) m ξ =ᵐ[μ] fun x => tailProjection m (ξ x) := + constantField_ae (tailProjection m) ξ + +theorem fieldTailProjection_coordinates_ae (m : ℤ) (ξ : Lp Hilbert 2 μ) : + ∀ᵐ x ∂μ, ∀ k : ℤ, + fieldTailProjection (μ := μ) m ξ x k = if m ≤ k then ξ x k else 0 := by + filter_upwards [fieldTailProjection_ae m ξ] with x hx k + rw [hx, tailProjection_apply] + +theorem fieldTailProjection_isStarProjection (m : ℤ) : + IsStarProjection (fieldTailProjection (μ := μ) m) := + isStarProjection_fieldTailProjection m + +theorem fieldTailSubspace_isClosed (m : ℤ) : + IsClosed (fieldTailSubspace μ m : Set (Lp Hilbert 2 μ)) := + ContinuousLinearMap.IsIdempotentElem.isClosed_range + (fieldTailProjection_isStarProjection (μ := μ) m).isIdempotentElem + +theorem mem_fieldTailSubspace_iff (m : ℤ) (ξ : Lp Hilbert 2 μ) : + ξ ∈ fieldTailSubspace μ m ↔ ∀ᵐ x ∂μ, ∀ k : ℤ, k < m → ξ x k = 0 := by + constructor + · rintro ⟨η, rfl⟩ + filter_upwards [fieldTailProjection_coordinates_ae m η] with x hx k hk + change fieldTailProjection (μ := μ) m η x k = 0 + rw [hx k, ite_eq_right (not_le.mpr hk)] + · intro hξ + refine ⟨ξ, ?_⟩ + apply Lp.ext + filter_upwards [fieldTailProjection_coordinates_ae m ξ, hξ] with x hx hz + apply lp.ext + funext k + change fieldTailProjection (μ := μ) m ξ x k = ξ x k + rw [hx k] + split_ifs with hk + · rfl + · exact (hz k (lt_of_not_ge hk)).symm + +theorem mem_fieldTailSubspace_iff_closedSpan (m : ℤ) (ξ : Lp Hilbert 2 μ) : + ξ ∈ fieldTailSubspace μ m ↔ ∀ᵐ x ∂μ, + ξ x ∈ (Submodule.span ℂ + ((fun k : ℤ => (lp.single 2 k (1 : ℂ) : Hilbert)) '' Set.Ici m)).topologicalClosure := by + rw [mem_fieldTailSubspace_iff] + apply Filter.eventually_congr + exact Filter.Eventually.of_forall (fun x => by + rw [← tailProjection_range_eq_closedSpan, mem_range_tailProjection_iff]) + +theorem fieldTailSubspace_invariant + (a : X → Weight) (C : ℝ) (hC : 0 ≤ C) + (ha : ∀ x, ‖a x‖ ≤ C) + (hm : ∀ k, AEStronglyMeasurable (fun x => a x k) μ) (m : ℤ) : + fieldTailSubspace μ m ∈ Module.End.invtSubmodule + ((shift 1).toLinearIsometry.toContinuousLinearMap.compLpL 2 μ * + fieldDiagonal a C hC ha hm) := by + apply (ContinuousLinearMap.IsIdempotentElem.range_mem_invtSubmodule_iff + (fieldTailProjection_isStarProjection (μ := μ) m).isIdempotentElem).mpr + have h := fieldTailProjection_invariant a C hC ha hm m + rw [sub_mul, one_mul, sub_mul] at h + exact (sub_eq_zero.mp h).symm + +section Probability +variable [IsProbabilityMeasure μ] + +theorem fieldTailProjection_const (m : ℤ) (ξ : Hilbert) : + fieldTailProjection (μ := μ) m (Lp.const 2 μ ξ) = + Lp.const 2 μ (tailProjection m ξ) := by + apply Lp.ext + filter_upwards [fieldTailProjection_ae m (Lp.const 2 μ ξ), + Lp.coeFn_const (p := (2 : ENNReal)) (μ := μ) (c := ξ), + Lp.coeFn_const (p := (2 : ENNReal)) (μ := μ) (c := tailProjection m ξ)] + with x hP hξ htail + rw [hP, hξ, htail] + rfl + +theorem const_single_ne_zero (k : ℤ) : + (Lp.const 2 μ (lp.single 2 k (1 : ℂ)) : Lp Hilbert 2 μ) ≠ 0 := by + intro h + have hn : ‖(Lp.const 2 μ (lp.single 2 k (1 : ℂ)) : Lp Hilbert 2 μ)‖ = 1 := by + rw [Lp.norm_const' 2 μ _ (by norm_num) (by norm_num)] + simp [lp.norm_single (by norm_num : (0 : ENNReal) < 2)] + rw [h, norm_zero] at hn + exact zero_ne_one hn + +theorem fieldTailSubspace_ne_bot (m : ℤ) : fieldTailSubspace μ m ≠ ⊥ := by + intro h + apply fieldTailProjection_ne_zero (μ := μ) m + apply ContinuousLinearMap.ext + intro ξ + have hm : fieldTailProjection (μ := μ) m ξ ∈ fieldTailSubspace μ m := ⟨ξ, rfl⟩ + rw [h] at hm + exact hm + +theorem fieldTailSubspace_ne_top (m : ℤ) : fieldTailSubspace μ m ≠ ⊤ := by + intro h + apply fieldTailProjection_ne_one (μ := μ) m + apply ContinuousLinearMap.ext + intro ξ + have hm : ξ ∈ fieldTailSubspace μ m := by rw [h]; trivial + rcases hm with ⟨η, rfl⟩ + exact congrArg (fun A : Lp Hilbert 2 μ →L[ℂ] Lp Hilbert 2 μ => A η) + (fieldTailProjection_isStarProjection (μ := μ) m).isIdempotentElem.eq + +end Probability + +end Invariant233.WeightedShift + +namespace Invariant233.Rotation + +theorem ordinary_tail_subspace (θ : ℝ) (f : C(Circle, ℝ)) (m : ℤ) : + IsClosed (WeightedShift.fieldTailSubspace circleMeasure m : Set Hilbert) ∧ + WeightedShift.fieldTailSubspace circleMeasure m ≠ ⊥ ∧ + WeightedShift.fieldTailSubspace circleMeasure m ≠ ⊤ ∧ + WeightedShift.fieldTailSubspace circleMeasure m ∈ + Module.End.invtSubmodule (weightedReal θ f) := + ⟨WeightedShift.fieldTailSubspace_isClosed m, + WeightedShift.fieldTailSubspace_ne_bot m, + WeightedShift.fieldTailSubspace_ne_top m, + WeightedShift.fieldTailSubspace_invariant _ _ _ _ _ m⟩ + +end Invariant233.Rotation + +namespace Invariant233.ProductModel + +theorem ordinary_tail_subspace (θ c : ℕ → ℝ) (m : ℤ) : + IsClosed (WeightedShift.fieldTailSubspace baseMeasure m : Set Hilbert) ∧ + WeightedShift.fieldTailSubspace baseMeasure m ≠ ⊥ ∧ + WeightedShift.fieldTailSubspace baseMeasure m ≠ ⊤ ∧ + WeightedShift.fieldTailSubspace baseMeasure m ∈ + Module.End.invtSubmodule (weightedOperator θ c) := + ⟨WeightedShift.fieldTailSubspace_isClosed m, + WeightedShift.fieldTailSubspace_ne_bot m, + WeightedShift.fieldTailSubspace_ne_top m, + WeightedShift.fieldTailSubspace_invariant _ _ _ _ _ m⟩ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterAttenuationConsequences.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterAttenuationConsequences.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca6323bcfee62318446f1e1e0e9af0eebd637db2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterAttenuationConsequences.lean @@ -0,0 +1,247 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleParameters +import OAI.Analysis.IrrationalRotation.Product.ProductScaleConsequences +import OAI.Analysis.IrrationalRotation.Analysis.ConvolutionContradiction +import Mathlib.Analysis.PSeries + +namespace OAI + +noncomputable section +open Filter +open scoped BigOperators Topology +namespace Invariant233.ParameterAttenuation + +def central (r : ℝ) (n : ℤ) : ℂ := if n = 0 then (r : ℂ) else 0 + +lemma central_support (r : ℝ) (K : ℕ) : + Function.support (central r) ⊆ Set.Icc (-(K : ℤ)) (K : ℤ) := by + intro n hn + have hn0 : n = 0 := by + by_contra h + exact hn (by simp [central, h]) + subst n + constructor <;> omega + +lemma norm_central_le {r : ℝ} (hr : 0 ≤ r) (n : ℤ) : + ‖central r n‖ ≤ r := by + by_cases hn : n = 0 + · simp [central, hn, Complex.norm_real, abs_of_nonneg hr] + · simp [central, hn, hr] + +lemma circle_convolution_central (K : ℕ) (r : ℝ) (n : ℤ) : + CircleParameterData.convolutionCoefficient K (central r) (central r) n = + if n = 0 then (r : ℂ) * r else 0 := by + unfold CircleParameterData.convolutionCoefficient + rw [Finset.sum_eq_single 0] + · simp [central] + · intro i hi hi0 + simp [central, hi0] + · intro h + exact False.elim (h (by simp)) + +lemma product_convolution_central (K : ℕ) (r : ℝ) (n : ℕ) : + FiniteWindow.convolution K (central r) (central r) n = + if n = 0 then (r : ℂ) * r else 0 := by + unfold FiniteWindow.convolution + rw [Finset.sum_eq_single 0] + · simp [central] + · intro i hi hi0 + simp [central, hi0] + · intro h + by_cases hn : n = 0 + · subst n + exact False.elim (h (by simp)) + · simp [central, hn] + +lemma norm_circle_convolution_central_le (K : ℕ) (r : ℝ) (n : ℤ) : + ‖CircleParameterData.convolutionCoefficient K (central r) (central r) n‖ ≤ r ^ 2 := by + rw [circle_convolution_central] + split_ifs + · simp [Complex.norm_real, pow_two] + · simpa using sq_nonneg r + +lemma norm_product_convolution_central_le (K : ℕ) (r : ℝ) (n : ℕ) : + ‖FiniteWindow.convolution K (central r) (central r) n‖ ≤ r ^ 2 := by + rw [product_convolution_central] + split_ifs + · simp [Complex.norm_real, pow_two] + · simpa using sq_nonneg r + +lemma attenuation_le_reciprocal_cube (K : ℕ) (L ε j : ℝ) (hj : 0 < j) + (hε : ε ≤ (1 / j) ^ 2) + (hchoice : (2 * (K : ℝ) + 1) * 3 * Real.exp (-L / 10000) ≤ ε / j) : + Real.exp (-L / 10000) ≤ (1 / j) ^ 3 := by + calc + Real.exp (-L / 10000) ≤ + (2 * (K : ℝ) + 1) * 3 * Real.exp (-L / 10000) := by + nlinarith [Real.exp_pos (-L / 10000), Nat.cast_nonneg (α := ℝ) K] + _ ≤ ε / j := hchoice + _ ≤ (1 / j) ^ 2 / j := div_le_div_of_nonneg_right hε hj.le + _ = (1 / j) ^ 3 := by ring + +lemma log_le_attenuation {L j : ℝ} (hj : 0 < j) + (h : Real.exp (-L / 10000) ≤ (1 / j) ^ 3) : + 30000 * Real.log j ≤ L := by + have hlog := Real.log_le_log (Real.exp_pos (-L / 10000)) h + rw [Real.log_exp, Real.log_pow, Real.log_div one_ne_zero hj.ne', Real.log_one] at hlog + linarith + +lemma summable_shifted_reciprocal_power (k : ℕ) (hk : 1 < k) : + Summable (fun n : ℕ => (1 / ((n + 1 : ℕ) : ℝ)) ^ k) := by + have h : Summable (fun n : ℕ => ((n : ℝ) ^ k)⁻¹) := + Real.summable_nat_pow_inv.mpr hk + simpa only [one_div, inv_pow] using (summable_nat_add_iff 1).mpr h + +end ParameterAttenuation + +namespace CircleParameterLaws +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma coefficientBound_ge_one (j : ℕ) : 1 ≤ p.coefficientBound j := by + unfold CircleParameterData.coefficientBound + apply Real.one_le_exp_iff.mpr + apply mul_nonneg (by positivity) + apply Finset.sum_nonneg + intro s hs + exact mul_nonneg (hp.C_pos s (Finset.mem_Icc.mp hs).1).le (Nat.cast_nonneg _) + +theorem epsilon_le_reciprocal_sq (j : ℕ) (hj : 1 ≤ j) : + p.ε j ≤ (1 / (j : ℝ)) ^ 2 := by + have hjR : (1 : ℝ) ≤ j := by exact_mod_cast hj + have hr : 0 ≤ 1 / (j : ℝ) := by positivity + have hr1 : 1 / (j : ℝ) ≤ 1 := (div_le_one (by positivity)).mpr hjR + have hb (n : ℤ) : ‖ParameterAttenuation.central (1 / (j : ℝ)) n‖ ≤ + p.coefficientBound j := + (ParameterAttenuation.norm_central_le hr n).trans (hr1.trans (hp.coefficientBound_ge_one j)) + have hcenter : 1 / (j : ℝ) ≤ ‖ParameterAttenuation.central (1 / (j : ℝ)) 0‖ := by + change _ ≤ ‖((1 / (j : ℝ) : ℝ) : ℂ)‖ + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hr] + obtain ⟨n, hn, hε⟩ := hp.polynomial_lower j hj _ _ + (ParameterAttenuation.central_support _ _) (ParameterAttenuation.central_support _ _) + hb hb hcenter hcenter + exact hε.trans (ParameterAttenuation.norm_circle_convolution_central_le _ _ _) + +theorem summable_epsilon : Summable (fun n : ℕ => p.ε (n + 1)) := by + apply Summable.of_nonneg_of_le (fun n => (hp.epsilon_pos (n + 1) (by omega)).le) + (fun n => hp.epsilon_le_reciprocal_sq (n + 1) (by omega)) + exact ParameterAttenuation.summable_shifted_reciprocal_power 2 (by norm_num) + +theorem attenuation_le_reciprocal_cube (j : ℕ) (hj : 1 ≤ j) : + Real.exp (-p.L j / 10000) ≤ (1 / (j : ℝ)) ^ 3 := by + apply ParameterAttenuation.attenuation_le_reciprocal_cube (p.K j) (p.L j) (p.ε j) + (j : ℝ) (by exact_mod_cast (show 0 < j by omega)) + (hp.epsilon_le_reciprocal_sq j hj) + simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] using + hp.polynomial_attenuation j hj + +theorem log_le_attenuation (j : ℕ) (hj : 1 ≤ j) : + 30000 * Real.log (j : ℝ) ≤ p.L j := + ParameterAttenuation.log_le_attenuation + (by exact_mod_cast (show 0 < j by omega)) (hp.attenuation_le_reciprocal_cube j hj) + +theorem summable_attenuation : + Summable (fun n : ℕ => Real.exp (-p.L (n + 1) / 10000)) := by + apply Summable.of_nonneg_of_le (fun n => (Real.exp_pos _).le) + (fun n => hp.attenuation_le_reciprocal_cube (n + 1) (by omega)) + exact ParameterAttenuation.summable_shifted_reciprocal_power 3 (by norm_num) + +theorem tendsto_L_atTop : Tendsto p.L atTop atTop := by + apply tendsto_atTop_mono' atTop + (eventually_atTop.2 ⟨1, fun j hj => hp.log_le_attenuation j hj⟩) + exact (Real.tendsto_log_atTop.comp tendsto_natCast_atTop_atTop).const_mul_atTop + (by norm_num : (0 : ℝ) < 30000) + +theorem conditional_tail_le (j : ℕ) (hj : 1 ≤ j) : + (2 * (p.K j : ℝ) + 1) * + (Real.exp (-p.L j) + 2 * Real.sqrt (Real.exp (-p.L j / 400))) ≤ p.ε j / j := by + apply ConvolutionContradiction.coefficient_tail_le _ _ _ _ (hp.L_pos j hj).le + simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] using + hp.polynomial_attenuation j hj + +theorem not_eventually_conditional_obstruction (c : ℝ) (hc : 0 < c) : + ¬ ∀ᶠ j : ℕ in atTop, c * p.ε j ≤ (2 * (p.K j : ℝ) + 1) * + (Real.exp (-p.L j) + 2 * Real.sqrt (Real.exp (-p.L j / 400))) := by + intro h + apply ConvolutionContradiction.not_eventually_small_error c p.ε hc + (eventually_atTop.2 ⟨1, fun j hj => hp.epsilon_pos j hj⟩) + filter_upwards [h, eventually_ge_atTop 1] with j hj hj1 + exact hj.trans (hp.conditional_tail_le j hj1) + +end CircleParameterLaws + +namespace ProductScaleLaws +variable {p : ProductScaleData} (hp : ProductScaleLaws p) +include hp + +theorem epsilon_le_reciprocal_sq (n : ℕ) : + p.ε n ≤ (1 / ((n + 1 : ℕ) : ℝ)) ^ 2 := by + have hnR : (1 : ℝ) ≤ ((n + 1 : ℕ) : ℝ) := by exact_mod_cast Nat.succ_le_succ (Nat.zero_le n) + have hr : 0 ≤ 1 / ((n + 1 : ℕ) : ℝ) := by positivity + have hr1 : 1 / ((n + 1 : ℕ) : ℝ) ≤ 1 := (div_le_one (by positivity)).mpr hnR + have hb (i : ℤ) (_hi : |i| ≤ (p.K n : ℤ)) : + ‖ParameterAttenuation.central (1 / ((n + 1 : ℕ) : ℝ)) i‖ ≤ p.coefficientBound n := + (ParameterAttenuation.norm_central_le hr i).trans (hr1.trans (hp.coefficientBound_ge_one n)) + have hcenter : 1 / ((n + 1 : ℕ) : ℝ) ≤ + ‖ParameterAttenuation.central (1 / ((n + 1 : ℕ) : ℝ)) 0‖ := by + change _ ≤ ‖((1 / ((n + 1 : ℕ) : ℝ) : ℝ) : ℂ)‖ + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hr] + obtain ⟨i, hi, hε⟩ := hp.polynomial_lower n _ _ hb hb hcenter hcenter + exact hε.trans (ParameterAttenuation.norm_product_convolution_central_le _ _ _) + +theorem summable_epsilon : Summable p.ε := by + apply Summable.of_nonneg_of_le (fun n => (hp.epsilon_pos n).le) + hp.epsilon_le_reciprocal_sq + exact ParameterAttenuation.summable_shifted_reciprocal_power 2 (by norm_num) + +theorem attenuation_le_reciprocal_cube (n : ℕ) : + Real.exp (-p.L n / 10000) ≤ (1 / ((n + 1 : ℕ) : ℝ)) ^ 3 := by + apply ParameterAttenuation.attenuation_le_reciprocal_cube (p.K n) (p.L n) (p.ε n) + ((n + 1 : ℕ) : ℝ) (by positivity) (hp.epsilon_le_reciprocal_sq n) + simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] using + hp.polynomial_attenuation n + +theorem log_le_attenuation (n : ℕ) : + 30000 * Real.log ((n + 1 : ℕ) : ℝ) ≤ p.L n := + ParameterAttenuation.log_le_attenuation (by positivity) (hp.attenuation_le_reciprocal_cube n) + +theorem summable_attenuation : + Summable (fun n : ℕ => Real.exp (-p.L n / 10000)) := by + apply Summable.of_nonneg_of_le (fun n => (Real.exp_pos _).le) + hp.attenuation_le_reciprocal_cube + exact ParameterAttenuation.summable_shifted_reciprocal_power 3 (by norm_num) + +theorem tendsto_L_atTop : Tendsto p.L atTop atTop := by + apply tendsto_atTop_mono hp.log_le_attenuation + have hn : Tendsto (fun n : ℕ => ((n + 1 : ℕ) : ℝ)) atTop atTop := + tendsto_atTop_mono (fun n => Nat.cast_le.mpr (Nat.le_succ n)) + tendsto_natCast_atTop_atTop + exact (Real.tendsto_log_atTop.comp hn).const_mul_atTop + (by norm_num : (0 : ℝ) < 30000) + +theorem conditional_tail_le (n : ℕ) : + (2 * (p.K n : ℝ) + 1) * + (Real.exp (-p.L n) + 2 * Real.sqrt (Real.exp (-p.L n / 400))) ≤ + p.ε n / ((n + 1 : ℕ) : ℝ) := by + apply ConvolutionContradiction.coefficient_tail_le _ _ _ _ + (le_trans (by norm_num : (0 : ℝ) ≤ 1) (hp.L_ge_one n)) + simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] using + hp.polynomial_attenuation n + +theorem not_eventually_conditional_obstruction (c : ℝ) (hc : 0 < c) : + ¬ ∀ᶠ n : ℕ in atTop, c * p.ε n ≤ (2 * (p.K n : ℝ) + 1) * + (Real.exp (-p.L n) + 2 * Real.sqrt (Real.exp (-p.L n / 400))) := by + intro h + have hstage : ∀ᶠ n : ℕ in atTop, 1 / ((n + 1 : ℕ) : ℝ) < c := by + have ht : Tendsto (fun n : ℕ => 1 / ((n + 1 : ℕ) : ℝ)) atTop (𝓝 0) := + tendsto_one_div_atTop_nhds_zero_nat.comp (tendsto_add_atTop_nat 1) + exact ht.eventually (gt_mem_nhds hc) + obtain ⟨n, hn, hnc⟩ := (h.and hstage).exists + exact ConvolutionContradiction.fixed_stage_contradiction c (p.ε n) + ((n + 1 : ℕ) : ℝ) (hp.epsilon_pos n) hnc (hn.trans (hp.conditional_tail_le n)) + +end ProductScaleLaws +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterConvolutionIdentity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterConvolutionIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb5d199c577797b9a97b67f5580ac0f781e8f04e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterConvolutionIdentity.lean @@ -0,0 +1,153 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ParameterOrbitIdentity + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped BigOperators +namespace Invariant233.CircleParameterLaws +open CircleParameterData WeightedShift + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem parameter_orbitProduct_eq_floorCocycle {s : Set Circle} + (hinv : ∀ (k : ℤ) x, CircleWeights.rotate θ k x ∈ s ↔ x ∈ s) + (hc : ∀ x ∈ s, ∀ k n : ℤ, p.floorCocycle θ (k + n) x = + p.floorCocycle θ n (CircleWeights.rotate θ k x) * p.floorCocycle θ k x) + {y : Circle} (hy : y ∈ s) (n : ℕ) (v : ℤ) : + orbitProduct (hp.parameterOrbitWeight y) n v = + (p.floorCocycle θ (n : ℤ) (Rotation.action θ v y) : ℂ) := by + rw [orbitProduct_apply] + have hprod := p.weight_product_eq_floorCocycle θ (Rotation.action θ v y) + (hc _ ((hinv v y).mpr hy)) n + convert hprod using 1 + apply Finset.prod_congr rfl + intro j hj + change (p.measurableWeight θ (Rotation.action θ (v + j) y) : ℂ) = + (p.measurableWeight θ (Rotation.action θ (j : ℤ) (Rotation.action θ v y)) : ℂ) + rw [Rotation.action_add, add_comm v] + +theorem parameter_orbitProduct_mul_ratio {s : Set Circle} + (hinv : ∀ (k : ℤ) x, CircleWeights.rotate θ k x ∈ s ↔ x ∈ s) + (hc : ∀ x ∈ s, ∀ k n : ℤ, p.floorCocycle θ (k + n) x = + p.floorCocycle θ n (CircleWeights.rotate θ k x) * p.floorCocycle θ k x) + (x : Circle) {y : Circle} (hy : y ∈ s) (n : ℕ) (v : ℤ) : + orbitProduct (hp.parameterOrbitWeight y) n v * + ((p.floorCocycle θ v y / p.floorCocycle θ v x : ℝ) : ℂ) = + (p.floorCocycle θ (v + n) y : ℂ) / (p.floorCocycle θ v x : ℂ) := by + rw [hp.parameter_orbitProduct_eq_floorCocycle hinv hc hy n v, + hc y hy v n, Complex.ofReal_mul, Complex.ofReal_div] + simp only [Rotation.action, CircleWeights.rotate] + ring + +theorem parameter_convolution_absolute_and_zero {s : Set Circle} + (hinv : ∀ (k : ℤ) x, CircleWeights.rotate θ k x ∈ s ↔ x ∈ s) + (hc : ∀ x ∈ s, ∀ k n : ℤ, p.floorCocycle θ (k + n) x = + p.floorCocycle θ n (CircleWeights.rotate θ k x) * p.floorCocycle θ k x) + (x : Circle) {y : Circle} (hy : y ∈ s) + (P Q : Hilbert →L[ℂ] Hilbert) (hQ : IsStarProjection Q) + (hT : (1 - Q) * operator (hp.parameterOrbitWeight y) * Q = 0) + (hpair : (1 - Q) * ratioDiagonal (p.floorCocycle θ) (x, y) * P = 0) + (hbound : ∀ v : ℤ, p.floorCocycle θ v y / p.floorCocycle θ v x ≤ 1) + (n : ℕ) (ξ η : Hilbert) : + let A : ℤ → ℂ := fun v => P ξ v / (p.floorCocycle θ v x : ℂ) + let B : ℤ → ℂ := fun v => (p.floorCocycle θ (-v) y : ℂ) * star ((1 - Q) η (-v)) + Summable (fun v : ℤ => ‖A v * B (-(n : ℤ) - v)‖) ∧ + (∑' v : ℤ, A v * B (-(n : ℤ) - v)) = 0 := by + let r : Weight := ⟨fun v => ((p.floorCocycle θ v y / p.floorCocycle θ v x : ℝ) : ℂ), + memℓp_infty <| by + refine ⟨1, ?_⟩ + rintro a ⟨v, rfl⟩ + change ‖((p.floorCocycle θ v y / p.floorCocycle θ v x : ℝ) : ℂ)‖ ≤ 1 + rw [Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (div_pos (p.floorCocycle_pos θ v y) (p.floorCocycle_pos θ v x))] + exact hbound v⟩ + have hd : ratioDiagonal (p.floorCocycle θ) (x, y) = diagonal r := + SequenceHilbert.boundedDiagonal_eq_weighted r + rw [hd] at hpair + exact OrbitInvariance.cocycle_coefficients_absolute_and_zero + (hp.parameterOrbitWeight y) r (fun v => p.floorCocycle θ v x) + (fun v => p.floorCocycle θ v y) hQ hT hpair n ξ η + (hp.parameter_orbitProduct_mul_ratio hinv hc x hy n) + +theorem ae_parameter_convolution_absolute_and_zero + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (x y : Ω → Circle) (hy : AEMeasurable y μ) + (hyac : Measure.map y μ ≪ circleMeasure) + {P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert} + (F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber) + (hF : ∀ z, IsStarProjection (F z)) + (hrep : ∀ ξ : Rotation.Hilbert, P ξ =ᵐ[circleMeasure] fun z => F z (ξ z)) + (hT : (1 - P) * p.measurableOperator θ hp * P = 0) + (hpair : ∀ᵐ ω ∂μ, + (1 - F (y ω)) * ratioDiagonal (p.floorCocycle θ) (x ω, y ω) * F (x ω) = 0) + (hbound : ∀ᵐ ω ∂μ, ∀ v : ℤ, + p.floorCocycle θ v (y ω) / p.floorCocycle θ v (x ω) ≤ 1) : + ∀ᵐ ω ∂μ, ∀ (n : ℕ) (ξ η : Hilbert), + let A : ℤ → ℂ := fun v => F (x ω) ξ v / (p.floorCocycle θ v (x ω) : ℂ) + let B : ℤ → ℂ := fun v => (p.floorCocycle θ (-v) (y ω) : ℂ) * + star ((1 - F (y ω)) η (-v)) + Summable (fun v : ℤ => ‖A v * B (-(n : ℤ) - v)‖) ∧ + (∑' v : ℤ, A v * B (-(n : ℤ) - v)) = 0 := by + have hlocal := DirectIntegral.ae_invariant_of_representations + (default : HilbertBasis ℤ ℂ Rotation.Fiber) P (p.measurableOperator θ hp) F + (fun z => operator (hp.parameterOrbitWeight z)) hrep hp.measurableOperator_ae hT + obtain ⟨s, _, hfull, hs, _, hc⟩ := hp.exists_parameter_cocycle_set + have hylocal := ae_of_ae_map hy (hyac.ae_le hlocal) + have hyfull := ae_of_ae_map hy (hyac.ae_le hfull) + filter_upwards [hylocal, hyfull, hpair, hbound] with ω hloc hys hpa hbo + intro n ξ η + exact hp.parameter_convolution_absolute_and_zero hs hc (x ω) hys + (F (x ω)) (F (y ω)) (hF (y ω)) hloc hpa hbo n ξ η + +theorem parameter_convolution_ratio_bounds (x y : Circle) + (hx : ∀ k : ℤ, Function.HasFiniteSupport (fun i : p.Coord => + Int.floor (p.coordinate i.2 x + (k : ℝ) * p.alpha θ i.2))) + (hy : ∀ k : ℤ, Function.HasFiniteSupport (fun i : p.Coord => + Int.floor (p.coordinate i.2 y + (k : ℝ) * p.alpha θ i.2))) + (hbound : ∀ v : ℤ, p.floorCocycle θ v y / p.floorCocycle θ v x ≤ 1) + (n : ℕ) (v : ℤ) : + 0 < p.floorCocycle θ ((n : ℤ) + v) y / p.floorCocycle θ v x ∧ + p.floorCocycle θ ((n : ℤ) + v) y / p.floorCocycle θ v x ≤ + min (p.floorCocycle θ v y / p.floorCocycle θ v x) + (p.floorCocycle θ ((n : ℤ) + v) y / p.floorCocycle θ ((n : ℤ) + v) x) ∧ + min (p.floorCocycle θ v y / p.floorCocycle θ v x) + (p.floorCocycle θ ((n : ℤ) + v) y / p.floorCocycle θ ((n : ℤ) + v) x) ≤ 1 := by + have hle : v ≤ (n : ℤ) + v := by omega + have hmx := hp.parameter_cocycle_antitone x hx hle + have hmy := hp.parameter_cocycle_antitone y hy hle + refine ⟨div_pos (p.floorCocycle_pos θ _ y) (p.floorCocycle_pos θ v x), + le_min ?_ ?_, (min_le_left _ _).trans (hbound v)⟩ + · exact (div_le_div_iff_of_pos_right (p.floorCocycle_pos θ v x)).mpr hmy + · exact div_le_div_of_nonneg_left (p.floorCocycle_pos θ _ y).le + (p.floorCocycle_pos θ _ x) hmx + +theorem ae_parameter_convolution_ratio_bounds + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (x y : Ω → Circle) (hx : AEMeasurable x μ) (hy : AEMeasurable y μ) + (hxac : Measure.map x μ ≪ circleMeasure) (hyac : Measure.map y μ ≪ circleMeasure) + (hbound : ∀ᵐ ω ∂μ, ∀ v : ℤ, + p.floorCocycle θ v (y ω) / p.floorCocycle θ v (x ω) ≤ 1) : + ∀ᵐ ω ∂μ, ∀ (n : ℕ) (v : ℤ), + 0 < p.floorCocycle θ ((n : ℤ) + v) (y ω) / p.floorCocycle θ v (x ω) ∧ + p.floorCocycle θ ((n : ℤ) + v) (y ω) / p.floorCocycle θ v (x ω) ≤ + min (p.floorCocycle θ v (y ω) / p.floorCocycle θ v (x ω)) + (p.floorCocycle θ ((n : ℤ) + v) (y ω) / + p.floorCocycle θ ((n : ℤ) + v) (x ω)) ∧ + min (p.floorCocycle θ v (y ω) / p.floorCocycle θ v (x ω)) + (p.floorCocycle θ ((n : ℤ) + v) (y ω) / + p.floorCocycle θ ((n : ℤ) + v) (x ω)) ≤ 1 := by + obtain ⟨s, _, hfull, _, hfinite, _⟩ := hp.exists_parameter_cocycle_set + have hxfull := ae_of_ae_map hx (hxac.ae_le hfull) + have hyfull := ae_of_ae_map hy (hyac.ae_le hfull) + filter_upwards [hxfull, hyfull, hbound] with ω hxs hys hb + intro n v + exact hp.parameter_convolution_ratio_bounds (x ω) (y ω) + (hfinite _ hxs) (hfinite _ hys) hb n v + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterOrbitIdentity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterOrbitIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..a264b73f8ff578bf4883c1921a4c72f8cdf5216c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterOrbitIdentity.lean @@ -0,0 +1,243 @@ +import OAI.Analysis.IrrationalRotation.Model.ParameterCircleOperator +import OAI.Analysis.IrrationalRotation.Model.CompactTransfer +import OAI.Analysis.IrrationalRotation.Rotation.ParameterCircleCocycle +import OAI.Analysis.IrrationalRotation.Rotation.WeightedOrbitInvariance +import OAI.Analysis.IrrationalRotation.Rotation.RotationCenter +import OAI.Analysis.IrrationalRotation.Rotation.RotationMeasurable +import OAI.Analysis.IrrationalRotation.Analysis.RepresentedFieldInvariance +import OAI.Analysis.IrrationalRotation.Rotation.UnrestrictedDiagonal + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped BigOperators +namespace Invariant233 +namespace CircleParameterData + +theorem weight_product_eq_floorCocycle (p : CircleParameterData) (θ : ℝ) + (x : Circle) + (hc : ∀ k n : ℤ, p.floorCocycle θ (k + n) x = + p.floorCocycle θ n (CircleWeights.rotate θ k x) * p.floorCocycle θ k x) + (n : ℕ) : + (∏ j ∈ Finset.range n, (p.measurableWeight θ (Rotation.action θ (j : ℤ) x) : ℂ)) = + (p.floorCocycle θ (n : ℤ) x : ℂ) := by + induction n with + | zero => simp [p.floorCocycle_zero] + | succ n ih => + rw [Finset.prod_range_succ, ih] + have h := hc (n : ℤ) 1 + rw [Nat.cast_add, Nat.cast_one, h] + change (p.floorCocycle θ n x : ℂ) * + (p.floorCocycle θ 1 (CircleWeights.rotate θ n x) : ℂ) = _ + rw [Complex.ofReal_mul, mul_comm] + +end CircleParameterData + +namespace SequenceHilbert + +theorem boundedDiagonal_eq_weighted (w : WeightedShift.Weight) : + boundedDiagonal (fun k : ℤ => w k) = WeightedShift.diagonal w := by + ext ξ k + rw [boundedDiagonal_apply_of_bound (fun k : ℤ => w k) ‖w‖ (norm_nonneg _) + (fun k => lp.norm_apply_le_norm (by simp) w k)] + rfl + +end SequenceHilbert + +namespace CircleParameterLaws +open CircleParameterData Rotation WeightedShift +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) + +abbrev parameterOrbitWeight (x : Circle) : Weight := + Rotation.measurableOrbitWeight θ (fun z => (p.measurableWeight θ z : ℂ)) 1 + (p.measurableWeight_operator_bound θ hp) x + +theorem measurableOperator_mem_algebra : p.measurableOperator θ hp ∈ Rotation.algebra θ := + Rotation.U_mul_measurableRepresentation_mem_algebra θ _ _ _ _ _ + +theorem measurableOperator_ae (ξ : Rotation.Hilbert) : + p.measurableOperator θ hp ξ =ᵐ[circleMeasure] + fun x => WeightedShift.operator (hp.parameterOrbitWeight x) (ξ x) := by + filter_upwards [Rotation.U_mul_measurableRepresentation_coordinates_ae θ + (fun z => (p.measurableWeight θ z : ℂ)) 1 (by norm_num) + (Complex.measurable_ofReal.comp (p.measurableWeight_borel θ)) + (p.measurableWeight_operator_bound θ hp) ξ] with x hx + exact lp.ext (funext hx) + +theorem normalized_orbitProduct_eq_ratio {s : Set Circle} + (hinv : ∀ (k : ℤ) x, CircleWeights.rotate θ k x ∈ s ↔ x ∈ s) + (hc : ∀ x ∈ s, ∀ k n : ℤ, p.floorCocycle θ (k + n) x = + p.floorCocycle θ n (CircleWeights.rotate θ k x) * p.floorCocycle θ k x) + {x : Circle} (hx : x ∈ s) (n : ℕ) (v : ℤ) : + ((p.floorCocycle θ (n : ℤ) x : ℂ)⁻¹ • + WeightedShift.orbitProduct (hp.parameterOrbitWeight x) n) v = + ((p.floorCocycle θ v (Rotation.action θ (n : ℤ) x) / + p.floorCocycle θ v x : ℝ) : ℂ) := by + have hpord : WeightedShift.orbitProduct (hp.parameterOrbitWeight x) n v = + (p.floorCocycle θ (n : ℤ) (Rotation.action θ v x) : ℂ) := by + rw [WeightedShift.orbitProduct_apply] + have hprod := p.weight_product_eq_floorCocycle θ (Rotation.action θ v x) + (hc _ ((hinv v x).mpr hx)) n + convert hprod using 1 + apply Finset.prod_congr rfl + intro j hj + change (p.measurableWeight θ (Rotation.action θ (v + j) x) : ℂ) = + (p.measurableWeight θ (Rotation.action θ (j : ℤ) (Rotation.action θ v x)) : ℂ) + rw [Rotation.action_add, add_comm v] + have hratio := CircleWeights.orbit_ratio_of_cocycle_identities θ + p.coordFrequency p.coordCost x v (n : ℤ) (hc x hx v n) (hc x hx n v) + change p.floorCocycle θ (n : ℤ) (Rotation.action θ v x) / p.floorCocycle θ (n : ℤ) x = + p.floorCocycle θ v (Rotation.action θ (n : ℤ) x) / p.floorCocycle θ v x at hratio + change (p.floorCocycle θ (n : ℤ) x : ℂ)⁻¹ * + WeightedShift.orbitProduct (hp.parameterOrbitWeight x) n v = _ + rw [hpord, ← hratio, Complex.ofReal_div] + simp only [div_eq_mul_inv, mul_comm] + +theorem positive_orbit_identity_of_fiber {s : Set Circle} + (hinv : ∀ (k : ℤ) x, CircleWeights.rotate θ k x ∈ s ↔ x ∈ s) + (hc : ∀ x ∈ s, ∀ k n : ℤ, p.floorCocycle θ (k + n) x = + p.floorCocycle θ n (CircleWeights.rotate θ k x) * p.floorCocycle θ k x) + (P : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber) + {x : Circle} (hx : x ∈ s) (hP : IsIdempotentElem (P x)) + (hT : (1 - P x) * WeightedShift.operator (hp.parameterOrbitWeight x) * P x = 0) + (n : ℕ) + (hcov : P (Rotation.action θ (n : ℤ) x) = + (WeightedShift.shift (-(n : ℤ))).toLinearIsometry.toContinuousLinearMap * P x * + (WeightedShift.shift (n : ℤ)).toLinearIsometry.toContinuousLinearMap) : + (1 - P (Rotation.action θ (n : ℤ) x)) * + ratioDiagonal (p.floorCocycle θ) (x, Rotation.action θ (n : ℤ) x) * P x = 0 := by + let w : Weight := (p.floorCocycle θ (n : ℤ) x : ℂ)⁻¹ • + WeightedShift.orbitProduct (hp.parameterOrbitWeight x) n + have hd : ratioDiagonal (p.floorCocycle θ) (x, Rotation.action θ (n : ℤ) x) = + WeightedShift.diagonal w := by + unfold ratioDiagonal + rw [SequenceHilbert.boundedDiagonal_congr + (fun v => (hp.normalized_orbitProduct_eq_ratio hinv hc hx n v).symm)] + exact SequenceHilbert.boundedDiagonal_eq_weighted w + rw [hd, hcov] + exact OrbitInvariance.weighted_shift_orbit_normalized + (hp.parameterOrbitWeight x) hP hT n (p.floorCocycle θ (n : ℤ) x : ℂ) + +end CircleParameterLaws +end Invariant233 + +namespace Invariant233.Rotation + +theorem ae_field_conjugation_of_mem_algebra {θ : ℝ} + {P : Hilbert →L[ℂ] Hilbert} (hP : P ∈ algebra θ) + (F : Circle → Fiber →L[ℂ] Fiber) + (hrep : ∀ ξ : Hilbert, P ξ =ᵐ[circleMeasure] fun x => F x (ξ x)) : + ∀ᵐ x ∂circleMeasure, ∀ k : ℤ, F (action θ k x) = + (WeightedShift.shift (-k)).toLinearIsometry.toContinuousLinearMap * F x * + (WeightedShift.shift k).toLinearIsometry.toContinuousLinearMap := by + apply ae_all_iff.mpr + intro k + have hc := DirectIntegral.ae_covariance_of_represented_commute + (default : HilbertBasis ℤ ℂ Fiber) P F + (WeightedShift.shift k).toLinearIsometry.toContinuousLinearMap + (action θ k) (action_measurePreserving θ k) hrep + (algebra_commutes_shiftedPullback_int_independent θ k hP) + have hS : (WeightedShift.shift (-k)).toLinearIsometry.toContinuousLinearMap * + (WeightedShift.shift k).toLinearIsometry.toContinuousLinearMap = 1 := by + ext ξ i + simp [WeightedShift.shift_apply] + filter_upwards [hc] with x hx + calc + F (action θ k x) = 1 * F (action θ k x) := (one_mul _).symm + _ = ((WeightedShift.shift (-k)).toLinearIsometry.toContinuousLinearMap * + (WeightedShift.shift k).toLinearIsometry.toContinuousLinearMap) * + F (action θ k x) := by rw [hS] + _ = (WeightedShift.shift (-k)).toLinearIsometry.toContinuousLinearMap * + ((WeightedShift.shift k).toLinearIsometry.toContinuousLinearMap * + F (action θ k x)) := mul_assoc _ _ _ + _ = (WeightedShift.shift (-k)).toLinearIsometry.toContinuousLinearMap * + (F x * (WeightedShift.shift k).toLinearIsometry.toContinuousLinearMap) := by rw [hx] + _ = _ := (mul_assoc _ _ _).symm + +theorem exists_projection_field {θ : ℝ} {P : Hilbert →L[ℂ] Hilbert} + (hmem : P ∈ algebra θ) (hP : IsStarProjection P) : + ∃ F : Circle → Fiber →L[ℂ] Fiber, + (∀ x, IsStarProjection (F x)) ∧ + (∀ x, ‖F x‖ ≤ ‖P‖) ∧ + (∀ v : Fiber, StronglyMeasurable fun x => F x v) ∧ + (∀ ξ : Hilbert, P ξ =ᵐ[circleMeasure] fun x => F x (ξ x)) ∧ + (∀ᵐ x ∂circleMeasure, ∀ k : ℤ, F (action θ k x) = + (WeightedShift.shift (-k)).toLinearIsometry.toContinuousLinearMap * F x * + (WeightedShift.shift k).toLinearIsometry.toContinuousLinearMap) := by + classical + obtain ⟨G, hnorm, hmeas, hrep, _, _, _, hproj⟩ := + L2Multiplication.scalar_multiplier_fields_complete + (default : HilbertBasis ℤ ℂ Fiber) P (algebra_commutes_multiplier θ hmem) + obtain ⟨N, hsub, hN, hNzero⟩ := exists_measurable_superset_of_null (ae_iff.mp (hproj hP)) + let F : Circle → Fiber →L[ℂ] Fiber := fun x => if x ∈ N then 0 else G x + have hgood : ∀ x, x ∉ N → IsStarProjection (G x) := by + intro x hx + by_contra h + exact hx (hsub h) + have hnotN : ∀ᵐ x ∂circleMeasure, x ∉ N := by + simpa only [ae_iff, not_not, Set.ofPred_mem_eq] using hNzero + have heq : F =ᵐ[circleMeasure] G := by + filter_upwards [hnotN] with x hx + simp only [F, ite_eq_right hx] + have hFrep : ∀ ξ : Hilbert, P ξ =ᵐ[circleMeasure] fun x => F x (ξ x) := by + intro ξ + filter_upwards [hrep ξ, heq] with x hx hg + rw [hg] + exact hx + refine ⟨F, ?_, ?_, ?_, hFrep, + ae_field_conjugation_of_mem_algebra hmem F hFrep⟩ + · intro x + by_cases hx : x ∈ N + · simp only [F, ite_eq_left hx] + exact IsStarProjection.zero _ + · simpa only [F, ite_eq_right hx] using hgood x hx + · intro x + by_cases hx : x ∈ N + · simpa only [F, ite_eq_left hx, norm_zero] using norm_nonneg P + · simpa only [F, ite_eq_right hx] using hnorm x + · intro v + have he : (fun x => F x v) = N.piecewise (fun _ => (0 : Fiber)) (fun x => G x v) := by + funext x + by_cases hx : x ∈ N <;> simp [F, hx, Set.piecewise] + rw [he] + exact stronglyMeasurable_const.piecewise hN (hmeas v) + +end Invariant233.Rotation + +namespace Invariant233.CircleParameterLaws +open CircleParameterData +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) + +theorem exists_measurableOperator_positive_orbit_field + {P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert} + (hmem : P ∈ Rotation.algebra θ) (hP : IsStarProjection P) + (hT : (1 - P) * p.measurableOperator θ hp * P = 0) : + ∃ F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber, + (∀ x, IsStarProjection (F x)) ∧ + (∀ x, ‖F x‖ ≤ ‖P‖) ∧ + (∀ v : Rotation.Fiber, StronglyMeasurable fun x => F x v) ∧ + (∀ ξ : Rotation.Hilbert, P ξ =ᵐ[circleMeasure] fun x => F x (ξ x)) ∧ + (∀ᵐ x ∂circleMeasure, ∀ k : ℤ, F (Rotation.action θ k x) = + (WeightedShift.shift (-k)).toLinearIsometry.toContinuousLinearMap * F x * + (WeightedShift.shift k).toLinearIsometry.toContinuousLinearMap) ∧ + (∀ᵐ x ∂circleMeasure, ∀ n : ℕ, + (1 - F (Rotation.action θ (n : ℤ) x)) * + ratioDiagonal (p.floorCocycle θ) (x, Rotation.action θ (n : ℤ) x) * F x = 0) := by + obtain ⟨F, hproj, hnorm, hmeas, hrep, hcov⟩ := Rotation.exists_projection_field hmem hP + have hinv := DirectIntegral.ae_invariant_of_representations + (default : HilbertBasis ℤ ℂ Rotation.Fiber) P (p.measurableOperator θ hp) F + (fun x => WeightedShift.operator (hp.parameterOrbitWeight x)) hrep + hp.measurableOperator_ae hT + obtain ⟨s, _, hfull, hs, _, hc⟩ := hp.exists_parameter_cocycle_set + refine ⟨F, hproj, hnorm, hmeas, hrep, hcov, ?_⟩ + filter_upwards [hinv, hcov, hfull] with x hix hcx hsx + intro n + exact hp.positive_orbit_identity_of_fiber hs hc F hsx (hproj x).isIdempotentElem + hix n (hcx n) + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterSmoothing.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterSmoothing.lean new file mode 100644 index 0000000000000000000000000000000000000000..d019e1803f99af50931bfdae85827b601e17dc2b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterSmoothing.lean @@ -0,0 +1,371 @@ +import OAI.Analysis.IrrationalRotation.Model.ParameterSmoothing +import OAI.Analysis.IrrationalRotation.Rotation.CircleSmoothing +import OAI.Analysis.IrrationalRotation.Analysis.ContinuityCoboundary +import OAI.Analysis.IrrationalRotation.Sampling.CirclePhaseSummability +import Mathlib.MeasureTheory.OuterMeasure.BorelCantelli +import OAI.Analysis.IrrationalRotation.Analysis.BackgroundCost + +namespace OAI + +namespace Invariant233 + +open MeasureTheory Set InvariantProjection.Continuity +open scoped ENNReal + +namespace CircleParameterLaws + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem block_phase_pos (j : ℕ) (hj : 1 ≤ j) (i : ℕ) (hi : i ∈ p.block j) : + 0 < p.alpha θ i := by + have hN : 0 < p.N j := by + unfold CircleParameterData.N + exact mul_pos (Nat.cast_pos.mpr (hp.m_pos j hj)) (Nat.cast_pos.mpr (hp.K_pos j hj)) + exact (one_div_pos.mpr hN).trans (hp.phase_bounds j hj i hi).1 + +omit hp in + +theorem continuous_smoothBlock (p : CircleParameterData) (θ : ℝ) (j : ℕ) : + Continuous (p.smoothBlock θ j) := by + unfold CircleParameterData.smoothBlock + exact continuous_finsetSum _ (fun i _ => continuous_characterSmoothedDrop _ _ _ _) + +omit hp in + +theorem measurable_smoothBlockTransfer (p : CircleParameterData) (θ : ℝ) (j : ℕ) : + Measurable (p.smoothBlockTransfer θ j) := by + unfold CircleParameterData.smoothBlockTransfer + apply Finset.measurable_sum + intro i _hi + exact (measurable_circleSmoothingTransfer _ _).comp + (continuous_id.zsmul (p.q i : ℤ)).measurable + +theorem smoothBlock_nonneg (j : ℕ) (hj : 1 ≤ j) (x : Circle) : + 0 ≤ p.smoothBlock θ j x := by + apply Finset.sum_nonneg + intro i hi + apply circleSmoothedDrop_nonneg (hp.C_pos j hj).le + (hp.block_phase_pos j hj i hi).le + exact div_pos (hp.block_phase_pos j hj i hi) (by norm_num) + +theorem integral_smoothBlock (j : ℕ) : + (∫ x, p.smoothBlock θ j x) = p.C j * ∑ i ∈ p.block j, p.alpha θ i := by + unfold CircleParameterData.smoothBlock + rw [integral_finsetSum] + · rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + exact integral_characterSmoothedDrop _ _ _ (by exact_mod_cast (hp.q_pos i).ne') + · intro i hi + exact (continuous_characterSmoothedDrop _ _ _ _).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + +omit hp in + +theorem smoothBlock_eq_add_coboundary (j : ℕ) (x : Circle) : + p.smoothBlock θ j x = p.rawBlock θ j x + p.smoothBlockTransfer θ j x - + p.smoothBlockTransfer θ j (x + (θ : Circle)) := by + unfold CircleParameterData.smoothBlock CircleParameterData.rawBlock + CircleParameterData.smoothBlockTransfer + rw [← Finset.sum_add_distrib, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro i hi + convert characterSmoothedDrop_eq_add_coboundary (p.C j) θ (p.alpha θ i / 4) + (p.q i : ℤ) x using 1 <;> + simp only [CircleParameterData.alpha, CircleParameterData.coordinate, + CircleParameterData.rep, Int.cast_natCast, natCast_zsmul] + +omit hp in + +theorem continuous_relocatedBlock (j : ℕ) : Continuous (p.relocatedBlock θ j) := by + exact continuous_relocated (Homeomorph.addRight (θ : Circle)) _ _ _ + (continuous_smoothBlock p θ j) (fun n _ => (p.partition j n).continuous) + +omit hp in +theorem continuous_relocatedBlockTransfer (j : ℕ) : + Continuous (p.relocatedBlockTransfer θ j) := by + exact continuous_relocationTransfer (Homeomorph.addRight (θ : Circle)) _ _ _ + (continuous_smoothBlock p θ j) (fun n _ => (p.partition j n).continuous) + +theorem relocatedBlock_nonneg (j : ℕ) (hj : 1 ≤ j) (x : Circle) : + 0 ≤ p.relocatedBlock θ j x := by + exact relocated_nonneg _ _ _ _ (hp.smoothBlock_nonneg j hj) + (hp.partition_nonneg j hj) x + +theorem relocatedBlock_eq_add_coboundary (j : ℕ) (hj : 1 ≤ j) (x : Circle) : + p.relocatedBlock θ j x = p.smoothBlock θ j x + p.relocatedBlockTransfer θ j x - + p.relocatedBlockTransfer θ j (x + (θ : Circle)) := by + exact relocated_eq_add_coboundary _ _ _ _ x (hp.partition_sum j hj x) + +omit hp in +private theorem measure_support_finsetSum_le {ι : Type*} (s : Finset ι) + (f : ι → Circle → ℝ) : + volume (Function.support (fun x => ∑ i ∈ s, f i x)) ≤ + ∑ i ∈ s, volume (Function.support (f i)) := by + have hsub : Function.support (fun x => ∑ i ∈ s, f i x) ⊆ + ⋃ i ∈ s, Function.support (f i) := by + intro x hx + by_contra hn + apply hx + apply Finset.sum_eq_zero + intro i hi + by_contra hne + exact hn (Set.mem_iUnion.mpr ⟨i, Set.mem_iUnion.mpr ⟨hi, hne⟩⟩) + exact (measure_mono hsub).trans (measure_biUnion_finset_le s _) + +theorem measure_smoothBlock_support_le (j : ℕ) (hj : 1 ≤ j) : + volume (Function.support (p.smoothBlock θ j)) ≤ ENNReal.ofReal (3 / (p.K j : ℝ)) := by + have hα (i : ℕ) (hi : i ∈ p.block j) := hp.block_phase_pos j hj i hi + calc + _ ≤ ∑ i ∈ p.block j, volume (Function.support (fun x : Circle => + circleSmoothedDrop (p.C j) (p.alpha θ i) (p.alpha θ i / 4) ((p.q i : ℤ) • x))) := + measure_support_finsetSum_le _ _ + _ ≤ ∑ i ∈ p.block j, ENNReal.ofReal (p.alpha θ i + 2 * (p.alpha θ i / 4)) := by + apply Finset.sum_le_sum + intro i hi + exact measure_characterSmoothedDrop_support_le _ (hα i hi).le + (div_pos (hα i hi) (by norm_num)) (by exact_mod_cast (hp.q_pos i).ne') + _ = ENNReal.ofReal (∑ i ∈ p.block j, (p.alpha θ i + 2 * (p.alpha θ i / 4))) := by + symm + apply ENNReal.ofReal_sum_of_nonneg + intro i hi + have := (hα i hi).le + positivity + _ ≤ ENNReal.ofReal (3 / (p.K j : ℝ)) := by + apply ENNReal.ofReal_le_ofReal + calc + _ = (3 / 2 : ℝ) * ∑ i ∈ p.block j, p.alpha θ i := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + ring + _ ≤ (3 / 2 : ℝ) * (2 / (p.K j : ℝ)) := + mul_le_mul_of_nonneg_left (hp.block_phase_sum_le j hj) (by norm_num) + _ = _ := by ring + +theorem measure_smoothBlockTransfer_support_le (j : ℕ) (hj : 1 ≤ j) : + volume (Function.support (p.smoothBlockTransfer θ j)) ≤ + ENNReal.ofReal (1 / (p.K j : ℝ)) := by + have hα (i : ℕ) (hi : i ∈ p.block j) := hp.block_phase_pos j hj i hi + calc + _ ≤ ∑ i ∈ p.block j, volume (Function.support (fun x : Circle => + circleSmoothingTransfer (p.C j) (p.alpha θ i / 4) ((p.q i : ℤ) • x))) := + measure_support_finsetSum_le _ _ + _ ≤ ∑ i ∈ p.block j, ENNReal.ofReal (2 * (p.alpha θ i / 4)) := by + apply Finset.sum_le_sum + intro i hi + exact measure_characterSmoothingTransfer_support_le _ + (div_pos (hα i hi) (by norm_num)) (by exact_mod_cast (hp.q_pos i).ne') + _ = ENNReal.ofReal (∑ i ∈ p.block j, 2 * (p.alpha θ i / 4)) := by + symm + apply ENNReal.ofReal_sum_of_nonneg + intro i hi + have := (hα i hi).le + positivity + _ ≤ ENNReal.ofReal (1 / (p.K j : ℝ)) := by + apply ENNReal.ofReal_le_ofReal + calc + _ = (1 / 2 : ℝ) * ∑ i ∈ p.block j, p.alpha θ i := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + ring + _ ≤ (1 / 2 : ℝ) * (2 / (p.K j : ℝ)) := + mul_le_mul_of_nonneg_left (hp.block_phase_sum_le j hj) (by norm_num) + _ = _ := by ring + +theorem measure_relocatedBlockTransfer_support_le (j : ℕ) (hj : 1 ≤ j) : + volume (Function.support (p.relocatedBlockTransfer θ j)) ≤ + ENNReal.ofReal (3 * ((p.height j : ℝ) / p.K j)) := by + calc + _ ≤ (p.height j : ℝ≥0∞) * volume (Function.support (p.smoothBlock θ j)) := by + exact measure_support_relocationTransfer_le (MeasurableEquiv.addRight (θ : Circle)) + (measurePreserving_add_right volume _) _ (continuous_smoothBlock p θ j).measurable _ _ + _ ≤ (p.height j : ℝ≥0∞) * ENNReal.ofReal (3 / (p.K j : ℝ)) := + mul_le_mul_right (hp.measure_smoothBlock_support_le j hj) _ + _ = ENNReal.ofReal (3 * ((p.height j : ℝ) / p.K j)) := by + rw [← ENNReal.ofReal_natCast, ← ENNReal.ofReal_mul (Nat.cast_nonneg _)] + congr 1 + ring + +theorem support_relocatedBlock_subset (j : ℕ) (hj : 1 ≤ j) : + Function.support (p.relocatedBlock θ j) ⊆ + Metric.ball (0 : Circle) (1 / (10 * (j : ℝ))) := by + apply support_relocated_subset + intro n hn + rintro y ⟨x, hx, rfl⟩ + change dist (((fun z : Circle => z + (θ : Circle))^[n]) x) 0 < _ + rw [add_right_iterate] + have hs := hp.partition_support j hj n hn x (subset_tsupport _ hx) + simpa only [← AddCircle.coe_nsmul, nsmul_eq_mul] using hs + +theorem tsupport_relocatedBlock_subset (j : ℕ) (hj : 1 ≤ j) : + tsupport (p.relocatedBlock θ j) ⊆ + Metric.ball (0 : Circle) (1 / (10 * (j : ℝ))) := by + apply tsupport_relocated_subset (Homeomorph.addRight (θ : Circle)) + intro n hn + rintro y ⟨x, hx, rfl⟩ + change dist (((fun z : Circle => z + (θ : Circle))^[n]) x) 0 < _ + rw [add_right_iterate] + have hs := hp.partition_support j hj n hn x hx + simpa only [← AddCircle.coe_nsmul, nsmul_eq_mul] using hs + +theorem integral_relocatedBlock (j : ℕ) (hj : 1 ≤ j) : + (∫ x, p.relocatedBlock θ j x) = p.C j * ∑ i ∈ p.block j, p.alpha θ i := by + have ht : (∫ x, p.relocatedBlock θ j x) = ∫ x, p.smoothBlock θ j x := by + apply integral_relocated (MeasurableEquiv.addRight (θ : Circle)) + (measurePreserving_add_right volume _) + · intro n hn + exact ((continuous_smoothBlock p θ j).mul (p.partition j n).continuous).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + · exact hp.partition_sum j hj + exact ht.trans (hp.integral_smoothBlock j) + +theorem block_phase_sum_ge (j : ℕ) (hj : 1 ≤ j) : + 1 / (p.K j : ℝ) ≤ ∑ i ∈ p.block j, p.alpha θ i := by + have hm : (p.m j : ℝ) ≠ 0 := by exact_mod_cast (hp.m_pos j hj).ne' + have hK : (p.K j : ℝ) ≠ 0 := by exact_mod_cast (hp.K_pos j hj).ne' + calc + _ = ∑ _i ∈ p.block j, 1 / p.N j := by + simp only [Finset.sum_const, nsmul_eq_mul, p.card_block j hj, CircleParameterData.N] + field_simp + _ ≤ _ := Finset.sum_le_sum (fun i hi => (hp.phase_bounds j hj i hi).1.le) + +theorem integral_relocatedBlock_ge_K (j : ℕ) (hj : 1 ≤ j) : + (p.K j : ℝ) ≤ ∫ x, p.relocatedBlock θ j x := by + have hK : 0 < (p.K j : ℝ) := Nat.cast_pos.mpr (hp.K_pos j hj) + have hC : (p.K j : ℝ) ^ 2 ≤ p.C j := by + rw [hp.C_eq j hj] + exact le_max_right _ _ + rw [hp.integral_relocatedBlock j hj] + calc + (p.K j : ℝ) ≤ p.C j * (1 / (p.K j : ℝ)) := by + rw [mul_one_div, le_div_iff₀ hK] + nlinarith + _ ≤ _ := mul_le_mul_of_nonneg_left (hp.block_phase_sum_ge j hj) (hp.C_pos j hj).le + +theorem tsum_smoothBlock_support_ne_top : + (∑' n : ℕ, volume (Function.support (p.smoothBlock θ (n + 1)))) ≠ ⊤ := by + have hsum := (hp.summable_reciprocal.mul_left 3).tsum_ofReal_ne_top + apply ne_top_of_le_ne_top hsum + apply ENNReal.tsum_le_tsum + intro n + simpa only [mul_one_div] using hp.measure_smoothBlock_support_le (n + 1) (by omega) + +theorem tsum_smoothBlockTransfer_support_ne_top : + (∑' n : ℕ, volume (Function.support (p.smoothBlockTransfer θ (n + 1)))) ≠ ⊤ := by + apply ne_top_of_le_ne_top hp.summable_reciprocal.tsum_ofReal_ne_top + exact ENNReal.tsum_le_tsum (fun n => + hp.measure_smoothBlockTransfer_support_le (n + 1) (by omega)) + +theorem tsum_height_mul_smoothBlock_support_ne_top : + (∑' n : ℕ, (p.height (n + 1) : ℝ≥0∞) * + volume (Function.support (p.smoothBlock θ (n + 1)))) ≠ ⊤ := by + apply ne_top_of_le_ne_top (hp.summable_partition_cost.mul_left 3).tsum_ofReal_ne_top + apply ENNReal.tsum_le_tsum + intro n + have hK : 0 < (p.K (n + 1) : ℝ) := hp.shifted_K_pos n + calc + _ ≤ (p.height (n + 1) : ℝ≥0∞) * ENNReal.ofReal (3 / (p.K (n + 1) : ℝ)) := + mul_le_mul_right (hp.measure_smoothBlock_support_le (n + 1) (by omega)) _ + _ = ENNReal.ofReal (3 * ((p.height (n + 1) : ℝ) / p.K (n + 1))) := by + rw [← ENNReal.ofReal_natCast, ← ENNReal.ofReal_mul (Nat.cast_nonneg _)] + congr 1 + ring + _ ≤ ENNReal.ofReal (3 * ((1 + (p.height (n + 1) : ℝ)) / p.K (n + 1))) := by + apply ENNReal.ofReal_le_ofReal + apply mul_le_mul_of_nonneg_left _ (by norm_num) + exact div_le_div_of_nonneg_right (by linarith) hK.le + +theorem tsum_relocatedBlockTransfer_support_ne_top : + (∑' n : ℕ, volume (Function.support (p.relocatedBlockTransfer θ (n + 1)))) ≠ ⊤ := by + apply ne_top_of_le_ne_top hp.tsum_height_mul_smoothBlock_support_ne_top + apply ENNReal.tsum_le_tsum + intro n + exact measure_support_relocationTransfer_le (MeasurableEquiv.addRight (θ : Circle)) + (measurePreserving_add_right volume _) _ (continuous_smoothBlock p θ (n + 1)).measurable _ _ + +theorem ae_finite_smoothing_and_relocation_support : + ∀ᵐ x : Circle, (Function.support (fun n : ℕ => p.smoothBlock θ (n + 1) x)).Finite ∧ + (Function.support (fun n : ℕ => p.smoothBlockTransfer θ (n + 1) x)).Finite ∧ + (Function.support (fun n : ℕ => p.relocatedBlockTransfer θ (n + 1) x)).Finite := by + have h1 := ae_finite_setOfPred_mem hp.tsum_smoothBlock_support_ne_top + have h2 := ae_finite_setOfPred_mem hp.tsum_smoothBlockTransfer_support_ne_top + have h3 := ae_finite_setOfPred_mem hp.tsum_relocatedBlockTransfer_support_ne_top + filter_upwards [h1, h2, h3] with x hx1 hx2 hx3 + exact ⟨hx1, hx2, hx3⟩ + +omit hp in +private theorem shrinking_radius_tendsto_zero : + Filter.Tendsto (fun n : ℕ => 1 / (10 * ((n + 1 : ℕ) : ℝ))) + Filter.atTop (nhds 0) := by + have ht := (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).div_const 10 + convert ht using 1 + · funext n + push_cast + field_simp + · norm_num + +theorem relocatedBlock_locally_finite : + ∀ x : Circle, x ≠ 0 → ∃ s : Finset ℕ, + ∀ᶠ y in nhds x, ∀ n ∉ s, p.relocatedBlock θ (n + 1) y = 0 := by + apply BackgroundCost.locally_finite_of_support_shrinks 0 _ _ shrinking_radius_tendsto_zero + intro n x hx + exact (hp.support_relocatedBlock_subset (n + 1) (by omega) hx).le + +theorem summable_relocatedBlock_of_ne_zero {x : Circle} (hx : x ≠ 0) : + Summable (fun n : ℕ => p.relocatedBlock θ (n + 1) x) := by + obtain ⟨s, hs⟩ := hp.relocatedBlock_locally_finite x hx + exact summable_of_ne_finset_zero (mem_of_mem_nhds hs) + +theorem continuousOn_relocatedCost : ContinuousOn (p.relocatedCost θ) ({0}ᶜ : Set Circle) := by + exact BackgroundCost.continuousOn_tsum_of_locally_finite _ _ + (fun n => continuous_relocatedBlock (p := p) (θ := θ) (n + 1)) + (fun x hx => hp.relocatedBlock_locally_finite x hx) + +theorem relocatedCost_nonneg (x : Circle) : 0 ≤ p.relocatedCost θ x := + tsum_nonneg (fun n => hp.relocatedBlock_nonneg (n + 1) (by omega) x) + +theorem ae_summable_relocatedBlock : + ∀ᵐ x : Circle, Summable (fun n : ℕ => p.relocatedBlock θ (n + 1) x) := by + have hzero : volume ({0} : Set Circle) = 0 := by + rw [← Metric.closedBall_zero, AddCircle.volume_closedBall] + norm_num + have hne : ∀ᵐ x : Circle, x ≠ 0 := by + rw [ae_iff] + simpa only [not_not, Set.ofPred_eq_eq_singleton] using hzero + exact hne.mono (fun x hx => hp.summable_relocatedBlock_of_ne_zero hx) + +theorem lintegral_relocatedCost_eq_top : + (∫⁻ x : Circle, ENNReal.ofReal (p.relocatedCost θ x)) = ⊤ := by + have hsum : (∫⁻ x : Circle, ENNReal.ofReal (p.relocatedCost θ x)) = + ∑' n : ℕ, ∫⁻ x : Circle, ENNReal.ofReal (p.relocatedBlock θ (n + 1) x) := by + calc + _ = ∫⁻ x : Circle, ∑' n : ℕ, ENNReal.ofReal (p.relocatedBlock θ (n + 1) x) := by + apply lintegral_congr_ae + exact hp.ae_summable_relocatedBlock.mono (fun x hx => + ENNReal.ofReal_tsum_of_nonneg + (fun n => hp.relocatedBlock_nonneg (n + 1) (by omega) x) hx) + _ = _ := lintegral_tsum (fun n => + (continuous_relocatedBlock (p := p) (θ := θ) (n + 1)).measurable.ennreal_ofReal.aemeasurable) + rw [hsum] + apply top_unique + calc + ⊤ = ∑' _n : ℕ, (1 : ℝ≥0∞) := + (ENNReal.tsum_const_eq_top_of_ne_zero one_ne_zero).symm + _ ≤ ∑' n : ℕ, ∫⁻ x : Circle, ENNReal.ofReal (p.relocatedBlock θ (n + 1) x) := by + apply ENNReal.tsum_le_tsum + intro n + rw [← ofReal_integral_eq_lintegral_ofReal + ((continuous_relocatedBlock (p := p) (θ := θ) (n + 1)).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _)) + (Filter.Eventually.of_forall (hp.relocatedBlock_nonneg (n + 1) (by omega)))] + apply ENNReal.one_le_ofReal.mpr + have hK : (1 : ℝ) ≤ p.K (n + 1) := by + exact_mod_cast hp.K_pos (n + 1) (by omega) + exact hK.trans (hp.integral_relocatedBlock_ge_K (n + 1) (by omega)) + +end CircleParameterLaws +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterTailAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterTailAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..64ffcccfdbfee38c7ffb6a0985c9905a210d55a3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterTailAttenuation.lean @@ -0,0 +1,162 @@ +import OAI.Analysis.IrrationalRotation.Couplings.CircleConditionalAttenuation +import OAI.Analysis.IrrationalRotation.Analysis.TailScaleCover + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set + +namespace Invariant233.CircleParameterLaws +open CircleParameterData + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem measurable_parameter_coordinate (i : ℕ) : Measurable (p.coordinate i) := by + have hq : (p.q i : ℤ) ≠ 0 := by exact_mod_cast (hp.q_pos i).ne' + change Measurable (fun x : UnitAddCircle => + ((AddCircle.equivIco (1 : ℝ) 0 (p.q i • x)) : ℝ)) + simpa only [natCast_zsmul] using + (CircleWeightSupport.measurePreserving_characterRepresentative (p.q i) hq).measurable + +theorem finite_parameter_conditional_attenuation + {Ω : Type*} (mx my : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} + [StandardBorelSpace Ω] (hmx : mx ≤ mΩ) (hmy : my ≤ mΩ) + (μ : Measure Ω) [IsFiniteMeasure μ] + (x y : Ω → Circle) (hx : Measurable[mx] x) (hy : Measurable[my] y) + (hacx : μ.map x ≪ circleMeasure) (hacy : μ.map y ≪ circleMeasure) + (horder : ∀ᵐ ω ∂μ, ∀ i : p.Coord, + p.coordinate i.2 (x ω) ≤ p.coordinate i.2 (y ω)) + (top bottom : ℕ → Set Ω) + (htop : ∀ i, MeasurableSet (top i)) (hbottom : ∀ i, MeasurableSet (bottom i)) + (hindTop : iCondIndepSet mx hmx top μ) (hindBottom : iCondIndepSet my hmy bottom μ) + (s : ℕ) (hs : 1 ≤ s) (k : ℤ) (I : Finset ℕ) (hIs : I ⊆ p.block s) + (hI : (p.m s : ℝ) / 20 ≤ (I.card : ℝ)) + (ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ (p.m s : ℝ) * ρ) (hcost : L ≤ p.C s) + (hforceTop : ∀ᵐ ω ∂μ, ∀ i ∈ I, + p.coordinate i (x ω) < 1 - Int.fract ((k : ℝ) * p.alpha θ i) → + ω ∈ top i → 1 - Int.fract ((k : ℝ) * p.alpha θ i) ≤ p.coordinate i (y ω)) + (hforceBottom : ∀ᵐ ω ∂μ, ∀ i ∈ I, + 1 - Int.fract ((k : ℝ) * p.alpha θ i) ≤ p.coordinate i (y ω) → + ω ∈ bottom i → p.coordinate i (x ω) < 1 - Int.fract ((k : ℝ) * p.alpha θ i)) + (hprobTop : ∀ᵐ ω ∂μ, ∀ i ∈ I, + p.coordinate i (x ω) < 1 - Int.fract ((k : ℝ) * p.alpha θ i) → + ρ / 10 ≤ (μ[(top i).indicator (fun _ => (1 : ℝ)) | mx]) ω) + (hprobBottom : ∀ᵐ ω ∂μ, ∀ i ∈ I, + 1 - Int.fract ((k : ℝ) * p.alpha θ i) ≤ p.coordinate i (y ω) → + ρ / 10 ≤ (μ[(bottom i).indicator (fun _ => (1 : ℝ)) | my]) ω) : + ∃ H₁ H₂ : Set Ω, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂μ, (μ[H₁.indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂μ, (μ[H₂.indicator (fun _ => (1 : ℝ)) | my]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂μ, p.floorCocycle θ k (y ω) / p.floorCocycle θ k (x ω) ≤ + Real.exp (-L) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + have hs' : s - 1 + 1 = s := by omega + let coord (i : ℕ) (hi : i ∈ I) : p.Coord := + ⟨s - 1, ⟨i, by simpa only [hs'] using hIs hi⟩⟩ + have hxrep : Measurable[mx] (fun ω i => p.coordinate i (x ω)) := by + let : MeasurableSpace Ω := mx + exact Measurable.of_eval (fun i => (hp.measurable_parameter_coordinate i).comp hx) + have hyrep : Measurable[my] (fun ω i => p.coordinate i (y ω)) := by + let : MeasurableSpace Ω := my + exact Measurable.of_eval (fun i => (hp.measurable_parameter_coordinate i).comp hy) + have hr := hp.ae_parameter_ratio_bounds_of_map_ac μ x y + (hx.mono hmx le_rfl).aemeasurable (hy.mono hmy le_rfl).aemeasurable hacx hacy horder + apply CrossingAvoidance.finite_conditional_attenuation mx my hmx hmy μ I + (fun i => 1 - Int.fract ((k : ℝ) * p.alpha θ i)) + (fun ω i => p.coordinate i (x ω)) (fun ω i => p.coordinate i (y ω)) + hxrep hyrep top bottom htop hbottom hindTop hindBottom (p.m s) ρ L hρ hL hI + (horder.mono (fun _ h i hi => h (coord i hi))) + hforceTop hforceBottom hprobTop hprobBottom + (fun ω => p.floorCocycle θ k (y ω) / p.floorCocycle θ k (x ω)) + (hr.mono (fun _ h => (h k).1)) + filter_upwards [hr] with ω hω + intro i hi hcross + have hc : L ≤ p.coordCost (coord i hi) := by + change L ≤ p.C (s - 1 + 1) + rwa [hs'] + exact ((hω k).2 (coord i hi) hcross).trans (Real.exp_le_exp.mpr (neg_le_neg hc)) + +theorem parameter_tail_conditional_attenuation + {Ω : Type*} (mx my : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} + [StandardBorelSpace Ω] (hmx : mx ≤ mΩ) (hmy : my ≤ mΩ) + (μ : Measure Ω) [IsFiniteMeasure μ] + (x y : Ω → Circle) (hx : Measurable[mx] x) (hy : Measurable[my] y) + (hacx : μ.map x ≪ circleMeasure) (hacy : μ.map y ≪ circleMeasure) + (horder : ∀ᵐ ω ∂μ, ∀ i : p.Coord, + p.coordinate i.2 (x ω) ≤ p.coordinate i.2 (y ω)) + (top bottom : Bool → ℕ → Set Ω) + (htop : ∀ which i, MeasurableSet (top which i)) + (hbottom : ∀ which i, MeasurableSet (bottom which i)) + (hindTop : ∀ which, iCondIndepSet mx hmx (top which) μ) + (hindBottom : ∀ which, iCondIndepSet my hmy (bottom which) μ) + (j : ℕ) (hj : 1 ≤ j) + (hlabels : ∀ s, j ≤ s → ∀ which : Bool, ∀ i ∈ p.block s, + ∀ u ∈ Icc (if which then p.b s else p.a s) + (1 - (if which then p.b s else p.a s)), ∀ᵐ ω ∂μ, + (p.coordinate i (x ω) < u → ω ∈ top which i → u ≤ p.coordinate i (y ω)) ∧ + (u ≤ p.coordinate i (y ω) → ω ∈ bottom which i → p.coordinate i (x ω) < u) ∧ + (p.coordinate i (x ω) < u → + (kappa s * Real.sqrt ((if which then p.b s else p.a s) / (p.m s : ℝ))) / 10 ≤ + (μ[(top which i).indicator (fun _ => (1 : ℝ)) | mx]) ω) ∧ + (u ≤ p.coordinate i (y ω) → + (kappa s * Real.sqrt ((if which then p.b s else p.a s) / (p.m s : ℝ))) / 10 ≤ + (μ[(bottom which i).indicator (fun _ => (1 : ℝ)) | my]) ω)) + (E : Set Ω) (htag : ∀ᵐ ω ∂μ, ω ∈ E → ∃ i ∈ p.block j, + p.coordinate i (x ω) < 1 / (p.m j : ℝ) ∧ + 1 - 1 / (p.m j : ℝ) < p.coordinate i (y ω)) + (k : ℤ) (hk : (p.K j : ℝ) < |(k : ℝ)|) : + ∃ H₁ H₂ : Set Ω, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂μ, (μ[H₁.indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ Real.exp (-p.L j / 400)) ∧ + (∀ᵐ ω ∂μ, (μ[H₂.indicator (fun _ => (1 : ℝ)) | my]) ω ≤ Real.exp (-p.L j / 400)) ∧ + (∀ᵐ ω ∂μ, ω ∈ E → + p.floorCocycle θ k (y ω) / p.floorCocycle θ k (x ω) ≤ + Real.exp (-p.L j) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + by_cases hnear : |(k : ℝ)| ≤ p.N j / 4 + · exact CrossingAvoidance.empty_exceptional_events mx my μ E + (fun ω => p.floorCocycle θ k (y ω) / p.floorCocycle θ k (x ω)) + (Real.exp (-p.L j)) (Real.exp (-p.L j / 400)) (Real.exp_pos _).le + (hp.ae_parameter_tagged_ratio_le_exp μ x y + (hx.mono hmx le_rfl).aemeasurable (hy.mono hmy le_rfl).aemeasurable + hacx hacy horder j hj k hk hnear E htag) + · obtain ⟨s, w, I, hjs, hw, hIs, hI, hthreshold, hIntensity, hcost⟩ := + hp.exists_tail_crossing_set j hj k (le_of_not_ge hnear) + obtain ⟨which, rfl⟩ : ∃ which : Bool, w = if which then p.b s else p.a s := by + rcases hw with hw | ⟨_, hw⟩ + · exact ⟨true, by simpa using hw⟩ + · exact ⟨false, by simpa using hw⟩ + let w : ℝ := if which then p.b s else p.a s + let ρ : ℝ := kappa s * Real.sqrt (w / (p.m s : ℝ)) + have hρ : 0 ≤ ρ := mul_nonneg (by unfold kappa; positivity) (Real.sqrt_nonneg _) + have hl : ∀ᵐ ω ∂μ, ∀ i ∈ I, + (p.coordinate i (x ω) < 1 - Int.fract ((k : ℝ) * p.alpha θ i) → + ω ∈ top which i → 1 - Int.fract ((k : ℝ) * p.alpha θ i) ≤ p.coordinate i (y ω)) ∧ + (1 - Int.fract ((k : ℝ) * p.alpha θ i) ≤ p.coordinate i (y ω) → + ω ∈ bottom which i → p.coordinate i (x ω) < 1 - Int.fract ((k : ℝ) * p.alpha θ i)) ∧ + (p.coordinate i (x ω) < 1 - Int.fract ((k : ℝ) * p.alpha θ i) → + ρ / 10 ≤ (μ[(top which i).indicator (fun _ => (1 : ℝ)) | mx]) ω) ∧ + (1 - Int.fract ((k : ℝ) * p.alpha θ i) ≤ p.coordinate i (y ω) → + ρ / 10 ≤ (μ[(bottom which i).indicator (fun _ => (1 : ℝ)) | my]) ω) := by + apply ae_all_iff.mpr + intro i + apply ae_all_iff.mpr + intro hi + exact hlabels s hjs which i (hIs hi) + (1 - Int.fract ((k : ℝ) * p.alpha θ i)) (hthreshold i hi) + obtain ⟨H₁, H₂, hm₁, hm₂, hb₁, hb₂, hr⟩ := + hp.finite_parameter_conditional_attenuation mx my hmx hmy μ x y hx hy hacx hacy + horder (top which) (bottom which) (htop which) (hbottom which) + (hindTop which) (hindBottom which) s (hj.trans hjs) k I hIs hI + ρ (p.L j) hρ hIntensity hcost + (hl.mono (fun _ h i hi => (h i hi).1)) + (hl.mono (fun _ h i hi => (h i hi).2.1)) + (hl.mono (fun _ h i hi => (h i hi).2.2.1)) + (hl.mono (fun _ h i hi => (h i hi).2.2.2)) + exact ⟨H₁, H₂, hm₁, hm₂, hb₁, hb₂, hr.mono (fun _ h _ => h)⟩ + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterTails.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterTails.lean new file mode 100644 index 0000000000000000000000000000000000000000..a91f6146122a3af3edc79058194bf94a9c63dcba --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ParameterTails.lean @@ -0,0 +1,76 @@ +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +import Mathlib.Tactic + +namespace OAI + +open Filter +open scoped Topology + +namespace Invariant233.ParameterTails + +theorem half_decay_iterate {a : ℕ → ℝ} + (hstep : ∀ n, a (n + 1) ≤ a n / 2) (j n : ℕ) : + a (j + n) ≤ a j * (1 / 2 : ℝ) ^ n := by + induction n with + | zero => simp + | succ n ih => + calc + a (j + (n + 1)) ≤ a (j + n) / 2 := by + simpa only [Nat.add_assoc] using hstep (j + n) + _ ≤ (a j * (1 / 2 : ℝ) ^ n) / 2 := by linarith + _ = a j * (1 / 2 : ℝ) ^ (n + 1) := by rw [pow_succ]; ring + +theorem summable_of_half_decay {a : ℕ → ℝ} (ha : ∀ n, 0 ≤ a n) + (hstep : ∀ n, a (n + 1) ≤ a n / 2) : Summable a := by + apply Summable.of_nonneg_of_le ha + (fun n => by simpa using half_decay_iterate hstep 0 n) + simpa using summable_geometric_two.mul_left (a 0) + +theorem tsum_tail_le_of_half_decay {a : ℕ → ℝ} (ha : ∀ n, 0 ≤ a n) + (hstep : ∀ n, a (n + 1) ≤ a n / 2) (j : ℕ) : + (∑' n : ℕ, a (j + n)) ≤ 2 * a j := by + have hs : Summable (fun n : ℕ => a (j + n)) := + summable_of_half_decay (fun n => ha (j + n)) + (fun n => by simpa only [Nat.add_assoc] using hstep (j + n)) + calc + (∑' n : ℕ, a (j + n)) ≤ ∑' n : ℕ, a j * (1 / 2 : ℝ) ^ n := + hs.tsum_le_tsum (half_decay_iterate hstep j) + (summable_geometric_two.mul_left (a j)) + _ = 2 * a j := by rw [tsum_mul_left, tsum_geometric_two]; ring + +theorem reciprocal_half_decay {K : ℕ → ℝ} (hK : ∀ n, 0 < K n) + (hdouble : ∀ n, 2 * K n ≤ K (n + 1)) (n : ℕ) : + 1 / K (n + 1) ≤ (1 / K n) / 2 := by + calc + 1 / K (n + 1) ≤ 1 / (2 * K n) := + one_div_le_one_div_of_le (mul_pos (by norm_num) (hK n)) (hdouble n) + _ = (1 / K n) / 2 := by ring + +theorem reciprocal_tail_bound {K : ℕ → ℝ} (hK : ∀ n, 0 < K n) + (hdouble : ∀ n, 2 * K n ≤ K (n + 1)) (j : ℕ) : + (∑' n : ℕ, 1 / K (j + 1 + n)) ≤ 2 / K (j + 1) := by + simpa only [div_eq_mul_inv, one_mul] using + tsum_tail_le_of_half_decay (fun n => le_of_lt (one_div_pos.mpr (hK n))) + (reciprocal_half_decay hK hdouble) (j + 1) + +theorem summable_reciprocal {K : ℕ → ℝ} (hK : ∀ n, 0 < K n) + (hdouble : ∀ n, 2 * K n ≤ K (n + 1)) : + Summable (fun n => 1 / K n) := + summable_of_half_decay (fun n => le_of_lt (one_div_pos.mpr (hK n))) + (reciprocal_half_decay hK hdouble) + +theorem summable_partition_cost {K h : ℕ → ℝ} (hK : ∀ n, 0 < K n) + (hdouble : ∀ n, 2 * K n ≤ K (n + 1)) (hh : ∀ n, 0 ≤ h n) + (hheight : ∀ n, h (n + 1) / K (n + 1) ≤ (1 / 2 : ℝ) ^ n) : + Summable (fun n => (1 + h n) / K n) := by + have hsum : Summable (fun n => h n / K n) := by + apply (summable_nat_add_iff 1).mp + exact Summable.of_nonneg_of_le + (fun n => div_nonneg (hh (n + 1)) (hK (n + 1)).le) + hheight summable_geometric_two + simpa only [add_div] using (summable_reciprocal hK hdouble).add hsum + +end Invariant233.ParameterTails + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/PeriodicIntervalDiscrepancy.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/PeriodicIntervalDiscrepancy.lean new file mode 100644 index 0000000000000000000000000000000000000000..6071f89715d1ea11e9c1dd052107316084ee855c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/PeriodicIntervalDiscrepancy.lean @@ -0,0 +1,165 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ModuloIntervalMeasure + +namespace OAI + +namespace Invariant233.PeriodicIntervalDiscrepancy + +open Set MeasureTheory +open scoped ENNReal + +theorem length_sub_one_mul_integral_le {f : ℝ → ℝ} + (hperiod : Function.Periodic f 1) (hf : ∀ x, 0 ≤ f x) + (hint : IntervalIntegrable f volume 0 1) {a b : ℝ} (hab : a ≤ b) : + (b - a - 1) * (∫ x in (0 : ℝ)..1, f x) ≤ ∫ x in a..b, f x := by + let n : ℕ := ⌊b - a⌋₊ + have hn : a + n ≤ b := by + have := Nat.floor_le (sub_nonneg.mpr hab) + dsimp [n] + linarith + have hn' : b - a - 1 ≤ (n : ℝ) := (Nat.sub_one_lt_floor (b - a)).le + have hint' := hperiod.intervalIntegrable₀ (by norm_num : (1 : ℝ) ≠ 0) hint + have hmass : 0 ≤ ∫ x in (0 : ℝ)..1, f x := + intervalIntegral.integral_nonneg_of_forall (by norm_num) hf + calc + (b - a - 1) * (∫ x in (0 : ℝ)..1, f x) ≤ + (n : ℝ) * (∫ x in (0 : ℝ)..1, f x) := + mul_le_mul_of_nonneg_right hn' hmass + _ = ∫ x in a..a + n, f x := by + have h := hperiod.intervalIntegral_add_zsmul_eq (n : ℤ) a hint' + simpa only [zsmul_eq_mul, Int.cast_natCast, mul_one, + hperiod.intervalIntegral_add_eq a 0, zero_add] using h.symm + _ ≤ ∫ x in a..b, f x := + intervalIntegral.integral_mono_interval le_rfl (le_add_of_nonneg_right (Nat.cast_nonneg n)) hn + (Filter.Eventually.of_forall hf) (hint' _ _) + +theorem abs_integral_sub_length_mul_integral_le {f : ℝ → ℝ} + (hperiod : Function.Periodic f 1) (hint : IntervalIntegrable f volume 0 1) + {a b : ℝ} (hab : a ≤ b) : + |(∫ x in a..b, f x) - (b - a) * (∫ x in (0 : ℝ)..1, f x)| ≤ + ∫ x in (0 : ℝ)..1, |f x| := by + have hperiodAbs : Function.Periodic (fun x => |f x|) 1 := by + intro x + change |f (x + 1)| = |f x| + rw [hperiod x] + have hp : ∀ x, 0 ≤ |f x| + f x := fun x => by linarith [neg_abs_le (f x)] + have hm : ∀ x, 0 ≤ |f x| - f x := fun x => sub_nonneg.mpr (le_abs_self (f x)) + have hint' := hperiod.intervalIntegrable₀ (by norm_num : (1 : ℝ) ≠ 0) hint + have hpu := ModuloIntervalMeasure.integral_periodic_le_length_add_one + (hperiodAbs.add hperiod) hp (hint.abs.add hint) hab + have hpl := length_sub_one_mul_integral_le + (hperiodAbs.add hperiod) hp (hint.abs.add hint) hab + have hmu := ModuloIntervalMeasure.integral_periodic_le_length_add_one + (hperiodAbs.sub hperiod) hm (hint.abs.sub hint) hab + have hml := length_sub_one_mul_integral_le + (hperiodAbs.sub hperiod) hm (hint.abs.sub hint) hab + simp only [Pi.add_apply, Pi.sub_apply] at hpu hpl hmu hml + rw [intervalIntegral.integral_add (hint' a b).abs (hint' a b), + intervalIntegral.integral_add hint.abs hint] at hpu hpl + rw [intervalIntegral.integral_sub (hint' a b).abs (hint' a b), + intervalIntegral.integral_sub hint.abs hint] at hmu hml + apply abs_le.mpr + constructor <;> nlinarith + +theorem integral_cond_Ioc {f : ℝ → ℝ} {a b : ℝ} (hab : a < b) : + (∫ x, f x ∂ProbabilityTheory.cond volume (Ioc a b)) = + (b - a)⁻¹ * ∫ x in a..b, f x := by + rw [ProbabilityTheory.cond, integral_smul_measure, ENNReal.toReal_inv, + Real.volume_Ioc, ENNReal.toReal_ofReal (sub_pos.mpr hab).le, + intervalIntegral.integral_of_le hab.le, smul_eq_mul] + +theorem abs_integral_cond_sub_integral_le {f : ℝ → ℝ} + (hperiod : Function.Periodic f 1) (hint : IntervalIntegrable f volume 0 1) + {a b : ℝ} (hab : a < b) : + |(∫ x, f x ∂ProbabilityTheory.cond volume (Ioc a b)) - + (∫ x in (0 : ℝ)..1, f x)| ≤ + (b - a)⁻¹ * ∫ x in (0 : ℝ)..1, |f x| := by + have hlen : 0 < b - a := sub_pos.mpr hab + rw [integral_cond_Ioc hab] + calc + |(b - a)⁻¹ * (∫ x in a..b, f x) - (∫ x in (0 : ℝ)..1, f x)| = + (b - a)⁻¹ * |(∫ x in a..b, f x) - + (b - a) * (∫ x in (0 : ℝ)..1, f x)| := by + have heq : (b - a)⁻¹ * (∫ x in a..b, f x) - (∫ x in (0 : ℝ)..1, f x) = + (b - a)⁻¹ * ((∫ x in a..b, f x) - + (b - a) * (∫ x in (0 : ℝ)..1, f x)) := by + rw [mul_sub, ← mul_assoc, inv_mul_cancel₀ hlen.ne', one_mul] + rw [heq, abs_mul, abs_of_pos (inv_pos.mpr hlen)] + _ ≤ (b - a)⁻¹ * ∫ x in (0 : ℝ)..1, |f x| := + mul_le_mul_of_nonneg_left + (abs_integral_sub_length_mul_integral_le hperiod hint hab.le) + (inv_nonneg.mpr hlen.le) + +theorem cond_fract_preimage_ge {s : Set ℝ} (hs : MeasurableSet s) + {a b : ℝ} (hab : a < b) : + (1 - 1 / (b - a)) * volume.real (s ∩ Ico 0 1) ≤ + (ProbabilityTheory.cond volume (Ioc a b)).real (Int.fract ⁻¹' s) := by + have hr : 0 < b - a := sub_pos.mpr hab + have hs' : MeasurableSet (Int.fract ⁻¹' s) := hs.preimage measurable_fract + have hnonneg : ∀ x, 0 ≤ (Int.fract ⁻¹' s).indicator (fun _ => (1 : ℝ)) x := by + intro x + exact Set.indicator_nonneg (fun _ _ => zero_le_one) x + have h := length_sub_one_mul_integral_le + (ModuloIntervalMeasure.periodic_fract_indicator s) hnonneg + (ModuloIntervalMeasure.intervalIntegrable_indicator_one hs' 0 1) hab.le + rw [ModuloIntervalMeasure.integral_fract_indicator_one_period hs, + intervalIntegral.integral_of_le hab.le, integral_indicator_const 1 hs', + measureReal_restrict_apply hs'] at h + simp only [smul_eq_mul, mul_one] at h + have hh := mul_le_mul_of_nonneg_left h (inv_nonneg.mpr hr.le) + rw [ProbabilityTheory.cond, measureReal_ennreal_smul_apply, + measureReal_restrict_apply hs', ENNReal.toReal_inv, Real.volume_Ioc, + ENNReal.toReal_ofReal hr.le] + calc + (1 - 1 / (b - a)) * volume.real (s ∩ Ico 0 1) = + (b - a)⁻¹ * ((b - a - 1) * volume.real (s ∩ Ico 0 1)) := by + rw [← mul_assoc, mul_sub, inv_mul_cancel₀ hr.ne', mul_one, one_div] + _ ≤ _ := hh + +theorem fract_comp_eqOn {E : Type*} (g : ℝ → E) : + EqOn (fun x => g (Int.fract x)) g (Ioo 0 1) := by + intro x hx + change g (Int.fract x) = g x + rw [Int.fract_eq_self.mpr ⟨hx.1.le, hx.2⟩] + +theorem intervalIntegrable_fract_comp {g : ℝ → ℝ} + (hg : IntervalIntegrable g volume 0 1) : + IntervalIntegrable (fun x => g (Int.fract x)) volume 0 1 := by + apply hg.congr_uIoo + simpa only [uIoo_of_le (by norm_num : (0 : ℝ) ≤ 1)] using (fract_comp_eqOn g).symm + +theorem integral_cond_Ioc_mul {f : ℝ → ℝ} {a b k : ℝ} + (hab : a < b) (hk : 0 < k) : + (∫ x, f (k * x) ∂ProbabilityTheory.cond volume (Ioc a b)) = + ∫ x, f x ∂ProbabilityTheory.cond volume (Ioc (k * a) (k * b)) := by + rw [integral_cond_Ioc hab, integral_cond_Ioc (mul_lt_mul_of_pos_left hab hk), + intervalIntegral.integral_comp_mul_left f hk.ne', smul_eq_mul] + rw [← mul_sub, mul_inv_rev, mul_assoc] + +theorem uniform_angle_test_le {N n : ℝ} (hN : 0 < N) (hn : 0 < n) + {g : ℝ → ℝ} (hg : IntervalIntegrable g volume 0 1) : + |(∫ θ, g (Int.fract (n * θ)) + ∂ProbabilityTheory.cond volume (Icc (1 / N) (2 / N))) - + (∫ t in (0 : ℝ)..1, g t)| ≤ (N / n) * ∫ t in (0 : ℝ)..1, |g t| := by + have hab : (1 : ℝ) / N < 2 / N := + (div_lt_div_iff_of_pos_right hN).mpr (by norm_num) + have hperiod : Function.Periodic (fun x => g (Int.fract x)) 1 := by + intro x + simp only [Int.fract_add_one] + have h := abs_integral_cond_sub_integral_le hperiod + (intervalIntegrable_fract_comp hg) (mul_lt_mul_of_pos_left hab hn) + have hmean : (∫ t in (0 : ℝ)..1, g (Int.fract t)) = ∫ t in (0 : ℝ)..1, g t := + intervalIntegral.integral_congr_Ioo_of_le (by norm_num) (fract_comp_eqOn g) + have habs : (∫ t in (0 : ℝ)..1, |g (Int.fract t)|) = + ∫ t in (0 : ℝ)..1, |g t| := + intervalIntegral.integral_congr_Ioo_of_le (by norm_num) (fract_comp_eqOn (fun t => |g t|)) + have hlen : (n * (2 / N) - n * (1 / N))⁻¹ = N / n := by + rw [← mul_sub, ← sub_div, show (2 : ℝ) - 1 = 1 by norm_num] + field_simp + rw [hmean, habs, hlen] at h + rw [ModuloIntervalMeasure.cond_Icc_eq_cond_Ioc, + integral_cond_Ioc_mul (f := fun x => g (Int.fract x)) hab hn] + exact h + +end Invariant233.PeriodicIntervalDiscrepancy + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/PointwiseConvolution.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/PointwiseConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..434f80df722d66bb15e5aac165aefe50b01e8f12 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/PointwiseConvolution.lean @@ -0,0 +1,111 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ConvolutionRatios +import OAI.Analysis.IrrationalRotation.Analysis.MaskedConvolutionTail + +namespace OAI + +open scoped ComplexConjugate ENNReal lp + +namespace InvariantProjection + +theorem l2_masked_convolution_tail + (s : Finset ℤ) (ξ γ : ℓ²(ℤ, ℂ)) (e : ℤ ≃ ℤ) + (hξ : ‖ξ‖ ≤ 1) (hγ : ‖γ‖ ≤ 1) + (r : ℤ → ℝ) (hr : ∀ v, 0 ≤ r v ∧ r v ≤ 1) + (η : ℝ) (hη : 0 ≤ η) (H₁ H₂ : Set ℤ) + (hzero : (∑' v : ℤ, (r v : ℂ) * ξ v * conj (γ (e v))) = 0) + (hmask : ∀ v, v ∉ s → r v ≤ η + H₁.indicator (fun _ => (1 : ℝ)) v + + H₂.indicator (fun _ => (1 : ℝ)) v) : + ‖∑ v ∈ s, (r v : ℂ) * ξ v * conj (γ (e v))‖ ≤ η + + (∑' v : ↑((s : Set ℤ)ᶜ), H₁.indicator (fun v => ‖ξ v‖ * ‖γ (e v)‖) v) + + (∑' v : ↑((s : Set ℤ)ᶜ), H₂.indicator (fun v => ‖ξ v‖ * ‖γ (e v)‖) v) := by + have hbase := l2_reindexed_absolute_products ξ γ e + have hsum : (∑' v, ‖ξ v‖ * ‖γ (e v)‖) ≤ 1 := by + refine hbase.2.trans ?_ + calc + ‖ξ‖ * ‖γ‖ ≤ 1 * 1 := mul_le_mul hξ hγ (norm_nonneg _) (by norm_num) + _ = 1 := by norm_num + have hdom := norm_finset_sum_le_masked_tail s + (fun v => (r v : ℂ) * ξ v * conj (γ (e v))) + (fun v => ‖ξ v‖ * ‖γ (e v)‖) η H₁ H₂ + (l2_reindexed_multiplier_bound ξ γ e r hr).1 hzero hbase.1 + (fun v => mul_nonneg (norm_nonneg _) (norm_nonneg _)) hη + (fun v hv => by + simp only [norm_mul, Complex.norm_conj, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (hr v).1] + calc + r v * ‖ξ v‖ * ‖γ (e v)‖ = r v * (‖ξ v‖ * ‖γ (e v)‖) := by ring + _ ≤ (η + H₁.indicator (fun _ => (1 : ℝ)) v + + H₂.indicator (fun _ => (1 : ℝ)) v) * (‖ξ v‖ * ‖γ (e v)‖) := by + gcongr + exact hmask v hv) + refine hdom.trans ?_ + gcongr + simpa using mul_le_mul_of_nonneg_left hsum hη + +theorem l2_masked_convolution_tail_selector + (s : Finset ℤ) (ξ γ : ℓ²(ℤ, ℂ)) (e : ℤ ≃ ℤ) + (hξ : ‖ξ‖ ≤ 1) (hγ : ‖γ‖ ≤ 1) + (r : ℤ → ℝ) (hr : ∀ v, 0 ≤ r v ∧ r v ≤ 1) + (η : ℝ) (hη : 0 ≤ η) (H₁ H₂ : Set ℤ) (k : ℤ → ℤ) + (hzero : (∑' v : ℤ, (r v : ℂ) * ξ v * conj (γ (e v))) = 0) + (hmask : ∀ v, v ∉ s → r v ≤ η + H₁.indicator (fun _ => (1 : ℝ)) (k v) + + H₂.indicator (fun _ => (1 : ℝ)) (k v)) : + ‖∑ v ∈ s, (r v : ℂ) * ξ v * conj (γ (e v))‖ ≤ η + + (∑' v : ↑((s : Set ℤ)ᶜ), + (H₁.indicator (fun _ => (1 : ℝ)) (k v)) * (‖ξ v‖ * ‖γ (e v)‖)) + + (∑' v : ↑((s : Set ℤ)ᶜ), + (H₂.indicator (fun _ => (1 : ℝ)) (k v)) * (‖ξ v‖ * ‖γ (e v)‖)) := by + classical + have hind (H : Set ℤ) (v : ℤ) : + (k ⁻¹' H).indicator (fun v => ‖ξ v‖ * ‖γ (e v)‖) v = + H.indicator (fun _ => (1 : ℝ)) (k v) * (‖ξ v‖ * ‖γ (e v)‖) := by + by_cases hv : k v ∈ H <;> simp [hv] + have hone (H : Set ℤ) (v : ℤ) : + (k ⁻¹' H).indicator (fun _ => (1 : ℝ)) v = + H.indicator (fun _ => (1 : ℝ)) (k v) := by + simp only [Set.indicator_apply, Set.mem_preimage] + have h := l2_masked_convolution_tail s ξ γ e hξ hγ r hr η hη + (k ⁻¹' H₁) (k ⁻¹' H₂) hzero (by simpa only [hone] using hmask) + simpa only [hind] using h + +theorem cocycle_masked_tail + (K n : ℕ) (Fx Fy : ℤ → ℝ) + (hFx : ∀ k, 0 < Fx k) (hFy : ∀ k, 0 < Fy k) + (hx : Antitone Fx) (hy : Antitone Fy) (hxy : ∀ k, Fy k / Fx k ≤ 1) + (ξ γ : ℓ²(ℤ, ℂ)) (hξ : ‖ξ‖ ≤ 1) (hγ : ‖γ‖ ≤ 1) + (η : ℝ) (hη : 0 ≤ η) (H₁ H₂ : Set ℤ) + (hzero : (∑' v : ℤ, + ((Fy ((n : ℤ) + v) / Fx v : ℝ) : ℂ) * ξ v * conj (γ ((n : ℤ) + v))) = 0) + (htail : ∀ k : ℤ, (K : ℤ) < |k| → Fy k / Fx k ≤ + η + H₁.indicator (fun _ => (1 : ℝ)) k + H₂.indicator (fun _ => (1 : ℝ)) k) : + let s : Finset ℤ := (Finset.Icc (-(K : ℤ)) (K : ℤ)).filter + (fun v => |(n : ℤ) + v| ≤ (K : ℤ)) + let k : ℤ → ℤ := fun v => if (K : ℤ) < |v| then v else (n : ℤ) + v + ‖∑ v ∈ s, ((Fy ((n : ℤ) + v) / Fx v : ℝ) : ℂ) * ξ v * + conj (γ ((n : ℤ) + v))‖ ≤ η + + (∑' v : ↑((s : Set ℤ)ᶜ), H₁.indicator (fun _ => (1 : ℝ)) (k v) * + (‖ξ v‖ * ‖γ ((n : ℤ) + v)‖)) + + (∑' v : ↑((s : Set ℤ)ᶜ), H₂.indicator (fun _ => (1 : ℝ)) (k v) * + (‖ξ v‖ * ‖γ ((n : ℤ) + v)‖)) := by + dsimp only + refine l2_masked_convolution_tail_selector + ((Finset.Icc (-(K : ℤ)) (K : ℤ)).filter (fun v => |(n : ℤ) + v| ≤ (K : ℤ))) + ξ γ (Equiv.addLeft (n : ℤ)) hξ hγ (fun v => Fy ((n : ℤ) + v) / Fx v) ?_ + η hη H₁ H₂ (fun v => if (K : ℤ) < |v| then v else (n : ℤ) + v) hzero ?_ + · intro v + have h := cocycle_two_ratio_bounds Fx Fy hFx hFy hx hy hxy n v + exact ⟨h.1.le, h.2.1.trans h.2.2⟩ + · intro v hv + have hvw : ¬ (|v| ≤ (K : ℤ) ∧ |(n : ℤ) + v| ≤ (K : ℤ)) := by + intro hw + apply hv + simp only [Finset.mem_filter, Finset.mem_Icc] + exact ⟨abs_le.mp hw.1, hw.2⟩ + have hk := omitted_index_selector (K : ℤ) (n : ℤ) v hvw + have h := cocycle_two_ratio_bounds Fx Fy hFx hFy hx hy hxy n v + exact (omitted_index_ratio_bound (K : ℤ) (n : ℤ) v + (fun k => Fy k / Fx k) _ h.2.1).trans (htail _ hk) + +end InvariantProjection + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/PositiveSelfAdjointDenseRange.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/PositiveSelfAdjointDenseRange.lean new file mode 100644 index 0000000000000000000000000000000000000000..635615343300f3722acb222fe2880117c14ea82c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/PositiveSelfAdjointDenseRange.lean @@ -0,0 +1,61 @@ +import Mathlib.Analysis.InnerProductSpace.LinearPMap +import Mathlib.Analysis.InnerProductSpace.Projection.Submodule +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +namespace Invariant233.PositiveSelfAdjoint + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [CompleteSpace E] + +theorem one_add_range_orthogonal_eq_bot + (H : E →ₗ.[ℂ] E) (hH : IsSelfAdjoint H) + (hpos : ∀ x : H.domain, 0 ≤ (inner ℂ (x : E) (H x)).re) : + (LinearMap.range (H.domain.subtype + H.toFun))ᗮ = ⊥ := by + apply le_antisymm ?_ bot_le + intro y hy + have hzero (x : H.domain) : inner ℂ y ((x : E) + H x) = 0 := by + exact Submodule.inner_left_of_mem_orthogonal + (show (x : E) + H x ∈ LinearMap.range (H.domain.subtype + H.toFun) from + ⟨x, rfl⟩) hy + have hinner (x : H.domain) : inner ℂ (-y) (x : E) = inner ℂ y (H x) := by + have hx := hzero x + rw [inner_add_right] at hx + rw [inner_neg_left] + exact neg_eq_iff_add_eq_zero.mpr hx + have hadj : H.adjoint = H := LinearPMap.isSelfAdjoint_def.mp hH + have hyadj : y ∈ H.adjoint.domain := + LinearPMap.mem_adjoint_domain_of_exists y ⟨-y, hinner⟩ + have hyD : y ∈ H.domain := by simpa only [hadj] using hyadj + have hHy : H ⟨y, hyD⟩ = -y := by + have heq := LinearPMap.adjoint_apply_eq hH.dense_domain + (⟨y, hyadj⟩ : H.adjoint.domain) hinner + exact ((le_of_eq hadj).2 (show (⟨y, hyadj⟩ : H.adjoint.domain).val = + (⟨y, hyD⟩ : H.domain).val from rfl)).symm.trans heq + have hp := hpos ⟨y, hyD⟩ + change 0 ≤ (inner ℂ y (H ⟨y, hyD⟩)).re at hp + rw [hHy, inner_neg_right, Complex.neg_re] at hp + have hnorm : (inner ℂ y y).re = ‖y‖ ^ 2 := inner_self_eq_norm_sq (𝕜 := ℂ) y + rw [hnorm] at hp + change y = 0 + apply norm_eq_zero.mp + nlinarith [norm_nonneg y] + +theorem denseRange_one_add + (H : E →ₗ.[ℂ] E) (hH : IsSelfAdjoint H) + (hpos : ∀ x : H.domain, 0 ≤ (inner ℂ (x : E) (H x)).re) : + DenseRange (fun x : H.domain => (x : E) + H x) := by + change Dense (LinearMap.range (H.domain.subtype + H.toFun) : Set E) + rw [Submodule.dense_iff_topologicalClosure_eq_top] + apply Submodule.orthogonal_eq_bot_iff.mp + rw [Submodule.orthogonal_closure] + exact one_add_range_orthogonal_eq_bot H hH hpos + +end Invariant233.PositiveSelfAdjoint + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/PositiveSelfAdjointInverse.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/PositiveSelfAdjointInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..c238785e75de9153af96dc940e27d6c73a35e8ef --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/PositiveSelfAdjointInverse.lean @@ -0,0 +1,157 @@ +import OAI.Analysis.IrrationalRotation.Model.NormalAffiliation +import Mathlib.Analysis.InnerProductSpace.Projection.Submodule + +namespace OAI + +noncomputable section +open scoped ComplexConjugate + +namespace Invariant233.PartialInverse + +variable {𝕜 E : Type*} [RCLike 𝕜] +variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [CompleteSpace E] + +theorem dense_range {H : E →ₗ.[𝕜] E} (hH : IsSelfAdjoint H) + (hker : H.toFun.ker = ⊥) : Dense (LinearMap.range H.toFun : Set E) := by + have hsa := LinearPMap.isSelfAdjoint_def.mp hH + have horth : (LinearMap.range H.toFun)ᗮ = ⊥ := by + apply (Submodule.eq_bot_iff _).mpr + intro y hy + have hpair (x : H.domain) : inner 𝕜 y (H x) = 0 := by + exact (inner_eq_zero_symm).mp + (Submodule.inner_right_of_mem_orthogonal (LinearMap.mem_range_self H.toFun x) hy) + have hyD : y ∈ H.adjoint.domain := + LinearPMap.mem_adjoint_domain_of_exists y ⟨0, fun x => by simp [hpair x]⟩ + have hyzero : H.adjoint ⟨y, hyD⟩ = 0 := + LinearPMap.adjoint_apply_eq hH.dense_domain _ (fun x => by simp [hpair x]) + have hyH : y ∈ H.domain := by simpa only [hsa] using hyD + have heq : H.adjoint ⟨y, hyD⟩ = H ⟨y, hyH⟩ := (le_of_eq hsa).2 rfl + have hyHzero : H ⟨y, hyH⟩ = 0 := heq.symm.trans hyzero + have hz : (⟨y, hyH⟩ : H.domain) = 0 := + (LinearMap.ker_eq_bot.mp hker) (by simpa using hyHzero) + exact congrArg Subtype.val hz + rw [Submodule.dense_iff_topologicalClosure_eq_top, + ← Submodule.orthogonal_orthogonal_eq_closure, horth, Submodule.bot_orthogonal_eq_top] + +theorem inverse_dense_domain {H : E →ₗ.[𝕜] E} (hH : IsSelfAdjoint H) + (hker : H.toFun.ker = ⊥) : Dense (H.inverse.domain : Set E) := by + rw [LinearPMap.inverse_domain] + exact dense_range hH hker + +omit [CompleteSpace E] in + +theorem inverse_mem_domain {H : E →ₗ.[𝕜] E} (hker : H.toFun.ker = ⊥) + (y : H.inverse.domain) : H.inverse y ∈ H.domain := by + rw [← LinearPMap.inverse_range (LinearPMap.ker_eq_bot.mpr (LinearMap.ker_eq_bot.mp hker))] + exact LinearMap.mem_range_self H.inverse.toFun y + +omit [CompleteSpace E] in + +theorem apply_inverse {H : E →ₗ.[𝕜] E} (hker : H.toFun.ker = ⊥) + (y : H.inverse.domain) : + H ⟨H.inverse y, inverse_mem_domain hker y⟩ = (y : E) := by + have hy : (y : E) ∈ LinearMap.range H.toFun := by + simpa only [LinearPMap.inverse_domain] using y.property + obtain ⟨x, hx⟩ := hy + have hi := LinearPMap.inverse_apply_eq + (LinearPMap.ker_eq_bot.mpr (LinearMap.ker_eq_bot.mp hker)) hx + have hsub : (⟨H.inverse y, inverse_mem_domain hker y⟩ : H.domain) = x := + Subtype.ext hi + rw [hsub] + exact hx + +omit [CompleteSpace E] in + +theorem inverse_injective {H : E →ₗ.[𝕜] E} (hker : H.toFun.ker = ⊥) : + Function.Injective H.inverse := by + intro x y hxy + have hsub : (⟨H.inverse x, inverse_mem_domain hker x⟩ : H.domain) = + ⟨H.inverse y, inverse_mem_domain hker y⟩ := Subtype.ext hxy + apply Subtype.ext + exact (apply_inverse hker x).symm.trans ((congrArg H hsub).trans (apply_inverse hker y)) + +omit [CompleteSpace E] in + +theorem inverse_formalAdjoint {H : E →ₗ.[𝕜] E} + (hH : H.IsFormalAdjoint H) (hker : H.toFun.ker = ⊥) : + H.inverse.IsFormalAdjoint H.inverse := by + intro x y + have h := hH ⟨H.inverse x, inverse_mem_domain hker x⟩ + ⟨H.inverse y, inverse_mem_domain hker y⟩ + rw [apply_inverse hker x, apply_inverse hker y] at h + exact h.symm + +theorem inverse_selfAdjoint {H : E →ₗ.[𝕜] E} (hH : IsSelfAdjoint H) + (hker : H.toFun.ker = ⊥) : IsSelfAdjoint H.inverse := by + have hsa := LinearPMap.isSelfAdjoint_def.mp hH + have hd := inverse_dense_domain hH hker + have hs : H.IsFormalAdjoint H := by + have h := LinearPMap.adjoint_isFormalAdjoint hH.dense_domain + rwa [hsa] at h + have hsym := inverse_formalAdjoint hs hker + have hpre (y : H.inverse.adjoint.domain) : + ∃ x : H.domain, H x = (y : E) ∧ (x : E) = H.inverse.adjoint y := by + have hpair (x : H.domain) : + inner 𝕜 (y : E) (x : E) = inner 𝕜 (H.inverse.adjoint y) (H x) := by + let z : H.inverse.domain := ⟨H x, by + rw [LinearPMap.inverse_domain] + exact LinearMap.mem_range_self H.toFun x⟩ + have hz : H.inverse z = (x : E) := LinearPMap.inverse_apply_eq + (LinearPMap.ker_eq_bot.mpr (LinearMap.ker_eq_bot.mp hker)) rfl + have h := LinearPMap.adjoint_isFormalAdjoint hd y z + simpa only [hz] using h.symm + have hw : H.inverse.adjoint y ∈ H.adjoint.domain := + LinearPMap.mem_adjoint_domain_of_exists _ ⟨y, hpair⟩ + have hwval : H.adjoint ⟨H.inverse.adjoint y, hw⟩ = (y : E) := + LinearPMap.adjoint_apply_eq hH.dense_domain _ hpair + have hwH : H.inverse.adjoint y ∈ H.domain := by simpa only [hsa] using hw + refine ⟨⟨H.inverse.adjoint y, hwH⟩, ?_, rfl⟩ + exact ((le_of_eq hsa).2 rfl).symm.trans hwval + apply LinearPMap.isSelfAdjoint_def.mpr + apply le_antisymm + · refine ⟨?_, ?_⟩ + · intro y hy + obtain ⟨x, hx, _⟩ := hpre ⟨y, hy⟩ + rw [LinearPMap.inverse_domain] + exact ⟨x, hx⟩ + · intro y z hyz + obtain ⟨x, hx, hxy⟩ := hpre y + exact hxy.symm.trans (LinearPMap.inverse_apply_eq + (LinearPMap.ker_eq_bot.mpr (LinearMap.ker_eq_bot.mp hker)) (hx.trans hyz)).symm + · exact LinearPMap.IsFormalAdjoint.le_adjoint hd hsym + +end Invariant233.PartialInverse + +namespace Invariant233.PartialInverse + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + +theorem inverse_pairing {H : E →ₗ.[ℂ] E} + (hH : H.IsFormalAdjoint H) (hker : H.toFun.ker = ⊥) + (η : H.inverse.domain) (ζ : H.domain) : + inner ℂ (H.inverse η) (H ζ) = inner ℂ (η : E) (ζ : E) := by + have h := hH ⟨H.inverse η, inverse_mem_domain hker η⟩ ζ + rw [apply_inverse hker η] at h + exact h.symm + +theorem inverse_positive {H : E →ₗ.[ℂ] E} + (hpos : IsPositivePartial H) (hker : H.toFun.ker = ⊥) : + IsPositivePartial H.inverse := by + intro y + have h := hpos ⟨H.inverse y, inverse_mem_domain hker y⟩ + rw [apply_inverse hker y] at h + exact (inner_re_symm (𝕜 := ℂ) (y : E) (H.inverse y)).trans_ge h + +theorem inverse_positive_selfAdjoint [CompleteSpace E] {H : E →ₗ.[ℂ] E} + (hH : IsSelfAdjoint H) (hpos : IsPositivePartial H) (hinj : Function.Injective H) : + IsSelfAdjoint H.inverse ∧ IsPositivePartial H.inverse ∧ + Function.Injective H.inverse ∧ Dense (H.inverse.domain : Set E) := by + have hker : H.toFun.ker = ⊥ := LinearMap.ker_eq_bot.mpr hinj + exact ⟨inverse_selfAdjoint hH hker, inverse_positive hpos hker, + inverse_injective hker, inverse_dense_domain hH hker⟩ + +end Invariant233.PartialInverse + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/PowerGaps.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/PowerGaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..49b78c18de1ff9ccadbb54a95c23aaa5e5befecf --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/PowerGaps.lean @@ -0,0 +1,72 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +import Mathlib.Tactic + +namespace OAI + +namespace InvariantProjection.PowerGaps +open Filter Topology + +theorem tendsto_rpow_neg_mul_atTop {c : ℝ} (hc : 0 < c) : + Tendsto (fun x : ℝ => x ^ (-c * x)) atTop (𝓝 0) := by + apply squeeze_zero' _ _ (tendsto_rpow_neg_atTop hc) + · filter_upwards [eventually_ge_atTop (0 : ℝ)] with x hx + exact Real.rpow_nonneg hx _ + · filter_upwards [eventually_ge_atTop (1 : ℝ)] with x hx + apply Real.rpow_le_rpow_of_exponent_le hx + nlinarith + +theorem tendsto_rpow_mul_ratio {a b : ℝ} (hab : a < b) : + Tendsto (fun x : ℝ => x ^ (a * x) / x ^ (b * x)) atTop (𝓝 0) := by + apply (tendsto_rpow_neg_mul_atTop (sub_pos.mpr hab)).congr' + filter_upwards [eventually_gt_atTop (0 : ℝ)] with x hx + rw [← Real.rpow_sub hx] + congr 1 + ring + +theorem tendsto_ratio_of_power_lower {ι : Type*} {l : Filter ι} + {m K : ι → ℝ} {a b : ℝ} (hab : a < b) + (hm : Tendsto m l atTop) (hK : ∀ᶠ j in l, m j ^ (b * m j) ≤ K j) : + Tendsto (fun j => m j ^ (a * m j) / K j) l (𝓝 0) := by + have hmpos : ∀ᶠ j in l, 0 < m j := hm.eventually (eventually_gt_atTop 0) + apply squeeze_zero' _ _ ((tendsto_rpow_mul_ratio hab).comp hm) + · filter_upwards [hmpos, hK] with j hj hKj + exact div_nonneg (Real.rpow_nonneg hj.le _) + (le_trans (Real.rpow_nonneg hj.le _) hKj) + · filter_upwards [hmpos, hK] with j hj hKj + exact div_le_div_of_nonneg_left (Real.rpow_nonneg hj.le _) + (Real.rpow_pos_of_pos hj _) hKj + +theorem ceil_rpow_mul_le_two {a x : ℝ} (ha : 0 ≤ a) (hx : 1 ≤ x) : + (⌈x ^ (a * x)⌉₊ : ℝ) ≤ 2 * x ^ (a * x) := by + have hp : 1 ≤ x ^ (a * x) := + Real.one_le_rpow hx (mul_nonneg ha (le_trans (by norm_num) hx)) + have hc := Nat.ceil_lt_add_one (le_trans (by norm_num : (0 : ℝ) ≤ 1) hp) + linarith + +theorem tendsto_ceil_rpow_mul_ratio {a b : ℝ} (ha : 0 ≤ a) (hab : a < b) : + Tendsto (fun x : ℝ => (⌈x ^ (a * x)⌉₊ : ℝ) / x ^ (b * x)) atTop (𝓝 0) := by + have hlim : Tendsto (fun x : ℝ => 2 * (x ^ (a * x) / x ^ (b * x))) + atTop (𝓝 0) := by + simpa using (tendsto_rpow_mul_ratio hab).const_mul 2 + apply squeeze_zero' _ _ hlim + · filter_upwards [eventually_ge_atTop (0 : ℝ)] with x hx + exact div_nonneg (Nat.cast_nonneg _) (Real.rpow_nonneg hx _) + · filter_upwards [eventually_ge_atTop (1 : ℝ)] with x hx + calc + (⌈x ^ (a * x)⌉₊ : ℝ) / x ^ (b * x) ≤ + (2 * x ^ (a * x)) / x ^ (b * x) := + div_le_div_of_nonneg_right (ceil_rpow_mul_le_two ha hx) + (Real.rpow_nonneg (le_trans (by norm_num) hx) _) + _ = 2 * (x ^ (a * x) / x ^ (b * x)) := by ring + +theorem tendsto_cutoff_feasibility (G : ℝ) : + Tendsto (fun x : ℝ => + G * (⌈x ^ ((3 / 4 : ℝ) * x)⌉₊ : ℝ) / x ^ ((4 / 5 : ℝ) * x)) + atTop (𝓝 0) := by + have h := (tendsto_ceil_rpow_mul_ratio (a := (3 / 4 : ℝ)) + (b := (4 / 5 : ℝ)) (by norm_num) (by norm_num)).const_mul G + simpa only [mul_zero, mul_div_assoc] using h + +end InvariantProjection.PowerGaps + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/PurePointDiffuse.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/PurePointDiffuse.lean new file mode 100644 index 0000000000000000000000000000000000000000..0cee23701677dfeb5a94ce9d0d000a2157ac1805 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/PurePointDiffuse.lean @@ -0,0 +1,92 @@ +import OAI.Analysis.IrrationalRotation.Model.ConcreteSpectral +import OAI.Analysis.IrrationalRotation.Operators.JointEigenprojection + +namespace OAI + +noncomputable section +namespace Invariant233 + +variable {H ι : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +omit [CompleteSpace H] in + +theorem jointEigenspace_const_unit (D : H →L[ℂ] H) (z : ℂ) : + jointEigenspace (fun _ : Unit => D) (fun _ => z) = + Module.End.eigenspace D.toLinearMap z := by + ext x + simp only [mem_jointEigenspace, Module.End.mem_eigenspace_iff, + ContinuousLinearMap.coe_coe, forall_const] + +theorem projectionAtom_range_le_eigenspace + {M : VonNeumannAlgebra H} (hab : IsAbelianVonNeumannAlgebra M) + {p D : H →L[ℂ] H} (hp : IsProjectionAtom M p) (hD : D ∈ M) + (hpure : HasCountablyAtomicSpectralType D) : + ∃ z : ℂ, p.range ≤ Module.End.eigenspace D.toLinearMap z := by + obtain ⟨S, _hS, hdense⟩ := hpure + have hdense' : + (⨆ z : S, jointEigenspace (fun _ : Unit => D) (fun _ => (z : ℂ))).topologicalClosure = ⊤ := by + simpa only [jointEigenspace_const_unit] using hdense + obtain ⟨z, hz⟩ := exists_mul_jointEigenprojection_ne_zero + (fun _ : Unit => D) (fun z : S => fun _ => (z : ℂ)) hdense' p hp.2.2.1 + let q := jointEigenprojection (fun _ : Unit => D) (fun _ => (z : ℂ)) + have hqm : q ∈ M := by + apply vonNeumannGenerated_le (Set.range (fun _ : Unit => D)) M ?_ + (jointEigenprojection_mem_generated (fun _ : Unit => D) (fun _ => (z : ℂ))) + rintro A ⟨u, rfl⟩ + exact hD + have hqproj : IsStarProjection q := isStarProjection_jointEigenprojection _ _ + have hpq : Commute p q := hab p q hp.1 hqm + have hsub : (p * q) * p = p * q := by + rw [mul_assoc, ← hpq.eq, ← mul_assoc, hp.2.1.isIdempotentElem.eq] + have heq : p * q = p := + (hp.2.2.2 (p * q) (mul_mem hp.1 hqm) (hp.2.1.mul hqproj hpq) hsub).resolve_left hz + refine ⟨z, ?_⟩ + rintro x ⟨y, rfl⟩ + have hfix : q (p y) = p y := by + have h := DFunLike.congr_fun (hpq.eq.symm.trans heq) y + exact h + have hx : p y ∈ jointEigenspace (fun _ : Unit => D) (fun _ => (z : ℂ)) := + Submodule.starProjection_eq_self_iff.mp hfix + rwa [jointEigenspace_const_unit] at hx + +theorem projectionAtom_range_le_jointEigenspace + {M : VonNeumannAlgebra H} (hab : IsAbelianVonNeumannAlgebra M) + (D : ι → H →L[ℂ] H) (hD : ∀ i, D i ∈ M) + (hpure : ∀ i, HasCountablyAtomicSpectralType (D i)) + {p : H →L[ℂ] H} (hp : IsProjectionAtom M p) : + ∃ ev : ι → ℂ, p.range ≤ jointEigenspace D ev := by + choose ev hev using fun i => projectionAtom_range_le_eigenspace hab hp (hD i) (hpure i) + refine ⟨ev, ?_⟩ + intro x hx + rw [mem_jointEigenspace] + intro i + exact Module.End.mem_eigenspace_iff.mp (hev i hx) + +theorem isDiffuse_of_purePoint_no_jointEigenvectors + {M : VonNeumannAlgebra H} (hab : IsAbelianVonNeumannAlgebra M) + (D : ι → H →L[ℂ] H) (hD : ∀ i, D i ∈ M) + (hpure : ∀ i, HasCountablyAtomicSpectralType (D i)) + (hjoint : ∀ ev : ι → ℂ, jointEigenspace D ev = ⊥) : + IsDiffuseVonNeumannAlgebra M := by + intro p hp + obtain ⟨ev, hev⟩ := projectionAtom_range_le_jointEigenspace hab D hD hpure hp + rw [hjoint ev] at hev + apply hp.2.2.1 + ext x + exact hev ⟨x, rfl⟩ + +theorem generated_isDiffuse_of_purePoint_no_jointEigenvectors + (D : ι → H →L[ℂ] H) + (hab : IsAbelianVonNeumannAlgebra (vonNeumannGenerated (Set.range D))) + (hpure : ∀ i, HasCountablyAtomicSpectralType (D i)) + (hjoint : ∀ ev : ι → ℂ, jointEigenspace D ev = ⊥) : + IsDiffuseVonNeumannAlgebra (vonNeumannGenerated (Set.range D)) := by + exact isDiffuse_of_purePoint_no_jointEigenvectors hab D + (fun i => subset_vonNeumannGenerated _ ⟨i, rfl⟩) hpure hjoint + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/QuantizedCrossingGeometry.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/QuantizedCrossingGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..ddcd4dffdcc077a368f70c485190cfba567dcc44 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/QuantizedCrossingGeometry.lean @@ -0,0 +1,80 @@ +import OAI.Analysis.IrrationalRotation.Analysis.UniformQuantization + +namespace OAI + +noncomputable section +open Set + +namespace Invariant233.UniformQuantization + +theorem radix_bin_subset_top {q : ℕ} [NeZero q] (a : Fin q) + {t u w : ℝ} + (ht : t ∈ Ico ((a : ℝ) / q) (((a : ℝ) + 1) / q)) + (htu : t < u) (hu : u ≤ 1 - w) (hmargin : 1 / (q : ℝ) < w / 2) : + Ico ((a : ℝ) / q) (((a : ℝ) + 1) / q) ⊆ Ico 0 (1 - w / 2) := by + intro x hx + have hlow : 0 ≤ (a : ℝ) / q := by positivity + have hsplit : ((a : ℝ) + 1) / q = (a : ℝ) / q + 1 / q := by ring + refine ⟨hlow.trans hx.1, ?_⟩ + rw [hsplit] at hx + linarith [ht.1, hx.2] + +theorem radix_bin_subset_bottom {q : ℕ} [NeZero q] (a : Fin q) + {t u w : ℝ} + (ht : t ∈ Ico ((a : ℝ) / q) (((a : ℝ) + 1) / q)) + (hut : u ≤ t) (hu : w ≤ u) (hmargin : 1 / (q : ℝ) < w / 2) : + Ico ((a : ℝ) / q) (((a : ℝ) + 1) / q) ⊆ Ico (w / 2) 1 := by + intro x hx + have hq : (0 : ℝ) < q := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) + have ha : (a : ℝ) + 1 ≤ q := by exact_mod_cast Nat.succ_le_of_lt a.isLt + have hupper : ((a : ℝ) + 1) / q ≤ 1 := (div_le_iff₀ hq).mpr (by linarith) + have hsplit : ((a : ℝ) + 1) / q = (a : ℝ) / q + 1 / q := by ring + refine ⟨?_, hx.2.trans_le hupper⟩ + rw [hsplit] at ht + linarith [ht.2, hx.1] + +theorem quantize_bin_subset_top {q : ℕ} [NeZero q] {t u w : ℝ} + (ht : t ∈ Ico (0 : ℝ) 1) (htu : t < u) (hu : u ≤ 1 - w) + (hmargin : 1 / (q : ℝ) < w / 2) : + Ico ((quantize q t : ℝ) / q) (((quantize q t : ℝ) + 1) / q) ⊆ + Ico 0 (1 - w / 2) := + radix_bin_subset_top (quantize q t) ((quantize_eq_iff _ ht).mp rfl) htu hu hmargin + +theorem quantize_bin_subset_bottom {q : ℕ} [NeZero q] {t u w : ℝ} + (ht : t ∈ Ico (0 : ℝ) 1) (hut : u ≤ t) (hu : w ≤ u) + (hmargin : 1 / (q : ℝ) < w / 2) : + Ico ((quantize q t : ℝ) / q) (((quantize q t : ℝ) + 1) / q) ⊆ + Ico (w / 2) 1 := + radix_bin_subset_bottom (quantize q t) ((quantize_eq_iff _ ht).mp rfl) hut hu hmargin + +theorem raw_mem_top_of_same_digit {q : ℕ} [NeZero q] {X t u w : ℝ} + (hX : X ∈ Ico (0 : ℝ) 1) (ht : t ∈ Ico (0 : ℝ) 1) + (hdigit : quantize q X = quantize q t) + (htu : t < u) (hu : u ≤ 1 - w) (hmargin : 1 / (q : ℝ) < w / 2) : + X ∈ Ico 0 (1 - w / 2) := + quantize_bin_subset_top ht htu hu hmargin ((quantize_eq_iff _ hX).mp hdigit) + +theorem raw_mem_bottom_of_same_digit {q : ℕ} [NeZero q] {Y t u w : ℝ} + (hY : Y ∈ Ico (0 : ℝ) 1) (ht : t ∈ Ico (0 : ℝ) 1) + (hdigit : quantize q Y = quantize q t) + (hut : u ≤ t) (hu : w ≤ u) (hmargin : 1 / (q : ℝ) < w / 2) : + Y ∈ Ico (w / 2) 1 := + quantize_bin_subset_bottom ht hut hu hmargin ((quantize_eq_iff _ hY).mp hdigit) + +theorem rounded_top_forces_crossing {q : ℕ} {Y t u w : ℝ} + (hY : 1 - w / 2 ≤ Y) (hround : |t - Y| ≤ 1 / (q : ℝ)) + (hu : u ≤ 1 - w) (hmargin : 1 / (q : ℝ) < w / 2) : u < t := by + have h := (abs_le.mp hround).1 + linarith + +theorem rounded_bottom_forces_crossing {q : ℕ} {X t u w : ℝ} + (hX : X ≤ w / 2) (hround : |t - X| ≤ 1 / (q : ℝ)) + (hu : w ≤ u) (hmargin : 1 / (q : ℝ) < w / 2) : t < u := by + have h := (abs_le.mp hround).2 + linarith + +end Invariant233.UniformQuantization + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/QuantizedDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/QuantizedDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..649ded87b1682a9b7d103e8c3dc989b534c657df --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/QuantizedDensity.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.IrrationalRotation.Analysis.UniformQuantization +import OAI.Analysis.IrrationalRotation.Sampling.DigitAveraging + +namespace OAI + +noncomputable section +open MeasureTheory Set +open scoped ENNReal BigOperators + +namespace Invariant233.UniformQuantization + +local instance : IsProbabilityMeasure (volume.restrict (Ico (0 : ℝ) 1)) := + ⟨by simp⟩ + +theorem quantize_fiber_mass (q : ℕ) [NeZero q] (a : Fin q) : + (volume.restrict (Ico (0 : ℝ) 1)).real {x | quantize q x = a} = + 1 / (q : ℝ) := by + have hmass := map_quantize_singleton q a + rw [Measure.map_apply (measurable_quantize q) (measurableSet_singleton a)] at hmass + unfold Measure.real + rw [show (volume.restrict (Ico (0 : ℝ) 1)) {x | quantize q x = a} = + (q : ℝ≥0∞)⁻¹ from hmass] + simp [one_div] + +theorem binAverage_eq_interval (q : ℕ) [NeZero q] (h : ℝ → ℝ) (a : Fin q) : + binAverage q h a = + (q : ℝ) * ∫ x in Ico ((a : ℝ) / q) (((a : ℝ) + 1) / q), h x := by + unfold binAverage + congr 1 + change (∫ x, h x ∂(volume.restrict (Ico (0 : ℝ) 1)).restrict + (quantize q ⁻¹' {a})) = _ + rw [Measure.restrict_restrict ((measurable_quantize q) (measurableSet_singleton a))] + rw [preimage_singleton_inter_unit] + +theorem map_withDensity_quantize (q : ℕ) [NeZero q] {h : ℝ → ℝ} + (hh : Integrable h (volume.restrict (Ico (0 : ℝ) 1))) + (hnonneg : ∀ᵐ x ∂volume.restrict (Ico (0 : ℝ) 1), 0 ≤ h x) : + ((volume.restrict (Ico (0 : ℝ) 1)).withDensity (fun x => ENNReal.ofReal (h x))).map + (quantize q) = + (PMF.uniformOfFintype (Fin q)).toMeasure.withDensity + (fun a => ENNReal.ofReal (binAverage q h a)) := by + simpa only [map_quantize_uniform, binAverage] using + DigitAveraging.map_withDensity_eq_digit_density (Nat.pos_of_ne_zero (NeZero.ne q)) + (measurable_quantize q) (quantize_fiber_mass q) hh hnonneg + +theorem integral_binAverage_energy_le (q : ℕ) [NeZero q] {h : ℝ → ℝ} + (hh : MemLp h 2 (volume.restrict (Ico (0 : ℝ) 1))) : + (∫ a, (binAverage q h a - 1) ^ 2 ∂(PMF.uniformOfFintype (Fin q)).toMeasure) ≤ + ∫ x, (h x - 1) ^ 2 ∂volume.restrict (Ico (0 : ℝ) 1) := by + simpa only [map_quantize_uniform, binAverage] using + DigitAveraging.integral_digit_energy_le (Nat.pos_of_ne_zero (NeZero.ne q)) + (measurable_quantize q) (quantize_fiber_mass q) hh + +theorem binAverage_nonneg (q : ℕ) [NeZero q] {h : ℝ → ℝ} + (hh : ∀ᵐ x ∂volume.restrict (Ico (0 : ℝ) 1), 0 ≤ h x) (a : Fin q) : + 0 ≤ binAverage q h a := DigitAveraging.digit_average_nonneg hh a + +theorem integral_binAverage (q : ℕ) [NeZero q] {h : ℝ → ℝ} + (hh : Integrable h (volume.restrict (Ico (0 : ℝ) 1))) : + (∫ a, binAverage q h a ∂(PMF.uniformOfFintype (Fin q)).toMeasure) = + ∫ x, h x ∂volume.restrict (Ico (0 : ℝ) 1) := by + rw [← map_quantize_uniform q, + DigitAveraging.integral_map_eq_uniform_sum (measurable_quantize q) (quantize_fiber_mass q)] + exact DigitAveraging.digit_average_mean (Nat.pos_of_ne_zero (NeZero.ne q)) + (measurable_quantize q) hh + +theorem binAverage_le (q : ℕ) [NeZero q] {h : ℝ → ℝ} {B : ℝ} + (hh : Integrable h (volume.restrict (Ico (0 : ℝ) 1))) + (hB : ∀ᵐ x ∂volume.restrict (Ico (0 : ℝ) 1), h x ≤ B) (a : Fin q) : + binAverage q h a ≤ B := + DigitAveraging.digit_average_le (Nat.pos_of_ne_zero (NeZero.ne q)) + (quantize_fiber_mass q) hh hB a + +end Invariant233.UniformQuantization + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphRatioCaps.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphRatioCaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..f37ed6d9dadde1fad2540a150dbc0f5e79de654e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphRatioCaps.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.IrrationalRotation.Analysis.RationalGraphTrimming +import OAI.Analysis.IrrationalRotation.Analysis.InfiniteRatioCaps +import OAI.Analysis.IrrationalRotation.Rotation.ParameterCircleReindex + +namespace OAI + +noncomputable section +open MeasureTheory Function Set +open scoped BigOperators +namespace Invariant233.CircleParameterLaws +open CircleParameterData +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem floorCocycle_ratio_le_prefix {A : ℕ} (hA : 1 ≤ A) (x y : Circle) (v : ℤ) + (hxy : ∀ i, A ≤ i → p.coordinate i x ≤ p.coordinate i y) + (hx : HasFiniteSupport (fun k : ℕ => + Int.floor (p.coordinate (k + 1) x + (v : ℝ) * p.alpha θ (k + 1)))) + (hy : HasFiniteSupport (fun k : ℕ => + Int.floor (p.coordinate (k + 1) y + (v : ℝ) * p.alpha θ (k + 1)))) : + p.floorCocycle θ v y / p.floorCocycle θ v x ≤ + Real.exp (p.rationalGraphPrefixCost A) := by + rw [hp.parameter_cocycle_eq_flattened, hp.parameter_cocycle_eq_flattened] + apply CircleWeights.cocycle_ratio_cap_finite_exceptions + θ p.flattenedFrequency p.flattenedCost v x y (Finset.range (A - 1)) + (fun k => (hp.flattenedCost_pos k).le) + · intro k hk + have hkA : A ≤ k + 1 := by simp only [Finset.mem_range] at hk; omega + simpa only [CircleWeights.coordinate, CircleWeights.representative, + flattenedFrequency, coordinate, rep, natCast_zsmul] using hxy (k + 1) hkA + · simpa only [CircleWeights.coordinate, CircleWeights.representative, + CircleWeights.phase, flattenedFrequency, coordinate, rep, alpha, + natCast_zsmul, Int.cast_natCast] using hx + · simpa only [CircleWeights.coordinate, CircleWeights.representative, + CircleWeights.phase, flattenedFrequency, coordinate, rep, alpha, + natCast_zsmul, Int.cast_natCast] using hy + +theorem trimmed_floorCocycle_ratio_le {A j n : ℕ} (hA : 1 ≤ A) (hj : 1 ≤ j) + (x : Circle) (hx : x ∈ p.rationalGraphGood A j) (t : ℝ) + (ht : p.q A • (t : Circle) = 0) + (hphase : Int.fract ((n : ℝ) * θ - t) < p.ell j) + (hn : (n : ℝ) ≤ p.Q j) (hd : p.orbitGraphDensity θ j n x ≠ 0) (v : ℤ) + (hfx : HasFiniteSupport (fun k : ℕ => + Int.floor (p.coordinate (k + 1) x + (v : ℝ) * p.alpha θ (k + 1)))) + (hfy : HasFiniteSupport (fun k : ℕ => + Int.floor (p.coordinate (k + 1) (x + (((n : ℝ) * θ : ℝ) : Circle)) + + (v : ℝ) * p.alpha θ (k + 1)))) : + p.floorCocycle θ v (x + (((n : ℝ) * θ : ℝ) : Circle)) / p.floorCocycle θ v x ≤ + Real.exp (p.rationalGraphPrefixCost A) := + hp.floorCocycle_ratio_le_prefix hA x _ v + (hp.ordered_of_rationalGraphGood hA hj x hx t ht hphase hn hd) hfx hfy + +theorem exists_uniform_rationalGraph_cap_set : + ∃ s : Set Circle, MeasurableSet s ∧ (∀ᵐ x ∂circleMeasure, x ∈ s) ∧ + (∀ (k : ℤ) x, CircleWeights.rotate θ k x ∈ s ↔ x ∈ s) ∧ + ∀ (A j n : ℕ), 1 ≤ A → 1 ≤ j → ∀ x ∈ s, + x ∈ p.rationalGraphGood A j → ∀ t : ℝ, + p.q A • (t : Circle) = 0 → + Int.fract ((n : ℝ) * θ - t) < p.ell j → + (n : ℝ) ≤ p.Q j → p.orbitGraphDensity θ j n x ≠ 0 → + ∀ v : ℤ, p.floorCocycle θ v (x + (((n : ℝ) * θ : ℝ) : Circle)) / + p.floorCocycle θ v x ≤ Real.exp (p.rationalGraphPrefixCost A) := by + have hq : ∀ k, p.flattenedFrequency k ≠ 0 := by + intro k + change (p.q (k + 1) : ℤ) ≠ 0 + exact_mod_cast (hp.q_pos (k + 1)).ne' + have hphase : Summable (CircleWeights.phase θ p.flattenedFrequency) := by + change Summable (fun k : ℕ => Int.fract (((p.q (k + 1) : ℤ) : ℝ) * θ)) + simpa only [alpha, Int.cast_natCast] using hp.summable_phases + obtain ⟨s, hs, hfull, hinv, hfinite, _⟩ := CircleWeights.exists_cocycle_set + θ p.flattenedFrequency hq p.flattenedCost hphase + refine ⟨s, hs, hfull, hinv, ?_⟩ + intro A j n hA hj x hx hgood t ht hph hn hd v + apply hp.trimmed_floorCocycle_ratio_le hA hj x hgood t ht hph hn hd v + · simpa only [CircleWeights.coordinate, CircleWeights.representative, + CircleWeights.phase, flattenedFrequency, coordinate, rep, alpha, + natCast_zsmul, Int.cast_natCast] using hfinite x hx v + · have hy := hfinite (CircleWeights.rotate θ (n : ℤ) x) ((hinv (n : ℤ) x).mpr hx) v + simpa only [CircleWeights.coordinate, CircleWeights.representative, + CircleWeights.phase, CircleWeights.rotate, flattenedFrequency, coordinate, rep, alpha, + natCast_zsmul, Int.cast_natCast, ← AddCircle.coe_nsmul, nsmul_eq_mul] using hy + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphTrimming.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphTrimming.lean new file mode 100644 index 0000000000000000000000000000000000000000..de356aa88a83dcf017537f46a9827b08ec8ce771 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphTrimming.lean @@ -0,0 +1,203 @@ +import OAI.Analysis.IrrationalRotation.Model.RationalGraphTrimming +import OAI.Analysis.IrrationalRotation.Sampling.CircleCharacterDynamics +import OAI.Analysis.IrrationalRotation.Rotation.CircleParameterBlocks +import OAI.Analysis.IrrationalRotation.Sampling.CircleSamplingLp +import OAI.Analysis.IrrationalRotation.Sampling.CirclePhaseTails + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Invariant233.CircleParameterData + +theorem coordinate_mem_Ico (p : CircleParameterData) (i : ℕ) (x : Circle) : + p.coordinate i x ∈ Set.Ico (0 : ℝ) 1 := by + simpa only [coordinate, rep, zero_add] using + (AddCircle.equivIco (1 : ℝ) 0 (p.q i • x)).property + +theorem coordinate_orbit (p : CircleParameterData) (θ : ℝ) (i n : ℕ) + (x : Circle) : + p.coordinate i (x + (((n : ℝ) * θ : ℝ) : Circle)) = + Int.fract (p.coordinate i x + (n : ℝ) * p.alpha θ i) := by + simpa only [coordinate, rep, alpha, Int.cast_natCast, natCast_zsmul, + ← AddCircle.coe_nsmul, nsmul_eq_mul] using + CircleCharacterDynamics.character_orbit_representative (p.q i : ℤ) (n : ℤ) θ x + +theorem kernel_ne_zero_support {m : ℕ} {z v : ℝ} (h : kernel m z v ≠ 0) : + 1 / (m : ℝ)^2 ≤ delta z ∧ 0 < v ∧ v < kernelWidth m * delta z := by + unfold kernel at h + split_ifs at h with hs + · exact hs + · exact (h rfl).elim + +theorem kernel_no_wrap {m : ℕ} (hm : 1 ≤ m) {z v : ℝ} + (hz : z ∈ Set.Ico (0 : ℝ) 1) (hk : kernel m z v ≠ 0) : + 0 < v ∧ z + v < 1 := by + have hs := kernel_ne_zero_support hk + have hw : kernelWidth m ≤ 1 := by + exact Real.rpow_le_one_of_one_le_of_nonpos (by exact_mod_cast hm) (by norm_num) + have hd : 0 ≤ delta z := by + unfold delta + exact le_min (Int.fract_nonneg z) (by linarith [Int.fract_lt_one z]) + have hd' : delta z ≤ 1 - z := by + unfold delta + rw [Int.fract_eq_self.mpr hz] + exact min_le_right _ _ + have hv : v < delta z := hs.2.2.trans_le (by nlinarith) + exact ⟨hs.2.1, by linarith⟩ + +theorem current_block_ordered (p : CircleParameterData) (θ : ℝ) (j n : ℕ) + (hm : 1 ≤ p.m j) (x : Circle) (hd : p.orbitGraphDensity θ j n x ≠ 0) + {i : ℕ} (hi : i ∈ p.block j) : + p.coordinate i x ≤ p.coordinate i (x + (((n : ℝ) * θ : ℝ) : Circle)) := by + have hk : kernel (p.m j) (p.coordinate i x) + (Int.fract ((n : ℝ) * p.alpha θ i)) ≠ 0 := by + exact (Finset.prod_ne_zero_iff.mp hd) i hi + obtain ⟨hv, hsum⟩ := kernel_no_wrap hm (p.coordinate_mem_Ico i x) hk + rw [p.coordinate_orbit] + have he : Int.fract (p.coordinate i x + (n : ℝ) * p.alpha θ i) = + Int.fract (p.coordinate i x + Int.fract ((n : ℝ) * p.alpha θ i)) := by + conv_lhs => rw [← Int.fract_add_floor ((n : ℝ) * p.alpha θ i)] + rw [← add_assoc, Int.fract_add_intCast] + rw [he, Int.fract_eq_self.mpr + ⟨by linarith [(p.coordinate_mem_Ico i x).1], hsum⟩] + linarith + +theorem measurableSet_rationalGraphGood (p : CircleParameterData) (A j : ℕ) : + MeasurableSet (p.rationalGraphGood A j) := by + unfold rationalGraphGood + simp only [Set.ofPred_and, Set.ofPred_forall] + apply MeasurableSet.inter + · exact MeasurableSet.iInter fun i => MeasurableSet.iInter fun _ => + MeasurableSet.iInter fun _ => measurableSet_lt (p.measurable_coordinate i) measurable_const + · exact MeasurableSet.iInter fun s => MeasurableSet.iInter fun _ => + MeasurableSet.iInter fun i => MeasurableSet.iInter fun _ => + measurableSet_lt (p.measurable_coordinate i) measurable_const + +end Invariant233.CircleParameterData + +namespace Invariant233.CircleParameterLaws +open CircleParameterData +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem trimming_frequency_dvd_of_le {a b : ℕ} (hab : a ≤ b) : p.q a ∣ p.q b := by + induction b, hab using Nat.le_induction with + | base => exact dvd_rfl + | succ b _ ih => exact ih.trans (hp.frequency_divisible b) + +theorem trimming_coordinate_rational_translation {A i : ℕ} (hAi : A ≤ i) + (r : ℤ) (x : Circle) : + p.coordinate i (x + (((r : ℝ) / (p.q A : ℝ) : ℝ) : Circle)) = + p.coordinate i x := by + simpa only [coordinate, rep, Int.cast_natCast, natCast_zsmul] using + CircleCharacterDynamics.character_rational_translation + (q := (p.q i : ℤ)) (d := (p.q A : ℤ)) + (by exact_mod_cast (hp.q_pos A).ne') + (by exact_mod_cast hp.trimming_frequency_dvd_of_le hAi) r x + +alias frequency_dvd_of_le := trimming_frequency_dvd_of_le + +alias coordinate_rational_translation := trimming_coordinate_rational_translation + +theorem early_coordinate_ordered {A j i n : ℕ} (hAi : A ≤ i) + (hia : i ≤ p.blockEnd (j - 1)) (x : Circle) + (hx : x ∈ p.rationalGraphGood A j) (t : ℝ) + (ht : p.q A • (t : Circle) = 0) + (hn : Int.fract ((n : ℝ) * θ - t) < p.ell j) : + p.coordinate i x ≤ p.coordinate i (x + (((n : ℝ) * θ : ℝ) : Circle)) := by + let δ : ℝ := Int.fract ((n : ℝ) * θ - t) + have hδ : 0 ≤ δ := Int.fract_nonneg _ + have hqi : 0 ≤ (p.q i : ℝ) := Nat.cast_nonneg _ + have hqa : (p.q i : ℝ) ≤ p.q (p.blockEnd (j - 1)) := by + exact_mod_cast hp.frequency_increasing.monotone hia + have hell : 0 < p.ell j := by + unfold ell + have hq : (0 : ℝ) < p.q (p.blockEnd (j - 1)) := by + exact_mod_cast hp.q_pos _ + positivity + have hmove : (p.q i : ℝ) * δ ≤ (p.q (p.blockEnd (j - 1)) : ℝ) * p.ell j := by + exact mul_le_mul hqa hn.le hδ (Nat.cast_nonneg _) + have hnowrap : p.coordinate i x + (p.q i : ℝ) * δ < 1 := by + have htrim := hx.1 i hAi hia + linarith + have hti : p.q i • (t : Circle) = 0 := by + obtain ⟨k, hk⟩ := hp.trimming_frequency_dvd_of_le hAi + rw [hk, mul_nsmul, ht, nsmul_zero] + have he : (((n : ℝ) * θ : ℝ) : Circle) = (t : Circle) + (δ : Circle) := by + dsimp [δ] + rw [AddCircle.coe_fract, AddCircle.coe_sub] + abel + have hecoord : p.coordinate i (x + (((n : ℝ) * θ : ℝ) : Circle)) = + Int.fract (p.coordinate i x + (p.q i : ℝ) * δ) := by + change rep (p.q i • (x + (((n : ℝ) * θ : ℝ) : Circle))) = _ + rw [he, nsmul_add, nsmul_add, hti, zero_add, + ← AddCircle.coe_nsmul, nsmul_eq_mul] + exact CircleCharacterDynamics.representative_add_real _ _ + rw [hecoord, Int.fract_eq_self.mpr ⟨add_nonneg (p.coordinate_mem_Ico i x).1 + (mul_nonneg hqi hδ), hnowrap⟩] + exact le_add_of_nonneg_right (mul_nonneg hqi hδ) + +theorem future_coordinate_ordered {A j s i n : ℕ} (hjs : j < s) + (hi : i ∈ p.block s) (x : Circle) (hx : x ∈ p.rationalGraphGood A j) + (hn : (n : ℝ) ≤ p.Q j) : + p.coordinate i x ≤ p.coordinate i (x + (((n : ℝ) * θ : ℝ) : Circle)) := by + have hs : 1 ≤ s := by omega + have hN : 0 < p.N s := mul_pos (by exact_mod_cast hp.m_pos s hs) + (by exact_mod_cast hp.K_pos s hs) + have hα := hp.phase_bounds s hs i hi + have hmove : (n : ℝ) * p.alpha θ i ≤ 2 * p.Q j / p.N s := by + calc + _ ≤ p.Q j * (2 / p.N s) := mul_le_mul hn hα.2.le + (one_div_pos.mpr hN |>.le.trans hα.1.le) (Real.rpow_nonneg (Nat.cast_nonneg _) _) + _ = _ := by ring + have hnowrap : p.coordinate i x + (n : ℝ) * p.alpha θ i < 1 := by + have htrim := hx.2 s hjs i hi + linarith + have hmove0 : 0 ≤ (n : ℝ) * p.alpha θ i := + mul_nonneg (Nat.cast_nonneg _) ((one_div_pos.mpr hN).le.trans hα.1.le) + rw [p.coordinate_orbit, Int.fract_eq_self.mpr + ⟨add_nonneg (p.coordinate_mem_Ico i x).1 hmove0, hnowrap⟩] + exact le_add_of_nonneg_right hmove0 + +theorem ordered_of_rationalGraphGood {A j n : ℕ} (hA : 1 ≤ A) (hj : 1 ≤ j) + (x : Circle) (hx : x ∈ p.rationalGraphGood A j) (t : ℝ) + (ht : p.q A • (t : Circle) = 0) + (hphase : Int.fract ((n : ℝ) * θ - t) < p.ell j) + (hn : (n : ℝ) ≤ p.Q j) + (hd : p.orbitGraphDensity θ j n x ≠ 0) : + ∀ i, A ≤ i → p.coordinate i x ≤ + p.coordinate i (x + (((n : ℝ) * θ : ℝ) : Circle)) := by + intro i hAi + by_cases hia : i ≤ p.blockEnd (j - 1) + · exact hp.early_coordinate_ordered hAi hia x hx t ht hphase + · by_cases hij : i ≤ p.blockEnd j + · exact p.current_block_ordered θ j n (hp.m_pos j hj) x hd + ((p.mem_block_iff j i).mpr ⟨by omega, hij⟩) + · obtain ⟨s, hs, his⟩ := p.exists_mem_block hp.m_pos i (hA.trans hAi) + have hjs : j < s := by + by_contra h + have hsj : s ≤ j := by omega + have hb := (p.blockEnd_strictMono hp.m_pos).monotone hsj + have hi := (p.mem_block_iff s i).mp his + omega + exact hp.future_coordinate_ordered hjs his x hx hn + +theorem ordered_of_rationalGraphGood_rational {A j n : ℕ} + (hA : 1 ≤ A) (hj : 1 ≤ j) (r : ℤ) (x : Circle) + (hx : x ∈ p.rationalGraphGood A j) + (hphase : Int.fract ((n : ℝ) * θ - (r : ℝ) / p.q A) < p.ell j) + (hn : (n : ℝ) ≤ p.Q j) (hd : p.orbitGraphDensity θ j n x ≠ 0) : + ∀ i, A ≤ i → p.coordinate i x ≤ + p.coordinate i (x + (((n : ℝ) * θ : ℝ) : Circle)) := by + apply hp.ordered_of_rationalGraphGood hA hj x hx ((r : ℝ) / p.q A) _ hphase hn hd + simpa only [Int.cast_natCast, natCast_zsmul] using + CircleCharacterDynamics.zsmul_rational_eq_zero + (q := (p.q A : ℤ)) (d := (p.q A : ℤ)) + (by exact_mod_cast (hp.q_pos A).ne') dvd_rfl r + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphTrimmingMeasure.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphTrimmingMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd4e8e60ce2227cc0c24b72622e462dbe6e8cf79 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphTrimmingMeasure.lean @@ -0,0 +1,169 @@ +import OAI.Analysis.IrrationalRotation.Analysis.RationalGraphTrimming +import OAI.Analysis.IrrationalRotation.Rotation.CircleWeightSupport + +namespace OAI + +noncomputable section +open MeasureTheory Set +open scoped BigOperators ENNReal +namespace Invariant233.CircleParameterLaws +open CircleParameterData +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem trimming_measurePreserving_coordinate (i : ℕ) : + MeasurePreserving (p.coordinate i) circleMeasure + (volume.restrict (Ico (0 : ℝ) 1)) := by + change MeasurePreserving + (fun x : UnitAddCircle => ((AddCircle.equivIco (1 : ℝ) 0 (p.q i • x)) : ℝ)) + volume (volume.restrict (Ico (0 : ℝ) 1)) + simpa only [natCast_zsmul] using + CircleWeightSupport.measurePreserving_characterRepresentative (p.q i : ℤ) + (by exact_mod_cast (hp.q_pos i).ne') + +theorem measure_coordinate_boundary_le (i : ℕ) (b : ℝ) : + circleMeasure {x | 1 - b ≤ p.coordinate i x} ≤ ENNReal.ofReal b := by + change circleMeasure (p.coordinate i ⁻¹' Ici (1 - b)) ≤ _ + rw [(hp.trimming_measurePreserving_coordinate i).measure_preimage measurableSet_Ici.nullMeasurableSet, + Measure.restrict_apply measurableSet_Ici] + calc + volume (Ici (1 - b) ∩ Ico 0 1) ≤ volume (Ico (1 - b) 1) := by + apply measure_mono + intro z hz + exact ⟨hz.1, hz.2.2⟩ + _ = ENNReal.ofReal b := by rw [Real.volume_Ico]; congr 1; ring + +theorem measure_finite_boundary_union_le (s : Finset ℕ) (b : ℝ) : + circleMeasure (⋃ i ∈ s, {x | 1 - b ≤ p.coordinate i x}) ≤ + ENNReal.ofReal ((s.card : ℝ) * b) := by + calc + _ ≤ ∑ i ∈ s, circleMeasure {x | 1 - b ≤ p.coordinate i x} := measure_biUnion_finset_le _ _ + _ ≤ ∑ _i ∈ s, ENNReal.ofReal b := + Finset.sum_le_sum fun i _ => hp.measure_coordinate_boundary_le i b + _ = ENNReal.ofReal ((s.card : ℝ) * b) := by + simp only [Finset.sum_const, nsmul_eq_mul, ENNReal.ofReal_mul (Nat.cast_nonneg _), + ENNReal.ofReal_natCast] + +theorem measure_future_block_boundary_le (j s : ℕ) (hs : 1 ≤ s) : + circleMeasure (⋃ i ∈ p.block s, + {x | 1 - 2 * p.Q j / p.N s ≤ p.coordinate i x}) ≤ + ENNReal.ofReal (2 * p.Q j / (p.K s : ℝ)) := by + have h := hp.measure_finite_boundary_union_le (p.block s) (2 * p.Q j / p.N s) + rw [p.card_block s hs] at h + have hm : (p.m s : ℝ) ≠ 0 := by exact_mod_cast (hp.m_pos s hs).ne' + convert h using 2 + unfold N + field_simp + +omit hp in + +theorem rationalGraphBad_subset (A j : ℕ) : + p.rationalGraphBad A j ⊆ + (⋃ i ∈ Finset.Icc A (p.blockEnd (j - 1)), + {x | 1 - (p.q (p.blockEnd (j - 1)) : ℝ) * p.ell j ≤ p.coordinate i x}) ∪ + (⋃ n : ℕ, ⋃ i ∈ p.block (j + 1 + n), + {x | 1 - 2 * p.Q j / p.N (j + 1 + n) ≤ p.coordinate i x}) := by + intro x hx + change ¬ ((∀ i, A ≤ i → i ≤ p.blockEnd (j - 1) → + p.coordinate i x < 1 - (p.q (p.blockEnd (j - 1)) : ℝ) * p.ell j) ∧ + ∀ s, j < s → ∀ i ∈ p.block s, + p.coordinate i x < 1 - 2 * p.Q j / p.N s) at hx + by_cases hearly : ∀ i, A ≤ i → i ≤ p.blockEnd (j - 1) → + p.coordinate i x < 1 - (p.q (p.blockEnd (j - 1)) : ℝ) * p.ell j + · right + have hfuture : ¬ ∀ s, j < s → ∀ i ∈ p.block s, + p.coordinate i x < 1 - 2 * p.Q j / p.N s := + fun hf => hx ⟨hearly, hf⟩ + push Not at hfuture + obtain ⟨s, hjs, i, hi, hbad⟩ := hfuture + have hs : j + 1 + (s - (j + 1)) = s := by omega + apply mem_iUnion.mpr + refine ⟨s - (j + 1), ?_⟩ + rw [hs] + exact mem_iUnion.mpr ⟨i, mem_iUnion.mpr ⟨hi, hbad⟩⟩ + · left + push Not at hearly + obtain ⟨i, hAi, hia, hi⟩ := hearly + exact mem_iUnion.mpr ⟨i, mem_iUnion.mpr ⟨Finset.mem_Icc.mpr ⟨hAi, hia⟩, hi⟩⟩ + +theorem measure_early_boundary_le {A : ℕ} (hA : 1 ≤ A) (j : ℕ) : + circleMeasure (⋃ i ∈ Finset.Icc A (p.blockEnd (j - 1)), + {x | 1 - (p.q (p.blockEnd (j - 1)) : ℝ) * p.ell j ≤ p.coordinate i x}) ≤ + ENNReal.ofReal ((p.blockEnd (j - 1) : ℝ) * + (p.q (p.blockEnd (j - 1)) : ℝ) * p.ell j) := by + have hcard : (Finset.Icc A (p.blockEnd (j - 1))).card ≤ p.blockEnd (j - 1) := by + rw [Nat.card_Icc] + omega + have hb : 0 ≤ (p.q (p.blockEnd (j - 1)) : ℝ) * p.ell j := by + unfold ell + positivity + calc + _ ≤ ENNReal.ofReal (((Finset.Icc A (p.blockEnd (j - 1))).card : ℝ) * + ((p.q (p.blockEnd (j - 1)) : ℝ) * p.ell j)) := + hp.measure_finite_boundary_union_le _ _ + _ ≤ _ := ENNReal.ofReal_le_ofReal (by + rw [mul_assoc] + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hcard) hb) + +theorem measure_future_boundary_le (j : ℕ) : + circleMeasure (⋃ n : ℕ, ⋃ i ∈ p.block (j + 1 + n), + {x | 1 - 2 * p.Q j / p.N (j + 1 + n) ≤ p.coordinate i x}) ≤ + ENNReal.ofReal (2 * p.Q j * (∑' n : ℕ, 1 / (p.K (j + 1 + n) : ℝ))) := by + have hK : Summable (fun n : ℕ => 1 / (p.K (j + 1 + n) : ℝ)) := by + have h := (summable_nat_add_iff j).mpr hp.summable_reciprocal + simpa only [Nat.add_assoc, Nat.add_comm, Nat.add_left_comm] using h + have hsum : Summable (fun n : ℕ => 2 * p.Q j / (p.K (j + 1 + n) : ℝ)) := by + simpa only [mul_one_div] using hK.mul_left (2 * p.Q j) + calc + _ ≤ ∑' n : ℕ, circleMeasure (⋃ i ∈ p.block (j + 1 + n), + {x | 1 - 2 * p.Q j / p.N (j + 1 + n) ≤ p.coordinate i x}) := measure_iUnion_le _ + _ ≤ ∑' n : ℕ, ENNReal.ofReal (2 * p.Q j / (p.K (j + 1 + n) : ℝ)) := + ENNReal.tsum_le_tsum fun n => hp.measure_future_block_boundary_le j (j + 1 + n) (by omega) + _ = ENNReal.ofReal (∑' n : ℕ, 2 * p.Q j / (p.K (j + 1 + n) : ℝ)) := by + symm + apply ENNReal.ofReal_tsum_of_nonneg _ hsum + intro n + exact div_nonneg (mul_nonneg (by norm_num) (Real.rpow_nonneg (Nat.cast_nonneg _) _)) + (Nat.cast_nonneg _) + _ = _ := by + congr 1 + simpa only [mul_one_div] using + (tsum_mul_left : (∑' n : ℕ, (2 * p.Q j) * + (1 / (p.K (j + 1 + n) : ℝ))) = + (2 * p.Q j) * ∑' n : ℕ, 1 / (p.K (j + 1 + n) : ℝ)) + +theorem measure_rationalGraphBad_le {A j : ℕ} (hA : 1 ≤ A) (hj : 1 ≤ j) : + circleMeasure (p.rationalGraphBad A j) ≤ + ENNReal.ofReal (1 / ((j + 1 : ℕ) : ℝ)^2 + + 4 * p.Q j / (p.K (j + 1) : ℝ)) := by + have hearly := hp.measure_early_boundary_le hA j + have hfuture := hp.measure_future_boundary_le j + calc + _ ≤ circleMeasure ((⋃ i ∈ Finset.Icc A (p.blockEnd (j - 1)), + {x | 1 - (p.q (p.blockEnd (j - 1)) : ℝ) * p.ell j ≤ p.coordinate i x}) ∪ + (⋃ n : ℕ, ⋃ i ∈ p.block (j + 1 + n), + {x | 1 - 2 * p.Q j / p.N (j + 1 + n) ≤ p.coordinate i x})) := + measure_mono (rationalGraphBad_subset (p := p) A j) + _ ≤ _ := (measure_union_le _ _).trans ((add_le_add hearly hfuture).trans (by + rw [← ENNReal.ofReal_add (by unfold ell; positivity) (by + apply mul_nonneg + · exact mul_nonneg (by norm_num) (Real.rpow_nonneg (Nat.cast_nonneg _) _) + · exact tsum_nonneg fun n => one_div_nonneg.mpr (Nat.cast_nonneg _))] + exact ENNReal.ofReal_le_ofReal (hp.discarded_mass_bound j hj))) + +theorem tendsto_measure_rationalGraphBad {A : ℕ} (hA : 1 ≤ A) : + Filter.Tendsto (fun n : ℕ => circleMeasure (p.rationalGraphBad A (n + 1))) + Filter.atTop (nhds 0) := by + have hbound := ENNReal.tendsto_ofReal hp.tendsto_discarded_mass_bound + simp only [ENNReal.ofReal_zero] at hbound + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hbound + · intro n + exact zero_le + · intro n + simpa only [Nat.add_assoc] using hp.measure_rationalGraphBad_le hA (show 1 ≤ n + 1 by omega) + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphs.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphs.lean new file mode 100644 index 0000000000000000000000000000000000000000..3bd231d4be4f19aa44166703b6144aceefef1fe8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RationalGraphs.lean @@ -0,0 +1,48 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ParameterOrbitIdentity +import OAI.Analysis.IrrationalRotation.Rotation.CircleRationalGraphFields + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.CircleParameterLaws +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) + +theorem exists_rational_graph_field + {P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert} + (hmem : P ∈ Rotation.algebra θ) (hP : IsStarProjection P) + (hT : (1 - P) * p.measurableOperator θ hp * P = 0) : + ∃ F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber, + (∀ x, IsStarProjection (F x)) ∧ + (∀ x, ‖F x‖ ≤ ‖P‖) ∧ + (∀ v : Rotation.Fiber, StronglyMeasurable fun x => F x v) ∧ + (∀ ξ : Rotation.Hilbert, P ξ =ᵐ[circleMeasure] fun x => F x (ξ x)) ∧ + p.RationalGraphIdentities θ F := by + obtain ⟨F, hproj, hnorm, hmeas, hrep, _, horbit⟩ := + hp.exists_measurableOperator_positive_orbit_field hmem hP hT + refine ⟨F, hproj, hnorm, hmeas, hrep, ?_⟩ + apply hp.rationalGraphIdentities_of_positive_orbits F hproj + (fun k => (hmeas (lp.single 2 k 1)).measurable) + intro n hn + filter_upwards [horbit] with x hx + exact hx n + +theorem rational_graphs_of_representation + {P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert} + (hmem : P ∈ Rotation.algebra θ) (hP : IsStarProjection P) + (hT : (1 - P) * p.measurableOperator θ hp * P = 0) + (F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber) + (hrep : ∀ ξ : Rotation.Hilbert, P ξ =ᵐ[circleMeasure] fun x => F x (ξ x)) : + p.RationalGraphIdentities θ F := by + obtain ⟨G, _, _, _, hGrep, hG⟩ := hp.exists_rational_graph_field hmem hP hT + have heq : G =ᵐ[circleMeasure] F := + L2Multiplication.field_unique_of_representation + (default : HilbertBasis ℤ ℂ Rotation.Fiber) P G F hGrep hrep + exact (p.rationalGraphIdentities_congr_ae θ heq).mp hG + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RealDensityLp.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RealDensityLp.lean new file mode 100644 index 0000000000000000000000000000000000000000..74ff80246170e61fa2111147be4dbb4a963be564 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RealDensityLp.lean @@ -0,0 +1,31 @@ +import Mathlib.MeasureTheory.Function.LpSpace.Basic +import Mathlib.MeasureTheory.Measure.WithDensity + +namespace OAI + +open MeasureTheory Filter +open scoped ENNReal + +namespace Invariant233.DensityTransport + +variable {X : Type*} [MeasurableSpace X] + +lemma exists_Lp_density_of_memLp (μ ν : Measure X) {g : X → ℝ} {B : ℝ} + (hg : MemLp g 2 μ) (hn : 0 ≤ᵐ[μ] g) + (heq : ν = μ.withDensity (fun x => ENNReal.ofReal (g x))) + (hB : 0 ≤ B) (hb : eLpNorm g 2 μ ≤ ENNReal.ofReal B) : + ∃ f : Lp ℝ 2 μ, (0 ≤ᵐ[μ] (f : X → ℝ)) ∧ + ν = μ.withDensity (fun x => ENNReal.ofReal (f x)) ∧ ‖f‖ ≤ B := by + refine ⟨hg.toLp g, ?_, ?_, ?_⟩ + · filter_upwards [hg.coeFn_toLp, hn] with x hx hnx + simpa only [hx] using hnx + · rw [heq] + apply withDensity_congr_ae + exact hg.coeFn_toLp.mono (fun x hx => congrArg ENNReal.ofReal hx.symm) + · rw [Lp.norm_toLp] + exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top hb).trans_eq + (ENNReal.toReal_ofReal hB) + +end Invariant233.DensityTransport + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RealTriangularLaw.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RealTriangularLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..f274ea518c835b80747b54ca09c5fb2171072855 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RealTriangularLaw.lean @@ -0,0 +1,83 @@ +import OAI.Analysis.IrrationalRotation.Model.RealTriangularLaw +import OAI.Analysis.IrrationalRotation.Couplings.ProductCouplingCircle +import OAI.Analysis.IrrationalRotation.Sampling.ProductSampling + +namespace OAI + +noncomputable section +open MeasureTheory Set Filter + +namespace Invariant233.OrderedProductCoupling + +lemma circlePairEndpoint_measurable : Measurable circlePairEndpoint := + circleEndpoint_measurable.prodMap circleEndpoint_measurable + +lemma measurePreserving_circlePairEndpoint : + MeasurePreserving circlePairEndpoint (baseMeasure.prod baseMeasure) + (ProductModel.baseMeasure.prod ProductModel.baseMeasure) := + measurePreserving_circleEndpoint.prod measurePreserving_circleEndpoint + +lemma realSelectedEndpoint_measurable (I : Finset ℕ) : + Measurable (fun xz : Endpoint × Endpoint => realSelectedEndpoint I xz.1 xz.2) := by + apply Measurable.of_eval + intro i + by_cases hi : i ∈ I + · simpa [realSelectedEndpoint, hi, Function.comp_def] using + (measurable_pi_apply i).comp measurable_snd + · simpa [realSelectedEndpoint, hi, Function.comp_def] using + (measurable_pi_apply i).comp measurable_fst + +lemma circleEndpoint_realSelectedEndpoint (I : Finset ℕ) (x z : Endpoint) : + circleEndpoint (realSelectedEndpoint I x z) = + ProductModel.selectedEndpoint I (circleEndpoint x) (circleEndpoint z) := by + funext i + by_cases hi : i ∈ I <;> + simp [circleEndpoint, realSelectedEndpoint, ProductModel.selectedEndpoint, hi] + +lemma realTriangularEvent_ae_preimage (I : Finset ℕ) : + realTriangularEvent I =ᵐ[baseMeasure.prod baseMeasure] + circlePairEndpoint ⁻¹' ProductModel.triangularEvent I := by + have hx : ∀ᵐ xz ∂baseMeasure.prod baseMeasure, + realEndpoint (circleEndpoint xz.1) = xz.1 := + measurePreserving_fst.quasiMeasurePreserving.ae ae_realEndpoint_circleEndpoint + have hz : ∀ᵐ xz ∂baseMeasure.prod baseMeasure, + realEndpoint (circleEndpoint xz.2) = xz.2 := + measurePreserving_snd.quasiMeasurePreserving.ae ae_realEndpoint_circleEndpoint + filter_upwards [hx, hz] with xz hx hz + change (∀ i ∈ I, xz.1 i < xz.2 i) = + (∀ i ∈ I, realEndpoint (circleEndpoint xz.1) i < realEndpoint (circleEndpoint xz.2) i) + rw [hx, hz] + +lemma map_restrict_realTriangularEvent (I : Finset ℕ) : + ((baseMeasure.prod baseMeasure).restrict (realTriangularEvent I)).map circlePairEndpoint = + (ProductModel.baseMeasure.prod ProductModel.baseMeasure).restrict + (ProductModel.triangularEvent I) := by + rw [Measure.restrict_congr_set (realTriangularEvent_ae_preimage I), + ← Measure.restrict_map circlePairEndpoint_measurable + (ProductModel.Sampling.triangularEvent_measurable I), + measurePreserving_circlePairEndpoint.map_eq] + +theorem map_realTriangularLaw (I : Finset ℕ) : + (realTriangularLaw I).map circlePairEndpoint = ProductModel.triangularLaw I := by + have hm := measurable_fst.prodMk (realSelectedEndpoint_measurable I) + rw [realTriangularLaw, Measure.map_map circlePairEndpoint_measurable hm] + have hcomp : circlePairEndpoint ∘ (fun xz : Endpoint × Endpoint => + (xz.1, realSelectedEndpoint I xz.1 xz.2)) = + (fun xz : ProductModel.EndpointPair => + (xz.1, ProductModel.selectedEndpoint I xz.1 xz.2)) ∘ circlePairEndpoint := by + funext xz + exact Prod.ext rfl (circleEndpoint_realSelectedEndpoint I xz.1 xz.2) + rw [hcomp, ← Measure.map_map (ProductModel.Sampling.endpointMap_measurable I) + circlePairEndpoint_measurable, map_restrict_realTriangularEvent] + rfl + +theorem map_absolutelyContinuous_triangularLaw (I : Finset ℕ) + {ν : Measure (Endpoint × Endpoint)} (hν : ν ≪ realTriangularLaw I) : + ν.map circlePairEndpoint ≪ ProductModel.triangularLaw I := by + simpa only [map_realTriangularLaw] using hν.map circlePairEndpoint_measurable + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RecursiveReturnTowerFits.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RecursiveReturnTowerFits.lean new file mode 100644 index 0000000000000000000000000000000000000000..da4cb6730490ccb15cdfe0751adead43c72220a9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RecursiveReturnTowerFits.lean @@ -0,0 +1,91 @@ +import OAI.Analysis.IrrationalRotation.Analysis.RecursiveReturnTowers +import OAI.Analysis.IrrationalRotation.Analysis.TowerItineraryFits + +namespace OAI + +noncomputable section +open Set +open scoped BigOperators + +namespace Invariant233.FiniteReturnTower + +variable {X : Type*} [MeasurableSpace X] {f : X ≃ᵐ X} + +def baseLabel (P : FiniteReturnTower f) (i : P.Index) : P.LevelIndex := + ⟨i, ⟨0, P.height_pos i⟩⟩ + +@[simp] theorem level_baseLabel (P : FiniteReturnTower f) (i : P.Index) : + P.level (P.baseLabel i) = P.base i := by + simp [baseLabel, level, TowerItinerary.indexedLevel, TowerItinerary.level] + +@[simp] theorem color_fiber_baseLabel (P : FiniteReturnTower f) (i : P.Index) : + P.color ⁻¹' {P.baseLabel i} = P.base i := by + rw [P.color_fiber, P.level_baseLabel] + +def fittingBaseLevels (P Q : FiniteReturnTower f) (i : P.Index) : + Finset (P.refine Q).LevelIndex := + TowerItineraryFits.fittingColorLevels Q.height (P.baseLabel i) (P.height i) + +theorem fittingBaseLevels_fits (P Q : FiniteReturnTower f) (i : P.Index) + (a : (P.refine Q).LevelIndex) (ha : a ∈ P.fittingBaseLevels Q i) : + a.2.val + P.height i ≤ (P.refine Q).height a.1 := + (TowerItineraryFits.mem_fittingColorLevels Q.height (P.baseLabel i) + (P.height i) a).mp ha |>.2 + +theorem base_eq_refine_fitting_union (P Q : FiniteReturnTower f) + (hnest : Q.returnBase ⊆ P.returnBase) (i : P.Index) : + P.base i = ⋃ a ∈ P.fittingBaseLevels Q i, (P.refine Q).level a := by + rw [← P.color_fiber_baseLabel i] + apply TowerItineraryFits.colorFiber_eq_fitting_finset_union f P.color + Q.base Q.height P.returnBase (P.baseLabel i) (P.height i) Q.covers + · intro j z hz + exact hnest (Q.top_mem j z hz) + · intro y hy + have hymem : y ∈ P.base i := by + have : y ∈ P.color ⁻¹' {P.baseLabel i} := hy + rwa [P.color_fiber_baseLabel] at this + exact P.no_return i y hymem + +theorem indicator_base_eq_refine_fitting_sum (P Q : FiniteReturnTower f) + (hnest : Q.returnBase ⊆ P.returnBase) (i : P.Index) + {E : Type*} [AddCommMonoid E] (g : X → E) (x : X) : + (P.base i).indicator g x = ∑ a ∈ P.fittingBaseLevels Q i, + ((P.refine Q).level a).indicator g x := by + classical + rw [base_eq_refine_fitting_union P Q hnest i] + apply Finset.indicator_biUnion_apply + intro a ha b hb hab + exact (P.refine Q).disjoint hab + +def successorBaseLevels (raw : ℕ → FiniteReturnTower f) (n : ℕ) + (i : (sequence raw n).Index) : Finset (sequence raw (n + 1)).LevelIndex := + (sequence raw n).fittingBaseLevels (raw (n + 1)) i + +theorem sequence_base_eq_successor_fitting_union (raw : ℕ → FiniteReturnTower f) + (hnest : ∀ n, (raw (n + 1)).returnBase ⊆ (raw n).returnBase) + (n : ℕ) (i : (sequence raw n).Index) : + (sequence raw n).base i = + ⋃ a ∈ successorBaseLevels raw n i, (sequence raw (n + 1)).level a := by + apply base_eq_refine_fitting_union (sequence raw n) (raw (n + 1)) + simpa only [sequence_returnBase] using hnest n + +theorem sequence_successorBaseLevels_fits (raw : ℕ → FiniteReturnTower f) + (n : ℕ) (i : (sequence raw n).Index) + (a : (sequence raw (n + 1)).LevelIndex) (ha : a ∈ successorBaseLevels raw n i) : + a.2.val + (sequence raw n).height i ≤ (sequence raw (n + 1)).height a.1 := + fittingBaseLevels_fits (sequence raw n) (raw (n + 1)) i a ha + +theorem sequence_indicator_base_eq_successor_sum (raw : ℕ → FiniteReturnTower f) + (hnest : ∀ n, (raw (n + 1)).returnBase ⊆ (raw n).returnBase) + (n : ℕ) (i : (sequence raw n).Index) + {E : Type*} [AddCommMonoid E] (g : X → E) (x : X) : + ((sequence raw n).base i).indicator g x = + ∑ a ∈ successorBaseLevels raw n i, ((sequence raw (n + 1)).level a).indicator g x := by + apply indicator_base_eq_refine_fitting_sum (sequence raw n) (raw (n + 1)) + simpa only [sequence_returnBase] using hnest n + +end Invariant233.FiniteReturnTower + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RecursiveReturnTowers.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RecursiveReturnTowers.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef50954a17e9bd747421aa53d0e92f86aeaf6659 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RecursiveReturnTowers.lean @@ -0,0 +1,206 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TowerItineraryRefinement + +namespace OAI + +noncomputable section +namespace Invariant233 + +open Set + +variable {X : Type*} [MeasurableSpace X] + +structure FiniteReturnTower (f : X ≃ᵐ X) where + Index : Type + indexFintype : Fintype Index + height : Index → ℕ + height_pos : ∀ i, 0 < height i + base : Index → Set X + returnBase : Set X + base_measurable : ∀ i, MeasurableSet (base i) + bases_cover : (⋃ i, base i) = returnBase + top_mem : ∀ i x, x ∈ base i → (f : X → X)^[height i] x ∈ returnBase + no_return : ∀ i x, x ∈ base i → ∀ k : ℕ, 0 < k → k < height i → + (f : X → X)^[k] x ∉ returnBase + disjoint : Pairwise fun a b : TowerItinerary.LevelIndex height => + Disjoint (TowerItinerary.indexedLevel f base height a) + (TowerItinerary.indexedLevel f base height b) + covers : ∀ x, ∃ i, ∃ k : Fin (height i), + x ∈ TowerItinerary.level f base height i k + +namespace FiniteReturnTower + +attribute [instance] indexFintype + +variable {f : X ≃ᵐ X} + +abbrev LevelIndex (P : FiniteReturnTower f) := TowerItinerary.LevelIndex P.height + +abbrev level (P : FiniteReturnTower f) (a : P.LevelIndex) : Set X := + TowerItinerary.indexedLevel f P.base P.height a + +def color (P : FiniteReturnTower f) : X → P.LevelIndex := + TowerItinerary.partitionColor P.level (fun x => by + obtain ⟨i, k, hx⟩ := P.covers x + exact ⟨⟨i, k⟩, hx⟩) + +theorem color_fiber (P : FiniteReturnTower f) (a : P.LevelIndex) : + P.color ⁻¹' {a} = P.level a := + TowerItinerary.partitionColor_fiber _ _ P.disjoint a + +theorem measurable_level (P : FiniteReturnTower f) (a : P.LevelIndex) : + MeasurableSet (P.level a) := + TowerItinerary.measurableSet_iterate_image f (P.base_measurable a.1) a.2.val + +theorem measurable_color (P : FiniteReturnTower f) [MeasurableSpace P.LevelIndex] : + Measurable P.color := + TowerItinerary.measurable_partitionColor _ P.measurable_level _ P.disjoint + +def refine (P Q : FiniteReturnTower f) : FiniteReturnTower f := by + classical + letI : MeasurableSpace P.LevelIndex := ⊤ + exact { + Index := TowerItinerary.RefinedIndex Q.height P.LevelIndex + indexFintype := inferInstance + height := TowerItinerary.refinedHeight Q.height + height_pos := fun a => Q.height_pos a.1 + base := TowerItinerary.bases f P.color Q.base Q.height + returnBase := Q.returnBase + base_measurable := fun a => TowerItinerary.measurableSet_refinedBase + f.measurable P.measurable_color (Q.base_measurable a.1) (Q.height a.1) a.2 + bases_cover := by + rw [← Q.bases_cover] + ext x + simp only [Set.mem_iUnion] + constructor + · rintro ⟨⟨i, w⟩, hx⟩ + exact ⟨i, hx.1⟩ + · rintro ⟨i, hx⟩ + exact ⟨⟨i, TowerItinerary.word f P.color (Q.height i) x⟩, hx, rfl⟩ + top_mem := fun a x hx => Q.top_mem a.1 x hx.1 + no_return := fun a x hx => Q.no_return a.1 x hx.1 + disjoint := TowerItinerary.pairwiseDisjoint_refinedLevels f.injective + P.color Q.base Q.height Q.disjoint + covers := TowerItinerary.refined_covers f P.color Q.base Q.height Q.covers } + +@[simp] theorem refine_returnBase (P Q : FiniteReturnTower f) : + (P.refine Q).returnBase = Q.returnBase := rfl + +@[simp] theorem refine_height (P Q : FiniteReturnTower f) + (a : (P.refine Q).Index) : (P.refine Q).height a = Q.height a.1 := rfl + +theorem refine_base_subset (P Q : FiniteReturnTower f) (a : (P.refine Q).Index) : + (P.refine Q).base a ⊆ Q.base a.1 := + TowerItinerary.refinedBase_subset f P.color (Q.base a.1) (Q.height a.1) a.2 + +theorem level_eq_refine_union (P Q : FiniteReturnTower f) (a : P.LevelIndex) : + P.level a = ⋃ b ∈ TowerItinerary.colorLevels Q.height a, (P.refine Q).level b := by + rw [← P.color_fiber a] + exact TowerItinerary.colorFiber_eq_finset_union f P.color Q.base Q.height Q.covers a + +def sequence (raw : ℕ → FiniteReturnTower f) : ℕ → FiniteReturnTower f + | 0 => raw 0 + | n + 1 => (sequence raw n).refine (raw (n + 1)) + +@[simp] theorem sequence_zero (raw : ℕ → FiniteReturnTower f) : + sequence raw 0 = raw 0 := rfl + +@[simp] theorem sequence_succ (raw : ℕ → FiniteReturnTower f) (n : ℕ) : + sequence raw (n + 1) = (sequence raw n).refine (raw (n + 1)) := rfl + +@[simp] theorem sequence_returnBase (raw : ℕ → FiniteReturnTower f) (n : ℕ) : + (sequence raw n).returnBase = (raw n).returnBase := by + cases n <;> rfl + +theorem sequence_level_eq_successor_union (raw : ℕ → FiniteReturnTower f) + (n : ℕ) (a : (sequence raw n).LevelIndex) : + (sequence raw n).level a = + ⋃ b ∈ TowerItinerary.colorLevels (raw (n + 1)).height a, + (sequence raw (n + 1)).level b := + level_eq_refine_union (sequence raw n) (raw (n + 1)) a + +def sequenceParent (raw : ℕ → FiniteReturnTower f) : + (n : ℕ) → (sequence raw n).Index → (raw n).Index + | 0, i => i + | _ + 1, i => i.1 + +@[simp] theorem sequence_height_parent (raw : ℕ → FiniteReturnTower f) + (n : ℕ) (i : (sequence raw n).Index) : + (sequence raw n).height i = (raw n).height (sequenceParent raw n i) := by + cases n <;> rfl + +theorem sequence_base_subset_parent (raw : ℕ → FiniteReturnTower f) + (n : ℕ) (i : (sequence raw n).Index) : + (sequence raw n).base i ⊆ (raw n).base (sequenceParent raw n i) := by + cases n with + | zero => exact Subset.rfl + | succ n => exact refine_base_subset (sequence raw n) (raw (n + 1)) i + +def topUnion (P : FiniteReturnTower f) : Set X := + ⋃ i, (f : X → X)^[P.height i - 1] '' P.base i + +@[simp] theorem refine_topUnion (P Q : FiniteReturnTower f) : + (P.refine Q).topUnion = Q.topUnion := by + ext x + simp only [topUnion, Set.mem_iUnion] + constructor + · rintro ⟨⟨i, w⟩, y, hy, hxy⟩ + exact ⟨i, y, hy.1, hxy⟩ + · rintro ⟨i, y, hy, hxy⟩ + exact ⟨⟨i, TowerItinerary.word f P.color (Q.height i) y⟩, + y, ⟨hy, rfl⟩, hxy⟩ + +@[simp] theorem sequence_topUnion (raw : ℕ → FiniteReturnTower f) (n : ℕ) : + (sequence raw n).topUnion = (raw n).topUnion := by + cases n with + | zero => rfl + | succ n => exact refine_topUnion (sequence raw n) (raw (n + 1)) + +def sequenceLevelParent (raw : ℕ → FiniteReturnTower f) (n : ℕ) + (a : (sequence raw n).LevelIndex) : (raw n).LevelIndex := + ⟨sequenceParent raw n a.1, ⟨a.2.val, by + rw [← sequence_height_parent raw n a.1] + exact a.2.isLt⟩⟩ + +theorem sequence_level_subset_parent (raw : ℕ → FiniteReturnTower f) + (n : ℕ) (a : (sequence raw n).LevelIndex) : + (sequence raw n).level a ⊆ (raw n).level (sequenceLevelParent raw n a) := + Set.image_mono (sequence_base_subset_parent raw n a.1) + +theorem measurable_returnBase (P : FiniteReturnTower f) : + MeasurableSet P.returnBase := by + rw [← P.bases_cover] + exact MeasurableSet.iUnion P.base_measurable + +theorem topUnion_eq_preimage (P : FiniteReturnTower f) : + P.topUnion = f ⁻¹' P.returnBase := by + ext x + constructor + · intro hx + obtain ⟨i, y, hy, rfl⟩ := Set.mem_iUnion.mp hx + have hheight : P.height i - 1 + 1 = P.height i := by + exact Nat.sub_add_cancel (P.height_pos i) + change f ((f : X → X)^[P.height i - 1] y) ∈ P.returnBase + rw [← Function.iterate_succ_apply' (f := (f : X → X)), Nat.succ_eq_add_one, hheight] + exact P.top_mem i y hy + · intro hx + obtain ⟨i, k, y, hy, rfl⟩ := P.covers x + have hnext : (f : X → X)^[k.val + 1] y ∈ P.returnBase := by + simpa only [Function.iterate_succ_apply', Set.mem_preimage] using hx + have hbound : P.height i ≤ k.val + 1 := by + by_contra hbad + exact P.no_return i y hy (k.val + 1) (Nat.succ_pos _) (by omega) hnext + have htop : k.val = P.height i - 1 := by omega + exact Set.mem_iUnion.mpr ⟨i, y, hy, by simp only [htop]⟩ + +theorem measure_topUnion (P : FiniteReturnTower f) (μ : MeasureTheory.Measure X) + (hf : MeasureTheory.MeasurePreserving f μ μ) : + μ P.topUnion = μ P.returnBase := by + rw [P.topUnion_eq_preimage] + exact hf.measure_preimage P.measurable_returnBase.nullMeasurableSet + +end FiniteReturnTower +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RelocationLinearity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RelocationLinearity.lean new file mode 100644 index 0000000000000000000000000000000000000000..60b25548d9b646196d278bbca15db94311dddf0c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RelocationLinearity.lean @@ -0,0 +1,60 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ContinuityCoboundary +import OAI.Analysis.IrrationalRotation.Model.ParameterSmoothing + +namespace OAI + +namespace InvariantProjection.Continuity + +variable {X I : Type*} + +theorem backwardSum_finset_sum (σ : X ≃ X) (s : Finset I) + (v : I → X → ℝ) (n : ℕ) (x : X) : + backwardSum σ (fun y => ∑ i ∈ s, v i y) n x = + ∑ i ∈ s, backwardSum σ (v i) n x := by + simp only [backwardSum] + exact Finset.sum_comm + +theorem relocated_finset_sum (σ : X ≃ X) (s : Finset I) + (h : I → X → ℝ) (φ : ℕ → X → ℝ) (H : ℕ) (x : X) : + relocated σ (fun y => ∑ i ∈ s, h i y) φ H x = + ∑ i ∈ s, relocated σ (h i) φ H x := by + simp only [relocated, Finset.sum_mul] + exact Finset.sum_comm + +theorem relocationTransfer_finset_sum (σ : X ≃ X) (s : Finset I) + (h : I → X → ℝ) (φ : ℕ → X → ℝ) (H : ℕ) (x : X) : + relocationTransfer σ (fun y => ∑ i ∈ s, h i y) φ H x = + ∑ i ∈ s, relocationTransfer σ (h i) φ H x := by + simp only [relocationTransfer, backwardSum, Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i hi + exact Finset.sum_comm + +end InvariantProjection.Continuity + +namespace Invariant233.CircleParameterData + +open InvariantProjection.Continuity + +theorem relocatedBlock_eq_sum_coordinates (p : CircleParameterData) (θ : ℝ) + (j : ℕ) (x : Circle) : + p.relocatedBlock θ j x = ∑ i ∈ p.block j, + relocated (Equiv.addRight (θ : Circle)) + (fun y => circleSmoothedDrop (p.C j) (p.alpha θ i) (p.alpha θ i / 4) + ((p.q i : ℤ) • y)) + (fun n y => p.partition j n y) (p.height j) x := by + exact relocated_finset_sum _ _ _ _ _ _ + +theorem relocatedBlockTransfer_eq_sum_coordinates (p : CircleParameterData) (θ : ℝ) + (j : ℕ) (x : Circle) : + p.relocatedBlockTransfer θ j x = ∑ i ∈ p.block j, + relocationTransfer (Equiv.addRight (θ : Circle)) + (fun y => circleSmoothedDrop (p.C j) (p.alpha θ i) (p.alpha θ i / 4) + ((p.q i : ℤ) • y)) + (fun n y => p.partition j n y) (p.height j) x := by + exact relocationTransfer_finset_sum _ _ _ _ _ _ + +end Invariant233.CircleParameterData + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RelocationSeries.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RelocationSeries.lean new file mode 100644 index 0000000000000000000000000000000000000000..fdb17ab1a27e6596c9b9383c9e2effc4b659afb5 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RelocationSeries.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ContinuityCoboundary +import OAI.Analysis.IrrationalRotation.Analysis.TransferSupport + +namespace OAI + +open scoped ENNReal BigOperators +open MeasureTheory Function + +namespace InvariantProjection.Continuity + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem measurable_relocationTransfer (σ : X ≃ᵐ X) (h : X → ℝ) + (φ : ℕ → X → ℝ) (H : ℕ) (hh : Measurable h) + (hφ : ∀ n, Measurable (φ n)) : + Measurable (relocationTransfer σ.toEquiv h φ H) := by + unfold relocationTransfer backwardSum + apply Finset.measurable_sum + intro n hn + apply Finset.measurable_sum + intro r hr + exact (hh.comp (σ.symm.measurable.iterate (r + 1))).mul + ((hφ n).comp (σ.symm.measurable.iterate (r + 1))) + +theorem exists_measurable_relocation_series_transfer {ι : Type*} [Countable ι] + (σ : X ≃ᵐ X) (hσ : MeasurePreserving σ μ μ) + (h : ι → X → ℝ) (φ : ι → ℕ → X → ℝ) (H : ι → ℕ) + (hm : ∀ i, Measurable (h i)) (hφm : ∀ i n, Measurable (φ i n)) + (hpartition : ∀ i x, ∑ n ∈ Finset.range (H i + 1), φ i n x = 1) + (hcost : ∑' i, (H i : ℝ≥0∞) * μ (support (h i)) ≠ ∞) + (hsum : ∀ᵐ x ∂μ, Summable (fun i => h i x)) : + ∃ b : X → ℝ, Measurable b ∧ + (∀ᵐ x ∂μ, (support (fun i => relocationTransfer σ.toEquiv (h i) (φ i) (H i) x)).Finite) ∧ + ∀ᵐ x ∂μ, + Summable (fun i => relocated σ.toEquiv (h i) (φ i) (H i) x) ∧ + (∑' i, relocated σ.toEquiv (h i) (φ i) (H i) x) = + (∑' i, h i x) + b x - b (σ x) := by + let d : ι → X → ℝ := fun i => relocationTransfer σ.toEquiv (h i) (φ i) (H i) + have hdmeas (i : ι) : Measurable (d i) := + measurable_relocationTransfer σ (h i) (φ i) (H i) (hm i) (hφm i) + have hdcost : ∑' i, μ (support (d i)) ≠ ∞ := by + apply ne_top_of_le_ne_top hcost + exact ENNReal.tsum_le_tsum fun i => + measure_support_relocationTransfer_le σ hσ (h i) (hm i) (φ i) (H i) + refine ⟨fun x => ∑' i, d i x, Measurable.tsum hdmeas, ?_, ?_⟩ + · exact Invariant233.TransferSupport.ae_finite_transfer_support d hdcost + · apply Invariant233.TransferSupport.ae_tsum_coboundary h + (fun i => relocated σ.toEquiv (h i) (φ i) (H i)) d σ + hσ.quasiMeasurePreserving hdcost hsum + intro i + exact Filter.Eventually.of_forall fun x => + relocated_eq_add_coboundary σ.toEquiv (h i) (φ i) (H i) x (hpartition i x) + +end InvariantProjection.Continuity + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RepresentedFieldInvariance.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RepresentedFieldInvariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e197fe460958f32262d59a8d33c86fdc3e554cd --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RepresentedFieldInvariance.lean @@ -0,0 +1,38 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplierFields + +namespace OAI + +noncomputable section +open MeasureTheory Filter +namespace Invariant233.DirectIntegral + +variable {X E ι : Type*} [MeasurableSpace X] {μ : Measure X} [IsFiniteMeasure μ] + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [Countable ι] + +theorem ae_invariant_of_representations (b : HilbertBasis ι ℂ E) + (P T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (F G : X → E →L[ℂ] E) + (hP : ∀ ξ : Lp E 2 μ, P ξ =ᵐ[μ] fun x => F x (ξ x)) + (hT : ∀ ξ : Lp E 2 μ, T ξ =ᵐ[μ] fun x => G x (ξ x)) + (hinv : (1 - P) * T * P = 0) : + ∀ᵐ x ∂μ, (1 - F x) * G x * F x = 0 := by + apply Fields.ae_eq_of_countable_columns + (Submodule.dense_iff_topologicalClosure_eq_top.mpr b.dense_span) + intro i + let ξ : Lp E 2 μ := Lp.const 2 μ (b i) + have heq : T (P ξ) = P (T (P ξ)) := by + have h := congrArg (fun A : Lp E 2 μ →L[ℂ] Lp E 2 μ => A ξ) hinv + change T (P ξ) - P (T (P ξ)) = 0 at h + exact sub_eq_zero.mp h + filter_upwards [hP ξ, hT (P ξ), hP (T (P ξ)), Lp.coeFn_const 2 μ (b i)] + with x hPx hTx hPTx hξ + have hx := congrArg (fun η : Lp E 2 μ => η x) heq + change ξ x = b i at hξ + rw [hTx, hPTx, hTx, hPx, hξ] at hx + change G x (F x (b i)) - F x (G x (F x (b i))) = 0 + exact sub_eq_zero.mpr hx + +end Invariant233.DirectIntegral + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/RepresentedInvariance.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/RepresentedInvariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..012d45fe565297706732ac242cbe7816826e54a2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/RepresentedInvariance.lean @@ -0,0 +1,52 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplierFields + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal + +namespace Invariant233.L2Multiplication + +variable {X E ι : Type*} [MeasurableSpace X] {μ : Measure X} [IsFiniteMeasure μ] + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [Countable ι] + +theorem ae_invariance_of_represented + (b : HilbertBasis ι ℂ E) + (p T : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (P W : X → E →L[ℂ] E) + (hp : ∀ f : Lp E 2 μ, p f =ᵐ[μ] fun x => P x (f x)) + (hT : ∀ f : Lp E 2 μ, T f =ᵐ[μ] fun x => W x (f x)) + (hinv : (1 - p) * T * p = 0) : + ∀ᵐ x ∂μ, (1 - P x) * W x * P x = 0 := by + have hzero : ∀ f : Lp E 2 μ, (0 : Lp E 2 μ →L[ℂ] Lp E 2 μ) f =ᵐ[μ] + fun x => ((1 - P x) * W x * P x) (f x) := by + intro f + have hfix : T (p f) = p (T (p f)) := by + have h := congrArg (fun A : Lp E 2 μ →L[ℂ] Lp E 2 μ => A f) hinv + simpa only [mul_apply_eq_comp, sub_apply, + one_apply_eq_self, zero_apply, sub_eq_zero] using h + filter_upwards [hp f, hT (p f), hp (T (p f)), Lp.coeFn_zero E 2 μ] + with x hpf hTf hpTf h0 + change (0 : Lp E 2 μ) x = _ + rw [h0] + have heq : W x (P x (f x)) = P x (W x (P x (f x))) := by + calc + W x (P x (f x)) = T (p f) x := by rw [hTf, hpf] + _ = p (T (p f)) x := congrArg (fun g : Lp E 2 μ => g x) hfix + _ = P x (W x (P x (f x))) := by rw [hpTf, hTf, hpf] + change (0 : E) = W x (P x (f x)) - P x (W x (P x (f x))) + exact (sub_eq_zero.mpr heq).symm + have huniq := field_unique_of_representation b + (0 : Lp E 2 μ →L[ℂ] Lp E 2 μ) (fun x => (1 - P x) * W x * P x) + (fun _ => 0) hzero (fun f => by + filter_upwards [Lp.coeFn_zero E 2 μ] with x hx + change (0 : Lp E 2 μ) x = (0 : E) + exact hx) + exact huniq + +end Invariant233.L2Multiplication + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ReturnSegments.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ReturnSegments.lean new file mode 100644 index 0000000000000000000000000000000000000000..7113eb14f0184147369a22f12327026d3e79f20c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ReturnSegments.lean @@ -0,0 +1,122 @@ +import Mathlib + +namespace OAI + +namespace Invariant233.ReturnSegments + +variable {X : Type*} (f : X → X) + +def IsFirstReturn (B : Set X) (x : X) (h : ℕ) : Prop := + x ∈ B ∧ 0 < h ∧ f^[h] x ∈ B ∧ + ∀ k : ℕ, 0 < k → k < h → f^[k] x ∉ B + +variable {f} + +theorem IsFirstReturn.le_return {B : Set X} {x : X} {h k : ℕ} + (hh : IsFirstReturn f B x h) (hk : 0 < k) (hret : f^[k] x ∈ B) : + h ≤ k := by + by_contra h + exact hh.2.2.2 k hk (by omega) hret + +theorem IsFirstReturn.unique {B : Set X} {x : X} {h k : ℕ} + (hh : IsFirstReturn f B x h) (hk : IsFirstReturn f B x k) : h = k := by + exact le_antisymm (hh.le_return hk.2.1 hk.2.2.1) + (hk.le_return hh.2.1 hh.2.2.1) + +theorem exists_firstReturn_le {B : Set X} {x : X} {H : ℕ} + (hx : x ∈ B) (hH : 0 < H) (hret : f^[H] x ∈ B) : + ∃ h : ℕ, IsFirstReturn f B x h ∧ h ≤ H := by + classical + have hex : ∃ k : ℕ, 0 < k ∧ f^[k] x ∈ B := ⟨H, hH, hret⟩ + refine ⟨Nat.find hex, ⟨hx, (Nat.find_spec hex).1, + (Nat.find_spec hex).2, ?_⟩, Nat.find_min' hex ⟨hH, hret⟩⟩ + intro k hk hkh hmem + exact Nat.find_min hex hkh ⟨hk, hmem⟩ + +theorem segment_fits_of_endpoint {B C : Set X} (hCB : C ⊆ B) + {x : X} {H r h : ℕ} (hret : f^[H] x ∈ C) (hr : r < H) + (hfirst : IsFirstReturn f B (f^[r] x) h) : r + h ≤ H := by + have hdiff : 0 < H - r := by omega + have heq : f^[H - r] (f^[r] x) = f^[H] x := by + rw [← Function.iterate_add_apply, Nat.sub_add_cancel (by omega : r ≤ H)] + have hle := hfirst.le_return hdiff (heq ▸ hCB hret) + omega + +theorem nested_segment_fits {B C : Set X} (hCB : C ⊆ B) + {x : X} {H r h : ℕ} (hnew : IsFirstReturn f C x H) (hr : r < H) + (hold : IsFirstReturn f B (f^[r] x) h) : r + h ≤ H := + segment_fits_of_endpoint hCB hnew.2.2.1 hr hold + +theorem exists_firstReturn_at_visit {B C : Set X} (hCB : C ⊆ B) + {x : X} {H r : ℕ} (hret : f^[H] x ∈ C) (hr : r < H) + (hvisit : f^[r] x ∈ B) : + ∃! h : ℕ, IsFirstReturn f B (f^[r] x) h ∧ r + h ≤ H := by + have heq : f^[H - r] (f^[r] x) = f^[H] x := by + rw [← Function.iterate_add_apply, Nat.sub_add_cancel (by omega : r ≤ H)] + obtain ⟨h, hh, hbound⟩ := exists_firstReturn_le hvisit + (by omega : 0 < H - r) (heq ▸ hCB hret) + refine ⟨h, ⟨hh, by omega⟩, ?_⟩ + intro k hk + exact hk.1.unique hh + +theorem IsFirstReturn.no_internal_visit {B : Set X} {x : X} {r h t : ℕ} + (hh : IsFirstReturn f B (f^[r] x) h) (hrt : r < t) (hth : t < r + h) : + f^[t] x ∉ B := by + have heq : f^[t - r] (f^[r] x) = f^[t] x := by + rw [← Function.iterate_add_apply, Nat.sub_add_cancel (by omega : r ≤ t)] + rw [← heq] + exact hh.2.2.2 (t - r) (by omega) (by omega) + +theorem segment_unique {B : Set X} {x : X} {r h s k t : ℕ} + (hr : IsFirstReturn f B (f^[r] x) h) + (hs : IsFirstReturn f B (f^[s] x) k) + (hrt : r ≤ t) (htr : t < r + h) (hst : s ≤ t) (hts : t < s + k) : + r = s ∧ h = k := by + have hrs : r = s := by + apply le_antisymm + · by_contra hnot + exact hs.no_internal_visit (x := x) (r := s) (h := k) (t := r) + (by omega : s < r) (by omega : r < s + k) hr.1 + · by_contra hnot + exact hr.no_internal_visit (x := x) (r := r) (h := h) (t := s) + (by omega : r < s) (by omega : s < r + h) hs.1 + refine ⟨hrs, ?_⟩ + subst s + exact hr.unique hs + +theorem exists_unique_segment {B C : Set X} (hCB : C ⊆ B) + {x : X} {H t : ℕ} (hx : x ∈ B) (hret : f^[H] x ∈ C) (ht : t < H) : + ∃! s : ℕ × ℕ, IsFirstReturn f B (f^[s.1] x) s.2 ∧ + s.1 ≤ t ∧ t < s.1 + s.2 ∧ s.1 + s.2 ≤ H := by + classical + let P : ℕ → Prop := fun r => f^[r] x ∈ B + let r : ℕ := Nat.findGreatest P t + have hrt : r ≤ t := Nat.findGreatest_le t + have hvisit : f^[r] x ∈ B := + Nat.findGreatest_spec (P := P) (Nat.zero_le t) (by simpa [P] using hx) + obtain ⟨h, ⟨hh, hfit⟩, _⟩ := + exists_firstReturn_at_visit hCB hret (by omega : r < H) hvisit + have htr : t < r + h := by + by_contra hnot + have hreturn : P (r + h) := by + dsimp [P] + rw [Nat.add_comm r h, Function.iterate_add_apply] + exact hh.2.2.1 + have hmax : r + h ≤ r := Nat.le_findGreatest (by omega) hreturn + have hpos := hh.2.1 + omega + refine ⟨(r, h), ⟨hh, hrt, htr, hfit⟩, ?_⟩ + rintro ⟨s, k⟩ ⟨hs, hst, hts, _⟩ + obtain ⟨hrs, hhk⟩ := segment_unique hs hh hst hts hrt htr + exact Prod.ext hrs hhk + +theorem nested_return_concatenation {B C : Set X} (hCB : C ⊆ B) + {x : X} {H : ℕ} (hnew : IsFirstReturn f C x H) : + ∀ t < H, ∃! s : ℕ × ℕ, IsFirstReturn f B (f^[s.1] x) s.2 ∧ + s.1 ≤ t ∧ t < s.1 + s.2 ∧ s.1 + s.2 ≤ H := by + intro t ht + exact exists_unique_segment hCB (hCB hnew.1) hnew.2.2.1 ht + +end Invariant233.ReturnSegments + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/SawtoothSmoothing.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/SawtoothSmoothing.lean new file mode 100644 index 0000000000000000000000000000000000000000..a07461b817fbb7fc2bc2ae413c11873888858309 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/SawtoothSmoothing.lean @@ -0,0 +1,252 @@ +import OAI.Analysis.IrrationalRotation.Model.SawtoothSmoothing +import Mathlib.MeasureTheory.Integral.DominatedConvergence +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic +import Mathlib.Analysis.SpecialFunctions.Integrals.Basic +import Mathlib.Tactic + +namespace OAI + +namespace InvariantProjection.Continuity + +open MeasureTheory Set + +theorem intervalIntegrable_fract (a b : ℝ) : + IntervalIntegrable Int.fract volume a b := by + apply (intervalIntegrable_const (c := (1 : ℝ))).mono_fun' + · exact measurable_fract.aestronglyMeasurable + · exact Filter.Eventually.of_forall (fun x => by + change ‖Int.fract x‖ ≤ (1 : ℝ) + rw [Real.norm_eq_abs, abs_of_nonneg (Int.fract_nonneg x)] + exact (Int.fract_lt_one x).le) + +theorem fract_fract_add (u a : ℝ) : + Int.fract (Int.fract u + a) = Int.fract (u + a) := by + have hu : u + a = (Int.fract u + a) + (⌊u⌋ : ℝ) := by + have := Int.fract_add_floor u + linarith + rw [hu, Int.fract_add_intCast] + +theorem floor_drop_eq_sawtooth_difference (u a : ℝ) : + (⌊Int.fract u + a⌋ : ℝ) = a + Int.fract u - Int.fract (u + a) := by + have ha := Int.floor_add_fract (Int.fract u + a) + rw [fract_fract_add] at ha + linarith + +theorem smoothedDrop_eq_add_coboundary (C a δ u : ℝ) : + smoothedDrop C a δ u = C * (⌊Int.fract u + a⌋ : ℝ) + + smoothingTransfer C δ u - smoothingTransfer C δ (u + a) := by + rw [floor_drop_eq_sawtooth_difference] + unfold smoothedDrop smoothingTransfer + ring + +theorem smoothSawtooth_periodic (δ : ℝ) : + Function.Periodic (smoothSawtooth δ) 1 := by + intro u + unfold smoothSawtooth + congr 1 + apply intervalIntegral.integral_congr + intro t ht + have h : u + 1 + t = (u + t) + 1 := by ring + change Int.fract (u + 1 + t) = Int.fract (u + t) + rw [h, Int.fract_add_one] + +theorem continuous_smoothSawtooth (δ : ℝ) : Continuous (smoothSawtooth δ) := by + have hc := intervalIntegral.continuous_primitive intervalIntegrable_fract 0 + have heq (u : ℝ) : smoothSawtooth δ u = + (2 * δ)⁻¹ * ((∫ t in 0..u + δ, Int.fract t) - + ∫ t in 0..u - δ, Int.fract t) := by + unfold smoothSawtooth + rw [intervalIntegral.integral_comp_add_left] + have ht := intervalIntegral.integral_add_adjacent_intervals + (intervalIntegrable_fract 0 (u - δ)) + (intervalIntegrable_fract (u - δ) (u + δ)) + congr 1 + change (∫ t in u - δ..u + δ, Int.fract t) = _ + linarith + have hf : smoothSawtooth δ = fun u => + (2 * δ)⁻¹ * ((∫ t in 0..u + δ, Int.fract t) - + ∫ t in 0..u - δ, Int.fract t) := funext heq + rw [hf] + exact continuous_const.mul ((hc.comp (continuous_id.add_const δ)).sub + (hc.comp (continuous_id.sub continuous_const))) + +theorem continuous_smoothedDrop (C a δ : ℝ) : Continuous (smoothedDrop C a δ) := by + unfold smoothedDrop + exact continuous_const.mul ((continuous_const.add (continuous_smoothSawtooth δ)).sub + ((continuous_smoothSawtooth δ).comp (continuous_id.add_const a))) + +theorem intervalIntegrable_fract_add (u a b : ℝ) : + IntervalIntegrable (fun t => Int.fract (u + t)) volume a b := by + apply (intervalIntegrable_const (c := (1 : ℝ))).mono_fun' + · exact (measurable_const.add measurable_id).fract.aestronglyMeasurable + · exact Filter.Eventually.of_forall (fun t => by + change ‖Int.fract (u + t)‖ ≤ (1 : ℝ) + rw [Real.norm_eq_abs, abs_of_nonneg (Int.fract_nonneg _)] + exact (Int.fract_lt_one _).le) + +theorem smoothedDrop_eq_average (C a δ u : ℝ) (hδ : δ ≠ 0) : + smoothedDrop C a δ u = C * (2 * δ)⁻¹ * + ∫ t in -δ..δ, (⌊Int.fract (u + t) + a⌋ : ℝ) := by + have hiu := intervalIntegrable_fract_add u (-δ) δ + have hiua := intervalIntegrable_fract_add (u + a) (-δ) δ + have hi : (∫ t in -δ..δ, (⌊Int.fract (u + t) + a⌋ : ℝ)) = + (2 * δ) * a + (∫ t in -δ..δ, Int.fract (u + t)) - + (∫ t in -δ..δ, Int.fract (u + a + t)) := by + calc + _ = ∫ t in -δ..δ, a + Int.fract (u + t) - Int.fract (u + a + t) := by + apply intervalIntegral.integral_congr + intro t ht + change (⌊Int.fract (u + t) + a⌋ : ℝ) = _ + rw [floor_drop_eq_sawtooth_difference] + congr 2 + ring + _ = _ := by + rw [intervalIntegral.integral_sub (intervalIntegrable_const.add hiu) hiua, + intervalIntegral.integral_add intervalIntegrable_const hiu, + intervalIntegral.integral_const] + simp only [smul_eq_mul] + ring + rw [hi] + unfold smoothedDrop smoothSawtooth + field_simp + +theorem smoothedDrop_nonneg {C a δ : ℝ} (hC : 0 ≤ C) (ha : 0 ≤ a) + (hδ : 0 < δ) (u : ℝ) : 0 ≤ smoothedDrop C a δ u := by + rw [smoothedDrop_eq_average C a δ u hδ.ne'] + apply mul_nonneg + · positivity + · apply intervalIntegral.integral_nonneg (by linarith) + intro t ht + exact_mod_cast Int.floor_nonneg.mpr (add_nonneg (Int.fract_nonneg _) ha) + +theorem smoothSawtooth_eq_fract_of_middle {δ u : ℝ} (hδ : 0 < δ) + (hlo : δ ≤ Int.fract u) (hhi : Int.fract u + δ < 1) : + smoothSawtooth δ u = Int.fract u := by + have hi : (∫ t in -δ..δ, Int.fract (u + t)) = + ∫ t in -δ..δ, Int.fract u + t := by + apply intervalIntegral.integral_congr + intro t ht + rw [Set.uIcc_of_le (by linarith : -δ ≤ δ)] at ht + change Int.fract (u + t) = Int.fract u + t + rw [← fract_fract_add] + apply Int.fract_eq_self.mpr + constructor <;> linarith [ht.1, ht.2] + unfold smoothSawtooth + rw [hi, intervalIntegral.integral_add + (f := fun _ : ℝ => Int.fract u) (g := fun t : ℝ => t) + intervalIntegrable_const (continuous_id.intervalIntegrable (-δ) δ), + intervalIntegral.integral_const, integral_id] + simp only [smul_eq_mul] + field_simp + ring + +theorem smoothingTransfer_eq_zero_of_middle {δ u : ℝ} (C : ℝ) + (hδ : 0 < δ) (hlo : δ ≤ Int.fract u) (hhi : Int.fract u + δ < 1) : + smoothingTransfer C δ u = 0 := by + simp [smoothingTransfer, smoothSawtooth_eq_fract_of_middle hδ hlo hhi] + +theorem integral_smoothedDrop (C a δ : ℝ) : + (∫ u in (0 : ℝ)..1, smoothedDrop C a δ u) = C * a := by + have hs := continuous_smoothSawtooth δ + have hshift : (∫ u in (0 : ℝ)..1, smoothSawtooth δ (u + a)) = + ∫ u in (0 : ℝ)..1, smoothSawtooth δ u := by + rw [intervalIntegral.integral_comp_add_right] + simpa only [zero_add, add_comm (1 : ℝ) a] using + (smoothSawtooth_periodic δ).intervalIntegral_add_eq a 0 + unfold smoothedDrop + rw [intervalIntegral.integral_const_mul, + intervalIntegral.integral_sub + (f := fun u : ℝ => a + smoothSawtooth δ u) + (g := fun u : ℝ => smoothSawtooth δ (u + a)) + (intervalIntegrable_const.add (hs.intervalIntegrable 0 1)) + ((hs.comp (continuous_id.add_const a)).intervalIntegrable 0 1), + intervalIntegral.integral_add + (f := fun _ : ℝ => a) (g := smoothSawtooth δ) + intervalIntegrable_const (hs.intervalIntegrable 0 1), + intervalIntegral.integral_const, hshift] + simp + +theorem smoothedDrop_eq_zero_of_middle {a δ u : ℝ} (C : ℝ) + (ha : 0 ≤ a) (hδ : 0 < δ) (hlo : δ ≤ Int.fract u) + (hhi : Int.fract u + a + δ < 1) : smoothedDrop C a δ u = 0 := by + rw [smoothedDrop_eq_average C a δ u hδ.ne'] + have hi : (∫ t in -δ..δ, (⌊Int.fract (u + t) + a⌋ : ℝ)) = 0 := by + calc + _ = ∫ _t in -δ..δ, (0 : ℝ) := by + apply intervalIntegral.integral_congr + intro t ht + rw [Set.uIcc_of_le (by linarith : -δ ≤ δ)] at ht + have hf : Int.fract (u + t) = Int.fract u + t := by + rw [← fract_fract_add] + apply Int.fract_eq_self.mpr + constructor <;> linarith [ht.1, ht.2] + have hz : ⌊Int.fract (u + t) + a⌋ = 0 := by + rw [hf, Int.floor_eq_iff] + constructor <;> norm_num <;> linarith [ht.1, ht.2] + change (⌊Int.fract (u + t) + a⌋ : ℝ) = 0 + rw [hz, Int.cast_zero] + _ = 0 := by simp + rw [hi, mul_zero] + +theorem measure_smoothingTransfer_support_le {δ : ℝ} (C : ℝ) (hδ : 0 < δ) : + volume {u : ℝ | u ∈ Ico 0 1 ∧ smoothingTransfer C δ u ≠ 0} ≤ + ENNReal.ofReal (2 * δ) := by + have hsub : {u : ℝ | u ∈ Ico 0 1 ∧ smoothingTransfer C δ u ≠ 0} ⊆ + Icc 0 δ ∪ Icc (1 - δ) 1 := by + intro u hu + by_contra hout + have hfrac : Int.fract u = u := Int.fract_eq_self.mpr hu.1 + have hleft : δ < u := by + by_contra hn + exact hout (Or.inl ⟨hu.1.1, le_of_not_gt hn⟩) + have hright : u < 1 - δ := by + by_contra hn + exact hout (Or.inr ⟨le_of_not_gt hn, hu.1.2.le⟩) + apply hu.2 + apply smoothingTransfer_eq_zero_of_middle C hδ + · simpa [hfrac] using hleft.le + · rw [hfrac] + linarith + calc + _ ≤ volume (Icc 0 δ ∪ Icc (1 - δ) 1) := measure_mono hsub + _ ≤ volume (Icc 0 δ) + volume (Icc (1 - δ) 1) := measure_union_le _ _ + _ = ENNReal.ofReal δ + ENNReal.ofReal δ := by simp + _ = ENNReal.ofReal (2 * δ) := by + rw [← ENNReal.ofReal_add hδ.le hδ.le] + congr 1 + ring + +theorem measure_smoothedDrop_support_le {a δ : ℝ} (C : ℝ) + (ha : 0 ≤ a) (hδ : 0 < δ) : + volume {u : ℝ | u ∈ Ico 0 1 ∧ smoothedDrop C a δ u ≠ 0} ≤ + ENNReal.ofReal (a + 2 * δ) := by + have hsub : {u : ℝ | u ∈ Ico 0 1 ∧ smoothedDrop C a δ u ≠ 0} ⊆ + Icc 0 δ ∪ Icc (1 - a - δ) 1 := by + intro u hu + by_contra hout + have hfrac : Int.fract u = u := Int.fract_eq_self.mpr hu.1 + have hleft : δ < u := by + by_contra hn + exact hout (Or.inl ⟨hu.1.1, le_of_not_gt hn⟩) + have hright : u < 1 - a - δ := by + by_contra hn + exact hout (Or.inr ⟨le_of_not_gt hn, hu.1.2.le⟩) + apply hu.2 + apply smoothedDrop_eq_zero_of_middle C ha hδ + · simpa [hfrac] using hleft.le + · rw [hfrac] + linarith + calc + _ ≤ volume (Icc 0 δ ∪ Icc (1 - a - δ) 1) := measure_mono hsub + _ ≤ volume (Icc 0 δ) + volume (Icc (1 - a - δ) 1) := measure_union_le _ _ + _ = ENNReal.ofReal δ + ENNReal.ofReal (a + δ) := by + rw [Real.volume_Icc, Real.volume_Icc] + congr 1 <;> congr 1 <;> ring + _ = ENNReal.ofReal (a + 2 * δ) := by + rw [← ENNReal.ofReal_add hδ.le (by linarith)] + congr 1 + ring + +end InvariantProjection.Continuity + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarBVDiscrepancy.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarBVDiscrepancy.lean new file mode 100644 index 0000000000000000000000000000000000000000..503be9fa06cb89102011f6e4ba9570a1ecd58014 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarBVDiscrepancy.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ScalarRectangleDiscrepancy +import OAI.Analysis.IrrationalRotation.Analysis.BVDiscrepancy + +namespace OAI + +noncomputable section +open MeasureTheory Set +open scoped ENNReal + +namespace Invariant233.ScalarRectangles + +theorem scalar_bv_discrepancy (m : ℕ) (hm : 200 ≤ m) + (N₀ N : ℝ) (hN₀ : 0 < N₀) (hN : N₀ ≤ N) (hNm : N ≤ (m : ℝ) ^ 2) + (n n' : ℕ) + (hn : (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 ≤ n) + (hn' : (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 ≤ n') + (hsep : ∀ i j : ℤ, |i| ≤ (m ^ 300 : ℕ) → |j| ≤ (m ^ 300 : ℕ) → + (i, j) ≠ (0, 0) → + N * (m : ℝ) ^ 1000 < |(i : ℝ) * n + (j : ℝ) * n'|) + (f g : ℝ → ℂ) + (hf : BoundedVariationOn f (Icc (0 : ℝ) 1)) + (hg : BoundedVariationOn g (Icc (0 : ℝ) 1)) : + ‖(∫ t, f (Int.fract ((n : ℝ) * t)) * g (Int.fract ((n' : ℝ) * t)) + ∂UniformIntervalPhase.lambdaLaw N₀) - + (∫ x in (0 : ℝ)..1, f x) * (∫ y in (0 : ℝ)..1, g y)‖ ≤ + (29 / (m : ℝ) ^ 80) * + (sSup ((fun x => ‖f x‖) '' Icc (0 : ℝ) 1) + + (eVariationOn f (Icc (0 : ℝ) 1)).toReal) * + (sSup ((fun x => ‖g x‖) '' Icc (0 : ℝ) 1) + + (eVariationOn g (Icc (0 : ℝ) 1)).toReal) := by + let := UniformIntervalPhase.lambdaLaw_probability N₀ hN₀ + have hmr : (200 : ℝ) ≤ m := by exact_mod_cast hm + have hmp : 0 < (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 := + div_pos (Real.rpow_pos_of_pos (by linarith) _) (by norm_num) + have hX : Measurable (fun t => Int.fract ((n : ℝ) * t)) := + measurable_fract.comp (measurable_const_mul (n : ℝ)) + have hY : Measurable (fun t => Int.fract ((n' : ℝ) * t)) := + measurable_fract.comp (measurable_const_mul (n' : ℝ)) + have hrect : ∀ a ∈ Icc (0 : ℝ) 1, ∀ b ∈ Icc (0 : ℝ) 1, + ‖(∫ t, BVDiscrepancy.tail a (Int.fract ((n : ℝ) * t)) * + BVDiscrepancy.tail b (Int.fract ((n' : ℝ) * t)) + ∂UniformIntervalPhase.lambdaLaw N₀) - + ((1 - a : ℝ) : ℂ) * ((1 - b : ℝ) : ℂ)‖ ≤ 29 / (m : ℝ) ^ 80 := by + intro a ha b hb + simpa only [BVDiscrepancy.tail, Complex.ofReal_mul] using + scalar_tail_rectangles_integral m hm N₀ N hN₀ hN hNm n n' hn hn' hsep a b ha hb + have h := BVDiscrepancy.boundedVariation_discrepancy + (UniformIntervalPhase.lambdaLaw N₀) hX hY + (sampled_fraction_absolutelyContinuous N₀ n hN₀ (hmp.trans_le hn)) + (sampled_fraction_absolutelyContinuous N₀ n' hN₀ (hmp.trans_le hn')) + (by positivity : (0 : ℝ) ≤ 29 / (m : ℝ) ^ 80) hrect f g hf hg + simpa only [BVDiscrepancy.unitMeasure, integral_Icc_eq_integral_Ioc, + intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] using h + +end Invariant233.ScalarRectangles + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarEndpointDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarEndpointDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..cea3d9c48fec022d769e71290dfd766aa6110950 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarEndpointDensity.lean @@ -0,0 +1,380 @@ +import OAI.Analysis.IrrationalRotation.Model.ScalarEndpointDensity +import Mathlib.Tactic +import Mathlib.MeasureTheory.Integral.Prod + +namespace OAI + +open MeasureTheory Set + +namespace Invariant233.ScalarEndpointDensity + +theorem endpointMap_left (t : ℝ) {z : ℝ} (hz : z ≤ 1 / 2) : + endpointMap t z = (1 + t) * z := by + unfold endpointMap cutDistance + rw [min_eq_left (by linarith)] + ring + +theorem endpointMap_right (t : ℝ) {z : ℝ} (hz : 1 / 2 ≤ z) : + endpointMap t z = (1 - t) * z + t := by + unfold endpointMap cutDistance + rw [min_eq_right (by linarith)] + ring + +theorem continuous_endpointMap (t : ℝ) : Continuous (endpointMap t) := by + unfold endpointMap cutDistance + fun_prop + +theorem endpointMap_zero (t : ℝ) : endpointMap t 0 = 0 := by + simp [endpointMap, cutDistance] + +theorem endpointMap_one (t : ℝ) : endpointMap t 1 = 1 := by + simp [endpointMap, cutDistance] + +theorem endpointMap_half (t : ℝ) : endpointMap t (1 / 2) = midpoint t := by + rw [endpointMap_left t le_rfl] + unfold midpoint + ring + +theorem strictMono_endpointMap {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t < 1) : + StrictMono (endpointMap t) := by + intro x y hxy + by_cases hx : x ≤ 1 / 2 + · by_cases hy : y ≤ 1 / 2 + · rw [endpointMap_left t hx, endpointMap_left t hy] + exact mul_lt_mul_of_pos_left hxy (by linarith) + · rw [endpointMap_left t hx, endpointMap_right t (by linarith)] + have hleft : (1 + t) * x ≤ (1 + t) * (1 / 2) := + mul_le_mul_of_nonneg_left hx (by linarith) + have hright : (1 - t) * (1 / 2) < (1 - t) * y := + mul_lt_mul_of_pos_left (by linarith) (by linarith) + linarith + · rw [endpointMap_right t (by linarith), endpointMap_right t (by linarith)] + have := mul_lt_mul_of_pos_left hxy (show 0 < 1 - t by linarith) + linarith + +theorem endpointMap_mem_unitInterval {t z : ℝ} (ht0 : 0 ≤ t) (ht1 : t < 1) + (hz0 : 0 ≤ z) (hz1 : z ≤ 1) : endpointMap t z ∈ Icc (0 : ℝ) 1 := by + have hm := (strictMono_endpointMap ht0 ht1).monotone + constructor + · simpa only [endpointMap_zero] using hm hz0 + · simpa only [endpointMap_one] using hm hz1 + +theorem midpoint_pos {t : ℝ} (ht0 : 0 ≤ t) : 0 < midpoint t := by + unfold midpoint + linarith + +theorem midpoint_lt_one {t : ℝ} (ht1 : t < 1) : midpoint t < 1 := by + unfold midpoint + linarith + +theorem slopeDensity_pos {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t < 1) (s : ℝ) : + 0 < slopeDensity t s := by + unfold slopeDensity + split_ifs <;> positivity + +theorem slopeDensity_lower {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t < 1) (s : ℝ) : + (1 + t)⁻¹ ≤ slopeDensity t s := by + unfold slopeDensity + split_ifs + · exact le_rfl + · apply inv_anti₀ (by linarith) + linarith + +theorem slopeDensity_upper {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t < 1) (s : ℝ) : + slopeDensity t s ≤ (1 - t)⁻¹ := by + unfold slopeDensity + split_ifs + · apply inv_anti₀ (by linarith) + linarith + · exact le_rfl + +theorem slopeDensity_mul_intervalIntegrable {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t < 1) + {φ : ℝ → ℝ} (hφ : Continuous φ) : + IntervalIntegrable (fun s => φ s * slopeDensity t s) volume 0 1 := by + have hm0 := midpoint_pos ht0 + have hm1 := midpoint_lt_one ht1 + have hleft : IntervalIntegrable (fun s => φ s * slopeDensity t s) + volume 0 (midpoint t) := by + have hi : IntervalIntegrable (fun s => φ s * (1 + t)⁻¹) + volume 0 (midpoint t) := (hφ.mul continuous_const).intervalIntegrable _ _ + apply hi.congr_uIoo + intro s hs + rw [uIoo_of_le hm0.le] at hs + simp only [slopeDensity, ite_eq_left hs.2.le] + have hright : IntervalIntegrable (fun s => φ s * slopeDensity t s) + volume (midpoint t) 1 := by + have hi : IntervalIntegrable (fun s => φ s * (1 - t)⁻¹) + volume (midpoint t) 1 := (hφ.mul continuous_const).intervalIntegrable _ _ + apply hi.congr_uIoo + intro s hs + rw [uIoo_of_le hm1.le] at hs + simp only [slopeDensity, ite_eq_right (not_le_of_gt hs.1)] + exact hleft.trans hright + +theorem endpointMap_integral {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t < 1) + {φ : ℝ → ℝ} (hφ : Continuous φ) : + (∫ z in (0 : ℝ)..1, φ (endpointMap t z)) = + ∫ s in (0 : ℝ)..1, φ s * slopeDensity t s := by + have hp : 1 + t ≠ 0 := ne_of_gt (by linarith) + have hn : 1 - t ≠ 0 := ne_of_gt (by linarith) + have hm0 := midpoint_pos ht0 + have hm1 := midpoint_lt_one ht1 + have hc : Continuous (fun z => φ (endpointMap t z)) := + hφ.comp (continuous_endpointMap t) + have hleft : (∫ z in (0 : ℝ)..(1 / 2), φ (endpointMap t z)) = + (1 + t)⁻¹ * ∫ s in (0 : ℝ)..midpoint t, φ s := by + calc + _ = ∫ z in (0 : ℝ)..(1 / 2), φ ((1 + t) * z) := by + apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num) + intro z hz + dsimp + rw [endpointMap_left t hz.2.le] + _ = _ := by + rw [intervalIntegral.integral_comp_mul_left φ hp] + simp only [mul_zero, smul_eq_mul] + congr 2 + unfold midpoint + ring + have hright : (∫ z in (1 / 2 : ℝ)..1, φ (endpointMap t z)) = + (1 - t)⁻¹ * ∫ s in midpoint t..(1 : ℝ), φ s := by + calc + _ = ∫ z in (1 / 2 : ℝ)..1, φ ((1 - t) * z + t) := by + apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num) + intro z hz + dsimp + rw [endpointMap_right t hz.1.le] + _ = _ := by + rw [intervalIntegral.integral_comp_mul_add φ hn t] + simp only [smul_eq_mul] + congr 2 + · unfold midpoint + ring + · ring + have hd := slopeDensity_mul_intervalIntegrable ht0 ht1 hφ + have hdleft : (∫ s in (0 : ℝ)..midpoint t, φ s * slopeDensity t s) = + (1 + t)⁻¹ * ∫ s in (0 : ℝ)..midpoint t, φ s := by + calc + _ = ∫ s in (0 : ℝ)..midpoint t, φ s * (1 + t)⁻¹ := by + apply intervalIntegral.integral_congr_Ioo_of_le hm0.le + intro s hs + simp only [slopeDensity, ite_eq_left hs.2.le] + _ = _ := by rw [intervalIntegral.integral_mul_const]; ring + have hdright : (∫ s in midpoint t..(1 : ℝ), φ s * slopeDensity t s) = + (1 - t)⁻¹ * ∫ s in midpoint t..(1 : ℝ), φ s := by + calc + _ = ∫ s in midpoint t..(1 : ℝ), φ s * (1 - t)⁻¹ := by + apply intervalIntegral.integral_congr_Ioo_of_le hm1.le + intro s hs + simp only [slopeDensity, ite_eq_right (not_le_of_gt hs.1)] + _ = _ := by rw [intervalIntegral.integral_mul_const]; ring + rw [← intervalIntegral.integral_add_adjacent_intervals + (hc.intervalIntegrable 0 (1 / 2)) (hc.intervalIntegrable (1 / 2) 1), hleft, hright] + have hdl : IntervalIntegrable (fun s => φ s * slopeDensity t s) + volume 0 (midpoint t) := hd.mono_set (by + rw [uIcc_of_le hm0.le, uIcc_of_le (by norm_num : (0 : ℝ) ≤ 1)] + exact Icc_subset_Icc le_rfl hm1.le) + have hdr : IntervalIntegrable (fun s => φ s * slopeDensity t s) + volume (midpoint t) 1 := hd.mono_set (by + rw [uIcc_of_le hm1.le, uIcc_of_le (by norm_num : (0 : ℝ) ≤ 1)] + exact Icc_subset_Icc hm0.le le_rfl) + rw [← intervalIntegral.integral_add_adjacent_intervals hdl hdr] + rw [hdleft, hdright] + +theorem integral_slopeDensity {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t < 1) : + (∫ s in (0 : ℝ)..1, slopeDensity t s) = 1 := by + have h := endpointMap_integral ht0 ht1 (φ := fun _ => 1) continuous_const + simpa using h.symm + +theorem slopeDensity_deviation {t h : ℝ} (ht0 : 0 ≤ t) (hth : t ≤ h) + (hh1 : h < 1) (s : ℝ) : + |slopeDensity t s - 1| ≤ h / (1 - h) := by + have ht1 : t < 1 := lt_of_le_of_lt hth hh1 + have hh0 : 0 ≤ h := le_trans ht0 hth + have hp : 0 < 1 + t := by linarith + have hn : 0 < 1 - t := by linarith + have hd : 0 < 1 - h := by linarith + unfold slopeDensity + split_ifs + · have heq : (1 + t)⁻¹ - 1 = -(t / (1 + t)) := by + field_simp + ring + rw [heq, abs_neg, abs_of_nonneg (div_nonneg ht0 hp.le)] + exact div_le_div₀ hh0 hth hd (by linarith) + · have heq : (1 - t)⁻¹ - 1 = t / (1 - t) := by + field_simp + ring + rw [heq, abs_of_nonneg (div_nonneg ht0 hn.le)] + exact div_le_div₀ hh0 hth hd (by linarith) + +theorem slopeDensity_uniform_upper {t h : ℝ} (ht0 : 0 ≤ t) (hth : t ≤ h) + (hh1 : h < 1) (s : ℝ) : slopeDensity t s ≤ (1 - h)⁻¹ := by + apply (slopeDensity_upper ht0 (lt_of_le_of_lt hth hh1) s).trans + exact inv_anti₀ (by linarith) (by linarith) + +theorem measurable_slopeDensity : Measurable (fun p : ℝ × ℝ => slopeDensity p.1 p.2) := by + unfold slopeDensity midpoint + apply Measurable.ite + · exact measurableSet_le measurable_snd + ((measurable_const.add measurable_fst).div_const 2) + · exact (measurable_const.add measurable_fst).inv + · exact (measurable_const.sub measurable_fst).inv + +theorem slopeDensity_parameter_integrable {h : ℝ} (hh0 : 0 ≤ h) (hh1 : h < 1) + (s : ℝ) : IntervalIntegrable (fun t => slopeDensity t s) volume 0 h := by + rw [intervalIntegrable_iff] + apply IntegrableOn.of_bound (by rw [uIoc_of_le hh0]; exact measure_Ioc_lt_top) + ((measurable_slopeDensity.comp (measurable_id.prodMk measurable_const)).aestronglyMeasurable) + ((1 - h)⁻¹) + filter_upwards [ae_restrict_mem measurableSet_uIoc] with t ht + rw [uIoc_of_le hh0] at ht + change ‖slopeDensity t s‖ ≤ _ + rw [Real.norm_eq_abs, abs_of_pos (slopeDensity_pos ht.1.le (lt_of_le_of_lt ht.2 hh1) s)] + exact slopeDensity_uniform_upper ht.1.le ht.2 hh1 s + +theorem averagedDensity_nonneg {h : ℝ} (hh0 : 0 < h) (hh1 : h < 1) (s : ℝ) : + 0 ≤ averagedDensity h s := by + unfold averagedDensity + apply mul_nonneg (inv_nonneg.mpr hh0.le) + apply intervalIntegral.integral_nonneg hh0.le + intro t ht + exact (slopeDensity_pos ht.1 (lt_of_le_of_lt ht.2 hh1) s).le + +theorem averagedDensity_upper {h : ℝ} (hh0 : 0 < h) (hh1 : h < 1) (s : ℝ) : + averagedDensity h s ≤ (1 - h)⁻¹ := by + have hint := slopeDensity_parameter_integrable hh0.le hh1 s + have hb : (∫ t in (0 : ℝ)..h, slopeDensity t s) ≤ h * (1 - h)⁻¹ := by + calc + _ ≤ ∫ _t in (0 : ℝ)..h, (1 - h)⁻¹ := + intervalIntegral.integral_mono_on hh0.le hint intervalIntegrable_const + (fun t ht => slopeDensity_uniform_upper ht.1 ht.2 hh1 s) + _ = _ := by simp + unfold averagedDensity + calc + _ ≤ h⁻¹ * (h * (1 - h)⁻¹) := mul_le_mul_of_nonneg_left hb (inv_nonneg.mpr hh0.le) + _ = _ := by rw [← mul_assoc, inv_mul_cancel₀ hh0.ne', one_mul] + +theorem averagedDensity_deviation {h : ℝ} (hh0 : 0 < h) (hh1 : h < 1) (s : ℝ) : + |averagedDensity h s - 1| ≤ h / (1 - h) := by + have hint := slopeDensity_parameter_integrable hh0.le hh1 s + have heq : averagedDensity h s - 1 = + h⁻¹ * ∫ t in (0 : ℝ)..h, (slopeDensity t s - 1) := by + rw [intervalIntegral.integral_sub hint intervalIntegrable_const] + simp only [intervalIntegral.integral_const, sub_zero, smul_eq_mul, mul_one] + unfold averagedDensity + rw [mul_sub, inv_mul_cancel₀ hh0.ne'] + rw [heq, abs_mul, abs_of_pos (inv_pos.mpr hh0)] + have hb : |∫ t in (0 : ℝ)..h, (slopeDensity t s - 1)| ≤ + (h / (1 - h)) * h := by + have := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (0 : ℝ)) (b := h) (C := h / (1 - h)) + (f := fun t => slopeDensity t s - 1) (by + intro t ht + rw [uIoc_of_le hh0.le] at ht + simpa only [Real.norm_eq_abs] using slopeDensity_deviation ht.1.le ht.2 hh1 s) + simpa only [Real.norm_eq_abs, sub_zero, abs_of_pos hh0] using this + calc + _ ≤ h⁻¹ * ((h / (1 - h)) * h) := + mul_le_mul_of_nonneg_left hb (inv_nonneg.mpr hh0.le) + _ = _ := by field_simp + +theorem slopeDensity_rectangle_integrable {h : ℝ} (hh0 : 0 ≤ h) (hh1 : h < 1) : + IntegrableOn (Function.uncurry slopeDensity) + (uIoc (0 : ℝ) h ×ˢ uIoc (0 : ℝ) 1) := by + have hfinite : volume (uIoc (0 : ℝ) h ×ˢ uIoc (0 : ℝ) 1) < ⊤ := by + apply lt_of_le_of_lt (measure_mono (Set.prod_mono uIoc_subset_uIcc uIoc_subset_uIcc)) + exact (isCompact_uIcc.prod isCompact_uIcc).measure_lt_top + apply IntegrableOn.of_bound hfinite measurable_slopeDensity.aestronglyMeasurable ((1 - h)⁻¹) + filter_upwards [ae_restrict_mem (measurableSet_uIoc.prod measurableSet_uIoc)] with p hp + have ht := hp.1 + rw [uIoc_of_le hh0] at ht + change ‖slopeDensity p.1 p.2‖ ≤ _ + rw [Real.norm_eq_abs, abs_of_pos (slopeDensity_pos ht.1.le (lt_of_le_of_lt ht.2 hh1) p.2)] + exact slopeDensity_uniform_upper ht.1.le ht.2 hh1 p.2 + +theorem averagedDensity_intervalIntegrable {h : ℝ} (hh0 : 0 < h) (hh1 : h < 1) : + IntervalIntegrable (averagedDensity h) volume 0 1 := by + have hr := slopeDensity_rectangle_integrable hh0.le hh1 + rw [IntegrableOn, Measure.volume_eq_prod, ← Measure.prod_restrict] at hr + have hi := hr.integral_prod_right.const_mul h⁻¹ + rw [intervalIntegrable_iff] + change Integrable (fun s => h⁻¹ * ∫ t in (0 : ℝ)..h, slopeDensity t s) + (volume.restrict (uIoc (0 : ℝ) 1)) + simpa only [intervalIntegral.integral_of_le hh0.le, + uIoc_of_le hh0.le, Function.uncurry] using hi + +theorem integral_averagedDensity {h : ℝ} (hh0 : 0 < h) (hh1 : h < 1) : + (∫ s in (0 : ℝ)..1, averagedDensity h s) = 1 := by + have hr := slopeDensity_rectangle_integrable hh0.le hh1 + have hi : (∫ t in (0 : ℝ)..h, ∫ s in (0 : ℝ)..1, slopeDensity t s) = h := by + calc + _ = ∫ _t in (0 : ℝ)..h, (1 : ℝ) := by + apply intervalIntegral.integral_congr_Ioo_of_le hh0.le + intro t ht + exact integral_slopeDensity ht.1.le (lt_trans ht.2 hh1) + _ = _ := by simp + unfold averagedDensity + rw [intervalIntegral.integral_const_mul, + ← intervalIntegral_intervalIntegral_swap hr, hi, inv_mul_cancel₀ hh0.ne'] + +theorem unitMass_square_identity {f : ℝ → ℝ} {δ : ℝ} + (hf : IntervalIntegrable f volume 0 1) (hδ : 0 ≤ δ) + (hbound : ∀ s ∈ Icc (0 : ℝ) 1, |f s - 1| ≤ δ) + (hmass : (∫ s in (0 : ℝ)..1, f s) = 1) : + (∫ s in (0 : ℝ)..1, (f s) ^ 2) = + 1 + ∫ s in (0 : ℝ)..1, (f s - 1) ^ 2 := by + have hdev : IntervalIntegrable (fun s => (f s - 1) ^ 2) volume 0 1 := by + rw [intervalIntegrable_iff] + apply IntegrableOn.of_bound (by simp only [uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)]; exact measure_Ioc_lt_top) + ((hf.def'.aestronglyMeasurable.sub aestronglyMeasurable_const).pow 2) (δ ^ 2) + filter_upwards [ae_restrict_mem measurableSet_uIoc] with s hs + rw [uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)] at hs + have hb := hbound s ⟨hs.1.le, hs.2⟩ + rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] + change (f s - 1) ^ 2 ≤ δ ^ 2 + exact sq_le_sq.mpr (by simpa only [abs_of_nonneg hδ] using hb) + have hfun : (fun s => (f s) ^ 2) = + (fun s => (f s - 1) ^ 2 + 2 * f s - 1) := by + funext s + ring + rw [hfun, intervalIntegral.integral_sub (hdev.add (hf.const_mul 2)) intervalIntegrable_const, + intervalIntegral.integral_add hdev (hf.const_mul 2), intervalIntegral.integral_const_mul, hmass] + simp + ring + +theorem unitMass_square_le {f : ℝ → ℝ} {δ : ℝ} + (hf : IntervalIntegrable f volume 0 1) (hδ : 0 ≤ δ) + (hbound : ∀ s ∈ Icc (0 : ℝ) 1, |f s - 1| ≤ δ) + (hmass : (∫ s in (0 : ℝ)..1, f s) = 1) : + (∫ s in (0 : ℝ)..1, (f s) ^ 2) ≤ 1 + δ ^ 2 := by + rw [unitMass_square_identity hf hδ hbound hmass] + apply add_le_add le_rfl + have hint : IntervalIntegrable (fun s => (f s - 1) ^ 2) volume 0 1 := by + rw [intervalIntegrable_iff] + apply IntegrableOn.of_bound (by simp only [uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)]; exact measure_Ioc_lt_top) + ((hf.def'.aestronglyMeasurable.sub aestronglyMeasurable_const).pow 2) (δ ^ 2) + filter_upwards [ae_restrict_mem measurableSet_uIoc] with s hs + rw [uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)] at hs + have hb := hbound s ⟨hs.1.le, hs.2⟩ + rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] + change (f s - 1) ^ 2 ≤ δ ^ 2 + exact sq_le_sq.mpr (by simpa only [abs_of_nonneg hδ] using hb) + calc + _ ≤ ∫ _s in (0 : ℝ)..1, δ ^ 2 := + intervalIntegral.integral_mono_on (by norm_num) hint intervalIntegrable_const + (fun s hs => by + have hb := hbound s hs + exact sq_le_sq.mpr (by simpa only [abs_of_nonneg hδ] using hb)) + _ = _ := by simp + +theorem averagedDensity_second_moment {h : ℝ} (hh0 : 0 < h) (hh1 : h < 1) : + (∫ s in (0 : ℝ)..1, (averagedDensity h s) ^ 2) ≤ + 1 + h ^ 2 / (1 - h) ^ 2 := by + have hb := unitMass_square_le (averagedDensity_intervalIntegrable hh0 hh1) + (show 0 ≤ h / (1 - h) by positivity) + (fun s _ => averagedDensity_deviation hh0 hh1 s) + (integral_averagedDensity hh0 hh1) + simpa only [div_pow] using hb + +end Invariant233.ScalarEndpointDensity + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarEndpointKernelBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarEndpointKernelBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..86e580a8de0fde2cabaa047e36faf6e581343f9f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarEndpointKernelBounds.lean @@ -0,0 +1,282 @@ +import OAI.Analysis.IrrationalRotation.Analysis.EndpointKernelGeometry +import Mathlib.MeasureTheory.Function.Floor + +namespace OAI + +open MeasureTheory Set + +namespace Invariant233.ScalarSampling + +theorem measurable_rawKernel_pair (h α : ℝ) : + Measurable (fun p : ℝ × ℝ => rawKernel h α p.1 p.2) := by + have hd : Measurable (fun p : ℝ × ℝ => delta p.1) := + (continuous_fst.min (continuous_const.sub continuous_fst)).measurable + unfold rawKernel + simp only [Set.indicator_apply, mem_Ioo] + apply Measurable.ite (measurableSet_le measurable_const hd) + · apply Measurable.ite ((measurableSet_lt measurable_const measurable_snd).inter + (measurableSet_lt measurable_snd (measurable_const.mul hd))) + · exact (measurable_const.mul hd).inv + · exact measurable_const + · exact measurable_const + +theorem measurable_circleEndpoint_pair (h α : ℝ) : + Measurable (fun p : ℝ × ℝ => circleKernel h α (p.1 - p.2) p.2) := by + exact (measurable_rawKernel_pair h α).comp + (((measurable_fst.sub measurable_snd).fract).prodMk measurable_snd.fract) + +theorem rawKernel_height {h α s v : ℝ} (hh : 0 < h) (hα : 0 < α) : + 0 ≤ rawKernel h α s v ∧ rawKernel h α s v ≤ (h * α)⁻¹ := by + unfold rawKernel + split_ifs with hd + · by_cases hv : v ∈ Ioo 0 (h * delta s) + · rw [Set.indicator_of_mem hv] + have hp : 0 < h * delta s := mul_pos hh (hα.trans_le hd) + exact ⟨(inv_pos.mpr hp).le, inv_anti₀ (mul_pos hh hα) + (mul_le_mul_of_nonneg_left hd hh.le)⟩ + · rw [Set.indicator_of_notMem hv] + exact ⟨le_rfl, (inv_pos.mpr (mul_pos hh hα)).le⟩ + · exact ⟨le_rfl, (inv_pos.mpr (mul_pos hh hα)).le⟩ + +theorem circleEndpoint_intervalIntegrable {h α : ℝ} (hh : 0 < h) (hα : 0 < α) + (s : ℝ) : IntervalIntegrable (fun v => circleKernel h α (s - v) v) volume 0 1 := by + rw [intervalIntegrable_iff] + apply IntegrableOn.of_bound (by rw [uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)]; exact measure_Ioc_lt_top) + ((measurable_circleEndpoint_pair h α).comp + (measurable_const.prodMk measurable_id)).aestronglyMeasurable ((h * α)⁻¹) + apply Filter.Eventually.of_forall + intro v + change ‖circleKernel h α (s - v) v‖ ≤ _ + unfold circleKernel + rw [Real.norm_eq_abs, abs_of_nonneg (rawKernel_height hh hα).1] + exact (rawKernel_height hh hα).2 + +theorem delta_backward_bound {s v : ℝ} (hv : 0 ≤ v) : delta s ≤ delta (s - v) + v := by + have heq : delta (s - v) + v = min s (1 - s + 2 * v) := by + unfold delta + rw [← min_add_add_right] + congr 1 <;> ring + rw [heq] + exact min_le_min le_rfl (by linarith) + +theorem uncut_rawEndpoint_height {h s v : ℝ} (hh : 0 < h) + (hs0 : 0 < s) (hs1 : s < 1) (hv : 0 ≤ v) : + 0 ≤ rawKernel h 0 (s - v) v ∧ + rawKernel h 0 (s - v) v ≤ (1 + h) / (h * delta s) := by + have hdS : 0 < delta s := lt_min hs0 (by linarith) + have hC : 0 ≤ (1 + h) / (h * delta s) := by positivity + unfold rawKernel + split_ifs with hd + · by_cases hmem : v ∈ Ioo 0 (h * delta (s - v)) + · rw [Set.indicator_of_mem hmem] + have hdpos : 0 < delta (s - v) := by + have hp : 0 < h * delta (s - v) := lt_trans hmem.1 hmem.2 + exact (mul_pos_iff_of_pos_left hh).mp hp + refine ⟨(inv_pos.mpr (mul_pos hh hdpos)).le, ?_⟩ + have hcomp : delta s ≤ (1 + h) * delta (s - v) := by + have := delta_backward_bound (s := s) hv + linarith [hmem.2] + rw [inv_eq_one_div, div_le_div_iff₀ (mul_pos hh hdpos) (mul_pos hh hdS)] + nlinarith [mul_le_mul_of_nonneg_left hcomp hh.le] + · rw [Set.indicator_of_notMem hmem] + exact ⟨le_rfl, hC⟩ + · exact ⟨le_rfl, hC⟩ + +theorem uncut_rawEndpoint_intervalIntegrable {h s : ℝ} (hh : 0 < h) + (hs0 : 0 < s) (hs1 : s < 1) : + IntervalIntegrable (fun v => rawKernel h 0 (s - v) v) volume 0 1 := by + rw [intervalIntegrable_iff] + apply IntegrableOn.of_bound (by rw [uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)]; exact measure_Ioc_lt_top) + ((measurable_rawKernel_pair h 0).comp + ((measurable_const.sub measurable_id).prodMk measurable_id)).aestronglyMeasurable + ((1 + h) / (h * delta s)) + filter_upwards [ae_restrict_mem measurableSet_uIoc] with v hv + rw [uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)] at hv + change ‖rawKernel h 0 (s - v) v‖ ≤ _ + rw [Real.norm_eq_abs, abs_of_nonneg (uncut_rawEndpoint_height hh hs0 hs1 hv.1.le).1] + exact (uncut_rawEndpoint_height hh hs0 hs1 hv.1.le).2 + +theorem uncut_circleEndpoint_intervalIntegrable {h s : ℝ} (hh : 0 < h) (hh1 : h ≤ 1) + (hs0 : 0 < s) (hs1 : s < 1) : + IntervalIntegrable (fun v => circleKernel h 0 (s - v) v) volume 0 1 := by + apply (uncut_rawEndpoint_intervalIntegrable hh hs0 hs1).congr_uIoo + intro v hv + rw [uIoo_of_le (by norm_num : (0 : ℝ) ≤ 1)] at hv + exact (uncut_endpoint_no_wrap hh.le hh1 hs0 hs1 hv.1 hv.2).symm + +theorem circleEndpoint_average_le_density {h α s : ℝ} + (hh0 : 0 < h) (hh1 : h < 1) (hα : 0 < α) (hs0 : 0 < s) (hs1 : s < 1) : + 0 ≤ (∫ v in (0 : ℝ)..1, circleKernel h α (s - v) v) ∧ + (∫ v in (0 : ℝ)..1, circleKernel h α (s - v) v) ≤ + ScalarEndpointDensity.averagedDensity h s := by + constructor + · apply intervalIntegral.integral_nonneg (by norm_num) + intro v _ + exact (rawKernel_height hh0 hα).1 + · rw [← integral_uncut_circleEndpoint hh0 hh1 hs0 hs1] + apply intervalIntegral.integral_mono_on (by norm_num) + (circleEndpoint_intervalIntegrable hh0 hα s) + (uncut_circleEndpoint_intervalIntegrable hh0 hh1.le hs0 hs1) + intro v _ + exact rawKernel_le_uncut hh0.le + ⟨Int.fract_nonneg (s - v), (Int.fract_lt_one (s - v)).le⟩ + +theorem stronglyMeasurable_circleEndpoint_average (h α : ℝ) : + StronglyMeasurable (fun s => ∫ v in (0 : ℝ)..1, circleKernel h α (s - v) v) := by + have hm := (measurable_circleEndpoint_pair h α).stronglyMeasurable.integral_prod_right' + (ν := volume.restrict (Ioc (0 : ℝ) 1)) + simpa only [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] using hm + +theorem circleEndpoint_average_height {h α : ℝ} (hh : 0 < h) (hα : 0 < α) (s : ℝ) : + 0 ≤ (∫ v in (0 : ℝ)..1, circleKernel h α (s - v) v) ∧ + (∫ v in (0 : ℝ)..1, circleKernel h α (s - v) v) ≤ (h * α)⁻¹ := by + constructor + · apply intervalIntegral.integral_nonneg (by norm_num) + intro v _ + exact (rawKernel_height hh hα).1 + · calc + _ ≤ ∫ _v in (0 : ℝ)..1, (h * α)⁻¹ := + intervalIntegral.integral_mono_on (by norm_num) + (circleEndpoint_intervalIntegrable hh hα s) intervalIntegrable_const + (fun _ _ => (rawKernel_height hh hα).2) + _ = _ := by simp + +theorem intervalIntegrable_square_of_bound {f : ℝ → ℝ} {C : ℝ} + (hf : AEStronglyMeasurable f (volume.restrict (uIoc (0 : ℝ) 1))) + (hC : 0 ≤ C) (hb : ∀ s ∈ Ioo (0 : ℝ) 1, |f s| ≤ C) : + IntervalIntegrable (fun s => (f s) ^ 2) volume 0 1 := by + rw [intervalIntegrable_iff] + apply IntegrableOn.of_bound (by rw [uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)]; exact measure_Ioc_lt_top) + (hf.pow 2) (C ^ 2) + have hne : ∀ᵐ s ∂(volume : Measure ℝ), s ≠ 1 := by + rw [ae_iff] + simp + filter_upwards [ae_restrict_mem measurableSet_uIoc, ae_restrict_of_ae hne] with s hs hne + rw [uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)] at hs + have hbound := hb s ⟨hs.1, lt_of_le_of_ne hs.2 hne⟩ + change ‖(f s) ^ 2‖ ≤ C ^ 2 + rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] + exact sq_le_sq.mpr (by simpa only [abs_of_nonneg hC] using hbound) + +theorem circleEndpoint_averaged_secondMoment {h α : ℝ} + (hh0 : 0 < h) (hh1 : h < 1) (hα : 0 < α) : + (∫ s in (0 : ℝ)..1, (∫ v in (0 : ℝ)..1, circleKernel h α (s - v) v)^2) ≤ + 1 + h^2 / (1 - h)^2 := by + have hcut : IntervalIntegrable + (fun s => (∫ v in (0 : ℝ)..1, circleKernel h α (s - v) v)^2) volume 0 1 := by + apply intervalIntegrable_square_of_bound + (stronglyMeasurable_circleEndpoint_average h α).aestronglyMeasurable + (show 0 ≤ (h * α)⁻¹ by positivity) + intro s _ + rw [abs_of_nonneg (circleEndpoint_average_height hh0 hα s).1] + exact (circleEndpoint_average_height hh0 hα s).2 + have huncut : IntervalIntegrable + (fun s => (ScalarEndpointDensity.averagedDensity h s)^2) volume 0 1 := by + apply intervalIntegrable_square_of_bound + (ScalarEndpointDensity.averagedDensity_intervalIntegrable hh0 hh1).def'.aestronglyMeasurable + (show 0 ≤ (1 - h)⁻¹ by positivity) + intro s _ + rw [abs_of_nonneg (ScalarEndpointDensity.averagedDensity_nonneg hh0 hh1 s)] + exact ScalarEndpointDensity.averagedDensity_upper hh0 hh1 s + calc + _ ≤ ∫ s in (0 : ℝ)..1, (ScalarEndpointDensity.averagedDensity h s)^2 := by + apply intervalIntegral.integral_mono_on_of_le_Ioo (by norm_num) hcut huncut + intro s hs + have hp := circleEndpoint_average_le_density hh0 hh1 hα hs.1 hs.2 + exact (sq_le_sq₀ hp.1 (ScalarEndpointDensity.averagedDensity_nonneg hh0 hh1 s)).mpr hp.2 + _ ≤ _ := ScalarEndpointDensity.averagedDensity_second_moment hh0 hh1 + +theorem manuscriptEndpointKernel_averaged_secondMoment {m : ℕ} (hm : 200 ≤ m) : + (∫ s in (0 : ℝ)..1, (∫ v in (0 : ℝ)..1, manuscriptEndpointKernel m s v)^2) ≤ + 1 + ((m : ℝ)^(-(3 / 5 : ℝ)))^2 / (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 := by + obtain ⟨hh, _, hα, _⟩ := manuscript_parameters hm + have hm1 : (1 : ℝ) < m := by exact_mod_cast (by omega : 1 < m) + have hh1 : (m : ℝ)^(-(3 / 5 : ℝ)) < 1 := + Real.rpow_lt_one_of_one_lt_of_neg hm1 (by norm_num) + exact circleEndpoint_averaged_secondMoment hh hh1 hα + +theorem circleEndpoint_periodize (h α s v : ℝ) : + circleKernel h α (Int.fract s - v) v = circleKernel h α (s - v) v := by + unfold circleKernel + congr 1 + calc + Int.fract (Int.fract s - v) = Int.fract ((s - v) - (⌊s⌋ : ℝ)) := by + congr 1 + unfold Int.fract + ring + _ = _ := Int.fract_sub_intCast _ _ + +theorem circleEndpoint_at_zero {h α v : ℝ} (_hh0 : 0 ≤ h) (hh1 : h ≤ 1) + (hv0 : 0 < v) (hv1 : v < 1) : circleKernel h α (0 - v) v = 0 := by + have hfract : Int.fract (-v) = 1 - v := by + rw [Int.fract_neg (by rw [Int.fract_eq_self.mpr ⟨hv0.le, hv1⟩]; exact hv0.ne'), + Int.fract_eq_self.mpr ⟨hv0.le, hv1⟩] + unfold circleKernel + rw [zero_sub, hfract, Int.fract_eq_self.mpr ⟨hv0.le, hv1⟩] + unfold rawKernel + split_ifs + · apply Set.indicator_of_notMem + intro hv + have hd0 : 0 ≤ delta (1 - v) := delta_nonneg ⟨by linarith, by linarith⟩ + have hd : delta (1 - v) ≤ v := by + unfold delta + exact (min_le_right _ _).trans (by linarith) + have hm : h * delta (1 - v) ≤ delta (1 - v) := + (mul_le_mul_of_nonneg_right hh1 hd0).trans_eq (one_mul _) + linarith [hv.2] + · rfl + +theorem integral_circleEndpoint_at_zero {h α : ℝ} (hh0 : 0 ≤ h) (hh1 : h ≤ 1) : + (∫ v in (0 : ℝ)..1, circleKernel h α (0 - v) v) = 0 := by + calc + _ = ∫ _v in (0 : ℝ)..1, (0 : ℝ) := by + apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num) + intro v hv + exact circleEndpoint_at_zero hh0 hh1 hv.1 hv.2 + _ = _ := by simp + +theorem circleEndpoint_average_uniform_bound {h α : ℝ} + (hh0 : 0 < h) (hh1 : h < 1) (hα : 0 < α) (s : ℝ) : + 0 ≤ (∫ v in (0 : ℝ)..1, circleKernel h α (s - v) v) ∧ + (∫ v in (0 : ℝ)..1, circleKernel h α (s - v) v) ≤ (1 - h)⁻¹ := by + refine ⟨(circleEndpoint_average_height hh0 hα s).1, ?_⟩ + have heq : (∫ v in (0 : ℝ)..1, circleKernel h α (s - v) v) = + ∫ v in (0 : ℝ)..1, circleKernel h α (Int.fract s - v) v := by + apply intervalIntegral.integral_congr + intro v _ + exact (circleEndpoint_periodize h α s v).symm + rw [heq] + by_cases hs : Int.fract s = 0 + · rw [hs, integral_circleEndpoint_at_zero hh0.le hh1.le] + positivity + · have hs0 : 0 < Int.fract s := lt_of_le_of_ne (Int.fract_nonneg s) (Ne.symm hs) + exact (circleEndpoint_average_le_density hh0 hh1 hα hs0 (Int.fract_lt_one s)).2.trans + (ScalarEndpointDensity.averagedDensity_upper hh0 hh1 _) + +theorem manuscript_width_le_half {m : ℕ} (hm : 200 ≤ m) : + (m : ℝ) ^ (-(3 / 5 : ℝ)) ≤ 1 / 2 := by + have hm4 : (4 : ℝ) ≤ m := by exact_mod_cast (by omega : 4 ≤ m) + calc + _ ≤ (m : ℝ) ^ (-(1 / 2 : ℝ)) := + Real.rpow_le_rpow_of_exponent_le (by linarith) (by norm_num) + _ ≤ (4 : ℝ) ^ (-(1 / 2 : ℝ)) := + Real.rpow_le_rpow_of_nonpos (by norm_num) hm4 (by norm_num) + _ = _ := by + rw [Real.rpow_neg (by norm_num : (0 : ℝ) ≤ 4), ← Real.sqrt_eq_rpow] + norm_num + +theorem manuscriptEndpointKernel_averaged_bounds {m : ℕ} (hm : 200 ≤ m) (s : ℝ) : + 0 ≤ (∫ v in (0 : ℝ)..1, manuscriptEndpointKernel m s v) ∧ + (∫ v in (0 : ℝ)..1, manuscriptEndpointKernel m s v) ≤ 2 := by + obtain ⟨hh, _, hα, _⟩ := manuscript_parameters hm + have hhalf := manuscript_width_le_half hm + have hh1 : (m : ℝ)^(-(3 / 5 : ℝ)) < 1 := by linarith + have hb := circleEndpoint_average_uniform_bound hh hh1 hα s + refine ⟨hb.1, hb.2.trans ?_⟩ + calc + _ ≤ ((1 / 2 : ℝ))⁻¹ := inv_anti₀ (by norm_num) (by linarith) + _ = 2 := by norm_num + +end Invariant233.ScalarSampling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarFieldLift.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarFieldLift.lean new file mode 100644 index 0000000000000000000000000000000000000000..fde6d21e5772b60b57a142c36826f0891a5cd161 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarFieldLift.lean @@ -0,0 +1,37 @@ +import Mathlib.MeasureTheory.Function.L2Space + +namespace OAI + +namespace Invariant233.DirectIntegral + +open MeasureTheory Filter +open scoped ENNReal + +variable {X E : Type*} [MeasurableSpace X] {μ : Measure X} + [NormedAddCommGroup E] [NormedSpace ℂ E] + +theorem eq_smul_id_of_representation_ae_scalar + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : X → E →L[ℂ] E) + (hrep : ∀ f : Lp E 2 μ, T f =ᵐ[μ] fun x => A x (f x)) + (c : ℂ) (hc : ∀ᵐ x ∂μ, A x = c • (1 : E →L[ℂ] E)) : + T = c • (1 : Lp E 2 μ →L[ℂ] Lp E 2 μ) := by + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + filter_upwards [hrep f, hc, Lp.coeFn_smul c f] with x hfx hcx hsmul + change (T f) x = (c • f) x + rw [hfx, hcx] + change c • f x = (c • f) x + exact hsmul.symm + +theorem scalar_of_representation_ae_scalar + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : X → E →L[ℂ] E) + (hrep : ∀ f : Lp E 2 μ, T f =ᵐ[μ] fun x => A x (f x)) + (hc : ∃ c : ℂ, ∀ᵐ x ∂μ, A x = c • (1 : E →L[ℂ] E)) : + ∃ c : ℂ, T = c • (1 : Lp E 2 μ →L[ℂ] Lp E 2 μ) := by + obtain ⟨c, hc⟩ := hc + exact ⟨c, eq_smul_id_of_representation_ae_scalar T A hrep c hc⟩ + +end Invariant233.DirectIntegral + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarKernelEstimates.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarKernelEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..018b9a4ec24baf283bf38f3a415eb3863225b97a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarKernelEstimates.lean @@ -0,0 +1,96 @@ +import OAI.Analysis.IrrationalRotation.Model.ScalarKernelEstimates +import OAI.Analysis.IrrationalRotation.Analysis.ScalarEndpointKernelBounds +import OAI.Analysis.IrrationalRotation.Sampling.ScalarSamplingJensen +import OAI.Analysis.IrrationalRotation.Sampling.ScalarSamplingEndpointVariation + +namespace OAI + +open MeasureTheory Set + +namespace Invariant233.ScalarSampling + +theorem unitInterval_mass_sq_le {f : ℝ → ℝ} + (hf : IntervalIntegrable f volume 0 1) + (hfsq : IntervalIntegrable (fun s => (f s)^2) volume 0 1) : + (∫ s in (0 : ℝ)..1, f s)^2 ≤ ∫ s in (0 : ℝ)..1, (f s)^2 := by + let c : ℝ := ∫ s in (0 : ℝ)..1, f s + have heq : (fun s => (f s - c)^2) = + (fun s => (f s)^2 - (2 * c) * f s + c^2) := by + funext s + ring + have hnonneg : 0 ≤ ∫ s in (0 : ℝ)..1, (f s - c)^2 := + intervalIntegral.integral_nonneg (by norm_num) (fun _ _ => sq_nonneg _) + rw [heq, intervalIntegral.integral_add (hfsq.sub (hf.const_mul (2 * c))) + intervalIntegrable_const, intervalIntegral.integral_sub hfsq (hf.const_mul (2 * c)), + intervalIntegral.integral_const_mul] at hnonneg + simp only [intervalIntegral.integral_const, sub_zero, one_smul] at hnonneg + change c^2 ≤ _ + change 0 ≤ (∫ s in (0 : ℝ)..1, (f s)^2) - 2 * c * c + c^2 at hnonneg + nlinarith + +theorem manuscriptKernel_averaged_bounds {m : ℕ} (hm : 200 ≤ m) (s : ℝ) : + 0 ≤ (∫ v in (0 : ℝ)..1, manuscriptKernel m s v) ∧ + (∫ v in (0 : ℝ)..1, manuscriptKernel m s v) ≤ 2 := by + obtain ⟨hh, hhone, hα, _⟩ := manuscript_parameters hm + have hb := averaged_circleKernel_bounds hh hhone hα s + exact ⟨hb.1, hb.2.trans (by norm_num)⟩ + +theorem manuscriptKernel_averaged_secondMoment_exact {m : ℕ} (hm : 200 ≤ m) : + (∫ s in (0 : ℝ)..1, (∫ v in (0 : ℝ)..1, manuscriptKernel m s v)^2) = + 1 - 2 / (m : ℝ)^2 := by + obtain ⟨hh, hhone, hα, hαhalf⟩ := manuscript_parameters hm + simpa only [manuscriptKernel, mul_one_div] using + integral_sq_averaged_circleKernel hh hhone hα hαhalf + +theorem manuscriptKernel_averaged_secondMoment_bounds {m : ℕ} (hm : 200 ≤ m) : + (1 - 2 / (m : ℝ)^2)^2 ≤ + (∫ s in (0 : ℝ)..1, (∫ v in (0 : ℝ)..1, manuscriptKernel m s v)^2) ∧ + (∫ s in (0 : ℝ)..1, (∫ v in (0 : ℝ)..1, manuscriptKernel m s v)^2) ≤ + 1 + ((m : ℝ)^(-(3 / 5 : ℝ)))^2 / (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 := by + rw [manuscriptKernel_averaged_secondMoment_exact hm] + have hα := (manuscript_parameters hm).2.2 + have hq0 : 0 ≤ 2 / (m : ℝ)^2 := by positivity + have hq1 : 2 / (m : ℝ)^2 ≤ 1 := by + have := hα.2 + rw [div_eq_mul_inv] at this ⊢ + nlinarith + constructor + · nlinarith + · have : 0 ≤ ((m : ℝ)^(-(3 / 5 : ℝ)))^2 / + (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 := by positivity + linarith + +theorem manuscriptKernel_estimates {m : ℕ} (hm : 200 ≤ m) : + KernelEstimates m (manuscriptKernel m) where + boundedVariation s := (manuscriptKernel_BV_bound hm s).1 + variation_sharp s := (manuscriptKernel_BV_bound hm s).2.trans + (mul_le_mul_of_nonneg_right (by norm_num) (by positivity)) + variation_coarse s := (manuscriptKernel_BV_bound_ten hm s).trans + (mul_le_mul_of_nonneg_right (by norm_num) (by positivity)) + average_bounds := manuscriptKernel_averaged_bounds hm + mass := manuscriptKernel_mass hm + average_square_lower := (manuscriptKernel_averaged_secondMoment_bounds hm).1 + average_square_upper := (manuscriptKernel_averaged_secondMoment_bounds hm).2 + square_mass := manuscriptKernel_secondMoment hm + +theorem manuscriptEndpointKernel_estimates {m : ℕ} (hm : 200 ≤ m) : + KernelEstimates m (manuscriptEndpointKernel m) where + boundedVariation s := (manuscriptEndpointKernel_BV_bound hm s).1 + variation_sharp s := (manuscriptEndpointKernel_BV_bound hm s).2 + variation_coarse := manuscriptEndpointKernel_BV_bound_ten hm + average_bounds := manuscriptEndpointKernel_averaged_bounds hm + mass := manuscriptEndpointKernel_mass hm + average_square_lower := manuscriptEndpointKernel_averaged_secondMoment_lower_from_mass hm + average_square_upper := manuscriptEndpointKernel_averaged_secondMoment hm + square_mass := manuscriptEndpointKernel_secondMoment hm + +theorem both_kernel_estimates {m : ℕ} (hm : 200 ≤ m) {u : ℝ → ℝ → ℝ} + (hu : u = manuscriptKernel m ∨ u = manuscriptEndpointKernel m) : + KernelEstimates m u := by + rcases hu with rfl | rfl + · exact manuscriptKernel_estimates hm + · exact manuscriptEndpointKernel_estimates hm + +end Invariant233.ScalarSampling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarKernelMomentNumerics.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarKernelMomentNumerics.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d98b534d5296f1da52745d69e482c1dbd2f69b1 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarKernelMomentNumerics.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.IrrationalRotation.Sampling.ScalarSamplingEstimates + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.ScalarSampling + +theorem kernel_average_square_remainder_le {m : ℕ} (hm : 200 ≤ m) : + ((m : ℝ)^(-(3 / 5 : ℝ)))^2 / (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 ≤ + 4 * (m : ℝ)^(-(6 / 5 : ℝ)) := by + have hm0 : (0 : ℝ) < m := by exact_mod_cast (by omega : 0 < m) + have hhalf := manuscript_width_le_half hm + have hwidth : 0 < (m : ℝ)^(-(3 / 5 : ℝ)) := Real.rpow_pos_of_pos hm0 _ + have hden : (1 / 4 : ℝ) ≤ (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 := by nlinarith + have hsquare : ((m : ℝ)^(-(3 / 5 : ℝ)))^2 = (m : ℝ)^(-(6 / 5 : ℝ)) := by + rw [← Real.rpow_two, ← Real.rpow_mul hm0.le] + congr 1 + norm_num + calc + _ ≤ ((m : ℝ)^(-(3 / 5 : ℝ)))^2 / (1 / 4) := + div_le_div_of_nonneg_left (sq_nonneg _) (by norm_num) hden + _ = _ := by rw [hsquare]; ring + +theorem twice_kernel_square_mass_le {m : ℕ} (hm : 200 ≤ m) : + 2 * ((2 / (m : ℝ)^(-(3 / 5 : ℝ))) * Real.log ((m : ℝ)^2 / 2)) ≤ + 8 * (m : ℝ)^(3 / 5 : ℝ) * Real.log (m : ℝ) := by + have hm0 : (0 : ℝ) < m := by exact_mod_cast (by omega : 0 < m) + have hlog : Real.log ((m : ℝ)^2 / 2) ≤ 2 * Real.log (m : ℝ) := by + calc + _ ≤ Real.log ((m : ℝ)^2) := Real.log_le_log (by positivity) (by nlinarith [sq_nonneg (m : ℝ)]) + _ = _ := by rw [Real.log_pow]; norm_num + rw [Real.rpow_neg hm0.le, div_inv_eq_mul] + nlinarith [mul_le_mul_of_nonneg_left hlog (Real.rpow_pos_of_pos hm0 (3 / 5 : ℝ)).le] + +theorem KernelEstimates.average_square_source_bound {m : ℕ} (hm : 200 ≤ m) + {u : ℝ → ℝ → ℝ} (hu : KernelEstimates m u) : + (∫ s in (0 : ℝ)..1, (∫ v in (0 : ℝ)..1, u s v)^2) ≤ + 1 + 4 * (m : ℝ)^(-(6 / 5 : ℝ)) := + hu.average_square_upper.trans (add_le_add le_rfl (kernel_average_square_remainder_le hm)) + +theorem KernelEstimates.twice_square_mass_source_bound {m : ℕ} (hm : 200 ≤ m) + {u : ℝ → ℝ → ℝ} (hu : KernelEstimates m u) : + 2 * (∫ s in (0 : ℝ)..1, ∫ v in (0 : ℝ)..1, u s v^2) ≤ + 8 * (m : ℝ)^(3 / 5 : ℝ) * Real.log (m : ℝ) := by + rw [hu.square_mass] + exact twice_kernel_square_mass_le hm + +end Invariant233.ScalarSampling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarKernelMomentRates.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarKernelMomentRates.lean new file mode 100644 index 0000000000000000000000000000000000000000..14eb9c9913359fca7294dcf6bdeb204088e109ad --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarKernelMomentRates.lean @@ -0,0 +1,73 @@ +import OAI.Analysis.IrrationalRotation.Sampling.ScalarSamplingEstimates + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.ScalarSampling + +theorem KernelEstimates.average_square_rate {m : ℕ} (hm : 200 ≤ m) + {u : ℝ → ℝ → ℝ} (hu : KernelEstimates m u) : + (∫ s in (0 : ℝ)..1, (∫ v in (0 : ℝ)..1, u s v)^2) ≤ + 1 + 4 * (m : ℝ)^(-(6 / 5 : ℝ)) := by + have hh := manuscript_width_le_half hm + have hnonneg : 0 ≤ (m : ℝ)^(-(3 / 5 : ℝ)) := Real.rpow_nonneg (Nat.cast_nonneg m) _ + have hden : (1 / 4 : ℝ) ≤ (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 := by nlinarith + have hdenpos : 0 < (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 := lt_of_lt_of_le (by norm_num) hden + have hrate : ((m : ℝ)^(-(3 / 5 : ℝ)))^2 / + (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 ≤ + 4 * ((m : ℝ)^(-(3 / 5 : ℝ)))^2 := by + apply (div_le_iff₀ hdenpos).2 + nlinarith [mul_nonneg (sq_nonneg ((m : ℝ)^(-(3 / 5 : ℝ)))) + (sub_nonneg.mpr hden)] + have hpow : ((m : ℝ)^(-(3 / 5 : ℝ)))^2 = (m : ℝ)^(-(6 / 5 : ℝ)) := by + rw [← Real.rpow_mul_natCast (Nat.cast_nonneg m)] + congr 1 + norm_num + calc + _ ≤ 1 + ((m : ℝ)^(-(3 / 5 : ℝ)))^2 / + (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 := hu.average_square_upper + _ ≤ 1 + 4 * ((m : ℝ)^(-(3 / 5 : ℝ)))^2 := by linarith [hrate] + _ = _ := by rw [hpow] + +theorem KernelEstimates.twice_square_mass_rate {m : ℕ} (hm : 200 ≤ m) + {u : ℝ → ℝ → ℝ} (hu : KernelEstimates m u) : + 2 * (∫ s in (0 : ℝ)..1, ∫ v in (0 : ℝ)..1, u s v^2) ≤ + 8 * (m : ℝ)^(3 / 5 : ℝ) * Real.log m := by + have hmpos : (0 : ℝ) < m := by exact_mod_cast (by omega : 0 < m) + have hlog : Real.log ((m : ℝ)^2 / 2) ≤ 2 * Real.log m := by + calc + _ ≤ Real.log ((m : ℝ)^2) := + Real.log_le_log (by positivity) (by nlinarith [sq_nonneg (m : ℝ)]) + _ = _ := by rw [Real.log_pow]; norm_num + calc + _ = 4 * (m : ℝ)^(3 / 5 : ℝ) * Real.log ((m : ℝ)^2 / 2) := by + rw [hu.square_mass, Real.rpow_neg hmpos.le] + simp only [div_inv_eq_mul] + ring + _ ≤ (4 * (m : ℝ)^(3 / 5 : ℝ)) * (2 * Real.log m) := + mul_le_mul_of_nonneg_left hlog (by positivity) + _ = _ := by ring + +theorem manuscript_average_square_rates {m : ℕ} (hm : 200 ≤ m) : + (∫ s in (0 : ℝ)..1, (∫ v in (0 : ℝ)..1, manuscriptKernel m s v)^2) ≤ + 1 + 4 * (m : ℝ)^(-(6 / 5 : ℝ)) ∧ + (∫ s in (0 : ℝ)..1, (∫ v in (0 : ℝ)..1, manuscriptEndpointKernel m s v)^2) ≤ + 1 + 4 * (m : ℝ)^(-(6 / 5 : ℝ)) := + ⟨(all_kernel_estimates m hm).1.average_square_rate hm, + (all_kernel_estimates m hm).2.average_square_rate hm⟩ + +theorem manuscript_twice_square_mass_rates {m : ℕ} (hm : 200 ≤ m) : + 2 * (∫ s in (0 : ℝ)..1, ∫ v in (0 : ℝ)..1, manuscriptKernel m s v^2) ≤ + 8 * (m : ℝ)^(3 / 5 : ℝ) * Real.log m ∧ + 2 * (∫ s in (0 : ℝ)..1, ∫ v in (0 : ℝ)..1, manuscriptEndpointKernel m s v^2) ≤ + 8 * (m : ℝ)^(3 / 5 : ℝ) * Real.log m := + ⟨(all_kernel_estimates m hm).1.twice_square_mass_rate hm, + (all_kernel_estimates m hm).2.twice_square_mass_rate hm⟩ + +end Invariant233.ScalarSampling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarMultiplier.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarMultiplier.lean new file mode 100644 index 0000000000000000000000000000000000000000..0a11154db010c621ab9586bacf8ae44f4a9c21a8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarMultiplier.lean @@ -0,0 +1,210 @@ +import OAI.Analysis.IrrationalRotation.Model.ScalarMultiplier +import OAI.Analysis.IrrationalRotation.Analysis.FieldsNorm +import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp +import Mathlib.MeasureTheory.Function.L2Space + +namespace OAI + +open MeasureTheory Filter Set +open scoped ENNReal + +namespace Invariant233.L2Multiplication + +variable {X E : Type*} [MeasurableSpace X] {μ : Measure X} + [NormedAddCommGroup E] [NormedSpace ℂ E] + +theorem multiplier_coe (g : Lp ℂ ∞ μ) (f : Lp E 2 μ) : + multiplier g f =ᵐ[μ] fun x => g x • f x := by + exact (ContinuousLinearMap.lsmul ℂ ℂ : ℂ →L[ℂ] E →L[ℂ] E).coeFn_holder g f + +theorem norm_multiplier_le (g : Lp ℂ ∞ μ) : + ‖(multiplier g : Lp E 2 μ →L[ℂ] Lp E 2 μ)‖ ≤ ‖g‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg g) + intro f + apply (ContinuousLinearMap.lsmul ℂ ℂ : ℂ →L[ℂ] E →L[ℂ] E).norm_holder_apply_apply_le g f + |>.trans + have h : ‖(ContinuousLinearMap.lsmul ℂ ℂ : ℂ →L[ℂ] E →L[ℂ] E)‖ ≤ 1 := + ContinuousLinearMap.opNorm_lsmul_le + calc + ‖(ContinuousLinearMap.lsmul ℂ ℂ : ℂ →L[ℂ] E →L[ℂ] E)‖ * ‖g‖ * ‖f‖ + ≤ 1 * ‖g‖ * ‖f‖ := by gcongr + _ = ‖g‖ * ‖f‖ := by ring + +variable [IsFiniteMeasure μ] + +theorem multiplier_indicator_coe (s : Set X) (hs : MeasurableSet s) + (f : Lp E 2 μ) : + multiplier (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ)) f =ᵐ[μ] + s.indicator f := by + filter_upwards [multiplier_coe (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ)) f, + indicatorConstLp_coeFn (p := ∞) (μ := μ) (hs := hs) + (hμs := measure_ne_top μ s) (c := (1 : ℂ))] with x hx hi + rw [hx, hi] + by_cases hxs : x ∈ s <;> simp [Set.indicator, hxs] + +theorem multiplier_const (c : ℂ) : + (multiplier (Lp.const ∞ μ c) : Lp E 2 μ →L[ℂ] Lp E 2 μ) = + c • (1 : Lp E 2 μ →L[ℂ] Lp E 2 μ) := by + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + filter_upwards [multiplier_coe (Lp.const ∞ μ c) f, + Lp.coeFn_const ∞ μ c, Lp.coeFn_smul c f] with x hx hc hs + simpa only [smul_apply, one_apply_eq_self] using + hx.trans (by rw [hc]; exact hs.symm) + +theorem multiplier_indicator_const (s : Set X) (hs : MeasurableSet s) (c : E) : + multiplier (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ)) (Lp.const 2 μ c) = + indicatorConstLp 2 hs (measure_ne_top μ s) c := by + apply Lp.ext + filter_upwards [multiplier_indicator_coe s hs (Lp.const 2 μ c), + Lp.coeFn_const 2 μ c, + indicatorConstLp_coeFn (p := 2) (μ := μ) (hs := hs) + (hμs := measure_ne_top μ s) (c := c)] with x hx hc hi + rw [hx, hi] + by_cases hxs : x ∈ s + · simpa only [Set.indicator_of_mem hxs, Function.const_apply] using hc + · simp only [Set.indicator_of_notMem hxs] + +omit [IsFiniteMeasure μ] in + +theorem norm_sq_eq_integral (f : Lp ℂ 2 μ) : + ‖f‖ ^ 2 = ∫ x, ‖f x‖ ^ 2 ∂μ := by + rw [norm_sq_eq_re_inner (𝕜 := ℝ), L2.inner_def] + simp only [RCLike.re_to_real, real_inner_self_eq_norm_sq] + +theorem norm_indicator_one_sq (s : Set X) (hs : MeasurableSet s) : + ‖indicatorConstLp 2 hs (measure_ne_top μ s) (1 : ℂ)‖ ^ 2 = μ.real s := by + rw [norm_sq_eq_integral] + calc + (∫ x, ‖indicatorConstLp 2 hs (measure_ne_top μ s) (1 : ℂ) x‖ ^ 2 ∂μ) = + ∫ x, s.indicator (fun _ => (1 : ℝ)) x ∂μ := by + apply integral_congr_ae + filter_upwards [indicatorConstLp_coeFn (p := 2) (μ := μ) (hs := hs) + (hμs := measure_ne_top μ s) (c := (1 : ℂ))] with x hx + rw [hx] + by_cases hxs : x ∈ s <;> simp [Set.indicator, hxs] + _ = μ.real s := by rw [integral_indicator hs]; simp + +theorem norm_multiplier_indicator_sq (s : Set X) (hs : MeasurableSet s) + (f : Lp ℂ 2 μ) : + ‖multiplier (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ)) f‖ ^ 2 = + ∫ x in s, ‖f x‖ ^ 2 ∂μ := by + rw [norm_sq_eq_integral, ← integral_indicator hs] + apply integral_congr_ae + filter_upwards [multiplier_indicator_coe s hs f] with x hx + rw [hx] + by_cases hxs : x ∈ s <;> simp [Set.indicator, hxs] + +theorem ae_norm_apply_const_one_le + (B : Lp ℂ 2 μ →L[ℂ] Lp ℂ 2 μ) + (hB : ∀ g : Lp ℂ ∞ μ, Commute B (multiplier g)) : + ∀ᵐ x ∂μ, ‖B (Lp.const 2 μ (1 : ℂ)) x‖ ≤ ‖B‖ := by + apply Fields.ae_norm_le_of_local_square_integral (norm_nonneg B) + ((memLp_two_iff_integrable_sq_norm (Lp.aestronglyMeasurable _)).mp (Lp.memLp _)) + intro s hs + have hcomm := congrArg (fun A : Lp ℂ 2 μ →L[ℂ] Lp ℂ 2 μ => + A (Lp.const 2 μ (1 : ℂ))) + (hB (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ))).eq + have hid : B (indicatorConstLp 2 hs (measure_ne_top μ s) (1 : ℂ)) = + multiplier (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ)) + (B (Lp.const 2 μ (1 : ℂ))) := by + simpa only [mul_apply_eq_comp, multiplier_indicator_const] using hcomm + rw [← norm_multiplier_indicator_sq s hs, ← hid] + calc + ‖B (indicatorConstLp 2 hs (measure_ne_top μ s) (1 : ℂ))‖ ^ 2 ≤ + (‖B‖ * ‖indicatorConstLp 2 hs (measure_ne_top μ s) (1 : ℂ)‖) ^ 2 := by + gcongr + exact B.le_opNorm _ + _ = ‖B‖ ^ 2 * μ.real s := by rw [mul_pow, norm_indicator_one_sq] + +theorem apply_const_eq_smul (B : Lp ℂ 2 μ →L[ℂ] Lp ℂ 2 μ) (c : ℂ) : + B (Lp.const 2 μ c) = c • B (Lp.const 2 μ (1 : ℂ)) := by + have hc : Lp.const 2 μ c = c • Lp.const 2 μ (1 : ℂ) := by + simpa only [smul_eq_mul, mul_one, Lp.constₗ_apply] using + (Lp.constₗ 2 μ ℂ).map_smul c (1 : ℂ) + rw [hc, map_smul] + +theorem exists_multiplier_of_commutes + (B : Lp ℂ 2 μ →L[ℂ] Lp ℂ 2 μ) + (hB : ∀ g : Lp ℂ ∞ μ, Commute B (multiplier g)) : + ∃ g : Lp ℂ ∞ μ, ‖g‖ ≤ ‖B‖ ∧ B = multiplier g := by + let b : Lp ℂ 2 μ := B (Lp.const 2 μ (1 : ℂ)) + have hb : ∀ᵐ x ∂μ, ‖b x‖ ≤ ‖B‖ := ae_norm_apply_const_one_le B hB + have hbtop : MemLp (fun x => b x) ∞ μ := + memLp_top_of_bound (Lp.aestronglyMeasurable b) ‖B‖ hb + let g : Lp ℂ ∞ μ := hbtop.toLp (fun x => b x) + have hg : g =ᵐ[μ] b := hbtop.coeFn_toLp + refine ⟨g, ?_, ?_⟩ + · have hgbound : ∀ᵐ x ∂μ, ‖g x‖ ≤ ‖B‖ := by + filter_upwards [hg, hb] with x hx hbound + rw [hx] + exact hbound + simpa using Lp.norm_le_of_ae_bound (norm_nonneg B) hgbound + · have hind : ∀ (c : ℂ) (s : Set X) (hs : MeasurableSet s), + B (indicatorConstLp 2 hs (measure_ne_top μ s) c) = + multiplier g (indicatorConstLp 2 hs (measure_ne_top μ s) c) := by + intro c s hs + have hcomm := congrArg (fun A : Lp ℂ 2 μ →L[ℂ] Lp ℂ 2 μ => + A (Lp.const 2 μ c)) + (hB (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ))).eq + have hid : B (indicatorConstLp 2 hs (measure_ne_top μ s) c) = + multiplier (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ)) (c • b) := by + calc + B (indicatorConstLp 2 hs (measure_ne_top μ s) c) = + multiplier (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ)) + (B (Lp.const 2 μ c)) := by + simpa only [mul_apply_eq_comp, multiplier_indicator_const] using hcomm + _ = _ := congrArg _ (apply_const_eq_smul B c) + rw [hid] + apply Lp.ext + filter_upwards [multiplier_indicator_coe s hs (c • b), Lp.coeFn_smul c b, + multiplier_coe g (indicatorConstLp 2 hs (measure_ne_top μ s) c), + indicatorConstLp_coeFn (p := 2) (μ := μ) (hs := hs) + (hμs := measure_ne_top μ s) (c := c), hg] with x hx hsx hmult hi hgb + rw [hx, hmult, hi, hgb] + by_cases hxs : x ∈ s + · simp only [Set.indicator_of_mem hxs, hsx, Pi.smul_apply, smul_eq_mul, mul_comm] + · simp only [Set.indicator_of_notMem hxs, smul_zero] + apply ContinuousLinearMap.ext + apply Lp.induction (by simp) (fun f => B f = multiplier g f) + · intro c s hs hμs + simpa only [Lp.simpleFunc.coe_indicatorConst] using hind c s hs + · intro f₁ f₂ hf₁ hf₂ hd h₁ h₂ + simp only [map_add, h₁, h₂] + · exact isClosed_eq B.continuous (multiplier g).continuous + +omit [IsFiniteMeasure μ] in + +theorem multiplier_commute (g h : Lp ℂ ∞ μ) : + Commute (multiplier g : Lp E 2 μ →L[ℂ] Lp E 2 μ) (multiplier h) := by + show multiplier g * multiplier h = multiplier h * multiplier g + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + filter_upwards [multiplier_coe g (multiplier h f), multiplier_coe h f, + multiplier_coe h (multiplier g f), multiplier_coe g f] with x hgh hh hhg hg + simp only [mul_apply_eq_comp, hgh, hh, hhg, hg, smul_smul, mul_comm] + +theorem multiplier_injective : + Function.Injective (multiplier (μ := μ) (E := ℂ)) := by + intro g h hgh + have haction := congrArg (fun A : Lp ℂ 2 μ →L[ℂ] Lp ℂ 2 μ => + A (Lp.const 2 μ (1 : ℂ))) hgh + apply Lp.ext + filter_upwards [multiplier_coe g (Lp.const 2 μ (1 : ℂ)), + multiplier_coe h (Lp.const 2 μ (1 : ℂ)), Lp.coeFn_const 2 μ (1 : ℂ)] with x hg hh hc + rw [haction] at hg + simpa only [hc, Function.const_apply, smul_eq_mul, mul_one] using hg.symm.trans hh + +theorem norm_scalar_multiplier (g : Lp ℂ ∞ μ) : + ‖(multiplier g : Lp ℂ 2 μ →L[ℂ] Lp ℂ 2 μ)‖ = ‖g‖ := by + apply le_antisymm (norm_multiplier_le g) + obtain ⟨h, hh, haction⟩ := exists_multiplier_of_commutes (multiplier g) + (multiplier_commute g) + have hgh := multiplier_injective haction + simpa only [hgh] using hh + +end Invariant233.L2Multiplication + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarMultiplierFields.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarMultiplierFields.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b29fa1ed54cf7391d44b001e5f941ea7f573290 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarMultiplierFields.lean @@ -0,0 +1,308 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplier +import OAI.Analysis.IrrationalRotation.Operators.ColumnOperator +import OAI.Analysis.IrrationalRotation.Operators.LpOperatorExt +import OAI.Analysis.IrrationalRotation.Model.FieldOperator +import OAI.Analysis.IrrationalRotation.Operators.FieldProjections + +namespace OAI + +open MeasureTheory Filter Set +open scoped ENNReal + +namespace Invariant233.L2Multiplication + +variable {X E : Type*} [MeasurableSpace X] {μ : Measure X} + [NormedAddCommGroup E] [InnerProductSpace ℂ E] + +theorem norm_sq_eq_integral_hilbert (f : Lp E 2 μ) : + ‖f‖ ^ 2 = ∫ x, ‖f x‖ ^ 2 ∂μ := by + let := InnerProductSpace.rclikeToReal ℂ E + rw [norm_sq_eq_re_inner (𝕜 := ℝ), L2.inner_def] + simp only [RCLike.re_to_real, real_inner_self_eq_norm_sq] + +variable [IsFiniteMeasure μ] + +theorem norm_indicator_sq_hilbert (s : Set X) (hs : MeasurableSet s) (v : E) : + ‖indicatorConstLp 2 hs (measure_ne_top μ s) v‖ ^ 2 = ‖v‖ ^ 2 * μ.real s := by + rw [norm_sq_eq_integral_hilbert] + calc + (∫ x, ‖indicatorConstLp 2 hs (measure_ne_top μ s) v x‖ ^ 2 ∂μ) = + ∫ x, s.indicator (fun _ => ‖v‖ ^ 2) x ∂μ := by + apply integral_congr_ae + filter_upwards [indicatorConstLp_coeFn (p := 2) (μ := μ) (hs := hs) + (hμs := measure_ne_top μ s) (c := v)] with x hx + rw [hx] + by_cases hxs : x ∈ s <;> simp [Set.indicator, hxs] + _ = ‖v‖ ^ 2 * μ.real s := by rw [integral_indicator hs]; simp [mul_comm] + +theorem norm_multiplier_indicator_sq_hilbert (s : Set X) (hs : MeasurableSet s) + (f : Lp E 2 μ) : + ‖multiplier (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ)) f‖ ^ 2 = + ∫ x in s, ‖f x‖ ^ 2 ∂μ := by + rw [norm_sq_eq_integral_hilbert, ← integral_indicator hs] + apply integral_congr_ae + filter_upwards [multiplier_indicator_coe s hs f] with x hx + rw [hx] + by_cases hxs : x ∈ s <;> simp [Set.indicator, hxs] + +theorem ae_norm_apply_const_le + (A : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (hA : ∀ g : Lp ℂ ∞ μ, Commute A (multiplier g)) (v : E) : + ∀ᵐ x ∂μ, ‖A (Lp.const 2 μ v) x‖ ≤ ‖A‖ * ‖v‖ := by + apply Fields.ae_norm_le_of_local_square_integral (mul_nonneg (norm_nonneg A) (norm_nonneg v)) + ((memLp_two_iff_integrable_sq_norm (Lp.aestronglyMeasurable _)).mp (Lp.memLp _)) + intro s hs + have hcomm := congrArg (fun B : Lp E 2 μ →L[ℂ] Lp E 2 μ => B (Lp.const 2 μ v)) + (hA (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ))).eq + have hid : A (indicatorConstLp 2 hs (measure_ne_top μ s) v) = + multiplier (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ)) + (A (Lp.const 2 μ v)) := by + simpa only [mul_apply_eq_comp, multiplier_indicator_const] using hcomm + rw [← norm_multiplier_indicator_sq_hilbert s hs, ← hid] + calc + ‖A (indicatorConstLp 2 hs (measure_ne_top μ s) v)‖ ^ 2 ≤ + (‖A‖ * ‖indicatorConstLp 2 hs (measure_ne_top μ s) v‖) ^ 2 := by + gcongr + exact A.le_opNorm _ + _ = (‖A‖ * ‖v‖) ^ 2 * μ.real s := by + rw [mul_pow, norm_indicator_sq_hilbert] + ring + +theorem apply_const_finsetSum_coe {ι : Type*} + (A : Lp E 2 μ →L[ℂ] Lp E 2 μ) (s : Finset ι) (z : ι → ℂ) (v : ι → E) : + A (Lp.const 2 μ (∑ i ∈ s, z i • v i)) =ᵐ[μ] + fun x => ∑ i ∈ s, z i • A (Lp.const 2 μ (v i)) x := by + have heq : A (Lp.const 2 μ (∑ i ∈ s, z i • v i)) = + ∑ i ∈ s, z i • A (Lp.const 2 μ (v i)) := by + change (A.comp (Lp.constL 2 μ ℂ)) (∑ i ∈ s, z i • v i) = _ + rw [map_sum] + apply Finset.sum_congr rfl + intro i hi + exact map_smul _ _ _ + rw [heq] + have hsmul : ∀ᵐ x ∂μ, ∀ i ∈ s, + (z i • A (Lp.const 2 μ (v i))) x = z i • A (Lp.const 2 μ (v i)) x := by + apply (Filter.eventually_all_finset s).mpr + intro i hi + exact Lp.coeFn_smul _ _ + filter_upwards [Lp.coeFn_fun_finsetSum s (fun i => z i • A (Lp.const 2 μ (v i))), hsmul] + with x hx hxs + rw [hx] + exact Finset.sum_congr rfl hxs + +theorem apply_indicator_coe_of_commutes + (A : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (hA : ∀ g : Lp ℂ ∞ μ, Commute A (multiplier g)) + (s : Set X) (hs : MeasurableSet s) (v : E) : + A (indicatorConstLp 2 hs (measure_ne_top μ s) v) =ᵐ[μ] + s.indicator (A (Lp.const 2 μ v)) := by + have hcomm := congrArg (fun B : Lp E 2 μ →L[ℂ] Lp E 2 μ => B (Lp.const 2 μ v)) + (hA (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ))).eq + have hid : A (indicatorConstLp 2 hs (measure_ne_top μ s) v) = + multiplier (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ)) + (A (Lp.const 2 μ v)) := by + simpa only [mul_apply_eq_comp, multiplier_indicator_const] using hcomm + rw [hid] + exact multiplier_indicator_coe s hs _ + +variable {ι : Type*} [Countable ι] [CompleteSpace E] + +omit [IsFiniteMeasure μ] in + +theorem exists_stronglyMeasurable_field_of_rational_tests + (b : HilbertBasis ι ℂ E) (c : X → ι → E) {C : ℝ} + (hC : 0 ≤ C) + (hbound : ∀ s : Finset ι, ∀ q : s → ℚ × ℚ, ∀ᵐ x ∂μ, + ‖∑ i : s, Fields.rationalComplex (q i) • c x i‖ ≤ + C * ‖∑ i : s, Fields.rationalComplex (q i) • b i‖) + (hc : ∀ i, AEStronglyMeasurable (fun x => c x i) μ) : + ∃ F : X → E →L[ℂ] E, + (∀ x, ‖F x‖ ≤ C) ∧ + (∀ v : E, StronglyMeasurable fun x => F x v) ∧ + (∀ᵐ x ∂μ, ∀ i, F x (b i) = c x i) := by + classical + let d : X → ι → E := fun x i => (hc i).mk (fun x => c x i) x + have hd : ∀ i, StronglyMeasurable fun x => d x i := + fun i => (hc i).stronglyMeasurable_mk + have hdc : ∀ᵐ x ∂μ, ∀ i, d x i = c x i := + ae_all_iff.mpr (fun i => (hc i).ae_eq_mk.symm) + have hdtest : ∀ s : Finset ι, ∀ q : s → ℚ × ℚ, ∀ᵐ x ∂μ, + ‖∑ i : s, Fields.rationalComplex (q i) • d x i‖ ≤ + C * ‖∑ i : s, Fields.rationalComplex (q i) • b i‖ := by + intro s q + filter_upwards [hbound s q, hdc] with x hx hdx + simpa only [hdx] using hx + have hdbound := Fields.ae_finite_combination_bound_of_rational b d hdtest + obtain ⟨s, hsae, hsm, hsb⟩ := hdbound.exists_measurable_mem + let e : X → ι → E := fun x i => s.indicator (fun x => d x i) x + have he : ∀ i, StronglyMeasurable fun x => e x i := + fun i => (hd i).indicator hsm + have hebound : ∀ x, ∀ z : ι →₀ ℂ, + ‖Finsupp.linearCombination ℂ (e x) z‖ ≤ + C * ‖Finsupp.linearCombination ℂ b z‖ := by + intro x z + by_cases hx : x ∈ s + · simpa only [e, Set.indicator_of_mem hx] using hsb x hx z + · simp only [e, Set.indicator_of_notMem hx] + simp only [Finsupp.linearCombination_apply, Finsupp.sum, smul_zero, Finset.sum_const_zero, + norm_zero] + exact mul_nonneg hC (norm_nonneg _) + refine ⟨fun x => Fields.columnOperator b (e x), ?_, ?_, ?_⟩ + · intro x + exact Fields.norm_columnOperator_le b (e x) hC (hebound x) + · intro v + exact Fields.stronglyMeasurable_columnOperator_apply b e hebound he stronglyMeasurable_const + · filter_upwards [hsae, hdc] with x hx hdx + intro i + rw [Fields.columnOperator_apply_basis b (e x) (hebound x)] + simpa only [e, Set.indicator_of_mem hx] using hdx i + +theorem exists_field_columns_of_commutes + (b : HilbertBasis ι ℂ E) + (A : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (hA : ∀ g : Lp ℂ ∞ μ, Commute A (multiplier g)) : + ∃ F : X → E →L[ℂ] E, + (∀ x, ‖F x‖ ≤ ‖A‖) ∧ + (∀ v : E, StronglyMeasurable fun x => F x v) ∧ + (∀ᵐ x ∂μ, ∀ i, F x (b i) = A (Lp.const 2 μ (b i)) x) := by + apply exists_stronglyMeasurable_field_of_rational_tests b + (fun x i => A (Lp.const 2 μ (b i)) x) (norm_nonneg A) + · intro s q + filter_upwards [ae_norm_apply_const_le A hA + (∑ i : s, Fields.rationalComplex (q i) • b i), + apply_const_finsetSum_coe A Finset.univ + (fun i : s => Fields.rationalComplex (q i)) (fun i : s => b i)] with x hx hcomb + rw [hcomb] at hx + exact hx + · intro i + exact Lp.aestronglyMeasurable _ + +omit [CompleteSpace E] in + +theorem field_unique_of_representation (b : HilbertBasis ι ℂ E) + (A : Lp E 2 μ →L[ℂ] Lp E 2 μ) (F G : X → E →L[ℂ] E) + (hF : ∀ f : Lp E 2 μ, A f =ᵐ[μ] fun x => F x (f x)) + (hG : ∀ f : Lp E 2 μ, A f =ᵐ[μ] fun x => G x (f x)) : F =ᵐ[μ] G := by + apply Fields.ae_eq_of_countable_columns + (Submodule.dense_iff_topologicalClosure_eq_top.mpr b.dense_span) + intro i + filter_upwards [hF (Lp.const 2 μ (b i)), hG (Lp.const 2 μ (b i)), + Lp.coeFn_const 2 μ (b i)] with x hx hy hc + simpa only [hc, Function.const_apply] using hx.symm.trans hy + +omit [Countable ι] [CompleteSpace E] in + +theorem represented_eq_of_basis_columns (b : HilbertBasis ι ℂ E) + (A T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (F : X → E →L[ℂ] E) + (hA : ∀ g : Lp ℂ ∞ μ, Commute A (multiplier g)) + (hT : ∀ f : Lp E 2 μ, T f =ᵐ[μ] fun x => F x (f x)) + (hcol : ∀ᵐ x ∂μ, ∀ i, F x (b i) = A (Lp.const 2 μ (b i)) x) : A = T := by + apply Fields.lp_operator_ext_basis_indicator b (by simp) A T + intro i s hs hμs + apply Lp.ext + filter_upwards [apply_indicator_coe_of_commutes A hA s hs (b i), + hT (indicatorConstLp 2 hs hμs (b i)), + indicatorConstLp_coeFn (p := 2) (μ := μ) (hs := hs) (hμs := hμs) (c := b i), + hcol] with x hx ht hi hc + rw [hx, ht, hi] + by_cases hxs : x ∈ s + · simpa only [Set.indicator_of_mem hxs] using (hc i).symm + · simp only [Set.indicator_of_notMem hxs, map_zero] + +theorem exists_field_of_commutes (b : HilbertBasis ι ℂ E) + (A : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (hA : ∀ g : Lp ℂ ∞ μ, Commute A (multiplier g)) : + ∃ F : X → E →L[ℂ] E, + (∀ x, ‖F x‖ ≤ ‖A‖) ∧ + (∀ v : E, StronglyMeasurable fun x => F x v) ∧ + (∀ f : Lp E 2 μ, A f =ᵐ[μ] fun x => F x (f x)) := by + obtain ⟨F, hnorm, hmeas, hcol⟩ := exists_field_columns_of_commutes b A hA + let T : Lp E 2 μ →L[ℂ] Lp E 2 μ := DirectIntegral.fieldOperator F ‖A‖ hnorm + (fun v => (hmeas v).aestronglyMeasurable) + have hT : ∀ f : Lp E 2 μ, T f =ᵐ[μ] fun x => F x (f x) := by + intro f + exact DirectIntegral.fieldOperatorVec_ae F ‖A‖ hnorm + (fun v => (hmeas v).aestronglyMeasurable) f + have hAT : A = T := represented_eq_of_basis_columns b A T F hA hT hcol + refine ⟨F, hnorm, hmeas, ?_⟩ + intro f + rw [hAT] + exact hT f + +theorem exists_unique_field_of_commutes (b : HilbertBasis ι ℂ E) + (A : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (hA : ∀ g : Lp ℂ ∞ μ, Commute A (multiplier g)) : + ∃ F : X → E →L[ℂ] E, + (∀ x, ‖F x‖ ≤ ‖A‖) ∧ + (∀ v : E, StronglyMeasurable fun x => F x v) ∧ + (∀ f : Lp E 2 μ, A f =ᵐ[μ] fun x => F x (f x)) ∧ + (∀ G : X → E →L[ℂ] E, + (∀ f : Lp E 2 μ, A f =ᵐ[μ] fun x => G x (f x)) → F =ᵐ[μ] G) := by + obtain ⟨F, hnorm, hmeas, hrep⟩ := exists_field_of_commutes b A hA + exact ⟨F, hnorm, hmeas, hrep, fun G hG => field_unique_of_representation b A F G hrep hG⟩ + +omit [IsFiniteMeasure μ] [CompleteSpace E] in + +theorem separableSpace_of_countable_hilbertBasis (b : HilbertBasis ι ℂ E) : + TopologicalSpace.SeparableSpace E := by + apply TopologicalSpace.isSeparable_univ_iff.mp + have hs := ((Set.countable_range b).isSeparable.span (R := ℂ)).closure + rw [← Submodule.topologicalClosure_coe, b.dense_span] at hs + exact hs + +theorem scalar_multiplier_fields_complete (b : HilbertBasis ι ℂ E) + (A : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (hA : ∀ g : Lp ℂ ∞ μ, Commute A (multiplier g)) : + ∃ F : X → E →L[ℂ] E, + (∀ x, ‖F x‖ ≤ ‖A‖) ∧ + (∀ v : E, StronglyMeasurable fun x => F x v) ∧ + (∀ f : Lp E 2 μ, A f =ᵐ[μ] fun x => F x (f x)) ∧ + (∀ G : X → E →L[ℂ] E, + (∀ f : Lp E 2 μ, A f =ᵐ[μ] fun x => G x (f x)) → F =ᵐ[μ] G) ∧ + (∀ f : Lp E 2 μ, A.adjoint f =ᵐ[μ] fun x => (F x).adjoint (f x)) ∧ + (∀ (B : Lp E 2 μ →L[ℂ] Lp E 2 μ) (G : X → E →L[ℂ] E), + (∀ f : Lp E 2 μ, B f =ᵐ[μ] fun x => G x (f x)) → + ∀ f : Lp E 2 μ, (A * B) f =ᵐ[μ] fun x => (F x * G x) (f x)) ∧ + (IsStarProjection A → ∀ᵐ x ∂μ, IsStarProjection (F x)) := by + let := separableSpace_of_countable_hilbertBasis b + obtain ⟨F, hnorm, hmeas, hrep, huniq⟩ := exists_unique_field_of_commutes b A hA + have hAT : A = DirectIntegral.fieldOperator F ‖A‖ hnorm + (fun v => (hmeas v).aestronglyMeasurable) := by + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + exact (hrep f).trans (DirectIntegral.fieldOperatorVec_ae F ‖A‖ hnorm + (fun v => (hmeas v).aestronglyMeasurable) f).symm + refine ⟨F, hnorm, hmeas, hrep, huniq, ?_, ?_, ?_⟩ + · have hnormAdj : ∀ x, ‖(F x).adjoint‖ ≤ ‖A‖ := by + intro x + simpa only [LinearIsometryEquiv.norm_map] using hnorm x + have hmeasAdj : ∀ v, AEStronglyMeasurable (fun x => (F x).adjoint v) μ := by + intro v + exact (StrongField.stronglyMeasurable_adjoint_apply_of_columns b F + (fun i => hmeas (b i)) v).aestronglyMeasurable + have hAdj : DirectIntegral.fieldOperator (fun x => (F x).adjoint) ‖A‖ hnormAdj hmeasAdj = + A.adjoint := by + calc + _ = (DirectIntegral.fieldOperator F ‖A‖ hnorm + (fun v => (hmeas v).aestronglyMeasurable)).adjoint := + DirectIntegral.fieldOperator_adjoint_of_ae_eq + (Filter.Eventually.of_forall fun x => rfl) + _ = A.adjoint := congrArg ContinuousLinearMap.adjoint hAT.symm + intro f + rw [← hAdj] + exact DirectIntegral.fieldOperator_ae _ _ _ _ f + · intro B G hG f + filter_upwards [hrep (B f), hG f] with x hx hy + change A (B f) x = (F x) (G x (f x)) + rw [hx, hy] + · intro hP + have hPT : IsStarProjection (DirectIntegral.fieldOperator (μ := μ) F ‖A‖ hnorm + (fun v => (hmeas v).aestronglyMeasurable)) := by + rw [← hAT] + exact hP + exact DirectIntegral.ae_isStarProjection_of_fieldOperator b (norm_nonneg A) hmeas hPT + +end Invariant233.L2Multiplication + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarRectangleDiscrepancy.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarRectangleDiscrepancy.lean new file mode 100644 index 0000000000000000000000000000000000000000..7bcc1d82a0d723fca35f76280384725a89fe856e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/ScalarRectangleDiscrepancy.lean @@ -0,0 +1,430 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FejerApproximation +import OAI.Analysis.IrrationalRotation.Analysis.IntervalIndicatorTranslation +import OAI.Analysis.IrrationalRotation.Analysis.UniformIntervalFourier +import OAI.Analysis.IrrationalRotation.Sampling.UniformIntervalPhase + +namespace OAI + +noncomputable section +open MeasureTheory Set +open scoped BigOperators ENNReal + +namespace Invariant233.ScalarRectangles + +local instance : IsProbabilityMeasure (volume : Measure UnitAddCircle) := by + rw [AddCircle.volume_eq_smul_haarAddCircle] + norm_num + infer_instance + +def intervalTest (a b : ℝ) (x : UnitAddCircle) : ℝ := + (Icc a b).indicator (fun _ => 1) (UniformIntervalPhase.representative x) + +theorem measurable_intervalTest (a b : ℝ) : Measurable (intervalTest a b) := + (measurable_const.indicator measurableSet_Icc).comp + UniformIntervalPhase.measurable_representative + +theorem intervalTest_bounds (a b : ℝ) (x : UnitAddCircle) : + 0 ≤ intervalTest a b x ∧ intervalTest a b x ≤ 1 := by + unfold intervalTest + by_cases h : UniformIntervalPhase.representative x ∈ Icc a b <;> simp [h] + +theorem intervalTest_translation (a b : ℝ) {η : ℝ} (hη : 0 ≤ η) + (t : UnitAddCircle) (ht : dist t 0 ≤ η) : + CircleKernelConvolution.translationError (intervalTest a b) t ≤ 6 * η := by + induction t using QuotientAddGroup.induction_on with + | H u => + have hround : (((round u : ℤ) : ℝ) : UnitAddCircle) = 0 := by + have hc := AddCircle.coe_zsmul (p := (1 : ℝ)) (n := round u) (x := (1 : ℝ)) + simpa only [zsmul_eq_mul, mul_one, AddCircle.coe_period, smul_zero] using hc + have hcoe : ((u - round u : ℝ) : UnitAddCircle) = (u : UnitAddCircle) := by + rw [QuotientAddGroup.mk_sub, hround, sub_zero] + have hu : |u - round u| ≤ η := by + simpa only [dist_zero_right, UnitAddCircle.norm_eq] using ht + have h := IntervalIndicatorTranslation.circle_integral_indicator_translation_le + (a := a) (b := b) hη hu + rw [hcoe] at h + exact h + +theorem kernel_tail_le (H : ℕ) (hH : H ≠ 0) {η : ℝ} (hη : 0 < η) : + (∫ t in {x : UnitAddCircle | dist x 0 ≤ η}ᶜ, Fejer.kernel H t) ≤ + 1 / (4 * (H : ℝ) * η ^ 2) := by + have hB : MeasurableSet {x : UnitAddCircle | dist x 0 ≤ η} := + isClosed_le (continuous_id.dist continuous_const) continuous_const |>.measurableSet + have hk : Integrable (Fejer.kernel H) (volume : Measure UnitAddCircle) := + (Fejer.continuous_kernel H).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + rw [← integral_indicator hB.compl] + have hbound : ∀ t : UnitAddCircle, + {x : UnitAddCircle | dist x 0 ≤ η}ᶜ.indicator (Fejer.kernel H) t ≤ + 1 / (4 * (H : ℝ) * η ^ 2) := by + intro t + by_cases ht : t ∈ {x : UnitAddCircle | dist x 0 ≤ η}ᶜ + · rw [Set.indicator_of_mem ht] + exact Fejer.kernel_le_of_distance_ge H hH hη t (le_of_lt (not_le.mp ht)) + · rw [Set.indicator_of_notMem ht] + positivity + have hi := integral_mono (hk.indicator hB.compl) (integrable_const + (1 / (4 * (H : ℝ) * η ^ 2))) hbound + simpa using hi + +theorem interval_approximation_error (H : ℕ) (hH : H ≠ 0) + (a b : ℝ) {η : ℝ} (hη : 0 < η) : + (∫ x : UnitAddCircle, |Fejer.approximation H (intervalTest a b) x - + intervalTest a b x|) ≤ 6 * η + 1 / (4 * (H : ℝ) * η ^ 2) := by + apply Fejer.approximation_l1_error_le H hH (measurable_intervalTest a b) + (fun x => (intervalTest_bounds a b x).1) (fun x => (intervalTest_bounds a b x).2) + (B := {x : UnitAddCircle | dist x 0 ≤ η}) + · exact (isClosed_le (continuous_id.dist continuous_const) continuous_const).measurableSet + · positivity + · exact fun t ht => intervalTest_translation a b hη.le t ht + · exact kernel_tail_le H hH hη + +private theorem integrable_unit {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) [IsFiniteMeasure μ] {f : Ω → ℂ} + (hf : Measurable f) (hb : ∀ x, ‖f x‖ ≤ 1) : Integrable f μ := + Integrable.of_bound hf.aestronglyMeasurable 1 (Filter.Eventually.of_forall hb) + +theorem rectangle_error_of_character_bounds + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] + (X Y : Ω → UnitAddCircle) (hX : Measurable X) (hY : Measurable Y) + (hmapX : μ.map X ≤ (2 : ℝ≥0∞) • volume) + (hmapY : μ.map Y ≤ (2 : ℝ≥0∞) • volume) + (H : ℕ) (hH : H ≠ 0) (a b c d : ℝ) {η ε : ℝ} + (hη : 0 < η) (hε : 0 ≤ ε) + (hchar : ∀ i ∈ Fejer.frequencies H, ∀ j ∈ Fejer.frequencies H, + (i, j) ≠ (0, 0) → + ‖∫ ω, fourier i (X ω) * fourier j (Y ω) ∂μ‖ ≤ ε) : + ‖(∫ ω, (intervalTest a b (X ω) : ℂ) * (intervalTest c d (Y ω) : ℂ) ∂μ) - + (∫ x : UnitAddCircle, intervalTest a b x : ℝ) * + (∫ x : UnitAddCircle, intervalTest c d x : ℝ)‖ ≤ + 4 * (6 * η + 1 / (4 * (H : ℝ) * η ^ 2)) + (2 * (H : ℝ)) ^ 2 * ε := by + let f := intervalTest a b + let g := intervalTest c d + let p := Fejer.approximation H f + let q := Fejer.approximation H g + have hf := measurable_intervalTest a b + have hg := measurable_intervalTest c d + have hf0 := fun x => (intervalTest_bounds a b x).1 + have hf1 := fun x => (intervalTest_bounds a b x).2 + have hg0 := fun x => (intervalTest_bounds c d x).1 + have hg1 := fun x => (intervalTest_bounds c d x).2 + have hpcont : Continuous p := Fejer.continuous_approximation H hf hf0 hf1 + have hqcont : Continuous q := Fejer.continuous_approximation H hg hg0 hg1 + have hpb : ∀ x, 0 ≤ p x ∧ p x ≤ 1 := Fejer.approximation_bounds H hH hf hf0 hf1 + have hqb : ∀ x, 0 ≤ q x ∧ q x ≤ 1 := Fejer.approximation_bounds H hH hg hg0 hg1 + have hfn : ∀ x, ‖(f x : ℂ)‖ ≤ 1 := fun x => by + simpa only [f, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hf0 x)] using hf1 x + have hgn : ∀ x, ‖(g x : ℂ)‖ ≤ 1 := fun x => by + simpa only [g, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hg0 x)] using hg1 x + have hpn : ∀ x, ‖(p x : ℂ)‖ ≤ 1 := fun x => by + simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hpb x).1] using (hpb x).2 + have hqn : ∀ x, ‖(q x : ℂ)‖ ≤ 1 := fun x => by + simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hqb x).1] using (hqb x).2 + have hfX := (Complex.measurable_ofReal.comp hf).comp hX + have hgY := (Complex.measurable_ofReal.comp hg).comp hY + have hpX := (Complex.measurable_ofReal.comp hpcont.measurable).comp hX + have hqY := (Complex.measurable_ofReal.comp hqcont.measurable).comp hY + have hfi := integrable_unit μ hfX (fun ω => hfn (X ω)) + have hgi := integrable_unit μ hgY (fun ω => hgn (Y ω)) + have hpi := integrable_unit μ hpX (fun ω => hpn (X ω)) + have hqi := integrable_unit μ hqY (fun ω => hqn (Y ω)) + have hfg := hgi.bdd_mul hfX.aestronglyMeasurable + (Filter.Eventually.of_forall fun ω => hfn (X ω)) + have hpq := hqi.bdd_mul hpX.aestronglyMeasurable + (Filter.Eventually.of_forall fun ω => hpn (X ω)) + have hfvol := integrable_unit (volume : Measure UnitAddCircle) + (Complex.measurable_ofReal.comp hf) hfn + have hgvol := integrable_unit (volume : Measure UnitAddCircle) + (Complex.measurable_ofReal.comp hg) hgn + have hpvol := integrable_unit (volume : Measure UnitAddCircle) + (Complex.measurable_ofReal.comp hpcont.measurable) hpn + have hqvol := integrable_unit (volume : Measure UnitAddCircle) + (Complex.measurable_ofReal.comp hqcont.measurable) hqn + have herrX := FourierSampling.marginal_l1_error_le hX (by norm_num : (0 : ℝ) ≤ 2) + (by simpa using hmapX) (hfvol.sub hpvol) + have herrY := FourierSampling.marginal_l1_error_le hY (by norm_num : (0 : ℝ) ≤ 2) + (by simpa using hmapY) (hgvol.sub hqvol) + have herrf : (∫ x : UnitAddCircle, ‖(f x : ℂ) - (p x : ℂ)‖) ≤ + 6 * η + 1 / (4 * (H : ℝ) * η ^ 2) := by + simpa only [← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs, abs_sub_comm] + using interval_approximation_error H hH a b hη + have herrg : (∫ x : UnitAddCircle, ‖(g x : ℂ) - (q x : ℂ)‖) ≤ + 6 * η + 1 / (4 * (H : ℝ) * η ^ 2) := by + simpa only [← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs, abs_sub_comm] + using interval_approximation_error H hH c d hη + have hzero : 0 ∈ Fejer.frequencies H := by + simp only [Fejer.frequencies, Finset.mem_Ioo] + have hpos := Nat.pos_of_ne_zero hH + constructor <;> omega + have heqp (x : UnitAddCircle) : FourierSampling.polynomial (Fejer.frequencies H) + (Fejer.approximationCoefficient H f) x = (p x : ℂ) := + (Fejer.approximation_eq_polynomial H hf hf0 hf1 x).symm + have heqq (x : UnitAddCircle) : FourierSampling.polynomial (Fejer.frequencies H) + (Fejer.approximationCoefficient H g) x = (q x : ℂ) := + (Fejer.approximation_eq_polynomial H hg hg0 hg1 x).symm + have hmain := FourierSampling.test_error_le hX hY + (Fejer.frequencies H) (Fejer.frequencies H) hzero hzero + (Fejer.approximationCoefficient H f) (Fejer.approximationCoefficient H g) + hfg (by simpa only [heqp, heqq, Function.comp_apply] using hpq) + (by simp only [heqp]; exact hfi.sub hpi) + (by simp only [heqq]; exact hgi.sub hqi) + (Filter.Eventually.of_forall fun ω => hgn (Y ω)) + (by simpa only [heqp] using Filter.Eventually.of_forall fun ω => hpn (X ω)) + (fun i _ => Fejer.approximationCoefficient_norm_le_one H hH hf hf0 hf1 i) + (fun j _ => Fejer.approximationCoefficient_norm_le_one H hH hg hg0 hg1 j) + hε hchar + simp only [Fejer.approximationCoefficient_zero H hH, heqp, heqq] at hmain + have hcard : ((Fejer.frequencies H).card : ℝ) ≤ 2 * (H : ℝ) := by + exact_mod_cast Fejer.card_frequencies_le H + have hcard2 : ((Fejer.frequencies H).card : ℝ) * (Fejer.frequencies H).card * ε ≤ + (2 * (H : ℝ)) ^ 2 * ε := by + apply mul_le_mul_of_nonneg_right _ hε + nlinarith [Nat.cast_nonneg (α := ℝ) (Fejer.frequencies H).card] + dsimp only [Function.comp_apply, f, g] at herrX herrY herrf herrg hmain ⊢ + exact hmain.trans (by nlinarith only [herrX, herrY, herrf, herrg, hcard2]) + +theorem sampled_character_pair (i j : ℤ) (n n' t : ℝ) : + fourier i ((n * t : ℝ) : UnitAddCircle) * + fourier j ((n' * t : ℝ) : UnitAddCircle) = + Complex.exp ((((2 * Real.pi * ((i : ℝ) * n + (j : ℝ) * n')) * t : ℝ) : ℂ) * + Complex.I) := by + rw [fourier_coe_apply, fourier_coe_apply, ← Complex.exp_add] + congr 1 + push_cast + ring + +theorem sampling_rectangle_error + {N₀ N m n n' : ℝ} (hN₀ : 0 < N₀) (hN : N₀ ≤ N) (hm : 0 < m) + (hn : N₀ ≤ n) (hn' : N₀ ≤ n') (H : ℕ) (hH : H ≠ 0) + (hsep : ∀ i j : ℤ, |i| ≤ (H : ℤ) → |j| ≤ (H : ℤ) → + (i, j) ≠ (0, 0) → N * m ^ 1000 < |(i : ℝ) * n + (j : ℝ) * n'|) + (a b c d : ℝ) {η : ℝ} (hη : 0 < η) : + ‖(∫ t, (intervalTest a b ((n * t : ℝ) : UnitAddCircle) : ℂ) * + (intervalTest c d ((n' * t : ℝ) : UnitAddCircle) : ℂ) + ∂UniformIntervalPhase.lambdaLaw N₀) - + (∫ x : UnitAddCircle, intervalTest a b x : ℝ) * + (∫ x : UnitAddCircle, intervalTest c d x : ℝ)‖ ≤ + 4 * (6 * η + 1 / (4 * (H : ℝ) * η ^ 2)) + + (2 * (H : ℝ)) ^ 2 / m ^ 1000 := by + let := UniformIntervalPhase.lambdaLaw_probability N₀ hN₀ + have hX : Measurable (fun t : ℝ => ((n * t : ℝ) : UnitAddCircle)) := + AddCircle.measurable_mk'.comp (measurable_const_mul n) + have hY : Measurable (fun t : ℝ => ((n' * t : ℝ) : UnitAddCircle)) := + AddCircle.measurable_mk'.comp (measurable_const_mul n') + have hchar : ∀ i ∈ Fejer.frequencies H, ∀ j ∈ Fejer.frequencies H, + (i, j) ≠ (0, 0) → + ‖∫ t, fourier i ((n * t : ℝ) : UnitAddCircle) * + fourier j ((n' * t : ℝ) : UnitAddCircle) + ∂UniformIntervalPhase.lambdaLaw N₀‖ ≤ 1 / m ^ 1000 := by + intro i hi j hj hij + have hi' : |i| ≤ (H : ℤ) := by + simp only [Fejer.frequencies, Finset.mem_Ioo] at hi + exact abs_le.mpr ⟨hi.1.le, hi.2.le⟩ + have hj' : |j| ≤ (H : ℤ) := by + simp only [Fejer.frequencies, Finset.mem_Ioo] at hj + exact abs_le.mpr ⟨hj.1.le, hj.2.le⟩ + simp_rw [sampled_character_pair] + rw [UniformIntervalPhase.lambdaLaw_eq_cond N₀ hN₀] + apply (UniformIntervalFourier.norm_sampling_interval_character_le_of_separation + hN₀ hN hm (hsep i j hi' hj' hij)).trans + apply one_div_le_one_div_of_le (pow_pos hm _) + nlinarith [Real.pi_gt_three, pow_pos hm 1000] + have h := rectangle_error_of_character_bounds (UniformIntervalPhase.lambdaLaw N₀) + _ _ hX hY (UniformIntervalPhase.sampled_circle_le_two N₀ n hN₀ hn) + (UniformIntervalPhase.sampled_circle_le_two N₀ n' hN₀ hn') + H hH a b c d hη (by positivity : 0 ≤ 1 / m ^ 1000) hchar + simpa only [mul_one_div] using h + +theorem integral_intervalTest (a b : ℝ) (ha : 0 ≤ a) (hab : a ≤ b) (hb : b ≤ 1) : + (∫ x : UnitAddCircle, intervalTest a b x) = b - a := by + have hf : Measurable ((Icc a b).indicator (fun _ => (1 : ℝ))) := + measurable_const.indicator measurableSet_Icc + have h := integral_map (μ := (volume : Measure UnitAddCircle)) + UniformIntervalPhase.measurable_representative.aemeasurable + hf.aestronglyMeasurable + rw [UniformIntervalPhase.map_representative_haar] at h + change (∫ x : UnitAddCircle, (Icc a b).indicator (fun _ => (1 : ℝ)) + (UniformIntervalPhase.representative x)) = b - a + rw [← h, integral_indicator_const 1 measurableSet_Icc, + measureReal_restrict_apply measurableSet_Icc, smul_eq_mul, mul_one] + have heq : (Icc a b ∩ Ico (0 : ℝ) 1 : Set ℝ) =ᵐ[volume] + (Icc a b ∩ Icc (0 : ℝ) 1 : Set ℝ) := + Filter.EventuallyEqSet.inter Filter.EventuallyEq.rfl Ico_ae_eq_Icc + rw [measureReal_congr heq, Set.inter_eq_left.mpr (Icc_subset_Icc ha hb)] + exact Real.volume_real_Icc_of_le hab + +theorem integral_sample_interval_product (N₀ n n' a b c d : ℝ) : + (∫ t, (intervalTest a b ((n * t : ℝ) : UnitAddCircle) : ℂ) * + (intervalTest c d ((n' * t : ℝ) : UnitAddCircle) : ℂ) + ∂UniformIntervalPhase.lambdaLaw N₀) = + ((UniformIntervalPhase.lambdaLaw N₀).real + {t : ℝ | Int.fract (n * t) ∈ Icc a b ∧ Int.fract (n' * t) ∈ Icc c d} : ℂ) := by + have hs : MeasurableSet + {t : ℝ | Int.fract (n * t) ∈ Icc a b ∧ Int.fract (n' * t) ∈ Icc c d} := + (measurableSet_Icc.preimage (measurable_fract.comp (measurable_const_mul n))).inter + (measurableSet_Icc.preimage (measurable_fract.comp (measurable_const_mul n'))) + have heq : (fun t => (intervalTest a b ((n * t : ℝ) : UnitAddCircle) : ℂ) * + (intervalTest c d ((n' * t : ℝ) : UnitAddCircle) : ℂ)) = + {t : ℝ | Int.fract (n * t) ∈ Icc a b ∧ Int.fract (n' * t) ∈ Icc c d}.indicator + (fun _ => (1 : ℂ)) := by + funext t + simp only [intervalTest, UniformIntervalPhase.representative_coe, Set.indicator_apply, + Set.mem_ofPred_eq] + by_cases hi : Int.fract (n * t) ∈ Icc a b <;> + by_cases hj : Int.fract (n' * t) ∈ Icc c d <;> simp [hi, hj] + rw [heq, integral_indicator_const 1 hs] + simp + +theorem sampling_rectangle_probability_error + {N₀ N m n n' : ℝ} (hN₀ : 0 < N₀) (hN : N₀ ≤ N) (hm : 0 < m) + (hn : N₀ ≤ n) (hn' : N₀ ≤ n') (H : ℕ) (hH : H ≠ 0) + (hsep : ∀ i j : ℤ, |i| ≤ (H : ℤ) → |j| ≤ (H : ℤ) → + (i, j) ≠ (0, 0) → N * m ^ 1000 < |(i : ℝ) * n + (j : ℝ) * n'|) + (a b c d : ℝ) (ha : 0 ≤ a) (hab : a ≤ b) (hb : b ≤ 1) + (hc : 0 ≤ c) (hcd : c ≤ d) (hd : d ≤ 1) {η : ℝ} (hη : 0 < η) : + |(UniformIntervalPhase.lambdaLaw N₀).real + {t : ℝ | Int.fract (n * t) ∈ Icc a b ∧ Int.fract (n' * t) ∈ Icc c d} - + (b - a) * (d - c)| ≤ + 4 * (6 * η + 1 / (4 * (H : ℝ) * η ^ 2)) + + (2 * (H : ℝ)) ^ 2 / m ^ 1000 := by + have h := sampling_rectangle_error hN₀ hN hm hn hn' H hH hsep a b c d hη + rw [integral_sample_interval_product, integral_intervalTest a b ha hab hb, + integral_intervalTest c d hc hcd hd] at h + simpa only [← Complex.ofReal_mul, ← Complex.ofReal_sub, Complex.norm_real, + Real.norm_eq_abs] using h + +theorem horizon_ge_twice_square {m : ℝ} (hm : 200 ≤ m) : + 2 * m ^ 2 ≤ m ^ ((7 / 10 : ℝ) * m) := by + have hm1 : 1 ≤ m := by linarith + calc + 2 * m ^ 2 ≤ m ^ 3 := by nlinarith [sq_nonneg m] + _ = m ^ (3 : ℝ) := (Real.rpow_natCast m 3).symm + _ ≤ m ^ ((7 / 10 : ℝ) * m) := + Real.rpow_le_rpow_of_exponent_le hm1 (by linarith) + +theorem numerical_rectangle_error {m : ℝ} (hm : 1 ≤ m) : + 4 * (6 * (1 / m ^ 80) + 1 / (4 * m ^ 300 * (1 / m ^ 80) ^ 2)) + + (2 * m ^ 300) ^ 2 / m ^ 1000 ≤ 29 / m ^ 80 := by + have hm0 : 0 < m := by linarith + have heq : + 4 * (6 * (1 / m ^ 80) + 1 / (4 * m ^ 300 * (1 / m ^ 80) ^ 2)) + + (2 * m ^ 300) ^ 2 / m ^ 1000 = + 24 / m ^ 80 + 1 / m ^ 140 + 4 / m ^ 400 := by + field_simp + ring + rw [heq] + have h140 : 1 / m ^ 140 ≤ 1 / m ^ 80 := + one_div_le_one_div_of_le (pow_pos hm0 _) (pow_le_pow_right₀ hm (by norm_num)) + have h400 : 4 / m ^ 400 ≤ 4 / m ^ 80 := + div_le_div_of_nonneg_left (by norm_num) (pow_pos hm0 _) + (pow_le_pow_right₀ hm (by norm_num)) + calc + _ ≤ 24 / m ^ 80 + 1 / m ^ 80 + 4 / m ^ 80 := + add_le_add (add_le_add le_rfl h140) h400 + _ = 29 / m ^ 80 := by ring + +theorem scalar_rectangles (m : ℕ) (hm : 200 ≤ m) + (N₀ N : ℝ) (hN₀ : 0 < N₀) (hN : N₀ ≤ N) (hNm : N ≤ (m : ℝ) ^ 2) + (n n' : ℕ) + (hn : (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 ≤ n) + (hn' : (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 ≤ n') + (hsep : ∀ i j : ℤ, |i| ≤ (m ^ 300 : ℕ) → |j| ≤ (m ^ 300 : ℕ) → + (i, j) ≠ (0, 0) → + N * (m : ℝ) ^ 1000 < |(i : ℝ) * n + (j : ℝ) * n'|) + (a b c d : ℝ) (ha : 0 ≤ a) (hab : a ≤ b) (hb : b ≤ 1) + (hc : 0 ≤ c) (hcd : c ≤ d) (hd : d ≤ 1) : + |(UniformIntervalPhase.lambdaLaw N₀).real + {t : ℝ | Int.fract ((n : ℝ) * t) ∈ Icc a b ∧ + Int.fract ((n' : ℝ) * t) ∈ Icc c d} - (b - a) * (d - c)| ≤ + 29 / (m : ℝ) ^ 80 := by + have hmr : (200 : ℝ) ≤ m := by exact_mod_cast hm + have hm0 : (0 : ℝ) < m := by linarith + have hmn : m ≠ 0 := by omega + have hhor := horizon_ge_twice_square hmr + have hnN : N₀ ≤ (n : ℝ) := by linarith + have hn'N : N₀ ≤ (n' : ℝ) := by linarith + have h := sampling_rectangle_probability_error hN₀ hN hm0 hnN hn'N + (m ^ 300) (pow_ne_zero _ hmn) hsep a b c d ha hab hb hc hcd hd + (η := 1 / (m : ℝ) ^ 80) (by positivity) + simp only [Nat.cast_pow] at h + exact h.trans (numerical_rectangle_error (by linarith)) + +theorem sampled_fraction_absolutelyContinuous (N₀ n : ℝ) (hN₀ : 0 < N₀) (hn : 0 < n) : + (UniformIntervalPhase.lambdaLaw N₀).map (fun t => Int.fract (n * t)) ≪ + volume.restrict (Icc (0 : ℝ) 1) := by + have hac : UniformIntervalPhase.fractionLaw N₀ n ≪ volume.restrict (Ico (0 : ℝ) 1) := by + rw [← (UniformIntervalPhase.scalar_marginal N₀ n hN₀ hn).2.2] + exact withDensity_absolutelyContinuous _ _ + simpa only [UniformIntervalPhase.fractionLaw, restrict_Ico_eq_restrict_Icc] using hac + +theorem sampled_fraction_ae_eq {E : Type*} (N₀ n : ℝ) + (hN₀ : 0 < N₀) (hn : 0 < n) {f g : ℝ → E} (hfg : f =ᵐ[volume] g) : + (fun t => f (Int.fract (n * t))) =ᵐ[UniformIntervalPhase.lambdaLaw N₀] + (fun t => g (Int.fract (n * t))) := by + have h := (sampled_fraction_absolutelyContinuous N₀ n hN₀ hn).ae_eq + (ae_restrict_of_ae hfg) + exact ae_of_ae_map (measurable_fract.comp (measurable_const_mul n)).aemeasurable h + +theorem rectangle_probability_congr (N₀ n n' : ℝ) + (hN₀ : 0 < N₀) (hn : 0 < n) (hn' : 0 < n') + {s s' t t' : Set ℝ} (hs : s =ᵐ[volume] s') (ht : t =ᵐ[volume] t') : + (UniformIntervalPhase.lambdaLaw N₀).real + {x | Int.fract (n * x) ∈ s ∧ Int.fract (n' * x) ∈ t} = + (UniformIntervalPhase.lambdaLaw N₀).real + {x | Int.fract (n * x) ∈ s' ∧ Int.fract (n' * x) ∈ t'} := by + apply measureReal_congr + filter_upwards [sampled_fraction_ae_eq N₀ n hN₀ hn hs, + sampled_fraction_ae_eq N₀ n' hN₀ hn' ht] with x hx hy + exact congrArg₂ And hx hy + +theorem scalar_rectangles_ae (m : ℕ) (hm : 200 ≤ m) + (N₀ N : ℝ) (hN₀ : 0 < N₀) (hN : N₀ ≤ N) (hNm : N ≤ (m : ℝ) ^ 2) + (n n' : ℕ) + (hn : (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 ≤ n) + (hn' : (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 ≤ n') + (hsep : ∀ i j : ℤ, |i| ≤ (m ^ 300 : ℕ) → |j| ≤ (m ^ 300 : ℕ) → + (i, j) ≠ (0, 0) → + N * (m : ℝ) ^ 1000 < |(i : ℝ) * n + (j : ℝ) * n'|) + (a b c d : ℝ) (ha : 0 ≤ a) (hab : a ≤ b) (hb : b ≤ 1) + (hc : 0 ≤ c) (hcd : c ≤ d) (hd : d ≤ 1) + (s t : Set ℝ) (hs : s =ᵐ[volume] Icc a b) (ht : t =ᵐ[volume] Icc c d) : + |(UniformIntervalPhase.lambdaLaw N₀).real + {x : ℝ | Int.fract ((n : ℝ) * x) ∈ s ∧ + Int.fract ((n' : ℝ) * x) ∈ t} - (b - a) * (d - c)| ≤ + 29 / (m : ℝ) ^ 80 := by + have hmr : (200 : ℝ) ≤ m := by exact_mod_cast hm + have hmp : 0 < (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 := by + apply div_pos (Real.rpow_pos_of_pos (by linarith) _) (by norm_num) + rw [rectangle_probability_congr N₀ n n' hN₀ (hmp.trans_le hn) (hmp.trans_le hn') hs ht] + exact scalar_rectangles m hm N₀ N hN₀ hN hNm n n' hn hn' hsep a b c d ha hab hb hc hcd hd + +theorem scalar_tail_rectangles_integral (m : ℕ) (hm : 200 ≤ m) + (N₀ N : ℝ) (hN₀ : 0 < N₀) (hN : N₀ ≤ N) (hNm : N ≤ (m : ℝ) ^ 2) + (n n' : ℕ) + (hn : (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 ≤ n) + (hn' : (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 ≤ n') + (hsep : ∀ i j : ℤ, |i| ≤ (m ^ 300 : ℕ) → |j| ≤ (m ^ 300 : ℕ) → + (i, j) ≠ (0, 0) → + N * (m : ℝ) ^ 1000 < |(i : ℝ) * n + (j : ℝ) * n'|) + (a b : ℝ) (ha : a ∈ Icc (0 : ℝ) 1) (hb : b ∈ Icc (0 : ℝ) 1) : + ‖(∫ t, (Icc a 1).indicator (fun _ => (1 : ℂ)) (Int.fract ((n : ℝ) * t)) * + (Icc b 1).indicator (fun _ => (1 : ℂ)) (Int.fract ((n' : ℝ) * t)) + ∂UniformIntervalPhase.lambdaLaw N₀) - ((1 - a) * (1 - b) : ℝ)‖ ≤ + 29 / (m : ℝ) ^ 80 := by + have h := scalar_rectangles m hm N₀ N hN₀ hN hNm n n' hn hn' hsep + a 1 b 1 ha.1 ha.2 le_rfl hb.1 hb.2 le_rfl + have heq (u v z : ℝ) : + (intervalTest u v (z : UnitAddCircle) : ℂ) = + (Icc u v).indicator (fun _ => (1 : ℂ)) (Int.fract z) := by + simp only [intervalTest, UniformIntervalPhase.representative_coe, Set.indicator_apply] + split_ifs <;> simp + have hid := integral_sample_interval_product N₀ n n' a 1 b 1 + simp_rw [heq] at hid + rw [hid, ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs] + exact h + +end Invariant233.ScalarRectangles + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/SeparatedPowers.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/SeparatedPowers.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1393209cf4c747c2db44e2fe24ea5c5e6282d70 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/SeparatedPowers.lean @@ -0,0 +1,409 @@ +import Mathlib + +namespace OAI + +namespace Invariant233.SeparatedPowers + +open Filter +open scoped Topology + +theorem exists_separated_subset {α : Type*} (s : Finset α) (R : α → α → Prop) [DecidableRel R] + (hSymm : ∀ ⦃x y⦄, R x y → R y x) (D : ℕ) + (hdegree : ∀ x ∈ s, (s.filter (R x)).card ≤ D) : + ∃ t : Finset α, t ⊆ s ∧ (t : Set α).Pairwise (fun x y => ¬ R x y) ∧ + s.card ≤ t.card * (D + 1) := by + classical + let T := s.powerset.filter (fun t : Finset α => + (t : Set α).Pairwise (fun x y => ¬ R x y)) + have hTempty : (∅ : Finset α) ∈ T := by simp [T] + obtain ⟨t, ht, hmax⟩ := T.exists_max_image Finset.card ⟨∅, hTempty⟩ + have hsub : t ⊆ s := Finset.mem_powerset.mp (Finset.mem_filter.mp ht).1 + have hpair : (t : Set α).Pairwise (fun x y => ¬ R x y) := + (Finset.mem_filter.mp ht).2 + have hcover : s ⊆ t.biUnion (fun y => insert y (s.filter (R y))) := by + intro x hxs + by_contra hxout + have hxnot : x ∉ t := by + intro hxt + apply hxout + exact Finset.mem_biUnion.mpr ⟨x, hxt, Finset.mem_insert_self _ _⟩ + have hbad : ∀ y ∈ t, ¬ R y x := by + intro y hy hyx + apply hxout + exact Finset.mem_biUnion.mpr + ⟨y, hy, Finset.mem_insert_of_mem (Finset.mem_filter.mpr ⟨hxs, hyx⟩)⟩ + have hnewpair : ((insert x t : Finset α) : Set α).Pairwise (fun a b => ¬ R a b) := by + rw [Finset.coe_insert] + apply hpair.insert + intro y hy hxy + exact ⟨fun h => hbad y hy (hSymm h), hbad y hy⟩ + have hnew : insert x t ∈ T := by + apply Finset.mem_filter.mpr + exact ⟨Finset.mem_powerset.mpr (Finset.insert_subset hxs hsub), hnewpair⟩ + have hc := hmax (insert x t) hnew + rw [Finset.card_insert_of_notMem hxnot] at hc + omega + refine ⟨t, hsub, hpair, ?_⟩ + calc + s.card ≤ (t.biUnion (fun y => insert y (s.filter (R y)))).card := + Finset.card_le_card hcover + _ ≤ t.card * (D + 1) := by + apply Finset.card_biUnion_le_card_mul + intro y hy + exact (Finset.card_insert_le y (s.filter (R y))).trans + (Nat.add_le_add_right (hdegree y (hsub hy)) 1) + +theorem power_gap_absorbs_polynomial {m C a b d : ℝ} + (hm : 1 ≤ m) (hC : C ≤ m) (hgap : 1 + d ≤ (b - a) * m) : + C * m ^ d * m ^ (a * m) ≤ m ^ (b * m) := by + have hmpos : 0 < m := lt_of_lt_of_le zero_lt_one hm + calc + C * m ^ d * m ^ (a * m) ≤ m * m ^ d * m ^ (a * m) := by + gcongr + _ = m ^ (1 + d + a * m) := by + rw [Real.rpow_add hmpos, Real.rpow_add hmpos, Real.rpow_one] + _ ≤ m ^ (b * m) := + Real.rpow_le_rpow_of_exponent_le hm (by linarith) + +theorem eventually_power_gap {m : ℕ → ℝ} (hm : Tendsto m atTop atTop) + (C a b d : ℝ) (hab : a < b) : + ∀ᶠ n in atTop, C * m n ^ d * m n ^ (a * m n) ≤ m n ^ (b * m n) := by + have hgap : 0 < b - a := sub_pos.mpr hab + filter_upwards [hm.eventually_ge_atTop 1, hm.eventually_ge_atTop C, + hm.eventually_ge_atTop ((1 + d) / (b - a))] with n hn hC hd + apply power_gap_absorbs_polynomial hn hC + have := (div_le_iff₀ hgap).mp hd + nlinarith + +theorem eventually_sampling_count {m : ℕ → ℝ} (hm : Tendsto m atTop atTop) + (c : ℝ) (hc : 0 < c) : + ∀ᶠ n in atTop, m n ^ ((69 / 100 : ℝ) * m n) ≤ + c * m n ^ ((7 / 10 : ℝ) * m n) / m n ^ (1602 : ℝ) := by + have h := eventually_power_gap hm (c⁻¹) (69 / 100) (7 / 10) 1602 (by norm_num) + filter_upwards [h, hm.eventually_ge_atTop 1] with n hn hmone + have hmpos : 0 < m n := lt_of_lt_of_le zero_lt_one hmone + apply (le_div_iff₀ (Real.rpow_pos_of_pos hmpos _)).mpr + have hh := mul_le_mul_of_nonneg_left hn hc.le + calc + m n ^ ((69 / 100 : ℝ) * m n) * m n ^ (1602 : ℝ) = + c * (c⁻¹ * m n ^ (1602 : ℝ) * m n ^ ((69 / 100 : ℝ) * m n)) := by + field_simp + _ ≤ c * m n ^ ((7 / 10 : ℝ) * m n) := hh + +theorem card_small_affine_le (s : Finset ℤ) (a b : ℤ) (hb : b ≠ 0) (R : ℕ) : + (s.filter (fun x => |a + b * x| ≤ (R : ℤ))).card ≤ 2 * R + 1 := by + have hcard : (s.filter (fun x => |a + b * x| ≤ (R : ℤ))).card ≤ + (Finset.Icc (-(R : ℤ)) R).card := by + apply Finset.card_le_card_of_injOn (fun x => a + b * x) + · intro x hx + exact Finset.mem_Icc.mpr (abs_le.mp (Finset.mem_filter.mp hx).2) + · intro x hx y hy hxy + exact mul_left_cancel₀ hb (add_left_cancel hxy) + have hc : (Finset.Icc (-(R : ℤ)) R).card = 2 * R + 1 := by + rw [Int.card_Icc] + omega + exact hc ▸ hcard + +theorem exists_frequency_separated_subset (s : Finset ℤ) (H R : ℕ) + (hs : ∀ n ∈ s, (R : ℤ) < n) : + ∃ t : Finset ℤ, t ⊆ s ∧ + s.card ≤ t.card * ((2 * H + 1) ^ 2 * (2 * R + 1) + 1) ∧ + ∀ n ∈ t, ∀ n' ∈ t, n ≠ n' → ∀ v v' : ℤ, + |v| ≤ (H : ℤ) → |v'| ≤ (H : ℤ) → (v ≠ 0 ∨ v' ≠ 0) → + (R : ℤ) < |v * n + v' * n'| := by + classical + let I : Finset ℤ := Finset.Icc (-(H : ℤ)) H + let F : Finset (ℤ × ℤ) := (I.product I).filter (fun p => p.1 ≠ 0 ∧ p.2 ≠ 0) + let Bad : ℤ → ℤ → Prop := fun n n' => + ∃ p ∈ F, |p.1 * n + p.2 * n'| ≤ (R : ℤ) + have hsymm : ∀ ⦃n n'⦄, Bad n n' → Bad n' n := by + intro n n' h + obtain ⟨⟨v, v'⟩, hf, hsmall⟩ := h + have hp := Finset.mem_filter.mp hf + have hi := Finset.mem_product.mp hp.1 + refine ⟨(v', v), Finset.mem_filter.mpr ?_, ?_⟩ + · exact ⟨Finset.mem_product.mpr ⟨hi.2, hi.1⟩, hp.2.2, hp.2.1⟩ + · simpa only [add_comm] using hsmall + have hFcard : F.card ≤ (2 * H + 1) ^ 2 := by + have hI : I.card = 2 * H + 1 := by + dsimp [I] + rw [Int.card_Icc] + omega + calc + F.card ≤ (I.product I).card := Finset.card_filter_le _ _ + _ = (2 * H + 1) ^ 2 := by + change (I ×ˢ I).card = _ + rw [Finset.card_product, hI, pow_two] + have hdegree : ∀ n ∈ s, (s.filter (Bad n)).card ≤ + (2 * H + 1) ^ 2 * (2 * R + 1) := by + intro n hn + have hcover : s.filter (Bad n) ⊆ + F.biUnion (fun p => s.filter (fun n' => |p.1 * n + p.2 * n'| ≤ (R : ℤ))) := by + intro n' hn' + obtain ⟨hns, p, hp, hsmall⟩ := Finset.mem_filter.mp hn' + exact Finset.mem_biUnion.mpr ⟨p, hp, Finset.mem_filter.mpr ⟨hns, hsmall⟩⟩ + calc + (s.filter (Bad n)).card ≤ + (F.biUnion (fun p => s.filter (fun n' => |p.1 * n + p.2 * n'| ≤ (R : ℤ)))).card := + Finset.card_le_card hcover + _ ≤ F.card * (2 * R + 1) := by + apply Finset.card_biUnion_le_card_mul + intro p hp + exact card_small_affine_le s (p.1 * n) p.2 (Finset.mem_filter.mp hp).2.2 R + _ ≤ (2 * H + 1) ^ 2 * (2 * R + 1) := Nat.mul_le_mul_right _ hFcard + obtain ⟨t, hts, hpair, hcard⟩ := + exists_separated_subset s Bad hsymm ((2 * H + 1) ^ 2 * (2 * R + 1)) hdegree + refine ⟨t, hts, hcard, ?_⟩ + intro n hn n' hn' hne v v' hv hv' hnonzero + have hnR := hs n (hts hn) + have hnR' := hs n' (hts hn') + have hn0 : 0 ≤ n := by omega + have hn0' : 0 ≤ n' := by omega + by_cases hv0 : v = 0 + · have hvn : v' ≠ 0 := hnonzero.resolve_left (not_not.mpr hv0) + have hmul := mul_le_mul_of_nonneg_right (Int.one_le_abs hvn) hn0' + rw [one_mul] at hmul + simpa only [hv0, zero_mul, zero_add, abs_mul, abs_of_nonneg hn0'] using hnR'.trans_le hmul + by_cases hv0' : v' = 0 + · have hmul := mul_le_mul_of_nonneg_right (Int.one_le_abs hv0) hn0 + rw [one_mul] at hmul + simpa only [hv0', zero_mul, add_zero, abs_mul, abs_of_nonneg hn0] using hnR.trans_le hmul + apply lt_of_not_ge + intro hsmall + apply hpair hn hn' hne + refine ⟨(v, v'), Finset.mem_filter.mpr ?_, hsmall⟩ + exact ⟨Finset.mem_product.mpr + ⟨Finset.mem_Icc.mpr (abs_le.mp hv), Finset.mem_Icc.mpr (abs_le.mp hv')⟩, + hv0, hv0'⟩ + +theorem deletion_budget_le {m N : ℕ} (hm : 1 ≤ m) (hN : N ≤ m ^ 2) : + (2 * m ^ 300 + 1) ^ 2 * (2 * (N * m ^ 1000) + 1) + 1 ≤ + 28 * m ^ 1602 := by + have h300 : 1 ≤ m ^ 300 := one_le_pow₀ hm + have h1002 : 1 ≤ m ^ 1002 := one_le_pow₀ hm + have h1602 : 1 ≤ m ^ 1602 := one_le_pow₀ hm + have hR : N * m ^ 1000 ≤ m ^ 1002 := by + calc + N * m ^ 1000 ≤ m ^ 2 * m ^ 1000 := Nat.mul_le_mul_right _ hN + _ = m ^ 1002 := by rw [← pow_add] + have hH : 2 * m ^ 300 + 1 ≤ 3 * m ^ 300 := by omega + have hR' : 2 * (N * m ^ 1000) + 1 ≤ 3 * m ^ 1002 := by omega + calc + (2 * m ^ 300 + 1) ^ 2 * (2 * (N * m ^ 1000) + 1) + 1 ≤ + (3 * m ^ 300) ^ 2 * (3 * m ^ 1002) + 1 := by gcongr + _ = 27 * m ^ 1602 + 1 := by + simp only [mul_pow, ← pow_mul] + ring_nf + _ ≤ 28 * m ^ 1602 := by omega + +theorem quarter_le_card_interval {Q : ℝ} (hQ : 4 ≤ Q) : + Q / 4 ≤ ((Finset.Icc (⌈Q / 2⌉ : ℤ) ⌊Q⌋).card : ℝ) := by + have hi : (⌊Q⌋ : ℤ) + 1 - ⌈Q / 2⌉ ≤ + ((Finset.Icc (⌈Q / 2⌉ : ℤ) ⌊Q⌋).card : ℤ) := by + rw [Int.card_Icc] + exact Int.self_le_toNat _ + have hr : (⌊Q⌋ : ℝ) + 1 - (⌈Q / 2⌉ : ℝ) ≤ + ((Finset.Icc (⌈Q / 2⌉ : ℤ) ⌊Q⌋).card : ℝ) := by exact_mod_cast hi + have hf := Int.lt_floor_add_one Q + have hc := Int.ceil_lt_add_one (Q / 2) + linarith + +theorem eventually_exists_sampling_powers : + ∀ᶠ m : ℕ in atTop, ∀ N : ℕ, N ≤ m ^ 2 → + ∃ t : Finset ℤ, + (∀ n ∈ t, (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 ≤ n ∧ + (n : ℝ) ≤ (m : ℝ) ^ ((7 / 10 : ℝ) * m)) ∧ + (m : ℝ) ^ ((69 / 100 : ℝ) * m) ≤ (t.card : ℝ) ∧ + (∀ n ∈ t, 0 < n) ∧ + ∀ n ∈ t, ∀ n' ∈ t, n ≠ n' → ∀ v v' : ℤ, + |v| ≤ (m ^ 300 : ℕ) → |v'| ≤ (m ^ 300 : ℕ) → + (v ≠ 0 ∨ v' ≠ 0) → (N * m ^ 1000 : ℕ) < |v * n + v' * n'| := by + have hm : Tendsto (fun m : ℕ => (m : ℝ)) atTop atTop := + tendsto_natCast_atTop_atTop + have hcount := eventually_power_gap hm 112 (69 / 100) (7 / 10) 1602 (by norm_num) + have hgrowth := eventually_power_gap hm 4 0 (7 / 10) 1002 (by norm_num) + filter_upwards [hcount, hgrowth, eventually_ge_atTop 20] with m hcount hgrowth hm20 + intro N hN + have hmone : 1 ≤ m := by omega + have hmpos : (0 : ℝ) < m := by exact_mod_cast (show 0 < m by omega) + let Q : ℝ := (m : ℝ) ^ ((7 / 10 : ℝ) * m) + let s : Finset ℤ := Finset.Icc (⌈Q / 2⌉ : ℤ) ⌊Q⌋ + have hQpos : 0 < Q := Real.rpow_pos_of_pos hmpos _ + have hQlarge : 4 ≤ Q := by + have hp : 1 ≤ (m : ℝ) ^ (1002 : ℝ) := + Real.one_le_rpow (by exact_mod_cast hmone) (by norm_num) + simp only [zero_mul, Real.rpow_zero, mul_one] at hgrowth + dsimp [Q] + linarith + have hR : N * m ^ 1000 ≤ m ^ 1002 := by + calc + N * m ^ 1000 ≤ m ^ 2 * m ^ 1000 := Nat.mul_le_mul_right _ hN + _ = m ^ 1002 := by rw [← pow_add] + have hRreal : (N * m ^ 1000 : ℕ) ≤ (m : ℝ) ^ (1002 : ℝ) := by + rw [show (1002 : ℝ) = ((1002 : ℕ) : ℝ) by norm_num, Real.rpow_natCast] + exact_mod_cast hR + have hRlt : ((N * m ^ 1000 : ℕ) : ℝ) < Q / 2 := by + have hp := Real.rpow_pos_of_pos hmpos (1002 : ℝ) + simp only [zero_mul, Real.rpow_zero, mul_one] at hgrowth + dsimp [Q] + linarith + have hinterval : ∀ n ∈ s, Q / 2 ≤ (n : ℝ) ∧ (n : ℝ) ≤ Q := by + intro n hn + have hmem := Finset.mem_Icc.mp hn + constructor + · exact (Int.le_ceil (Q / 2)).trans (by exact_mod_cast hmem.1) + · exact (show (n : ℝ) ≤ (⌊Q⌋ : ℝ) by exact_mod_cast hmem.2).trans (Int.floor_le Q) + obtain ⟨t, hts, hcard, hsep⟩ := + exists_frequency_separated_subset s (m ^ 300) (N * m ^ 1000) (by + intro n hn + have h := hRlt.trans_le (hinterval n hn).1 + exact_mod_cast h) + have hcardreal : (s.card : ℝ) ≤ (t.card : ℝ) * + (((2 * m ^ 300 + 1) ^ 2 * (2 * (N * m ^ 1000) + 1) + 1 : ℕ) : ℝ) := + by exact_mod_cast hcard + have hbudget : (((2 * m ^ 300 + 1) ^ 2 * (2 * (N * m ^ 1000) + 1) + 1 : ℕ) : ℝ) ≤ + 28 * (m : ℝ) ^ (1602 : ℝ) := by + rw [show (1602 : ℝ) = ((1602 : ℕ) : ℝ) by norm_num, Real.rpow_natCast] + exact_mod_cast deletion_budget_le hmone hN + have hcountlower : 28 * (m : ℝ) ^ (1602 : ℝ) * + (m : ℝ) ^ ((69 / 100 : ℝ) * m) ≤ (s.card : ℝ) := by + have hc := quarter_le_card_interval hQlarge + change Q / 4 ≤ (s.card : ℝ) at hc + dsimp [Q] at hc + linarith + have hselected : (m : ℝ) ^ ((69 / 100 : ℝ) * m) ≤ (t.card : ℝ) := by + have hbound := hcardreal.trans (mul_le_mul_of_nonneg_left hbudget (Nat.cast_nonneg t.card)) + have hp : 0 < 28 * (m : ℝ) ^ (1602 : ℝ) := by positivity + apply le_of_mul_le_mul_left _ hp + calc + 28 * (m : ℝ) ^ (1602 : ℝ) * (m : ℝ) ^ ((69 / 100 : ℝ) * m) ≤ + (s.card : ℝ) := hcountlower + _ ≤ 28 * (m : ℝ) ^ (1602 : ℝ) * (t.card : ℝ) := by + simpa only [mul_comm] using hbound + refine ⟨t, (fun n hn => hinterval n (hts hn)), hselected, ?_, hsep⟩ + intro n hn + have h := (half_pos hQpos).trans_le (hinterval n (hts hn)).1 + exact_mod_cast h + +theorem eventually_exists_nat_sampling_powers : + ∀ᶠ m : ℕ in atTop, ∀ N : ℕ, N ≤ m ^ 2 → + ∃ t : Finset ℕ, + (∀ n ∈ t, (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 ≤ n ∧ + (n : ℝ) ≤ (m : ℝ) ^ ((7 / 10 : ℝ) * m)) ∧ + (m : ℝ) ^ ((69 / 100 : ℝ) * m) ≤ (t.card : ℝ) ∧ + (∀ n ∈ t, 0 < n) ∧ + ∀ n ∈ t, ∀ n' ∈ t, n ≠ n' → ∀ v v' : ℤ, + |v| ≤ (m ^ 300 : ℕ) → |v'| ≤ (m ^ 300 : ℕ) → + (v ≠ 0 ∨ v' ≠ 0) → + (N * m ^ 1000 : ℕ) < |v * (n : ℤ) + v' * (n' : ℤ)| := by + classical + filter_upwards [eventually_exists_sampling_powers] with m hm + intro N hN + obtain ⟨t, hrange, hcard, hpos, hsep⟩ := hm N hN + have hcast : ∀ n ∈ t, (n.toNat : ℤ) = n := by + intro n hn + exact Int.toNat_of_nonneg (hpos n hn).le + have hcastReal : ∀ n ∈ t, (n.toNat : ℝ) = (n : ℝ) := by + intro n hn + exact_mod_cast hcast n hn + have hcardImage : (t.image Int.toNat).card = t.card := by + apply Finset.card_image_iff.mpr + intro a ha b hb hab + have h := congrArg (fun n : ℕ => (n : ℤ)) hab + simpa only [hcast a ha, hcast b hb] using h + refine ⟨t.image Int.toNat, ?_, ?_, ?_, ?_⟩ + · intro n hn + obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hn + simpa only [hcastReal z hz] using hrange z hz + · simpa only [hcardImage] using hcard + · intro n hn + obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hn + have hzpos := hpos z hz + omega + · intro n hn n' hn' hne v v' hv hv' hvv + obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hn + obtain ⟨z', hz', rfl⟩ := Finset.mem_image.mp hn' + have hzz : z ≠ z' := by intro h; exact hne (congrArg Int.toNat h) + simpa only [hcast z hz, hcast z' hz'] using hsep z hz z' hz' hzz v v' hv hv' hvv + +theorem exists_frequency_separated_nat_subset (s : Finset ℕ) (H R : ℕ) + (hs : ∀ n ∈ s, R < n) : + ∃ t : Finset ℕ, t ⊆ s ∧ + s.card ≤ t.card * ((2 * H + 1) ^ 2 * (2 * R + 1) + 1) ∧ + ∀ n ∈ t, ∀ n' ∈ t, n ≠ n' → ∀ v v' : ℤ, + |v| ≤ (H : ℤ) → |v'| ≤ (H : ℤ) → (v ≠ 0 ∨ v' ≠ 0) → + (R : ℤ) < |v * (n : ℤ) + v' * (n' : ℤ)| := by + classical + obtain ⟨u, hus, hcard, hsep⟩ := + exists_frequency_separated_subset (s.image (fun n : ℕ => (n : ℤ))) H R (by + intro n hn + obtain ⟨k, hk, rfl⟩ := Finset.mem_image.mp hn + exact_mod_cast hs k hk) + have hnonneg : ∀ n ∈ u, 0 ≤ n := by + intro n hn + obtain ⟨k, hk, rfl⟩ := Finset.mem_image.mp (hus hn) + exact Int.natCast_nonneg k + have hcast : ∀ n ∈ u, (n.toNat : ℤ) = n := + fun n hn => Int.toNat_of_nonneg (hnonneg n hn) + have hcardu : (u.image Int.toNat).card = u.card := by + apply Finset.card_image_iff.mpr + intro a ha b hb hab + have h := congrArg (fun n : ℕ => (n : ℤ)) hab + simpa only [hcast a ha, hcast b hb] using h + have hcards : (s.image (fun n : ℕ => (n : ℤ))).card = s.card := + Finset.card_image_of_injective _ (by intro a b h; change (a : ℤ) = (b : ℤ) at h; omega) + refine ⟨u.image Int.toNat, ?_, ?_, ?_⟩ + · intro n hn + obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hn + obtain ⟨k, hk, rfl⟩ := Finset.mem_image.mp (hus hz) + simpa using hk + · simpa only [hcardu, hcards] using hcard + · intro n hn n' hn' hne v v' hv hv' hvv + obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hn + obtain ⟨z', hz', rfl⟩ := Finset.mem_image.mp hn' + have hzz : z ≠ z' := by intro h; exact hne (congrArg Int.toNat h) + simpa only [hcast z hz, hcast z' hz'] using hsep z hz z' hz' hzz v v' hv hv' hvv + +theorem eventually_select_from_supply (c : ℝ) (hc : 0 < c) : + ∀ᶠ m : ℕ in atTop, ∀ N : ℕ, N ≤ m ^ 2 → ∀ s : Finset ℕ, + (∀ n ∈ s, N * m ^ 1000 < n) → + c * (m : ℝ) ^ ((7 / 10 : ℝ) * m) ≤ (s.card : ℝ) → + ∃ t : Finset ℕ, t ⊆ s ∧ + (m : ℝ) ^ ((69 / 100 : ℝ) * m) ≤ (t.card : ℝ) ∧ + ∀ n ∈ t, ∀ n' ∈ t, n ≠ n' → ∀ v v' : ℤ, + |v| ≤ (m ^ 300 : ℕ) → |v'| ≤ (m ^ 300 : ℕ) → + (v ≠ 0 ∨ v' ≠ 0) → + (N * m ^ 1000 : ℕ) < |v * (n : ℤ) + v' * (n' : ℤ)| := by + have hm : Tendsto (fun m : ℕ => (m : ℝ)) atTop atTop := tendsto_natCast_atTop_atTop + have hgap := eventually_power_gap hm (28 / c) (69 / 100) (7 / 10) 1602 (by norm_num) + filter_upwards [hgap, eventually_ge_atTop 1] with m hgap hmone + intro N hN s hs hsize + obtain ⟨t, hts, hcard, hsep⟩ := + exists_frequency_separated_nat_subset s (m ^ 300) (N * m ^ 1000) hs + have hmpos : (0 : ℝ) < m := by exact_mod_cast (show 0 < m by omega) + have hbudget : (((2 * m ^ 300 + 1) ^ 2 * (2 * (N * m ^ 1000) + 1) + 1 : ℕ) : ℝ) ≤ + 28 * (m : ℝ) ^ (1602 : ℝ) := by + rw [show (1602 : ℝ) = ((1602 : ℕ) : ℝ) by norm_num, Real.rpow_natCast] + exact_mod_cast deletion_budget_le hmone hN + have hcardreal : (s.card : ℝ) ≤ (t.card : ℝ) * + (((2 * m ^ 300 + 1) ^ 2 * (2 * (N * m ^ 1000) + 1) + 1 : ℕ) : ℝ) := + by exact_mod_cast hcard + have hlower : 28 * (m : ℝ) ^ (1602 : ℝ) * + (m : ℝ) ^ ((69 / 100 : ℝ) * m) ≤ (s.card : ℝ) := by + calc + _ = c * ((28 / c) * (m : ℝ) ^ (1602 : ℝ) * + (m : ℝ) ^ ((69 / 100 : ℝ) * m)) := by field_simp + _ ≤ c * (m : ℝ) ^ ((7 / 10 : ℝ) * m) := mul_le_mul_of_nonneg_left hgap hc.le + _ ≤ (s.card : ℝ) := hsize + refine ⟨t, hts, ?_, hsep⟩ + have hp : 0 < 28 * (m : ℝ) ^ (1602 : ℝ) := by positivity + apply le_of_mul_le_mul_left _ hp + calc + _ ≤ (s.card : ℝ) := hlower + _ ≤ (t.card : ℝ) * (28 * (m : ℝ) ^ (1602 : ℝ)) := + hcardreal.trans (mul_le_mul_of_nonneg_left hbudget (Nat.cast_nonneg t.card)) + _ = _ := by ring + +end Invariant233.SeparatedPowers + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/SeparatingVectorStrongConvergence.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/SeparatingVectorStrongConvergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..a3e49c886d4a5355b82d4e6102a8859e3910e8d7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/SeparatingVectorStrongConvergence.lean @@ -0,0 +1,100 @@ +import OAI.Analysis.IrrationalRotation.Operators.StrongOperatorConvergence +import OAI.Analysis.IrrationalRotation.Operators.TracialVectorSeparating + +namespace OAI + +noncomputable section +open Filter +open scoped Topology + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem commutant_cyclic_span_of_separating (M : VonNeumannAlgebra H) (ξ : H) + (hsep : ∀ A : H →L[ℂ] H, A ∈ M → A ξ = 0 → A = 0) : + (Submodule.span ℂ (Set.range (fun B : M.commutant => + (B : H →L[ℂ] H) ξ))).topologicalClosure = ⊤ := by + let S := Submodule.span ℂ (Set.range (fun B : M.commutant => + (B : H →L[ℂ] H) ξ)) + let K := S.topologicalClosure + have hinv (B : H →L[ℂ] H) (hB : B ∈ M.commutant) : + S ∈ Module.End.invtSubmodule B := by + intro x hx + change B x ∈ S + induction hx using Submodule.span_induction with + | mem x hx => + obtain ⟨C, rfl⟩ := hx + exact Submodule.subset_span ⟨⟨B * C, mul_mem hB C.property⟩, rfl⟩ + | zero => simpa only [map_zero] using S.zero_mem + | add x y hx hy ihx ihy => simpa only [map_add] using S.add_mem ihx ihy + | smul c x hx ih => simpa only [map_smul] using S.smul_mem c ih + have hp : K.starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff + (isStarProjection_starProjection (U := K)) M).mpr + intro B hB + rw [Submodule.range_starProjection] + exact Submodule.topologicalClosure_mem_invtSubmodule (hinv B hB) + have hξ : ξ ∈ K := by + apply S.le_topologicalClosure + exact Submodule.subset_span ⟨1, by simp⟩ + have hpξ : K.starProjection ξ = ξ := K.starProjection_eq_self_iff.mpr hξ + have hzero : (1 - K.starProjection : H →L[ℂ] H) = 0 := by + apply hsep _ (sub_mem (one_mem M) hp) + change ξ - K.starProjection ξ = 0 + rw [hpξ, sub_self] + have hpone : K.starProjection = 1 := (sub_eq_zero.mp hzero).symm + apply top_unique + intro x hx + have hmem := K.starProjection_apply_mem x + simpa only [hpone, one_apply_eq_self] using hmem + +theorem strong_tendsto_of_commutant_cyclic_of_bounded + {ι : Type*} {l : Filter ι} (M : VonNeumannAlgebra H) (ξ : H) + (hcyclic : (Submodule.span ℂ (Set.range (fun B : M.commutant => + (B : H →L[ℂ] H) ξ))).topologicalClosure = ⊤) + {A : ι → H →L[ℂ] H} {A₀ : H →L[ℂ] H} {C : ℝ} + (hA : ∀ i, A i ∈ M) (hA₀ : A₀ ∈ M) + (hξ : Tendsto (fun i => A i ξ) l (𝓝 (A₀ ξ))) + (hC : ∀ᶠ i in l, ‖A i‖ ≤ C) (v : H) : + Tendsto (fun i => A i v) l (𝓝 (A₀ v)) := by + apply strong_tendsto_of_dense_span_of_bounded + (Submodule.dense_iff_topologicalClosure_eq_top.mpr hcyclic) ?_ hC v + intro B + have hcomm (i : ι) : A i ((B : H →L[ℂ] H) ξ) = (B : H →L[ℂ] H) (A i ξ) := + congrArg (fun T : H →L[ℂ] H => T ξ) + ((VonNeumannAlgebra.mem_commutant_iff.mp B.property) (A i) (hA i)) + have hcomm₀ : A₀ ((B : H →L[ℂ] H) ξ) = (B : H →L[ℂ] H) (A₀ ξ) := + congrArg (fun T : H →L[ℂ] H => T ξ) + ((VonNeumannAlgebra.mem_commutant_iff.mp B.property) A₀ hA₀) + simp only [hcomm, hcomm₀] + exact B.val.continuous.continuousAt.tendsto.comp hξ + +theorem strong_tendsto_of_separating_of_bounded + {ι : Type*} {l : Filter ι} (M : VonNeumannAlgebra H) (ξ : H) + (hsep : ∀ A : H →L[ℂ] H, A ∈ M → A ξ = 0 → A = 0) + {A : ι → H →L[ℂ] H} {A₀ : H →L[ℂ] H} {C : ℝ} + (hA : ∀ i, A i ∈ M) (hA₀ : A₀ ∈ M) + (hξ : Tendsto (fun i => A i ξ) l (𝓝 (A₀ ξ))) + (hC : ∀ᶠ i in l, ‖A i‖ ≤ C) (v : H) : + Tendsto (fun i => A i v) l (𝓝 (A₀ v)) := + strong_tendsto_of_commutant_cyclic_of_bounded M ξ + (commutant_cyclic_span_of_separating M ξ hsep) hA hA₀ hξ hC v + +theorem IsFaithfulTracialVector.strong_tendsto_of_bounded + {ι : Type*} {l : Filter ι} {M : VonNeumannAlgebra H} {ξ : H} + (htrace : IsFaithfulTracialVector M ξ) + {A : ι → H →L[ℂ] H} {A₀ : H →L[ℂ] H} {C : ℝ} + (hA : ∀ i, A i ∈ M) (hA₀ : A₀ ∈ M) + (hξ : Tendsto (fun i => A i ξ) l (𝓝 (A₀ ξ))) + (hC : ∀ᶠ i in l, ‖A i‖ ≤ C) (v : H) : + Tendsto (fun i => A i v) l (𝓝 (A₀ v)) := + strong_tendsto_of_separating_of_bounded M ξ + (fun _ hA hz => htrace.eq_zero_of_apply_eq_zero hA hz) hA hA₀ hξ hC v + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/SimultaneousLusin.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/SimultaneousLusin.lean new file mode 100644 index 0000000000000000000000000000000000000000..d7d5e0d4870cf1964ad06e065f884c44b61aefa7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/SimultaneousLusin.lean @@ -0,0 +1,65 @@ +import Mathlib.MeasureTheory.Constructions.Polish.Basic +import Mathlib.MeasureTheory.Measure.RegularityCompacts + +namespace OAI + +open Set MeasureTheory Topology +open scoped ENNReal + +namespace Invariant233.SimultaneousLusin + +theorem continuousOn_of_finer_compact {X Y : Type*} + [t : TopologicalSpace X] [hT2 : T2Space X] [TopologicalSpace Y] + {t' : TopologicalSpace X} (hle : t' ≤ t) + {K : Set X} (hK : @IsCompact X t' K) {f : X → Y} + (hf : @Continuous X Y t' _ f) : @ContinuousOn X Y t _ f K := by + apply (@continuousOn_iff_isClosed X Y t _ f K).2 + intro s hs + have hC : @IsCompact X t' (K ∩ f ⁻¹' s) := + hK.inter_right (hs.preimage hf) + have hC' : @IsCompact X t (K ∩ f ⁻¹' s) := by + simpa only [image_id] using + (@IsCompact.image X X t' t (K ∩ f ⁻¹' s) id hC (continuous_id_of_le hle)) + exact ⟨K ∩ f ⁻¹' s, @IsCompact.isClosed X t hT2 _ hC', + by ext x; simp [and_comm]⟩ + +theorem exists_compact_continuousOn {X Y : Type*} + [t : TopologicalSpace X] [hPolish : PolishSpace X] + [m : MeasurableSpace X] [hBorel : BorelSpace X] + [TopologicalSpace Y] [MeasurableSpace Y] [OpensMeasurableSpace Y] + [SecondCountableTopology Y] (μ : Measure X) [IsFiniteMeasure μ] + {f : X → Y} (hf : Measurable f) {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ K : Set X, IsCompact K ∧ μ Kᶜ < ε ∧ ContinuousOn f K := by + obtain ⟨t', hle, hfc, hP'⟩ := hf.exists_continuous + have hB' : @BorelSpace X t' m := by + constructor + exact hBorel.measurable_eq.trans + (MeasureTheory.borel_eq_borel_of_le hP' hPolish hle).symm + let : TopologicalSpace X := t' + let : PolishSpace X := hP' + let : BorelSpace X := hB' + obtain ⟨K, -, hK, hsmall⟩ := + (MeasurableSet.univ : MeasurableSet (Set.univ : Set X)).exists_isCompact_sdiff_lt + (measure_ne_top μ Set.univ) hε + have hKold : @IsCompact X t K := by + simpa only [image_id] using + (@IsCompact.image X X t' t K id hK (continuous_id_of_le hle)) + refine ⟨K, hKold, ?_, ?_⟩ + · simpa only [← compl_eq_univ_sdiff] using hsmall + · exact @continuousOn_of_finer_compact X Y t inferInstance _ t' hle K hK f hfc + +theorem exists_compact_forall_continuousOn {X ι : Type*} {Y : ι → Type*} + [TopologicalSpace X] [PolishSpace X] [MeasurableSpace X] [BorelSpace X] + [Countable ι] + [∀ i, TopologicalSpace (Y i)] [∀ i, MeasurableSpace (Y i)] + [∀ i, OpensMeasurableSpace (Y i)] [∀ i, SecondCountableTopology (Y i)] + (μ : Measure X) [IsFiniteMeasure μ] (f : ∀ i, X → Y i) + (hf : ∀ i, Measurable (f i)) {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ K : Set X, IsCompact K ∧ μ Kᶜ < ε ∧ ∀ i, ContinuousOn (f i) K := by + have hjoint : Measurable (fun x i => f i x) := Measurable.of_eval hf + obtain ⟨K, hK, hsmall, hcont⟩ := exists_compact_continuousOn μ hjoint hε + exact ⟨K, hK, hsmall, continuousOn_pi.mp hcont⟩ + +end Invariant233.SimultaneousLusin + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/SmallSupportStrongApproximation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/SmallSupportStrongApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..feb5e71b0e8422cb71760c6b76f77c3a81d1df9e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/SmallSupportStrongApproximation.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplier +import Mathlib.Topology.Algebra.Module.Spaces.PointwiseConvergenceCLM +import Mathlib.Analysis.SpecialFunctions.Sqrt + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal Topology + +namespace Invariant233.SmallSupport + +variable {X E : Type*} [MeasurableSpace X] {μ : Measure X} + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [IsFiniteMeasure μ] + +def cutoff (s : Set X) (hs : MeasurableSet s) : Lp E 2 μ →L[ℂ] Lp E 2 μ := + L2Multiplication.multiplier (indicatorConstLp ∞ hs (measure_ne_top μ s) (1 : ℂ)) + +theorem norm_cutoff_sq (s : Set X) (hs : MeasurableSet s) (f : Lp E 2 μ) : + ‖cutoff (μ := μ) s hs f‖ ^ 2 = ∫ x in s, ‖f x‖ ^ 2 ∂μ := by + have hnorm (g : Lp E 2 μ) : ‖g‖ ^ 2 = ∫ x, ‖g x‖ ^ 2 ∂μ := by + let := InnerProductSpace.rclikeToReal ℂ E + rw [norm_sq_eq_re_inner (𝕜 := ℝ), L2.inner_def] + simp only [RCLike.re_to_real, real_inner_self_eq_norm_sq] + rw [hnorm, ← integral_indicator hs] + apply integral_congr_ae + filter_upwards [L2Multiplication.multiplier_indicator_coe s hs f] with x hx + change cutoff s hs f x = _ at hx + rw [hx] + by_cases hxs : x ∈ s <;> simp [Set.indicator, hxs] + +theorem cutoff_tendsto_apply {ι : Type*} {l : Filter ι} + (s : ι → Set X) (hs : ∀ i, MeasurableSet (s i)) + (hμ : Tendsto (fun i => μ (s i)) l (𝓝 0)) (f : Lp E 2 μ) : + Tendsto (fun i => cutoff (μ := μ) (s i) (hs i) f) l (𝓝 0) := by + have hf : Integrable (fun x => ‖f x‖ ^ 2) μ := + (memLp_two_iff_integrable_sq_norm (Lp.aestronglyMeasurable f)).mp (Lp.memLp f) + have hsq : Tendsto (fun i => ‖cutoff (μ := μ) (s i) (hs i) f‖ ^ 2) l (𝓝 0) := by + simpa only [norm_cutoff_sq] using hf.tendsto_setIntegral_nhds_zero hμ + apply tendsto_zero_iff_norm_tendsto_zero.mpr + have h := (Real.continuous_sqrt.tendsto 0).comp hsq + simpa only [Function.comp_def, Real.sqrt_sq (norm_nonneg _), Real.sqrt_zero] using h + +theorem cutoff_tendsto_strong {ι : Type*} {l : Filter ι} + (s : ι → Set X) (hs : ∀ i, MeasurableSet (s i)) + (hμ : Tendsto (fun i => μ (s i)) l (𝓝 0)) : + Tendsto (fun i => + UniformConvergenceCLM.ofFun (RingHom.id ℂ) (Lp E 2 μ) + {t : Set (Lp E 2 μ) | t.Finite} (cutoff (μ := μ) (s i) (hs i))) + l (𝓝 0) := by + apply PointwiseConvergenceCLM.tendsto_iff_forall_tendsto.mpr + intro f + exact cutoff_tendsto_apply s hs hμ f + +section SupportedErrors +variable {H ι : Type*} [NormedAddCommGroup H] [NormedSpace ℂ H] + +theorem norm_error_le_of_right_supported + (A B P : H →L[ℂ] H) {C : ℝ} (hbound : ‖A - B‖ ≤ C) + (hsupport : (A - B) * (1 - P) = 0) (v : H) : + ‖A v - B v‖ ≤ C * ‖P v‖ := by + have heq : A - B = (A - B) * P := by + simpa only [mul_sub, mul_one, sub_eq_zero] using hsupport + have hv : A v - B v = (A - B) (P v) := + DFunLike.congr_fun heq v + rw [hv] + exact ((A - B).le_opNorm (P v)).trans + (mul_le_mul_of_nonneg_right hbound (norm_nonneg _)) + +theorem tendsto_apply_of_right_supported + {l : Filter ι} (A : ι → H →L[ℂ] H) (B : H →L[ℂ] H) + (P : ι → H →L[ℂ] H) {C : ℝ} + (hbound : ∀ᶠ i in l, ‖A i - B‖ ≤ C) + (hsupport : ∀ᶠ i in l, (A i - B) * (1 - P i) = 0) + (hP : ∀ v, Tendsto (fun i => P i v) l (𝓝 0)) (v : H) : + Tendsto (fun i => A i v) l (𝓝 (B v)) := by + have hnorm : Tendsto (fun i => C * ‖P i v‖) l (𝓝 0) := by + simpa using (hP v).norm.const_mul C + have herr : Tendsto (fun i => A i v - B v) l (𝓝 0) := by + apply squeeze_zero_norm' _ hnorm + filter_upwards [hbound, hsupport] with i hi hsi + exact norm_error_le_of_right_supported (A i) B (P i) hi hsi v + simpa only [sub_add_cancel, zero_add] using herr.add_const (B v) + +end SupportedErrors +end Invariant233.SmallSupport + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/SmoothingTopologicalSupport.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/SmoothingTopologicalSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..7b5a508050fb0db74721a40cc4f85b7fb8db99ea --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/SmoothingTopologicalSupport.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CircleSmoothing + +namespace OAI + +namespace InvariantProjection.Continuity + +open MeasureTheory Set Metric +local notation "Circle" => AddCircle (1 : ℝ) +local notation "rep" => (fun x : Circle => (AddCircle.equivIco (1 : ℝ) 0 x : ℝ)) + +private theorem dist_coe_le_abs (u v : ℝ) : + dist (u : Circle) (v : Circle) ≤ |u - v| := by + rw [dist_eq_norm, ← AddCircle.coe_sub] + exact QuotientAddGroup.norm_mk_le_norm + +theorem tsupport_circleSmoothedDrop_subset_closedBall {a δ : ℝ} (C : ℝ) + (ha : 0 ≤ a) (hδ : 0 < δ) : + tsupport (circleSmoothedDrop C a δ) ⊆ + closedBall ((-a / 2 : ℝ) : Circle) (a / 2 + δ) := by + apply closure_minimal _ isClosed_closedBall + intro x hx + have hu : rep x ∈ Ico (0 : ℝ) 1 := by + simpa using (AddCircle.equivIco (1 : ℝ) 0 x).property + have hfrac : Int.fract (rep x) = rep x := Int.fract_eq_self.mpr hu + have hout : rep x ≤ δ ∨ 1 - a - δ ≤ rep x := by + by_contra hn + push Not at hn + apply hx + rw [circleSmoothedDrop_eq_representative] + exact smoothedDrop_eq_zero_of_middle C ha hδ + (by rw [hfrac]; linarith) (by rw [hfrac]; linarith) + rcases hout with hl | hr + · change dist x ((-a / 2 : ℝ) : Circle) ≤ _ + calc + _ = dist ((rep x : ℝ) : Circle) ((-a / 2 : ℝ) : Circle) := by + rw [AddCircle.coe_equivIco] + _ ≤ |rep x - -a / 2| := dist_coe_le_abs _ _ + _ ≤ a / 2 + δ := by rw [abs_le]; constructor <;> linarith [hu.1] + · have hrep : ((rep x - 1 : ℝ) : Circle) = x := by + rw [AddCircle.coe_sub, AddCircle.coe_period, sub_zero, AddCircle.coe_equivIco] + change dist x ((-a / 2 : ℝ) : Circle) ≤ _ + calc + _ = dist ((rep x - 1 : ℝ) : Circle) ((-a / 2 : ℝ) : Circle) := by rw [hrep] + _ ≤ |rep x - 1 - -a / 2| := dist_coe_le_abs _ _ + _ ≤ a / 2 + δ := by rw [abs_le]; constructor <;> linarith [hu.2] + +theorem measure_tsupport_circleSmoothedDrop_le {a δ : ℝ} (C : ℝ) + (ha : 0 ≤ a) (hδ : 0 < δ) : + volume (tsupport (circleSmoothedDrop C a δ)) ≤ ENNReal.ofReal (a + 2 * δ) := by + calc + _ ≤ volume (closedBall ((-a / 2 : ℝ) : Circle) (a / 2 + δ)) := + measure_mono (tsupport_circleSmoothedDrop_subset_closedBall C ha hδ) + _ ≤ ENNReal.ofReal (a + 2 * δ) := by + rw [AddCircle.volume_closedBall] + apply ENNReal.ofReal_le_ofReal + calc + min (1 : ℝ) (2 * (a / 2 + δ)) ≤ 2 * (a / 2 + δ) := min_le_right _ _ + _ = a + 2 * δ := by ring + +theorem measure_tsupport_characterSmoothedDrop_le {a δ : ℝ} (C : ℝ) + (ha : 0 ≤ a) (hδ : 0 < δ) {q : ℤ} (hq : q ≠ 0) : + volume (tsupport (fun x : Circle => circleSmoothedDrop C a δ (q • x))) ≤ + ENNReal.ofReal (a + 2 * δ) := by + have hp := Measure.measurePreserving_zsmul (volume : Measure Circle) hq + calc + _ ≤ volume ((fun x : Circle => q • x) ⁻¹' tsupport (circleSmoothedDrop C a δ)) := + measure_mono (tsupport_comp_subset_preimage _ (continuous_id.zsmul q)) + _ = volume (tsupport (circleSmoothedDrop C a δ)) := + hp.measure_preimage (isClosed_tsupport _).measurableSet.nullMeasurableSet + _ ≤ _ := measure_tsupport_circleSmoothedDrop_le C ha hδ + +end InvariantProjection.Continuity + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/SquaredIntegralLp.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/SquaredIntegralLp.lean new file mode 100644 index 0000000000000000000000000000000000000000..1295363d328b3ca56c94f1e1f44018cbc5bf8fb6 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/SquaredIntegralLp.lean @@ -0,0 +1,115 @@ +import Mathlib.MeasureTheory.Function.LpSeminorm.Basic +import Mathlib.MeasureTheory.Integral.Bochner.Basic +import Mathlib.Analysis.SpecialFunctions.Pow.Continuity + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal Topology + +namespace Invariant233.SquaredIntegralLp + +theorem eLpNorm'_two_eq_lintegral_sq_rpow + {X : Type*} [MeasurableSpace X] (μ : Measure X) (f : X → ℝ) : + eLpNorm' f 2 μ = (∫⁻ x, ENNReal.ofReal (f x ^ 2) ∂μ) ^ (1 / 2 : ℝ) := by + rw [eLpNorm'_eq_lintegral_enorm] + congr 1 + apply lintegral_congr + intro x + rw [ENNReal.rpow_two, Real.enorm_eq_ofReal_abs, ← ENNReal.ofReal_pow (abs_nonneg _)] + rw [sq_abs] + +theorem eLpNorm'_two_eq_ofReal_integral_sq_rpow + {X : Type*} [MeasurableSpace X] (μ : Measure X) (f : X → ℝ) + (hf : Integrable (fun x => f x ^ 2) μ) : + eLpNorm' f 2 μ = ENNReal.ofReal (∫ x, f x ^ 2 ∂μ) ^ (1 / 2 : ℝ) := by + rw [eLpNorm'_two_eq_lintegral_sq_rpow, + ofReal_integral_eq_lintegral_ofReal hf (Eventually.of_forall fun x => sq_nonneg (f x))] + +theorem eLpNorm'_two_lt_ofReal_iff_integral_sq_lt + {X : Type*} [MeasurableSpace X] (μ : Measure X) (f : X → ℝ) + (hf : Integrable (fun x => f x ^ 2) μ) {δ : ℝ} (hδ : 0 < δ) : + eLpNorm' f 2 μ < ENNReal.ofReal δ ↔ (∫ x, f x ^ 2 ∂μ) < δ ^ 2 := by + rw [eLpNorm'_two_eq_ofReal_integral_sq_rpow μ f hf, one_div, + ENNReal.rpow_inv_lt_iff (by norm_num : (0 : ℝ) < 2), ENNReal.rpow_two, + ← ENNReal.ofReal_pow hδ.le] + exact ENNReal.ofReal_lt_ofReal_iff (sq_pos_of_pos hδ) + +theorem tendsto_eLpNorm'_two_of_lintegral_sq + {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + (μ : Measure X) (ν : Measure Y) (f : ℕ → X → ℝ) (g : Y → ℝ) + (h : Tendsto (fun n => ∫⁻ x, ENNReal.ofReal (f n x ^ 2) ∂μ) atTop + (𝓝 (∫⁻ y, ENNReal.ofReal (g y ^ 2) ∂ν))) : + Tendsto (fun n => eLpNorm' (f n) 2 μ) atTop (𝓝 (eLpNorm' g 2 ν)) := by + simpa only [eLpNorm'_two_eq_lintegral_sq_rpow] using h.ennrpow_const (1 / 2 : ℝ) + +theorem tendsto_eLpNorm'_two_of_integral_sq + {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + (μ : Measure X) (ν : Measure Y) (f : ℕ → X → ℝ) (g : Y → ℝ) + (hf : ∀ n, Integrable (fun x => f n x ^ 2) μ) + (hg : Integrable (fun y => g y ^ 2) ν) + (h : Tendsto (fun n => ∫ x, f n x ^ 2 ∂μ) atTop + (𝓝 (∫ y, g y ^ 2 ∂ν))) : + Tendsto (fun n => eLpNorm' (f n) 2 μ) atTop (𝓝 (eLpNorm' g 2 ν)) := by + have hreal := (ENNReal.continuous_ofReal.tendsto _).comp h + have hp := hreal.ennrpow_const (1 / 2 : ℝ) + simpa only [eLpNorm'_two_eq_ofReal_integral_sq_rpow μ _ (hf _), + eLpNorm'_two_eq_ofReal_integral_sq_rpow ν _ hg, Function.comp_def] using hp + +theorem eLpNorm_two_eq_lintegral_sq_rpow + {X : Type*} [MeasurableSpace X] (μ : Measure X) (f : X → ℝ) + (hfm : AEStronglyMeasurable f μ) : + eLpNorm f 2 μ = (∫⁻ x, ENNReal.ofReal (f x ^ 2) ∂μ) ^ (1 / 2 : ℝ) := by + rw [eLpNorm_eq_eLpNorm' (by norm_num) (by norm_num) hfm] + simpa only [ENNReal.toReal_ofNat] using eLpNorm'_two_eq_lintegral_sq_rpow μ f + +theorem eLpNorm_two_eq_ofReal_integral_sq_rpow + {X : Type*} [MeasurableSpace X] (μ : Measure X) (f : X → ℝ) + (hfm : AEStronglyMeasurable f μ) + (hf : Integrable (fun x => f x ^ 2) μ) : + eLpNorm f 2 μ = ENNReal.ofReal (∫ x, f x ^ 2 ∂μ) ^ (1 / 2 : ℝ) := by + rw [eLpNorm_two_eq_lintegral_sq_rpow μ f hfm, + ofReal_integral_eq_lintegral_ofReal hf (Eventually.of_forall fun x => sq_nonneg (f x))] + +theorem eLpNorm_two_lt_ofReal_iff_integral_sq_lt + {X : Type*} [MeasurableSpace X] (μ : Measure X) (f : X → ℝ) + (hfm : AEStronglyMeasurable f μ) + (hf : Integrable (fun x => f x ^ 2) μ) {δ : ℝ} (hδ : 0 < δ) : + eLpNorm f 2 μ < ENNReal.ofReal δ ↔ (∫ x, f x ^ 2 ∂μ) < δ ^ 2 := by + rw [eLpNorm_two_eq_ofReal_integral_sq_rpow μ f hfm hf, one_div, + ENNReal.rpow_inv_lt_iff (by norm_num : (0 : ℝ) < 2), ENNReal.rpow_two, + ← ENNReal.ofReal_pow hδ.le] + exact ENNReal.ofReal_lt_ofReal_iff (sq_pos_of_pos hδ) + +theorem tendsto_eLpNorm_two_of_lintegral_sq + {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + (μ : Measure X) (ν : Measure Y) (f : ℕ → X → ℝ) (g : Y → ℝ) + (hfm : ∀ index, AEStronglyMeasurable (f index) μ) + (hgm : AEStronglyMeasurable g ν) + (h : Tendsto (fun n => ∫⁻ x, ENNReal.ofReal (f n x ^ 2) ∂μ) atTop + (𝓝 (∫⁻ y, ENNReal.ofReal (g y ^ 2) ∂ν))) : + Tendsto (fun n => eLpNorm (f n) 2 μ) atTop (𝓝 (eLpNorm g 2 ν)) := by + simpa only [eLpNorm_two_eq_lintegral_sq_rpow μ _ (hfm _), + eLpNorm_two_eq_lintegral_sq_rpow ν _ hgm] using h.ennrpow_const (1 / 2 : ℝ) + +theorem tendsto_eLpNorm_two_of_integral_sq + {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + (μ : Measure X) (ν : Measure Y) (f : ℕ → X → ℝ) (g : Y → ℝ) + (hfm : ∀ index, AEStronglyMeasurable (f index) μ) + (hgm : AEStronglyMeasurable g ν) + (hf : ∀ n, Integrable (fun x => f n x ^ 2) μ) + (hg : Integrable (fun y => g y ^ 2) ν) + (h : Tendsto (fun n => ∫ x, f n x ^ 2 ∂μ) atTop + (𝓝 (∫ y, g y ^ 2 ∂ν))) : + Tendsto (fun n => eLpNorm (f n) 2 μ) atTop (𝓝 (eLpNorm g 2 ν)) := by + have hreal := (ENNReal.continuous_ofReal.tendsto _).comp h + have hp := hreal.ennrpow_const (1 / 2 : ℝ) + simpa only [eLpNorm_two_eq_ofReal_integral_sq_rpow μ _ (hfm _) (hf _), + eLpNorm_two_eq_ofReal_integral_sq_rpow ν _ hgm hg, Function.comp_def] using hp + +end Invariant233.SquaredIntegralLp + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/StrictlyPositiveNormalization.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrictlyPositiveNormalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..372d5e34ec8d5e291c18611aa996f19485bfcbe9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrictlyPositiveNormalization.lean @@ -0,0 +1,60 @@ +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +import Mathlib.Tactic + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra +namespace Invariant233 + +variable {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +theorem norm_one_sub_normalization_lt_one {a : A} (ha : IsStrictlyPositive a) : + ‖1 - (‖a‖ + 1)⁻¹ • a‖ < 1 := by + have hden : 0 < ‖a‖ + 1 := by positivity + have he : cfc (fun x : ℝ => 1 - (‖a‖ + 1)⁻¹ * x) a = + 1 - (‖a‖ + 1)⁻¹ • a := by + rw [cfc_sub (fun _ : ℝ => 1) (fun x : ℝ => (‖a‖ + 1)⁻¹ * x) a + (by fun_prop) (by fun_prop), cfc_const 1 a ha.isSelfAdjoint, + cfc_const_mul_id _ a ha.isSelfAdjoint] + simp + rw [← he] + apply norm_cfc_lt zero_lt_one + intro x hx + have hxpos : 0 < x := ha.spectrum_pos hx + have hxle : x ≤ ‖a‖ := + (Real.le_norm_self x).trans (IsometricContinuousFunctionalCalculus.norm_spectrum_le a hx ha.isSelfAdjoint) + have hlo : 0 < (‖a‖ + 1)⁻¹ * x := mul_pos (inv_pos.mpr hden) hxpos + have hhi : (‖a‖ + 1)⁻¹ * x < 1 := by + rw [mul_comm, ← div_eq_mul_inv] + exact (div_lt_one hden).mpr (lt_of_le_of_lt hxle (lt_add_one _)) + rw [Real.norm_eq_abs, abs_lt] + constructor <;> linarith + +theorem exists_pos_norm_one_sub_smul_lt_one {a : A} (ha : IsStrictlyPositive a) : + ∃ c : ℝ, 0 < c ∧ ‖1 - c • a‖ < 1 := + ⟨(‖a‖ + 1)⁻¹, by positivity, norm_one_sub_normalization_lt_one ha⟩ + +theorem exists_pos_normalization_uniform_nhds {a : A} (ha : IsStrictlyPositive a) : + ∃ c r : ℝ, 0 < c ∧ 0 < r ∧ r < 1 ∧ + ∀ᶠ b in 𝓝 a, ‖1 - c • b‖ < r := by + obtain ⟨c, hc, hn⟩ := exists_pos_norm_one_sub_smul_lt_one ha + obtain ⟨r, hr, hr1⟩ := exists_between hn + refine ⟨c, r, hc, (norm_nonneg _).trans_lt hr, hr1, ?_⟩ + have hcont : Continuous (fun b : A => ‖1 - c • b‖) := by fun_prop + exact hcont.continuousAt.eventually_lt continuousAt_const hr + +theorem exists_pos_normalization_uniform_along + {X : Type*} [TopologicalSpace X] {f : X → A} {x : X} + (hf : ContinuousAt f x) (ha : IsStrictlyPositive (f x)) : + ∃ c r : ℝ, 0 < c ∧ 0 < r ∧ r < 1 ∧ + ∀ᶠ y in 𝓝 x, ‖1 - c • f y‖ < r := by + obtain ⟨c, r, hc, hr, hr1, hloc⟩ := exists_pos_normalization_uniform_nhds ha + exact ⟨c, r, hc, hr, hr1, hf.eventually hloc⟩ + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongContinuityFromColumns.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongContinuityFromColumns.lean new file mode 100644 index 0000000000000000000000000000000000000000..374edaec38592846de69f49fb5b9dde217b0a030 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongContinuityFromColumns.lean @@ -0,0 +1,89 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space + +namespace OAI + +open Set Filter Topology + +namespace Invariant233.StrongContinuityFromColumns + +theorem continuous_apply_of_dense {𝕜 X E F : Type*} + [NontriviallyNormedField 𝕜] [TopologicalSpace X] + [NormedAddCommGroup E] [NormedAddCommGroup F] + [NormedSpace 𝕜 E] [NormedSpace 𝕜 F] + (A : X → E →L[𝕜] F) {C : ℝ} (hC : 0 ≤ C) + (hbound : ∀ x, ‖A x‖ ≤ C) {s : Set E} (hs : Dense s) + (hcont : ∀ v ∈ s, Continuous (fun x => A x v)) (v : E) : + Continuous (fun x => A x v) := by + rw [continuous_iff_continuousAt] + intro x + apply Metric.tendsto_nhds.mpr + intro ε hε + have hden : 0 < 3 * (C + 1) := by positivity + obtain ⟨w, hw, hvw⟩ := hs.exists_dist_lt v (div_pos hε hden) + have hvw' : C * dist v w < ε / 3 := by + have hdist : 0 ≤ dist v w := dist_nonneg + have hlt : dist v w * (3 * (C + 1)) < ε := + (lt_div_iff₀ hden).mp hvw + nlinarith + have hevent : ∀ᶠ y in 𝓝 x, dist (A y w) (A x w) < ε / 3 := + Metric.tendsto_nhds.mp (hcont w hw).continuousAt (ε / 3) (by positivity) + filter_upwards [hevent] with y hy + have hleft : dist (A y v) (A y w) ≤ C * dist v w := by + calc + dist (A y v) (A y w) ≤ ‖A y‖ * dist v w := (A y).lipschitzWith.dist_le_mul v w + _ ≤ C * dist v w := mul_le_mul_of_nonneg_right (hbound y) dist_nonneg + have hright : dist (A x w) (A x v) ≤ C * dist v w := by + calc + dist (A x w) (A x v) ≤ ‖A x‖ * dist w v := (A x).lipschitzWith.dist_le_mul w v + _ ≤ C * dist w v := mul_le_mul_of_nonneg_right (hbound x) dist_nonneg + _ = C * dist v w := by rw [dist_comm w v] + have htri := dist_triangle4 (A y v) (A y w) (A x w) (A x v) + linarith + +theorem continuous_apply_of_dense_span {𝕜 X E F ι : Type*} + [NontriviallyNormedField 𝕜] [TopologicalSpace X] + [NormedAddCommGroup E] [NormedAddCommGroup F] + [NormedSpace 𝕜 E] [NormedSpace 𝕜 F] + (A : X → E →L[𝕜] F) {C : ℝ} (hC : 0 ≤ C) + (hbound : ∀ x, ‖A x‖ ≤ C) (b : ι → E) + (hb : (Submodule.span 𝕜 (Set.range b)).topologicalClosure = ⊤) + (hcont : ∀ i, Continuous (fun x => A x (b i))) (v : E) : + Continuous (fun x => A x v) := by + apply continuous_apply_of_dense A hC hbound + (Submodule.dense_iff_topologicalClosure_eq_top.mpr hb) _ v + intro w hw + induction hw using Submodule.span_induction with + | mem w hw => + obtain ⟨i, rfl⟩ := hw + exact hcont i + | zero => simpa only [map_zero] using (continuous_const : Continuous (fun _ : X => (0 : F))) + | add w z hw hz hwc hzc => + simpa only [map_add, Pi.add_def] using hwc.add hzc + | smul c w hw hwc => + simpa only [map_smul, Pi.smul_def] using hwc.const_smul c + +theorem continuous_apply_of_hilbertBasis {𝕜 X E F ι : Type*} + [RCLike 𝕜] [TopologicalSpace X] + [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] + [NormedAddCommGroup F] [NormedSpace 𝕜 F] + (A : X → E →L[𝕜] F) {C : ℝ} (hC : 0 ≤ C) + (hbound : ∀ x, ‖A x‖ ≤ C) (b : HilbertBasis ι 𝕜 E) + (hcont : ∀ i, Continuous (fun x => A x (b i))) (v : E) : + Continuous (fun x => A x v) := + continuous_apply_of_dense_span A hC hbound b b.dense_span hcont v + +theorem continuousOn_apply_of_hilbertBasis {𝕜 X E F ι : Type*} + [RCLike 𝕜] [TopologicalSpace X] + [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] + [NormedAddCommGroup F] [NormedSpace 𝕜 F] + (A : X → E →L[𝕜] F) {C : ℝ} (hC : 0 ≤ C) {Q : Set X} + (hbound : ∀ x ∈ Q, ‖A x‖ ≤ C) (b : HilbertBasis ι 𝕜 E) + (hcont : ∀ i, ContinuousOn (fun x => A x (b i)) Q) (v : E) : + ContinuousOn (fun x => A x v) Q := by + rw [continuousOn_iff_continuous_domRestrict] + exact continuous_apply_of_hilbertBasis (fun x : Q => A x) hC + (fun x => hbound x x.property) b (fun i => (hcont i).domRestrict) v + +end Invariant233.StrongContinuityFromColumns + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongFieldContinuity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongFieldContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..8045c62276cf5d7aebc4b28615fbea5bf7b750bf --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongFieldContinuity.lean @@ -0,0 +1,119 @@ +import Mathlib.Analysis.Normed.Operator.Basic +import Mathlib.Analysis.Normed.Group.Continuity +import Mathlib.Topology.Algebra.Module.Spaces.PointwiseConvergenceCLM +import Mathlib.Topology.UniformSpace.UniformApproximation +import Mathlib.Tactic.Positivity + +namespace OAI + +namespace InvariantProjection + +open Filter Topology + +variable {𝕜 E F G ι X : Type*} +variable [NontriviallyNormedField 𝕜] +variable [NormedAddCommGroup E] [NormedSpace 𝕜 E] +variable [NormedAddCommGroup F] [NormedSpace 𝕜 F] +variable [NormedAddCommGroup G] [NormedSpace 𝕜 G] + +theorem tendsto_apply_of_strong_tendsto_of_bounded + {l : Filter ι} {A : ι → E →L[𝕜] F} {A₀ : E →L[𝕜] F} + {v : ι → E} {v₀ : E} {C : ℝ} + (hA : ∀ w, Tendsto (fun i => A i w) l (𝓝 (A₀ w))) + (hC : ∀ᶠ i in l, ‖A i‖ ≤ C) + (hv : Tendsto v l (𝓝 v₀)) : + Tendsto (fun i => A i (v i)) l (𝓝 (A₀ v₀)) := by + have hnorm : Tendsto (fun i => C * ‖v i - v₀‖) l (𝓝 0) := by + simpa using (tendsto_const_nhds : Tendsto (fun _ : ι => C) l (𝓝 C)).mul + (hv.sub_const v₀).norm + have hzero : Tendsto (fun i => A i (v i - v₀)) l (𝓝 0) := by + apply squeeze_zero_norm' _ hnorm + filter_upwards [hC] with i hi + exact ((A i).le_opNorm _).trans + (mul_le_mul_of_nonneg_right hi (norm_nonneg _)) + have hsum := hzero.add (hA v₀) + simpa only [map_sub, sub_add_cancel, zero_add] using hsum + +variable [TopologicalSpace X] + +theorem strong_continuous_of_dense_of_bounded + {A : X → E →L[𝕜] F} {s : Set E} {C : ℝ} + (hs : Dense s) (hA : ∀ w ∈ s, Continuous (fun x => A x w)) + (hC : ∀ x, ‖A x‖ ≤ C) (v : E) : + Continuous (fun x => A x v) := by + apply continuous_of_uniform_approx_of_continuous + intro u hu + obtain ⟨ε, hε, hsub⟩ := Metric.mem_uniformity_dist.mp hu + let M : ℝ := max C 0 + 1 + have hM : 0 < M := by dsimp [M]; positivity + obtain ⟨w, hw, hvw⟩ := hs.exists_dist_lt v (div_pos hε hM) + refine ⟨(fun x => A x w), hA w hw, ?_⟩ + intro x + apply hsub + calc + dist (A x v) (A x w) ≤ ‖A x‖ * dist v w := (A x).dist_le_opNorm v w + _ ≤ M * dist v w := mul_le_mul_of_nonneg_right + ((hC x).trans ((le_max_left C 0).trans (by dsimp [M]; exact le_add_of_nonneg_right zero_le_one))) + (dist_nonneg) + _ < ε := by simpa [mul_comm] using (lt_div_iff₀ hM).mp hvw + +theorem strong_continuous_of_dense_span_of_bounded + {A : X → E →L[𝕜] F} {b : ι → E} {C : ℝ} + (hb : Dense (Submodule.span 𝕜 (Set.range b) : Set E)) + (hA : ∀ i, Continuous (fun x => A x (b i))) + (hC : ∀ x, ‖A x‖ ≤ C) (v : E) : + Continuous (fun x => A x v) := by + apply strong_continuous_of_dense_of_bounded hb ?_ hC v + intro w hw + induction hw using Submodule.span_induction with + | mem w hw => + obtain ⟨i, rfl⟩ := hw + exact hA i + | zero => simpa only [map_zero] using (continuous_const : Continuous (fun _ : X => (0 : F))) + | add w z hw hz ihw ihz => + have h : Continuous (fun x => A x w + A x z) := + Continuous.add (f := fun x => A x w) (g := fun x => A x z) ihw ihz + simpa only [map_add] using h + | smul c w hw ihw => + have h : Continuous (fun x => c • A x w) := + Continuous.const_smul (g := fun x => A x w) ihw c + simpa only [map_smul] using h + +theorem continuous_apply_of_strong_continuous_of_bounded + {A : X → E →L[𝕜] F} {v : X → E} {C : ℝ} + (hA : ∀ w, Continuous (fun x => A x w)) + (hC : ∀ x, ‖A x‖ ≤ C) (hv : Continuous v) : + Continuous (fun x => A x (v x)) := by + apply continuous_iff_continuousAt.mpr + intro x + exact tendsto_apply_of_strong_tendsto_of_bounded + (fun w => (hA w).continuousAt) (Eventually.of_forall hC) hv.continuousAt + +theorem strong_continuous_comp_of_bounded + {A : X → F →L[𝕜] G} {B : X → E →L[𝕜] F} {C : ℝ} + (hA : ∀ w, Continuous (fun x => A x w)) + (hB : ∀ v, Continuous (fun x => B x v)) + (hC : ∀ x, ‖A x‖ ≤ C) (v : E) : + Continuous (fun x => ((A x).comp (B x)) v) := by + exact continuous_apply_of_strong_continuous_of_bounded + (A := A) (v := fun x => B x v) hA hC (hB v) + +theorem isClosed_zero_set_of_strong_continuous + {A : X → E →L[𝕜] F} + (hA : ∀ v, Continuous (fun x => A x v)) : + IsClosed {x | A x = 0} := by + have heq : {x | A x = 0} = ⋂ v : E, {x | A x v = 0} := by + ext x + simp only [Set.mem_ofPred_eq, Set.mem_iInter] + constructor + · intro hx v + simp [hx] + · intro hx + ext v + exact hx v + rw [heq] + exact isClosed_iInter fun v => isClosed_eq (hA v) continuous_const + +end InvariantProjection + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongFieldMeasurability.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongFieldMeasurability.lean new file mode 100644 index 0000000000000000000000000000000000000000..6aa7a7a3410dc4ff0ab5e1683b15873e97285ac9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongFieldMeasurability.lean @@ -0,0 +1,98 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Analysis.InnerProductSpace.Adjoint +import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas + +namespace OAI + +namespace Invariant233.StrongField + +open MeasureTheory Filter +open scoped Topology + +variable {X ι H F : Type*} [MeasurableSpace X] [Countable ι] + [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [NormedAddCommGroup F] [NormedSpace ℂ F] + +theorem stronglyMeasurable_apply_of_columns + (b : HilbertBasis ι ℂ H) (A : X → H →L[ℂ] F) + (hA : ∀ i, StronglyMeasurable fun x => A x (b i)) + {v : X → H} (hv : StronglyMeasurable v) : + StronglyMeasurable fun x => A x (v x) := by + classical + let approximant : Finset ι → X → F := fun s x => + ∑ i ∈ s, b.repr (v x) i • A x (b i) + have hm (s : Finset ι) : StronglyMeasurable (approximant s) := by + apply Finset.stronglyMeasurable_fun_sum + intro i hi + have hc : StronglyMeasurable fun x => b.repr (v x) i := by + simp only [b.repr_apply_apply] + exact (innerSL ℂ (b i)).continuous.comp_stronglyMeasurable hv + exact hc.smul (hA i) + apply stronglyMeasurable_of_tendsto (atTop : Filter (Finset ι)) hm + apply tendsto_pi_nhds.mpr + intro x + have h := (A x).hasSum (b.hasSum_repr (v x)) + simpa only [HasSum, SummationFilter.unconditional_filter, approximant, map_smul] using h + +theorem stronglyMeasurable_apply_const_of_columns + (b : HilbertBasis ι ℂ H) (A : X → H →L[ℂ] F) + (hA : ∀ i, StronglyMeasurable fun x => A x (b i)) (v : H) : + StronglyMeasurable fun x => A x v := + stronglyMeasurable_apply_of_columns b A hA stronglyMeasurable_const + +theorem aestronglyMeasurable_apply_of_columns + (b : HilbertBasis ι ℂ H) (A : X → H →L[ℂ] F) {μ : Measure X} + (hA : ∀ i, AEStronglyMeasurable (fun x => A x (b i)) μ) + {v : X → H} (hv : AEStronglyMeasurable v μ) : + AEStronglyMeasurable (fun x => A x (v x)) μ := by + classical + let approximant : Finset ι → X → F := fun s x => + ∑ i ∈ s, b.repr (v x) i • A x (b i) + have hm (s : Finset ι) : AEStronglyMeasurable (approximant s) μ := by + apply Finset.aestronglyMeasurable_fun_sum + intro i hi + have hc : AEStronglyMeasurable (fun x => b.repr (v x) i) μ := by + simp only [b.repr_apply_apply] + exact (innerSL ℂ (b i)).continuous.comp_aestronglyMeasurable hv + exact hc.smul (hA i) + apply aestronglyMeasurable_of_tendsto_ae (atTop : Filter (Finset ι)) hm + apply Filter.Eventually.of_forall + intro x + have h := (A x).hasSum (b.hasSum_repr (v x)) + simpa only [HasSum, SummationFilter.unconditional_filter, approximant, map_smul] using h + +theorem stronglyMeasurable_of_coordinates (b : HilbertBasis ι ℂ H) + {v : X → H} (hv : ∀ i, StronglyMeasurable fun x => b.repr (v x) i) : + StronglyMeasurable v := by + classical + let approximant : Finset ι → X → H := fun s x => + ∑ i ∈ s, b.repr (v x) i • b i + have hm (s : Finset ι) : StronglyMeasurable (approximant s) := by + apply Finset.stronglyMeasurable_fun_sum + intro i hi + exact (hv i).smul_const (b i) + apply stronglyMeasurable_of_tendsto (atTop : Filter (Finset ι)) hm + apply tendsto_pi_nhds.mpr + intro x + simpa only [HasSum, SummationFilter.unconditional_filter, approximant] using b.hasSum_repr (v x) + +theorem stronglyMeasurable_adjoint_apply_of_columns [CompleteSpace H] + (b : HilbertBasis ι ℂ H) (A : X → H →L[ℂ] H) + (hA : ∀ i, StronglyMeasurable fun x => A x (b i)) (v : H) : + StronglyMeasurable fun x => (A x).adjoint v := by + apply stronglyMeasurable_of_coordinates b + intro i + simp only [b.repr_apply_apply, ContinuousLinearMap.adjoint_inner_right] + exact (continuous_id.inner continuous_const).comp_stronglyMeasurable (hA i) + +theorem stronglyMeasurable_comp_apply_of_columns + (b : HilbertBasis ι ℂ H) (A B : X → H →L[ℂ] H) + (hA : ∀ i, StronglyMeasurable fun x => A x (b i)) + (hB : ∀ i, StronglyMeasurable fun x => B x (b i)) (v : H) : + StronglyMeasurable fun x => (A x).comp (B x) v := by + exact stronglyMeasurable_apply_of_columns b A hA + (stronglyMeasurable_apply_const_of_columns b B hB v) + +end Invariant233.StrongField + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongFourierRecovery.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongFourierRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ce0cafe9a02d29fcea43da770de85709cac5856 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongFourierRecovery.lean @@ -0,0 +1,77 @@ +import OAI.Analysis.IrrationalRotation.Analysis.FejerBanachApproximation +import OAI.Analysis.IrrationalRotation.Rotation.RotationMeasurable + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped Topology BigOperators +namespace Invariant233 +namespace StrongFourierRecovery + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +def average (C : ℤ → H →L[ℂ] H) (N : ℕ) : H →L[ℂ] H := + ∑ r ∈ Fejer.frequencies N, Fejer.coefficient N r • C r + +omit [CompleteSpace H] in + +theorem average_apply + (T : Fejer.Circle → H →L[ℂ] H) + (hT : ∀ v : H, Continuous (fun t => T t v)) + (C : ℤ → H →L[ℂ] H) + (hC : ∀ r v, C r v = ∫ t, fourier r t • T t v ∂AddCircle.haarAddCircle) + (N : ℕ) (v : H) : + average C N v = ∫ t, Fejer.kernel N t • T t v ∂AddCircle.haarAddCircle := by + have hint (r : ℤ) : Integrable (fun t : Fejer.Circle => fourier r t • T t v) + AddCircle.haarAddCircle := + ((fourier r).continuous.smul (hT v)).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + calc + average C N v = ∑ r ∈ Fejer.frequencies N, + Fejer.coefficient N r • ∫ t, fourier r t • T t v ∂AddCircle.haarAddCircle := by + simp only [average, sum_apply, smul_apply, hC] + _ = ∫ t, ∑ r ∈ Fejer.frequencies N, + Fejer.coefficient N r • (fourier r t • T t v) ∂AddCircle.haarAddCircle := by + rw [integral_finsetSum] + · simp only [integral_smul] + · intro r hr + exact (hint r).smul _ + _ = ∫ t, Fejer.kernel N t • T t v ∂AddCircle.haarAddCircle := by + apply integral_congr_ae + exact Eventually.of_forall fun t => by + change (∑ r ∈ Fejer.frequencies N, Fejer.coefficient N r • (fourier r t • T t v)) = + Fejer.kernel N t • T t v + rw [← Complex.coe_smul, Fejer.kernel_eq_finite_fourier_sum, Finset.sum_smul] + simp only [mul_smul] + +theorem average_tendsto + (T : Fejer.Circle → H →L[ℂ] H) + (hT : ∀ v : H, Continuous (fun t => T t v)) + (C : ℤ → H →L[ℂ] H) + (hC : ∀ r v, C r v = ∫ t, fourier r t • T t v ∂AddCircle.haarAddCircle) + (v : H) : + Tendsto (fun n : ℕ => average C (n + 1) v) atTop (𝓝 (T 0 v)) := by + simpa only [average_apply T hT C hC] using + Fejer.tendsto_integral_kernel_smul_of_continuous (hT v) + +theorem mem_of_fourier_modes + (M : VonNeumannAlgebra H) (T : Fejer.Circle → H →L[ℂ] H) + (hT : ∀ v : H, Continuous (fun t => T t v)) + (C : ℤ → H →L[ℂ] H) + (hC : ∀ r v, C r v = ∫ t, fourier r t • T t v ∂AddCircle.haarAddCircle) + (hCm : ∀ r, C r ∈ M) : T 0 ∈ M := by + apply vonNeumannAlgebra_mem_of_strong_tendsto M + (l := atTop) (A := fun n : ℕ => average C (n + 1)) + · intro n + apply M.toStarSubalgebra.sum_mem + intro r hr + exact M.toStarSubalgebra.smul_mem (hCm r) _ + · exact average_tendsto T hT C hC + +end StrongFourierRecovery +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongLusin.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongLusin.lean new file mode 100644 index 0000000000000000000000000000000000000000..05ada43b736a3647471ab2bc4da4df571b0d84fe --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/StrongLusin.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.IrrationalRotation.Analysis.SimultaneousLusin +import OAI.Analysis.IrrationalRotation.Analysis.StrongContinuityFromColumns + +namespace OAI + +open Set MeasureTheory +open scoped ENNReal + +namespace Invariant233.StrongLusin + +theorem exists_compact_strong_continuousOn {𝕜 X E F ι : Type*} + [RCLike 𝕜] [TopologicalSpace X] [PolishSpace X] + [MeasurableSpace X] [BorelSpace X] + [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] + [NormedAddCommGroup F] [NormedSpace 𝕜 F] + [MeasurableSpace F] [BorelSpace F] [SecondCountableTopology F] + [Countable ι] (μ : Measure X) [IsFiniteMeasure μ] + (A : X → E →L[𝕜] F) {C : ℝ} (hC : 0 ≤ C) + (hbound : ∀ x, ‖A x‖ ≤ C) (b : HilbertBasis ι 𝕜 E) + (hcolumns : ∀ i, Measurable (fun x => A x (b i))) + {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ Q : Set X, IsCompact Q ∧ μ Qᶜ < ε ∧ + ∀ v : E, ContinuousOn (fun x => A x v) Q := by + obtain ⟨Q, hQ, hsmall, hcont⟩ := + SimultaneousLusin.exists_compact_forall_continuousOn μ + (fun i x => A x (b i)) hcolumns hε + exact ⟨Q, hQ, hsmall, fun v => + StrongContinuityFromColumns.continuousOn_apply_of_hilbertBasis A hC + (fun x _ => hbound x) b hcont v⟩ + +theorem exists_compact_strong_and_continuousOn {𝕜 X E F ι J : Type*} + {Y : J → Type*} + [RCLike 𝕜] [TopologicalSpace X] [PolishSpace X] + [MeasurableSpace X] [BorelSpace X] + [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] + [NormedAddCommGroup F] [NormedSpace 𝕜 F] + [MeasurableSpace F] [BorelSpace F] [SecondCountableTopology F] + [∀ j, TopologicalSpace (Y j)] [∀ j, MeasurableSpace (Y j)] + [∀ j, OpensMeasurableSpace (Y j)] [∀ j, SecondCountableTopology (Y j)] + [Countable ι] [Countable J] (μ : Measure X) [IsFiniteMeasure μ] + (A : X → E →L[𝕜] F) {C : ℝ} (hC : 0 ≤ C) + (hbound : ∀ x, ‖A x‖ ≤ C) (b : HilbertBasis ι 𝕜 E) + (hcolumns : ∀ i, Measurable (fun x => A x (b i))) + (g : ∀ j, X → Y j) (hg : ∀ j, Measurable (g j)) + {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ Q : Set X, IsCompact Q ∧ μ Qᶜ < ε ∧ + (∀ v : E, ContinuousOn (fun x => A x v) Q) ∧ + ∀ j, ContinuousOn (g j) Q := by + have hmeas : Measurable (fun x => ((fun i => A x (b i)), (fun j => g j x))) := + (Measurable.of_eval hcolumns).prodMk (Measurable.of_eval hg) + obtain ⟨Q, hQ, hsmall, hcont⟩ := + SimultaneousLusin.exists_compact_continuousOn μ hmeas hε + refine ⟨Q, hQ, hsmall, ?_, continuousOn_pi.mp hcont.snd⟩ + exact fun v => StrongContinuityFromColumns.continuousOn_apply_of_hilbertBasis A hC + (fun x _ => hbound x) b (continuousOn_pi.mp hcont.fst) v + +end Invariant233.StrongLusin + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/SubmeasureLpDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/SubmeasureLpDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..aabb0626d74e1f95d5640415aa77006d0bca17dc --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/SubmeasureLpDensity.lean @@ -0,0 +1,64 @@ +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal + +namespace Invariant233.SubmeasureDensity + +theorem rnDeriv_le_of_le_withDensity + {X : Type*} [MeasurableSpace X] {μ ν : Measure X} [SigmaFinite μ] + {f : X → ℝ≥0∞} (hν : ν ≤ μ.withDensity f) : + ν.rnDeriv μ ≤ᵐ[μ] f := by + apply ae_le_of_forall_setLIntegral_le_of_sigmaFinite (ν.measurable_rnDeriv μ) + intro s hs _ + calc + (∫⁻ x in s, ν.rnDeriv μ x ∂μ) ≤ ν s := Measure.setLIntegral_rnDeriv_le s + _ ≤ μ.withDensity f s := hν s + _ = ∫⁻ x in s, f x ∂μ := withDensity_apply f hs + +theorem exists_lp_density_of_le_withDensity + {X : Type*} [MeasurableSpace X] {μ ν : Measure X} [SigmaFinite μ] + [IsFiniteMeasure ν] {p : ℝ≥0∞} (f : Lp ℝ p μ) + (hf : 0 ≤ᵐ[μ] f) + (hν : ν ≤ μ.withDensity (fun x => ENNReal.ofReal (f x))) : + ∃ g : Lp ℝ p μ, (0 ≤ᵐ[μ] g) ∧ (g ≤ᵐ[μ] f) ∧ + ν = μ.withDensity (fun x => ENNReal.ofReal (g x)) ∧ ‖g‖ ≤ ‖f‖ := by + let r : X → ℝ := fun x => (ν.rnDeriv μ x).toReal + have hrmeas : Measurable r := (ν.measurable_rnDeriv μ).ennreal_toReal + have hrnonneg : ∀ x, 0 ≤ r x := fun _ => ENNReal.toReal_nonneg + have hrle : r ≤ᵐ[μ] f := by + filter_upwards [rnDeriv_le_of_le_withDensity hν, hf] with x hx hfx + calc + r x ≤ (ENNReal.ofReal (f x)).toReal := ENNReal.toReal_mono ENNReal.ofReal_ne_top hx + _ = f x := ENNReal.toReal_ofReal hfx + have hrnorm : ∀ᵐ x ∂μ, ‖r x‖ ≤ ‖f x‖ := by + filter_upwards [hrle, hf] with x hx hfx + simpa only [Real.norm_eq_abs, abs_of_nonneg (hrnonneg x), abs_of_nonneg hfx] using hx + have hrLp : MemLp r p μ := (Lp.memLp f).mono hrmeas.aestronglyMeasurable hrnorm + have hrac : ν ≪ μ := + (Measure.absolutelyContinuous_of_le hν).trans (withDensity_absolutelyContinuous _ _) + refine ⟨hrLp.toLp r, ?_, ?_, ?_, ?_⟩ + · filter_upwards [hrLp.coeFn_toLp] with x hx + rw [hx] + exact hrnonneg x + · filter_upwards [hrLp.coeFn_toLp, hrle] with x hx hrx + simpa only [hx] using hrx + · calc + ν = μ.withDensity (ν.rnDeriv μ) := (ν.withDensity_rnDeriv_eq μ hrac).symm + _ = μ.withDensity (fun x => ENNReal.ofReal ((hrLp.toLp r) x)) := by + apply withDensity_congr_ae + filter_upwards [ν.rnDeriv_ne_top μ, hrLp.coeFn_toLp] with x hfinite hx + rw [hx] + exact (ENNReal.ofReal_toReal hfinite).symm + · rw [Lp.norm_toLp, Lp.norm_def] + exact ENNReal.toReal_mono (Lp.eLpNorm_ne_top f) + (eLpNorm_mono_ae hrmeas.aestronglyMeasurable hrnorm) + +end Invariant233.SubmeasureDensity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TaggedEventBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TaggedEventBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf3b946908461f4c3169b126d220178217c05517 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TaggedEventBounds.lean @@ -0,0 +1,370 @@ +import Mathlib.Analysis.SpecialFunctions.Log.Basic +import Mathlib.MeasureTheory.Constructions.Pi +import Mathlib.MeasureTheory.Measure.Real +import Mathlib.Probability.ProductMeasure +import Mathlib.Tactic + +namespace OAI + +namespace InvariantRotation.TaggedEventBounds + +theorem neg_div_one_sub_le_log {t : ℝ} (ht : t < 1) : + -t / (1 - t) ≤ Real.log (1 - t) := by + have hp : 0 < 1 - t := sub_pos.mpr ht + have heq : -t / (1 - t) = 1 - (1 - t)⁻¹ := by + field_simp + ring + rw [heq] + exact Real.one_sub_inv_le_log_of_pos hp + +theorem exp_neg_le_one_sub_pow (n : ℕ) {t a : ℝ} (ht : t < 1) + (hbudget : (n : ℝ) * t ≤ a * (1 - t)) : + Real.exp (-a) ≤ (1 - t) ^ n := by + have hp : 0 < 1 - t := sub_pos.mpr ht + apply (Real.le_log_iff_exp_le (pow_pos hp n)).mp + rw [Real.log_pow] + have hb : -a ≤ (n : ℝ) * (-t / (1 - t)) := by + rw [← mul_div_assoc] + apply (le_div_iff₀ hp).mpr + nlinarith + exact hb.trans (mul_le_mul_of_nonneg_left + (neg_div_one_sub_le_log ht) (Nat.cast_nonneg n)) + +theorem circle_tag_bound (m : ℕ) (hm : 200 ≤ m) : + Real.exp (-90) ≤ (1 - 61 / (m : ℝ)) ^ (m - 1) := by + have hmR : (200 : ℝ) ≤ m := by exact_mod_cast hm + have hmpos : (0 : ℝ) < m := by linarith + have hsub : ((m - 1 : ℕ) : ℝ) = (m : ℝ) - 1 := by + rw [Nat.cast_sub (by omega), Nat.cast_one] + apply exp_neg_le_one_sub_pow (m - 1) + · exact (div_lt_one hmpos).mpr (by linarith) + · rw [hsub] + apply (mul_le_mul_iff_left₀ hmpos).mp + field_simp + nlinarith + +theorem product_tag_bound (m : ℕ) (hm : 100 ≤ m) : + Real.exp (-82) ≤ (1 - 41 / (m : ℝ)) ^ (m - 1) := by + have hmR : (100 : ℝ) ≤ m := by exact_mod_cast hm + have hmpos : (0 : ℝ) < m := by linarith + have hsub : ((m - 1 : ℕ) : ℝ) = (m : ℝ) - 1 := by + rw [Nat.cast_sub (by omega), Nat.cast_one] + apply exp_neg_le_one_sub_pow (m - 1) + · exact (div_lt_one hmpos).mpr (by linarith) + · rw [hsub] + apply (mul_le_mul_iff_left₀ hmpos).mp + field_simp + nlinarith + +open MeasureTheory + +section ProductEvent + +variable {ι Ω : Type*} [Fintype ι] [DecidableEq ι] [MeasurableSpace Ω] + +def tagRectangle (T G : ι → Set Ω) (i : ι) : Set (ι → Ω) := + Set.pi Set.univ (fun j => if j = i then T j else G j) + +def oneTagEvent (T G : ι → Set Ω) : Set (ι → Ω) := + ⋃ i, tagRectangle T G i + +omit [Fintype ι] [MeasurableSpace Ω] in +theorem tagRectangle_pairwiseDisjoint (T G : ι → Set Ω) + (hdis : ∀ i, Disjoint (T i) (G i)) : + Pairwise (fun i j => Disjoint (tagRectangle T G i) (tagRectangle T G j)) := by + intro i j hij + apply Set.disjoint_left.mpr + intro x hxi hxj + have hi : x i ∈ T i := by simpa [tagRectangle] using hxi i (Set.mem_univ i) + have hj : x i ∈ G i := by simpa [tagRectangle, hij] using hxj i (Set.mem_univ i) + exact Set.disjoint_left.mp (hdis i) hi hj + +theorem measurableSet_tagRectangle (T G : ι → Set Ω) + (hT : ∀ i, MeasurableSet (T i)) (hG : ∀ i, MeasurableSet (G i)) (i : ι) : + MeasurableSet (tagRectangle T G i) := by + apply MeasurableSet.univ_pi + intro j + split_ifs + · exact hT j + · exact hG j + +theorem measurableSet_oneTagEvent (T G : ι → Set Ω) + (hT : ∀ i, MeasurableSet (T i)) (hG : ∀ i, MeasurableSet (G i)) : + MeasurableSet (oneTagEvent T G) := + MeasurableSet.iUnion (measurableSet_tagRectangle T G hT hG) + +theorem oneTagEvent_measureReal (μ : ι → Measure Ω) [∀ i, IsFiniteMeasure (μ i)] + (T G : ι → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + (hG : ∀ i, MeasurableSet (G i)) (hdis : ∀ i, Disjoint (T i) (G i)) : + (Measure.pi μ).real (oneTagEvent T G) = + ∑ i, ∏ j, (μ j).real (if j = i then T j else G j) := by + rw [oneTagEvent, measureReal_iUnion_fintype (tagRectangle_pairwiseDisjoint T G hdis) + (measurableSet_tagRectangle T G hT hG)] + apply Finset.sum_congr rfl + intro i hi + simp only [tagRectangle, measureReal_def, Measure.pi_pi, ENNReal.toReal_prod] + +theorem oneTagEvent_measureReal_lower_bound + (μ : ι → Measure Ω) [∀ i, IsFiniteMeasure (μ i)] + (T G : ι → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + (hG : ∀ i, MeasurableSet (G i)) (hdis : ∀ i, Disjoint (T i) (G i)) + {t g : ℝ} (ht : 0 ≤ t) (hg : 0 ≤ g) + (hTag : ∀ i, t ≤ (μ i).real (T i)) (hGood : ∀ i, g ≤ (μ i).real (G i)) : + (Fintype.card ι : ℝ) * t * g ^ (Fintype.card ι - 1) ≤ + (Measure.pi μ).real (oneTagEvent T G) := by + rw [oneTagEvent_measureReal μ T G hT hG hdis] + have hprod (i : ι) : (∏ j : ι, if j = i then t else g) = + t * g ^ (Fintype.card ι - 1) := by + rw [← Finset.mul_prod_erase Finset.univ + (fun j => if j = i then t else g) (Finset.mem_univ i)] + simp only [ite_true] + congr 1 + calc + (∏ j ∈ Finset.univ.erase i, if j = i then t else g) = + ∏ _j ∈ Finset.univ.erase i, g := by + apply Finset.prod_congr rfl + intro j hj + exact ite_eq_right (Finset.mem_erase.mp hj).1 + _ = g ^ (Fintype.card ι - 1) := by simp + calc + (Fintype.card ι : ℝ) * t * g ^ (Fintype.card ι - 1) = + ∑ _i : ι, t * g ^ (Fintype.card ι - 1) := by simp [mul_assoc] + _ = ∑ i : ι, ∏ j : ι, if j = i then t else g := by simp_rw [hprod] + _ ≤ ∑ i, ∏ j, (μ j).real (if j = i then T j else G j) := by + apply Finset.sum_le_sum + intro i hi + apply Finset.prod_le_prod₀ + · intro j hj + split_ifs <;> assumption + · intro j hj + split_ifs + · exact hTag j + · exact hGood j + +theorem oneTagEvent_measureReal_ge_pow (m : ℕ) (hm : 0 < m) + (μ : Fin m → Measure Ω) [∀ i, IsFiniteMeasure (μ i)] + (T G : Fin m → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + (hG : ∀ i, MeasurableSet (G i)) (hdis : ∀ i, Disjoint (T i) (G i)) + {g : ℝ} (hg : 0 ≤ g) + (hTag : ∀ i, 1 / (m : ℝ) ≤ (μ i).real (T i)) + (hGood : ∀ i, g ≤ (μ i).real (G i)) : + g ^ (m - 1) ≤ (Measure.pi μ).real (oneTagEvent T G) := by + have hmR : (0 : ℝ) < m := by exact_mod_cast hm + have h := oneTagEvent_measureReal_lower_bound μ T G hT hG hdis + (t := 1 / (m : ℝ)) (by positivity) hg hTag hGood + simp only [Fintype.card_fin] at h + have hcancel : (m : ℝ) * (1 / (m : ℝ)) = 1 := by field_simp + simpa only [hcancel, one_mul] using h + +theorem circle_oneTagEvent_bound (m : ℕ) (hm : 200 ≤ m) + (μ : Fin m → Measure Ω) [∀ i, IsFiniteMeasure (μ i)] + (T G : Fin m → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + (hG : ∀ i, MeasurableSet (G i)) (hdis : ∀ i, Disjoint (T i) (G i)) + (hTag : ∀ i, 1 / (m : ℝ) ≤ (μ i).real (T i)) + (hGood : ∀ i, 1 - 61 / (m : ℝ) ≤ (μ i).real (G i)) : + Real.exp (-90) ≤ (Measure.pi μ).real (oneTagEvent T G) := by + have hmR : (200 : ℝ) ≤ m := by exact_mod_cast hm + have hmpos : (0 : ℝ) < m := by linarith + refine (circle_tag_bound m hm).trans + (oneTagEvent_measureReal_ge_pow m (by omega) μ T G hT hG hdis ?_ hTag hGood) + exact sub_nonneg.mpr ((div_le_one hmpos).mpr (by linarith)) + +theorem product_oneTagEvent_bound (m : ℕ) (hm : 100 ≤ m) + (μ : Fin m → Measure Ω) [∀ i, IsFiniteMeasure (μ i)] + (T G : Fin m → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + (hG : ∀ i, MeasurableSet (G i)) (hdis : ∀ i, Disjoint (T i) (G i)) + (hTag : ∀ i, 1 / (m : ℝ) ≤ (μ i).real (T i)) + (hGood : ∀ i, 1 - 41 / (m : ℝ) ≤ (μ i).real (G i)) : + Real.exp (-82) ≤ (Measure.pi μ).real (oneTagEvent T G) := by + have hmR : (100 : ℝ) ≤ m := by exact_mod_cast hm + have hmpos : (0 : ℝ) < m := by linarith + refine (product_tag_bound m hm).trans + (oneTagEvent_measureReal_ge_pow m (by omega) μ T G hT hG hdis ?_ hTag hGood) + exact sub_nonneg.mpr ((div_le_one hmpos).mpr (by linarith)) + +end ProductEvent + +section InfiniteProductEvent + +variable {κ Ω : Type*} [DecidableEq κ] [MeasurableSpace Ω] + +theorem infinitePi_oneTagEvent_measureReal + (μ : κ → Measure Ω) [∀ i, IsProbabilityMeasure (μ i)] (J : Finset κ) + (T G : J → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + (hG : ∀ i, MeasurableSet (G i)) : + (Measure.infinitePi μ).real (J.restrict ⁻¹' oneTagEvent T G) = + (Measure.pi (fun i : J => μ i)).real (oneTagEvent T G) := by + classical + simp only [measureReal_def] + rw [← Measure.map_apply (Finset.measurable_restrict J) (measurableSet_oneTagEvent T G hT hG), + Measure.infinitePi_map_restrict] + +theorem infinitePi_oneTagEvent_lower_bound + (μ : κ → Measure Ω) [∀ i, IsProbabilityMeasure (μ i)] (J : Finset κ) + (T G : J → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + (hG : ∀ i, MeasurableSet (G i)) (hdis : ∀ i, Disjoint (T i) (G i)) + {t g : ℝ} (ht : 0 ≤ t) (hg : 0 ≤ g) + (hTag : ∀ i : J, t ≤ (μ i).real (T i)) + (hGood : ∀ i : J, g ≤ (μ i).real (G i)) : + (J.card : ℝ) * t * g ^ (J.card - 1) ≤ + (Measure.infinitePi μ).real (J.restrict ⁻¹' oneTagEvent T G) := by + classical + rw [infinitePi_oneTagEvent_measureReal μ J T G hT hG] + simpa using oneTagEvent_measureReal_lower_bound (fun i : J => μ i) + T G hT hG hdis ht hg hTag hGood + +end InfiniteProductEvent + +section EventLoss + +variable {Ω : Type*} [MeasurableSpace Ω] + +theorem measureReal_remove_bad_union {ι : Type*} [Fintype ι] + (μ : Measure Ω) [IsFiniteMeasure μ] (A : Set Ω) (B : ι → Set Ω) : + μ.real A - ∑ i, μ.real (B i) ≤ μ.real (A \ ⋃ i, B i) := by + have hsum := measureReal_iUnion_fintype_le (μ := μ) B + have hremove := le_measureReal_sdiff (μ := μ) (s₁ := A) (s₂ := ⋃ i, B i) + linarith + +theorem admissible_nontag_measureReal_lower_bound + (μ : Measure Ω) [IsProbabilityMeasure μ] (T B₁ B₂ : Set Ω) + (hT : MeasurableSet T) (hB₁ : MeasurableSet B₁) (hB₂ : MeasurableSet B₂) + {t b₁ b₂ : ℝ} (hTag : μ.real T ≤ t) + (hBad₁ : μ.real B₁ ≤ b₁) (hBad₂ : μ.real B₂ ≤ b₂) : + 1 - t - b₁ - b₂ ≤ μ.real (Tᶜ ∩ B₁ᶜ ∩ B₂ᶜ) := by + have hbound : μ.real (T ∪ B₁ ∪ B₂) ≤ t + b₁ + b₂ := + (measureReal_union_le (T ∪ B₁) B₂).trans + (add_le_add ((measureReal_union_le T B₁).trans (add_le_add hTag hBad₁)) hBad₂) + have heq : μ.real (Tᶜ ∩ B₁ᶜ ∩ B₂ᶜ) = 1 - μ.real (T ∪ B₁ ∪ B₂) := by + rw [← Set.compl_union, ← Set.compl_union, measureReal_compl (hT.union hB₁ |>.union hB₂)] + simp + rw [heq] + linarith + +theorem eventually_half_le_measureReal_sdiff + (μ : ℕ → Measure Ω) [∀ n, IsFiniteMeasure (μ n)] + (A B : ℕ → Set Ω) {c : ℝ} (hc : 0 < c) + (hbase : ∀ᶠ n in Filter.atTop, c ≤ (μ n).real (A n)) + (hloss : Filter.Tendsto (fun n => (μ n).real (B n)) Filter.atTop (nhds 0)) : + ∀ᶠ n in Filter.atTop, c / 2 ≤ (μ n).real (A n \ B n) := by + have hsmall : ∀ᶠ n in Filter.atTop, (μ n).real (B n) < c / 2 := + (tendsto_order.1 hloss).2 (c / 2) (by linarith) + filter_upwards [hbase, hsmall] with n hn hsmalln + have hremove := le_measureReal_sdiff (μ := μ n) (s₁ := A n) (s₂ := B n) + linarith + +theorem eventually_half_le_measureReal_remove_bad_union + {ι : Type*} [Fintype ι] (μ : ℕ → Measure Ω) [∀ n, IsFiniteMeasure (μ n)] + (A : ℕ → Set Ω) (B : ℕ → ι → Set Ω) {c : ℝ} (hc : 0 < c) + (hbase : ∀ᶠ n in Filter.atTop, c ≤ (μ n).real (A n)) + (hloss : Filter.Tendsto (fun n => ∑ i, (μ n).real (B n i)) + Filter.atTop (nhds 0)) : + ∀ᶠ n in Filter.atTop, c / 2 ≤ (μ n).real (A n \ ⋃ i, B n i) := by + have hsmall : ∀ᶠ n in Filter.atTop, (∑ i, (μ n).real (B n i)) < c / 2 := + (tendsto_order.1 hloss).2 (c / 2) (by linarith) + filter_upwards [hbase, hsmall] with n hn hsmalln + have hremove := measureReal_remove_bad_union (μ n) (A n) (B n) + linarith + +theorem eventually_half_le_measureReal_sdiff_varying + {Ω' : ℕ → Type*} [∀ n, MeasurableSpace (Ω' n)] + (μ : (n : ℕ) → Measure (Ω' n)) [∀ n, IsFiniteMeasure (μ n)] + (A B : (n : ℕ) → Set (Ω' n)) {c : ℝ} (hc : 0 < c) + (hbase : ∀ᶠ n in Filter.atTop, c ≤ (μ n).real (A n)) + (hloss : Filter.Tendsto (fun n => (μ n).real (B n)) Filter.atTop (nhds 0)) : + ∀ᶠ n in Filter.atTop, c / 2 ≤ (μ n).real (A n \ B n) := by + have hsmall : ∀ᶠ n in Filter.atTop, (μ n).real (B n) < c / 2 := + (tendsto_order.1 hloss).2 (c / 2) (by linarith) + filter_upwards [hbase, hsmall] with n hn hsmalln + have hremove := le_measureReal_sdiff (μ := μ n) (s₁ := A n) (s₂ := B n) + linarith + +theorem eventually_half_le_measureReal_remove_bad_union_varying + {Ω' : ℕ → Type*} [∀ n, MeasurableSpace (Ω' n)] {ι : Type*} [Fintype ι] + (μ : (n : ℕ) → Measure (Ω' n)) [∀ n, IsFiniteMeasure (μ n)] + (A : (n : ℕ) → Set (Ω' n)) (B : (n : ℕ) → ι → Set (Ω' n)) + {c : ℝ} (hc : 0 < c) + (hbase : ∀ᶠ n in Filter.atTop, c ≤ (μ n).real (A n)) + (hloss : Filter.Tendsto (fun n => ∑ i, (μ n).real (B n i)) + Filter.atTop (nhds 0)) : + ∀ᶠ n in Filter.atTop, c / 2 ≤ (μ n).real (A n \ ⋃ i, B n i) := by + have hsmall : ∀ᶠ n in Filter.atTop, (∑ i, (μ n).real (B n i)) < c / 2 := + (tendsto_order.1 hloss).2 (c / 2) (by linarith) + filter_upwards [hbase, hsmall] with n hn hsmalln + have hremove := measureReal_remove_bad_union (μ n) (A n) (B n) + linarith + +end EventLoss + + +variable {ι Ω : Type*} [Fintype ι] [DecidableEq ι] [MeasurableSpace Ω] + +def currentBlockEvent (T B₁ B₂ : ι → Set Ω) : Set (ι → Ω) := + {x | (∃ i, x i ∈ T i) ∧ ∀ i, x i ∉ B₁ i ∧ x i ∉ B₂ i} + +omit [DecidableEq ι] in +theorem measurableSet_currentBlockEvent (T B₁ B₂ : ι → Set Ω) + (hT : ∀ i, MeasurableSet (T i)) (hB₁ : ∀ i, MeasurableSet (B₁ i)) + (hB₂ : ∀ i, MeasurableSet (B₂ i)) : + MeasurableSet (currentBlockEvent T B₁ B₂) := by + change MeasurableSet ({x : ι → Ω | ∃ i, x i ∈ T i} ∩ + {x : ι → Ω | ∀ i, x i ∉ B₁ i ∧ x i ∉ B₂ i}) + rw [Set.ofPred_exists, Set.ofPred_forall] + apply MeasurableSet.inter + · apply MeasurableSet.iUnion + intro i + exact (hT i).preimage (measurable_pi_apply i) + · apply MeasurableSet.iInter + intro i + exact ((hB₁ i).preimage (measurable_pi_apply i)).compl.inter + ((hB₂ i).preimage (measurable_pi_apply i)).compl + +omit [Fintype ι] [MeasurableSpace Ω] in +theorem oneTagEvent_subset_currentBlockEvent (T B₁ B₂ : ι → Set Ω) + (hTagSafe : ∀ i, T i ⊆ (B₁ i)ᶜ ∩ (B₂ i)ᶜ) : + oneTagEvent T (fun i => (T i)ᶜ ∩ (B₁ i)ᶜ ∩ (B₂ i)ᶜ) ⊆ + currentBlockEvent T B₁ B₂ := by + intro x hx + obtain ⟨i, hi⟩ := Set.mem_iUnion.mp hx + have htag : x i ∈ T i := by + simpa [tagRectangle] using hi i (Set.mem_univ i) + refine ⟨⟨i, htag⟩, ?_⟩ + intro j + by_cases hji : j = i + · subst j + exact hTagSafe i htag + · have hj : x j ∈ (T j)ᶜ ∩ (B₁ j)ᶜ ∩ (B₂ j)ᶜ := by + simpa [tagRectangle, hji] using hi j (Set.mem_univ j) + exact ⟨hj.1.2, hj.2⟩ + +theorem currentBlockEvent_measureReal_lower_bound (m : ℕ) (hm : 0 < m) + (μ : Fin m → Measure Ω) [∀ i, IsProbabilityMeasure (μ i)] + (T B₁ B₂ : Fin m → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + (hB₁ : ∀ i, MeasurableSet (B₁ i)) (hB₂ : ∀ i, MeasurableSet (B₂ i)) + (hTagSafe : ∀ i, T i ⊆ (B₁ i)ᶜ ∩ (B₂ i)ᶜ) {a : ℝ} + (hg : 0 ≤ 1 - (1 + 2 * a) / (m : ℝ)) + (hTag : ∀ i, (μ i).real (T i) = 1 / (m : ℝ)) + (hBad₁ : ∀ i, (μ i).real (B₁ i) ≤ a / (m : ℝ)) + (hBad₂ : ∀ i, (μ i).real (B₂ i) ≤ a / (m : ℝ)) : + (1 - (1 + 2 * a) / (m : ℝ)) ^ (m - 1) ≤ + (Measure.pi μ).real (currentBlockEvent T B₁ B₂) := by + let G : Fin m → Set Ω := fun i => (T i)ᶜ ∩ (B₁ i)ᶜ ∩ (B₂ i)ᶜ + have hG : ∀ i, MeasurableSet (G i) := fun i => + ((hT i).compl.inter (hB₁ i).compl).inter (hB₂ i).compl + have hdis : ∀ i, Disjoint (T i) (G i) := by + intro i + exact Set.disjoint_left.mpr (fun x hx hGx => hGx.1.1 hx) + have hGood : ∀ i, 1 - (1 + 2 * a) / (m : ℝ) ≤ (μ i).real (G i) := by + intro i + have h := admissible_nontag_measureReal_lower_bound (μ i) (T i) (B₁ i) (B₂ i) + (hT i) (hB₁ i) (hB₂ i) (le_of_eq (hTag i)) (hBad₁ i) (hBad₂ i) + convert h using 1 + ring + exact (oneTagEvent_measureReal_ge_pow m hm μ T G hT hG hdis hg + (fun i => (hTag i).ge) hGood).trans + (measureReal_mono (oneTagEvent_subset_currentBlockEvent T B₁ B₂ hTagSafe)) + + +end InvariantRotation.TaggedEventBounds + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TaggedNearWindow.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TaggedNearWindow.lean new file mode 100644 index 0000000000000000000000000000000000000000..69b4dc583a23b0483e07ab8762ac6f6c87e1a77b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TaggedNearWindow.lean @@ -0,0 +1,164 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleParameters +import OAI.Analysis.IrrationalRotation.Model.MixedRadixCircle +import OAI.Analysis.IrrationalRotation.Sampling.MixedRadixCircle +import OAI.Analysis.IrrationalRotation.Sampling.CircleCharacterDynamics +import OAI.Analysis.IrrationalRotation.Rotation.CircleParameterBlocks +import OAI.Analysis.IrrationalRotation.Sampling.PhaseRanges +import OAI.Analysis.IrrationalRotation.Rotation.FiniteSupportCocycle + +namespace OAI + +noncomputable section + +namespace Invariant233.TaggedNearWindow + +theorem rounded_tag_endpoints {m K X Y u v : ℝ} + (hm : 0 < m) (hK : 2 ≤ K) + (hX : X < 1 / (2 * m)) (hY : 1 - 1 / (2 * m) ≤ Y) + (hu : |u - X| ≤ 1 / (m * K)) (hv : |v - Y| ≤ 1 / (m * K)) : + u < 1 / m ∧ 1 - 1 / m ≤ v := by + have herror : 1 / (m * K) ≤ 1 / (2 * m) := by + apply one_div_le_one_div_of_le (by positivity) + nlinarith + have hhalves : 1 / (2 * m) + 1 / (2 * m) = 1 / m := by ring + have hu' := (abs_le.mp hu).2 + have hv' := (abs_le.mp hv).1 + constructor <;> linarith + +theorem rounded_tag_crossing {m K α k X Y u v : ℝ} + (hm : 0 < m) (hK : 2 ≤ K) + (hαlo : 1 / (m * K) ≤ α) (hαhi : α ≤ 2 / (m * K)) + (hklo : K ≤ |k|) (hkhi : |k| ≤ m * K / 4) + (hX : X < 1 / (2 * m)) (hY : 1 - 1 / (2 * m) ≤ Y) + (hu : |u - X| ≤ 1 / (m * K)) (hv : |v - Y| ≤ 1 / (m * K)) : + u < 1 - Int.fract (k * α) ∧ 1 - Int.fract (k * α) ≤ v := by + have he := rounded_tag_endpoints hm hK hX hY hu hv + have ht := phase_small_window (m := m) (K := K) (G := 1) (α := α) (k := k) + hm (by linarith) (by norm_num) hαlo hαhi (by simpa using hklo) hkhi + exact ⟨he.1.trans_le ht.1, ht.2.trans he.2⟩ + +theorem coordinate_circleValue_eq (p : CircleParameterData) + (d : MixedRadix.Digits (MixedRadix.radices p.q)) (i : ℕ) : + p.coordinate i (MixedRadix.circleValue d) = + Int.fract ((p.q i : ℝ) * MixedRadix.ofDigits d) := by + unfold CircleParameterData.coordinate CircleParameterData.rep MixedRadix.circleValue + rw [← AddCircle.coe_nsmul] + simpa only [nsmul_eq_mul, Nat.cast_commute] using + CircleCharacterDynamics.representative_coe ((p.q i : ℝ) * MixedRadix.ofDigits d) + +end TaggedNearWindow + +namespace CircleParameterLaws + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem tagged_K_ge_initial (j : ℕ) (hj : 1 ≤ j) : 100 ≤ p.K j := by + obtain ⟨n, rfl⟩ := Nat.exists_eq_add_of_le hj + induction n with + | zero => simpa using hp.initial_K.ge + | succ n ih => + have hd := hp.K_double (1 + n) (by omega) + have he : 1 + (n + 1) = 1 + n + 1 := by omega + rw [he] + omega + +theorem tagged_radix_eq_ratio (i : ℕ) : + (MixedRadix.radices p.q i : ℝ) = (p.q (i + 1) : ℝ) / p.q i := by + have hq : (p.q i : ℝ) ≠ 0 := by exact_mod_cast (hp.q_pos i).ne' + apply (eq_div_iff hq).mpr + have h := Nat.mul_div_cancel' (hp.frequency_divisible i) + have hr : p.q i * MixedRadix.radices p.q i = p.q (i + 1) := h + exact_mod_cast (show MixedRadix.radices p.q i * p.q i = p.q (i + 1) by simpa only [mul_comm] using hr) + +theorem tagged_coordinate_error {j i : ℕ} (hj : 1 ≤ j) (hi : i ∈ p.block j) + (d : MixedRadix.Digits (MixedRadix.radices p.q)) (hd : MixedRadix.Nonterminal d) + {X : ℝ} (hX : 0 ≤ X) + (hfloor : ⌊(MixedRadix.radices p.q i : ℝ) * X⌋₊ = (d i : ℕ)) : + |p.coordinate i (MixedRadix.circleValue d) - X| ≤ 1 / p.N j := by + rw [TaggedNearWindow.coordinate_circleValue_eq] + refine (MixedRadix.abs_coordinate_sub_raw_le hp.frequency_zero hp.q_pos + hp.frequency_increasing hp.frequency_divisible d hd i hX hfloor).trans ?_ + apply one_div_le_one_div_of_le + · exact mul_pos (Nat.cast_pos.mpr (hp.m_pos j hj)) (Nat.cast_pos.mpr (hp.K_pos j hj)) + · rw [hp.tagged_radix_eq_ratio] + exact hp.frequency_ratios j hj i hi + +theorem tagged_near_window_crossing {j i : ℕ} (hj : 1 ≤ j) (hi : i ∈ p.block j) + (d e : MixedRadix.Digits (MixedRadix.radices p.q)) + (hd : MixedRadix.Nonterminal d) (he : MixedRadix.Nonterminal e) + (k : ℤ) (hklo : (p.K j : ℝ) < |(k : ℝ)|) (hkhi : |(k : ℝ)| ≤ p.N j / 4) + {X Y : ℝ} (hX0 : 0 ≤ X) (hY0 : 0 ≤ Y) + (hX : X < 1 / (2 * (p.m j : ℝ))) (hY : 1 - 1 / (2 * (p.m j : ℝ)) ≤ Y) + (hfloorX : ⌊(MixedRadix.radices p.q i : ℝ) * X⌋₊ = (d i : ℕ)) + (hfloorY : ⌊(MixedRadix.radices p.q i : ℝ) * Y⌋₊ = (e i : ℕ)) : + p.coordinate i (MixedRadix.circleValue d) < 1 - Int.fract ((k : ℝ) * p.alpha θ i) ∧ + 1 - Int.fract ((k : ℝ) * p.alpha θ i) ≤ + p.coordinate i (MixedRadix.circleValue e) := by + apply TaggedNearWindow.rounded_tag_crossing + (Nat.cast_pos.mpr (hp.m_pos j hj)) + (show (2 : ℝ) ≤ p.K j by exact_mod_cast (show 2 ≤ p.K j by have := hp.tagged_K_ge_initial j hj; omega)) + (hp.phase_bounds j hj i hi).1.le (hp.phase_bounds j hj i hi).2.le + hklo.le hkhi hX hY + · exact hp.tagged_coordinate_error hj hi d hd hX0 hfloorX + · exact hp.tagged_coordinate_error hj hi e he hY0 hfloorY + +theorem tagged_near_window_attenuation {j i : ℕ} (hj : 1 ≤ j) (hi : i ∈ p.block j) + (d e : MixedRadix.Digits (MixedRadix.radices p.q)) + (hd : MixedRadix.Nonterminal d) (he : MixedRadix.Nonterminal e) + (hde : ∀ n, d n ≤ e n) + (k : ℤ) (hklo : (p.K j : ℝ) < |(k : ℝ)|) (hkhi : |(k : ℝ)| ≤ p.N j / 4) + {X Y : ℝ} (hX0 : 0 ≤ X) (hY0 : 0 ≤ Y) + (hX : X < 1 / (2 * (p.m j : ℝ))) (hY : 1 - 1 / (2 * (p.m j : ℝ)) ≤ Y) + (hfloorX : ⌊(MixedRadix.radices p.q i : ℝ) * X⌋₊ = (d i : ℕ)) + (hfloorY : ⌊(MixedRadix.radices p.q i : ℝ) * Y⌋₊ = (e i : ℕ)) + (hsd : Function.HasFiniteSupport (fun n : ℕ => + ⌊p.coordinate (n + 1) (MixedRadix.circleValue d) + (k : ℝ) * p.alpha θ (n + 1)⌋)) + (hse : Function.HasFiniteSupport (fun n : ℕ => + ⌊p.coordinate (n + 1) (MixedRadix.circleValue e) + (k : ℝ) * p.alpha θ (n + 1)⌋)) : + Real.exp (-(∑' n : ℕ, p.flattenedCost n * + (⌊p.coordinate (n + 1) (MixedRadix.circleValue e) + (k : ℝ) * p.alpha θ (n + 1)⌋ : ℝ))) / + Real.exp (-(∑' n : ℕ, p.flattenedCost n * + (⌊p.coordinate (n + 1) (MixedRadix.circleValue d) + (k : ℝ) * p.alpha θ (n + 1)⌋ : ℝ))) + ≤ Real.exp (-p.L j) := by + have hip : 1 ≤ i := by + have h := (p.mem_block_iff j i).mp hi + omega + have hin : i - 1 + 1 = i := Nat.sub_add_cancel hip + have hcoord (a : MixedRadix.Digits (MixedRadix.radices p.q)) (n : ℕ) : + p.coordinate (n + 1) (MixedRadix.circleValue a) ∈ Set.Ico (0 : ℝ) 1 := by + simpa only [CircleParameterData.coordinate, CircleParameterData.rep, zero_add] using + (AddCircle.equivIco (1 : ℝ) 0 (p.q (n + 1) • MixedRadix.circleValue a)).property + have hcost (n : ℕ) : 0 ≤ p.flattenedCost n := + (hp.C_pos _ (p.blockIndex_pos hp.m_pos (by omega))).le + have horder (n : ℕ) : + p.coordinate (n + 1) (MixedRadix.circleValue d) ≤ + p.coordinate (n + 1) (MixedRadix.circleValue e) := by + simp only [TaggedNearWindow.coordinate_circleValue_eq] + exact MixedRadix.coordinates_ordered hp.frequency_zero hp.q_pos + hp.frequency_increasing hp.frequency_divisible hd he hde (n + 1) + have hcross := hp.tagged_near_window_crossing hj hi d e hd he k hklo hkhi + hX0 hY0 hX hY hfloorX hfloorY + have hbound := FiniteSupportCocycle.exp_tsum_floor_ratio_le_finite_crossings + (fun n => p.coordinate (n + 1) (MixedRadix.circleValue d)) + (fun n => p.coordinate (n + 1) (MixedRadix.circleValue e)) + (fun n => (k : ℝ) * p.alpha θ (n + 1)) p.flattenedCost {i - 1} + (hcoord d) (hcoord e) hcost horder hsd hse (by + intro n hn + have hn' : n = i - 1 := Finset.mem_singleton.mp hn + subst n + simpa only [hin] using hcross) + simp only [Finset.sum_singleton] at hbound + have hc : p.flattenedCost (i - 1) = p.C j := + p.flattenedCost_eq_of_mem hp.m_pos (by simpa only [hin] using hi) + rw [hc] at hbound + exact hbound.trans (Real.exp_le_exp.mpr (neg_le_neg (by + rw [hp.C_eq j hj] + exact le_max_left _ _))) + +end CircleParameterLaws +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TaggedThresholdCrossing.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TaggedThresholdCrossing.lean new file mode 100644 index 0000000000000000000000000000000000000000..6456f165a7622454c4ff690b7b5ed127745d61d8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TaggedThresholdCrossing.lean @@ -0,0 +1,97 @@ +import OAI.Analysis.IrrationalRotation.Rotation.FloorCocycle + +namespace OAI + +namespace Invariant233.FloorCocycle + +theorem threshold_mem_Ioo_of_abs_phase {δ t : ℝ} (hδ : 0 ≤ δ) + (hlo : δ < |t|) (hhi : |t| < 1 - δ) : + 1 - Int.fract t ∈ Set.Ioo δ (1 - δ) := by + by_cases ht : 0 ≤ t + · rw [abs_of_nonneg ht] at hlo hhi + have hf : Int.fract t = t := Int.fract_eq_self.mpr ⟨ht, by linarith⟩ + rw [hf] + constructor <;> linarith + · have ht' : t < 0 := lt_of_not_ge ht + rw [abs_of_neg ht'] at hlo hhi + have hf : Int.fract (-t) = -t := + Int.fract_eq_self.mpr ⟨by linarith, by linarith⟩ + have hne : Int.fract (-t) ≠ 0 := by rw [hf]; linarith + have hf' : Int.fract t = 1 + t := by + simpa only [neg_neg, hf, sub_neg_eq_add] using Int.fract_neg hne + rw [hf'] + constructor <;> linarith + +theorem tagged_crossing_of_abs_phase {x y δ t : ℝ} (hδ : 0 ≤ δ) + (hx : x < δ) (hy : 1 - δ < y) + (hlo : δ < |t|) (hhi : |t| < 1 - δ) : + x < 1 - Int.fract t ∧ 1 - Int.fract t ≤ y := by + have h := threshold_mem_Ioo_of_abs_phase hδ hlo hhi + exact ⟨hx.trans h.1, (h.2.trans hy).le⟩ + +theorem tagged_crossing_of_window {m K α x y : ℝ} (k : ℤ) + (hm : 2 ≤ m) (hK : 0 < K) + (hαlo : 1 / (m * K) < α) (hαhi : α < 2 / (m * K)) + (hklo : K < |(k : ℝ)|) (hkhi : |(k : ℝ)| ≤ m * K / 4) + (hx : x < 1 / m) (hy : 1 - 1 / m < y) : + x < 1 - Int.fract ((k : ℝ) * α) ∧ + 1 - Int.fract ((k : ℝ) * α) ≤ y := by + have hm0 : 0 < m := by linarith + have hmK : 0 < m * K := mul_pos hm0 hK + have hα0 : 0 < α := (one_div_pos.mpr hmK).trans hαlo + have hk0 : 0 < |(k : ℝ)| := hK.trans hklo + have hlo : 1 / m < |(k : ℝ)| * α := by + calc + 1 / m = K * (1 / (m * K)) := by field_simp + _ < |(k : ℝ)| * (1 / (m * K)) := + mul_lt_mul_of_pos_right hklo (one_div_pos.mpr hmK) + _ ≤ |(k : ℝ)| * α := mul_le_mul_of_nonneg_left hαlo.le hk0.le + have hhalf : |(k : ℝ)| * α < 1 / 2 := by + calc + |(k : ℝ)| * α < |(k : ℝ)| * (2 / (m * K)) := + mul_lt_mul_of_pos_left hαhi hk0 + _ ≤ (m * K / 4) * (2 / (m * K)) := + mul_le_mul_of_nonneg_right hkhi (div_nonneg (by norm_num) hmK.le) + _ = 1 / 2 := by field_simp; ring + have hinv : 1 / m ≤ (1 / 2 : ℝ) := by + exact one_div_le_one_div_of_le (by norm_num) hm + apply tagged_crossing_of_abs_phase (one_div_pos.mpr hm0).le hx hy + · simpa only [abs_mul, abs_of_pos hα0] using hlo + · rw [abs_mul, abs_of_pos hα0] + linarith + +theorem tagged_crossing_of_window_closed {m K α x y : ℝ} (k : ℤ) + (hm : 2 ≤ m) (hK : 0 < K) + (hαlo : 1 / (m * K) ≤ α) (hαhi : α ≤ 2 / (m * K)) + (hklo : K < |(k : ℝ)|) (hkhi : |(k : ℝ)| ≤ m * K / 4) + (hx : x < 1 / m) (hy : 1 - 1 / m ≤ y) : + x < 1 - Int.fract ((k : ℝ) * α) ∧ + 1 - Int.fract ((k : ℝ) * α) ≤ y := by + have hm0 : 0 < m := by linarith + have hmK : 0 < m * K := mul_pos hm0 hK + have hα0 : 0 < α := (one_div_pos.mpr hmK).trans_le hαlo + have hk0 : 0 < |(k : ℝ)| := hK.trans hklo + have hlo : 1 / m < |(k : ℝ)| * α := by + calc + 1 / m = K * (1 / (m * K)) := by field_simp + _ < |(k : ℝ)| * (1 / (m * K)) := + mul_lt_mul_of_pos_right hklo (one_div_pos.mpr hmK) + _ ≤ |(k : ℝ)| * α := mul_le_mul_of_nonneg_left hαlo hk0.le + have hhalf : |(k : ℝ)| * α ≤ 1 / 2 := by + calc + |(k : ℝ)| * α ≤ |(k : ℝ)| * (2 / (m * K)) := + mul_le_mul_of_nonneg_left hαhi hk0.le + _ ≤ (m * K / 4) * (2 / (m * K)) := + mul_le_mul_of_nonneg_right hkhi (div_nonneg (by norm_num) hmK.le) + _ = 1 / 2 := by field_simp; ring + have hinv : 1 / m < (1 / 2 : ℝ) := hlo.trans_le hhalf + have hatt : 1 - Int.fract ((k : ℝ) * α) ∈ Set.Ioo (1 / m) (1 - 1 / m) := by + apply threshold_mem_Ioo_of_abs_phase (one_div_pos.mpr hm0).le + · simpa only [abs_mul, abs_of_pos hα0] using hlo + · rw [abs_mul, abs_of_pos hα0] + linarith + exact ⟨hx.trans hatt.1, hatt.2.le.trans hy⟩ + +end Invariant233.FloorCocycle + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TailScaleCover.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TailScaleCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..4bd1bd9cd4679e240be94ba5478e14dee533b551 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TailScaleCover.lean @@ -0,0 +1,360 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CircleParameterBlocks +import OAI.Analysis.IrrationalRotation.Couplings.CouplingMarginalBounds + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Invariant233.TailScaleCover + +theorem exists_window_of_overlap (left right : ℕ → ℝ) (j : ℕ) (t : ℝ) + (hunbounded : ∀ R : ℝ, ∃ s : ℕ, j ≤ s ∧ R ≤ right s) + (hoverlap : ∀ s : ℕ, j ≤ s → left (s + 1) ≤ right s) : + ∃ s : ℕ, j ≤ s ∧ t ≤ right s ∧ (s = j ∨ left s ≤ t) := by + have hex : ∃ n : ℕ, t ≤ right (j + n) := by + obtain ⟨s, hjs, hs⟩ := hunbounded t + obtain ⟨n, rfl⟩ := Nat.exists_eq_add_of_le hjs + exact ⟨n, hs⟩ + let n := Nat.find hex + have hn : t ≤ right (j + n) := Nat.find_spec hex + refine ⟨j + n, by omega, hn, ?_⟩ + by_cases hn0 : n = 0 + · left + simp [hn0] + · right + have hprev : ¬ t ≤ right (j + (n - 1)) := + Nat.find_min hex (show n - 1 < Nat.find hex by change n - 1 < n; omega) + have hstep := hoverlap (j + (n - 1)) (by omega) + have heq : j + (n - 1) + 1 = j + n := by omega + rw [heq] at hstep + exact hstep.trans (le_of_lt (lt_of_not_ge hprev)) + +theorem lower_intensity_eq (κ G m : ℝ) (hG : 0 ≤ G) (hm : 0 < m) : + m * (κ * Real.sqrt ((G / m) / m)) = κ * Real.sqrt G := by + have hdiv : (G / m) / m = G / m ^ 2 := by ring + rw [hdiv, Real.sqrt_div hG, Real.sqrt_sq hm.le] + field_simp + +theorem upper_intensity_eq (κ m : ℝ) (hm : 0 < m) : + m * (κ * Real.sqrt (m ^ (-(19 / 20 : ℝ)) / m)) = + κ * m ^ (1 / 40 : ℝ) := by + have hdiv : m ^ (-(19 / 20 : ℝ)) / m = m ^ (-(39 / 20 : ℝ)) := by + calc + _ = m ^ (-(19 / 20 : ℝ)) / m ^ (1 : ℝ) := by rw [Real.rpow_one] + _ = m ^ (-(19 / 20 : ℝ) - 1) := (Real.rpow_sub hm _ _).symm + _ = _ := by norm_num + have hsqrt : Real.sqrt (m ^ (-(19 / 20 : ℝ)) / m) = + m ^ (-(39 / 40 : ℝ)) := by + rw [hdiv, Real.sqrt_eq_rpow, ← Real.rpow_mul hm.le] + norm_num + rw [hsqrt] + calc + _ = κ * (m ^ (1 : ℝ) * m ^ (-(39 / 40 : ℝ))) := by + rw [Real.rpow_one] + ring + _ = κ * m ^ ((1 : ℝ) + -(39 / 40 : ℝ)) := by rw [Real.rpow_add hm] + _ = _ := by norm_num + +end TailScaleCover + +namespace CircleParameterLaws +open CircleParameterData +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem index_le_tail_horizon (s : ℕ) (hs : 1 ≤ s) : + (s : ℝ) ≤ (p.m s : ℝ) ^ ((4 / 5 : ℝ) * p.m s) := by + have hsm : s ≤ p.m s := (Nat.lt_two_pow_self.le).trans (hp.m_ge_pow s hs) + have hm200 : (200 : ℝ) ≤ p.m s := by exact_mod_cast hp.m_ge_200 s hs + calc + (s : ℝ) ≤ (p.m s : ℝ) := by exact_mod_cast hsm + _ = (p.m s : ℝ) ^ (1 : ℝ) := (Real.rpow_one _).symm + _ ≤ _ := Real.rpow_le_rpow_of_exponent_le (by linarith) (by linarith) + +theorem tail_windows_cover (j : ℕ) (hj : 1 ≤ j) (t : ℝ) + (ht : p.N j / 4 ≤ t) : + ∃ s : ℕ, j ≤ s ∧ t ≤ (p.m s : ℝ) ^ ((4 / 5 : ℝ) * p.m s) ∧ + ((s = j ∧ p.N s / 4 ≤ t) ∨ (j < s ∧ (p.G s : ℝ) * p.K s ≤ t)) := by + obtain ⟨s, hjs, hs, hleft⟩ := TailScaleCover.exists_window_of_overlap + (fun s => (p.G s : ℝ) * p.K s) + (fun s => (p.m s : ℝ) ^ ((4 / 5 : ℝ) * p.m s)) j t + (by + intro R + obtain ⟨n, hn⟩ := exists_nat_gt (max R (j : ℝ)) + have hjn : j ≤ n := by + have hlt : (j : ℝ) < n := (le_max_right _ _).trans_lt hn + exact_mod_cast hlt.le + refine ⟨n, hjn, ?_⟩ + exact ((le_max_left _ _).trans hn.le).trans + (hp.index_le_tail_horizon n (hj.trans hjn))) + (fun s hs => (hp.next_G_gap s (hj.trans hs)).le) + refine ⟨s, hjs, hs, ?_⟩ + rcases hleft with hsj | hleft + · left + exact ⟨hsj, hsj ▸ ht⟩ + · by_cases hsj : s = j + · left + exact ⟨hsj, hsj ▸ ht⟩ + · right + exact ⟨lt_of_le_of_ne hjs (Ne.symm hsj), hleft⟩ + +theorem upper_crossing_intensity (j s : ℕ) (hj : 1 ≤ j) (hjs : j ≤ s) : + p.L j ≤ (p.m s : ℝ) * + (kappa s * Real.sqrt (p.b s / (p.m s : ℝ))) := by + have hs := hj.trans hjs + have hm : 0 < (p.m s : ℝ) := by exact_mod_cast hp.m_pos s hs + rw [CircleParameterData.b, TailScaleCover.upper_intensity_eq _ _ hm] + exact (hp.L_monotone j s hj hjs).trans (hp.attenuation_m s hs) + +theorem lower_crossing_intensity (j s : ℕ) (hj : 1 ≤ j) (hjs : j < s) : + p.L j ≤ (p.m s : ℝ) * + (kappa s * Real.sqrt (p.a s / (p.m s : ℝ))) := by + have hs : 1 ≤ s := by omega + have hm : 0 < (p.m s : ℝ) := by exact_mod_cast hp.m_pos s hs + rw [CircleParameterData.a, TailScaleCover.lower_intensity_eq _ _ _ + (Nat.cast_nonneg _) hm] + have hatten := hp.attenuation_G (s - 1) (by omega) + have heq : s - 1 + 1 = s := by omega + rw [heq] at hatten + exact (hp.L_monotone j (s - 1) hj (by omega)).trans hatten + +theorem exists_tail_crossing_set (j : ℕ) (hj : 1 ≤ j) (k : ℤ) + (hk : p.N j / 4 ≤ |(k : ℝ)|) : + ∃ (s : ℕ) (w : ℝ) (I : Finset ℕ), + j ≤ s ∧ (w = p.b s ∨ (j < s ∧ w = p.a s)) ∧ + I ⊆ p.block s ∧ (p.m s : ℝ) / 20 ≤ (I.card : ℝ) ∧ + (∀ i ∈ I, 1 - Int.fract ((k : ℝ) * p.alpha θ i) ∈ Set.Icc w (1 - w)) ∧ + p.L j ≤ (p.m s : ℝ) * (kappa s * Real.sqrt (w / (p.m s : ℝ))) ∧ + p.L j ≤ p.C s := by + classical + obtain ⟨s, hjs, htop, hleft⟩ := hp.tail_windows_cover j hj |(k : ℝ)| hk + have hs : 1 ≤ s := hj.trans hjs + have hcost : p.L j ≤ p.C s := by + rw [hp.C_eq s hs] + exact (hp.L_monotone j s hj hjs).trans (le_max_left _ _) + by_cases hhigh : p.N s / 4 ≤ |(k : ℝ)| + · let I := (p.block s).filter (fun i => + 1 - Int.fract ((k : ℝ) * p.alpha θ i) ∈ Set.Icc (p.b s) (1 - p.b s)) + refine ⟨s, p.b s, I, hjs, Or.inl rfl, Finset.filter_subset _ _, + hp.spread_high s hs k hhigh htop, ?_, + hp.upper_crossing_intensity j s hj hjs, hcost⟩ + intro i hi + exact (Finset.mem_filter.mp hi).2 + · have hlow : j < s ∧ (p.G s : ℝ) * p.K s ≤ |(k : ℝ)| := by + rcases hleft with ⟨hsj, hstart⟩ | hlow + · exact False.elim (hhigh hstart) + · exact hlow + refine ⟨s, p.a s, p.block s, hjs, Or.inr ⟨hlow.1, rfl⟩, + Finset.Subset.refl _, ?_, hp.spread_low s hs k hlow.2 (le_of_not_ge hhigh), + hp.lower_crossing_intensity j s hj hlow.1, hcost⟩ + rw [p.card_block s hs] + have hm : 0 ≤ (p.m s : ℝ) := Nat.cast_nonneg _ + linarith + +end CircleParameterLaws +end Invariant233 + +noncomputable section +open Set +open scoped BigOperators + +namespace Invariant233.TailScaleCover + +theorem exists_window + (a b Q : ℕ → ℝ) (j : ℕ) + (hgap : ∀ s, j ≤ s → a (s + 1) ≤ Q s) + (hunbounded : ∀ R : ℝ, ∃ s, j ≤ s ∧ R ≤ Q s) + {t : ℝ} (ht : b j ≤ t) : + ∃ s, j ≤ s ∧ + ((b s ≤ t ∧ t ≤ Q s) ∨ (j < s ∧ a s ≤ t ∧ t ≤ b s)) := by + classical + let h := hunbounded t + let s := Nat.find h + have hs : j ≤ s ∧ t ≤ Q s := Nat.find_spec h + refine ⟨s, hs.1, ?_⟩ + by_cases hb : b s ≤ t + · exact Or.inl ⟨hb, hs.2⟩ + · right + have hjs : j < s := by + apply lt_of_le_of_ne hs.1 + intro heq + exact hb (heq ▸ ht) + have hprev : Q (s - 1) < t := by + by_contra hnot + have hsmall : s ≤ s - 1 := Nat.find_min' h ⟨by omega, le_of_not_gt hnot⟩ + omega + have ha : a s ≤ t := by + have hg := hgap (s - 1) (by omega) + rw [Nat.sub_add_cancel (by omega : 1 ≤ s)] at hg + exact hg.trans hprev.le + exact ⟨hjs, ha, le_of_not_ge hb⟩ + +def upperHorizon (m : ℕ) : ℝ := (m : ℝ) ^ ((4 / 5 : ℝ) * m) + +theorem self_le_upperHorizon {m : ℕ} (hm : 2 ≤ m) : + (m : ℝ) ≤ upperHorizon m := by + apply Real.self_le_rpow_of_one_le + · exact_mod_cast (show 1 ≤ m by omega) + · have hm' : (2 : ℝ) ≤ m := by exact_mod_cast hm + linarith + +theorem intensity_small (κ m G : ℝ) (hm : 0 < m) (hG : 0 ≤ G) : + m * CouplingMarginalBounds.rho κ m (G / m) = κ * Real.sqrt G := by + unfold CouplingMarginalBounds.rho + have hdiv : (G / m) / m = G / m ^ 2 := by ring + rw [hdiv, Real.sqrt_div hG, Real.sqrt_sq_eq_abs, abs_of_pos hm] + field_simp + +theorem intensity_large (κ m : ℝ) (hm : 0 < m) : + m * CouplingMarginalBounds.rho κ m (m ^ (-(19 / 20 : ℝ))) = + κ * m ^ (1 / 40 : ℝ) := by + unfold CouplingMarginalBounds.rho + rw [Real.sqrt_eq_rpow] + have hdiv : m ^ (-(19 / 20 : ℝ)) / m = m ^ (-(39 / 20 : ℝ)) := by + rw [show (-(39 / 20 : ℝ)) = -(19 / 20 : ℝ) - 1 by norm_num, + Real.rpow_sub hm, Real.rpow_one] + rw [hdiv, ← Real.rpow_mul hm.le] + have hpow : m * m ^ ((-(39 / 20 : ℝ)) * (1 / 2 : ℝ)) = + m ^ (1 / 40 : ℝ) := by + calc + _ = m ^ (1 : ℝ) * m ^ ((-(39 / 20 : ℝ)) * (1 / 2 : ℝ)) := by + rw [Real.rpow_one] + _ = m ^ (1 + (-(39 / 20 : ℝ)) * (1 / 2 : ℝ)) := + (Real.rpow_add hm _ _).symm + _ = _ := by norm_num + calc + m * (κ * m ^ ((-(39 / 20 : ℝ)) * (1 / 2 : ℝ))) = + κ * (m * m ^ ((-(39 / 20 : ℝ)) * (1 / 2 : ℝ))) := by ring + _ = _ := by rw [hpow] + +theorem widths_mem_Icc {m G : ℝ} (hm : 16 ≤ m) (hG : 1 ≤ G) + (hGm : 4 * G ≤ m) : + G / m ∈ Set.Icc (1 / m) (1 / 4) ∧ + m ^ (-(19 / 20 : ℝ)) ∈ Set.Icc (1 / m) (1 / 4) := by + have hmpos : 0 < m := by linarith + have hmone : 1 ≤ m := by linarith + constructor + · constructor + · exact div_le_div_of_nonneg_right hG hmpos.le + · apply (div_le_iff₀ hmpos).mpr + linarith + · rw [Real.rpow_neg hmpos.le, inv_eq_one_div] + constructor + · apply one_div_le_one_div_of_le (Real.rpow_pos_of_pos hmpos _) + calc + m ^ (19 / 20 : ℝ) ≤ m ^ (1 : ℝ) := + Real.rpow_le_rpow_of_exponent_le hmone (by norm_num) + _ = m := Real.rpow_one _ + · apply one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 4) + have hsqrt : 4 ≤ Real.sqrt m := by + nlinarith [Real.sq_sqrt hmpos.le, Real.sqrt_nonneg m] + calc + 4 ≤ Real.sqrt m := hsqrt + _ = m ^ (1 / 2 : ℝ) := Real.sqrt_eq_rpow _ + _ ≤ m ^ (19 / 20 : ℝ) := + Real.rpow_le_rpow_of_exponent_le hmone (by norm_num) + +end Invariant233.TailScaleCover + +namespace Invariant233.CircleParameterLaws + +open CircleParameterData TailScaleCover + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem upperHorizon_unbounded (j : ℕ) (hj : 1 ≤ j) (R : ℝ) : + ∃ s, j ≤ s ∧ R ≤ upperHorizon (p.m s) := by + obtain ⟨n, hn⟩ := exists_nat_gt R + let s := max j n + have hjs : j ≤ s := le_max_left _ _ + have hs : 1 ≤ s := hj.trans hjs + have hsm : s ≤ p.m s := + (Nat.lt_two_pow_self (n := s)).le.trans (hp.m_ge_pow s hs) + refine ⟨s, hjs, ?_⟩ + calc + R ≤ (n : ℝ) := hn.le + _ ≤ (s : ℝ) := by exact_mod_cast (le_max_right j n) + _ ≤ (p.m s : ℝ) := by exact_mod_cast hsm + _ ≤ upperHorizon (p.m s) := self_le_upperHorizon (by + have := hp.m_ge_200 s hs + omega) + +theorem exists_tail_window (j : ℕ) (hj : 1 ≤ j) {t : ℝ} + (ht : p.N j / 4 ≤ t) : + ∃ s, j ≤ s ∧ + ((p.N s / 4 ≤ t ∧ t ≤ upperHorizon (p.m s)) ∨ + (j < s ∧ (p.G s : ℝ) * p.K s ≤ t ∧ t ≤ p.N s / 4)) := by + apply exists_window (fun s => (p.G s : ℝ) * p.K s) + (fun s => p.N s / 4) (fun s => upperHorizon (p.m s)) j + · intro s hs + exact (hp.next_G_gap s (hj.trans hs)).le + · exact hp.upperHorizon_unbounded j hj + · exact ht + +theorem exists_tail_thresholds (j : ℕ) (hj : 1 ≤ j) (k : ℤ) + (hk : p.N j / 4 ≤ |(k : ℝ)|) : + ∃ (s : ℕ) (w : ℝ) (I : Finset ℕ), + j ≤ s ∧ (w = p.b s ∨ (j < s ∧ w = p.a s)) ∧ + I ⊆ p.block s ∧ (p.m s : ℝ) / 20 ≤ I.card ∧ + (∀ i ∈ I, 1 - Int.fract ((k : ℝ) * p.alpha θ i) ∈ Set.Icc w (1 - w)) ∧ + p.L j ≤ (p.m s : ℝ) * CouplingMarginalBounds.rho (kappa s) (p.m s) w ∧ + p.L j ≤ p.C s := by + classical + obtain ⟨s, hjs, hs⟩ := hp.exists_tail_window j hj hk + have hspos : 1 ≤ s := hj.trans hjs + have hm : (0 : ℝ) < p.m s := by exact_mod_cast hp.m_pos s hspos + have hL : p.L j ≤ p.L s := hp.L_monotone j s hj hjs + have hC : p.L j ≤ p.C s := by + rw [hp.C_eq s hspos] + exact hL.trans (le_max_left _ _) + rcases hs with hhigh | hlow + · refine ⟨s, p.b s, (p.block s).filter (fun i => + 1 - Int.fract ((k : ℝ) * p.alpha θ i) ∈ Set.Icc (p.b s) (1 - p.b s)), + hjs, Or.inl rfl, Finset.filter_subset _ _, + hp.spread_high s hspos k hhigh.1 hhigh.2, ?_, ?_, hC⟩ + · intro i hi + exact (Finset.mem_filter.mp hi).2 + · rw [CircleParameterData.b, intensity_large _ _ hm] + exact hL.trans (hp.attenuation_m s hspos) + · refine ⟨s, p.a s, p.block s, hjs, Or.inr ⟨hlow.1, rfl⟩, + Finset.Subset.refl _, ?_, hp.spread_low s hspos k hlow.2.1 hlow.2.2, ?_, hC⟩ + · rw [p.card_block s hspos] + linarith [hm.le] + · rw [CircleParameterData.a, intensity_small _ _ _ hm (Nat.cast_nonneg _)] + have hprev : 1 ≤ s - 1 := by omega + have hjs' : j ≤ s - 1 := by omega + have hbound := hp.attenuation_G (s - 1) hprev + rw [Nat.sub_add_cancel (by omega : 1 ≤ s)] at hbound + exact (hp.L_monotone j (s - 1) hj hjs').trans hbound + +theorem exists_admissible_tail_thresholds (j : ℕ) (hj : 1 ≤ j) (k : ℤ) + (hk : p.N j / 4 ≤ |(k : ℝ)|) : + ∃ (s : ℕ) (w : ℝ) (I : Finset ℕ), + j ≤ s ∧ (w = p.b s ∨ (j < s ∧ w = p.a s)) ∧ + w ∈ Set.Icc (1 / (p.m s : ℝ)) (1 / 4) ∧ + I ⊆ p.block s ∧ (p.m s : ℝ) / 20 ≤ I.card ∧ + (∀ i ∈ I, 1 - Int.fract ((k : ℝ) * p.alpha θ i) ∈ Set.Icc w (1 - w)) ∧ + p.L j ≤ (p.m s : ℝ) * CouplingMarginalBounds.rho (kappa s) (p.m s) w ∧ + p.L j ≤ p.C s := by + obtain ⟨s, w, I, hjs, hw, hI, hcard, hphase, hintensity, hC⟩ := + hp.exists_tail_thresholds j hj k hk + have hs : 1 ≤ s := hj.trans hjs + have hwidths := widths_mem_Icc + (show (16 : ℝ) ≤ p.m s by + have hm : (200 : ℝ) ≤ p.m s := by exact_mod_cast hp.m_ge_200 s hs + linarith) + (show (1 : ℝ) ≤ p.G s by exact_mod_cast hp.G_pos s hs) + (show 4 * (p.G s : ℝ) ≤ p.m s by exact_mod_cast hp.m_ge_G s hs) + refine ⟨s, w, I, hjs, hw, ?_, hI, hcard, hphase, hintensity, hC⟩ + rcases hw with rfl | ⟨_, rfl⟩ + · exact hwidths.2 + · exact hwidths.1 + +end Invariant233.CircleParameterLaws + +end +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TestedKernelUnifiedMoments.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TestedKernelUnifiedMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f559a6c49b52dee96ac36a7fd92ba0075480b03 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TestedKernelUnifiedMoments.lean @@ -0,0 +1,88 @@ +import OAI.Analysis.IrrationalRotation.Sampling.TestedSamplingMoments + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.ScalarSampling.TestedSampling + +theorem half_le_common_square_bound {m : ℕ} (hm : 200 ≤ m) : + (1 / 2 : ℝ) ≤ (2 / (m : ℝ)^(-(3 / 5 : ℝ))) * + Real.log ((m : ℝ)^2 / 2) := by + obtain ⟨hh, hh1, _, _⟩ := manuscript_parameters hm + have hmR : (200 : ℝ) ≤ m := by exact_mod_cast hm + have hlog2 : (1 / 2 : ℝ) ≤ Real.log 2 := by + have h := Real.one_sub_inv_le_log_of_pos (by norm_num : (0 : ℝ) < 2) + norm_num at h + exact h + have hlog : (1 / 2 : ℝ) ≤ Real.log ((m : ℝ)^2 / 2) := + hlog2.trans (Real.log_le_log (by norm_num) (by nlinarith)) + have hfactor : (1 : ℝ) ≤ 2 / (m : ℝ)^(-(3 / 5 : ℝ)) := + (le_div_iff₀ hh).2 (by linarith) + calc + (1 / 2 : ℝ) = 1 * (1 / 2) := by ring + _ ≤ (2 / (m : ℝ)^(-(3 / 5 : ℝ))) * Real.log ((m : ℝ)^2 / 2) := + mul_le_mul hfactor hlog (by norm_num) (by positivity) + +theorem firstTriangular_moment_bounds {m : ℕ} (hm : 200 ≤ m) + {E F : Set ℝ} (hE : MeasurableSet E) (hF : MeasurableSet F) : + MomentBounds m (TestedTriangular.firstKernel E F) := by + obtain ⟨hi, hmeas, _, hmean, havg, _⟩ := + TestedTriangular.firstKernel_moment_bounds hE hF + refine ⟨hi, hmeas, ?_, ?_, ?_⟩ + · intro s + exact ⟨intervalIntegral.integral_nonneg_of_forall zero_le_one + (fun t => (TestedTriangular.firstKernel_bounds E F s t).1), + (hmean s).trans (by norm_num)⟩ + · refine ⟨intervalIntegral.integral_nonneg_of_forall zero_le_one + (fun _ => sq_nonneg _), havg.trans ?_⟩ + have hnonneg : 0 ≤ ((m : ℝ)^(-(3 / 5 : ℝ)))^2 / + (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 := by positivity + linarith + · exact ⟨intervalIntegral.integral_nonneg_of_forall zero_le_one (fun _ => + intervalIntegral.integral_nonneg_of_forall zero_le_one (fun _ => sq_nonneg _)), + (TestedTriangular.testedKernel_reverse_square_moments_le hE hF).1.trans + (half_le_common_square_bound hm)⟩ + +theorem secondTriangular_moment_bounds {m : ℕ} (hm : 200 ≤ m) + {E F : Set ℝ} (hE : MeasurableSet E) (hF : MeasurableSet F) : + MomentBounds m (TestedTriangular.secondKernel E F) := by + obtain ⟨hi, hmeas, hnonneg, hmean, havg, _⟩ := + TestedTriangular.secondKernel_moment_bounds hE hF + refine ⟨hi, hmeas, ?_, ?_, ?_⟩ + · intro s + exact ⟨(hnonneg s).1, (hmean s).trans (by norm_num)⟩ + · refine ⟨intervalIntegral.integral_nonneg_of_forall zero_le_one + (fun _ => sq_nonneg _), havg.trans ?_⟩ + have hnonneg : 0 ≤ ((m : ℝ)^(-(3 / 5 : ℝ)))^2 / + (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 := by positivity + linarith + · exact ⟨intervalIntegral.integral_nonneg_of_forall zero_le_one (fun _ => + intervalIntegral.integral_nonneg_of_forall zero_le_one (fun _ => sq_nonneg _)), + (TestedTriangular.testedKernel_reverse_square_moments_le hE hF).2.trans + (half_le_common_square_bound hm)⟩ + +theorem first_choice_moment_bounds {m : ℕ} (hm : 200 ≤ m) + (selected : Prop) [Decidable selected] {E F : Set ℝ} + (hE : MeasurableSet E) (hF : MeasurableSet F) : + MomentBounds m (if selected then TestedTriangular.firstKernel E F + else firstKernel m E F) := by + by_cases h : selected + · simpa [h] using firstTriangular_moment_bounds hm hE hF + · simpa [h] using firstKernel_moment_bounds hm hE hF + +theorem second_choice_moment_bounds {m : ℕ} (hm : 200 ≤ m) + (selected : Prop) [Decidable selected] {E F : Set ℝ} + (hE : MeasurableSet E) (hF : MeasurableSet F) : + MomentBounds m (if selected then TestedTriangular.secondKernel E F + else secondKernel m E F) := by + by_cases h : selected + · simpa [h] using secondTriangular_moment_bounds hm hE hF + · simpa [h] using secondKernel_moment_bounds hm hE hF + +end Invariant233.ScalarSampling.TestedSampling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TestedTriangularMoments.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TestedTriangularMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..38b9fbb8ad175e074427634b0ffd32664c70cc55 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TestedTriangularMoments.lean @@ -0,0 +1,268 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TriangularEndpointKernel +import Mathlib.MeasureTheory.Integral.Prod +import Mathlib.MeasureTheory.Function.Floor + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.ScalarSampling.TestedTriangular + +private theorem intervalIntegrable_of_unit_bound {f : ℝ → ℝ} + (hf : Measurable f) (hbound : ∀ x, ‖f x‖ ≤ 1) : + IntervalIntegrable f volume 0 1 := by + apply (intervalIntegrable_iff_integrableOn_Ioc_of_le (by norm_num : (0 : ℝ) ≤ 1)).2 + exact IntegrableOn.of_bound (by simp) hf.aestronglyMeasurable 1 + (Filter.Eventually.of_forall hbound) + +private theorem interval_average_measurable {u : ℝ → ℝ → ℝ} + (hu : Measurable (Function.uncurry u)) : + Measurable (fun s => ∫ t in (0 : ℝ)..1, u s t) := by + simp only [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] + exact hu.stronglyMeasurable.integral_prod_right.measurable + +private theorem norm_le_one_of_bounds {x : ℝ} (hx : 0 ≤ x ∧ x ≤ 1) : ‖x‖ ≤ 1 := by + rw [Real.norm_eq_abs, abs_of_nonneg hx.1] + exact hx.2 + +theorem dominated_unitKernel_moments {u K : ℝ → ℝ → ℝ} + (hu : Measurable (Function.uncurry u)) + (hK : Measurable (Function.uncurry K)) + (hKbound : ∀ s t, 0 ≤ K s t ∧ K s t ≤ 1) + (hubound : ∀ s t, 0 ≤ u s t ∧ u s t ≤ K s t) : + (∀ s, IntervalIntegrable (u s) volume 0 1) ∧ + Measurable (fun s => ∫ t in (0 : ℝ)..1, u s t) ∧ + (∀ s, 0 ≤ (∫ t in (0 : ℝ)..1, u s t) ∧ + (∫ t in (0 : ℝ)..1, u s t) ≤ (∫ t in (0 : ℝ)..1, K s t)) ∧ + (∀ s, (∫ t in (0 : ℝ)..1, u s t) ≤ 1) ∧ + (∫ s in (0 : ℝ)..1, (∫ t in (0 : ℝ)..1, u s t) ^ 2) ≤ + (∫ s in (0 : ℝ)..1, (∫ t in (0 : ℝ)..1, K s t) ^ 2) ∧ + (∫ s in (0 : ℝ)..1, ∫ t in (0 : ℝ)..1, u s t ^ 2) ≤ + (∫ s in (0 : ℝ)..1, ∫ t in (0 : ℝ)..1, K s t ^ 2) := by + have hu01 (s t : ℝ) : 0 ≤ u s t ∧ u s t ≤ 1 := + ⟨(hubound s t).1, (hubound s t).2.trans (hKbound s t).2⟩ + have ui (s : ℝ) : IntervalIntegrable (u s) volume 0 1 := + intervalIntegrable_of_unit_bound + (hu.comp (measurable_const.prodMk measurable_id)) + (fun t => norm_le_one_of_bounds (hu01 s t)) + have Ki (s : ℝ) : IntervalIntegrable (K s) volume 0 1 := + intervalIntegrable_of_unit_bound + (hK.comp (measurable_const.prodMk measurable_id)) + (fun t => norm_le_one_of_bounds (hKbound s t)) + have means (s : ℝ) : 0 ≤ (∫ t in (0 : ℝ)..1, u s t) ∧ + (∫ t in (0 : ℝ)..1, u s t) ≤ (∫ t in (0 : ℝ)..1, K s t) := by + constructor + · exact intervalIntegral.integral_nonneg_of_forall zero_le_one (fun t => (hubound s t).1) + · exact intervalIntegral.integral_mono zero_le_one (ui s) (Ki s) + (fun t => (hubound s t).2) + have Kmean01 (s : ℝ) : 0 ≤ (∫ t in (0 : ℝ)..1, K s t) ∧ + (∫ t in (0 : ℝ)..1, K s t) ≤ 1 := by + constructor + · exact intervalIntegral.integral_nonneg_of_forall zero_le_one (fun t => (hKbound s t).1) + · calc + _ ≤ ∫ _t in (0 : ℝ)..1, (1 : ℝ) := + intervalIntegral.integral_mono zero_le_one (Ki s) intervalIntegrable_const + (fun t => (hKbound s t).2) + _ = 1 := by norm_num + have umean01 (s : ℝ) : 0 ≤ (∫ t in (0 : ℝ)..1, u s t) ∧ + (∫ t in (0 : ℝ)..1, u s t) ≤ 1 := + ⟨(means s).1, (means s).2.trans (Kmean01 s).2⟩ + have sq01 {x : ℝ} (hx : 0 ≤ x ∧ x ≤ 1) : 0 ≤ x ^ 2 ∧ x ^ 2 ≤ 1 := + ⟨sq_nonneg x, pow_le_one₀ hx.1 hx.2⟩ + refine ⟨ui, interval_average_measurable hu, means, fun s => (umean01 s).2, ?_, ?_⟩ + · apply intervalIntegral.integral_mono zero_le_one + (intervalIntegrable_of_unit_bound ((interval_average_measurable hu).pow_const 2) + (fun s => norm_le_one_of_bounds (sq01 (umean01 s)))) + (intervalIntegrable_of_unit_bound ((interval_average_measurable hK).pow_const 2) + (fun s => norm_le_one_of_bounds (sq01 (Kmean01 s)))) + intro s + exact pow_le_pow_left₀ (means s).1 (means s).2 2 + · have usq (s : ℝ) : IntervalIntegrable (fun t => u s t ^ 2) volume 0 1 := + intervalIntegrable_of_unit_bound + ((hu.comp (measurable_const.prodMk measurable_id)).pow_const 2) + (fun t => norm_le_one_of_bounds (sq01 (hu01 s t))) + have Ksq (s : ℝ) : IntervalIntegrable (fun t => K s t ^ 2) volume 0 1 := + intervalIntegrable_of_unit_bound + ((hK.comp (measurable_const.prodMk measurable_id)).pow_const 2) + (fun t => norm_le_one_of_bounds (sq01 (hKbound s t))) + have inner01 (v : ℝ → ℝ → ℝ) + (vi : ∀ s, IntervalIntegrable (fun t => v s t ^ 2) volume 0 1) + (vb : ∀ s t, 0 ≤ v s t ∧ v s t ≤ 1) (s : ℝ) : + 0 ≤ (∫ t in (0 : ℝ)..1, v s t ^ 2) ∧ + (∫ t in (0 : ℝ)..1, v s t ^ 2) ≤ 1 := by + constructor + · exact intervalIntegral.integral_nonneg_of_forall zero_le_one (fun _ => sq_nonneg _) + · calc + _ ≤ ∫ _t in (0 : ℝ)..1, (1 : ℝ) := + intervalIntegral.integral_mono zero_le_one (vi s) intervalIntegrable_const + (fun t => (sq01 (vb s t)).2) + _ = 1 := by norm_num + apply intervalIntegral.integral_mono zero_le_one + (intervalIntegrable_of_unit_bound (interval_average_measurable (hu.pow_const 2)) + (fun s => norm_le_one_of_bounds (inner01 u usq hu01 s))) + (intervalIntegrable_of_unit_bound (interval_average_measurable (hK.pow_const 2)) + (fun s => norm_le_one_of_bounds (inner01 K Ksq hKbound s))) + intro s + exact intervalIntegral.integral_mono zero_le_one (usq s) (Ksq s) + (fun t => pow_le_pow_left₀ (hubound s t).1 (hubound s t).2 2) + +def firstKernel (E F : Set ℝ) (s t : ℝ) : ℝ := + triangularKernel s t * E.indicator (fun _ => 1) s * + F.indicator (fun _ => 1) (Int.fract (s + t)) + +theorem triangularKernel_measurable : Measurable (Function.uncurry triangularKernel) := by + change Measurable (fun p : ℝ × ℝ => triangularKernel p.1 p.2) + simp only [triangularKernel, Set.indicator_apply, Set.mem_Ioo] + exact Measurable.ite + ((measurableSet_lt measurable_const measurable_snd).inter + (measurableSet_lt measurable_snd (measurable_const.sub measurable_fst))) + measurable_const measurable_const + +theorem triangularKernel_bounds (s t : ℝ) : + 0 ≤ triangularKernel s t ∧ triangularKernel s t ≤ 1 := by + unfold triangularKernel + by_cases h : t ∈ Ioo 0 (1 - s) <;> simp [h] + +theorem firstKernel_measurable {E F : Set ℝ} + (hE : MeasurableSet E) (hF : MeasurableSet F) : + Measurable (Function.uncurry (firstKernel E F)) := by + exact (triangularKernel_measurable.mul + ((measurable_const.indicator hE).comp measurable_fst)).mul + ((measurable_const.indicator hF).comp + (measurable_fract.comp (measurable_fst.add measurable_snd))) + +theorem firstKernel_bounds (E F : Set ℝ) (s t : ℝ) : + 0 ≤ firstKernel E F s t ∧ firstKernel E F s t ≤ triangularKernel s t := by + have h := triangularKernel_bounds s t + by_cases hs : s ∈ E <;> by_cases ht : Int.fract (s + t) ∈ F <;> + simp [firstKernel, hs, ht, h.1] + +theorem firstKernel_moment_bounds {E F : Set ℝ} + (hE : MeasurableSet E) (hF : MeasurableSet F) : + (∀ s, IntervalIntegrable (firstKernel E F s) volume 0 1) ∧ + Measurable (fun s => ∫ t in (0 : ℝ)..1, firstKernel E F s t) ∧ + (∀ s ∈ Icc (0 : ℝ) 1, + 0 ≤ (∫ t in (0 : ℝ)..1, firstKernel E F s t) ∧ + (∫ t in (0 : ℝ)..1, firstKernel E F s t) ≤ 1 - s) ∧ + (∀ s, (∫ t in (0 : ℝ)..1, firstKernel E F s t) ≤ 1) ∧ + (∫ s in (0 : ℝ)..1, (∫ t in (0 : ℝ)..1, firstKernel E F s t) ^ 2) ≤ 1 / 3 ∧ + (∫ s in (0 : ℝ)..1, ∫ t in (0 : ℝ)..1, firstKernel E F s t ^ 2) ≤ 1 / 2 := by + obtain ⟨hi, hm, havg, hone, havgsq, hsq⟩ := dominated_unitKernel_moments + (firstKernel_measurable hE hF) triangularKernel_measurable + triangularKernel_bounds (firstKernel_bounds E F) + refine ⟨hi, hm, ?_, hone, ?_, ?_⟩ + · intro s hs + exact ⟨(havg s).1, (havg s).2.trans_eq (interval_integral_triangularKernel hs)⟩ + · exact havgsq.trans_eq triangularKernel_averaged_secondMoment + · exact hsq.trans_eq triangularKernel_secondMoment + +def secondKernel (E F : Set ℝ) (s t : ℝ) : ℝ := + triangularKernel (Int.fract (s - t)) t * + E.indicator (fun _ => 1) (Int.fract (s - t)) * F.indicator (fun _ => 1) s + +theorem endpointKernel_measurable : + Measurable (fun p : ℝ × ℝ => triangularKernel (Int.fract (p.1 - p.2)) p.2) := + triangularKernel_measurable.comp + ((measurable_fract.comp (measurable_fst.sub measurable_snd)).prodMk measurable_snd) + +theorem secondKernel_measurable {E F : Set ℝ} + (hE : MeasurableSet E) (hF : MeasurableSet F) : + Measurable (Function.uncurry (secondKernel E F)) := by + exact (endpointKernel_measurable.mul + ((measurable_const.indicator hE).comp + (measurable_fract.comp (measurable_fst.sub measurable_snd)))).mul + ((measurable_const.indicator hF).comp measurable_fst) + +theorem secondKernel_bounds (E F : Set ℝ) (s t : ℝ) : + 0 ≤ secondKernel E F s t ∧ + secondKernel E F s t ≤ triangularKernel (Int.fract (s - t)) t := by + have h := triangularKernel_bounds (Int.fract (s - t)) t + by_cases hx : Int.fract (s - t) ∈ E <;> by_cases hy : s ∈ F <;> + simp [secondKernel, hx, hy, h.1] + +theorem secondKernel_moment_bounds {E F : Set ℝ} + (hE : MeasurableSet E) (hF : MeasurableSet F) : + (∀ s, IntervalIntegrable (secondKernel E F s) volume 0 1) ∧ + Measurable (fun s => ∫ t in (0 : ℝ)..1, secondKernel E F s t) ∧ + (∀ s, 0 ≤ (∫ t in (0 : ℝ)..1, secondKernel E F s t) ∧ + (∫ t in (0 : ℝ)..1, secondKernel E F s t) ≤ Int.fract s) ∧ + (∀ s, (∫ t in (0 : ℝ)..1, secondKernel E F s t) ≤ 1) ∧ + (∫ s in (0 : ℝ)..1, (∫ t in (0 : ℝ)..1, secondKernel E F s t) ^ 2) ≤ 1 / 3 ∧ + (∫ s in (0 : ℝ)..1, ∫ t in (0 : ℝ)..1, secondKernel E F s t ^ 2) ≤ 1 / 2 := by + obtain ⟨hi, hm, havg, hone, havgsq, hsq⟩ := dominated_unitKernel_moments + (K := fun s t => triangularKernel (Int.fract (s - t)) t) + (secondKernel_measurable hE hF) endpointKernel_measurable + (fun s t => triangularKernel_bounds (Int.fract (s - t)) t) (secondKernel_bounds E F) + refine ⟨hi, hm, ?_, hone, ?_, ?_⟩ + · intro s + exact ⟨(havg s).1, + (havg s).2.trans_eq (interval_integral_endpoint_triangularKernel_periodic s)⟩ + · exact havgsq.trans_eq endpoint_triangularKernel_averaged_secondMoment + · exact hsq.trans_eq endpoint_triangularKernel_secondMoment + +@[simp] theorem firstKernel_univ_univ (s t : ℝ) : + firstKernel univ univ s t = triangularKernel s t := by + simp [firstKernel] + +@[simp] theorem secondKernel_univ_univ (s t : ℝ) : + secondKernel univ univ s t = triangularKernel (Int.fract (s - t)) t := by + simp [secondKernel] + +theorem firstKernel_sq (E F : Set ℝ) (s t : ℝ) : + firstKernel E F s t ^ 2 = firstKernel E F s t := by + by_cases hs : s ∈ E <;> by_cases ht : Int.fract (s + t) ∈ F <;> + simp [firstKernel, hs, ht, triangularKernel_sq] + +theorem secondKernel_sq (E F : Set ℝ) (s t : ℝ) : + secondKernel E F s t ^ 2 = secondKernel E F s t := by + by_cases hx : Int.fract (s - t) ∈ E <;> by_cases hy : s ∈ F <;> + simp [secondKernel, hx, hy, triangularKernel_sq] + +theorem testedKernel_masses_le {E F : Set ℝ} + (hE : MeasurableSet E) (hF : MeasurableSet F) : + (∫ s in (0 : ℝ)..1, ∫ t in (0 : ℝ)..1, firstKernel E F s t) ≤ 1 / 2 ∧ + (∫ s in (0 : ℝ)..1, ∫ t in (0 : ℝ)..1, secondKernel E F s t) ≤ 1 / 2 := by + constructor + · simpa only [firstKernel_sq] using (firstKernel_moment_bounds hE hF).2.2.2.2.2 + · simpa only [secondKernel_sq] using (secondKernel_moment_bounds hE hF).2.2.2.2.2 + +theorem testedKernel_square_integrable {E F : Set ℝ} + (hE : MeasurableSet E) (hF : MeasurableSet F) : + IntegrableOn (fun p : ℝ × ℝ => firstKernel E F p.1 p.2 ^ 2) + (uIoc (0 : ℝ) 1 ×ˢ uIoc (0 : ℝ) 1) ∧ + IntegrableOn (fun p : ℝ × ℝ => secondKernel E F p.1 p.2 ^ 2) + (uIoc (0 : ℝ) 1 ×ˢ uIoc (0 : ℝ) 1) := by + constructor + · apply integrableOn_unitSquare_of_bound + (F := fun s t => firstKernel E F s t ^ 2) (C := 1) + ((firstKernel_measurable hE hF).pow_const 2) + intro s t + rw [firstKernel_sq, Real.norm_eq_abs, abs_of_nonneg (firstKernel_bounds E F s t).1] + exact (firstKernel_bounds E F s t).2.trans (triangularKernel_bounds s t).2 + · apply integrableOn_unitSquare_of_bound + (F := fun s t => secondKernel E F s t ^ 2) (C := 1) + ((secondKernel_measurable hE hF).pow_const 2) + intro s t + rw [secondKernel_sq, Real.norm_eq_abs, abs_of_nonneg (secondKernel_bounds E F s t).1] + exact (secondKernel_bounds E F s t).2.trans + (triangularKernel_bounds (Int.fract (s - t)) t).2 + +theorem testedKernel_reverse_square_moments_le {E F : Set ℝ} + (hE : MeasurableSet E) (hF : MeasurableSet F) : + (∫ t in (0 : ℝ)..1, ∫ s in (0 : ℝ)..1, firstKernel E F s t ^ 2) ≤ 1 / 2 ∧ + (∫ t in (0 : ℝ)..1, ∫ s in (0 : ℝ)..1, secondKernel E F s t ^ 2) ≤ 1 / 2 := by + obtain ⟨hi, hj⟩ := testedKernel_square_integrable hE hF + constructor + · rw [← intervalIntegral_intervalIntegral_swap + (F := fun s t => firstKernel E F s t ^ 2) hi] + exact (firstKernel_moment_bounds hE hF).2.2.2.2.2 + · rw [← intervalIntegral_intervalIntegral_swap + (F := fun s t => secondKernel E F s t ^ 2) hj] + exact (secondKernel_moment_bounds hE hF).2.2.2.2.2 + +end Invariant233.ScalarSampling.TestedTriangular + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TestedTriangularVariation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TestedTriangularVariation.lean new file mode 100644 index 0000000000000000000000000000000000000000..adac8ac8ef9802691897df609fc8120f890fc194 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TestedTriangularVariation.lean @@ -0,0 +1,119 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TestedTriangularMoments + +namespace OAI + +noncomputable section +open Set +attribute [local instance] Classical.propDecidable + +namespace Invariant233.ScalarSampling.TestedTriangular + +theorem firstKernel_interval_eq (E : Set ℝ) (a b : ℝ) {s : ℝ} + (hs : s ∈ Ico (0 : ℝ) 1) (t : ℝ) : + firstKernel E (Ico a b) s t = + if s ∈ E then + if a ≤ s + t then if s + t < b then triangularKernel s t else 0 else 0 + else 0 := by + by_cases ht : t ∈ Ioo 0 (1 - s) + · have hfract : Int.fract (s + t) = s + t := + Int.fract_eq_self.mpr ⟨by linarith [hs.1, ht.1], by linarith [ht.2]⟩ + by_cases hE : s ∈ E <;> by_cases ha : a ≤ s + t <;> by_cases hb : s + t < b <;> + simp [firstKernel, triangularKernel, ht, hfract, hE, ha, hb] + · simp [firstKernel, triangularKernel, ht] + +theorem secondKernel_interval_eq (F : Set ℝ) (a b : ℝ) {s : ℝ} + (hs : s ∈ Ico (0 : ℝ) 1) (t : ℝ) : + secondKernel (Ico a b) F s t = + if s ∈ F then + if a ≤ s - t then + if s - t < b then triangularKernel (Int.fract (s - t)) t else 0 + else 0 + else 0 := by + by_cases ht : t ∈ Ioc 0 s + · have hfract : Int.fract (s - t) = s - t := + Int.fract_eq_self.mpr ⟨sub_nonneg.mpr ht.2, by linarith [hs.2, ht.1]⟩ + by_cases hF : s ∈ F <;> by_cases ha : a ≤ s - t <;> by_cases hb : s - t < b <;> + simp [secondKernel, hfract, hF, ha, hb] + · have hzero : triangularKernel (Int.fract (s - t)) t = 0 := by + rw [endpoint_triangularKernel_eq_indicator hs t] + exact indicator_of_notMem ht _ + simp [secondKernel, hzero] + +private theorem zero_control : VariationControl (fun _ : ℝ => 0) 1 4 := by + refine ⟨fun _ => le_rfl, fun _ => zero_le_one, ?_⟩ + have hz := monotone_variation_le_height + (f := fun _ : ℝ => 0) (C := 0) (by intro x hx y hy hxy; rfl) + (fun _ _ => ⟨le_rfl, le_rfl⟩) + exact hz.trans (by norm_num) + +theorem firstKernel_interval_control (E : Set ℝ) (a b : ℝ) {s : ℝ} + (hs : s ∈ Ico (0 : ℝ) 1) : + VariationControl (firstKernel E (Ico a b) s) 1 4 := by + have h1 := (triangularKernel_control s).mask (by norm_num) (by norm_num) + (fun t => s + t < b) + (Or.inr (by intro x y hxy hy; linarith)) + have h2 := h1.mask (by norm_num) (by norm_num) (fun t => a ≤ s + t) + (Or.inl (by intro x y hxy hx; linarith)) + by_cases hE : s ∈ E + · convert h2 using 1 + · funext t + simp only [firstKernel_interval_eq E a b hs t, ite_eq_left hE] + · norm_num + · have heq : firstKernel E (Ico a b) s = fun _ => 0 := by + funext t + simp [firstKernel_interval_eq E a b hs t, hE] + rw [heq] + exact zero_control + +theorem secondKernel_interval_control (F : Set ℝ) (a b : ℝ) {s : ℝ} + (hs : s ∈ Ico (0 : ℝ) 1) : + VariationControl (secondKernel (Ico a b) F s) 1 4 := by + have h1 := (endpoint_triangularKernel_control hs).mask (by norm_num) (by norm_num) + (fun t => s - t < b) + (Or.inl (by intro x y hxy hx; linarith)) + have h2 := h1.mask (by norm_num) (by norm_num) (fun t => a ≤ s - t) + (Or.inr (by intro x y hxy hy; linarith)) + by_cases hF : s ∈ F + · convert h2 using 1 + · funext t + simp only [secondKernel_interval_eq F a b hs t, ite_eq_left hF] + · norm_num + · have heq : secondKernel (Ico a b) F s = fun _ => 0 := by + funext t + simp [secondKernel_interval_eq F a b hs t, hF] + rw [heq] + exact zero_control + +private theorem BV_bound_of_control {f : ℝ → ℝ} (hf : VariationControl f 1 4) : + BoundedVariationOn f (Icc (0 : ℝ) 1) ∧ + sSup (Set.range (fun t => |f t|)) + + (eVariationOn f (Icc (0 : ℝ) 1)).toReal ≤ 5 := by + refine ⟨ne_top_of_le_ne_top ENNReal.ofReal_ne_top hf.variation, ?_⟩ + have hv := ENNReal.toReal_le_of_le_ofReal (by norm_num) hf.variation + have hh : sSup (Set.range (fun t => |f t|)) ≤ (1 : ℝ) := by + apply csSup_le (Set.range_nonempty _) + rintro _ ⟨t, rfl⟩ + dsimp only + rw [abs_of_nonneg (hf.nonneg t)] + exact hf.le_height t + linarith + +theorem firstKernel_interval_BV_bound (E : Set ℝ) (a b : ℝ) {s : ℝ} + (hs : s ∈ Ico (0 : ℝ) 1) : + BoundedVariationOn (firstKernel E (Ico a b) s) (Icc (0 : ℝ) 1) ∧ + sSup (Set.range (fun t => |firstKernel E (Ico a b) s t|)) + + (eVariationOn (firstKernel E (Ico a b) s) (Icc (0 : ℝ) 1)).toReal ≤ 5 := + BV_bound_of_control (firstKernel_interval_control E a b hs) + +theorem secondKernel_interval_BV_bound (F : Set ℝ) (a b : ℝ) {s : ℝ} + (hs : s ∈ Ico (0 : ℝ) 1) : + BoundedVariationOn (secondKernel (Ico a b) F s) (Icc (0 : ℝ) 1) ∧ + sSup (Set.range (fun t => |secondKernel (Ico a b) F s t|)) + + (eVariationOn (secondKernel (Ico a b) F s) (Icc (0 : ℝ) 1)).toReal ≤ 5 := + BV_bound_of_control (secondKernel_interval_control F a b hs) + +end Invariant233.ScalarSampling.TestedTriangular + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerApproximationBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerApproximationBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..234d94996e1687e7609c9b7aa4de75c9cf475329 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerApproximationBounds.lean @@ -0,0 +1,97 @@ +import OAI.Analysis.IrrationalRotation.Analysis.SeparatingVectorStrongConvergence +import OAI.Analysis.IrrationalRotation.Rotation.ProjectionDiagonal + +namespace OAI + +noncomputable section +open Filter +open scoped Topology + +namespace Invariant233.TowerApproximation + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +omit [CompleteSpace H] in + +theorem sub_eq_mul_one_sub {A B P : H →L[ℂ] H} (h : A * P = B * P) : + A - B = (A - B) * (1 - P) := by + rw [mul_sub, mul_one, sub_mul, h, sub_self, sub_zero] + +omit [CompleteSpace H] in + +theorem norm_sub_apply_le {A B P : H →L[ℂ] H} (h : A * P = B * P) (ξ : H) : + ‖A ξ - B ξ‖ ≤ (‖A‖ + ‖B‖) * ‖(1 - P) ξ‖ := by + calc + ‖A ξ - B ξ‖ = ‖(A - B) ((1 - P) ξ)‖ := by + change ‖(A - B) ξ‖ = _ + conv_lhs => rw [sub_eq_mul_one_sub h] + rfl + _ ≤ ‖A - B‖ * ‖(1 - P) ξ‖ := (A - B).le_opNorm _ + _ ≤ (‖A‖ + ‖B‖) * ‖(1 - P) ξ‖ := + mul_le_mul_of_nonneg_right (norm_sub_le A B) (norm_nonneg _) + +omit [CompleteSpace H] in + +theorem norm_sub_apply_le_two_mul {A B P : H →L[ℂ] H} + (hA : ‖A‖ ≤ 1) (hB : ‖B‖ ≤ 1) (h : A * P = B * P) (ξ : H) : + ‖A ξ - B ξ‖ ≤ 2 * ‖(1 - P) ξ‖ := by + exact (norm_sub_apply_le h ξ).trans + (mul_le_mul_of_nonneg_right (by linarith) (norm_nonneg _)) + +theorem vectorTrace_projection_re (P : H →L[ℂ] H) (hP : IsStarProjection P) (ξ : H) : + (vectorTrace ξ P).re = ‖P ξ‖ ^ 2 := by + change (inner ℂ ξ (P ξ)).re = _ + calc + (inner ℂ ξ (P ξ)).re = (inner ℂ (P ξ) ξ).re := + inner_re_symm (𝕜 := ℂ) ξ (P ξ) + _ = (inner ℂ (P ξ) (P ξ)).re := by + rw [ProjectionDiagonal.inner_projection_eq_inner_projected P hP ξ] + _ = ‖P ξ‖ ^ 2 := inner_self_eq_norm_sq (𝕜 := ℂ) _ + +theorem norm_sub_apply_sq_le_four_trace_compl {A B P : H →L[ℂ] H} + (hA : ‖A‖ ≤ 1) (hB : ‖B‖ ≤ 1) (hP : IsStarProjection P) + (h : A * P = B * P) (ξ : H) : + ‖A ξ - B ξ‖ ^ 2 ≤ 4 * (vectorTrace ξ (1 - P)).re := by + rw [vectorTrace_projection_re (1 - P) hP.one_sub ξ] + have hnorm := norm_sub_apply_le_two_mul hA hB h ξ + have hs := (sq_le_sq₀ (norm_nonneg (A ξ - B ξ)) + (show 0 ≤ 2 * ‖(1 - P) ξ‖ by positivity)).mpr hnorm + nlinarith + +theorem tendsto_apply_of_complement_trace_tendsto_zero + {ι : Type*} {l : Filter ι} {A : ι → H →L[ℂ] H} {B : H →L[ℂ] H} + {P : ι → H →L[ℂ] H} (ξ : H) + (hA : ∀ i, ‖A i‖ ≤ 1) (hB : ‖B‖ ≤ 1) + (hP : ∀ i, IsStarProjection (P i)) (hagree : ∀ i, A i * P i = B * P i) + (htrace : Tendsto (fun i => (vectorTrace ξ (1 - P i)).re) l (𝓝 0)) : + Tendsto (fun i => A i ξ) l (𝓝 (B ξ)) := by + have hnorm : Tendsto (fun i => ‖(1 - P i) ξ‖) l (𝓝 0) := by + have hsqrt := Real.continuous_sqrt.continuousAt.tendsto.comp htrace + change Tendsto (fun i => Real.sqrt ((vectorTrace ξ (1 - P i)).re)) l + (𝓝 (Real.sqrt 0)) at hsqrt + simpa only [ vectorTrace_projection_re _ (hP _).one_sub ξ, + Real.sqrt_sq (norm_nonneg _), Real.sqrt_zero] using hsqrt + apply tendsto_iff_norm_sub_tendsto_zero.mpr + exact squeeze_zero (fun _ => norm_nonneg _) + (fun i => norm_sub_apply_le_two_mul (hA i) hB (hagree i) ξ) + (by simpa using hnorm.const_mul 2) + +theorem strong_tendsto_of_complement_trace_tendsto_zero + {ι : Type*} {l : Filter ι} {M : VonNeumannAlgebra H} {ξ : H} + (hfaithful : IsFaithfulTracialVector M ξ) + {A : ι → H →L[ℂ] H} {B : H →L[ℂ] H} {P : ι → H →L[ℂ] H} + (hAmem : ∀ i, A i ∈ M) (hBmem : B ∈ M) + (hA : ∀ i, ‖A i‖ ≤ 1) (hB : ‖B‖ ≤ 1) + (hP : ∀ i, IsStarProjection (P i)) (hagree : ∀ i, A i * P i = B * P i) + (htrace : Tendsto (fun i => (vectorTrace ξ (1 - P i)).re) l (𝓝 0)) (v : H) : + Tendsto (fun i => A i v) l (𝓝 (B v)) := + hfaithful.strong_tendsto_of_bounded hAmem hBmem + (tendsto_apply_of_complement_trace_tendsto_zero ξ hA hB hP hagree htrace) + (Filter.Eventually.of_forall hA) v + +end Invariant233.TowerApproximation + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerCyclicShift.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerCyclicShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..78cac9192cb9bb1781d17318ab8edc3212938ecd --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerCyclicShift.lean @@ -0,0 +1,326 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Invariant233.TowerCyclicShift + +variable {R : Type*} [Ring R] [StarRing R] +variable {ι : Type*} [Fintype ι] [DecidableEq ι] + +def diagonalSum (e : ι → ι → R) : R := ∑ i, e i i + +def permutationSum (e : ι → ι → R) (π : Equiv.Perm ι) : R := + ∑ i, e (π i) i + +omit [DecidableEq ι] in +theorem star_permutationSum (e : ι → ι → R) (π : Equiv.Perm ι) + (hstar : ∀ i j, star (e i j) = e j i) : + star (permutationSum e π) = ∑ i, e i (π i) := by + simp only [permutationSum, star_sum, hstar] + +theorem star_permutationSum_mul (e : ι → ι → R) (π : Equiv.Perm ι) + (hstar : ∀ i j, star (e i j) = e j i) + (hmul : ∀ i j k l, e i j * e k l = if j = k then e i l else 0) : + star (permutationSum e π) * permutationSum e π = diagonalSum e := by + rw [star_permutationSum e π hstar] + simp only [permutationSum, Finset.sum_mul_sum, hmul, π.injective.eq_iff] + simp [diagonalSum] + +theorem permutationSum_mul_star (e : ι → ι → R) (π : Equiv.Perm ι) + (hstar : ∀ i j, star (e i j) = e j i) + (hmul : ∀ i j k l, e i j * e k l = if j = k then e i l else 0) : + permutationSum e π * star (permutationSum e π) = diagonalSum e := by + rw [star_permutationSum e π hstar] + simp only [permutationSum, Finset.sum_mul_sum, hmul] + simp only [Finset.sum_ite_eq, Finset.mem_univ, ite_true] + exact Equiv.sum_comp π (fun i ↦ e i i) + +omit [StarRing R] in +theorem permutationSum_mul_diagonal (e : ι → ι → R) (π : Equiv.Perm ι) + (hmul : ∀ i j k l, e i j * e k l = if j = k then e i l else 0) + (i : ι) : + permutationSum e π * e i i = e (π i) i := by + simp [permutationSum, Finset.sum_mul, hmul] + +omit [StarRing R] in +theorem diagonalSum_mul_diagonal (e : ι → ι → R) + (hmul : ∀ i j k l, e i j * e k l = if j = k then e i l else 0) + (i : ι) : diagonalSum e * e i i = e i i := by + simp [diagonalSum, Finset.sum_mul, hmul] + +section Blocks + +variable {β : Type*} [Fintype β] [DecidableEq β] +variable {κ : β → Type*} [∀ b, Fintype (κ b)] [∀ b, DecidableEq (κ b)] + +def blockPermutationSum (e : ∀ b, κ b → κ b → R) + (π : ∀ b, Equiv.Perm (κ b)) : R := ∑ b, permutationSum (e b) (π b) + +omit [Fintype β] [DecidableEq β] [∀ b, DecidableEq (κ b)] in +theorem star_permutationSum_mul_other + (e : ∀ b, κ b → κ b → R) (π : ∀ b, Equiv.Perm (κ b)) + (hstar : ∀ b i j, star (e b i j) = e b j i) + (hcross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0) + {b c : β} (hbc : b ≠ c) : + star (permutationSum (e b) (π b)) * permutationSum (e c) (π c) = 0 := by + rw [star_permutationSum _ _ (hstar b)] + simp only [permutationSum, Finset.sum_mul_sum, hcross b c hbc, + Finset.sum_const_zero] + +omit [Fintype β] [DecidableEq β] [∀ b, DecidableEq (κ b)] in +theorem permutationSum_mul_star_other + (e : ∀ b, κ b → κ b → R) (π : ∀ b, Equiv.Perm (κ b)) + (hstar : ∀ b i j, star (e b i j) = e b j i) + (hcross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0) + {b c : β} (hbc : b ≠ c) : + permutationSum (e b) (π b) * star (permutationSum (e c) (π c)) = 0 := by + rw [star_permutationSum _ _ (hstar c)] + simp only [permutationSum, Finset.sum_mul_sum, hcross b c hbc, + Finset.sum_const_zero] + +theorem star_blockPermutationSum_mul + (e : ∀ b, κ b → κ b → R) (π : ∀ b, Equiv.Perm (κ b)) + (hstar : ∀ b i j, star (e b i j) = e b j i) + (hmul : ∀ b i j k l, e b i j * e b k l = if j = k then e b i l else 0) + (hcross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0) : + star (blockPermutationSum e π) * blockPermutationSum e π = + ∑ b, diagonalSum (e b) := by + simp only [blockPermutationSum, star_sum, Finset.sum_mul_sum] + calc + _ = ∑ b, ∑ c, if b = c then diagonalSum (e b) else 0 := by + apply Finset.sum_congr rfl + intro b hb + apply Finset.sum_congr rfl + intro c hc + by_cases hbc : b = c + · subst c + simp [star_permutationSum_mul _ _ (hstar b) (hmul b)] + · simp only [ite_eq_right hbc, star_permutationSum_mul_other e π hstar hcross hbc] + _ = _ := by simp + +theorem blockPermutationSum_mul_star + (e : ∀ b, κ b → κ b → R) (π : ∀ b, Equiv.Perm (κ b)) + (hstar : ∀ b i j, star (e b i j) = e b j i) + (hmul : ∀ b i j k l, e b i j * e b k l = if j = k then e b i l else 0) + (hcross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0) : + blockPermutationSum e π * star (blockPermutationSum e π) = + ∑ b, diagonalSum (e b) := by + simp only [blockPermutationSum, star_sum, Finset.sum_mul_sum] + calc + _ = ∑ b, ∑ c, if b = c then diagonalSum (e b) else 0 := by + apply Finset.sum_congr rfl + intro b hb + apply Finset.sum_congr rfl + intro c hc + by_cases hbc : b = c + · subst c + simp [permutationSum_mul_star _ _ (hstar b) (hmul b)] + · simp only [ite_eq_right hbc, permutationSum_mul_star_other e π hstar hcross hbc] + _ = _ := by simp + +theorem blockPermutationSum_mem_unitary + (e : ∀ b, κ b → κ b → R) (π : ∀ b, Equiv.Perm (κ b)) + (hstar : ∀ b i j, star (e b i j) = e b j i) + (hmul : ∀ b i j k l, e b i j * e b k l = if j = k then e b i l else 0) + (hcross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0) + (hcomplete : ∑ b, diagonalSum (e b) = 1) : + blockPermutationSum e π ∈ unitary R := by + exact ⟨(star_blockPermutationSum_mul e π hstar hmul hcross).trans hcomplete, + (blockPermutationSum_mul_star e π hstar hmul hcross).trans hcomplete⟩ + +omit [StarRing R] [DecidableEq β] in +theorem blockPermutationSum_mul_diagonal + (e : ∀ b, κ b → κ b → R) (π : ∀ b, Equiv.Perm (κ b)) + (hmul : ∀ b i j k l, e b i j * e b k l = if j = k then e b i l else 0) + (hcross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0) + (b : β) (i : κ b) : + blockPermutationSum e π * e b i i = e b (π b i) i := by + classical + rw [blockPermutationSum, Finset.sum_mul] + rw [Finset.sum_eq_single b] + · exact permutationSum_mul_diagonal _ _ (hmul b) i + · intro c hc hcb + simp only [permutationSum, Finset.sum_mul, hcross c b hcb, + Finset.sum_const_zero] + · simp + +end Blocks + +omit [StarRing R] [DecidableEq ι] in + +theorem sub_eq_sub_mul_sum_of_agree (U A : R) (p : ι → R) (tops : Finset ι) + (hcomplete : ∑ i, p i = 1) + (hagree : ∀ i, i ∉ tops → U * p i = A * p i) : + U - A = (U - A) * ∑ i ∈ tops, p i := by + have hzero (i : ι) (hi : i ∉ tops) : (U - A) * p i = 0 := by + rw [sub_mul, hagree i hi, sub_self] + calc + U - A = (U - A) * ∑ i, p i := by rw [hcomplete, mul_one] + _ = ∑ i, (U - A) * p i := Finset.mul_sum _ _ _ + _ = ∑ i ∈ tops, (U - A) * p i := by + symm + exact Finset.sum_subset (Finset.subset_univ _) (fun i _ hi ↦ hzero i hi) + _ = (U - A) * ∑ i ∈ tops, p i := (Finset.mul_sum _ _ _).symm + +section Cyclic + +variable {β : Type*} [Fintype β] [DecidableEq β] + +def topSum (height : β → ℕ) + (e : ∀ b, Fin (height b + 1) → Fin (height b + 1) → R) : R := + ∑ b, e b (Fin.last (height b)) (Fin.last (height b)) + +def cyclicSum (height : β → ℕ) + (e : ∀ b, Fin (height b + 1) → Fin (height b + 1) → R) : R := + blockPermutationSum e (fun b ↦ finRotate (height b + 1)) + +theorem finRotate_castSucc {n : ℕ} (i : Fin n) : + finRotate (n + 1) i.castSucc = i.succ := by + exact finRotate_of_lt i.isLt + +omit [StarRing R] [DecidableEq β] in + +theorem cyclicSum_eq (height : β → ℕ) + (e : ∀ b, Fin (height b + 1) → Fin (height b + 1) → R) : + cyclicSum height e = ∑ b, + ((∑ i : Fin (height b), e b i.succ i.castSucc) + + e b 0 (Fin.last (height b))) := by + simp only [cyclicSum, blockPermutationSum, permutationSum, + Fin.sum_univ_castSucc, finRotate_castSucc, finRotate_last] + +theorem topSum_isStarProjection (height : β → ℕ) + (e : ∀ b, Fin (height b + 1) → Fin (height b + 1) → R) + (hstar : ∀ b i j, star (e b i j) = e b j i) + (hmul : ∀ b i j k l, e b i j * e b k l = if j = k then e b i l else 0) + (hcross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0) : + IsStarProjection (topSum height e) := by + refine ⟨?_, ?_⟩ + · change topSum height e * topSum height e = topSum height e + simp only [topSum, Finset.sum_mul_sum] + calc + _ = ∑ b, ∑ c, if b = c then + e b (Fin.last (height b)) (Fin.last (height b)) else 0 := by + apply Finset.sum_congr rfl + intro b hb + apply Finset.sum_congr rfl + intro c hc + by_cases hbc : b = c + · subst c + simp [hmul] + · simp [hcross b c hbc, hbc] + _ = _ := by simp + · change star (topSum height e) = topSum height e + simp only [topSum, star_sum, hstar] + +omit [DecidableEq β] in +theorem cyclicSum_mem {𝕜 : Type*} [CommSemiring 𝕜] [StarRing 𝕜] + [Algebra 𝕜 R] [StarModule 𝕜 R] (S : StarSubalgebra 𝕜 R) + (height : β → ℕ) + (e : ∀ b, Fin (height b + 1) → Fin (height b + 1) → R) + (he : ∀ b i j, e b i j ∈ S) : cyclicSum height e ∈ S := by + exact sum_mem fun b _ ↦ sum_mem fun i _ ↦ he b _ i + +omit [DecidableEq β] in +theorem topSum_mem {𝕜 : Type*} [CommSemiring 𝕜] [StarRing 𝕜] + [Algebra 𝕜 R] [StarModule 𝕜 R] (S : StarSubalgebra 𝕜 R) + (height : β → ℕ) + (e : ∀ b, Fin (height b + 1) → Fin (height b + 1) → R) + (he : ∀ b i j, e b i j ∈ S) : topSum height e ∈ S := by + exact sum_mem fun b _ ↦ he b _ _ + +theorem cyclicSum_mem_unitary (height : β → ℕ) + (e : ∀ b, Fin (height b + 1) → Fin (height b + 1) → R) + (hstar : ∀ b i j, star (e b i j) = e b j i) + (hmul : ∀ b i j k l, e b i j * e b k l = if j = k then e b i l else 0) + (hcross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0) + (hcomplete : ∑ b, diagonalSum (e b) = 1) : + cyclicSum height e ∈ unitary R := + blockPermutationSum_mem_unitary e _ hstar hmul hcross hcomplete + +omit [StarRing R] [DecidableEq β] in + +theorem sub_cyclicSum_eq_mul_topSum (height : β → ℕ) + (e : ∀ b, Fin (height b + 1) → Fin (height b + 1) → R) (U : R) + (hmul : ∀ b i j k l, e b i j * e b k l = if j = k then e b i l else 0) + (hcross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0) + (hcomplete : ∑ b, diagonalSum (e b) = 1) + (hshift : ∀ b i, i ≠ Fin.last (height b) → + U * e b i i = e b (finRotate (height b + 1) i) i) : + U - cyclicSum height e = (U - cyclicSum height e) * topSum height e := by + have hzero (b : β) (i : Fin (height b + 1)) (hi : i ≠ Fin.last (height b)) : + (U - cyclicSum height e) * e b i i = 0 := by + rw [sub_mul, hshift b i hi] + rw [cyclicSum, blockPermutationSum_mul_diagonal e _ hmul hcross] + exact sub_self _ + calc + U - cyclicSum height e = + (U - cyclicSum height e) * ∑ b, diagonalSum (e b) := by + rw [hcomplete, mul_one] + _ = ∑ b, ∑ i, (U - cyclicSum height e) * e b i i := by + simp only [diagonalSum, Finset.mul_sum] + _ = ∑ b, (U - cyclicSum height e) * + e b (Fin.last (height b)) (Fin.last (height b)) := by + apply Finset.sum_congr rfl + intro b hb + apply Finset.sum_eq_single (Fin.last (height b)) + · intro i hi hne + exact hzero b i hne + · simp + _ = (U - cyclicSum height e) * topSum height e := by + rw [topSum, Finset.mul_sum] + +theorem towerEntry_below_top_shift (U p : R) {n : ℕ} (i : Fin (n + 1)) + (hi : i ≠ Fin.last n) : + U * (U ^ (i : ℕ) * p * star (U ^ (i : ℕ))) = + U ^ (finRotate (n + 1) i : ℕ) * p * star (U ^ (i : ℕ)) := by + rw [coe_finRotate_of_ne_last hi, pow_succ'] + simp only [mul_assoc] + +omit [DecidableEq β] in +theorem sub_cyclicSum_eq_mul_topSum_of_towerEntries (height : β → ℕ) + (e : ∀ b, Fin (height b + 1) → Fin (height b + 1) → R) + (U : R) (p : β → R) + (he : ∀ b i j, e b i j = U ^ (i : ℕ) * p b * star (U ^ (j : ℕ))) + (hmul : ∀ b i j k l, e b i j * e b k l = if j = k then e b i l else 0) + (hcross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0) + (hcomplete : ∑ b, diagonalSum (e b) = 1) : + U - cyclicSum height e = (U - cyclicSum height e) * topSum height e := by + apply sub_cyclicSum_eq_mul_topSum height e U hmul hcross hcomplete + intro b i hi + simp only [he] + exact towerEntry_below_top_shift U (p b) i hi + +end Cyclic + +section Norm + +variable {A : Type*} [NormedRing A] [StarRing A] [CStarRing A] [Nontrivial A] +variable {β : Type*} [Fintype β] [DecidableEq β] + +theorem norm_sub_cyclicSum_le_two (height : β → ℕ) + (e : ∀ b, Fin (height b + 1) → Fin (height b + 1) → A) (U : A) + (hU : U ∈ unitary A) + (hstar : ∀ b i j, star (e b i j) = e b j i) + (hmul : ∀ b i j k l, e b i j * e b k l = if j = k then e b i l else 0) + (hcross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0) + (hcomplete : ∑ b, diagonalSum (e b) = 1) : + ‖U - cyclicSum height e‖ ≤ 2 := by + calc + ‖U - cyclicSum height e‖ ≤ ‖U‖ + ‖cyclicSum height e‖ := norm_sub_le _ _ + _ = 2 := by + rw [CStarRing.norm_of_mem_unitary hU, + CStarRing.norm_of_mem_unitary + (cyclicSum_mem_unitary height e hstar hmul hcross hcomplete)] + norm_num + +end Norm + +end Invariant233.TowerCyclicShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerItineraryFits.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerItineraryFits.lean new file mode 100644 index 0000000000000000000000000000000000000000..a689304afcde7c8e7cdc2241848952128093969b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerItineraryFits.lean @@ -0,0 +1,104 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TowerItineraryRefinement +import OAI.Analysis.IrrationalRotation.Analysis.NestedReturnSegments + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Invariant233.TowerItineraryFits +open TowerItinerary + +variable {X ι κ : Type*} + +theorem offset_fits_of_nonempty (f : X → X) (c : X → κ) + (B : ι → Set X) (height : ι → ℕ) (A : Set X) (t : κ) (oldHeight : ℕ) + (hend : ∀ i z, z ∈ B i → f^[height i] z ∈ A) + (havoid : ∀ y, c y = t → ∀ u : ℕ, 0 < u → u < oldHeight → f^[u] y ∉ A) + (a : LevelIndex (refinedHeight height (κ := κ))) + (hcol : a.1.2 a.2 = t) + (hne : (bases f c B height a.1).Nonempty) : + a.2.val + oldHeight ≤ height a.1.1 := by + obtain ⟨z, hz⟩ := hne + have hc : c (f^[a.2.val] z) = t := (congrFun hz.2 a.2).trans hcol + exact NestedReturnSegments.return_segment_fits f a.2.isLt + (hend a.1.1 z hz.1) (havoid _ hc) + +section Finite +variable [Fintype ι] [Fintype κ] + +def fittingColorLevels (height : ι → ℕ) (t : κ) (oldHeight : ℕ) : + Finset (LevelIndex (refinedHeight height (κ := κ))) := by + classical + exact (colorLevels height t).filter fun a => a.2.val + oldHeight ≤ height a.1.1 + +@[simp] theorem mem_fittingColorLevels (height : ι → ℕ) (t : κ) (oldHeight : ℕ) + (a : LevelIndex (refinedHeight height (κ := κ))) : + a ∈ fittingColorLevels height t oldHeight ↔ + a.1.2 a.2 = t ∧ a.2.val + oldHeight ≤ height a.1.1 := by + classical + simp [fittingColorLevels] + +theorem colorFiber_eq_fitting_finset_union (f : X → X) (c : X → κ) + (B : ι → Set X) (height : ι → ℕ) (A : Set X) (t : κ) (oldHeight : ℕ) + (hcover : ∀ x, ∃ i, ∃ k : Fin (height i), x ∈ level f B height i k) + (hend : ∀ i z, z ∈ B i → f^[height i] z ∈ A) + (havoid : ∀ y, c y = t → ∀ u : ℕ, 0 < u → u < oldHeight → f^[u] y ∉ A) : + c ⁻¹' {t} = ⋃ a ∈ fittingColorLevels height t oldHeight, + indexedLevel f (bases f c B height) (refinedHeight height) a := by + rw [colorFiber_eq_finset_union f c B height hcover t] + apply Set.ext + intro x + simp only [Set.mem_iUnion, mem_colorLevels, mem_fittingColorLevels] + constructor + · rintro ⟨a, ha, hx⟩ + have hne : (bases f c B height a.1).Nonempty := by + obtain ⟨z, hz, _⟩ := hx + exact ⟨z, hz⟩ + have hfit := offset_fits_of_nonempty f c B height A t oldHeight hend havoid a ha hne + exact ⟨a, ⟨ha, hfit⟩, hx⟩ + · rintro ⟨a, ⟨ha, _⟩, hx⟩ + exact ⟨a, ha, hx⟩ + +theorem partitionAtom_eq_fitting_finset_union (f : X → X) + (B : ι → Set X) (height : ι → ℕ) (A : Set X) + (P : κ → Set X) (hPcover : ∀ x, ∃ t, x ∈ P t) + (hPdisj : Pairwise (fun t u => Disjoint (P t) (P u))) (t : κ) (oldHeight : ℕ) + (hcover : ∀ x, ∃ i, ∃ k : Fin (height i), x ∈ level f B height i k) + (hend : ∀ i z, z ∈ B i → f^[height i] z ∈ A) + (havoid : ∀ y ∈ P t, ∀ u : ℕ, 0 < u → u < oldHeight → f^[u] y ∉ A) : + P t = ⋃ a ∈ fittingColorLevels height t oldHeight, + indexedLevel f (bases f (partitionColor P hPcover) B height) + (refinedHeight height) a := by + rw [← partitionColor_fiber P hPcover hPdisj t] + apply colorFiber_eq_fitting_finset_union f (partitionColor P hPcover) + B height A t oldHeight hcover hend + intro y hy + apply havoid y + have hy' : y ∈ partitionColor P hPcover ⁻¹' {t} := hy + rwa [partitionColor_fiber P hPcover hPdisj t] at hy' + +theorem indicator_colorFiber_eq_fitting_sum {f : X → X} (hf : Function.Injective f) + (c : X → κ) (B : ι → Set X) (height : ι → ℕ) (A : Set X) + (t : κ) (oldHeight : ℕ) + (hcover : ∀ x, ∃ i, ∃ k : Fin (height i), x ∈ level f B height i k) + (hdisj : Pairwise (fun a b : LevelIndex height => + Disjoint (indexedLevel f B height a) (indexedLevel f B height b))) + (hend : ∀ i z, z ∈ B i → f^[height i] z ∈ A) + (havoid : ∀ y, c y = t → ∀ u : ℕ, 0 < u → u < oldHeight → f^[u] y ∉ A) + {E : Type*} [AddCommMonoid E] (g : X → E) (x : X) : + (c ⁻¹' {t}).indicator g x = + ∑ a ∈ fittingColorLevels height t oldHeight, + (indexedLevel f (bases f c B height) (refinedHeight height) a).indicator g x := by + classical + rw [colorFiber_eq_fitting_finset_union f c B height A t oldHeight hcover hend havoid] + apply Finset.indicator_biUnion_apply + intro a ha b hb hab + exact pairwiseDisjoint_refinedLevels hf c B height hdisj hab + +end Finite +end Invariant233.TowerItineraryFits + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerItineraryRefinement.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerItineraryRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..b187650b040bdb7002eeb6b613e247c2b32e04cf --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerItineraryRefinement.lean @@ -0,0 +1,264 @@ +import Mathlib + +namespace OAI + +namespace Invariant233.TowerItinerary + +variable {X ι κ : Type*} + +def word (f : X → X) (c : X → κ) (h : ℕ) (x : X) : Fin h → κ := + fun k => c (f^[k.val] x) + +def refinedBase (f : X → X) (c : X → κ) (B : Set X) (h : ℕ) + (w : Fin h → κ) : Set X := B ∩ {x | word f c h x = w} + +@[simp] theorem mem_refinedBase {f : X → X} {c : X → κ} {B : Set X} + {h : ℕ} {w : Fin h → κ} {x : X} : + x ∈ refinedBase f c B h w ↔ x ∈ B ∧ word f c h x = w := Iff.rfl + +theorem refinedBase_subset (f : X → X) (c : X → κ) (B : Set X) + (h : ℕ) (w : Fin h → κ) : refinedBase f c B h w ⊆ B := + Set.inter_subset_left + +theorem iUnion_refinedBase (f : X → X) (c : X → κ) (B : Set X) (h : ℕ) : + (⋃ w : Fin h → κ, refinedBase f c B h w) = B := by + ext x + simp only [Set.mem_iUnion, mem_refinedBase] + exact ⟨fun ⟨_, hx, _⟩ => hx, fun hx => ⟨word f c h x, hx, rfl⟩⟩ + +theorem disjoint_refinedBase (f : X → X) (c : X → κ) (B : Set X) + (h : ℕ) {v w : Fin h → κ} (hvw : v ≠ w) : + Disjoint (refinedBase f c B h v) (refinedBase f c B h w) := by + apply Set.disjoint_left.mpr + intro x hx hy + exact hvw (hx.2.symm.trans hy.2) + +theorem image_refinedBase_subset_color (f : X → X) (c : X → κ) + (B : Set X) (h : ℕ) (w : Fin h → κ) (k : Fin h) : + f^[k.val] '' refinedBase f c B h w ⊆ c ⁻¹' {w k} := by + rintro y ⟨x, hx, rfl⟩ + exact congrFun hx.2 k + +theorem iUnion_image_refinedBase (f : X → X) (c : X → κ) + (B : Set X) (h n : ℕ) : + (⋃ w : Fin h → κ, f^[n] '' refinedBase f c B h w) = f^[n] '' B := by + rw [← Set.image_iUnion, iUnion_refinedBase] + +section Measurable +variable [MeasurableSpace X] [MeasurableSpace κ] [MeasurableSingletonClass κ] + +omit [MeasurableSingletonClass κ] in +theorem measurable_word {f : X → X} {c : X → κ} + (hf : Measurable f) (hc : Measurable c) (h : ℕ) : + Measurable (word f c h) := by + exact Measurable.of_eval (fun k => hc.comp (hf.iterate k.val)) + +theorem measurableSet_refinedBase {f : X → X} {c : X → κ} {B : Set X} + (hf : Measurable f) (hc : Measurable c) (hB : MeasurableSet B) + (h : ℕ) (w : Fin h → κ) : MeasurableSet (refinedBase f c B h w) := by + exact hB.inter ((measurable_word hf hc h) (measurableSet_singleton w)) + +end Measurable + +def level (f : X → X) (B : ι → Set X) (h : ι → ℕ) + (a : ι) (k : Fin (h a)) : Set X := f^[k.val] '' B a + +abbrev RefinedIndex (h : ι → ℕ) (κ : Type*) := Σ a, Fin (h a) → κ + +def refinedHeight (h : ι → ℕ) (a : RefinedIndex h κ) : ℕ := h a.1 + +def bases (f : X → X) (c : X → κ) (B : ι → Set X) (h : ι → ℕ) + (a : RefinedIndex h κ) : Set X := refinedBase f c (B a.1) (h a.1) a.2 + +theorem level_eq_iUnion (f : X → X) (c : X → κ) (B : ι → Set X) + (h : ι → ℕ) (a : ι) (k : Fin (h a)) : + level f B h a k = ⋃ w : Fin (h a) → κ, + level f (bases f c B h) (refinedHeight h) ⟨a, w⟩ k := by + exact (iUnion_image_refinedBase f c (B a) (h a) k.val).symm + +theorem refined_covers (f : X → X) (c : X → κ) (B : ι → Set X) + (h : ι → ℕ) + (hcover : ∀ x, ∃ a, ∃ k : Fin (h a), x ∈ level f B h a k) : + ∀ x, ∃ a : RefinedIndex h κ, ∃ k : Fin (refinedHeight h a), + x ∈ level f (bases f c B h) (refinedHeight h) a k := by + intro x + obtain ⟨a, k, y, hy, rfl⟩ := hcover x + exact ⟨⟨a, word f c (h a) y⟩, k, y, ⟨hy, rfl⟩, rfl⟩ + +abbrev LevelIndex (h : ι → ℕ) := Σ a, Fin (h a) + +def indexedLevel (f : X → X) (B : ι → Set X) (h : ι → ℕ) + (a : LevelIndex h) : Set X := level f B h a.1 a.2 + +theorem pairwiseDisjoint_refinedLevels {f : X → X} + (hf : Function.Injective f) (c : X → κ) (B : ι → Set X) (h : ι → ℕ) + (hdisj : Pairwise (fun a b : LevelIndex h => + Disjoint (indexedLevel f B h a) (indexedLevel f B h b))) : + Pairwise (fun a b : LevelIndex (refinedHeight h (κ := κ)) => + Disjoint (indexedLevel f (bases f c B h) (refinedHeight h) a) + (indexedLevel f (bases f c B h) (refinedHeight h) b)) := by + rintro ⟨⟨i, w⟩, k⟩ ⟨⟨j, v⟩, l⟩ hne + apply Set.disjoint_left.mpr + rintro x ⟨y, hy, hxy⟩ ⟨z, hz, hxz⟩ + have hiy : x ∈ indexedLevel f B h ⟨i, k⟩ := ⟨y, hy.1, hxy⟩ + have hjz : x ∈ indexedLevel f B h ⟨j, l⟩ := ⟨z, hz.1, hxz⟩ + by_cases hp : (⟨i, k⟩ : LevelIndex h) = ⟨j, l⟩ + · have hij : i = j := congrArg Sigma.fst hp + subst j + have hkl : k = l := eq_of_heq (Sigma.mk.inj hp).2 + subst l + have hyz : y = z := hf.iterate k.val (hxy.trans hxz.symm) + subst z + have hwv : w = v := hy.2.symm.trans hz.2 + subst v + exact hne rfl + · exact Set.disjoint_left.mp (hdisj hp) hiy hjz + +theorem colorFiber_eq_iUnion (f : X → X) (c : X → κ) + (B : ι → Set X) (h : ι → ℕ) + (hcover : ∀ x, ∃ a, ∃ k : Fin (h a), x ∈ level f B h a k) (t : κ) : + c ⁻¹' {t} = ⋃ a : RefinedIndex h κ, + ⋃ k : Fin (refinedHeight h a), ⋃ (_ : a.2 k = t), + level f (bases f c B h) (refinedHeight h) a k := by + ext x + constructor + · intro hx + obtain ⟨a, k, hax⟩ := refined_covers f c B h hcover x + have hc : c x = a.2 k := image_refinedBase_subset_color f c + (B a.1) (h a.1) a.2 k hax + exact Set.mem_iUnion.mpr ⟨a, Set.mem_iUnion.mpr ⟨k, + Set.mem_iUnion.mpr ⟨hc.symm.trans hx, hax⟩⟩⟩ + · intro hx + obtain ⟨a, hx⟩ := Set.mem_iUnion.mp hx + obtain ⟨k, hx⟩ := Set.mem_iUnion.mp hx + obtain ⟨ht, hax⟩ := Set.mem_iUnion.mp hx + have hc : c x = a.2 k := image_refinedBase_subset_color f c + (B a.1) (h a.1) a.2 k hax + exact hc.trans ht + +section MeasurableLevels +variable [MeasurableSpace X] [MeasurableSpace κ] [MeasurableSingletonClass κ] + +theorem measurableSet_iterate_image (f : X ≃ᵐ X) {A : Set X} + (hA : MeasurableSet A) (n : ℕ) : MeasurableSet ((f : X → X)^[n] '' A) := by + induction n with + | zero => simpa using hA + | succ n ih => + rw [Function.iterate_succ', Set.image_comp] + exact f.measurableSet_image.mpr ih + +theorem measurableSet_refinedLevel (f : X ≃ᵐ X) {c : X → κ} + (hc : Measurable c) {B : ι → Set X} (hB : ∀ a, MeasurableSet (B a)) + (h : ι → ℕ) (a : RefinedIndex h κ) (k : Fin (refinedHeight h a)) : + MeasurableSet (level f (bases f c B h) (refinedHeight h) a k) := by + exact measurableSet_iterate_image f + (measurableSet_refinedBase f.measurable hc (hB a.1) (h a.1) a.2) k.val + +end MeasurableLevels + +noncomputable def partitionColor (P : κ → Set X) (hcover : ∀ x, ∃ a, x ∈ P a) + (x : X) : κ := Classical.choose (hcover x) + +theorem mem_partitionColor (P : κ → Set X) (hcover : ∀ x, ∃ a, x ∈ P a) + (x : X) : x ∈ P (partitionColor P hcover x) := Classical.choose_spec (hcover x) + +theorem partitionColor_fiber (P : κ → Set X) + (hcover : ∀ x, ∃ a, x ∈ P a) + (hdisj : Pairwise (fun a b => Disjoint (P a) (P b))) (a : κ) : + partitionColor P hcover ⁻¹' {a} = P a := by + ext x + constructor + · intro hx + exact hx ▸ mem_partitionColor P hcover x + · intro hx + change partitionColor P hcover x = a + by_contra hne + exact Set.disjoint_left.mp (hdisj hne) (mem_partitionColor P hcover x) hx + +theorem measurable_partitionColor [MeasurableSpace X] [MeasurableSpace κ] + [Countable κ] (P : κ → Set X) (hP : ∀ a, MeasurableSet (P a)) + (hcover : ∀ x, ∃ a, x ∈ P a) + (hdisj : Pairwise (fun a b => Disjoint (P a) (P b))) : + Measurable (partitionColor P hcover) := by + intro s hs + have heq : partitionColor P hcover ⁻¹' s = ⋃ a ∈ s, P a := by + ext x + constructor + · intro hx + exact Set.mem_iUnion.mpr ⟨partitionColor P hcover x, + Set.mem_iUnion.mpr ⟨hx, mem_partitionColor P hcover x⟩⟩ + · intro hx + obtain ⟨a, hx⟩ := Set.mem_iUnion.mp hx + obtain ⟨ha, hxa⟩ := Set.mem_iUnion.mp hx + have hcol : partitionColor P hcover x = a := by + change x ∈ partitionColor P hcover ⁻¹' {a} + rw [partitionColor_fiber P hcover hdisj a] + exact hxa + change partitionColor P hcover x ∈ s + rwa [hcol] + rw [heq] + exact MeasurableSet.iUnion (fun a => MeasurableSet.iUnion (fun _ => hP a)) + +theorem partitionAtom_eq_iUnion (f : X → X) (B : ι → Set X) (h : ι → ℕ) + (htower : ∀ x, ∃ a, ∃ k : Fin (h a), x ∈ level f B h a k) + (P : κ → Set X) (hcover : ∀ x, ∃ a, x ∈ P a) + (hdisj : Pairwise (fun a b => Disjoint (P a) (P b))) (t : κ) : + P t = ⋃ a : RefinedIndex h κ, ⋃ k : Fin (refinedHeight h a), + ⋃ (_ : a.2 k = t), + level f (bases f (partitionColor P hcover) B h) (refinedHeight h) a k := by + rw [← partitionColor_fiber P hcover hdisj t] + exact colorFiber_eq_iUnion f (partitionColor P hcover) B h htower t + +section Finite +variable [Fintype ι] [Fintype κ] +open scoped BigOperators + +theorem card_refinedIndex (h : ι → ℕ) : + Fintype.card (RefinedIndex h κ) = ∑ a, Fintype.card κ ^ h a := by + classical + simp [RefinedIndex] + +noncomputable def colorLevels (h : ι → ℕ) (t : κ) : + Finset (LevelIndex (refinedHeight h (κ := κ))) := by + classical + exact Finset.univ.filter (fun a => a.1.2 a.2 = t) + +@[simp] theorem mem_colorLevels (h : ι → ℕ) (t : κ) + (a : LevelIndex (refinedHeight h (κ := κ))) : + a ∈ colorLevels h t ↔ a.1.2 a.2 = t := by + classical + simp [colorLevels] + +theorem colorFiber_eq_finset_union (f : X → X) (c : X → κ) + (B : ι → Set X) (h : ι → ℕ) + (hcover : ∀ x, ∃ a, ∃ k : Fin (h a), x ∈ level f B h a k) (t : κ) : + c ⁻¹' {t} = ⋃ a ∈ colorLevels h t, + indexedLevel f (bases f c B h) (refinedHeight h) a := by + rw [colorFiber_eq_iUnion f c B h hcover t] + ext x + simp only [Set.mem_iUnion, mem_colorLevels] + constructor + · rintro ⟨a, k, hc, hx⟩ + exact ⟨⟨a, k⟩, hc, hx⟩ + · rintro ⟨⟨a, k⟩, hc, hx⟩ + exact ⟨a, k, hc, hx⟩ + +theorem indicator_colorFiber_eq_sum {f : X → X} (hf : Function.Injective f) + (c : X → κ) (B : ι → Set X) (h : ι → ℕ) + (hcover : ∀ x, ∃ a, ∃ k : Fin (h a), x ∈ level f B h a k) + (hdisj : Pairwise (fun a b : LevelIndex h => + Disjoint (indexedLevel f B h a) (indexedLevel f B h b))) + {E : Type*} [AddCommMonoid E] (g : X → E) (t : κ) (x : X) : + (c ⁻¹' {t}).indicator g x = ∑ a ∈ colorLevels h t, + (indexedLevel f (bases f c B h) (refinedHeight h) a).indicator g x := by + classical + rw [colorFiber_eq_finset_union f c B h hcover t] + apply Finset.indicator_biUnion_apply + intro a ha b hb hab + exact pairwiseDisjoint_refinedLevels hf c B h hdisj hab + +end Finite + +end Invariant233.TowerItinerary + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerMatrixUnits.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerMatrixUnits.lean new file mode 100644 index 0000000000000000000000000000000000000000..ff985eddc9d56d7a45a3bf345807617f06c4f845 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerMatrixUnits.lean @@ -0,0 +1,191 @@ +import Mathlib.Algebra.Star.Subalgebra +import Mathlib.Algebra.Star.Unitary +import Mathlib.LinearAlgebra.FiniteDimensional.Basic +import Mathlib.Analysis.Complex.Basic + +namespace OAI + +noncomputable section +namespace Invariant233.TowerMatrixUnits + +variable {A : Type*} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] + +def spanStarAlgebra (s : Set A) (h1 : (1 : A) ∈ Submodule.span ℂ s) + (hmul : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ Submodule.span ℂ s) + (hstar : ∀ x ∈ s, star x ∈ Submodule.span ℂ s) : StarSubalgebra ℂ A where + toSubalgebra := (Submodule.span ℂ s).toSubalgebra h1 (by + intro x y hx hy + induction hx, hy using Submodule.span_induction₂ with + | mem_mem x y hx hy => exact hmul x hx y hy + | zero_left y hy => simp + | zero_right x hx => simp + | add_left x y z hx hy hz h1 h2 => + simpa only [add_mul] using (Submodule.span ℂ s).add_mem h1 h2 + | add_right x y z hx hy hz h1 h2 => + simpa only [mul_add] using (Submodule.span ℂ s).add_mem h1 h2 + | smul_left r x y hx hy h => + simpa only [smul_mul_assoc] using (Submodule.span ℂ s).smul_mem r h + | smul_right r x y hx hy h => + simpa only [mul_smul_comm] using (Submodule.span ℂ s).smul_mem r h) + star_mem' := by + intro x hx + change star x ∈ Submodule.span ℂ s + change x ∈ Submodule.span ℂ s at hx + induction hx using Submodule.span_induction with + | mem x hx => exact hstar x hx + | zero => simp + | add x y hx hy hx' hy' => + simpa only [star_add] using (Submodule.span ℂ s).add_mem hx' hy' + | smul r x hx hx' => + simpa only [star_smul] using (Submodule.span ℂ s).smul_mem (star r) hx' + +@[simp] theorem mem_spanStarAlgebra (s : Set A) (h1 hmul hstar) (x : A) : + x ∈ spanStarAlgebra s h1 hmul hstar ↔ x ∈ Submodule.span ℂ s := Iff.rfl + +theorem spanStarAlgebra_finiteDimensional (s : Set A) (hs : s.Finite) (h1 hmul hstar) : + FiniteDimensional ℂ (spanStarAlgebra s h1 hmul hstar) := by + let : FiniteDimensional ℂ (Submodule.span ℂ s) := FiniteDimensional.span_of_finite ℂ hs + have : FiniteDimensional ℂ + (spanStarAlgebra s h1 hmul hstar).toSubalgebra.toSubmodule := by + change FiniteDimensional ℂ (Submodule.span ℂ s) + infer_instance + exact (spanStarAlgebra s h1 hmul hstar).toSubalgebra.toSubmoduleEquiv.finiteDimensional + +theorem spanStarAlgebra_le (s : Set A) (h1 hmul hstar) (B : StarSubalgebra ℂ A) + (hs : s ⊆ B) : spanStarAlgebra s h1 hmul hstar ≤ B := by + change Submodule.span ℂ s ≤ B.toSubalgebra.toSubmodule + exact Submodule.span_le.mpr hs + +theorem spanStarAlgebra_eq_adjoin (s : Set A) (h1 hmul hstar) : + spanStarAlgebra s h1 hmul hstar = StarAlgebra.adjoin ℂ s := by + apply le_antisymm + · exact spanStarAlgebra_le s h1 hmul hstar _ (StarAlgebra.subset_adjoin ℂ s) + · exact StarAlgebra.adjoin_le (fun _ hx => Submodule.subset_span hx) + +variable {ι : Type*} [DecidableEq ι] + +structure IsMatrixUnitFamily (e : ι → ι → A) : Prop where + mul : ∀ i j k l, e i j * e k l = if j = k then e i l else 0 + star : ∀ i j, star (e i j) = e j i + +def matrixGenerators (e : ι → ι → A) : Set A := + insert 1 (Set.range fun ij : ι × ι => e ij.1 ij.2) + +omit [StarRing A] [StarModule ℂ A] [DecidableEq ι] in +theorem matrixUnit_mem_span (e : ι → ι → A) (i j : ι) : + e i j ∈ Submodule.span ℂ (matrixGenerators e) := + Submodule.subset_span (Set.mem_insert_of_mem _ ⟨(i, j), rfl⟩) + +omit [StarModule ℂ A] in +theorem matrixGenerators_mul (e : ι → ι → A) (he : IsMatrixUnitFamily e) : + ∀ x ∈ matrixGenerators e, ∀ y ∈ matrixGenerators e, + x * y ∈ Submodule.span ℂ (matrixGenerators e) := by + rintro x (rfl | ⟨⟨i, j⟩, rfl⟩) y hy + · simpa using Submodule.subset_span hy + · rcases hy with rfl | ⟨⟨k, l⟩, rfl⟩ + · simpa using matrixUnit_mem_span e i j + · rw [he.mul] + split_ifs + · exact matrixUnit_mem_span e i l + · exact Submodule.zero_mem _ + +omit [StarModule ℂ A] in +theorem matrixGenerators_star (e : ι → ι → A) (he : IsMatrixUnitFamily e) : + ∀ x ∈ matrixGenerators e, star x ∈ Submodule.span ℂ (matrixGenerators e) := by + rintro x (rfl | ⟨⟨i, j⟩, rfl⟩) + · simpa using (Submodule.subset_span (Set.mem_insert 1 _) : + (1 : A) ∈ Submodule.span ℂ (matrixGenerators e)) + · rw [he.star] + exact matrixUnit_mem_span e j i + +def matrixAlgebra (e : ι → ι → A) (he : IsMatrixUnitFamily e) : StarSubalgebra ℂ A := + spanStarAlgebra (matrixGenerators e) (Submodule.subset_span (Set.mem_insert 1 _)) + (matrixGenerators_mul e he) (matrixGenerators_star e he) + +theorem matrixAlgebra_finiteDimensional [Finite ι] (e : ι → ι → A) + (he : IsMatrixUnitFamily e) : FiniteDimensional ℂ (matrixAlgebra e he) := + spanStarAlgebra_finiteDimensional _ ((Set.finite_range _).insert 1) _ _ _ + +theorem matrixAlgebra_le (e : ι → ι → A) (he : IsMatrixUnitFamily e) + (B : StarSubalgebra ℂ A) (heB : ∀ i j, e i j ∈ B) : matrixAlgebra e he ≤ B := by + apply spanStarAlgebra_le + rintro x (rfl | ⟨⟨i, j⟩, rfl⟩) + · exact B.one_mem + · exact heB i j + +@[simp] theorem matrixUnit_mem_matrixAlgebra (e : ι → ι → A) + (he : IsMatrixUnitFamily e) (i j : ι) : e i j ∈ matrixAlgebra e he := + matrixUnit_mem_span e i j + +theorem matrixAlgebra_eq_adjoin (e : ι → ι → A) (he : IsMatrixUnitFamily e) : + matrixAlgebra e he = StarAlgebra.adjoin ℂ (Set.range fun ij : ι × ι => e ij.1 ij.2) := by + apply le_antisymm + · apply matrixAlgebra_le + intro i j + exact StarAlgebra.subset_adjoin ℂ _ ⟨(i, j), rfl⟩ + · apply StarAlgebra.adjoin_le + rintro _ ⟨⟨i, j⟩, rfl⟩ + exact matrixUnit_mem_matrixAlgebra e he i j + +def towerEntry (u : ι → A) (p : A) (i j : ι) : A := u i * p * star (u j) + +omit [Algebra ℂ A] [StarModule ℂ A] [DecidableEq ι] in +theorem towerEntry_star (u : ι → A) {p : A} (hp : IsStarProjection p) (i j : ι) : + star (towerEntry u p i j) = towerEntry u p j i := by + simp only [towerEntry, star_mul, star_star, hp.isSelfAdjoint.star_eq, mul_assoc] + +omit [Algebra ℂ A] [StarModule ℂ A] [DecidableEq ι] in +theorem compressed_eq_zero_of_orthogonal (u : ι → A) + (hu : ∀ i, u i ∈ unitary A) (p : A) (i j : ι) + (h : towerEntry u p i i * towerEntry u p j j = 0) : + p * star (u i) * u j * p = 0 := by + have h' := congrArg (fun x : A => star (u i) * x * u j) h + have hi := Unitary.star_mul_self_of_mem (hu i) + have hj := Unitary.star_mul_self_of_mem (hu j) + simp only [towerEntry, ← mul_assoc, hi, one_mul, mul_zero, zero_mul] at h' + simpa only [mul_assoc, hj, mul_one] using h' + +omit [Algebra ℂ A] [StarModule ℂ A] in +theorem towerEntry_isMatrixUnitFamily (u : ι → A) + (hu : ∀ i, u i ∈ unitary A) {p : A} (hp : IsStarProjection p) + (horth : ∀ i j, i ≠ j → towerEntry u p i i * towerEntry u p j j = 0) : + IsMatrixUnitFamily (towerEntry u p) := by + refine ⟨?_, towerEntry_star u hp⟩ + intro i j k l + by_cases hjk : j = k + · subst k + rw [ite_eq_left rfl] + have huj := Unitary.star_mul_self_of_mem (hu j) + have hpp : p * p = p := hp.isIdempotentElem + calc + towerEntry u p i j * towerEntry u p j l = + u i * (p * (star (u j) * u j) * p) * star (u l) := by + simp only [towerEntry, mul_assoc] + _ = towerEntry u p i l := by rw [huj, mul_one, hpp]; rfl + · rw [ite_eq_right hjk] + have hzero := compressed_eq_zero_of_orthogonal u hu p j k (horth j k hjk) + calc + towerEntry u p i j * towerEntry u p k l = + u i * (p * star (u j) * u k * p) * star (u l) := by + simp only [towerEntry, mul_assoc] + _ = 0 := by rw [hzero, mul_zero, zero_mul] + +theorem exists_finiteDimensional_towerAlgebra [Finite ι] (u : ι → A) + (hu : ∀ i, u i ∈ unitary A) {p : A} (hp : IsStarProjection p) + (horth : ∀ i j, i ≠ j → towerEntry u p i i * towerEntry u p j j = 0) + (B : StarSubalgebra ℂ A) (hpB : p ∈ B) (huB : ∀ i, u i ∈ B) : + ∃ C : StarSubalgebra ℂ A, C ≤ B ∧ FiniteDimensional ℂ C ∧ + (∀ i j, towerEntry u p i j ∈ C) ∧ + (C.toSubalgebra.toSubmodule = Submodule.span ℂ (matrixGenerators (towerEntry u p))) := by + let he := towerEntry_isMatrixUnitFamily u hu hp horth + refine ⟨matrixAlgebra (towerEntry u p) he, ?_, + matrixAlgebra_finiteDimensional _ he, matrixUnit_mem_matrixAlgebra _ he, rfl⟩ + apply matrixAlgebra_le + intro i j + exact B.mul_mem (B.mul_mem (huB i) hpB) (B.star_mem' (huB j)) + +end Invariant233.TowerMatrixUnits + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerRefinement.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..b505d8e62fa4882422a661c4778f1f36403f29ae --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TowerRefinement.lean @@ -0,0 +1,75 @@ +import Mathlib.Algebra.Star.Subalgebra +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Invariant233.TowerRefinement + +variable {A : Type*} [Semiring A] [StarRing A] + +theorem matrixUnit_shift (U q : A) (i j r : ℕ) : + U ^ i * (U ^ r * q * star (U ^ r)) * star (U ^ j) = + U ^ (i + r) * q * star (U ^ (j + r)) := by + simp only [pow_add, star_mul, mul_assoc] + +theorem matrixUnit_decomposition {ι : Type*} (s : Finset ι) + (U p : A) (q : ι → A) (offset : ι → ℕ) + (hp : p = ∑ a ∈ s, U ^ offset a * q a * star (U ^ offset a)) + (i j : ℕ) : + U ^ i * p * star (U ^ j) = + ∑ a ∈ s, U ^ (i + offset a) * q a * star (U ^ (j + offset a)) := by + rw [hp, Finset.mul_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro a ha + exact matrixUnit_shift U (q a) i j (offset a) + +variable {R : Type*} [CommSemiring R] [StarRing R] [Algebra R A] [StarModule R A] + +theorem matrixUnit_mem_of_refinement {ι : Type*} (s : Finset ι) + (B : StarSubalgebra R A) (U p : A) (q : ι → A) + (offset height : ι → ℕ) (oldHeight : ℕ) + (hp : p = ∑ a ∈ s, U ^ offset a * q a * star (U ^ offset a)) + (hfit : ∀ a ∈ s, offset a + oldHeight ≤ height a) + (hq : ∀ a ∈ s, ∀ i j : ℕ, i < height a → j < height a → + U ^ i * q a * star (U ^ j) ∈ B) + {i j : ℕ} (hi : i < oldHeight) (hj : j < oldHeight) : + U ^ i * p * star (U ^ j) ∈ B := by + rw [matrixUnit_decomposition s U p q offset hp i j] + apply B.sum_mem + intro a ha + have hbound := hfit a ha + apply hq a ha <;> omega + +def towerGenerators {ι : Type*} (U : A) (p : ι → A) (height : ι → ℕ) : Set A := + {x | ∃ a i j, i < height a ∧ j < height a ∧ + x = U ^ i * p a * star (U ^ j)} + +theorem adjoin_towerGenerators_le_of_refinement + {ι κ τ : Type*} (U : A) (p : ι → A) (q : κ → A) + (oldHeight : ι → ℕ) (newHeight : κ → ℕ) + (pieces : ι → Finset τ) (index : ι → τ → κ) (offset : ι → τ → ℕ) + (hp : ∀ a, p a = ∑ b ∈ pieces a, + U ^ offset a b * q (index a b) * star (U ^ offset a b)) + (hfit : ∀ a b, b ∈ pieces a → + offset a b + oldHeight a ≤ newHeight (index a b)) : + StarAlgebra.adjoin R (towerGenerators U p oldHeight) ≤ + StarAlgebra.adjoin R (towerGenerators U q newHeight) := by + apply StarAlgebra.adjoin_le + rintro x ⟨a, i, j, hi, hj, rfl⟩ + apply matrixUnit_mem_of_refinement (pieces a) + (StarAlgebra.adjoin R (towerGenerators U q newHeight)) U (p a) + (fun b => q (index a b)) (offset a) (fun b => newHeight (index a b)) + (oldHeight a) (hp a) (hfit a) _ hi hj + intro b hb k l hk hl + apply StarAlgebra.subset_adjoin + exact ⟨index a b, k, l, hk, hl, rfl⟩ + +end Invariant233.TowerRefinement + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TransferSupport.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TransferSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e639d069c5022f1550100a652bcc730fdaff8aa --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TransferSupport.lean @@ -0,0 +1,167 @@ +import Mathlib + +namespace OAI + +open scoped BigOperators ENNReal +open MeasureTheory Set Filter + +namespace Invariant233.TransferSupport + +variable {X : Type*} + +theorem support_relocation_subset (τ : X → X) (h : X → ℝ) + (φ : ℕ → X → ℝ) (H : ℕ) : + Function.support (fun x => ∑ n ∈ Finset.range (H + 1), + ∑ r ∈ Finset.Icc 1 n, h (τ^[r] x) * φ n (τ^[r] x)) ⊆ + ⋃ r ∈ Finset.Icc 1 H, (τ^[r]) ⁻¹' Function.support h := by + classical + intro x hx + obtain ⟨n, hn, hnz⟩ := Finset.exists_ne_zero_of_sum_ne_zero hx + obtain ⟨r, hr, hrz⟩ := Finset.exists_ne_zero_of_sum_ne_zero hnz + have hrH : r ∈ Finset.Icc 1 H := by + simp only [Finset.mem_Icc] at hr ⊢ + have hnH := Finset.mem_range.mp hn + omega + refine Set.mem_iUnion.mpr ⟨r, Set.mem_iUnion.mpr ⟨hrH, ?_⟩⟩ + exact (mul_ne_zero_iff.mp hrz).1 + +variable [MeasurableSpace X] {μ : Measure X} + +theorem measure_support_relocation_le (τ : X → X) (hτ : MeasurePreserving τ μ μ) + (h : X → ℝ) (φ : ℕ → X → ℝ) (H : ℕ) : + μ (Function.support (fun x => ∑ n ∈ Finset.range (H + 1), + ∑ r ∈ Finset.Icc 1 n, h (τ^[r] x) * φ n (τ^[r] x))) ≤ + (H : ℝ≥0∞) * μ (Function.support h) := by + classical + calc + _ ≤ μ (⋃ r ∈ Finset.Icc 1 H, (τ^[r]) ⁻¹' Function.support h) := + measure_mono (support_relocation_subset τ h φ H) + _ ≤ ∑ r ∈ Finset.Icc 1 H, μ ((τ^[r]) ⁻¹' Function.support h) := + measure_biUnion_finset_le _ _ + _ ≤ ∑ r ∈ Finset.Icc 1 H, μ (Function.support h) := by + exact Finset.sum_le_sum fun r _ => (hτ.iterate r).measure_preimage_le _ + _ = (H : ℝ≥0∞) * μ (Function.support h) := by simp [nsmul_eq_mul] + +theorem ae_finite_transfer_support {ι : Type*} [Countable ι] (d : ι → X → ℝ) + (hd : ∑' i, μ (Function.support (d i)) ≠ ∞) : + ∀ᵐ x ∂μ, (Function.support (fun i => d i x)).Finite := by + simpa only [Function.support, Set.mem_ofPred_eq] using + (ae_finite_setOfPred_mem hd) + +theorem ae_finite_transfer_support_comp {ι κ : Type*} [Countable ι] [Countable κ] + (d : ι → X → ℝ) (hd : ∑' i, μ (Function.support (d i)) ≠ ∞) + (ρ : κ → X → X) (hρ : ∀ k, Measure.QuasiMeasurePreserving (ρ k) μ μ) : + ∀ᵐ x ∂μ, ∀ k, (Function.support (fun i => d i (ρ k x))).Finite := by + exact ae_all_iff.mpr fun k => (hρ k).ae (ae_finite_transfer_support d hd) + +theorem ae_finite_transfer_support_pair {ι : Type*} [Countable ι] + (d : ι → X → ℝ) (hd : ∑' i, μ (Function.support (d i)) ≠ ∞) + (σ : X → X) (hσ : Measure.QuasiMeasurePreserving σ μ μ) : + ∀ᵐ x ∂μ, (Function.support (fun i => d i x)).Finite ∧ + (Function.support (fun i => d i (σ x))).Finite := by + exact (ae_finite_transfer_support d hd).and + (hσ.ae (ae_finite_transfer_support d hd)) + +theorem ae_finite_relocation_support {ι : Type*} [Countable ι] + (τ : X → X) (hτ : MeasurePreserving τ μ μ) + (h : ι → X → ℝ) (φ : ι → ℕ → X → ℝ) (H : ι → ℕ) + (hcost : ∑' i, (H i : ℝ≥0∞) * μ (Function.support (h i)) ≠ ∞) : + ∀ᵐ x ∂μ, (Function.support (fun i => ∑ n ∈ Finset.range (H i + 1), + ∑ r ∈ Finset.Icc 1 n, h i (τ^[r] x) * φ i n (τ^[r] x))).Finite := by + apply ae_finite_transfer_support + exact ne_top_of_le_ne_top hcost (ENNReal.tsum_le_tsum fun i => + measure_support_relocation_le τ hτ (h i) (φ i) (H i)) + +theorem measure_support_background_le (τ : X → X) (hτ : MeasurePreserving τ μ μ) + (v : X → ℝ) (W : ℕ) (c : ℝ) : + μ (Function.support (fun x => c * (∑ n ∈ Finset.range (W + 1), + ∑ r ∈ Finset.Icc 1 n, v (τ^[r] x)))) ≤ + (W : ℝ≥0∞) * μ (Function.support v) := by + calc + _ ≤ μ (Function.support (fun x => ∑ n ∈ Finset.range (W + 1), + ∑ r ∈ Finset.Icc 1 n, v (τ^[r] x))) := by + apply measure_mono + intro x hx + exact (mul_ne_zero_iff.mp hx).2 + _ ≤ (W : ℝ≥0∞) * μ (Function.support v) := by + simpa only [mul_one] using measure_support_relocation_le τ hτ v (fun _ _ => 1) W + +theorem ae_tsum_coboundary {ι : Type*} [Countable ι] + (h g d : ι → X → ℝ) (σ : X → X) + (hσ : Measure.QuasiMeasurePreserving σ μ μ) + (hd : ∑' i, μ (Function.support (d i)) ≠ ∞) + (hh : ∀ᵐ x ∂μ, Summable (fun i => h i x)) + (heq : ∀ i, g i =ᵐ[μ] fun x => h i x + d i x - d i (σ x)) : + ∀ᵐ x ∂μ, Summable (fun i => g i x) ∧ + (∑' i, g i x) = (∑' i, h i x) + (∑' i, d i x) - (∑' i, d i (σ x)) := by + filter_upwards [hh, ae_finite_transfer_support_pair d hd σ hσ, + ae_all_iff.mpr heq] with x hhx hdx heqx + have hd0 : Summable (fun i => d i x) := summable_of_hasFiniteSupport hdx.1 + have hd1 : Summable (fun i => d i (σ x)) := summable_of_hasFiniteSupport hdx.2 + have hg : Summable (fun i => g i x) := + ((hhx.add hd0).sub hd1).congr (fun i => (heqx i).symm) + refine ⟨hg, ?_⟩ + calc + (∑' i, g i x) = ∑' i, (h i x + d i x - d i (σ x)) := tsum_congr heqx + _ = (∑' i, h i x) + (∑' i, d i x) - (∑' i, d i (σ x)) := by + rw [(hhx.add hd0).tsum_sub hd1, hhx.tsum_add hd0] + +theorem exists_measurable_tsum_transfer {ι : Type*} [Countable ι] + (h g d : ι → X → ℝ) (σ : X → X) + (hσ : Measure.QuasiMeasurePreserving σ μ μ) + (hmd : ∀ i, Measurable (d i)) + (hd : ∑' i, μ (Function.support (d i)) ≠ ∞) + (hh : ∀ᵐ x ∂μ, Summable (fun i => h i x)) + (heq : ∀ i, g i =ᵐ[μ] fun x => h i x + d i x - d i (σ x)) : + ∃ b : X → ℝ, Measurable b ∧ + (∀ᵐ x ∂μ, (Function.support (fun i => d i x)).Finite ∧ + b x = ∑' i, d i x) ∧ + ∀ᵐ x ∂μ, (∑' i, g i x) = (∑' i, h i x) + b x - b (σ x) := by + refine ⟨fun x => ∑' i, d i x, Measurable.tsum hmd, ?_, ?_⟩ + · filter_upwards [ae_finite_transfer_support d hd] with x hx + exact ⟨hx, rfl⟩ + · filter_upwards [ae_tsum_coboundary h g d σ hσ hd hh heq] with x hx + exact hx.2 + +theorem tsum_measure_support_add_ne_top {ι : Type*} [Countable ι] + (d e : ι → X → ℝ) + (hd : ∑' i, μ (Function.support (d i)) ≠ ∞) + (he : ∑' i, μ (Function.support (e i)) ≠ ∞) : + ∑' i, μ (Function.support (fun x => d i x + e i x)) ≠ ∞ := by + apply ne_top_of_le_ne_top (ENNReal.add_ne_top.mpr ⟨hd, he⟩) + calc + _ ≤ ∑' i, (μ (Function.support (d i)) + μ (Function.support (e i))) := by + apply ENNReal.tsum_le_tsum + intro i + exact (measure_mono (Function.support_add _ _)).trans (measure_union_le _ _) + _ = (∑' i, μ (Function.support (d i))) + ∑' i, μ (Function.support (e i)) := + ENNReal.tsum_add + +theorem assemble_continuous_coboundary {ι : Type*} [Countable ι] + (cost moved d e : ι → X → ℝ) (g₀ b₀ : X → ℝ) (σ : X → X) + (hσ : Measure.QuasiMeasurePreserving σ μ μ) + (hmb₀ : Measurable b₀) (hmd : ∀ i, Measurable (d i)) + (hme : ∀ i, Measurable (e i)) + (hd : ∑' i, μ (Function.support (d i)) ≠ ∞) + (he : ∑' i, μ (Function.support (e i)) ≠ ∞) + (hcost : ∀ᵐ x ∂μ, Summable (fun i => cost i x)) + (hmoved : ∀ i, moved i =ᵐ[μ] fun x => cost i x + + (d i x + e i x) - (d i (σ x) + e i (σ x))) + (hbackground : g₀ =ᵐ[μ] fun x => 1 + b₀ (σ x) - b₀ x) : + ∃ b : X → ℝ, Measurable b ∧ + (∀ x, b x = b₀ x - ∑' i, (d i x + e i x)) ∧ + ∀ᵐ x ∂μ, g₀ x + (∑' i, moved i x) = + (∑' i, cost i x) + 1 + b (σ x) - b x := by + let D : ι → X → ℝ := fun i x => d i x + e i x + have hD : ∑' i, μ (Function.support (D i)) ≠ ∞ := + tsum_measure_support_add_ne_top d e hd he + refine ⟨fun x => b₀ x - ∑' i, D i x, + hmb₀.sub (Measurable.tsum fun i => (hmd i).add (hme i)), fun _ => rfl, ?_⟩ + filter_upwards [ae_tsum_coboundary cost moved D σ hσ hD hcost hmoved, + hbackground] with x hsum hbg + rw [hsum.2, hbg] + ring + +end Invariant233.TransferSupport + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularEndpointKernel.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularEndpointKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..36db15594b7cd36dd872396edc016577b552b6c1 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularEndpointKernel.lean @@ -0,0 +1,165 @@ +import OAI.Analysis.IrrationalRotation.Sampling.ScalarSamplingEndpointVariation + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.ScalarSampling + +theorem endpoint_triangularKernel_eq_indicator {s : ℝ} (hs : s ∈ Ico (0 : ℝ) 1) + (t : ℝ) : + triangularKernel (Int.fract (s - t)) t = (Ioc 0 s).indicator (fun _ => 1) t := by + have hsupport : t ∈ Ioo 0 (1 - Int.fract (s - t)) ↔ t ∈ Ioc 0 s := by + constructor + · intro ht + refine ⟨ht.1, ?_⟩ + by_contra hts + have hst : s < t := lt_of_not_ge hts + have htone : t < 1 := by linarith [ht.2, Int.fract_nonneg (s - t)] + have hfrac : Int.fract (s - t) = s - t + 1 := by + rw [← Int.fract_add_one (s - t)] + exact Int.fract_eq_self.mpr ⟨by linarith [hs.1], by linarith⟩ + rw [hfrac] at ht + linarith [hs.1, ht.2] + · intro ht + have hfrac : Int.fract (s - t) = s - t := + Int.fract_eq_self.mpr ⟨sub_nonneg.mpr ht.2, by linarith [hs.2, ht.1]⟩ + rw [mem_Ioo, hfrac] + exact ⟨ht.1, by linarith [hs.2]⟩ + simp only [triangularKernel, Set.indicator_apply, hsupport] + +theorem interval_integral_endpoint_triangularKernel {s : ℝ} + (hs : s ∈ Ico (0 : ℝ) 1) : + (∫ t in (0 : ℝ)..1, triangularKernel (Int.fract (s - t)) t) = s := by + simp_rw [endpoint_triangularKernel_eq_indicator hs] + rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] + rw [setIntegral_eq_integral_of_forall_compl_eq_zero] + · rw [integral_indicator_const _ measurableSet_Ioc, + Real.volume_real_Ioc_of_le hs.1] + simp + · intro t ht + apply Set.indicator_of_notMem + intro hts + exact ht ⟨hts.1, hts.2.trans hs.2.le⟩ + +theorem endpoint_triangularKernel_fract (s t : ℝ) : + triangularKernel (Int.fract (s - t)) t = + triangularKernel (Int.fract (Int.fract s - t)) t := by + have heq : Int.fract s - t = (s - t) - (⌊s⌋ : ℤ) := by + rw [Int.fract] + ring + simp only [heq, Int.fract_sub_intCast] + +theorem interval_integral_endpoint_triangularKernel_periodic (s : ℝ) : + (∫ t in (0 : ℝ)..1, triangularKernel (Int.fract (s - t)) t) = Int.fract s := by + simp_rw [endpoint_triangularKernel_fract s] + exact interval_integral_endpoint_triangularKernel + ⟨Int.fract_nonneg s, Int.fract_lt_one s⟩ + +theorem endpoint_triangularKernel_mass : + (∫ s in (0 : ℝ)..1, ∫ t in (0 : ℝ)..1, + triangularKernel (Int.fract (s - t)) t) = 1 / 2 := by + calc + _ = ∫ s in (0 : ℝ)..1, s := by + apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num : (0 : ℝ) ≤ 1) + intro s hs + exact interval_integral_endpoint_triangularKernel ⟨hs.1.le, hs.2⟩ + _ = 1 / 2 := by norm_num + +theorem endpoint_triangularKernel_secondMoment : + (∫ s in (0 : ℝ)..1, ∫ t in (0 : ℝ)..1, + triangularKernel (Int.fract (s - t)) t ^ 2) = 1 / 2 := by + simp_rw [triangularKernel_sq] + exact endpoint_triangularKernel_mass + +theorem endpoint_triangularKernel_averaged_secondMoment : + (∫ s in (0 : ℝ)..1, + (∫ t in (0 : ℝ)..1, triangularKernel (Int.fract (s - t)) t) ^ 2) = 1 / 3 := by + calc + _ = ∫ s in (0 : ℝ)..1, s ^ 2 := by + apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num : (0 : ℝ) ≤ 1) + intro s hs + dsimp only + rw [interval_integral_endpoint_triangularKernel ⟨hs.1.le, hs.2⟩] + _ = 1 / 3 := by norm_num + +private theorem lower_interval_control (s : ℝ) : + VariationControl ((Ioc 0 s).indicator (fun _ => (1 : ℝ))) 1 2 := by + have hstep : VariationControl (fun t : ℝ => if 0 < t then 1 else 0) 1 1 := by + refine ⟨?_, ?_, ?_⟩ + · intro t; split_ifs <;> norm_num + · intro t; split_ifs <;> norm_num + · simpa using variation_step_le (fun t : ℝ => 0 < t) + (Or.inl (by intro x y hxy hx; exact hx.trans_le hxy)) + have hmask := hstep.mask (by norm_num) (by norm_num) (fun t => t ≤ s) + (Or.inr (by intro x y hxy hy; exact hxy.trans hy)) + convert hmask using 1 + · funext t + by_cases ht : 0 < t <;> by_cases hts : t ≤ s <;> simp [ht, hts] + · norm_num + +theorem triangularKernel_control (s : ℝ) : VariationControl (triangularKernel s) 1 2 := by + have hstep : VariationControl (fun t : ℝ => if 0 < t then 1 else 0) 1 1 := by + refine ⟨?_, ?_, ?_⟩ + · intro t; split_ifs <;> norm_num + · intro t; split_ifs <;> norm_num + · simpa using variation_step_le (fun t : ℝ => 0 < t) + (Or.inl (by intro x y hxy hx; exact hx.trans_le hxy)) + have hmask := hstep.mask (by norm_num) (by norm_num) (fun t => t < 1 - s) + (Or.inr (by intro x y hxy hy; exact hxy.trans_lt hy)) + convert hmask using 1 + · funext t + by_cases ht : 0 < t <;> by_cases hts : t < 1 - s <;> + simp [triangularKernel, ht, hts] + · norm_num + +theorem triangularKernel_BV_bound (s : ℝ) : + BoundedVariationOn (triangularKernel s) (Icc (0 : ℝ) 1) ∧ + sSup (Set.range (fun t => |triangularKernel s t|)) + + (eVariationOn (triangularKernel s) (Icc (0 : ℝ) 1)).toReal ≤ 3 := by + have hc := triangularKernel_control s + constructor + · exact ne_top_of_le_ne_top ENNReal.ofReal_ne_top hc.variation + · have hv := ENNReal.toReal_le_of_le_ofReal (by norm_num) hc.variation + have hh : sSup (Set.range (fun t => |triangularKernel s t|)) ≤ (1 : ℝ) := by + apply csSup_le (Set.range_nonempty _) + rintro _ ⟨t, rfl⟩ + dsimp only + rw [abs_of_nonneg (hc.nonneg t)] + exact hc.le_height t + linarith + +theorem endpoint_triangularKernel_control {s : ℝ} (hs : s ∈ Ico (0 : ℝ) 1) : + VariationControl (fun t => triangularKernel (Int.fract (s - t)) t) 1 2 := by + have heq : (fun t => triangularKernel (Int.fract (s - t)) t) = + (Ioc 0 s).indicator (fun _ => (1 : ℝ)) := by + funext t + exact endpoint_triangularKernel_eq_indicator hs t + rw [heq] + exact lower_interval_control s + +theorem endpoint_triangularKernel_BV_bound {s : ℝ} (hs : s ∈ Ico (0 : ℝ) 1) : + BoundedVariationOn (fun t => triangularKernel (Int.fract (s - t)) t) + (Icc (0 : ℝ) 1) ∧ + sSup (Set.range (fun t => |triangularKernel (Int.fract (s - t)) t|)) + + (eVariationOn (fun t => triangularKernel (Int.fract (s - t)) t) + (Icc (0 : ℝ) 1)).toReal ≤ 3 := by + have hc := endpoint_triangularKernel_control hs + constructor + · exact ne_top_of_le_ne_top ENNReal.ofReal_ne_top hc.variation + · have hv := ENNReal.toReal_le_of_le_ofReal (by norm_num) hc.variation + have hh : sSup (Set.range (fun t => |triangularKernel (Int.fract (s - t)) t|)) ≤ + (1 : ℝ) := by + apply csSup_le (Set.range_nonempty _) + rintro _ ⟨t, rfl⟩ + dsimp only + rw [abs_of_nonneg (hc.nonneg t)] + exact hc.le_height t + linarith + +end Invariant233.ScalarSampling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularLawMass.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularLawMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..6cca3d3a3a807ae815c0a090af792baed9e136ac --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularLawMass.lean @@ -0,0 +1,97 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductSampling +import OAI.Analysis.IrrationalRotation.Analysis.TriangularProbability +import Mathlib.MeasureTheory.Constructions.Pi + +namespace OAI + +noncomputable section +open MeasureTheory MeasureTheory.Measure +open scoped ENNReal + +namespace Invariant233.ProductModel + +private theorem rep_measurable : Measurable circleRepresentative := + measurable_subtype_coe.comp (AddCircle.measurableEquivIco (1 : ℝ) 0).measurable + +private theorem rep_injective : Function.Injective circleRepresentative := + Subtype.val_injective.comp (AddCircle.equivIco (1 : ℝ) 0).injective + +theorem circle_strict_triangle_mass : + (circleMeasure.prod circleMeasure) + {xz : Circle × Circle | circleRepresentative xz.1 < circleRepresentative xz.2} = + (1 / 2 : ℝ≥0∞) := by + let ν := circleMeasure.map circleRepresentative + have : NullSingletonClass circleMeasure := by + change NullSingletonClass (volume : Measure Circle) + constructor + intro x + simpa using (AddCircle.volume_closedBall (T := (1 : ℝ)) (x := x) 0) + have : IsProbabilityMeasure ν := inferInstance + have : NullSingletonClass ν := by + constructor + intro x + change (circleMeasure.map circleRepresentative) {x} = 0 + rw [map_apply rep_measurable (measurableSet_singleton x)] + apply Set.Subsingleton.measure_zero + intro a ha b hb + apply rep_injective + exact ha.trans hb.symm + have hmass := InvariantProjection.TriangularProbability.measure_strict_triangle ν + change ((circleMeasure.map circleRepresentative).prod + (circleMeasure.map circleRepresentative)) _ = _ at hmass + have hm : Measurable (Prod.map circleRepresentative circleRepresentative) := + rep_measurable.prodMap rep_measurable + rw [map_prod_map circleMeasure circleMeasure rep_measurable rep_measurable, + map_apply hm (measurableSet_lt measurable_fst measurable_snd)] at hmass + exact hmass + +theorem measurePreserving_finite_coordinate_pairs (I : Finset ℕ) : + MeasurePreserving + (fun xz : EndpointPair => fun i : I => (xz.1 i, xz.2 i)) + (baseMeasure.prod baseMeasure) + (Measure.pi (fun _ : I => circleMeasure.prod circleMeasure)) := by + have hr : MeasurePreserving I.restrict baseMeasure + (Measure.pi (fun _ : I => circleMeasure)) := by + refine ⟨Finset.measurable_restrict I, ?_⟩ + exact infinitePi_map_restrict (fun _ : ℕ => circleMeasure) + let e := MeasurableEquiv.arrowProdEquivProdArrow Circle Circle I + have he := (measurePreserving_arrowProdEquivProdArrow Circle Circle I + (fun _ => circleMeasure) (fun _ => circleMeasure)).symm + exact he.comp (hr.prod hr) + +theorem triangularEvent_mass (I : Finset ℕ) : + (baseMeasure.prod baseMeasure) (triangularEvent I) = (1 / 2 : ℝ≥0∞) ^ I.card := by + let E : Set (Circle × Circle) := + {xz | circleRepresentative xz.1 < circleRepresentative xz.2} + have hE : MeasurableSet E := + measurableSet_lt (rep_measurable.comp measurable_fst) (rep_measurable.comp measurable_snd) + have hpre : triangularEvent I = + (fun xz : EndpointPair => fun i : I => (xz.1 i, xz.2 i)) ⁻¹' + Set.univ.pi (fun _ : I => E) := by + ext xz + simp [triangularEvent, E, Set.mem_pi] + rw [hpre, (measurePreserving_finite_coordinate_pairs I).measure_preimage + (MeasurableSet.univ_pi (fun _ => hE)).nullMeasurableSet, Measure.pi_pi] + simp only [E, circle_strict_triangle_mass, Finset.prod_const, Finset.card_univ, + Fintype.card_coe] + +private theorem replacement_measurable (I : Finset ℕ) : + Measurable (fun xz : EndpointPair => (xz.1, selectedEndpoint I xz.1 xz.2)) := by + refine measurable_fst.prodMk (Measurable.of_eval fun index => ?_) + by_cases hi : index ∈ I + · simpa [selectedEndpoint, hi, Function.comp_def] using + (measurable_pi_apply index).comp measurable_snd + · simpa [selectedEndpoint, hi, Function.comp_def] using + (measurable_pi_apply index).comp measurable_fst + +theorem triangularLaw_mass (I : Finset ℕ) : + triangularLaw I Set.univ = (1 / 2 : ℝ≥0∞) ^ I.card := by + rw [triangularLaw, map_apply (replacement_measurable I) MeasurableSet.univ, + Set.preimage_univ, Measure.restrict_apply_univ] + exact triangularEvent_mass I + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularLawProperties.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularLawProperties.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3aeb1cb80f5302d11446b18e2fcf9b3f2068eb4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularLawProperties.lean @@ -0,0 +1,18 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TriangularLawMass +import OAI.Analysis.IrrationalRotation.Analysis.TriangularSecondMarginal + +namespace OAI + +namespace Invariant233.ProductModel + +theorem triangularLaw_properties (I : Finset ℕ) : TriangularLawProperties I := by + exact ⟨Sampling.triangularLaw_finite I, triangularLaw_mass I, + Sampling.triangularLaw_first_marginal I, + Sampling.triangularLaw_second_marginal I, + Sampling.triangularLaw_ordered I, + fun x => (Sampling.triangular_density_bounds I x).1, + fun y => (Sampling.triangular_density_bounds I y).2⟩ + +end Invariant233.ProductModel + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularMarginalMoments.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularMarginalMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..36b1d0f90924682f5cfd373b4d0e872c20d4078b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularMarginalMoments.lean @@ -0,0 +1,186 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TriangularLawProperties +import OAI.Analysis.IrrationalRotation.Couplings.ProductDensity +import Mathlib.Analysis.SpecialFunctions.Integrals.Basic + +namespace OAI + +noncomputable section +open MeasureTheory Set +open scoped BigOperators ENNReal + +namespace Invariant233.ProductModel + +private theorem rep_measurable : Measurable circleRepresentative := + Sampling.representative_measurable + +private theorem rep_bounds (x : Circle) : + 0 ≤ circleRepresentative x ∧ circleRepresentative x ≤ 1 := + ⟨(Sampling.representative_mem_Ico x).1, + (Sampling.representative_mem_Ico x).2.le⟩ + +theorem integral_circleRepresentative_pow (n : ℕ) : + (∫ x, circleRepresentative x ^ n ∂circleMeasure) = 1 / (n + 1 : ℝ) := by + have hmap : circleMeasure.map circleRepresentative = + volume.restrict (Ico (0 : ℝ) 1) := Sampling.representative_map_haar + calc + (∫ x, circleRepresentative x ^ n ∂circleMeasure) = + ∫ t in Ico (0 : ℝ) 1, t ^ n := by + rw [← hmap, integral_map rep_measurable.aemeasurable] + exact (measurable_id.pow_const n).aestronglyMeasurable + _ = ∫ t in (0 : ℝ)..1, t ^ n := by + rw [integral_Ico_eq_integral_Ioc, + intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] + _ = 1 / (n + 1 : ℝ) := by + rw [integral_pow] + simp + +theorem integral_one_sub_circleRepresentative_pow (n : ℕ) : + (∫ x, (1 - circleRepresentative x) ^ n ∂circleMeasure) = + 1 / (n + 1 : ℝ) := by + have hmap : circleMeasure.map circleRepresentative = + volume.restrict (Ico (0 : ℝ) 1) := Sampling.representative_map_haar + calc + (∫ x, (1 - circleRepresentative x) ^ n ∂circleMeasure) = + ∫ t in Ico (0 : ℝ) 1, (1 - t) ^ n := by + rw [← hmap, integral_map rep_measurable.aemeasurable] + exact ((measurable_const.sub measurable_id).pow_const n).aestronglyMeasurable + _ = ∫ t in (0 : ℝ)..1, (1 - t) ^ n := by + rw [integral_Ico_eq_integral_Ioc, + intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] + _ = ∫ t in (0 : ℝ)..1, t ^ n := by + simpa using (intervalIntegral.integral_comp_sub_left (fun t : ℝ => t ^ n) + (a := 0) (b := 1) 1) + _ = 1 / (n + 1 : ℝ) := by + rw [integral_pow] + simp + +private theorem representative_pow_integrable (n : ℕ) : + Integrable (fun x => circleRepresentative x ^ n) circleMeasure := by + apply (MemLp.of_bound (rep_measurable.pow_const n).aestronglyMeasurable 1 ?_ + : MemLp (fun x => circleRepresentative x ^ n) 1 circleMeasure).integrable (by norm_num) + exact ae_of_all _ fun x => by + rw [Real.norm_eq_abs, abs_of_nonneg (pow_nonneg (rep_bounds x).1 n)] + exact pow_le_one₀ (rep_bounds x).1 (rep_bounds x).2 + +private theorem one_sub_representative_pow_integrable (n : ℕ) : + Integrable (fun x => (1 - circleRepresentative x) ^ n) circleMeasure := by + apply (MemLp.of_bound ((measurable_const.sub rep_measurable).pow_const n).aestronglyMeasurable + 1 ?_ : MemLp (fun x => (1 - circleRepresentative x) ^ n) 1 circleMeasure).integrable + (by norm_num) + exact ae_of_all _ fun x => by + rw [Real.norm_eq_abs, abs_of_nonneg (pow_nonneg (sub_nonneg.mpr (rep_bounds x).2) n)] + exact pow_le_one₀ (sub_nonneg.mpr (rep_bounds x).2) (by linarith [(rep_bounds x).1]) + +theorem integral_triangularFirstDensity_pow (I : Finset ℕ) (n : ℕ) : + (∫ x, triangularFirstDensity I x ^ n ∂baseMeasure) = + (1 / (n + 1 : ℝ)) ^ I.card := by + simp only [triangularFirstDensity, ← Finset.prod_pow] + rw [baseMeasure, ProductDensity.integral_partial_product I + (fun _ => one_sub_representative_pow_integrable n)] + simp [integral_one_sub_circleRepresentative_pow] + +theorem integral_triangularSecondDensity_pow (I : Finset ℕ) (n : ℕ) : + (∫ x, triangularSecondDensity I x ^ n ∂baseMeasure) = + (1 / (n + 1 : ℝ)) ^ I.card := by + simp only [triangularSecondDensity, ← Finset.prod_pow] + rw [baseMeasure, ProductDensity.integral_partial_product I + (fun _ => representative_pow_integrable n)] + simp [integral_circleRepresentative_pow] + +theorem integral_triangularFirstDensity_sq (I : Finset ℕ) : + (∫ x, triangularFirstDensity I x ^ 2 ∂baseMeasure) = (1 / 3 : ℝ) ^ I.card := by + convert integral_triangularFirstDensity_pow I 2 using 1 + norm_num + +theorem integral_triangularSecondDensity_sq (I : Finset ℕ) : + (∫ x, triangularSecondDensity I x ^ 2 ∂baseMeasure) = (1 / 3 : ℝ) ^ I.card := by + convert integral_triangularSecondDensity_pow I 2 using 1 + norm_num + +theorem memLp_triangularFirstDensity (I : Finset ℕ) (p : ℝ≥0∞) : + MemLp (triangularFirstDensity I) p baseMeasure := by + have hm : Measurable (triangularFirstDensity I) := by + unfold triangularFirstDensity + exact Finset.measurable_prod I fun i _ => + measurable_const.sub (rep_measurable.comp (measurable_pi_apply i)) + apply MemLp.of_bound hm.aestronglyMeasurable 1 + exact ae_of_all _ fun x => by + rw [Real.norm_eq_abs, abs_of_nonneg (Sampling.triangular_density_bounds I x).1.1] + exact (Sampling.triangular_density_bounds I x).1.2 + +theorem memLp_triangularSecondDensity (I : Finset ℕ) (p : ℝ≥0∞) : + MemLp (triangularSecondDensity I) p baseMeasure := by + have hm : Measurable (triangularSecondDensity I) := by + unfold triangularSecondDensity + exact Finset.measurable_prod I fun i _ => + rep_measurable.comp (measurable_pi_apply i) + apply MemLp.of_bound hm.aestronglyMeasurable 1 + exact ae_of_all _ fun x => by + rw [Real.norm_eq_abs, abs_of_nonneg (Sampling.triangular_density_bounds I x).2.1] + exact (Sampling.triangular_density_bounds I x).2.2 + +theorem eLpNorm_triangularFirstDensity (I : Finset ℕ) : + eLpNorm (triangularFirstDensity I) 2 baseMeasure = + ENNReal.ofReal (Real.sqrt ((1 / 3 : ℝ) ^ I.card)) := by + rw [MemLp.eLpNorm_eq_integral_rpow_norm (by norm_num) (by norm_num) + (memLp_triangularFirstDensity I 2)] + norm_num only [ENNReal.toReal_ofNat, Real.rpow_two, Real.norm_eq_abs, sq_abs] + rw [integral_triangularFirstDensity_sq, Real.sqrt_eq_rpow] + +theorem eLpNorm_triangularSecondDensity (I : Finset ℕ) : + eLpNorm (triangularSecondDensity I) 2 baseMeasure = + ENNReal.ofReal (Real.sqrt ((1 / 3 : ℝ) ^ I.card)) := by + rw [MemLp.eLpNorm_eq_integral_rpow_norm (by norm_num) (by norm_num) + (memLp_triangularSecondDensity I 2)] + norm_num only [ENNReal.toReal_ofNat, Real.rpow_two, Real.norm_eq_abs, sq_abs] + rw [integral_triangularSecondDensity_sq, Real.sqrt_eq_rpow] + +theorem triangularLaw_exact_L2_marginals (I : Finset ℕ) : + ∃ f g : Lp ℝ 2 baseMeasure, + ((fun x => f x) =ᵐ[baseMeasure] triangularFirstDensity I) ∧ + ((fun x => g x) =ᵐ[baseMeasure] triangularSecondDensity I) ∧ + (0 ≤ᵐ[baseMeasure] f) ∧ (0 ≤ᵐ[baseMeasure] g) ∧ + (triangularLaw I).map Prod.fst = + baseMeasure.withDensity (fun x => ENNReal.ofReal (f x)) ∧ + (triangularLaw I).map Prod.snd = + baseMeasure.withDensity (fun x => ENNReal.ofReal (g x)) ∧ + ‖f‖ = Real.sqrt ((1 / 3 : ℝ) ^ I.card) ∧ + ‖g‖ = Real.sqrt ((1 / 3 : ℝ) ^ I.card) := by + let hf := memLp_triangularFirstDensity I 2 + let hg := memLp_triangularSecondDensity I 2 + let f := hf.toLp (triangularFirstDensity I) + let g := hg.toLp (triangularSecondDensity I) + have hfeq : (fun x => f x) =ᵐ[baseMeasure] triangularFirstDensity I := hf.coeFn_toLp + have hgeq : (fun x => g x) =ᵐ[baseMeasure] triangularSecondDensity I := hg.coeFn_toLp + refine ⟨f, g, hfeq, hgeq, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · filter_upwards [hfeq] with x hx + rw [hx] + exact (Sampling.triangular_density_bounds I x).1.1 + · filter_upwards [hgeq] with x hx + rw [hx] + exact (Sampling.triangular_density_bounds I x).2.1 + · rw [triangularLaw_first_marginal] + exact withDensity_congr_ae (hfeq.symm.fun_comp ENNReal.ofReal) + · rw [Sampling.triangularLaw_second_marginal] + exact withDensity_congr_ae (hgeq.symm.fun_comp ENNReal.ofReal) + · rw [Lp.norm_toLp, eLpNorm_triangularFirstDensity, ENNReal.toReal_ofReal + (Real.sqrt_nonneg _)] + · rw [Lp.norm_toLp, eLpNorm_triangularSecondDensity, ENNReal.toReal_ofReal + (Real.sqrt_nonneg _)] + +theorem triangularLaw_hasUniformL2Marginals (I : ℕ → Finset ℕ) : + HasUniformL2Marginals (fun l => triangularLaw (I l)) := by + refine ⟨1, zero_le_one, ?_⟩ + intro l + obtain ⟨f, g, _hfeq, _hgeq, hf, hg, hmf, hmg, hnf, hng⟩ := + triangularLaw_exact_L2_marginals (I l) + have hnorm : Real.sqrt ((1 / 3 : ℝ) ^ (I l).card) ≤ 1 := by + apply Real.sqrt_le_one.mpr + exact pow_le_one₀ (by norm_num) (by norm_num) + exact ⟨f, g, hf, hg, hmf, hmg, hnf.le.trans hnorm, hng.le.trans hnorm⟩ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularMarginals.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularMarginals.lean new file mode 100644 index 0000000000000000000000000000000000000000..872d9ad636e46f5b888126e37e1ad529e6dd49c5 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularMarginals.lean @@ -0,0 +1,139 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TriangularLawMass +import OAI.Analysis.IrrationalRotation.Rotation.CircleRepresentative + +namespace OAI + +noncomputable section +open MeasureTheory MeasureTheory.Measure Set +open scoped ENNReal + +namespace Invariant233.ProductModel + +private theorem rep_measurable : Measurable circleRepresentative := + measurable_subtype_coe.comp (AddCircle.measurableEquivIco (1 : ℝ) 0).measurable + +private theorem rep_bounds (x : Circle) : + 0 ≤ circleRepresentative x ∧ circleRepresentative x < 1 := by + simpa [circleRepresentative] using (AddCircle.equivIco (1 : ℝ) 0 x).property + +private theorem rep_preserving : MeasurePreserving circleRepresentative circleMeasure + (volume.restrict (Ico (0 : ℝ) 1)) := + CocycleSupport.measurePreserving_circleRepresentative + +theorem circleRepresentative_upper_tail (r : ℝ) (hr : 0 ≤ r) : + circleMeasure {x | r < circleRepresentative x} = ENNReal.ofReal (1 - r) := by + change circleMeasure (circleRepresentative ⁻¹' Ioi r) = _ + rw [rep_preserving.measure_preimage measurableSet_Ioi.nullMeasurableSet, + Measure.restrict_apply measurableSet_Ioi] + have hset : Ioi r ∩ Ico (0 : ℝ) 1 = Ioo r 1 := by + ext x + simp only [mem_inter_iff, mem_Ioi, mem_Ico, mem_Ioo] + constructor + · tauto + · intro hx + exact ⟨hx.1, le_trans hr hx.1.le, hx.2⟩ + rw [hset, Real.volume_Ioo] + +theorem circleRepresentative_lower_tail (r : ℝ) (hr : r ≤ 1) : + circleMeasure {x | circleRepresentative x < r} = ENNReal.ofReal r := by + change circleMeasure (circleRepresentative ⁻¹' Iio r) = _ + rw [rep_preserving.measure_preimage measurableSet_Iio.nullMeasurableSet, + Measure.restrict_apply measurableSet_Iio] + have hset : Iio r ∩ Ico (0 : ℝ) 1 = Ico 0 r := by + ext x + simp only [mem_inter_iff, mem_Iio, mem_Ico] + constructor + · tauto + · intro hx + exact ⟨hx.2, hx.1, lt_of_lt_of_le hx.2 hr⟩ + rw [hset, Real.volume_Ico, sub_zero] + +private theorem event_measurable (I : Finset ℕ) : MeasurableSet (triangularEvent I) := by + simp only [triangularEvent, ofPred_forall] + apply MeasurableSet.iInter + intro i + apply MeasurableSet.iInter + intro _ + exact measurableSet_lt + (rep_measurable.comp ((measurable_pi_apply i).comp measurable_fst)) + (rep_measurable.comp ((measurable_pi_apply i).comp measurable_snd)) + +theorem triangularEvent_fiber_mass (I : Finset ℕ) (x : Base) : + baseMeasure (Prod.mk x ⁻¹' triangularEvent I) = + ENNReal.ofReal (triangularFirstDensity I x) := by + change (Measure.infinitePi (fun _ : ℕ => circleMeasure)) + ((I : Set ℕ).pi (fun i => {z | circleRepresentative (x i) < circleRepresentative z})) = _ + rw [Measure.infinitePi_pi _ (fun _ _ => measurableSet_lt measurable_const rep_measurable)] + simp_rw [circleRepresentative_upper_tail _ (rep_bounds _).1] + rw [triangularFirstDensity, ENNReal.ofReal_prod_of_nonneg] + intro i _ + exact sub_nonneg.mpr (rep_bounds (x i)).2.le + +theorem fst_restrict_prod_eq_withDensity {α β : Type*} + [MeasurableSpace α] [MeasurableSpace β] (μ : Measure α) (ν : Measure β) + [SFinite ν] (E : Set (α × β)) (hE : MeasurableSet E) : + ((μ.prod ν).restrict E).map Prod.fst = + μ.withDensity (fun x => ν (Prod.mk x ⁻¹' E)) := by + ext s hs + rw [Measure.map_apply measurable_fst hs, + Measure.restrict_apply (measurable_fst hs), + Measure.prod_apply ((measurable_fst hs).inter hE), + withDensity_apply _ hs, ← lintegral_indicator hs] + apply lintegral_congr + intro x + by_cases hx : x ∈ s + · simp [hx, Set.preimage, Set.indicator_of_mem] + · simp [hx, Set.preimage, Set.indicator_of_notMem] + +theorem triangularLaw_first_marginal (I : Finset ℕ) : + (triangularLaw I).map Prod.fst = + baseMeasure.withDensity (fun x => ENNReal.ofReal (triangularFirstDensity I x)) := by + have hm : Measurable (fun xz : EndpointPair => (xz.1, selectedEndpoint I xz.1 xz.2)) := by + refine measurable_fst.prodMk (Measurable.of_eval fun index => ?_) + by_cases hi : index ∈ I + · simpa [selectedEndpoint, hi, Function.comp_def] using + (measurable_pi_apply index).comp (measurable_snd : Measurable (Prod.snd : EndpointPair → Base)) + · simpa [selectedEndpoint, hi, Function.comp_def] using + (measurable_pi_apply index).comp (measurable_fst : Measurable (Prod.fst : EndpointPair → Base)) + rw [triangularLaw, Measure.map_map measurable_fst hm] + change ((baseMeasure.prod baseMeasure).restrict (triangularEvent I)).map Prod.fst = _ + rw [fst_restrict_prod_eq_withDensity _ _ _ (event_measurable I)] + congr 1 + funext x + exact triangularEvent_fiber_mass I x + +theorem reversedTriangularEvent_fiber_mass (I : Finset ℕ) (x : Base) : + baseMeasure {z : Base | ∀ i ∈ I, + circleRepresentative (z i) < circleRepresentative (x i)} = + ENNReal.ofReal (triangularSecondDensity I x) := by + change (Measure.infinitePi (fun _ : ℕ => circleMeasure)) + ((I : Set ℕ).pi (fun i => {z | circleRepresentative z < circleRepresentative (x i)})) = _ + rw [Measure.infinitePi_pi _ (fun _ _ => measurableSet_lt rep_measurable measurable_const)] + simp_rw [circleRepresentative_lower_tail _ (rep_bounds _).2.le] + rw [triangularSecondDensity, ENNReal.ofReal_prod_of_nonneg] + intro i _ + exact (rep_bounds (x i)).1 + +theorem reversedTriangularEvent_first_marginal (I : Finset ℕ) : + ((baseMeasure.prod baseMeasure).restrict + {xz : EndpointPair | ∀ i ∈ I, + circleRepresentative (xz.2 i) < circleRepresentative (xz.1 i)}).map Prod.fst = + baseMeasure.withDensity (fun x => ENNReal.ofReal (triangularSecondDensity I x)) := by + rw [fst_restrict_prod_eq_withDensity] + · congr 1 + funext x + exact reversedTriangularEvent_fiber_mass I x + · simp only [ofPred_forall] + apply MeasurableSet.iInter + intro i + apply MeasurableSet.iInter + intro _ + exact measurableSet_lt + (rep_measurable.comp ((measurable_pi_apply i).comp measurable_snd)) + (rep_measurable.comp ((measurable_pi_apply i).comp measurable_fst)) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularProbability.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularProbability.lean new file mode 100644 index 0000000000000000000000000000000000000000..f128313843dfc0d8a47ab2bcd27adcc5b45aa5eb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularProbability.lean @@ -0,0 +1,51 @@ +import Mathlib.MeasureTheory.Measure.Prod +import Mathlib.MeasureTheory.Measure.Typeclasses.NullSingletonClass +import Mathlib.MeasureTheory.Measure.Typeclasses.Probability +import Mathlib.MeasureTheory.Constructions.BorelSpace.Order +import Mathlib.Tactic + +namespace OAI + +open scoped ENNReal +open MeasureTheory MeasureTheory.Measure + +namespace InvariantProjection.TriangularProbability + +theorem ae_ne_prod (μ : Measure ℝ) [IsProbabilityMeasure μ] [NullSingletonClass μ] : + ∀ᵐ z ∂μ.prod μ, z.1 ≠ z.2 := by + apply (ae_prod_iff_ae_ae measurableSet_diagonal.compl).2 + exact Filter.Eventually.of_forall fun x => (μ.ae_ne x).mono fun y hy => Ne.symm hy + +theorem measure_strict_triangle (μ : Measure ℝ) [IsProbabilityMeasure μ] + [NullSingletonClass μ] : (μ.prod μ) {z : ℝ × ℝ | z.1 < z.2} = 1 / 2 := by + let E : Set (ℝ × ℝ) := {z | z.1 < z.2} + let F : Set (ℝ × ℝ) := {z | z.2 < z.1} + have hE : MeasurableSet E := measurableSet_lt measurable_fst measurable_snd + have hF : MeasurableSet F := measurableSet_lt measurable_snd measurable_fst + have hswap : (μ.prod μ) E = (μ.prod μ) F := by + calc + (μ.prod μ) E = ((μ.prod μ).map Prod.swap) E := by rw [prod_swap] + _ = (μ.prod μ) F := by rw [Measure.map_apply measurable_swap hE]; rfl + have hcompl : Eᶜ =ᵐ[μ.prod μ] F := by + filter_upwards [ae_ne_prod μ] with z hz + change (¬ z.1 < z.2) = (z.2 < z.1) + apply propext + exact ⟨fun h => lt_of_le_of_ne (le_of_not_gt h) (Ne.symm hz), + fun h => not_lt_of_gt h⟩ + have hsum : (μ.prod μ) E + (μ.prod μ) E = 1 := by + calc + (μ.prod μ) E + (μ.prod μ) E = (μ.prod μ) E + (μ.prod μ) F := + congrArg (fun r => (μ.prod μ) E + r) hswap + _ = (μ.prod μ) E + (μ.prod μ) Eᶜ := + congrArg (fun r => (μ.prod μ) E + r) (measure_congr hcompl).symm + _ = 1 := by rw [measure_add_measure_compl hE, measure_univ] + have hfinite : (μ.prod μ) E ≠ ∞ := measure_ne_top _ _ + apply (ENNReal.toReal_eq_toReal_iff' hfinite (by norm_num)).mp + have hsreal := congrArg ENNReal.toReal hsum + rw [ENNReal.toReal_add hfinite hfinite] at hsreal + norm_num at hsreal ⊢ + linarith + +end InvariantProjection.TriangularProbability + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularSecondMarginal.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularSecondMarginal.lean new file mode 100644 index 0000000000000000000000000000000000000000..86aacd34f7056f3699251a2c2c7cfcd7a5dd5e7c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularSecondMarginal.lean @@ -0,0 +1,58 @@ +import OAI.Analysis.IrrationalRotation.Product.CoordinateSwap +import OAI.Analysis.IrrationalRotation.Sampling.ProductSampling + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal + +namespace Invariant233.ProductModel.Sampling + +def reverseTriangularEvent (I : Finset ℕ) : Set EndpointPair := + {xz | ∀ i ∈ I, circleRepresentative (xz.2 i) < circleRepresentative (xz.1 i)} + +theorem reverseTriangularEvent_measurable (I : Finset ℕ) : + MeasurableSet (reverseTriangularEvent I) := + (triangularEvent_measurable I).preimage measurable_swap + +theorem swap_preimage_reverseTriangularEvent (I : Finset ℕ) : + CoordinateSwap.swapEquiv I ⁻¹' reverseTriangularEvent I = triangularEvent I := by + ext xz + change (∀ i ∈ I, circleRepresentative ((CoordinateSwap.swapEquiv I xz).2 i) < + circleRepresentative ((CoordinateSwap.swapEquiv I xz).1 i)) ↔ _ + constructor + · intro h i hi + simpa only [CoordinateSwap.swapEquiv_snd, CoordinateSwap.swapEquiv_fst, ite_eq_left hi] + using h i hi + · intro h i hi + simpa only [CoordinateSwap.swapEquiv_snd, CoordinateSwap.swapEquiv_fst, ite_eq_left hi] + using h i hi + +theorem triangularLaw_second_marginal_swap (I : Finset ℕ) : + (triangularLaw I).map Prod.snd = + ((baseMeasure.prod baseMeasure).restrict (reverseTriangularEvent I)).map Prod.fst := by + have hp : MeasurePreserving (CoordinateSwap.swapEquiv (X := Circle) I) + (baseMeasure.prod baseMeasure) (baseMeasure.prod baseMeasure) := + CoordinateSwap.measurePreserving_swap circleMeasure I + have hm := hp.restrict_preimage (reverseTriangularEvent_measurable I) + rw [swap_preimage_reverseTriangularEvent] at hm + have heq : (fun xz : EndpointPair => selectedEndpoint I xz.1 xz.2) = + Prod.fst ∘ CoordinateSwap.swapEquiv I := by + funext xz i + exact (CoordinateSwap.swapEquiv_fst I xz i).symm + unfold triangularLaw + rw [Measure.map_map measurable_snd (endpointMap_measurable I)] + change ((baseMeasure.prod baseMeasure).restrict (triangularEvent I)).map + (fun xz : EndpointPair => selectedEndpoint I xz.1 xz.2) = _ + rw [heq, ← Measure.map_map measurable_fst (CoordinateSwap.swapEquiv I).measurable, + hm.map_eq] + +theorem triangularLaw_second_marginal (I : Finset ℕ) : + (triangularLaw I).map Prod.snd = + baseMeasure.withDensity (fun y => ENNReal.ofReal (triangularSecondDensity I y)) := by + rw [triangularLaw_second_marginal_swap] + exact reversedRestriction_first_marginal I + +end Invariant233.ProductModel.Sampling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularTestedVariation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularTestedVariation.lean new file mode 100644 index 0000000000000000000000000000000000000000..2dcd8686e3904286161426d325967d225839c001 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TriangularTestedVariation.lean @@ -0,0 +1,153 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TriangularEndpointKernel + +namespace OAI + +noncomputable section +open Set + +namespace Invariant233.ScalarSampling + +theorem VariationControl.mul_interval_indicator {f : ℝ → ℝ} {C V : ℝ} + (hf : VariationControl f C V) (hC : 0 ≤ C) (hV : 0 ≤ V) + (g : ℝ → ℝ) (hg : Monotone g ∨ Antitone g) (a b : ℝ) : + VariationControl (fun t => f t * (Ico a b).indicator (fun _ => 1) (g t)) + C (V + 2 * C) := by + have ha : (∀ x y, x ≤ y → a ≤ g x → a ≤ g y) ∨ + (∀ x y, x ≤ y → a ≤ g y → a ≤ g x) := by + rcases hg with hg | hg + · exact Or.inl (fun _ _ hxy hx => hx.trans (hg hxy)) + · exact Or.inr (fun _ _ hxy hy => hy.trans (hg hxy)) + have hb : (∀ x y, x ≤ y → g x < b → g y < b) ∨ + (∀ x y, x ≤ y → g y < b → g x < b) := by + rcases hg with hg | hg + · exact Or.inr (fun _ _ hxy hy => (hg hxy).trans_lt hy) + · exact Or.inl (fun _ _ hxy hx => (hg hxy).trans_lt hx) + have h1 := hf.mask hC hV (fun t => a ≤ g t) ha + have h2 := h1.mask hC (add_nonneg hV hC) (fun t => g t < b) hb + convert h2 using 1 + · funext t + by_cases hat : a ≤ g t <;> by_cases hbt : g t < b <;> simp [hat, hbt] + · ring + +theorem VariationControl.fixed_indicator_mul {f : ℝ → ℝ} {C V : ℝ} + (hf : VariationControl f C V) (hC : 0 ≤ C) (E : Set ℝ) (s : ℝ) : + VariationControl (fun t => E.indicator (fun _ => 1) s * f t) C V := by + by_cases hs : s ∈ E + · simpa [hs] using hf + · simp only [Set.indicator_of_notMem hs, zero_mul] + refine ⟨fun _ => le_rfl, fun _ => hC, ?_⟩ + have hzero : eVariationOn (fun _ : ℝ => (0 : ℝ)) (Icc (0 : ℝ) 1) = 0 := by + apply (eVariationOn.eq_zero_iff _).2 + intro x hx y hy + exact edist_self _ + rw [hzero] + exact bot_le + +theorem VariationControl.boundedVariation_sup_add_le {f : ℝ → ℝ} {C V : ℝ} + (hf : VariationControl f C V) (hV : 0 ≤ V) : + BoundedVariationOn f (Icc (0 : ℝ) 1) ∧ + sSup (Set.range (fun t => |f t|)) + + (eVariationOn f (Icc (0 : ℝ) 1)).toReal ≤ C + V := by + constructor + · exact ne_top_of_le_ne_top ENNReal.ofReal_ne_top hf.variation + · have hv := ENNReal.toReal_le_of_le_ofReal hV hf.variation + have hh : sSup (Set.range (fun t => |f t|)) ≤ C := by + apply csSup_le (Set.range_nonempty _) + rintro _ ⟨t, rfl⟩ + dsimp only + rw [abs_of_nonneg (hf.nonneg t)] + exact hf.le_height t + exact add_le_add hh hv + +theorem triangularKernel_mul_test_unwrap {s : ℝ} (hs : s ∈ Ico (0 : ℝ) 1) + (F : ℝ → ℝ) (t : ℝ) : + triangularKernel s t * F (Int.fract (s + t)) = triangularKernel s t * F (s + t) := by + by_cases ht : t ∈ Ioo 0 (1 - s) + · have hfract : Int.fract (s + t) = s + t := + Int.fract_eq_self.mpr ⟨by linarith [hs.1, ht.1], by linarith [ht.2]⟩ + rw [hfract] + · simp [triangularKernel, ht] + +theorem endpoint_triangularKernel_mul_test_unwrap {s : ℝ} + (hs : s ∈ Ico (0 : ℝ) 1) (F : ℝ → ℝ) (t : ℝ) : + triangularKernel (Int.fract (s - t)) t * F (Int.fract (s - t)) = + triangularKernel (Int.fract (s - t)) t * F (s - t) := by + by_cases ht : t ∈ Ioc 0 s + · have hfract : Int.fract (s - t) = s - t := + Int.fract_eq_self.mpr ⟨by linarith [ht.2], by linarith [hs.2, ht.1]⟩ + rw [hfract] + · rw [endpoint_triangularKernel_eq_indicator hs] + simp [ht] + +theorem tested_triangularKernel_control {s : ℝ} (hs : s ∈ Ico (0 : ℝ) 1) + (a b c d : ℝ) : + VariationControl (fun t => triangularKernel s t * + (Ico a b).indicator (fun _ => 1) s * + (Ico c d).indicator (fun _ => 1) (Int.fract (s + t))) 1 4 := by + have hc := (triangularKernel_control s).mul_interval_indicator + (by norm_num) (by norm_num) (fun t => s + t) + (Or.inl (by intro x y hxy; dsimp only; linarith)) c d + have hfixed := hc.fixed_indicator_mul (by norm_num) (Ico a b) s + have heq : (fun t => triangularKernel s t * (Ico a b).indicator (fun _ => 1) s * + (Ico c d).indicator (fun _ => 1) (Int.fract (s + t))) = + fun t => (Ico a b).indicator (fun _ => 1) s * + (triangularKernel s t * (Ico c d).indicator (fun _ => 1) (s + t)) := by + funext t + calc + _ = (Ico a b).indicator (fun _ => 1) s * + (triangularKernel s t * + (Ico c d).indicator (fun _ => 1) (Int.fract (s + t))) := by ring + _ = _ := by rw [triangularKernel_mul_test_unwrap hs] + rw [heq] + convert hfixed using 1 + norm_num + +theorem tested_endpoint_triangularKernel_control {s : ℝ} (hs : s ∈ Ico (0 : ℝ) 1) + (a b c d : ℝ) : + VariationControl (fun t => triangularKernel (Int.fract (s - t)) t * + (Ico a b).indicator (fun _ => 1) (Int.fract (s - t)) * + (Ico c d).indicator (fun _ => 1) s) 1 4 := by + have hc := (endpoint_triangularKernel_control hs).mul_interval_indicator + (by norm_num) (by norm_num) (fun t => s - t) + (Or.inr (by intro x y hxy; exact sub_le_sub_left hxy s)) a b + have hfixed := hc.fixed_indicator_mul (by norm_num) (Ico c d) s + have heq : (fun t => triangularKernel (Int.fract (s - t)) t * + (Ico a b).indicator (fun _ => 1) (Int.fract (s - t)) * + (Ico c d).indicator (fun _ => 1) s) = + fun t => (Ico c d).indicator (fun _ => 1) s * + (triangularKernel (Int.fract (s - t)) t * + (Ico a b).indicator (fun _ => 1) (s - t)) := by + funext t + calc + _ = (Ico c d).indicator (fun _ => 1) s * + (triangularKernel (Int.fract (s - t)) t * + (Ico a b).indicator (fun _ => 1) (Int.fract (s - t))) := by ring + _ = _ := by rw [endpoint_triangularKernel_mul_test_unwrap hs] + rw [heq] + convert hfixed using 1 + norm_num + +theorem tested_triangularKernel_BV_bound {s : ℝ} (hs : s ∈ Ico (0 : ℝ) 1) + (a b c d : ℝ) : + let f := fun t => triangularKernel s t * (Ico a b).indicator (fun _ => 1) s * + (Ico c d).indicator (fun _ => 1) (Int.fract (s + t)) + BoundedVariationOn f (Icc (0 : ℝ) 1) ∧ + sSup (Set.range (fun t => |f t|)) + (eVariationOn f (Icc (0 : ℝ) 1)).toReal ≤ 5 := by + simpa only [show (1 : ℝ) + 4 = 5 by norm_num] using (tested_triangularKernel_control hs a b c d).boundedVariation_sup_add_le + (by norm_num) + +theorem tested_endpoint_triangularKernel_BV_bound {s : ℝ} (hs : s ∈ Ico (0 : ℝ) 1) + (a b c d : ℝ) : + let f := fun t => triangularKernel (Int.fract (s - t)) t * + (Ico a b).indicator (fun _ => 1) (Int.fract (s - t)) * + (Ico c d).indicator (fun _ => 1) s + BoundedVariationOn f (Icc (0 : ℝ) 1) ∧ + sSup (Set.range (fun t => |f t|)) + (eVariationOn f (Icc (0 : ℝ) 1)).toReal ≤ 5 := by + simpa only [show (1 : ℝ) + 4 = 5 by norm_num] using (tested_endpoint_triangularKernel_control hs a b c d).boundedVariation_sup_add_le + (by norm_num) + +end Invariant233.ScalarSampling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TrimmingTotalVariation.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TrimmingTotalVariation.lean new file mode 100644 index 0000000000000000000000000000000000000000..61396f15960a1cb3e648e940ca0fb37408bf6a67 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TrimmingTotalVariation.lean @@ -0,0 +1,44 @@ +import Mathlib.MeasureTheory.VectorMeasure.Decomposition.JordanSub +import Mathlib.Topology.Instances.ENNReal.Lemmas + +namespace OAI + +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal Topology + +namespace Invariant233.TailTrimming + +theorem totalVariation_sub_restrict {X : Type*} [MeasurableSpace X] + (μ : Measure X) [IsFiniteMeasure μ] (A : Set X) (hA : MeasurableSet A) : + (μ.toSignedMeasure - (μ.restrict A).toSignedMeasure).totalVariation = + μ.restrict Aᶜ := by + rw [SignedMeasure.totalVariation, Measure.toJordanDecomposition_toSignedMeasure_sub] + change (μ - μ.restrict A) + (μ.restrict A - μ) = μ.restrict Aᶜ + rw [Measure.sub_eq_zero_of_le Measure.restrict_le_self, add_zero] + calc + μ - μ.restrict A = (μ.restrict Aᶜ + μ.restrict A) - μ.restrict A := by + rw [Measure.restrict_compl_add_restrict hA] + _ = μ.restrict Aᶜ := Measure.add_sub_cancel + +theorem totalVariation_sub_restrict_univ {X : Type*} [MeasurableSpace X] + (μ : Measure X) [IsFiniteMeasure μ] (A : Set X) (hA : MeasurableSet A) : + (μ.toSignedMeasure - (μ.restrict A).toSignedMeasure).totalVariation univ = μ Aᶜ := by + rw [totalVariation_sub_restrict μ A hA, Measure.restrict_apply MeasurableSet.univ, + univ_inter] + +theorem tendsto_totalVariation_sub_restrict {X J : Type*} [MeasurableSpace X] + {l : Filter J} (μ : J → Measure X) (hμ : ∀ j, IsFiniteMeasure (μ j)) + (A : J → Set X) (hA : ∀ j, MeasurableSet (A j)) + (hlost : Tendsto (fun j => μ j (A j)ᶜ) l (𝓝 0)) : + Tendsto (fun j => ((μ j).toSignedMeasure - ((μ j).restrict (A j)).toSignedMeasure).totalVariation univ) l (𝓝 0) := by + have heq (j : J) := by + letI := hμ j + exact totalVariation_sub_restrict_univ (μ j) (A j) (hA j) + simpa only [heq] using hlost + +end Invariant233.TailTrimming + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TrimmingWeakLimits.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TrimmingWeakLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..107f01056a23a04964a749d99a3dbea4a7d5c05b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TrimmingWeakLimits.lean @@ -0,0 +1,73 @@ +import Mathlib.MeasureTheory.Measure.FiniteMeasure +import Mathlib.MeasureTheory.Measure.Sub + +namespace OAI + +open MeasureTheory Filter Set Topology BoundedContinuousFunction +open scoped ENNReal NNReal + +namespace Invariant233.TrimmingWeakLimits + +variable {X : Type*} [TopologicalSpace X] [MeasurableSpace X] + [OpensMeasurableSpace X] + +omit [OpensMeasurableSpace X] in + +theorem testAgainstNN_add_measure (μ ν : FiniteMeasure X) (f : X →ᵇ ℝ≥0) : + (μ + ν).testAgainstNN f = μ.testAgainstNN f + ν.testAgainstNN f := by + simp only [← ENNReal.coe_inj, ENNReal.coe_add, FiniteMeasure.testAgainstNN_coe_eq, + FiniteMeasure.toMeasure_add, lintegral_add_measure] + +theorem tendsto_of_add_eq_of_mass_tendsto_zero {I : Type*} {l : Filter I} + {μn βn δn : I → FiniteMeasure X} {μ : FiniteMeasure X} + (hμ : Tendsto μn l (𝓝 μ)) (hsplit : ∀ i, βn i + δn i = μn i) + (hlost : Tendsto (fun i => (δn i).mass) l (𝓝 0)) : + Tendsto βn l (𝓝 μ) := by + apply FiniteMeasure.tendsto_iff_forall_testAgainstNN_tendsto.mpr + intro f + have hmain := FiniteMeasure.tendsto_iff_forall_testAgainstNN_tendsto.mp hμ f + have hsmall := FiniteMeasure.tendsto_zero_testAgainstNN_of_tendsto_zero_mass hlost f + have heq : (fun i => (βn i).testAgainstNN f) = + (fun i => (μn i).testAgainstNN f - (δn i).testAgainstNN f) := by + funext i + rw [← hsplit i, testAgainstNN_add_measure, add_tsub_cancel_right] + rw [heq] + simpa only [tsub_zero] using hmain.sub hsmall + +theorem tendsto_of_le_of_mass_sub_tendsto_zero {I : Type*} {l : Filter I} + {μn βn : I → FiniteMeasure X} {μ : FiniteMeasure X} + (hμ : Tendsto μn l (𝓝 μ)) + (hle : ∀ i, (βn i : Measure X) ≤ (μn i : Measure X)) + (hlost : Tendsto (fun i => (μn i).mass - (βn i).mass) l (𝓝 0)) : + Tendsto βn l (𝓝 μ) := by + let δn : I → FiniteMeasure X := fun i => + ⟨(μn i : Measure X) - (βn i : Measure X), inferInstance⟩ + apply tendsto_of_add_eq_of_mass_tendsto_zero hμ (δn := δn) + · intro i + apply FiniteMeasure.toMeasure_injective + change (βn i : Measure X) + ((μn i : Measure X) - (βn i : Measure X)) = _ + rw [add_comm, Measure.sub_add_cancel_of_le (hle i)] + · have heq : (fun i => (δn i).mass) = + (fun i => (μn i).mass - (βn i).mass) := by + funext i + change (((μn i : Measure X) - (βn i : Measure X)) univ).toNNReal = + ((μn i : Measure X) univ).toNNReal - ((βn i : Measure X) univ).toNNReal + rw [Measure.sub_apply MeasurableSet.univ (hle i), ENNReal.toNNReal_sub (measure_ne_top _ _)] + rwa [heq] + +theorem tendsto_restrict_of_compl_mass_tendsto_zero {I : Type*} {l : Filter I} + {μn : I → FiniteMeasure X} {μ : FiniteMeasure X} + (hμ : Tendsto μn l (𝓝 μ)) (A : I → Set X) + (hA : ∀ i, MeasurableSet (A i)) + (hlost : Tendsto (fun i => μn i (A i)ᶜ) l (𝓝 0)) : + Tendsto (fun i => (μn i).restrict (A i)) l (𝓝 μ) := by + apply tendsto_of_add_eq_of_mass_tendsto_zero hμ + (δn := fun i => (μn i).restrict (A i)ᶜ) + · intro i + simpa only [union_compl_self, FiniteMeasure.restrict_univ] using + (FiniteMeasure.restrict_union (μ := μn i) disjoint_compl_right (hA i).compl).symm + · simpa only [FiniteMeasure.restrict_mass] using hlost + +end Invariant233.TrimmingWeakLimits + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TruncatedLogIntegral.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TruncatedLogIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..9dad6d1e4241a720057bbc6a955fadc6009a46a2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TruncatedLogIntegral.lean @@ -0,0 +1,145 @@ +import Mathlib.Analysis.SpecialFunctions.Log.Basic +import Mathlib.MeasureTheory.Integral.Bochner.Basic +import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic + +namespace OAI + +open Set Filter MeasureTheory +open scoped ENNReal Topology + +namespace Invariant233 + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem lintegral_cost_eq_iSup_truncations (g : X → ℝ) (hm : Measurable g) : + (∫⁻ x, ENNReal.ofReal (g x) ∂μ) = + ⨆ n : ℕ, ∫⁻ x, ENNReal.ofReal (min (g x) (n : ℝ)) ∂μ := by + have hsup (x : X) : + (⨆ n : ℕ, ENNReal.ofReal (min (g x) (n : ℝ))) = ENNReal.ofReal (g x) := by + apply le_antisymm + · exact iSup_le fun n => ENNReal.ofReal_le_ofReal (min_le_left _ _) + · obtain ⟨n, hn⟩ := exists_nat_gt (g x) + exact le_iSup_of_le n (by rw [min_eq_left hn.le]) + rw [← lintegral_iSup] + · exact lintegral_congr (fun x => (hsup x).symm) + · intro n + exact (hm.min measurable_const).ennreal_ofReal + · intro n m hnm x + exact ENNReal.ofReal_le_ofReal (min_le_min_left _ (by exact_mod_cast hnm)) + +theorem integrable_min_nat_cost [IsFiniteMeasure μ] + (g : X → ℝ) (hm : Measurable g) (hg : ∀ x, 0 ≤ g x) (n : ℕ) : + Integrable (fun x => min (g x) (n : ℝ)) μ := by + refine (integrable_const (μ := μ) (n : ℝ)).mono' + (hm.min measurable_const).aestronglyMeasurable ?_ + exact ae_of_all μ fun x => by + rw [Real.norm_eq_abs, abs_of_nonneg (le_min (hg x) (Nat.cast_nonneg n))] + exact min_le_right _ _ + +theorem exists_integral_truncation_gt [IsFiniteMeasure μ] + (g : X → ℝ) (hm : Measurable g) (hg : ∀ x, 0 ≤ g x) + (hinf : (∫⁻ x, ENNReal.ofReal (g x) ∂μ) = ∞) (A : ℝ) : + ∃ n : ℕ, A < ∫ x, min (g x) (n : ℝ) ∂μ := by + have hs : (⨆ n : ℕ, ∫⁻ x, ENNReal.ofReal (min (g x) (n : ℝ)) ∂μ) = ∞ := by + rw [← lintegral_cost_eq_iSup_truncations g hm, hinf] + have ht : ENNReal.ofReal A < + ⨆ n : ℕ, ∫⁻ x, ENNReal.ofReal (min (g x) (n : ℝ)) ∂μ := by + rw [hs] + exact ENNReal.ofReal_lt_top + obtain ⟨n, hn⟩ := lt_iSup_iff.mp ht + refine ⟨n, ?_⟩ + rw [← ofReal_integral_eq_lintegral_ofReal + (integrable_min_nat_cost g hm hg n) + (ae_of_all μ fun x => le_min (hg x) (Nat.cast_nonneg n))] at hn + exact (ENNReal.ofReal_lt_ofReal_iff'.mp hn).1 + +theorem log_max_exp_neg (g M : ℝ) : + Real.log (max (Real.exp (-g)) (Real.exp (-M))) = -min g M := by + rcases le_total g M with h | h + · rw [max_eq_left (Real.exp_le_exp.mpr (neg_le_neg h)), Real.log_exp, min_eq_left h] + · rw [max_eq_right (Real.exp_le_exp.mpr (neg_le_neg h)), Real.log_exp, min_eq_right h] + +theorem integral_truncated_log_eq_neg_cost + (f g : X → ℝ) (hfg : f =ᵐ[μ] fun x => Real.exp (-g x)) (M : ℝ) : + (∫ x, Real.log (max (f x) (Real.exp (-M))) ∂μ) = + -(∫ x, min (g x) M ∂μ) := by + rw [← integral_neg] + apply integral_congr_ae + filter_upwards [hfg] with x hx + rw [hx, log_max_exp_neg] + +theorem exists_truncated_log_integral_lt_of_cost [IsFiniteMeasure μ] + (f g : X → ℝ) (hm : Measurable g) (hg : ∀ x, 0 ≤ g x) + (hfg : f =ᵐ[μ] fun x => Real.exp (-g x)) + (hinf : (∫⁻ x, ENNReal.ofReal (g x) ∂μ) = ∞) (A : ℝ) : + ∃ n : ℕ, (∫ x, Real.log (max (f x) (Real.exp (-(n : ℝ)))) ∂μ) < -A := by + obtain ⟨n, hn⟩ := exists_integral_truncation_gt g hm hg hinf A + refine ⟨n, ?_⟩ + rw [integral_truncated_log_eq_neg_cost f g hfg] + exact neg_lt_neg hn + +theorem exists_truncated_log_integral_lt [IsFiniteMeasure μ] + (f : X → ℝ) (hm : Measurable f) + (hf0 : ∀ x, 0 ≤ f x) (hf1 : ∀ x, f x ≤ 1) + (hpos : ∀ᵐ x ∂μ, 0 < f x) + (hinf : (∫⁻ x, ENNReal.ofReal (-Real.log (f x)) ∂μ) = ∞) (A : ℝ) : + ∃ n : ℕ, (∫ x, Real.log (max (f x) (Real.exp (-(n : ℝ)))) ∂μ) < -A := by + refine exists_truncated_log_integral_lt_of_cost f (fun x => -Real.log (f x)) + hm.log.neg (fun x => neg_nonneg.mpr (Real.log_nonpos (hf0 x) (hf1 x))) ?_ hinf A + filter_upwards [hpos] with x hx + simp [Real.exp_log hx] + +theorem tendsto_integral_truncations_atTop [IsFiniteMeasure μ] + (g : X → ℝ) (hm : Measurable g) (hg : ∀ x, 0 ≤ g x) + (hinf : (∫⁻ x, ENNReal.ofReal (g x) ∂μ) = ∞) : + Tendsto (fun n : ℕ => ∫ x, min (g x) (n : ℝ) ∂μ) atTop atTop := by + apply tendsto_atTop.2 + intro A + obtain ⟨n, hn⟩ := exists_integral_truncation_gt g hm hg hinf A + filter_upwards [eventually_ge_atTop n] with m hnm + refine hn.le.trans (integral_mono (integrable_min_nat_cost g hm hg n) + (integrable_min_nat_cost g hm hg m) ?_) + intro x + exact min_le_min (le_refl (g x)) (Nat.cast_le.mpr hnm) + +theorem tendsto_truncated_log_integrals_atBot [IsFiniteMeasure μ] + (f : X → ℝ) (hm : Measurable f) + (hf0 : ∀ x, 0 ≤ f x) (hf1 : ∀ x, f x ≤ 1) + (hpos : ∀ᵐ x ∂μ, 0 < f x) + (hinf : (∫⁻ x, ENNReal.ofReal (-Real.log (f x)) ∂μ) = ∞) : + Tendsto (fun n : ℕ => ∫ x, Real.log (max (f x) (Real.exp (-(n : ℝ)))) ∂μ) + atTop atBot := by + have hfg : f =ᵐ[μ] fun x => Real.exp (-(-Real.log (f x))) := by + filter_upwards [hpos] with x hx + simp [Real.exp_log hx] + have h := tendsto_neg_atTop_atBot.comp + (tendsto_integral_truncations_atTop (fun x => -Real.log (f x)) hm.log.neg + (fun x => neg_nonneg.mpr (Real.log_nonpos (hf0 x) (hf1 x))) hinf) + convert h using 1 + funext n + exact integral_truncated_log_eq_neg_cost f (fun x => -Real.log (f x)) hfg (n : ℝ) + +theorem exists_pos_truncated_log_integral_lt [IsFiniteMeasure μ] + (f : X → ℝ) (hm : Measurable f) + (hf0 : ∀ x, 0 ≤ f x) (hf1 : ∀ x, f x ≤ 1) + (hpos : ∀ᵐ x ∂μ, 0 < f x) + (hinf : (∫⁻ x, ENNReal.ofReal (-Real.log (f x)) ∂μ) = ∞) (a : ℝ) : + ∃ M : ℝ, 0 < M ∧ + (∫ x, Real.log (max (f x) (Real.exp (-M))) ∂μ) < -2 * a := by + have hlim := tendsto_truncated_log_integrals_atBot f hm hf0 hf1 hpos hinf + have hneg : ∀ᶠ n : ℕ in atTop, + (∫ x, Real.log (max (f x) (Real.exp (-(n : ℝ)))) ∂μ) < -2 * a := + hlim.eventually (eventually_lt_atBot (-2 * a)) + obtain ⟨n, hn, hnint⟩ := ((eventually_gt_atTop (0 : ℕ)).and hneg).exists + exact ⟨n, Nat.cast_pos.mpr hn, hnint⟩ + +theorem continuous_truncated_log {Y : Type*} [TopologicalSpace Y] + (f : Y → ℝ) (hf : Continuous f) (M : ℝ) : + Continuous (fun x => Real.log (max (f x) (Real.exp (-M)))) := by + apply (hf.max continuous_const).log + intro x + exact ne_of_gt ((Real.exp_pos (-M)).trans_le (le_max_right _ _)) + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/TruncationEvent.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/TruncationEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..7bc0c8386ce8154a93229f161a4158a1782c3e5b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/TruncationEvent.lean @@ -0,0 +1,126 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TaggedEventBounds +import OAI.Analysis.IrrationalRotation.Analysis.EndpointIntervalBounds + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal + +namespace InvariantRotation.TruncationEvent + +open TaggedEventBounds EndpointIntervalBounds + +variable {Ω : Type*} [MeasurableSpace Ω] + +theorem currentBlock_mass_lower_bound (m : ℕ) (hm : 0 < m) + (μ : Fin m → Measure Ω) [∀ i, IsProbabilityMeasure (μ i)] + (T : Fin m → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + {X Y : Fin m → Ω → ℝ} (hX : ∀ i, Measurable (X i)) (hY : ∀ i, Measurable (Y i)) + {C a : ℝ} (hC : 0 ≤ C) (ha : 0 ≤ a) + (hbudget : 0 ≤ 1 - (1 + 2 * (C * a)) / (m : ℝ)) + (hTag : ∀ i, (μ i).real (T i) = 1 / (m : ℝ)) + (hSafe : ∀ i, ∀ x ∈ T i, X i x < 1 - a / (m : ℝ) ∧ a / (m : ℝ) < Y i x) + (hdomX : ∀ i, (μ i).map (X i) ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) + (hdomY : ∀ i, (μ i).map (Y i) ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) : + (1 - (1 + 2 * (C * a)) / (m : ℝ)) ^ (m - 1) ≤ + (Measure.pi μ).real {x | (∃ i, x i ∈ T i) ∧ + ∀ i, X i (x i) < 1 - a / (m : ℝ) ∧ a / (m : ℝ) < Y i (x i)} := by + let B₁ : Fin m → Set Ω := fun i => {x | 1 - a / (m : ℝ) ≤ X i x} + let B₂ : Fin m → Set Ω := fun i => {x | Y i x ≤ a / (m : ℝ)} + have hB₁ : ∀ i, MeasurableSet (B₁ i) := fun i => + measurableSet_le measurable_const (hX i) + have hB₂ : ∀ i, MeasurableSet (B₂ i) := fun i => + measurableSet_le (hY i) measurable_const + have hSafe' : ∀ i, T i ⊆ (B₁ i)ᶜ ∩ (B₂ i)ᶜ := by + intro i x hx + exact ⟨not_le.mpr (hSafe i x hx).1, not_le.mpr (hSafe i x hx).2⟩ + have hd : 0 ≤ a / (m : ℝ) := div_nonneg ha (Nat.cast_nonneg m) + have hBad₁ : ∀ i, (μ i).real (B₁ i) ≤ C * a / (m : ℝ) := by + intro i + simpa only [mul_div_assoc] using endpoint_function_upper_loss_le + (μ i) (hX i) hC hd (hdomX i) + have hBad₂ : ∀ i, (μ i).real (B₂ i) ≤ C * a / (m : ℝ) := by + intro i + simpa only [mul_div_assoc] using endpoint_function_lower_loss_le + (μ i) (hY i) hC hd (hdomY i) + have h := currentBlockEvent_measureReal_lower_bound m hm μ T B₁ B₂ hT hB₁ hB₂ + hSafe' hbudget hTag hBad₁ hBad₂ + simpa only [currentBlockEvent, B₁, B₂, Set.mem_ofPred_eq, not_le] using h + +theorem currentBlock_mass_lower_bound_ae (m : ℕ) (hm : 0 < m) + (μ : Fin m → Measure Ω) [∀ i, IsProbabilityMeasure (μ i)] + (T : Fin m → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + {X Y : Fin m → Ω → ℝ} (hX : ∀ i, Measurable (X i)) (hY : ∀ i, Measurable (Y i)) + {C a : ℝ} (hC : 0 ≤ C) (ha : 0 ≤ a) + (hbudget : 0 ≤ 1 - (1 + 2 * (C * a)) / (m : ℝ)) + (hTag : ∀ i, (μ i).real (T i) = 1 / (m : ℝ)) + (hSafe : ∀ i, ∀ᵐ x ∂μ i, x ∈ T i → + X i x < 1 - a / (m : ℝ) ∧ a / (m : ℝ) < Y i x) + (hdomX : ∀ i, (μ i).map (X i) ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) + (hdomY : ∀ i, (μ i).map (Y i) ≤ ENNReal.ofReal C • volume.restrict (Ico (0 : ℝ) 1)) : + (1 - (1 + 2 * (C * a)) / (m : ℝ)) ^ (m - 1) ≤ + (Measure.pi μ).real {x | (∃ i, x i ∈ T i) ∧ + ∀ i, X i (x i) < 1 - a / (m : ℝ) ∧ a / (m : ℝ) < Y i (x i)} := by + let T' : Fin m → Set Ω := fun i => T i ∩ + {x | X i x < 1 - a / (m : ℝ) ∧ a / (m : ℝ) < Y i x} + have hT' : ∀ i, MeasurableSet (T' i) := fun i => + (hT i).inter ((measurableSet_lt (hX i) measurable_const).inter + (measurableSet_lt measurable_const (hY i))) + have hTag' : ∀ i, (μ i).real (T' i) = 1 / (m : ℝ) := by + intro i + have hae : T' i =ᵐ[μ i] T i := by + filter_upwards [hSafe i] with x hx + exact propext ⟨fun h => h.1, fun h => ⟨h, hx h⟩⟩ + exact (measureReal_congr hae).trans (hTag i) + have h := currentBlock_mass_lower_bound m hm μ T' hT' hX hY hC ha hbudget hTag' + (fun i x hx => hx.2) hdomX hdomY + refine h.trans (measureReal_mono ?_) + intro x hx + obtain ⟨⟨i, hi⟩, hgood⟩ := hx + exact ⟨⟨i, hi.1⟩, hgood⟩ + +theorem circle_currentBlock_mass (m : ℕ) (hm : 200 ≤ m) + (μ : Fin m → Measure Ω) [∀ i, IsProbabilityMeasure (μ i)] + (T : Fin m → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + {X Y : Fin m → Ω → ℝ} (hX : ∀ i, Measurable (X i)) (hY : ∀ i, Measurable (Y i)) + (hTag : ∀ i, (μ i).real (T i) = 1 / (m : ℝ)) + (hSafe : ∀ i, ∀ x ∈ T i, X i x < 1 - 3 / (m : ℝ) ∧ 3 / (m : ℝ) < Y i x) + (hdomX : ∀ i, (μ i).map (X i) ≤ (10 : ℝ≥0∞) • volume.restrict (Ico (0 : ℝ) 1)) + (hdomY : ∀ i, (μ i).map (Y i) ≤ (10 : ℝ≥0∞) • volume.restrict (Ico (0 : ℝ) 1)) : + Real.exp (-90) ≤ (Measure.pi μ).real {x | (∃ i, x i ∈ T i) ∧ + ∀ i, X i (x i) < 1 - 3 / (m : ℝ) ∧ 3 / (m : ℝ) < Y i (x i)} := by + have hmR : (200 : ℝ) ≤ m := by exact_mod_cast hm + have hmpos : (0 : ℝ) < m := by linarith + have hbudget : 0 ≤ 1 - (1 + 2 * ((10 : ℝ) * 3)) / (m : ℝ) := by + apply sub_nonneg.mpr + exact (div_le_one hmpos).mpr (by linarith) + have h := currentBlock_mass_lower_bound m (by omega) μ T hT hX hY + (C := 10) (a := 3) (by norm_num) (by norm_num) hbudget hTag hSafe + (by simpa using hdomX) (by simpa using hdomY) + norm_num only [show (1 : ℝ) + 2 * (10 * 3) = 61 by norm_num] at h + exact (circle_tag_bound m hm).trans h + +theorem product_currentBlock_mass (m : ℕ) (hm : 100 ≤ m) + (μ : Fin m → Measure Ω) [∀ i, IsProbabilityMeasure (μ i)] + (T : Fin m → Set Ω) (hT : ∀ i, MeasurableSet (T i)) + {X Y : Fin m → Ω → ℝ} (hX : ∀ i, Measurable (X i)) (hY : ∀ i, Measurable (Y i)) + (hTag : ∀ i, (μ i).real (T i) = 1 / (m : ℝ)) + (hSafe : ∀ i, ∀ x ∈ T i, X i x < 1 - 2 / (m : ℝ) ∧ 2 / (m : ℝ) < Y i x) + (hdomX : ∀ i, (μ i).map (X i) ≤ (10 : ℝ≥0∞) • volume.restrict (Ico (0 : ℝ) 1)) + (hdomY : ∀ i, (μ i).map (Y i) ≤ (10 : ℝ≥0∞) • volume.restrict (Ico (0 : ℝ) 1)) : + Real.exp (-82) ≤ (Measure.pi μ).real {x | (∃ i, x i ∈ T i) ∧ + ∀ i, X i (x i) < 1 - 2 / (m : ℝ) ∧ 2 / (m : ℝ) < Y i (x i)} := by + have hmR : (100 : ℝ) ≤ m := by exact_mod_cast hm + have hmpos : (0 : ℝ) < m := by linarith + have hbudget : 0 ≤ 1 - (1 + 2 * ((10 : ℝ) * 2)) / (m : ℝ) := by + apply sub_nonneg.mpr + exact (div_le_one hmpos).mpr (by linarith) + have h := currentBlock_mass_lower_bound m (by omega) μ T hT hX hY + (C := 10) (a := 2) (by norm_num) (by norm_num) hbudget hTag hSafe + (by simpa using hdomX) (by simpa using hdomY) + norm_num only [show (1 : ℝ) + 2 * (10 * 2) = 41 by norm_num] at h + exact (product_tag_bound m hm).trans h + +end InvariantRotation.TruncationEvent + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/UnboundedMultiplier.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/UnboundedMultiplier.lean new file mode 100644 index 0000000000000000000000000000000000000000..f80d8c53c25e04ea3b41b8be82090ab4e1427cfe --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/UnboundedMultiplier.lean @@ -0,0 +1,269 @@ +import OAI.Analysis.IrrationalRotation.Model.UnboundedMultiplier +import OAI.Analysis.IrrationalRotation.Rotation.WeightedShiftPowers +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Analysis.InnerProductSpace.LinearPMap +import Mathlib.Tactic + +namespace OAI + +noncomputable section +open Filter Topology +open scoped ENNReal +namespace Invariant233.WeightedShift + +@[simp] theorem multiplier_apply (h : ℤ → ℂ) (ξ : multiplierDomain h) (k : ℤ) : + multiplier h ξ k = h k * ξ.val k := rfl + +theorem multiplier_injective {h : ℤ → ℂ} (hh : ∀ k, h k ≠ 0) : + Function.Injective (multiplier h) := by + intro ξ η heq + apply Subtype.ext + ext k + exact mul_left_cancel₀ (hh k) (congrArg (fun v : Hilbert => v k) heq) + +theorem operator_mem_multiplierDomain (h : ℤ → ℂ) (f g : Weight) (c : ℂ) + (hfg : ∀ k : ℤ, h (k + 1) * f k = c * g k * h k) + (ξ : multiplierDomain h) : + operator f ξ.val ∈ multiplierDomain h := by + change Memℓp (fun k => h k * (operator f ξ.val) k) 2 + have heq : (fun k => h k * (operator f ξ.val) k) = + fun k => (c • operator g (multiplier h ξ)) k := by + funext k + have hk := hfg (k - 1) + simp only [sub_add_cancel] at hk + change h k * (f (k - 1) * ξ.val (k - 1)) = + c * (g (k - 1) * (h (k - 1) * ξ.val (k - 1))) + rw [← mul_assoc, hk] + ring + rw [heq] + exact lp.memℓp (c • operator g (multiplier h ξ)) + +theorem multiplier_intertwines (h : ℤ → ℂ) (f g : Weight) (c : ℂ) + (hfg : ∀ k : ℤ, h (k + 1) * f k = c * g k * h k) + (ξ : multiplierDomain h) : + multiplier h ⟨operator f ξ.val, operator_mem_multiplierDomain h f g c hfg ξ⟩ = + c • operator g (multiplier h ξ) := by + ext k + have hk := hfg (k - 1) + simp only [sub_add_cancel] at hk + change h k * (f (k - 1) * ξ.val (k - 1)) = + c * (g (k - 1) * (h (k - 1) * ξ.val (k - 1))) + rw [← mul_assoc, hk] + ring + +theorem exp_coboundary_intertwining {b g gstar : ℤ → ℝ} {d : ℝ} + (hcost : ∀ k, g k = gstar k + d + b (k + 1) - b k) (k : ℤ) : + Real.exp (b (k + 1)) * Real.exp (-g k) = + Real.exp (-d) * Real.exp (-gstar k) * Real.exp (b k) := by + rw [← Real.exp_add, ← Real.exp_add, ← Real.exp_add] + congr 1 + rw [hcost k] + ring + +theorem single_mem_multiplierDomain (h : ℤ → ℂ) (k : ℤ) (z : ℂ) : + lp.single (E := fun _ : ℤ => ℂ) 2 k z ∈ multiplierDomain h := by + change Memℓp (fun j => h j * lp.single (E := fun _ : ℤ => ℂ) 2 k z j) 2 + convert lp.memℓp (lp.single (E := fun _ : ℤ => ℂ) 2 k (h k * z)) using 1 + funext j + by_cases hj : j = k + · subst j; simp + · simp [lp.single_apply, Pi.single_eq_of_ne hj] + +theorem dense_multiplierDomain (h : ℤ → ℂ) : + Dense (multiplierDomain h : Set Hilbert) := by + intro ξ + apply isClosed_closure.mem_of_tendsto (lp.hasSum_single (by norm_num) ξ) + exact Filter.Eventually.of_forall fun s => subset_closure + ((multiplierDomain h).sum_mem fun k _ => single_mem_multiplierDomain h k (ξ k)) + +theorem unboundedMultiplier_single (h : ℤ → ℂ) (k : ℤ) (z : ℂ) : + unboundedMultiplier h ⟨lp.single (E := fun _ : ℤ => ℂ) 2 k z, single_mem_multiplierDomain h k z⟩ = + lp.single (E := fun _ : ℤ => ℂ) 2 k (h k * z) := by + ext j + change h j * lp.single (E := fun _ : ℤ => ℂ) 2 k z j = lp.single (E := fun _ : ℤ => ℂ) 2 k (h k * z) j + by_cases hj : j = k + · subst j; simp + · simp [lp.single_apply, Pi.single_eq_of_ne hj] + +theorem unboundedMultiplier_formalAdjoint (h : ℤ → ℂ) : + (unboundedMultiplier h).IsFormalAdjoint (unboundedMultiplier (fun k => star (h k))) := by + intro ξ η + change inner ℂ (multiplier h ξ) η.val = + inner ℂ ξ.val (multiplier (fun k => star (h k)) η) + rw [lp.inner_eq_tsum, lp.inner_eq_tsum] + apply tsum_congr + intro k + simp only [RCLike.inner_apply', starRingEnd_apply] + change star (h k * ξ.val k) * η.val k = star (ξ.val k) * (star (h k) * η.val k) + rw [star_mul] + ring + +theorem adjoint_unboundedMultiplier_apply (h : ℤ → ℂ) + (ξ : (unboundedMultiplier h).adjoint.domain) (k : ℤ) : + (unboundedMultiplier h).adjoint ξ k = star (h k) * ξ.val k := by + have hformal := (LinearPMap.adjoint_isFormalAdjoint (T := unboundedMultiplier h) (dense_multiplierDomain h)).symm + have heq := hformal + ⟨lp.single (E := fun _ : ℤ => ℂ) 2 k 1, single_mem_multiplierDomain h k 1⟩ ξ + rw [unboundedMultiplier_single, lp.inner_single_left, lp.inner_single_left] at heq + simpa only [mul_one, RCLike.inner_apply', map_one, one_mul, starRingEnd_apply] using heq.symm + +theorem adjoint_unboundedMultiplier (h : ℤ → ℂ) : + (unboundedMultiplier h).adjoint = unboundedMultiplier (fun k => star (h k)) := by + apply le_antisymm + · constructor + · intro ξ hξ + change Memℓp (fun k => star (h k) * ξ k) 2 + have heq : (fun k => star (h k) * ξ k) = + fun k => (unboundedMultiplier h).adjoint ⟨ξ, hξ⟩ k := by + funext k + exact (adjoint_unboundedMultiplier_apply h ⟨ξ, hξ⟩ k).symm + rw [heq] + exact lp.memℓp ((unboundedMultiplier h).adjoint ⟨ξ, hξ⟩) + · intro ξ η hξη + ext k + rw [adjoint_unboundedMultiplier_apply] + change star (h k) * ξ.val k = star (h k) * η.val k + rw [hξη] + · exact LinearPMap.IsFormalAdjoint.le_adjoint (dense_multiplierDomain h) + (unboundedMultiplier_formalAdjoint h) + +theorem isSelfAdjoint_unboundedMultiplier_real (h : ℤ → ℝ) : + IsSelfAdjoint (unboundedMultiplier (fun k => (h k : ℂ))) := by + rw [LinearPMap.isSelfAdjoint_def, adjoint_unboundedMultiplier] + congr 1 + funext k + simp + +theorem isClosed_unboundedMultiplier_real (h : ℤ → ℝ) : + (unboundedMultiplier (fun k => (h k : ℂ))).IsClosed := + (isSelfAdjoint_unboundedMultiplier_real h).isClosed + +theorem unboundedMultiplier_nonnegative (h : ℤ → ℝ) (hh : ∀ k, 0 ≤ h k) + (ξ : multiplierDomain (fun k => (h k : ℂ))) : + 0 ≤ (inner ℂ ξ.val (multiplier (fun k => (h k : ℂ)) ξ)).re := by + rw [lp.inner_eq_tsum, Complex.re_tsum (lp.summable_inner _ _)] + apply tsum_nonneg + intro k + change 0 ≤ (inner ℂ (ξ.val k) ((h k : ℂ) • ξ.val k)).re + rw [inner_smul_right] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] + exact mul_nonneg (hh k) (inner_self_nonneg (𝕜 := ℂ) (x := ξ.val k)) + +theorem exponential_multiplier_injective (b : ℤ → ℝ) : + Function.Injective (multiplier (fun k => (Real.exp (b k) : ℂ))) := by + apply multiplier_injective + intro k + exact_mod_cast Real.exp_ne_zero (b k) + +theorem multiplier_mem_inverseDomain (h : ℤ → ℂ) (hh : ∀ k, h k ≠ 0) + (ξ : multiplierDomain h) : + multiplier h ξ ∈ multiplierDomain (fun k => (h k)⁻¹) := by + change Memℓp (fun k => (h k)⁻¹ * (h k * ξ.val k)) 2 + simpa only [← mul_assoc, inv_mul_cancel₀ (hh _), one_mul] using lp.memℓp ξ.val + +theorem inverse_multiplier_mul (h : ℤ → ℂ) (hh : ∀ k, h k ≠ 0) + (ξ : multiplierDomain h) : + multiplier (fun k => (h k)⁻¹) + ⟨multiplier h ξ, multiplier_mem_inverseDomain h hh ξ⟩ = ξ.val := by + ext k + change (h k)⁻¹ * (h k * ξ.val k) = ξ.val k + rw [← mul_assoc, inv_mul_cancel₀ (hh k), one_mul] + +theorem inverseMultiplier_mem_domain (h : ℤ → ℂ) (hh : ∀ k, h k ≠ 0) + (ξ : multiplierDomain (fun k => (h k)⁻¹)) : + multiplier (fun k => (h k)⁻¹) ξ ∈ multiplierDomain h := by + change Memℓp (fun k => h k * ((h k)⁻¹ * ξ.val k)) 2 + simpa only [← mul_assoc, mul_inv_cancel₀ (hh _), one_mul] using lp.memℓp ξ.val + +theorem multiplier_mul_inverse (h : ℤ → ℂ) (hh : ∀ k, h k ≠ 0) + (ξ : multiplierDomain (fun k => (h k)⁻¹)) : + multiplier h + ⟨multiplier (fun k => (h k)⁻¹) ξ, inverseMultiplier_mem_domain h hh ξ⟩ = ξ.val := by + ext k + change h k * ((h k)⁻¹ * ξ.val k) = ξ.val k + rw [← mul_assoc, mul_inv_cancel₀ (hh k), one_mul] + +theorem multiplier_range (h : ℤ → ℂ) (hh : ∀ k, h k ≠ 0) : + LinearMap.range (multiplier h) = multiplierDomain (fun k => (h k)⁻¹) := by + ext ξ + constructor + · rintro ⟨η, rfl⟩ + exact multiplier_mem_inverseDomain h hh η + · intro hξ + exact ⟨⟨multiplier (fun k => (h k)⁻¹) ⟨ξ, hξ⟩, + inverseMultiplier_mem_domain h hh ⟨ξ, hξ⟩⟩, + multiplier_mul_inverse h hh ⟨ξ, hξ⟩⟩ + +theorem multiplier_denseRange (h : ℤ → ℂ) (hh : ∀ k, h k ≠ 0) : + DenseRange (multiplier h) := by + change Dense (LinearMap.range (multiplier h) : Set Hilbert) + rw [multiplier_range h hh] + exact dense_multiplierDomain _ + +theorem unboundedMultiplier_real_formalAdjoint (h : ℤ → ℝ) : + (unboundedMultiplier (fun k => (h k : ℂ))).IsFormalAdjoint + (unboundedMultiplier (fun k => (h k : ℂ))) := by + simpa using unboundedMultiplier_formalAdjoint (fun k => (h k : ℂ)) + +theorem inverse_multiplier_inner (h : ℤ → ℝ) (hh : ∀ k, h k ≠ 0) + (η : multiplierDomain (fun k => (h k : ℂ)⁻¹)) + (ζ : multiplierDomain (fun k => (h k : ℂ))) : + inner ℂ (multiplier (fun k => (h k : ℂ)⁻¹) η) + (multiplier (fun k => (h k : ℂ)) ζ) = inner ℂ η.val ζ.val := by + have hh' : ∀ k, (h k : ℂ) ≠ 0 := fun k => Complex.ofReal_ne_zero.mpr (hh k) + have heq := unboundedMultiplier_real_formalAdjoint h + ⟨multiplier (fun k => (h k : ℂ)⁻¹) η, + inverseMultiplier_mem_domain (fun k => (h k : ℂ)) hh' η⟩ ζ + change inner ℂ + (multiplier (fun k => (h k : ℂ)) + ⟨multiplier (fun k => (h k : ℂ)⁻¹) η, + inverseMultiplier_mem_domain (fun k => (h k : ℂ)) hh' η⟩) + ζ.val = _ at heq + rw [multiplier_mul_inverse _ hh'] at heq + exact heq.symm + +@[simp] theorem exponentialWeight_apply (g : ℤ → ℝ) (hg : ∀ k, 0 ≤ g k) (k : ℤ) : + exponentialWeight g hg k = (Real.exp (-g k) : ℂ) := rfl + +theorem operator_exponentialWeight_ne_zero (g : ℤ → ℝ) (hg : ∀ k, 0 ≤ g k) : + operator (exponentialWeight g hg) ≠ 0 := by + intro hzero + have hw := (operator_eq_zero_iff (exponentialWeight g hg)).mp hzero + have h := congrArg (fun w : Weight => w 0) hw + simp only [exponentialWeight_apply, lp.coeFn_zero, Pi.zero_apply, + Complex.ofReal_eq_zero, Real.exp_ne_zero] at h + +theorem exponentialWeight_coboundary (b g gstar : ℤ → ℝ) (d : ℝ) + (hg : ∀ k, 0 ≤ g k) (hgs : ∀ k, 0 ≤ gstar k) + (hcost : ∀ k, g k = gstar k + d + b (k + 1) - b k) (k : ℤ) : + (Real.exp (b (k + 1)) : ℂ) * exponentialWeight g hg k = + (Real.exp (-d) : ℂ) * exponentialWeight gstar hgs k * (Real.exp (b k) : ℂ) := by + simp only [exponentialWeight_apply] + exact_mod_cast exp_coboundary_intertwining hcost k + +theorem exponential_coboundary_domain (b g gstar : ℤ → ℝ) (d : ℝ) + (hg : ∀ k, 0 ≤ g k) (hgs : ∀ k, 0 ≤ gstar k) + (hcost : ∀ k, g k = gstar k + d + b (k + 1) - b k) + (ξ : multiplierDomain (fun k => (Real.exp (b k) : ℂ))) : + operator (exponentialWeight g hg) ξ.val ∈ + multiplierDomain (fun k => (Real.exp (b k) : ℂ)) := + operator_mem_multiplierDomain _ _ _ _ + (exponentialWeight_coboundary b g gstar d hg hgs hcost) ξ + +theorem exponential_coboundary_intertwines (b g gstar : ℤ → ℝ) (d : ℝ) + (hg : ∀ k, 0 ≤ g k) (hgs : ∀ k, 0 ≤ gstar k) + (hcost : ∀ k, g k = gstar k + d + b (k + 1) - b k) + (ξ : multiplierDomain (fun k => (Real.exp (b k) : ℂ))) : + multiplier (fun k => (Real.exp (b k) : ℂ)) + ⟨operator (exponentialWeight g hg) ξ.val, + exponential_coboundary_domain b g gstar d hg hgs hcost ξ⟩ = + (Real.exp (-d) : ℂ) • operator (exponentialWeight gstar hgs) + (multiplier (fun k => (Real.exp (b k) : ℂ)) ξ) := + multiplier_intertwines _ _ _ _ + (exponentialWeight_coboundary b g gstar d hg hgs hcost) ξ + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformAbsoluteContinuity.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformAbsoluteContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..beefa736c02a81c93e31153b2cc505881af42319 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformAbsoluteContinuity.lean @@ -0,0 +1,34 @@ +import OAI.Analysis.IrrationalRotation.Model.CompactTransfer + +namespace OAI + +open MeasureTheory +open scoped ENNReal NNReal + +namespace Invariant233.UniformlyAbsolutelyContinuous + +variable {X ι : Type*} [MeasurableSpace X] + +theorem absolutelyContinuous {μ : Measure X} {ν : ι → Measure X} + (h : UniformlyAbsolutelyContinuous μ ν) (i : ι) : ν i ≪ μ := by + apply Measure.AbsolutelyContinuous.mk + intro s hs hzero + apply le_antisymm ?_ bot_le + apply ENNReal.le_of_forall_pos_le_add + intro ε hε _ + obtain ⟨δ, hδ, hbound⟩ := h ε hε + have hsmall : μ s < (δ : ℝ≥0∞) := by + rw [hzero] + exact_mod_cast hδ + simpa only [bot_eq_zero, zero_add] using (hbound s hs hsmall i).le + +theorem of_le {μ : Measure X} {ν ρ : ι → Measure X} + (h : UniformlyAbsolutelyContinuous μ ν) (hle : ∀ i, ρ i ≤ ν i) : + UniformlyAbsolutelyContinuous μ ρ := by + intro ε hε + obtain ⟨δ, hδ, hb⟩ := h ε hε + exact ⟨δ, hδ, fun s hs hsmall i => (hle i s).trans_lt (hb s hs hsmall i)⟩ + +end Invariant233.UniformlyAbsolutelyContinuous + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformAbsoluteContinuityLimits.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformAbsoluteContinuityLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..004e62f8ede5962d95d495cd54ae06b684a2ef23 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformAbsoluteContinuityLimits.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.IrrationalRotation.Model.CompactTransfer +import Mathlib.MeasureTheory.Measure.Map +import Mathlib.Topology.Instances.ENNReal.Lemmas + +namespace OAI + +open MeasureTheory Filter Set +open scoped Topology NNReal ENNReal + +namespace Invariant233.UniformlyAbsolutelyContinuous + +variable {X ι : Type*} [MeasurableSpace X] + +theorem mono {μ : Measure X} {ν η : ι → Measure X} + (hν : UniformlyAbsolutelyContinuous μ ν) (hην : ∀ i, η i ≤ ν i) : + UniformlyAbsolutelyContinuous μ η := by + intro ε hε + obtain ⟨δ, hδ, hsmall⟩ := hν ε hε + exact ⟨δ, hδ, fun A hA hμ i => (hην i A).trans_lt (hsmall A hA hμ i)⟩ + +theorem restrict {μ : Measure X} {ν : ι → Measure X} + (hν : UniformlyAbsolutelyContinuous μ ν) (s : ι → Set X) : + UniformlyAbsolutelyContinuous μ (fun i => (ν i).restrict (s i)) := + hν.mono (fun _ => Measure.restrict_le_self) + +theorem map_restrict {Z : Type*} [MeasurableSpace Z] + {μ : Measure X} {ν : ι → Measure Z} (f : Z → X) (hf : Measurable f) + (hν : UniformlyAbsolutelyContinuous μ (fun i => (ν i).map f)) + (s : ι → Set Z) : + UniformlyAbsolutelyContinuous μ (fun i => ((ν i).restrict (s i)).map f) := + hν.mono (fun _ => Measure.map_mono Measure.restrict_le_self hf) + +theorem tendsto_apply_of_base_tendsto_zero + {μ : Measure X} {ν : ι → Measure X} + (hν : UniformlyAbsolutelyContinuous μ ν) + {L : Filter ι} (s : ι → Set X) (hs : ∀ i, MeasurableSet (s i)) + (hbase : Tendsto (fun i => μ (s i)) L (𝓝 0)) : + Tendsto (fun i => ν i (s i)) L (𝓝 0) := by + rw [ENNReal.tendsto_nhds_zero] + intro ε hε + obtain ⟨η, hη, hηε⟩ := ENNReal.lt_iff_exists_nnreal_btwn.mp hε + obtain ⟨δ, hδ, hsmall⟩ := hν η (ENNReal.coe_pos.mp hη) + have hδ' : (0 : ℝ≥0∞) < δ := ENNReal.coe_pos.mpr hδ + filter_upwards [hbase.eventually_lt_const hδ'] with i hi + exact (hsmall (s i) (hs i) hi i).le.trans hηε.le + +theorem tendsto_real_apply_of_base_tendsto_zero + {μ : Measure X} {ν : ι → Measure X} + (hν : UniformlyAbsolutelyContinuous μ ν) + {L : Filter ι} (s : ι → Set X) (hs : ∀ i, MeasurableSet (s i)) + (hbase : Tendsto (fun i => μ (s i)) L (𝓝 0)) : + Tendsto (fun i => (ν i).real (s i)) L (𝓝 0) := by + simpa only [Measure.real, ENNReal.toReal_zero, Function.comp_def] using + (ENNReal.tendsto_toReal ENNReal.zero_ne_top).comp + (hν.tendsto_apply_of_base_tendsto_zero s hs hbase) + +theorem tendsto_real_apply_of_base_real_tendsto_zero + {μ : Measure X} [IsFiniteMeasure μ] {ν : ι → Measure X} + (hν : UniformlyAbsolutelyContinuous μ ν) + {L : Filter ι} (s : ι → Set X) (hs : ∀ i, MeasurableSet (s i)) + (hbase : Tendsto (fun i => μ.real (s i)) L (𝓝 0)) : + Tendsto (fun i => (ν i).real (s i)) L (𝓝 0) := by + apply hν.tendsto_real_apply_of_base_tendsto_zero s hs + have h := ENNReal.continuous_ofReal.continuousAt.tendsto.comp hbase + simpa only [Function.comp_def, Measure.real, ENNReal.ofReal_toReal (measure_ne_top μ _), + ENNReal.ofReal_zero] using h + +end Invariant233.UniformlyAbsolutelyContinuous + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformIntervalFourier.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformIntervalFourier.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9fceac4524830e3785456d6c22ffc23454de5c7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformIntervalFourier.lean @@ -0,0 +1,204 @@ +import Mathlib + +namespace OAI + +open MeasureTheory + +namespace Invariant233.UniformIntervalFourier + +theorem norm_integral_exp_mul_I_le {ξ : ℝ} (hξ : ξ ≠ 0) (a b : ℝ) : + ‖∫ t in a..b, Complex.exp (((ξ * t : ℝ) : ℂ) * Complex.I)‖ ≤ 2 / |ξ| := by + have hc : (ξ : ℂ) * Complex.I ≠ 0 := + mul_ne_zero (by exact_mod_cast hξ) Complex.I_ne_zero + have heq : (fun t : ℝ => Complex.exp (((ξ * t : ℝ) : ℂ) * Complex.I)) = + (fun t : ℝ => Complex.exp (((ξ : ℂ) * Complex.I) * t)) := by + funext t + congr 1 + push_cast + ring + have hn (t : ℝ) : ‖Complex.exp (((ξ : ℂ) * Complex.I) * t)‖ = 1 := by + simp [Complex.norm_exp, Complex.mul_re, Complex.mul_im] + rw [heq, integral_exp_mul_complex hc, norm_div] + have hnum : ‖Complex.exp (((ξ : ℂ) * Complex.I) * b) - + Complex.exp (((ξ : ℂ) * Complex.I) * a)‖ ≤ 2 := by + simpa only [hn, one_add_one_eq_two] using norm_sub_le + (Complex.exp (((ξ : ℂ) * Complex.I) * b)) + (Complex.exp (((ξ : ℂ) * Complex.I) * a)) + simpa only [norm_mul, Complex.norm_real, Complex.norm_I, mul_one, Real.norm_eq_abs] using + div_le_div_of_nonneg_right hnum (norm_nonneg ((ξ : ℂ) * Complex.I)) + +theorem norm_normalized_integral_exp_mul_I_le {ξ a b : ℝ} + (hξ : ξ ≠ 0) (hab : a < b) : + ‖(b - a)⁻¹ • (∫ t in a..b, Complex.exp (((ξ * t : ℝ) : ℂ) * Complex.I))‖ ≤ + 2 / (|ξ| * (b - a)) := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr (sub_pos.mpr hab))] + calc + (b - a)⁻¹ * ‖∫ t in a..b, Complex.exp (((ξ * t : ℝ) : ℂ) * Complex.I)‖ ≤ + (b - a)⁻¹ * (2 / |ξ|) := + mul_le_mul_of_nonneg_left (norm_integral_exp_mul_I_le hξ a b) + (inv_nonneg.mpr (sub_nonneg.mpr hab.le)) + _ = 2 / (|ξ| * (b - a)) := by + simp only [div_eq_mul_inv, mul_inv_rev] + ring + +theorem norm_normalized_circle_character_le {ξ a b : ℝ} + (hξ : ξ ≠ 0) (hab : a < b) : + ‖(b - a)⁻¹ • (∫ t in a..b, + Complex.exp ((((2 * Real.pi * ξ) * t : ℝ) : ℂ) * Complex.I))‖ ≤ + 1 / (Real.pi * |ξ| * (b - a)) := by + have hfreq : 2 * Real.pi * ξ ≠ 0 := mul_ne_zero (by positivity) hξ + have h := norm_normalized_integral_exp_mul_I_le hfreq hab + have ha : |2 * Real.pi * ξ| = 2 * Real.pi * |ξ| := by + rw [abs_mul, abs_of_pos (by positivity : 0 < 2 * Real.pi)] + rw [ha] at h + convert h using 1 + simp only [div_eq_mul_inv, mul_inv_rev] + ring + +theorem integral_uniform_interval_eq {a b : ℝ} (hab : a ≤ b) (f : ℝ → ℂ) : + (∫ t, f t ∂ProbabilityTheory.cond volume (Set.Icc a b)) = + (b - a)⁻¹ • (∫ t in a..b, f t) := by + rw [ProbabilityTheory.cond, integral_smul_measure, Real.volume_Icc, + ENNReal.toReal_inv, ENNReal.toReal_ofReal (sub_nonneg.mpr hab), + integral_Icc_eq_integral_Ioc, intervalIntegral.integral_of_le hab] + +theorem norm_uniform_interval_circle_character_le {ξ a b : ℝ} + (hξ : ξ ≠ 0) (hab : a < b) : + ‖∫ t, Complex.exp ((((2 * Real.pi * ξ) * t : ℝ) : ℂ) * Complex.I) + ∂ProbabilityTheory.cond volume (Set.Icc a b)‖ ≤ + 1 / (Real.pi * |ξ| * (b - a)) := by + rw [integral_uniform_interval_eq hab.le] + exact norm_normalized_circle_character_le hξ hab + +theorem norm_sampling_interval_character_le {ξ N₀ : ℝ} + (hξ : ξ ≠ 0) (hN₀ : 0 < N₀) : + ‖∫ t, Complex.exp ((((2 * Real.pi * ξ) * t : ℝ) : ℂ) * Complex.I) + ∂ProbabilityTheory.cond volume (Set.Icc (1 / N₀) (2 / N₀))‖ ≤ + N₀ / (Real.pi * |ξ|) := by + have hab : 1 / N₀ < 2 / N₀ := (div_lt_div_iff_of_pos_right hN₀).2 (by norm_num) + have h := norm_uniform_interval_circle_character_le hξ hab + have hlen : 2 / N₀ - 1 / N₀ = 1 / N₀ := by ring + rw [hlen] at h + convert h using 1 + simp only [div_eq_mul_inv, mul_inv_rev, inv_inv, one_mul] + +theorem norm_sampling_interval_character_le_of_separation {ξ N₀ N m : ℝ} + (hN₀ : 0 < N₀) (hN : N₀ ≤ N) (hm : 0 < m) + (hsep : N * m ^ 1000 < |ξ|) : + ‖∫ t, Complex.exp ((((2 * Real.pi * ξ) * t : ℝ) : ℂ) * Complex.I) + ∂ProbabilityTheory.cond volume (Set.Icc (1 / N₀) (2 / N₀))‖ ≤ + 1 / (Real.pi * m ^ 1000) := by + have hNpos : 0 < N := lt_of_lt_of_le hN₀ hN + have hξpos : 0 < |ξ| := lt_trans (mul_pos hNpos (pow_pos hm _)) hsep + have hξ : ξ ≠ 0 := abs_pos.mp hξpos + calc + _ ≤ N₀ / (Real.pi * |ξ|) := norm_sampling_interval_character_le hξ hN₀ + _ ≤ N / (Real.pi * |ξ|) := + div_le_div_of_nonneg_right hN (mul_nonneg Real.pi_pos.le (abs_nonneg _)) + _ ≤ 1 / (Real.pi * m ^ 1000) := by + apply (div_le_div_iff₀ (mul_pos Real.pi_pos hξpos) + (mul_pos Real.pi_pos (pow_pos hm _))).2 + have hh := mul_le_mul_of_nonneg_left hsep.le Real.pi_pos.le + nlinarith only [hh] + +theorem integrable_circle_character (μ : Measure ℝ) [IsFiniteMeasure μ] (ξ : ℝ) : + Integrable (fun t : ℝ => + Complex.exp ((((2 * Real.pi * ξ) * t : ℝ) : ℂ) * Complex.I)) μ := by + apply Integrable.of_bound (by fun_prop) 1 + exact Filter.Eventually.of_forall (fun t => (Complex.norm_exp_ofReal_mul_I _).le) + +theorem norm_uniform_interval_fourier_sum_sub_zero_le + {ι : Type*} (s : Finset ι) (c : ι → ℂ) (ξ : ι → ℝ) + {a b R : ℝ} (hab : a < b) (hR : 0 < R) + (hsep : ∀ i ∈ s, ξ i ≠ 0 → R ≤ |ξ i|) : + ‖(∫ t, ∑ i ∈ s, c i * + Complex.exp ((((2 * Real.pi * ξ i) * t : ℝ) : ℂ) * Complex.I) + ∂ProbabilityTheory.cond volume (Set.Icc a b)) - + ∑ i ∈ s, (if ξ i = 0 then c i else 0)‖ ≤ + (∑ i ∈ s, ‖c i‖) / (Real.pi * R * (b - a)) := by + classical + let μ : Measure ℝ := ProbabilityTheory.cond volume (Set.Icc a b) + let : IsProbabilityMeasure μ := ProbabilityTheory.cond_isProbabilityMeasure_of_finite + (by rw [Real.volume_Icc]; exact (ENNReal.ofReal_pos.mpr (sub_pos.mpr hab)).ne') + (by rw [Real.volume_Icc]; exact ENNReal.ofReal_ne_top) + have hden : 0 < Real.pi * R * (b - a) := + mul_pos (mul_pos Real.pi_pos hR) (sub_pos.mpr hab) + rw [integral_finsetSum s (fun i _ => (integrable_circle_character μ (ξ i)).const_mul (c i)), + ← Finset.sum_sub_distrib] + calc + _ ≤ ∑ i ∈ s, ‖(∫ t, c i * + Complex.exp ((((2 * Real.pi * ξ i) * t : ℝ) : ℂ) * Complex.I) ∂μ) - + (if ξ i = 0 then c i else 0)‖ := norm_sum_le _ _ + _ ≤ ∑ i ∈ s, ‖c i‖ / (Real.pi * R * (b - a)) := by + apply Finset.sum_le_sum + intro i hi + by_cases hξ : ξ i = 0 + · simpa [hξ] using div_nonneg (norm_nonneg (c i)) hden.le + · rw [ite_eq_right hξ, sub_zero, integral_const_mul, norm_mul] + have ht := norm_uniform_interval_circle_character_le hξ hab + have hs : 1 / (Real.pi * |ξ i| * (b - a)) ≤ + 1 / (Real.pi * R * (b - a)) := by + apply one_div_le_one_div_of_le hden + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left (hsep i hi hξ) Real.pi_pos.le) (sub_pos.mpr hab).le + calc + _ ≤ ‖c i‖ * (1 / (Real.pi * R * (b - a))) := + mul_le_mul_of_nonneg_left (ht.trans hs) (norm_nonneg _) + _ = _ := by ring + _ = (∑ i ∈ s, ‖c i‖) / (Real.pi * R * (b - a)) := (Finset.sum_div ..).symm + +theorem norm_uniform_interval_fourier_sum_sub_zero_le_card + {ι : Type*} (s : Finset ι) (c : ι → ℂ) (ξ : ι → ℝ) + {a b R C : ℝ} (hab : a < b) (hR : 0 < R) + (hsep : ∀ i ∈ s, ξ i ≠ 0 → R ≤ |ξ i|) (hc : ∀ i ∈ s, ‖c i‖ ≤ C) : + ‖(∫ t, ∑ i ∈ s, c i * + Complex.exp ((((2 * Real.pi * ξ i) * t : ℝ) : ℂ) * Complex.I) + ∂ProbabilityTheory.cond volume (Set.Icc a b)) - + ∑ i ∈ s, (if ξ i = 0 then c i else 0)‖ ≤ + (s.card : ℝ) * C / (Real.pi * R * (b - a)) := by + apply (norm_uniform_interval_fourier_sum_sub_zero_le s c ξ hab hR hsep).trans + apply div_le_div_of_nonneg_right _ (by positivity) + simpa using Finset.sum_le_sum hc + +theorem norm_uniform_interval_two_frequency_sum_le + (s t : Finset ℤ) (hs : 0 ∈ s) (ht : 0 ∈ t) (c d : ℤ → ℂ) + {n n' a b R : ℝ} (hab : a < b) (hR : 0 < R) + (hsep : ∀ i ∈ s, ∀ j ∈ t, (i, j) ≠ (0, 0) → + R ≤ |(i : ℝ) * n + (j : ℝ) * n'|) + (hc : ∀ i ∈ s, ‖c i‖ ≤ 1) (hd : ∀ j ∈ t, ‖d j‖ ≤ 1) : + ‖(∫ u, ∑ i ∈ s, ∑ j ∈ t, (c i * d j) * + Complex.exp ((((2 * Real.pi * ((i : ℝ) * n + (j : ℝ) * n')) * u : ℝ) : ℂ) * + Complex.I) ∂ProbabilityTheory.cond volume (Set.Icc a b)) - c 0 * d 0‖ ≤ + ((s.card : ℝ) * (t.card : ℝ)) / (Real.pi * R * (b - a)) := by + classical + let ξ : ℤ × ℤ → ℝ := fun p => (p.1 : ℝ) * n + (p.2 : ℝ) * n' + let e : ℤ × ℤ → ℂ := fun p => c p.1 * d p.2 + have hsep' (p : ℤ × ℤ) (hp : p ∈ s ×ˢ t) (_hpξ : ξ p ≠ 0) : R ≤ |ξ p| := by + apply hsep p.1 (Finset.mem_product.mp hp).1 p.2 (Finset.mem_product.mp hp).2 + intro hp0 + apply _hpξ + have hp0' : p = (0, 0) := hp0 + simp [ξ, hp0'] + have he (p : ℤ × ℤ) (hp : p ∈ s ×ˢ t) : ‖e p‖ ≤ 1 := by + dsimp [e] + rw [norm_mul] + have h1 := hc p.1 (Finset.mem_product.mp hp).1 + have h2 := hd p.2 (Finset.mem_product.mp hp).2 + nlinarith [norm_nonneg (c p.1), norm_nonneg (d p.2)] + have hzero : (∑ p ∈ s ×ˢ t, (if ξ p = 0 then e p else 0)) = c 0 * d 0 := by + rw [Finset.sum_eq_single (0, 0)] + · simp [ξ, e] + · intro p hp hp0 + have hpos : 0 < |ξ p| := hR.trans_le + (hsep p.1 (Finset.mem_product.mp hp).1 p.2 (Finset.mem_product.mp hp).2 hp0) + rw [ite_eq_right (abs_pos.mp hpos)] + · intro hnot + exact (hnot (Finset.mem_product.mpr ⟨hs, ht⟩)).elim + have h := norm_uniform_interval_fourier_sum_sub_zero_le_card + (s ×ˢ t) e ξ hab hR hsep' he + rw [hzero] at h + simpa only [Finset.sum_product, e, ξ, Finset.card_product, Nat.cast_mul, mul_one] using h + +end Invariant233.UniformIntervalFourier + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformQuantization.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformQuantization.lean new file mode 100644 index 0000000000000000000000000000000000000000..c13801decd7efa89e63239fea9dac989805b0020 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/UniformQuantization.lean @@ -0,0 +1,82 @@ +import OAI.Analysis.IrrationalRotation.Model.UniformQuantization +import Mathlib.Probability.Distributions.Uniform +import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +import Mathlib.MeasureTheory.Function.Floor +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped ENNReal + +namespace Invariant233.UniformQuantization + +theorem measurable_quantize (q : ℕ) [NeZero q] : Measurable (quantize q) := by + exact (measurable_of_countable (fun n : ℕ => + (⟨n % q, Nat.mod_lt _ (Nat.pos_of_ne_zero (NeZero.ne q))⟩ : Fin q))).comp + ((measurable_const.mul measurable_id).nat_floor) + +theorem quantize_eq_iff {q : ℕ} [NeZero q] (a : Fin q) {x : ℝ} + (hx : x ∈ Ico (0 : ℝ) 1) : + quantize q x = a ↔ x ∈ Ico ((a : ℝ) / q) (((a : ℝ) + 1) / q) := by + have hq : (0 : ℝ) < q := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) + have hnonneg : 0 ≤ (q : ℝ) * x := mul_nonneg hq.le hx.1 + have hfloor : ⌊(q : ℝ) * x⌋₊ < q := (Nat.floor_lt hnonneg).mpr (by nlinarith [hx.2]) + change (⟨⌊(q : ℝ) * x⌋₊ % q, _⟩ : Fin q) = a ↔ _ + rw [Fin.ext_iff] + change (⌊(q : ℝ) * x⌋₊ % q = a.val) ↔ _ + rw [Nat.mod_eq_of_lt hfloor, Nat.floor_eq_iff hnonneg] + simp only [mem_Ico] + constructor + · intro h + exact ⟨(div_le_iff₀ hq).mpr (by nlinarith [h.1]), + (lt_div_iff₀ hq).mpr (by nlinarith [h.2])⟩ + · intro h + constructor + · have := (div_le_iff₀ hq).mp h.1 + nlinarith + · have := (lt_div_iff₀ hq).mp h.2 + nlinarith + +theorem preimage_singleton_inter_unit {q : ℕ} [NeZero q] (a : Fin q) : + (quantize q ⁻¹' {a}) ∩ Ico (0 : ℝ) 1 = + Ico ((a : ℝ) / q) (((a : ℝ) + 1) / q) := by + have hq : (0 : ℝ) < q := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) + ext x + constructor + · rintro ⟨hxa, hx⟩ + exact (quantize_eq_iff a hx).mp hxa + · intro hx + have hunit : x ∈ Ico (0 : ℝ) 1 := by + constructor + · exact (div_nonneg (by positivity) hq.le).trans hx.1 + · have ha : (a : ℝ) + 1 ≤ q := by exact_mod_cast Nat.succ_le_of_lt a.isLt + have hbound : ((a : ℝ) + 1) / q ≤ 1 := (div_le_iff₀ hq).mpr (by linarith) + exact hx.2.trans_le hbound + exact ⟨(quantize_eq_iff a hunit).mpr hx, hunit⟩ + +theorem map_quantize_singleton (q : ℕ) [NeZero q] (a : Fin q) : + (volume.restrict (Ico (0 : ℝ) 1)).map (quantize q) {a} = (q : ℝ≥0∞)⁻¹ := by + rw [Measure.map_apply (measurable_quantize q) (measurableSet_singleton a), + Measure.restrict_apply ((measurable_quantize q) (measurableSet_singleton a)), + preimage_singleton_inter_unit, Real.volume_Ico] + have hq : (0 : ℝ) < q := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) + have heq : ((a : ℝ) + 1) / q - (a : ℝ) / q = 1 / q := by ring + rw [heq, ENNReal.ofReal_div_of_pos hq] + simp + +theorem map_quantize_uniform (q : ℕ) [NeZero q] : + (volume.restrict (Ico (0 : ℝ) 1)).map (quantize q) = + (PMF.uniformOfFintype (Fin q)).toMeasure := by + apply Measure.ext_of_singleton + intro a + rw [map_quantize_singleton] + simp + +end Invariant233.UniformQuantization + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/UnitaryTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/UnitaryTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2aeb03d13efeb6aebc514d1ab30990c97213db3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/UnitaryTransport.lean @@ -0,0 +1,146 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Analysis.InnerProductSpace.Adjoint +import Mathlib.Basic.Denumerable +import Mathlib.Topology.Bases +import Mathlib.Analysis.SpecialFunctions.Pow.Real + +namespace OAI + +noncomputable section + +namespace Invariant233.UnitaryTransport + +open scoped Topology +open TopologicalSpace + +variable {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [NormedAddCommGroup F] [InnerProductSpace ℂ F] + +theorem countable_orthonormal_index [SeparableSpace E] {ι : Type*} + {v : ι → E} (hv : Orthonormal ℂ v) : Countable ι := by + have hd : Pairwise (fun i j : ι => + Disjoint (Metric.ball (v i) (1 / 2 : ℝ)) (Metric.ball (v j) (1 / 2 : ℝ))) := by + intro i j hij + apply Metric.ball_disjoint_ball + have hs : ‖v i - v j‖ ^ 2 = 2 := by + rw [norm_sub_sq (𝕜 := ℂ), hv.norm_eq_one i, hv.norm_eq_one j, hv.inner_eq_zero hij] + norm_num + rw [dist_eq_norm] + have hn := norm_nonneg (v i - v j) + nlinarith + exact hd.countable_of_isOpen_disjoint (fun _ => Metric.isOpen_ball) + (fun i => ⟨v i, by simp⟩) + +theorem infinite_hilbertBasis_index [CompleteSpace E] {ι : Type*} + (b : HilbertBasis ι ℂ E) (hE : ¬ FiniteDimensional ℂ E) : Infinite ι := by + classical + by_contra h + let : Finite ι := not_infinite_iff_finite.mp h + let : Fintype ι := Fintype.ofFinite ι + exact hE b.toOrthonormalBasis.toBasis.finiteDimensional_of_finite + +theorem exists_nat_hilbertBasis [CompleteSpace E] [SeparableSpace E] + (hE : ¬ FiniteDimensional ℂ E) : Nonempty (HilbertBasis ℕ ℂ E) := by + classical + obtain ⟨w, b, _⟩ := exists_hilbertBasis ℂ E + let : Countable w := countable_orthonormal_index b.orthonormal + let : Infinite w := infinite_hilbertBasis_index b hE + let e : ℕ ≃ w := Classical.choice inferInstance + have hv : Orthonormal ℂ (fun n : ℕ => b (e n)) := + b.orthonormal.comp e e.injective + refine ⟨HilbertBasis.mk hv ?_⟩ + have hr : Set.range (fun n : ℕ => b (e n)) = Set.range b := by + ext x + constructor + · rintro ⟨n, rfl⟩ + exact ⟨e n, rfl⟩ + · rintro ⟨i, rfl⟩ + exact ⟨e.symm i, by simp⟩ + rw [hr, b.dense_span] + +theorem nonempty_linearIsometryEquiv [CompleteSpace E] [CompleteSpace F] + [SeparableSpace E] [SeparableSpace F] + (hE : ¬ FiniteDimensional ℂ E) (hF : ¬ FiniteDimensional ℂ F) : + Nonempty (E ≃ₗᵢ[ℂ] F) := by + obtain ⟨bE⟩ := exists_nat_hilbertBasis hE + obtain ⟨bF⟩ := exists_nat_hilbertBasis hF + exact ⟨bE.repr.trans bF.repr.symm⟩ + +section Conjugation + +variable [CompleteSpace E] [CompleteSpace F] + +theorem norm_conj (e : E ≃ₗᵢ[ℂ] F) (T : E →L[ℂ] E) : + ‖e.conjStarAlgEquiv T‖ = ‖T‖ := by + apply le_antisymm + · apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg T) + intro x + simpa using T.le_opNorm (e.symm x) + · apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg (e.conjStarAlgEquiv T)) + intro x + simpa using (e.conjStarAlgEquiv T).le_opNorm (e x) + +theorem norm_conj_pow (e : E ≃ₗᵢ[ℂ] F) (T : E →L[ℂ] E) (n : ℕ) : + ‖(e.conjStarAlgEquiv T) ^ n‖ = ‖T ^ n‖ := by + rw [← map_pow, norm_conj] + +theorem norm_quasinilpotent_conj_iff (e : E ≃ₗᵢ[ℂ] F) (T : E →L[ℂ] E) : + Filter.Tendsto (fun n : ℕ => ‖(e.conjStarAlgEquiv T) ^ n‖ ^ (1 / (n : ℝ))) + Filter.atTop (𝓝 (0 : ℝ)) ↔ + Filter.Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) + Filter.atTop (𝓝 (0 : ℝ)) := by + simp only [norm_conj_pow] + +theorem conj_ne_zero_iff (e : E ≃ₗᵢ[ℂ] F) (T : E →L[ℂ] E) : + e.conjStarAlgEquiv T ≠ 0 ↔ T ≠ 0 := by + exact not_congr (map_eq_zero_iff _ e.conjStarAlgEquiv.injective) + +theorem no_hyperinvariant_subspace_conj + (e : E ≃ₗᵢ[ℂ] F) (T : E →L[ℂ] E) + (hT : ∀ S : Submodule ℂ E, IsClosed (S : Set E) → + (∀ A : E →L[ℂ] E, Commute A T → ∀ x ∈ S, A x ∈ S) → S = ⊥ ∨ S = ⊤) : + ∀ S : Submodule ℂ F, IsClosed (S : Set F) → + (∀ A : F →L[ℂ] F, Commute A (e.conjStarAlgEquiv T) → + ∀ x ∈ S, A x ∈ S) → S = ⊥ ∨ S = ⊤ := by + intro S hS hInv + let S' : Submodule ℂ E := S.comap e.toLinearEquiv.toLinearMap + have hS' : IsClosed (S' : Set E) := hS.preimage e.continuous + have hInv' : ∀ A : E →L[ℂ] E, Commute A T → ∀ x ∈ S', A x ∈ S' := by + intro A hA x hx + have h := hInv (e.conjStarAlgEquiv A) (hA.map e.conjStarAlgEquiv) (e x) hx + simpa [S'] using h + rcases hT S' hS' hInv' with hbot | htop + · left + apply le_antisymm _ bot_le + intro y hy + have hx : e.symm y ∈ S' := by simpa [S'] using hy + rw [hbot, Submodule.mem_bot] at hx + simpa using congrArg e hx + · right + apply le_antisymm le_top + intro y _ + have hx : e.symm y ∈ S' := by rw [htop]; trivial + simpa [S'] using hx + +theorem transport_counterexample (e : E ≃ₗᵢ[ℂ] F) (T : E →L[ℂ] E) + (hne : T ≠ 0) + (hquasi : Filter.Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) + Filter.atTop (𝓝 (0 : ℝ))) + (hhyper : ∀ S : Submodule ℂ E, IsClosed (S : Set E) → + (∀ A : E →L[ℂ] E, Commute A T → ∀ x ∈ S, A x ∈ S) → S = ⊥ ∨ S = ⊤) : + ∃ T' : F →L[ℂ] F, T' ≠ 0 ∧ + Filter.Tendsto (fun n : ℕ => ‖T' ^ n‖ ^ (1 / (n : ℝ))) + Filter.atTop (𝓝 (0 : ℝ)) ∧ + (∀ S : Submodule ℂ F, IsClosed (S : Set F) → + (∀ A : F →L[ℂ] F, Commute A T' → ∀ x ∈ S, A x ∈ S) → S = ⊥ ∨ S = ⊤) := by + exact ⟨e.conjStarAlgEquiv T, (conj_ne_zero_iff e T).2 hne, + (norm_quasinilpotent_conj_iff e T).2 hquasi, + no_hyperinvariant_subspace_conj e T hhyper⟩ + +end Conjugation + +end Invariant233.UnitaryTransport + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/VaryingMapWeakLimit.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/VaryingMapWeakLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c9f12fd883f2032ba384f356cb80002abac5bbe --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/VaryingMapWeakLimit.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TrimmingWeakLimits +import Mathlib.MeasureTheory.Integral.DominatedConvergence +import Mathlib.Topology.ContinuousMap.Bounded.Normed + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped Topology BoundedContinuousFunction + +namespace Invariant233.VaryingMapWeakLimit + +variable {X Y : Type*} [MeasurableSpace X] + [TopologicalSpace Y] [MeasurableSpace Y] [OpensMeasurableSpace Y] + +theorem tendsto_map_of_ae_tendsto (μ : FiniteMeasure X) + (f : ℕ → X → Y) (g : X → Y) + (hf : ∀ n, Measurable (f n)) (hg : Measurable g) + (hlim : ∀ᵐ x ∂(μ : Measure X), Tendsto (fun n => f n x) atTop (𝓝 (g x))) : + Tendsto (fun n => μ.map (f n)) atTop (𝓝 (μ.map g)) := by + apply FiniteMeasure.tendsto_iff_forall_integral_tendsto.mpr + intro φ + have hi := tendsto_integral_of_dominated_convergence (μ := (μ : Measure X)) + (fun _ => ‖φ‖) + (fun n => (φ.continuous.measurable.comp (hf n)).aestronglyMeasurable) + (integrable_const ‖φ‖) + (fun n => Filter.Eventually.of_forall (fun x => φ.norm_coe_le_norm (f n x))) + (hlim.mono (fun x hx => φ.continuous.continuousAt.tendsto.comp hx)) + simpa only [Function.comp_def, FiniteMeasure.toMeasure_map, + integral_map (hf _).aemeasurable φ.continuous.aestronglyMeasurable, + integral_map hg.aemeasurable φ.continuous.aestronglyMeasurable] using hi + +theorem tendsto_map_restrict_of_ae_tendsto (μ : FiniteMeasure X) + (f : ℕ → X → Y) (g : X → Y) + (hf : ∀ n, Measurable (f n)) (hg : Measurable g) + (hlim : ∀ᵐ x ∂(μ : Measure X), Tendsto (fun n => f n x) atTop (𝓝 (g x))) + (A : ℕ → Set X) (hA : ∀ n, MeasurableSet (A n)) + (hlost : Tendsto (fun n => μ (A n)ᶜ) atTop (𝓝 0)) : + Tendsto (fun n => (μ.restrict (A n)).map (f n)) atTop (𝓝 (μ.map g)) := by + apply TrimmingWeakLimits.tendsto_of_add_eq_of_mass_tendsto_zero + (tendsto_map_of_ae_tendsto μ f g hf hg hlim) + (δn := fun n => (μ.restrict (A n)ᶜ).map (f n)) + · intro n + rw [← FiniteMeasure.map_add (hf n)] + congr 1 + simpa only [union_compl_self, FiniteMeasure.restrict_univ] using + (FiniteMeasure.restrict_union (μ := μ) disjoint_compl_right (hA n).compl).symm + · simpa only [FiniteMeasure.mass, FiniteMeasure.map_apply _ (hf _) MeasurableSet.univ, + preimage_univ, FiniteMeasure.restrict_apply μ _ MeasurableSet.univ, + univ_inter] using hlost + +end Invariant233.VaryingMapWeakLimit + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/VonNeumannStrongClosure.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/VonNeumannStrongClosure.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad13c9815741abe831fed7e8e453b7176027b222 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/VonNeumannStrongClosure.lean @@ -0,0 +1,46 @@ +import OAI.Analysis.IrrationalRotation.Operators.Commutant +import Mathlib.Analysis.VonNeumannAlgebra.Basic + +namespace OAI + +namespace Invariant233 + +section Normed +variable {H : Type*} [NormedAddCommGroup H] [NormedSpace ℂ H] + +theorem centralizer_stronglyClosed (s : Set (H →L[ℂ] H)) : + IsStronglyClosed (Subalgebra.centralizer ℂ s) := by + unfold IsStronglyClosed + have heq : + {A : H →Lₚₜ[ℂ] H | strongOperatorUnderlying A ∈ Subalgebra.centralizer ℂ s} = + ⋂ T ∈ s, {A : H →Lₚₜ[ℂ] H | ∀ x : H, T (A x) = A (T x)} := by + ext A + simp only [Set.mem_ofPred_eq, Set.mem_iInter, Subalgebra.mem_centralizer_iff] + apply forall_congr' + intro T + apply forall_congr' + intro _ + exact ContinuousLinearMap.ext_iff + rw [heq] + exact isClosed_biInter fun T _ => Commutant.isClosed_strong_commutant T + +end Normed + +section Hilbert +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem vonNeumannAlgebra_stronglyClosed (M : VonNeumannAlgebra H) : + IsStronglyClosed M.toStarSubalgebra.toSubalgebra := by + have heq : M.toStarSubalgebra.toSubalgebra = + Subalgebra.centralizer ℂ (M.commutant : Set (H →L[ℂ] H)) := by + apply SetLike.coe_injective + change (M : Set (H →L[ℂ] H)) = _ + rw [Subalgebra.coe_centralizer, VonNeumannAlgebra.coe_commutant, + M.centralizer_centralizer] + rw [heq] + exact centralizer_stronglyClosed _ + +end Hilbert +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/VonNeumannSupportGeometry.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/VonNeumannSupportGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed3fc262000a364f7b3526f5859d825613768362 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/VonNeumannSupportGeometry.lean @@ -0,0 +1,167 @@ +import Mathlib.Analysis.VonNeumannAlgebra.Basic +import Mathlib.Analysis.InnerProductSpace.Projection.Submodule + +namespace OAI + +noncomputable section + +namespace Invariant233.VonNeumannSupportGeometry + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem kernel_projection_mem (M : VonNeumannAlgebra H) (a : H →L[ℂ] H) + (ha : a ∈ M) : a.ker.starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mpr + intro w hw + rw [Submodule.range_starProjection] + apply (Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mpr + intro x hx + change a (w x) = 0 + have hc := congrArg (fun b : H →L[ℂ] H => b x) + ((VonNeumannAlgebra.mem_commutant_iff.mp hw) a ha) + change a (w x) = w (a x) at hc + rw [hc, show a x = 0 from hx, map_zero] + +theorem range_closure_projection_mem (M : VonNeumannAlgebra H) + (a : H →L[ℂ] H) (ha : a ∈ M) : + a.range.topologicalClosure.starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mpr + intro w hw + rw [Submodule.range_starProjection] + apply Submodule.topologicalClosure_mem_invtSubmodule + apply (Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mpr + rintro y ⟨x, rfl⟩ + refine ⟨w x, ?_⟩ + exact congrArg (fun b : H →L[ℂ] H => b x) + ((VonNeumannAlgebra.mem_commutant_iff.mp hw) a ha) + +theorem kernel_orthogonal_projection_mem (M : VonNeumannAlgebra H) + (a : H →L[ℂ] H) (ha : a ∈ M) : a.kerᗮ.starProjection ∈ M := by + rw [Submodule.starProjection_orthogonal'] + exact sub_mem (one_mem M) (kernel_projection_mem M a ha) + +theorem range_closure_projection_eq (a : H →L[ℂ] H) : + a.range.topologicalClosure.starProjection = + 1 - (star a).ker.starProjection := by + rw [← Submodule.starProjection_orthogonal'] + congr 1 + simpa only [ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_adjoint] using + (ContinuousLinearMap.orthogonal_ker (star a)).symm + +section Meet + +variable (p q : Submodule ℂ H) [p.HasOrthogonalProjection] [q.HasOrthogonalProjection] + +private theorem inf_hasOrthogonalProjection : (p ⊓ q).HasOrthogonalProjection := by + have hp : IsClosed (p : Set H) := by + rw [← p.orthogonal_orthogonal] + exact pᗮ.isClosed_orthogonal + have hq : IsClosed (q : Set H) := by + rw [← q.orthogonal_orthogonal] + exact qᗮ.isClosed_orthogonal + let : IsClosed ((p ⊓ q : Submodule ℂ H) : Set H) := hp.inter hq + infer_instance + +local instance : (p ⊓ q).HasOrthogonalProjection := inf_hasOrthogonalProjection p q + +theorem inf_projection_mem (M : VonNeumannAlgebra H) + (hp : p.starProjection ∈ M) (hq : q.starProjection ∈ M) : + (p ⊓ q).starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mpr + intro w hw + rw [Submodule.range_starProjection] + apply (Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mpr + have hpi := (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mp hp w hw + have hqi := (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mp hq w hw + rw [Submodule.range_starProjection] at hpi hqi + intro x hx + exact ⟨(Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mp hpi x hx.1, + (Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mp hqi x hx.2⟩ + +omit [CompleteSpace H] in + +theorem inf_kernel_complement_projection : + p ⊓ ((1 - q.starProjection) * p.starProjection).ker = p ⊓ q := by + ext x + constructor + · rintro ⟨hp, hx⟩ + refine ⟨hp, ?_⟩ + change p.starProjection x - q.starProjection (p.starProjection x) = 0 at hx + rw [Submodule.starProjection_eq_self_iff.mpr hp] at hx + exact Submodule.starProjection_eq_self_iff.mp (sub_eq_zero.mp hx).symm + · rintro ⟨hp, hq⟩ + refine ⟨hp, ?_⟩ + change p.starProjection x - q.starProjection (p.starProjection x) = 0 + rw [Submodule.starProjection_eq_self_iff.mpr hp, + Submodule.starProjection_eq_self_iff.mpr hq, sub_self] + +omit [CompleteSpace H] in + +theorem kernel_complement_projection : + ((1 - q.starProjection) * p.starProjection).ker = pᗮ ⊔ (p ⊓ q) := by + ext x + constructor + · intro hx + change p.starProjection x - q.starProjection (p.starProjection x) = 0 at hx + apply Submodule.mem_sup.mpr + refine ⟨x - p.starProjection x, p.sub_starProjection_mem_orthogonal x, + p.starProjection x, ⟨p.starProjection_apply_mem x, ?_⟩, sub_add_cancel x _⟩ + exact Submodule.starProjection_eq_self_iff.mp (sub_eq_zero.mp hx).symm + · intro hx + obtain ⟨u, hu, v, ⟨hvp, hvq⟩, rfl⟩ := Submodule.mem_sup.mp hx + have hu0 : p.starProjection u = 0 := by + change u ∈ p.starProjection.ker + rwa [Submodule.ker_starProjection] + change p.starProjection (u + v) - q.starProjection (p.starProjection (u + v)) = 0 + rw [map_add, hu0, zero_add, Submodule.starProjection_eq_self_iff.mpr hvp, + Submodule.starProjection_eq_self_iff.mpr hvq, sub_self] + +theorem initial_support_complement_projection : + ((1 - q.starProjection) * p.starProjection).kerᗮ.starProjection = + p.starProjection - (p ⊓ q).starProjection := by + let r : Submodule ℂ H := p ⊓ q + have hrp : r ≤ p := inf_le_left + have hrq : r ≤ q := inf_le_right + have hk : ((1 - q.starProjection) * p.starProjection).ker = pᗮ ⊔ r := + kernel_complement_projection p q + ext x + change _ = p.starProjection x - r.starProjection x + apply Submodule.eq_starProjection_of_mem_orthogonal + · rw [hk, ← Submodule.inf_orthogonal, p.orthogonal_orthogonal] + refine ⟨p.sub_mem (p.starProjection_apply_mem x) + (hrp (r.starProjection_apply_mem x)), ?_⟩ + rw [← Submodule.ker_starProjection] + change r.starProjection (p.starProjection x - r.starProjection x) = 0 + have hc := congrArg (fun b : H →L[ℂ] H => b x) + (Submodule.starProjection_comp_starProjection_of_le hrp) + change r.starProjection (p.starProjection x) = r.starProjection x at hc + rw [map_sub, hc, + Submodule.starProjection_eq_self_iff.mpr (r.starProjection_apply_mem x), sub_self] + · rw [Submodule.orthogonal_orthogonal, hk] + apply Submodule.mem_sup.mpr + refine ⟨x - p.starProjection x, p.sub_starProjection_mem_orthogonal x, + r.starProjection x, r.starProjection_apply_mem x, ?_⟩ + abel + +omit [CompleteSpace H] in + +theorem range_closure_complement_projection_le : + ((1 - q.starProjection) * p.starProjection).range.topologicalClosure ≤ qᗮ := by + apply Submodule.topologicalClosure_minimal _ _ q.isClosed_orthogonal + rintro y ⟨x, rfl⟩ + exact q.sub_starProjection_mem_orthogonal (p.starProjection x) + +end Meet + +end Invariant233.VonNeumannSupportGeometry + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Analysis/WeakConvergenceAEContinuous.lean b/lean/OAI/Analysis/IrrationalRotation/Analysis/WeakConvergenceAEContinuous.lean new file mode 100644 index 0000000000000000000000000000000000000000..302357c6e17d858a21ed52ff30c0bce76242e679 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Analysis/WeakConvergenceAEContinuous.lean @@ -0,0 +1,74 @@ +import Mathlib.MeasureTheory.Measure.Portmanteau +import Mathlib.Topology.ContinuousMap.Bounded.Normed + +namespace OAI + +noncomputable section + +namespace Invariant233.WeakConvergenceAEContinuous + +open MeasureTheory Filter Set +open scoped Topology BoundedContinuousFunction + +theorem tendsto_map_of_ae_continuous + {X Y : Type*} [TopologicalSpace X] [MeasurableSpace X] + [OpensMeasurableSpace X] [HasOuterApproxClosed X] + [TopologicalSpace Y] [MeasurableSpace Y] [OpensMeasurableSpace Y] + {μs : ℕ → ProbabilityMeasure X} {μ : ProbabilityMeasure X} + (hμ : Tendsto μs atTop (𝓝 μ)) {f : X → Y} (hf : Measurable f) + (hc : ∀ᵐ x ∂(μ : Measure X), ContinuousAt f x) : + Tendsto (fun j => (μs j).map f) atTop + (𝓝 (μ.map f)) := by + apply tendsto_of_forall_isClosed_limsup_le' + intro F hF + have heq : (μ : Measure X) (closure (f ⁻¹' F)) = (μ : Measure X) (f ⁻¹' F) := by + apply measure_congr + filter_upwards [hc] with x hx + apply propext + constructor + · intro h + have hfreq : ∃ᶠ y in 𝓝 x, f y ∈ F := mem_closure_iff_frequently.mp h + exact hF.mem_of_frequently_of_tendsto hfreq hx + · intro h + exact subset_closure h + simp only [ProbabilityMeasure.map, ProbabilityMeasure.coe_mk, + Measure.map_apply hf hF.measurableSet] + calc + limsup (fun j => (μs j : Measure X) (f ⁻¹' F)) atTop ≤ + limsup (fun j => (μs j : Measure X) (closure (f ⁻¹' F))) atTop := + limsup_le_limsup (Eventually.of_forall (fun _ => measure_mono subset_closure)) + _ ≤ (μ : Measure X) (closure (f ⁻¹' F)) := + ProbabilityMeasure.limsup_measure_closed_le_of_tendsto hμ isClosed_closure + _ = (μ : Measure X) (f ⁻¹' F) := heq + +theorem tendsto_integral_of_ae_continuous + {X : Type*} [TopologicalSpace X] [MeasurableSpace X] + [OpensMeasurableSpace X] [HasOuterApproxClosed X] + {μs : ℕ → ProbabilityMeasure X} {μ : ProbabilityMeasure X} + (hμ : Tendsto μs atTop (𝓝 μ)) {f : X → ℝ} (hf : Measurable f) + (hc : ∀ᵐ x ∂(μ : Measure X), ContinuousAt f x) + {B : ℝ} (hB : 0 ≤ B) (hb : ∀ x, |f x| ≤ B) : + Tendsto (fun j => ∫ x, f x ∂(μs j : Measure X)) atTop + (𝓝 (∫ x, f x ∂(μ : Measure X))) := by + let g : ℝ →ᵇ ℝ := BoundedContinuousFunction.ofNormedAddCommGroup + (fun x => max (-B) (min B x)) (by fun_prop) B (fun x => by + rw [Real.norm_eq_abs, abs_le] + exact ⟨le_max_left _ _, max_le (by linarith) (min_le_left _ _)⟩) + have hgf : ∀ x, g (f x) = f x := by + intro x + change max (-B) (min B (f x)) = f x + rw [min_eq_right (abs_le.mp (hb x)).2, max_eq_right (abs_le.mp (hb x)).1] + have h := (ProbabilityMeasure.tendsto_iff_forall_integral_tendsto.mp + (tendsto_map_of_ae_continuous hμ hf hc)) g + have hmap (ν : ProbabilityMeasure X) : + (∫ y, g y ∂(ν.map f : Measure ℝ)) = ∫ x, f x ∂(ν : Measure X) := by + change (∫ y, g y ∂Measure.map f (ν : Measure X)) = _ + rw [integral_map hf.aemeasurable g.continuous.aestronglyMeasurable] + simp only [hgf] + simpa only [hmap] using h + +end Invariant233.WeakConvergenceAEContinuous + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/BiasedTailDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/BiasedTailDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c321979fab417990eac97d8d037b3f308bcc0bb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/BiasedTailDensity.lean @@ -0,0 +1,131 @@ +import OAI.Analysis.IrrationalRotation.Model.BiasedTailDensity +import Mathlib.MeasureTheory.Function.L2Space +import Mathlib.MeasureTheory.Measure.WithDensity +import Mathlib.Tactic + +namespace OAI + +noncomputable section +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal + +namespace Invariant233.BiasedTailDensity + +variable {P Z : Type*} [MeasurableSpace P] [MeasurableSpace Z] + {μ : Measure P} {ν : Measure Z} + +theorem sq_integral_le_integral_sq [IsProbabilityMeasure μ] {f : P → ℝ} + (hf : Integrable f μ) (hf2 : Integrable (fun u => f u ^ 2) μ) : + (∫ u, f u ∂μ) ^ 2 ≤ ∫ u, f u ^ 2 ∂μ := by + let a := ∫ u, f u ∂μ + have hn : 0 ≤ ∫ u, (f u - a) ^ 2 ∂μ := + integral_nonneg fun u => sq_nonneg _ + have heq : (fun u => (f u - a) ^ 2) = + fun u => (f u ^ 2 - (2 * a) * f u) + a ^ 2 := by + funext u + ring + rw [heq] at hn + rw [integral_add (f := fun u => f u ^ 2 - (2 * a) * f u) + (g := fun _ => a ^ 2) (hf2.sub (hf.const_mul (2 * a))) (integrable_const _), + integral_sub (f := fun u => f u ^ 2) (g := fun u => (2 * a) * f u) + hf2 (hf.const_mul (2 * a)), integral_const_mul, integral_const] at hn + simp only [probReal_univ, one_smul] at hn + change a ^ 2 ≤ _ + change 0 ≤ (∫ u, f u ^ 2 ∂μ) - (2 * a) * a + a ^ 2 at hn + nlinarith + +variable [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + +theorem integrable_tailDensity {g : P × Z → ℝ} (hg : MemLp g 2 (μ.prod ν)) : + Integrable (tailDensity μ g) ν := + (hg.integrable (by norm_num)).integral_prod_right + +theorem ae_sq_tailDensity_le {g : P × Z → ℝ} (hg : MemLp g 2 (μ.prod ν)) : + ∀ᵐ z ∂ν, tailDensity μ g z ^ 2 ≤ ∫ u, g (u, z) ^ 2 ∂μ := by + filter_upwards [(hg.integrable (by norm_num)).prod_left_ae, + hg.integrable_sq.prod_left_ae] with z hz hz2 + exact sq_integral_le_integral_sq hz hz2 + +theorem memLp_tailDensity {g : P × Z → ℝ} (hg : MemLp g 2 (μ.prod ν)) : + MemLp (tailDensity μ g) 2 ν := by + apply (memLp_two_iff_integrable_sq (integrable_tailDensity hg).aestronglyMeasurable).2 + apply Integrable.mono hg.integrable_sq.integral_prod_right + ((integrable_tailDensity hg).aestronglyMeasurable.pow 2) + filter_upwards [ae_sq_tailDensity_le hg] with z hz + change |tailDensity μ g z ^ 2| ≤ |∫ u, g (u, z) ^ 2 ∂μ| + rw [abs_of_nonneg (sq_nonneg _), + abs_of_nonneg (integral_nonneg fun u => sq_nonneg (g (u, z)))] + exact hz + +theorem integral_sq_tailDensity_le {g : P × Z → ℝ} (hg : MemLp g 2 (μ.prod ν)) : + (∫ z, tailDensity μ g z ^ 2 ∂ν) ≤ ∫ p, g p ^ 2 ∂μ.prod ν := by + calc + _ ≤ ∫ z, ∫ u, g (u, z) ^ 2 ∂μ ∂ν := + integral_mono_ae (memLp_tailDensity hg).integrable_sq + hg.integrable_sq.integral_prod_right (ae_sq_tailDensity_le hg) + _ = _ := (integral_prod_symm _ hg.integrable_sq).symm + +theorem eLpNorm_tailDensity_le {g : P × Z → ℝ} (hg : MemLp g 2 (μ.prod ν)) : + eLpNorm (tailDensity μ g) 2 ν ≤ eLpNorm g 2 (μ.prod ν) := by + rw [MemLp.eLpNorm_eq_integral_rpow_norm (by norm_num) (by norm_num) + (memLp_tailDensity hg), + MemLp.eLpNorm_eq_integral_rpow_norm (by norm_num) (by norm_num) hg] + norm_num only [ENNReal.toReal_ofNat, Real.rpow_two, Real.norm_eq_abs, sq_abs] + apply ENNReal.ofReal_le_ofReal + exact Real.rpow_le_rpow (integral_nonneg fun _ => sq_nonneg _) + (integral_sq_tailDensity_le hg) (by positivity) + +theorem integral_tailDensity {g : P × Z → ℝ} (hg : MemLp g 2 (μ.prod ν)) : + (∫ z, tailDensity μ g z ∂ν) = ∫ p, g p ∂μ.prod ν := + (integral_prod_symm _ (hg.integrable (by norm_num))).symm + +theorem map_snd_withDensity_lintegral {g : P × Z → ℝ≥0∞} + (hg : AEMeasurable g (μ.prod ν)) : + ((μ.prod ν).withDensity g).map Prod.snd = + ν.withDensity (fun z => ∫⁻ u, g (u, z) ∂μ) := by + ext s hs + rw [Measure.map_apply measurable_snd hs, + withDensity_apply _ (measurable_snd hs), withDensity_apply _ hs] + have heq : Prod.snd ⁻¹' s = (Set.univ : Set P) ×ˢ s := by + ext x + simp + rw [heq, setLIntegral_prod_symm _ hg.restrict] + simp only [Measure.restrict_univ] + +theorem ae_nonneg_tailDensity {g : P × Z → ℝ} + (hn : 0 ≤ᵐ[μ.prod ν] g) : 0 ≤ᵐ[ν] tailDensity μ g := by + have hs : ∀ᵐ q ∂ν.prod μ, 0 ≤ g (q.2, q.1) := + measurePreserving_swap.quasiMeasurePreserving.ae hn + filter_upwards [ae_ae_of_ae_prod hs] with z hz + exact integral_nonneg_of_ae hz + +theorem map_snd_withDensity_tailDensity {g : P × Z → ℝ} + (hg : MemLp g 2 (μ.prod ν)) (hn : 0 ≤ᵐ[μ.prod ν] g) : + ((μ.prod ν).withDensity (fun p => ENNReal.ofReal (g p))).map Prod.snd = + ν.withDensity (fun z => ENNReal.ofReal (tailDensity μ g z)) := by + rw [map_snd_withDensity_lintegral hg.aemeasurable.ennreal_ofReal] + apply withDensity_congr_ae + have hs : ∀ᵐ q ∂ν.prod μ, 0 ≤ g (q.2, q.1) := + measurePreserving_swap.quasiMeasurePreserving.ae hn + filter_upwards [(hg.integrable (by norm_num)).prod_left_ae, + ae_ae_of_ae_prod hs] with z hz hzn + exact (ofReal_integral_eq_lintegral_ofReal hz hzn).symm + +theorem tailDensity_spec {g : P × Z → ℝ} + (hg : MemLp g 2 (μ.prod ν)) (hn : 0 ≤ᵐ[μ.prod ν] g) + (hmass : ∫ p, g p ∂μ.prod ν = 1) : + MemLp (tailDensity μ g) 2 ν ∧ + 0 ≤ᵐ[ν] tailDensity μ g ∧ + (∫ z, tailDensity μ g z ∂ν) = 1 ∧ + eLpNorm (tailDensity μ g) 2 ν ≤ eLpNorm g 2 (μ.prod ν) ∧ + ((μ.prod ν).withDensity (fun p => ENNReal.ofReal (g p))).map Prod.snd = + ν.withDensity (fun z => ENNReal.ofReal (tailDensity μ g z)) := by + exact ⟨memLp_tailDensity hg, ae_nonneg_tailDensity hn, + (integral_tailDensity hg).trans hmass, eLpNorm_tailDensity_le hg, + map_snd_withDensity_tailDensity hg hn⟩ + +end Invariant233.BiasedTailDensity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockProductCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockProductCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..ded184dc82805a4456f6461d4df67b5c900434b7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockProductCoupling.lean @@ -0,0 +1,135 @@ +import OAI.Analysis.IrrationalRotation.Model.BlockProductCoupling +import OAI.Analysis.IrrationalRotation.Couplings.ProductCoupling +import OAI.Analysis.IrrationalRotation.Analysis.BlockAverageSum +import OAI.Analysis.IrrationalRotation.Analysis.ConsecutiveBlocks +import Mathlib.Analysis.PSeries + +namespace OAI + +open MeasureTheory Filter +open scoped BigOperators ENNReal + +namespace Invariant233.OrderedProductCoupling +open InvariantProjection.IndependentAngles + +lemma sourceKappa_nonneg (s : ℕ) : 0 ≤ sourceKappa s := by + unfold sourceKappa + positivity + +lemma sourceKappa_pos (s : ℕ) : 0 < sourceKappa s := by + unfold sourceKappa + positivity + +lemma sourceKappa_le (s : ℕ) : sourceKappa s ≤ 1 / 100 := by + unfold sourceKappa + apply (div_le_iff₀ (by positivity : 0 < 100 * ((s : ℝ) + 1))).2 + nlinarith [Nat.cast_nonneg (α := ℝ) s] + +lemma summable_sourceKappa_sq : Summable (fun s => sourceKappa s ^ 2) := by + have hbase : Summable (fun s : ℕ => 1 / ((s + 1 : ℕ) : ℝ) ^ 2) := + (summable_nat_add_iff 1).2 (Real.summable_one_div_nat_pow.mpr (by norm_num)) + apply (hbase.mul_left (1 / 10000 : ℝ)).congr + intro s + have hs : (s : ℝ) + 1 ≠ 0 := by positivity + simp only [sourceKappa, Nat.cast_add, Nat.cast_one] + field_simp + ring + +lemma blockDensityBound_pos (κ : ℕ → ℝ) : 0 < blockDensityBound κ := + Real.exp_pos _ + +lemma blockDensityBound_sq (κ : ℕ → ℝ) : + blockDensityBound κ ^ 2 = Real.exp (20 * (2 * (∑' s, κ s ^ 2) + 1)) := by + rw [blockDensityBound, pow_two, ← Real.exp_add] + congr 1 + ring + +section BlockData +variable (m : ℕ → ℕ) (κ a b : ℕ → ℝ) + (hκ0 : ∀ s, 0 ≤ κ s) (hκ : ∀ s, κ s ≤ 1 / 100) + (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) (tag : ℕ) + +lemma energyBound_ofBlocks (i : ℕ) : + energyBound (ofBlocks m κ a b hκ0 hκ hm ha ha' hb hb' e tag) i = + (20 * (2 * κ (e i).1 ^ 2 + if (e i).1 = tag then 1 else 0)) / + (m (e i).1 : ℝ) := by + unfold energyBound ofBlocks + ring + +theorem ofBlocks_energy_sum (hsκ : Summable (fun s => κ s ^ 2)) : + Summable (energyBound (ofBlocks m κ a b hκ0 hκ hm ha ha' hb hb' e tag)) ∧ + (∑' i, energyBound (ofBlocks m κ a b hκ0 hκ hm ha ha' hb hb' e tag) i) = + 20 * (2 * (∑' s, κ s ^ 2) + 1) := by + let u : ℕ → ℝ := fun s => 20 * (2 * κ s ^ 2 + if s = tag then 1 else 0) + have hu : ∀ s, 0 ≤ u s := by + intro s + dsimp [u] + split_ifs <;> positivity + have htag : Summable (fun s : ℕ => if s = tag then (1 : ℝ) else 0) := + (hasSum_ite_eq tag (1 : ℝ)).summable + have hsu : Summable u := ((hsκ.mul_left 2).add htag).mul_left 20 + have hblock := enumerated_block_average m (fun s => by have := hm s; omega) u hu hsu e + have henergy : energyBound (ofBlocks m κ a b hκ0 hκ hm ha ha' hb hb' e tag) = + fun i => u (e i).1 / (m (e i).1 : ℝ) := by + funext i + exact energyBound_ofBlocks m κ a b hκ0 hκ hm ha ha' hb hb' e tag i + rw [henergy] + refine ⟨hblock.1, hblock.2.trans ?_⟩ + dsimp [u] + rw [tsum_mul_left, (hsκ.mul_left 2).tsum_add htag, tsum_mul_left, + tsum_ite_eq] + +theorem exists_hybrid_density_ofBlocks (hsκ : Summable (fun s => κ s ^ 2)) + (ε : ℕ → Bool) : + ∃ H : Endpoint → ℝ, MemLp H 2 baseMeasure ∧ (0 ≤ᵐ[baseMeasure] H) ∧ + (∫ x, H x ∂baseMeasure) = 1 ∧ + eLpNorm H 2 baseMeasure ≤ ENNReal.ofReal (blockDensityBound κ) ∧ + (law (ofBlocks m κ a b hκ0 hκ hm ha ha' hb hb' e tag)).map (hybridEndpoint ε) = + baseMeasure.withDensity (fun x => ENNReal.ofReal (H x)) := by + obtain ⟨hs, htotal⟩ := ofBlocks_energy_sum m κ a b hκ0 hκ hm ha ha' hb hb' e tag hsκ + have hbound : Real.exp ((20 * (2 * (∑' s, κ s ^ 2) + 1)) / 2) = + blockDensityBound κ := by + unfold blockDensityBound + congr 1 + ring + simpa only [hbound] using exists_hybrid_density + (ofBlocks m κ a b hκ0 hκ hm ha ha' hb hb' e tag) ε hs htotal.le + +end BlockData + +theorem exists_source_hybrid_density + (m : ℕ → ℕ) (a b : ℕ → ℝ) (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) (tag : ℕ) (ε : ℕ → Bool) : + ∃ H : Endpoint → ℝ, MemLp H 2 baseMeasure ∧ (0 ≤ᵐ[baseMeasure] H) ∧ + (∫ x, H x ∂baseMeasure) = 1 ∧ + eLpNorm H 2 baseMeasure ≤ ENNReal.ofReal (blockDensityBound sourceKappa) ∧ + (law (ofBlocks m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm + ha ha' hb hb' e tag)).map (hybridEndpoint ε) = + baseMeasure.withDensity (fun x => ENNReal.ofReal (H x)) := + exists_hybrid_density_ofBlocks m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm + ha ha' hb hb' e tag summable_sourceKappa_sq ε + +theorem exists_source_consecutive_couplings + (m : ℕ → ℕ) (a b : ℕ → ℝ) (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) : + ∃ e : ℕ ≃ Σ s, Fin (m s), + (∀ i : Σ s, Fin (m s), e.symm i = (∑ r ∈ Finset.range i.1, m r) + i.2.val) ∧ + ∀ (tag : ℕ) (ε : ℕ → Bool), + ∃ H : Endpoint → ℝ, MemLp H 2 baseMeasure ∧ (0 ≤ᵐ[baseMeasure] H) ∧ + (∫ x, H x ∂baseMeasure) = 1 ∧ + eLpNorm H 2 baseMeasure ≤ ENNReal.ofReal (blockDensityBound sourceKappa) ∧ + (law (ofBlocks m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm + ha ha' hb hb' e tag)).map (hybridEndpoint ε) = + baseMeasure.withDensity (fun x => ENNReal.ofReal (H x)) := by + obtain ⟨e, he⟩ := exists_consecutiveBlocks_equiv m (fun s => by have := hm s; omega) + exact ⟨e, he, fun tag ε => exists_source_hybrid_density m a b hm ha ha' hb hb' e tag ε⟩ + +end Invariant233.OrderedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockedCouplingDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockedCouplingDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..c857c96c6a3d22ca089b6daf5a34a566763c0594 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockedCouplingDensity.lean @@ -0,0 +1,115 @@ +import OAI.Analysis.IrrationalRotation.Couplings.BlockedProductCoupling +import OAI.Analysis.IrrationalRotation.Couplings.BlockedCouplingEnergy +import OAI.Analysis.IrrationalRotation.Analysis.EndpointLoss + +namespace OAI + +open MeasureTheory +open scoped ENNReal + +namespace Invariant233.BlockedProductCoupling + +variable {m : ℕ → ℕ} {κ : ℕ → ℝ} + {a b : (s : ℕ) → Fin (m s) → ℝ} + (hm : ∀ s, 100 ≤ m s) (hκ0 : ∀ s, 0 ≤ κ s) (hκ : ∀ s, κ s ≤ 1 / 100) + (ha : ∀ s i, 1 / (m s : ℝ) ≤ a s i) (ha' : ∀ s i, a s i ≤ 1 / 4) + (hb : ∀ s i, 1 / (m s : ℝ) ≤ b s i) (hb' : ∀ s i, b s i ≤ 1 / 4) + +include hm hκ0 hκ ha ha' hb hb' + +theorem law_map_flatten (e : ℕ ≃ Σ s, Fin (m s)) (j : ℕ) : + (law m κ a b j).map (flatten e) = + OrderedProductCoupling.law (parameters hm hκ0 hκ ha ha' hb hb' e j) := by + let P := parameters hm hκ0 hκ ha ha' hb hb' e j + change (law m κ a b j).map + ((fun z : (Σ s, Fin (m s)) → Coordinate => fun i => z (e i)) ∘ + (fun z p => z p.1 p.2)) = OrderedProductCoupling.law P + rw [← Measure.map_map (by fun_prop) (by fun_prop), + law_map_uncurry hm hκ0 hκ ha ha' hb hb'] + have h := Measure.infinitePi_map_piCongrLeft + (OrderedProductCoupling.coordinateLaw P) e.symm + simp only [OrderedProductCoupling.coordinateLaw, P, parameters, + Equiv.apply_symm_apply] at h + unfold OrderedProductCoupling.law + convert h using 1 <;> congr 1 + · funext z i + simp [MeasurableEquiv.piCongrLeft, Equiv.piCongrLeft] + · congr 1 + funext p + rw [e.apply_symm_apply] + +theorem exists_hybrid_density_of_blocks + (hsq : Summable (fun s => κ s ^ 2)) + (e : ℕ ≃ Σ s, Fin (m s)) (j : ℕ) (sel : ℕ → Bool) : + ∃ H : OrderedProductCoupling.Endpoint → ℝ, + MemLp H 2 OrderedProductCoupling.baseMeasure ∧ + (0 ≤ᵐ[OrderedProductCoupling.baseMeasure] H) ∧ + (∫ x, H x ∂OrderedProductCoupling.baseMeasure) = 1 ∧ + eLpNorm H 2 OrderedProductCoupling.baseMeasure ≤ + ENNReal.ofReal (Real.exp (10 * (2 * (∑' s, κ s ^ 2) + 1))) ∧ + (law m κ a b j).map (OrderedProductCoupling.hybridEndpoint sel ∘ flatten e) = + OrderedProductCoupling.baseMeasure.withDensity (fun x => ENNReal.ofReal (H x)) := by + let P := parameters hm hκ0 hκ ha ha' hb hb' e j + obtain ⟨hs, he⟩ := enumerated_energy_sum m (fun s => by have := hm s; omega) κ hsq e j + have hs' : Summable (OrderedProductCoupling.energyBound P) := hs + have he' : (∑' i, OrderedProductCoupling.energyBound P i) ≤ + 20 * (2 * (∑' s, κ s ^ 2) + 1) := he.le + obtain ⟨H, hH, hn, hmean, hnorm, hmap⟩ := + OrderedProductCoupling.exists_hybrid_density P sel hs' he' + refine ⟨H, hH, hn, hmean, ?_, ?_⟩ + · convert hnorm using 1 + congr 2 + ring + · rw [← Measure.map_map (OrderedProductCoupling.hybridEndpoint_measurable sel) + (by unfold flatten; fun_prop), law_map_flatten hm hκ0 hκ ha ha' hb hb'] + exact hmap + +theorem exists_left_density_of_blocks + (hsq : Summable (fun s => κ s ^ 2)) + (e : ℕ ≃ Σ s, Fin (m s)) (j : ℕ) : + ∃ H : OrderedProductCoupling.Endpoint → ℝ, + MemLp H 2 OrderedProductCoupling.baseMeasure ∧ + (0 ≤ᵐ[OrderedProductCoupling.baseMeasure] H) ∧ + Real.sqrt (∫ x, H x ^ 2 ∂OrderedProductCoupling.baseMeasure) ≤ + Real.exp (10 * (2 * (∑' s, κ s ^ 2) + 1)) ∧ + (law m κ a b j).map (leftEndpoint e) = + OrderedProductCoupling.baseMeasure.withDensity (fun x => ENNReal.ofReal (H x)) := by + obtain ⟨H, hH, hn, _, hnorm, hmap⟩ := + exists_hybrid_density_of_blocks hm hκ0 hκ ha ha' hb hb' hsq e j (fun _ => false) + refine ⟨H, hH, hn, ?_, ?_⟩ + · rw [EndpointLoss.sqrt_integral_sq_eq_toReal_eLpNorm hH] + have h := ENNReal.toReal_mono ENNReal.ofReal_ne_top hnorm + simpa only [ENNReal.toReal_ofReal (Real.exp_pos _).le] using h + · have hf : OrderedProductCoupling.hybridEndpoint (fun _ => false) ∘ flatten e = + leftEndpoint e := by + funext z i + rfl + rw [hf] at hmap + exact hmap + +theorem exists_right_density_of_blocks + (hsq : Summable (fun s => κ s ^ 2)) + (e : ℕ ≃ Σ s, Fin (m s)) (j : ℕ) : + ∃ H : OrderedProductCoupling.Endpoint → ℝ, + MemLp H 2 OrderedProductCoupling.baseMeasure ∧ + (0 ≤ᵐ[OrderedProductCoupling.baseMeasure] H) ∧ + Real.sqrt (∫ x, H x ^ 2 ∂OrderedProductCoupling.baseMeasure) ≤ + Real.exp (10 * (2 * (∑' s, κ s ^ 2) + 1)) ∧ + (law m κ a b j).map (rightEndpoint e) = + OrderedProductCoupling.baseMeasure.withDensity (fun x => ENNReal.ofReal (H x)) := by + obtain ⟨H, hH, hn, _, hnorm, hmap⟩ := + exists_hybrid_density_of_blocks hm hκ0 hκ ha ha' hb hb' hsq e j (fun _ => true) + refine ⟨H, hH, hn, ?_, ?_⟩ + · rw [EndpointLoss.sqrt_integral_sq_eq_toReal_eLpNorm hH] + have h := ENNReal.toReal_mono ENNReal.ofReal_ne_top hnorm + simpa only [ENNReal.toReal_ofReal (Real.exp_pos _).le] using h + · have hf : OrderedProductCoupling.hybridEndpoint (fun _ => true) ∘ flatten e = + rightEndpoint e := by + funext z i + rfl + rw [hf] at hmap + exact hmap + +end Invariant233.BlockedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockedCouplingEnergy.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockedCouplingEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..77df9036c8e6e8303da8dae7cd0dc1d2f2410114 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockedCouplingEnergy.lean @@ -0,0 +1,63 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductCoupling + +namespace OAI + +open MeasureTheory +open scoped BigOperators + +namespace Invariant233.BlockedProductCoupling + +theorem sum_block_energy (m : ℕ) (hm : 0 < m) (κ t : ℝ) : + (∑' _i : Fin m, 20 * (2 * κ ^ 2 / (m : ℝ) + t / (m : ℝ))) = + 20 * (2 * κ ^ 2 + t) := by + have hm0 : (m : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hm) + simp only [tsum_fintype, Finset.sum_const, Finset.card_univ, + Fintype.card_fin, nsmul_eq_mul] + field_simp + +theorem full_energy_sum (m : ℕ → ℕ) (hm : ∀ s, 0 < m s) + (κ : ℕ → ℝ) (hκ : Summable (fun s => κ s ^ 2)) (j : ℕ) : + Summable (fun p : Σ s, Fin (m s) => + 20 * (2 * κ p.1 ^ 2 / (m p.1 : ℝ) + + (if p.1 = j then 1 else 0) / (m p.1 : ℝ))) ∧ + (∑' p : Σ s, Fin (m s), + 20 * (2 * κ p.1 ^ 2 / (m p.1 : ℝ) + + (if p.1 = j then 1 else 0) / (m p.1 : ℝ))) = + 20 * (2 * (∑' s, κ s ^ 2) + 1) := by + classical + have htag : Summable (fun s : ℕ => if s = j then (1 : ℝ) else 0) := + summable_of_ne_finset_zero (s := {j}) (by simp) + have he (s : ℕ) : + (∑' _i : Fin (m s), 20 * (2 * κ s ^ 2 / (m s : ℝ) + + (if s = j then 1 else 0) / (m s : ℝ))) = + 20 * (2 * κ s ^ 2 + (if s = j then 1 else 0)) := + sum_block_energy _ (hm s) _ _ + have hblock : Summable (fun s => 20 * (2 * κ s ^ 2 + + (if s = j then (1 : ℝ) else 0))) := + ((hκ.mul_left 2).add htag).mul_left 20 + have hs : Summable (fun p : Σ s, Fin (m s) => + 20 * (2 * κ p.1 ^ 2 / (m p.1 : ℝ) + + (if p.1 = j then 1 else 0) / (m p.1 : ℝ))) := by + apply (summable_sigma_of_nonneg (fun p => by positivity)).2 + refine ⟨fun s => (hasSum_fintype _).summable, ?_⟩ + simpa only [he] using hblock + refine ⟨hs, ?_⟩ + rw [hs.tsum_sigma' (fun s => (hasSum_fintype _).summable)] + simp only [he] + rw [tsum_mul_left, (hκ.mul_left 2).tsum_add htag, tsum_mul_left] + simp + +theorem enumerated_energy_sum (m : ℕ → ℕ) (hm : ∀ s, 0 < m s) + (κ : ℕ → ℝ) (hκ : Summable (fun s => κ s ^ 2)) + (e : ℕ ≃ Σ s, Fin (m s)) (j : ℕ) : + Summable (fun i : ℕ => 20 * (2 * κ (e i).1 ^ 2 / (m (e i).1 : ℝ) + + (if (e i).1 = j then 1 else 0) / (m (e i).1 : ℝ))) ∧ + (∑' i : ℕ, 20 * (2 * κ (e i).1 ^ 2 / (m (e i).1 : ℝ) + + (if (e i).1 = j then 1 else 0) / (m (e i).1 : ℝ))) = + 20 * (2 * (∑' s, κ s ^ 2) + 1) := by + obtain ⟨hs, hv⟩ := full_energy_sum m hm κ hκ j + exact ⟨e.summable_iff.mpr hs, (e.tsum_eq _).trans hv⟩ + +end Invariant233.BlockedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockedProductCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockedProductCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..0fe1c699817b83e25ed80dcd4a6d15c5e17bb651 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/BlockedProductCoupling.lean @@ -0,0 +1,148 @@ +import OAI.Analysis.IrrationalRotation.Model.BlockedProductCoupling +import OAI.Analysis.IrrationalRotation.Analysis.ConcreteTagEvent + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal + +namespace Invariant233.BlockedProductCoupling + +open OneCoordinateCoupling + +variable {m : ℕ → ℕ} {κ : ℕ → ℝ} + {a b : (s : ℕ) → Fin (m s) → ℝ} + (hm : ∀ s, 100 ≤ m s) (hκ0 : ∀ s, 0 ≤ κ s) (hκ : ∀ s, κ s ≤ 1 / 100) + (ha : ∀ s i, 1 / (m s : ℝ) ≤ a s i) (ha' : ∀ s i, a s i ≤ 1 / 4) + (hb : ∀ s i, 1 / (m s : ℝ) ≤ b s i) (hb' : ∀ s i, b s i ≤ 1 / 4) + +include hm hκ0 hκ ha ha' hb hb' + +theorem coordinate_isProbabilityMeasure (j s : ℕ) (i : Fin (m s)) : + IsProbabilityMeasure (labelledLaw (κ s) (m s) (a s i) (b s i) + (if s = j then 1 else 0)) := by + apply labelledLaw_isProbabilityMeasure (hκ0 s) (hκ s) + (by exact_mod_cast hm s) (ha s i) (ha' s i) (hb s i) (hb' s i) + all_goals split_ifs <;> norm_num + +theorem blockLaw_isProbabilityMeasure (j s : ℕ) : + IsProbabilityMeasure (blockLaw m κ a b j s) := by + have := coordinate_isProbabilityMeasure hm hκ0 hκ ha ha' hb hb' j s + unfold blockLaw + infer_instance + +theorem law_isProbabilityMeasure (j : ℕ) : + IsProbabilityMeasure (law m κ a b j) := by + have := blockLaw_isProbabilityMeasure hm hκ0 hκ ha ha' hb hb' j + unfold law + infer_instance + +theorem law_map_block (j s : ℕ) : + (law m κ a b j).map (fun z => z s) = blockLaw m κ a b j s := by + have := blockLaw_isProbabilityMeasure hm hκ0 hκ ha ha' hb hb' j + exact Measure.infinitePi_map_eval _ s + +theorem law_map_coordinate (j s : ℕ) (i : Fin (m s)) : + (law m κ a b j).map (fun z => z s i) = + labelledLaw (κ s) (m s) (a s i) (b s i) (if s = j then 1 else 0) := by + have := coordinate_isProbabilityMeasure hm hκ0 hκ ha ha' hb hb' j s + change (law m κ a b j).map ((fun z => z i) ∘ (fun z => z s)) = _ + rw [← Measure.map_map (measurable_pi_apply i) (measurable_pi_apply s), + law_map_block hm hκ0 hκ ha ha' hb hb'] + exact (measurePreserving_eval _ i).map_eq + +theorem currentEvent_mass (j : ℕ) : + Real.exp (-82) ≤ (law m κ a b j).real (currentEvent m j) := by + let E : Set (Fin (m j) → Coordinate) := + {z | (∃ i, (z i).1 = some (4 : Fin 5)) ∧ + ∀ i, (z i).2.1 < 1 - 2 / (m j : ℝ) ∧ 2 / (m j : ℝ) < (z i).2.2} + have hE : MeasurableSet E := by + change MeasurableSet ({z : Fin (m j) → Coordinate | ∃ i, (z i).1 = some (4 : Fin 5)} ∩ + {z | ∀ i, (z i).2.1 < 1 - 2 / (m j : ℝ) ∧ 2 / (m j : ℝ) < (z i).2.2}) + rw [Set.ofPred_exists, Set.ofPred_forall] + apply MeasurableSet.inter + · + apply MeasurableSet.iUnion + intro i + exact (measurable_fst.comp (measurable_pi_apply i)) (measurableSet_singleton _) + · + apply MeasurableSet.iInter + intro i + have hx : Measurable (fun z : Fin (m j) → Coordinate => (z i).2.1) := by fun_prop + have hy : Measurable (fun z : Fin (m j) → Coordinate => (z i).2.2) := by fun_prop + exact (measurableSet_lt hx measurable_const).inter + (measurableSet_lt measurable_const hy) + have heq : (law m κ a b j).real (currentEvent m j) = + (blockLaw m κ a b j j).real E := by + rw [← law_map_block hm hκ0 hκ ha ha' hb hb' j j, + map_measureReal_apply (measurable_pi_apply j) hE] + rfl + rw [heq] + simpa only [blockLaw, ite_true, E] using + concrete_product_currentBlock_mass (m j) (hm j) (κ j) (hκ0 j) (hκ j) + (a j) (b j) (ha j) (ha' j) (hb j) (hb' j) + +theorem law_map_uncurry (j : ℕ) : + (law m κ a b j).map (fun z (p : Σ s, Fin (m s)) => z p.1 p.2) = + Measure.infinitePi (fun p : Σ s, Fin (m s) => + labelledLaw (κ p.1) (m p.1) (a p.1 p.2) (b p.1 p.2) + (if p.1 = j then 1 else 0)) := by + have := coordinate_isProbabilityMeasure hm hκ0 hκ ha ha' hb hb' j + unfold law blockLaw + have h := Measure.infinitePi_map_piCurry_symm + (fun s i => labelledLaw (κ s) (m s) (a s i) (b s i) + (if s = j then 1 else 0)) + simp only [Measure.infinitePi_eq_pi] at h + convert h using 1 + congr 1 + +theorem law_left_marginal_le_ten (j s : ℕ) (i : Fin (m s)) : + (law m κ a b j).map (fun z => (z s i).2.1) ≤ + (10 : ℝ≥0∞) • volume.restrict (Ico (0 : ℝ) 1) := by + change (law m κ a b j).map ((Prod.fst ∘ Prod.snd) ∘ + (fun z => z s i)) ≤ _ + rw [← Measure.map_map (measurable_fst.comp measurable_snd) + ((measurable_pi_apply i).comp (measurable_pi_apply s)), + law_map_coordinate hm hκ0 hκ ha ha' hb hb'] + change (labelledLaw (κ s) (m s) (a s i) (b s i) _).map + (fun z => z.2.1) ≤ _ + rw [labelledLaw_left_map, ← baseLaw_eq_restrict] + apply pairLaw_fst_le_ten (hκ0 s) (hκ s) (by exact_mod_cast hm s) + (ha s i) (ha' s i) (hb s i) (hb' s i) + all_goals split_ifs <;> norm_num + +theorem law_right_marginal_le_ten (j s : ℕ) (i : Fin (m s)) : + (law m κ a b j).map (fun z => (z s i).2.2) ≤ + (10 : ℝ≥0∞) • volume.restrict (Ico (0 : ℝ) 1) := by + change (law m κ a b j).map ((Prod.snd ∘ Prod.snd) ∘ + (fun z => z s i)) ≤ _ + rw [← Measure.map_map (measurable_snd.comp measurable_snd) + ((measurable_pi_apply i).comp (measurable_pi_apply s)), + law_map_coordinate hm hκ0 hκ ha ha' hb hb'] + change (labelledLaw (κ s) (m s) (a s i) (b s i) _).map + (fun z => z.2.2) ≤ _ + rw [labelledLaw_right_map, ← baseLaw_eq_restrict] + apply pairLaw_snd_le_ten (hκ0 s) (hκ s) (by exact_mod_cast hm s) + (ha s i) (ha' s i) (hb s i) (hb' s i) + all_goals split_ifs <;> norm_num + +theorem futureBad_mass_le {K : ℕ → ℝ} (hK : ∀ s, 0 < K s) + (j : ℕ) (hsum : Summable (fun n : ℕ => 1 / K (j + 1 + n))) : + (law m κ a b j).real (futureBad m K j) ≤ + 40 * K j * ∑' n : ℕ, 1 / K (j + 1 + n) := by + have := law_isProbabilityMeasure hm hκ0 hκ ha ha' hb hb' j + have h := InvariantRotation.EndpointIntervalBounds.blocked_future_endpoint_loss_le + (law m κ a b j) (fun n => m (j + 1 + n)) (fun n => by have := hm (j + 1 + n); omega) + (K := fun n => K (j + 1 + n)) (fun n => hK _) hsum + (X := fun n i z => (z (j + 1 + n) i).2.1) + (Y := fun n i z => (z (j + 1 + n) i).2.2) + (by intros; fun_prop) (by intros; fun_prop) + (C := 10) (a := 2) (W := K j) (by norm_num) (by norm_num) (hK j).le + (fun n i => by simpa using law_left_marginal_le_ten hm hκ0 hκ ha ha' hb hb' j _ i) + (fun n i => by simpa using law_right_marginal_le_ten hm hκ0 hκ ha ha' hb hb' j _ i) + norm_num only [show (2 : ℝ) * 10 * 2 = 40 by norm_num] at h + exact h + +end Invariant233.BlockedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..0a2fc37f3e6d8637a0aee11dcc08d1a7227b3306 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalAttenuation.lean @@ -0,0 +1,204 @@ +import OAI.Analysis.IrrationalRotation.Rotation.ParameterCircleCocycle +import OAI.Analysis.IrrationalRotation.Couplings.FiniteConditionalAttenuation +import OAI.Analysis.IrrationalRotation.Analysis.TaggedThresholdCrossing + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Function Set +open scoped BigOperators + +namespace Invariant233.CircleWeights + +theorem cocycle_ratio_le_exp_of_crossing {ι : Type*} + (θ : ℝ) (q : ι → ℤ) (c : ι → ℝ) (k : ℤ) (x y : UnitAddCircle) (i : ι) + (hc : ∀ j, 0 ≤ c j) (horder : ∀ j, coordinate q j x ≤ coordinate q j y) + (hx : HasFiniteSupport (fun j => ⌊coordinate q j x + (k : ℝ) * phase θ q j⌋)) + (hy : HasFiniteSupport (fun j => ⌊coordinate q j y + (k : ℝ) * phase θ q j⌋)) + (hcross : coordinate q i x < 1 - Int.fract ((k : ℝ) * phase θ q i) ∧ + 1 - Int.fract ((k : ℝ) * phase θ q i) ≤ coordinate q i y) : + cocycle θ q c k y / cocycle θ q c k x ≤ Real.exp (-c i) := by + classical + have h := FiniteSupportCocycle.exp_tsum_floor_ratio_le_finite_crossings + (fun j => coordinate q j x) (fun j => coordinate q j y) + (fun j => (k : ℝ) * phase θ q j) c {i} + (fun j => coordinate_mem_Ico q j x) (fun j => coordinate_mem_Ico q j y) + hc horder hx hy (by simpa using hcross) + simpa only [cocycle, floorCost, Finset.sum_singleton] using h + +theorem ae_all_int_finite_floor_support_of_map_ac + {ι Ω : Type*} [Countable ι] [MeasurableSpace Ω] + (μ : Measure Ω) (θ : ℝ) (q : ι → ℤ) (hq : ∀ i, q i ≠ 0) + (hphase : Summable (phase θ q)) + (x : Ω → UnitAddCircle) (hx : AEMeasurable x μ) + (hac : μ.map x ≪ (volume : Measure UnitAddCircle)) : + ∀ᵐ ω ∂μ, ∀ k : ℤ, + HasFiniteSupport (fun i => ⌊coordinate q i (x ω) + (k : ℝ) * phase θ q i⌋) := by + apply ae_of_ae_map hx (p := fun z : UnitAddCircle => ∀ k : ℤ, + HasFiniteSupport (fun i => ⌊coordinate q i z + (k : ℝ) * phase θ q i⌋)) + exact hac.ae_le (CircleWeightSupport.ae_all_int_finite_floor_support q hq + (phase θ q) (phase_nonneg θ q) hphase) + +theorem ae_all_int_ratio_bounds_of_map_ac + {ι Ω : Type*} [Countable ι] [MeasurableSpace Ω] + (μ : Measure Ω) (θ : ℝ) (q : ι → ℤ) (hq : ∀ i, q i ≠ 0) + (hphase : Summable (phase θ q)) (c : ι → ℝ) (hc : ∀ i, 0 ≤ c i) + (x y : Ω → UnitAddCircle) (hx : AEMeasurable x μ) (hy : AEMeasurable y μ) + (hacx : μ.map x ≪ (volume : Measure UnitAddCircle)) + (hacy : μ.map y ≪ (volume : Measure UnitAddCircle)) + (horder : ∀ᵐ ω ∂μ, ∀ i, coordinate q i (x ω) ≤ coordinate q i (y ω)) : + ∀ᵐ ω ∂μ, ∀ k : ℤ, + cocycle θ q c k (y ω) / cocycle θ q c k (x ω) ≤ 1 ∧ + ∀ i, (coordinate q i (x ω) < 1 - Int.fract ((k : ℝ) * phase θ q i) ∧ + 1 - Int.fract ((k : ℝ) * phase θ q i) ≤ coordinate q i (y ω)) → + cocycle θ q c k (y ω) / cocycle θ q c k (x ω) ≤ Real.exp (-c i) := by + filter_upwards [ae_all_int_finite_floor_support_of_map_ac μ θ q hq hphase x hx hacx, + ae_all_int_finite_floor_support_of_map_ac μ θ q hq hphase y hy hacy, horder] + with ω hxs hys hord + intro k + refine ⟨?_, fun i hi => cocycle_ratio_le_exp_of_crossing θ q c k (x ω) (y ω) i + hc hord (hxs k) (hys k) hi⟩ + exact FiniteSupportCocycle.exp_tsum_floor_ratio_le_one + (fun i => coordinate q i (x ω)) (fun i => coordinate q i (y ω)) + (phase θ q) c k hc hord (hxs k) (hys k) + +theorem finite_conditional_attenuation_of_map_ac + {ι Ω : Type*} [Countable ι] + (mx my : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω] + (hmx : mx ≤ mΩ) (hmy : my ≤ mΩ) (μ : Measure Ω) [IsFiniteMeasure μ] + (θ : ℝ) (q : ι → ℤ) (hq : ∀ i, q i ≠ 0) + (hphase : Summable (phase θ q)) (c : ι → ℝ) (hc : ∀ i, 0 ≤ c i) + (k : ℤ) (I : Finset ι) + (x y : Ω → UnitAddCircle) (hx : Measurable[mx] x) (hy : Measurable[my] y) + (hacx : μ.map x ≪ (volume : Measure UnitAddCircle)) + (hacy : μ.map y ≪ (volume : Measure UnitAddCircle)) + (top bottom : ι → Set Ω) + (htop : ∀ i, MeasurableSet (top i)) (hbottom : ∀ i, MeasurableSet (bottom i)) + (hindTop : iCondIndepSet mx hmx top μ) (hindBottom : iCondIndepSet my hmy bottom μ) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) + (hI : m / 20 ≤ (I.card : ℝ)) (hcost : ∀ i ∈ I, L ≤ c i) + (horder : ∀ᵐ ω ∂μ, ∀ i, coordinate q i (x ω) ≤ coordinate q i (y ω)) + (hforceTop : ∀ᵐ ω ∂μ, ∀ i ∈ I, + coordinate q i (x ω) < 1 - Int.fract ((k : ℝ) * phase θ q i) → + ω ∈ top i → 1 - Int.fract ((k : ℝ) * phase θ q i) ≤ coordinate q i (y ω)) + (hforceBottom : ∀ᵐ ω ∂μ, ∀ i ∈ I, + 1 - Int.fract ((k : ℝ) * phase θ q i) ≤ coordinate q i (y ω) → + ω ∈ bottom i → coordinate q i (x ω) < 1 - Int.fract ((k : ℝ) * phase θ q i)) + (hprobTop : ∀ᵐ ω ∂μ, ∀ i ∈ I, + coordinate q i (x ω) < 1 - Int.fract ((k : ℝ) * phase θ q i) → + ρ / 10 ≤ (μ[(top i).indicator (fun _ => (1 : ℝ)) | mx]) ω) + (hprobBottom : ∀ᵐ ω ∂μ, ∀ i ∈ I, + 1 - Int.fract ((k : ℝ) * phase θ q i) ≤ coordinate q i (y ω) → + ρ / 10 ≤ (μ[(bottom i).indicator (fun _ => (1 : ℝ)) | my]) ω) : + ∃ H₁ H₂ : Set Ω, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂μ, (μ[H₁.indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂μ, (μ[H₂.indicator (fun _ => (1 : ℝ)) | my]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂μ, cocycle θ q c k (y ω) / cocycle θ q c k (x ω) ≤ + Real.exp (-L) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + have hxrep : Measurable[mx] (fun ω i => coordinate q i (x ω)) := by + let : MeasurableSpace Ω := mx + exact Measurable.of_eval (fun i => + (CircleWeightSupport.measurePreserving_characterRepresentative (q i) (hq i)).measurable.comp hx) + have hyrep : Measurable[my] (fun ω i => coordinate q i (y ω)) := by + let : MeasurableSpace Ω := my + exact Measurable.of_eval (fun i => + (CircleWeightSupport.measurePreserving_characterRepresentative (q i) (hq i)).measurable.comp hy) + have hr := ae_all_int_ratio_bounds_of_map_ac μ θ q hq hphase c hc x y + (hx.mono hmx le_rfl).aemeasurable (hy.mono hmy le_rfl).aemeasurable hacx hacy horder + apply CrossingAvoidance.finite_conditional_attenuation mx my hmx hmy μ I + (fun i => 1 - Int.fract ((k : ℝ) * phase θ q i)) + (fun ω i => coordinate q i (x ω)) (fun ω i => coordinate q i (y ω)) + hxrep hyrep top bottom htop hbottom hindTop hindBottom m ρ L hρ hL hI + (horder.mono (fun _ h i _ => h i)) hforceTop hforceBottom hprobTop hprobBottom + (fun ω => cocycle θ q c k (y ω) / cocycle θ q c k (x ω)) + (hr.mono (fun _ h => (h k).1)) + filter_upwards [hr] with ω hω + intro i hi hcross + exact ((hω k).2 i hcross).trans (Real.exp_le_exp.mpr (neg_le_neg (hcost i hi))) + +theorem ae_tagged_ratio_le_exp_of_map_ac + {ι Ω : Type*} [Countable ι] [MeasurableSpace Ω] + (μ : Measure Ω) (θ : ℝ) (q : ι → ℤ) (hq : ∀ i, q i ≠ 0) + (hphase : Summable (phase θ q)) (c : ι → ℝ) (hc : ∀ i, 0 ≤ c i) + (x y : Ω → UnitAddCircle) (hx : AEMeasurable x μ) (hy : AEMeasurable y μ) + (hacx : μ.map x ≪ (volume : Measure UnitAddCircle)) + (hacy : μ.map y ≪ (volume : Measure UnitAddCircle)) + (horder : ∀ᵐ ω ∂μ, ∀ i, coordinate q i (x ω) ≤ coordinate q i (y ω)) + (m K L : ℝ) (hm : 2 ≤ m) (hK : 0 < K) (k : ℤ) + (hklo : K < |(k : ℝ)|) (hkhi : |(k : ℝ)| ≤ m * K / 4) + (I : Finset ι) (hlo : ∀ i ∈ I, 1 / (m * K) < phase θ q i) + (hhi : ∀ i ∈ I, phase θ q i < 2 / (m * K)) (hcost : ∀ i ∈ I, L ≤ c i) + (E : Set Ω) (htag : ∀ᵐ ω ∂μ, ω ∈ E → ∃ i ∈ I, + coordinate q i (x ω) < 1 / m ∧ 1 - 1 / m < coordinate q i (y ω)) : + ∀ᵐ ω ∂μ, ω ∈ E → + cocycle θ q c k (y ω) / cocycle θ q c k (x ω) ≤ Real.exp (-L) := by + filter_upwards [ae_all_int_ratio_bounds_of_map_ac μ θ q hq hphase c hc x y + hx hy hacx hacy horder, htag] with ω hr ht + intro hE + obtain ⟨i, hi, hxi, hyi⟩ := ht hE + have hcross := FloorCocycle.tagged_crossing_of_window k hm hK + (hlo i hi) (hhi i hi) hklo hkhi hxi hyi + exact ((hr k).2 i hcross).trans (Real.exp_le_exp.mpr (neg_le_neg (hcost i hi))) + +end Invariant233.CircleWeights + +namespace Invariant233.CircleParameterLaws + +theorem ae_parameter_ratio_bounds_of_map_ac + {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (x y : Ω → Circle) (hx : AEMeasurable x μ) (hy : AEMeasurable y μ) + (hacx : μ.map x ≪ circleMeasure) (hacy : μ.map y ≪ circleMeasure) + (horder : ∀ᵐ ω ∂μ, ∀ i : p.Coord, p.coordinate i.2 (x ω) ≤ p.coordinate i.2 (y ω)) : + ∀ᵐ ω ∂μ, ∀ k : ℤ, + p.floorCocycle θ k (y ω) / p.floorCocycle θ k (x ω) ≤ 1 ∧ + ∀ i : p.Coord, + (p.coordinate i.2 (x ω) < 1 - Int.fract ((k : ℝ) * p.alpha θ i.2) ∧ + 1 - Int.fract ((k : ℝ) * p.alpha θ i.2) ≤ p.coordinate i.2 (y ω)) → + p.floorCocycle θ k (y ω) / p.floorCocycle θ k (x ω) ≤ Real.exp (-p.coordCost i) := by + have hord : ∀ᵐ ω ∂μ, ∀ i : p.Coord, + CircleWeights.coordinate p.coordFrequency i (x ω) ≤ + CircleWeights.coordinate p.coordFrequency i (y ω) := by + simpa only [p.coord_coordinate_eq] using horder + simpa only [CircleParameterData.floorCocycle, p.coord_coordinate_eq, p.coord_phase_eq] using + CircleWeights.ae_all_int_ratio_bounds_of_map_ac μ θ p.coordFrequency + hp.coordFrequency_ne_zero hp.summable_coord_phases p.coordCost + (fun i => (hp.coordCost_pos i).le) x y hx hy hacx hacy hord + +theorem ae_parameter_tagged_ratio_le_exp + {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (x y : Ω → Circle) (hx : AEMeasurable x μ) (hy : AEMeasurable y μ) + (hacx : μ.map x ≪ circleMeasure) (hacy : μ.map y ≪ circleMeasure) + (horder : ∀ᵐ ω ∂μ, ∀ i : p.Coord, p.coordinate i.2 (x ω) ≤ p.coordinate i.2 (y ω)) + (j : ℕ) (hj : 1 ≤ j) (k : ℤ) + (hklo : (p.K j : ℝ) < |(k : ℝ)|) (hkhi : |(k : ℝ)| ≤ p.N j / 4) + (E : Set Ω) (htag : ∀ᵐ ω ∂μ, ω ∈ E → ∃ i ∈ p.block j, + p.coordinate i (x ω) < 1 / (p.m j : ℝ) ∧ + 1 - 1 / (p.m j : ℝ) < p.coordinate i (y ω)) : + ∀ᵐ ω ∂μ, ω ∈ E → + p.floorCocycle θ k (y ω) / p.floorCocycle θ k (x ω) ≤ Real.exp (-p.L j) := by + filter_upwards [hp.ae_parameter_ratio_bounds_of_map_ac μ x y hx hy hacx hacy horder, + htag] with ω hr ht + intro hE + obtain ⟨i, hi, hxi, hyi⟩ := ht hE + have hj' : j - 1 + 1 = j := by omega + let a : p.Coord := ⟨j - 1, ⟨i, by simpa only [hj'] using hi⟩⟩ + have hm : (2 : ℝ) ≤ (p.m j : ℝ) := by exact_mod_cast (le_trans (by norm_num) (hp.m_ge_200 j hj)) + have hK : (0 : ℝ) < (p.K j : ℝ) := by exact_mod_cast hp.K_pos j hj + have hphase := hp.phase_bounds j hj i hi + have hcross := FloorCocycle.tagged_crossing_of_window k hm hK + hphase.1 hphase.2 hklo hkhi hxi hyi + have hratio := (hr k).2 a hcross + have hcost : p.L j ≤ p.coordCost a := by + change p.L j ≤ p.C (j - 1 + 1) + rw [hj', hp.C_eq j hj] + exact le_max_left _ _ + exact hratio.trans (Real.exp_le_exp.mpr (neg_le_neg hcost)) + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalConvolutionData.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalConvolutionData.lean new file mode 100644 index 0000000000000000000000000000000000000000..5bcc79ea77916f4da0244020956ba8b26f859eae --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalConvolutionData.lean @@ -0,0 +1,126 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CircleTruncationIntegral +import OAI.Analysis.IrrationalRotation.Rotation.CircleTailExceptionalFamilies +import OAI.Analysis.IrrationalRotation.Rotation.CircleOrderedTransfer +import OAI.Analysis.IrrationalRotation.Analysis.ParameterConvolutionIdentity +import OAI.Analysis.IrrationalRotation.Rotation.CircleObstruction + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped lp ComplexConjugate +namespace Invariant233.CircleCoupling +open InvariantProjection.ConditionalConvolution +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem conditionalData_of_truncation_mass + (j : ℕ) (hj : 1 ≤ j) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + {P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert} + (hmem : P ∈ Rotation.algebra θ) (hP : IsStarProjection P) + (hT : (1 - P) * p.measurableOperator θ hp * P = 0) + (F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber) + (hF : ∀ z, IsStarProjection (F z)) + (hFm : ∀ v : Rotation.Fiber, StronglyMeasurable (fun z => F z v)) + (hrep : ∀ ξ : Rotation.Hilbert, P ξ =ᵐ[circleMeasure] fun z => F z (ξ z)) + (c : ℝ) (hmass : c ≤ (law p j).real (truncationEvent p j hr + (fun z => ((F z ProjectionCocycleWindow.basisZero) 0).re))) : + Nonempty (Data Sample (law p j) (p.K j) (p.coefficientBound j) + (1 / (j : ℝ)) c (Real.exp (-p.L j)) (Real.exp (-p.L j / 400))) := by + classical + let := law_isProbabilityMeasure hp j + let r : Circle → ℝ := fun z => ((F z ProjectionCocycleWindow.basisZero) 0).re + let E := truncationEvent p j hr r + let ξ : Sample → Rotation.Fiber := fun ω => + F (point p hr false ω) ProjectionCocycleWindow.basisZero + let γ : Sample → Rotation.Fiber := fun ω => + (1 - F (point p hr true ω)) ProjectionCocycleWindow.basisZero + let Fx : Sample → ℤ → ℝ := fun ω k => p.floorCocycle θ k (point p hr false ω) + let Fy : Sample → ℤ → ℝ := fun ω k => p.floorCocycle θ k (point p hr true ω) + have hrm : Measurable r := Complex.continuous_re.measurable.comp + (((lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 0).continuous.comp_stronglyMeasurable + (hFm ProjectionCocycleWindow.basisZero)).measurable) + have hEm : MeasurableSet E := measurableSet_truncationEvent hp j hr hrm + obtain ⟨H₁, H₂, hm₁, hm₂, hc₁, hc₂, hatt⟩ := + tail_exceptional_families_of_subset hp j hj hr E hEm + (truncationEvent_subset_tagEvent p j hr r) + have hordered := orderedCouplingIdentities_of_rational hp hr F hF + (fun k => (hFm (lp.single 2 k 1)).measurable) + (hp.rational_graphs_of_representation hmem hP hT F hrep) j + have hbound := hordered.mono (fun _ h k => (h.2 k).2) + have hzero := hp.ae_parameter_convolution_absolute_and_zero (law p j) + (point p hr false) (point p hr true) (measurable_point hp hr true).aemeasurable + (endpoint_absolutelyContinuous hp j hr true) F hF hrep hT + (hordered.mono (fun _ h => h.1)) hbound + have hratio := hp.ae_parameter_convolution_ratio_bounds (law p j) + (point p hr false) (point p hr true) (measurable_point hp hr false).aemeasurable + (measurable_point hp hr true).aemeasurable + (endpoint_absolutelyContinuous hp j hr false) + (endpoint_absolutelyContinuous hp j hr true) hbound + have hγm : StronglyMeasurable (fun z => + (1 - F z) ProjectionCocycleWindow.basisZero) := by + have h : StronglyMeasurable + ((fun _ : Circle => ProjectionCocycleWindow.basisZero) - + fun z => F z ProjectionCocycleWindow.basisZero) := + stronglyMeasurable_const.sub (hFm ProjectionCocycleWindow.basisZero) + convert h using 1 + funext z + simp only [Pi.sub_apply, sub_apply, one_apply_eq_self] + refine ⟨{ + mX := endpointSigma p hr false + mY := endpointSigma p hr true + mX_le := (measurable_point hp hr false).comap_le + mY_le := (measurable_point hp hr true).comap_le + ξ := ξ + γ := γ + ξ_measurable := (hFm ProjectionCocycleWindow.basisZero).comp_measurable + (measurable_iff_comap_le.mpr le_rfl) + γ_measurable := hγm.comp_measurable (measurable_iff_comap_le.mpr le_rfl) + ξ_unit := Eventually.of_forall (fun ω => + ProjectionCocycleWindow.projection_vector_norm_le _ (hF _)) + γ_unit := Eventually.of_forall (fun ω => + ProjectionCocycleWindow.complement_vector_norm_le _ (hF _)) + Fx := Fx + Fy := Fy + Fx_measurable := fun k => (hp.measurable_parameter_cocycle k).comp + (measurable_point hp hr false) + Fy_measurable := fun k => (hp.measurable_parameter_cocycle k).comp + (measurable_point hp hr true) + Fx_pos := Eventually.of_forall (fun ω k => p.floorCocycle_pos θ k _) + Fy_pos := Eventually.of_forall (fun ω k => p.floorCocycle_pos θ k _) + Fx_zero := Eventually.of_forall (fun ω => p.floorCocycle_zero θ _) + Fy_zero := Eventually.of_forall (fun ω => p.floorCocycle_zero θ _) + zero_convolution := ?_ + ratio_bounds := fun n _ => hratio.mono (fun _ h => h n) + E := E + E_measurable := hEm + E_mass := hmass + coefficient_bounds := ?_ + H₁ := H₁ + H₂ := H₂ + H₁_measurable := hm₁ + H₂_measurable := hm₂ + attenuation := hatt + conditional₁ := hc₁ + conditional₂ := hc₂ }⟩ + · intro n _ + filter_upwards [hzero] with ω hω + exact (hω n ProjectionCocycleWindow.basisZero ProjectionCocycleWindow.basisZero).2 + · filter_upwards [ae_restrict_mem hEm, + ae_restrict_of_ae (ae_truncationEvent_exclusions hp j hj hr r)] with ω hω he + have he' := he hω + have hdiag := hω.2.2.2.2 + have hright : ((F (point p hr true ω) ProjectionCocycleWindow.basisZero) 0).re ≤ + 1 - 1 / (j : ℝ) := by + change 1 / (j : ℝ) ≤ 1 - ((F (point p hr true ω) + ProjectionCocycleWindow.basisZero) 0).re at hdiag + linarith + exact hp.canonical_projection_coefficient_properties j hj _ _ + (fun s hs i hi => (he' s hs i hi).1) (fun s hs i hi => (he' s hs i hi).2) + _ _ (hF _) (hF _) (1 / (j : ℝ)) hω.2.2.2.1 hright + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalLabels.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalLabels.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e629b80c2d0cf4c77755ec9b5bcc2769278691d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalLabels.lean @@ -0,0 +1,31 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleConditionalLabels +import OAI.Analysis.IrrationalRotation.Couplings.CircleConditionalProbabilities + +namespace OAI + +noncomputable section +namespace Invariant233.CircleCoupling + +theorem conditionalLabelLaws {θ : ℝ} {p : CircleParameterData} + (hp : CircleParameterLaws θ p) (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) : ConditionalLabelLaws p j hr where + probability := law_isProbabilityMeasure hp j + endpoint_measurable := measurable_point hp hr + independent := iCondIndepFun_labels_point hp j hr + finite_posterior := condExp_labels_point hp j hr + top_probability := fun _ hs _ hi which => ae_top_conditional_probability hp j hr hs hi which + bottom_probability := fun _ hs _ hi which => ae_bottom_conditional_probability hp j hr hs hi which + top_forcing := fun _ hs _ hi which => ae_top_forces hp j hr hs hi which + bottom_forcing := fun _ hs _ hi which => ae_bottom_forces hp j hr hs hi which + +theorem exists_conditionalLabelLaws {θ : ℝ} {p : CircleParameterData} + (hp : CircleParameterLaws θ p) (j : ℕ) : + ∃ hr : ∀ i, 0 < MixedRadix.radices p.q i, ConditionalLabelLaws p j hr := + ⟨MixedRadix.radices_pos hp.q_pos hp.frequency_increasing hp.frequency_divisible, + conditionalLabelLaws hp j _⟩ + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalProbabilities.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalProbabilities.lean new file mode 100644 index 0000000000000000000000000000000000000000..02e4750de172099bca42e6c2ecd3d79b4a3df092 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleConditionalProbabilities.lean @@ -0,0 +1,53 @@ +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingForcing + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal ProbabilityTheory +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData OneCoordinateCoupling CouplingMarginalBounds +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma ae_top_conditional_probability (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) (which : Bool) : + ∀ᵐ ω ∂law p j, ∀ u : ℝ, + p.coordinate i (point p hr false ω) < u → u ≤ 1 - width (p.a s) (p.b s) which → + rho (kappa s) (p.m s) (width (p.a s) (p.b s) which) / 10 ≤ + ((law p j)⟦label i ⁻¹' {topLabel which} | + MeasurableSpace.comap (point p hr false) inferInstance⟧) ω := by + let := posterior_isMarkov hp j false i + have hρ0 : 0 ≤ rho (kappa s) (p.m s) (width (p.a s) (p.b s) which) := + rho_nonneg (CircleParameterLaws.coupling_kappa_bounds s hs).1 + filter_upwards [ae_top_posterior_lower hp j hr hs hi which, + condExp_single_label_point hp j hr false i (topLabel which)] with ω hlo heq + intro u hxu hu + rw [heq] + have h := ENNReal.toReal_mono (measure_ne_top _ _) (hlo u hxu hu) + simpa only [measureReal_def, ENNReal.toReal_div, ENNReal.toReal_ofReal hρ0, + ENNReal.toReal_ofNat] using h + +lemma ae_bottom_conditional_probability (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) (which : Bool) : + ∀ᵐ ω ∂law p j, ∀ u : ℝ, + u ≤ p.coordinate i (point p hr true ω) → width (p.a s) (p.b s) which ≤ u → + rho (kappa s) (p.m s) (width (p.a s) (p.b s) which) / 10 ≤ + ((law p j)⟦label i ⁻¹' {bottomLabel which} | + MeasurableSpace.comap (point p hr true) inferInstance⟧) ω := by + let := posterior_isMarkov hp j true i + have hρ0 : 0 ≤ rho (kappa s) (p.m s) (width (p.a s) (p.b s) which) := + rho_nonneg (CircleParameterLaws.coupling_kappa_bounds s hs).1 + filter_upwards [ae_bottom_posterior_lower hp j hr hs hi which, + condExp_single_label_point hp j hr true i (bottomLabel which)] with ω hlo heq + intro u huy hu + rw [heq] + have h := ENNReal.toReal_mono (measure_ne_top _ _) (hlo u huy hu) + simpa only [measureReal_def, ENNReal.toReal_div, ENNReal.toReal_ofReal hρ0, + ENNReal.toReal_ofNat] using h + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..d0fc88da0e7ad1e079c4b6db4bfe0595484126d2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCoupling.lean @@ -0,0 +1,3 @@ +import OAI.Analysis.IrrationalRotation.Couplings.CircleConditionalLabels + + diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..4501fe2a0cbed99df84734d2a10b56226ba8d7e9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingAttenuation.lean @@ -0,0 +1,85 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleTailAttenuation +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingTagSupport +import OAI.Analysis.IrrationalRotation.Couplings.ConditionalAvoidance +import OAI.Analysis.IrrationalRotation.Analysis.ParameterTailAttenuation + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal + +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData CouplingMarginalBounds +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +omit hp in +lemma measurableSet_tagEvent (p : CircleParameterData) (j : ℕ) : + MeasurableSet (tagEvent p j) := by + simp only [tagEvent, Set.ofPred_exists] + apply MeasurableSet.iUnion + intro i + by_cases hi : i ∈ p.block j + · simpa only [hi, true_and] using + (measurableSet_eq_fun (measurable_label i) (measurable_const (a := (some 4 : Label)))) + · simp only [hi, false_and, Set.ofPred_false, MeasurableSet.empty] + +lemma actual_tail_attenuation_of_ac_order (j : ℕ) (hj : 1 ≤ j) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (hac : ∀ side, (law p j).map (point p hr side) ≪ circleMeasure) + (horder : ∀ᵐ ω ∂law p j, ∀ i : p.Coord, + p.coordinate i.2 (point p hr false ω) ≤ p.coordinate i.2 (point p hr true ω)) : + TailAttenuation θ p j hr := by + let := law_isProbabilityMeasure hp j + have hpoint (side : Bool) : Measurable[endpointSigma p hr side] (point p hr side) := + Measurable.of_comap_le le_rfl + have hle (side : Bool) : endpointSigma p hr side ≤ (inferInstance : MeasurableSpace Sample) := + (measurable_point hp hr side).comap_le + let top : Bool → ℕ → Set Sample := fun which i => label i ⁻¹' {topLabel which} + let bottom : Bool → ℕ → Set Sample := fun which i => label i ⁻¹' {bottomLabel which} + have ht (which : Bool) (i : ℕ) : MeasurableSet (top which i) := + (measurable_label i) (measurableSet_singleton _) + have hb (which : Bool) (i : ℕ) : MeasurableSet (bottom which i) := + (measurable_label i) (measurableSet_singleton _) + have hindt (which : Bool) : iCondIndepSet (endpointSigma p hr false) (hle false) + (top which) (law p j) := + ConditionalAvoidance.iCondIndepSet_preimages (hle false) label measurable_label + (iCondIndepFun_labels_point hp j hr false) (fun _ => {topLabel which}) + (fun _ => measurableSet_singleton _) + have hindb (which : Bool) : iCondIndepSet (endpointSigma p hr true) (hle true) + (bottom which) (law p j) := + ConditionalAvoidance.iCondIndepSet_preimages (hle true) label measurable_label + (iCondIndepFun_labels_point hp j hr true) (fun _ => {bottomLabel which}) + (fun _ => measurableSet_singleton _) + intro k hk + apply hp.parameter_tail_conditional_attenuation (endpointSigma p hr false) + (endpointSigma p hr true) (hle false) (hle true) (law p j) + (point p hr false) (point p hr true) (hpoint false) (hpoint true) + (hac false) (hac true) horder top bottom ht hb hindt hindb j hj + · intro s hjs which i hi u hu + have hs : 1 ≤ s := hj.trans hjs + filter_upwards [ae_top_forces hp j hr hs hi which, + ae_bottom_forces hp j hr hs hi which, + ae_top_conditional_probability hp j hr hs hi which, + ae_bottom_conditional_probability hp j hr hs hi which] + with ω htforce hbforce htprob hbprob + refine ⟨?_, ?_, ?_, ?_⟩ + · intro _hxu hl + exact htforce u hl hu.2 + · intro _huy hl + exact hbforce u hl hu.1 + · intro hxu + exact htprob u hxu hu.2 + · intro huy + exact hbprob u huy hu.1 + · filter_upwards [ae_all_tag_coordinate_support hp j hr] with ω hω + rintro ⟨i, hi, htag⟩ + exact ⟨i, hi, hω j hj i hi htag⟩ + · exact hk + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingCocycleLaws.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingCocycleLaws.lean new file mode 100644 index 0000000000000000000000000000000000000000..678e00bdbda8c68a5cf0e6227141bc9cc9029f24 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingCocycleLaws.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CircleTailAttenuation +import OAI.Analysis.IrrationalRotation.Analysis.ConvolutionRatios + +namespace OAI + +noncomputable section +open MeasureTheory Set Function +namespace Invariant233.CircleCoupling +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma ae_point_finite_floor_support (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) : + ∀ᵐ ω ∂law p j, ∀ k : ℤ, HasFiniteSupport (fun i : p.Coord => + Int.floor (p.coordinate i.2 (point p hr side ω) + (k : ℝ) * p.alpha θ i.2)) := by + have h := CircleWeights.ae_all_int_finite_floor_support_of_map_ac (law p j) + θ p.coordFrequency hp.coordFrequency_ne_zero hp.summable_coord_phases + (point p hr side) (measurable_point hp hr side).aemeasurable + (endpoint_absolutelyContinuous hp j hr side) + simpa only [p.coord_coordinate_eq, p.coord_phase_eq] using h + +lemma ae_point_cocycle_antitone (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) : + ∀ᵐ ω ∂law p j, Antitone (fun k : ℤ => p.floorCocycle θ k (point p hr side ω)) := + (ae_point_finite_floor_support hp j hr side).mono + (fun _ h => hp.parameter_cocycle_antitone _ h) + +lemma ae_cocycle_two_ratio_bounds (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) : + ∀ᵐ ω ∂law p j, ∀ n : ℕ, ∀ v : ℤ, + 0 < p.floorCocycle θ ((n : ℤ) + v) (point p hr true ω) / + p.floorCocycle θ v (point p hr false ω) ∧ + p.floorCocycle θ ((n : ℤ) + v) (point p hr true ω) / + p.floorCocycle θ v (point p hr false ω) ≤ + min (p.floorCocycle θ v (point p hr true ω) / + p.floorCocycle θ v (point p hr false ω)) + (p.floorCocycle θ ((n : ℤ) + v) (point p hr true ω) / + p.floorCocycle θ ((n : ℤ) + v) (point p hr false ω)) ∧ + min (p.floorCocycle θ v (point p hr true ω) / + p.floorCocycle θ v (point p hr false ω)) + (p.floorCocycle θ ((n : ℤ) + v) (point p hr true ω) / + p.floorCocycle θ ((n : ℤ) + v) (point p hr false ω)) ≤ 1 := by + have hratio := hp.ae_parameter_ratio_bounds_of_map_ac (law p j) + (point p hr false) (point p hr true) (measurable_point hp hr false).aemeasurable + (measurable_point hp hr true).aemeasurable (endpoint_absolutelyContinuous hp j hr false) + (endpoint_absolutelyContinuous hp j hr true) + ((ae_coordinates_ordered hp j hr).mono (fun _ h i => h i.2)) + filter_upwards [ae_point_cocycle_antitone hp j hr false, + ae_point_cocycle_antitone hp j hr true, hratio] with ω hx hy hxy + intro n v + exact InvariantProjection.cocycle_two_ratio_bounds _ _ + (fun k => p.floorCocycle_pos θ k _) (fun k => p.floorCocycle_pos θ k _) + hx hy (fun k => (hxy k).1) n v + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingConditioning.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingConditioning.lean new file mode 100644 index 0000000000000000000000000000000000000000..1bb48d040ded285d40d9f32b13b1d68c514dcc6d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingConditioning.lean @@ -0,0 +1,84 @@ +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingDisintegration +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingNonterminal +import OAI.Analysis.IrrationalRotation.Couplings.ConditionalObservationTransport +import OAI.Analysis.IrrationalRotation.Sampling.MixedRadixTransport + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal BigOperators ProbabilityTheory +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData OneCoordinateCoupling +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma measurable_point (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) : + Measurable (point p hr side) := + (MixedRadix.measurable_circleValue + (MixedRadix.radices_ge_two hp.q_pos hp.frequency_increasing hp.frequency_divisible)).comp + (measurable_digits hr side) + +lemma ae_recover_digits (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) : + ∀ᵐ ω ∂law p j, MixedRadix.circleCanonical (MixedRadix.radices p.q) hr + (point p hr side ω) = digits p hr side ω := by + filter_upwards [ae_nonterminal_digits hp j hr side] with ω hω + exact MixedRadix.circleCanonical_circleValue hr _ hω + +lemma iCondIndepFun_labels_point (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) : + letI := law_isProbabilityMeasure hp j + iCondIndepFun (MeasurableSpace.comap (point p hr side) inferInstance) + (measurable_point hp hr side).comap_le label (law p j) := by + let := law_isProbabilityMeasure hp j + exact (ConditionalObservationTransport.iCondIndepFun_encoding_iff + (measurable_digits hr side) + (MixedRadix.measurable_circleValue + (MixedRadix.radices_ge_two hp.q_pos hp.frequency_increasing hp.frequency_divisible)) + (MixedRadix.measurable_circleCanonical _ hr) (ae_recover_digits hp j hr side) + label measurable_label).2 (iCondIndepFun_labels_digits hp j hr side) + +lemma condExp_labels_digits (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) + (S : Finset ℕ) (C : ℕ → Set Label) (hC : ∀ i, MeasurableSet (C i)) : + (law p j)⟦(⋂ i ∈ S, label i ⁻¹' C i) | + MeasurableSpace.comap (digits p hr side) inferInstance⟧ =ᵐ[law p j] + (fun ω => ∏ i ∈ S, (posterior p j side i (digits p hr side ω i)).real (C i)) := by + let := coordinateLaw_isProbabilityMeasure hp j + let := posterior_isMarkov hp j side + exact CoordinateConditioning.condExp_label_inter_of_disintegration (coordinateLaw p j) + S (observedDigit p hr side) (measurable_observedDigit hr side) + (fun _ => Prod.fst) (fun _ => measurable_fst) (posterior p j side) + (fun i => (posterior_disintegration hp j hr side i).symm) C hC + +lemma condExp_labels_point (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) + (S : Finset ℕ) (C : ℕ → Set Label) (hC : ∀ i, MeasurableSet (C i)) : + (law p j)⟦(⋂ i ∈ S, label i ⁻¹' C i) | + MeasurableSpace.comap (point p hr side) inferInstance⟧ =ᵐ[law p j] + (fun ω => ∏ i ∈ S, (posterior p j side i + (MixedRadix.circleCanonical (MixedRadix.radices p.q) hr (point p hr side ω) i)).real (C i)) := by + let := law_isProbabilityMeasure hp j + have he := ConditionalObservationTransport.condExp_encoding + (measurable_digits hr side) + (MixedRadix.measurable_circleValue + (MixedRadix.radices_ge_two hp.q_pos hp.frequency_increasing hp.frequency_divisible)) + (MixedRadix.measurable_circleCanonical _ hr) (ae_recover_digits hp j hr side) + ((⋂ i ∈ S, label i ⁻¹' C i).indicator (fun _ => (1 : ℝ))) + refine he.trans ((condExp_labels_digits hp j hr side S C hC).trans ?_) + filter_upwards [ae_recover_digits hp j hr side] with ω hω + rw [hω] + +lemma condExp_single_label_point (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) (i : ℕ) (l : Label) : + (law p j)⟦label i ⁻¹' {l} | MeasurableSpace.comap (point p hr side) inferInstance⟧ =ᵐ[law p j] + (fun ω => (posterior p j side i + (MixedRadix.circleCanonical (MixedRadix.radices p.q) hr (point p hr side ω) i)).real {l}) := by + simpa using condExp_labels_point hp j hr side {i} (fun _ => {l}) + (fun _ => measurableSet_singleton l) + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingCrossings.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingCrossings.lean new file mode 100644 index 0000000000000000000000000000000000000000..99b1a17e9d3e1a49ef11885ed39ded8f3e3418ee --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingCrossings.lean @@ -0,0 +1,92 @@ +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingConditioning +import OAI.Analysis.IrrationalRotation.Sampling.CircleCharacterDynamics + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData OneCoordinateCoupling +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma coordinate_point_eq_tail (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (side : Bool) (ω : Sample) (hnt : MixedRadix.Nonterminal (digits p hr side ω)) (i : ℕ) : + p.coordinate i (point p hr side ω) = MixedRadix.tailValue (digits p hr side ω) i := by + unfold coordinate point MixedRadix.circleValue + rw [← AddCircle.coe_nsmul, nsmul_eq_mul] + change CircleParameterData.rep (((p.q i : ℝ) * MixedRadix.ofDigits (digits p hr side ω) : ℝ) : Circle) = _ + rw [show CircleParameterData.rep = (fun x : Circle => (AddCircle.equivIco (1 : ℝ) 0 x : ℝ)) from rfl, + CircleCharacterDynamics.representative_coe] + exact MixedRadix.coordinate_eq_tailValue hp.frequency_zero hp.q_pos + hp.frequency_increasing hp.frequency_divisible _ hnt i + +lemma coordinate_point_mem_bin (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (side : Bool) (ω : Sample) (hnt : MixedRadix.Nonterminal (digits p hr side ω)) (i : ℕ) : + p.coordinate i (point p hr side ω) ∈ bin (MixedRadix.radices p.q i) (digits p hr side ω i) := by + rw [coordinate_point_eq_tail hp hr side ω hnt i] + have h0 := (MixedRadix.tailValue_mem_bin hr (digits p hr side ω) i).1 + refine ⟨h0, ?_⟩ + change MixedRadix.tailValue (digits p hr side ω) i < _ + rw [MixedRadix.tailValue_rec hr] + apply div_lt_div_of_pos_right _ (by exact_mod_cast hr i) + linarith [MixedRadix.tailValue_lt_one hr (digits p hr side ω) hnt (i + 1)] + +lemma ae_top_posterior_lower (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) (which : Bool) : + ∀ᵐ ω ∂law p j, ∀ u : ℝ, + p.coordinate i (point p hr false ω) < u → u ≤ 1 - width (p.a s) (p.b s) which → + ENNReal.ofReal (CouplingMarginalBounds.rho (kappa s) (p.m s) (width (p.a s) (p.b s) which)) / 10 ≤ + posterior p j false i + (MixedRadix.circleCanonical (MixedRadix.radices p.q) hr (point p hr false ω) i) + {topLabel which} := by + have hi0 : i ≠ 0 := by have := (p.mem_block_iff s i).mp hi; omega + have hidx := p.blockIndex_eq_of_mem hp.m_pos hi + have hm : (100 : ℝ) ≤ p.m s := by exact_mod_cast (show 100 ≤ p.m s by have := hp.m_ge_200 s hs; omega) + have ha := hp.coupling_a_bounds s hs + have hb := hp.coupling_b_bounds s hs + have hκ := CircleParameterLaws.coupling_kappa_bounds s hs + have hw : 1 / (p.m s : ℝ) ≤ width (p.a s) (p.b s) which := by + cases which + · exact ha.1 + · exact hb.1 + let : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + filter_upwards [ae_nonterminal_digits hp j hr false, ae_recover_digits hp j hr false] with ω hnt hrec + intro u hxu hu + rw [hrec, posterior, ite_eq_right hi0, hidx] + exact top_posterior_lower hκ.1 hκ.2 hm ha.1 ha.2 hb.1 hb.2 + (tag_bounds j s).1 (tag_bounds j s).2 _ _ which + (coordinate_point_mem_bin hp hr false ω hnt i) hxu hu (hp.coupling_bin_small hs hi hw) + +lemma ae_bottom_posterior_lower (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) (which : Bool) : + ∀ᵐ ω ∂law p j, ∀ u : ℝ, + u ≤ p.coordinate i (point p hr true ω) → width (p.a s) (p.b s) which ≤ u → + ENNReal.ofReal (CouplingMarginalBounds.rho (kappa s) (p.m s) (width (p.a s) (p.b s) which)) / 10 ≤ + posterior p j true i + (MixedRadix.circleCanonical (MixedRadix.radices p.q) hr (point p hr true ω) i) + {bottomLabel which} := by + have hi0 : i ≠ 0 := by have := (p.mem_block_iff s i).mp hi; omega + have hidx := p.blockIndex_eq_of_mem hp.m_pos hi + have hm : (100 : ℝ) ≤ p.m s := by exact_mod_cast (show 100 ≤ p.m s by have := hp.m_ge_200 s hs; omega) + have ha := hp.coupling_a_bounds s hs + have hb := hp.coupling_b_bounds s hs + have hκ := CircleParameterLaws.coupling_kappa_bounds s hs + have hw : 1 / (p.m s : ℝ) ≤ width (p.a s) (p.b s) which := by + cases which + · exact ha.1 + · exact hb.1 + let : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + filter_upwards [ae_nonterminal_digits hp j hr true, ae_recover_digits hp j hr true] with ω hnt hrec + intro u huy hu + rw [hrec, posterior, ite_eq_right hi0, hidx] + exact bottom_posterior_lower hκ.1 hκ.2 hm ha.1 ha.2 hb.1 hb.2 + (tag_bounds j s).1 (tag_bounds j s).2 _ _ which + (coordinate_point_mem_bin hp hr true ω hnt i) huy hu (hp.coupling_bin_small hs hi hw) + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingDisintegration.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingDisintegration.lean new file mode 100644 index 0000000000000000000000000000000000000000..de967c8394d42decc01f28ee1677e9fdfdee0e83 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingDisintegration.lean @@ -0,0 +1,55 @@ +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingLaw + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData OneCoordinateCoupling + +lemma initial_disintegration {D : Type*} [MeasurableSpace D] + (f : CoordinateSample → D) (hf : Measurable f) : + (initialLaw.map f) ⊗ₘ Kernel.const D (Measure.dirac (none : Label)) = + initialLaw.map (fun z => (f z, z.1)) := by + let := initialLaw_isProbabilityMeasure + rw [Measure.compProd_const, Measure.prod_dirac, + Measure.map_map (show Measurable (fun d : D => (d, (none : Label))) from by fun_prop) hf] + simp only [Function.comp_def] + unfold initialLaw + have hin : Measurable (fun x : ℝ => ((none : Label), (x, x))) := by fun_prop + rw [Measure.map_map (show Measurable (fun z : CoordinateSample => (f z, (none : Label))) from by fun_prop) hin, + Measure.map_map (show Measurable (fun z : CoordinateSample => (f z, z.1)) from by fun_prop) hin] + rfl + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma posterior_disintegration (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) (i : ℕ) : + ((coordinateLaw p j i).map (observedDigit p hr side i)) ⊗ₘ posterior p j side i = + (coordinateLaw p j i).map (fun z => (observedDigit p hr side i z, z.1)) := by + by_cases hi : i = 0 + · simpa only [coordinateLaw, posterior, ite_eq_left hi] using + initial_disintegration (observedDigit p hr side i) (measurable_observedDigit hr side i) + have hs := p.blockIndex_pos hp.m_pos (show 1 ≤ i by omega) + have hm : (100 : ℝ) ≤ p.m (p.blockIndex i) := by + exact_mod_cast (show 100 ≤ p.m (p.blockIndex i) by have := hp.m_ge_200 _ hs; omega) + let : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + have hd := labelsGivenDigit_disintegration hm + (hp.coupling_a_bounds _ hs).1 (hp.coupling_a_bounds _ hs).2 + (hp.coupling_b_bounds _ hs).1 (hp.coupling_b_bounds _ hs).2 + (CircleParameterLaws.coupling_kappa_bounds _ hs).1 + (CircleParameterLaws.coupling_kappa_bounds _ hs).2 + (tag_bounds j (p.blockIndex i)).1 (tag_bounds j (p.blockIndex i)).2 side (MixedRadix.radices p.q i) + have ho : observedDigit p hr side i = (fun z => + UniformQuantization.quantize (MixedRadix.radices p.q i) (endpoint side z)) := rfl + rw [digitJoint, + Measure.fst_map_prodMk (ho ▸ measurable_observedDigit hr side i) measurable_fst] at hd + simpa only [coordinateLaw, posterior, ite_eq_right hi, ho, digitJoint] using hd + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingForcing.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingForcing.lean new file mode 100644 index 0000000000000000000000000000000000000000..a0eb78242e0e118de21682d68d844616c46824c5 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingForcing.lean @@ -0,0 +1,96 @@ +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingSupport + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData OneCoordinateCoupling +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma ae_endpoint_unit (j : ℕ) (i : ℕ) (side : Bool) : + ∀ᵐ ω ∂law p j, endpoint side (ω i) ∈ Ico (0 : ℝ) 1 := by + let := coordinateLaw_isProbabilityMeasure hp j + apply (measurePreserving_eval_infinitePi (coordinateLaw p j) i).quasiMeasurePreserving.ae + (p := fun z => endpoint side z ∈ Ico (0 : ℝ) 1) + by_cases hi : i = 0 + · rw [coordinateLaw, ite_eq_left hi, initialLaw] + apply (ae_map_iff (show Measurable (fun x : ℝ => ((none : Label), (x, x))) from by fun_prop).aemeasurable + (show MeasurableSet {z : CoordinateSample | endpoint side z ∈ Ico (0 : ℝ) 1} from by + apply measurableSet_Ico.preimage + cases side + · exact measurable_fst.comp measurable_snd + · exact measurable_snd.comp measurable_snd)).2 + cases side <;> exact CouplingMixture.intervalLaw_ae_mem 0 1 + · have hs := p.blockIndex_pos hp.m_pos (show 1 ≤ i by omega) + have hm : (100 : ℝ) ≤ p.m (p.blockIndex i) := by exact_mod_cast + (show 100 ≤ p.m (p.blockIndex i) by have := hp.m_ge_200 _ hs; omega) + rw [coordinateLaw, ite_eq_right hi] + exact rawLaw_ae_endpoint_unit hm (hp.coupling_a_bounds _ hs).1 (hp.coupling_a_bounds _ hs).2 + (hp.coupling_b_bounds _ hs).1 (hp.coupling_b_bounds _ hs).2 side + +lemma ae_rounding_bound (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (i : ℕ) (side : Bool) : + ∀ᵐ ω ∂law p j, |p.coordinate i (point p hr side ω) - endpoint side (ω i)| ≤ + 1 / (MixedRadix.radices p.q i : ℝ) := by + let : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + filter_upwards [ae_endpoint_unit hp j i side, ae_nonterminal_digits hp j hr side] with ω hunit hnt + have hraw : endpoint side (ω i) ∈ bin _ (digits p hr side ω i) := + (UniformQuantization.quantize_eq_iff _ hunit).mp rfl + exact (abs_sub_lt_bin_width _ (coordinate_point_mem_bin hp hr side ω hnt i) hraw).le + +lemma ae_top_raw_support (j : ℕ) {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) (which : Bool) : + ∀ᵐ ω ∂law p j, label i ω = topLabel which → + 1 - width (p.a s) (p.b s) which / 2 ≤ (ω i).2.2 := by + let := coordinateLaw_isProbabilityMeasure hp j + apply (measurePreserving_eval_infinitePi (coordinateLaw p j) i).quasiMeasurePreserving.ae + (p := fun z => z.1 = topLabel which → 1 - width (p.a s) (p.b s) which / 2 ≤ z.2.2) + have hi0 : i ≠ 0 := by have := (p.mem_block_iff s i).mp hi; omega + rw [coordinateLaw, ite_eq_right hi0, p.blockIndex_eq_of_mem hp.m_pos hi] + have hm : (100 : ℝ) ≤ p.m s := by exact_mod_cast (show 100 ≤ p.m s by have := hp.m_ge_200 s hs; omega) + exact rawLaw_ae_top_support hm (hp.coupling_a_bounds s hs).1 (hp.coupling_a_bounds s hs).2 + (hp.coupling_b_bounds s hs).1 (hp.coupling_b_bounds s hs).2 which + +lemma ae_bottom_raw_support (j : ℕ) {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) (which : Bool) : + ∀ᵐ ω ∂law p j, label i ω = bottomLabel which → + (ω i).2.1 < width (p.a s) (p.b s) which / 2 := by + let := coordinateLaw_isProbabilityMeasure hp j + apply (measurePreserving_eval_infinitePi (coordinateLaw p j) i).quasiMeasurePreserving.ae + (p := fun z => z.1 = bottomLabel which → z.2.1 < width (p.a s) (p.b s) which / 2) + have hi0 : i ≠ 0 := by have := (p.mem_block_iff s i).mp hi; omega + rw [coordinateLaw, ite_eq_right hi0, p.blockIndex_eq_of_mem hp.m_pos hi] + have hm : (100 : ℝ) ≤ p.m s := by exact_mod_cast (show 100 ≤ p.m s by have := hp.m_ge_200 s hs; omega) + exact rawLaw_ae_bottom_support hm (hp.coupling_a_bounds s hs).1 (hp.coupling_a_bounds s hs).2 + (hp.coupling_b_bounds s hs).1 (hp.coupling_b_bounds s hs).2 which + +lemma ae_top_forces (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) (which : Bool) : + ∀ᵐ ω ∂law p j, ∀ u : ℝ, label i ω = topLabel which → + u ≤ 1 - width (p.a s) (p.b s) which → u ≤ p.coordinate i (point p hr true ω) := by + have hw : 1 / (p.m s : ℝ) ≤ width (p.a s) (p.b s) which := by + cases which + · exact (hp.coupling_a_bounds s hs).1 + · exact (hp.coupling_b_bounds s hs).1 + filter_upwards [ae_top_raw_support hp j hs hi which, ae_rounding_bound hp j hr i true] with ω hsupp hround + intro u hl hu + exact top_forces_crossing (hsupp hl) hround (hp.coupling_bin_small hs hi hw) hu + +lemma ae_bottom_forces (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) (which : Bool) : + ∀ᵐ ω ∂law p j, ∀ u : ℝ, label i ω = bottomLabel which → + width (p.a s) (p.b s) which ≤ u → p.coordinate i (point p hr false ω) < u := by + have hw : 1 / (p.m s : ℝ) ≤ width (p.a s) (p.b s) which := by + cases which + · exact (hp.coupling_a_bounds s hs).1 + · exact (hp.coupling_b_bounds s hs).1 + filter_upwards [ae_bottom_raw_support hp j hs hi which, ae_rounding_bound hp j hr i false] with ω hsupp hround + intro u hl hu + exact bottom_forces_crossing (hsupp hl) hround (hp.coupling_bin_small hs hi hw) hu + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingHybrid.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingHybrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..42ce528a8967f3dd879ec330bc9fc4b29c66c47e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingHybrid.lean @@ -0,0 +1,137 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleOrderedCoupling +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingOrder +import OAI.Analysis.IrrationalRotation.Sampling.CircleDigitMarginalLaws +import OAI.Analysis.IrrationalRotation.Analysis.L2UniformAbsoluteContinuity +import OAI.Analysis.IrrationalRotation.Analysis.UniformAbsoluteContinuity +import OAI.Analysis.IrrationalRotation.Rotation.ParameterCircleCocycle +import OAI.Analysis.IrrationalRotation.Analysis.InfiniteRatioCaps + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal Topology +namespace Invariant233.CircleCoupling +open CircleParameterData +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +omit hp in +lemma finiteHybridPoint_eq (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (N : ℕ) (ω : Sample) : + finiteHybridPoint p hr N ω = MixedRadix.circleValue + (MixedRadix.hybrid (digits p hr false ω) (digits p hr true ω) (N + 1)) := by + change MixedRadix.circleValue (hybridDigits p hr (finiteHybridChoice N) ω) = _ + congr 1 + funext i + simp only [hybridDigits, finiteHybridChoice, MixedRadix.hybrid] + by_cases hi : i < N + 1 <;> simp [hi, digits] + +lemma measurable_finiteHybridPoint (hr : ∀ i, 0 < MixedRadix.radices p.q i) (N : ℕ) : + Measurable (finiteHybridPoint p hr N) := measurable_hybridPoint hp hr _ + +lemma tendsto_finiteHybridPoint (hr : ∀ i, 0 < MixedRadix.radices p.q i) (ω : Sample) : + Tendsto (fun N => finiteHybridPoint p hr N ω) atTop (𝓝 (point p hr true ω)) := by + simp_rw [finiteHybridPoint_eq] + exact (MixedRadix.tendsto_circleValue_hybrid + (MixedRadix.radices_ge_two hp.q_pos hp.frequency_increasing hp.frequency_divisible) + (digits p hr false ω) (digits p hr true ω)).comp (tendsto_add_atTop_nat 1) + +lemma uniformlyAbsolutelyContinuous_hybrids + (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) : + UniformlyAbsolutelyContinuous circleMeasure + (fun ε : ℕ → Bool => (law p j).map (hybridPoint p hr ε)) := by + apply EndpointLoss.uniformlyAbsolutelyContinuous_of_Lp_densities + circleMeasure _ marginalBound + intro ε + obtain ⟨H, hH, hn, _, hb, he⟩ := (digitMarginalLaws hp hr).2 j ε + change MemLp H 2 circleMeasure at hH + change (0 ≤ᵐ[circleMeasure] H) at hn + change eLpNorm H 2 circleMeasure ≤ ENNReal.ofReal marginalBound at hb + change (law p j).map (hybridPoint p hr ε) = + circleMeasure.withDensity (fun x => ENNReal.ofReal (H x)) at he + refine ⟨hH.toLp H, ?_, ?_, ?_⟩ + · filter_upwards [hH.coeFn_toLp, hn] with x hx hnx + rwa [hx] + · rw [he] + apply withDensity_congr_ae + filter_upwards [hH.coeFn_toLp] with x hx + rw [hx] + · rw [Lp.norm_toLp] + exact ENNReal.toReal_le_of_le_ofReal (Real.exp_pos _).le hb + +lemma hybridPoint_absolutelyContinuous (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (ε : ℕ → Bool) : + (law p j).map (hybridPoint p hr ε) ≪ circleMeasure := + (uniformlyAbsolutelyContinuous_hybrids hp j hr).absolutelyContinuous ε + +lemma point_absolutelyContinuous (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) : + (law p j).map (point p hr side) ≪ circleMeasure := + hybridPoint_absolutelyContinuous hp j hr (fun _ => side) + +lemma coordinate_circleValue_eq_tail + (_hr : ∀ i, 0 < MixedRadix.radices p.q i) + (d : MixedRadix.Digits (MixedRadix.radices p.q)) (hd : MixedRadix.Nonterminal d) (i : ℕ) : + p.coordinate i (MixedRadix.circleValue d) = MixedRadix.tailValue d i := by + unfold coordinate MixedRadix.circleValue + rw [← AddCircle.coe_nsmul, nsmul_eq_mul] + change CircleParameterData.rep (((p.q i : ℝ) * MixedRadix.ofDigits d : ℝ) : Circle) = _ + rw [show CircleParameterData.rep = (fun x : Circle => (AddCircle.equivIco (1 : ℝ) 0 x : ℝ)) from rfl, + CircleCharacterDynamics.representative_coe] + exact MixedRadix.coordinate_eq_tailValue hp.frequency_zero hp.q_pos + hp.frequency_increasing hp.frequency_divisible d hd i + +lemma ae_finiteHybrid_coordinates_ordered (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (N : ℕ) : + ∀ᵐ ω ∂law p j, ∀ i, + p.coordinate i (point p hr false ω) ≤ p.coordinate i (finiteHybridPoint p hr N ω) := by + filter_upwards [ae_digits_ordered hp j hr, ae_nonterminal_digits hp j hr false] with ω horder hx + intro i + rw [finiteHybridPoint_eq, coordinate_point_eq_tail hp hr false ω hx i, + coordinate_circleValue_eq_tail hp hr _ + (MixedRadix.nonterminal_hybrid _ _ hx (N + 1)) i] + exact MixedRadix.tailValue_mono hr (fun n => (MixedRadix.hybrid_ordered horder (N + 1) n).1) i + +lemma ae_ratio_cap_of_order (j : ℕ) (x y : Sample → Circle) + (hx : Measurable x) (hy : Measurable y) + (hax : (law p j).map x ≪ circleMeasure) (hay : (law p j).map y ≪ circleMeasure) + (horder : ∀ᵐ ω ∂law p j, ∀ i, p.coordinate i (x ω) ≤ p.coordinate i (y ω)) : + ∀ᵐ ω ∂law p j, ∀ k : ℤ, + 0 < p.floorCocycle θ k (y ω) / p.floorCocycle θ k (x ω) ∧ + p.floorCocycle θ k (y ω) / p.floorCocycle θ k (x ω) ≤ 1 := by + obtain ⟨s, _, hs, _, hfinite, _⟩ := hp.exists_parameter_cocycle_set + have hsx := ae_of_ae_map hx.aemeasurable (hax.ae_le hs) + have hsy := ae_of_ae_map hy.aemeasurable (hay.ae_le hs) + filter_upwards [horder, hsx, hsy] with ω ho hxs hys + intro k + refine ⟨div_pos (p.floorCocycle_pos θ k _) (p.floorCocycle_pos θ k _), ?_⟩ + have hcap := CircleWeights.cocycle_ratio_cap_finite_exceptions θ + p.coordFrequency p.coordCost k (x ω) (y ω) ∅ + (fun i => (hp.coordCost_pos i).le) + (fun i _ => by simpa only [p.coord_coordinate_eq] using ho i.2) + (by simpa only [p.coord_coordinate_eq, p.coord_phase_eq] using hfinite _ hxs k) + (by simpa only [p.coord_coordinate_eq, p.coord_phase_eq] using hfinite _ hys k) + simpa only [floorCocycle, Finset.sum_empty, Real.exp_zero] using hcap + +lemma ae_endpoint_ratio_cap (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) : + ∀ᵐ ω ∂law p j, ∀ k : ℤ, + 0 < p.floorCocycle θ k (point p hr true ω) / p.floorCocycle θ k (point p hr false ω) ∧ + p.floorCocycle θ k (point p hr true ω) / p.floorCocycle θ k (point p hr false ω) ≤ 1 := + ae_ratio_cap_of_order hp j _ _ (measurable_point hp hr false) (measurable_point hp hr true) + (point_absolutelyContinuous hp j hr false) (point_absolutelyContinuous hp j hr true) + (ae_coordinates_ordered hp j hr) + +lemma ae_finiteHybrid_ratio_cap (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) (N : ℕ) : + ∀ᵐ ω ∂law p j, ∀ k : ℤ, + 0 < p.floorCocycle θ k (finiteHybridPoint p hr N ω) / p.floorCocycle θ k (point p hr false ω) ∧ + p.floorCocycle θ k (finiteHybridPoint p hr N ω) / p.floorCocycle θ k (point p hr false ω) ≤ 1 := + ae_ratio_cap_of_order hp j _ _ (measurable_point hp hr false) (measurable_finiteHybridPoint hp hr N) + (point_absolutelyContinuous hp j hr false) (hybridPoint_absolutelyContinuous hp j hr _) + (ae_finiteHybrid_coordinates_ordered hp j hr N) + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingLaw.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..8470fdb487f7e7ce8141f5277ad360ed5f136a94 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingLaw.lean @@ -0,0 +1,97 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleCoupling +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingParameters +import OAI.Analysis.IrrationalRotation.Sampling.CircleDigitCrossings +import OAI.Analysis.IrrationalRotation.Product.IndependentCoordinateConditioning + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal BigOperators +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData OneCoordinateCoupling + +lemma tag_bounds (j s : ℕ) : 0 ≤ tag j s ∧ tag j s ≤ 1 := by + unfold tag + split_ifs <;> norm_num + +lemma initialLaw_isProbabilityMeasure : IsProbabilityMeasure initialLaw := by + have := baseLaw_isProbabilityMeasure + unfold initialLaw + infer_instance + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma coordinateLaw_isProbabilityMeasure (j i : ℕ) : + IsProbabilityMeasure (coordinateLaw p j i) := by + by_cases hi : i = 0 + · simpa [coordinateLaw, hi] using initialLaw_isProbabilityMeasure + have hs := p.blockIndex_pos hp.m_pos (show 1 ≤ i by omega) + have hm : (100 : ℝ) ≤ p.m (p.blockIndex i) := by + exact_mod_cast (show 100 ≤ p.m (p.blockIndex i) by have := hp.m_ge_200 _ hs; omega) + simpa only [coordinateLaw, ite_eq_right hi] using rawLaw_isProbabilityMeasure + (CircleParameterLaws.coupling_kappa_bounds _ hs).1 + (CircleParameterLaws.coupling_kappa_bounds _ hs).2 hm + (hp.coupling_a_bounds _ hs).1 (hp.coupling_a_bounds _ hs).2 + (hp.coupling_b_bounds _ hs).1 (hp.coupling_b_bounds _ hs).2 + (tag_bounds j _).1 (tag_bounds j _).2 + +lemma law_isProbabilityMeasure (j : ℕ) : IsProbabilityMeasure (law p j) := by + let := coordinateLaw_isProbabilityMeasure hp j + unfold law + infer_instance + +omit hp in +lemma measurable_observedDigit (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (side : Bool) (i : ℕ) : Measurable (observedDigit p hr side i) := by + let : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + change Measurable (UniformQuantization.quantize _ ∘ endpoint side) + apply (UniformQuantization.measurable_quantize _).comp + cases side + · exact measurable_fst.comp measurable_snd + · exact measurable_snd.comp measurable_snd + +omit hp in +lemma measurable_digits (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) : + Measurable (digits p hr side) := by + exact Measurable.of_eval (fun i => + (measurable_observedDigit hr side i).comp (measurable_pi_apply i)) + +omit hp in +lemma measurable_label (i : ℕ) : Measurable (label i) := by + exact measurable_fst.comp (measurable_pi_apply i) + +lemma iCondIndepFun_labels_digits (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) : + letI := law_isProbabilityMeasure hp j + iCondIndepFun (MeasurableSpace.comap (digits p hr side) inferInstance) + (measurable_digits hr side).comap_le label (law p j) := by + let := coordinateLaw_isProbabilityMeasure hp j + let := law_isProbabilityMeasure hp j + exact CoordinateConditioning.iCondIndepFun_labels (coordinateLaw p j) + (observedDigit p hr side) (measurable_observedDigit hr side) + (fun _ => Prod.fst) (fun _ => measurable_fst) + +lemma posterior_isMarkov (j : ℕ) (side : Bool) (i : ℕ) : + IsMarkovKernel (posterior p j side i) := by + by_cases hi : i = 0 + · simp only [posterior, ite_eq_left hi] + infer_instance + have hs := p.blockIndex_pos hp.m_pos (show 1 ≤ i by omega) + have hm : (100 : ℝ) ≤ p.m (p.blockIndex i) := by + exact_mod_cast (show 100 ≤ p.m (p.blockIndex i) by have := hp.m_ge_200 _ hs; omega) + let : NeZero (MixedRadix.radices p.q i) := + ⟨Nat.ne_of_gt (MixedRadix.radices_pos hp.q_pos hp.frequency_increasing hp.frequency_divisible i)⟩ + simpa only [posterior, ite_eq_right hi] using labelsGivenDigit_isMarkov + (CircleParameterLaws.coupling_kappa_bounds _ hs).1 + (CircleParameterLaws.coupling_kappa_bounds _ hs).2 hm + (hp.coupling_a_bounds _ hs).1 (hp.coupling_a_bounds _ hs).2 + (hp.coupling_b_bounds _ hs).1 (hp.coupling_b_bounds _ hs).2 + (tag_bounds j _).1 (tag_bounds j _).2 side (MixedRadix.radices p.q i) + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingNonterminal.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingNonterminal.lean new file mode 100644 index 0000000000000000000000000000000000000000..a828e1b20dbdc9e839728a7b679cc0048f157121 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingNonterminal.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingLaw +import OAI.Analysis.IrrationalRotation.Sampling.MixedRadixNonterminal + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData OneCoordinateCoupling + +lemma initial_digit_singleton {p : CircleParameterData} + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) (i : ℕ) + (d : Fin (MixedRadix.radices p.q i)) : + (initialLaw.map (observedDigit p hr side i)) {d} = + (MixedRadix.radices p.q i : ℝ≥0∞)⁻¹ := by + let : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + rw [initialLaw, Measure.map_map (measurable_observedDigit hr side i) + (show Measurable (fun x : ℝ => ((none : Label), (x, x))) from by fun_prop)] + cases side <;> + change (baseLaw.map (UniformQuantization.quantize _)) {d} = _ + all_goals rw [baseLaw_eq_restrict]; exact UniformQuantization.map_quantize_singleton _ d + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma observed_singleton_le_half (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) (i : ℕ) + (d : Fin (MixedRadix.radices p.q i)) : + ((coordinateLaw p j i).map (observedDigit p hr side i)) {d} ≤ (2 : ℝ≥0∞)⁻¹ := by + let : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + by_cases hi : i = 0 + · rw [coordinateLaw, ite_eq_left hi, initial_digit_singleton] + exact ENNReal.inv_le_inv.mpr (by exact_mod_cast + (MixedRadix.radices_ge_two hp.q_pos hp.frequency_increasing hp.frequency_divisible i)) + obtain ⟨s, hs, his⟩ := p.exists_mem_block hp.m_pos i (by omega) + have hidx := p.blockIndex_eq_of_mem hp.m_pos his + have hm : (100 : ℝ) ≤ p.m s := by exact_mod_cast (show 100 ≤ p.m s by have := hp.m_ge_200 s hs; omega) + have ha := hp.coupling_a_bounds s hs + have hb := hp.coupling_b_bounds s hs + have hκ := CircleParameterLaws.coupling_kappa_bounds s hs + have ht := tag_bounds j s + have h20 : (20 : ℝ) ≤ MixedRadix.radices p.q i := by + have hN := hp.coupling_radix_ge_N hs his + have hK : (100 : ℝ) ≤ p.K s := by exact_mod_cast hp.coupling_K_ge s hs + dsimp [N] at hN + nlinarith + rw [coordinateLaw, ite_eq_right hi, hidx] + have hfst := Measure.fst_map_prodMk (μ := rawLaw (kappa s) (p.m s) (p.a s) (p.b s) (tag j s)) + (X := observedDigit p hr side i) (measurable_observedDigit hr side i) measurable_fst + rw [← hfst] + change (digitJoint side (MixedRadix.radices p.q i) (kappa s) (p.m s) (p.a s) (p.b s) (tag j s)).fst {d} ≤ _ + rw [digitJoint_fst_singleton hm ha.1 ha.2 hb.1 hb.2] + calc + _ ≤ 10 * baseLaw (bin _ d) := digitWeight_total_le_ten hκ.1 hκ.2 hm ha.1 ha.2 hb.1 hb.2 ht.1 ht.2 side _ d + _ = 10 * (MixedRadix.radices p.q i : ℝ≥0∞)⁻¹ := by rw [baseLaw_bin] + _ ≤ 10 * (20 : ℝ≥0∞)⁻¹ := mul_le_mul_right (ENNReal.inv_le_inv.mpr (by exact_mod_cast h20)) 10 + _ = _ := by + apply (ENNReal.toReal_eq_toReal_iff' (by finiteness) (by finiteness)).mp + norm_num + +lemma ae_nonterminal_digits (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) : + ∀ᵐ ω ∂law p j, MixedRadix.Nonterminal (digits p hr side ω) := by + let := coordinateLaw_isProbabilityMeasure hp j + let s : ℕ → Set CoordinateSample := fun i => + {z | ¬(observedDigit p hr side i z : ℕ) + 1 < MixedRadix.radices p.q i} + have heq (i : ℕ) : s i = observedDigit p hr side i ⁻¹' + {⟨MixedRadix.radices p.q i - 1, by have := hr i; omega⟩} := by + ext z + simp only [s, mem_ofPred_eq, mem_preimage, mem_singleton_iff, Fin.ext_iff] + have := (observedDigit p hr side i z).isLt + omega + have hs (i : ℕ) : MeasurableSet (s i) := by + rw [heq] + exact (measurable_observedDigit hr side i) (measurableSet_singleton _) + have hprob (i : ℕ) : coordinateLaw p j i (s i) ≤ (2 : ℝ≥0∞)⁻¹ := by + rw [heq, ← Measure.map_apply (measurable_observedDigit hr side i) (measurableSet_singleton _)] + exact observed_singleton_le_half hp j hr side i _ + have hnull := infinitePi_eventually_mem_null (coordinateLaw p j) s hs + (by norm_num : (2 : ℝ≥0∞)⁻¹ < 1) hprob + rw [ae_iff] + simpa only [law, MixedRadix.Nonterminal, digits, mem_ofPred_eq, + not_forall, not_exists, not_and, s] using hnull + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingOrder.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..b460cd1b2cf1142aeb3994f67c202a2986174dc1 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingOrder.lean @@ -0,0 +1,136 @@ +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingSupport +import OAI.Analysis.IrrationalRotation.Couplings.MixedRadixHybridLaw + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal + +namespace Invariant233.UniformQuantization + +lemma quantize_mono_on_unit {q : ℕ} [NeZero q] {x y : ℝ} + (hx : x ∈ Ico (0 : ℝ) 1) (hy : y ∈ Ico (0 : ℝ) 1) (hxy : x ≤ y) : + quantize q x ≤ quantize q y := by + have hq : (0 : ℝ) < q := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) + have hfx : ⌊(q : ℝ) * x⌋₊ < q := + (Nat.floor_lt (mul_nonneg hq.le hx.1)).mpr (by nlinarith [hx.2]) + have hfy : ⌊(q : ℝ) * y⌋₊ < q := + (Nat.floor_lt (mul_nonneg hq.le hy.1)).mpr (by nlinarith [hy.2]) + change ⌊(q : ℝ) * x⌋₊ % q ≤ ⌊(q : ℝ) * y⌋₊ % q + rw [Nat.mod_eq_of_lt hfx, Nat.mod_eq_of_lt hfy] + exact Nat.floor_mono (mul_le_mul_of_nonneg_left hxy hq.le) + +lemma quantize_val_eq_floor {q : ℕ} [NeZero q] {x : ℝ} + (hx : x ∈ Ico (0 : ℝ) 1) : (quantize q x : ℕ) = ⌊(q : ℝ) * x⌋₊ := by + have hq : (0 : ℝ) < q := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) + have hf : ⌊(q : ℝ) * x⌋₊ < q := + (Nat.floor_lt (mul_nonneg hq.le hx.1)).mpr (by nlinarith [hx.2]) + exact Nat.mod_eq_of_lt hf + +end Invariant233.UniformQuantization + +namespace Invariant233.CircleDigitCoupling +open OneCoordinateCoupling + +lemma rawLaw_ae_ordered {κ m a b t : ℝ} (hm : 1 ≤ m) : + ∀ᵐ z ∂rawLaw κ m a b t, endpoint false z ≤ endpoint true z := by + apply rawLaw_ae_of_components + · exact measurableSet_le (measurable_fst.comp measurable_snd) + (measurable_snd.comp measurable_snd) + · exact Eventually.of_forall (fun _ => le_rfl) + · exact replacement_ae_ordered (by linarith : 2 ≤ 2 * m) + +end Invariant233.CircleDigitCoupling + +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData OneCoordinateCoupling +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma coordinateLaw_ae_ordered (j i : ℕ) : + ∀ᵐ z ∂coordinateLaw p j i, endpoint false z ≤ endpoint true z := by + by_cases hi : i = 0 + · rw [coordinateLaw, ite_eq_left hi, initialLaw] + apply (ae_map_iff (show Measurable (fun x : ℝ => ((none : Label), (x, x))) from by fun_prop).aemeasurable + (measurableSet_le (measurable_fst.comp measurable_snd) + (measurable_snd.comp measurable_snd))).2 + exact Eventually.of_forall (fun _ => le_rfl) + · rw [coordinateLaw, ite_eq_right hi] + apply rawLaw_ae_ordered + have hs := p.blockIndex_pos hp.m_pos (show 1 ≤ i by omega) + exact_mod_cast (show 1 ≤ p.m (p.blockIndex i) by + have := hp.m_ge_200 _ hs + omega) + +lemma coordinateLaw_ae_endpoint_unit (j : ℕ) (side : Bool) (i : ℕ) : + ∀ᵐ z ∂coordinateLaw p j i, endpoint side z ∈ Ico (0 : ℝ) 1 := by + by_cases hi : i = 0 + · rw [coordinateLaw, ite_eq_left hi, initialLaw] + have hmeas : Measurable (endpoint side) := by + cases side + · exact measurable_fst.comp measurable_snd + · exact measurable_snd.comp measurable_snd + apply (ae_map_iff (show Measurable (fun x : ℝ => ((none : Label), (x, x))) from by fun_prop).aemeasurable + (measurableSet_Ico.preimage hmeas)).2 + cases side <;> exact CouplingMixture.intervalLaw_ae_mem 0 1 + · rw [coordinateLaw, ite_eq_right hi] + have hs := p.blockIndex_pos hp.m_pos (show 1 ≤ i by omega) + have hm : (100 : ℝ) ≤ p.m (p.blockIndex i) := by + exact_mod_cast (show 100 ≤ p.m (p.blockIndex i) by + have := hp.m_ge_200 _ hs + omega) + exact rawLaw_ae_endpoint_unit hm (hp.coupling_a_bounds _ hs).1 + (hp.coupling_a_bounds _ hs).2 (hp.coupling_b_bounds _ hs).1 + (hp.coupling_b_bounds _ hs).2 side + +lemma ae_digits_ordered (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) : + ∀ᵐ ω ∂law p j, ∀ i, digits p hr false ω i ≤ digits p hr true ω i := by + let := coordinateLaw_isProbabilityMeasure hp j + apply ae_all_iff.2 + intro i + have h : ∀ᵐ z ∂coordinateLaw p j i, + observedDigit p hr false i z ≤ observedDigit p hr true i z := by + filter_upwards [coordinateLaw_ae_ordered hp j i, + coordinateLaw_ae_endpoint_unit hp j false i, + coordinateLaw_ae_endpoint_unit hp j true i] with z hz hx hy + let : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + exact UniformQuantization.quantize_mono_on_unit hx hy hz + exact (measurePreserving_eval_infinitePi (coordinateLaw p j) i).quasiMeasurePreserving.ae h + +lemma ae_coordinates_ordered (j : ℕ) (hr : ∀ i, 0 < MixedRadix.radices p.q i) : + ∀ᵐ ω ∂law p j, ∀ i, + p.coordinate i (point p hr false ω) ≤ p.coordinate i (point p hr true ω) := by + filter_upwards [ae_digits_ordered hp j hr, ae_nonterminal_digits hp j hr false, + ae_nonterminal_digits hp j hr true] with ω horder hx hy + intro i + rw [coordinate_point_eq_tail hp hr false ω hx i, + coordinate_point_eq_tail hp hr true ω hy i] + exact MixedRadix.tailValue_mono hr horder i + +lemma ae_raw_endpoints_unit (j : ℕ) (side : Bool) : + ∀ᵐ ω ∂law p j, ∀ i, endpoint side (ω i) ∈ Ico (0 : ℝ) 1 := by + let := coordinateLaw_isProbabilityMeasure hp j + apply ae_all_iff.mpr + intro i + exact (measurePreserving_eval_infinitePi (coordinateLaw p j) i).quasiMeasurePreserving.ae + (coordinateLaw_ae_endpoint_unit hp j side i) + +lemma ae_coordinate_raw_error (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) : + ∀ᵐ ω ∂law p j, ∀ i, + |p.coordinate i (point p hr side ω) - endpoint side (ω i)| ≤ + 1 / (MixedRadix.radices p.q i : ℝ) := by + filter_upwards [ae_nonterminal_digits hp j hr side, + ae_raw_endpoints_unit hp j side] with ω hnt hu + intro i + rw [coordinate_point_eq_tail hp hr side ω hnt i] + apply MixedRadix.abs_tailValue_sub_raw_le_of_floor hr _ i (hu i).1 + let : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + exact (UniformQuantization.quantize_val_eq_floor (hu i)).symm + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingParameters.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..b96dbb2c36292e7a323fb677678f8a425129d0bd --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingParameters.lean @@ -0,0 +1,85 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CircleParameterBlocks +import OAI.Analysis.IrrationalRotation.Sampling.MixedRadixCircle +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Tactic + +namespace OAI + +noncomputable section +namespace Invariant233.CircleParameterLaws +open CircleParameterData +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma coupling_K_ge (j : ℕ) (hj : 1 ≤ j) : 100 ≤ p.K j := by + obtain ⟨n, rfl⟩ := Nat.exists_eq_add_of_le hj + induction n with + | zero => simpa using hp.initial_K.ge + | succ n ih => + have h := hp.K_double (1 + n) (by omega) + have he : 1 + (n + 1) = 1 + n + 1 := by omega + rw [he] + omega + +omit hp in +lemma coupling_kappa_bounds (j : ℕ) (hj : 1 ≤ j) : + 0 ≤ kappa j ∧ kappa j ≤ 1 / 100 := by + have hj' : (1 : ℝ) ≤ j := by exact_mod_cast hj + unfold kappa + constructor + · positivity + · apply one_div_le_one_div_of_le (by norm_num) + nlinarith + +lemma coupling_a_bounds (j : ℕ) (hj : 1 ≤ j) : + 1 / (p.m j : ℝ) ≤ p.a j ∧ p.a j ≤ 1 / 4 := by + have hm : (0 : ℝ) < p.m j := by exact_mod_cast hp.m_pos j hj + have hG : (1 : ℝ) ≤ p.G j := by exact_mod_cast hp.G_pos j hj + have hGm : 4 * (p.G j : ℝ) ≤ p.m j := by exact_mod_cast hp.m_ge_G j hj + unfold a + exact ⟨div_le_div_of_nonneg_right hG hm.le, (div_le_iff₀ hm).mpr (by linarith)⟩ + +lemma coupling_b_bounds (j : ℕ) (hj : 1 ≤ j) : + 1 / (p.m j : ℝ) ≤ p.b j ∧ p.b j ≤ 1 / 4 := by + have hm : (200 : ℝ) ≤ p.m j := by exact_mod_cast hp.m_ge_200 j hj + have hm1 : (1 : ℝ) ≤ p.m j := by linarith + have hm0 : (0 : ℝ) < p.m j := by linarith + constructor + · simpa only [b, one_div, Real.rpow_neg_one] using + (Real.rpow_le_rpow_of_exponent_le hm1 (show (-1 : ℝ) ≤ -(19 / 20 : ℝ) by norm_num)) + · have hs : (4 : ℝ) ≤ Real.sqrt (p.m j) := by + apply (Real.le_sqrt (by norm_num) hm0.le).mpr + nlinarith + have hpw : (4 : ℝ) ≤ (p.m j : ℝ) ^ (19 / 20 : ℝ) := by + calc + _ ≤ Real.sqrt (p.m j) := hs + _ = (p.m j : ℝ) ^ (1 / 2 : ℝ) := Real.sqrt_eq_rpow _ + _ ≤ _ := Real.rpow_le_rpow_of_exponent_le hm1 (by norm_num) + rw [b, Real.rpow_neg hm0.le, ← one_div] + exact one_div_le_one_div_of_le (by norm_num) hpw + +lemma coupling_radix_ge_N {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) : + p.N s ≤ (MixedRadix.radices p.q i : ℝ) := by + simpa only [MixedRadix.radices, Nat.cast_div (hp.frequency_divisible i) + (by exact_mod_cast (Nat.ne_of_gt (hp.q_pos i)) : (p.q i : ℝ) ≠ 0)] using hp.frequency_ratios s hs i hi + +lemma coupling_bin_small {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) + {w : ℝ} (hw : 1 / (p.m s : ℝ) ≤ w) : + 1 / (MixedRadix.radices p.q i : ℝ) < w / 2 := by + have hm : (0 : ℝ) < p.m s := by exact_mod_cast hp.m_pos s hs + have hk : (100 : ℝ) ≤ p.K s := by exact_mod_cast hp.coupling_K_ge s hs + have hN : (0 : ℝ) < p.N s := by unfold N; positivity + have hmN : 2 * (p.m s : ℝ) < p.N s := by unfold N; nlinarith + calc + _ ≤ 1 / p.N s := one_div_le_one_div_of_le hN (hp.coupling_radix_ge_N hs hi) + _ < (1 / (p.m s : ℝ)) / 2 := by + rw [div_div] + apply one_div_lt_one_div_of_lt (by positivity) + linarith + _ ≤ _ := div_le_div_of_nonneg_right hw (by norm_num) + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingSupport.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a0862a029527d3ddb80cc184c9603ca5adbcde1 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingSupport.lean @@ -0,0 +1,110 @@ +import OAI.Analysis.IrrationalRotation.Couplings.CircleCouplingCrossings + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal BigOperators +namespace Invariant233.CircleDigitCoupling +open CouplingMixture CouplingMarginalBounds OneCoordinateCoupling + +lemma rawLaw_ae_of_components {κ m a b t : ℝ} {P : CoordinateSample → Prop} + (hP : MeasurableSet {z | P z}) + (hdiag : ∀ᵐ x ∂baseLaw, P (none, (x, x))) + (hcomp : ∀ i : Fin 5, ∀ᵐ z ∂(leftLaw (2 * m) a b i).prod (rightLaw (2 * m) a b i), + P (some i, z)) : ∀ᵐ z ∂rawLaw κ m a b t, P z := by + unfold rawLaw labelledMixture + rw [ae_add_measure_iff, ae_finsetSum_measure_iff] + constructor + · apply Measure.ae_smul_measure + apply (ae_map_iff (show Measurable (fun z : ℝ × ℝ => ((none : Label), z)) from by fun_prop).aemeasurable hP).2 + unfold CouplingMixture.diagonal + exact (ae_map_iff (show Measurable (fun x : ℝ => (x, x)) from by fun_prop).aemeasurable + (show MeasurableSet {z : ℝ × ℝ | P (none, z)} from + (show Measurable (fun z : ℝ × ℝ => ((none : Label), z)) from by fun_prop) hP)).2 hdiag + · intro i _ + exact Measure.ae_smul_measure + ((ae_map_iff (show Measurable (fun z : ℝ × ℝ => (some i, z)) from by fun_prop).aemeasurable hP).2 (hcomp i)) _ + +section Parameters +variable {κ m a b t : ℝ} + (hm : 100 ≤ m) (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) +include hm ha ha' hb hb' + +lemma rawLaw_ae_endpoint_property (side : Bool) {P : Label → ℝ → Prop} + (hP : MeasurableSet {z : CoordinateSample | P z.1 (endpoint side z)}) + (hbase : ∀ᵐ x ∂baseLaw, P none x) + (hl : ∀ i : Fin 5, ∀ᵐ x ∂endpointLaw side m a b (some i), P (some i) x) : + ∀ᵐ z ∂rawLaw κ m a b t, P z.1 (endpoint side z) := by + have hm0 : 0 < m := by linarith + have : ∀ i, IsProbabilityMeasure (leftLaw (2 * m) a b i) := + leftLaw_isProbabilityMeasure (by linarith) (width_pos hm0 ha) ha' (width_pos hm0 hb) hb' + have : ∀ i, IsProbabilityMeasure (rightLaw (2 * m) a b i) := + rightLaw_isProbabilityMeasure (by linarith) (width_pos hm0 ha) ha' (width_pos hm0 hb) hb' + apply rawLaw_ae_of_components hP + · cases side <;> exact hbase + · intro i + cases side + · exact (measurePreserving_fst (μ := leftLaw (2 * m) a b i) + (ν := rightLaw (2 * m) a b i)).quasiMeasurePreserving.ae (hl i) + · exact (measurePreserving_snd (μ := leftLaw (2 * m) a b i) + (ν := rightLaw (2 * m) a b i)).quasiMeasurePreserving.ae (hl i) + +lemma rawLaw_ae_endpoint_unit (side : Bool) : + ∀ᵐ z ∂rawLaw κ m a b t, endpoint side z ∈ Ico (0 : ℝ) 1 := by + apply rawLaw_ae_endpoint_property hm ha ha' hb hb' side (P := fun _ x => x ∈ Ico (0 : ℝ) 1) + · apply measurableSet_Ico.preimage + cases side + · exact measurable_fst.comp measurable_snd + · exact measurable_snd.comp measurable_snd + · exact intervalLaw_ae_mem 0 1 + · intro i + exact endpointLaw_ae_unit hm ha ha' hb hb' side (some i) + +lemma rawLaw_ae_top_support (which : Bool) : + ∀ᵐ z ∂rawLaw κ m a b t, z.1 = topLabel which → 1 - width a b which / 2 ≤ z.2.2 := by + apply rawLaw_ae_endpoint_property hm ha ha' hb hb' true (P := fun l x => l = topLabel which → 1 - width a b which / 2 ≤ x) + · simp only [imp_iff_not_or, endpoint, ite_true] + exact (measurableSet_eq_fun measurable_fst measurable_const).compl.union + (measurableSet_le measurable_const (measurable_snd.comp measurable_snd)) + · exact Eventually.of_forall (by intro x h; cases which <;> cases h) + · intro i + by_cases hi : some i = topLabel which + · cases which + · have he : i = 0 := Option.some.inj hi + subst i + filter_upwards [intervalLaw_ae_mem (1 - a / 2) 1] with x hx + exact fun _ => hx.1 + · have he : i = 2 := Option.some.inj hi + subst i + filter_upwards [intervalLaw_ae_mem (1 - b / 2) 1] with x hx + exact fun _ => hx.1 + · exact Eventually.of_forall (fun _ h => (hi h).elim) + +lemma rawLaw_ae_bottom_support (which : Bool) : + ∀ᵐ z ∂rawLaw κ m a b t, z.1 = bottomLabel which → z.2.1 < width a b which / 2 := by + apply rawLaw_ae_endpoint_property hm ha ha' hb hb' false (P := fun l x => l = bottomLabel which → x < width a b which / 2) + · simp only [imp_iff_not_or, endpoint, Bool.false_eq_true, ite_false] + exact (measurableSet_eq_fun measurable_fst measurable_const).compl.union + (measurableSet_lt (measurable_fst.comp measurable_snd) measurable_const) + · exact Eventually.of_forall (by intro x h; cases which <;> cases h) + · intro i + by_cases hi : some i = bottomLabel which + · cases which + · have he : i = 1 := Option.some.inj hi + subst i + filter_upwards [intervalLaw_ae_mem 0 (a / 2)] with x hx + exact fun _ => hx.2 + · have he : i = 3 := Option.some.inj hi + subst i + filter_upwards [intervalLaw_ae_mem 0 (b / 2)] with x hx + exact fun _ => hx.2 + · exact Eventually.of_forall (fun _ h => (hi h).elim) + +end Parameters +end Invariant233.CircleDigitCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingTagSupport.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingTagSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..8d27b08736738d23af0722f9e4ba0d288b769891 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleCouplingTagSupport.lean @@ -0,0 +1,106 @@ +import OAI.Analysis.IrrationalRotation.Couplings.CircleConditionalLabels + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal + +namespace Invariant233.CircleDigitCoupling +open CouplingMarginalBounds CouplingMixture OneCoordinateCoupling + +lemma rawLaw_ae_tag_left {κ m a b t : ℝ} + (hm : 100 ≤ m) (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) : + ∀ᵐ z ∂rawLaw κ m a b t, z.1 = some 4 → z.2.1 < 1 / (2 * m) := by + apply rawLaw_ae_endpoint_property hm ha ha' hb hb' false + (P := fun l x => l = some 4 → x < 1 / (2 * m)) + · simp only [imp_iff_not_or, endpoint, Bool.false_eq_true, ite_false] + exact (measurableSet_eq_fun measurable_fst measurable_const).compl.union + (measurableSet_lt (measurable_fst.comp measurable_snd) measurable_const) + · exact Eventually.of_forall (by intro x h; cases h) + · intro i + by_cases hi : i = 4 + · subst i + filter_upwards [intervalLaw_ae_mem 0 (1 / (2 * m))] with x hx + exact fun _ => hx.2 + · exact Eventually.of_forall (fun _ h => (hi (Option.some.inj h)).elim) + +lemma rawLaw_ae_tag_right {κ m a b t : ℝ} + (hm : 100 ≤ m) (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) : + ∀ᵐ z ∂rawLaw κ m a b t, z.1 = some 4 → 1 - 1 / (2 * m) ≤ z.2.2 := by + apply rawLaw_ae_endpoint_property hm ha ha' hb hb' true + (P := fun l x => l = some 4 → 1 - 1 / (2 * m) ≤ x) + · simp only [imp_iff_not_or, endpoint, ite_true] + exact (measurableSet_eq_fun measurable_fst measurable_const).compl.union + (measurableSet_le measurable_const (measurable_snd.comp measurable_snd)) + · exact Eventually.of_forall (by intro x h; cases h) + · intro i + by_cases hi : i = 4 + · subst i + filter_upwards [intervalLaw_ae_mem (1 - 1 / (2 * m)) 1] with x hx + exact fun _ => hx.1 + · exact Eventually.of_forall (fun _ h => (hi (Option.some.inj h)).elim) + +end Invariant233.CircleDigitCoupling + +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData OneCoordinateCoupling +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +lemma ae_tag_raw_support (j : ℕ) {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) : + ∀ᵐ ω ∂law p j, label i ω = some 4 → + (ω i).2.1 < 1 / (2 * (p.m s : ℝ)) ∧ + 1 - 1 / (2 * (p.m s : ℝ)) ≤ (ω i).2.2 := by + let := coordinateLaw_isProbabilityMeasure hp j + apply (measurePreserving_eval_infinitePi (coordinateLaw p j) i).quasiMeasurePreserving.ae + (p := fun z => z.1 = some 4 → z.2.1 < 1 / (2 * (p.m s : ℝ)) ∧ + 1 - 1 / (2 * (p.m s : ℝ)) ≤ z.2.2) + have hi0 : i ≠ 0 := by have := (p.mem_block_iff s i).mp hi; omega + rw [coordinateLaw, ite_eq_right hi0, p.blockIndex_eq_of_mem hp.m_pos hi] + have hm : (100 : ℝ) ≤ p.m s := by + exact_mod_cast (show 100 ≤ p.m s by have := hp.m_ge_200 s hs; omega) + filter_upwards [rawLaw_ae_tag_left hm (hp.coupling_a_bounds s hs).1 + (hp.coupling_a_bounds s hs).2 (hp.coupling_b_bounds s hs).1 (hp.coupling_b_bounds s hs).2, + rawLaw_ae_tag_right hm (hp.coupling_a_bounds s hs).1 + (hp.coupling_a_bounds s hs).2 (hp.coupling_b_bounds s hs).1 (hp.coupling_b_bounds s hs).2] + with z hl hr + exact fun h => ⟨hl h, hr h⟩ + +lemma ae_tag_coordinate_support (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) + {s i : ℕ} (hs : 1 ≤ s) (hi : i ∈ p.block s) : + ∀ᵐ ω ∂law p j, label i ω = some 4 → + p.coordinate i (point p hr false ω) < 1 / (p.m s : ℝ) ∧ + 1 - 1 / (p.m s : ℝ) < p.coordinate i (point p hr true ω) := by + have hsmall := hp.coupling_bin_small hs hi (le_refl (1 / (p.m s : ℝ))) + have hhalf : (1 / (p.m s : ℝ)) / 2 = 1 / (2 * (p.m s : ℝ)) := by ring + rw [hhalf] at hsmall + have hsum : 1 / (2 * (p.m s : ℝ)) + 1 / (2 * (p.m s : ℝ)) = + 1 / (p.m s : ℝ) := by ring + filter_upwards [ae_tag_raw_support hp j hs hi, + ae_rounding_bound hp j hr i false, ae_rounding_bound hp j hr i true] + with ω htag hx hy + intro hl + have hraw := htag hl + have hx' := (abs_le.mp hx).2 + have hy' := (abs_le.mp hy).1 + simp only [endpoint, Bool.false_eq_true, ite_false, ite_true] at hx' hy' + constructor <;> linarith [hraw.1, hraw.2] + +lemma ae_all_tag_coordinate_support (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) : + ∀ᵐ ω ∂law p j, ∀ s, 1 ≤ s → ∀ i ∈ p.block s, label i ω = some 4 → + p.coordinate i (point p hr false ω) < 1 / (p.m s : ℝ) ∧ + 1 - 1 / (p.m s : ℝ) < p.coordinate i (point p hr true ω) := by + exact ae_all_iff.mpr (fun s => ae_all_iff.mpr (fun hs => + ae_all_iff.mpr (fun i => ae_all_iff.mpr (fun hi => + ae_tag_coordinate_support hp j hr hs hi)))) + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleDigitCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleDigitCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..02d4d425697a28a1d74daae4816361c1768705e7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CircleDigitCoupling.lean @@ -0,0 +1,117 @@ +import OAI.Analysis.IrrationalRotation.Sampling.CircleDigitGeometry +import OAI.Analysis.IrrationalRotation.Product.OneCoordinateDensity +import OAI.Analysis.IrrationalRotation.Analysis.FiniteKernelMixture + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal BigOperators +namespace Invariant233.CircleDigitCoupling +open CouplingMarginalBounds CouplingMixture OneCoordinateCoupling + +lemma baseLaw_bin {r : ℕ} [NeZero r] (d : Fin r) : + baseLaw (bin r d) = (r : ℝ≥0∞)⁻¹ := by + have hr : (0 : ℝ) < r := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne r) + rw [baseLaw_eq_restrict, Measure.restrict_apply (show MeasurableSet (bin r d) from measurableSet_Ico), + inter_eq_left.mpr (bin_subset_unit d)] + rw [bin, Real.volume_Ico, bin_length] + rw [ENNReal.ofReal_div_of_pos hr] + simp + +lemma labelsGivenDigit_singleton (side : Bool) (r : ℕ) (κ m a b t : ℝ) + (d : Fin r) (l : Label) : + labelsGivenDigit side r κ m a b t d {l} = + digitWeight side r κ m a b t l d / ∑ k, digitWeight side r κ m a b t k d := by + classical + cases l <;> simp [labelsGivenDigit, FiniteKernelMixture.normalizedKernel_apply, + Kernel.const_apply, Pi.single_apply] + +variable {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) + +include hm ha ha' hb hb' in +lemma endpointLaw_isProbabilityMeasure (side : Bool) (l : Label) : + IsProbabilityMeasure (endpointLaw side m a b l) := by + have hm0 : 0 < m := by linarith + have ha0 := width_pos hm0 ha + have hb0 := width_pos hm0 hb + cases l with + | none => exact baseLaw_isProbabilityMeasure + | some i => + cases side + · exact leftLaw_isProbabilityMeasure (by linarith) ha0 ha' hb0 hb' i + · exact rightLaw_isProbabilityMeasure (by linarith) ha0 ha' hb0 hb' i + +include hκ0 hκ hm ha ha' hb hb' ht0 ht in +lemma labelMass_sum : (∑ l, labelMass κ m a b t l) = 1 := by + have hm0 : 0 < m := by linarith + have hq0 : 0 ≤ diagonalMass κ m a b t := + le_trans (by norm_num) (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + have hp0 := componentProbabilities_nonneg (a := a) (b := b) hκ0 hm0 ht0 + rw [Fintype.sum_option] + change ENNReal.ofReal (diagonalMass κ m a b t) + + ∑ i, ENNReal.ofReal (componentProbabilities κ m a b t i) = 1 + rw [← ENNReal.ofReal_sum_of_nonneg (fun i _ => hp0 i), + ← ENNReal.ofReal_add hq0 (Finset.sum_nonneg (fun i _ => hp0 i))] + have heq : diagonalMass κ m a b t + ∑ i, componentProbabilities κ m a b t i = 1 := by + simp only [componentProbabilities, Fin.sum_univ_succ, Matrix.cons_val_zero, + Matrix.cons_val_succ, Fin.sum_univ_zero, add_zero] + unfold diagonalMass + ring + rw [heq] + norm_num + +include hκ0 hκ hm ha ha' hb hb' ht0 ht in +lemma rawLaw_isProbabilityMeasure : IsProbabilityMeasure (rawLaw κ m a b t) := by + have hm0 : 0 < m := by linarith + have ha0 := width_pos hm0 ha + have hb0 := width_pos hm0 hb + have : ∀ i, IsProbabilityMeasure (leftLaw (2 * m) a b i) := + leftLaw_isProbabilityMeasure (by linarith) ha0 ha' hb0 hb' + have : ∀ i, IsProbabilityMeasure (rightLaw (2 * m) a b i) := + rightLaw_isProbabilityMeasure (by linarith) ha0 ha' hb0 hb' + apply labelledMixture_isProbabilityMeasure + have h := labelMass_sum hκ0 hκ hm ha ha' hb hb' ht0 ht + simpa only [Fintype.sum_option, labelMass] using h + +include hκ0 hκ hm ha ha' hb hb' ht0 ht in +lemma digitWeight_total_ne_zero (side : Bool) (r : ℕ) [NeZero r] (d : Fin r) : + (∑ l, digitWeight side r κ m a b t l d) ≠ 0 := by + have hq : 0 < diagonalMass κ m a b t := by + have := (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + linarith + have hpos : digitWeight side r κ m a b t none d ≠ 0 := by + simp only [digitWeight, labelMass, endpointLaw, baseLaw_bin] + exact mul_ne_zero (ENNReal.ofReal_ne_zero_iff.mpr hq) + (ENNReal.inv_ne_zero.mpr (by simp)) + intro h + apply hpos + exact (Finset.sum_eq_zero_iff.mp h) none (Finset.mem_univ none) + +include hm ha ha' hb hb' in +lemma digitWeight_total_ne_top (side : Bool) (r : ℕ) (d : Fin r) : + (∑ l, digitWeight side r κ m a b t l d) ≠ ∞ := by + have : ∀ l, IsProbabilityMeasure (endpointLaw side m a b l) := + endpointLaw_isProbabilityMeasure hm ha ha' hb hb' side + apply ENNReal.sum_ne_top.mpr + intro l _ + apply ENNReal.mul_ne_top + · cases l <;> exact ENNReal.ofReal_ne_top + · exact measure_ne_top _ _ + +include hκ0 hκ hm ha ha' hb hb' ht0 ht in +lemma labelsGivenDigit_isMarkov (side : Bool) (r : ℕ) [NeZero r] : + IsMarkovKernel (labelsGivenDigit side r κ m a b t) := by + apply FiniteKernelMixture.normalizedKernel_isMarkov + · exact digitWeight_total_ne_zero hκ0 hκ hm ha ha' hb hb' ht0 ht side r + · exact digitWeight_total_ne_top hm ha ha' hb hb' side r + +end Invariant233.CircleDigitCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalAvoidance.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalAvoidance.lean new file mode 100644 index 0000000000000000000000000000000000000000..dcc14a0fbf8cd474e69d59e916d6ad6238d159d9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalAvoidance.lean @@ -0,0 +1,263 @@ +import Mathlib.Probability.Independence.Conditional +import Mathlib.MeasureTheory.Function.ConditionalExpectation.Indicator +import Mathlib.MeasureTheory.Function.ConditionalExpectation.Real +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal Classical + +namespace Invariant233.ConditionalAvoidance + +variable {Ω ι : Type*} {m : MeasurableSpace Ω} [mΩ : MeasurableSpace Ω] +variable {μ : Measure Ω} [IsFiniteMeasure μ] + +omit mΩ [IsFiniteMeasure μ] in + +theorem measurableSet_filter_selection_eq (I S : Finset ι) (P : ι → Ω → Prop) + (hP : ∀ i ∈ I, MeasurableSet[m] {ω | P i ω}) : + MeasurableSet[m] {ω | I.filter (fun i => P i ω) = S} := by + classical + by_cases hSI : S ⊆ I + · have heq : {ω | I.filter (fun i => P i ω) = S} = + ⋂ i ∈ I, {ω | P i ω ↔ i ∈ S} := by + ext ω + simp only [Set.mem_ofPred_eq, Set.mem_iInter] + constructor + · intro h i hi + have := Finset.ext_iff.mp h i + simpa only [Finset.mem_filter, hi, true_and] using this + · intro h + ext i + by_cases hi : i ∈ I + · simpa only [Finset.mem_filter, hi, true_and] using h i hi + · simp only [Finset.mem_filter, hi, false_and, false_iff] + exact fun his => hi (hSI his) + rw [heq] + apply MeasurableSet.biInter I.countable_toSet + intro i hi + by_cases his : i ∈ S + · simpa only [his, iff_true] using hP i hi + · simpa only [his, iff_false, ← Set.compl_ofPred] using (hP i hi).compl + · have heq : {ω | I.filter (fun i => P i ω) = S} = (∅ : Set Ω) := by + apply Set.eq_empty_iff_forall_notMem.mpr + intro ω hω + exact hSI (hω ▸ Finset.filter_subset _ _) + rw [heq] + exact MeasurableSet.empty + +theorem condProb_compl (hm : m ≤ mΩ) {A : Set Ω} (hA : MeasurableSet A) : + μ⟦Aᶜ | m⟧ =ᵐ[μ] fun ω => 1 - (μ⟦A | m⟧) ω := by + have heq : Aᶜ.indicator (fun _ : Ω => (1 : ℝ)) = + (fun _ => (1 : ℝ)) - A.indicator (fun _ => (1 : ℝ)) := by + ext ω + by_cases hω : ω ∈ A <;> simp [hω] + change μ[Aᶜ.indicator (fun _ => (1 : ℝ)) | m] =ᵐ[μ] _ + rw [heq] + have hsub := condExp_sub (μ := μ) (integrable_const (1 : ℝ)) + ((integrable_const (1 : ℝ)).indicator hA) m + filter_upwards [hsub] with ω hω + simpa only [Pi.sub_apply, condExp_const hm] using hω + +omit [IsFiniteMeasure μ] in + +theorem condProb_nonneg (A : Set Ω) : + ∀ᵐ ω ∂μ, 0 ≤ (μ⟦A | m⟧) ω := by + apply condExp_nonneg + exact Eventually.of_forall fun ω => by + by_cases hω : ω ∈ A <;> simp [hω] + +theorem condProb_le_on_of_ae_inter_subset (hm : m ≤ mΩ) + {H K B : Set Ω} (hH : MeasurableSet H) (hK : MeasurableSet[m] K) + (hB : MeasurableSet B) (hsub : (H ∩ K : Set Ω) ≤ᵐ[μ] B) : + ∀ᵐ ω ∂μ, ω ∈ K → (μ⟦H | m⟧) ω ≤ (μ⟦B | m⟧) ω := by + have hpull := condExp_indicator (μ := μ) + ((integrable_const (1 : ℝ)).indicator hH) hK + have hmono := condExp_mono (μ := μ) (m := m) + (((integrable_const (1 : ℝ)).indicator hH).indicator (hm _ hK)) + ((integrable_const (1 : ℝ)).indicator hB) + (hsub.mono fun ω hsubω => show + K.indicator (H.indicator (fun _ => (1 : ℝ))) ω ≤ + B.indicator (fun _ => (1 : ℝ)) ω from by + by_cases hωK : ω ∈ K + · by_cases hωH : ω ∈ H + · have hωB : ω ∈ B := hsubω ⟨hωH, hωK⟩ + simp [hωK, hωH, hωB] + · simp [hωK, hωH, Set.indicator_nonneg] + · simp [hωK, Set.indicator_nonneg]) + filter_upwards [hpull, hmono] with ω hp hmω hωK + simpa only [hp, Set.indicator_of_mem hωK] using hmω + +theorem condProb_le_on_of_inter_subset (hm : m ≤ mΩ) + {H K B : Set Ω} (hH : MeasurableSet H) (hK : MeasurableSet[m] K) + (hB : MeasurableSet B) (hsub : H ∩ K ⊆ B) : + ∀ᵐ ω ∂μ, ω ∈ K → (μ⟦H | m⟧) ω ≤ (μ⟦B | m⟧) ω := + condProb_le_on_of_ae_inter_subset hm hH hK hB (Eventually.of_forall hsub) + +theorem prod_one_sub_le_exp (S : Finset ι) (q : ι → ℝ) {p : ℝ} + (hq : ∀ i ∈ S, 0 ≤ 1 - q i) (hp : ∀ i ∈ S, p ≤ q i) : + (∏ i ∈ S, (1 - q i)) ≤ Real.exp (-p * S.card) := by + calc + (∏ i ∈ S, (1 - q i)) ≤ ∏ _i ∈ S, Real.exp (-p) := by + apply Finset.prod_le_prod₀ hq + intro i hi + calc + 1 - q i ≤ 1 - p := sub_le_sub_left (hp i hi) 1 + _ ≤ Real.exp (-p) := by linarith [Real.add_one_le_exp (-p)] + _ = Real.exp (-p) ^ S.card := by simp + _ = Real.exp (-p * S.card) := by rw [← Real.exp_nat_mul]; congr 1; ring + +section ConditionalIndependence + +variable [StandardBorelSpace Ω] + +theorem condProb_avoid_eq_prod (hm : m ≤ mΩ) (A : ι → Set Ω) + (hA : ∀ i, MeasurableSet (A i)) (hind : iCondIndepSet m hm A μ) + (S : Finset ι) : + μ⟦⋂ i ∈ S, (A i)ᶜ | m⟧ =ᵐ[μ] + fun ω => ∏ i ∈ S, (1 - (μ⟦A i | m⟧) ω) := by + have hmA : ∀ i, MeasurableSpace.generateFrom {A i} ≤ mΩ := by + intro i + apply MeasurableSpace.generateFrom_le + intro s hs + rcases Set.mem_singleton_iff.mp hs with rfl + exact hA i + have hi := (iCondIndepSet_iff_iCondIndep m hm A μ).mp hind + have hprod := (iCondIndep_iff m hm _ hmA μ).mp hi S + (f := fun i => (A i)ᶜ) (fun i _ => + (MeasurableSpace.measurableSet_generateFrom (Set.mem_singleton (A i))).compl) + have hcomp : ∀ᵐ ω ∂μ, ∀ i ∈ S, + (μ⟦(A i)ᶜ | m⟧) ω = 1 - (μ⟦A i | m⟧) ω := by + exact (ae_ball_iff S.countable_toSet).mpr (fun i _ => condProb_compl hm (hA i)) + filter_upwards [hprod, hcomp] with ω hω hc + rw [hω, Finset.prod_apply] + exact Finset.prod_congr rfl hc + +theorem condProb_avoid_random_selection_le_exp_ae + (hm : m ≤ mΩ) (I : Finset ι) (A : ι → Set Ω) + (hA : ∀ i, MeasurableSet (A i)) (hind : iCondIndepSet m hm A μ) + (J : Ω → Finset ι) + (hJ : ∀ S : Finset ι, MeasurableSet[m] {ω | J ω = S}) + (hJI : ∀ ω, J ω ⊆ I) {H : Set Ω} (hH : MeasurableSet H) + {p r : ℝ} (hp : 0 ≤ p) + (hposterior : ∀ i ∈ I, ∀ᵐ ω ∂μ, i ∈ J ω → p ≤ (μ⟦A i | m⟧) ω) + (hcard : ∀ᵐ ω ∂μ, ω ∈ H → r ≤ ((J ω).card : ℝ)) + (havoid : ∀ᵐ ω ∂μ, ω ∈ H → ∀ i ∈ J ω, ω ∉ A i) : + ∀ᵐ ω ∂μ, (μ⟦H | m⟧) ω ≤ Real.exp (-p * r) := by + classical + have hlocal : ∀ S ∈ I.powerset, ∀ᵐ ω ∂μ, + J ω = S → (μ⟦H | m⟧) ω ≤ Real.exp (-p * r) := by + intro S hS + have hSI : S ⊆ I := Finset.mem_powerset.mp hS + by_cases hSr : r ≤ (S.card : ℝ) + · have hsub : (H ∩ {ω | J ω = S} : Set Ω) ≤ᵐ[μ] (⋂ i ∈ S, (A i)ᶜ : Set Ω) := by + filter_upwards [havoid] with ω ha hω + change ω ∈ (⋂ i ∈ S, (A i)ᶜ : Set Ω) + simp only [Set.mem_iInter, Set.mem_compl_iff] + intro i hi + exact ha hω.1 i (hω.2.symm ▸ hi) + have hloc := condProb_le_on_of_ae_inter_subset (μ := μ) hm hH (hJ S) + (MeasurableSet.biInter S.countable_toSet (fun i _ => (hA i).compl)) hsub + have hprod := condProb_avoid_eq_prod (μ := μ) hm A hA hind S + have hpost : ∀ᵐ ω ∂μ, ∀ i ∈ S, + i ∈ J ω → p ≤ (μ⟦A i | m⟧) ω := + (ae_ball_iff S.countable_toSet).mpr (fun i hi => hposterior i (hSI hi)) + have hnonneg : ∀ᵐ ω ∂μ, ∀ i ∈ S, 0 ≤ 1 - (μ⟦A i | m⟧) ω := by + apply (ae_ball_iff S.countable_toSet).mpr + intro i _ + filter_upwards [condProb_nonneg (μ := μ) (m := m) (A i)ᶜ, + condProb_compl hm (hA i)] with ω hn hc + simpa only [hc] using hn + filter_upwards [hloc, hprod, hpost, hnonneg] with ω hl he hpo hnn hωS + calc + (μ⟦H | m⟧) ω ≤ (μ⟦⋂ i ∈ S, (A i)ᶜ | m⟧) ω := hl hωS + _ = ∏ i ∈ S, (1 - (μ⟦A i | m⟧) ω) := he + _ ≤ Real.exp (-p * S.card) := prod_one_sub_le_exp S _ hnn + (fun i hi => hpo i hi (hωS.symm ▸ hi)) + _ ≤ Real.exp (-p * r) := Real.exp_le_exp.mpr (by nlinarith) + · have hsub : (H ∩ {ω | J ω = S} : Set Ω) ≤ᵐ[μ] (∅ : Set Ω) := by + filter_upwards [hcard] with ω hc hω + have heq : J ω = S := hω.2 + exact (hSr (by simpa only [heq] using hc hω.1)).elim + have hloc := condProb_le_on_of_ae_inter_subset (μ := μ) hm hH (hJ S) + MeasurableSet.empty hsub + filter_upwards [hloc] with ω hl hωS + have hz : (μ⟦H | m⟧) ω ≤ 0 := by simpa using hl hωS + exact hz.trans (Real.exp_pos _).le + have hall := (ae_ball_iff I.powerset.countable_toSet).mpr hlocal + filter_upwards [hall] with ω hω + exact hω (J ω) (Finset.mem_powerset.mpr (hJI ω)) rfl + +theorem condProb_avoid_random_selection_le_exp + (hm : m ≤ mΩ) (I : Finset ι) (A : ι → Set Ω) + (hA : ∀ i, MeasurableSet (A i)) (hind : iCondIndepSet m hm A μ) + (J : Ω → Finset ι) + (hJ : ∀ S : Finset ι, MeasurableSet[m] {ω | J ω = S}) + (hJI : ∀ ω, J ω ⊆ I) {H : Set Ω} (hH : MeasurableSet H) + {p r : ℝ} (hp : 0 ≤ p) + (hposterior : ∀ i ∈ I, ∀ᵐ ω ∂μ, i ∈ J ω → p ≤ (μ⟦A i | m⟧) ω) + (hcard : ∀ ω ∈ H, r ≤ ((J ω).card : ℝ)) + (havoid : ∀ ω ∈ H, ∀ i ∈ J ω, ω ∉ A i) : + ∀ᵐ ω ∂μ, (μ⟦H | m⟧) ω ≤ Real.exp (-p * r) := + condProb_avoid_random_selection_le_exp_ae hm I A hA hind J hJ hJI hH hp + hposterior (Eventually.of_forall hcard) (Eventually.of_forall havoid) + +theorem condProb_half_selection_le_exp + (hm : m ≤ mΩ) (I : Finset ι) (A : ι → Set Ω) + (hA : ∀ i, MeasurableSet (A i)) (hind : iCondIndepSet m hm A μ) + (J : Ω → Finset ι) + (hJ : ∀ S : Finset ι, MeasurableSet[m] {ω | J ω = S}) + (hJI : ∀ ω, J ω ⊆ I) {H : Set Ω} (hH : MeasurableSet H) + {ρ M : ℝ} (hρ : 0 ≤ ρ) (hI : M / 20 ≤ (I.card : ℝ)) + (hposterior : ∀ i ∈ I, ∀ᵐ ω ∂μ, i ∈ J ω → ρ / 10 ≤ (μ⟦A i | m⟧) ω) + (hcard : ∀ ω ∈ H, (I.card : ℝ) / 2 ≤ ((J ω).card : ℝ)) + (havoid : ∀ ω ∈ H, ∀ i ∈ J ω, ω ∉ A i) : + ∀ᵐ ω ∂μ, (μ⟦H | m⟧) ω ≤ Real.exp (-M * ρ / 400) := by + have h := condProb_avoid_random_selection_le_exp hm I A hA hind J hJ hJI hH + (div_nonneg hρ (by norm_num : (0 : ℝ) ≤ 10)) hposterior hcard havoid + filter_upwards [h] with ω hω + apply hω.trans + apply Real.exp_le_exp.mpr + nlinarith + +theorem condProb_avoid_intensity_le_exp_ae + (hm : m ≤ mΩ) (I : Finset ι) (A : ι → Set Ω) + (hA : ∀ i, MeasurableSet (A i)) (hind : iCondIndepSet m hm A μ) + (J : Ω → Finset ι) + (hJ : ∀ S : Finset ι, MeasurableSet[m] {ω | J ω = S}) + (hJI : ∀ ω, J ω ⊆ I) {H : Set Ω} (hH : MeasurableSet H) + {ρ M L : ℝ} (hρ : 0 ≤ ρ) (hL : L ≤ M * ρ) + (hI : M / 20 ≤ (I.card : ℝ)) + (hposterior : ∀ i ∈ I, ∀ᵐ ω ∂μ, i ∈ J ω → ρ / 10 ≤ (μ⟦A i | m⟧) ω) + (hcard : ∀ᵐ ω ∂μ, ω ∈ H → (I.card : ℝ) / 2 ≤ ((J ω).card : ℝ)) + (havoid : ∀ᵐ ω ∂μ, ω ∈ H → ∀ i ∈ J ω, ω ∉ A i) : + ∀ᵐ ω ∂μ, (μ⟦H | m⟧) ω ≤ Real.exp (-L / 400) := by + have h := condProb_avoid_random_selection_le_exp_ae hm I A hA hind J hJ hJI hH + (div_nonneg hρ (by norm_num : (0 : ℝ) ≤ 10)) hposterior hcard havoid + filter_upwards [h] with ω hω + apply hω.trans + apply Real.exp_le_exp.mpr + have hi := mul_le_mul_of_nonneg_right hI hρ + nlinarith + +theorem iCondIndepSet_preimages {β : ι → Type*} + [mβ : ∀ i, MeasurableSpace (β i)] + (hm : m ≤ mΩ) (f : ∀ i, Ω → β i) (hf : ∀ i, Measurable (f i)) + (hind : iCondIndepFun m hm f μ) (C : ∀ i, Set (β i)) + (hC : ∀ i, MeasurableSet (C i)) : + iCondIndepSet m hm (fun i => f i ⁻¹' C i) μ := by + rw [iCondIndepSet_iff m hm _ (fun i => (hf i) (hC i)) μ] + intro S + exact (iCondIndepFun_iff_condExp_inter_preimage_eq_mul mβ f hf).mp hind S + (fun i _ => hC i) + +end ConditionalIndependence +end Invariant233.ConditionalAvoidance + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalConvolution.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb6602f18516439cb802c7c872dfc9aa30011019 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalConvolution.lean @@ -0,0 +1,202 @@ +import OAI.Analysis.IrrationalRotation.Model.ConditionalConvolution +import OAI.Analysis.IrrationalRotation.Couplings.ConditionalL2Tail +import OAI.Analysis.IrrationalRotation.Analysis.OmittedEvents +import OAI.Analysis.IrrationalRotation.Analysis.FiniteWindowIntegralLower +import OAI.Analysis.IrrationalRotation.Couplings.ConditionalConvolutionPointwise + +namespace OAI + +open MeasureTheory +open scoped ENNReal lp ComplexConjugate + +noncomputable section + +namespace InvariantProjection.ConditionalConvolution + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {μ : Measure Ω} +variable {K : ℕ} {D a c η δ : ℝ} + +def exceptionalTail (H : ℤ → Set Ω) (K n : ℕ) + (ξ γ : Ω → ℓ²(ℤ, ℂ)) (ω : Ω) : ℝ := + ∑' v : ℤ, (omittedEvent H K n v).indicator + (fun ω => ‖ξ ω v‖ * ‖γ ω ((n : ℤ) + v)‖) ω + +omit mΩ in +theorem exceptionalTail_nonneg (H : ℤ → Set Ω) (K n : ℕ) + (ξ γ : Ω → ℓ²(ℤ, ℂ)) (ω : Ω) : + 0 ≤ exceptionalTail H K n ξ γ ω := by + apply tsum_nonneg + intro v + exact Set.indicator_nonneg (fun _ _ => mul_nonneg (norm_nonneg _) (norm_nonneg _)) ω + +omit mΩ in +theorem exceptionalTail_eq_productMask (H : ℤ → Set Ω) (K n : ℕ) + (ξ γ : Ω → ℓ²(ℤ, ℂ)) : + exceptionalTail H K n ξ γ = fun ω => ∑' v : ℤ, + ({z : Ω × ℤ | z.1 ∈ omittedEvent H K n z.2}).indicator + (fun z => ‖ξ z.1 z.2‖ * ‖γ z.1 ((n : ℤ) + z.2)‖) (ω, v) := by + funext ω + unfold exceptionalTail + apply tsum_congr + intro v + by_cases hv : ω ∈ omittedEvent H K n v <;> simp [hv] + +omit mΩ in +theorem exceptionalTail_eq_indicatorOne (H : ℤ → Set Ω) (K n : ℕ) + (ξ γ : Ω → ℓ²(ℤ, ℂ)) (ω : Ω) : + exceptionalTail H K n ξ γ ω = ∑' v : ℤ, + (omittedEvent H K n v).indicator (fun _ => (1 : ℝ)) ω * + (‖ξ ω v‖ * ‖γ ω ((n : ℤ) + v)‖) := by + unfold exceptionalTail + apply tsum_congr + intro v + by_cases hv : ω ∈ omittedEvent H K n v <;> simp [hv] + +namespace Data + +variable (d : Data Ω μ K D a c η δ) + +theorem coeffA_measurable (v : ℤ) : Measurable (fun ω => coeffA d.ξ d.Fx ω v) := by + have hx : StronglyMeasurable (fun ω => d.ξ ω v) := + (lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 v).continuous.comp_stronglyMeasurable + (d.ξ_measurable.mono d.mX_le) + exact hx.measurable.div (Complex.continuous_ofReal.measurable.comp (d.Fx_measurable v)) + +theorem coeffB_measurable (v : ℤ) : Measurable (fun ω => coeffB d.γ d.Fy ω v) := by + have hy : StronglyMeasurable (fun ω => d.γ ω (-v)) := + (lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 (-v)).continuous.comp_stronglyMeasurable + (d.γ_measurable.mono d.mY_le) + exact (Complex.continuous_ofReal.measurable.comp (d.Fy_measurable (-v))).mul + (Complex.continuous_conj.measurable.comp hy.measurable) + +theorem integrableOn_norm_truncated [IsFiniteMeasure μ] (n : ℕ) : + IntegrableOn (fun ω => ‖truncated K n (coeffA d.ξ d.Fx ω) (coeffB d.γ d.Fy ω)‖) d.E μ := by + exact Invariant233.FiniteWindow.integrableOn_norm_convolution μ d.E + (measure_lt_top μ d.E) K n D (coeffA d.ξ d.Fx) (coeffB d.γ d.Fy) + d.coeffA_measurable d.coeffB_measurable + (d.coefficient_bounds.mono fun _ h => h.1) + (d.coefficient_bounds.mono fun _ h => h.2.1) + +theorem first_tail_bound [IsProbabilityMeasure μ] (n : ℕ) (hδ : 0 ≤ δ) : + Integrable (exceptionalTail d.H₁ K n d.ξ d.γ) μ ∧ + (∫ ω, exceptionalTail d.H₁ K n d.ξ d.γ ω ∂μ) ≤ Real.sqrt δ := by + have h := integral_l2_masked_tail_le_of_condExp (mΩ := mΩ) + d.ξ d.γ (d.γ_measurable.mono d.mY_le) d.ξ_unit d.γ_unit + (Equiv.addLeft (n : ℤ)) + (measurableSet_omittedMask d.H₁ K n (fun k _ => d.H₁_measurable k)) + d.mX_le d.ξ_measurable hδ + (condExp_omittedMask_section_le μ d.mX d.H₁ K n hδ d.conditional₁) + rw [exceptionalTail_eq_productMask] + exact h.2 + +theorem second_tail_bound [IsProbabilityMeasure μ] (n : ℕ) (hδ : 0 ≤ δ) : + Integrable (exceptionalTail d.H₂ K n d.ξ d.γ) μ ∧ + (∫ ω, exceptionalTail d.H₂ K n d.ξ d.γ ω ∂μ) ≤ Real.sqrt δ := by + have h := integral_l2_masked_tail_le_of_condExp_right (mΩ := mΩ) + d.ξ d.γ (d.ξ_measurable.mono d.mX_le) d.ξ_unit d.γ_unit + (Equiv.addLeft (n : ℤ)) + (measurableSet_omittedMask d.H₂ K n (fun k _ => d.H₂_measurable k)) + d.mY_le d.γ_measurable hδ + (condExp_omittedMask_section_le μ d.mY d.H₂ K n hδ d.conditional₂) + rw [exceptionalTail_eq_productMask] + exact h + +theorem integral_truncated_le_of_pointwise [IsProbabilityMeasure μ] + (n : ℕ) (hη : 0 ≤ η) (hδ : 0 ≤ δ) + (hpoint : ∀ᵐ ω ∂μ.restrict d.E, + ‖truncated K n (coeffA d.ξ d.Fx ω) (coeffB d.γ d.Fy ω)‖ ≤ + η + exceptionalTail d.H₁ K n d.ξ d.γ ω + exceptionalTail d.H₂ K n d.ξ d.γ ω) : + (∫ ω in d.E, ‖truncated K n (coeffA d.ξ d.Fx ω) (coeffB d.γ d.Fy ω)‖ ∂μ) ≤ + η + 2 * Real.sqrt δ := by + obtain ⟨ht₁, hb₁⟩ := d.first_tail_bound n hδ + obtain ⟨ht₂, hb₂⟩ := d.second_tail_bound n hδ + have hi : Integrable (d.E.indicator (fun ω => + ‖truncated K n (coeffA d.ξ d.Fx ω) (coeffB d.γ d.Fy ω)‖)) μ := + (integrable_indicator_iff d.E_measurable).mpr (d.integrableOn_norm_truncated n) + have hfull : ∀ᵐ ω ∂μ, + d.E.indicator (fun ω => ‖truncated K n (coeffA d.ξ d.Fx ω) (coeffB d.γ d.Fy ω)‖) ω ≤ + η + exceptionalTail d.H₁ K n d.ξ d.γ ω + exceptionalTail d.H₂ K n d.ξ d.γ ω := by + filter_upwards [(ae_restrict_iff' d.E_measurable).mp hpoint] with ω hω + by_cases hE : ω ∈ d.E + · simpa only [Set.indicator_of_mem hE] using hω hE + · rw [Set.indicator_of_notMem hE] + exact add_nonneg (add_nonneg hη (exceptionalTail_nonneg _ _ _ _ _ _)) + (exceptionalTail_nonneg _ _ _ _ _ _) + have hiR := ((integrable_const η).add ht₁).add ht₂ + have hbound := integral_mono_ae hi hiR hfull + rw [integral_indicator d.E_measurable] at hbound + have heval : (∫ ω, ((fun _ : Ω => η) + exceptionalTail d.H₁ K n d.ξ d.γ + + exceptionalTail d.H₂ K n d.ξ d.γ) ω ∂μ) = + η + (∫ ω, exceptionalTail d.H₁ K n d.ξ d.γ ω ∂μ) + + (∫ ω, exceptionalTail d.H₂ K n d.ξ d.γ ω ∂μ) := by + calc + _ = (∫ ω, ((fun _ : Ω => η) + exceptionalTail d.H₁ K n d.ξ d.γ) ω ∂μ) + + ∫ ω, exceptionalTail d.H₂ K n d.ξ d.γ ω ∂μ := + integral_add ((integrable_const η).add ht₁) ht₂ + _ = ((∫ _ : Ω, η ∂μ) + ∫ ω, exceptionalTail d.H₁ K n d.ξ d.γ ω ∂μ) + + ∫ ω, exceptionalTail d.H₂ K n d.ξ d.γ ω ∂μ := by + rw [show (∫ ω, ((fun _ : Ω => η) + exceptionalTail d.H₁ K n d.ξ d.γ) ω ∂μ) = + (∫ _ : Ω, η ∂μ) + ∫ ω, exceptionalTail d.H₁ K n d.ξ d.γ ω ∂μ from + integral_add (integrable_const η) ht₁] + _ = _ := by simp + rw [heval] at hbound + linarith + +theorem pointwise_truncated_bound (n : ℕ) (hn : n ≤ 2 * K) (hη : 0 ≤ η) : + ∀ᵐ ω ∂μ.restrict d.E, + ‖truncated K n (coeffA d.ξ d.Fx ω) (coeffB d.γ d.Fy ω)‖ ≤ + η + exceptionalTail d.H₁ K n d.ξ d.γ ω + exceptionalTail d.H₂ K n d.ξ d.γ ω := by + filter_upwards [ae_restrict_of_ae d.ξ_unit, ae_restrict_of_ae d.γ_unit, + ae_restrict_of_ae (d.ratio_bounds n hn), ae_restrict_of_ae (d.zero_convolution n hn), + d.attenuation] with ω hξ hγ hr hz ht + have hz' : (∑' v : ℤ, (d.ξ ω v / (d.Fx ω v : ℂ)) * + ((d.Fy ω ((n : ℤ) + v) : ℂ) * conj (d.γ ω ((n : ℤ) + v)))) = 0 := by + simpa only [coeffA, coeffB, neg_sub, neg_neg, sub_neg_eq_add, add_comm] using hz + have h := pointwise_bound K n (d.Fx ω) (d.Fy ω) (d.ξ ω) (d.γ ω) + hξ hγ η hη d.H₁ d.H₂ ω hr hz' ht + rw [← exceptionalTail_eq_indicatorOne, ← exceptionalTail_eq_indicatorOne] at h + exact h + +theorem obstruction_of_pointwise [IsProbabilityMeasure μ] + {ε : ℝ} (hε : 0 ≤ ε) + (hcoeff : ∀ A B : ℤ → ℂ, + (∀ v : ℤ, |v| ≤ (K : ℤ) → ‖A v‖ ≤ D) → + (∀ v : ℤ, |v| ≤ (K : ℤ) → ‖B v‖ ≤ D) → + a ≤ ‖A 0‖ → a ≤ ‖B 0‖ → + ε ≤ ∑ n ∈ Finset.range (2 * K + 1), ‖truncated K n A B‖) + (hη : 0 ≤ η) (hδ : 0 ≤ δ) + (hpoint : ∀ n : ℕ, n ≤ 2 * K → ∀ᵐ ω ∂μ.restrict d.E, + ‖truncated K n (coeffA d.ξ d.Fx ω) (coeffB d.γ d.Fy ω)‖ ≤ + η + exceptionalTail d.H₁ K n d.ξ d.γ ω + exceptionalTail d.H₂ K n d.ξ d.γ ω) : + c * ε ≤ ((2 * K + 1 : ℕ) : ℝ) * (η + 2 * Real.sqrt δ) := by + apply Invariant233.FiniteWindow.finite_sum_obstruction μ d.E (2 * K + 1) + (fun n ω => ‖truncated K n (coeffA d.ξ d.Fx ω) (coeffB d.γ d.Fy ω)‖) + c ε (η + 2 * Real.sqrt δ) hε d.E_mass + · intro n _ + exact d.integrableOn_norm_truncated n + · exact Invariant233.FiniteWindow.integral_lower_of_sum_bound μ K D a ε hcoeff + d.E (coeffA d.ξ d.Fx) (coeffB d.γ d.Fy) + d.coeffA_measurable d.coeffB_measurable d.coefficient_bounds + · intro n hn + exact d.integral_truncated_le_of_pointwise n hη hδ + (hpoint n (Nat.lt_succ_iff.mp (Finset.mem_range.mp hn))) + +end Data + +theorem conditional_convolution_obstruction + (K : ℕ) (D a : ℝ) (ha : 0 < a) : + ∃ ε > 0, ∀ {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + [IsProbabilityMeasure μ] (c η δ : ℝ), + 0 ≤ η → 0 ≤ δ → ∀ _ : Data Ω μ K D a c η δ, + c * ε ≤ ((2 * K + 1 : ℕ) : ℝ) * (η + 2 * Real.sqrt δ) := by + obtain ⟨ε, hε, hcoeff⟩ := Invariant233.FiniteWindow.uniform_convolution_sum_lower_bound K D a ha + refine ⟨ε, hε, ?_⟩ + intro Ω mΩ μ hμ c η δ hη hδ d + exact d.obstruction_of_pointwise hε.le hcoeff hη hδ + (fun n hn => d.pointwise_truncated_bound n hn hη) + +end InvariantProjection.ConditionalConvolution + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalConvolutionPointwise.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalConvolutionPointwise.lean new file mode 100644 index 0000000000000000000000000000000000000000..530af5b92d03b5889e74266faf1cbab4c4d1ac57 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalConvolutionPointwise.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.IrrationalRotation.Model.ConditionalConvolution +import OAI.Analysis.IrrationalRotation.Analysis.PointwiseConvolution + +namespace OAI + +open scoped ComplexConjugate ENNReal lp + +namespace InvariantProjection.ConditionalConvolution + +theorem tsum_omittedEvent {Ω : Type*} (H : ℤ → Set Ω) (K n : ℕ) + (ω : Ω) (w : ℤ → ℝ) : + (∑' v : ↑(((window K n) : Set ℤ)ᶜ), + (H (selector K n v)).indicator (fun _ => (1 : ℝ)) ω * w v) = + ∑' v : ℤ, (omittedEvent H K n v).indicator (fun _ => (1 : ℝ)) ω * w v := by + classical + rw [tsum_subtype (((window K n) : Set ℤ)ᶜ) + (fun v : ℤ => (H (selector K n v)).indicator (fun _ => (1 : ℝ)) ω * w v)] + apply tsum_congr + intro v + by_cases hv : v ∈ window K n <;> simp [omittedEvent, hv] + +theorem pointwise_bound {Ω : Type*} (K n : ℕ) (Fx Fy : ℤ → ℝ) + (ξ γ : ℓ²(ℤ, ℂ)) (hξ : ‖ξ‖ ≤ 1) (hγ : ‖γ‖ ≤ 1) + (η : ℝ) (hη : 0 ≤ η) (H₁ H₂ : ℤ → Set Ω) (ω : Ω) + (hratio : ∀ v : ℤ, 0 < Fy ((n : ℤ) + v) / Fx v ∧ + Fy ((n : ℤ) + v) / Fx v ≤ min (Fy v / Fx v) + (Fy ((n : ℤ) + v) / Fx ((n : ℤ) + v)) ∧ + min (Fy v / Fx v) (Fy ((n : ℤ) + v) / Fx ((n : ℤ) + v)) ≤ 1) + (hzero : (∑' v : ℤ, (ξ v / (Fx v : ℂ)) * + ((Fy ((n : ℤ) + v) : ℂ) * conj (γ ((n : ℤ) + v)))) = 0) + (htail : ∀ k : ℤ, (K : ℤ) < |k| → Fy k / Fx k ≤ η + + (H₁ k).indicator (fun _ => (1 : ℝ)) ω + + (H₂ k).indicator (fun _ => (1 : ℝ)) ω) : + ‖truncated K n (fun v => ξ v / (Fx v : ℂ)) + (fun w => (Fy (-w) : ℂ) * conj (γ (-w)))‖ ≤ η + + (∑' v : ℤ, (omittedEvent H₁ K n v).indicator (fun _ => (1 : ℝ)) ω * + (‖ξ v‖ * ‖γ ((n : ℤ) + v)‖)) + + (∑' v : ℤ, (omittedEvent H₂ K n v).indicator (fun _ => (1 : ℝ)) ω * + (‖ξ v‖ * ‖γ ((n : ℤ) + v)‖)) := by + classical + have hmask (H : ℤ → Set Ω) (k : ℤ) : + ({k | ω ∈ H k} : Set ℤ).indicator (fun _ => (1 : ℝ)) k = + (H k).indicator (fun _ => (1 : ℝ)) ω := by + simp only [Set.indicator_apply, Set.mem_ofPred_eq] + have hdom := InvariantProjection.l2_masked_convolution_tail_selector + (window K n) ξ γ (Equiv.addLeft (n : ℤ)) hξ hγ + (fun v => Fy ((n : ℤ) + v) / Fx v) + (fun v => ⟨(hratio v).1.le, (hratio v).2.1.trans (hratio v).2.2⟩) + η hη {k | ω ∈ H₁ k} {k | ω ∈ H₂ k} (selector K n) + (by + change (∑' v : ℤ, ((Fy ((n : ℤ) + v) / Fx v : ℝ) : ℂ) * ξ v * + conj (γ ((n : ℤ) + v))) = 0 + calc + _ = ∑' v : ℤ, (ξ v / (Fx v : ℂ)) * + ((Fy ((n : ℤ) + v) : ℂ) * conj (γ ((n : ℤ) + v))) := by + apply tsum_congr + intro v + exact (InvariantProjection.convolution_coefficient_factorization Fx Fy + (fun v => ξ v) (fun v => γ v) (n : ℤ) v).symm + _ = 0 := hzero) + (by + intro v hv + have hvw : ¬ (|v| ≤ (K : ℤ) ∧ |(n : ℤ) + v| ≤ (K : ℤ)) := by + intro hw + apply hv + simp only [window, Finset.mem_filter, Finset.mem_Icc] + exact ⟨abs_le.mp hw.1, hw.2⟩ + have hk := InvariantProjection.omitted_index_selector (K : ℤ) (n : ℤ) v hvw + have hb := (InvariantProjection.omitted_index_ratio_bound (K : ℤ) (n : ℤ) v + (fun k => Fy k / Fx k) _ (hratio v).2.1).trans (htail _ hk) + simpa only [selector, hmask] using hb) + simp only [hmask] at hdom + rw [tsum_omittedEvent H₁ K n ω + (fun v => ‖ξ v‖ * ‖γ ((Equiv.addLeft (n : ℤ)) v)‖), + tsum_omittedEvent H₂ K n ω + (fun v => ‖ξ v‖ * ‖γ ((Equiv.addLeft (n : ℤ)) v)‖)] at hdom + convert hdom using 1 + congr 1 + apply Finset.sum_congr rfl + intro v hv + change (ξ v / (Fx v : ℂ)) * + ((Fy (-(-(n : ℤ) - v)) : ℂ) * conj (γ (-(-(n : ℤ) - v)))) = _ + have hsign : -(-(n : ℤ) - v) = (n : ℤ) + v := by omega + rw [hsign] + exact InvariantProjection.convolution_coefficient_factorization Fx Fy (fun v => ξ v) (fun v => γ v) (n : ℤ) v + all_goals rfl + +end InvariantProjection.ConditionalConvolution + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalCrossingAvoidance.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalCrossingAvoidance.lean new file mode 100644 index 0000000000000000000000000000000000000000..c24d043fc7e149624806d8d37596cd49d1b12855 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalCrossingAvoidance.lean @@ -0,0 +1,189 @@ +import OAI.Analysis.IrrationalRotation.Analysis.CrossingAvoidance +import OAI.Analysis.IrrationalRotation.Couplings.ConditionalKernelSupport +import Mathlib.Probability.Independence.Conditional + +namespace OAI + +open MeasureTheory ProbabilityTheory +open scoped BigOperators + +namespace Invariant233.CrossingAvoidance + +section KernelBounds + +variable {ι Ω Y : Type*} [Countable ι] [MeasurableSpace Ω] [MeasurableSpace Y] + +theorem kernel_iIndepSet_ae (κ : Kernel Y Ω) (ν : Measure Y) + (events : ι → Set Ω) (hmeas : ∀ i, MeasurableSet (events i)) + (hind : Kernel.iIndepSet events κ ν) : + ∀ᵐ y ∂ν, iIndepSet events (κ y) := by + have hall : ∀ᵐ y ∂ν, ∀ s : Finset ι, + κ y (⋂ i ∈ s, events i) = ∏ i ∈ s, κ y (events i) := + ae_all_iff.mpr (fun s => hind.meas_biInter s) + filter_upwards [hall] with y hy + exact (iIndepSet_iff_meas_biInter hmeas).mpr hy + +theorem kernel_avoid_le_exp (κ : Kernel Y Ω) (ν : Measure Y) + (events : ι → Set Ω) (hmeas : ∀ i, MeasurableSet (events i)) + (hind : Kernel.iIndepSet events κ ν) (selected : Y → Finset ι) (p : Y → ℝ) + (hp : ∀ᵐ y ∂ν, ∀ i ∈ selected y, p y ≤ (κ y).real (events i)) : + ∀ᵐ y ∂ν, (κ y).real (⋂ i ∈ selected y, (events i)ᶜ) ≤ + Real.exp (-((selected y).card : ℝ) * p y) := by + filter_upwards [kernel_iIndepSet_ae κ ν events hmeas hind, hp] with y hy hp + let : IsProbabilityMeasure (κ y) := hy.isProbabilityMeasure + exact measureReal_avoid_le_exp (κ y) events hy hmeas (selected y) (p y) hp + +theorem kernel_bad_le_exp_intensity (κ : Kernel Y Ω) (ν : Measure Y) + (events : ι → Set Ω) (hmeas : ∀ i, MeasurableSet (events i)) + (hind : Kernel.iIndepSet events κ ν) (selected : Y → Finset ι) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) + (hcard : ∀ᵐ y ∂ν, m / 40 ≤ ((selected y).card : ℝ)) + (hp : ∀ᵐ y ∂ν, ∀ i ∈ selected y, ρ / 10 ≤ (κ y).real (events i)) + (bad : Y → Set Ω) + (hbad : ∀ᵐ y ∂ν, ∀ᵐ ω ∂κ y, + ω ∈ bad y → ∀ i ∈ selected y, ω ∉ events i) : + ∀ᵐ y ∂ν, (κ y).real (bad y) ≤ Real.exp (-L / 400) := by + filter_upwards [kernel_iIndepSet_ae κ ν events hmeas hind, hcard, hp, hbad] + with y hy hcard hp hbad + let : IsProbabilityMeasure (κ y) := hy.isProbabilityMeasure + have hsubset : bad y ≤ᵐ[κ y] ⋂ i ∈ selected y, (events i)ᶜ := by + filter_upwards [hbad] with ω hω + intro hb + exact Set.mem_iInter.mpr (fun i => Set.mem_iInter.mpr (fun hi => hω hb i hi)) + have hmono : (κ y).real (bad y) ≤ (κ y).real (⋂ i ∈ selected y, (events i)ᶜ) := + ENNReal.toReal_mono (measure_ne_top _ _) (measure_mono_ae hsubset) + refine hmono.trans ?_ + exact measureReal_le_exp_intensity (κ y) events hy hmeas (selected y) m ρ L + hρ hcard hL hp _ (Set.Subset.refl _) + +theorem kernel_bad_le_exp_intensity_on (κ : Kernel Y Ω) (ν : Measure Y) + (events : ι → Set Ω) (hmeas : ∀ i, MeasurableSet (events i)) + (hind : Kernel.iIndepSet events κ ν) (selected : Y → Finset ι) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) (active : Y → Prop) + (hcard : ∀ᵐ y ∂ν, active y → m / 40 ≤ ((selected y).card : ℝ)) + (hp : ∀ᵐ y ∂ν, active y → ∀ i ∈ selected y, ρ / 10 ≤ (κ y).real (events i)) + (bad : Y → Set Ω) + (hzero : ∀ᵐ y ∂ν, ¬ active y → κ y (bad y) = 0) + (hbad : ∀ᵐ y ∂ν, ∀ᵐ ω ∂κ y, + ω ∈ bad y → ∀ i ∈ selected y, ω ∉ events i) : + ∀ᵐ y ∂ν, (κ y).real (bad y) ≤ Real.exp (-L / 400) := by + filter_upwards [kernel_iIndepSet_ae κ ν events hmeas hind, hcard, hp, hzero, hbad] + with y hy hcard hp hzero hbad + let : IsProbabilityMeasure (κ y) := hy.isProbabilityMeasure + by_cases ha : active y + · have hsubset : bad y ≤ᵐ[κ y] ⋂ i ∈ selected y, (events i)ᶜ := by + filter_upwards [hbad] with ω hω + intro hb + exact Set.mem_iInter.mpr (fun i => Set.mem_iInter.mpr (fun hi => hω hb i hi)) + have hmono : (κ y).real (bad y) ≤ (κ y).real (⋂ i ∈ selected y, (events i)ᶜ) := + ENNReal.toReal_mono (measure_ne_top _ _) (measure_mono_ae hsubset) + exact hmono.trans (measureReal_le_exp_intensity (κ y) events hy hmeas (selected y) m ρ L + hρ (hcard ha) hL (hp ha) _ (Set.Subset.refl _)) + · change (κ y (bad y)).toReal ≤ _ + rw [hzero ha, ENNReal.toReal_zero] + exact (Real.exp_pos _).le + +end KernelBounds + +section ConditionalExpectation + +variable {ι Ω : Type*} [Countable ι] + +theorem iCondIndepSet_ae_condExpKernel (m' : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} + [StandardBorelSpace Ω] (hm' : m' ≤ mΩ) (μ : Measure Ω) [IsFiniteMeasure μ] + (events : ι → Set Ω) (hmeas : ∀ i, MeasurableSet (events i)) + (hind : iCondIndepSet m' hm' events μ) : + ∀ᵐ x ∂μ, iIndepSet events (condExpKernel μ m' x) := by + exact ae_of_ae_trim hm' + (@kernel_iIndepSet_ae ι Ω Ω ‹Countable ι› mΩ m' + (condExpKernel μ m') (μ.trim hm') events hmeas hind) + +theorem conditional_bad_le_exp_intensity (m' : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} + [StandardBorelSpace Ω] (hm' : m' ≤ mΩ) (μ : Measure Ω) [IsFiniteMeasure μ] + (events : ι → Set Ω) (hmeas : ∀ i, MeasurableSet (events i)) + (hind : iCondIndepSet m' hm' events μ) (selected : Ω → Finset ι) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) (active : Ω → Prop) + (hcard : ∀ᵐ x ∂μ, active x → m / 40 ≤ ((selected x).card : ℝ)) + (hp : ∀ᵐ x ∂μ, active x → ∀ i ∈ selected x, + ρ / 10 ≤ (condExpKernel μ m' x).real (events i)) + (bad : Set Ω) (hbadmeas : MeasurableSet bad) + (hzero : ∀ᵐ x ∂μ, ¬ active x → condExpKernel μ m' x bad = 0) + (hbad : ∀ᵐ x ∂μ, ∀ᵐ ω ∂condExpKernel μ m' x, + ω ∈ bad → ∀ i ∈ selected x, ω ∉ events i) : + ∀ᵐ x ∂μ, (μ[bad.indicator (fun _ => (1 : ℝ)) | m']) x ≤ + Real.exp (-L / 400) := by + filter_upwards [iCondIndepSet_ae_condExpKernel m' hm' μ events hmeas hind, + hcard, hp, hzero, hbad, condExpKernel_ae_eq_condExp hm' hbadmeas] + with x hx hcard hp hzero hbad heq + rw [← heq] + let : IsProbabilityMeasure (condExpKernel μ m' x) := hx.isProbabilityMeasure + by_cases ha : active x + · have hsubset : bad ≤ᵐ[condExpKernel μ m' x] ⋂ i ∈ selected x, (events i)ᶜ := by + filter_upwards [hbad] with ω hω + intro hb + exact Set.mem_iInter.mpr (fun i => Set.mem_iInter.mpr (fun hi => hω hb i hi)) + have hmono : (condExpKernel μ m' x).real bad ≤ + (condExpKernel μ m' x).real (⋂ i ∈ selected x, (events i)ᶜ) := + ENNReal.toReal_mono (measure_ne_top _ _) (measure_mono_ae hsubset) + exact hmono.trans (measureReal_le_exp_intensity (condExpKernel μ m' x) events hx hmeas + (selected x) m ρ L hρ (hcard ha) hL (hp ha) _ (Set.Subset.refl _)) + · change (condExpKernel μ m' x bad).toReal ≤ _ + rw [hzero ha, ENNReal.toReal_zero] + exact (Real.exp_pos _).le + +theorem conditional_bad_le_exp_of_endpoint {Y : Type*} + (m' : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω] + [MeasurableSpace Y] [MeasurableEq Y] + (hm' : m' ≤ mΩ) (μ : Measure Ω) [IsFiniteMeasure μ] + (events : ι → Set Ω) (hmeas : ∀ i, MeasurableSet (events i)) + (hind : iCondIndepSet m' hm' events μ) + (endpoint : Ω → Y) (hendpoint : Measurable[m'] endpoint) + (selected : Y → Finset ι) (active : Y → Prop) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) + (hcard : ∀ y, active y → m / 40 ≤ ((selected y).card : ℝ)) + (hp : ∀ᵐ x ∂μ, active (endpoint x) → ∀ i ∈ selected (endpoint x), + ρ / 10 ≤ (μ[(events i).indicator (fun _ => (1 : ℝ)) | m']) x) + (bad : Set Ω) (hbadmeas : MeasurableSet bad) + (hbad : ∀ᵐ ω ∂μ, ω ∈ bad → active (endpoint ω) ∧ + ∀ i ∈ selected (endpoint ω), ω ∉ events i) : + ∀ᵐ x ∂μ, (μ[bad.indicator (fun _ => (1 : ℝ)) | m']) x ≤ + Real.exp (-L / 400) := by + have heq : ∀ᵐ x ∂μ, ∀ i, (condExpKernel μ m' x).real (events i) = + (μ[(events i).indicator (fun _ => (1 : ℝ)) | m']) x := + ae_all_iff.mpr (fun i => condExpKernel_ae_eq_condExp hm' (hmeas i)) + have hpKernel : ∀ᵐ x ∂μ, active (endpoint x) → ∀ i ∈ selected (endpoint x), + ρ / 10 ≤ (condExpKernel μ m' x).real (events i) := by + filter_upwards [hp, heq] with x hx heq + intro ha i hi + rw [heq i] + exact hx ha i hi + have hfixed := condExpKernel_ae_eq_of_measurable m' hm' μ endpoint hendpoint + have hlift := ae_ae_condExpKernel_of_ae m' hm' μ hbad + have hsupport : ∀ᵐ x ∂μ, ∀ᵐ ω ∂condExpKernel μ m' x, + ω ∈ bad → active (endpoint x) ∧ ∀ i ∈ selected (endpoint x), ω ∉ events i := by + filter_upwards [hfixed, hlift] with x hfixed hlift + filter_upwards [hfixed, hlift] with ω hfixed hlift + intro hb + simpa only [hfixed] using hlift hb + have hzero : ∀ᵐ x ∂μ, ¬ active (endpoint x) → condExpKernel μ m' x bad = 0 := by + filter_upwards [hsupport] with x hx + intro ha + have hn : ∀ᵐ ω ∂condExpKernel μ m' x, ω ∉ bad := by + filter_upwards [hx] with ω hω + exact fun hb => ha (hω hb).1 + simpa only [not_not, Set.ofPred_mem_eq] using (ae_iff.mp hn) + have havoid : ∀ᵐ x ∂μ, ∀ᵐ ω ∂condExpKernel μ m' x, + ω ∈ bad → ∀ i ∈ selected (endpoint x), ω ∉ events i := by + filter_upwards [hsupport] with x hx + filter_upwards [hx] with ω hω + exact fun hb => (hω hb).2 + exact conditional_bad_le_exp_intensity m' hm' μ events hmeas hind + (fun x => selected (endpoint x)) m ρ L hρ hL (fun x => active (endpoint x)) + (Filter.Eventually.of_forall (fun x => hcard (endpoint x))) hpKernel + bad hbadmeas hzero havoid + +end ConditionalExpectation + +end Invariant233.CrossingAvoidance + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalDistributionEvents.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalDistributionEvents.lean new file mode 100644 index 0000000000000000000000000000000000000000..db4ca59ea6034b2c8efd790a0cdc9ae66a4f41b0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalDistributionEvents.lean @@ -0,0 +1,71 @@ +import Mathlib.Probability.Independence.Conditional +import Mathlib.Probability.Independence.Basic + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped BigOperators ProbabilityTheory + +namespace Invariant233.ConditionalDistributionEvents + +variable {ι Ω X Y : Type*} [Countable ι] + [MeasurableSpace Ω] [StandardBorelSpace Ω] + [MeasurableSpace X] [MeasurableSpace Y] [StandardBorelSpace Y] [Nonempty Y] + +theorem iCondIndepSet_preimage_of_condDistrib + (μ : Measure Ω) [IsFiniteMeasure μ] + (observed : Ω → X) (value : Ω → Y) + (hobserved : Measurable observed) (hvalue : Measurable value) + (events : ι → Set Y) (hevents : ∀ i, MeasurableSet (events i)) + (hind : ∀ᵐ x ∂μ.map observed, + iIndepSet events (condDistrib value observed μ x)) : + iCondIndepSet (MeasurableSpace.comap observed inferInstance) hobserved.comap_le + (fun i => value ⁻¹' events i) μ := by + apply (iCondIndepSet_iff _ _ _ (fun i => hvalue (hevents i)) μ).mpr + intro S + have hi : MeasurableSet (⋂ i ∈ S, events i) := + MeasurableSet.biInter S.countable_toSet (fun i _ => hevents i) + have hfull := ae_of_ae_map hobserved.aemeasurable hind + have heach : ∀ᵐ ω ∂μ, ∀ i, + (condDistrib value observed μ (observed ω)).real (events i) = + (μ⟦value ⁻¹' events i | MeasurableSpace.comap observed inferInstance⟧) ω := + ae_all_iff.mpr (fun i => condDistrib_ae_eq_condExp hobserved hvalue (hevents i)) + filter_upwards [hfull, heach, condDistrib_ae_eq_condExp hobserved hvalue hi] + with ω hω heach hinter + have hprod := (iIndepSet_iff_meas_biInter hevents).mp hω S + have hreal := congrArg ENNReal.toReal hprod + simp only [ENNReal.toReal_prod] at hreal + have hpre : value ⁻¹' (⋂ i ∈ S, events i) = ⋂ i ∈ S, value ⁻¹' events i := by + ext z + simp + rw [hpre] at hinter + simp only [Finset.prod_apply] + rw [← hinter] + change (condDistrib value observed μ (observed ω) (⋂ i ∈ S, events i)).toReal = _ + rw [hreal] + exact Finset.prod_congr rfl (fun i _ => heach i) + +theorem iCondIndepSet_coordinate_preimage_of_condDistrib + {Z : ι → Type*} [∀ i, MeasurableSpace (Z i)] + (μ : Measure Ω) [IsFiniteMeasure μ] + (observed : Ω → X) (value : Ω → Y) + (hobserved : Measurable observed) (hvalue : Measurable value) + (coordinate : ∀ i, Y → Z i) (hcoordinate : ∀ i, Measurable (coordinate i)) + (events : ∀ i, Set (Z i)) (hevents : ∀ i, MeasurableSet (events i)) + (hind : ∀ᵐ x ∂μ.map observed, + iIndepFun coordinate (condDistrib value observed μ x)) : + iCondIndepSet (MeasurableSpace.comap observed inferInstance) hobserved.comap_le + (fun i => (fun ω => coordinate i (value ω)) ⁻¹' events i) μ := by + apply iCondIndepSet_preimage_of_condDistrib μ observed value hobserved hvalue + (fun i => coordinate i ⁻¹' events i) (fun i => hcoordinate i (hevents i)) + filter_upwards [hind] with x hx + apply (iIndepSet_iff_meas_biInter (fun i => hcoordinate i (hevents i))).mpr + intro S + exact hx.measure_inter_preimage_eq_mul S (fun i _ => hevents i) + +end Invariant233.ConditionalDistributionEvents + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalEndpointTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalEndpointTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..95fc5074492f26580d3e725a233005de4232fce8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalEndpointTransport.lean @@ -0,0 +1,39 @@ +import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic +import Mathlib.MeasureTheory.Function.FactorsThrough + +namespace OAI + +open MeasureTheory + +namespace Invariant233.ConditionalEndpointTransport + +variable {Ω X Y E : Type*} [mΩ : MeasurableSpace Ω] + [mX : MeasurableSpace X] [mY : MeasurableSpace Y] + [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + +theorem condExp_comap_encode_ae_eq + (μ : Measure Ω) [IsFiniteMeasure μ] (x : Ω → X) (hx : Measurable x) + (encode : X → Y) (hencode : Measurable encode) + (decode : Y → X) (hdecode : Measurable decode) + (hinverse : ∀ᵐ ω ∂μ, decode (encode (x ω)) = x ω) (f : Ω → E) : + μ[f | mY.comap (encode ∘ x)] =ᵐ[μ] μ[f | mX.comap x] := by + have hxy : mY.comap (encode ∘ x) ≤ mX.comap x := + (hencode.comp (Measurable.of_comap_le le_rfl)).comap_le + have hy : Measurable (encode ∘ x) := hencode.comp hx + obtain ⟨g, hg, hfactor⟩ := + (stronglyMeasurable_condExp (μ := μ) (f := f) (m := mX.comap x)).exists_eq_measurable_comp + have hgm : AEStronglyMeasurable[mY.comap (encode ∘ x)] + (μ[f | mX.comap x]) μ := by + have hmeas : StronglyMeasurable[mY.comap (encode ∘ x)] + (fun ω => g (decode (encode (x ω)))) := + hg.comp_measurable (hdecode.comp (Measurable.of_comap_le le_rfl)) + apply hmeas.aestronglyMeasurable.congr + filter_upwards [hinverse] with ω hω + rw [hω, hfactor] + rfl + exact (condExp_condExp_of_le hxy hx.comap_le).symm.trans + (condExp_of_aestronglyMeasurable' hy.comap_le hgm integrable_condExp) + +end Invariant233.ConditionalEndpointTransport + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalEventBridge.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalEventBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..52da1e2fbd24401723a9f8252ca7058ca937e839 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalEventBridge.lean @@ -0,0 +1,48 @@ +import Mathlib.Probability.Independence.Conditional +import Mathlib.Probability.Independence.Basic + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped BigOperators + +namespace Invariant233.ConditionalEventBridge + +variable {Ω A B ι : Type*} + [MeasurableSpace Ω] [StandardBorelSpace Ω] + [MeasurableSpace A] [MeasurableSpace B] [StandardBorelSpace B] [Nonempty B] + [Countable ι] + +theorem iCondIndepSet_preimage_of_condDistrib + (μ : Measure Ω) [IsFiniteMeasure μ] + (X : Ω → A) (Y : Ω → B) (hX : Measurable X) (hY : Measurable Y) + (s : ι → Set B) (hs : ∀ i, MeasurableSet (s i)) + (hind : ∀ᵐ x ∂μ.map X, iIndepSet s (condDistrib Y X μ x)) : + iCondIndepSet (MeasurableSpace.comap X inferInstance) hX.comap_le + (fun i => Y ⁻¹' s i) μ := by + apply (iCondIndepSet_iff _ _ _ (fun i => hY (hs i)) μ).2 + intro S + have hi : ∀ᵐ ω ∂μ, ∀ i, + (condDistrib Y X μ (X ω)).real (s i) = + (μ[(Y ⁻¹' s i).indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap X inferInstance]) ω := + ae_all_iff.mpr (fun i => condDistrib_ae_eq_condExp hX hY (hs i)) + have hinter := condDistrib_ae_eq_condExp (μ := μ) hX hY + (MeasurableSet.biInter S.countable_toSet (fun i _ => hs i)) + have hind' := ae_of_ae_map hX.aemeasurable hind + filter_upwards [hi, hinter, hind'] with ω hω hI hInd + simp only [Set.preimage_iInter, Finset.mem_coe] at hI + rw [← hI] + have heq := congrArg ENNReal.toReal (hInd.meas_biInter S) + simp only [ENNReal.toReal_prod] at heq + change (condDistrib Y X μ (X ω)).real (⋂ i ∈ S, s i) = _ at heq + rw [heq] + simp only [Finset.prod_apply] + exact Finset.prod_congr rfl (fun i _ => hω i) + +end Invariant233.ConditionalEventBridge + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalEventLocalization.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalEventLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb62a7e21a6fa622c35d852431218371d7877916 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalEventLocalization.lean @@ -0,0 +1,53 @@ +import Mathlib.MeasureTheory.Function.ConditionalExpectation.Indicator +import Mathlib.Probability.Notation + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ProbabilityTheory + +namespace Invariant233.ConditionalEventLocalization + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] + {μ : Measure Ω} [IsFiniteMeasure μ] {m : MeasurableSpace Ω} + +theorem condProb_mono_on (hm : m ≤ mΩ) {A B S : Set Ω} + (hA : MeasurableSet[mΩ] A) (hB : MeasurableSet[mΩ] B) (hS : MeasurableSet[m] S) + (hsub : ∀ᵐ ω ∂μ, ω ∈ S → ω ∈ A → ω ∈ B) : + ∀ᵐ ω ∂μ, ω ∈ S → (μ⟦A | m⟧) ω ≤ (μ⟦B | m⟧) ω := by + have hAi : Integrable (A.indicator (fun _ => (1 : ℝ))) μ := + (integrable_const _).indicator hA + have hBi : Integrable (B.indicator (fun _ => (1 : ℝ))) μ := + (integrable_const _).indicator hB + have hle : S.indicator (A.indicator (fun _ => (1 : ℝ))) ≤ᵐ[μ] + S.indicator (B.indicator (fun _ => (1 : ℝ))) := by + filter_upwards [hsub] with ω hω + by_cases hs : ω ∈ S + · simp only [indicator_of_mem hs] + by_cases ha : ω ∈ A + · simp only [indicator_of_mem ha, indicator_of_mem (hω hs ha), le_refl] + · simp only [indicator_of_notMem ha] + exact indicator_nonneg (fun _ _ => by norm_num) _ + · simp only [indicator_of_notMem hs, le_refl] + have hc := condExp_mono (m := m) (hAi.indicator (hm _ hS)) + (hBi.indicator (hm _ hS)) hle + filter_upwards [hc, condExp_indicator hAi hS, condExp_indicator hBi hS] + with ω hle hleft hright + intro hs + rw [hleft, hright, indicator_of_mem hs, indicator_of_mem hs] at hle + exact hle + +theorem condProb_lower_on_of_forcing (hm : m ≤ mΩ) {A B S : Set Ω} + (hA : MeasurableSet[mΩ] A) (hB : MeasurableSet[mΩ] B) (hS : MeasurableSet[m] S) + (hsub : ∀ᵐ ω ∂μ, ω ∈ S → ω ∈ A → ω ∈ B) + (r : Ω → ℝ) (hlower : ∀ᵐ ω ∂μ, ω ∈ S → r ω ≤ (μ⟦A | m⟧) ω) : + ∀ᵐ ω ∂μ, ω ∈ S → r ω ≤ (μ⟦B | m⟧) ω := by + filter_upwards [@condProb_mono_on Ω mΩ μ _ m hm A B S hA hB hS hsub, hlower] with ω hmono hlo + exact fun hs => (hlo hs).trans (hmono hs) + +end Invariant233.ConditionalEventLocalization + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalKernelSupport.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalKernelSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..a3fcca2a32d8e4443258692773b2a94fddc6f36f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalKernelSupport.lean @@ -0,0 +1,41 @@ +import Mathlib.Probability.Kernel.Condexp +import Mathlib.Tactic + +namespace OAI + +open MeasureTheory ProbabilityTheory + +namespace Invariant233.CrossingAvoidance + +variable {Ω β : Type*} + +theorem ae_ae_condExpKernel_of_ae (m' : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} + [StandardBorelSpace Ω] (hm' : m' ≤ mΩ) (μ : Measure Ω) [IsFiniteMeasure μ] + {P : Ω → Prop} (hP : ∀ᵐ ω ∂μ, P ω) : + ∀ᵐ x ∂μ, ∀ᵐ ω ∂condExpKernel μ m' x, P ω := by + apply ae_of_ae_trim hm' + apply Measure.ae_ae_of_ae_comp + rwa [condExpKernel_comp_trim hm'] + +theorem condExpKernel_ae_eq_of_measurable (m' : MeasurableSpace Ω) + {mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω] + [mβ : MeasurableSpace β] [MeasurableEq β] + (hm' : m' ≤ mΩ) (μ : Measure Ω) [IsFiniteMeasure μ] + (f : Ω → β) (hf : Measurable[m'] f) : + ∀ᵐ x ∂μ, ∀ᵐ ω ∂condExpKernel μ m' x, f ω = f x := by + let : MeasurableSpace (Ω × Ω) := m'.prod mΩ + have hf1 : @Measurable (Ω × Ω) β (m'.prod mΩ) mβ (fun z => f z.1) := + hf.comp (@measurable_fst Ω Ω m' mΩ) + have hf2 : @Measurable (Ω × Ω) β (m'.prod mΩ) mβ (fun z => f z.2) := + (hf.mono hm' le_rfl).comp (@measurable_snd Ω Ω m' mΩ) + have hdiag : @Measurable Ω (Ω × Ω) mΩ (m'.prod mΩ) (fun x => (x, x)) := + (measurable_id'' hm').prodMk measurable_id + have hprod : ∀ᵐ z ∂(μ.trim hm') ⊗ₘ condExpKernel μ m', f z.2 = f z.1 := by + rw [compProd_trim_condExpKernel hm'] + exact (ae_map_iff hdiag.aemeasurable (measurableSet_eq_fun hf2 hf1)).mpr + (Filter.Eventually.of_forall (fun _ => rfl)) + exact ae_of_ae_trim hm' (Measure.ae_ae_of_ae_compProd hprod) + +end Invariant233.CrossingAvoidance + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalL2Tail.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalL2Tail.lean new file mode 100644 index 0000000000000000000000000000000000000000..4372c7857419c239a8923f794be2a9a0b36649da --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalL2Tail.lean @@ -0,0 +1,140 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ConditionalMaskedTail +import Mathlib.Analysis.InnerProductSpace.l2Space + +namespace OAI + +open MeasureTheory +open scoped ENNReal lp + +namespace InvariantProjection + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {μ : Measure Ω} + +theorem l2_tsum_ofReal_sq (x : ℓ²(ℤ, ℂ)) : + (∑' i : ℤ, ENNReal.ofReal (‖x i‖ ^ 2)) = ENNReal.ofReal (‖x‖ ^ 2) := by + have hs : HasSum (fun i : ℤ => ‖x i‖ ^ 2) (‖x‖ ^ 2) := by + simpa using lp.hasSum_norm (p := (2 : ℝ≥0∞)) (by norm_num) x + rw [← ENNReal.ofReal_tsum_of_nonneg (fun _ => sq_nonneg _) hs.summable, hs.tsum_eq] + +theorem lintegral_l2_sq_le_one [IsProbabilityMeasure μ] + (ξ : Ω → ℓ²(ℤ, ℂ)) (hξ : ∀ᵐ ω ∂μ, ‖ξ ω‖ ≤ 1) : + (∫⁻ ω, ∑' i : ℤ, ENNReal.ofReal (‖ξ ω i‖ ^ 2) ∂μ) ≤ 1 := by + calc + _ ≤ ∫⁻ _ : Ω, (1 : ℝ≥0∞) ∂μ := by + apply lintegral_mono_ae + filter_upwards [hξ] with ω hω + rw [l2_tsum_ofReal_sq] + apply ENNReal.ofReal_le_one.mpr + nlinarith [norm_nonneg (ξ ω)] + _ = 1 := by simp + +theorem lintegral_l2_masked_tail_le_of_condExp + [IsProbabilityMeasure μ] + (ξ γ : Ω → ℓ²(ℤ, ℂ)) (hγ : StronglyMeasurable γ) + (hξ_ball : ∀ᵐ ω ∂μ, ‖ξ ω‖ ≤ 1) (hγ_ball : ∀ᵐ ω ∂μ, ‖γ ω‖ ≤ 1) + (e : ℤ ≃ ℤ) {H : Set (Ω × ℤ)} (hH : MeasurableSet H) + {m : MeasurableSpace Ω} (hm : m ≤ mΩ) (hξ : StronglyMeasurable[m] ξ) + {δ : ℝ} (hδ : 0 ≤ δ) + (hcond : ∀ i : ℤ, μ[({ω | (ω, i) ∈ H}).indicator (fun _ => (1 : ℝ)) | m] + ≤ᵐ[μ] fun _ => δ) : + (∫⁻ ω, ∑' i : ℤ, H.indicator + (fun z => ENNReal.ofReal ‖ξ z.1 z.2‖ * ENNReal.ofReal ‖γ z.1 (e z.2)‖) + (ω, i) ∂μ) ≤ ENNReal.ofReal (Real.sqrt δ) := by + let : MeasurableSpace Ω := mΩ + have hxcoord (i : ℤ) : StronglyMeasurable[m] (fun ω => ξ ω i) := + (lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 i).continuous.comp_stronglyMeasurable hξ + have hycoord (i : ℤ) : StronglyMeasurable (fun ω => γ ω (e i)) := + (lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 (e i)).continuous.comp_stronglyMeasurable hγ + apply lintegral_tsum_masked_mul_le_of_condExp + (a := fun z : Ω × ℤ => ‖ξ z.1 z.2‖) + (b := fun z : Ω × ℤ => ‖γ z.1 (e z.2)‖) + (measurable_from_prod_countable_left fun i => ((hxcoord i).mono hm).norm.measurable) + (measurable_from_prod_countable_left fun i => (hycoord i).norm.measurable) + (fun _ => norm_nonneg _) (fun _ => norm_nonneg _) hH hm hδ + (fun i => (hxcoord i).norm.pow 2) hcond + · exact lintegral_l2_sq_le_one ξ hξ_ball + · have h := lintegral_l2_sq_le_one γ hγ_ball + calc + _ = ∫⁻ ω, ∑' i : ℤ, ENNReal.ofReal (‖γ ω i‖ ^ 2) ∂μ := by + apply lintegral_congr + intro ω + exact e.tsum_eq (fun i => ENNReal.ofReal (‖γ ω i‖ ^ 2)) + _ ≤ 1 := h + +theorem integral_l2_masked_tail_le_of_condExp + [IsProbabilityMeasure μ] + (ξ γ : Ω → ℓ²(ℤ, ℂ)) (hγ : StronglyMeasurable γ) + (hξ_ball : ∀ᵐ ω ∂μ, ‖ξ ω‖ ≤ 1) (hγ_ball : ∀ᵐ ω ∂μ, ‖γ ω‖ ≤ 1) + (e : ℤ ≃ ℤ) {H : Set (Ω × ℤ)} (hH : MeasurableSet H) + {m : MeasurableSpace Ω} (hm : m ≤ mΩ) (hξ : StronglyMeasurable[m] ξ) + {δ : ℝ} (hδ : 0 ≤ δ) + (hcond : ∀ i : ℤ, μ[({ω | (ω, i) ∈ H}).indicator (fun _ => (1 : ℝ)) | m] + ≤ᵐ[μ] fun _ => δ) : + (∀ᵐ ω ∂μ, Summable (fun i : ℤ => H.indicator + (fun z => ‖ξ z.1 z.2‖ * ‖γ z.1 (e z.2)‖) (ω, i))) ∧ + Integrable (fun ω => ∑' i : ℤ, H.indicator + (fun z => ‖ξ z.1 z.2‖ * ‖γ z.1 (e z.2)‖) (ω, i)) μ ∧ + (∫ ω, ∑' i : ℤ, H.indicator + (fun z => ‖ξ z.1 z.2‖ * ‖γ z.1 (e z.2)‖) (ω, i) ∂μ) ≤ Real.sqrt δ := by + let : MeasurableSpace Ω := mΩ + have hbound := lintegral_l2_masked_tail_le_of_condExp + (mΩ := mΩ) ξ γ hγ hξ_ball hγ_ball e hH hm hξ hδ hcond + have hxcoord (i : ℤ) : StronglyMeasurable (fun ω => ξ ω i) := + ((lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 i).continuous.comp_stronglyMeasurable hξ).mono hm + have hycoord (i : ℤ) : StronglyMeasurable (fun ω => γ ω (e i)) := + (lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 (e i)).continuous.comp_stronglyMeasurable hγ + have hf (i : ℤ) : Measurable (fun ω => H.indicator + (fun z => ‖ξ z.1 z.2‖ * ‖γ z.1 (e z.2)‖) (ω, i)) := by + have hs := hH.preimage (@measurable_prodMk_right Ω ℤ mΩ inferInstance i) + convert (((hxcoord i).norm.measurable.mul (hycoord i).norm.measurable).indicator hs) using 1 + funext ω + by_cases hi : (ω, i) ∈ H <;> simp [hi] + apply Invariant233.MaskedTail.real_tsum_integrable_of_lintegral_bound hf + (fun i ω => Set.indicator_nonneg (fun z _ => mul_nonneg (norm_nonneg _) (norm_nonneg _)) (ω, i)) + (Real.sqrt_nonneg δ) + convert hbound using 1 + apply lintegral_congr + intro ω + apply tsum_congr + intro i + by_cases hi : (ω, i) ∈ H + · simp [hi, ENNReal.ofReal_mul (norm_nonneg _)] + · simp [hi] + +theorem integral_l2_masked_tail_le_of_condExp_right + [IsProbabilityMeasure μ] + (ξ γ : Ω → ℓ²(ℤ, ℂ)) (hξ : StronglyMeasurable ξ) + (hξ_ball : ∀ᵐ ω ∂μ, ‖ξ ω‖ ≤ 1) (hγ_ball : ∀ᵐ ω ∂μ, ‖γ ω‖ ≤ 1) + (e : ℤ ≃ ℤ) {H : Set (Ω × ℤ)} (hH : MeasurableSet H) + {m : MeasurableSpace Ω} (hm : m ≤ mΩ) (hγ : StronglyMeasurable[m] γ) + {δ : ℝ} (hδ : 0 ≤ δ) + (hcond : ∀ i : ℤ, μ[({ω | (ω, i) ∈ H}).indicator (fun _ => (1 : ℝ)) | m] + ≤ᵐ[μ] fun _ => δ) : + Integrable (fun ω => ∑' i : ℤ, H.indicator + (fun z => ‖ξ z.1 z.2‖ * ‖γ z.1 (e z.2)‖) (ω, i)) μ ∧ + (∫ ω, ∑' i : ℤ, H.indicator + (fun z => ‖ξ z.1 z.2‖ * ‖γ z.1 (e z.2)‖) (ω, i) ∂μ) ≤ Real.sqrt δ := by + let : MeasurableSpace Ω := mΩ + let H' : Set (Ω × ℤ) := {z | (z.1, e.symm z.2) ∈ H} + have hH' : MeasurableSet H' := + hH.preimage (measurable_fst.prodMk ((measurable_of_countable e.symm).comp measurable_snd)) + have hc' : ∀ j : ℤ, μ[({ω | (ω, j) ∈ H'}).indicator (fun _ => (1 : ℝ)) | m] + ≤ᵐ[μ] fun _ => δ := fun j => hcond (e.symm j) + have h := integral_l2_masked_tail_le_of_condExp (mΩ := mΩ) + γ ξ hξ hγ_ball hξ_ball e.symm hH' hm hγ hδ hc' + have heq : (fun ω => ∑' i : ℤ, H.indicator + (fun z => ‖ξ z.1 z.2‖ * ‖γ z.1 (e z.2)‖) (ω, i)) = + (fun ω => ∑' j : ℤ, H'.indicator + (fun z => ‖γ z.1 z.2‖ * ‖ξ z.1 (e.symm z.2)‖) (ω, j)) := by + funext ω + rw [← e.tsum_eq (fun j => H'.indicator + (fun z => ‖γ z.1 z.2‖ * ‖ξ z.1 (e.symm z.2)‖) (ω, j))] + apply tsum_congr + intro i + by_cases hi : (ω, i) ∈ H <;> simp [H', hi, mul_comm] + rw [heq] + exact h.2 + +end InvariantProjection + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalMaskedTail.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalMaskedTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..4014c09cc9f7f1476a376a6be006d1ba4e959e53 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalMaskedTail.lean @@ -0,0 +1,63 @@ +import OAI.Analysis.IrrationalRotation.Analysis.MaskedCauchySchwarz +import OAI.Analysis.IrrationalRotation.Analysis.MaskedTail + +namespace OAI + +open MeasureTheory +open scoped ENNReal + +namespace InvariantProjection + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {μ : Measure Ω} + +theorem lintegral_tsum_masked_mul_le_of_condExp + {ι : Type*} [mι : MeasurableSpace ι] [MeasurableSingletonClass ι] [Countable ι] + [IsFiniteMeasure μ] + {a b : Ω × ι → ℝ} (ha : Measurable a) (hb : Measurable b) + (ha_nonneg : ∀ z, 0 ≤ a z) (hb_nonneg : ∀ z, 0 ≤ b z) + {H : Set (Ω × ι)} (hH : MeasurableSet H) + {m : MeasurableSpace Ω} (hm : m ≤ mΩ) {δ : ℝ} (hδ : 0 ≤ δ) + (ha_endpoint : ∀ i, StronglyMeasurable[m] (fun ω => a (ω, i) ^ 2)) + (hcond : ∀ i, μ[({ω | (ω, i) ∈ H}).indicator (fun _ => (1 : ℝ)) | m] + ≤ᵐ[μ] fun _ => δ) + (ha_energy : (∫⁻ ω, ∑' i, ENNReal.ofReal (a (ω, i) ^ 2) ∂μ) ≤ 1) + (hb_energy : (∫⁻ ω, ∑' i, ENNReal.ofReal (b (ω, i) ^ 2) ∂μ) ≤ 1) : + (∫⁻ ω, ∑' i, H.indicator + (fun z => ENNReal.ofReal (a z) * ENNReal.ofReal (b z)) (ω, i) ∂μ) ≤ + ENNReal.ofReal (Real.sqrt δ) := by + have ha_sq_int : ∀ i, Integrable (fun ω => a (ω, i) ^ 2) μ := by + intro i + refine ⟨((ha.comp (@measurable_prodMk_right Ω ι mΩ mι i)).pow_const 2).aestronglyMeasurable, ?_⟩ + apply (hasFiniteIntegral_iff_ofReal (Filter.Eventually.of_forall fun _ => sq_nonneg _)).2 + calc + (∫⁻ ω, ENNReal.ofReal (a (ω, i) ^ 2) ∂μ) ≤ + ∫⁻ ω, ∑' j, ENNReal.ofReal (a (ω, j) ^ 2) ∂μ := + lintegral_mono fun ω => ENNReal.le_tsum (f := fun j => ENNReal.ofReal (a (ω, j) ^ 2)) i + _ ≤ 1 := ha_energy + _ < ⊤ := by simp + have hs : ∀ i, MeasurableSet[mΩ] {ω | (ω, i) ∈ H} := fun i => + hH.preimage (@measurable_prodMk_right Ω ι mΩ mι i) + have hsmall := lintegral_tsum_indicator_le_of_condExp_indicator_le_of_energy_le_one + (mΩ := mΩ) hm hs hδ ha_sq_int ha_endpoint + (fun _ => Filter.Eventually.of_forall fun _ => sq_nonneg _) hcond ha_energy + have hmasked : (∫⁻ ω, ∑' i, H.indicator + (fun z => ENNReal.ofReal (a z) ^ (2 : ℕ)) (ω, i) ∂μ) ≤ ENNReal.ofReal δ := by + convert hsmall using 1 + apply lintegral_congr + intro ω + apply tsum_congr + intro i + by_cases hi : (ω, i) ∈ H + · simp [hi, ENNReal.ofReal_pow (ha_nonneg (ω, i))] + · simp [hi] + have hb2 : (∫⁻ ω, ∑' i, ENNReal.ofReal (b (ω, i)) ^ (2 : ℕ) ∂μ) ≤ 1 := by + simpa only [← ENNReal.ofReal_pow (hb_nonneg _)] using hb_energy + let : MeasurableSpace Ω := mΩ + have hcs := Invariant233.MaskedTail.lintegral_tsum_indicator_mul_le_sqrt + (μ := μ) hH ha.ennreal_ofReal.aemeasurable hb.ennreal_ofReal.aemeasurable hmasked hb2 + simpa only [ENNReal.ofReal_rpow_of_nonneg hδ (by norm_num : (0 : ℝ) ≤ 1 / 2), + ← Real.sqrt_eq_rpow] using hcs + +end InvariantProjection + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalObservationTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalObservationTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f74bf58ce92cd0de9722000077a819c9cee8808 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ConditionalObservationTransport.lean @@ -0,0 +1,93 @@ +import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic +import Mathlib.MeasureTheory.Function.FactorsThrough +import Mathlib.Probability.Independence.Conditional + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped MeasureTheory + +namespace Invariant233.ConditionalObservationTransport + +variable {Ω D Y E : Type*} [mΩ : MeasurableSpace Ω] + [mD : MeasurableSpace D] [mY : MeasurableSpace Y] + {μ : Measure Ω} [IsFiniteMeasure μ] + +omit [IsFiniteMeasure μ] in + +theorem aestronglyMeasurable_encoding + [NormedAddCommGroup E] [CompleteSpace E] + {X : Ω → D} {encode : D → Y} {decode : Y → D} + (hdecode : Measurable decode) + (hrecover : ∀ᵐ ω ∂μ, decode (encode (X ω)) = X ω) + {g : Ω → E} (hg : StronglyMeasurable[mD.comap X] g) : + AEStronglyMeasurable[mY.comap (encode ∘ X)] g μ := by + obtain ⟨k, hk, hkg⟩ := hg.exists_eq_measurable_comp + have hobs : Measurable[mY.comap (encode ∘ X)] (encode ∘ X) := + measurable_iff_comap_le.mpr le_rfl + refine ⟨k ∘ decode ∘ (encode ∘ X), + hk.comp_measurable (hdecode.comp hobs), ?_⟩ + filter_upwards [hrecover] with ω hω + simp only [hkg, Function.comp_apply, hω] + +theorem condExp_encoding + [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + {X : Ω → D} {encode : D → Y} {decode : Y → D} + (hX : Measurable X) (hencode : Measurable encode) (hdecode : Measurable decode) + (hrecover : ∀ᵐ ω ∂μ, decode (encode (X ω)) = X ω) (f : Ω → E) : + μ[f | mY.comap (encode ∘ X)] =ᵐ[μ] μ[f | mD.comap X] := by + have hle : mY.comap (encode ∘ X) ≤ mD.comap X := by + rw [← MeasurableSpace.comap_comp] + exact MeasurableSpace.comap_mono hencode.comap_le + have hsmall : mY.comap (encode ∘ X) ≤ mΩ := (hencode.comp hX).comap_le + have hg : AEStronglyMeasurable[mY.comap (encode ∘ X)] (μ[f | mD.comap X]) μ := + aestronglyMeasurable_encoding hdecode hrecover stronglyMeasurable_condExp + exact (condExp_condExp_of_le hle hX.comap_le).symm.trans + (condExp_of_aestronglyMeasurable' hsmall hg integrable_condExp) + +theorem condExp_encoding_formula + [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + {X : Ω → D} {encode : D → Y} {decode : Y → D} + (hX : Measurable X) (hencode : Measurable encode) (hdecode : Measurable decode) + (hrecover : ∀ᵐ ω ∂μ, decode (encode (X ω)) = X ω) + (f : Ω → E) (posterior : D → E) + (hposterior : μ[f | mD.comap X] =ᵐ[μ] posterior ∘ X) : + μ[f | mY.comap (encode ∘ X)] =ᵐ[μ] posterior ∘ decode ∘ (encode ∘ X) := by + refine (condExp_encoding hX hencode hdecode hrecover f).trans (hposterior.trans ?_) + filter_upwards [hrecover] with ω hω + simp only [Function.comp_apply, hω] + +theorem iCondIndepFun_encoding_iff + [StandardBorelSpace Ω] {ι : Type*} {β : ι → Type*} + [mβ : ∀ i, MeasurableSpace (β i)] + {X : Ω → D} {encode : D → Y} {decode : Y → D} + (hX : Measurable X) (hencode : Measurable encode) (hdecode : Measurable decode) + (hrecover : ∀ᵐ ω ∂μ, decode (encode (X ω)) = X ω) + (L : ∀ i, Ω → β i) (hL : ∀ i, Measurable (L i)) : + iCondIndepFun (mY.comap (encode ∘ X)) (hencode.comp hX).comap_le L μ ↔ + iCondIndepFun (mD.comap X) hX.comap_le L μ := by + classical + rw [iCondIndepFun_iff_condExp_inter_preimage_eq_mul mβ L hL, + iCondIndepFun_iff_condExp_inter_preimage_eq_mul mβ L hL] + have hce (s : Set Ω) : + μ⟦s | mY.comap (encode ∘ X)⟧ =ᵐ[μ] μ⟦s | mD.comap X⟧ := + condExp_encoding hX hencode hdecode hrecover (s.indicator (fun _ => (1 : ℝ))) + constructor + · intro h S sets hsets + have hp : (∏ i ∈ S, μ⟦L i ⁻¹' sets i | mY.comap (encode ∘ X)⟧) =ᵐ[μ] + ∏ i ∈ S, μ⟦L i ⁻¹' sets i | mD.comap X⟧ := + eventuallyEq_prod (fun i _ => hce (L i ⁻¹' sets i)) + exact (hce _).symm.trans ((h S hsets).trans hp) + · intro h S sets hsets + have hp : (∏ i ∈ S, μ⟦L i ⁻¹' sets i | mY.comap (encode ∘ X)⟧) =ᵐ[μ] + ∏ i ∈ S, μ⟦L i ⁻¹' sets i | mD.comap X⟧ := + eventuallyEq_prod (fun i _ => hce (L i ⁻¹' sets i)) + exact (hce _).trans ((h S hsets).trans hp.symm) + +end Invariant233.ConditionalObservationTransport + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CouplingMarginalBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CouplingMarginalBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec8f58b7399a0d2223a603e772342dae3ca40d50 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CouplingMarginalBounds.lean @@ -0,0 +1,267 @@ +import OAI.Analysis.IrrationalRotation.Model.CouplingMarginalBounds +import Mathlib + +namespace OAI + +open MeasureTheory Filter +open scoped BigOperators ENNReal + +namespace Invariant233.CouplingMarginalBounds + +lemma rho_nonneg {κ m w : ℝ} (hκ : 0 ≤ κ) : 0 ≤ rho κ m w := + mul_nonneg hκ (Real.sqrt_nonneg _) + +lemma width_pos {m w : ℝ} (hm : 0 < m) (hw : 1 / m ≤ w) : 0 < w := + lt_of_lt_of_le (one_div_pos.mpr hm) hw + +lemma sqrt_width_div_le {m w : ℝ} (hm : 0 < m) (hw : 1 / m ≤ w) : + Real.sqrt (w / m) ≤ w := by + have hw0 := width_pos hm hw + apply (Real.sqrt_le_iff).2 + refine ⟨hw0.le, ?_⟩ + apply (div_le_iff₀ hm).2 + have hmw : 1 ≤ w * m := (div_le_iff₀ hm).1 hw + nlinarith [mul_le_mul_of_nonneg_left hmw hw0.le] + +lemma rho_le_mul_width {κ m w : ℝ} (hκ : 0 ≤ κ) + (hm : 0 < m) (hw : 1 / m ≤ w) : rho κ m w ≤ κ * w := + mul_le_mul_of_nonneg_left (sqrt_width_div_le hm hw) hκ + +lemma rho_div_width_le {κ m w : ℝ} (hκ : 0 ≤ κ) + (hm : 0 < m) (hw : 1 / m ≤ w) : rho κ m w / w ≤ κ := by + exact (div_le_iff₀ (width_pos hm hw)).2 (rho_le_mul_width hκ hm hw) + +lemma rho_sq_div_width {κ m w : ℝ} (hm : 0 < m) (hw : 0 < w) : + (rho κ m w) ^ 2 / w = κ ^ 2 / m := by + unfold rho + rw [mul_pow, Real.sq_sqrt (div_nonneg hw.le hm.le)] + field_simp + +lemma diagonalMass_bounds {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) : + 49 / 50 ≤ diagonalMass κ m a b t ∧ diagonalMass κ m a b t ≤ 1 := by + have hm0 : 0 < m := by linarith + have hra := rho_le_mul_width hκ0 hm0 ha + have hrb := rho_le_mul_width hκ0 hm0 hb + have hra' : rho κ m a ≤ κ / 4 := by nlinarith + have hrb' : rho κ m b ≤ κ / 4 := by nlinarith + have htm : t / m ≤ 1 / 100 := by + apply (div_le_iff₀ hm0).2 + nlinarith + have htm0 : 0 ≤ t / m := div_nonneg ht0 hm0.le + have hra0 := rho_nonneg (m := m) (w := a) hκ0 + have hrb0 := rho_nonneg (m := m) (w := b) hκ0 + unfold diagonalMass + constructor <;> linarith + +lemma marginal_density_bounds {κ m a b t u₁ u₂ u₃ u₄ v : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) + (hu₁ : 0 ≤ u₁ ∧ u₁ ≤ 2 / a) (hu₂ : 0 ≤ u₂ ∧ u₂ ≤ 2 / a) + (hu₃ : 0 ≤ u₃ ∧ u₃ ≤ 2 / b) (hu₄ : 0 ≤ u₄ ∧ u₄ ≤ 2 / b) + (hv : 0 ≤ v ∧ v ≤ m) : + let h := diagonalMass κ m a b t + rho κ m a * u₁ + rho κ m a * u₂ + + rho κ m b * u₃ + rho κ m b * u₄ + (t / m) * v + 49 / 50 ≤ h ∧ h ≤ 2 + 8 * κ ∧ h < 10 := by + dsimp only + have hm0 : 0 < m := by linarith + have ha0 := width_pos hm0 ha + have hb0 := width_pos hm0 hb + have hra0 := rho_nonneg (m := m) (w := a) hκ0 + have hrb0 := rho_nonneg (m := m) (w := b) hκ0 + have hq := diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht + have hra := rho_div_width_le hκ0 hm0 ha + have hrb := rho_div_width_le hκ0 hm0 hb + have hu₁' : rho κ m a * u₁ ≤ 2 * κ := by + calc + _ ≤ rho κ m a * (2 / a) := mul_le_mul_of_nonneg_left hu₁.2 hra0 + _ = 2 * (rho κ m a / a) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hra (by norm_num) + have hu₂' : rho κ m a * u₂ ≤ 2 * κ := by + calc + _ ≤ rho κ m a * (2 / a) := mul_le_mul_of_nonneg_left hu₂.2 hra0 + _ = 2 * (rho κ m a / a) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hra (by norm_num) + have hu₃' : rho κ m b * u₃ ≤ 2 * κ := by + calc + _ ≤ rho κ m b * (2 / b) := mul_le_mul_of_nonneg_left hu₃.2 hrb0 + _ = 2 * (rho κ m b / b) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hrb (by norm_num) + have hu₄' : rho κ m b * u₄ ≤ 2 * κ := by + calc + _ ≤ rho κ m b * (2 / b) := mul_le_mul_of_nonneg_left hu₄.2 hrb0 + _ = 2 * (rho κ m b / b) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hrb (by norm_num) + have htm0 := div_nonneg ht0 hm0.le + have hv' : (t / m) * v ≤ t := by + calc + _ ≤ (t / m) * m := mul_le_mul_of_nonneg_left hv.2 htm0 + _ = t := div_mul_cancel₀ _ hm0.ne' + have hlow₁ := mul_nonneg hra0 hu₁.1 + have hlow₂ := mul_nonneg hra0 hu₂.1 + have hlow₃ := mul_nonneg hrb0 hu₃.1 + have hlow₄ := mul_nonneg hrb0 hu₄.1 + have hlowv := mul_nonneg htm0 hv.1 + constructor + · linarith [hq.1] + constructor + · linarith [hq.2] + · linarith [hq.2] + +lemma ae_eq_of_ordered_equal_integral {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} {x y : Ω → ℝ} + (hx : Integrable x μ) (hy : Integrable y μ) + (hxy : x ≤ᵐ[μ] y) (hmean : ∫ ω, x ω ∂μ = ∫ ω, y ω ∂μ) : + x =ᵐ[μ] y := + (integral_eq_iff_of_ae_le hx hy hxy).1 hmean + +lemma ae_eq_of_coordinate_ordered_equal_integral {Ω I : Type*} + [MeasurableSpace Ω] [Countable I] {μ : Measure Ω} {x y : Ω → I → ℝ} + (hx : ∀ i, Integrable (fun ω => x ω i) μ) + (hy : ∀ i, Integrable (fun ω => y ω i) μ) + (hxy : ∀ i, (fun ω => x ω i) ≤ᵐ[μ] fun ω => y ω i) + (hmean : ∀ i, ∫ ω, x ω i ∂μ = ∫ ω, y ω i ∂μ) : x =ᵐ[μ] y := by + have hi : ∀ i, ∀ᵐ ω ∂μ, x ω i = y ω i := fun i => + ae_eq_of_ordered_equal_integral (hx i) (hy i) (hxy i) (hmean i) + filter_upwards [ae_all_iff.2 hi] with ω hω + exact funext hω + +lemma integral_sq_sum_le {Ω I : Type*} [MeasurableSpace Ω] [Fintype I] + {μ : Measure Ω} {f : I → Ω → ℝ} (hf : ∀ i, MemLp (f i) 2 μ) : + (∫ ω, (∑ i, f i ω) ^ 2 ∂μ) ≤ + (Fintype.card I : ℝ) * ∑ i, ∫ ω, (f i ω) ^ 2 ∂μ := by + classical + have hsum : MemLp (fun ω => ∑ i, f i ω) 2 μ := + memLp_finsetSum Finset.univ (fun i _ => hf i) + have hsq : Integrable (fun ω => ∑ i, (f i ω) ^ 2) μ := + integrable_finsetSum Finset.univ (fun i _ => (hf i).integrable_sq) + calc + _ ≤ ∫ ω, (Fintype.card I : ℝ) * ∑ i, (f i ω) ^ 2 ∂μ := by + apply integral_mono hsum.integrable_sq (hsq.const_mul _) + intro ω + simpa using (sq_sum_le_card_mul_sum_sq (s := Finset.univ) + (f := fun i => f i ω)) + _ = _ := by + rw [integral_const_mul, integral_finsetSum] + intro i _ + exact (hf i).integrable_sq + +lemma integral_sq_weighted_sum_le {Ω I : Type*} [MeasurableSpace Ω] [Fintype I] + {μ : Measure Ω} {f : I → Ω → ℝ} (hf : ∀ i, MemLp (f i) 2 μ) + (p : I → ℝ) : + (∫ ω, (∑ i, p i * f i ω) ^ 2 ∂μ) ≤ + (Fintype.card I : ℝ) * ∑ i, (p i) ^ 2 * ∫ ω, (f i ω) ^ 2 ∂μ := by + have h := integral_sq_sum_le (fun i => (hf i).const_mul (p i)) + simpa only [mul_pow, integral_const_mul] using h + +lemma uniformDensity_memLp {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} [IsFiniteMeasure μ] {s : Set Ω} (hs : MeasurableSet s) + (p : ℝ≥0∞) : MemLp (uniformDensity μ s) p μ := by + exact memLp_indicator_const p hs _ (Or.inr (measure_ne_top μ s)) + +lemma uniformDensity_integral {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} {s : Set Ω} (hs : MeasurableSet s) (hpos : 0 < μ.real s) : + ∫ ω, uniformDensity μ s ω ∂μ = 1 := by + rw [uniformDensity, integral_indicator_const _ hs, smul_eq_mul] + exact mul_inv_cancel₀ hpos.ne' + +lemma uniformDensity_sq_integral {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} {s : Set Ω} (hs : MeasurableSet s) (hpos : 0 < μ.real s) : + ∫ ω, (uniformDensity μ s ω) ^ 2 ∂μ = (μ.real s)⁻¹ := by + have hsq : (fun ω => (uniformDensity μ s ω) ^ 2) = + s.indicator (fun _ => ((μ.real s)⁻¹) ^ 2) := by + ext ω + by_cases hω : ω ∈ s <;> simp [uniformDensity, hω] + rw [hsq, integral_indicator_const _ hs, smul_eq_mul] + field_simp + +lemma uniformDensity_variance {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} [IsProbabilityMeasure μ] {s : Set Ω} + (hs : MeasurableSet s) (hpos : 0 < μ.real s) : + ∫ ω, (uniformDensity μ s ω - 1) ^ 2 ∂μ = (μ.real s)⁻¹ - 1 := by + have hu := uniformDensity_memLp (μ := μ) hs 2 + have hui : Integrable (uniformDensity μ s) μ := hu.integrable (by norm_num) + have hfun : (fun ω => (uniformDensity μ s ω - 1) ^ 2) = + fun ω => (uniformDensity μ s ω) ^ 2 - 2 * uniformDensity μ s ω + 1 := by + ext ω + ring + have hsub : Integrable (fun ω => (uniformDensity μ s ω) ^ 2 - 2 * uniformDensity μ s ω) μ := + hu.integrable_sq.sub (hui.const_mul 2) + rw [hfun, integral_add hsub (integrable_const 1), + integral_sub hu.integrable_sq (hui.const_mul 2), integral_const_mul, + uniformDensity_sq_integral hs hpos, uniformDensity_integral hs hpos] + simp + ring + +lemma uniformDensity_variance_le {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} [IsProbabilityMeasure μ] {s : Set Ω} + (hs : MeasurableSet s) {w : ℝ} (hw : 0 < w) (hlen : w / 2 ≤ μ.real s) : + ∫ ω, (uniformDensity μ s ω - 1) ^ 2 ∂μ ≤ 2 / w := by + have hpos : 0 < μ.real s := lt_of_lt_of_le (by positivity) hlen + rw [uniformDensity_variance hs hpos] + have hinv : (μ.real s)⁻¹ ≤ 2 / w := by + rw [inv_eq_one_div] + apply (div_le_div_iff₀ hpos hw).2 + linarith + linarith + +lemma diagonalMass_add_components (κ m a b t : ℝ) : + diagonalMass κ m a b t + rho κ m a + rho κ m a + + rho κ m b + rho κ m b + t / m = 1 := by + unfold diagonalMass + ring + +lemma conditional_component_lower {r u h : ℝ} + (hr : 0 ≤ r) (hu : 1 ≤ u) (hh : 0 < h) (hh10 : h ≤ 10) : + r / 10 ≤ r * u / h := by + apply (le_div_iff₀ hh).2 + have hfirst : r / 10 * h ≤ r := by nlinarith + have hsecond : r ≤ r * u := by nlinarith + exact hfirst.trans hsecond + +lemma five_component_energy_bound {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} {f : Fin 5 → Ω → ℝ} (hf : ∀ i, MemLp (f i) 2 μ) + {κ m a b t : ℝ} (hm : 0 < m) (ha : 0 < a) (hb : 0 < b) + (ht0 : 0 ≤ t) (ht : t ≤ 1) + (henergy : ∀ i, (∫ ω, (f i ω) ^ 2 ∂μ) ≤ componentVarianceBounds m a b i) : + (∫ ω, (∑ i, componentProbabilities κ m a b t i * f i ω) ^ 2 ∂μ) ≤ + 20 * (2 * κ ^ 2 / m + t / m) := by + have hbound := integral_sq_weighted_sum_le hf (componentProbabilities κ m a b t) + have hsum : (∑ i, (componentProbabilities κ m a b t i) ^ 2 * + ∫ ω, (f i ω) ^ 2 ∂μ) ≤ + ∑ i, (componentProbabilities κ m a b t i) ^ 2 * + componentVarianceBounds m a b i := by + apply Finset.sum_le_sum + intro i _ + exact mul_le_mul_of_nonneg_left (henergy i) (sq_nonneg _) + have hcalc : (∑ i, (componentProbabilities κ m a b t i) ^ 2 * + componentVarianceBounds m a b i) = 8 * κ ^ 2 / m + t ^ 2 / m := by + simp only [componentProbabilities, componentVarianceBounds, Fin.sum_univ_succ, + Matrix.cons_val_zero, Matrix.cons_val_succ, Fin.sum_univ_zero, add_zero] + have hra := rho_sq_div_width (κ := κ) hm ha + have hrb := rho_sq_div_width (κ := κ) hm hb + have htag : (t / m) ^ 2 * m = t ^ 2 / m := by field_simp + rw [htag] + simp only [div_eq_mul_inv] at hra hrb ⊢ + nlinarith + have ht2 : t ^ 2 ≤ t := by nlinarith + have htdiv : t ^ 2 / m ≤ t / m := (div_le_div_iff_of_pos_right hm).2 ht2 + have htm : 0 ≤ t / m := div_nonneg ht0 hm.le + norm_num only [Fintype.card_fin] at hbound + calc + _ ≤ 5 * (∑ i, (componentProbabilities κ m a b t i) ^ 2 * + componentVarianceBounds m a b i) := + hbound.trans (mul_le_mul_of_nonneg_left hsum (by norm_num)) + _ = 5 * (8 * κ ^ 2 / m + t ^ 2 / m) := by rw [hcalc] + _ ≤ _ := by + simp only [div_eq_mul_inv] at htdiv htm ⊢ + nlinarith + +end Invariant233.CouplingMarginalBounds + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/CouplingMixture.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/CouplingMixture.lean new file mode 100644 index 0000000000000000000000000000000000000000..e21708cd6f82f0ccc68c6f5e78796a96863b9801 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/CouplingMixture.lean @@ -0,0 +1,243 @@ +import OAI.Analysis.IrrationalRotation.Model.CouplingMixture +import OAI.Analysis.IrrationalRotation.Model.CouplingMarginalBounds +import Mathlib + +namespace OAI + +open MeasureTheory ProbabilityTheory Set +open scoped BigOperators ENNReal ProbabilityTheory + +namespace Invariant233.CouplingMixture + +variable {X I : Type*} [MeasurableSpace X] [Fintype I] + +lemma diagonal_fst (μ : Measure X) : (diagonal μ).fst = μ := by + simpa [diagonal] using + (Measure.fst_map_prodMk (μ := μ) (X := id) (Y := id) measurable_id measurable_id) + +lemma diagonal_snd (μ : Measure X) : (diagonal μ).snd = μ := by + simpa [diagonal] using + (Measure.snd_map_prodMk (μ := μ) (X := id) (Y := id) measurable_id measurable_id) + +instance diagonal_isProbabilityMeasure (μ : Measure X) [IsProbabilityMeasure μ] : + IsProbabilityMeasure (diagonal μ) := by + unfold diagonal + infer_instance + +lemma fst_finsetSum {J : Type*} (s : Finset J) (μ : J → Measure (X × X)) : + (∑ i ∈ s, μ i).fst = ∑ i ∈ s, (μ i).fst := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert a s ha ih => simp [Finset.sum_insert ha, ih] + +lemma snd_finsetSum {J : Type*} (s : Finset J) (μ : J → Measure (X × X)) : + (∑ i ∈ s, μ i).snd = ∑ i ∈ s, (μ i).snd := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert a s ha ih => simp [Finset.sum_insert ha, ih] + +lemma mixture_fst (μ : Measure X) (q : ℝ≥0∞) (p : I → ℝ≥0∞) + (u v : I → Measure X) [∀ i, IsProbabilityMeasure (v i)] : + (mixture μ q p u v).fst = q • μ + ∑ i, p i • u i := by + unfold mixture + rw [Measure.fst_add, fst_finsetSum] + simp only [Measure.fst, Measure.map_smul _ measurable_fst.aemeasurable, + Measure.map_fst_prod, measure_univ, one_smul] + rw [← Measure.fst, diagonal_fst] + +lemma mixture_snd (μ : Measure X) (q : ℝ≥0∞) (p : I → ℝ≥0∞) + (u v : I → Measure X) [∀ i, IsProbabilityMeasure (u i)] + [∀ i, IsProbabilityMeasure (v i)] : + (mixture μ q p u v).snd = q • μ + ∑ i, p i • v i := by + unfold mixture + rw [Measure.snd_add, snd_finsetSum] + simp only [Measure.snd, Measure.map_smul _ measurable_snd.aemeasurable, + Measure.map_snd_prod, measure_univ, one_smul] + rw [← Measure.snd, diagonal_snd] + +lemma mixture_isProbabilityMeasure (μ : Measure X) [IsProbabilityMeasure μ] + (q : ℝ≥0∞) (p : I → ℝ≥0∞) (u v : I → Measure X) + [∀ i, IsProbabilityMeasure (u i)] [∀ i, IsProbabilityMeasure (v i)] + (htotal : q + ∑ i, p i = 1) : IsProbabilityMeasure (mixture μ q p u v) := by + constructor + simp only [mixture, Measure.add_apply, Measure.smul_apply, smul_eq_mul, + measure_univ, mul_one, Measure.finsetSum_apply] + simpa using htotal + +lemma diagonal_ae {μ : Measure X} {R : X → X → Prop} + (hR : MeasurableSet {z : X × X | R z.1 z.2}) (href : ∀ x, R x x) : + ∀ᵐ z ∂diagonal μ, R z.1 z.2 := by + unfold diagonal + apply (ae_map_iff (show Measurable (fun x : X => (x, x)) from + measurable_id.prodMk measurable_id).aemeasurable hR).2 + exact Filter.Eventually.of_forall href + +lemma mixture_ae {μ : Measure X} {q : ℝ≥0∞} {p : I → ℝ≥0∞} + {u v : I → Measure X} {P : X × X → Prop} + (hdiag : ∀ᵐ z ∂diagonal μ, P z) + (hcomp : ∀ i, ∀ᵐ z ∂(u i).prod (v i), P z) : + ∀ᵐ z ∂mixture μ q p u v, P z := by + rw [mixture, ae_add_measure_iff, ae_finsetSum_measure_iff] + exact ⟨Measure.ae_smul_measure hdiag q, fun i _ => Measure.ae_smul_measure (hcomp i) (p i)⟩ + +lemma withDensity_finite_mixture (μ : Measure X) (q : ℝ≥0∞) + (p : I → ℝ≥0∞) (g : I → X → ℝ≥0∞) (hg : ∀ i, Measurable (g i)) : + μ.withDensity (fun x => q + ∑ i, p i * g i x) = + q • μ + ∑ i, p i • μ.withDensity (g i) := by + classical + have hsum : μ.withDensity (fun x => ∑ i, p i * g i x) = + ∑ i, p i • μ.withDensity (g i) := by + have hfin : ∀ s : Finset I, μ.withDensity (fun x => ∑ i ∈ s, p i * g i x) = + ∑ i ∈ s, p i • μ.withDensity (g i) := by + intro s + induction s using Finset.induction_on with + | empty => simp + | @insert a s ha ih => + simp only [Finset.sum_insert ha] + rw [show (fun x => p a * g a x + ∑ i ∈ s, p i * g i x) = + (fun x => p a * g a x) + (fun x => ∑ i ∈ s, p i * g i x) from rfl, + withDensity_add_left (show Measurable (fun x => p a * g a x) from measurable_const.mul (hg a)), ih] + congr 1 + exact withDensity_smul (p a) (hg a) + exact hfin Finset.univ + rw [show (fun x => q + ∑ i, p i * g i x) = + (fun _ => q) + (fun x => ∑ i, p i * g i x) from rfl, + withDensity_add_left measurable_const, withDensity_const, hsum] + +lemma intervalLaw_isProbabilityMeasure {a b : ℝ} (hab : a < b) : + IsProbabilityMeasure (intervalLaw a b) := by + apply cond_isProbabilityMeasure_of_finite + · rw [Real.volume_Ico] + exact ENNReal.ofReal_ne_zero_iff.mpr (sub_pos.mpr hab) + · rw [Real.volume_Ico] + exact ENNReal.ofReal_ne_top + +lemma intervalLaw_ae_mem (a b : ℝ) : ∀ᵐ x ∂intervalLaw a b, x ∈ Ico a b := + ae_cond_mem measurableSet_Ico + +lemma intervalLaw_pair_ordered {a b c d : ℝ} (hbc : b ≤ c) : + ∀ᵐ z ∂(intervalLaw a b).prod (intervalLaw c d), z.1 ≤ z.2 := by + have : IsZeroOrProbabilityMeasure (intervalLaw a b) := inferInstanceAs + (IsZeroOrProbabilityMeasure (volume[|Ico a b])) + have : IsZeroOrProbabilityMeasure (intervalLaw c d) := inferInstanceAs + (IsZeroOrProbabilityMeasure (volume[|Ico c d])) + rw [Measure.ae_prod_iff_ae_ae (measurableSet_le measurable_fst measurable_snd)] + filter_upwards [intervalLaw_ae_mem a b] with x hx + filter_upwards [intervalLaw_ae_mem c d] with y hy + exact hx.2.le.trans (hbc.trans hy.1) + +lemma map_finsetSum {A B J : Type*} [MeasurableSpace A] [MeasurableSpace B] + (s : Finset J) (μ : J → Measure A) {f : A → B} (hf : Measurable f) : + (∑ i ∈ s, μ i).map f = ∑ i ∈ s, (μ i).map f := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert a s ha ih => simp [Finset.sum_insert ha, Measure.map_add _ _ hf, ih] + +omit [Fintype I] in +lemma map_snd_label [MeasurableSpace (Option I)] (ν : Measure (X × X)) + (l : Option I) : (ν.map (fun z => (l, z))).map Prod.snd = ν := by + rw [Measure.map_map measurable_snd (show Measurable (fun z : X × X => (l, z)) from + measurable_const.prodMk measurable_id)] + exact Measure.map_id + +omit [Fintype I] in +lemma map_label_event [DecidableEq I] [MeasurableSpace (Option I)] [MeasurableSingletonClass (Option I)] + (ν : Measure (X × X)) (l j : Option I) : + ν.map (fun z => (l, z)) {z | z.1 = j} = if l = j then ν Set.univ else 0 := by + classical + have hs : MeasurableSet {z : Option I × (X × X) | z.1 = j} := + measurable_fst (measurableSet_singleton j) + rw [Measure.map_apply (show Measurable (fun z : X × X => (l, z)) from + measurable_const.prodMk measurable_id) hs] + by_cases h : l = j <;> simp [h] + +lemma labelledMixture_map_snd [MeasurableSpace (Option I)] + (μ : Measure X) (q : ℝ≥0∞) (p : I → ℝ≥0∞) (u v : I → Measure X) : + (labelledMixture μ q p u v).map Prod.snd = mixture μ q p u v := by + unfold labelledMixture mixture + rw [Measure.map_add _ _ measurable_snd, map_finsetSum _ _ measurable_snd] + simp only [Measure.map_smul _ measurable_snd.aemeasurable, map_snd_label] + +lemma labelledMixture_isProbabilityMeasure [MeasurableSpace (Option I)] + (μ : Measure X) [IsProbabilityMeasure μ] (q : ℝ≥0∞) (p : I → ℝ≥0∞) + (u v : I → Measure X) [∀ i, IsProbabilityMeasure (u i)] + [∀ i, IsProbabilityMeasure (v i)] (htotal : q + ∑ i, p i = 1) : + IsProbabilityMeasure (labelledMixture μ q p u v) := by + constructor + have := mixture_isProbabilityMeasure μ q p u v htotal + have h := congrArg (fun ν : Measure (X × X) => ν Set.univ) + (labelledMixture_map_snd μ q p u v) + simpa [Measure.map_apply measurable_snd MeasurableSet.univ] using h + +lemma labelledMixture_none_mass [MeasurableSpace (Option I)] [MeasurableSingletonClass (Option I)] + (μ : Measure X) [IsProbabilityMeasure μ] (q : ℝ≥0∞) (p : I → ℝ≥0∞) + (u v : I → Measure X) : + labelledMixture μ q p u v {z | z.1 = none} = q := by + classical + simp only [labelledMixture, Measure.add_apply, Measure.smul_apply, + Measure.finsetSum_apply, smul_eq_mul, map_label_event] + simp + +lemma labelledMixture_some_mass [MeasurableSpace (Option I)] [MeasurableSingletonClass (Option I)] + (μ : Measure X) (q : ℝ≥0∞) (p : I → ℝ≥0∞) + (u v : I → Measure X) [∀ i, IsProbabilityMeasure (u i)] + [∀ i, IsProbabilityMeasure (v i)] (i : I) : + labelledMixture μ q p u v {z | z.1 = some i} = p i := by + classical + simp only [labelledMixture, Measure.add_apply, Measure.smul_apply, + Measure.finsetSum_apply, smul_eq_mul, map_label_event] + simp + +lemma cond_eq_withDensity_uniformDensity {μ : Measure X} [IsFiniteMeasure μ] + {s : Set X} (hs : MeasurableSet s) (hpos : 0 < μ.real s) : + μ[|s] = μ.withDensity (fun x => + ENNReal.ofReal (CouplingMarginalBounds.uniformDensity μ s x)) := by + have hc : ENNReal.ofReal ((μ.real s)⁻¹) = (μ s)⁻¹ := by + rw [ENNReal.ofReal_inv_of_pos hpos, measureReal_def, + ENNReal.ofReal_toReal (measure_ne_top μ s)] + have hfun : (fun x => ENNReal.ofReal (CouplingMarginalBounds.uniformDensity μ s x)) = + s.indicator (fun _ => (μ s)⁻¹) := by + ext x + by_cases hx : x ∈ s <;> simp [CouplingMarginalBounds.uniformDensity, hx, hc] + rw [hfun, withDensity_indicator hs, withDensity_const] + rfl + +omit [MeasurableSpace X] in +lemma ofReal_mixture_density (q : ℝ) (p : I → ℝ) (g : I → X → ℝ) + (hq : 0 ≤ q) (hp : ∀ i, 0 ≤ p i) (hg : ∀ i x, 0 ≤ g i x) (x : X) : + ENNReal.ofReal (q + ∑ i, p i * g i x) = + ENNReal.ofReal q + ∑ i, ENNReal.ofReal (p i) * ENNReal.ofReal (g i x) := by + rw [ENNReal.ofReal_add hq (Finset.sum_nonneg (fun i _ => mul_nonneg (hp i) (hg i x))), + ENNReal.ofReal_sum_of_nonneg (fun i _ => mul_nonneg (hp i) (hg i x))] + congr 1 + exact Finset.sum_congr rfl (fun i _ => ENNReal.ofReal_mul (hp i)) + +lemma mixture_fst_real_density (μ : Measure X) (q : ℝ) (p : I → ℝ) + (u v : I → Measure X) [∀ i, IsProbabilityMeasure (v i)] + (g : I → X → ℝ) (hq : 0 ≤ q) (hp : ∀ i, 0 ≤ p i) + (hg0 : ∀ i x, 0 ≤ g i x) (hgm : ∀ i, Measurable (g i)) + (hu : ∀ i, u i = μ.withDensity (fun x => ENNReal.ofReal (g i x))) : + (mixture μ (ENNReal.ofReal q) (fun i => ENNReal.ofReal (p i)) u v).fst = + μ.withDensity (fun x => ENNReal.ofReal (q + ∑ i, p i * g i x)) := by + rw [mixture_fst] + simp_rw [hu, ofReal_mixture_density q p g hq hp hg0] + exact (withDensity_finite_mixture μ _ _ _ (fun i => (hgm i).ennreal_ofReal)).symm + +lemma mixture_snd_real_density (μ : Measure X) (q : ℝ) (p : I → ℝ) + (u v : I → Measure X) [∀ i, IsProbabilityMeasure (u i)] + [∀ i, IsProbabilityMeasure (v i)] + (g : I → X → ℝ) (hq : 0 ≤ q) (hp : ∀ i, 0 ≤ p i) + (hg0 : ∀ i x, 0 ≤ g i x) (hgm : ∀ i, Measurable (g i)) + (hv : ∀ i, v i = μ.withDensity (fun x => ENNReal.ofReal (g i x))) : + (mixture μ (ENNReal.ofReal q) (fun i => ENNReal.ofReal (p i)) u v).snd = + μ.withDensity (fun x => ENNReal.ofReal (q + ∑ i, p i * g i x)) := by + rw [mixture_snd] + simp_rw [hv, ofReal_mixture_density q p g hq hp hg0] + exact (withDensity_finite_mixture μ _ _ _ (fun i => (hgm i).ennreal_ofReal)).symm + +end Invariant233.CouplingMixture + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/FiniteConditionalAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/FiniteConditionalAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..cdd64cfda404cdea0d33a435843d83eeafa3bea3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/FiniteConditionalAttenuation.lean @@ -0,0 +1,179 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ConditionalCrossingAvoidance + +namespace OAI + +open MeasureTheory ProbabilityTheory +open scoped BigOperators Classical + +namespace Invariant233.CrossingAvoidance + +variable {ι Ω : Type*} + +theorem measurable_card_filter [MeasurableSpace Ω] (s : Finset ι) + (p : Ω → ι → Prop) + (hp : ∀ i ∈ s, MeasurableSet {ω | p ω i}) : + Measurable (fun ω => (s.filter (fun i => p ω i)).card) := by + classical + have hsum : Measurable (fun ω => ∑ i ∈ s, if p ω i then (1 : ℕ) else 0) := by + apply Finset.measurable_sum + intro i hi + exact Measurable.ite (hp i hi) measurable_const measurable_const + simpa only [Finset.sum_boole, Nat.cast_id] using hsum + +theorem majority_split_for_ordered_pair (s : Finset ι) (x y u : ι → ℝ) + (horder : ∀ i ∈ s, x i ≤ y i) + (hno : ∀ i ∈ s, ¬ (x i < u i ∧ u i ≤ y i)) : + (¬ s.card ≤ 2 * (s.filter (fun i => x i < u i)).card) ↔ + s.card < 2 * (s.filter (fun i => u i ≤ y i)).card := by + have hsum := below_card_add_above_card s x y u horder hno + omega + +theorem finite_conditional_attenuation [Countable ι] + (mx my : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω] + (hmx : mx ≤ mΩ) (hmy : my ≤ mΩ) (μ : Measure Ω) [IsFiniteMeasure μ] + (I : Finset ι) (u : ι → ℝ) (x y : Ω → ι → ℝ) + (hx : Measurable[mx] x) (hy : Measurable[my] y) + (top bottom : ι → Set Ω) + (htop : ∀ i, MeasurableSet (top i)) (hbottom : ∀ i, MeasurableSet (bottom i)) + (hindTop : iCondIndepSet mx hmx top μ) (hindBottom : iCondIndepSet my hmy bottom μ) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) + (hI : m / 20 ≤ (I.card : ℝ)) + (horder : ∀ᵐ ω ∂μ, ∀ i ∈ I, x ω i ≤ y ω i) + (hforceTop : ∀ᵐ ω ∂μ, ∀ i ∈ I, + x ω i < u i → ω ∈ top i → u i ≤ y ω i) + (hforceBottom : ∀ᵐ ω ∂μ, ∀ i ∈ I, + u i ≤ y ω i → ω ∈ bottom i → x ω i < u i) + (hprobTop : ∀ᵐ ω ∂μ, ∀ i ∈ I, x ω i < u i → + ρ / 10 ≤ (μ[(top i).indicator (fun _ => (1 : ℝ)) | mx]) ω) + (hprobBottom : ∀ᵐ ω ∂μ, ∀ i ∈ I, u i ≤ y ω i → + ρ / 10 ≤ (μ[(bottom i).indicator (fun _ => (1 : ℝ)) | my]) ω) + (R : Ω → ℝ) (hR : ∀ᵐ ω ∂μ, R ω ≤ 1) + (hcross : ∀ᵐ ω ∂μ, ∀ i ∈ I, + (x ω i < u i ∧ u i ≤ y ω i) → R ω ≤ Real.exp (-L)) : + ∃ H₁ H₂ : Set Ω, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂μ, (μ[H₁.indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂μ, (μ[H₂.indicator (fun _ => (1 : ℝ)) | my]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂μ, R ω ≤ Real.exp (-L) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + classical + let B : Set Ω := {ω | ∀ i ∈ I, ¬ (x ω i < u i ∧ u i ≤ y ω i)} + let low : (ι → ℝ) → Finset ι := fun a => I.filter (fun i => a i < u i) + let high : (ι → ℝ) → Finset ι := fun a => I.filter (fun i => u i ≤ a i) + let activeLow : (ι → ℝ) → Prop := fun a => I.card ≤ 2 * (low a).card + let activeHigh : (ι → ℝ) → Prop := fun a => I.card ≤ 2 * (high a).card + let H₁ : Set Ω := B ∩ {ω | activeLow (x ω)} + let H₂ : Set Ω := B \ {ω | activeLow (x ω)} + have hxi (i : ι) : Measurable (fun ω => x ω i) := + (measurable_pi_apply i).comp (hx.mono hmx le_rfl) + have hyi (i : ι) : Measurable (fun ω => y ω i) := + (measurable_pi_apply i).comp (hy.mono hmy le_rfl) + have hB : MeasurableSet B := by + have hh : MeasurableSet (⋂ i ∈ I, {ω | ¬ (x ω i < u i ∧ u i ≤ y ω i)}) := + MeasurableSet.biInter I.countable_toSet (fun i _ => + ((measurableSet_lt (hxi i) measurable_const).inter + (measurableSet_le measurable_const (hyi i))).compl) + simpa only [B, Set.ofPred_forall] using hh + have hcount : Measurable (fun ω => (low (x ω)).card) := by + apply measurable_card_filter I (fun ω i => x ω i < u i) + intro i _ + exact measurableSet_lt (hxi i) measurable_const + have hactive : MeasurableSet {ω | activeLow (x ω)} := + measurableSet_le measurable_const (measurable_const.mul hcount) + have hH₁ : MeasurableSet H₁ := hB.inter hactive + have hH₂ : MeasurableSet H₂ := hB.diff hactive + have hbound₁ : ∀ᵐ ω ∂μ, + (μ[H₁.indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ Real.exp (-L / 400) := by + apply conditional_bad_le_exp_of_endpoint mx hmx μ top htop hindTop x hx + low activeLow m ρ L hρ hL + · intro a ha + exact eligible_card_lower_bound I (low a) m hI ha + · filter_upwards [hprobTop] with ω hω + intro _ i hi + have hi' := Finset.mem_filter.mp hi + exact hω i hi'.1 hi'.2 + · exact hH₁ + · filter_upwards [hforceTop] with ω hω + intro hmem + refine ⟨hmem.2, ?_⟩ + intro i hi hlabel + have hi' := Finset.mem_filter.mp hi + exact hmem.1 i hi'.1 ⟨hi'.2, hω i hi'.1 hi'.2 hlabel⟩ + have hbound₂ : ∀ᵐ ω ∂μ, + (μ[H₂.indicator (fun _ => (1 : ℝ)) | my]) ω ≤ Real.exp (-L / 400) := by + apply conditional_bad_le_exp_of_endpoint my hmy μ bottom hbottom hindBottom y hy + high activeHigh m ρ L hρ hL + · intro a ha + exact eligible_card_lower_bound I (high a) m hI ha + · filter_upwards [hprobBottom] with ω hω + intro _ i hi + have hi' := Finset.mem_filter.mp hi + exact hω i hi'.1 hi'.2 + · exact hH₂ + · filter_upwards [horder, hforceBottom] with ω horder hω + intro hmem + have hhalf : activeHigh (y ω) := + above_half_of_below_not_half I (x ω) (y ω) u horder hmem.1 hmem.2 + refine ⟨hhalf, ?_⟩ + intro i hi hlabel + have hi' := Finset.mem_filter.mp hi + exact hmem.1 i hi'.1 ⟨hω i hi'.1 hi'.2 hlabel, hi'.2⟩ + refine ⟨H₁, H₂, hH₁, hH₂, hbound₁, hbound₂, ?_⟩ + filter_upwards [hR, hcross] with ω hR hcross + by_cases hb : ω ∈ B + · by_cases ha : activeLow (x ω) + · have h1 : ω ∈ H₁ := ⟨hb, ha⟩ + have h2 : ω ∉ H₂ := fun h => h.2 ha + rw [Set.indicator_of_mem h1, Set.indicator_of_notMem h2] + linarith [Real.exp_pos (-L)] + · have h1 : ω ∉ H₁ := fun h => ha h.2 + have h2 : ω ∈ H₂ := ⟨hb, ha⟩ + rw [Set.indicator_of_notMem h1, Set.indicator_of_mem h2] + linarith [Real.exp_pos (-L)] + · have hb' : ¬ ∀ i ∈ I, ¬ (x ω i < u i ∧ u i ≤ y ω i) := hb + push Not at hb' + obtain ⟨i, hi, hci⟩ := hb' + have h1 : ω ∉ H₁ := fun h => hb h.1 + have h2 : ω ∉ H₂ := fun h => hb h.1 + rw [Set.indicator_of_notMem h1, Set.indicator_of_notMem h2] + simpa using hcross i hi hci + +theorem empty_exceptional_events (mx my : MeasurableSpace Ω) + {mΩ : MeasurableSpace Ω} (μ : Measure Ω) (E : Set Ω) (R : Ω → ℝ) + (η δ : ℝ) (hδ : 0 ≤ δ) + (hR : ∀ᵐ ω ∂μ, ω ∈ E → R ω ≤ η) : + ∃ H₁ H₂ : Set Ω, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂μ, (μ[H₁.indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ δ) ∧ + (∀ᵐ ω ∂μ, (μ[H₂.indicator (fun _ => (1 : ℝ)) | my]) ω ≤ δ) ∧ + (∀ᵐ ω ∂μ, ω ∈ E → R ω ≤ η + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + refine ⟨∅, ∅, MeasurableSet.empty, MeasurableSet.empty, ?_, ?_, ?_⟩ + · simp only [Set.indicator_empty, condExp_fun_zero] + exact Filter.Eventually.of_forall (fun _ => hδ) + · simp only [Set.indicator_empty, condExp_fun_zero] + exact Filter.Eventually.of_forall (fun _ => hδ) + · simpa only [Set.indicator_empty, Pi.zero_apply, add_zero] using hR + +theorem simultaneous_exceptional_families {κ : Type*} [Countable κ] + (mx my : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} (μ : Measure Ω) + (E : Set Ω) (R : κ → Ω → ℝ) (η δ : κ → ℝ) + (h : ∀ k, ∃ H₁ H₂ : Set Ω, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂μ, (μ[H₁.indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ δ k) ∧ + (∀ᵐ ω ∂μ, (μ[H₂.indicator (fun _ => (1 : ℝ)) | my]) ω ≤ δ k) ∧ + (∀ᵐ ω ∂μ, ω ∈ E → R k ω ≤ η k + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω)) : + ∃ H₁ H₂ : κ → Set Ω, (∀ k, MeasurableSet (H₁ k)) ∧ (∀ k, MeasurableSet (H₂ k)) ∧ + (∀ᵐ ω ∂μ, ∀ k, + (μ[(H₁ k).indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ δ k ∧ + (μ[(H₂ k).indicator (fun _ => (1 : ℝ)) | my]) ω ≤ δ k ∧ + (ω ∈ E → R k ω ≤ η k + (H₁ k).indicator (fun _ => (1 : ℝ)) ω + + (H₂ k).indicator (fun _ => (1 : ℝ)) ω)) := by + classical + choose H₁ H₂ hmeas₁ hmeas₂ hbound₁ hbound₂ hratio using h + refine ⟨H₁, H₂, hmeas₁, hmeas₂, ae_all_iff.mpr ?_⟩ + intro k + filter_upwards [hbound₁ k, hbound₂ k, hratio k] with ω h₁ h₂ hr + exact ⟨h₁, h₂, hr⟩ + +end Invariant233.CrossingAvoidance + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/MixedRadixHybridLaw.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/MixedRadixHybridLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..f2a0f2b4003cb2685b587ce83c1742e820f2fd5a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/MixedRadixHybridLaw.lean @@ -0,0 +1,121 @@ +import OAI.Analysis.IrrationalRotation.Sampling.MixedRadixCircle +import OAI.Analysis.IrrationalRotation.Sampling.MixedRadixTransport +import OAI.Analysis.IrrationalRotation.Analysis.CountableGraphTransfer +import Mathlib.MeasureTheory.Measure.FiniteMeasure +import Mathlib.MeasureTheory.Integral.DominatedConvergence + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped Topology + +namespace Invariant233.HybridLaw + +theorem tendsto_finiteMeasure_map_of_ae_tendsto + {Ω X : Type*} [MeasurableSpace Ω] [TopologicalSpace X] + [MeasurableSpace X] [BorelSpace X] + (P : FiniteMeasure Ω) {f : ℕ → Ω → X} {g : Ω → X} + (hf : ∀ n, Measurable (f n)) (hg : Measurable g) + (hlim : ∀ᵐ ω ∂(P : Measure Ω), + Tendsto (fun n => f n ω) atTop (𝓝 (g ω))) : + Tendsto (fun n => P.map (f n)) atTop (𝓝 (P.map g)) := by + apply FiniteMeasure.tendsto_iff_forall_integral_tendsto.mpr + intro φ + simp only [FiniteMeasure.toMeasure_map] + simp_rw [integral_map (hf _).aemeasurable φ.continuous.aestronglyMeasurable, + integral_map hg.aemeasurable φ.continuous.aestronglyMeasurable] + apply tendsto_integral_of_dominated_convergence (fun _ => ‖φ‖) + · intro n + exact (φ.continuous.measurable.comp (hf n)).aestronglyMeasurable + · exact integrable_const _ + · intro n + exact Eventually.of_forall fun ω => φ.norm_coe_le_norm (f n ω) + · filter_upwards [hlim] with ω hω + exact (φ.continuous.tendsto (g ω)).comp hω + +end Invariant233.HybridLaw + +namespace Invariant233.MixedRadix + +theorem measurable_hybrid {r : ℕ → ℕ} (N : ℕ) : + Measurable (fun z : Digits r × Digits r => hybrid z.1 z.2 N) := by + apply Measurable.of_eval + intro n + by_cases hn : n < N + · simpa only [hybrid, ite_eq_left hn, Function.comp_def] using (measurable_pi_apply n).comp measurable_snd + · simpa only [hybrid, ite_eq_right hn, Function.comp_def] using (measurable_pi_apply n).comp measurable_fst + +theorem tendsto_circleValue_hybrid {r : ℕ → ℕ} (hr : ∀ n, 2 ≤ r n) + (d e : Digits r) : + Tendsto (fun N => circleValue (hybrid d e N)) atTop (𝓝 (circleValue e)) := by + exact (AddCircle.continuous_mk' (1 : ℝ)).continuousAt.tendsto.comp + (tendsto_ofDigits_hybrid hr d e) + +theorem tendsto_circle_hybrid_pair_law {r : ℕ → ℕ} (hr : ∀ n, 2 ≤ r n) + (P : FiniteMeasure (Digits r × Digits r)) : + Tendsto (fun N => P.map (fun z => (circleValue z.1, + circleValue (hybrid z.1 z.2 N)))) atTop + (𝓝 (P.map (fun z => (circleValue z.1, circleValue z.2)))) := by + apply HybridLaw.tendsto_finiteMeasure_map_of_ae_tendsto + · intro N + exact ((measurable_circleValue hr).comp measurable_fst).prodMk + ((measurable_circleValue hr).comp (measurable_hybrid N)) + · exact ((measurable_circleValue hr).comp measurable_fst).prodMk + ((measurable_circleValue hr).comp measurable_snd) + · exact Eventually.of_forall fun z => tendsto_const_nhds.prodMk_nhds + (tendsto_circleValue_hybrid hr z.1 z.2) + +theorem circleValue_hybrid_eq_add_int_div {r : ℕ → ℕ} (hr : ∀ n, 0 < r n) + (d e : Digits r) (N : ℕ) : + ∃ z : ℤ, circleValue (hybrid d e N) = circleValue d + + (((z : ℝ) / (denominator r N : ℝ) : ℝ) : AddCircle (1 : ℝ)) := by + obtain ⟨z, hz⟩ := hybrid_sub_eq_int_div hr d e N + refine ⟨z, ?_⟩ + have hreal : ofDigits (hybrid d e N) = ofDigits d + + (z : ℝ) / (denominator r N : ℝ) := by linarith + simpa only [circleValue, AddCircle.coe_add] using + congrArg (fun x : ℝ => (x : AddCircle (1 : ℝ))) hreal + +theorem ae_circle_hybrid_pair_graph {r : ℕ → ℕ} (hr : ∀ n, 2 ≤ r n) + (P : Measure (Digits r × Digits r)) (N : ℕ) : + ∀ᵐ t ∂P.map (fun z => (circleValue z.1, circleValue (hybrid z.1 z.2 N))), + ∃ z : ℤ, t.2 = t.1 + + (((z : ℝ) / (denominator r N : ℝ) : ℝ) : AddCircle (1 : ℝ)) := by + have hmeas : Measurable (fun z : Digits r × Digits r => + (circleValue z.1, circleValue (hybrid z.1 z.2 N))) := + ((measurable_circleValue hr).comp measurable_fst).prodMk + ((measurable_circleValue hr).comp (measurable_hybrid N)) + have hset : MeasurableSet {t : AddCircle (1 : ℝ) × AddCircle (1 : ℝ) | + ∃ z : ℤ, t.2 = t.1 + + (((z : ℝ) / (denominator r N : ℝ) : ℝ) : AddCircle (1 : ℝ))} := by + simp only [Set.ofPred_exists] + exact MeasurableSet.iUnion fun z => + measurableSet_eq_fun measurable_snd (measurable_fst.add measurable_const) + apply (ae_map_iff hmeas.aemeasurable hset).mpr + exact Eventually.of_forall fun t => circleValue_hybrid_eq_add_int_div + (fun n => lt_of_lt_of_le (by decide : 0 < 2) (hr n)) t.1 t.2 N + +theorem ae_relation_circle_hybrid_pair_law {r : ℕ → ℕ} (hr : ∀ n, 2 ≤ r n) + (P : Measure (Digits r × Digits r)) (μ : Measure (AddCircle (1 : ℝ))) + (R : AddCircle (1 : ℝ) → AddCircle (1 : ℝ) → Prop) (N : ℕ) + (hfirst : P.map (fun z => circleValue z.1) ≪ μ) + (hgraph : ∀ z : ℤ, ∀ᵐ x ∂μ, + R x (x + (((z : ℝ) / (denominator r N : ℝ) : ℝ) : AddCircle (1 : ℝ)))) : + ∀ᵐ t ∂P.map (fun z => (circleValue z.1, circleValue (hybrid z.1 z.2 N))), + R t.1 t.2 := by + have hmeas : Measurable (fun z : Digits r × Digits r => + (circleValue z.1, circleValue (hybrid z.1 z.2 N))) := + ((measurable_circleValue hr).comp measurable_fst).prodMk + ((measurable_circleValue hr).comp (measurable_hybrid N)) + apply Fields.ae_pair_relation_of_countable_graphs R + (fun (z : ℤ) x => x + (((z : ℝ) / (denominator r N : ℝ) : ℝ) : AddCircle (1 : ℝ))) + · simpa only [Measure.map_map measurable_fst hmeas, Function.comp_def] using hfirst + · exact hgraph + · exact ae_circle_hybrid_pair_graph hr P N + +end Invariant233.MixedRadix + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/OneCoordinateConditional.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/OneCoordinateConditional.lean new file mode 100644 index 0000000000000000000000000000000000000000..2603e30baed738892e34db2e5cef4c9adde1fd00 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/OneCoordinateConditional.lean @@ -0,0 +1,126 @@ +import OAI.Analysis.IrrationalRotation.Model.OneCoordinateConditional +import OAI.Analysis.IrrationalRotation.Analysis.FiniteKernelMixture +import OAI.Analysis.IrrationalRotation.Product.OneCoordinateDensity + +namespace OAI + +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal ProbabilityTheory + +namespace Invariant233.OneCoordinateCoupling +open CouplingMixture CouplingMarginalBounds FiniteKernelMixture + +private lemma finite_total (q : ℝ) (p : Fin 5 → ℝ) (u : Fin 5 → ℝ → ℝ) (x : ℝ) : + ENNReal.ofReal q + ∑ i, ENNReal.ofReal (p i) * ENNReal.ofReal (u i x) ≠ ∞ := by + apply ENNReal.add_ne_top.mpr + refine ⟨ENNReal.ofReal_ne_top, ENNReal.sum_ne_top.mpr ?_⟩ + intro i _ + exact ENNReal.mul_ne_top ENNReal.ofReal_ne_top ENNReal.ofReal_ne_top + +section SourceParameters +variable {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) +include hκ0 hκ hm ha ha' hb hb' ht0 ht + +lemma rightGivenLeft_isMarkov : IsMarkovKernel (rightGivenLeft κ m a b t) := by + have hm0 : 0 < m := by linarith + have : ∀ i, IsProbabilityMeasure (rightLaw m a b i) := + rightLaw_isProbabilityMeasure (by linarith) (width_pos hm0 ha) ha' (width_pos hm0 hb) hb' + apply diagonalReplacementKernel_isMarkov + · apply ENNReal.ofReal_ne_zero_iff.mpr + have := (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + linarith + · exact finite_total _ _ _ + +lemma leftGivenRight_isMarkov : IsMarkovKernel (leftGivenRight κ m a b t) := by + have hm0 : 0 < m := by linarith + have : ∀ i, IsProbabilityMeasure (leftLaw m a b i) := + leftLaw_isProbabilityMeasure hm0 (width_pos hm0 ha) ha' (width_pos hm0 hb) hb' + apply diagonalReplacementKernel_isMarkov + · apply ENNReal.ofReal_ne_zero_iff.mpr + have := (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + linarith + · exact finite_total _ _ _ + +lemma rightGivenLeft_disintegration : + (pairLaw κ m a b t).fst ⊗ₘ rightGivenLeft κ m a b t = pairLaw κ m a b t := by + have hm0 : 0 < m := by linarith + have ha0 := width_pos hm0 ha + have hb0 := width_pos hm0 hb + have : ∀ i, IsProbabilityMeasure (rightLaw m a b i) := + rightLaw_isProbabilityMeasure (by linarith) ha0 ha' hb0 hb' + have := rightGivenLeft_isMarkov hκ0 hκ hm ha ha' hb hb' ht0 ht + have hq : ENNReal.ofReal (diagonalMass κ m a b t) ≠ 0 := by + apply ENNReal.ofReal_ne_zero_iff.mpr + have := (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + linarith + let d : ℝ → ℝ≥0∞ := fun x => ENNReal.ofReal (diagonalMass κ m a b t) + + ∑ i, ENNReal.ofReal (componentProbabilities κ m a b t i) * + ENNReal.ofReal (leftDensity m a b i x) + have hpair : (baseLaw.withDensity d) ⊗ₘ rightGivenLeft κ m a b t = pairLaw κ m a b t := by + unfold rightGivenLeft d + rw [diagonalReplacementKernel_disintegration _ _ hq] + · unfold pairLaw mixture CouplingMixture.diagonal + congr 1 + apply Finset.sum_congr rfl + intro i _ + rw [leftLaw_eq_withDensity (by linarith) ha0 ha' hb0 hb'] + · exact finite_total _ _ _ + have hfst := congrArg Measure.fst hpair + rw [Measure.fst_compProd] at hfst + rw [← hfst] + exact hpair + +lemma leftGivenRight_disintegration : + (pairLaw κ m a b t).snd ⊗ₘ leftGivenRight κ m a b t = + (pairLaw κ m a b t).map Prod.swap := by + have hm0 : 0 < m := by linarith + have ha0 := width_pos hm0 ha + have hb0 := width_pos hm0 hb + have : ∀ i, IsProbabilityMeasure (leftLaw m a b i) := + leftLaw_isProbabilityMeasure hm0 ha0 ha' hb0 hb' + have : ∀ i, IsProbabilityMeasure (rightLaw m a b i) := + rightLaw_isProbabilityMeasure (by linarith) ha0 ha' hb0 hb' + have := leftGivenRight_isMarkov hκ0 hκ hm ha ha' hb hb' ht0 ht + have hq : ENNReal.ofReal (diagonalMass κ m a b t) ≠ 0 := by + apply ENNReal.ofReal_ne_zero_iff.mpr + have := (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + linarith + have hswap : (pairLaw κ m a b t).map Prod.swap = + ENNReal.ofReal (diagonalMass κ m a b t) • CouplingMixture.diagonal baseLaw + + ∑ i, ENNReal.ofReal (componentProbabilities κ m a b t i) • + (rightLaw m a b i).prod (leftLaw m a b i) := by + unfold pairLaw mixture + rw [Measure.map_add _ _ measurable_swap, map_finsetSum _ _ measurable_swap] + simp only [Measure.map_smul _ measurable_swap.aemeasurable, Measure.prod_swap] + congr 1 + unfold CouplingMixture.diagonal + rw [Measure.map_map measurable_swap (show Measurable (fun x : ℝ => (x, x)) from + measurable_id.prodMk measurable_id)] + rfl + let d : ℝ → ℝ≥0∞ := fun x => ENNReal.ofReal (diagonalMass κ m a b t) + + ∑ i, ENNReal.ofReal (componentProbabilities κ m a b t i) * + ENNReal.ofReal (rightDensity m a b i x) + have hpair : (baseLaw.withDensity d) ⊗ₘ leftGivenRight κ m a b t = + (pairLaw κ m a b t).map Prod.swap := by + unfold leftGivenRight d + rw [diagonalReplacementKernel_disintegration _ _ hq] + · rw [hswap] + unfold CouplingMixture.diagonal + congr 1 + apply Finset.sum_congr rfl + intro i _ + rw [rightLaw_eq_withDensity (by linarith) ha0 ha' hb0 hb'] + · exact finite_total _ _ _ + have hfst := congrArg Measure.fst hpair + rw [Measure.fst_compProd, Measure.fst_map_swap] at hfst + rw [← hfst] + exact hpair + +end SourceParameters +end Invariant233.OneCoordinateCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/OneCoordinateCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/OneCoordinateCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..5fb9067f39f40203fd06260cf7e7e27417955d69 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/OneCoordinateCoupling.lean @@ -0,0 +1,172 @@ +import OAI.Analysis.IrrationalRotation.Model.OneCoordinateCoupling +import OAI.Analysis.IrrationalRotation.Couplings.CouplingMarginalBounds +import OAI.Analysis.IrrationalRotation.Couplings.CouplingMixture + +namespace OAI + +open MeasureTheory ProbabilityTheory Set +open scoped BigOperators ENNReal + +namespace Invariant233.OneCoordinateCoupling + +open CouplingMarginalBounds CouplingMixture + +instance baseLaw_isProbabilityMeasure : IsProbabilityMeasure baseLaw := + intervalLaw_isProbabilityMeasure (by norm_num) + +lemma leftLaw_isProbabilityMeasure {m a b : ℝ} + (hm : 0 < m) (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) + (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) (i : Fin 5) : + IsProbabilityMeasure (leftLaw m a b i) := by + have hinv : 0 < 1 / m := one_div_pos.mpr hm + fin_cases i <;> simp only [leftLaw] <;> + apply intervalLaw_isProbabilityMeasure <;> linarith + +lemma rightLaw_isProbabilityMeasure {m a b : ℝ} + (hm : 2 ≤ m) (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) + (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) (i : Fin 5) : + IsProbabilityMeasure (rightLaw m a b i) := by + have hm0 : 0 < m := by linarith + have hinv : 0 < 1 / m := one_div_pos.mpr hm0 + fin_cases i <;> simp only [rightLaw] <;> + apply intervalLaw_isProbabilityMeasure <;> linarith + +lemma componentProbabilities_nonneg {κ m a b t : ℝ} + (hκ : 0 ≤ κ) (hm : 0 < m) (ht : 0 ≤ t) (i : Fin 5) : + 0 ≤ componentProbabilities κ m a b t i := by + fin_cases i <;> + simp only [componentProbabilities] + all_goals first | exact rho_nonneg hκ | exact div_nonneg ht hm.le + +lemma pairLaw_isProbabilityMeasure {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) : IsProbabilityMeasure (pairLaw κ m a b t) := by + have hm0 : 0 < m := by linarith + have ha0 := width_pos hm0 ha + have hb0 := width_pos hm0 hb + have : ∀ i, IsProbabilityMeasure (leftLaw m a b i) := + leftLaw_isProbabilityMeasure hm0 ha0 ha' hb0 hb' + have : ∀ i, IsProbabilityMeasure (rightLaw m a b i) := + rightLaw_isProbabilityMeasure (by linarith) ha0 ha' hb0 hb' + apply mixture_isProbabilityMeasure + have hq0 : 0 ≤ diagonalMass κ m a b t := + le_trans (by norm_num) (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + have hp0 := componentProbabilities_nonneg (a := a) (b := b) hκ0 hm0 ht0 + rw [← ENNReal.ofReal_sum_of_nonneg (fun i _ => hp0 i), + ← ENNReal.ofReal_add hq0 (Finset.sum_nonneg (fun i _ => hp0 i))] + have htotal : diagonalMass κ m a b t + ∑ i, componentProbabilities κ m a b t i = 1 := by + simp only [componentProbabilities, Fin.sum_univ_succ, Matrix.cons_val_zero, + Matrix.cons_val_succ, Fin.sum_univ_zero, add_zero] + unfold diagonalMass + ring + rw [htotal] + norm_num + +lemma replacement_ae_ordered {m a b : ℝ} (hm : 2 ≤ m) (i : Fin 5) : + ∀ᵐ z ∂(leftLaw m a b i).prod (rightLaw m a b i), z.1 ≤ z.2 := by + have hm0 : 0 < m := by linarith + have hinv : 1 / m ≤ 1 / 2 := by + apply (div_le_iff₀ hm0).2 + linarith + fin_cases i <;> + simp only [leftLaw, rightLaw] + all_goals apply intervalLaw_pair_ordered + all_goals linarith + +lemma pairLaw_ae_ordered {κ m a b t : ℝ} (hm : 2 ≤ m) : + ∀ᵐ z ∂pairLaw κ m a b t, z.1 ≤ z.2 := by + apply mixture_ae + · exact diagonal_ae (measurableSet_le measurable_fst measurable_snd) (fun _ => le_rfl) + · exact replacement_ae_ordered hm + +lemma pairLaw_fst {κ m a b t : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) : + (pairLaw κ m a b t).fst = + ENNReal.ofReal (diagonalMass κ m a b t) • baseLaw + + ∑ i, ENNReal.ofReal (componentProbabilities κ m a b t i) • leftLaw m a b i := by + have : ∀ i, IsProbabilityMeasure (rightLaw m a b i) := + rightLaw_isProbabilityMeasure hm ha0 ha1 hb0 hb1 + exact mixture_fst _ _ _ _ _ + +lemma pairLaw_snd {κ m a b t : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) : + (pairLaw κ m a b t).snd = + ENNReal.ofReal (diagonalMass κ m a b t) • baseLaw + + ∑ i, ENNReal.ofReal (componentProbabilities κ m a b t i) • rightLaw m a b i := by + have : ∀ i, IsProbabilityMeasure (leftLaw m a b i) := + leftLaw_isProbabilityMeasure (by linarith) ha0 ha1 hb0 hb1 + have : ∀ i, IsProbabilityMeasure (rightLaw m a b i) := + rightLaw_isProbabilityMeasure hm ha0 ha1 hb0 hb1 + exact mixture_snd _ _ _ _ _ + +lemma baseLaw_eq_restrict : baseLaw = volume.restrict (Ico (0 : ℝ) 1) := by + simp [baseLaw, intervalLaw, ProbabilityTheory.cond, Real.volume_Ico] + +lemma interval_subset_unit {a b : ℝ} (ha : 0 ≤ a) (hb : b ≤ 1) : + Ico a b ⊆ Ico (0 : ℝ) 1 := by + intro x hx + exact ⟨ha.trans hx.1, hx.2.trans_le hb⟩ + +lemma baseLaw_interval_measure {a b : ℝ} (ha : 0 ≤ a) (hb : b ≤ 1) (hab : a ≤ b) : + baseLaw.real (Ico a b) = b - a := by + rw [measureReal_def, baseLaw_eq_restrict, Measure.restrict_apply measurableSet_Ico, + inter_eq_left.mpr (interval_subset_unit ha hb), Real.volume_Ico, + ENNReal.toReal_ofReal (sub_nonneg.mpr hab)] + +lemma intervalLaw_eq_base_cond {a b : ℝ} (ha : 0 ≤ a) (hb : b ≤ 1) : + intervalLaw a b = baseLaw[|Ico a b] := by + rw [baseLaw_eq_restrict] + simp only [intervalLaw, ProbabilityTheory.cond, + Measure.restrict_apply measurableSet_Ico, + Measure.restrict_restrict measurableSet_Ico, + inter_eq_left.mpr (interval_subset_unit ha hb)] + +lemma intervalLaw_eq_base_withDensity {a b : ℝ} + (ha : 0 ≤ a) (hb : b ≤ 1) (hab : a < b) : + intervalLaw a b = baseLaw.withDensity (fun x => + ENNReal.ofReal (uniformDensity baseLaw (Ico a b) x)) := by + rw [intervalLaw_eq_base_cond ha hb] + apply cond_eq_withDensity_uniformDensity measurableSet_Ico + rw [baseLaw_interval_measure ha hb hab.le] + exact sub_pos.mpr hab + +lemma labelledLaw_map_snd (κ m a b t : ℝ) : + (labelledLaw κ m a b t).map Prod.snd = pairLaw κ m a b t := + labelledMixture_map_snd _ _ _ _ _ + +lemma labelledLaw_isProbabilityMeasure {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) : IsProbabilityMeasure (labelledLaw κ m a b t) := by + have := pairLaw_isProbabilityMeasure hκ0 hκ hm ha ha' hb hb' ht0 ht + constructor + have h := congrArg (fun ν : Measure (ℝ × ℝ) => ν Set.univ) + (labelledLaw_map_snd κ m a b t) + simpa [Measure.map_apply measurable_snd MeasurableSet.univ] using h + +lemma labelledLaw_tag_mass {κ m a b t : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) : + labelledLaw κ m a b t {z | z.1 = some (4 : Fin 5)} = ENNReal.ofReal (t / m) := by + have : ∀ i, IsProbabilityMeasure (leftLaw m a b i) := + leftLaw_isProbabilityMeasure (by linarith) ha0 ha1 hb0 hb1 + have : ∀ i, IsProbabilityMeasure (rightLaw m a b i) := + rightLaw_isProbabilityMeasure hm ha0 ha1 hb0 hb1 + exact labelledMixture_some_mass _ _ _ _ _ (4 : Fin 5) + +lemma labelledLaw_diagonal_mass (κ m a b t : ℝ) : + labelledLaw κ m a b t {z | z.1 = none} = ENNReal.ofReal (diagonalMass κ m a b t) := + labelledMixture_none_mass _ _ _ _ _ + +lemma labelledLaw_ae_ordered {κ m a b t : ℝ} (hm : 2 ≤ m) : + ∀ᵐ z ∂labelledLaw κ m a b t, z.2.1 ≤ z.2.2 := by + have h := pairLaw_ae_ordered (κ := κ) (a := a) (b := b) (t := t) hm + rw [← labelledLaw_map_snd] at h + exact (ae_map_iff measurable_snd.aemeasurable + (measurableSet_le measurable_fst measurable_snd)).1 h + +end Invariant233.OneCoordinateCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/PrefixHybrid.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/PrefixHybrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a6bfe1e3da9f3753f67389fc83017f9f696adb8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/PrefixHybrid.lean @@ -0,0 +1,102 @@ +import OAI.Analysis.IrrationalRotation.Model.PrefixHybrid +import OAI.Analysis.IrrationalRotation.Sampling.ProductSampling +import Mathlib.MeasureTheory.Integral.DominatedConvergence +import Mathlib.Topology.ContinuousMap.Compact + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped Topology + +namespace Invariant233.ProductModel + +@[simp] theorem prefixEndpoint_apply (D i : ℕ) (x y : Base) : + prefixEndpoint D x y i = if i < D then y i else x i := by + simp [prefixEndpoint, selectedEndpoint] + +@[simp] theorem prefixPair_fst (D : ℕ) (xy : EndpointPair) : + (prefixPair D xy).1 = xy.1 := rfl + +theorem continuous_prefixEndpoint (D : ℕ) : + Continuous (fun xy : EndpointPair => prefixEndpoint D xy.1 xy.2) := by + apply continuous_pi + intro i + by_cases hi : i < D + · simpa only [prefixEndpoint_apply, ite_eq_left hi, Function.comp_def] using + (continuous_apply i).comp continuous_snd + · simpa only [prefixEndpoint_apply, ite_eq_right hi, Function.comp_def] using + (continuous_apply i).comp continuous_fst + +theorem continuous_prefixPair (D : ℕ) : Continuous (prefixPair D) := + continuous_fst.prodMk (continuous_prefixEndpoint D) + +theorem measurable_prefixPair (D : ℕ) : Measurable (prefixPair D) := + Sampling.endpointMap_measurable (Finset.range D) + +theorem tendsto_prefixEndpoint (x y : Base) : + Tendsto (fun D => prefixEndpoint D x y) atTop (𝓝 y) := by + apply tendsto_pi_nhds.mpr + intro i + apply tendsto_const_nhds.congr' + filter_upwards [eventually_gt_atTop i] with D hD + simp [prefixEndpoint_apply, hD] + +theorem tendsto_prefixPair (xy : EndpointPair) : + Tendsto (fun D => prefixPair D xy) atTop (𝓝 xy) := + tendsto_const_nhds.prodMk_nhds (tendsto_prefixEndpoint xy.1 xy.2) + +theorem prefixPairLaw_first_marginal (ν : Measure EndpointPair) (D : ℕ) : + (prefixPairLaw ν D).map Prod.fst = ν.map Prod.fst := by + rw [prefixPairLaw, Measure.map_map measurable_fst (measurable_prefixPair D)] + rfl + +theorem prefixPairLaw_second_marginal (ν : Measure EndpointPair) (D : ℕ) : + (prefixPairLaw ν D).map Prod.snd = + ν.map (fun xy => prefixEndpoint D xy.1 xy.2) := by + rw [prefixPairLaw, Measure.map_map measurable_snd (measurable_prefixPair D)] + rfl + +instance prefixPairLaw_finite (ν : Measure EndpointPair) [IsFiniteMeasure ν] (D : ℕ) : + IsFiniteMeasure (prefixPairLaw ν D) := by + unfold prefixPairLaw + infer_instance + +theorem prefixPairLaw_weaklyConverges (ν : Measure EndpointPair) [IsFiniteMeasure ν] : + WeaklyConverges (prefixPairLaw ν) ν := by + intro φ + have hmap (D : ℕ) : + (∫ xy, φ xy ∂prefixPairLaw ν D) = ∫ xy, φ (prefixPair D xy) ∂ν := by + exact integral_map (measurable_prefixPair D).aemeasurable + φ.continuous.aestronglyMeasurable + simp_rw [hmap] + apply tendsto_integral_of_dominated_convergence (fun _ => ‖φ‖) + · intro D + exact (φ.continuous.comp (continuous_prefixPair D)).aestronglyMeasurable + · exact integrable_const _ + · intro D + exact Filter.Eventually.of_forall (fun xy => φ.norm_coe_le_norm (prefixPair D xy)) + · exact Filter.Eventually.of_forall (fun xy => + φ.continuous.continuousAt.tendsto.comp (tendsto_prefixPair xy)) + +theorem ordered_selectedEndpoint {x y : Base} (hxy : Ordered x y) (I : Finset ℕ) : + Ordered x (selectedEndpoint I x y) ∧ Ordered (selectedEndpoint I x y) y := by + constructor <;> intro i <;> by_cases hi : i ∈ I + · simpa only [selectedEndpoint, ite_eq_left hi] using hxy i + · simp only [selectedEndpoint, ite_eq_right hi, le_refl] + · simp only [selectedEndpoint, ite_eq_left hi, le_refl] + · simpa only [selectedEndpoint, ite_eq_right hi] using hxy i + +theorem prefixPairLaw_ordered (ν : Measure EndpointPair) + (hν : ∀ᵐ xy ∂ν, Ordered xy.1 xy.2) (D : ℕ) : + ∀ᵐ xy ∂prefixPairLaw ν D, Ordered xy.1 xy.2 := by + rw [prefixPairLaw, ae_map_iff (measurable_prefixPair D).aemeasurable + Sampling.ordered_measurable] + filter_upwards [hν] with xy hxy + exact (ordered_selectedEndpoint hxy (Finset.range D)).1 + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/PrefixPairIdentity.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/PrefixPairIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..43e0094e5887a1c35878d00409b9a3c22f2771aa --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/PrefixPairIdentity.lean @@ -0,0 +1,41 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductPairIdentity +import OAI.Analysis.IrrationalRotation.Sampling.PrefixCompactTransfer + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators + +namespace Invariant233.ProductModel + +theorem prefix_pairIdentity_of_triangular_domination + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) (ν : FiniteMeasure EndpointPair) + (hfst : (ν : Measure EndpointPair).map Prod.fst ≪ baseMeasure) + (hsnd : (ν : Measure EndpointPair).map Prod.snd ≪ baseMeasure) + (horder : ∀ᵐ xy ∂(ν : Measure EndpointPair), Ordered xy.1 xy.2) + (hL2 : HasUniformL2Marginals (prefixPairLaw (ν : Measure EndpointPair))) + (hdom : ∀ D, prefixPairLaw (ν : Measure EndpointPair) D ≪ + ∑ I ∈ (Finset.range D).powerset, triangularLaw I) + (p : Base → Fiber →L[ℂ] Fiber) + (hp : ∀ x, IsStarProjection (p x)) + (hpm : ∀ i : ℤ, Measurable (fun x => p x (lp.single 2 i 1))) + (htri : ∀ I : Finset ℕ, ∀ᵐ xy ∂triangularLaw I, PairIdentity θ c p xy) : + ∀ᵐ xy ∂(ν : Measure EndpointPair), PairIdentity θ c p xy := by + have hz := prefix_operator_relation_of_triangular_domination θ c hθ0 hθ hc ν + hfst hsnd horder hL2 hdom p hp hpm (fun I => ?_) + · filter_upwards [ae_ordered_cocycle_ratio_cap θ c hθ0 hθ hc + (ν : Measure EndpointPair) hfst hsnd horder, hz] with xy hcap hzero + refine ⟨hcap, ?_⟩ + simpa only [ratioDiagonal, cocycleRatio, Invariant233.ratioDiagonal, + mul_assoc, ContinuousLinearMap.mul_def, ContinuousLinearMap.comp_assoc] using hzero + · filter_upwards [htri I] with xy hxy + simpa only [ratioDiagonal, cocycleRatio, Invariant233.ratioDiagonal, + mul_assoc, ContinuousLinearMap.mul_def, ContinuousLinearMap.comp_assoc] using hxy.2 + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductBiasedIdentity.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductBiasedIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..948883c9d30e09a040f8afeeb601569f6a0e4ccc --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductBiasedIdentity.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductPairIdentity +import OAI.Analysis.IrrationalRotation.Couplings.ProductBiasedIdentityFromTriangular + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.OrderedProductCoupling + +theorem exists_covariantProjectionField_all_biased_pairIdentity + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) (hsampling : ProductModel.HasAllFiniteCoordinateSampling θ) + (p : ProductModel.Hilbert →L[ℂ] ProductModel.Hilbert) + (hpM : p ∈ ProductModel.factor θ) (hp : IsStarProjection p) + (hinv : (1 - p) * ProductModel.weightedOperator θ c * p = 0) : + ∃ F : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber, + ProductModel.IsCovariantFieldRepresentation θ p F 1 ∧ + (∀ x, IsStarProjection (F x)) ∧ + ∀ P : Parameters, Summable (energyBound P) → + ∀ᵐ xy ∂circlePairLaw P, ProductModel.PairIdentity θ c F xy := by + obtain ⟨F, hrep, hproj, htri⟩ := + ProductModel.exists_covariantProjectionField_pairIdentity θ c hθ0 hθ hc hsampling + p hpM hp hinv + refine ⟨F, hrep, hproj, ?_⟩ + intro P hsum + exact circlePairLaw_pairIdentity_of_covariantField P hsum θ c hθ0 hθ hc p F hrep hproj htri + +theorem exists_source_covariantProjectionField_biased_pairIdentity + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) (hsampling : ProductModel.HasAllFiniteCoordinateSampling θ) + (p : ProductModel.Hilbert →L[ℂ] ProductModel.Hilbert) + (hpM : p ∈ ProductModel.factor θ) (hp : IsStarProjection p) + (hinv : (1 - p) * ProductModel.weightedOperator θ c * p = 0) + (m : ℕ → ℕ) (a b : ℕ → ℝ) (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) : + ∃ F : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber, + ProductModel.IsCovariantFieldRepresentation θ p F 1 ∧ + (∀ x, IsStarProjection (F x)) ∧ + ∀ tag : ℕ, ∀ᵐ xy ∂circlePairLaw + (ofBlocks m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm ha ha' hb hb' e tag), + ProductModel.PairIdentity θ c F xy := by + obtain ⟨F, hrep, hproj, htri⟩ := + ProductModel.exists_covariantProjectionField_pairIdentity θ c hθ0 hθ hc hsampling + p hpM hp hinv + exact ⟨F, hrep, hproj, source_circlePairLaw_pairIdentity_of_triangular m a b + hm ha ha' hb hb' e θ c hθ0 hθ hc F hproj + (fun i => (hrep.2.2.1 (lp.single 2 i 1)).measurable) htri⟩ + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductBiasedIdentityFromTriangular.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductBiasedIdentityFromTriangular.lean new file mode 100644 index 0000000000000000000000000000000000000000..2fe1bc000a0f66848acab7c05cdd6c407551edc8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductBiasedIdentityFromTriangular.lean @@ -0,0 +1,64 @@ +import OAI.Analysis.IrrationalRotation.Sampling.PrefixReferenceCompletion +import OAI.Analysis.IrrationalRotation.Couplings.ProductBiasedPrefixTransfer +import OAI.Analysis.IrrationalRotation.Couplings.BlockProductCoupling + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators + +namespace Invariant233.OrderedProductCoupling + +theorem circlePairLaw_pairIdentity_of_triangular + (P : Parameters) (hsum : Summable (energyBound P)) + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) + (F : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber) + (hF : ∀ x, IsStarProjection (F x)) + (hFm : ∀ i : ℤ, Measurable (fun x => F x (lp.single 2 i 1))) + (htri : ∀ I : Finset ℕ, ∀ᵐ xy ∂ProductModel.triangularLaw I, + ProductModel.PairIdentity θ c F xy) : + ∀ᵐ xy ∂circlePairLaw P, ProductModel.PairIdentity θ c F xy := + circlePairLaw_pairIdentity_of_triangular_domination P hsum θ c hθ0 hθ hc + (circle_prefix_absolutelyContinuous_triangular_sum P hsum) F hF hFm htri + +theorem circlePairLaw_pairIdentity_of_covariantField + (P : Parameters) (hsum : Summable (energyBound P)) + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) + (A : ProductModel.Hilbert →L[ℂ] ProductModel.Hilbert) + (F : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber) + (hrep : ProductModel.IsCovariantFieldRepresentation θ A F 1) + (hF : ∀ x, IsStarProjection (F x)) + (htri : ∀ I : Finset ℕ, ∀ᵐ xy ∂ProductModel.triangularLaw I, + ProductModel.PairIdentity θ c F xy) : + ∀ᵐ xy ∂circlePairLaw P, ProductModel.PairIdentity θ c F xy := + circlePairLaw_pairIdentity_of_triangular P hsum θ c hθ0 hθ hc F hF + (fun i => (hrep.2.2.1 (lp.single 2 i 1)).measurable) htri + +theorem source_circlePairLaw_pairIdentity_of_triangular + (m : ℕ → ℕ) (a b : ℕ → ℝ) (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) + (F : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber) + (hF : ∀ x, IsStarProjection (F x)) + (hFm : ∀ i : ℤ, Measurable (fun x => F x (lp.single 2 i 1))) + (htri : ∀ I : Finset ℕ, ∀ᵐ xy ∂ProductModel.triangularLaw I, + ProductModel.PairIdentity θ c F xy) : + ∀ tag : ℕ, ∀ᵐ xy ∂circlePairLaw + (ofBlocks m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm ha ha' hb hb' e tag), + ProductModel.PairIdentity θ c F xy := by + intro tag + exact circlePairLaw_pairIdentity_of_triangular _ + (ofBlocks_energy_sum m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm + ha ha' hb hb' e tag summable_sourceKappa_sq).1 θ c hθ0 hθ hc F hF hFm htri + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductBiasedPrefixTransfer.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductBiasedPrefixTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..3141af5a4a4f699b958e0983b06fc6bcd52803fb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductBiasedPrefixTransfer.lean @@ -0,0 +1,34 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductCouplingPrefix +import OAI.Analysis.IrrationalRotation.Couplings.PrefixPairIdentity + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators + +namespace Invariant233.OrderedProductCoupling + +theorem circlePairLaw_pairIdentity_of_triangular_domination + (P : Parameters) (hsum : Summable (energyBound P)) + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) + (hdom : ∀ D, ProductModel.prefixPairLaw (circlePairLaw P) D ≪ + ∑ I ∈ (Finset.range D).powerset, ProductModel.triangularLaw I) + (p : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber) + (hp : ∀ x, IsStarProjection (p x)) + (hpm : ∀ i : ℤ, Measurable (fun x => p x (lp.single 2 i 1))) + (htri : ∀ I : Finset ℕ, ∀ᵐ xy ∂ProductModel.triangularLaw I, + ProductModel.PairIdentity θ c p xy) : + ∀ᵐ xy ∂circlePairLaw P, ProductModel.PairIdentity θ c p xy := by + let ν : FiniteMeasure ProductModel.EndpointPair := ⟨circlePairLaw P, inferInstance⟩ + obtain ⟨hfst, hsnd⟩ := circlePairLaw_marginals_ac_of_energy P hsum + exact ProductModel.prefix_pairIdentity_of_triangular_domination θ c hθ0 hθ hc ν + hfst hsnd (circlePairLaw_ordered P) + (circlePairLaw_prefix_hasUniformL2Marginals P hsum) hdom p hp hpm htri + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCircleConditionalEvents.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCircleConditionalEvents.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d8d45d29b25e0bc0ce5687c6aa5827342bd37e0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCircleConditionalEvents.lean @@ -0,0 +1,45 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalEvents +import OAI.Analysis.IrrationalRotation.Product.ProductCircleConditioning + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory + +namespace Invariant233.OrderedProductCoupling + +theorem finite_threshold_attenuation_circle (P : Parameters) (I : Finset ℕ) + (u w : ℕ → ℝ) + (hwidth : ∀ i ∈ I, w i = P.a i ∨ w i = P.b i) + (hthreshold : ∀ i ∈ I, w i ≤ u i ∧ u i ≤ 1 - w i) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) + (hI : m / 20 ≤ (I.card : ℝ)) + (hrho : ∀ i ∈ I, ρ ≤ CouplingMarginalBounds.rho (P.κ i) (P.m i) (w i)) + (R : Sample → ℝ) (hR : ∀ᵐ ω ∂law P, R ω ≤ 1) + (hcross : ∀ᵐ ω ∂law P, ∀ i ∈ I, + (leftEndpoint ω i < u i ∧ u i ≤ rightEndpoint ω i) → R ω ≤ Real.exp (-L)) : + ∃ H₁ H₂ : Set Sample, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂law P, ((law P)[H₁.indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleLeftEndpoint inferInstance]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂law P, ((law P)[H₂.indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleRightEndpoint inferInstance]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂law P, R ω ≤ Real.exp (-L) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + obtain ⟨H₁, H₂, hH₁, hH₂, hleft, hright, hratio⟩ := + finite_threshold_attenuation P I u w hwidth hthreshold m ρ L hρ hL hI hrho + R hR hcross + refine ⟨H₁, H₂, hH₁, hH₂, ?_, ?_, hratio⟩ + · filter_upwards [hleft, left_condExp_eq_circle P (H₁.indicator (fun _ => (1 : ℝ)))] + with ω hω heq + rw [← heq] + exact hω + · filter_upwards [hright, right_condExp_eq_circle P (H₂.indicator (fun _ => (1 : ℝ)))] + with ω hω heq + rw [← heq] + exact hω + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCircleCrossingConditionalExpectation.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCircleCrossingConditionalExpectation.lean new file mode 100644 index 0000000000000000000000000000000000000000..b914592d39afa553d1bda833cdfb1e8f8666dbbb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCircleCrossingConditionalExpectation.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductCrossingConditionalExpectation +import OAI.Analysis.IrrationalRotation.Product.ProductCircleConditioning + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory + +namespace Invariant233.OrderedProductCoupling +open CouplingMarginalBounds + +theorem crossing_event_ae_eq_circle (P : Parameters) (u : ℕ → ℝ) (i : ℕ) : + {ω : Sample | leftEndpoint ω i < u i ∧ u i ≤ rightEndpoint ω i} =ᵐ[law P] + {ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u i ∧ + u i ≤ realEndpoint (circleRightEndpoint ω) i} := by + filter_upwards [ae_real_circle_endpoints P] with ω hω + rw [hω.1, hω.2] + +theorem right_crossing_condExp_eq_circle (P : Parameters) (u : ℕ → ℝ) (i : ℕ) : + (law P)[{ω : Sample | leftEndpoint ω i < u i ∧ u i ≤ rightEndpoint ω i}.indicator + (fun _ => (1 : ℝ)) | (inferInstance : MeasurableSpace Endpoint).comap leftEndpoint] + =ᵐ[law P] + (law P)[{ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u i ∧ + u i ≤ realEndpoint (circleRightEndpoint ω) i}.indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace ProductModel.Base).comap circleLeftEndpoint] := by + exact (left_condExp_eq_circle P _).trans + (condExp_congr_ae (indicator_ae_eq_of_ae_eq_set (crossing_event_ae_eq_circle P u i))) + +theorem left_crossing_condExp_eq_circle (P : Parameters) (u : ℕ → ℝ) (i : ℕ) : + (law P)[{ω : Sample | leftEndpoint ω i < u i ∧ u i ≤ rightEndpoint ω i}.indicator + (fun _ => (1 : ℝ)) | (inferInstance : MeasurableSpace Endpoint).comap rightEndpoint] + =ᵐ[law P] + (law P)[{ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u i ∧ + u i ≤ realEndpoint (circleRightEndpoint ω) i}.indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace ProductModel.Base).comap circleRightEndpoint] := by + exact (right_condExp_eq_circle P _).trans + (condExp_congr_ae (indicator_ae_eq_of_ae_eq_set (crossing_event_ae_eq_circle P u i))) + +theorem circle_crossing_condExp_lower_countable {K : Type*} [Countable K] + (P : Parameters) (u : K → ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (k : K) (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u k i → u k i ≤ 1 - w → + (realEndpoint (circleLeftEndpoint ω) i < u k i → + rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u k i ∧ + u k i ≤ realEndpoint (circleRightEndpoint ω) i}.indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace ProductModel.Base).comap circleLeftEndpoint]) ω) ∧ + (u k i ≤ realEndpoint (circleRightEndpoint ω) i → + rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u k i ∧ + u k i ≤ realEndpoint (circleRightEndpoint ω) i}.indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace ProductModel.Base).comap circleRightEndpoint]) ω) := by + have hr := ae_all_iff.mpr (fun k => + ae_all_iff.mpr (right_crossing_condExp_eq_circle P (u k))) + have hl := ae_all_iff.mpr (fun k => + ae_all_iff.mpr (left_crossing_condExp_eq_circle P (u k))) + filter_upwards [crossing_condExp_lower_countable P u, ae_real_circle_endpoints P, + hr, hl] with ω hraw hrep hright hleft + intro k i w hw hwu huw + constructor + · intro hxu + rw [← hright k i] + apply (hraw k i w hw hwu huw).1 + simpa only [hrep.1] using hxu + · intro huy + rw [← hleft k i] + apply (hraw k i w hw hwu huw).2 + simpa only [hrep.2] using huy + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..93a620210c420502e1979d8a3e40ac3a4e158023 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalAttenuation.lean @@ -0,0 +1,139 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductCocycle +import OAI.Analysis.IrrationalRotation.Couplings.FiniteConditionalAttenuation +import OAI.Analysis.IrrationalRotation.Analysis.TaggedThresholdCrossing + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Function Set +open scoped BigOperators + +namespace Invariant233.ProductCocycle + +theorem cocycleVersion_ratio_le_exp_of_crossing {ι : Type*} + (θ c : ι → ℝ) (k : ℤ) (x y : Space ι) (i : ι) + (hc : ∀ j, 0 ≤ c j) + (horder : ∀ j, representative (x j) ≤ representative (y j)) + (hx : HasFiniteSupport (fun j => ⌊representative (x j) + (k : ℝ) * θ j⌋)) + (hy : HasFiniteSupport (fun j => ⌊representative (y j) + (k : ℝ) * θ j⌋)) + (hcross : representative (x i) < 1 - Int.fract ((k : ℝ) * θ i) ∧ + 1 - Int.fract ((k : ℝ) * θ i) ≤ representative (y i)) : + cocycleVersion θ c k y / cocycleVersion θ c k x ≤ Real.exp (-c i) := by + classical + have h := FiniteSupportCocycle.exp_tsum_floor_ratio_le_finite_crossings + (fun j => representative (x j)) (fun j => representative (y j)) + (fun j => (k : ℝ) * θ j) c {i} + (fun j => representative_mem_Ico (x j)) (fun j => representative_mem_Ico (y j)) + hc horder hx hy (by simpa using hcross) + simpa only [cocycleVersion, Finset.sum_singleton] using h + +theorem ae_all_int_finite_floor_support_of_map_ac + {ι Ω : Type*} [Countable ι] [MeasurableSpace Ω] + (μ : Measure Ω) (θ : ι → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (x : Ω → Space ι) (hx : AEMeasurable x μ) (hac : μ.map x ≪ haar ι) : + ∀ᵐ ω ∂μ, ∀ k : ℤ, + HasFiniteSupport (fun i => ⌊representative (x ω i) + (k : ℝ) * θ i⌋) := by + apply ae_of_ae_map hx (p := fun z : Space ι => ∀ k : ℤ, + HasFiniteSupport (fun i => ⌊representative (z i) + (k : ℝ) * θ i⌋)) + apply hac.ae_le + exact CocycleSupport.ae_product_all_int_finite_floor_support θ hθ0 hθ + +theorem ae_all_int_ratio_bounds_of_map_ac + {ι Ω : Type*} [Countable ι] [MeasurableSpace Ω] + (μ : Measure Ω) (θ c : ι → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) + (hθ : Summable θ) (hc : ∀ i, 0 ≤ c i) + (x y : Ω → Space ι) (hx : AEMeasurable x μ) (hy : AEMeasurable y μ) + (hacx : μ.map x ≪ haar ι) (hacy : μ.map y ≪ haar ι) + (horder : ∀ᵐ ω ∂μ, ∀ i, representative (x ω i) ≤ representative (y ω i)) : + ∀ᵐ ω ∂μ, ∀ k : ℤ, + cocycleVersion θ c k (y ω) / cocycleVersion θ c k (x ω) ≤ 1 ∧ + ∀ i, (representative (x ω i) < 1 - Int.fract ((k : ℝ) * θ i) ∧ + 1 - Int.fract ((k : ℝ) * θ i) ≤ representative (y ω i)) → + cocycleVersion θ c k (y ω) / cocycleVersion θ c k (x ω) ≤ Real.exp (-c i) := by + filter_upwards [ae_all_int_finite_floor_support_of_map_ac μ θ hθ0 hθ x hx hacx, + ae_all_int_finite_floor_support_of_map_ac μ θ hθ0 hθ y hy hacy, horder] + with ω hxs hys hord + intro k + exact ⟨cocycleVersion_ratio_le_one θ c k (x ω) (y ω) hc hord (hxs k) (hys k), + fun i hi => cocycleVersion_ratio_le_exp_of_crossing θ c k (x ω) (y ω) i + hc hord (hxs k) (hys k) hi⟩ + +theorem finite_conditional_attenuation_of_map_ac + {ι Ω : Type*} [Countable ι] + (mx my : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω] + (hmx : mx ≤ mΩ) (hmy : my ≤ mΩ) (μ : Measure Ω) [IsFiniteMeasure μ] + (θ c : ι → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) (k : ℤ) (I : Finset ι) + (x y : Ω → Space ι) (hx : Measurable[mx] x) (hy : Measurable[my] y) + (hacx : μ.map x ≪ haar ι) (hacy : μ.map y ≪ haar ι) + (top bottom : ι → Set Ω) + (htop : ∀ i, MeasurableSet (top i)) (hbottom : ∀ i, MeasurableSet (bottom i)) + (hindTop : iCondIndepSet mx hmx top μ) (hindBottom : iCondIndepSet my hmy bottom μ) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) + (hI : m / 20 ≤ (I.card : ℝ)) (hcost : ∀ i ∈ I, L ≤ c i) + (horder : ∀ᵐ ω ∂μ, ∀ i, representative (x ω i) ≤ representative (y ω i)) + (hforceTop : ∀ᵐ ω ∂μ, ∀ i ∈ I, + representative (x ω i) < 1 - Int.fract ((k : ℝ) * θ i) → + ω ∈ top i → 1 - Int.fract ((k : ℝ) * θ i) ≤ representative (y ω i)) + (hforceBottom : ∀ᵐ ω ∂μ, ∀ i ∈ I, + 1 - Int.fract ((k : ℝ) * θ i) ≤ representative (y ω i) → + ω ∈ bottom i → representative (x ω i) < 1 - Int.fract ((k : ℝ) * θ i)) + (hprobTop : ∀ᵐ ω ∂μ, ∀ i ∈ I, + representative (x ω i) < 1 - Int.fract ((k : ℝ) * θ i) → + ρ / 10 ≤ (μ[(top i).indicator (fun _ => (1 : ℝ)) | mx]) ω) + (hprobBottom : ∀ᵐ ω ∂μ, ∀ i ∈ I, + 1 - Int.fract ((k : ℝ) * θ i) ≤ representative (y ω i) → + ρ / 10 ≤ (μ[(bottom i).indicator (fun _ => (1 : ℝ)) | my]) ω) : + ∃ H₁ H₂ : Set Ω, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂μ, (μ[H₁.indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂μ, (μ[H₂.indicator (fun _ => (1 : ℝ)) | my]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂μ, cocycleVersion θ c k (y ω) / cocycleVersion θ c k (x ω) ≤ + Real.exp (-L) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + have hxrep : Measurable[mx] (fun ω i => representative (x ω i)) := by + let : MeasurableSpace Ω := mx + exact Measurable.of_eval (fun i => measurable_representative.comp ((measurable_pi_apply i).comp hx)) + have hyrep : Measurable[my] (fun ω i => representative (y ω i)) := by + let : MeasurableSpace Ω := my + exact Measurable.of_eval (fun i => measurable_representative.comp ((measurable_pi_apply i).comp hy)) + have hr := ae_all_int_ratio_bounds_of_map_ac μ θ c hθ0 hθ hc x y + (hx.mono hmx le_rfl).aemeasurable (hy.mono hmy le_rfl).aemeasurable hacx hacy horder + apply CrossingAvoidance.finite_conditional_attenuation mx my hmx hmy μ I + (fun i => 1 - Int.fract ((k : ℝ) * θ i)) + (fun ω i => representative (x ω i)) (fun ω i => representative (y ω i)) + hxrep hyrep top bottom htop hbottom hindTop hindBottom m ρ L hρ hL hI + (horder.mono (fun _ h i _ => h i)) hforceTop hforceBottom hprobTop hprobBottom + (fun ω => cocycleVersion θ c k (y ω) / cocycleVersion θ c k (x ω)) + (hr.mono (fun _ h => (h k).1)) + filter_upwards [hr] with ω hω + intro i hi hcross + exact ((hω k).2 i hcross).trans (Real.exp_le_exp.mpr (neg_le_neg (hcost i hi))) + +theorem ae_tagged_ratio_le_exp_of_map_ac + {ι Ω : Type*} [Countable ι] [MeasurableSpace Ω] + (μ : Measure Ω) (θ c : ι → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) + (hθ : Summable θ) (hc : ∀ i, 0 ≤ c i) + (x y : Ω → Space ι) (hx : AEMeasurable x μ) (hy : AEMeasurable y μ) + (hacx : μ.map x ≪ haar ι) (hacy : μ.map y ≪ haar ι) + (horder : ∀ᵐ ω ∂μ, ∀ i, representative (x ω i) ≤ representative (y ω i)) + (m K L : ℝ) (hm : 2 ≤ m) (hK : 0 < K) (k : ℤ) + (hklo : K < |(k : ℝ)|) (hkhi : |(k : ℝ)| ≤ m * K / 4) + (I : Finset ι) (hlo : ∀ i ∈ I, 1 / (m * K) < θ i) + (hhi : ∀ i ∈ I, θ i < 2 / (m * K)) (hcost : ∀ i ∈ I, L ≤ c i) + (E : Set Ω) (htag : ∀ᵐ ω ∂μ, ω ∈ E → ∃ i ∈ I, + representative (x ω i) < 1 / m ∧ 1 - 1 / m < representative (y ω i)) : + ∀ᵐ ω ∂μ, ω ∈ E → + cocycleVersion θ c k (y ω) / cocycleVersion θ c k (x ω) ≤ Real.exp (-L) := by + filter_upwards [ae_all_int_ratio_bounds_of_map_ac μ θ c hθ0 hθ hc x y + hx hy hacx hacy horder, htag] with ω hr ht + intro hE + obtain ⟨i, hi, hxi, hyi⟩ := ht hE + have hcross := FloorCocycle.tagged_crossing_of_window k hm hK + (hlo i hi) (hhi i hi) hklo hkhi hxi hyi + exact ((hr k).2 i hcross).trans (Real.exp_le_exp.mpr (neg_le_neg (hcost i hi))) + +end Invariant233.ProductCocycle + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalCrossing.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalCrossing.lean new file mode 100644 index 0000000000000000000000000000000000000000..ba0d75ba2f8d82138c4d65f0f15a9ff87ebfaa31 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalCrossing.lean @@ -0,0 +1,72 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalKernels +import OAI.Analysis.IrrationalRotation.Product.OneCoordinateCrossing + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal +namespace Invariant233.OrderedProductCoupling +open OneCoordinateCoupling CouplingMarginalBounds + +theorem right_condDistrib_crossing_lower (P : Parameters) : + ∀ᵐ x ∂(law P).map leftEndpoint, ∀ (i : ℕ) (w u : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u → u ≤ 1 - w → x i < u → + ENNReal.ofReal (rho (P.κ i) (P.m i) w) / 10 ≤ + condDistrib rightEndpoint leftEndpoint (law P) x + {y : Endpoint | x i < u ∧ u ≤ y i} := by + filter_upwards [right_condDistrib_coordinate_law P, ae_leftEndpoint_mem_unit P] + with x hx hxunit i w u hw _hu0 hu1 hxu + have hevent : {y : Endpoint | x i < u ∧ u ≤ y i} = + (fun y : Endpoint => y i) ⁻¹' Ici u := by + ext y + simp [hxu] + rw [hevent, ← Measure.map_apply (measurable_pi_apply i) measurableSet_Ici, hx i] + exact rightGivenLeft_crossing_lower (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) hw (hxunit i).1 hxu hu1 + +theorem left_condDistrib_crossing_lower (P : Parameters) : + ∀ᵐ y ∂(law P).map rightEndpoint, ∀ (i : ℕ) (w u : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u → u ≤ 1 - w → u ≤ y i → + ENNReal.ofReal (rho (P.κ i) (P.m i) w) / 10 ≤ + condDistrib leftEndpoint rightEndpoint (law P) y + {x : Endpoint | x i < u ∧ u ≤ y i} := by + filter_upwards [left_condDistrib_coordinate_law P, ae_rightEndpoint_mem_unit P] + with y hy hyunit i w u hw hu0 _hu1 huy + have hevent : {x : Endpoint | x i < u ∧ u ≤ y i} = + (fun x : Endpoint => x i) ⁻¹' Iio u := by + ext x + simp [huy] + rw [hevent, ← Measure.map_apply (measurable_pi_apply i) measurableSet_Iio, hy i] + exact leftGivenRight_crossing_lower (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) hw (hyunit i).2 huy hu0 + +theorem right_condDistrib_crossing_real_lower (P : Parameters) : + ∀ᵐ x ∂(law P).map leftEndpoint, ∀ (i : ℕ) (w u : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u → u ≤ 1 - w → x i < u → + rho (P.κ i) (P.m i) w / 10 ≤ + (condDistrib rightEndpoint leftEndpoint (law P) x).real + {y : Endpoint | x i < u ∧ u ≤ y i} := by + filter_upwards [right_condDistrib_crossing_lower P] with x hx i w u hw hu0 hu1 hxu + have h := ENNReal.toReal_mono (measure_ne_top _ _) (hx i w u hw hu0 hu1 hxu) + simpa only [ENNReal.toReal_div, ENNReal.toReal_ofReal (rho_nonneg (P.κ_nonneg i)), + ENNReal.toReal_ofNat, measureReal_def] using h + +theorem left_condDistrib_crossing_real_lower (P : Parameters) : + ∀ᵐ y ∂(law P).map rightEndpoint, ∀ (i : ℕ) (w u : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u → u ≤ 1 - w → u ≤ y i → + rho (P.κ i) (P.m i) w / 10 ≤ + (condDistrib leftEndpoint rightEndpoint (law P) y).real + {x : Endpoint | x i < u ∧ u ≤ y i} := by + filter_upwards [left_condDistrib_crossing_lower P] with y hy i w u hw hu0 hu1 huy + have h := ENNReal.toReal_mono (measure_ne_top _ _) (hy i w u hw hu0 hu1 huy) + simpa only [ENNReal.toReal_div, ENNReal.toReal_ofReal (rho_nonneg (P.κ_nonneg i)), + ENNReal.toReal_ofNat, measureReal_def] using h + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalData.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalData.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca749a810989fbae5b30e98bc96555c3e2e3db85 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalData.lean @@ -0,0 +1,135 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductConvolutionIdentity +import OAI.Analysis.IrrationalRotation.Product.SourceProductTailRealization +import OAI.Analysis.IrrationalRotation.Product.ProductObstructionConstant + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal ComplexConjugate + +namespace Invariant233.ProductModel +open OrderedProductCoupling +open InvariantProjection.ConditionalConvolution + +abbrev sourceUnitVector : Fiber := lp.single 2 (0 : ℤ) (1 : ℂ) + +def sourceLeftVector (F : Base → Fiber →L[ℂ] Fiber) (ω : Sample) : Fiber := + F (circleLeftEndpoint ω) sourceUnitVector + +def sourceRightVector (F : Base → Fiber →L[ℂ] Fiber) (ω : Sample) : Fiber := + (1 - F (circleRightEndpoint ω)) sourceUnitVector + +def sourceLeftCocycle (θ c : ℕ → ℝ) (ω : Sample) (k : ℤ) : ℝ := + ProductCocycle.cocycleVersion θ c k (circleLeftEndpoint ω) + +def sourceRightCocycle (θ c : ℕ → ℝ) (ω : Sample) (k : ℤ) : ℝ := + ProductCocycle.cocycleVersion θ c k (circleRightEndpoint ω) + +theorem conditionalData_of_sourceTail + {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) (θ : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hθsum : Summable θ) + (P : Parameters) (j : ℕ) + (A : Hilbert →L[ℂ] Hilbert) (F : Base → Fiber →L[ℂ] Fiber) + (hF : IsCovariantFieldRepresentation θ A F 1) + (hproj : ∀ x, IsStarProjection (F x)) + (hinv : (1 - A) * weightedOperator θ (fun i => p.C (e i).1) * A = 0) + (hfst : (circlePairLaw P).map Prod.fst ≪ baseMeasure) + (hsnd : (circlePairLaw P).map Prod.snd ≪ baseMeasure) + (hpair : ∀ᵐ xy ∂circlePairLaw P, PairIdentity θ (fun i => p.C (e i).1) F xy) + (htail : SourceTailEstimate p e θ j P) + (E : Set Sample) (hE : MeasurableSet E) (c : ℝ) (hmass : c ≤ (law P).real E) + (hcoeff : ∀ᵐ ω ∂(law P).restrict E, + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖coeffA (sourceLeftVector F) (sourceLeftCocycle θ (fun i => p.C (e i).1)) ω v‖ ≤ p.coefficientBound j) ∧ + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖coeffB (sourceRightVector F) (sourceRightCocycle θ (fun i => p.C (e i).1)) ω v‖ ≤ p.coefficientBound j) ∧ + 1 / ((j + 1 : ℕ) : ℝ) ≤ + ‖coeffA (sourceLeftVector F) (sourceLeftCocycle θ (fun i => p.C (e i).1)) ω 0‖ ∧ + 1 / ((j + 1 : ℕ) : ℝ) ≤ + ‖coeffB (sourceRightVector F) (sourceRightCocycle θ (fun i => p.C (e i).1)) ω 0‖) + (htag : ∀ᵐ ω ∂(law P).restrict E, + ∃ i ∈ ProductPhases.consecutiveBlock p.m j, + circleRepresentative (circleLeftEndpoint ω i) < 1 / (p.m j : ℝ) ∧ + 1 - 1 / (p.m j : ℝ) ≤ circleRepresentative (circleRightEndpoint ω i)) : + Nonempty (Data Sample (law P) (p.K j) (p.coefficientBound j) + (1 / ((j + 1 : ℕ) : ℝ)) c (Real.exp (-p.L j)) (Real.exp (-p.L j / 400))) := by + let costs : ℕ → ℝ := fun i => p.C (e i).1 + have hc : ∀ i, 0 ≤ costs i := fun i => (hp.C_pos (e i).1).le + have hxy : Measurable (fun ω : Sample => (circleLeftEndpoint ω, circleRightEndpoint ω)) := + circleLeftEndpoint_measurable.prodMk circleRightEndpoint_measurable + have hz := ae_of_ae_map hxy.aemeasurable + (ae_coefficients_absolute_and_zero θ costs hθ0 hc hθsum A F hproj hF.2.2.2.1 + hinv (circlePairLaw P) hsnd hpair sourceUnitVector sourceUnitVector) + have hr := ae_of_ae_map hxy.aemeasurable + (ae_convolution_two_ratio_bounds θ costs hθ0 hc hθsum F (circlePairLaw P) hfst hsnd hpair) + obtain ⟨H₁, H₂, hm₁, hm₂, ht⟩ := htail + have hv : ‖sourceUnitVector‖ = 1 := by simp [sourceUnitVector] + refine ⟨{ + mX := MeasurableSpace.comap circleLeftEndpoint inferInstance + mY := MeasurableSpace.comap circleRightEndpoint inferInstance + mX_le := circleLeftEndpoint_measurable.comap_le + mY_le := circleRightEndpoint_measurable.comap_le + ξ := sourceLeftVector F + γ := sourceRightVector F + ξ_measurable := ?_ + γ_measurable := ?_ + ξ_unit := ?_ + γ_unit := ?_ + Fx := sourceLeftCocycle θ costs + Fy := sourceRightCocycle θ costs + Fx_measurable := fun k => (ProductCocycle.measurable_cocycleVersion θ costs k).comp circleLeftEndpoint_measurable + Fy_measurable := fun k => (ProductCocycle.measurable_cocycleVersion θ costs k).comp circleRightEndpoint_measurable + Fx_pos := Filter.Eventually.of_forall (fun ω k => ProductCocycle.cocycleVersion_pos θ costs k _) + Fy_pos := Filter.Eventually.of_forall (fun ω k => ProductCocycle.cocycleVersion_pos θ costs k _) + Fx_zero := Filter.Eventually.of_forall (fun ω => ProductCocycle.cocycleVersion_zero θ costs _) + Fy_zero := Filter.Eventually.of_forall (fun ω => ProductCocycle.cocycleVersion_zero θ costs _) + zero_convolution := ?_ + ratio_bounds := ?_ + E := E + E_measurable := hE + E_mass := hmass + coefficient_bounds := hcoeff + H₁ := H₁ + H₂ := H₂ + H₁_measurable := hm₁ + H₂_measurable := hm₂ + attenuation := ?_ + conditional₁ := ?_ + conditional₂ := ?_ }⟩ + · exact (hF.2.2.1 sourceUnitVector).comp_measurable (Measurable.of_comap_le le_rfl) + · have hs : StronglyMeasurable (fun x : Base => (1 - F x) sourceUnitVector) := by + convert ((stronglyMeasurable_const : StronglyMeasurable (fun _ : Base => sourceUnitVector)).sub (hF.2.2.1 sourceUnitVector)) using 1 + funext x + simp only [sub_apply, one_apply_eq_self, Pi.sub_apply] + exact hs.comp_measurable (Measurable.of_comap_le le_rfl) + · exact Filter.Eventually.of_forall (fun ω => by + have h := (F (circleLeftEndpoint ω)).le_of_opNorm_le + (IsStarProjection.norm_le _ (hproj _)) sourceUnitVector + simpa [sourceLeftVector, hv] using h) + · exact Filter.Eventually.of_forall (fun ω => by + have h := (1 - F (circleRightEndpoint ω)).le_of_opNorm_le + (IsStarProjection.norm_le _ (hproj _).one_sub) sourceUnitVector + simpa [sourceRightVector, hv] using h) + · intro n _ + filter_upwards [hz] with ω hω + exact (hω n).2 + · intro n _ + filter_upwards [hr] with ω hω v + exact hω n v + · filter_upwards [ae_restrict_of_ae ht, htag] with ω hω htagω k hk + have hk' : (p.K j : ℝ) < |(k : ℝ)| := by exact_mod_cast hk + exact (hω k hk').2.2 htagω + · intro k hk + filter_upwards [ht] with ω hω + exact (hω k (by exact_mod_cast hk)).1 + · intro k hk + filter_upwards [ht] with ω hω + exact (hω k (by exact_mod_cast hk)).2.1 + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalEvents.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalEvents.lean new file mode 100644 index 0000000000000000000000000000000000000000..b920b00733acb71d6152f1001244259d2fbc2bc7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalEvents.lean @@ -0,0 +1,130 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ConditionalEventBridge +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalCrossing +import OAI.Analysis.IrrationalRotation.Couplings.FiniteConditionalAttenuation + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped BigOperators + +namespace Invariant233.OrderedProductCoupling + +theorem right_thresholds_iCondIndepSet (P : Parameters) (u : ℕ → ℝ) : + iCondIndepSet (MeasurableSpace.comap leftEndpoint inferInstance) + leftEndpoint_measurable.comap_le + (fun i => {ω : Sample | u i ≤ rightEndpoint ω i}) (law P) := by + apply ConditionalEventBridge.iCondIndepSet_preimage_of_condDistrib + (law P) leftEndpoint rightEndpoint leftEndpoint_measurable rightEndpoint_measurable + (fun i => {y : Endpoint | u i ≤ y i}) + (fun i => measurableSet_le measurable_const (measurable_pi_apply i)) + filter_upwards [right_coordinates_conditionally_independent P] with x hx + apply (iIndepSet_iff_meas_biInter + (fun i => measurableSet_le measurable_const (measurable_pi_apply i))).2 + intro S + exact hx.meas_biInter (fun i _ => + ⟨Ici (u i), measurableSet_Ici, rfl⟩) + +theorem left_thresholds_iCondIndepSet (P : Parameters) (u : ℕ → ℝ) : + iCondIndepSet (MeasurableSpace.comap rightEndpoint inferInstance) + rightEndpoint_measurable.comap_le + (fun i => {ω : Sample | leftEndpoint ω i < u i}) (law P) := by + apply ConditionalEventBridge.iCondIndepSet_preimage_of_condDistrib + (law P) rightEndpoint leftEndpoint rightEndpoint_measurable leftEndpoint_measurable + (fun i => {x : Endpoint | x i < u i}) + (fun i => measurableSet_lt (measurable_pi_apply i) measurable_const) + filter_upwards [left_coordinates_conditionally_independent P] with y hy + apply (iIndepSet_iff_meas_biInter + (fun i => measurableSet_lt (measurable_pi_apply i) measurable_const)).2 + intro S + exact hy.meas_biInter (fun i _ => + ⟨Iio (u i), measurableSet_Iio, rfl⟩) + +theorem right_threshold_condExp_lower (P : Parameters) (u : ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u i → u i ≤ 1 - w → + leftEndpoint ω i < u i → + CouplingMarginalBounds.rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | u i ≤ rightEndpoint ω i}.indicator + (fun _ => (1 : ℝ)) | MeasurableSpace.comap leftEndpoint inferInstance]) ω := by + have heq : ∀ᵐ ω ∂law P, ∀ i, + (condDistrib rightEndpoint leftEndpoint (law P) (leftEndpoint ω)).real + {y : Endpoint | u i ≤ y i} = + ((law P)[{ω : Sample | u i ≤ rightEndpoint ω i}.indicator + (fun _ => (1 : ℝ)) | MeasurableSpace.comap leftEndpoint inferInstance]) ω := + ae_all_iff.mpr (fun i => condDistrib_ae_eq_condExp + leftEndpoint_measurable rightEndpoint_measurable + (measurableSet_le measurable_const (measurable_pi_apply i))) + have hcross := ae_of_ae_map leftEndpoint_measurable.aemeasurable + (right_condDistrib_crossing_real_lower P) + filter_upwards [heq, hcross] with ω heq hcross i w hw hwu huw hxu + rw [← heq i] + simpa only [hxu, true_and] using hcross i w (u i) hw hwu huw hxu + +theorem left_threshold_condExp_lower (P : Parameters) (u : ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u i → u i ≤ 1 - w → + u i ≤ rightEndpoint ω i → + CouplingMarginalBounds.rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | leftEndpoint ω i < u i}.indicator + (fun _ => (1 : ℝ)) | MeasurableSpace.comap rightEndpoint inferInstance]) ω := by + have heq : ∀ᵐ ω ∂law P, ∀ i, + (condDistrib leftEndpoint rightEndpoint (law P) (rightEndpoint ω)).real + {x : Endpoint | x i < u i} = + ((law P)[{ω : Sample | leftEndpoint ω i < u i}.indicator + (fun _ => (1 : ℝ)) | MeasurableSpace.comap rightEndpoint inferInstance]) ω := + ae_all_iff.mpr (fun i => condDistrib_ae_eq_condExp + rightEndpoint_measurable leftEndpoint_measurable + (measurableSet_lt (measurable_pi_apply i) measurable_const)) + have hcross := ae_of_ae_map rightEndpoint_measurable.aemeasurable + (left_condDistrib_crossing_real_lower P) + filter_upwards [heq, hcross] with ω heq hcross i w hw hwu huw huy + rw [← heq i] + simpa only [huy, and_true] using hcross i w (u i) hw hwu huw huy + +theorem finite_threshold_attenuation (P : Parameters) (I : Finset ℕ) + (u w : ℕ → ℝ) + (hwidth : ∀ i ∈ I, w i = P.a i ∨ w i = P.b i) + (hthreshold : ∀ i ∈ I, w i ≤ u i ∧ u i ≤ 1 - w i) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) + (hI : m / 20 ≤ (I.card : ℝ)) + (hrho : ∀ i ∈ I, ρ ≤ CouplingMarginalBounds.rho (P.κ i) (P.m i) (w i)) + (R : Sample → ℝ) (hR : ∀ᵐ ω ∂law P, R ω ≤ 1) + (hcross : ∀ᵐ ω ∂law P, ∀ i ∈ I, + (leftEndpoint ω i < u i ∧ u i ≤ rightEndpoint ω i) → R ω ≤ Real.exp (-L)) : + ∃ H₁ H₂ : Set Sample, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂law P, ((law P)[H₁.indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap leftEndpoint inferInstance]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂law P, ((law P)[H₂.indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap rightEndpoint inferInstance]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂law P, R ω ≤ Real.exp (-L) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + refine CrossingAvoidance.finite_conditional_attenuation + (MeasurableSpace.comap leftEndpoint inferInstance) + (MeasurableSpace.comap rightEndpoint inferInstance) + leftEndpoint_measurable.comap_le rightEndpoint_measurable.comap_le (law P) + I u leftEndpoint rightEndpoint + (Measurable.of_comap_le le_rfl) (Measurable.of_comap_le le_rfl) + (fun i => {ω : Sample | u i ≤ rightEndpoint ω i}) + (fun i => {ω : Sample | leftEndpoint ω i < u i}) + (fun i => measurableSet_le measurable_const + ((measurable_pi_apply i).comp rightEndpoint_measurable)) + (fun i => measurableSet_lt + ((measurable_pi_apply i).comp leftEndpoint_measurable) measurable_const) + (right_thresholds_iCondIndepSet P u) (left_thresholds_iCondIndepSet P u) + m ρ L hρ hL hI ?_ ?_ ?_ ?_ ?_ R hR hcross + · exact (ae_ordered P).mono (fun _ h i _ => h i) + · exact Filter.Eventually.of_forall (fun _ _ _ _ h => h) + · exact Filter.Eventually.of_forall (fun _ _ _ _ h => h) + · filter_upwards [right_threshold_condExp_lower P u] with ω hω i hi hxi + exact (div_le_div_of_nonneg_right (hrho i hi) (by norm_num)).trans + (hω i (w i) (hwidth i hi) (hthreshold i hi).1 (hthreshold i hi).2 hxi) + · filter_upwards [left_threshold_condExp_lower P u] with ω hω i hi hyi + exact (div_le_div_of_nonneg_right (hrho i hi) (by norm_num)).trans + (hω i (w i) (hwidth i hi) (hthreshold i hi).1 (hthreshold i hi).2 hyi) + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalKernels.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalKernels.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb8d7253141179ef5fb87485e52b1db877885668 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalKernels.lean @@ -0,0 +1,150 @@ +import OAI.Analysis.IrrationalRotation.Product.IndependentKernelProduct +import OAI.Analysis.IrrationalRotation.Couplings.OneCoordinateConditional +import OAI.Analysis.IrrationalRotation.Couplings.ProductCoupling + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +namespace Invariant233.OrderedProductCoupling +open OneCoordinateCoupling KernelProduct + +private lemma coordinate_right_disintegration (P : Parameters) (i : ℕ) : + (coordinateLaw P i).map (fun z => z.2.1) ⊗ₘ + rightGivenLeft (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) = + (coordinateLaw P i).map (fun z => (z.2.1, z.2.2)) := by + have hleft : (coordinateLaw P i).map (fun z => z.2.1) = + (pairLaw (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i)).fst := by + rw [← coordinateLaw_map_pair P i, Measure.fst, + Measure.map_map measurable_fst measurable_snd] + rfl + rw [hleft] + simpa only [Prod.eta] using + (rightGivenLeft_disintegration (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i)).trans (coordinateLaw_map_pair P i).symm + +private lemma coordinate_left_disintegration (P : Parameters) (i : ℕ) : + (coordinateLaw P i).map (fun z => z.2.2) ⊗ₘ + leftGivenRight (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) = + (coordinateLaw P i).map (fun z => (z.2.2, z.2.1)) := by + have hright : (coordinateLaw P i).map (fun z => z.2.2) = + (pairLaw (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i)).snd := by + rw [← coordinateLaw_map_pair P i, Measure.snd, + Measure.map_map measurable_snd measurable_snd] + rfl + rw [hright, leftGivenRight_disintegration (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i), ← coordinateLaw_map_pair P i, + Measure.map_map measurable_swap measurable_snd] + rfl + +theorem right_condDistrib_eq_product (P : Parameters) : + condDistrib rightEndpoint leftEndpoint (law P) + =ᵐ[(law P).map leftEndpoint] fun x => Measure.infinitePi + (fun i => rightGivenLeft (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) (x i)) := by + let (i : ℕ) : IsMarkovKernel + (rightGivenLeft (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i)) := + rightGivenLeft_isMarkov (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) + exact condDistrib_of_coordinate_disintegration (coordinateLaw P) + (fun _ z => z.2.1) (fun _ z => z.2.2) (by fun_prop) (by fun_prop) + (fun i => rightGivenLeft (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i)) + (coordinate_right_disintegration P) + +theorem left_condDistrib_eq_product (P : Parameters) : + condDistrib leftEndpoint rightEndpoint (law P) + =ᵐ[(law P).map rightEndpoint] fun y => Measure.infinitePi + (fun i => leftGivenRight (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) (y i)) := by + let (i : ℕ) : IsMarkovKernel + (leftGivenRight (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i)) := + leftGivenRight_isMarkov (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) + exact condDistrib_of_coordinate_disintegration (coordinateLaw P) + (fun _ z => z.2.2) (fun _ z => z.2.1) (by fun_prop) (by fun_prop) + (fun i => leftGivenRight (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i)) + (coordinate_left_disintegration P) + +theorem right_coordinates_conditionally_independent (P : Parameters) : + ∀ᵐ x ∂(law P).map leftEndpoint, + iIndepFun (fun i (y : Endpoint) => y i) + (condDistrib rightEndpoint leftEndpoint (law P) x) := by + let (i : ℕ) : IsMarkovKernel + (rightGivenLeft (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i)) := + rightGivenLeft_isMarkov (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) + filter_upwards [right_condDistrib_eq_product P] with x hx + rw [hx] + exact iIndepFun_infinitePi (fun _ => measurable_id) + +theorem left_coordinates_conditionally_independent (P : Parameters) : + ∀ᵐ y ∂(law P).map rightEndpoint, + iIndepFun (fun i (x : Endpoint) => x i) + (condDistrib leftEndpoint rightEndpoint (law P) y) := by + let (i : ℕ) : IsMarkovKernel + (leftGivenRight (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i)) := + leftGivenRight_isMarkov (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) + filter_upwards [left_condDistrib_eq_product P] with y hy + rw [hy] + exact iIndepFun_infinitePi (fun _ => measurable_id) + +theorem right_condDistrib_coordinate_law (P : Parameters) : + ∀ᵐ x ∂(law P).map leftEndpoint, ∀ i, + (condDistrib rightEndpoint leftEndpoint (law P) x).map + (fun y : Endpoint => y i) = + rightGivenLeft (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) (x i) := by + let (i : ℕ) : IsMarkovKernel + (rightGivenLeft (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i)) := + rightGivenLeft_isMarkov (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) + filter_upwards [right_condDistrib_eq_product P] with x hx i + rw [hx, Measure.infinitePi_map_eval] + +theorem left_condDistrib_coordinate_law (P : Parameters) : + ∀ᵐ y ∂(law P).map rightEndpoint, ∀ i, + (condDistrib leftEndpoint rightEndpoint (law P) y).map + (fun x : Endpoint => x i) = + leftGivenRight (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) (y i) := by + let (i : ℕ) : IsMarkovKernel + (leftGivenRight (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i)) := + leftGivenRight_isMarkov (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) + filter_upwards [left_condDistrib_eq_product P] with y hy i + rw [hy, Measure.infinitePi_map_eval] + +theorem ae_leftEndpoint_mem_unit (P : Parameters) : + ∀ᵐ x ∂(law P).map leftEndpoint, ∀ i, x i ∈ Set.Ico (0 : ℝ) 1 := by + apply (ae_map_iff leftEndpoint_measurable.aemeasurable (by measurability)).mpr + apply ae_all_iff.mpr + intro i + have hc : ∀ᵐ z ∂coordinateLaw P i, z.2.1 ∈ Set.Ico (0 : ℝ) 1 := by + apply ae_of_ae_map ((measurable_fst.comp measurable_snd).aemeasurable) + simp only [Function.comp_def] + rw [coordinateLaw_map_left P i] + exact (withDensity_absolutelyContinuous _ _).ae_le (CouplingMixture.intervalLaw_ae_mem 0 1) + exact (measurePreserving_eval_infinitePi (coordinateLaw P) i).quasiMeasurePreserving.ae hc + +theorem ae_rightEndpoint_mem_unit (P : Parameters) : + ∀ᵐ y ∂(law P).map rightEndpoint, ∀ i, y i ∈ Set.Ico (0 : ℝ) 1 := by + apply (ae_map_iff rightEndpoint_measurable.aemeasurable (by measurability)).mpr + apply ae_all_iff.mpr + intro i + have hc : ∀ᵐ z ∂coordinateLaw P i, z.2.2 ∈ Set.Ico (0 : ℝ) 1 := by + apply ae_of_ae_map ((measurable_snd.comp measurable_snd).aemeasurable) + simp only [Function.comp_def] + rw [coordinateLaw_map_right P i] + exact (withDensity_absolutelyContinuous _ _).ae_le (CouplingMixture.intervalLaw_ae_mem 0 1) + exact (measurePreserving_eval_infinitePi (coordinateLaw P) i).quasiMeasurePreserving.ae hc + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalThresholds.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalThresholds.lean new file mode 100644 index 0000000000000000000000000000000000000000..0ef3e41f27996dd3a480fc73d0f4f4cbdda9955f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductConditionalThresholds.lean @@ -0,0 +1,84 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalCrossing + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set + +namespace Invariant233.OrderedProductCoupling +open CouplingMarginalBounds + +theorem right_threshold_condExp_lower_all_coordinates (P : Parameters) (u : ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u i → u i ≤ 1 - w → + leftEndpoint ω i < u i → + rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | u i ≤ rightEndpoint ω i}.indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace Endpoint).comap leftEndpoint]) ω := by + apply ae_all_iff.mpr + intro i + have hc := ae_of_ae_map leftEndpoint_measurable.aemeasurable + (right_condDistrib_crossing_real_lower P) + have he := condDistrib_ae_eq_condExp (μ := law P) + leftEndpoint_measurable rightEndpoint_measurable + (s := {y : Endpoint | u i ≤ y i}) + (measurableSet_le measurable_const (measurable_pi_apply i)) + filter_upwards [hc, he] with ω hcross heq + intro w hw hwu huw hxu + have hb := hcross i w (u i) hw hwu huw hxu + have hs : {y : Endpoint | leftEndpoint ω i < u i ∧ u i ≤ y i} = + {y : Endpoint | u i ≤ y i} := by + ext y + simp only [mem_ofPred_eq, hxu, true_and] + rw [hs] at hb + exact heq ▸ hb + +theorem left_threshold_condExp_lower_all_coordinates (P : Parameters) (u : ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u i → u i ≤ 1 - w → + u i ≤ rightEndpoint ω i → + rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | leftEndpoint ω i < u i}.indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace Endpoint).comap rightEndpoint]) ω := by + apply ae_all_iff.mpr + intro i + have hc := ae_of_ae_map rightEndpoint_measurable.aemeasurable + (left_condDistrib_crossing_real_lower P) + have he := condDistrib_ae_eq_condExp (μ := law P) + rightEndpoint_measurable leftEndpoint_measurable + (s := {x : Endpoint | x i < u i}) + (measurableSet_lt (measurable_pi_apply i) measurable_const) + filter_upwards [hc, he] with ω hcross heq + intro w hw hwu huw huy + have hb := hcross i w (u i) hw hwu huw huy + have hs : {x : Endpoint | x i < u i ∧ u i ≤ rightEndpoint ω i} = + {x : Endpoint | x i < u i} := by + ext x + simp only [mem_ofPred_eq, huy, and_true] + rw [hs] at hb + exact heq ▸ hb + +theorem threshold_condExp_lower_countable {K : Type*} [Countable K] + (P : Parameters) (u : K → ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (k : K) (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u k i → u k i ≤ 1 - w → + (leftEndpoint ω i < u k i → + rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | u k i ≤ rightEndpoint ω i}.indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace Endpoint).comap leftEndpoint]) ω) ∧ + (u k i ≤ rightEndpoint ω i → + rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | leftEndpoint ω i < u k i}.indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace Endpoint).comap rightEndpoint]) ω) := by + apply ae_all_iff.mpr + intro k + filter_upwards [right_threshold_condExp_lower_all_coordinates P (u k), + left_threshold_condExp_lower_all_coordinates P (u k)] with ω hright hleft + intro i w hw hwu huw + exact ⟨hright i w hw hwu huw, hleft i w hw hwu huw⟩ + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..3840955743c6bdd8ffde1fa24f0b3d9b615859ef --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCoupling.lean @@ -0,0 +1,144 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductCoupling +import OAI.Analysis.IrrationalRotation.Product.OneCoordinateDensity +import OAI.Analysis.IrrationalRotation.Couplings.ProductDensityLimit + +namespace OAI + +open MeasureTheory ProbabilityTheory Filter +open scoped BigOperators ENNReal + +namespace Invariant233.OrderedProductCoupling + +open OneCoordinateCoupling + +instance coordinateLaw_isProbabilityMeasure (P : Parameters) (i : ℕ) : + IsProbabilityMeasure (coordinateLaw P i) := + labelledLaw_isProbabilityMeasure (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) (P.t_nonneg i) (P.t_le i) + +instance law_isProbabilityMeasure (P : Parameters) : IsProbabilityMeasure (law P) := by + unfold law + infer_instance + +instance baseMeasure_isProbabilityMeasure : IsProbabilityMeasure baseMeasure := by + unfold baseMeasure + infer_instance + +lemma leftEndpoint_measurable : Measurable leftEndpoint := by + unfold leftEndpoint + fun_prop + +lemma rightEndpoint_measurable : Measurable rightEndpoint := by + unfold rightEndpoint + fun_prop + +lemma hybridEndpoint_measurable (ε : ℕ → Bool) : Measurable (hybridEndpoint ε) := by + apply Measurable.of_eval + intro i + unfold hybridEndpoint rightEndpoint leftEndpoint + split_ifs <;> fun_prop + +lemma coordinateLaw_map_pair (P : Parameters) (i : ℕ) : + (coordinateLaw P i).map Prod.snd = pairLaw (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) := + labelledLaw_map_snd _ _ _ _ _ + +lemma coordinateLaw_map_left (P : Parameters) (i : ℕ) : + (coordinateLaw P i).map (fun z => z.2.1) = baseLaw.withDensity + (fun x => ENNReal.ofReal (marginalDensity P false i x)) := by + have h := pairLaw_fst_density (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) (P.t_nonneg i) (P.t_le i) + rw [← coordinateLaw_map_pair P i, Measure.fst, + Measure.map_map measurable_fst measurable_snd] at h + exact h + +lemma coordinateLaw_map_right (P : Parameters) (i : ℕ) : + (coordinateLaw P i).map (fun z => z.2.2) = baseLaw.withDensity + (fun x => ENNReal.ofReal (marginalDensity P true i x)) := by + have h := pairLaw_snd_density (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) (P.t_nonneg i) (P.t_le i) + rw [← coordinateLaw_map_pair P i, Measure.snd, + Measure.map_map measurable_snd measurable_snd] at h + exact h + +lemma hybridEndpoint_map (P : Parameters) (ε : ℕ → Bool) : + (law P).map (hybridEndpoint ε) = Measure.infinitePi (fun i => baseLaw.withDensity + (fun x => ENNReal.ofReal (marginalDensity P (ε i) i x))) := by + let f : ℕ → CoordinateSample → ℝ := + fun i z => if ε i then z.2.2 else z.2.1 + have hf : ∀ i, Measurable (f i) := by + intro i + dsimp [f] + split_ifs <;> fun_prop + calc + _ = Measure.infinitePi (fun i => (coordinateLaw P i).map (f i)) := + Measure.infinitePi_map_pi (coordinateLaw P) hf + _ = _ := by + congr 1 + funext i + cases h : ε i + · simpa only [f, h, Bool.false_eq_true, ite_false] using coordinateLaw_map_left P i + · simpa only [f, h, ite_true] using coordinateLaw_map_right P i + +lemma ae_ordered (P : Parameters) : + ∀ᵐ ω ∂law P, ∀ i, leftEndpoint ω i ≤ rightEndpoint ω i := by + apply ae_all_iff.2 + intro i + have h : ∀ᵐ z ∂coordinateLaw P i, z.2.1 ≤ z.2.2 := + labelledLaw_ae_ordered (by linarith [P.m_ge i]) + exact (measurePreserving_eval_infinitePi (coordinateLaw P) i).quasiMeasurePreserving.ae h + +lemma coordinates_independent (P : Parameters) : + iIndepFun (fun i (ω : Sample) => ω i) (law P) := + iIndepFun_infinitePi (fun _ => measurable_id) + +lemma marginalDensity_memLp (P : Parameters) (side : Bool) (i : ℕ) : + MemLp (marginalDensity P side i) 2 baseLaw := by + cases side + · exact leftMarginalDensity_memLp _ _ _ _ _ + · exact rightMarginalDensity_memLp _ _ _ _ _ + +lemma marginalDensity_nonneg (P : Parameters) (side : Bool) (i : ℕ) (x : ℝ) : + 0 ≤ marginalDensity P side i x := by + cases side + · exact le_trans (by norm_num) (leftMarginalDensity_bounds (P.κ_nonneg i) (P.κ_le i) + (P.m_ge i) (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) x).1 + · exact le_trans (by norm_num) (rightMarginalDensity_bounds (P.κ_nonneg i) (P.κ_le i) + (P.m_ge i) (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) x).1 + +lemma marginalDensity_integral (P : Parameters) (side : Bool) (i : ℕ) : + (∫ x, marginalDensity P side i x ∂baseLaw) = 1 := by + have hm0 : 0 < P.m i := by linarith [P.m_ge i] + have ha0 := CouplingMarginalBounds.width_pos hm0 (P.a_lower i) + have hb0 := CouplingMarginalBounds.width_pos hm0 (P.b_lower i) + cases side + · exact leftMarginalDensity_integral (by linarith [P.m_ge i]) ha0 (P.a_upper i) hb0 (P.b_upper i) + · exact rightMarginalDensity_integral (by linarith [P.m_ge i]) ha0 (P.a_upper i) hb0 (P.b_upper i) + +lemma marginalDensity_variance_le (P : Parameters) (side : Bool) (i : ℕ) : + (∫ x, (marginalDensity P side i x - 1) ^ 2 ∂baseLaw) ≤ energyBound P i := by + have hm0 : 0 < P.m i := by linarith [P.m_ge i] + have ha0 := CouplingMarginalBounds.width_pos hm0 (P.a_lower i) + have hb0 := CouplingMarginalBounds.width_pos hm0 (P.b_lower i) + cases side + · exact leftMarginalDensity_energy (by linarith [P.m_ge i]) ha0 (P.a_upper i) hb0 (P.b_upper i) + (P.t_nonneg i) (P.t_le i) + · exact rightMarginalDensity_energy (by linarith [P.m_ge i]) ha0 (P.a_upper i) hb0 (P.b_upper i) + (P.t_nonneg i) (P.t_le i) + +lemma exists_hybrid_density (P : Parameters) (ε : ℕ → Bool) {C : ℝ} + (hsum : Summable (energyBound P)) (hC : (∑' i, energyBound P i) ≤ C) : + ∃ H : Endpoint → ℝ, MemLp H 2 baseMeasure ∧ (0 ≤ᵐ[baseMeasure] H) ∧ + (∫ x, H x ∂baseMeasure) = 1 ∧ + eLpNorm H 2 baseMeasure ≤ ENNReal.ofReal (Real.exp (C / 2)) ∧ + (law P).map (hybridEndpoint ε) = baseMeasure.withDensity (fun x => ENNReal.ofReal (H x)) := by + obtain ⟨H, hH, hnonneg, hmean, hnorm, hlaw⟩ := + ProductDensity.exists_hybrid_product_density ε + (marginalDensity_memLp P) (marginalDensity_nonneg P) (marginalDensity_integral P) + (marginalDensity_variance_le P) hsum hC + exact ⟨H, hH, hnonneg, hmean, hnorm, (hybridEndpoint_map P ε).trans hlaw.symm⟩ + +end Invariant233.OrderedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCircle.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCircle.lean new file mode 100644 index 0000000000000000000000000000000000000000..5358eca8d36f7904f0a582b939a4b005ae94c8c3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCircle.lean @@ -0,0 +1,189 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductCouplingCircle +import OAI.Analysis.IrrationalRotation.Couplings.ProductCoupling +import OAI.Analysis.IrrationalRotation.Rotation.CircleRepresentative +import OAI.Analysis.IrrationalRotation.Analysis.DensityTransport + +namespace OAI + +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal + +namespace Invariant233.OrderedProductCoupling + +open OneCoordinateCoupling + +lemma baseLaw_eq_restrict : baseLaw = volume.restrict (Ico (0 : ℝ) 1) := by + simp [baseLaw, CouplingMixture.intervalLaw, ProbabilityTheory.cond, Real.volume_Ico] + +lemma circleEndpoint_measurable : Measurable circleEndpoint := by + unfold circleEndpoint + fun_prop + +lemma realEndpoint_measurable : Measurable realEndpoint := by + apply Measurable.of_eval + intro i + exact (CocycleSupport.measurePreserving_circleRepresentative.measurable).comp + (measurable_pi_apply i) + +lemma measurePreserving_circleQuotient : + MeasurePreserving (fun x : ℝ => (x : Circle)) baseLaw circleMeasure := by + rw [baseLaw_eq_restrict] + change MeasurePreserving (fun x : ℝ => (x : UnitAddCircle)) + (volume.restrict (Ico 0 1)) volume + rw [restrict_Ico_eq_restrict_Ioc] + simpa using AddCircle.measurePreserving_mk (1 : ℝ) 0 + +lemma measurePreserving_circleEndpoint : + MeasurePreserving circleEndpoint baseMeasure ProductModel.baseMeasure := by + refine ⟨circleEndpoint_measurable, ?_⟩ + change (Measure.infinitePi (fun _ : ℕ => baseLaw)).map + (fun x i => (x i : Circle)) = Measure.infinitePi (fun _ : ℕ => circleMeasure) + rw [Measure.infinitePi_map_pi (fun _ : ℕ => baseLaw) + (fun _ => measurePreserving_circleQuotient.measurable)] + simp_rw [measurePreserving_circleQuotient.map_eq] + +lemma measurePreserving_realEndpoint : + MeasurePreserving realEndpoint ProductModel.baseMeasure baseMeasure := by + refine ⟨realEndpoint_measurable, ?_⟩ + change (Measure.infinitePi (fun _ : ℕ => circleMeasure)).map + (fun x i => circleRepresentative (x i)) = Measure.infinitePi (fun _ : ℕ => baseLaw) + unfold circleRepresentative + rw [Measure.infinitePi_map_pi (fun _ : ℕ => circleMeasure) + (fun _ => CocycleSupport.measurePreserving_circleRepresentative.measurable)] + congr 1 + funext i + exact CocycleSupport.measurePreserving_circleRepresentative.map_eq.trans + baseLaw_eq_restrict.symm + +lemma circleEndpoint_realEndpoint (x : ProductModel.Base) : + circleEndpoint (realEndpoint x) = x := by + funext i + exact AddCircle.coe_equivIco + +lemma realEndpoint_circleEndpoint_of_mem {x : Endpoint} + (hx : ∀ i, x i ∈ Ico (0 : ℝ) 1) : realEndpoint (circleEndpoint x) = x := by + funext i + exact AddCircle.equivIco_coe_of_mem (by simpa using hx i) + +lemma ae_realEndpoint_circleEndpoint : + ∀ᵐ x ∂baseMeasure, realEndpoint (circleEndpoint x) = x := by + have h : ∀ᵐ x ∂baseMeasure, ∀ i, x i ∈ Ico (0 : ℝ) 1 := by + apply ae_all_iff.2 + intro i + exact (measurePreserving_eval_infinitePi (fun _ : ℕ => baseLaw) i).quasiMeasurePreserving.ae + (CouplingMixture.intervalLaw_ae_mem 0 1) + exact h.mono (fun _ hx => realEndpoint_circleEndpoint_of_mem hx) + +theorem circle_density_transport {g : Endpoint → ℝ} (hg : MemLp g 2 baseMeasure) : + (baseMeasure.withDensity (fun x => ENNReal.ofReal (g x))).map circleEndpoint = + ProductModel.baseMeasure.withDensity + (fun x => ENNReal.ofReal (g (realEndpoint x))) ∧ + eLpNorm (g ∘ realEndpoint) 2 ProductModel.baseMeasure = eLpNorm g 2 baseMeasure := + DensityTransport.real_density_transport_ae circleEndpoint_measurable realEndpoint_measurable + measurePreserving_circleEndpoint.map_eq ae_realEndpoint_circleEndpoint hg.aemeasurable + +lemma circleHybridEndpoint_measurable (ε : ℕ → Bool) : + Measurable (circleHybridEndpoint ε) := + circleEndpoint_measurable.comp (hybridEndpoint_measurable ε) + +lemma circleLeftEndpoint_measurable : Measurable circleLeftEndpoint := + circleEndpoint_measurable.comp leftEndpoint_measurable + +lemma circleRightEndpoint_measurable : Measurable circleRightEndpoint := + circleEndpoint_measurable.comp rightEndpoint_measurable + +instance circlePairLaw_probability (P : Parameters) : IsProbabilityMeasure (circlePairLaw P) := by + unfold circlePairLaw + infer_instance + +theorem exists_circle_hybrid_density (P : Parameters) (ε : ℕ → Bool) {C : ℝ} + (hsum : Summable (energyBound P)) (hC : (∑' i, energyBound P i) ≤ C) : + ∃ G : ProductModel.Base → ℝ, + MemLp G 2 ProductModel.baseMeasure ∧ (0 ≤ᵐ[ProductModel.baseMeasure] G) ∧ + (∫ x, G x ∂ProductModel.baseMeasure) = 1 ∧ + eLpNorm G 2 ProductModel.baseMeasure ≤ ENNReal.ofReal (Real.exp (C / 2)) ∧ + (law P).map (circleHybridEndpoint ε) = + ProductModel.baseMeasure.withDensity (fun x => ENNReal.ofReal (G x)) := by + obtain ⟨g, hg, hn, hm, hnorm, hlaw⟩ := exists_hybrid_density P ε hsum hC + have ht := circle_density_transport hg + refine ⟨g ∘ realEndpoint, hg.comp_measurePreserving measurePreserving_realEndpoint, + measurePreserving_realEndpoint.quasiMeasurePreserving.ae hn, ?_, ht.2.trans_le hnorm, ?_⟩ + · have hi := integral_map realEndpoint_measurable.aemeasurable + (show AEStronglyMeasurable g (ProductModel.baseMeasure.map realEndpoint) by + rw [measurePreserving_realEndpoint.map_eq] + exact hg.aestronglyMeasurable) + rw [measurePreserving_realEndpoint.map_eq] at hi + exact hi.symm.trans hm + · change (law P).map (circleEndpoint ∘ hybridEndpoint ε) = _ + rw [← Measure.map_map circleEndpoint_measurable (hybridEndpoint_measurable ε), hlaw] + exact ht.1 + +theorem leftEndpoint_ae_mem_unit (P : Parameters) : + ∀ᵐ ω ∂law P, ∀ i, leftEndpoint ω i ∈ Ico (0 : ℝ) 1 := by + apply ae_all_iff.2 + intro i + have hc : ∀ᵐ z ∂coordinateLaw P i, z.2.1 ∈ Ico (0 : ℝ) 1 := by + apply (ae_map_iff (measurable_fst.comp measurable_snd).aemeasurable measurableSet_Ico).1 + change ∀ᵐ x ∂(coordinateLaw P i).map (fun z => z.2.1), x ∈ Ico (0 : ℝ) 1 + rw [coordinateLaw_map_left] + exact (withDensity_absolutelyContinuous _ _).ae_le (CouplingMixture.intervalLaw_ae_mem 0 1) + exact (measurePreserving_eval_infinitePi (coordinateLaw P) i).quasiMeasurePreserving.ae hc + +theorem rightEndpoint_ae_mem_unit (P : Parameters) : + ∀ᵐ ω ∂law P, ∀ i, rightEndpoint ω i ∈ Ico (0 : ℝ) 1 := by + apply ae_all_iff.2 + intro i + have hc : ∀ᵐ z ∂coordinateLaw P i, z.2.2 ∈ Ico (0 : ℝ) 1 := by + apply (ae_map_iff (measurable_snd.comp measurable_snd).aemeasurable measurableSet_Ico).1 + change ∀ᵐ x ∂(coordinateLaw P i).map (fun z => z.2.2), x ∈ Ico (0 : ℝ) 1 + rw [coordinateLaw_map_right] + exact (withDensity_absolutelyContinuous _ _).ae_le (CouplingMixture.intervalLaw_ae_mem 0 1) + exact (measurePreserving_eval_infinitePi (coordinateLaw P) i).quasiMeasurePreserving.ae hc + +theorem ae_real_circle_endpoints (P : Parameters) : + ∀ᵐ ω ∂law P, realEndpoint (circleLeftEndpoint ω) = leftEndpoint ω ∧ + realEndpoint (circleRightEndpoint ω) = rightEndpoint ω := by + filter_upwards [leftEndpoint_ae_mem_unit P, rightEndpoint_ae_mem_unit P] with ω hx hy + exact ⟨realEndpoint_circleEndpoint_of_mem hx, realEndpoint_circleEndpoint_of_mem hy⟩ + +theorem ae_circle_endpoints_ordered (P : Parameters) : + ∀ᵐ ω ∂law P, ProductModel.Ordered (circleLeftEndpoint ω) (circleRightEndpoint ω) := by + filter_upwards [ae_real_circle_endpoints P, ae_ordered P] with ω hrep hord + change realEndpoint (circleLeftEndpoint ω) ≤ realEndpoint (circleRightEndpoint ω) + rw [hrep.1, hrep.2] + exact hord + +theorem circlePairLaw_fst (P : Parameters) : + (circlePairLaw P).map Prod.fst = (law P).map circleLeftEndpoint := by + rw [circlePairLaw, Measure.map_map measurable_fst + (circleLeftEndpoint_measurable.prodMk circleRightEndpoint_measurable)] + rfl + +theorem circlePairLaw_snd (P : Parameters) : + (circlePairLaw P).map Prod.snd = (law P).map circleRightEndpoint := by + rw [circlePairLaw, Measure.map_map measurable_snd + (circleLeftEndpoint_measurable.prodMk circleRightEndpoint_measurable)] + rfl + +theorem circlePairLaw_ordered (P : Parameters) : + ∀ᵐ xy ∂circlePairLaw P, ProductModel.Ordered xy.1 xy.2 := by + have hm : MeasurableSet {xy : ProductModel.Base × ProductModel.Base | + ProductModel.Ordered xy.1 xy.2} := by + change MeasurableSet {xy : ProductModel.Base × ProductModel.Base | + ∀ i, realEndpoint xy.1 i ≤ realEndpoint xy.2 i} + simp only [ofPred_forall] + apply MeasurableSet.iInter + intro i + exact measurableSet_le + ((measurable_pi_apply i).comp (realEndpoint_measurable.comp measurable_fst)) + ((measurable_pi_apply i).comp (realEndpoint_measurable.comp measurable_snd)) + exact (ae_map_iff + (circleLeftEndpoint_measurable.prodMk circleRightEndpoint_measurable).aemeasurable hm).2 + (ae_circle_endpoints_ordered P) + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCircleSource.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCircleSource.lean new file mode 100644 index 0000000000000000000000000000000000000000..3185d7040e4206a0d077fee6a43e7f1d1bfb50c9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCircleSource.lean @@ -0,0 +1,104 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductCouplingCircle +import OAI.Analysis.IrrationalRotation.Couplings.BlockProductCoupling +import OAI.Analysis.IrrationalRotation.Analysis.L2UniformAbsoluteContinuity +import OAI.Analysis.IrrationalRotation.Analysis.RealDensityLp +import OAI.Analysis.IrrationalRotation.Sampling.ProductSamplingAbsoluteContinuity + +namespace OAI + +open MeasureTheory Filter Set +open scoped ENNReal BigOperators + +namespace Invariant233.OrderedProductCoupling + +theorem exists_source_circle_hybrid_density + (m : ℕ → ℕ) (a b : ℕ → ℝ) (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) (tag : ℕ) (ε : ℕ → Bool) : + ∃ H : ProductModel.Base → ℝ, MemLp H 2 ProductModel.baseMeasure ∧ + (0 ≤ᵐ[ProductModel.baseMeasure] H) ∧ + (∫ x, H x ∂ProductModel.baseMeasure) = 1 ∧ + eLpNorm H 2 ProductModel.baseMeasure ≤ ENNReal.ofReal (blockDensityBound sourceKappa) ∧ + (law (ofBlocks m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm + ha ha' hb hb' e tag)).map (circleHybridEndpoint ε) = + ProductModel.baseMeasure.withDensity (fun x => ENNReal.ofReal (H x)) := by + obtain ⟨hs, htotal⟩ := ofBlocks_energy_sum m sourceKappa a b + sourceKappa_nonneg sourceKappa_le hm ha ha' hb hb' e tag summable_sourceKappa_sq + have hbound : Real.exp ((20 * (2 * (∑' s, sourceKappa s ^ 2) + 1)) / 2) = + blockDensityBound sourceKappa := by + unfold blockDensityBound + congr 1 + ring + simpa only [hbound] using exists_circle_hybrid_density + (ofBlocks m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm + ha ha' hb hb' e tag) ε hs htotal.le + +section UniformSourceMarginals +variable (m : ℕ → ℕ) (a b : ℕ → ℝ) (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) + +theorem exists_source_circle_hybrid_Lp_density (tag : ℕ) (ε : ℕ → Bool) : + ∃ f : Lp ℝ 2 ProductModel.baseMeasure, + (0 ≤ᵐ[ProductModel.baseMeasure] (f : ProductModel.Base → ℝ)) ∧ + (law (ofBlocks m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm + ha ha' hb hb' e tag)).map (circleHybridEndpoint ε) = + ProductModel.baseMeasure.withDensity (fun x => ENNReal.ofReal (f x)) ∧ + ‖f‖ ≤ blockDensityBound sourceKappa := by + obtain ⟨g, hg, hn, _hmass, hbound, heq⟩ := + exists_source_circle_hybrid_density m a b hm ha ha' hb hb' e tag ε + exact DensityTransport.exists_Lp_density_of_memLp _ _ hg hn heq + (blockDensityBound_pos sourceKappa).le hbound + +theorem source_hybrid_pairs_hasUniformL2Marginals + (tag : ℕ → ℕ) (ε₁ ε₂ : ℕ → ℕ → Bool) : + ProductModel.HasUniformL2Marginals (fun n => + (law (ofBlocks m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm + ha ha' hb hb' e (tag n))).map + (fun ω => (circleHybridEndpoint (ε₁ n) ω, circleHybridEndpoint (ε₂ n) ω))) := by + refine ⟨blockDensityBound sourceKappa, (blockDensityBound_pos sourceKappa).le, ?_⟩ + intro n + obtain ⟨f, hfn, hfm, hfb⟩ := + exists_source_circle_hybrid_Lp_density m a b hm ha ha' hb hb' e (tag n) (ε₁ n) + obtain ⟨g, hgn, hgm, hgb⟩ := + exists_source_circle_hybrid_Lp_density m a b hm ha ha' hb hb' e (tag n) (ε₂ n) + refine ⟨f, g, hfn, hgn, ?_, ?_, hfb, hgb⟩ + · rw [Measure.map_map measurable_fst + ((circleHybridEndpoint_measurable (ε₁ n)).prodMk (circleHybridEndpoint_measurable (ε₂ n)))] + exact hfm + · rw [Measure.map_map measurable_snd + ((circleHybridEndpoint_measurable (ε₁ n)).prodMk (circleHybridEndpoint_measurable (ε₂ n)))] + exact hgm + +theorem source_hybrid_pairs_uniformlyAbsolutelyContinuous + (tag : ℕ → ℕ) (ε₁ ε₂ : ℕ → ℕ → Bool) : + let η := fun n => + (law (ofBlocks m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm + ha ha' hb hb' e (tag n))).map + (fun ω => (circleHybridEndpoint (ε₁ n) ω, circleHybridEndpoint (ε₂ n) ω)) + UniformlyAbsolutelyContinuous ProductModel.baseMeasure (fun n => (η n).map Prod.fst) ∧ + UniformlyAbsolutelyContinuous ProductModel.baseMeasure (fun n => (η n).map Prod.snd) := + (source_hybrid_pairs_hasUniformL2Marginals m a b hm ha ha' hb hb' e tag ε₁ ε₂).uniformlyAbsolutelyContinuous + +theorem source_circle_hybrid_measureReal_le_sqrt (tag : ℕ) (ε : ℕ → Bool) + (A : Set ProductModel.Base) (hA : MeasurableSet A) : + ((law (ofBlocks m sourceKappa a b sourceKappa_nonneg sourceKappa_le hm + ha ha' hb hb' e tag)).map (circleHybridEndpoint ε)).real A ≤ + blockDensityBound sourceKappa * Real.sqrt (ProductModel.baseMeasure.real A) := by + obtain ⟨g, hg, hn, _hmass, hbound, heq⟩ := + exists_source_circle_hybrid_density m a b hm ha ha' hb hb' e tag ε + have hbnd : (eLpNorm g 2 ProductModel.baseMeasure).toReal ≤ blockDensityBound sourceKappa := by + exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top hbound).trans_eq + (ENNReal.toReal_ofReal (blockDensityBound_pos sourceKappa).le) + rw [heq] + refine (EndpointLoss.withDensity_measureReal_le_sqrt ProductModel.baseMeasure hg hn hA).trans ?_ + rw [EndpointLoss.sqrt_integral_sq_eq_toReal_eLpNorm hg] + exact mul_le_mul_of_nonneg_right hbnd (Real.sqrt_nonneg _) + +end UniformSourceMarginals + +end Invariant233.OrderedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCocycleAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCocycleAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7c52ba18643eb057513af27d40bef82d779f0ab --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCocycleAttenuation.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductCouplingCocycleBounds +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalEvents + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.OrderedProductCoupling + +theorem finite_cocycle_conditional_attenuation (P : Parameters) + (hsum : Summable (energyBound P)) + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) (k : ℤ) (I : Finset ℕ) (w : ℕ → ℝ) + (hwidth : ∀ i ∈ I, w i = P.a i ∨ w i = P.b i) + (hthreshold : ∀ i ∈ I, + w i ≤ 1 - Int.fract ((k : ℝ) * θ i) ∧ + 1 - Int.fract ((k : ℝ) * θ i) ≤ 1 - w i) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) + (hI : m / 20 ≤ (I.card : ℝ)) + (hrho : ∀ i ∈ I, ρ ≤ CouplingMarginalBounds.rho (P.κ i) (P.m i) (w i)) + (hcost : ∀ i ∈ I, L ≤ c i) : + ∃ H₁ H₂ : Set Sample, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂law P, ((law P)[H₁.indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap leftEndpoint inferInstance]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂law P, ((law P)[H₂.indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap rightEndpoint inferInstance]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂law P, + ProductCocycle.cocycleVersion θ c k (circleRightEndpoint ω) / + ProductCocycle.cocycleVersion θ c k (circleLeftEndpoint ω) ≤ + Real.exp (-L) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + have hbound := ae_all_int_cocycle_ratio_bounds P hsum θ c hθ0 hθ hc + apply finite_threshold_attenuation P I + (fun i => 1 - Int.fract ((k : ℝ) * θ i)) w hwidth hthreshold + m ρ L hρ hL hI hrho + (fun ω => ProductCocycle.cocycleVersion θ c k (circleRightEndpoint ω) / + ProductCocycle.cocycleVersion θ c k (circleLeftEndpoint ω)) + (hbound.mono (fun _ h => (h k).2.1)) + filter_upwards [hbound] with ω hω + intro i hi hcross + exact ((hω k).2.2 i hcross).trans + (Real.exp_le_exp.mpr (neg_le_neg (hcost i hi))) + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCocycleBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCocycleBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..b55323a3b78479300a9e5ed986569b4b7a078f9e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingCocycleBounds.lean @@ -0,0 +1,64 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductCouplingCircle +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalAttenuation + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.OrderedProductCoupling + +theorem circleLeftEndpoint_map_absolutelyContinuous (P : Parameters) + (hsum : Summable (energyBound P)) : + (law P).map circleLeftEndpoint ≪ ProductModel.baseMeasure := by + obtain ⟨g, _, _, _, _, hg⟩ := + exists_circle_hybrid_density P (fun _ => false) hsum le_rfl + change (law P).map (circleHybridEndpoint (fun _ => false)) ≪ _ + rw [hg] + exact withDensity_absolutelyContinuous _ _ + +theorem circleRightEndpoint_map_absolutelyContinuous (P : Parameters) + (hsum : Summable (energyBound P)) : + (law P).map circleRightEndpoint ≪ ProductModel.baseMeasure := by + obtain ⟨g, _, _, _, _, hg⟩ := + exists_circle_hybrid_density P (fun _ => true) hsum le_rfl + change (law P).map (circleHybridEndpoint (fun _ => true)) ≪ _ + rw [hg] + exact withDensity_absolutelyContinuous _ _ + +theorem ae_all_int_cocycle_ratio_bounds (P : Parameters) + (hsum : Summable (energyBound P)) + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) : + ∀ᵐ ω ∂law P, ∀ k : ℤ, + 0 < ProductCocycle.cocycleVersion θ c k (circleRightEndpoint ω) / + ProductCocycle.cocycleVersion θ c k (circleLeftEndpoint ω) ∧ + ProductCocycle.cocycleVersion θ c k (circleRightEndpoint ω) / + ProductCocycle.cocycleVersion θ c k (circleLeftEndpoint ω) ≤ 1 ∧ + ∀ i, (leftEndpoint ω i < 1 - Int.fract ((k : ℝ) * θ i) ∧ + 1 - Int.fract ((k : ℝ) * θ i) ≤ rightEndpoint ω i) → + ProductCocycle.cocycleVersion θ c k (circleRightEndpoint ω) / + ProductCocycle.cocycleVersion θ c k (circleLeftEndpoint ω) ≤ Real.exp (-c i) := by + have hbound := ProductCocycle.ae_all_int_ratio_bounds_of_map_ac + (law P) θ c hθ0 hθ hc circleLeftEndpoint circleRightEndpoint + circleLeftEndpoint_measurable.aemeasurable circleRightEndpoint_measurable.aemeasurable + (circleLeftEndpoint_map_absolutelyContinuous P hsum) + (circleRightEndpoint_map_absolutelyContinuous P hsum) + (ae_circle_endpoints_ordered P) + filter_upwards [hbound, ae_real_circle_endpoints P] with ω hω hrep + intro k + refine ⟨div_pos (ProductCocycle.cocycleVersion_pos θ c k _) + (ProductCocycle.cocycleVersion_pos θ c k _), (hω k).1, ?_⟩ + intro i hi + apply (hω k).2 i + have hx : ProductCocycle.representative (circleLeftEndpoint ω i) = leftEndpoint ω i := + congrFun hrep.1 i + have hy : ProductCocycle.representative (circleRightEndpoint ω i) = rightEndpoint ω i := + congrFun hrep.2 i + simpa only [hx, hy] using hi + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingPrefix.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingPrefix.lean new file mode 100644 index 0000000000000000000000000000000000000000..775a685cb6732e5c6e6b301e82bf5d55b693f932 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCouplingPrefix.lean @@ -0,0 +1,98 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductCouplingCircle +import OAI.Analysis.IrrationalRotation.Sampling.PrefixCompactTransfer + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.OrderedProductCoupling + +theorem prefixEndpoint_circle_endpoints (D : ℕ) (ω : Sample) : + ProductModel.prefixEndpoint D (circleLeftEndpoint ω) (circleRightEndpoint ω) = + circleHybridEndpoint (fun i => decide (i < D)) ω := by + funext i + by_cases hi : i < D <;> + simp [ProductModel.prefixEndpoint_apply, circleLeftEndpoint, + circleRightEndpoint, circleHybridEndpoint, circleEndpoint, hybridEndpoint, Function.comp_apply, hi] + +theorem prefixPairLaw_circlePairLaw (P : Parameters) (D : ℕ) : + ProductModel.prefixPairLaw (circlePairLaw P) D = + (law P).map (fun ω => + (circleLeftEndpoint ω, circleHybridEndpoint (fun i => decide (i < D)) ω)) := by + rw [ProductModel.prefixPairLaw, circlePairLaw, + Measure.map_map (ProductModel.measurable_prefixPair D) + (circleLeftEndpoint_measurable.prodMk circleRightEndpoint_measurable)] + congr 1 + funext ω + exact congrArg (fun y => (circleLeftEndpoint ω, y)) + (prefixEndpoint_circle_endpoints D ω) + +theorem prefixPairLaw_circlePairLaw_fst (P : Parameters) (D : ℕ) : + (ProductModel.prefixPairLaw (circlePairLaw P) D).map Prod.fst = + (law P).map (circleHybridEndpoint (fun _ => false)) := by + rw [ProductModel.prefixPairLaw_first_marginal] + exact circlePairLaw_fst P + +theorem prefixPairLaw_circlePairLaw_snd (P : Parameters) (D : ℕ) : + (ProductModel.prefixPairLaw (circlePairLaw P) D).map Prod.snd = + (law P).map (circleHybridEndpoint (fun i => decide (i < D))) := by + rw [prefixPairLaw_circlePairLaw, + Measure.map_map measurable_snd (circleLeftEndpoint_measurable.prodMk + (circleHybridEndpoint_measurable (fun i => decide (i < D))))] + rfl + +theorem circlePairLaw_marginals_ac_of_energy (P : Parameters) + (hsum : Summable (energyBound P)) : + (circlePairLaw P).map Prod.fst ≪ ProductModel.baseMeasure ∧ + (circlePairLaw P).map Prod.snd ≪ ProductModel.baseMeasure := by + have hhybrid (ε : ℕ → Bool) : + (law P).map (circleHybridEndpoint ε) ≪ ProductModel.baseMeasure := by + obtain ⟨G, _, _, _, _, hG⟩ := exists_circle_hybrid_density P ε hsum + (le_refl (∑' i, energyBound P i)) + rw [hG] + exact withDensity_absolutelyContinuous _ _ + constructor + · rw [circlePairLaw_fst] + exact hhybrid (fun _ => false) + · rw [circlePairLaw_snd] + exact hhybrid (fun _ => true) + +theorem circlePairLaw_prefix_hasUniformL2Marginals (P : Parameters) + (hsum : Summable (energyBound P)) : + ProductModel.HasUniformL2Marginals + (ProductModel.prefixPairLaw (circlePairLaw P)) := by + let H : ℝ := Real.exp ((∑' i, energyBound P i) / 2) + have hH : 0 ≤ H := (Real.exp_pos _).le + have hd (ε : ℕ → Bool) : + ∃ f : Lp ℝ 2 ProductModel.baseMeasure, + (∀ᵐ x ∂ProductModel.baseMeasure, 0 ≤ f x) ∧ + (law P).map (circleHybridEndpoint ε) = + ProductModel.baseMeasure.withDensity (fun x => ENNReal.ofReal (f x)) ∧ + ‖f‖ ≤ H := by + obtain ⟨G, hG, hpos, _, hnorm, hlaw⟩ := exists_circle_hybrid_density P ε hsum + (le_refl (∑' i, energyBound P i)) + refine ⟨hG.toLp G, ?_, ?_, ?_⟩ + · filter_upwards [hG.coeFn_toLp, hpos] with x hx hpx + simpa only [hx, Pi.zero_apply] using hpx + · rw [hlaw] + apply withDensity_congr_ae + filter_upwards [hG.coeFn_toLp] with x hx + exact congrArg ENNReal.ofReal hx.symm + · rw [Lp.norm_toLp] + exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top hnorm).trans_eq + (ENNReal.toReal_ofReal hH) + refine ⟨H, hH, fun D => ?_⟩ + obtain ⟨f, hf, hflaw, hfnorm⟩ := hd (fun _ => false) + obtain ⟨g, hg, hglaw, hgnorm⟩ := hd (fun i => decide (i < D)) + refine ⟨f, g, hf, hg, ?_, ?_, hfnorm, hgnorm⟩ + · rw [prefixPairLaw_circlePairLaw_fst] + exact hflaw + · rw [prefixPairLaw_circlePairLaw_snd] + exact hglaw + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCrossingConditionalExpectation.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCrossingConditionalExpectation.lean new file mode 100644 index 0000000000000000000000000000000000000000..b6f686edee98ac163a45f0ba13bce9f58127df21 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductCrossingConditionalExpectation.lean @@ -0,0 +1,101 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalThresholds +import Mathlib.MeasureTheory.Function.ConditionalExpectation.Indicator + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set + +namespace Invariant233.OrderedProductCoupling +open CouplingMarginalBounds + +theorem right_crossing_condExp_eq (P : Parameters) (u : ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ i : ℕ, + ((law P)[{ω : Sample | leftEndpoint ω i < u i ∧ u i ≤ rightEndpoint ω i}.indicator + (fun _ => (1 : ℝ)) | (inferInstance : MeasurableSpace Endpoint).comap leftEndpoint]) ω = + {ω : Sample | leftEndpoint ω i < u i}.indicator + ((law P)[{ω : Sample | u i ≤ rightEndpoint ω i}.indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace Endpoint).comap leftEndpoint]) ω := by + apply ae_all_iff.mpr + intro i + have htop : MeasurableSet {ω : Sample | u i ≤ rightEndpoint ω i} := + measurableSet_le measurable_const ((measurable_pi_apply i).comp rightEndpoint_measurable) + have helig : MeasurableSet[(inferInstance : MeasurableSpace Endpoint).comap leftEndpoint] + {ω : Sample | leftEndpoint ω i < u i} := by + exact ⟨{x : Endpoint | x i < u i}, + measurableSet_lt (measurable_pi_apply i) measurable_const, rfl⟩ + have h := condExp_indicator (μ := law P) + ((integrable_const (1 : ℝ)).indicator htop) helig + filter_upwards [h] with ω hω + simpa only [Set.indicator_indicator, Set.ofPred_and] using hω + +theorem left_crossing_condExp_eq (P : Parameters) (u : ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ i : ℕ, + ((law P)[{ω : Sample | leftEndpoint ω i < u i ∧ u i ≤ rightEndpoint ω i}.indicator + (fun _ => (1 : ℝ)) | (inferInstance : MeasurableSpace Endpoint).comap rightEndpoint]) ω = + {ω : Sample | u i ≤ rightEndpoint ω i}.indicator + ((law P)[{ω : Sample | leftEndpoint ω i < u i}.indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace Endpoint).comap rightEndpoint]) ω := by + apply ae_all_iff.mpr + intro i + have hbottom : MeasurableSet {ω : Sample | leftEndpoint ω i < u i} := + measurableSet_lt ((measurable_pi_apply i).comp leftEndpoint_measurable) measurable_const + have helig : MeasurableSet[(inferInstance : MeasurableSpace Endpoint).comap rightEndpoint] + {ω : Sample | u i ≤ rightEndpoint ω i} := by + exact ⟨{y : Endpoint | u i ≤ y i}, + measurableSet_le measurable_const (measurable_pi_apply i), rfl⟩ + have h := condExp_indicator (μ := law P) + ((integrable_const (1 : ℝ)).indicator hbottom) helig + filter_upwards [h] with ω hω + simpa only [Set.indicator_indicator, Set.ofPred_and, Set.inter_comm] using hω + +theorem right_crossing_condExp_lower (P : Parameters) (u : ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u i → u i ≤ 1 - w → + leftEndpoint ω i < u i → + rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | leftEndpoint ω i < u i ∧ u i ≤ rightEndpoint ω i}.indicator + (fun _ => (1 : ℝ)) | (inferInstance : MeasurableSpace Endpoint).comap leftEndpoint]) ω := by + filter_upwards [right_crossing_condExp_eq P u, + right_threshold_condExp_lower_all_coordinates P u] with ω heq hbound + intro i w hw hwu huw hxu + rw [heq i, Set.indicator_of_mem (show ω ∈ {ω : Sample | leftEndpoint ω i < u i} from hxu)] + exact hbound i w hw hwu huw hxu + +theorem left_crossing_condExp_lower (P : Parameters) (u : ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u i → u i ≤ 1 - w → + u i ≤ rightEndpoint ω i → + rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | leftEndpoint ω i < u i ∧ u i ≤ rightEndpoint ω i}.indicator + (fun _ => (1 : ℝ)) | (inferInstance : MeasurableSpace Endpoint).comap rightEndpoint]) ω := by + filter_upwards [left_crossing_condExp_eq P u, + left_threshold_condExp_lower_all_coordinates P u] with ω heq hbound + intro i w hw hwu huw huy + rw [heq i, Set.indicator_of_mem (show ω ∈ {ω : Sample | u i ≤ rightEndpoint ω i} from huy)] + exact hbound i w hw hwu huw huy + +theorem crossing_condExp_lower_countable {K : Type*} [Countable K] + (P : Parameters) (u : K → ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (k : K) (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u k i → u k i ≤ 1 - w → + (leftEndpoint ω i < u k i → + rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | leftEndpoint ω i < u k i ∧ u k i ≤ rightEndpoint ω i}.indicator + (fun _ => (1 : ℝ)) | (inferInstance : MeasurableSpace Endpoint).comap leftEndpoint]) ω) ∧ + (u k i ≤ rightEndpoint ω i → + rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | leftEndpoint ω i < u k i ∧ u k i ≤ rightEndpoint ω i}.indicator + (fun _ => (1 : ℝ)) | (inferInstance : MeasurableSpace Endpoint).comap rightEndpoint]) ω) := by + apply ae_all_iff.mpr + intro k + filter_upwards [right_crossing_condExp_lower P (u k), + left_crossing_condExp_lower P (u k)] with ω hright hleft + intro i w hw hwu huw + exact ⟨hright i w hw hwu huw, hleft i w hw hwu huw⟩ + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..948f6a356a7c6a48d3b592c2d8d458c16e31841e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductDensity.lean @@ -0,0 +1,294 @@ +import Mathlib.MeasureTheory.Integral.Pi +import Mathlib.Probability.Moments.Variance +import Mathlib.Analysis.Complex.Exponential +import Mathlib.Probability.ProductMeasure + +namespace OAI + +open MeasureTheory +open scoped BigOperators ENNReal + +namespace Invariant233.ProductDensity + +theorem integral_sq_eq_one_add_centered_sq + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {h : Ω → ℝ} (hh : MemLp h 2 μ) (hmean : ∫ x, h x ∂μ = 1) : + (∫ x, h x ^ 2 ∂μ) = 1 + ∫ x, (h x - 1) ^ 2 ∂μ := by + have hv := ProbabilityTheory.variance_eq_sub hh + rw [ProbabilityTheory.variance_eq_integral hh.aemeasurable, hmean] at hv + norm_num at hv + linarith + +theorem integral_finite_product_eq_one + {ι : Type*} [Fintype ι] {Ω : ι → Type*} + [∀ i, MeasurableSpace (Ω i)] {μ : (i : ι) → Measure (Ω i)} + [∀ i, IsProbabilityMeasure (μ i)] {h : (i : ι) → Ω i → ℝ} + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) : + (∫ x, ∏ i, h i (x i) ∂Measure.pi μ) = 1 := by + rw [integral_fintype_prod_eq_prod] + simp [hmean] + +theorem integral_finite_product_sq + {ι : Type*} [Fintype ι] {Ω : ι → Type*} + [∀ i, MeasurableSpace (Ω i)] {μ : (i : ι) → Measure (Ω i)} + [∀ i, IsProbabilityMeasure (μ i)] {h : (i : ι) → Ω i → ℝ} + (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) : + (∫ x, (∏ i, h i (x i)) ^ 2 ∂Measure.pi μ) = + ∏ i, (1 + ∫ x, (h i x - 1) ^ 2 ∂μ i) := by + calc + _ = ∫ x, ∏ i, (h i (x i)) ^ 2 ∂Measure.pi μ := by + congr 1 + funext x + exact (Finset.prod_pow _ _ _).symm + _ = ∏ i, ∫ x, (h i x) ^ 2 ∂μ i := integral_fintype_prod_eq_prod (μ := μ) (fun i x => h i x ^ 2) + _ = _ := Finset.prod_congr rfl fun i _ => + integral_sq_eq_one_add_centered_sq (hh i) (hmean i) + +theorem integral_finite_product_sq_le_exp + {ι : Type*} [Fintype ι] {Ω : ι → Type*} + [∀ i, MeasurableSpace (Ω i)] {μ : (i : ι) → Measure (Ω i)} + [∀ i, IsProbabilityMeasure (μ i)] {h : (i : ι) → Ω i → ℝ} + (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) : + (∫ x, (∏ i, h i (x i)) ^ 2 ∂Measure.pi μ) ≤ + Real.exp (∑ i, ∫ x, (h i x - 1) ^ 2 ∂μ i) := by + rw [integral_finite_product_sq hh hmean] + exact Real.prod_one_add_le_exp_sum _ fun i => integral_nonneg fun x => sq_nonneg _ + +theorem memLp_finite_product + {ι : Type*} [Fintype ι] {Ω : ι → Type*} + [∀ i, MeasurableSpace (Ω i)] {μ : (i : ι) → Measure (Ω i)} + [∀ i, IsProbabilityMeasure (μ i)] {h : (i : ι) → Ω i → ℝ} + (hh : ∀ i, MemLp (h i) 2 (μ i)) : + MemLp (fun x => ∏ i, h i (x i)) 2 (Measure.pi μ) := by + have hi : Integrable (fun x => ∏ i, h i (x i)) (Measure.pi μ) := + Integrable.fintype_prod_dep fun i => (hh i).integrable (by norm_num) + apply (memLp_two_iff_integrable_sq hi.aestronglyMeasurable).2 + simpa only [Finset.prod_pow] using + (Integrable.fintype_prod_dep fun i => (hh i).integrable_sq) + +theorem integral_finite_product_sq_le_exp_of_sum_le + {ι : Type*} [Fintype ι] {Ω : ι → Type*} + [∀ i, MeasurableSpace (Ω i)] {μ : (i : ι) → Measure (Ω i)} + [∀ i, IsProbabilityMeasure (μ i)] {h : (i : ι) → Ω i → ℝ} {C : ℝ} + (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + (hC : (∑ i, ∫ x, (h i x - 1) ^ 2 ∂μ i) ≤ C) : + (∫ x, (∏ i, h i (x i)) ^ 2 ∂Measure.pi μ) ≤ Real.exp C := + (integral_finite_product_sq_le_exp hh hmean).trans (Real.exp_le_exp.mpr hC) + +theorem eLpNorm_finite_product_le_exp_half + {ι : Type*} [Fintype ι] {Ω : ι → Type*} + [∀ i, MeasurableSpace (Ω i)] {μ : (i : ι) → Measure (Ω i)} + [∀ i, IsProbabilityMeasure (μ i)] {h : (i : ι) → Ω i → ℝ} {C : ℝ} + (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + (hC : (∑ i, ∫ x, (h i x - 1) ^ 2 ∂μ i) ≤ C) : + eLpNorm (fun x => ∏ i, h i (x i)) 2 (Measure.pi μ) ≤ + ENNReal.ofReal (Real.exp (C / 2)) := by + rw [MemLp.eLpNorm_eq_integral_rpow_norm (by norm_num) (by norm_num) + (memLp_finite_product hh)] + norm_num only [ENNReal.toReal_ofNat, Real.rpow_two, Real.norm_eq_abs, sq_abs] + apply ENNReal.ofReal_le_ofReal + calc + _ ≤ (Real.exp C) ^ (1 / 2 : ℝ) := + Real.rpow_le_rpow (integral_nonneg fun _ => sq_nonneg _) + (integral_finite_product_sq_le_exp_of_sum_le hh hmean hC) (by positivity) + _ = Real.exp (C / 2) := by + rw [← Real.exp_mul] + congr 1 + ring + +theorem eLpNorm_finite_hybrid_le_exp_half + {ι : Type*} [Fintype ι] {Ω : ι → Type*} + [∀ i, MeasurableSpace (Ω i)] {μ : (i : ι) → Measure (Ω i)} + [∀ i, IsProbabilityMeasure (μ i)] {h : Bool → (i : ι) → Ω i → ℝ} + {b : ι → ℝ} {C : ℝ} (ε : ι → Bool) + (hh : ∀ a i, MemLp (h a i) 2 (μ i)) + (hmean : ∀ a i, ∫ x, h a i x ∂μ i = 1) + (hb : ∀ a i, (∫ x, (h a i x - 1) ^ 2 ∂μ i) ≤ b i) + (hC : (∑ i, b i) ≤ C) : + eLpNorm (fun x => ∏ i, h (ε i) i (x i)) 2 (Measure.pi μ) ≤ + ENNReal.ofReal (Real.exp (C / 2)) := by + apply eLpNorm_finite_product_le_exp_half (fun i => hh (ε i) i) + (fun i => hmean (ε i) i) + exact (Finset.sum_le_sum fun i _ => hb (ε i) i).trans hC + +theorem measurePreserving_restrict_infinitePi + {ι : Type*} {Ω : ι → Type*} [∀ i, MeasurableSpace (Ω i)] + (μ : (i : ι) → Measure (Ω i)) [∀ i, IsProbabilityMeasure (μ i)] (s : Finset ι) : + MeasurePreserving s.restrict (Measure.infinitePi μ) + (Measure.pi fun i : s => μ i) := + ⟨Finset.measurable_restrict s, Measure.infinitePi_map_restrict μ⟩ + +theorem partial_product_eq_restrict + {ι : Type*} {Ω : ι → Type*} (h : (i : ι) → Ω i → ℝ) (s : Finset ι) : + (fun x => ∏ i ∈ s, h i (x i)) = + (fun x : (i : s) → Ω i => ∏ i : s, h i (x i)) ∘ s.restrict := by + funext x + exact (Finset.prod_coe_sort s (fun i => h i (x i))).symm + +theorem memLp_partial_product + {ι : Type*} {Ω : ι → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ι) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ι) → Ω i → ℝ} (s : Finset ι) + (hh : ∀ i, MemLp (h i) 2 (μ i)) : + MemLp (fun x => ∏ i ∈ s, h i (x i)) 2 (Measure.infinitePi μ) := by + rw [partial_product_eq_restrict h s] + exact (memLp_finite_product (fun i : s => hh i)).comp_measurePreserving + (measurePreserving_restrict_infinitePi μ s) + +theorem eLpNorm_partial_product_le_exp_half + {ι : Type*} {Ω : ι → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ι) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ι) → Ω i → ℝ} {C : ℝ} (s : Finset ι) + (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + (hC : (∑ i ∈ s, ∫ x, (h i x - 1) ^ 2 ∂μ i) ≤ C) : + eLpNorm (fun x => ∏ i ∈ s, h i (x i)) 2 (Measure.infinitePi μ) ≤ + ENNReal.ofReal (Real.exp (C / 2)) := by + have heq := eLpNorm_comp_measurePreserving + (memLp_finite_product (fun i : s => hh i)).aestronglyMeasurable + (measurePreserving_restrict_infinitePi μ s) (p := (2 : ℝ≥0∞)) + have hbound := eLpNorm_finite_product_le_exp_half (fun i : s => hh i) + (fun i : s => hmean i) (C := C) (by + exact (Finset.sum_coe_sort s (fun i => ∫ x, (h i x - 1) ^ 2 ∂μ i)).le.trans hC) + rw [partial_product_eq_restrict h s] + exact heq.le.trans hbound + +theorem eLpNorm_partial_product_le_exp_half_of_tsum_le + {ι : Type*} {Ω : ι → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ι) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ι) → Ω i → ℝ} {C : ℝ} (s : Finset ι) + (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + (hsum : Summable (fun i => ∫ x, (h i x - 1) ^ 2 ∂μ i)) + (hC : (∑' i, ∫ x, (h i x - 1) ^ 2 ∂μ i) ≤ C) : + eLpNorm (fun x => ∏ i ∈ s, h i (x i)) 2 (Measure.infinitePi μ) ≤ + ENNReal.ofReal (Real.exp (C / 2)) := by + apply eLpNorm_partial_product_le_exp_half s hh hmean + exact (hsum.sum_le_tsum s fun i _ => integral_nonneg fun x => sq_nonneg _).trans hC + +theorem integral_partial_product + {ι : Type*} {Ω : ι → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ι) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ι) → Ω i → ℝ} (s : Finset ι) + (hh : ∀ i, Integrable (h i) (μ i)) : + (∫ x, ∏ i ∈ s, h i (x i) ∂Measure.infinitePi μ) = + ∏ i ∈ s, ∫ x, h i x ∂μ i := by + rw [partial_product_eq_restrict h s] + change (∫ x, (fun y : (i : s) → Ω i => ∏ i : s, h i (y i)) (s.restrict x) + ∂Measure.infinitePi μ) = _ + rw [integral_restrict_infinitePi (μ := μ) (s := s) + (f := fun y : (i : s) → Ω i => ∏ i : s, h i (y i)) + (Integrable.fintype_prod_dep (fun i : s => hh i)).aestronglyMeasurable] + rw [integral_fintype_prod_eq_prod] + exact Finset.prod_coe_sort s (fun i => ∫ x, h i x ∂μ i) + +theorem partial_product_mul_of_subset + {ι : Type*} [DecidableEq ι] {Ω : ι → Type*} + (h : (i : ι) → Ω i → ℝ) {s t : Finset ι} (hst : s ⊆ t) (x : (i : ι) → Ω i) : + (∏ i ∈ s, h i (x i)) * (∏ i ∈ t, h i (x i)) = + ∏ i ∈ t, if i ∈ s then h i (x i) ^ 2 else h i (x i) := by + have heq : (∏ i ∈ t, if i ∈ s then h i (x i) else 1) = + ∏ i ∈ s, h i (x i) := by + rw [Finset.prod_ite_mem, Finset.inter_eq_right.mpr hst] + rw [← heq, ← Finset.prod_mul_distrib] + apply Finset.prod_congr rfl + intro i hi + split_ifs <;> ring + +theorem integral_partial_product_mul_of_subset + {ι : Type*} [DecidableEq ι] {Ω : ι → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ι) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ι) → Ω i → ℝ} {s t : Finset ι} (hst : s ⊆ t) + (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) : + (∫ x, (∏ i ∈ s, h i (x i)) * (∏ i ∈ t, h i (x i)) ∂Measure.infinitePi μ) = + ∫ x, (∏ i ∈ s, h i (x i)) ^ 2 ∂Measure.infinitePi μ := by + have hmixed : ∀ i, Integrable (fun x => if i ∈ s then h i x ^ 2 else h i x) (μ i) := by + intro i + by_cases hi : i ∈ s + · simpa only [ite_eq_left hi] using (hh i).integrable_sq + · simpa only [ite_eq_right hi] using (hh i).integrable (by norm_num) + have hleft : (∫ x, (∏ i ∈ s, h i (x i)) * (∏ i ∈ t, h i (x i)) ∂Measure.infinitePi μ) = + ∏ i ∈ s, ∫ x, h i x ^ 2 ∂μ i := by + simp_rw [partial_product_mul_of_subset h hst] + rw [integral_partial_product t hmixed] + calc + _ = ∏ i ∈ t, if i ∈ s then ∫ x, h i x ^ 2 ∂μ i else 1 := by + apply Finset.prod_congr rfl + intro i hi + by_cases his : i ∈ s + · simp only [ite_eq_left his] + · simp only [ite_eq_right his, hmean] + _ = _ := by rw [Finset.prod_ite_mem, Finset.inter_eq_right.mpr hst] + rw [hleft] + symm + calc + _ = ∫ x, ∏ i ∈ s, h i (x i) ^ 2 ∂Measure.infinitePi μ := by + congr 1 + funext x + exact (Finset.prod_pow _ _ _).symm + _ = _ := integral_partial_product s (fun i => (hh i).integrable_sq) + +theorem indicator_partial_product + {ι : Type*} [DecidableEq ι] {Ω : ι → Type*} + (h : (i : ι) → Ω i → ℝ) {s t : Finset ι} (hst : s ⊆ t) + (a : (i : ι) → Set (Ω i)) (x : (i : ι) → Ω i) : + (Set.pi (s : Set ι) a).indicator (fun y => ∏ i ∈ t, h i (y i)) x = + ∏ i ∈ t, if i ∈ s then (a i).indicator (h i) (x i) else h i (x i) := by + classical + by_cases hx : x ∈ Set.pi (s : Set ι) a + · rw [Set.indicator_of_mem hx] + apply Finset.prod_congr rfl + intro i hi + by_cases his : i ∈ s + · rw [ite_eq_left his, Set.indicator_of_mem ((Set.mem_pi.mp hx) i his)] + · rw [ite_eq_right his] + · rw [Set.indicator_of_notMem hx] + symm + have hex : ∃ i ∈ s, x i ∉ a i := by + by_contra hnone + apply hx + apply Set.mem_pi.mpr + intro i hi + by_contra hix + exact hnone ⟨i, hi, hix⟩ + obtain ⟨i, his, hix⟩ := hex + apply Finset.prod_eq_zero (hst his) + rw [ite_eq_left his, Set.indicator_of_notMem hix] + +theorem setIntegral_partial_product_pi + {ι : Type*} [DecidableEq ι] {Ω : ι → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ι) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ι) → Ω i → ℝ} {s t : Finset ι} (hst : s ⊆ t) + (hh : ∀ i, Integrable (h i) (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + (a : (i : ι) → Set (Ω i)) (ha : ∀ i, MeasurableSet (a i)) : + (∫ x in Set.pi (s : Set ι) a, ∏ i ∈ t, h i (x i) ∂Measure.infinitePi μ) = + ∏ i ∈ s, ∫ x in a i, h i x ∂μ i := by + classical + have hmeas : MeasurableSet (Set.pi (s : Set ι) a) := + MeasurableSet.pi s.countable_toSet (fun i _ => ha i) + rw [← integral_indicator hmeas] + simp_rw [indicator_partial_product h hst a] + have hmixed : ∀ i, Integrable (fun x => if i ∈ s then (a i).indicator (h i) x else h i x) (μ i) := by + intro i + by_cases his : i ∈ s + · simpa only [ite_eq_left his] using (hh i).indicator (ha i) + · simpa only [ite_eq_right his] using hh i + rw [integral_partial_product t hmixed] + calc + _ = ∏ i ∈ t, if i ∈ s then ∫ x in a i, h i x ∂μ i else 1 := by + apply Finset.prod_congr rfl + intro i hi + by_cases his : i ∈ s + · simp only [ite_eq_left his, integral_indicator (ha i)] + · simp only [ite_eq_right his, hmean] + _ = _ := by rw [Finset.prod_ite_mem, Finset.inter_eq_right.mpr hst] + +end Invariant233.ProductDensity + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductDensityLimit.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductDensityLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc72eafbb41f3476dc68c70441d9f4743299abcf --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductDensityLimit.lean @@ -0,0 +1,285 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductDensity +import OAI.Analysis.IrrationalRotation.Sampling.OrthogonalPrefixLimit +import Mathlib.MeasureTheory.Function.LpSpace.Complete +import Mathlib.MeasureTheory.Function.AEEqOfIntegral +import Mathlib.MeasureTheory.Measure.WithDensity + +namespace OAI + +open MeasureTheory Filter +open scoped BigOperators ENNReal Topology + +namespace Invariant233.ProductDensity + +theorem inner_toLp_eq_integral_mul + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} + {f g : Ω → ℝ} (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) : + inner ℝ (hf.toLp f) (hg.toLp g) = ∫ x, f x * g x ∂μ := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hf.coeFn_toLp, hg.coeFn_toLp] with x hfx hgx + simp [hfx, hgx, mul_comm] + +noncomputable def partialDensityLp + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ℕ) → Ω i → ℝ} (hh : ∀ i, MemLp (h i) 2 (μ i)) + (n : ℕ) : Lp ℝ 2 (Measure.infinitePi μ) := + (memLp_partial_product (Finset.range n) hh).toLp + (fun x => ∏ i ∈ Finset.range n, h i (x i)) + +theorem partialDensityLp_inner + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ℕ) → Ω i → ℝ} (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) {n m : ℕ} (hnm : n ≤ m) : + inner ℝ (partialDensityLp hh n) (partialDensityLp hh m) = + ‖partialDensityLp hh n‖ ^ 2 := by + calc + _ = ∫ x, (∏ i ∈ Finset.range n, h i (x i)) * + (∏ i ∈ Finset.range m, h i (x i)) ∂Measure.infinitePi μ := + inner_toLp_eq_integral_mul _ _ + _ = ∫ x, (∏ i ∈ Finset.range n, h i (x i)) ^ 2 ∂Measure.infinitePi μ := + integral_partial_product_mul_of_subset (Finset.range_mono hnm) hh hmean + _ = inner ℝ (partialDensityLp hh n) (partialDensityLp hh n) := by + rw [partialDensityLp, inner_toLp_eq_integral_mul] + congr 1 + funext x + ring + _ = _ := real_inner_self_eq_norm_sq _ + +theorem exists_partialDensityLp_limit + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ℕ) → Ω i → ℝ} {C : ℝ} + (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + (hsum : Summable (fun i => ∫ x, (h i x - 1) ^ 2 ∂μ i)) + (hC : (∑' i, ∫ x, (h i x - 1) ^ 2 ∂μ i) ≤ C) : + ∃ g : Lp ℝ 2 (Measure.infinitePi μ), + Tendsto (partialDensityLp hh) atTop (𝓝 g) ∧ ‖g‖ ≤ Real.exp (C / 2) := by + have hb : ∀ n, ‖partialDensityLp hh n‖ ≤ Real.exp (C / 2) := by + intro n + rw [partialDensityLp, Lp.norm_toLp] + have hnorm := eLpNorm_partial_product_le_exp_half_of_tsum_le + (Finset.range n) hh hmean hsum hC + have := ENNReal.toReal_mono (ENNReal.ofReal_ne_top) hnorm + simpa only [ENNReal.toReal_ofReal (Real.exp_pos _).le] using this + obtain ⟨g, hg⟩ := exists_limit_of_prefix_inner (partialDensityLp hh) + (fun n m hnm => partialDensityLp_inner hh hmean hnm) + ⟨(Real.exp (C / 2)) ^ 2, by + rintro _ ⟨n, rfl⟩ + exact pow_le_pow_left₀ (norm_nonneg _) (hb n) 2⟩ + exact ⟨g, hg, le_of_tendsto hg.norm (Filter.Eventually.of_forall hb)⟩ + +theorem tendsto_eLpNorm_one_partialDensity_sub + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ℕ) → Ω i → ℝ} (hh : ∀ i, MemLp (h i) 2 (μ i)) + {g : Lp ℝ 2 (Measure.infinitePi μ)} + (hg : Tendsto (partialDensityLp hh) atTop (𝓝 g)) : + Tendsto (fun n => eLpNorm + ((fun x => ∏ i ∈ Finset.range n, h i (x i)) - (g : ((i : ℕ) → Ω i) → ℝ)) + 1 (Measure.infinitePi μ)) atTop (𝓝 0) := by + have h2 : Tendsto (fun n => eLpNorm + ((fun x => ∏ i ∈ Finset.range n, h i (x i)) - (g : ((i : ℕ) → Ω i) → ℝ)) + 2 (Measure.infinitePi μ)) atTop (𝓝 0) := by + have ht := hg.edist (tendsto_const_nhds (x := g)) + simp only [edist_self] at ht + apply ht.congr + intro n + rw [Lp.edist_def] + apply eLpNorm_congr_ae + exact (memLp_partial_product (Finset.range n) hh).coeFn_toLp.sub Filter.EventuallyEq.rfl + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds h2 + (fun _ => bot_le) + intro n + exact eLpNorm_le_eLpNorm_of_exponent_le (by norm_num) + +theorem partialDensityLp_limit_nonneg + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ℕ) → Ω i → ℝ} (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hnonneg : ∀ i x, 0 ≤ h i x) + {g : Lp ℝ 2 (Measure.infinitePi μ)} + (hg : Tendsto (partialDensityLp hh) atTop (𝓝 g)) : + 0 ≤ᵐ[Measure.infinitePi μ] (g : ((i : ℕ) → Ω i) → ℝ) := by + apply ae_nonneg_of_forall_setIntegral_nonneg ((Lp.memLp g).integrable (by norm_num)) + intro s hs hsf + have hi := tendsto_setIntegral_of_L1' (g : ((i : ℕ) → Ω i) → ℝ) + (Filter.Eventually.of_forall fun n => + (memLp_partial_product (Finset.range n) hh).integrable (by norm_num)) + (tendsto_eLpNorm_one_partialDensity_sub hh hg) s + exact ge_of_tendsto hi (Filter.Eventually.of_forall fun n => + integral_nonneg fun x => Finset.prod_nonneg fun i _ => hnonneg i (x i)) + +theorem partialDensityLp_limit_integral + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ℕ) → Ω i → ℝ} (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + {g : Lp ℝ 2 (Measure.infinitePi μ)} + (hg : Tendsto (partialDensityLp hh) atTop (𝓝 g)) : + (∫ x, g x ∂Measure.infinitePi μ) = 1 := by + have hi := tendsto_integral_of_L1' (g : ((i : ℕ) → Ω i) → ℝ) + (Filter.Eventually.of_forall fun n => + (memLp_partial_product (Finset.range n) hh).integrable (by norm_num)) + (tendsto_eLpNorm_one_partialDensity_sub hh hg) + have heq : ∀ n, (∫ x, ∏ i ∈ Finset.range n, h i (x i) ∂Measure.infinitePi μ) = 1 := by + intro n + rw [integral_partial_product (Finset.range n) (fun i => (hh i).integrable (by norm_num))] + simp [hmean] + simp_rw [heq] at hi + exact tendsto_nhds_unique hi tendsto_const_nhds + +theorem partialDensityLp_limit_setIntegral_pi + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ℕ) → Ω i → ℝ} (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + {g : Lp ℝ 2 (Measure.infinitePi μ)} + (hg : Tendsto (partialDensityLp hh) atTop (𝓝 g)) + (s : Finset ℕ) (a : (i : ℕ) → Set (Ω i)) (ha : ∀ i, MeasurableSet (a i)) : + (∫ x in Set.pi (s : Set ℕ) a, g x ∂Measure.infinitePi μ) = + ∏ i ∈ s, ∫ x in a i, h i x ∂μ i := by + have hi := tendsto_setIntegral_of_L1' (g : ((i : ℕ) → Ω i) → ℝ) + (Filter.Eventually.of_forall fun n => + (memLp_partial_product (Finset.range n) hh).integrable (by norm_num)) + (tendsto_eLpNorm_one_partialDensity_sub hh hg) (Set.pi (s : Set ℕ) a) + obtain ⟨N, hN⟩ := Finset.exists_nat_subset_range s + have heq : (fun n => ∫ x in Set.pi (s : Set ℕ) a, + ∏ i ∈ Finset.range n, h i (x i) ∂Measure.infinitePi μ) =ᶠ[atTop] + (fun _ => ∏ i ∈ s, ∫ x in a i, h i x ∂μ i) := by + apply Filter.eventually_atTop.2 + refine ⟨N, fun n hn => ?_⟩ + exact setIntegral_partial_product_pi (hN.trans (Finset.range_mono hn)) + (fun i => (hh i).integrable (by norm_num)) hmean a ha + exact tendsto_nhds_unique hi (tendsto_const_nhds.congr' heq.symm) + +theorem isProbabilityMeasure_withDensity_ofReal + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} + {h : Ω → ℝ} (hh : Integrable h μ) (hnonneg : 0 ≤ᵐ[μ] h) + (hmean : ∫ x, h x ∂μ = 1) : + IsProbabilityMeasure (μ.withDensity (fun x => ENNReal.ofReal (h x))) := by + constructor + rw [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ, + ← ofReal_integral_eq_lintegral_ofReal hh hnonneg, hmean] + simp + +theorem partialDensityLp_limit_withDensity + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ℕ) → Ω i → ℝ} (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hnonneg : ∀ i x, 0 ≤ h i x) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + {g : Lp ℝ 2 (Measure.infinitePi μ)} + (hg : Tendsto (partialDensityLp hh) atTop (𝓝 g)) : + (Measure.infinitePi μ).withDensity (fun x => ENNReal.ofReal (g x)) = + Measure.infinitePi (fun i => (μ i).withDensity (fun x => ENNReal.ofReal (h i x))) := by + let : ∀ i, IsProbabilityMeasure ((μ i).withDensity (fun x => ENNReal.ofReal (h i x))) := + fun i => isProbabilityMeasure_withDensity_ofReal ((hh i).integrable (by norm_num)) + (Filter.Eventually.of_forall (hnonneg i)) (hmean i) + have hgnonneg := partialDensityLp_limit_nonneg hh hnonneg hg + have hgi := (Lp.memLp g).integrable (by norm_num : (1 : ℝ≥0∞) ≤ 2) + apply Measure.eq_infinitePi + intro s a ha + have hmeas : MeasurableSet (Set.pi (s : Set ℕ) a) := + MeasurableSet.pi s.countable_toSet (fun i _ => ha i) + rw [withDensity_apply _ hmeas, + ← ofReal_integral_eq_lintegral_ofReal hgi.restrict (ae_restrict_of_ae hgnonneg), + partialDensityLp_limit_setIntegral_pi hh hmean hg s a ha] + rw [ENNReal.ofReal_prod_of_nonneg (fun i _ => integral_nonneg (hnonneg i))] + apply Finset.prod_congr rfl + intro i hi + rw [withDensity_apply _ (ha i)] + exact ofReal_integral_eq_lintegral_ofReal ((hh i).integrable (by norm_num)).restrict + (Filter.Eventually.of_forall (hnonneg i)) + +theorem exists_product_density + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ℕ) → Ω i → ℝ} {C : ℝ} + (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hnonneg : ∀ i x, 0 ≤ h i x) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + (hsum : Summable (fun i => ∫ x, (h i x - 1) ^ 2 ∂μ i)) + (hC : (∑' i, ∫ x, (h i x - 1) ^ 2 ∂μ i) ≤ C) : + ∃ H : ((i : ℕ) → Ω i) → ℝ, + MemLp H 2 (Measure.infinitePi μ) ∧ + (0 ≤ᵐ[Measure.infinitePi μ] H) ∧ + (∫ x, H x ∂Measure.infinitePi μ) = 1 ∧ + eLpNorm H 2 (Measure.infinitePi μ) ≤ ENNReal.ofReal (Real.exp (C / 2)) ∧ + (Measure.infinitePi μ).withDensity (fun x => ENNReal.ofReal (H x)) = + Measure.infinitePi (fun i => (μ i).withDensity (fun x => ENNReal.ofReal (h i x))) := by + obtain ⟨g, hg, hgbound⟩ := exists_partialDensityLp_limit hh hmean hsum hC + refine ⟨g, Lp.memLp g, partialDensityLp_limit_nonneg hh hnonneg hg, + partialDensityLp_limit_integral hh hmean hg, ?_, + partialDensityLp_limit_withDensity hh hnonneg hmean hg⟩ + rw [← Lp.enorm_def, ← ofReal_norm] + exact ENNReal.ofReal_le_ofReal hgbound + +theorem norm_toLp_sq_eq_integral_sq + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} + {h : Ω → ℝ} (hh : MemLp h 2 μ) : + ‖hh.toLp h‖ ^ 2 = ∫ x, h x ^ 2 ∂μ := by + rw [← real_inner_self_eq_norm_sq, inner_toLp_eq_integral_mul] + congr 1 + funext x + ring + +theorem centered_eLpNorm_sq_eq_integral + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {h : Ω → ℝ} (hh : MemLp h 2 μ) : + (eLpNorm (fun x => h x - 1) 2 μ).toReal ^ 2 = ∫ x, (h x - 1) ^ 2 ∂μ := by + have hc : MemLp (fun x => h x - 1) 2 μ := hh.sub (memLp_const (1 : ℝ)) + calc + _ = ‖hc.toLp (fun x => h x - 1)‖ ^ 2 := by rw [Lp.norm_toLp] + _ = _ := norm_toLp_sq_eq_integral_sq hc + +theorem exists_product_density_of_norm + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ℕ) → Ω i → ℝ} {C : ℝ} + (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hnonneg : ∀ i x, 0 ≤ h i x) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + (hsum : Summable (fun i => (eLpNorm (fun x => h i x - 1) 2 (μ i)).toReal ^ 2)) + (hC : (∑' i, (eLpNorm (fun x => h i x - 1) 2 (μ i)).toReal ^ 2) ≤ C) : + ∃ H : ((i : ℕ) → Ω i) → ℝ, + MemLp H 2 (Measure.infinitePi μ) ∧ + (0 ≤ᵐ[Measure.infinitePi μ] H) ∧ + (∫ x, H x ∂Measure.infinitePi μ) = 1 ∧ + eLpNorm H 2 (Measure.infinitePi μ) ≤ ENNReal.ofReal (Real.exp (C / 2)) ∧ + (Measure.infinitePi μ).withDensity (fun x => ENNReal.ofReal (H x)) = + Measure.infinitePi (fun i => (μ i).withDensity (fun x => ENNReal.ofReal (h i x))) := by + apply exists_product_density hh hnonneg hmean + · simpa only [centered_eLpNorm_sq_eq_integral (hh _)] using hsum + · simpa only [centered_eLpNorm_sq_eq_integral (hh _)] using hC + +theorem exists_hybrid_product_density + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : Bool → (i : ℕ) → Ω i → ℝ} {b : ℕ → ℝ} {C : ℝ} + (ε : ℕ → Bool) + (hh : ∀ a i, MemLp (h a i) 2 (μ i)) + (hnonneg : ∀ a i x, 0 ≤ h a i x) + (hmean : ∀ a i, ∫ x, h a i x ∂μ i = 1) + (hb : ∀ a i, (∫ x, (h a i x - 1) ^ 2 ∂μ i) ≤ b i) + (hsum : Summable b) (hC : (∑' i, b i) ≤ C) : + ∃ H : ((i : ℕ) → Ω i) → ℝ, + MemLp H 2 (Measure.infinitePi μ) ∧ + (0 ≤ᵐ[Measure.infinitePi μ] H) ∧ + (∫ x, H x ∂Measure.infinitePi μ) = 1 ∧ + eLpNorm H 2 (Measure.infinitePi μ) ≤ ENNReal.ofReal (Real.exp (C / 2)) ∧ + (Measure.infinitePi μ).withDensity (fun x => ENNReal.ofReal (H x)) = + Measure.infinitePi (fun i => (μ i).withDensity (fun x => ENNReal.ofReal (h (ε i) i x))) := by + have hsel : Summable (fun i => ∫ x, (h (ε i) i x - 1) ^ 2 ∂μ i) := + Summable.of_nonneg_of_le (fun i => integral_nonneg fun x => sq_nonneg _) + (fun i => hb (ε i) i) hsum + exact exists_product_density (fun i => hh (ε i) i) + (fun i => hnonneg (ε i) i) (fun i => hmean (ε i) i) hsel + ((hsel.tsum_le_tsum (fun i => hb (ε i) i) hsum).trans hC) + +end Invariant233.ProductDensity + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductPairIdentity.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductPairIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc75407235c9aa4564f763e5aa33c0b8e213f899 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductPairIdentity.lean @@ -0,0 +1,33 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductOrbitPair +import OAI.Analysis.IrrationalRotation.Product.ProductPairTransfer + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.ProductModel + +theorem exists_covariantProjectionField_pairIdentity + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) (hsampling : HasAllFiniteCoordinateSampling θ) + (p : Hilbert →L[ℂ] Hilbert) (hpM : p ∈ factor θ) (hp : IsStarProjection p) + (hinv : (1 - p) * weightedOperator θ c * p = 0) : + ∃ F : Base → Fiber →L[ℂ] Fiber, + IsCovariantFieldRepresentation θ p F 1 ∧ + (∀ x, IsStarProjection (F x)) ∧ + ∀ I : Finset ℕ, ∀ᵐ xy ∂triangularLaw I, PairIdentity θ c F xy := by + obtain ⟨F, hF, hproj⟩ := exists_covariantProjectionField hpM hp + refine ⟨F, hF, hproj, ?_⟩ + intro I + apply pairIdentity_of_orderedOrbitSampling θ c hθ0 hθ hc F hproj hF.2.2.1 + _ I (hsampling I) + intro n _hn + exact (ae_orbit_pair_identity θ c hθ0 hc hθ p hpM F hproj hF.2.2.2.1 hinv n).mono + (fun _ hx _ => hx) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductPrefixConditionalLaw.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductPrefixConditionalLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..933a5688b16ee7aea5a98bfa1f0a6eeb4e2c1409 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductPrefixConditionalLaw.lean @@ -0,0 +1,171 @@ +import OAI.Analysis.IrrationalRotation.Sampling.ProductPrefixDomination +import OAI.Analysis.IrrationalRotation.Sampling.ProductPrefixConditioning + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal + +namespace Invariant233.ProductCoordinateSplit + +variable {ι : Type*} {X : ι → Type*} [∀ i, MeasurableSpace (X i)] + +theorem map_split_cond_prefix + (μ : (i : ι) → Measure (X i)) [∀ i, IsProbabilityMeasure (μ i)] + (p : ι → Prop) [DecidablePred p] + (s : Set ((i : Subtype p) → X i)) (hs : MeasurableSet s) : + (cond (Measure.infinitePi μ) + ((fun x (i : Subtype p) => x i) ⁻¹' s)).map + (MeasurableEquiv.piEquivPiSubtypeProd X p) = + (cond (Measure.infinitePi (fun i : Subtype p => μ i)) s).prod + (Measure.infinitePi (fun i : {i // ¬p i} => μ i)) := by + let e := MeasurableEquiv.piEquivPiSubtypeProd X p + have he := measurePreserving_split μ p + have hpre : (fun x (i : Subtype p) => x i) ⁻¹' s = + e ⁻¹' (s ×ˢ (Set.univ : Set ((i : {i // ¬p i}) → X i))) := by + ext x + simp [e, MeasurableEquiv.piEquivPiSubtypeProd, Equiv.piEquivPiSubtypeProd] + have hprefix : MeasurePreserving (fun x (i : Subtype p) => x i) + (Measure.infinitePi μ) (Measure.infinitePi fun i : Subtype p => μ i) := + measurePreserving_fst.comp he + have hmass : Measure.infinitePi μ ((fun x (i : Subtype p) => x i) ⁻¹' s) = + Measure.infinitePi (fun i : Subtype p => μ i) s := + hprefix.measure_preimage hs.nullMeasurableSet + change (cond (Measure.infinitePi μ) _).map e = _ + rw [ProbabilityTheory.cond, Measure.map_smul _ e.measurable.aemeasurable, hmass, hpre, + ← Measure.restrict_map e.measurable (hs.prod MeasurableSet.univ), he.map_eq, + ← Measure.prod_restrict, Measure.restrict_univ, ProbabilityTheory.cond, Measure.prod_smul_left] + +end Invariant233.ProductCoordinateSplit + +namespace Invariant233.OrderedProductCoupling + +theorem prefix_payload_cond_map (P : Parameters) (D : ℕ) + (s : Set (PrefixIndex D → CoordinateSample)) (hs : MeasurableSet s) : + (cond (law P) ((fun ω (i : PrefixIndex D) => ω i) ⁻¹' s)).map + (fun ω => ((fun i : PrefixIndex D => (ω i).2), + (fun i : TailIndex D => (ω i).2.1))) = + ((cond (Measure.infinitePi (fun i : PrefixIndex D => coordinateLaw P i)) s).map + (fun ω (i : PrefixIndex D) => (ω i).2)).prod (leftTailLaw P D) := by + let e := MeasurableEquiv.piEquivPiSubtypeProd (fun _ : ℕ => CoordinateSample) + (fun i => i ∈ Finset.range D) + let f : (PrefixIndex D → CoordinateSample) → PrefixPairs D := fun ω i => (ω i).2 + let g : (TailIndex D → CoordinateSample) → TailValues D := fun ω i => (ω i).2.1 + have hf : Measurable f := by fun_prop + have hg : Measurable g := by fun_prop + have he : (cond (law P) ((fun ω (i : PrefixIndex D) => ω i) ⁻¹' s)).map e = + (cond (Measure.infinitePi (fun i : PrefixIndex D => coordinateLaw P i)) s).prod + (Measure.infinitePi (fun i : TailIndex D => coordinateLaw P i)) := + ProductCoordinateSplit.map_split_cond_prefix (coordinateLaw P) + (fun i => i ∈ Finset.range D) s hs + have ht : (Measure.infinitePi (fun i : TailIndex D => coordinateLaw P i)).map g = + leftTailLaw P D := + Measure.infinitePi_map_pi _ (fun _ => measurable_snd.fst) + change (cond (law P) _).map ((Prod.map f g) ∘ e) = _ + rw [← Measure.map_map (hf.prodMap hg) e.measurable, he, + ← Measure.map_prod_map _ _ hf hg, ht] + +theorem prefixPairLaw_cond_factorization (P : Parameters) (D : ℕ) + (s : Set (PrefixIndex D → CoordinateSample)) (hs : MeasurableSet s) : + (cond (law P) ((fun ω (i : PrefixIndex D) => ω i) ⁻¹' s)).map + (fun ω => (leftEndpoint ω, + hybridEndpoint (fun i => decide (i ∈ Finset.range D)) ω)) = + (((cond (Measure.infinitePi (fun i : PrefixIndex D => coordinateLaw P i)) s).map + (fun ω (i : PrefixIndex D) => (ω i).2)).prod + (leftTailLaw P D)).map (assemblePrefixPair D) := by + rw [← prefix_payload_cond_map P D s hs, + Measure.map_map (assemblePrefixPair_measurable D) (by fun_prop)] + congr 1 + funext ω + apply Prod.ext <;> funext i + all_goals + by_cases hi : i ∈ Finset.range D + · simp_all [assemblePrefixPair, hybridEndpoint, leftEndpoint, rightEndpoint, + Finset.mem_range] + · simp_all [assemblePrefixPair, hybridEndpoint, leftEndpoint, rightEndpoint, + Finset.mem_range] + +theorem prefixPairLaw_cond_absolutelyContinuous (P : Parameters) + (hsum : Summable (energyBound P)) (D : ℕ) (s : Set Sample) : + (cond (law P) s).map (fun ω => (leftEndpoint ω, + hybridEndpoint (fun i => decide (i ∈ Finset.range D)) ω)) ≪ + prefixReferencePairLaw D := by + have h := (cond_absolutelyContinuous (μ := law P) (s := s)).map + (leftEndpoint_measurable.prodMk + (hybridEndpoint_measurable (fun i => decide (i ∈ Finset.range D)))) + exact h.trans (prefixPairLaw_absolutelyContinuous P hsum D) + +end Invariant233.OrderedProductCoupling + +namespace Invariant233.ProductCoordinateSplit + +theorem cond_fintype_pi {ι : Type*} {X : ι → Type*} [Fintype ι] + [∀ i, MeasurableSpace (X i)] + (μ : (i : ι) → Measure (X i)) [∀ i, IsFiniteMeasure (μ i)] + (s : (i : ι) → Set (X i)) : + cond (Measure.pi μ) (Set.univ.pi s) = + Measure.pi (fun i => cond (μ i) (s i)) := by + classical + symm + apply Measure.pi_eq + intro t ht + simp only [ProbabilityTheory.cond, Measure.smul_apply, smul_eq_mul] + rw [Measure.restrict_apply (MeasurableSet.univ_pi ht), + ← Set.pi_inter_distrib, Measure.pi_pi, Measure.pi_pi] + simp_rw [Measure.restrict_apply (ht _)] + rw [Finset.prod_mul_distrib] + congr 1 + exact (ENNReal.prod_inv_distrib (fun i hi j hj hij => Or.inr (measure_ne_top (μ j) (s j)))) + +end Invariant233.ProductCoordinateSplit + +namespace Invariant233.OrderedProductCoupling + +theorem prefix_label_cond_eq_pi (P : Parameters) (D : ℕ) + (c : PrefixIndex D → Option (Fin 5)) : + cond (Measure.infinitePi (fun i : PrefixIndex D => coordinateLaw P i)) + {ω | ∀ i, (ω i).1 = c i} = + Measure.pi (fun i : PrefixIndex D => cond (coordinateLaw P i) {z | z.1 = c i}) := by + rw [Measure.infinitePi_eq_pi] + have hset : {ω : PrefixIndex D → CoordinateSample | ∀ i, (ω i).1 = c i} = + Set.univ.pi (fun i : PrefixIndex D => {z : CoordinateSample | z.1 = c i}) := by + ext ω + simp + rw [hset] + exact ProductCoordinateSplit.cond_fintype_pi + (fun i : PrefixIndex D => coordinateLaw P i) (fun i => {z | z.1 = c i}) + +end Invariant233.OrderedProductCoupling + +namespace Invariant233.OrderedProductCoupling + +theorem prefix_label_pair_factorization (P : Parameters) (D : ℕ) + (c : PrefixIndex D → Option (Fin 5)) : + (cond (law P) {ω | ∀ i : PrefixIndex D, (ω i).1 = c i}).map + (fun ω => (leftEndpoint ω, + hybridEndpoint (fun i => decide (i ∈ Finset.range D)) ω)) = + ((Measure.pi (fun i : PrefixIndex D => + (cond (coordinateLaw P i) {z | z.1 = c i}).map Prod.snd)).prod + (leftTailLaw P D)).map (assemblePrefixPair D) := by + have hs : MeasurableSet {ω : PrefixIndex D → CoordinateSample | + ∀ i, (ω i).1 = c i} := by + simp only [Set.ofPred_forall] + exact MeasurableSet.iInter fun i => + (measurable_fst.comp (measurable_pi_apply i)) (measurableSet_singleton (c i)) + have h := prefixPairLaw_cond_factorization P D _ hs + rw [prefix_label_cond_eq_pi] at h + have : ∀ i : PrefixIndex D, IsFiniteMeasure + ((cond (coordinateLaw P i) {z | z.1 = c i}).map + (Prod.snd : CoordinateSample → ℝ × ℝ)) := fun _ => inferInstance + rw [Measure.pi_map_pi (X := fun _ : PrefixIndex D => CoordinateSample) + (Y := fun _ : PrefixIndex D => ℝ × ℝ) (μ := fun i : PrefixIndex D => + cond (coordinateLaw P i) {z | z.1 = c i}) + (f := fun _ => Prod.snd) (hμ := fun i => inferInstance) (fun _ => measurable_snd.aemeasurable)] at h + exact h + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductSourceConditionalData.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductSourceConditionalData.lean new file mode 100644 index 0000000000000000000000000000000000000000..50603b55b7f0a541939dbe177ff640d6951fa8ce --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/ProductSourceConditionalData.lean @@ -0,0 +1,116 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalData +import OAI.Analysis.IrrationalRotation.Analysis.BlockedSourceTransport + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal Topology + +namespace Invariant233.ProductModel +open OrderedProductCoupling +open InvariantProjection.ConditionalConvolution + +abbrev actualSourceParameters {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) (j : ℕ) : Parameters := + sourceBlocks p.m p.a p.b hp.m_ge_100 + (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j + +theorem actualSourcePair_marginals_ac {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) (j : ℕ) : + (circlePairLaw (actualSourceParameters hp e j)).map Prod.fst ≪ baseMeasure ∧ + (circlePairLaw (actualSourceParameters hp e j)).map Prod.snd ≪ baseMeasure := by + let P := actualSourceParameters hp e j + have hac (side : Bool) : (law P).map (circleHybridEndpoint (fun _ => side)) ≪ baseMeasure := by + obtain ⟨g, _, _, _, _, hg⟩ := exists_source_circle_hybrid_density p.m p.a p.b + hp.m_ge_100 (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j (fun _ => side) + change (law P).map (circleHybridEndpoint (fun _ => side)) = _ at hg + rw [hg] + exact withDensity_absolutelyContinuous _ _ + have hm : Measurable (fun ω : Sample => (circleLeftEndpoint ω, circleRightEndpoint ω)) := + circleLeftEndpoint_measurable.prodMk circleRightEndpoint_measurable + constructor + · change ((law P).map _).map Prod.fst ≪ baseMeasure + rw [Measure.map_map measurable_fst hm] + exact hac false + · change ((law P).map _).map Prod.snd ≪ baseMeasure + rw [Measure.map_map measurable_snd hm] + exact hac true + +theorem eventually_actualSource_conditionalData + {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) + (he : ∀ a : Σ s, Fin (p.m s), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) + (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθsum : Summable θ) + (hphase : ∀ i, θ i ∈ Set.Icc (1 / p.N (e i).1) (2 / p.N (e i).1)) + (A : Hilbert →L[ℂ] Hilbert) (F : Base → Fiber →L[ℂ] Fiber) + (hF : IsCovariantFieldRepresentation θ A F 1) + (hproj : ∀ x, IsStarProjection (F x)) + (hinv : (1 - A) * weightedOperator θ (fun i => p.C (e i).1) * A = 0) + (hdiag : ∀ᵐ x ∂baseMeasure, + 0 < BlockedProductCoupling.projectionDiagonal F x ∧ + BlockedProductCoupling.projectionDiagonal F x < 1) + (hpair : ∀ j, ∀ᵐ xy ∂circlePairLaw (actualSourceParameters hp e j), + PairIdentity θ (fun i => p.C (e i).1) F xy) + (htail : ∀ᶠ j in atTop, + SourceTailEstimate p e θ j (actualSourceParameters hp e j)) : + ∀ᶠ j in atTop, + Nonempty (Data Sample (law (actualSourceParameters hp e j)) + (p.K j) (p.coefficientBound j) (1 / ((j + 1 : ℕ) : ℝ)) + (Real.exp (-82) / 2) (Real.exp (-p.L j)) (Real.exp (-p.L j / 400))) := by + have hr : Measurable (BlockedProductCoupling.projectionDiagonal F) := by + exact Complex.measurable_re.comp + ((lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 0).continuous.measurable.comp (hF.2.2.1 _).measurable) + have hmass := BlockedProductCoupling.eventually_flatSourceEvent_mass hp e hr hdiag + filter_upwards [hmass, htail] with j hj ht + let E := BlockedProductCoupling.flatSourceEvent p e (BlockedProductCoupling.projectionDiagonal F) j + have hE : MeasurableSet E := BlockedProductCoupling.measurable_flatSourceEvent p e hr j + have hb := BlockedProductCoupling.ae_flatSourceEvent_coefficient_properties hp e θ hphase F + (Filter.Eventually.of_forall hproj) j + have htag := BlockedProductCoupling.ae_flatSourceEvent_tag_endpoints hp e he + (BlockedProductCoupling.projectionDiagonal F) j + have hmem : ∀ᵐ ω ∂(law (actualSourceParameters hp e j)).restrict E, ω ∈ E := + ae_restrict_mem hE + apply conditionalData_of_sourceTail hp e θ hθ0 hθsum (actualSourceParameters hp e j) j A F hF hproj hinv + (actualSourcePair_marginals_ac hp e j).1 (actualSourcePair_marginals_ac hp e j).2 + (hpair j) ht E hE (Real.exp (-82) / 2) hj + · filter_upwards [ae_restrict_of_ae hb, hmem] with ω hω hωE + simpa only [BlockedProductCoupling.sourceCoefficientA, BlockedProductCoupling.sourceCoefficientB, + BlockedProductCoupling.circleLeftEndpoint_unflatten, + BlockedProductCoupling.circleRightEndpoint_unflatten, + coeffA, coeffB, sourceLeftVector, sourceRightVector, sourceLeftCocycle, + sourceRightCocycle, sourceUnitVector, BlockedProductCoupling.sourceBasisZero] using hω hωE + · filter_upwards [ae_restrict_of_ae htag, hmem] with ω hω hωE + exact hω hωE + +theorem actualSource_projection_contradiction + {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) + (he : ∀ a : Σ s, Fin (p.m s), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) + (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθsum : Summable θ) + (hphase : ∀ i, θ i ∈ Set.Icc (1 / p.N (e i).1) (2 / p.N (e i).1)) + (A : Hilbert →L[ℂ] Hilbert) (F : Base → Fiber →L[ℂ] Fiber) + (hF : IsCovariantFieldRepresentation θ A F 1) + (hproj : ∀ x, IsStarProjection (F x)) + (hinv : (1 - A) * weightedOperator θ (fun i => p.C (e i).1) * A = 0) + (hdiag : ∀ᵐ x ∂baseMeasure, + 0 < BlockedProductCoupling.projectionDiagonal F x ∧ + BlockedProductCoupling.projectionDiagonal F x < 1) + (hpair : ∀ j, ∀ᵐ xy ∂circlePairLaw (actualSourceParameters hp e j), + PairIdentity θ (fun i => p.C (e i).1) F xy) + (htail : ∀ᶠ j in atTop, + SourceTailEstimate p e θ j (actualSourceParameters hp e j)) : False := by + apply hp.not_eventually_conditional_data + (fun j => law (actualSourceParameters hp e j)) (Real.exp (-82) / 2) (by positivity) + exact eventually_actualSource_conditionalData hp e he θ hθ0 hθsum hphase A F + hF hproj hinv hdiag hpair htail + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Couplings/SourceCouplingMarginals.lean b/lean/OAI/Analysis/IrrationalRotation/Couplings/SourceCouplingMarginals.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc70f8a529e43d82a47d7d6bfdd314dde3f8c336 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Couplings/SourceCouplingMarginals.lean @@ -0,0 +1,58 @@ +import OAI.Analysis.IrrationalRotation.Model.SourceCouplingMarginals +import OAI.Analysis.IrrationalRotation.Couplings.ProductCouplingCircleSource +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalCrossing + +namespace OAI + +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal + +namespace Invariant233.OrderedProductCoupling +open OneCoordinateCoupling + +theorem source_coupling_marginals + (m : ℕ → ℕ) (a b : ℕ → ℝ) (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) (tag : ℕ) : + SourceMarginalProperties (sourceBlocks m a b hm ha ha' hb hb' e tag) + (blockDensityBound sourceKappa) := by + let P := sourceBlocks m a b hm ha ha' hb hb' e tag + change SourceMarginalProperties P _ + refine { + law_probability := law_isProbabilityMeasure P + H_positive := blockDensityBound_pos sourceKappa + probability := circlePairLaw_probability P + ordered := circlePairLaw_ordered P + representatives := ae_real_circle_endpoints P + coordinate_densities := ?_ + coordinate_bound := ?_ + hybrid_densities := ?_ + hybrid_mass_bound := ?_ + right_kernel := right_condDistrib_eq_product P + left_kernel := left_condDistrib_eq_product P + right_independent := right_coordinates_conditionally_independent P + left_independent := left_coordinates_conditionally_independent P + right_crossing := right_condDistrib_crossing_real_lower P + left_crossing := left_condDistrib_crossing_real_lower P } + · intro side i + cases side + · exact coordinateLaw_map_left P i + · exact coordinateLaw_map_right P i + · intro side i x + refine ⟨marginalDensity_nonneg P side i x, ?_⟩ + cases side + · exact (leftMarginalDensity_bounds (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) x).2.2.le + · exact (rightMarginalDensity_bounds (P.κ_nonneg i) (P.κ_le i) (P.m_ge i) + (P.a_lower i) (P.a_upper i) (P.b_lower i) (P.b_upper i) + (P.t_nonneg i) (P.t_le i) x).2.2.le + · intro ε + exact exists_source_circle_hybrid_density m a b hm ha ha' hb hb' e tag ε + · intro ε A hA + exact source_circle_hybrid_measureReal_le_sqrt m a b hm ha ha' hb hb' e tag ε A hA + +end Invariant233.OrderedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Main.lean b/lean/OAI/Analysis/IrrationalRotation/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7d8ade8845cf4574633be176fc4b800dcf6f611 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Main.lean @@ -0,0 +1,677 @@ +import Mathlib +import OAI.Analysis.IrrationalRotation.PrescribedAngle +import OAI.Analysis.IrrationalRotation.Sampling.ProductSourceSamplingFinal +import OAI.Analysis.IrrationalRotation.Product.ProductRealizationAssembly +import OAI.Analysis.IrrationalRotation.Rotation.RotationHyperfinite +import OAI.Analysis.IrrationalRotation.Rotation.RotationFactorStructure +import OAI.Analysis.IrrationalRotation.Rotation.CircleTruncationBound +import OAI.Analysis.IrrationalRotation.Rotation.CircleOrderedTransfer +import OAI.Analysis.IrrationalRotation.Product.ProductFactorComplete +import OAI.Analysis.IrrationalRotation.Sampling.CircleDigitMarginalLaws +import OAI.Analysis.IrrationalRotation.Rotation.CircleTailAttenuation +import OAI.Analysis.IrrationalRotation.Couplings.CircleConditionalLabels +import OAI.Analysis.IrrationalRotation.Couplings.SourceCouplingMarginals +import OAI.Analysis.IrrationalRotation.Rotation.CircleParametersExistence +import OAI.Analysis.IrrationalRotation.Operators.FullAffiliatedTransport +import OAI.Analysis.IrrationalRotation.Analysis.OrdinaryTailNonmembership +import OAI.Analysis.IrrationalRotation.Rotation.PositiveDiagonalAlgebra +import OAI.Analysis.IrrationalRotation.Sampling.ScalarSamplingSeparated +import OAI.Analysis.IrrationalRotation.Spectral.ProductPolarComplete +import OAI.Analysis.IrrationalRotation.Analysis.RationalGraphs +import OAI.Analysis.IrrationalRotation.Operators.OperatorCompactTransfer +import OAI.Analysis.IrrationalRotation.Sampling.LargePhaseAssembly +import OAI.Analysis.IrrationalRotation.Spectral.ProductSpectralBundle +import OAI.Analysis.IrrationalRotation.Spectral.RotationDeterminant +import OAI.Analysis.IrrationalRotation.Analysis.TriangularLawProperties +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplierFields +import OAI.Analysis.IrrationalRotation.Model.Analytic +import OAI.Analysis.IrrationalRotation.Operators.CommutantProper +import OAI.Analysis.IrrationalRotation.Operators.HyperinvariantProjection +import OAI.Analysis.IrrationalRotation.Operators.CommutantAlgebra +import OAI.Analysis.IrrationalRotation.Analysis.FiniteConvolution +import OAI.Analysis.IrrationalRotation.Rotation.UniformRotationAverage +import OAI.Analysis.IrrationalRotation.Couplings.ProductDensityLimit +import OAI.Analysis.IrrationalRotation.Couplings.ConditionalConvolution +import OAI.Analysis.IrrationalRotation.Rotation.CircleMeasurableObstruction +import OAI.Analysis.IrrationalRotation.Analysis.ContinuousCounterexampleAssembly +import OAI.Analysis.IrrationalRotation.Operators.HilbertConsequence +import OAI.Analysis.IrrationalRotation.Model.Conjugation +import OAI.Analysis.IrrationalRotation.Analysis.ChoKoLeeCompleteComparison +import OAI.Analysis.IrrationalRotation.Couplings.ProductBiasedIdentity +import OAI.Analysis.IrrationalRotation.Couplings.ProductPairIdentity + +namespace OAI + +/-! Irrational rotation counterexamples, product realizations, and transitive commutants. -/ + +noncomputable section +open Filter MeasureTheory +open scoped Topology BigOperators +namespace Invariant233.Results + +theorem rotation_hyperfinite (θ : ℝ) + (_hθ0 : 0 < θ) (_hθ1 : θ < 1) (hθ : Irrational θ) : + IsHyperfinite (Rotation.algebra θ) := by + exact Rotation.isHyperfinite_algebra hθ + +theorem circle_parameters_exist (θ : ℝ) + (_hθ0 : 0 < θ) (_hθ1 : θ < 1) (hθ : Irrational θ) : + ∃ p : CircleParameterData, CircleParameterLaws θ p := + Invariant233.exists_circle_parameters hθ + +section Operators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem commutant_properness (T : H →L[ℂ] H) + (hT : ¬ ∃ c : ℂ, T = c • (1 : H →L[ℂ] H)) : + Subalgebra.centralizer ℂ ({T} : Set (H →L[ℂ] H)) ≠ ⊤ := + Invariant233.centralizer_singleton_ne_top_of_nonscalar T hT + +theorem commutant_affine_shift (T : H →L[ℂ] H) : + Subalgebra.centralizer ℂ ({1 + T} : Set (H →L[ℂ] H)) = + Subalgebra.centralizer ℂ ({T} : Set (H →L[ℂ] H)) := + Invariant233.centralizer_singleton_one_add T + +theorem commutant_algebra (T : H →L[ℂ] H) + (hT : ¬ ∃ c : ℂ, T = c • (1 : H →L[ℂ] H)) : + operatorCommutant T ≠ ⊤ ∧ IsStronglyClosed (operatorCommutant T) ∧ + (IsTransitive (operatorCommutant T) ↔ HasNoNontrivialHyperinvariantSubspace T) := + Invariant233.commutant_algebra_properties T hT + +variable [CompleteSpace H] + +theorem hyperinvariant_projection_mem + (M : VonNeumannAlgebra H) {T p : H →L[ℂ] H} + (hT : T ∈ M) (hp : IsStarProjection p) + (hhyper : ∀ A : H →L[ℂ] H, Commute A T → + p.range ∈ Module.End.invtSubmodule A) : + p ∈ M ∧ (1 - p) * T * p = 0 := + Invariant233.hyperinvariant_projection_mem M hT hp hhyper + +end Operators + +theorem finite_convolution_uniform_lower_bound (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) : + ∃ ε > 0, ∀ a b : InvariantProjection.FiniteConvolution.Coefficients K, + (∀ i, ‖a i‖ ≤ D) → (∀ i, ‖b i‖ ≤ D) → + δ ≤ ‖a (InvariantProjection.FiniteConvolution.center K)‖ → + δ ≤ ‖b (InvariantProjection.FiniteConvolution.center K)‖ → + ∃ n : Fin (2 * K + 1), + ε ≤ ‖InvariantProjection.FiniteConvolution.lowProduct a b n‖ := + InvariantProjection.FiniteConvolution.uniform_lower_bound K D δ hδ + +theorem uniform_irrational_rotation_average {θ : ℝ} (hθ : Irrational θ) + (f : C(Circle, ℝ)) : + TendstoUniformly + (fun n x => birkhoffAverage ℝ (fun y : Circle => y + (θ : Circle)) f n x) + (fun _ => ∫ x, f x ∂AddCircle.haarAddCircle) atTop := + InvariantProjection.UniformRotationAverage.tendstoUniformly_real hθ f + +end Invariant233.Results + +namespace Invariant233 + +theorem product_density_bound + {Ω : ℕ → Type*} [∀ i, MeasurableSpace (Ω i)] + {μ : (i : ℕ) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)] + {h : (i : ℕ) → Ω i → ℝ} {C : ℝ} + (hh : ∀ i, MemLp (h i) 2 (μ i)) + (hnonneg : ∀ i x, 0 ≤ h i x) + (hmean : ∀ i, ∫ x, h i x ∂μ i = 1) + (hsum : Summable (fun i => (eLpNorm (fun x => h i x - 1) 2 (μ i)).toReal ^ 2)) + (hC : (∑' i, (eLpNorm (fun x => h i x - 1) 2 (μ i)).toReal ^ 2) ≤ C) : + ∃ H : ((i : ℕ) → Ω i) → ℝ, + MemLp H 2 (Measure.infinitePi μ) ∧ + (0 ≤ᵐ[Measure.infinitePi μ] H) ∧ + (∫ x, H x ∂Measure.infinitePi μ) = 1 ∧ + eLpNorm H 2 (Measure.infinitePi μ) ≤ ENNReal.ofReal (Real.exp (C / 2)) ∧ + (Measure.infinitePi μ).withDensity (fun x => ENNReal.ofReal (H x)) = + Measure.infinitePi (fun i => (μ i).withDensity (fun x => ENNReal.ofReal (h i x))) := + ProductDensity.exists_product_density_of_norm hh hnonneg hmean hsum hC + +end Invariant233 + +namespace Invariant233 + +theorem conditional_convolution + (K : ℕ) (D a : ℝ) (ha : 0 < a) : + ∃ ε > 0, ∀ {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + [IsProbabilityMeasure μ] (c η δ : ℝ), + 0 ≤ η → 0 ≤ δ → ∀ _ : InvariantProjection.ConditionalConvolution.Data Ω μ K D a c η δ, + c * ε ≤ ((2 * K + 1 : ℕ) : ℝ) * (η + 2 * Real.sqrt δ) := + InvariantProjection.ConditionalConvolution.conditional_convolution_obstruction K D a ha + +end Invariant233 + +namespace Invariant233 +open scoped ENNReal + +theorem scalar_multiplier_fields + {X E ι : Type*} [MeasurableSpace X] {μ : Measure X} [IsFiniteMeasure μ] + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] [Countable ι] + (b : HilbertBasis ι ℂ E) + (A : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (hA : ∀ g : Lp ℂ ∞ μ, Commute A (L2Multiplication.multiplier g)) : + ∃ F : X → E →L[ℂ] E, + (∀ x, ‖F x‖ ≤ ‖A‖) ∧ + (∀ v : E, StronglyMeasurable fun x => F x v) ∧ + (∀ f : Lp E 2 μ, A f =ᵐ[μ] fun x => F x (f x)) ∧ + (∀ G : X → E →L[ℂ] E, + (∀ f : Lp E 2 μ, A f =ᵐ[μ] fun x => G x (f x)) → F =ᵐ[μ] G) ∧ + (∀ f : Lp E 2 μ, A.adjoint f =ᵐ[μ] fun x => (F x).adjoint (f x)) ∧ + (∀ (B : Lp E 2 μ →L[ℂ] Lp E 2 μ) (G : X → E →L[ℂ] E), + (∀ f : Lp E 2 μ, B f =ᵐ[μ] fun x => G x (f x)) → + ∀ f : Lp E 2 μ, (A * B) f =ᵐ[μ] fun x => (F x * G x) (f x)) ∧ + (IsStarProjection A → ∀ᵐ x ∂μ, IsStarProjection (F x)) := + L2Multiplication.scalar_multiplier_fields_complete b A hA + +end Invariant233 + +namespace Invariant233 + +theorem rational_graphs {θ : ℝ} {p : CircleParameterData} + (hp : CircleParameterLaws θ p) + {P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert} + (hmem : P ∈ Rotation.algebra θ) (hP : IsStarProjection P) + (hT : (1 - P) * p.measurableOperator θ hp * P = 0) : + ∃ F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber, + (∀ x, IsStarProjection (F x)) ∧ + (∀ x, ‖F x‖ ≤ ‖P‖) ∧ + (∀ v : Rotation.Fiber, StronglyMeasurable fun x => F x v) ∧ + (∀ ξ : Rotation.Hilbert, P ξ =ᵐ[circleMeasure] fun x => F x (ξ x)) ∧ + p.RationalGraphIdentities θ F := by + exact hp.exists_rational_graph_field hmem hP hT + +end Invariant233 + +namespace Invariant233.Results + +theorem continuous_counterexample_quasinilpotent (θ : ℝ) (hθ : Irrational θ) + (f : C(Circle, ℝ)) (hf : IsContinuousCircleWeight f) : + Rotation.weightedReal θ f ≠ 0 ∧ NormQuasinilpotent (Rotation.weightedReal θ f) ∧ + vectorFugledeKadisonDeterminant Rotation.vacuum (Rotation.weightedReal θ f) = 0 := + Rotation.continuous_weight_spectral_bundle θ hθ f hf + +theorem product_triangular_law_properties (I : Finset ℕ) : + ProductModel.TriangularLawProperties I := + ProductModel.triangularLaw_properties I + +end Invariant233.Results + +namespace Invariant233 +open scoped ENNReal BigOperators + +theorem product_quasinilpotent + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) + (K C : ℕ → ℝ) (hK : ∀ j, 1 ≤ K j) (hC : ∀ j, K j ^ 2 ≤ C j) + (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ) + (hθ01 : ∀ i, θ i ∈ Set.Ico (0 : ℝ) 1) (hθsum : Summable θ) + (hθlower : ∀ i, 1 / ((m (e i).1 : ℝ) * K (e i).1) ≤ θ i) : + let c : ℕ → ℝ := fun i => C (e i).1 + HasNegInfiniteLogIntegral ProductModel.baseMeasure (ProductModel.weight θ c) ∧ + ProductModel.weightedOperator θ c ∈ ProductModel.factor θ ∧ + ProductModel.weightedOperator θ c ≠ 0 ∧ + NormQuasinilpotent (ProductModel.weightedOperator θ c) ∧ + vectorFugledeKadisonDeterminant ProductModel.traceVector + (ProductModel.weightedOperator θ c) = 0 ∧ + spectrum ℂ (ProductModel.weightedOperator θ c) = {0} ∧ + ∀ (I : Finset ℕ) (n : ℕ), + ‖ProductModel.weightedOperator θ c ^ n‖ ≤ + Real.exp ((∑ i ∈ I, c i) - (n : ℝ) * (∑ i ∈ I, c i * θ i)) := by + dsimp + obtain ⟨hlog, hmem, hne, hqn, hdet, hspec⟩ := + ProductModel.spectral_bundle_of_block_bounds m hm K C hK hC e θ + hθsum hθ01 hθlower + refine ⟨hlog, hmem, hne, hqn, hdet, hspec, ?_⟩ + intro I n + exact ProductModel.norm_weightedOperator_pow_le_finite_cost θ _ + (fun i => (hθ01 i).1) (fun i => (sq_nonneg _).trans (hC _)) hθsum I n + +end Invariant233 + +namespace Invariant233 + +theorem product_phase_ranges {ι : Type*} [Countable ι] + (S : ι → ℝ) (hS : ∀ i, 0 < S i) + (J : ℕ → Finset ι) (K G : ℕ → ℝ) + (hK : ∀ j, 0 < K j) (hG : ∀ j, 0 < G j) + (hgrowth : ∀ j, 2 ^ j ≤ (J j).card) + (hblock : ∀ j, ∀ i ∈ J j, S i = ((J j).card : ℝ) * K j) : + (∀ (j : ℕ) (θ : ι → ℝ), + (∀ i ∈ J j, θ i ∈ Set.Icc (1 / (((J j).card : ℝ) * K j)) + (2 / (((J j).card : ℝ) * K j))) → + ProductPhases.smallPhaseCondition (J j) (K j) (G j) θ) ∧ + (∀ᵐ θ ∂Measure.infinitePi + (fun i => ProbabilityTheory.cond volume (Set.Icc (1 / S i) (2 / S i))), + (∀ j, ProductPhases.smallPhaseCondition (J j) (K j) (G j) θ) ∧ + (∀ᶠ j in atTop, + ProductPhases.largePhaseCondition (J j) (((J j).card : ℝ) * K j) θ)) := by + constructor + · intro j θ hθ + have hJ : 0 < (J j).card := + lt_of_lt_of_le (by positivity : 0 < 2 ^ j) (hgrowth j) + exact ProductPhases.smallPhaseCondition_of_bounds (J j) hJ (hK j) (hG j) θ hθ + · exact ProductPhases.uniformProduct_ae_phaseRanges S hS J K G hK hG hgrowth hblock + +end Invariant233 + +namespace Invariant233 +open MeasureTheory Filter +open scoped Topology ENNReal + +theorem compact_transfer {X ι : Type*} + [TopologicalSpace X] [PolishSpace X] [MeasurableSpace X] [BorelSpace X] + (μ : Measure X) [IsFiniteMeasure μ] + (p : X → SequenceHilbert ℤ →L[ℂ] SequenceHilbert ℤ) + (hp : ∀ x, IsStarProjection (p x)) + (F : ℤ → X → ℝ) (hF : ∀ i x, 0 < F i x) + (hFm : ∀ i, Measurable (F i)) + (hpm : ∀ i : ℤ, Measurable (fun x => p x (lp.single 2 i 1))) + {L : Filter ι} [L.NeBot] {ν : FiniteMeasure (X × X)} + {νs : ι → FiniteMeasure (X × X)} (hν : Tendsto νs L (𝓝 ν)) + (hfirst : UniformlyAbsolutelyContinuous μ + (fun i => (νs i : Measure (X × X)).map Prod.fst)) + (hsecond : UniformlyAbsolutelyContinuous μ + (fun i => (νs i : Measure (X × X)).map Prod.snd)) + (B : ℝ) (hB : 0 < B) + (hcapn : ∀ i k, ∀ᵐ t ∂(νs i : Measure (X × X)), F k t.2 / F k t.1 ≤ B) + (hcap : ∀ k, ∀ᵐ t ∂(ν : Measure (X × X)), F k t.2 / F k t.1 ≤ B) + (hzero : ∀ i, ∀ᵐ t ∂(νs i : Measure (X × X)), + (1 - p t.2).comp ((ratioDiagonal F t).comp (p t.1)) = 0) : + ∀ᵐ t ∂(ν : Measure (X × X)), + (1 - p t.2).comp ((ratioDiagonal F t).comp (p t.1)) = 0 := + CompactTransfer.compact_operator_transfer μ p hp F hF hFm hpm hν + hfirst hsecond B hB hcapn hcap hzero + +end Invariant233 + +namespace Invariant233 + +theorem scalar_sampling_estimates : ScalarSampling.ScalarSamplingEstimates := + ScalarRectangles.full_scalar_estimates + +end Invariant233 + +open MeasureTheory Filter +open scoped ENNReal InnerProductSpace +namespace Invariant233 +open PositiveDiagonalModel +variable {Y : Type*} [MeasurableSpace Y] {μ : Measure Y} +theorem positive_diagonal + [IsProbabilityMeasure μ] (σ : Y ≃ᵐ Y) (hσ : Ergodic σ μ) + (M : VonNeumannAlgebra (Space μ)) + (_htrace : IsFaithfulTracialVector M (Lp.const 2 μ e0)) + (hfields : ∀ A : Space μ →L[ℂ] Space μ, A ∈ M → + ∃ a : Y → Fiber →L[ℂ] Fiber, + (∀ y, ‖a y‖ ≤ ‖A‖) ∧ + (∀ v, StronglyMeasurable fun y => a y v) ∧ + (∀ ξ : Space μ, A ξ =ᵐ[μ] fun y => a y (ξ y)) ∧ + (∀ᵐ y ∂μ, a y * fiberShift = fiberShift * a (σ y))) + (f : Lp ℝ ∞ μ) (hpositive : ∀ᵐ y ∂μ, 0 < f y) + (P : Space μ →L[ℂ] Space μ) (hPm : P ∈ M) (hP : IsStarProjection P) + (hinv : (1 - P) * lpOrbitWeightedShift σ f * P = 0) + (htrace0 : 0 < diagonalState P) (htrace1 : diagonalState P < 1) : + ∃ p : Y → Fiber →L[ℂ] Fiber, + (∀ y, ‖p y‖ ≤ ‖P‖) ∧ + (∀ v, StronglyMeasurable fun y => p y v) ∧ + (∀ ξ : Space μ, P ξ =ᵐ[μ] fun y => p y (ξ y)) ∧ + (∀ᵐ y ∂μ, IsStarProjection (p y)) ∧ + (∀ᵐ y ∂μ, p y * fiberShift = fiberShift * p (σ y)) ∧ + diagonalState P = ∫ y, (inner ℂ e0 (p y e0)).re ∂μ ∧ + (∀ᵐ y ∂μ, 0 < (inner ℂ e0 (p y e0)).re ∧ + (inner ℂ e0 (p y e0)).re < 1) := + PositiveDiagonalModel.positive_diagonal_in_algebra σ hσ M _htrace hfields + f hpositive P hPm hP hinv htrace0 htrace1 + +end Invariant233 + +namespace Invariant233 + +theorem product_ordinary_tail_projection (θ c : ℕ → ℝ) (m : ℤ) : + IsStarProjection (WeightedShift.fieldTailProjection (μ := ProductModel.baseMeasure) m) ∧ + WeightedShift.fieldTailProjection (μ := ProductModel.baseMeasure) m ≠ 0 ∧ + WeightedShift.fieldTailProjection (μ := ProductModel.baseMeasure) m ≠ 1 ∧ + (1 - WeightedShift.fieldTailProjection (μ := ProductModel.baseMeasure) m) * + ProductModel.weightedOperator θ c * + WeightedShift.fieldTailProjection (μ := ProductModel.baseMeasure) m = 0 ∧ + WeightedShift.fieldTailProjection (μ := ProductModel.baseMeasure) m ∉ + ProductModel.factor θ ∧ + (∀ ξ : ProductModel.Hilbert, + ξ ∈ WeightedShift.fieldTailSubspace ProductModel.baseMeasure m ↔ + ∀ᵐ x ∂ProductModel.baseMeasure, ξ x ∈ + (Submodule.span ℂ ((fun k : ℤ => + (lp.single 2 k (1 : ℂ) : WeightedShift.Hilbert)) '' + Set.Ici m)).topologicalClosure) := + by + obtain ⟨hp, hzero, hone, hinv, hmem⟩ := ProductModel.ordinary_tail_projection θ c m + exact ⟨hp, hzero, hone, hinv, hmem, + fun ξ => WeightedShift.mem_fieldTailSubspace_iff_closedSpan m ξ⟩ + +theorem product_polar_structure (θ c : ℕ → ℝ) + (h : ProductModel.AdmissibleAnglesAndCosts θ c) + (hlog : HasNegInfiniteLogIntegral ProductModel.baseMeasure (ProductModel.weight θ c)) : + ProductPolarStructure ProductModel.shiftOperator (ProductModel.weightedOperator θ c) := + ProductModel.productPolarStructure_of_negInfiniteLogIntegral θ c h hlog + +end Invariant233 + +namespace Invariant233.Results + +theorem rotation_factor_structure (θ : ℝ) + (_hθ0 : 0 < θ) (_hθ1 : θ < 1) (hθ : Irrational θ) : + IsTypeII1FactorWithVector (Rotation.algebra θ) Rotation.vacuum ∧ + HasSeparablePredual (Rotation.algebra θ) := + Rotation.factor_structure θ hθ + +end Invariant233.Results +namespace Invariant233 + +theorem conditional_labels {θ : ℝ} {p : CircleParameterData} + (hp : CircleParameterLaws θ p) (j : ℕ) : + ∃ hr : ∀ i, 0 < MixedRadix.radices p.q i, + CircleCoupling.ConditionalLabelLaws p j hr := CircleCoupling.exists_conditionalLabelLaws hp j + +theorem product_coupling_marginals + (m : ℕ → ℕ) (a b : ℕ → ℝ) (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) (tag : ℕ) : + OrderedProductCoupling.SourceMarginalProperties + (OrderedProductCoupling.sourceBlocks m a b hm ha ha' hb hb' e tag) + (OrderedProductCoupling.blockDensityBound OrderedProductCoupling.sourceKappa) := + OrderedProductCoupling.source_coupling_marginals m a b hm ha ha' hb hb' e tag + +end Invariant233 + +namespace Invariant233 + +theorem truncation_bound {θ : ℝ} (_hθ0 : 0 < θ) (_hθ1 : θ < 1) + (hθ : Irrational θ) {p : CircleParameterData} (hp : CircleParameterLaws θ p) + {P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert} + (hmem : P ∈ Rotation.algebra θ) (hP : IsStarProjection P) + (htrace0 : 0 < (Rotation.vacuumFunctional P).re) + (htrace1 : (Rotation.vacuumFunctional P).re < 1) + (hinv : (1 - P) * p.measurableOperator θ hp * P = 0) : + ∃ hr : ∀ i, 0 < MixedRadix.radices p.q i, + ∃ F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber, + (∀ x, IsStarProjection (F x)) ∧ + (∀ x, ‖F x‖ ≤ ‖P‖) ∧ + (∀ v : Rotation.Fiber, StronglyMeasurable fun x => F x v) ∧ + (∀ ξ : Rotation.Hilbert, P ξ =ᵐ[circleMeasure] fun x => F x (ξ x)) ∧ + p.RationalGraphIdentities θ F ∧ + CircleCoupling.TruncationBounds θ p hr F := by + exact CircleParameterLaws.exists_rational_graph_field_with_truncation_bounds + hθ hp hmem hP htrace0 htrace1 hinv + +theorem digit_marginals {θ : ℝ} {p : CircleParameterData} + (hp : CircleParameterLaws θ p) : + ∃ hr : ∀ i, 0 < MixedRadix.radices p.q i, + CircleCoupling.DigitMarginalLaws p hr := CircleCoupling.exists_digitMarginalLaws hp + +end Invariant233 + +namespace Invariant233 + +theorem ordered_couplings {θ : ℝ} {p : CircleParameterData} + (hp : CircleParameterLaws θ p) + {P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert} + (hmem : P ∈ Rotation.algebra θ) (hP : IsStarProjection P) + (hT : (1 - P) * p.measurableOperator θ hp * P = 0) : + ∃ (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber), + (∀ x, IsStarProjection (F x)) ∧ + (∀ x, ‖F x‖ ≤ ‖P‖) ∧ + (∀ v : Rotation.Fiber, StronglyMeasurable fun x => F x v) ∧ + (∀ ξ : Rotation.Hilbert, P ξ =ᵐ[circleMeasure] fun x => F x (ξ x)) ∧ + CircleCoupling.OrderedCouplingIdentities p θ hr F := by + exact CircleCoupling.exists_ordered_coupling_field hp hmem hP hT + +end Invariant233 + +namespace Invariant233 + +theorem tail_attenuation {θ : ℝ} {p : CircleParameterData} + (hp : CircleParameterLaws θ p) (j : ℕ) (hj : 1 ≤ j) : + ∃ hr : ∀ i, 0 < MixedRadix.radices p.q i, + CircleCoupling.TailAttenuation θ p j hr := by + exact CircleCoupling.exists_actual_tail_attenuation hp j hj + +end Invariant233 + +namespace Invariant233 + +theorem product_factor (θ : ℕ → ℝ) + (hθ : ProductModel.JointlyRationallyIndependent θ) : + IsTypeII1FactorWithVector (ProductModel.factor θ) ProductModel.traceVector ∧ + HasSeparablePredual (ProductModel.factor θ) ∧ + (∀ A : ProductModel.Hilbert →L[ℂ] ProductModel.Hilbert, + A ∈ ProductModel.factor θ ↔ + ∃ (F : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber) + (B : ℝ), ProductModel.IsCovariantFieldRepresentation θ A F B) ∧ + (∀ (A : ProductModel.Hilbert →L[ℂ] ProductModel.Hilbert) + (F : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber) (B : ℝ), + ProductModel.IsCovariantFieldRepresentation θ A F B → + vectorTrace ProductModel.traceVector A = ProductModel.centralDiagonalIntegral F) := by + exact ProductModel.factor_complete θ hθ +end Invariant233 + +namespace Invariant233 + +theorem affiliated_transport + {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + (M : VonNeumannAlgebra E) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (H : E →ₗ.[ℂ] E) (hH : IsSelfAdjoint H) (hpos : IsPositivePartial H) + (hinj : Function.Injective H) (haff : IsAffiliated M H) + (A B : M) + (hD : ∀ x : H.domain, (A : E →L[ℂ] E) (x : E) ∈ H.domain) + (hinter : ∀ x : H.domain, + H ⟨(A : E →L[ℂ] E) (x : E), hD x⟩ = (B : E →L[ℂ] E) (H x)) + (p : M) (hp : IsStarProjection (p : E →L[ℂ] E)) + (hinv : (1 - (p : E →L[ℂ] E)) * (A : E →L[ℂ] E) * (p : E →L[ℂ] E) = 0) : + ∃ P : M, + (P : E →L[ℂ] E) = + (InvariantRotation.AffiliatedTransport.transported H + (p : E →L[ℂ] E).range).starProjection ∧ + IsStarProjection (P : E →L[ℂ] E) ∧ + (1 - (P : E →L[ℂ] E)) * (B : E →L[ℂ] E) * (P : E →L[ℂ] E) = 0 ∧ + τ P = τ p := by + exact affiliated_transport_proof M τ hτ H hH hpos hinj haff A B hD hinter p hp hinv + +end Invariant233 + +namespace Invariant233.Results + +section PrincipalHilbertConsequences +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem transitive_commutant_on_separable_hilbert + [TopologicalSpace.SeparableSpace H] (hH : ¬ FiniteDimensional ℂ H) : + ∃ T : H →L[ℂ] H, T ≠ 0 ∧ NormQuasinilpotent T ∧ + HasNoNontrivialHyperinvariantSubspace T ∧ + operatorCommutant T ≠ ⊤ ∧ IsStronglyClosed (operatorCommutant T) ∧ + IsTransitive (operatorCommutant T) := by + have hs : Real.sqrt 2 ^ 2 = 2 := Real.sq_sqrt (by norm_num) + have hs0 := Real.sqrt_nonneg (2 : ℝ) + have hθ0 : 0 < Real.sqrt 2 - 1 := by nlinarith + have hθ1 : Real.sqrt 2 - 1 < 1 := by nlinarith + have hθ : Irrational (Real.sqrt 2 - 1) := by + simpa using irrational_sqrt_two.sub_intCast 1 + obtain ⟨f, _hf, hmem, hproj, hne, hqn, _hdet⟩ := + prescribed_irrational_counterexample (Real.sqrt 2 - 1) hθ0 hθ1 hθ + exact Invariant233.transitive_commutant_of_circle_witness hH + (Rotation.algebra (Real.sqrt 2 - 1)) hmem hne hqn hproj + +theorem cho_ko_lee_comparison [TopologicalSpace.SeparableSpace H] + (hH : ¬ FiniteDimensional ℂ H) : + ∃ T : H →L[ℂ] H, T ≠ 0 ∧ NormQuasinilpotent T ∧ + HasNoNontrivialHyperinvariantSubspace T ∧ + operatorCommutant (1 + T) = operatorCommutant T ∧ + ∀ C : H → H, ∀ hC : IsConjugation C, + IsInfiniteConjugationIsometry hC.toHilbertConjugation (1 + T) ∧ + HasNoNontrivialHyperinvariantSubspace (1 + T) := by + obtain ⟨T, hne, hqn, hhyper, _hproper, _hclosed, _htrans⟩ := + transitive_commutant_on_separable_hilbert hH + exact Invariant233.cho_ko_lee_complete_comparison_of_exists ⟨T, hne, hqn, hhyper⟩ + +end PrincipalHilbertConsequences +end Invariant233.Results + +namespace Invariant233 +theorem product_pair_identity (θ c : ℕ → ℝ) + (_hθ : ProductModel.JointlyRationallyIndependent θ) + (hθ01 : ∀ i, θ i ∈ Set.Ico (0 : ℝ) 1) (hθsum : Summable θ) + (hc : ∀ i, 0 ≤ c i) (hsampling : ProductModel.HasAllFiniteCoordinateSampling θ) + (p : ProductModel.Hilbert →L[ℂ] ProductModel.Hilbert) + (hpM : p ∈ ProductModel.factor θ) (hp : IsStarProjection p) + (hinv : (1 - p) * ProductModel.weightedOperator θ c * p = 0) : + ∃ F : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber, + ProductModel.IsCovariantFieldRepresentation θ p F 1 ∧ + (∀ x, IsStarProjection (F x)) ∧ + ∀ I : Finset ℕ, ∀ᵐ xy ∂ProductModel.triangularLaw I, + ProductModel.PairIdentity θ c F xy := by + exact ProductModel.exists_covariantProjectionField_pairIdentity θ c + (fun i => (hθ01 i).1) hθsum hc hsampling p hpM hp hinv +end Invariant233 + +namespace Invariant233 + +theorem product_biased_identity (θ c : ℕ → ℝ) + (_hθ : ProductModel.JointlyRationallyIndependent θ) + (hθ01 : ∀ i, θ i ∈ Set.Ico (0 : ℝ) 1) (hθsum : Summable θ) + (hc : ∀ i, 0 ≤ c i) (hsampling : ProductModel.HasAllFiniteCoordinateSampling θ) + (P : ProductModel.Hilbert →L[ℂ] ProductModel.Hilbert) + (hPM : P ∈ ProductModel.factor θ) (hP : IsStarProjection P) + (hinv : (1 - P) * ProductModel.weightedOperator θ c * P = 0) + (m : ℕ → ℕ) (a b : ℕ → ℝ) (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) : + ∃ F : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber, + ProductModel.IsCovariantFieldRepresentation θ P F 1 ∧ + (∀ x, IsStarProjection (F x)) ∧ + ∀ tag : ℕ, ∀ᵐ xy ∂OrderedProductCoupling.circlePairLaw + (OrderedProductCoupling.sourceBlocks m a b hm ha ha' hb hb' e tag), + ProductModel.PairIdentity θ c F xy := by + exact OrderedProductCoupling.exists_source_covariantProjectionField_biased_pairIdentity + θ c (fun i => (hθ01 i).1) hθsum hc hsampling P hPM hP hinv + m a b hm ha ha' hb hb' e + +end Invariant233 + +namespace Invariant233 + +theorem measurable_counterexample (θ : ℝ) + (_hθ0 : 0 < θ) (_hθ1 : θ < 1) (hθ : Irrational θ) + (p : CircleParameterData) (hp : CircleParameterLaws θ p) : + p.measurableOperator θ hp ∈ Rotation.algebra θ ∧ + ∀ P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert, + P ∈ Rotation.algebra θ → IsStarProjection P → + 0 < (Rotation.vacuumFunctional P).re → + (Rotation.vacuumFunctional P).re < 1 → + (1 - P) * p.measurableOperator θ hp * P ≠ 0 := by + refine ⟨hp.measurableOperator_mem_algebra, ?_⟩ + intro P hmem hP htrace0 htrace1 hinv + rcases hp.measurableOperator_hasOnlyTrivialInvariantProjections hθ P hmem hP hinv with h0 | h1 + · subst P + simp [Rotation.vacuumFunctional] at htrace0 + · subst P + simp [Rotation.vacuumFunctional_one] at htrace1 + +end Invariant233 + +namespace Invariant233 + +theorem product_finite_coordinate_sampling + (p : ProductScaleData) (hp : ProductScaleLaws p) + (S : ℕ → ℝ) (hS : ∀ i, 0 < S i) + (hblock : ∀ j, ∀ i ∈ ProductPhases.consecutiveBlock p.m j, + S i = (p.m j : ℝ) * p.K j) : + ∀ᵐ θ ∂Measure.infinitePi (fun i => + ProbabilityTheory.cond volume (Set.Icc (1 / S i) (2 / S i))), + ProductModel.HasAllFiniteCoordinateSampling θ := by + exact ProductModel.SamplingWeights.ae_hasAllFiniteCoordinateSampling hp S hS hblock + +end Invariant233 +end + +namespace Invariant233 + +local instance ProductModel.instFactOneLeTwoCounterexample : + Fact (1 ≤ (2 : ENNReal)) := ⟨by norm_num⟩ + +abbrev ProductModel.CounterexampleFiber : Type := + @lp ℤ (fun _ => ℂ) (fun _ => Complex.instNormedAddCommGroup) 2 + +abbrev ProductModel.CounterexampleHilbert : Type := + @MeasureTheory.Lp ProductModel.Base ProductModel.CounterexampleFiber MeasurableSpace.pi + (@lp.normedAddCommGroup ℤ (fun _ => ℂ) 2 + (fun _ => Complex.instNormedAddCommGroup) ProductModel.instFactOneLeTwoCounterexample) + 2 ProductModel.baseMeasure + +instance ProductModel.instCompleteSpaceHilbertCounterexample : + CompleteSpace ProductModel.CounterexampleHilbert := inferInstance + +def ProductOperatorProperties {H : Type*} [NormedAddCommGroup H] + [InnerProductSpace ℂ H] [CompleteSpace H] (factor : VonNeumannAlgebra H) + (traceVector : H) (shift operator : H →L[ℂ] H) : Prop := + IsTypeII1FactorWithVector factor traceVector ∧ + HasSeparablePredual factor ∧ + operator ∈ factor ∧ operator ≠ 0 ∧ + NormQuasinilpotent operator ∧ + vectorFugledeKadisonDeterminant traceVector operator = 0 ∧ + spectrum ℂ operator = {0} ∧ + IsVectorBrownMeasure traceVector operator (MeasureTheory.Measure.dirac 0) ∧ + HasOnlyTrivialInvariantProjections factor operator ∧ + ProductPolarStructure shift operator + +@[instance_reducible] +noncomputable def ProductModel.counterexampleHilbertNormedAddCommGroup : + NormedAddCommGroup ProductModel.CounterexampleHilbert := + @MeasureTheory.Lp.instNormedAddCommGroup ProductModel.Base ProductModel.CounterexampleFiber + MeasurableSpace.pi 2 ProductModel.baseMeasure + (@lp.normedAddCommGroup ℤ (fun _ => ℂ) 2 + (fun _ => Complex.instNormedAddCommGroup) ProductModel.instFactOneLeTwoCounterexample) + ProductModel.instFactOneLeTwoCounterexample + +@[instance_reducible] +noncomputable def ProductModel.counterexampleHilbertInnerProductSpace : + @InnerProductSpace ℂ ProductModel.CounterexampleHilbert Complex.instRCLike + ProductModel.counterexampleHilbertNormedAddCommGroup.toSeminormedAddCommGroup := + @MeasureTheory.L2.innerProductSpace ProductModel.Base ProductModel.CounterexampleFiber ℂ + Complex.instRCLike MeasurableSpace.pi ProductModel.baseMeasure + (@lp.normedAddCommGroup ℤ (fun _ => ℂ) 2 + (fun _ => Complex.instNormedAddCommGroup) ProductModel.instFactOneLeTwoCounterexample) + (@lp.instInnerProductSpace ℤ ℂ Complex.instRCLike (fun _ => ℂ) + (fun _ => Complex.instNormedAddCommGroup) + (fun _ => @RCLike.innerProductSpace ℂ Complex.instRCLike)) + +def ProductModel.HasCounterexampleOperator (θ c : ℕ → ℝ) : Prop := + @ProductOperatorProperties ProductModel.CounterexampleHilbert + ProductModel.counterexampleHilbertNormedAddCommGroup + ProductModel.counterexampleHilbertInnerProductSpace + ProductModel.instCompleteSpaceHilbertCounterexample (ProductModel.factor θ) + ProductModel.traceVector ProductModel.shiftOperator (ProductModel.weightedOperator θ c) + +def ProductModel.IsCounterexampleRealization (θ c : ℕ → ℝ) : Prop := + ProductModel.AdmissibleAnglesAndCosts θ c ∧ + ProductModel.HasAllFiniteCoordinateSampling θ ∧ + Filter.Eventually (fun x : ProductModel.Base => 0 < ProductModel.weight θ c x) + (@MeasureTheory.ae ProductModel.Base + (@MeasureTheory.Measure ProductModel.Base MeasurableSpace.pi) + MeasureTheory.Measure.instFunLike MeasureTheory.Measure.instOuterMeasureClass + ProductModel.baseMeasure) ∧ + @HasNegInfiniteLogIntegral ProductModel.Base MeasurableSpace.pi + ProductModel.baseMeasure (ProductModel.weight θ c) ∧ + ProductModel.HasCounterexampleOperator θ c + +namespace Results + +theorem product_realization : + ∃ θ c : ℕ → ℝ, ProductModel.IsCounterexampleRealization θ c := by + exact ProductModel.product_realization_of_ae_sampling Invariant233.product_finite_coordinate_sampling + +end Results +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/AffiliatedTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Model/AffiliatedTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..b35b6e41839fa7b3071cd3dd2369d90cb64f20be --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/AffiliatedTransport.lean @@ -0,0 +1,32 @@ +import Mathlib.Analysis.InnerProductSpace.LinearPMap +import Mathlib.Analysis.InnerProductSpace.Projection.Basic + +namespace OAI + +noncomputable section + +namespace InvariantRotation.AffiliatedTransport + +variable {𝕜 E : Type*} [RCLike 𝕜] +variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] + +def domainImage (H : E →ₗ.[𝕜] E) (p : Submodule 𝕜 E) : Submodule 𝕜 E := + (p.comap H.domain.subtype).map H.toFun + +def transported (H : E →ₗ.[𝕜] E) (p : Submodule 𝕜 E) : Submodule 𝕜 E := + (domainImage H p).topologicalClosure + +variable [CompleteSpace E] + +instance transported_hasOrthogonalProjection + (H : E →ₗ.[𝕜] E) (p : Submodule 𝕜 E) : + (transported H p).HasOrthogonalProjection := by + let : IsClosed (transported H p : Set E) := + Submodule.isClosed_topologicalClosure _ + infer_instance + +end InvariantRotation.AffiliatedTransport + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/Analytic.lean b/lean/OAI/Analysis/IrrationalRotation/Model/Analytic.lean new file mode 100644 index 0000000000000000000000000000000000000000..17f95b6316014ba651fd6c7cb1527f5d40e8b235 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/Analytic.lean @@ -0,0 +1,40 @@ +import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLogExp +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.MeasureTheory.Group.AddCircle +import Mathlib.MeasureTheory.Integral.Lebesgue.Basic + +namespace OAI + +noncomputable section +open Filter MeasureTheory +open scoped ENNReal Topology + +namespace Invariant233 + +abbrev Circle := AddCircle (1 : ℝ) + +def circleMeasure : Measure Circle := volume + +def negLogCost (t : ℝ) : ℝ≥0∞ := + if t = 0 then ∞ else ENNReal.ofReal (-Real.log |t|) + +def HasNegInfiniteLogIntegral {X : Type*} [MeasurableSpace X] + (μ : Measure X) (f : X → ℝ) : Prop := + (∫⁻ x, negLogCost (f x) ∂μ) = ∞ + +def scalarWeightDeterminant {X : Type*} [MeasurableSpace X] + (μ : Measure X) (f : X → ℝ) : ℝ≥0∞ := + EReal.exp (-((∫⁻ x, negLogCost (f x) ∂μ) : EReal)) + +def NormQuasinilpotent {A : Type*} [NormedRing A] (T : A) : Prop := + Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) atTop (𝓝 0) + +def IsContinuousCircleWeight (f : Circle → ℝ) : Prop := + Continuous f ∧ (∀ x, 0 ≤ f x ∧ f x ≤ 1) ∧ + (∀ x, f x = 0 ↔ x = 0) ∧ HasNegInfiniteLogIntegral circleMeasure f + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/BackgroundData.lean b/lean/OAI/Analysis/IrrationalRotation/Model/BackgroundData.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8a6e7303238ae77851d7e7cdae9e836bfcd82d2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/BackgroundData.lean @@ -0,0 +1,46 @@ +import OAI.Analysis.IrrationalRotation.Model.Analytic +import OAI.Analysis.IrrationalRotation.Model.ContinuityCoboundary +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal Topology + +namespace Invariant233 + +structure BackgroundBumpData (θ : ℝ) where + radius : ℕ → ℝ + bump : ℕ → Circle → ℝ + radius_pos : ∀ n, 0 < radius n + radius_lt : ∀ n, radius n < 1 / ((n : ℝ) + 1) + continuous_bump : ∀ n, Continuous (bump n) + bump_zero : ∀ n, bump n 0 = 1 + bump_bounds : ∀ n x, 0 ≤ bump n x ∧ bump n x ≤ 1 + bump_support : ∀ n, Function.support (bump n) ⊆ Metric.closedBall 0 (radius n) + disjoint_translates : ∀ n, Pairwise (fun i j : Fin (2 ^ (n + 2)) => + Disjoint + ((fun x : Circle => x + ((i : ℕ) + 1) • (θ : Circle)) '' + Metric.closedBall 0 (radius n)) + ((fun x : Circle => x + ((j : ℕ) + 1) • (θ : Circle)) '' + Metric.closedBall 0 (radius n))) + weighted_support_bound : + (∑' n, (2 : ℝ≥0∞) ^ (n + 2) * circleMeasure (Metric.closedBall 0 (radius n))) ≤ 1 / 2 + +def backgroundNegative {θ : ℝ} (d : BackgroundBumpData θ) (n : ℕ) (x : Circle) : ℝ := + InvariantProjection.Continuity.backwardAverage (Equiv.addRight (θ : Circle)) + (d.bump n) (2 ^ (n + 2)) x + +def backgroundCost {θ : ℝ} (d : BackgroundBumpData θ) (x : Circle) : ℝ := + 1 + (∑' n, d.bump n x) - (∑' n, backgroundNegative d n x) + +def backgroundTransferSum {θ : ℝ} (d : BackgroundBumpData θ) (x : Circle) : ℝ := + ∑' n, InvariantProjection.Continuity.backgroundTransfer (Equiv.addRight (θ : Circle)) + (d.bump n) (2 ^ (n + 2)) x + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/BiasedTailDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Model/BiasedTailDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..2adf0f4a31005c13a9915d63d4590ec729285d11 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/BiasedTailDensity.lean @@ -0,0 +1,18 @@ +import Mathlib.MeasureTheory.Integral.Prod + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.BiasedTailDensity + +def tailDensity {P Z : Type*} [MeasurableSpace P] [MeasurableSpace Z] + (μ : Measure P) (g : P × Z → ℝ) (z : Z) : ℝ := + ∫ u, g (u, z) ∂μ + +end Invariant233.BiasedTailDensity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/BlockProductCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/BlockProductCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..094983b43528951ba64b102977f981f0c58c8f2a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/BlockProductCoupling.lean @@ -0,0 +1,38 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductCoupling + +namespace OAI + +noncomputable section +namespace Invariant233.OrderedProductCoupling + +def sourceKappa (s : ℕ) : ℝ := 1 / (100 * ((s : ℝ) + 1)) + +def ofBlocks (m : ℕ → ℕ) (κ a b : ℕ → ℝ) + (hκ0 : ∀ s, 0 ≤ κ s) (hκ : ∀ s, κ s ≤ 1 / 100) + (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) (tag : ℕ) : Parameters where + κ i := κ (e i).1 + m i := m (e i).1 + a i := a (e i).1 + b i := b (e i).1 + t i := if (e i).1 = tag then 1 else 0 + κ_nonneg i := hκ0 (e i).1 + κ_le i := hκ (e i).1 + m_ge i := by exact_mod_cast hm (e i).1 + a_lower i := ha (e i).1 + a_upper i := ha' (e i).1 + b_lower i := hb (e i).1 + b_upper i := hb' (e i).1 + t_nonneg i := by split_ifs <;> norm_num + t_le i := by split_ifs <;> norm_num + +def blockDensityBound (κ : ℕ → ℝ) : ℝ := + Real.exp (10 * (2 * (∑' s, κ s ^ 2) + 1)) + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/BlockedProductCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/BlockedProductCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..61bbec084c22e8711e0ec26cd70f23a2202afff2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/BlockedProductCoupling.lean @@ -0,0 +1,86 @@ +import OAI.Analysis.IrrationalRotation.Model.OneCoordinateCoupling +import OAI.Analysis.IrrationalRotation.Model.ProductCoupling +import OAI.Analysis.IrrationalRotation.Model.ProductBase +import Mathlib.Probability.ProductMeasure + +namespace OAI + +open MeasureTheory + +namespace Invariant233.BlockedProductCoupling + +abbrev Coordinate := Option (Fin 5) × (ℝ × ℝ) + +abbrev Sample (m : ℕ → ℕ) := (s : ℕ) → Fin (m s) → Coordinate + +def flatten {m : ℕ → ℕ} (e : ℕ ≃ Σ s, Fin (m s)) (z : Sample m) : + OrderedProductCoupling.Sample := fun i => z (e i).1 (e i).2 + +def leftEndpoint {m : ℕ → ℕ} (e : ℕ ≃ Σ s, Fin (m s)) + (z : Sample m) : OrderedProductCoupling.Endpoint := + OrderedProductCoupling.leftEndpoint (flatten e z) + +def rightEndpoint {m : ℕ → ℕ} (e : ℕ ≃ Σ s, Fin (m s)) + (z : Sample m) : OrderedProductCoupling.Endpoint := + OrderedProductCoupling.rightEndpoint (flatten e z) + +def toCircle (x : OrderedProductCoupling.Endpoint) : ProductModel.Base := + fun i => (x i : Circle) + +def circleLeftEndpoint {m : ℕ → ℕ} (e : ℕ ≃ Σ s, Fin (m s)) : + Sample m → ProductModel.Base := toCircle ∘ leftEndpoint e + +def circleRightEndpoint {m : ℕ → ℕ} (e : ℕ ≃ Σ s, Fin (m s)) : + Sample m → ProductModel.Base := toCircle ∘ rightEndpoint e + +def parameters {m : ℕ → ℕ} {κ : ℕ → ℝ} + {a b : (s : ℕ) → Fin (m s) → ℝ} + (hm : ∀ s, 100 ≤ m s) (hκ0 : ∀ s, 0 ≤ κ s) (hκ : ∀ s, κ s ≤ 1 / 100) + (ha : ∀ s i, 1 / (m s : ℝ) ≤ a s i) (ha' : ∀ s i, a s i ≤ 1 / 4) + (hb : ∀ s i, 1 / (m s : ℝ) ≤ b s i) (hb' : ∀ s i, b s i ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) (j : ℕ) : OrderedProductCoupling.Parameters where + κ i := κ (e i).1 + m i := m (e i).1 + a i := a (e i).1 (e i).2 + b i := b (e i).1 (e i).2 + t i := if (e i).1 = j then 1 else 0 + κ_nonneg i := hκ0 _ + κ_le i := hκ _ + m_ge i := Nat.cast_le.mpr (hm _) + a_lower i := ha _ _ + a_upper i := ha' _ _ + b_lower i := hb _ _ + b_upper i := hb' _ _ + t_nonneg i := by split_ifs <;> norm_num + t_le i := by split_ifs <;> norm_num + +noncomputable def blockLaw (m : ℕ → ℕ) (κ : ℕ → ℝ) + (a b : (s : ℕ) → Fin (m s) → ℝ) (j s : ℕ) : + Measure (Fin (m s) → Coordinate) := + Measure.pi (fun i => OneCoordinateCoupling.labelledLaw (κ s) (m s) + (a s i) (b s i) (if s = j then 1 else 0)) + +noncomputable def law (m : ℕ → ℕ) (κ : ℕ → ℝ) + (a b : (s : ℕ) → Fin (m s) → ℝ) (j : ℕ) : Measure (Sample m) := + Measure.infinitePi (blockLaw m κ a b j) + +def currentEvent (m : ℕ → ℕ) (j : ℕ) : Set (Sample m) := + {z | (∃ i, (z j i).1 = some (4 : Fin 5)) ∧ + ∀ i, (z j i).2.1 < 1 - 2 / (m j : ℝ) ∧ + 2 / (m j : ℝ) < (z j i).2.2} + +def futureBad (m : ℕ → ℕ) (K : ℕ → ℝ) (j : ℕ) : Set (Sample m) := + ⋃ n : ℕ, ⋃ i : Fin (m (j + 1 + n)), + {z | 1 - 2 * K j / ((m (j + 1 + n) : ℝ) * K (j + 1 + n)) ≤ + (z (j + 1 + n) i).2.1 ∨ + (z (j + 1 + n) i).2.2 ≤ + 2 * K j / ((m (j + 1 + n) : ℝ) * K (j + 1 + n))} + +def retainedEvent {X : Type*} (m : ℕ → ℕ) (K : ℕ → ℝ) + (r : X → ℝ) (x y : Sample m → X) (j : ℕ) : Set (Sample m) := + currentEvent m j \ (futureBad m K j ∪ + ({z | r (x z) < 1 / (j : ℝ)} ∪ {z | 1 - r (y z) < 1 / (j : ℝ)})) + +end Invariant233.BlockedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/BlockedSourceEvent.lean b/lean/OAI/Analysis/IrrationalRotation/Model/BlockedSourceEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..b19b5099ef31327501aaef4b612b2ad210fcc6c4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/BlockedSourceEvent.lean @@ -0,0 +1,58 @@ +import OAI.Analysis.IrrationalRotation.Model.BlockedProductCoupling +import OAI.Analysis.IrrationalRotation.Model.ProductScales +import OAI.Analysis.IrrationalRotation.Model.ProductCocycle +import OAI.Analysis.IrrationalRotation.Model.SourceCouplingMarginals + +namespace OAI + +noncomputable section +open scoped ComplexConjugate + +namespace Invariant233.BlockedProductCoupling + +def sourceBasisZero : ProductModel.Fiber := lp.single 2 (0 : ℤ) (1 : ℂ) + +abbrev ProjectionField := ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber + +def projectionDiagonal (P : ProjectionField) (x : ProductModel.Base) : ℝ := + ((P x sourceBasisZero) 0).re + +def sourceRetainedEvent {X : Type*} (m : ℕ → ℕ) (K : ℕ → ℝ) + (r : X → ℝ) (x y : Sample m → X) (j : ℕ) : Set (Sample m) := + currentEvent m j \ (futureBad m K j ∪ + ({z | r (x z) < 1 / ((j + 1 : ℕ) : ℝ)} ∪ + {z | 1 - r (y z) < 1 / ((j + 1 : ℕ) : ℝ)})) + +noncomputable def sourceLaw (p : ProductScaleData) (j : ℕ) : MeasureTheory.Measure (Sample p.m) := + law p.m ProductScaleData.kappa (fun s _ => p.a s) (fun s _ => p.b s) j + +def sourceEvent (p : ProductScaleData) (e : ℕ ≃ Σ s, Fin (p.m s)) + (r : ProductModel.Base → ℝ) (j : ℕ) : Set (Sample p.m) := + sourceRetainedEvent p.m (fun s => (p.K s : ℝ)) r + (circleLeftEndpoint e) (circleRightEndpoint e) j + +def unflatten {m : ℕ → ℕ} (e : ℕ ≃ Σ s, Fin (m s)) + (ω : OrderedProductCoupling.Sample) : Sample m := + fun s i => ω (e.symm ⟨s, i⟩) + +def flatSourceEvent (p : ProductScaleData) (e : ℕ ≃ Σ s, Fin (p.m s)) + (r : ProductModel.Base → ℝ) (j : ℕ) : Set OrderedProductCoupling.Sample := + unflatten e ⁻¹' sourceEvent p e r j + +def sourceCoefficientA (p : ProductScaleData) (e : ℕ ≃ Σ s, Fin (p.m s)) + (θ : ℕ → ℝ) (P : ProjectionField) (z : Sample p.m) (v : ℤ) : ℂ := + (P (circleLeftEndpoint e z) sourceBasisZero) v / + (ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) v + (circleLeftEndpoint e z) : ℂ) + +def sourceCoefficientB (p : ProductScaleData) (e : ℕ ≃ Σ s, Fin (p.m s)) + (θ : ℕ → ℝ) (P : ProjectionField) (z : Sample p.m) (v : ℤ) : ℂ := + (ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) (-v) + (circleRightEndpoint e z) : ℂ) * + conj (((1 - P (circleRightEndpoint e z)) sourceBasisZero) (-v)) + +end Invariant233.BlockedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CharacterLaw.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CharacterLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1e8cbe10246c330ce1be9f787150239c583287f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CharacterLaw.lean @@ -0,0 +1,40 @@ +import Mathlib.Analysis.Fourier.AddCircleMulti +import Mathlib.MeasureTheory.Measure.ProbabilityMeasure + +namespace OAI + +noncomputable section + +namespace Invariant233.CharacterLaws + +open MeasureTheory + +def circleHaar : ProbabilityMeasure (AddCircle (1 : ℝ)) := + ⟨volume, ⟨by simp [AddCircle.measure_univ]⟩⟩ + +def torusHaar (m : ℕ) : ProbabilityMeasure (UnitAddTorus (Fin m)) := by + letI : IsProbabilityMeasure (volume : Measure (AddCircle (1 : ℝ))) := + circleHaar.property + exact ⟨volume, inferInstance⟩ + +def characterMap {m : ℕ} (q : Fin m → ℕ) : + C(AddCircle (1 : ℝ), UnitAddTorus (Fin m)) := + ⟨fun x i => (q i : ℤ) • x, by fun_prop⟩ + +def characterLaw {m : ℕ} (q : Fin m → ℕ) : ProbabilityMeasure (UnitAddTorus (Fin m)) := + circleHaar.map (characterMap q) + +def characterPhaseLaw {Z : Type*} [TopologicalSpace Z] [MeasurableSpace Z] + [BorelSpace Z] {m : ℕ} (q : Fin m → ℕ) (a : Z) : + ProbabilityMeasure (Z × UnitAddTorus (Fin m)) := + circleHaar.map (fun x => (a, characterMap q x)) + +def haarPhaseLaw {Z : Type*} [TopologicalSpace Z] [MeasurableSpace Z] + [BorelSpace Z] (m : ℕ) (a : Z) : ProbabilityMeasure (Z × UnitAddTorus (Fin m)) := + (torusHaar m).map (fun y => (a, y)) + +end Invariant233.CharacterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CharacterSampling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CharacterSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..7736c12e43b28e133f04dc0ec6d68959887c5440 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CharacterSampling.lean @@ -0,0 +1,32 @@ +import OAI.Analysis.IrrationalRotation.Model.CharacterLaw +import OAI.Analysis.IrrationalRotation.Model.ScalarSampling +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Invariant233.CharacterSampling + +def representative (x : UnitAddCircle) : ℝ := + (AddCircle.equivIco (1 : ℝ) 0 x : ℝ) + +def kernel (endpoint : Bool) (m : ℕ) (z v : ℝ) : ℝ := + if endpoint then ScalarSampling.manuscriptEndpointKernel m z v + else ScalarSampling.manuscriptKernel m z v + +def average (m : ℕ) (powers : Finset ℕ) (endpoint : Bool) + (phase : Fin m → ℝ) (spatial : UnitAddTorus (Fin m)) : ℝ := + (powers.card : ℝ)⁻¹ * ∑ n ∈ powers, ∏ i : Fin m, + kernel endpoint m (representative (spatial i)) ((n : ℝ) * phase i) + +def squaredError (m : ℕ) (powers : Finset ℕ) (endpoint : Bool) + (p : (Fin m → ℝ) × UnitAddTorus (Fin m)) : ℝ := + (average m powers endpoint p.1 p.2 - 1) ^ 2 + +end Invariant233.CharacterSampling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleConditionalLabels.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleConditionalLabels.lean new file mode 100644 index 0000000000000000000000000000000000000000..411c572fdec196cc6d61bdd85d97a46445a21086 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleConditionalLabels.lean @@ -0,0 +1,48 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleCoupling +import Mathlib.Probability.Independence.Conditional + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal BigOperators ProbabilityTheory +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData CouplingMarginalBounds + +structure ConditionalLabelLaws (p : CircleParameterData) (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) : Prop where + probability : IsProbabilityMeasure (law p j) + endpoint_measurable : ∀ side, Measurable (point p hr side) + independent : letI := probability + ∀ side, iCondIndepFun (MeasurableSpace.comap (point p hr side) inferInstance) + (endpoint_measurable side).comap_le label (law p j) + finite_posterior : ∀ side (S : Finset ℕ) (C : ℕ → Set Label), + (∀ i, MeasurableSet (C i)) → + (law p j)⟦(⋂ i ∈ S, label i ⁻¹' C i) | + MeasurableSpace.comap (point p hr side) inferInstance⟧ =ᵐ[law p j] + (fun ω => ∏ i ∈ S, (posterior p j side i + (MixedRadix.circleCanonical (MixedRadix.radices p.q) hr (point p hr side ω) i)).real (C i)) + top_probability : ∀ s, 1 ≤ s → ∀ i ∈ p.block s, ∀ which, + ∀ᵐ ω ∂law p j, ∀ u : ℝ, + p.coordinate i (point p hr false ω) < u → u ≤ 1 - width (p.a s) (p.b s) which → + rho (kappa s) (p.m s) (width (p.a s) (p.b s) which) / 10 ≤ + ((law p j)⟦label i ⁻¹' {topLabel which} | + MeasurableSpace.comap (point p hr false) inferInstance⟧) ω + bottom_probability : ∀ s, 1 ≤ s → ∀ i ∈ p.block s, ∀ which, + ∀ᵐ ω ∂law p j, ∀ u : ℝ, + u ≤ p.coordinate i (point p hr true ω) → width (p.a s) (p.b s) which ≤ u → + rho (kappa s) (p.m s) (width (p.a s) (p.b s) which) / 10 ≤ + ((law p j)⟦label i ⁻¹' {bottomLabel which} | + MeasurableSpace.comap (point p hr true) inferInstance⟧) ω + top_forcing : ∀ s, 1 ≤ s → ∀ i ∈ p.block s, ∀ which, + ∀ᵐ ω ∂law p j, ∀ u : ℝ, label i ω = topLabel which → + u ≤ 1 - width (p.a s) (p.b s) which → u ≤ p.coordinate i (point p hr true ω) + bottom_forcing : ∀ s, 1 ≤ s → ∀ i ∈ p.block s, ∀ which, + ∀ᵐ ω ∂law p j, ∀ u : ℝ, label i ω = bottomLabel which → + width (p.a s) (p.b s) which ≤ u → p.coordinate i (point p hr false ω) < u + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..3925f0ce5741c622d21eca939b3f41bd6f77d213 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleCoupling.lean @@ -0,0 +1,53 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleDigitCoupling +import OAI.Analysis.IrrationalRotation.Model.CircleParameters +import OAI.Analysis.IrrationalRotation.Model.MixedRadixCircle +import Mathlib.Probability.ProductMeasure + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData OneCoordinateCoupling + +abbrev Sample := ℕ → CoordinateSample + +def initialLaw : Measure CoordinateSample := + baseLaw.map (fun x => (none, (x, x))) + +def tag (j s : ℕ) : ℝ := if s = j then 1 else 0 + +def coordinateLaw (p : CircleParameterData) (j i : ℕ) : Measure CoordinateSample := + if i = 0 then initialLaw else + rawLaw (kappa (p.blockIndex i)) (p.m (p.blockIndex i)) + (p.a (p.blockIndex i)) (p.b (p.blockIndex i)) (tag j (p.blockIndex i)) + +def law (p : CircleParameterData) (j : ℕ) : Measure Sample := + Measure.infinitePi (coordinateLaw p j) + +def observedDigit (p : CircleParameterData) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (side : Bool) (i : ℕ) (z : CoordinateSample) : Fin (MixedRadix.radices p.q i) := by + letI : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + exact UniformQuantization.quantize (MixedRadix.radices p.q i) (endpoint side z) + +def digits (p : CircleParameterData) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (side : Bool) (ω : Sample) : MixedRadix.Digits (MixedRadix.radices p.q) := + fun i => observedDigit p hr side i (ω i) + +def point (p : CircleParameterData) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (side : Bool) (ω : Sample) : Circle := MixedRadix.circleValue (digits p hr side ω) + +def label (i : ℕ) (ω : Sample) : Label := (ω i).1 + +def posterior (p : CircleParameterData) (j : ℕ) (side : Bool) (i : ℕ) : + Kernel (Fin (MixedRadix.radices p.q i)) Label := + if i = 0 then Kernel.const _ (Measure.dirac none) else + labelsGivenDigit side (MixedRadix.radices p.q i) (kappa (p.blockIndex i)) + (p.m (p.blockIndex i)) (p.a (p.blockIndex i)) (p.b (p.blockIndex i)) + (tag j (p.blockIndex i)) + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleDigitCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleDigitCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..cbb3ad9dff730d7c1a2e5e05955c7a8fe1d4c825 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleDigitCoupling.lean @@ -0,0 +1,67 @@ +import OAI.Analysis.IrrationalRotation.Model.OneCoordinateCoupling +import OAI.Analysis.IrrationalRotation.Model.FiniteKernelMixture +import OAI.Analysis.IrrationalRotation.Model.UniformQuantization + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped ENNReal BigOperators +namespace Invariant233.CircleDigitCoupling +open CouplingMarginalBounds CouplingMixture OneCoordinateCoupling + +abbrev Label := Option (Fin 5) +abbrev CoordinateSample := Label × (ℝ × ℝ) + +def endpointLaw (side : Bool) (m a b : ℝ) : Label → Measure ℝ + | none => baseLaw + | some i => if side then rightLaw (2 * m) a b i else leftLaw (2 * m) a b i + +def endpointDensity (side : Bool) (m a b : ℝ) : Label → ℝ → ℝ + | none => fun _ => 1 + | some i => if side then rightDensity (2 * m) a b i else leftDensity (2 * m) a b i + +def marginalDensity (side : Bool) (κ m a b t x : ℝ) : ℝ := + diagonalMass κ m a b t + + ∑ i, componentProbabilities κ m a b t i * endpointDensity side m a b (some i) x + +def labelMass (κ m a b t : ℝ) : Label → ℝ≥0∞ + | none => ENNReal.ofReal (diagonalMass κ m a b t) + | some i => ENNReal.ofReal (componentProbabilities κ m a b t i) + +def rawLaw (κ m a b t : ℝ) : Measure CoordinateSample := + labelledMixture baseLaw (ENNReal.ofReal (diagonalMass κ m a b t)) + (fun i => ENNReal.ofReal (componentProbabilities κ m a b t i)) + (leftLaw (2 * m) a b) (rightLaw (2 * m) a b) + +def endpoint (side : Bool) (z : CoordinateSample) : ℝ := + if side then z.2.2 else z.2.1 + +def bin (r : ℕ) (d : Fin r) : Set ℝ := + Set.Ico ((d : ℝ) / r) (((d : ℝ) + 1) / r) + +def digitJoint (side : Bool) (r : ℕ) [NeZero r] (κ m a b t : ℝ) : + Measure (Fin r × Label) := + (rawLaw κ m a b t).map (fun z => + (UniformQuantization.quantize r (endpoint side z), z.1)) + +def digitWeight (side : Bool) (r : ℕ) (κ m a b t : ℝ) + (l : Label) (d : Fin r) : ℝ≥0∞ := + labelMass κ m a b t l * endpointLaw side m a b l (bin r d) + +def labelsGivenDigit (side : Bool) (r : ℕ) (κ m a b t : ℝ) : Kernel (Fin r) Label := + FiniteKernelMixture.normalizedKernel + (fun l => Kernel.const (Fin r) (Measure.dirac l)) + (digitWeight side r κ m a b t) + (fun _ => measurable_of_countable _) + +def width (a b : ℝ) (which : Bool) : ℝ := if which then b else a + +def topLabel (which : Bool) : Label := some (if which then 2 else 0) +def bottomLabel (which : Bool) : Label := some (if which then 3 else 1) + +end Invariant233.CircleDigitCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleDigitMarginals.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleDigitMarginals.lean new file mode 100644 index 0000000000000000000000000000000000000000..aff6b35266f9ae40b917d9f98cb9c68193082ef2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleDigitMarginals.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleCoupling +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.MeasureTheory.Function.LpSeminorm.Basic + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal +namespace Invariant233.CircleCoupling +open CircleDigitCoupling CircleParameterData + +def hybridDigits (p : CircleParameterData) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (ε : ℕ → Bool) (ω : Sample) : + MixedRadix.Digits (MixedRadix.radices p.q) := + fun i => observedDigit p hr (ε i) i (ω i) + +def hybridPoint (p : CircleParameterData) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (ε : ℕ → Bool) (ω : Sample) : Circle := + MixedRadix.circleValue (hybridDigits p hr ε ω) + +def rawDensity (p : CircleParameterData) (j : ℕ) (side : Bool) (i : ℕ) : ℝ → ℝ := + if i = 0 then fun _ => 1 else + marginalDensity side (kappa (p.blockIndex i)) (p.m (p.blockIndex i)) + (p.a (p.blockIndex i)) (p.b (p.blockIndex i)) (tag j (p.blockIndex i)) + +def digitDensity (p : CircleParameterData) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (j : ℕ) (side : Bool) (i : ℕ) : Fin (MixedRadix.radices p.q i) → ℝ := by + letI : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + exact UniformQuantization.binAverage (MixedRadix.radices p.q i) (rawDensity p j side i) + +def digitReference (p : CircleParameterData) (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (i : ℕ) : Measure (Fin (MixedRadix.radices p.q i)) := by + letI : NeZero (MixedRadix.radices p.q i) := ⟨Nat.ne_of_gt (hr i)⟩ + exact (PMF.uniformOfFintype (Fin (MixedRadix.radices p.q i))).toMeasure + +def marginalBound : ℝ := Real.exp (25 * ((∑' s : ℕ, kappa s ^ 2) + 1)) + +def DigitMarginalLaws (p : CircleParameterData) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) : Prop := + 0 < marginalBound ∧ ∀ (j : ℕ) (ε : ℕ → Bool), + ∃ H : Circle → ℝ, MemLp H 2 volume ∧ (0 ≤ᵐ[volume] H) ∧ + (∫ x, H x) = 1 ∧ eLpNorm H 2 volume ≤ ENNReal.ofReal marginalBound ∧ + (law p j).map (hybridPoint p hr ε) = + volume.withDensity (fun x => ENNReal.ofReal (H x)) + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleOrderedCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleOrderedCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb526de0c5f4e3a4f05da24b7ed19476ba05fe88 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleOrderedCoupling.lean @@ -0,0 +1,33 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleDigitMarginals +import OAI.Analysis.IrrationalRotation.Model.ParameterCircleOperator +import OAI.Analysis.IrrationalRotation.Model.CircleRationalGraphs + +namespace OAI + +noncomputable section +open MeasureTheory +namespace Invariant233.CircleCoupling + +def finiteHybridChoice (N i : ℕ) : Bool := decide (i < N + 1) + +def finiteHybridPoint (p : CircleParameterData) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (N : ℕ) : Sample → Circle := + hybridPoint p hr (finiteHybridChoice N) + +def OrderedCouplingIdentities (p : CircleParameterData) (θ : ℝ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber) : Prop := + ∀ j : ℕ, ∀ᵐ ω ∂law p j, + (1 - F (point p hr true ω)) * + ratioDiagonal (p.floorCocycle θ) (point p hr false ω, point p hr true ω) * + F (point p hr false ω) = 0 ∧ + ∀ k : ℤ, 0 < p.floorCocycle θ k (point p hr true ω) / + p.floorCocycle θ k (point p hr false ω) ∧ + p.floorCocycle θ k (point p hr true ω) / + p.floorCocycle θ k (point p hr false ω) ≤ 1 + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleParameters.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..b5a08aa61567d5b72e247f3f9da3109ed2bec37a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleParameters.lean @@ -0,0 +1,181 @@ +import OAI.Analysis.IrrationalRotation.Model.Analytic +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.MeasureTheory.Function.LpSeminorm.Basic +import Mathlib.Topology.ContinuousMap.Basic +import Mathlib.Data.Int.Interval + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators ENNReal + +namespace Invariant233 + +structure CircleParameterData where + m : ℕ → ℕ + K : ℕ → ℕ + G : ℕ → ℕ + q : ℕ → ℕ + L : ℕ → ℝ + C : ℕ → ℝ + ε : ℕ → ℝ + height : ℕ → ℕ + partition : ℕ → ℕ → C(Circle, ℝ) + samples : ℕ → ℕ → Finset ℕ + +namespace CircleParameterData + +def rep (x : Circle) : ℝ := (AddCircle.equivIco (1 : ℝ) 0 x : ℝ) + +def delta (z : ℝ) : ℝ := min (Int.fract z) (1 - Int.fract z) + +def kernelWidth (m : ℕ) : ℝ := (m : ℝ) ^ (-(3 / 5 : ℝ)) + +def kernel (m : ℕ) (z v : ℝ) : ℝ := + if (1 / (m : ℝ) ^ 2 ≤ delta z) ∧ 0 < v ∧ v < kernelWidth m * delta z + then 1 / (kernelWidth m * delta z) else 0 + +def orientedKernel (endpoint : Bool) (m : ℕ) (z v : ℝ) : ℝ := + if endpoint then kernel m (z - v) v else kernel m z v + +def blockEnd (p : CircleParameterData) (j : ℕ) : ℕ := + ∑ s ∈ Finset.Icc 1 j, p.m s + +def blockIndex (p : CircleParameterData) (i : ℕ) : ℕ := by + classical + exact if h : ∃ j, i ≤ p.blockEnd j then Nat.find h else 0 + +def flattenedFrequency (p : CircleParameterData) (n : ℕ) : ℤ := p.q (n + 1) + +def flattenedCost (p : CircleParameterData) (n : ℕ) : ℝ := + p.C (p.blockIndex (n + 1)) + +def block (p : CircleParameterData) (j : ℕ) : Finset ℕ := + Finset.Icc (p.blockEnd (j - 1) + 1) (p.blockEnd j) + +def N (p : CircleParameterData) (j : ℕ) : ℝ := (p.m j : ℝ) * p.K j + +def a (p : CircleParameterData) (j : ℕ) : ℝ := (p.G j : ℝ) / p.m j + +def b (p : CircleParameterData) (j : ℕ) : ℝ := (p.m j : ℝ) ^ (-(19 / 20 : ℝ)) + +def Q (p : CircleParameterData) (j : ℕ) : ℝ := + (p.m j : ℝ) ^ ((7 / 10 : ℝ) * p.m j) + +def kappa (j : ℕ) : ℝ := 1 / (100 * (j : ℝ)) + +def alpha (p : CircleParameterData) (θ : ℝ) (i : ℕ) : ℝ := + Int.fract ((p.q i : ℝ) * θ) + +def coordinate (p : CircleParameterData) (i : ℕ) (x : Circle) : ℝ := + rep (p.q i • x) + +def ell (p : CircleParameterData) (j : ℕ) : ℝ := + 1 / (((j + 1 : ℕ) : ℝ) ^ 2 * (1 + (p.blockEnd (j - 1) : ℝ)) * + (p.q (p.blockEnd (j - 1)) : ℝ)) + +def shift (p : CircleParameterData) (j r : ℕ) : ℝ := + (r : ℝ) / p.q (p.blockEnd (j - 1)) + +def coefficientBound (p : CircleParameterData) (j : ℕ) : ℝ := + Real.exp (((p.K j : ℝ) + 1) * + ∑ s ∈ Finset.Icc 1 (j - 1), p.C s * p.m s) + +def convolutionCoefficient (K : ℕ) (A B : ℤ → ℂ) (n : ℤ) : ℂ := + ∑ t ∈ Finset.Icc (-(K : ℤ)) (K : ℤ), A t * B (n - t) + +def samplingAverage (p : CircleParameterData) (θ : ℝ) (j r : ℕ) + (endpoint : Bool) (x : Circle) : ℝ := + (1 / ((p.samples j r).card : ℝ)) * + ∑ n ∈ p.samples j r, ∏ i ∈ p.block j, + orientedKernel endpoint (p.m j) (p.coordinate i x) + (Int.fract ((n : ℝ) * p.alpha θ i)) + +end CircleParameterData + +open CircleParameterData + +structure CircleParameterLaws (θ : ℝ) (p : CircleParameterData) : Prop where + m_pos : ∀ j, 1 ≤ j → 0 < p.m j + K_pos : ∀ j, 1 ≤ j → 0 < p.K j + G_pos : ∀ j, 1 ≤ j → 0 < p.G j + q_pos : ∀ i, 0 < p.q i + L_pos : ∀ j, 1 ≤ j → 0 < p.L j + C_pos : ∀ j, 1 ≤ j → 0 < p.C j + epsilon_pos : ∀ j, 1 ≤ j → 0 < p.ε j + partition_nonneg : ∀ j, 1 ≤ j → ∀ n, n ≤ p.height j → + ∀ x, 0 ≤ p.partition j n x + partition_sum : ∀ j, 1 ≤ j → ∀ x, + (∑ n ∈ Finset.range (p.height j + 1), p.partition j n x) = 1 + partition_support : ∀ j, 1 ≤ j → ∀ n, n ≤ p.height j → + ∀ x ∈ tsupport (p.partition j n), + dist (x + (((n : ℝ) * θ : ℝ) : Circle)) 0 < 1 / (10 * (j : ℝ)) + frequency_zero : p.q 0 = 1 + frequency_increasing : StrictMono p.q + frequency_divisible : ∀ i, p.q i ∣ p.q (i + 1) + phase_bounds : ∀ j, 1 ≤ j → ∀ i ∈ p.block j, + 1 / p.N j < p.alpha θ i ∧ p.alpha θ i < 2 / p.N j + frequency_ratios : ∀ j, 1 ≤ j → ∀ i ∈ p.block j, + p.N j ≤ (p.q (i + 1) : ℝ) / p.q i + spread_high : ∀ j, 1 ≤ j → ∀ k : ℤ, + p.N j / 4 ≤ |(k : ℝ)| → + |(k : ℝ)| ≤ (p.m j : ℝ) ^ ((4 / 5 : ℝ) * p.m j) → + (p.m j : ℝ) / 20 ≤ + ((p.block j).filter (fun i => + 1 - Int.fract ((k : ℝ) * p.alpha θ i) ∈ Set.Icc (p.b j) (1 - p.b j))).card + spread_low : ∀ j, 1 ≤ j → ∀ k : ℤ, + (p.G j : ℝ) * p.K j ≤ |(k : ℝ)| → |(k : ℝ)| ≤ p.N j / 4 → + ∀ i ∈ p.block j, + 1 - Int.fract ((k : ℝ) * p.alpha θ i) ∈ Set.Icc (p.a j) (1 - p.a j) + initial_K : p.K 1 = 100 + initial_G : p.G 1 = 1 + L_ge_one : ∀ j, 1 ≤ j → 1 ≤ p.L j + L_monotone : ∀ j k, 1 ≤ j → j ≤ k → p.L j ≤ p.L k + C_eq : ∀ j, 1 ≤ j → p.C j = max (p.L j) ((p.K j : ℝ) ^ 2) + m_ge_K : ∀ j, 1 ≤ j → p.K j ≤ p.m j + m_ge_pow : ∀ j, 1 ≤ j → 2 ^ j ≤ p.m j + m_ge_G : ∀ j, 1 ≤ j → 4 * p.G j ≤ p.m j + m_ge_200 : ∀ j, 1 ≤ j → 200 ≤ p.m j + next_K : ∀ j, 1 ≤ j → + p.K (j + 1) = ⌈(p.m j : ℝ) ^ ((3 / 4 : ℝ) * p.m j)⌉₊ + K_double : ∀ j, 1 ≤ j → 2 * p.K j < p.K (j + 1) + next_G_gap : ∀ j, 1 ≤ j → + (p.G (j + 1) : ℝ) * p.K (j + 1) < + (p.m j : ℝ) ^ ((4 / 5 : ℝ) * p.m j) + attenuation_m : ∀ j, 1 ≤ j → + p.L j ≤ kappa j * (p.m j : ℝ) ^ (1 / 40 : ℝ) + attenuation_G : ∀ j, 1 ≤ j → + p.L j ≤ kappa (j + 1) * Real.sqrt (p.G (j + 1) : ℝ) + continuity_height : ∀ j, 1 ≤ j → + (p.height (j + 1) : ℝ) / p.K (j + 1) ≤ (1 / 2 : ℝ) ^ j + polynomial_lower : ∀ j, 1 ≤ j → ∀ A B : ℤ → ℂ, + Function.support A ⊆ Set.Icc (-(p.K j : ℤ)) (p.K j : ℤ) → + Function.support B ⊆ Set.Icc (-(p.K j : ℤ)) (p.K j : ℤ) → + (∀ n, ‖A n‖ ≤ p.coefficientBound j) → + (∀ n, ‖B n‖ ≤ p.coefficientBound j) → + 1 / (j : ℝ) ≤ ‖A 0‖ → 1 / (j : ℝ) ≤ ‖B 0‖ → + ∃ n ∈ Finset.Icc 0 (2 * p.K j), + p.ε j ≤ ‖convolutionCoefficient (p.K j) A B (-(n : ℤ))‖ + polynomial_attenuation : ∀ j, 1 ≤ j → + ((2 * p.K j + 1 : ℕ) : ℝ) * 3 * Real.exp (-p.L j / 10000) ≤ p.ε j / j + samples_nonempty : ∀ j, 1 ≤ j → ∀ r, + r < p.q (p.blockEnd (j - 1)) → (p.samples j r).Nonempty + samples_positive : ∀ j, 1 ≤ j → ∀ r, + r < p.q (p.blockEnd (j - 1)) → ∀ n ∈ p.samples j r, 0 < n + samples_range : ∀ j, 1 ≤ j → ∀ r, + r < p.q (p.blockEnd (j - 1)) → ∀ n ∈ p.samples j r, + p.Q j / 2 ≤ (n : ℝ) ∧ (n : ℝ) ≤ p.Q j + samples_phase : ∀ j, 1 ≤ j → ∀ r, + r < p.q (p.blockEnd (j - 1)) → ∀ n ∈ p.samples j r, + Int.fract ((n : ℝ) * θ - p.shift j r) ∈ Set.Ioo 0 (p.ell j) + sampling_L2 : ∀ j, 1 ≤ j → ∀ r, + r < p.q (p.blockEnd (j - 1)) → ∀ endpoint : Bool, + eLpNorm (fun x => p.samplingAverage θ j r endpoint x - 1) 2 circleMeasure < + ENNReal.ofReal (1 / (j : ℝ)) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleRationalGraphs.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleRationalGraphs.lean new file mode 100644 index 0000000000000000000000000000000000000000..bfe54c34a642a60594c290430e8c691a58a9a441 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleRationalGraphs.lean @@ -0,0 +1,36 @@ +import OAI.Analysis.IrrationalRotation.Model.ParameterCircleWeights +import OAI.Analysis.IrrationalRotation.Model.CompactTransfer +import Mathlib.MeasureTheory.Measure.FiniteMeasure + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233 + +def circleTranslationGraph (t : Circle) : FiniteMeasure (Circle × Circle) := + ⟨circleMeasure.map (fun x => (x, x + t)), by + change IsFiniteMeasure ((volume : Measure Circle).map (fun x => (x, x + t))) + infer_instance⟩ + +namespace CircleParameterData + +def rationalTranslation (p : CircleParameterData) (A : ℕ) (r : ℤ) : Circle := + (((r : ℝ) / (p.q A : ℝ) : ℝ) : Circle) + +def rationalRatioBound (p : CircleParameterData) (A : ℕ) : ℝ := + Real.exp (∑ i ∈ Finset.range (A - 1), p.flattenedCost i) + +def RationalGraphIdentities (p : CircleParameterData) (θ : ℝ) + (P : Circle → SequenceHilbert ℤ →L[ℂ] SequenceHilbert ℤ) : Prop := + ∀ᵐ x ∂circleMeasure, ∀ A : ℕ, 1 ≤ A → ∀ r : ℤ, + (1 - P (x + p.rationalTranslation A r)) * + ratioDiagonal (p.floorCocycle θ) (x, x + p.rationalTranslation A r) * P x = 0 + +end CircleParameterData +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleSamplingGraph.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleSamplingGraph.lean new file mode 100644 index 0000000000000000000000000000000000000000..9685b0da3f2f07b23b8cd8e950a593e6171e72e6 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleSamplingGraph.lean @@ -0,0 +1,35 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleParameters +import Mathlib.MeasureTheory.Measure.WithDensity + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators ENNReal + +namespace Invariant233.CircleParameterData + +def samplingDensity (p : CircleParameterData) (θ : ℝ) (j n : ℕ) + (endpoint : Bool) (x : Circle) : ℝ := + ∏ i ∈ p.block j, orientedKernel endpoint (p.m j) (p.coordinate i x) + (Int.fract ((n : ℝ) * p.alpha θ i)) + +def samplingTranslation (θ : ℝ) (n : ℕ) (x : Circle) : Circle := + x + (((n : ℝ) * θ : ℝ) : Circle) + +def samplingGraph (p : CircleParameterData) (θ : ℝ) (j n : ℕ) : + Measure (Circle × Circle) := + (circleMeasure.withDensity + (fun x => ENNReal.ofReal (p.samplingDensity θ j n false x))).map + (fun x => (x, samplingTranslation θ n x)) + +def samplingGraphAverage (p : CircleParameterData) (θ : ℝ) (j r : ℕ) : + Measure (Circle × Circle) := + ENNReal.ofReal (1 / ((p.samples j r).card : ℝ)) • + ∑ n ∈ p.samples j r, p.samplingGraph θ j n + +end Invariant233.CircleParameterData + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleSamplingStage.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleSamplingStage.lean new file mode 100644 index 0000000000000000000000000000000000000000..c543f6a3dc624930bceda9f9fd1d8ef53f7b23d4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleSamplingStage.lean @@ -0,0 +1,52 @@ +import OAI.Analysis.IrrationalRotation.Model.TrialSampling +import OAI.Analysis.IrrationalRotation.Model.StrictPhase + +namespace OAI + +noncomputable section +open MeasureTheory Set +open scoped BigOperators ENNReal + +namespace Invariant233 + +structure CircleSamplingStage (θ : ℝ) (j K d q₀ m : ℕ) (R : ℝ) where + q : ℕ → ℕ + samples : Fin q₀ → Finset ℕ + q_zero : q 0 = q₀ + q_pos : ∀ i, 0 < q i + q_strict : StrictMono q + q_div : ∀ i, q i ∣ q (i + 1) + q_ratio : ∀ i < m, R ≤ (q (i + 1) : ℝ) / q i + phases : ∀ i : Fin m, + Int.fract ((q (i.val + 1) : ℝ) * θ) ∈ + Ioo (1 / ((m : ℝ) * K)) (2 / ((m : ℝ) * K)) + spread : ProductPhases.strictLargePhaseCondition Finset.univ ((m : ℝ) * K) + (fun i : Fin m => Int.fract ((q (i.val + 1) : ℝ) * θ)) + samples_nonempty : ∀ r, (samples r).Nonempty + samples_positive : ∀ r, ∀ n ∈ samples r, 0 < n + samples_range : ∀ r, ∀ n ∈ samples r, + (m : ℝ) ^ ((7 / 10 : ℝ) * m) / 2 ≤ n ∧ + (n : ℝ) ≤ (m : ℝ) ^ ((7 / 10 : ℝ) * m) + samples_phase : ∀ r, ∀ n ∈ samples r, + Int.fract ((n : ℝ) * θ - (r.val : ℝ) / q₀) ∈ + Ioo 0 (1 / (((j + 1 : ℕ) : ℝ) ^ 2 * (1 + (d : ℝ)) * q₀)) + sampling_L2 : ∀ r endpoint, + eLpNorm (fun x : Circle => TrialSampling.average m (samples r) endpoint + (fun i : Fin m => Int.fract ((q (i.val + 1) : ℝ) * θ)) + (fun i : Fin m => (q (i.val + 1) : ℤ) • x) - 1) 2 circleMeasure < + ENNReal.ofReal (1 / (j : ℝ)) + +end Invariant233 + +namespace Invariant233 + +def CircleStageSupply (θ : ℝ) : Prop := + ∀ j K d q₀ : ℕ, 0 < j → 0 < K → 0 < q₀ → + ∀ᶠ m : ℕ in Filter.atTop, ∀ R : ℝ, + Nonempty (CircleSamplingStage θ j K d q₀ m R) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleSmoothing.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleSmoothing.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7c89e37030938e0657e50186fed18bb14ffb154 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleSmoothing.lean @@ -0,0 +1,23 @@ +import OAI.Analysis.IrrationalRotation.Model.SawtoothSmoothing +import Mathlib.Topology.Instances.AddCircle.Defs + +namespace OAI + +noncomputable section + +namespace InvariantProjection.Continuity + +def circleSmoothSawtooth (δ : ℝ) : AddCircle (1 : ℝ) → ℝ := + AddCircle.liftIco 1 0 (smoothSawtooth δ) + +def circleSmoothedDrop (C a δ : ℝ) (x : AddCircle (1 : ℝ)) : ℝ := + C * (a + circleSmoothSawtooth δ x - circleSmoothSawtooth δ (x + (a : AddCircle (1 : ℝ)))) + +def circleSmoothingTransfer (C δ : ℝ) (x : AddCircle (1 : ℝ)) : ℝ := + C * (circleSmoothSawtooth δ x - (AddCircle.equivIco 1 0 x : ℝ)) + +end InvariantProjection.Continuity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleTailAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleTailAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..3907fe112e93404f6b3d37bc6ecf99abe7a7d9cd --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleTailAttenuation.lean @@ -0,0 +1,39 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleCoupling +import OAI.Analysis.IrrationalRotation.Model.ParameterCircleWeights +import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.CircleCoupling + +def tagEvent (p : CircleParameterData) (j : ℕ) : Set Sample := + {ω | ∃ i ∈ p.block j, label i ω = some 4} + +abbrev endpointSigma (p : CircleParameterData) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (side : Bool) : MeasurableSpace Sample := + MeasurableSpace.comap (point p hr side) inferInstance + +def TailAttenuation (θ : ℝ) (p : CircleParameterData) (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) : Prop := + ∀ k : ℤ, (p.K j : ℝ) < |(k : ℝ)| → + ∃ H₁ H₂ : Set Sample, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂law p j, + ((law p j)[H₁.indicator (fun _ => (1 : ℝ)) | endpointSigma p hr false]) ω ≤ + Real.exp (-p.L j / 400)) ∧ + (∀ᵐ ω ∂law p j, + ((law p j)[H₂.indicator (fun _ => (1 : ℝ)) | endpointSigma p hr true]) ω ≤ + Real.exp (-p.L j / 400)) ∧ + (∀ᵐ ω ∂law p j, ω ∈ tagEvent p j → + p.floorCocycle θ k (point p hr true ω) / + p.floorCocycle θ k (point p hr false ω) ≤ + Real.exp (-p.L j) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleTruncation.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleTruncation.lean new file mode 100644 index 0000000000000000000000000000000000000000..d965b0940ab2ea0ed497f28ab008b0d009438701 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleTruncation.lean @@ -0,0 +1,45 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleTruncationEvent +import OAI.Analysis.IrrationalRotation.Model.ConditionalConvolution +import OAI.Analysis.IrrationalRotation.Model.Rotation + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators ComplexConjugate + +namespace Invariant233.CircleCoupling + +def projectionDiagonal (F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber) + (x : Circle) : ℝ := ((F x (lp.single 2 0 1)) 0).re + +def projectionCoefficientA (θ : ℝ) (p : CircleParameterData) + (F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber) (x : Circle) (v : ℤ) : ℂ := + (F x (lp.single 2 0 1)) v / (p.floorCocycle θ v x : ℂ) + +def projectionCoefficientB (θ : ℝ) (p : CircleParameterData) + (F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber) (y : Circle) (v : ℤ) : ℂ := + (p.floorCocycle θ (-v) y : ℂ) * conj (((1 - F y) (lp.single 2 0 1)) (-v)) + +def truncationSum (θ : ℝ) (p : CircleParameterData) (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber) (ω : Sample) : ℝ := + ∑ n ∈ Finset.range (2 * p.K j + 1), + ‖InvariantProjection.ConditionalConvolution.truncated (p.K j) n + (projectionCoefficientA θ p F (point p hr false ω)) + (projectionCoefficientB θ p F (point p hr true ω))‖ + +def TruncationBounds (θ : ℝ) (p : CircleParameterData) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber) : Prop := + ∃ J : ℕ, 1 ≤ J ∧ ∀ j : ℕ, J ≤ j → + Real.exp (-90) / 2 ≤ (law p j).real (truncationEvent p j hr (projectionDiagonal F)) ∧ + (Real.exp (-90) / 2) * p.ε j ≤ + ∫ ω in truncationEvent p j hr (projectionDiagonal F), + truncationSum θ p j hr F ω ∂law p j + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleTruncationEvent.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleTruncationEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b8bf217095e0edc9e9f1d9cccd55b4c0047d6fc --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleTruncationEvent.lean @@ -0,0 +1,24 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleTailAttenuation + +namespace OAI + +noncomputable section +open MeasureTheory Set +namespace Invariant233.CircleCoupling + +def truncationEvent (p : CircleParameterData) (j : ℕ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) (r : Circle → ℝ) : Set Sample := + {ω | (∀ i ∈ p.block j, + (ω i).2.1 < 1 - 3 / (p.m j : ℝ) ∧ 3 / (p.m j : ℝ) < (ω i).2.2) ∧ + ω ∈ tagEvent p j ∧ + (∀ s, j < s → ∀ i ∈ p.block s, + (ω i).2.1 < 1 - 3 * (p.K j : ℝ) / p.N s ∧ + 3 * (p.K j : ℝ) / p.N s < (ω i).2.2) ∧ + 1 / (j : ℝ) ≤ r (point p hr false ω) ∧ + 1 / (j : ℝ) ≤ 1 - r (point p hr true ω)} + +end Invariant233.CircleCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CircleWeights.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CircleWeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..a607acbde531b4149a73a9a3ac33ab2d61b6417a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CircleWeights.lean @@ -0,0 +1,38 @@ +import Mathlib.Topology.Instances.AddCircle.Real +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Topology.Algebra.InfiniteSum.Real + +namespace OAI + +noncomputable section + +namespace Invariant233.CircleWeights + +def representative (x : UnitAddCircle) : ℝ := + AddCircle.equivIco (1 : ℝ) 0 x + +def coordinate {ι : Type*} (q : ι → ℤ) (i : ι) (x : UnitAddCircle) : ℝ := + representative (q i • x) + +def phase {ι : Type*} (θ : ℝ) (q : ι → ℤ) (i : ι) : ℝ := + Int.fract ((q i : ℝ) * θ) + +def rotate (θ : ℝ) (k : ℤ) (x : UnitAddCircle) : UnitAddCircle := + x + k • (θ : UnitAddCircle) + +def floorCost {ι : Type*} (θ : ℝ) (q : ι → ℤ) (c : ι → ℝ) + (k : ℤ) (x : UnitAddCircle) : ℝ := + ∑' i, c i * (Int.floor (coordinate q i x + (k : ℝ) * phase θ q i) : ℝ) + +def cocycle {ι : Type*} (θ : ℝ) (q : ι → ℤ) (c : ι → ℝ) + (k : ℤ) (x : UnitAddCircle) : ℝ := + Real.exp (-floorCost θ q c k x) + +def weight {ι : Type*} (θ : ℝ) (q : ι → ℤ) (c : ι → ℝ) : UnitAddCircle → ℝ := + cocycle θ q c 1 + +end Invariant233.CircleWeights + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ColumnOperator.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ColumnOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c3ed75cb135540122bcc335ba239b3508b64ca4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ColumnOperator.lean @@ -0,0 +1,20 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Analysis.Normed.Operator.Extend +import Mathlib.LinearAlgebra.Finsupp.LinearCombination + +namespace OAI + +namespace Invariant233.Fields + +noncomputable def rationalComplex (q : ℚ × ℚ) : ℂ := + Complex.equivRealProdCLM.symm ((q.1 : ℝ), (q.2 : ℝ)) + +variable {ι H F : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [NormedAddCommGroup F] [NormedSpace ℂ F] [CompleteSpace F] + +noncomputable def columnOperator (b : HilbertBasis ι ℂ H) (c : ι → F) : H →L[ℂ] F := + (Finsupp.linearCombination ℂ c).extendOfNorm (Finsupp.linearCombination ℂ b) + +end Invariant233.Fields + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/Commutant.lean b/lean/OAI/Analysis/IrrationalRotation/Model/Commutant.lean new file mode 100644 index 0000000000000000000000000000000000000000..7745e767bf5f585d4aa03901c27cf75a4280ea96 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/Commutant.lean @@ -0,0 +1,36 @@ +import Mathlib.Analysis.Complex.Basic +import Mathlib.Analysis.Normed.Operator.ContinuousLinearMap +import Mathlib.Algebra.Algebra.Subalgebra.Basic +import Mathlib.Topology.Algebra.Module.Spaces.PointwiseConvergenceCLM + +namespace OAI + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [NormedSpace ℂ H] + +def operatorCommutant (T : H →L[ℂ] H) : Subalgebra ℂ (H →L[ℂ] H) := + Subalgebra.centralizer ℂ ({T} : Set (H →L[ℂ] H)) + +def IsInvariant (T : H →L[ℂ] H) (L : Submodule ℂ H) : Prop := + ∀ x ∈ L, T x ∈ L + +def IsHyperinvariant (T : H →L[ℂ] H) (L : Submodule ℂ H) : Prop := + IsClosed (L : Set H) ∧ ∀ A ∈ operatorCommutant T, IsInvariant A L + +def IsTransitive (A : Subalgebra ℂ (H →L[ℂ] H)) : Prop := + ∀ L : Submodule ℂ H, IsClosed (L : Set H) → + (∀ B ∈ A, IsInvariant B L) → L = ⊥ ∨ L = ⊤ + +def HasNoNontrivialHyperinvariantSubspace (T : H →L[ℂ] H) : Prop := + ∀ L : Submodule ℂ H, IsHyperinvariant T L → L = ⊥ ∨ L = ⊤ + +noncomputable def strongOperatorUnderlying (B : H →Lₚₜ[ℂ] H) : H →L[ℂ] H := + (UniformConvergenceCLM.ofFun (RingHom.id ℂ) H {s : Set H | s.Finite}).symm B + +def IsStronglyClosed (A : Subalgebra ℂ (H →L[ℂ] H)) : Prop := + IsClosed {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ A} + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CompactTransfer.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CompactTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..3bc89968ebf0e8ccd7f8d6fe3b3414f01b5c7a2a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CompactTransfer.lean @@ -0,0 +1,31 @@ +import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic +import OAI.Analysis.IrrationalRotation.Model.UnrestrictedDiagonal +import Mathlib.Analysis.InnerProductSpace.Adjoint +import Mathlib.MeasureTheory.Measure.Map + +namespace OAI + +open MeasureTheory +open scoped NNReal +noncomputable section + +namespace Invariant233 + +instance sequenceHilbertIntMeasurableSpace : MeasurableSpace (SequenceHilbert ℤ) := borel _ + +instance sequenceHilbertIntBorelSpace : BorelSpace (SequenceHilbert ℤ) := ⟨rfl⟩ + +def UniformlyAbsolutelyContinuous {X ι : Type*} [MeasurableSpace X] + (μ : Measure X) (ν : ι → Measure X) : Prop := + ∀ ε : ℝ≥0, 0 < ε → ∃ δ : ℝ≥0, 0 < δ ∧ + ∀ A : Set X, MeasurableSet A → μ A < δ → ∀ i, ν i A < ε + +noncomputable def ratioDiagonal {X : Type*} (F : ℤ → X → ℝ) (t : X × X) : + SequenceHilbert ℤ →L[ℂ] SequenceHilbert ℤ := + SequenceHilbert.boundedDiagonal (fun i => ((F i t.2 / F i t.1 : ℝ) : ℂ)) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ConcreteSpectral.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ConcreteSpectral.lean new file mode 100644 index 0000000000000000000000000000000000000000..277098f41a90d40e5f2296d45547c8220f407167 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ConcreteSpectral.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.IrrationalRotation.Model.Spectral +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties +import OAI.Analysis.IrrationalRotation.Model.GeneratedVonNeumann + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal +namespace Invariant233 +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +def vectorFugledeKadisonDeterminant (ξ : H) (T : H →L[ℂ] H) : ℝ≥0∞ := + ⨅ ε : {r : ℝ // 0 < r}, ENNReal.ofReal + (Real.exp ((vectorTrace ξ (CFC.log (star T * T + ε.val • (1 : H →L[ℂ] H)))).re / 2)) + +def IsVectorBrownMeasure (ξ : H) (T : H →L[ℂ] H) (μ : Measure ℂ) : Prop := + IsProbabilityMeasure μ ∧ IsCompact μ.support ∧ ∀ z : ℂ, + vectorFugledeKadisonDeterminant ξ (T - z • (1 : H →L[ℂ] H)) = + logarithmicPotentialDeterminant μ z + +def operatorModulus (T : H →L[ℂ] H) : H →L[ℂ] H := CFC.sqrt (star T * T) + +def HasCountablyAtomicSpectralType (B : H →L[ℂ] H) : Prop := + ∃ S : Set ℂ, S.Countable ∧ + (⨆ z : S, Module.End.eigenspace B.toLinearMap z.val).topologicalClosure = ⊤ + +def polarConjugate (U B : H →L[ℂ] H) (n : ℤ) : H →L[ℂ] H := + if 0 ≤ n then U ^ n.toNat * B * star U ^ n.toNat + else star U ^ (-n).toNat * B * U ^ (-n).toNat + +def finitePolarAlgebra (U B : H →L[ℂ] H) (F : Finset ℤ) : VonNeumannAlgebra H := + vonNeumannGenerated {A | ∃ n ∈ F, A = polarConjugate U B n} + +def fullPolarAlgebra (U B : H →L[ℂ] H) : VonNeumannAlgebra H := + vonNeumannGenerated (Set.range (polarConjugate U B)) + +def ProductPolarStructure (U T : H →L[ℂ] H) : Prop := + star U * U = 1 ∧ U * star U = 1 ∧ T = U * operatorModulus T ∧ + Function.Injective (operatorModulus T) ∧ HasCountablyAtomicSpectralType (operatorModulus T) ∧ + (∀ F : Finset ℤ, + IsAbelianVonNeumannAlgebra (finitePolarAlgebra U (operatorModulus T) F) ∧ + IsAtomicVonNeumannAlgebra (finitePolarAlgebra U (operatorModulus T) F)) ∧ + IsAbelianVonNeumannAlgebra (fullPolarAlgebra U (operatorModulus T)) ∧ + IsDiffuseVonNeumannAlgebra (fullPolarAlgebra U (operatorModulus T)) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ConditionalConvolution.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ConditionalConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..f170016190c14aaa53595ef8e1a671b97180f59f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ConditionalConvolution.lean @@ -0,0 +1,84 @@ +import Mathlib.Data.Int.Interval +import Mathlib.Basic.Real.Basic +import Mathlib.Analysis.Complex.Basic +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic + +namespace OAI + +open MeasureTheory +open scoped ENNReal lp ComplexConjugate + +noncomputable section + +namespace InvariantProjection.ConditionalConvolution + +def window (K : ℕ) (n : ℕ) : Finset ℤ := + (Finset.Icc (-(K : ℤ)) (K : ℤ)).filter fun v => |(n : ℤ) + v| ≤ (K : ℤ) + +def selector (K : ℕ) (n : ℕ) (v : ℤ) : ℤ := + if (K : ℤ) < |v| then v else (n : ℤ) + v + +def omittedEvent {Ω : Type*} (H : ℤ → Set Ω) (K : ℕ) (n : ℕ) (v : ℤ) : Set Ω := + if v ∈ window K n then ∅ else H (selector K n v) + +def truncated (K : ℕ) (n : ℕ) (A B : ℤ → ℂ) : ℂ := + ∑ v ∈ window K n, A v * B (-(n : ℤ) - v) + +def coeffA {Ω : Type*} (ξ : Ω → ℓ²(ℤ, ℂ)) (Fx : Ω → ℤ → ℝ) + (ω : Ω) (v : ℤ) : ℂ := ξ ω v / (Fx ω v : ℂ) + +def coeffB {Ω : Type*} (γ : Ω → ℓ²(ℤ, ℂ)) (Fy : Ω → ℤ → ℝ) + (ω : Ω) (w : ℤ) : ℂ := (Fy ω (-w) : ℂ) * conj (γ ω (-w)) + +structure Data (Ω : Type*) [mΩ : MeasurableSpace Ω] (μ : Measure Ω) + (K : ℕ) (D a c η δ : ℝ) where + mX : MeasurableSpace Ω + mY : MeasurableSpace Ω + mX_le : mX ≤ mΩ + mY_le : mY ≤ mΩ + ξ : Ω → ℓ²(ℤ, ℂ) + γ : Ω → ℓ²(ℤ, ℂ) + ξ_measurable : StronglyMeasurable[mX] ξ + γ_measurable : StronglyMeasurable[mY] γ + ξ_unit : ∀ᵐ ω ∂μ, ‖ξ ω‖ ≤ 1 + γ_unit : ∀ᵐ ω ∂μ, ‖γ ω‖ ≤ 1 + Fx : Ω → ℤ → ℝ + Fy : Ω → ℤ → ℝ + Fx_measurable : ∀ k, Measurable[mΩ] (fun ω => Fx ω k) + Fy_measurable : ∀ k, Measurable[mΩ] (fun ω => Fy ω k) + Fx_pos : ∀ᵐ ω ∂μ, ∀ k, 0 < Fx ω k + Fy_pos : ∀ᵐ ω ∂μ, ∀ k, 0 < Fy ω k + Fx_zero : ∀ᵐ ω ∂μ, Fx ω 0 = 1 + Fy_zero : ∀ᵐ ω ∂μ, Fy ω 0 = 1 + zero_convolution : ∀ n : ℕ, n ≤ 2 * K → ∀ᵐ ω ∂μ, + (∑' v : ℤ, coeffA ξ Fx ω v * coeffB γ Fy ω (-(n : ℤ) - v)) = 0 + ratio_bounds : ∀ n : ℕ, n ≤ 2 * K → ∀ᵐ ω ∂μ, ∀ v : ℤ, + 0 < Fy ω ((n : ℤ) + v) / Fx ω v ∧ + Fy ω ((n : ℤ) + v) / Fx ω v ≤ + min (Fy ω v / Fx ω v) (Fy ω ((n : ℤ) + v) / Fx ω ((n : ℤ) + v)) ∧ + min (Fy ω v / Fx ω v) (Fy ω ((n : ℤ) + v) / Fx ω ((n : ℤ) + v)) ≤ 1 + E : Set Ω + E_measurable : MeasurableSet[mΩ] E + E_mass : c ≤ μ.real E + coefficient_bounds : ∀ᵐ ω ∂μ.restrict E, + (∀ v : ℤ, |v| ≤ (K : ℤ) → ‖coeffA ξ Fx ω v‖ ≤ D) ∧ + (∀ v : ℤ, |v| ≤ (K : ℤ) → ‖coeffB γ Fy ω v‖ ≤ D) ∧ + a ≤ ‖coeffA ξ Fx ω 0‖ ∧ a ≤ ‖coeffB γ Fy ω 0‖ + H₁ : ℤ → Set Ω + H₂ : ℤ → Set Ω + H₁_measurable : ∀ k, MeasurableSet[mΩ] (H₁ k) + H₂_measurable : ∀ k, MeasurableSet[mΩ] (H₂ k) + attenuation : ∀ᵐ ω ∂μ.restrict E, ∀ k : ℤ, (K : ℤ) < |k| → + Fy ω k / Fx ω k ≤ η + (H₁ k).indicator (fun _ => (1 : ℝ)) ω + + (H₂ k).indicator (fun _ => (1 : ℝ)) ω + conditional₁ : ∀ k : ℤ, (K : ℤ) < |k| → + μ[(H₁ k).indicator (fun _ => (1 : ℝ)) | mX] ≤ᵐ[μ] fun _ => δ + conditional₂ : ∀ k : ℤ, (K : ℤ) < |k| → + μ[(H₂ k).indicator (fun _ => (1 : ℝ)) | mY] ≤ᵐ[μ] fun _ => δ + +end InvariantProjection.ConditionalConvolution + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/Conjugation.lean b/lean/OAI/Analysis/IrrationalRotation/Model/Conjugation.lean new file mode 100644 index 0000000000000000000000000000000000000000..370afb4192670398f07e908303ce9ff85f7ded31 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/Conjugation.lean @@ -0,0 +1,14 @@ +import OAI.Analysis.IrrationalRotation.Model.Commutant + +namespace OAI + +namespace Invariant233 +variable {H : Type*} [NormedAddCommGroup H] [NormedSpace ℂ H] + +def IsConjugation (C : H → H) : Prop := + Function.Involutive C ∧ (∀ x y, C (x + y) = C x + C y) ∧ + (∀ (c : ℂ) x, C (c • x) = star c • C x) ∧ (∀ x, ‖C x‖ = ‖x‖) + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ConjugationDefect.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ConjugationDefect.lean new file mode 100644 index 0000000000000000000000000000000000000000..36107e6c13abc748e5e450ca20809badef2e13f0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ConjugationDefect.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.IrrationalRotation.Model.Conjugation +import Mathlib.Analysis.InnerProductSpace.Adjoint +import OAI.Analysis.IrrationalRotation.Model.Analytic + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Invariant233 + +variable (H : Type*) [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +abbrev HilbertConjugation := + {C : H ≃ₗᵢ⋆[ℂ] H // Function.Involutive C} + +variable {H} + +def IsConjugation.toHilbertConjugation {C : H → H} (hC : IsConjugation C) : + HilbertConjugation H := + ⟨{ toFun := C + invFun := C + left_inv := hC.1 + right_inv := hC.1 + map_add' := hC.2.1 + map_smul' := hC.2.2.1 + norm_map' := hC.2.2.2 }, hC.1⟩ + +def HilbertConjugation.conjugate (C : HilbertConjugation H) (T : H →L[ℂ] H) : + H →L[ℂ] H := + (((C.val : H →L⋆[ℂ] H).comp T).comp (C.val : H →L⋆[ℂ] H)) + +variable [CompleteSpace H] + +def conjugationDefect (C : HilbertConjugation H) (T : H →L[ℂ] H) (m : ℕ) : + H →L[ℂ] H := + ∑ j ∈ Finset.range (m + 1), + ((-1 : ℂ) ^ j * (m.choose j : ℂ)) • + ((star T) ^ (m - j) * C.conjugate (T ^ (m - j))) + +def IsInfiniteConjugationIsometry (C : HilbertConjugation H) (T : H →L[ℂ] H) : Prop := + Filter.Tendsto (fun m : ℕ => ‖conjugationDefect C T m‖ ^ (1 / (m : ℝ))) + Filter.atTop (nhds 0) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ContinuityCoboundary.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ContinuityCoboundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..3681b2cdbf49bdb69da8903706a43e89645ce7f6 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ContinuityCoboundary.lean @@ -0,0 +1,35 @@ +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Logic.Function.Iterate +import Mathlib.Basic.Real.Basic + +namespace OAI + +noncomputable section + +namespace InvariantProjection.Continuity + +variable {X : Type*} + +def backwardSum (σ : X ≃ X) (v : X → ℝ) (n : ℕ) (x : X) : ℝ := + ∑ r ∈ Finset.range n, v ((σ.symm : X → X)^[r + 1] x) + +def relocated (σ : X ≃ X) (h : X → ℝ) (φ : ℕ → X → ℝ) + (H : ℕ) (x : X) : ℝ := + ∑ n ∈ Finset.range (H + 1), + h ((σ.symm : X → X)^[n] x) * φ n ((σ.symm : X → X)^[n] x) + +def relocationTransfer (σ : X ≃ X) (h : X → ℝ) (φ : ℕ → X → ℝ) + (H : ℕ) (x : X) : ℝ := + ∑ n ∈ Finset.range (H + 1), backwardSum σ (fun y => h y * φ n y) n x + +def backwardAverage (σ : X ≃ X) (v : X → ℝ) (W : ℕ) (x : X) : ℝ := + (W : ℝ)⁻¹ * backwardSum σ v W x + +def backgroundTransfer (σ : X ≃ X) (v : X → ℝ) (W : ℕ) (x : X) : ℝ := + (W : ℝ)⁻¹ * ∑ n ∈ Finset.range W, backwardSum σ v (n + 1) x + +end InvariantProjection.Continuity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ContinuousConstruction.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ContinuousConstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ef9a850edd0a351db84ca5fa9368feb9e161810 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ContinuousConstruction.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.IrrationalRotation.Model.BackgroundData +import OAI.Analysis.IrrationalRotation.Model.ParameterSmoothing + +namespace OAI + +noncomputable section + +namespace Invariant233.CircleParameterData + +def rawCost (p : CircleParameterData) (θ : ℝ) (x : Circle) : ℝ := + ∑' n : ℕ, p.rawBlock θ (n + 1) x + +def continuousCost (p : CircleParameterData) (θ : ℝ) (d : BackgroundBumpData θ) + (x : Circle) : ℝ := + backgroundCost d x + ∑' n : ℕ, p.relocatedBlock θ (n + 1) x + +def continuousTransfer (p : CircleParameterData) (θ : ℝ) (d : BackgroundBumpData θ) + (x : Circle) : ℝ := + backgroundTransferSum d x - ∑' n : ℕ, + (p.smoothBlockTransfer θ (n + 1) x + p.relocatedBlockTransfer θ (n + 1) x) + +def continuousWeight (p : CircleParameterData) (θ : ℝ) (d : BackgroundBumpData θ) : + Circle → ℝ := + Function.update (fun x => Real.exp (-p.continuousCost θ d x)) 0 0 + +end Invariant233.CircleParameterData + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ContinuousCounterexample.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ContinuousCounterexample.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f00d8ba116fb6067bc48c03a46a76d154cd8c9c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ContinuousCounterexample.lean @@ -0,0 +1,22 @@ +import OAI.Analysis.IrrationalRotation.Rotation.Rotation +import OAI.Analysis.IrrationalRotation.Model.ConcreteSpectral + +namespace OAI + +/-! Continuous circle weights with invariant-projection and spectral properties. -/ + +namespace Invariant233 + +def Rotation.IsContinuousCounterexample (θ : ℝ) (f : C(Circle, ℝ)) : Prop := + IsContinuousCircleWeight f ∧ + let operator : Rotation.Hilbert →L[ℂ] Rotation.Hilbert := Rotation.weightedReal θ f + let factor : VonNeumannAlgebra Rotation.Hilbert := Rotation.algebra θ + operator ∈ factor ∧ + HasOnlyTrivialInvariantProjections (H := Rotation.Hilbert) factor operator ∧ + operator ≠ 0 ∧ + NormQuasinilpotent (A := Rotation.Hilbert →L[ℂ] Rotation.Hilbert) operator ∧ + vectorFugledeKadisonDeterminant (H := Rotation.Hilbert) Rotation.vacuum operator = 0 + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ContinuousExtendedCost.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ContinuousExtendedCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3ef877128c3435eb43294be112085f67c502f0d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ContinuousExtendedCost.lean @@ -0,0 +1,18 @@ +import OAI.Analysis.IrrationalRotation.Model.ContinuousConstruction + +namespace OAI + +noncomputable section +open scoped ENNReal + +namespace Invariant233.CircleParameterData + +def extendedContinuousCost (p : CircleParameterData) (θ : ℝ) + (d : BackgroundBumpData θ) : Circle → ℝ≥0∞ := + Function.update (fun x => ENNReal.ofReal (p.continuousCost θ d x)) 0 ∞ + +end Invariant233.CircleParameterData + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CouplingMarginalBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CouplingMarginalBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..824fc0a2edcc766ba546eece4114f2ad66bc2a10 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CouplingMarginalBounds.lean @@ -0,0 +1,26 @@ +import Mathlib + +namespace OAI + +namespace Invariant233.CouplingMarginalBounds + +open MeasureTheory + +noncomputable def rho (κ m w : ℝ) : ℝ := κ * Real.sqrt (w / m) + +noncomputable def diagonalMass (κ m a b t : ℝ) : ℝ := + 1 - 2 * rho κ m a - 2 * rho κ m b - t / m + +noncomputable def uniformDensity {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) (s : Set Ω) : Ω → ℝ := + s.indicator (fun _ => (μ.real s)⁻¹) + +noncomputable def componentProbabilities (κ m a b t : ℝ) : Fin 5 → ℝ := + ![rho κ m a, rho κ m a, rho κ m b, rho κ m b, t / m] + +noncomputable def componentVarianceBounds (m a b : ℝ) : Fin 5 → ℝ := + ![2 / a, 2 / a, 2 / b, 2 / b, m] + +end Invariant233.CouplingMarginalBounds + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/CouplingMixture.lean b/lean/OAI/Analysis/IrrationalRotation/Model/CouplingMixture.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6c17a39f3055cdd91c239ade91979b526c55a5d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/CouplingMixture.lean @@ -0,0 +1,30 @@ +import Mathlib + +namespace OAI + +open MeasureTheory ProbabilityTheory Set +open scoped BigOperators ENNReal ProbabilityTheory + +namespace Invariant233.CouplingMixture + +variable {X I : Type*} [MeasurableSpace X] [Fintype I] + +noncomputable def diagonal (μ : Measure X) : Measure (X × X) := + μ.map (fun x => (x, x)) + +noncomputable def mixture (μ : Measure X) (q : ℝ≥0∞) (p : I → ℝ≥0∞) + (u v : I → Measure X) : Measure (X × X) := + q • diagonal μ + ∑ i, p i • (u i).prod (v i) + +noncomputable def intervalLaw (a b : ℝ) : Measure ℝ := + volume[|Ico a b] + +noncomputable def labelledMixture [MeasurableSpace (Option I)] (μ : Measure X) + (q : ℝ≥0∞) (p : I → ℝ≥0∞) (u v : I → Measure X) : + Measure (Option I × (X × X)) := + q • (diagonal μ).map (fun z => (none, z)) + + ∑ i, p i • ((u i).prod (v i)).map (fun z => (some i, z)) + +end Invariant233.CouplingMixture + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/Diagonal.lean b/lean/OAI/Analysis/IrrationalRotation/Model/Diagonal.lean new file mode 100644 index 0000000000000000000000000000000000000000..04f0f1cbace23d58fecfcad8c256bb204eb6d3ef --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/Diagonal.lean @@ -0,0 +1,79 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Analysis.Normed.Operator.Basic + +namespace OAI + +noncomputable section +open scoped ENNReal lp + +namespace Invariant233 + +abbrev SequenceHilbert (I : Type*) := lp (fun _ : I => ℂ) 2 + +namespace SequenceHilbert +variable {I : Type*} + +def diagonalLinear (a : I → ℂ) (C : ℝ) (ha : ∀ i, ‖a i‖ ≤ C) : + SequenceHilbert I →ₗ[ℂ] SequenceHilbert I where + toFun x := ⟨fun i => a i * x i, by + apply Memℓp.mono ((lp.memℓp x).norm.const_mul C) + intro i + rw [norm_mul] + exact mul_le_mul_of_nonneg_right (ha i) (norm_nonneg _)⟩ + map_add' x y := by + apply lp.ext + funext i + exact mul_add _ _ _ + map_smul' c x := by + apply lp.ext + funext i + change a i * (c * x i) = c * (a i * x i) + ring + +def diagonal (a : I → ℂ) (C : ℝ) (hC : 0 ≤ C) (ha : ∀ i, ‖a i‖ ≤ C) : + SequenceHilbert I →L[ℂ] SequenceHilbert I := + (diagonalLinear a C ha).mkContinuous C (by + intro x + calc + ‖diagonalLinear a C ha x‖ ≤ ‖C • x‖ := by + apply lp.norm_mono (by norm_num : (2 : ℝ≥0∞) ≠ 0) + intro i + change ‖a i * x i‖ ≤ ‖C • x i‖ + rw [norm_mul, norm_smul, Real.norm_eq_abs, abs_of_nonneg hC] + exact mul_le_mul_of_nonneg_right (ha i) (norm_nonneg _) + _ = C * ‖x‖ := by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg hC]) + +def reindex (e : Equiv.Perm I) : SequenceHilbert I ≃ₗᵢ[ℂ] SequenceHilbert I where + toFun x := ⟨fun i => x (e.symm i), by + apply memℓp_gen + exact e.symm.summable_iff.mpr ((lp.memℓp x).summable (by norm_num))⟩ + invFun x := ⟨fun i => x (e i), by + apply memℓp_gen + exact e.summable_iff.mpr ((lp.memℓp x).summable (by norm_num))⟩ + left_inv x := by + apply lp.ext + funext i + simp + right_inv x := by + apply lp.ext + funext i + simp + map_add' x y := by + apply lp.ext + funext i + rfl + map_smul' c x := by + apply lp.ext + funext i + rfl + norm_map' x := by + simp only [lp.norm_eq_tsum_rpow (by norm_num : 0 < (2 : ℝ≥0∞).toReal)] + exact congrArg (fun t : ℝ => t ^ (1 / (2 : ℝ≥0∞).toReal)) + (e.symm.tsum_eq (fun i => ‖x i‖ ^ (2 : ℝ≥0∞).toReal)) + +end SequenceHilbert +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/DiagonalGauge.lean b/lean/OAI/Analysis/IrrationalRotation/Model/DiagonalGauge.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9f953b9717c112cb80a69cef3d6e9a2b82c0925 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/DiagonalGauge.lean @@ -0,0 +1,37 @@ +import OAI.Analysis.IrrationalRotation.Model.WeightedShift +import Mathlib.Analysis.Fourier.AddCircle +import Mathlib.MeasureTheory.Function.LpSpace.Basic + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.DiagonalGauge + +abbrev Circle := AddCircle (1 : ℝ) +abbrev Fiber := WeightedShift.Hilbert + +def weight (t : Circle) : WeightedShift.Weight := + ⟨fun k => fourier k t, memℓp_infty <| by + refine ⟨1, ?_⟩ + rintro r ⟨k, rfl⟩ + exact (Circle.norm_coe _).le⟩ + +def fiberOperator (t : Circle) : Fiber →L[ℂ] Fiber := + WeightedShift.diagonal (weight t) + +def fieldOperator {X : Type*} [MeasurableSpace X] (μ : Measure X) (t : Circle) : + Lp Fiber 2 μ →L[ℂ] Lp Fiber 2 μ := + (fiberOperator t).compLpL 2 μ + +def conjugate {X : Type*} [MeasurableSpace X] (μ : Measure X) + (A : Lp Fiber 2 μ →L[ℂ] Lp Fiber 2 μ) (t : Circle) : + Lp Fiber 2 μ →L[ℂ] Lp Fiber 2 μ := + fieldOperator μ t * A * fieldOperator μ (-t) + +end Invariant233.DiagonalGauge + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ExponentialWeight.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ExponentialWeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e8ae44fc811ee0e4f54a17af908cd45d5985460 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ExponentialWeight.lean @@ -0,0 +1,13 @@ +import Mathlib.Analysis.SpecialFunctions.Exp + +namespace OAI + +namespace Invariant233 + +noncomputable def exponentialWeight {X : Type*} (x₀ : X) (g : X → ℝ) : X → ℝ := by + classical + exact Function.update (fun x => Real.exp (-g x)) x₀ 0 + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/Fejer.lean b/lean/OAI/Analysis/IrrationalRotation/Model/Fejer.lean new file mode 100644 index 0000000000000000000000000000000000000000..ab8aa5ccf93b335635db315e30ab60a273cdccee --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/Fejer.lean @@ -0,0 +1,26 @@ +import Mathlib.Analysis.Fourier.AddCircle + +namespace OAI + +noncomputable section + +namespace Invariant233.Fejer + +abbrev Circle := AddCircle (1 : ℝ) + +def geometricPolynomial (H : ℕ) (x : Circle) : ℂ := + ∑ k ∈ Finset.range H, fourier (k : ℤ) x + +def kernel (H : ℕ) (x : Circle) : ℝ := + Complex.normSq (geometricPolynomial H x) / H + +def frequencies (H : ℕ) : Finset ℤ := Finset.Ioo (-(H : ℤ)) (H : ℤ) + +def coefficient (H : ℕ) (n : ℤ) : ℂ := + fourierCoeff (fun x : Circle => (kernel H x : ℂ)) n + +end Invariant233.Fejer + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/FejerApproximation.lean b/lean/OAI/Analysis/IrrationalRotation/Model/FejerApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..7809fad6d3fbe3f5a6f547abd7214710cf795613 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/FejerApproximation.lean @@ -0,0 +1,20 @@ +import OAI.Analysis.IrrationalRotation.Model.Fejer + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.Fejer + +def approximation (H : ℕ) (f : Circle → ℝ) (x : Circle) : ℝ := + ∫ y, kernel H (x - y) * f y + +def approximationCoefficient (H : ℕ) (f : Circle → ℝ) (v : ℤ) : ℂ := + coefficient H v * ∫ y, fourier (-v) y * (f y : ℂ) + +end Invariant233.Fejer + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/FieldDiagonal.lean b/lean/OAI/Analysis/IrrationalRotation/Model/FieldDiagonal.lean new file mode 100644 index 0000000000000000000000000000000000000000..e83a88125cb3c6cf14b0653c475210f035cbcac3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/FieldDiagonal.lean @@ -0,0 +1,98 @@ +import OAI.Analysis.IrrationalRotation.Model.WeightedShift +import Mathlib.MeasureTheory.Function.L2Space +import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal lp Topology + +namespace Invariant233.WeightedShift +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem diagonal_value (w : Weight) (v : Hilbert) (i : ℤ) : + diagonal w v i = w i * v i := rfl + +theorem diagonal_bound (w : Weight) (C : ℝ) (hw : ‖w‖ ≤ C) (v : Hilbert) : + ‖diagonal w v‖ ≤ C * ‖v‖ := by + apply (diagonal w).le_of_opNorm_le + exact (lp.norm_mapCLM_le 2 _ (norm_nonneg w) _).trans hw + +theorem diagonal_aestronglyMeasurable (a : X → Weight) (C : ℝ) (_hC : 0 ≤ C) + (_ha : ∀ x, ‖a x‖ ≤ C) + (hm : ∀ i, AEStronglyMeasurable (fun x => a x i) μ) + {f : X → Hilbert} (hf : AEStronglyMeasurable f μ) : + AEStronglyMeasurable (fun x => diagonal (a x) (f x)) μ := by + classical + let : Nonempty (Finset ℤ) := ⟨∅⟩ + let F : Finset ℤ → X → Hilbert := + fun s => ∑ i ∈ s, fun x => lp.single 2 i (a x i * f x i) + apply aestronglyMeasurable_of_tendsto_ae (atTop : Filter (Finset ℤ)) + (f := F) + · intro s + apply Finset.aestronglyMeasurable_sum + intro i hi + exact (lp.singleContinuousLinearMap ℂ (fun _ : ℤ => ℂ) 2 i).continuous.comp_aestronglyMeasurable + ((hm i).mul ((lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 i).continuous.comp_aestronglyMeasurable hf)) + · apply Filter.Eventually.of_forall + intro x + simpa only [F, Finset.sum_apply, diagonal_value, HasSum, SummationFilter.unconditional] using + lp.hasSum_single (by norm_num) (diagonal (a x) (f x)) + +def fieldDiagonalVec (a : X → Weight) (C : ℝ) (hC : 0 ≤ C) + (ha : ∀ x, ‖a x‖ ≤ C) + (hm : ∀ i, AEStronglyMeasurable (fun x => a x i) μ) + (f : Lp (Hilbert) 2 μ) : Lp (Hilbert) 2 μ := + ((Lp.memLp f).of_le_mul + (diagonal_aestronglyMeasurable a C hC ha hm (Lp.aestronglyMeasurable f)) + (Filter.Eventually.of_forall fun x => diagonal_bound (a x) C (ha x) (f x))).toLp _ + +theorem fieldDiagonalVec_ae (a : X → Weight) (C : ℝ) (hC : 0 ≤ C) + (ha : ∀ x, ‖a x‖ ≤ C) + (hm : ∀ i, AEStronglyMeasurable (fun x => a x i) μ) + (f : Lp (Hilbert) 2 μ) : + fieldDiagonalVec a C hC ha hm f =ᵐ[μ] + fun x => diagonal (a x) (f x) := + MemLp.coeFn_toLp _ + +def fieldDiagonalLinear (a : X → Weight) (C : ℝ) (hC : 0 ≤ C) + (ha : ∀ x, ‖a x‖ ≤ C) + (hm : ∀ i, AEStronglyMeasurable (fun x => a x i) μ) : + Lp (Hilbert) 2 μ →ₗ[ℂ] Lp (Hilbert) 2 μ where + toFun := fieldDiagonalVec a C hC ha hm + map_add' f g := by + apply Lp.ext + filter_upwards [fieldDiagonalVec_ae a C hC ha hm (f + g), + fieldDiagonalVec_ae a C hC ha hm f, fieldDiagonalVec_ae a C hC ha hm g, + Lp.coeFn_add f g, Lp.coeFn_add + (fieldDiagonalVec a C hC ha hm f) (fieldDiagonalVec a C hC ha hm g)] + with x hfg hf hg hsum hout + simp only [Pi.add_apply] at hsum hout + rw [hfg, hout, hf, hg, hsum, map_add] + map_smul' c f := by + change fieldDiagonalVec a C hC ha hm (c • f) = c • fieldDiagonalVec a C hC ha hm f + apply Lp.ext + filter_upwards [fieldDiagonalVec_ae a C hC ha hm (c • f), + fieldDiagonalVec_ae a C hC ha hm f, Lp.coeFn_smul c f, + Lp.coeFn_smul c (fieldDiagonalVec a C hC ha hm f)] with x hcf hf hsmul hout + simp only [Pi.smul_apply] at hsmul hout + rw [hcf, hout, hf, hsmul, map_smul] + +def fieldDiagonal (a : X → Weight) (C : ℝ) (hC : 0 ≤ C) + (ha : ∀ x, ‖a x‖ ≤ C) + (hm : ∀ i, AEStronglyMeasurable (fun x => a x i) μ) : + Lp (Hilbert) 2 μ →L[ℂ] Lp (Hilbert) 2 μ := + (fieldDiagonalLinear a C hC ha hm).mkContinuous C (by + intro f + apply Lp.norm_le_mul_norm_of_ae_le_mul + change ∀ᵐ x ∂μ, ‖fieldDiagonalVec a C hC ha hm f x‖ ≤ C * ‖f x‖ + filter_upwards [fieldDiagonalVec_ae a C hC ha hm f] with x hx + rw [hx] + exact diagonal_bound (a x) C (ha x) (f x)) + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/FieldOperator.lean b/lean/OAI/Analysis/IrrationalRotation/Model/FieldOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..c9a98194b307851be8f97ca23224319637976ceb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/FieldOperator.lean @@ -0,0 +1,93 @@ +import Mathlib.MeasureTheory.Function.L2Space +import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal Topology + +namespace Invariant233.DirectIntegral +variable {X E F : Type*} [MeasurableSpace X] {μ : Measure X} + [NormedAddCommGroup E] [NormedSpace ℂ E] + [NormedAddCommGroup F] [NormedSpace ℂ F] + +theorem apply_simple_aestronglyMeasurable + (A : X → E →L[ℂ] F) + (hm : ∀ v, AEStronglyMeasurable (fun x => A x v) μ) (s : SimpleFunc X E) : + AEStronglyMeasurable (fun x => A x (s x)) μ := by + classical + induction s using SimpleFunc.induction' with + | const v => exact hm v + | @pcw s t u hu hs ht => + convert AEStronglyMeasurable.piecewise hu hs.restrict ht.restrict using 1 + funext x + by_cases hx : x ∈ u <;> simp [SimpleFunc.coe_piecewise, hx] + +theorem apply_aestronglyMeasurable + (A : X → E →L[ℂ] F) + (hm : ∀ v, AEStronglyMeasurable (fun x => A x v) μ) + {f : X → E} (hf : AEStronglyMeasurable f μ) : + AEStronglyMeasurable (fun x => A x (f x)) μ := by + apply aestronglyMeasurable_of_tendsto_ae atTop + (f := fun n x => A x (hf.stronglyMeasurable_mk.approx n x)) + · intro n + exact apply_simple_aestronglyMeasurable A hm _ + · filter_upwards [hf.ae_eq_mk] with x hx + rw [hx] + exact ((A x).continuous.tendsto _).comp (hf.stronglyMeasurable_mk.tendsto_approx x) + +def fieldOperatorVec (A : X → E →L[ℂ] F) (C : ℝ) + (hA : ∀ x, ‖A x‖ ≤ C) + (hm : ∀ v, AEStronglyMeasurable (fun x => A x v) μ) + (f : Lp E 2 μ) : Lp F 2 μ := + ((Lp.memLp f).of_le_mul (apply_aestronglyMeasurable A hm (Lp.aestronglyMeasurable f)) + (Filter.Eventually.of_forall fun x => (A x).le_of_opNorm_le (hA x) (f x))).toLp _ + +theorem fieldOperatorVec_ae (A : X → E →L[ℂ] F) (C : ℝ) + (hA : ∀ x, ‖A x‖ ≤ C) + (hm : ∀ v, AEStronglyMeasurable (fun x => A x v) μ) + (f : Lp E 2 μ) : + fieldOperatorVec A C hA hm f =ᵐ[μ] fun x => A x (f x) := + MemLp.coeFn_toLp _ + +def fieldOperatorLinear (A : X → E →L[ℂ] F) (C : ℝ) + (hA : ∀ x, ‖A x‖ ≤ C) + (hm : ∀ v, AEStronglyMeasurable (fun x => A x v) μ) : + Lp E 2 μ →ₗ[ℂ] Lp F 2 μ where + toFun := fieldOperatorVec A C hA hm + map_add' f g := by + apply Lp.ext + filter_upwards [fieldOperatorVec_ae A C hA hm (f + g), + fieldOperatorVec_ae A C hA hm f, fieldOperatorVec_ae A C hA hm g, + Lp.coeFn_add f g, + Lp.coeFn_add (fieldOperatorVec A C hA hm f) (fieldOperatorVec A C hA hm g)] + with x hfg hf hg hsum hout + simp only [Pi.add_apply] at hsum hout + rw [hfg, hout, hf, hg, hsum, map_add] + map_smul' c f := by + change fieldOperatorVec A C hA hm (c • f) = c • fieldOperatorVec A C hA hm f + apply Lp.ext + filter_upwards [fieldOperatorVec_ae A C hA hm (c • f), + fieldOperatorVec_ae A C hA hm f, Lp.coeFn_smul c f, + Lp.coeFn_smul c (fieldOperatorVec A C hA hm f)] with x hcf hf hsmul hout + simp only [Pi.smul_apply] at hsmul hout + rw [hcf, hout, hf, hsmul, map_smul] + +def fieldOperator (A : X → E →L[ℂ] F) (C : ℝ) + (hA : ∀ x, ‖A x‖ ≤ C) + (hm : ∀ v, AEStronglyMeasurable (fun x => A x v) μ) : + Lp E 2 μ →L[ℂ] Lp F 2 μ := + (fieldOperatorLinear A C hA hm).mkContinuous C (by + intro f + apply Lp.norm_le_mul_norm_of_ae_le_mul + change ∀ᵐ x ∂μ, ‖fieldOperatorVec A C hA hm f x‖ ≤ C * ‖f x‖ + filter_upwards [fieldOperatorVec_ae A C hA hm f] with x hx + rw [hx] + exact (A x).le_of_opNorm_le (hA x) (f x)) + +end Invariant233.DirectIntegral + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/FieldUnboundedMultiplier.lean b/lean/OAI/Analysis/IrrationalRotation/Model/FieldUnboundedMultiplier.lean new file mode 100644 index 0000000000000000000000000000000000000000..2adaf395a74015f75f4b6fcf40597a7f8595e57f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/FieldUnboundedMultiplier.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.IrrationalRotation.Model.WeightedShift +import Mathlib.MeasureTheory.Function.L2Space +import Mathlib.LinearAlgebra.LinearPMap + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal +namespace Invariant233.WeightedShift +variable {X : Type*} [MeasurableSpace X] (μ : Measure X) + +abbrev FieldHilbert := Lp Hilbert 2 μ + +def fieldMultiplierGraph (h : X → ℤ → ℂ) : + Submodule ℂ (FieldHilbert μ × FieldHilbert μ) where + carrier := {p | ∀ᵐ x ∂μ, ∀ k, p.2 x k = h x k * p.1 x k} + zero_mem' := by + filter_upwards [Lp.coeFn_zero Hilbert 2 μ] with x hx + intro k + simp only [Prod.fst_zero, Prod.snd_zero, hx, Pi.zero_apply, lp.coeFn_zero, mul_zero] + add_mem' := by + intro p q hp hq + filter_upwards [hp, hq, Lp.coeFn_add p.1 q.1, Lp.coeFn_add p.2 q.2] + with x hp hq hfst hsnd + intro k + change (p.2 + q.2) x k = h x k * (p.1 + q.1) x k + rw [hsnd, hfst] + change p.2 x k + q.2 x k = h x k * (p.1 x k + q.1 x k) + rw [hp, hq, mul_add] + smul_mem' := by + intro c p hp + filter_upwards [hp, Lp.coeFn_smul c p.1, Lp.coeFn_smul c p.2] + with x hp hfst hsnd + intro k + change (c • p.2) x k = h x k * (c • p.1) x k + rw [hsnd, hfst] + change c * p.2 x k = h x k * (c * p.1 x k) + rw [hp, mul_left_comm] + +def fieldUnboundedMultiplier (h : X → ℤ → ℂ) : + FieldHilbert μ →ₗ.[ℂ] FieldHilbert μ := + (fieldMultiplierGraph μ h).toLinearPMap + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/FieldWeightedShift.lean b/lean/OAI/Analysis/IrrationalRotation/Model/FieldWeightedShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..fa850d8eaf9b08518211f4acad85539dbac29cd7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/FieldWeightedShift.lean @@ -0,0 +1,24 @@ +import OAI.Analysis.IrrationalRotation.Model.FieldDiagonal + +namespace OAI + +noncomputable section +open MeasureTheory +namespace Invariant233.WeightedShift +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +def fieldOperator (a : X → Weight) (C : ℝ) (hC : 0 ≤ C) + (ha : ∀ x, ‖a x‖ ≤ C) + (hm : ∀ k, AEStronglyMeasurable (fun x => a x k) μ) : + Lp Hilbert 2 μ →L[ℂ] Lp Hilbert 2 μ := + (shift 1).toLinearIsometry.toContinuousLinearMap.compLpL 2 μ * + fieldDiagonal a C hC ha hm + +def fieldTailProjection (m : ℤ) : Lp Hilbert 2 μ →L[ℂ] Lp Hilbert 2 μ := + (tailProjection m).compLpL 2 μ + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/FiniteConvolution.lean b/lean/OAI/Analysis/IrrationalRotation/Model/FiniteConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..f62433921a0267dc7808c2653f113a3128451165 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/FiniteConvolution.lean @@ -0,0 +1,19 @@ +import Mathlib + +namespace OAI + +namespace InvariantProjection.FiniteConvolution + +abbrev Coefficients (K : ℕ) := Fin (2 * K + 1) → ℂ + +def center (K : ℕ) : Fin (2 * K + 1) := ⟨K, by omega⟩ + +noncomputable def polynomial {K : ℕ} (a : Coefficients K) : Polynomial ℂ := + ∑ i : Fin (2 * K + 1), Polynomial.monomial (i : ℕ) (a i) + +noncomputable def lowProduct {K : ℕ} (a b : Coefficients K) : Coefficients K := + fun n => (polynomial a * polynomial b).coeff (n : ℕ) + +end InvariantProjection.FiniteConvolution + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/FiniteKernelMixture.lean b/lean/OAI/Analysis/IrrationalRotation/Model/FiniteKernelMixture.lean new file mode 100644 index 0000000000000000000000000000000000000000..061506eff312752600c78a9bd21e5e44ce08f159 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/FiniteKernelMixture.lean @@ -0,0 +1,43 @@ +import Mathlib.Probability.Kernel.Composition.MeasureCompProd +import Mathlib.MeasureTheory.Measure.WithDensity + +namespace OAI + +open MeasureTheory ProbabilityTheory +open scoped ENNReal + +namespace Invariant233.FiniteKernelMixture + +variable {I X Y : Type*} [Fintype I] [MeasurableSpace X] [MeasurableSpace Y] + +noncomputable def weightedKernel (κ : I → Kernel X Y) (w : I → X → ℝ≥0∞) + (hw : ∀ i, Measurable (w i)) : Kernel X Y where + toFun x := ∑ i, w i x • κ i x + measurable' := by + apply Measure.measurable_of_measurable_coe + intro s hs + simp only [Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul] + exact Finset.measurable_sum _ (fun i _ => (hw i).mul (Kernel.measurable_coe (κ i) hs)) + +noncomputable def normalizedKernel (κ : I → Kernel X Y) (w : I → X → ℝ≥0∞) + (hw : ∀ i, Measurable (w i)) : Kernel X Y := + weightedKernel κ (fun i x => w i x / ∑ j, w j x) + (fun i => (hw i).div (Finset.measurable_sum _ (fun j _ => hw j))) + +noncomputable def diagonalReplacementKernel (q : ℝ≥0∞) (p : I → ℝ≥0∞) + (u : I → X → ℝ≥0∞) (hu : ∀ i, Measurable (u i)) + (ν : I → Measure X) : Kernel X X := + normalizedKernel + (fun o : Option I => match o with + | none => Kernel.id + | some i => Kernel.const X (ν i)) + (fun o x => match o with + | none => q + | some i => p i * u i x) + (fun o => by cases o with + | none => exact measurable_const + | some i => exact measurable_const.mul (hu i)) + +end Invariant233.FiniteKernelMixture + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/GeneratedVonNeumann.lean b/lean/OAI/Analysis/IrrationalRotation/Model/GeneratedVonNeumann.lean new file mode 100644 index 0000000000000000000000000000000000000000..da059d68e1102839f1af18b280d679f011c6d08f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/GeneratedVonNeumann.lean @@ -0,0 +1,28 @@ +import Mathlib.Analysis.VonNeumannAlgebra.Basic + +namespace OAI + +open scoped Pointwise + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +local instance instStarModuleGenerated : StarModule ℂ (H →L[ℂ] H) := + ContinuousLinearMap.instStarModuleId + +noncomputable def vonNeumannGenerated (s : Set (H →L[ℂ] H)) : VonNeumannAlgebra H where + toStarSubalgebra := + StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ s : Set (H →L[ℂ] H)) + centralizer_centralizer' := by + change Set.centralizer (Set.centralizer + (StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ s : Set (H →L[ℂ] H)) : + Set (H →L[ℂ] H))) = _ + rw [StarSubalgebra.coe_centralizer_centralizer] + rw [Set.centralizer_centralizer_centralizer] + exact (StarSubalgebra.coe_centralizer_centralizer ℂ s).symm + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/Hyperfinite.lean b/lean/OAI/Analysis/IrrationalRotation/Model/Hyperfinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..83e106772ff3c0887efc22254e207f17737c3eb4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/Hyperfinite.lean @@ -0,0 +1,23 @@ +import OAI.Analysis.IrrationalRotation.Model.Commutant +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties +import Mathlib.LinearAlgebra.FiniteDimensional.Basic + +namespace OAI + +noncomputable section +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +def IsHyperfinite (M : VonNeumannAlgebra H) : Prop := + ∃ A : ℕ → StarSubalgebra ℂ (H →L[ℂ] H), Monotone A ∧ + (∀ n, A n ≤ M.toStarSubalgebra) ∧ + (∀ n, FiniteDimensional ℂ (A n)) ∧ + closure {B : H →Lₚₜ[ℂ] H | ∃ n, strongOperatorUnderlying B ∈ A n} = + {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ M} + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/IndependentKernelProduct.lean b/lean/OAI/Analysis/IrrationalRotation/Model/IndependentKernelProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..47244a62600156c28e9d2f0f069d60c5037c3f68 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/IndependentKernelProduct.lean @@ -0,0 +1,52 @@ +import Mathlib.Probability.Independence.InfinitePi +import Mathlib.Probability.Kernel.Basic +import Mathlib.MeasureTheory.Measure.GiryMonad + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped BigOperators + +namespace Invariant233.KernelProduct + +variable {ι : Type*} {A B : ι → Type*} + [∀ i, MeasurableSpace (A i)] [∀ i, MeasurableSpace (B i)] + +def independent (κ : ∀ i, Kernel (A i) (B i)) [∀ i, IsMarkovKernel (κ i)] : + Kernel (∀ i, A i) (∀ i, B i) where + toFun x := Measure.infinitePi (fun i => κ i (x i)) + measurable' := by + apply Measurable.measure_of_isPiSystem_of_isProbabilityMeasure + generateFrom_squareCylinders.symm + (isPiSystem_squareCylinders + (fun _ => MeasurableSpace.isPiSystem_measurableSet) (by simp)) + rintro _ ⟨s, t, ht, rfl⟩ + simp only [Set.mem_univ_pi, Set.mem_ofPred_eq] at ht + simp_rw [Measure.infinitePi_pi _ (fun i _ => ht i)] + exact Finset.measurable_fun_prod s (fun i _ => + (Kernel.measurable_coe (κ i) (ht i)).comp (measurable_pi_apply i)) + +end Invariant233.KernelProduct + +namespace Invariant233.KernelProduct +variable {ι : Type*} {A B : ι → Type*} + [∀ i, MeasurableSpace (A i)] [∀ i, MeasurableSpace (B i)] + +def pairCoordinates : ((∀ i, A i) × (∀ i, B i)) ≃ᵐ (∀ i, A i × B i) where + toFun p i := (p.1 i, p.2 i) + invFun z := (fun i => (z i).1, fun i => (z i).2) + left_inv p := rfl + right_inv z := rfl + measurable_toFun := by + change Measurable (fun p : (∀ i, A i) × (∀ i, B i) => fun i => (p.1 i, p.2 i)) + fun_prop + measurable_invFun := by + change Measurable (fun z : ∀ i, A i × B i => (fun i => (z i).1, fun i => (z i).2)) + fun_prop + +end Invariant233.KernelProduct + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/JointEigenspace.lean b/lean/OAI/Analysis/IrrationalRotation/Model/JointEigenspace.lean new file mode 100644 index 0000000000000000000000000000000000000000..40de300f1144de6cdf90efa0f42f31ae8b09187d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/JointEigenspace.lean @@ -0,0 +1,28 @@ +import Mathlib.LinearAlgebra.Eigenspace.ContinuousLinearMap +import Mathlib.Analysis.InnerProductSpace.Adjoint + +namespace OAI + +noncomputable section +namespace Invariant233 + +variable {ι H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +def jointEigenspace (D : ι → H →L[ℂ] H) (ev : ι → ℂ) : Submodule ℂ H := + ⨅ i, Module.End.eigenspace (D i).toLinearMap (ev i) + +instance isClosed_jointEigenspace (D : ι → H →L[ℂ] H) (ev : ι → ℂ) : + IsClosed (jointEigenspace D ev : Set H) := by + unfold jointEigenspace + rw [Submodule.coe_iInf] + exact isClosed_iInter fun i => ContinuousLinearMap.isClosed_eigenspace (D i) (ev i) + +def jointEigenprojection (D : ι → H →L[ℂ] H) (ev : ι → ℂ) : H →L[ℂ] H := + (jointEigenspace D ev).starProjection + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/LaurentConvolution.lean b/lean/OAI/Analysis/IrrationalRotation/Model/LaurentConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..503d37eba29fb52b8fdea279269e6301b68d839d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/LaurentConvolution.lean @@ -0,0 +1,23 @@ +import Mathlib.Algebra.Polynomial.Laurent +import Mathlib.Basic.Complex.Basic +import Mathlib.Algebra.Order.BigOperators.Group.Finset +import Mathlib.Data.Int.Interval + +namespace OAI + +noncomputable section + +namespace Invariant233.FiniteWindow + +def laurent (K : ℕ) (a : ℤ → ℂ) : LaurentPolynomial ℂ := + ∑ i ∈ Finset.Icc (-(K : ℤ)) (K : ℤ), AddMonoidAlgebra.single i (a i) + +def convolution (K : ℕ) (a b : ℤ → ℂ) (n : ℕ) : ℂ := + ∑ i ∈ (Finset.Icc (-(K : ℤ)) (K : ℤ)).filter (fun i => |(n : ℤ) + i| ≤ (K : ℤ)), + a i * b (-(n : ℤ) - i) + +end Invariant233.FiniteWindow + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/MixedRadix.lean b/lean/OAI/Analysis/IrrationalRotation/Model/MixedRadix.lean new file mode 100644 index 0000000000000000000000000000000000000000..b65c7ba5f11d4710582f7df8392d9d60e2b869b3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/MixedRadix.lean @@ -0,0 +1,44 @@ +import Mathlib.Data.Fin.Basic +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Topology.Algebra.InfiniteSum.Real + +namespace OAI + +namespace Invariant233.MixedRadix + +def denominator (r : ℕ → ℕ) (n : ℕ) : ℕ := + ∏ i ∈ Finset.range n, r i + +abbrev Digits (r : ℕ → ℕ) := (n : ℕ) → Fin (r n) + +noncomputable def term {r : ℕ → ℕ} (d : Digits r) (n : ℕ) : ℝ := + (d n : ℝ) / (denominator r (n + 1) : ℝ) + +noncomputable def ofDigits {r : ℕ → ℕ} (d : Digits r) : ℝ := + ∑' n, term d n + +noncomputable def tailValue {r : ℕ → ℕ} (d : Digits r) (j : ℕ) : ℝ := + (denominator r j : ℝ) * ∑' n, term d (j + n) + +def prefixRank {r : ℕ → ℕ} (d : Digits r) : ℕ → ℕ + | 0 => 0 + | n + 1 => prefixRank d n * r n + (d n : ℕ) + +def Nonterminal {r : ℕ → ℕ} (d : Digits r) : Prop := + ∀ j, ∃ n, j ≤ n ∧ (d n : ℕ) + 1 < r n + +noncomputable def canonicalDigits (r : ℕ → ℕ) (hr : ∀ n, 0 < r n) (x : ℝ) : Digits r := + fun n => ⟨⌊(denominator r (n + 1) : ℝ) * x⌋₊ % r n, Nat.mod_lt _ (hr n)⟩ + +def extendPrefix (r : ℕ → ℕ) (hr : ∀ n, 0 < r n) (N : ℕ) + (d : (i : Fin N) → Fin (r i)) : Digits r := + fun n => if h : n < N then d ⟨n, h⟩ else ⟨0, hr n⟩ + +def radices (q : ℕ → ℕ) (n : ℕ) : ℕ := q (n + 1) / q n + +def hybrid {r : ℕ → ℕ} (d e : Digits r) (N : ℕ) : Digits r := + fun n => if n < N then e n else d n + +end Invariant233.MixedRadix + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/MixedRadixCircle.lean b/lean/OAI/Analysis/IrrationalRotation/Model/MixedRadixCircle.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e34be40028e22e44bde90f779d2c1dacc467bac --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/MixedRadixCircle.lean @@ -0,0 +1,17 @@ +import OAI.Analysis.IrrationalRotation.Model.MixedRadix +import Mathlib.MeasureTheory.Group.AddCircle + +namespace OAI + +namespace Invariant233.MixedRadix + +noncomputable def circleValue {r : ℕ → ℕ} (d : Digits r) : AddCircle (1 : ℝ) := + (ofDigits d : AddCircle (1 : ℝ)) + +noncomputable def circleCanonical (r : ℕ → ℕ) (hr : ∀ n, 0 < r n) + (x : AddCircle (1 : ℝ)) : Digits r := + canonicalDigits r hr (AddCircle.equivIco (1 : ℝ) 0 x : ℝ) + +end Invariant233.MixedRadix + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/MixedRadixProbability.lean b/lean/OAI/Analysis/IrrationalRotation/Model/MixedRadixProbability.lean new file mode 100644 index 0000000000000000000000000000000000000000..5286a61e72ebab396f2fb63102e690e68cc2f5ba --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/MixedRadixProbability.lean @@ -0,0 +1,21 @@ +import OAI.Analysis.IrrationalRotation.Model.MixedRadix +import Mathlib.Probability.Distributions.Uniform +import Mathlib.Probability.ProductMeasure + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Invariant233.MixedRadix + +def digitLaw (r : ℕ → ℕ) (hr : ∀ n, 0 < r n) : Measure (Digits r) := by + letI : ∀ n, NeZero (r n) := fun n => ⟨ne_of_gt (hr n)⟩ + exact Measure.infinitePi (fun n => (PMF.uniformOfFintype (Fin (r n))).toMeasure) + +end Invariant233.MixedRadix + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/NormalAffiliation.lean b/lean/OAI/Analysis/IrrationalRotation/Model/NormalAffiliation.lean new file mode 100644 index 0000000000000000000000000000000000000000..eec366e13e2229c4a31208c5aa632c17df28e9ae --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/NormalAffiliation.lean @@ -0,0 +1,35 @@ +import OAI.Analysis.IrrationalRotation.Model.AffiliatedTransport +import OAI.Analysis.IrrationalRotation.Model.VectorTraceState + +namespace OAI + +noncomputable section +open Filter +open scoped Topology +namespace Invariant233 + +universe u +variable {E : Type u} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +def IsNormalFaithfulTracialState (M : VonNeumannAlgebra E) (τ : TracialState M) : Prop := + (∀ a : M, (a : E →L[ℂ] E).IsPositive → τ a = 0 → a = 0) ∧ + (∀ (ι : Type u) (L : Filter ι), L.NeBot → ∀ (a : ι → M) (b : M), + (∃ C : ℝ, ∀ i, ‖a i‖ ≤ C) → + (∀ x : E, Tendsto (fun i => (a i : E →L[ℂ] E) x) L + (𝓝 ((b : E →L[ℂ] E) x))) → + Tendsto (fun i => τ (a i)) L (𝓝 (τ b))) + +def IsAffiliated (M : VonNeumannAlgebra E) (H : E →ₗ.[ℂ] E) : Prop := + ∀ U : unitary (E →L[ℂ] E), (U : E →L[ℂ] E) ∈ M.commutant → + ∃ hD : ∀ x : H.domain, (U : E →L[ℂ] E) (x : E) ∈ H.domain, + ∀ x : H.domain, + H ⟨(U : E →L[ℂ] E) (x : E), hD x⟩ = (U : E →L[ℂ] E) (H x) + +def IsPositivePartial (H : E →ₗ.[ℂ] E) : Prop := + ∀ x : H.domain, 0 ≤ (inner ℂ (x : E) (H x)).re + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/OneCoordinateConditional.lean b/lean/OAI/Analysis/IrrationalRotation/Model/OneCoordinateConditional.lean new file mode 100644 index 0000000000000000000000000000000000000000..3fb54f0536eef67fa046e5fe3d862860ece7d2e0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/OneCoordinateConditional.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.IrrationalRotation.Model.OneCoordinateCoupling +import OAI.Analysis.IrrationalRotation.Model.FiniteKernelMixture + +namespace OAI + +open MeasureTheory ProbabilityTheory +open scoped ENNReal + +namespace Invariant233.OneCoordinateCoupling +open CouplingMarginalBounds FiniteKernelMixture + +noncomputable def rightGivenLeft (κ m a b t : ℝ) : Kernel ℝ ℝ := + diagonalReplacementKernel (ENNReal.ofReal (diagonalMass κ m a b t)) + (fun i => ENNReal.ofReal (componentProbabilities κ m a b t i)) + (fun i x => ENNReal.ofReal (leftDensity m a b i x)) + (fun i => by fin_cases i <;> + exact (measurable_const.indicator measurableSet_Ico).ennreal_ofReal) + (rightLaw m a b) + +noncomputable def leftGivenRight (κ m a b t : ℝ) : Kernel ℝ ℝ := + diagonalReplacementKernel (ENNReal.ofReal (diagonalMass κ m a b t)) + (fun i => ENNReal.ofReal (componentProbabilities κ m a b t i)) + (fun i x => ENNReal.ofReal (rightDensity m a b i x)) + (fun i => by fin_cases i <;> + exact (measurable_const.indicator measurableSet_Ico).ennreal_ofReal) + (leftLaw m a b) + +end Invariant233.OneCoordinateCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/OneCoordinateCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/OneCoordinateCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d159c3c1d48e8e868beee761a8bc2c4093e3970 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/OneCoordinateCoupling.lean @@ -0,0 +1,61 @@ +import OAI.Analysis.IrrationalRotation.Model.CouplingMarginalBounds +import OAI.Analysis.IrrationalRotation.Model.CouplingMixture + +namespace OAI + +open MeasureTheory ProbabilityTheory +open scoped ENNReal + +namespace Invariant233.OneCoordinateCoupling + +open CouplingMarginalBounds CouplingMixture + +noncomputable def baseLaw : Measure ℝ := intervalLaw 0 1 + +noncomputable def leftLaw (m a b : ℝ) : Fin 5 → Measure ℝ := + ![intervalLaw 0 (1 - a / 2), intervalLaw 0 (a / 2), + intervalLaw 0 (1 - b / 2), intervalLaw 0 (b / 2), intervalLaw 0 (1 / m)] + +noncomputable def rightLaw (m a b : ℝ) : Fin 5 → Measure ℝ := + ![intervalLaw (1 - a / 2) 1, intervalLaw (a / 2) 1, + intervalLaw (1 - b / 2) 1, intervalLaw (b / 2) 1, intervalLaw (1 - 1 / m) 1] + +noncomputable def pairLaw (κ m a b t : ℝ) : Measure (ℝ × ℝ) := + mixture baseLaw (ENNReal.ofReal (diagonalMass κ m a b t)) + (fun i => ENNReal.ofReal (componentProbabilities κ m a b t i)) + (leftLaw m a b) (rightLaw m a b) + +instance labelMeasurableSpace : MeasurableSpace (Option (Fin 5)) := ⊤ + +instance labelMeasurableSingletonClass : MeasurableSingletonClass (Option (Fin 5)) := + ⟨fun _ => trivial⟩ + +noncomputable def labelledLaw (κ m a b t : ℝ) : + Measure (Option (Fin 5) × (ℝ × ℝ)) := + labelledMixture baseLaw (ENNReal.ofReal (diagonalMass κ m a b t)) + (fun i => ENNReal.ofReal (componentProbabilities κ m a b t i)) + (leftLaw m a b) (rightLaw m a b) + +noncomputable def intervalDensity (a b : ℝ) : ℝ → ℝ := + uniformDensity baseLaw (Set.Ico a b) + +noncomputable def leftDensity (m a b : ℝ) : Fin 5 → ℝ → ℝ := + ![intervalDensity 0 (1 - a / 2), intervalDensity 0 (a / 2), + intervalDensity 0 (1 - b / 2), intervalDensity 0 (b / 2), intervalDensity 0 (1 / m)] + +noncomputable def rightDensity (m a b : ℝ) : Fin 5 → ℝ → ℝ := + ![intervalDensity (1 - a / 2) 1, intervalDensity (a / 2) 1, + intervalDensity (1 - b / 2) 1, intervalDensity (b / 2) 1, + intervalDensity (1 - 1 / m) 1] + +noncomputable def leftMarginalDensity (κ m a b t x : ℝ) : ℝ := + diagonalMass κ m a b t + + ∑ i, componentProbabilities κ m a b t i * leftDensity m a b i x + +noncomputable def rightMarginalDensity (κ m a b t x : ℝ) : ℝ := + diagonalMass κ m a b t + + ∑ i, componentProbabilities κ m a b t i * rightDensity m a b i x + +end Invariant233.OneCoordinateCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/OperatorProperties.lean b/lean/OAI/Analysis/IrrationalRotation/Model/OperatorProperties.lean new file mode 100644 index 0000000000000000000000000000000000000000..f92b16841073f6538119c0667d92a90250305456 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/OperatorProperties.lean @@ -0,0 +1,65 @@ +import Mathlib.Analysis.VonNeumannAlgebra.Basic +import Mathlib.Analysis.InnerProductSpace.Positive +import Mathlib.Analysis.Normed.Module.Dual + +namespace OAI + +noncomputable section +namespace Invariant233 + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +def HasOnlyTrivialInvariantProjections (M : VonNeumannAlgebra H) + (T : H →L[ℂ] H) : Prop := + ∀ p : H →L[ℂ] H, p ∈ M → IsStarProjection p → + (1 - p) * T * p = 0 → p = 0 ∨ p = 1 + +def IsProjectionAtom (M : VonNeumannAlgebra H) (p : H →L[ℂ] H) : Prop := + p ∈ M ∧ IsStarProjection p ∧ p ≠ 0 ∧ + ∀ q : H →L[ℂ] H, q ∈ M → IsStarProjection q → q * p = q → + q = 0 ∨ q = p + +def IsAtomicVonNeumannAlgebra (M : VonNeumannAlgebra H) : Prop := + ∀ p : H →L[ℂ] H, p ∈ M → IsStarProjection p → p ≠ 0 → + ∃ q : H →L[ℂ] H, IsProjectionAtom M q ∧ q * p = q + +def IsAbelianVonNeumannAlgebra (M : VonNeumannAlgebra H) : Prop := + ∀ A B : H →L[ℂ] H, A ∈ M → B ∈ M → Commute A B + +def IsDiffuseVonNeumannAlgebra (M : VonNeumannAlgebra H) : Prop := + ∀ p : H →L[ℂ] H, ¬ IsProjectionAtom M p + +def IsFactor (M : VonNeumannAlgebra H) : Prop := + Nontrivial H ∧ ∀ A : H →L[ℂ] H, A ∈ M → + (∀ B : H →L[ℂ] H, B ∈ M → Commute A B) → + ∃ c : ℂ, A = c • (1 : H →L[ℂ] H) + +def vectorTrace (ξ : H) (A : H →L[ℂ] H) : ℂ := + @inner ℂ H InnerProductSpace.toInner ξ (A ξ) + +def IsFaithfulTracialVector (M : VonNeumannAlgebra H) (ξ : H) : Prop := + ‖ξ‖ = 1 ∧ + (∀ A B : H →L[ℂ] H, A ∈ M → B ∈ M → + vectorTrace ξ (A * B) = vectorTrace ξ (B * A)) ∧ + (∀ A : H →L[ℂ] H, A ∈ M → A.IsPositive → + vectorTrace ξ A = 0 → A = 0) + +def IsTypeII1FactorWithVector (M : VonNeumannAlgebra H) (ξ : H) : Prop := + IsFactor M ∧ IsDiffuseVonNeumannAlgebra M ∧ IsFaithfulTracialVector M ξ + +local instance instNormedAlgebraPredual : NormedAlgebra ℂ (H →L[ℂ] H) := + ContinuousLinearMap.toNormedAlgebra + +def HasSeparablePredual (M : VonNeumannAlgebra H) : Prop := + ∃ (X : Type u) (_ : NormedAddCommGroup X) (_ : NormedSpace ℂ X) + (_ : CompleteSpace X) (_ : TopologicalSpace.SeparableSpace X), + Nonempty (StrongDual ℂ X ≃ₗᵢ[ℂ] M.toStarSubalgebra) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/OrbitMeasurable.lean b/lean/OAI/Analysis/IrrationalRotation/Model/OrbitMeasurable.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8f04b8c607e2a048405d669758b26910a8508e7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/OrbitMeasurable.lean @@ -0,0 +1,15 @@ +import Mathlib.MeasureTheory.MeasurableSpace.Basic +import Mathlib.GroupTheory.Perm.Basic + +namespace OAI + +namespace Invariant233 + +variable {X Y : Type*} [MeasurableSpace Y] + +@[reducible] def orbitMeasurableSpace (σ : Equiv.Perm X) (f : X → Y) : MeasurableSpace X := + ⨆ n : ℤ, MeasurableSpace.comap (fun x => f ((σ ^ n) x)) ‹MeasurableSpace Y› + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ParameterCircleOperator.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ParameterCircleOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..34cb87e11648ae8dd68a567732dd1ab6f48c2f86 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ParameterCircleOperator.lean @@ -0,0 +1,57 @@ +import OAI.Analysis.IrrationalRotation.Model.ParameterCircleWeights +import OAI.Analysis.IrrationalRotation.Model.RotationMeasurable +import Mathlib.MeasureTheory.Function.Floor +import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic + +namespace OAI + +noncomputable section +open MeasureTheory +namespace Invariant233.CircleParameterData + +theorem measurableWeight_borel (p : CircleParameterData) (θ : ℝ) : + Measurable (p.measurableWeight θ) := by + unfold measurableWeight CircleWeights.weight CircleWeights.cocycle CircleWeights.floorCost + apply Measurable.exp + apply Measurable.neg + apply Measurable.tsum + intro i + apply Measurable.mul measurable_const + apply (measurable_of_countable (fun z : ℤ => (z : ℝ))).comp + apply Measurable.floor + apply Measurable.add _ measurable_const + change Measurable (fun x : Circle => + ((AddCircle.equivIco (1 : ℝ) 0 (p.coordFrequency i • x)) : ℝ)) + exact (measurable_subtype_coe.comp + (AddCircle.measurableEquivIco (1 : ℝ) 0).measurable).comp + (continuous_const_smul (p.coordFrequency i)).measurable + +theorem measurableWeight_operator_bound (p : CircleParameterData) (θ : ℝ) + (hp : CircleParameterLaws θ p) (x : Circle) : + ‖(p.measurableWeight θ x : ℂ)‖ ≤ 1 := by + have hpos : 0 < p.measurableWeight θ x := Real.exp_pos _ + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_pos hpos] + apply Real.exp_le_one_iff.mpr + apply neg_nonpos.mpr + apply tsum_nonneg + intro i + apply mul_nonneg (hp.C_pos (i.1 + 1) (Nat.succ_le_iff.mpr (Nat.zero_lt_succ _))).le + apply Int.cast_nonneg + apply Int.floor_nonneg.mpr + apply add_nonneg + · exact (AddCircle.equivIco (1 : ℝ) 0 (p.coordFrequency i • x)).property.1 + · exact mul_nonneg (by norm_num) (Int.fract_nonneg _) + +def measurableOperator (p : CircleParameterData) (θ : ℝ) + (hp : CircleParameterLaws θ p) : Rotation.Hilbert →L[ℂ] Rotation.Hilbert := + Rotation.U * Rotation.measurableRepresentation θ + (fun x => (p.measurableWeight θ x : ℂ)) 1 (by norm_num) + (Complex.measurable_ofReal.comp (p.measurableWeight_borel θ)) + (p.measurableWeight_operator_bound θ hp) + +end Invariant233.CircleParameterData + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ParameterCircleWeights.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ParameterCircleWeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..05143c8c00fe294ee79bb48379bc94bc6a9c6c17 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ParameterCircleWeights.lean @@ -0,0 +1,27 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleParameters +import OAI.Analysis.IrrationalRotation.Model.CircleWeights + +namespace OAI + +noncomputable section + +namespace Invariant233.CircleParameterData + +abbrev Coord (p : CircleParameterData) := + Σ j : ℕ, {i : ℕ // i ∈ p.block (j + 1)} + +def coordFrequency (p : CircleParameterData) (i : p.Coord) : ℤ := p.q i.2 + +def coordCost (p : CircleParameterData) (i : p.Coord) : ℝ := p.C (i.1 + 1) + +def floorCocycle (p : CircleParameterData) (θ : ℝ) (k : ℤ) (x : Circle) : ℝ := + CircleWeights.cocycle θ p.coordFrequency p.coordCost k x + +def measurableWeight (p : CircleParameterData) (θ : ℝ) : Circle → ℝ := + CircleWeights.weight θ p.coordFrequency p.coordCost + +end Invariant233.CircleParameterData + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ParameterSmoothing.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ParameterSmoothing.lean new file mode 100644 index 0000000000000000000000000000000000000000..f29b0804d127897a0d3b4046365b5c611ae3d173 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ParameterSmoothing.lean @@ -0,0 +1,39 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleParameters +import OAI.Analysis.IrrationalRotation.Model.CircleSmoothing +import OAI.Analysis.IrrationalRotation.Model.ContinuityCoboundary + +namespace OAI + +noncomputable section + +namespace Invariant233.CircleParameterData + +open InvariantProjection.Continuity + +def smoothBlock (p : CircleParameterData) (θ : ℝ) (j : ℕ) (x : Circle) : ℝ := + ∑ i ∈ p.block j, circleSmoothedDrop (p.C j) (p.alpha θ i) (p.alpha θ i / 4) + ((p.q i : ℤ) • x) + +def rawBlock (p : CircleParameterData) (θ : ℝ) (j : ℕ) (x : Circle) : ℝ := + ∑ i ∈ p.block j, p.C j * (⌊p.coordinate i x + p.alpha θ i⌋ : ℝ) + +def smoothBlockTransfer (p : CircleParameterData) (θ : ℝ) (j : ℕ) (x : Circle) : ℝ := + ∑ i ∈ p.block j, circleSmoothingTransfer (p.C j) (p.alpha θ i / 4) + ((p.q i : ℤ) • x) + +def relocatedBlock (p : CircleParameterData) (θ : ℝ) (j : ℕ) : Circle → ℝ := + relocated (Equiv.addRight (θ : Circle)) (p.smoothBlock θ j) + (fun n x => p.partition j n x) (p.height j) + +def relocatedBlockTransfer (p : CircleParameterData) (θ : ℝ) (j : ℕ) : Circle → ℝ := + relocationTransfer (Equiv.addRight (θ : Circle)) (p.smoothBlock θ j) + (fun n x => p.partition j n x) (p.height j) + +def relocatedCost (p : CircleParameterData) (θ : ℝ) (x : Circle) : ℝ := + ∑' n : ℕ, p.relocatedBlock θ (n + 1) x + +end Invariant233.CircleParameterData + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/PhaseBlocks.lean b/lean/OAI/Analysis/IrrationalRotation/Model/PhaseBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0dbae6bf09ed853ef64a83b78e6193ed1ced4c9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/PhaseBlocks.lean @@ -0,0 +1,16 @@ +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Order.Interval.Finset.Nat + +namespace OAI + +namespace Invariant233.ProductPhases + +open scoped BigOperators + +def consecutiveBlock (m : ℕ → ℕ) (j : ℕ) : Finset ℕ := + Finset.Ico (∑ r ∈ Finset.range j, m r) + ((∑ r ∈ Finset.range j, m r) + m j) + +end Invariant233.ProductPhases + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/PhaseFailure.lean b/lean/OAI/Analysis/IrrationalRotation/Model/PhaseFailure.lean new file mode 100644 index 0000000000000000000000000000000000000000..894c9b7e723bddcc76aabc428118c9244dbb6d40 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/PhaseFailure.lean @@ -0,0 +1,43 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Data.Int.Interval + +namespace OAI + +namespace Invariant233.ProductPhases + +noncomputable def failureBound (m : ℝ) : ℝ := + 2 * m ^ ((4 / 5 : ℝ) * m) * (2 : ℝ) ^ m * + (10 * m ^ (-19 / 20 : ℝ)) ^ ((19 / 20 : ℝ) * m) + +noncomputable def nonzeroIntegerWindow (R : ℝ) : Finset ℤ := + (Finset.Icc (-Int.floor R) (Int.floor R)).erase 0 + +noncomputable def largePhaseTimes (N R : ℝ) : Finset ℤ := + (nonzeroIntegerWindow R).filter (fun k => N / 4 ≤ |(k : ℝ)|) + +noncomputable def phaseGoodCount {ι : Type*} (J : Finset ι) (b : ℝ) + (k : ℤ) (θ : ι → ℝ) : ℕ := by + classical + exact (J.filter (fun i => 1 - Int.fract ((k : ℝ) * θ i) ∈ + Set.Icc b (1 - b))).card + +noncomputable def largePhaseFailure {ι : Type*} (J : Finset ι) (N : ℝ) : + Set (ι → ℝ) := + {θ | ∃ k ∈ largePhaseTimes N ((J.card : ℝ) ^ ((4 / 5 : ℝ) * J.card)), + (phaseGoodCount J ((J.card : ℝ) ^ (-19 / 20 : ℝ)) k θ : ℝ) < + (J.card : ℝ) / 20} + +def largePhaseCondition {ι : Type*} (J : Finset ι) (N : ℝ) (θ : ι → ℝ) : Prop := + ∀ k : ℤ, N / 4 ≤ |(k : ℝ)| → + |(k : ℝ)| ≤ (J.card : ℝ) ^ ((4 / 5 : ℝ) * J.card) → + (J.card : ℝ) / 20 ≤ + (phaseGoodCount J ((J.card : ℝ) ^ (-19 / 20 : ℝ)) k θ : ℝ) + +def smallPhaseCondition {ι : Type*} (J : Finset ι) (K G : ℝ) (θ : ι → ℝ) : Prop := + ∀ k : ℤ, G * K ≤ |(k : ℝ)| → |(k : ℝ)| ≤ (J.card : ℝ) * K / 4 → + ∀ i ∈ J, 1 - Int.fract ((k : ℝ) * θ i) ∈ + Set.Icc (G / J.card) (1 - G / J.card) + +end Invariant233.ProductPhases + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/PositiveDiagonalModel.lean b/lean/OAI/Analysis/IrrationalRotation/Model/PositiveDiagonalModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..0343abf862a33dba0e49c37576aa750c2bd65be3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/PositiveDiagonalModel.lean @@ -0,0 +1,115 @@ +import OAI.Analysis.IrrationalRotation.Model.FieldDiagonal +import Mathlib.Topology.Algebra.Module.Equiv + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal + +namespace Invariant233.PositiveDiagonalModel + +abbrev Fiber := WeightedShift.Hilbert +abbrev Space {Y : Type*} [MeasurableSpace Y] (μ : Measure Y) := Lp Fiber 2 μ + +def e0 : Fiber := lp.single 2 (0 : ℤ) (1 : ℂ) + +def fiberShift : Fiber →L[ℂ] Fiber := + (WeightedShift.shift 1).toLinearIsometry.toContinuousLinearMap + +def fiberShiftUnit : (Fiber →L[ℂ] Fiber)ˣ := + (ContinuousLinearEquiv.unitsEquiv ℂ Fiber).symm + (WeightedShift.shift 1).toContinuousLinearEquiv + +variable {Y : Type*} [MeasurableSpace Y] {μ : Measure Y} + +def integerIterate (σ : Y ≃ᵐ Y) : ℤ → Y → Y + | .ofNat n => (σ : Y → Y)^[n] + | .negSucc n => (σ.symm : Y → Y)^[n + 1] + +theorem measurable_integerIterate (σ : Y ≃ᵐ Y) (k : ℤ) : + Measurable (integerIterate σ k) := by + cases k with + | ofNat n => exact σ.measurable.iterate n + | negSucc n => exact σ.symm.measurable.iterate (n + 1) + +def orbitArray (σ : Y ≃ᵐ Y) (f : Y → ℝ) (y : Y) (k : ℤ) : ℝ := + f (integerIterate σ k y) + +def realWeight (a : Y → ℤ → ℝ) (C : ℝ) + (hbound : ∀ y k, |a y k| ≤ C) (y : Y) : WeightedShift.Weight := + ⟨fun k => (a y k : ℂ), memℓp_infty <| by + refine ⟨C, ?_⟩ + rintro r ⟨k, rfl⟩ + simpa only [Complex.norm_real, Real.norm_eq_abs] using hbound y k⟩ + +def realDiagonal (a : Y → ℤ → ℝ) (C : ℝ) (hC : 0 ≤ C) + (hbound : ∀ y k, |a y k| ≤ C) + (hm : ∀ k, AEStronglyMeasurable (fun y => a y k) μ) : + Space μ →L[ℂ] Space μ := + WeightedShift.fieldDiagonal (realWeight a C hbound) C hC + (fun y => lp.norm_le_of_forall_le hC (fun k => by + simpa only [realWeight, Complex.norm_real, Real.norm_eq_abs] using hbound y k)) + (fun k => Complex.continuous_ofReal.comp_aestronglyMeasurable (hm k)) + +def realWeightedShift (a : Y → ℤ → ℝ) (C : ℝ) (hC : 0 ≤ C) + (hbound : ∀ y k, |a y k| ≤ C) + (hm : ∀ k, AEStronglyMeasurable (fun y => a y k) μ) : + Space μ →L[ℂ] Space μ := + (fiberShift.compLpL 2 μ) * realDiagonal a C hC hbound hm + +def orbitWeightedShift (σ : Y ≃ᵐ Y) (f : Y → ℝ) (C : ℝ) (hC : 0 ≤ C) + (hbound : ∀ y, |f y| ≤ C) (hf : Measurable f) : Space μ →L[ℂ] Space μ := + realWeightedShift (orbitArray σ f) C hC + (fun y k => hbound (integerIterate σ k y)) + (fun k => (hf.comp (measurable_integerIterate σ k)).aestronglyMeasurable) + +theorem exists_bounded_measurable_representative (f : Lp ℝ ∞ μ) : + ∃ g : Y → ℝ, Measurable g ∧ g =ᵐ[μ] f ∧ ∀ y, |g y| ≤ ‖f‖ := by + let g₀ := (Lp.aestronglyMeasurable f).mk f + have hm : Measurable g₀ := (Lp.aestronglyMeasurable f).stronglyMeasurable_mk.measurable + have heq : g₀ =ᵐ[μ] f := (Lp.aestronglyMeasurable f).ae_eq_mk.symm + have hb : ∀ᵐ y ∂μ, |f y| ≤ ‖f‖ := by + filter_upwards [ae_le_eLpNormEssSup (f := (f : Y → ℝ)) (μ := μ)] with y hy + have hfin : eLpNormEssSup f μ ≠ ∞ := by + simpa only [eLpNorm_exponent_top (Lp.aestronglyMeasurable f)] using Lp.eLpNorm_ne_top f + have hle := ENNReal.toReal_mono hfin hy + simpa only [toReal_enorm, Real.norm_eq_abs, Lp.norm_def, + eLpNorm_exponent_top (Lp.aestronglyMeasurable f)] using hle + let g : Y → ℝ := fun y => if |g₀ y| ≤ ‖f‖ then g₀ y else 0 + refine ⟨g, hm.ite (measurableSet_le (continuous_abs.measurable.comp hm) measurable_const) measurable_const, ?_, ?_⟩ + · filter_upwards [heq, hb] with y hy hby + simp only [g, hy, ite_eq_left hby] + · intro y + by_cases hy : |g₀ y| ≤ ‖f‖ + · simpa only [g, ite_eq_left hy] using hy + · simpa only [g, ite_eq_right hy, abs_zero] using norm_nonneg f + +def boundedRepresentative (f : Lp ℝ ∞ μ) : Y → ℝ := + Classical.choose (exists_bounded_measurable_representative f) + +theorem boundedRepresentative_measurable (f : Lp ℝ ∞ μ) : + Measurable (boundedRepresentative f) := + (Classical.choose_spec (exists_bounded_measurable_representative f)).1 + +theorem boundedRepresentative_ae_eq (f : Lp ℝ ∞ μ) : + boundedRepresentative f =ᵐ[μ] f := + (Classical.choose_spec (exists_bounded_measurable_representative f)).2.1 + +theorem boundedRepresentative_bound (f : Lp ℝ ∞ μ) (y : Y) : + |boundedRepresentative f y| ≤ ‖f‖ := + (Classical.choose_spec (exists_bounded_measurable_representative f)).2.2 y + +def lpOrbitWeightedShift (σ : Y ≃ᵐ Y) (f : Lp ℝ ∞ μ) : + Space μ →L[ℂ] Space μ := + orbitWeightedShift σ (boundedRepresentative f) ‖f‖ (norm_nonneg f) + (boundedRepresentative_bound f) (boundedRepresentative_measurable f) + +def diagonalState [IsFiniteMeasure μ] (P : Space μ →L[ℂ] Space μ) : ℝ := + (inner ℂ (Lp.const 2 μ e0) (P (Lp.const 2 μ e0))).re + +end Invariant233.PositiveDiagonalModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/PrefixDomination.lean b/lean/OAI/Analysis/IrrationalRotation/Model/PrefixDomination.lean new file mode 100644 index 0000000000000000000000000000000000000000..e1c185fd7004fc10fbbdbec7a3eadc28812bf26b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/PrefixDomination.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.IrrationalRotation.Model.OneCoordinateCoupling + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Invariant233.OneCoordinateCoupling + +def triangleLaw : Measure (ℝ × ℝ) := + (baseLaw.prod baseLaw).restrict {z | z.1 < z.2} + +def componentLaw (m a b : ℝ) : Option (Fin 5) → Measure (ℝ × ℝ) + | none => CouplingMixture.diagonal baseLaw + | some i => (leftLaw m a b i).prod (rightLaw m a b i) + +def componentReference : Option (Fin 5) → Measure (ℝ × ℝ) + | none => CouplingMixture.diagonal baseLaw + | some _ => triangleLaw + +def replacementDensity (m a b : ℝ) (i : Fin 5) (z : ℝ × ℝ) : ℝ≥0∞ := + ENNReal.ofReal (leftDensity m a b i z.1) * + ENNReal.ofReal (rightDensity m a b i z.2) + +end Invariant233.OneCoordinateCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/PrefixHybrid.lean b/lean/OAI/Analysis/IrrationalRotation/Model/PrefixHybrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..f65113deb33d11d654f225875394a3d57121a097 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/PrefixHybrid.lean @@ -0,0 +1,23 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductSampling + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.ProductModel + +def prefixEndpoint (D : ℕ) (x y : Base) : Base := + selectedEndpoint (Finset.range D) x y + +def prefixPair (D : ℕ) (xy : EndpointPair) : EndpointPair := + (xy.1, prefixEndpoint D xy.1 xy.2) + +def prefixPairLaw (ν : Measure EndpointPair) (D : ℕ) : Measure EndpointPair := + ν.map (prefixPair D) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/PrefixPatternLaw.lean b/lean/OAI/Analysis/IrrationalRotation/Model/PrefixPatternLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..c35e53212a0c44c872cd441985a8e3b7b669c06e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/PrefixPatternLaw.lean @@ -0,0 +1,35 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductSampling + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal BigOperators + +namespace Invariant233.ProductModel.PrefixPatterns + +def replacement (I : Finset ℕ) (xz : EndpointPair) : EndpointPair := + (xz.1, selectedEndpoint I xz.1 xz.2) + +def rectangleDensity (U V : Set Circle) : Circle × Circle → ℝ≥0∞ := + (U ×ˢ V).indicator (fun _ => (circleMeasure U * circleMeasure V)⁻¹) + +def patternDensity (I : Finset ℕ) (g : Base → ℝ≥0∞) + (U V : ℕ → Set Circle) (xz : EndpointPair) : ℝ≥0∞ := + g xz.1 * ∏ i ∈ I, rectangleDensity (U i) (V i) (xz.1 i, xz.2 i) + +def patternLaw (I : Finset ℕ) (g : Base → ℝ≥0∞) + (U V : ℕ → Set Circle) : Measure EndpointPair := + ((baseMeasure.prod baseMeasure).withDensity (patternDensity I g U V)).map + (replacement I) + +def mixtureLaw {C : Type*} [Fintype C] (w : C → ℝ≥0∞) + (I : C → Finset ℕ) (g : C → Base → ℝ≥0∞) + (U V : C → ℕ → Set Circle) : Measure EndpointPair := + ∑ c, w c • patternLaw (I c) (g c) (U c) (V c) + +end Invariant233.ProductModel.PrefixPatterns + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/Product.lean b/lean/OAI/Analysis/IrrationalRotation/Model/Product.lean new file mode 100644 index 0000000000000000000000000000000000000000..e63a515401f10c427a758885243b1c50cc1df414 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/Product.lean @@ -0,0 +1,136 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductBase +import OAI.Analysis.IrrationalRotation.Model.FieldDiagonal +import OAI.Analysis.IrrationalRotation.Model.GeneratedVonNeumann +import Mathlib.MeasureTheory.Function.LpSpace.Indicator +import Mathlib.MeasureTheory.Function.Floor + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal +namespace Invariant233.ProductModel + +theorem measurable_rep : Measurable circleRepresentative := + measurable_subtype_coe.comp (AddCircle.measurableEquivIco (T := (1 : ℝ)) 0).measurable + +theorem measurable_iterate (θ : ℕ → ℝ) (k : ℤ) : + Measurable (rotationIterate θ k) := by + let : T0Space ℝ := @MetricSpace.instT0Space ℝ Real.metricSpace + let : BorelSpace Circle := QuotientAddGroup.borelSpace + let : ContinuousAdd Circle := + (QuotientAddGroup.instIsTopologicalAddGroup (AddSubgroup.zmultiples (1 : ℝ))).toContinuousAdd + let : MeasurableAdd Circle := ContinuousAdd.measurableAdd + apply Measurable.of_eval + intro i + exact (measurable_pi_apply i).add_const _ + +theorem measurable_cost (θ c : ℕ → ℝ) : Measurable (logarithmicCost θ c) := by + apply Measurable.tsum + intro i + have hm : Measurable (fun x : Base => circleRepresentative (x i) + θ i) := + (measurable_rep.comp (measurable_pi_apply i)).add_const (θ i) + have hc : Measurable (fun x : Base => (⌊circleRepresentative (x i) + θ i⌋ : ℝ)) := + (measurable_of_countable (fun z : ℤ => (z : ℝ))).comp hm.floor + exact (measurable_const.mul hc).ennreal_ofReal + +theorem weight_measurable (θ c : ℕ → ℝ) : Measurable (weight θ c) := by + exact (measurable_cost θ c).coe_ereal_ennreal.neg.ereal_exp.ennreal_toReal + +theorem weight_nonneg (θ c : ℕ → ℝ) (x : Base) : 0 ≤ weight θ c x := + ENNReal.toReal_nonneg + +theorem weight_le_one (θ c : ℕ → ℝ) (x : Base) : weight θ c x ≤ 1 := by + have h : EReal.exp (-(logarithmicCost θ c x : EReal)) ≤ 1 := by + rw [← EReal.exp_zero] + apply EReal.exp_le_exp_iff.mpr + exact EReal.neg_le_zero.mpr (EReal.coe_ennreal_nonneg (logarithmicCost θ c x)) + exact (ENNReal.toReal_mono (by simp) h).trans (by simp) + +def shiftOperator : Hilbert →L[ℂ] Hilbert := + (WeightedShift.shift 1).toLinearIsometry.toContinuousLinearMap.compLpL 2 baseMeasure + +def multiplierField (θ : ℕ → ℝ) (g : Base → ℂ) (C : ℝ) + (hb : ∀ x, ‖g x‖ ≤ C) (x : Base) : WeightedShift.Weight := + ⟨fun k => g (rotationIterate θ k x), memℓp_infty <| by + refine ⟨C, ?_⟩ + rintro r ⟨k, rfl⟩ + exact hb _⟩ + +def multiplier (θ : ℕ → ℝ) (g : Base → ℂ) (C : ℝ) (hC : 0 ≤ C) + (hg : Measurable g) (hb : ∀ x, ‖g x‖ ≤ C) : Hilbert →L[ℂ] Hilbert := + WeightedShift.fieldDiagonal (multiplierField θ g C hb) C hC + (fun _x => lp.norm_le_of_forall_le hC (fun _k => hb _)) + (fun k => (hg.comp (measurable_iterate θ k)).aestronglyMeasurable) + +def multiplierGenerators (θ : ℕ → ℝ) : Set (Hilbert →L[ℂ] Hilbert) := + {A | ∃ (g : Base → ℂ) (C : ℝ) (hC : 0 ≤ C) (hg : Measurable g) + (hb : ∀ x, ‖g x‖ ≤ C), A = multiplier θ g C hC hg hb} + +def factor (θ : ℕ → ℝ) : VonNeumannAlgebra Hilbert := + vonNeumannGenerated ({shiftOperator} ∪ multiplierGenerators θ) + +def traceVector : Hilbert := Lp.const 2 baseMeasure (lp.single 2 0 (1 : ℂ)) + +theorem measurable_complexWeight (θ c : ℕ → ℝ) : + Measurable (fun x => (weight θ c x : ℂ)) := + (weight_measurable θ c).complex_ofReal + +theorem norm_complexWeight_le_one (θ c : ℕ → ℝ) (x : Base) : + ‖(weight θ c x : ℂ)‖ ≤ 1 := by + simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (weight_nonneg θ c x)] + using weight_le_one θ c x + +local instance instNormedAddCommGroupProductWeightedOperator : NormedAddCommGroup Hilbert := + @MeasureTheory.Lp.instNormedAddCommGroup Base Fiber MeasurableSpace.pi 2 baseMeasure + (@lp.normedAddCommGroup ℤ (fun _ => ℂ) 2 + (fun _ => Complex.instNormedAddCommGroup) fact_one_le_two_ennreal) + fact_one_le_two_ennreal + +local instance instInnerProductSpaceProductWeightedOperator : + @InnerProductSpace ℂ Hilbert Complex.instRCLike + instNormedAddCommGroupProductWeightedOperator.toSeminormedAddCommGroup := + @MeasureTheory.L2.innerProductSpace Base Fiber ℂ Complex.instRCLike MeasurableSpace.pi + baseMeasure + (@lp.normedAddCommGroup ℤ (fun _ => ℂ) 2 + (fun _ => Complex.instNormedAddCommGroup) fact_one_le_two_ennreal) + (@lp.instInnerProductSpace ℤ ℂ Complex.instRCLike (fun _ => ℂ) + (fun _ => Complex.instNormedAddCommGroup) + (fun _ => @RCLike.innerProductSpace ℂ Complex.instRCLike)) + +local instance instTopologicalSpaceProductWeightedOperator : TopologicalSpace Hilbert := + instNormedAddCommGroupProductWeightedOperator.toUniformSpace.toTopologicalSpace + +local instance instAddCommMonoidProductWeightedOperator : AddCommMonoid Hilbert := + instNormedAddCommGroupProductWeightedOperator.toAddCommGroup.toAddCommMonoid + +local instance instModuleProductWeightedOperator : Module ℂ Hilbert := + instInnerProductSpaceProductWeightedOperator.toNormedSpace.toModule + +local notation "weightedOperatorSemiring" => + Complex.instNormedField.toField.toCommRing.toRing.toSemiring + +local notation "weightedOperatorScalarIdentity" => + @RingHom.id ℂ (@Semiring.toNonAssocSemiring ℂ weightedOperatorSemiring) + +run_cmd Lean.modifyEnv fun env => Lean.Meta.auxLemmasExt.setState env {} + +def weightedOperator (θ c : ℕ → ℝ) : + @ContinuousLinearMap ℂ ℂ weightedOperatorSemiring weightedOperatorSemiring + weightedOperatorScalarIdentity + Hilbert instTopologicalSpaceProductWeightedOperator instAddCommMonoidProductWeightedOperator + Hilbert instTopologicalSpaceProductWeightedOperator instAddCommMonoidProductWeightedOperator + instModuleProductWeightedOperator instModuleProductWeightedOperator := + let compose := fun (Scalar : Type) [Semiring Scalar] (Space : Type) + [TopologicalSpace Space] [AddCommMonoid Space] [Module Scalar Space] + (left right : Space →L[Scalar] Space) => left ∘L right + @compose ℂ weightedOperatorSemiring Hilbert instTopologicalSpaceProductWeightedOperator + instAddCommMonoidProductWeightedOperator instModuleProductWeightedOperator + shiftOperator (multiplier θ (fun x => (weight θ c x : ℂ)) 1 zero_le_one + (measurable_complexWeight θ c) (norm_complexWeight_le_one θ c)) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductBase.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductBase.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a4abc8d1e3dfc8b6424dcfdbe7c67ea4687bf26 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductBase.lean @@ -0,0 +1,64 @@ +import OAI.Analysis.IrrationalRotation.Model.Analytic +import Mathlib.Probability.ProductMeasure +import Mathlib.MeasureTheory.Function.L2Space +import Mathlib.Analysis.InnerProductSpace.l2Space + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal +namespace Invariant233 + +def circleRepresentative (x : Circle) : ℝ := + (AddCircle.equivIco (1 : ℝ) 0 x).val + +instance circleMeasure_probability : IsProbabilityMeasure circleMeasure := by + constructor + simp [circleMeasure, Circle, AddCircle.measure_univ] + +namespace ProductModel + +abbrev Base := ℕ → Circle + +def baseMeasure : Measure Base := Measure.infinitePi (fun _ : ℕ => circleMeasure) + +instance baseMeasure_probability : IsProbabilityMeasure baseMeasure := by + unfold baseMeasure + infer_instance + +def Ordered (x y : Base) : Prop := + ∀ i, circleRepresentative (x i) ≤ circleRepresentative (y i) + +def rotation (θ : ℕ → ℝ) (x : Base) : Base := + fun i => x i + (θ i : Circle) + +def rotationIterate (θ : ℕ → ℝ) (k : ℤ) (x : Base) : Base := + fun i => x i + ((k : ℝ) * θ i : ℝ) + +def logarithmicCost (θ c : ℕ → ℝ) (x : Base) : ℝ≥0∞ := + ∑' i, ENNReal.ofReal (c i * (⌊circleRepresentative (x i) + θ i⌋ : ℤ)) + +def weight (θ c : ℕ → ℝ) (x : Base) : ℝ := + (EReal.exp (-(logarithmicCost θ c x : EReal))).toReal + +def JointlyRationallyIndependent (θ : ℕ → ℝ) : Prop := + LinearIndependent ℚ (fun i : Option ℕ => i.elim 1 θ) + +def AdmissibleAnglesAndCosts (θ c : ℕ → ℝ) : Prop := + (∀ i, 0 < θ i ∧ θ i < 1 ∧ 0 < c i) ∧ + Summable θ ∧ JointlyRationallyIndependent θ + +abbrev Fiber := @lp ℤ (fun _ => ℂ) (fun _ => Complex.instNormedAddCommGroup) 2 +abbrev Hilbert := + @MeasureTheory.Lp Base Fiber MeasurableSpace.pi + (@lp.normedAddCommGroup ℤ (fun _ => ℂ) 2 + (fun _ => Complex.instNormedAddCommGroup) fact_one_le_two_ennreal) + 2 baseMeasure + +end ProductModel +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductCharacters.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductCharacters.lean new file mode 100644 index 0000000000000000000000000000000000000000..4099c226c64dbe359cf19d4b8f5ef03d23de2b8a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductCharacters.lean @@ -0,0 +1,29 @@ +import Mathlib.Analysis.Fourier.AddCircle +import Mathlib.Data.Finsupp.SMul + +namespace OAI + +namespace InvariantProjection.ProductRotation + +open scoped BigOperators + +noncomputable def characterPhase {ι : Type*} (v : ι →₀ ℤ) + (x : ι → UnitAddCircle) : UnitAddCircle := + v.sum (fun i n => n • x i) + +noncomputable def productCharacter {ι : Type*} (v : ι →₀ ℤ) : + C((ι → UnitAddCircle), ℂ) where + toFun x := (AddCircle.toCircle (characterPhase v x) : ℂ) + continuous_toFun := by + apply continuous_subtype_val.comp + apply AddCircle.continuous_toCircle.comp + unfold characterPhase Finsupp.sum + fun_prop + +noncomputable def productFourierAlgebra (ι : Type*) : + StarSubalgebra ℂ C((ι → UnitAddCircle), ℂ) := + StarAlgebra.adjoin ℂ (Set.range (productCharacter (ι := ι))) + +end InvariantProjection.ProductRotation + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductCocycle.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductCocycle.lean new file mode 100644 index 0000000000000000000000000000000000000000..36fc10f5e118569d524678132e5769c04ac3a298 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductCocycle.lean @@ -0,0 +1,31 @@ +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic +import Mathlib.Probability.ProductMeasure + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Invariant233.ProductCocycle + +abbrev Space (I : Type*) := I → UnitAddCircle + +def haar (I : Type*) : Measure (Space I) := + Measure.infinitePi (fun _ : I ↦ (volume : Measure UnitAddCircle)) + +def representative (x : UnitAddCircle) : ℝ := + (AddCircle.equivIco (1 : ℝ) 0 x : ℝ) + +def rotate {I : Type*} (θ : I → ℝ) (k : ℤ) (x : Space I) : Space I := + fun i ↦ x i + (((k : ℝ) * θ i : ℝ) : UnitAddCircle) + +def cocycleVersion {I : Type*} (θ c : I → ℝ) (k : ℤ) (x : Space I) : ℝ := + Real.exp (-(∑' i, c i * (⌊representative (x i) + (k : ℝ) * θ i⌋ : ℝ))) + +end Invariant233.ProductCocycle + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductCoupling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..c35b309cb2c5817bdeea090602df7d656da9829f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductCoupling.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.IrrationalRotation.Model.OneCoordinateCoupling + +namespace OAI + +open MeasureTheory + +namespace Invariant233.OrderedProductCoupling + +open OneCoordinateCoupling + +structure Parameters where + κ : ℕ → ℝ + m : ℕ → ℝ + a : ℕ → ℝ + b : ℕ → ℝ + t : ℕ → ℝ + κ_nonneg : ∀ i, 0 ≤ κ i + κ_le : ∀ i, κ i ≤ 1 / 100 + m_ge : ∀ i, 100 ≤ m i + a_lower : ∀ i, 1 / m i ≤ a i + a_upper : ∀ i, a i ≤ 1 / 4 + b_lower : ∀ i, 1 / m i ≤ b i + b_upper : ∀ i, b i ≤ 1 / 4 + t_nonneg : ∀ i, 0 ≤ t i + t_le : ∀ i, t i ≤ 1 + +abbrev CoordinateSample := Option (Fin 5) × (ℝ × ℝ) +abbrev Sample := ℕ → CoordinateSample +abbrev Endpoint := ℕ → ℝ + +noncomputable def coordinateLaw (P : Parameters) (i : ℕ) : Measure CoordinateSample := + labelledLaw (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) + +noncomputable def law (P : Parameters) : Measure Sample := + Measure.infinitePi (coordinateLaw P) + +noncomputable def baseMeasure : Measure Endpoint := + Measure.infinitePi (fun _ : ℕ => baseLaw) + +def leftEndpoint (ω : Sample) (i : ℕ) : ℝ := (ω i).2.1 + +def rightEndpoint (ω : Sample) (i : ℕ) : ℝ := (ω i).2.2 + +def hybridEndpoint (ε : ℕ → Bool) (ω : Sample) (i : ℕ) : ℝ := + if ε i then rightEndpoint ω i else leftEndpoint ω i + +noncomputable def marginalDensity (P : Parameters) (side : Bool) (i : ℕ) : ℝ → ℝ := + if side then rightMarginalDensity (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) + else leftMarginalDensity (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) + +noncomputable def energyBound (P : Parameters) (i : ℕ) : ℝ := + 20 * (2 * (P.κ i) ^ 2 / P.m i + P.t i / P.m i) + +end Invariant233.OrderedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductCouplingCircle.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductCouplingCircle.lean new file mode 100644 index 0000000000000000000000000000000000000000..aad48540bd64e701ee7f6fd908119cf38b939190 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductCouplingCircle.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductCoupling +import OAI.Analysis.IrrationalRotation.Model.ProductBase + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.OrderedProductCoupling + +def circleEndpoint (x : Endpoint) : ProductModel.Base := fun i => (x i : Circle) + +def realEndpoint (x : ProductModel.Base) : Endpoint := + fun i => circleRepresentative (x i) + +def circleLeftEndpoint : Sample → ProductModel.Base := circleEndpoint ∘ leftEndpoint + +def circleRightEndpoint : Sample → ProductModel.Base := circleEndpoint ∘ rightEndpoint + +def circleHybridEndpoint (ε : ℕ → Bool) : Sample → ProductModel.Base := + circleEndpoint ∘ hybridEndpoint ε + +def circlePairLaw (P : Parameters) : Measure (ProductModel.Base × ProductModel.Base) := + (law P).map (fun ω => (circleLeftEndpoint ω, circleRightEndpoint ω)) + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductFactorStructure.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductFactorStructure.lean new file mode 100644 index 0000000000000000000000000000000000000000..fedb5528dfb3e7bcca4f3db5fef9a91760ec54dc --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductFactorStructure.lean @@ -0,0 +1,28 @@ +import OAI.Analysis.IrrationalRotation.Model.Product +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties + +namespace OAI + +noncomputable section +open MeasureTheory +namespace Invariant233.ProductModel + +def IsCovariantFieldRepresentation (θ : ℕ → ℝ) (A : Hilbert →L[ℂ] Hilbert) + (F : Base → Fiber →L[ℂ] Fiber) (B : ℝ) : Prop := + 0 ≤ B ∧ (∀ x, ‖F x‖ ≤ B) ∧ + (∀ v : Fiber, StronglyMeasurable (fun x => F x v)) ∧ + (∀ f : Hilbert, A f =ᵐ[baseMeasure] fun x => F x (f x)) ∧ + (∀ᵐ x ∂baseMeasure, + F (rotation θ x) = + (WeightedShift.shift (-1)).toLinearIsometry.toContinuousLinearMap * F x * + (WeightedShift.shift 1).toLinearIsometry.toContinuousLinearMap) + +def centralDiagonalIntegral (F : Base → Fiber →L[ℂ] Fiber) : ℂ := + ∫ x, inner ℂ (lp.single 2 0 (1 : ℂ) : Fiber) + (F x (lp.single 2 0 (1 : ℂ) : Fiber)) ∂baseMeasure + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductIdealSampling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductIdealSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..288e831f856f1826ca946fa8966ccb6d59ad6464 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductIdealSampling.lean @@ -0,0 +1,35 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductSampling +import OAI.Analysis.IrrationalRotation.Model.ScalarSampling + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.ProductModel.IdealSampling + +def endpoint (I D : Finset ℕ) (h : ℝ) (x z : Base) : Base := + fun i => if i ∈ I then z i else if i ∈ D then + x i + ((h * ScalarSampling.delta (circleRepresentative (x i)) * + circleRepresentative (z i) : ℝ) : Circle) else x i + +def endpointMap (I D : Finset ℕ) (h : ℝ) (xz : EndpointPair) : EndpointPair := + (xz.1, endpoint I D h xz.1 xz.2) + +def cutoffEvent (I D : Finset ℕ) (α : ℝ) : Set EndpointPair := + {xz | ∀ i ∈ D \ I, α ≤ ScalarSampling.delta (circleRepresentative (xz.1 i))} + +def sourceMeasure (I : Finset ℕ) : Measure EndpointPair := + (baseMeasure.prod baseMeasure).restrict (triangularEvent I) + +def uncutLaw (I D : Finset ℕ) (h : ℝ) : Measure EndpointPair := + (sourceMeasure I).map (endpointMap I D h) + +def law (I D : Finset ℕ) (h α : ℝ) : Measure EndpointPair := + ((sourceMeasure I).restrict (cutoffEvent I D α)).map (endpointMap I D h) + +end Invariant233.ProductModel.IdealSampling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductPairIdentity.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductPairIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8ebf394a838ecec01337f472192faa91210b411 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductPairIdentity.lean @@ -0,0 +1,27 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductFactorStructure +import OAI.Analysis.IrrationalRotation.Model.ProductCocycle +import OAI.Analysis.IrrationalRotation.Model.ProductSampling +import OAI.Analysis.IrrationalRotation.Model.UnrestrictedDiagonal + +namespace OAI + +noncomputable section +namespace Invariant233.ProductModel + +def cocycleRatio (θ c : ℕ → ℝ) (x y : Base) (k : ℤ) : ℝ := + ProductCocycle.cocycleVersion θ c k y / ProductCocycle.cocycleVersion θ c k x + +def ratioDiagonal (θ c : ℕ → ℝ) (x y : Base) : Fiber →L[ℂ] Fiber := + SequenceHilbert.boundedDiagonal (fun k => (cocycleRatio θ c x y k : ℂ)) + +def PairIdentity (θ c : ℕ → ℝ) (F : Base → Fiber →L[ℂ] Fiber) + (xy : EndpointPair) : Prop := + (∀ k : ℤ, 0 < cocycleRatio θ c xy.1 xy.2 k ∧ + cocycleRatio θ c xy.1 xy.2 k ≤ 1) ∧ + (1 - F xy.2) * ratioDiagonal θ c xy.1 xy.2 * F xy.1 = 0 + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductPowers.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductPowers.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f0bbdc91d08a1aaeb56f27e321eb397f8c93e02 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductPowers.lean @@ -0,0 +1,50 @@ +import OAI.Analysis.IrrationalRotation.Model.Product +import OAI.Analysis.IrrationalRotation.Model.ProductCocycle + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal +namespace Invariant233.ProductModel + +private theorem measurable_cocycle (θ c : ℕ → ℝ) (n : ℕ) : + Measurable (ProductCocycle.cocycleVersion θ c n) := by + apply Real.measurable_exp.comp + apply Measurable.neg + apply Measurable.tsum + intro i + have hrep : Measurable (fun x : Base => ProductCocycle.representative (x i)) := + (measurable_subtype_coe.comp + (AddCircle.measurableEquivIco (T := (1 : ℝ)) 0).measurable).comp + (measurable_pi_apply i) + exact measurable_const.mul ((measurable_of_countable (fun z : ℤ => (z : ℝ))).comp + ((hrep.add_const ((n : ℝ) * θ i)).floor)) + +private theorem cocycle_norm_le_one (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (n : ℕ) (x : Base) : + ‖(ProductCocycle.cocycleVersion θ c n x : ℂ)‖ ≤ 1 := by + unfold ProductCocycle.cocycleVersion + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] + apply Real.exp_le_one_iff.mpr + apply neg_nonpos.mpr + apply tsum_nonneg + intro i + apply mul_nonneg (hc i) + have hrep : 0 ≤ ProductCocycle.representative (x i) := by + exact (AddCircle.equivIco (1 : ℝ) 0 (x i)).property.1 + have hf : (0 : ℤ) ≤ ⌊ProductCocycle.representative (x i) + (n : ℝ) * θ i⌋ := + Int.floor_nonneg.mpr (add_nonneg hrep (mul_nonneg (Nat.cast_nonneg n) (hθ0 i))) + exact_mod_cast hf + +def positiveCocycleMultiplier (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (n : ℕ) : Hilbert →L[ℂ] Hilbert := + multiplier θ (fun x => (ProductCocycle.cocycleVersion θ c n x : ℂ)) 1 + (by norm_num) (measurable_cocycle θ c n).complex_ofReal + (cocycle_norm_le_one θ c hθ0 hc n) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductPrefixDomination.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductPrefixDomination.lean new file mode 100644 index 0000000000000000000000000000000000000000..643d65527e81de2c343eab873734abee82904ac3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductPrefixDomination.lean @@ -0,0 +1,48 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductCoupling +import OAI.Analysis.IrrationalRotation.Model.PrefixDomination + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal BigOperators + +namespace Invariant233.OrderedProductCoupling + +abbrev PrefixIndex (D : ℕ) := ↥(Finset.range D) +abbrev TailIndex (D : ℕ) := {i : ℕ // i ∉ Finset.range D} +abbrev PrefixPairs (D : ℕ) := PrefixIndex D → ℝ × ℝ +abbrev TailValues (D : ℕ) := TailIndex D → ℝ + +def assemblePrefixPair (D : ℕ) (z : PrefixPairs D × TailValues D) : Endpoint × Endpoint := + ((fun i => if hi : i ∈ Finset.range D then (z.1 ⟨i, hi⟩).1 else z.2 ⟨i, hi⟩), + (fun i => if hi : i ∈ Finset.range D then (z.1 ⟨i, hi⟩).2 else z.2 ⟨i, hi⟩)) + +def prefixPairLaw (P : Parameters) (D : ℕ) : Measure (Endpoint × Endpoint) := + (law P).map (fun ω => (leftEndpoint ω, + hybridEndpoint (fun i => decide (i ∈ Finset.range D)) ω)) + +def prefixPairsLaw (P : Parameters) (D : ℕ) : Measure (PrefixPairs D) := + Measure.pi (fun i => OneCoordinateCoupling.pairLaw + (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i)) + +def leftTailLaw (P : Parameters) (D : ℕ) : Measure (TailValues D) := + Measure.infinitePi (fun i : TailIndex D => + (coordinateLaw P i).map (fun z => z.2.1)) + +def baseTailLaw (D : ℕ) : Measure (TailValues D) := + Measure.infinitePi (fun _ => OneCoordinateCoupling.baseLaw) + +def prefixReferenceLaw (D : ℕ) : Measure (PrefixPairs D) := + ∑ pattern : PrefixIndex D → Bool, Measure.pi (fun i => + if pattern i then OneCoordinateCoupling.triangleLaw + else CouplingMixture.diagonal OneCoordinateCoupling.baseLaw) + +def prefixReferencePairLaw (D : ℕ) : Measure (Endpoint × Endpoint) := + ((prefixReferenceLaw D).prod (baseTailLaw D)).map (assemblePrefixPair D) + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductSampling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..2628217831bf85b64bf4d3553279b72f5746251b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductSampling.lean @@ -0,0 +1,71 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductBase +import Mathlib.MeasureTheory.Measure.WithDensity +import Mathlib.MeasureTheory.Measure.FiniteMeasure + +namespace OAI + +noncomputable section +open Filter MeasureTheory +open scoped ENNReal Topology BigOperators + +namespace Invariant233.ProductModel + +abbrev EndpointPair := Base × Base + +def selectedEndpoint (I : Finset ℕ) (x z : Base) : Base := + fun i => if i ∈ I then z i else x i + +def triangularEvent (I : Finset ℕ) : Set EndpointPair := + {xz | ∀ i ∈ I, circleRepresentative (xz.1 i) < circleRepresentative (xz.2 i)} + +def triangularLaw (I : Finset ℕ) : Measure EndpointPair := + Measure.map (fun xz : EndpointPair => (xz.1, selectedEndpoint I xz.1 xz.2)) + ((baseMeasure.prod baseMeasure).restrict (triangularEvent I)) + +def triangularFirstDensity (I : Finset ℕ) (x : Base) : ℝ := + ∏ i ∈ I, (1 - circleRepresentative (x i)) + +def triangularSecondDensity (I : Finset ℕ) (y : Base) : ℝ := + ∏ i ∈ I, circleRepresentative (y i) + +def TriangularLawProperties (I : Finset ℕ) : Prop := + IsFiniteMeasure (triangularLaw I) ∧ + triangularLaw I Set.univ = (1 / 2 : ℝ≥0∞) ^ I.card ∧ + (triangularLaw I).map Prod.fst = + baseMeasure.withDensity (fun x => ENNReal.ofReal (triangularFirstDensity I x)) ∧ + (triangularLaw I).map Prod.snd = + baseMeasure.withDensity (fun y => ENNReal.ofReal (triangularSecondDensity I y)) ∧ + (∀ᵐ xy ∂triangularLaw I, Ordered xy.1 xy.2) ∧ + (∀ x, 0 ≤ triangularFirstDensity I x ∧ triangularFirstDensity I x ≤ 1) ∧ + (∀ y, 0 ≤ triangularSecondDensity I y ∧ triangularSecondDensity I y ≤ 1) + +def WeaklyConverges (η : ℕ → Measure EndpointPair) (ν : Measure EndpointPair) : Prop := + ∀ φ : C(EndpointPair, ℝ), + Tendsto (fun l => ∫ xy, φ xy ∂η l) atTop (𝓝 (∫ xy, φ xy ∂ν)) + +def SupportedOnPositiveOrderedOrbitPairs (θ : ℕ → ℝ) (η : Measure EndpointPair) : Prop := + ∃ N : Finset ℕ, (∀ n ∈ N, 0 < n) ∧ + ∀ᵐ xy ∂η, Ordered xy.1 xy.2 ∧ + ∃ n ∈ N, xy.2 = rotationIterate θ (n : ℤ) xy.1 + +def HasUniformL2Marginals (η : ℕ → Measure EndpointPair) : Prop := + ∃ H : ℝ, 0 ≤ H ∧ ∀ l, ∃ f g : Lp ℝ 2 baseMeasure, + (∀ᵐ x ∂baseMeasure, 0 ≤ f x) ∧ (∀ᵐ y ∂baseMeasure, 0 ≤ g y) ∧ + (η l).map Prod.fst = baseMeasure.withDensity (fun x => ENNReal.ofReal (f x)) ∧ + (η l).map Prod.snd = baseMeasure.withDensity (fun y => ENNReal.ofReal (g y)) ∧ + ‖f‖ ≤ H ∧ ‖g‖ ≤ H + +def OrderedOrbitSampling (θ : ℕ → ℝ) (I : Finset ℕ) : Prop := + ∃ η : ℕ → Measure EndpointPair, + (∀ l, IsFiniteMeasure (η l)) ∧ + (∀ l, SupportedOnPositiveOrderedOrbitPairs θ (η l)) ∧ + HasUniformL2Marginals η ∧ WeaklyConverges η (triangularLaw I) + +def HasAllFiniteCoordinateSampling (θ : ℕ → ℝ) : Prop := + ∀ I : Finset ℕ, OrderedOrbitSampling θ I + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductScaleSampling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductScaleSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..4098396a631c06c516043506bce4cd654b44caae --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductScaleSampling.lean @@ -0,0 +1,20 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductScales + +namespace OAI + +namespace Invariant233 + +structure ProductSamplingPowersAt (p : ProductScaleData) (j : ℕ) + (s : Finset ℕ) : Prop where + range : ∀ n ∈ s, (p.m j : ℝ) ^ ((7 / 10 : ℝ) * p.m j) / 2 ≤ n ∧ + (n : ℝ) ≤ (p.m j : ℝ) ^ ((7 / 10 : ℝ) * p.m j) + cardinality : (p.m j : ℝ) ^ ((69 / 100 : ℝ) * p.m j) ≤ (s.card : ℝ) + positive : ∀ n ∈ s, 0 < n + separation : ∀ n ∈ s, ∀ n' ∈ s, n ≠ n' → ∀ v v' : ℤ, + |v| ≤ (p.m j ^ 300 : ℕ) → |v'| ≤ (p.m j ^ 300 : ℕ) → + (v ≠ 0 ∨ v' ≠ 0) → + (p.m j * p.K j * p.m j ^ 1000 : ℕ) < |v * (n : ℤ) + v' * (n' : ℤ)| + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductScales.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductScales.lean new file mode 100644 index 0000000000000000000000000000000000000000..d7572b2403db8cfeb74a12a85a42c9b3223c3332 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductScales.lean @@ -0,0 +1,79 @@ +import OAI.Analysis.IrrationalRotation.Model.LaurentConvolution +import Mathlib.Analysis.SpecialFunctions.Pow.Real + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Invariant233 + +structure ProductScaleData where + m : ℕ → ℕ + K : ℕ → ℕ + G : ℕ → ℕ + L : ℕ → ℝ + C : ℕ → ℝ + ε : ℕ → ℝ + +namespace ProductScaleData + +def prefixCount (p : ProductScaleData) (n : ℕ) : ℕ := + ∑ r ∈ Finset.range n, p.m r + +def prefixCost (p : ProductScaleData) (n : ℕ) : ℝ := + ∑ r ∈ Finset.range n, p.C r * p.m r + +def coefficientBound (p : ProductScaleData) (n : ℕ) : ℝ := + Real.exp (((p.K n : ℝ) + 1) * p.prefixCost n) + +def kappa (n : ℕ) : ℝ := 1 / (100 * ((n + 1 : ℕ) : ℝ)) + +def N (p : ProductScaleData) (n : ℕ) : ℝ := (p.m n : ℝ) * p.K n + +def a (p : ProductScaleData) (n : ℕ) : ℝ := (p.G n : ℝ) / p.m n + +def b (p : ProductScaleData) (n : ℕ) : ℝ := (p.m n : ℝ) ^ (-(19 / 20 : ℝ)) + +end ProductScaleData + +open Invariant233.FiniteWindow + +structure ProductScaleLaws (p : ProductScaleData) : Prop where + initial_K : p.K 0 = 100 + initial_G : p.G 0 = 1 + K_pos : ∀ n, 0 < p.K n + G_pos : ∀ n, 0 < p.G n + epsilon_pos : ∀ n, 0 < p.ε n + L_ge_one : ∀ n, 1 ≤ p.L n + L_monotone : Monotone p.L + C_eq : ∀ n, p.C n = max (p.L n) ((p.K n : ℝ) ^ 2) + polynomial_lower : ∀ n, ∀ A B : ℤ → ℂ, + (∀ i, |i| ≤ (p.K n : ℤ) → ‖A i‖ ≤ p.coefficientBound n) → + (∀ i, |i| ≤ (p.K n : ℤ) → ‖B i‖ ≤ p.coefficientBound n) → + 1 / ((n + 1 : ℕ) : ℝ) ≤ ‖A 0‖ → + 1 / ((n + 1 : ℕ) : ℝ) ≤ ‖B 0‖ → + ∃ i : ℕ, i ≤ 2 * p.K n ∧ p.ε n ≤ ‖convolution (p.K n) A B i‖ + polynomial_attenuation : ∀ n, + ((2 * p.K n + 1 : ℕ) : ℝ) * 3 * Real.exp (-p.L n / 10000) ≤ + p.ε n / ((n + 1 : ℕ) : ℝ) + gain_attenuation : ∀ n, + p.L n ≤ ProductScaleData.kappa (n + 1) * Real.sqrt (p.G (n + 1) : ℝ) + m_ge_K : ∀ n, p.K n ≤ p.m n + m_ge_pow : ∀ n, 2 ^ (n + 1) ≤ p.m n + m_ge_G : ∀ n, 4 * p.G n ≤ p.m n + m_ge_100 : ∀ n, 100 ≤ p.m n + prefix_count_le : ∀ n, (p.prefixCount n : ℝ) ≤ (p.m n : ℝ) / 100 + m_attenuation : ∀ n, + p.L n ≤ ProductScaleData.kappa n * (p.m n : ℝ) ^ (1 / 40 : ℝ) + next_K : ∀ n, + p.K (n + 1) = ⌈(p.m n : ℝ) ^ ((3 / 4 : ℝ) * p.m n)⌉₊ + next_gap : ∀ n, (p.G (n + 1) : ℝ) * p.K (n + 1) < + (p.m n : ℝ) ^ ((4 / 5 : ℝ) * p.m n) + K_double : ∀ n, 2 * p.K n < p.K (n + 1) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductTailDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductTailDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd7f5809c03c919c934a3a93c1444bd62b11befd --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductTailDensity.lean @@ -0,0 +1,32 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductBase +import OAI.Analysis.IrrationalRotation.Model.BiasedTailDensity + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.ProductModel + +abbrev Prefix (D : ℕ) := {i : ℕ // i < D} → Circle +abbrev Tail (D : ℕ) := {i : ℕ // ¬i < D} → Circle + +def prefixMeasure (D : ℕ) : Measure (Prefix D) := + Measure.infinitePi fun _ : {i : ℕ // i < D} => circleMeasure + +def tailMeasure (D : ℕ) : Measure (Tail D) := + Measure.infinitePi fun _ : {i : ℕ // ¬i < D} => circleMeasure + +def splitCoordinates (D : ℕ) : Base ≃ᵐ Prefix D × Tail D := + MeasurableEquiv.piEquivPiSubtypeProd (fun _ : ℕ => Circle) (fun i => i < D) + +def tailCoordinates (D : ℕ) (x : Base) : Tail D := fun i => x i + +def prefixTailDensity (D : ℕ) (g : Base → ℝ) : Tail D → ℝ := + BiasedTailDensity.tailDensity (prefixMeasure D) (g ∘ (splitCoordinates D).symm) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ProductTailTrimming.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ProductTailTrimming.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e8a5c0c70f8e1d8dc73149696a56c53b97b67f1 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ProductTailTrimming.lean @@ -0,0 +1,39 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductBase +import Mathlib.MeasureTheory.Measure.WithDensity + +namespace OAI + +noncomputable section +open MeasureTheory Set +open scoped ENNReal BigOperators + +namespace Invariant233.ProductModel + +def coordinateOrderFailure (θ : ℕ → ℝ) (n : ℕ) (i : ℕ) : Set Base := + {x | circleRepresentative (rotationIterate θ (n : ℤ) x i) < + circleRepresentative (x i)} + +def tailOrderFailure (I : Finset ℕ) (θ : ℕ → ℝ) (n : ℕ) : Set Base := + ⋃ i : {i : ℕ // i ∉ I}, coordinateOrderFailure θ n i + +namespace TailTrimming + +def orbitPairMap (θ : ℕ → ℝ) (n : ℕ) (x : Base) : Base × Base := + (x, rotationIterate θ (n : ℤ) x) + +def orbitPairMeasure (θ : ℕ → ℝ) (n : ℕ) (w : Base → ℝ≥0∞) : Measure (Base × Base) := + (baseMeasure.withDensity w).map (orbitPairMap θ n) + +def orbitAverageMeasure (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ≥0∞) : Measure (Base × Base) := + (N.card : ℝ≥0∞)⁻¹ • ∑ n ∈ N, orbitPairMeasure θ n (w n) + +def orderedPairEvent : Set (Base × Base) := {xy | Ordered xy.1 xy.2} + +end TailTrimming + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/RationalGraphTrimming.lean b/lean/OAI/Analysis/IrrationalRotation/Model/RationalGraphTrimming.lean new file mode 100644 index 0000000000000000000000000000000000000000..2234c777a7f3551a92d318eb55879c1345f913e2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/RationalGraphTrimming.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleParameters + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Invariant233.CircleParameterData + +def orbitGraphDensity (p : CircleParameterData) (θ : ℝ) (j n : ℕ) + (x : Circle) : ℝ := + ∏ i ∈ p.block j, kernel (p.m j) (p.coordinate i x) + (Int.fract ((n : ℝ) * p.alpha θ i)) + +def rationalGraphGood (p : CircleParameterData) (A j : ℕ) : Set Circle := + {x | (∀ i, A ≤ i → i ≤ p.blockEnd (j - 1) → + p.coordinate i x < 1 - (p.q (p.blockEnd (j - 1)) : ℝ) * p.ell j) ∧ + ∀ s, j < s → ∀ i ∈ p.block s, + p.coordinate i x < 1 - 2 * p.Q j / p.N s} + +def rationalGraphPrefixCost (p : CircleParameterData) (A : ℕ) : ℝ := + ∑ k ∈ Finset.range (A - 1), p.flattenedCost k + +def rationalGraphBad (p : CircleParameterData) (A j : ℕ) : Set Circle := + (p.rationalGraphGood A j)ᶜ + +end Invariant233.CircleParameterData + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/RealTriangularLaw.lean b/lean/OAI/Analysis/IrrationalRotation/Model/RealTriangularLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..11fa4fa6e46df2d55d7f2d110c42e36cebefee30 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/RealTriangularLaw.lean @@ -0,0 +1,28 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductCouplingCircle +import OAI.Analysis.IrrationalRotation.Model.ProductSampling + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.OrderedProductCoupling + +def realSelectedEndpoint (I : Finset ℕ) (x z : Endpoint) : Endpoint := + fun i => if i ∈ I then z i else x i + +def realTriangularEvent (I : Finset ℕ) : Set (Endpoint × Endpoint) := + {xz | ∀ i ∈ I, xz.1 i < xz.2 i} + +def realTriangularLaw (I : Finset ℕ) : Measure (Endpoint × Endpoint) := + ((baseMeasure.prod baseMeasure).restrict (realTriangularEvent I)).map + (fun xz => (xz.1, realSelectedEndpoint I xz.1 xz.2)) + +def circlePairEndpoint : Endpoint × Endpoint → ProductModel.EndpointPair := + Prod.map circleEndpoint circleEndpoint + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/Rotation.lean b/lean/OAI/Analysis/IrrationalRotation/Model/Rotation.lean new file mode 100644 index 0000000000000000000000000000000000000000..327e1c94b94027ac949aa0a3f7deaf2740b23c77 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/Rotation.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.IrrationalRotation.Model.Analytic +import OAI.Analysis.IrrationalRotation.Model.WeightedShift +import OAI.Analysis.IrrationalRotation.Model.GeneratedVonNeumann +import OAI.Analysis.IrrationalRotation.Model.FieldDiagonal +import Mathlib.MeasureTheory.Function.LpSpace.Indicator +import Mathlib.Analysis.Fourier.AddCircle +import Mathlib.MeasureTheory.Function.LpSpace.Basic + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Invariant233.Rotation + +instance circleMeasure_probability : IsProbabilityMeasure circleMeasure := by + constructor + change volume (Set.univ : Set Circle) = 1 + exact UnitAddCircle.measure_univ + +abbrev Fiber := WeightedShift.Hilbert +abbrev Hilbert := MeasureTheory.Lp Fiber 2 circleMeasure + +def action (θ : ℝ) (k : ℤ) (x : Circle) : Circle := + x + k • (θ : Circle) + +def U : Hilbert →L[ℂ] Hilbert := + (WeightedShift.shift 1).toLinearIsometry.toContinuousLinearMap.compLpL 2 circleMeasure + +def orbitWeight (θ : ℝ) (a : C(Circle, ℂ)) (x : Circle) : WeightedShift.Weight := + ⟨fun k => a (action θ k x), memℓp_infty <| by + refine ⟨‖a‖, ?_⟩ + rintro r ⟨k, rfl⟩ + exact a.norm_coe_le_norm _⟩ + +def character : C(Circle, ℂ) := fourier 1 + +def representation (θ : ℝ) (a : C(Circle, ℂ)) : Hilbert →L[ℂ] Hilbert := + WeightedShift.fieldDiagonal (orbitWeight θ a) ‖a‖ (norm_nonneg a) + (fun x => lp.norm_le_of_forall_le (norm_nonneg a) (fun k => a.norm_coe_le_norm _)) + (fun k => by + let : T0Space ℝ := @MetricSpace.instT0Space ℝ Real.metricSpace + let : T0Space ℂ := @MetricSpace.instT0Space ℂ Complex.instNormedAddCommGroup.toMetricSpace + change AEStronglyMeasurable (fun x : Circle => a (x + k • (θ : Circle))) circleMeasure + exact (a.continuous.comp (continuous_id.add continuous_const)).aestronglyMeasurable) + +def V (θ : ℝ) : Hilbert →L[ℂ] Hilbert := representation θ character + +def algebra (θ : ℝ) : VonNeumannAlgebra Hilbert := + vonNeumannGenerated ({U, V θ} : Set (Hilbert →L[ℂ] Hilbert)) + +def weighted (θ : ℝ) (a : C(Circle, ℂ)) : Hilbert →L[ℂ] Hilbert := + U * representation θ a + +def complexWeight (f : C(Circle, ℝ)) : C(Circle, ℂ) := + ⟨fun x => (f x : ℂ), Complex.continuous_ofReal.comp f.continuous⟩ + +def weightedReal (θ : ℝ) (f : C(Circle, ℝ)) : Hilbert →L[ℂ] Hilbert := + weighted θ (complexWeight f) + +def vacuum : Hilbert := Lp.const 2 circleMeasure (lp.single 2 (0 : ℤ) (1 : ℂ)) + +def vacuumFunctional (T : Hilbert →L[ℂ] Hilbert) : ℂ := inner ℂ vacuum (T vacuum) + +end Invariant233.Rotation + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/RotationLInfinity.lean b/lean/OAI/Analysis/IrrationalRotation/Model/RotationLInfinity.lean new file mode 100644 index 0000000000000000000000000000000000000000..a5787d13af4747158b2833135c23951f41e61b09 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/RotationLInfinity.lean @@ -0,0 +1,64 @@ +import OAI.Analysis.IrrationalRotation.Model.Rotation +import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm +import Mathlib.MeasureTheory.Function.Holder + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Invariant233.LInfinityRepresentative + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +def value (a : Lp ℂ ∞ μ) (x : X) : ℂ := + if ‖(Lp.aestronglyMeasurable a).mk a x‖ ≤ ‖a‖ then + (Lp.aestronglyMeasurable a).mk a x else 0 + +theorem norm_value_le (a : Lp ℂ ∞ μ) (x : X) : ‖value a x‖ ≤ ‖a‖ := by + unfold value + split_ifs with h + · exact h + · simp + +theorem stronglyMeasurable_value (a : Lp ℂ ∞ μ) : StronglyMeasurable (value a) := by + exact StronglyMeasurable.piecewise + (measurableSet_le + (Lp.aestronglyMeasurable a).stronglyMeasurable_mk.norm.measurable measurable_const) + (Lp.aestronglyMeasurable a).stronglyMeasurable_mk stronglyMeasurable_const + +theorem value_ae (a : Lp ℂ ∞ μ) : value a =ᵐ[μ] a := by + have hb : ∀ᵐ x ∂μ, ‖a x‖ ≤ ‖a‖ := by + have h := ae_le_lpNorm_exponent_top (Lp.memLp a) + simpa only [← toReal_eLpNorm, Lp.norm_def] using h + filter_upwards [(Lp.aestronglyMeasurable a).ae_eq_mk, hb] with x hx hb + simp only [value, ← hx, ite_eq_left hb] + +end Invariant233.LInfinityRepresentative + +namespace Invariant233.Rotation + +def lInfinityProduct (a b : Lp ℂ ∞ circleMeasure) : Lp ℂ ∞ circleMeasure := + (ContinuousLinearMap.lsmul ℂ ℂ).holderL circleMeasure ∞ ∞ ∞ a b + +def lInfinityOrbitWeight (θ : ℝ) (a : Lp ℂ ∞ circleMeasure) (x : Circle) : + WeightedShift.Weight := + ⟨fun k => LInfinityRepresentative.value a (action θ k x), memℓp_infty <| by + refine ⟨‖a‖, ?_⟩ + rintro r ⟨k, rfl⟩ + exact LInfinityRepresentative.norm_value_le a _⟩ + +def lInfinityRepresentation (θ : ℝ) (a : Lp ℂ ∞ circleMeasure) : + Hilbert →L[ℂ] Hilbert := + WeightedShift.fieldDiagonal (lInfinityOrbitWeight θ a) ‖a‖ (norm_nonneg a) + (fun _x => lp.norm_le_of_forall_le (norm_nonneg a) + (fun _k => LInfinityRepresentative.norm_value_le a _)) + (fun _k => ((LInfinityRepresentative.stronglyMeasurable_value a).comp_measurable + (continuous_id.add continuous_const).measurable).aestronglyMeasurable) + +end Invariant233.Rotation + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/RotationMeasurable.lean b/lean/OAI/Analysis/IrrationalRotation/Model/RotationMeasurable.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f1a38921939cb0a14724df7796a53189c38d079 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/RotationMeasurable.lean @@ -0,0 +1,27 @@ +import OAI.Analysis.IrrationalRotation.Model.Rotation + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.Rotation + +def measurableOrbitWeight (θ : ℝ) (g : Circle → ℂ) (C : ℝ) + (hb : ∀ x, ‖g x‖ ≤ C) (x : Circle) : WeightedShift.Weight := + ⟨fun k => g (action θ k x), memℓp_infty <| by + refine ⟨C, ?_⟩ + rintro r ⟨k, rfl⟩ + exact hb _⟩ + +def measurableRepresentation (θ : ℝ) (g : Circle → ℂ) (C : ℝ) (hC : 0 ≤ C) + (hg : Measurable g) (hb : ∀ x, ‖g x‖ ≤ C) : Hilbert →L[ℂ] Hilbert := + WeightedShift.fieldDiagonal (measurableOrbitWeight θ g C hb) C hC + (fun _ => lp.norm_le_of_forall_le hC (fun _ => hb _)) + (fun _k => (hg.comp (continuous_id.add continuous_const).measurable).aestronglyMeasurable) + +end Invariant233.Rotation + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/RotationProducts.lean b/lean/OAI/Analysis/IrrationalRotation/Model/RotationProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..b50384e1da8011fd290bf67902f4d349f79fefbc --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/RotationProducts.lean @@ -0,0 +1,16 @@ +import OAI.Analysis.IrrationalRotation.Model.Rotation + +namespace OAI + +noncomputable section +namespace Invariant233.Rotation + +def orbitProduct (θ : ℝ) (a : C(Circle, ℂ)) (n : ℕ) : C(Circle, ℂ) := + ∏ j ∈ Finset.range n, a.comp ⟨fun x => x + j • (θ : Circle), + continuous_id.add continuous_const⟩ + +end Invariant233.Rotation + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/RotationTransfer.lean b/lean/OAI/Analysis/IrrationalRotation/Model/RotationTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..c762d21d754252840f97a41cc014ed484e919cba --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/RotationTransfer.lean @@ -0,0 +1,17 @@ +import OAI.Analysis.IrrationalRotation.Model.Rotation +import OAI.Analysis.IrrationalRotation.Model.FieldUnboundedMultiplier + +namespace OAI + +noncomputable section +namespace Invariant233.Rotation + +def exponentialTransfer (θ : ℝ) (b : Circle → ℝ) : Hilbert →ₗ.[ℂ] Hilbert := + WeightedShift.fieldUnboundedMultiplier circleMeasure + (fun x k => (Real.exp (b (action θ k x)) : ℂ)) + +end Invariant233.Rotation + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/SamplingTests.lean b/lean/OAI/Analysis/IrrationalRotation/Model/SamplingTests.lean new file mode 100644 index 0000000000000000000000000000000000000000..c0c08ab4a429dabf8645a346f60ebe2c35858e32 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/SamplingTests.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleParameters +import OAI.Analysis.IrrationalRotation.Model.CharacterLaw + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Invariant233.SamplingTests + +def kernel (endpoint : Bool) (m : ℕ) (z v : ℝ) : ℝ := + CircleParameterData.orientedKernel endpoint m z (Int.fract v) + +def circleKernel (endpoint : Bool) (m : ℕ) (v : ℝ) (x : Circle) : ℝ := + kernel endpoint m (CircleParameterData.rep x) v + +def average (endpoint : Bool) (m d : ℕ) (s : Finset ℕ) + (z : (Fin d → ℝ) × UnitAddTorus (Fin d)) : ℝ := + ((s.card : ℝ)⁻¹) * ∑ n ∈ s, ∏ i : Fin d, + circleKernel endpoint m ((n : ℝ) * z.1 i) (z.2 i) + +def errorSq (endpoint : Bool) (m d : ℕ) (s : Finset ℕ) + (z : (Fin d → ℝ) × UnitAddTorus (Fin d)) : ℝ := + (average endpoint m d s z - 1) ^ 2 + +end Invariant233.SamplingTests + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/SawtoothSmoothing.lean b/lean/OAI/Analysis/IrrationalRotation/Model/SawtoothSmoothing.lean new file mode 100644 index 0000000000000000000000000000000000000000..acea81719869a6210ae44247b66e8e1aaca87baf --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/SawtoothSmoothing.lean @@ -0,0 +1,23 @@ +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +import Mathlib.MeasureTheory.Function.Floor + +namespace OAI + +noncomputable section + +namespace InvariantProjection.Continuity + +def smoothSawtooth (δ u : ℝ) : ℝ := + (2 * δ)⁻¹ * ∫ t in -δ..δ, Int.fract (u + t) + +def smoothedDrop (C α δ u : ℝ) : ℝ := + C * (α + smoothSawtooth δ u - smoothSawtooth δ (u + α)) + +def smoothingTransfer (C δ u : ℝ) : ℝ := + C * (smoothSawtooth δ u - Int.fract u) + +end InvariantProjection.Continuity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ScalarEndpointDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ScalarEndpointDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..64762821d2b31232170f1676aee20fdc78855fc2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ScalarEndpointDensity.lean @@ -0,0 +1,24 @@ +import Mathlib.Analysis.SpecialFunctions.Integrals.Basic + +namespace OAI + +namespace Invariant233.ScalarEndpointDensity +noncomputable section + +def cutDistance (z : ℝ) : ℝ := min z (1 - z) + +def endpointMap (t z : ℝ) : ℝ := z + t * cutDistance z + +def midpoint (t : ℝ) : ℝ := (1 + t) / 2 + +def slopeDensity (t s : ℝ) : ℝ := + if s ≤ midpoint t then (1 + t)⁻¹ else (1 - t)⁻¹ + +def averagedDensity (h s : ℝ) : ℝ := + h⁻¹ * ∫ t in (0 : ℝ)..h, slopeDensity t s + +end + +end Invariant233.ScalarEndpointDensity + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ScalarKernelEstimates.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ScalarKernelEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..18a62cc8ca53b64e0a0ebf265cc25e3ed916d75d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ScalarKernelEstimates.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.IrrationalRotation.Model.ScalarSampling +import Mathlib.Topology.EMetricSpace.BoundedVariation + +namespace OAI + +open MeasureTheory Set + +namespace Invariant233.ScalarSampling + +structure KernelEstimates (m : ℕ) (u : ℝ → ℝ → ℝ) : Prop where + boundedVariation : ∀ s, BoundedVariationOn (u s) (Icc (0 : ℝ) 1) + variation_sharp : ∀ s, + sSup (Set.range (fun v : ℝ => |u s v|)) + + (eVariationOn (u s) (Icc (0 : ℝ) 1)).toReal ≤ 11 * (m : ℝ)^(13 / 5 : ℝ) + variation_coarse : ∀ s, + sSup (Set.range (fun v : ℝ => |u s v|)) + + (eVariationOn (u s) (Icc (0 : ℝ) 1)).toReal ≤ 11 * (m : ℝ)^10 + average_bounds : ∀ s, 0 ≤ (∫ v in (0 : ℝ)..1, u s v) ∧ + (∫ v in (0 : ℝ)..1, u s v) ≤ 2 + mass : (∫ s in (0 : ℝ)..1, ∫ v in (0 : ℝ)..1, u s v) = 1 - 2 / (m : ℝ)^2 + average_square_lower : (1 - 2 / (m : ℝ)^2)^2 ≤ + ∫ s in (0 : ℝ)..1, (∫ v in (0 : ℝ)..1, u s v)^2 + average_square_upper : (∫ s in (0 : ℝ)..1, (∫ v in (0 : ℝ)..1, u s v)^2) ≤ + 1 + ((m : ℝ)^(-(3 / 5 : ℝ)))^2 / (1 - (m : ℝ)^(-(3 / 5 : ℝ)))^2 + square_mass : (∫ s in (0 : ℝ)..1, ∫ v in (0 : ℝ)..1, u s v^2) = + (2 / (m : ℝ)^(-(3 / 5 : ℝ))) * Real.log ((m : ℝ)^2 / 2) + +end Invariant233.ScalarSampling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ScalarMultiplier.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ScalarMultiplier.lean new file mode 100644 index 0000000000000000000000000000000000000000..428eabad7d71702af45a0c6142def3d2de65a1b7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ScalarMultiplier.lean @@ -0,0 +1,20 @@ +import Mathlib.MeasureTheory.Function.Holder +import Mathlib.MeasureTheory.Function.LpSpace.Indicator +import Mathlib.Analysis.Complex.Basic + +namespace OAI + +open MeasureTheory +open scoped ENNReal + +namespace Invariant233.L2Multiplication + +variable {X E : Type*} [MeasurableSpace X] {μ : Measure X} + [NormedAddCommGroup E] [NormedSpace ℂ E] + +noncomputable def multiplier (g : Lp ℂ ∞ μ) : Lp E 2 μ →L[ℂ] Lp E 2 μ := + (ContinuousLinearMap.lsmul ℂ ℂ : ℂ →L[ℂ] E →L[ℂ] E).holderL μ ∞ 2 2 g + +end Invariant233.L2Multiplication + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ScalarSampling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ScalarSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..b8270c4d98310cb8f75b9fea19ee62035f1a1a2a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ScalarSampling.lean @@ -0,0 +1,33 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic + +namespace OAI + +noncomputable section + +namespace Invariant233.ScalarSampling + +def delta (s : ℝ) : ℝ := min s (1 - s) + +def rawKernel (h α s t : ℝ) : ℝ := + if α ≤ delta s then + (Set.Ioo 0 (h * delta s)).indicator (fun _ => (h * delta s)⁻¹) t + else 0 + +def circleKernel (h α z v : ℝ) : ℝ := + rawKernel h α (Int.fract z) (Int.fract v) + +def manuscriptKernel (m : ℕ) (z v : ℝ) : ℝ := + circleKernel ((m : ℝ) ^ (-(3 / 5 : ℝ))) (1 / (m : ℝ)^2) z v + +def manuscriptEndpointKernel (m : ℕ) (z v : ℝ) : ℝ := + manuscriptKernel m (z - v) v + +def triangularKernel (s t : ℝ) : ℝ := + (Set.Ioo 0 (1 - s)).indicator (fun _ => 1) t + +end Invariant233.ScalarSampling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ScalarSamplingEstimates.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ScalarSamplingEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..8cdbfcfd3555ce0e04876b8b8535e5b99c3681ae --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ScalarSamplingEstimates.lean @@ -0,0 +1,84 @@ +import OAI.Analysis.IrrationalRotation.Model.ScalarKernelEstimates +import OAI.Analysis.IrrationalRotation.Model.UniformIntervalPhase +import Mathlib.Analysis.Complex.Basic + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.ScalarSampling + +def samplingHorizon (m : ℕ) : ℝ := (m : ℝ) ^ ((7 / 10 : ℝ) * m) + +def bvSize (f : ℝ → ℂ) : ℝ := + sSup ((fun x => ‖f x‖) '' Icc (0 : ℝ) 1) + + (eVariationOn f (Icc (0 : ℝ) 1)).toReal + +def SeparatedPowers (m : ℕ) (N : ℝ) (n n' : ℕ) : Prop := + ∀ v v' : ℤ, |v| ≤ (m ^ 300 : ℕ) → |v'| ≤ (m ^ 300 : ℕ) → + (v ≠ 0 ∨ v' ≠ 0) → + N * (m : ℝ) ^ 1000 < |(v : ℝ) * n + (v' : ℝ) * n'| + +structure SamplingPair (m : ℕ) (N₀ N : ℝ) (n n' : ℕ) : Prop where + N₀_pos : 0 < N₀ + N₀_le : N₀ ≤ N + N_le : N ≤ (m : ℝ)^2 + n_pos : 0 < n + n'_pos : 0 < n' + distinct : n ≠ n' + first_range : samplingHorizon m / 2 ≤ n ∧ (n : ℝ) ≤ samplingHorizon m + second_range : samplingHorizon m / 2 ≤ n' ∧ (n' : ℝ) ≤ samplingHorizon m + separated : SeparatedPowers m N n n' + +def rectangleProbability (N₀ : ℝ) (n n' : ℕ) (a b c d : ℝ) : ℝ := + (UniformIntervalPhase.lambdaLaw N₀).real + {x | Int.fract ((n : ℝ) * x) ∈ Ico a b ∧ + Int.fract ((n' : ℝ) * x) ∈ Ico c d} + +def RectangleEstimate (m : ℕ) (N₀ : ℝ) (n n' : ℕ) (C : ℝ) : Prop := + ∀ a b c d : ℝ, 0 ≤ a → a ≤ b → b ≤ 1 → + 0 ≤ c → c ≤ d → d ≤ 1 → + |rectangleProbability N₀ n n' a b c d - (b - a) * (d - c)| ≤ + C * (m : ℝ)^(-(80 : ℝ)) + +def BVEstimate (m : ℕ) (N₀ : ℝ) (n n' : ℕ) (C : ℝ) : Prop := + ∀ f g : ℝ → ℂ, + BoundedVariationOn f (Icc (0 : ℝ) 1) → + BoundedVariationOn g (Icc (0 : ℝ) 1) → + ‖(∫ x, f (Int.fract ((n : ℝ) * x)) * g (Int.fract ((n' : ℝ) * x)) + ∂UniformIntervalPhase.lambdaLaw N₀) - + (∫ x in (0 : ℝ)..1, f x) * (∫ x in (0 : ℝ)..1, g x)‖ ≤ + C * (m : ℝ)^(-(80 : ℝ)) * bvSize f * bvSize g + +def AllKernelEstimates : Prop := + ∀ m : ℕ, 200 ≤ m → + KernelEstimates m (manuscriptKernel m) ∧ + KernelEstimates m (manuscriptEndpointKernel m) + +def AllMarginalEstimates : Prop := + ∀ N₀ n : ℝ, 0 < N₀ → 0 < n → + Measurable (UniformIntervalPhase.fractionDensity N₀ n) ∧ + (∀ᵐ x ∂volume.restrict (Ico (0 : ℝ) 1), + 0 ≤ UniformIntervalPhase.fractionDensity N₀ n x ∧ + |UniformIntervalPhase.fractionDensity N₀ n x - 1| ≤ N₀ / n) ∧ + (volume.restrict (Ico (0 : ℝ) 1)).withDensity + (fun x => ENNReal.ofReal (UniformIntervalPhase.fractionDensity N₀ n x)) = + UniformIntervalPhase.fractionLaw N₀ n + +def AllSeparatedEstimates : Prop := + ∃ C : ℝ, 0 < C ∧ ∃ M : ℕ, 200 ≤ M ∧ + ∀ m : ℕ, M ≤ m → ∀ N₀ N : ℝ, ∀ n n' : ℕ, + SamplingPair m N₀ N n n' → + RectangleEstimate m N₀ n n' C ∧ BVEstimate m N₀ n n' C + +structure ScalarSamplingEstimates : Prop where + kernel : AllKernelEstimates + marginal : AllMarginalEstimates + separated : AllSeparatedEstimates + +end Invariant233.ScalarSampling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/ShiftedPullback.lean b/lean/OAI/Analysis/IrrationalRotation/Model/ShiftedPullback.lean new file mode 100644 index 0000000000000000000000000000000000000000..4849301e757512abd59fc9b848bd2b7730345ddd --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/ShiftedPullback.lean @@ -0,0 +1,22 @@ +import Mathlib.MeasureTheory.Function.LpSpace.Basic +import Mathlib.Analysis.InnerProductSpace.PiL2 + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.DirectIntegral + +variable {Ω E : Type*} [MeasurableSpace Ω] + [NormedAddCommGroup E] [NormedSpace ℂ E] {μ : Measure Ω} + +def shiftedPullback (S : E →L[ℂ] E) (σ : Ω → Ω) + (hσ : MeasurePreserving σ μ μ) : Lp E 2 μ →L[ℂ] Lp E 2 μ := + (S.compLpL 2 μ).comp (Lp.compMeasurePreservingₗᵢ ℂ σ hσ).toContinuousLinearMap + +end Invariant233.DirectIntegral + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/SourceCouplingMarginals.lean b/lean/OAI/Analysis/IrrationalRotation/Model/SourceCouplingMarginals.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e5236a62a1991a4dd1c7652f4689ec418bf2db2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/SourceCouplingMarginals.lean @@ -0,0 +1,79 @@ +import OAI.Analysis.IrrationalRotation.Model.BlockProductCoupling +import OAI.Analysis.IrrationalRotation.Model.ProductCouplingCircle +import OAI.Analysis.IrrationalRotation.Model.OneCoordinateConditional +import Mathlib.Probability.Kernel.CondDistrib +import Mathlib.Probability.Independence.InfinitePi + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal + +namespace Invariant233.OrderedProductCoupling + +def sourceBlocks (m : ℕ → ℕ) (a b : ℕ → ℝ) (hm : ∀ s, 100 ≤ m s) + (ha : ∀ s, 1 / (m s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (m s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) (tag : ℕ) : Parameters := + ofBlocks m sourceKappa a b + (by intro s; unfold sourceKappa; positivity) + (by + intro s + unfold sourceKappa + apply (div_le_iff₀ (by positivity : 0 < 100 * ((s : ℝ) + 1))).2 + nlinarith [Nat.cast_nonneg (α := ℝ) s]) + hm ha ha' hb hb' e tag + +structure SourceMarginalProperties (P : Parameters) (H : ℝ) : Prop where + [law_probability : IsProbabilityMeasure (law P)] + H_positive : 0 < H + probability : IsProbabilityMeasure (circlePairLaw P) + ordered : ∀ᵐ xy ∂circlePairLaw P, ProductModel.Ordered xy.1 xy.2 + representatives : ∀ᵐ ω ∂law P, + realEndpoint (circleLeftEndpoint ω) = leftEndpoint ω ∧ + realEndpoint (circleRightEndpoint ω) = rightEndpoint ω + coordinate_densities : ∀ (side : Bool) (i : ℕ), + (coordinateLaw P i).map (fun z => if side then z.2.2 else z.2.1) = + OneCoordinateCoupling.baseLaw.withDensity + (fun x => ENNReal.ofReal (marginalDensity P side i x)) + coordinate_bound : ∀ (side : Bool) (i : ℕ) (x : ℝ), + 0 ≤ marginalDensity P side i x ∧ marginalDensity P side i x ≤ 10 + hybrid_densities : ∀ ε : ℕ → Bool, + ∃ g : ProductModel.Base → ℝ, MemLp g 2 ProductModel.baseMeasure ∧ + (0 ≤ᵐ[ProductModel.baseMeasure] g) ∧ + (∫ x, g x ∂ProductModel.baseMeasure) = 1 ∧ + eLpNorm g 2 ProductModel.baseMeasure ≤ ENNReal.ofReal H ∧ + (law P).map (circleHybridEndpoint ε) = + ProductModel.baseMeasure.withDensity (fun x => ENNReal.ofReal (g x)) + hybrid_mass_bound : ∀ (ε : ℕ → Bool) (A : Set ProductModel.Base), MeasurableSet A → + ((law P).map (circleHybridEndpoint ε)).real A ≤ + H * Real.sqrt (ProductModel.baseMeasure.real A) + right_kernel : condDistrib rightEndpoint leftEndpoint (law P) + =ᵐ[(law P).map leftEndpoint] fun x => Measure.infinitePi + (fun i => OneCoordinateCoupling.rightGivenLeft + (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) (x i)) + left_kernel : condDistrib leftEndpoint rightEndpoint (law P) + =ᵐ[(law P).map rightEndpoint] fun y => Measure.infinitePi + (fun i => OneCoordinateCoupling.leftGivenRight + (P.κ i) (P.m i) (P.a i) (P.b i) (P.t i) (y i)) + right_independent : ∀ᵐ x ∂(law P).map leftEndpoint, + iIndepFun (fun i (y : Endpoint) => y i) (condDistrib rightEndpoint leftEndpoint (law P) x) + left_independent : ∀ᵐ y ∂(law P).map rightEndpoint, + iIndepFun (fun i (x : Endpoint) => x i) (condDistrib leftEndpoint rightEndpoint (law P) y) + right_crossing : ∀ᵐ x ∂(law P).map leftEndpoint, ∀ (i : ℕ) (w u : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u → u ≤ 1 - w → x i < u → + CouplingMarginalBounds.rho (P.κ i) (P.m i) w / 10 ≤ + (condDistrib rightEndpoint leftEndpoint (law P) x).real + {y : Endpoint | x i < u ∧ u ≤ y i} + left_crossing : ∀ᵐ y ∂(law P).map rightEndpoint, ∀ (i : ℕ) (w u : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u → u ≤ 1 - w → u ≤ y i → + CouplingMarginalBounds.rho (P.κ i) (P.m i) w / 10 ≤ + (condDistrib leftEndpoint rightEndpoint (law P) y).real + {x : Endpoint | x i < u ∧ u ≤ y i} + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/SourceProductTail.lean b/lean/OAI/Analysis/IrrationalRotation/Model/SourceProductTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb1951540b1213cab88f1771caf1b8cbe30d5d9b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/SourceProductTail.lean @@ -0,0 +1,37 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductCouplingCircle +import OAI.Analysis.IrrationalRotation.Model.ProductCocycle +import OAI.Analysis.IrrationalRotation.Model.ProductScales +import OAI.Analysis.IrrationalRotation.Model.PhaseBlocks +import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set + +namespace Invariant233.OrderedProductCoupling + +def SourceTailEstimate (p : ProductScaleData) (e : ℕ ≃ Σ s, Fin (p.m s)) + (θ : ℕ → ℝ) (j : ℕ) (P : Parameters) : Prop := + ∃ H₁ H₂ : ℤ → Set Sample, + (∀ k, MeasurableSet (H₁ k)) ∧ (∀ k, MeasurableSet (H₂ k)) ∧ + (∀ᵐ ω ∂law P, ∀ k : ℤ, (p.K j : ℝ) < |(k : ℝ)| → + ((law P)[(H₁ k).indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleLeftEndpoint inferInstance]) ω ≤ + Real.exp (-p.L j / 400) ∧ + ((law P)[(H₂ k).indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleRightEndpoint inferInstance]) ω ≤ + Real.exp (-p.L j / 400) ∧ + ((∃ i ∈ ProductPhases.consecutiveBlock p.m j, + circleRepresentative (circleLeftEndpoint ω i) < 1 / (p.m j : ℝ) ∧ + 1 - 1 / (p.m j : ℝ) ≤ circleRepresentative (circleRightEndpoint ω i)) → + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (circleRightEndpoint ω) / + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (circleLeftEndpoint ω) ≤ + Real.exp (-p.L j) + (H₁ k).indicator (fun _ => (1 : ℝ)) ω + + (H₂ k).indicator (fun _ => (1 : ℝ)) ω)) + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/Spectral.lean b/lean/OAI/Analysis/IrrationalRotation/Model/Spectral.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a46eb7924aaaf88f50f0c16e73e6e7442e46e69 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/Spectral.lean @@ -0,0 +1,47 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Invariant233 + +structure TracialState (A : Type*) [CStarAlgebra A] where + toContinuousLinearMap : A →L[ℂ] ℂ + map_one : toContinuousLinearMap 1 = 1 + map_star : ∀ a, toContinuousLinearMap (star a) = star (toContinuousLinearMap a) + positive : ∀ a, 0 ≤ (toContinuousLinearMap (star a * a)).re + tracial : ∀ a b, toContinuousLinearMap (a * b) = toContinuousLinearMap (b * a) + +namespace TracialState + +variable {A : Type*} [CStarAlgebra A] + +instance : CoeFun (TracialState A) (fun _ => A → ℂ) := + ⟨fun τ => τ.toContinuousLinearMap⟩ + +end TracialState + +def fugledeKadisonDeterminant {A : Type*} [CStarAlgebra A] + (τ : TracialState A) (a : A) : ℝ≥0∞ := + ⨅ ε : {r : ℝ // 0 < r}, + ENNReal.ofReal (Real.exp ((τ (CFC.log (star a * a + (ε.val : ℝ) • (1 : A)))).re / 2)) + +def logarithmicPotentialDeterminant (μ : Measure ℂ) (z : ℂ) : ℝ≥0∞ := + ⨅ ε : {r : ℝ // 0 < r}, + ENNReal.ofReal (Real.exp ((∫ w, Real.log (‖w - z‖ ^ 2 + ε.val) ∂μ) / 2)) + +def IsBrownMeasure {A : Type*} [CStarAlgebra A] + (τ : TracialState A) (a : A) (μ : Measure ℂ) : Prop := + IsProbabilityMeasure μ ∧ IsCompact μ.support ∧ + ∀ z : ℂ, fugledeKadisonDeterminant τ (a - algebraMap ℂ A z) = + logarithmicPotentialDeterminant μ z + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/SpectralCutoff.lean b/lean/OAI/Analysis/IrrationalRotation/Model/SpectralCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..c1167e0947934279e77de126a36516614904067d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/SpectralCutoff.lean @@ -0,0 +1,89 @@ +import OAI.Analysis.IrrationalRotation.Model.FieldDiagonal +import OAI.Analysis.IrrationalRotation.Model.FieldUnboundedMultiplier +import Mathlib.Analysis.InnerProductSpace.Projection.Basic + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal +namespace Invariant233.WeightedShift.SpectralCutoff +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +def boundedWeight (a : X → ℤ → ℂ) (C : ℝ) + (ha : ∀ x k, ‖a x k‖ ≤ C) (x : X) : Weight := + ⟨a x, memℓp_infty ⟨C, by rintro r ⟨k, rfl⟩; exact ha x k⟩⟩ + +def boundedOperator (a : X → ℤ → ℂ) (C : ℝ) (hC : 0 ≤ C) + (ha : ∀ x k, ‖a x k‖ ≤ C) + (hm : ∀ k, AEStronglyMeasurable (fun x => a x k) μ) : + FieldHilbert μ →L[ℂ] FieldHilbert μ := + fieldDiagonal (boundedWeight a C ha) C hC + (fun x => lp.norm_le_of_forall_le hC (ha x)) hm + +def window (n : ℕ) : Set ℝ := Set.Icc ((n + 1 : ℝ)⁻¹) (n + 1 : ℝ) + +def symbol (n : ℕ) (r : ℝ) : ℂ := (window n).indicator (fun _ => 1) r + +theorem norm_symbol_le (n : ℕ) (r : ℝ) : ‖symbol n r‖ ≤ 1 := by + classical + by_cases hr : r ∈ window n + · simp [symbol, hr] + · simp [symbol, hr] + +def projection (h : X → ℤ → ℝ) (hm : ∀ k, Measurable (fun x => h x k)) + (n : ℕ) : FieldHilbert μ →L[ℂ] FieldHilbert μ := + boundedOperator (fun x k => symbol n (h x k)) 1 (by norm_num) + (fun x k => norm_symbol_le n (h x k)) + (fun k => ((measurable_const.indicator measurableSet_Icc).comp (hm k)).aestronglyMeasurable) + +def productSymbol (n : ℕ) (r : ℝ) : ℂ := (r : ℂ) * symbol n r + +def inverseSymbol (n : ℕ) (r : ℝ) : ℂ := (r⁻¹ : ℝ) * symbol n r + +theorem norm_productSymbol_le (n : ℕ) (r : ℝ) : + ‖productSymbol n r‖ ≤ n + 1 := by + classical + by_cases hr : r ∈ window n + · have hr0 : 0 ≤ r := le_trans (by positivity) hr.1 + simpa [productSymbol, symbol, hr, Complex.norm_real, abs_of_nonneg hr0] using hr.2 + · simp [productSymbol, symbol, hr]; positivity + +theorem norm_inverseSymbol_le (n : ℕ) (r : ℝ) : + ‖inverseSymbol n r‖ ≤ n + 1 := by + classical + by_cases hr : r ∈ window n + · have hr0 : 0 < r := lt_of_lt_of_le (by positivity) hr.1 + have hbound : r⁻¹ ≤ n + 1 := (inv_le_comm₀ hr0 (by positivity)).mpr hr.1 + simpa [inverseSymbol, symbol, hr, Complex.norm_real, abs_of_pos hr0] using hbound + · simp [inverseSymbol, symbol, hr]; positivity + +def productOperator (h : X → ℤ → ℝ) (hm : ∀ k, Measurable (fun x => h x k)) + (n : ℕ) : FieldHilbert μ →L[ℂ] FieldHilbert μ := + boundedOperator (fun x k => productSymbol n (h x k)) (n + 1) (by positivity) + (fun x k => norm_productSymbol_le n (h x k)) + (fun k => ((Complex.measurable_ofReal.comp (hm k)).mul + ((measurable_const.indicator measurableSet_Icc).comp (hm k))).aestronglyMeasurable) + +def inverseOperator (h : X → ℤ → ℝ) (hm : ∀ k, Measurable (fun x => h x k)) + (n : ℕ) : FieldHilbert μ →L[ℂ] FieldHilbert μ := + boundedOperator (fun x k => inverseSymbol n (h x k)) (n + 1) (by positivity) + (fun x k => norm_inverseSymbol_le n (h x k)) + (fun k => ((Complex.measurable_ofReal.comp (hm k).inv).mul + ((measurable_const.indicator measurableSet_Icc).comp (hm k))).aestronglyMeasurable) + +def cutoffSpace (h : X → ℤ → ℝ) (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + Submodule ℂ (FieldHilbert μ) := (projection h hm n).range.topologicalClosure + +instance cutoffSpace_hasOrthogonalProjection (h : X → ℤ → ℝ) + (hm : ∀ k, Measurable (fun x => h x k)) (n : ℕ) : + (cutoffSpace (μ := μ) h hm n).HasOrthogonalProjection := by + let : IsClosed (cutoffSpace (μ := μ) h hm n : Set (FieldHilbert μ)) := + Submodule.isClosed_topologicalClosure _ + infer_instance + +end Invariant233.WeightedShift.SpectralCutoff + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/StrictPhase.lean b/lean/OAI/Analysis/IrrationalRotation/Model/StrictPhase.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f09f33fe0553ccc4a9eefc2c18079706423a66f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/StrictPhase.lean @@ -0,0 +1,27 @@ +import OAI.Analysis.IrrationalRotation.Model.PhaseFailure + +namespace OAI + +namespace Invariant233.ProductPhases + +noncomputable def strictPhaseGoodCount {ι : Type*} (J : Finset ι) (b : ℝ) + (k : ℤ) (θ : ι → ℝ) : ℕ := by + classical + exact (J.filter (fun i => 1 - Int.fract ((k : ℝ) * θ i) ∈ + Set.Ioo b (1 - b))).card + +noncomputable def strictLargePhaseFailure {ι : Type*} (J : Finset ι) (N : ℝ) : + Set (ι → ℝ) := + {θ | ∃ k ∈ largePhaseTimes N ((J.card : ℝ) ^ ((4 / 5 : ℝ) * J.card)), + (strictPhaseGoodCount J ((J.card : ℝ) ^ (-19 / 20 : ℝ)) k θ : ℝ) < + (J.card : ℝ) / 20} + +def strictLargePhaseCondition {ι : Type*} (J : Finset ι) (N : ℝ) (θ : ι → ℝ) : Prop := + ∀ k : ℤ, N / 4 ≤ |(k : ℝ)| → + |(k : ℝ)| ≤ (J.card : ℝ) ^ ((4 / 5 : ℝ) * J.card) → + (J.card : ℝ) / 20 ≤ + (strictPhaseGoodCount J ((J.card : ℝ) ^ (-19 / 20 : ℝ)) k θ : ℝ) + +end Invariant233.ProductPhases + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/TailSubspace.lean b/lean/OAI/Analysis/IrrationalRotation/Model/TailSubspace.lean new file mode 100644 index 0000000000000000000000000000000000000000..fae81e290ebd3533b31310e87dad87f91e9f8916 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/TailSubspace.lean @@ -0,0 +1,17 @@ +import OAI.Analysis.IrrationalRotation.Model.FieldWeightedShift + +namespace OAI + +noncomputable section +open MeasureTheory +namespace Invariant233.WeightedShift +variable {X : Type*} [MeasurableSpace X] (μ : Measure X) + +def fieldTailSubspace (m : ℤ) : Submodule ℂ (Lp Hilbert 2 μ) := + (fieldTailProjection (μ := μ) m).range + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/TrialSampling.lean b/lean/OAI/Analysis/IrrationalRotation/Model/TrialSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..698b0812e781f5c63bb3466f079b3bde8e3d44af --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/TrialSampling.lean @@ -0,0 +1,45 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleParameters +import Mathlib.Probability.ProductMeasure +import Mathlib.MeasureTheory.Measure.ProbabilityMeasure + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators ENNReal + +namespace Invariant233.TrialSampling + +def phaseLaw (m : ℕ) (N : ℝ) : Measure (Fin m → ℝ) := + Measure.infinitePi (fun _ : Fin m => + ProbabilityTheory.cond volume (Set.Icc (1 / N) (2 / N))) + +def spatialLaw (m : ℕ) : Measure (Fin m → Circle) := + Measure.pi (fun _ : Fin m => circleMeasure) + +def average (m : ℕ) (samples : Finset ℕ) (endpoint : Bool) + (phase : Fin m → ℝ) (z : Fin m → Circle) : ℝ := + (samples.card : ℝ)⁻¹ * ∑ n ∈ samples, ∏ i : Fin m, + CircleParameterData.orientedKernel endpoint m + (CircleParameterData.rep (z i)) (Int.fract ((n : ℝ) * phase i)) + +def squaredError (m : ℕ) (samples : Finset ℕ) (endpoint : Bool) + (phase : Fin m → ℝ) : ℝ≥0∞ := + ∫⁻ z, ENNReal.ofReal ((average m samples endpoint phase z - 1) ^ 2) ∂spatialLaw m + +def pairLaw (N : ℝ) : Measure (ℝ × Circle) := + (ProbabilityTheory.cond volume (Set.Icc (1 / N) (2 / N))).prod circleMeasure + +def coordinateSample (m : ℕ) (endpoint : Bool) (n : ℕ) (p : ℝ × Circle) : ℝ := + CircleParameterData.orientedKernel endpoint m (CircleParameterData.rep p.2) + (Int.fract ((n : ℝ) * p.1)) + +def coordinateIdeal (m : ℕ) (endpoint : Bool) (p : ℝ × Circle) : ℝ := + ∫ v, CircleParameterData.orientedKernel endpoint m (CircleParameterData.rep p.2) v + ∂volume.restrict (Set.Ioc (0 : ℝ) 1) + +end Invariant233.TrialSampling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/TrimmedCircleSamplingGraph.lean b/lean/OAI/Analysis/IrrationalRotation/Model/TrimmedCircleSamplingGraph.lean new file mode 100644 index 0000000000000000000000000000000000000000..31eb20b01c7a2b9c7bd9e0f99cb333db299867e6 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/TrimmedCircleSamplingGraph.lean @@ -0,0 +1,18 @@ +import OAI.Analysis.IrrationalRotation.Model.CircleSamplingGraph +import OAI.Analysis.IrrationalRotation.Model.RationalGraphTrimming + +namespace OAI + +noncomputable section +open MeasureTheory +namespace Invariant233.CircleParameterData + +def trimmedSamplingGraphAverage (p : CircleParameterData) (θ : ℝ) + (A j r : ℕ) : Measure (Circle × Circle) := + (p.samplingGraphAverage θ j r).restrict (Prod.fst ⁻¹' p.rationalGraphGood A j) + +end Invariant233.CircleParameterData + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/UnboundedMultiplier.lean b/lean/OAI/Analysis/IrrationalRotation/Model/UnboundedMultiplier.lean new file mode 100644 index 0000000000000000000000000000000000000000..004ca77e53f6b9dc031aa04e5aabb1a473c5cdad --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/UnboundedMultiplier.lean @@ -0,0 +1,43 @@ +import OAI.Analysis.IrrationalRotation.Model.WeightedShift +import Mathlib.LinearAlgebra.LinearPMap +import Mathlib.Analysis.SpecialFunctions.Exp + +namespace OAI + +noncomputable section +open scoped ENNReal +namespace Invariant233.WeightedShift + +def multiplierDomain (h : ℤ → ℂ) : Submodule ℂ Hilbert where + carrier := {ξ | Memℓp (fun k => h k * ξ k) 2} + zero_mem' := by simpa using (zero_mem_ℓp' : Memℓp (fun _ : ℤ => (0 : ℂ)) 2) + add_mem' := by + intro ξ η hξ hη + change Memℓp (fun k => h k * (ξ k + η k)) 2 + convert hξ.add hη using 1 + funext k + exact mul_add _ _ _ + smul_mem' := by + intro c ξ hξ + simpa only [Set.mem_ofPred_eq, lp.coeFn_smul, Pi.smul_apply, smul_eq_mul, mul_left_comm] using hξ.const_mul c + +def multiplier (h : ℤ → ℂ) : multiplierDomain h →ₗ[ℂ] Hilbert where + toFun ξ := ⟨fun k => h k * ξ.val k, ξ.property⟩ + map_add' ξ η := by ext k; exact mul_add _ _ _ + map_smul' c ξ := by ext k; exact mul_left_comm _ _ _ + +def unboundedMultiplier (h : ℤ → ℂ) : Hilbert →ₗ.[ℂ] Hilbert := + ⟨multiplierDomain h, multiplier h⟩ + +def exponentialWeight (g : ℤ → ℝ) (hg : ∀ k, 0 ≤ g k) : Weight := + ⟨fun k => (Real.exp (-g k) : ℂ), memℓp_infty <| by + refine ⟨1, ?_⟩ + rintro r ⟨k, rfl⟩ + simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] using + (Real.exp_le_one_iff.mpr (neg_nonpos.mpr (hg k)))⟩ + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/UniformIntervalPhase.lean b/lean/OAI/Analysis/IrrationalRotation/Model/UniformIntervalPhase.lean new file mode 100644 index 0000000000000000000000000000000000000000..f1dae8fbe5d7210577f7e03b1f60f0db918743f5 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/UniformIntervalPhase.lean @@ -0,0 +1,34 @@ +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic +import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal + +namespace Invariant233.UniformIntervalPhase + +noncomputable def intervalLaw (a L : ℝ) : Measure ℝ := + ENNReal.ofReal (1 / L) • volume.restrict (Ioc a (a + L)) + +noncomputable def phaseLaw (a L : ℝ) : Measure UnitAddCircle := + (intervalLaw a L).map (fun x : ℝ => (x : UnitAddCircle)) + +noncomputable def phaseDensity (a L : ℝ) (x : UnitAddCircle) : ℝ := + ((phaseLaw a L).rnDeriv volume x).toReal + +noncomputable def representative (x : UnitAddCircle) : ℝ := + (AddCircle.equivIco 1 0 x : ℝ) + +noncomputable def lambdaLaw (N₀ : ℝ) : Measure ℝ := + ENNReal.ofReal N₀ • volume.restrict (Icc (1 / N₀) (2 / N₀)) + +noncomputable def fractionLaw (N₀ n : ℝ) : Measure ℝ := + (lambdaLaw N₀).map (fun x => Int.fract (n * x)) + +noncomputable def fractionDensity (N₀ n x : ℝ) : ℝ := + ((fractionLaw N₀ n).rnDeriv (volume.restrict (Ico 0 1)) x).toReal + +end Invariant233.UniformIntervalPhase + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/UniformQuantization.lean b/lean/OAI/Analysis/IrrationalRotation/Model/UniformQuantization.lean new file mode 100644 index 0000000000000000000000000000000000000000..07d2355af67c5ae3eed31ca359873bed9b200596 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/UniformQuantization.lean @@ -0,0 +1,22 @@ +import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +import Mathlib.MeasureTheory.Function.Floor +import Mathlib.MeasureTheory.Integral.Bochner.Set + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.UniformQuantization + +def quantize (q : ℕ) [NeZero q] (x : ℝ) : Fin q := + ⟨⌊(q : ℝ) * x⌋₊ % q, Nat.mod_lt _ (Nat.pos_of_ne_zero (NeZero.ne q))⟩ + +def binAverage (q : ℕ) [NeZero q] (h : ℝ → ℝ) (a : Fin q) : ℝ := + (q : ℝ) * ∫ x in {x | quantize q x = a}, h x ∂volume.restrict (Ico (0 : ℝ) 1) + +end Invariant233.UniformQuantization + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/UnrestrictedDiagonal.lean b/lean/OAI/Analysis/IrrationalRotation/Model/UnrestrictedDiagonal.lean new file mode 100644 index 0000000000000000000000000000000000000000..543c4ea8b73b840a596a1bd2689448e280375d4a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/UnrestrictedDiagonal.lean @@ -0,0 +1,21 @@ +import OAI.Analysis.IrrationalRotation.Model.Diagonal + +namespace OAI + +noncomputable section + +namespace Invariant233.SequenceHilbert + +variable {I : Type*} + +def boundedDiagonal (a : I → ℂ) : SequenceHilbert I →L[ℂ] SequenceHilbert I := by + classical + exact if h : ∃ C : ℝ, 0 ≤ C ∧ ∀ i, ‖a i‖ ≤ C then + diagonal a h.choose h.choose_spec.1 h.choose_spec.2 + else 0 + +end Invariant233.SequenceHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/VectorTraceState.lean b/lean/OAI/Analysis/IrrationalRotation/Model/VectorTraceState.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd6197d16ef13210bd2a91dcee25d842369d9adc --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/VectorTraceState.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties +import OAI.Analysis.IrrationalRotation.Model.Spectral + +namespace OAI + +noncomputable section + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +instance vonNeumannSMulMemClass : + SMulMemClass (VonNeumannAlgebra H) ℂ (H →L[ℂ] H) where + smul_mem {s} c {_} ha := s.toSubalgebra.smul_mem ha c + +instance vonNeumannNormClosed (M : VonNeumannAlgebra H) : + IsClosed (M : Set (H →L[ℂ] H)) := by + change IsClosed M.carrier + rw [← M.centralizer_centralizer'] + exact Set.isClosed_centralizer _ + +def vectorTraceCLM (ξ : H) : (H →L[ℂ] H) →L[ℂ] ℂ := + (innerSL ℂ ξ).comp ((ContinuousLinearMap.apply ℂ H) ξ) + +def vonNeumannVectorTraceCLM (M : VonNeumannAlgebra H) (ξ : H) : M →L[ℂ] ℂ := + (vectorTraceCLM ξ).comp M.toSubalgebra.toSubmodule.subtypeL + +def IsFaithfulTracialVector.toTracialState {M : VonNeumannAlgebra H} {ξ : H} + (h : IsFaithfulTracialVector M ξ) : TracialState M where + toContinuousLinearMap := vonNeumannVectorTraceCLM M ξ + map_one := by + change inner ℂ ξ ξ = 1 + rw [inner_self_eq_norm_sq_to_K, h.1] + norm_num + map_star := by + intro a + change inner ℂ ξ ((star (a : H →L[ℂ] H)) ξ) = + star (inner ℂ ξ ((a : H →L[ℂ] H) ξ)) + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right] + exact (inner_conj_symm _ _).symm + positive := by + intro a + change 0 ≤ (inner ℂ ξ ((star (a : H →L[ℂ] H)) ((a : H →L[ℂ] H) ξ))).re + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right] + exact inner_self_nonneg (𝕜 := ℂ) (x := (a : H →L[ℂ] H) ξ) + tracial := by + intro a b + exact h.2.1 (a : H →L[ℂ] H) (b : H →L[ℂ] H) a.property b.property + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Model/WeightedShift.lean b/lean/OAI/Analysis/IrrationalRotation/Model/WeightedShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..2f0ccbc5a76d2b6a5c626d04105e03fab2849ddd --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Model/WeightedShift.lean @@ -0,0 +1,95 @@ +import Mathlib.Analysis.Normed.Lp.lpHolder +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Analysis.Normed.Operator.Mul +import Mathlib.Analysis.Complex.Basic +import Mathlib.Analysis.CStarAlgebra.Classes + +namespace OAI + +noncomputable section +open scoped ENNReal +namespace Invariant233.WeightedShift + +abbrev Hilbert := lp (fun _ : ℤ => ℂ) 2 +abbrev Weight := lp (fun _ : ℤ => ℂ) ∞ + +def reindex (e : Equiv.Perm ℤ) : Hilbert ≃ₗᵢ[ℂ] Hilbert where + toFun ξ := ⟨fun k => ξ (e k), memℓp_gen <| + (e.summable_iff).2 ((lp.memℓp ξ).summable (by norm_num))⟩ + invFun ξ := ⟨fun k => ξ (e.symm k), memℓp_gen <| + (e.symm.summable_iff).2 ((lp.memℓp ξ).summable (by norm_num))⟩ + left_inv ξ := by ext k; simp + right_inv ξ := by ext k; simp + map_add' ξ η := by ext k; rfl + map_smul' c ξ := by ext k; rfl + norm_map' ξ := by + rw [lp.norm_eq_tsum_rpow (by norm_num), lp.norm_eq_tsum_rpow (by norm_num)] + congr 1 + exact e.tsum_eq (fun k => ‖ξ k‖ ^ (2 : ENNReal).toReal) + +def shift (m : ℤ) : Hilbert ≃ₗᵢ[ℂ] Hilbert := reindex (Equiv.addRight (-m)) + +def diagonal (w : Weight) : Hilbert →L[ℂ] Hilbert := + lp.mapCLM 2 (fun k => w k • ContinuousLinearMap.id ℂ ℂ) (norm_nonneg w) + (fun k => by + let : T0Space ℂ := @MetricSpace.instT0Space ℂ Complex.instNormedAddCommGroup.toMetricSpace + simpa [norm_smul] using lp.norm_apply_le_norm (by simp) w k) + +def diagonalAlgHom : Weight →ₐ[ℂ] (Hilbert →L[ℂ] Hilbert) where + toFun := diagonal + map_one' := by + ext ξ k + change (1 : ℂ) * ξ k = ξ k + exact one_mul _ + map_mul' w v := by + ext ξ k + change (w k * v k) * ξ k = w k * (v k * ξ k) + exact mul_assoc _ _ _ + map_zero' := by + ext ξ k + change (0 : ℂ) * ξ k = 0 + exact zero_mul _ + map_add' w v := by + ext ξ k + change (w k + v k) * ξ k = w k * ξ k + v k * ξ k + exact add_mul _ _ _ + commutes' c := by + ext ξ k + change c * ξ k = c * ξ k + rfl + +def translate (w : Weight) (m : ℤ) : Weight := + ⟨fun k => w (k + m), memℓp_infty <| by + refine ⟨‖w‖, ?_⟩ + rintro r ⟨k, rfl⟩ + exact lp.norm_apply_le_norm (by simp) w (k + m)⟩ + +def operator (w : Weight) : Hilbert →L[ℂ] Hilbert := + (shift 1).toLinearIsometry.toContinuousLinearMap.comp (diagonal w) + +def orbitProduct (w : Weight) (n : ℕ) : Weight := + ⟨fun k => ∏ j ∈ Finset.range n, w (k + j), memℓp_infty <| by + refine ⟨‖w‖ ^ n, ?_⟩ + rintro r ⟨k, rfl⟩ + calc + ‖∏ j ∈ Finset.range n, w (k + j)‖ ≤ + ∏ j ∈ Finset.range n, ‖w (k + j)‖ := le_of_eq (norm_prod _ _) + _ ≤ ∏ _j ∈ Finset.range n, ‖w‖ := by + apply Finset.prod_le_prod₀ + · intro j hj; exact norm_nonneg _ + · intro j hj; exact lp.norm_apply_le_norm (by simp) w _ + _ = ‖w‖ ^ n := by simp⟩ + +def tailWeight (m : ℤ) : Weight := + ⟨fun k => if m ≤ k then 1 else 0, memℓp_infty <| by + refine ⟨1, ?_⟩ + rintro r ⟨k, rfl⟩ + by_cases h : m ≤ k <;> simp [h]⟩ + +def tailProjection (m : ℤ) : Hilbert →L[ℂ] Hilbert := diagonal (tailWeight m) + +end Invariant233.WeightedShift + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/AffiliatedTraceCutoffs.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/AffiliatedTraceCutoffs.lean new file mode 100644 index 0000000000000000000000000000000000000000..94c9057a6495f00bad5924f13c0989a322f6cd77 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/AffiliatedTraceCutoffs.lean @@ -0,0 +1,136 @@ +import OAI.Analysis.IrrationalRotation.Operators.ProjectionMeetTrace + +namespace OAI + +noncomputable section +open Filter +open scoped Topology NNReal +namespace Invariant233.AffiliatedTraceCutoffs +open InvariantRotation.AffiliatedTransport +open InvariantRotation.ClosedRangeTransport +open TracialProjectionTransport ProjectionMeetTrace + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem trace_lower_of_cutoff + (M : VonNeumannAlgebra H) (ξ : H) (hξ : IsFaithfulTracialVector M ξ) + (T : H →ₗ.[ℂ] H) (p E : Submodule ℂ H) + [CompleteSpace p] [CompleteSpace E] + (hp : p.starProjection ∈ M) (hE : E.starProjection ∈ M) + (hED : E ≤ T.domain) (F : H →L[ℂ] H) (hF : F ∈ M) + (hTF : ∀ x : E, T ⟨x, hED x.property⟩ = F x) + (L : ℝ≥0) (hlower : ∀ x : E, ‖x‖ ≤ L * ‖F x‖) : + (vectorTrace ξ p.starProjection).re + (vectorTrace ξ E.starProjection).re - 1 ≤ + (vectorTrace ξ (transported T p).starProjection).re := by + let r := p ⊓ E + have hrD : r ≤ T.domain := inf_le_right.trans hED + have hupper : ∀ x : r, ‖T ⟨x, hrD x.property⟩‖ ≤ ‖F‖ * ‖x‖ := by + intro x + rw [hTF ⟨x, x.property.2⟩] + exact F.le_opNorm x + have hlower' : ∀ x : r, ‖x‖ ≤ L * ‖T ⟨x, hrD x.property⟩‖ := by + intro x + rw [hTF ⟨x, x.property.2⟩] + exact hlower ⟨x, x.property.2⟩ + have hrmem : r.starProjection ∈ M := meet_projection_mem M p E hp hE + have hforward : forward r (cutoffMap T r hrD ‖F‖ hupper) = F * r.starProjection := by + ext x + exact hTF ⟨r.starProjection x, (r.starProjection_apply_mem x).2⟩ + have hforwardmem : forward r (cutoffMap T r hrD ‖F‖ hupper) ∈ M := by + rw [hforward] + exact mul_mem hF hrmem + exact (faithful_vectorTrace_meet_lower_bound M ξ hξ p E hp hE).trans + (cutoff_trace_le_transported M ξ hξ T p r inf_le_left hrD ‖F‖ hupper L + hlower' hrmem hforwardmem) + +theorem vectorTrace_transported_eq_of_cutoffs + (M : VonNeumannAlgebra H) (ξ : H) (hξ : IsFaithfulTracialVector M ξ) + (T : H →ₗ.[ℂ] H) (hT : T.IsFormalAdjoint T) (hinj : T.toFun.ker = ⊥) + (p : Submodule ℂ H) [CompleteSpace p] (hp : p.starProjection ∈ M) + (E : ℕ → Submodule ℂ H) [∀ n, CompleteSpace (E n)] + (hE : ∀ n, (E n).starProjection ∈ M) + (hlim : Tendsto (fun n => (E n).starProjection ξ) atTop (𝓝 ξ)) + (hED : ∀ n, E n ≤ T.domain) (hEinvD : ∀ n, E n ≤ T.inverse.domain) + (F G : ℕ → H →L[ℂ] H) (hF : ∀ n, F n ∈ M) (hG : ∀ n, G n ∈ M) + (hTF : ∀ n, ∀ x : E n, T ⟨x, hED n x.property⟩ = F n x) + (hTG : ∀ n, ∀ x : E n, T.inverse ⟨x, hEinvD n x.property⟩ = G n x) + (L R : ℕ → ℝ≥0) + (hlower : ∀ n, ∀ x : E n, ‖x‖ ≤ L n * ‖F n x‖) + (hinvlower : ∀ n, ∀ x : E n, ‖x‖ ≤ R n * ‖G n x‖) : + vectorTrace ξ (transported T p).starProjection = vectorTrace ξ p.starProjection := by + have hpperp : pᗮ.starProjection ∈ M := by + simpa only [Submodule.starProjection_orthogonal, ← ContinuousLinearMap.one_def] using + (sub_mem (one_mem M) hp : (1 : H →L[ℂ] H) - p.starProjection ∈ M) + have hortho := inverse_transported_le_orthogonal T p hT hinj + apply Eq.symm + apply vectorTrace_eq_of_cutoff_estimates ξ p (transported T p) E hlim + · intro n + simpa only [hξ.1, one_pow] using + trace_lower_of_cutoff M ξ hξ T p (E n) hp (hE n) (hED n) + (F n) (hF n) (hTF n) (L n) (hlower n) + · intro n + have hcut := trace_lower_of_cutoff M ξ hξ T.inverse pᗮ (E n) + hpperp (hE n) (hEinvD n) (G n) (hG n) (hTG n) (R n) (hinvlower n) + have hmono := vectorTrace_projection_mono ξ hortho + simpa only [hξ.1, one_pow] using hcut.trans hmono + +theorem commutant_equivariance_of_graph_cutoffs + (M : VonNeumannAlgebra H) (T : H →ₗ.[ℂ] H) (hclosed : T.IsClosed) + (E : ℕ → Submodule ℂ H) [∀ n, CompleteSpace (E n)] + (hED : ∀ n, E n ≤ T.domain) + (hlim : ∀ x : H, Tendsto (fun n => (E n).starProjection x) atTop (𝓝 x)) + (F : ℕ → H →L[ℂ] H) (hF : ∀ n, F n ∈ M) + (hTF : ∀ n x, T ⟨(E n).starProjection x, + hED n ((E n).starProjection_apply_mem x)⟩ = F n x) + (hgraphlim : ∀ x : T.domain, + Tendsto (fun n => F n x) atTop (𝓝 (T x))) + (W : H →L[ℂ] H) (hW : W ∈ M.commutant) (x : T.domain) : + ∃ hx : W x ∈ T.domain, T ⟨W x, hx⟩ = W (T x) := by + have hWF : ∀ n, W * F n = F n * W := by + intro n + exact (VonNeumannAlgebra.mem_commutant_iff.mp hW) (F n) (hF n) |>.symm + have hsecond : Tendsto (fun n => F n (W x)) atTop (𝓝 (W (T x))) := by + have ht := W.continuous.continuousAt.tendsto.comp (hgraphlim x) + convert ht using 1 + funext n + exact congrArg (fun A : H →L[ℂ] H => A x) (hWF n).symm + have hpair : ∀ n, ((E n).starProjection (W x), F n (W x)) ∈ T.graph := by + intro n + apply T.mem_graph_iff.mpr + exact ⟨⟨(E n).starProjection (W x), hED n ((E n).starProjection_apply_mem _)⟩, + rfl, hTF n (W x)⟩ + have hlimit := (hlim (W x)).prodMk_nhds hsecond + have hmem : (W x, W (T x)) ∈ T.graph := + hclosed.mem_of_tendsto hlimit (Filter.Eventually.of_forall hpair) + obtain ⟨y, hy, hTy⟩ := T.mem_graph_iff.mp hmem + change (y : H) = W x at hy + have hx : W x ∈ T.domain := by rw [← hy]; exact y.property + refine ⟨hx, ?_⟩ + have hy' : y = ⟨W x, hx⟩ := Subtype.ext hy + rw [← hy'] + exact hTy + +theorem transported_projection_mem_of_graph_cutoffs + (M : VonNeumannAlgebra H) (T : H →ₗ.[ℂ] H) (hclosed : T.IsClosed) + (p : Submodule ℂ H) [p.HasOrthogonalProjection] (hp : p.starProjection ∈ M) + (E : ℕ → Submodule ℂ H) [∀ n, CompleteSpace (E n)] + (hED : ∀ n, E n ≤ T.domain) + (hlim : ∀ x : H, Tendsto (fun n => (E n).starProjection x) atTop (𝓝 x)) + (F : ℕ → H →L[ℂ] H) (hF : ∀ n, F n ∈ M) + (hTF : ∀ n x, T ⟨(E n).starProjection x, + hED n ((E n).starProjection_apply_mem x)⟩ = F n x) + (hgraphlim : ∀ x : T.domain, + Tendsto (fun n => F n x) atTop (𝓝 (T x))) : + (transported T p).starProjection ∈ M := by + have heq := commutant_equivariance_of_graph_cutoffs M T hclosed E hED hlim F hF hTF hgraphlim + let hD : ∀ W ∈ M.commutant, ∀ x ∈ T.domain, W x ∈ T.domain := + fun W hW x hx => (heq W hW ⟨x, hx⟩).choose + apply transported_projection_mem M T p hp hD + intro W hW x + exact (heq W hW x).choose_spec + +end Invariant233.AffiliatedTraceCutoffs + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/AffiliatedTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/AffiliatedTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..90c3db8c5fd753c0d98a17a9a0c87e110fc9b2de --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/AffiliatedTransport.lean @@ -0,0 +1,124 @@ +import OAI.Analysis.IrrationalRotation.Model.AffiliatedTransport +import Mathlib.Analysis.VonNeumannAlgebra.Basic + +namespace OAI + +noncomputable section + +namespace InvariantRotation.AffiliatedTransport + +variable {𝕜 E : Type*} [RCLike 𝕜] +variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] + +@[simp] +theorem mem_domainImage {H : E →ₗ.[𝕜] E} {p : Submodule 𝕜 E} {y : E} : + y ∈ domainImage H p ↔ ∃ x : H.domain, (x : E) ∈ p ∧ H x = y := by + simp [domainImage, Submodule.mem_map] + +theorem domainImage_invariant + (H : E →ₗ.[𝕜] E) (p : Submodule 𝕜 E) (A B : E →L[𝕜] E) + (hAp : ∀ x ∈ p, A x ∈ p) + (hAD : ∀ x ∈ H.domain, A x ∈ H.domain) + (hAB : ∀ x : H.domain, H ⟨A x, hAD x x.property⟩ = B (H x)) : + ∀ y ∈ domainImage H p, B y ∈ domainImage H p := by + intro y hy + obtain ⟨x, hxp, rfl⟩ := mem_domainImage.mp hy + exact mem_domainImage.mpr + ⟨⟨A x, hAD x x.property⟩, hAp x hxp, hAB x⟩ + +theorem transported_invariant + (H : E →ₗ.[𝕜] E) (p : Submodule 𝕜 E) (A B : E →L[𝕜] E) + (hAp : ∀ x ∈ p, A x ∈ p) + (hAD : ∀ x ∈ H.domain, A x ∈ H.domain) + (hAB : ∀ x : H.domain, H ⟨A x, hAD x x.property⟩ = B (H x)) : + ∀ y ∈ transported H p, B y ∈ transported H p := by + have hi : domainImage H p ∈ Module.End.invtSubmodule B.toLinearMap := + (Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mpr + (domainImage_invariant H p A B hAp hAD hAB) + exact (Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mp + (Submodule.topologicalClosure_mem_invtSubmodule hi) + +theorem transported_invariant_of_commutes + (H : E →ₗ.[𝕜] E) (p : Submodule 𝕜 E) (W : E →L[𝕜] E) + (hWp : ∀ x ∈ p, W x ∈ p) + (hWD : ∀ x ∈ H.domain, W x ∈ H.domain) + (hWH : ∀ x : H.domain, H ⟨W x, hWD x x.property⟩ = W (H x)) : + ∀ y ∈ transported H p, W y ∈ transported H p := + transported_invariant H p W W hWp hWD hWH + +theorem mem_transported_orthogonal + (H : E →ₗ.[𝕜] E) (p : Submodule 𝕜 E) + (hH : H.IsFormalAdjoint H) (x : H.domain) (hx : H x ∈ pᗮ) : + (x : E) ∈ (transported H p)ᗮ := by + rw [transported, Submodule.orthogonal_closure, Submodule.mem_orthogonal] + intro y hy + obtain ⟨z, hzp, rfl⟩ := mem_domainImage.mp hy + rw [hH z x] + exact p.inner_right_of_mem_orthogonal hzp hx + +theorem inverse_domainImage_le_orthogonal + (H : E →ₗ.[𝕜] E) (p : Submodule 𝕜 E) + (hH : H.IsFormalAdjoint H) (hker : H.toFun.ker = ⊥) : + domainImage H.inverse pᗮ ≤ (transported H p)ᗮ := by + intro y hy + obtain ⟨z, hzp, rfl⟩ := mem_domainImage.mp hy + have hz : (z : E) ∈ LinearMap.range H.toFun := by + simpa only [LinearPMap.inverse_domain] using z.property + obtain ⟨x, hx⟩ := LinearMap.mem_range.mp hz + have hpartialker : H.ker = ⊥ := by simp [LinearPMap.ker, hker] + rw [LinearPMap.inverse_apply_eq hpartialker hx] + apply mem_transported_orthogonal H p hH x + change H.toFun x ∈ pᗮ + rw [hx] + exact hzp + +theorem inverse_transported_le_orthogonal + (H : E →ₗ.[𝕜] E) (p : Submodule 𝕜 E) + (hH : H.IsFormalAdjoint H) (hker : H.toFun.ker = ⊥) : + transported H.inverse pᗮ ≤ (transported H p)ᗮ := + Submodule.topologicalClosure_minimal _ + (inverse_domainImage_le_orthogonal H p hH hker) + (Submodule.isClosed_orthogonal _) + +section Complete + +variable [CompleteSpace E] + +theorem inverse_transported_le_orthogonal_of_selfAdjoint + (H : E →ₗ.[𝕜] E) (p : Submodule 𝕜 E) + (hH : IsSelfAdjoint H) (hker : H.toFun.ker = ⊥) : + transported H.inverse pᗮ ≤ (transported H p)ᗮ := by + have hs := LinearPMap.adjoint_isFormalAdjoint hH.dense_domain + rw [LinearPMap.isSelfAdjoint_def.mp hH] at hs + exact inverse_transported_le_orthogonal H p hs hker + +end Complete + + +variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℂ F] [CompleteSpace F] + +theorem transported_projection_mem + (M : VonNeumannAlgebra F) (H : F →ₗ.[ℂ] F) (p : Submodule ℂ F) + [p.HasOrthogonalProjection] (hp : p.starProjection ∈ M) + (hD : ∀ W ∈ M.commutant, ∀ x ∈ H.domain, W x ∈ H.domain) + (hcomm : ∀ W, ∀ hW : W ∈ M.commutant, ∀ x : H.domain, + H ⟨W x, hD W hW x x.property⟩ = W (H x)) : + (transported H p).starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mpr + intro W hW + rw [Submodule.range_starProjection] + apply (Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mpr + have hinv := (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mp hp W hW + rw [Submodule.range_starProjection] at hinv + exact transported_invariant_of_commutes H p W + ((Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mp hinv) + (hD W hW) (hcomm W hW) + + +end InvariantRotation.AffiliatedTransport + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/AffiliatedTransportSupplement.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/AffiliatedTransportSupplement.lean new file mode 100644 index 0000000000000000000000000000000000000000..4d9cd61c14837128f7d8c954f9051097ae3f1627 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/AffiliatedTransportSupplement.lean @@ -0,0 +1,172 @@ +import Mathlib.Analysis.InnerProductSpace.LinearPMap +import Mathlib.Analysis.InnerProductSpace.Projection.Basic +import Mathlib.Topology.Algebra.Module.ContinuousLinearMap.Basic +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +namespace Invariant233.AffiliatedTransport + +open Filter Topology + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + +def imageOn (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) : Submodule ℂ E := + (p.comap H.domain.subtype).map H.toFun + +def closedImageOn (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) : Submodule ℂ E := + (imageOn H p).topologicalClosure + +instance [CompleteSpace E] (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) : + CompleteSpace (closedImageOn H p) := by + unfold closedImageOn + infer_instance + +@[simp] theorem mem_imageOn {H : E →ₗ.[ℂ] E} {p : Submodule ℂ E} {y : E} : + y ∈ imageOn H p ↔ ∃ x : H.domain, (x : E) ∈ p ∧ H x = y := by + rfl + +theorem imageOn_le_closedImageOn (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) : + imageOn H p ≤ closedImageOn H p := + Submodule.le_topologicalClosure _ + +theorem image_mem_closedImageOn (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) + (x : H.domain) (hx : (x : E) ∈ p) : H x ∈ closedImageOn H p := + imageOn_le_closedImageOn H p ((mem_imageOn).2 ⟨x, hx, rfl⟩) + +theorem imageOn_invariant (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) + (A B : E →L[ℂ] E) + (hD : ∀ x : H.domain, A (x : E) ∈ H.domain) + (hI : ∀ x : H.domain, H ⟨A (x : E), hD x⟩ = B (H x)) + (hp : ∀ x ∈ p, A x ∈ p) : + ∀ y ∈ imageOn H p, B y ∈ imageOn H p := by + rintro y ⟨x, hx, rfl⟩ + exact (mem_imageOn).2 ⟨⟨A (x : E), hD x⟩, hp x hx, hI x⟩ + +theorem closedImageOn_invariant (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) + (A B : E →L[ℂ] E) + (hD : ∀ x : H.domain, A (x : E) ∈ H.domain) + (hI : ∀ x : H.domain, H ⟨A (x : E), hD x⟩ = B (H x)) + (hp : ∀ x ∈ p, A x ∈ p) : + ∀ y ∈ closedImageOn H p, B y ∈ closedImageOn H p := by + have hmap : (imageOn H p).map B.toLinearMap ≤ imageOn H p := by + rintro y ⟨x, hx, rfl⟩ + exact imageOn_invariant H p A B hD hI hp x hx + intro y hy + change B y ∈ (imageOn H p).topologicalClosure + apply Submodule.topologicalClosure_mono hmap + apply Submodule.topologicalClosure_map B (imageOn H p) + exact ⟨y, hy, rfl⟩ + +theorem closedImageOn_invariant_of_commuting (H : E →ₗ.[ℂ] E) + (p : Submodule ℂ E) (W : E →L[ℂ] E) + (hD : ∀ x : H.domain, W (x : E) ∈ H.domain) + (hC : ∀ x : H.domain, H ⟨W (x : E), hD x⟩ = W (H x)) + (hp : ∀ x ∈ p, W x ∈ p) : + ∀ y ∈ closedImageOn H p, W y ∈ closedImageOn H p := + closedImageOn_invariant H p W W hD hC hp + +theorem mem_orthogonal_closedImageOn (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) + (hH : H.IsFormalAdjoint H) (z : H.domain) + (hz : H z ∈ pᗮ) : (z : E) ∈ (closedImageOn H p)ᗮ := by + rw [closedImageOn, Submodule.orthogonal_closure] + rw [Submodule.mem_orthogonal] + rintro y ⟨x, hx, rfl⟩ + change inner ℂ (H x) (z : E) = 0 + exact (hH x z).trans (Submodule.inner_right_of_mem_orthogonal hx hz) + +theorem inverse_imageOn_le_orthogonal (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) + (hH : H.IsFormalAdjoint H) (hinj : H.toFun.ker = ⊥) : + imageOn H.inverse pᗮ ≤ (closedImageOn H p)ᗮ := by + rintro y ⟨η, hη, rfl⟩ + have hηrange : (η : E) ∈ LinearMap.range H.toFun := by + rw [← LinearPMap.inverse_domain] + exact η.property + obtain ⟨z, hz⟩ := hηrange + have hker : H.ker = ⊥ := by simp [LinearPMap.ker, hinj] + have heq : H.inverse η = (z : E) := LinearPMap.inverse_apply_eq hker hz + change H.inverse η ∈ (closedImageOn H p)ᗮ + rw [heq] + apply mem_orthogonal_closedImageOn H p hH z + change H.toFun z ∈ pᗮ + rw [hz] + exact hη + +theorem inverse_closedImageOn_le_orthogonal (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) + (hH : H.IsFormalAdjoint H) (hinj : H.toFun.ker = ⊥) : + closedImageOn H.inverse pᗮ ≤ (closedImageOn H p)ᗮ := by + exact (imageOn H.inverse pᗮ).topologicalClosure_minimal + (inverse_imageOn_le_orthogonal H p hH hinj) + (closedImageOn H p).isClosed_orthogonal + +theorem orthogonal_invariant_of_inverse (p : Submodule ℂ E) + (W : E ≃ₗᵢ[ℂ] E) (hp : ∀ x ∈ p, W.symm x ∈ p) : + ∀ y ∈ pᗮ, W y ∈ pᗮ := by + intro y hy + rw [Submodule.mem_orthogonal] + intro x hx + have h := W.inner_map_map (W.symm x) y + rw [W.apply_symm_apply] at h + exact h.trans (Submodule.inner_right_of_mem_orthogonal (hp x hx) hy) + +theorem starProjection_commutes_of_reducing (p : Submodule ℂ E) + [p.HasOrthogonalProjection] (W : E ≃ₗᵢ[ℂ] E) + (hp : ∀ x ∈ p, W x ∈ p) (hp' : ∀ x ∈ p, W.symm x ∈ p) : + ∀ x, p.starProjection (W x) = W (p.starProjection x) := by + intro x + apply p.eq_starProjection_of_mem_orthogonal + · exact hp _ (p.starProjection_apply_mem x) + · have h := orthogonal_invariant_of_inverse p W hp' _ + (p.sub_starProjection_mem_orthogonal x) + simpa only [map_sub] using h + +theorem closedImageOn_map_eq (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) + (W : E ≃L[ℂ] E) + (hD : ∀ x : H.domain, W (x : E) ∈ H.domain) + (hD' : ∀ x : H.domain, W.symm (x : E) ∈ H.domain) + (hC : ∀ x : H.domain, H ⟨W (x : E), hD x⟩ = W (H x)) + (hC' : ∀ x : H.domain, H ⟨W.symm (x : E), hD' x⟩ = W.symm (H x)) + (hp : ∀ x ∈ p, W x ∈ p) (hp' : ∀ x ∈ p, W.symm x ∈ p) : + (closedImageOn H p).map W.toLinearMap = closedImageOn H p := by + apply le_antisymm + · rintro y ⟨x, hx, rfl⟩ + exact closedImageOn_invariant_of_commuting H p W.toContinuousLinearMap hD hC hp x hx + · intro y hy + refine ⟨W.symm y, ?_, W.apply_symm_apply y⟩ + exact closedImageOn_invariant_of_commuting H p W.symm.toContinuousLinearMap + hD' hC' hp' y hy + +theorem closedImageOn_starProjection_commutes [CompleteSpace E] + (H : E →ₗ.[ℂ] E) (p : Submodule ℂ E) (W : E ≃ₗᵢ[ℂ] E) + (hD : ∀ x : H.domain, W (x : E) ∈ H.domain) + (hD' : ∀ x : H.domain, W.symm (x : E) ∈ H.domain) + (hC : ∀ x : H.domain, H ⟨W (x : E), hD x⟩ = W (H x)) + (hC' : ∀ x : H.domain, H ⟨W.symm (x : E), hD' x⟩ = W.symm (H x)) + (hp : ∀ x ∈ p, W x ∈ p) (hp' : ∀ x ∈ p, W.symm x ∈ p) : + ∀ x, (closedImageOn H p).starProjection (W x) = + W ((closedImageOn H p).starProjection x) := by + apply starProjection_commutes_of_reducing + · exact closedImageOn_invariant_of_commuting H p W.toLinearIsometry.toContinuousLinearMap hD hC hp + · exact closedImageOn_invariant_of_commuting H p W.symm.toLinearIsometry.toContinuousLinearMap hD' hC' hp' + +theorem trace_eq_of_cutoff_estimates {t p : ℝ} {e : ℕ → ℝ} + (he : Tendsto e atTop (𝓝 1)) + (hlower : ∀ n, p + e n - 1 ≤ t) + (hupper : ∀ n, (1 - p) + e n - 1 ≤ 1 - t) : t = p := by + have h₁ : p ≤ t := by + have hlim : Tendsto (fun n => p + e n - 1) atTop (𝓝 p) := by + convert (tendsto_const_nhds.add he).sub tendsto_const_nhds using 1; simp + exact le_of_tendsto hlim (Filter.Eventually.of_forall hlower) + have h₂ : 1 - p ≤ 1 - t := by + have hlim : Tendsto (fun n => (1 - p) + e n - 1) atTop (𝓝 (1 - p)) := by + convert (tendsto_const_nhds.add he).sub tendsto_const_nhds using 1; simp + exact le_of_tendsto hlim (Filter.Eventually.of_forall hupper) + linarith + +end Invariant233.AffiliatedTransport + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/AtomicNonscalarProjection.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/AtomicNonscalarProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..7a96731c9233a4357de62a7012bd9ab6ba09fb9b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/AtomicNonscalarProjection.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.IrrationalRotation.Model.ConcreteSpectral +import OAI.Analysis.IrrationalRotation.Operators.JointEigenprojection + +namespace OAI + +noncomputable section +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem exists_nontrivial_projection_of_atomic_nonscalar + (M : VonNeumannAlgebra H) (B : H →L[ℂ] H) + (hB : B ∈ M) (hatomic : HasCountablyAtomicSpectralType B) + (hnonscalar : ¬ ∃ c : ℂ, B = c • (1 : H →L[ℂ] H)) : + ∃ q : H →L[ℂ] H, q ∈ M ∧ IsStarProjection q ∧ q ≠ 0 ∧ q ≠ 1 := by + obtain ⟨S, _, hdense⟩ := hatomic + let D : Unit → H →L[ℂ] H := fun _ => B + let ev : S → Unit → ℂ := fun z _ => z.val + have hdense' : (⨆ z : S, jointEigenspace D (ev z)).topologicalClosure = ⊤ := by + simpa only [jointEigenspace, D, ev, iInf_const] using hdense + have hB0 : B ≠ 0 := by + intro hz + exact hnonscalar ⟨0, by simpa using hz⟩ + obtain ⟨z, hz⟩ := exists_mul_jointEigenprojection_ne_zero D ev hdense' B hB0 + let q := jointEigenprojection D (ev z) + have hqmem : q ∈ M := by + apply vonNeumannGenerated_le (Set.range D) M _ (jointEigenprojection_mem_generated D (ev z)) + rintro A ⟨i, rfl⟩ + exact hB + refine ⟨q, hqmem, isStarProjection_jointEigenprojection D (ev z), ?_, ?_⟩ + · intro hq0 + apply hz + change B * q = 0 + rw [hq0, mul_zero] + · intro hq1 + apply hnonscalar + refine ⟨z.val, ?_⟩ + ext x + have hx : x ∈ jointEigenspace D (ev z) := by + apply Submodule.starProjection_eq_self_iff.mp + change q x = x + rw [hq1] + rfl + exact (mem_jointEigenspace.mp hx) () + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantAmplification.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantAmplification.lean new file mode 100644 index 0000000000000000000000000000000000000000..84075fd109f0d6ff046390fbade86eb6072c16a8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantAmplification.lean @@ -0,0 +1,124 @@ +import Mathlib.Analysis.InnerProductSpace.PiL2 +import Mathlib.Analysis.VonNeumannAlgebra.Basic + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Invariant233.BicommutantDensity + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] +variable (ι : Type*) [Fintype ι] + +abbrev Amplification := PiLp 2 (fun _ : ι => H) + +def amplify (T : H →L[ℂ] H) : Amplification (H := H) ι →L[ℂ] Amplification (H := H) ι := + (PiLp.continuousLinearEquiv 2 ℂ (fun _ : ι => H)).symm.toContinuousLinearMap.comp + (ContinuousLinearMap.pi fun i => T.comp (PiLp.proj 2 (fun _ : ι => H) i)) + +omit [CompleteSpace H] [Fintype ι] in +@[simp] theorem amplify_apply (T : H →L[ℂ] H) (x : Amplification (H := H) ι) (i : ι) : + amplify ι T x i = T (x i) := rfl + +def amplifyHom : (H →L[ℂ] H) →⋆ₐ[ℂ] + (Amplification (H := H) ι →L[ℂ] Amplification (H := H) ι) where + toFun := amplify ι + map_zero' := by ext x i; simp + map_one' := by ext x i; simp + map_add' T S := by ext x i; simp + map_mul' T S := by ext x i; simp + commutes' c := by ext x i; simp [Algebra.algebraMap_eq_smul_one] + map_star' T := by + rw [ContinuousLinearMap.star_eq_adjoint] + apply (ContinuousLinearMap.eq_adjoint_iff _ _).2 + intro x y + simp only [PiLp.inner_apply, amplify_apply, ContinuousLinearMap.adjoint_inner_left] + +@[simp] theorem amplifyHom_apply (T : H →L[ℂ] H) : amplifyHom (H := H) ι T = amplify ι T := rfl + +variable [DecidableEq ι] + +def insert (i : ι) : H →L[ℂ] Amplification (H := H) ι := + (PiLp.continuousLinearEquiv 2 ℂ (fun _ : ι => H)).symm.toContinuousLinearMap.comp + (ContinuousLinearMap.single ℂ (fun _ : ι => H) i) + +omit [CompleteSpace H] [Fintype ι] in +@[simp] theorem insert_apply (i : ι) (x : H) (j : ι) : + insert ι i x j = if j = i then x else 0 := by + simp [insert, ContinuousLinearMap.single_apply] + +def entry (B : Amplification (H := H) ι →L[ℂ] Amplification (H := H) ι) + (i j : ι) : H →L[ℂ] H := + (PiLp.proj 2 (fun _ : ι => H) i).comp (B.comp (insert ι j)) + +omit [CompleteSpace H] [Fintype ι] in +@[simp] theorem entry_apply (B : Amplification (H := H) ι →L[ℂ] Amplification (H := H) ι) + (i j : ι) (x : H) : entry ι B i j x = B (insert ι j x) i := rfl + +omit [CompleteSpace H] [Fintype ι] in +@[simp] theorem amplify_insert (T : H →L[ℂ] H) (j : ι) (x : H) : + amplify ι T (insert ι j x) = insert ι j (T x) := by + ext i + by_cases h : i = j <;> simp [h] + +omit [CompleteSpace H] in + +theorem sum_insert (x : Amplification (H := H) ι) : + ∑ j, insert ι j (x j) = x := by + ext i + simp + +omit [CompleteSpace H] in +theorem apply_eq_sum_entry + (B : Amplification (H := H) ι →L[ℂ] Amplification (H := H) ι) + (x : Amplification (H := H) ι) (i : ι) : + B x i = ∑ j, entry ι B i j (x j) := by + conv_lhs => rw [← sum_insert ι x] + simp + +omit [CompleteSpace H] [Fintype ι] in +theorem entry_commutes {T : H →L[ℂ] H} + {B : Amplification (H := H) ι →L[ℂ] Amplification (H := H) ι} + (h : amplify ι T * B = B * amplify ι T) (i j : ι) : + T * entry ι B i j = entry ι B i j * T := by + ext x + have hx := congrArg (fun C => C (insert ι j x) i) h + simpa only [mul_apply_eq_comp, amplify_apply, amplify_insert, entry_apply] using hx + +omit [CompleteSpace H] in +theorem amplify_commutes_of_entries {T : H →L[ℂ] H} + {B : Amplification (H := H) ι →L[ℂ] Amplification (H := H) ι} + (h : ∀ i j, T * entry ι B i j = entry ι B i j * T) : + amplify ι T * B = B * amplify ι T := by + ext x i + change T (B x i) = B (amplify ι T x) i + rw [apply_eq_sum_entry ι B x i, apply_eq_sum_entry ι B (amplify ι T x) i, + map_sum] + apply Finset.sum_congr rfl + intro j _ + exact congrArg (fun C : H →L[ℂ] H => C (x j)) (h i j) + +theorem amplify_mem_bicommutant (A : StarSubalgebra ℂ (H →L[ℂ] H)) + {T : H →L[ℂ] H} + (hT : T ∈ Set.centralizer (Set.centralizer (A : Set (H →L[ℂ] H)))) : + amplify ι T ∈ Set.centralizer (Set.centralizer + (StarSubalgebra.map (amplifyHom ι) A : Set + (Amplification (H := H) ι →L[ℂ] Amplification (H := H) ι))) := by + intro B hB + symm + apply amplify_commutes_of_entries + intro i j + have hij : entry ι B i j ∈ Set.centralizer (A : Set (H →L[ℂ] H)) := by + intro a ha + apply entry_commutes + apply hB + exact StarSubalgebra.mem_map.mpr ⟨a, ha, rfl⟩ + exact (hT _ hij).symm + +end Invariant233.BicommutantDensity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantCyclic.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantCyclic.lean new file mode 100644 index 0000000000000000000000000000000000000000..d915faaeaa68c121b24076fcdaef1335be8d0d28 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantCyclic.lean @@ -0,0 +1,79 @@ +import OAI.Analysis.IrrationalRotation.Analysis.VonNeumannStrongClosure +import Mathlib.Analysis.InnerProductSpace.Projection.Basic + +namespace OAI + +noncomputable section +open Set +namespace Invariant233.Bicommutant + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +def orbitSubmodule (A : StarSubalgebra ℂ (H →L[ℂ] H)) (x : H) : Submodule ℂ H where + carrier := {y | ∃ a : H →L[ℂ] H, a ∈ A ∧ a x = y} + zero_mem' := ⟨0, A.zero_mem, by simp⟩ + add_mem' := by + rintro y z ⟨a, ha, rfl⟩ ⟨b, hb, rfl⟩ + exact ⟨a + b, A.add_mem ha hb, by simp⟩ + smul_mem' := by + rintro c y ⟨a, ha, rfl⟩ + exact ⟨c • a, A.smul_mem ha c, by simp⟩ + +@[simp] theorem mem_orbitSubmodule (A : StarSubalgebra ℂ (H →L[ℂ] H)) (x y : H) : + y ∈ orbitSubmodule A x ↔ ∃ a : H →L[ℂ] H, a ∈ A ∧ a x = y := Iff.rfl + +theorem orbit_invariant (A : StarSubalgebra ℂ (H →L[ℂ] H)) (x : H) + {a : H →L[ℂ] H} (ha : a ∈ A) : + orbitSubmodule A x ∈ Module.End.invtSubmodule a := by + rintro y ⟨b, hb, rfl⟩ + exact ⟨a * b, A.mul_mem ha hb, rfl⟩ + +theorem closedOrbit_invariant (A : StarSubalgebra ℂ (H →L[ℂ] H)) (x : H) + {a : H →L[ℂ] H} (ha : a ∈ A) : + (orbitSubmodule A x).topologicalClosure ∈ Module.End.invtSubmodule a := + Submodule.topologicalClosure_mem_invtSubmodule (orbit_invariant A x ha) + +theorem projection_mem_centralizer (A : StarSubalgebra ℂ (H →L[ℂ] H)) + (S : Submodule ℂ H) [S.HasOrthogonalProjection] + (hS : ∀ a : H →L[ℂ] H, a ∈ A → S ∈ Module.End.invtSubmodule a) : + S.starProjection ∈ Set.centralizer (A : Set (H →L[ℂ] H)) := by + intro a ha + have hc : Commute S.starProjection a := by + apply (ContinuousLinearMap.IsIdempotentElem.commute_iff + (isStarProjection_starProjection (U := S)).isIdempotentElem).2 + constructor + · simpa only [Submodule.range_starProjection] using hS a ha + · rw [Submodule.ker_starProjection] + exact ContinuousLinearMap.orthogonal_mem_invtSubmodule (hS (star a) (star_mem ha)) + exact hc.symm.eq + +theorem apply_mem_orbit_closure (A : StarSubalgebra ℂ (H →L[ℂ] H)) + {T : H →L[ℂ] H} + (hT : T ∈ Set.centralizer (Set.centralizer (A : Set (H →L[ℂ] H)))) + (x : H) : T x ∈ closure {y | ∃ a : H →L[ℂ] H, a ∈ A ∧ a x = y} := by + let S := (orbitSubmodule A x).topologicalClosure + let : CompleteSpace S := (Submodule.isClosed_topologicalClosure (orbitSubmodule A x)).completeSpace_coe + have hP : S.starProjection ∈ Set.centralizer (A : Set (H →L[ℂ] H)) := + projection_mem_centralizer A S (fun a ha => closedOrbit_invariant A x ha) + have hx : x ∈ S := Submodule.le_topologicalClosure _ ⟨1, A.one_mem, by simp⟩ + have hPx : S.starProjection x = x := Submodule.starProjection_eq_self_iff.mpr hx + have hPT := congrArg (fun a : H →L[ℂ] H => a x) (hT S.starProjection hP) + have hTx : S.starProjection (T x) = T x := by + simpa only [mul_apply_eq_comp, hPx] using hPT + exact Submodule.starProjection_eq_self_iff.mp hTx + +theorem exists_single_vector_approximation (A : StarSubalgebra ℂ (H →L[ℂ] H)) + {T : H →L[ℂ] H} + (hT : T ∈ Set.centralizer (Set.centralizer (A : Set (H →L[ℂ] H)))) + (x : H) {ε : ℝ} (hε : 0 < ε) : + ∃ a : H →L[ℂ] H, a ∈ A ∧ ‖a x - T x‖ < ε := by + obtain ⟨y, ⟨a, ha, rfl⟩, hy⟩ := + Metric.mem_closure_iff.mp (apply_mem_orbit_closure A hT x) ε hε + exact ⟨a, ha, by simpa only [dist_eq_norm, norm_sub_rev] using hy⟩ + +end Invariant233.Bicommutant + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e236c6c123058553db933694603d9d5c060c4cc --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantDensity.lean @@ -0,0 +1,100 @@ +import OAI.Analysis.IrrationalRotation.Operators.BicommutantAmplification +import OAI.Analysis.IrrationalRotation.Operators.BicommutantCyclic +import OAI.Analysis.IrrationalRotation.Operators.BicommutantStrongTopology +import OAI.Analysis.IrrationalRotation.Model.Hyperfinite + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Invariant233.BicommutantDensity + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem exists_amplified_approximation + (A : StarSubalgebra ℂ (H →L[ℂ] H)) {T : H →L[ℂ] H} + (hT : T ∈ Set.centralizer (Set.centralizer (A : Set (H →L[ℂ] H)))) + {ι : Type*} [Fintype ι] (v : Amplification (H := H) ι) + {ε : ℝ} (hε : 0 < ε) : + ∃ a : H →L[ℂ] H, a ∈ A ∧ ‖amplify ι a v - amplify ι T v‖ < ε := by + classical + have hdiag := amplify_mem_bicommutant ι A hT + obtain ⟨B, hB, hclose⟩ := Bicommutant.exists_single_vector_approximation + (StarSubalgebra.map (amplifyHom (H := H) ι) A) hdiag v hε + obtain ⟨a, ha, hBa⟩ := StarSubalgebra.mem_map.mp hB + refine ⟨a, ha, ?_⟩ + rw [← hBa] at hclose + exact hclose + +theorem exists_finite_vector_approximation + (A : StarSubalgebra ℂ (H →L[ℂ] H)) {T : H →L[ℂ] H} + (hT : T ∈ Set.centralizer (Set.centralizer (A : Set (H →L[ℂ] H)))) + {ι : Type*} [Fintype ι] (x : ι → H) {ε : ℝ} (hε : 0 < ε) : + ∃ a : H →L[ℂ] H, a ∈ A ∧ ∀ i, ‖a (x i) - T (x i)‖ < ε := by + let v : Amplification (H := H) ι := WithLp.toLp 2 x + obtain ⟨a, ha, hclose⟩ := exists_amplified_approximation A hT v hε + refine ⟨a, ha, fun i => ?_⟩ + have hi := PiLp.norm_apply_le (amplify ι a v - amplify ι T v) i + change ‖a (x i) - T (x i)‖ ≤ ‖amplify ι a v - amplify ι T v‖ at hi + exact hi.trans_lt hclose + +theorem strongClosure_eq_bicommutant (A : StarSubalgebra ℂ (H →L[ℂ] H)) : + closure {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ A} = + {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ + Set.centralizer (Set.centralizer (A : Set (H →L[ℂ] H)))} := by + classical + apply Set.Subset.antisymm (strongClosure_subset_bicommutant _) + intro T hT + have h := (mem_strongClosure_iff (A : Set (H →L[ℂ] H)) + (strongOperatorUnderlying T)).2 ?_ + · simpa only [strongView_underlying] using h + intro s hs ε hε + let := hs.fintype + obtain ⟨a, ha, hclose⟩ := exists_finite_vector_approximation A hT + (fun x : s => (x : H)) hε + exact ⟨a, ha, fun x hx => hclose ⟨x, hx⟩⟩ + +theorem isStronglyClosed_iff_bicommutant (A : StarSubalgebra ℂ (H →L[ℂ] H)) : + IsStronglyClosed A.toSubalgebra ↔ + Set.centralizer (Set.centralizer (A : Set (H →L[ℂ] H))) = A := by + constructor + · intro hA + have hclosure := hA.closure_eq + change closure {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ A} = + {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ A} at hclosure + rw [strongClosure_eq_bicommutant A] at hclosure + apply Set.ext + intro T + simpa only [Set.mem_ofPred_eq, SetLike.mem_coe, underlying_strongView] using + (Set.ext_iff.mp hclosure (strongView T)) + · intro hA + change IsClosed {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ (A : Set (H →L[ℂ] H))} + rw [← hA] + exact isClosed_strongCentralizer _ + +theorem isHyperfinite_of_bicommutant_chain (M : VonNeumannAlgebra H) + (A : ℕ → StarSubalgebra ℂ (H →L[ℂ] H)) (hmono : Monotone A) + (hinside : ∀ n, A n ≤ M.toStarSubalgebra) + (hfinite : ∀ n, FiniteDimensional ℂ (A n)) + (hgenerate : Set.centralizer (Set.centralizer + {T : H →L[ℂ] H | ∃ n, T ∈ A n}) = (M : Set (H →L[ℂ] H))) : + IsHyperfinite M := by + refine ⟨A, hmono, hinside, hfinite, ?_⟩ + have hcoe : ((⨆ n, A n : StarSubalgebra ℂ (H →L[ℂ] H)) : Set (H →L[ℂ] H)) = + {T | ∃ n, T ∈ A n} := by + rw [StarSubalgebra.coe_iSup_of_directed hmono.directed_le] + ext T + simp + have h := strongClosure_eq_bicommutant (⨆ n, A n) + change closure {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ + ((⨆ n, A n : StarSubalgebra ℂ (H →L[ℂ] H)) : Set (H →L[ℂ] H))} = _ at h + rw [hcoe, hgenerate] at h + exact h + +end Invariant233.BicommutantDensity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantStrongTopology.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantStrongTopology.lean new file mode 100644 index 0000000000000000000000000000000000000000..34ded2deaf9955512d1e71978104e9620d497a24 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/BicommutantStrongTopology.lean @@ -0,0 +1,65 @@ +import OAI.Analysis.IrrationalRotation.Analysis.VonNeumannStrongClosure +import Mathlib.Analysis.VonNeumannAlgebra.Basic + +namespace OAI + +noncomputable section +open Filter Topology + +namespace Invariant233.BicommutantDensity + +variable {H : Type*} [NormedAddCommGroup H] [NormedSpace ℂ H] + +def strongView (T : H →L[ℂ] H) : H →Lₚₜ[ℂ] H := + UniformConvergenceCLM.ofFun (RingHom.id ℂ) H {s : Set H | s.Finite} T + +@[simp] theorem strongView_apply (T : H →L[ℂ] H) (x : H) : strongView T x = T x := rfl +@[simp] theorem underlying_apply (T : H →Lₚₜ[ℂ] H) (x : H) : + strongOperatorUnderlying T x = T x := rfl + +@[simp] theorem underlying_strongView (T : H →L[ℂ] H) : + strongOperatorUnderlying (strongView T) = T := rfl +@[simp] theorem strongView_underlying (T : H →Lₚₜ[ℂ] H) : + strongView (strongOperatorUnderlying T) = T := rfl + +theorem mem_strongClosure_iff (S : Set (H →L[ℂ] H)) (T : H →L[ℂ] H) : + strongView T ∈ closure {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ S} ↔ + ∀ (s : Set H), s.Finite → ∀ ε : ℝ, 0 < ε → + ∃ A ∈ S, ∀ x ∈ s, ‖A x - T x‖ < ε := by + have hb := (PointwiseConvergenceCLM.hasBasis_nhds_zero_of_basis + (σ := RingHom.id ℂ) (E := H) (Metric.nhds_basis_ball (x := (0 : H)))).nhds_of_zero + (strongView T) + rw [mem_closure_iff_nhds_basis hb] + constructor + · intro h s hs ε hε + obtain ⟨A, hA, hclose⟩ := h (s, ε) ⟨hs, hε⟩ + refine ⟨strongOperatorUnderlying A, hA, ?_⟩ + intro x hx + have hx' := hclose x hx + simpa only [Set.mem_ofPred_eq, Metric.mem_ball, dist_zero_right, + sub_apply, strongView_apply, underlying_apply] using hx' + · intro h ⟨s, ε⟩ ⟨hs, hε⟩ + obtain ⟨A, hA, hclose⟩ := h s hs ε hε + refine ⟨strongView A, hA, ?_⟩ + intro x hx + simpa only [Metric.mem_ball, dist_zero_right, sub_apply, + strongView_apply] using hclose x hx + +theorem isClosed_strongCentralizer (S : Set (H →L[ℂ] H)) : + IsClosed {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ Set.centralizer S} := + centralizer_stronglyClosed S + +theorem strongClosure_subset_bicommutant (S : Set (H →L[ℂ] H)) : + closure {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ S} ⊆ + {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ + Set.centralizer (Set.centralizer S)} := by + apply closure_minimal + · intro B hB A hA + exact (hA _ hB).symm + · exact isClosed_strongCentralizer _ + +end Invariant233.BicommutantDensity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/BlockedProjectionWindow.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/BlockedProjectionWindow.lean new file mode 100644 index 0000000000000000000000000000000000000000..ac3479e14c9abc6d97a1269f1c75a3e135e406f1 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/BlockedProjectionWindow.lean @@ -0,0 +1,195 @@ +import OAI.Analysis.IrrationalRotation.Analysis.BlockedSourceEvent +import OAI.Analysis.IrrationalRotation.Product.ProductScaleCocycleWindow +import OAI.Analysis.IrrationalRotation.Rotation.ProjectionCocycleWindow +import OAI.Analysis.IrrationalRotation.Analysis.FiniteWindowIntegralLower + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped Topology BigOperators ComplexConjugate lp + +namespace Invariant233.BlockedProductCoupling + +theorem measurable_sourceEvent (p : ProductScaleData) + (e : ℕ ≃ Σ s, Fin (p.m s)) {r : ProductModel.Base → ℝ} + (hr : Measurable r) (j : ℕ) : MeasurableSet (sourceEvent p e r j) := by + have hx : Measurable (circleLeftEndpoint e) := by + unfold circleLeftEndpoint toCircle leftEndpoint flatten OrderedProductCoupling.leftEndpoint + fun_prop + have hy : Measurable (circleRightEndpoint e) := by + unfold circleRightEndpoint toCircle rightEndpoint flatten OrderedProductCoupling.rightEndpoint + fun_prop + have hc : MeasurableSet (currentEvent p.m j) := by + change MeasurableSet ({z : Sample p.m | ∃ i, (z j i).1 = some (4 : Fin 5)} ∩ + {z | ∀ i, (z j i).2.1 < 1 - 2 / (p.m j : ℝ) ∧ + 2 / (p.m j : ℝ) < (z j i).2.2}) + apply MeasurableSet.inter + · simp only [ofPred_exists] + exact MeasurableSet.iUnion fun i => (by fun_prop : + Measurable (fun z : Sample p.m => (z j i).1)) (measurableSet_singleton _) + · simp only [ofPred_forall] + apply MeasurableSet.iInter + intro i + have hxi : Measurable (fun z : Sample p.m => (z j i).2.1) := by fun_prop + have hyi : Measurable (fun z : Sample p.m => (z j i).2.2) := by fun_prop + exact (measurableSet_lt hxi measurable_const).inter + (measurableSet_lt measurable_const hyi) + have hf : MeasurableSet (futureBad p.m (fun s => (p.K s : ℝ)) j) := by + apply MeasurableSet.iUnion + intro n + apply MeasurableSet.iUnion + intro i + have hxi : Measurable (fun z : Sample p.m => (z (j + 1 + n) i).2.1) := by fun_prop + have hyi : Measurable (fun z : Sample p.m => (z (j + 1 + n) i).2.2) := by fun_prop + exact (measurableSet_le measurable_const hxi).union + (measurableSet_le hyi measurable_const) + exact hc.diff (hf.union + ((measurableSet_lt (hr.comp hx) measurable_const).union + (measurableSet_lt (measurable_const.sub (hr.comp hy)) measurable_const))) + +theorem ae_sourceEvent_coefficient_properties {p : ProductScaleData} + (hp : ProductScaleLaws p) (e : ℕ ≃ Σ s, Fin (p.m s)) (θ : ℕ → ℝ) + (hphase : ∀ i, θ i ∈ Icc (1 / p.N (e i).1) (2 / p.N (e i).1)) + (P : ProjectionField) (hP : ∀ᵐ x ∂ProductModel.baseMeasure, IsStarProjection (P x)) (j : ℕ) : + ∀ᵐ z ∂sourceLaw p j, + z ∈ sourceEvent p e (projectionDiagonal P) j → + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖sourceCoefficientA p e θ P z v‖ ≤ p.coefficientBound j) ∧ + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖sourceCoefficientB p e θ P z v‖ ≤ p.coefficientBound j) ∧ + 1 / ((j + 1 : ℕ) : ℝ) ≤ ‖sourceCoefficientA p e θ P z 0‖ ∧ + 1 / ((j + 1 : ℕ) : ℝ) ≤ ‖sourceCoefficientB p e θ P z 0‖ := by + have hrep := ae_circle_representatives hp.m_ge_100 source_kappa_nonneg source_kappa_le + (fun s _ => (hp.a_bounds s).1) (fun s _ => (hp.a_bounds s).2) + (fun s _ => (hp.b_bounds s).1) (fun s _ => (hp.b_bounds s).2) e j + filter_upwards [hrep, (sourceLaw_quasiMeasurePreserving_left hp e j).ae hP, + (sourceLaw_quasiMeasurePreserving_right hp e j).ae hP] with z hz hPx hPy + intro he + obtain ⟨_, hcurrent, hfuture, hdiagx, hdiagy⟩ := mem_sourceRetainedEvent_iff.mp he + have hcur : ∀ i, (e i).1 = j → + ProductCocycle.representative (circleLeftEndpoint e z i) < 1 - 2 / (p.m j : ℝ) ∧ + 2 / (p.m j : ℝ) < ProductCocycle.representative (circleRightEndpoint e z i) := by + intro i hi + change circleRepresentative _ < _ ∧ _ < circleRepresentative _ + rw [(hz i).1, (hz i).2] + change (z (e i).1 (e i).2).2.1 < _ ∧ _ < (z (e i).1 (e i).2).2.2 + subst j + exact hcurrent (e i).2 + have hfut : ∀ i, j < (e i).1 → + ProductCocycle.representative (circleLeftEndpoint e z i) < + 1 - 2 * (p.K j : ℝ) / p.N (e i).1 ∧ + 2 * (p.K j : ℝ) / p.N (e i).1 < + ProductCocycle.representative (circleRightEndpoint e z i) := by + intro i hi + change circleRepresentative _ < _ ∧ _ < circleRepresentative _ + rw [(hz i).1, (hz i).2] + exact hfuture (e i).1 hi (e i).2 + obtain ⟨hA, hB⟩ := hp.product_finite_window_coefficients e θ hphase j + (circleLeftEndpoint e z) (circleRightEndpoint e z) hcur hfut + (P (circleLeftEndpoint e z) sourceBasisZero) + ((1 - P (circleRightEndpoint e z)) sourceBasisZero) + (ProjectionCocycleWindow.projection_vector_norm_le _ hPx) + (ProjectionCocycleWindow.complement_vector_norm_le _ hPy) + obtain ⟨hA0, hB0⟩ := ProjectionCocycleWindow.central_lower_bounds + (P (circleLeftEndpoint e z)) (P (circleRightEndpoint e z)) + (1 / ((j + 1 : ℕ) : ℝ)) hdiagx (by + change 1 / ((j + 1 : ℕ) : ℝ) ≤ + 1 - ((P (circleRightEndpoint e z) ProjectionCocycleWindow.basisZero) 0).re at hdiagy + linarith) + exact ⟨hA, hB, + by simpa [sourceCoefficientA, sourceBasisZero, ProjectionCocycleWindow.basisZero] using hA0, + by simpa [sourceCoefficientB, sourceBasisZero, ProjectionCocycleWindow.basisZero] using hB0⟩ + +theorem measurable_sourceCoefficientA (p : ProductScaleData) + (e : ℕ ≃ Σ s, Fin (p.m s)) (θ : ℕ → ℝ) (P : ProjectionField) + (hPm : ∀ v, Measurable (fun x => (P x sourceBasisZero) v)) (v : ℤ) : + Measurable (fun z => sourceCoefficientA p e θ P z v) := by + have hx : Measurable (circleLeftEndpoint e) := by + unfold circleLeftEndpoint toCircle leftEndpoint flatten OrderedProductCoupling.leftEndpoint + fun_prop + exact ((hPm v).comp hx).div (Complex.measurable_ofReal.comp + ((ProductCocycle.measurable_cocycleVersion θ (fun i => p.C (e i).1) v).comp hx)) + +theorem measurable_sourceCoefficientB (p : ProductScaleData) + (e : ℕ ≃ Σ s, Fin (p.m s)) (θ : ℕ → ℝ) (P : ProjectionField) + (hPm : ∀ v, Measurable (fun x => (P x sourceBasisZero) v)) (v : ℤ) : + Measurable (fun z => sourceCoefficientB p e θ P z v) := by + have hy : Measurable (circleRightEndpoint e) := by + unfold circleRightEndpoint toCircle rightEndpoint flatten OrderedProductCoupling.rightEndpoint + fun_prop + have hvec : Measurable (fun z : Sample p.m => + sourceBasisZero (-v) - (P (circleRightEndpoint e z) sourceBasisZero) (-v)) := + measurable_const.sub ((hPm (-v)).comp hy) + have hvec' : Measurable (fun z : Sample p.m => + ((1 - P (circleRightEndpoint e z)) sourceBasisZero) (-v)) := by + simpa only [sub_apply, one_apply_eq_self, lp.coeFn_sub, Pi.sub_apply] using hvec + exact (Complex.measurable_ofReal.comp + ((ProductCocycle.measurable_cocycleVersion θ (fun i => p.C (e i).1) (-v)).comp hy)).mul + (Complex.continuous_conj.measurable.comp hvec') + +theorem source_polynomial_sum_lower {p : ProductScaleData} (hp : ProductScaleLaws p) + (j : ℕ) (A B : ℤ → ℂ) + (hA : ∀ v, |v| ≤ (p.K j : ℤ) → ‖A v‖ ≤ p.coefficientBound j) + (hB : ∀ v, |v| ≤ (p.K j : ℤ) → ‖B v‖ ≤ p.coefficientBound j) + (hA0 : 1 / ((j + 1 : ℕ) : ℝ) ≤ ‖A 0‖) + (hB0 : 1 / ((j + 1 : ℕ) : ℝ) ≤ ‖B 0‖) : + p.ε j ≤ ∑ n ∈ Finset.range (2 * p.K j + 1), + ‖FiniteWindow.convolution (p.K j) A B n‖ := by + obtain ⟨n, hn, hε⟩ := hp.polynomial_lower j A B hA hB hA0 hB0 + exact hε.trans (Finset.single_le_sum (fun k _ => norm_nonneg _) + (Finset.mem_range.mpr (by omega))) + +theorem sourceEvent_integral_lower {p : ProductScaleData} + (hp : ProductScaleLaws p) (e : ℕ ≃ Σ s, Fin (p.m s)) (θ : ℕ → ℝ) + (hphase : ∀ i, θ i ∈ Icc (1 / p.N (e i).1) (2 / p.N (e i).1)) + (P : ProjectionField) (hP : ∀ᵐ x ∂ProductModel.baseMeasure, IsStarProjection (P x)) + (hPm : ∀ v, Measurable (fun x => (P x sourceBasisZero) v)) (j : ℕ) : + p.ε j * (sourceLaw p j).real (sourceEvent p e (projectionDiagonal P) j) ≤ + ∫ z in sourceEvent p e (projectionDiagonal P) j, + ∑ n ∈ Finset.range (2 * p.K j + 1), + ‖FiniteWindow.convolution (p.K j) + (sourceCoefficientA p e θ P z) (sourceCoefficientB p e θ P z) n‖ + ∂sourceLaw p j := by + have := sourceLaw_isProbabilityMeasure hp j + have hr : Measurable (projectionDiagonal P) := Complex.measurable_re.comp (hPm 0) + apply FiniteWindow.integral_lower_of_sum_bound (sourceLaw p j) + (p.K j) (p.coefficientBound j) (1 / ((j + 1 : ℕ) : ℝ)) (p.ε j) + (source_polynomial_sum_lower hp j) + (sourceEvent p e (projectionDiagonal P) j) + (sourceCoefficientA p e θ P) (sourceCoefficientB p e θ P) + (measurable_sourceCoefficientA p e θ P hPm) + (measurable_sourceCoefficientB p e θ P hPm) + filter_upwards [ae_restrict_of_ae (ae_sourceEvent_coefficient_properties hp e θ hphase P hP j), + ae_restrict_mem (measurable_sourceEvent p e hr j)] with z hz he + exact hz he + +theorem eventually_sourceEvent_and_integral_lower {p : ProductScaleData} + (hp : ProductScaleLaws p) (e : ℕ ≃ Σ s, Fin (p.m s)) (θ : ℕ → ℝ) + (hphase : ∀ i, θ i ∈ Icc (1 / p.N (e i).1) (2 / p.N (e i).1)) + (P : ProjectionField) (hP : ∀ᵐ x ∂ProductModel.baseMeasure, IsStarProjection (P x)) + (hPm : ∀ v, Measurable (fun x => (P x sourceBasisZero) v)) + (hi : ∀ᵐ x ∂ProductModel.baseMeasure, + 0 < projectionDiagonal P x ∧ projectionDiagonal P x < 1) : + ∀ᶠ j in atTop, + Real.exp (-82) / 2 ≤ (sourceLaw p j).real (sourceEvent p e (projectionDiagonal P) j) ∧ + (Real.exp (-82) / 2) * p.ε j ≤ + ∫ z in sourceEvent p e (projectionDiagonal P) j, + ∑ n ∈ Finset.range (2 * p.K j + 1), + ‖FiniteWindow.convolution (p.K j) + (sourceCoefficientA p e θ P z) (sourceCoefficientB p e θ P z) n‖ + ∂sourceLaw p j := by + have hr : Measurable (projectionDiagonal P) := Complex.measurable_re.comp (hPm 0) + filter_upwards [eventually_sourceEvent_mass hp e hr hi] with j hj + refine ⟨hj, ?_⟩ + calc + (Real.exp (-82) / 2) * p.ε j ≤ + p.ε j * (sourceLaw p j).real (sourceEvent p e (projectionDiagonal P) j) := by + simpa only [mul_comm] using mul_le_mul_of_nonneg_right hj (hp.epsilon_pos j).le + _ ≤ _ := sourceEvent_integral_lower hp e θ hphase P hP hPm j + +end Invariant233.BlockedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/BoundedRangeTrace.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/BoundedRangeTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c671a1cccaa5207ffbea4ede14e250fefb32bec --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/BoundedRangeTrace.lean @@ -0,0 +1,172 @@ +import OAI.Analysis.IrrationalRotation.Operators.ProjectionMeetTrace + +namespace OAI + +noncomputable section +namespace Invariant233.BoundedRangeTrace +open ProjectionMeetTrace TracialProjectionTransport +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem kernel_projection_mem (M : VonNeumannAlgebra H) + (A : H →L[ℂ] H) (hA : A ∈ M) : A.ker.starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff isStarProjection_starProjection M).mpr + intro W hW + rw [Submodule.range_starProjection] + intro x hx + have hcomm := (VonNeumannAlgebra.mem_commutant_iff.mp hW) A hA + change A (W x) = 0 + change A x = 0 at hx + have heq := congrArg (fun B : H →L[ℂ] H => B x) hcomm + change A (W x) = W (A x) at heq + rw [heq, hx, map_zero] + +theorem kernel_trace_eq (M : VonNeumannAlgebra H) (ξ : H) + (htrace : ∀ a b : H →L[ℂ] H, a ∈ M → b ∈ M → + vectorTrace ξ (a * b) = vectorTrace ξ (b * a)) + (A : H →L[ℂ] H) (hA : A ∈ M) : + vectorTrace ξ A.ker.starProjection = vectorTrace ξ A.adjoint.ker.starProjection := by + let c : ℂ := ((1 + ‖A‖)⁻¹ : ℝ) + have hc : c ≠ 0 := Complex.ofReal_ne_zero.mpr (inv_ne_zero (by positivity)) + have hn : ‖c • A‖ ≤ 1 := by + rw [norm_smul] + have hcNorm : ‖c‖ = (1 + ‖A‖)⁻¹ := by + simp only [c, Complex.norm_real, Real.norm_eq_abs] + exact abs_of_pos (by positivity) + rw [hcNorm] + have hpos : 0 < 1 + ‖A‖ := by positivity + rw [inv_mul_le_iff₀ hpos] + linarith [norm_nonneg A] + have heq := vectorTrace_kernel_eq_adjoint_kernel M ξ htrace (c • A) + (M.toStarSubalgebra.smul_mem hA c) hn + have hk : (c • A).ker = A.ker := by + ext x + change c • A x = 0 ↔ A x = 0 + simp only [smul_eq_zero, hc, false_or] + have hka : (c • A).adjoint.ker = A.adjoint.ker := by + rw [map_smulₛₗ] + ext x + change star c • A.adjoint x = 0 ↔ A.adjoint x = 0 + simp only [smul_eq_zero, star_ne_zero.mpr hc, false_or] + simpa only [hk, hka] using heq + +theorem range_closure_eq (A : H →L[ℂ] H) : + A.range.topologicalClosure = A.adjoint.kerᗮ := by + simpa only [ContinuousLinearMap.adjoint_adjoint] using A.adjoint.orthogonal_ker.symm + +theorem range_trace_eq_of_injective + (M : VonNeumannAlgebra H) (ξ : H) + (htrace : ∀ a b : H →L[ℂ] H, a ∈ M → b ∈ M → + vectorTrace ξ (a * b) = vectorTrace ξ (b * a)) + (A : H →L[ℂ] H) (hA : A ∈ M) (hinj : Function.Injective A) + (p : Submodule ℂ H) [CompleteSpace p] (hp : p.starProjection ∈ M) : + vectorTrace ξ (A * p.starProjection).range.topologicalClosure.starProjection = + vectorTrace ξ p.starProjection := by + have hk : (A * p.starProjection).ker = pᗮ := by + rw [← p.ker_starProjection] + ext x + change A (p.starProjection x) = 0 ↔ p.starProjection x = 0 + exact map_eq_zero_iff A hinj + have ht := kernel_trace_eq M ξ htrace (A * p.starProjection) (mul_mem hA hp) + simp only [hk] at ht + simp only [range_closure_eq, vectorTrace_projection_orthogonal, ← ht] + ring + +theorem preimage_trace_eq + (M : VonNeumannAlgebra H) (ξ : H) + (htrace : ∀ a b : H →L[ℂ] H, a ∈ M → b ∈ M → + vectorTrace ξ (a * b) = vectorTrace ξ (b * a)) + (A : H →L[ℂ] H) (hA : A ∈ M) (hinj : Function.Injective A.adjoint) + (p : Submodule ℂ H) [CompleteSpace p] (hp : p.starProjection ∈ M) : + vectorTrace ξ ((1 - p.starProjection) * A).ker.starProjection = + vectorTrace ξ p.starProjection := by + have hstar : ((1 - p.starProjection) * A).adjoint = + A.adjoint * (1 - p.starProjection) := by + simp only [← ContinuousLinearMap.star_eq_adjoint, star_mul, star_sub, star_one, + isStarProjection_starProjection.isSelfAdjoint.star_eq] + have hk : ((1 - p.starProjection) * A).adjoint.ker = p := by + rw [hstar] + ext x + change A.adjoint (x - p.starProjection x) = 0 ↔ x ∈ p + rw [map_eq_zero_iff A.adjoint hinj, sub_eq_zero] + rw [eq_comm] + exact p.starProjection_eq_self_iff + have ht := kernel_trace_eq M ξ htrace ((1 - p.starProjection) * A) + (mul_mem (sub_mem (one_mem M) hp) hA) + simpa only [hk] using ht + +theorem trace_le_transported_of_normalizer + (M : VonNeumannAlgebra H) (ξ : H) + (htrace : ∀ a b : H →L[ℂ] H, a ∈ M → b ∈ M → + vectorTrace ξ (a * b) = vectorTrace ξ (b * a)) + (T : H →ₗ.[ℂ] H) (A B : H →L[ℂ] H) + (hA : A ∈ M) (hB : B ∈ M) + (hAinj : Function.Injective A.adjoint) (hBinj : Function.Injective B) + (hD : ∀ x, A x ∈ T.domain) (hTA : ∀ x, T ⟨A x, hD x⟩ = B x) + (p : Submodule ℂ H) [CompleteSpace p] (hp : p.starProjection ∈ M) : + (vectorTrace ξ p.starProjection).re ≤ + (vectorTrace ξ (InvariantRotation.AffiliatedTransport.transported T p).starProjection).re := by + let r := ((1 - p.starProjection) * A).ker + have hr : r.starProjection ∈ M := kernel_projection_mem M _ + (mul_mem (sub_mem (one_mem M) hp) hA) + have hrt : vectorTrace ξ r.starProjection = vectorTrace ξ p.starProjection := + preimage_trace_eq M ξ htrace A hA hAinj p hp + have hBt := range_trace_eq_of_injective M ξ htrace B hB hBinj r hr + have hle : (B * r.starProjection).range.topologicalClosure ≤ + InvariantRotation.AffiliatedTransport.transported T p := by + apply Submodule.topologicalClosure_minimal _ _ + (Submodule.isClosed_topologicalClosure _) + rintro y ⟨x, rfl⟩ + apply (InvariantRotation.AffiliatedTransport.domainImage T p).le_topologicalClosure + apply InvariantRotation.AffiliatedTransport.mem_domainImage.mpr + refine ⟨⟨A (r.starProjection x), hD _⟩, ?_, hTA _⟩ + have hm := r.starProjection_apply_mem x + change A (r.starProjection x) - p.starProjection (A (r.starProjection x)) = 0 at hm + exact p.starProjection_eq_self_iff.mp (sub_eq_zero.mp hm).symm + have ht := vectorTrace_projection_mono ξ hle + simpa only [hBt, hrt] using ht + +theorem transported_trace_eq_of_normalizer + (M : VonNeumannAlgebra H) (ξ : H) + (htrace : ∀ a b : H →L[ℂ] H, a ∈ M → b ∈ M → + vectorTrace ξ (a * b) = vectorTrace ξ (b * a)) + (T : H →ₗ.[ℂ] H) (hT : T.IsFormalAdjoint T) (hker : T.toFun.ker = ⊥) + (A B : H →L[ℂ] H) (hA : A ∈ M) (hB : B ∈ M) + (hAinj : Function.Injective A) (hAadj : Function.Injective A.adjoint) + (hBinj : Function.Injective B) (hBadj : Function.Injective B.adjoint) + (hD : ∀ x, A x ∈ T.domain) (hTA : ∀ x, T ⟨A x, hD x⟩ = B x) + (p : Submodule ℂ H) [CompleteSpace p] (hp : p.starProjection ∈ M) : + vectorTrace ξ (InvariantRotation.AffiliatedTransport.transported T p).starProjection = + vectorTrace ξ p.starProjection := by + have hforward := trace_le_transported_of_normalizer M ξ htrace T A B hA hB + hAadj hBinj hD hTA p hp + have hDinv : ∀ x, B x ∈ T.inverse.domain := by + intro x + rw [LinearPMap.inverse_domain] + exact ⟨⟨A x, hD x⟩, hTA x⟩ + have hTinv : ∀ x, T.inverse ⟨B x, hDinv x⟩ = A x := by + intro x + have hpartialker : T.ker = ⊥ := by simp [LinearPMap.ker, hker] + exact LinearPMap.inverse_apply_eq (x := ⟨A x, hD x⟩) (y := ⟨B x, hDinv x⟩) + hpartialker (hTA x) + have hpperp : pᗮ.starProjection ∈ M := by + simpa only [Submodule.starProjection_orthogonal, ← ContinuousLinearMap.one_def] using + (sub_mem (one_mem M) hp : (1 : H →L[ℂ] H) - p.starProjection ∈ M) + have hback := trace_le_transported_of_normalizer M ξ htrace T.inverse B A hB hA + hBadj hAinj hDinv hTinv pᗮ hpperp + have horth := InvariantRotation.AffiliatedTransport.inverse_transported_le_orthogonal + T p hT hker + have hback' := hback.trans (vectorTrace_projection_mono ξ horth) + rw [vectorTrace_projection_orthogonal, vectorTrace_projection_orthogonal] at hback' + have hre : (vectorTrace ξ (InvariantRotation.AffiliatedTransport.transported T p).starProjection).re = + (vectorTrace ξ p.starProjection).re := by + simp only [Complex.sub_re] at hback' + linarith + rw [vectorTrace_projection_re, vectorTrace_projection_re] at hre + rw [vectorTrace_projection, vectorTrace_projection] + exact_mod_cast hre + +end Invariant233.BoundedRangeTrace + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ColumnOperator.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ColumnOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..70352cdf2303082b45ddc8bd4d31068fd620b382 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ColumnOperator.lean @@ -0,0 +1,151 @@ +import OAI.Analysis.IrrationalRotation.Model.ColumnOperator +import OAI.Analysis.IrrationalRotation.Analysis.StrongFieldMeasurability +import Mathlib.Topology.Instances.Rat + +namespace OAI + +namespace Invariant233.Fields + +open MeasureTheory + +variable {ι H F : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [NormedAddCommGroup F] [NormedSpace ℂ F] [CompleteSpace F] + +theorem denseRange_basis_linearCombination (b : HilbertBasis ι ℂ H) : + DenseRange (Finsupp.linearCombination ℂ b) := by + change Dense (LinearMap.range (Finsupp.linearCombination ℂ b) : Set H) + rw [Submodule.dense_iff_topologicalClosure_eq_top, Finsupp.range_linearCombination] + exact b.dense_span + +theorem columnOperator_linearCombination (b : HilbertBasis ι ℂ H) (c : ι → F) + {C : ℝ} + (hbound : ∀ z : ι →₀ ℂ, + ‖Finsupp.linearCombination ℂ c z‖ ≤ C * ‖Finsupp.linearCombination ℂ b z‖) + (z : ι →₀ ℂ) : + columnOperator b c (Finsupp.linearCombination ℂ b z) = + Finsupp.linearCombination ℂ c z := by + exact LinearMap.extendOfNorm_eq (denseRange_basis_linearCombination b) ⟨C, hbound⟩ z + +theorem columnOperator_apply_basis (b : HilbertBasis ι ℂ H) (c : ι → F) + {C : ℝ} + (hbound : ∀ z : ι →₀ ℂ, + ‖Finsupp.linearCombination ℂ c z‖ ≤ C * ‖Finsupp.linearCombination ℂ b z‖) + (i : ι) : columnOperator b c (b i) = c i := by + classical + simpa using columnOperator_linearCombination b c hbound (Finsupp.single i 1) + +theorem norm_columnOperator_le (b : HilbertBasis ι ℂ H) (c : ι → F) + {C : ℝ} (hC : 0 ≤ C) + (hbound : ∀ z : ι →₀ ℂ, + ‖Finsupp.linearCombination ℂ c z‖ ≤ C * ‖Finsupp.linearCombination ℂ b z‖) : + ‖columnOperator b c‖ ≤ C := + LinearMap.opNorm_extendOfNorm_le (denseRange_basis_linearCombination b) hC hbound + +theorem columnOperator_unique (b : HilbertBasis ι ℂ H) (c : ι → F) + {C : ℝ} + (hbound : ∀ z : ι →₀ ℂ, + ‖Finsupp.linearCombination ℂ c z‖ ≤ C * ‖Finsupp.linearCombination ℂ b z‖) + (T : H →L[ℂ] F) (hT : ∀ i, T (b i) = c i) : columnOperator b c = T := by + apply LinearMap.extendOfNorm_unique (denseRange_basis_linearCombination b) C hbound T + ext i + simp [hT] + +theorem denseRange_rationalComplex : DenseRange rationalComplex := by + have hq := Rat.isDenseEmbedding_coe_real.dense + have hprod := hq.prodMap hq + have h := Complex.equivRealProdCLM.symm.surjective.denseRange.comp hprod + Complex.equivRealProdCLM.symm.continuous + change DenseRange (fun q : ℚ × ℚ => + Complex.equivRealProdCLM.symm ((q.1 : ℝ), (q.2 : ℝ))) + simpa only [Function.comp_def, Prod.map] using h + +omit [CompleteSpace F] in + +theorem finite_combination_bound_of_rational + (b : HilbertBasis ι ℂ H) (c : ι → F) {C : ℝ} + (hbound : ∀ s : Finset ι, ∀ q : s → ℚ × ℚ, + ‖∑ i : s, rationalComplex (q i) • c i‖ ≤ + C * ‖∑ i : s, rationalComplex (q i) • b i‖) : + ∀ z : ι →₀ ℂ, + ‖Finsupp.linearCombination ℂ c z‖ ≤ C * ‖Finsupp.linearCombination ℂ b z‖ := by + classical + intro z + have hd : DenseRange (fun q : z.support → ℚ × ℚ => + fun i : z.support => rationalComplex (q i)) := + DenseRange.piMap (fun _ => denseRange_rationalComplex) + have h : ‖∑ i : z.support, z i • c i‖ ≤ C * ‖∑ i : z.support, z i • b i‖ := by + exact hd.induction_on + (p := fun a : z.support → ℂ => + ‖∑ i : z.support, a i • c i‖ ≤ C * ‖∑ i : z.support, a i • b i‖) + (fun i : z.support => z i) + (isClosed_le (by fun_prop) (by fun_prop)) (hbound z.support) + rw [z.support.sum_coe_sort (fun i => z i • c i), + z.support.sum_coe_sort (fun i => z i • b i)] at h + exact h + +variable {X : Type*} [MeasurableSpace X] [Countable ι] + +theorem stronglyMeasurable_columnOperator_apply + (b : HilbertBasis ι ℂ H) (c : X → ι → F) {C : ℝ} + (hbound : ∀ x, ∀ z : ι →₀ ℂ, + ‖Finsupp.linearCombination ℂ (c x) z‖ ≤ C * ‖Finsupp.linearCombination ℂ b z‖) + (hc : ∀ i, StronglyMeasurable fun x => c x i) + {v : X → H} (hv : StronglyMeasurable v) : + StronglyMeasurable fun x => columnOperator b (c x) (v x) := by + apply StrongField.stronglyMeasurable_apply_of_columns b + · intro i + simpa only [columnOperator_apply_basis b _ (hbound _)] using hc i + · exact hv + +theorem aestronglyMeasurable_columnOperator_apply + (b : HilbertBasis ι ℂ H) (c : X → ι → F) {C : ℝ} {μ : Measure X} + (hbound : ∀ᵐ x ∂μ, ∀ z : ι →₀ ℂ, + ‖Finsupp.linearCombination ℂ (c x) z‖ ≤ C * ‖Finsupp.linearCombination ℂ b z‖) + (hc : ∀ i, AEStronglyMeasurable (fun x => c x i) μ) + {v : X → H} (hv : AEStronglyMeasurable v μ) : + AEStronglyMeasurable (fun x => columnOperator b (c x) (v x)) μ := by + apply StrongField.aestronglyMeasurable_apply_of_columns b + · intro i + apply (hc i).congr + filter_upwards [hbound] with x hx + exact (columnOperator_apply_basis b (c x) hx i).symm + · exact hv + +omit [CompleteSpace F] in + +theorem ae_finite_combination_bound_of_rational + (b : HilbertBasis ι ℂ H) (c : X → ι → F) {C : ℝ} {μ : Measure X} + (hbound : ∀ s : Finset ι, ∀ q : s → ℚ × ℚ, ∀ᵐ x ∂μ, + ‖∑ i : s, rationalComplex (q i) • c x i‖ ≤ + C * ‖∑ i : s, rationalComplex (q i) • b i‖) : + ∀ᵐ x ∂μ, ∀ z : ι →₀ ℂ, + ‖Finsupp.linearCombination ℂ (c x) z‖ ≤ C * ‖Finsupp.linearCombination ℂ b z‖ := by + have hs : ∀ s : Finset ι, ∀ᵐ x ∂μ, ∀ q : s → ℚ × ℚ, + ‖∑ i : s, rationalComplex (q i) • c x i‖ ≤ + C * ‖∑ i : s, rationalComplex (q i) • b i‖ := by + intro s + exact ae_all_iff.mpr (hbound s) + filter_upwards [ae_all_iff.mpr hs] with x hx + exact finite_combination_bound_of_rational b (c x) hx + +theorem exists_bounded_field_of_rational_column_tests + (b : HilbertBasis ι ℂ H) (c : X → ι → F) {C : ℝ} {μ : Measure X} + (hC : 0 ≤ C) + (hbound : ∀ s : Finset ι, ∀ q : s → ℚ × ℚ, ∀ᵐ x ∂μ, + ‖∑ i : s, rationalComplex (q i) • c x i‖ ≤ + C * ‖∑ i : s, rationalComplex (q i) • b i‖) + (hc : ∀ i, AEStronglyMeasurable (fun x => c x i) μ) : + ∃ A : X → H →L[ℂ] F, + (∀ᵐ x ∂μ, ‖A x‖ ≤ C ∧ ∀ i, A x (b i) = c x i) ∧ + (∀ v : H, AEStronglyMeasurable (fun x => A x v) μ) := by + have hb := ae_finite_combination_bound_of_rational b c hbound + refine ⟨fun x => columnOperator b (c x), ?_, ?_⟩ + · filter_upwards [hb] with x hx + exact ⟨norm_columnOperator_le b (c x) hC hx, + columnOperator_apply_basis b (c x) hx⟩ + · intro v + exact aestronglyMeasurable_columnOperator_apply b c hb hc aestronglyMeasurable_const + +end Invariant233.Fields + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/Commutant.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/Commutant.lean new file mode 100644 index 0000000000000000000000000000000000000000..c9bc69dd0bcaf492d97310c9b13305fdfddbdf73 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/Commutant.lean @@ -0,0 +1,76 @@ +import OAI.Analysis.IrrationalRotation.Model.Commutant + +namespace OAI + +namespace Invariant233.Commutant + +variable {H : Type*} [NormedAddCommGroup H] [NormedSpace ℂ H] + +theorem mem_iff (T A : H →L[ℂ] H) : + A ∈ Subalgebra.centralizer ℂ ({T} : Set (H →L[ℂ] H)) ↔ + T * A = A * T := by + simp [Subalgebra.mem_centralizer_iff] + +theorem one_mem (T : H →L[ℂ] H) : + (1 : H →L[ℂ] H) ∈ Subalgebra.centralizer ℂ ({T} : Set (H →L[ℂ] H)) := + (Subalgebra.centralizer ℂ ({T} : Set (H →L[ℂ] H))).one_mem + +theorem isClosed_strong_commutant (T : H →L[ℂ] H) : + IsClosed {A : H →Lₚₜ[ℂ] H | ∀ x : H, T (A x) = A (T x)} := by + have h : ∀ x : H, + IsClosed {A : H →Lₚₜ[ℂ] H | T (A x) = A (T x)} := by + intro x + exact isClosed_eq (T.continuous.comp (continuous_eval_const x)) + (continuous_eval_const (T x)) + simpa only [Set.iInter_ofPred] using isClosed_iInter h + +theorem commute_of_strong_limit {ι : Type*} {l : Filter ι} [l.NeBot] + (T A : H →L[ℂ] H) (B : ι → H →L[ℂ] H) + (hB : ∀ᶠ i in l, T * B i = B i * T) + (hlim : ∀ x : H, Filter.Tendsto (fun i => B i x) l (nhds (A x))) : + T * A = A * T := by + ext x + have h₁ := T.continuous.continuousAt.tendsto.comp (hlim x) + have h₂ := hlim (T x) + apply tendsto_nhds_unique_of_eventuallyEq h₁ h₂ + filter_upwards [hB] with i hi + exact congrArg (fun S : H →L[ℂ] H => S x) hi + +end Invariant233.Commutant + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [NormedSpace ℂ H] + +theorem operatorCommutant_mem_iff (T A : H →L[ℂ] H) : + A ∈ operatorCommutant T ↔ T * A = A * T := + Commutant.mem_iff T A + +theorem operatorCommutant_stronglyClosed (T : H →L[ℂ] H) : + IsStronglyClosed (operatorCommutant T) := by + unfold IsStronglyClosed + have heq : {A : H →Lₚₜ[ℂ] H | strongOperatorUnderlying A ∈ operatorCommutant T} = + {A : H →Lₚₜ[ℂ] H | ∀ x : H, T (A x) = A (T x)} := by + ext A + change strongOperatorUnderlying A ∈ operatorCommutant T ↔ _ + exact (operatorCommutant_mem_iff T (strongOperatorUnderlying A)).trans + ContinuousLinearMap.ext_iff + rw [heq] + exact Commutant.isClosed_strong_commutant T + +theorem operatorCommutant_transitive_iff (T : H →L[ℂ] H) : + IsTransitive (operatorCommutant T) ↔ HasNoNontrivialHyperinvariantSubspace T := by + constructor + · intro h L hL + exact h L hL.1 hL.2 + · intro h L hclosed hinvariant + exact h L ⟨hclosed, hinvariant⟩ + +theorem IsHyperinvariant.isInvariant {T : H →L[ℂ] H} {L : Submodule ℂ H} + (h : IsHyperinvariant T L) : IsInvariant T L := by + apply h.2 T + rw [operatorCommutant_mem_iff] + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/CommutantAlgebra.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/CommutantAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..e90aa527ffc729b65bc9a324d1a1ab6025ae649b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/CommutantAlgebra.lean @@ -0,0 +1,33 @@ +import OAI.Analysis.IrrationalRotation.Operators.Commutant +import OAI.Analysis.IrrationalRotation.Operators.CommutantProper + +namespace OAI + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem commutant_algebra_properties (T : H →L[ℂ] H) + (hT : ¬ ∃ c : ℂ, T = c • (1 : H →L[ℂ] H)) : + operatorCommutant T ≠ ⊤ ∧ IsStronglyClosed (operatorCommutant T) ∧ + (IsTransitive (operatorCommutant T) ↔ HasNoNontrivialHyperinvariantSubspace T) := by + exact ⟨centralizer_singleton_ne_top_of_nonscalar T hT, + operatorCommutant_stronglyClosed T, operatorCommutant_transitive_iff T⟩ + +theorem operatorCommutant_one_add (T : H →L[ℂ] H) : + operatorCommutant (1 + T) = operatorCommutant T := + centralizer_singleton_one_add T + +theorem isHyperinvariant_one_add_iff (T : H →L[ℂ] H) (L : Submodule ℂ H) : + IsHyperinvariant (1 + T) L ↔ IsHyperinvariant T L := by + unfold IsHyperinvariant + rw [operatorCommutant_one_add] + +theorem hasNoNontrivialHyperinvariantSubspace_one_add_iff (T : H →L[ℂ] H) : + HasNoNontrivialHyperinvariantSubspace (1 + T) ↔ + HasNoNontrivialHyperinvariantSubspace T := by + simp only [HasNoNontrivialHyperinvariantSubspace, isHyperinvariant_one_add_iff] + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/CommutantProper.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/CommutantProper.lean new file mode 100644 index 0000000000000000000000000000000000000000..048886efe04843cf1f58a523979c0a1d844950f8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/CommutantProper.lean @@ -0,0 +1,40 @@ +import Mathlib.Analysis.InnerProductSpace.Dual +import Mathlib.Analysis.LocallyConvex.SeparatingDual +import Mathlib.Algebra.Algebra.Subalgebra.Lattice + +namespace OAI + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem centralizer_singleton_eq_top_iff_scalar (T : H →L[ℂ] H) : + Subalgebra.centralizer ℂ ({T} : Set (H →L[ℂ] H)) = ⊤ ↔ + ∃ c : ℂ, T = c • (1 : H →L[ℂ] H) := by + rw [Subalgebra.centralizer_eq_top_iff_subset] + simp only [Set.singleton_subset_iff, Algebra.IsCentral.center_eq_bot] + simp [Algebra.algebraMap_eq_smul_one, eq_comm] + +theorem centralizer_singleton_ne_top_of_nonscalar (T : H →L[ℂ] H) + (hT : ¬ ∃ c : ℂ, T = c • (1 : H →L[ℂ] H)) : + Subalgebra.centralizer ℂ ({T} : Set (H →L[ℂ] H)) ≠ ⊤ := by + exact fun h => hT ((centralizer_singleton_eq_top_iff_scalar T).mp h) + +variable {A : Type*} [Ring A] [Algebra ℂ A] + +theorem centralizer_singleton_add_scalar (T : A) (c : ℂ) : + Subalgebra.centralizer ℂ ({T + c • (1 : A)} : Set A) = + Subalgebra.centralizer ℂ ({T} : Set A) := by + ext S + simp only [Subalgebra.mem_centralizer_iff, Set.mem_singleton_iff, + forall_eq, add_mul, mul_add, smul_mul_assoc, mul_smul_comm, + one_mul, mul_one, add_right_cancel_iff] + +theorem centralizer_singleton_one_add (T : A) : + Subalgebra.centralizer ℂ ({1 + T} : Set A) = + Subalgebra.centralizer ℂ ({T} : Set A) := by + simpa only [one_smul, add_comm] using centralizer_singleton_add_scalar T 1 + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ConcreteTracialDirectFiniteness.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ConcreteTracialDirectFiniteness.lean new file mode 100644 index 0000000000000000000000000000000000000000..e456f7ebb0dbccca007634de2b6676af75e6dca5 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ConcreteTracialDirectFiniteness.lean @@ -0,0 +1,23 @@ +import OAI.Analysis.IrrationalRotation.Operators.TracialDirectFiniteness +import OAI.Analysis.IrrationalRotation.Rotation.RotationTrace +import OAI.Analysis.IrrationalRotation.Product.ProductTracialVector + +namespace OAI + +noncomputable section + +namespace Invariant233 + +theorem Rotation.algebra_isDedekindFiniteMonoid (θ : ℝ) : + IsDedekindFiniteMonoid (Rotation.algebra θ) := + (Rotation.vacuum_faithfulTracial θ).isDedekindFiniteMonoid + +theorem ProductModel.factor_isDedekindFiniteMonoid (θ : ℕ → ℝ) : + IsDedekindFiniteMonoid (ProductModel.factor θ) := + (ProductModel.traceVector_faithfulTracial θ).isDedekindFiniteMonoid + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ConcreteTracialFiniteness.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ConcreteTracialFiniteness.lean new file mode 100644 index 0000000000000000000000000000000000000000..c1cc28de7bd0c331b5d9bf029c161c2661943ab5 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ConcreteTracialFiniteness.lean @@ -0,0 +1,39 @@ +import OAI.Analysis.IrrationalRotation.Operators.TracialFiniteness +import OAI.Analysis.IrrationalRotation.Rotation.RotationTrace +import OAI.Analysis.IrrationalRotation.Product.ProductTracialVector + +namespace OAI + +noncomputable section + +namespace Invariant233.Rotation + +theorem mem_unitary_of_isometry_mem_algebra (θ : ℝ) + {v : Hilbert →L[ℂ] Hilbert} (hvm : v ∈ algebra θ) (hv : star v * v = 1) : + v ∈ unitary (Hilbert →L[ℂ] Hilbert) := + (vacuum_faithfulTracial θ).mem_unitary_of_star_mul_eq_one hvm hv + +theorem mem_unitary_of_coisometry_mem_algebra (θ : ℝ) + {v : Hilbert →L[ℂ] Hilbert} (hvm : v ∈ algebra θ) (hv : v * star v = 1) : + v ∈ unitary (Hilbert →L[ℂ] Hilbert) := + (vacuum_faithfulTracial θ).mem_unitary_of_mul_star_eq_one hvm hv + +end Invariant233.Rotation + +namespace Invariant233.ProductModel + +theorem mem_unitary_of_isometry_mem_factor (θ : ℕ → ℝ) + {v : Hilbert →L[ℂ] Hilbert} (hvm : v ∈ factor θ) (hv : star v * v = 1) : + v ∈ unitary (Hilbert →L[ℂ] Hilbert) := + (traceVector_faithfulTracial θ).mem_unitary_of_star_mul_eq_one hvm hv + +theorem mem_unitary_of_coisometry_mem_factor (θ : ℕ → ℝ) + {v : Hilbert →L[ℂ] Hilbert} (hvm : v ∈ factor θ) (hv : v * star v = 1) : + v ∈ unitary (Hilbert →L[ℂ] Hilbert) := + (traceVector_faithfulTracial θ).mem_unitary_of_mul_star_eq_one hvm hv + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/Conjugation.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/Conjugation.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5e2c26aa816adc2b4b3ef186691e520d8a44220 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/Conjugation.lean @@ -0,0 +1,91 @@ +import OAI.Analysis.IrrationalRotation.Model.ConjugationDefect +import Mathlib.Analysis.Normed.Operator.Mul +import Mathlib.Topology.Order.LiminfLimsup + +namespace OAI + +noncomputable section +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +@[simp] theorem IsConjugation.toHilbertConjugation_apply {C : H → H} + (hC : IsConjugation C) (x : H) : hC.toHilbertConjugation.val x = C x := rfl + +theorem HilbertConjugation.isConjugation (C : HilbertConjugation H) : + IsConjugation C.val := by + exact ⟨C.property, C.val.map_add, C.val.map_smul', C.val.norm_map⟩ + +namespace HilbertConjugation + +@[simp] theorem conjugate_apply (C : HilbertConjugation H) (T : H →L[ℂ] H) (x : H) : + C.conjugate T x = C.val (T (C.val x)) := rfl + +@[simp] theorem apply_apply (C : HilbertConjugation H) (x : H) : + C.val (C.val x) = x := C.property x + +@[simp] theorem conjugate_one (C : HilbertConjugation H) : + C.conjugate (1 : H →L[ℂ] H) = 1 := by + ext x + simp + +@[simp] theorem conjugate_add (C : HilbertConjugation H) (A B : H →L[ℂ] H) : + C.conjugate (A + B) = C.conjugate A + C.conjugate B := by + ext x + simp + +@[simp] theorem conjugate_mul (C : HilbertConjugation H) (A B : H →L[ℂ] H) : + C.conjugate (A * B) = C.conjugate A * C.conjugate B := by + ext x + simp + +@[simp] theorem conjugate_pow (C : HilbertConjugation H) (A : H →L[ℂ] H) (n : ℕ) : + C.conjugate (A ^ n) = (C.conjugate A) ^ n := by + induction n with + | zero => simp + | succ n ih => simp [pow_succ, ih] + +@[simp] theorem conjugate_conjugate (C : HilbertConjugation H) (A : H →L[ℂ] H) : + C.conjugate (C.conjugate A) = A := by + ext x + simp + +theorem norm_conjugate_le (C : HilbertConjugation H) (A : H →L[ℂ] H) : + ‖C.conjugate A‖ ≤ ‖A‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) + intro x + simpa only [conjugate_apply, LinearIsometryEquiv.norm_map] using A.le_opNorm (C.val x) + +@[simp] theorem norm_conjugate (C : HilbertConjugation H) (A : H →L[ℂ] H) : + ‖C.conjugate A‖ = ‖A‖ := by + apply le_antisymm (C.norm_conjugate_le A) + simpa only [conjugate_conjugate] using C.norm_conjugate_le (C.conjugate A) + +theorem normQuasinilpotent_conjugate (C : HilbertConjugation H) {A : H →L[ℂ] H} + (hA : NormQuasinilpotent A) : NormQuasinilpotent (C.conjugate A) := by + simpa only [NormQuasinilpotent, ← conjugate_pow, norm_conjugate] using hA + +end HilbertConjugation + +theorem isInfiniteConjugationIsometry_iff_limsup [CompleteSpace H] + (C : HilbertConjugation H) (T : H →L[ℂ] H) : + IsInfiniteConjugationIsometry C T ↔ + Filter.limsup (fun m : ℕ => ENNReal.ofReal + (‖conjugationDefect C T m‖ ^ (1 / (m : ℝ)))) Filter.atTop = 0 := by + constructor + · intro h + have h' := ENNReal.continuous_ofReal.continuousAt.tendsto.comp h + simpa only [Function.comp_def, ENNReal.ofReal_zero] using h'.limsup_eq + · intro h + have h' : Filter.Tendsto (fun m : ℕ => ENNReal.ofReal + (‖conjugationDefect C T m‖ ^ (1 / (m : ℝ)))) Filter.atTop (nhds 0) := + tendsto_of_le_liminf_of_limsup_le bot_le h.le + have hreal := (ENNReal.tendsto_toReal ENNReal.zero_ne_top).comp h' + simpa only [IsInfiniteConjugationIsometry, Function.comp_def, ENNReal.toReal_zero, + ENNReal.toReal_ofReal (Real.rpow_nonneg (norm_nonneg _) _)] using hreal + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ConjugationDefect.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ConjugationDefect.lean new file mode 100644 index 0000000000000000000000000000000000000000..80b0e9fdb8b4d52fbfd89349ebdbedbe9cdae1b9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ConjugationDefect.lean @@ -0,0 +1,163 @@ +import OAI.Analysis.IrrationalRotation.Operators.Conjugation +import OAI.Analysis.IrrationalRotation.Spectral.QuasinilpotentCommuting + +namespace OAI + +noncomputable section +open scoped BigOperators Topology +namespace Invariant233 +namespace ConjugationSupport + +variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] + +def leftMul (a : A) : A →L[ℂ] A := ContinuousLinearMap.mul ℂ A a + +def rightMul (a : A) : A →L[ℂ] A := (ContinuousLinearMap.mul ℂ A).flip a + +@[simp] theorem leftMul_apply (a x : A) : leftMul a x = a * x := rfl +@[simp] theorem rightMul_apply (a x : A) : rightMul a x = x * a := rfl + +@[simp] theorem leftMul_pow (a : A) (n : ℕ) : (leftMul a) ^ n = leftMul (a ^ n) := by + induction n with + | zero => ext x; simp + | succ n ih => ext x; simp [pow_succ, ih, mul_assoc] + +@[simp] theorem rightMul_pow (a : A) (n : ℕ) : (rightMul a) ^ n = rightMul (a ^ n) := by + induction n with + | zero => ext x; simp + | succ n ih => + ext x + simp only [pow_succ, mul_apply_eq_comp, ih, rightMul_apply] + rw [mul_assoc, ← pow_succ', pow_succ] + +theorem leftMul_commute_rightMul (a b : A) : Commute (leftMul a) (rightMul b) := by + apply ContinuousLinearMap.ext + intro x + simp [mul_assoc] + +theorem norm_leftMul_le (a : A) : ‖leftMul a‖ ≤ ‖a‖ := + ContinuousLinearMap.opNorm_mul_apply_le ℂ A a + +theorem norm_rightMul_le (a : A) : ‖rightMul a‖ ≤ ‖a‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) + intro x + exact (norm_mul_le x a).trans_eq (mul_comm _ _) + +theorem normQuasinilpotent_leftMul {a : A} (ha : NormQuasinilpotent a) : + NormQuasinilpotent (leftMul a) := by + apply root_tendsto_zero_of_geometric_bounds _ (fun _ => norm_nonneg _) + intro r hr + obtain ⟨C, hC, hb⟩ := ha.geometric_bound r hr + refine ⟨C, hC, fun n => ?_⟩ + rw [leftMul_pow] + exact (norm_leftMul_le _).trans (hb n) + +theorem normQuasinilpotent_rightMul {a : A} (ha : NormQuasinilpotent a) : + NormQuasinilpotent (rightMul a) := by + apply root_tendsto_zero_of_geometric_bounds _ (fun _ => norm_nonneg _) + intro r hr + obtain ⟨C, hC, hb⟩ := ha.geometric_bound r hr + refine ⟨C, hC, fun n => ?_⟩ + rw [rightMul_pow] + exact (norm_rightMul_le _).trans (hb n) + +theorem mul_left_right_pow_apply (a b x : A) (n : ℕ) : + ((leftMul a * rightMul b) ^ n) x = a ^ n * x * b ^ n := by + rw [(leftMul_commute_rightMul a b).mul_pow, leftMul_pow, rightMul_pow] + simp [mul_assoc] + +@[simp] theorem leftMul_one : leftMul (1 : A) = 1 := by ext x; simp +@[simp] theorem rightMul_one : rightMul (1 : A) = 1 := by ext x; simp +@[simp] theorem leftMul_add (a b : A) : leftMul (a + b) = leftMul a + leftMul b := by + ext x + simp [add_mul] +@[simp] theorem rightMul_add (a b : A) : rightMul (a + b) = rightMul a + rightMul b := by + ext x + simp [mul_add] + +theorem sub_one_pow_apply (B : A →L[ℂ] A) (x : A) (n : ℕ) : + ((B - 1) ^ n) x = ∑ j ∈ Finset.range (n + 1), + ((-1 : ℂ) ^ j * (n.choose j : ℂ)) • ((B ^ (n - j)) x) := by + have hexp : (B - 1) ^ n = ∑ j ∈ Finset.range (n + 1), + n.choose j • ((-1 : A →L[ℂ] A) ^ j * B ^ (n - j)) := by + rw [show B - 1 = -1 + B by abel] + simpa only [Finset.Nat.sum_antidiagonal_eq_sum_range_succ_mk] using + (Commute.neg_one_left B).add_pow' n + rw [hexp] + simp only [sum_apply] + apply Finset.sum_congr rfl + intro j hj + have hnegpow : ∀ (k : ℕ) (y : A), ((-1 : A →L[ℂ] A) ^ k) y = (-1 : ℂ) ^ k • y := by + intro k + induction k with + | zero => intro y; simp + | succ k ih => intro y; simp [pow_succ', mul_apply_eq_comp, ih] + simp only [smul_apply, mul_apply_eq_comp, hnegpow] + rw [← Nat.cast_smul_eq_nsmul ℂ, smul_smul] + congr 1 + ring + +end ConjugationSupport + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +open ConjugationSupport + +def conjugationDefectMap (C : HilbertConjugation H) (T : H →L[ℂ] H) : + (H →L[ℂ] H) →L[ℂ] (H →L[ℂ] H) := + leftMul (star T) * rightMul (C.conjugate T) - 1 + +theorem conjugationDefectMap_one_add (C : HilbertConjugation H) (Q : H →L[ℂ] H) : + conjugationDefectMap C (1 + Q) = + leftMul (star Q) + rightMul (C.conjugate Q) + + leftMul (star Q) * rightMul (C.conjugate Q) := by + simp only [conjugationDefectMap, star_add, star_one, + HilbertConjugation.conjugate_add, HilbertConjugation.conjugate_one, + leftMul_add, rightMul_add, leftMul_one, rightMul_one] + noncomm_ring + +theorem normQuasinilpotent_conjugationDefectMap_one_add + (C : HilbertConjugation H) {Q : H →L[ℂ] H} (hQ : NormQuasinilpotent Q) : + NormQuasinilpotent (conjugationDefectMap C (1 + Q)) := by + have hnorm : ∀ n : ℕ, ‖(star Q) ^ n‖ = ‖Q ^ n‖ := by + intro n + rw [← star_pow] + exact ContinuousLinearMap.adjoint.norm_map _ + have hstar : NormQuasinilpotent (star Q) := by + simpa only [NormQuasinilpotent, hnorm] using hQ + have hL := normQuasinilpotent_leftMul hstar + have hR := normQuasinilpotent_rightMul (C.normQuasinilpotent_conjugate hQ) + have hcomm := leftMul_commute_rightMul (star Q) (C.conjugate Q) + rw [conjugationDefectMap_one_add] + apply (hL.add_of_commute hR hcomm).add_of_commute (hL.mul_of_commute hR hcomm) + exact ((Commute.refl _).mul_right hcomm).add_left + (hcomm.symm.mul_right (Commute.refl _)) + +theorem conjugationDefect_eq_power_apply (C : HilbertConjugation H) + (T : H →L[ℂ] H) (m : ℕ) : + conjugationDefect C T m = ((conjugationDefectMap C T) ^ m) 1 := by + simp only [conjugationDefectMap, sub_one_pow_apply, conjugationDefect, + mul_left_right_pow_apply, mul_one, HilbertConjugation.conjugate_pow] + +theorem isInfiniteConjugationIsometry_one_add (C : HilbertConjugation H) + {Q : H →L[ℂ] H} (hQ : NormQuasinilpotent Q) : + IsInfiniteConjugationIsometry C (1 + Q) := by + apply root_tendsto_zero_of_geometric_bounds _ (fun _ => norm_nonneg _) + intro r hr + obtain ⟨K, hK, hb⟩ := + (normQuasinilpotent_conjugationDefectMap_one_add C hQ).geometric_bound r hr + refine ⟨K * (‖(1 : H →L[ℂ] H)‖ + 1), by positivity, fun n => ?_⟩ + rw [conjugationDefect_eq_power_apply] + calc + ‖((conjugationDefectMap C (1 + Q)) ^ n) 1‖ + ≤ ‖(conjugationDefectMap C (1 + Q)) ^ n‖ * ‖(1 : H →L[ℂ] H)‖ := + ContinuousLinearMap.le_opNorm _ _ + _ ≤ (K * r ^ n) * (‖(1 : H →L[ℂ] H)‖ + 1) := + mul_le_mul (hb n) (by linarith) (norm_nonneg _) (by positivity) + _ = K * (‖(1 : H →L[ℂ] H)‖ + 1) * r ^ n := by ring + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ContinuousProjectionTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ContinuousProjectionTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8b27c68a2f2b0f50378795648d0014e44d1d6d0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ContinuousProjectionTransport.lean @@ -0,0 +1,42 @@ +import OAI.Analysis.IrrationalRotation.Rotation.ContinuousWeightOperatorBridge +import OAI.Analysis.IrrationalRotation.Rotation.RotationProjectionTransport + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.CircleParameterLaws + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem continuousWeight_hasOnlyTrivialInvariantProjections + (d : BackgroundBumpData θ) + (hstar : HasOnlyTrivialInvariantProjections (Rotation.algebra θ) + (Rotation.U * Rotation.measurableRepresentation θ + (fun x => (p.measurableWeight θ x : ℂ)) 1 zero_le_one + hp.measurable_complexParameterWeight hp.norm_complexParameterWeight_le_one)) : + HasOnlyTrivialInvariantProjections (Rotation.algebra θ) + (Rotation.weightedReal θ + ⟨p.continuousWeight θ d, (hp.isContinuousCircleWeight_continuousWeight d).1⟩) := by + let f : C(Circle, ℝ) := + ⟨p.continuousWeight θ d, (hp.isContinuousCircleWeight_continuousWeight d).1⟩ + let H := Rotation.exponentialTransfer θ (p.continuousTransfer θ d) + let Tstar := Rotation.U * Rotation.measurableRepresentation θ + (fun x => (p.measurableWeight θ x : ℂ)) 1 zero_le_one + hp.measurable_complexParameterWeight hp.norm_complexParameterWeight_le_one + have h := hp.continuousWeight_natural_intertwining d + let hD : ∀ ξ : H.domain, Rotation.weightedReal θ f ξ.val ∈ H.domain := + fun ξ => (h ξ).choose + have hI : ∀ ξ : H.domain, H ⟨Rotation.weightedReal θ f ξ.val, hD ξ⟩ = + (Real.exp (-1) : ℂ) • Tstar (H ξ) := fun ξ => (h ξ).choose_spec + exact Rotation.hasOnlyTrivialInvariantProjections_of_scaled_exponentialTransfer θ + (measurable_continuousTransfer d) (Rotation.weightedReal θ f) Tstar + (Real.exp (-1) : ℂ) (Complex.ofReal_ne_zero.mpr (Real.exp_ne_zero _)) hD hI hstar + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/CovariantTracialVector.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/CovariantTracialVector.lean new file mode 100644 index 0000000000000000000000000000000000000000..687dae37881bbe13ec201f4778bfb88f5f8e049a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/CovariantTracialVector.lean @@ -0,0 +1,147 @@ +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties +import OAI.Analysis.IrrationalRotation.Analysis.FieldVectorState +import OAI.Analysis.IrrationalRotation.Operators.FieldTraceFaithfulness +import OAI.Analysis.IrrationalRotation.Analysis.FieldPositivity +import OAI.Analysis.IrrationalRotation.Operators.HilbertModelSize +import OAI.Analysis.IrrationalRotation.Analysis.FieldCovariance + +namespace OAI + +open MeasureTheory Filter +open scoped InnerProductSpace + +namespace Invariant233.FieldTraceCyclic + +variable {Ω E : Type*} [MeasurableSpace Ω] + [NormedAddCommGroup E] [InnerProductSpace ℂ E] + {μ : Measure Ω} + +theorem represented_eq_zero_of_field_ae_zero + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : Ω → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (hA : A =ᵐ[μ] 0) : T = 0 := by + apply ContinuousLinearMap.ext + intro ξ + apply Lp.ext + filter_upwards [hT ξ, hA, Lp.coeFn_zero E 2 μ] with x hx hxA hx0 + simpa only [hxA, Pi.zero_apply, zero_apply, hx0] using hx + +variable [CompleteSpace E] [IsFiniteMeasure μ] + +theorem represented_eq_zero_of_vector_state_zero + (b : HilbertBasis ℤ ℂ E) (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (A : Ω → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) + (hpos : ∀ᵐ x ∂μ, (A x).IsPositive) + (σ : ℤ → Ω → Ω) (hσ : ∀ r, MeasurePreserving (σ r) μ μ) + (hcov : ∀ r : ℤ, ∀ᵐ x ∂μ, + inner ℂ (b 0) (A (σ r x) (b 0)) = inner ℂ (b r) (A x (b r))) + (hzero : inner ℂ (Lp.const 2 μ (b 0)) (T (Lp.const 2 μ (b 0))) = 0) : + T = 0 := by + have hi : Integrable (fun x => inner ℂ (b 0) (A x (b 0))) μ := by + apply (L2.integrable_inner (𝕜 := ℂ) (Lp.const 2 μ (b 0)) + (T (Lp.const 2 μ (b 0)))).congr + filter_upwards [Lp.coeFn_const 2 μ (b 0), hT (Lp.const 2 μ (b 0))] + with x hx hTx + rw [hTx, hx] + rfl + have heq : (fun x => (inner ℂ (A x (b 0)) (b 0)).re) = + fun x => (inner ℂ (b 0) (A x (b 0))).re := by + funext x + exact inner_re_symm (𝕜 := ℂ) (A x (b 0)) (b 0) + have hcov' : ∀ r : ℤ, ∀ᵐ x ∂μ, + (inner ℂ (A x (b r)) (b r)).re = + (inner ℂ (A (σ r x) (b 0)) (b 0)).re := by + intro r + filter_upwards [hcov r] with x hx + calc + (inner ℂ (A x (b r)) (b r)).re = (inner ℂ (b r) (A x (b r))).re := + inner_re_symm (𝕜 := ℂ) (A x (b r)) (b r) + _ = (inner ℂ (b 0) (A (σ r x) (b 0))).re := congrArg Complex.re hx.symm + _ = (inner ℂ (A (σ r x) (b 0)) (b 0)).re := + inner_re_symm (𝕜 := ℂ) (b 0) (A (σ r x) (b 0)) + have hint : Integrable (fun x => (inner ℂ (A x (b 0)) (b 0)).re) μ := by + rw [heq] + exact hi.re + have htr : (∫ x, (inner ℂ (A x (b 0)) (b 0)).re ∂μ) = 0 := by + rw [heq] + change (∫ x, RCLike.re (inner ℂ (b 0) (A x (b 0))) ∂μ) = 0 + rw [integral_re hi, + ← constant_vector_state_eq_integral T A hT (b 0), hzero] + rfl + exact represented_eq_zero_of_field_ae_zero T A hT + (FieldTraceFaithfulness.ae_eq_zero_of_integral_diagonal_eq_zero + μ b 0 A σ hσ hpos hcov' hint htr) + +theorem faithfulTracialVector_of_covariant_fields [IsProbabilityMeasure μ] + (b : HilbertBasis ℤ ℂ E) (M : VonNeumannAlgebra (Lp E 2 μ)) + (σ : ℤ → Ω → Ω) (hσ : ∀ r, MeasurePreserving (σ r) μ μ) + (hfields : ∀ T : Lp E 2 μ →L[ℂ] Lp E 2 μ, T ∈ M → + ∃ A : Ω → E →L[ℂ] E, + (∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) ∧ + (∀ r : ℤ, AEStronglyMeasurable (fun x => A x (b r)) μ) ∧ + (∀ᵐ x ∂μ, ‖A x‖ ≤ ‖T‖) ∧ + (∀ r k l : ℤ, ∀ᵐ x ∂μ, + inner ℂ (b k) (A (σ r x) (b l)) = + inner ℂ (b (k + r)) (A x (b (l + r)))) ∧ + (T.IsPositive → ∀ᵐ x ∂μ, (A x).IsPositive)) : + IsFaithfulTracialVector M (Lp.const 2 μ (b 0)) := by + refine ⟨?_, ?_, ?_⟩ + · rw [Lp.norm_const' 2 μ (b 0) (by norm_num) (by norm_num)] + simp [b.orthonormal.norm_eq_one] + · intro T S hTM hSM + obtain ⟨A, hT, hA, hAbound, hcovA, _⟩ := hfields T hTM + obtain ⟨B, hS, hB, hBbound, hcovB, _⟩ := hfields S hSM + exact constant_vector_state_cyclic_of_covariance b T S A B hT hS hA hB + ‖T‖ ‖S‖ (norm_nonneg _) (norm_nonneg _) hAbound hBbound σ hσ hcovA hcovB + · intro T hTM hpos hzero + obtain ⟨A, hT, _, _, hcov, hApos⟩ := hfields T hTM + apply represented_eq_zero_of_vector_state_zero b T A hT (hApos hpos) σ hσ + · intro r + simpa only [zero_add] using hcov r 0 0 + · exact hzero + +theorem faithfulTracialVector_of_represented_covariant_fields + [IsProbabilityMeasure μ] + (b : HilbertBasis ℤ ℂ E) (M : VonNeumannAlgebra (Lp E 2 μ)) + (σ : ℤ → Ω → Ω) (hσ : ∀ r, MeasurePreserving (σ r) μ μ) + (hfields : ∀ T : Lp E 2 μ →L[ℂ] Lp E 2 μ, T ∈ M → + ∃ A : Ω → E →L[ℂ] E, + (∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) ∧ + (∀ r : ℤ, AEStronglyMeasurable (fun x => A x (b r)) μ) ∧ + (∀ᵐ x ∂μ, ‖A x‖ ≤ ‖T‖) ∧ + (∀ r k l : ℤ, ∀ᵐ x ∂μ, + inner ℂ (b k) (A (σ r x) (b l)) = + inner ℂ (b (k + r)) (A x (b (l + r))))) : + IsFaithfulTracialVector M (Lp.const 2 μ (b 0)) := by + let := HilbertModelSize.separable_of_countable_hilbertBasis b + apply faithfulTracialVector_of_covariant_fields b M σ hσ + intro T hTM + obtain ⟨A, hT, hA, hAbound, hcov⟩ := hfields T hTM + exact ⟨A, hT, hA, hAbound, hcov, + ae_isPositive_of_represented_isPositive T A hT⟩ + +theorem faithfulTracialVector_of_commuting_shiftedPullbacks [IsProbabilityMeasure μ] + (b : HilbertBasis ℤ ℂ E) (M : VonNeumannAlgebra (Lp E 2 μ)) + (σ : ℤ → Ω → Ω) (hσ : ∀ r, MeasurePreserving (σ r) μ μ) + (S : ℤ → E →ₗᵢ[ℂ] E) (hS : ∀ r k : ℤ, S r (b k) = b (k + r)) + (hcomm : ∀ T : Lp E 2 μ →L[ℂ] Lp E 2 μ, T ∈ M → ∀ r, + Commute T (DirectIntegral.shiftedPullback (S r).toContinuousLinearMap (σ r) (hσ r))) + (hfields : ∀ T : Lp E 2 μ →L[ℂ] Lp E 2 μ, T ∈ M → + ∃ A : Ω → E →L[ℂ] E, + (∀ ξ : Lp E 2 μ, ∀ᵐ x ∂μ, (T ξ) x = A x (ξ x)) ∧ + (∀ r : ℤ, AEStronglyMeasurable (fun x => A x (b r)) μ) ∧ + (∀ᵐ x ∂μ, ‖A x‖ ≤ ‖T‖)) : + IsFaithfulTracialVector M (Lp.const 2 μ (b 0)) := by + apply faithfulTracialVector_of_represented_covariant_fields b M σ hσ + intro T hTM + obtain ⟨A, hT, hA, hAbound⟩ := hfields T hTM + refine ⟨A, hT, hA, hAbound, ?_⟩ + exact ae_matrix_covariance_of_commute b T A + (fun r => DirectIntegral.shiftedPullback (S r).toContinuousLinearMap (σ r) (hσ r)) + S σ hσ hS hT + (fun r => shiftedPullback_ae (S r).toContinuousLinearMap (σ r) (hσ r)) (hcomm T hTM) + +end Invariant233.FieldTraceCyclic + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/DenseOperatorRange.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/DenseOperatorRange.lean new file mode 100644 index 0000000000000000000000000000000000000000..20dffaca5abc88496acb56072247c989f046efcc --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/DenseOperatorRange.lean @@ -0,0 +1,87 @@ +import Mathlib.Analysis.InnerProductSpace.Adjoint +import Mathlib.Analysis.Normed.Operator.Banach +import Mathlib.Algebra.Algebra.Spectrum.Basic + +namespace OAI + +noncomputable section + +namespace Invariant233.OperatorRange + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem denseRange_of_adjoint_injective (T : H →L[ℂ] H) + (hT : Function.Injective (star T : H →L[ℂ] H)) : DenseRange T := by + change Dense (T.range : Set H) + rw [Submodule.dense_iff_topologicalClosure_eq_top, + Submodule.topologicalClosure_eq_top_iff, ContinuousLinearMap.orthogonal_range] + exact LinearMap.ker_eq_bot.mpr hT + +theorem denseRange_of_selfAdjoint_injective (T : H →L[ℂ] H) + (hself : IsSelfAdjoint T) (hinj : Function.Injective T) : DenseRange T := by + apply denseRange_of_adjoint_injective + simpa only [hself.star_eq] using hinj + +theorem unitary_injective (U : H →L[ℂ] H) + (hU : U ∈ unitary (H →L[ℂ] H)) : Function.Injective U := by + intro x y hxy + have h := congrArg (fun z => star U z) hxy + change (star U * U) x = (star U * U) y at h + simpa only [(Unitary.mem_iff.mp hU).1, one_apply_eq_self] using h + +theorem unitary_surjective (U : H →L[ℂ] H) + (hU : U ∈ unitary (H →L[ℂ] H)) : Function.Surjective U := by + intro x + refine ⟨star U x, ?_⟩ + change (U * star U) x = x + rw [(Unitary.mem_iff.mp hU).2, one_apply_eq_self] + +theorem unitary_mul_selfAdjoint_range (U D : H →L[ℂ] H) + (hU : U ∈ unitary (H →L[ℂ] H)) (hD : IsSelfAdjoint D) + (hinj : Function.Injective D) : + Function.Injective (U * D) ∧ DenseRange (U * D) := by + constructor + · exact (unitary_injective U hU).comp hinj + · exact (unitary_surjective U hU).denseRange.comp + (denseRange_of_selfAdjoint_injective D hD hinj) U.continuous + +theorem not_surjective_of_zero_mem_spectrum (T : H →L[ℂ] H) + (hinj : Function.Injective T) (hspec : (0 : ℂ) ∈ spectrum ℂ T) : + ¬ Function.Surjective T := by + intro hsurj + exact ((spectrum.zero_mem_iff (R := ℂ)).mp hspec) + (ContinuousLinearMap.isUnit_iff_bijective.mpr ⟨hinj, hsurj⟩) + +omit [CompleteSpace H] in + +theorem not_isClosed_range_of_dense_not_surjective (T : H →L[ℂ] H) + (hdense : DenseRange T) (hnot : ¬ Function.Surjective T) : + ¬ IsClosed (Set.range T) := by + intro hclosed + apply hnot + have hrange : Set.range T = Set.univ := + hclosed.closure_eq.symm.trans hdense.closure_range + intro x + have : x ∈ Set.range T := by rw [hrange]; trivial + exact this + +theorem eq_zero_of_eigenvector_of_spectrum_zero (T : H →L[ℂ] H) + (hinj : Function.Injective T) (hspec : spectrum ℂ T = {0}) + (z : ℂ) (x : H) (heigen : T x = z • x) : x = 0 := by + by_cases hz : z = 0 + · apply hinj + simpa only [hz, zero_smul, map_zero] using heigen + · have hunit : IsUnit (algebraMap ℂ (H →L[ℂ] H) z - T) := by + apply spectrum.notMem_iff.mp + rw [hspec] + simpa only [Set.mem_singleton_iff] using hz + apply (ContinuousLinearMap.isUnit_iff_bijective.mp hunit).1 + simp only [sub_apply, Algebra.algebraMap_eq_smul_one, + smul_apply, one_apply_eq_self, heigen, sub_self, map_zero] + +end Invariant233.OperatorRange + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/FaithfulProjectionTrace.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/FaithfulProjectionTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..ecc4b4ffc81d4e0e20c3267277eae2210f797b79 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/FaithfulProjectionTrace.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties +import OAI.Analysis.IrrationalRotation.Rotation.ProjectionDiagonalPropagation + +namespace OAI + +noncomputable section +open scoped InnerProductSpace + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem strict_positive_trace_of_nonzero_projection + (M : VonNeumannAlgebra H) (ξ : H) (htrace : IsFaithfulTracialVector M ξ) + (P : H →L[ℂ] H) (hPm : P ∈ M) (hP : IsStarProjection P) (hP0 : P ≠ 0) : + 0 < (vectorTrace ξ P).re := by + have hnonneg := (InvariantProjection.projection_re_inner_bounds hP ξ).1 + apply lt_of_le_of_ne hnonneg + intro heq + have hzero : P ξ = 0 := + (InvariantProjection.projection_re_inner_eq_zero_iff hP ξ).mp heq.symm + apply hP0 + exact htrace.2.2 P hPm (ContinuousLinearMap.IsPositive.of_isStarProjection hP) + (by simp only [vectorTrace, hzero, inner_zero_right]) + +theorem strict_trace_bounds_of_nontrivial_projection + (M : VonNeumannAlgebra H) (ξ : H) (htrace : IsFaithfulTracialVector M ξ) + (P : H →L[ℂ] H) (hPm : P ∈ M) (hP : IsStarProjection P) + (hP0 : P ≠ 0) (hP1 : P ≠ 1) : + 0 < (vectorTrace ξ P).re ∧ (vectorTrace ξ P).re < 1 := by + refine ⟨strict_positive_trace_of_nonzero_projection M ξ htrace P hPm hP hP0, ?_⟩ + have hcomp := strict_positive_trace_of_nonzero_projection M ξ htrace + (1 - P) (M.sub_mem M.one_mem hPm) hP.one_sub + (sub_ne_zero.mpr (Ne.symm hP1)) + have hself : (inner ℂ ξ ξ).re = 1 := by + calc + (inner ℂ ξ ξ).re = ‖ξ‖ ^ 2 := inner_self_eq_norm_sq (𝕜 := ℂ) ξ + _ = 1 := by rw [htrace.1]; norm_num + simp only [vectorTrace, sub_apply, + one_apply_eq_self, inner_sub_right, Complex.sub_re, + hself] at hcomp ⊢ + exact sub_pos.mp hcomp + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/FieldOperator.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/FieldOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9f3af86f0d8656eab7547bdbd2b61cfca14bf44 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/FieldOperator.lean @@ -0,0 +1,103 @@ +import OAI.Analysis.IrrationalRotation.Model.FieldOperator +import Mathlib.Analysis.InnerProductSpace.Adjoint +import Mathlib.MeasureTheory.Function.LpSpace.Indicator +import Mathlib.Tactic + +namespace OAI + +noncomputable section +open MeasureTheory Filter TopologicalSpace +open scoped ENNReal Topology + +namespace Invariant233.DirectIntegral +variable {X E F G : Type*} [MeasurableSpace X] {μ : Measure X} + [NormedAddCommGroup E] [NormedSpace ℂ E] + [NormedAddCommGroup F] [NormedSpace ℂ F] + [NormedAddCommGroup G] [NormedSpace ℂ G] + +variable (A : X → E →L[ℂ] F) (C : ℝ) + (hA : ∀ x, ‖A x‖ ≤ C) + (hm : ∀ v, AEStronglyMeasurable (fun x => A x v) μ) + +theorem fieldOperator_ae (f : Lp E 2 μ) : + fieldOperator A C hA hm f =ᵐ[μ] fun x => A x (f x) := + fieldOperatorVec_ae A C hA hm f + +theorem norm_fieldOperator_le (hC : 0 ≤ C) : ‖fieldOperator A C hA hm‖ ≤ C := + LinearMap.mkContinuous_norm_le _ hC _ + +variable {A C hA hm} + +theorem fieldOperator_congr + {B : X → E →L[ℂ] F} {D : ℝ} {hB : ∀ x, ‖B x‖ ≤ D} + {hn : ∀ v, AEStronglyMeasurable (fun x => B x v) μ} + (heq : A =ᵐ[μ] B) : fieldOperator A C hA hm = fieldOperator B D hB hn := by + ext f + filter_upwards [fieldOperator_ae A C hA hm f, + fieldOperator_ae B D hB hn f, heq] with x hx hy hxy + rw [hx, hy, hxy] + +theorem fieldOperator_comp_of_ae_eq + {B : X → F →L[ℂ] G} {P : X → E →L[ℂ] G} {D R : ℝ} + {hB : ∀ x, ‖B x‖ ≤ D} {hP : ∀ x, ‖P x‖ ≤ R} + {hn : ∀ v, AEStronglyMeasurable (fun x => B x v) μ} + {hp : ∀ v, AEStronglyMeasurable (fun x => P x v) μ} + (heq : P =ᵐ[μ] fun x => (B x).comp (A x)) : + fieldOperator P R hP hp = + (fieldOperator B D hB hn).comp (fieldOperator A C hA hm) := by + ext f + filter_upwards [fieldOperator_ae P R hP hp f, + fieldOperator_ae B D hB hn (fieldOperator A C hA hm f), + fieldOperator_ae A C hA hm f, heq] with x hx hy hz he + change fieldOperator P R hP hp f x = + fieldOperator B D hB hn (fieldOperator A C hA hm f) x + rw [hx, hy, hz, he] + rfl + +theorem fieldOperator_ae_eq_of_eq [IsFiniteMeasure μ] [SeparableSpace E] + {B : X → E →L[ℂ] F} {D : ℝ} {hB : ∀ x, ‖B x‖ ≤ D} + {hn : ∀ v, AEStronglyMeasurable (fun x => B x v) μ} + (heq : fieldOperator A C hA hm = fieldOperator B D hB hn) : A =ᵐ[μ] B := by + have hpoint (v : E) : ∀ᵐ x ∂μ, A x v = B x v := by + have heqv := congrArg (fun T : Lp E 2 μ →L[ℂ] Lp F 2 μ => T (Lp.const 2 μ v)) heq + have hae : fieldOperator A C hA hm (Lp.const 2 μ v) =ᵐ[μ] + fieldOperator B D hB hn (Lp.const 2 μ v) := by rw [heqv] + filter_upwards [fieldOperator_ae A C hA hm (Lp.const 2 μ v), + fieldOperator_ae B D hB hn (Lp.const 2 μ v), Lp.coeFn_const 2 μ v, hae] + with x hx hy hv he + simpa only [hx, hy, hv, Function.const_apply] using he + have hseq : ∀ᵐ x ∂μ, ∀ n : ℕ, A x (denseSeq E n) = B x (denseSeq E n) := + ae_all_iff.mpr fun n => hpoint (denseSeq E n) + filter_upwards [hseq] with x hx + have hfunctions : (A x : E → F) = (B x : E → F) := + (denseRange_denseSeq E).equalizer (A x).continuous (B x).continuous (funext hx) + exact DFunLike.ext' hfunctions + +end Invariant233.DirectIntegral + +namespace Invariant233.DirectIntegral +variable {X E F : Type*} [MeasurableSpace X] {μ : Measure X} + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + [NormedAddCommGroup F] [InnerProductSpace ℂ F] [CompleteSpace F] + {A : X → E →L[ℂ] F} {C : ℝ} {hA : ∀ x, ‖A x‖ ≤ C} + {hm : ∀ v, AEStronglyMeasurable (fun x => A x v) μ} + +theorem fieldOperator_adjoint_of_ae_eq + {B : X → F →L[ℂ] E} {D : ℝ} {hB : ∀ x, ‖B x‖ ≤ D} + {hn : ∀ v, AEStronglyMeasurable (fun x => B x v) μ} + (heq : B =ᵐ[μ] fun x => ContinuousLinearMap.adjoint (A x)) : + fieldOperator B D hB hn = ContinuousLinearMap.adjoint (fieldOperator A C hA hm) := by + apply (ContinuousLinearMap.eq_adjoint_iff _ _).2 + intro f g + simp only [L2.inner_def] + apply integral_congr_ae + filter_upwards [fieldOperator_ae B D hB hn f, + fieldOperator_ae A C hA hm g, heq] with x hx hy he + rw [hx, hy, he] + exact (A x).adjoint_inner_left (g x) (f x) + +end Invariant233.DirectIntegral + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/FieldProjections.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/FieldProjections.lean new file mode 100644 index 0000000000000000000000000000000000000000..4cdd773c8eb9fba78a3c53bfaa45a491c7e4e874 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/FieldProjections.lean @@ -0,0 +1,69 @@ +import OAI.Analysis.IrrationalRotation.Operators.FieldOperator +import OAI.Analysis.IrrationalRotation.Analysis.StrongFieldMeasurability + +namespace OAI + +noncomputable section +open MeasureTheory Filter TopologicalSpace +open scoped ENNReal Topology + +namespace Invariant233.DirectIntegral +variable {X E : Type*} [MeasurableSpace X] {μ : Measure X} [IsFiniteMeasure μ] + [NormedAddCommGroup E] [NormedSpace ℂ E] [SeparableSpace E] + {A : X → E →L[ℂ] E} {C : ℝ} {hA : ∀ x, ‖A x‖ ≤ C} + {hm : ∀ v, AEStronglyMeasurable (fun x => A x v) μ} + +theorem ae_isIdempotentElem_of_fieldOperator (hC : 0 ≤ C) + (hP : IsIdempotentElem (fieldOperator A C hA hm)) : + ∀ᵐ x ∂μ, IsIdempotentElem (A x) := by + have hAA : ∀ x, ‖A x * A x‖ ≤ C * C := fun x => + (norm_mul_le _ _).trans (mul_le_mul (hA x) (hA x) (norm_nonneg _) hC) + have hmAA : ∀ v, AEStronglyMeasurable (fun x => (A x * A x) v) μ := fun v => + apply_aestronglyMeasurable A hm (hm v) + have hmul : fieldOperator (fun x => A x * A x) (C * C) hAA hmAA = + fieldOperator A C hA hm * fieldOperator A C hA hm := + fieldOperator_comp_of_ae_eq (Filter.Eventually.of_forall fun x => rfl) + have hfield := fieldOperator_ae_eq_of_eq (hmul.trans hP.eq) + exact hfield + +end Invariant233.DirectIntegral + +namespace Invariant233.DirectIntegral +variable {X E ι : Type*} [MeasurableSpace X] {μ : Measure X} [IsFiniteMeasure μ] + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + [SeparableSpace E] [Countable ι] + {A : X → E →L[ℂ] E} {C : ℝ} {hA : ∀ x, ‖A x‖ ≤ C} + +theorem ae_isSelfAdjoint_of_fieldOperator (b : HilbertBasis ι ℂ E) + (hm : ∀ v, StronglyMeasurable (fun x => A x v)) + (hP : IsSelfAdjoint (fieldOperator (μ := μ) A C hA (fun v => (hm v).aestronglyMeasurable))) : + ∀ᵐ x ∂μ, IsSelfAdjoint (A x) := by + have hB : ∀ x, ‖star (A x)‖ ≤ C := by + intro x + rw [ContinuousLinearMap.star_eq_adjoint, LinearIsometryEquiv.norm_map] + exact hA x + have hn : ∀ v, AEStronglyMeasurable (fun x => star (A x) v) μ := by + intro v + simpa only [ContinuousLinearMap.star_eq_adjoint] using + (StrongField.stronglyMeasurable_adjoint_apply_of_columns b A + (fun i => hm (b i)) v).aestronglyMeasurable + have hglobal : fieldOperator (fun x => star (A x)) C hB hn = + star (fieldOperator (μ := μ) A C hA (fun v => (hm v).aestronglyMeasurable)) := by + rw [ContinuousLinearMap.star_eq_adjoint] + exact fieldOperator_adjoint_of_ae_eq (Filter.Eventually.of_forall fun x => + ContinuousLinearMap.star_eq_adjoint (A x)) + exact fieldOperator_ae_eq_of_eq (hglobal.trans hP.star_eq) + +theorem ae_isStarProjection_of_fieldOperator (b : HilbertBasis ι ℂ E) (hC : 0 ≤ C) + (hm : ∀ v, StronglyMeasurable (fun x => A x v)) + (hP : IsStarProjection (fieldOperator (μ := μ) A C hA (fun v => (hm v).aestronglyMeasurable))) : + ∀ᵐ x ∂μ, IsStarProjection (A x) := by + filter_upwards [ae_isIdempotentElem_of_fieldOperator hC hP.isIdempotentElem, + ae_isSelfAdjoint_of_fieldOperator b hm hP.isSelfAdjoint] with x hid hself + exact ⟨hid, hself⟩ + +end Invariant233.DirectIntegral + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/FieldTraceCyclic.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/FieldTraceCyclic.lean new file mode 100644 index 0000000000000000000000000000000000000000..11edab7047e0390a73d15b495677c3171f695c45 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/FieldTraceCyclic.lean @@ -0,0 +1,127 @@ +import Mathlib + +namespace OAI + +open MeasureTheory Filter +open scoped InnerProductSpace + +namespace Invariant233.FieldTraceCyclic + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +theorem hasSum_matrix_product (b : HilbertBasis ℤ ℂ E) + (A B : E →L[ℂ] E) (k : ℤ) : + HasSum (fun r : ℤ => inner ℂ (b k) (A (b r)) * inner ℂ (b r) (B (b k))) + (inner ℂ (b k) (A (B (b k)))) := by + simpa only [ContinuousLinearMap.adjoint_inner_left] using + b.hasSum_inner_mul_inner ((ContinuousLinearMap.adjoint A) (b k)) (B (b k)) + +theorem summable_norm_matrix_product (b : HilbertBasis ℤ ℂ E) + (A B : E →L[ℂ] E) (k : ℤ) : + Summable (fun r : ℤ => + ‖inner ℂ (b k) (A (b r)) * inner ℂ (b r) (B (b k))‖) := + summable_norm_iff.mpr (hasSum_matrix_product b A B k).summable + +theorem tsum_norm_matrix_product_le (b : HilbertBasis ℤ ℂ E) + (A B : E →L[ℂ] E) (k : ℤ) : + (∑' r : ℤ, ‖inner ℂ (b k) (A (b r)) * inner ℂ (b r) (B (b k))‖) ≤ + ‖A‖ * ‖B‖ := by + have hc := lp.tsum_mul_le_mul_norm' (p := 2) (q := 2) + (by simpa using Real.HolderConjugate.two_two) + (b.repr ((ContinuousLinearMap.adjoint A) (b k))) (b.repr (B (b k))) + simp only [HilbertBasis.repr_apply_apply, LinearIsometryEquiv.norm_map] at hc + calc + (∑' r : ℤ, ‖inner ℂ (b k) (A (b r)) * inner ℂ (b r) (B (b k))‖) = + ∑' r : ℤ, ‖inner ℂ (b r) ((ContinuousLinearMap.adjoint A) (b k))‖ * + ‖inner ℂ (b r) (B (b k))‖ := by + apply tsum_congr + intro r + rw [norm_mul, ← ContinuousLinearMap.adjoint_inner_left, norm_inner_symm] + _ ≤ ‖(ContinuousLinearMap.adjoint A) (b k)‖ * ‖B (b k)‖ := hc + _ ≤ (‖ContinuousLinearMap.adjoint A‖ * ‖b k‖) * (‖B‖ * ‖b k‖) := + mul_le_mul ((ContinuousLinearMap.adjoint A).le_opNorm (b k)) + (B.le_opNorm (b k)) (norm_nonneg _) (by positivity) + _ = ‖A‖ * ‖B‖ := by + rw [ContinuousLinearMap.adjoint.norm_map, b.orthonormal.norm_eq_one] + ring + +variable {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] + +theorem hasSum_integral_matrix_product (b : HilbertBasis ℤ ℂ E) + (A B : Ω → E →L[ℂ] E) + (hA : ∀ r : ℤ, AEStronglyMeasurable (fun x => A x (b r)) μ) + (hB : ∀ r : ℤ, AEStronglyMeasurable (fun x => B x (b r)) μ) + (CA CB : ℝ) (hCA : 0 ≤ CA) + (hAbound : ∀ᵐ x ∂μ, ‖A x‖ ≤ CA) (hBbound : ∀ᵐ x ∂μ, ‖B x‖ ≤ CB) + (k : ℤ) : + HasSum (fun r : ℤ => ∫ x, + inner ℂ (b k) (A x (b r)) * inner ℂ (b r) (B x (b k)) ∂μ) + (∫ x, inner ℂ (b k) (A x (B x (b k))) ∂μ) := by + let F : ℤ → Ω → ℂ := fun r x => + inner ℂ (b k) (A x (b r)) * inner ℂ (b r) (B x (b k)) + have hFm : ∀ r, AEStronglyMeasurable (F r) μ := by + intro r + exact (aestronglyMeasurable_const.inner (hA r)).mul + (aestronglyMeasurable_const.inner (hB k)) + have hsumInt : Integrable (fun x => ∑' r, ‖F r x‖) μ := by + apply (integrable_const (CA * CB)).mono' (AEStronglyMeasurable.tsum (fun r => (hFm r).norm)) + filter_upwards [hAbound, hBbound] with x hxA hxB + rw [Real.norm_of_nonneg (tsum_nonneg (fun r => norm_nonneg (F r x)))] + exact (tsum_norm_matrix_product_le b (A x) (B x) k).trans + (mul_le_mul hxA hxB (norm_nonneg _) hCA) + exact hasSum_integral_of_dominated_convergence + (fun r x => ‖F r x‖) hFm (fun _ => ae_of_all _ (fun _ => le_rfl)) + (ae_of_all _ (fun x => summable_norm_matrix_product b (A x) (B x) k)) + hsumInt (ae_of_all _ (fun x => hasSum_matrix_product b (A x) (B x) k)) + +theorem integral_central_matrix_product_cyclic (b : HilbertBasis ℤ ℂ E) + (A B : Ω → E →L[ℂ] E) + (hA : ∀ r : ℤ, AEStronglyMeasurable (fun x => A x (b r)) μ) + (hB : ∀ r : ℤ, AEStronglyMeasurable (fun x => B x (b r)) μ) + (CA CB : ℝ) (hCA : 0 ≤ CA) (hCB : 0 ≤ CB) + (hAbound : ∀ᵐ x ∂μ, ‖A x‖ ≤ CA) (hBbound : ∀ᵐ x ∂μ, ‖B x‖ ≤ CB) + (σ : ℤ → Ω → Ω) (hσ : ∀ r, MeasurePreserving (σ r) μ μ) + (hcovA : ∀ r k l : ℤ, ∀ᵐ x ∂μ, + inner ℂ (b k) (A (σ r x) (b l)) = inner ℂ (b (k + r)) (A x (b (l + r)))) + (hcovB : ∀ r k l : ℤ, ∀ᵐ x ∂μ, + inner ℂ (b k) (B (σ r x) (b l)) = inner ℂ (b (k + r)) (B x (b (l + r)))) : + (∫ x, inner ℂ (b 0) (A x (B x (b 0))) ∂μ) = + ∫ x, inner ℂ (b 0) (B x (A x (b 0))) ∂μ := by + have hterm (r : ℤ) : + (∫ x, inner ℂ (b 0) (A x (b r)) * inner ℂ (b r) (B x (b 0)) ∂μ) = + ∫ x, inner ℂ (b 0) (B x (b (-r))) * inner ℂ (b (-r)) (A x (b 0)) ∂μ := by + let f : Ω → ℂ := fun x => + inner ℂ (b 0) (B x (b (-r))) * inner ℂ (b (-r)) (A x (b 0)) + have hfm : AEStronglyMeasurable f μ := + (aestronglyMeasurable_const.inner (hB (-r))).mul + (aestronglyMeasurable_const.inner (hA 0)) + have hm : AEStronglyMeasurable f (μ.map (σ r)) := by + rw [(hσ r).map_eq] + exact hfm + calc + (∫ x, inner ℂ (b 0) (A x (b r)) * inner ℂ (b r) (B x (b 0)) ∂μ) = + ∫ x, f (σ r x) ∂μ := by + apply integral_congr_ae + filter_upwards [hcovA r (-r) 0, hcovB r 0 (-r)] with x hxA hxB + simp only [neg_add_cancel, zero_add] at hxA hxB + dsimp [f] + rw [hxA, hxB] + exact mul_comm _ _ + _ = ∫ x, f x ∂μ := by + simpa only [(hσ r).map_eq] using + (integral_map (hσ r).measurable.aemeasurable hm).symm + rw [← (hasSum_integral_matrix_product b A B hA hB CA CB hCA hAbound hBbound 0).tsum_eq, + ← (hasSum_integral_matrix_product b B A hB hA CB CA hCB hBbound hAbound 0).tsum_eq] + calc + (∑' r : ℤ, ∫ x, inner ℂ (b 0) (A x (b r)) * inner ℂ (b r) (B x (b 0)) ∂μ) = + ∑' r : ℤ, ∫ x, inner ℂ (b 0) (B x (b (-r))) * inner ℂ (b (-r)) (A x (b 0)) ∂μ := + tsum_congr hterm + _ = ∑' r : ℤ, ∫ x, inner ℂ (b 0) (B x (b r)) * inner ℂ (b r) (A x (b 0)) ∂μ := + by + simpa only [Equiv.neg_apply] using + (Equiv.neg ℤ).tsum_eq (fun r : ℤ => + ∫ x, inner ℂ (b 0) (B x (b r)) * inner ℂ (b r) (A x (b 0)) ∂μ) + +end Invariant233.FieldTraceCyclic + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/FieldTraceFaithfulness.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/FieldTraceFaithfulness.lean new file mode 100644 index 0000000000000000000000000000000000000000..0760262581f7407498e06a40ea26e1448d1d59d7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/FieldTraceFaithfulness.lean @@ -0,0 +1,70 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped InnerProductSpace Topology + +namespace Invariant233.FieldTraceFaithfulness + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [CompleteSpace E] + +theorem apply_eq_zero_of_re_inner_eq_zero {T : E →L[ℂ] E} + (hT : T.IsPositive) {x : E} (hx : (inner ℂ (T x) x).re = 0) : T x = 0 := by + let R := CFC.sqrt T + have hR : R.IsPositive := + ContinuousLinearMap.nonneg_iff_isPositive.mp (CFC.sqrt_nonneg T) + have hRR : R * R = T := CFC.sqrt_mul_sqrt_self T + (ContinuousLinearMap.nonneg_iff_isPositive.mpr hT) + have hnorm : ‖R x‖ ^ 2 = 0 := by + rw [R.apply_norm_sq_eq_inner_adjoint_left, (ContinuousLinearMap.isSelfAdjoint_iff'.mp hR.isSelfAdjoint)] + change (inner ℂ ((R * R) x) x).re = 0 + rw [hRR] + exact hx + have hRx : R x = 0 := norm_eq_zero.mp (sq_eq_zero_iff.mp hnorm) + rw [← hRR] + change R (R x) = 0 + simp [hRx] + +theorem eq_zero_of_re_diagonal_eq_zero {ι : Type*} (b : HilbertBasis ι ℂ E) + {T : E →L[ℂ] E} (hT : T.IsPositive) + (hdiag : ∀ i, (inner ℂ (T (b i)) (b i)).re = 0) : T = 0 := by + have hb : ∀ i, T (b i) = 0 := fun i => + apply_eq_zero_of_re_inner_eq_zero hT (hdiag i) + ext x + have hsum := T.hasSum (b.hasSum_repr x) + simp only [map_smul, hb, smul_zero] at hsum + exact hsum.unique hasSum_zero + +theorem ae_eq_zero_of_integral_diagonal_eq_zero + {X ι : Type*} [MeasurableSpace X] [Countable ι] + (μ : Measure X) (b : HilbertBasis ι ℂ E) (i₀ : ι) + (H : X → E →L[ℂ] E) (σ : ι → X → X) + (hσ : ∀ i, MeasurePreserving (σ i) μ μ) + (hpos : ∀ᵐ x ∂μ, (H x).IsPositive) + (hcov : ∀ i, ∀ᵐ x ∂μ, + (inner ℂ (H x (b i)) (b i)).re = + (inner ℂ (H (σ i x) (b i₀)) (b i₀)).re) + (hint : Integrable (fun x => (inner ℂ (H x (b i₀)) (b i₀)).re) μ) + (htrace : ∫ x, (inner ℂ (H x (b i₀)) (b i₀)).re ∂μ = 0) : + H =ᵐ[μ] 0 := by + have hnonneg : 0 ≤ᵐ[μ] fun x => (inner ℂ (H x (b i₀)) (b i₀)).re := by + filter_upwards [hpos] with x hx + exact hx.re_inner_nonneg_left _ + have hzero : ∀ᵐ x ∂μ, (inner ℂ (H x (b i₀)) (b i₀)).re = 0 := + (integral_eq_zero_iff_of_nonneg_ae hnonneg hint).mp htrace + have hall : ∀ i, ∀ᵐ x ∂μ, (inner ℂ (H x (b i)) (b i)).re = 0 := by + intro i + filter_upwards [hcov i, (hσ i).quasiMeasurePreserving.ae hzero] with x hcovx hzerox + exact hcovx.trans hzerox + filter_upwards [hpos, ae_all_iff.mpr hall] with x hposx hdiagx + exact eq_zero_of_re_diagonal_eq_zero b hposx hdiagx + +end Invariant233.FieldTraceFaithfulness + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/FiniteConvolutionAlgebra.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/FiniteConvolutionAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ffc00282c22912a66d48d3411b78e28086ce0ae --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/FiniteConvolutionAlgebra.lean @@ -0,0 +1,37 @@ +import Mathlib.Algebra.Polynomial.Degree.TrailingDegree +import Mathlib.Algebra.Polynomial.OfFn +import Mathlib.Basic.Complex.Basic + +namespace OAI + +namespace InvariantProjection + +open Polynomial + +theorem exists_nonzero_product_coeff_le + {R : Type*} [Semiring R] [NoZeroDivisors R] + (A B : R[X]) (k l : ℕ) + (hA : A.coeff k ≠ 0) (hB : B.coeff l ≠ 0) : + ∃ n ≤ k + l, (A * B).coeff n ≠ 0 := by + have hA0 : A ≠ 0 := by + intro h + simp [h] at hA + have hB0 : B ≠ 0 := by + intro h + simp [h] at hB + refine ⟨(A * B).natTrailingDegree, ?_, ?_⟩ + · rw [natTrailingDegree_mul hA0 hB0] + exact Nat.add_le_add + (natTrailingDegree_le_of_ne_zero hA) + (natTrailingDegree_le_of_ne_zero hB) + · exact coeff_natTrailingDegree_ne_zero.mpr (mul_ne_zero hA0 hB0) + +theorem exists_nonzero_product_coeff_le_two_mul + (A B : ℂ[X]) (K : ℕ) + (hA : A.coeff K ≠ 0) (hB : B.coeff K ≠ 0) : + ∃ n ≤ 2 * K, (A * B).coeff n ≠ 0 := by + simpa [two_mul] using exists_nonzero_product_coeff_le A B K K hA hB + +end InvariantProjection + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/FullAffiliatedTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/FullAffiliatedTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..c448a473c3a76544e8bcd6351ae3af014f3f428b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/FullAffiliatedTransport.lean @@ -0,0 +1,71 @@ +import OAI.Analysis.IrrationalRotation.Spectral.AffiliatedPositiveResolvent +import OAI.Analysis.IrrationalRotation.Spectral.PartialResolventCalculus +import OAI.Analysis.IrrationalRotation.Operators.NormalTracialTransport + +namespace OAI + +noncomputable section +namespace Invariant233 + +theorem affiliated_transport_proof + {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + (M : VonNeumannAlgebra E) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (H : E →ₗ.[ℂ] E) (hH : IsSelfAdjoint H) (hpos : IsPositivePartial H) + (hinj : Function.Injective H) (haff : IsAffiliated M H) + (A B : M) + (hD : ∀ x : H.domain, (A : E →L[ℂ] E) (x : E) ∈ H.domain) + (hinter : ∀ x : H.domain, + H ⟨(A : E →L[ℂ] E) (x : E), hD x⟩ = (B : E →L[ℂ] E) (H x)) + (p : M) (hp : IsStarProjection (p : E →L[ℂ] E)) + (hinv : (1 - (p : E →L[ℂ] E)) * (A : E →L[ℂ] E) * + (p : E →L[ℂ] E) = 0) : + ∃ P : M, + (P : E →L[ℂ] E) = + (InvariantRotation.AffiliatedTransport.transported H + (p : E →L[ℂ] E).range).starProjection ∧ + IsStarProjection (P : E →L[ℂ] E) ∧ + (1 - (P : E →L[ℂ] E)) * (B : E →L[ℂ] E) * + (P : E →L[ℂ] E) = 0 ∧ + τ P = τ p := by + obtain ⟨hPM, hPproj, hPinv⟩ := haff.transported_projection_invariant + (A : E →L[ℂ] E) (B : E →L[ℂ] E) hD hinter p.property hp hinv + refine ⟨⟨_, hPM⟩, rfl, hPproj, hPinv, ?_⟩ + obtain ⟨R, hRM, _hnorm, hRD, hHR, _hRH, _hrange⟩ := + PositivePartialResolvent.exists_affiliated_resolvent M H hH hpos haff + have hHR' : ∀ x, H ⟨R x, hRD x⟩ = x - R x := fun x => hHR x (hRD x) + have hformal : H.IsFormalAdjoint H := by + simpa only [LinearPMap.isSelfAdjoint_def.mp hH] using + (LinearPMap.adjoint_isFormalAdjoint hH.dense_domain) + have hRinj := PartialResolvent.injective H R hRD hHR' + have hSinj := PartialResolvent.injective_one_sub H R hRD hHR' hinj + have hRsa := PartialResolvent.isSelfAdjoint H R hRD hHR' hformal + have hSsa := PartialResolvent.one_sub_isSelfAdjoint H R hRD hHR' hformal + change star R = R at hRsa + change star (1 - R : E →L[ℂ] E) = 1 - R at hSsa + have hRadj : Function.Injective R.adjoint := by + rw [← ContinuousLinearMap.star_eq_adjoint, hRsa] + exact hRinj + have hSadj : Function.Injective (1 - R : E →L[ℂ] E).adjoint := by + rw [← ContinuousLinearMap.star_eq_adjoint, hSsa] + exact hSinj + have hSM : (1 - R : E →L[ℂ] E) ∈ M := sub_mem (one_mem M) hRM + let : CompleteSpace (p : E →L[ℂ] E).range := + (ContinuousLinearMap.IsIdempotentElem.isClosed_range hp.isIdempotentElem).completeSpace_coe + have hpeq : (p : E →L[ℂ] E).range.starProjection = (p : E →L[ℂ] E) := + (isStarProjection_iff_eq_starProjection_range.mp hp).choose_spec.symm + have hpM : (p : E →L[ℂ] E).range.starProjection ∈ M := by + rw [hpeq] + exact p.property + have htrace := NormalTracialTransport.transported_trace_eq_of_normalizer + M τ hτ H hformal (LinearMap.ker_eq_bot.mpr hinj) R (1 - R) hRM hSM + hRinj hRadj hSinj hSadj hRD hHR' (p : E →L[ℂ] E).range hpM hPM + convert htrace using 1 + congr 1 + exact Subtype.ext hpeq.symm + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertConjugationExistence.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertConjugationExistence.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec901da12881af17d4cd24e849dc6287fc02fd32 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertConjugationExistence.lean @@ -0,0 +1,45 @@ +import OAI.Analysis.IrrationalRotation.Operators.Conjugation +import Mathlib.Analysis.InnerProductSpace.l2Space + +namespace OAI + +noncomputable section +namespace Invariant233 +open scoped lp + +variable {H ι : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem exists_conjugation_fixing_hilbertBasis (b : HilbertBasis ι ℂ H) : + ∃ C : HilbertConjugation H, ∀ i, C.val (b i) = b i := by + classical + let C : H → H := fun x => b.repr.symm (star (b.repr x)) + have hC : IsConjugation C := by + refine ⟨fun x => ?_, fun x y => ?_, fun c x => ?_, fun x => ?_⟩ + · simp [C] + · simp [C] + · simp [C] + · simp [C] + refine ⟨hC.toHilbertConjugation, fun i => ?_⟩ + change b.repr.symm (star (b.repr (b i))) = b i + rw [b.repr_self] + have hs : star (lp.single 2 i (1 : ℂ) : ℓ²(ι, ℂ)) = lp.single 2 i (1 : ℂ) := by + ext j + by_cases hij : j = i + · subst j; simp [lp.single_apply] + · simp [lp.single_apply, Pi.single_eq_of_ne hij] + rw [hs, b.repr_symm_single] + +theorem nonempty_hilbertConjugation [CompleteSpace H] : Nonempty (HilbertConjugation H) := by + obtain ⟨w, b, _⟩ := exists_hilbertBasis ℂ H + obtain ⟨C, _⟩ := exists_conjugation_fixing_hilbertBasis b + exact ⟨C⟩ + +theorem exists_isConjugation [CompleteSpace H] : ∃ C : H → H, IsConjugation C := by + obtain ⟨C⟩ := nonempty_hilbertConjugation (H := H) + exact ⟨C.val, C.isConjugation⟩ + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertConsequence.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertConsequence.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf8adf624e64faf933f0c0fc38a72cd82ce7f64b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertConsequence.lean @@ -0,0 +1,125 @@ +import OAI.Analysis.IrrationalRotation.Operators.HyperinvariantProjection +import OAI.Analysis.IrrationalRotation.Analysis.UnitaryTransport +import OAI.Analysis.IrrationalRotation.Operators.CommutantAlgebra +import OAI.Analysis.IrrationalRotation.Spectral.QuasinilpotentNonscalar +import OAI.Analysis.IrrationalRotation.Model.Analytic +import OAI.Analysis.IrrationalRotation.Operators.HilbertModelSize +import Mathlib.MeasureTheory.Function.L2Space + +namespace OAI + +noncomputable section +namespace Invariant233 + +open scoped Topology +open TopologicalSpace + +variable {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [CompleteSpace E] [NormedAddCommGroup F] [InnerProductSpace ℂ F] + [CompleteSpace F] + +theorem no_hyperinvariant_subspace_of_no_invariant_projection + (M : VonNeumannAlgebra E) {T : E →L[ℂ] E} (hT : T ∈ M) + (hproj : ∀ p : E →L[ℂ] E, p ∈ M → IsStarProjection p → + (1 - p) * T * p = 0 → p = 0 ∨ p = 1) : + ∀ S : Submodule ℂ E, IsClosed (S : Set E) → + (∀ A : E →L[ℂ] E, Commute A T → ∀ x ∈ S, A x ∈ S) → S = ⊥ ∨ S = ⊤ := by + intro S hS hhyper + let : CompleteSpace S := hS.completeSpace_coe + have hhyper' : ∀ A : E →L[ℂ] E, Commute A T → S ∈ Module.End.invtSubmodule A := + hhyper + obtain ⟨hmem, hinv⟩ := hyperinvariant_subspace_projection_mem M hT S hhyper' + rcases hproj S.starProjection hmem isStarProjection_starProjection hinv with hzero | hone + · left + apply le_antisymm _ bot_le + intro x hx + have heq := Submodule.starProjection_eq_self_iff.mpr hx + simpa [hzero] using heq.symm + · right + apply le_antisymm le_top + intro x _ + apply Submodule.starProjection_eq_self_iff.mp + simp [hone] + +theorem hilbert_counterexample_of_factor_witness + [SeparableSpace E] [SeparableSpace F] + (hE : ¬ FiniteDimensional ℂ E) (hF : ¬ FiniteDimensional ℂ F) + (M : VonNeumannAlgebra E) {T : E →L[ℂ] E} (hT : T ∈ M) (hne : T ≠ 0) + (hquasi : Filter.Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) + Filter.atTop (𝓝 (0 : ℝ))) + (hproj : ∀ p : E →L[ℂ] E, p ∈ M → IsStarProjection p → + (1 - p) * T * p = 0 → p = 0 ∨ p = 1) : + ∃ T' : F →L[ℂ] F, T' ≠ 0 ∧ + Filter.Tendsto (fun n : ℕ => ‖T' ^ n‖ ^ (1 / (n : ℝ))) + Filter.atTop (𝓝 (0 : ℝ)) ∧ + (∀ S : Submodule ℂ F, IsClosed (S : Set F) → + (∀ A : F →L[ℂ] F, Commute A T' → ∀ x ∈ S, A x ∈ S) → S = ⊥ ∨ S = ⊤) := by + obtain ⟨e⟩ := UnitaryTransport.nonempty_linearIsometryEquiv hE hF + exact UnitaryTransport.transport_counterexample e T hne hquasi + (no_hyperinvariant_subspace_of_no_invariant_projection M hT hproj) + +theorem hasNoNontrivialHyperinvariantSubspace_of_no_invariant_projection + (M : VonNeumannAlgebra E) {T : E →L[ℂ] E} (hT : T ∈ M) + (hproj : ∀ p : E →L[ℂ] E, p ∈ M → IsStarProjection p → + (1 - p) * T * p = 0 → p = 0 ∨ p = 1) : + HasNoNontrivialHyperinvariantSubspace T := by + intro S hS + apply no_hyperinvariant_subspace_of_no_invariant_projection M hT hproj S hS.1 + intro A hA + apply hS.2 A + exact (operatorCommutant_mem_iff T A).2 hA.symm.eq + +theorem transitive_commutant_of_factor_witness + [SeparableSpace E] [SeparableSpace F] + (hE : ¬ FiniteDimensional ℂ E) (hF : ¬ FiniteDimensional ℂ F) + (M : VonNeumannAlgebra E) {T : E →L[ℂ] E} (hT : T ∈ M) (hne : T ≠ 0) + (hquasi : NormQuasinilpotent T) + (hproj : ∀ p : E →L[ℂ] E, p ∈ M → IsStarProjection p → + (1 - p) * T * p = 0 → p = 0 ∨ p = 1) : + ∃ T' : F →L[ℂ] F, T' ≠ 0 ∧ NormQuasinilpotent T' ∧ + HasNoNontrivialHyperinvariantSubspace T' ∧ + operatorCommutant T' ≠ ⊤ ∧ IsStronglyClosed (operatorCommutant T') ∧ + IsTransitive (operatorCommutant T') := by + classical + have : Nontrivial F := by + cases subsingleton_or_nontrivial F with + | inl h => + let : Subsingleton F := h + exact False.elim (hF inferInstance) + | inr h => exact h + obtain ⟨T', hne', hquasi', hhyper'⟩ := + hilbert_counterexample_of_factor_witness hE hF M hT hne hquasi hproj + have hnonscalar : ¬ ∃ c : ℂ, T' = c • (1 : F →L[ℂ] F) := by + rintro ⟨c, hc⟩ + exact InvariantProjection.continuousLinearMap_not_scalar_of_nonzero_norm_root_tendsto + hne' hquasi' c hc + have hhyper : HasNoNontrivialHyperinvariantSubspace T' := by + intro S hS + apply hhyper' S hS.1 + intro A hA + exact hS.2 A ((operatorCommutant_mem_iff T' A).2 hA.symm.eq) + obtain ⟨hproper, hclosed, htrans⟩ := commutant_algebra_properties T' hnonscalar + exact ⟨T', hne', hquasi', hhyper, hproper, hclosed, htrans.2 hhyper⟩ + +theorem transitive_commutant_of_circle_witness + [SeparableSpace F] (hF : ¬ FiniteDimensional ℂ F) + (M : VonNeumannAlgebra (MeasureTheory.Lp (lp (fun _ : ℤ => ℂ) 2) 2 circleMeasure)) + {T : (MeasureTheory.Lp (lp (fun _ : ℤ => ℂ) 2) 2 circleMeasure) →L[ℂ] + (MeasureTheory.Lp (lp (fun _ : ℤ => ℂ) 2) 2 circleMeasure)} + (hT : T ∈ M) (hne : T ≠ 0) (hquasi : NormQuasinilpotent T) + (hproj : ∀ p : (MeasureTheory.Lp (lp (fun _ : ℤ => ℂ) 2) 2 circleMeasure) →L[ℂ] + (MeasureTheory.Lp (lp (fun _ : ℤ => ℂ) 2) 2 circleMeasure), + p ∈ M → IsStarProjection p → (1 - p) * T * p = 0 → p = 0 ∨ p = 1) : + ∃ T' : F →L[ℂ] F, T' ≠ 0 ∧ NormQuasinilpotent T' ∧ + HasNoNontrivialHyperinvariantSubspace T' ∧ + operatorCommutant T' ≠ ⊤ ∧ IsStronglyClosed (operatorCommutant T') ∧ + IsTransitive (operatorCommutant T') := by + let := HilbertModelSize.circle_representation_separable + exact transitive_commutant_of_factor_witness + HilbertModelSize.circle_representation_not_finiteDimensional hF M hT hne hquasi hproj + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertEnergyCauchy.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertEnergyCauchy.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f6cc0e523f10f3b0b01c727b3fa41c31b6d1185 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertEnergyCauchy.lean @@ -0,0 +1,101 @@ +import Mathlib.Analysis.InnerProductSpace.Basic +import Mathlib.Topology.MetricSpace.Cauchy +import Mathlib.Topology.Order.MonotoneConvergence +import Mathlib.Tactic + +namespace OAI + +open Filter Set Topology +open scoped InnerProductSpace + +namespace Invariant233.HilbertEnergy + +section Normed + +variable {E : Type*} [SeminormedAddCommGroup E] {u : ℕ → E} + +theorem monotone_norm_sq_of_energy + (henergy : ∀ m n : ℕ, m ≤ n → + ‖u n - u m‖ ^ 2 = ‖u n‖ ^ 2 - ‖u m‖ ^ 2) : + Monotone (fun n => ‖u n‖ ^ 2) := by + intro m n hmn + have h := sq_nonneg ‖u n - u m‖ + rw [henergy m n hmn] at h + linarith + +theorem cauchySeq_of_energy + (hbdd : BddAbove (range (fun n => ‖u n‖ ^ 2))) + (henergy : ∀ m n : ℕ, m ≤ n → + ‖u n - u m‖ ^ 2 = ‖u n‖ ^ 2 - ‖u m‖ ^ 2) : + CauchySeq u := by + have hmono := monotone_norm_sq_of_energy henergy + have hc : CauchySeq (fun n => ‖u n‖ ^ 2) := + (tendsto_atTop_ciSup hmono hbdd).cauchySeq + rw [Metric.cauchySeq_iff] + intro ε hε + obtain ⟨N, hN⟩ := Metric.cauchySeq_iff.mp hc (ε ^ 2) (sq_pos_of_pos hε) + refine ⟨N, ?_⟩ + intro m hm n hn + have hd := hN m hm n hn + rw [Real.dist_eq] at hd + rw [dist_eq_norm] + have hsq : ‖u m - u n‖ ^ 2 < ε ^ 2 := by + rcases le_total m n with hmn | hnm + · rw [norm_sub_rev, henergy m n hmn] + have hle := hmono hmn + rw [abs_of_nonpos (sub_nonpos.mpr hle)] at hd + linarith + · rw [henergy n m hnm] + exact lt_of_le_of_lt (le_abs_self _) hd + nlinarith [norm_nonneg (u m - u n)] + +theorem exists_limit_of_energy [CompleteSpace E] + (hbdd : BddAbove (range (fun n => ‖u n‖ ^ 2))) + (henergy : ∀ m n : ℕ, m ≤ n → + ‖u n - u m‖ ^ 2 = ‖u n‖ ^ 2 - ‖u m‖ ^ 2) : + ∃ v : E, Tendsto u atTop (𝓝 v) := + cauchySeq_tendsto_of_complete (cauchySeq_of_energy hbdd henergy) + +theorem limit_norm_sq_eq_iSup + (hbdd : BddAbove (range (fun n => ‖u n‖ ^ 2))) + (henergy : ∀ m n : ℕ, m ≤ n → + ‖u n - u m‖ ^ 2 = ‖u n‖ ^ 2 - ‖u m‖ ^ 2) + {v : E} (hv : Tendsto u atTop (𝓝 v)) : + ‖v‖ ^ 2 = ⨆ n, ‖u n‖ ^ 2 := + tendsto_nhds_unique (hv.norm.pow 2) + (tendsto_atTop_ciSup (monotone_norm_sq_of_energy henergy) hbdd) + +end Normed + +section InnerProduct + +variable {𝕜 E : Type*} [RCLike 𝕜] + [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] {u : ℕ → E} + +theorem energy_of_inner + (hinner : ∀ m n : ℕ, m ≤ n → + RCLike.re (inner 𝕜 (u n) (u m)) = ‖u m‖ ^ 2) : + ∀ m n : ℕ, m ≤ n → ‖u n - u m‖ ^ 2 = ‖u n‖ ^ 2 - ‖u m‖ ^ 2 := by + intro m n hmn + rw [@norm_sub_sq 𝕜 E _ _ _ (u n) (u m), hinner m n hmn] + ring + +theorem cauchySeq_of_inner + (hbdd : BddAbove (range (fun n => ‖u n‖ ^ 2))) + (hinner : ∀ m n : ℕ, m ≤ n → + RCLike.re (inner 𝕜 (u n) (u m)) = ‖u m‖ ^ 2) : + CauchySeq u := + cauchySeq_of_energy hbdd (energy_of_inner hinner) + +theorem exists_limit_of_inner [CompleteSpace E] + (hbdd : BddAbove (range (fun n => ‖u n‖ ^ 2))) + (hinner : ∀ m n : ℕ, m ≤ n → + RCLike.re (inner 𝕜 (u n) (u m)) = ‖u m‖ ^ 2) : + ∃ v : E, Tendsto u atTop (𝓝 v) := + exists_limit_of_energy hbdd (energy_of_inner hinner) + +end InnerProduct + +end Invariant233.HilbertEnergy + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertModelSize.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertModelSize.lean new file mode 100644 index 0000000000000000000000000000000000000000..bef4db545dbdbfd62441fd2348a7a129049f5cad --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/HilbertModelSize.lean @@ -0,0 +1,92 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space +import OAI.Analysis.IrrationalRotation.Model.Analytic +import Mathlib.MeasureTheory.Measure.SeparableMeasure +import Mathlib.MeasureTheory.Function.LpSpace.Indicator + +namespace OAI + +noncomputable section +namespace Invariant233.HilbertModelSize + +open TopologicalSpace MeasureTheory +open scoped lp + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + +theorem separable_of_countable_hilbertBasis {ι : Type*} [Countable ι] + (b : HilbertBasis ι ℂ E) : SeparableSpace E := by + have hs : IsSeparable (Submodule.span ℂ (Set.range b) : Set E) := + (Set.countable_range b).isSeparable.span + have hc := hs.closure + have heq : closure (Submodule.span ℂ (Set.range b) : Set E) = Set.univ := by + change ((Submodule.span ℂ (Set.range b)).topologicalClosure : Set E) = Set.univ + rw [b.dense_span] + rfl + rw [heq] at hc + exact isSeparable_univ_iff.mp hc + +theorem separable_l2 (ι : Type*) [Countable ι] : SeparableSpace (ℓ²(ι, ℂ)) := + separable_of_countable_hilbertBasis (default : HilbertBasis ι ℂ (ℓ²(ι, ℂ))) + +theorem not_finiteDimensional_of_infinite_orthonormal {ι : Type*} [Infinite ι] + {v : ι → E} (hv : Orthonormal ℂ v) : ¬ FiniteDimensional ℂ E := by + intro h + let := h + have : Finite ι := hv.linearIndependent.finite + exact not_finite ι + +theorem not_finiteDimensional_l2 (ι : Type*) [Infinite ι] : + ¬ FiniteDimensional ℂ (ℓ²(ι, ℂ)) := + not_finiteDimensional_of_infinite_orthonormal + (default : HilbertBasis ι ℂ (ℓ²(ι, ℂ))).orthonormal + +section BochnerLp + +variable {X : Type*} [MeasurableSpace X] (μ : Measure X) [IsProbabilityMeasure μ] + +def constL2Isometry : E →ₗᵢ[ℂ] Lp E 2 μ where + toLinearMap := Lp.constₗ 2 μ ℂ + norm_map' x := by + change ‖Lp.const 2 μ x‖ = ‖x‖ + rw [Lp.norm_const' 2 μ x (by norm_num) (by norm_num)] + simp + +theorem not_finiteDimensional_L2 (hE : ¬ FiniteDimensional ℂ E) : + ¬ FiniteDimensional ℂ (Lp E 2 μ) := by + intro h + let := h + exact hE (FiniteDimensional.of_injective (constL2Isometry μ).toLinearMap + (constL2Isometry μ).injective) + +theorem separable_L2_l2 [MeasurableSpace.CountablyGenerated X] + (ι : Type*) [Countable ι] : SeparableSpace (Lp (ℓ²(ι, ℂ)) 2 μ) := by + let := separable_l2 ι + let : Fact ((2 : ENNReal) ≠ ⊤) := ⟨by norm_num⟩ + infer_instance + +theorem not_finiteDimensional_L2_l2 (ι : Type*) [Infinite ι] : + ¬ FiniteDimensional ℂ (Lp (ℓ²(ι, ℂ)) 2 μ) := + not_finiteDimensional_L2 μ (not_finiteDimensional_l2 ι) + +end BochnerLp + +theorem circleMeasure_isProbabilityMeasure : IsProbabilityMeasure circleMeasure := by + constructor + change (volume : Measure Circle) Set.univ = 1 + simp [AddCircle.measure_univ] + +theorem circle_representation_separable : + SeparableSpace (Lp (ℓ²(ℤ, ℂ)) 2 circleMeasure) := by + let := circleMeasure_isProbabilityMeasure + exact separable_L2_l2 circleMeasure ℤ + +theorem circle_representation_not_finiteDimensional : + ¬ FiniteDimensional ℂ (Lp (ℓ²(ℤ, ℂ)) 2 circleMeasure) := by + let := circleMeasure_isProbabilityMeasure + exact not_finiteDimensional_L2_l2 circleMeasure ℤ + +end Invariant233.HilbertModelSize + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/HyperfiniteCriterion.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/HyperfiniteCriterion.lean new file mode 100644 index 0000000000000000000000000000000000000000..66206fb6c8e725e8e4a5433e1fb3cff9b8786fe7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/HyperfiniteCriterion.lean @@ -0,0 +1,83 @@ +import OAI.Analysis.IrrationalRotation.Model.Hyperfinite +import OAI.Analysis.IrrationalRotation.Analysis.GeneratedVonNeumann +import OAI.Analysis.IrrationalRotation.Analysis.VonNeumannStrongClosure + +namespace OAI + +noncomputable section +open Filter +open scoped Topology + +namespace Invariant233.HyperfiniteCriterion + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +def asStrong (T : H →L[ℂ] H) : H →Lₚₜ[ℂ] H := + UniformConvergenceCLM.ofFun (RingHom.id ℂ) H {s : Set H | s.Finite} T + +omit [CompleteSpace H] in +@[simp] theorem underlying_asStrong (T : H →L[ℂ] H) : + strongOperatorUnderlying (asStrong T) = T := rfl + +omit [CompleteSpace H] in +@[simp] theorem asStrong_apply (T : H →L[ℂ] H) (x : H) : + asStrong T x = T x := rfl + +theorem mem_iSup_iff (A : ℕ → StarSubalgebra ℂ (H →L[ℂ] H)) + (hA : Monotone A) (T : H →L[ℂ] H) : + T ∈ iSup A ↔ ∃ n, T ∈ A n := by + change T ∈ (↑(iSup A) : Set (H →L[ℂ] H)) ↔ _ + rw [StarSubalgebra.coe_iSup_of_directed hA.directed_le] + exact Set.mem_iUnion + +theorem strong_union_eq (A : ℕ → StarSubalgebra ℂ (H →L[ℂ] H)) + (hA : Monotone A) : + {B : H →Lₚₜ[ℂ] H | ∃ n, strongOperatorUnderlying B ∈ A n} = + {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ iSup A} := by + ext B + exact (mem_iSup_iff A hA (strongOperatorUnderlying B)).symm + +theorem mem_strong_union_closure_of_tendsto + (A : ℕ → StarSubalgebra ℂ (H →L[ℂ] H)) + (T : ℕ → H →L[ℂ] H) (S : H →L[ℂ] H) + (hT : ∀ n, T n ∈ A n) + (hlim : ∀ x, Tendsto (fun n => T n x) atTop (𝓝 (S x))) : + asStrong S ∈ closure {B : H →Lₚₜ[ℂ] H | + ∃ n, strongOperatorUnderlying B ∈ A n} := by + have hstrong : Tendsto (fun n => asStrong (T n)) atTop (𝓝 (asStrong S)) := + PointwiseConvergenceCLM.tendsto_iff_forall_tendsto.mpr hlim + exact mem_closure_of_tendsto hstrong (Eventually.of_forall fun n => ⟨n, hT n⟩) + +theorem strong_union_closure_subset + (M : VonNeumannAlgebra H) (A : ℕ → StarSubalgebra ℂ (H →L[ℂ] H)) + (hAM : ∀ n, A n ≤ M.toStarSubalgebra) : + closure {B : H →Lₚₜ[ℂ] H | ∃ n, strongOperatorUnderlying B ∈ A n} ⊆ + {B : H →Lₚₜ[ℂ] H | strongOperatorUnderlying B ∈ M} := by + apply closure_minimal + · rintro B ⟨n, hn⟩ + exact hAM n hn + · exact vonNeumannAlgebra_stronglyClosed M + +theorem generated_iSup_eq_of_generator_approximation + (s : Set (H →L[ℂ] H)) (A : ℕ → StarSubalgebra ℂ (H →L[ℂ] H)) + (hAM : ∀ n, A n ≤ (vonNeumannGenerated s).toStarSubalgebra) + (hs : ∀ T ∈ s, asStrong T ∈ closure {B : H →Lₚₜ[ℂ] H | + ∃ n, strongOperatorUnderlying B ∈ A n}) : + vonNeumannGenerated (↑(iSup A) : Set (H →L[ℂ] H)) = vonNeumannGenerated s := by + apply le_antisymm + · apply vonNeumannGenerated_le + exact iSup_le hAM + · apply vonNeumannGenerated_le + intro T hT + have hinclude : ∀ n, A n ≤ + (vonNeumannGenerated (↑(iSup A) : Set (H →L[ℂ] H))).toStarSubalgebra := by + intro n S hS + exact subset_vonNeumannGenerated _ ((le_iSup A n) hS) + exact strong_union_closure_subset _ A hinclude (hs T hT) + +end Invariant233.HyperfiniteCriterion + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/HyperinvariantProjection.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/HyperinvariantProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..4d1e93a691bcc5cdb6d37adfbf5a6ba2a2075ca0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/HyperinvariantProjection.lean @@ -0,0 +1,69 @@ +import Mathlib.Analysis.VonNeumannAlgebra.Basic + +namespace OAI + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem hyperinvariant_projection_mem + (M : VonNeumannAlgebra H) {T p : H →L[ℂ] H} + (hT : T ∈ M) (hp : IsStarProjection p) + (hhyper : ∀ A : H →L[ℂ] H, Commute A T → + p.range ∈ Module.End.invtSubmodule A) : + p ∈ M ∧ (1 - p) * T * p = 0 := by + constructor + · apply (VonNeumannAlgebra.IsStarProjection.mem_iff hp M).2 + intro A hA + apply hhyper A + exact (VonNeumannAlgebra.mem_commutant_iff.mp hA T hT).symm + · have h := (ContinuousLinearMap.IsIdempotentElem.range_mem_invtSubmodule_iff + hp.isIdempotentElem).mp + (hhyper T (Commute.refl T)) + change p * T * p = T * p at h + rw [sub_mul, one_mul, sub_mul, h, sub_self] + +theorem hyperinvariant_subspace_projection_mem + (M : VonNeumannAlgebra H) {T : H →L[ℂ] H} + (hT : T ∈ M) (S : Submodule ℂ H) [S.HasOrthogonalProjection] + (hhyper : ∀ A : H →L[ℂ] H, Commute A T → + S ∈ Module.End.invtSubmodule A) : + S.starProjection ∈ M ∧ (1 - S.starProjection) * T * S.starProjection = 0 := by + apply hyperinvariant_projection_mem M hT isStarProjection_starProjection + simpa only [Submodule.range_starProjection] using hhyper + +theorem hyperinvariant_subspace_trivial + (M : VonNeumannAlgebra H) {T : H →L[ℂ] H} (hT : T ∈ M) + (htrivial : ∀ p : H →L[ℂ] H, p ∈ M → IsStarProjection p → + (1 - p) * T * p = 0 → p = 0 ∨ p = 1) + (S : Submodule ℂ H) [S.HasOrthogonalProjection] + (hhyper : ∀ A : H →L[ℂ] H, Commute A T → + S ∈ Module.End.invtSubmodule A) : S = ⊥ ∨ S = ⊤ := by + obtain ⟨hmem, hinv⟩ := hyperinvariant_subspace_projection_mem M hT S hhyper + rcases htrivial S.starProjection hmem isStarProjection_starProjection hinv with h0 | h1 + · left + apply le_antisymm ?_ bot_le + intro x hx + change x = 0 + have h := (S.starProjection_eq_self_iff).mpr hx + simpa only [h0, zero_apply] using h.symm + · right + apply Submodule.eq_top_iff'.mpr + intro x + have h := Submodule.starProjection_apply_mem S x + simpa only [h1, one_apply_eq_self] using h + +theorem closed_hyperinvariant_subspace_trivial + (M : VonNeumannAlgebra H) {T : H →L[ℂ] H} (hT : T ∈ M) + (htrivial : ∀ p : H →L[ℂ] H, p ∈ M → IsStarProjection p → + (1 - p) * T * p = 0 → p = 0 ∨ p = 1) + (S : ClosedSubmodule ℂ H) + (hhyper : ∀ A : H →L[ℂ] H, Commute A T → + S.toSubmodule ∈ Module.End.invtSubmodule A) : + S.toSubmodule = ⊥ ∨ S.toSubmodule = ⊤ := by + exact hyperinvariant_subspace_trivial M hT htrivial S.toSubmodule hhyper + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/InvariantTraceTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/InvariantTraceTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..1be819e52a48b4a20f08d800e9b587d6d184fa80 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/InvariantTraceTransport.lean @@ -0,0 +1,58 @@ +import OAI.Analysis.IrrationalRotation.Operators.NormalTraceProjectionRigidity + +namespace OAI + +noncomputable section +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem NormalTraceProjectionRigidity.hasOnlyTrivialInvariantProjections_smul_iff + (M : VonNeumannAlgebra H) + (T : H →L[ℂ] H) {c : ℂ} (hc : c ≠ 0) : + HasOnlyTrivialInvariantProjections M (c • T) ↔ + HasOnlyTrivialInvariantProjections M T := by + have hinv (p : H →L[ℂ] H) : (1 - p) * (c • T) * p = 0 ↔ + (1 - p) * T * p = 0 := by + simp only [mul_smul_comm, smul_mul_assoc, smul_eq_zero, hc, false_or] + constructor + · intro h p hpm hp hT + exact h p hpm hp ((hinv p).mpr hT) + · intro h p hpm hp hT + exact h p hpm hp ((hinv p).mp hT) + +theorem hasOnlyTrivialInvariantProjections_of_trace_transport + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) (A B : M) + (hB : HasOnlyTrivialInvariantProjections M (B : H →L[ℂ] H)) + (htransport : ∀ p : M, IsStarProjection (p : H →L[ℂ] H) → + (1 - (p : H →L[ℂ] H)) * (A : H →L[ℂ] H) * (p : H →L[ℂ] H) = 0 → + ∃ P : M, IsStarProjection (P : H →L[ℂ] H) ∧ + (1 - (P : H →L[ℂ] H)) * (B : H →L[ℂ] H) * (P : H →L[ℂ] H) = 0 ∧ + τ P = τ p) : + HasOnlyTrivialInvariantProjections M (A : H →L[ℂ] H) := by + intro p hpm hp hinv + let p' : M := ⟨p, hpm⟩ + obtain ⟨P, hP, hPinv, htrace⟩ := htransport p' hp hinv + have htrivP := hB (P : H →L[ℂ] H) P.property hP hPinv + have hnontriv := NormalTraceProjectionRigidity.nontrivial_iff_of_trace_eq + τ hτ hp hP htrace.symm + by_contra hpnontriv + push Not at hpnontriv + have hp' : p' ≠ 0 ∧ p' ≠ 1 := by + constructor + · intro h + exact hpnontriv.1 (congrArg Subtype.val h) + · intro h + exact hpnontriv.2 (congrArg Subtype.val h) + have hP' := hnontriv.mp hp' + rcases htrivP with hz | ho + · exact hP'.1 (Subtype.ext hz) + · exact hP'.2 (Subtype.ext ho) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/InverseAffiliation.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/InverseAffiliation.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b5347d2d7c08341ad9b14592d54ccb1d706f540 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/InverseAffiliation.lean @@ -0,0 +1,40 @@ +import OAI.Analysis.IrrationalRotation.Operators.NormalAffiliatedTransport + +namespace OAI + +noncomputable section + +namespace Invariant233 + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [CompleteSpace E] + +theorem IsAffiliated.inverse + {M : VonNeumannAlgebra E} {H : E →ₗ.[ℂ] E} (hH : IsAffiliated M H) + (hinj : Function.Injective H) : IsAffiliated M H.inverse := by + have hker : H.toFun.ker = ⊥ := LinearMap.ker_eq_bot.mpr hinj + have hpartialker : H.ker = ⊥ := by simp [LinearPMap.ker, hker] + intro U hU + have hgraph : ∀ y : H.inverse.domain, + ((U : E →L[ℂ] E) (y : E), (U : E →L[ℂ] E) (H.inverse y)) ∈ + H.inverse.graph := by + intro y + have hy : (y : E) ∈ H.toFun.range := by + simpa only [LinearPMap.inverse_domain] using y.property + obtain ⟨x, hx⟩ := hy + have hxy : H x = (y : E) := hx + have hyx : H.inverse y = (x : E) := LinearPMap.inverse_apply_eq hpartialker hxy + obtain ⟨hD, hC⟩ := hH.commutes_of_mem_commutant hU + rw [hyx, ← hxy, ← hC x] + exact LinearPMap.mem_inverse_graph hpartialker ⟨(U : E →L[ℂ] E) x, hD x⟩ + let hD : ∀ y : H.inverse.domain, (U : E →L[ℂ] E) (y : E) ∈ H.inverse.domain := + fun y => LinearPMap.mem_domain_of_mem_graph (hgraph y) + refine ⟨hD, fun y => ?_⟩ + exact H.inverse.mem_graph_snd_inj (H.inverse.mem_graph ⟨(U : E →L[ℂ] E) y, hD y⟩) + (hgraph y) rfl + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/JointEigenprojection.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/JointEigenprojection.lean new file mode 100644 index 0000000000000000000000000000000000000000..587792f6b68b3d86e5f4e0bfb9147c99e93b0038 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/JointEigenprojection.lean @@ -0,0 +1,129 @@ +import OAI.Analysis.IrrationalRotation.Model.JointEigenspace +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties +import OAI.Analysis.IrrationalRotation.Analysis.GeneratedVonNeumann + +namespace OAI + +noncomputable section +namespace Invariant233 + +variable {ι H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +omit [CompleteSpace H] in +@[simp] +theorem mem_jointEigenspace {D : ι → H →L[ℂ] H} {ev : ι → ℂ} {x : H} : + x ∈ jointEigenspace D ev ↔ ∀ i, D i x = ev i • x := by + simp [jointEigenspace] + +omit [CompleteSpace H] in + +theorem map_mem_jointEigenspace {D : ι → H →L[ℂ] H} {ev : ι → ℂ} + {T : H →L[ℂ] H} (hT : ∀ i, Commute (D i) T) + {x : H} (hx : x ∈ jointEigenspace D ev) : T x ∈ jointEigenspace D ev := by + rw [mem_jointEigenspace] at hx ⊢ + intro i + calc + D i (T x) = T (D i x) := DFunLike.congr_fun (hT i).eq x + _ = ev i • T x := by rw [hx i, map_smul] + +theorem commute_starProjection_of_reducing (K : Submodule ℂ H) + [K.HasOrthogonalProjection] (T : H →L[ℂ] H) + (hT : ∀ x ∈ K, T x ∈ K) (hTstar : ∀ x ∈ K, star T x ∈ K) : + Commute K.starProjection T := by + apply ContinuousLinearMap.ext + intro x + change K.starProjection (T x) = T (K.starProjection x) + apply Submodule.eq_starProjection_of_mem_orthogonal + · apply hT + exact Submodule.coe_mem (K.orthogonalProjectionOnto x) + · have horth : Kᗮ ∈ Module.End.invtSubmodule T.toLinearMap := + ContinuousLinearMap.orthogonal_mem_invtSubmodule hTstar + rw [Module.End.mem_invtSubmodule_iff_forall_mem_of_mem] at horth + rw [← map_sub] + exact horth _ (K.sub_starProjection_mem_orthogonal x) + +@[simp] +theorem isStarProjection_jointEigenprojection (D : ι → H →L[ℂ] H) (ev : ι → ℂ) : + IsStarProjection (jointEigenprojection D ev) := + isStarProjection_starProjection + +theorem jointEigenprojection_mem_generated (D : ι → H →L[ℂ] H) (ev : ι → ℂ) : + jointEigenprojection D ev ∈ vonNeumannGenerated (Set.range D) := by + rw [VonNeumannAlgebra.IsStarProjection.mem_iff + (isStarProjection_jointEigenprojection D ev)] + intro T hT + change (jointEigenspace D ev).starProjection.range ∈ Module.End.invtSubmodule T + rw [Submodule.range_starProjection] + rw [Module.End.mem_invtSubmodule_iff_forall_mem_of_mem] + apply map_mem_jointEigenspace + intro i + exact ((mem_commutant_vonNeumannGenerated_iff _ T).mp hT (D i) ⟨i, rfl⟩).1 + +theorem jointEigenprojection_mem_commutant (D : ι → H →L[ℂ] H) (ev : ι → ℂ) + (hD : ∀ i, IsSelfAdjoint (D i)) : + jointEigenprojection D ev ∈ (vonNeumannGenerated (Set.range D)).commutant := by + rw [mem_commutant_vonNeumannGenerated_iff] + rintro _ ⟨i, rfl⟩ + have h : Commute (jointEigenprojection D ev) (D i) := by + apply commute_starProjection_of_reducing + · intro x hx + rw [(mem_jointEigenspace.mp hx) i] + exact (jointEigenspace D ev).smul_mem _ hx + · intro x hx + rw [(hD i).star_eq, (mem_jointEigenspace.mp hx) i] + exact (jointEigenspace D ev).smul_mem _ hx + exact ⟨h.eq.symm, by simpa only [(hD i).star_eq] using h.eq.symm⟩ + +theorem exists_mul_jointEigenprojection_ne_zero {A : Type*} + (D : ι → H →L[ℂ] H) (ev : A → ι → ℂ) + (hdense : (⨆ a, jointEigenspace D (ev a)).topologicalClosure = ⊤) + (p : H →L[ℂ] H) (hp : p ≠ 0) : + ∃ a, p * jointEigenprojection D (ev a) ≠ 0 := by + by_contra! h + apply hp + have hker : (⨆ a, jointEigenspace D (ev a)) ≤ p.ker := by + apply iSup_le + intro a x hx + change p x = 0 + have hxq : jointEigenprojection D (ev a) x = x := + Submodule.starProjection_eq_self_iff.mpr hx + have heq := DFunLike.congr_fun (h a) x + simpa only [mul_apply_eq_comp, hxq, zero_apply] using heq + have htop : (⊤ : Submodule ℂ H) ≤ p.ker := by + rw [← hdense] + exact Submodule.topologicalClosure_minimal _ hker p.isClosed_ker + ext x + exact htop (Submodule.mem_top : x ∈ (⊤ : Submodule ℂ H)) + +theorem atomic_generated_of_jointEigenprojection_atoms {A : Type*} + (D : ι → H →L[ℂ] H) (ev : A → ι → ℂ) + (hD : ∀ i, IsSelfAdjoint (D i)) + (hdense : (⨆ a, jointEigenspace D (ev a)).topologicalClosure = ⊤) + (hatom : ∀ a, jointEigenprojection D (ev a) ≠ 0 → + IsProjectionAtom (vonNeumannGenerated (Set.range D)) (jointEigenprojection D (ev a))) : + IsAtomicVonNeumannAlgebra (vonNeumannGenerated (Set.range D)) := by + intro p hp hpp hp0 + obtain ⟨a, ha⟩ := exists_mul_jointEigenprojection_ne_zero D ev hdense p hp0 + let q := jointEigenprojection D (ev a) + have hqm : q ∈ vonNeumannGenerated (Set.range D) := jointEigenprojection_mem_generated D _ + have hqp : IsStarProjection q := isStarProjection_jointEigenprojection D _ + have hq0 : q ≠ 0 := by + intro hq + apply ha + change p * q = 0 + rw [hq, mul_zero] + have hpq : Commute p q := + VonNeumannAlgebra.mem_commutant_iff.mp (jointEigenprojection_mem_commutant D _ hD) p hp + have hqa := hatom a hq0 + have hpqq : (p * q) * q = p * q := by + rw [mul_assoc, hqp.isIdempotentElem.eq] + have hpeq : p * q = q := + (hqa.2.2.2 (p * q) (mul_mem hp hqm) (hpp.mul hqp hpq) hpqq).resolve_left ha + exact ⟨q, hqa, hpq.eq.symm.trans hpeq⟩ + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/JointEigenspaceAlgebra.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/JointEigenspaceAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..ae77bfe9a960d5bdeb2c9e865219c29ff0259f9d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/JointEigenspaceAlgebra.lean @@ -0,0 +1,226 @@ +import Mathlib.LinearAlgebra.Eigenspace.ContinuousLinearMap +import Mathlib.Analysis.InnerProductSpace.StarOrder +import Mathlib.Analysis.CStarAlgebra.Projection +import Mathlib.Analysis.InnerProductSpace.Adjoint +import Mathlib.Analysis.InnerProductSpace.Dual +import Mathlib.Analysis.VonNeumannAlgebra.Basic + +namespace OAI + +open InnerProductSpace + +namespace Invariant233.JointEigenspaceAlgebra + +variable {H I : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem commute_rankOne_of_same_eigenvalue + {A : H →L[ℂ] H} (hA : IsSelfAdjoint A) {eig : ℝ} {x y : H} + (hx : A x = (eig : ℂ) • x) (hy : A y = (eig : ℂ) • y) : + Commute A (rankOne ℂ x y) := by + apply ContinuousLinearMap.ext + intro z + change A (rankOne ℂ x y z) = rankOne ℂ x y (A z) + rw [rankOne_apply, rankOne_apply, map_smul, hx] + have hadj : A.adjoint = A := hA.star_eq + rw [← A.adjoint_inner_left z y, hadj, hy, inner_smul_left] + simp only [Complex.conj_ofReal, smul_smul] + rw [mul_comm] + +theorem exists_scalar_on_common_eigenspace + (A : I → H →L[ℂ] H) (hA : ∀ i, IsSelfAdjoint (A i)) + (eig : I → ℝ) (K : Submodule ℂ H) + (hK : ∀ i, ∀ x ∈ K, A i x = (eig i : ℂ) • x) + {B : H →L[ℂ] H} + (hB : B ∈ Set.centralizer (Set.centralizer (Set.range A))) : + ∃ c : ℂ, ∀ x ∈ K, B x = c • x := by + classical + by_cases hK0 : K = ⊥ + · refine ⟨0, ?_⟩ + intro x hx + have hx0 : x = 0 := by simpa [hK0] using hx + simp [hx0] + · obtain ⟨x, hxK, hx0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot hK0 + let d : ℂ := inner ℂ x x + have hd : d ≠ 0 := by + dsimp [d] + exact inner_self_ne_zero.mpr hx0 + refine ⟨inner ℂ x (B x) / d, ?_⟩ + intro y hyK + have hrank : rankOne ℂ y x ∈ Set.centralizer (Set.range A) := by + intro C hC + obtain ⟨i, rfl⟩ := hC + exact (commute_rankOne_of_same_eigenvalue (hA i) (hK i y hyK) (hK i x hxK)).eq + have hcomm := hB (rankOne ℂ y x) hrank + have heq : d • B y = inner ℂ x (B x) • y := by + have heval := congrArg (fun C : H →L[ℂ] H => C x) hcomm + simpa only [mul_apply_eq_comp, rankOne_apply, map_smul] using heval.symm + calc + B y = d⁻¹ • (d • B y) := by simp [hd] + _ = d⁻¹ • (inner ℂ x (B x) • y) := by rw [heq] + _ = (inner ℂ x (B x) / d) • y := by + rw [smul_smul, div_eq_mul_inv, mul_comm] + +theorem commute_starProjection_of_maps + (K : Submodule ℂ H) [K.HasOrthogonalProjection] (B : H →L[ℂ] H) + (hB : ∀ x ∈ K, B x ∈ K) (hBstar : ∀ x ∈ K, B.adjoint x ∈ K) : + Commute K.starProjection B := by + apply ContinuousLinearMap.ext + intro z + change K.starProjection (B z) = B (K.starProjection z) + apply Submodule.eq_starProjection_of_mem_orthogonal + (hB _ (K.starProjection_apply_mem z)) + rw [← map_sub] + apply (Submodule.mem_orthogonal K _).2 + intro x hx + rw [← B.adjoint_inner_left] + exact (Submodule.mem_orthogonal K _).1 (K.sub_starProjection_mem_orthogonal z) + _ (hBstar x hx) + +omit [CompleteSpace H] in + +theorem common_eigenspace_mapsTo + (A : I → H →L[ℂ] H) (eig : I → ℝ) (K : Submodule ℂ H) + (hK : ∀ x, x ∈ K ↔ ∀ i, A i x = (eig i : ℂ) • x) + {B : H →L[ℂ] H} (hB : B ∈ Set.centralizer (Set.range A)) : + ∀ x ∈ K, B x ∈ K := by + intro x hx + apply (hK _).2 + intro i + have hcomm := hB (A i) (Set.mem_range_self i) + have heval := congrArg (fun C : H →L[ℂ] H => C x) hcomm + change A i (B x) = B (A i x) at heval + rw [heval, (hK x).1 hx i, map_smul] + +theorem common_eigenspace_projection_mem_bicommutant + (A : I → H →L[ℂ] H) (hA : ∀ i, IsSelfAdjoint (A i)) + (eig : I → ℝ) (K : Submodule ℂ H) [K.HasOrthogonalProjection] + (hK : ∀ x, x ∈ K ↔ ∀ i, A i x = (eig i : ℂ) • x) : + K.starProjection ∈ Set.centralizer (Set.centralizer (Set.range A)) := by + intro B hB + have hstar : star B ∈ Set.centralizer (Set.range A) := by + apply Set.star_mem_centralizer' _ hB + intro C hC + obtain ⟨i, rfl⟩ := hC + rw [(hA i).star_eq] + exact Set.mem_range_self i + exact (commute_starProjection_of_maps K B + (common_eigenspace_mapsTo A eig K hK hB) + (common_eigenspace_mapsTo A eig K hK hstar)).eq.symm + +theorem eq_zero_or_eq_joint_projection_of_le + (A : I → H →L[ℂ] H) (hA : ∀ i, IsSelfAdjoint (A i)) + (eig : I → ℝ) (K : Submodule ℂ H) [K.HasOrthogonalProjection] + (hK : ∀ i, ∀ x ∈ K, A i x = (eig i : ℂ) • x) + {q : H →L[ℂ] H} (hq : IsStarProjection q) + (hqmem : q ∈ Set.centralizer (Set.centralizer (Set.range A))) + (hle : q ≤ K.starProjection) : q = 0 ∨ q = K.starProjection := by + have hp : IsStarProjection K.starProjection := isStarProjection_starProjection + by_cases hp0 : K.starProjection = 0 + · left + exact le_antisymm (hp0 ▸ hle) hq.nonneg + · obtain ⟨c, hc⟩ := exists_scalar_on_common_eigenspace A hA eig K hK hqmem + have hqp : q * K.starProjection = q := (hq.le_iff_mul_eq_left hp).1 hle + have hqeq : q = c • K.starProjection := by + rw [← hqp] + apply ContinuousLinearMap.ext + intro x + exact hc _ (K.starProjection_apply_mem x) + have hscalar : (c * c) • K.starProjection = c • K.starProjection := by + have hidem := hq.isIdempotentElem.eq + rw [hqeq] at hidem + simpa only [smul_mul_assoc, mul_smul_comm, smul_smul, + K.isIdempotentElem_starProjection.eq] using hidem + have hcid : IsIdempotentElem c := smul_left_injective ℂ hp0 hscalar + rcases IsIdempotentElem.iff_eq_zero_or_one.1 hcid with hc0 | hc1 + · left + simpa [hc0] using hqeq + · right + simpa [hc1] using hqeq + +theorem exists_minimal_projection_below_of_joint_eigenspaces + {J : Type*} (A : I → H →L[ℂ] H) (hA : ∀ i, IsSelfAdjoint (A i)) + (eig : J → I → ℝ) (K : J → Submodule ℂ H) + [∀ j, (K j).HasOrthogonalProjection] + (hK : ∀ j x, x ∈ K j ↔ ∀ i, A i x = (eig j i : ℂ) • x) + (hdense : (⨆ j, K j).topologicalClosure = ⊤) + {q : H →L[ℂ] H} (hq : IsStarProjection q) (hq0 : q ≠ 0) + (hqmem : q ∈ Set.centralizer (Set.centralizer (Set.range A))) : + ∃ j, (K j).starProjection ≠ 0 ∧ + (K j).starProjection ∈ Set.centralizer (Set.centralizer (Set.range A)) ∧ + (K j).starProjection ≤ q ∧ + ∀ r : H →L[ℂ] H, IsStarProjection r → + r ∈ Set.centralizer (Set.centralizer (Set.range A)) → + r ≤ (K j).starProjection → r = 0 ∨ r = (K j).starProjection := by + classical + have hex : ∃ j, ∃ x ∈ K j, q x ≠ 0 := by + by_contra! hzero + have hle : (⨆ j, K j) ≤ q.ker := by + apply iSup_le + intro j x hx + exact hzero j x hx + have hclosed : (⨆ j, K j).topologicalClosure ≤ q.ker := + (⨆ j, K j).topologicalClosure_minimal hle q.isClosed_ker + rw [hdense] at hclosed + apply hq0 + apply ContinuousLinearMap.ext + intro x + exact hclosed (Submodule.mem_top) + obtain ⟨j, x, hxK, hqx⟩ := hex + have hx0 : x ≠ 0 := by + intro hx + exact hqx (by simp [hx]) + obtain ⟨c, hc⟩ := exists_scalar_on_common_eigenspace A hA (eig j) (K j) + (fun i y hy => (hK j y).1 hy i) hqmem + have hcid : IsIdempotentElem c := by + have hidem := congrArg (fun B : H →L[ℂ] H => B x) hq.isIdempotentElem.eq + change q (q x) = q x at hidem + rw [hc x hxK, map_smul, hc x hxK, smul_smul] at hidem + exact smul_left_injective ℂ hx0 hidem + have hc1 : c = 1 := by + rcases IsIdempotentElem.iff_eq_zero_or_one.1 hcid with hc0 | hc1 + · exact False.elim (hqx (by simp [hc x hxK, hc0])) + · exact hc1 + refine ⟨j, ?_, common_eigenspace_projection_mem_bicommutant A hA _ _ (hK j), ?_, ?_⟩ + · intro hpzero + have hpx : (K j).starProjection x = x := + (K j).starProjection_eq_self_iff.2 hxK + rw [hpzero] at hpx + exact hx0 hpx.symm + · apply (isStarProjection_starProjection.le_iff_mul_eq_right hq).2 + apply ContinuousLinearMap.ext + intro y + change q ((K j).starProjection y) = (K j).starProjection y + simpa [hc1] using hc _ ((K j).starProjection_apply_mem y) + · intro r hr hrmem hrle + exact eq_zero_or_eq_joint_projection_of_le A hA (eig j) (K j) + (fun i y hy => (hK j y).1 hy i) hr hrmem hrle + +theorem atomic_bicommutant_of_dense_joint_eigenspaces + {J : Type*} (A : I → H →L[ℂ] H) (hA : ∀ i, IsSelfAdjoint (A i)) + (eig : J → I → ℝ) + (hdense : (⨆ j, ⨅ i, Module.End.eigenspace (A i).toLinearMap (eig j i : ℂ)).topologicalClosure = ⊤) + {q : H →L[ℂ] H} (hq : IsStarProjection q) (hq0 : q ≠ 0) + (hqmem : q ∈ Set.centralizer (Set.centralizer (Set.range A))) : + ∃ p : H →L[ℂ] H, IsStarProjection p ∧ p ≠ 0 ∧ + p ∈ Set.centralizer (Set.centralizer (Set.range A)) ∧ p ≤ q ∧ + ∀ r : H →L[ℂ] H, IsStarProjection r → + r ∈ Set.centralizer (Set.centralizer (Set.range A)) → + r ≤ p → r = 0 ∨ r = p := by + let K : J → Submodule ℂ H := fun j => + ⨅ i, Module.End.eigenspace (A i).toLinearMap (eig j i : ℂ) + have hclosed : ∀ j, IsClosed ((K j : Submodule ℂ H) : Set H) := by + intro j + simp only [K, Submodule.coe_iInf] + exact isClosed_iInter fun i => (A i).isClosed_eigenspace (eig j i : ℂ) + let : ∀ j, CompleteSpace (K j) := fun j => (hclosed j).completeSpace_coe + have hK : ∀ j x, x ∈ K j ↔ ∀ i, A i x = (eig j i : ℂ) • x := by + intro j x + simp only [K, Submodule.mem_iInf, Module.End.mem_eigenspace_iff, + ContinuousLinearMap.coe_coe] + obtain ⟨j, hp0, hpmem, hple, hpmin⟩ := + exists_minimal_projection_below_of_joint_eigenspaces A hA eig K hK hdense hq hq0 hqmem + exact ⟨(K j).starProjection, isStarProjection_starProjection, hp0, hpmem, hple, hpmin⟩ + +end Invariant233.JointEigenspaceAlgebra + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/JointProjectionAtomic.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/JointProjectionAtomic.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e103d021b1ba1df0bfd6006aa14eac3d276d120 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/JointProjectionAtomic.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.IrrationalRotation.Operators.JointEigenprojection +import OAI.Analysis.IrrationalRotation.Operators.JointEigenspaceAlgebra +import Mathlib.Analysis.InnerProductSpace.Spectrum + +namespace OAI + +noncomputable section +open scoped Pointwise + +namespace Invariant233 + +variable {ι H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem coe_generated_range_selfAdjoint (D : ι → H →L[ℂ] H) + (hD : ∀ i, IsSelfAdjoint (D i)) : + (vonNeumannGenerated (Set.range D) : Set (H →L[ℂ] H)) = + Set.centralizer (Set.centralizer (Set.range D)) := by + rw [coe_vonNeumannGenerated] + have hstar : star (Set.range D) ⊆ Set.range D := by + intro T hT + change star T ∈ Set.range D at hT + obtain ⟨i, hi⟩ := hT + refine ⟨i, ?_⟩ + calc + D i = star (D i) := (hD i).star_eq.symm + _ = T := by rw [hi, star_star] + rw [Set.union_eq_left.mpr hstar] + +theorem jointEigenprojection_isProjectionAtom (D : ι → H →L[ℂ] H) + (hD : ∀ i, IsSelfAdjoint (D i)) (ev : ι → ℂ) + (hp0 : jointEigenprojection D ev ≠ 0) : + IsProjectionAtom (vonNeumannGenerated (Set.range D)) (jointEigenprojection D ev) := by + have hK0 : jointEigenspace D ev ≠ ⊥ := by + intro hK + apply hp0 + ext x + have hx := (jointEigenspace D ev).starProjection_apply_mem x + change (jointEigenspace D ev).starProjection x = 0 + exact (le_of_eq hK) hx + obtain ⟨x, hxK, hx0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot hK0 + have hreal : ∀ i, ((ev i).re : ℂ) = ev i := by + intro i + apply Complex.conj_eq_iff_re.mp + apply (hD i).isSymmetric.conj_eigenvalue_eq_self + apply Module.End.hasEigenvalue_of_hasEigenvector + exact ⟨Module.End.mem_eigenspace_iff.mpr ((mem_jointEigenspace.mp hxK) i), hx0⟩ + refine ⟨jointEigenprojection_mem_generated D ev, + isStarProjection_jointEigenprojection D ev, hp0, ?_⟩ + intro q hqm hqp hle + apply JointEigenspaceAlgebra.eq_zero_or_eq_joint_projection_of_le + D hD (fun i => (ev i).re) (jointEigenspace D ev) + · intro i y hy + rw [hreal i] + exact (mem_jointEigenspace.mp hy) i + · exact hqp + · change q ∈ (vonNeumannGenerated (Set.range D) : Set (H →L[ℂ] H)) at hqm + rwa [coe_generated_range_selfAdjoint D hD] at hqm + · exact (hqp.le_iff_mul_eq_left (isStarProjection_jointEigenprojection D ev)).mpr hle + +theorem atomic_generated_of_dense_jointEigenspaces {A : Type*} + (D : ι → H →L[ℂ] H) (ev : A → ι → ℂ) + (hD : ∀ i, IsSelfAdjoint (D i)) + (hdense : (⨆ a, jointEigenspace D (ev a)).topologicalClosure = ⊤) : + IsAtomicVonNeumannAlgebra (vonNeumannGenerated (Set.range D)) := by + apply atomic_generated_of_jointEigenprojection_atoms D ev hD hdense + intro a + exact jointEigenprojection_isProjectionAtom D hD (ev a) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/LpOperatorExt.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/LpOperatorExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..20a5ced5830ad7a11a8a5370a3a5241ce705ba08 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/LpOperatorExt.lean @@ -0,0 +1,64 @@ +import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp +import Mathlib.Analysis.InnerProductSpace.l2Space + +namespace OAI + +namespace Invariant233.Fields + +open MeasureTheory +open scoped ENNReal + +variable {X E F : Type*} [MeasurableSpace X] [NormedAddCommGroup E] + [NormedSpace ℂ E] [NormedAddCommGroup F] [NormedSpace ℂ F] + {μ : Measure X} {p : ℝ≥0∞} [Fact (1 ≤ p)] + +theorem lp_operator_ext_indicator (hp : p ≠ ∞) + (A B : Lp E p μ →L[ℂ] F) + (h : ∀ (v : E) (s : Set X) (hs : MeasurableSet s) (hμs : μ s ≠ ∞), + A (indicatorConstLp p hs hμs v) = B (indicatorConstLp p hs hμs v)) : + A = B := by + ext f + apply Lp.induction hp (fun g => A g = B g) _ _ _ f + · intro v s hs hμs + exact h v s hs hμs.ne + · intro g k hg hk hdis hAg hAk + simp only [map_add, hAg, hAk] + · exact isClosed_eq A.continuous B.continuous + +noncomputable def indicatorConstLpCLM (s : Set X) (hs : MeasurableSet s) + (hμs : μ s ≠ ∞) : E →L[ℂ] Lp E p μ := + LinearMap.mkContinuous + { toFun := indicatorConstLp p hs hμs + map_add' := fun v w => (indicatorConstLp_add (c := v) (c' := w)).symm + map_smul' := by + intro c v + simp only [indicatorConstLp, ← MemLp.toLp_const_smul] + apply MemLp.toLp_congr + exact Filter.Eventually.of_forall fun x => by + simp only [RingHom.id_apply, Pi.smul_apply, Set.indicator_smul_apply] } + (μ.real s ^ (1 / p.toReal)) + (fun v => by + change ‖indicatorConstLp p hs hμs v‖ ≤ μ.real s ^ (1 / p.toReal) * ‖v‖ + simpa only [mul_comm] using + (norm_indicatorConstLp_le (p := p) (hs := hs) (hμs := hμs) (c := v))) + +theorem lp_operator_ext_basis_indicator {H ι : Type*} + [NormedAddCommGroup H] [InnerProductSpace ℂ H] + (e : HilbertBasis ι ℂ H) (hp : p ≠ ∞) + (A B : Lp H p μ →L[ℂ] F) + (h : ∀ (i : ι) (s : Set X) (hs : MeasurableSet s) (hμs : μ s ≠ ∞), + A (indicatorConstLp p hs hμs (e i)) = + B (indicatorConstLp p hs hμs (e i))) : A = B := by + apply lp_operator_ext_indicator hp A B + intro v s hs hμs + let C : H →L[ℂ] Lp H p μ := indicatorConstLpCLM s hs hμs + have hAC : A.comp C = B.comp C := by + apply ContinuousLinearMap.ext_on + (Submodule.dense_iff_topologicalClosure_eq_top.mpr e.dense_span) + rintro _ ⟨i, rfl⟩ + exact h i s hs hμs + exact DFunLike.congr_fun hAC v + +end Invariant233.Fields + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/NestedHilbertLimit.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/NestedHilbertLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..e07a51b81383d09ee35cf8dd94fef0bc11c9eb0e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/NestedHilbertLimit.lean @@ -0,0 +1,64 @@ +import Mathlib + +namespace OAI + +open Filter +open scoped Topology + +namespace Invariant233.ProductDensity + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +theorem norm_sub_sq_of_nested_inner (u : ℕ → E) + (hinner : ∀ m n, m ≤ n → inner ℝ (u m) (u n) = ‖u m‖ ^ 2) + {m n : ℕ} (hmn : m ≤ n) : + ‖u m - u n‖ ^ 2 = ‖u n‖ ^ 2 - ‖u m‖ ^ 2 := by + rw [norm_sub_sq_real, hinner m n hmn] + ring + +theorem monotone_norm_sq_of_nested_inner (u : ℕ → E) + (hinner : ∀ m n, m ≤ n → inner ℝ (u m) (u n) = ‖u m‖ ^ 2) : + Monotone (fun n => ‖u n‖ ^ 2) := by + intro m n hmn + have h := norm_sub_sq_of_nested_inner u hinner hmn + nlinarith [sq_nonneg ‖u m - u n‖] + +theorem norm_sub_sq_eq_abs_of_nested_inner (u : ℕ → E) + (hinner : ∀ m n, m ≤ n → inner ℝ (u m) (u n) = ‖u m‖ ^ 2) + (m n : ℕ) : + ‖u m - u n‖ ^ 2 = |‖u m‖ ^ 2 - ‖u n‖ ^ 2| := by + rcases le_total m n with hmn | hnm + · rw [norm_sub_sq_of_nested_inner u hinner hmn, + abs_of_nonpos (sub_nonpos.mpr (monotone_norm_sq_of_nested_inner u hinner hmn))] + ring + · rw [norm_sub_rev, norm_sub_sq_of_nested_inner u hinner hnm, + abs_of_nonneg (sub_nonneg.mpr (monotone_norm_sq_of_nested_inner u hinner hnm))] + +theorem cauchySeq_of_nested_inner (u : ℕ → E) + (hinner : ∀ m n, m ≤ n → inner ℝ (u m) (u n) = ‖u m‖ ^ 2) + (hbound : BddAbove (Set.range (fun n => ‖u n‖ ^ 2))) : + CauchySeq u := by + have hlim := tendsto_atTop_ciSup (monotone_norm_sq_of_nested_inner u hinner) hbound + have hc : CauchySeq (fun n => ‖u n‖ ^ 2) := hlim.cauchySeq + apply Metric.cauchySeq_iff.mpr + intro ε hε + obtain ⟨N, hN⟩ := Metric.cauchySeq_iff.mp hc (ε ^ 2) (sq_pos_of_pos hε) + refine ⟨N, ?_⟩ + intro m hm n hn + have hs := hN m hm n hn + rw [Real.dist_eq, ← norm_sub_sq_eq_abs_of_nested_inner u hinner m n] at hs + rw [dist_eq_norm] + nlinarith [norm_nonneg (u m - u n)] + +theorem exists_limit_of_nested_inner [CompleteSpace E] (u : ℕ → E) + (hinner : ∀ m n, m ≤ n → inner ℝ (u m) (u n) = ‖u m‖ ^ 2) + (C : ℝ) (hbound : ∀ n, ‖u n‖ ^ 2 ≤ C) : + ∃ v : E, Tendsto u atTop (𝓝 v) ∧ ‖v‖ ^ 2 ≤ C := by + obtain ⟨v, hv⟩ := cauchySeq_tendsto_of_complete + (cauchySeq_of_nested_inner u hinner ⟨C, by rintro _ ⟨n, rfl⟩; exact hbound n⟩) + refine ⟨v, hv, ?_⟩ + exact le_of_tendsto (hv.norm.pow 2) (Eventually.of_forall hbound) + +end Invariant233.ProductDensity + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/NormalAffiliatedTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalAffiliatedTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..46970e736676e19be9e840ab8a90189c60070fd3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalAffiliatedTransport.lean @@ -0,0 +1,104 @@ +import OAI.Analysis.IrrationalRotation.Model.NormalAffiliation +import OAI.Analysis.IrrationalRotation.Operators.AffiliatedTransport +import Mathlib.Analysis.CStarAlgebra.Unitary.Span + +namespace OAI + +noncomputable section + +namespace Invariant233 + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [CompleteSpace E] + +theorem IsAffiliated.graph_mem_of_mem_commutant + {M : VonNeumannAlgebra E} {H : E →ₗ.[ℂ] E} (hH : IsAffiliated M H) + {W : E →L[ℂ] E} (hW : W ∈ M.commutant) (x : H.domain) : + (W (x : E), W (H x)) ∈ H.graph := by + let S : Submodule ℂ M.commutant := { + carrier := {a | ∀ z : H.domain, + ((a : E →L[ℂ] E) (z : E), (a : E →L[ℂ] E) (H z)) ∈ H.graph} + zero_mem' := by + intro z + simp + add_mem' := by + intro a b ha hb z + change ((a : E →L[ℂ] E) z + (b : E →L[ℂ] E) z, + (a : E →L[ℂ] E) (H z) + (b : E →L[ℂ] E) (H z)) ∈ H.graph + exact H.graph.add_mem (ha z) (hb z) + smul_mem' := by + intro c a ha z + simpa only [SetLike.val_smul, smul_apply, Prod.smul_mk] + using H.graph.smul_mem c (ha z) } + have hspan : Submodule.span ℂ (unitary M.commutant : Set M.commutant) ≤ S := by + apply Submodule.span_le.mpr + intro U hU z + let U' : unitary (E →L[ℂ] E) := + ⟨(U : E →L[ℂ] E), Unitary.map_mem M.commutant.toStarSubalgebra.subtype hU⟩ + obtain ⟨hD, hC⟩ := hH U' U.property + exact H.mem_graph_iff.mpr ⟨⟨(U' : E →L[ℂ] E) z, hD z⟩, rfl, hC z⟩ + rw [CStarAlgebra.span_unitary] at hspan + exact hspan (Submodule.mem_top : (⟨W, hW⟩ : M.commutant) ∈ ⊤) x + +theorem IsAffiliated.commutes_of_mem_commutant + {M : VonNeumannAlgebra E} {H : E →ₗ.[ℂ] E} (hH : IsAffiliated M H) + {W : E →L[ℂ] E} (hW : W ∈ M.commutant) : + ∃ hD : ∀ x : H.domain, W (x : E) ∈ H.domain, + ∀ x : H.domain, H ⟨W (x : E), hD x⟩ = W (H x) := by + let hD : ∀ x : H.domain, W (x : E) ∈ H.domain := fun x => + H.mem_domain_of_mem_graph (hH.graph_mem_of_mem_commutant hW x) + refine ⟨hD, fun x => ?_⟩ + exact H.mem_graph_snd_inj (H.mem_graph ⟨W x, hD x⟩) + (hH.graph_mem_of_mem_commutant hW x) rfl + +theorem IsAffiliated.transported_projection_mem + {M : VonNeumannAlgebra E} {H : E →ₗ.[ℂ] E} (hH : IsAffiliated M H) + {p : E →L[ℂ] E} (hpM : p ∈ M) (hp : IsStarProjection p) : + (InvariantRotation.AffiliatedTransport.transported H p.range).starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mpr + intro W hW + rw [Submodule.range_starProjection] + apply (Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mpr + obtain ⟨hD, hC⟩ := hH.commutes_of_mem_commutant hW + have hpW := (VonNeumannAlgebra.IsStarProjection.mem_iff hp M).mp hpM W hW + exact InvariantRotation.AffiliatedTransport.transported_invariant_of_commutes H p.range W + ((Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mp hpW) + (fun x hx => hD ⟨x, hx⟩) hC + +theorem IsAffiliated.transported_projection_invariant + {M : VonNeumannAlgebra E} {H : E →ₗ.[ℂ] E} (hH : IsAffiliated M H) + (A B : E →L[ℂ] E) + (hD : ∀ x : H.domain, A (x : E) ∈ H.domain) + (hI : ∀ x : H.domain, H ⟨A (x : E), hD x⟩ = B (H x)) + {p : E →L[ℂ] E} (hpM : p ∈ M) (hp : IsStarProjection p) + (hinv : (1 - p) * A * p = 0) : + let Q := (InvariantRotation.AffiliatedTransport.transported H p.range).starProjection + Q ∈ M ∧ IsStarProjection Q ∧ (1 - Q) * B * Q = 0 := by + dsimp only + refine ⟨hH.transported_projection_mem hpM hp, isStarProjection_starProjection, ?_⟩ + have hpap : p * A * p = A * p := by + rw [sub_mul, one_mul, sub_mul, sub_eq_zero] at hinv + exact hinv.symm + have hpA : p.range ∈ Module.End.invtSubmodule A := by + apply (ContinuousLinearMap.IsIdempotentElem.range_mem_invtSubmodule_iff + hp.isIdempotentElem).mpr + exact hpap + have hQB := InvariantRotation.AffiliatedTransport.transported_invariant H p.range A B + ((Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mp hpA) + (fun x hx => hD ⟨x, hx⟩) hI + have hQinv : + (InvariantRotation.AffiliatedTransport.transported H p.range).starProjection.range ∈ + Module.End.invtSubmodule B := by + rw [Submodule.range_starProjection] + exact (Module.End.mem_invtSubmodule_iff_forall_mem_of_mem _).mpr hQB + have hQBQ := (ContinuousLinearMap.IsIdempotentElem.range_mem_invtSubmodule_iff + isStarProjection_starProjection.isIdempotentElem).mp hQinv + simp only [← ContinuousLinearMap.mul_def] at hQBQ + rw [sub_mul, one_mul, sub_mul, mul_assoc, hQBQ, sub_self] + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTraceDomainDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTraceDomainDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8cbd006001f0e0e8d203240fbfcb092dc62e734 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTraceDomainDensity.lean @@ -0,0 +1,108 @@ +import OAI.Analysis.IrrationalRotation.Operators.NormalTracialTransport +import OAI.Analysis.IrrationalRotation.Spectral.AffiliatedPositiveResolvent +import OAI.Analysis.IrrationalRotation.Spectral.PartialResolventCalculus + +namespace OAI + +noncomputable section +namespace Invariant233.NormalTraceDomainDensity + +universe u +variable {E : Type u} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +open NormalTracialTransport BoundedRangeTrace + +theorem eq_of_le_of_trace_eq + (M : VonNeumannAlgebra E) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (p q : Submodule ℂ E) [CompleteSpace p] [CompleteSpace q] + (hp : p.starProjection ∈ M) (hq : q.starProjection ∈ M) + (hpq : p ≤ q) + (heq : extendedTrace M τ p.starProjection = extendedTrace M τ q.starProjection) : + p = q := by + have hproj : IsStarProjection (q.starProjection - p.starProjection) := + isStarProjection_starProjection.sub_of_mul_eq_left isStarProjection_starProjection + (Submodule.starProjection_comp_starProjection_of_le hpq) + have hmem : q.starProjection - p.starProjection ∈ M := sub_mem hq hp + have hz : τ ⟨q.starProjection - p.starProjection, hmem⟩ = 0 := by + rw [← extendedTrace_apply M τ _ hmem, map_sub, heq, sub_self] + have hzero := hτ.1 ⟨q.starProjection - p.starProjection, hmem⟩ + (ContinuousLinearMap.IsPositive.of_isStarProjection hproj) hz + have hpzero : q.starProjection - p.starProjection = 0 := congrArg Subtype.val hzero + have hprojection : q.starProjection = p.starProjection := sub_eq_zero.mp hpzero + have hrange := congrArg (fun A : E →L[ℂ] E => A.range) hprojection + simpa only [Submodule.range_starProjection] using hrange.symm + +theorem closure_inf_eq_of_normalizer + (M : VonNeumannAlgebra E) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (A : E →L[ℂ] E) (hA : A ∈ M) + (hinj : Function.Injective A) (hadj : Function.Injective A.adjoint) + (d p : Submodule ℂ E) [CompleteSpace p] + (hD : A.range ≤ d) (hp : p.starProjection ∈ M) : + (p ⊓ d).topologicalClosure = p := by + let r := ((1 - p.starProjection) * A).ker + have hr : r.starProjection ∈ M := kernel_projection_mem M _ + (mul_mem (sub_mem (one_mem M) hp) hA) + let q := (A * r.starProjection).range.topologicalClosure + let : IsClosed (q : Set E) := Submodule.isClosed_topologicalClosure _ + let : CompleteSpace q := inferInstance + have hq : q.starProjection ∈ M := range_closure_projection_mem M _ (mul_mem hA hr) + have hrange : (A * r.starProjection).range ≤ p ⊓ d := by + rintro y ⟨x, rfl⟩ + constructor + · have hx := r.starProjection_apply_mem x + change A (r.starProjection x) - p.starProjection (A (r.starProjection x)) = 0 at hx + exact p.starProjection_eq_self_iff.mp (sub_eq_zero.mp hx).symm + · exact hD ⟨r.starProjection x, rfl⟩ + have hqp : q ≤ p := by + apply Submodule.topologicalClosure_minimal _ (hrange.trans inf_le_left) + exact (completeSpace_coe_iff_isComplete.mp inferInstance).isClosed + have htrace : extendedTrace M τ q.starProjection = extendedTrace M τ p.starProjection := by + exact (extendedTrace_range_eq_of_injective M τ hτ A hA hinj r hr).trans + (extendedTrace_preimage_eq M τ hτ A hA hadj p hp) + have hqeq : q = p := eq_of_le_of_trace_eq M τ hτ q p hq hp hqp htrace + apply le_antisymm + · apply Submodule.topologicalClosure_minimal _ inf_le_left + exact (completeSpace_coe_iff_isComplete.mp inferInstance).isClosed + · calc + p = q := hqeq.symm + _ ≤ (p ⊓ d).topologicalClosure := Submodule.topologicalClosure_mono hrange + +theorem closure_inf_domain_eq_of_normalizer + (M : VonNeumannAlgebra E) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (H : E →ₗ.[ℂ] E) (A : E →L[ℂ] E) (hA : A ∈ M) + (hinj : Function.Injective A) (hadj : Function.Injective A.adjoint) + (hD : ∀ x, A x ∈ H.domain) + (p : Submodule ℂ E) [CompleteSpace p] (hp : p.starProjection ∈ M) : + (p ⊓ H.domain).topologicalClosure = p := by + apply closure_inf_eq_of_normalizer M τ hτ A hA hinj hadj H.domain p _ hp + rintro y ⟨x, rfl⟩ + exact hD x + +theorem closure_inf_domain_eq_of_affiliated + (M : VonNeumannAlgebra E) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (H : E →ₗ.[ℂ] E) (hH : IsSelfAdjoint H) + (hpos : IsPositivePartial H) (haff : IsAffiliated M H) + (p : Submodule ℂ E) [CompleteSpace p] (hp : p.starProjection ∈ M) : + (p ⊓ H.domain).topologicalClosure = p := by + obtain ⟨R, hRM, _, hD, hHR, _, _⟩ := + PositivePartialResolvent.exists_affiliated_resolvent M H hH hpos haff + have hHR' : ∀ x : E, H ⟨R x, hD x⟩ = x - R x := fun x => hHR x (hD x) + have hinj : Function.Injective R := PartialResolvent.injective H R hD hHR' + have hformal : H.IsFormalAdjoint H := by + have hh := LinearPMap.adjoint_isFormalAdjoint hH.dense_domain + rwa [LinearPMap.isSelfAdjoint_def.mp hH] at hh + have hRself := PartialResolvent.isSelfAdjoint H R hD hHR' hformal + have hadj : Function.Injective R.adjoint := by + rw [← ContinuousLinearMap.star_eq_adjoint, hRself.star_eq] + exact hinj + exact closure_inf_domain_eq_of_normalizer M τ hτ H R hRM hinj hadj hD p hp + +end Invariant233.NormalTraceDomainDensity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTraceProjectionRigidity.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTraceProjectionRigidity.lean new file mode 100644 index 0000000000000000000000000000000000000000..99677096ea23dbfc533f4483d171b31bdde9fde3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTraceProjectionRigidity.lean @@ -0,0 +1,99 @@ +import OAI.Analysis.IrrationalRotation.Model.NormalAffiliation +import Mathlib.Algebra.Star.StarProjection +import Mathlib.Tactic + +namespace OAI + +noncomputable section +namespace Invariant233.NormalTraceProjectionRigidity + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] {M : VonNeumannAlgebra H} + +theorem trace_im_eq_zero (τ : TracialState M) {p : M} + (hp : IsStarProjection (p : H →L[ℂ] H)) : (τ p).im = 0 := by + have hstar : star p = p := Subtype.ext hp.isSelfAdjoint.star_eq + have heq : star (τ p) = τ p := (τ.map_star p).symm.trans (congrArg τ hstar) + have him := congrArg Complex.im heq + simp only [Complex.star_def, Complex.conj_im] at him + linarith + +theorem trace_re_nonneg (τ : TracialState M) {p : M} + (hp : IsStarProjection (p : H →L[ℂ] H)) : 0 ≤ (τ p).re := by + have hstar : star p = p := Subtype.ext hp.isSelfAdjoint.star_eq + have hmul : p * p = p := Subtype.ext hp.isIdempotentElem.eq + simpa only [hstar, hmul] using τ.positive p + +theorem trace_re_eq_zero_iff (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) {p : M} + (hp : IsStarProjection (p : H →L[ℂ] H)) : (τ p).re = 0 ↔ p = 0 := by + constructor + · intro hz + apply hτ.1 p (ContinuousLinearMap.IsPositive.of_isStarProjection hp) + exact Complex.ext hz (trace_im_eq_zero τ hp) + · rintro rfl + simp only [map_zero, Complex.zero_re] + +theorem trace_mono (τ : TracialState M) {p q : M} + (hp : IsStarProjection (p : H →L[ℂ] H)) + (hq : IsStarProjection (q : H →L[ℂ] H)) + (hpq : (p : H →L[ℂ] H) * (q : H →L[ℂ] H) = p) : + (τ p).re ≤ (τ q).re := by + have hdiff : IsStarProjection ((q - p : M) : H →L[ℂ] H) := + hp.sub_of_mul_eq_left hq hpq + have hnonneg := trace_re_nonneg τ hdiff + change 0 ≤ (τ.toContinuousLinearMap (q - p)).re at hnonneg + rw [map_sub, Complex.sub_re] at hnonneg + exact sub_nonneg.mp hnonneg + +theorem trace_re_eq_iff_of_nested (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) {p q : M} + (hp : IsStarProjection (p : H →L[ℂ] H)) + (hq : IsStarProjection (q : H →L[ℂ] H)) + (hpq : (p : H →L[ℂ] H) * (q : H →L[ℂ] H) = p) : + (τ p).re = (τ q).re ↔ p = q := by + constructor + · intro heq + have hdiff : IsStarProjection ((q - p : M) : H →L[ℂ] H) := + hp.sub_of_mul_eq_left hq hpq + have hz : (τ (q - p)).re = 0 := by + rw [map_sub, Complex.sub_re, heq, sub_self] + exact (sub_eq_zero.mp ((trace_re_eq_zero_iff τ hτ hdiff).mp hz)).symm + · rintro rfl + rfl + +theorem trace_re_eq_one_iff (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) {p : M} + (hp : IsStarProjection (p : H →L[ℂ] H)) : (τ p).re = 1 ↔ p = 1 := by + have hone : (τ (1 : M)).re = 1 := by rw [τ.map_one]; rfl + rw [← hone] + exact trace_re_eq_iff_of_nested τ hτ hp (IsStarProjection.one _) (mul_one _) + +theorem trace_mem_Ioo_iff (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) {p : M} + (hp : IsStarProjection (p : H →L[ℂ] H)) : + (τ p).re ∈ Set.Ioo (0 : ℝ) 1 ↔ p ≠ 0 ∧ p ≠ 1 := by + have hlo := trace_re_nonneg τ hp + have hhi : (τ p).re ≤ 1 := by + simpa only [τ.map_one, Complex.one_re] using + trace_mono τ (q := (1 : M)) hp (IsStarProjection.one _) (mul_one (p : H →L[ℂ] H)) + constructor + · intro h + exact ⟨fun hz => (ne_of_gt h.1) ((trace_re_eq_zero_iff τ hτ hp).mpr hz), + fun ho => (ne_of_lt h.2) ((trace_re_eq_one_iff τ hτ hp).mpr ho)⟩ + · rintro ⟨hz, ho⟩ + exact ⟨lt_of_le_of_ne hlo (Ne.symm (fun h => hz ((trace_re_eq_zero_iff τ hτ hp).mp h))), + lt_of_le_of_ne hhi (fun h => ho ((trace_re_eq_one_iff τ hτ hp).mp h))⟩ + +theorem nontrivial_iff_of_trace_eq (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) {p q : M} + (hp : IsStarProjection (p : H →L[ℂ] H)) + (hq : IsStarProjection (q : H →L[ℂ] H)) (htrace : τ p = τ q) : + (p ≠ 0 ∧ p ≠ 1) ↔ (q ≠ 0 ∧ q ≠ 1) := by + rw [← trace_mem_Ioo_iff τ hτ hp, ← trace_mem_Ioo_iff τ hτ hq, htrace] + +end Invariant233.NormalTraceProjectionRigidity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTracialMeet.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTracialMeet.lean new file mode 100644 index 0000000000000000000000000000000000000000..16aa2b30e52ab5b8d8602797cdab77d0988c0e37 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTracialMeet.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.IrrationalRotation.Operators.NormalTracialTransport +import OAI.Analysis.IrrationalRotation.Analysis.VonNeumannSupportGeometry + +namespace OAI + +noncomputable section + +namespace Invariant233.NormalTracialMeet + +open NormalTracialTransport + +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem extendedTrace_support_eq (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) (A : H →L[ℂ] H) (hA : A ∈ M) : + extendedTrace M τ A.kerᗮ.starProjection = + extendedTrace M τ A.range.topologicalClosure.starProjection := by + rw [Submodule.starProjection_orthogonal', + VonNeumannSupportGeometry.range_closure_projection_eq, map_sub, map_sub] + congr 1 + exact extendedTrace_kernel_eq_adjoint_kernel M τ hτ A hA + +theorem trace_support_eq (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) (A : H →L[ℂ] H) (hA : A ∈ M) : + τ ⟨A.kerᗮ.starProjection, + VonNeumannSupportGeometry.kernel_orthogonal_projection_mem M A hA⟩ = + τ ⟨A.range.topologicalClosure.starProjection, + VonNeumannSupportGeometry.range_closure_projection_mem M A hA⟩ := by + simpa only [extendedTrace_apply M τ _ + (VonNeumannSupportGeometry.kernel_orthogonal_projection_mem M A hA), + extendedTrace_apply M τ _ + (VonNeumannSupportGeometry.range_closure_projection_mem M A hA)] using + extendedTrace_support_eq M τ hτ A hA + +private instance inf_complete (p q : Submodule ℂ H) + [CompleteSpace p] [CompleteSpace q] : CompleteSpace ↥(p ⊓ q) := by + have hp : IsClosed (p : Set H) := + (completeSpace_coe_iff_isComplete.mp inferInstance).isClosed + have hq : IsClosed (q : Set H) := + (completeSpace_coe_iff_isComplete.mp inferInstance).isClosed + exact (hp.inter hq).completeSpace_coe + +theorem extendedTrace_meet_lower_bound + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (p q : Submodule ℂ H) [CompleteSpace p] [CompleteSpace q] + (hp : p.starProjection ∈ M) (hq : q.starProjection ∈ M) : + (extendedTrace M τ p.starProjection).re + + (extendedTrace M τ q.starProjection).re - 1 ≤ + (extendedTrace M τ (p ⊓ q).starProjection).re := by + let A := (1 - q.starProjection) * p.starProjection + have hA : A ∈ M := mul_mem (sub_mem (one_mem M) hq) hp + have hqperp : qᗮ.starProjection ∈ M := by + rw [Submodule.starProjection_orthogonal'] + exact sub_mem (one_mem M) hq + have hmono := extendedTrace_projection_mono M τ + A.range.topologicalClosure qᗮ + (VonNeumannSupportGeometry.range_closure_projection_mem M A hA) hqperp + (VonNeumannSupportGeometry.range_closure_complement_projection_le p q) + rw [← extendedTrace_support_eq M τ hτ A hA] at hmono + change (extendedTrace M τ + (((1 - q.starProjection) * p.starProjection).kerᗮ.starProjection)).re ≤ _ at hmono + rw [VonNeumannSupportGeometry.initial_support_complement_projection, + map_sub, Complex.sub_re, extendedTrace_orthogonal, Complex.sub_re, + Complex.one_re] at hmono + linarith + +theorem trace_meet_lower_bound + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (p q : Submodule ℂ H) [CompleteSpace p] [CompleteSpace q] + (hp : p.starProjection ∈ M) (hq : q.starProjection ∈ M) : + (τ ⟨p.starProjection, hp⟩).re + (τ ⟨q.starProjection, hq⟩).re - 1 ≤ + (τ ⟨(p ⊓ q).starProjection, + VonNeumannSupportGeometry.inf_projection_mem p q M hp hq⟩).re := by + simpa only [extendedTrace_apply M τ _ hp, extendedTrace_apply M τ _ hq, + extendedTrace_apply M τ _ + (VonNeumannSupportGeometry.inf_projection_mem p q M hp hq)] using + extendedTrace_meet_lower_bound M τ hτ p q hp hq + +end Invariant233.NormalTracialMeet + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTracialProjectionTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTracialProjectionTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..7c260ff50a9be7fda96fc2d0a636ad3aee0f59b6 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTracialProjectionTransport.lean @@ -0,0 +1,107 @@ +import OAI.Analysis.IrrationalRotation.Operators.VectorTraceNormality +import OAI.Analysis.IrrationalRotation.Operators.VectorProjectionNormality +import OAI.Analysis.IrrationalRotation.Operators.AffiliatedTransportSupplement + +namespace OAI + +noncomputable section +open Filter +open scoped Topology +namespace Invariant233 + +namespace TracialState +variable {A : Type*} [CStarAlgebra A] + +theorem apply_selfAdjoint_eq_re (τ : TracialState A) {a : A} + (ha : IsSelfAdjoint a) : τ a = ((τ a).re : ℂ) := by + apply (Complex.conj_eq_iff_re.mp ?_).symm + change star (τ a) = τ a + rw [← τ.map_star, ha.star_eq] + +theorem projection_nonneg (τ : TracialState A) {p : A} + (hp : IsStarProjection p) : 0 ≤ (τ p).re := by + have h := τ.positive p + rwa [hp.isSelfAdjoint.star_eq, hp.isIdempotentElem.eq] at h + +theorem projection_mono (τ : TracialState A) {p q : A} + (hp : IsStarProjection p) (hq : IsStarProjection q) (hpq : p * q = p) : + (τ p).re ≤ (τ q).re := by + have h := τ.projection_nonneg (hp.sub_of_mul_eq_left hq hpq) + change 0 ≤ (τ.toContinuousLinearMap (q - p)).re at h + rw [map_sub, Complex.sub_re] at h + linarith + +theorem projection_re_mem_Icc (τ : TracialState A) {p : A} + (hp : IsStarProjection p) : (τ p).re ∈ Set.Icc (0 : ℝ) 1 := by + refine ⟨τ.projection_nonneg hp, ?_⟩ + have h := τ.projection_mono hp (IsStarProjection.one A) (mul_one p) + simpa only [τ.map_one, Complex.one_re] using h + +end TracialState + +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +namespace NormalTracialProjectionTransport + +theorem tendsto_trace_projection_exhaustion + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + {ι : Type} [Preorder ι] [NeBot (atTop : Filter ι)] + (K : ι → Submodule ℂ H) [∀ i, (K i).HasOrthogonalProjection] + (hK : Monotone K) (hmem : ∀ i, (K i).starProjection ∈ M) + (hdense : (⨆ i, K i).topologicalClosure = ⊤) : + Tendsto (fun i => τ ⟨(K i).starProjection, hmem i⟩) atTop (𝓝 1) := by + have h := hτ.tendsto_of_strong_small atTop + (fun i => ⟨(K i).starProjection, hmem i⟩) 1 + ⟨1, fun i => (K i).starProjection_norm_le⟩ (fun x => ?_) + · simpa only [τ.map_one] using h + · simpa only [OneMemClass.coe_one, one_apply_eq_self] using + Submodule.starProjection_tendsto_self K hK x (by rw [hdense]) + +theorem tendsto_trace_projection_exhaustion_re + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + {ι : Type} [Preorder ι] [NeBot (atTop : Filter ι)] + (K : ι → Submodule ℂ H) [∀ i, (K i).HasOrthogonalProjection] + (hK : Monotone K) (hmem : ∀ i, (K i).starProjection ∈ M) + (hdense : (⨆ i, K i).topologicalClosure = ⊤) : + Tendsto (fun i => (τ ⟨(K i).starProjection, hmem i⟩).re) atTop (𝓝 1) := by + simpa only [Function.comp_def, Complex.one_re] using + Complex.continuous_re.continuousAt.tendsto.comp + (tendsto_trace_projection_exhaustion M τ hτ K hK hmem hdense) + +theorem trace_eq_of_cutoff_estimates + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (p q : M) (hp : IsStarProjection p) (hq : IsStarProjection q) + (K : ℕ → Submodule ℂ H) [∀ n, (K n).HasOrthogonalProjection] + (hK : Monotone K) (hmem : ∀ n, (K n).starProjection ∈ M) + (hdense : (⨆ n, K n).topologicalClosure = ⊤) + (hforward : ∀ n, (τ p).re + (τ ⟨(K n).starProjection, hmem n⟩).re - 1 ≤ + (τ q).re) + (hbackward : ∀ n, (τ (1 - p)).re + + (τ ⟨(K n).starProjection, hmem n⟩).re - 1 ≤ (τ (1 - q)).re) : + τ p = τ q := by + have he : Tendsto (fun n : ℕ => (τ ⟨(K n).starProjection, hmem n⟩).re) + atTop (𝓝 1) := + tendsto_trace_projection_exhaustion_re M τ hτ (ι := ℕ) K hK hmem hdense + have hbackward' : ∀ n, (1 - (τ p).re) + + (τ ⟨(K n).starProjection, hmem n⟩).re - 1 ≤ 1 - (τ q).re := by + intro n + have h := hbackward n + change (τ.toContinuousLinearMap (1 - p)).re + _ - 1 ≤ + (τ.toContinuousLinearMap (1 - q)).re at h + simpa only [map_sub, Complex.sub_re, τ.map_one, Complex.one_re] using h + have hre := Invariant233.AffiliatedTransport.trace_eq_of_cutoff_estimates + he hforward hbackward' + rw [τ.apply_selfAdjoint_eq_re hp.isSelfAdjoint, + τ.apply_selfAdjoint_eq_re hq.isSelfAdjoint, hre] + +end NormalTracialProjectionTransport +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTracialTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTracialTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..0eb9b981ce2a9eb2ba2396ea12bfd746b09706ad --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalTracialTransport.lean @@ -0,0 +1,369 @@ +import OAI.Analysis.IrrationalRotation.Model.NormalAffiliation +import OAI.Analysis.IrrationalRotation.Operators.BoundedRangeTrace +import Mathlib.Analysis.Normed.Module.HahnBanach + +namespace OAI + +noncomputable section +open Filter +open scoped Topology BigOperators +namespace Invariant233.NormalTracialTransport + +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +def extendedTrace (M : VonNeumannAlgebra H) (τ : TracialState M) : + (H →L[ℂ] H) →L[ℂ] ℂ := + Classical.choose (exists_extension_norm_eq M.toSubalgebra.toSubmodule + τ.toContinuousLinearMap) + +theorem extendedTrace_apply (M : VonNeumannAlgebra H) (τ : TracialState M) + (A : H →L[ℂ] H) (hA : A ∈ M) : + extendedTrace M τ A = τ ⟨A, hA⟩ := + (Classical.choose_spec (exists_extension_norm_eq M.toSubalgebra.toSubmodule + τ.toContinuousLinearMap)).1 ⟨A, hA⟩ + +@[simp] theorem extendedTrace_one (M : VonNeumannAlgebra H) (τ : TracialState M) : + extendedTrace M τ 1 = 1 := by + rw [extendedTrace_apply M τ 1 (one_mem M)] + exact τ.map_one + +theorem extendedTrace_cyclic (M : VonNeumannAlgebra H) (τ : TracialState M) + (A B : H →L[ℂ] H) (hA : A ∈ M) (hB : B ∈ M) : + extendedTrace M τ (A * B) = extendedTrace M τ (B * A) := by + rw [extendedTrace_apply M τ _ (mul_mem hA hB), + extendedTrace_apply M τ _ (mul_mem hB hA)] + exact τ.tracial ⟨A, hA⟩ ⟨B, hB⟩ + +theorem extendedTrace_star (M : VonNeumannAlgebra H) (τ : TracialState M) + (A : H →L[ℂ] H) (hA : A ∈ M) : + extendedTrace M τ (star A) = star (extendedTrace M τ A) := by + rw [extendedTrace_apply M τ _ (star_mem hA), extendedTrace_apply M τ A hA] + exact τ.map_star ⟨A, hA⟩ + +theorem extendedTrace_projection_nonneg (M : VonNeumannAlgebra H) (τ : TracialState M) + (P : H →L[ℂ] H) (hP : P ∈ M) (hp : IsStarProjection P) : + 0 ≤ (extendedTrace M τ P).re := by + have hh := τ.positive (⟨P, hP⟩ : M) + have hid : star P * P = P := by rw [hp.isSelfAdjoint.star_eq, hp.isIdempotentElem.eq] + have heq : (star (⟨P, hP⟩ : M) * ⟨P, hP⟩ : M) = ⟨P, hP⟩ := Subtype.ext hid + rw [heq] at hh + rwa [extendedTrace_apply M τ P hP] + +theorem extendedTrace_projection_real (M : VonNeumannAlgebra H) (τ : TracialState M) + (P : H →L[ℂ] H) (hP : P ∈ M) (hp : IsStarProjection P) : + ((extendedTrace M τ P).re : ℂ) = extendedTrace M τ P := by + have hs := extendedTrace_star M τ P hP + rw [hp.isSelfAdjoint.star_eq] at hs + exact Complex.conj_eq_iff_re.mp hs.symm + +theorem extendedTrace_tendsto (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + {ι : Type u} {L : Filter ι} [L.NeBot] + (A : ι → H →L[ℂ] H) (B : H →L[ℂ] H) + (hA : ∀ i, A i ∈ M) (hB : B ∈ M) + (hbound : ∃ C : ℝ, ∀ i, ‖A i‖ ≤ C) + (hstrong : ∀ x, Tendsto (fun i => A i x) L (𝓝 (B x))) : + Tendsto (fun i => extendedTrace M τ (A i)) L (𝓝 (extendedTrace M τ B)) := by + have hh := hτ.2 ι L inferInstance (fun i => ⟨A i, hA i⟩) ⟨B, hB⟩ hbound hstrong + simpa only [extendedTrace_apply M τ B hB, + extendedTrace_apply M τ _ (hA _)] using hh + +theorem extendedTrace_projection_mono (M : VonNeumannAlgebra H) (τ : TracialState M) + (p q : Submodule ℂ H) [p.HasOrthogonalProjection] [q.HasOrthogonalProjection] + (hp : p.starProjection ∈ M) (hq : q.starProjection ∈ M) (hpq : p ≤ q) : + (extendedTrace M τ p.starProjection).re ≤ (extendedTrace M τ q.starProjection).re := by + have hproj : IsStarProjection (q.starProjection - p.starProjection) := + isStarProjection_starProjection.sub_of_mul_eq_left isStarProjection_starProjection + (Submodule.starProjection_comp_starProjection_of_le hpq) + have hnonneg := extendedTrace_projection_nonneg M τ _ (sub_mem hq hp) hproj + rw [map_sub, Complex.sub_re] at hnonneg + linarith + +@[simp] theorem extendedTrace_orthogonal (M : VonNeumannAlgebra H) (τ : TracialState M) + (p : Submodule ℂ H) [p.HasOrthogonalProjection] : + extendedTrace M τ pᗮ.starProjection = 1 - extendedTrace M τ p.starProjection := by + rw [Submodule.starProjection_orthogonal, ← ContinuousLinearMap.one_def, map_sub, + extendedTrace_one] + +open ProjectionMeetTrace BoundedRangeTrace + +theorem extendedTrace_complement_pow_eq (M : VonNeumannAlgebra H) (τ : TracialState M) + (a b : H →L[ℂ] H) (ha : a ∈ M) (hb : b ∈ M) (n : ℕ) : + extendedTrace M τ ((1 - a * b) ^ n) = extendedTrace M τ ((1 - b * a) ^ n) := by + induction n with + | zero => rfl + | succ n ih => + have hp : (1 - a * b) ^ n ∈ M := pow_mem (sub_mem (one_mem M) (mul_mem ha hb)) n + have hcycle := extendedTrace_cyclic M τ ((1 - a * b) ^ n * a) b (mul_mem hp ha) hb + have hterm : extendedTrace M τ (((1 - a * b) ^ n * a) * b) = + extendedTrace M τ (((1 - b * a) ^ n * b) * a) := by + rw [hcycle, ← mul_assoc, mul_complement_pow b a n] + simpa only [pow_succ, mul_sub, mul_one, ← mul_assoc, map_sub] using + congrArg₂ (fun x y : ℂ => x - y) ih hterm + +theorem meanOperator_mem (M : VonNeumannAlgebra H) (A : H →L[ℂ] H) + (hA : A ∈ M) (n : ℕ) : meanOperator A n ∈ M := by + exact M.toSubalgebra.smul_mem (sum_mem fun k hk => pow_mem hA k) _ + +theorem norm_meanOperator_le_one (A : H →L[ℂ] H) (hA : ‖A‖ ≤ 1) (n : ℕ) : + ‖meanOperator A n‖ ≤ 1 := by + rcases eq_or_ne n 0 with rfl | hn + · simp [meanOperator] + have hpow : ∀ k : ℕ, ‖A ^ k‖ ≤ 1 := by + intro k + induction k with + | zero => + simp only [pow_zero] + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro x + simp + | succ k ih => + rw [pow_succ] + calc + ‖A ^ k * A‖ ≤ ‖A ^ k‖ * ‖A‖ := norm_mul_le _ _ + _ ≤ 1 * ‖A‖ := mul_le_mul_of_nonneg_right ih (norm_nonneg _) + _ ≤ 1 := by simpa only [one_mul] using hA + have hsum : ‖∑ k ∈ Finset.range n, A ^ k‖ ≤ (n : ℝ) := by + calc + _ ≤ ∑ k ∈ Finset.range n, (1 : ℝ) := norm_sum_le_of_le _ (fun k hk => hpow k) + _ = _ := by simp + rw [meanOperator, norm_smul] + apply (mul_le_mul_of_nonneg_left hsum (norm_nonneg _)).trans + simp [norm_inv, hn] + +theorem extendedTrace_tendsto_nat (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (A : ℕ → H →L[ℂ] H) (B : H →L[ℂ] H) + (hA : ∀ n, A n ∈ M) (hB : B ∈ M) + (hbound : ∃ C : ℝ, ∀ n, ‖A n‖ ≤ C) + (hstrong : ∀ x, Tendsto (fun n => A n x) atTop (𝓝 (B x))) : + Tendsto (fun n => extendedTrace M τ (A n)) atTop (𝓝 (extendedTrace M τ B)) := by + let L : Filter (ULift.{u} ℕ) := Filter.map ULift.up atTop + have hs : ∀ x, Tendsto (fun n : ULift.{u} ℕ => A n.down x) L (𝓝 (B x)) := by + intro x + change Filter.map (fun n : ULift.{u} ℕ => A n.down x) + (Filter.map ULift.up atTop) ≤ _ + rw [Filter.map_map] + exact hstrong x + have ht := extendedTrace_tendsto M τ hτ (L := L) + (fun n : ULift.{u} ℕ => A n.down) B (fun n => hA n.down) hB + (by obtain ⟨C, hC⟩ := hbound; exact ⟨C, fun n => hC n.down⟩) hs + exact ht.comp Filter.tendsto_map + +theorem extendedTrace_kernel_eq_adjoint_kernel_of_norm_le_one + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (A : H →L[ℂ] H) (hA : A ∈ M) (hnorm : ‖A‖ ≤ 1) : + extendedTrace M τ A.ker.starProjection = + extendedTrace M τ A.adjoint.ker.starProjection := by + have hnstar : ‖star A‖ ≤ 1 := by simpa using hnorm + have hlim := extendedTrace_tendsto_nat M τ hτ + (fun n => meanOperator (1 - star A * A) n) A.ker.starProjection + (fun n => meanOperator_mem M _ (sub_mem (one_mem M) (mul_mem (star_mem hA) hA)) n) + (kernel_projection_mem M A hA) + ⟨1, fun n => norm_meanOperator_le_one _ (norm_one_sub_gram_le_one A hnorm) n⟩ + (meanOperator_one_sub_gram_tendsto A hnorm) + have hlimStar := extendedTrace_tendsto_nat M τ hτ + (fun n => meanOperator (1 - star (star A) * star A) n) (star A).ker.starProjection + (fun n => meanOperator_mem M _ + (sub_mem (one_mem M) (mul_mem (star_mem (star_mem hA)) (star_mem hA))) n) + (kernel_projection_mem M (star A) (star_mem hA)) + ⟨1, fun n => norm_meanOperator_le_one _ + (norm_one_sub_gram_le_one (star A) hnstar) n⟩ + (meanOperator_one_sub_gram_tendsto (star A) hnstar) + have heq : ∀ n, extendedTrace M τ (meanOperator (1 - star A * A) n) = + extendedTrace M τ (meanOperator (1 - star (star A) * star A) n) := by + intro n + simp only [meanOperator, map_smul, map_sum, star_star] + congr 1 + apply Finset.sum_congr rfl + intro k hk + exact extendedTrace_complement_pow_eq M τ (star A) A (star_mem hA) hA k + have hlim' : Tendsto (fun n => extendedTrace M τ + (meanOperator (1 - star (star A) * star A) n)) atTop + (𝓝 (extendedTrace M τ A.ker.starProjection)) := by + convert hlim using 1 + funext n + exact (heq n).symm + simpa only [ContinuousLinearMap.star_eq_adjoint] using + tendsto_nhds_unique hlim' hlimStar + +theorem extendedTrace_kernel_eq_adjoint_kernel + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (A : H →L[ℂ] H) (hA : A ∈ M) : + extendedTrace M τ A.ker.starProjection = + extendedTrace M τ A.adjoint.ker.starProjection := by + let c : ℂ := ((1 + ‖A‖)⁻¹ : ℝ) + have hc : c ≠ 0 := Complex.ofReal_ne_zero.mpr (inv_ne_zero (by positivity)) + have hn : ‖c • A‖ ≤ 1 := by + rw [norm_smul] + have hcNorm : ‖c‖ = (1 + ‖A‖)⁻¹ := by + simp only [c, Complex.norm_real, Real.norm_eq_abs] + exact abs_of_pos (by positivity) + rw [hcNorm] + have hpos : 0 < 1 + ‖A‖ := by positivity + rw [inv_mul_le_iff₀ hpos] + linarith [norm_nonneg A] + have heq := extendedTrace_kernel_eq_adjoint_kernel_of_norm_le_one M τ hτ + (c • A) (M.toStarSubalgebra.smul_mem hA c) hn + have hk : (c • A).ker = A.ker := by + ext x + change c • A x = 0 ↔ A x = 0 + simp only [smul_eq_zero, hc, false_or] + have hka : (c • A).adjoint.ker = A.adjoint.ker := by + rw [map_smulₛₗ] + ext x + change star c • A.adjoint x = 0 ↔ A.adjoint x = 0 + simp only [smul_eq_zero, star_ne_zero.mpr hc, false_or] + simpa only [hk, hka] using heq + +theorem range_closure_projection_mem (M : VonNeumannAlgebra H) + (A : H →L[ℂ] H) (hA : A ∈ M) : + A.range.topologicalClosure.starProjection ∈ M := by + simpa only [range_closure_eq, Submodule.starProjection_orthogonal, + ← ContinuousLinearMap.one_def] using + (sub_mem (one_mem M) (kernel_projection_mem M A.adjoint (star_mem hA))) + +theorem extendedTrace_range_eq_of_injective + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (A : H →L[ℂ] H) (hA : A ∈ M) (hinj : Function.Injective A) + (p : Submodule ℂ H) [CompleteSpace p] (hp : p.starProjection ∈ M) : + extendedTrace M τ (A * p.starProjection).range.topologicalClosure.starProjection = + extendedTrace M τ p.starProjection := by + have hk : (A * p.starProjection).ker = pᗮ := by + rw [← p.ker_starProjection] + ext x + change A (p.starProjection x) = 0 ↔ p.starProjection x = 0 + exact map_eq_zero_iff A hinj + have ht := extendedTrace_kernel_eq_adjoint_kernel M τ hτ + (A * p.starProjection) (mul_mem hA hp) + simp only [hk] at ht + simp only [range_closure_eq, extendedTrace_orthogonal, ← ht] + ring + +theorem extendedTrace_preimage_eq + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (A : H →L[ℂ] H) (hA : A ∈ M) (hinj : Function.Injective A.adjoint) + (p : Submodule ℂ H) [CompleteSpace p] (hp : p.starProjection ∈ M) : + extendedTrace M τ ((1 - p.starProjection) * A).ker.starProjection = + extendedTrace M τ p.starProjection := by + have hstar : ((1 - p.starProjection) * A).adjoint = + A.adjoint * (1 - p.starProjection) := by + simp only [← ContinuousLinearMap.star_eq_adjoint, star_mul, star_sub, star_one, + isStarProjection_starProjection.isSelfAdjoint.star_eq] + have hk : ((1 - p.starProjection) * A).adjoint.ker = p := by + rw [hstar] + ext x + change A.adjoint (x - p.starProjection x) = 0 ↔ x ∈ p + rw [map_eq_zero_iff A.adjoint hinj, sub_eq_zero, eq_comm] + exact p.starProjection_eq_self_iff + have ht := extendedTrace_kernel_eq_adjoint_kernel M τ hτ + ((1 - p.starProjection) * A) (mul_mem (sub_mem (one_mem M) hp) hA) + simpa only [hk] using ht + +theorem extendedTrace_le_of_normalizer + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (T : H →ₗ.[ℂ] H) (A B : H →L[ℂ] H) + (hA : A ∈ M) (hB : B ∈ M) + (hAinj : Function.Injective A.adjoint) (hBinj : Function.Injective B) + (hD : ∀ x, A x ∈ T.domain) (hTA : ∀ x, T ⟨A x, hD x⟩ = B x) + (p q : Submodule ℂ H) [CompleteSpace p] [CompleteSpace q] + (hp : p.starProjection ∈ M) (hq : q.starProjection ∈ M) + (himage : InvariantRotation.AffiliatedTransport.transported T p ≤ q) : + (extendedTrace M τ p.starProjection).re ≤ + (extendedTrace M τ q.starProjection).re := by + let r := ((1 - p.starProjection) * A).ker + have hr : r.starProjection ∈ M := kernel_projection_mem M _ + (mul_mem (sub_mem (one_mem M) hp) hA) + have hrt : extendedTrace M τ r.starProjection = extendedTrace M τ p.starProjection := + extendedTrace_preimage_eq M τ hτ A hA hAinj p hp + have hBt := extendedTrace_range_eq_of_injective M τ hτ B hB hBinj r hr + have hle : (B * r.starProjection).range.topologicalClosure ≤ + InvariantRotation.AffiliatedTransport.transported T p := by + apply Submodule.topologicalClosure_minimal _ _ + (Submodule.isClosed_topologicalClosure _) + rintro y ⟨x, rfl⟩ + apply (InvariantRotation.AffiliatedTransport.domainImage T p).le_topologicalClosure + apply InvariantRotation.AffiliatedTransport.mem_domainImage.mpr + refine ⟨⟨A (r.starProjection x), hD _⟩, ?_, hTA _⟩ + have hm := r.starProjection_apply_mem x + change A (r.starProjection x) - p.starProjection (A (r.starProjection x)) = 0 at hm + exact p.starProjection_eq_self_iff.mp (sub_eq_zero.mp hm).symm + have ht := extendedTrace_projection_mono M τ + (B * r.starProjection).range.topologicalClosure q + (range_closure_projection_mem M _ (mul_mem hB hr)) hq (hle.trans himage) + simpa only [hBt, hrt] using ht + +theorem extendedTrace_transported_eq_of_normalizer + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (T : H →ₗ.[ℂ] H) (hT : T.IsFormalAdjoint T) (hker : T.toFun.ker = ⊥) + (A B : H →L[ℂ] H) (hA : A ∈ M) (hB : B ∈ M) + (hAinj : Function.Injective A) (hAadj : Function.Injective A.adjoint) + (hBinj : Function.Injective B) (hBadj : Function.Injective B.adjoint) + (hD : ∀ x, A x ∈ T.domain) (hTA : ∀ x, T ⟨A x, hD x⟩ = B x) + (p : Submodule ℂ H) [CompleteSpace p] (hp : p.starProjection ∈ M) + (hP : (InvariantRotation.AffiliatedTransport.transported T p).starProjection ∈ M) : + extendedTrace M τ (InvariantRotation.AffiliatedTransport.transported T p).starProjection = + extendedTrace M τ p.starProjection := by + let : CompleteSpace (InvariantRotation.AffiliatedTransport.transported T p) := by + unfold InvariantRotation.AffiliatedTransport.transported + infer_instance + have hforward := extendedTrace_le_of_normalizer M τ hτ T A B hA hB + hAadj hBinj hD hTA p (InvariantRotation.AffiliatedTransport.transported T p) + hp hP le_rfl + have hDinv : ∀ x, B x ∈ T.inverse.domain := by + intro x + rw [LinearPMap.inverse_domain] + exact ⟨⟨A x, hD x⟩, hTA x⟩ + have hTinv : ∀ x, T.inverse ⟨B x, hDinv x⟩ = A x := by + intro x + have hpartialker : T.ker = ⊥ := by simp [LinearPMap.ker, hker] + exact LinearPMap.inverse_apply_eq (x := ⟨A x, hD x⟩) (y := ⟨B x, hDinv x⟩) + hpartialker (hTA x) + have hpperp : pᗮ.starProjection ∈ M := by + simpa only [Submodule.starProjection_orthogonal, ← ContinuousLinearMap.one_def] using + (sub_mem (one_mem M) hp : (1 : H →L[ℂ] H) - p.starProjection ∈ M) + have hPperp : (InvariantRotation.AffiliatedTransport.transported T p)ᗮ.starProjection ∈ M := by + simpa only [Submodule.starProjection_orthogonal, ← ContinuousLinearMap.one_def] using + (sub_mem (one_mem M) hP : (1 : H →L[ℂ] H) - + (InvariantRotation.AffiliatedTransport.transported T p).starProjection ∈ M) + have hback := extendedTrace_le_of_normalizer M τ hτ T.inverse B A hB hA + hBadj hAinj hDinv hTinv pᗮ + (InvariantRotation.AffiliatedTransport.transported T p)ᗮ hpperp hPperp + (InvariantRotation.AffiliatedTransport.inverse_transported_le_orthogonal T p hT hker) + rw [extendedTrace_orthogonal, extendedTrace_orthogonal] at hback + have hre : (extendedTrace M τ (InvariantRotation.AffiliatedTransport.transported T p).starProjection).re = + (extendedTrace M τ p.starProjection).re := by + simp only [Complex.sub_re, Complex.one_re] at hback + linarith + rw [← extendedTrace_projection_real M τ _ hP isStarProjection_starProjection, + ← extendedTrace_projection_real M τ _ hp isStarProjection_starProjection] + exact congrArg Complex.ofReal hre + +theorem transported_trace_eq_of_normalizer + (M : VonNeumannAlgebra H) (τ : TracialState M) + (hτ : IsNormalFaithfulTracialState M τ) + (T : H →ₗ.[ℂ] H) (hT : T.IsFormalAdjoint T) (hker : T.toFun.ker = ⊥) + (A B : H →L[ℂ] H) (hA : A ∈ M) (hB : B ∈ M) + (hAinj : Function.Injective A) (hAadj : Function.Injective A.adjoint) + (hBinj : Function.Injective B) (hBadj : Function.Injective B.adjoint) + (hD : ∀ x, A x ∈ T.domain) (hTA : ∀ x, T ⟨A x, hD x⟩ = B x) + (p : Submodule ℂ H) [CompleteSpace p] (hp : p.starProjection ∈ M) + (hP : (InvariantRotation.AffiliatedTransport.transported T p).starProjection ∈ M) : + τ ⟨(InvariantRotation.AffiliatedTransport.transported T p).starProjection, hP⟩ = + τ ⟨p.starProjection, hp⟩ := by + simpa only [extendedTrace_apply M τ _ hP, extendedTrace_apply M τ _ hp] using + extendedTrace_transported_eq_of_normalizer M τ hτ T hT hker A B hA hB + hAinj hAadj hBinj hBadj hD hTA p hp hP + +end Invariant233.NormalTracialTransport + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/NormalVectorTrace.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalVectorTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..a64db3f2ad5efd096deccae931dbc3a64f4842b9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/NormalVectorTrace.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.IrrationalRotation.Model.NormalAffiliation + +namespace OAI + +noncomputable section +open Filter +open scoped Topology + +namespace Invariant233 + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [CompleteSpace E] + +theorem IsFaithfulTracialVector.isNormalFaithfulTracialState + {M : VonNeumannAlgebra E} {ξ : E} (hξ : IsFaithfulTracialVector M ξ) : + IsNormalFaithfulTracialState M hξ.toTracialState := by + constructor + · intro a ha hzero + apply Subtype.ext + exact hξ.2.2 (a : E →L[ℂ] E) a.property ha hzero + · intro ι L _hL a b _hbound hstrong + change Tendsto (fun i => inner ℂ ξ ((a i : E →L[ℂ] E) ξ)) L + (𝓝 (inner ℂ ξ ((b : E →L[ℂ] E) ξ))) + exact tendsto_const_nhds.inner (hstrong ξ) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/OperatorCompactTransfer.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/OperatorCompactTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..33e85859242053c2161b43cb366a8f072c66dbde --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/OperatorCompactTransfer.lean @@ -0,0 +1,176 @@ +import Mathlib.Analysis.InnerProductSpace.Adjoint +import OAI.Analysis.IrrationalRotation.Model.CompactTransfer +import OAI.Analysis.IrrationalRotation.Analysis.CompactTransfer +import OAI.Analysis.IrrationalRotation.Analysis.StrongLusin +import OAI.Analysis.IrrationalRotation.Rotation.DiagonalContinuity +import OAI.Analysis.IrrationalRotation.Analysis.CappedRatios +import OAI.Analysis.IrrationalRotation.Rotation.UnrestrictedDiagonal +import Mathlib.Topology.Algebra.Module.Basic +import Mathlib.Topology.Order.OrderClosed +import Mathlib.Analysis.CStarAlgebra.Basic + +namespace OAI + +open Set MeasureTheory Filter +open scoped Topology ENNReal NNReal lp + +noncomputable section +namespace Invariant233.CompactTransfer + +local instance operatorCompactTransferSecondCountableTopology : + SecondCountableTopology (SequenceHilbert ℤ) := by + let b : HilbertBasis ℤ ℂ (SequenceHilbert ℤ) := + HilbertBasis.ofRepr (LinearIsometryEquiv.refl ℂ _) + have hs := (Set.countable_range b).isSeparable.span (R := ℂ) |>.closure + have : TopologicalSpace.SeparableSpace (SequenceHilbert ℤ) := + TopologicalSpace.isSeparable_univ_iff.mp (by + simpa only [← Submodule.topologicalClosure_coe, b.dense_span, Submodule.top_coe] using hs) + infer_instance + +def cappedDiagonal {X : Type*} (F : ℤ → X → ℝ) + (hF : ∀ i x, 0 < F i x) (B : ℝ) (hB : 0 ≤ B) (t : X × X) : + SequenceHilbert ℤ →L[ℂ] SequenceHilbert ℤ := + SequenceHilbert.diagonal (fun i => ((min B (F i t.2 / F i t.1) : ℝ) : ℂ)) B hB (by + intro i + have hn : 0 ≤ min B (F i t.2 / F i t.1) := + le_min hB (div_nonneg (hF i t.2).le (hF i t.1).le) + simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hn] using + (min_le_left B (F i t.2 / F i t.1))) + +theorem uniform_marginal_budget {X ι : Type*} + [MeasurableSpace X] (μ : Measure X) (νs : ι → Measure (X × X)) + (hfirst : UniformlyAbsolutelyContinuous μ (fun i => (νs i).map Prod.fst)) + (hsecond : UniformlyAbsolutelyContinuous μ (fun i => (νs i).map Prod.snd)) : + ∀ ε : ℝ≥0, 0 < ε → ∃ δ : ℝ≥0∞, δ ≠ 0 ∧ + ∀ A : Set X, MeasurableSet A → μ A < δ → ∀ i, + νs i (A ×ˢ Set.univ) + νs i (Set.univ ×ˢ A) ≤ ε := by + intro ε hε + have hhalf : 0 < ε / 2 := by positivity + obtain ⟨δ₁, hδ₁, hfirst⟩ := hfirst (ε / 2) hhalf + obtain ⟨δ₂, hδ₂, hsecond⟩ := hsecond (ε / 2) hhalf + refine ⟨(min δ₁ δ₂ : ℝ≥0), ?_, ?_⟩ + · exact ENNReal.coe_ne_zero.mpr (ne_of_gt (lt_min hδ₁ hδ₂)) + intro A hA hμ i + have hμ₁ : μ A < (δ₁ : ℝ≥0∞) := hμ.trans_le (by exact_mod_cast min_le_left δ₁ δ₂) + have hμ₂ : μ A < (δ₂ : ℝ≥0∞) := hμ.trans_le (by exact_mod_cast min_le_right δ₁ δ₂) + have h₁ := hfirst A hA hμ₁ i + have h₂ := hsecond A hA hμ₂ i + rw [Measure.map_apply measurable_fst hA] at h₁ + rw [Measure.map_apply measurable_snd hA] at h₂ + have heq₁ : Prod.fst ⁻¹' A = A ×ˢ (Set.univ : Set X) := by ext t; simp + have heq₂ : Prod.snd ⁻¹' A = (Set.univ : Set X) ×ˢ A := by ext t; simp + rw [heq₁] at h₁ + rw [heq₂] at h₂ + calc + νs i (A ×ˢ Set.univ) + νs i (Set.univ ×ˢ A) ≤ + ((ε / 2 : ℝ≥0) : ℝ≥0∞) + ((ε / 2 : ℝ≥0) : ℝ≥0∞) := + add_le_add h₁.le h₂.le + _ = ε := by rw [← ENNReal.coe_add, add_halves] + +theorem capped_operator_relation_transfer {X ι : Type*} + [TopologicalSpace X] [PolishSpace X] [MeasurableSpace X] [BorelSpace X] + (μ : Measure X) [IsFiniteMeasure μ] + (p : X → SequenceHilbert ℤ →L[ℂ] SequenceHilbert ℤ) + (F : ℤ → X → ℝ) (hF : ∀ i x, 0 < F i x) + (hFm : ∀ i, Measurable (F i)) + (hpm : ∀ i : ℤ, Measurable (fun x => p x (lp.single 2 i 1))) + (C : ℝ) (hC : 0 ≤ C) (hpn : ∀ x, ‖p x‖ ≤ C) + (B : ℝ) (hB : 0 ≤ B) + {L : Filter ι} [L.NeBot] {ν : FiniteMeasure (X × X)} + {νs : ι → FiniteMeasure (X × X)} (hν : Tendsto νs L (𝓝 ν)) + (hsmall : ∀ ε : ℝ≥0, 0 < ε → ∃ δ : ℝ≥0∞, δ ≠ 0 ∧ + ∀ A : Set X, MeasurableSet A → μ A < δ → ∀ i, + (νs i : Measure (X × X)) (A ×ˢ Set.univ) + + (νs i : Measure (X × X)) (Set.univ ×ˢ A) ≤ ε) + (hzero : ∀ i, ∀ᵐ t ∂(νs i : Measure (X × X)), + (1 - p t.2).comp ((cappedDiagonal F hF B hB t).comp (p t.1)) = 0) : + ∀ᵐ t ∂(ν : Measure (X × X)), + (1 - p t.2).comp ((cappedDiagonal F hF B hB t).comp (p t.1)) = 0 := by + classical + let b : HilbertBasis ℤ ℂ (SequenceHilbert ℤ) := + HilbertBasis.ofRepr (LinearIsometryEquiv.refl ℂ _) + have hb : ∀ i, b i = lp.single 2 i (1 : ℂ) := fun i => (b.repr_symm_single i).symm + apply ae_mem_of_closed_approximation hν + intro ε hε + obtain ⟨δ, hδ, hδsmall⟩ := hsmall ε hε + obtain ⟨Q, hQ, hμQ, hpQ, hFQ⟩ := + StrongLusin.exists_compact_strong_and_continuousOn μ p hC hpn b + (fun i => by simpa only [hb] using hpm i) F hFm hδ + let S : Set (X × X) := {t | t ∈ Q ×ˢ Q ∧ + (1 - p t.2).comp ((cappedDiagonal F hF B hB t).comp (p t.1)) = 0} + have hScompact : IsCompact S := by + apply isCompact_diagonal_relation_on Q hQ p + (fun t i => ((min B (F i t.2 / F i t.1) : ℝ) : ℂ)) B C hB + (fun t i => ?_) hpQ (fun i => ?_) hpn + · have hn : 0 ≤ min B (F i t.2 / F i t.1) := + le_min hB (div_nonneg (hF i t.2).le (hF i t.1).le) + simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hn] using + (min_le_left B (F i t.2 / F i t.1)) + · exact continuousOn_capped_ratio (F i) Q (hFQ i) + (fun x _ => (hF i x).ne') B + refine ⟨S, hScompact.isClosed, fun _ ht => ht.2, + Filter.Eventually.of_forall ?_⟩ + intro i + have hsub : ∀ᵐ t ∂(νs i : Measure (X × X)), t ∈ Sᶜ → t ∈ (Q ×ˢ Q)ᶜ := by + filter_upwards [hzero i] with t ht + intro hbad hQpair + exact hbad ⟨hQpair, ht⟩ + apply (measure_mono_ae hsub).trans + rw [Set.compl_prod_eq_union] + exact (measure_union_le _ _).trans + (hδsmall Qᶜ hQ.isClosed.measurableSet.compl hμQ i) + +theorem cappedDiagonal_eq_ratioDiagonal {X : Type*} (F : ℤ → X → ℝ) + (hF : ∀ i x, 0 < F i x) (B : ℝ) (hB : 0 ≤ B) (t : X × X) + (hcap : ∀ i, F i t.2 / F i t.1 ≤ B) : + cappedDiagonal F hF B hB t = ratioDiagonal F t := by + have hnorm : ∀ i, ‖((F i t.2 / F i t.1 : ℝ) : ℂ)‖ ≤ B := by + intro i + simpa only [Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (div_nonneg (hF i t.2).le (hF i t.1).le)] using hcap i + unfold ratioDiagonal + rw [SequenceHilbert.boundedDiagonal_eq _ B hB hnorm] + apply SequenceHilbert.diagonal_congr + intro i + simp only [min_eq_right (hcap i)] + +theorem compact_operator_transfer {X ι : Type*} + [TopologicalSpace X] [PolishSpace X] [MeasurableSpace X] [BorelSpace X] + (μ : Measure X) [IsFiniteMeasure μ] + (p : X → SequenceHilbert ℤ →L[ℂ] SequenceHilbert ℤ) + (hp : ∀ x, IsStarProjection (p x)) + (F : ℤ → X → ℝ) (hF : ∀ i x, 0 < F i x) + (hFm : ∀ i, Measurable (F i)) + (hpm : ∀ i : ℤ, Measurable (fun x => p x (lp.single 2 i 1))) + {L : Filter ι} [L.NeBot] {ν : FiniteMeasure (X × X)} + {νs : ι → FiniteMeasure (X × X)} (hν : Tendsto νs L (𝓝 ν)) + (hfirst : UniformlyAbsolutelyContinuous μ + (fun i => (νs i : Measure (X × X)).map Prod.fst)) + (hsecond : UniformlyAbsolutelyContinuous μ + (fun i => (νs i : Measure (X × X)).map Prod.snd)) + (B : ℝ) (hB : 0 < B) + (hcapn : ∀ i k, ∀ᵐ t ∂(νs i : Measure (X × X)), F k t.2 / F k t.1 ≤ B) + (hcap : ∀ k, ∀ᵐ t ∂(ν : Measure (X × X)), F k t.2 / F k t.1 ≤ B) + (hzero : ∀ i, ∀ᵐ t ∂(νs i : Measure (X × X)), + (1 - p t.2).comp ((ratioDiagonal F t).comp (p t.1)) = 0) : + ∀ᵐ t ∂(ν : Measure (X × X)), + (1 - p t.2).comp ((ratioDiagonal F t).comp (p t.1)) = 0 := by + have hsmall := uniform_marginal_budget μ + (fun i => (νs i : Measure (X × X))) hfirst hsecond + have hbounded : ∀ x, ‖p x‖ ≤ (1 : ℝ) := + fun x => IsStarProjection.norm_le (p x) (hp x) + have hzerocap : ∀ i, ∀ᵐ t ∂(νs i : Measure (X × X)), + (1 - p t.2).comp ((cappedDiagonal F hF B hB.le t).comp (p t.1)) = 0 := by + intro i + filter_upwards [ae_all_iff.mpr (hcapn i), hzero i] with t ht hz + rwa [cappedDiagonal_eq_ratioDiagonal F hF B hB.le t ht] + have hresult := capped_operator_relation_transfer μ p F hF hFm hpm + 1 zero_le_one hbounded B hB.le hν hsmall hzerocap + filter_upwards [ae_all_iff.mpr hcap, hresult] with t ht hz + rwa [cappedDiagonal_eq_ratioDiagonal F hF B hB.le t ht] at hz + +end Invariant233.CompactTransfer + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionAtomOrbit.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionAtomOrbit.lean new file mode 100644 index 0000000000000000000000000000000000000000..23a4971329d0969354e25ce9f15c41c18fda7299 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionAtomOrbit.lean @@ -0,0 +1,212 @@ +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties +import Mathlib.Algebra.Star.UnitaryStarAlgAut +import Mathlib.Algebra.Star.StarProjection +import Mathlib.Analysis.InnerProductSpace.Positive +import Mathlib.Tactic + +namespace OAI + +noncomputable section +open scoped InnerProductSpace ComplexOrder +namespace Invariant233.ProjectionAtomOrbit + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +theorem mul_eq_zero_of_atoms + (hab : ∀ A ∈ M, ∀ B ∈ M, Commute A B) + {p q : H →L[ℂ] H} (hp : IsProjectionAtom M p) (hq : IsProjectionAtom M q) + (hne : p ≠ q) : p * q = 0 := by + have hc := hab p hp.1 q hq.1 + have hproj : IsStarProjection (p * q) := hp.2.1.mul hq.2.1 hc + have hmem : p * q ∈ M := mul_mem hp.1 hq.1 + have hpp : (p * q) * p = p * q := by + calc + (p * q) * p = p * (q * p) := mul_assoc _ _ _ + _ = p * (p * q) := by rw [hc.eq] + _ = p * q := by rw [← mul_assoc, hp.2.1.isIdempotentElem.eq] + have hpq : (p * q) * q = p * q := by + rw [mul_assoc, hq.2.1.isIdempotentElem.eq] + rcases hp.2.2.2 (p * q) hmem hproj hpp with hz | hp' + · exact hz + rcases hq.2.2.2 (p * q) hmem hproj hpq with hz | hq' + · exact hz + exact (hne (hp'.symm.trans hq')).elim + +theorem sum_atoms_isStarProjection + (hab : ∀ A ∈ M, ∀ B ∈ M, Commute A B) + (s : Finset (H →L[ℂ] H)) (hs : ∀ p ∈ s, IsProjectionAtom M p) : + IsStarProjection (∑ p ∈ s, p) := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert p s hp ih => + rw [Finset.sum_insert hp] + apply (hs p (Finset.mem_insert_self p s)).2.1.add + (ih fun q hq => hs q (Finset.mem_insert_of_mem hq)) + rw [Finset.mul_sum] + apply Finset.sum_eq_zero + intro q hq + exact mul_eq_zero_of_atoms hab (hs p (Finset.mem_insert_self p s)) + (hs q (Finset.mem_insert_of_mem hq)) (fun he => hp (he ▸ hq)) + +theorem vectorTrace_le_norm_sq (ξ : H) {p : H →L[ℂ] H} (hp : IsStarProjection p) : + (vectorTrace ξ p).re ≤ ‖ξ‖ ^ 2 := by + have h := (ContinuousLinearMap.IsPositive.of_isStarProjection hp.one_sub).re_inner_nonneg_right ξ + change 0 ≤ (inner ℂ ξ ((1 - p) ξ)).re at h + simp only [sub_apply, one_apply_eq_self, inner_sub_right, + inner_self_eq_norm_sq_to_K] at h + norm_num at h + simpa only [← Complex.ofReal_pow, Complex.ofReal_re, vectorTrace] using h + +theorem sum_vectorTrace_atoms_le (ξ : H) + (hab : ∀ A ∈ M, ∀ B ∈ M, Commute A B) + (s : Finset (H →L[ℂ] H)) (hs : ∀ p ∈ s, IsProjectionAtom M p) : + (∑ p ∈ s, (vectorTrace ξ p).re) ≤ ‖ξ‖ ^ 2 := by + have h := vectorTrace_le_norm_sq ξ (sum_atoms_isStarProjection hab s hs) + simpa [vectorTrace, sum_apply, inner_sum] using h + +theorem finite_atoms_vectorTrace_ge (ξ : H) + (hab : ∀ A ∈ M, ∀ B ∈ M, Commute A B) + {δ : ℝ} (hδ : 0 < δ) : + {p : H →L[ℂ] H | IsProjectionAtom M p ∧ δ ≤ (vectorTrace ξ p).re}.Finite := by + classical + by_contra hfin + have hinf : Set.Infinite {p : H →L[ℂ] H | + IsProjectionAtom M p ∧ δ ≤ (vectorTrace ξ p).re} := hfin + obtain ⟨n, hn⟩ := exists_nat_gt (‖ξ‖ ^ 2 / δ) + obtain ⟨s, hs, hcard⟩ := hinf.exists_subset_card_eq n + have hlo : (n : ℝ) * δ ≤ ∑ p ∈ s, (vectorTrace ξ p).re := by + calc + (n : ℝ) * δ = ∑ _p ∈ s, δ := by simp [hcard] + _ ≤ _ := Finset.sum_le_sum fun p hp => (hs hp).2 + have hhi := sum_vectorTrace_atoms_le ξ hab s (fun p hp => (hs hp).1) + have hlarge : ‖ξ‖ ^ 2 < (n : ℝ) * δ := (div_lt_iff₀ hδ).mp hn + linarith + +theorem atom_map (Φ : (H →L[ℂ] H) ≃⋆ₐ[ℂ] (H →L[ℂ] H)) + (hM : ∀ A, Φ A ∈ M ↔ A ∈ M) + {p : H →L[ℂ] H} (hp : IsProjectionAtom M p) : + IsProjectionAtom M (Φ p) := by + refine ⟨(hM p).mpr hp.1, hp.2.1.map Φ, ?_, ?_⟩ + · intro hz + apply hp.2.2.1 + apply Φ.injective + simpa using hz + · intro q hq hproj hqp + have hqm : Φ.symm q ∈ M := (hM _).mp (by simpa using hq) + have hle : Φ.symm q * p = Φ.symm q := by + apply Φ.injective + change Φ (Φ.symm q * p) = Φ (Φ.symm q) + rw [map_mul] + simpa only [StarAlgEquiv.apply_symm_apply] using hqp + rcases hp.2.2.2 (Φ.symm q) hqm (hproj.map Φ.symm) hle with hz | he + · left + simpa using congrArg Φ hz + · right + simpa using congrArg Φ he + +theorem atom_iterate (Φ : (H →L[ℂ] H) ≃⋆ₐ[ℂ] (H →L[ℂ] H)) + (hM : ∀ A, Φ A ∈ M ↔ A ∈ M) + {p : H →L[ℂ] H} (hp : IsProjectionAtom M p) (n : ℕ) : + IsProjectionAtom M ((Φ : (H →L[ℂ] H) → (H →L[ℂ] H))^[n] p) := by + induction n with + | zero => exact hp + | succ n ih => + rw [Function.iterate_succ_apply'] + exact atom_map Φ hM ih + +theorem finite_atom_orbit (ξ : H) + (hab : ∀ A ∈ M, ∀ B ∈ M, Commute A B) + (Φ : (H →L[ℂ] H) ≃⋆ₐ[ℂ] (H →L[ℂ] H)) + (hM : ∀ A, Φ A ∈ M ↔ A ∈ M) + (htrace : ∀ A ∈ M, vectorTrace ξ (Φ A) = vectorTrace ξ A) + {p : H →L[ℂ] H} (hp : IsProjectionAtom M p) + (hpos : 0 < (vectorTrace ξ p).re) : + (Set.range fun n : ℕ => (Φ : (H →L[ℂ] H) → (H →L[ℂ] H))^[n] p).Finite := by + have hm : ∀ n : ℕ, + vectorTrace ξ ((Φ : (H →L[ℂ] H) → (H →L[ℂ] H))^[n] p) = vectorTrace ξ p := by + intro n + induction n with + | zero => rfl + | succ n ih => + rw [Function.iterate_succ_apply', htrace _ (atom_iterate Φ hM hp n).1, ih] + apply (finite_atoms_vectorTrace_ge ξ hab hpos).subset + rintro A ⟨n, rfl⟩ + exact ⟨atom_iterate Φ hM hp n, (congrArg Complex.re (hm n)).ge⟩ + +theorem exists_positive_atom_period (ξ : H) + (hab : ∀ A ∈ M, ∀ B ∈ M, Commute A B) + (Φ : (H →L[ℂ] H) ≃⋆ₐ[ℂ] (H →L[ℂ] H)) + (hM : ∀ A, Φ A ∈ M ↔ A ∈ M) + (htrace : ∀ A ∈ M, vectorTrace ξ (Φ A) = vectorTrace ξ A) + {p : H →L[ℂ] H} (hp : IsProjectionAtom M p) + (hpos : 0 < (vectorTrace ξ p).re) : + ∃ n : ℕ, 0 < n ∧ (Φ : (H →L[ℂ] H) → (H →L[ℂ] H))^[n] p = p := by + have hfin := finite_atom_orbit ξ hab Φ hM htrace hp hpos + have hnot : ¬ Function.Injective + (fun n : ℕ => (Φ : (H →L[ℂ] H) → (H →L[ℂ] H))^[n] p) := by + intro hinj + exact (Set.infinite_range_of_injective hinj) hfin + simp only [Function.Injective, not_forall] at hnot + obtain ⟨m, n, heq, hne⟩ := hnot + rcases lt_or_gt_of_ne hne with hlt | hlt + · exact ⟨n - m, Nat.sub_pos_of_lt hlt, Function.iterate_cancel Φ.injective heq.symm⟩ + · exact ⟨m - n, Nat.sub_pos_of_lt hlt, Function.iterate_cancel Φ.injective heq⟩ + +theorem vectorTrace_pos_of_faithful (ξ : H) + (hξ : IsFaithfulTracialVector M ξ) + {p : H →L[ℂ] H} (hp : p ∈ M) (hproj : IsStarProjection p) (hne : p ≠ 0) : + 0 < (vectorTrace ξ p).re := by + have hpositive := ContinuousLinearMap.IsPositive.of_isStarProjection hproj + have hnonneg : 0 ≤ vectorTrace ξ p := hpositive.inner_nonneg_right ξ + have hparts := Complex.nonneg_iff.mp hnonneg + by_contra h + apply hne + apply hξ.2.2 p hp hpositive + apply Complex.ext + · exact le_antisymm (not_lt.mp h) hparts.1 + · exact hparts.2.symm + +theorem isDiffuse_of_total_ergodicity (ξ : H) + (hab : ∀ A ∈ M, ∀ B ∈ M, Commute A B) + (hξ : IsFaithfulTracialVector M ξ) + (Φ : (H →L[ℂ] H) ≃⋆ₐ[ℂ] (H →L[ℂ] H)) + (hM : ∀ A, Φ A ∈ M ↔ A ∈ M) + (htrace : ∀ A ∈ M, vectorTrace ξ (Φ A) = vectorTrace ξ A) + (htotal : ∀ n : ℕ, 0 < n → ∀ p : H →L[ℂ] H, + p ∈ M → IsStarProjection p → + (Φ : (H →L[ℂ] H) → (H →L[ℂ] H))^[n] p = p → p = 0 ∨ p = 1) + (hnontrivial : ∃ q : H →L[ℂ] H, + q ∈ M ∧ IsStarProjection q ∧ q ≠ 0 ∧ q ≠ 1) : + IsDiffuseVonNeumannAlgebra M := by + intro p hp + have hpos := vectorTrace_pos_of_faithful ξ hξ hp.1 hp.2.1 hp.2.2.1 + obtain ⟨n, hn, hperiod⟩ := exists_positive_atom_period ξ hab Φ hM htrace hp hpos + have hp1 : p = 1 := (htotal n hn p hp.1 hp.2.1 hperiod).resolve_left hp.2.2.1 + obtain ⟨q, hq, hqproj, hq0, hq1⟩ := hnontrivial + rcases hp.2.2.2 q hq hqproj (by rw [hp1, mul_one]) with hz | he + · exact hq0 hz + · exact hq1 (he.trans hp1) + +theorem faithfulTracialVector_restrict {N : VonNeumannAlgebra H} + (hMN : M ≤ N) (ξ : H) (hξ : IsFaithfulTracialVector N ξ) : + IsFaithfulTracialVector M ξ := by + exact ⟨hξ.1, fun A B hA hB => hξ.2.1 A B (hMN hA) (hMN hB), + fun A hA hpos hz => hξ.2.2 A (hMN hA) hpos hz⟩ + +theorem vectorTrace_unitary_conjugation {N : VonNeumannAlgebra H} + (ξ : H) (hξ : IsFaithfulTracialVector N ξ) + (U : unitary (H →L[ℂ] H)) (hU : (U : H →L[ℂ] H) ∈ N) + {A : H →L[ℂ] H} (hA : A ∈ N) : + vectorTrace ξ (Unitary.conjStarAlgAut ℂ (H →L[ℂ] H) U A) = vectorTrace ξ A := by + rw [Unitary.conjStarAlgAut_apply] + rw [hξ.2.1 ((U : H →L[ℂ] H) * A) (star (U : H →L[ℂ] H)) + (mul_mem hU hA) (star_mem hU)] + rw [← mul_assoc, (Unitary.mem_iff.mp U.property).1, one_mul] + +end Invariant233.ProjectionAtomOrbit + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionFieldRepresentative.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionFieldRepresentative.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d96b08bf577740141ccaed779ec3d700fdcf59d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionFieldRepresentative.lean @@ -0,0 +1,50 @@ +import OAI.Analysis.IrrationalRotation.Model.CompactTransfer +import Mathlib.Algebra.Order.Module.Field +import Mathlib.Data.EReal.Inv +import Mathlib.Tactic.Measurability +import Mathlib.Topology.Algebra.InfiniteSum.Order +import Mathlib.Topology.MetricSpace.Bounded + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.Fields + +theorem exists_everywhere_projection_field + {X : Type*} [MeasurableSpace X] (μ : Measure X) + (P : X → SequenceHilbert ℤ →L[ℂ] SequenceHilbert ℤ) + (hP : ∀ᵐ x ∂μ, IsStarProjection (P x)) + (hm : ∀ k : ℤ, Measurable (fun x => P x (lp.single 2 k 1))) : + ∃ Q : X → SequenceHilbert ℤ →L[ℂ] SequenceHilbert ℤ, + (∀ x, IsStarProjection (Q x)) ∧ + (∀ k : ℤ, Measurable (fun x => Q x (lp.single 2 k 1))) ∧ + Q =ᵐ[μ] P := by + classical + obtain ⟨N, hsub, hN, hnull⟩ := exists_measurable_superset_of_null (ae_iff.mp hP) + let Q : X → SequenceHilbert ℤ →L[ℂ] SequenceHilbert ℤ := + fun x => if x ∈ N then 0 else P x + refine ⟨Q, ?_, ?_, ?_⟩ + · intro x + by_cases hx : x ∈ N + · simpa only [Q, ite_eq_left hx] using IsStarProjection.zero + (SequenceHilbert ℤ →L[ℂ] SequenceHilbert ℤ) + · simp only [Q, ite_eq_right hx] + by_contra h + exact hx (hsub h) + · intro k + have h : Measurable (fun x => if x ∈ N then (0 : SequenceHilbert ℤ) + else P x (lp.single 2 k 1)) := + Measurable.ite hN measurable_const (hm k) + convert h using 1 + funext x + by_cases hx : x ∈ N <;> simp [Q, hx] + · filter_upwards [show ∀ᵐ x ∂μ, x ∉ N from ae_iff.mpr (by simpa using hnull)] with x hx + simp only [Q, ite_eq_right hx] + +end Invariant233.Fields + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionMeetTrace.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionMeetTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..b8826f1f1c3f0266f4341f7acfd0ea26acbf6063 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionMeetTrace.lean @@ -0,0 +1,255 @@ +import OAI.Analysis.IrrationalRotation.Operators.TracialProjectionTransport +import Mathlib.Analysis.InnerProductSpace.MeanErgodic +import Mathlib.Analysis.InnerProductSpace.StarOrder +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +import Mathlib.Tactic + +namespace OAI + +noncomputable section +open Filter +open scoped Topology BigOperators +namespace Invariant233.ProjectionMeetTrace +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +def vectorFunctional (ξ : H) : (H →L[ℂ] H) →L[ℂ] ℂ := + (innerSL ℂ ξ).comp (ContinuousLinearMap.apply ℂ H ξ) + +omit [CompleteSpace H] in +@[simp] theorem vectorFunctional_apply (ξ : H) (A : H →L[ℂ] H) : + vectorFunctional ξ A = vectorTrace ξ A := rfl + +theorem norm_one_sub_gram_le_one (A : H →L[ℂ] H) (hA : ‖A‖ ≤ 1) : + ‖1 - star A * A‖ ≤ 1 := by + have hgram : 0 ≤ star A * A := star_mul_self_nonneg A + have hnorm : ‖star A * A‖ ≤ 1 := by + rw [CStarRing.norm_star_mul_self] + nlinarith [norm_nonneg A] + have hle : star A * A ≤ 1 := + (CStarAlgebra.norm_le_one_iff_of_nonneg _ hgram).mp hnorm + exact (CStarAlgebra.norm_le_one_iff_of_nonneg _ (sub_nonneg.mpr hle)).mpr + (sub_le_self _ hgram) + +omit [CompleteSpace H] in + +theorem mul_complement_pow (a b : H →L[ℂ] H) (n : ℕ) : + a * (1 - b * a) ^ n = (1 - a * b) ^ n * a := by + induction n with + | zero => simp + | succ n ih => + rw [pow_succ, pow_succ, ← mul_assoc, ih] + noncomm_ring + +theorem vectorTrace_complement_pow_eq + (M : VonNeumannAlgebra H) (ξ : H) + (htrace : ∀ a b : H →L[ℂ] H, a ∈ M → b ∈ M → + vectorTrace ξ (a * b) = vectorTrace ξ (b * a)) + (a b : H →L[ℂ] H) (ha : a ∈ M) (hb : b ∈ M) (n : ℕ) : + vectorTrace ξ ((1 - a * b) ^ n) = vectorTrace ξ ((1 - b * a) ^ n) := by + induction n with + | zero => rfl + | succ n ih => + have hp : (1 - a * b) ^ n ∈ M := pow_mem (sub_mem (one_mem M) (mul_mem ha hb)) n + have hcycle := htrace ((1 - a * b) ^ n * a) b (mul_mem hp ha) hb + have hterm : vectorTrace ξ (((1 - a * b) ^ n * a) * b) = + vectorTrace ξ (((1 - b * a) ^ n * b) * a) := by + rw [hcycle, ← mul_assoc, mul_complement_pow b a n] + simpa only [pow_succ, mul_sub, mul_one, ← mul_assoc, + vectorTrace, sub_apply, inner_sub_right] using congrArg₂ (fun x y : ℂ => x - y) ih hterm + +def meanOperator (A : H →L[ℂ] H) (n : ℕ) : H →L[ℂ] H := + (n : ℂ)⁻¹ • ∑ k ∈ Finset.range n, A ^ k + +omit [CompleteSpace H] in + +theorem meanOperator_apply (A : H →L[ℂ] H) (n : ℕ) (x : H) : + meanOperator A n x = birkhoffAverage ℂ A id n x := by + simp only [meanOperator, birkhoffAverage, birkhoffSum, smul_apply, sum_apply] + congr 1 + apply Finset.sum_congr rfl + intro k hk + exact (congrArg (fun f : H →ₗ[ℂ] H => f x) (ContinuousLinearMap.toLinearMap_pow A k)).trans + (congrFun (Module.End.coe_pow A.toLinearMap k) x) + +theorem eqLocus_one_sub_gram (A : H →L[ℂ] H) : + (1 - star A * A).eqLocus (1 : H →L[ℂ] H) = A.ker := by + rw [← A.ker_adjoint_comp_self] + ext x + change x - (A.adjoint (A x)) = x ↔ A.adjoint (A x) = 0 + exact sub_eq_self + +theorem meanOperator_one_sub_gram_tendsto (A : H →L[ℂ] H) (hA : ‖A‖ ≤ 1) (x : H) : + Tendsto (fun n => meanOperator (1 - star A * A) n x) atTop + (𝓝 (A.ker.starProjection x)) := by + have ht := (1 - star A * A).tendsto_birkhoffAverage_orthogonalProjection + (norm_one_sub_gram_le_one A hA) x + simp only [← meanOperator_apply] at ht + change Tendsto (fun n => meanOperator (1 - star A * A) n x) atTop + (𝓝 (((1 - star A * A).eqLocus (1 : H →L[ℂ] H)).starProjection x)) at ht + simpa only [eqLocus_one_sub_gram] using ht + +theorem vectorTrace_kernel_eq_adjoint_kernel + (M : VonNeumannAlgebra H) (ξ : H) + (htrace : ∀ a b : H →L[ℂ] H, a ∈ M → b ∈ M → + vectorTrace ξ (a * b) = vectorTrace ξ (b * a)) + (A : H →L[ℂ] H) (hA : A ∈ M) (hnorm : ‖A‖ ≤ 1) : + vectorTrace ξ A.ker.starProjection = vectorTrace ξ A.adjoint.ker.starProjection := by + have hnstar : ‖star A‖ ≤ 1 := by simpa using hnorm + have hlim : Tendsto (fun n => vectorTrace ξ (meanOperator (1 - star A * A) n)) + atTop (𝓝 (vectorTrace ξ A.ker.starProjection)) := + tendsto_const_nhds.inner (meanOperator_one_sub_gram_tendsto A hnorm ξ) + have hlimStar : Tendsto (fun n => vectorTrace ξ + (meanOperator (1 - star (star A) * star A) n)) atTop + (𝓝 (vectorTrace ξ (star A).ker.starProjection)) := + tendsto_const_nhds.inner (meanOperator_one_sub_gram_tendsto (star A) hnstar ξ) + have heq : ∀ n, vectorTrace ξ (meanOperator (1 - star A * A) n) = + vectorTrace ξ (meanOperator (1 - star (star A) * star A) n) := by + intro n + change vectorFunctional ξ (meanOperator (1 - star A * A) n) = + vectorFunctional ξ (meanOperator (1 - star (star A) * star A) n) + simp only [meanOperator, map_smul, map_sum, star_star] + congr 1 + apply Finset.sum_congr rfl + intro k hk + exact vectorTrace_complement_pow_eq M ξ htrace (star A) A (star_mem hA) hA k + have hlim' : Tendsto (fun n => vectorTrace ξ + (meanOperator (1 - star (star A) * star A) n)) atTop + (𝓝 (vectorTrace ξ A.ker.starProjection)) := by + convert hlim using 1 + funext n + exact (heq n).symm + have hresult := tendsto_nhds_unique hlim' hlimStar + simpa only [vectorTrace, ContinuousLinearMap.star_eq_adjoint] using hresult + +private instance inf_complete (p q : Submodule ℂ H) [CompleteSpace p] [CompleteSpace q] : + CompleteSpace ↥(p ⊓ q) := by + have hp : IsClosed (p : Set H) := (completeSpace_coe_iff_isComplete.mp inferInstance).isClosed + have hq : IsClosed (q : Set H) := (completeSpace_coe_iff_isComplete.mp inferInstance).isClosed + exact (hp.inter hq).completeSpace_coe + +omit [CompleteSpace H] in + +theorem projection_mul_of_le {p q : Submodule ℂ H} + [p.HasOrthogonalProjection] [q.HasOrthogonalProjection] (h : p ≤ q) : + q.starProjection * p.starProjection = p.starProjection := by + ext x + exact q.starProjection_eq_self_iff.mpr (h (p.starProjection_apply_mem x)) + +theorem kernel_projection_complement_mul (p q : Submodule ℂ H) + [CompleteSpace p] [CompleteSpace q] : + ((1 - q.starProjection) * p.starProjection).ker.starProjection = + 1 - p.starProjection + (p ⊓ q).starProjection := by + let A := (1 - q.starProjection) * p.starProjection + let R := (p ⊓ q).starProjection + have hpR : p.starProjection * R = R := projection_mul_of_le inf_le_left + have hRp : R * p.starProjection = R := + Submodule.starProjection_comp_starProjection_of_le inf_le_left + have hqR : q.starProjection * R = R := projection_mul_of_le inf_le_right + have horth : (1 - p.starProjection) * R = 0 := by + rw [sub_mul, one_mul, hpR, sub_self] + have hproj : IsStarProjection (1 - p.starProjection + R) := + isStarProjection_starProjection.one_sub.add isStarProjection_starProjection horth + have hAp : A * (1 - p.starProjection + R) = 0 := by + dsimp [A] + have hpp := p.isIdempotentElem_starProjection.eq + noncomm_ring [hpp, hpR, hqR] + have hrange : (1 - p.starProjection + R).range = A.ker := by + apply le_antisymm + · rintro y ⟨x, rfl⟩ + change A ((1 - p.starProjection + R) x) = 0 + have hx := congrArg (fun B : H →L[ℂ] H => B x) hAp + exact hx + · intro x hx + have hAx : p.starProjection x - q.starProjection (p.starProjection x) = 0 := hx + have hpq : p.starProjection x ∈ p ⊓ q := by + exact ⟨p.starProjection_apply_mem x, + q.starProjection_eq_self_iff.mp (sub_eq_zero.mp hAx).symm⟩ + have hRx : R x = p.starProjection x := by + have h1 : R (p.starProjection x) = p.starProjection x := + (p ⊓ q).starProjection_eq_self_iff.mpr hpq + have h2 := congrArg (fun B : H →L[ℂ] H => B x) hRp + exact h2.symm.trans h1 + refine ⟨x, ?_⟩ + change x - p.starProjection x + R x = x + rw [hRx, sub_add_cancel] + obtain ⟨hinst, heq⟩ := isStarProjection_iff_eq_starProjection_range.mp hproj + simpa only [hrange] using heq.symm + +theorem meet_projection_mem (M : VonNeumannAlgebra H) (p q : Submodule ℂ H) + [CompleteSpace p] [CompleteSpace q] + (hp : p.starProjection ∈ M) (hq : q.starProjection ∈ M) : + (p ⊓ q).starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff isStarProjection_starProjection M).mpr + intro W hW + rw [Submodule.range_starProjection] + have hpW := (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mp hp W hW + have hqW := (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mp hq W hW + rw [Submodule.range_starProjection] at hpW hqW + intro x hx + exact ⟨hpW hx.1, hqW hx.2⟩ + +omit [CompleteSpace H] in + +theorem norm_projection_le_one (p : Submodule ℂ H) [p.HasOrthogonalProjection] : + ‖p.starProjection‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro x + simpa only [one_mul] using p.norm_starProjection_apply_le x + +theorem vectorTrace_meet_lower_bound + (M : VonNeumannAlgebra H) (ξ : H) + (htrace : ∀ a b : H →L[ℂ] H, a ∈ M → b ∈ M → + vectorTrace ξ (a * b) = vectorTrace ξ (b * a)) + (p q : Submodule ℂ H) [CompleteSpace p] [CompleteSpace q] + (hp : p.starProjection ∈ M) (hq : q.starProjection ∈ M) : + (vectorTrace ξ p.starProjection).re + (vectorTrace ξ q.starProjection).re - + ‖ξ‖ ^ 2 ≤ (vectorTrace ξ (p ⊓ q).starProjection).re := by + let A := (1 - q.starProjection) * p.starProjection + have hAmem : A ∈ M := mul_mem (sub_mem (one_mem M) hq) hp + have hqn : ‖1 - q.starProjection‖ ≤ 1 := by + have hh := norm_projection_le_one qᗮ + simpa only [Submodule.starProjection_orthogonal, ContinuousLinearMap.one_def] using hh + have hpn := norm_projection_le_one p + have hAn : ‖A‖ ≤ 1 := by + apply (norm_mul_le _ _).trans + nlinarith [norm_nonneg (1 - q.starProjection), norm_nonneg p.starProjection] + have hstar : A.adjoint = p.starProjection * (1 - q.starProjection) := by + change star A = _ + simp only [A, star_mul, star_sub, star_one, + (isSelfAdjoint_starProjection p).star_eq, (isSelfAdjoint_starProjection q).star_eq] + have hqker : q ≤ A.adjoint.ker := by + intro x hx + change A.adjoint x = 0 + rw [hstar] + change p.starProjection (x - q.starProjection x) = 0 + rw [q.starProjection_eq_self_iff.mpr hx, sub_self, map_zero] + have hmono := TracialProjectionTransport.vectorTrace_projection_mono ξ hqker + have hsame := vectorTrace_kernel_eq_adjoint_kernel M ξ htrace A hAmem hAn + rw [← hsame] at hmono + change (vectorTrace ξ q.starProjection).re ≤ + (vectorTrace ξ (((1 - q.starProjection) * p.starProjection).ker.starProjection)).re at hmono + rw [kernel_projection_complement_mul] at hmono + have hone : (vectorTrace ξ (1 : H →L[ℂ] H)).re = ‖ξ‖ ^ 2 := by + exact inner_self_eq_norm_sq (𝕜 := ℂ) ξ + have hadd : vectorTrace ξ (1 - p.starProjection + (p ⊓ q).starProjection) = + vectorTrace ξ 1 - vectorTrace ξ p.starProjection + + vectorTrace ξ (p ⊓ q).starProjection := by + simp only [vectorTrace, add_apply, sub_apply, inner_add_right, inner_sub_right] + rw [hadd, Complex.add_re, Complex.sub_re, hone] at hmono + linarith + +theorem faithful_vectorTrace_meet_lower_bound + (M : VonNeumannAlgebra H) (ξ : H) (hξ : IsFaithfulTracialVector M ξ) + (p q : Submodule ℂ H) [CompleteSpace p] [CompleteSpace q] + (hp : p.starProjection ∈ M) (hq : q.starProjection ∈ M) : + (vectorTrace ξ p.starProjection).re + (vectorTrace ξ q.starProjection).re - 1 ≤ + (vectorTrace ξ (p ⊓ q).starProjection).re := by + simpa only [hξ.1, one_pow] using vectorTrace_meet_lower_bound M ξ hξ.2.1 p q hp hq + +end Invariant233.ProjectionMeetTrace + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionToCommutant.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionToCommutant.lean new file mode 100644 index 0000000000000000000000000000000000000000..45f73fef5cd901a2664b073eff02179d25a6b1e0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionToCommutant.lean @@ -0,0 +1,73 @@ +import OAI.Analysis.IrrationalRotation.Operators.Commutant +import OAI.Analysis.IrrationalRotation.Operators.HyperinvariantProjection +import OAI.Analysis.IrrationalRotation.Operators.CommutantProper +import OAI.Analysis.IrrationalRotation.Spectral.QuasinilpotentNonscalar + +namespace OAI + +open Filter +open scoped Topology + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem hyperinvariant_subspace_trivial_of_invariant_projection_trivial + (M : VonNeumannAlgebra H) {T : H →L[ℂ] H} (hT : T ∈ M) + (hproj : ∀ p : H →L[ℂ] H, p ∈ M → IsStarProjection p → + (1 - p) * T * p = 0 → p = 0 ∨ p = 1) + (S : Submodule ℂ H) (hS : IsClosed (S : Set H)) + (hhyper : ∀ A : H →L[ℂ] H, Commute A T → + S ∈ Module.End.invtSubmodule A) : + S = ⊥ ∨ S = ⊤ := by + let : CompleteSpace S := hS.completeSpace_coe + obtain ⟨hmem, hinv⟩ := hyperinvariant_subspace_projection_mem M hT S hhyper + rcases hproj S.starProjection hmem isStarProjection_starProjection hinv with hp | hp + · left + rw [← Submodule.range_starProjection S, hp] + simp + · right + rw [← Submodule.range_starProjection S, hp] + exact LinearMap.range_eq_top.mpr Function.surjective_id + +omit [CompleteSpace H] in + +theorem commutant_proper_of_nonzero_norm_quasinilpotent [Nontrivial H] + {T : H →L[ℂ] H} (hT : T ≠ 0) + (hq : Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) atTop (𝓝 0)) : + Subalgebra.centralizer ℂ ({T} : Set (H →L[ℂ] H)) ≠ ⊤ := by + apply centralizer_singleton_ne_top_of_nonscalar + rintro ⟨c, hc⟩ + exact InvariantProjection.continuousLinearMap_not_scalar_of_nonzero_norm_root_tendsto + hT hq c hc + +theorem no_hyperinvariant_of_invariant_projection_trivial + (M : VonNeumannAlgebra H) {T : H →L[ℂ] H} (hT : T ∈ M) + (hproj : ∀ p : H →L[ℂ] H, p ∈ M → IsStarProjection p → + (1 - p) * T * p = 0 → p = 0 ∨ p = 1) : + HasNoNontrivialHyperinvariantSubspace T := by + intro S hS + apply hyperinvariant_subspace_trivial_of_invariant_projection_trivial M hT hproj S hS.1 + intro A hA + have hmem : A ∈ operatorCommutant T := by + rw [operatorCommutant_mem_iff] + exact hA.eq.symm + exact hS.2 A hmem + +theorem proper_stronglyClosed_transitive_commutant_of_projection_obstruction + [Nontrivial H] (M : VonNeumannAlgebra H) {T : H →L[ℂ] H} + (hT : T ∈ M) (hne : T ≠ 0) + (hq : Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) atTop (𝓝 0)) + (hproj : ∀ p : H →L[ℂ] H, p ∈ M → IsStarProjection p → + (1 - p) * T * p = 0 → p = 0 ∨ p = 1) : + HasNoNontrivialHyperinvariantSubspace T ∧ + operatorCommutant T ≠ ⊤ ∧ IsStronglyClosed (operatorCommutant T) ∧ + IsTransitive (operatorCommutant T) := by + have hh := no_hyperinvariant_of_invariant_projection_trivial M hT hproj + exact ⟨hh, commutant_proper_of_nonzero_norm_quasinilpotent hne hq, + operatorCommutant_stronglyClosed T, (operatorCommutant_transitive_iff T).mpr hh⟩ + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionTraceRigidity.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionTraceRigidity.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d27864e5771a8e6bfe5c95c3155c2bbc98f7953 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionTraceRigidity.lean @@ -0,0 +1,106 @@ +import OAI.Analysis.IrrationalRotation.Operators.TracialFiniteness +import OAI.Analysis.IrrationalRotation.Model.NormalAffiliation +import Mathlib.Analysis.InnerProductSpace.Adjoint +import Mathlib.Algebra.Star.StarProjection +import Mathlib.Tactic + +namespace OAI + +noncomputable section +namespace Invariant233.ProjectionTraceRigidity + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +theorem vectorTrace_eq_norm_sq (ξ : H) {p : H →L[ℂ] H} + (hp : IsStarProjection p) : vectorTrace ξ p = (‖p ξ‖ ^ 2 : ℂ) := by + have hpp : p.adjoint * p = p := by + rw [← ContinuousLinearMap.star_eq_adjoint, hp.isSelfAdjoint.star_eq, + hp.isIdempotentElem.eq] + calc + vectorTrace ξ p = inner ℂ ξ ((p.adjoint * p) ξ) := by rw [hpp]; rfl + _ = inner ℂ (p ξ) (p ξ) := by + change inner ℂ ξ (p.adjoint (p ξ)) = _ + rw [ContinuousLinearMap.adjoint_inner_right] + _ = _ := inner_self_eq_norm_sq_to_K _ + +theorem trace_gap_eq_norm_sq (ξ : H) {p q : H →L[ℂ] H} + (hp : IsStarProjection p) (hq : IsStarProjection q) (hpq : p * q = p) : + (vectorTrace ξ q).re - (vectorTrace ξ p).re = ‖(q - p) ξ‖ ^ 2 := by + have h := congrArg Complex.re (vectorTrace_eq_norm_sq ξ (hp.sub_of_mul_eq_left hq hpq)) + simpa only [vectorTrace, sub_apply, inner_sub_right, Complex.sub_re, + ← Complex.ofReal_pow, Complex.ofReal_re] using h + +theorem trace_mono (ξ : H) {p q : H →L[ℂ] H} + (hp : IsStarProjection p) (hq : IsStarProjection q) (hpq : p * q = p) : + (vectorTrace ξ p).re ≤ (vectorTrace ξ q).re := by + have h := trace_gap_eq_norm_sq ξ hp hq hpq + nlinarith [sq_nonneg ‖(q - p) ξ‖] + +variable {M : VonNeumannAlgebra H} {ξ : H} + +theorem trace_re_eq_zero_iff (hξ : IsFaithfulTracialVector M ξ) + {p : H →L[ℂ] H} (hmem : p ∈ M) (hp : IsStarProjection p) : + (vectorTrace ξ p).re = 0 ↔ p = 0 := by + constructor + · intro hzero + apply hξ.2.2 p hmem (ContinuousLinearMap.IsPositive.of_isStarProjection hp) + rw [vectorTrace_eq_norm_sq ξ hp] at hzero ⊢ + norm_cast at hzero ⊢ + · rintro rfl + simp [vectorTrace] + +theorem trace_re_eq_iff_of_nested (hξ : IsFaithfulTracialVector M ξ) + {p q : H →L[ℂ] H} (hpm : p ∈ M) (hqm : q ∈ M) + (hp : IsStarProjection p) (hq : IsStarProjection q) (hpq : p * q = p) : + (vectorTrace ξ p).re = (vectorTrace ξ q).re ↔ p = q := by + constructor + · intro heq + apply hξ.projection_eq_of_trace_eq hpm hqm hp hq hpq + apply Complex.ext heq + rw [vectorTrace_eq_norm_sq ξ hp, vectorTrace_eq_norm_sq ξ hq] + simp only [← Complex.ofReal_pow, Complex.ofReal_im] + · rintro rfl + rfl + +theorem trace_eq_iff_of_nested (hξ : IsFaithfulTracialVector M ξ) + {p q : H →L[ℂ] H} (hpm : p ∈ M) (hqm : q ∈ M) + (hp : IsStarProjection p) (hq : IsStarProjection q) (hpq : p * q = p) : + vectorTrace ξ p = vectorTrace ξ q ↔ p = q := by + constructor + · intro h + exact (trace_re_eq_iff_of_nested hξ hpm hqm hp hq hpq).mp (congrArg Complex.re h) + · rintro rfl + rfl + +theorem trace_lt_of_nested_ne (hξ : IsFaithfulTracialVector M ξ) + {p q : H →L[ℂ] H} (hpm : p ∈ M) (hqm : q ∈ M) + (hp : IsStarProjection p) (hq : IsStarProjection q) + (hpq : p * q = p) (hne : p ≠ q) : + (vectorTrace ξ p).re < (vectorTrace ξ q).re := + lt_of_le_of_ne (trace_mono ξ hp hq hpq) + (fun h => hne ((trace_re_eq_iff_of_nested hξ hpm hqm hp hq hpq).mp h)) + +theorem trace_re_eq_one_iff (hξ : IsFaithfulTracialVector M ξ) + {p : H →L[ℂ] H} (hmem : p ∈ M) (hp : IsStarProjection p) : + (vectorTrace ξ p).re = 1 ↔ p = 1 := by + have hone : (vectorTrace ξ (1 : H →L[ℂ] H)).re = 1 := by + rw [vectorTrace_eq_norm_sq ξ (IsStarProjection.one _)] + simp [hξ.1] + rw [← hone] + exact trace_re_eq_iff_of_nested hξ hmem (one_mem M) hp (IsStarProjection.one _) (mul_one p) + +theorem trivial_iff_of_trace_eq (hξ : IsFaithfulTracialVector M ξ) + {p q : H →L[ℂ] H} (hpm : p ∈ M) (hqm : q ∈ M) + (hp : IsStarProjection p) (hq : IsStarProjection q) + (htrace : vectorTrace ξ p = vectorTrace ξ q) : + (p = 0 ∨ p = 1) ↔ (q = 0 ∨ q = 1) := by + have hreal := congrArg Complex.re htrace + rw [← trace_re_eq_zero_iff hξ hpm hp, ← trace_re_eq_one_iff hξ hpm hp, + ← trace_re_eq_zero_iff hξ hqm hq, ← trace_re_eq_one_iff hξ hqm hq, hreal] + +end Invariant233.ProjectionTraceRigidity + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionTruncationMass.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionTruncationMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..aff231264c3c4eee02e3037ac1996053ab0819cf --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ProjectionTruncationMass.lean @@ -0,0 +1,64 @@ +import OAI.Analysis.IrrationalRotation.Rotation.ParameterPositiveDiagonal +import OAI.Analysis.IrrationalRotation.Rotation.CircleTruncationMass + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal InnerProductSpace + +namespace Invariant233.CircleParameterLaws + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +local notation "e₀" => PositiveDiagonalModel.e0 + +theorem exists_projection_truncation_mass_threshold (hθ : Irrational θ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) + (P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert) + (hPm : P ∈ Rotation.algebra θ) (hP : IsStarProjection P) + (hinv : (1 - P) * p.measurableOperator θ hp * P = 0) + (hP0 : P ≠ 0) (hP1 : P ≠ 1) + (F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber) + (hbound : ∀ x, ‖F x‖ ≤ ‖P‖) + (hmeas : ∀ v, StronglyMeasurable fun x => F x v) + (hrep : ∀ ξ : Rotation.Hilbert, P ξ =ᵐ[circleMeasure] fun x => F x (ξ x)) : + ∃ J : ℕ, 1 ≤ J ∧ ∀ j : ℕ, J ≤ j → + Real.exp (-90) / 2 ≤ (CircleCoupling.law p j).real + (CircleCoupling.truncationEvent p j hr + (fun x => (inner ℂ e₀ (F x e₀)).re)) := by + let r : Circle → ℝ := fun x => (inner ℂ e₀ (F x e₀)).re + have hm : Measurable r := + ((Complex.continuous_re.comp (continuous_const.inner continuous_id)).comp_stronglyMeasurable + (hmeas e₀)).measurable + have hi : ∀ᵐ x ∂(volume : Measure Circle), 0 < r x ∧ r x < 1 := + hp.ae_strict_diagonal_measurableOperator_of_nontrivial hθ P hPm hP hinv + hP0 hP1 F hbound hmeas hrep + exact CircleCoupling.exists_truncationEvent_mass_threshold hp hr (r := r) hm hi + +theorem exists_rational_graph_field_with_truncation_mass (hθ : Irrational θ) + (hr : ∀ i, 0 < MixedRadix.radices p.q i) + {P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert} + (hPm : P ∈ Rotation.algebra θ) (hP : IsStarProjection P) + (hinv : (1 - P) * p.measurableOperator θ hp * P = 0) + (hP0 : P ≠ 0) (hP1 : P ≠ 1) : + ∃ F : Circle → Rotation.Fiber →L[ℂ] Rotation.Fiber, + (∀ x, IsStarProjection (F x)) ∧ + (∀ x, ‖F x‖ ≤ ‖P‖) ∧ + (∀ v, StronglyMeasurable fun x => F x v) ∧ + (∀ ξ : Rotation.Hilbert, P ξ =ᵐ[circleMeasure] fun x => F x (ξ x)) ∧ + p.RationalGraphIdentities θ F ∧ + ∃ J : ℕ, 1 ≤ J ∧ ∀ j : ℕ, J ≤ j → + Real.exp (-90) / 2 ≤ (CircleCoupling.law p j).real + (CircleCoupling.truncationEvent p j hr + (fun x => (inner ℂ e₀ (F x e₀)).re)) := by + obtain ⟨F, hproj, hbound, hmeas, hrep, hgraph, _⟩ := + hp.exists_strict_rational_graph_field hθ hPm hP hinv hP0 hP1 + exact ⟨F, hproj, hbound, hmeas, hrep, hgraph, + hp.exists_projection_truncation_mass_threshold hθ hr P hPm hP hinv hP0 hP1 + F hbound hmeas hrep⟩ + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/RepresentedCommutation.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/RepresentedCommutation.lean new file mode 100644 index 0000000000000000000000000000000000000000..77425c345c77883a8d95bee2700650a9dbdaef33 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/RepresentedCommutation.lean @@ -0,0 +1,41 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplierFields + +namespace OAI + +namespace Invariant233.DirectIntegral + +open MeasureTheory Filter +open scoped ENNReal + +variable {X E ι : Type*} [MeasurableSpace X] {μ : Measure X} + [IsFiniteMeasure μ] [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [Countable ι] + +omit [IsFiniteMeasure μ] in +theorem represented_mul + (T U : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A B : X → E →L[ℂ] E) + (hT : ∀ f : Lp E 2 μ, T f =ᵐ[μ] fun x => A x (f x)) + (hU : ∀ f : Lp E 2 μ, U f =ᵐ[μ] fun x => B x (f x)) + (f : Lp E 2 μ) : + (T * U) f =ᵐ[μ] fun x => (A x * B x) (f x) := by + filter_upwards [hT (U f), hU f] with x hx hy + change T (U f) x = A x (B x (f x)) + rw [hx, hy] + +theorem ae_commute_of_represented_commute + (b : HilbertBasis ι ℂ E) + (T U : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A B : X → E →L[ℂ] E) + (hT : ∀ f : Lp E 2 μ, T f =ᵐ[μ] fun x => A x (f x)) + (hU : ∀ f : Lp E 2 μ, U f =ᵐ[μ] fun x => B x (f x)) + (hcomm : Commute T U) : ∀ᵐ x ∂μ, Commute (A x) (B x) := by + have hAB : (fun x => A x * B x) =ᵐ[μ] (fun x => B x * A x) := by + apply L2Multiplication.field_unique_of_representation b (T * U) + · exact represented_mul T U A B hT hU + · rw [hcomm.eq] + exact represented_mul U T B A hU hT + filter_upwards [hAB] with x hx + exact hx + +end Invariant233.DirectIntegral + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/RepresentedFieldCommutation.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/RepresentedFieldCommutation.lean new file mode 100644 index 0000000000000000000000000000000000000000..8103759702b0388ca82aba39812d6a909677ad44 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/RepresentedFieldCommutation.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplierFields +import OAI.Analysis.IrrationalRotation.Analysis.FieldKoopman + +namespace OAI + +noncomputable section +open MeasureTheory Filter + +namespace Invariant233.DirectIntegral + +variable {X E ι : Type*} [MeasurableSpace X] {μ : Measure X} [IsFiniteMeasure μ] + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [Countable ι] + +theorem ae_commute_of_representations (b : HilbertBasis ι ℂ E) + (T B : Lp E 2 μ →L[ℂ] Lp E 2 μ) (F G : X → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, T ξ =ᵐ[μ] fun x => F x (ξ x)) + (hB : ∀ ξ : Lp E 2 μ, B ξ =ᵐ[μ] fun x => G x (ξ x)) + (hcomm : Commute T B) : ∀ᵐ x ∂μ, Commute (F x) (G x) := by + apply L2Multiplication.field_unique_of_representation b (T * B) + (fun x => F x * G x) (fun x => G x * F x) + · intro ξ + filter_upwards [hT (B ξ), hB ξ] with x hx hy + change T (B ξ) x = F x (G x (ξ x)) + rw [hx, hy] + · intro ξ + rw [hcomm.eq] + filter_upwards [hB (T ξ), hT ξ] with x hx hy + change B (T ξ) x = G x (F x (ξ x)) + rw [hx, hy] + +theorem ae_covariance_of_represented_commute (b : HilbertBasis ι ℂ E) + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (F : X → E →L[ℂ] E) + (S : E →L[ℂ] E) (σ : X → X) (hσ : MeasurePreserving σ μ μ) + (hT : ∀ ξ : Lp E 2 μ, T ξ =ᵐ[μ] fun x => F x (ξ x)) + (hcomm : Commute T (shiftedPullback S σ hσ)) : + ∀ᵐ x ∂μ, F x * S = S * F (σ x) := by + apply Fields.ae_eq_of_countable_columns + (Submodule.dense_iff_topologicalClosure_eq_top.mpr b.dense_span) + intro i + let ξ : Lp E 2 μ := Lp.const 2 μ (b i) + let J := shiftedPullback S σ hσ + have heq : T (J ξ) = J (T ξ) := + congrArg (fun A : Lp E 2 μ →L[ℂ] Lp E 2 μ => A ξ) hcomm.eq + filter_upwards [hT (J ξ), FieldKoopman.operator_ae S σ hσ ξ, + FieldKoopman.operator_ae S σ hσ (T ξ), + hσ.quasiMeasurePreserving.ae (hT ξ), + hσ.quasiMeasurePreserving.ae (Lp.coeFn_const 2 μ (b i))] + with x hTJ hJ hJT hTσ hξ + have hx := congrArg (fun η : Lp E 2 μ => η x) heq + change ξ (σ x) = b i at hξ + change T (J ξ) x = J (T ξ) x at hx + rw [hTJ, hJ, hJT, hTσ, hξ] at hx + exact hx + +end Invariant233.DirectIntegral + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/ScalarMultiplierCommutation.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/ScalarMultiplierCommutation.lean new file mode 100644 index 0000000000000000000000000000000000000000..79f9a1bb76642d4d1ee1ebf98516932fd3a4c855 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/ScalarMultiplierCommutation.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplier +import Mathlib.Analysis.InnerProductSpace.Adjoint + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal + +namespace Invariant233.L2Multiplication + +variable {X E : Type*} [MeasurableSpace X] {μ : Measure X} + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +omit [CompleteSpace E] in + +theorem commute_multiplier_of_represented + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) (A : X → E →L[ℂ] E) + (hT : ∀ ξ : Lp E 2 μ, T ξ =ᵐ[μ] fun x => A x (ξ x)) + (g : Lp ℂ ∞ μ) : Commute T (multiplier g) := by + apply ContinuousLinearMap.ext + intro ξ + apply Lp.ext + filter_upwards [hT (multiplier g ξ), multiplier_coe g ξ, + multiplier_coe g (T ξ), hT ξ] with x hTM hM hMT hTx + change T (multiplier g ξ) x = multiplier g (T ξ) x + rw [hTM, hM, hMT, hTx, map_smul] + +theorem multiplier_star (g : Lp ℂ ∞ μ) : + (multiplier (star g) : Lp E 2 μ →L[ℂ] Lp E 2 μ) = + star (multiplier g : Lp E 2 μ →L[ℂ] Lp E 2 μ) := by + rw [ContinuousLinearMap.star_eq_adjoint] + apply (ContinuousLinearMap.eq_adjoint_iff _ _).2 + intro ξ η + simp only [L2.inner_def] + apply integral_congr_ae + filter_upwards [multiplier_coe (star g) ξ, multiplier_coe g η, + Lp.coeFn_star g] with x hx hy hg + rw [hx, hy, hg] + simp only [Pi.star_apply, inner_smul_left, inner_smul_right, starRingEnd_apply, star_star] + +theorem star_commutes_multiplier + (T : Lp E 2 μ →L[ℂ] Lp E 2 μ) + (hT : ∀ g : Lp ℂ ∞ μ, Commute T (multiplier g)) + (g : Lp ℂ ∞ μ) : Commute (star T) (multiplier g) := by + change star T * multiplier g = multiplier g * star T + have h := congrArg star (hT (star g)).eq + simpa only [star_mul, ← multiplier_star, star_star] using h.symm + +end Invariant233.L2Multiplication + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/StrongOperatorConvergence.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/StrongOperatorConvergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..36cb7ce23e6f5629ce92da5ab92c4fcbf8761304 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/StrongOperatorConvergence.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.IrrationalRotation.Analysis.StrongFieldContinuity +import Mathlib.Analysis.InnerProductSpace.l2Space + +namespace OAI + +open Filter +open scoped Topology +namespace Invariant233 + +variable {𝕜 E F ι : Type*} [NontriviallyNormedField 𝕜] + [NormedAddCommGroup E] [NormedSpace 𝕜 E] + [NormedAddCommGroup F] [NormedSpace 𝕜 F] + +theorem strong_tendsto_of_dense_of_bounded + {l : Filter ι} {A : ι → E →L[𝕜] F} {A₀ : E →L[𝕜] F} + {s : Set E} {C : ℝ} (hs : Dense s) + (hA : ∀ w ∈ s, Tendsto (fun i => A i w) l (𝓝 (A₀ w))) + (hC : ∀ᶠ i in l, ‖A i‖ ≤ C) (v : E) : + Tendsto (fun i => A i v) l (𝓝 (A₀ v)) := by + apply Metric.tendsto_nhds.mpr + intro ε hε + let M : ℝ := max C 0 + ‖A₀‖ + 1 + have hM : 0 < M := by dsimp [M]; positivity + have hCM : C ≤ M := by dsimp [M]; have := le_max_left C 0; have := norm_nonneg A₀; linarith + have hAM : ‖A₀‖ ≤ M := by dsimp [M]; have := le_max_right C 0; linarith + obtain ⟨w, hws, hvw⟩ := hs.exists_dist_lt v (div_pos (show 0 < ε / 3 by positivity) hM) + have hMw : M * dist v w < ε / 3 := by + simpa [mul_comm] using (lt_div_iff₀ hM).mp hvw + have hw := Metric.tendsto_nhds.mp (hA w hws) (ε / 3) (by positivity) + filter_upwards [hC, hw] with i hi hwi + have hfirst : dist (A i v) (A i w) < ε / 3 := + ((A i).dist_le_opNorm v w).trans_lt + ((mul_le_mul_of_nonneg_right (hi.trans hCM) dist_nonneg).trans_lt hMw) + have hlast : dist (A₀ w) (A₀ v) < ε / 3 := by + rw [dist_comm] + exact (A₀.dist_le_opNorm v w).trans_lt + ((mul_le_mul_of_nonneg_right hAM dist_nonneg).trans_lt hMw) + have htri := dist_triangle (A i v) (A i w) (A₀ v) + have htri' := dist_triangle (A i w) (A₀ w) (A₀ v) + linarith + +theorem strong_tendsto_of_dense_span_of_bounded + {κ : Type*} {l : Filter ι} {A : ι → E →L[𝕜] F} {A₀ : E →L[𝕜] F} + {b : κ → E} {C : ℝ} + (hb : Dense (Submodule.span 𝕜 (Set.range b) : Set E)) + (hA : ∀ k, Tendsto (fun i => A i (b k)) l (𝓝 (A₀ (b k)))) + (hC : ∀ᶠ i in l, ‖A i‖ ≤ C) (v : E) : + Tendsto (fun i => A i v) l (𝓝 (A₀ v)) := by + apply strong_tendsto_of_dense_of_bounded hb ?_ hC v + intro w hw + induction hw using Submodule.span_induction with + | mem w hw => obtain ⟨k, rfl⟩ := hw; exact hA k + | zero => simpa only [map_zero] using (tendsto_const_nhds : Tendsto (fun _ : ι => (0 : F)) l (𝓝 0)) + | add w z hw hz ihw ihz => simpa only [map_add] using ihw.add ihz + | smul c w hw ih => simpa only [map_smul] using ih.const_smul c + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/StrongOperatorIntegral.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/StrongOperatorIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..a420a6fb6a9c823c303c5c0ed07c75eb2365ee7d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/StrongOperatorIntegral.lean @@ -0,0 +1,70 @@ +import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +import Mathlib.Analysis.Normed.Operator.Basic + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.StrongOperatorIntegral + +variable {X E F : Type*} [MeasurableSpace X] + [NormedAddCommGroup E] [NormedSpace ℂ E] + [NormedAddCommGroup F] [NormedSpace ℂ F] [CompleteSpace F] + {μ : Measure X} [IsProbabilityMeasure μ] + +def linearMap (A : X → E →L[ℂ] F) + (hint : ∀ v, Integrable (fun x => A x v) μ) : E →ₗ[ℂ] F where + toFun v := ∫ x, A x v ∂μ + map_add' v w := by + simp only [map_add] + exact integral_add (hint v) (hint w) + map_smul' c v := by + simp only [map_smul] + exact integral_smul c (fun x => A x v) + +omit [CompleteSpace F] in + +theorem norm_linearMap_le (A : X → E →L[ℂ] F) + (hint : ∀ v, Integrable (fun x => A x v) μ) + {C : ℝ} (hbound : ∀ᵐ x ∂μ, ‖A x‖ ≤ C) (v : E) : + ‖linearMap A hint v‖ ≤ C * ‖v‖ := by + change ‖∫ x, A x v ∂μ‖ ≤ C * ‖v‖ + have h := norm_integral_le_of_norm_le_const (μ := μ) + (C := C * ‖v‖) (f := fun x => A x v) (by + filter_upwards [hbound] with x hx + exact ((A x).le_opNorm v).trans + (mul_le_mul_of_nonneg_right hx (norm_nonneg v))) + simpa using h + +def operator (A : X → E →L[ℂ] F) + (hint : ∀ v, Integrable (fun x => A x v) μ) + (C : ℝ) (hbound : ∀ᵐ x ∂μ, ‖A x‖ ≤ C) : E →L[ℂ] F := + (linearMap A hint).mkContinuous C (norm_linearMap_le A hint hbound) + +omit [CompleteSpace F] in +@[simp] theorem operator_apply (A : X → E →L[ℂ] F) + (hint : ∀ v, Integrable (fun x => A x v) μ) + (C : ℝ) (hbound : ∀ᵐ x ∂μ, ‖A x‖ ≤ C) (v : E) : + operator A hint C hbound v = ∫ x, A x v ∂μ := rfl + +omit [CompleteSpace F] in +theorem norm_operator_le (A : X → E →L[ℂ] F) + (hint : ∀ v, Integrable (fun x => A x v) μ) + (C : ℝ) (hC : 0 ≤ C) (hbound : ∀ᵐ x ∂μ, ‖A x‖ ≤ C) : + ‖operator A hint C hbound‖ ≤ C := + LinearMap.mkContinuous_norm_le _ hC _ + +variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℂ G] [CompleteSpace G] + +theorem test_operator (L : F →L[ℂ] G) (A : X → E →L[ℂ] F) + (hint : ∀ v, Integrable (fun x => A x v) μ) + (C : ℝ) (hbound : ∀ᵐ x ∂μ, ‖A x‖ ≤ C) (v : E) : + L (operator A hint C hbound v) = ∫ x, L (A x v) ∂μ := + (L.integral_comp_comm (hint v)).symm + +end Invariant233.StrongOperatorIntegral + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TowerBlockAlgebras.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TowerBlockAlgebras.lean new file mode 100644 index 0000000000000000000000000000000000000000..1984708a0abe532259a85859b537b682a488cfeb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TowerBlockAlgebras.lean @@ -0,0 +1,145 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TowerMatrixUnits + +namespace OAI + +noncomputable section +namespace Invariant233.TowerMatrixUnits + +variable {A : Type*} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] +variable {β : Type*} {ι : β → Type*} [∀ b, DecidableEq (ι b)] + +structure IsBlockMatrixUnitFamily (e : (b : β) → ι b → ι b → A) : Prop where + block : ∀ b, IsMatrixUnitFamily (e b) + cross : ∀ b c, b ≠ c → ∀ i j k l, e b i j * e c k l = 0 + +def blockMatrixGenerators (e : (b : β) → ι b → ι b → A) : Set A := + insert 1 (Set.range fun t : Σ b, ι b × ι b => e t.1 t.2.1 t.2.2) + +omit [StarRing A] [StarModule ℂ A] [∀ block, DecidableEq (ι block)] in +theorem blockMatrixUnit_mem_span (e : (b : β) → ι b → ι b → A) + (b : β) (i j : ι b) : e b i j ∈ Submodule.span ℂ (blockMatrixGenerators e) := + Submodule.subset_span (Set.mem_insert_of_mem _ ⟨⟨b, i, j⟩, rfl⟩) + +omit [StarModule ℂ A] in +theorem blockMatrixGenerators_mul (e : (b : β) → ι b → ι b → A) + (he : IsBlockMatrixUnitFamily e) : + ∀ x ∈ blockMatrixGenerators e, ∀ y ∈ blockMatrixGenerators e, + x * y ∈ Submodule.span ℂ (blockMatrixGenerators e) := by + classical + rintro x (rfl | ⟨⟨b, i, j⟩, rfl⟩) y hy + · simpa using Submodule.subset_span hy + · rcases hy with rfl | ⟨⟨c, k, l⟩, rfl⟩ + · simpa using blockMatrixUnit_mem_span e b i j + · by_cases hbc : b = c + · subst c + rw [(he.block b).mul] + split_ifs + · exact blockMatrixUnit_mem_span e b i l + · exact Submodule.zero_mem _ + · rw [he.cross b c hbc] + exact Submodule.zero_mem _ + +omit [StarModule ℂ A] in +theorem blockMatrixGenerators_star (e : (b : β) → ι b → ι b → A) + (he : IsBlockMatrixUnitFamily e) : + ∀ x ∈ blockMatrixGenerators e, star x ∈ Submodule.span ℂ (blockMatrixGenerators e) := by + rintro x (rfl | ⟨⟨b, i, j⟩, rfl⟩) + · simpa using (Submodule.subset_span (Set.mem_insert 1 _) : + (1 : A) ∈ Submodule.span ℂ (blockMatrixGenerators e)) + · rw [(he.block b).star] + exact blockMatrixUnit_mem_span e b j i + +def blockMatrixAlgebra (e : (b : β) → ι b → ι b → A) + (he : IsBlockMatrixUnitFamily e) : StarSubalgebra ℂ A := + spanStarAlgebra (blockMatrixGenerators e) (Submodule.subset_span (Set.mem_insert 1 _)) + (blockMatrixGenerators_mul e he) (blockMatrixGenerators_star e he) + +theorem blockMatrixAlgebra_finiteDimensional [Finite β] [∀ b, Finite (ι b)] + (e : (b : β) → ι b → ι b → A) (he : IsBlockMatrixUnitFamily e) : + FiniteDimensional ℂ (blockMatrixAlgebra e he) := + spanStarAlgebra_finiteDimensional _ ((Set.finite_range _).insert 1) _ _ _ + +@[simp] theorem blockMatrixUnit_mem_blockMatrixAlgebra + (e : (b : β) → ι b → ι b → A) (he : IsBlockMatrixUnitFamily e) + (b : β) (i j : ι b) : e b i j ∈ blockMatrixAlgebra e he := + blockMatrixUnit_mem_span e b i j + +theorem blockMatrixAlgebra_le (e : (b : β) → ι b → ι b → A) + (he : IsBlockMatrixUnitFamily e) (B : StarSubalgebra ℂ A) + (heB : ∀ b i j, e b i j ∈ B) : blockMatrixAlgebra e he ≤ B := by + apply spanStarAlgebra_le + rintro x (rfl | ⟨⟨b, i, j⟩, rfl⟩) + · exact B.one_mem + · exact heB b i j + +theorem blockMatrixAlgebra_eq_adjoin (e : (b : β) → ι b → ι b → A) + (he : IsBlockMatrixUnitFamily e) : + blockMatrixAlgebra e he = StarAlgebra.adjoin ℂ + (Set.range fun t : Σ b, ι b × ι b => e t.1 t.2.1 t.2.2) := by + apply le_antisymm + · apply blockMatrixAlgebra_le + intro b i j + exact StarAlgebra.subset_adjoin ℂ _ ⟨⟨b, i, j⟩, rfl⟩ + · apply StarAlgebra.adjoin_le + rintro _ ⟨⟨b, i, j⟩, rfl⟩ + exact blockMatrixUnit_mem_blockMatrixAlgebra e he b i j + +omit [Algebra ℂ A] [StarModule ℂ A] in +theorem compressed_cross_eq_zero {u v p q : A} + (hu : u ∈ unitary A) (hv : v ∈ unitary A) + (h : (u * p * star u) * (v * q * star v) = 0) : + p * star u * v * q = 0 := by + have h' := congrArg (fun x : A => star u * x * v) h + have hu' := Unitary.star_mul_self_of_mem hu + have hv' := Unitary.star_mul_self_of_mem hv + simp only [← mul_assoc, hu', one_mul, mul_zero, zero_mul] at h' + simpa only [mul_assoc, hv', mul_one] using h' + +omit [Algebra ℂ A] [StarModule ℂ A] in +theorem towerEntry_cross_eq_zero {γ δ : Type*} (u : γ → A) (v : δ → A) + (hu : ∀ i, u i ∈ unitary A) (hv : ∀ j, v j ∈ unitary A) (p q : A) + (horth : ∀ i j, towerEntry u p i i * towerEntry v q j j = 0) + (i j : γ) (k l : δ) : towerEntry u p i j * towerEntry v q k l = 0 := by + have hzero := compressed_cross_eq_zero (hu j) (hv k) (horth j k) + calc + towerEntry u p i j * towerEntry v q k l = + u i * (p * star (u j) * v k * q) * star (v l) := by + simp only [towerEntry, mul_assoc] + _ = 0 := by rw [hzero, mul_zero, zero_mul] + +omit [Algebra ℂ A] [StarModule ℂ A] in +theorem towerEntry_isBlockMatrixUnitFamily (u : (b : β) → ι b → A) (p : β → A) + (hu : ∀ b i, u b i ∈ unitary A) (hp : ∀ b, IsStarProjection (p b)) + (hself : ∀ b i j, i ≠ j → + towerEntry (u b) (p b) i i * towerEntry (u b) (p b) j j = 0) + (hcross : ∀ b c, b ≠ c → ∀ i j, + towerEntry (u b) (p b) i i * towerEntry (u c) (p c) j j = 0) : + IsBlockMatrixUnitFamily (fun b => towerEntry (u b) (p b)) := by + refine ⟨fun b => towerEntry_isMatrixUnitFamily (u b) (hu b) (hp b) (hself b), ?_⟩ + intro b c hbc i j k l + exact towerEntry_cross_eq_zero (u b) (u c) (hu b) (hu c) (p b) (p c) + (hcross b c hbc) i j k l + +theorem exists_finiteDimensional_blockTowerAlgebra [Finite β] [∀ b, Finite (ι b)] + (u : (b : β) → ι b → A) (p : β → A) + (hu : ∀ b i, u b i ∈ unitary A) (hp : ∀ b, IsStarProjection (p b)) + (hself : ∀ b i j, i ≠ j → + towerEntry (u b) (p b) i i * towerEntry (u b) (p b) j j = 0) + (hcross : ∀ b c, b ≠ c → ∀ i j, + towerEntry (u b) (p b) i i * towerEntry (u c) (p c) j j = 0) + (B : StarSubalgebra ℂ A) (hpB : ∀ b, p b ∈ B) (huB : ∀ b i, u b i ∈ B) : + ∃ C : StarSubalgebra ℂ A, C ≤ B ∧ FiniteDimensional ℂ C ∧ + (∀ b i j, towerEntry (u b) (p b) i j ∈ C) := by + let e := fun b => towerEntry (u b) (p b) + let he := towerEntry_isBlockMatrixUnitFamily u p hu hp hself hcross + refine ⟨blockMatrixAlgebra e he, ?_, blockMatrixAlgebra_finiteDimensional e he, + blockMatrixUnit_mem_blockMatrixAlgebra e he⟩ + apply blockMatrixAlgebra_le + intro b i j + exact B.mul_mem (B.mul_mem (huB b i) (hpB b)) (B.star_mem' (huB b j)) + +end Invariant233.TowerMatrixUnits + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TowerTraceBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TowerTraceBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..1783021dbb3054f8960ab5bc1ceaaabc1dd49fd7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TowerTraceBounds.lean @@ -0,0 +1,124 @@ +import OAI.Analysis.IrrationalRotation.Operators.TowerBlockAlgebras +import OAI.Analysis.IrrationalRotation.Analysis.TowerApproximationBounds + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Invariant233.TowerTraceBounds +open TowerMatrixUnits + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] {M : VonNeumannAlgebra H} {ξ : H} + {β : Type*} [Fintype β] {ι : β → Type*} [∀ b, Fintype (ι b)] + [∀ b, DecidableEq (ι b)] + (e : (b : β) → ι b → ι b → H →L[ℂ] H) + (he : IsBlockMatrixUnitFamily e) + +include he + +omit [Fintype β] [∀ b, Fintype (ι b)] in + +theorem diagonal_isStarProjection (b : β) (i : ι b) : + IsStarProjection (e b i i) := by + constructor + · change e b i i * e b i i = e b i i + simpa using (he.block b).mul i i i i + · exact (he.block b).star i i + +omit [∀ b, Fintype (ι b)] in + +theorem selectedFloor_isStarProjection (top : ∀ b, ι b) : + IsStarProjection (∑ b, e b (top b) (top b)) := by + classical + constructor + · change (∑ b, e b (top b) (top b)) * (∑ b, e b (top b) (top b)) = _ + rw [Finset.sum_mul] + apply Finset.sum_congr rfl + intro b hb + rw [Finset.mul_sum, Finset.sum_eq_single b] + · simpa using (he.block b).mul (top b) (top b) (top b) (top b) + · intro c hc hcb + exact he.cross b c (Ne.symm hcb) _ _ _ _ + · simp + · change star (∑ b, e b (top b) (top b)) = _ + rw [star_sum] + exact Finset.sum_congr rfl (fun b _ => (he.block b).star _ _) + +omit [Fintype β] [∀ b, Fintype (ι b)] in + +theorem diagonal_trace_eq (htrace : IsFaithfulTracialVector M ξ) + (hmem : ∀ b i j, e b i j ∈ M) (b : β) (i j : ι b) : + vectorTrace ξ (e b i i) = vectorTrace ξ (e b j j) := by + have h := htrace.2.1 (e b i j) (e b j i) (hmem b i j) (hmem b j i) + simpa only [(he.block b).mul, ite_true] using h + +omit he [CompleteSpace H] in + +theorem vectorTrace_sum_re {κ : Type*} [Fintype κ] (f : κ → H →L[ℂ] H) : + (vectorTrace ξ (∑ k, f k)).re = ∑ k, (vectorTrace ξ (f k)).re := by + simp only [vectorTrace, sum_apply, inner_sum] + exact map_sum Complex.reAddGroupHom _ _ + +theorem height_weighted_trace_eq_one (htrace : IsFaithfulTracialVector M ξ) + (hmem : ∀ b i j, e b i j ∈ M) (top : ∀ b, ι b) + (hcomplete : ∑ b, ∑ i, e b i i = 1) : + (∑ b, (Fintype.card (ι b) : ℝ) * (vectorTrace ξ (e b (top b) (top b))).re) = 1 := by + have heq := congrArg (fun T : H →L[ℂ] H => (vectorTrace ξ T).re) hcomplete + rw [vectorTrace_sum_re] at heq + simp_rw [vectorTrace_sum_re, diagonal_trace_eq e he htrace hmem _ _ (top _)] at heq + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] at heq + have hone : (vectorTrace ξ (1 : H →L[ℂ] H)).re = 1 := by + change (inner ℂ ξ ξ).re = 1 + calc + (inner ℂ ξ ξ).re = ‖ξ‖ ^ 2 := inner_self_eq_norm_sq (𝕜 := ℂ) ξ + _ = 1 := by rw [htrace.1]; norm_num + exact heq.trans hone + +theorem selectedFloor_trace_le_inv_height (htrace : IsFaithfulTracialVector M ξ) + (hmem : ∀ b i j, e b i j ∈ M) (top : ∀ b, ι b) + (hcomplete : ∑ b, ∑ i, e b i i = 1) + (N : ℕ) (hN : 0 < N) (hheight : ∀ b, N ≤ Fintype.card (ι b)) : + (vectorTrace ξ (∑ b, e b (top b) (top b))).re ≤ 1 / (N : ℝ) := by + have hnonneg (b : β) : 0 ≤ (vectorTrace ξ (e b (top b) (top b))).re := by + rw [TowerApproximation.vectorTrace_projection_re _ + (diagonal_isStarProjection e he b (top b)) ξ] + positivity + have hcount := height_weighted_trace_eq_one e he htrace hmem top hcomplete + rw [vectorTrace_sum_re] + apply (le_div_iff₀ (show (0 : ℝ) < N by exact_mod_cast hN)).mpr + calc + (∑ b, (vectorTrace ξ (e b (top b) (top b))).re) * (N : ℝ) = + ∑ b, (N : ℝ) * (vectorTrace ξ (e b (top b) (top b))).re := by + rw [Finset.sum_mul] + exact Finset.sum_congr rfl (fun b _ => mul_comm _ _) + _ ≤ ∑ b, (Fintype.card (ι b) : ℝ) * + (vectorTrace ξ (e b (top b) (top b))).re := by + apply Finset.sum_le_sum + intro b hb + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hheight b) (hnonneg b) + _ = 1 := hcount + +theorem norm_sub_apply_sq_le_four_div_height + (htrace : IsFaithfulTracialVector M ξ) + (hmem : ∀ b i j, e b i j ∈ M) (top : ∀ b, ι b) + (hcomplete : ∑ b, ∑ i, e b i i = 1) + (N : ℕ) (hN : 0 < N) (hheight : ∀ b, N ≤ Fintype.card (ι b)) + {A B : H →L[ℂ] H} (hA : ‖A‖ ≤ 1) (hB : ‖B‖ ≤ 1) + (hagree : A * (1 - ∑ b, e b (top b) (top b)) = + B * (1 - ∑ b, e b (top b) (top b))) : + ‖A ξ - B ξ‖ ^ 2 ≤ 4 / (N : ℝ) := by + have hp := selectedFloor_isStarProjection e he top + have hb := TowerApproximation.norm_sub_apply_sq_le_four_trace_compl hA hB hp.one_sub hagree ξ + simp only [sub_sub_cancel] at hb + have ht := selectedFloor_trace_le_inv_height e he htrace hmem top hcomplete N hN hheight + calc + ‖A ξ - B ξ‖ ^ 2 ≤ 4 * (vectorTrace ξ (∑ b, e b (top b) (top b))).re := hb + _ ≤ 4 * (1 / (N : ℝ)) := mul_le_mul_of_nonneg_left ht (by norm_num) + _ = 4 / (N : ℝ) := by ring + +end Invariant233.TowerTraceBounds + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialAdjointStrongConvergence.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialAdjointStrongConvergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..51de629f062cba44243a58045e0f7bb751d09d79 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialAdjointStrongConvergence.lean @@ -0,0 +1,58 @@ +import OAI.Analysis.IrrationalRotation.Analysis.SeparatingVectorStrongConvergence + +namespace OAI + +noncomputable section +open Filter +open scoped Topology +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] {M : VonNeumannAlgebra H} {ξ : H} + +theorem IsFaithfulTracialVector.norm_star_apply_eq + (htrace : IsFaithfulTracialVector M ξ) {A : H →L[ℂ] H} (hA : A ∈ M) : + ‖(star A) ξ‖ = ‖A ξ‖ := by + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + have hnorm (T : H →L[ℂ] H) : + ‖T ξ‖ ^ 2 = (vectorTrace ξ (star T * T)).re := by + exact T.apply_norm_sq_eq_inner_adjoint_right ξ + rw [hnorm, hnorm, star_star] + exact congrArg Complex.re (htrace.2.1 A (star A) hA (star_mem hA)) + +theorem IsFaithfulTracialVector.norm_star_sub_apply_eq + (htrace : IsFaithfulTracialVector M ξ) {A B : H →L[ℂ] H} + (hA : A ∈ M) (hB : B ∈ M) : + ‖(star A) ξ - (star B) ξ‖ = ‖A ξ - B ξ‖ := by + simpa only [star_sub, sub_apply] using + htrace.norm_star_apply_eq (sub_mem hA hB) + +theorem IsFaithfulTracialVector.strong_tendsto_star_of_bounded + {ι : Type*} {l : Filter ι} (htrace : IsFaithfulTracialVector M ξ) + {A : ι → H →L[ℂ] H} {B : H →L[ℂ] H} {C : ℝ} + (hA : ∀ i, A i ∈ M) (hB : B ∈ M) + (hξ : Tendsto (fun i => A i ξ) l (𝓝 (B ξ))) + (hC : ∀ᶠ i in l, ‖A i‖ ≤ C) (v : H) : + Tendsto (fun i => (star (A i)) v) l (𝓝 ((star B) v)) := by + apply htrace.strong_tendsto_of_bounded (C := C) (fun i => star_mem (hA i)) (star_mem hB) ?_ ?_ v + · apply tendsto_iff_norm_sub_tendsto_zero.mpr + simpa only [htrace.norm_star_sub_apply_eq (hA _) hB] using + tendsto_iff_norm_sub_tendsto_zero.mp hξ + · simpa only [norm_star] using hC + +theorem IsFaithfulTracialVector.strongStar_tendsto_of_bounded + {ι : Type*} {l : Filter ι} (htrace : IsFaithfulTracialVector M ξ) + {A : ι → H →L[ℂ] H} {B : H →L[ℂ] H} {C : ℝ} + (hA : ∀ i, A i ∈ M) (hB : B ∈ M) + (hξ : Tendsto (fun i => A i ξ) l (𝓝 (B ξ))) + (hC : ∀ᶠ i in l, ‖A i‖ ≤ C) : + (∀ v : H, Tendsto (fun i => A i v) l (𝓝 (B v))) ∧ + (∀ v : H, Tendsto (fun i => (star (A i)) v) l (𝓝 ((star B) v))) := + ⟨htrace.strong_tendsto_of_bounded hA hB hξ hC, + htrace.strong_tendsto_star_of_bounded hA hB hξ hC⟩ + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialDirectFiniteness.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialDirectFiniteness.lean new file mode 100644 index 0000000000000000000000000000000000000000..87d9ee4eb000c891fb4e774465091bfff6596dfa --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialDirectFiniteness.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.IrrationalRotation.Operators.TracialFiniteness +import OAI.Analysis.IrrationalRotation.Analysis.ClosedRangeTransport + +namespace OAI + +noncomputable section + +namespace Invariant233 + +open InvariantRotation.ClosedRangeTransport + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] {M : VonNeumannAlgebra H} {ξ : H} + +theorem IsFaithfulTracialVector.surjective_of_left_inverse + (hτ : IsFaithfulTracialVector M ξ) + {a b : H →L[ℂ] H} (ham : a ∈ M) (hba : b * a = 1) : + Function.Surjective a := by + let : CompleteSpace (⊤ : Submodule ℂ H) := isClosed_univ.completeSpace_coe + have hleft : Function.LeftInverse b a := by + intro x + exact congrArg (fun T : H →L[ℂ] H => T x) hba + have hclosed : IsClosed (Set.range a) := + hleft.isClosed_range b.continuous a.continuous + let f : (⊤ : Submodule ℂ H) →L[ℂ] H := a.comp (⊤ : Submodule ℂ H).subtypeL + have hrange : f.range = a.range := by + ext y + constructor + · rintro ⟨x, rfl⟩ + exact ⟨x.val, rfl⟩ + · rintro ⟨x, rfl⟩ + exact ⟨⟨x, Submodule.mem_top⟩, rfl⟩ + have hfclosed : IsClosed (Set.range f) := by + change IsClosed (f.range : Set H) + rw [hrange] + exact hclosed + let : IsClosed (f.range : Set H) := hfclosed + have hfinj : Function.Injective f := by + intro x y hxy + apply Subtype.ext + exact hleft.injective hxy + have hforward : forward ⊤ f = a := by + ext x + change a ((⊤ : Submodule ℂ H).starProjection x) = a x + rw [Submodule.starProjection_top'] + rfl + have hfm : forward ⊤ f ∈ M := hforward ▸ ham + have hqmem : f.range.starProjection ∈ M := by + have hc : IsClosed (Set.range (forward ⊤ f)) := hforward ▸ hclosed + simpa only [range_forward] using range_projection_mem M (forward ⊤ f) hfm hc + have htrace : vectorTrace ξ 1 = vectorTrace ξ f.range.starProjection := by + simpa only [Submodule.starProjection_top'] using + trace_range_eq M ⊤ f hfinj hfclosed + (by simpa only [Submodule.starProjection_top'] using (one_mem M)) hfm + (vectorTrace ξ) (fun a ha b hb => hτ.2.1 a b ha hb) + have hqone : f.range.starProjection = 1 := + hτ.projection_eq_of_trace_eq hqmem (one_mem M) + isStarProjection_starProjection (IsStarProjection.one _) (mul_one _) htrace.symm + intro y + have hy : y ∈ f.range := by + have h := f.range.starProjection_apply_mem y + simpa only [hqone, one_apply_eq_self] using h + rw [hrange] at hy + exact hy + +theorem IsFaithfulTracialVector.mul_eq_one_of_reverse + (hτ : IsFaithfulTracialVector M ξ) + {a b : H →L[ℂ] H} (ham : a ∈ M) (hba : b * a = 1) : + a * b = 1 := by + ext y + obtain ⟨x, rfl⟩ := hτ.surjective_of_left_inverse ham hba y + have hx := congrArg (fun T : H →L[ℂ] H => T x) hba + change a (b (a x)) = a x + exact congrArg a hx + +theorem IsFaithfulTracialVector.isDedekindFiniteMonoid + (hτ : IsFaithfulTracialVector M ξ) : IsDedekindFiniteMonoid M := by + constructor + intro a b hab + apply Subtype.ext + exact hτ.mul_eq_one_of_reverse b.property (congrArg Subtype.val hab) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialFiniteness.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialFiniteness.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f2c16dd530919e904a7cacffc6afcf19f2ab956 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialFiniteness.lean @@ -0,0 +1,68 @@ +import OAI.Analysis.IrrationalRotation.Model.VectorTraceState +import Mathlib.Algebra.Star.StarProjection + +namespace OAI + +noncomputable section + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] {M : VonNeumannAlgebra H} {ξ : H} + +theorem IsFaithfulTracialVector.projection_eq_of_trace_eq + (hτ : IsFaithfulTracialVector M ξ) + {p q : H →L[ℂ] H} (hpm : p ∈ M) (hqm : q ∈ M) + (hp : IsStarProjection p) (hq : IsStarProjection q) + (hpq : p * q = p) (htrace : vectorTrace ξ p = vectorTrace ξ q) : p = q := by + have hpos : (q - p).IsPositive := + ContinuousLinearMap.IsPositive.of_isStarProjection (hp.sub_of_mul_eq_left hq hpq) + have hzero : vectorTrace ξ (q - p) = 0 := by + simp only [vectorTrace, sub_apply, inner_sub_right] at htrace ⊢ + exact sub_eq_zero.mpr htrace.symm + exact (sub_eq_zero.mp (hτ.2.2 (q - p) (sub_mem hqm hpm) hpos hzero)).symm + +theorem IsFaithfulTracialVector.projection_eq_of_equivalent_subprojection + (hτ : IsFaithfulTracialVector M ξ) + {p q v : H →L[ℂ] H} (hpm : p ∈ M) (hqm : q ∈ M) (hvm : v ∈ M) + (hp : IsStarProjection p) (hq : IsStarProjection q) (hpq : p * q = p) + (hvinit : star v * v = p) (hvfinal : v * star v = q) : p = q := by + apply hτ.projection_eq_of_trace_eq hpm hqm hp hq hpq + rw [← hvinit, ← hvfinal] + exact hτ.2.1 (star v) v (star_mem hvm) hvm + +theorem IsFaithfulTracialVector.mul_star_eq_one_of_star_mul_eq_one + (hτ : IsFaithfulTracialVector M ξ) + {v : H →L[ℂ] H} (hvm : v ∈ M) (hv : star v * v = 1) : + v * star v = 1 := by + have hp : IsStarProjection (v * star v) := by + refine ⟨?_, ?_⟩ + · change (v * star v) * (v * star v) = v * star v + calc + (v * star v) * (v * star v) = v * (star v * v) * star v := by + simp only [mul_assoc] + _ = v * star v := by rw [hv]; simp + · simp [IsSelfAdjoint] + apply hτ.projection_eq_of_trace_eq (mul_mem hvm (star_mem hvm)) (one_mem M) + hp (IsStarProjection.one _) (mul_one _) + rw [hτ.2.1 v (star v) hvm (star_mem hvm), hv] + +theorem IsFaithfulTracialVector.mem_unitary_of_star_mul_eq_one + (hτ : IsFaithfulTracialVector M ξ) + {v : H →L[ℂ] H} (hvm : v ∈ M) (hv : star v * v = 1) : + v ∈ unitary (H →L[ℂ] H) := + Unitary.mem_iff.mpr ⟨hv, hτ.mul_star_eq_one_of_star_mul_eq_one hvm hv⟩ + +theorem IsFaithfulTracialVector.mem_unitary_of_mul_star_eq_one + (hτ : IsFaithfulTracialVector M ξ) + {v : H →L[ℂ] H} (hvm : v ∈ M) (hv : v * star v = 1) : + v ∈ unitary (H →L[ℂ] H) := by + apply Unitary.star_mem_iff.mp + apply hτ.mem_unitary_of_star_mul_eq_one (star_mem hvm) + simpa only [star_star] using hv + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialInverseClosure.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialInverseClosure.lean new file mode 100644 index 0000000000000000000000000000000000000000..a800f3cbe5d464c3cbf3a00ee32143fb036a26c1 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialInverseClosure.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.IrrationalRotation.Operators.TracialDirectFiniteness + +namespace OAI + +noncomputable section + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] {M : VonNeumannAlgebra H} {ξ : H} + +theorem inverse_mem_of_two_sided_inverse + {a b : H →L[ℂ] H} (ha : a ∈ M) (hba : b * a = 1) (hab : a * b = 1) : + b ∈ M := by + rw [← M.commutant_commutant] + apply VonNeumannAlgebra.mem_commutant_iff.mpr + intro w hw + exact (InvariantRotation.ClosedRangeTransport.commute_partialInverse + hba hab (one_mul b) + ((VonNeumannAlgebra.mem_commutant_iff.mp hw) a ha).symm + (Commute.one_right w) (Commute.one_right w)).eq + +theorem IsFaithfulTracialVector.left_inverse_mem + (hτ : IsFaithfulTracialVector M ξ) + {a b : H →L[ℂ] H} (ha : a ∈ M) (hba : b * a = 1) : b ∈ M := + inverse_mem_of_two_sided_inverse ha hba (hτ.mul_eq_one_of_reverse ha hba) + +theorem IsFaithfulTracialVector.isUnit_of_ambient_left_inverse + (hτ : IsFaithfulTracialVector M ξ) + {a b : H →L[ℂ] H} (ha : a ∈ M) (hba : b * a = 1) : + IsUnit (⟨a, ha⟩ : M) := by + refine ⟨⟨⟨a, ha⟩, ⟨b, hτ.left_inverse_mem ha hba⟩, ?_, ?_⟩, rfl⟩ + · exact Subtype.ext (hτ.mul_eq_one_of_reverse ha hba) + · exact Subtype.ext hba + +theorem IsFaithfulTracialVector.reverse_mul_eq_one + (hτ : IsFaithfulTracialVector M ξ) + {a b : H →L[ℂ] H} (ha : a ∈ M) (hab : a * b = 1) : b * a = 1 := by + have hstar : star b * star a = 1 := by + simpa only [star_mul, star_one] using congrArg star hab + have h := hτ.mul_eq_one_of_reverse (star_mem ha) hstar + simpa only [star_mul, star_star, star_one] using congrArg star h + +theorem IsFaithfulTracialVector.right_inverse_mem + (hτ : IsFaithfulTracialVector M ξ) + {a b : H →L[ℂ] H} (ha : a ∈ M) (hab : a * b = 1) : b ∈ M := + inverse_mem_of_two_sided_inverse ha (hτ.reverse_mul_eq_one ha hab) hab + +theorem IsFaithfulTracialVector.isUnit_of_ambient_right_inverse + (hτ : IsFaithfulTracialVector M ξ) + {a b : H →L[ℂ] H} (ha : a ∈ M) (hab : a * b = 1) : + IsUnit (⟨a, ha⟩ : M) := + hτ.isUnit_of_ambient_left_inverse ha (hτ.reverse_mul_eq_one ha hab) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialLogDerivative.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialLogDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..a02eca37850f2e61a4907f69258f5debdd912877 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialLogDerivative.lean @@ -0,0 +1,156 @@ +import OAI.Analysis.IrrationalRotation.Spectral.CFCLogSeries + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra +namespace Invariant233 +namespace CFCLogSeries +variable {A : Type*} [CStarAlgebra A] [Nontrivial A] + +omit [Nontrivial A] in +lemma trace_pow_derivative_sum (τ : TracialState A) (a b : A) (n : ℕ) : + τ (∑ i ∈ Finset.range (n+1), a ^ (n-i) * b * a ^ i) = + (n+1) • τ (a ^ n * b) := by + rw [map_sum] + have hterm : ∀ i ∈ Finset.range (n+1), + τ (a ^ (n-i) * b * a ^ i) = τ (a ^ n * b) := by + intro i hi + have hin : i ≤ n := by simpa only [Finset.mem_range, Nat.lt_succ_iff] using hi + rw [τ.tracial (a ^ (n-i) * b) (a ^ i), ← mul_assoc, ← pow_add, + Nat.add_sub_of_le hin] + calc + (∑ i ∈ Finset.range (n+1), τ.toContinuousLinearMap (a ^ (n-i) * b * a ^ i)) = + ∑ _i ∈ Finset.range (n+1), τ (a ^ n * b) := Finset.sum_congr rfl hterm + _ = _ := by simp + +omit [Nontrivial A] in + +theorem hasDerivAt_trace_term (τ : TracialState A) {f : ℝ → A} {f' : A} {x : ℝ} + (hf : HasDerivAt f f' x) (n : ℕ) : + HasDerivAt (fun t => τ (term (f t) n)) (τ (f x ^ n * f')) x := by + let L := τ.toContinuousLinearMap.restrictScalars ℝ + have hd := L.hasFDerivAt.comp_hasDerivAt x + ((hf.fun_pow' (n+1)).const_smul ((n+1 : ℝ)⁻¹)) + have hvalue : L (((n+1 : ℝ)⁻¹) • + (∑ i ∈ Finset.range (n+1), f x ^ (n-i) * f' * f x ^ i)) = + τ (f x ^ n * f') := by + rw [map_smul] + change ((n+1 : ℝ)⁻¹) • τ (∑ i ∈ Finset.range (n+1), + f x ^ (n-i) * f' * f x ^ i) = _ + rw [trace_pow_derivative_sum, ← Nat.cast_smul_eq_nsmul ℝ (n+1), smul_smul] + simp only [Nat.cast_add, Nat.cast_one, + inv_mul_cancel₀ (show (n+1 : ℝ) ≠ 0 by positivity), one_smul] + change HasDerivAt (fun t => τ (term (f t) n)) + (L (((n+1 : ℝ)⁻¹) • (∑ i ∈ Finset.range (n+1), + f x ^ (n-i) * f' * f x ^ i))) x at hd + exact hd.congr_deriv hvalue + +theorem hasDerivAt_trace_log_one_sub (τ : TracialState A) + {f f' : ℝ → A} {s : Set ℝ} (hs : IsOpen s) (hsc : IsPreconnected s) + {r C : ℝ} (hr0 : 0 ≤ r) (hr : r < 1) (_hC : 0 ≤ C) + (hsa : ∀ y ∈ s, IsSelfAdjoint (f y)) + (hf : ∀ y ∈ s, HasDerivAt f (f' y) y) + (hbound : ∀ y ∈ s, ‖f y‖ ≤ r) (hdbound : ∀ y ∈ s, ‖f' y‖ ≤ C) + {x : ℝ} (hx : x ∈ s) : + HasDerivAt (fun y => τ (CFC.log (1-f y))) + (-τ (Ring.inverse (1-f x) * f' x)) x := by + have hu : Summable (fun n : ℕ => ‖τ.toContinuousLinearMap‖ * C * r^n) := + (summable_geometric_of_lt_one hr0 hr).mul_left _ + have hterms : ∀ n y, y ∈ s → + HasDerivAt (fun t => τ (term (f t) n)) (τ (f y ^ n * f' y)) y := + fun n y hy => hasDerivAt_trace_term τ (hf y hy) n + have hb : ∀ n y, y ∈ s → + ‖τ (f y ^ n * f' y)‖ ≤ ‖τ.toContinuousLinearMap‖ * C * r^n := by + intro n y hy + calc + ‖τ (f y ^ n * f' y)‖ ≤ + ‖τ.toContinuousLinearMap‖ * ‖f y ^ n * f' y‖ := + τ.toContinuousLinearMap.le_opNorm _ + _ ≤ ‖τ.toContinuousLinearMap‖ * (‖f y ^ n‖ * ‖f' y‖) := by + gcongr + exact norm_mul_le _ _ + _ ≤ ‖τ.toContinuousLinearMap‖ * (r^n * C) := by + gcongr + · exact (norm_pow_le _ _).trans (pow_le_pow_left₀ (norm_nonneg _) (hbound y hy) n) + · exact hdbound y hy + _ = _ := by ring + have hs0 : Summable (fun n => τ (term (f x) n)) := + (TracialState_hasSum_log τ (hsa x hx) ((hbound x hx).trans_lt hr)).summable + have hd := hasDerivAt_tsum_of_isPreconnected hu hs hsc hterms hb hx hs0 hx + have hgeom : HasSum (fun n : ℕ => τ (f x ^ n * f' x)) + (τ (Ring.inverse (1-f x) * f' x)) := + τ.toContinuousLinearMap.hasSum + ((hasSum_geom_series_inverse (f x) ((hbound x hx).trans_lt hr)).mul_right (f' x)) + have heq : (fun y => τ (CFC.log (1-f y))) =ᶠ[𝓝 x] + (fun y => -(∑' n, τ (term (f y) n))) := by + filter_upwards [hs.mem_nhds hx] with y hy + rw [(TracialState_hasSum_log τ (hsa y hy) ((hbound y hy).trans_lt hr)).tsum_eq, + neg_neg] + have hout := hd.neg.congr_of_eventuallyEq heq + simpa only [hgeom.tsum_eq] using hout + +variable [PartialOrder A] [StarOrderedRing A] + +theorem hasDerivAt_trace_log_of_scaled_ball (τ : TracialState A) + {f f' : ℝ → A} {s : Set ℝ} (hs : IsOpen s) (hsc : IsPreconnected s) + {c r C : ℝ} (hc : 0 < c) (hr0 : 0 ≤ r) (hr : r < 1) (hC : 0 ≤ C) + (hpos : ∀ y ∈ s, IsStrictlyPositive (f y)) + (hf : ∀ y ∈ s, HasDerivAt f (f' y) y) + (hbound : ∀ y ∈ s, ‖1-c • f y‖ ≤ r) (hdbound : ∀ y ∈ s, ‖f' y‖ ≤ C) + {x : ℝ} (hx : x ∈ s) : + HasDerivAt (fun y => τ (CFC.log (f y))) + (τ (Ring.inverse (f x) * f' x)) x := by + have hd := hasDerivAt_trace_log_one_sub τ hs hsc hr0 hr + (mul_nonneg hc.le hC) + (f := fun y => 1-c • f y) (f' := fun y => -(c • f' y)) + (fun y hy => (show IsSelfAdjoint (1 : A) by simp).sub ((IsSelfAdjoint.all c).smul (hpos y hy).isSelfAdjoint)) + (fun y hy => ((hf y hy).const_smul c).const_sub 1) + hbound (fun y hy => by + simpa only [norm_neg, norm_smul, Real.norm_eq_abs, abs_of_pos hc] using + mul_le_mul_of_nonneg_left (hdbound y hy) hc.le) hx + have hinv : Ring.inverse (c • f x) * (c • f' x) = + Ring.inverse (f x) * f' x := by + apply (Ring.inverse_mul_eq_iff_eq_mul (c • f x) (c • f' x) + (Ring.inverse (f x) * f' x) ((hpos x hx).smul hc).isUnit).mpr + rw [smul_mul_assoc, ← mul_assoc, Ring.mul_inverse_cancel _ (hpos x hx).isUnit, + one_mul] + have hd' : HasDerivAt (fun y => τ (CFC.log (c • f y))) + (τ (Ring.inverse (f x) * f' x)) x := by + simpa only [sub_sub_cancel, mul_neg, map_neg, neg_neg, hinv] using hd + have heq : (fun y => τ (CFC.log (f y))) =ᶠ[𝓝 x] + (fun y => τ (CFC.log (c • f y)) - τ (algebraMap ℝ A (Real.log c))) := by + filter_upwards [hs.mem_nhds hx] with y hy + rw [CFC.log_smul' (f y) hc (hpos y hy), map_add, add_sub_cancel_left] + exact (hd'.sub_const (τ (algebraMap ℝ A (Real.log c)))).congr_of_eventuallyEq heq + +theorem hasDerivAt_trace_log_of_normalization (τ : TracialState A) + {f f' : ℝ → A} (hpos : ∀ y, IsStrictlyPositive (f y)) + (hf : ∀ y, HasDerivAt f (f' y) y) {x : ℝ} (hcf' : ContinuousAt f' x) + (hscale : ∃ c : ℝ, 0 < c ∧ ‖1-c • f x‖ < 1) : + HasDerivAt (fun y => τ (CFC.log (f y))) + (τ (Ring.inverse (f x) * f' x)) x := by + obtain ⟨c, hc, hcball⟩ := hscale + let r := (‖1-c • f x‖ + 1) / 2 + have hr0 : 0 ≤ r := by dsimp [r]; positivity + have hr : r < 1 := by dsimp [r]; linarith + have hrx : ‖1-c • f x‖ < r := by dsimp [r]; linarith + have hcont : ContinuousAt (fun y => ‖1-c • f y‖) x := + (continuousAt_const.sub ((hf x).continuousAt.const_smul c)).norm + have he1 : ∀ᶠ y in 𝓝 x, ‖1-c • f y‖ < r := + hcont.eventually_lt_const hrx + have he2 : ∀ᶠ y in 𝓝 x, ‖f' y‖ < ‖f' x‖ + 1 := + hcf'.norm.eventually_lt_const (by linarith) + obtain ⟨l, u, hxu, hlu⟩ := (he1.and he2).exists_Ioo_subset + exact hasDerivAt_trace_log_of_scaled_ball τ isOpen_Ioo (convex_Ioo l u).isPreconnected + hc hr0 hr (by positivity : 0 ≤ ‖f' x‖+1) + (fun y _ => hpos y) (fun y _ => hf y) + (fun y hy => (hlu hy).1.le) (fun y hy => (hlu hy).2.le) hxu + +end CFCLogSeries +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialLogNormSquare.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialLogNormSquare.lean new file mode 100644 index 0000000000000000000000000000000000000000..61248b3a3eeb11199af80ee254c73a9014c0de3c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialLogNormSquare.lean @@ -0,0 +1,45 @@ +import OAI.Analysis.IrrationalRotation.Operators.TracialLogDerivative +import OAI.Analysis.IrrationalRotation.Operators.TracialNormSquareDerivative +import OAI.Analysis.IrrationalRotation.Analysis.StrictlyPositiveNormalization + +namespace OAI + +noncomputable section +namespace Invariant233 +namespace CFCLogSeries +variable {A : Type*} [CStarAlgebra A] [Nontrivial A] +variable [PartialOrder A] [StarOrderedRing A] + +theorem hasDerivAt_re_trace_log_normSquare_of_normalization (τ : TracialState A) + {f f' : ℝ → A} (hunit : ∀ y, IsUnit (f y)) + (hf : ∀ y, HasDerivAt f (f' y) y) {x : ℝ} (hcf' : ContinuousAt f' x) + (hscale : ∃ c : ℝ, 0 < c ∧ ‖1-c • (star (f x) * f x)‖ < 1) : + HasDerivAt (fun y => (τ (CFC.log (star (f y) * f y))).re) + (2 * (τ (Ring.inverse (f x) * f' x)).re) x := by + have hp : ∀ y, IsStrictlyPositive (star (f y) * f y) := + fun y => ⟨star_mul_self_nonneg _, (hunit y).star.mul (hunit y)⟩ + have hq' : ContinuousAt (fun y => star (f' y) * f y + star (f y) * f' y) x := + (hcf'.star.mul (hf x).continuousAt).add ((hf x).continuousAt.star.mul hcf') + have hlog := hasDerivAt_trace_log_of_normalization τ hp + (fun y => TracialState.hasDerivAt_normSquare (hf y)) hq' hscale + have hre := Complex.reCLM.hasFDerivAt.comp_hasDerivAt x hlog + change HasDerivAt (fun y => (τ (CFC.log (star (f y) * f y))).re) + (τ (Ring.inverse (star (f x) * f x) * + (star (f' x) * f x + star (f x) * f' x))).re x at hre + exact hre.congr_deriv (τ.re_inverse_normSquare_differential (f x) (f' x) (hunit x)) + +theorem hasDerivAt_re_trace_log_normSquare (τ : TracialState A) + {f f' : ℝ → A} (hunit : ∀ y, IsUnit (f y)) + (hf : ∀ y, HasDerivAt f (f' y) y) {x : ℝ} (hcf' : ContinuousAt f' x) : + HasDerivAt (fun y => (τ (CFC.log (star (f y) * f y))).re) + (2 * (τ (Ring.inverse (f x) * f' x)).re) x := + hasDerivAt_re_trace_log_normSquare_of_normalization τ hunit hf hcf' + (exists_pos_norm_one_sub_smul_lt_one + ⟨star_mul_self_nonneg _, (hunit x).star.mul (hunit x)⟩) + +end CFCLogSeries +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialNormSquareDerivative.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialNormSquareDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b543987405165a9c3b4eb3ed1e449fc53a799eb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialNormSquareDerivative.lean @@ -0,0 +1,57 @@ +import OAI.Analysis.IrrationalRotation.Model.Spectral + +namespace OAI + +noncomputable section +namespace Invariant233 +namespace TracialState +variable {A : Type*} [CStarAlgebra A] + +theorem inverse_normSquare_first_term (τ : TracialState A) (a b : A) + (ha : IsUnit a) : + τ ((Ring.inverse a * star (Ring.inverse a)) * (star b * a)) = + star (τ (Ring.inverse a * b)) := by + calc + τ ((Ring.inverse a * star (Ring.inverse a)) * (star b * a)) = + τ (((Ring.inverse a * star (Ring.inverse a)) * star b) * a) := by + simp only [mul_assoc] + _ = τ (a * ((Ring.inverse a * star (Ring.inverse a)) * star b)) := + τ.tracial _ _ + _ = τ ((a * Ring.inverse a) * (star (Ring.inverse a) * star b)) := by + simp only [mul_assoc] + _ = τ (star (Ring.inverse a) * star b) := by + rw [Ring.mul_inverse_cancel a ha, one_mul] + _ = star (τ (b * Ring.inverse a)) := by rw [← star_mul, τ.map_star] + _ = star (τ (Ring.inverse a * b)) := by rw [τ.tracial b (Ring.inverse a)] + +theorem inverse_normSquare_second_term (a b : A) (ha : IsUnit a) : + (Ring.inverse a * star (Ring.inverse a)) * (star a * b) = + Ring.inverse a * b := by + have hc : star (Ring.inverse a) * star a = 1 := by + rw [← star_mul, Ring.mul_inverse_cancel a ha, star_one] + calc + (Ring.inverse a * star (Ring.inverse a)) * (star a * b) = + Ring.inverse a * ((star (Ring.inverse a) * star a) * b) := by + simp only [mul_assoc] + _ = Ring.inverse a * b := by rw [hc, one_mul] + +theorem re_inverse_normSquare_differential (τ : TracialState A) (a b : A) + (ha : IsUnit a) : + (τ (Ring.inverse (star a * a) * (star b * a + star a * b))).re = + 2 * (τ (Ring.inverse a * b)).re := by + rw [Ring.inverse_mul (Or.inr ha), Ring.inverse_star, mul_add, map_add, + τ.inverse_normSquare_first_term a b ha, inverse_normSquare_second_term a b ha] + simp [Complex.add_re, two_mul] + +theorem hasDerivAt_normSquare {f : ℝ → A} {f' : A} {t : ℝ} + (hf : HasDerivAt f f' t) : + HasDerivAt (fun s => star (f s) * f s) + (star f' * f t + star (f t) * f') t := by + exact hf.star.mul hf + +end TracialState +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialPowerDerivative.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialPowerDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5f310a15a615fd7fbfe358a3ba35abbc6f9dbee --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialPowerDerivative.lean @@ -0,0 +1,73 @@ +import OAI.Analysis.IrrationalRotation.Model.Spectral + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Invariant233 +namespace TracialState + +variable {A : Type*} [CStarAlgebra A] + +theorem power_derivative_term (τ : TracialState A) (a b : A) (n i : ℕ) + (hi : i < n) : + τ (a ^ (n.pred - i) * b * a ^ i) = τ (b * a ^ n.pred) := by + rw [mul_assoc, τ.tracial, mul_assoc, ← pow_add] + have hi' : i + (n.pred - i) = n.pred := by + simp only [Nat.pred_eq_sub_one] + omega + rw [hi'] + +theorem power_derivative_sum (τ : TracialState A) (a b : A) (n : ℕ) : + τ (∑ i ∈ Finset.range n, a ^ (n.pred - i) * b * a ^ i) = + (n : ℂ) * τ (b * a ^ n.pred) := by + rw [map_sum] + have hterms : ∀ i ∈ Finset.range n, + τ.toContinuousLinearMap (a ^ (n.pred - i) * b * a ^ i) = + τ (b * a ^ n.pred) := by + intro i hi + exact τ.power_derivative_term a b n i (Finset.mem_range.mp hi) + rw [Finset.sum_congr rfl hterms] + simp [nsmul_eq_mul] + +theorem hasDerivAt_power (τ : TracialState A) {f : ℝ → A} {f' : A} {t : ℝ} + (hf : HasDerivAt f f' t) (n : ℕ) : + HasDerivAt (fun s => τ (f s ^ n)) + ((n : ℂ) * τ (f' * f t ^ n.pred)) t := by + have h := (τ.toContinuousLinearMap.restrictScalars ℝ).hasFDerivAt.comp_hasDerivAt t + (hf.fun_pow' n) + change HasDerivAt (fun s => τ (f s ^ n)) + (τ (∑ i ∈ Finset.range n, f t ^ (n.pred - i) * f' * f t ^ i)) t at h + rw [τ.power_derivative_sum] at h + exact h + +theorem hasDerivAt_re_power (τ : TracialState A) {f : ℝ → A} {f' : A} {t : ℝ} + (hf : HasDerivAt f f' t) (n : ℕ) : + HasDerivAt (fun s => (τ (f s ^ n)).re) + ((n : ℝ) * (τ (f' * f t ^ n.pred)).re) t := by + have h := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t (τ.hasDerivAt_power hf n) + simpa [Function.comp_def, Complex.mul_re] using h + +theorem hasDerivAt_logarithmic_power (τ : TracialState A) + {f : ℝ → A} {f' : A} {t : ℝ} (hf : HasDerivAt f f' t) (n : ℕ) : + HasDerivAt (fun s => ((n + 1 : ℝ)⁻¹) • τ (f s ^ (n + 1))) + (τ (f' * f t ^ n)) t := by + have h := (τ.hasDerivAt_power hf (n + 1)).const_smul ((n + 1 : ℝ)⁻¹) + change HasDerivAt (fun s => ((n + 1 : ℝ)⁻¹) • τ (f s ^ (n + 1))) _ t at h + have hn : (n + 1 : ℂ) ≠ 0 := by exact_mod_cast Nat.succ_ne_zero n + simpa [Pi.smul_apply, Nat.pred_succ, Complex.real_smul, Complex.ofReal_inv, + mul_assoc, ← mul_assoc, hn] using h + +theorem hasDerivAt_logarithmic_partialSum (τ : TracialState A) + {f : ℝ → A} {f' : A} {t : ℝ} (hf : HasDerivAt f f' t) (N : ℕ) : + HasDerivAt (fun s => ∑ n ∈ Finset.range N, + ((n + 1 : ℝ)⁻¹) • τ (f s ^ (n + 1))) + (∑ n ∈ Finset.range N, τ (f' * f t ^ n)) t := by + exact HasDerivAt.fun_sum (fun n _ => τ.hasDerivAt_logarithmic_power hf n) + +end TracialState +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialProjectionTransport.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialProjectionTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..4405f82969ccc399ab251004b72c3de6e3ea26c0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialProjectionTransport.lean @@ -0,0 +1,168 @@ +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties +import OAI.Analysis.IrrationalRotation.Analysis.ClosedRangeTransport +import OAI.Analysis.IrrationalRotation.Operators.AffiliatedTransport + +namespace OAI + +noncomputable section +open Filter +open scoped Topology NNReal + +namespace Invariant233.TracialProjectionTransport + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem vectorTrace_projection (ξ : H) (p : Submodule ℂ H) + [p.HasOrthogonalProjection] : + vectorTrace ξ p.starProjection = (‖p.starProjection ξ‖ ^ 2 : ℂ) := by + unfold vectorTrace + calc + inner ℂ ξ (p.starProjection ξ) = + inner ℂ (p.starProjection ξ) (p.starProjection ξ) := by + rw [Submodule.inner_starProjection_left_eq_right] + rw [Submodule.starProjection_eq_self_iff.mpr (p.starProjection_apply_mem ξ)] + _ = _ := inner_self_eq_norm_sq_to_K _ + +theorem vectorTrace_projection_re (ξ : H) (p : Submodule ℂ H) + [p.HasOrthogonalProjection] : + (vectorTrace ξ p.starProjection).re = ‖p.starProjection ξ‖ ^ 2 := by + rw [vectorTrace_projection] + norm_cast + +theorem vectorTrace_projection_nonneg (ξ : H) (p : Submodule ℂ H) + [p.HasOrthogonalProjection] : + 0 ≤ (vectorTrace ξ p.starProjection).re := by + rw [vectorTrace_projection_re] + positivity + +theorem vectorTrace_projection_mono (ξ : H) {p q : Submodule ℂ H} + [p.HasOrthogonalProjection] [q.HasOrthogonalProjection] (hpq : p ≤ q) : + (vectorTrace ξ p.starProjection).re ≤ (vectorTrace ξ q.starProjection).re := by + rw [vectorTrace_projection_re, vectorTrace_projection_re] + have hnorm := p.norm_starProjection_apply_le (q.starProjection ξ) + have heq := DFunLike.congr_fun + (Submodule.starProjection_comp_starProjection_of_le hpq) ξ + change p.starProjection (q.starProjection ξ) = p.starProjection ξ at heq + rw [heq] at hnorm + exact pow_le_pow_left₀ (norm_nonneg _) hnorm 2 + +theorem vectorTrace_projection_orthogonal (ξ : H) (p : Submodule ℂ H) + [p.HasOrthogonalProjection] : + vectorTrace ξ pᗮ.starProjection = (‖ξ‖ ^ 2 : ℂ) - vectorTrace ξ p.starProjection := by + unfold vectorTrace + rw [Submodule.starProjection_orthogonal] + simp only [sub_apply, ContinuousLinearMap.id_apply, inner_sub_right] + rw [inner_self_eq_norm_sq_to_K] + rfl + +theorem tendsto_vectorTrace {ι : Type*} {l : Filter ι} + (ξ : H) (A : ι → H →L[ℂ] H) (B : H →L[ℂ] H) + (h : Tendsto (fun n => A n ξ) l (𝓝 (B ξ))) : + Tendsto (fun n => vectorTrace ξ (A n)) l (𝓝 (vectorTrace ξ B)) := by + exact tendsto_const_nhds.inner h + +theorem vectorTrace_le_of_cutoff_estimates + (ξ : H) (p q : Submodule ℂ H) + [p.HasOrthogonalProjection] [q.HasOrthogonalProjection] + (E : ℕ → Submodule ℂ H) [∀ n, (E n).HasOrthogonalProjection] + (hE : Tendsto (fun n => (E n).starProjection ξ) atTop (𝓝 ξ)) + (hbound : ∀ n, (vectorTrace ξ p.starProjection).re + + (vectorTrace ξ (E n).starProjection).re - ‖ξ‖ ^ 2 ≤ + (vectorTrace ξ q.starProjection).re) : + (vectorTrace ξ p.starProjection).re ≤ (vectorTrace ξ q.starProjection).re := by + have ht : Tendsto (fun n => inner ℂ ξ ((E n).starProjection ξ)) + atTop (𝓝 (inner ℂ ξ ξ)) := tendsto_const_nhds.inner hE + have hr := Complex.continuous_re.continuousAt.tendsto.comp ht + have he : Tendsto (fun n => (vectorTrace ξ (E n).starProjection).re) + atTop (𝓝 (‖ξ‖ ^ 2)) := by + have hnorm : (inner ℂ ξ ξ).re = ‖ξ‖ ^ 2 := inner_self_eq_norm_sq (𝕜 := ℂ) ξ + rw [hnorm] at hr + exact hr + have hlim : Tendsto (fun n => (vectorTrace ξ p.starProjection).re + + (vectorTrace ξ (E n).starProjection).re - ‖ξ‖ ^ 2) atTop + (𝓝 ((vectorTrace ξ p.starProjection).re + ‖ξ‖ ^ 2 - ‖ξ‖ ^ 2)) := + (tendsto_const_nhds.add he).sub_const (‖ξ‖ ^ 2) + have hle := le_of_tendsto hlim (Filter.Eventually.of_forall hbound) + simpa only [add_sub_cancel_right] using hle + +theorem vectorTrace_eq_of_cutoff_estimates + (ξ : H) (p q : Submodule ℂ H) + [p.HasOrthogonalProjection] [q.HasOrthogonalProjection] + (E : ℕ → Submodule ℂ H) [∀ n, (E n).HasOrthogonalProjection] + (hE : Tendsto (fun n => (E n).starProjection ξ) atTop (𝓝 ξ)) + (hforward : ∀ n, (vectorTrace ξ p.starProjection).re + + (vectorTrace ξ (E n).starProjection).re - ‖ξ‖ ^ 2 ≤ + (vectorTrace ξ q.starProjection).re) + (hbackward : ∀ n, (vectorTrace ξ pᗮ.starProjection).re + + (vectorTrace ξ (E n).starProjection).re - ‖ξ‖ ^ 2 ≤ + (vectorTrace ξ qᗮ.starProjection).re) : + vectorTrace ξ p.starProjection = vectorTrace ξ q.starProjection := by + have hle := vectorTrace_le_of_cutoff_estimates ξ p q E hE hforward + have hge := vectorTrace_le_of_cutoff_estimates ξ pᗮ qᗮ E hE hbackward + rw [vectorTrace_projection_orthogonal, vectorTrace_projection_orthogonal] at hge + have hre : (vectorTrace ξ p.starProjection).re = + (vectorTrace ξ q.starProjection).re := by + simp only [Complex.sub_re] at hge + linarith + rw [vectorTrace_projection_re, vectorTrace_projection_re] at hre + rw [vectorTrace_projection, vectorTrace_projection] + exact_mod_cast hre + +theorem vectorTrace_closedRange_eq + [CompleteSpace H] + (M : VonNeumannAlgebra H) (ξ : H) (hξ : IsFaithfulTracialVector M ξ) + (p : Submodule ℂ H) [CompleteSpace p] + (f : p →L[ℂ] H) (hinj : Function.Injective f) + (hc : IsClosed (Set.range f)) + (hp : p.starProjection ∈ M) + (hf : InvariantRotation.ClosedRangeTransport.forward p f ∈ M) : + letI : IsClosed (f.range : Set H) := hc + vectorTrace ξ p.starProjection = vectorTrace ξ f.range.starProjection := by + exact InvariantRotation.ClosedRangeTransport.trace_range_eq M p f hinj hc hp hf + (vectorTrace ξ) (fun a ha b hb => hξ.2.1 a b ha hb) + + +variable [CompleteSpace H] + +def cutoffMap (T : H →ₗ.[ℂ] H) (r : Submodule ℂ H) (hrD : r ≤ T.domain) + (K : ℝ) (hupper : ∀ x : r, ‖T ⟨x, hrD x.property⟩‖ ≤ K * ‖x‖) : r →L[ℂ] H := + (T.toFun.comp (Submodule.inclusion hrD)).mkContinuous K hupper + +omit [CompleteSpace H] in + +theorem cutoffMap_range_le_transported + (T : H →ₗ.[ℂ] H) (p r : Submodule ℂ H) (hrp : r ≤ p) (hrD : r ≤ T.domain) + (K : ℝ) (hupper : ∀ x : r, ‖T ⟨x, hrD x.property⟩‖ ≤ K * ‖x‖) : + (cutoffMap T r hrD K hupper).range ≤ + InvariantRotation.AffiliatedTransport.transported T p := by + rintro y ⟨x, rfl⟩ + apply (InvariantRotation.AffiliatedTransport.domainImage T p).le_topologicalClosure + apply InvariantRotation.AffiliatedTransport.mem_domainImage.mpr + exact ⟨⟨x, hrD x.property⟩, hrp x.property, rfl⟩ + +theorem cutoff_trace_le_transported + (M : VonNeumannAlgebra H) (ξ : H) (hξ : IsFaithfulTracialVector M ξ) + (T : H →ₗ.[ℂ] H) (p r : Submodule ℂ H) [CompleteSpace r] + (hrp : r ≤ p) (hrD : r ≤ T.domain) + (K : ℝ) (hupper : ∀ x : r, ‖T ⟨x, hrD x.property⟩‖ ≤ K * ‖x‖) + (L : ℝ≥0) (hlower : ∀ x : r, ‖x‖ ≤ L * ‖T ⟨x, hrD x.property⟩‖) + (hr : r.starProjection ∈ M) + (hf : InvariantRotation.ClosedRangeTransport.forward r + (cutoffMap T r hrD K hupper) ∈ M) : + (vectorTrace ξ r.starProjection).re ≤ + (vectorTrace ξ (InvariantRotation.AffiliatedTransport.transported T p).starProjection).re := by + let f := cutoffMap T r hrD K hupper + have hbounds := InvariantRotation.ClosedRangeTransport.injective_closedRange_of_bound + r f L hlower + let : IsClosed (f.range : Set H) := hbounds.2 + have htrace := vectorTrace_closedRange_eq M ξ hξ r f hbounds.1 hbounds.2 hr hf + apply (congrArg Complex.re htrace).trans_le + exact vectorTrace_projection_mono ξ + (cutoffMap_range_le_transported T p r hrp hrD K hupper) + + +end Invariant233.TracialProjectionTransport + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialStateBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialStateBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..97f36082bea4ac9674b805bab07b62984535f3c9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialStateBounds.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.IrrationalRotation.Model.Spectral +import Mathlib.Analysis.CStarAlgebra.GelfandNaimarkSegal + +namespace OAI + +noncomputable section +open scoped CStarAlgebra ComplexOrder +namespace Invariant233.TracialState + +variable {A : Type*} [CStarAlgebra A] + +local instance tracialStateBoundsSpectralOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance tracialStateBoundsSpectralOrderedRing : StarOrderedRing A := + CStarAlgebra.spectralOrderedRing A + +theorem positive_of_nonneg (τ : TracialState A) {a : A} (ha : 0 ≤ a) : + 0 ≤ τ a := by + obtain ⟨b, rfl⟩ := CStarAlgebra.nonneg_iff_eq_star_mul_self.mp ha + apply RCLike.nonneg_iff.mpr + refine ⟨τ.positive b, ?_⟩ + apply Complex.conj_eq_iff_im.mp + change star (τ (star b * b)) = τ (star b * b) + rw [← τ.map_star] + simp only [star_mul, star_star] + +def toPositiveLinearMap (τ : TracialState A) : A →ₚ[ℂ] ℂ where + toLinearMap := τ.toContinuousLinearMap.toLinearMap + monotone' := by + intro a b hab + have h := τ.positive_of_nonneg (sub_nonneg.mpr hab) + change 0 ≤ τ.toContinuousLinearMap (b - a) at h + rw [map_sub] at h + exact sub_nonneg.mp h + +@[simp] theorem toPositiveLinearMap_apply (τ : TracialState A) (a : A) : + τ.toPositiveLinearMap a = τ a := rfl + +theorem cauchySchwarz (τ : TracialState A) (a b : A) : + ‖τ (star a * b)‖ ^ 2 ≤ (τ (star a * a)).re * (τ (star b * b)).re := by + let f := τ.toPositiveLinearMap + have h := norm_inner_le_norm (𝕜 := ℂ) (f.toPreGNS a) (f.toPreGNS b) + have hs := (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _))).mpr h + rw [mul_pow, PositiveLinearMap.preGNS_norm_def, PositiveLinearMap.preGNS_norm_def] at hs + change ‖τ (star a * b)‖ ^ 2 ≤ + (Real.sqrt (τ (star a * a)).re) ^ 2 * (Real.sqrt (τ (star b * b)).re) ^ 2 at hs + rwa [Real.sq_sqrt (τ.positive a), Real.sq_sqrt (τ.positive b)] at hs + +theorem norm_apply_le (τ : TracialState A) (a : A) : ‖τ a‖ ≤ ‖a‖ := by + have hcs := τ.cauchySchwarz 1 a + simp only [star_one, one_mul, τ.map_one, Complex.one_re, one_mul] at hcs + have hb := τ.toPositiveLinearMap.norm_apply_le_of_nonneg + (star a * a) (star_mul_self_nonneg a) + simp only [toPositiveLinearMap_apply, τ.map_one, norm_one, one_mul, + CStarRing.norm_star_mul_self] at hb + have hre := (Complex.re_le_norm (τ (star a * a))).trans hb + apply (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + nlinarith + +theorem norm_eq_one (τ : TracialState A) : ‖τ.toContinuousLinearMap‖ = 1 := by + have hnontrivial : Nontrivial A := by + apply not_subsingleton_iff_nontrivial.mp + intro h + have h01 : (0 : A) = 1 := Subsingleton.elim _ _ + have hbad := congrArg τ.toContinuousLinearMap h01 + simp only [map_zero, τ.map_one] at hbad + exact zero_ne_one hbad + let := hnontrivial + apply le_antisymm + · exact τ.toContinuousLinearMap.opNorm_le_bound (by norm_num) + (fun a => by simpa only [one_mul] using τ.norm_apply_le a) + · have h := τ.toContinuousLinearMap.le_opNorm (1 : A) + simpa only [τ.map_one, norm_one, mul_one] using h + +end Invariant233.TracialState + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialStateGNS.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialStateGNS.lean new file mode 100644 index 0000000000000000000000000000000000000000..d2f7b093f24edf1ce1a15f548f2166b98b3f1b47 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialStateGNS.lean @@ -0,0 +1,50 @@ +import OAI.Analysis.IrrationalRotation.Operators.TracialStateBounds +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties + +namespace OAI + +noncomputable section +open scoped CStarAlgebra ComplexOrder +namespace Invariant233.TracialState +variable {A : Type*} [CStarAlgebra A] +local instance : PartialOrder A := CStarAlgebra.spectralOrder A +local instance : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +def gnsVector (τ : TracialState A) : τ.toPositiveLinearMap.GNS := + (τ.toPositiveLinearMap.toPreGNS 1 : τ.toPositiveLinearMap.GNS) + +theorem gns_apply_vector (τ : TracialState A) (a : A) : + τ.toPositiveLinearMap.gnsStarAlgHom a (τ.gnsVector) = + (τ.toPositiveLinearMap.toPreGNS a : τ.toPositiveLinearMap.GNS) := by + change τ.toPositiveLinearMap.gnsNonUnitalStarAlgHom a + (τ.toPositiveLinearMap.toPreGNS 1 : τ.toPositiveLinearMap.GNS) = _ + rw [PositiveLinearMap.gnsNonUnitalStarAlgHom_apply_coe, + PositiveLinearMap.leftMulMapPreGNS_apply] + simp only [PositiveLinearMap.ofPreGNS_toPreGNS, mul_one] + +theorem norm_gnsVector (τ : TracialState A) : ‖τ.gnsVector‖ = 1 := by + rw [gnsVector, UniformSpace.Completion.norm_coe, PositiveLinearMap.preGNS_norm_def] + simp only [PositiveLinearMap.ofPreGNS_toPreGNS, star_one, one_mul, + toPositiveLinearMap_apply, τ.map_one, Complex.one_re, Real.sqrt_one] + +theorem gns_vectorTrace (τ : TracialState A) (a : A) : + vectorTrace τ.gnsVector (τ.toPositiveLinearMap.gnsStarAlgHom a) = τ a := by + unfold vectorTrace + rw [τ.gns_apply_vector] + change inner ℂ (τ.toPositiveLinearMap.toPreGNS 1 : τ.toPositiveLinearMap.GNS) + (τ.toPositiveLinearMap.toPreGNS a : τ.toPositiveLinearMap.GNS) = _ + rw [UniformSpace.Completion.inner_coe, PositiveLinearMap.preGNS_inner_def] + simp only [PositiveLinearMap.ofPreGNS_toPreGNS, star_one, one_mul, + toPositiveLinearMap_apply] + +theorem denseRange_gns_orbit (τ : TracialState A) : + DenseRange (fun a : A => τ.toPositiveLinearMap.gnsStarAlgHom a τ.gnsVector) := by + simp_rw [τ.gns_apply_vector] + exact UniformSpace.Completion.denseRange_coe.comp + τ.toPositiveLinearMap.toPreGNS.surjective.denseRange (by fun_prop) + +end Invariant233.TracialState + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/TracialVectorSeparating.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialVectorSeparating.lean new file mode 100644 index 0000000000000000000000000000000000000000..1893c1780a5a9cc004d5826496b3ece9b1b7b919 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/TracialVectorSeparating.lean @@ -0,0 +1,40 @@ +import OAI.Analysis.IrrationalRotation.Model.VectorTraceState + +namespace OAI + +noncomputable section + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + {M : VonNeumannAlgebra H} {ξ : H} + +theorem IsFaithfulTracialVector.eq_zero_of_apply_eq_zero + (h : IsFaithfulTracialVector M ξ) {A : H →L[ℂ] H} + (hA : A ∈ M) (hξ : A ξ = 0) : A = 0 := by + apply (CStarRing.star_mul_self_eq_zero_iff A).mp + apply h.2.2 (star A * A) (mul_mem (star_mem hA) hA) + · simpa only [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.mul_def] + using ContinuousLinearMap.isPositive_adjoint_comp_self A + · change inner ℂ ξ ((star A) (A ξ)) = 0 + simp [hξ] + +theorem IsFaithfulTracialVector.eq_of_apply_eq + (h : IsFaithfulTracialVector M ξ) {A B : H →L[ℂ] H} + (hA : A ∈ M) (hB : B ∈ M) (hξ : A ξ = B ξ) : A = B := by + apply sub_eq_zero.mp + apply h.eq_zero_of_apply_eq_zero (sub_mem hA hB) + change A ξ - B ξ = 0 + rw [hξ, sub_self] + +theorem IsFaithfulTracialVector.injective_apply + (h : IsFaithfulTracialVector M ξ) : + Function.Injective (fun A : M => (A : H →L[ℂ] H) ξ) := by + intro A B hAB + exact Subtype.ext (h.eq_of_apply_eq A.property B.property hAB) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/VectorProjectionEndpoints.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/VectorProjectionEndpoints.lean new file mode 100644 index 0000000000000000000000000000000000000000..662b160e76903797371d127b844a9fd10b193128 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/VectorProjectionEndpoints.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.IrrationalRotation.Operators.TracialProjectionTransport +import Mathlib.Analysis.InnerProductSpace.StarOrder + +namespace OAI + +noncomputable section +namespace Invariant233 +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem vectorTrace_projection_re_pos_iff + (M : VonNeumannAlgebra H) (ξ : H) (hξ : IsFaithfulTracialVector M ξ) + (P : H →L[ℂ] H) (hPm : P ∈ M) (hP : IsStarProjection P) : + 0 < (vectorTrace ξ P).re ↔ P ≠ 0 := by + obtain ⟨hproj, hPeq⟩ := isStarProjection_iff_eq_starProjection_range.mp hP + let := hproj + have hPpos : P.IsPositive := by + apply ContinuousLinearMap.nonneg_iff_isPositive.mp + simpa only [hP.isSelfAdjoint.star_eq, hP.isIdempotentElem.eq] using star_mul_self_nonneg P + have hnonneg : 0 ≤ (vectorTrace ξ P).re := hPpos.re_inner_nonneg_right ξ + constructor + · intro hpos hz + subst P + simp [vectorTrace] at hpos + · intro hne + by_contra hn + have hzre : (vectorTrace ξ P).re = 0 := le_antisymm (le_of_not_gt hn) hnonneg + have hz : vectorTrace ξ P = 0 := by + rw [hPeq, TracialProjectionTransport.vectorTrace_projection] at hzre ⊢ + exact_mod_cast hzre + exact hne (hξ.2.2 P hPm hPpos hz) + +theorem vectorTrace_projection_re_lt_one_iff + (M : VonNeumannAlgebra H) (ξ : H) (hξ : IsFaithfulTracialVector M ξ) + (P : H →L[ℂ] H) (hPm : P ∈ M) (hP : IsStarProjection P) : + (vectorTrace ξ P).re < 1 ↔ P ≠ 1 := by + have hnorm : (inner ℂ ξ ξ).re = 1 := by + calc + _ = ‖ξ‖ ^ 2 := inner_self_eq_norm_sq (𝕜 := ℂ) ξ + _ = 1 := by rw [hξ.1, one_pow] + have hc : (vectorTrace ξ (1 - P)).re = 1 - (vectorTrace ξ P).re := by + simp only [vectorTrace, sub_apply, one_apply_eq_self, inner_sub_right, Complex.sub_re, hnorm] + have h := vectorTrace_projection_re_pos_iff M ξ hξ (1 - P) + (sub_mem (one_mem M) hPm) hP.one_sub + rw [hc] at h + constructor + · intro hp + have hn := h.mp (by linarith) + intro heq + exact hn (by rw [heq, sub_self]) + · intro hp + have hn : (1 : H →L[ℂ] H) - P ≠ 0 := by + intro hz + exact hp (sub_eq_zero.mp hz).symm + have := h.mpr hn + linarith + +theorem vectorTrace_projection_between_zero_one_iff + (M : VonNeumannAlgebra H) (ξ : H) (hξ : IsFaithfulTracialVector M ξ) + (P : H →L[ℂ] H) (hPm : P ∈ M) (hP : IsStarProjection P) : + (0 < (vectorTrace ξ P).re ∧ (vectorTrace ξ P).re < 1) ↔ (P ≠ 0 ∧ P ≠ 1) := + and_congr (vectorTrace_projection_re_pos_iff M ξ hξ P hPm hP) + (vectorTrace_projection_re_lt_one_iff M ξ hξ P hPm hP) + +theorem hasOnlyTrivialInvariantProjections_iff_no_intermediate_trace + (M : VonNeumannAlgebra H) (ξ : H) (hξ : IsFaithfulTracialVector M ξ) + (T : H →L[ℂ] H) : + HasOnlyTrivialInvariantProjections M T ↔ + ∀ P : H →L[ℂ] H, P ∈ M → IsStarProjection P → (1 - P) * T * P = 0 → + ¬ (0 < (vectorTrace ξ P).re ∧ (vectorTrace ξ P).re < 1) := by + constructor + · intro h P hPm hP hinv hm + have hn := (vectorTrace_projection_between_zero_one_iff M ξ hξ P hPm hP).mp hm + rcases h P hPm hP hinv with hz | ho + · exact hn.1 hz + · exact hn.2 ho + · intro h P hPm hP hinv + by_cases hz : P = 0 + · exact Or.inl hz + · right + by_contra ho + exact h P hPm hP hinv + ((vectorTrace_projection_between_zero_one_iff M ξ hξ P hPm hP).mpr ⟨hz, ho⟩) +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/VectorProjectionNormality.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/VectorProjectionNormality.lean new file mode 100644 index 0000000000000000000000000000000000000000..48083ec058af004aa8683911c486954c612442bd --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/VectorProjectionNormality.lean @@ -0,0 +1,112 @@ +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties +import Mathlib.Analysis.InnerProductSpace.Projection.Submodule +import Mathlib.Topology.Order.OrderClosed + +namespace OAI + +noncomputable section +open Filter +open scoped Topology + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +omit [CompleteSpace H] in +theorem vectorTrace_starProjection_re (ξ : H) (K : Submodule ℂ H) + [K.HasOrthogonalProjection] : + (vectorTrace ξ K.starProjection).re = ‖K.starProjection ξ‖ ^ 2 := by + change (inner ℂ ξ (K.starProjection ξ)).re = _ + exact (inner_re_symm (𝕜 := ℂ) ξ (K.starProjection ξ)).trans + (Submodule.re_inner_starProjection_eq_normSq K ξ) + +omit [CompleteSpace H] in +theorem vectorTrace_starProjection_mono (ξ : H) {K L : Submodule ℂ H} + [K.HasOrthogonalProjection] [L.HasOrthogonalProjection] (hKL : K ≤ L) : + (vectorTrace ξ K.starProjection).re ≤ (vectorTrace ξ L.starProjection).re := by + rw [vectorTrace_starProjection_re, vectorTrace_starProjection_re] + have hproj : K.starProjection (L.starProjection ξ) = K.starProjection ξ := + congrArg (fun A : H →L[ℂ] H => A ξ) + (Submodule.starProjection_comp_starProjection_of_le hKL) + have hn : ‖K.starProjection ξ‖ ≤ ‖L.starProjection ξ‖ := by + rw [← hproj] + exact K.norm_starProjection_apply_le _ + exact pow_le_pow_left₀ (norm_nonneg _) hn 2 + +theorem tendsto_vectorTrace_starProjection_iSup + {ι : Type*} [Preorder ι] (ξ : H) (K : ι → Submodule ℂ H) + [∀ i, (K i).HasOrthogonalProjection] (hK : Monotone K) : + Tendsto (fun i => vectorTrace ξ (K i).starProjection) atTop + (𝓝 (vectorTrace ξ (⨆ i, K i).topologicalClosure.starProjection)) := by + exact tendsto_const_nhds.inner (Submodule.starProjection_tendsto_closure_iSup K hK ξ) + +theorem iSup_vectorTrace_starProjection + {ι : Type*} [Preorder ι] [NeBot (atTop : Filter ι)] + (ξ : H) (K : ι → Submodule ℂ H) + [∀ i, (K i).HasOrthogonalProjection] (hK : Monotone K) : + (⨆ i, (vectorTrace ξ (K i).starProjection).re) = + (vectorTrace ξ (⨆ i, K i).topologicalClosure.starProjection).re := by + apply iSup_eq_of_forall_le_of_tendsto (F := (atTop : Filter ι)) + · intro i + exact vectorTrace_starProjection_mono ξ + ((le_iSup K i).trans (Submodule.le_topologicalClosure _)) + · exact Complex.continuous_re.continuousAt.tendsto.comp + (tendsto_vectorTrace_starProjection_iSup ξ K hK) + +omit [CompleteSpace H] in +theorem tendsto_vectorTrace_starProjection_exhaustion + {ι : Type*} [Preorder ι] (ξ : H) (K : ι → Submodule ℂ H) + [∀ i, (K i).HasOrthogonalProjection] (hK : Monotone K) + (hdense : (⨆ i, K i).topologicalClosure = ⊤) : + Tendsto (fun i => vectorTrace ξ (K i).starProjection) atTop + (𝓝 ((‖ξ‖ ^ 2 : ℝ) : ℂ)) := by + have h : Tendsto (fun i => inner ℂ ξ ((K i).starProjection ξ)) atTop + (𝓝 (inner ℂ ξ ξ)) := tendsto_const_nhds.inner + (Submodule.starProjection_tendsto_self K hK ξ (by rw [hdense])) + simpa [vectorTrace, inner_self_eq_norm_sq_to_K] using h + +omit [CompleteSpace H] in +theorem tendsto_vectorTrace_starProjection_exhaustion_one + {ι : Type*} [Preorder ι] (ξ : H) (hξ : ‖ξ‖ = 1) + (K : ι → Submodule ℂ H) [∀ i, (K i).HasOrthogonalProjection] + (hK : Monotone K) (hdense : (⨆ i, K i).topologicalClosure = ⊤) : + Tendsto (fun i => (vectorTrace ξ (K i).starProjection).re) atTop (𝓝 1) := by + have h := Complex.continuous_re.continuousAt.tendsto.comp + (tendsto_vectorTrace_starProjection_exhaustion ξ K hK hdense) + simpa only [Function.comp_def, hξ, one_pow, Complex.ofReal_one, Complex.one_re] using h + +theorem starProjection_closure_iSup_mem (M : VonNeumannAlgebra H) + {ι : Type*} (K : ι → Submodule ℂ H) + [∀ i, (K i).HasOrthogonalProjection] + (hmem : ∀ i, (K i).starProjection ∈ M) : + (⨆ i, K i).topologicalClosure.starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).2 + intro y hy + rw [Submodule.range_starProjection] + apply Submodule.topologicalClosure_mem_invtSubmodule + rw [Module.End.mem_invtSubmodule_iff_map_le, Submodule.map_iSup] + apply iSup_le + intro i + have hi := (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).1 (hmem i) y hy + rw [Submodule.range_starProjection, Module.End.mem_invtSubmodule_iff_map_le] at hi + exact hi.trans (le_iSup K i) + +theorem vectorTrace_projection_normality (M : VonNeumannAlgebra H) + {ι : Type*} [Preorder ι] [NeBot (atTop : Filter ι)] + (ξ : H) (K : ι → Submodule ℂ H) + [∀ i, (K i).HasOrthogonalProjection] (hK : Monotone K) + (hmem : ∀ i, (K i).starProjection ∈ M) : + (⨆ i, K i).topologicalClosure.starProjection ∈ M ∧ + (⨆ i, (vectorTrace ξ (K i).starProjection).re) = + (vectorTrace ξ (⨆ i, K i).topologicalClosure.starProjection).re := + ⟨starProjection_closure_iSup_mem M K hmem, + iSup_vectorTrace_starProjection ξ K hK⟩ + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/VectorTraceNormality.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/VectorTraceNormality.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc180a08baf14331d11be21170e717c9438253d0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/VectorTraceNormality.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.IrrationalRotation.Model.NormalAffiliation +import OAI.Analysis.IrrationalRotation.Operators.VectorTraceState + +namespace OAI + +noncomputable section +open Filter +open scoped Topology +namespace Invariant233 + +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] + +omit [CompleteSpace H] in + +theorem tendsto_vectorTrace_of_strong {ι : Type*} {L : Filter ι} + (ξ : H) (a : ι → H →L[ℂ] H) (b : H →L[ℂ] H) + (hab : ∀ x : H, Tendsto (fun i => a i x) L (𝓝 (b x))) : + Tendsto (fun i => vectorTrace ξ (a i)) L (𝓝 (vectorTrace ξ b)) := by + exact tendsto_const_nhds.inner (hab ξ) + +theorem IsFaithfulTracialVector.toTracialState_normal + {M : VonNeumannAlgebra H} {ξ : H} (h : IsFaithfulTracialVector M ξ) : + IsNormalFaithfulTracialState M h.toTracialState := by + constructor + · exact fun a ha hz => h.toTracialState_faithful a ha hz + · intro ι L _ a b _ hab + exact tendsto_vectorTrace_of_strong ξ + (fun i => (a i : H →L[ℂ] H)) (b : H →L[ℂ] H) hab + +theorem IsNormalFaithfulTracialState.tendsto_of_strong_small + {M : VonNeumannAlgebra H} {τ : TracialState M} + (h : IsNormalFaithfulTracialState M τ) + {ι : Type} (L : Filter ι) [L.NeBot] (a : ι → M) (b : M) + (hbound : ∃ C : ℝ, ∀ i, ‖a i‖ ≤ C) + (hab : ∀ x : H, Tendsto (fun i => (a i : H →L[ℂ] H) x) L + (𝓝 ((b : H →L[ℂ] H) x))) : + Tendsto (fun i => τ (a i)) L (𝓝 (τ b)) := by + have h' := h.2 (ULift.{u} ι) (Filter.map ULift.up L) inferInstance + (fun i => a i.down) b + (by obtain ⟨C, hC⟩ := hbound; exact ⟨C, fun i => hC i.down⟩) + (fun x => ?_) + · simpa only [Filter.tendsto_map'_iff, Function.comp_def, ULift.down_up] using h' + · simpa only [Filter.tendsto_map'_iff, Function.comp_def, ULift.down_up] using hab x + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Operators/VectorTraceState.lean b/lean/OAI/Analysis/IrrationalRotation/Operators/VectorTraceState.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef5a9ec28ae8885543d1dc50818d729111beae68 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Operators/VectorTraceState.lean @@ -0,0 +1,35 @@ +import OAI.Analysis.IrrationalRotation.Model.VectorTraceState + +namespace OAI + +noncomputable section + +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +omit [CompleteSpace H] in +@[simp] +theorem vectorTraceCLM_apply (ξ : H) (A : H →L[ℂ] H) : + vectorTraceCLM ξ A = vectorTrace ξ A := rfl + +@[simp] +theorem vonNeumannVectorTraceCLM_apply (M : VonNeumannAlgebra H) (ξ : H) (A : M) : + vonNeumannVectorTraceCLM M ξ A = vectorTrace ξ (A : H →L[ℂ] H) := rfl + +@[simp] +theorem IsFaithfulTracialVector.toTracialState_apply {M : VonNeumannAlgebra H} {ξ : H} + (h : IsFaithfulTracialVector M ξ) (A : M) : + h.toTracialState A = vectorTrace ξ (A : H →L[ℂ] H) := rfl + +theorem IsFaithfulTracialVector.toTracialState_faithful {M : VonNeumannAlgebra H} {ξ : H} + (h : IsFaithfulTracialVector M ξ) (A : M) + (hA : (A : H →L[ℂ] H).IsPositive) (hzero : h.toTracialState A = 0) : A = 0 := by + apply Subtype.ext + exact h.2.2 (A : H →L[ℂ] H) A.property hA hzero + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/PrescribedAngle.lean b/lean/OAI/Analysis/IrrationalRotation/PrescribedAngle.lean new file mode 100644 index 0000000000000000000000000000000000000000..223720cdf1fd33f93272fb58aa652b580dafe05d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/PrescribedAngle.lean @@ -0,0 +1,39 @@ +import OAI.Analysis.IrrationalRotation.PrescribedAngleConditional + +namespace OAI + +/-! Continuous counterexamples for every prescribed irrational angle. -/ + +namespace Invariant233 + +theorem publishedRotationSpectralInput_of_irrational {θ : ℝ} (hθ : Irrational θ) : + PublishedRotationSpectralInput θ := by + refine ⟨fun f hf => ?_⟩ + rw [spectralRadius_eq_of_unital, Rotation.weightedReal_spectrum hθ f hf] + simp + +namespace Results + +theorem prescribed_irrational_counterexample (θ : ℝ) + (_hθ0 : 0 < θ) (_hθ1 : θ < 1) (hθ : Irrational θ) : + ∃ f : C(Circle, ℝ), Rotation.IsContinuousCounterexample θ f := + prescribed_irrational_counterexample_of_published_spectral_input θ hθ + (publishedRotationSpectralInput_of_irrational hθ) + +theorem prescribed_irrational_weight (θ : ℝ) (hθ : Irrational θ) : + ∃ f : C(Circle, ℝ), + (∀ x, 0 ≤ f x ∧ f x ≤ 1) ∧ + (∀ x, f x = 0 ↔ x = 0) ∧ + HasNegInfiniteLogIntegral circleMeasure f ∧ + ∀ P : Rotation.Hilbert →L[ℂ] Rotation.Hilbert, + P ∈ Rotation.algebra θ → IsStarProjection P → + (1 - P) * Rotation.weightedReal θ f * P = 0 → P = 0 ∨ P = 1 := by + obtain ⟨f, hf, _, hinv, _⟩ := + prescribed_irrational_counterexample_of_published_spectral_input θ hθ + (publishedRotationSpectralInput_of_irrational hθ) + exact ⟨f, hf.2.1, hf.2.2.1, hf.2.2.2, hinv⟩ + +end Results +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/PrescribedAngleConditional.lean b/lean/OAI/Analysis/IrrationalRotation/PrescribedAngleConditional.lean new file mode 100644 index 0000000000000000000000000000000000000000..4ad87d71d62f70a14772d0d94c79bc61b5bdda9d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/PrescribedAngleConditional.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.IrrationalRotation.Model.ContinuousCounterexample +import OAI.Analysis.IrrationalRotation.Rotation.CircleParametersExistence +import OAI.Analysis.IrrationalRotation.Rotation.CircleMeasurableObstruction +import OAI.Analysis.IrrationalRotation.Analysis.ContinuousCounterexampleAssembly +import Mathlib.Analysis.Normed.Algebra.GelfandFormula + +namespace OAI + +/-! The spectral-radius hypothesis and its consequences for prescribed irrational angles. -/ + +noncomputable section +open Filter +open scoped ENNReal Topology + +namespace Invariant233 + +structure PublishedRotationSpectralInput (θ : ℝ) : Prop where + radius_zero : ∀ f : C(Circle, ℝ), IsContinuousCircleWeight f → + spectralRadius ℂ (Rotation.weightedReal θ f) = 0 + +theorem PublishedRotationSpectralInput.normQuasinilpotent + {θ : ℝ} (hpub : PublishedRotationSpectralInput θ) + (f : C(Circle, ℝ)) (hf : IsContinuousCircleWeight f) : + NormQuasinilpotent (Rotation.weightedReal θ f) := by + have h := spectrum.pow_norm_pow_one_div_tendsto_nhds_spectralRadius + (Rotation.weightedReal θ f) + rw [hpub.radius_zero f hf] at h + have ht := (ENNReal.tendsto_toReal (by simp : (0 : ℝ≥0∞) ≠ ∞)).comp h + simpa only [NormQuasinilpotent, Function.comp_def, ENNReal.toReal_zero, + ENNReal.toReal_ofReal (Real.rpow_nonneg (norm_nonneg _) _)] using ht + +namespace Results + +theorem prescribed_irrational_counterexample_of_published_spectral_input + (θ : ℝ) (hθ : Irrational θ) (hpub : PublishedRotationSpectralInput θ) : + ∃ f : C(Circle, ℝ), Rotation.IsContinuousCounterexample θ f := by + obtain ⟨p, hp⟩ := exists_circle_parameters hθ + obtain ⟨f, hf, hmem, hinv⟩ := + hp.exists_continuous_invariant_weight hθ + (hp.measurableOperator_hasOnlyTrivialInvariantProjections hθ) + exact ⟨f, hf, hmem, hinv, Rotation.weightedReal_ne_zero_of_isContinuousCircleWeight θ f hf, + hpub.normQuasinilpotent f hf, Rotation.weightedReal_vectorDeterminant_zero θ f hf⟩ + +end Results +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/CoordinateSwap.lean b/lean/OAI/Analysis/IrrationalRotation/Product/CoordinateSwap.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6548a9cba2fc41c0e285b2fc2a75311d430c37a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/CoordinateSwap.lean @@ -0,0 +1,68 @@ +import Mathlib + +namespace OAI + +open MeasureTheory +open scoped ENNReal + +namespace Invariant233.CoordinateSwap + +variable {X : Type*} [MeasurableSpace X] + +def flatten : ((ℕ → X) × (ℕ → X)) ≃ᵐ (Fin 2 × ℕ → X) := + MeasurableEquiv.finTwoArrow.symm.trans (MeasurableEquiv.curry (Fin 2) ℕ X).symm + +def swapIndex (I : Finset ℕ) : Fin 2 × ℕ ≃ Fin 2 × ℕ where + toFun p := (if p.2 ∈ I then Equiv.swap 0 1 p.1 else p.1, p.2) + invFun p := (if p.2 ∈ I then Equiv.swap 0 1 p.1 else p.1, p.2) + left_inv p := by rcases p with ⟨a,n⟩; by_cases hn : n ∈ I <;> simp [hn] + right_inv p := by rcases p with ⟨a,n⟩; by_cases hn : n ∈ I <;> simp [hn] + +def swapEquiv (I : Finset ℕ) : ((ℕ → X) × (ℕ → X)) ≃ᵐ ((ℕ → X) × (ℕ → X)) := + (flatten.trans (MeasurableEquiv.piCongrLeft (fun _ : Fin 2 × ℕ => X) (swapIndex I))).trans + flatten.symm + +theorem measurePreserving_flatten (μ : Measure X) [IsProbabilityMeasure μ] : + MeasurePreserving (flatten (X := X)) + ((Measure.infinitePi (fun _ : ℕ => μ)).prod (Measure.infinitePi (fun _ : ℕ => μ))) + (Measure.infinitePi (fun _ : Fin 2 × ℕ => μ)) := by + have hp := MeasurePreserving.symm MeasurableEquiv.finTwoArrow + (measurePreserving_finTwoArrow (Measure.infinitePi (fun _ : ℕ => μ))) + have hc : MeasurePreserving (MeasurableEquiv.curry (Fin 2) ℕ X).symm + (Measure.infinitePi (fun _ : Fin 2 => Measure.infinitePi (fun _ : ℕ => μ))) + (Measure.infinitePi (fun _ : Fin 2 × ℕ => μ)) := by + exact ⟨(MeasurableEquiv.curry (Fin 2) ℕ X).symm.measurable, + Measure.infinitePi_map_curry_symm (fun _ : Fin 2 => fun _ : ℕ => μ)⟩ + apply hp.trans + simpa only [Measure.infinitePi_eq_pi] using hc + +theorem measurePreserving_swap (μ : Measure X) [IsProbabilityMeasure μ] (I : Finset ℕ) : + MeasurePreserving (swapEquiv (X := X) I) + ((Measure.infinitePi (fun _ : ℕ => μ)).prod (Measure.infinitePi (fun _ : ℕ => μ))) + ((Measure.infinitePi (fun _ : ℕ => μ)).prod (Measure.infinitePi (fun _ : ℕ => μ))) := by + have hr : MeasurePreserving + (MeasurableEquiv.piCongrLeft (fun _ : Fin 2 × ℕ => X) (swapIndex I)) + (Measure.infinitePi (fun _ : Fin 2 × ℕ => μ)) + (Measure.infinitePi (fun _ : Fin 2 × ℕ => μ)) := + ⟨(MeasurableEquiv.piCongrLeft _ _).measurable, + Measure.infinitePi_map_piCongrLeft (fun _ : Fin 2 × ℕ => μ) (swapIndex I)⟩ + exact ((measurePreserving_flatten μ).trans hr).trans + (MeasurePreserving.symm flatten (measurePreserving_flatten μ)) + +theorem swapEquiv_fst (I : Finset ℕ) (xz : (ℕ → X) × (ℕ → X)) (i : ℕ) : + (swapEquiv I xz).1 i = if i ∈ I then xz.2 i else xz.1 i := by + by_cases hi : i ∈ I <;> + simp [swapEquiv, flatten, MeasurableEquiv.piCongrLeft, Equiv.piCongrLeft, + swapIndex, hi, MeasurableEquiv.finTwoArrow, MeasurableEquiv.piFinTwo, + MeasurableEquiv.curry] + +theorem swapEquiv_snd (I : Finset ℕ) (xz : (ℕ → X) × (ℕ → X)) (i : ℕ) : + (swapEquiv I xz).2 i = if i ∈ I then xz.1 i else xz.2 i := by + by_cases hi : i ∈ I <;> + simp [swapEquiv, flatten, MeasurableEquiv.piCongrLeft, Equiv.piCongrLeft, + swapIndex, hi, MeasurableEquiv.finTwoArrow, MeasurableEquiv.piFinTwo, + MeasurableEquiv.curry] + +end Invariant233.CoordinateSwap + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/FiniteProductAbsoluteContinuity.lean b/lean/OAI/Analysis/IrrationalRotation/Product/FiniteProductAbsoluteContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..72807d5915d485c707c4b71c41020efd9784e7bd --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/FiniteProductAbsoluteContinuity.lean @@ -0,0 +1,68 @@ +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators ENNReal + +namespace Invariant233 + +theorem fin_pi_absolutelyContinuous {n : ℕ} {X : Fin n → Type*} + [∀ i, MeasurableSpace (X i)] (μ ν : (i : Fin n) → Measure (X i)) + [∀ i, SigmaFinite (μ i)] [∀ i, SigmaFinite (ν i)] + (h : ∀ i, μ i ≪ ν i) : Measure.pi μ ≪ Measure.pi ν := by + induction n with + | zero => + rw [Measure.pi_of_empty μ, Measure.pi_of_empty ν] + | succ n ih => + have ht : Measure.pi (fun i : Fin n => μ (Fin.succAbove 0 i)) ≪ + Measure.pi (fun i : Fin n => ν (Fin.succAbove 0 i)) := + ih (fun i => μ (Fin.succAbove 0 i)) (fun i => ν (Fin.succAbove 0 i)) + (fun i => h (Fin.succAbove 0 i)) + have hp := (h 0).prod ht + have hm := (measurePreserving_piFinSuccAbove μ 0).symm + have hn := (measurePreserving_piFinSuccAbove ν 0).symm + have hx := hp.map (MeasurableEquiv.piFinSuccAbove X 0).symm.measurable + rwa [hm.map_eq, hn.map_eq] at hx + +theorem fintype_pi_absolutelyContinuous {I : Type*} [Fintype I] + {X : I → Type*} [∀ i, MeasurableSpace (X i)] + (μ ν : (i : I) → Measure (X i)) + [∀ i, SigmaFinite (μ i)] [∀ i, SigmaFinite (ν i)] + (h : ∀ i, μ i ≪ ν i) : Measure.pi μ ≪ Measure.pi ν := by + let e := (Fintype.equivFin I).symm + have ha := fin_pi_absolutelyContinuous (fun i => μ (e i)) (fun i => ν (e i)) + (fun i => h (e i)) + have hmap := ha.map (MeasurableEquiv.piCongrLeft X e).measurable + rwa [(measurePreserving_piCongrLeft μ e).map_eq, + (measurePreserving_piCongrLeft ν e).map_eq] at hmap + +theorem pi_finite_sum {I J : Type*} [Fintype I] [DecidableEq I] [Fintype J] + {X : I → Type*} [∀ i, MeasurableSpace (X i)] + (μ : (i : I) → J → Measure (X i)) [∀ i j, IsFiniteMeasure (μ i j)] : + Measure.pi (fun i => ∑ j, μ i j) = + ∑ pattern : I → J, Measure.pi (fun i => μ i (pattern i)) := by + classical + apply Measure.pi_eq + intro s hs + simp_rw [Measure.finsetSum_apply, Measure.pi_pi] + exact (Fintype.prod_sum (fun i j => μ i j (s i))).symm + +theorem pi_add_eq_sum_bool {I : Type*} [Fintype I] [DecidableEq I] + {X : I → Type*} [∀ i, MeasurableSpace (X i)] + (μ ν : (i : I) → Measure (X i)) + [∀ i, IsFiniteMeasure (μ i)] [∀ i, IsFiniteMeasure (ν i)] : + Measure.pi (fun i => μ i + ν i) = + ∑ pattern : I → Bool, Measure.pi (fun i => if pattern i then ν i else μ i) := by + have : ∀ i (b : Bool), IsFiniteMeasure (if b then ν i else μ i) := by + intro i b + cases b <;> simp only [Bool.false_eq_true, ite_false, ite_true] <;> infer_instance + simpa only [Fintype.sum_bool, Bool.false_eq_true, ite_false, ite_true, add_comm] using + pi_finite_sum (fun i (b : Bool) => if b then ν i else μ i) + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/FloorProducts.lean b/lean/OAI/Analysis/IrrationalRotation/Product/FloorProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..276d7738d81512c96276cd9eff7bd33313030ed2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/FloorProducts.lean @@ -0,0 +1,165 @@ +import OAI.Analysis.IrrationalRotation.Rotation.FloorCocycle +import Mathlib.Algebra.BigOperators.Group.Finset.Basic + +namespace OAI + +namespace Invariant233.FloorProducts + +open scoped BigOperators + +theorem finite_cocycle {ι : Type*} (s : Finset ι) (c x θ : ι → ℝ) (k n : ℤ) : + Real.exp (-(∑ i ∈ s, c i * (⌊x i + ((k + n : ℤ) : ℝ) * θ i⌋ : ℝ))) = + Real.exp (-(∑ i ∈ s, + c i * (⌊Int.fract (x i + (k : ℝ) * θ i) + (n : ℝ) * θ i⌋ : ℝ))) * + Real.exp (-(∑ i ∈ s, c i * (⌊x i + (k : ℝ) * θ i⌋ : ℝ))) := by + have hsum : (∑ i ∈ s, c i * (⌊x i + ((k + n : ℤ) : ℝ) * θ i⌋ : ℝ)) = + (∑ i ∈ s, c i * (⌊x i + (k : ℝ) * θ i⌋ : ℝ)) + + ∑ i ∈ s, c i * (⌊Int.fract (x i + (k : ℝ) * θ i) + (n : ℝ) * θ i⌋ : ℝ) := by + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i hi + rw [← FloorCocycle.floor_cocycle, Int.cast_add, mul_add] + rw [hsum, neg_add, Real.exp_add, mul_comm] + +theorem finite_cocycle_zero {ι : Type*} (s : Finset ι) (c x : ι → ℝ) + (hx : ∀ i ∈ s, x i ∈ Set.Ico (0 : ℝ) 1) : + Real.exp (-(∑ i ∈ s, c i * (⌊x i⌋ : ℝ))) = 1 := by + have hsum : (∑ i ∈ s, c i * (⌊x i⌋ : ℝ)) = 0 := by + apply Finset.sum_eq_zero + intro i hi + rw [Int.floor_eq_zero_iff.mpr (hx i hi)] + simp + rw [hsum, neg_zero, Real.exp_zero] + +theorem finite_cocycle_antitone {ι : Type*} (s : Finset ι) (c x θ : ι → ℝ) + (hc : ∀ i ∈ s, 0 ≤ c i) (hθ : ∀ i ∈ s, 0 ≤ θ i) : + Antitone (fun k : ℤ => Real.exp (-(∑ i ∈ s, + c i * (⌊x i + (k : ℝ) * θ i⌋ : ℝ)))) := by + intro k n hkn + apply Real.exp_le_exp.mpr + apply neg_le_neg + apply Finset.sum_le_sum + intro i hi + apply mul_le_mul_of_nonneg_left _ (hc i hi) + have hkn' : (k : ℝ) ≤ (n : ℝ) := by exact_mod_cast hkn + have harg : x i + (k : ℝ) * θ i ≤ x i + (n : ℝ) * θ i := by + nlinarith [hθ i hi] + exact_mod_cast Int.floor_mono harg + +theorem finite_ratio_eq {ι : Type*} (s : Finset ι) (c x y t : ι → ℝ) + (hx : ∀ i ∈ s, 0 ≤ x i) (hxy : ∀ i ∈ s, x i ≤ y i) + (hy : ∀ i ∈ s, y i < 1) : + Real.exp (-(∑ i ∈ s, c i * (⌊y i + t i⌋ : ℝ))) / + Real.exp (-(∑ i ∈ s, c i * (⌊x i + t i⌋ : ℝ))) = + Real.exp (-(∑ i ∈ s, + if x i < 1 - Int.fract (t i) ∧ 1 - Int.fract (t i) ≤ y i then c i else 0)) := by + rw [← Real.exp_sub] + congr 1 + have hsum : (∑ i ∈ s, c i * (⌊y i + t i⌋ : ℝ)) - + (∑ i ∈ s, c i * (⌊x i + t i⌋ : ℝ)) = + ∑ i ∈ s, if x i < 1 - Int.fract (t i) ∧ 1 - Int.fract (t i) ≤ y i + then c i else 0 := by + rw [← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro i hi + rw [← mul_sub] + have hd := FloorCocycle.floor_sub_eq_crossing (hx i hi) + (lt_of_le_of_lt (hxy i hi) (hy i hi)) (le_trans (hx i hi) (hxy i hi)) + (hy i hi) (hxy i hi) (t i) + have hd' : (⌊y i + t i⌋ : ℝ) - (⌊x i + t i⌋ : ℝ) = + if x i < 1 - Int.fract (t i) ∧ 1 - Int.fract (t i) ≤ y i then 1 else 0 := by + exact_mod_cast hd + rw [hd'] + split_ifs <;> simp + linarith + +theorem finite_ratio_suppression {ι : Type*} (s a : Finset ι) (c x y t : ι → ℝ) + (ha : a ⊆ s) (hc : ∀ i ∈ s, 0 ≤ c i) + (hx : ∀ i ∈ s, 0 ≤ x i) (hxy : ∀ i ∈ s, x i ≤ y i) + (hy : ∀ i ∈ s, y i < 1) + (hcross : ∀ i ∈ a, x i < 1 - Int.fract (t i) ∧ 1 - Int.fract (t i) ≤ y i) : + Real.exp (-(∑ i ∈ s, c i * (⌊y i + t i⌋ : ℝ))) / + Real.exp (-(∑ i ∈ s, c i * (⌊x i + t i⌋ : ℝ))) ≤ + Real.exp (-(∑ i ∈ a, c i)) := by + classical + rw [finite_ratio_eq s c x y t hx hxy hy] + apply Real.exp_le_exp.mpr + apply neg_le_neg + have heq : (∑ i ∈ a, c i) = ∑ i ∈ a, + if x i < 1 - Int.fract (t i) ∧ 1 - Int.fract (t i) ≤ y i then c i else 0 := by + apply Finset.sum_congr rfl + intro i hi + rw [ite_eq_left (hcross i hi)] + rw [heq] + apply Finset.sum_le_sum_of_subset_of_nonneg ha + intro i hi hia + split_ifs + · exact hc i hi + · exact le_rfl + +theorem finite_ratio_le_one {ι : Type*} (s : Finset ι) (c x y t : ι → ℝ) + (hc : ∀ i ∈ s, 0 ≤ c i) (hx : ∀ i ∈ s, 0 ≤ x i) + (hxy : ∀ i ∈ s, x i ≤ y i) (hy : ∀ i ∈ s, y i < 1) : + Real.exp (-(∑ i ∈ s, c i * (⌊y i + t i⌋ : ℝ))) / + Real.exp (-(∑ i ∈ s, c i * (⌊x i + t i⌋ : ℝ))) ≤ 1 := by + simpa using finite_ratio_suppression s ∅ c x y t (Finset.empty_subset s) + hc hx hxy hy (by simp) + +theorem finite_ratio_le_exp_neg_cost {ι : Type*} (s : Finset ι) (c x y t : ι → ℝ) + (hc : ∀ i ∈ s, 0 ≤ c i) (hx : ∀ i ∈ s, 0 ≤ x i) + (hxy : ∀ i ∈ s, x i ≤ y i) (hy : ∀ i ∈ s, y i < 1) + (i : ι) (hi : i ∈ s) + (hcross : x i < 1 - Int.fract (t i) ∧ 1 - Int.fract (t i) ≤ y i) : + Real.exp (-(∑ j ∈ s, c j * (⌊y j + t j⌋ : ℝ))) / + Real.exp (-(∑ j ∈ s, c j * (⌊x j + t j⌋ : ℝ))) ≤ Real.exp (-c i) := by + classical + simpa using finite_ratio_suppression s {i} c x y t + (Finset.singleton_subset_iff.mpr hi) hc hx hxy hy (by simpa using hcross) + +theorem finite_ratio_cap {ι : Type*} (s a : Finset ι) (c x y t : ι → ℝ) + (ha : a ⊆ s) (hc : ∀ i ∈ s, 0 ≤ c i) + (hx : ∀ i ∈ s, x i ∈ Set.Ico (0 : ℝ) 1) + (hy : ∀ i ∈ s, y i ∈ Set.Ico (0 : ℝ) 1) + (hxy : ∀ i ∈ s, i ∉ a → x i ≤ y i) : + Real.exp (-(∑ i ∈ s, c i * (⌊y i + t i⌋ : ℝ))) / + Real.exp (-(∑ i ∈ s, c i * (⌊x i + t i⌋ : ℝ))) ≤ + Real.exp (∑ i ∈ a, c i) := by + classical + rw [← Real.exp_sub] + apply Real.exp_le_exp.mpr + have hsum : (∑ i ∈ s, c i * (⌊x i + t i⌋ : ℝ)) - + (∑ i ∈ s, c i * (⌊y i + t i⌋ : ℝ)) ≤ ∑ i ∈ a, c i := by + rw [← Finset.sum_sub_distrib] + have heq : (∑ i ∈ a, c i) = ∑ i ∈ s, if i ∈ a then c i else 0 := by + calc + _ = ∑ i ∈ a, if i ∈ a then c i else 0 := by + apply Finset.sum_congr rfl + intro i hi + rw [ite_eq_left hi] + _ = ∑ i ∈ s, if i ∈ a then c i else 0 := by + apply Finset.sum_subset ha + intro i his hia + rw [ite_eq_right hia] + rw [heq] + apply Finset.sum_le_sum + intro i hi + by_cases hia : i ∈ a + · rw [ite_eq_left hia] + have hf := (FloorCocycle.floor_sub_bounds (hy i hi).1 (hy i hi).2 + (hx i hi).1 (hx i hi).2 (t i)).2 + have hf' : (⌊x i + t i⌋ : ℝ) - (⌊y i + t i⌋ : ℝ) ≤ 1 := by + exact_mod_cast hf + calc + _ = c i * ((⌊x i + t i⌋ : ℝ) - (⌊y i + t i⌋ : ℝ)) := by ring + _ ≤ c i * 1 := mul_le_mul_of_nonneg_left hf' (hc i hi) + _ = c i := mul_one _ + · rw [ite_eq_right hia] + have hf : (⌊x i + t i⌋ : ℝ) ≤ (⌊y i + t i⌋ : ℝ) := by + exact_mod_cast Int.floor_mono (show x i + t i ≤ y i + t i by + linarith [hxy i hi hia]) + exact sub_nonpos.mpr (mul_le_mul_of_nonneg_left hf (hc i hi)) + linarith + +end Invariant233.FloorProducts + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/IndependentAngles.lean b/lean/OAI/Analysis/IrrationalRotation/Product/IndependentAngles.lean new file mode 100644 index 0000000000000000000000000000000000000000..5190e148749aa3ae7b50a54adcf4b7dc17c7c021 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/IndependentAngles.lean @@ -0,0 +1,223 @@ +import Mathlib.Probability.Independence.InfinitePi +import Mathlib.Probability.ConditionalProbability +import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +import Mathlib.Analysis.Normed.Group.InfiniteSum +import Mathlib.MeasureTheory.Measure.Typeclasses.NullSingletonClass +import Mathlib.Data.Finsupp.Encodable +import Mathlib.Data.Finsupp.Option +import Mathlib.LinearAlgebra.LinearIndependent.Defs +import Mathlib.Tactic + +namespace OAI + +open scoped BigOperators +open MeasureTheory MeasureTheory.Measure ProbabilityTheory + +namespace InvariantProjection.IndependentAngles + +variable {Ω ι : Type*} [MeasurableSpace Ω] {μ : Measure Ω} + +theorem ae_add_ne_of_indep [IsProbabilityMeasure μ] {X Y : Ω → ℝ} + (hX : Measurable X) (hY : Measurable Y) (hXY : IndepFun X Y μ) + [NullSingletonClass (μ.map Y)] (c : ℝ) : + ∀ᵐ ω ∂μ, X ω + Y ω ≠ c := by + have hset : MeasurableSet {z : ℝ × ℝ | z.1 + z.2 ≠ c} := by + exact (measurable_fst.add measurable_snd) (measurableSet_singleton c).compl + have hp : ∀ᵐ z ∂(μ.map X).prod (μ.map Y), z.1 + z.2 ≠ c := by + apply (ae_prod_iff_ae_ae hset).2 + exact Filter.Eventually.of_forall fun x => + ((μ.map Y).ae_ne (c - x)).mono fun y hy h => hy (by linarith) + rw [← hXY.map_prod_eq_prod_map_map hX.aemeasurable hY.aemeasurable] at hp + exact ae_of_ae_map (hX.prodMk hY).aemeasurable hp + +theorem nullSingletonClass_map_mul {X : Ω → ℝ} (hX : Measurable X) + [NullSingletonClass (μ.map X)] {c : ℝ} (hc : c ≠ 0) : + NullSingletonClass (μ.map (fun ω => c * X ω)) := by + constructor + intro y + rw [Measure.map_apply (show Measurable (fun ω => c * X ω) from + measurable_const.mul hX) (measurableSet_singleton y)] + have hsub : (fun ω => c * X ω) ⁻¹' {y} ⊆ X ⁻¹' {y / c} := by + intro ω hω + simp only [Set.mem_preimage, Set.mem_singleton_iff] at hω ⊢ + apply (eq_div_iff hc).2 + simpa [mul_comm] using hω + apply measure_mono_null hsub + rw [← Measure.map_apply hX (measurableSet_singleton (y / c))] + exact measure_singleton _ + +theorem ae_finset_sum_ne [IsProbabilityMeasure μ] [DecidableEq ι] + {X : ι → Ω → ℝ} (hX : ∀ i, Measurable (X i)) (hind : iIndepFun X μ) + (hno : ∀ i, NullSingletonClass (μ.map (X i))) + (s : Finset ι) (c : ι → ℝ) {i : ι} (hi : i ∈ s) (hci : c i ≠ 0) + (r : ℝ) : ∀ᵐ ω ∂μ, (∑ j ∈ s, c j * X j ω) ≠ r := by + let Y : ι → Ω → ℝ := fun j ω => c j * X j ω + have hY : ∀ j, Measurable (Y j) := fun j => measurable_const.mul (hX j) + have hindY : iIndepFun Y μ := hind.comp (fun j x => c j * x) + (fun _ => measurable_const.mul measurable_id) + have hsumInd : IndepFun (∑ j ∈ s.erase i, Y j) (Y i) μ := + hindY.indepFun_finsetSum_of_notMem hY (Finset.notMem_erase i s) + let : NullSingletonClass (μ.map (X i)) := hno i + let : NullSingletonClass (μ.map (Y i)) := + nullSingletonClass_map_mul (hX i) hci + have hsum : Measurable (∑ j ∈ s.erase i, Y j) := by + change Measurable (fun ω => (∑ j ∈ s.erase i, Y j) ω) + simp only [Finset.sum_apply] + exact Finset.measurable_sum (s.erase i) (fun j _ => hY j) + filter_upwards [ae_add_ne_of_indep hsum (hY i) hsumInd r] with ω hω + convert hω using 1 + simp only [Finset.sum_apply, Y] + exact (Finset.sum_erase_add _ _ hi).symm + +theorem ae_finsupp_sum_ne [IsProbabilityMeasure μ] {X : ι → Ω → ℝ} + (hX : ∀ i, Measurable (X i)) (hind : iIndepFun X μ) + (hno : ∀ i, NullSingletonClass (μ.map (X i))) + (c : ι →₀ ℚ) (hc : c ≠ 0) (r : ℝ) : + ∀ᵐ ω ∂μ, c.sum (fun j q => (q : ℝ) * X j ω) ≠ r := by + classical + obtain ⟨i, hi⟩ := Finsupp.support_nonempty_iff.mpr hc + have hci : (c i : ℝ) ≠ 0 := by + exact_mod_cast Finsupp.mem_support_iff.mp hi + exact ae_finset_sum_ne hX hind hno c.support (fun j => (c j : ℝ)) hi hci r + +theorem ae_no_rational_affine_relation [Countable ι] [IsProbabilityMeasure μ] + {X : ι → Ω → ℝ} (hX : ∀ i, Measurable (X i)) (hind : iIndepFun X μ) + (hno : ∀ i, NullSingletonClass (μ.map (X i))) : + ∀ᵐ ω ∂μ, ∀ (c : ι →₀ ℚ) (q : ℚ), + (q : ℝ) + c.sum (fun j r => (r : ℝ) * X j ω) = 0 → c = 0 ∧ q = 0 := by + apply ae_all_iff.mpr + intro c + apply ae_all_iff.mpr + intro q + by_cases hc : c = 0 + · subst c + exact Filter.Eventually.of_forall fun ω h => ⟨rfl, by simpa using h⟩ + · filter_upwards [ae_finsupp_sum_ne hX hind hno c hc (-(q : ℝ))] with ω hω + intro heq + exact False.elim (hω (by linarith)) + +theorem ae_linearIndependent_with_one [Countable ι] [IsProbabilityMeasure μ] + {X : ι → Ω → ℝ} (hX : ∀ i, Measurable (X i)) (hind : iIndepFun X μ) + (hno : ∀ i, NullSingletonClass (μ.map (X i))) : + ∀ᵐ ω ∂μ, LinearIndependent ℚ (fun o : Option ι => o.elim 1 (fun i => X i ω)) := by + filter_upwards [ae_no_rational_affine_relation hX hind hno] with ω hω + rw [linearIndependent_iff] + intro l hl + rw [Finsupp.linearCombination_apply, Finsupp.sum_option_index_smul] at hl + have hrel : (l none : ℝ) + l.some.sum (fun j r => (r : ℝ) * X j ω) = 0 := by + simpa only [Option.elim_none, Option.elim_some, Rat.smul_def, mul_one] using hl + obtain ⟨hsome, hnone⟩ := hω l.some (l none) hrel + ext o + cases o with + | none => exact hnone + | some i => + change l.some i = 0 + rw [hsome] + rfl + +theorem infinitePi_ae_linearIndependent_with_one [Countable ι] + (ν : ι → Measure ℝ) [∀ i, IsProbabilityMeasure (ν i)] + [∀ i, NullSingletonClass (ν i)] : + ∀ᵐ θ ∂Measure.infinitePi ν, + LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ) := by + have hm : ∀ i : ι, Measurable (fun θ : ι → ℝ => θ i) := + fun i => measurable_pi_apply i + have hi : iIndepFun (fun i (θ : ι → ℝ) => θ i) (Measure.infinitePi ν) := + iIndepFun_infinitePi (X := fun _ (x : ℝ) => x) (fun _ => measurable_id) + have hn : ∀ i : ι, NullSingletonClass + ((Measure.infinitePi ν).map (fun θ : ι → ℝ => θ i)) := by + intro i + rw [Measure.infinitePi_map_eval] + infer_instance + exact ae_linearIndependent_with_one hm hi hn + +theorem exists_linearIndependent_with_one_and [Countable ι] + (ν : ι → Measure ℝ) [∀ i, IsProbabilityMeasure (ν i)] + [∀ i, NullSingletonClass (ν i)] {P : (ι → ℝ) → Prop} + (hP : ∀ᵐ θ ∂Measure.infinitePi ν, P θ) : + ∃ θ : ι → ℝ, LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ) ∧ P θ := + ((infinitePi_ae_linearIndependent_with_one ν).and hP).exists + +theorem intervalLaw_isProbabilityMeasure {a b : ℝ} (hab : a < b) : + IsProbabilityMeasure (ProbabilityTheory.cond volume (Set.Icc a b)) := by + apply cond_isProbabilityMeasure_of_finite + · rw [Real.volume_Icc] + exact (ENNReal.ofReal_pos.mpr (sub_pos.mpr hab)).ne' + · rw [Real.volume_Icc] + exact ENNReal.ofReal_ne_top + +theorem intervalLaw_nullSingletonClass (a b : ℝ) : + NullSingletonClass (ProbabilityTheory.cond volume (Set.Icc a b)) := by + constructor + intro x + exact ProbabilityTheory.cond_absolutelyContinuous (measure_singleton x) + +theorem intervalProduct_ae_bounds_linearIndependent [Countable ι] + (a b : ι → ℝ) (hab : ∀ i, a i < b i) : + ∀ᵐ θ ∂Measure.infinitePi (fun i => ProbabilityTheory.cond volume (Set.Icc (a i) (b i))), + (∀ i, θ i ∈ Set.Icc (a i) (b i)) ∧ + LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ) := by + let ν : ι → Measure ℝ := fun i => ProbabilityTheory.cond volume (Set.Icc (a i) (b i)) + let (i : ι) : IsProbabilityMeasure (ν i) := intervalLaw_isProbabilityMeasure (hab i) + let (i : ι) : NullSingletonClass (ν i) := intervalLaw_nullSingletonClass (a i) (b i) + have hb : ∀ᵐ θ ∂Measure.infinitePi ν, ∀ i, θ i ∈ Set.Icc (a i) (b i) := by + apply ae_all_iff.mpr + intro i + have hi : ∀ᵐ x ∂(Measure.infinitePi ν).map (fun θ => θ i), + x ∈ Set.Icc (a i) (b i) := by + rw [Measure.infinitePi_map_eval] + exact ae_cond_mem measurableSet_Icc + exact ae_of_ae_map (measurable_pi_apply i).aemeasurable hi + exact hb.and (infinitePi_ae_linearIndependent_with_one ν) + +theorem exists_interval_bounds_linearIndependent [Countable ι] + (a b : ι → ℝ) (hab : ∀ i, a i < b i) : + ∃ θ : ι → ℝ, (∀ i, θ i ∈ Set.Icc (a i) (b i)) ∧ + LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ) := by + let (i : ι) : IsProbabilityMeasure + (ProbabilityTheory.cond volume (Set.Icc (a i) (b i))) := + intervalLaw_isProbabilityMeasure (hab i) + exact (intervalProduct_ae_bounds_linearIndependent a b hab).exists + +theorem prescribedIntervals_ae_summable_independent [Countable ι] + (N : ι → ℝ) (hN : ∀ i, 0 < N i) (hsum : Summable (fun i => 1 / N i)) : + ∀ᵐ θ ∂Measure.infinitePi + (fun i => ProbabilityTheory.cond volume (Set.Icc (1 / N i) (2 / N i))), + (∀ i, θ i ∈ Set.Icc (1 / N i) (2 / N i)) ∧ Summable θ ∧ + (∑' i, θ i) ≤ 2 * (∑' i, 1 / N i) ∧ + LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ) := by + have hinterval : ∀ i, (1 : ℝ) / N i < 2 / N i := fun i => + div_lt_div_of_pos_right (by norm_num) (hN i) + filter_upwards [intervalProduct_ae_bounds_linearIndependent + (fun i => 1 / N i) (fun i => 2 / N i) hinterval] with θ hθ + have hnonneg : ∀ i, 0 ≤ θ i := fun i => + (le_of_lt (one_div_pos.mpr (hN i))).trans (hθ.1 i).1 + have hupper : ∀ i, θ i ≤ 2 * (1 / N i) := by + intro i + simpa only [mul_one_div] using (hθ.1 i).2 + have hsumθ : Summable θ := + Summable.of_nonneg_of_le hnonneg hupper (hsum.mul_left 2) + refine ⟨hθ.1, hsumθ, ?_, hθ.2⟩ + calc + (∑' i, θ i) ≤ ∑' i, 2 * (1 / N i) := + hsumθ.tsum_le_tsum hupper (hsum.mul_left 2) + _ = 2 * (∑' i, 1 / N i) := tsum_mul_left + +theorem exists_prescribed_summable_independent_and [Countable ι] + (N : ι → ℝ) (hN : ∀ i, 0 < N i) (hsum : Summable (fun i => 1 / N i)) + {P : (ι → ℝ) → Prop} + (hP : ∀ᵐ θ ∂Measure.infinitePi + (fun i => ProbabilityTheory.cond volume (Set.Icc (1 / N i) (2 / N i))), P θ) : + ∃ θ : ι → ℝ, (∀ i, θ i ∈ Set.Icc (1 / N i) (2 / N i)) ∧ Summable θ ∧ + (∑' i, θ i) ≤ 2 * (∑' i, 1 / N i) ∧ + LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ) ∧ P θ := by + let (i : ι) : IsProbabilityMeasure + (ProbabilityTheory.cond volume (Set.Icc (1 / N i) (2 / N i))) := + intervalLaw_isProbabilityMeasure (div_lt_div_of_pos_right (by norm_num) (hN i)) + obtain ⟨θ, hθ, hp⟩ := + ((prescribedIntervals_ae_summable_independent N hN hsum).and hP).exists + exact ⟨θ, hθ.1, hθ.2.1, hθ.2.2.1, hθ.2.2.2, hp⟩ + +end InvariantProjection.IndependentAngles + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/IndependentCoordinateConditioning.lean b/lean/OAI/Analysis/IrrationalRotation/Product/IndependentCoordinateConditioning.lean new file mode 100644 index 0000000000000000000000000000000000000000..7088699428b86fd0c1e7919220947a84d50f8cc2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/IndependentCoordinateConditioning.lean @@ -0,0 +1,328 @@ +import Mathlib.Algebra.BigOperators.Pi +import Mathlib.Probability.ProductMeasure +import Mathlib.MeasureTheory.Integral.Pi +import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic +import Mathlib.Probability.Independence.Conditional + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped BigOperators ProbabilityTheory Classical + +namespace Invariant233.CoordinateConditioning + +variable {ι : Type*} {X Y : ι → Type*} + [∀ i, MeasurableSpace (X i)] [∀ i, MeasurableSpace (Y i)] + (μ : ∀ i, Measure (X i)) [∀ i, IsProbabilityMeasure (μ i)] + +theorem integral_finset_prod (S : Finset ι) (f : ∀ i, X i → ℝ) + (hf : ∀ i, Measurable (f i)) : + ∫ x, ∏ i ∈ S, f i (x i) ∂Measure.infinitePi μ = + ∏ i ∈ S, ∫ x, f i x ∂μ i := by + classical + have he : (fun x : ∀ i, X i => ∏ i ∈ S, f i (x i)) = + (fun z : ∀ i : S, X i => ∏ i : S, f i (z i)) ∘ S.restrict := by + funext x + simp only [Function.comp_apply, Finset.restrict] + exact (S.prod_coe_sort (fun i => f i (x i))).symm + rw [he] + change (∫ x, (∏ i : S, f i (S.restrict x i)) ∂Measure.infinitePi μ) = _ + rw [MeasureTheory.integral_restrict_infinitePi μ (s := S) + (f := fun z : ∀ i : S, X i => ∏ i : S, f i (z i))] + · rw [integral_fintype_prod_eq_prod] + exact S.prod_coe_sort (fun i => ∫ x, f i x ∂μ i) + · exact (Finset.measurable_prod Finset.univ + (fun (i : S) _ => (hf i).comp (measurable_pi_apply i))).aestronglyMeasurable + +theorem integrable_finset_prod (S : Finset ι) (f : ∀ i, X i → ℝ) + (hf : ∀ i, Measurable (f i)) (hb : ∀ i x, ‖f i x‖ ≤ 1) : + Integrable (fun x : ∀ i, X i => ∏ i ∈ S, f i (x i)) (Measure.infinitePi μ) := by + apply (integrable_const (1 : ℝ)).mono' + · exact (Finset.measurable_prod S + (fun i _ => (hf i).comp (measurable_pi_apply i))).aestronglyMeasurable + · exact Eventually.of_forall fun x => by + rw [norm_prod] + exact Finset.prod_le_one₀ (fun i _ => norm_nonneg _) (fun i _ => hb i (x i)) + +private theorem prod_extend (S T : Finset ι) (f : ι → ℝ) : + ∏ i ∈ S ∪ T, (if i ∈ S then f i else 1) = ∏ i ∈ S, f i := by + classical + rw [Finset.prod_ite_mem] + simp + +omit [∀ i, MeasurableSpace (X i)] in + +private theorem cylinder_indicator_prod (S T : Finset ι) (f : ∀ i, X i → ℝ) + (B : ∀ i, Set (X i)) (x : ∀ i, X i) : + ((T : Set ι).pi B).indicator (fun x => ∏ i ∈ S, f i (x i)) x = + ∏ i ∈ S ∪ T, + (if i ∈ T then (B i).indicator + (fun z => if i ∈ S then f i z else 1) (x i) + else if i ∈ S then f i (x i) else 1) := by + classical + by_cases hx : x ∈ (T : Set ι).pi B + · rw [Set.indicator_of_mem hx] + have hval : ∀ i ∈ S ∪ T, + (if i ∈ T then (B i).indicator (fun z => if i ∈ S then f i z else 1) (x i) + else if i ∈ S then f i (x i) else 1) = if i ∈ S then f i (x i) else 1 := by + intro i hi + by_cases hit : i ∈ T + · rw [ite_eq_left hit, Set.indicator_of_mem (hx i hit)] + · rw [ite_eq_right hit] + rw [Finset.prod_congr rfl hval] + exact (prod_extend S T (fun i => f i (x i))).symm + · rw [Set.indicator_of_notMem hx] + symm + simp only [Set.mem_pi, Finset.mem_coe, not_forall] at hx + obtain ⟨i, hi, hxi⟩ := hx + apply Finset.prod_eq_zero (Finset.mem_union_right S hi) + rw [ite_eq_left hi, Set.indicator_of_notMem hxi] + +theorem setIntegral_cylinder_prod_eq + (S T : Finset ι) (A : ∀ i, X i → Y i) + (hA : ∀ i, Measurable (A i)) + (f g : ∀ i, X i → ℝ) (hf : ∀ i, Measurable (f i)) + (hg : ∀ i, Measurable (g i)) + (hloc : ∀ i (B : Set (Y i)), MeasurableSet B → + ∫ x in A i ⁻¹' B, g i x ∂μ i = ∫ x in A i ⁻¹' B, f i x ∂μ i) + (B : ∀ i, Set (Y i)) (hB : ∀ i, MeasurableSet (B i)) : + ∫ x in (fun x i => A i (x i)) ⁻¹' (T : Set ι).pi B, + ∏ i ∈ S, g i (x i) ∂Measure.infinitePi μ = + ∫ x in (fun x i => A i (x i)) ⁻¹' (T : Set ι).pi B, + ∏ i ∈ S, f i (x i) ∂Measure.infinitePi μ := by + classical + have hp : (fun x i => A i (x i)) ⁻¹' (T : Set ι).pi B = + (T : Set ι).pi (fun i => A i ⁻¹' B i) := rfl + have hm : MeasurableSet ((T : Set ι).pi (fun i => A i ⁻¹' B i)) := + MeasurableSet.pi T.countable_toSet (fun i _ => hA i (hB i)) + rw [hp, ← integral_indicator hm, ← integral_indicator hm] + simp_rw [cylinder_indicator_prod] + let factors (F : ∀ i, X i → ℝ) : ∀ i, X i → ℝ := fun i z => + if i ∈ T then (A i ⁻¹' B i).indicator + (fun z => if i ∈ S then F i z else 1) z + else if i ∈ S then F i z else 1 + change (∫ x, ∏ i ∈ S ∪ T, factors g i (x i) ∂Measure.infinitePi μ) = + (∫ x, ∏ i ∈ S ∪ T, factors f i (x i) ∂Measure.infinitePi μ) + rw [integral_finset_prod μ (S ∪ T) (factors g), + integral_finset_prod μ (S ∪ T) (factors f)] + · apply Finset.prod_congr rfl + intro i hi + dsimp only [factors] + by_cases hit : i ∈ T <;> by_cases his : i ∈ S + · simp only [ite_eq_left hit, ite_eq_left his] + rw [integral_indicator (hA i (hB i)), integral_indicator (hA i (hB i))] + exact hloc i (B i) (hB i) + · simp only [ite_eq_left hit, ite_eq_right his] + · simp only [ite_eq_right hit, ite_eq_left his] + simpa using hloc i Set.univ MeasurableSet.univ + · simp only [ite_eq_right hit, ite_eq_right his] + all_goals + intro i + have hset : MeasurableSet (A i ⁻¹' B i) := hA i (hB i) + dsimp only [factors] + split_ifs <;> fun_prop + +theorem setIntegral_observed_prod_eq + (S : Finset ι) (A : ∀ i, X i → Y i) + (hA : ∀ i, Measurable (A i)) + (f g : ∀ i, X i → ℝ) (hf : ∀ i, Measurable (f i)) + (hg : ∀ i, Measurable (g i)) + (hfb : ∀ i x, ‖f i x‖ ≤ 1) (hgb : ∀ i x, ‖g i x‖ ≤ 1) + (hloc : ∀ i (B : Set (Y i)), MeasurableSet B → + ∫ x in A i ⁻¹' B, g i x ∂μ i = ∫ x in A i ⁻¹' B, f i x ∂μ i) + (B : Set (∀ i, Y i)) (hB : MeasurableSet B) : + ∫ x in (fun x i => A i (x i)) ⁻¹' B, + ∏ i ∈ S, g i (x i) ∂Measure.infinitePi μ = + ∫ x in (fun x i => A i (x i)) ⁻¹' B, + ∏ i ∈ S, f i (x i) ∂Measure.infinitePi μ := by + classical + let obs : (∀ i, X i) → (∀ i, Y i) := fun x i => A i (x i) + have hm : Measurable obs := Measurable.of_eval + (fun i => (hA i).comp (measurable_pi_apply i)) + have hfi := integrable_finset_prod μ S f hf hfb + have hgi := integrable_finset_prod μ S g hg hgb + have htotal : (∫ x, ∏ i ∈ S, g i (x i) ∂Measure.infinitePi μ) = + (∫ x, ∏ i ∈ S, f i (x i) ∂Measure.infinitePi μ) := by + rw [integral_finset_prod μ S g hg, integral_finset_prod μ S f hf] + apply Finset.prod_congr rfl + intro i hi + simpa using hloc i Set.univ MeasurableSet.univ + refine MeasurableSpace.induction_on_inter + (C := fun D _ => + (∫ x in obs ⁻¹' D, ∏ i ∈ S, g i (x i) ∂Measure.infinitePi μ) = + (∫ x in obs ⁻¹' D, ∏ i ∈ S, f i (x i) ∂Measure.infinitePi μ)) + generateFrom_squareCylinders.symm + (isPiSystem_squareCylinders (fun _ => MeasurableSpace.isPiSystem_measurableSet) + (fun _ => MeasurableSet.univ)) ?_ ?_ ?_ ?_ B hB + · simp + · rintro C ⟨T, D, hD, rfl⟩ + exact setIntegral_cylinder_prod_eq μ S T A hA f g hf hg hloc D + (fun i => hD i (Set.mem_univ i)) + · intro C hC ih + have heqg := integral_add_compl (hm hC) hgi + have heqf := integral_add_compl (hm hC) hfi + change (∫ x in obs ⁻¹' C, ∏ i ∈ S, g i (x i) ∂Measure.infinitePi μ) = + (∫ x in obs ⁻¹' C, ∏ i ∈ S, f i (x i) ∂Measure.infinitePi μ) at ih + rw [Set.preimage_compl] + linarith + · intro C hdisj hC ih + rw [Set.preimage_iUnion, + integral_iUnion (fun n => hm (hC n)) + (fun i j hij => (hdisj hij).preimage obs) hgi.integrableOn, + integral_iUnion (fun n => hm (hC n)) + (fun i j hij => (hdisj hij).preimage obs) hfi.integrableOn] + exact tsum_congr ih + +theorem condExp_finset_prod + (S : Finset ι) (A : ∀ i, X i → Y i) + (hA : ∀ i, Measurable (A i)) + (f : ∀ i, X i → ℝ) (p : ∀ i, Y i → ℝ) + (hf : ∀ i, Measurable (f i)) (hp : ∀ i, Measurable (p i)) + (hfb : ∀ i x, ‖f i x‖ ≤ 1) (hpb : ∀ i y, ‖p i y‖ ≤ 1) + (hloc : ∀ i (B : Set (Y i)), MeasurableSet B → + ∫ x in A i ⁻¹' B, p i (A i x) ∂μ i = ∫ x in A i ⁻¹' B, f i x ∂μ i) : + (Measure.infinitePi μ)[(fun x => ∏ i ∈ S, f i (x i)) | + MeasurableSpace.comap (fun x i => A i (x i)) inferInstance] =ᵐ[Measure.infinitePi μ] + (fun x => ∏ i ∈ S, p i (A i (x i))) := by + classical + let obs : (∀ i, X i) → (∀ i, Y i) := fun x i => A i (x i) + have hm : Measurable obs := Measurable.of_eval + (fun i => (hA i).comp (measurable_pi_apply i)) + have hpA : ∀ i, Measurable (fun x => p i (A i x)) := fun i => (hp i).comp (hA i) + have hpAb : ∀ i x, ‖p i (A i x)‖ ≤ 1 := fun i x => hpb i (A i x) + symm + apply ae_eq_condExp_of_forall_setIntegral_eq hm.comap_le + (integrable_finset_prod μ S f hf hfb) + · intro B hB hfin + exact (integrable_finset_prod μ S _ hpA hpAb).integrableOn + · intro B hB hfin + obtain ⟨C, hC, rfl⟩ := MeasurableSpace.measurableSet_comap.mp hB + exact setIntegral_observed_prod_eq μ S A hA f _ hf hpA hfb hpAb hloc C hC + · have hobs : @Measurable _ _ (MeasurableSpace.comap obs inferInstance) _ obs := + Measurable.of_comap_le le_rfl + exact ((Finset.measurable_prod S (fun i _ => + (hp i).comp (measurable_pi_apply i))).comp hobs).aestronglyMeasurable + +section Labels + +variable {L : ι → Type*} [∀ i, MeasurableSpace (L i)] + [∀ i, StandardBorelSpace (L i)] [∀ i, Nonempty (L i)] + +theorem condExp_label_product + (S : Finset ι) (A : ∀ i, X i → Y i) (hA : ∀ i, Measurable (A i)) + (label : ∀ i, X i → L i) (hl : ∀ i, Measurable (label i)) + (C : ∀ i, Set (L i)) (hC : ∀ i, MeasurableSet (C i)) : + (Measure.infinitePi μ)[(fun x => ∏ i ∈ S, + (label i ⁻¹' C i).indicator (fun _ => (1 : ℝ)) (x i)) | + MeasurableSpace.comap (fun x i => A i (x i)) inferInstance] =ᵐ[Measure.infinitePi μ] + (fun x => ∏ i ∈ S, (condDistrib (label i) (A i) (μ i) (A i (x i))).real (C i)) := by + apply condExp_finset_prod μ S A hA + (fun i => (label i ⁻¹' C i).indicator (fun _ => (1 : ℝ))) + (fun i y => (condDistrib (label i) (A i) (μ i) y).real (C i)) + · intro i + exact measurable_const.indicator (hl i (hC i)) + · intro i + exact (Kernel.measurable_coe _ (hC i)).ennreal_toReal + · intro i x + by_cases hx : label i x ∈ C i <;> simp [Set.indicator, hx] + · intro i y + rw [Real.norm_eq_abs, abs_of_nonneg measureReal_nonneg] + exact measureReal_le_one + · intro i B hB + have he := condDistrib_ae_eq_condExp (μ := μ i) (hA i) (hl i) (hC i) + calc + (∫ x in A i ⁻¹' B, (condDistrib (label i) (A i) (μ i) (A i x)).real (C i) ∂μ i) = + ∫ x in A i ⁻¹' B, + (μ i)[(label i ⁻¹' C i).indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap (A i) inferInstance] x ∂μ i := + integral_congr_ae (ae_restrict_of_ae he) + _ = _ := setIntegral_condExp (hA i).comap_le + ((integrable_const (1 : ℝ)).indicator (hl i (hC i))) ⟨B, hB, rfl⟩ + +theorem condExp_label_inter + (S : Finset ι) (A : ∀ i, X i → Y i) (hA : ∀ i, Measurable (A i)) + (label : ∀ i, X i → L i) (hl : ∀ i, Measurable (label i)) + (C : ∀ i, Set (L i)) (hC : ∀ i, MeasurableSet (C i)) : + (Measure.infinitePi μ)⟦(⋂ i ∈ S, (fun x : ∀ i, X i => label i (x i)) ⁻¹' C i) | + MeasurableSpace.comap (fun x i => A i (x i)) inferInstance⟧ =ᵐ[Measure.infinitePi μ] + (fun x => ∏ i ∈ S, (condDistrib (label i) (A i) (μ i) (A i (x i))).real (C i)) := by + have hind : + (⋂ i ∈ S, (fun x : ∀ i, X i => label i (x i)) ⁻¹' C i).indicator + (fun _ => (1 : ℝ)) = + (fun x => ∏ i ∈ S, (label i ⁻¹' C i).indicator (fun _ => (1 : ℝ)) (x i)) := by + funext x + simpa [Set.indicator, Finset.prod_apply] using + (prod_indicator_apply S + (fun i => (fun x : ∀ i, X i => label i (x i)) ⁻¹' C i) + (fun _ _ => (1 : ℝ)) x).symm + change MeasureTheory.condExp _ (Measure.infinitePi μ) _ =ᵐ[Measure.infinitePi μ] _ + rw [hind] + exact condExp_label_product μ S A hA label hl C hC + +theorem iCondIndepFun_labels [Countable ι] [∀ i, StandardBorelSpace (X i)] + (A : ∀ i, X i → Y i) (hA : ∀ i, Measurable (A i)) + (label : ∀ i, X i → L i) (hl : ∀ i, Measurable (label i)) : + iCondIndepFun + (MeasurableSpace.comap (fun x i => A i (x i)) inferInstance) + (Measurable.of_eval (fun i => (hA i).comp (measurable_pi_apply i))).comap_le + (fun i x => label i (x i)) (Measure.infinitePi μ) := by + classical + apply (iCondIndepFun_iff_condExp_inter_preimage_eq_mul + (μ := Measure.infinitePi μ) + (m' := MeasurableSpace.comap (fun x i => A i (x i)) inferInstance) + (fun i => inferInstance) (fun i (x : ∀ i, X i) => label i (x i)) + (fun i => (hl i).comp (measurable_pi_apply i))).2 + intro S C hC + let D : ∀ i, Set (L i) := fun i => if i ∈ S then C i else Set.univ + have hD : ∀ i, MeasurableSet (D i) := by + intro i + by_cases hi : i ∈ S + · simpa [D, hi] using hC i hi + · simp [D, hi] + have hDC : ∀ i ∈ S, D i = C i := fun i hi => ite_eq_left hi + have hsets : (⋂ i ∈ S, (fun x : ∀ i, X i => label i (x i)) ⁻¹' C i) = + (⋂ i ∈ S, (fun x : ∀ i, X i => label i (x i)) ⁻¹' D i) := by + apply Set.iInter₂_congr + intro i hi + rw [hDC i hi] + rw [hsets] + have hjoint := condExp_label_inter μ S A hA label hl D hD + have hsingle : ∀ i ∈ S, + (Measure.infinitePi μ)⟦(fun x : ∀ i, X i => label i (x i)) ⁻¹' C i | + MeasurableSpace.comap (fun x i => A i (x i)) inferInstance⟧ =ᵐ[Measure.infinitePi μ] + (fun x => (condDistrib (label i) (A i) (μ i) (A i (x i))).real (D i)) := by + intro i hi + simpa [hDC i hi] using condExp_label_inter μ {i} A hA label hl D hD + have hall := (ae_ball_iff S.countable_toSet).2 hsingle + filter_upwards [hjoint, hall] with x hx hallx + rw [Finset.prod_apply, hx] + exact Finset.prod_congr rfl (fun i hi => (hallx i hi).symm) + +theorem condExp_label_inter_of_disintegration + (S : Finset ι) (A : ∀ i, X i → Y i) (hA : ∀ i, Measurable (A i)) + (label : ∀ i, X i → L i) (hl : ∀ i, Measurable (label i)) + (κ : ∀ i, Kernel (Y i) (L i)) [∀ i, IsFiniteKernel (κ i)] + (hκ : ∀ i, (μ i).map (fun x => (A i x, label i x)) = (μ i).map (A i) ⊗ₘ κ i) + (C : ∀ i, Set (L i)) (hC : ∀ i, MeasurableSet (C i)) : + (Measure.infinitePi μ)⟦(⋂ i ∈ S, (fun x : ∀ i, X i => label i (x i)) ⁻¹' C i) | + MeasurableSpace.comap (fun x i => A i (x i)) inferInstance⟧ =ᵐ[Measure.infinitePi μ] + (fun x => ∏ i ∈ S, (κ i (A i (x i))).real (C i)) := by + refine (condExp_label_inter μ S A hA label hl C hC).trans ?_ + have hlocal (i : ι) : ∀ᵐ x ∂μ i, + condDistrib (label i) (A i) (μ i) (A i x) = κ i (A i x) := + ae_of_ae_map (hA i).aemeasurable + (condDistrib_ae_eq_of_measure_eq_compProd_of_measurable (hA i) (hl i) (hκ i)) + have hglobal (i : ι) : ∀ᵐ x ∂Measure.infinitePi μ, + condDistrib (label i) (A i) (μ i) (A i (x i)) = κ i (A i (x i)) := + (measurePreserving_eval_infinitePi μ i).quasiMeasurePreserving.ae (hlocal i) + filter_upwards [(ae_ball_iff S.countable_toSet).2 (fun i _ => hglobal i)] with x hx + exact Finset.prod_congr rfl (fun i hi => congrArg (fun ν => ν.real (C i)) (hx i hi)) + +end Labels + +end Invariant233.CoordinateConditioning + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/IndependentKernelProduct.lean b/lean/OAI/Analysis/IrrationalRotation/Product/IndependentKernelProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ca0cb9082068aaacbe7671b5947833d4ad68b5b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/IndependentKernelProduct.lean @@ -0,0 +1,148 @@ +import OAI.Analysis.IrrationalRotation.Model.IndependentKernelProduct +import Mathlib.Probability.Independence.Integration +import Mathlib.Probability.Kernel.CondDistrib +import Mathlib.Probability.Independence.Conditional + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped BigOperators ENNReal + +namespace Invariant233.KernelProduct + +variable {ι : Type*} {A B : ι → Type*} + [∀ i, MeasurableSpace (A i)] [∀ i, MeasurableSpace (B i)] + +instance independent_isMarkov (κ : ∀ i, Kernel (A i) (B i)) + [∀ i, IsMarkovKernel (κ i)] : IsMarkovKernel (independent κ) := + ⟨fun _ => inferInstanceAs (IsProbabilityMeasure (Measure.infinitePi _))⟩ + +@[simp] theorem independent_apply (κ : ∀ i, Kernel (A i) (B i)) + [∀ i, IsMarkovKernel (κ i)] (x : ∀ i, A i) : + independent κ x = Measure.infinitePi (fun i => κ i (x i)) := rfl + +theorem compProd_map_pairCoordinates (μ : ∀ i, Measure (A i)) + [∀ i, IsProbabilityMeasure (μ i)] (κ : ∀ i, Kernel (A i) (B i)) + [∀ i, IsMarkovKernel (κ i)] : + ((Measure.infinitePi μ) ⊗ₘ independent κ).map pairCoordinates = + Measure.infinitePi (fun i => μ i ⊗ₘ κ i) := by + apply Measure.eq_infinitePi + intro s t ht + have hpair : Measurable (pairCoordinates (A := A) (B := B)) := + pairCoordinates.measurable + have hset : MeasurableSet (Set.pi (s : Set ι) t) := + MeasurableSet.pi s.countable_toSet (fun i _ => ht i) + rw [Measure.map_apply hpair hset, Measure.compProd_apply (hpair hset)] + have hsection (x : ∀ i, A i) : + Prod.mk x ⁻¹' (pairCoordinates ⁻¹' Set.pi (s : Set ι) t) = + Set.pi (s : Set ι) (fun i => Prod.mk (x i) ⁻¹' t i) := by + ext y + rfl + simp_rw [hsection, independent_apply, + Measure.infinitePi_pi _ (fun i _ => measurable_prodMk_left (ht i))] + have hg (i : ι) : Measurable (fun a : A i => κ i a (Prod.mk a ⁻¹' t i)) := + Kernel.measurable_kernel_prodMk_left (ht i) + rw [lintegral_prod_eq_prod_lintegral_of_indepFun (μ := Measure.infinitePi μ) s + (fun i (x : ∀ i, A i) => κ i (x i) (Prod.mk (x i) ⁻¹' t i)) + (iIndepFun_infinitePi hg) (fun i => (hg i).comp (measurable_pi_apply i))] + apply Finset.prod_congr rfl + intro i _ + rw [Measure.compProd_apply (ht i)] + exact (measurePreserving_eval_infinitePi μ i).lintegral_comp (hg i) + +theorem independent_coordinates (κ : ∀ i, Kernel (A i) (B i)) + [∀ i, IsMarkovKernel (κ i)] (x : ∀ i, A i) : + iIndepFun (fun i (y : ∀ i, B i) => y i) (independent κ x) := + iIndepFun_infinitePi (fun _ => measurable_id) + +end Invariant233.KernelProduct + +namespace Invariant233.KernelProduct +variable {ι : Type*} {X A : ι → Type*} + [∀ i, MeasurableSpace (X i)] [∀ i, MeasurableSpace (A i)] + +theorem coordinate_disintegration (μ : ∀ i, Measure (X i)) + [∀ i, IsProbabilityMeasure (μ i)] (obs : ∀ i, X i → A i) + (hobs : ∀ i, Measurable (obs i)) (κ : ∀ i, Kernel (A i) (X i)) + [∀ i, IsMarkovKernel (κ i)] + (hκ : ∀ i, (μ i).map (obs i) ⊗ₘ κ i = + (μ i).map (fun z => (obs i z, z))) : + ((Measure.infinitePi μ).map (fun z i => obs i (z i))) ⊗ₘ independent κ = + (Measure.infinitePi μ).map (fun z => (fun i => obs i (z i), z)) := by + let (index : ι) : IsProbabilityMeasure ((μ index).map (obs index)) := inferInstance + apply (pairCoordinates (A := A) (B := X)).map_measurableEquiv_injective + rw [Measure.infinitePi_map_pi μ hobs, compProd_map_pairCoordinates] + rw [Measure.map_map pairCoordinates.measurable (by fun_prop)] + change Measure.infinitePi (fun i => (μ i).map (obs i) ⊗ₘ κ i) = + (Measure.infinitePi μ).map (fun z i => (obs i (z i), z i)) + rw [Measure.infinitePi_map_pi μ (f := fun i z => (obs i z, z)) + (fun i => (hobs i).prodMk measurable_id)] + congr 1 + funext i + exact hκ i + +variable [Countable ι] [∀ i, StandardBorelSpace (X i)] [∀ i, Nonempty (X i)] + +theorem condDistrib_coordinates (μ : ∀ i, Measure (X i)) + [∀ i, IsProbabilityMeasure (μ i)] (obs : ∀ i, X i → A i) + (hobs : ∀ i, Measurable (obs i)) : + condDistrib id (fun z i => obs i (z i)) (Measure.infinitePi μ) + =ᵐ[(Measure.infinitePi μ).map (fun z i => obs i (z i))] + independent (fun i => condDistrib id (obs i) (μ i)) := by + apply condDistrib_ae_eq_of_measure_eq_compProd_of_measurable + (by fun_prop) measurable_id + exact (coordinate_disintegration μ obs hobs + (fun i => condDistrib id (obs i) (μ i)) + (fun index => compProd_map_condDistrib (hobs index).aemeasurable + measurable_id.aemeasurable)).symm + +end Invariant233.KernelProduct + +namespace Invariant233.KernelProduct +variable {ι : Type*} {X A B : ι → Type*} + [∀ i, MeasurableSpace (X i)] [∀ i, MeasurableSpace (A i)] + [∀ i, MeasurableSpace (B i)] + +theorem coordinate_pair_disintegration (μ : ∀ i, Measure (X i)) + [∀ i, IsProbabilityMeasure (μ i)] (obs : ∀ i, X i → A i) + (val : ∀ i, X i → B i) (hobs : ∀ i, Measurable (obs i)) + (hval : ∀ i, Measurable (val i)) (κ : ∀ i, Kernel (A i) (B i)) + [∀ i, IsMarkovKernel (κ i)] + (hκ : ∀ i, (μ i).map (obs i) ⊗ₘ κ i = + (μ i).map (fun z => (obs i z, val i z))) : + ((Measure.infinitePi μ).map (fun z i => obs i (z i))) ⊗ₘ independent κ = + (Measure.infinitePi μ).map + (fun z => (fun i => obs i (z i), fun i => val i (z i))) := by + let (index : ι) : IsProbabilityMeasure ((μ index).map (obs index)) := inferInstance + apply (pairCoordinates (A := A) (B := B)).map_measurableEquiv_injective + rw [Measure.infinitePi_map_pi μ hobs, compProd_map_pairCoordinates] + rw [Measure.map_map pairCoordinates.measurable (by fun_prop)] + change Measure.infinitePi (fun i => (μ i).map (obs i) ⊗ₘ κ i) = + (Measure.infinitePi μ).map (fun z i => (obs i (z i), val i (z i))) + rw [Measure.infinitePi_map_pi μ (f := fun i z => (obs i z, val i z)) + (fun i => (hobs i).prodMk (hval i))] + congr 1 + funext i + exact hκ i + +variable [Countable ι] [∀ i, StandardBorelSpace (B i)] [∀ i, Nonempty (B i)] + +theorem condDistrib_of_coordinate_disintegration (μ : ∀ i, Measure (X i)) + [∀ i, IsProbabilityMeasure (μ i)] (obs : ∀ i, X i → A i) + (val : ∀ i, X i → B i) (hobs : ∀ i, Measurable (obs i)) + (hval : ∀ i, Measurable (val i)) (κ : ∀ i, Kernel (A i) (B i)) + [∀ i, IsMarkovKernel (κ i)] + (hκ : ∀ i, (μ i).map (obs i) ⊗ₘ κ i = + (μ i).map (fun z => (obs i z, val i z))) : + condDistrib (fun z i => val i (z i)) (fun z i => obs i (z i)) + (Measure.infinitePi μ) + =ᵐ[(Measure.infinitePi μ).map (fun z i => obs i (z i))] independent κ := by + apply condDistrib_ae_eq_of_measure_eq_compProd_of_measurable (by fun_prop) (by fun_prop) + exact (coordinate_pair_disintegration μ obs val hobs hval κ hκ).symm + +end Invariant233.KernelProduct + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/IndependentMissBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Product/IndependentMissBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..08a765e8759395d3c2c6208391d7dc9c73fb3bb8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/IndependentMissBounds.lean @@ -0,0 +1,118 @@ +import Mathlib + +namespace OAI + +namespace Invariant233 + +open MeasureTheory ProbabilityTheory +open scoped ENNReal + +theorem measure_many_independent_events_le + {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (E : ι → Set Ω) (hE : iIndepSet E μ) (s : Finset ι) + {p : ℝ≥0∞} (hp : p ≤ 1) (hprob : ∀ i ∈ s, μ (E i) ≤ p) (q : ℝ) : + μ {ω | ∃ t : Finset ι, t ⊆ s ∧ q ≤ (t.card : ℝ) ∧ ∀ i ∈ t, ω ∈ E i} ≤ + (2 : ℝ≥0∞) ^ s.card * p ^ q := by + classical + let F := s.powerset.filter (fun t => q ≤ (t.card : ℝ)) + have hset : {ω | ∃ t : Finset ι, t ⊆ s ∧ q ≤ (t.card : ℝ) ∧ + ∀ i ∈ t, ω ∈ E i} = ⋃ t ∈ F, ⋂ i ∈ t, E i := by + ext ω + simp only [Set.mem_ofPred_eq, Set.mem_iUnion, Set.mem_iInter, F, + Finset.mem_filter, Finset.mem_powerset] + aesop + have hFcard : F.card ≤ 2 ^ s.card := by + calc + F.card ≤ s.powerset.card := Finset.card_le_card (Finset.filter_subset _ _) + _ = 2 ^ s.card := Finset.card_powerset s + rw [hset] + calc + μ (⋃ t ∈ F, ⋂ i ∈ t, E i) ≤ ∑ t ∈ F, μ (⋂ i ∈ t, E i) := + measure_biUnion_finset_le F _ + _ ≤ ∑ t ∈ F, p ^ q := by + apply Finset.sum_le_sum + intro t ht + have ht' : t ⊆ s ∧ q ≤ (t.card : ℝ) := by + simpa only [F, Finset.mem_filter, Finset.mem_powerset] using ht + rw [hE.meas_biInter t] + calc + ∏ i ∈ t, μ (E i) ≤ ∏ _i ∈ t, p := + Finset.prod_le_prod (fun i hi => hprob i (ht'.1 hi)) + _ = p ^ t.card := by simp + _ = p ^ (t.card : ℝ) := (ENNReal.rpow_natCast p t.card).symm + _ ≤ p ^ q := ENNReal.rpow_le_rpow_of_exponent_ge hp ht'.2 + _ = (F.card : ℝ≥0∞) * p ^ q := by simp [nsmul_eq_mul] + _ ≤ (2 : ℝ≥0∞) ^ s.card * p ^ q := by + apply mul_le_mul_left + exact_mod_cast hFcard + +theorem measure_exists_many_independent_events_le + {Ω ι κ : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (E : κ → ι → Set Ω) (s : Finset ι) (powers : Finset κ) + (hE : ∀ k ∈ powers, iIndepSet (E k) μ) + {p : ℝ≥0∞} (hp : p ≤ 1) + (hprob : ∀ k ∈ powers, ∀ i ∈ s, μ (E k i) ≤ p) (q : ℝ) : + μ {ω | ∃ k ∈ powers, ∃ t : Finset ι, + t ⊆ s ∧ q ≤ (t.card : ℝ) ∧ ∀ i ∈ t, ω ∈ E k i} ≤ + (powers.card : ℝ≥0∞) * ((2 : ℝ≥0∞) ^ s.card * p ^ q) := by + classical + have hset : {ω | ∃ k ∈ powers, ∃ t : Finset ι, + t ⊆ s ∧ q ≤ (t.card : ℝ) ∧ ∀ i ∈ t, ω ∈ E k i} = + ⋃ k ∈ powers, {ω | ∃ t : Finset ι, + t ⊆ s ∧ q ≤ (t.card : ℝ) ∧ ∀ i ∈ t, ω ∈ E k i} := by + ext ω + simp + rw [hset] + calc + _ ≤ ∑ k ∈ powers, μ {ω | ∃ t : Finset ι, + t ⊆ s ∧ q ≤ (t.card : ℝ) ∧ ∀ i ∈ t, ω ∈ E k i} := + measure_biUnion_finset_le powers _ + _ ≤ ∑ _k ∈ powers, (2 : ℝ≥0∞) ^ s.card * p ^ q := by + apply Finset.sum_le_sum + intro k hk + exact measure_many_independent_events_le μ (E k) (hE k hk) s hp + (hprob k hk) q + _ = _ := by simp [nsmul_eq_mul] + +theorem exists_many_misses_of_few_successes {ι : Type*} (s : Finset ι) + (good : ι → Prop) [DecidablePred good] + (hgood : ((s.filter good).card : ℝ) < (s.card : ℝ) / 20) : + ∃ t : Finset ι, t ⊆ s ∧ (19 / 20 : ℝ) * s.card < (t.card : ℝ) ∧ + ∀ i ∈ t, ¬ good i := by + classical + refine ⟨s.filter (fun i => ¬ good i), Finset.filter_subset _ _, ?_, ?_⟩ + · have hcard := Finset.card_filter_add_card_filter_not (s := s) good + have hcardR : ((s.filter good).card : ℝ) + + ((s.filter (fun i => ¬ good i)).card : ℝ) = s.card := by + exact_mod_cast hcard + linarith + · intro i hi + exact (Finset.mem_filter.mp hi).2 + +theorem measure_exists_few_successes_le + {Ω ι κ : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (good : κ → ι → Ω → Prop) [∀ k i ω, Decidable (good k i ω)] + (s : Finset ι) (powers : Finset κ) + (hE : ∀ k ∈ powers, iIndepSet (fun i => {ω | ¬ good k i ω}) μ) + {p : ℝ≥0∞} (hp : p ≤ 1) + (hprob : ∀ k ∈ powers, ∀ i ∈ s, μ {ω | ¬ good k i ω} ≤ p) : + μ {ω | ∃ k ∈ powers, + ((s.filter (fun i => good k i ω)).card : ℝ) < (s.card : ℝ) / 20} ≤ + (powers.card : ℝ≥0∞) * + ((2 : ℝ≥0∞) ^ s.card * p ^ ((19 / 20 : ℝ) * s.card)) := by + calc + _ ≤ μ {ω | ∃ k ∈ powers, ∃ t : Finset ι, + t ⊆ s ∧ (19 / 20 : ℝ) * s.card ≤ (t.card : ℝ) ∧ + ∀ i ∈ t, ω ∈ {ω | ¬ good k i ω}} := by + apply measure_mono + intro ω hω + obtain ⟨k, hk, hgood⟩ := hω + obtain ⟨t, hts, htcard, htbad⟩ := + exists_many_misses_of_few_successes s (fun i => good k i ω) hgood + exact ⟨k, hk, t, hts, htcard.le, htbad⟩ + _ ≤ _ := measure_exists_many_independent_events_le μ + (fun k i => {ω | ¬ good k i ω}) s powers hE hp hprob _ + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/IndependentRotation.lean b/lean/OAI/Analysis/IrrationalRotation/Product/IndependentRotation.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8aa2e07722188a4cd4844475d8db4d86ddef738 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/IndependentRotation.lean @@ -0,0 +1,92 @@ +import Mathlib.Data.Finsupp.Option +import Mathlib.LinearAlgebra.LinearIndependent.Defs +import Mathlib.NumberTheory.Real.Irrational +import Mathlib.Dynamics.Ergodic.AddCircleAdd +import Mathlib.Analysis.SpecialFunctions.Complex.Circle +import Mathlib.Tactic + +namespace OAI + +open scoped BigOperators +open MeasureTheory + +namespace Invariant233.IndependentRotation + +theorem irrational_finsupp_rat_sum {ι : Type*} {θ : ι → ℝ} + (hθ : LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ)) + (c : ι →₀ ℚ) (hc : c ≠ 0) : + Irrational (c.sum (fun i q => (q : ℝ) * θ i)) := by + rintro ⟨r, hr⟩ + let l : Option ι →₀ ℚ := c.optionElim (-r) + have hl : Finsupp.linearCombination ℚ (fun o : Option ι => o.elim 1 θ) l = 0 := by + rw [Finsupp.linearCombination_apply, Finsupp.sum_option_index_smul] + simp only [l, Finsupp.optionElim_apply_eq_elim, Option.elim_none, + Finsupp.some_optionElim, Option.elim_some, Rat.smul_def, Rat.cast_neg, mul_one] + linarith + exact (Finsupp.optionElim_ne_zero_of_right (-r) c hc) + ((linearIndependent_iff.mp hθ) l hl) + +theorem irrational_coordinate {ι : Type*} {θ : ι → ℝ} + (hθ : LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ)) (i : ι) : + Irrational (θ i) := by + simpa using irrational_finsupp_rat_sum hθ (Finsupp.single i 1) (by simp) + +theorem irrational_finsupp_int_sum {ι : Type*} {θ : ι → ℝ} + (hθ : LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ)) + (v : ι →₀ ℤ) (hv : v ≠ 0) : + Irrational (v.sum (fun i n => (n : ℝ) * θ i)) := by + let c : ι →₀ ℚ := v.mapRange (fun n : ℤ => (n : ℚ)) (by simp) + have hc : c ≠ 0 := by + intro h + apply hv + ext i + have hi := DFunLike.congr_fun h i + dsimp [c] at hi + exact_mod_cast hi + have h := irrational_finsupp_rat_sum hθ c hc + simpa [c, Finsupp.sum_mapRange_index] using h + +theorem int_mul_character_ne_integer {ι : Type*} {θ : ι → ℝ} + (hθ : LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ)) + (v : ι →₀ ℤ) (hv : v ≠ 0) (q : ℤ) (hq : q ≠ 0) (n : ℤ) : + (q : ℝ) * v.sum (fun i k => (k : ℝ) * θ i) ≠ (n : ℝ) := + ((irrational_finsupp_int_sum hθ v hv).intCast_mul hq).ne_int n + +theorem zsmul_ne_zero_of_irrational {α : ℝ} (hα : Irrational α) + {n : ℤ} (hn : n ≠ 0) : n • (α : AddCircle (1 : ℝ)) ≠ 0 := by + intro h + rw [← AddCircle.coe_zsmul, AddCircle.coe_eq_zero_iff] at h + obtain ⟨k, hk⟩ := h + have heq : (n : ℝ) * α = (k : ℝ) := by simpa [zsmul_eq_mul] using hk.symm + exact (hα.intCast_mul hn).ne_int k heq + +theorem product_rotation_free {ι : Type*} [Nonempty ι] {θ : ι → ℝ} + (hθ : LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ)) + (n : ℤ) (hn : n ≠ 0) (x : ι → AddCircle (1 : ℝ)) : + (fun i => x i + n • (θ i : AddCircle (1 : ℝ))) ≠ x := by + intro h + let i : ι := Classical.choice inferInstance + have hi := congrFun h i + have hz : n • (θ i : AddCircle (1 : ℝ)) = 0 := by + apply add_left_cancel (a := x i) + simpa using hi + exact zsmul_ne_zero_of_irrational (irrational_coordinate hθ i) hn hz + +theorem circle_exp_ne_one_of_irrational {α : ℝ} (hα : Irrational α) : + Circle.exp (2 * Real.pi * α) ≠ 1 := by + intro h + obtain ⟨n, hn⟩ := Circle.exp_eq_one.mp h + have heq : α = (n : ℝ) := by + apply mul_left_cancel₀ (mul_ne_zero (by norm_num : (2 : ℝ) ≠ 0) Real.pi_ne_zero) + simpa only [mul_comm (n : ℝ)] using hn + exact hα.ne_int n heq + +theorem character_eigenvalue_ne_one {ι : Type*} {θ : ι → ℝ} + (hθ : LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ)) + (v : ι →₀ ℤ) (hv : v ≠ 0) (q : ℤ) (hq : q ≠ 0) : + Circle.exp (2 * Real.pi * ((q : ℝ) * v.sum (fun i k => (k : ℝ) * θ i))) ≠ 1 := + circle_exp_ne_one_of_irrational ((irrational_finsupp_int_sum hθ v hv).intCast_mul hq) + +end Invariant233.IndependentRotation + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/OneCoordinateCrossing.lean b/lean/OAI/Analysis/IrrationalRotation/Product/OneCoordinateCrossing.lean new file mode 100644 index 0000000000000000000000000000000000000000..53afe02561920c3c872862473e6d0fb517a2a46b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/OneCoordinateCrossing.lean @@ -0,0 +1,268 @@ +import OAI.Analysis.IrrationalRotation.Couplings.OneCoordinateConditional + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal BigOperators +namespace Invariant233.OneCoordinateCoupling +open CouplingMarginalBounds CouplingMixture FiniteKernelMixture + +private lemma ofReal_total {I : Type*} [Fintype I] (q : ℝ) (p u : I → ℝ) + (hq : 0 ≤ q) (hp : ∀ i, 0 ≤ p i) (hu : ∀ i, 0 ≤ u i) : + ENNReal.ofReal q + ∑ i, ENNReal.ofReal (p i) * ENNReal.ofReal (u i) = + ENNReal.ofReal (q + ∑ i, p i * u i) := by + rw [ENNReal.ofReal_add hq (Finset.sum_nonneg (fun i _ => mul_nonneg (hp i) (hu i))), + ENNReal.ofReal_sum_of_nonneg (fun i _ => mul_nonneg (hp i) (hu i))] + congr 1 + apply Finset.sum_congr rfl + intro i _ + exact (ENNReal.ofReal_mul (hp i)).symm + +lemma intervalDensity_ge_one {a b x : ℝ} (ha : 0 ≤ a) (hb : b ≤ 1) + (hab : a < b) (hx : x ∈ Ico a b) : 1 ≤ intervalDensity a b x := by + rw [intervalDensity, uniformDensity, Set.indicator_of_mem hx, + baseLaw_interval_measure ha hb hab.le] + exact (one_le_inv₀ (sub_pos.mpr hab)).mpr (by linarith) + +lemma intervalLaw_Ici_eq_one {a b u : ℝ} (hab : a < b) (hu : u ≤ a) : + intervalLaw a b (Ici u) = 1 := by + let := intervalLaw_isProbabilityMeasure hab + apply (mem_ae_iff_prob_eq_one measurableSet_Ici).mp + filter_upwards [intervalLaw_ae_mem a b] with z hz + exact hu.trans hz.1 + +lemma intervalLaw_Iio_eq_one {a b u : ℝ} (hab : a < b) (hu : b ≤ u) : + intervalLaw a b (Iio u) = 1 := by + let := intervalLaw_isProbabilityMeasure hab + apply (mem_ae_iff_prob_eq_one measurableSet_Iio).mp + filter_upwards [intervalLaw_ae_mem a b] with z hz + exact hz.2.trans_le hu + +section SourceParameters +variable {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) +include hκ0 hκ hm ha ha' hb hb' ht0 ht + +lemma rightGivenLeft_component_lower (x : ℝ) (s : Set ℝ) (i : Fin 5) + (hd : 1 ≤ leftDensity m a b i x) (hs : rightLaw m a b i s = 1) : + ENNReal.ofReal (componentProbabilities κ m a b t i) / 10 ≤ + rightGivenLeft κ m a b t x s := by + unfold rightGivenLeft + apply diagonalReplacementKernel_event_lower _ _ _ _ _ x s i 10 + · exact ENNReal.one_le_ofReal.mpr hd + · have hq := (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + rw [ofReal_total _ _ _ (by linarith : 0 ≤ diagonalMass κ m a b t) + (componentProbabilities_nonneg hκ0 (by linarith) ht0) + (fun i => by fin_cases i <;> exact intervalDensity_nonneg _ _ _)] + have hle := (leftMarginalDensity_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht x).2.2.le + simpa only [leftMarginalDensity, ENNReal.ofReal_ofNat] using ENNReal.ofReal_le_ofReal hle + · exact hs + +lemma leftGivenRight_component_lower (y : ℝ) (s : Set ℝ) (i : Fin 5) + (hd : 1 ≤ rightDensity m a b i y) (hs : leftLaw m a b i s = 1) : + ENNReal.ofReal (componentProbabilities κ m a b t i) / 10 ≤ + leftGivenRight κ m a b t y s := by + unfold leftGivenRight + apply diagonalReplacementKernel_event_lower _ _ _ _ _ y s i 10 + · exact ENNReal.one_le_ofReal.mpr hd + · have hq := (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + rw [ofReal_total _ _ _ (by linarith : 0 ≤ diagonalMass κ m a b t) + (componentProbabilities_nonneg hκ0 (by linarith) ht0) + (fun i => by fin_cases i <;> exact intervalDensity_nonneg _ _ _)] + have hle := (rightMarginalDensity_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht y).2.2.le + simpa only [rightMarginalDensity, ENNReal.ofReal_ofNat] using ENNReal.ofReal_le_ofReal hle + · exact hs + +theorem rightGivenLeft_crossing_lower {w x u : ℝ} (hw : w = a ∨ w = b) + (hx0 : 0 ≤ x) (hxu : x < u) (hu : u ≤ 1 - w) : + ENNReal.ofReal (rho κ m w) / 10 ≤ rightGivenLeft κ m a b t x (Ici u) := by + have ha0 := width_pos (by linarith : 0 < m) ha + have hb0 := width_pos (by linarith : 0 < m) hb + rcases hw with hw | hw + · subst w + have hd : 1 ≤ leftDensity m a b 0 x := by + change 1 ≤ intervalDensity 0 (1 - a / 2) x + apply intervalDensity_ge_one (by norm_num) (by linarith) (by linarith) + exact ⟨hx0, by linarith⟩ + have hs : rightLaw m a b 0 (Ici u) = 1 := by + change intervalLaw (1 - a / 2) 1 (Ici u) = 1 + exact intervalLaw_Ici_eq_one (by linarith) (by linarith) + exact rightGivenLeft_component_lower hκ0 hκ hm ha ha' hb hb' ht0 ht x (Ici u) 0 hd hs + · subst w + have hd : 1 ≤ leftDensity m a b 2 x := by + change 1 ≤ intervalDensity 0 (1 - b / 2) x + apply intervalDensity_ge_one (by norm_num) (by linarith) (by linarith) + exact ⟨hx0, by linarith⟩ + have hs : rightLaw m a b 2 (Ici u) = 1 := by + change intervalLaw (1 - b / 2) 1 (Ici u) = 1 + exact intervalLaw_Ici_eq_one (by linarith) (by linarith) + exact rightGivenLeft_component_lower hκ0 hκ hm ha ha' hb hb' ht0 ht x (Ici u) 2 hd hs + +theorem leftGivenRight_crossing_lower {w y u : ℝ} (hw : w = a ∨ w = b) + (hy1 : y < 1) (huy : u ≤ y) (hu : w ≤ u) : + ENNReal.ofReal (rho κ m w) / 10 ≤ leftGivenRight κ m a b t y (Iio u) := by + have ha0 := width_pos (by linarith : 0 < m) ha + have hb0 := width_pos (by linarith : 0 < m) hb + rcases hw with hw | hw + · subst w + have hd : 1 ≤ rightDensity m a b 1 y := by + change 1 ≤ intervalDensity (a / 2) 1 y + apply intervalDensity_ge_one (by linarith) (by norm_num) (by linarith) + exact ⟨by linarith, hy1⟩ + have hs : leftLaw m a b 1 (Iio u) = 1 := by + change intervalLaw 0 (a / 2) (Iio u) = 1 + exact intervalLaw_Iio_eq_one (by linarith) (by linarith) + exact leftGivenRight_component_lower hκ0 hκ hm ha ha' hb hb' ht0 ht y (Iio u) 1 hd hs + · subst w + have hd : 1 ≤ rightDensity m a b 3 y := by + change 1 ≤ intervalDensity (b / 2) 1 y + apply intervalDensity_ge_one (by linarith) (by norm_num) (by linarith) + exact ⟨by linarith, hy1⟩ + have hs : leftLaw m a b 3 (Iio u) = 1 := by + change intervalLaw 0 (b / 2) (Iio u) = 1 + exact intervalLaw_Iio_eq_one (by linarith) (by linarith) + exact leftGivenRight_component_lower hκ0 hκ hm ha ha' hb hb' ht0 ht y (Iio u) 3 hd hs + +end SourceParameters +end Invariant233.OneCoordinateCoupling + +namespace Invariant233.OneCoordinateCoupling +open CouplingMixture CouplingMarginalBounds FiniteKernelMixture + +lemma intervalDensity_ge_one_of_mem {a b x : ℝ} + (ha : 0 ≤ a) (hb : b ≤ 1) (hab : a < b) (hx : x ∈ Ico a b) : + 1 ≤ intervalDensity a b x := by + simp only [intervalDensity, uniformDensity, Set.indicator_of_mem hx, + baseLaw_interval_measure ha hb hab.le] + exact (one_le_inv₀ (sub_pos.mpr hab)).2 (by linarith) + +section SourceParameters +variable {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) +include hκ0 hκ hm ha ha' hb hb' ht0 ht + +theorem rightGivenLeft_event_lower (i : Fin 5) (x : ℝ) (s : Set ℝ) + (hd : 1 ≤ leftDensity m a b i x) (he : rightLaw m a b i s = 1) : + ENNReal.ofReal (componentProbabilities κ m a b t i / 10) ≤ + rightGivenLeft κ m a b t x s := by + have hm0 : 0 < m := by linarith + have hq0 : 0 ≤ diagonalMass κ m a b t := + le_trans (by norm_num) (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + have hp0 := componentProbabilities_nonneg (a := a) (b := b) hκ0 hm0 ht0 + have hd0 : ∀ i x, 0 ≤ leftDensity m a b i x := fun i x => + (leftDensity_bound (by linarith) (width_pos hm0 ha) ha' + (width_pos hm0 hb) hb' i x).1 + rw [ENNReal.ofReal_div_of_pos (by norm_num : (0 : ℝ) < 10)] + norm_num only [ENNReal.ofReal_ofNat] + unfold rightGivenLeft + apply diagonalReplacementKernel_event_lower _ _ _ _ _ _ _ i + · exact ENNReal.one_le_ofReal.mpr hd + · rw [← ofReal_mixture_density _ _ _ hq0 hp0 hd0] + exact (ENNReal.ofReal_le_ofReal + (leftMarginalDensity_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht x).2.2.le).trans_eq + (by norm_num) + · exact he + +theorem leftGivenRight_event_lower (i : Fin 5) (y : ℝ) (s : Set ℝ) + (hd : 1 ≤ rightDensity m a b i y) (he : leftLaw m a b i s = 1) : + ENNReal.ofReal (componentProbabilities κ m a b t i / 10) ≤ + leftGivenRight κ m a b t y s := by + have hm0 : 0 < m := by linarith + have hq0 : 0 ≤ diagonalMass κ m a b t := + le_trans (by norm_num) (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + have hp0 := componentProbabilities_nonneg (a := a) (b := b) hκ0 hm0 ht0 + have hd0 : ∀ i x, 0 ≤ rightDensity m a b i x := fun i x => + (rightDensity_bound (by linarith) (width_pos hm0 ha) ha' + (width_pos hm0 hb) hb' i x).1 + rw [ENNReal.ofReal_div_of_pos (by norm_num : (0 : ℝ) < 10)] + norm_num only [ENNReal.ofReal_ofNat] + unfold leftGivenRight + apply diagonalReplacementKernel_event_lower _ _ _ _ _ _ _ i + · exact ENNReal.one_le_ofReal.mpr hd + · rw [← ofReal_mixture_density _ _ _ hq0 hp0 hd0] + exact (ENNReal.ofReal_le_ofReal + (rightMarginalDensity_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht y).2.2.le).trans_eq + (by norm_num) + · exact he + +theorem rightGivenLeft_crossing {w u x : ℝ} (hw : w = a ∨ w = b) + (hwu : w ≤ u) (huw : u ≤ 1 - w) (hx0 : 0 ≤ x) (hxu : x < u) : + ENNReal.ofReal (rho κ m w / 10) ≤ + rightGivenLeft κ m a b t x (Ici u) := by + have hm0 : 0 < m := by linarith + have ha0 := width_pos hm0 ha + have hb0 := width_pos hm0 hb + rcases hw with hw | hw + · subst w + apply rightGivenLeft_event_lower hκ0 hκ hm ha ha' hb hb' ht0 ht (0 : Fin 5) + · change 1 ≤ intervalDensity 0 (1 - a / 2) x + apply intervalDensity_ge_one_of_mem <;> first | exact ⟨hx0, by linarith⟩ | linarith + · change intervalLaw (1 - a / 2) 1 (Ici u) = 1 + apply intervalLaw_Ici_eq_one <;> linarith + · subst w + apply rightGivenLeft_event_lower hκ0 hκ hm ha ha' hb hb' ht0 ht (2 : Fin 5) + · change 1 ≤ intervalDensity 0 (1 - b / 2) x + apply intervalDensity_ge_one_of_mem <;> first | exact ⟨hx0, by linarith⟩ | linarith + · change intervalLaw (1 - b / 2) 1 (Ici u) = 1 + apply intervalLaw_Ici_eq_one <;> linarith + +theorem leftGivenRight_crossing {w u y : ℝ} (hw : w = a ∨ w = b) + (hwu : w ≤ u) (huw : u ≤ 1 - w) (huy : u ≤ y) (hy1 : y < 1) : + ENNReal.ofReal (rho κ m w / 10) ≤ + leftGivenRight κ m a b t y (Iio u) := by + have hm0 : 0 < m := by linarith + have ha0 := width_pos hm0 ha + have hb0 := width_pos hm0 hb + rcases hw with hw | hw + · subst w + apply leftGivenRight_event_lower hκ0 hκ hm ha ha' hb hb' ht0 ht (1 : Fin 5) + · change 1 ≤ intervalDensity (a / 2) 1 y + apply intervalDensity_ge_one_of_mem <;> first | exact ⟨by linarith, hy1⟩ | linarith + · change intervalLaw 0 (a / 2) (Iio u) = 1 + apply intervalLaw_Iio_eq_one <;> linarith + · subst w + apply leftGivenRight_event_lower hκ0 hκ hm ha ha' hb hb' ht0 ht (3 : Fin 5) + · change 1 ≤ intervalDensity (b / 2) 1 y + apply intervalDensity_ge_one_of_mem <;> first | exact ⟨by linarith, hy1⟩ | linarith + · change intervalLaw 0 (b / 2) (Iio u) = 1 + apply intervalLaw_Iio_eq_one <;> linarith + +theorem pairLaw_fst_ae_mem_unit : + ∀ᵐ x ∂(pairLaw κ m a b t).fst, x ∈ Ico (0 : ℝ) 1 := by + rw [pairLaw_fst_density hκ0 hκ hm ha ha' hb hb' ht0 ht] + exact (withDensity_absolutelyContinuous _ _).ae_le (intervalLaw_ae_mem 0 1) + +theorem pairLaw_snd_ae_mem_unit : + ∀ᵐ y ∂(pairLaw κ m a b t).snd, y ∈ Ico (0 : ℝ) 1 := by + rw [pairLaw_snd_density hκ0 hκ hm ha ha' hb hb' ht0 ht] + exact (withDensity_absolutelyContinuous _ _).ae_le (intervalLaw_ae_mem 0 1) + +theorem rightGivenLeft_ae_all_crossings : + ∀ᵐ x ∂(pairLaw κ m a b t).fst, + ∀ w : ℝ, w = a ∨ w = b → ∀ u : ℝ, w ≤ u → u ≤ 1 - w → x < u → + ENNReal.ofReal (rho κ m w / 10) ≤ rightGivenLeft κ m a b t x (Ici u) := by + filter_upwards [pairLaw_fst_ae_mem_unit hκ0 hκ hm ha ha' hb hb' ht0 ht] with x hx + intro w hw u hwu huw hxu + exact rightGivenLeft_crossing hκ0 hκ hm ha ha' hb hb' ht0 ht hw hwu huw hx.1 hxu + +theorem leftGivenRight_ae_all_crossings : + ∀ᵐ y ∂(pairLaw κ m a b t).snd, + ∀ w : ℝ, w = a ∨ w = b → ∀ u : ℝ, w ≤ u → u ≤ 1 - w → u ≤ y → + ENNReal.ofReal (rho κ m w / 10) ≤ leftGivenRight κ m a b t y (Iio u) := by + filter_upwards [pairLaw_snd_ae_mem_unit hκ0 hκ hm ha ha' hb hb' ht0 ht] with y hy + intro w hw u hwu huw huy + exact leftGivenRight_crossing hκ0 hκ hm ha ha' hb hb' ht0 ht hw hwu huw huy hy.2 + +end SourceParameters +end Invariant233.OneCoordinateCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/OneCoordinateDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Product/OneCoordinateDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed1724c925f33aa9f7e1e5cdb1ebe6dae8711d43 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/OneCoordinateDensity.lean @@ -0,0 +1,344 @@ +import OAI.Analysis.IrrationalRotation.Couplings.OneCoordinateCoupling + +namespace OAI + +open MeasureTheory ProbabilityTheory Set +open scoped BigOperators ENNReal + +namespace Invariant233.OneCoordinateCoupling + +open CouplingMarginalBounds CouplingMixture + +lemma intervalDensity_measurable (a b : ℝ) : Measurable (intervalDensity a b) := + measurable_const.indicator measurableSet_Ico + +lemma intervalDensity_nonneg (a b x : ℝ) : 0 ≤ intervalDensity a b x := by + by_cases hx : x ∈ Ico a b + · simp [intervalDensity, uniformDensity, hx, inv_nonneg.mpr (measureReal_nonneg)] + · simp [intervalDensity, uniformDensity, hx] + +lemma intervalDensity_memLp (a b : ℝ) (p : ℝ≥0∞) : + MemLp (intervalDensity a b) p baseLaw := + uniformDensity_memLp measurableSet_Ico p + +lemma intervalDensity_integral {a b : ℝ} (ha : 0 ≤ a) (hb : b ≤ 1) (hab : a < b) : + (∫ x, intervalDensity a b x ∂baseLaw) = 1 := by + apply uniformDensity_integral measurableSet_Ico + rw [baseLaw_interval_measure ha hb hab.le] + exact sub_pos.mpr hab + +lemma intervalDensity_variance {a b : ℝ} (ha : 0 ≤ a) (hb : b ≤ 1) (hab : a < b) : + (∫ x, (intervalDensity a b x - 1) ^ 2 ∂baseLaw) = (b - a)⁻¹ - 1 := by + have hpos : 0 < baseLaw.real (Ico a b) := by + rw [baseLaw_interval_measure ha hb hab.le] + exact sub_pos.mpr hab + rw [intervalDensity, uniformDensity_variance measurableSet_Ico hpos, + baseLaw_interval_measure ha hb hab.le] + +lemma intervalDensity_le_inv_length {a b : ℝ} + (ha : 0 ≤ a) (hb : b ≤ 1) (hab : a < b) (x : ℝ) : + intervalDensity a b x ≤ (b - a)⁻¹ := by + by_cases hx : x ∈ Ico a b + · simp [intervalDensity, uniformDensity, hx, baseLaw_interval_measure ha hb hab.le] + · simp [intervalDensity, uniformDensity, hx, inv_nonneg.mpr (sub_nonneg.mpr hab.le)] + +lemma intervalDensity_le_width {a b w : ℝ} + (ha : 0 ≤ a) (hb : b ≤ 1) (hw : 0 < w) (hlen : w / 2 ≤ b - a) (x : ℝ) : + intervalDensity a b x ≤ 2 / w := by + have hab : a < b := by linarith + apply (intervalDensity_le_inv_length ha hb hab x).trans + rw [inv_eq_one_div] + apply (div_le_div_iff₀ (sub_pos.mpr hab) hw).2 + linarith + +lemma leftLaw_eq_withDensity {m a b : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) + (i : Fin 5) : + leftLaw m a b i = baseLaw.withDensity (fun x => ENNReal.ofReal (leftDensity m a b i x)) := by + have hm0 : 0 < m := by linarith + have hinv0 : 0 < 1 / m := one_div_pos.mpr hm0 + have hinv1 : 1 / m ≤ 1 / 2 := (div_le_iff₀ hm0).2 (by linarith) + fin_cases i <;> simp only [leftLaw, leftDensity] <;> + apply intervalLaw_eq_base_withDensity <;> linarith + +lemma rightLaw_eq_withDensity {m a b : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) + (i : Fin 5) : + rightLaw m a b i = baseLaw.withDensity (fun x => ENNReal.ofReal (rightDensity m a b i x)) := by + have hm0 : 0 < m := by linarith + have hinv0 : 0 < 1 / m := one_div_pos.mpr hm0 + have hinv1 : 1 / m ≤ 1 / 2 := (div_le_iff₀ hm0).2 (by linarith) + fin_cases i <;> simp only [rightLaw, rightDensity] <;> + apply intervalLaw_eq_base_withDensity <;> linarith + +lemma leftDensity_bound {m a b : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) + (i : Fin 5) (x : ℝ) : + 0 ≤ leftDensity m a b i x ∧ leftDensity m a b i x ≤ componentVarianceBounds m a b i := by + have hm0 : 0 < m := by linarith + have hinv0 : 0 < 1 / m := one_div_pos.mpr hm0 + have hinv1 : 1 / m ≤ 1 / 2 := (div_le_iff₀ hm0).2 (by linarith) + constructor + · fin_cases i <;> exact intervalDensity_nonneg _ _ _ + · fin_cases i <;> simp only [leftDensity, componentVarianceBounds] + · apply intervalDensity_le_width <;> linarith + · apply intervalDensity_le_width <;> linarith + · apply intervalDensity_le_width <;> linarith + · apply intervalDensity_le_width <;> linarith + · simpa using intervalDensity_le_inv_length (a := 0) (b := 1 / m) + (by norm_num) (by linarith) hinv0 x + +lemma rightDensity_bound {m a b : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) + (i : Fin 5) (x : ℝ) : + 0 ≤ rightDensity m a b i x ∧ rightDensity m a b i x ≤ componentVarianceBounds m a b i := by + have hm0 : 0 < m := by linarith + have hinv0 : 0 < 1 / m := one_div_pos.mpr hm0 + have hinv1 : 1 / m ≤ 1 / 2 := (div_le_iff₀ hm0).2 (by linarith) + constructor + · fin_cases i <;> exact intervalDensity_nonneg _ _ _ + · fin_cases i <;> simp only [rightDensity, componentVarianceBounds] + · apply intervalDensity_le_width <;> linarith + · apply intervalDensity_le_width <;> linarith + · apply intervalDensity_le_width <;> linarith + · apply intervalDensity_le_width <;> linarith + · simpa using intervalDensity_le_inv_length (a := 1 - 1 / m) (b := 1) + (by linarith) (by norm_num) (by linarith) x + +lemma pairLaw_fst_density {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) : + (pairLaw κ m a b t).fst = baseLaw.withDensity + (fun x => ENNReal.ofReal (leftMarginalDensity κ m a b t x)) := by + have hm0 : 0 < m := by linarith + have hm2 : 2 ≤ m := by linarith + have ha0 := width_pos hm0 ha + have hb0 := width_pos hm0 hb + have : ∀ i, IsProbabilityMeasure (rightLaw m a b i) := + rightLaw_isProbabilityMeasure hm2 ha0 ha' hb0 hb' + apply mixture_fst_real_density + · exact le_trans (by norm_num) (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + · exact componentProbabilities_nonneg hκ0 hm0 ht0 + · intro i x + exact (leftDensity_bound hm2 ha0 ha' hb0 hb' i x).1 + · intro i + fin_cases i <;> exact intervalDensity_measurable _ _ + · exact leftLaw_eq_withDensity hm2 ha0 ha' hb0 hb' + +lemma pairLaw_snd_density {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) : + (pairLaw κ m a b t).snd = baseLaw.withDensity + (fun x => ENNReal.ofReal (rightMarginalDensity κ m a b t x)) := by + have hm0 : 0 < m := by linarith + have hm2 : 2 ≤ m := by linarith + have ha0 := width_pos hm0 ha + have hb0 := width_pos hm0 hb + have : ∀ i, IsProbabilityMeasure (leftLaw m a b i) := + leftLaw_isProbabilityMeasure hm0 ha0 ha' hb0 hb' + have : ∀ i, IsProbabilityMeasure (rightLaw m a b i) := + rightLaw_isProbabilityMeasure hm2 ha0 ha' hb0 hb' + apply mixture_snd_real_density + · exact le_trans (by norm_num) (diagonalMass_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht).1 + · exact componentProbabilities_nonneg hκ0 hm0 ht0 + · intro i x + exact (rightDensity_bound hm2 ha0 ha' hb0 hb' i x).1 + · intro i + fin_cases i <;> exact intervalDensity_measurable _ _ + · exact rightLaw_eq_withDensity hm2 ha0 ha' hb0 hb' + +lemma leftMarginalDensity_bounds {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) (x : ℝ) : + 49 / 50 ≤ leftMarginalDensity κ m a b t x ∧ + leftMarginalDensity κ m a b t x ≤ 2 + 8 * κ ∧ + leftMarginalDensity κ m a b t x < 10 := by + have hm0 : 0 < m := by linarith + have hd := leftDensity_bound (m := m) (by linarith) (width_pos hm0 ha) ha' + (width_pos hm0 hb) hb' + have h := marginal_density_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht + (hd 0 x) (hd 1 x) (hd 2 x) (hd 3 x) (hd 4 x) + simpa [leftMarginalDensity, componentProbabilities, Fin.sum_univ_succ, leftDensity, add_assoc] using h + +lemma rightMarginalDensity_bounds {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) (x : ℝ) : + 49 / 50 ≤ rightMarginalDensity κ m a b t x ∧ + rightMarginalDensity κ m a b t x ≤ 2 + 8 * κ ∧ + rightMarginalDensity κ m a b t x < 10 := by + have hm0 : 0 < m := by linarith + have hd := rightDensity_bound (m := m) (by linarith) (width_pos hm0 ha) ha' + (width_pos hm0 hb) hb' + have h := marginal_density_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht + (hd 0 x) (hd 1 x) (hd 2 x) (hd 3 x) (hd 4 x) + simpa [rightMarginalDensity, componentProbabilities, Fin.sum_univ_succ, rightDensity, add_assoc] using h + +lemma intervalDensity_variance_le_width {a b w : ℝ} + (ha : 0 ≤ a) (hb : b ≤ 1) (hw : 0 < w) (hlen : w / 2 ≤ b - a) : + (∫ x, (intervalDensity a b x - 1) ^ 2 ∂baseLaw) ≤ 2 / w := by + apply uniformDensity_variance_le measurableSet_Ico hw + rw [baseLaw_interval_measure ha hb (by linarith)] + exact hlen + +lemma leftDensity_variance_bound {m a b : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) + (i : Fin 5) : + (∫ x, (leftDensity m a b i x - 1) ^ 2 ∂baseLaw) ≤ componentVarianceBounds m a b i := by + have hm0 : 0 < m := by linarith + have hinv0 : 0 < 1 / m := one_div_pos.mpr hm0 + have hinv1 : 1 / m ≤ 1 / 2 := (div_le_iff₀ hm0).2 (by linarith) + fin_cases i <;> simp only [leftDensity, componentVarianceBounds] + · apply intervalDensity_variance_le_width <;> linarith + · apply intervalDensity_variance_le_width <;> linarith + · apply intervalDensity_variance_le_width <;> linarith + · apply intervalDensity_variance_le_width <;> linarith + · change (∫ x, (intervalDensity 0 (1 / m) x - 1) ^ 2 ∂baseLaw) ≤ m + rw [intervalDensity_variance (by norm_num) (by linarith) hinv0] + simp + +lemma rightDensity_variance_bound {m a b : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) + (i : Fin 5) : + (∫ x, (rightDensity m a b i x - 1) ^ 2 ∂baseLaw) ≤ componentVarianceBounds m a b i := by + have hm0 : 0 < m := by linarith + have hinv0 : 0 < 1 / m := one_div_pos.mpr hm0 + have hinv1 : 1 / m ≤ 1 / 2 := (div_le_iff₀ hm0).2 (by linarith) + fin_cases i <;> simp only [rightDensity, componentVarianceBounds] + · apply intervalDensity_variance_le_width <;> linarith + · apply intervalDensity_variance_le_width <;> linarith + · apply intervalDensity_variance_le_width <;> linarith + · apply intervalDensity_variance_le_width <;> linarith + · change (∫ x, (intervalDensity (1 - 1 / m) 1 x - 1) ^ 2 ∂baseLaw) ≤ m + rw [intervalDensity_variance (by linarith) (by norm_num) (by linarith)] + simp + +lemma marginalDensity_sub_one (κ m a b t : ℝ) (d : Fin 5 → ℝ) : + diagonalMass κ m a b t + ∑ i, componentProbabilities κ m a b t i * d i - 1 = + ∑ i, componentProbabilities κ m a b t i * (d i - 1) := by + simp only [componentProbabilities, Fin.sum_univ_succ, Matrix.cons_val_zero, + Matrix.cons_val_succ, Fin.sum_univ_zero, add_zero, diagonalMass] + ring + +lemma leftMarginalDensity_energy {κ m a b t : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) : + (∫ x, (leftMarginalDensity κ m a b t x - 1) ^ 2 ∂baseLaw) ≤ + 20 * (2 * κ ^ 2 / m + t / m) := by + have hf : ∀ i, MemLp (fun x => leftDensity m a b i x - 1) 2 baseLaw := by + intro i + fin_cases i <;> exact (intervalDensity_memLp _ _ 2).sub (memLp_const 1) + have h := five_component_energy_bound hf (κ := κ) (by linarith) ha0 hb0 ht0 ht + (leftDensity_variance_bound hm ha0 ha1 hb0 hb1) + simpa only [leftMarginalDensity, marginalDensity_sub_one] using h + +lemma rightMarginalDensity_energy {κ m a b t : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) : + (∫ x, (rightMarginalDensity κ m a b t x - 1) ^ 2 ∂baseLaw) ≤ + 20 * (2 * κ ^ 2 / m + t / m) := by + have hf : ∀ i, MemLp (fun x => rightDensity m a b i x - 1) 2 baseLaw := by + intro i + fin_cases i <;> exact (intervalDensity_memLp _ _ 2).sub (memLp_const 1) + have h := five_component_energy_bound hf (κ := κ) (by linarith) ha0 hb0 ht0 ht + (rightDensity_variance_bound hm ha0 ha1 hb0 hb1) + simpa only [rightMarginalDensity, marginalDensity_sub_one] using h + +lemma leftMarginalDensity_memLp (κ m a b t : ℝ) : + MemLp (leftMarginalDensity κ m a b t) 2 baseLaw := by + apply (memLp_const (diagonalMass κ m a b t)).add + apply memLp_finsetSum Finset.univ + intro i _ + apply MemLp.const_mul + fin_cases i <;> exact intervalDensity_memLp _ _ 2 + +lemma rightMarginalDensity_memLp (κ m a b t : ℝ) : + MemLp (rightMarginalDensity κ m a b t) 2 baseLaw := by + apply (memLp_const (diagonalMass κ m a b t)).add + apply memLp_finsetSum Finset.univ + intro i _ + apply MemLp.const_mul + fin_cases i <;> exact intervalDensity_memLp _ _ 2 + +lemma leftMarginalDensity_integral {κ m a b t : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) : + (∫ x, leftMarginalDensity κ m a b t x ∂baseLaw) = 1 := by + have hm0 : 0 < m := by linarith + have hinv0 : 0 < 1 / m := one_div_pos.mpr hm0 + have hinv1 : 1 / m ≤ 1 / 2 := (div_le_iff₀ hm0).2 (by linarith) + have hi : ∀ i, Integrable (fun x => componentProbabilities κ m a b t i * leftDensity m a b i x) baseLaw := by + intro i + apply Integrable.const_mul + fin_cases i <;> exact (intervalDensity_memLp _ _ 2).integrable (by norm_num) + have hmean : ∀ i, (∫ x, leftDensity m a b i x ∂baseLaw) = 1 := by + intro i + fin_cases i <;> apply intervalDensity_integral <;> linarith + have hs := integrable_finsetSum Finset.univ (fun i _ => hi i) + change (∫ x, diagonalMass κ m a b t + ∑ i, componentProbabilities κ m a b t i * leftDensity m a b i x ∂baseLaw) = 1 + rw [integral_add (integrable_const _) hs, + integral_finsetSum Finset.univ (fun i _ => hi i)] + simp only [integral_const, probReal_univ, one_smul, + integral_const_mul, hmean, mul_one] + simp only [componentProbabilities, Fin.sum_univ_succ, Matrix.cons_val_zero, + Matrix.cons_val_succ, Fin.sum_univ_zero, add_zero, diagonalMass] + ring + +lemma rightMarginalDensity_integral {κ m a b t : ℝ} (hm : 2 ≤ m) + (ha0 : 0 < a) (ha1 : a ≤ 1 / 4) (hb0 : 0 < b) (hb1 : b ≤ 1 / 4) : + (∫ x, rightMarginalDensity κ m a b t x ∂baseLaw) = 1 := by + have hm0 : 0 < m := by linarith + have hinv0 : 0 < 1 / m := one_div_pos.mpr hm0 + have hinv1 : 1 / m ≤ 1 / 2 := (div_le_iff₀ hm0).2 (by linarith) + have hi : ∀ i, Integrable (fun x => componentProbabilities κ m a b t i * rightDensity m a b i x) baseLaw := by + intro i + apply Integrable.const_mul + fin_cases i <;> exact (intervalDensity_memLp _ _ 2).integrable (by norm_num) + have hmean : ∀ i, (∫ x, rightDensity m a b i x ∂baseLaw) = 1 := by + intro i + fin_cases i <;> apply intervalDensity_integral <;> linarith + have hs := integrable_finsetSum Finset.univ (fun i _ => hi i) + change (∫ x, diagonalMass κ m a b t + ∑ i, componentProbabilities κ m a b t i * rightDensity m a b i x ∂baseLaw) = 1 + rw [integral_add (integrable_const _) hs, + integral_finsetSum Finset.univ (fun i _ => hi i)] + simp only [integral_const, probReal_univ, one_smul, + integral_const_mul, hmean, mul_one] + simp only [componentProbabilities, Fin.sum_univ_succ, Matrix.cons_val_zero, + Matrix.cons_val_succ, Fin.sum_univ_zero, add_zero, diagonalMass] + ring + +lemma pairLaw_fst_le_ten {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) : + (pairLaw κ m a b t).fst ≤ (10 : ℝ≥0∞) • baseLaw := by + rw [pairLaw_fst_density hκ0 hκ hm ha ha' hb hb' ht0 ht, ← withDensity_const] + apply withDensity_mono + apply Filter.Eventually.of_forall + intro x + exact (ENNReal.ofReal_le_ofReal + (leftMarginalDensity_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht x).2.2.le).trans_eq (by norm_num) + +lemma pairLaw_snd_le_ten {κ m a b t : ℝ} + (hκ0 : 0 ≤ κ) (hκ : κ ≤ 1 / 100) (hm : 100 ≤ m) + (ha : 1 / m ≤ a) (ha' : a ≤ 1 / 4) + (hb : 1 / m ≤ b) (hb' : b ≤ 1 / 4) + (ht0 : 0 ≤ t) (ht : t ≤ 1) : + (pairLaw κ m a b t).snd ≤ (10 : ℝ≥0∞) • baseLaw := by + rw [pairLaw_snd_density hκ0 hκ hm ha ha' hb hb' ht0 ht, ← withDensity_const] + apply withDensity_mono + apply Filter.Eventually.of_forall + intro x + exact (ENNReal.ofReal_le_ofReal + (rightMarginalDensity_bounds hκ0 hκ hm ha ha' hb hb' ht0 ht x).2.2.le).trans_eq (by norm_num) + +end Invariant233.OneCoordinateCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductAlgebraDimension.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductAlgebraDimension.lean new file mode 100644 index 0000000000000000000000000000000000000000..a42cb14e75a15a266d1fa32923dae6eb6544b8b9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductAlgebraDimension.lean @@ -0,0 +1,84 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductFields +import OAI.Analysis.IrrationalRotation.Product.ProductHilbert +import Mathlib.LinearAlgebra.Dimension.Finite + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal +namespace Invariant233.ProductModel + +theorem shiftOperator_pow (n : ℕ) : + shiftOperator ^ n = + (WeightedShift.shift (n : ℤ)).toLinearIsometry.toContinuousLinearMap.compLpL + 2 baseMeasure := by + induction n with + | zero => simpa using (WeightedShift.fieldShift_zero (μ := baseMeasure)).symm + | succ n ih => + rw [pow_succ, ih] + change _ = (WeightedShift.shift ((n : ℤ) + 1)).toLinearIsometry.toContinuousLinearMap.compLpL + 2 baseMeasure + exact (WeightedShift.fieldShift_add (n : ℤ) 1).symm + +theorem shiftOperator_pow_traceVector (n : ℕ) : + (shiftOperator ^ n) traceVector = + Lp.const 2 baseMeasure (lp.single 2 (n : ℤ) (1 : ℂ)) := by + rw [shiftOperator_pow] + apply Lp.ext + filter_upwards [WeightedShift.fieldShift_ae (n : ℤ) traceVector, + Lp.coeFn_const 2 baseMeasure (lp.single 2 (0 : ℤ) (1 : ℂ) : Fiber), + Lp.coeFn_const 2 baseMeasure (lp.single 2 (n : ℤ) (1 : ℂ) : Fiber)] with x hx h0 hn + change ((WeightedShift.shift (n : ℤ)).toLinearIsometry.toContinuousLinearMap.compLpL + 2 baseMeasure traceVector) x = _ + rw [hx, hn] + change WeightedShift.shift (n : ℤ) ((Lp.const 2 baseMeasure + (lp.single 2 (0 : ℤ) (1 : ℂ))) x) = _ + rw [h0] + ext k + change (lp.single 2 (0 : ℤ) (1 : ℂ) : Fiber) (k - n) = + (lp.single 2 (n : ℤ) (1 : ℂ) : Fiber) k + simp [lp.single_apply, Pi.single_apply, sub_eq_zero] + +theorem linearIndependent_shiftOperator_vacuum : + LinearIndependent ℂ (fun n : ℕ => (shiftOperator ^ n) traceVector) := by + let b := (default : HilbertBasis ℤ ℂ Fiber) + have hb : LinearIndependent ℂ (fun n : ℕ => b (n : ℤ)) := + b.orthonormal.linearIndependent.comp (fun n : ℕ => (n : ℤ)) (by + intro m n h + change (m : ℤ) = (n : ℤ) at h + omega) + have hb' : LinearIndependent ℂ (fun n : ℕ => Lp.const 2 baseMeasure (b (n : ℤ))) := + hb.map' (HilbertModelSize.constL2Isometry (E := Fiber) baseMeasure).toLinearMap + (LinearMap.ker_eq_bot.mpr + (HilbertModelSize.constL2Isometry (E := Fiber) baseMeasure).injective) + have hsingle (n : ℕ) : b (n : ℤ) = (lp.single 2 (n : ℤ) (1 : ℂ) : Fiber) := + (HilbertBasis.repr_symm_single b (n : ℤ)).symm + simpa only [shiftOperator_pow_traceVector, hsingle] using hb' + +theorem linearIndependent_shiftOperator_powers : + LinearIndependent ℂ (fun n : ℕ => shiftOperator ^ n) := by + let ev : (Hilbert →L[ℂ] Hilbert) →ₗ[ℂ] Hilbert := + { toFun := fun T => T traceVector + map_add' := fun _ _ => rfl + map_smul' := fun _ _ => rfl } + exact LinearIndependent.of_comp ev linearIndependent_shiftOperator_vacuum + +theorem factor_not_finiteDimensional (θ : ℕ → ℝ) : + ¬ FiniteDimensional ℂ (factor θ).toStarSubalgebra := by + intro hfinite + let := hfinite + have hS : shiftOperator ∈ factor θ := + subset_vonNeumannGenerated _ (Or.inl (Set.mem_singleton _)) + let v : ℕ → (factor θ).toStarSubalgebra := + fun n => ⟨shiftOperator ^ n, pow_mem hS n⟩ + have hv : LinearIndependent ℂ v := + LinearIndependent.of_comp (factor θ).toStarSubalgebra.toSubalgebra.val.toLinearMap + linearIndependent_shiftOperator_powers + exact (Module.Finite.not_linearIndependent_of_infinite v) hv + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductBaseDynamics.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductBaseDynamics.lean new file mode 100644 index 0000000000000000000000000000000000000000..4efff5f3817a89259c068c32ff55c26514fa3d77 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductBaseDynamics.lean @@ -0,0 +1,43 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductBase +import OAI.Analysis.IrrationalRotation.Product.ProductErgodicity + +namespace OAI + +namespace Invariant233.ProductModel + +open MeasureTheory + +theorem measurePreserving_rotationIterate (θ : ℕ → ℝ) (k : ℤ) : + MeasurePreserving (rotationIterate θ k) baseMeasure baseMeasure := + InvariantProjection.ProductRotation.measurePreserving_product_translation + (fun i => (((k : ℝ) * θ i : ℝ) : UnitAddCircle)) + +theorem measurePreserving_rotation (θ : ℕ → ℝ) : + MeasurePreserving (rotation θ) baseMeasure baseMeasure := + InvariantProjection.ProductRotation.measurePreserving_product_translation + (fun i => (θ i : UnitAddCircle)) + +theorem rotationIterate_ergodic {θ : ℕ → ℝ} + (hθ : JointlyRationallyIndependent θ) {k : ℤ} (hk : k ≠ 0) : + Ergodic (rotationIterate θ k) baseMeasure := + InvariantProjection.ProductRotation.product_rotation_integer_ergodic hθ hk + +theorem rotation_ergodic {θ : ℕ → ℝ} + (hθ : JointlyRationallyIndependent θ) : + Ergodic (rotation θ) baseMeasure := + InvariantProjection.ProductRotation.product_rotation_ergodic hθ + +theorem rotation_totalErgodic {θ : ℕ → ℝ} + (hθ : JointlyRationallyIndependent θ) {n : ℕ} (hn : 0 < n) : + Ergodic (rotation θ)^[n] baseMeasure := + InvariantProjection.ProductRotation.product_rotation_totalErgodic hθ hn + +theorem rotationIterate_ne_self {θ : ℕ → ℝ} + (hθ : JointlyRationallyIndependent θ) {k : ℤ} (hk : k ≠ 0) (x : Base) : + rotationIterate θ k x ≠ x := + InvariantProjection.ProductRotation.product_rotation_free θ + (InvariantProjection.ProductRotation.integer_affine_independent hθ) hk x + +end Invariant233.ProductModel + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductBlockCost.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductBlockCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..61ed35416aae774f4101a84560b1b217b6d88507 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductBlockCost.lean @@ -0,0 +1,95 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductLogIntegral +import OAI.Analysis.IrrationalRotation.Analysis.BlockAngleConstruction + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal BigOperators + +namespace Invariant233.ProductModel + +theorem one_le_block_cost {m : ℕ} (hm : 0 < m) (K C : ℝ) + (hK : 1 ≤ K) (hC : K ^ 2 ≤ C) (θ : Fin m → ℝ) + (hθ : ∀ r, 1 / ((m : ℝ) * K) ≤ θ r) : + (1 : ℝ≥0∞) ≤ ∑' r, ENNReal.ofReal (C * θ r) := by + have hmpos : (0 : ℝ) < m := Nat.cast_pos.mpr hm + have hKpos : 0 < K := lt_of_lt_of_le zero_lt_one hK + have hC0 : 0 ≤ C := le_trans (sq_nonneg K) hC + have hθ0 (r : Fin m) : 0 ≤ θ r := + (le_of_lt (one_div_pos.mpr (mul_pos hmpos hKpos))).trans (hθ r) + have hlower : C / K ≤ ∑ r : Fin m, C * θ r := by + calc + C / K = ∑ _r : Fin m, C * (1 / ((m : ℝ) * K)) := by + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + field_simp + _ ≤ ∑ r : Fin m, C * θ r := + Finset.sum_le_sum (fun r _ ↦ mul_le_mul_of_nonneg_left (hθ r) hC0) + have hone : 1 ≤ C / K := by + apply (le_div_iff₀ hKpos).mpr + nlinarith + rw [tsum_fintype, ← ENNReal.ofReal_sum_of_nonneg + (fun r _ ↦ mul_nonneg hC0 (hθ0 r))] + exact ENNReal.one_le_ofReal.mpr (hone.trans hlower) + +theorem tsum_block_coordinate_cost_eq_top + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) + (K C : ℕ → ℝ) (hK : ∀ j, 1 ≤ K j) (hC : ∀ j, (K j) ^ 2 ≤ C j) + (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ) + (hθ : ∀ i, 1 / ((m (e i).1 : ℝ) * K (e i).1) ≤ θ i) : + (∑' i, ENNReal.ofReal (C (e i).1 * θ i)) = ∞ := by + rw [← e.symm.tsum_eq (fun i : ℕ ↦ ENNReal.ofReal (C (e i).1 * θ i))] + simp only [e.apply_symm_apply] + rw [ENNReal.tsum_sigma (fun (j : ℕ) (r : Fin (m j)) ↦ + ENNReal.ofReal (C j * θ (e.symm ⟨j, r⟩)))] + apply top_le_iff.mp + calc + (∞ : ℝ≥0∞) = ∑' _j : ℕ, (1 : ℝ≥0∞) := + (ENNReal.tsum_const_eq_top_of_ne_zero one_ne_zero).symm + _ ≤ ∑' j, ∑' r : Fin (m j), ENNReal.ofReal (C j * θ (e.symm ⟨j, r⟩)) := by + apply ENNReal.tsum_le_tsum + intro j + apply one_le_block_cost (hm j) (K j) (C j) (hK j) (hC j) + intro r + simpa only [e.apply_symm_apply] using hθ (e.symm ⟨j, r⟩) + +theorem hasNegInfiniteLogIntegral_of_block_bounds + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) + (K C : ℕ → ℝ) (hK : ∀ j, 1 ≤ K j) (hC : ∀ j, (K j) ^ 2 ≤ C j) + (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ) + (hθ01 : ∀ i, θ i ∈ Ico (0 : ℝ) 1) + (hθ : ∀ i, 1 / ((m (e i).1 : ℝ) * K (e i).1) ≤ θ i) : + HasNegInfiniteLogIntegral baseMeasure (weight θ (fun i ↦ C (e i).1)) := by + apply (hasNegInfiniteLogIntegral_iff_tsum θ _ hθ01 + (fun i ↦ le_trans (sq_nonneg _) (hC (e i).1))).mpr + exact tsum_block_coordinate_cost_eq_top m hm K C hK hC e θ hθ + +theorem exists_admissible_block_weight + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) + (K C : ℕ → ℝ) (hK : ∀ j, 1 ≤ K j) (hC : ∀ j, (K j) ^ 2 ≤ C j) + (hscale : ∀ j, 2 < (m j : ℝ) * K j) + (hsum : Summable (fun j ↦ 1 / K j)) : + ∃ (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ), + (∀ i : Σ j, Fin (m j), e.symm i = (∑ r ∈ Finset.range i.1, m r) + i.2.val) ∧ + (∀ i, θ i ∈ Icc (1 / ((m (e i).1 : ℝ) * K (e i).1)) + (2 / ((m (e i).1 : ℝ) * K (e i).1))) ∧ + (∑' i, θ i) ≤ 2 * (∑' j, 1 / K j) ∧ + AdmissibleAnglesAndCosts θ (fun i ↦ C (e i).1) ∧ + HasNegInfiniteLogIntegral baseMeasure (weight θ (fun i ↦ C (e i).1)) ∧ + (∀ᵐ x ∂baseMeasure, 0 < weight θ (fun i ↦ C (e i).1) x ∧ + weight θ (fun i ↦ C (e i).1) x ≤ 1) := by + have hKpos (j : ℕ) : 0 < K j := lt_of_lt_of_le zero_lt_one (hK j) + have hCpos (j : ℕ) : 0 < C j := lt_of_lt_of_le (sq_pos_of_pos (hKpos j)) (hC j) + obtain ⟨e, θ, he, hbounds, hθ01, hθsum, hsumBound, hlin⟩ := + InvariantProjection.IndependentAngles.exists_summable_block_angles_unitInterval + m hm K hKpos hscale hsum + refine ⟨e, θ, he, hbounds, hsumBound, ?_, ?_, ?_⟩ + · exact ⟨fun i ↦ ⟨(hθ01 i).1, (hθ01 i).2, hCpos (e i).1⟩, hθsum, hlin⟩ + · exact hasNegInfiniteLogIntegral_of_block_bounds m hm K C hK hC e θ + (fun i ↦ ⟨(hθ01 i).1.le, (hθ01 i).2⟩) (fun i ↦ (hbounds i).1) + · filter_upwards [ae_weight_pos θ (fun i ↦ C (e i).1) + (fun i ↦ (hθ01 i).1.le) (fun i ↦ (hCpos (e i).1).le) hθsum] with x hx + exact ⟨hx, (weight_mem_Icc θ _ x).2⟩ + +end Invariant233.ProductModel + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductBlockTailBounds.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductBlockTailBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..c7e67f8a4e2bb217cb544529b59053d3a68a3b55 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductBlockTailBounds.lean @@ -0,0 +1,232 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductTailTrimming +import OAI.Analysis.IrrationalRotation.Analysis.BlockReciprocalSum +import OAI.Analysis.IrrationalRotation.Analysis.GeometricTails +import OAI.Analysis.IrrationalRotation.Sampling.SamplingHorizon +import Mathlib.Basic.ENNReal.BigOperators + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal BigOperators Topology +namespace Invariant233.ProductModel + +theorem block_angle_sum_le {m : ℕ} (hm : 0 < m) (K : ℝ) (hK : 0 < K) + (θ : Fin m → ℝ) (hθ : ∀ r, θ r ≤ 2 / ((m : ℝ) * K)) : + (∑' r, ENNReal.ofReal (θ r)) ≤ ENNReal.ofReal (2 / K) := by + have hm0 : (m : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hm) + calc + (∑' r, ENNReal.ofReal (θ r)) ≤ + ∑' _r : Fin m, ENNReal.ofReal (2 / ((m : ℝ) * K)) := + ENNReal.tsum_le_tsum (fun r => ENNReal.ofReal_le_ofReal (hθ r)) + _ = ENNReal.ofReal (∑ r : Fin m, 2 / ((m : ℝ) * K)) := by + rw [tsum_fintype, ENNReal.ofReal_sum_of_nonneg (fun _ _ => by positivity)] + _ = ENNReal.ofReal (2 / K) := by + congr 1 + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + field_simp + +theorem enumerated_tail_angle_sum_le + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) (K : ℕ → ℝ) (hK : ∀ j, 0 < K j) + (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ) + (hθ : ∀ i, θ i ≤ 2 / ((m (e i).1 : ℝ) * K (e i).1)) (l : ℕ) : + (∑' i : {i : ℕ // l < (e i).1}, ENNReal.ofReal (θ i)) ≤ + 2 * ∑' j : {j : ℕ // l < j}, ENNReal.ofReal (1 / K j) := by + have hsub : (∑' i : {i : ℕ // l < (e i).1}, ENNReal.ofReal (θ i)) = + ∑' i : ℕ, ({i : ℕ | l < (e i).1}).indicator (fun i => ENNReal.ofReal (θ i)) i := + tsum_subtype ({i : ℕ | l < (e i).1}) (fun i => ENNReal.ofReal (θ i)) + rw [hsub] + rw [← e.symm.tsum_eq (fun i : ℕ => + ({i : ℕ | l < (e i).1}).indicator (fun i => ENNReal.ofReal (θ i)) i)] + simp only [Set.indicator, Set.mem_ofPred_eq, e.apply_symm_apply] + have hsplit : (∑' p : Σ j, Fin (m j), + if l < p.1 then ENNReal.ofReal (θ (e.symm p)) else 0) = + ∑' j, ∑' r : Fin (m j), if l < j then ENNReal.ofReal (θ (e.symm ⟨j, r⟩)) else 0 := + ENNReal.tsum_sigma (fun j r => if l < j then ENNReal.ofReal (θ (e.symm ⟨j, r⟩)) else 0) + rw [hsplit] + calc + (∑' j, ∑' r : Fin (m j), if l < j then ENNReal.ofReal (θ (e.symm ⟨j, r⟩)) else 0) ≤ + ∑' j, if l < j then ENNReal.ofReal (2 / K j) else 0 := by + apply ENNReal.tsum_le_tsum + intro j + by_cases hj : l < j + · simp only [hj, ite_true] + apply block_angle_sum_le (hm j) (K j) (hK j) + intro r + simpa only [e.apply_symm_apply] using hθ (e.symm ⟨j, r⟩) + · simp only [hj, ite_false, tsum_zero, le_refl] + _ = 2 * ∑' j : {j : ℕ // l < j}, ENNReal.ofReal (1 / K j) := by + have hjsub : (∑' j : {j : ℕ // l < j}, ENNReal.ofReal (1 / K j)) = + ∑' j : ℕ, ({j : ℕ | l < j}).indicator (fun j => ENNReal.ofReal (1 / K j)) j := + tsum_subtype ({j : ℕ | l < j}) (fun j => ENNReal.ofReal (1 / K j)) + rw [hjsub, ← ENNReal.tsum_mul_left] + apply tsum_congr + intro j + by_cases hj : l < j + · simp only [Set.indicator, Set.mem_ofPred_eq, hj, ite_true] + rw [show (2 : ℝ) / K j = 2 * (1 / K j) by ring, + ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] + norm_num + · simp [Set.indicator, hj] + +def strictBlockTailEquiv (l : ℕ) : ℕ ≃ {j : ℕ // l < j} where + toFun n := ⟨l + 1 + n, by omega⟩ + invFun j := j.val - l - 1 + left_inv n := by dsimp; omega + right_inv j := by apply Subtype.ext; dsimp; omega + +theorem enumerated_tail_angle_sum_le_four_div + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) (K : ℕ → ℝ) (hK : ∀ j, 0 < K j) + (hdouble : ∀ j, 2 * K j ≤ K (j + 1)) + (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ) + (hθ : ∀ i, θ i ≤ 2 / ((m (e i).1 : ℝ) * K (e i).1)) (l : ℕ) : + (∑' i : {i : ℕ // l < (e i).1}, ENNReal.ofReal (θ i)) ≤ + ENNReal.ofReal (4 / K (l + 1)) := by + have hs : Summable (fun n : ℕ => 1 / K (l + 1 + n)) := by + simpa only [Nat.add_comm] using (summable_nat_add_iff (l + 1)).mpr + (InvariantProjection.GeometricTails.summable_reciprocal hK hdouble) + have heq : (∑' j : {j : ℕ // l < j}, ENNReal.ofReal (1 / K j)) = + ∑' n : ℕ, ENNReal.ofReal (1 / K (l + 1 + n)) := + ((strictBlockTailEquiv l).tsum_eq (fun j => ENNReal.ofReal (1 / K j))).symm + refine (enumerated_tail_angle_sum_le m hm K hK e θ hθ l).trans ?_ + rw [heq, ← ENNReal.ofReal_tsum_of_nonneg (fun n => (one_div_pos.mpr (hK (l + 1 + n))).le) hs] + calc + 2 * ENNReal.ofReal (∑' n : ℕ, 1 / K (l + 1 + n)) ≤ + 2 * ENNReal.ofReal (2 / K (l + 1)) := by + gcongr + exact InvariantProjection.GeometricTails.tsum_reciprocal_tail_le hK hdouble l + _ = ENNReal.ofReal (4 / K (l + 1)) := by + rw [show (4 : ℝ) / K (l + 1) = 2 * (2 / K (l + 1)) by ring, + ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] + norm_num + +theorem sampling_horizon_ratio_le_decay {m K : ℝ} (hm : 0 < m) + (hK : m ^ ((3 / 4 : ℝ) * m) ≤ K) : + m ^ ((7 / 10 : ℝ) * m) / K ≤ m ^ (-m / 20) := by + calc + m ^ ((7 / 10 : ℝ) * m) / K ≤ + m ^ ((7 / 10 : ℝ) * m) / m ^ ((3 / 4 : ℝ) * m) := + div_le_div_of_nonneg_left (Real.rpow_nonneg hm.le _) + (Real.rpow_pos_of_pos hm _) hK + _ = m ^ (-m / 20) := by + rw [← Real.rpow_sub hm] + congr 1 + ring + +theorem enumerated_sampled_tail_angle_sum_le_decay + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) (K : ℕ → ℝ) (hK : ∀ j, 0 < K j) + (hdouble : ∀ j, 2 * K j ≤ K (j + 1)) + (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ) + (hθ : ∀ i, θ i ≤ 2 / ((m (e i).1 : ℝ) * K (e i).1)) (l n : ℕ) + (hn : (n : ℝ) ≤ (m l : ℝ) ^ ((7 / 10 : ℝ) * m l)) + (hscale : (m l : ℝ) ^ ((3 / 4 : ℝ) * m l) ≤ K (l + 1)) : + ENNReal.ofReal (n : ℝ) * + (∑' i : {i : ℕ // l < (e i).1}, ENNReal.ofReal (θ i)) ≤ + ENNReal.ofReal (4 * (m l : ℝ) ^ (-(m l : ℝ) / 20)) := by + have hmpos : (0 : ℝ) < m l := Nat.cast_pos.mpr (hm l) + calc + ENNReal.ofReal (n : ℝ) * + (∑' i : {i : ℕ // l < (e i).1}, ENNReal.ofReal (θ i)) ≤ + ENNReal.ofReal (n : ℝ) * ENNReal.ofReal (4 / K (l + 1)) := by + gcongr + exact enumerated_tail_angle_sum_le_four_div m hm K hK hdouble e θ hθ l + _ = ENNReal.ofReal ((n : ℝ) * (4 / K (l + 1))) := + (ENNReal.ofReal_mul (Nat.cast_nonneg n)).symm + _ ≤ ENNReal.ofReal (4 * (m l : ℝ) ^ (-(m l : ℝ) / 20)) := by + apply ENNReal.ofReal_le_ofReal + calc + (n : ℝ) * (4 / K (l + 1)) ≤ + (m l : ℝ) ^ ((7 / 10 : ℝ) * m l) * (4 / K (l + 1)) := + mul_le_mul_of_nonneg_right hn (div_nonneg (by norm_num) (hK (l + 1)).le) + _ = 4 * ((m l : ℝ) ^ ((7 / 10 : ℝ) * m l) / K (l + 1)) := by ring + _ ≤ 4 * (m l : ℝ) ^ (-(m l : ℝ) / 20) := + mul_le_mul_of_nonneg_left (sampling_horizon_ratio_le_decay hmpos hscale) (by norm_num) + +def blockPrefixCoordinates (m : ℕ → ℕ) (e : ℕ ≃ Σ j, Fin (m j)) (l : ℕ) : Finset ℕ := + ((Finset.range (l + 1)).sigma (fun j => (Finset.univ : Finset (Fin (m j))))).preimage + e e.injective.injOn + +@[simp] theorem mem_blockPrefixCoordinates (m : ℕ → ℕ) + (e : ℕ ≃ Σ j, Fin (m j)) (l i : ℕ) : + i ∈ blockPrefixCoordinates m e l ↔ (e i).1 ≤ l := by + simp [blockPrefixCoordinates] + +theorem blockPrefix_tail_tsum (m : ℕ → ℕ) (e : ℕ ≃ Σ j, Fin (m j)) + (l : ℕ) (θ : ℕ → ℝ) : + (∑' i : {i : ℕ // i ∉ blockPrefixCoordinates m e l}, ENNReal.ofReal (θ i)) = + ∑' i : {i : ℕ // l < (e i).1}, ENNReal.ofReal (θ i) := by + let d : {i : ℕ // i ∉ blockPrefixCoordinates m e l} ≃ {i : ℕ // l < (e i).1} := + (Equiv.refl ℕ).subtypeEquiv (by intro i; simp) + exact d.tsum_eq (fun i => ENNReal.ofReal (θ i)) + +theorem weighted_block_tailOrderFailure_le_decay + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) (K : ℕ → ℝ) (hK : ∀ j, 0 < K j) + (hdouble : ∀ j, 2 * K j ≤ K (j + 1)) + (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) + (hθ : ∀ i, θ i ≤ 2 / ((m (e i).1 : ℝ) * K (e i).1)) (l n : ℕ) + (hn : (n : ℝ) ≤ (m l : ℝ) ^ ((7 / 10 : ℝ) * m l)) + (hscale : (m l : ℝ) ^ ((3 / 4 : ℝ) * m l) ≤ K (l + 1)) + (w : (blockPrefixCoordinates m e l → Circle) → ℝ≥0∞) (hw : Measurable w) : + (baseMeasure.withDensity + (fun x : Base => w (fun i : blockPrefixCoordinates m e l => x i))) + (tailOrderFailure (blockPrefixCoordinates m e l) θ n) ≤ + (baseMeasure.withDensity + (fun x : Base => w (fun i : blockPrefixCoordinates m e l => x i))) Set.univ * + ENNReal.ofReal (4 * (m l : ℝ) ^ (-(m l : ℝ) / 20)) := by + refine (TailTrimming.weighted_tailOrderFailure_le + (blockPrefixCoordinates m e l) θ hθ0 n w hw).trans ?_ + apply mul_le_mul_right + rw [blockPrefix_tail_tsum] + exact enumerated_sampled_tail_angle_sum_le_decay m hm K hK hdouble e θ hθ l n hn hscale + +theorem orbitAverage_block_unordered_le_decay + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) (K : ℕ → ℝ) (hK : ∀ j, 0 < K j) + (hdouble : ∀ j, 2 * K j ≤ K (j + 1)) + (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) + (hθ : ∀ i, θ i ≤ 2 / ((m (e i).1 : ℝ) * K (e i).1)) (l M : ℕ) + (hM : (M : ℝ) ≤ (m l : ℝ) ^ ((7 / 10 : ℝ) * m l)) + (hscale : (m l : ℝ) ^ ((3 / 4 : ℝ) * m l) ≤ K (l + 1)) + (N : Finset ℕ) (hN : ∀ n ∈ N, n ≤ M) + (w : ℕ → (blockPrefixCoordinates m e l → Circle) → ℝ≥0∞) + (hw : ∀ n ∈ N, Measurable (w n)) + (hprefix : ∀ n ∈ N, + ∀ᵐ x ∂baseMeasure.withDensity + (fun x : Base => w n (fun i : blockPrefixCoordinates m e l => x i)), + ∀ i ∈ blockPrefixCoordinates m e l, circleRepresentative (x i) ≤ + circleRepresentative (rotationIterate θ (n : ℤ) x i)) : + TailTrimming.orbitAverageMeasure θ N + (fun n x => w n (fun i : blockPrefixCoordinates m e l => x i)) + TailTrimming.orderedPairEventᶜ ≤ + TailTrimming.orbitAverageMeasure θ N + (fun n x => w n (fun i : blockPrefixCoordinates m e l => x i)) Set.univ * + ENNReal.ofReal (4 * (m l : ℝ) ^ (-(m l : ℝ) / 20)) := by + refine (TailTrimming.orbitAverageMeasure_unordered_le + (blockPrefixCoordinates m e l) N θ hθ0 M hN w hw hprefix).trans ?_ + apply mul_le_mul_right + rw [blockPrefix_tail_tsum] + exact enumerated_sampled_tail_angle_sum_le_decay m hm K hK hdouble e θ hθ l M hM hscale + +theorem tendsto_four_mul_block_decay {m : ℕ → ℝ} + (hm : Tendsto m atTop atTop) : + Tendsto (fun l => 4 * m l ^ (-m l / 20)) atTop (𝓝 0) := by + have hinv : Tendsto (fun l => 4 * (m l)⁻¹) atTop (𝓝 0) := by + simpa using (tendsto_inv_atTop_zero.comp hm).const_mul 4 + apply squeeze_zero' _ _ hinv + · filter_upwards [hm.eventually_ge_atTop 20] with l hl + exact mul_nonneg (by norm_num) (Real.rpow_nonneg (by linarith) _) + · filter_upwards [hm.eventually_ge_atTop 20] with l hl + exact mul_le_mul_of_nonneg_left (SamplingHorizon.decay_le_inv hl) (by norm_num) + +theorem tendsto_four_mul_block_decay_of_growth (m : ℕ → ℕ) + (hm : ∀ l, 2 ^ l ≤ m l) : + Tendsto (fun l => 4 * (m l : ℝ) ^ (-(m l : ℝ) / 20)) atTop (𝓝 0) := by + apply tendsto_four_mul_block_decay + apply tendsto_atTop_mono (fun l => ?_) + (tendsto_pow_atTop_atTop_of_one_lt (by norm_num : (1 : ℝ) < 2)) + exact_mod_cast hm l + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductCircleConditioning.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCircleConditioning.lean new file mode 100644 index 0000000000000000000000000000000000000000..d7a1e2625b1609bf6edbd51e6c14fe0174d61622 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCircleConditioning.lean @@ -0,0 +1,125 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ObservationConditioning +import OAI.Analysis.IrrationalRotation.Couplings.ProductCouplingCircle + +namespace OAI + +open MeasureTheory ProbabilityTheory + +namespace Invariant233.OrderedProductCoupling + +theorem left_condExp_eq_circle (P : Parameters) (f : Sample → ℝ) : + (law P)[f | (inferInstance : MeasurableSpace Endpoint).comap leftEndpoint] + =ᵐ[law P] + (law P)[f | (inferInstance : MeasurableSpace ProductModel.Base).comap circleLeftEndpoint] := by + apply ObservationConditioning.condExp_comap_of_ae_section (law P) + leftEndpoint_measurable circleLeftEndpoint_measurable + realEndpoint_measurable circleEndpoint_measurable circleEndpoint_realEndpoint + exact (ae_real_circle_endpoints P).mono (fun _ h => h.1) + +theorem right_condExp_eq_circle (P : Parameters) (f : Sample → ℝ) : + (law P)[f | (inferInstance : MeasurableSpace Endpoint).comap rightEndpoint] + =ᵐ[law P] + (law P)[f | (inferInstance : MeasurableSpace ProductModel.Base).comap circleRightEndpoint] := by + apply ObservationConditioning.condExp_comap_of_ae_section (law P) + rightEndpoint_measurable circleRightEndpoint_measurable + realEndpoint_measurable circleEndpoint_measurable circleEndpoint_realEndpoint + exact (ae_real_circle_endpoints P).mono (fun _ h => h.2) + +theorem left_iCondIndepSet_iff_circle {ι : Type*} [Countable ι] + (P : Parameters) (events : ι → Set Sample) + (hmeas : ∀ i, MeasurableSet (events i)) : + iCondIndepSet ((inferInstance : MeasurableSpace Endpoint).comap leftEndpoint) + leftEndpoint_measurable.comap_le events (law P) ↔ + iCondIndepSet ((inferInstance : MeasurableSpace ProductModel.Base).comap circleLeftEndpoint) + circleLeftEndpoint_measurable.comap_le events (law P) := by + apply ObservationConditioning.iCondIndepSet_comap_iff_of_ae_section (law P) + leftEndpoint_measurable circleLeftEndpoint_measurable + realEndpoint_measurable circleEndpoint_measurable circleEndpoint_realEndpoint + _ events hmeas + exact (ae_real_circle_endpoints P).mono (fun _ h => h.1) + +theorem right_iCondIndepSet_iff_circle {ι : Type*} [Countable ι] + (P : Parameters) (events : ι → Set Sample) + (hmeas : ∀ i, MeasurableSet (events i)) : + iCondIndepSet ((inferInstance : MeasurableSpace Endpoint).comap rightEndpoint) + rightEndpoint_measurable.comap_le events (law P) ↔ + iCondIndepSet ((inferInstance : MeasurableSpace ProductModel.Base).comap circleRightEndpoint) + circleRightEndpoint_measurable.comap_le events (law P) := by + apply ObservationConditioning.iCondIndepSet_comap_iff_of_ae_section (law P) + rightEndpoint_measurable circleRightEndpoint_measurable + realEndpoint_measurable circleEndpoint_measurable circleEndpoint_realEndpoint + _ events hmeas + exact (ae_real_circle_endpoints P).mono (fun _ h => h.2) + +theorem right_threshold_event_ae_eq_circle (P : Parameters) (u : ℕ → ℝ) (i : ℕ) : + {ω : Sample | u i ≤ rightEndpoint ω i} =ᵐ[law P] + {ω : Sample | u i ≤ realEndpoint (circleRightEndpoint ω) i} := by + filter_upwards [ae_real_circle_endpoints P] with ω hω + rw [hω.2] + +theorem left_threshold_event_ae_eq_circle (P : Parameters) (u : ℕ → ℝ) (i : ℕ) : + {ω : Sample | leftEndpoint ω i < u i} =ᵐ[law P] + {ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u i} := by + filter_upwards [ae_real_circle_endpoints P] with ω hω + rw [hω.1] + +theorem right_threshold_condExp_eq_circle (P : Parameters) (u : ℕ → ℝ) (i : ℕ) : + (law P)[({ω : Sample | u i ≤ rightEndpoint ω i}).indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace Endpoint).comap leftEndpoint] =ᵐ[law P] + (law P)[({ω : Sample | u i ≤ realEndpoint (circleRightEndpoint ω) i}).indicator + (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace ProductModel.Base).comap circleLeftEndpoint] := by + exact (left_condExp_eq_circle P _).trans + (condExp_congr_ae (indicator_ae_eq_of_ae_eq_set + (right_threshold_event_ae_eq_circle P u i))) + +theorem left_threshold_condExp_eq_circle (P : Parameters) (u : ℕ → ℝ) (i : ℕ) : + (law P)[({ω : Sample | leftEndpoint ω i < u i}).indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace Endpoint).comap rightEndpoint] =ᵐ[law P] + (law P)[({ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u i}).indicator + (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace ProductModel.Base).comap circleRightEndpoint] := by + exact (right_condExp_eq_circle P _).trans + (condExp_congr_ae (indicator_ae_eq_of_ae_eq_set + (left_threshold_event_ae_eq_circle P u i))) + +theorem right_threshold_iCondIndepSet_iff_circle (P : Parameters) (u : ℕ → ℝ) : + iCondIndepSet ((inferInstance : MeasurableSpace Endpoint).comap leftEndpoint) + leftEndpoint_measurable.comap_le + (fun i => {ω : Sample | u i ≤ rightEndpoint ω i}) (law P) ↔ + iCondIndepSet ((inferInstance : MeasurableSpace ProductModel.Base).comap circleLeftEndpoint) + circleLeftEndpoint_measurable.comap_le + (fun i => {ω : Sample | u i ≤ realEndpoint (circleRightEndpoint ω) i}) (law P) := by + have hraw (i : ℕ) : MeasurableSet {ω : Sample | u i ≤ rightEndpoint ω i} := + measurableSet_le measurable_const ((measurable_pi_apply i).comp rightEndpoint_measurable) + have hcircle (i : ℕ) : + MeasurableSet {ω : Sample | u i ≤ realEndpoint (circleRightEndpoint ω) i} := + measurableSet_le measurable_const + ((measurable_pi_apply i).comp (realEndpoint_measurable.comp circleRightEndpoint_measurable)) + exact (left_iCondIndepSet_iff_circle P _ hraw).trans + (ObservationConditioning.iCondIndepSet_iff_of_events_ae_eq + _ circleLeftEndpoint_measurable.comap_le (law P) _ _ hraw hcircle + (right_threshold_event_ae_eq_circle P u)) + +theorem left_threshold_iCondIndepSet_iff_circle (P : Parameters) (u : ℕ → ℝ) : + iCondIndepSet ((inferInstance : MeasurableSpace Endpoint).comap rightEndpoint) + rightEndpoint_measurable.comap_le + (fun i => {ω : Sample | leftEndpoint ω i < u i}) (law P) ↔ + iCondIndepSet ((inferInstance : MeasurableSpace ProductModel.Base).comap circleRightEndpoint) + circleRightEndpoint_measurable.comap_le + (fun i => {ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u i}) (law P) := by + have hraw (i : ℕ) : MeasurableSet {ω : Sample | leftEndpoint ω i < u i} := + measurableSet_lt ((measurable_pi_apply i).comp leftEndpoint_measurable) measurable_const + have hcircle (i : ℕ) : + MeasurableSet {ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u i} := + measurableSet_lt + ((measurable_pi_apply i).comp (realEndpoint_measurable.comp circleLeftEndpoint_measurable)) + measurable_const + exact (right_iCondIndepSet_iff_circle P _ hraw).trans + (ObservationConditioning.iCondIndepSet_iff_of_events_ae_eq + _ circleRightEndpoint_measurable.comap_le (law P) _ _ hraw hcircle + (left_threshold_event_ae_eq_circle P u)) + +end Invariant233.OrderedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductCircleThresholds.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCircleThresholds.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a7d184a9860918781a76e136e367c0f54390af8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCircleThresholds.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalEvents +import OAI.Analysis.IrrationalRotation.Product.ProductCircleConditioning + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory + +namespace Invariant233.OrderedProductCoupling + +theorem circle_right_thresholds_iCondIndepSet (P : Parameters) (u : ℕ → ℝ) : + iCondIndepSet (MeasurableSpace.comap circleLeftEndpoint inferInstance) + circleLeftEndpoint_measurable.comap_le + (fun i => {ω : Sample | u i ≤ realEndpoint (circleRightEndpoint ω) i}) (law P) := + (right_threshold_iCondIndepSet_iff_circle P u).mp + (right_thresholds_iCondIndepSet P u) + +theorem circle_left_thresholds_iCondIndepSet (P : Parameters) (u : ℕ → ℝ) : + iCondIndepSet (MeasurableSpace.comap circleRightEndpoint inferInstance) + circleRightEndpoint_measurable.comap_le + (fun i => {ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u i}) (law P) := + (left_threshold_iCondIndepSet_iff_circle P u).mp + (left_thresholds_iCondIndepSet P u) + +theorem circle_right_threshold_condExp_lower (P : Parameters) (u : ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u i → u i ≤ 1 - w → + realEndpoint (circleLeftEndpoint ω) i < u i → + CouplingMarginalBounds.rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | u i ≤ realEndpoint (circleRightEndpoint ω) i}.indicator + (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleLeftEndpoint inferInstance]) ω := by + have heq := ae_all_iff.mpr (right_threshold_condExp_eq_circle P u) + filter_upwards [right_threshold_condExp_lower P u, ae_real_circle_endpoints P, heq] + with ω hω hrep hce i w hw hwu huw hxu + rw [← hce i] + apply hω i w hw hwu huw + simpa only [hrep.1] using hxu + +theorem circle_left_threshold_condExp_lower (P : Parameters) (u : ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u i → u i ≤ 1 - w → + u i ≤ realEndpoint (circleRightEndpoint ω) i → + CouplingMarginalBounds.rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u i}.indicator + (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleRightEndpoint inferInstance]) ω := by + have heq := ae_all_iff.mpr (left_threshold_condExp_eq_circle P u) + filter_upwards [left_threshold_condExp_lower P u, ae_real_circle_endpoints P, heq] + with ω hω hrep hce i w hw hwu huw huy + rw [← hce i] + apply hω i w hw hwu huw + simpa only [hrep.2] using huy + +theorem circle_threshold_condExp_lower_countable {T : Type*} [Countable T] + (P : Parameters) (u : T → ℕ → ℝ) : + ∀ᵐ ω ∂law P, ∀ (t : T) (i : ℕ) (w : ℝ), + (w = P.a i ∨ w = P.b i) → w ≤ u t i → u t i ≤ 1 - w → + (realEndpoint (circleLeftEndpoint ω) i < u t i → + CouplingMarginalBounds.rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | u t i ≤ realEndpoint (circleRightEndpoint ω) i}.indicator + (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleLeftEndpoint inferInstance]) ω) ∧ + (u t i ≤ realEndpoint (circleRightEndpoint ω) i → + CouplingMarginalBounds.rho (P.κ i) (P.m i) w / 10 ≤ + ((law P)[{ω : Sample | realEndpoint (circleLeftEndpoint ω) i < u t i}.indicator + (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleRightEndpoint inferInstance]) ω) := by + have hleft := ae_all_iff.mpr (fun t => circle_right_threshold_condExp_lower P (u t)) + have hright := ae_all_iff.mpr (fun t => circle_left_threshold_condExp_lower P (u t)) + filter_upwards [hleft, hright] with ω hx hy t i w hw hwu huw + exact ⟨hx t i w hw hwu huw, hy t i w hw hwu huw⟩ + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductCocycle.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCocycle.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b01e3907fffa489b22248c5e7cade574157120b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCocycle.lean @@ -0,0 +1,192 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductCocycle +import OAI.Analysis.IrrationalRotation.Rotation.FiniteSupportCocycle +import OAI.Analysis.IrrationalRotation.Analysis.InvariantConullCore +import OAI.Analysis.IrrationalRotation.Product.ProductSupport +import Mathlib.MeasureTheory.Constructions.Polish.Basic + +namespace OAI + +open MeasureTheory Set Function + +namespace Invariant233.ProductCocycle + +@[simp] theorem rotate_zero {I : Type*} (θ : I → ℝ) (x : Space I) : + rotate θ 0 x = x := by + funext i + simp [rotate] + +theorem rotate_add {I : Type*} (θ : I → ℝ) (k n : ℤ) (x : Space I) : + rotate θ (k + n) x = rotate θ n (rotate θ k x) := by + funext i + simp only [rotate, Int.cast_add, add_mul, AddCircle.coe_add, add_assoc] + +theorem representative_mem_Ico (x : UnitAddCircle) : + representative x ∈ Ico (0 : ℝ) 1 := by + simpa only [representative, zero_add] using (AddCircle.equivIco (1 : ℝ) 0 x).property + +@[simp] theorem coe_representative (x : UnitAddCircle) : + ((representative x : ℝ) : UnitAddCircle) = x := + AddCircle.coe_equivIco + +theorem representative_add (x : UnitAddCircle) (t : ℝ) : + representative (x + (t : UnitAddCircle)) = Int.fract (representative x + t) := by + have hx : x + (t : UnitAddCircle) = + ((representative x + t : ℝ) : UnitAddCircle) := by + rw [AddCircle.coe_add, coe_representative] + rw [hx] + change ((AddCircle.equivIco (1 : ℝ) 0 + ((representative x + t : ℝ) : UnitAddCircle)) : ℝ) = _ + simpa only [div_one, mul_one] using + (AddCircle.coe_equivIco_mk_apply (p := (1 : ℝ)) (representative x + t)) + +theorem representative_rotate {I : Type*} (θ : I → ℝ) (k : ℤ) + (x : Space I) (i : I) : + representative (rotate θ k x i) = + Int.fract (representative (x i) + (k : ℝ) * θ i) := + representative_add (x i) ((k : ℝ) * θ i) + +theorem measurable_representative : Measurable representative := + CocycleSupport.measurePreserving_circleRepresentative.measurable + +theorem measurable_cocycleVersion {I : Type*} [Countable I] + (θ c : I → ℝ) (k : ℤ) : Measurable (cocycleVersion θ c k) := by + apply Real.measurable_exp.comp + apply Measurable.neg + apply Measurable.tsum + intro i + have hrep : Measurable (fun x : Space I ↦ representative (x i)) := + measurable_representative.comp (measurable_pi_apply i) + exact measurable_const.mul ((measurable_of_countable (fun z : ℤ ↦ (z : ℝ))).comp + ((hrep.add_const ((k : ℝ) * θ i)).floor)) + +theorem cocycleVersion_pos {I : Type*} (θ c : I → ℝ) (k : ℤ) (x : Space I) : + 0 < cocycleVersion θ c k x := + Real.exp_pos _ + +@[simp] theorem cocycleVersion_zero {I : Type*} (θ c : I → ℝ) (x : Space I) : + cocycleVersion θ c 0 x = 1 := by + simp only [cocycleVersion, Int.cast_zero, zero_mul, add_zero] + exact FiniteSupportCocycle.exp_tsum_floor_zero _ c + (fun i ↦ representative_mem_Ico (x i)) + +theorem measurePreserving_rotate {I : Type*} (θ : I → ℝ) (k : ℤ) : + MeasurePreserving (rotate θ k) (haar I) (haar I) := by + let : IsProbabilityMeasure (volume : Measure UnitAddCircle) := + ⟨UnitAddCircle.measure_univ⟩ + have hcoord (i : I) : MeasurePreserving + (fun x : UnitAddCircle ↦ x + (((k : ℝ) * θ i : ℝ) : UnitAddCircle)) volume volume := + measurePreserving_add_right volume _ + refine ⟨Measurable.of_eval (fun i ↦ (measurable_pi_apply i).add_const _), ?_⟩ + change (Measure.infinitePi (fun _ : I ↦ (volume : Measure UnitAddCircle))).map + (fun x i ↦ x i + (((k : ℝ) * θ i : ℝ) : UnitAddCircle)) = _ + rw [Measure.infinitePi_map_pi _ (fun i ↦ (hcoord i).measurable)] + simp only [(hcoord _).map_eq, haar] + +theorem cocycleVersion_add_of_finite_support {I : Type*} + (θ c : I → ℝ) (k n : ℤ) (x : Space I) + (hk : HasFiniteSupport + (fun i ↦ ⌊representative (x i) + (k : ℝ) * θ i⌋)) + (hn : HasFiniteSupport + (fun i ↦ ⌊representative (rotate θ k x i) + (n : ℝ) * θ i⌋)) : + cocycleVersion θ c (k + n) x = + cocycleVersion θ c n (rotate θ k x) * cocycleVersion θ c k x := by + simp only [cocycleVersion, representative_rotate] at hn ⊢ + exact FiniteSupportCocycle.exp_tsum_floor_cocycle _ θ c k n hk hn + +theorem cocycleVersion_ratio_le_one {I : Type*} + (θ c : I → ℝ) (k : ℤ) (x y : Space I) + (hc : ∀ i, 0 ≤ c i) + (hxy : ∀ i, representative (x i) ≤ representative (y i)) + (hx : HasFiniteSupport + (fun i ↦ ⌊representative (x i) + (k : ℝ) * θ i⌋)) + (hy : HasFiniteSupport + (fun i ↦ ⌊representative (y i) + (k : ℝ) * θ i⌋)) : + cocycleVersion θ c k y / cocycleVersion θ c k x ≤ 1 := + FiniteSupportCocycle.exp_tsum_floor_ratio_le_one _ _ θ c k hc hxy hx hy + +theorem cocycleVersion_one_le_one {I : Type*} (θ c : I → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (x : Space I) : + cocycleVersion θ c 1 x ≤ 1 := by + apply Real.exp_le_one_iff.mpr + apply neg_nonpos.mpr + apply tsum_nonneg + intro i + apply mul_nonneg (hc i) + have hf : (0 : ℤ) ≤ ⌊representative (x i) + (1 : ℝ) * θ i⌋ := by + apply Int.floor_nonneg.mpr + simpa only [one_mul] using + add_nonneg (representative_mem_Ico (x i)).1 (hθ i) + exact_mod_cast hf + +theorem cocycleVersion_eq_finite_sum {I : Type*} + (θ c : I → ℝ) (k : ℤ) (x : Space I) (s : Finset I) + (hs : ∀ i ∉ s, ⌊representative (x i) + (k : ℝ) * θ i⌋ = 0) : + cocycleVersion θ c k x = + Real.exp (-∑ i ∈ s, c i * (⌊representative (x i) + (k : ℝ) * θ i⌋ : ℝ)) := by + unfold cocycleVersion + rw [tsum_eq_sum (s := s) (fun i hi ↦ by rw [hs i hi]; simp)] + +theorem exists_finset_cocycleVersion_one {I : Type*} + (θ c : I → ℝ) (hθ : ∀ i, θ i ∈ Ico (0 : ℝ) 1) (x : Space I) + (hx : HasFiniteSupport (fun i ↦ ⌊representative (x i) + θ i⌋)) : + ∃ s : Finset I, cocycleVersion θ c 1 x = Real.exp (-∑ i ∈ s, c i) := by + classical + let s := hx.toFinset + have hs : ∀ i ∉ s, ⌊representative (x i) + (1 : ℝ) * θ i⌋ = 0 := by + intro i hi + have hnot : i ∉ Function.support (fun j ↦ ⌊representative (x j) + θ j⌋) := by + exact fun hmem ↦ hi (hx.mem_toFinset.mpr hmem) + simpa only [Function.mem_support, not_not, one_mul] using hnot + refine ⟨s, ?_⟩ + rw [cocycleVersion_eq_finite_sum θ c 1 x s (by simpa using hs)] + congr 2 + apply Finset.sum_congr rfl + intro i hi + have hne : ⌊representative (x i) + θ i⌋ ≠ 0 := by + exact hx.mem_toFinset.mp hi + have hzero : ⌊θ i⌋ = 0 := Int.floor_eq_zero_iff.mpr (hθ i) + have hfloor : ⌊representative (x i) + θ i⌋ = 1 := by + rw [FloorCocycle.floor_add_eq_indicator (representative_mem_Ico (x i)).1 + (representative_mem_Ico (x i)).2, hzero] at hne ⊢ + split_ifs at hne ⊢ <;> simp_all + simp only [Int.cast_one, one_mul, hfloor, mul_one] + +theorem exists_invariant_cocycle_core {I : Type*} [Countable I] + (θ : I → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) : + ∃ s : Set (Space I), MeasurableSet s ∧ (∀ᵐ x ∂haar I, x ∈ s) ∧ + (∀ k : ℤ, rotate θ k ⁻¹' s = s) ∧ + (∀ x ∈ s, ∀ k : ℤ, HasFiniteSupport + (fun i ↦ ⌊representative (x i) + (k : ℝ) * θ i⌋)) ∧ + (∀ x ∈ s, ∀ (c : I → ℝ) (k n : ℤ), + cocycleVersion θ c (k + n) x = + cocycleVersion θ c n (rotate θ k x) * cocycleVersion θ c k x) := by + have hall : ∀ᵐ x ∂haar I, ∀ k : ℤ, HasFiniteSupport + (fun i ↦ ⌊representative (x i) + (k : ℝ) * θ i⌋) := + CocycleSupport.ae_product_all_int_finite_floor_support θ hθ0 hθ + obtain ⟨s, hs, hfull, hprop, hinv⟩ := + Invariant233.exists_invariant_conull_forall (rotate θ) (rotate_zero θ) + (rotate_add θ) (measurePreserving_rotate θ) + (fun (k : ℤ) (x : Space I) ↦ HasFiniteSupport + (fun i ↦ ⌊representative (x i) + (k : ℝ) * θ i⌋)) + (ae_all_iff.mp hall) + have hsupport (x : Space I) (hx : x ∈ s) (k : ℤ) : + HasFiniteSupport (fun i ↦ ⌊representative (x i) + (k : ℝ) * θ i⌋) := by + simpa only [rotate_zero] using hprop x hx 0 k + refine ⟨s, hs, hfull, hinv, hsupport, ?_⟩ + intro x hx c k n + exact cocycleVersion_add_of_finite_support θ c k n x + (hsupport x hx k) (hprop x hx k n) + +theorem ae_exists_finset_cocycleVersion_one {I : Type*} [Countable I] + (θ c : I → ℝ) (hθ01 : ∀ i, θ i ∈ Ico (0 : ℝ) 1) (hθ : Summable θ) : + ∀ᵐ x ∂haar I, ∃ s : Finset I, + cocycleVersion θ c 1 x = Real.exp (-∑ i ∈ s, c i) := by + have hall := CocycleSupport.ae_product_all_int_finite_floor_support + θ (fun i ↦ (hθ01 i).1) hθ + filter_upwards [hall] with x hx + apply exists_finset_cocycleVersion_one θ c hθ01 x + simpa only [HasFiniteSupport, representative, Int.cast_one, one_mul] using hx 1 + +end Invariant233.ProductCocycle + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductCocycleInterchange.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCocycleInterchange.lean new file mode 100644 index 0000000000000000000000000000000000000000..eec312fe778736e7efa48b782e4daa45d49cfdcf --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCocycleInterchange.lean @@ -0,0 +1,76 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductCocycle +import OAI.Analysis.IrrationalRotation.Model.ProductPairIdentity + +namespace OAI + +noncomputable section +open MeasureTheory Set Function + +namespace Invariant233.ProductCocycle + +theorem cocycleVersion_ratio_interchange_of_add {I : Type*} + (θ c : I → ℝ) (k n : ℤ) (x : Space I) + (hkn : cocycleVersion θ c (k + n) x = + cocycleVersion θ c n (rotate θ k x) * cocycleVersion θ c k x) + (hnk : cocycleVersion θ c (n + k) x = + cocycleVersion θ c k (rotate θ n x) * cocycleVersion θ c n x) : + cocycleVersion θ c k (rotate θ n x) / cocycleVersion θ c k x = + cocycleVersion θ c n (rotate θ k x) / cocycleVersion θ c n x := by + apply (div_eq_div_iff (cocycleVersion_pos θ c k x).ne' + (cocycleVersion_pos θ c n x).ne').mpr + calc + cocycleVersion θ c k (rotate θ n x) * cocycleVersion θ c n x = + cocycleVersion θ c (n + k) x := hnk.symm + _ = cocycleVersion θ c (k + n) x := by rw [add_comm n k] + _ = cocycleVersion θ c n (rotate θ k x) * cocycleVersion θ c k x := hkn + +theorem exists_invariant_ratio_interchange_core {I : Type*} [Countable I] + (θ : I → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) : + ∃ s : Set (Space I), MeasurableSet s ∧ (∀ᵐ x ∂haar I, x ∈ s) ∧ + (∀ k : ℤ, rotate θ k ⁻¹' s = s) ∧ + (∀ x ∈ s, ∀ (c : I → ℝ) (k n : ℤ), + cocycleVersion θ c k (rotate θ n x) / cocycleVersion θ c k x = + cocycleVersion θ c n (rotate θ k x) / cocycleVersion θ c n x) := by + obtain ⟨s, hs, hfull, hinv, _hsupport, hlaw⟩ := + exists_invariant_cocycle_core θ hθ0 hθ + refine ⟨s, hs, hfull, hinv, ?_⟩ + intro x hx c k n + exact cocycleVersion_ratio_interchange_of_add θ c k n x + (hlaw x hx c k n) (hlaw x hx c n k) + +theorem ae_cocycleVersion_ratio_interchange {I : Type*} [Countable I] + (θ : I → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) : + ∀ᵐ x ∂haar I, ∀ (c : I → ℝ) (k n : ℤ), + cocycleVersion θ c k (rotate θ n x) / cocycleVersion θ c k x = + cocycleVersion θ c n (rotate θ k x) / cocycleVersion θ c n x := by + obtain ⟨s, _hs, hfull, _hinv, hlaw⟩ := + exists_invariant_ratio_interchange_core θ hθ0 hθ + filter_upwards [hfull] with x hx + exact hlaw x hx + +end Invariant233.ProductCocycle + +namespace Invariant233.ProductModel + +theorem ae_cocycle_ratio_interchange (θ : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) : + ∀ᵐ x ∂baseMeasure, ∀ (c : ℕ → ℝ) (k n : ℤ), + ProductCocycle.cocycleVersion θ c k (rotationIterate θ n x) / + ProductCocycle.cocycleVersion θ c k x = + ProductCocycle.cocycleVersion θ c n (rotationIterate θ k x) / + ProductCocycle.cocycleVersion θ c n x := + ProductCocycle.ae_cocycleVersion_ratio_interchange θ hθ0 hθ + +theorem ae_cocycleRatio_rotation (θ : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) : + ∀ᵐ x ∂baseMeasure, ∀ (c : ℕ → ℝ) (k n : ℤ), + cocycleRatio θ c x (rotationIterate θ n x) k = + ProductCocycle.cocycleVersion θ c n (rotationIterate θ k x) / + ProductCocycle.cocycleVersion θ c n x := + ae_cocycle_ratio_interchange θ hθ0 hθ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductCocycleWindow.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCocycleWindow.lean new file mode 100644 index 0000000000000000000000000000000000000000..57c44d619e0bb7473d8bae95743313119ac68ed9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCocycleWindow.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CocycleWindowBounds +import OAI.Analysis.IrrationalRotation.Product.ProductCocycle + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexConjugate lp +namespace Invariant233.ProductCocycle + +theorem finite_window_bounds {I : Type*} (s : Finset I) + (θ c : I → ℝ) (K : ℕ) (x y : Space I) + (hθ : ∀ i, θ i ∈ Set.Icc (0 : ℝ) 1) (hc : ∀ i, 0 ≤ c i) + (hleft : ∀ i ∉ s, representative (x i) + (K : ℝ) * θ i < 1) + (hright : ∀ i ∉ s, (K : ℝ) * θ i ≤ representative (y i)) + (v : ℤ) (hv : |v| ≤ (K : ℤ)) : + 1 / cocycleVersion θ c v x ≤ Real.exp (((K : ℝ) + 1) * ∑ i ∈ s, c i) ∧ + cocycleVersion θ c (-v) y ≤ Real.exp (((K : ℝ) + 1) * ∑ i ∈ s, c i) := by + exact CocycleWindowBounds.cocycle_bounds s + (fun i => representative (x i)) (fun i => representative (y i)) θ c K + (fun i => representative_mem_Ico (x i)) (fun i => representative_mem_Ico (y i)) + hθ hc hleft hright v hv + +theorem finite_window_coefficients {I : Type*} (s : Finset I) + (θ c : I → ℝ) (K : ℕ) (x y : Space I) + (hθ : ∀ i, θ i ∈ Set.Icc (0 : ℝ) 1) (hc : ∀ i, 0 ≤ c i) + (hleft : ∀ i ∉ s, representative (x i) + (K : ℝ) * θ i < 1) + (hright : ∀ i ∉ s, (K : ℝ) * θ i ≤ representative (y i)) + (ξ γ : ℓ²(ℤ, ℂ)) (hξ : ‖ξ‖ ≤ 1) (hγ : ‖γ‖ ≤ 1) : + (∀ v : ℤ, |v| ≤ (K : ℤ) → + ‖ξ v / (cocycleVersion θ c v x : ℂ)‖ ≤ + Real.exp (((K : ℝ) + 1) * ∑ i ∈ s, c i)) ∧ + (∀ v : ℤ, |v| ≤ (K : ℤ) → + ‖(cocycleVersion θ c (-v) y : ℂ) * conj (γ (-v))‖ ≤ + Real.exp (((K : ℝ) + 1) * ∑ i ∈ s, c i)) := by + have h := fun v hv => CocycleWindowBounds.coefficient_bounds s + (fun i => representative (x i)) (fun i => representative (y i)) θ c K + (fun i => representative_mem_Ico (x i)) (fun i => representative_mem_Ico (y i)) + hθ hc hleft hright ξ γ hξ hγ v hv + exact ⟨fun v hv => (h v hv).1, fun v hv => (h v hv).2⟩ + +theorem central_coefficients {I Ω : Type*} (θ c : I → ℝ) + (x y : Ω → Space I) (ξ γ : Ω → ℓ²(ℤ, ℂ)) (ω : Ω) : + InvariantProjection.ConditionalConvolution.coeffA ξ + (fun z v => cocycleVersion θ c v (x z)) ω 0 = ξ ω 0 ∧ + InvariantProjection.ConditionalConvolution.coeffB γ + (fun z v => cocycleVersion θ c v (y z)) ω 0 = conj (γ ω 0) := by + simp [InvariantProjection.ConditionalConvolution.coeffA, + InvariantProjection.ConditionalConvolution.coeffB] + +end Invariant233.ProductCocycle + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductConvolutionIdentity.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductConvolutionIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..e77cd38ec35505d39f206e0d6f27738856d155c7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductConvolutionIdentity.lean @@ -0,0 +1,167 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductPairIdentity +import OAI.Analysis.IrrationalRotation.Rotation.CocycleWindowBounds +import OAI.Analysis.IrrationalRotation.Analysis.ConvolutionRatios + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal BigOperators ComplexConjugate + +namespace Invariant233.ProductModel + +theorem ae_antitone_cocycleVersion (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) : + ∀ᵐ x ∂baseMeasure, Antitone (fun k : ℤ => ProductCocycle.cocycleVersion θ c k x) := by + obtain ⟨s, _hsm, hfull, _hinv, _hs, hlaw⟩ := + ProductCocycle.exists_invariant_cocycle_core θ hθ0 hθ + filter_upwards [hfull] with x hx + intro a b hab + have heq := hlaw x hx c a (b - a) + rw [add_sub_cancel] at heq + calc + ProductCocycle.cocycleVersion θ c b x = + ProductCocycle.cocycleVersion θ c (b - a) (rotationIterate θ a x) * + ProductCocycle.cocycleVersion θ c a x := heq + _ ≤ 1 * ProductCocycle.cocycleVersion θ c a x := + mul_le_mul_of_nonneg_right + (ProductCocycle.cocycleVersion_le_one_of_nonneg_time θ c hθ0 hc (b - a) + (sub_nonneg.mpr hab) _) (ProductCocycle.cocycleVersion_pos θ c a x).le + _ = _ := one_mul _ + +theorem ae_convolution_two_ratio_bounds (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) + (F : Base → Fiber →L[ℂ] Fiber) (ν : Measure EndpointPair) + (hfst : ν.map Prod.fst ≪ baseMeasure) (hsnd : ν.map Prod.snd ≪ baseMeasure) + (hpair : ∀ᵐ xy ∂ν, PairIdentity θ c F xy) : + ∀ᵐ xy ∂ν, ∀ (n : ℕ) (v : ℤ), + 0 < ProductCocycle.cocycleVersion θ c ((n : ℤ) + v) xy.2 / + ProductCocycle.cocycleVersion θ c v xy.1 ∧ + ProductCocycle.cocycleVersion θ c ((n : ℤ) + v) xy.2 / + ProductCocycle.cocycleVersion θ c v xy.1 ≤ + min (cocycleRatio θ c xy.1 xy.2 v) + (cocycleRatio θ c xy.1 xy.2 ((n : ℤ) + v)) ∧ + min (cocycleRatio θ c xy.1 xy.2 v) + (cocycleRatio θ c xy.1 xy.2 ((n : ℤ) + v)) ≤ 1 := by + have hmono := ae_antitone_cocycleVersion θ c hθ0 hc hθ + have hx := ae_of_ae_map measurable_fst.aemeasurable (hfst.ae_le hmono) + have hy := ae_of_ae_map measurable_snd.aemeasurable (hsnd.ae_le hmono) + filter_upwards [hx, hy, hpair] with xy hx hy hp n v + exact InvariantProjection.cocycle_two_ratio_bounds + (fun k => ProductCocycle.cocycleVersion θ c k xy.1) + (fun k => ProductCocycle.cocycleVersion θ c k xy.2) + (fun k => ProductCocycle.cocycleVersion_pos θ c k xy.1) + (fun k => ProductCocycle.cocycleVersion_pos θ c k xy.2) + hx hy (fun k => (hp.1 k).2) n v + +theorem coefficients_absolute_and_zero_of_pair (θ c : ℕ → ℝ) + (F : Base → Fiber →L[ℂ] Fiber) (x y : Base) + (hproj : IsStarProjection (F y)) + (hinv : (1 - F y) * WeightedShift.operator (actualWeightField θ c y) * F y = 0) + (hpair : PairIdentity θ c F (x, y)) (n : ℕ) + (hprod : ∀ k : ℤ, + (∏ j ∈ Finset.range n, weight θ c (rotationIterate θ (k + j) y)) = + ProductCocycle.cocycleVersion θ c n (rotationIterate θ k y)) + (hlaw : ∀ k : ℤ, + ProductCocycle.cocycleVersion θ c (k + n) y = + ProductCocycle.cocycleVersion θ c n (rotationIterate θ k y) * + ProductCocycle.cocycleVersion θ c k y) + (ξ η : Fiber) : + let A : ℤ → ℂ := fun v => F x ξ v / (ProductCocycle.cocycleVersion θ c v x : ℂ) + let B : ℤ → ℂ := fun v => (ProductCocycle.cocycleVersion θ c (-v) y : ℂ) * + star (((1 - F y) η) (-v)) + (Summable (fun v : ℤ => ‖A v * B (-(n : ℤ) - v)‖)) ∧ + (∑' v : ℤ, A v * B (-(n : ℤ) - v)) = 0 := by + let r : WeightedShift.Weight := ⟨fun k => (cocycleRatio θ c x y k : ℂ), + memℓp_infty ⟨1, by + rintro z ⟨k, rfl⟩ + simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (hpair.1 k).1] + using (hpair.1 k).2⟩⟩ + have hr : WeightedShift.diagonal r = ratioDiagonal θ c x y := + (boundedDiagonal_weight r).symm + have hp : (1 - F y) * WeightedShift.diagonal r * F x = 0 := by + rw [hr] + exact hpair.2 + apply OrbitInvariance.cocycle_coefficients_absolute_and_zero + (actualWeightField θ c y) r + (fun k => ProductCocycle.cocycleVersion θ c k x) + (fun k => ProductCocycle.cocycleVersion θ c k y) + hproj hinv hp n ξ η + intro v + change (∏ j ∈ Finset.range n, (weight θ c (rotationIterate θ (v + j) y) : ℂ)) * + ((ProductCocycle.cocycleVersion θ c v y / + ProductCocycle.cocycleVersion θ c v x : ℝ) : ℂ) = _ + rw [← Complex.ofReal_prod, hprod v, Complex.ofReal_div, ← mul_div_assoc, + ← Complex.ofReal_mul, ← hlaw v] + +theorem ae_coefficients_absolute_and_zero (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) + (p : Hilbert →L[ℂ] Hilbert) (F : Base → Fiber →L[ℂ] Fiber) + (hproj : ∀ x, IsStarProjection (F x)) + (hrep : ∀ f : Hilbert, p f =ᵐ[baseMeasure] fun x => F x (f x)) + (hinv : (1 - p) * weightedOperator θ c * p = 0) + (ν : Measure EndpointPair) (hsnd : ν.map Prod.snd ≪ baseMeasure) + (hpair : ∀ᵐ xy ∂ν, PairIdentity θ c F xy) (ξ η : Fiber) : + ∀ᵐ xy ∂ν, ∀ n : ℕ, + let A : ℤ → ℂ := fun v => F xy.1 ξ v / + (ProductCocycle.cocycleVersion θ c v xy.1 : ℂ) + let B : ℤ → ℂ := fun v => (ProductCocycle.cocycleVersion θ c (-v) xy.2 : ℂ) * + star (((1 - F xy.2) η) (-v)) + (Summable (fun v : ℤ => ‖A v * B (-(n : ℤ) - v)‖)) ∧ + (∑' v : ℤ, A v * B (-(n : ℤ) - v)) = 0 := by + have hInv := ae_of_ae_map measurable_snd.aemeasurable + (hsnd.ae_le (ae_actualWeightField_invariant θ c p F hrep hinv)) + obtain ⟨s, _hsm, hfull, _hinv, _hs, hlaw⟩ := + ProductCocycle.exists_invariant_cocycle_core θ hθ0 hθ + have hcore := ae_of_ae_map measurable_snd.aemeasurable (hsnd.ae_le hfull) + apply ae_all_iff.mpr + intro n + have hProd := ae_of_ae_map measurable_snd.aemeasurable + (hsnd.ae_le (ae_weight_orbit_product_eq_cocycleVersion θ c hθ0 hc hθ n)) + filter_upwards [hInv, hcore, hProd, hpair] with xy hi hs hp hxy + exact coefficients_absolute_and_zero_of_pair θ c F xy.1 xy.2 (hproj xy.2) + hi hxy n hp (fun k => hlaw xy.2 hs c k n) ξ η + +theorem ae_coefficients_absolute_sum_le (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) + (F : Base → Fiber →L[ℂ] Fiber) (hproj : ∀ x, IsStarProjection (F x)) + (ν : Measure EndpointPair) (hfst : ν.map Prod.fst ≪ baseMeasure) + (hsnd : ν.map Prod.snd ≪ baseMeasure) + (hpair : ∀ᵐ xy ∂ν, PairIdentity θ c F xy) (ξ η : Fiber) : + ∀ᵐ xy ∂ν, ∀ n : ℕ, + let A : ℤ → ℂ := fun v => F xy.1 ξ v / + (ProductCocycle.cocycleVersion θ c v xy.1 : ℂ) + let B : ℤ → ℂ := fun v => (ProductCocycle.cocycleVersion θ c (-v) xy.2 : ℂ) * + star (((1 - F xy.2) η) (-v)) + (∑' v : ℤ, ‖A v * B (-(n : ℤ) - v)‖) ≤ ‖ξ‖ * ‖η‖ := by + filter_upwards [ae_convolution_two_ratio_bounds θ c hθ0 hc hθ F ν hfst hsnd hpair] + with xy hratio n + dsimp only + have hbound := InvariantProjection.l2_reindexed_multiplier_bound + (F xy.1 ξ) ((1 - F xy.2) η) (Equiv.addLeft (n : ℤ)) + (fun v => ProductCocycle.cocycleVersion θ c ((n : ℤ) + v) xy.2 / + ProductCocycle.cocycleVersion θ c v xy.1) + (fun v => ⟨(hratio n v).1.le, (hratio n v).2.1.trans (hratio n v).2.2⟩) + have hξ : ‖F xy.1 ξ‖ ≤ ‖ξ‖ := by + simpa only [one_mul] using (F xy.1).le_of_opNorm_le + (IsStarProjection.norm_le _ (hproj xy.1)) ξ + have hη : ‖(1 - F xy.2) η‖ ≤ ‖η‖ := by + simpa only [one_mul] using (1 - F xy.2).le_of_opNorm_le + (IsStarProjection.norm_le _ (hproj xy.2).one_sub) η + have hsum := hbound.2.trans (mul_le_mul hξ hη (norm_nonneg _) (norm_nonneg _)) + convert hsum using 1 + try rfl + apply tsum_congr + intro v + congr 1 + rw [show -(-(n : ℤ) - v) = (n : ℤ) + v by omega] + exact InvariantProjection.convolution_coefficient_factorization + (fun k => ProductCocycle.cocycleVersion θ c k xy.1) + (fun k => ProductCocycle.cocycleVersion θ c k xy.2) + (F xy.1 ξ) ((1 - F xy.2) η) n v + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductCoordinateSplit.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCoordinateSplit.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e4e10da2bb6e7df133e32d736a4dfd3e55a4348 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCoordinateSplit.lean @@ -0,0 +1,61 @@ +import Mathlib.Probability.ProductMeasure +import Mathlib.Tactic + +namespace OAI + +noncomputable section +open MeasureTheory MeasureTheory.Measure Set +open scoped ENNReal BigOperators + +namespace Invariant233.ProductCoordinateSplit + +variable {ι : Type*} {X : ι → Type*} [∀ i, MeasurableSpace (X i)] + +theorem measurePreserving_split + (μ : (i : ι) → Measure (X i)) [∀ i, IsProbabilityMeasure (μ i)] + (p : ι → Prop) [DecidablePred p] : + MeasurePreserving (MeasurableEquiv.piEquivPiSubtypeProd X p) + (Measure.infinitePi μ) + ((Measure.infinitePi fun i : Subtype p => μ i).prod + (Measure.infinitePi fun i : {i // ¬ p i} => μ i)) := by + classical + let e := (MeasurableEquiv.piEquivPiSubtypeProd X p).symm + apply MeasurePreserving.symm e + refine ⟨e.measurable, ?_⟩ + apply Measure.eq_infinitePi + intro s t ht + have heq : e ⁻¹' Set.pi (s : Set ι) t = + (Set.pi (s.subtype p) (fun i : Subtype p => t i)) ×ˢ + (Set.pi (s.subtype (fun i => ¬ p i)) (fun i : {i // ¬p i} => t i)) := by + ext x + simp only [Set.mem_preimage, Set.mem_pi, Finset.mem_coe, Set.mem_prod, + Finset.mem_subtype] + constructor + · intro h + constructor + · intro i hi + have := h i hi + simpa [e, MeasurableEquiv.piEquivPiSubtypeProd, Equiv.piEquivPiSubtypeProd, i.property] + using this + · intro i hi + have := h i hi + simpa [e, MeasurableEquiv.piEquivPiSubtypeProd, Equiv.piEquivPiSubtypeProd, i.property] + using this + · rintro ⟨hpos, hneg⟩ i hi + by_cases hip : p i + · simpa [e, MeasurableEquiv.piEquivPiSubtypeProd, Equiv.piEquivPiSubtypeProd, hip] + using hpos ⟨i, hip⟩ hi + · simpa [e, MeasurableEquiv.piEquivPiSubtypeProd, Equiv.piEquivPiSubtypeProd, hip] + using hneg ⟨i, hip⟩ hi + rw [e.map_apply, heq, Measure.prod_prod, + Measure.infinitePi_pi (fun i : Subtype p => μ i) (fun i _ => ht i), + Measure.infinitePi_pi (fun i : {i // ¬p i} => μ i) (fun i _ => ht i)] + rw [Finset.prod_subtype_eq_prod_filter (s := s) (p := p) (fun i => μ i (t i)), + Finset.prod_subtype_eq_prod_filter (s := s) (p := fun i => ¬p i) (fun i => μ i (t i)), + Finset.prod_filter_mul_prod_filter_not] + +end Invariant233.ProductCoordinateSplit + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductCovariance.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..2867a7848599a53fa88b52bd41d0a3badd62526d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductCovariance.lean @@ -0,0 +1,130 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductFields +import OAI.Analysis.IrrationalRotation.Product.ProductCocycle +import OAI.Analysis.IrrationalRotation.Analysis.FieldKoopmanGenerated +import OAI.Analysis.IrrationalRotation.Analysis.FieldCovariance + +namespace OAI + +noncomputable section +open MeasureTheory Filter + +namespace Invariant233.ProductModel + +@[simp] theorem rotationIterate_zero (θ : ℕ → ℝ) (x : Base) : + rotationIterate θ 0 x = x := ProductCocycle.rotate_zero θ x + +theorem rotationIterate_add (θ : ℕ → ℝ) (m n : ℤ) (x : Base) : + rotationIterate θ (m + n) x = rotationIterate θ n (rotationIterate θ m x) := + ProductCocycle.rotate_add θ m n x + +theorem rotationIterate_measurePreserving (θ : ℕ → ℝ) (m : ℤ) : + MeasurePreserving (rotationIterate θ m) baseMeasure baseMeasure := + ProductCocycle.measurePreserving_rotate θ m + +theorem shiftedPullback_mem_unitary (θ : ℕ → ℝ) (m : ℤ) : + DirectIntegral.shiftedPullback + (WeightedShift.shift m).toLinearIsometry.toContinuousLinearMap + (rotationIterate θ m) (rotationIterate_measurePreserving θ m) ∈ + unitary (Hilbert →L[ℂ] Hilbert) := by + apply FieldKoopman.operator_mem_unitary (WeightedShift.shift m) + (rotationIterate θ m) (rotationIterate θ (-m)) + · exact rotationIterate_measurePreserving θ (-m) + · funext x + change rotationIterate θ (-m) (rotationIterate θ m x) = x + rw [← rotationIterate_add] + simp + · funext x + change rotationIterate θ m (rotationIterate θ (-m) x) = x + rw [← rotationIterate_add] + simp + +theorem multiplier_commutes_shiftedPullback (θ : ℕ → ℝ) + (g : Base → ℂ) (C : ℝ) (hC : 0 ≤ C) (hg : Measurable g) + (hb : ∀ x, ‖g x‖ ≤ C) (m : ℤ) : + Commute (multiplier θ g C hC hg hb) + (DirectIntegral.shiftedPullback + (WeightedShift.shift m).toLinearIsometry.toContinuousLinearMap + (rotationIterate θ m) (rotationIterate_measurePreserving θ m)) := by + unfold multiplier + apply FieldKoopman.commute_fieldDiagonal + apply Filter.Eventually.of_forall + intro x k + change g (rotationIterate θ (k - m) (rotationIterate θ m x)) = + g (rotationIterate θ k x) + rw [← rotationIterate_add] + congr 2 + omega + +theorem commute_shiftedPullback_of_mem_factor (θ : ℕ → ℝ) + {T : Hilbert →L[ℂ] Hilbert} (hT : T ∈ factor θ) (m : ℤ) : + Commute T (DirectIntegral.shiftedPullback + (WeightedShift.shift m).toLinearIsometry.toContinuousLinearMap + (rotationIterate θ m) (rotationIterate_measurePreserving θ m)) := by + apply FieldKoopman.commute_of_mem_generated_of_unitary + ({shiftOperator} ∪ multiplierGenerators θ) (shiftedPullback_mem_unitary θ m) _ hT + intro A hA + rcases hA with hA | hA + · rcases Set.mem_singleton_iff.mp hA with rfl + exact FieldKoopman.commute_fieldShifts 1 m _ _ + · obtain ⟨g, C, hC, hg, hb, rfl⟩ := hA + exact multiplier_commutes_shiftedPullback θ g C hC hg hb m + +theorem field_matrix_covariance {θ : ℕ → ℝ} {T : Hilbert →L[ℂ] Hilbert} + (hT : T ∈ factor θ) (F : Base → Fiber →L[ℂ] Fiber) + (hF : ∀ ξ : Hilbert, T ξ =ᵐ[baseMeasure] fun x => F x (ξ x)) : + ∀ m k l : ℤ, ∀ᵐ x ∂baseMeasure, + inner ℂ ((default : HilbertBasis ℤ ℂ Fiber) k) + (F (rotationIterate θ m x) ((default : HilbertBasis ℤ ℂ Fiber) l)) = + inner ℂ ((default : HilbertBasis ℤ ℂ Fiber) (k + m)) + (F x ((default : HilbertBasis ℤ ℂ Fiber) (l + m))) := by + apply FieldTraceCyclic.ae_matrix_covariance_of_commute + (default : HilbertBasis ℤ ℂ Fiber) T F + (fun m => DirectIntegral.shiftedPullback + (WeightedShift.shift m).toLinearIsometry.toContinuousLinearMap + (rotationIterate θ m) (rotationIterate_measurePreserving θ m)) + (fun m => (WeightedShift.shift m).toLinearIsometry) + (rotationIterate θ) (rotationIterate_measurePreserving θ) + · exact FieldKoopman.shift_default_basis + · exact hF + · intro m + exact FieldTraceCyclic.shiftedPullback_ae _ _ _ + · exact commute_shiftedPullback_of_mem_factor θ hT + +theorem field_covariance {θ : ℕ → ℝ} {T : Hilbert →L[ℂ] Hilbert} + (hT : T ∈ factor θ) (F : Base → Fiber →L[ℂ] Fiber) + (hF : ∀ ξ : Hilbert, T ξ =ᵐ[baseMeasure] fun x => F x (ξ x)) : + ∀ᵐ x ∂baseMeasure, ∀ m : ℤ, + F x * (WeightedShift.shift m).toLinearIsometry.toContinuousLinearMap = + (WeightedShift.shift m).toLinearIsometry.toContinuousLinearMap * + F (rotationIterate θ m x) := by + let := HilbertModelSize.separable_of_countable_hilbertBasis + (default : HilbertBasis ℤ ℂ Fiber) + apply ae_all_iff.mpr + intro m + exact FieldTraceCyclic.ae_covariance_of_commute T _ F _ _ + (rotationIterate_measurePreserving θ m) hF + (FieldTraceCyclic.shiftedPullback_ae _ _ _) + (commute_shiftedPullback_of_mem_factor θ hT m) + +theorem field_conjugacy {θ : ℕ → ℝ} {T : Hilbert →L[ℂ] Hilbert} + (hT : T ∈ factor θ) (F : Base → Fiber →L[ℂ] Fiber) + (hF : ∀ ξ : Hilbert, T ξ =ᵐ[baseMeasure] fun x => F x (ξ x)) : + ∀ᵐ x ∂baseMeasure, ∀ m : ℤ, + F (rotationIterate θ m x) = + (WeightedShift.shift (-m)).toLinearIsometry.toContinuousLinearMap * F x * + (WeightedShift.shift m).toLinearIsometry.toContinuousLinearMap := by + filter_upwards [field_covariance hT F hF] with x hx m + have hinv : (WeightedShift.shift (-m)).toLinearIsometry.toContinuousLinearMap * + (WeightedShift.shift m).toLinearIsometry.toContinuousLinearMap = 1 := by + rw [← WeightedShift.shift_add] + simp [WeightedShift.shift_zero] + have heq := congrArg + (fun A : Fiber →L[ℂ] Fiber => + (WeightedShift.shift (-m)).toLinearIsometry.toContinuousLinearMap * A) (hx m) + simpa only [← mul_assoc, hinv, one_mul] using heq.symm + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductDenseRange.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductDenseRange.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e7cb3679a7d0a866d65525cabd3d9cc3ca64cf8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductDenseRange.lean @@ -0,0 +1,76 @@ +import OAI.Analysis.IrrationalRotation.Operators.DenseOperatorRange +import OAI.Analysis.IrrationalRotation.Spectral.ProductWeightPolar +import OAI.Analysis.IrrationalRotation.Spectral.ProductPolarModulus +import OAI.Analysis.IrrationalRotation.Spectral.ProductQuasinilpotent + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Invariant233.ProductModel + +theorem weight_multiplier_selfAdjoint (θ c : ℕ → ℝ) : + IsSelfAdjoint (star shiftOperator * weightedOperator θ c) := by + rw [star_shift_weightedOperator_eq_multiplier] + exact IsSelfAdjoint.of_nonneg (realMultiplier_nonneg θ (weight θ c) 1 + (by norm_num) (measurable_weight θ c) (weight_complex_norm_le_one θ c) + (fun x => (weight_mem_Icc θ c x).1)) + +theorem weightedOperator_injective (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) : + Function.Injective (weightedOperator θ c) := by + intro ξ η hξη + apply weight_multiplier_injective θ c hθ0 hc hθ + change star shiftOperator (weightedOperator θ c ξ) = + star shiftOperator (weightedOperator θ c η) + rw [hξη] + +theorem weight_multiplier_denseRange (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) : + DenseRange (star shiftOperator * weightedOperator θ c) := + OperatorRange.denseRange_of_selfAdjoint_injective _ + (weight_multiplier_selfAdjoint θ c) (weight_multiplier_injective θ c hθ0 hc hθ) + +theorem weightedOperator_denseRange (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) : + DenseRange (weightedOperator θ c) := by + have hU : shiftOperator ∈ unitary (Hilbert →L[ℂ] Hilbert) := + WeightedShift.fieldShift_mem_unitary 1 + have hd := (OperatorRange.unitary_mul_selfAdjoint_range shiftOperator + (star shiftOperator * weightedOperator θ c) hU + (weight_multiplier_selfAdjoint θ c) + (weight_multiplier_injective θ c hθ0 hc hθ)).2 + simpa only [← mul_assoc, (Unitary.mem_iff.mp hU).2, one_mul] using hd + +theorem weightedOperator_not_surjective (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) + (hdiv : (∑' i, ENNReal.ofReal (c i * θ i)) = ∞) : + ¬ Function.Surjective (weightedOperator θ c) := by + apply OperatorRange.not_surjective_of_zero_mem_spectrum _ + (weightedOperator_injective θ c hθ0 hc hθ) + rw [weightedOperator_spectrum_eq_singleton_zero θ c hθ0 hc hθ hdiv] + exact Set.mem_singleton 0 + +theorem weightedOperator_range_not_closed (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) + (hdiv : (∑' i, ENNReal.ofReal (c i * θ i)) = ∞) : + ¬ IsClosed (Set.range (weightedOperator θ c)) := + OperatorRange.not_isClosed_range_of_dense_not_surjective _ + (weightedOperator_denseRange θ c hθ0 hc hθ) + (weightedOperator_not_surjective θ c hθ0 hc hθ hdiv) + +theorem weightedOperator_eigenvector_eq_zero (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) + (hdiv : (∑' i, ENNReal.ofReal (c i * θ i)) = ∞) + (z : ℂ) (ξ : Hilbert) (hξ : weightedOperator θ c ξ = z • ξ) : ξ = 0 := + OperatorRange.eq_zero_of_eigenvector_of_spectrum_zero _ + (weightedOperator_injective θ c hθ0 hc hθ) + (weightedOperator_spectrum_eq_singleton_zero θ c hθ0 hc hθ hdiv) z ξ hξ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductDiffuse.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductDiffuse.lean new file mode 100644 index 0000000000000000000000000000000000000000..19226eac81f9ba66170adcfc70df8aeda50ab093 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductDiffuse.lean @@ -0,0 +1,127 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductMultiplierFunctionalCalculus +import OAI.Analysis.IrrationalRotation.Product.ProductScalarity +import OAI.Analysis.IrrationalRotation.Product.ProductTracialVector +import OAI.Analysis.IrrationalRotation.Analysis.DiffuseFromSmallPartitions +import Mathlib.MeasureTheory.Measure.Regular + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped Topology ENNReal +namespace Invariant233.ProductModel + +def borelSetProjection (θ : ℕ → ℝ) (s : Set Base) (hs : MeasurableSet s) : + Hilbert →L[ℂ] Hilbert := + multiplier θ (s.indicator (fun _ => (1 : ℂ))) 1 zero_le_one + (measurable_const.indicator hs) (by + intro x + by_cases hx : x ∈ s <;> simp [hx]) + +theorem borelSetProjection_mem (θ : ℕ → ℝ) (s : Set Base) (hs : MeasurableSet s) : + borelSetProjection θ s hs ∈ factor θ := + subset_vonNeumannGenerated _ (Or.inr ⟨_, _, _, _, _, rfl⟩) + +theorem borelSetProjection_isStarProjection (θ : ℕ → ℝ) (s : Set Base) + (hs : MeasurableSet s) : IsStarProjection (borelSetProjection θ s hs) := by + constructor + · change borelSetProjection θ s hs * borelSetProjection θ s hs = borelSetProjection θ s hs + symm + apply WeightedShift.fieldDiagonal_mul_of_coeff_eq + exact Eventually.of_forall fun x k => by + change s.indicator (fun _ => (1 : ℂ)) (rotationIterate θ k x) = + s.indicator (fun _ => (1 : ℂ)) (rotationIterate θ k x) * + s.indicator (fun _ => (1 : ℂ)) (rotationIterate θ k x) + by_cases hx : rotationIterate θ k x ∈ s <;> simp [hx] + · change star (borelSetProjection θ s hs) = borelSetProjection θ s hs + symm + apply WeightedShift.fieldDiagonal_star_of_eq + exact Eventually.of_forall fun x => lp.ext (funext fun k => by + change s.indicator (fun _ => (1 : ℂ)) (rotationIterate θ k x) = + star (s.indicator (fun _ => (1 : ℂ)) (rotationIterate θ k x)) + by_cases hx : rotationIterate θ k x ∈ s <;> simp [hx]) + +theorem vectorTrace_borelSetProjection (θ : ℕ → ℝ) (s : Set Base) (hs : MeasurableSet s) : + vectorTrace traceVector (borelSetProjection θ s hs) = (baseMeasure.real s : ℂ) := by + unfold borelSetProjection + rw [vectorTrace_multiplier, integral_indicator hs, integral_const] + simp [Measure.real] + +theorem borelSetProjection_joint_kernel {ι : Type*} [Fintype ι] + (θ : ℕ → ℝ) (s : ι → Set Base) (hs : ∀ i, MeasurableSet (s i)) + (hcover : ∀ x : Base, ∃ i, x ∈ s i) (v : Hilbert) + (hv : ∀ i, borelSetProjection θ (s i) (hs i) v = 0) : v = 0 := by + have hcoord : ∀ i, ∀ᵐ x ∂baseMeasure, ∀ k : ℤ, + (s i).indicator (fun _ => (1 : ℂ)) (rotationIterate θ k x) * v x k = 0 := by + intro i + have h := multiplier_coordinates_ae θ + ((s i).indicator (fun _ => (1 : ℂ))) 1 zero_le_one + (measurable_const.indicator (hs i)) (by intro x; by_cases hx : x ∈ s i <;> simp [hx]) v + change ∀ᵐ x ∂baseMeasure, ∀ k, + borelSetProjection θ (s i) (hs i) v x k = _ at h + rw [hv i] at h + filter_upwards [h, Lp.coeFn_zero Fiber 2 baseMeasure] with x hx hz + intro k + simpa [hz] using (hx k).symm + apply Lp.ext + filter_upwards [ae_all_iff.mpr hcoord, Lp.coeFn_zero Fiber 2 baseMeasure] with x hx hz + rw [hz] + apply lp.ext + funext k + obtain ⟨i, hi⟩ := hcover (rotationIterate θ k x) + simpa [hi] using hx i k + +theorem factor_isDiffuse (θ : ℕ → ℝ) : IsDiffuseVonNeumannAlgebra (factor θ) := by + classical + apply isDiffuse_of_small_trace_separating_families (factor θ) traceVector (traceVector_faithfulTracial θ) + intro ε hε + have hsmall (x : Base) : ∃ U : Set Base, x ∈ U ∧ IsOpen U ∧ baseMeasure U < ENNReal.ofReal ε := by + obtain ⟨U, hxU, hU, hm⟩ := isCompact_singleton.exists_isOpen_lt_of_lt + (μ := baseMeasure) (K := {x}) (ENNReal.ofReal ε) (by + have hz0 : circleMeasure {x 0} = 0 := by + change volume {x 0} = 0 + rw [← Metric.closedBall_zero, AddCircle.volume_closedBall] + norm_num + have hz : baseMeasure {x} = 0 := by + apply le_antisymm _ (by positivity) + calc + baseMeasure {x} ≤ baseMeasure ((fun y : Base => y 0) ⁻¹' {x 0}) := by + apply measure_mono + intro y hy + change y 0 = x 0 + exact congrArg (fun z : Base => z 0) (Set.mem_singleton_iff.mp hy) + _ = circleMeasure {x 0} := by + exact (measurePreserving_eval_infinitePi (fun _ : ℕ => circleMeasure) 0).measure_preimage + (measurableSet_singleton (x 0)).nullMeasurableSet + _ = 0 := hz0 + rw [hz] + exact ENNReal.ofReal_pos.mpr hε) + exact ⟨U, hxU (Set.mem_singleton x), hU, hm⟩ + choose U hxU hU hm using hsmall + obtain ⟨t, ht⟩ := isCompact_univ.elim_finite_subcover U hU (by + intro x hx + exact mem_iUnion.mpr ⟨x, hxU x⟩) + let e := Fintype.equivFin t + let s : Fin (Fintype.card t) → Set Base := fun i => U (e.symm i) + have hs : ∀ i, MeasurableSet (s i) := fun i => (hU (e.symm i)).measurableSet + refine ⟨Fintype.card t, fun i => borelSetProjection θ (s i) (hs i), + fun i => borelSetProjection_mem θ (s i) (hs i), + fun i => borelSetProjection_isStarProjection θ (s i) (hs i), ?_, ?_⟩ + · intro i + rw [vectorTrace_borelSetProjection] + change (baseMeasure (s i)).toReal < ε + exact (ENNReal.toReal_lt_of_lt_ofReal (hm (e.symm i))) + · apply borelSetProjection_joint_kernel θ s hs + intro x + obtain ⟨y, hy, hxy⟩ := mem_iUnion₂.mp (ht (mem_univ x)) + exact ⟨e ⟨y, hy⟩, by simpa only [s, Equiv.symm_apply_apply] using hxy⟩ + +theorem factor_isTypeII1FactorWithVector (θ : ℕ → ℝ) (hθ : JointlyRationallyIndependent θ) : + IsTypeII1FactorWithVector (factor θ) traceVector := + ⟨factor_isFactor θ hθ, factor_isDiffuse θ, traceVector_faithfulTracial θ⟩ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductErgodicity.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductErgodicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..2f2849274c1581280a04c0e289f0f2a98712085b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductErgodicity.lean @@ -0,0 +1,83 @@ +import OAI.Analysis.IrrationalRotation.Sampling.ProductCharacters +import OAI.Analysis.IrrationalRotation.Product.IndependentRotation +import OAI.Analysis.IrrationalRotation.Sampling.ErgodicCharacterCriterion +import Mathlib.Probability.ProductMeasure +import Mathlib.MeasureTheory.Constructions.Polish.Basic + +namespace OAI + +namespace InvariantProjection.ProductRotation + +open MeasureTheory + +variable {ι : Type*} + +theorem integer_affine_independent {θ : ι → ℝ} + (hθ : LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ)) + (v : ι →₀ ℤ) (m : ℤ) + (heq : v.sum (fun i z => (z : ℝ) * θ i) = m) : v = 0 := by + by_contra hv + exact (Invariant233.IndependentRotation.irrational_finsupp_int_sum hθ v hv).ne_int m heq + +theorem measurePreserving_product_translation (a : ι → UnitAddCircle) : + MeasurePreserving (fun x : ι → UnitAddCircle => x + a) + (Measure.infinitePi (fun _ : ι => (volume : Measure UnitAddCircle))) + (Measure.infinitePi (fun _ : ι => (volume : Measure UnitAddCircle))) := by + let : IsProbabilityMeasure (volume : Measure UnitAddCircle) := + ⟨UnitAddCircle.measure_univ⟩ + have hcoord (i : ι) : MeasurePreserving + (fun x : UnitAddCircle => x + a i) volume volume := + measurePreserving_add_right volume _ + refine ⟨Measurable.of_eval (fun i => (measurable_pi_apply i).add_const _), ?_⟩ + change (Measure.infinitePi (fun _ : ι => (volume : Measure UnitAddCircle))).map + (fun x i => x i + a i) = _ + rw [Measure.infinitePi_map_pi _ (fun i => (hcoord i).measurable)] + simp only [(hcoord _).map_eq] + +theorem product_rotation_integer_ergodic [Countable ι] {θ : ι → ℝ} + (hθ : LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ)) + {q : ℤ} (hq : q ≠ 0) : + Ergodic (fun x : ι → UnitAddCircle => + fun i => x i + (((q : ℝ) * θ i : ℝ) : UnitAddCircle)) + (Measure.infinitePi (fun _ : ι => (volume : Measure UnitAddCircle))) := by + let : IsProbabilityMeasure (volume : Measure UnitAddCircle) := + ⟨UnitAddCircle.measure_univ⟩ + apply Invariant233.Characters.ergodic_of_dense_continuous_eigenfunctions + (measurePreserving_product_translation (fun i => (((q : ℝ) * θ i : ℝ) : UnitAddCircle))) + (0 : ι →₀ ℤ) productCharacter + (fun v => productCharacter v (fun i => (((q : ℝ) * θ i : ℝ) : UnitAddCircle))) + productCharacter_zero span_productCharacter_closure_eq_top + · intro v hv + exact productCharacter_ne_one θ (integer_affine_independent hθ) hv hq + · intro v _ x + exact productCharacter_translation v θ q x + +theorem product_rotation_ergodic [Countable ι] {θ : ι → ℝ} + (hθ : LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ)) : + Ergodic (fun x : ι → UnitAddCircle => fun i => x i + (θ i : UnitAddCircle)) + (Measure.infinitePi (fun _ : ι => (volume : Measure UnitAddCircle))) := by + simpa only [Int.cast_one, one_mul] using + product_rotation_integer_ergodic hθ (q := 1) one_ne_zero + +theorem product_rotation_totalErgodic [Countable ι] {θ : ι → ℝ} + (hθ : LinearIndependent ℚ (fun o : Option ι => o.elim 1 θ)) + {n : ℕ} (hn : 0 < n) : + Ergodic (fun x : ι → UnitAddCircle => fun i => x i + (θ i : UnitAddCircle))^[n] + (Measure.infinitePi (fun _ : ι => (volume : Measure UnitAddCircle))) := by + change Ergodic (fun x : ι → UnitAddCircle => x + fun i => (θ i : UnitAddCircle))^[n] _ + rw [add_right_iterate] + have hcoe : (fun i => (((n : ℝ) * θ i : ℝ) : UnitAddCircle)) = + n • (fun i => (θ i : UnitAddCircle)) := by + funext i + simpa only [Pi.smul_apply, nsmul_eq_mul] using + (AddCircle.coe_nsmul (p := (1 : ℝ)) (n := n) (x := θ i)) + have he := product_rotation_integer_ergodic hθ (q := (n : ℤ)) + (by exact_mod_cast Nat.ne_of_gt hn) + simp only [Int.cast_natCast] at he + change Ergodic (fun x : ι → UnitAddCircle => + x + (fun i => (((n : ℝ) * θ i : ℝ) : UnitAddCircle))) _ at he + rwa [hcoe] at he + +end InvariantProjection.ProductRotation + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductFactorComplete.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFactorComplete.lean new file mode 100644 index 0000000000000000000000000000000000000000..22c300171f3d67c71677b5e6f46590de23773e2c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFactorComplete.lean @@ -0,0 +1,32 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductFieldConverse +import OAI.Analysis.IrrationalRotation.Product.ProductDiffuse +import OAI.Analysis.IrrationalRotation.Analysis.ConcretePredualModels + +namespace OAI + +noncomputable section +namespace Invariant233.ProductModel + +theorem factor_complete (θ : ℕ → ℝ) + (hθ : ProductModel.JointlyRationallyIndependent θ) : + IsTypeII1FactorWithVector (ProductModel.factor θ) ProductModel.traceVector ∧ + HasSeparablePredual (ProductModel.factor θ) ∧ + (∀ A : ProductModel.Hilbert →L[ℂ] ProductModel.Hilbert, + A ∈ ProductModel.factor θ ↔ + ∃ (F : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber) + (B : ℝ), ProductModel.IsCovariantFieldRepresentation θ A F B) ∧ + (∀ (A : ProductModel.Hilbert →L[ℂ] ProductModel.Hilbert) + (F : ProductModel.Base → ProductModel.Fiber →L[ℂ] ProductModel.Fiber) (B : ℝ), + ProductModel.IsCovariantFieldRepresentation θ A F B → + vectorTrace ProductModel.traceVector A = ProductModel.centralDiagonalIntegral F) := by + refine ⟨factor_isTypeII1FactorWithVector θ hθ, + factor_hasSeparablePredual θ, + mem_factor_iff_covariantFieldRepresentation θ, ?_⟩ + intro A F B h + exact h.vectorTrace_eq + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductFactorCovariance.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFactorCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..830f3d7c80a7770514daa5b65de52bd9f9ee5b67 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFactorCovariance.lean @@ -0,0 +1,109 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductFields +import OAI.Analysis.IrrationalRotation.Rotation.FieldDiagonal +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplierFields +import OAI.Analysis.IrrationalRotation.Analysis.GeneratedVonNeumann +import OAI.Analysis.IrrationalRotation.Analysis.FieldCovariance +import OAI.Analysis.IrrationalRotation.Product.ProductBaseDynamics + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal +namespace Invariant233.ProductModel + +local notation "S" => LinearIsometry.toContinuousLinearMap + (LinearIsometryEquiv.toLinearIsometry (WeightedShift.shift 1)) + +theorem multiplier_star (θ : ℕ → ℝ) (g : Base → ℂ) (C : ℝ) (hC : 0 ≤ C) + (hg : Measurable g) (hb : ∀ x, ‖g x‖ ≤ C) : + star (multiplier θ g C hC hg hb) = + multiplier θ (fun x => star (g x)) C hC (continuous_star.measurable.comp hg) + (fun x => (norm_star (g x)).le.trans (hb x)) := by + symm + apply WeightedShift.fieldDiagonal_star_of_eq + exact Eventually.of_forall fun x => by + ext k + rfl + +private theorem commute_star_of_unitary {A B : Hilbert →L[ℂ] Hilbert} + (hA : A ∈ unitary (Hilbert →L[ℂ] Hilbert)) (hAB : Commute A B) : + Commute (star A) B := by + obtain ⟨h₁, h₂⟩ := Unitary.mem_iff.mp hA + show star A * B = B * star A + calc + star A * B = star A * (B * (A * star A)) := by rw [h₂, mul_one] + _ = star A * ((A * B) * star A) := by rw [← mul_assoc B A, ← hAB.eq] + _ = (star A * A) * (B * star A) := by simp only [mul_assoc] + _ = B * star A := by rw [h₁, one_mul] + +theorem rotationIterate_comp (θ : ℕ → ℝ) (m n : ℤ) (x : Base) : + rotationIterate θ n (rotationIterate θ m x) = rotationIterate θ (m + n) x := by + funext i + simp only [rotationIterate, Int.cast_add, add_mul, AddCircle.coe_add, add_assoc] + +theorem factor_commutes_shiftedPullback (θ : ℕ → ℝ) (r : ℤ) + (T : Hilbert →L[ℂ] Hilbert) (hT : T ∈ factor θ) : + Commute T (DirectIntegral.shiftedPullback + (WeightedShift.shift r).toLinearIsometry.toContinuousLinearMap + (rotationIterate θ r) (measurePreserving_rotationIterate θ r)) := by + let Sr := (WeightedShift.shift r).toLinearIsometry.toContinuousLinearMap + let J := DirectIntegral.shiftedPullback Sr (rotationIterate θ r) + (measurePreserving_rotationIterate θ r) + have hSJ : Commute shiftOperator J := by + apply FieldTraceCyclic.commute_shiftedPullback_of_covariance + shiftOperator (fun _ => S) Sr (rotationIterate θ r) + (measurePreserving_rotationIterate θ r) shiftOperator_ae + apply Eventually.of_forall + intro x + dsimp [Sr] + rw [← WeightedShift.shift_add, ← WeightedShift.shift_add, add_comm] + have hDJ (g : Base → ℂ) (C : ℝ) (hC : 0 ≤ C) + (hg : Measurable g) (hb : ∀ x, ‖g x‖ ≤ C) : + Commute (multiplier θ g C hC hg hb) J := by + apply FieldTraceCyclic.commute_shiftedPullback_of_covariance + (multiplier θ g C hC hg hb) + (fun x => WeightedShift.diagonal (multiplierField θ g C hb x)) + Sr (rotationIterate θ r) (measurePreserving_rotationIterate θ r) + (multiplier_ae θ g C hC hg hb) + apply Eventually.of_forall + intro x + ext v k + change g (rotationIterate θ k x) * v (k - r) = + g (rotationIterate θ (k - r) (rotationIterate θ r x)) * v (k - r) + rw [rotationIterate_comp] + congr 3 + omega + have hJ : J ∈ (factor θ).commutant := by + apply (mem_commutant_vonNeumannGenerated_iff _ _).mpr + intro A hA + rcases hA with hA | hA + · have hA' : A = shiftOperator := Set.mem_singleton_iff.mp hA + subst A + exact ⟨hSJ.eq, + (commute_star_of_unitary (WeightedShift.fieldShift_mem_unitary 1) hSJ).eq⟩ + · obtain ⟨g, C, hC, hg, hb, rfl⟩ := hA + refine ⟨(hDJ g C hC hg hb).eq, ?_⟩ + rw [multiplier_star] + exact (hDJ _ C hC _ _).eq + exact (VonNeumannAlgebra.mem_commutant_iff.mp hJ) T hT + +theorem ae_covariance_of_mem_factor (θ : ℕ → ℝ) + (T : Hilbert →L[ℂ] Hilbert) (hT : T ∈ factor θ) + (A : Base → Fiber →L[ℂ] Fiber) + (hrep : ∀ f : Hilbert, T f =ᵐ[baseMeasure] fun x => A x (f x)) (r : ℤ) : + ∀ᵐ x ∂baseMeasure, + A x * (WeightedShift.shift r).toLinearIsometry.toContinuousLinearMap = + (WeightedShift.shift r).toLinearIsometry.toContinuousLinearMap * + A (rotationIterate θ r x) := by + let : TopologicalSpace.SeparableSpace Fiber := HilbertModelSize.separable_l2 ℤ + exact FieldTraceCyclic.ae_covariance_of_commute T _ A _ _ + (measurePreserving_rotationIterate θ r) hrep + (FieldTraceCyclic.shiftedPullback_ae _ _ _) + (factor_commutes_shiftedPullback θ r T hT) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductFactorSource.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFactorSource.lean new file mode 100644 index 0000000000000000000000000000000000000000..c1f90217296bc7bb34eddc0f49f4dd97dc05a5b2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFactorSource.lean @@ -0,0 +1,32 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductFactorStructure + +namespace OAI + +noncomputable section +open MeasureTheory +namespace Invariant233.ProductModel + +theorem vectorTrace_eq_centralDiagonalIntegral + (A : Hilbert →L[ℂ] Hilbert) (F : Base → Fiber →L[ℂ] Fiber) + (hA : ∀ f : Hilbert, A f =ᵐ[baseMeasure] fun x => F x (f x)) : + vectorTrace traceVector A = centralDiagonalIntegral F := by + unfold vectorTrace traceVector centralDiagonalIntegral + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [Lp.coeFn_const 2 baseMeasure (lp.single 2 0 (1 : ℂ) : Fiber), + hA (Lp.const 2 baseMeasure (lp.single 2 0 (1 : ℂ) : Fiber))] with x hx hAx + rw [hAx, hx] + rfl + +theorem IsCovariantFieldRepresentation.vectorTrace_eq + {θ : ℕ → ℝ} {A : Hilbert →L[ℂ] Hilbert} + {F : Base → Fiber →L[ℂ] Fiber} {B : ℝ} + (h : IsCovariantFieldRepresentation θ A F B) : + vectorTrace traceVector A = centralDiagonalIntegral F := + vectorTrace_eq_centralDiagonalIntegral A F h.2.2.2.1 + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductFieldConverse.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFieldConverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..4abdb4d031f005b994a003930374cf8b767434a4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFieldConverse.lean @@ -0,0 +1,38 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductGaugeFourier +import OAI.Analysis.IrrationalRotation.Analysis.StrongFourierRecovery + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.ProductModel + +theorem IsCovariantFieldRepresentation.mem_factor + {θ : ℕ → ℝ} {A : Hilbert →L[ℂ] Hilbert} + {F : Base → Fiber →L[ℂ] Fiber} {B : ℝ} + (h : IsCovariantFieldRepresentation θ A F B) : A ∈ factor θ := by + have hm := StrongFourierRecovery.mem_of_fourier_modes (factor θ) + (DiagonalGauge.conjugate baseMeasure A) + (DiagonalGauge.continuous_conjugate_apply baseMeasure A) + (fun r => h.matrixDiagonal (-r)) + h.matrixDiagonal_neg_apply_integral + (fun r => h.matrixDiagonal_mem_factor (-r)) + simpa only [DiagonalGauge.conjugate_zero] using hm + +theorem mem_factor_iff_covariantFieldRepresentation (θ : ℕ → ℝ) + (A : Hilbert →L[ℂ] Hilbert) : + A ∈ factor θ ↔ ∃ (F : Base → Fiber →L[ℂ] Fiber) (B : ℝ), + IsCovariantFieldRepresentation θ A F B := by + constructor + · intro hA + obtain ⟨F, hF⟩ := exists_covariantFieldRepresentation hA + exact ⟨F, ‖A‖, hF⟩ + · rintro ⟨F, B, hF⟩ + exact hF.mem_factor + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductFieldDiagonals.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFieldDiagonals.lean new file mode 100644 index 0000000000000000000000000000000000000000..0380f124b695a6202ee5c974015acf16538f5846 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFieldDiagonals.lean @@ -0,0 +1,202 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductFieldRepresentation + +namespace OAI + +noncomputable section +open MeasureTheory Filter +namespace Invariant233.ProductModel + +private abbrev S (m : ℤ) : Fiber →L[ℂ] Fiber := + (WeightedShift.shift m).toLinearIsometry.toContinuousLinearMap + +private theorem rotationIterate_one_eq (θ : ℕ → ℝ) (x : Base) : + rotationIterate θ 1 x = rotation θ x := by + funext i + change x i + (((1 : ℤ) : ℝ) * θ i : ℝ) = x i + (θ i : Circle) + simp only [Int.cast_one, one_mul] + +theorem IsCovariantFieldRepresentation.covariance_all + {θ : ℕ → ℝ} {A : Hilbert →L[ℂ] Hilbert} + {F : Base → Fiber →L[ℂ] Fiber} {B : ℝ} + (h : IsCovariantFieldRepresentation θ A F B) : + ∀ᵐ x ∂baseMeasure, ∀ m : ℤ, + F x * S m = S m * F (rotationIterate θ m x) := by + have hpm : S 1 * S (-1) = 1 := by + rw [← WeightedShift.shift_add] + norm_num [WeightedShift.shift_zero] + have hmp : S (-1) * S 1 = 1 := by + rw [← WeightedShift.shift_add] + norm_num [WeightedShift.shift_zero] + have h1 : ∀ᵐ x ∂baseMeasure, F x * S 1 = S 1 * F (rotationIterate θ 1 x) := by + filter_upwards [h.2.2.2.2] with x hx + rw [rotationIterate_one_eq, hx] + simp only [← mul_assoc, hpm, one_mul] + have hn1 : ∀ᵐ x ∂baseMeasure, F x * S (-1) = S (-1) * F (rotationIterate θ (-1) x) := by + filter_upwards [(rotationIterate_measurePreserving θ (-1)).quasiMeasurePreserving.ae h1] + with x hx + have hrot : rotationIterate θ 1 (rotationIterate θ (-1) x) = x := by + rw [← rotationIterate_add] + norm_num + rw [hrot] at hx + calc + F x * S (-1) = (S (-1) * S 1) * F x * S (-1) := by rw [hmp, one_mul] + _ = S (-1) * (S 1 * F x) * S (-1) := by simp only [mul_assoc] + _ = S (-1) * (F (rotationIterate θ (-1) x) * S 1) * S (-1) := by rw [← hx] + _ = S (-1) * F (rotationIterate θ (-1) x) := by simp only [mul_assoc, hpm, mul_one] + have hadd (m n : ℤ) + (hm : ∀ᵐ x ∂baseMeasure, F x * S m = S m * F (rotationIterate θ m x)) + (hn : ∀ᵐ x ∂baseMeasure, F x * S n = S n * F (rotationIterate θ n x)) : + ∀ᵐ x ∂baseMeasure, F x * S (m+n) = S (m+n) * F (rotationIterate θ (m+n) x) := by + filter_upwards [hm, (rotationIterate_measurePreserving θ m).quasiMeasurePreserving.ae hn] + with x hmx hnx + have hs : S (m+n) = S m * S n := WeightedShift.shift_add m n + rw [hs, ← mul_assoc, hmx, mul_assoc, hnx, ← mul_assoc, ← rotationIterate_add] + apply ae_all_iff.mpr + intro m + induction m using Int.induction_on with + | zero => exact Eventually.of_forall (fun x => by simp [S]) + | succ n ih => exact hadd n 1 ih h1 + | pred n ih => simpa only [sub_eq_add_neg] using hadd (-(n : ℤ)) (-1) ih hn1 + +theorem IsCovariantFieldRepresentation.matrix_covariance + {θ : ℕ → ℝ} {A : Hilbert →L[ℂ] Hilbert} + {F : Base → Fiber →L[ℂ] Fiber} {B : ℝ} + (h : IsCovariantFieldRepresentation θ A F B) : + ∀ m k l : ℤ, ∀ᵐ x ∂baseMeasure, + inner ℂ ((default : HilbertBasis ℤ ℂ Fiber) k) + (F (rotationIterate θ m x) ((default : HilbertBasis ℤ ℂ Fiber) l)) = + inner ℂ ((default : HilbertBasis ℤ ℂ Fiber) (k+m)) + (F x ((default : HilbertBasis ℤ ℂ Fiber) (l+m))) := by + apply FieldTraceCyclic.ae_matrix_covariance_of_commute + (default : HilbertBasis ℤ ℂ Fiber) A F + (fun m => DirectIntegral.shiftedPullback (S m) + (rotationIterate θ m) (rotationIterate_measurePreserving θ m)) + (fun m => (WeightedShift.shift m).toLinearIsometry) + (rotationIterate θ) (rotationIterate_measurePreserving θ) + · exact FieldKoopman.shift_default_basis + · exact h.2.2.2.1 + · intro m + exact FieldTraceCyclic.shiftedPullback_ae _ _ _ + · intro m + apply FieldTraceCyclic.commute_shiftedPullback_of_covariance + A F (S m) (rotationIterate θ m) (rotationIterate_measurePreserving θ m) h.2.2.2.1 + filter_upwards [h.covariance_all] with x hx + exact hx m + +theorem signedShift_mem_factor (θ : ℕ → ℝ) (m : ℤ) : + (S m).compLpL 2 baseMeasure ∈ factor θ := by + let Q : ℤ → Hilbert →L[ℂ] Hilbert := fun k => (S k).compLpL 2 baseMeasure + have hQadd (k l : ℤ) : Q (k+l) = Q k * Q l := WeightedShift.fieldShift_add k l + have hQ0 : Q 0 = 1 := WeightedShift.fieldShift_zero + have hQ1 : Q 1 ∈ factor θ := subset_vonNeumannGenerated _ (Or.inl rfl) + have hQunit : Q 1 ∈ unitary (Hilbert →L[ℂ] Hilbert) := WeightedShift.fieldShift_mem_unitary 1 + have hQinv : Q 1 * Q (-1) = 1 := by rw [← hQadd]; norm_num [hQ0] + have hQneg : Q (-1) = star (Q 1) := by + calc + Q (-1) = (star (Q 1) * Q 1) * Q (-1) := by + rw [Unitary.star_mul_self_of_mem hQunit, one_mul] + _ = star (Q 1) * (Q 1 * Q (-1)) := mul_assoc _ _ _ + _ = star (Q 1) := by rw [hQinv, mul_one] + have hQn1 : Q (-1) ∈ factor θ := hQneg ▸ star_mem hQ1 + change Q m ∈ factor θ + induction m using Int.induction_on with + | zero => rw [hQ0]; exact one_mem _ + | succ n ih => rw [hQadd]; exact mul_mem ih hQ1 + | pred n ih => + rw [sub_eq_add_neg, hQadd] + exact mul_mem ih hQn1 + +def fieldCoefficient (F : Base → Fiber →L[ℂ] Fiber) (r : ℤ) (x : Base) : ℂ := + inner ℂ ((default : HilbertBasis ℤ ℂ Fiber) r) + (F x ((default : HilbertBasis ℤ ℂ Fiber) 0)) + +theorem IsCovariantFieldRepresentation.measurable_fieldCoefficient + {θ : ℕ → ℝ} {A : Hilbert →L[ℂ] Hilbert} + {F : Base → Fiber →L[ℂ] Fiber} {B : ℝ} + (h : IsCovariantFieldRepresentation θ A F B) (r : ℤ) : + Measurable (fieldCoefficient F r) := by + exact ((continuous_const.inner continuous_id).comp_stronglyMeasurable + (h.2.2.1 ((default : HilbertBasis ℤ ℂ Fiber) 0))).measurable + +theorem IsCovariantFieldRepresentation.norm_fieldCoefficient_le + {θ : ℕ → ℝ} {A : Hilbert →L[ℂ] Hilbert} + {F : Base → Fiber →L[ℂ] Fiber} {B : ℝ} + (h : IsCovariantFieldRepresentation θ A F B) (r : ℤ) (x : Base) : + ‖fieldCoefficient F r x‖ ≤ B := by + let b := (default : HilbertBasis ℤ ℂ Fiber) + calc + ‖fieldCoefficient F r x‖ ≤ ‖b r‖ * ‖F x (b 0)‖ := norm_inner_le_norm _ _ + _ ≤ ‖b r‖ * (‖F x‖ * ‖b 0‖) := + mul_le_mul_of_nonneg_left ((F x).le_opNorm _) (norm_nonneg _) + _ = ‖F x‖ := by rw [b.orthonormal.norm_eq_one, b.orthonormal.norm_eq_one]; ring + _ ≤ B := h.2.1 x + +theorem IsCovariantFieldRepresentation.diagonal_coefficient + {θ : ℕ → ℝ} {A : Hilbert →L[ℂ] Hilbert} + {F : Base → Fiber →L[ℂ] Fiber} {B : ℝ} + (h : IsCovariantFieldRepresentation θ A F B) (r k : ℤ) : + ∀ᵐ x ∂baseMeasure, + inner ℂ ((default : HilbertBasis ℤ ℂ Fiber) (k+r)) + (F x ((default : HilbertBasis ℤ ℂ Fiber) k)) = + fieldCoefficient F r (rotationIterate θ k x) := by + filter_upwards [h.matrix_covariance k r 0] with x hx + simpa only [fieldCoefficient, zero_add, add_comm k r] using hx.symm + +theorem IsCovariantFieldRepresentation.diagonalOperator_mem_factor + {θ : ℕ → ℝ} {A : Hilbert →L[ℂ] Hilbert} + {F : Base → Fiber →L[ℂ] Fiber} {B : ℝ} + (h : IsCovariantFieldRepresentation θ A F B) (r : ℤ) : + (S r).compLpL 2 baseMeasure * + multiplier θ (fieldCoefficient F r) B h.1 + (h.measurable_fieldCoefficient r) (h.norm_fieldCoefficient_le r) ∈ factor θ := by + apply mul_mem (signedShift_mem_factor θ r) + apply subset_vonNeumannGenerated _ + exact Or.inr ⟨fieldCoefficient F r, B, h.1, h.measurable_fieldCoefficient r, + h.norm_fieldCoefficient_le r, rfl⟩ + +theorem IsCovariantFieldRepresentation.diagonalOperator_ae + {θ : ℕ → ℝ} {A : Hilbert →L[ℂ] Hilbert} + {F : Base → Fiber →L[ℂ] Fiber} {B : ℝ} + (h : IsCovariantFieldRepresentation θ A F B) (r : ℤ) (ξ : Hilbert) : + ((S r).compLpL 2 baseMeasure * + multiplier θ (fieldCoefficient F r) B h.1 + (h.measurable_fieldCoefficient r) (h.norm_fieldCoefficient_le r)) ξ =ᵐ[baseMeasure] + fun x => S r (WeightedShift.diagonal + (multiplierField θ (fieldCoefficient F r) B (h.norm_fieldCoefficient_le r) x) (ξ x)) := by + filter_upwards [WeightedShift.fieldShift_ae r + (multiplier θ (fieldCoefficient F r) B h.1 (h.measurable_fieldCoefficient r) + (h.norm_fieldCoefficient_le r) ξ), + multiplier_ae θ (fieldCoefficient F r) B h.1 (h.measurable_fieldCoefficient r) + (h.norm_fieldCoefficient_le r) ξ] with x hs hd + exact hs.trans (congrArg (S r) hd) + +theorem IsCovariantFieldRepresentation.diagonalOperator_basis + {θ : ℕ → ℝ} {A : Hilbert →L[ℂ] Hilbert} + {F : Base → Fiber →L[ℂ] Fiber} {B : ℝ} + (h : IsCovariantFieldRepresentation θ A F B) (r k : ℤ) : + ∀ᵐ x ∂baseMeasure, + S r (WeightedShift.diagonal + (multiplierField θ (fieldCoefficient F r) B (h.norm_fieldCoefficient_le r) x) + ((default : HilbertBasis ℤ ℂ Fiber) k)) = + (inner ℂ ((default : HilbertBasis ℤ ℂ Fiber) (k+r)) + (F x ((default : HilbertBasis ℤ ℂ Fiber) k))) • + ((default : HilbertBasis ℤ ℂ Fiber) (k+r)) := by + let b := (default : HilbertBasis ℤ ℂ Fiber) + have hdiag (w : WeightedShift.Weight) : WeightedShift.diagonal w (b k) = w k • b k := by + have hb : b k = (lp.single 2 k (1 : ℂ) : Fiber) := + (HilbertBasis.repr_symm_single b k).symm + rw [hb] + ext j + by_cases hj : j = k <;> simp [WeightedShift.diagonal_apply, lp.single_apply, hj] + filter_upwards [h.diagonal_coefficient r k] with x hx + rw [hdiag, map_smul] + change _ • WeightedShift.shift r (b k) = _ + rw [FieldKoopman.shift_default_basis] + change fieldCoefficient F r (rotationIterate θ k x) • b (k+r) = _ + rw [← hx] + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductFieldRepresentation.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFieldRepresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..afb0b7713c35d5b7278daa792c33609a6be1c60c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFieldRepresentation.lean @@ -0,0 +1,83 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductFactorStructure +import OAI.Analysis.IrrationalRotation.Product.ProductProjectionFields +import OAI.Analysis.IrrationalRotation.Product.ProductFactorSource + +namespace OAI + +noncomputable section +open MeasureTheory Filter +namespace Invariant233.ProductModel + +theorem exists_covariantFieldRepresentation {θ : ℕ → ℝ} + {A : Hilbert →L[ℂ] Hilbert} (hA : A ∈ factor θ) : + ∃ F : Base → Fiber →L[ℂ] Fiber, + IsCovariantFieldRepresentation θ A F ‖A‖ := by + obtain ⟨F, hbound, hm, hrep, _⟩ := exists_unique_field hA + refine ⟨F, norm_nonneg A, hbound, hm, hrep, ?_⟩ + filter_upwards [field_conjugacy hA F hrep] with x hx + have hrot : rotationIterate θ 1 x = rotation θ x := by + funext i + change x i + (((1 : ℤ) : ℝ) * θ i : ℝ) = x i + (θ i : Circle) + simp only [Int.cast_one, one_mul] + rw [← hrot] + exact hx 1 + +theorem exists_covariantFieldRepresentation_with_trace {θ : ℕ → ℝ} + {A : Hilbert →L[ℂ] Hilbert} (hA : A ∈ factor θ) : + ∃ F : Base → Fiber →L[ℂ] Fiber, + IsCovariantFieldRepresentation θ A F ‖A‖ ∧ + vectorTrace traceVector A = centralDiagonalIntegral F := by + obtain ⟨F, hF⟩ := exists_covariantFieldRepresentation hA + exact ⟨F, hF, hF.vectorTrace_eq⟩ + +theorem exists_covariantProjectionField {θ : ℕ → ℝ} + {P : Hilbert →L[ℂ] Hilbert} (hPm : P ∈ factor θ) (hP : IsStarProjection P) : + ∃ F : Base → Fiber →L[ℂ] Fiber, + IsCovariantFieldRepresentation θ P F 1 ∧ ∀ x, IsStarProjection (F x) := by + classical + obtain ⟨F, hbound, hm, hrep, _⟩ := exists_unique_field hPm + have hproj := field_isStarProjection hPm hP F hrep + obtain ⟨N, hsub, hN, hnull⟩ := exists_measurable_superset_of_null (ae_iff.mp hproj) + let G : Base → Fiber →L[ℂ] Fiber := fun x => if x ∈ N then 0 else F x + have hgood : ∀ᵐ x ∂baseMeasure, x ∉ N := by + apply ae_iff.mpr + simpa only [not_not, Set.ofPred_mem_eq] using hnull + have hGF : G =ᵐ[baseMeasure] F := by + filter_upwards [hgood] with x hx + simp only [G, ite_eq_right hx] + have hGrep : ∀ ξ : Hilbert, P ξ =ᵐ[baseMeasure] fun x => G x (ξ x) := by + intro ξ + filter_upwards [hrep ξ, hGF] with x hξ hx + rw [hx] + exact hξ + have hGproj : ∀ x, IsStarProjection (G x) := by + intro x + by_cases hx : x ∈ N + · simp only [G, ite_eq_left hx] + exact IsStarProjection.zero _ + · simp only [G, ite_eq_right hx] + by_contra hn + exact hx (hsub hn) + refine ⟨G, ⟨by norm_num, ?_, ?_, hGrep, ?_⟩, hGproj⟩ + · intro x + exact IsStarProjection.norm_le _ (hGproj x) + · intro v + have heq : (fun x => G x v) = N.piecewise (fun _ => (0 : Fiber)) (fun x => F x v) := by + funext x + by_cases hx : x ∈ N <;> simp [G, Set.piecewise, hx] + rw [heq] + exact (stronglyMeasurable_const : StronglyMeasurable (fun _ : Base => (0 : Fiber))).piecewise + hN (hm v) + · filter_upwards [field_conjugacy hPm G hGrep] with x hx + have hrot : rotationIterate θ 1 x = rotation θ x := by + funext i + change x i + (((1 : ℤ) : ℝ) * θ i : ℝ) = x i + (θ i : Circle) + simp only [Int.cast_one, one_mul] + rw [← hrot] + exact hx 1 + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductFields.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFields.lean new file mode 100644 index 0000000000000000000000000000000000000000..be1d03b6d4cbe32cb0d1317599f697567fd32646 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFields.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.IrrationalRotation.Model.Product +import OAI.Analysis.IrrationalRotation.Operators.ScalarMultiplierCommutation +import OAI.Analysis.IrrationalRotation.Analysis.ScalarMultiplierFields +import OAI.Analysis.IrrationalRotation.Analysis.GeneratedVonNeumann +import OAI.Analysis.IrrationalRotation.Rotation.FieldDiagonal + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal + +namespace Invariant233.ProductModel + +theorem shiftOperator_ae (ξ : Hilbert) : + shiftOperator ξ =ᵐ[baseMeasure] fun x => WeightedShift.shift 1 (ξ x) := + ContinuousLinearMap.coeFn_compLpL _ _ + +theorem multiplier_ae (θ : ℕ → ℝ) (g : Base → ℂ) (C : ℝ) (hC : 0 ≤ C) + (hg : Measurable g) (hb : ∀ x, ‖g x‖ ≤ C) (ξ : Hilbert) : + multiplier θ g C hC hg hb ξ =ᵐ[baseMeasure] + fun x => WeightedShift.diagonal (multiplierField θ g C hb x) (ξ x) := by + unfold multiplier + exact WeightedShift.fieldDiagonal_ae _ _ _ _ _ _ + +theorem shiftOperator_commutes_multiplier (g : Lp ℂ ∞ baseMeasure) : + Commute shiftOperator (L2Multiplication.multiplier (E := Fiber) g) := + L2Multiplication.commute_multiplier_of_represented shiftOperator + (fun _ => (WeightedShift.shift 1).toLinearIsometry.toContinuousLinearMap) + shiftOperator_ae g + +theorem multiplier_commutes_scalar (θ : ℕ → ℝ) (g : Base → ℂ) + (C : ℝ) (hC : 0 ≤ C) (hg : Measurable g) (hb : ∀ x, ‖g x‖ ≤ C) + (a : Lp ℂ ∞ baseMeasure) : + Commute (multiplier θ g C hC hg hb) (L2Multiplication.multiplier (E := Fiber) a) := + L2Multiplication.commute_multiplier_of_represented _ + (fun x => WeightedShift.diagonal (multiplierField θ g C hb x)) + (multiplier_ae θ g C hC hg hb) a + +theorem scalarMultiplier_mem_commutant (θ : ℕ → ℝ) (g : Lp ℂ ∞ baseMeasure) : + L2Multiplication.multiplier (E := Fiber) g ∈ (factor θ).commutant := by + apply (mem_commutant_vonNeumannGenerated_iff _ _).mpr + intro A hA + have hcomm : ∀ a : Lp ℂ ∞ baseMeasure, + Commute A (L2Multiplication.multiplier (E := Fiber) a) := by + rcases hA with hA | hA + · rcases Set.mem_singleton_iff.mp hA with rfl + exact shiftOperator_commutes_multiplier + · obtain ⟨f, C, hC, hf, hb, rfl⟩ := hA + exact multiplier_commutes_scalar θ f C hC hf hb + exact ⟨(hcomm g).eq, (L2Multiplication.star_commutes_multiplier A hcomm g).eq⟩ + +theorem factor_commutes_scalarMultiplier (θ : ℕ → ℝ) {T : Hilbert →L[ℂ] Hilbert} + (hT : T ∈ factor θ) (g : Lp ℂ ∞ baseMeasure) : + Commute T (L2Multiplication.multiplier (E := Fiber) g) := + (VonNeumannAlgebra.mem_commutant_iff.mp (scalarMultiplier_mem_commutant θ g)) T hT + +theorem exists_unique_field {θ : ℕ → ℝ} {T : Hilbert →L[ℂ] Hilbert} + (hT : T ∈ factor θ) : + ∃ F : Base → Fiber →L[ℂ] Fiber, + (∀ x, ‖F x‖ ≤ ‖T‖) ∧ + (∀ v : Fiber, StronglyMeasurable fun x => F x v) ∧ + (∀ ξ : Hilbert, T ξ =ᵐ[baseMeasure] fun x => F x (ξ x)) ∧ + (∀ G : Base → Fiber →L[ℂ] Fiber, + (∀ ξ : Hilbert, T ξ =ᵐ[baseMeasure] fun x => G x (ξ x)) → + F =ᵐ[baseMeasure] G) := + L2Multiplication.exists_unique_field_of_commutes + (default : HilbertBasis ℤ ℂ Fiber) T (factor_commutes_scalarMultiplier θ hT) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductFloorIntegral.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFloorIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa14c381ed4aca96bff7a45326df689b3d7c9e46 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductFloorIntegral.lean @@ -0,0 +1,122 @@ +import Mathlib +import OAI.Analysis.IrrationalRotation.Rotation.CircleRepresentative +import OAI.Analysis.IrrationalRotation.Product.ProductSupport + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal + +namespace Invariant233.ProductNorm + +theorem floor_add_eq_indicator (x θ : ℝ) (hx : x ∈ Ico (0 : ℝ) 1) + (hθ0 : 0 ≤ θ) (hθ1 : θ ≤ 1) : + (⌊x + θ⌋ : ℝ) = (Ico (1 - θ) 1).indicator (fun _ => (1 : ℝ)) x := by + by_cases h : 1 - θ ≤ x + · have hmem : x ∈ Ico (1 - θ) 1 := ⟨h, hx.2⟩ + rw [Set.indicator_of_mem hmem] + have hf : ⌊x + θ⌋ = (1 : ℤ) := by + apply Int.floor_eq_iff.mpr + norm_num + constructor <;> linarith [hx.1, hx.2] + simp [hf] + · have hmem : x ∉ Ico (1 - θ) 1 := fun hx' => h hx'.1 + rw [Set.indicator_of_notMem hmem] + have hf : ⌊x + θ⌋ = (0 : ℤ) := by + apply Int.floor_eq_iff.mpr + norm_num + constructor <;> linarith [hx.1, hx.2] + simp [hf] + +theorem lintegral_floor_add (θ : ℝ) (hθ0 : 0 ≤ θ) (hθ1 : θ ≤ 1) : + (∫⁻ x : ℝ in Ico (0 : ℝ) 1, ENNReal.ofReal (⌊x + θ⌋ : ℝ)) = + ENNReal.ofReal θ := by + have heq : (fun x : ℝ => ENNReal.ofReal (⌊x + θ⌋ : ℝ)) =ᵐ[ + volume.restrict (Ico (0 : ℝ) 1)] + (Ico (1 - θ) 1).indicator (fun _ => (1 : ℝ≥0∞)) := by + filter_upwards [ae_restrict_mem measurableSet_Ico] with x hx + rw [floor_add_eq_indicator x θ hx hθ0 hθ1] + by_cases hm : x ∈ Ico (1 - θ) 1 <;> simp [hm] + rw [lintegral_congr_ae heq, lintegral_indicator measurableSet_Ico] + simp only [lintegral_const, one_mul, Measure.restrict_apply_univ] + rw [Measure.restrict_apply measurableSet_Ico] + have hsubset : Ico (1 - θ) 1 ⊆ Ico (0 : ℝ) 1 := by + intro x hx + exact ⟨by linarith [hx.1], hx.2⟩ + rw [inter_eq_left.mpr hsubset, Real.volume_Ico] + congr 1 + ring + +theorem lintegral_tsum_floor_cost {Ω ι : Type*} [MeasurableSpace Ω] [Countable ι] + (μ : Measure Ω) (u : ι → Ω → ℝ) + (hu : ∀ i, MeasurePreserving (u i) μ (volume.restrict (Ico (0 : ℝ) 1))) + (c θ : ι → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ1 : ∀ i, θ i ≤ 1) : + (∫⁻ x, ∑' i, ENNReal.ofReal (c i) * ENNReal.ofReal (⌊u i x + θ i⌋ : ℝ) ∂μ) = + ∑' i, ENNReal.ofReal (c i) * ENNReal.ofReal (θ i) := by + have hm (i : ι) : Measurable (fun x : ℝ => ENNReal.ofReal (⌊x + θ i⌋ : ℝ)) := by + fun_prop + have hm' (i : ι) : Measurable (fun x : Ω => + ENNReal.ofReal (c i) * ENNReal.ofReal (⌊u i x + θ i⌋ : ℝ)) := + measurable_const.mul ((hm i).comp (hu i).measurable) + rw [lintegral_tsum (fun i => (hm' i).aemeasurable)] + apply tsum_congr + intro i + calc + _ = ENNReal.ofReal (c i) * (∫⁻ x, ENNReal.ofReal (⌊u i x + θ i⌋ : ℝ) ∂μ) := + lintegral_const_mul (ENNReal.ofReal (c i)) + (show Measurable (fun x => ENNReal.ofReal (⌊u i x + θ i⌋ : ℝ)) from + (hm i).comp (hu i).measurable) + _ = ENNReal.ofReal (c i) * (∫⁻ x : ℝ in Ico (0 : ℝ) 1, + ENNReal.ofReal (⌊x + θ i⌋ : ℝ)) := by + congr 1 + exact (hu i).lintegral_comp (hm i) + _ = _ := by rw [lintegral_floor_add (θ i) (hθ0 i) (hθ1 i)] + +theorem lintegral_product_floor_cost {ι : Type*} [Countable ι] + (c θ : ι → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ1 : ∀ i, θ i ≤ 1) : + (∫⁻ x : ι → UnitAddCircle, + ∑' i, ENNReal.ofReal (c i) * ENNReal.ofReal + (⌊((AddCircle.equivIco (1 : ℝ) 0 (x i)) : ℝ) + θ i⌋ : ℝ) + ∂(Measure.infinitePi (fun _ : ι => (volume : Measure UnitAddCircle)))) = + ∑' i, ENNReal.ofReal (c i) * ENNReal.ofReal (θ i) := by + exact lintegral_tsum_floor_cost _ _ + (fun i => CocycleSupport.measurePreserving_productRepresentative i) c θ hθ0 hθ1 + +theorem lintegral_neg_log_product_weight {ι : Type*} [Countable ι] + (c θ : ι → ℝ) (hc : ∀ i, 0 ≤ c i) + (hθ0 : ∀ i, 0 ≤ θ i) (hθ1 : ∀ i, θ i ≤ 1) (hθ : Summable θ) : + (∫⁻ x : ι → UnitAddCircle, ENNReal.ofReal + (-Real.log (Real.exp (-(∑' i, c i * + (⌊((AddCircle.equivIco (1 : ℝ) 0 (x i)) : ℝ) + θ i⌋ : ℝ))))) + ∂(Measure.infinitePi (fun _ : ι => (volume : Measure UnitAddCircle)))) = + ∑' i, ENNReal.ofReal (c i) * ENNReal.ofReal (θ i) := by + rw [← lintegral_product_floor_cost c θ hθ0 hθ1] + apply lintegral_congr_ae + filter_upwards [CocycleSupport.ae_product_all_int_finite_floor_support θ hθ0 hθ] + with x hx + have hfinite : (Function.support (fun i => c i * + (⌊((AddCircle.equivIco (1 : ℝ) 0 (x i)) : ℝ) + θ i⌋ : ℝ))).Finite := by + have hf := hx (1 : ℤ) + simp only [Int.cast_one, one_mul] at hf + apply hf.subset + intro i hi + simp only [Function.mem_support] at hi ⊢ + intro hz + apply hi + simp [hz] + have hsum : Summable (fun i => c i * + (⌊((AddCircle.equivIco (1 : ℝ) 0 (x i)) : ℝ) + θ i⌋ : ℝ)) := + summable_of_hasFiniteSupport hfinite + have hcost (i : ι) : 0 ≤ c i * + (⌊((AddCircle.equivIco (1 : ℝ) 0 (x i)) : ℝ) + θ i⌋ : ℝ) := by + apply mul_nonneg (hc i) + have hu : 0 ≤ ((AddCircle.equivIco (1 : ℝ) 0 (x i)) : ℝ) := + (AddCircle.equivIco (1 : ℝ) 0 (x i)).property.1 + exact_mod_cast Int.floor_nonneg.mpr (add_nonneg hu (hθ0 i)) + simp only [Real.log_exp, neg_neg] + rw [ENNReal.ofReal_tsum_of_nonneg hcost hsum] + exact tsum_congr fun i => ENNReal.ofReal_mul (hc i) + +end Invariant233.ProductNorm + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductGaugeFourier.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductGaugeFourier.lean new file mode 100644 index 0000000000000000000000000000000000000000..67451b1038b629289f3e75834dbd78da504f1327 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductGaugeFourier.lean @@ -0,0 +1,117 @@ +import OAI.Analysis.IrrationalRotation.Rotation.GaugeFourierDiagonal +import OAI.Analysis.IrrationalRotation.Product.ProductFieldDiagonals + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Invariant233.ProductModel + +variable {θ : ℕ → ℝ} {A : Hilbert →L[ℂ] Hilbert} + {F : Base → Fiber →L[ℂ] Fiber} {B : ℝ} + +def IsCovariantFieldRepresentation.matrixDiagonal + (h : IsCovariantFieldRepresentation θ A F B) (r : ℤ) : Hilbert →L[ℂ] Hilbert := + (WeightedShift.shift r).toLinearIsometry.toContinuousLinearMap.compLpL 2 baseMeasure * + multiplier θ (fieldCoefficient F r) B h.1 + (h.measurable_fieldCoefficient r) (h.norm_fieldCoefficient_le r) + +theorem IsCovariantFieldRepresentation.matrixDiagonal_mem_factor + (h : IsCovariantFieldRepresentation θ A F B) (r : ℤ) : + h.matrixDiagonal r ∈ factor θ := h.diagonalOperator_mem_factor r + +private theorem single_eq_smul_basis (j : ℤ) (c : ℂ) : + (lp.single 2 j c : Fiber) = c • (default : HilbertBasis ℤ ℂ Fiber) j := by + have hb : (default : HilbertBasis ℤ ℂ Fiber) j = + (lp.single 2 j (1 : ℂ) : Fiber) := + (HilbertBasis.repr_symm_single (default : HilbertBasis ℤ ℂ Fiber) j).symm + rw [hb] + simpa only [smul_eq_mul, mul_one] using + (lp.single_smul (E := fun _ : ℤ => ℂ) 2 j c (1 : ℂ)) + +private theorem inner_basis_coordinate (j : ℤ) (v : Fiber) : + inner ℂ ((default : HilbertBasis ℤ ℂ Fiber) j) v = v j := + ((default : HilbertBasis ℤ ℂ Fiber).repr_apply_apply v j).symm + +theorem IsCovariantFieldRepresentation.coordinate_matrixDiagonal_inclusion + (h : IsCovariantFieldRepresentation θ A F B) (r k j : ℤ) + (v : Lp ℂ 2 baseMeasure) : + DiagonalGauge.coordinate baseMeasure k + (h.matrixDiagonal r (DiagonalGauge.inclusion baseMeasure j v)) = + if k - j = r then DiagonalGauge.coordinate baseMeasure k + (A (DiagonalGauge.inclusion baseMeasure j v)) else 0 := by + let b := (default : HilbertBasis ℤ ℂ Fiber) + have hb0 (n : ℤ) : b n = (lp.single 2 n (1 : ℂ) : Fiber) := + (HilbertBasis.repr_symm_single b n).symm + have hdiag := h.diagonalOperator_ae r (DiagonalGauge.inclusion baseMeasure j v) + change h.matrixDiagonal r (DiagonalGauge.inclusion baseMeasure j v) =ᵐ[baseMeasure] _ at hdiag + by_cases hkj : k - j = r + · rw [ite_eq_left hkj] + have hk : k = j + r := by omega + subst k + apply Lp.ext + filter_upwards [DiagonalGauge.coordinate_ae baseMeasure (j+r) + (h.matrixDiagonal r (DiagonalGauge.inclusion baseMeasure j v)), + hdiag, DiagonalGauge.inclusion_ae baseMeasure j v, + h.diagonalOperator_basis r j, + DiagonalGauge.coordinate_ae baseMeasure (j+r) + (A (DiagonalGauge.inclusion baseMeasure j v)), + h.2.2.2.1 (DiagonalGauge.inclusion baseMeasure j v)] with x hc hd hi hb hcA hA + rw [hc, hd, hi, single_eq_smul_basis, map_smul, map_smul, hb, + hcA, hA, hi, single_eq_smul_basis, map_smul] + change v x * (inner ℂ (b (j+r)) (F x (b j)) * b (j+r) (j+r)) = + v x * (F x (b j)) (j+r) + rw [inner_basis_coordinate] + have hbb : b (j+r) (j+r) = 1 := by + rw [hb0] + simp + rw [hbb, mul_one] + · rw [ite_eq_right hkj] + apply Lp.ext + filter_upwards [DiagonalGauge.coordinate_ae baseMeasure k + (h.matrixDiagonal r (DiagonalGauge.inclusion baseMeasure j v)), + hdiag, DiagonalGauge.inclusion_ae baseMeasure j v, + h.diagonalOperator_basis r j, + Lp.coeFn_zero ℂ 2 baseMeasure] with x hc hd hi hb hz + rw [hc, hd, hi, single_eq_smul_basis, map_smul, map_smul, hb, hz] + change v x * (inner ℂ (b (j+r)) (F x (b j)) * b (j+r) k) = 0 + have hbb : b (j+r) k = 0 := by + rw [hb0] + have hk : j+r ≠ k := by omega + simp [lp.single_apply, hk] + rw [hbb, mul_zero, mul_zero] + +theorem IsCovariantFieldRepresentation.fourierOperator_eq_matrixDiagonal + (h : IsCovariantFieldRepresentation θ A F B) (r : ℤ) : + DiagonalGauge.fourierOperator baseMeasure A r = h.matrixDiagonal r := by + apply DiagonalGauge.operator_ext_entries baseMeasure + intro k j v + rw [DiagonalGauge.coordinate_fourierOperator_inclusion, + h.coordinate_matrixDiagonal_inclusion] + +theorem IsCovariantFieldRepresentation.fourierOperator_mem_factor + (h : IsCovariantFieldRepresentation θ A F B) (r : ℤ) : + DiagonalGauge.fourierOperator baseMeasure A r ∈ factor θ := by + rw [h.fourierOperator_eq_matrixDiagonal] + exact h.matrixDiagonal_mem_factor r + +theorem IsCovariantFieldRepresentation.matrixDiagonal_neg_apply_integral + (h : IsCovariantFieldRepresentation θ A F B) (r : ℤ) (v : Hilbert) : + h.matrixDiagonal (-r) v = ∫ t : DiagonalGauge.Circle, + fourier r t • DiagonalGauge.conjugate baseMeasure A t v + ∂AddCircle.haarAddCircle := by + rw [← h.fourierOperator_eq_matrixDiagonal, DiagonalGauge.fourierOperator_apply] + simp only [neg_neg] + +theorem IsCovariantFieldRepresentation.norm_matrixDiagonal_le + (h : IsCovariantFieldRepresentation θ A F B) (r : ℤ) : + ‖h.matrixDiagonal r‖ ≤ ‖A‖ := by + rw [← h.fourierOperator_eq_matrixDiagonal] + exact DiagonalGauge.norm_fourierOperator_le baseMeasure A r + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductHilbert.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductHilbert.lean new file mode 100644 index 0000000000000000000000000000000000000000..9579561b79e21437d77d3619826bd2197b74f270 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductHilbert.lean @@ -0,0 +1,33 @@ +import OAI.Analysis.IrrationalRotation.Model.Product +import OAI.Analysis.IrrationalRotation.Operators.HilbertModelSize + +namespace OAI + +noncomputable section +namespace Invariant233.ProductModel + +instance hilbert_separable : TopologicalSpace.SeparableSpace Hilbert := + HilbertModelSize.separable_L2_l2 baseMeasure ℤ + +theorem hilbert_not_finiteDimensional : ¬ FiniteDimensional ℂ Hilbert := + HilbertModelSize.not_finiteDimensional_L2_l2 baseMeasure ℤ + +instance hilbert_nontrivial : Nontrivial Hilbert := by + cases subsingleton_or_nontrivial Hilbert with + | inl h => + let : Subsingleton Hilbert := h + exact False.elim (hilbert_not_finiteDimensional inferInstance) + | inr h => exact h + +theorem norm_traceVector : ‖traceVector‖ = 1 := by + rw [traceVector, MeasureTheory.Lp.norm_const' 2 baseMeasure _ (by norm_num) (by norm_num)] + simp [lp.norm_single (by norm_num : (0 : ENNReal) < 2)] + +theorem traceVector_inner_one : inner ℂ traceVector ((1 : Hilbert →L[ℂ] Hilbert) traceVector) = 1 := by + simp [inner_self_eq_norm_sq_to_K, norm_traceVector] + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductIdealCylinderLimit.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductIdealCylinderLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e57e083d27b80d336cff53088f568f28044a0e9 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductIdealCylinderLimit.lean @@ -0,0 +1,170 @@ +import OAI.Analysis.IrrationalRotation.Sampling.ProductIdealSamplingScales +import OAI.Analysis.IrrationalRotation.Sampling.SamplingCylinderWeak + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped Topology ENNReal NNReal BigOperators + +namespace Invariant233.ProductModel.IdealSampling +open SamplingCylinderWeak + +private theorem mem_frontier_preimage_of_continuousAt + {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] + {f : X → Y} {x : X} {s : Set Y} (hf : ContinuousAt f x) + (hx : x ∈ frontier (f ⁻¹' s)) : f x ∈ frontier s := by + rw [frontier_eq_closure_inter_closure] at hx ⊢ + constructor + · exact closure_mono (image_preimage_subset f s) (mem_closure_image hf hx.1) + · exact closure_mono (image_preimage_subset f sᶜ) (mem_closure_image hf hx.2) + +private theorem null_frontier_preimage_of_ae_continuousAt + {X Y : Type*} [TopologicalSpace X] [MeasurableSpace X] [OpensMeasurableSpace X] + [TopologicalSpace Y] {μ : Measure X} {f : X → Y} {s : Set Y} + (hf : ∀ᵐ x ∂μ, ContinuousAt f x) (hs : μ (f ⁻¹' frontier s) = 0) : + μ (frontier (f ⁻¹' s)) = 0 := by + apply measure_eq_zero_iff_ae_notMem.mpr + filter_upwards [hf, measure_eq_zero_iff_ae_notMem.mp hs] with x hfx hsx + exact fun hx => hsx (mem_frontier_preimage_of_continuousAt hfx hx) + +theorem triangularLaw_coordinate_singleton (I : Finset ℕ) (b : Bool) (i : ℕ) + (a : Circle) : + triangularLaw I {xy | (if b then xy.2 i else xy.1 i) = a} = 0 := by + have hfst : (baseMeasure.prod baseMeasure) {xz : EndpointPair | xz.1 i = a} = 0 := by + have hp := (measurePreserving_eval_infinitePi (fun _ : ℕ => circleMeasure) i).comp + (measurePreserving_fst (μ := baseMeasure) (ν := baseMeasure)) + have he := hp.measure_preimage (measurableSet_singleton a).nullMeasurableSet + simpa [Sampling.circleMeasure_singleton, Function.comp_def, Set.preimage, Set.mem_singleton_iff] using he + have hsnd : (baseMeasure.prod baseMeasure) {xz : EndpointPair | xz.2 i = a} = 0 := by + have hp := (measurePreserving_eval_infinitePi (fun _ : ℕ => circleMeasure) i).comp + (measurePreserving_snd (μ := baseMeasure) (ν := baseMeasure)) + have he := hp.measure_preimage (measurableSet_singleton a).nullMeasurableSet + simpa [Sampling.circleMeasure_singleton, Function.comp_def, Set.preimage, Set.mem_singleton_iff] using he + rw [triangularLaw, Measure.map_apply (Sampling.endpointMap_measurable I)] + · apply le_antisymm ((Measure.restrict_le_self _).trans_eq ?_) (bot_le) + cases b + · simpa using hfst + · by_cases hi : i ∈ I + · simpa [selectedEndpoint, hi] using hsnd + · simpa [selectedEndpoint, hi] using hfst + · cases b <;> simp only [Bool.false_eq_true, ite_false, ite_true] + · exact measurableSet_eq_fun ((measurable_pi_apply i).comp measurable_fst) measurable_const + · exact measurableSet_eq_fun ((measurable_pi_apply i).comp measurable_snd) measurable_const + +theorem triangularLaw_cutCoordinate_singleton (I : Finset ℕ) (k : Bool × ℕ) + (a : ℝ) : triangularLaw I {xy | cutCoordinates xy k = a} = 0 := by + apply measure_mono_null _ (triangularLaw_coordinate_singleton I k.1 k.2 (a : Circle)) + intro xy hxy + change circleRepresentative (if k.1 then xy.2 k.2 else xy.1 k.2) = a at hxy + change (if k.1 then xy.2 k.2 else xy.1 k.2) = (a : Circle) + rw [← hxy] + exact AddCircle.coe_equivIco.symm + +theorem triangularLaw_ae_continuousAt_cutCoordinate (I : Finset ℕ) (k : Bool × ℕ) : + ∀ᵐ xy ∂triangularLaw I, ContinuousAt (fun z => cutCoordinates z k) xy := by + have hn : ∀ᵐ xy ∂triangularLaw I, + (if k.1 then xy.2 k.2 else xy.1 k.2) ≠ (0 : Circle) := + by simpa only [not_not] using (ae_iff.mpr (by + simpa only [not_not] using triangularLaw_coordinate_singleton I k.1 k.2 0)) + filter_upwards [hn] with xy hxy + have hc : Continuous (fun z : EndpointPair => if k.1 then z.2 k.2 else z.1 k.2) := by + cases k.1 <;> simp only [Bool.false_eq_true, ite_false, ite_true] <;> fun_prop + have hr : ContinuousAt circleRepresentative (if k.1 then xy.2 k.2 else xy.1 k.2) := + continuousAt_subtype_val.comp (AddCircle.continuousAt_equivIco (1 : ℝ) 0 hxy) + exact hr.comp (f := fun z : EndpointPair => if k.1 then z.2 k.2 else z.1 k.2) hc.continuousAt + +theorem triangularLaw_null_frontier_interval (I : Finset ℕ) (k : Bool × ℕ) + (a b : ℝ) : + triangularLaw I (frontier {xy | a < cutCoordinates xy k ∧ cutCoordinates xy k < b}) = 0 := by + change triangularLaw I (frontier ((fun xy => cutCoordinates xy k) ⁻¹' Ioo a b)) = 0 + apply null_frontier_preimage_of_ae_continuousAt + (triangularLaw_ae_continuousAt_cutCoordinate I k) + by_cases hab : a < b + · rw [frontier_Ioo hab] + have he : (fun xy => cutCoordinates xy k) ⁻¹' ({a, b} : Set ℝ) = + {xy | cutCoordinates xy k = a} ∪ {xy | cutCoordinates xy k = b} := by + ext xy + simp + rw [he] + exact measure_union_null (triangularLaw_cutCoordinate_singleton I k a) + (triangularLaw_cutCoordinate_singleton I k b) + · simp [Set.Ioo_eq_empty hab] + +theorem triangularLaw_null_frontier_endpointCylinder (I : Finset ℕ) + (t : CylinderTest (Bool × ℕ)) : + triangularLaw I (frontier (endpointCylinder t)) = 0 := by + classical + induction t using Finset.induction_on with + | empty => simp [endpointCylinder] + | @insert v t hv ih => + have he : endpointCylinder (insert v t) = + {xy | (v.2.1 : ℝ) < cutCoordinates xy v.1 ∧ + cutCoordinates xy v.1 < (v.2.2 : ℝ)} ∩ endpointCylinder t := by + ext xy + simp [endpointCylinder, SamplingCylinderWeak.cylinder] + rw [he] + apply measure_mono_null (frontier_inter_subset _ _) + exact measure_union_null + (measure_inter_null_of_null_left _ (triangularLaw_null_frontier_interval I v.1 _ _)) + (measure_inter_null_of_null_right _ ih) + +theorem finiteMeasure_tendsto_apply_of_null_frontier + {X ι : Type*} [Nonempty X] [MeasurableSpace X] [TopologicalSpace X] + [OpensMeasurableSpace X] [HasOuterApproxClosed X] + {l : Filter ι} {μ : ι → FiniteMeasure X} {ν : FiniteMeasure X} + (hμ : Tendsto μ l (𝓝 ν)) {E : Set X} + (hE : (ν : Measure X) (frontier E) = 0) : + Tendsto (fun i => μ i E) l (𝓝 (ν E)) := by + by_cases hν : ν = 0 + · subst ν + apply tendsto_of_tendsto_of_tendsto_of_le_of_le + (by simpa using (tendsto_const_nhds : Tendsto (fun _ : ι => (0 : ℝ≥0)) l (𝓝 0))) + (by simpa using hμ.mass) + · intro i; exact bot_le + · intro i; exact (μ i).apply_le_mass E + · have hnorm := FiniteMeasure.tendsto_normalize_of_tendsto hμ hν + have hEnorm : ν.normalize (frontier E) = 0 := by + rw [ν.normalize_eq_of_nonzero hν] + have hzero : ν (frontier E) = 0 := by + change ((ν : Measure X) (frontier E)).toNNReal = 0 + rw [hE] + rfl + rw [hzero, mul_zero] + have h := hμ.mass.mul + (ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto hnorm hEnorm) + simpa only [← FiniteMeasure.self_eq_mass_mul_normalize] using h + +theorem cylinder_real_tendsto_of_weaklyConverges + (I : Finset ℕ) {μ : ℕ → Measure EndpointPair} + (hfinite : ∀ n, IsFiniteMeasure (μ n)) + (hμ : WeaklyConverges μ (triangularLaw I)) + (t : CylinderTest (Bool × ℕ)) : + Tendsto (fun n => (μ n).real (endpointCylinder t)) atTop + (𝓝 ((triangularLaw I).real (endpointCylinder t))) := by + let μ' : ℕ → FiniteMeasure EndpointPair := fun n => ⟨μ n, hfinite n⟩ + let ν : FiniteMeasure EndpointPair := ⟨triangularLaw I, Sampling.triangularLaw_finite I⟩ + have hw : Tendsto μ' atTop (𝓝 ν) := + (weaklyConverges_iff_tendsto μ' ν).mp hμ + have ht := finiteMeasure_tendsto_apply_of_null_frontier hw + (triangularLaw_null_frontier_endpointCylinder I t) + have hr := NNReal.continuous_coe.continuousAt.tendsto.comp ht + change Tendsto (fun n => (((μ n) (endpointCylinder t)).toNNReal : ℝ)) atTop + (𝓝 (((triangularLaw I) (endpointCylinder t)).toNNReal : ℝ)) + exact hr + +theorem law_cylinder_real_tendsto_of_productScaleLaws (I : Finset ℕ) + {p : ProductScaleData} (hp : ProductScaleLaws p) + (t : CylinderTest (Bool × ℕ)) : + Tendsto (fun l => (law I (Finset.range (p.prefixCount (l + 1))) + ((p.m l : ℝ) ^ (-(3 / 5 : ℝ))) (1 / (p.m l : ℝ) ^ 2)).real + (endpointCylinder t)) atTop + (𝓝 ((triangularLaw I).real (endpointCylinder t))) := + cylinder_real_tendsto_of_weaklyConverges I (fun _ => inferInstance) + (law_weaklyConverges_of_productScaleLaws I hp) t + +end Invariant233.ProductModel.IdealSampling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductInvariantProjectionObstruction.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductInvariantProjectionObstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..553de0deae7aaa239382556a649d9cd4f088a1e3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductInvariantProjectionObstruction.lean @@ -0,0 +1,71 @@ +import OAI.Analysis.IrrationalRotation.Product.SourceProductTailRealization +import OAI.Analysis.IrrationalRotation.Couplings.ProductSourceConditionalData +import OAI.Analysis.IrrationalRotation.Product.ProductPositiveDiagonal +import OAI.Analysis.IrrationalRotation.Couplings.ProductPairIdentity +import OAI.Analysis.IrrationalRotation.Couplings.ProductBiasedIdentityFromTriangular + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped BigOperators Topology InnerProductSpace + +namespace Invariant233.ProductModel + +theorem hasOnlyTrivialInvariantProjections_of_sampling_and_phases + {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) + (he : ∀ a : Σ s, Fin (p.m s), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) + (θ : ℕ → ℝ) + (hadm : AdmissibleAnglesAndCosts θ (fun i => p.C (e i).1)) + (hb : ∀ j, ∀ i ∈ ProductPhases.consecutiveBlock p.m j, + θ i ∈ Set.Icc (1 / p.N j) (2 / p.N j)) + (hsmall : ∀ s, ProductPhases.smallPhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.K s) (p.G s) θ) + (hlarge : ∀ᶠ s in atTop, ProductPhases.largePhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.N s) θ) + (hsampling : HasAllFiniteCoordinateSampling θ) : + HasOnlyTrivialInvariantProjections (factor θ) + (weightedOperator θ (fun i => p.C (e i).1)) := by + intro A hAm hA hinv + by_cases hA0 : A = 0 + · exact Or.inl hA0 + by_cases hA1 : A = 1 + · exact Or.inr hA1 + exfalso + have hθ0 : ∀ i, 0 ≤ θ i := fun i => (hadm.1 i).1.le + have hc : ∀ i, 0 ≤ p.C (e i).1 := fun i => (hp.C_pos (e i).1).le + obtain ⟨F, hF, hproj, htri⟩ := exists_covariantProjectionField_pairIdentity + θ (fun i => p.C (e i).1) hθ0 hadm.2.1 hc hsampling A hAm hA hinv + have hnorm : ‖A‖ = 1 := by + have heq : ‖A‖ * ‖A‖ = ‖A‖ := by + rw [← CStarRing.norm_star_mul_self, hA.isSelfAdjoint.star_eq, + hA.isIdempotentElem.eq] + have hpos : 0 < ‖A‖ := norm_pos_iff.mpr hA0 + nlinarith + have hdiag := ae_strict_diagonal_of_invariant_projection hadm A hAm hA hA0 hA1 + hinv F (fun x => by simpa only [hnorm] using hF.2.1 x) hF.2.2.1 hF.2.2.2.1 + have hdiag' : ∀ᵐ x ∂baseMeasure, + 0 < BlockedProductCoupling.projectionDiagonal F x ∧ + BlockedProductCoupling.projectionDiagonal F x < 1 := by + simpa only [BlockedProductCoupling.projectionDiagonal, + BlockedProductCoupling.sourceBasisZero, PositiveDiagonalModel.e0, + lp.inner_single_left, RCLike.inner_apply, map_one, mul_one] using hdiag + have hpair := OrderedProductCoupling.source_circlePairLaw_pairIdentity_of_triangular + p.m p.a p.b hp.m_ge_100 + (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) + e θ (fun i => p.C (e i).1) hθ0 hadm.2.1 hc F hproj + (fun i => (hF.2.2.1 (lp.single 2 i 1)).measurable) htri + have htail := hp.eventually_source_product_tail_estimate e he θ hθ0 hadm.2.1 + hb hsmall hlarge + exact actualSource_projection_contradiction hp e he θ hθ0 hadm.2.1 + (fun i => hb (e i).1 i (ProductPhases.mem_consecutiveBlock_enumeration p.m e he i)) + A F hF hproj hinv hdiag' hpair htail + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductLogIntegral.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductLogIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb5fc7025538c4a2046a9145bd7a384cc5a45db1 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductLogIntegral.lean @@ -0,0 +1,72 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductWeightBridge + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal + +namespace Invariant233.ProductModel + +theorem uniform_floorCost_integral (θ c : ℝ) (hθ : θ ∈ Ico (0 : ℝ) 1) + (hc : 0 ≤ c) : + (∫⁻ u : ℝ, ENNReal.ofReal (c * (⌊u + θ⌋ : ℝ)) + ∂(volume.restrict (Ico (0 : ℝ) 1))) = ENNReal.ofReal (c * θ) := by + classical + have heq : (fun u : ℝ ↦ ENNReal.ofReal (c * (⌊u + θ⌋ : ℝ))) =ᵐ[ + volume.restrict (Ico (0 : ℝ) 1)] + (Ici (1 - θ)).indicator (fun _ ↦ ENNReal.ofReal c) := by + filter_upwards [ae_restrict_mem (μ := (volume : Measure ℝ)) measurableSet_Ico] with u hu + rw [FloorCocycle.floor_add_eq_indicator hu.1 hu.2, + Int.floor_eq_zero_iff.mpr hθ, Int.fract_eq_self.mpr hθ, zero_add] + by_cases h : 1 - θ ≤ u + · simp [h] + · simp [h] + have hinter : Ici (1 - θ) ∩ Ico (0 : ℝ) 1 = Ico (1 - θ) 1 := by + ext u + constructor + · rintro ⟨ha, _, hb⟩ + exact ⟨ha, hb⟩ + · intro hu + exact ⟨hu.1, by linarith [hu.1, hθ.2], hu.2⟩ + rw [lintegral_congr_ae heq, lintegral_indicator_const measurableSet_Ici, + Measure.restrict_apply measurableSet_Ici, hinter, Real.volume_Ico] + rw [show (1 : ℝ) - (1 - θ) = θ by ring, ← ENNReal.ofReal_mul hc] + +theorem measurable_cost_summand (θ c : ℕ → ℝ) (i : ℕ) : + Measurable (fun x : Base ↦ + ENNReal.ofReal (c i * (⌊circleRepresentative (x i) + θ i⌋ : ℝ))) := by + have hrep : Measurable (fun x : Base ↦ circleRepresentative (x i)) := + ProductCocycle.measurable_representative.comp (measurable_pi_apply i) + exact (measurable_const.mul ((measurable_of_countable (fun z : ℤ ↦ (z : ℝ))).comp + ((hrep.add_const (θ i)).floor))).ennreal_ofReal + +theorem lintegral_cost_summand (θ c : ℕ → ℝ) + (hθ : ∀ i, θ i ∈ Ico (0 : ℝ) 1) (hc : ∀ i, 0 ≤ c i) (i : ℕ) : + (∫⁻ x, ENNReal.ofReal (c i * (⌊circleRepresentative (x i) + θ i⌋ : ℝ)) + ∂baseMeasure) = ENNReal.ofReal (c i * θ i) := by + have hm : Measurable (fun u : ℝ ↦ ENNReal.ofReal (c i * (⌊u + θ i⌋ : ℝ))) := + (measurable_const.mul ((measurable_of_countable (fun z : ℤ ↦ (z : ℝ))).comp + ((measurable_id.add_const (θ i)).floor))).ennreal_ofReal + calc + _ = ∫⁻ u : ℝ, ENNReal.ofReal (c i * (⌊u + θ i⌋ : ℝ)) + ∂(volume.restrict (Ico (0 : ℝ) 1)) := + (CocycleSupport.measurePreserving_productRepresentative i).lintegral_comp hm + _ = ENNReal.ofReal (c i * θ i) := uniform_floorCost_integral _ _ (hθ i) (hc i) + +theorem lintegral_logarithmicCost (θ c : ℕ → ℝ) + (hθ : ∀ i, θ i ∈ Ico (0 : ℝ) 1) (hc : ∀ i, 0 ≤ c i) : + (∫⁻ x, logarithmicCost θ c x ∂baseMeasure) = + ∑' i, ENNReal.ofReal (c i * θ i) := by + unfold logarithmicCost + rw [lintegral_tsum (fun i ↦ (measurable_cost_summand θ c i).aemeasurable)] + exact tsum_congr (lintegral_cost_summand θ c hθ hc) + +theorem hasNegInfiniteLogIntegral_iff_tsum (θ c : ℕ → ℝ) + (hθ : ∀ i, θ i ∈ Ico (0 : ℝ) 1) (hc : ∀ i, 0 ≤ c i) : + HasNegInfiniteLogIntegral baseMeasure (weight θ c) ↔ + (∑' i, ENNReal.ofReal (c i * θ i)) = ∞ := by + rw [hasNegInfiniteLogIntegral_iff, lintegral_logarithmicCost θ c hθ hc] + +end Invariant233.ProductModel + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductMultiplierFunctionalCalculus.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductMultiplierFunctionalCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..b982f20be4ddb1a592666fccda995c75d47a21bd --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductMultiplierFunctionalCalculus.lean @@ -0,0 +1,189 @@ +import OAI.Analysis.IrrationalRotation.Model.Product +import OAI.Analysis.IrrationalRotation.Rotation.FieldDiagonal +import OAI.Analysis.IrrationalRotation.Spectral.RotationDeterminant +import OAI.Analysis.IrrationalRotation.Product.ProductWeightBridge + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal + +namespace Invariant233.ProductModel + +theorem multiplier_coordinates_ae (θ : ℕ → ℝ) (g : Base → ℂ) (C : ℝ) + (hC : 0 ≤ C) (hg : Measurable g) (hb : ∀ x, ‖g x‖ ≤ C) (ξ : Hilbert) : + ∀ᵐ x ∂baseMeasure, ∀ k : ℤ, + multiplier θ g C hC hg hb ξ x k = g (rotationIterate θ k x) * ξ x k := by + unfold multiplier + exact WeightedShift.fieldDiagonal_coordinate_ae _ _ _ _ _ ξ + +theorem multiplier_operator_ext {A B : Hilbert →L[ℂ] Hilbert} + (h : ∀ ξ : Hilbert, ∀ᵐ x ∂baseMeasure, ∀ k : ℤ, A ξ x k = B ξ x k) : + A = B := by + apply ContinuousLinearMap.ext + intro ξ + apply Lp.ext + filter_upwards [h ξ] with x hx + exact lp.ext (funext hx) + +theorem vectorTrace_multiplier (θ : ℕ → ℝ) (g : Base → ℂ) (C : ℝ) + (hC : 0 ≤ C) (hg : Measurable g) (hb : ∀ x, ‖g x‖ ≤ C) : + vectorTrace traceVector (multiplier θ g C hC hg hb) = ∫ x, g x ∂baseMeasure := by + change inner ℂ traceVector (multiplier θ g C hC hg hb traceVector) = _ + rw [L2.inner_def] + apply integral_congr_ae + have hv : traceVector =ᵐ[baseMeasure] + fun _ => lp.single 2 (0 : ℤ) (1 : ℂ) := Lp.coeFn_const 2 baseMeasure _ + filter_upwards [hv, multiplier_coordinates_ae θ g C hC hg hb traceVector] with x hv hm + rw [hv, lp.inner_single_left] + rw [hm 0, hv] + simp + congr 1 + funext i + simp [Invariant233.ProductModel.rotationIterate] + +section ContinuousValues +variable {Y : Type*} [TopologicalSpace Y] [CompactSpace Y] + [MeasurableSpace Y] [BorelSpace Y] + +def continuousValueMultiplier (θ : ℕ → ℝ) (a : Base → Y) (ha : Measurable a) + (f : C(Y, ℂ)) : Hilbert →L[ℂ] Hilbert := + multiplier θ (fun x => f (a x)) ‖f‖ (norm_nonneg f) + (f.continuous.measurable.comp ha) (fun x => f.norm_coe_le_norm (a x)) + +theorem continuousValueMultiplier_coordinates_ae (θ : ℕ → ℝ) + (a : Base → Y) (ha : Measurable a) (f : C(Y, ℂ)) (ξ : Hilbert) : + ∀ᵐ x ∂baseMeasure, ∀ k : ℤ, + continuousValueMultiplier θ a ha f ξ x k = + f (a (rotationIterate θ k x)) * ξ x k := + multiplier_coordinates_ae θ _ _ _ _ _ ξ + +@[simp] theorem continuousValueMultiplier_one (θ : ℕ → ℝ) + (a : Base → Y) (ha : Measurable a) : + continuousValueMultiplier θ a ha 1 = 1 := by + apply multiplier_operator_ext + intro ξ + filter_upwards [continuousValueMultiplier_coordinates_ae θ a ha 1 ξ] with x hx + intro k + simpa only [ContinuousMap.one_apply, one_mul, one_apply_eq_self] using hx k + +@[simp] theorem continuousValueMultiplier_mul (θ : ℕ → ℝ) + (a : Base → Y) (ha : Measurable a) (f g : C(Y, ℂ)) : + continuousValueMultiplier θ a ha (f * g) = + continuousValueMultiplier θ a ha f * continuousValueMultiplier θ a ha g := by + apply multiplier_operator_ext + intro ξ + filter_upwards [continuousValueMultiplier_coordinates_ae θ a ha (f * g) ξ, + continuousValueMultiplier_coordinates_ae θ a ha f (continuousValueMultiplier θ a ha g ξ), + continuousValueMultiplier_coordinates_ae θ a ha g ξ] with x hfg hf hg + intro k + change continuousValueMultiplier θ a ha (f * g) ξ x k = + continuousValueMultiplier θ a ha f (continuousValueMultiplier θ a ha g ξ) x k + rw [hfg k, hf k, hg k, ContinuousMap.mul_apply, mul_assoc] + +@[simp] theorem continuousValueMultiplier_add (θ : ℕ → ℝ) + (a : Base → Y) (ha : Measurable a) (f g : C(Y, ℂ)) : + continuousValueMultiplier θ a ha (f + g) = + continuousValueMultiplier θ a ha f + continuousValueMultiplier θ a ha g := by + apply multiplier_operator_ext + intro ξ + filter_upwards [continuousValueMultiplier_coordinates_ae θ a ha (f + g) ξ, + continuousValueMultiplier_coordinates_ae θ a ha f ξ, + continuousValueMultiplier_coordinates_ae θ a ha g ξ, + Lp.coeFn_add (continuousValueMultiplier θ a ha f ξ) + (continuousValueMultiplier θ a ha g ξ)] with x hfg hf hg hs + intro k + change continuousValueMultiplier θ a ha (f + g) ξ x k = + ((continuousValueMultiplier θ a ha f ξ + continuousValueMultiplier θ a ha g ξ) x) k + rw [hs] + change continuousValueMultiplier θ a ha (f + g) ξ x k = + continuousValueMultiplier θ a ha f ξ x k + continuousValueMultiplier θ a ha g ξ x k + rw [hfg k, hf k, hg k, ContinuousMap.add_apply, add_mul] + +@[simp] theorem continuousValueMultiplier_smul (θ : ℕ → ℝ) + (a : Base → Y) (ha : Measurable a) (z : ℂ) (f : C(Y, ℂ)) : + continuousValueMultiplier θ a ha (z • f) = z • continuousValueMultiplier θ a ha f := by + apply multiplier_operator_ext + intro ξ + filter_upwards [continuousValueMultiplier_coordinates_ae θ a ha (z • f) ξ, + continuousValueMultiplier_coordinates_ae θ a ha f ξ, + Lp.coeFn_smul z (continuousValueMultiplier θ a ha f ξ)] with x hzf hf hs + intro k + change continuousValueMultiplier θ a ha (z • f) ξ x k = + ((z • continuousValueMultiplier θ a ha f ξ) x) k + rw [hs] + change continuousValueMultiplier θ a ha (z • f) ξ x k = + z * continuousValueMultiplier θ a ha f ξ x k + rw [hzf k, hf k] + simp only [ContinuousMap.smul_apply, smul_eq_mul, mul_assoc] + +@[simp] theorem continuousValueMultiplier_star (θ : ℕ → ℝ) + (a : Base → Y) (ha : Measurable a) (f : C(Y, ℂ)) : + continuousValueMultiplier θ a ha (star f) = star (continuousValueMultiplier θ a ha f) := by + unfold continuousValueMultiplier multiplier + apply WeightedShift.fieldDiagonal_star_of_eq + exact Filter.Eventually.of_forall fun x => lp.ext (funext fun k => rfl) + +@[simp] theorem continuousValueMultiplier_zero (θ : ℕ → ℝ) + (a : Base → Y) (ha : Measurable a) : continuousValueMultiplier θ a ha 0 = 0 := by + have h := continuousValueMultiplier_smul θ a ha (0 : ℂ) (1 : C(Y, ℂ)) + apply ContinuousLinearMap.ext + intro vector + simpa only [zero_smul, smul_apply, zero_apply] + using congrArg (fun operator : Hilbert →L[ℂ] Hilbert => operator vector) h + +def continuousValueRepresentation (θ : ℕ → ℝ) (a : Base → Y) (ha : Measurable a) : + C(Y, ℂ) →⋆ₐ[ℂ] (Hilbert →L[ℂ] Hilbert) where + toFun := continuousValueMultiplier θ a ha + map_one' := continuousValueMultiplier_one θ a ha + map_mul' := continuousValueMultiplier_mul θ a ha + map_zero' := continuousValueMultiplier_zero θ a ha + map_add' := continuousValueMultiplier_add θ a ha + commutes' z := by + simp only [Algebra.algebraMap_eq_smul_one, continuousValueMultiplier_smul, + continuousValueMultiplier_one] + map_star' := continuousValueMultiplier_star θ a ha + +theorem vectorTrace_continuousValueRepresentation (θ : ℕ → ℝ) + (a : Base → Y) (ha : Measurable a) (f : C(Y, ℂ)) : + vectorTrace traceVector (continuousValueRepresentation θ a ha f) = + ∫ x, f (a x) ∂baseMeasure := + vectorTrace_multiplier θ (fun x => f (a x)) ‖f‖ (norm_nonneg f) + (f.continuous.measurable.comp ha) (fun x => f.norm_coe_le_norm (a x)) + +end ContinuousValues +end Invariant233.ProductModel + +namespace Invariant233 + +theorem vectorFugledeKadisonDeterminant_composed_representation + {H X Y : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [MeasurableSpace X] [TopologicalSpace Y] [CompactSpace Y] + (μ : Measure X) (a : X → Y) + (π : C(Y, ℂ) →⋆ₐ[ℂ] (H →L[ℂ] H)) (ξ : H) + (hξ : ∀ g : C(Y, ℂ), vectorTrace ξ (π g) = ∫ x, g (a x) ∂μ) + (f : C(Y, ℂ)) : + vectorFugledeKadisonDeterminant ξ (π f) = + ⨅ ε : {r : ℝ // 0 < r}, ENNReal.ofReal + (Real.exp ((∫ x, Real.log (‖f (a x)‖ ^ 2 + ε.val) ∂μ) / 2)) := by + let : NormedAlgebra ℝ C(Y, ℂ) := NormedAlgebra.restrictScalars ℝ ℂ C(Y, ℂ) + unfold vectorFugledeKadisonDeterminant + apply iInf_congr + intro ε + rw [← regularizedLog_map π f ε.val ε.property, hξ] + have hpoint : ∀ y, (CFC.log (star f * f + ε.val • (1 : C(Y, ℂ)))) y = + (Real.log (‖f y‖ ^ 2 + ε.val) : ℂ) := by + intro y + have h := regularizedLog_map (ContinuousMap.evalStarAlgHom ℂ ℂ y) f ε.val ε.property + simpa only [ContinuousMap.evalStarAlgHom_apply] using + h.trans (regularizedLog_complex (f y) ε.val) + simp_rw [hpoint] + rw [integral_complex_ofReal] + rfl + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductNorm.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..a65c0bd02a195546aa34c9ec181d91901818f264 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductNorm.lean @@ -0,0 +1,227 @@ +import Mathlib + +namespace OAI + +open Filter +open scoped Topology ENNReal + +namespace Invariant233.ProductNorm + +theorem floor_lower_bound (x t : ℝ) (hx : 0 ≤ x) : + t - 1 ≤ (⌊x + t⌋ : ℝ) := by + have h := Int.sub_one_lt_floor (x + t) + linarith + +theorem finite_cost_lower_bound {ι : Type*} (I : Finset ι) + (c x θ : ι → ℝ) (n : ℕ) + (hc : ∀ i ∈ I, 0 ≤ c i) (hx : ∀ i ∈ I, 0 ≤ x i) : + (n : ℝ) * (∑ i ∈ I, c i * θ i) - (∑ i ∈ I, c i) ≤ + ∑ i ∈ I, c i * (⌊x i + (n : ℝ) * θ i⌋ : ℝ) := by + calc + (n : ℝ) * (∑ i ∈ I, c i * θ i) - (∑ i ∈ I, c i) = + ∑ i ∈ I, c i * ((n : ℝ) * θ i - 1) := by + simp only [Finset.mul_sum, Finset.sum_sub_distrib, mul_sub, mul_one] + congr 1 + apply Finset.sum_congr rfl + intro i hi + ring + _ ≤ _ := Finset.sum_le_sum fun i hi => + mul_le_mul_of_nonneg_left (floor_lower_bound (x i) ((n : ℝ) * θ i) (hx i hi)) + (hc i hi) + +theorem finite_weight_upper_bound {ι : Type*} (I : Finset ι) + (c x θ : ι → ℝ) (n : ℕ) + (hc : ∀ i ∈ I, 0 ≤ c i) (hx : ∀ i ∈ I, 0 ≤ x i) : + Real.exp (-(∑ i ∈ I, c i * (⌊x i + (n : ℝ) * θ i⌋ : ℝ))) ≤ + Real.exp ((∑ i ∈ I, c i) - (n : ℝ) * (∑ i ∈ I, c i * θ i)) := by + apply Real.exp_le_exp.mpr + have h := finite_cost_lower_bound I c x θ n hc hx + linarith + +theorem infinite_weight_upper_bound {ι : Type*} (I : Finset ι) + (c x θ : ι → ℝ) (n : ℕ) + (hc : ∀ i, 0 ≤ c i) (hx : ∀ i, 0 ≤ x i) (hθ : ∀ i, 0 ≤ θ i) + (hsum : Summable (fun i => c i * (⌊x i + (n : ℝ) * θ i⌋ : ℝ))) : + Real.exp (-(∑' i, c i * (⌊x i + (n : ℝ) * θ i⌋ : ℝ))) ≤ + Real.exp ((∑ i ∈ I, c i) - (n : ℝ) * (∑ i ∈ I, c i * θ i)) := by + have hcost : ∀ i, 0 ≤ c i * (⌊x i + (n : ℝ) * θ i⌋ : ℝ) := by + intro i + apply mul_nonneg (hc i) + exact_mod_cast Int.floor_nonneg.mpr (add_nonneg (hx i) (mul_nonneg (Nat.cast_nonneg n) (hθ i))) + calc + Real.exp (-(∑' i, c i * (⌊x i + (n : ℝ) * θ i⌋ : ℝ))) ≤ + Real.exp (-(∑ i ∈ I, c i * (⌊x i + (n : ℝ) * θ i⌋ : ℝ))) := by + apply Real.exp_le_exp.mpr + exact neg_le_neg (Summable.sum_le_tsum I (fun i _hi => hcost i) hsum) + _ ≤ _ := finite_weight_upper_bound I c x θ n (fun i _ => hc i) (fun i _ => hx i) + +theorem root_upper_bound (u C S : ℝ) (n : ℕ) (hn : 0 < n) + (hu : 0 ≤ u) (h : u ≤ Real.exp (C - (n : ℝ) * S)) : + u ^ (1 / (n : ℝ)) ≤ Real.exp (C / (n : ℝ) - S) := by + have hn' : (n : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hn) + calc + u ^ (1 / (n : ℝ)) ≤ Real.exp (C - (n : ℝ) * S) ^ (1 / (n : ℝ)) := + Real.rpow_le_rpow hu h (by positivity) + _ = Real.exp ((C - (n : ℝ) * S) * (1 / (n : ℝ))) := + (Real.exp_mul _ _).symm + _ = Real.exp (C / (n : ℝ) - S) := by + congr 1 + field_simp + +theorem tendsto_root_zero_of_exponential_bounds + (u C S : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) + (hbound : ∀ q n, 0 < n → u n ≤ Real.exp (C q - (n : ℝ) * S q)) + (hS : ∀ b : ℝ, ∃ q, b < S q) : + Tendsto (fun n : ℕ => (u n) ^ (1 / (n : ℝ))) atTop (𝓝 0) := by + apply tendsto_order.mpr + constructor + · intro a ha + exact Filter.Eventually.of_forall fun n => + lt_of_lt_of_le ha (Real.rpow_nonneg (hu n) _) + · intro ε hε + obtain ⟨q, hq⟩ := hS (1 - Real.log ε) + have hlim : Tendsto (fun n : ℕ => C q / (n : ℝ)) atTop (𝓝 0) := + tendsto_const_div_atTop_nhds_zero_nat (C q) + have hevent : ∀ᶠ n : ℕ in atTop, C q / (n : ℝ) < 1 := + hlim.eventually (eventually_lt_nhds (by norm_num)) + filter_upwards [hevent, Filter.eventually_gt_atTop (0 : ℕ)] with n hn hnpos + calc + (u n) ^ (1 / (n : ℝ)) ≤ Real.exp (C q / (n : ℝ) - S q) := + root_upper_bound (u n) (C q) (S q) n hnpos (hu n) (hbound q n hnpos) + _ < Real.exp (Real.log ε) := Real.exp_lt_exp.mpr (by linarith) + _ = ε := Real.exp_log hε + +theorem block_angle_sum_lower_bound {ι : Type*} (I : Finset ι) + (hI : I.Nonempty) (K : ℝ) (hK : 0 < K) (θ : ι → ℝ) + (hθ : ∀ i ∈ I, 1 / ((I.card : ℝ) * K) ≤ θ i) : + 1 / K ≤ ∑ i ∈ I, θ i := by + have hcard : (I.card : ℝ) ≠ 0 := by + exact_mod_cast Finset.card_ne_zero.mpr hI + have hK0 : K ≠ 0 := ne_of_gt hK + calc + 1 / K = ∑ _i ∈ I, 1 / ((I.card : ℝ) * K) := by + simp only [Finset.sum_const, nsmul_eq_mul] + field_simp + _ ≤ _ := Finset.sum_le_sum hθ + +theorem one_le_block_cost (C K angleSum : ℝ) (hK : 1 ≤ K) + (hC : K ^ 2 ≤ C) (hθ : 1 / K ≤ angleSum) : + 1 ≤ C * angleSum := by + have hKpos : 0 < K := lt_of_lt_of_le zero_lt_one hK + have hCnonneg : 0 ≤ C := (sq_nonneg K).trans hC + have hCK : K ≤ C / K := (le_div_iff₀ hKpos).mpr (by nlinarith) + calc + 1 ≤ K := hK + _ ≤ C / K := hCK + _ = C * (1 / K) := by ring + _ ≤ C * angleSum := mul_le_mul_of_nonneg_left hθ hCnonneg + +theorem unbounded_prefix_cost (b : ℕ → ℝ) (hb : ∀ j, 1 ≤ b j) : + ∀ a : ℝ, ∃ q : ℕ, a < ∑ j ∈ Finset.range q, b j := by + intro a + obtain ⟨q, hq⟩ := exists_nat_gt a + refine ⟨q, hq.trans_le ?_⟩ + calc + (q : ℝ) = ∑ _j ∈ Finset.range q, (1 : ℝ) := by simp + _ ≤ _ := Finset.sum_le_sum fun j _hj => hb j + +theorem block_cost_tsum_eq_top (C K angleSum : ℕ → ℝ) + (hK : ∀ j, 1 ≤ K j) (hC : ∀ j, K j ^ 2 ≤ C j) + (hθ : ∀ j, 1 / K j ≤ angleSum j) : + (∑' j, ENNReal.ofReal (C j * angleSum j)) = ⊤ := by + apply top_unique + calc + (⊤ : ℝ≥0∞) = ∑' _j : ℕ, (1 : ℝ≥0∞) := + (ENNReal.tsum_const_eq_top_of_ne_zero one_ne_zero).symm + _ ≤ _ := ENNReal.tsum_le_tsum fun j => by + simpa using ENNReal.ofReal_le_ofReal + (one_le_block_cost (C j) (K j) (angleSum j) (hK j) (hC j) (hθ j)) + +theorem exists_finite_sum_gt_of_tsum_eq_top {ι : Type*} + (a : ι → ℝ) (ha : ∀ i, 0 ≤ a i) + (hdiv : (∑' i, ENNReal.ofReal (a i)) = ⊤) (b : ℝ) : + ∃ I : Finset ι, b < ∑ i ∈ I, a i := by + classical + by_cases hb : 0 ≤ b + · have hlt : ENNReal.ofReal b < ∑' i, ENNReal.ofReal (a i) := by + rw [hdiv] + exact ENNReal.ofReal_lt_top + rw [ENNReal.tsum_eq_iSup_sum] at hlt + obtain ⟨I, hI⟩ := lt_iSup_iff.mp hlt + refine ⟨I, ?_⟩ + rw [← ENNReal.ofReal_sum_of_nonneg (fun i _hi => ha i)] at hI + exact (ENNReal.ofReal_lt_ofReal_iff_of_nonneg hb).mp hI + · exact ⟨∅, by simpa using lt_of_not_ge hb⟩ + +theorem tsum_eq_top_of_disjoint_blocks {ι : Type*} + (J : ℕ → Finset ι) (hJ : Pairwise (fun j k => Disjoint (J j) (J k))) + (a : ι → ℝ≥0∞) (ha : ∀ j, 1 ≤ ∑ i ∈ J j, a i) : + (∑' i, a i) = ⊤ := by + classical + let e : (Σ j : ℕ, ↥(J j)) → ι := fun p => p.2.1 + have he : Function.Injective e := by + rintro ⟨j, i, hi⟩ ⟨k, l, hl⟩ hil + change i = l at hil + have hjk : j = k := by + by_contra hne + exact Finset.disjoint_left.mp (hJ hne) hi (hil.symm ▸ hl) + subst k + subst l + rfl + apply top_unique + calc + (⊤ : ℝ≥0∞) = ∑' _j : ℕ, (1 : ℝ≥0∞) := + (ENNReal.tsum_const_eq_top_of_ne_zero one_ne_zero).symm + _ ≤ ∑' j : ℕ, ∑' i : ↥(J j), a i := ENNReal.tsum_le_tsum fun j => by + simpa only [tsum_fintype, Finset.univ_eq_attach, Finset.sum_attach] using ha j + _ = ∑' p : (Σ j : ℕ, ↥(J j)), a (e p) := + (ENNReal.tsum_sigma (fun j (i : ↥(J j)) => a i)).symm + _ ≤ ∑' i, a i := ENNReal.tsum_comp_le_tsum_of_injective he a + +theorem block_coordinate_cost_tsum_eq_top + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) (C K : ℕ → ℝ) + (θ : (Σ j : ℕ, Fin (m j)) → ℝ) + (hK : ∀ j, 1 ≤ K j) (hC : ∀ j, K j ^ 2 ≤ C j) + (hθ0 : ∀ i, 0 ≤ θ i) + (hθ : ∀ j (i : Fin (m j)), 1 / ((m j : ℝ) * K j) ≤ θ ⟨j, i⟩) : + (∑' i, ENNReal.ofReal (C i.1) * ENNReal.ofReal (θ i)) = ⊤ := by + rw [ENNReal.tsum_sigma (fun j (i : Fin (m j)) => + ENNReal.ofReal (C j) * ENNReal.ofReal (θ ⟨j, i⟩))] + apply top_unique + calc + (⊤ : ℝ≥0∞) = ∑' _j : ℕ, (1 : ℝ≥0∞) := + (ENNReal.tsum_const_eq_top_of_ne_zero one_ne_zero).symm + _ ≤ _ := ENNReal.tsum_le_tsum fun j => by + have hC0 : 0 ≤ C j := (sq_nonneg (K j)).trans (hC j) + have hI : (Finset.univ : Finset (Fin (m j))).Nonempty := by + exact ⟨⟨0, hm j⟩, Finset.mem_univ _⟩ + have hsum : 1 / K j ≤ ∑ i : Fin (m j), θ ⟨j, i⟩ := by + apply block_angle_sum_lower_bound Finset.univ hI (K j) + (lt_of_lt_of_le zero_lt_one (hK j)) (fun i => θ ⟨j, i⟩) + intro i hi + simpa using hθ j i + have hblock := one_le_block_cost (C j) (K j) + (∑ i : Fin (m j), θ ⟨j, i⟩) (hK j) (hC j) hsum + calc + (1 : ℝ≥0∞) ≤ ENNReal.ofReal (C j * ∑ i : Fin (m j), θ ⟨j, i⟩) := by + simpa using ENNReal.ofReal_le_ofReal hblock + _ = ∑' i : Fin (m j), ENNReal.ofReal (C j) * ENNReal.ofReal (θ ⟨j, i⟩) := by + rw [ENNReal.ofReal_mul hC0, ENNReal.ofReal_sum_of_nonneg + (fun i _hi => hθ0 ⟨j, i⟩), tsum_fintype, Finset.mul_sum] + +theorem tendsto_root_zero_of_block_bounds + (u loss C K angleSum : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) + (hK : ∀ j, 1 ≤ K j) (hC : ∀ j, K j ^ 2 ≤ C j) + (hθ : ∀ j, 1 / K j ≤ angleSum j) + (hbound : ∀ q n, 0 < n → + u n ≤ Real.exp (loss q - (n : ℝ) * + (∑ j ∈ Finset.range q, C j * angleSum j))) : + Tendsto (fun n : ℕ => (u n) ^ (1 / (n : ℝ))) atTop (𝓝 0) := by + apply tendsto_root_zero_of_exponential_bounds u loss + (fun q => ∑ j ∈ Finset.range q, C j * angleSum j) hu hbound + exact unbounded_prefix_cost _ fun j => + one_le_block_cost (C j) (K j) (angleSum j) (hK j) (hC j) (hθ j) + +end Invariant233.ProductNorm + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductObstructionConstant.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductObstructionConstant.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d33288bd685fb7475f0fa6132435a447828b246 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductObstructionConstant.lean @@ -0,0 +1,58 @@ +import OAI.Analysis.IrrationalRotation.Analysis.ParameterAttenuationConsequences +import OAI.Analysis.IrrationalRotation.Analysis.ConvolutionUniformConstant + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped Topology +open InvariantProjection.ConditionalConvolution + +namespace Invariant233.ProductScaleLaws +variable {p : ProductScaleData} (hp : ProductScaleLaws p) +include hp + +theorem conditional_bound {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} [IsProbabilityMeasure μ] + (n : ℕ) {c η δ : ℝ} + (d : Data Ω μ (p.K n) (p.coefficientBound n) + (1 / ((n + 1 : ℕ) : ℝ)) c η δ) + (hη : 0 ≤ η) (hδ : 0 ≤ δ) : + c * p.ε n ≤ ((2 * p.K n + 1 : ℕ) : ℝ) * (η + 2 * Real.sqrt δ) := by + apply d.obstruction_of_coefficient_bound (hp.epsilon_pos n).le _ hη hδ + exact hp.polynomial_lower n + +theorem no_conditional_data_at_stage {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} [IsProbabilityMeasure μ] + (n : ℕ) (c : ℝ) (hc : 1 / ((n + 1 : ℕ) : ℝ) < c) : + ¬ Nonempty (Data Ω μ (p.K n) (p.coefficientBound n) + (1 / ((n + 1 : ℕ) : ℝ)) c + (Real.exp (-p.L n)) (Real.exp (-p.L n / 400))) := by + rintro ⟨d⟩ + have h := hp.conditional_bound n d (Real.exp_pos _).le (Real.exp_pos _).le + have h' : c * p.ε n ≤ (2 * (p.K n : ℝ) + 1) * + (Real.exp (-p.L n) + 2 * Real.sqrt (Real.exp (-p.L n / 400))) := by + simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] using h + exact ConvolutionContradiction.fixed_stage_contradiction c (p.ε n) + ((n + 1 : ℕ) : ℝ) (hp.epsilon_pos n) hc (h'.trans (hp.conditional_tail_le n)) + +theorem not_eventually_conditional_data + {Ω : ℕ → Type*} [∀ n, MeasurableSpace (Ω n)] + (μ : ∀ n, Measure (Ω n)) [∀ n, IsProbabilityMeasure (μ n)] + (c : ℝ) (hc : 0 < c) : + ¬ ∀ᶠ n in atTop, + Nonempty (Data (Ω n) (μ n) (p.K n) (p.coefficientBound n) + (1 / ((n + 1 : ℕ) : ℝ)) c + (Real.exp (-p.L n)) (Real.exp (-p.L n / 400))) := by + intro h + apply hp.not_eventually_conditional_obstruction c hc + filter_upwards [h] with n hn + obtain ⟨d⟩ := hn + have hb := hp.conditional_bound n d (Real.exp_pos _).le (Real.exp_pos _).le + simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] using hb + +end Invariant233.ProductScaleLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitFiberNull.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitFiberNull.lean new file mode 100644 index 0000000000000000000000000000000000000000..8dcedbc6374cc6971cca3d411b01527014d61709 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitFiberNull.lean @@ -0,0 +1,93 @@ +import OAI.Analysis.IrrationalRotation.Analysis.OrbitFiberNull +import OAI.Analysis.IrrationalRotation.Product.ProductBaseDynamics +import OAI.Analysis.IrrationalRotation.Product.ProductLogIntegral + +namespace OAI + +noncomputable section +open MeasureTheory Set Function +open scoped ENNReal + +namespace Invariant233.ProductModel + +private def orbitPerm (θ : ℕ → ℝ) : Equiv.Perm Base := + Equiv.addRight (fun i => (θ i : Circle)) + +private theorem orbitPerm_apply (θ : ℕ → ℝ) (x : Base) : + orbitPerm θ x = rotation θ x := rfl + +private theorem orbitPerm_zpow (θ : ℕ → ℝ) (n : ℤ) (x : Base) : + (orbitPerm θ ^ n) x = rotationIterate θ n x := by + cases n with + | ofNat n => + change ((Equiv.addRight (fun i => (θ i : Circle))) ^ n) x = _ + rw [Equiv.Perm.coe_pow] + change (fun x : Base => x + fun i => (θ i : Circle))^[n] x = _ + rw [add_right_iterate] + ext i + change x i + n • (θ i : Circle) = x i + (((n : ℤ) : ℝ) * θ i : ℝ) + rw [← AddCircle.coe_nsmul] + simp [nsmul_eq_mul] + | negSucc n => + rw [zpow_negSucc, ← inv_pow] + change ((Equiv.addRight (fun i => (θ i : Circle))).symm ^ (n + 1)) x = _ + rw [Equiv.addRight_symm, Equiv.Perm.coe_pow] + change (fun x : Base => x + -(fun i => (θ i : Circle)))^[n + 1] x = _ + rw [add_right_iterate] + ext i + change x i + (n + 1) • (-(θ i : Circle)) = + x i + (((Int.negSucc n : ℤ) : ℝ) * θ i : ℝ) + rw [← AddCircle.coe_neg, ← AddCircle.coe_nsmul] + congr 2 + simp [nsmul_eq_mul] + ring + +theorem rotation_joint_fiber_measure_zero + {Y : Type*} [MeasurableSpace Y] [Nonempty Y] + [MeasurableSpace.CountablySeparated Y] [MeasurableSingletonClass Y] + {θ : ℕ → ℝ} (hθ : JointlyRationallyIndependent θ) + {f : Base → Y} (hf : Measurable f) + (hnonconstant : ¬ ∃ c : Y, f =ᵐ[baseMeasure] Function.const Base c) + (z : ℤ → Y) : + baseMeasure {x | ∀ n : ℤ, f (rotationIterate θ n x) = z n} = 0 := by + have hm : Measurable (orbitPerm θ) := (measurePreserving_rotation θ).measurable + have hi : Measurable (orbitPerm θ).symm := by + change Measurable (fun x : Base => x - fun i => (θ i : Circle)) + fun_prop + have he : ∀ n : ℕ, 0 < n → Ergodic (orbitPerm θ : Base → Base)^[n] baseMeasure := by + intro n hn + exact rotation_totalErgodic hθ hn + simpa only [orbitPerm_zpow] using + orbit_joint_fiber_measure_zero (orbitPerm θ) hm hi he hf hnonconstant z + +theorem weight_rotation_joint_fiber_measure_zero + (θ c : ℕ → ℝ) (hadm : AdmissibleAnglesAndCosts θ c) + (hdiv : (∑' i, ENNReal.ofReal (c i * θ i)) = ∞) (z : ℤ → ℝ) : + baseMeasure {x | ∀ n : ℤ, weight θ c (rotationIterate θ n x) = z n} = 0 := by + apply rotation_joint_fiber_measure_zero hadm.2.2 (measurable_weight θ c) + apply not_ae_constant_of_negInfiniteLogIntegral + · exact (ae_weight_pos θ c (fun i => (hadm.1 i).1.le) + (fun i => (hadm.1 i).2.2.le) hadm.2.1).mono fun _ h => h.ne' + · exact (hasNegInfiniteLogIntegral_iff_tsum θ c + (fun i => ⟨(hadm.1 i).1.le, (hadm.1 i).2.1⟩) + (fun i => (hadm.1 i).2.2.le)).mpr hdiv + +theorem weight_polar_joint_fiber_measure_zero + (θ c : ℕ → ℝ) (hadm : AdmissibleAnglesAndCosts θ c) + (hdiv : (∑' i, ENNReal.ofReal (c i * θ i)) = ∞) + (k : ℤ) (z : ℤ → ℂ) : + baseMeasure {x | ∀ n : ℤ, + (weight θ c (rotationIterate θ (k - n) x) : ℂ) = z n} = 0 := by + apply measure_mono_null (t := {x | ∀ n : ℤ, + weight θ c (rotationIterate θ n x) = (z (k - n)).re}) + · intro x hx n + have he := congrArg Complex.re (hx (k - n)) + have hk : k - (k - n) = n := by omega + simpa only [hk, Complex.ofReal_re] using he + · exact weight_rotation_joint_fiber_measure_zero θ c hadm hdiv _ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitL2Marginals.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitL2Marginals.lean new file mode 100644 index 0000000000000000000000000000000000000000..2506c070733d4d1d2a8182a0f7c1b6f48d757f48 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitL2Marginals.lean @@ -0,0 +1,60 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductOrbitMarginals +import OAI.Analysis.IrrationalRotation.Analysis.RealDensityLp + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal BigOperators + +namespace Invariant233.ProductModel.TailTrimming + +theorem hasUniformL2Marginals_of_average_bounds (θ : ℕ → ℝ) + (N : ℕ → Finset ℕ) (w : ℕ → ℕ → Base → ℝ) + (hw : ∀ l, ∀ n ∈ N l, Measurable (w l n)) + (hw0 : ∀ l, ∀ n ∈ N l, ∀ x, 0 ≤ w l n x) + {H : ℝ} (hH : 0 ≤ H) + (hfirst : ∀ l, eLpNorm + (fun x => ((N l).card : ℝ)⁻¹ * ∑ n ∈ N l, w l n x) 2 baseMeasure ≤ + ENNReal.ofReal H) + (hsecond : ∀ l, eLpNorm + (fun y => ((N l).card : ℝ)⁻¹ * + ∑ n ∈ N l, w l n (rotationIterate θ (-(n : ℤ)) y)) 2 baseMeasure ≤ + ENNReal.ofReal H) : + HasUniformL2Marginals + (fun l => orbitAverageMeasure θ (N l) (fun n x => ENNReal.ofReal (w l n x))) := by + refine ⟨H, hH, ?_⟩ + intro l + have hf : MemLp + (fun x => ((N l).card : ℝ)⁻¹ * ∑ n ∈ N l, w l n x) 2 baseMeasure := + lt_of_le_of_lt (hfirst l) ENNReal.ofReal_lt_top + have hg : MemLp + (fun y => ((N l).card : ℝ)⁻¹ * + ∑ n ∈ N l, w l n (rotationIterate θ (-(n : ℤ)) y)) 2 baseMeasure := + lt_of_le_of_lt (hsecond l) ENNReal.ofReal_lt_top + have hf0 : 0 ≤ᵐ[baseMeasure] + (fun x => ((N l).card : ℝ)⁻¹ * ∑ n ∈ N l, w l n x) := by + apply Filter.Eventually.of_forall + intro x + exact mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg _)) + (Finset.sum_nonneg (fun n hn => hw0 l n hn x)) + have hg0 : 0 ≤ᵐ[baseMeasure] + (fun y => ((N l).card : ℝ)⁻¹ * + ∑ n ∈ N l, w l n (rotationIterate θ (-(n : ℤ)) y)) := by + apply Filter.Eventually.of_forall + intro y + exact mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg _)) + (Finset.sum_nonneg (fun n hn => hw0 l n hn _)) + obtain ⟨f, hf0', hfEq, hfBound⟩ := DensityTransport.exists_Lp_density_of_memLp + baseMeasure _ hf hf0 (orbitAverageMeasure_first_marginal_real θ (N l) (w l) + (hw l) (hw0 l)) hH (hfirst l) + obtain ⟨g, hg0', hgEq, hgBound⟩ := DensityTransport.exists_Lp_density_of_memLp + baseMeasure _ hg hg0 (orbitAverageMeasure_second_marginal_real θ (N l) (w l) + (hw l) (hw0 l)) hH (hsecond l) + exact ⟨f, g, hf0', hg0', hfEq, hgEq, hfBound, hgBound⟩ + +end Invariant233.ProductModel.TailTrimming + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitMarginals.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitMarginals.lean new file mode 100644 index 0000000000000000000000000000000000000000..642716c60cf90be8f99ac61d71e0210516c4084c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitMarginals.lean @@ -0,0 +1,145 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductTailTrimming +import OAI.Analysis.IrrationalRotation.Rotation.WeightedGraphMarginals + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal BigOperators + +namespace Invariant233.ProductModel.TailTrimming + +theorem rotationIterate_inverse_left (θ : ℕ → ℝ) (k : ℤ) (x : Base) : + rotationIterate θ (-k) (rotationIterate θ k x) = x := by + change ProductCocycle.rotate θ (-k) (ProductCocycle.rotate θ k x) = x + rw [← ProductCocycle.rotate_add, add_neg_cancel, ProductCocycle.rotate_zero] + +theorem orbitPairMeasure_first_marginal (θ : ℕ → ℝ) (n : ℕ) + (w : Base → ℝ≥0∞) : + (orbitPairMeasure θ n w).map Prod.fst = baseMeasure.withDensity w := by + exact WeightedGraphMarginals.map_fst_graph _ + (ProductCocycle.measurePreserving_rotate θ (n : ℤ)).measurable + +theorem orbitPairMeasure_second_marginal (θ : ℕ → ℝ) (n : ℕ) + (w : Base → ℝ≥0∞) (hw : Measurable w) : + (orbitPairMeasure θ n w).map Prod.snd = + baseMeasure.withDensity (fun y => w (rotationIterate θ (-(n : ℤ)) y)) := by + exact (WeightedGraphMarginals.map_snd_graph (baseMeasure.withDensity w) + (T := rotationIterate θ (n : ℤ)) + (ProductCocycle.measurePreserving_rotate θ (n : ℤ)).measurable).trans + (WeightedGraphMarginals.map_withDensity_inverse baseMeasure + (ProductCocycle.measurePreserving_rotate θ (n : ℤ)) + (ProductCocycle.measurePreserving_rotate θ (-(n : ℤ))).measurable + (rotationIterate_inverse_left θ (n : ℤ)) hw) + +theorem orbitAverageMeasure_first_marginal (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ≥0∞) (hw : ∀ n ∈ N, Measurable (w n)) : + (orbitAverageMeasure θ N w).map Prod.fst = + baseMeasure.withDensity (fun x => (N.card : ℝ≥0∞)⁻¹ * ∑ n ∈ N, w n x) := by + rw [orbitAverageMeasure, Measure.map_smul _ measurable_fst.aemeasurable, + WeightedGraphMarginals.map_finset_sum _ _ measurable_fst] + simp_rw [orbitPairMeasure_first_marginal] + rw [show (fun x => (N.card : ℝ≥0∞)⁻¹ * ∑ n ∈ N, w n x) = + (N.card : ℝ≥0∞)⁻¹ • (fun x => ∑ n ∈ N, w n x) from rfl, + withDensity_smul _ (Finset.measurable_sum N hw), + WeightedGraphMarginals.withDensity_finset_sum baseMeasure N w hw] + +theorem orbitAverageMeasure_second_marginal (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ≥0∞) (hw : ∀ n ∈ N, Measurable (w n)) : + (orbitAverageMeasure θ N w).map Prod.snd = + baseMeasure.withDensity (fun y => (N.card : ℝ≥0∞)⁻¹ * + ∑ n ∈ N, w n (rotationIterate θ (-(n : ℤ)) y)) := by + rw [orbitAverageMeasure, Measure.map_smul _ measurable_snd.aemeasurable, + WeightedGraphMarginals.map_finset_sum _ _ measurable_snd] + have hwi (n : ℕ) (hn : n ∈ N) : + Measurable (fun y => w n (rotationIterate θ (-(n : ℤ)) y)) := + (hw n hn).comp (ProductCocycle.measurePreserving_rotate θ (-(n : ℤ))).measurable + rw [show (fun y => (N.card : ℝ≥0∞)⁻¹ * + ∑ n ∈ N, w n (rotationIterate θ (-(n : ℤ)) y)) = + (N.card : ℝ≥0∞)⁻¹ • + (fun y => ∑ n ∈ N, w n (rotationIterate θ (-(n : ℤ)) y)) from rfl, + withDensity_smul _ (Finset.measurable_sum N hwi), + WeightedGraphMarginals.withDensity_finset_sum baseMeasure N _ hwi] + congr 1 + exact Finset.sum_congr rfl fun n hn => orbitPairMeasure_second_marginal θ n (w n) (hw n hn) + +theorem orbitPairMeasure_restrict (θ : ℕ → ℝ) (n : ℕ) + (w : Base → ℝ≥0∞) (A : Set EndpointPair) (hA : MeasurableSet A) : + (orbitPairMeasure θ n w).restrict A = + orbitPairMeasure θ n ((orbitPairMap θ n ⁻¹' A).indicator w) := by + unfold orbitPairMeasure + rw [Measure.restrict_map (measurable_orbitPairMap θ n) hA, + restrict_withDensity ((measurable_orbitPairMap θ n) hA), + ← withDensity_indicator ((measurable_orbitPairMap θ n) hA)] + +theorem orbitAverageMeasure_restrict (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ≥0∞) (A : Set EndpointPair) (hA : MeasurableSet A) : + (orbitAverageMeasure θ N w).restrict A = + orbitAverageMeasure θ N (fun n => (orbitPairMap θ n ⁻¹' A).indicator (w n)) := by + unfold orbitAverageMeasure + rw [Measure.restrict_smul] + have hsum : (∑ n ∈ N, orbitPairMeasure θ n (w n)).restrict A = + ∑ n ∈ N, (orbitPairMeasure θ n (w n)).restrict A := by + simp only [← Measure.restrictₗ_apply, map_sum] + rw [hsum] + congr 1 + exact Finset.sum_congr rfl fun n _ => orbitPairMeasure_restrict θ n (w n) A hA + +theorem orbitAverageMeasure_restrict_first_marginal (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ≥0∞) (hw : ∀ n ∈ N, Measurable (w n)) + (A : Set EndpointPair) (hA : MeasurableSet A) : + ((orbitAverageMeasure θ N w).restrict A).map Prod.fst = + baseMeasure.withDensity (fun x => (N.card : ℝ≥0∞)⁻¹ * + ∑ n ∈ N, (orbitPairMap θ n ⁻¹' A).indicator (w n) x) := by + rw [orbitAverageMeasure_restrict θ N w A hA] + exact orbitAverageMeasure_first_marginal θ N _ + (fun n hn => (hw n hn).indicator ((measurable_orbitPairMap θ n) hA)) + +theorem orbitAverageMeasure_restrict_second_marginal (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ≥0∞) (hw : ∀ n ∈ N, Measurable (w n)) + (A : Set EndpointPair) (hA : MeasurableSet A) : + ((orbitAverageMeasure θ N w).restrict A).map Prod.snd = + baseMeasure.withDensity (fun y => (N.card : ℝ≥0∞)⁻¹ * + ∑ n ∈ N, (orbitPairMap θ n ⁻¹' A).indicator (w n) + (rotationIterate θ (-(n : ℤ)) y)) := by + rw [orbitAverageMeasure_restrict θ N w A hA] + exact orbitAverageMeasure_second_marginal θ N _ + (fun n hn => (hw n hn).indicator ((measurable_orbitPairMap θ n) hA)) + +theorem ofReal_average_eq (N : Finset ℕ) (w : ℕ → ℝ) + (hw : ∀ n ∈ N, 0 ≤ w n) : + ENNReal.ofReal ((N.card : ℝ)⁻¹ * ∑ n ∈ N, w n) = + (N.card : ℝ≥0∞)⁻¹ * ∑ n ∈ N, ENNReal.ofReal (w n) := by + rcases N.eq_empty_or_nonempty with rfl | hN + · simp + have hc : 0 < (N.card : ℝ) := by exact_mod_cast hN.card_pos + rw [ENNReal.ofReal_mul (inv_nonneg.mpr hc.le), ENNReal.ofReal_inv_of_pos hc, + ENNReal.ofReal_natCast, ENNReal.ofReal_sum_of_nonneg hw] + +theorem orbitAverageMeasure_first_marginal_real (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ) (hw : ∀ n ∈ N, Measurable (w n)) + (hw0 : ∀ n ∈ N, ∀ x, 0 ≤ w n x) : + (orbitAverageMeasure θ N (fun n x => ENNReal.ofReal (w n x))).map Prod.fst = + baseMeasure.withDensity (fun x => ENNReal.ofReal + ((N.card : ℝ)⁻¹ * ∑ n ∈ N, w n x)) := by + rw [orbitAverageMeasure_first_marginal θ N _ (fun n hn => (hw n hn).ennreal_ofReal)] + congr 1 + funext x + exact (ofReal_average_eq N (fun n => w n x) (fun n hn => hw0 n hn x)).symm + +theorem orbitAverageMeasure_second_marginal_real (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ) (hw : ∀ n ∈ N, Measurable (w n)) + (hw0 : ∀ n ∈ N, ∀ x, 0 ≤ w n x) : + (orbitAverageMeasure θ N (fun n x => ENNReal.ofReal (w n x))).map Prod.snd = + baseMeasure.withDensity (fun y => ENNReal.ofReal + ((N.card : ℝ)⁻¹ * ∑ n ∈ N, w n (rotationIterate θ (-(n : ℤ)) y))) := by + rw [orbitAverageMeasure_second_marginal θ N _ (fun n hn => (hw n hn).ennreal_ofReal)] + congr 1 + funext y + exact (ofReal_average_eq N _ (fun n hn => hw0 n hn _)).symm + +end Invariant233.ProductModel.TailTrimming + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitPair.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitPair.lean new file mode 100644 index 0000000000000000000000000000000000000000..61d3528ff8a0e5b230e8f202902d7c1ad97515b8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitPair.lean @@ -0,0 +1,115 @@ +import OAI.Analysis.IrrationalRotation.Analysis.RepresentedInvariance +import OAI.Analysis.IrrationalRotation.Product.ProductFieldRepresentation +import OAI.Analysis.IrrationalRotation.Product.ProductPowerIdentity +import OAI.Analysis.IrrationalRotation.Rotation.WeightedOrbitInvariance +import OAI.Analysis.IrrationalRotation.Product.ProductCocycleInterchange +import OAI.Analysis.IrrationalRotation.Product.ProductPairRatios + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal BigOperators + +namespace Invariant233.ProductModel + +def actualWeightField (θ c : ℕ → ℝ) (x : Base) : WeightedShift.Weight := + multiplierField θ (fun y => (weight θ c y : ℂ)) 1 (fun y => by + simpa only [Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (weight_mem_Icc θ c y).1] using (weight_mem_Icc θ c y).2) x + +@[simp] theorem actualWeightField_apply (θ c : ℕ → ℝ) (x : Base) (k : ℤ) : + actualWeightField θ c x k = (weight θ c (rotationIterate θ k x) : ℂ) := rfl + +theorem weightedOperator_ae_actualWeightField (θ c : ℕ → ℝ) (f : Hilbert) : + weightedOperator θ c f =ᵐ[baseMeasure] fun x => + WeightedShift.operator (actualWeightField θ c x) (f x) := by + have ha (x : Base) : ‖actualWeightField θ c x‖ ≤ 1 := + lp.norm_le_of_forall_le (by norm_num) (fun k => by + simpa only [actualWeightField_apply, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (weight_mem_Icc θ c _).1] using (weight_mem_Icc θ c _).2) + have hm (k : ℤ) : AEStronglyMeasurable + (fun x => actualWeightField θ c x k) baseMeasure := + ((measurable_weight θ c).complex_ofReal.comp + (rotationIterate_measurePreserving θ k).measurable).aestronglyMeasurable + exact WeightedShift.fieldOperator_ae (actualWeightField θ c) 1 (by norm_num) ha hm f + +theorem ae_actualWeightField_invariant (θ c : ℕ → ℝ) + (p : Hilbert →L[ℂ] Hilbert) (F : Base → Fiber →L[ℂ] Fiber) + (hrep : ∀ f : Hilbert, p f =ᵐ[baseMeasure] fun x => F x (f x)) + (hinv : (1 - p) * weightedOperator θ c * p = 0) : + ∀ᵐ x ∂baseMeasure, + (1 - F x) * WeightedShift.operator (actualWeightField θ c x) * F x = 0 := + L2Multiplication.ae_invariance_of_represented + (default : HilbertBasis ℤ ℂ Fiber) p (weightedOperator θ c) F + (fun x => WeightedShift.operator (actualWeightField θ c x)) + hrep (weightedOperator_ae_actualWeightField θ c) hinv + +theorem boundedDiagonal_weight (w : WeightedShift.Weight) : + SequenceHilbert.boundedDiagonal (fun k : ℤ => w k) = WeightedShift.diagonal w := by + ext v k + rw [SequenceHilbert.boundedDiagonal_apply_of_bound _ ‖w‖ (norm_nonneg w) + (fun i => lp.norm_apply_le_norm (by simp) w i)] + rfl + +theorem ratioDiagonal_eq_normalized_orbit (θ c : ℕ → ℝ) + (x : Base) (n : ℕ) + (hprod : ∀ k : ℤ, + (∏ j ∈ Finset.range n, weight θ c (rotationIterate θ (k + j) x)) = + ProductCocycle.cocycleVersion θ c n (rotationIterate θ k x)) + (hratio : ∀ k : ℤ, + cocycleRatio θ c x (rotationIterate θ n x) k = + ProductCocycle.cocycleVersion θ c n (rotationIterate θ k x) / + ProductCocycle.cocycleVersion θ c n x) : + ratioDiagonal θ c x (rotationIterate θ n x) = + WeightedShift.diagonal ((ProductCocycle.cocycleVersion θ c n x : ℂ)⁻¹ • + WeightedShift.orbitProduct (actualWeightField θ c x) n) := by + rw [← boundedDiagonal_weight] + apply SequenceHilbert.boundedDiagonal_congr + intro k + change (cocycleRatio θ c x (rotationIterate θ n x) k : ℂ) = + (ProductCocycle.cocycleVersion θ c n x : ℂ)⁻¹ * + (∏ j ∈ Finset.range n, (weight θ c (rotationIterate θ (k + j) x) : ℂ)) + rw [hratio k, Complex.ofReal_div, ← Complex.ofReal_prod, hprod k] + exact div_eq_mul_inv _ _ |>.trans (mul_comm _ _) + +theorem ae_orbit_pair_identity_of_ratio (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) + (p : Hilbert →L[ℂ] Hilbert) (hpM : p ∈ factor θ) + (F : Base → Fiber →L[ℂ] Fiber) (hproj : ∀ x, IsStarProjection (F x)) + (hrep : ∀ f : Hilbert, p f =ᵐ[baseMeasure] fun x => F x (f x)) + (hinv : (1 - p) * weightedOperator θ c * p = 0) + (n : ℕ) + (hratio : ∀ᵐ x ∂baseMeasure, ∀ k : ℤ, + cocycleRatio θ c x (rotationIterate θ n x) k = + ProductCocycle.cocycleVersion θ c n (rotationIterate θ k x) / + ProductCocycle.cocycleVersion θ c n x) : + ∀ᵐ x ∂baseMeasure, + (1 - F (rotationIterate θ n x)) * + ratioDiagonal θ c x (rotationIterate θ n x) * F x = 0 := by + filter_upwards [ae_actualWeightField_invariant θ c p F hrep hinv, + field_conjugacy hpM F hrep, + ae_weight_orbit_product_eq_cocycleVersion θ c hθ0 hc hθ n, + hratio] with x hInv hCov hProd hRatio + rw [ratioDiagonal_eq_normalized_orbit θ c x n hProd hRatio, hCov n] + exact OrbitInvariance.weighted_shift_orbit_normalized + (actualWeightField θ c x) (hproj x).isIdempotentElem hInv n + (ProductCocycle.cocycleVersion θ c n x : ℂ) + +theorem ae_orbit_pair_identity (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) + (p : Hilbert →L[ℂ] Hilbert) (hpM : p ∈ factor θ) + (F : Base → Fiber →L[ℂ] Fiber) (hproj : ∀ x, IsStarProjection (F x)) + (hrep : ∀ f : Hilbert, p f =ᵐ[baseMeasure] fun x => F x (f x)) + (hinv : (1 - p) * weightedOperator θ c * p = 0) (n : ℕ) : + ∀ᵐ x ∂baseMeasure, + (1 - F (rotationIterate θ n x)) * + ratioDiagonal θ c x (rotationIterate θ n x) * F x = 0 := + ae_orbit_pair_identity_of_ratio θ c hθ0 hc hθ p hpM F hproj hrep hinv n + ((ae_cocycleRatio_rotation θ hθ0 hθ).mono (fun _ hx k => hx c k n)) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitTests.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitTests.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1256c96cc4357dab3eacddb0f5d5b618325f31d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductOrbitTests.lean @@ -0,0 +1,96 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductOrbitMarginals +import Mathlib.MeasureTheory.Integral.Bochner.Basic + +namespace OAI + +noncomputable section +open MeasureTheory Set +open scoped ENNReal BigOperators + +namespace Invariant233.ProductModel.TailTrimming + +def orbitTestWeight (θ : ℕ → ℝ) (A : Set EndpointPair) + (w : ℕ → Base → ℝ) (n : ℕ) : Base → ℝ := + (orbitPairMap θ n ⁻¹' A).indicator (w n) + +theorem measurable_orbitTestWeight (θ : ℕ → ℝ) (A : Set EndpointPair) + (hA : MeasurableSet A) (w : ℕ → Base → ℝ) (n : ℕ) + (hw : Measurable (w n)) : Measurable (orbitTestWeight θ A w n) := + hw.indicator ((measurable_orbitPairMap θ n) hA) + +theorem orbitTestWeight_nonneg (θ : ℕ → ℝ) (A : Set EndpointPair) + (w : ℕ → Base → ℝ) (n : ℕ) (hw0 : ∀ x, 0 ≤ w n x) (x : Base) : + 0 ≤ orbitTestWeight θ A w n x := + Set.indicator_nonneg (fun x _ => hw0 x) x + +theorem orbitTestWeight_inverse (θ : ℕ → ℝ) (A : Set EndpointPair) + (w : ℕ → Base → ℝ) (n : ℕ) (y : Base) : + orbitTestWeight θ A w n (rotationIterate θ (-(n : ℤ)) y) = + A.indicator (fun xy : EndpointPair => w n xy.1) + (rotationIterate θ (-(n : ℤ)) y, y) := by + classical + have hr : rotationIterate θ (n : ℤ) (rotationIterate θ (-(n : ℤ)) y) = y := by + simpa only [neg_neg] using rotationIterate_inverse_left θ (-(n : ℤ)) y + simp only [orbitTestWeight, Set.indicator_apply, Set.mem_preimage, orbitPairMap, hr] + +theorem orbitAverageMeasure_restrict_real (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ) (A : Set EndpointPair) (hA : MeasurableSet A) : + (orbitAverageMeasure θ N (fun n x => ENNReal.ofReal (w n x))).restrict A = + orbitAverageMeasure θ N (fun n x => ENNReal.ofReal (orbitTestWeight θ A w n x)) := by + rw [orbitAverageMeasure_restrict θ N _ A hA] + congr 1 + funext n x + by_cases hx : orbitPairMap θ n x ∈ A <;> + simp [orbitTestWeight, hx] + +theorem orbitAverageMeasure_restrict_first_marginal_real (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ) (hw : ∀ n ∈ N, Measurable (w n)) + (hw0 : ∀ n ∈ N, ∀ x, 0 ≤ w n x) + (A : Set EndpointPair) (hA : MeasurableSet A) : + ((orbitAverageMeasure θ N (fun n x => ENNReal.ofReal (w n x))).restrict A).map Prod.fst = + baseMeasure.withDensity (fun x => ENNReal.ofReal + ((N.card : ℝ)⁻¹ * ∑ n ∈ N, orbitTestWeight θ A w n x)) := by + rw [orbitAverageMeasure_restrict_real θ N w A hA] + exact orbitAverageMeasure_first_marginal_real θ N _ + (fun n hn => measurable_orbitTestWeight θ A hA w n (hw n hn)) + (fun n hn => orbitTestWeight_nonneg θ A w n (hw0 n hn)) + +theorem orbitAverageMeasure_restrict_second_marginal_real (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ) (hw : ∀ n ∈ N, Measurable (w n)) + (hw0 : ∀ n ∈ N, ∀ x, 0 ≤ w n x) + (A : Set EndpointPair) (hA : MeasurableSet A) : + ((orbitAverageMeasure θ N (fun n x => ENNReal.ofReal (w n x))).restrict A).map Prod.snd = + baseMeasure.withDensity (fun y => ENNReal.ofReal + ((N.card : ℝ)⁻¹ * ∑ n ∈ N, + orbitTestWeight θ A w n (rotationIterate θ (-(n : ℤ)) y))) := by + rw [orbitAverageMeasure_restrict_real θ N w A hA] + exact orbitAverageMeasure_second_marginal_real θ N _ + (fun n hn => measurable_orbitTestWeight θ A hA w n (hw n hn)) + (fun n hn => orbitTestWeight_nonneg θ A w n (hw0 n hn)) + +theorem orbitAverageMeasure_real_test_mass (θ : ℕ → ℝ) (N : Finset ℕ) + (w : ℕ → Base → ℝ) (hw : ∀ n ∈ N, Measurable (w n)) + (hw0 : ∀ n ∈ N, ∀ x, 0 ≤ w n x) + (A : Set EndpointPair) (hA : MeasurableSet A) : + (orbitAverageMeasure θ N (fun n x => ENNReal.ofReal (w n x))).real A = + ∫ x, (N.card : ℝ)⁻¹ * ∑ n ∈ N, orbitTestWeight θ A w n x ∂baseMeasure := by + have he := congrArg (fun μ : Measure Base => μ univ) + (orbitAverageMeasure_restrict_first_marginal_real θ N w hw hw0 A hA) + simp only [Measure.map_apply measurable_fst MeasurableSet.univ, preimage_univ, + Measure.restrict_apply_univ, withDensity_apply _ MeasurableSet.univ, + Measure.restrict_univ] at he + rw [Measure.real, he] + symm + apply integral_eq_lintegral_of_nonneg_ae + · apply Filter.Eventually.of_forall + intro x + exact mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg _)) + (Finset.sum_nonneg (fun n hn => orbitTestWeight_nonneg θ A w n (hw0 n hn) x)) + · exact (measurable_const.mul (Finset.measurable_sum N + (fun n hn => measurable_orbitTestWeight θ A hA w n (hw n hn)))).aestronglyMeasurable + +end Invariant233.ProductModel.TailTrimming + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductPairRatios.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPairRatios.lean new file mode 100644 index 0000000000000000000000000000000000000000..12a219cef0b21b5121a537cfae7c5ff9fc4e68b3 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPairRatios.lean @@ -0,0 +1,73 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductPairIdentity +import OAI.Analysis.IrrationalRotation.Product.ProductCocycle +import OAI.Analysis.IrrationalRotation.Analysis.TriangularLawProperties +import OAI.Analysis.IrrationalRotation.Sampling.ProductSamplingAbsoluteContinuity +import OAI.Analysis.IrrationalRotation.Rotation.UnrestrictedDiagonal + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Invariant233.ProductModel + +theorem cocycleRatio_pos (θ c : ℕ → ℝ) (x y : Base) (k : ℤ) : + 0 < cocycleRatio θ c x y k := + div_pos (ProductCocycle.cocycleVersion_pos θ c k y) + (ProductCocycle.cocycleVersion_pos θ c k x) + +theorem ae_all_cocycleRatio_bounds_of_ordered + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) (ν : Measure EndpointPair) + (hfst : ν.map Prod.fst ≪ baseMeasure) + (hsnd : ν.map Prod.snd ≪ baseMeasure) + (horder : ∀ᵐ xy ∂ν, Ordered xy.1 xy.2) : + ∀ᵐ xy ∂ν, ∀ k : ℤ, + 0 < cocycleRatio θ c xy.1 xy.2 k ∧ + cocycleRatio θ c xy.1 xy.2 k ≤ 1 := by + have hcore := CocycleSupport.ae_product_all_int_finite_floor_support θ hθ0 hθ + have hfirst := ae_of_ae_map measurable_fst.aemeasurable (hfst.ae_le hcore) + have hsecond := ae_of_ae_map measurable_snd.aemeasurable (hsnd.ae_le hcore) + filter_upwards [hfirst, hsecond, horder] with xy hx hy hxy + intro k + refine ⟨cocycleRatio_pos θ c xy.1 xy.2 k, ?_⟩ + exact ProductCocycle.cocycleVersion_ratio_le_one θ c k xy.1 xy.2 + hc hxy (hx k) (hy k) + +theorem triangularLaw_ae_all_cocycleRatio_bounds + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) (I : Finset ℕ) : + ∀ᵐ xy ∂triangularLaw I, ∀ k : ℤ, + 0 < cocycleRatio θ c xy.1 xy.2 k ∧ + cocycleRatio θ c xy.1 xy.2 k ≤ 1 := by + apply ae_all_cocycleRatio_bounds_of_ordered θ c hθ0 hθ hc (triangularLaw I) + · rw [Sampling.triangularLaw_first_marginal] + exact withDensity_absolutelyContinuous _ _ + · rw [Sampling.triangularLaw_second_marginal] + exact withDensity_absolutelyContinuous _ _ + · exact Sampling.triangularLaw_ordered I + +theorem HasUniformL2Marginals.ae_all_cocycleRatio_bounds + {η : ℕ → Measure EndpointPair} (hη : HasUniformL2Marginals η) + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) + (horder : ∀ l, ∀ᵐ xy ∂η l, Ordered xy.1 xy.2) : + ∀ l, ∀ᵐ xy ∂η l, ∀ k : ℤ, + 0 < cocycleRatio θ c xy.1 xy.2 k ∧ + cocycleRatio θ c xy.1 xy.2 k ≤ 1 := by + intro l + obtain ⟨H, hH, hdens⟩ := hη + obtain ⟨f, g, hf, hg, hmf, hmg, hbf, hbg⟩ := hdens l + apply ae_all_cocycleRatio_bounds_of_ordered θ c hθ0 hθ hc (η l) + · rw [hmf] + exact withDensity_absolutelyContinuous _ _ + · rw [hmg] + exact withDensity_absolutelyContinuous _ _ + · exact horder l + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductPairSanity.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPairSanity.lean new file mode 100644 index 0000000000000000000000000000000000000000..51b3d4dc388e08fbc043e70ec595e45014068321 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPairSanity.lean @@ -0,0 +1,84 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductPairIdentity +import OAI.Analysis.IrrationalRotation.Product.ProductCocycle +import OAI.Analysis.IrrationalRotation.Analysis.TriangularLawProperties +import OAI.Analysis.IrrationalRotation.Rotation.UnrestrictedDiagonal + +namespace OAI + +noncomputable section +open MeasureTheory +namespace Invariant233.ProductModel + +@[simp] theorem cocycleRatio_self (θ c : ℕ → ℝ) (x : Base) (k : ℤ) : + cocycleRatio θ c x x k = 1 := by + exact div_self (ne_of_gt (ProductCocycle.cocycleVersion_pos θ c k x)) + +@[simp] theorem ratioDiagonal_self (θ c : ℕ → ℝ) (x : Base) : + ratioDiagonal θ c x x = 1 := by + apply ContinuousLinearMap.ext + intro v + apply lp.ext + funext k + change SequenceHilbert.boundedDiagonal + (fun k => (cocycleRatio θ c x x k : ℂ)) v k = v k + rw [SequenceHilbert.boundedDiagonal_apply_of_bound _ 1 zero_le_one] + · simp + · intro j + simp + +theorem pairIdentity_self_iff (θ c : ℕ → ℝ) + (F : Base → Fiber →L[ℂ] Fiber) (x : Base) : + PairIdentity θ c F (x, x) ↔ IsIdempotentElem (F x) := by + simp only [PairIdentity, cocycleRatio_self, zero_lt_one, le_refl, + and_self, forall_const, true_and, ratioDiagonal_self, mul_one] + rw [sub_mul, one_mul, sub_eq_zero] + exact eq_comm + +@[simp] theorem triangularLaw_empty_eq_diagonal : + triangularLaw ∅ = baseMeasure.map (fun x : Base => (x, x)) := by + have he : triangularEvent ∅ = Set.univ := by + ext xy + simp [triangularEvent] + rw [triangularLaw, he, Measure.restrict_univ] + have hs : selectedEndpoint ∅ = fun x _ => x := by + funext x z i + simp [selectedEndpoint] + rw [hs] + have hm := Measure.map_map (measurable_id.prodMk measurable_id) + (measurable_fst : Measurable (Prod.fst : EndpointPair → Base)) + (μ := baseMeasure.prod baseMeasure) + simpa [Function.comp_def] using hm.symm + +theorem measurableEmbedding_diagonalPair : + MeasurableEmbedding (fun x : Base => (x, x)) := by + have hr : Set.range (fun x : Base => (x, x)) = + {xy : EndpointPair | xy.1 = xy.2} := by + ext xy + constructor + · rintro ⟨x, rfl⟩ + rfl + · intro h + exact ⟨xy.1, Prod.ext rfl h⟩ + apply MeasurableEmbedding.of_measurable_inverse + (measurable_id.prodMk measurable_id) _ measurable_fst (fun _ => rfl) + change MeasurableSet (Set.range (fun x : Base => (x, x))) + rw [hr] + exact measurableSet_eq_fun measurable_fst measurable_snd + +theorem triangularLaw_empty_ae_iff {p : EndpointPair → Prop} : + (∀ᵐ xy ∂triangularLaw ∅, p xy) ↔ ∀ᵐ x ∂baseMeasure, p (x, x) := by + rw [triangularLaw_empty_eq_diagonal] + exact measurableEmbedding_diagonalPair.ae_map_iff + +theorem triangularLaw_empty_pairIdentity_iff (θ c : ℕ → ℝ) + (F : Base → Fiber →L[ℂ] Fiber) : + (∀ᵐ xy ∂triangularLaw ∅, PairIdentity θ c F xy) ↔ + ∀ᵐ x ∂baseMeasure, IsIdempotentElem (F x) := by + rw [triangularLaw_empty_ae_iff] + simp_rw [pairIdentity_self_iff] + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductPairTransfer.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPairTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd0966802c7a38686b12219a74acca62fb7718de --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPairTransfer.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductPairRatios +import OAI.Analysis.IrrationalRotation.Sampling.ProductSamplingTrimming +import OAI.Analysis.IrrationalRotation.Operators.OperatorCompactTransfer + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal Topology + +namespace Invariant233.ProductModel + +theorem ae_ratio_identity_of_positive_ordered_orbit_support + (θ c : ℕ → ℝ) (F : Base → Fiber →L[ℂ] Fiber) + (horbit : ∀ n : ℕ, 0 < n → ∀ᵐ x ∂baseMeasure, + Ordered x (rotationIterate θ (n : ℤ) x) → + (1 - F (rotationIterate θ (n : ℤ) x)) * + ratioDiagonal θ c x (rotationIterate θ (n : ℤ) x) * F x = 0) + (ν : Measure EndpointPair) (hfst : ν.map Prod.fst ≪ baseMeasure) + (hsupp : SupportedOnPositiveOrderedOrbitPairs θ ν) : + ∀ᵐ xy ∂ν, (1 - F xy.2) * ratioDiagonal θ c xy.1 xy.2 * F xy.1 = 0 := by + have hall : ∀ᵐ x ∂baseMeasure, ∀ n : ℕ, 0 < n → + Ordered x (rotationIterate θ (n : ℤ) x) → + (1 - F (rotationIterate θ (n : ℤ) x)) * + ratioDiagonal θ c x (rotationIterate θ (n : ℤ) x) * F x = 0 := by + apply ae_all_iff.mpr + intro n + by_cases hn : 0 < n + · exact (horbit n hn).mono (fun x hx _ => hx) + · exact Filter.Eventually.of_forall (fun _ h => (hn h).elim) + have hpull := ae_of_ae_map measurable_fst.aemeasurable (hfst.ae_le hall) + obtain ⟨N, hN, hsupp⟩ := hsupp + filter_upwards [hpull, hsupp] with xy hx hxy + obtain ⟨horder, n, hn, heq⟩ := hxy + rw [heq] at horder ⊢ + exact hx n (hN n hn) horder + +theorem pairIdentity_of_orderedOrbitSampling + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) (F : Base → Fiber →L[ℂ] Fiber) + (hproj : ∀ x, IsStarProjection (F x)) + (hFm : ∀ v : Fiber, StronglyMeasurable (fun x => F x v)) + (horbit : ∀ n : ℕ, 0 < n → ∀ᵐ x ∂baseMeasure, + Ordered x (rotationIterate θ (n : ℤ) x) → + (1 - F (rotationIterate θ (n : ℤ) x)) * + ratioDiagonal θ c x (rotationIterate θ (n : ℤ) x) * F x = 0) + (I : Finset ℕ) (hsampling : OrderedOrbitSampling θ I) : + ∀ᵐ xy ∂triangularLaw I, PairIdentity θ c F xy := by + obtain ⟨η, hfinite, hsupp, hL2, hweak⟩ := hsampling + let ηf : ℕ → FiniteMeasure EndpointPair := fun l => ⟨η l, hfinite l⟩ + let ν : FiniteMeasure EndpointPair := ⟨triangularLaw I, Sampling.triangularLaw_finite I⟩ + have hconv : Tendsto ηf atTop (𝓝 ν) := + (weaklyConverges_iff_tendsto ηf ν).mp hweak + have horder : ∀ l, ∀ᵐ xy ∂η l, Ordered xy.1 xy.2 := by + intro l + obtain ⟨N, hN, hs⟩ := hsupp l + exact hs.mono (fun _ h => h.1) + have hratio := hL2.ae_all_cocycleRatio_bounds θ c hθ0 hθ hc horder + have hlimit := triangularLaw_ae_all_cocycleRatio_bounds θ c hθ0 hθ hc I + have hac := hL2.uniformlyAbsolutelyContinuous + have hzero : ∀ l, ∀ᵐ xy ∂η l, + (1 - F xy.2) * ratioDiagonal θ c xy.1 xy.2 * F xy.1 = 0 := by + intro l + obtain ⟨H, hH, hdens⟩ := hL2 + obtain ⟨f, g, hf, hg, hmf, hmg, hbf, hbg⟩ := hdens l + apply ae_ratio_identity_of_positive_ordered_orbit_support θ c F horbit (η l) + · rw [hmf] + exact withDensity_absolutelyContinuous _ _ + · exact hsupp l + have htransfer := CompactTransfer.compact_operator_transfer baseMeasure F hproj + (fun k => ProductCocycle.cocycleVersion θ c k) + (fun k x => ProductCocycle.cocycleVersion_pos θ c k x) + (fun k => ProductCocycle.measurable_cocycleVersion θ c k) + (fun k => (hFm (lp.single 2 k 1)).measurable) + hconv hac.1 hac.2 1 zero_lt_one + (fun l k => (hratio l).mono (fun xy h => (h k).2)) + (fun k => hlimit.mono (fun xy h => (h k).2)) + (fun l => (hzero l).mono (fun xy h => by + simpa only [ContinuousLinearMap.mul_def, ContinuousLinearMap.comp_assoc, + ProductModel.ratioDiagonal, Invariant233.ratioDiagonal, cocycleRatio] using h)) + filter_upwards [hlimit, htransfer] with xy hr hz + refine ⟨hr, ?_⟩ + simpa only [ContinuousLinearMap.mul_def, ContinuousLinearMap.comp_assoc, + ProductModel.ratioDiagonal, Invariant233.ratioDiagonal, cocycleRatio] using hz + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductPositiveDiagonal.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPositiveDiagonal.lean new file mode 100644 index 0000000000000000000000000000000000000000..0963266099c98ec806eac684a50102813fe8979c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPositiveDiagonal.lean @@ -0,0 +1,77 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductProjectionFields +import OAI.Analysis.IrrationalRotation.Product.ProductBaseDynamics +import OAI.Analysis.IrrationalRotation.Product.ProductWeightBridge +import OAI.Analysis.IrrationalRotation.Rotation.RealWeightedPositiveDiagonal + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal InnerProductSpace + +namespace Invariant233.ProductModel + +theorem ae_strict_diagonal_of_invariant_projection + {θ c : ℕ → ℝ} (hadm : AdmissibleAnglesAndCosts θ c) + (P : Hilbert →L[ℂ] Hilbert) (hPm : P ∈ factor θ) (hP : IsStarProjection P) + (hP0 : P ≠ 0) (hP1 : P ≠ 1) + (hinv : (1 - P) * weightedOperator θ c * P = 0) + (p : Base → Fiber →L[ℂ] Fiber) + (hpbound : ∀ x, ‖p x‖ ≤ ‖P‖) + (hpm : ∀ v, StronglyMeasurable fun x => p x v) + (hrep : ∀ ξ : Hilbert, P ξ =ᵐ[baseMeasure] fun x => p x (ξ x)) : + ∀ᵐ x ∂baseMeasure, + 0 < (inner ℂ PositiveDiagonalModel.e0 (p x PositiveDiagonalModel.e0)).re ∧ + (inner ℂ PositiveDiagonalModel.e0 (p x PositiveDiagonalModel.e0)).re < 1 := by + let a : Base → ℤ → ℝ := fun x k => weight θ c (rotationIterate θ k x) + have hb : ∀ x k, |a x k| ≤ 1 := by + intro x k + rw [abs_of_nonneg (weight_mem_Icc θ c _).1] + exact (weight_mem_Icc θ c _).2 + have hm : ∀ k, AEStronglyMeasurable (fun x => a x k) baseMeasure := by + intro k + exact ((measurable_weight θ c).comp + (rotationIterate_measurePreserving θ k).measurable).aestronglyMeasurable + have hT : weightedOperator θ c = + PositiveDiagonalModel.realWeightedShift a 1 (by norm_num) hb hm := by + rfl + have hcov : ∀ᵐ x ∂baseMeasure, + p x * PositiveDiagonalModel.fiberShift = + PositiveDiagonalModel.fiberShift * p (rotationIterate θ 1 x) := by + filter_upwards [field_covariance hPm p hrep] with x hx + exact hx 1 + have hpos : ∀ᵐ x ∂baseMeasure, 0 < a x 0 := by + simpa only [a, rotationIterate_zero] using + ae_weight_pos θ c (fun i => (hadm.1 i).1.le) + (fun i => (hadm.1 i).2.2.le) hadm.2.1 + have htrace := projection_vectorTrace_mem_Ioo hPm hP hP0 hP1 + apply PositiveDiagonalModel.positive_diagonal + (rotationIterate_ergodic hadm.2.2 (by norm_num : (1 : ℤ) ≠ 0)) + a 1 (by norm_num) hb hm hpos P p hpbound hpm hrep hP hcov + · rwa [← hT] + · exact htrace.1 + · exact htrace.2 + +theorem exists_strict_projection_field + {θ c : ℕ → ℝ} (hadm : AdmissibleAnglesAndCosts θ c) + (P : Hilbert →L[ℂ] Hilbert) (hPm : P ∈ factor θ) (hP : IsStarProjection P) + (hP0 : P ≠ 0) (hP1 : P ≠ 1) + (hinv : (1 - P) * weightedOperator θ c * P = 0) : + ∃ p : Base → Fiber →L[ℂ] Fiber, + (∀ x, ‖p x‖ ≤ ‖P‖) ∧ + (∀ v, StronglyMeasurable fun x => p x v) ∧ + (∀ ξ : Hilbert, P ξ =ᵐ[baseMeasure] fun x => p x (ξ x)) ∧ + (∀ᵐ x ∂baseMeasure, IsStarProjection (p x)) ∧ + (∀ᵐ x ∂baseMeasure, + 0 < (inner ℂ PositiveDiagonalModel.e0 (p x PositiveDiagonalModel.e0)).re ∧ + (inner ℂ PositiveDiagonalModel.e0 (p x PositiveDiagonalModel.e0)).re < 1) := by + obtain ⟨p, hpbound, hpm, hrep, _⟩ := exists_unique_field hPm + exact ⟨p, hpbound, hpm, hrep, field_isStarProjection hPm hP p hrep, + ae_strict_diagonal_of_invariant_projection hadm P hPm hP hP0 hP1 hinv + p hpbound hpm hrep⟩ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductPowerIdentity.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPowerIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..a608db35d65b43033843e8476114f4c451f2b168 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPowerIdentity.lean @@ -0,0 +1,127 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductPowers +import OAI.Analysis.IrrationalRotation.Spectral.ProductQuasinilpotent + +namespace OAI + +noncomputable section +open MeasureTheory Set Function Filter +open scoped ENNReal BigOperators Topology + +namespace Invariant233.WeightedShift +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem fieldShift_one_pow (n : ℕ) : + ((shift 1).toLinearIsometry.toContinuousLinearMap.compLpL 2 μ) ^ n = + (shift (n : ℤ)).toLinearIsometry.toContinuousLinearMap.compLpL 2 μ := by + induction n with + | zero => simpa using (fieldShift_zero (μ := μ)).symm + | succ n ih => + rw [pow_succ, ih, ← fieldShift_add] + norm_cast + +theorem fieldOperator_pow_eq_shift_mul_of_coeff + (a : X → Weight) (C : ℝ) (hC : 0 ≤ C) + (ha : ∀ x, ‖a x‖ ≤ C) + (hm : ∀ k, AEStronglyMeasurable (fun x => a x k) μ) + (b : X → Weight) (D : ℝ) (hD : 0 ≤ D) + (hb : ∀ x, ‖b x‖ ≤ D) + (hn : ∀ k, AEStronglyMeasurable (fun x => b x k) μ) + (n : ℕ) (heq : ∀ᵐ x ∂μ, ∀ k : ℤ, + b x k = ∏ j ∈ Finset.range n, a x (k + j)) : + fieldOperator a C hC ha hm ^ n = + ((shift 1).toLinearIsometry.toContinuousLinearMap.compLpL 2 μ) ^ n * + fieldDiagonal b D hD hb hn := by + rw [fieldShift_one_pow] + ext f + filter_upwards [fieldOperator_pow_ae a C hC ha hm n f, + fieldShift_ae (n : ℤ) (fieldDiagonal b D hD hb hn f), + fieldDiagonal_coordinate_ae b D hD hb hn f, heq] with x hx hs hd he + apply lp.ext + funext k + change ((fieldOperator a C hC ha hm ^ n) f) x k = + ((shift (n : ℤ)).toLinearIsometry.toContinuousLinearMap.compLpL 2 μ + (fieldDiagonal b D hD hb hn f)) x k + rw [hx, hs, shift_apply, hd, he] + exact operator_pow_apply (a x) n (f x) k + +end Invariant233.WeightedShift + +namespace Invariant233.ProductModel + +theorem ae_weight_orbit_product_eq_cocycleVersion + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) + (hθ : Summable θ) (n : ℕ) : + ∀ᵐ x ∂baseMeasure, ∀ k : ℤ, + (∏ j ∈ Finset.range n, weight θ c (rotationIterate θ (k + j) x)) = + ProductCocycle.cocycleVersion θ c n (rotationIterate θ k x) := by + obtain ⟨s, _hsm, hfull, hinv, hs, hlaw⟩ := + ProductCocycle.exists_invariant_cocycle_core θ hθ0 hθ + filter_upwards [hfull] with x hx k + have hxk : ProductCocycle.rotate θ k x ∈ s := by + change x ∈ ProductCocycle.rotate θ k ⁻¹' s + rw [hinv k] + exact hx + have hprod := weight_orbit_product_eq_cocycleVersion θ c hθ0 hc s hinv hs + (fun y hy => hlaw y hy c) (ProductCocycle.rotate θ k x) hxk n + have hrot (j : ℕ) : rotationIterate θ (k + j) x = + rotationIterate θ j (ProductCocycle.rotate θ k x) := + ProductCocycle.rotate_add θ k j x + simp_rw [hrot] + exact hprod + +theorem weightedOperator_pow_coordinate_ae + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) + (hθ : Summable θ) (n : ℕ) (f : Hilbert) : + ∀ᵐ x ∂baseMeasure, ∀ k : ℤ, + (weightedOperator θ c ^ n) f x k = + (ProductCocycle.cocycleVersion θ c n (rotationIterate θ (k - n) x) : ℂ) * + f x (k - n) := by + have hb (x : Base) : ‖(weight θ c x : ℂ)‖ ≤ 1 := by + simpa only [Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (weight_mem_Icc θ c x).1] using (weight_mem_Icc θ c x).2 + have ha (x : Base) : ‖multiplierField θ (fun x => (weight θ c x : ℂ)) 1 hb x‖ ≤ 1 := + lp.norm_le_of_forall_le (by norm_num) (fun k => hb _) + have hm (k : ℤ) : AEStronglyMeasurable + (fun x => (multiplierField θ (fun x => (weight θ c x : ℂ)) 1 hb x) k) + baseMeasure := by + exact ((measurable_weight θ c).complex_ofReal.comp + (ProductCocycle.measurePreserving_rotate θ k).measurable).aestronglyMeasurable + have hp := WeightedShift.fieldOperator_pow_ae + (multiplierField θ (fun x => (weight θ c x : ℂ)) 1 hb) 1 + (by norm_num) ha hm n f + change (weightedOperator θ c ^ n) f =ᵐ[baseMeasure] _ at hp + filter_upwards [hp, ae_weight_orbit_product_eq_cocycleVersion θ c hθ0 hc hθ n] + with x hx he k + rw [hx, WeightedShift.operator_pow_apply] + change (∏ j ∈ Finset.range n, + (weight θ c (rotationIterate θ (k - n + j) x) : ℂ)) * f x (k - n) = _ + rw [← Complex.ofReal_prod, he] + +theorem weightedOperator_pow_eq_shift_mul_positiveCocycleMultiplier + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) + (hθ : Summable θ) (n : ℕ) : + weightedOperator θ c ^ n = + shiftOperator ^ n * positiveCocycleMultiplier θ c hθ0 hc n := by + unfold weightedOperator positiveCocycleMultiplier multiplier shiftOperator + apply WeightedShift.fieldOperator_pow_eq_shift_mul_of_coeff + (multiplierField θ (fun x => (weight θ c x : ℂ)) 1 _) 1 _ _ _ + (multiplierField θ (fun x => (ProductCocycle.cocycleVersion θ c n x : ℂ)) 1 _) + 1 _ _ _ n + filter_upwards [ae_weight_orbit_product_eq_cocycleVersion θ c hθ0 hc hθ n] + with x hx k + change (ProductCocycle.cocycleVersion θ c n (rotationIterate θ k x) : ℂ) = + ∏ j ∈ Finset.range n, (weight θ c (rotationIterate θ (k + j) x) : ℂ) + rw [← Complex.ofReal_prod, hx] + +theorem positiveCocycleMultiplier_mem_factor + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (n : ℕ) : + positiveCocycleMultiplier θ c hθ0 hc n ∈ factor θ := by + apply subset_vonNeumannGenerated _ + apply Set.mem_union_right + exact ⟨_, _, _, _, _, rfl⟩ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductPowerOrbit.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPowerOrbit.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b7c77b3b48a36cfa149d06685ad34be17b0968c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductPowerOrbit.lean @@ -0,0 +1,48 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductPowerIdentity +import OAI.Analysis.IrrationalRotation.Spectral.ProductDeterminant +import OAI.Analysis.IrrationalRotation.Analysis.OrbitInvariance +import Mathlib.Algebra.Star.UnitaryStarAlgAut + +namespace OAI + +noncomputable section +namespace Invariant233.ProductModel + +private def shiftPowerUnit (n : ℕ) : (Hilbert →L[ℂ] Hilbert)ˣ where + val := shiftOperator ^ n + inv := star (shiftOperator ^ n) + val_inv := Unitary.mul_star_self_of_mem ((unitary _).pow_mem shiftOperator_mem_unitary n) + inv_val := Unitary.star_mul_self_of_mem ((unitary _).pow_mem shiftOperator_mem_unitary n) + +theorem weightedOperator_orbit_inclusion + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) + (hθ : Summable θ) {p : Hilbert →L[ℂ] Hilbert} + (hp : IsIdempotentElem p) (hinv : (1 - p) * weightedOperator θ c * p = 0) + (n : ℕ) : + (1 - star (shiftOperator ^ n) * p * shiftOperator ^ n) * + positiveCocycleMultiplier θ c hθ0 hc n * p = 0 := by + exact OrbitInvariance.orbit_inclusion_pow hp hinv n (shiftPowerUnit n) + (positiveCocycleMultiplier θ c hθ0 hc n) + (weightedOperator_pow_eq_shift_mul_positiveCocycleMultiplier θ c hθ0 hc hθ n) + +theorem shifted_projection_mem_factor (θ : ℕ → ℝ) + {p : Hilbert →L[ℂ] Hilbert} (hp : p ∈ factor θ) (n : ℕ) : + star (shiftOperator ^ n) * p * shiftOperator ^ n ∈ factor θ := by + have hu : shiftOperator ∈ factor θ := + subset_vonNeumannGenerated _ (Set.mem_union_left _ (Set.mem_singleton _)) + have hpow : shiftOperator ^ n ∈ factor θ := pow_mem hu n + have hs : star (shiftOperator ^ n) ∈ factor θ := star_mem hpow + exact mul_mem (mul_mem hs hp) hpow + +theorem shifted_projection_isStarProjection + {p : Hilbert →L[ℂ] Hilbert} (hp : IsStarProjection p) (n : ℕ) : + IsStarProjection (star (shiftOperator ^ n) * p * shiftOperator ^ n) := by + let u : unitary (Hilbert →L[ℂ] Hilbert) := + ⟨shiftOperator ^ n, (unitary _).pow_mem shiftOperator_mem_unitary n⟩ + exact hp.map (Unitary.conjStarAlgAut ℂ (Hilbert →L[ℂ] Hilbert) u).symm.toStarAlgHom + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductProjectionFields.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductProjectionFields.lean new file mode 100644 index 0000000000000000000000000000000000000000..ae895dfa73306e6ec60dbdd52463f03b5c2c1ac4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductProjectionFields.lean @@ -0,0 +1,73 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductTracialVector +import OAI.Analysis.IrrationalRotation.Operators.ProjectionAtomOrbit + +namespace OAI + +noncomputable section +open MeasureTheory Filter + +namespace Invariant233.ProductModel + +theorem field_isStarProjection {θ : ℕ → ℝ} {P : Hilbert →L[ℂ] Hilbert} + (hP : P ∈ factor θ) (hp : IsStarProjection P) + (F : Base → Fiber →L[ℂ] Fiber) + (hF : ∀ ξ : Hilbert, P ξ =ᵐ[baseMeasure] fun x => F x (ξ x)) : + ∀ᵐ x ∂baseMeasure, IsStarProjection (F x) := by + obtain ⟨G, _, _, hG, huniq, _, _, hproj⟩ := + L2Multiplication.scalar_multiplier_fields_complete + (default : HilbertBasis ℤ ℂ Fiber) P (factor_commutes_scalarMultiplier θ hP) + filter_upwards [huniq F hF, hproj hp] with x hGF hx + rwa [← hGF] + +theorem projection_vectorTrace_mem_Ioo {θ : ℕ → ℝ} {P : Hilbert →L[ℂ] Hilbert} + (hP : P ∈ factor θ) (hp : IsStarProjection P) (hP0 : P ≠ 0) (hP1 : P ≠ 1) : + 0 < (vectorTrace traceVector P).re ∧ (vectorTrace traceVector P).re < 1 := by + have htrace := traceVector_faithfulTracial θ + have hpos := ProjectionAtomOrbit.vectorTrace_pos_of_faithful traceVector htrace hP hp hP0 + have hcomp : 1 - P ∈ factor θ := sub_mem (one_mem _) hP + have hcomp0 : (1 : Hilbert →L[ℂ] Hilbert) - P ≠ 0 := by + intro h + exact hP1 (sub_eq_zero.mp h).symm + have hposcomp := ProjectionAtomOrbit.vectorTrace_pos_of_faithful + traceVector htrace hcomp hp.one_sub hcomp0 + have hn : ‖traceVector‖ = 1 := htrace.1 + have heq : (vectorTrace traceVector (1 - P)).re = + 1 - (vectorTrace traceVector P).re := by + simp [vectorTrace, inner_sub_right, inner_self_eq_norm_sq_to_K, hn] + rw [heq] at hposcomp + exact ⟨hpos, sub_pos.mp hposcomp⟩ + +theorem integral_central_mem_Ioo {θ : ℕ → ℝ} {P : Hilbert →L[ℂ] Hilbert} + (hP : P ∈ factor θ) (hp : IsStarProjection P) (hP0 : P ≠ 0) (hP1 : P ≠ 1) + (F : Base → Fiber →L[ℂ] Fiber) + (hF : ∀ ξ : Hilbert, P ξ =ᵐ[baseMeasure] fun x => F x (ξ x)) : + 0 < ∫ x, (inner ℂ (lp.single 2 (0 : ℤ) (1 : ℂ) : Fiber) + (F x (lp.single 2 (0 : ℤ) (1 : ℂ)))).re ∂baseMeasure ∧ + (∫ x, (inner ℂ (lp.single 2 (0 : ℤ) (1 : ℂ) : Fiber) + (F x (lp.single 2 (0 : ℤ) (1 : ℂ)))).re ∂baseMeasure) < 1 := by + have hint : Integrable (fun x => inner ℂ (lp.single 2 (0 : ℤ) (1 : ℂ) : Fiber) + (F x (lp.single 2 (0 : ℤ) (1 : ℂ)))) baseMeasure := by + apply (L2.integrable_inner (𝕜 := ℂ) traceVector (P traceVector)).congr + filter_upwards [Lp.coeFn_const 2 baseMeasure (lp.single 2 (0 : ℤ) (1 : ℂ) : Fiber), + hF traceVector] with x hx hPx + change inner ℂ (traceVector x) (P traceVector x) = _ + rw [hPx] + change traceVector x = _ at hx + rw [hx] + rfl + have heq := congrArg Complex.re (vectorTrace_eq_integral_central P F hF) + have hi : (∫ x, (inner ℂ (lp.single 2 (0 : ℤ) (1 : ℂ) : Fiber) + (F x (lp.single 2 (0 : ℤ) (1 : ℂ)))).re ∂baseMeasure) = + (vectorTrace traceVector P).re := by + change (∫ x, RCLike.re (inner ℂ (lp.single 2 (0 : ℤ) (1 : ℂ) : Fiber) + (F x (lp.single 2 (0 : ℤ) (1 : ℂ)))) ∂baseMeasure) = _ + rw [integral_re hint] + exact heq.symm + rw [hi] + exact projection_vectorTrace_mem_Ioo hP hp hP0 hP1 + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductRealizationAssembly.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductRealizationAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e94c5687e21a99be03108626c634910acf186f4 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductRealizationAssembly.lean @@ -0,0 +1,79 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductInvariantProjectionObstruction +import OAI.Analysis.IrrationalRotation.Spectral.ProductBrownMeasure +import OAI.Analysis.IrrationalRotation.Product.ProductFactorComplete +import OAI.Analysis.IrrationalRotation.Spectral.ProductPolarComplete + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped BigOperators Topology +namespace Invariant233.ProductModel + +theorem product_realization_of_ae_sampling + (hsampling : ∀ (p : ProductScaleData) (_hp : ProductScaleLaws p) + (S : ℕ → ℝ) (_hS : ∀ i, 0 < S i) + (_hblock : ∀ j, ∀ i ∈ ProductPhases.consecutiveBlock p.m j, + S i = (p.m j : ℝ) * p.K j), + ∀ᵐ θ ∂Measure.infinitePi (fun i => + ProbabilityTheory.cond volume (Set.Icc (1 / S i) (2 / S i))), + HasAllFiniteCoordinateSampling θ) : + ∃ θ c : ℕ → ℝ, AdmissibleAnglesAndCosts θ c ∧ + HasAllFiniteCoordinateSampling θ ∧ + (∀ᵐ x ∂baseMeasure, 0 < weight θ c x) ∧ + HasNegInfiniteLogIntegral baseMeasure (weight θ c) ∧ + IsTypeII1FactorWithVector (factor θ) traceVector ∧ + HasSeparablePredual (factor θ) ∧ + weightedOperator θ c ∈ factor θ ∧ weightedOperator θ c ≠ 0 ∧ + NormQuasinilpotent (weightedOperator θ c) ∧ + vectorFugledeKadisonDeterminant traceVector (weightedOperator θ c) = 0 ∧ + spectrum ℂ (weightedOperator θ c) = {0} ∧ + IsVectorBrownMeasure traceVector (weightedOperator θ c) (Measure.dirac 0) ∧ + HasOnlyTrivialInvariantProjections (factor θ) (weightedOperator θ c) ∧ + ProductPolarStructure shiftOperator (weightedOperator θ c) := by + obtain ⟨p, hp⟩ := ProductScaleConstruction.exists_product_scales + have hm (j : ℕ) : 0 < p.m j := lt_of_lt_of_le (by norm_num) (hp.m_ge_100 j) + obtain ⟨e, he⟩ := InvariantProjection.IndependentAngles.exists_consecutiveBlocks_equiv p.m hm + have hK (j : ℕ) : (1 : ℝ) ≤ p.K j := by exact_mod_cast hp.K_pos j + have hG (j : ℕ) : (0 : ℝ) < p.G j := by exact_mod_cast hp.G_pos j + have hC (j : ℕ) : (p.K j : ℝ) ^ 2 ≤ p.C j := by + rw [hp.C_eq j] + exact le_max_right _ _ + have hscale (j : ℕ) : (2 : ℝ) < (p.m j : ℝ) * p.K j := by + have hm100 : (100 : ℝ) ≤ p.m j := by exact_mod_cast hp.m_ge_100 j + have hk := hK j + nlinarith + have hS (i : ℕ) : 0 < (p.m (e i).1 : ℝ) * p.K (e i).1 := + mul_pos (Nat.cast_pos.mpr (hm _)) (Nat.cast_pos.mpr (hp.K_pos _)) + have hsamp := hsampling p hp + (fun i => (p.m (e i).1 : ℝ) * p.K (e i).1) hS + (by + intro j i hi + rw [ProductPhases.enumeration_block_of_mem p.m e he hi]) + obtain ⟨θ, hθ, _hsum, hadm, hlog, hpos, hsmall, hlarge, hs⟩ := + exists_admissible_phase_block_weight_and p.m hp.m_ge_pow_self + (fun j => (p.K j : ℝ)) (fun j => (p.G j : ℝ)) p.C + hK hG hC hscale hp.summable_reciprocal e he hsamp + have hθ0 (i : ℕ) : 0 ≤ θ i := (hadm.1 i).1.le + have hθ01 (i : ℕ) : θ i ∈ Ico (0 : ℝ) 1 := ⟨hθ0 i, (hadm.1 i).2.1⟩ + have hc (i : ℕ) : 0 ≤ p.C (e i).1 := (hadm.1 i).2.2.le + have hdiv := (hasNegInfiniteLogIntegral_iff_tsum θ _ hθ01 hc).mp hlog + obtain ⟨hfactor, hpredual, _hfields, _htrace⟩ := factor_complete θ hadm.2.2 + refine ⟨θ, (fun i => p.C (e i).1), hadm, hs, + hpos.mono (fun _ hx => hx.1), hlog, hfactor, hpredual, + weightedOperator_mem_factor θ _, + weightedOperator_ne_zero θ _ hθ0 hc hadm.2.1, + weightedOperator_normQuasinilpotent θ _ hθ0 hc hadm.2.1 hdiv, + weightedOperator_vectorDeterminant_zero θ _ hθ0 hc hadm.2.1 hlog, + weightedOperator_spectrum_eq_singleton_zero θ _ hθ0 hc hadm.2.1 hdiv, + weightedOperator_isVectorBrownMeasure_dirac_zero_of_logIntegral + θ _ hθ01 hc hadm.2.1 hlog, + ?_, productPolarStructure_of_admissible θ _ hadm⟩ + exact hasOnlyTrivialInvariantProjections_of_sampling_and_phases hp e he θ hadm + hθ hsmall hlarge hs + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductScalarity.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScalarity.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f7d461dc8cd85510cd1d510f9e78b76a4c3611e --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScalarity.lean @@ -0,0 +1,79 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductCovariance +import OAI.Analysis.IrrationalRotation.Rotation.ActualRotationCentrality +import OAI.Analysis.IrrationalRotation.Analysis.ScalarFieldLift +import OAI.Analysis.IrrationalRotation.Operators.RepresentedCommutation +import OAI.Analysis.IrrationalRotation.Product.ProductHilbert +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal +namespace Invariant233.ProductModel + +local notation "S" => LinearIsometry.toContinuousLinearMap + (LinearIsometryEquiv.toLinearIsometry (WeightedShift.shift 1)) + +theorem scalar_of_mem_factor_central (θ : ℕ → ℝ) + (hθ : JointlyRationallyIndependent θ) (T : Hilbert →L[ℂ] Hilbert) + (hT : T ∈ factor θ) + (hcentral : ∀ B : Hilbert →L[ℂ] Hilbert, B ∈ factor θ → Commute T B) : + ∃ c : ℂ, T = c • (1 : Hilbert →L[ℂ] Hilbert) := by + obtain ⟨A, hbound, hm, hrep, huniq⟩ := exists_unique_field hT + let b : HilbertBasis ℤ ℂ Fiber := + HilbertBasis.ofRepr (LinearIsometryEquiv.refl ℂ Fiber) + have hS : Commute T shiftOperator := + hcentral shiftOperator (subset_vonNeumannGenerated _ (Or.inl (Set.mem_singleton _))) + have hAS : ∀ᵐ x ∂baseMeasure, Commute (A x) S := + DirectIntegral.ae_commute_of_represented_commute b T shiftOperator A (fun _ => S) + hrep shiftOperator_ae hS + let g : Base → ℂ := fun x => (AddCircle.toCircle (x 0) : ℂ) + have hg : Measurable g := by + exact (continuous_subtype_val.comp + ((AddCircle.continuous_toCircle (T := (1 : ℝ))).comp + (show Continuous (fun x : Base => x 0) from continuous_apply 0))).measurable + have hb : ∀ x, ‖g x‖ ≤ 1 := by + intro x + exact (Circle.norm_coe (AddCircle.toCircle (x 0))).le + let D := multiplier θ g 1 (by norm_num) hg hb + have hDmem : D ∈ factor θ := by + apply subset_vonNeumannGenerated + exact Or.inr ⟨g, 1, by norm_num, hg, hb, rfl⟩ + have hAD : ∀ᵐ x ∂baseMeasure, + Commute (A x) (WeightedShift.diagonal (multiplierField θ g 1 hb x)) := + DirectIntegral.ae_commute_of_represented_commute b T D A + (fun x => WeightedShift.diagonal (multiplierField θ g 1 hb x)) + hrep (multiplier_ae θ g 1 (by norm_num) hg hb) (hcentral D hDmem) + have hmeas : NullMeasurable + (fun x => A x (lp.single 2 (0 : ℤ) (1 : ℂ)) 0) baseMeasure := + ((lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 0).continuous.comp_stronglyMeasurable + (hm (lp.single 2 (0 : ℤ) (1 : ℂ)))).measurable.nullMeasurable + have hcov : ∀ᵐ x ∂baseMeasure, S * A (rotation θ x) = A x * S := by + filter_upwards [field_covariance hT A hrep] with x hall + have hx := hall 1 + have heq : rotationIterate θ 1 x = rotation θ x := by + funext i + simp only [rotationIterate, Int.cast_one, one_mul, rotation] + rw [heq] at hx + exact hx.symm + apply DirectIntegral.scalar_of_representation_ae_scalar T A hrep + apply WeightedShift.ae_eq_scalar_over_product_rotation θ hθ 0 A + (multiplierField θ g 1 hb) _ hmeas hAD hAS hcov + apply Eventually.of_forall + intro x k + change (AddCircle.toCircle (x 0 + (((k : ℝ) * θ 0 : ℝ) : Circle)) : ℂ) = + (AddCircle.toCircle (x 0 + k • (θ 0 : Circle)) : ℂ) + congr 3 + simpa only [zsmul_eq_mul] using + (AddCircle.coe_zsmul (p := (1 : ℝ)) (n := k) (x := θ 0)) + +theorem factor_isFactor (θ : ℕ → ℝ) (hθ : JointlyRationallyIndependent θ) : + IsFactor (factor θ) := + ⟨inferInstance, fun T hT hcentral => scalar_of_mem_factor_central θ hθ T hT hcentral⟩ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleAnalyticRealization.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleAnalyticRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd68e249efa92a039f64f5f805bc08e5dd30b676 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleAnalyticRealization.lean @@ -0,0 +1,67 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductScaleRealization +import OAI.Analysis.IrrationalRotation.Spectral.ProductSpectralBundle +import OAI.Analysis.IrrationalRotation.Product.ProductScalarity +import OAI.Analysis.IrrationalRotation.Product.ProductTracialVector +import OAI.Analysis.IrrationalRotation.Product.ProductBaseDynamics + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped BigOperators Topology + +namespace Invariant233.ProductModel + +open ProductPhases + +theorem exists_product_scales_phase_analytic_realization : + ∃ p : ProductScaleData, ProductScaleLaws p ∧ + ∃ (e : ℕ ≃ Σ j, Fin (p.m j)) (θ : ℕ → ℝ), + (∀ a : Σ j, Fin (p.m j), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) ∧ + (∀ j, ∀ i ∈ consecutiveBlock p.m j, + θ i ∈ Icc (1 / p.N j) (2 / p.N j)) ∧ + (∑' i, θ i) ≤ 2 * (∑' j, 1 / (p.K j : ℝ)) ∧ + (∑' i, θ i) ≤ 1 / 25 ∧ + AdmissibleAnglesAndCosts θ (fun i => p.C (e i).1) ∧ + HasNegInfiniteLogIntegral baseMeasure (weight θ (fun i => p.C (e i).1)) ∧ + (∀ᵐ x ∂baseMeasure, + 0 < weight θ (fun i => p.C (e i).1) x ∧ + weight θ (fun i => p.C (e i).1) x ≤ 1) ∧ + (∀ j, smallPhaseCondition (consecutiveBlock p.m j) (p.K j) (p.G j) θ) ∧ + (∀ᶠ j in atTop, + largePhaseCondition (consecutiveBlock p.m j) (p.N j) θ) ∧ + (∀ k : ℤ, k ≠ 0 → Ergodic (rotationIterate θ k) baseMeasure) ∧ + (∀ k : ℤ, k ≠ 0 → ∀ x : Base, rotationIterate θ k x ≠ x) ∧ + IsFactor (factor θ) ∧ IsFaithfulTracialVector (factor θ) traceVector ∧ + weightedOperator θ (fun i => p.C (e i).1) ∈ factor θ ∧ + weightedOperator θ (fun i => p.C (e i).1) ≠ 0 ∧ + NormQuasinilpotent (weightedOperator θ (fun i => p.C (e i).1)) ∧ + vectorFugledeKadisonDeterminant traceVector + (weightedOperator θ (fun i => p.C (e i).1)) = 0 ∧ + spectrum ℂ (weightedOperator θ (fun i => p.C (e i).1)) = {0} ∧ + ∀ (I : Finset ℕ) (n : ℕ), + ‖weightedOperator θ (fun i => p.C (e i).1) ^ n‖ ≤ + Real.exp ((∑ i ∈ I, p.C (e i).1) - + (n : ℝ) * (∑ i ∈ I, p.C (e i).1 * θ i)) := by + obtain ⟨p, hp, e, θ, he, hθ, hsumθ, hsumθ', hadm, hlog, hpos, + hsmall, hlarge, hmem, hne, hqn, hspec⟩ := + exists_product_scales_phase_quasinilpotent + refine ⟨p, hp, e, θ, he, hθ, hsumθ, hsumθ', hadm, hlog, hpos, + hsmall, hlarge, ?_, ?_, factor_isFactor θ hadm.2.2, + traceVector_faithfulTracial θ, hmem, hne, hqn, ?_, hspec, ?_⟩ + · intro k hk + exact rotationIterate_ergodic hadm.2.2 hk + · intro k hk x + exact rotationIterate_ne_self hadm.2.2 hk x + · exact weightedOperator_vectorDeterminant_zero_of_ae_pos θ _ + (hpos.mono (fun _ hx => hx.1)) hlog + · intro I n + exact norm_weightedOperator_pow_le_finite_cost θ _ + (fun i => (hadm.1 i).1.le) (fun i => (hadm.1 i).2.2.le) hadm.2.1 I n + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleCocycleWindow.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleCocycleWindow.lean new file mode 100644 index 0000000000000000000000000000000000000000..740e27fb3ac31fecbd5eb49b6af8266ae5cd4acb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleCocycleWindow.lean @@ -0,0 +1,91 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductCocycleWindow +import OAI.Analysis.IrrationalRotation.Product.ProductScaleConsequences + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexConjugate lp + +namespace Invariant233.ProductScaleData + +def earlyCoordinates (p : ProductScaleData) (e : ℕ ≃ Σ s, Fin (p.m s)) + (j : ℕ) : Finset ℕ := + ((Finset.range j).sigma (fun s => (Finset.univ : Finset (Fin (p.m s))))).map + e.symm.toEmbedding + +@[simp] theorem mem_earlyCoordinates (p : ProductScaleData) + (e : ℕ ≃ Σ s, Fin (p.m s)) (j i : ℕ) : + i ∈ p.earlyCoordinates e j ↔ (e i).1 < j := by + simp [earlyCoordinates] + +theorem sum_earlyCoordinates_cost (p : ProductScaleData) + (e : ℕ ≃ Σ s, Fin (p.m s)) (j : ℕ) : + (∑ i ∈ p.earlyCoordinates e j, p.C (e i).1) = p.prefixCost j := by + simp [earlyCoordinates, Finset.sum_sigma, prefixCost, mul_comm] + +end Invariant233.ProductScaleData + +namespace Invariant233.ProductScaleLaws +variable {p : ProductScaleData} (hp : ProductScaleLaws p) +include hp + +theorem current_window_margin (j : ℕ) : + 2 * (p.K j : ℝ) / p.N j = 2 / (p.m j : ℝ) := by + have hK : (p.K j : ℝ) ≠ 0 := (hp.real_K_pos j).ne' + have hm : (p.m j : ℝ) ≠ 0 := by exact_mod_cast (hp.m_pos j).ne' + unfold ProductScaleData.N + field_simp + +theorem product_finite_window_coefficients + (e : ℕ ≃ Σ s, Fin (p.m s)) (θ : ℕ → ℝ) + (hphase : ∀ i, θ i ∈ Set.Icc (1 / p.N (e i).1) (2 / p.N (e i).1)) + (j : ℕ) (x y : ProductCocycle.Space ℕ) + (hcurrent : ∀ i, (e i).1 = j → + ProductCocycle.representative (x i) < 1 - 2 / (p.m j : ℝ) ∧ + 2 / (p.m j : ℝ) < ProductCocycle.representative (y i)) + (hfuture : ∀ i, j < (e i).1 → + ProductCocycle.representative (x i) < 1 - 2 * (p.K j : ℝ) / p.N (e i).1 ∧ + 2 * (p.K j : ℝ) / p.N (e i).1 < ProductCocycle.representative (y i)) + (ξ γ : ℓ²(ℤ, ℂ)) (hξ : ‖ξ‖ ≤ 1) (hγ : ‖γ‖ ≤ 1) : + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖ξ v / (ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) v x : ℂ)‖ ≤ + p.coefficientBound j) ∧ + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖(ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) (-v) y : ℂ) * + conj (γ (-v))‖ ≤ p.coefficientBound j) := by + have hN (s : ℕ) : 2 ≤ p.N s := by + have hm : (100 : ℝ) ≤ p.m s := by exact_mod_cast hp.m_ge_100 s + have hK : (1 : ℝ) ≤ p.K s := by exact_mod_cast hp.K_pos s + dsimp [ProductScaleData.N] + nlinarith + have hθ (i : ℕ) : θ i ∈ Set.Icc (0 : ℝ) 1 := by + constructor + · exact (div_nonneg (by norm_num) (by linarith [hN (e i).1])).trans (hphase i).1 + · exact (hphase i).2.trans ((div_le_one (by linarith [hN (e i).1])).mpr (hN _)) + have hexclude (i : ℕ) (hi : i ∉ p.earlyCoordinates e j) : + ProductCocycle.representative (x i) + (p.K j : ℝ) * θ i < 1 ∧ + (p.K j : ℝ) * θ i ≤ ProductCocycle.representative (y i) := by + have htag : j ≤ (e i).1 := by simpa only [p.mem_earlyCoordinates, not_lt] using hi + have hevent : ProductCocycle.representative (x i) < 1 - 2 * (p.K j : ℝ) / p.N (e i).1 ∧ + 2 * (p.K j : ℝ) / p.N (e i).1 < ProductCocycle.representative (y i) := by + rcases eq_or_lt_of_le htag with h | h + · simpa only [← h, hp.current_window_margin] using hcurrent i h.symm + · exact hfuture i h + have hmul := mul_le_mul_of_nonneg_left (hphase i).2 (Nat.cast_nonneg (p.K j)) + have hbound : (p.K j : ℝ) * θ i ≤ 2 * (p.K j : ℝ) / p.N (e i).1 := by + calc + _ ≤ (p.K j : ℝ) * (2 / p.N (e i).1) := hmul + _ = _ := by ring + constructor + · linarith [hevent.1] + · exact hbound.trans hevent.2.le + have h := ProductCocycle.finite_window_coefficients (p.earlyCoordinates e j) + θ (fun i => p.C (e i).1) (p.K j) x y hθ (fun i => (hp.C_pos _).le) + (fun i hi => (hexclude i hi).1) (fun i hi => (hexclude i hi).2) ξ γ hξ hγ + simpa only [p.sum_earlyCoordinates_cost, ProductScaleData.coefficientBound] using h + +end Invariant233.ProductScaleLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleConsequences.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleConsequences.lean new file mode 100644 index 0000000000000000000000000000000000000000..6aa604cf9e77dc5e236060bfcd0dc8804d6605c2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleConsequences.lean @@ -0,0 +1,136 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductScales +import OAI.Analysis.IrrationalRotation.Analysis.ParameterTails +import OAI.Analysis.IrrationalRotation.Sampling.SamplingHorizon + +namespace OAI + +noncomputable section +open scoped BigOperators Topology +open Filter +namespace Invariant233.ProductScaleLaws + +variable {p : ProductScaleData} (hp : ProductScaleLaws p) +include hp + +theorem m_pos (n : ℕ) : 0 < p.m n := by have := hp.m_ge_100 n; omega + +theorem C_pos (n : ℕ) : 0 < p.C n := by + rw [hp.C_eq n] + exact lt_of_lt_of_le (lt_of_lt_of_le (by norm_num : (0 : ℝ) < 1) (hp.L_ge_one n)) + (le_max_left _ _) + +theorem real_K_pos (n : ℕ) : 0 < (p.K n : ℝ) := by exact_mod_cast hp.K_pos n + +theorem real_K_double (n : ℕ) : 2 * (p.K n : ℝ) ≤ (p.K (n + 1) : ℝ) := by + exact_mod_cast (hp.K_double n).le + +theorem summable_reciprocal : Summable (fun n => 1 / (p.K n : ℝ)) := + ParameterTails.summable_reciprocal hp.real_K_pos hp.real_K_double + +theorem reciprocal_tail_bound (n : ℕ) : + (∑' r : ℕ, 1 / (p.K (n + 1 + r) : ℝ)) ≤ 2 / (p.K (n + 1) : ℝ) := + ParameterTails.reciprocal_tail_bound hp.real_K_pos hp.real_K_double n + +theorem prefix_count_succ_le (n : ℕ) : + (p.prefixCount (n + 1) : ℝ) ≤ (101 / 100 : ℝ) * p.m n := by + have h := hp.prefix_count_le n + simp only [ProductScaleData.prefixCount, Finset.sum_range_succ, Nat.cast_add] at * + linarith + +theorem N_le_square (n : ℕ) : p.N n ≤ (p.m n : ℝ) ^ 2 := by + have h : (p.K n : ℝ) ≤ p.m n := by exact_mod_cast hp.m_ge_K n + dsimp [ProductScaleData.N] + nlinarith [show (0 : ℝ) ≤ p.m n by positivity] + +theorem a_bounds (n : ℕ) : + 1 / (p.m n : ℝ) ≤ p.a n ∧ p.a n ≤ 1 / 4 := by + have hm : 0 < (p.m n : ℝ) := by exact_mod_cast hp.m_pos n + have hG : (1 : ℝ) ≤ p.G n := by exact_mod_cast hp.G_pos n + have hlarge : 4 * (p.G n : ℝ) ≤ p.m n := by exact_mod_cast hp.m_ge_G n + dsimp [ProductScaleData.a] + constructor + · exact div_le_div_of_nonneg_right hG hm.le + · apply (div_le_iff₀ hm).mpr + linarith + +theorem b_bounds (n : ℕ) : + 1 / (p.m n : ℝ) ≤ p.b n ∧ p.b n ≤ 1 / 4 := by + have hm100 : (100 : ℝ) ≤ p.m n := by exact_mod_cast hp.m_ge_100 n + have hm1 : (1 : ℝ) ≤ p.m n := by linarith + have hm : (0 : ℝ) < p.m n := by linarith + dsimp [ProductScaleData.b] + constructor + · rw [one_div, ← Real.rpow_neg_one] + exact Real.rpow_le_rpow_of_exponent_le hm1 (by norm_num) + · calc + (p.m n : ℝ) ^ (-(19 / 20 : ℝ)) ≤ (p.m n : ℝ) ^ (-(1 / 2 : ℝ)) := + Real.rpow_le_rpow_of_exponent_le hm1 (by norm_num) + _ = (Real.sqrt (p.m n : ℝ))⁻¹ := by rw [Real.rpow_neg hm.le, ← Real.sqrt_eq_rpow] + _ ≤ 1 / 4 := by + have hs : (4 : ℝ) ≤ Real.sqrt (p.m n : ℝ) := by + apply Real.le_sqrt_of_sq_le + linarith + simpa only [one_div] using one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 4) hs + +theorem K_strictMono : StrictMono p.K := by + apply strictMono_nat_of_lt_succ + intro n + have := hp.K_double n + omega + +theorem m_lt_next_K (n : ℕ) : p.m n < p.K (n + 1) := by + have hm : (20 : ℝ) ≤ p.m n := by exact_mod_cast le_trans (by decide) (hp.m_ge_100 n) + have h := SamplingHorizon.twice_lt_ceiling_cutoff hm + rw [← hp.next_K n] at h + have hmpos : (0 : ℝ) < p.m n := by exact_mod_cast hp.m_pos n + have : (p.m n : ℝ) < p.K (n + 1) := by linarith + exact_mod_cast this + +theorem m_strictMono : StrictMono p.m := by + apply strictMono_nat_of_lt_succ + intro n + exact (hp.m_lt_next_K n).trans_le (hp.m_ge_K (n + 1)) + +theorem N_strictMono : StrictMono p.N := by + intro n k hnk + have hm : (p.m n : ℝ) < p.m k := by exact_mod_cast hp.m_strictMono hnk + have hK : (p.K n : ℝ) < p.K k := by exact_mod_cast hp.K_strictMono hnk + exact mul_lt_mul hm hK.le (hp.real_K_pos n) (by positivity) + +theorem K_ge_100 (n : ℕ) : 100 ≤ p.K n := by + simpa only [hp.initial_K] using hp.K_strictMono.monotone (Nat.zero_le n) + +theorem m_ge_pow_self (n : ℕ) : 2 ^ n ≤ p.m n := by + have h := hp.m_ge_pow n + have hpow : 2 ^ n ≤ 2 ^ (n + 1) := by + rw [pow_succ] + omega + exact hpow.trans h + +theorem reciprocal_sum_le : (∑' n, 1 / (p.K n : ℝ)) ≤ 1 / 50 := by + have h := ParameterTails.tsum_tail_le_of_half_decay + (fun n => (one_div_pos.mpr (hp.real_K_pos n)).le) + (ParameterTails.reciprocal_half_decay hp.real_K_pos hp.real_K_double) 0 + norm_num [hp.initial_K] at h ⊢ + exact h + +theorem prefixCost_nonneg (n : ℕ) : 0 ≤ p.prefixCost n := by + apply Finset.sum_nonneg + intro r hr + exact mul_nonneg (hp.C_pos r).le (Nat.cast_nonneg _) + +theorem coefficientBound_ge_one (n : ℕ) : 1 ≤ p.coefficientBound n := by + apply Real.one_le_exp_iff.mpr + exact mul_nonneg (by positivity) (hp.prefixCost_nonneg n) + +theorem one_le_C_div_K (n : ℕ) : 1 ≤ p.C n / p.K n := by + have hK : (1 : ℝ) ≤ p.K n := by exact_mod_cast hp.K_pos n + have hC : (p.K n : ℝ) ^ 2 ≤ p.C n := by rw [hp.C_eq n]; exact le_max_right _ _ + apply (le_div_iff₀ (hp.real_K_pos n)).mpr + nlinarith + +end Invariant233.ProductScaleLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleConstruction.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleConstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..d64fd59b1ce5be0fc02f7c7d93f3a9669db0b63d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleConstruction.lean @@ -0,0 +1,169 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductScales +import OAI.Analysis.IrrationalRotation.Sampling.SamplingHorizon +import OAI.Analysis.IrrationalRotation.Analysis.LaurentNoncancellation + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Invariant233.ProductScaleConstruction + +open SamplingHorizon FiniteWindow + +private structure State where + K : ℕ + G : ℕ + count : ℕ + cost : ℝ + previousL : ℝ + +private structure Step (n : ℕ) (s : State) where + m : ℕ + Gnext : ℕ + L : ℝ + ε : ℝ + epsilon_pos : 0 < ε + L_one : 1 ≤ L + L_previous : s.previousL ≤ L + gain_one : 1 ≤ Gnext + gain : L ≤ ProductScaleData.kappa (n + 1) * Real.sqrt (Gnext : ℝ) + m_K : s.K ≤ m + m_pow : 2 ^ (n + 1) ≤ m + m_G : 4 * s.G ≤ m + m_large : 200 ≤ m + count_bound : (s.count : ℝ) ≤ (m : ℝ) / 100 + attenuation_m : L ≤ ProductScaleData.kappa n * (m : ℝ) ^ (1 / 40 : ℝ) + gap : (Gnext : ℝ) * (⌈(m : ℝ) ^ ((3 / 4 : ℝ) * m)⌉₊ : ℝ) < + (m : ℝ) ^ ((4 / 5 : ℝ) * m) + double : 2 * s.K < ⌈(m : ℝ) ^ ((3 / 4 : ℝ) * m)⌉₊ + attenuation : ((2 * s.K + 1 : ℕ) : ℝ) * 3 * Real.exp (-L / 10000) ≤ + ε / ((n + 1 : ℕ) : ℝ) + polynomial : ∀ A B : ℤ → ℂ, + (∀ i, |i| ≤ (s.K : ℤ) → ‖A i‖ ≤ Real.exp (((s.K : ℝ) + 1) * s.cost)) → + (∀ i, |i| ≤ (s.K : ℤ) → ‖B i‖ ≤ Real.exp (((s.K : ℝ) + 1) * s.cost)) → + 1 / ((n + 1 : ℕ) : ℝ) ≤ ‖A 0‖ → 1 / ((n + 1 : ℕ) : ℝ) ≤ ‖B 0‖ → + ∃ i : ℕ, i ≤ 2 * s.K ∧ ε ≤ ‖convolution s.K A B i‖ + +private theorem step_exists (n : ℕ) (s : State) : Nonempty (Step n s) := by + have hn : (0 : ℝ) < ((n + 1 : ℕ) : ℝ) := by positivity + obtain ⟨ε, hε, hpoly⟩ := uniform_convolution_lower_bound s.K + (Real.exp (((s.K : ℝ) + 1) * s.cost)) (1 / ((n + 1 : ℕ) : ℝ)) (by positivity) + obtain ⟨L, hL1, hLprev, hL⟩ := exists_attenuation + (((2 * s.K + 1 : ℕ) : ℝ) * 3) s.previousL + (ε / ((n + 1 : ℕ) : ℝ)) (div_pos hε hn) + have hk : 0 < ProductScaleData.kappa (n + 1) := by + unfold ProductScaleData.kappa + positivity + obtain ⟨G, hG, hgain⟩ := exists_next_gain (ProductScaleData.kappa (n + 1)) L hk + obtain ⟨m, hmK, hmpow, hmG, hmlarge, hcount, hmL, hgap, _hheight, hdouble⟩ := + exists_stage_size (n + 1) (by omega) s.K s.G G L 0 s.count + exact ⟨{ + m := m, Gnext := G, L := L, ε := ε + epsilon_pos := hε, L_one := hL1, L_previous := hLprev + gain_one := hG, gain := hgain + m_K := by exact_mod_cast hmK + m_pow := by exact_mod_cast hmpow + m_G := by exact_mod_cast hmG + m_large := hmlarge + count_bound := hcount + attenuation_m := hmL + gap := hgap + double := by exact_mod_cast hdouble + attenuation := hL + polynomial := hpoly }⟩ + +private def chooseStep (n : ℕ) (s : State) : Step n s := + Classical.choice (step_exists n s) + +private def nextState (n : ℕ) (s : State) : State := + let t := chooseStep n s + { K := ⌈(t.m : ℝ) ^ ((3 / 4 : ℝ) * t.m)⌉₊ + G := t.Gnext + count := s.count + t.m + cost := s.cost + max t.L ((s.K : ℝ) ^ 2) * t.m + previousL := t.L } + +private def states : ℕ → State := + Nat.rec ⟨100, 1, 0, 0, 0⟩ nextState + +private def choices (n : ℕ) : Step n (states n) := chooseStep n (states n) + +def constructed : ProductScaleData where + m n := (choices n).m + K n := (states n).K + G n := (states n).G + L n := (choices n).L + C n := max (choices n).L (((states n).K : ℝ) ^ 2) + ε n := (choices n).ε + +private theorem states_succ (n : ℕ) : states (n + 1) = nextState n (states n) := rfl + +private theorem count_eq (n : ℕ) : (states n).count = constructed.prefixCount n := by + induction n with + | zero => simp [states, ProductScaleData.prefixCount] + | succ n ih => + change (states n).count + (choices n).m = constructed.prefixCount (n + 1) + rw [ih] + simp [ProductScaleData.prefixCount, Finset.sum_range_succ, constructed] + +private theorem cost_eq (n : ℕ) : (states n).cost = constructed.prefixCost n := by + induction n with + | zero => simp [states, ProductScaleData.prefixCost] + | succ n ih => + change (states n).cost + max (choices n).L (((states n).K : ℝ) ^ 2) * + (choices n).m = constructed.prefixCost (n + 1) + rw [ih] + simp [ProductScaleData.prefixCost, Finset.sum_range_succ, constructed] + +theorem constructed_laws : ProductScaleLaws constructed := by + refine { + initial_K := rfl + initial_G := rfl + K_pos := ?_ + G_pos := ?_ + epsilon_pos := fun n => (choices n).epsilon_pos + L_ge_one := fun n => (choices n).L_one + L_monotone := ?_ + C_eq := fun _ => rfl + polynomial_lower := ?_ + polynomial_attenuation := fun n => (choices n).attenuation + gain_attenuation := fun n => (choices n).gain + m_ge_K := fun n => (choices n).m_K + m_ge_pow := fun n => (choices n).m_pow + m_ge_G := fun n => (choices n).m_G + m_ge_100 := fun n => le_trans (by decide) (choices n).m_large + prefix_count_le := ?_ + m_attenuation := fun n => (choices n).attenuation_m + next_K := fun _ => rfl + next_gap := fun n => (choices n).gap + K_double := fun n => (choices n).double } + · intro n + induction n with + | zero => norm_num [constructed, states] + | succ n ih => + have h := (choices n).double + change 0 < ⌈((choices n).m : ℝ) ^ ((3 / 4 : ℝ) * (choices n).m)⌉₊ + omega + · intro n + cases n with + | zero => norm_num [constructed, states] + | succ n => exact Nat.zero_lt_of_lt (choices n).gain_one + · apply monotone_nat_of_le_succ + intro n + exact (choices (n + 1)).L_previous + · intro n + unfold ProductScaleData.coefficientBound + rw [← cost_eq n] + exact (choices n).polynomial + · intro n + rw [← count_eq n] + exact (choices n).count_bound + +theorem exists_product_scales : ∃ p : ProductScaleData, ProductScaleLaws p := + ⟨constructed, constructed_laws⟩ + +end Invariant233.ProductScaleConstruction + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleRealization.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..00a45364d91fcc1687e3eea9954077cc9ff20156 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleRealization.lean @@ -0,0 +1,61 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductScaleConstruction +import OAI.Analysis.IrrationalRotation.Product.ProductScaleConsequences +import OAI.Analysis.IrrationalRotation.Spectral.PhaseBlockQuasinilpotent + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped BigOperators Topology + +namespace Invariant233.ProductModel + +open ProductPhases + +theorem exists_product_scales_phase_quasinilpotent : + ∃ p : ProductScaleData, ProductScaleLaws p ∧ + ∃ (e : ℕ ≃ Σ j, Fin (p.m j)) (θ : ℕ → ℝ), + (∀ a : Σ j, Fin (p.m j), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) ∧ + (∀ j, ∀ i ∈ consecutiveBlock p.m j, + θ i ∈ Icc (1 / p.N j) (2 / p.N j)) ∧ + (∑' i, θ i) ≤ 2 * (∑' j, 1 / (p.K j : ℝ)) ∧ + (∑' i, θ i) ≤ 1 / 25 ∧ + AdmissibleAnglesAndCosts θ (fun i => p.C (e i).1) ∧ + HasNegInfiniteLogIntegral baseMeasure (weight θ (fun i => p.C (e i).1)) ∧ + (∀ᵐ x ∂baseMeasure, + 0 < weight θ (fun i => p.C (e i).1) x ∧ + weight θ (fun i => p.C (e i).1) x ≤ 1) ∧ + (∀ j, smallPhaseCondition (consecutiveBlock p.m j) (p.K j) (p.G j) θ) ∧ + (∀ᶠ j in atTop, + largePhaseCondition (consecutiveBlock p.m j) (p.N j) θ) ∧ + weightedOperator θ (fun i => p.C (e i).1) ∈ factor θ ∧ + weightedOperator θ (fun i => p.C (e i).1) ≠ 0 ∧ + NormQuasinilpotent (weightedOperator θ (fun i => p.C (e i).1)) ∧ + spectrum ℂ (weightedOperator θ (fun i => p.C (e i).1)) = {0} := by + obtain ⟨p, hp⟩ := ProductScaleConstruction.exists_product_scales + have hK (j : ℕ) : (1 : ℝ) ≤ p.K j := by exact_mod_cast hp.K_pos j + have hG (j : ℕ) : (0 : ℝ) < p.G j := by exact_mod_cast hp.G_pos j + have hC (j : ℕ) : (p.K j : ℝ) ^ 2 ≤ p.C j := by + rw [hp.C_eq j] + exact le_max_right _ _ + have hscale (j : ℕ) : (2 : ℝ) < (p.m j : ℝ) * p.K j := by + have hm : (100 : ℝ) ≤ p.m j := by exact_mod_cast hp.m_ge_100 j + have hk := hK j + nlinarith + obtain ⟨e, θ, he, hθ, hsumθ, hadm, hlog, hpos, hsmall, hlarge, + hmem, hne, hqn, hspec⟩ := + exists_admissible_phase_block_quasinilpotent p.m hp.m_ge_pow_self + (fun j => (p.K j : ℝ)) (fun j => (p.G j : ℝ)) p.C hK hG hC hscale + hp.summable_reciprocal + have hsumθ' : (∑' i, θ i) ≤ 1 / 25 := by + have hsumK := hp.reciprocal_sum_le + linarith + exact ⟨p, hp, e, θ, he, hθ, hsumθ, hsumθ', hadm, hlog, hpos, + hsmall, hlarge, hmem, hne, hqn, hspec⟩ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTagAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTagAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..946d200570b99587abf427644a24ca43e7fa9ab2 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTagAttenuation.lean @@ -0,0 +1,57 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductScales +import OAI.Analysis.IrrationalRotation.Sampling.BlockPhaseConstruction +import OAI.Analysis.IrrationalRotation.Product.ProductSourceTagAttenuation + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators + +namespace Invariant233.ProductScaleLaws + +theorem ae_all_source_tagged_ratios {p : ProductScaleData} (hp : ProductScaleLaws p) + (e : ℕ ≃ Σ s, Fin (p.m s)) + (he : ∀ a : Σ s, Fin (p.m s), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) + (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (j : ℕ) (hb : ∀ i ∈ ProductPhases.consecutiveBlock p.m j, + θ i ∈ Set.Icc (1 / p.N j) (2 / p.N j)) + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (x y : Ω → ProductCocycle.Space ℕ) + (hx : AEMeasurable x μ) (hy : AEMeasurable y μ) + (hacx : μ.map x ≪ ProductCocycle.haar ℕ) + (hacy : μ.map y ≪ ProductCocycle.haar ℕ) + (horder : ∀ᵐ ω ∂μ, ∀ i, + ProductCocycle.representative (x ω i) ≤ ProductCocycle.representative (y ω i)) + (E : Set Ω) (htag : ∀ᵐ ω ∂μ, ω ∈ E → + ∃ i ∈ ProductPhases.consecutiveBlock p.m j, + ProductCocycle.representative (x ω i) < 1 / (p.m j : ℝ) ∧ + 1 - 1 / (p.m j : ℝ) ≤ ProductCocycle.representative (y ω i)) : + ∀ᵐ ω ∂μ, ω ∈ E → ∀ k : ℤ, + (p.K j : ℝ) < |(k : ℝ)| → |(k : ℝ)| ≤ p.N j / 4 → + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (y ω) / + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (x ω) ≤ + Real.exp (-p.L j) := by + have hC (s : ℕ) : p.L s ≤ p.C s := by + rw [hp.C_eq s] + exact le_max_left _ _ + have hcost (i : ℕ) (hi : i ∈ ProductPhases.consecutiveBlock p.m j) : + p.L j ≤ p.C (e i).1 := by + rw [ProductPhases.enumeration_block_of_mem p.m e he hi] + exact hC j + exact ProductCocycle.ae_all_source_tagged_ratios_of_map_ac μ θ + (fun i => p.C (e i).1) hθ0 hθ + (fun i => (by norm_num : (0 : ℝ) ≤ 1).trans + ((hp.L_ge_one (e i).1).trans (hC (e i).1))) + x y hx hy hacx hacy horder (p.m j) (p.K j) (p.L j) + (by exact_mod_cast (show 4 ≤ p.m j by have := hp.m_ge_100 j; omega)) + (by exact_mod_cast hp.K_pos j) + (ProductPhases.consecutiveBlock p.m j) + (fun i hi => (hb i hi).1) (fun i hi => (hb i hi).2) hcost E htag + +end Invariant233.ProductScaleLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTail.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2015a67eab48e9050db5fa0bee893fc718510bb --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTail.lean @@ -0,0 +1,107 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductScaleConsequences +import OAI.Analysis.IrrationalRotation.Sampling.BlockPhaseConstruction + +namespace OAI + +noncomputable section +open scoped BigOperators Topology +open Filter +namespace Invariant233.ProductScaleLaws + +open ProductPhases InvariantProjection.IndependentAngles +variable {p : ProductScaleData} (hp : ProductScaleLaws p) +include hp + +omit hp + +theorem mem_consecutiveBlock_tail (j r i : ℕ) + (hi : i ∈ consecutiveBlock (fun k => p.m (j + k)) r) : + p.prefixCount j + i ∈ consecutiveBlock p.m (j + r) := by + have h := (mem_consecutiveBlock_iff _ _ _).mp hi + apply (mem_consecutiveBlock_iff _ _ _).mpr + rw [Finset.sum_range_add] + dsimp [ProductScaleData.prefixCount] + omega + +include hp + +theorem angle_tail_le (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) + (hθ : ∀ j, ∀ i ∈ consecutiveBlock p.m j, + θ i ≤ 2 / ((p.m j : ℝ) * p.K j)) (j : ℕ) : + (∑' i, θ (p.prefixCount j + i)) ≤ 2 * (∑' r, 1 / (p.K (j + r) : ℝ)) := by + let mt : ℕ → ℕ := fun r => p.m (j + r) + let Kt : ℕ → ℝ := fun r => p.K (j + r) + have hm : ∀ r, 0 < mt r := fun r => hp.m_pos (j + r) + have hK : ∀ r, 0 < Kt r := fun r => hp.real_K_pos (j + r) + have hsum : Summable (fun r => 1 / Kt r) := by + simpa only [Kt, Nat.add_comm] using (summable_nat_add_iff j).mpr hp.summable_reciprocal + obtain ⟨e, he⟩ := exists_consecutiveBlocks_equiv mt hm + have hrec := enumerated_block_reciprocal mt hm Kt hK hsum e + have hbound (i : ℕ) : θ (p.prefixCount j + i) ≤ + 2 * (1 / ((mt (e i).1 : ℝ) * Kt (e i).1)) := by + have hi := mem_consecutiveBlock_enumeration mt e he i + have hi' := mem_consecutiveBlock_tail j (e i).1 i hi + simpa only [mt, Kt, mul_one_div] using hθ _ _ hi' + have hs : Summable (fun i => θ (p.prefixCount j + i)) := + Summable.of_nonneg_of_le (fun i => hθ0 _) hbound (hrec.1.mul_left 2) + calc + _ ≤ ∑' i, 2 * (1 / ((mt (e i).1 : ℝ) * Kt (e i).1)) := + hs.tsum_le_tsum hbound (hrec.1.mul_left 2) + _ = 2 * (∑' r, 1 / (p.K (j + r) : ℝ)) := by + rw [tsum_mul_left, hrec.2] + +theorem angle_tail_le_four_div_next (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) + (hθ : ∀ j, ∀ i ∈ consecutiveBlock p.m j, + θ i ≤ 2 / ((p.m j : ℝ) * p.K j)) (n : ℕ) : + (∑' i, θ (p.prefixCount (n + 1) + i)) ≤ 4 / (p.K (n + 1) : ℝ) := by + calc + _ ≤ 2 * (∑' r, 1 / (p.K (n + 1 + r) : ℝ)) := hp.angle_tail_le θ hθ0 hθ (n + 1) + _ ≤ 2 * (2 / (p.K (n + 1) : ℝ)) := + mul_le_mul_of_nonneg_left (hp.reciprocal_tail_bound n) (by norm_num) + _ = _ := by ring + +theorem horizon_ratio_le_decay (n : ℕ) : + (p.m n : ℝ) ^ ((7 / 10 : ℝ) * p.m n) / p.K (n + 1) ≤ + (p.m n : ℝ) ^ (-(p.m n : ℝ) / 20) := by + have hm : 0 < (p.m n : ℝ) := by exact_mod_cast hp.m_pos n + have hnext : (p.m n : ℝ) ^ ((3 / 4 : ℝ) * p.m n) ≤ p.K (n + 1) := by + rw [hp.next_K n] + exact Nat.le_ceil _ + calc + _ ≤ (p.m n : ℝ) ^ ((7 / 10 : ℝ) * p.m n) / + (p.m n : ℝ) ^ ((3 / 4 : ℝ) * p.m n) := + div_le_div_of_nonneg_left (by positivity) (Real.rpow_pos_of_pos hm _) hnext + _ = _ := by rw [← Real.rpow_sub hm]; congr 1; ring + +theorem power_mul_angle_tail_le (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) + (hθ : ∀ j, ∀ i ∈ consecutiveBlock p.m j, + θ i ≤ 2 / ((p.m j : ℝ) * p.K j)) (n t : ℕ) + (ht : (t : ℝ) ≤ (p.m n : ℝ) ^ ((7 / 10 : ℝ) * p.m n)) : + (t : ℝ) * (∑' i, θ (p.prefixCount (n + 1) + i)) ≤ + 4 * (p.m n : ℝ) ^ (-(p.m n : ℝ) / 20) := by + calc + _ ≤ (p.m n : ℝ) ^ ((7 / 10 : ℝ) * p.m n) * (4 / (p.K (n + 1) : ℝ)) := + mul_le_mul ht (hp.angle_tail_le_four_div_next θ hθ0 hθ n) + (tsum_nonneg fun _ => hθ0 _) (by positivity) + _ = 4 * ((p.m n : ℝ) ^ ((7 / 10 : ℝ) * p.m n) / p.K (n + 1)) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left (hp.horizon_ratio_le_decay n) (by norm_num) + +theorem tendsto_tail_trim_bound : + Tendsto (fun n => 4 * (p.m n : ℝ) ^ (-(p.m n : ℝ) / 20)) atTop (𝓝 0) := by + have hm : Tendsto (fun n => (p.m n : ℝ)) atTop atTop := + tendsto_natCast_atTop_atTop.comp hp.m_strictMono.tendsto_atTop + have hi : Tendsto (fun n => 4 * (p.m n : ℝ)⁻¹) atTop (𝓝 0) := by + simpa using (tendsto_inv_atTop_zero.comp hm).const_mul 4 + apply squeeze_zero' _ _ hi + · exact Filter.Eventually.of_forall fun _ => by positivity + · apply Filter.Eventually.of_forall + intro n + apply mul_le_mul_of_nonneg_left _ (by norm_num) + apply SamplingHorizon.decay_le_inv + exact_mod_cast le_trans (by decide : 20 ≤ 100) (hp.m_ge_100 n) + +end Invariant233.ProductScaleLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTailAssignment.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTailAssignment.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2a24a0b73027b0962b959b197a4d45cd14ae9d1 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTailAssignment.lean @@ -0,0 +1,84 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductScales +import OAI.Analysis.IrrationalRotation.Model.PhaseBlocks +import OAI.Analysis.IrrationalRotation.Product.ProductTailScaleCover + +namespace OAI + +noncomputable section +open Filter +open scoped Topology + +namespace Invariant233.ProductScaleLaws + +variable {p : ProductScaleData} (hp : ProductScaleLaws p) +include hp + +theorem exists_phase_tail_thresholds (θ : ℕ → ℝ) (j : ℕ) + (hsmall : ∀ s, j < s → ProductPhases.smallPhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.K s) (p.G s) θ) + (hlarge : ∀ s, j ≤ s → ProductPhases.largePhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.N s) θ) + (k : ℤ) (hk : p.N j / 4 ≤ |(k : ℝ)|) : + ∃ (s : ℕ) (w : ℝ) (I : Finset ℕ), + j ≤ s ∧ (w = p.b s ∨ (j < s ∧ w = p.a s)) ∧ + w ∈ Set.Icc (1 / (p.m s : ℝ)) (1 / 4) ∧ + I ⊆ ProductPhases.consecutiveBlock p.m s ∧ (p.m s : ℝ) / 20 ≤ I.card ∧ + (∀ i ∈ I, 1 - Int.fract ((k : ℝ) * θ i) ∈ Set.Icc w (1 - w)) ∧ + p.L j ≤ (p.m s : ℝ) * CouplingMarginalBounds.rho + (ProductScaleData.kappa s) (p.m s) w ∧ p.L j ≤ p.C s := by + have hcard (s : ℕ) : (ProductPhases.consecutiveBlock p.m s).card = p.m s := by + simp [ProductPhases.consecutiveBlock] + have hgrowth (s : ℕ) : 2 ^ s ≤ p.m s := by + have h := hp.m_ge_pow s + rw [pow_succ] at h + have : 0 < 2 ^ s := by positivity + omega + have hG (s : ℕ) : (1 : ℝ) ≤ p.G s ∧ 4 * (p.G s : ℝ) ≤ p.m s := by + constructor + · exact_mod_cast hp.G_pos s + · exact_mod_cast hp.m_ge_G s + have hC (s : ℕ) : p.L s ≤ p.C s := by + rw [hp.C_eq s] + exact le_max_left _ _ + have h := ProductPhases.exists_tail_thresholds + (ProductPhases.consecutiveBlock p.m) (fun s => (p.K s : ℝ)) + (fun s => (p.G s : ℝ)) ProductScaleData.kappa p.L p.C θ j + (by simpa only [hcard] using fun s (_ : j ≤ s) => hp.m_ge_100 s) + (by simpa only [hcard] using fun s (_ : j ≤ s) => hgrowth s) + (by simpa only [hcard] using fun s (_ : j ≤ s) => hG s) + (by simpa only [hcard, TailScaleCover.upperHorizon] using + fun s (_ : j ≤ s) => hp.next_gap s) + (fun s hs => hp.L_monotone hs) + (fun s _ => hC s) + (by simpa only [hcard] using fun s (_ : j ≤ s) => hp.m_attenuation s) + (fun s _ => hp.gain_attenuation s) + hsmall + (by simpa only [hcard, ProductScaleData.N] using hlarge) + k (by simpa only [hcard, ProductScaleData.N] using hk) + simpa only [hcard, ProductScaleData.a, ProductScaleData.b] using h + +theorem eventually_phase_tail_thresholds (θ : ℕ → ℝ) + (hsmall : ∀ s, ProductPhases.smallPhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.K s) (p.G s) θ) + (hlarge : ∀ᶠ s in atTop, ProductPhases.largePhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.N s) θ) : + ∀ᶠ j in atTop, ∀ k : ℤ, p.N j / 4 ≤ |(k : ℝ)| → + ∃ (s : ℕ) (w : ℝ) (I : Finset ℕ), + j ≤ s ∧ (w = p.b s ∨ (j < s ∧ w = p.a s)) ∧ + w ∈ Set.Icc (1 / (p.m s : ℝ)) (1 / 4) ∧ + I ⊆ ProductPhases.consecutiveBlock p.m s ∧ (p.m s : ℝ) / 20 ≤ I.card ∧ + (∀ i ∈ I, 1 - Int.fract ((k : ℝ) * θ i) ∈ Set.Icc w (1 - w)) ∧ + p.L j ≤ (p.m s : ℝ) * CouplingMarginalBounds.rho + (ProductScaleData.kappa s) (p.m s) w ∧ p.L j ≤ p.C s := by + obtain ⟨j₀, hj₀⟩ := eventually_atTop.mp hlarge + apply eventually_atTop.mpr + refine ⟨j₀, ?_⟩ + intro j hj k hk + exact hp.exists_phase_tail_thresholds θ j (fun s _ => hsmall s) + (fun s hs => hj₀ s (hj.trans hs)) k hk + +end Invariant233.ProductScaleLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTailAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTailAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..16cf10fbb7e5ad968a99fdc43aa3c6f1f98ded95 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductScaleTailAttenuation.lean @@ -0,0 +1,191 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductScaleTagAttenuation +import OAI.Analysis.IrrationalRotation.Product.ProductScaleTailAssignment + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped BigOperators + +namespace Invariant233.ProductScaleLaws +variable {p : ProductScaleData} (hp : ProductScaleLaws p) +include hp + +theorem product_tail_conditional_attenuation + (e : ℕ ≃ Σ s, Fin (p.m s)) + (he : ∀ a : Σ s, Fin (p.m s), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) + (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθsum : Summable θ) + {Ω : Type*} (mx my : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} + [StandardBorelSpace Ω] (hmx : mx ≤ mΩ) (hmy : my ≤ mΩ) + (μ : Measure Ω) [IsFiniteMeasure μ] + (x y : Ω → ProductCocycle.Space ℕ) (hx : Measurable[mx] x) (hy : Measurable[my] y) + (hacx : μ.map x ≪ ProductCocycle.haar ℕ) (hacy : μ.map y ≪ ProductCocycle.haar ℕ) + (horder : ∀ᵐ ω ∂μ, ∀ i, + ProductCocycle.representative (x ω i) ≤ ProductCocycle.representative (y ω i)) + (top bottom : Bool → ℕ → Set Ω) + (htop : ∀ which i, MeasurableSet (top which i)) + (hbottom : ∀ which i, MeasurableSet (bottom which i)) + (hindTop : ∀ which, iCondIndepSet mx hmx (top which) μ) + (hindBottom : ∀ which, iCondIndepSet my hmy (bottom which) μ) + (j : ℕ) + (hb : ∀ i ∈ ProductPhases.consecutiveBlock p.m j, + θ i ∈ Icc (1 / p.N j) (2 / p.N j)) + (hsmall : ∀ s, j < s → ProductPhases.smallPhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.K s) (p.G s) θ) + (hlarge : ∀ s, j ≤ s → ProductPhases.largePhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.N s) θ) + (k : ℤ) (hk : (p.K j : ℝ) < |(k : ℝ)|) + (hlabels : ∀ s, j ≤ s → ∀ which : Bool, ∀ i ∈ ProductPhases.consecutiveBlock p.m s, + let u := 1 - Int.fract ((k : ℝ) * θ i) + u ∈ Icc (if which then p.b s else p.a s) + (1 - (if which then p.b s else p.a s)) → ∀ᵐ ω ∂μ, + (ProductCocycle.representative (x ω i) < u → ω ∈ top which i → u ≤ ProductCocycle.representative (y ω i)) ∧ + (u ≤ ProductCocycle.representative (y ω i) → ω ∈ bottom which i → ProductCocycle.representative (x ω i) < u) ∧ + (ProductCocycle.representative (x ω i) < u → + (ProductScaleData.kappa s * Real.sqrt ((if which then p.b s else p.a s) / (p.m s : ℝ))) / 10 ≤ + (μ[(top which i).indicator (fun _ => (1 : ℝ)) | mx]) ω) ∧ + (u ≤ ProductCocycle.representative (y ω i) → + (ProductScaleData.kappa s * Real.sqrt ((if which then p.b s else p.a s) / (p.m s : ℝ))) / 10 ≤ + (μ[(bottom which i).indicator (fun _ => (1 : ℝ)) | my]) ω)) + (E : Set Ω) (htag : ∀ᵐ ω ∂μ, ω ∈ E → ∃ i ∈ ProductPhases.consecutiveBlock p.m j, + ProductCocycle.representative (x ω i) < 1 / (p.m j : ℝ) ∧ + 1 - 1 / (p.m j : ℝ) ≤ ProductCocycle.representative (y ω i)) + : ∃ H₁ H₂ : Set Ω, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂μ, (μ[H₁.indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ Real.exp (-p.L j / 400)) ∧ + (∀ᵐ ω ∂μ, (μ[H₂.indicator (fun _ => (1 : ℝ)) | my]) ω ≤ Real.exp (-p.L j / 400)) ∧ + (∀ᵐ ω ∂μ, ω ∈ E → + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (y ω) / ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (x ω) ≤ + Real.exp (-p.L j) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + have hc : ∀ i, 0 ≤ p.C (e i).1 := by + intro i + rw [hp.C_eq] + exact (by norm_num : (0 : ℝ) ≤ 1).trans + ((hp.L_ge_one _).trans (le_max_left _ _)) + by_cases hnear : |(k : ℝ)| ≤ p.N j / 4 + · apply CrossingAvoidance.empty_exceptional_events mx my μ E + (fun ω => ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (y ω) / + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (x ω)) + (Real.exp (-p.L j)) (Real.exp (-p.L j / 400)) (Real.exp_pos _).le + exact (hp.ae_all_source_tagged_ratios e he θ hθ0 hθsum j hb μ x y + (hx.mono hmx le_rfl).aemeasurable (hy.mono hmy le_rfl).aemeasurable + hacx hacy horder E htag).mono (fun _ h hE => h hE k hk hnear) + · obtain ⟨s, w, I, hjs, hw, _hwidth, hIs, hI, hthreshold, hIntensity, hcost⟩ := + hp.exists_phase_tail_thresholds θ j hsmall hlarge k (le_of_not_ge hnear) + obtain ⟨which, rfl⟩ : ∃ which : Bool, w = if which then p.b s else p.a s := by + rcases hw with hw | ⟨_, hw⟩ + · exact ⟨true, by simpa using hw⟩ + · exact ⟨false, by simpa using hw⟩ + let w : ℝ := if which then p.b s else p.a s + let ρ : ℝ := ProductScaleData.kappa s * Real.sqrt (w / (p.m s : ℝ)) + have hρ : 0 ≤ ρ := mul_nonneg + (by unfold ProductScaleData.kappa; positivity) (Real.sqrt_nonneg _) + have hl : ∀ᵐ ω ∂μ, ∀ i ∈ I, + (ProductCocycle.representative (x ω i) < 1 - Int.fract ((k : ℝ) * θ i) → + ω ∈ top which i → 1 - Int.fract ((k : ℝ) * θ i) ≤ ProductCocycle.representative (y ω i)) ∧ + (1 - Int.fract ((k : ℝ) * θ i) ≤ ProductCocycle.representative (y ω i) → + ω ∈ bottom which i → ProductCocycle.representative (x ω i) < 1 - Int.fract ((k : ℝ) * θ i)) ∧ + (ProductCocycle.representative (x ω i) < 1 - Int.fract ((k : ℝ) * θ i) → + ρ / 10 ≤ (μ[(top which i).indicator (fun _ => (1 : ℝ)) | mx]) ω) ∧ + (1 - Int.fract ((k : ℝ) * θ i) ≤ ProductCocycle.representative (y ω i) → + ρ / 10 ≤ (μ[(bottom which i).indicator (fun _ => (1 : ℝ)) | my]) ω) := by + apply ae_all_iff.mpr + intro i + apply ae_all_iff.mpr + intro hi + exact hlabels s hjs which i (hIs hi) (hthreshold i hi) + have hcostI : ∀ i ∈ I, p.L j ≤ p.C (e i).1 := by + intro i hi + rw [ProductPhases.enumeration_block_of_mem p.m e he (hIs hi)] + exact hcost + obtain ⟨H₁, H₂, hm₁, hm₂, hb₁, hb₂, hr⟩ := + ProductCocycle.finite_conditional_attenuation_of_map_ac mx my hmx hmy μ + θ (fun i => p.C (e i).1) hθ0 hθsum hc k I x y hx hy hacx hacy + (top which) (bottom which) (htop which) (hbottom which) + (hindTop which) (hindBottom which) (p.m s) ρ (p.L j) hρ hIntensity hI hcostI + horder + (hl.mono (fun _ h i hi => (h i hi).1)) + (hl.mono (fun _ h i hi => (h i hi).2.1)) + (hl.mono (fun _ h i hi => (h i hi).2.2.1)) + (hl.mono (fun _ h i hi => (h i hi).2.2.2)) + exact ⟨H₁, H₂, hm₁, hm₂, hb₁, hb₂, hr.mono (fun _ h _ => h)⟩ + +theorem simultaneous_product_tail_conditional_attenuation + (e : ℕ ≃ Σ s, Fin (p.m s)) + (he : ∀ a : Σ s, Fin (p.m s), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) + (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθsum : Summable θ) + {Ω : Type*} (mx my : MeasurableSpace Ω) {mΩ : MeasurableSpace Ω} + [StandardBorelSpace Ω] (hmx : mx ≤ mΩ) (hmy : my ≤ mΩ) + (μ : Measure Ω) [IsFiniteMeasure μ] + (x y : Ω → ProductCocycle.Space ℕ) (hx : Measurable[mx] x) (hy : Measurable[my] y) + (hacx : μ.map x ≪ ProductCocycle.haar ℕ) (hacy : μ.map y ≪ ProductCocycle.haar ℕ) + (horder : ∀ᵐ ω ∂μ, ∀ i, + ProductCocycle.representative (x ω i) ≤ ProductCocycle.representative (y ω i)) + (top bottom : ℤ → Bool → ℕ → Set Ω) + (htop : ∀ k which i, MeasurableSet (top k which i)) + (hbottom : ∀ k which i, MeasurableSet (bottom k which i)) + (hindTop : ∀ k which, iCondIndepSet mx hmx (top k which) μ) + (hindBottom : ∀ k which, iCondIndepSet my hmy (bottom k which) μ) + (j : ℕ) + (hb : ∀ i ∈ ProductPhases.consecutiveBlock p.m j, + θ i ∈ Icc (1 / p.N j) (2 / p.N j)) + (hsmall : ∀ s, j < s → ProductPhases.smallPhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.K s) (p.G s) θ) + (hlarge : ∀ s, j ≤ s → ProductPhases.largePhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.N s) θ) + (hlabels : ∀ k : ℤ, ∀ s, j ≤ s → ∀ which : Bool, ∀ i ∈ ProductPhases.consecutiveBlock p.m s, + let u := 1 - Int.fract ((k : ℝ) * θ i) + u ∈ Icc (if which then p.b s else p.a s) + (1 - (if which then p.b s else p.a s)) → ∀ᵐ ω ∂μ, + (ProductCocycle.representative (x ω i) < u → ω ∈ top k which i → u ≤ ProductCocycle.representative (y ω i)) ∧ + (u ≤ ProductCocycle.representative (y ω i) → ω ∈ bottom k which i → ProductCocycle.representative (x ω i) < u) ∧ + (ProductCocycle.representative (x ω i) < u → + (ProductScaleData.kappa s * Real.sqrt ((if which then p.b s else p.a s) / (p.m s : ℝ))) / 10 ≤ + (μ[(top k which i).indicator (fun _ => (1 : ℝ)) | mx]) ω) ∧ + (u ≤ ProductCocycle.representative (y ω i) → + (ProductScaleData.kappa s * Real.sqrt ((if which then p.b s else p.a s) / (p.m s : ℝ))) / 10 ≤ + (μ[(bottom k which i).indicator (fun _ => (1 : ℝ)) | my]) ω)) + (E : Set Ω) (htag : ∀ᵐ ω ∂μ, ω ∈ E → ∃ i ∈ ProductPhases.consecutiveBlock p.m j, + ProductCocycle.representative (x ω i) < 1 / (p.m j : ℝ) ∧ + 1 - 1 / (p.m j : ℝ) ≤ ProductCocycle.representative (y ω i)) + : ∃ H₁ H₂ : ℤ → Set Ω, + (∀ k, MeasurableSet (H₁ k)) ∧ (∀ k, MeasurableSet (H₂ k)) ∧ + (∀ᵐ ω ∂μ, ∀ k : ℤ, (p.K j : ℝ) < |(k : ℝ)| → + (μ[(H₁ k).indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ Real.exp (-p.L j / 400) ∧ + (μ[(H₂ k).indicator (fun _ => (1 : ℝ)) | my]) ω ≤ Real.exp (-p.L j / 400) ∧ + (ω ∈ E → + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (y ω) / + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (x ω) ≤ + Real.exp (-p.L j) + (H₁ k).indicator (fun _ => (1 : ℝ)) ω + + (H₂ k).indicator (fun _ => (1 : ℝ)) ω)) := by + classical + let R : ℤ → Ω → ℝ := fun k ω => if (p.K j : ℝ) < |(k : ℝ)| then + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (y ω) / + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (x ω) else 0 + have hEach (k : ℤ) : ∃ H₁ H₂ : Set Ω, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂μ, (μ[H₁.indicator (fun _ => (1 : ℝ)) | mx]) ω ≤ Real.exp (-p.L j / 400)) ∧ + (∀ᵐ ω ∂μ, (μ[H₂.indicator (fun _ => (1 : ℝ)) | my]) ω ≤ Real.exp (-p.L j / 400)) ∧ + (∀ᵐ ω ∂μ, ω ∈ E → R k ω ≤ Real.exp (-p.L j) + + H₁.indicator (fun _ => (1 : ℝ)) ω + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + by_cases hk : (p.K j : ℝ) < |(k : ℝ)| + · simpa only [R, ite_eq_left hk] using hp.product_tail_conditional_attenuation + e he θ hθ0 hθsum mx my hmx hmy μ x y hx hy hacx hacy horder + (top k) (bottom k) (htop k) (hbottom k) (hindTop k) (hindBottom k) + j hb hsmall hlarge k hk (hlabels k) E htag + · apply CrossingAvoidance.empty_exceptional_events mx my μ E (R k) + (Real.exp (-p.L j)) (Real.exp (-p.L j / 400)) (Real.exp_pos _).le + exact Filter.Eventually.of_forall (fun _ _ => by + simpa only [R, ite_eq_right hk] using (Real.exp_pos (-p.L j)).le) + obtain ⟨H₁, H₂, hm₁, hm₂, h⟩ := CrossingAvoidance.simultaneous_exceptional_families + mx my μ E R (fun _ => Real.exp (-p.L j)) (fun _ => Real.exp (-p.L j / 400)) hEach + refine ⟨H₁, H₂, hm₁, hm₂, h.mono ?_⟩ + intro ω hω k hk + simpa only [R, ite_eq_left hk] using hω k + +end Invariant233.ProductScaleLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceAngleLaw.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceAngleLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..0eb90107ea8e937f351383d22ad91bd032e27f86 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceAngleLaw.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.IrrationalRotation.Sampling.ProductSamplingScaleTrimming + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped BigOperators Topology ENNReal + +namespace Invariant233.ProductScaleLaws +open ProductPhases InvariantProjection.IndependentAngles + +variable {p : ProductScaleData} (hp : ProductScaleLaws p) +include hp + +theorem source_coordinate_reciprocal (S : ℕ → ℝ) + (hblock : ∀ j, ∀ i ∈ consecutiveBlock p.m j, S i = (p.m j : ℝ) * p.K j) : + Summable (fun i => 1 / S i) ∧ + (∑' i, 1 / S i) = ∑' j, 1 / (p.K j : ℝ) := by + obtain ⟨e, he⟩ := exists_consecutiveBlocks_equiv p.m hp.m_pos + have hS (i : ℕ) : S i = (p.m (e i).1 : ℝ) * p.K (e i).1 := + hblock _ _ (mem_consecutiveBlock_enumeration p.m e he i) + simpa only [hS] using enumerated_block_reciprocal p.m hp.m_pos + (fun j => (p.K j : ℝ)) hp.real_K_pos hp.summable_reciprocal e + +theorem ae_source_angles (S : ℕ → ℝ) (hS : ∀ i, 0 < S i) + (hblock : ∀ j, ∀ i ∈ consecutiveBlock p.m j, S i = (p.m j : ℝ) * p.K j) : + ∀ᵐ θ ∂Measure.infinitePi (fun i => ProbabilityTheory.cond volume + (Icc (1 / S i) (2 / S i))), + (∀ j, ∀ i ∈ consecutiveBlock p.m j, + θ i ∈ Icc (1 / p.N j) (2 / p.N j)) ∧ + (∀ i, 0 < θ i ∧ θ i < 1) ∧ Summable θ ∧ + (∑' i, θ i) ≤ 1 / 25 ∧ ProductModel.JointlyRationallyIndependent θ := by + have hrec := hp.source_coordinate_reciprocal S hblock + filter_upwards [prescribedIntervals_ae_summable_independent S hS hrec.1] with θ hθ + have hb (j i : ℕ) (hi : i ∈ consecutiveBlock p.m j) : + θ i ∈ Icc (1 / p.N j) (2 / p.N j) := by + simpa only [hblock j i hi, ProductScaleData.N] using hθ.1 i + have hpos (i : ℕ) : 0 < θ i := + (one_div_pos.mpr (hS i)).trans_le (hθ.1 i).1 + have hsum : (∑' i, θ i) ≤ 1 / 25 := by + have ht := hθ.2.2.1 + rw [hrec.2] at ht + have hk := hp.reciprocal_sum_le + linarith + refine ⟨hb, ?_, hθ.2.1, hsum, hθ.2.2.2⟩ + intro i + refine ⟨hpos i, ?_⟩ + have hi : θ i ≤ ∑' k, θ k := + hθ.2.1.le_tsum i (fun k _ => (hpos k).le) + linarith + +theorem ae_source_horizon_angle_tail_le (S : ℕ → ℝ) (hS : ∀ i, 0 < S i) + (hblock : ∀ j, ∀ i ∈ consecutiveBlock p.m j, S i = (p.m j : ℝ) * p.K j) : + ∀ᵐ θ ∂Measure.infinitePi (fun i => ProbabilityTheory.cond volume + (Icc (1 / S i) (2 / S i))), + ∀ l t : ℕ, (t : ℝ) ≤ (p.m l : ℝ) ^ ((7 / 10 : ℝ) * p.m l) → + ENNReal.ofReal (t : ℝ) * + (∑' i : {i : ℕ // i ∉ Finset.range (p.prefixCount (l + 1))}, + ENNReal.ofReal (θ i)) ≤ + ENNReal.ofReal (4 * (p.m l : ℝ) ^ (-(p.m l : ℝ) / 20)) := by + filter_upwards [hp.ae_source_angles S hS hblock] with θ hθ + intro l t ht + exact ProductModel.TailTrimming.source_horizon_angle_tail_le hp θ + (fun i => (hθ.2.1 i).1.le) hθ.2.2.1 + (fun j i hi => (hθ.1 j i hi).2) l t ht + +theorem ae_source_horizon_angle_tail_tendsto_zero + (S : ℕ → ℝ) (hS : ∀ i, 0 < S i) + (hblock : ∀ j, ∀ i ∈ consecutiveBlock p.m j, S i = (p.m j : ℝ) * p.K j) : + ∀ᵐ θ ∂Measure.infinitePi (fun i => ProbabilityTheory.cond volume + (Icc (1 / S i) (2 / S i))), + ∀ M : ℕ → ℕ, + (∀ l, (M l : ℝ) ≤ (p.m l : ℝ) ^ ((7 / 10 : ℝ) * p.m l)) → + Tendsto (fun l => ENNReal.ofReal (M l : ℝ) * + ∑' i : {i : ℕ // i ∉ Finset.range (p.prefixCount (l + 1))}, + ENNReal.ofReal (θ i)) atTop (𝓝 0) := by + filter_upwards [hp.ae_source_angles S hS hblock] with θ hθ + intro M hM + exact ProductModel.TailTrimming.source_horizon_angle_tail_tendsto_zero hp θ + (fun i => (hθ.2.1 i).1.le) hθ.2.2.1 + (fun j i hi => (hθ.1 j i hi).2) M hM + +end Invariant233.ProductScaleLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceCircleAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceCircleAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..d11b8f7ccac99293b2edaa97bb5501f84501fa49 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceCircleAttenuation.lean @@ -0,0 +1,55 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductSourceCocycleAttenuation +import OAI.Analysis.IrrationalRotation.Product.ProductCircleConditioning + +namespace OAI + +noncomputable section +open MeasureTheory Set +namespace Invariant233.OrderedProductCoupling + +theorem source_finite_cocycle_conditional_attenuation_circle + (M : ℕ → ℕ) (a b : ℕ → ℝ) (hM : ∀ s, 100 ≤ M s) + (ha : ∀ s, 1 / (M s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (M s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (M s)) (tag : ℕ) + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) (k : ℤ) (I : Finset ℕ) (w : ℕ → ℝ) + (hwidth : ∀ i ∈ I, w i = a (e i).1 ∨ w i = b (e i).1) + (hthreshold : ∀ i ∈ I, + w i ≤ 1 - Int.fract ((k : ℝ) * θ i) ∧ + 1 - Int.fract ((k : ℝ) * θ i) ≤ 1 - w i) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) + (hI : m / 20 ≤ (I.card : ℝ)) + (hrho : ∀ i ∈ I, + ρ ≤ CouplingMarginalBounds.rho (sourceKappa (e i).1) (M (e i).1) (w i)) + (hcost : ∀ i ∈ I, L ≤ c i) : + let P := sourceBlocks M a b hM ha ha' hb hb' e tag + ∃ H₁ H₂ : Set Sample, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂law P, ((law P)[H₁.indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleLeftEndpoint inferInstance]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂law P, ((law P)[H₂.indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleRightEndpoint inferInstance]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂law P, + ProductCocycle.cocycleVersion θ c k (circleRightEndpoint ω) / + ProductCocycle.cocycleVersion θ c k (circleLeftEndpoint ω) ≤ + Real.exp (-L) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + let P := sourceBlocks M a b hM ha ha' hb hb' e tag + obtain ⟨H₁, H₂, hmeas₁, hmeas₂, hbound₁, hbound₂, hratio⟩ := + source_finite_cocycle_conditional_attenuation M a b hM ha ha' hb hb' e tag + θ c hθ0 hθ hc k I w hwidth hthreshold m ρ L hρ hL hI hrho hcost + refine ⟨H₁, H₂, hmeas₁, hmeas₂, ?_, ?_, hratio⟩ + · filter_upwards [hbound₁, left_condExp_eq_circle P (H₁.indicator (fun _ => (1 : ℝ)))] + with ω hω heq + rw [← heq] + exact hω + · filter_upwards [hbound₂, right_condExp_eq_circle P (H₂.indicator (fun _ => (1 : ℝ)))] + with ω hω heq + rw [← heq] + exact hω + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceCocycleAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceCocycleAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..089942a01b2f99ad379aab390a951a1b3013b41b --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceCocycleAttenuation.lean @@ -0,0 +1,57 @@ +import OAI.Analysis.IrrationalRotation.Model.SourceCouplingMarginals +import OAI.Analysis.IrrationalRotation.Couplings.BlockProductCoupling +import OAI.Analysis.IrrationalRotation.Couplings.ProductCouplingCocycleAttenuation + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.OrderedProductCoupling + +theorem sourceBlocks_energy_summable + (M : ℕ → ℕ) (a b : ℕ → ℝ) (hM : ∀ s, 100 ≤ M s) + (ha : ∀ s, 1 / (M s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (M s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (M s)) (tag : ℕ) : + Summable (energyBound (sourceBlocks M a b hM ha ha' hb hb' e tag)) := + (ofBlocks_energy_sum M sourceKappa a b sourceKappa_nonneg sourceKappa_le hM + ha ha' hb hb' e tag summable_sourceKappa_sq).1 + +theorem source_finite_cocycle_conditional_attenuation + (M : ℕ → ℕ) (a b : ℕ → ℝ) (hM : ∀ s, 100 ≤ M s) + (ha : ∀ s, 1 / (M s : ℝ) ≤ a s) (ha' : ∀ s, a s ≤ 1 / 4) + (hb : ∀ s, 1 / (M s : ℝ) ≤ b s) (hb' : ∀ s, b s ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (M s)) (tag : ℕ) + (θ c : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) + (hc : ∀ i, 0 ≤ c i) (k : ℤ) (I : Finset ℕ) (w : ℕ → ℝ) + (hwidth : ∀ i ∈ I, w i = a (e i).1 ∨ w i = b (e i).1) + (hthreshold : ∀ i ∈ I, + w i ≤ 1 - Int.fract ((k : ℝ) * θ i) ∧ + 1 - Int.fract ((k : ℝ) * θ i) ≤ 1 - w i) + (m ρ L : ℝ) (hρ : 0 ≤ ρ) (hL : L ≤ m * ρ) + (hI : m / 20 ≤ (I.card : ℝ)) + (hrho : ∀ i ∈ I, + ρ ≤ CouplingMarginalBounds.rho (sourceKappa (e i).1) (M (e i).1) (w i)) + (hcost : ∀ i ∈ I, L ≤ c i) : + let P := sourceBlocks M a b hM ha ha' hb hb' e tag + ∃ H₁ H₂ : Set Sample, MeasurableSet H₁ ∧ MeasurableSet H₂ ∧ + (∀ᵐ ω ∂law P, ((law P)[H₁.indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap leftEndpoint inferInstance]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂law P, ((law P)[H₂.indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap rightEndpoint inferInstance]) ω ≤ Real.exp (-L / 400)) ∧ + (∀ᵐ ω ∂law P, + ProductCocycle.cocycleVersion θ c k (circleRightEndpoint ω) / + ProductCocycle.cocycleVersion θ c k (circleLeftEndpoint ω) ≤ + Real.exp (-L) + H₁.indicator (fun _ => (1 : ℝ)) ω + + H₂.indicator (fun _ => (1 : ℝ)) ω) := by + exact finite_cocycle_conditional_attenuation + (sourceBlocks M a b hM ha ha' hb hb' e tag) + (sourceBlocks_energy_summable M a b hM ha ha' hb hb' e tag) + θ c hθ0 hθ hc k I w hwidth hthreshold m ρ L hρ hL hI hrho hcost + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceTagAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceTagAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..afc7430b7ce1eb6e24c641d3445ba013a54bccd8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductSourceTagAttenuation.lean @@ -0,0 +1,62 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalAttenuation +import OAI.Analysis.IrrationalRotation.Sampling.ProductStrictPhaseBounds + +namespace OAI + +noncomputable section +open MeasureTheory Function Set + +namespace Invariant233.ProductCocycle + +theorem ae_source_tagged_ratio_le_exp_of_map_ac + {ι Ω : Type*} [Countable ι] [MeasurableSpace Ω] + (μ : Measure Ω) (θ c : ι → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) + (hθ : Summable θ) (hc : ∀ i, 0 ≤ c i) + (x y : Ω → Space ι) (hx : AEMeasurable x μ) (hy : AEMeasurable y μ) + (hacx : μ.map x ≪ haar ι) (hacy : μ.map y ≪ haar ι) + (horder : ∀ᵐ ω ∂μ, ∀ i, representative (x ω i) ≤ representative (y ω i)) + (m K L : ℝ) (hm : 4 ≤ m) (hK : 0 < K) (k : ℤ) + (hklo : K < |(k : ℝ)|) (hkhi : |(k : ℝ)| ≤ m * K / 4) + (I : Finset ι) (hlo : ∀ i ∈ I, 1 / (m * K) ≤ θ i) + (hhi : ∀ i ∈ I, θ i ≤ 2 / (m * K)) (hcost : ∀ i ∈ I, L ≤ c i) + (E : Set Ω) (htag : ∀ᵐ ω ∂μ, ω ∈ E → ∃ i ∈ I, + representative (x ω i) < 1 / m ∧ 1 - 1 / m ≤ representative (y ω i)) : + ∀ᵐ ω ∂μ, ω ∈ E → + cocycleVersion θ c k (y ω) / cocycleVersion θ c k (x ω) ≤ Real.exp (-L) := by + filter_upwards [ae_all_int_ratio_bounds_of_map_ac μ θ c hθ0 hθ hc x y + hx hy hacx hacy horder, htag] with ω hr ht + intro hE + obtain ⟨i, hi, hxi, hyi⟩ := ht hE + have hcross := FloorCocycle.tagged_crossing_of_source_window k hm hK + (hlo i hi) (hhi i hi) hklo hkhi hxi hyi + exact ((hr k).2 i hcross).trans (Real.exp_le_exp.mpr (neg_le_neg (hcost i hi))) + +theorem ae_all_source_tagged_ratios_of_map_ac + {ι Ω : Type*} [Countable ι] [MeasurableSpace Ω] + (μ : Measure Ω) (θ c : ι → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) + (hθ : Summable θ) (hc : ∀ i, 0 ≤ c i) + (x y : Ω → Space ι) (hx : AEMeasurable x μ) (hy : AEMeasurable y μ) + (hacx : μ.map x ≪ haar ι) (hacy : μ.map y ≪ haar ι) + (horder : ∀ᵐ ω ∂μ, ∀ i, representative (x ω i) ≤ representative (y ω i)) + (m K L : ℝ) (hm : 4 ≤ m) (hK : 0 < K) + (I : Finset ι) (hlo : ∀ i ∈ I, 1 / (m * K) ≤ θ i) + (hhi : ∀ i ∈ I, θ i ≤ 2 / (m * K)) (hcost : ∀ i ∈ I, L ≤ c i) + (E : Set Ω) (htag : ∀ᵐ ω ∂μ, ω ∈ E → ∃ i ∈ I, + representative (x ω i) < 1 / m ∧ 1 - 1 / m ≤ representative (y ω i)) : + ∀ᵐ ω ∂μ, ω ∈ E → ∀ k : ℤ, + K < |(k : ℝ)| → |(k : ℝ)| ≤ m * K / 4 → + cocycleVersion θ c k (y ω) / cocycleVersion θ c k (x ω) ≤ Real.exp (-L) := by + filter_upwards [ae_all_int_ratio_bounds_of_map_ac μ θ c hθ0 hθ hc x y + hx hy hacx hacy horder, htag] with ω hr ht + intro hE + obtain ⟨i, hi, hxi, hyi⟩ := ht hE + intro k hklo hkhi + have hcross := FloorCocycle.tagged_crossing_of_source_window k hm hK + (hlo i hi) (hhi i hi) hklo hkhi hxi hyi + exact ((hr k).2 i hcross).trans (Real.exp_le_exp.mpr (neg_le_neg (hcost i hi))) + +end Invariant233.ProductCocycle + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductSupport.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..78b42f5fe5282aa5eeb63ce03362b89ccb552ab5 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductSupport.lean @@ -0,0 +1,26 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CocycleSupport +import OAI.Analysis.IrrationalRotation.Rotation.CircleRepresentative + +namespace OAI + +open MeasureTheory Set + +namespace Invariant233.CocycleSupport + +theorem ae_product_all_int_finite_floor_support {ι : Type*} [Countable ι] + (θ : ι → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθ : Summable θ) : + ∀ᵐ x ∂(Measure.infinitePi (fun _ : ι => (volume : Measure UnitAddCircle))), + ∀ k : ℤ, + (Function.support (fun i => + (⌊((AddCircle.equivIco (1 : ℝ) 0 (x i)) : ℝ) + (k : ℝ) * θ i⌋ : ℤ))).Finite := by + exact ae_all_int_finite_floor_support + (Ω := ι → UnitAddCircle) (ι := ι) + (Measure.infinitePi (fun _ : ι => (volume : Measure UnitAddCircle))) + (fun i x => ((AddCircle.equivIco (1 : ℝ) 0 (x i)) : ℝ)) + (fun i => (measurePreserving_productRepresentative i).measurable) + (fun i => (measurePreserving_productRepresentative i).map_eq) + θ hθ0 hθ + +end Invariant233.CocycleSupport + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductTailDensity.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTailDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..440637451a15f10d247101244e4de0227e6ab2da --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTailDensity.lean @@ -0,0 +1,68 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductTailDensity +import OAI.Analysis.IrrationalRotation.Couplings.BiasedTailDensity +import OAI.Analysis.IrrationalRotation.Product.ProductCoordinateSplit +import OAI.Analysis.IrrationalRotation.Analysis.DensityTransport + +namespace OAI + +noncomputable section +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal + +namespace Invariant233.ProductModel + +instance prefixMeasure_probability (D : ℕ) : IsProbabilityMeasure (prefixMeasure D) := by + unfold prefixMeasure + infer_instance + +instance tailMeasure_probability (D : ℕ) : IsProbabilityMeasure (tailMeasure D) := by + unfold tailMeasure + infer_instance + +theorem measurePreserving_splitCoordinates (D : ℕ) : + MeasurePreserving (splitCoordinates D) baseMeasure + ((prefixMeasure D).prod (tailMeasure D)) := + ProductCoordinateSplit.measurePreserving_split (fun _ : ℕ => circleMeasure) (fun i => i < D) + +theorem prefixTailDensity_spec (D : ℕ) {g : Base → ℝ} + (hg : MemLp g 2 baseMeasure) (hn : 0 ≤ᵐ[baseMeasure] g) + (hmass : ∫ x, g x ∂baseMeasure = 1) : + MemLp (prefixTailDensity D g) 2 (tailMeasure D) ∧ + 0 ≤ᵐ[tailMeasure D] prefixTailDensity D g ∧ + (∫ z, prefixTailDensity D g z ∂tailMeasure D) = 1 ∧ + eLpNorm (prefixTailDensity D g) 2 (tailMeasure D) ≤ eLpNorm g 2 baseMeasure ∧ + (baseMeasure.withDensity (fun x => ENNReal.ofReal (g x))).map (tailCoordinates D) = + (tailMeasure D).withDensity (fun z => ENNReal.ofReal (prefixTailDensity D g z)) := by + let e := splitCoordinates D + have he := measurePreserving_splitCoordinates D + have heinv : MeasurePreserving e.symm + ((prefixMeasure D).prod (tailMeasure D)) baseMeasure := he.symm e + have hgp : MemLp (g ∘ e.symm) 2 ((prefixMeasure D).prod (tailMeasure D)) := + hg.comp_measurePreserving heinv + have hgn : 0 ≤ᵐ[(prefixMeasure D).prod (tailMeasure D)] (g ∘ e.symm) := + heinv.quasiMeasurePreserving.ae hn + have hgm : (∫ p, (g ∘ e.symm) p ∂(prefixMeasure D).prod (tailMeasure D)) = 1 := by + exact (heinv.integral_comp e.symm.measurableEmbedding g).trans hmass + obtain ⟨hmem, hnonneg, hmean, hnorm, hmap⟩ := + BiasedTailDensity.tailDensity_spec hgp hgn hgm + have hnormeq : eLpNorm (g ∘ e.symm) 2 ((prefixMeasure D).prod (tailMeasure D)) = + eLpNorm g 2 baseMeasure := eLpNorm_comp_measurePreserving hg.aestronglyMeasurable heinv + refine ⟨hmem, hnonneg, hmean, hnorm.trans_eq hnormeq, ?_⟩ + have htransport := (DensityTransport.real_density_transport_ae e.measurable e.symm.measurable + he.map_eq (Eventually.of_forall e.symm_apply_apply) hg.aemeasurable).1 + have heq : tailCoordinates D = Prod.snd ∘ e := rfl + rw [heq, ← Measure.map_map measurable_snd e.measurable, htransport] + exact hmap + +theorem eLpNorm_prefixTailDensity_le (D : ℕ) {g : Base → ℝ} + (hg : MemLp g 2 baseMeasure) : + eLpNorm (prefixTailDensity D g) 2 (tailMeasure D) ≤ eLpNorm g 2 baseMeasure := by + have heinv := (measurePreserving_splitCoordinates D).symm (splitCoordinates D) + exact (BiasedTailDensity.eLpNorm_tailDensity_le (hg.comp_measurePreserving heinv)).trans_eq + (eLpNorm_comp_measurePreserving hg.aestronglyMeasurable heinv) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductTailScaleCover.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTailScaleCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..1cf44e6809835abd8c9be266cf7c948480cd8bd7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTailScaleCover.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.IrrationalRotation.Analysis.TailScaleCover +import OAI.Analysis.IrrationalRotation.Model.PhaseFailure + +namespace OAI + +noncomputable section +open Set + +namespace Invariant233.ProductPhases + +open TailScaleCover + +theorem exists_tail_thresholds + {ι : Type*} (J : ℕ → Finset ι) (K G κ L C : ℕ → ℝ) (θ : ι → ℝ) + (j : ℕ) + (hsize : ∀ s, j ≤ s → 100 ≤ (J s).card) + (hgrowth : ∀ s, j ≤ s → 2 ^ s ≤ (J s).card) + (hG : ∀ s, j ≤ s → 1 ≤ G s ∧ 4 * G s ≤ ((J s).card : ℝ)) + (hgap : ∀ s, j ≤ s → G (s + 1) * K (s + 1) < upperHorizon (J s).card) + (hL : ∀ s, j ≤ s → L j ≤ L s) + (hC : ∀ s, j ≤ s → L s ≤ C s) + (hlargeIntensity : ∀ s, j ≤ s → L s ≤ κ s * ((J s).card : ℝ) ^ (1 / 40 : ℝ)) + (hsmallIntensity : ∀ s, j ≤ s → L s ≤ κ (s + 1) * Real.sqrt (G (s + 1))) + (hsmall : ∀ s, j < s → smallPhaseCondition (J s) (K s) (G s) θ) + (hlarge : ∀ s, j ≤ s → largePhaseCondition (J s) (((J s).card : ℝ) * K s) θ) + (k : ℤ) (hk : ((J j).card : ℝ) * K j / 4 ≤ |(k : ℝ)|) : + ∃ (s : ℕ) (w : ℝ) (I : Finset ι), + j ≤ s ∧ (w = ((J s).card : ℝ) ^ (-(19 / 20 : ℝ)) ∨ + (j < s ∧ w = G s / (J s).card)) ∧ + w ∈ Set.Icc (1 / ((J s).card : ℝ)) (1 / 4) ∧ + I ⊆ J s ∧ ((J s).card : ℝ) / 20 ≤ I.card ∧ + (∀ i ∈ I, 1 - Int.fract ((k : ℝ) * θ i) ∈ Set.Icc w (1 - w)) ∧ + L j ≤ ((J s).card : ℝ) * CouplingMarginalBounds.rho (κ s) (J s).card w ∧ + L j ≤ C s := by + classical + have hunbounded (R : ℝ) : ∃ s, j ≤ s ∧ R ≤ upperHorizon (J s).card := by + obtain ⟨n, hn⟩ := exists_nat_gt R + let s := max j n + have hjs : j ≤ s := le_max_left _ _ + have hsm : s ≤ (J s).card := (Nat.lt_two_pow_self (n := s)).le.trans (hgrowth s hjs) + refine ⟨s, hjs, ?_⟩ + calc + R ≤ (n : ℝ) := hn.le + _ ≤ (s : ℝ) := by exact_mod_cast le_max_right j n + _ ≤ ((J s).card : ℝ) := by exact_mod_cast hsm + _ ≤ upperHorizon (J s).card := self_le_upperHorizon (by + have := hsize s hjs + omega) + obtain ⟨s, hjs, hs⟩ := exists_window (fun s => G s * K s) + (fun s => ((J s).card : ℝ) * K s / 4) (fun s => upperHorizon (J s).card) + j (fun s hs => (hgap s hs).le) hunbounded hk + have hm100 : (100 : ℝ) ≤ (J s).card := by exact_mod_cast hsize s hjs + have hm : (0 : ℝ) < (J s).card := by linarith + have hwidths := widths_mem_Icc (by linarith : (16 : ℝ) ≤ (J s).card) + (hG s hjs).1 (hG s hjs).2 + have hcost : L j ≤ C s := (hL s hjs).trans (hC s hjs) + rcases hs with hhigh | hlow + · let w : ℝ := ((J s).card : ℝ) ^ (-(19 / 20 : ℝ)) + have hcount : ((J s).card : ℝ) / 20 ≤ + (((J s).filter (fun i => + 1 - Int.fract ((k : ℝ) * θ i) ∈ Set.Icc w (1 - w))).card : ℝ) := by + simpa only [phaseGoodCount, w, neg_div] using + hlarge s hjs k hhigh.1 hhigh.2 + refine ⟨s, w, (J s).filter (fun i => + 1 - Int.fract ((k : ℝ) * θ i) ∈ Set.Icc w (1 - w)), + hjs, Or.inl rfl, hwidths.2, Finset.filter_subset _ _, + hcount, ?_, ?_, hcost⟩ + · intro i hi + exact (Finset.mem_filter.mp hi).2 + · rw [show w = ((J s).card : ℝ) ^ (-(19 / 20 : ℝ)) from rfl, + intensity_large _ _ hm] + exact (hL s hjs).trans (hlargeIntensity s hjs) + · refine ⟨s, G s / (J s).card, J s, hjs, Or.inr ⟨hlow.1, rfl⟩, + hwidths.1, Finset.Subset.refl _, ?_, + hsmall s hlow.1 k hlow.2.1 hlow.2.2, ?_, hcost⟩ + · linarith [hm.le] + · rw [intensity_small _ _ _ hm (by linarith [(hG s hjs).1])] + have hprev : j ≤ s - 1 := by omega + have hi := hsmallIntensity (s - 1) hprev + rw [Nat.sub_add_cancel (by omega : 1 ≤ s)] at hi + exact (hL (s - 1) hprev).trans hi + +end Invariant233.ProductPhases + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductTailTrimming.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTailTrimming.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e22fb5b4385a9c7f407c2b4ef6b2ff01c801ac7 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTailTrimming.lean @@ -0,0 +1,302 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductTailTrimming +import OAI.Analysis.IrrationalRotation.Model.ProductSampling +import OAI.Analysis.IrrationalRotation.Product.ProductCocycle +import Mathlib.Probability.Independence.InfinitePi +import Mathlib.Probability.Independence.Integration +import Mathlib.MeasureTheory.Measure.WithDensity + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal + +namespace Invariant233.ProductModel.TailTrimming + +theorem fract_add_eq_fract_add_fract (u t : ℝ) : + Int.fract (u + t) = Int.fract (u + Int.fract t) := by + conv_lhs => rw [← Int.floor_add_fract t] + rw [show u + ((⌊t⌋ : ℝ) + Int.fract t) = + (u + Int.fract t) + (⌊t⌋ : ℝ) by ring] + exact Int.fract_add_intCast _ _ + +theorem fract_add_lt_iff {u : ℝ} (hu : u ∈ Ico (0 : ℝ) 1) (t : ℝ) : + Int.fract (u + t) < u ↔ 1 - Int.fract t ≤ u := by + rw [fract_add_eq_fract_add_fract] + have hr0 := Int.fract_nonneg t + have hr1 := Int.fract_lt_one t + by_cases h : u + Int.fract t < 1 + · have hf : ⌊u + Int.fract t⌋ = (0 : ℤ) := + Int.floor_eq_zero_iff.mpr ⟨add_nonneg hu.1 hr0, h⟩ + rw [Int.fract, hf, Int.cast_zero, sub_zero] + constructor <;> intro hh <;> linarith + · have hf : ⌊u + Int.fract t⌋ = (1 : ℤ) := by + apply Int.floor_eq_iff.mpr + constructor <;> norm_num <;> linarith [hu.2] + rw [Int.fract, hf, Int.cast_one] + constructor <;> intro hh <;> linarith + +theorem uniform_wrap_measure (t : ℝ) : + (volume.restrict (Ico (0 : ℝ) 1)) {u : ℝ | Int.fract (u + t) < u} = + ENNReal.ofReal (Int.fract t) := by + have hm : MeasurableSet {u : ℝ | Int.fract (u + t) < u} := + measurableSet_lt ((measurable_id.add_const t).fract) measurable_id + rw [Measure.restrict_apply hm] + have heq : {u : ℝ | Int.fract (u + t) < u} ∩ Ico 0 1 = + Ico (1 - Int.fract t) 1 := by + ext u + constructor + · rintro ⟨h, hu⟩ + exact ⟨(fract_add_lt_iff hu t).mp h, hu.2⟩ + · rintro ⟨hl, hr⟩ + have hu : u ∈ Ico (0 : ℝ) 1 := + ⟨by linarith [Int.fract_lt_one t], hr⟩ + exact ⟨(fract_add_lt_iff hu t).mpr hl, hu⟩ + rw [heq, Real.volume_Ico] + congr 1 + ring + +theorem measurableSet_coordinateOrderFailure (θ : ℕ → ℝ) (n i : ℕ) : + MeasurableSet (coordinateOrderFailure θ n i) := by + have hr : Measurable circleRepresentative := + ProductCocycle.measurable_representative + exact measurableSet_lt + (hr.comp ((measurable_pi_apply i).add_const _)) + (hr.comp (measurable_pi_apply i)) + +theorem coordinateOrderFailure_measure (θ : ℕ → ℝ) (n i : ℕ) : + baseMeasure (coordinateOrderFailure θ n i) = + ENNReal.ofReal (Int.fract ((n : ℝ) * θ i)) := by + have hmp := CocycleSupport.measurePreserving_productRepresentative (ι := ℕ) i + have hm : MeasurableSet {u : ℝ | Int.fract (u + (n : ℝ) * θ i) < u} := + measurableSet_lt ((measurable_id.add_const _).fract) measurable_id + have heq : coordinateOrderFailure θ n i = + (fun x : Base => circleRepresentative (x i)) ⁻¹' + {u : ℝ | Int.fract (u + (n : ℝ) * θ i) < u} := by + ext x + simp only [coordinateOrderFailure, rotationIterate, Set.mem_ofPred_eq, + Int.cast_natCast, Set.mem_preimage] + exact Iff.of_eq (congrArg (fun r : ℝ => r < circleRepresentative (x i)) + (ProductCocycle.representative_add (x i) ((n : ℝ) * θ i))) + rw [heq] + change (Measure.infinitePi (fun _ : ℕ => (volume : Measure UnitAddCircle))) _ = _ + exact (hmp.measure_preimage hm.nullMeasurableSet).trans (uniform_wrap_measure _) + +theorem measurableSet_tailOrderFailure (I : Finset ℕ) (θ : ℕ → ℝ) (n : ℕ) : + MeasurableSet (tailOrderFailure I θ n) := + MeasurableSet.iUnion (fun i => measurableSet_coordinateOrderFailure θ n i) + +theorem tailOrderFailure_measure_le (I : Finset ℕ) (θ : ℕ → ℝ) (n : ℕ) : + baseMeasure (tailOrderFailure I θ n) ≤ + ∑' i : {i : ℕ // i ∉ I}, ENNReal.ofReal (Int.fract ((n : ℝ) * θ i)) := by + exact (measure_iUnion_le _).trans_eq + (tsum_congr (fun i => coordinateOrderFailure_measure θ n i)) + +theorem tailOrderFailure_measure_le_angles (I : Finset ℕ) (θ : ℕ → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (n : ℕ) : + baseMeasure (tailOrderFailure I θ n) ≤ + ∑' i : {i : ℕ // i ∉ I}, ENNReal.ofReal ((n : ℝ) * θ i) := by + refine (tailOrderFailure_measure_le I θ n).trans (ENNReal.tsum_le_tsum ?_) + intro i + apply ENNReal.ofReal_le_ofReal + have hf : (0 : ℤ) ≤ ⌊(n : ℝ) * θ i⌋ := + Int.floor_nonneg.mpr (mul_nonneg (Nat.cast_nonneg n) (hθ i)) + have hf' : (0 : ℝ) ≤ (⌊(n : ℝ) * θ i⌋ : ℝ) := by exact_mod_cast hf + rw [Int.fract] + linarith + +theorem indepFun_coordinate_restrictions (S T : Set ℕ) (hST : Disjoint S T) : + IndepFun (fun x : Base => fun i : S => x i) + (fun x : Base => fun i : T => x i) baseMeasure := by + have hi : iIndepFun (fun i (x : Base) => x i) baseMeasure := + iIndepFun_infinitePi (X := fun _ x => x) (fun _ => measurable_id) + have h := indep_iSup_of_disjoint + (fun i : ℕ => (measurable_pi_apply i : Measurable (fun x : Base => x i)).comap_le) + hi hST + change Indep (MeasurableSpace.comap (fun x : Base => fun i : S => x i) inferInstance) + (MeasurableSpace.comap (fun x : Base => fun i : T => x i) inferInstance) baseMeasure + simp_rw [MeasurableSpace.comap_process_pi] + simpa only [iSup_subtype] using h + +theorem withDensity_tail_event (I : Finset ℕ) + (w : (I → Circle) → ℝ≥0∞) (hw : Measurable w) + (B : Set ({i : ℕ // i ∉ I} → Circle)) (hB : MeasurableSet B) : + (baseMeasure.withDensity (fun x : Base => w (fun i : I => x i))) + ((fun x : Base => fun i : {i : ℕ // i ∉ I} => x i) ⁻¹' B) = + (baseMeasure.withDensity (fun x : Base => w (fun i : I => x i))) univ * + baseMeasure ((fun x : Base => fun i : {i : ℕ // i ∉ I} => x i) ⁻¹' B) := by + let P : Base → (I → Circle) := fun x i => x i + let Q : Base → ({i : ℕ // i ∉ I} → Circle) := fun x i => x i + have hP : Measurable P := by fun_prop + have hQ : Measurable Q := by fun_prop + have hpre : MeasurableSet (Q ⁻¹' B) := hQ hB + have hind : IndepFun P Q baseMeasure := + indepFun_coordinate_restrictions (I : Set ℕ) (I : Set ℕ)ᶜ disjoint_compl_right + have hind' := hind.comp hw (measurable_const.indicator hB : + Measurable (B.indicator (fun _ => (1 : ℝ≥0∞)))) + have hh := lintegral_mul_eq_lintegral_mul_lintegral_of_indepFun + (hw.comp hP) ((measurable_const.indicator hB).comp hQ) hind' + have heq : (fun x : Base => w (P x) * B.indicator (fun _ => (1 : ℝ≥0∞)) (Q x)) = + (Q ⁻¹' B).indicator (fun x => w (P x)) := by + funext x + by_cases hx : Q x ∈ B <;> simp [hx] + have heq1 : (fun x : Base => B.indicator (fun _ => (1 : ℝ≥0∞)) (Q x)) = + (Q ⁻¹' B).indicator (fun _ => (1 : ℝ≥0∞)) := by + funext x + by_cases hx : Q x ∈ B <;> simp [hx] + change (∫⁻ x, w (P x) * B.indicator (fun _ => (1 : ℝ≥0∞)) (Q x) ∂baseMeasure) = + (∫⁻ x, w (P x) ∂baseMeasure) * + (∫⁻ x, B.indicator (fun _ => (1 : ℝ≥0∞)) (Q x) ∂baseMeasure) at hh + rw [heq, heq1, lintegral_indicator hpre, lintegral_indicator_const hpre, one_mul] at hh + change (baseMeasure.withDensity (fun x => w (P x))) (Q ⁻¹' B) = + (baseMeasure.withDensity (fun x => w (P x))) univ * baseMeasure (Q ⁻¹' B) + simpa only [withDensity_apply _ hpre, + withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] using hh + +theorem weighted_tailOrderFailure_eq (I : Finset ℕ) (θ : ℕ → ℝ) (n : ℕ) + (w : (I → Circle) → ℝ≥0∞) (hw : Measurable w) : + (baseMeasure.withDensity (fun x : Base => w (fun i : I => x i))) + (tailOrderFailure I θ n) = + (baseMeasure.withDensity (fun x : Base => w (fun i : I => x i))) univ * + baseMeasure (tailOrderFailure I θ n) := by + let B : Set ({i : ℕ // i ∉ I} → Circle) := + ⋃ i : {i : ℕ // i ∉ I}, + {y | circleRepresentative (y i + ((n : ℝ) * θ i : ℝ)) < + circleRepresentative (y i)} + have hr : Measurable circleRepresentative := ProductCocycle.measurable_representative + have hB : MeasurableSet B := by + apply MeasurableSet.iUnion + intro i + exact measurableSet_lt (hr.comp ((measurable_pi_apply i).add_const _)) + (hr.comp (measurable_pi_apply i)) + have heq : tailOrderFailure I θ n = + (fun x : Base => fun i : {i : ℕ // i ∉ I} => x i) ⁻¹' B := by + ext x + simp only [tailOrderFailure, coordinateOrderFailure, B, rotationIterate, + mem_iUnion, mem_ofPred_eq, mem_preimage, Int.cast_natCast] + rw [heq] + exact withDensity_tail_event I w hw B hB + +theorem weighted_tailOrderFailure_le (I : Finset ℕ) (θ : ℕ → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (n : ℕ) + (w : (I → Circle) → ℝ≥0∞) (hw : Measurable w) : + (baseMeasure.withDensity (fun x : Base => w (fun i : I => x i))) + (tailOrderFailure I θ n) ≤ + (baseMeasure.withDensity (fun x : Base => w (fun i : I => x i))) univ * + (ENNReal.ofReal (n : ℝ) * ∑' i : {i : ℕ // i ∉ I}, ENNReal.ofReal (θ i)) := by + rw [weighted_tailOrderFailure_eq I θ n w hw] + apply mul_le_mul_right + convert tailOrderFailure_measure_le_angles I θ hθ n using 1 + simp_rw [ENNReal.ofReal_mul (Nat.cast_nonneg n), ENNReal.tsum_mul_left] + +theorem not_mem_tailOrderFailure_iff (I : Finset ℕ) (θ : ℕ → ℝ) (n : ℕ) (x : Base) : + x ∉ tailOrderFailure I θ n ↔ + ∀ i, i ∉ I → circleRepresentative (x i) ≤ + circleRepresentative (rotationIterate θ (n : ℤ) x i) := by + simp only [tailOrderFailure, coordinateOrderFailure, mem_iUnion, + mem_ofPred_eq, not_exists, not_lt, Subtype.forall] + +theorem measurable_orbitPairMap (θ : ℕ → ℝ) (n : ℕ) : + Measurable (orbitPairMap θ n) := by + apply measurable_id.prodMk + apply Measurable.of_eval + intro i + exact (measurable_pi_apply i).add_const _ + +theorem measurableSet_orderedPairEvent : MeasurableSet orderedPairEvent := by + have hr : Measurable circleRepresentative := ProductCocycle.measurable_representative + simp only [orderedPairEvent, Ordered, ofPred_forall] + apply MeasurableSet.iInter + intro i + exact measurableSet_le (hr.comp ((measurable_pi_apply i).comp measurable_fst)) + (hr.comp ((measurable_pi_apply i).comp measurable_snd)) + +theorem orbitPairMeasure_mass (θ : ℕ → ℝ) (n : ℕ) (w : Base → ℝ≥0∞) : + orbitPairMeasure θ n w univ = (baseMeasure.withDensity w) univ := by + rw [orbitPairMeasure, Measure.map_apply (measurable_orbitPairMap θ n) MeasurableSet.univ] + simp + +theorem orbitPairMeasure_unordered_le (I : Finset ℕ) (θ : ℕ → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (n : ℕ) + (w : (I → Circle) → ℝ≥0∞) (hw : Measurable w) + (hprefix : ∀ᵐ x ∂baseMeasure.withDensity (fun x : Base => w (fun i : I => x i)), + ∀ i ∈ I, circleRepresentative (x i) ≤ + circleRepresentative (rotationIterate θ (n : ℤ) x i)) : + orbitPairMeasure θ n (fun x : Base => w (fun i : I => x i)) orderedPairEventᶜ ≤ + orbitPairMeasure θ n (fun x : Base => w (fun i : I => x i)) univ * + (ENNReal.ofReal (n : ℝ) * ∑' i : {i : ℕ // i ∉ I}, ENNReal.ofReal (θ i)) := by + rw [orbitPairMeasure_mass] + refine le_trans ?_ (weighted_tailOrderFailure_le I θ hθ n w hw) + rw [orbitPairMeasure, Measure.map_apply (measurable_orbitPairMap θ n) + measurableSet_orderedPairEvent.compl] + apply measure_mono_ae + filter_upwards [hprefix] with x hx + intro hbad + by_contra htail + have ht := (not_mem_tailOrderFailure_iff I θ n x).mp htail + apply hbad + change Ordered x (rotationIterate θ (n : ℤ) x) + intro i + by_cases hi : i ∈ I + · exact hx i hi + · exact ht i hi + +theorem orbitAverageMeasure_unordered_le (I N : Finset ℕ) (θ : ℕ → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (M : ℕ) (hN : ∀ n ∈ N, n ≤ M) + (w : ℕ → (I → Circle) → ℝ≥0∞) (hw : ∀ n ∈ N, Measurable (w n)) + (hprefix : ∀ n ∈ N, + ∀ᵐ x ∂baseMeasure.withDensity (fun x : Base => w n (fun i : I => x i)), + ∀ i ∈ I, circleRepresentative (x i) ≤ + circleRepresentative (rotationIterate θ (n : ℤ) x i)) : + orbitAverageMeasure θ N (fun n x => w n (fun i : I => x i)) orderedPairEventᶜ ≤ + orbitAverageMeasure θ N (fun n x => w n (fun i : I => x i)) univ * + (ENNReal.ofReal (M : ℝ) * ∑' i : {i : ℕ // i ∉ I}, ENNReal.ofReal (θ i)) := by + let B : ℝ≥0∞ := ENNReal.ofReal (M : ℝ) * + ∑' i : {i : ℕ // i ∉ I}, ENNReal.ofReal (θ i) + have hbound (n : ℕ) (hn : n ∈ N) : + orbitPairMeasure θ n (fun x : Base => w n (fun i : I => x i)) orderedPairEventᶜ ≤ + orbitPairMeasure θ n (fun x : Base => w n (fun i : I => x i)) univ * B := by + refine (orbitPairMeasure_unordered_le I θ hθ n (w n) (hw n hn) (hprefix n hn)).trans ?_ + apply mul_le_mul_right + apply mul_le_mul_left + exact ENNReal.ofReal_le_ofReal (by exact_mod_cast hN n hn) + change orbitAverageMeasure θ N (fun n x => w n (fun i : I => x i)) orderedPairEventᶜ ≤ + orbitAverageMeasure θ N (fun n x => w n (fun i : I => x i)) univ * B + simp only [orbitAverageMeasure, Measure.smul_apply, smul_eq_mul, Measure.finsetSum_apply] + rw [mul_assoc, Finset.sum_mul] + apply mul_le_mul_right + exact Finset.sum_le_sum hbound + +theorem trimmed_orbitAverage_supported (θ : ℕ → ℝ) (N : Finset ℕ) + (hN : ∀ n ∈ N, 0 < n) (w : ℕ → Base → ℝ≥0∞) : + SupportedOnPositiveOrderedOrbitPairs θ + ((orbitAverageMeasure θ N w).restrict orderedPairEvent) := by + refine ⟨N, hN, ?_⟩ + have hm : MeasurableSet {xy : Base × Base | + ∃ n ∈ N, xy.2 = rotationIterate θ (n : ℤ) xy.1} := by + simp only [ofPred_exists] + apply MeasurableSet.iUnion + intro n + by_cases hn : n ∈ N + · simp only [hn, true_and] + apply measurableSet_eq_fun measurable_snd + apply Measurable.of_eval + intro i + exact ((measurable_pi_apply i).comp measurable_fst).add_const _ + · simp only [hn, false_and, ofPred_false, MeasurableSet.empty] + have hgraph : ∀ᵐ xy ∂orbitAverageMeasure θ N w, + ∃ n ∈ N, xy.2 = rotationIterate θ (n : ℤ) xy.1 := by + apply Measure.ae_smul_measure + apply ae_finsetSum_measure_iff.mpr + intro n hn + apply (ae_map_iff (measurable_orbitPairMap θ n).aemeasurable hm).mpr + exact Filter.Eventually.of_forall (fun _ => ⟨n, hn, rfl⟩) + filter_upwards [ae_restrict_mem measurableSet_orderedPairEvent, + ae_restrict_of_ae hgraph] with xy horder hgraph + exact ⟨horder, hgraph⟩ + +end Invariant233.ProductModel.TailTrimming + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductTestedExpectationSummability.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTestedExpectationSummability.lean new file mode 100644 index 0000000000000000000000000000000000000000..623c7ab39fdd366fc3cc9fa9683b2d5ae4214f6d --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTestedExpectationSummability.lean @@ -0,0 +1,96 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductTestedKernelMoments +import OAI.Analysis.IrrationalRotation.Sampling.ProductSamplingAsymptotics + +namespace OAI + +noncomputable section +open MeasureTheory Set Filter + +namespace Invariant233.ProductSamplingPhaseMoments + +def testedExpectedError {κ : Type*} [Fintype κ] (m : ℕ) + (N₀ : κ → ℝ) (powers : Finset ℕ) (selected : κ → Bool) + (endpoint : Bool) (a b c d : κ → ℝ) : ℝ := + let u := fun i => testedKernel m (selected i) endpoint (a i) (b i) (c i) (d i) + ∫ θ, ∫ x, ((powers.card : ℝ)⁻¹ * + (∑ n ∈ powers, ∏ i, u i (x i) (Int.fract ((n : ℝ) * θ i))) - + ∏ i, mean (u i) (x i))^2 + ∂Measure.pi (fun _ : κ => unitInterval) + ∂Measure.pi (fun i => UniformIntervalPhase.lambdaLaw (N₀ i)) + +theorem testedExpectedError_nonneg {κ : Type*} [Fintype κ] (m : ℕ) + (N₀ : κ → ℝ) (powers : Finset ℕ) (selected : κ → Bool) + (endpoint : Bool) (a b c d : κ → ℝ) : + 0 ≤ testedExpectedError m N₀ powers selected endpoint a b c d := by + apply integral_nonneg + intro θ + apply integral_nonneg + intro x + exact sq_nonneg _ + +theorem testedExpectedError_le_majorant {κ : Type*} [Fintype κ] + {p : ProductScaleData} (hp : ProductScaleLaws p) {j : ℕ} (hm : 200 ≤ p.m j) + (N₀ : κ → ℝ) (hN : ∀ i, 0 < N₀ i) (hNle : ∀ i, N₀ i ≤ p.N j) + (powers : Finset ℕ) (hs : ProductSamplingPowersAt p j powers) + (selected : κ → Bool) (endpoint : Bool) (a b c d : κ → ℝ) + (hd : (Fintype.card κ : ℝ) ≤ (101 / 100 : ℝ) * p.m j) + (hlog : 8 * Real.log (p.m j) ≤ (p.m j : ℝ)^(1 / 25 : ℝ)) : + testedExpectedError (p.m j) N₀ powers selected endpoint a b c d ≤ + ((303 / 100 : ℝ) * 8 * Real.exp ((101 / 50 : ℝ) * 8)) * + (p.m j : ℝ)^(-39 : ℝ) + (p.m j : ℝ)^(-(p.m j : ℝ) / 25) := by + have hm1 : (1 : ℝ) ≤ p.m j := by exact_mod_cast (show 1 ≤ p.m j by omega) + have hm0 : (0 : ℝ) ≤ p.m j := Nat.cast_nonneg _ + have hbase : 1 + 4 * (p.m j : ℝ)^(-6 / 5 : ℝ) + (p.m j : ℝ)^(-50 : ℝ) ≤ + 1 + 8 * (p.m j : ℝ)^(-6 / 5 : ℝ) + 8 * (p.m j : ℝ)^(-50 : ℝ) := by + nlinarith [Real.rpow_nonneg hm0 (-6 / 5 : ℝ), Real.rpow_nonneg hm0 (-50 : ℝ)] + have hsmall : (p.m j : ℝ)^(-50 : ℝ) ≤ 8 * (p.m j : ℝ)^(-50 : ℝ) := by + nlinarith [Real.rpow_nonneg hm0 (-50 : ℝ)] + have hoff := ProductSampling.exact_moment_error_le (d := Fintype.card κ) + hm1 (show (0 : ℝ) ≤ 8 by norm_num) hd + have hdiag := ProductSampling.diagonal_sampling_ratio_le hm1 + (show (0 : ℝ) ≤ 8 by norm_num) hlog hd hs.cardinality + have hraw := tested_expected_average_error_le hp hm N₀ hN hNle powers hs + selected endpoint a b c d + apply hraw.trans + calc + _ ≤ (p.m j : ℝ)^(-(p.m j : ℝ) / 25) + + 3 * ((Fintype.card κ : ℝ) * (8 * (p.m j : ℝ)^(-50 : ℝ)) * + (1 + 8 * (p.m j : ℝ)^(-6 / 5 : ℝ) + + 8 * (p.m j : ℝ)^(-50 : ℝ))^(Fintype.card κ - 1)) := by + apply add_le_add hdiag + gcongr + _ ≤ _ := by + simpa only [add_comm] using + (add_le_add_left hoff ((p.m j : ℝ)^(-(p.m j : ℝ) / 25))) + +theorem testedExpectedError_summable {p : ProductScaleData} + (hp : ProductScaleLaws p) (powers : ℕ → Finset ℕ) + (hs : ∀ᶠ j in atTop, ProductSamplingPowersAt p j (powers j)) + (N₀ : (j : ℕ) → Fin (p.prefixCount (j + 1)) → ℝ) + (hN : ∀ j i, 0 < N₀ j i) (hNle : ∀ j i, N₀ j i ≤ p.N j) + (selected : (j : ℕ) → Fin (p.prefixCount (j + 1)) → Bool) + (endpoint : Bool) + (a b c d : (j : ℕ) → Fin (p.prefixCount (j + 1)) → ℝ) : + Summable (fun j => testedExpectedError (p.m j) (N₀ j) (powers j) + (selected j) endpoint (a j) (b j) (c j) (d j)) := by + have hgrowth : ∀ j, (2 : ℝ)^j ≤ (p.m j : ℝ) := by + intro j + exact_mod_cast hp.m_ge_pow_self j + have hmTop : Tendsto (fun j => (p.m j : ℝ)) atTop atTop := + tendsto_atTop_mono hgrowth (tendsto_pow_atTop_atTop_of_one_lt (by norm_num)) + have hlogs := hmTop.eventually (ProductSampling.eventually_const_log_le_rpow 8 + (by norm_num : (0 : ℝ) < 1 / 25)) + apply (ProductSampling.sampling_error_majorant_summable hgrowth + ((303 / 100 : ℝ) * 8 * Real.exp ((101 / 50 : ℝ) * 8))).of_norm_bounded_eventually_nat + filter_upwards [hs, hlogs, hmTop.eventually_ge_atTop 200] with j hsj hlog hm + rw [Real.norm_of_nonneg (testedExpectedError_nonneg _ _ _ _ _ _ _ _ _)] + apply testedExpectedError_le_majorant hp (by exact_mod_cast hm) + (N₀ j) (hN j) (hNle j) (powers j) hsj (selected j) endpoint (a j) (b j) (c j) (d j) + · simpa only [Fintype.card_fin] using hp.prefix_count_succ_le j + · exact hlog + +end Invariant233.ProductSamplingPhaseMoments + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductTestedKernelMoments.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTestedKernelMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..13985b8e81bccfed2a846d4bf46ee88952c96cae --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTestedKernelMoments.lean @@ -0,0 +1,175 @@ +import OAI.Analysis.IrrationalRotation.Sampling.ProductSamplingNumericalBudget +import OAI.Analysis.IrrationalRotation.Analysis.TestedKernelUnifiedMoments +import OAI.Analysis.IrrationalRotation.Sampling.ScalarSamplingTestVariation +import OAI.Analysis.IrrationalRotation.Analysis.TestedTriangularVariation + +namespace OAI + +noncomputable section +open MeasureTheory Set + +namespace Invariant233.ProductSamplingPhaseMoments +open Invariant233.ScalarSampling + +def testedKernel (m : ℕ) (selected endpoint : Bool) (a b c d : ℝ) : ℝ → ℝ → ℝ := + if endpoint then + if selected then TestedTriangular.secondKernel (Ico a b) (Ico c d) + else TestedSampling.secondKernel m (Ico a b) (Ico c d) + else + if selected then TestedTriangular.firstKernel (Ico a b) (Ico c d) + else TestedSampling.firstKernel m (Ico a b) (Ico c d) + +@[fun_prop] theorem testedKernel_measurable (m : ℕ) (selected endpoint : Bool) + (a b c d : ℝ) : Measurable (Function.uncurry (testedKernel m selected endpoint a b c d)) := by + have hfirst : Measurable (Function.uncurry (TestedSampling.firstKernel m (Ico a b) (Ico c d))) := + ((measurable_circleKernel _ _).mul + ((measurable_const.indicator measurableSet_Ico).comp measurable_fst)).mul + ((measurable_const.indicator measurableSet_Ico).comp + (measurable_fract.comp (measurable_fst.add measurable_snd))) + have hsecond : Measurable (Function.uncurry (TestedSampling.secondKernel m (Ico a b) (Ico c d))) := + ((measurable_circleEndpoint_pair _ _).mul + ((measurable_const.indicator measurableSet_Ico).comp + (measurable_fract.comp (measurable_fst.sub measurable_snd)))).mul + ((measurable_const.indicator measurableSet_Ico).comp measurable_fst) + cases selected <;> cases endpoint <;> simp only [testedKernel, Bool.false_eq_true, ite_false, ite_true] + · exact hfirst + · exact hsecond + · exact TestedTriangular.firstKernel_measurable measurableSet_Ico measurableSet_Ico + · exact TestedTriangular.secondKernel_measurable measurableSet_Ico measurableSet_Ico + +theorem testedKernel_bounds {m : ℕ} (hm : 200 ≤ m) (selected endpoint : Bool) + (a b c d s t : ℝ) : + 0 ≤ testedKernel m selected endpoint a b c d s t ∧ + |testedKernel m selected endpoint a b c d s t| ≤ (m : ℝ)^(13 / 5 : ℝ) := by + obtain ⟨hh, _, hα, _⟩ := manuscript_parameters hm + have hheight : 1 ≤ (m : ℝ)^(13 / 5 : ℝ) := + Real.one_le_rpow (by exact_mod_cast (show 1 ≤ m by omega)) (by norm_num) + have hb (s t : ℝ) : 0 ≤ manuscriptKernel m s t ∧ + manuscriptKernel m s t ≤ (m : ℝ)^(13 / 5 : ℝ) := by + simpa only [manuscript_reciprocal_height hm, manuscriptKernel, circleKernel] using + (rawKernel_height hh hα : 0 ≤ manuscriptKernel m s t ∧ + manuscriptKernel m s t ≤ ((m : ℝ)^(-(3 / 5 : ℝ)) * (1 / (m : ℝ)^2))⁻¹) + cases selected <;> cases endpoint <;> simp only [testedKernel, Bool.false_eq_true, ite_false, ite_true] + · by_cases hs : s ∈ Ico a b <;> by_cases ht : Int.fract (s+t) ∈ Ico c d <;> + simp [TestedSampling.firstKernel, hs, ht, (hb s t).1, abs_of_nonneg (hb s t).1, + (hb s t).2, hheight.trans' zero_le_one] + · by_cases hs : Int.fract (s-t) ∈ Ico a b <;> by_cases ht : s ∈ Ico c d <;> + simp [TestedSampling.secondKernel, manuscriptEndpointKernel, hs, ht, (hb (s-t) t).1, + abs_of_nonneg (hb (s-t) t).1, (hb (s-t) t).2, hheight.trans' zero_le_one] + · have h := TestedTriangular.firstKernel_bounds (Ico a b) (Ico c d) s t + exact ⟨h.1, by rw [abs_of_nonneg h.1]; exact h.2.trans ((TestedTriangular.triangularKernel_bounds s t).2.trans hheight)⟩ + · have h := TestedTriangular.secondKernel_bounds (Ico a b) (Ico c d) s t + exact ⟨h.1, by rw [abs_of_nonneg h.1]; exact h.2.trans ((TestedTriangular.triangularKernel_bounds (Int.fract (s-t)) t).2.trans hheight)⟩ + +theorem realBVSize_le_of_global {f : ℝ → ℝ} {C V : ℝ} + (hf : ∀ t, |f t| ≤ C) + (hsize : sSup (Set.range (fun t => |f t|)) + + (eVariationOn f (Icc (0 : ℝ) 1)).toReal ≤ V) : realBVSize f ≤ V := by + have hsup : sSup ((fun t => |f t|) '' Icc (0 : ℝ) 1) ≤ + sSup (Set.range (fun t => |f t|)) := by + apply csSup_le ((nonempty_Icc.mpr zero_le_one).image _) + rintro _ ⟨t, _, rfl⟩ + exact le_csSup ⟨C, by rintro _ ⟨t, rfl⟩; exact hf t⟩ ⟨t, rfl⟩ + dsimp only [realBVSize] + linarith + +theorem testedKernel_BV_bound {m : ℕ} (hm : 200 ≤ m) (selected endpoint : Bool) + (a b c d : ℝ) {s : ℝ} (hs : s ∈ Ico (0 : ℝ) 1) : + BoundedVariationOn (testedKernel m selected endpoint a b c d s) (Icc (0 : ℝ) 1) ∧ + realBVSize (testedKernel m selected endpoint a b c d s) ≤ 16 * (m : ℝ)^10 := by + have hbound := fun t => (testedKernel_bounds hm selected endpoint a b c d s t).2 + have hheight : 1 ≤ (m : ℝ)^10 := one_le_pow₀ (by exact_mod_cast (show 1 ≤ m by omega)) + cases selected + · have h := tested_manuscript_oriented_BV_bound_ten hm hs endpoint a b c d + have heq : testedKernel m false endpoint a b c d s = + fun t => if endpoint then manuscriptEndpointKernel m s t * + (Ico a b).indicator (fun _ => 1) (Int.fract (s-t)) * + (Ico c d).indicator (fun _ => 1) s + else manuscriptKernel m s t * (Ico a b).indicator (fun _ => 1) s * + (Ico c d).indicator (fun _ => 1) (Int.fract (s+t)) := by + cases endpoint <;> rfl + rw [heq] + refine ⟨h.1, ?_⟩ + apply (realBVSize_le_of_global (by simpa only [heq] using hbound) h.2).trans + nlinarith [pow_nonneg (Nat.cast_nonneg m : (0 : ℝ) ≤ m) 10] + · cases endpoint + · have h := TestedTriangular.firstKernel_interval_BV_bound (Ico a b) c d hs + refine ⟨h.1, ?_⟩ + exact (realBVSize_le_of_global hbound h.2).trans (by nlinarith) + · have h := TestedTriangular.secondKernel_interval_BV_bound (Ico c d) a b hs + refine ⟨h.1, ?_⟩ + exact (realBVSize_le_of_global hbound h.2).trans (by nlinarith) + +theorem testedKernel_momentBounds {m : ℕ} (hm : 200 ≤ m) (selected endpoint : Bool) + (a b c d : ℝ) : TestedSampling.MomentBounds m (testedKernel m selected endpoint a b c d) := by + cases selected <;> cases endpoint <;> simp only [testedKernel, Bool.false_eq_true, ite_false, ite_true] + · exact TestedSampling.firstKernel_moment_bounds hm measurableSet_Ico measurableSet_Ico + · exact TestedSampling.secondKernel_moment_bounds hm measurableSet_Ico measurableSet_Ico + · exact TestedSampling.firstTriangular_moment_bounds hm measurableSet_Ico measurableSet_Ico + · exact TestedSampling.secondTriangular_moment_bounds hm measurableSet_Ico measurableSet_Ico + +theorem testedKernel_square_moment_bound {m : ℕ} (hm : 200 ≤ m) + (selected endpoint : Bool) (a b c d : ℝ) : + (∫ s, ∫ t, (testedKernel m selected endpoint a b c d s t)^2 + ∂unitInterval ∂unitInterval) ≤ + (2 / (m : ℝ)^(-(3 / 5 : ℝ))) * Real.log ((m : ℝ)^2 / 2) := by + have hi : IntegrableOn (fun p : ℝ × ℝ => + (testedKernel m selected endpoint a b c d p.1 p.2)^2) + (uIoc (0 : ℝ) 1 ×ˢ uIoc (0 : ℝ) 1) := by + apply integrableOn_unitSquare_of_bound + (F := fun s t => (testedKernel m selected endpoint a b c d s t)^2) + (C := ((m : ℝ)^(13 / 5 : ℝ))^2) + ((testedKernel_measurable m selected endpoint a b c d).pow_const 2) + intro s t + rw [norm_pow, Real.norm_eq_abs] + exact pow_le_pow_left₀ (abs_nonneg _) + (testedKernel_bounds hm selected endpoint a b c d s t).2 2 + simp_rw [integral_unitInterval] + rw [intervalIntegral_intervalIntegral_swap + (F := fun s t => (testedKernel m selected endpoint a b c d s t)^2) hi] + exact (testedKernel_momentBounds hm selected endpoint a b c d).2.2.2.2.2 + +theorem tested_expected_average_error_le {κ : Type*} [Fintype κ] + {p : ProductScaleData} (hp : ProductScaleLaws p) {j : ℕ} (hm : 200 ≤ p.m j) + (N₀ : κ → ℝ) (hN : ∀ i, 0 < N₀ i) (hNle : ∀ i, N₀ i ≤ p.N j) + (powers : Finset ℕ) (hs : ProductSamplingPowersAt p j powers) + (selected : κ → Bool) (endpoint : Bool) (a b c d : κ → ℝ) : + let u := fun i => testedKernel (p.m j) (selected i) endpoint (a i) (b i) (c i) (d i) + (∫ θ, ∫ x, ((powers.card : ℝ)⁻¹ * + (∑ n ∈ powers, ∏ i, u i (x i) (Int.fract ((n : ℝ) * θ i))) - + ∏ i, mean (u i) (x i))^2 + ∂Measure.pi (fun _ : κ => unitInterval) + ∂Measure.pi (fun i => UniformIntervalPhase.lambdaLaw (N₀ i))) ≤ + (8 * (p.m j : ℝ)^(3 / 5 : ℝ) * Real.log (p.m j))^Fintype.card κ / + (powers.card : ℝ) + + 3 * ((Fintype.card κ : ℝ) * (p.m j : ℝ)^(-50 : ℝ) * + (1 + 4 * (p.m j : ℝ)^(-6 / 5 : ℝ) + + (p.m j : ℝ)^(-50 : ℝ))^(Fintype.card κ - 1)) := by + dsimp only + let u := fun i => testedKernel (p.m j) (selected i) endpoint (a i) (b i) (c i) (d i) + have h := expected_average_error_le_source_scale hp hm N₀ hN hNle powers hs u + (fun _ => (p.m j : ℝ)^(13 / 5 : ℝ)) + (fun i => testedKernel_measurable _ _ _ _ _ _ _) + (fun i s t => (testedKernel_bounds hm _ _ _ _ _ _ s t).2) + (fun i s t => (testedKernel_bounds hm _ _ _ _ _ _ s t).1) + (fun i s => by + simpa only [mean, integral_unitInterval] using + ((testedKernel_momentBounds hm (selected i) endpoint (a i) (b i) (c i) (d i)).2.2.1 s).2) + (fun i s hs => (testedKernel_BV_bound hm _ _ _ _ _ _ hs).1) + (fun i s hs => (testedKernel_BV_bound hm _ _ _ _ _ _ hs).2) + (fun i => by + simpa only [mean, integral_unitInterval] using + (testedKernel_momentBounds hm (selected i) endpoint (a i) (b i) (c i) (d i)).2.2.2.1.2) + (fun i => testedKernel_square_moment_bound hm (selected i) endpoint (a i) (b i) (c i) (d i)) + apply h.trans + apply add_le_add_left + apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg powers.card) + apply pow_le_pow_left₀ _ (ScalarSampling.twice_kernel_square_mass_le hm) + have hraw := TestedSampling.half_le_common_square_bound hm + linarith + +end Invariant233.ProductSamplingPhaseMoments + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductThresholdIndependence.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductThresholdIndependence.lean new file mode 100644 index 0000000000000000000000000000000000000000..e26890121e78f7de2cc5a6e32af9a69acd27f60a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductThresholdIndependence.lean @@ -0,0 +1,35 @@ +import OAI.Analysis.IrrationalRotation.Couplings.ConditionalDistributionEvents +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalKernels + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set + +namespace Invariant233.OrderedProductCoupling + +theorem right_thresholds_iCondIndepSet_via_events (P : Parameters) (u : ℕ → ℝ) : + iCondIndepSet (MeasurableSpace.comap leftEndpoint inferInstance) + leftEndpoint_measurable.comap_le + (fun i => {ω : Sample | u i ≤ rightEndpoint ω i}) (law P) := by + exact ConditionalDistributionEvents.iCondIndepSet_coordinate_preimage_of_condDistrib + (law P) leftEndpoint rightEndpoint leftEndpoint_measurable rightEndpoint_measurable + (fun i (y : Endpoint) => y i) (fun i => measurable_pi_apply i) + (fun i => Ici (u i)) (fun _ => measurableSet_Ici) + (right_coordinates_conditionally_independent P) + +theorem left_thresholds_iCondIndepSet_via_events (P : Parameters) (u : ℕ → ℝ) : + iCondIndepSet (MeasurableSpace.comap rightEndpoint inferInstance) + rightEndpoint_measurable.comap_le + (fun i => {ω : Sample | leftEndpoint ω i < u i}) (law P) := by + exact ConditionalDistributionEvents.iCondIndepSet_coordinate_preimage_of_condDistrib + (law P) rightEndpoint leftEndpoint rightEndpoint_measurable leftEndpoint_measurable + (fun i (x : Endpoint) => x i) (fun i => measurable_pi_apply i) + (fun i => Iio (u i)) (fun _ => measurableSet_Iio) + (left_coordinates_conditionally_independent P) + +end Invariant233.OrderedProductCoupling + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductTraceNormality.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTraceNormality.lean new file mode 100644 index 0000000000000000000000000000000000000000..84fa99da459034fbd7655293b39506fd71bf2a77 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTraceNormality.lean @@ -0,0 +1,58 @@ +import OAI.Analysis.IrrationalRotation.Operators.VectorTraceNormality +import OAI.Analysis.IrrationalRotation.Spectral.ProductTracialSpectral + +namespace OAI + +noncomputable section +open scoped ENNReal + +namespace Invariant233.ProductModel + +theorem traceVectorTracialState_normal (θ : ℕ → ℝ) : + IsNormalFaithfulTracialState (factor θ) + (traceVector_faithfulTracial θ).toTracialState := + (traceVector_faithfulTracial θ).toTracialState_normal + +theorem exists_normalTracialState_weightedOperator_spectral_bundle + (θ c : ℕ → ℝ) (hθ01 : ∀ i, θ i ∈ Set.Ico (0 : ℝ) 1) + (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) + (hcost : (∑' i, ENNReal.ofReal (c i * θ i)) = ∞) : + ∃ τ : TracialState (factor θ), + IsNormalFaithfulTracialState (factor θ) τ ∧ + (∀ A : factor θ, τ A = vectorTrace traceVector (A : Hilbert →L[ℂ] Hilbert)) ∧ + ∃ T : factor θ, (T : Hilbert →L[ℂ] Hilbert) = weightedOperator θ c ∧ + T ≠ 0 ∧ NormQuasinilpotent T ∧ spectrum ℂ T = {0} ∧ + fugledeKadisonDeterminant τ T = 0 := by + refine ⟨(traceVector_faithfulTracial θ).toTracialState, + traceVectorTracialState_normal θ, fun _ => rfl, + ⟨weightedOperator θ c, weightedOperator_mem_factor θ c⟩, rfl, ?_, + weightedOperator_normQuasinilpotent θ c (fun i => (hθ01 i).1) hc hθ hcost, + weightedOperator_factorSpectrum_eq_singleton_zero θ c + (fun i => (hθ01 i).1) hc hθ hcost, + weightedOperator_tracialDeterminant_zero_of_cost_divergence θ c hθ01 hc hθ hcost⟩ + intro hz + exact weightedOperator_ne_zero θ c (fun i => (hθ01 i).1) hc hθ + (congrArg Subtype.val hz) + +theorem exists_normalTracialState_weightedOperator_block_spectral_bundle + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) + (K C : ℕ → ℝ) (hK : ∀ j, 1 ≤ K j) (hC : ∀ j, K j ^ 2 ≤ C j) + (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ) + (hθ01 : ∀ i, θ i ∈ Set.Ico (0 : ℝ) 1) (hθ : Summable θ) + (hlower : ∀ i, 1 / ((m (e i).1 : ℝ) * K (e i).1) ≤ θ i) : + ∃ τ : TracialState (factor θ), + IsNormalFaithfulTracialState (factor θ) τ ∧ + (∀ A : factor θ, τ A = vectorTrace traceVector (A : Hilbert →L[ℂ] Hilbert)) ∧ + ∃ T : factor θ, (T : Hilbert →L[ℂ] Hilbert) = + weightedOperator θ (fun i => C (e i).1) ∧ + T ≠ 0 ∧ NormQuasinilpotent T ∧ spectrum ℂ T = {0} ∧ + fugledeKadisonDeterminant τ T = 0 := by + exact exists_normalTracialState_weightedOperator_spectral_bundle θ + (fun i => C (e i).1) hθ01 (fun i => (sq_nonneg _).trans (hC _)) hθ + (tsum_block_coordinate_cost_eq_top m hm K C hK hC e θ hlower) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductTracialInputs.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTracialInputs.lean new file mode 100644 index 0000000000000000000000000000000000000000..229724f5de8ee7978130f2e9b2fe2f19cbb19d7c --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTracialInputs.lean @@ -0,0 +1,79 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductTracialVector +import OAI.Analysis.IrrationalRotation.Spectral.ProductQuasinilpotent +import OAI.Analysis.IrrationalRotation.Spectral.ProductDeterminant +import OAI.Analysis.IrrationalRotation.Spectral.ProductBlockQuasinilpotent +import OAI.Analysis.IrrationalRotation.Analysis.FieldShiftMoments +import OAI.Analysis.IrrationalRotation.Spectral.VectorSpectral + +namespace OAI + +noncomputable section +open MeasureTheory Set +open scoped ENNReal + +namespace Invariant233.ProductModel + +def weightedElement (θ c : ℕ → ℝ) : factor θ := + ⟨weightedOperator θ c, weightedOperator_mem_factor θ c⟩ + +def productTracialState (θ : ℕ → ℝ) : TracialState (factor θ) := + (traceVector_faithfulTracial θ).toTracialState + +@[simp] theorem coe_weightedElement (θ c : ℕ → ℝ) : + (weightedElement θ c : Hilbert →L[ℂ] Hilbert) = weightedOperator θ c := rfl + +@[simp] theorem productTracialState_apply (θ : ℕ → ℝ) (a : factor θ) : + productTracialState θ a = vectorTrace traceVector (a : Hilbert →L[ℂ] Hilbert) := rfl + +theorem weightedElement_normQuasinilpotent (θ c : ℕ → ℝ) + (hT : NormQuasinilpotent (weightedOperator θ c)) : + NormQuasinilpotent (weightedElement θ c) := by + exact hT + +theorem productTracialState_weightedElement_pow_eq_zero (θ c : ℕ → ℝ) + (n : ℕ) (hn : 0 < n) : + productTracialState θ (weightedElement θ c ^ n) = 0 := by + exact vectorTrace_weightedOperator_pow_eq_zero θ c n hn + +theorem weightedElement_determinant_eq_vector (θ c : ℕ → ℝ) : + fugledeKadisonDeterminant (productTracialState θ) (weightedElement θ c) = + vectorFugledeKadisonDeterminant traceVector (weightedOperator θ c) := + (traceVector_faithfulTracial θ).determinant_eq_vector (weightedElement θ c) + +theorem weightedElement_isBrownMeasure_iff_vector (θ c : ℕ → ℝ) (μ : Measure ℂ) : + IsBrownMeasure (productTracialState θ) (weightedElement θ c) μ ↔ + IsVectorBrownMeasure traceVector (weightedOperator θ c) μ := + (traceVector_faithfulTracial θ).isBrownMeasure_iff_vector (weightedElement θ c) μ + +theorem weightedElement_tracialInputs_of_logIntegral (θ c : ℕ → ℝ) + (hθ01 : ∀ i, θ i ∈ Ico (0 : ℝ) 1) (hc : ∀ i, 0 ≤ c i) + (hθ : Summable θ) + (hlog : HasNegInfiniteLogIntegral baseMeasure (weight θ c)) : + NormQuasinilpotent (weightedElement θ c) ∧ + (∀ n : ℕ, 0 < n → productTracialState θ (weightedElement θ c ^ n) = 0) ∧ + fugledeKadisonDeterminant (productTracialState θ) (weightedElement θ c) = 0 := by + refine ⟨weightedElement_normQuasinilpotent θ c + (weightedOperator_normQuasinilpotent_of_logIntegral θ c hθ01 hc hθ hlog), + productTracialState_weightedElement_pow_eq_zero θ c, ?_⟩ + rw [weightedElement_determinant_eq_vector] + exact weightedOperator_vectorDeterminant_zero θ c (fun i => (hθ01 i).1) hc hθ hlog + +theorem weightedElement_tracialInputs_of_block_bounds + (m : ℕ → ℕ) (hm : ∀ j, 0 < m j) + (K C : ℕ → ℝ) (hK : ∀ j, 1 ≤ K j) (hC : ∀ j, K j ^ 2 ≤ C j) + (e : ℕ ≃ Σ j, Fin (m j)) (θ : ℕ → ℝ) + (hθ01 : ∀ i, θ i ∈ Ico (0 : ℝ) 1) (hθ : Summable θ) + (hθlower : ∀ i, 1 / ((m (e i).1 : ℝ) * K (e i).1) ≤ θ i) : + let c : ℕ → ℝ := fun i => C (e i).1 + NormQuasinilpotent (weightedElement θ c) ∧ + (∀ n : ℕ, 0 < n → productTracialState θ (weightedElement θ c ^ n) = 0) ∧ + fugledeKadisonDeterminant (productTracialState θ) (weightedElement θ c) = 0 := by + exact weightedElement_tracialInputs_of_logIntegral θ _ hθ01 + (fun i => (sq_nonneg _).trans (hC (e i).1)) hθ + (hasNegInfiniteLogIntegral_of_block_bounds m hm K C hK hC e θ hθ01 hθlower) + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductTracialVector.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTracialVector.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1b49ac0e964a8f3df996c4d6cecd4bd5758ac74 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductTracialVector.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductCovariance +import OAI.Analysis.IrrationalRotation.Operators.CovariantTracialVector + +namespace OAI + +noncomputable section +open MeasureTheory Filter + +namespace Invariant233.ProductModel + +theorem traceVector_faithfulTracial (θ : ℕ → ℝ) : + IsFaithfulTracialVector (factor θ) traceVector := by + have hb : (default : HilbertBasis ℤ ℂ Fiber) 0 = + (lp.single 2 (0 : ℤ) (1 : ℂ) : Fiber) := + (HilbertBasis.repr_symm_single (default : HilbertBasis ℤ ℂ Fiber) 0).symm + rw [traceVector, ← hb] + apply FieldTraceCyclic.faithfulTracialVector_of_commuting_shiftedPullbacks + (default : HilbertBasis ℤ ℂ Fiber) (factor θ) + (rotationIterate θ) (rotationIterate_measurePreserving θ) + (fun m => (WeightedShift.shift m).toLinearIsometry) + · exact FieldKoopman.shift_default_basis + · intro T hT + exact commute_shiftedPullback_of_mem_factor θ hT + · intro T hT + obtain ⟨F, hbound, hmeas, hrepr, _⟩ := exists_unique_field hT + exact ⟨F, hrepr, fun r => (hmeas _).aestronglyMeasurable, + Filter.Eventually.of_forall hbound⟩ + +theorem vectorTrace_eq_integral_central + (T : Hilbert →L[ℂ] Hilbert) (F : Base → Fiber →L[ℂ] Fiber) + (hF : ∀ ξ : Hilbert, T ξ =ᵐ[baseMeasure] fun x => F x (ξ x)) : + vectorTrace traceVector T = + ∫ x, inner ℂ (lp.single 2 (0 : ℤ) (1 : ℂ) : Fiber) + (F x (lp.single 2 (0 : ℤ) (1 : ℂ))) ∂baseMeasure := + FieldTraceCyclic.constant_vector_state_eq_integral T F hF _ + +theorem vectorTrace_mul_comm (θ : ℕ → ℝ) {A B : Hilbert →L[ℂ] Hilbert} + (hA : A ∈ factor θ) (hB : B ∈ factor θ) : + vectorTrace traceVector (A * B) = vectorTrace traceVector (B * A) := + (traceVector_faithfulTracial θ).2.1 A B hA hB + +theorem eq_zero_of_positive_vectorTrace_zero (θ : ℕ → ℝ) + {A : Hilbert →L[ℂ] Hilbert} (hA : A ∈ factor θ) + (hpos : A.IsPositive) (hzero : vectorTrace traceVector A = 0) : A = 0 := + (traceVector_faithfulTracial θ).2.2 A hA hpos hzero + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductWeightBridge.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductWeightBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..d19ac9f2b7a6243099c6c2cd9f5351e82f574b2a --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductWeightBridge.lean @@ -0,0 +1,102 @@ +import OAI.Analysis.IrrationalRotation.Model.ProductBase +import OAI.Analysis.IrrationalRotation.Product.ProductCocycle +import OAI.Analysis.IrrationalRotation.Analysis.ExtendedExponential + +namespace OAI + +open MeasureTheory Set Function +open scoped ENNReal + +namespace Invariant233.ProductModel + +theorem cost_summand_nonneg (θ c : ℕ → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (x : Base) (i : ℕ) : + 0 ≤ c i * (⌊circleRepresentative (x i) + θ i⌋ : ℝ) := by + apply mul_nonneg (hc i) + have hf : (0 : ℤ) ≤ ⌊circleRepresentative (x i) + θ i⌋ := by + apply Int.floor_nonneg.mpr + exact add_nonneg (ProductCocycle.representative_mem_Ico (x i)).1 (hθ i) + exact_mod_cast hf + +theorem logarithmicCost_eq_ofReal_tsum (θ c : ℕ → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (x : Base) + (hx : HasFiniteSupport (fun i ↦ ⌊circleRepresentative (x i) + θ i⌋)) : + logarithmicCost θ c x = + ENNReal.ofReal (∑' i, c i * (⌊circleRepresentative (x i) + θ i⌋ : ℝ)) := by + exact (ENNReal.ofReal_tsum_of_nonneg + (cost_summand_nonneg θ c hθ hc x) + (FiniteSupportCocycle.summable_weighted_int c hx)).symm + +theorem weight_eq_cocycleVersion_of_finite_support (θ c : ℕ → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (x : Base) + (hx : HasFiniteSupport (fun i ↦ ⌊circleRepresentative (x i) + θ i⌋)) : + weight θ c x = ProductCocycle.cocycleVersion θ c 1 x := by + have hnonneg : 0 ≤ ∑' i, c i * (⌊circleRepresentative (x i) + θ i⌋ : ℝ) := + tsum_nonneg (cost_summand_nonneg θ c hθ hc x) + unfold weight + rw [logarithmicCost_eq_ofReal_tsum θ c hθ hc x hx, + EReal.coe_ennreal_ofReal, max_eq_left hnonneg, ← EReal.coe_neg, + EReal.exp_coe, ENNReal.toReal_ofReal (Real.exp_pos _).le] + simp only [ProductCocycle.cocycleVersion, Int.cast_one, one_mul, + circleRepresentative, ProductCocycle.representative] + +theorem negLogCost_weight (θ c : ℕ → ℝ) (x : Base) : + negLogCost (weight θ c x) = logarithmicCost θ c x := + negLogCost_extendedExpNeg _ + +theorem weight_mem_Icc (θ c : ℕ → ℝ) (x : Base) : + weight θ c x ∈ Icc (0 : ℝ) 1 := + extendedExpNeg_mem_Icc _ + +theorem measurable_logarithmicCost (θ c : ℕ → ℝ) : + Measurable (logarithmicCost θ c) := by + apply Measurable.tsum + intro i + have hrep : Measurable (fun x : Base ↦ circleRepresentative (x i)) := + ProductCocycle.measurable_representative.comp (measurable_pi_apply i) + exact (measurable_const.mul ((measurable_of_countable (fun z : ℤ ↦ (z : ℝ))).comp + ((hrep.add_const (θ i)).floor))).ennreal_ofReal + +theorem measurable_weight (θ c : ℕ → ℝ) : Measurable (weight θ c) := by + exact (((measurable_coe_ennreal_ereal.comp + (measurable_logarithmicCost θ c)).neg).ereal_exp).ennreal_toReal + +theorem weight_ae_eq_cocycleVersion (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) : + weight θ c =ᵐ[baseMeasure] ProductCocycle.cocycleVersion θ c 1 := by + have hall := CocycleSupport.ae_product_all_int_finite_floor_support θ hθ0 hθ + filter_upwards [hall] with x hx + apply weight_eq_cocycleVersion_of_finite_support θ c hθ0 hc x + simpa only [HasFiniteSupport, circleRepresentative, Int.cast_one, one_mul] using hx 1 + +theorem ae_weight_pos (θ c : ℕ → ℝ) + (hθ0 : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) : + ∀ᵐ x ∂baseMeasure, 0 < weight θ c x := by + filter_upwards [weight_ae_eq_cocycleVersion θ c hθ0 hc hθ] with x hx + rw [hx] + exact ProductCocycle.cocycleVersion_pos θ c 1 x + +theorem weight_eq_zero_iff (θ c : ℕ → ℝ) (x : Base) : + weight θ c x = 0 ↔ logarithmicCost θ c x = ∞ := + extendedExpNeg_eq_zero_iff _ + +theorem ae_exists_finset_weight (θ c : ℕ → ℝ) + (hθ01 : ∀ i, θ i ∈ Ico (0 : ℝ) 1) (hc : ∀ i, 0 ≤ c i) (hθ : Summable θ) : + ∀ᵐ x ∂baseMeasure, ∃ s : Finset ℕ, weight θ c x = Real.exp (-∑ i ∈ s, c i) := by + filter_upwards [weight_ae_eq_cocycleVersion θ c (fun i ↦ (hθ01 i).1) hc hθ, + ProductCocycle.ae_exists_finset_cocycleVersion_one θ c hθ01 hθ] with x hx hfin + simpa only [hx] using hfin + +theorem lintegral_negLogCost_weight (θ c : ℕ → ℝ) : + (∫⁻ x, negLogCost (weight θ c x) ∂baseMeasure) = + ∫⁻ x, logarithmicCost θ c x ∂baseMeasure := by + simp only [negLogCost_weight] + +theorem hasNegInfiniteLogIntegral_iff (θ c : ℕ → ℝ) : + HasNegInfiniteLogIntegral baseMeasure (weight θ c) ↔ + (∫⁻ x, logarithmicCost θ c x ∂baseMeasure) = ∞ := by + rw [HasNegInfiniteLogIntegral, lintegral_negLogCost_weight] + +end Invariant233.ProductModel + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/ProductWeightNonconstant.lean b/lean/OAI/Analysis/IrrationalRotation/Product/ProductWeightNonconstant.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b541e02569457102cf7504394ffe0d907ed5f32 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/ProductWeightNonconstant.lean @@ -0,0 +1,118 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductOrbitFiberNull +import OAI.Analysis.IrrationalRotation.Spectral.ProductPolarDiffuse + +namespace OAI + +open MeasureTheory Set Filter +open scoped ENNReal + +namespace Invariant233.ProductModel + +theorem logarithmicCost_coordinate_increase + (θ c : ℕ → ℝ) (j : ℕ) (x y : Base) + (hxy : ∀ i, i ≠ j → y i = x i) + (hx : ⌊circleRepresentative (x j) + θ j⌋ = (0 : ℤ)) + (hy : ⌊circleRepresentative (y j) + θ j⌋ = (1 : ℤ)) : + logarithmicCost θ c y = ENNReal.ofReal (c j) + logarithmicCost θ c x := by + unfold logarithmicCost + rw [ENNReal.tsum_eq_add_tsum_ite j] + conv_rhs => arg 2; rw [ENNReal.tsum_eq_add_tsum_ite j] + simp only [hx, hy, Int.cast_zero, Int.cast_one, mul_zero, mul_one, + ENNReal.ofReal_zero, zero_add] + congr 1 + apply tsum_congr + intro i + by_cases hij : i = j + · simp [hij] + · simp [hij, hxy i hij] + +theorem measure_representative_cylinder (j : ℕ) {a : ℝ} (ha : a ≤ 1) : + baseMeasure {x | circleRepresentative (x j) ∈ Ico (0 : ℝ) a} = + ENNReal.ofReal a := by + have hmp : MeasurePreserving + (fun x : Base => circleRepresentative (x j)) baseMeasure + (volume.restrict (Ico (0 : ℝ) 1)) := + CocycleSupport.measurePreserving_productRepresentative j + change baseMeasure ((fun x : Base => circleRepresentative (x j)) ⁻¹' Ico (0 : ℝ) a) = _ + rw [← Measure.map_apply hmp.measurable measurableSet_Ico, hmp.map_eq, + Measure.restrict_apply measurableSet_Ico, + inter_eq_left.mpr (Ico_subset_Ico le_rfl ha), Real.volume_Ico, sub_zero] + +theorem weight_not_ae_constant_of_ae_ne_zero + (θ c : ℕ → ℝ) (j : ℕ) (hθj : 0 < θ j ∧ θ j < 1) (hcj : 0 < c j) + (hne : ∀ᵐ x ∂baseMeasure, weight θ c x ≠ 0) : + ¬ ∃ a : ℝ, weight θ c =ᵐ[baseMeasure] Function.const Base a := by + rintro ⟨a, ha⟩ + let α : ℕ → ℝ := fun i => if i = j then 1 - θ j else 0 + let σ : Base → Base := rotation α + have hmp : MeasurePreserving σ baseMeasure baseMeasure := measurePreserving_rotation α + let d : ℝ := min (θ j) (1 - θ j) + have hdpos : 0 < d := lt_min hθj.1 (by linarith [hθj.2]) + have hdθ : d ≤ θ j := min_le_left _ _ + have hdθ' : d ≤ 1 - θ j := min_le_right _ _ + have hd1 : d ≤ 1 := le_trans hdθ hθj.2.le + have hs : baseMeasure {x | circleRepresentative (x j) ∈ Ico (0 : ℝ) d} ≠ 0 := by + rw [measure_representative_cylinder j hd1] + exact ne_of_gt (ENNReal.ofReal_pos.mpr hdpos) + have hall : ∀ᵐ x ∂baseMeasure, + weight θ c x = a ∧ weight θ c (σ x) = a ∧ weight θ c x ≠ 0 := by + filter_upwards [ha, hmp.quasiMeasurePreserving.ae ha, hne] with x hx hy hn + exact ⟨hx, hy, hn⟩ + obtain ⟨x, hx, hxvalue, hyvalue, hxne⟩ := + ((frequently_ae_iff.mpr hs).and_eventually hall).exists + have hj : σ x j = x j + ((1 - θ j : ℝ) : Circle) := by simp [σ, rotation, α] + have hother (i : ℕ) (hij : i ≠ j) : σ x i = x i := by + simp [σ, rotation, α, hij] + have hrep : circleRepresentative (σ x j) = circleRepresentative (x j) + (1 - θ j) := by + rw [hj] + change ProductCocycle.representative (x j + ((1 - θ j : ℝ) : Circle)) = _ + rw [ProductCocycle.representative_add] + apply Int.fract_eq_self.mpr + change 0 ≤ circleRepresentative (x j) + (1 - θ j) ∧ + circleRepresentative (x j) + (1 - θ j) < 1 + constructor <;> linarith [hx.1, hx.2] + have hfloorx : ⌊circleRepresentative (x j) + θ j⌋ = (0 : ℤ) := by + apply Int.floor_eq_zero_iff.mpr + constructor <;> linarith [hx.1, hx.2] + have hfloory : ⌊circleRepresentative (σ x j) + θ j⌋ = (1 : ℤ) := by + rw [hrep] + apply Int.floor_eq_iff.mpr + constructor <;> norm_num <;> linarith [hx.1, hx.2] + have hincrease := logarithmicCost_coordinate_increase θ c j x (σ x) hother hfloorx hfloory + have hequal : logarithmicCost θ c (σ x) = logarithmicCost θ c x := by + rw [← negLogCost_weight, ← negLogCost_weight, hxvalue, hyvalue] + have hfinite : logarithmicCost θ c x ≠ ∞ := fun h => + hxne ((weight_eq_zero_iff θ c x).mpr h) + have hlt := ENNReal.lt_add_right hfinite (ne_of_gt (ENNReal.ofReal_pos.mpr hcj)) + rw [add_comm, ← hincrease, hequal] at hlt + exact (lt_irrefl _) hlt + +theorem weight_not_ae_constant (θ c : ℕ → ℝ) + (hadm : AdmissibleAnglesAndCosts θ c) : + ¬ ∃ a : ℝ, weight θ c =ᵐ[baseMeasure] Function.const Base a := by + apply weight_not_ae_constant_of_ae_ne_zero θ c 0 + ⟨(hadm.1 0).1, (hadm.1 0).2.1⟩ (hadm.1 0).2.2 + exact (ae_weight_pos θ c (fun i => (hadm.1 i).1.le) + (fun i => (hadm.1 i).2.2.le) hadm.2.1).mono (fun _ hx => hx.ne') + +theorem weight_rotation_joint_fiber_measure_zero_of_admissible + (θ c : ℕ → ℝ) (hadm : AdmissibleAnglesAndCosts θ c) (z : ℤ → ℝ) : + baseMeasure {x | ∀ n : ℤ, weight θ c (rotationIterate θ n x) = z n} = 0 := + rotation_joint_fiber_measure_zero hadm.2.2 (measurable_weight θ c) + (weight_not_ae_constant θ c hadm) z + +theorem fullPolarAlgebra_weight_diffuse_of_admissible + (θ c : ℕ → ℝ) (hadm : AdmissibleAnglesAndCosts θ c) : + IsDiffuseVonNeumannAlgebra + (fullPolarAlgebra shiftOperator (star shiftOperator * weightedOperator θ c)) := by + rw [star_shift_weightedOperator_eq_multiplier] + obtain ⟨S, hS, -, hmem⟩ := ae_weight_mem_countable θ c + (fun i => ⟨(hadm.1 i).1.le, (hadm.1 i).2.1⟩) + (fun i => (hadm.1 i).2.2.le) hadm.2.1 + exact fullPolarAlgebra_multiplier_diffuse_of_null_fibers θ (weight θ c) 1 + (by norm_num) (measurable_weight θ c) (weight_complex_norm_le_one θ c) + ⟨S, hS, hmem⟩ (weight_rotation_joint_fiber_measure_zero_of_admissible θ c hadm) + +end Invariant233.ProductModel + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/SourceProductTailAttenuation.lean b/lean/OAI/Analysis/IrrationalRotation/Product/SourceProductTailAttenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0ff084d00017bb01030c1e3327b2082ed767888 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/SourceProductTailAttenuation.lean @@ -0,0 +1,124 @@ +import OAI.Analysis.IrrationalRotation.Product.ProductScaleConsequences +import OAI.Analysis.IrrationalRotation.Product.ProductScaleTailAttenuation +import OAI.Analysis.IrrationalRotation.Couplings.SourceCouplingMarginals +import OAI.Analysis.IrrationalRotation.Couplings.ProductConditionalEvents +import OAI.Analysis.IrrationalRotation.Product.ProductCircleConditioning + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set +open scoped BigOperators + +namespace Invariant233.ProductScaleLaws +open OrderedProductCoupling + +variable {p : ProductScaleData} (hp : ProductScaleLaws p) + +theorem source_product_tail_conditional_attenuation + (e : ℕ ≃ Σ s, Fin (p.m s)) + (he : ∀ a : Σ s, Fin (p.m s), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) + (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθsum : Summable θ) + (j : ℕ) + (hb : ∀ i ∈ ProductPhases.consecutiveBlock p.m j, + θ i ∈ Icc (1 / p.N j) (2 / p.N j)) + (hsmall : ∀ s, j < s → ProductPhases.smallPhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.K s) (p.G s) θ) + (hlarge : ∀ s, j ≤ s → ProductPhases.largePhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.N s) θ) : + let P := sourceBlocks p.m p.a p.b hp.m_ge_100 + (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j + ∃ H₁ H₂ : ℤ → Set Sample, + (∀ k, MeasurableSet (H₁ k)) ∧ (∀ k, MeasurableSet (H₂ k)) ∧ + (∀ᵐ ω ∂law P, ∀ k : ℤ, (p.K j : ℝ) < |(k : ℝ)| → + ((law P)[(H₁ k).indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleLeftEndpoint inferInstance]) ω ≤ + Real.exp (-p.L j / 400) ∧ + ((law P)[(H₂ k).indicator (fun _ => (1 : ℝ)) | + MeasurableSpace.comap circleRightEndpoint inferInstance]) ω ≤ + Real.exp (-p.L j / 400) ∧ + ((∃ i ∈ ProductPhases.consecutiveBlock p.m j, + circleRepresentative (circleLeftEndpoint ω i) < 1 / (p.m j : ℝ) ∧ + 1 - 1 / (p.m j : ℝ) ≤ circleRepresentative (circleRightEndpoint ω i)) → + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (circleRightEndpoint ω) / + ProductCocycle.cocycleVersion θ (fun i => p.C (e i).1) k (circleLeftEndpoint ω) ≤ + Real.exp (-p.L j) + (H₁ k).indicator (fun _ => (1 : ℝ)) ω + + (H₂ k).indicator (fun _ => (1 : ℝ)) ω)) := by + let P := sourceBlocks p.m p.a p.b hp.m_ge_100 + (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j + change ∃ H₁ H₂ : ℤ → Set Sample, _ + let u : ℤ → ℕ → ℝ := fun k i => 1 - Int.fract ((k : ℝ) * θ i) + let top : ℤ → Bool → ℕ → Set Sample := fun k _ i => + {ω | u k i ≤ realEndpoint (circleRightEndpoint ω) i} + let bottom : ℤ → Bool → ℕ → Set Sample := fun k _ i => + {ω | realEndpoint (circleLeftEndpoint ω) i < u k i} + have htop (k : ℤ) (which : Bool) (i : ℕ) : MeasurableSet (top k which i) := + measurableSet_le measurable_const + ((measurable_pi_apply i).comp (realEndpoint_measurable.comp circleRightEndpoint_measurable)) + have hbottom (k : ℤ) (which : Bool) (i : ℕ) : MeasurableSet (bottom k which i) := + measurableSet_lt + ((measurable_pi_apply i).comp (realEndpoint_measurable.comp circleLeftEndpoint_measurable)) + measurable_const + have hac (side : Bool) : (law P).map (circleHybridEndpoint (fun _ => side)) ≪ + ProductCocycle.haar ℕ := by + obtain ⟨g, _, _, _, _, hg⟩ := exists_source_circle_hybrid_density p.m p.a p.b + hp.m_ge_100 (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j (fun _ => side) + change (law P).map (circleHybridEndpoint (fun _ => side)) = _ at hg + rw [hg] + exact withDensity_absolutelyContinuous _ _ + have hacx : (law P).map circleLeftEndpoint ≪ ProductCocycle.haar ℕ := hac false + have hacy : (law P).map circleRightEndpoint ≪ ProductCocycle.haar ℕ := hac true + apply hp.simultaneous_product_tail_conditional_attenuation e he θ hθ0 hθsum + (MeasurableSpace.comap circleLeftEndpoint inferInstance) + (MeasurableSpace.comap circleRightEndpoint inferInstance) + circleLeftEndpoint_measurable.comap_le circleRightEndpoint_measurable.comap_le + (law P) circleLeftEndpoint circleRightEndpoint + (Measurable.of_comap_le le_rfl) (Measurable.of_comap_le le_rfl) + hacx hacy (ae_circle_endpoints_ordered P) top bottom htop hbottom + (fun k _ => (right_threshold_iCondIndepSet_iff_circle P (u k)).mp + (right_thresholds_iCondIndepSet P (u k))) + (fun k _ => (left_threshold_iCondIndepSet_iff_circle P (u k)).mp + (left_thresholds_iCondIndepSet P (u k))) + j hb hsmall hlarge + · intro k s _hjs which i hi _u hu + have hsi := ProductPhases.enumeration_block_of_mem p.m e he hi + let w : ℝ := if which then p.b s else p.a s + have hw : w = P.a i ∨ w = P.b i := by + cases which + · exact Or.inl (by simp only [w, P, sourceBlocks, ofBlocks, hsi, Bool.false_eq_true, ↓reduceIte]) + · exact Or.inr (by simp only [w, P, sourceBlocks, ofBlocks, hsi, ↓reduceIte]) + have hrho : CouplingMarginalBounds.rho (P.κ i) (P.m i) w = + ProductScaleData.kappa s * Real.sqrt (w / (p.m s : ℝ)) := by + simp only [CouplingMarginalBounds.rho, P, sourceBlocks, ofBlocks, hsi, + sourceKappa, ProductScaleData.kappa, Nat.cast_add, Nat.cast_one] + filter_upwards [ae_real_circle_endpoints P, + right_threshold_condExp_lower P (u k), left_threshold_condExp_lower P (u k), + right_threshold_condExp_eq_circle P (u k) i, + left_threshold_condExp_eq_circle P (u k) i] + with ω hrep hr hl her hel + refine ⟨fun _ h => h, fun _ h => h, ?_, ?_⟩ + · intro hx + have hxr : leftEndpoint ω i < u k i := by + rw [← hrep.1] + exact hx + have h := hr i w hw hu.1 hu.2 hxr + rw [hrho, her] at h + exact h + · intro hy + have hyr : u k i ≤ rightEndpoint ω i := by + rw [← hrep.2] + exact hy + have h := hl i w hw hu.1 hu.2 hyr + rw [hrho, hel] at h + exact h + · exact Filter.Eventually.of_forall (fun _ h => h) + +end Invariant233.ProductScaleLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Product/SourceProductTailRealization.lean b/lean/OAI/Analysis/IrrationalRotation/Product/SourceProductTailRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..2562f0c10c27188c1330c86f4bb8b1047db6bf88 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Product/SourceProductTailRealization.lean @@ -0,0 +1,65 @@ +import OAI.Analysis.IrrationalRotation.Model.SourceProductTail +import OAI.Analysis.IrrationalRotation.Product.SourceProductTailAttenuation +import OAI.Analysis.IrrationalRotation.Product.ProductScaleRealization + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped BigOperators Topology + +namespace Invariant233.ProductScaleLaws +open OrderedProductCoupling +variable {p : ProductScaleData} (hp : ProductScaleLaws p) + +theorem eventually_source_product_tail_estimate + (e : ℕ ≃ Σ s, Fin (p.m s)) + (he : ∀ a : Σ s, Fin (p.m s), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) + (θ : ℕ → ℝ) (hθ0 : ∀ i, 0 ≤ θ i) (hθsum : Summable θ) + (hb : ∀ j, ∀ i ∈ ProductPhases.consecutiveBlock p.m j, + θ i ∈ Icc (1 / p.N j) (2 / p.N j)) + (hsmall : ∀ s, ProductPhases.smallPhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.K s) (p.G s) θ) + (hlarge : ∀ᶠ s in atTop, ProductPhases.largePhaseCondition + (ProductPhases.consecutiveBlock p.m s) (p.N s) θ) : + ∀ᶠ j in atTop, SourceTailEstimate p e θ j + (sourceBlocks p.m p.a p.b hp.m_ge_100 + (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j) := by + obtain ⟨j₀, hj₀⟩ := eventually_atTop.1 hlarge + filter_upwards [eventually_ge_atTop j₀] with j hj + exact hp.source_product_tail_conditional_attenuation e he θ hθ0 hθsum j + (hb j) (fun s _ => hsmall s) (fun s hjs => hj₀ s (hj.trans hjs)) + +end Invariant233.ProductScaleLaws + +namespace Invariant233.ProductModel +open OrderedProductCoupling + +theorem exists_product_operator_and_source_tail_estimates : + ∃ p : ProductScaleData, ∃ hp : ProductScaleLaws p, + ∃ (e : ℕ ≃ Σ s, Fin (p.m s)) (θ : ℕ → ℝ), + (∀ a : Σ s, Fin (p.m s), + e.symm a = (∑ r ∈ Finset.range a.1, p.m r) + a.2.val) ∧ + AdmissibleAnglesAndCosts θ (fun i => p.C (e i).1) ∧ + HasNegInfiniteLogIntegral baseMeasure (weight θ (fun i => p.C (e i).1)) ∧ + weightedOperator θ (fun i => p.C (e i).1) ∈ factor θ ∧ + weightedOperator θ (fun i => p.C (e i).1) ≠ 0 ∧ + NormQuasinilpotent (weightedOperator θ (fun i => p.C (e i).1)) ∧ + (∀ᶠ j in atTop, SourceTailEstimate p e θ j + (sourceBlocks p.m p.a p.b hp.m_ge_100 + (fun s => (hp.a_bounds s).1) (fun s => (hp.a_bounds s).2) + (fun s => (hp.b_bounds s).1) (fun s => (hp.b_bounds s).2) e j)) := by + obtain ⟨p, hp, e, θ, he, hθ, _hsum, _hsum', hadm, hlog, _hpos, + hsmall, hlarge, hmem, hne, hqn, _hspec⟩ := + exists_product_scales_phase_quasinilpotent + exact ⟨p, hp, e, θ, he, hadm, hlog, hmem, hne, hqn, + hp.eventually_source_product_tail_estimate e he θ + (fun i => (hadm.1 i).1.le) hadm.2.1 hθ hsmall hlarge⟩ + +end Invariant233.ProductModel + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Rotation/ActualRotationCentrality.lean b/lean/OAI/Analysis/IrrationalRotation/Rotation/ActualRotationCentrality.lean new file mode 100644 index 0000000000000000000000000000000000000000..08e9bbb5d3e3113a5f3e6546cc1c7e877041b438 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Rotation/ActualRotationCentrality.lean @@ -0,0 +1,55 @@ +import OAI.Analysis.IrrationalRotation.Rotation.WeightedShiftCentrality +import OAI.Analysis.IrrationalRotation.Rotation.CircleErgodicity +import OAI.Analysis.IrrationalRotation.Product.ProductBaseDynamics + +namespace OAI + +namespace Invariant233.WeightedShift + +open MeasureTheory Filter + +local notation "S" => + LinearIsometry.toContinuousLinearMap (LinearIsometryEquiv.toLinearIsometry (shift 1)) + +theorem ae_eq_scalar_over_circle_rotation + (θ : ℝ) (hθ : Irrational θ) + (A : Invariant233.Circle → Hilbert →L[ℂ] Hilbert) + (w : Invariant233.Circle → Weight) + (hphase : ∀ᵐ x ∂circleMeasure, ∀ k : ℤ, + w x k = (AddCircle.toCircle (x + k • (θ : Invariant233.Circle)) : ℂ)) + (hm : NullMeasurable + (fun x => A x (lp.single 2 (0 : ℤ) (1 : ℂ)) 0) circleMeasure) + (hD : ∀ᵐ x ∂circleMeasure, Commute (A x) (diagonal (w x))) + (hS : ∀ᵐ x ∂circleMeasure, Commute (A x) S) + (hcov : ∀ᵐ x ∂circleMeasure, + S * A (x + (θ : Invariant233.Circle)) = A x * S) : + ∃ c : ℂ, ∀ᵐ x ∂circleMeasure, + A x = c • (1 : Hilbert →L[ℂ] Hilbert) := by + exact ae_eq_scalar_of_commute_irrational_diagonal_shift + circleMeasure (fun x => x + (θ : Invariant233.Circle)) + (InvariantProjection.CircleErgodicity.irrational_rotation_ergodic hθ) + A w θ hθ id hphase hm hD hS hcov + +theorem ae_eq_scalar_over_product_rotation + (θ : ℕ → ℝ) (hθ : ProductModel.JointlyRationallyIndependent θ) + (i : ℕ) (A : ProductModel.Base → Hilbert →L[ℂ] Hilbert) + (w : ProductModel.Base → Weight) + (hphase : ∀ᵐ x ∂ProductModel.baseMeasure, ∀ k : ℤ, + w x k = (AddCircle.toCircle (x i + k • (θ i : Invariant233.Circle)) : ℂ)) + (hm : NullMeasurable + (fun x => A x (lp.single 2 (0 : ℤ) (1 : ℂ)) 0) ProductModel.baseMeasure) + (hD : ∀ᵐ x ∂ProductModel.baseMeasure, Commute (A x) (diagonal (w x))) + (hS : ∀ᵐ x ∂ProductModel.baseMeasure, Commute (A x) S) + (hcov : ∀ᵐ x ∂ProductModel.baseMeasure, + S * A (ProductModel.rotation θ x) = A x * S) : + ∃ c : ℂ, ∀ᵐ x ∂ProductModel.baseMeasure, + A x = c • (1 : Hilbert →L[ℂ] Hilbert) := by + exact ae_eq_scalar_of_commute_irrational_diagonal_shift + ProductModel.baseMeasure (ProductModel.rotation θ) + (ProductModel.rotation_ergodic hθ) A w (θ i) + (Invariant233.IndependentRotation.irrational_coordinate hθ i) + (fun x => x i) hphase hm hD hS hcov + +end Invariant233.WeightedShift + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Rotation/AnalyticWeightBridge.lean b/lean/OAI/Analysis/IrrationalRotation/Rotation/AnalyticWeightBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..daaa8a3b22d5a167ef65a474e3ca96b79414d518 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Rotation/AnalyticWeightBridge.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.IrrationalRotation.Model.Analytic +import OAI.Analysis.IrrationalRotation.Rotation.ExponentialWeight +import OAI.Analysis.IrrationalRotation.Analysis.TruncatedLogIntegral + +namespace OAI + +open Filter MeasureTheory +open scoped ENNReal Topology + +namespace Invariant233 + +@[simp] theorem negLogCost_zero : negLogCost 0 = ∞ := by + simp [negLogCost] + +theorem negLogCost_of_pos {t : ℝ} (ht : 0 < t) : + negLogCost t = ENNReal.ofReal (-Real.log t) := by + simp [negLogCost, ht.ne', abs_of_pos ht] + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} + +theorem lintegral_negLogCost_eq_of_ae_pos (f : X → ℝ) + (hpos : ∀ᵐ x ∂μ, 0 < f x) : + (∫⁻ x, negLogCost (f x) ∂μ) = + ∫⁻ x, ENNReal.ofReal (-Real.log (f x)) ∂μ := by + apply lintegral_congr_ae + filter_upwards [hpos] with x hx + exact negLogCost_of_pos hx + +theorem hasNegInfiniteLogIntegral_iff_of_ae_pos (f : X → ℝ) + (hpos : ∀ᵐ x ∂μ, 0 < f x) : + HasNegInfiniteLogIntegral μ f ↔ + (∫⁻ x, ENNReal.ofReal (-Real.log (f x)) ∂μ) = ∞ := by + unfold HasNegInfiniteLogIntegral + rw [lintegral_negLogCost_eq_of_ae_pos f hpos] + +theorem scalarWeightDeterminant_eq_zero_of_log_integral + (f : X → ℝ) (h : HasNegInfiniteLogIntegral μ f) : + scalarWeightDeterminant μ f = 0 := by + unfold scalarWeightDeterminant + rw [show (∫⁻ x, negLogCost (f x) ∂μ) = ∞ from h] + simp + +theorem ae_pos_of_nonneg_singleton_zero (f : X → ℝ) (a : X) + (ha : μ {a} = 0) (hf : ∀ x, 0 ≤ f x) + (hz : ∀ x, f x = 0 ↔ x = a) : ∀ᵐ x ∂μ, 0 < f x := by + have hne : ∀ᵐ x ∂μ, x ≠ a := by + simpa only [ae_iff, not_not, Set.ofPred_eq_eq_singleton] using ha + filter_upwards [hne] with x hx + exact lt_of_le_of_ne (hf x) (Ne.symm (fun h => hx ((hz x).mp h))) + +@[simp] theorem circleMeasure_singleton (x : Circle) : circleMeasure {x} = 0 := by + change volume {x} = 0 + rw [← Metric.closedBall_zero, AddCircle.volume_closedBall] + norm_num + +theorem IsContinuousCircleWeight.ae_pos {f : Circle → ℝ} + (hf : IsContinuousCircleWeight f) : ∀ᵐ x ∂circleMeasure, 0 < f x := by + apply ae_pos_of_nonneg_singleton_zero f 0 + · simp only [circleMeasure_singleton] + · exact fun x => (hf.2.1 x).1 + · exact hf.2.2.1 + +theorem exists_continuous_circle_weight_of_cost (g : Circle → ℝ) + (hc : ContinuousOn g ({0}ᶜ)) + (hg : ∀ x ≠ 0, 0 ≤ g x) + (hlim : Tendsto g (𝓝[≠] 0) atTop) + (hint : (∫⁻ x, ENNReal.ofReal (g x) ∂circleMeasure) = ∞) : + ∃ f : Circle → ℝ, IsContinuousCircleWeight f ∧ + (∀ x ≠ 0, -Real.log (f x) = g x) := by + obtain ⟨f, hfcont, hfrange, hfzero, hflog, hfinf⟩ := + exists_continuous_weight_of_cost circleMeasure 0 g (by simp only [circleMeasure_singleton]) + hc hg hlim hint + have hpos : ∀ᵐ x ∂circleMeasure, 0 < f x := + ae_pos_of_nonneg_singleton_zero f 0 (by simp only [circleMeasure_singleton]) + (fun x => (hfrange x).1) hfzero + exact ⟨f, ⟨hfcont, hfrange, hfzero, + (hasNegInfiniteLogIntegral_iff_of_ae_pos f hpos).mpr hfinf⟩, hflog⟩ + +theorem IsContinuousCircleWeight.exists_truncated_log_integral_lt + {f : Circle → ℝ} (hf : IsContinuousCircleWeight f) (a : ℝ) : + ∃ M : ℝ, 0 < M ∧ + (∫ x, Real.log (max (f x) (Real.exp (-M))) ∂circleMeasure) < -2 * a := by + let : IsFiniteMeasure circleMeasure := by unfold circleMeasure; infer_instance + apply exists_pos_truncated_log_integral_lt f hf.1.measurable + (fun x => (hf.2.1 x).1) (fun x => (hf.2.1 x).2) hf.ae_pos + exact (hasNegInfiniteLogIntegral_iff_of_ae_pos f hf.ae_pos).mp hf.2.2.2 + +end Invariant233 + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Rotation/BlockedCircleEvent.lean b/lean/OAI/Analysis/IrrationalRotation/Rotation/BlockedCircleEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..1325046daad9c29d9eee20b1cb276009a674bed8 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Rotation/BlockedCircleEvent.lean @@ -0,0 +1,121 @@ +import OAI.Analysis.IrrationalRotation.Analysis.BlockedPositiveEvent +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic + +namespace OAI + +open Filter MeasureTheory Set +open scoped Topology + +namespace Invariant233.BlockedProductCoupling + +theorem ae_all_coordinates_mem_Ico + {m : ℕ → ℕ} {κ : ℕ → ℝ} {a b : (s : ℕ) → Fin (m s) → ℝ} + (hm : ∀ s, 100 ≤ m s) (hκ0 : ∀ s, 0 ≤ κ s) (hκ : ∀ s, κ s ≤ 1 / 100) + (ha : ∀ s i, 1 / (m s : ℝ) ≤ a s i) (ha' : ∀ s i, a s i ≤ 1 / 4) + (hb : ∀ s i, 1 / (m s : ℝ) ≤ b s i) (hb' : ∀ s i, b s i ≤ 1 / 4) + (j : ℕ) : + ∀ᵐ z ∂law m κ a b j, ∀ s i, + (z s i).2.1 ∈ Ico (0 : ℝ) 1 ∧ (z s i).2.2 ∈ Ico (0 : ℝ) 1 := by + apply ae_all_iff.2 + intro s + apply ae_all_iff.2 + intro i + have hs : ∀ᵐ t ∂(volume : Measure ℝ).restrict (Ico (0 : ℝ) 1), + t ∈ Ico (0 : ℝ) 1 := ae_restrict_mem measurableSet_Ico + have hx := (Measure.absolutelyContinuous_of_le_smul + (law_left_marginal_le_ten hm hκ0 hκ ha ha' hb hb' j s i)).ae_le hs + have hy := (Measure.absolutelyContinuous_of_le_smul + (law_right_marginal_le_ten hm hκ0 hκ ha ha' hb hb' j s i)).ae_le hs + have hmx : Measurable (fun z : Sample m => (z s i).2.1) := by fun_prop + have hmy : Measurable (fun z : Sample m => (z s i).2.2) := by fun_prop + exact (ae_of_ae_map hmx.aemeasurable hx).and (ae_of_ae_map hmy.aemeasurable hy) + +theorem ae_all_coordinates_ordered + {m : ℕ → ℕ} {κ : ℕ → ℝ} {a b : (s : ℕ) → Fin (m s) → ℝ} + (hm : ∀ s, 100 ≤ m s) (hκ0 : ∀ s, 0 ≤ κ s) (hκ : ∀ s, κ s ≤ 1 / 100) + (ha : ∀ s i, 1 / (m s : ℝ) ≤ a s i) (ha' : ∀ s i, a s i ≤ 1 / 4) + (hb : ∀ s i, 1 / (m s : ℝ) ≤ b s i) (hb' : ∀ s i, b s i ≤ 1 / 4) + (j : ℕ) : + ∀ᵐ z ∂law m κ a b j, ∀ s i, (z s i).2.1 ≤ (z s i).2.2 := by + apply ae_all_iff.2 + intro s + apply ae_all_iff.2 + intro i + have ho : ∀ᵐ q ∂OneCoordinateCoupling.labelledLaw (κ s) (m s) (a s i) (b s i) + (if s = j then 1 else 0), q.2.1 ≤ q.2.2 := + OneCoordinateCoupling.labelledLaw_ae_ordered (by have := hm s; norm_cast; omega) + rw [← law_map_coordinate hm hκ0 hκ ha ha' hb hb' j s i] at ho + exact ae_of_ae_map ((measurable_pi_apply i).comp (measurable_pi_apply s)).aemeasurable ho + +theorem ae_circle_representatives + {m : ℕ → ℕ} {κ : ℕ → ℝ} {a b : (s : ℕ) → Fin (m s) → ℝ} + (hm : ∀ s, 100 ≤ m s) (hκ0 : ∀ s, 0 ≤ κ s) (hκ : ∀ s, κ s ≤ 1 / 100) + (ha : ∀ s i, 1 / (m s : ℝ) ≤ a s i) (ha' : ∀ s i, a s i ≤ 1 / 4) + (hb : ∀ s i, 1 / (m s : ℝ) ≤ b s i) (hb' : ∀ s i, b s i ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) (j : ℕ) : + ∀ᵐ z ∂law m κ a b j, ∀ i, + circleRepresentative (circleLeftEndpoint e z i) = leftEndpoint e z i ∧ + circleRepresentative (circleRightEndpoint e z i) = rightEndpoint e z i := by + filter_upwards [ae_all_coordinates_mem_Ico hm hκ0 hκ ha ha' hb hb' j] with z hz + intro i + have hx := (hz (e i).1 (e i).2).1 + have hy := (hz (e i).1 (e i).2).2 + have hx' : (z (e i).1 (e i).2).2.1 ∈ Ico (0 : ℝ) (0 + 1) := by simpa using hx + have hy' : (z (e i).1 (e i).2).2.2 ∈ Ico (0 : ℝ) (0 + 1) := by simpa using hy + constructor + · exact congrArg Subtype.val (AddCircle.equivIco_coe_eq hx') + · exact congrArg Subtype.val (AddCircle.equivIco_coe_eq hy') + +theorem ae_circle_endpoints_ordered + {m : ℕ → ℕ} {κ : ℕ → ℝ} {a b : (s : ℕ) → Fin (m s) → ℝ} + (hm : ∀ s, 100 ≤ m s) (hκ0 : ∀ s, 0 ≤ κ s) (hκ : ∀ s, κ s ≤ 1 / 100) + (ha : ∀ s i, 1 / (m s : ℝ) ≤ a s i) (ha' : ∀ s i, a s i ≤ 1 / 4) + (hb : ∀ s i, 1 / (m s : ℝ) ≤ b s i) (hb' : ∀ s i, b s i ≤ 1 / 4) + (e : ℕ ≃ Σ s, Fin (m s)) (j : ℕ) : + ∀ᵐ z ∂law m κ a b j, + ProductModel.Ordered (circleLeftEndpoint e z) (circleRightEndpoint e z) := by + filter_upwards [ae_circle_representatives hm hκ0 hκ ha ha' hb hb' e j, + ae_all_coordinates_ordered hm hκ0 hκ ha ha' hb hb' j] with z hr ho + intro i + rw [(hr i).1, (hr i).2] + exact ho (e i).1 (e i).2 + +theorem measurePreserving_toCircle : MeasurePreserving toCircle + OrderedProductCoupling.baseMeasure ProductModel.baseMeasure := by + have hc : MeasurePreserving (fun t : ℝ => (t : Circle)) + OneCoordinateCoupling.baseLaw circleMeasure := by + rw [OneCoordinateCoupling.baseLaw_eq_restrict, circleMeasure, + restrict_Ico_eq_restrict_Ioc] + simpa only [zero_add] using AddCircle.measurePreserving_mk (1 : ℝ) 0 + refine ⟨by unfold toCircle; fun_prop, ?_⟩ + unfold OrderedProductCoupling.baseMeasure ProductModel.baseMeasure toCircle + rw [Measure.infinitePi_map_pi _ (fun _ => hc.measurable)] + simp only [hc.map_eq] + +theorem eventually_circle_retainedEvent_mass + {m : ℕ → ℕ} {κ : ℕ → ℝ} {a b : (s : ℕ) → Fin (m s) → ℝ} + (hm : ∀ s, 100 ≤ m s) (hκ0 : ∀ s, 0 ≤ κ s) (hκ : ∀ s, κ s ≤ 1 / 100) + (ha : ∀ s i, 1 / (m s : ℝ) ≤ a s i) (ha' : ∀ s i, a s i ≤ 1 / 4) + (hb : ∀ s i, 1 / (m s : ℝ) ≤ b s i) (hb' : ∀ s i, b s i ≤ 1 / 4) + (hsq : Summable (fun s => κ s ^ 2)) (e : ℕ ≃ Σ s, Fin (m s)) + {K : ℕ → ℝ} (hK : ∀ s, 0 < K s) + (hd : ∀ s, 2 * K s ≤ K (s + 1)) + (hratio : Tendsto (fun j => K j / K (j + 1)) atTop (𝓝 0)) + {r : ProductModel.Base → ℝ} (hr : Measurable r) + (hi : ∀ᵐ x ∂ProductModel.baseMeasure, 0 < r x ∧ r x < 1) : + ∀ᶠ j in atTop, Real.exp (-82) / 2 ≤ + (law m κ a b j).real + (retainedEvent m K r (circleLeftEndpoint e) (circleRightEndpoint e) j) := by + have hir : ∀ᵐ x ∂OrderedProductCoupling.baseMeasure, + 0 < (r ∘ toCircle) x ∧ (r ∘ toCircle) x < 1 := + measurePreserving_toCircle.quasiMeasurePreserving.ae hi + have h := eventually_actual_retainedEvent_mass + (m := m) (κ := κ) (a := a) (b := b) + hm hκ0 hκ ha ha' hb hb' hsq e hK hd hratio + (r := r ∘ toCircle) (hr.comp measurePreserving_toCircle.measurable) hir + simpa only [retainedEvent, circleLeftEndpoint, circleRightEndpoint, + Function.comp_apply] using h + +end Invariant233.BlockedProductCoupling + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Rotation/CanonicalCircleCoefficients.lean b/lean/OAI/Analysis/IrrationalRotation/Rotation/CanonicalCircleCoefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..f472279bc77f2ffabbfd38eea2e54d559936b17f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Rotation/CanonicalCircleCoefficients.lean @@ -0,0 +1,65 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CircleCocycleWindow +import OAI.Analysis.IrrationalRotation.Rotation.ParameterCircleReindex + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexConjugate lp + +namespace Invariant233.CircleParameterLaws +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem parameter_cocycle_eq_product (k : ℤ) (x : Circle) : + p.floorCocycle θ k x = ProductCocycle.cocycleVersion + (fun n => p.alpha θ (n + 1)) p.flattenedCost k + (fun n => p.q (n + 1) • x) := by + rw [hp.parameter_cocycle_eq_flattened] + simp only [CircleWeights.cocycle, CircleWeights.floorCost, + ProductCocycle.cocycleVersion, CircleWeights.coordinate, + CircleWeights.representative, CircleWeights.phase, + CircleParameterData.flattenedFrequency, CircleParameterData.alpha, + ProductCocycle.representative, Int.cast_natCast, natCast_zsmul] + +theorem canonical_finite_window_coefficients (j : ℕ) (hj : 1 ≤ j) (x y : Circle) + (hleft : ∀ s, j ≤ s → ∀ i ∈ p.block s, + p.coordinate i x < 1 - 2 * (p.K j : ℝ) / p.N s) + (hright : ∀ s, j ≤ s → ∀ i ∈ p.block s, + 2 * (p.K j : ℝ) / p.N s < p.coordinate i y) + (ξ γ : ℓ²(ℤ, ℂ)) (hξ : ‖ξ‖ ≤ 1) (hγ : ‖γ‖ ≤ 1) : + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖ξ v / (p.floorCocycle θ v x : ℂ)‖ ≤ p.coefficientBound j) ∧ + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖(p.floorCocycle θ (-v) y : ℂ) * conj (γ (-v))‖ ≤ p.coefficientBound j) := by + simpa only [hp.parameter_cocycle_eq_product] using + hp.finite_window_coefficients j hj x y hleft hright ξ γ hξ hγ + +theorem canonical_raw_event_coefficients (j : ℕ) (hj : 1 ≤ j) + (d e : MixedRadix.Digits (MixedRadix.radices p.q)) + (hd : MixedRadix.Nonterminal d) (he : MixedRadix.Nonterminal e) + (X Y : ℕ → ℝ) (hX : ∀ i, 0 ≤ X i) (hY : ∀ i, 0 ≤ Y i) + (hdigit : ∀ i, ⌊(MixedRadix.radices p.q i : ℝ) * X i⌋₊ = (d i : ℕ)) + (hedigit : ∀ i, ⌊(MixedRadix.radices p.q i : ℝ) * Y i⌋₊ = (e i : ℕ)) + (hcurrent : ∀ i ∈ p.block j, + X i < 1 - 3 / (p.m j : ℝ) ∧ 3 / (p.m j : ℝ) < Y i) + (hfuture : ∀ s, j < s → ∀ i ∈ p.block s, + X i < 1 - 3 * (p.K j : ℝ) / p.N s ∧ + 3 * (p.K j : ℝ) / p.N s < Y i) + (ξ γ : ℓ²(ℤ, ℂ)) (hξ : ‖ξ‖ ≤ 1) (hγ : ‖γ‖ ≤ 1) : + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖ξ v / (p.floorCocycle θ v (MixedRadix.circleValue d) : ℂ)‖ ≤ + p.coefficientBound j) ∧ + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖(p.floorCocycle θ (-v) (MixedRadix.circleValue e) : ℂ) * conj (γ (-v))‖ ≤ + p.coefficientBound j) := by + have hexcl := hp.source_good_event_exclusions j hj d e hd he X Y hX hY + hdigit hedigit hcurrent hfuture + exact hp.canonical_finite_window_coefficients j hj _ _ + (fun s hs i hi => (hexcl s hs i hi).1) + (fun s hs i hi => (hexcl s hs i hi).2) ξ γ hξ hγ + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Rotation/CanonicalCircleFiniteLower.lean b/lean/OAI/Analysis/IrrationalRotation/Rotation/CanonicalCircleFiniteLower.lean new file mode 100644 index 0000000000000000000000000000000000000000..b89991185bcdc172ad7eba59b8a95e8dac0a1637 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Rotation/CanonicalCircleFiniteLower.lean @@ -0,0 +1,154 @@ +import OAI.Analysis.IrrationalRotation.Rotation.CanonicalCircleCoefficients +import OAI.Analysis.IrrationalRotation.Rotation.ProjectionCocycleWindow +import OAI.Analysis.IrrationalRotation.Analysis.FiniteWindowIntegralLower + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators ComplexConjugate lp + +namespace Invariant233.CircleParameterLaws + +variable {θ : ℝ} {p : CircleParameterData} (hp : CircleParameterLaws θ p) +include hp + +theorem parameter_convolution_sum_lower (j : ℕ) (hj : 1 ≤ j) + (A B : ℤ → ℂ) + (hA : ∀ v : ℤ, |v| ≤ (p.K j : ℤ) → ‖A v‖ ≤ p.coefficientBound j) + (hB : ∀ v : ℤ, |v| ≤ (p.K j : ℤ) → ‖B v‖ ≤ p.coefficientBound j) + (hA0 : 1 / (j : ℝ) ≤ ‖A 0‖) (hB0 : 1 / (j : ℝ) ≤ ‖B 0‖) : + p.ε j ≤ ∑ n ∈ Finset.range (2 * p.K j + 1), + ‖FiniteWindow.convolution (p.K j) A B n‖ := by + apply FiniteWindow.convolution_sum_lower_bound_of_supported_bound + (p.K j) (p.coefficientBound j) (1 / (j : ℝ)) (p.ε j) ?_ + A B hA hB hA0 hB0 + simpa only [CircleParameterData.convolutionCoefficient] using hp.polynomial_lower j hj + +theorem canonical_projection_coefficient_properties (j : ℕ) (hj : 1 ≤ j) + (x y : Circle) + (hleft : ∀ s, j ≤ s → ∀ i ∈ p.block s, + p.coordinate i x < 1 - 2 * (p.K j : ℝ) / p.N s) + (hright : ∀ s, j ≤ s → ∀ i ∈ p.block s, + 2 * (p.K j : ℝ) / p.N s < p.coordinate i y) + (P Q : ℓ²(ℤ, ℂ) →L[ℂ] ℓ²(ℤ, ℂ)) + (hP : IsStarProjection P) (hQ : IsStarProjection Q) + (a : ℝ) (hPdiag : a ≤ ((P ProjectionCocycleWindow.basisZero) 0).re) + (hQdiag : ((Q ProjectionCocycleWindow.basisZero) 0).re ≤ 1 - a) : + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖(P ProjectionCocycleWindow.basisZero) v / (p.floorCocycle θ v x : ℂ)‖ ≤ + p.coefficientBound j) ∧ + (∀ v : ℤ, |v| ≤ (p.K j : ℤ) → + ‖(p.floorCocycle θ (-v) y : ℂ) * + conj (((1 - Q) ProjectionCocycleWindow.basisZero) (-v))‖ ≤ + p.coefficientBound j) ∧ + a ≤ ‖(P ProjectionCocycleWindow.basisZero) 0 / (p.floorCocycle θ 0 x : ℂ)‖ ∧ + a ≤ ‖(p.floorCocycle θ 0 y : ℂ) * + conj (((1 - Q) ProjectionCocycleWindow.basisZero) 0)‖ := by + simpa only [hp.parameter_cocycle_eq_product] using + ProjectionCocycleWindow.circle_coefficient_properties hp j hj x y hleft hright + P Q hP hQ a hPdiag hQdiag + +theorem canonical_projection_convolution_lower (j : ℕ) (hj : 1 ≤ j) + (x y : Circle) + (hleft : ∀ s, j ≤ s → ∀ i ∈ p.block s, + p.coordinate i x < 1 - 2 * (p.K j : ℝ) / p.N s) + (hright : ∀ s, j ≤ s → ∀ i ∈ p.block s, + 2 * (p.K j : ℝ) / p.N s < p.coordinate i y) + (P Q : ℓ²(ℤ, ℂ) →L[ℂ] ℓ²(ℤ, ℂ)) + (hP : IsStarProjection P) (hQ : IsStarProjection Q) + (hPdiag : 1 / (j : ℝ) ≤ ((P ProjectionCocycleWindow.basisZero) 0).re) + (hQdiag : ((Q ProjectionCocycleWindow.basisZero) 0).re ≤ 1 - 1 / (j : ℝ)) : + p.ε j ≤ ∑ n ∈ Finset.range (2 * p.K j + 1), + ‖FiniteWindow.convolution (p.K j) + (fun v => (P ProjectionCocycleWindow.basisZero) v / (p.floorCocycle θ v x : ℂ)) + (fun v => (p.floorCocycle θ (-v) y : ℂ) * + conj (((1 - Q) ProjectionCocycleWindow.basisZero) (-v))) n‖ := by + obtain ⟨hA, hB, hA0, hB0⟩ := hp.canonical_projection_coefficient_properties + j hj x y hleft hright P Q hP hQ (1 / (j : ℝ)) hPdiag hQdiag + exact hp.parameter_convolution_sum_lower j hj _ _ hA hB hA0 hB0 + +theorem canonical_raw_projection_convolution_lower (j : ℕ) (hj : 1 ≤ j) + (d e : MixedRadix.Digits (MixedRadix.radices p.q)) + (hd : MixedRadix.Nonterminal d) (he : MixedRadix.Nonterminal e) + (X Y : ℕ → ℝ) (hX : ∀ i, 0 ≤ X i) (hY : ∀ i, 0 ≤ Y i) + (hdigit : ∀ i, ⌊(MixedRadix.radices p.q i : ℝ) * X i⌋₊ = (d i : ℕ)) + (hedigit : ∀ i, ⌊(MixedRadix.radices p.q i : ℝ) * Y i⌋₊ = (e i : ℕ)) + (hcurrent : ∀ i ∈ p.block j, + X i < 1 - 3 / (p.m j : ℝ) ∧ 3 / (p.m j : ℝ) < Y i) + (hfuture : ∀ s, j < s → ∀ i ∈ p.block s, + X i < 1 - 3 * (p.K j : ℝ) / p.N s ∧ + 3 * (p.K j : ℝ) / p.N s < Y i) + (P Q : ℓ²(ℤ, ℂ) →L[ℂ] ℓ²(ℤ, ℂ)) + (hP : IsStarProjection P) (hQ : IsStarProjection Q) + (hPdiag : 1 / (j : ℝ) ≤ ((P ProjectionCocycleWindow.basisZero) 0).re) + (hQdiag : ((Q ProjectionCocycleWindow.basisZero) 0).re ≤ 1 - 1 / (j : ℝ)) : + p.ε j ≤ ∑ n ∈ Finset.range (2 * p.K j + 1), + ‖FiniteWindow.convolution (p.K j) + (fun v => (P ProjectionCocycleWindow.basisZero) v / + (p.floorCocycle θ v (MixedRadix.circleValue d) : ℂ)) + (fun v => (p.floorCocycle θ (-v) (MixedRadix.circleValue e) : ℂ) * + conj (((1 - Q) ProjectionCocycleWindow.basisZero) (-v))) n‖ := by + have hexcl := hp.source_good_event_exclusions j hj d e hd he X Y hX hY + hdigit hedigit hcurrent hfuture + exact hp.canonical_projection_convolution_lower j hj _ _ + (fun s hs i hi => (hexcl s hs i hi).1) + (fun s hs i hi => (hexcl s hs i hi).2) P Q hP hQ hPdiag hQdiag + +theorem canonical_projection_integral_lower + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] + (j : ℕ) (hj : 1 ≤ j) (E : Set Ω) (x y : Ω → Circle) + (hx : Measurable x) (hy : Measurable y) + (P Q : Ω → ℓ²(ℤ, ℂ) →L[ℂ] ℓ²(ℤ, ℂ)) + (hPm : StronglyMeasurable (fun ω => P ω ProjectionCocycleWindow.basisZero)) + (hQm : StronglyMeasurable (fun ω => Q ω ProjectionCocycleWindow.basisZero)) + (hP : ∀ ω, IsStarProjection (P ω)) (hQ : ∀ ω, IsStarProjection (Q ω)) + (hE : ∀ᵐ ω ∂μ.restrict E, + (∀ s, j ≤ s → ∀ i ∈ p.block s, + p.coordinate i (x ω) < 1 - 2 * (p.K j : ℝ) / p.N s) ∧ + (∀ s, j ≤ s → ∀ i ∈ p.block s, + 2 * (p.K j : ℝ) / p.N s < p.coordinate i (y ω)) ∧ + 1 / (j : ℝ) ≤ ((P ω ProjectionCocycleWindow.basisZero) 0).re ∧ + ((Q ω ProjectionCocycleWindow.basisZero) 0).re ≤ 1 - 1 / (j : ℝ)) : + p.ε j * μ.real E ≤ ∫ ω in E, ∑ n ∈ Finset.range (2 * p.K j + 1), + ‖FiniteWindow.convolution (p.K j) + (fun v => (P ω ProjectionCocycleWindow.basisZero) v / + (p.floorCocycle θ v (x ω) : ℂ)) + (fun v => (p.floorCocycle θ (-v) (y ω) : ℂ) * + conj (((1 - Q ω) ProjectionCocycleWindow.basisZero) (-v))) n‖ ∂μ := by + let A : Ω → ℤ → ℂ := fun ω v => + (P ω ProjectionCocycleWindow.basisZero) v / (p.floorCocycle θ v (x ω) : ℂ) + let B : Ω → ℤ → ℂ := fun ω v => + (p.floorCocycle θ (-v) (y ω) : ℂ) * + conj (((1 - Q ω) ProjectionCocycleWindow.basisZero) (-v)) + have hγ : StronglyMeasurable (fun ω => (1 - Q ω) ProjectionCocycleWindow.basisZero) := by + have hbase : StronglyMeasurable + ((fun _ : Ω => ProjectionCocycleWindow.basisZero) - + fun ω => Q ω ProjectionCocycleWindow.basisZero) := + stronglyMeasurable_const.sub hQm + convert hbase using 1 + funext ω + simp only [Pi.sub_apply, sub_apply, one_apply_eq_self] + have hA : ∀ v, Measurable (fun ω => A ω v) := by + intro v + exact ((lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 v).continuous.comp_stronglyMeasurable hPm).measurable.div + (Complex.continuous_ofReal.measurable.comp ((hp.measurable_parameter_cocycle v).comp hx)) + have hB : ∀ v, Measurable (fun ω => B ω v) := by + intro v + exact (Complex.continuous_ofReal.measurable.comp + ((hp.measurable_parameter_cocycle (-v)).comp hy)).mul + (Complex.continuous_conj.measurable.comp + ((lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 (-v)).continuous.comp_stronglyMeasurable hγ).measurable) + apply FiniteWindow.integral_lower_of_sum_bound μ (p.K j) + (p.coefficientBound j) (1 / (j : ℝ)) (p.ε j) + (hp.parameter_convolution_sum_lower j hj) E A B hA hB + filter_upwards [hE] with ω hω + exact hp.canonical_projection_coefficient_properties j hj (x ω) (y ω) + hω.1 hω.2.1 (P ω) (Q ω) (hP ω) (hQ ω) (1 / (j : ℝ)) + hω.2.2.1 hω.2.2.2 + +end Invariant233.CircleParameterLaws + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Rotation/ChoKoLeeCircleReduction.lean b/lean/OAI/Analysis/IrrationalRotation/Rotation/ChoKoLeeCircleReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..3853a54e6501450a5a09e942f5cb44974a921a1f --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Rotation/ChoKoLeeCircleReduction.lean @@ -0,0 +1,42 @@ +import OAI.Analysis.IrrationalRotation.Model.OperatorProperties +import OAI.Analysis.IrrationalRotation.Analysis.ChoKoLeeComparison +import OAI.Analysis.IrrationalRotation.Operators.HilbertConsequence +import OAI.Analysis.IrrationalRotation.Rotation.RotationAlgebra +import OAI.Analysis.IrrationalRotation.Spectral.RotationQuasinilpotent + +namespace OAI + +noncomputable section +namespace Invariant233 + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] [TopologicalSpace.SeparableSpace H] + +theorem cho_ko_lee_comparison_of_continuous_circle_obstruction + (hH : ¬ FiniteDimensional ℂ H) {θ : ℝ} (hθ : Irrational θ) + (f : C(Circle, ℝ)) (hf : IsContinuousCircleWeight f) + (hinv : HasOnlyTrivialInvariantProjections + (Rotation.algebra θ) (Rotation.weightedReal θ f)) : + ∃ Q : H →L[ℂ] H, Q ≠ 0 ∧ NormQuasinilpotent Q ∧ + HasNoNontrivialHyperinvariantSubspace Q ∧ + operatorCommutant Q ≠ ⊤ ∧ IsStronglyClosed (operatorCommutant Q) ∧ + IsTransitive (operatorCommutant Q) ∧ + operatorCommutant (1 + Q) = operatorCommutant Q ∧ + ∀ C : H → H, ∀ hC : IsConjugation C, + IsInfiniteConjugationIsometry hC.toHilbertConjugation (1 + Q) ∧ + HasNoNontrivialHyperinvariantSubspace (1 + Q) := by + obtain ⟨Q, hne, hQ, hhyper, hproper, hclosed, htrans⟩ := + transitive_commutant_of_circle_witness (F := H) hH (Rotation.algebra θ) + (Rotation.weightedReal_mem_algebra θ f) + (Rotation.weightedReal_ne_zero_of_isContinuousCircleWeight θ f hf) + (Rotation.weightedReal_normQuasinilpotent hθ f hf) hinv + refine ⟨Q, hne, hQ, hhyper, hproper, hclosed, htrans, + operatorCommutant_one_add Q, fun C hC => ?_⟩ + exact ⟨isInfiniteConjugationIsometry_one_add_of_isConjugation hC hQ, + (hasNoNontrivialHyperinvariantSubspace_one_add_iff Q).2 hhyper⟩ + +end Invariant233 + +end + +end OAI diff --git a/lean/OAI/Analysis/IrrationalRotation/Rotation/CircleBackgroundBumps.lean b/lean/OAI/Analysis/IrrationalRotation/Rotation/CircleBackgroundBumps.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb5f4e96d1ba7458eca7f24fd683cdd5e8af9ab0 --- /dev/null +++ b/lean/OAI/Analysis/IrrationalRotation/Rotation/CircleBackgroundBumps.lean @@ -0,0 +1,80 @@ +import OAI.Analysis.IrrationalRotation.Model.BackgroundData +import OAI.Analysis.IrrationalRotation.Analysis.BackgroundBumps +import OAI.Analysis.IrrationalRotation.Analysis.BackgroundCost + +namespace OAI + +noncomputable section +open MeasureTheory Set Filter +open scoped ENNReal Topology + +namespace Invariant233.BackgroundCost + +local instance circleBackgroundBumpsFactOnePos : Fact (0 < (1 : ℝ)) := ⟨by norm_num⟩ + +theorem circleMeasure_singleton (x : Circle) : circleMeasure {x} = 0 := by + change volume ({x} : Set (AddCircle (1 : ℝ))) = 0 + rw [← Metric.closedBall_zero, AddCircle.volume_closedBall] + norm_num + +theorem exists_backgroundBumpData (θ : ℝ) (hθ : Irrational θ) : + Nonempty (BackgroundBumpData θ) := by + classical + let : NullSingletonClass circleMeasure := ⟨circleMeasure_singleton⟩ + let : circleMeasure.OuterRegular := by + change (volume : Measure (AddCircle (1 : ℝ))).OuterRegular + infer_instance + have hinfinite : ¬ IsOfFinAddOrder (θ : Circle) := by + rw [AddCircle.isOfFinAddOrder_iff_exists_rat_eq_div] + rintro ⟨q, hq⟩ + exact hθ.ne_rat q (by simpa using hq.symm) + have hinj : Function.Injective (fun n : ℕ => n • (θ : Circle)) := + injective_nsmul_iff_not_isOfFinAddOrder.2 hinfinite + have hchoice (n : ℕ) := exists_bump_disjoint_images circleMeasure (0 : Circle) + (fun (i : Fin (2 ^ (n + 2))) (x : Circle) => x + ((i : ℕ) + 1) • (θ : Circle)) + (fun i => isometry_add_right _) (by + intro i j hij + apply Fin.ext + have he : (i : ℕ) + 1 = (j : ℕ) + 1 := hinj (by simpa using hij) + omega) + (R := 1 / ((n : ℝ) + 1)) (by positivity) + (ε := (1 / 2 : ℝ≥0∞) ^ (n + 2) / (2 : ℝ≥0∞) ^ (n + 2)) + (ENNReal.div_pos (pow_ne_zero _ (by simp)) (by finiteness)) + choose r v hr hcap hμ hv hva hbounds hsupp hdisj using hchoice + refine ⟨{ + radius := r + bump := v + radius_pos := hr + radius_lt := hcap + continuous_bump := hv + bump_zero := hva + bump_bounds := hbounds + bump_support := hsupp + disjoint_translates := hdisj + weighted_support_bound := ?_ }⟩ + have hterm (n : ℕ) : + (2 : ℝ≥0∞) ^ (n + 2) * circleMeasure (Metric.closedBall 0 (r n)) ≤ + (1 / 2 : ℝ≥0∞) ^ (n + 2) := by + calc + _ ≤ (2 : ℝ≥0∞) ^ (n + 2) * + ((1 / 2 : ℝ≥0∞) ^ (n + 2) / (2 : ℝ≥0∞) ^ (n + 2)) := + mul_le_mul_right (hμ n).le _ + _ = _ := ENNReal.mul_div_cancel (by positivity) (by finiteness) + calc + _ ≤ ∑' n : ℕ, (1 / 2 : ℝ≥0∞) ^ (n + 2) := ENNReal.tsum_le_tsum hterm + _ = 1 / 2 := by + simp_rw [pow_add] + rw [ENNReal.tsum_mul_right, ENNReal.tsum_geometric] + norm_num + rw [pow_two, ← mul_assoc, ENNReal.mul_inv_cancel (by norm_num) (by simp), one_mul] + +theorem BackgroundBumpData.radius_tendsto_zero {θ : ℝ} (d : BackgroundBumpData θ) : + Tendsto d.radius atTop (𝓝 0) := by + apply squeeze_zero (fun n => (d.radius_pos n).le) (fun n => (d.radius_lt n).le) + exact tendsto_one_div_add_atTop_nhds_zero_nat + +end Invariant233.BackgroundCost + +end + +end OAI